212 lines
9.8 KiB
TypeScript
212 lines
9.8 KiB
TypeScript
/* Metro module 14910; source: modules/quests/hooks/useHasNewAdContent.tsx; dependencies: [57, 13563, 7093, 6528, 672, 9511, 566, 7091, 7121, 7013, 1365, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import Durations from '../../../utils/Durations.tsx'; /* Metro dependency 672 */
|
|
import QuestStore from '../QuestStore.tsx'; /* Metro dependency 7093 */
|
|
import AdContentSeenStore from '../AdContentSeenStore.tsx'; /* Metro dependency 13563 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as QuestConstantsModule from '../QuestConstants.tsx'; /* Metro dependency 6528 */
|
|
import * as UseSelectedDismissibleContentModule from '../../dismissible_content/hooks/useSelectedDismissibleContent.tsx'; /* Metro dependency 7013 */
|
|
import * as ExperimentsModule from '../experiments/index.tsx'; /* Metro dependency 9511 */
|
|
|
|
function _fun112802(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#112802, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15107:6, offset: 0x023dcbee, size: 218 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_112805 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const Millis = (Durations).Millis;
|
|
const env0_6 = Millis.DAY;
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/quests/hooks/useHasNewAdContent.tsx');
|
|
exports.default = useHasNewAdContent;
|
|
function _createForOfIteratorHelperLoose_112803(a0, a1) { // fn#112803, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15107:167, offset: 0x023dccc8, size: 372 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun112804;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_112805(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_112805(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_112805(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun112804;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
function _fun112804() { // fn#112804, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15107:738, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
|
|
return env0_1 >= env0_0.length ? {done: true} : {done: false,
|
|
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
|
|
}
|
|
|
|
}
|
|
|
|
function useHasNewAdContent() { // fn#112806, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15107:1192, offset: 0x023dce3c, size: 307 bytes, params: 1, frame: 23
|
|
const MobileQuestHomeRedDotNotificationExperiment = (ExperimentsModule).MobileQuestHomeRedDotNotificationExperiment;
|
|
const useConfig = MobileQuestHomeRedDotNotificationExperiment.useConfig;
|
|
const YOU_TAB_PROFILE_HEADER = QuestsExperimentLocations.YOU_TAB_PROFILE_HEADER;
|
|
const enabled = Reflect.apply(useConfig, MobileQuestHomeRedDotNotificationExperiment,
|
|
[{location: YOU_TAB_PROFILE_HEADER}]).enabled;
|
|
const value3 = (FluxModule).useStateFromStores([AdContentSeenStore], _fun112810,
|
|
[(FluxModule).useStateFromStoresArray([QuestStore], _fun112807, [enabled])]);
|
|
const useSelectedTimeRecurringDismissibleContent = UseSelectedDismissibleContentModule.useSelectedTimeRecurringDismissibleContent;
|
|
const value4 = null;
|
|
const QUEST_HOME_NEW_QUEST_BADGE = value3 && enabled ? (require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent.QUEST_HOME_NEW_QUEST_BADGE : value4;
|
|
const value = Module00057(Reflect.apply(useSelectedTimeRecurringDismissibleContent, UseSelectedDismissibleContentModule,
|
|
[QUEST_HOME_NEW_QUEST_BADGE, {cooldownDurationMs: DAY}, undefined, true]), 2);
|
|
return {showBadge: value4 != value[0], dismissBadge: value[1]};
|
|
function _fun112807() { // fn#112807, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15107:1376, offset: 0x023dcf6f, size: 94 bytes, params: 1, frame: 14
|
|
var environment;
|
|
var r0;
|
|
var Array;
|
|
var from;
|
|
var quests;
|
|
var value;
|
|
if (enabled) {
|
|
Array = global.Array;
|
|
from = Array.from;
|
|
value = environment.__proto__;
|
|
quests = QuestStore.quests;
|
|
value = Reflect.apply(from, Array, [quests.values()]);
|
|
value = value.filter(_fun112808);
|
|
value = value.map(function(a0) {
|
|
return a0.id;
|
|
});
|
|
r0 = value;
|
|
} else {
|
|
r0 = [];
|
|
}
|
|
return r0;
|
|
function _fun112808(a0) { // fn#112808, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15107:1420, offset: 0x023dcfcd, size: 44 bytes, params: 2, frame: 11
|
|
let value = environment.__proto__.__proto__;
|
|
value = require(7091) /* metro dependency 7091: QuestDataUtils */;
|
|
return !value.isQuestExpired(a0);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun112810() { // fn#112810, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15107:1512, offset: 0x023dcff9, size: 112 bytes, params: 1, frame: 19
|
|
var value5;
|
|
var adContentSeenStoreBinding;
|
|
var hasSeen;
|
|
var AdCreativeType;
|
|
var QUEST;
|
|
var value6;
|
|
const value3 = _createForOfIteratorHelperLoose_112803(env0_1);
|
|
const value4 = value3();
|
|
let done = value4.done;
|
|
if (done) {
|
|
return false;
|
|
}
|
|
let r1 = value4;
|
|
loopExit1: while (true) {
|
|
value5 = r1.value;
|
|
adContentSeenStoreBinding = AdContentSeenStore;
|
|
hasSeen = adContentSeenStoreBinding.hasSeen;
|
|
AdCreativeType = (require(7121) /* metro dependency 7121: AdCreativeType */).AdCreativeType;
|
|
QUEST = AdCreativeType.QUEST;
|
|
if (Reflect.apply(hasSeen, adContentSeenStoreBinding, [QUEST, value5])) {
|
|
value6 = value3();
|
|
done = value6.done;
|
|
if (done) {
|
|
return false;
|
|
}
|
|
r1 = value6;
|
|
continue;
|
|
}
|
|
break loopExit1;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun112802, 14910, [57, 13563, 7093, 6528, 672, 9511, 566, 7091, 7121, 7013, 1365,
|
|
2]) /* metro module 14910, dependencies: [57, 13563, 7093, 6528, 672, 9511, 566, 7091, 7121, 7013, 1365, 2] */;
|