3834 lines
179 KiB
TypeScript
3834 lines
179 KiB
TypeScript
/* Metro module 6526; source: utils/AutocompleteUtils.tsx; dependencies: [57, 6, 7, 6527, 6540, 4266, 4613, 6582, 6583, 5071, 3786, 1383, 1939, 1885, 1379, 4267, 6586, 1935, 1945, 1938, 1867, 4814, 3784, 4396, 3793, 1934, 3969, 1878, 4279, 661, 6587, 1386, 6588, 3, 6589, 1418, 4100, 6590, 1861, 3995, 6591, 4785, 22, 1944, 1360, 6592, 3789, 4805, 1244, 21, 6937, 6940, 5103, 6941, 6942, 1362, 6943, 6944, 6637, 6948, 5193, 2] */
|
|
import ClassCallCheck from '../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import defaultImport3 from '../by-id/module-00022.js'; /* Metro dependency 22 */
|
|
import Module00057 from '../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import ChannelStore from '../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import GuildStore from '../stores/GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import UserStore from '../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import UserRecord from '../records/UserRecord.tsx'; /* Metro dependency 1885 */
|
|
import SelectedChannelStore from '../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */
|
|
import GuildChannelStore from '../stores/GuildChannelStore.tsx'; /* Metro dependency 1935 */
|
|
import GuildRoleStore from '../stores/GuildRoleStore.tsx'; /* Metro dependency 1938 */
|
|
import GuildMemberStore from '../stores/GuildMemberStore.tsx'; /* Metro dependency 1945 */
|
|
import PermissionStore from '../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
|
|
import JoinedThreadsStore from '../modules/threads/JoinedThreadsStore.tsx'; /* Metro dependency 3786 */
|
|
import RelationshipStore from '../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
|
|
import SelectedGuildStore from '../stores/SelectedGuildStore.tsx'; /* Metro dependency 3969 */
|
|
import RegexUtils from './RegexUtils.tsx'; /* Metro dependency 4100 */
|
|
import RunningGameStoreNative from '../modules/game_detection/RunningGameStore.native.tsx'; /* Metro dependency 4266 */
|
|
import DetectableGameStore from '../stores/DetectableGameStore.tsx'; /* Metro dependency 4267 */
|
|
import SKUStore from '../stores/game_store/SKUStore.tsx'; /* Metro dependency 4279 */
|
|
import PresenceStore from '../stores/PresenceStore.tsx'; /* Metro dependency 4396 */
|
|
import SoundboardStore from '../modules/soundboard/SoundboardStore.tsx'; /* Metro dependency 4613 */
|
|
import MessageStore from '../stores/MessageStore.tsx'; /* Metro dependency 4814 */
|
|
import ActiveJoinedThreadsStore from '../modules/threads/ActiveJoinedThreadsStore.tsx'; /* Metro dependency 5071 */
|
|
import EmojiStore from '../modules/emojis/EmojiStore.tsx'; /* Metro dependency 6540 */
|
|
import StickersPersistedStore from '../modules/stickers/StickersPersistedStore.tsx'; /* Metro dependency 6582 */
|
|
import StickersStore from '../modules/stickers/StickersStore.tsx'; /* Metro dependency 6583 */
|
|
import FrecencyStore from '../stores/FrecencyStore.tsx'; /* Metro dependency 6586 */
|
|
import SortByMatchScore from '../modules/autocompleter/sortByMatchScore.tsx'; /* Metro dependency 6591 */
|
|
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as IndexNativeModule from '../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as UserSettingsProtoActionCreatorsModule from '../modules/user_settings/UserSettingsProtoActionCreators.tsx'; /* Metro dependency 1362 */
|
|
import * as ChannelConstantsModule from '../modules/channel/ChannelConstants.tsx'; /* Metro dependency 1386 */
|
|
import * as GuildRecordUtilsModule from './GuildRecordUtils.tsx'; /* Metro dependency 1418 */
|
|
import * as StringUtilsModule from './StringUtils.tsx'; /* Metro dependency 1861 */
|
|
import * as GuildRoleRecordModule from '../records/GuildRoleRecord.tsx'; /* Metro dependency 1939 */
|
|
import * as FunctionUtilsModule from './FunctionUtils.tsx'; /* Metro dependency 1944 */
|
|
import * as StickersTypesModule from '../modules/stickers/StickersTypes.tsx'; /* Metro dependency 4785 */
|
|
import * as OnboardingHomeUtilsModule from '../modules/guild_onboarding_home/OnboardingHomeUtils.tsx'; /* Metro dependency 5103 */
|
|
import * as WidgetUtilsModule from '../modules/user_profile/WidgetUtils.tsx'; /* Metro dependency 5193 */
|
|
import * as InAppNavigationRecordModule from '../modules/autocompleter/record/InAppNavigationRecord.tsx'; /* Metro dependency 6527 */
|
|
import * as AutocompleterConstantsModule from '../modules/autocompleter/AutocompleterConstants.tsx'; /* Metro dependency 6587 */
|
|
import * as GuildProfileConstantsModule from '../modules/guild_profile/GuildProfileConstants.tsx'; /* Metro dependency 6588 */
|
|
import * as AutocompleteUtilsModule from './native/AutocompleteUtils.tsx'; /* Metro dependency 6589 */
|
|
import * as GameMentionsExperimentModule from '../modules/game_mentions/GameMentionsExperiment.tsx'; /* Metro dependency 6940 */
|
|
import * as UseGuildOnboardingAvailableModule from '../modules/guild_onboarding/useGuildOnboardingAvailable.tsx'; /* Metro dependency 6941 */
|
|
import * as SearchSoundsModule from '../modules/soundboard/searchSounds.tsx'; /* Metro dependency 6948 */
|
|
|
|
function _fun51294(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#51294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:6, offset: 0x0122e56a, size: 1540 bytes, params: 8, frame: 25
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_51297 = 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 NOOP_51298 = function() {
|
|
return true;
|
|
};
|
|
const closure = function() {
|
|
var value = a0;
|
|
return 1000 * (value !== undefined ? value : 0) * (a1 ?? 1);
|
|
};
|
|
const isValidGuildMember = function(a0) {
|
|
return a0?.joinedAt != null && !a0.isPending;
|
|
};
|
|
const queryMemberList2 = queryMemberList;
|
|
const getRecentlyTalked2 = getRecentlyTalked;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = InAppNavigationRecordModule;
|
|
const env0_7 = value.InAppNavigationRecord;
|
|
const env0_8 = value.InAppNavigationType;
|
|
value = require(1383) /* metro dependency 1383: ChannelRecord */;
|
|
const env0_16 = value.ChannelRecordBase;
|
|
const env0_17 = value.isGuildChannelType;
|
|
const env0_18 = value.isGuildSelectableChannelType;
|
|
const env0_19 = value.isGuildVocalChannelType;
|
|
const env0_20 = value.isThread;
|
|
const env0_21 = value.PrivateChannelRecord;
|
|
const env0_22 = value.UnknownChannelRecord;
|
|
value = require(1935) /* metro dependency 1935: GuildChannelStore */;
|
|
const GUILD_SELECTABLE_CHANNELS_KEY = value.GUILD_SELECTABLE_CHANNELS_KEY;
|
|
const GUILD_VOCAL_CHANNELS_KEY = value.GUILD_VOCAL_CHANNELS_KEY;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_42 = value.Permissions;
|
|
const env0_43 = value.GuildFeatures;
|
|
const ChannelTypes = value.ChannelTypes;
|
|
const env0_45 = value.SKUTypes;
|
|
const env0_46 = value.MAX_AUTOCOMPLETE_RESULTS;
|
|
value = importDefault(3) /* metro dependency 3: Logger */;
|
|
value = new value('AutocompleteUtils');
|
|
const regexp = RegExp('(\\t|\\s)', '');
|
|
const env0_53 = [];
|
|
value = _fun51316();
|
|
value = new value();
|
|
items2 = [GUILD_SELECTABLE_CHANNELS_KEY, GUILD_VOCAL_CHANNELS_KEY];
|
|
const GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
|
|
items2[2] = GUILD_CATEGORY;
|
|
const env0_61 = (FunctionUtilsModule).cachedFunction(_fun51327);
|
|
let object = {queryFriends: queryFriends, queryDMUsers: queryDMUsers, queryChannelUsers: queryChannelUsers,
|
|
queryGuildUsers: queryGuildUsers, queryUsers: queryUsers, queryAllUsers: queryAllUsers,
|
|
queryChannels: queryChannels, queryGuilds: queryGuilds, queryDMChannels: queryDMChannels,
|
|
queryGroupDMs: queryGroupDMs, queryApplications: queryApplications,
|
|
queryInAppNavigations: queryInAppNavigations, querySKUs: querySKUs, getRecentlyTalked: getRecentlyTalked2,
|
|
queryMentionResults: queryMentionResults, queryGuildMentionResults: queryGuildMentionResults,
|
|
queryChoice: queryChoice, queryStaticRouteChannels: queryStaticRouteChannels,
|
|
queryChannelResults: queryChannelResults,
|
|
queryApplicationCommandChannelResults: queryApplicationCommandChannelResults,
|
|
queryChoiceResults: function({query, choices}) {
|
|
var object = {};
|
|
object.choices = this.queryChoice({query: query, choices: choices, limit: null}).map(_fun51371);
|
|
return object;
|
|
}, queryEmojiResults: queryEmojiResults, queryStickers: queryStickers, querySoundmoji: querySoundmoji,
|
|
queryGames: queryGames, matchSentinel: matchSentinel, hasSameRoleAsUsername: hasSameRoleAsUsername,
|
|
queryMemberList: queryMemberList2};
|
|
(FileImportTrackerModule).fileFinishedImporting('utils/AutocompleteUtils.tsx');
|
|
exports.default = object;
|
|
exports.WHITESPACE_REGEX = regexp;
|
|
exports.calculateScore = closure;
|
|
exports.getBoosterMap = getBoosterMap;
|
|
exports.COMMAND_SUPPORTED_CHANNEL_TYPE_KEYS = items2;
|
|
function _createForOfIteratorHelperLoose_51295(a0, a1) { // fn#51295, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:946, offset: 0x0122eb6e, 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 _fun51296;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_51297(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_51297(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_51297(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun51296;
|
|
}
|
|
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 _fun51296() { // fn#51296, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:1517, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
|
|
return env0_1 >= env0_0.length ? {done: true} : {done: false,
|
|
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
|
|
}
|
|
|
|
}
|
|
|
|
function getMatchValue(a0, {exactQuery, containQuery, queryLower}) { // fn#51300, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:4075, offset: 0x0122ed0d, size: 211 bytes, params: 3, frame: 17
|
|
var environment;
|
|
var r0;
|
|
var test;
|
|
var closure;
|
|
var property;
|
|
var value2;
|
|
var binding;
|
|
var error;
|
|
let value = a2;
|
|
const r6 = !(value !== undefined) || value;
|
|
try {
|
|
test = exactQuery.test;
|
|
} catch (error) {
|
|
value = environment;
|
|
binding = env0_50;
|
|
binding.error(error);
|
|
return 0;
|
|
}
|
|
try {
|
|
value = Reflect.apply(test, exactQuery, [a0]);
|
|
} catch (error) {
|
|
value = environment;
|
|
binding = env0_50;
|
|
binding.error(error);
|
|
return 0;
|
|
}
|
|
if (value) {
|
|
try {
|
|
value = a0.toLocaleLowerCase();
|
|
value2 = 7;
|
|
value = value !== queryLower;
|
|
if (value) {
|
|
r0 = value2;
|
|
} else {
|
|
value = environment;
|
|
binding = env0_51;
|
|
r0 = binding;
|
|
}
|
|
} catch (error) {
|
|
value = environment;
|
|
binding = env0_50;
|
|
binding.error(error);
|
|
return 0;
|
|
}
|
|
return r0;
|
|
}
|
|
try {
|
|
test = containQuery.test;
|
|
} catch (error) {
|
|
value = environment;
|
|
binding = env0_50;
|
|
binding.error(error);
|
|
return 0;
|
|
}
|
|
try {
|
|
value = Reflect.apply(test, containQuery, [a0]);
|
|
} catch (error) {
|
|
value = environment;
|
|
binding = env0_50;
|
|
binding.error(error);
|
|
return 0;
|
|
}
|
|
if (value) {
|
|
return 5;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
value = environment;
|
|
binding = env0_50;
|
|
binding.error(error);
|
|
return 0;
|
|
}
|
|
try {
|
|
closure = function(a0, a1) {
|
|
var env0_0 = a1;
|
|
return a0.split(RegExp('(?:,| )+', '')).every(_fun51302);
|
|
};
|
|
} catch (error) {
|
|
value = environment;
|
|
binding = env0_50;
|
|
binding.error(error);
|
|
return 0;
|
|
}
|
|
try {
|
|
value = closure(queryLower, a0);
|
|
} catch (error) {
|
|
value = environment;
|
|
binding = env0_50;
|
|
binding.error(error);
|
|
return 0;
|
|
}
|
|
if (value) {
|
|
return 3;
|
|
}
|
|
if (r6) {
|
|
try {
|
|
} catch (error) {
|
|
value = environment;
|
|
binding = env0_50;
|
|
binding.error(error);
|
|
return 0;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
value = environment;
|
|
binding = env0_50;
|
|
binding.error(error);
|
|
return 0;
|
|
}
|
|
try {
|
|
property = dependencyMap[37];
|
|
} catch (error) {
|
|
value = environment;
|
|
binding = env0_50;
|
|
binding.error(error);
|
|
return 0;
|
|
}
|
|
try {
|
|
value = importDefault(property);
|
|
} catch (error) {
|
|
value = environment;
|
|
binding = env0_50;
|
|
binding.error(error);
|
|
return 0;
|
|
}
|
|
try {
|
|
value = value(queryLower, a0);
|
|
} catch (error) {
|
|
value = environment;
|
|
binding = env0_50;
|
|
binding.error(error);
|
|
return 0;
|
|
}
|
|
if (value) {
|
|
return 1;
|
|
}
|
|
}
|
|
return 0;
|
|
function multiTokenMatch(a0, a1) { // fn#51301, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:4229, owner: getMatchValue.multiTokenMatch, offset: 0x0122ede0, size: 54 bytes, params: 3, frame: 12
|
|
const env0_0 = a1;
|
|
return a0.split(RegExp('(?:,| )+', '')).every(_fun51302);
|
|
function _fun51302(a0) { // fn#51302, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:4293, offset: 0x0122ee16, size: 90 bytes, params: 2, frame: 13
|
|
const RegExp = global.RegExp;
|
|
let value = environment.__proto__.__proto__;
|
|
value = importDefault(4100) /* metro dependency 4100: RegexUtils */;
|
|
value = value.escape(a0);
|
|
const value2 = Object.create(RegExp.prototype, {constructor: {value: RegExp}});
|
|
const regExp = new RegExp(value, 'i');
|
|
return (regExp instanceof Object ? regExp : value2).test(require);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function stripAndNormalize(a0) { // fn#51304, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:4501, offset: 0x0122ee96, size: 91 bytes, params: 2, frame: 15
|
|
if (a0 == null) {
|
|
return [null, null];
|
|
}
|
|
let value = StringUtilsModule;
|
|
value = value.stripDiacritics(a0);
|
|
const items2 = [value];
|
|
items2[1] = StringUtilsModule.normalize(value);
|
|
return items2;
|
|
}
|
|
|
|
function queryMemberList({query, members, limit, filter, allowSnowflake, boosters}) { // fn#51305, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:4628, offset: 0x0122eef1, size: 1897 bytes, params: 2, frame: 83
|
|
var r22;
|
|
var r23;
|
|
var r65;
|
|
var r42;
|
|
var r43;
|
|
var r64;
|
|
var r67;
|
|
var r68;
|
|
var r71;
|
|
var r69;
|
|
var r56;
|
|
var r0;
|
|
var property;
|
|
var nick;
|
|
var value8;
|
|
var userId;
|
|
var guildMemberStoreBinding;
|
|
var getNick;
|
|
var id;
|
|
var value9;
|
|
var value10;
|
|
var defaultImport;
|
|
var getGlobalName;
|
|
var value11;
|
|
var value12;
|
|
var username;
|
|
var value13;
|
|
var moduleValue2;
|
|
var stripDiacritics;
|
|
var value14;
|
|
var moduleValue3;
|
|
var value15;
|
|
var stripAndNormalizeBinding;
|
|
var value16;
|
|
var value17;
|
|
var property2;
|
|
var value18;
|
|
var value19;
|
|
var property3;
|
|
var property4;
|
|
var substring;
|
|
var length2;
|
|
var length3;
|
|
var length4;
|
|
var value20;
|
|
var length5;
|
|
var value21;
|
|
var length6;
|
|
var value22;
|
|
var length7;
|
|
var value23;
|
|
var length8;
|
|
var length9;
|
|
var value24;
|
|
var length10;
|
|
var value25;
|
|
var push;
|
|
var object;
|
|
var USER;
|
|
var calculateScoreBinding;
|
|
var property5;
|
|
var value26;
|
|
var object2;
|
|
var property6;
|
|
var object3;
|
|
var binding;
|
|
var property7;
|
|
var value27;
|
|
var concat;
|
|
var slice;
|
|
var Math;
|
|
var max;
|
|
let value = environment;
|
|
const users = UserStore.getUsers();
|
|
const guildId = SelectedGuildStore.getGuildId();
|
|
const value4 = query.toLocaleLowerCase();
|
|
const value6 = (require(1861) /* metro dependency 1861: StringUtils */).normalize(value4);
|
|
const items3 = [];
|
|
const items2 = [];
|
|
let length = members.length;
|
|
if (0 < length) {
|
|
r22 = 0;
|
|
r23 = 0;
|
|
reducibleLoop1: while (true) {
|
|
property = members[r23];
|
|
if (property instanceof UserRecord) {
|
|
guildMemberStoreBinding = GuildMemberStore;
|
|
getNick = guildMemberStoreBinding.getNick;
|
|
id = property.id;
|
|
value9 = Reflect.apply(getNick, guildMemberStoreBinding, [guildId, id]);
|
|
reducibleJoin7: while (true) {
|
|
if (value9 == null) {
|
|
r42 = undefined;
|
|
break reducibleJoin7;
|
|
}
|
|
toLocaleLowerCase = value9.toLocaleLowerCase;
|
|
value10 = Reflect.apply(toLocaleLowerCase, value9, []);
|
|
r42 = value10;
|
|
break reducibleJoin7;
|
|
}
|
|
r43 = property;
|
|
r65 = r42;
|
|
} else {
|
|
nick = property.nick;
|
|
reducibleJoin4: while (true) {
|
|
if (nick == null) {
|
|
r65 = undefined;
|
|
break reducibleJoin4;
|
|
}
|
|
toLocaleLowerCase = nick.toLocaleLowerCase;
|
|
value8 = Reflect.apply(toLocaleLowerCase, nick, []);
|
|
r65 = value8;
|
|
break reducibleJoin4;
|
|
}
|
|
userId = property.userId;
|
|
property = users[userId];
|
|
r43 = property;
|
|
}
|
|
defaultImport = importDefault(3995) /* metro dependency 3995: UserUtils */;
|
|
getGlobalName = defaultImport.getGlobalName;
|
|
value11 = Reflect.apply(getGlobalName, defaultImport, [r43]);
|
|
reducibleJoin10: while (true) {
|
|
if (value11 == null) {
|
|
r64 = undefined;
|
|
break reducibleJoin10;
|
|
}
|
|
toLocaleLowerCase = value11.toLocaleLowerCase;
|
|
value12 = Reflect.apply(toLocaleLowerCase, value11, []);
|
|
r64 = value12;
|
|
break reducibleJoin10;
|
|
}
|
|
reducibleJoin68: while (true) {
|
|
if (r43 == null) {
|
|
r56 = r22;
|
|
break reducibleJoin68;
|
|
}
|
|
if (filter != null) {
|
|
if (!filter(r43)) {
|
|
r56 = r22;
|
|
break reducibleJoin68;
|
|
}
|
|
}
|
|
username = r43.username;
|
|
toLocaleLowerCase = username.toLocaleLowerCase;
|
|
value13 = Reflect.apply(toLocaleLowerCase, username, []);
|
|
moduleValue2 = require(1861) /* metro dependency 1861: StringUtils */;
|
|
stripDiacritics = moduleValue2.stripDiacritics;
|
|
value14 = Reflect.apply(stripDiacritics, moduleValue2, [value13]);
|
|
moduleValue3 = require(1861) /* metro dependency 1861: StringUtils */;
|
|
value15 = moduleValue3.normalize(value14);
|
|
stripAndNormalizeBinding = stripAndNormalize;
|
|
value16 = stripAndNormalizeBinding(r65);
|
|
value17 = Module00057(value16, 2);
|
|
property = value17[0];
|
|
property2 = value17[1];
|
|
value18 = stripAndNormalizeBinding(r64);
|
|
value19 = Module00057(value18, 2);
|
|
property3 = value19[0];
|
|
property4 = value19[1];
|
|
if (allowSnowflake) {
|
|
id = r43.id;
|
|
if (query === id) {
|
|
push = items3.push;
|
|
object3 = {};
|
|
object3.type = AutocompleterResultTypes.USER;
|
|
object3.record = r43;
|
|
calculateScoreBinding = calculateScore;
|
|
binding = env0_51;
|
|
reducibleJoin63: while (true) {
|
|
if (boosters == null) {
|
|
r69 = undefined;
|
|
break reducibleJoin63;
|
|
}
|
|
id = r43.id;
|
|
property7 = boosters[id];
|
|
r69 = property7;
|
|
break reducibleJoin63;
|
|
}
|
|
object3.score = calculateScoreBinding(binding, r69);
|
|
if (r64 != null) {
|
|
r65 = r64;
|
|
}
|
|
r64 = r65 ?? value13;
|
|
object3.comparator = r64;
|
|
r64 = property3 ?? property;
|
|
r69 = r64 ?? value14;
|
|
object3.sortable = r69;
|
|
Reflect.apply(push, items3, [object3]);
|
|
r56 = r22;
|
|
break reducibleJoin68;
|
|
}
|
|
}
|
|
substring = value13.substring;
|
|
length2 = value4.length;
|
|
if (Reflect.apply(substring, value13, [0, length2]) !== value4) {
|
|
substring = value14.substring;
|
|
length3 = value4.length;
|
|
if (Reflect.apply(substring, value14, [0, length3]) !== value4) {
|
|
reducibleJoin19: while (true) {
|
|
if (r65 == null) {
|
|
r67 = undefined;
|
|
break reducibleJoin19;
|
|
}
|
|
substring = r65.substring;
|
|
length4 = value4.length;
|
|
value20 = Reflect.apply(substring, r65, [0, length4]);
|
|
r67 = value20;
|
|
break reducibleJoin19;
|
|
}
|
|
if (r67 !== value4) {
|
|
reducibleJoin22: while (true) {
|
|
if (property == null) {
|
|
r67 = undefined;
|
|
break reducibleJoin22;
|
|
}
|
|
substring = property.substring;
|
|
length5 = value4.length;
|
|
value21 = Reflect.apply(substring, property, [0, length5]);
|
|
r67 = value21;
|
|
break reducibleJoin22;
|
|
}
|
|
if (r67 !== value4) {
|
|
reducibleJoin25: while (true) {
|
|
if (r64 == null) {
|
|
r67 = undefined;
|
|
break reducibleJoin25;
|
|
}
|
|
substring = r64.substring;
|
|
length6 = value4.length;
|
|
value22 = Reflect.apply(substring, r64, [0, length6]);
|
|
r67 = value22;
|
|
break reducibleJoin25;
|
|
}
|
|
if (r67 !== value4) {
|
|
reducibleJoin28: while (true) {
|
|
if (property3 == null) {
|
|
r67 = undefined;
|
|
break reducibleJoin28;
|
|
}
|
|
substring = property3.substring;
|
|
length7 = value4.length;
|
|
value23 = Reflect.apply(substring, property3, [0, length7]);
|
|
r67 = value23;
|
|
break reducibleJoin28;
|
|
}
|
|
if (r67 !== value4) {
|
|
substring = value15.substring;
|
|
length8 = value6.length;
|
|
if (Reflect.apply(substring, value15, [0, length8]) !== value6) {
|
|
reducibleJoin32: while (true) {
|
|
if (property2 == null) {
|
|
r67 = undefined;
|
|
break reducibleJoin32;
|
|
}
|
|
substring = property2.substring;
|
|
length9 = value6.length;
|
|
value24 = Reflect.apply(substring, property2, [0, length9]);
|
|
r67 = value24;
|
|
break reducibleJoin32;
|
|
}
|
|
if (r67 !== value6) {
|
|
reducibleJoin35: while (true) {
|
|
if (property4 == null) {
|
|
r67 = undefined;
|
|
break reducibleJoin35;
|
|
}
|
|
substring = property4.substring;
|
|
length10 = value6.length;
|
|
value25 = Reflect.apply(substring, property4, [0, length10]);
|
|
r67 = value25;
|
|
break reducibleJoin35;
|
|
}
|
|
if (r67 !== value6) {
|
|
if (r22 < 50) {
|
|
if (!(importDefault(6590) /* metro dependency 6590 */)(value4,
|
|
value14)) {
|
|
if (!(importDefault(6590) /* metro dependency 6590 */)(value6,
|
|
|
|
value15)) {
|
|
if (property != null) {
|
|
if ((importDefault(6590) /* metro dependency 6590 */)(value4,
|
|
|
|
|
|
|
|
property)) {
|
|
push = items2.push;
|
|
object = {};
|
|
object.type = AutocompleterResultTypes.USER;
|
|
object.record = r43;
|
|
calculateScoreBinding = calculateScore;
|
|
reducibleJoin49: while (true) {
|
|
if (boosters == null) {
|
|
r67 = undefined;
|
|
break reducibleJoin49;
|
|
}
|
|
id = r43.id;
|
|
property5 = boosters[id];
|
|
r67 = property5;
|
|
break reducibleJoin49;
|
|
}
|
|
object.score = calculateScoreBinding(1, r67);
|
|
r67 = r64 ?? r65 ?? value13;
|
|
object.comparator = r67;
|
|
r67 = property3 ?? property;
|
|
object.sortable = r67 ?? value14;
|
|
Reflect.apply(push, items2, [object]);
|
|
r56 = r22 + 1;
|
|
break reducibleJoin68;
|
|
}
|
|
}
|
|
if (property2 != null) {
|
|
if ((importDefault(6590) /* metro dependency 6590 */)(value6,
|
|
|
|
|
|
|
|
property2)) {
|
|
push = items2.push;
|
|
object = {};
|
|
object.type = AutocompleterResultTypes.USER;
|
|
object.record = r43;
|
|
calculateScoreBinding = calculateScore;
|
|
reducibleJoin49: while (true) {
|
|
if (boosters == null) {
|
|
r67 = undefined;
|
|
break reducibleJoin49;
|
|
}
|
|
id = r43.id;
|
|
property5 = boosters[id];
|
|
r67 = property5;
|
|
break reducibleJoin49;
|
|
}
|
|
object.score = calculateScoreBinding(1, r67);
|
|
r67 = r64 ?? r65 ?? value13;
|
|
object.comparator = r67;
|
|
r67 = property3 ?? property;
|
|
object.sortable = r67 ?? value14;
|
|
Reflect.apply(push, items2, [object]);
|
|
r56 = r22 + 1;
|
|
break reducibleJoin68;
|
|
}
|
|
}
|
|
if (property3 != null) {
|
|
if ((importDefault(6590) /* metro dependency 6590 */)(value4,
|
|
|
|
|
|
|
|
property3)) {
|
|
push = items2.push;
|
|
object = {};
|
|
object.type = AutocompleterResultTypes.USER;
|
|
object.record = r43;
|
|
calculateScoreBinding = calculateScore;
|
|
reducibleJoin49: while (true) {
|
|
if (boosters == null) {
|
|
r67 = undefined;
|
|
break reducibleJoin49;
|
|
}
|
|
id = r43.id;
|
|
property5 = boosters[id];
|
|
r67 = property5;
|
|
break reducibleJoin49;
|
|
}
|
|
object.score = calculateScoreBinding(1, r67);
|
|
r67 = r64 ?? r65 ?? value13;
|
|
object.comparator = r67;
|
|
r67 = property3 ?? property;
|
|
object.sortable = r67 ?? value14;
|
|
Reflect.apply(push, items2, [object]);
|
|
r56 = r22 + 1;
|
|
break reducibleJoin68;
|
|
}
|
|
}
|
|
if (property4 == null) {
|
|
r56 = r22;
|
|
break reducibleJoin68;
|
|
}
|
|
if (!(importDefault(6590) /* metro dependency 6590 */)(value6,
|
|
|
|
|
|
property4)) {
|
|
r56 = r22;
|
|
break reducibleJoin68;
|
|
}
|
|
}
|
|
}
|
|
push = items2.push;
|
|
object = {};
|
|
object.type = AutocompleterResultTypes.USER;
|
|
object.record = r43;
|
|
calculateScoreBinding = calculateScore;
|
|
reducibleJoin49: while (true) {
|
|
if (boosters == null) {
|
|
r67 = undefined;
|
|
break reducibleJoin49;
|
|
}
|
|
id = r43.id;
|
|
property5 = boosters[id];
|
|
r67 = property5;
|
|
break reducibleJoin49;
|
|
}
|
|
object.score = calculateScoreBinding(1, r67);
|
|
r67 = r64 ?? r65 ?? value13;
|
|
object.comparator = r67;
|
|
r67 = property3 ?? property;
|
|
object.sortable = r67 ?? value14;
|
|
Reflect.apply(push, items2, [object]);
|
|
value26 = r22 + 1;
|
|
r56 = value26;
|
|
break reducibleJoin68;
|
|
}
|
|
r56 = r22;
|
|
break reducibleJoin68;
|
|
}
|
|
}
|
|
}
|
|
push = items3.push;
|
|
object2 = {};
|
|
object2.type = AutocompleterResultTypes.USER;
|
|
object2.record = r43;
|
|
calculateScoreBinding = calculateScore;
|
|
reducibleJoin56: while (true) {
|
|
if (boosters == null) {
|
|
r67 = undefined;
|
|
break reducibleJoin56;
|
|
}
|
|
id = r43.id;
|
|
property6 = boosters[id];
|
|
r67 = property6;
|
|
break reducibleJoin56;
|
|
}
|
|
object2.score = calculateScoreBinding(1, r67);
|
|
r68 = r64 ?? r65;
|
|
r67 = r68 ?? value13;
|
|
object2.comparator = r67;
|
|
r67 = property3 ?? property;
|
|
r71 = r67 ?? value14;
|
|
object2.sortable = r71;
|
|
Reflect.apply(push, items3, [object2]);
|
|
r56 = r22;
|
|
break reducibleJoin68;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
push = items3.push;
|
|
object3 = {};
|
|
USER = AutocompleterResultTypes.USER;
|
|
object3.type = USER;
|
|
object3.record = r43;
|
|
calculateScoreBinding = calculateScore;
|
|
binding = env0_51;
|
|
reducibleJoin63: while (true) {
|
|
if (boosters == null) {
|
|
r69 = undefined;
|
|
break reducibleJoin63;
|
|
}
|
|
id = r43.id;
|
|
property7 = boosters[id];
|
|
r69 = property7;
|
|
break reducibleJoin63;
|
|
}
|
|
object3.score = calculateScoreBinding(binding, r69);
|
|
if (r64 != null) {
|
|
r65 = r64;
|
|
}
|
|
r64 = r65 ?? value13;
|
|
object3.comparator = r64;
|
|
r64 = property3 ?? property;
|
|
r69 = r64 ?? value14;
|
|
object3.sortable = r69;
|
|
Reflect.apply(push, items3, [object3]);
|
|
r56 = r22;
|
|
break reducibleJoin68;
|
|
}
|
|
value27 = r23 + 1;
|
|
if (value27 < length) {
|
|
r22 = r56;
|
|
r23 = value27;
|
|
continue reducibleLoop1;
|
|
}
|
|
break reducibleLoop1;
|
|
}
|
|
}
|
|
let sort = items3.sort;
|
|
Reflect.apply(sort, items3, [importDefault(6591) /* metro dependency 6591: sortByMatchScore */]);
|
|
length = items3.length;
|
|
reducibleJoin71: while (true) {
|
|
if (length < limit) {
|
|
sort = items2.sort;
|
|
Reflect.apply(sort, items2, [importDefault(6591) /* metro dependency 6591: sortByMatchScore */]);
|
|
concat = items3.concat;
|
|
slice = items2.slice;
|
|
Math = global.Math;
|
|
max = Math.max;
|
|
length = items3.length;
|
|
value = Reflect.apply(concat, items3, [Reflect.apply(slice, items2, [0, Reflect.apply(max, Math, [0,
|
|
limit - length])])]);
|
|
r0 = value;
|
|
break reducibleJoin71;
|
|
}
|
|
r0 = items3;
|
|
break reducibleJoin71;
|
|
}
|
|
reducibleJoin73: while (true) {
|
|
if (r0.length > limit) {
|
|
r0.length = limit;
|
|
break reducibleJoin73;
|
|
}
|
|
break reducibleJoin73;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function getPriorityForStickerMetadataType(a0) { // fn#51306, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:6455, offset: 0x0122f65a, size: 204 bytes, params: 2, frame: 14
|
|
const StickerMetadataTypes = (StickersTypesModule).StickerMetadataTypes;
|
|
const STICKER_NAME = StickerMetadataTypes.STICKER_NAME;
|
|
if (STICKER_NAME === a0) {
|
|
return 11;
|
|
}
|
|
const CORRELATED_EMOJI = StickerMetadataTypes.CORRELATED_EMOJI;
|
|
if (CORRELATED_EMOJI === a0) {
|
|
return 6;
|
|
}
|
|
const TAG = StickerMetadataTypes.TAG;
|
|
if (TAG !== a0) {
|
|
var GUILD_NAME = StickerMetadataTypes.GUILD_NAME;
|
|
if (GUILD_NAME === a0) {
|
|
return 8;
|
|
}
|
|
var PACK_NAME = StickerMetadataTypes.PACK_NAME;
|
|
if (PACK_NAME === a0) {
|
|
return 8;
|
|
}
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
function isPartialTypeMatch(a0, a1) { // fn#51307, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:6801, offset: 0x0122f726, size: 33 bytes, params: 3, frame: 12
|
|
return a0 === GUILD_SELECTABLE_CHANNELS_KEY && isGuildVocalChannelType(a1);
|
|
}
|
|
|
|
function getBestScore(a0, a1, a2) { // fn#51308, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:6853, offset: 0x0122f747, size: 146 bytes, params: 4, frame: 27
|
|
var r6;
|
|
var r7;
|
|
var r8;
|
|
var r0;
|
|
var r4;
|
|
var value6;
|
|
var matchValue;
|
|
var value8;
|
|
const value2 = _createForOfIteratorHelperLoose_51295(a1);
|
|
const value3 = value2();
|
|
let done = value3.done;
|
|
const value4 = 0;
|
|
const value5 = null;
|
|
if (done) {
|
|
r0 = value4;
|
|
r4 = value5;
|
|
} else {
|
|
r6 = value5;
|
|
r7 = value4;
|
|
r8 = value3;
|
|
while (true) {
|
|
value6 = r8.value;
|
|
matchValue = getMatchValue(a0, value6, a2);
|
|
if (matchValue > r7) {
|
|
r6 = value6;
|
|
r7 = matchValue;
|
|
}
|
|
value8 = value2();
|
|
done = value8.done;
|
|
if (done) {
|
|
r0 = r7;
|
|
r4 = r6;
|
|
break;
|
|
}
|
|
r8 = value8;
|
|
continue;
|
|
}
|
|
}
|
|
if (value5 != r4) {
|
|
if (r4.isFullMatch) {
|
|
a1.length = value4;
|
|
} else {
|
|
a1.splice(a1.indexOf(r4), 1);
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function getGuildName(a0, a1) { // fn#51309, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:7078, offset: 0x0122f7d9, size: 95 bytes, params: 3, frame: 15
|
|
var r1;
|
|
var r0;
|
|
var property;
|
|
var value;
|
|
var guildStoreBinding;
|
|
let guild_id = a0.guild_id;
|
|
if (guild_id != null) {
|
|
guild_id = a0.guild_id;
|
|
property = a1[guild_id];
|
|
if (property != null) {
|
|
r0 = property;
|
|
} else {
|
|
guild_id = a0.guild_id;
|
|
guildStoreBinding = GuildStore;
|
|
value = guildStoreBinding.getGuild(a0.guild_id);
|
|
if (value == null) {
|
|
r1 = undefined;
|
|
} else {
|
|
value = value.name.toLocaleLowerCase();
|
|
r1 = value;
|
|
}
|
|
a1[guild_id] = r1;
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
}
|
|
|
|
function getCategoryName(a0, a1) { // fn#51310, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:7252, offset: 0x0122f838, size: 98 bytes, params: 3, frame: 15
|
|
var r1;
|
|
var r0;
|
|
var property;
|
|
var value;
|
|
var channelStoreBinding;
|
|
let parent_id = a0.parent_id;
|
|
if (parent_id != null) {
|
|
parent_id = a0.parent_id;
|
|
property = a1[parent_id];
|
|
if (property != null) {
|
|
r0 = property;
|
|
} else {
|
|
parent_id = a0.parent_id;
|
|
channelStoreBinding = ChannelStore;
|
|
value = channelStoreBinding.getChannel(a0.parent_id);
|
|
if (value == null) {
|
|
r1 = undefined;
|
|
} else {
|
|
value = value.name.toLocaleLowerCase();
|
|
r1 = value;
|
|
}
|
|
a1[parent_id] = r1;
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
}
|
|
|
|
function getRecentlyTalked(a0, a1) { // fn#51311, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:7435, offset: 0x0122f89a, size: 196 bytes, params: 3, frame: 14
|
|
var r0;
|
|
var defaultImport;
|
|
var value;
|
|
if (a0 == null) {
|
|
r0 = [];
|
|
} else if (ChannelStore.getChannel(a0) == null) {
|
|
r0 = [];
|
|
} else {
|
|
defaultImport = importDefault(22) /* metro dependency 22 */;
|
|
value = MessageStore.getMessages(a0);
|
|
value = defaultImport(value.toArray());
|
|
value = value.reverse();
|
|
value = value.uniqBy(function(a0) {
|
|
return a0.author.id;
|
|
});
|
|
value = value.map(_fun51313);
|
|
value = value.filter(_fun51314);
|
|
value = value.map(_fun51315);
|
|
value = value.take(a1);
|
|
value = value.value();
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
function _fun51313({author}) { // fn#51313, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:7593, offset: 0x0122f96e, size: 34 bytes, params: 2, frame: 11
|
|
return UserStore.getUser(author.id);
|
|
}
|
|
|
|
function _fun51314(a0) { // fn#51314, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:7629, offset: 0x0122f990, size: 91 bytes, params: 2, frame: 15
|
|
var r0;
|
|
var value3;
|
|
var isValidGuildMemberBinding;
|
|
var guildMemberStoreBinding;
|
|
if (a0 == null) {
|
|
return false;
|
|
}
|
|
if (a0.isNonUserBot()) {
|
|
return false;
|
|
}
|
|
var value;
|
|
const value2 = env0_0.getGuildId() == null;
|
|
if (value2) {
|
|
r0 = value2;
|
|
} else {
|
|
value3 = environment.__proto__;
|
|
isValidGuildMemberBinding = isValidGuildMember;
|
|
guildMemberStoreBinding = GuildMemberStore;
|
|
value = guildMemberStoreBinding.getMember(value, a0.id);
|
|
value = isValidGuildMemberBinding(value);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun51315(a0) { // fn#51315, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:7767, offset: 0x0122f9eb, size: 145 bytes, params: 2, frame: 17
|
|
var r1;
|
|
let value = env0_0.getGuildId();
|
|
const value2 = null;
|
|
const r6 = value2 != value ? GuildMemberStore.getMember(value, a0.id) : value2;
|
|
const object = {};
|
|
value = environment.__proto__;
|
|
const USER = AutocompleterResultTypes.USER;
|
|
object.type = USER;
|
|
object.record = a0;
|
|
object.score = 0;
|
|
const nick = value2 == r6 ? undefined : r6.nick;
|
|
if (value2 != nick) {
|
|
r1 = nick;
|
|
} else {
|
|
value = importDefault(3995) /* metro dependency 3995: UserUtils */;
|
|
value = value.getName(a0);
|
|
r1 = value;
|
|
}
|
|
object.comparator = r1;
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
function _fun51316() { // fn#51316, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:2211, offset: 0x0122fa7c, size: 101 bytes, params: 1, frame: 15
|
|
return CreateClass(AutocompleteBoostersCache, [{key: 'get', value: function(a0) {
|
|
if (this.isStale()) {
|
|
this.cache.clear();
|
|
}
|
|
var value = this.cache.get(a0);
|
|
if (value == null) {
|
|
value = this.build(a0);
|
|
this.cache.set(a0, value);
|
|
}
|
|
return value;
|
|
}}, {key: 'isStale', value: value_51319}, {key: 'build', value: value_51320}]);
|
|
function AutocompleteBoostersCache() { // fn#51317, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:2232, offset: 0x0122fae1, size: 81 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
env1_5(this, AutocompleteBoostersCache);
|
|
this.lastFrecencyVersion = null;
|
|
this.lastRelationshipVersion = null;
|
|
this.lastPrivateChannelsVersion = null;
|
|
const Map = global.Map;
|
|
this.cache = new Map();
|
|
}
|
|
|
|
function value_51319() { // fn#51319, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:2606, offset: 0x0122fb8b, size: 109 bytes, params: 1, frame: 13
|
|
let value = environment.__proto__;
|
|
const version = FrecencyStore.getVersion();
|
|
const version2 = RelationshipStore.getVersion();
|
|
value = ChannelStore.getPrivateChannelsVersion();
|
|
let r0 = this.lastFrecencyVersion !== version || this.lastRelationshipVersion !== version2;
|
|
r0 = !r0 ? this.lastPrivateChannelsVersion !== value : r0;
|
|
if (r0) {
|
|
this.lastFrecencyVersion = version;
|
|
this.lastRelationshipVersion = version2;
|
|
this.lastPrivateChannelsVersion = value;
|
|
value = true;
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_51320(a0) { // fn#51320, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:2914, offset: 0x0122fbf8, size: 708 bytes, params: 2, frame: 31
|
|
var environment;
|
|
var r3;
|
|
var r8;
|
|
var r17;
|
|
var r2;
|
|
var r1;
|
|
var USER;
|
|
var GROUP_DM;
|
|
var filter;
|
|
var value4;
|
|
var value12;
|
|
var id;
|
|
var getScoreWithoutFetchingLatest;
|
|
var value13;
|
|
var type;
|
|
var DM;
|
|
var recipients;
|
|
var length;
|
|
var value14;
|
|
var value15;
|
|
var value16;
|
|
var value17;
|
|
var value18;
|
|
var getRecipientId;
|
|
var value19;
|
|
var value20;
|
|
var value23;
|
|
var property;
|
|
var value24;
|
|
var value26;
|
|
var value27;
|
|
let value = environment.__proto__;
|
|
const frequentlyWithoutFetchingLatest = FrecencyStore.getFrequentlyWithoutFetchingLatest();
|
|
let value3 = frequentlyWithoutFetchingLatest.reduce(function(a0, a1) {
|
|
var value = a0;
|
|
var value3 = FrecencyStore.getScoreWithoutFetchingLatest(a1.id);
|
|
return value3 > value ? value3 : value;
|
|
}, 0);
|
|
let object = [];
|
|
const GUILD = AutocompleterResultTypes.GUILD;
|
|
if (GUILD === a0) {
|
|
r3 = frequentlyWithoutFetchingLatest.filter(_fun51322);
|
|
} else {
|
|
USER = AutocompleterResultTypes.USER;
|
|
if (USER === a0) {
|
|
r3 = frequentlyWithoutFetchingLatest.filter(_fun51323);
|
|
} else {
|
|
GROUP_DM = AutocompleterResultTypes.GROUP_DM;
|
|
if (GROUP_DM === a0) {
|
|
r3 = frequentlyWithoutFetchingLatest.filter(_fun51324);
|
|
} else if (AutocompleterResultTypes.TEXT_CHANNEL === a0) {
|
|
r3 = frequentlyWithoutFetchingLatest.filter(_fun51325);
|
|
} else {
|
|
reducibleJoin10: while (true) {
|
|
if (AutocompleterResultTypes.VOICE_CHANNEL !== a0) {
|
|
r3 = object;
|
|
break reducibleJoin10;
|
|
}
|
|
filter = frequentlyWithoutFetchingLatest.filter;
|
|
value4 = Reflect.apply(filter, frequentlyWithoutFetchingLatest, [_fun51326]);
|
|
r3 = value4;
|
|
break reducibleJoin10;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
object = {};
|
|
const value9 = _createForOfIteratorHelperLoose_51295(r3);
|
|
const value10 = value9();
|
|
let done = value10.done;
|
|
const value11 = 1;
|
|
if (!done) {
|
|
r8 = value10;
|
|
reducibleLoop11: while (true) {
|
|
value12 = r8.value;
|
|
id = value12.id;
|
|
frecencyStoreBinding = FrecencyStore;
|
|
getScoreWithoutFetchingLatest = frecencyStoreBinding.getScoreWithoutFetchingLatest;
|
|
value13 = Reflect.apply(getScoreWithoutFetchingLatest, frecencyStoreBinding, [id]);
|
|
USER = AutocompleterResultTypes.USER;
|
|
reducibleJoin19: while (true) {
|
|
reducibleJoin13: while (true) {
|
|
if (a0 !== USER) {
|
|
break reducibleJoin13;
|
|
}
|
|
if (value12 instanceof PrivateChannelRecord) {
|
|
type = value12.type;
|
|
DM = ChannelTypes.DM;
|
|
if (DM === type) {
|
|
getRecipientId = value12.getRecipientId;
|
|
value19 = Reflect.apply(getRecipientId, value12, []);
|
|
object[value19] = value11 + value13 / value3;
|
|
break reducibleJoin19;
|
|
}
|
|
GROUP_DM = ChannelTypes.GROUP_DM;
|
|
if (GROUP_DM !== type) {
|
|
break reducibleJoin19;
|
|
}
|
|
recipients = value12.recipients;
|
|
length = recipients.length;
|
|
_createForOfIteratorHelperLoose_51295Binding = _createForOfIteratorHelperLoose_51295;
|
|
recipients = value12.recipients;
|
|
value14 = _createForOfIteratorHelperLoose_51295Binding(recipients);
|
|
value15 = value14();
|
|
done = value15.done;
|
|
if (done) {
|
|
break reducibleJoin19;
|
|
}
|
|
r17 = value15;
|
|
reducibleLoop17: while (true) {
|
|
value16 = r17.value;
|
|
value17 = value13 / value3;
|
|
object[value16] = value11 + value17 * (value11 / length);
|
|
value18 = value14();
|
|
done = value18.done;
|
|
if (done) {
|
|
break reducibleJoin19;
|
|
}
|
|
r17 = value18;
|
|
continue reducibleLoop17;
|
|
}
|
|
value20 = value9();
|
|
done = value20.done;
|
|
if (done) {
|
|
break reducibleLoop11;
|
|
}
|
|
r8 = value20;
|
|
continue reducibleLoop11;
|
|
}
|
|
break reducibleJoin13;
|
|
}
|
|
object[id] = value11 + value13 / value3;
|
|
break reducibleJoin19;
|
|
}
|
|
value20 = value9();
|
|
done = value20.done;
|
|
if (done) {
|
|
break reducibleLoop11;
|
|
}
|
|
r8 = value20;
|
|
continue reducibleLoop11;
|
|
}
|
|
}
|
|
_createForOfIteratorHelperLoose_51295Binding = _createForOfIteratorHelperLoose_51295;
|
|
const relationshipStoreBinding = RelationshipStore;
|
|
const getFriendIDs = relationshipStoreBinding.getFriendIDs;
|
|
const value21 = _createForOfIteratorHelperLoose_51295Binding(Reflect.apply(getFriendIDs, relationshipStoreBinding,
|
|
[]));
|
|
const value22 = value21();
|
|
done = value22.done;
|
|
if (!done) {
|
|
r3 = value22;
|
|
reducibleLoop21: while (true) {
|
|
value23 = r3.value;
|
|
property = object[value23];
|
|
r2 = property ?? value11;
|
|
object[value23] = r2 + 0.2;
|
|
value24 = value21();
|
|
done = value24.done;
|
|
if (done) {
|
|
break reducibleLoop21;
|
|
}
|
|
r3 = value24;
|
|
continue reducibleLoop21;
|
|
}
|
|
}
|
|
_createForOfIteratorHelperLoose_51295Binding = _createForOfIteratorHelperLoose_51295;
|
|
const channelStoreBinding = ChannelStore;
|
|
const getDMUserIds = channelStoreBinding.getDMUserIds;
|
|
value = _createForOfIteratorHelperLoose_51295Binding(Reflect.apply(getDMUserIds, channelStoreBinding, []));
|
|
const value25 = value();
|
|
done = value25.done;
|
|
if (!done) {
|
|
r2 = value25;
|
|
reducibleLoop24: while (true) {
|
|
value26 = r2.value;
|
|
property = object[value26];
|
|
r1 = property ?? value11;
|
|
object[value26] = r1 + 0.1;
|
|
value27 = value();
|
|
done = value27.done;
|
|
if (done) {
|
|
break reducibleLoop24;
|
|
}
|
|
r2 = value27;
|
|
continue reducibleLoop24;
|
|
}
|
|
}
|
|
return object;
|
|
function _fun51322(a0) { // fn#51322, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:3097, offset: 0x0122fee2, size: 41 bytes, params: 2, frame: 11
|
|
const value = environment.__proto__.__proto__;
|
|
return (GuildRecordUtilsModule).isGuildRecord(a0);
|
|
}
|
|
|
|
function _fun51323(a0) { // fn#51323, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:3159, offset: 0x0122ff0b, size: 38 bytes, params: 2, frame: 4
|
|
const value = environment.__proto__.__proto__;
|
|
return a0 instanceof ChannelRecordBase && a0.type === ChannelTypes.DM;
|
|
}
|
|
|
|
function _fun51324(a0) { // fn#51324, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:3228, offset: 0x0122ff31, size: 29 bytes, params: 2, frame: 10
|
|
const value = environment.__proto__.__proto__;
|
|
return a0 instanceof ChannelRecordBase && a0.isMultiUserDM();
|
|
}
|
|
|
|
function _fun51325(a0) { // fn#51325, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:3305, offset: 0x0122ff4e, size: 35 bytes, params: 2, frame: 12
|
|
const value = environment.__proto__.__proto__;
|
|
return a0 instanceof ChannelRecordBase && isGuildSelectableChannelType(a0.type);
|
|
}
|
|
|
|
function _fun51326(a0) { // fn#51326, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:3375, offset: 0x0122ff71, size: 29 bytes, params: 2, frame: 10
|
|
const value = environment.__proto__.__proto__;
|
|
return a0 instanceof ChannelRecordBase && a0.isGuildVocal();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun51327() { // fn#51327, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:7983, offset: 0x0122ff8e, size: 168 bytes, params: 1, frame: 16
|
|
let Map = global.Map;
|
|
let map = new Map();
|
|
Map = global.Map;
|
|
map = new Map();
|
|
const defaultImport = defaultImport3;
|
|
const channelStoreBinding = ChannelStore;
|
|
const getMutablePrivateChannels = channelStoreBinding.getMutablePrivateChannels;
|
|
defaultImport(Reflect.apply(getMutablePrivateChannels, channelStoreBinding, [])).values().value().forEach(_fun51328);
|
|
return {channelsByRecipientId: map, recipientsById: map, recipients: []};
|
|
function _fun51328(a0) { // fn#51328, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:8090, offset: 0x01230036, size: 160 bytes, params: 2, frame: 17
|
|
var r0;
|
|
var recipientId;
|
|
var value2;
|
|
var user;
|
|
var binding;
|
|
var push;
|
|
var object;
|
|
if (a0.isDM()) {
|
|
recipientId = a0.getRecipientId();
|
|
value2 = environment.__proto__;
|
|
user = UserStore.getUser(recipientId);
|
|
r0 = recipientId == null || user == null;
|
|
r0 = !r0 ? env0_0.has(recipientId) : r0;
|
|
if (!r0) {
|
|
binding = env0_0;
|
|
binding.set(recipientId, a0);
|
|
binding = env0_2;
|
|
push = binding.push;
|
|
object = {userId: recipientId};
|
|
object.nick = RelationshipStore.getNickname(recipientId);
|
|
Reflect.apply(push, binding, [object]);
|
|
binding = env0_1;
|
|
binding.set(recipientId, user);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function queryFriends(a0) { // fn#51329, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:8320, offset: 0x012300d6, size: 135 bytes, params: 2, frame: 18
|
|
const query = a0.query;
|
|
let limit = a0.limit;
|
|
limit = limit === undefined ? 10 : limit;
|
|
a0._fuzzy;
|
|
const filter = a0.filter;
|
|
const queryMemberListBinding = queryMemberList;
|
|
const object = {query: query};
|
|
const value3 = RelationshipStore.getFriendIDs().map(function(a0) {
|
|
return UserStore.getUser(a0);
|
|
});
|
|
object.members = value3.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish);
|
|
object.limit = limit;
|
|
object.filter = filter;
|
|
return queryMemberListBinding(object);
|
|
}
|
|
|
|
function queryDMUsers({query, limit, filter}) { // fn#51331, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:8501, offset: 0x01230174, size: 129 bytes, params: 2, frame: 18
|
|
limit = limit === undefined ? 10 : limit;
|
|
const queryMemberListBinding = queryMemberList;
|
|
const object = {query: query};
|
|
const value3 = ChannelStore.getDMUserIds().map(function(a0) {
|
|
return UserStore.getUser(a0);
|
|
});
|
|
object.members = value3.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish);
|
|
object.limit = limit;
|
|
object.filter = filter;
|
|
return queryMemberListBinding(object);
|
|
}
|
|
|
|
function queryChannelUsers({channelId, query, limit, request, checkRecentlyTalkedOnEmptyQuery, allowSnowflake}) { // fn#51333, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:8657, offset: 0x012301f5, size: 414 bytes, params: 2, frame: 24
|
|
var r6;
|
|
var recentlyTalked;
|
|
var guildMemberStoreBinding;
|
|
var value6;
|
|
var value7;
|
|
var defaultImport;
|
|
var value8;
|
|
var currentUser;
|
|
limit = limit === undefined ? 10 : limit;
|
|
request = request === undefined || request;
|
|
checkRecentlyTalkedOnEmptyQuery = checkRecentlyTalkedOnEmptyQuery === undefined || checkRecentlyTalkedOnEmptyQuery;
|
|
allowSnowflake = !(allowSnowflake === undefined) && allowSnowflake;
|
|
const channel = ChannelStore.getChannel(channelId);
|
|
if (channel == null) {
|
|
return [];
|
|
}
|
|
const r1 = (channel.isThread() ? ChannelStore.getChannel(channel.parent_id) : null) ?? channel;
|
|
if (r1 == null) {
|
|
return [];
|
|
}
|
|
if (r1.isPrivate()) {
|
|
value8 = r1.recipients.map(_fun51334);
|
|
currentUser = UserStore.getCurrentUser();
|
|
if (currentUser == null) {
|
|
r6 = value8;
|
|
} else {
|
|
value8.push({userId: currentUser.id, nick: null});
|
|
r6 = value8;
|
|
}
|
|
} else {
|
|
if (query.length !== 0) {
|
|
guildMemberStoreBinding = GuildMemberStore;
|
|
value6 = guildMemberStoreBinding.getMembers(r1.guild_id);
|
|
} else {
|
|
if (checkRecentlyTalkedOnEmptyQuery) {
|
|
recentlyTalked = getRecentlyTalked(channel.id, limit);
|
|
if (recentlyTalked.length > 0) {
|
|
return recentlyTalked;
|
|
}
|
|
guildMemberStoreBinding = GuildMemberStore;
|
|
value6 = guildMemberStoreBinding.getMembers(r1.guild_id);
|
|
value7 = value6.filter(isValidGuildMember);
|
|
if (request) {
|
|
defaultImport = importDefault(6592) /* metro dependency 6592: GuildUtils */;
|
|
defaultImport.requestMembers(r1.guild_id, query, limit);
|
|
r6 = value7;
|
|
} else {
|
|
r6 = value7;
|
|
}
|
|
return queryMemberList({query: query, members: r6, limit: limit, filter: filter_51335,
|
|
allowSnowflake: allowSnowflake});
|
|
}
|
|
value6 = GuildMemberStore.getMembers(r1.guild_id);
|
|
}
|
|
value7 = value6.filter(isValidGuildMember);
|
|
if (request) {
|
|
defaultImport = importDefault(6592) /* metro dependency 6592: GuildUtils */;
|
|
defaultImport.requestMembers(r1.guild_id, query, limit);
|
|
r6 = value7;
|
|
} else {
|
|
r6 = value7;
|
|
}
|
|
}
|
|
return queryMemberList({query: query, members: r6, limit: limit, filter: filter_51335,
|
|
allowSnowflake: allowSnowflake});
|
|
function _fun51334(a0) { // fn#51334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:8945, offset: 0x01230393, size: 46 bytes, params: 2, frame: 12
|
|
let value = environment.__proto__;
|
|
value = RelationshipStore.getNickname(a0);
|
|
const value2 = null;
|
|
return {userId: a0, nick: value2 != value ? value : value2};
|
|
}
|
|
|
|
function queryChannelUsersFilter(a0) { // fn#51335, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:9314, owner: queryChannelUsers.filter, offset: 0x012303c1, size: 90 bytes, params: 2, frame: 14
|
|
return env0_0.isPrivate() || (importAll(3789) /* metro dependency 3789: PermissionUtils */).can({permission: Permissions.VIEW_CHANNEL,
|
|
user: a0, context: env0_0});
|
|
}
|
|
|
|
}
|
|
|
|
function queryGuildUsers({guildId, query, limit, request, checkRecentlyTalkedOnEmptyQuery, filter, allowSnowflake}) { // fn#51336, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:9412, offset: 0x0123041b, size: 259 bytes, params: 2, frame: 23
|
|
var getRecentlyTalkedBinding;
|
|
var selectedChannelStoreBinding;
|
|
var recentlyTalkedBinding;
|
|
var members;
|
|
var value5;
|
|
limit = limit === undefined ? 10 : limit;
|
|
request = request === undefined || request;
|
|
checkRecentlyTalkedOnEmptyQuery = checkRecentlyTalkedOnEmptyQuery === undefined || checkRecentlyTalkedOnEmptyQuery;
|
|
if (GuildStore.getGuild(guildId) == null) {
|
|
return [];
|
|
}
|
|
if (query.length === 0) {
|
|
if (checkRecentlyTalkedOnEmptyQuery) {
|
|
getRecentlyTalkedBinding = getRecentlyTalked;
|
|
selectedChannelStoreBinding = SelectedChannelStore;
|
|
recentlyTalkedBinding = getRecentlyTalkedBinding(selectedChannelStoreBinding.getChannelId(guildId), limit);
|
|
if (recentlyTalkedBinding.length > 0) {
|
|
return recentlyTalkedBinding;
|
|
}
|
|
members = GuildMemberStore.getMembers(guildId);
|
|
value5 = members.filter(isValidGuildMember);
|
|
if (request && query.length > 0) {
|
|
(importDefault(6592) /* metro dependency 6592: GuildUtils */).requestMembers(guildId, query, limit);
|
|
}
|
|
return queryMemberList({query: query, members: value5, limit: limit, filter: filter,
|
|
allowSnowflake: allowSnowflake});
|
|
}
|
|
}
|
|
members = GuildMemberStore.getMembers(guildId);
|
|
value5 = members.filter(isValidGuildMember);
|
|
if (request && query.length > 0) {
|
|
(importDefault(6592) /* metro dependency 6592: GuildUtils */).requestMembers(guildId, query, limit);
|
|
}
|
|
return queryMemberList({query: query, members: value5, limit: limit, filter: filter,
|
|
allowSnowflake: allowSnowflake});
|
|
}
|
|
|
|
function queryUsers({query, filter, boosters, limit, users, allowSnowflake}) { // fn#51337, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:9841, offset: 0x0123051e, size: 90 bytes, params: 2, frame: 17
|
|
limit = limit === undefined ? 10 : limit;
|
|
return queryMemberList({query: query, members: users, limit: limit, filter: filter, allowSnowflake: allowSnowflake,
|
|
boosters: boosters});
|
|
}
|
|
|
|
function queryAllUsers({query, filter, boosters, limit, request}) { // fn#51338, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:9992, offset: 0x01230578, size: 210 bytes, params: 2, frame: 20
|
|
limit = limit === undefined ? 10 : limit;
|
|
request = request === undefined || request;
|
|
if (request && query.length > 0) {
|
|
(importDefault(6592) /* metro dependency 6592: GuildUtils */).requestMembers(null, query, limit);
|
|
}
|
|
const queryUsers = this.queryUsers;
|
|
const object = {query: query, limit: limit, request: request, filter: filter, boosters: boosters};
|
|
const defaultImport = defaultImport3;
|
|
const userStoreBinding = UserStore;
|
|
const getUsers = userStoreBinding.getUsers;
|
|
let value = defaultImport(Reflect.apply(getUsers, userStoreBinding, []));
|
|
value = value.values();
|
|
object.users = value.value();
|
|
return Reflect.apply(queryUsers, this, [object]);
|
|
}
|
|
|
|
function queryChannels({query, guildId, limit, fuzzy, filter, type, allowEmptyQueries, requireVocalConnectAccess, boosters, allowSnowflake, includeAllThreads}) { // fn#51339, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:10229, offset: 0x0123064a, size: 1702 bytes, params: 2, frame: 76
|
|
var r65;
|
|
var environment;
|
|
var r1;
|
|
var r35;
|
|
var r34;
|
|
var r32;
|
|
var r2;
|
|
var r0;
|
|
var r5;
|
|
var r15;
|
|
var r4;
|
|
var r48;
|
|
var r50;
|
|
var r53;
|
|
var r59;
|
|
var r61;
|
|
var r58;
|
|
var r49;
|
|
var r54;
|
|
var r56;
|
|
var value;
|
|
var value4;
|
|
var value5;
|
|
var defaultImport;
|
|
var channelStoreBinding;
|
|
var value7;
|
|
var concat;
|
|
var defaultImport2;
|
|
var guildChannelStoreBinding;
|
|
var value12;
|
|
var value22;
|
|
var value23;
|
|
var isGuildChannelTypeBinding;
|
|
var value24;
|
|
var isGuildVocalChannelTypeBinding;
|
|
var isGuildVocalChannelType2;
|
|
var isGuildSelectableChannelType2;
|
|
var isGuildVocalChannelType3;
|
|
var permissionStoreBinding;
|
|
var can;
|
|
var VIEW_CHANNEL;
|
|
var accessPermissions;
|
|
var items2;
|
|
var moduleValue;
|
|
var computeChannelName;
|
|
var channelName;
|
|
var toLocaleLowerCase;
|
|
var value25;
|
|
var id;
|
|
var value26;
|
|
var bestScore;
|
|
var binding;
|
|
var length;
|
|
var guildName;
|
|
var items3;
|
|
var property;
|
|
var bestScore2;
|
|
var value30;
|
|
var value31;
|
|
var Math;
|
|
var min;
|
|
var value32;
|
|
var isFullMatch;
|
|
var isPartialTypeMatchBinding;
|
|
var max;
|
|
var value33;
|
|
var isThread2;
|
|
var isActiveThread;
|
|
var value34;
|
|
var joinedThreadsStoreBinding;
|
|
var hasJoined;
|
|
var value35;
|
|
var getScoreWithoutFetchingLatest;
|
|
var value36;
|
|
var value37;
|
|
var value38;
|
|
var value39;
|
|
var value40;
|
|
var push;
|
|
var object2;
|
|
var isGuildVocalChannelType4;
|
|
var TEXT_CHANNEL;
|
|
var VOICE_CHANNEL;
|
|
var calculateScoreBinding;
|
|
var moduleValue2;
|
|
var value41;
|
|
reducibleJoin2: while (true) {
|
|
if (limit !== undefined) {
|
|
r1 = limit;
|
|
break reducibleJoin2;
|
|
}
|
|
value = environment;
|
|
r1 = MAX_AUTOCOMPLETE_RESULTS;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (fuzzy !== undefined) {
|
|
break reducibleJoin4;
|
|
}
|
|
value = true;
|
|
fuzzy = value;
|
|
break reducibleJoin4;
|
|
}
|
|
reducibleJoin6: while (true) {
|
|
if (filter !== undefined) {
|
|
r35 = filter;
|
|
break reducibleJoin6;
|
|
}
|
|
value = environment;
|
|
r35 = NOOP_51298;
|
|
break reducibleJoin6;
|
|
}
|
|
reducibleJoin8: while (true) {
|
|
if (type !== undefined) {
|
|
r34 = type;
|
|
break reducibleJoin8;
|
|
}
|
|
value = environment;
|
|
r34 = GUILD_SELECTABLE_CHANNELS_KEY;
|
|
break reducibleJoin8;
|
|
}
|
|
reducibleJoin10: while (true) {
|
|
if (allowEmptyQueries !== undefined) {
|
|
break reducibleJoin10;
|
|
}
|
|
value = false;
|
|
allowEmptyQueries = value;
|
|
break reducibleJoin10;
|
|
}
|
|
reducibleJoin12: while (true) {
|
|
if (requireVocalConnectAccess !== undefined) {
|
|
break reducibleJoin12;
|
|
}
|
|
value = true;
|
|
requireVocalConnectAccess = value;
|
|
break reducibleJoin12;
|
|
}
|
|
reducibleJoin14: while (true) {
|
|
if (boosters !== undefined) {
|
|
r32 = boosters;
|
|
break reducibleJoin14;
|
|
}
|
|
r32 = {};
|
|
break reducibleJoin14;
|
|
}
|
|
value = getSeparatedQueries(query, allowEmptyQueries);
|
|
const value3 = r34 === GUILD_SELECTABLE_CHANNELS_KEY;
|
|
reducibleJoin18: while (true) {
|
|
if (value3) {
|
|
r0 = value3;
|
|
break reducibleJoin18;
|
|
}
|
|
value4 = r34 !== GUILD_VOCAL_CHANNELS_KEY;
|
|
reducibleJoin17: while (true) {
|
|
if (value4) {
|
|
value5 = !!isThread(r34);
|
|
r2 = value5;
|
|
break reducibleJoin17;
|
|
}
|
|
r2 = value4;
|
|
break reducibleJoin17;
|
|
}
|
|
r0 = r2;
|
|
break reducibleJoin18;
|
|
}
|
|
if (guildId != null) {
|
|
defaultImport2 = importDefault(22) /* metro dependency 22 */;
|
|
guildChannelStoreBinding = GuildChannelStore;
|
|
value12 = defaultImport2(guildChannelStoreBinding.getChannels(guildId)[r34]).map(function(a0) {
|
|
return a0.channel;
|
|
});
|
|
concat = value12.concat;
|
|
r0 = r0 ? includeAllThreads ? ChannelStore.getAllThreadsForGuild(guildId) : ActiveJoinedThreadsStore.computeAllActiveJoinedThreads(guildId) : [];
|
|
r5 = Reflect.apply(concat, value12, [r0]).value();
|
|
} else {
|
|
defaultImport = importDefault(22) /* metro dependency 22 */;
|
|
channelStoreBinding = ChannelStore;
|
|
value7 = defaultImport(channelStoreBinding.loadAllGuildAndPrivateChannelsFromDisk()).values();
|
|
concat = value7.concat;
|
|
r5 = r0 ? ActiveJoinedThreadsStore.computeAllActiveJoinedThreads() : [];
|
|
r5 = Reflect.apply(concat, value7, [r5]).value();
|
|
}
|
|
const object = {};
|
|
const items4 = [];
|
|
const maxScore = FrecencyStore.getMaxScore();
|
|
const value18 = _createForOfIteratorHelperLoose_51295(r5);
|
|
const value19 = value18();
|
|
let done = value19.done;
|
|
if (!done) {
|
|
r15 = value19;
|
|
reducibleLoop31: while (true) {
|
|
value22 = r15.value;
|
|
type = value22.type;
|
|
value23 = guildId != null;
|
|
reducibleJoin83: while (true) {
|
|
reducibleJoin47: while (true) {
|
|
if (r34 === type) {
|
|
isGuildChannelTypeBinding = isGuildChannelType;
|
|
type = value22.type;
|
|
if (isGuildChannelTypeBinding(type)) {
|
|
permissionStoreBinding = PermissionStore;
|
|
can = permissionStoreBinding.can;
|
|
if (requireVocalConnectAccess) {
|
|
accessPermissions = value22.accessPermissions;
|
|
r4 = accessPermissions;
|
|
} else {
|
|
VIEW_CHANNEL = Permissions.VIEW_CHANNEL;
|
|
r4 = VIEW_CHANNEL;
|
|
}
|
|
if (Reflect.apply(can, permissionStoreBinding, [r4, value22])) {
|
|
break reducibleJoin47;
|
|
}
|
|
break reducibleJoin83;
|
|
}
|
|
break reducibleJoin47;
|
|
}
|
|
if (!value23) {
|
|
if (!isGuildChannelType(type)) {
|
|
break reducibleJoin83;
|
|
}
|
|
}
|
|
if (r34 === GUILD_SELECTABLE_CHANNELS_KEY) {
|
|
isGuildSelectableChannelType2 = isGuildSelectableChannelType(type);
|
|
reducibleJoin40: while (true) {
|
|
if (isGuildSelectableChannelType2) {
|
|
r48 = isGuildSelectableChannelType2;
|
|
break reducibleJoin40;
|
|
}
|
|
isGuildVocalChannelType3 = isGuildVocalChannelType(type);
|
|
r48 = isGuildVocalChannelType3;
|
|
break reducibleJoin40;
|
|
}
|
|
r4 = r48;
|
|
} else {
|
|
value24 = r34 === GUILD_VOCAL_CHANNELS_KEY;
|
|
reducibleJoin37: while (true) {
|
|
if (value24) {
|
|
isGuildVocalChannelType2 = isGuildVocalChannelType(type);
|
|
r4 = isGuildVocalChannelType2;
|
|
break reducibleJoin37;
|
|
}
|
|
r4 = value24;
|
|
break reducibleJoin37;
|
|
}
|
|
}
|
|
if (r4) {
|
|
isGuildChannelTypeBinding = isGuildChannelType;
|
|
type = value22.type;
|
|
if (isGuildChannelTypeBinding(type)) {
|
|
permissionStoreBinding = PermissionStore;
|
|
can = permissionStoreBinding.can;
|
|
if (requireVocalConnectAccess) {
|
|
accessPermissions = value22.accessPermissions;
|
|
r4 = accessPermissions;
|
|
} else {
|
|
VIEW_CHANNEL = Permissions.VIEW_CHANNEL;
|
|
r4 = VIEW_CHANNEL;
|
|
}
|
|
if (Reflect.apply(can, permissionStoreBinding, [r4, value22])) {
|
|
break reducibleJoin47;
|
|
}
|
|
break reducibleJoin83;
|
|
}
|
|
break reducibleJoin47;
|
|
}
|
|
break reducibleJoin83;
|
|
}
|
|
if (r35(value22)) {
|
|
items2 = [];
|
|
arraySpread(items2, value, 0, r65);
|
|
moduleValue = require(4805) /* metro dependency 4805: useChannelName */;
|
|
computeChannelName = moduleValue.computeChannelName;
|
|
channelName = Reflect.apply(computeChannelName, moduleValue, [value22, UserStore,
|
|
RelationshipStore]);
|
|
toLocaleLowerCase = channelName.toLocaleLowerCase;
|
|
value25 = Reflect.apply(toLocaleLowerCase, channelName, []);
|
|
reducibleJoin50: while (true) {
|
|
if (allowSnowflake) {
|
|
id = value22.id;
|
|
value26 = query === id;
|
|
r50 = value26;
|
|
break reducibleJoin50;
|
|
}
|
|
r50 = allowSnowflake;
|
|
break reducibleJoin50;
|
|
}
|
|
if (r50) {
|
|
binding = env0_51;
|
|
r53 = binding;
|
|
} else {
|
|
bestScore = getBestScore(value25, items2, fuzzy);
|
|
r53 = bestScore;
|
|
}
|
|
if (r53 === 0) {
|
|
break reducibleJoin83;
|
|
}
|
|
length = items2.length;
|
|
reducibleJoin62: while (true) {
|
|
if (length > 0) {
|
|
guildName = getGuildName(value22, object);
|
|
items3 = [guildName];
|
|
items3[1] = getCategoryName(value22, object);
|
|
length = items3.length;
|
|
if (0 < length) {
|
|
r59 = 0;
|
|
r61 = r53;
|
|
reducibleLoop56: while (true) {
|
|
property = items3[r59];
|
|
reducibleJoin60: while (true) {
|
|
if (property == null) {
|
|
r65 = r61;
|
|
break reducibleJoin60;
|
|
}
|
|
if (property === '') {
|
|
r65 = r61;
|
|
break reducibleJoin60;
|
|
}
|
|
bestScore2 = getBestScore(property, items2, false);
|
|
if (bestScore2 === 0) {
|
|
r65 = r61;
|
|
break reducibleJoin60;
|
|
}
|
|
value30 = r61 + 0.5 * bestScore2;
|
|
r65 = value30;
|
|
break reducibleJoin60;
|
|
}
|
|
value31 = typeof r59 === 'bigint' ? r59 + 1n : +r59 + 1;
|
|
length = items3.length;
|
|
if (value31 < length) {
|
|
r59 = value31;
|
|
r61 = r65;
|
|
continue reducibleLoop56;
|
|
}
|
|
r58 = r65;
|
|
break reducibleLoop56;
|
|
}
|
|
} else {
|
|
r58 = r53;
|
|
}
|
|
Math = global.Math;
|
|
min = Math.min;
|
|
value32 = Reflect.apply(min, Math, [6, r58]);
|
|
r49 = value32;
|
|
break reducibleJoin62;
|
|
}
|
|
r49 = r53;
|
|
break reducibleJoin62;
|
|
}
|
|
if (r49 === 0) {
|
|
break reducibleJoin83;
|
|
}
|
|
length = items2.length;
|
|
if (length > 1) {
|
|
break reducibleJoin83;
|
|
}
|
|
length = items2.length;
|
|
if (length === 1) {
|
|
isFullMatch = items2[0].isFullMatch;
|
|
if (!isFullMatch) {
|
|
if (!r50) {
|
|
break reducibleJoin83;
|
|
}
|
|
}
|
|
}
|
|
isPartialTypeMatchBinding = isPartialTypeMatch;
|
|
type = value22.type;
|
|
reducibleJoin69: while (true) {
|
|
if (isPartialTypeMatchBinding(r34, type)) {
|
|
Math = global.Math;
|
|
max = Math.max;
|
|
value33 = Reflect.apply(max, Math, [r49 - 1, 0.5]);
|
|
r53 = value33;
|
|
break reducibleJoin69;
|
|
}
|
|
r53 = r49;
|
|
break reducibleJoin69;
|
|
}
|
|
isThread2 = value22.isThread;
|
|
reducibleJoin75: while (true) {
|
|
if (Reflect.apply(isThread2, value22, [])) {
|
|
isActiveThread = value22.isActiveThread;
|
|
reducibleJoin72: while (true) {
|
|
if (Reflect.apply(isActiveThread, value22, [])) {
|
|
r54 = r53;
|
|
break reducibleJoin72;
|
|
}
|
|
value34 = r53 - 3;
|
|
r54 = value34;
|
|
break reducibleJoin72;
|
|
}
|
|
joinedThreadsStoreBinding = JoinedThreadsStore;
|
|
hasJoined = joinedThreadsStoreBinding.hasJoined;
|
|
id = value22.id;
|
|
reducibleJoin74: while (true) {
|
|
if (Reflect.apply(hasJoined, joinedThreadsStoreBinding, [id])) {
|
|
r53 = r54;
|
|
break reducibleJoin74;
|
|
}
|
|
value35 = r54 - 5;
|
|
r53 = value35;
|
|
break reducibleJoin74;
|
|
}
|
|
r49 = r53;
|
|
break reducibleJoin75;
|
|
}
|
|
r49 = r53;
|
|
break reducibleJoin75;
|
|
}
|
|
Math = global.Math;
|
|
min = Math.min;
|
|
frecencyStoreBinding = FrecencyStore;
|
|
getScoreWithoutFetchingLatest = frecencyStoreBinding.getScoreWithoutFetchingLatest;
|
|
id = value22.id;
|
|
value36 = Reflect.apply(getScoreWithoutFetchingLatest, frecencyStoreBinding, [id]);
|
|
reducibleJoin77: while (true) {
|
|
if (value36 != null) {
|
|
r54 = value36;
|
|
break reducibleJoin77;
|
|
}
|
|
value37 = 0 / maxScore;
|
|
r54 = value37;
|
|
break reducibleJoin77;
|
|
}
|
|
value38 = Reflect.apply(min, Math, [r54, 1]);
|
|
Math = global.Math;
|
|
min = Math.min;
|
|
value39 = r49 + 3 * value38;
|
|
reducibleJoin79: while (true) {
|
|
if (r49 >= 7) {
|
|
binding = env0_51;
|
|
r49 = binding;
|
|
break reducibleJoin79;
|
|
}
|
|
r49 = 7;
|
|
break reducibleJoin79;
|
|
}
|
|
value40 = Reflect.apply(min, Math, [value39, r49]);
|
|
push = items4.push;
|
|
object2 = {};
|
|
isGuildVocalChannelTypeBinding = isGuildVocalChannelType;
|
|
type = value22.type;
|
|
isGuildVocalChannelType4 = isGuildVocalChannelTypeBinding(type);
|
|
if (isGuildVocalChannelType4) {
|
|
VOICE_CHANNEL = AutocompleterResultTypes.VOICE_CHANNEL;
|
|
r56 = VOICE_CHANNEL;
|
|
} else {
|
|
TEXT_CHANNEL = AutocompleterResultTypes.TEXT_CHANNEL;
|
|
r56 = TEXT_CHANNEL;
|
|
}
|
|
object2.type = r56;
|
|
object2.record = value22;
|
|
calculateScoreBinding = calculateScore;
|
|
id = value22.id;
|
|
object2.score = calculateScoreBinding(value40, r32[id]);
|
|
moduleValue2 = require(4805) /* metro dependency 4805: useChannelName */;
|
|
computeChannelName = moduleValue2.computeChannelName;
|
|
object2.comparator = Reflect.apply(computeChannelName, moduleValue2, [value22, UserStore,
|
|
RelationshipStore]);
|
|
object2.sortable = value25;
|
|
Reflect.apply(push, items4, [object2]);
|
|
break reducibleJoin83;
|
|
}
|
|
break reducibleJoin83;
|
|
}
|
|
value41 = value18();
|
|
done = value41.done;
|
|
if (done) {
|
|
break reducibleLoop31;
|
|
}
|
|
r15 = value41;
|
|
continue reducibleLoop31;
|
|
}
|
|
}
|
|
items4.sort(SortByMatchScore);
|
|
value = r1 != null;
|
|
reducibleJoin86: while (true) {
|
|
if (value) {
|
|
length = items4.length;
|
|
value = length > r1;
|
|
r2 = value;
|
|
break reducibleJoin86;
|
|
}
|
|
r2 = value;
|
|
break reducibleJoin86;
|
|
}
|
|
reducibleJoin88: while (true) {
|
|
if (r2) {
|
|
items4.length = r1;
|
|
break reducibleJoin88;
|
|
}
|
|
break reducibleJoin88;
|
|
}
|
|
return items4;
|
|
function getSeparatedQueries(a0) { // fn#51340, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:10421, owner: queryChannels.getSeparatedQueries, offset: 0x01230cf0, size: 295 bytes, params: 2, frame: 24
|
|
var environment;
|
|
var value2;
|
|
var unshift;
|
|
var object;
|
|
var RegExp;
|
|
var value3;
|
|
var value6;
|
|
var prototype;
|
|
var value7;
|
|
var regExp;
|
|
var value10;
|
|
var value11;
|
|
let value = a1;
|
|
const env0_0 = value !== undefined ? value : false;
|
|
value = a0.split(' ');
|
|
value = value.filter(_fun51341);
|
|
value = value.map(_fun51342);
|
|
if (a0.includes(' ')) {
|
|
value2 = a0.toLocaleLowerCase();
|
|
unshift = value.unshift;
|
|
object = {queryLower: value2};
|
|
RegExp = global.RegExp;
|
|
value3 = environment.__proto__;
|
|
value6 = '^' + (importDefault(4100) /* metro dependency 4100: RegexUtils */).escape(value2).replace(' ',
|
|
'( |-)');
|
|
prototype = RegExp.prototype;
|
|
value7 = Object.create(prototype, {constructor: {value: RegExp}});
|
|
regExp = new RegExp(value6, 'i');
|
|
object.exactQuery = regExp instanceof Object ? regExp : value7;
|
|
RegExp = global.RegExp;
|
|
value10 = (importDefault(4100) /* metro dependency 4100: RegexUtils */).escape(value2).replace(' ', '( |-)');
|
|
prototype = RegExp.prototype;
|
|
value11 = Object.create(prototype, {constructor: {value: RegExp}});
|
|
regExp = new RegExp(value10, 'i');
|
|
object.containQuery = regExp instanceof Object ? regExp : value11;
|
|
object.isFullMatch = true;
|
|
Reflect.apply(unshift, value, [object]);
|
|
}
|
|
return value;
|
|
function _fun51341(a0) { // fn#51341, offset: 0x01230e17, size: 23 bytes, params: 2, frame: 2
|
|
return a0 !== '' || env0_0;
|
|
}
|
|
|
|
function _fun51342(a0) { // fn#51342, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:10505, offset: 0x01230e2e, size: 176 bytes, params: 2, frame: 20
|
|
let value = a0.toLocaleLowerCase();
|
|
const object = {queryLower: value};
|
|
let RegExp = global.RegExp;
|
|
const value4 = '^' + (importDefault(4100) /* metro dependency 4100: RegexUtils */).escape(value);
|
|
const value5 = Object.create(RegExp.prototype, {constructor: {value: RegExp}});
|
|
let regExp = new RegExp(value4, 'i');
|
|
object.exactQuery = regExp instanceof Object ? regExp : value5;
|
|
RegExp = global.RegExp;
|
|
value = (importDefault(4100) /* metro dependency 4100: RegexUtils */).escape(value);
|
|
const value7 = Object.create(RegExp.prototype, {constructor: {value: RegExp}});
|
|
regExp = new RegExp(value, 'i');
|
|
object.containQuery = regExp instanceof Object ? regExp : value7;
|
|
object.isFullMatch = false;
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function queryGuilds({query, limit, fuzzy, allowSnowflake, filter, boosters}) { // fn#51344, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:12305, offset: 0x01230ede, size: 502 bytes, params: 2, frame: 32
|
|
var r12;
|
|
var r11;
|
|
var r0;
|
|
var r7;
|
|
var r3;
|
|
var value;
|
|
var toLocaleLowerCase;
|
|
var value11;
|
|
var name;
|
|
var value12;
|
|
var id;
|
|
var matchValue;
|
|
var binding;
|
|
var push;
|
|
var object2;
|
|
var GUILD;
|
|
var calculateScoreBinding;
|
|
var value14;
|
|
reducibleJoin2: while (true) {
|
|
if (limit !== undefined) {
|
|
break reducibleJoin2;
|
|
}
|
|
value = 10;
|
|
limit = value;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (fuzzy !== undefined) {
|
|
break reducibleJoin4;
|
|
}
|
|
value = true;
|
|
fuzzy = value;
|
|
break reducibleJoin4;
|
|
}
|
|
reducibleJoin6: while (true) {
|
|
if (filter !== undefined) {
|
|
r12 = filter;
|
|
break reducibleJoin6;
|
|
}
|
|
value = environment;
|
|
r12 = NOOP_51298;
|
|
break reducibleJoin6;
|
|
}
|
|
reducibleJoin8: while (true) {
|
|
if (boosters !== undefined) {
|
|
r11 = boosters;
|
|
break reducibleJoin8;
|
|
}
|
|
r11 = {};
|
|
break reducibleJoin8;
|
|
}
|
|
value = '';
|
|
reducibleJoin10: while (true) {
|
|
if (value === query) {
|
|
r0 = value;
|
|
break reducibleJoin10;
|
|
}
|
|
toLocaleLowerCase = query.toLocaleLowerCase;
|
|
value = Reflect.apply(toLocaleLowerCase, query, []);
|
|
r0 = value;
|
|
break reducibleJoin10;
|
|
}
|
|
const object = {};
|
|
let RegExp = global.RegExp;
|
|
const value3 = '^' + (RegexUtils).escape(r0);
|
|
const value4 = Object.create(RegExp.prototype, {constructor: {value: RegExp}});
|
|
let regExp = new RegExp(value3, 'i');
|
|
object.exactQuery = regExp instanceof Object ? regExp : value4;
|
|
RegExp = global.RegExp;
|
|
const value6 = (RegexUtils).escape(r0);
|
|
const value7 = Object.create(RegExp.prototype, {constructor: {value: RegExp}});
|
|
regExp = new RegExp(value6, 'i');
|
|
object.containQuery = regExp instanceof Object ? regExp : value7;
|
|
object.queryLower = r0;
|
|
const items2 = [];
|
|
const _createForOfIteratorHelperLoose_51295Binding = _createForOfIteratorHelperLoose_51295;
|
|
const guildStoreBinding = GuildStore;
|
|
const getGuildsArray = guildStoreBinding.getGuildsArray;
|
|
const value9 = _createForOfIteratorHelperLoose_51295Binding(Reflect.apply(getGuildsArray, guildStoreBinding, []));
|
|
const value10 = value9();
|
|
let done = value10.done;
|
|
if (!done) {
|
|
r7 = value10;
|
|
reducibleLoop11: while (true) {
|
|
value11 = r7.value;
|
|
reducibleJoin18: while (true) {
|
|
if (r12(value11)) {
|
|
name = value11.name;
|
|
toLocaleLowerCase = name.toLocaleLowerCase;
|
|
value12 = Reflect.apply(toLocaleLowerCase, name, []);
|
|
reducibleJoin16: while (true) {
|
|
reducibleJoin14: while (true) {
|
|
if (allowSnowflake) {
|
|
id = value11.id;
|
|
if (query === id) {
|
|
binding = env0_51;
|
|
r3 = binding;
|
|
break reducibleJoin16;
|
|
}
|
|
break reducibleJoin14;
|
|
}
|
|
break reducibleJoin14;
|
|
}
|
|
matchValue = getMatchValue(value12, object, fuzzy);
|
|
r3 = matchValue;
|
|
break reducibleJoin16;
|
|
}
|
|
if (r3 > 0) {
|
|
push = items2.push;
|
|
object2 = {};
|
|
GUILD = AutocompleterResultTypes.GUILD;
|
|
object2.type = GUILD;
|
|
object2.record = value11;
|
|
calculateScoreBinding = calculateScore;
|
|
id = value11.id;
|
|
object2.score = calculateScoreBinding(r3, r11[id]);
|
|
name = value11.name;
|
|
object2.comparator = name;
|
|
object2.sortable = value12;
|
|
Reflect.apply(push, items2, [object2]);
|
|
break reducibleJoin18;
|
|
}
|
|
break reducibleJoin18;
|
|
}
|
|
break reducibleJoin18;
|
|
}
|
|
value14 = value9();
|
|
done = value14.done;
|
|
if (done) {
|
|
break reducibleLoop11;
|
|
}
|
|
r7 = value14;
|
|
continue reducibleLoop11;
|
|
}
|
|
}
|
|
items2.sort(SortByMatchScore);
|
|
reducibleJoin21: while (true) {
|
|
if (items2.length > limit) {
|
|
items2.length = limit;
|
|
break reducibleJoin21;
|
|
}
|
|
break reducibleJoin21;
|
|
}
|
|
return items2;
|
|
}
|
|
|
|
function queryDMChannels({query, limit, boosters = {}}) { // fn#51345, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:12876, offset: 0x012310d4, size: 237 bytes, params: 2, frame: 21
|
|
limit = limit === undefined ? 10 : limit;
|
|
const binding = env0_61;
|
|
const privateChannelsVersion = ChannelStore.getPrivateChannelsVersion();
|
|
const version = RelationshipStore.getVersion();
|
|
const userStoreBinding = UserStore;
|
|
const getUserStoreVersion = userStoreBinding.getUserStoreVersion;
|
|
const value4 = binding(privateChannelsVersion, version, Reflect.apply(getUserStoreVersion, userStoreBinding, []));
|
|
const env0_0 = value4.channelsByRecipientId;
|
|
const env0_1 = value4.recipientsById;
|
|
const recipients = value4.recipients;
|
|
const value5 = queryMemberList({query: query, members: recipients, limit: recipients.length, boosters: boosters});
|
|
items2 = [];
|
|
value5.forEach(_fun51346);
|
|
items2.sort(SortByMatchScore);
|
|
if (items2.length > limit) {
|
|
items2.length = limit;
|
|
}
|
|
return items2;
|
|
function _fun51346(a0) { // fn#51346, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:13155, offset: 0x012311c1, size: 167 bytes, params: 2, frame: 17
|
|
var binding;
|
|
var push;
|
|
var object;
|
|
var value3;
|
|
var defaultImport;
|
|
var getUserTag;
|
|
var recipientsByIdBinding;
|
|
const value2 = channelsByRecipientId.get(a0.record.id);
|
|
if (value2 != null) {
|
|
binding = env0_2;
|
|
push = binding.push;
|
|
object = {};
|
|
value3 = environment.__proto__;
|
|
object.type = AutocompleterResultTypes.DM;
|
|
object.record = value2;
|
|
object.score = a0.score;
|
|
defaultImport = importDefault(3995) /* metro dependency 3995: UserUtils */;
|
|
getUserTag = defaultImport.getUserTag;
|
|
recipientsByIdBinding = recipientsById;
|
|
object.comparator = Reflect.apply(getUserTag, defaultImport, [recipientsByIdBinding.get(a0.record.id)]);
|
|
object.sortable = a0.sortable;
|
|
Reflect.apply(push, binding, [object]);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function queryGroupDMs({query, limit, fuzzy, filter, boosters = {}}) { // fn#51347, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:13355, offset: 0x01231268, size: 1260 bytes, params: 2, frame: 73
|
|
var r18;
|
|
var r55;
|
|
var r53;
|
|
var r54;
|
|
var r49;
|
|
var value16;
|
|
var isMultiUserDM;
|
|
var moduleValue3;
|
|
var channelName;
|
|
var value17;
|
|
var moduleValue4;
|
|
var moduleValue5;
|
|
var value18;
|
|
var matchValue;
|
|
var items2;
|
|
var recipients;
|
|
var value20;
|
|
var value21;
|
|
var value22;
|
|
var user;
|
|
var username;
|
|
var defaultImport4;
|
|
var globalName;
|
|
var nickname;
|
|
var push;
|
|
var value26;
|
|
var length;
|
|
var property;
|
|
var moduleValue6;
|
|
var moduleValue7;
|
|
var value27;
|
|
var Math;
|
|
var value28;
|
|
var value29;
|
|
var object;
|
|
var GROUP_DM;
|
|
var calculateScoreBinding;
|
|
var id;
|
|
var moduleValue8;
|
|
var value30;
|
|
limit = limit === undefined ? 10 : limit;
|
|
fuzzy = fuzzy === undefined || fuzzy;
|
|
const r29 = filter !== undefined ? filter : NOOP_51298;
|
|
const stringUtilsModule = require(1861) /* metro dependency 1861: StringUtils */;
|
|
let stripDiacritics = stringUtilsModule.stripDiacritics;
|
|
const moduleValue2 = stringUtilsModule;
|
|
let normalize = moduleValue2.normalize;
|
|
let toLocaleLowerCase = query.toLocaleLowerCase;
|
|
const value2 = Reflect.apply(stripDiacritics, stringUtilsModule, [Reflect.apply(normalize, moduleValue2,
|
|
[Reflect.apply(toLocaleLowerCase, query, [])])]);
|
|
const object2 = {};
|
|
let RegExp = global.RegExp;
|
|
const value4 = '^' + (RegexUtils).escape(value2);
|
|
const value5 = Object.create(RegExp.prototype, {constructor: {value: RegExp}});
|
|
let regExp = new RegExp(value4, 'i');
|
|
object2.exactQuery = regExp instanceof Object ? regExp : value5;
|
|
RegExp = global.RegExp;
|
|
const value7 = (RegexUtils).escape(value2);
|
|
const value8 = Object.create(RegExp.prototype, {constructor: {value: RegExp}});
|
|
regExp = new RegExp(value7, 'i');
|
|
object2.containQuery = regExp instanceof Object ? regExp : value8;
|
|
object2.queryLower = value2;
|
|
const items3 = [];
|
|
let _createForOfIteratorHelperLoose_51295Binding = _createForOfIteratorHelperLoose_51295;
|
|
const channelStoreBinding = ChannelStore;
|
|
const getMutablePrivateChannels = channelStoreBinding.getMutablePrivateChannels;
|
|
const value11 = defaultImport3(Reflect.apply(getMutablePrivateChannels, channelStoreBinding, [])).values();
|
|
const value13 = _createForOfIteratorHelperLoose_51295Binding(value11.value());
|
|
const value14 = value13();
|
|
let done = value14.done;
|
|
if (!done) {
|
|
r18 = value14;
|
|
while (true) {
|
|
value16 = r18.value;
|
|
isMultiUserDM = value16.isMultiUserDM;
|
|
if (Reflect.apply(isMultiUserDM, value16, [])) {
|
|
if (r29(value16)) {
|
|
moduleValue3 = require(4805) /* metro dependency 4805: useChannelName */;
|
|
channelName = moduleValue3.computeChannelName(value16, UserStore, RelationshipStore);
|
|
value17 = channelName.toLocaleLowerCase();
|
|
moduleValue4 = stringUtilsModule;
|
|
stripDiacritics = moduleValue4.stripDiacritics;
|
|
moduleValue5 = require(1861) /* metro dependency 1861: StringUtils */;
|
|
normalize = moduleValue5.normalize;
|
|
value18 = Reflect.apply(stripDiacritics, moduleValue4, [Reflect.apply(normalize, moduleValue5,
|
|
[value17])]);
|
|
matchValue = getMatchValue(value18, object2, fuzzy);
|
|
items2 = [];
|
|
_createForOfIteratorHelperLoose_51295Binding = _createForOfIteratorHelperLoose_51295;
|
|
recipients = value16.recipients;
|
|
value20 = _createForOfIteratorHelperLoose_51295Binding(recipients);
|
|
value21 = value20();
|
|
done = value21.done;
|
|
if (done) {
|
|
continue;
|
|
}
|
|
r55 = value21;
|
|
while (true) {
|
|
value22 = r55.value;
|
|
user = UserStore.getUser(value22);
|
|
if (user != null) {
|
|
username = user.username;
|
|
defaultImport4 = importDefault(3995) /* metro dependency 3995: UserUtils */;
|
|
globalName = defaultImport4.getGlobalName(user);
|
|
nickname = RelationshipStore.getNickname(value22);
|
|
if (username == null) {
|
|
continue;
|
|
}
|
|
items2.push(username);
|
|
if (globalName == null) {
|
|
continue;
|
|
}
|
|
items2.push(globalName);
|
|
if (nickname == null) {
|
|
break;
|
|
}
|
|
items2.push(nickname);
|
|
break;
|
|
}
|
|
value26 = value20();
|
|
done = value26.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r55 = value26;
|
|
continue;
|
|
}
|
|
length = items2.length;
|
|
if (!(0 < length)) {
|
|
r49 = matchValue;
|
|
continue;
|
|
}
|
|
r53 = 0;
|
|
r54 = matchValue;
|
|
while (true) {
|
|
property = items2[r53];
|
|
moduleValue6 = require(1861) /* metro dependency 1861: StringUtils */;
|
|
stripDiacritics = moduleValue6.stripDiacritics;
|
|
moduleValue7 = require(1861) /* metro dependency 1861: StringUtils */;
|
|
normalize = moduleValue7.normalize;
|
|
toLocaleLowerCase = property.toLocaleLowerCase;
|
|
value27 = Reflect.apply(stripDiacritics, moduleValue6, [Reflect.apply(normalize, moduleValue7,
|
|
[Reflect.apply(toLocaleLowerCase, property, [])])]);
|
|
Math = global.Math;
|
|
value28 = Math.min(5, getMatchValue(value27, object2, fuzzy));
|
|
r54 = value28 > r54 ? value28 : r54;
|
|
value29 = typeof r53 === 'bigint' ? r53 + 1n : +r53 + 1;
|
|
length = items2.length;
|
|
if (value29 < length) {
|
|
r53 = value29;
|
|
continue;
|
|
}
|
|
r49 = r54;
|
|
break;
|
|
}
|
|
if (r49 > 0) {
|
|
push = items3.push;
|
|
object = {};
|
|
GROUP_DM = AutocompleterResultTypes.GROUP_DM;
|
|
object.type = GROUP_DM;
|
|
object.record = value16;
|
|
calculateScoreBinding = calculateScore;
|
|
id = value16.id;
|
|
object.score = calculateScoreBinding(r49, boosters[id]);
|
|
moduleValue8 = require(4805) /* metro dependency 4805: useChannelName */;
|
|
object.comparator = moduleValue8.computeChannelName(value16, UserStore, RelationshipStore);
|
|
object.sortable = value18;
|
|
Reflect.apply(push, items3, [object]);
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
value30 = value13();
|
|
done = value30.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r18 = value30;
|
|
continue;
|
|
}
|
|
}
|
|
items3.sort(SortByMatchScore);
|
|
if (items3.length > limit) {
|
|
items3.length = limit;
|
|
}
|
|
return items3;
|
|
}
|
|
|
|
function queryApplications({query, limit, fuzzy, filter}) { // fn#51348, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:14503, offset: 0x01231754, size: 432 bytes, params: 2, frame: 28
|
|
var r7;
|
|
var value11;
|
|
var application;
|
|
var name;
|
|
var value12;
|
|
var matchValue;
|
|
var push;
|
|
var APPLICATION;
|
|
var value14;
|
|
limit = limit === undefined ? 10 : limit;
|
|
fuzzy = fuzzy === undefined || fuzzy;
|
|
const r11 = filter !== undefined ? filter : NOOP_51298;
|
|
let value = query.toLocaleLowerCase();
|
|
const object = {};
|
|
let RegExp = global.RegExp;
|
|
const value4 = '^' + (RegexUtils).escape(value);
|
|
const value5 = Object.create(RegExp.prototype, {constructor: {value: RegExp}});
|
|
let regExp = new RegExp(value4, 'i');
|
|
object.exactQuery = regExp instanceof Object ? regExp : value5;
|
|
RegExp = global.RegExp;
|
|
const value7 = (RegexUtils).escape(value);
|
|
const value8 = Object.create(RegExp.prototype, {constructor: {value: RegExp}});
|
|
regExp = new RegExp(value7, 'i');
|
|
object.containQuery = regExp instanceof Object ? regExp : value8;
|
|
object.queryLower = value;
|
|
const items2 = [];
|
|
value = _createForOfIteratorHelperLoose_51295(LAUNCHABLE_APPLICATIONS());
|
|
const value10 = value();
|
|
let done = value10.done;
|
|
if (!done) {
|
|
r7 = value10;
|
|
while (true) {
|
|
value11 = r7.value;
|
|
application = value11.application;
|
|
if (r11(application)) {
|
|
name = application.name;
|
|
value12 = name.toLocaleLowerCase();
|
|
matchValue = getMatchValue(value12, object, fuzzy);
|
|
if (matchValue > 0) {
|
|
push = items2.push;
|
|
APPLICATION = AutocompleterResultTypes.APPLICATION;
|
|
name = application.name;
|
|
Reflect.apply(push, items2, [{type: APPLICATION, record: application, score: matchValue,
|
|
comparator: name,
|
|
sortable: value12}]);
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
value14 = value();
|
|
done = value14.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r7 = value14;
|
|
continue;
|
|
}
|
|
}
|
|
items2.sort(SortByMatchScore);
|
|
if (items2.length > limit) {
|
|
items2.length = limit;
|
|
}
|
|
return items2;
|
|
}
|
|
|
|
function queryInAppNavigations({query, limit, fuzzy}) { // fn#51349, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:15004, offset: 0x01231904, size: 1173 bytes, params: 2, frame: 37
|
|
var r16;
|
|
var r4;
|
|
var propertyName;
|
|
var propertyName2;
|
|
var property;
|
|
var property2;
|
|
var value10;
|
|
var done;
|
|
var value11;
|
|
var value12;
|
|
var matchValue;
|
|
var push;
|
|
var object;
|
|
var IN_APP_NAVIGATION;
|
|
var value14;
|
|
limit = limit === undefined ? 10 : limit;
|
|
fuzzy = fuzzy === undefined || fuzzy;
|
|
let value = query.toLocaleLowerCase();
|
|
const object2 = {};
|
|
let RegExp = global.RegExp;
|
|
const value4 = '^' + (RegexUtils).escape(value);
|
|
const value5 = Object.create(RegExp.prototype, {constructor: {value: RegExp}});
|
|
let regExp = new RegExp(value4, 'i');
|
|
object2.exactQuery = regExp instanceof Object ? regExp : value5;
|
|
RegExp = global.RegExp;
|
|
const value7 = (RegexUtils).escape(value);
|
|
const value8 = Object.create(RegExp.prototype, {constructor: {value: RegExp}});
|
|
regExp = new RegExp(value7, 'i');
|
|
object2.containQuery = regExp instanceof Object ? regExp : value8;
|
|
object2.queryLower = value;
|
|
const object3 = {};
|
|
const SHOP = InAppNavigationType.SHOP;
|
|
const intl = (IndexNativeModule).intl;
|
|
let string = intl.string;
|
|
const t = (IndexNativeModule).t;
|
|
object3[SHOP] = [Reflect.apply(string, intl, [t.pWG4ze])];
|
|
const SHOP_ORBS_TAB = InAppNavigationType.SHOP_ORBS_TAB;
|
|
string = intl.string;
|
|
let ElYQFS = t.ElYQFS;
|
|
const items2 = [Reflect.apply(string, intl, [ElYQFS])];
|
|
items2[1] = intl.string(t.pWG4ze);
|
|
string = intl.string;
|
|
const EBYkzk = t.EBYkzk;
|
|
items2[2] = Reflect.apply(string, intl, [EBYkzk]);
|
|
object3[SHOP_ORBS_TAB] = items2;
|
|
const QUEST_ORBS = InAppNavigationType.QUEST_ORBS;
|
|
string = intl.string;
|
|
ElYQFS = t.ElYQFS;
|
|
object3[QUEST_ORBS] = [Reflect.apply(string, intl, [ElYQFS]), intl.string(t['v/R2aC']), intl.string(t.qQR4tn)];
|
|
const NITRO_HOME = InAppNavigationType.NITRO_HOME;
|
|
string = intl.string;
|
|
const Ipxkog = t.Ipxkog;
|
|
object3[NITRO_HOME] = [Reflect.apply(string, intl, [Ipxkog])];
|
|
const QUEST_HOME = InAppNavigationType.QUEST_HOME;
|
|
string = intl.string;
|
|
const JALI2K = t.JALI2K;
|
|
object3[QUEST_HOME] = [Reflect.apply(string, intl, [JALI2K])];
|
|
const APPS_HOME = InAppNavigationType.APPS_HOME;
|
|
string = intl.string;
|
|
const PHjkRE = t.PHjkRE;
|
|
const items6 = [Reflect.apply(string, intl, [PHjkRE])];
|
|
string = intl.string;
|
|
const AKcFUj = t.AKcFUj;
|
|
items6[1] = Reflect.apply(string, intl, [AKcFUj]);
|
|
object3[APPS_HOME] = items6;
|
|
const SETTINGS = InAppNavigationType.SETTINGS;
|
|
object3[SETTINGS] = [intl.string(t['3D5yo/'])];
|
|
const items8 = [];
|
|
for (propertyName in object3) {
|
|
property = InAppNavigationType[propertyName];
|
|
property2 = object3[property];
|
|
if (property2 == null) {
|
|
r16 = propertyName2;
|
|
continue;
|
|
}
|
|
value = _createForOfIteratorHelperLoose_51295(property2);
|
|
value10 = value();
|
|
done = value10.done;
|
|
if (done) {
|
|
r16 = propertyName2;
|
|
continue;
|
|
}
|
|
r4 = value10;
|
|
while (true) {
|
|
value11 = r4.value;
|
|
value12 = value11.toLocaleLowerCase();
|
|
matchValue = getMatchValue(value12, object2, fuzzy);
|
|
if (matchValue > 0) {
|
|
push = items8.push;
|
|
object = {};
|
|
IN_APP_NAVIGATION = AutocompleterResultTypes.IN_APP_NAVIGATION;
|
|
object.type = IN_APP_NAVIGATION;
|
|
object.record = InAppNavigationRecord.fromType(property);
|
|
object.score = calculateScore(matchValue);
|
|
object.comparator = value12;
|
|
object.sortable = value12;
|
|
Reflect.apply(push, items8, [object]);
|
|
}
|
|
value14 = value();
|
|
done = value14.done;
|
|
if (done) {
|
|
r16 = propertyName2;
|
|
break;
|
|
}
|
|
r4 = value14;
|
|
continue;
|
|
}
|
|
}
|
|
items8.sort(SortByMatchScore);
|
|
if (items8.length > limit) {
|
|
items8.length = limit;
|
|
}
|
|
return items8;
|
|
}
|
|
|
|
function querySKUs({query, limit, fuzzy, filter}) { // fn#51350, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:16163, offset: 0x01231d99, size: 510 bytes, params: 2, frame: 30
|
|
var r7;
|
|
var value12;
|
|
var type;
|
|
var DURABLE_PRIMARY;
|
|
var name;
|
|
var value13;
|
|
var matchValue;
|
|
var push;
|
|
var SKU;
|
|
var value15;
|
|
limit = limit === undefined ? 10 : limit;
|
|
fuzzy = fuzzy === undefined || fuzzy;
|
|
const r11 = filter !== undefined ? filter : NOOP_51298;
|
|
let value = query.toLocaleLowerCase();
|
|
const object = {};
|
|
let RegExp = global.RegExp;
|
|
const value4 = '^' + (RegexUtils).escape(value);
|
|
const value5 = Object.create(RegExp.prototype, {constructor: {value: RegExp}});
|
|
let regExp = new RegExp(value4, 'i');
|
|
object.exactQuery = regExp instanceof Object ? regExp : value5;
|
|
RegExp = global.RegExp;
|
|
const value7 = (RegexUtils).escape(value);
|
|
const value8 = Object.create(RegExp.prototype, {constructor: {value: RegExp}});
|
|
regExp = new RegExp(value7, 'i');
|
|
object.containQuery = regExp instanceof Object ? regExp : value8;
|
|
object.queryLower = value;
|
|
const items2 = [];
|
|
const _createForOfIteratorHelperLoose_51295Binding = _createForOfIteratorHelperLoose_51295;
|
|
value = importDefault(22) /* metro dependency 22 */;
|
|
const skuStoreBinding = SKUStore;
|
|
const getSKUs = skuStoreBinding.getSKUs;
|
|
value = value(Reflect.apply(getSKUs, skuStoreBinding, []));
|
|
value = value.values();
|
|
value = _createForOfIteratorHelperLoose_51295Binding(value.value());
|
|
const value11 = value();
|
|
let done = value11.done;
|
|
if (!done) {
|
|
r7 = value11;
|
|
while (true) {
|
|
value12 = r7.value;
|
|
type = value12.type;
|
|
DURABLE_PRIMARY = SKUTypes.DURABLE_PRIMARY;
|
|
if (type === DURABLE_PRIMARY) {
|
|
if (r11(value12)) {
|
|
name = value12.name;
|
|
value13 = name.toLocaleLowerCase();
|
|
matchValue = getMatchValue(value13, object, fuzzy);
|
|
if (matchValue > 0) {
|
|
push = items2.push;
|
|
SKU = AutocompleterResultTypes.SKU;
|
|
name = value12.name;
|
|
Reflect.apply(push, items2, [{type: SKU, record: value12, score: matchValue, comparator: name,
|
|
sortable: value13}]);
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
value15 = value();
|
|
done = value15.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r7 = value15;
|
|
continue;
|
|
}
|
|
}
|
|
items2.sort(SortByMatchScore);
|
|
if (items2.length > limit) {
|
|
items2.length = limit;
|
|
}
|
|
return items2;
|
|
}
|
|
|
|
function queryMentionResults({query, channel, canMentionEveryone, canMentionHere, canMentionUsers, canMentionRoles, canMentionOtherGlobals, includeAllGuildUsers, includeNonMentionableRoles, checkRecentlyTalkedOnEmptyQuery, limit, request, allowSnowflake}) { // fn#51351, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:16734, offset: 0x01231f97, size: 963 bytes, params: 2, frame: 28
|
|
var r1;
|
|
var r0;
|
|
var guild;
|
|
var defaultImport;
|
|
var guildRoleStoreBinding;
|
|
var value24;
|
|
canMentionEveryone = !(canMentionEveryone === undefined) && canMentionEveryone;
|
|
canMentionHere = canMentionHere === undefined || canMentionHere;
|
|
canMentionUsers = canMentionUsers === undefined || canMentionUsers;
|
|
canMentionRoles = canMentionRoles === undefined || canMentionRoles;
|
|
if (canMentionOtherGlobals !== undefined) {
|
|
}
|
|
includeAllGuildUsers = !(includeAllGuildUsers === undefined) && includeAllGuildUsers;
|
|
if (includeNonMentionableRoles !== undefined) {
|
|
}
|
|
checkRecentlyTalkedOnEmptyQuery = checkRecentlyTalkedOnEmptyQuery === undefined || checkRecentlyTalkedOnEmptyQuery;
|
|
const r8 = limit !== undefined ? limit : MAX_AUTOCOMPLETE_RESULTS;
|
|
allowSnowflake = !(allowSnowflake === undefined) && allowSnowflake;
|
|
const maybePushOtherGlobal2 = maybePushOtherGlobal;
|
|
const r3 = canMentionUsers ? (includeAllGuildUsers && channel.guild_id != null ? this.queryGuildUsers({guildId: channel.guild_id,
|
|
query: query, limit: r8, checkRecentlyTalkedOnEmptyQuery: checkRecentlyTalkedOnEmptyQuery, request: request,
|
|
allowSnowflake: allowSnowflake}) : this.queryChannelUsers({channelId: channel.id, query: query, limit: r8,
|
|
checkRecentlyTalkedOnEmptyQuery: checkRecentlyTalkedOnEmptyQuery,
|
|
allowSnowflake: allowSnowflake})).map(function({record, score, comparator}) {
|
|
var object = {user: record, score: score, comparator: comparator};
|
|
object.nick = GuildMemberStore.getNick(channel.guild_id, record.id);
|
|
object.status = PresenceStore.getStatus(record.id);
|
|
return object;
|
|
}) : [];
|
|
let env0_7 = r3.length;
|
|
const value15 = query.toLowerCase();
|
|
let items2 = [];
|
|
if (env0_7 < r8) {
|
|
if (canMentionRoles) {
|
|
guild = GuildStore.getGuild(channel.getGuildId());
|
|
if (guild == null) {
|
|
r1 = items2;
|
|
} else {
|
|
defaultImport = importDefault(22) /* metro dependency 22 */;
|
|
guildRoleStoreBinding = GuildRoleStore;
|
|
value24 = (require(6937) /* metro dependency 6937 */).matchSorter(defaultImport(guildRoleStoreBinding.getSortedRoles(guild.id)).filter(_fun51354).value(),
|
|
|
|
|
|
|
|
query, {keys: ['name']}).slice(0, r8 - env0_7);
|
|
env0_7 = env0_7 + value24.length;
|
|
r1 = value24;
|
|
}
|
|
} else {
|
|
r1 = items2;
|
|
}
|
|
} else {
|
|
r1 = items2;
|
|
}
|
|
items2 = [];
|
|
if (!channel.isPrivate() && canMentionEveryone && canMentionRoles) {
|
|
if (env0_7 < r8 && (importDefault(6590) /* metro dependency 6590 */)(value15, MENTION_EVERYONE().test)) {
|
|
items2.push(MENTION_EVERYONE());
|
|
env0_7 += 1;
|
|
}
|
|
r0 = canMentionHere && env0_7 < r8;
|
|
r0 = r0 && (importDefault(6590) /* metro dependency 6590 */)(value15, MENTION_HERE().test);
|
|
if (r0) {
|
|
items2.push(MENTION_HERE());
|
|
env0_7 += 1;
|
|
}
|
|
}
|
|
const GameMentionsExperiment = (GameMentionsExperimentModule).GameMentionsExperiment;
|
|
const config = GameMentionsExperiment.getConfig({location: 'mention autocomplete'});
|
|
if (config.enabled && !config.combineMentionAutocomplete) {
|
|
maybePushOtherGlobal2(MENTION_GAME?.());
|
|
}
|
|
maybePushOtherGlobal2(MENTION_TIMESTAMP?.());
|
|
return {users: r3, globals: items2, roles: r1};
|
|
function maybePushOtherGlobal(a0) { // fn#51352, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:17779, owner: queryMentionResults.maybePushOtherGlobal, offset: 0x0123235a, size: 220 bytes, params: 2, frame: 16
|
|
let r0 = canMentionOtherGlobals && a0 != null;
|
|
if (r0) {
|
|
r0 = length < Module00057 || env0_8.length === 0;
|
|
r0 = r0 && (importDefault(6590) /* metro dependency 6590 */)(env0_8, a0.test);
|
|
r0 = !r0 ? env0_8 === a0.test : r0;
|
|
if (r0) {
|
|
if (length >= Module00057) {
|
|
if (env0_9.length > 0) {
|
|
env0_9.pop();
|
|
} else if (CreateClass.length > 0) {
|
|
CreateClass.pop();
|
|
}
|
|
}
|
|
env0_11.push(a0);
|
|
env0_7 = length + 1;
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun51354({mentionable, name, id}) { // fn#51354, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:17557, offset: 0x0123249e, size: 166 bytes, params: 2, frame: 17
|
|
var value;
|
|
let r0 = mentionable || canMentionEveryone;
|
|
r0 = !r0 ? includeNonMentionableRoles : r0;
|
|
if (r0) {
|
|
value = environment.__proto__;
|
|
value = importDefault(6590) /* metro dependency 6590 */;
|
|
value = value(env0_8, name.toLowerCase());
|
|
r0 = value || allowSnowflake && env0_8 === id;
|
|
}
|
|
if (r0) {
|
|
value = environment.__proto__;
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value = id !== value.castGuildIdAsEveryoneGuildRoleId(env0_10);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
function queryGuildMentionResults({query, guildId, canMentionEveryone, canMentionUsers, canMentionRoles, canMentionNonMentionableRoles}) { // fn#51355, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:18316, offset: 0x01232544, size: 498 bytes, params: 2, frame: 23
|
|
var r3;
|
|
var r7;
|
|
var r6;
|
|
var value;
|
|
var guild;
|
|
var defaultImport;
|
|
var guildRoleStoreBinding;
|
|
var value11;
|
|
canMentionEveryone = !(canMentionEveryone === undefined) && canMentionEveryone;
|
|
canMentionUsers = canMentionUsers === undefined || canMentionUsers;
|
|
canMentionRoles = canMentionRoles === undefined || canMentionRoles;
|
|
if (canMentionNonMentionableRoles !== undefined) {
|
|
}
|
|
if (canMentionUsers) {
|
|
value = this.queryGuildUsers({guildId: guildId, query: query});
|
|
value = value.map(_fun51356);
|
|
r3 = value;
|
|
} else {
|
|
r3 = [];
|
|
}
|
|
const length = r3.length;
|
|
value = query.toLowerCase();
|
|
const items2 = [];
|
|
if (length < MAX_AUTOCOMPLETE_RESULTS) {
|
|
if (canMentionRoles) {
|
|
guild = GuildStore.getGuild(guildId);
|
|
if (guild == null) {
|
|
r7 = length;
|
|
} else {
|
|
defaultImport = importDefault(22) /* metro dependency 22 */;
|
|
guildRoleStoreBinding = GuildRoleStore;
|
|
defaultImport(guildRoleStoreBinding.getSortedRoles(guild.id)).filter(_fun51357).take(MAX_AUTOCOMPLETE_RESULTS - length).forEach(_fun51358);
|
|
r7 = length + items2.length;
|
|
}
|
|
} else {
|
|
r7 = length;
|
|
}
|
|
} else {
|
|
r7 = length;
|
|
}
|
|
const items3 = [];
|
|
let r4 = canMentionEveryone && canMentionRoles;
|
|
if (r4) {
|
|
r4 = r7 < MAX_AUTOCOMPLETE_RESULTS && (importDefault(6590) /* metro dependency 6590 */)(value,
|
|
MENTION_EVERYONE().test);
|
|
if (r4) {
|
|
items3.push(MENTION_EVERYONE());
|
|
r6 = r7 + 1;
|
|
} else {
|
|
r6 = r7;
|
|
}
|
|
value11 = r6 < MAX_AUTOCOMPLETE_RESULTS;
|
|
if (value11) {
|
|
value = (importDefault(6590) /* metro dependency 6590 */)(value, MENTION_HERE().test);
|
|
r4 = value;
|
|
} else {
|
|
r4 = value11;
|
|
}
|
|
if (r4) {
|
|
items3.push(MENTION_HERE());
|
|
}
|
|
}
|
|
return {users: r3, globals: items3, roles: items2};
|
|
function _fun51356(a0) { // fn#51356, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:18518, offset: 0x01232736, size: 55 bytes, params: 2, frame: 13
|
|
const object = {};
|
|
copyDataProperties(object, a0, undefined);
|
|
const value = environment.__proto__;
|
|
const presenceStoreBinding = PresenceStore;
|
|
const getStatus = presenceStoreBinding.getStatus;
|
|
object['status'] = Reflect.apply(getStatus, presenceStoreBinding, [a0.record.id]);
|
|
return object;
|
|
}
|
|
|
|
function _fun51357(a0) { // fn#51357, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:18683, offset: 0x0123276d, size: 107 bytes, params: 2, frame: 16
|
|
var value;
|
|
var binding;
|
|
var name;
|
|
let r0 = a0.mentionable || canMentionEveryone;
|
|
r0 = !r0 ? canMentionNonMentionableRoles : r0;
|
|
if (r0) {
|
|
value = environment.__proto__;
|
|
value = importDefault(6590) /* metro dependency 6590 */;
|
|
binding = env0_2;
|
|
name = a0.name;
|
|
value = value(binding, name.toLowerCase());
|
|
r0 = value;
|
|
}
|
|
if (r0) {
|
|
value = environment.__proto__;
|
|
value = !isEveryoneRole(a0);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun51358(a0) { // fn#51358, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:18770, offset: 0x012327d8, size: 24 bytes, params: 2, frame: 11
|
|
env0_3.push(a0);
|
|
}
|
|
|
|
}
|
|
|
|
function queryChoice({query, choices, limit, fuzzy}) { // fn#51359, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:18942, offset: 0x012327f0, size: 327 bytes, params: 2, frame: 23
|
|
var r1;
|
|
limit = limit === undefined ? 10 : limit;
|
|
if (fuzzy !== undefined) {
|
|
}
|
|
let value = query.toLocaleLowerCase();
|
|
let RegExp = global.RegExp;
|
|
let regExp = new RegExp('^' + (importDefault(4100) /* metro dependency 4100: RegexUtils */).escape(value), 'i');
|
|
RegExp = global.RegExp;
|
|
value = (importDefault(4100) /* metro dependency 4100: RegexUtils */).escape(value);
|
|
regExp = new RegExp(value, 'i');
|
|
regExp = (importDefault(22) /* metro dependency 22 */)(choices);
|
|
regExp = regExp.map(_fun51360);
|
|
regExp = regExp.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish);
|
|
regExp = regExp.sortBy(function(a0) {
|
|
return -1 * a0.score;
|
|
});
|
|
if (limit === null) {
|
|
r1 = regExp;
|
|
} else {
|
|
regExp = regExp.take(limit);
|
|
r1 = regExp;
|
|
}
|
|
return r1.value();
|
|
function _fun51360(a0, a1) { // fn#51360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:19124, offset: 0x01232937, size: 103 bytes, params: 3, frame: 16
|
|
let value = environment.__proto__;
|
|
const getMatchValueBinding = getMatchValue;
|
|
value = a0.displayName.toLocaleLowerCase();
|
|
value = getMatchValueBinding(value, {exactQuery: env0_2, containQuery: env0_3, queryLower: env0_1}, fuzzy);
|
|
return value > 0 ? {choice: a0, score: value, originalIndex: a1} : null;
|
|
}
|
|
|
|
}
|
|
|
|
function queryStaticRouteChannels({query, guild}) { // fn#51362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:19383, offset: 0x012329b3, size: 767 bytes, params: 2, frame: 27
|
|
var r8;
|
|
var r6;
|
|
var r2;
|
|
var features;
|
|
var has;
|
|
var HUB;
|
|
var value10;
|
|
var property;
|
|
var getMatchValueBinding;
|
|
var name;
|
|
var push;
|
|
var object;
|
|
var UNKNOWN;
|
|
var value12;
|
|
var unknownChannelRecord;
|
|
var value13;
|
|
var value14;
|
|
let value = query.toLocaleLowerCase();
|
|
const object2 = {};
|
|
let RegExp = global.RegExp;
|
|
const value4 = '^' + (RegexUtils).escape(value);
|
|
let prototype = RegExp.prototype;
|
|
const value5 = Object.create(prototype, {constructor: {value: RegExp}});
|
|
let regExp = new RegExp(value4, 'i');
|
|
object2.exactQuery = regExp instanceof Object ? regExp : value5;
|
|
RegExp = global.RegExp;
|
|
const value7 = (RegexUtils).escape(value);
|
|
const value8 = Object.create(RegExp.prototype, {constructor: {value: RegExp}});
|
|
regExp = new RegExp(value7, 'i');
|
|
object2.containQuery = regExp instanceof Object ? regExp : value8;
|
|
object2.queryLower = value;
|
|
const canSeeOnboardingHome = (OnboardingHomeUtilsModule).canSeeOnboardingHome;
|
|
let id = guild.id;
|
|
value = Reflect.apply(canSeeOnboardingHome, value, [id]);
|
|
reducibleJoin2: while (true) {
|
|
if (value) {
|
|
features = guild.features;
|
|
has = features.has;
|
|
HUB = GuildFeatures.HUB;
|
|
value = !Reflect.apply(has, features, [HUB]);
|
|
r8 = value;
|
|
break reducibleJoin2;
|
|
}
|
|
r8 = value;
|
|
break reducibleJoin2;
|
|
}
|
|
features = guild.features;
|
|
has = features.has;
|
|
let COMMUNITY = GuildFeatures.COMMUNITY;
|
|
value = Reflect.apply(has, features, [COMMUNITY]);
|
|
const isGuildOnboardingAvailable2 = (UseGuildOnboardingAvailableModule).isGuildOnboardingAvailable(guild);
|
|
reducibleJoin4: while (true) {
|
|
if (isGuildOnboardingAvailable2) {
|
|
features = guild.features;
|
|
has = features.has;
|
|
COMMUNITY = GuildFeatures.COMMUNITY;
|
|
value10 = Reflect.apply(has, features, [COMMUNITY]);
|
|
r6 = value10;
|
|
break reducibleJoin4;
|
|
}
|
|
r6 = isGuildOnboardingAvailable2;
|
|
break reducibleJoin4;
|
|
}
|
|
const items3 = [];
|
|
const object5 = {};
|
|
let SERVER_GUIDE = StaticChannelId.SERVER_GUIDE;
|
|
object5.id = SERVER_GUIDE;
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const t = (IndexNativeModule).t;
|
|
const VbpLyU = t.VbpLyU;
|
|
object5.name = Reflect.apply(string, intl, [VbpLyU]);
|
|
const items2 = [object5];
|
|
let CHANNEL_BROWSER = StaticChannelId.CHANNEL_BROWSER;
|
|
items2[1] = {id: CHANNEL_BROWSER, name: intl.string(t.et6wav)};
|
|
let CUSTOMIZE_COMMUNITY = StaticChannelId.CUSTOMIZE_COMMUNITY;
|
|
items2[2] = {id: CUSTOMIZE_COMMUNITY, name: intl.string(t.h9mGOP)};
|
|
let length = items2.length;
|
|
if (0 < length) {
|
|
r2 = 0;
|
|
reducibleLoop5: while (true) {
|
|
property = items2[r2];
|
|
id = property.id;
|
|
SERVER_GUIDE = StaticChannelId.SERVER_GUIDE;
|
|
reducibleJoin13: while (true) {
|
|
reducibleJoin11: while (true) {
|
|
if (id !== SERVER_GUIDE) {
|
|
id = property.id;
|
|
CHANNEL_BROWSER = StaticChannelId.CHANNEL_BROWSER;
|
|
if (id === CHANNEL_BROWSER) {
|
|
if (!value) {
|
|
break reducibleJoin13;
|
|
}
|
|
}
|
|
id = property.id;
|
|
CUSTOMIZE_COMMUNITY = StaticChannelId.CUSTOMIZE_COMMUNITY;
|
|
if (id !== CUSTOMIZE_COMMUNITY) {
|
|
break reducibleJoin11;
|
|
}
|
|
if (r6) {
|
|
break reducibleJoin11;
|
|
}
|
|
break reducibleJoin13;
|
|
}
|
|
if (r8) {
|
|
id = property.id;
|
|
CHANNEL_BROWSER = StaticChannelId.CHANNEL_BROWSER;
|
|
if (id === CHANNEL_BROWSER) {
|
|
if (!value) {
|
|
break reducibleJoin13;
|
|
}
|
|
}
|
|
id = property.id;
|
|
CUSTOMIZE_COMMUNITY = StaticChannelId.CUSTOMIZE_COMMUNITY;
|
|
if (id !== CUSTOMIZE_COMMUNITY) {
|
|
break reducibleJoin11;
|
|
}
|
|
if (r6) {
|
|
break reducibleJoin11;
|
|
}
|
|
break reducibleJoin13;
|
|
}
|
|
break reducibleJoin13;
|
|
}
|
|
getMatchValueBinding = getMatchValue;
|
|
name = property.name;
|
|
if (getMatchValueBinding(name.toLocaleLowerCase(), object2, false) > 0) {
|
|
push = items3.push;
|
|
object = {};
|
|
id = property.id;
|
|
object.id = id;
|
|
name = property.name;
|
|
object.name = name;
|
|
UNKNOWN = ChannelTypes.UNKNOWN;
|
|
object.type = UNKNOWN;
|
|
id = guild.id;
|
|
object.guild_id = id;
|
|
prototype = UnknownChannelRecord.prototype;
|
|
value12 = Object.create(prototype, {constructor: {value: UnknownChannelRecord}});
|
|
unknownChannelRecord = new UnknownChannelRecord();
|
|
value13 = unknownChannelRecord instanceof Object ? unknownChannelRecord : value12;
|
|
Reflect.apply(push, items3, [value13]);
|
|
break reducibleJoin13;
|
|
}
|
|
break reducibleJoin13;
|
|
}
|
|
value14 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
length = items2.length;
|
|
if (value14 < length) {
|
|
r2 = value14;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return items3;
|
|
}
|
|
|
|
function queryChannelResults({query, channel, type = GUILD_SELECTABLE_CHANNELS_KEY, channelTypes}) { // fn#51363, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:20213, offset: 0x01232cb2, size: 132 bytes, params: 2, frame: 17
|
|
const object = {};
|
|
const queryChannels = this.queryChannels;
|
|
const object2 = {query: query};
|
|
object2.guildId = channel.getGuildId();
|
|
object2.limit = undefined;
|
|
object2.fuzzy = undefined;
|
|
object2.filter = filter_51364;
|
|
object2.type = type;
|
|
object2.allowEmptyQueries = true;
|
|
object.channels = Reflect.apply(queryChannels, this, [object2]).map(function(a0) {
|
|
return a0.record;
|
|
});
|
|
return object;
|
|
function queryChannelResultsFilter(a0) { // fn#51364, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:20378, owner: queryChannelResults.filter, offset: 0x01232d36, size: 40 bytes, params: 2, frame: 12
|
|
return channelTypes == null || channelTypes.includes(a0.type);
|
|
}
|
|
|
|
}
|
|
|
|
function queryApplicationCommandChannelResults({query, channel, channelTypes, limit, allowSnowflake}) { // fn#51366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:20460, offset: 0x01232d5e, size: 345 bytes, params: 2, frame: 31
|
|
var environment;
|
|
var r8;
|
|
var r6;
|
|
var r11;
|
|
var r9;
|
|
var r1;
|
|
var r0;
|
|
var value;
|
|
var items2;
|
|
var property;
|
|
var concat;
|
|
var queryChannels;
|
|
var value3;
|
|
var value4;
|
|
var value7;
|
|
var slice;
|
|
var includes;
|
|
var type;
|
|
var push;
|
|
reducibleJoin2: while (true) {
|
|
if (limit !== undefined) {
|
|
r8 = limit;
|
|
break reducibleJoin2;
|
|
}
|
|
value = environment;
|
|
r8 = MAX_AUTOCOMPLETE_RESULTS;
|
|
break reducibleJoin2;
|
|
}
|
|
let guild_id = channel.guild_id;
|
|
if (guild_id == null) {
|
|
items2 = [];
|
|
value = channelTypes == null;
|
|
reducibleJoin12: while (true) {
|
|
if (value) {
|
|
r0 = value;
|
|
break reducibleJoin12;
|
|
}
|
|
includes = channelTypes.includes;
|
|
type = channel.type;
|
|
value = Reflect.apply(includes, channelTypes, [type]);
|
|
r0 = value;
|
|
break reducibleJoin12;
|
|
}
|
|
reducibleJoin14: while (true) {
|
|
if (r0) {
|
|
push = items2.push;
|
|
Reflect.apply(push, items2, [channel]);
|
|
break reducibleJoin14;
|
|
}
|
|
break reducibleJoin14;
|
|
}
|
|
return {channels: items2};
|
|
}
|
|
items2 = [];
|
|
const binding = env0_60;
|
|
let length = binding.length;
|
|
if (0 < length) {
|
|
r6 = 0;
|
|
r11 = items2;
|
|
reducibleLoop4: while (true) {
|
|
property = binding[r6];
|
|
concat = r11.concat;
|
|
queryChannels = this.queryChannels;
|
|
guild_id = channel.guild_id;
|
|
value3 = Reflect.apply(concat, r11, [Reflect.apply(queryChannels, this, [{query: query, guildId: guild_id,
|
|
limit: r8, fuzzy: true, filter: filter_51367, type: property, allowEmptyQueries: true,
|
|
requireVocalConnectAccess: false, allowSnowflake: allowSnowflake}])]);
|
|
value4 = typeof r6 === 'bigint' ? r6 + 1n : +r6 + 1;
|
|
length = binding.length;
|
|
if (value4 < length) {
|
|
r6 = value4;
|
|
r11 = value3;
|
|
continue reducibleLoop4;
|
|
}
|
|
r9 = value3;
|
|
break reducibleLoop4;
|
|
}
|
|
} else {
|
|
r9 = items2;
|
|
}
|
|
value = r9.filter(function(a0) {
|
|
return a0.record.id !== 'null';
|
|
}).sort(importDefault(6942) /* metro dependency 6942: compareChannelsByScoreAndPosition */);
|
|
const value6 = r8 != null;
|
|
reducibleJoin7: while (true) {
|
|
if (value6) {
|
|
length = value.length;
|
|
value7 = length > r8;
|
|
r1 = value7;
|
|
break reducibleJoin7;
|
|
}
|
|
r1 = value6;
|
|
break reducibleJoin7;
|
|
}
|
|
reducibleJoin9: while (true) {
|
|
if (r1) {
|
|
slice = value.slice;
|
|
value = Reflect.apply(slice, value, [0, r8]);
|
|
r6 = value;
|
|
break reducibleJoin9;
|
|
}
|
|
r6 = value;
|
|
break reducibleJoin9;
|
|
}
|
|
return {channels: r6.map(function(a0) {
|
|
return a0.record;
|
|
})};
|
|
function queryApplicationCommandChannelResultsFilter(a0) { // fn#51367, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:20782, owner: queryApplicationCommandChannelResults.filter, offset: 0x01232d36, size: 40 bytes, params: 2, frame: 12
|
|
return channelTypes == null || channelTypes.includes(a0.type);
|
|
}
|
|
|
|
}
|
|
|
|
function queryChoiceResults({query, choices}) { // fn#51370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:21025, offset: 0x01232ecf, size: 73 bytes, params: 2, frame: 14
|
|
const object = {};
|
|
object.choices = this.queryChoice({query: query, choices: choices, limit: null}).map(function(a0) {
|
|
return a0.choice;
|
|
});
|
|
return object;
|
|
}
|
|
|
|
function queryEmojiResults({query, channel, intention, maxCount = MAX_AUTOCOMPLETE_RESULTS, matchComparator}) { // fn#51372, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:21168, offset: 0x01232f23, size: 133 bytes, params: 2, frame: 18
|
|
const FrecencyUserSettingsActionCreators = (UserSettingsProtoActionCreatorsModule).FrecencyUserSettingsActionCreators;
|
|
FrecencyUserSettingsActionCreators.loadIfNecessary();
|
|
const emojiStoreBinding = EmojiStore;
|
|
return {emojis: emojiStoreBinding.searchWithoutFetchingLatest({channel: channel, query: query, count: maxCount,
|
|
intention: intention, matchComparator: matchComparator})};
|
|
}
|
|
|
|
function queryStickers(a0) { // fn#51373, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:21397, offset: 0x01232fa8, size: 362 bytes, params: 2, frame: 17
|
|
var environment;
|
|
var r0;
|
|
var r1;
|
|
var r5;
|
|
var item3;
|
|
var value8;
|
|
var value9;
|
|
var binding;
|
|
let value = a1;
|
|
const value2 = a2;
|
|
const value3 = undefined;
|
|
reducibleJoin2: while (true) {
|
|
if (value !== value3) {
|
|
r0 = value;
|
|
break reducibleJoin2;
|
|
}
|
|
value = true;
|
|
r0 = value;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (value2 !== value3) {
|
|
r1 = value2;
|
|
break reducibleJoin4;
|
|
}
|
|
value = environment;
|
|
r1 = [null, NOOP_51298];
|
|
break reducibleJoin4;
|
|
}
|
|
const iterator = r1[Symbol.iterator]();
|
|
const iterator2 = iterator.next;
|
|
let item2 = Reflect.apply(iterator2, iterator, []);
|
|
let item = item2.value;
|
|
item2 = item2.done ? undefined : iterator;
|
|
let r3 = item2 === value3 ? value3 : item;
|
|
reducibleJoin7: while (true) {
|
|
if (value) {
|
|
r0 = item2;
|
|
r1 = value;
|
|
r3 = value3;
|
|
break reducibleJoin7;
|
|
}
|
|
item3 = Reflect.apply(iterator2, item2, []);
|
|
item = item3.value;
|
|
item3 = item3.done ? undefined : item2;
|
|
value = item3 === value3;
|
|
if (value) {
|
|
r0 = item3;
|
|
r1 = value;
|
|
r3 = value3;
|
|
break reducibleJoin7;
|
|
}
|
|
r0 = item3;
|
|
r1 = value;
|
|
r3 = item;
|
|
break reducibleJoin7;
|
|
}
|
|
reducibleJoin9: while (true) {
|
|
if (r1) {
|
|
break reducibleJoin9;
|
|
}
|
|
r0.return();
|
|
break reducibleJoin9;
|
|
}
|
|
var env0_5;
|
|
var env0_6;
|
|
const env0_3 = UserStore.getCurrentUser();
|
|
const Set = global.Set;
|
|
const set = new Set();
|
|
const FrecencyUserSettingsActionCreators = (UserSettingsProtoActionCreatorsModule).FrecencyUserSettingsActionCreators;
|
|
FrecencyUserSettingsActionCreators.loadIfNecessary();
|
|
const queryStickers_loop2 = queryStickers_loop;
|
|
const value6 = _createForOfIteratorHelperLoose_51295(a0);
|
|
const value7 = value6();
|
|
let done = value7.done;
|
|
if (!done) {
|
|
r5 = value7;
|
|
reducibleLoop10: while (true) {
|
|
value8 = r5.value;
|
|
env0_6 = value8;
|
|
queryStickers_loop2();
|
|
value9 = value6();
|
|
done = value9.done;
|
|
if (done) {
|
|
break reducibleLoop10;
|
|
}
|
|
r5 = value9;
|
|
continue reducibleLoop10;
|
|
}
|
|
}
|
|
const value13 = (importDefault(22) /* metro dependency 22 */)([]).sortBy(function(a0) {
|
|
return -1 * a0.score;
|
|
}).value();
|
|
reducibleJoin13: while (true) {
|
|
if (value13.length !== 0) {
|
|
r0 = value13;
|
|
break reducibleJoin13;
|
|
}
|
|
binding = env0_53;
|
|
env0_5 = binding;
|
|
r0 = binding;
|
|
break reducibleJoin13;
|
|
}
|
|
return r0;
|
|
function queryStickers_loop() { // fn#51374, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:21556, owner: queryStickers._loop, offset: 0x01233112, size: 264 bytes, params: 1, frame: 22
|
|
if (value === '') {
|
|
return 1;
|
|
}
|
|
const value5 = (StringUtilsModule).stripDiacritics(value.toLocaleLowerCase());
|
|
let RegExp = global.RegExp;
|
|
let regExp = new RegExp('^' + (importDefault(4100) /* metro dependency 4100: RegexUtils */).escape(value5), 'i');
|
|
RegExp = global.RegExp;
|
|
regExp = new RegExp('' + (importDefault(4100) /* metro dependency 4100: RegexUtils */).escape(value5), 'i');
|
|
StickersStore.getStickerMetadataArrays().forEach(function(a0) {
|
|
a0.forEach(_fun51376);
|
|
});
|
|
function _fun51375(a0) { // fn#51375, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:21768, offset: 0x0123321a, size: 24 bytes, params: 2, frame: 11
|
|
a0.forEach(_fun51376);
|
|
function _fun51376(a0, a1) { // fn#51376, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:21783, offset: 0x01233232, size: 565 bytes, params: 3, frame: 35
|
|
var r9;
|
|
var r10;
|
|
var r11;
|
|
var r20;
|
|
var r18;
|
|
var r19;
|
|
var r4;
|
|
var r7;
|
|
var r3;
|
|
var r1;
|
|
var value4;
|
|
var binding;
|
|
var moduleValue;
|
|
var value5;
|
|
var value6;
|
|
var done;
|
|
var value7;
|
|
var value8;
|
|
var value9;
|
|
var type;
|
|
var value10;
|
|
var priorityForStickerMetadataType;
|
|
var binding3;
|
|
var value12;
|
|
var test;
|
|
const StickerMetadataTypes = (StickersTypesModule).StickerMetadataTypes;
|
|
var GUILD_NAME;
|
|
var value13;
|
|
var PACK_NAME;
|
|
var value14;
|
|
var STICKER_NAME;
|
|
var value15;
|
|
var value16;
|
|
var value17;
|
|
var value18;
|
|
var value19;
|
|
var value20;
|
|
let value = environment.__proto__.__proto__.__proto__;
|
|
const stickerById = StickersStore.getStickerById(a1);
|
|
const value3 = null;
|
|
if (value3 != stickerById) {
|
|
value4 = environment.__proto__.__proto__;
|
|
binding = env2_2;
|
|
moduleValue = require(6943) /* metro dependency 6943: StickerSendability */;
|
|
if (binding(stickerById, moduleValue.getStickerSendability(stickerById, env2_3, env2_1))) {
|
|
value5 = _createForOfIteratorHelperLoose_51295(a0);
|
|
value6 = value5();
|
|
done = value6.done;
|
|
value7 = 0;
|
|
value8 = environment.__proto__;
|
|
if (done) {
|
|
r4 = value3;
|
|
r7 = value7;
|
|
} else {
|
|
r9 = value6;
|
|
r10 = value3;
|
|
r11 = value7;
|
|
while (true) {
|
|
value9 = r9.value;
|
|
type = value9.type;
|
|
value10 = value9.value;
|
|
priorityForStickerMetadataType = getPriorityForStickerMetadataType(type);
|
|
binding = env2_0;
|
|
binding3 = env1_0;
|
|
if (binding) {
|
|
if (value10 === binding3) {
|
|
value19 = env3_51 * priorityForStickerMetadataType;
|
|
r18 = r10;
|
|
r19 = value19;
|
|
break;
|
|
}
|
|
binding = env1_1;
|
|
test = binding.test;
|
|
if (Reflect.apply(test, binding, [value10])) {
|
|
value18 = 7 * priorityForStickerMetadataType;
|
|
r18 = r10;
|
|
r19 = value18;
|
|
break;
|
|
}
|
|
GUILD_NAME = StickerMetadataTypes.GUILD_NAME;
|
|
value13 = type !== GUILD_NAME;
|
|
if (!value13) {
|
|
r20 = value13;
|
|
continue;
|
|
}
|
|
PACK_NAME = StickerMetadataTypes.PACK_NAME;
|
|
value14 = type !== PACK_NAME;
|
|
r20 = value14;
|
|
if (!r20) {
|
|
continue;
|
|
}
|
|
STICKER_NAME = StickerMetadataTypes.STICKER_NAME;
|
|
value15 = type !== STICKER_NAME;
|
|
r20 = value15;
|
|
if (r20) {
|
|
continue;
|
|
}
|
|
binding = env1_2;
|
|
test = binding.test;
|
|
value16 = !Reflect.apply(test, binding, [value10]);
|
|
r20 = value16;
|
|
if (r20) {
|
|
r18 = r10;
|
|
r19 = value7;
|
|
break;
|
|
}
|
|
value17 = 5 * priorityForStickerMetadataType;
|
|
r18 = r10;
|
|
r19 = value17;
|
|
break;
|
|
}
|
|
if (value10 !== binding3) {
|
|
r18 = r10;
|
|
r19 = value7;
|
|
break;
|
|
}
|
|
value12 = env3_51 * priorityForStickerMetadataType;
|
|
r18 = value10;
|
|
r19 = value12;
|
|
break;
|
|
if (r19 > r11) {
|
|
r11 = r19;
|
|
r18 = value10;
|
|
continue;
|
|
}
|
|
continue;
|
|
value20 = value5();
|
|
done = value20.done;
|
|
if (done) {
|
|
r4 = r18;
|
|
r7 = r11;
|
|
break;
|
|
}
|
|
r9 = value20;
|
|
r10 = r18;
|
|
continue;
|
|
}
|
|
}
|
|
value = StickersPersistedStore.stickerFrecencyWithoutFetchingLatest.getScore(a1);
|
|
r3 = value3 == value ? r7 : r7 * (value / 100);
|
|
value = r3 > value7;
|
|
r1 = value && value3 != r4;
|
|
if (r1) {
|
|
binding = env2_4;
|
|
r1 = !binding.has(stickerById.id);
|
|
}
|
|
if (r1) {
|
|
binding = env2_4;
|
|
binding.add(stickerById.id);
|
|
binding = env2_5;
|
|
binding.push({sticker: stickerById, comparator: r4, score: r3});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function querySoundmoji(a0, a1) { // fn#51378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:22572, offset: 0x01233467, size: 235 bytes, params: 3, frame: 21
|
|
let env0_0 = a1;
|
|
var value;
|
|
const currentUser = UserStore.getCurrentUser();
|
|
if (!SoundboardStore.isFetching() && !SoundboardStore.hasFetchedAllSounds()) {
|
|
(require(6944) /* metro dependency 6944: SoundboardActionCreators */).maybeFetchSoundboardSounds();
|
|
}
|
|
const FrecencyUserSettingsActionCreators = (UserSettingsProtoActionCreatorsModule).FrecencyUserSettingsActionCreators;
|
|
FrecencyUserSettingsActionCreators.loadIfNecessary();
|
|
const Array = global.Array;
|
|
value = Array.from(Reflect.apply(SoundboardStore.getSounds().values, value, []));
|
|
value = value.reduce(function(a0, a1) {
|
|
var env0_0 = a0;
|
|
a1.forEach(_fun51380);
|
|
return a0;
|
|
}, []);
|
|
return (SearchSoundsModule).searchSounds(a0, value, currentUser, a1);
|
|
function _fun51379(a0, a1) { // fn#51379, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:22811, offset: 0x01233552, size: 29 bytes, params: 3, frame: 12
|
|
const env0_0 = a0;
|
|
a1.forEach(_fun51380);
|
|
return a0;
|
|
function _fun51380(a0) { // fn#51380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:22830, offset: 0x0123356f, size: 106 bytes, params: 2, frame: 17
|
|
let value = environment.__proto__.__proto__;
|
|
value = undefined;
|
|
if ((importDefault(6637) /* metro dependency 6637: isSoundValid */)(a0, require == null ? value : require.guild_id,
|
|
require == null ? value : require.id)) {
|
|
env0_0.push(a0);
|
|
}
|
|
return value;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function queryGames(a0) { // fn#51381, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:22954, offset: 0x012335d9, size: 421 bytes, params: 2, frame: 22
|
|
var r4;
|
|
var Array;
|
|
var from;
|
|
var Set;
|
|
var items2;
|
|
var value5;
|
|
var set;
|
|
var value8;
|
|
const env0_0 = a0;
|
|
const runningVerifiedApplicationIds = RunningGameStoreNative.getRunningVerifiedApplicationIds();
|
|
const env0_2 = a0.includes('_');
|
|
const env0_3 = StringUtilsModule.stripDiacritics(a0.toLowerCase()).replaceAll('_', ' ');
|
|
if (a0.length === 0) {
|
|
Array = global.Array;
|
|
from = Array.from;
|
|
Set = global.Set;
|
|
items2 = [];
|
|
arraySpread(items2, HOISTED_SEARCH_APPLICATION_IDS_BY_PRIORITY.keys(), arraySpread(items2,
|
|
runningVerifiedApplicationIds, 0, undefined), HOISTED_SEARCH_APPLICATION_IDS_BY_PRIORITY);
|
|
value5 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
set = new Set();
|
|
value8 = Reflect.apply(from, Array, [set instanceof Object ? set : value5]).map(function(a0) {
|
|
return DetectableGameStore.getDetectableGame(a0);
|
|
});
|
|
r4 = value8.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish);
|
|
} else {
|
|
r4 = DetectableGameStore.games;
|
|
}
|
|
return (importDefault(22) /* metro dependency 22 */)(r4).filter(_fun51384).map(function(a0) {
|
|
var object = {game: a0};
|
|
object.score = getSortPriority(a0);
|
|
return object;
|
|
}).filter(function(a0) {
|
|
return a0.score > 0;
|
|
}).sortBy(function(a0) {
|
|
return a0.score;
|
|
}).map(function(a0) {
|
|
return a0.game;
|
|
}).reverse().value().slice(0, MAX_AUTOCOMPLETE_RESULTS);
|
|
function getSortPriority(a0) { // fn#51382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:23094, owner: queryGames.getSortPriority, offset: 0x0123377e, size: 343 bytes, params: 2, frame: 20
|
|
var r8;
|
|
var r5;
|
|
var r2;
|
|
var r0;
|
|
var moduleValue2;
|
|
var stripDiacritics;
|
|
var name;
|
|
var value2;
|
|
var id;
|
|
var includes;
|
|
var binding;
|
|
var get;
|
|
var value16;
|
|
const value = environment.__proto__;
|
|
if (WidgetUtilsModule.isGameAllowedInGameWidgets(a0)) {
|
|
moduleValue2 = require(1861) /* metro dependency 1861: StringUtils */;
|
|
stripDiacritics = moduleValue2.stripDiacritics;
|
|
name = a0.name;
|
|
value2 = Reflect.apply(stripDiacritics, moduleValue2, [name.toLowerCase()]);
|
|
r8 = env0_2 ? value2.replaceAll('_', ' ') : value2;
|
|
id = a0.id;
|
|
r5 = id === env0_0 ? 1000 : r8 === env0_3 ? 5 : r8.startsWith(env0_3) ? 4 : r8.includes(env0_3) ? 3 : env0_0.length > 1 && (importDefault(6590) /* metro dependency 6590 */)(env0_3,
|
|
|
|
r8) ? 1 : 0;
|
|
if (r5 > 0) {
|
|
binding = env0_1;
|
|
includes = binding.includes;
|
|
id = a0.id;
|
|
r2 = Reflect.apply(includes, binding, [id]) ? r5 + 10 : r5;
|
|
get = HOISTED_SEARCH_APPLICATION_IDS_BY_PRIORITY.get;
|
|
id = a0.id;
|
|
value16 = Reflect.apply(get, HOISTED_SEARCH_APPLICATION_IDS_BY_PRIORITY, [id]);
|
|
r0 = value16 == null ? r2 : r2 + value16 / HOISTED_SEARCH_APPLICATION_IDS_BY_PRIORITY.size;
|
|
} else {
|
|
r0 = r5;
|
|
}
|
|
return r0;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
function _fun51384(a0) { // fn#51384, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:23604, offset: 0x012338ec, size: 78 bytes, params: 2, frame: 14
|
|
var r0;
|
|
let value = environment.__proto__;
|
|
const isNSFWGame2 = (require(5193) /* metro dependency 5193: WidgetUtils */).isNSFWGame(a0);
|
|
if (isNSFWGame2) {
|
|
r0 = !isNSFWGame2;
|
|
} else {
|
|
value = require(5193) /* metro dependency 5193: WidgetUtils */;
|
|
value = !value.isAgeRestrictedGame(a0);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
function matchSentinel(a0, a1, a2) { // fn#51389, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:23832, offset: 0x01233980, size: 38 bytes, params: 4, frame: 11
|
|
return !env0_52.test(a1) && a0 === a2;
|
|
}
|
|
|
|
function hasSameRoleAsUsername(a0, a1) { // fn#51390, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:23860, offset: 0x012339a6, size: 171 bytes, params: 3, frame: 16
|
|
var r1;
|
|
var value;
|
|
var guildStoreBinding;
|
|
var value2;
|
|
var value3;
|
|
var done;
|
|
var value4;
|
|
var name;
|
|
var username;
|
|
var startsWith;
|
|
var toLowerCase;
|
|
var value5;
|
|
if (a1.hasUniqueUsername()) {
|
|
guildStoreBinding = GuildStore;
|
|
value2 = guildStoreBinding.getGuild(a0.getGuildId());
|
|
value = _createForOfIteratorHelperLoose_51295(value2 != null ? GuildRoleStore.getSortedRoles(value2.id) : []);
|
|
value3 = value();
|
|
done = value3.done;
|
|
if (done) {
|
|
return false;
|
|
}
|
|
r1 = value3;
|
|
loopExit6: while (true) {
|
|
value4 = r1.value;
|
|
name = value4.name;
|
|
username = a1.username;
|
|
startsWith = username.startsWith;
|
|
toLowerCase = name.toLowerCase;
|
|
if (Reflect.apply(startsWith, username, [Reflect.apply(toLowerCase, name, [])])) {
|
|
break loopExit6;
|
|
}
|
|
value5 = value();
|
|
done = value5.done;
|
|
if (done) {
|
|
return false;
|
|
}
|
|
r1 = value5;
|
|
continue;
|
|
}
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function getBoosterMap(a0) { // fn#51391, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:24309, offset: 0x01233a51, size: 22 bytes, params: 2, frame: 11
|
|
return env0_59.get(a0);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun51371(a0) { // fn#51371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6704:21134, offset: 0x01232f18, size: 11 bytes, params: 2, frame: 1
|
|
return a0.choice;
|
|
}
|
|
|
|
global.__d(_fun51294, 6526, [57, 6, 7, 6527, 6540, 4266, 4613, 6582, 6583, 5071, 3786, 1383, 1939, 1885, 1379, 4267,
|
|
6586, 1935, 1945, 1938, 1867, 4814, 3784, 4396, 3793, 1934, 3969, 1878, 4279, 661, 6587, 1386, 6588, 3, 6589,
|
|
1418, 4100, 6590, 1861, 3995, 6591, 4785, 22, 1944, 1360, 6592, 3789, 4805, 1244, 21, 6937, 6940, 5103, 6941,
|
|
6942, 1362, 6943, 6944, 6637, 6948, 5193,
|
|
2]) /* metro module 6526, dependencies: [57, 6, 7, 6527, 6540, 4266, 4613, 6582, 6583, 5071, 3786, 1383, 1939, 1885, 1379, 4267, 6586, 1935, 1945, 1938, 1867, 4814, 3784, 4396, 3793, 1934, 3969, 1878, 4279, 661, 6587, 1386, 6588, 3, 6589, 1418, 4100, 6590, 1861, 3995, 6591, 4785, 22, 1944, 1360, 6592, 3789, 4805, 1244, 21, 6937, 6940, 5103, 6941, 6942, 1362, 6943, 6944, 6637, 6948, 5193, 2] */;
|