/* Metro module 10580; source: stores/GamePartyStore.tsx; dependencies: [6, 7, 15, 17, 18, 1226, 3793, 6876, 661, 22, 566, 694, 2] */ function _fun81607(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#81607, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10766:6, offset: 0x01ed7b3f, size: 571 bytes, params: 8, frame: 22 const _arrayLikeToArray_81613 = 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 closure = function({guild}) { var r2; var r3; var r0; var value5; var user; var status; var activities; var updatePartyBinding; var id; var value6; var value7; var value2 = _createForOfIteratorHelperLoose_81611(guild.presences); var value3 = value2(); var value4 = false; if (value3.done) { r0 = value4; } else { r2 = value4; r3 = value3; while (true) { value5 = r3.value; user = value5.user; status = value5.status; activities = value5.activities; updatePartyBinding = updateParty; id = guild.id; if (value4 !== updatePartyBinding(id, user.id, activities, status)) { value6 = true; r2 = value6; } value7 = value2(); if (value7.done) { r0 = r2; break; } r3 = value7; continue; } } return r0; }; const handleLocalPresenceUpdate_81621 = function() { return updateParty(ME, AuthenticationStore.getId(), SelfPresenceStore.getActivities()); }; const closure2 = RELATIONSHIP_ADD_81622; 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 authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */; const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */; const selfPresenceStore = importDefault(6876) /* metro dependency 6876: SelfPresenceStore */; const constantsModule = require(661) /* metro dependency 661: Constants */; const env0_10 = constantsModule.StatusTypes; const env0_11 = constantsModule.ME; let env0_12 = {}; let Map = global.Map; let map = new Map(); const Store = (importDefault(566) /* metro dependency 566: flux */).Store; _fun81623(Store).displayName = 'GamePartyStore'; map = new map(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN_SUPPLEMENTAL: CONNECTION_OPEN_SUPPLEMENTAL_81629, OVERLAY_INITIALIZE: function(a0) { var r5; var parties = a0.parties; var env0_0 = parties; var userParties = a0.userParties; var Map = global.Map; env0_13 = new Map(); var object = {}; copyDataProperties(object, userParties, r5); env0_12 = object; var Object = global.Object; Object.keys(parties).forEach(_fun81631); }, GUILD_CREATE: closure, PRESENCES_REPLACE: function({presences}) { var r2; var r3; var r1; var r0; var user; var value5; var value6; var value7; var value8; var value2 = _createForOfIteratorHelperLoose_81611(presences); var value3 = value2(); var value4 = false; if (value3.done) { r0 = value4; } else { r2 = value4; r3 = value3; while (true) { presences = r3.value; user = presences.user; presences = presences.activities; value5 = user != null; if (value5) { value6 = value4 !== updateParty(ME, user.id, presences); r1 = value6; } else { r1 = value5; } if (!r1) { continue; } value7 = true; r2 = value7; value8 = value2(); if (value8.done) { r0 = r2; break; } r3 = value8; continue; } } return r0; }, PRESENCE_UPDATES: function({updates}) { return updates.map(_fun81634).some(_fun81635); }, THREAD_MEMBER_LIST_UPDATE: THREAD_MEMBER_LIST_UPDATE_81636, THREAD_MEMBERS_UPDATE: THREAD_MEMBERS_UPDATE_81638, RELATIONSHIP_ADD: closure2, RELATIONSHIP_UPDATE: closure2, RELATIONSHIP_REMOVE: RELATIONSHIP_REMOVE_81640}); (require(2) /* metro dependency 2 */).fileFinishedImporting('stores/GamePartyStore.tsx'); exports.default = map; } function _isNativeReflectConstruct_81608() { // fn#81608, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10766:214, offset: 0x01ed7d7a, 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_81608_isNativeReflectConstruct = function() { return !!result; })(); } function _createForOfIteratorHelperLoose_81611(a0, a1) { // fn#81611, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10766:407, offset: 0x01ed7ddc, 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 _fun81612; } value = undefined; if (a0) { if (typeof a0 === 'string') { value = _arrayLikeToArray_81613(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_81613(a0, value); r6 = value; } else { regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', ''); if (regexp.test(r9)) { value = _arrayLikeToArray_81613(a0, value); r6 = value; } else { r6 = value; } } r5 = r6; } } else { r5 = value; } if (r5) { if (r5) { } return _fun81612; } 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 getPartyForUser(a0, a1) { // fn#81614, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10766:1336, offset: 0x01ed7f50, size: 31 bytes, params: 3, frame: 2 return (env0_12[a0] ?? ({}))[a1]; } function removeUserFromParty(a0, a1) { // fn#81615, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10766:1403, offset: 0x01ed7f6f, size: 136 bytes, params: 3, frame: 18 var property; var defaultImport; var value3; const partyForUser = getPartyForUser(a0, a1); if (partyForUser != null) { property = env0_12[a0]; delete property[a1]; defaultImport = importDefault(22) /* metro dependency 22 */; if (defaultImport.isEmpty(property)) { delete env0_12[a0]; } value3 = env0_13.get(partyForUser); if (value3 != null) { value3.delete(a0); if (value3.size === 0) { env0_13.delete(partyForUser); } } } } function updateParty(a0, a1, a2, a3) { // fn#81616, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10766:1594, offset: 0x01ed7ff7, size: 294 bytes, params: 5, frame: 19 var r6; var r7; var r0; var property; var binding; var object2; var value4; var set; var value7; const value = a2.find(function(a0) { return a0.party != null && a0.party.id; }); const value2 = null; const id = value2 != value && value2 != value.party ? value.party.id : value2; const partyForUser = getPartyForUser(a1, a0); if (value2 == id) { value7 = value2 != partyForUser; if (value7) { removeUserFromParty(a1, a0); r0 = true; } else { r0 = value7; } return r0; } const OFFLINE = StatusTypes.OFFLINE; if (a3 === OFFLINE) { value7 = value2 != partyForUser; if (value7) { removeUserFromParty(a1, a0); r0 = true; } else { r0 = value7; } return r0; } if (value2 == partyForUser) { property = env0_12[a1]; if (value2 != property) { r6 = property; } else { binding = env0_12; object2 = {}; binding[a1] = object2; r6 = object2; } r6[a0] = id; if (!RelationshipStore.isBlocked(a1)) { if (!RelationshipStore.isIgnored(a1)) { binding = env0_13; value4 = binding.get(id); if (value2 != value4) { r7 = value4; } else { set = new global.Set(); } binding = env0_13; binding.set(id, r7); r7.add(a1); } } } else { if (partyForUser === id) { return false; } removeUserFromParty(a1, a0); property = env0_12[a1]; if (value2 != property) { r6 = property; } else { binding = env0_12; object2 = {}; binding[a1] = object2; r6 = object2; } r6[a0] = id; if (!RelationshipStore.isBlocked(a1)) { if (!RelationshipStore.isIgnored(a1)) { binding = env0_13; value4 = binding.get(id); if (value2 != value4) { r7 = value4; } else { set = new global.Set(); } binding = env0_13; binding.set(id, r7); r7.add(a1); } } } return true; } function batchUpdatePresences(a0, a1) { // fn#81619, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10766:2257, offset: 0x01ed81b0, size: 41 bytes, params: 3, frame: 12 const env0_0 = a0; const env0_1 = false; a1.forEach(_fun81620); return env0_1; } function RELATIONSHIP_ADD_81622({relationship}) { // fn#81622, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10766:2491, offset: 0x01ed8250, size: 193 bytes, params: 2, frame: 17 var r2; var value4; var get; var value5; var value6; const isBlocked = RelationshipStore.isBlocked; let id = relationship.id; if (!Reflect.apply(isBlocked, RelationshipStore, [id])) { reducibleJoin3: while (true) { if (!RelationshipStore.isIgnored(relationship.id)) { return false; } break reducibleJoin3; } } let binding = env0_12; const property = binding[relationship.id]; if (property == null) { return false; } const _createForOfIteratorHelperLoose_81611Binding = _createForOfIteratorHelperLoose_81611; const defaultImport = importDefault(22) /* metro dependency 22 */; const value2 = _createForOfIteratorHelperLoose_81611Binding(defaultImport.values(property)); const value3 = value2(); let done = value3.done; if (!done) { r2 = value3; reducibleLoop5: while (true) { value4 = r2.value; binding = env0_13; get = binding.get; value5 = Reflect.apply(get, binding, [value4]); reducibleJoin7: while (true) { if (value5 == null) { break reducibleJoin7; } id = relationship.id; value5.delete(id); break reducibleJoin7; } value6 = value2(); done = value6.done; if (done) { break reducibleLoop5; } r2 = value6; continue reducibleLoop5; } } } function _fun81623(a0) { // fn#81623, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10766:2768, offset: 0x01ed8311, size: 153 bytes, params: 2, frame: 16 const closure = GamePartyStore; env0_6(closure, a0); return env0_3(closure, [{key: 'initialize', value: function() { this.syncWith([SelfPresenceStore], handleLocalPresenceUpdate_81621); this.waitFor(AuthenticationStore, RelationshipStore, SelfPresenceStore); }}, {key: 'getParty', value: value_81626}, {key: 'getUserParties', value: value_81627}, {key: 'getParties', value: value_81628}]); } function CONNECTION_OPEN_SUPPLEMENTAL_81629({guilds, presences}) { // fn#81629, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10766:3418, offset: 0x01ed841d, size: 205 bytes, params: 2, frame: 27 var r3; var r4; var r1; var r0; var r2; var value5; var user; var status; var activities; var value6; var updatePartyBinding; var id; var value7; var value8; var value9; var object2; var value12; var value13; var value14; const value2 = _createForOfIteratorHelperLoose_81611(presences); const value3 = value2(); let done = value3.done; if (done) { r0 = false; } else { r3 = false; r4 = value3; while (true) { value5 = r4.value; user = value5.user; status = value5.status; activities = value5.activities; value6 = user != null; if (value6) { updatePartyBinding = updateParty; id = user.id; value7 = updatePartyBinding(ME, id, activities, status) !== false; r1 = value7; } else { r1 = value6; } if (!r1) { continue; } value8 = true; r3 = value8; value9 = value2(); done = value9.done; if (done) { r0 = r3; break; } r4 = value9; continue; } } const value10 = _createForOfIteratorHelperLoose_81611(guilds); const value11 = value10(); done = value11.done; if (!done) { r2 = value11; r3 = r0; while (true) { object2 = {}; value12 = r2.value; object2.guild = value12; if (GUILD_CREATE_81618(object2) !== false) { value13 = true; r3 = value13; } value14 = value10(); done = value14.done; if (done) { r0 = r3; break; } r2 = value14; continue; } } return r0; } function OVERLAY_INITIALIZE_81630({parties, userParties}) { // fn#81630, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10766:3787, offset: 0x01ed84ea, size: 110 bytes, params: 2, frame: 15 const Map = global.Map; const map = new Map(); copyDataProperties({}, userParties, undefined); const Object = global.Object; Object.keys(parties).forEach(_fun81631); } function PRESENCE_UPDATES_81633({updates}) { // fn#81633, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10766:4191, offset: 0x01ed860c, size: 48 bytes, params: 2, frame: 12 return updates.map(function({guildId, user, status, activities}) { return updateParty(guildId ?? ME, user.id, activities, status); }).some(function(a0) { return a0; }); } function THREAD_MEMBER_LIST_UPDATE_81636({guildId, members}) { // fn#81636, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10766:4369, offset: 0x01ed867b, size: 50 bytes, params: 2, frame: 14 return batchUpdatePresences(guildId, members.map(function(a0) { return a0.presence; })); } function THREAD_MEMBERS_UPDATE_81638({guildId, addedMembers}) { // fn#81638, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10766:4507, offset: 0x01ed86b8, size: 59 bytes, params: 2, frame: 15 var r0; var batchUpdatePresencesBinding; let value = addedMembers != null; if (value) { batchUpdatePresencesBinding = batchUpdatePresences; value = addedMembers.map(function(a0) { return a0.presence; }); value = batchUpdatePresencesBinding(guildId, value); r0 = value; } else { r0 = value; } return r0; } function RELATIONSHIP_REMOVE_81640({relationship}) { // fn#81640, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10766:4751, offset: 0x01ed86f3, size: 143 bytes, params: 2, frame: 17 var r2; var value4; var value5; var add; var value6; let binding = env0_12; let id = relationship.id; const property = binding[id]; if (property == null) { return false; } const _createForOfIteratorHelperLoose_81611Binding = _createForOfIteratorHelperLoose_81611; const defaultImport = importDefault(22) /* metro dependency 22 */; const value2 = _createForOfIteratorHelperLoose_81611Binding(defaultImport.values(property)); const value3 = value2(); let done = value3.done; if (!done) { r2 = value3; while (true) { value4 = r2.value; binding = env0_13; value5 = binding.get(value4); if (value5 != null) { add = value5.add; id = relationship.id; Reflect.apply(add, value5, [id]); } value6 = value2(); done = value6.done; if (done) { break; } r2 = value6; continue; } } } function _fun81620(a0) { // fn#81620, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10766:2319, offset: 0x01ed81d9, size: 69 bytes, params: 2, frame: 18 var r0; let value = a0 != null; if (value) { value = environment.__proto__; value = updateParty(env0_0, a0.user.id, a0.activities, a0.status); r0 = value; } else { r0 = value; } if (r0) { } } function value_81626(a0) { // fn#81626, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10766:3168, offset: 0x01ed83e9, size: 52 bytes, params: 2, frame: 14 const value = null; return value != a0 && env1_13.has(a0) ? env1_13.get(a0) : value; } function _fun81631(a0) { // fn#81631, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10766:3890, offset: 0x01ed8558, size: 62 bytes, params: 2, frame: 15 const value = environment.__proto__; const binding = env1_13; const set = binding.set; const Set = global.Set; return Reflect.apply(set, binding, [a0, new Set(parties[a0])]); }