354 lines
14 KiB
TypeScript
354 lines
14 KiB
TypeScript
/* Metro module 7158; source: modules/threads/ThreadMembersStore.tsx; dependencies: [6, 7, 15, 17, 18, 1383, 1379, 22, 566, 694, 2] */
|
|
function _fun57425(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57425, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:6, offset: 0x013e5d3c, size: 481 bytes, params: 8, frame: 22
|
|
const _arrayLikeToArray_57431 = 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({channel}) {
|
|
return updateFromThread_57433(channel);
|
|
};
|
|
const closure2 = function({threads}) {
|
|
threads.forEach(updateFromServerThread_57441);
|
|
};
|
|
const closure3 = SEARCH_MESSAGES_SUCCESS_57436;
|
|
const 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 env0_7 = (require(1383) /* metro dependency 1383: ChannelRecord */).ALL_CHANNEL_TYPES;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
let env0_9 = {};
|
|
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
|
|
let value = _fun57442(Store);
|
|
value.displayName = 'ThreadMembersStore';
|
|
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: function(a0) {
|
|
env0_9 = {};
|
|
a0.guilds.forEach(updateFromGuild_57432);
|
|
}, OVERLAY_INITIALIZE: function({threadMembers}) {
|
|
var object = {};
|
|
copyDataProperties(object, threadMembers, object);
|
|
env0_9 = object;
|
|
}, GUILD_CREATE: function({guild}) {
|
|
updateFromGuild_57432(guild);
|
|
}, GUILD_DELETE: function(a0) {
|
|
_fun57452(a0.guild.id);
|
|
}, CHANNEL_DELETE: function(a0) {
|
|
_fun57455(a0.channel.id);
|
|
}, THREAD_CREATE: closure, THREAD_UPDATE: closure, THREAD_LIST_SYNC: function({threads}) {
|
|
threads.forEach(updateFromThread_57433);
|
|
}, THREAD_MEMBERS_UPDATE: THREAD_MEMBERS_UPDATE_57458, SEARCH_MESSAGES_SUCCESS: closure3,
|
|
MOD_VIEW_SEARCH_MESSAGES_SUCCESS: closure3, LOAD_THREADS_SUCCESS: closure2,
|
|
LOAD_ARCHIVED_THREADS_SUCCESS: closure2, THREAD_DELETE: THREAD_DELETE_57459,
|
|
LOAD_MESSAGES_SUCCESS: function(a0) {
|
|
var r2;
|
|
var r3;
|
|
var r7;
|
|
var r0;
|
|
var value5;
|
|
var value6;
|
|
var value2 = _createForOfIteratorHelperLoose_57429(a0.messages);
|
|
var value3 = value2();
|
|
var value4 = false;
|
|
if (value3.done) {
|
|
r0 = value4;
|
|
} else {
|
|
r2 = value4;
|
|
r3 = value3;
|
|
while (true) {
|
|
value5 = updateFromServerThread_57441(r3.value.thread);
|
|
r7 = value5 || r2;
|
|
value6 = value2();
|
|
if (value6.done) {
|
|
r0 = r7;
|
|
break;
|
|
}
|
|
r2 = r7;
|
|
r3 = value6;
|
|
continue;
|
|
}
|
|
}
|
|
return r0;
|
|
}});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/ThreadMembersStore.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_57426() { // fn#57426, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:189, offset: 0x013e5f1d, size: 94 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_57426_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_57429(a0, a1) { // fn#57429, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:382, offset: 0x013e5f7b, size: 370 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 _fun57430;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_57431(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_57431(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_57431(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun57430;
|
|
}
|
|
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 updateFromGuild_57432({threads}) { // fn#57432, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:1301, offset: 0x013e60ed, size: 36 bytes, params: 2, frame: 11
|
|
if (threads != null) {
|
|
threads.forEach(updateFromThread_57433);
|
|
}
|
|
}
|
|
|
|
function updateFromThread_57433(a0) { // fn#57433, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:1384, offset: 0x013e6111, size: 190 bytes, params: 2, frame: 17
|
|
var r5;
|
|
var id;
|
|
var binding;
|
|
var object2;
|
|
var property;
|
|
if (ALL_CHANNEL_TYPES.has(a0.type)) {
|
|
id = a0.id;
|
|
if (!(id in env0_9)) {
|
|
binding = env0_9;
|
|
id = a0.id;
|
|
object2 = {};
|
|
object2.guildId = a0.guild_id;
|
|
object2.parentId = a0.parent_id;
|
|
r5 = a0.memberCount ?? 0;
|
|
object2.memberCount = r5;
|
|
r5 = a0.memberIdsPreview ?? [];
|
|
object2.memberIdsPreview = r5;
|
|
binding[id] = object2;
|
|
}
|
|
binding = env0_9;
|
|
id = a0.id;
|
|
property = binding[id];
|
|
if (a0.memberCount != null) {
|
|
property.memberCount = a0.memberCount;
|
|
}
|
|
if (a0.memberIdsPreview != null) {
|
|
property.memberIdsPreview = a0.memberIdsPreview;
|
|
}
|
|
return undefined;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function MOD_VIEW_SEARCH_MESSAGES_SUCCESS_57436({data}) { // fn#57436, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:1930, offset: 0x013e6205, size: 37 bytes, params: 2, frame: 12
|
|
data.forEach(function({threads, messages}) {
|
|
messages.forEach(_fun57438);
|
|
threads.forEach(_fun57440);
|
|
});
|
|
return false;
|
|
}
|
|
|
|
function updateFromServerThread_57441(a0) { // fn#57441, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:2175, offset: 0x013e62c3, size: 70 bytes, params: 2, frame: 13
|
|
if (a0 == null) {
|
|
return false;
|
|
}
|
|
if (a0.id in env0_9) {
|
|
return false;
|
|
}
|
|
const channel = ChannelStore.getChannel(a0.id);
|
|
if (channel == null) {
|
|
return false;
|
|
}
|
|
updateFromThread_57433(channel);
|
|
return true;
|
|
}
|
|
|
|
function _fun57442(a0) { // fn#57442, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:2317, offset: 0x013e6309, size: 141 bytes, params: 2, frame: 16
|
|
const closure = ThreadMembersStore;
|
|
env0_6(closure, a0);
|
|
return env0_3(closure, [{key: 'initialize', value: function() {
|
|
this.waitFor(ChannelStore);
|
|
}}, {key: 'getMemberCount', value: value_57445}, {key: 'getMemberIdsPreview', value: value_57446},
|
|
{key: 'getInitialOverlayState', value: value_57447}]);
|
|
}
|
|
|
|
function GUILD_DELETE_57451({guild}) { // fn#57451, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:3282, offset: 0x013e644b, size: 29 bytes, params: 2, frame: 11
|
|
GUILD_DELETE_57451DeleteForGuild(guild.id);
|
|
}
|
|
|
|
function CHANNEL_DELETE_57454({channel}) { // fn#57454, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:3410, offset: 0x013e64a5, size: 29 bytes, params: 2, frame: 11
|
|
CHANNEL_DELETE_57454DeleteForChannel(channel.id);
|
|
}
|
|
|
|
function THREAD_MEMBERS_UPDATE_57458(a0) { // fn#57458, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:3723, offset: 0x013e651d, size: 67 bytes, params: 2, frame: 4
|
|
const property = env0_9[a0.id];
|
|
if (property == null) {
|
|
return false;
|
|
}
|
|
if (a0.memberIdsPreview != null) {
|
|
property.memberIdsPreview = a0.memberIdsPreview;
|
|
}
|
|
property.memberCount = a0.memberCount;
|
|
}
|
|
|
|
function THREAD_DELETE_57459({channel}) { // fn#57459, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:4134, offset: 0x013e6560, size: 28 bytes, params: 2, frame: 2
|
|
delete env0_9[channel.id];
|
|
}
|
|
|
|
function _fun57437({threads, messages}) { // fn#57437, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:2004, offset: 0x013e622a, size: 51 bytes, params: 2, frame: 13
|
|
messages.forEach(function(a0) {
|
|
a0.forEach(_fun57439);
|
|
});
|
|
threads.forEach(_fun57440);
|
|
}
|
|
|
|
function value_57445(a0) { // fn#57445, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:2694, offset: 0x013e6396, size: 45 bytes, params: 2, frame: 4
|
|
let value = environment.__proto__;
|
|
const property = env1_9[a0];
|
|
value = null;
|
|
const memberCount = value == property ? undefined : property.memberCount;
|
|
return value != memberCount ? memberCount : value;
|
|
}
|
|
|
|
function value_57446(a0) { // fn#57446, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:2809, offset: 0x013e63c3, size: 45 bytes, params: 2, frame: 4
|
|
let value = environment.__proto__;
|
|
const property = env1_9[a0];
|
|
value = null;
|
|
const memberIdsPreview = value == property ? undefined : property.memberIdsPreview;
|
|
return value != memberIdsPreview ? memberIdsPreview : value;
|
|
}
|
|
|
|
function GUILD_DELETE_57451DeleteForGuild(a0) { // fn#57452, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:3321, owner: GUILD_DELETE_57451.deleteForGuild, offset: 0x013e6468, size: 61 bytes, params: 2, frame: 15
|
|
const env0_0 = a0;
|
|
const defaultImport = importDefault(22) /* metro dependency 22 */;
|
|
env1_9 = defaultImport.omitBy(env1_9, _fun57453);
|
|
}
|
|
|
|
function CHANNEL_DELETE_57454DeleteForChannel(a0) { // fn#57455, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:3453, owner: CHANNEL_DELETE_57454.deleteForChannel, offset: 0x013e64c2, size: 61 bytes, params: 2, frame: 15
|
|
const env0_0 = a0;
|
|
const defaultImport = importDefault(22) /* metro dependency 22 */;
|
|
env1_9 = defaultImport.omitBy(env1_9, _fun57456);
|
|
}
|
|
|
|
function _fun57438(a0) { // fn#57438, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:2042, offset: 0x013e625d, size: 24 bytes, params: 2, frame: 11
|
|
a0.forEach(_fun57439);
|
|
}
|
|
|
|
function _fun57440(a0) { // fn#57440, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:2124, offset: 0x013e629f, size: 36 bytes, params: 2, frame: 11
|
|
let value = environment.__proto__.__proto__;
|
|
const r2 = updateFromServerThread_57441(a0) || env1_0;
|
|
value = environment.__proto__;
|
|
}
|
|
|
|
function _fun57439({thread}) { // fn#57439, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:2057, offset: 0x013e6275, size: 42 bytes, params: 2, frame: 11
|
|
let value = environment.__proto__.__proto__.__proto__;
|
|
const r2 = updateFromServerThread_57441(thread) || env2_0;
|
|
value = environment.__proto__.__proto__;
|
|
}
|
|
|