252 lines
9.8 KiB
TypeScript
252 lines
9.8 KiB
TypeScript
/* Metro module 1381; source: stores/GuildMembershipStore.tsx; dependencies: [6, 7, 15, 17, 18, 694, 566, 2] */
|
|
function _fun16082(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#16082, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1508:6, offset: 0x00e46a40, size: 250 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_16085 = 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 Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_4 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_5 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_6 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_7 = importDefault(18) /* metro dependency 18 */;
|
|
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
|
|
let value = _fun16089(Store);
|
|
value = new value();
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('stores/GuildMembershipStore.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_16083(a0, a1) { // fn#16083, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1508:150, offset: 0x00e46b3a, 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 _fun16084;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_16085(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_16085(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_16085(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun16084;
|
|
}
|
|
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 _isNativeReflectConstruct_16086() { // fn#16086, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1508:1060, offset: 0x00e46cac, 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_16086_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun16089(a0) { // fn#16089, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1508:1263, offset: 0x00e46d0a, size: 208 bytes, params: 2, frame: 16
|
|
const closure = GuildMembershipStore;
|
|
env0_7(closure, a0);
|
|
return env0_4(closure, [{key: 'allGuildIds', value: function() {
|
|
return this.guildIds;
|
|
}}, {key: 'isMember', value: function(a0) {
|
|
return this.guildIds.has(a0);
|
|
}}, {key: 'handleConnectionOpen', value: function(a0) {
|
|
var Set = global.Set;
|
|
var guilds = a0.guilds;
|
|
var value = guilds.map(_fun16099);
|
|
var items = [];
|
|
value = arraySpread(items, value, 0, guilds);
|
|
arraySpread(items, a0.unavailableGuilds, value, guilds);
|
|
this.guildIds = new Set(items);
|
|
}}, {key: 'handleCacheLoaded', value: function(a0) {
|
|
var Set = global.Set;
|
|
var value = a0.guilds.map(_fun16101);
|
|
value = new Set(value);
|
|
this.guildIds = value;
|
|
}}, {key: 'handleCacheLoadedLazy', value: value_16102}, {key: 'handleGuildCreate', value: function(a0) {
|
|
this.guildIds.add(a0.guild.id);
|
|
}}, {key: 'handleGuildDelete', value: function(a0) {
|
|
if (a0.guild.unavailable !== true) {
|
|
this.guildIds.delete(a0.guild.id);
|
|
}
|
|
}}]);
|
|
}
|
|
|
|
function GuildMembershipStore() { // fn#16090, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1508:1275, offset: 0x00e46dda, size: 257 bytes, params: 1, frame: 20
|
|
var environment;
|
|
let value = environment.__proto__;
|
|
env1_3(this, GuildMembershipStore);
|
|
const items2 = [importDefault(694) /* metro dependency 694: Dispatcher */];
|
|
items2[1] = {CACHE_LOADED: CACHE_LOADED_16091, CACHE_LOADED_LAZY: CACHE_LOADED_LAZY_16092,
|
|
CONNECTION_OPEN: CONNECTION_OPEN_16093, GUILD_CREATE: GUILD_CREATE_16094, GUILD_DELETE: GUILD_DELETE_16095};
|
|
const DispatchBand = (require(694) /* metro dependency 694: Dispatcher */).DispatchBand;
|
|
const Early = DispatchBand.Early;
|
|
items2[2] = Early;
|
|
const value3 = env1_6(GuildMembershipStore);
|
|
value = env1_5(this, _isNativeReflectConstruct_16086() ? global.Reflect.construct(value3, items2,
|
|
env1_6(this).constructor) : value3.apply(this, items2));
|
|
const Set = global.Set;
|
|
const value4 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
const set = new Set();
|
|
value.guildIds = set instanceof Object ? set : value4;
|
|
return value;
|
|
}
|
|
|
|
function value_16098({guilds, unavailableGuilds}) { // fn#16098, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1508:1995, offset: 0x00e46f2c, size: 96 bytes, params: 2, frame: 15
|
|
const Set = global.Set;
|
|
let value = guilds.map(function(a0) {
|
|
return a0.id;
|
|
});
|
|
const items2 = [];
|
|
value = arraySpread(items2, value, 0, guilds);
|
|
arraySpread(items2, unavailableGuilds, value, guilds);
|
|
this.guildIds = new Set(items2);
|
|
}
|
|
|
|
function value_16100({guilds}) { // fn#16100, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1508:2115, offset: 0x00e46f96, size: 67 bytes, params: 2, frame: 12
|
|
const Set = global.Set;
|
|
const value = guilds.map(function(a0) {
|
|
return a0.id;
|
|
});
|
|
const value2 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
const set = new Set(value);
|
|
this.guildIds = set instanceof Object ? set : value2;
|
|
}
|
|
|
|
function value_16102({guilds}) { // fn#16102, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1508:2211, offset: 0x00e46fd9, size: 81 bytes, params: 2, frame: 15
|
|
var r2;
|
|
var value3;
|
|
var guildIds;
|
|
var add;
|
|
var id;
|
|
var value4;
|
|
let value = environment.__proto__;
|
|
value = _createForOfIteratorHelperLoose_16083(guilds);
|
|
const value2 = value();
|
|
let done = value2.done;
|
|
if (!done) {
|
|
for (r2 = value2; true; r2 = value4) {
|
|
value3 = r2.value;
|
|
guildIds = this.guildIds;
|
|
add = guildIds.add;
|
|
id = value3.id;
|
|
Reflect.apply(add, guildIds, [id]);
|
|
value4 = value();
|
|
done = value4.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function GuildMembershipStoreCACHE_LOADED(a0) { // fn#16091, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1508:1533, owner: GuildMembershipStore.CACHE_LOADED, offset: 0x00e46edb, size: 23 bytes, params: 2, frame: 11
|
|
return env0_0.handleCacheLoaded(a0);
|
|
}
|
|
|