/* Metro module 14608; source: modules/premium/powerups/GuildPowerupsNotificationStore.tsx; dependencies: [6, 7, 15, 17, 18, 1867, 8255, 8258, 14609, 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 Flux from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */ import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */ import GameServerStore from '../game_server/GameServerStore.tsx'; /* Metro dependency 8255 */ import GuildPowerupsStore from './GuildPowerupsStore.tsx'; /* Metro dependency 8258 */ import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as GetExpiringGuildEntitlementsModule from './utils/getExpiringGuildEntitlements.tsx'; /* Metro dependency 14609 */ 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}); let env0_10 = {}; const PersistedStore = (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 = {}; }}); (FileImportTrackerModule).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 GuildPowerupsNotificationStore2 = GuildPowerupsNotificationStore; Inherits(GuildPowerupsNotificationStore2, a0); return CreateClass(GuildPowerupsNotificationStore2, [{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 GuildPowerupsNotificationStore() { // fn#110470, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14805:398, offset: 0x00ff71a7, size: 113 bytes, params: 1, frame: 20 const value = environment.__proto__; env1_2(this, GuildPowerupsNotificationStore); const value3 = env1_5(GuildPowerupsNotificationStore); return env1_4(this, _isNativeReflectConstruct_110466() ? global.Reflect.construct(value3, arguments, env1_5(this).constructor) : value3.apply(this, arguments)); } function value_110471() { // fn#110471, offset: 0x00fbd9ec, size: 9 bytes, params: 1, frame: 1 return env1_10; } function value_110473(a0) { // fn#110473, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14805:901, offset: 0x010353e1, size: 16 bytes, params: 2, frame: 2 return env1_10[a0]; } } 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 _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; } } 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 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 object3 = {}; 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(); object3.lastSeenWarningNotification = (date instanceof Object ? date : value13).getTime(); object3.lastBoostCount = r5; object[guildId] = object3; } } global.__d(_fun110465, 14608, [6, 7, 15, 17, 18, 1867, 8255, 8258, 14609, 566, 694, 2]) /* metro module 14608, dependencies: [6, 7, 15, 17, 18, 1867, 8255, 8258, 14609, 566, 694, 2] */;