601 lines
22 KiB
TypeScript
601 lines
22 KiB
TypeScript
/* Metro module 13563; source: modules/quests/AdContentSeenStore.tsx; dependencies: [6, 7, 15, 17, 18, 57, 7093, 7121, 7091, 566, 694, 2] */
|
|
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import QuestStore from './QuestStore.tsx'; /* Metro dependency 7093 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as AdCreativeTypeModule from '../../external/discord_common/js/shared/shared-constants/AdCreativeType.tsx'; /* Metro dependency 7121 */
|
|
|
|
function _fun103049(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#103049, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13753:6, offset: 0x022555eb, size: 401 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_103055 = 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 Map = global.Map;
|
|
let map = new Map();
|
|
const PersistedStore = (Flux).PersistedStore;
|
|
map = _fun103058(PersistedStore);
|
|
map.displayName = 'AdContentSeenStore';
|
|
map.persistKey = 'AdContentSeenStore';
|
|
map = new map(importDefault(694) /* metro dependency 694: Dispatcher */,
|
|
{AD_CONTENT_MARK_SEEN: AD_CONTENT_MARK_SEEN, AD_CONTENT_MARK_UNSEEN: AD_CONTENT_MARK_UNSEEN});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/quests/AdContentSeenStore.tsx');
|
|
exports.default = map;
|
|
function _isNativeReflectConstruct_103050() { // fn#103050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13753:170, offset: 0x0225577c, size: 98 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_103050_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_103053(a0, a1) { // fn#103053, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13753:363, offset: 0x022557de, 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 _fun103054;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_103055(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_103055(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_103055(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun103054;
|
|
}
|
|
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 _fun103054() { // fn#103054, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13753:934, 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 getOrCreateSet(a0) { // fn#103056, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13753:1287, offset: 0x02255952, size: 74 bytes, params: 2, frame: 14
|
|
var r0;
|
|
var set;
|
|
const value2 = env0_9.get(a0);
|
|
if (value2 != null) {
|
|
r0 = value2;
|
|
} else {
|
|
set = new global.Set();
|
|
env0_9.set(a0, set);
|
|
r0 = set;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function syncWithQuestStore() { // fn#103057, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13753:1370, offset: 0x0225599c, size: 588 bytes, params: 1, frame: 31
|
|
var r2;
|
|
var r6;
|
|
var r0;
|
|
var r20;
|
|
var r19;
|
|
var r14;
|
|
var r4;
|
|
var r10;
|
|
var r3;
|
|
var r1;
|
|
var value6;
|
|
var value7;
|
|
var property;
|
|
var property2;
|
|
var value8;
|
|
var moduleValue;
|
|
var isQuestExpired2;
|
|
var userStatus;
|
|
var value9;
|
|
var enrolledAt;
|
|
var value10;
|
|
var completedAt;
|
|
var value11;
|
|
var claimedAt;
|
|
var value12;
|
|
var dismissedQuestContent;
|
|
var value13;
|
|
var value14;
|
|
var value15;
|
|
var value16;
|
|
var value17;
|
|
var value18;
|
|
var value19;
|
|
var value20;
|
|
var moduleValue2;
|
|
var isQuestExpired3;
|
|
var value21;
|
|
var value22;
|
|
var questHomeHero;
|
|
var value25;
|
|
var value26;
|
|
var value27;
|
|
var id;
|
|
var value28;
|
|
var value29;
|
|
var value30;
|
|
var value;
|
|
const quests = QuestStore.quests;
|
|
let getOrCreateSetBinding = getOrCreateSet;
|
|
const AdCreativeType = (AdCreativeTypeModule).AdCreativeType;
|
|
const QUEST = AdCreativeType.QUEST;
|
|
const orCreateSetBinding = getOrCreateSetBinding(QUEST);
|
|
const value3 = _createForOfIteratorHelperLoose_103053(quests);
|
|
const value4 = value3();
|
|
let done = value4.done;
|
|
const value5 = false;
|
|
if (done) {
|
|
r14 = value5;
|
|
} else {
|
|
r2 = value5;
|
|
r6 = value4;
|
|
while (true) {
|
|
value6 = r6.value;
|
|
value7 = Module00057(value6, 2);
|
|
property = value7[0];
|
|
property2 = value7[1];
|
|
value8 = orCreateSetBinding.has(property);
|
|
if (value8) {
|
|
r0 = value8;
|
|
} else {
|
|
moduleValue = require(7091) /* metro dependency 7091: QuestDataUtils */;
|
|
isQuestExpired2 = moduleValue.isQuestExpired(property2);
|
|
r0 = isQuestExpired2;
|
|
}
|
|
if (r0) {
|
|
continue;
|
|
}
|
|
userStatus = property2.userStatus;
|
|
value9 = userStatus == null;
|
|
if (value9) {
|
|
r19 = value9;
|
|
continue;
|
|
}
|
|
enrolledAt = userStatus.enrolledAt;
|
|
value10 = enrolledAt == null;
|
|
if (!value10) {
|
|
r20 = value10;
|
|
continue;
|
|
}
|
|
completedAt = userStatus.completedAt;
|
|
value11 = completedAt == null;
|
|
r20 = value11;
|
|
if (!r20) {
|
|
continue;
|
|
}
|
|
claimedAt = userStatus.claimedAt;
|
|
value12 = claimedAt == null;
|
|
r20 = value12;
|
|
if (!r20) {
|
|
continue;
|
|
}
|
|
dismissedQuestContent = userStatus.dismissedQuestContent;
|
|
value13 = dismissedQuestContent === 0;
|
|
r20 = value13;
|
|
r19 = r20;
|
|
r0 = r19;
|
|
if (r0) {
|
|
continue;
|
|
}
|
|
orCreateSetBinding.add(property);
|
|
value14 = true;
|
|
r2 = value14;
|
|
value15 = value3();
|
|
done = value15.done;
|
|
if (done) {
|
|
r14 = r2;
|
|
break;
|
|
}
|
|
r6 = value15;
|
|
continue;
|
|
}
|
|
}
|
|
if (QuestStore.lastFetchedCurrentQuests === 0) {
|
|
r10 = r14;
|
|
} else if (quests.size > 0) {
|
|
value16 = _createForOfIteratorHelperLoose_103053(orCreateSetBinding);
|
|
value17 = value16();
|
|
done = value17.done;
|
|
if (done) {
|
|
r10 = r14;
|
|
} else {
|
|
r2 = value17;
|
|
r4 = r14;
|
|
while (true) {
|
|
value18 = r2.value;
|
|
value19 = quests.get(value18);
|
|
value20 = value19 == null;
|
|
if (value20) {
|
|
r0 = value20;
|
|
} else {
|
|
moduleValue2 = require(7091) /* metro dependency 7091: QuestDataUtils */;
|
|
isQuestExpired3 = moduleValue2.isQuestExpired(value19);
|
|
r0 = isQuestExpired3;
|
|
}
|
|
if (!r0) {
|
|
continue;
|
|
}
|
|
orCreateSetBinding.delete(value18);
|
|
value21 = true;
|
|
r4 = value21;
|
|
value22 = value16();
|
|
done = value22.done;
|
|
if (done) {
|
|
r10 = r4;
|
|
break;
|
|
}
|
|
r2 = value22;
|
|
continue;
|
|
}
|
|
}
|
|
} else {
|
|
r10 = r14;
|
|
}
|
|
getOrCreateSetBinding = getOrCreateSet;
|
|
const QUEST_HOME_HERO = AdCreativeType.QUEST_HOME_HERO;
|
|
const orCreateSetBinding2 = getOrCreateSetBinding(QUEST_HOME_HERO);
|
|
questStoreBinding = QuestStore;
|
|
const getLastFetchedQuestHomeHero = questStoreBinding.getLastFetchedQuestHomeHero;
|
|
if (Reflect.apply(getLastFetchedQuestHomeHero, questStoreBinding, []) == null) {
|
|
r0 = r10;
|
|
} else if (orCreateSetBinding2.size > 0) {
|
|
questHomeHero = QuestStore.getQuestHomeHero();
|
|
value = _createForOfIteratorHelperLoose_103053(orCreateSetBinding2);
|
|
value25 = value();
|
|
done = value25.done;
|
|
if (done) {
|
|
r0 = r10;
|
|
} else {
|
|
r2 = value25;
|
|
r3 = r10;
|
|
while (true) {
|
|
value26 = r2.value;
|
|
value27 = questHomeHero != null;
|
|
if (value27) {
|
|
id = questHomeHero.id;
|
|
value28 = value26 === id;
|
|
r1 = value28;
|
|
} else {
|
|
r1 = value27;
|
|
}
|
|
if (r1) {
|
|
continue;
|
|
}
|
|
orCreateSetBinding2.delete(value26);
|
|
value29 = true;
|
|
r3 = value29;
|
|
value30 = value();
|
|
done = value30.done;
|
|
if (done) {
|
|
r0 = r3;
|
|
break;
|
|
}
|
|
r2 = value30;
|
|
continue;
|
|
}
|
|
}
|
|
} else {
|
|
r0 = r10;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun103058(a0) { // fn#103058, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13753:2191, offset: 0x02255be8, size: 122 bytes, params: 2, frame: 16
|
|
const AdContentSeenStore2 = AdContentSeenStore;
|
|
Inherits(AdContentSeenStore2, a0);
|
|
return CreateClass(AdContentSeenStore2, [{key: 'initialize', value: value_103060}, {key: 'getState',
|
|
value: value_103061}, {key: 'hasSeen', value: value_103062}]);
|
|
function AdContentSeenStore() { // fn#103059, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13753:2203, offset: 0x00ec62ac, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_2(this, AdContentSeenStore);
|
|
const value3 = env1_5(AdContentSeenStore);
|
|
return env1_4(this, _isNativeReflectConstruct_103050() ? global.Reflect.construct(value3, arguments,
|
|
env1_5(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_103060(a0) { // fn#103060, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13753:2511, offset: 0x02255c62, size: 233 bytes, params: 2, frame: 24
|
|
var r2;
|
|
var Object;
|
|
var entries;
|
|
var seenContentIds;
|
|
var value4;
|
|
var length;
|
|
var value5;
|
|
var property;
|
|
var value6;
|
|
var property2;
|
|
var binding;
|
|
var set;
|
|
var Number;
|
|
var value7;
|
|
var Set;
|
|
var value8;
|
|
var set2;
|
|
var value9;
|
|
var value10;
|
|
this.waitFor(QuestStore);
|
|
const Map = global.Map;
|
|
let prototype = Map.prototype;
|
|
const value2 = Object.create(prototype, {constructor: {value: Map}});
|
|
const map = new Map();
|
|
reducibleJoin3: while (true) {
|
|
if (a0 == null) {
|
|
break reducibleJoin3;
|
|
}
|
|
Object = global.Object;
|
|
entries = Object.entries;
|
|
seenContentIds = a0.seenContentIds;
|
|
value4 = Reflect.apply(entries, Object, [seenContentIds]);
|
|
length = value4.length;
|
|
value5 = 0;
|
|
if (!(value5 < length)) {
|
|
break reducibleJoin3;
|
|
}
|
|
r2 = value5;
|
|
reducibleLoop2: while (true) {
|
|
property = value4[r2];
|
|
value6 = env1_7(property, 2);
|
|
property = value6[value5];
|
|
property2 = value6[1];
|
|
binding = map instanceof Object ? map : value2;
|
|
set = binding.set;
|
|
Number = global.Number;
|
|
value7 = Number(property);
|
|
Set = global.Set;
|
|
prototype = Set.prototype;
|
|
value8 = Object.create(prototype, {constructor: {value: Set}});
|
|
set2 = new Set();
|
|
value9 = set2 instanceof Object ? set2 : value8;
|
|
Reflect.apply(set, binding, [value7, value9]);
|
|
value10 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
length = value4.length;
|
|
if (value10 < length) {
|
|
r2 = value10;
|
|
continue reducibleLoop2;
|
|
}
|
|
break reducibleJoin3;
|
|
}
|
|
}
|
|
this.syncWith([QuestStore], syncWithQuestStore);
|
|
}
|
|
|
|
function value_103061() { // fn#103061, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13753:2747, offset: 0x02255d4b, size: 109 bytes, params: 1, frame: 22
|
|
var r2;
|
|
var value4;
|
|
var value5;
|
|
var property;
|
|
var property2;
|
|
var Array;
|
|
var from;
|
|
var value6;
|
|
const object = {};
|
|
const value2 = _createForOfIteratorHelperLoose_103053(env1_9);
|
|
const value3 = value2();
|
|
let done = value3.done;
|
|
if (!done) {
|
|
for (r2 = value3; true; r2 = value6) {
|
|
value4 = r2.value;
|
|
value5 = env1_7(value4, 2);
|
|
property = value5[0];
|
|
property2 = value5[1];
|
|
Array = global.Array;
|
|
from = Array.from;
|
|
object[property] = Reflect.apply(from, Array, [property2]);
|
|
value6 = value2();
|
|
done = value6.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
return {seenContentIds: object};
|
|
}
|
|
|
|
function value_103062(a0, a1) { // fn#103062, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13753:2930, offset: 0x02255db8, size: 56 bytes, params: 3, frame: 13
|
|
var r1;
|
|
let value = environment.__proto__;
|
|
value = env1_9.get(a0);
|
|
if (value == null) {
|
|
r1 = undefined;
|
|
} else {
|
|
value = value.has(a1);
|
|
r1 = value;
|
|
}
|
|
return r1 != null && r1;
|
|
}
|
|
|
|
}
|
|
|
|
function AD_CONTENT_MARK_SEEN({adCreativeType, contentIds}) { // fn#103063, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13753:3148, offset: 0x02255df0, size: 107 bytes, params: 2, frame: 18
|
|
var r2;
|
|
var r3;
|
|
var r0;
|
|
var value5;
|
|
var has;
|
|
var value6;
|
|
var value7;
|
|
const orCreateSet = getOrCreateSet(adCreativeType);
|
|
const value = _createForOfIteratorHelperLoose_103053(contentIds);
|
|
const value3 = value();
|
|
let done = value3.done;
|
|
if (done) {
|
|
r0 = false;
|
|
} else {
|
|
r2 = false;
|
|
r3 = value3;
|
|
while (true) {
|
|
value5 = r3.value;
|
|
has = orCreateSet.has;
|
|
if (!Reflect.apply(has, orCreateSet, [value5])) {
|
|
orCreateSet.add(value5);
|
|
value6 = true;
|
|
r2 = value6;
|
|
}
|
|
value7 = value();
|
|
done = value7.done;
|
|
if (done) {
|
|
r0 = r2;
|
|
break;
|
|
}
|
|
r3 = value7;
|
|
continue;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function AD_CONTENT_MARK_UNSEEN({adCreativeType, contentIds}) { // fn#103064, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13753:3362, offset: 0x02255e5b, size: 122 bytes, params: 2, frame: 18
|
|
var r2;
|
|
var r3;
|
|
var r0;
|
|
var value5;
|
|
var has;
|
|
var value6;
|
|
var value7;
|
|
const value2 = env0_9.get(adCreativeType);
|
|
if (value2 == null) {
|
|
return false;
|
|
}
|
|
const value = _createForOfIteratorHelperLoose_103053(contentIds);
|
|
const value3 = value();
|
|
let done = value3.done;
|
|
if (done) {
|
|
r0 = false;
|
|
} else {
|
|
r2 = false;
|
|
r3 = value3;
|
|
while (true) {
|
|
value5 = r3.value;
|
|
has = value2.has;
|
|
if (Reflect.apply(has, value2, [value5])) {
|
|
value2.delete(value5);
|
|
value6 = true;
|
|
r2 = value6;
|
|
}
|
|
value7 = value();
|
|
done = value7.done;
|
|
if (done) {
|
|
r0 = r2;
|
|
break;
|
|
}
|
|
r3 = value7;
|
|
continue;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun103049, 13563, [6, 7, 15, 17, 18, 57, 7093, 7121, 7091, 566, 694,
|
|
2]) /* metro module 13563, dependencies: [6, 7, 15, 17, 18, 57, 7093, 7121, 7091, 566, 694, 2] */;
|