/* Metro module 10906; source: modules/guild_antiraid/GuildIncidentsStore.tsx; dependencies: [6, 7, 15, 17, 18, 4107, 1348, 1867, 3784, 8275, 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 UserSettingsProtoStore from '../user_settings/UserSettingsProtoStore.tsx'; /* Metro dependency 1348 */ import GuildStore from '../../stores/GuildStore.tsx'; /* Metro dependency 1867 */ import PermissionStore from '../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */ import ExperimentStore from '../experiments/ExperimentStore.tsx'; /* Metro dependency 4107 */ import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ function _fun83526(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#83526, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11092:6, offset: 0x01f1dda1, size: 441 bytes, params: 8, frame: 19 const env0_0 = require; const _arrayLikeToArray_83532 = 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 incidentsDataFromServer = function(a0) { var r0; var property; var value = null; if (value != a0) { property = global.Object; property = property.keys(a0).length; r0 = property > 0 ? {raidDetectedAt: a0.raid_detected_at, dmSpamDetectedAt: a0.dm_spam_detected_at, dmsDisabledUntil: a0.dms_disabled_until, invitesDisabledUntil: a0.invites_disabled_until, lockdownDurationHours: a0.lockdown_duration_hours} : value; } else { r0 = value; } return r0; }; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let env0_11 = {}; const env0_12 = {}; const Store = (Flux).Store; let value = _fun83535(Store); value.displayName = 'GuildIncidentsStore'; value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: CONNECTION_OPEN_83541, GUILD_CREATE: GUILD_CREATE_83542, GUILD_UPDATE: GUILD_UPDATE_83543, GUILD_DELETE: GUILD_DELETE_83544, LOGOUT: function() { env0_11 = {}; }}); (FileImportTrackerModule).fileFinishedImporting('modules/guild_antiraid/GuildIncidentsStore.tsx'); exports.default = value; function _isNativeReflectConstruct_83527() { // fn#83527, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11092:190, offset: 0x01f1df5a, 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_83527_isNativeReflectConstruct = function() { return !!result; })(); } function _createForOfIteratorHelperLoose_83530(a0, a1) { // fn#83530, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11092:383, offset: 0x01f1dfbc, 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 _fun83531; } value = undefined; if (a0) { if (typeof a0 === 'string') { value = _arrayLikeToArray_83532(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_83532(a0, value); r6 = value; } else { regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', ''); if (regexp.test(r9)) { value = _arrayLikeToArray_83532(a0, value); r6 = value; } else { r6 = value; } } r5 = r6; } } else { r5 = value; } if (r5) { if (r5) { } return _fun83531; } 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 _fun83531() { // fn#83531, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11092:954, 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 computeAlertSettings() { // fn#83533, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11092:1307, offset: 0x01f1e130, size: 140 bytes, params: 1, frame: 19 var object4; var r4; var r2; var object; var value6; var binding; var id; var id2; var name; var id3; var value7; const guildsProto = UserSettingsProtoStore.getGuildsProto(); reducibleJoin2: while (true) { if (guildsProto != null) { r4 = guildsProto; break reducibleJoin2; } r4 = {}; break reducibleJoin2; } const guildsArray = GuildStore.getGuildsArray(); object4 = {}; const value4 = _createForOfIteratorHelperLoose_83530(guildsArray); const value5 = value4(); let done = value5.done; if (!done) { r2 = value5; reducibleLoop3: while (true) { value6 = r2.value; binding = object4; id = value6.id; object = {}; id2 = value6.id; object.guildId = id2; name = value6.name; object.guildName = name; id3 = value6.id; copyDataProperties(object, r4[id3], name); binding[id] = object; value7 = value4(); done = value7.done; if (done) { break reducibleLoop3; } r2 = value7; continue reducibleLoop3; } } } function _fun83535(a0) { // fn#83535, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11092:1830, offset: 0x01f1e22e, size: 147 bytes, params: 2, frame: 16 const GuildIncidentsStore2 = GuildIncidentsStore; Inherits(GuildIncidentsStore2, a0); return CreateClass(GuildIncidentsStore2, [{key: 'initialize', value: function() { var userSettingsProtoStoreBinding = UserSettingsProtoStore; var guildStoreBinding = GuildStore; var permissionStoreBinding = PermissionStore; var experimentStoreBinding = ExperimentStore; this.waitFor(userSettingsProtoStoreBinding, guildStoreBinding, permissionStoreBinding, experimentStoreBinding); this.syncWith([UserSettingsProtoStore, GuildStore, permissionStoreBinding, experimentStoreBinding], computeAlertSettings); }}, {key: 'getGuildIncident', value: value_83538}, {key: 'getIncidentsByGuild', value: value_83539}, {key: 'getGuildAlertSettings', value: value_83540}]); function GuildIncidentsStore() { // fn#83536, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11092:1842, offset: 0x00ea76ec, size: 113 bytes, params: 1, frame: 20 const value = environment.__proto__; env1_2(this, GuildIncidentsStore); const value3 = env1_5(GuildIncidentsStore); return env1_4(this, _isNativeReflectConstruct_83527() ? global.Reflect.construct(value3, arguments, env1_5(this).constructor) : value3.apply(this, arguments)); } function value_83538(a0) { // fn#83538, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11092:2266, offset: 0x0108d3ec, size: 16 bytes, params: 2, frame: 2 return env1_11[a0]; } function value_83539() { // fn#83539, offset: 0x00ef8482, size: 9 bytes, params: 1, frame: 1 return env1_11; } function value_83540() { // fn#83540, offset: 0x00e2f9de, size: 9 bytes, params: 1, frame: 1 return env1_12; } } function CONNECTION_OPEN_83541({guilds}) { // fn#83541, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11092:2497, offset: 0x01f1e31a, size: 189 bytes, params: 2, frame: 20 var object2; var r2; var incidents_data; var r9; var r7; var value5; var incidentsDataFromServerBinding; var properties; var value6; var value7; var moduleValue; var hasDetectedActivity2; var moduleValue2; var isUnderLockdown2; var binding; var id; var value8; object2 = {}; const value3 = _createForOfIteratorHelperLoose_83530(guilds); const value4 = value3(); let done = value4.done; if (!done) { r2 = value4; while (true) { value5 = r2.value; incidentsDataFromServerBinding = incidentsDataFromServer; properties = value5.properties; incidents_data = properties?.incidents_data; value6 = incidentsDataFromServerBinding(incidents_data); value7 = value6 != null; if (!value7) { r7 = value7; continue; } moduleValue = require(8275) /* metro dependency 8275: GuildAntiRaidUtils */; hasDetectedActivity2 = moduleValue.hasDetectedActivity(value6); if (hasDetectedActivity2) { r9 = hasDetectedActivity2; continue; } moduleValue2 = require(8275) /* metro dependency 8275: GuildAntiRaidUtils */; isUnderLockdown2 = moduleValue2.isUnderLockdown(value6); r9 = isUnderLockdown2; r7 = r9; if (!r7) { continue; } binding = object2; id = value5.id; binding[id] = value6; value8 = value3(); done = value8.done; if (done) { break; } r2 = value8; continue; } } } function GUILD_CREATE_83542({guild}) { // fn#83542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11092:2795, offset: 0x01f1e3d7, size: 135 bytes, params: 2, frame: 17 const value3 = incidentsDataFromServer(guild.properties?.incidents_data); if (value3 != null && ((require(8275) /* metro dependency 8275: GuildAntiRaidUtils */).hasDetectedActivity(value3) || (require(8275) /* metro dependency 8275: GuildAntiRaidUtils */).isUnderLockdown(value3))) { env0_11[guild.id] = value3; } } function GUILD_UPDATE_83543({guild}) { // fn#83543, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11092:3012, offset: 0x01f1e45e, size: 129 bytes, params: 2, frame: 15 var moduleValue; var moduleValue2; const value2 = incidentsDataFromServer(guild.incidents_data); if (value2 == null) { delete env0_11[guild.id]; } else { moduleValue = require(8275) /* metro dependency 8275: GuildAntiRaidUtils */; if (moduleValue.hasDetectedActivity(value2)) { env0_11[guild.id] = value2; } else { moduleValue2 = require(8275) /* metro dependency 8275: GuildAntiRaidUtils */; if (moduleValue2.isUnderLockdown(value2)) { env0_11[guild.id] = value2; } else { delete env0_11[guild.id]; } } } } function GUILD_DELETE_83544({guild}) { // fn#83544, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11092:3209, offset: 0x01f1e4df, size: 28 bytes, params: 2, frame: 2 delete env0_11[guild.id]; } } global.__d(_fun83526, 10906, [6, 7, 15, 17, 18, 4107, 1348, 1867, 3784, 8275, 566, 694, 2]) /* metro module 10906, dependencies: [6, 7, 15, 17, 18, 4107, 1348, 1867, 3784, 8275, 566, 694, 2] */;