Initial commit

This commit is contained in:
janisslsm committed 2026-07-27 16:20:00 +03:00
commit af3b49f756
16065 files changed
+2938410

No files matched your search

@@ -0,0 +1,199 @@
/* Metro module 10581; source: stores/views/ActivityLauncherStore.tsx; dependencies: [6, 7, 15, 17, 18, 6877, 6876, 661, 4041, 694, 566, 2] */
function _fun81641(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#81641, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10767:6, offset: 0x01ed8782, size: 455 bytes, params: 8, frame: 20
const env0_0 = require;
const closure = ACTIVITY_JOIN;
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 localActivityStore = importDefault(6877) /* metro dependency 6877: LocalActivityStore */;
const selfPresenceStore = importDefault(6876) /* metro dependency 6876: SelfPresenceStore */;
let value = require(661) /* metro dependency 661: Constants */;
const env0_10 = value.ActivityActionStates;
const env0_11 = value.ActivityActionTypes;
let env0_12 = {};
const env0_13 = {};
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
_fun81653(Store).displayName = 'ActivityLauncherStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
{OVERLAY_INITIALIZE: function({activityLauncherStates}) {
var object = {};
copyDataProperties(object, activityLauncherStates, object);
env0_12 = object;
}, ACTIVITY_JOIN_LOADING: function(a0) {
var handleActivityStateChangedBinding = handleActivityStateChanged;
var LOADING = ActivityActionStates.LOADING;
return handleActivityStateChangedBinding(LOADING, ActivityActionTypes.JOIN, a0);
}, ACTIVITY_JOIN_FAILED: function(a0) {
var handleActivityStateChangedBinding = handleActivityStateChanged;
var FAILED = ActivityActionStates.FAILED;
return handleActivityStateChangedBinding(FAILED, ActivityActionTypes.JOIN, a0);
}, ACTIVITY_JOIN: closure, EMBEDDED_ACTIVITY_CLOSE: closure, ACTIVITY_LAUNCH_FAIL: ACTIVITY_LAUNCH_FAIL});
(require(2) /* metro dependency 2 */).fileFinishedImporting('stores/views/ActivityLauncherStore.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_81642() { // fn#81642, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10767:227, offset: 0x01ed8949, 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_81642_isNativeReflectConstruct = function() {
return !!result;
})();
}
function startActivityLaunchTimeout(a0, a1, a2) { // fn#81645, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10767:441, offset: 0x01ed89ab, size: 130 bytes, params: 4, frame: 16
const env0_0 = a0;
const env0_1 = a1;
if (env0_13[a0] != null) {
env0_13[a0].stop();
}
const Timeout = (require(4041) /* metro dependency 4041: Timers */).Timeout;
const timeout = new Timeout();
timeout.start(a2, _fun81646);
env0_13[a0] = timeout;
}
function handleActivityStateChanged(a0, a1, {applicationId, remotePartyId}) { // fn#81647, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10767:638, offset: 0x01ed8a72, size: 220 bytes, params: 4, frame: 19
var r7;
var property;
const COMPLETE = ActivityActionStates.COMPLETE;
if (a0 === COMPLETE) {
property = env0_12[applicationId];
if (property != null) {
delete property[a1];
}
if (env0_13[applicationId] != null) {
env0_13[applicationId].stop();
delete env0_13[applicationId];
}
} else {
r7 = env0_12[applicationId] ?? ({});
r7[a1] = {state: a0, remotePartyId: remotePartyId};
env0_12[applicationId] = r7;
var FAILED = ActivityActionStates.FAILED;
if (a0 === FAILED) {
startActivityLaunchTimeout(applicationId, a1, env0_14);
} else if (a0 === ActivityActionStates.LOADING) {
startActivityLaunchTimeout(applicationId, a1, remotePartyId != null ? 15000 : env0_14);
}
}
}
function ACTIVITY_JOIN(a0) { // fn#81648, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10767:991, offset: 0x01ed8b4e, size: 72 bytes, params: 2, frame: 16
return (a0.type !== 'ACTIVITY_JOIN' || a0.parentApplicationId == null) && handleActivityStateChanged(ActivityActionStates.COMPLETE,
ActivityActionTypes.JOIN, a0);
}
function handleActivityUpdate() { // fn#81649, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10767:1137, offset: 0x01ed8b96, size: 91 bytes, params: 1, frame: 12
const Object = global.Object;
let value = Object.entries(env0_12);
value = value.map(function(a0) {
var r0;
var r3;
var r4;
var item3;
var value3;
var iterator = a0[Symbol.iterator]();
var iterator2 = iterator.next;
var item2 = Reflect.apply(iterator2, iterator, []);
var item = item2.value;
item2 = item2.done ? undefined : iterator;
var value = undefined;
var value2 = item2 === value;
var r2 = value2 ? value : item;
if (value2) {
r0 = item2;
r3 = value;
r4 = value2;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = item3;
r3 = value;
r4 = value3;
} else {
r0 = item3;
r3 = item;
r4 = value3;
}
}
if (!r4) {
r0.return();
}
var property = r3[ActivityActionTypes.JOIN];
return {applicationId: r2, remotePartyId: property == null ? value : property.remotePartyId};
});
value = value.filter(function(a0) {
return a0.remotePartyId != null;
});
const env0_0 = false;
value.forEach(_fun81652);
return env0_0;
}
function _fun81653(a0) { // fn#81653, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10767:1656, offset: 0x01ed8d20, size: 124 bytes, params: 2, frame: 16
const closure = ActivityLauncherStore;
env0_7(closure, a0);
return env0_4(closure, [{key: 'initialize', value: function() {
this.syncWith([LocalActivityStore, SelfPresenceStore], handleActivityUpdate);
}}, {key: 'getState', value: value_81656}, {key: 'getStates', value: value_81657}]);
}
function ACTIVITY_LAUNCH_FAIL({applicationId, activityType}) { // fn#81661, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10767:2603, offset: 0x01ed8e6b, size: 43 bytes, params: 2, frame: 3
const property = env0_12[applicationId];
if (property == null) {
return false;
}
delete property[activityType];
}
function _fun81646() { // fn#81646, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10767:546, offset: 0x01ed8a2d, size: 69 bytes, params: 1, frame: 13
const value = environment.__proto__;
return (importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'ACTIVITY_LAUNCH_FAIL',
applicationId: env0_0, activityType: require});
}
function _fun81652({applicationId, remotePartyId}) { // fn#81652, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10767:1360, offset: 0x01ed8c70, size: 176 bytes, params: 2, frame: 19
const applicationActivity = LocalActivityStore.getApplicationActivity(applicationId);
const applicationActivity2 = SelfPresenceStore.getApplicationActivity(applicationId);
if (!((applicationActivity == null || applicationActivity.party == null ? undefined : applicationActivity.party.id) !== remotePartyId && (applicationActivity2 == null || applicationActivity2.party == null ? undefined : applicationActivity2.party.id) !== remotePartyId)) {
handleActivityStateChanged(ActivityActionStates.COMPLETE, ActivityActionTypes.JOIN,
{applicationId: applicationId,
remotePartyId: remotePartyId});
}
}
function value_81656(a0, a1) { // fn#81656, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10767:2068, offset: 0x01ed8dca, size: 48 bytes, params: 3, frame: 5
const value = environment.__proto__;
const property = env1_12[a0];
return property == null || property[a1] == null ? undefined : property[a1].state;
}
+308
View File
@@ -0,0 +1,308 @@
/* Metro module 9815; source: stores/views/GIFPickerViewStore.tsx; dependencies: [6, 7, 15, 17, 18, 661, 1349, 1244, 566, 694, 2] */
function _fun76879(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76879, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10001:6, offset: 0x01de899f, size: 470 bytes, params: 8, frame: 19
const env0_0 = require;
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(661) /* metro dependency 661: Constants */).GIFPickerResultTypes;
const GIFType = (require(1349) /* metro dependency 1349: frecency_user_settings */).GIFType;
const env0_8 = GIFType.IMAGE;
let env0_12 = [];
const env0_13 = [];
let env0_14 = [];
let env0_15 = [];
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
let value = _fun76884(Store);
value.displayName = 'GIFPickerViewStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {GIF_PICKER_INITIALIZE: function(a0) {
env0_9 = a0.analyticsID;
}, GIF_PICKER_QUERY: function({query}) {
env0_10 = query;
if (query === '') {
env0_11 = '';
env0_12 = [];
env0_14 = [];
}
}, GIF_PICKER_QUERY_SUCCESS: GIF_PICKER_QUERY_SUCCESS, GIF_PICKER_QUERY_FAILURE: function({query}) {
if (query == null) {
return false;
}
env0_11 = query;
env0_12 = [];
}, GIF_PICKER_TRENDING_FETCH_SUCCESS: GIF_PICKER_TRENDING_FETCH_SUCCESS,
GIF_PICKER_SUGGESTIONS_SUCCESS: function(a0) {
env0_14 = a0.items;
}, GIF_PICKER_TRENDING_SEARCH_TERMS_SUCCESS: function(a0) {
env0_15 = a0.items;
}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('stores/views/GIFPickerViewStore.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_76880() { // fn#76880, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10001:179, offset: 0x01de8b75, 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_76880_isNativeReflectConstruct = function() {
return !!result;
})();
}
function getFormatFromUrl(a0) { // fn#76883, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10001:825, offset: 0x01de8bd7, size: 178 bytes, params: 2, frame: 13
var URL;
var prototype;
var value;
var uRL;
var pathname;
var toLowerCase;
var endsWith;
var value2;
var property;
var GIFType;
var VIDEO;
var error;
try {
URL = global.URL;
} catch (error) {
value = environment;
GIFType = require(dependencyMap[6]).GIFType;
return GIFType.IMAGE;
}
try {
prototype = URL.prototype;
} catch (error) {
value = environment;
GIFType = require(dependencyMap[6]).GIFType;
return GIFType.IMAGE;
}
try {
} catch (error) {
value = environment;
GIFType = require(dependencyMap[6]).GIFType;
return GIFType.IMAGE;
}
try {
uRL = new URL(a0);
} catch (error) {
value = environment;
GIFType = require(dependencyMap[6]).GIFType;
return GIFType.IMAGE;
}
try {
value = uRL instanceof Object ? uRL : value;
} catch (error) {
value = environment;
GIFType = require(dependencyMap[6]).GIFType;
return GIFType.IMAGE;
}
try {
pathname = value.pathname;
} catch (error) {
value = environment;
GIFType = require(dependencyMap[6]).GIFType;
return GIFType.IMAGE;
}
try {
toLowerCase = pathname.toLowerCase;
} catch (error) {
value = environment;
GIFType = require(dependencyMap[6]).GIFType;
return GIFType.IMAGE;
}
try {
value = Reflect.apply(toLowerCase, pathname, []);
} catch (error) {
value = environment;
GIFType = require(dependencyMap[6]).GIFType;
return GIFType.IMAGE;
}
try {
endsWith = value.endsWith;
} catch (error) {
value = environment;
GIFType = require(dependencyMap[6]).GIFType;
return GIFType.IMAGE;
}
try {
value2 = Reflect.apply(endsWith, value, ['.mp4']);
} catch (error) {
value = environment;
GIFType = require(dependencyMap[6]).GIFType;
return GIFType.IMAGE;
}
if (value2) {
try {
value = environment;
property = dependencyMap[6];
value = require(property);
GIFType = value.GIFType;
VIDEO = GIFType.VIDEO;
} catch (error) {
value = environment;
GIFType = require(dependencyMap[6]).GIFType;
return GIFType.IMAGE;
}
return VIDEO;
}
try {
endsWith = value.endsWith;
} catch (error) {
value = environment;
GIFType = require(dependencyMap[6]).GIFType;
return GIFType.IMAGE;
}
try {
value = Reflect.apply(endsWith, value, ['.webm']);
} catch (error) {
value = environment;
GIFType = require(dependencyMap[6]).GIFType;
return GIFType.IMAGE;
}
if (value) {
try {
} catch (error) {
value = environment;
GIFType = require(dependencyMap[6]).GIFType;
return GIFType.IMAGE;
}
try {
} catch (error) {
value = environment;
GIFType = require(dependencyMap[6]).GIFType;
return GIFType.IMAGE;
}
try {
property = dependencyMap[6];
} catch (error) {
value = environment;
GIFType = require(dependencyMap[6]).GIFType;
return GIFType.IMAGE;
}
try {
value = require(property);
} catch (error) {
value = environment;
GIFType = require(dependencyMap[6]).GIFType;
return GIFType.IMAGE;
}
try {
GIFType = value.GIFType;
} catch (error) {
value = environment;
GIFType = require(dependencyMap[6]).GIFType;
return GIFType.IMAGE;
}
try {
VIDEO = GIFType.VIDEO;
} catch (error) {
value = environment;
GIFType = require(dependencyMap[6]).GIFType;
return GIFType.IMAGE;
}
return VIDEO;
}
GIFType = require(dependencyMap[6]).GIFType;
return GIFType.IMAGE;
}
function _fun76884(a0) { // fn#76884, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10001:1015, offset: 0x01de8c89, size: 255 bytes, params: 2, frame: 16
const closure = GIFPickerViewStore;
env0_6(closure, a0);
return env0_3(closure, [{key: 'getAnalyticsID', value: value_76886}, {key: 'getQuery', value: value_76887},
{key: 'getResultQuery', value: value_76888}, {key: 'getResultItems', value: value_76889},
{key: 'getTrendingCategories', value: value_76890}, {key: 'getSelectedFormat', value: function() {
return 'tinywebp';
}}, {key: 'getSuggestions', value: value_76892}, {key: 'getTrendingSearchTerms', value: value_76893}]);
}
function GIF_PICKER_QUERY_SUCCESS(a0) { // fn#76896, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10001:1967, offset: 0x01de8dd4, size: 93 bytes, params: 2, frame: 12
var value;
let query = a0.query;
if (query == null) {
query = a0.query;
if (query != null) {
query = a0.query;
}
value = a0.items.map(function({width, height, src, gif_src, url, id}) {
return {width: width, height: height, src: src, gifSrc: gif_src, url: url, id: id, format: IMAGE};
});
} else {
if (env0_10 === env0_11) {
return false;
}
query = a0.query;
if (query != null) {
query = a0.query;
}
value = a0.items.map(function({width, height, src, gif_src, url, id}) {
return {width: width, height: height, src: src, gifSrc: gif_src, url: url, id: id, format: IMAGE};
});
}
}
function GIF_PICKER_TRENDING_FETCH_SUCCESS(a0) { // fn#76899, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10001:2309, offset: 0x01de8ea5, size: 218 bytes, params: 2, frame: 21
var r10;
var items;
var object;
var intl;
var src;
var getFormatFromUrlBinding;
const trendingCategories = a0.trendingCategories;
let trendingGIFPreview = a0.trendingGIFPreview;
if (trendingGIFPreview != null) {
object = {};
object.type = GIFPickerResultTypes.TRENDING_GIFS;
intl = require(dependencyMap[7]).intl;
object.name = intl.string(require(dependencyMap[7]).t.H6zNFz);
trendingGIFPreview = a0.trendingGIFPreview;
src = trendingGIFPreview.src;
object.src = src;
getFormatFromUrlBinding = getFormatFromUrl;
trendingGIFPreview = a0.trendingGIFPreview;
src = trendingGIFPreview.src;
object.format = getFormatFromUrlBinding(src);
items = [object];
r10 = dependencyMap;
} else {
items = [];
}
object = [];
arraySpread(object, trendingCategories.map(_fun76900), arraySpread(object, items, 0, r10), r10);
}
function _fun76900(a0) { // fn#76900, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10001:2572, offset: 0x01de8f7f, size: 80 bytes, params: 2, frame: 14
const object2 = {};
copyDataProperties(object2, a0, undefined);
object2['src'] = a0.src;
const value = environment.__proto__;
const TRENDING_CATEGORY = GIFPickerResultTypes.TRENDING_CATEGORY;
object2['type'] = TRENDING_CATEGORY;
object2['format'] = getFormatFromUrl(a0.src);
return object2;
}
@@ -0,0 +1,265 @@
/* Metro module 5219; source: stores/views/PrivateChannelSortStore.tsx; dependencies: [6, 7, 15, 17, 18, 4621, 4622, 5220, 1383, 1379, 1867, 4605, 4864, 1878, 21, 3780, 3738, 5225, 566, 694, 2] */
function _fun46149(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#46149, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5397:6, offset: 0x011a1009, size: 640 bytes, params: 8, frame: 22
const env0_0 = require;
const closure = CONNECTION_OPEN_46154;
const closure2 = CACHE_LOADED_46156;
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 messageRequestStore = importDefault(4621) /* metro dependency 4621: MessageRequestStore */;
const spamMessageRequestStore = importDefault(4622) /* metro dependency 4622: SpamMessageRequestStore */;
const replyNudgeStore = importDefault(5220) /* metro dependency 5220: ReplyNudgeStore */;
const env0_11 = (require(1383) /* metro dependency 1383: ChannelRecord */).isPrivate;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const readStateStore = importDefault(4605) /* metro dependency 4605: ReadStateStore */;
const userGuildSettingsStore = importDefault(4864) /* metro dependency 4864: UserGuildSettingsStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
object = {DEFAULT: 'DEFAULT', FAVORITE: 'FAVORITE'};
const SecondaryIndexMap = (require(3780) /* metro dependency 3780: SecondaryIndexMap */).SecondaryIndexMap;
let secondaryIndexMap = new SecondaryIndexMap(_fun46157, _fun46158);
const env0_19 = [];
const env0_20 = [];
const env0_21 = [];
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
_fun46162(Store).displayName = 'PrivateChannelSortStore';
secondaryIndexMap = new secondaryIndexMap(importDefault(694) /* metro dependency 694: Dispatcher */,
{CONNECTION_OPEN: closure, CONNECTION_OPEN_SUPPLEMENTAL: closure, OVERLAY_INITIALIZE: closure,
CACHE_LOADED: closure2, CACHE_LOADED_LAZY: closure2, CHANNEL_UPDATES: function({channels}) {
channels.forEach(_fun46170);
}, CHANNEL_CREATE: CHANNEL_CREATE_46171, CHANNEL_DELETE: CHANNEL_DELETE_46172, MESSAGE_CREATE: MESSAGE_CREATE_46173,
REPLY_NUDGE_SET: REPLY_NUDGE_SET, GUILD_CREATE: GUILD_CREATE_46175, LOGOUT: LOGOUT_46176});
(require(2) /* metro dependency 2 */).fileFinishedImporting('stores/views/PrivateChannelSortStore.tsx');
exports.default = secondaryIndexMap;
}
function _isNativeReflectConstruct_46150() { // fn#46150, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5397:252, offset: 0x011a1289, 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_46150_isNativeReflectConstruct = function() {
return !!result;
})();
}
function makeSortedChannel(a0) { // fn#46153, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5397:727, offset: 0x011a12e7, size: 286 bytes, params: 2, frame: 20
var r4;
var r0;
var r2;
var isMessageRequestTimestamp;
let value = a1;
if (value !== undefined) {
r2 = value;
} else {
r4 = ReadStateStore.lastMessageId(a0.id) ?? a0.lastMessageId;
r4 = r4 ?? a0.id;
isMessageRequestTimestamp = a0.isMessageRequestTimestamp;
if (isMessageRequestTimestamp == null) {
r0 = r4;
} else {
value = (importDefault(3738) /* metro dependency 3738 */)(isMessageRequestTimestamp);
value = value.valueOf();
value = (importDefault(21) /* metro dependency 21: SnowflakeUtils */).fromTimestamp(value);
r0 = (importDefault(21) /* metro dependency 21: SnowflakeUtils */).compare(r4, value) > 0 ? r4 : value;
}
r2 = r0;
}
const object2 = {};
object2.channelId = a0.id;
object2.lastMessageId = r2;
object2.isFavorite = UserGuildSettingsStore.isMessagesFavorite(a0.id);
object2.isRequest = MessageRequestStore.isMessageRequest(a0.id) || SpamMessageRequestStore.isSpam(a0.id);
object2.nudgeTimestamp = ReplyNudgeStore.getNudgeDMTimestamp(a0.id);
return object2;
}
function CONNECTION_OPEN_46154() { // fn#46154, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5397:1188, offset: 0x011a1405, size: 70 bytes, params: 1, frame: 12
env0_18.clear();
const Object = global.Object;
const values = Object.values;
const getMutablePrivateChannels = ChannelStore.getMutablePrivateChannels;
Reflect.apply(values, Object, [Reflect.apply(getMutablePrivateChannels, ChannelStore, [])]).forEach(_fun46155);
}
function CACHE_LOADED_46156() { // fn#46156, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5397:1324, offset: 0x011a1472, size: 74 bytes, params: 1, frame: 22
var propertyName;
var binding;
const mutablePrivateChannels = ChannelStore.getMutablePrivateChannels();
for (propertyName in mutablePrivateChannels) {
binding = env0_18;
binding.set(propertyName, makeSortedChannel(mutablePrivateChannels[propertyName]));
}
}
function _fun46157({isRequest, isFavorite}) { // fn#46157, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5397:557, offset: 0x011a14bc, size: 58 bytes, params: 2, frame: 3
return isRequest ? [] : [isFavorite ? env0_17.FAVORITE : env0_17.DEFAULT];
}
function _fun46158({lastMessageId, nudgeTimestamp}) { // fn#46158, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5397:619, offset: 0x011a14f6, size: 89 bytes, params: 2, frame: 15
let value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = value.extractTimestamp(lastMessageId);
const Math = global.Math;
return -Math.max(value, nudgeTimestamp ?? 0);
}
function _fun46159() { // fn#46159, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5397:1465, offset: 0x011a154f, size: 123 bytes, params: 1, frame: 14
let binding = env0_18;
let values = binding.values;
const binding2 = env0_17;
const FAVORITE = binding2.FAVORITE;
const value2 = Reflect.apply(values, binding, [FAVORITE]);
binding = env0_18;
values = binding.values;
const DEFAULT = binding2.DEFAULT;
const value3 = Reflect.apply(values, binding, [DEFAULT]);
if (!(env0_19 === value2 && env0_20 === value3)) {
env0_21 = [];
value2.forEach(_fun46160);
value3.forEach(_fun46161);
}
return env0_21;
}
function _fun46162(a0) { // fn#46162, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5397:1641, offset: 0x011a15e5, size: 139 bytes, params: 2, frame: 16
const closure = PrivateChannelSortStore;
env0_7(closure, a0);
return env0_4(closure, [{key: 'initialize', value: function() {
this.waitFor(ChannelStore, GuildStore, MessageRequestStore, ReadStateStore, SpamMessageRequestStore,
UserGuildSettingsStore, UserStore, ReplyNudgeStore);
this.syncWith([UserGuildSettingsStore, MessageRequestStore, ReplyNudgeStore], CONNECTION_OPEN_46154);
}}, {key: 'getPrivateChannelIds', value: value_46165}, {key: 'getSortedChannels', value: value_46166},
{key: 'serializeForOverlay', value: value_46167}]);
}
function CHANNEL_UPDATES_46169({channels}) { // fn#46169, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5397:2643, offset: 0x011a1765, size: 30 bytes, params: 2, frame: 11
channels.forEach(_fun46170);
}
function CHANNEL_CREATE_46171({channel}) { // fn#46171, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5397:2780, offset: 0x011a17d1, size: 110 bytes, params: 2, frame: 17
var r1;
var r0;
var value4;
var binding;
const isPrivate2 = isPrivate(channel.type);
if (isPrivate2) {
value4 = channel.id !== (require(5225) /* metro dependency 5225: FakePlaceholderPrivateChannel */).FAKE_PLACEHOLDER_PRIVATE_CHANNEL_ID;
if (value4) {
binding = env0_18;
binding.set(channel.id, makeSortedChannel(channel));
r1 = undefined;
} else {
r1 = value4;
}
r0 = r1;
} else {
r0 = !!isPrivate2;
}
return r0;
}
function CHANNEL_DELETE_46172({channel}) { // fn#46172, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5397:2950, offset: 0x011a183f, size: 32 bytes, params: 2, frame: 11
return env0_18.delete(channel.id);
}
function MESSAGE_CREATE_46173({channelId, message}) { // fn#46173, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5397:3030, offset: 0x011a185f, size: 94 bytes, params: 2, frame: 17
var channel;
const binding = env0_18;
if (binding.has(channelId)) {
channel = ChannelStore.getChannel(channelId);
return channel != null && env0_18.set(channelId, makeSortedChannel(channel, message.id));
}
return false;
}
function REPLY_NUDGE_SET({channelId}) { // fn#46174, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5397:3196, offset: 0x011a18bd, size: 83 bytes, params: 2, frame: 16
var channel;
const binding = env0_18;
if (binding.has(channelId)) {
channel = ChannelStore.getChannel(channelId);
return channel != null && env0_18.set(channelId, makeSortedChannel(channel));
}
return false;
}
function GUILD_CREATE_46175({guild}) { // fn#46175, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5397:3344, offset: 0x011a1910, size: 32 bytes, params: 2, frame: 11
return env0_18.delete(guild.id);
}
function _fun46155(a0) { // fn#46155, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5397:1284, offset: 0x011a144b, size: 39 bytes, params: 2, frame: 15
const binding = env1_18;
binding.set(a0.id, makeSortedChannel(a0));
}
function _fun46160({channelId}) { // fn#46160, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5397:1557, offset: 0x011a15ca, size: 27 bytes, params: 2, frame: 11
return env1_21.push(channelId);
}
function value_46165() { // fn#46165, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5397:2107, offset: 0x011a16d3, size: 15 bytes, params: 1, frame: 9
return env1_22();
}
function value_46166() { // fn#46166, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5397:2162, offset: 0x011a16e2, size: 61 bytes, params: 1, frame: 13
let binding = env1_18;
let values = binding.values;
const binding2 = env1_17;
const FAVORITE = binding2.FAVORITE;
const items2 = [Reflect.apply(values, binding, [FAVORITE])];
binding = env1_18;
values = binding.values;
const DEFAULT = binding2.DEFAULT;
items2[1] = Reflect.apply(values, binding, [DEFAULT]);
return items2;
}
function value_46167() { // fn#46167, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5397:2257, offset: 0x011a171f, size: 41 bytes, params: 1, frame: 12
var environment;
const value = environment.__proto__;
env1_18.values().forEach(_fun46168);
return {};
}
function _fun46170(a0) { // fn#46170, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5397:2698, offset: 0x011a1783, size: 78 bytes, params: 2, frame: 16
var r2;
var binding;
const isPrivate2 = isPrivate(a0.type);
if (isPrivate2) {
r2 = isPrivate2;
} else {
binding = env1_18;
r2 = binding.has(a0.id);
}
if (r2) {
binding = env1_18;
binding.set(a0.id, makeSortedChannel(a0));
}
}
function _fun46168({channelId, lastMessageId}) { // fn#46168, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5397:2304, offset: 0x011a1748, size: 29 bytes, params: 2, frame: 3
env0_0[channelId] = lastMessageId;
}
@@ -0,0 +1,656 @@
/* Metro module 4300; source: stores/views/SortedVoiceStateStore.tsx; dependencies: [15, 17, 18, 6, 7, 1885, 1226, 1379, 1945, 1878, 4297, 661, 3995, 3780, 22, 21, 566, 694, 2] */
function _fun36594(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#36594, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:6, offset: 0x0108f2b1, size: 610 bytes, params: 8, frame: 23
const env0_0 = require;
const _arrayLikeToArray_36600 = 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 getMember = function(a0, a1) {
return GuildMemberStore.getMember(a0, a1.id);
};
const closure = makeMemberAndComparator;
const closure2 = function(a0, a1) {
var r5;
r5 = a0.selfStream ? '\x00' : '\x01';
value = a1.toLowerCase();
var userId = a0.userId;
return '' + r5 + value + '\x00' + userId;
};
const closure3 = makeSortedVoiceState;
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(15) /* metro dependency 15 */;
const env0_4 = importDefault(17) /* metro dependency 17 */;
const env0_5 = importDefault(18) /* metro dependency 18 */;
const env0_6 = importDefault(6) /* metro dependency 6 */;
const env0_7 = importDefault(7) /* metro dependency 7 */;
const userRecord = importDefault(1885) /* metro dependency 1885: UserRecord */;
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const voiceStateStore = importDefault(4297) /* metro dependency 4297: VoiceStateStore */;
const env0_14 = (require(661) /* metro dependency 661: Constants */).ME;
Object = global.Object;
let value = Object.freeze([]);
let env0_16 = {};
const env0_17 = _fun36611();
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
let value2 = _fun36626(Store);
value2.displayName = 'SortedVoiceStateStore';
let value5 = new value2(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: function() {
env0_16 = {};
}, OVERLAY_INITIALIZE: function() {
init_36608();
}, VOICE_CHANNEL_SELECT: VOICE_CHANNEL_SELECT_36637, VOICE_STATE_UPDATES: function({voiceStates}) {
return voiceStates.reduce(_fun36639, false);
}, GUILD_MEMBER_UPDATE: GUILD_MEMBER_UPDATE_36640, GUILD_CREATE: GUILD_CREATE_36641,
GUILD_DELETE: GUILD_DELETE_36642, PASSIVE_UPDATE_V2: PASSIVE_UPDATE_V2_36643});
(require(2) /* metro dependency 2 */).fileFinishedImporting('stores/views/SortedVoiceStateStore.tsx');
exports.default = value5;
exports.NO_VOICE_STATES = value;
exports.makeMemberAndComparator = closure;
exports.getComparator = closure2;
exports.makeSortedVoiceState = closure3;
}
function _isNativeReflectConstruct_36595() { // fn#36595, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:226, offset: 0x0108f513, 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_36595_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _createForOfIteratorHelperLoose_36598(a0, a1) { // fn#36598, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:419, offset: 0x0108f571, 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 _fun36599;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_36600(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_36600(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_36600(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun36599;
}
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 getVoiceStatesForGuild(a0) { // fn#36601, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:1358, offset: 0x0108f6e3, size: 60 bytes, params: 2, frame: 13
var r0;
var env0_172;
const property = env0_16[a0];
if (property != null) {
r0 = property;
} else {
env0_172 = new env0_17(a0);
env0_16[a0] = env0_172;
r0 = env0_172;
}
return r0;
}
function makeMemberAndComparator(a0, a1, a2) { // fn#36603, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:1493, offset: 0x0108f73f, size: 90 bytes, params: 4, frame: 17
var r2;
const object2 = {member: a1};
var value;
const getComparatorBinding = getComparator;
const nick = a1?.nick;
if (nick != null) {
r2 = nick;
} else {
value = importDefault(3995) /* metro dependency 3995: UserUtils */;
value = value.getName(a2);
r2 = value;
}
object2.comparator = getComparatorBinding(a0, r2);
return object2;
}
function makeSortedVoiceState(a0, a1, a2, a3) { // fn#36605, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:1730, offset: 0x0108f7e3, size: 245 bytes, params: 5, frame: 22
var r7;
var userRecord;
const user = UserStore.getUser(a2);
const value3 = user == null;
if (user != null) {
r7 = user;
} else {
({id: a2, username: '...'}).discriminator = a2.slice(-5, -1);
userRecord = new UserRecord();
}
const makeMemberAndComparatorBinding = makeMemberAndComparator;
const getMemberBinding = getMember;
const value = undefined;
const memberAndComparator = makeMemberAndComparatorBinding(a0, getMemberBinding(a1, r7), r7);
const member = memberAndComparator.member;
const object2 = {voiceState: a0, user: r7, member: member};
object2.comparator = memberAndComparator.comparator;
object2.nick = member == null ? value : member.nick;
object2.connectedOn = (a3 == null ? value : a3.connectedOn) ?? global.Date.now();
if (value3) {
object2._isPlaceholder = true;
}
return object2;
}
function handleUpdateUsers() { // fn#36606, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:4394, offset: 0x0108f8d8, size: 53 bytes, params: 1, frame: 15
const defaultImport = importDefault(22) /* metro dependency 22 */;
return defaultImport.reduce(env0_16, function(a0, a1) {
return a1.updateUsers() || a0;
}, false);
}
function init_36608() { // fn#36608, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:4480, offset: 0x0108f925, size: 78 bytes, params: 1, frame: 13
env0_16 = {};
const allVoiceStates = VoiceStateStore.getAllVoiceStates();
let value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = value.keys(allVoiceStates);
value.forEach(_fun36609);
}
function _fun36611() { // fn#36611, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:2174, offset: 0x0108f9e1, size: 239 bytes, params: 1, frame: 15
return env0_7(SortedVoiceStates, [{key: 'updateVoiceState', value: value_36615}, {key: 'updateMember',
value: value_36616}, {key: 'updateUsers', value: function() {
var r0;
var env0_0 = this;
var value = this._pending == null;
if (value) {
value = this._voiceStates.values();
value = value.reduce(_fun36618, false);
r0 = value;
} else {
r0 = value;
}
return r0;
}}, {key: 'getUserIds', value: function() {
this.processPending();
return this._voiceStates.keys();
}}, {key: 'getVoiceStates', value: function() {
this.processPending();
return this._voiceStates.indexes();
}}, {key: 'getVoiceStatesForChannel', value: value_36621}, {key: 'countVoiceStatesForChannel', value: function(a0) {
this.processPending();
return this._voiceStates.size(a0);
}}, {key: 'getVersion', value: function() {
this.processPending();
return this._voiceStates.version;
}}, {key: 'processPending', value: function() {
var _pending;
var env0_0 = this;
if (this._pending != null) {
_pending = this._pending;
this._pending = undefined;
_pending.forEach(_fun36625);
}
}}]);
}
function _fun36626(a0) { // fn#36626, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:4658, offset: 0x0108ff9c, size: 208 bytes, params: 2, frame: 16
const closure = SortedVoiceStateStore;
env0_5(closure, a0);
return env0_7(closure, [{key: 'initialize', value: function() {
init_36608();
this.waitFor(AuthenticationStore, ChannelStore, GuildMemberStore, UserStore, VoiceStateStore);
this.syncWith([UserStore], handleUpdateUsers);
}}, {key: 'getVoiceStates', value: function(a0) {
return getVoiceStatesForGuild(a0 ?? ME).getVoiceStates();
}}, {key: 'getAllVoiceStates', value: value_36630}, {key: 'getVoiceStatesForChannel', value: function(a0) {
return getVoiceStatesForGuild(a0.getGuildId() ?? ME).getVoiceStatesForChannel(a0.id);
}}, {key: 'getVoiceStatesForChannelAlt', value: function(a0, a1) {
return getVoiceStatesForGuild(a1 ?? ME).getVoiceStatesForChannel(a0);
}}, {key: 'countVoiceStatesForChannel', value: value_36633}, {key: 'getVoiceStateVersion', value: function(a0) {
return getVoiceStatesForGuild(a0 ?? ME).getVersion();
}}]);
}
function VOICE_CHANNEL_SELECT_36637({guildId}) { // fn#36637, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:6018, offset: 0x01090240, size: 66 bytes, params: 2, frame: 14
var r0;
var value;
const id = AuthenticationStore.getId();
const value3 = id != null;
if (value3) {
value = getVoiceStatesForGuild(guildId ?? ME);
value = value.updateVoiceState(id);
r0 = value;
} else {
r0 = value3;
}
return r0;
}
function VOICE_STATE_UPDATES_36638({voiceStates}) { // fn#36638, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:6174, offset: 0x01090282, size: 32 bytes, params: 2, frame: 13
return voiceStates.reduce(function(a0, a1) {
var value = a0;
var guildId = a1.guildId;
var userId = a1.userId;
return getVoiceStatesForGuild(guildId ?? ME).updateVoiceState(userId) || value;
}, false);
}
function GUILD_MEMBER_UPDATE_36640({guildId, user}) { // fn#36640, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:6352, offset: 0x010902dd, size: 45 bytes, params: 2, frame: 12
const voiceStatesForGuild = getVoiceStatesForGuild(guildId);
return voiceStatesForGuild.updateMember(user.id);
}
function GUILD_CREATE_36641({guild}) { // fn#36641, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:6471, offset: 0x0109030a, size: 28 bytes, params: 2, frame: 2
delete env0_16[guild.id];
}
function PASSIVE_UPDATE_V2_36643(a0) { // fn#36643, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:6610, offset: 0x01090326, size: 411 bytes, params: 2, frame: 22
var r3;
var r4;
var r10;
var r0;
var r9;
var value16;
var getVoiceStatesForGuildBinding;
var voiceStatesForGuildBinding;
var value18;
var value19;
var value22;
var has;
var voiceStatesForGuildBinding2;
var value24;
var value25;
let Set = global.Set;
const binding = env0_16;
let guildId = a0.guildId;
const property = binding[guildId];
const value2 = undefined;
let r2 = property == null ? value2 : property.getUserIds();
let set = new Set();
Set = global.Set;
const voiceStates = a0.voiceStates;
let r1 = voiceStates == null ? value2 : voiceStates.map(function(a0) {
return a0.userId;
});
set = new Set();
Set = global.Set;
set = new Set(a0.removedVoiceStateUsers);
const _createForOfIteratorHelperLoose_36598Binding = _createForOfIteratorHelperLoose_36598;
Set = global.Set;
const items2 = [];
arraySpread(items2, set, arraySpread(items2, set, 0, undefined), undefined);
const value11 = Object.create(Set.prototype, {constructor: {value: Set}});
set = new Set(items2);
const value13 = _createForOfIteratorHelperLoose_36598Binding(set instanceof Object ? set : value11);
const value14 = value13();
let done = value14.done;
const value15 = false;
if (done) {
r0 = value15;
} else {
r3 = value15;
r4 = value14;
while (true) {
value16 = r4.value;
getVoiceStatesForGuildBinding = getVoiceStatesForGuild;
guildId = a0.guildId;
voiceStatesForGuildBinding = getVoiceStatesForGuildBinding(guildId);
value18 = voiceStatesForGuildBinding.updateVoiceState(value16);
r10 = value18 || r3;
value19 = value13();
done = value19.done;
if (done) {
r0 = r10;
break;
}
r3 = r10;
r4 = value19;
continue;
}
}
const value20 = _createForOfIteratorHelperLoose_36598(set);
const value21 = value20();
done = value21.done;
if (!done) {
r2 = value21;
r3 = r0;
while (true) {
value22 = r2.value;
has = set.has;
if (Reflect.apply(has, set, [value22])) {
r9 = r3;
} else {
getVoiceStatesForGuildBinding = getVoiceStatesForGuild;
guildId = a0.guildId;
voiceStatesForGuildBinding2 = getVoiceStatesForGuildBinding(guildId);
value24 = voiceStatesForGuildBinding2.updateMember(value22);
if (value24) {
r1 = value24;
continue;
}
r1 = r3;
continue;
r9 = r1;
}
value25 = value20();
done = value25.done;
if (done) {
r0 = r9;
break;
}
r2 = value25;
r3 = r9;
continue;
}
}
return r0;
}
function _fun36609(a0) { // fn#36609, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:4555, offset: 0x0108f973, size: 57 bytes, params: 2, frame: 13
const env0_0 = a0;
const Object = global.Object;
Object.keys(env0_0[a0]).forEach(_fun36610);
}
function SortedVoiceStates(a0) { // fn#36612, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:2195, offset: 0x0108fad0, size: 134 bytes, params: 2, frame: 15
var environment;
const value = environment.__proto__;
env1_6(this, SortedVoiceStates);
const Set = global.Set;
const value3 = Object.create(Set.prototype, {constructor: {value: Set}});
const set = new Set();
this._pending = set instanceof Object ? set : value3;
const SecondaryIndexMap = (require(3780) /* metro dependency 3780: SecondaryIndexMap */).SecondaryIndexMap;
this._voiceStates = new SecondaryIndexMap(function(a0) {
var channelId = a0.voiceState.channelId;
return channelId != null ? [channelId] : [];
}, function(a0) {
return a0.comparator;
});
this.guildId = a0;
}
function value_36615(a0) { // fn#36615, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:2442, offset: 0x0108fb88, size: 334 bytes, params: 2, frame: 22
var r8;
var getMemberBinding;
var value5;
var memberBinding;
var set;
var object2;
if (this._pending != null) {
this._pending.add(a0);
return false;
}
const value = environment.__proto__;
const getVoiceState = VoiceStateStore.getVoiceState;
let guildId = this.guildId;
const value2 = Reflect.apply(getVoiceState, VoiceStateStore, [guildId, a0]);
let _voiceStates = this._voiceStates;
const value3 = _voiceStates.get(a0);
const user = UserStore.getUser(a0);
if (value2 == null) {
if (value3 == null) {
return false;
}
this._voiceStates.delete(a0);
} else {
if (user != null) {
if (value3 == null) {
_voiceStates = this._voiceStates;
_voiceStates.set(a0, makeSortedVoiceState(value2, this.guildId, a0));
return true;
}
if (value3.voiceState !== value2) {
getMemberBinding = getMember;
guildId = this.guildId;
value5 = undefined;
memberBinding = getMemberBinding(guildId, user);
r8 = (memberBinding == null ? value5 : memberBinding.nick) ?? (importDefault(3995) /* metro dependency 3995: UserUtils */).getName(user);
_voiceStates = this._voiceStates;
set = _voiceStates.set;
object2 = {};
copyDataProperties(object2, value3, undefined);
object2['member'] = memberBinding;
object2['comparator'] = getComparator(value2, r8);
object2['nick'] = r8;
object2['voiceState'] = value2;
Reflect.apply(set, _voiceStates, [a0, object2]);
return true;
}
return false;
}
if (value3 == null) {
return false;
}
_voiceStates = this._voiceStates;
_voiceStates.delete(a0);
}
return true;
}
function value_36616(a0) { // fn#36616, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:2998, offset: 0x0108fcd6, size: 282 bytes, params: 2, frame: 22
var comparator;
var set;
var object2;
if (this._pending != null) {
this._pending.add(a0);
} else {
var _voiceStates = this._voiceStates;
var value = _voiceStates.get(a0);
var user = UserStore.getUser(a0);
if (value == null) {
return false;
}
if (user == null) {
return false;
}
var getMemberBinding = getMember;
var guildId = this.guildId;
var value4 = undefined;
var memberBinding = getMemberBinding(guildId, user);
var nick = memberBinding == null ? value4 : memberBinding.nick;
var member = value.member;
if (nick !== (member == null ? value4 : member.nick)) {
comparator = makeMemberAndComparator(value.voiceState, memberBinding, user).comparator;
_voiceStates = this._voiceStates;
set = _voiceStates.set;
object2 = {};
copyDataProperties(object2, value, undefined);
object2['member'] = memberBinding;
object2['comparator'] = comparator;
object2['nick'] = memberBinding == null ? value4 : memberBinding.nick;
Reflect.apply(set, _voiceStates, [a0, object2]);
return true;
}
var avatar = memberBinding == null ? value4 : memberBinding.avatar;
member = value.member;
if (avatar !== (member == null ? value4 : member.avatar)) {
comparator = makeMemberAndComparator(value.voiceState, memberBinding, user).comparator;
_voiceStates = this._voiceStates;
set = _voiceStates.set;
object2 = {};
copyDataProperties(object2, value, undefined);
object2['member'] = memberBinding;
object2['comparator'] = comparator;
object2['nick'] = memberBinding == null ? value4 : memberBinding.nick;
Reflect.apply(set, _voiceStates, [a0, object2]);
return true;
}
}
return false;
}
function value_36617() { // fn#36617, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:3485, offset: 0x0108fdf0, size: 60 bytes, params: 1, frame: 14
var r0;
let value = this._pending == null;
if (value) {
value = this._voiceStates.values();
value = value.reduce(_fun36618, false);
r0 = value;
} else {
r0 = value;
}
return r0;
}
function value_36621(a0) { // fn#36621, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:3946, offset: 0x0108fede, size: 52 bytes, params: 2, frame: 11
this.processPending();
const value = this._voiceStates.values(a0);
return value.length !== 0 ? value : env1_15;
}
function value_36624() { // fn#36624, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:4269, offset: 0x0108ff4f, size: 54 bytes, params: 1, frame: 12
let _pending = this._pending;
if (_pending != null) {
_pending = this._pending;
this._pending = undefined;
_pending.forEach(_fun36625);
}
}
function SortedVoiceStateStore() { // fn#36627, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:4670, offset: 0x0109006c, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_6(this, SortedVoiceStateStore);
const value3 = env1_4(SortedVoiceStateStore);
return env1_3(this, _isNativeReflectConstruct_36595() ? global.Reflect.construct(value3, arguments,
env1_4(this).constructor) : value3.apply(this, arguments));
}
function value_36633(a0) { // fn#36633, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:5548, offset: 0x010901b5, size: 72 bytes, params: 2, frame: 13
const value = environment.__proto__;
const channel = ChannelStore.getChannel(a0);
if (channel == null) {
return 0;
}
return getVoiceStatesForGuild(channel.getGuildId() ?? ME).countVoiceStatesForChannel(a0);
}
function _fun36610(a0) { // fn#36610, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:4586, offset: 0x0108f9ac, size: 53 bytes, params: 2, frame: 13
const value = environment.__proto__.__proto__;
getVoiceStatesForGuild(env0_0 ?? ME).updateVoiceState(a0);
}
function _fun36618(a0, a1) { // fn#36618, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:3559, offset: 0x0108fe2c, size: 117 bytes, params: 3, frame: 21
var r0;
var binding;
var _voiceStates;
const value = a0;
const getUser = UserStore.getUser;
const user = a1.user;
const value3 = Reflect.apply(getUser, UserStore, [user.id]);
if (value3 == null) {
r0 = value;
} else if (a1.user === value3) {
r0 = value;
} else {
binding = env0_0;
_voiceStates = binding._voiceStates;
_voiceStates.set(value3.id, makeSortedVoiceState(a1.voiceState, binding.guildId, value3.id, a1));
r0 = true;
}
return r0;
}
function _fun36625(a0) { // fn#36625, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4472:4356, offset: 0x0108ff85, size: 23 bytes, params: 2, frame: 11
return env0_0.updateVoiceState(a0);
}