152 lines
6.7 KiB
TypeScript
152 lines
6.7 KiB
TypeScript
/* Metro module 14608; source: modules/premium/powerups/GuildPowerupsNotificationStore.tsx; dependencies: [6, 7, 15, 17, 18, 1867, 8255, 8258, 14609, 566, 694, 2] */
|
|
function _fun110465(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#110465, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14805:6, offset: 0x0237abaa, size: 370 bytes, params: 8, frame: 19
|
|
let env0_0 = require;
|
|
let Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_3 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_4 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_5 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_6 = importDefault(18) /* metro dependency 18 */;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const gameServerStore = importDefault(8255) /* metro dependency 8255: GameServerStore */;
|
|
const guildPowerupsStore = importDefault(8258) /* metro dependency 8258: GuildPowerupsStore */;
|
|
let env0_10 = {};
|
|
const PersistedStore = (importDefault(566) /* metro dependency 566: flux */).PersistedStore;
|
|
let value = _fun110469(PersistedStore);
|
|
value.displayName = 'GuildPowerupsNotificationStore';
|
|
value.persistKey = 'GuildPowerupsNotificationStore';
|
|
value.migrations = [function(a0) {
|
|
var env0_0 = a0;
|
|
var Object = global.Object;
|
|
Object.entries(a0).forEach(_fun110475);
|
|
return a0;
|
|
}];
|
|
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
|
|
{GUILD_POWERUPS_ACK_NOTIFICATION: GUILD_POWERUPS_ACK_NOTIFICATION,
|
|
GUILD_POWERUPS_RESET_NOTIFICATIONS: function() {
|
|
env0_10 = {};
|
|
}});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/powerups/GuildPowerupsNotificationStore.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_110466() { // fn#110466, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14805:178, offset: 0x0237ad1c, 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_110466_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun110469(a0) { // fn#110469, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14805:386, offset: 0x0237ad7e, size: 124 bytes, params: 2, frame: 16
|
|
const closure = GuildPowerupsNotificationStore;
|
|
env0_6(closure, a0);
|
|
return env0_3(closure, [{key: 'getState', value: value_110471}, {key: 'initialize', value: function(a0) {
|
|
this.waitFor(GameServerStore, GuildPowerupsStore, GuildStore);
|
|
if (a0 != null) {
|
|
env1_10 = a0;
|
|
}
|
|
}}, {key: 'getNotificationStateForGuild', value: value_110473}]);
|
|
}
|
|
|
|
function _fun110474(a0) { // fn#110474, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14805:1061, offset: 0x0237ae2a, size: 47 bytes, params: 2, frame: 12
|
|
const env0_0 = a0;
|
|
const Object = global.Object;
|
|
Object.entries(a0).forEach(_fun110475);
|
|
return a0;
|
|
}
|
|
|
|
function GUILD_POWERUPS_ACK_NOTIFICATION({guildId}) { // fn#110476, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14805:1170, offset: 0x0237aea5, size: 342 bytes, params: 2, frame: 25
|
|
const r5 = GuildStore.getGuild(guildId)?.premiumSubscriberCount ?? 0;
|
|
const stateForGuild = GuildPowerupsStore.getStateForGuild(guildId);
|
|
const stateForGuild2 = GameServerStore.getStateForGuild(guildId);
|
|
const getExpiringGuildEntitlementsModule = require(14609) /* metro dependency 14609: getExpiringGuildEntitlements */;
|
|
const getExpiringGuildEntitlements = getExpiringGuildEntitlementsModule.getExpiringGuildEntitlements;
|
|
let Object = global.Object;
|
|
let values = Object.values;
|
|
const value7 = stateForGuild == null;
|
|
const value8 = Reflect.apply(values, Object, [(value7 ? undefined : stateForGuild.unlockedPowerups) ?? ({})]);
|
|
let object = [];
|
|
const value9 = arraySpread(object, value8, 0, value7);
|
|
Object = global.Object;
|
|
values = Object.values;
|
|
const value10 = stateForGuild2 == null;
|
|
arraySpread(object, Reflect.apply(values, Object, [(value10 ? undefined : stateForGuild2.entitlements) ?? ({})]),
|
|
value9, value10);
|
|
const value11 = Reflect.apply(getExpiringGuildEntitlements, getExpiringGuildEntitlementsModule, [object]);
|
|
object = {};
|
|
copyDataProperties(object, env0_10, value9);
|
|
const object2 = {};
|
|
const Date = global.Date;
|
|
const r6 = value11[value11.length - 1]?.ends_at ?? global.Date.now();
|
|
const value13 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
const date = new Date();
|
|
object2.lastSeenWarningNotification = (date instanceof Object ? date : value13).getTime();
|
|
object2.lastBoostCount = r5;
|
|
object[guildId] = object2;
|
|
}
|
|
|
|
function _fun110475(a0) { // fn#110475, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14805:1092, offset: 0x0237ae59, size: 76 bytes, params: 2, frame: 8
|
|
var r1;
|
|
var r2;
|
|
var r4;
|
|
var item3;
|
|
var value3;
|
|
const iterator = a0[Symbol.iterator]();
|
|
const iterator2 = iterator.next;
|
|
let item2 = Reflect.apply(iterator2, iterator, []);
|
|
let item = item2.value;
|
|
item2 = item2.done ? undefined : iterator;
|
|
const value = undefined;
|
|
const value2 = item2 === value;
|
|
const r3 = value2 ? value : item;
|
|
if (value2) {
|
|
r1 = item2;
|
|
r2 = value;
|
|
r4 = value2;
|
|
} else {
|
|
item3 = Reflect.apply(iterator2, item2, []);
|
|
item = item3.value;
|
|
item3 = item3.done ? undefined : item2;
|
|
value3 = item3 === value;
|
|
if (value3) {
|
|
r1 = item3;
|
|
r2 = value;
|
|
r4 = value3;
|
|
} else {
|
|
r1 = item3;
|
|
r2 = item;
|
|
r4 = value3;
|
|
}
|
|
}
|
|
if (!r4) {
|
|
r1.return();
|
|
}
|
|
env0_0[r3] = r2;
|
|
return value;
|
|
}
|
|
|