Initial commit

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

No files matched your search

@@ -0,0 +1,218 @@
/* Metro module 11661; source: modules/app_launcher/hooks/useAppLauncherFrecents.tsx; dependencies: [31, 5109, 1878, 11662, 4237, 5066, 1909, 8060, 566, 6779, 4122, 11663, 8040, 8046, 10657, 2] */
function _fun89378(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#89378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11847:6, offset: 0x0200c0da, size: 360 bytes, params: 8, frame: 20
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = importAll(31) /* metro dependency 31 */;
const authorizedAppsStore = importDefault(5109) /* metro dependency 5109: AuthorizedAppsStore */;
const env0_6 = (require(5109) /* metro dependency 5109: AuthorizedAppsStore */).FetchState;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const appLauncherLastUsedCommandStore = importDefault(11662) /* metro dependency 11662: AppLauncherLastUsedCommandStore */;
const env0_9 = (require(4237) /* metro dependency 4237: Constants */).WATCH_YOUTUBE_PROD_APP_ID;
const applicationCommandConstantsModule = require(5066) /* metro dependency 5066: ApplicationCommandConstants */;
const env0_10 = applicationCommandConstantsModule.BuiltInSectionId;
const DISCOVERY_COMMANDS_QUERY_LIMIT = applicationCommandConstantsModule.DISCOVERY_COMMANDS_QUERY_LIMIT;
object2 = {};
const {CHAT, PRIMARY_ENTRY_POINT} = (require(1909) /* metro dependency 1909: Server */).ApplicationCommandType;
object2.commandTypes = [CHAT, PRIMARY_ENTRY_POINT];
({'placeholderCount': 0, 'limit': null, 'includeFrecency': true}).limit = DISCOVERY_COMMANDS_QUERY_LIMIT;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/app_launcher/hooks/useAppLauncherFrecents.tsx');
exports.default = useAppLauncherFrecentCommandsAndApps;
exports.useAppLauncherFrecentApps = useAppLauncherFrecentApps;
}
function useFrecentApps({sectionDescriptors, context, onlyActivityApps, includeAuthorizedAppsAndFetch}) { // fn#89379, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11847:415, offset: 0x0200c242, size: 362 bytes, params: 2, frame: 23
env0_4.useEffect(_fun89381, [includeAuthorizedAppsAndFetch,
(require(566) /* metro dependency 566: flux */).useStateFromStores([AuthorizedAppsStore], function() {
return AuthorizedAppsStore.getFetchState();
})]);
return env0_4.useMemo(_fun89387, [onlyActivityApps,
(require(11663) /* metro dependency 11663: ApplicationFrecencyHooks */).useSortApplicationsViaFrecency(sectionDescriptors.filter(_fun89384),
(require(566) /* metro dependency 566: flux */).useStateFromStoresArray([AuthorizedAppsStore], _fun89382)),
context, env0_4.useMemo(_fun89385, [context.type === 'contextless']),
(require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], _fun89386)]);
}
function useAppLauncherFrecentCommandsAndApps({context, onlyActivityApps}) { // fn#89392, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11847:1524, offset: 0x0200c617, size: 304 bytes, params: 2, frame: 24
var object2;
const {commands, commandsByActiveSection, sectionDescriptors, filterSection,
loading} = (importAll(8060) /* metro dependency 8060: ApplicationCommandQueryApi */).useDiscovery({context: context,
filters: env0_11, options: env0_12, allowFetch: true});
env0_4.useEffect(function() {
filterSection(BuiltInSectionId.FRECENCY);
}, [filterSection]);
const lastUsedCommandId = (require(566) /* metro dependency 566: flux */).useStateFromStores([AppLauncherLastUsedCommandStore],
function() {
return AppLauncherLastUsedCommandStore.getLastUsedCommandId();
});
var env0_4 = lastUsedCommandId;
object2 = {loading: loading};
object2.frecencyCommands = env0_4.useMemo(_fun89395, [commands, commandsByActiveSection, lastUsedCommandId,
onlyActivityApps]);
object2.frecentApps = useFrecentApps({sectionDescriptors: sectionDescriptors, context: context,
onlyActivityApps: onlyActivityApps, includeAuthorizedAppsAndFetch: true});
object2.sectionDescriptors = sectionDescriptors;
return object2;
}
function useAppLauncherFrecentApps({context, onlyActivityApps, allowCommandFetch, includeAuthorizedAppsAndFetch}) { // fn#89398, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11847:2249, offset: 0x0200c81c, size: 148 bytes, params: 2, frame: 18
var object2;
const value2 = (importAll(8060) /* metro dependency 8060: ApplicationCommandQueryApi */).useDiscovery({context: context,
filters: env0_11, options: env0_12, allowFetch: allowCommandFetch});
const sectionDescriptors = value2.sectionDescriptors;
object2 = {};
object2.loading = value2.loading;
object2.frecentApps = useFrecentApps({sectionDescriptors: sectionDescriptors, context: context,
onlyActivityApps: onlyActivityApps, includeAuthorizedAppsAndFetch: includeAuthorizedAppsAndFetch});
return object2;
}
function _fun89381() { // fn#89381, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11847:599, offset: 0x0200c3bf, size: 73 bytes, params: 1, frame: 11
var r0;
var fetchStateBinding;
var value;
const includeAuthorizedAppsAndFetchBinding = includeAuthorizedAppsAndFetch;
if (includeAuthorizedAppsAndFetchBinding) {
fetchStateBinding = fetchState;
value = environment.__proto__;
value = fetchStateBinding === FetchState.NOT_FETCHED;
r0 = value;
} else {
r0 = includeAuthorizedAppsAndFetchBinding;
}
if (r0) {
value = environment.__proto__;
value = importDefault(6779) /* metro dependency 6779: AuthorizedAppsActionCreators */;
value.fetch();
}
}
function _fun89382() { // fn#89382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11847:694, offset: 0x0200c408, size: 54 bytes, params: 1, frame: 12
var environment;
var r0;
var value;
if (includeAuthorizedAppsAndFetch) {
value = environment.__proto__;
value = AuthorizedAppsStore.getNewestTokens();
value = value.filter(function({scopes}) {
return scopes.includes(require(dependencyMap[10]).OAuth2Scopes.APPLICATIONS_COMMANDS);
});
r0 = value;
} else {
r0 = [];
}
return r0;
}
function _fun89384(a0) { // fn#89384, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11847:813, offset: 0x0200c478, size: 49 bytes, params: 2, frame: 4
const id = a0.id;
const value = environment.__proto__;
const FRECENCY = BuiltInSectionId.FRECENCY;
return id !== FRECENCY && a0.id !== BuiltInSectionId.BUILT_IN;
}
function _fun89385() { // fn#89385, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11847:893, offset: 0x0200c4a9, size: 33 bytes, params: 1, frame: 11
var push;
const items2 = [];
if (result) {
push = items2.push;
value = environment.__proto__;
Reflect.apply(push, items2, [WATCH_YOUTUBE_PROD_APP_ID]);
}
return items2;
}
function _fun89386() { // fn#89386, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11847:1017, offset: 0x0200c4ca, size: 35 bytes, params: 1, frame: 10
const value = environment.__proto__;
return UserStore.getCurrentUser()?.nsfwAllowed;
}
function _fun89387() { // fn#89387, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11847:1106, offset: 0x0200c4ed, size: 93 bytes, params: 1, frame: 14
var r0;
const closure = hideAgeRestricted;
var value;
const onlyActivityAppsBinding = onlyActivityApps;
const binding = env0_6;
const filter = binding.filter;
if (onlyActivityAppsBinding) {
value = Reflect.apply(filter, binding, [_fun89389]);
value = value.filter(_fun89390);
value = value.filter(closure);
r0 = value;
} else {
value = Reflect.apply(filter, binding, [_fun89391]);
value = value.filter(closure);
r0 = value;
}
return r0;
}
function _fun89395() { // fn#89395, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11847:1923, offset: 0x0200c779, size: 121 bytes, params: 1, frame: 16
var r0;
var items2;
if (onlyActivityApps) {
return [];
}
const r4 = commandsByActiveSection[0]?.data ?? [];
const commandsBinding = commands;
let value = commandsBinding.find(function({id}) {
return id === lastUsedCommandId;
});
if (value == null) {
r0 = r4;
} else {
items2 = [value];
value = r4.filter(function({id}) {
return id !== lastUsedCommandId;
});
arraySpread(items2, value, 1, commandsBinding);
r0 = items2;
}
return r0;
}
function hideAgeRestricted(a0) { // fn#89388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11847:1133, offset: 0x0200c54a, size: 59 bytes, params: 2, frame: 12
var r0;
let value = environment.__proto__;
value = env1_7 === false;
if (value) {
value = environment.__proto__.__proto__;
value = importDefault(8040) /* metro dependency 8040: isApplicationAgeRestricted */;
value = value(a0.id);
r0 = value;
} else {
r0 = value;
}
return !r0;
}
function _fun89389(a0) { // fn#89389, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11847:1181, offset: 0x0200c585, size: 116 bytes, params: 2, frame: 15
var r0;
var queryForPrimaryAppCommand;
var value2;
let value = a0.application != null;
if (value) {
value = environment.__proto__.__proto__;
value = require(8046) /* metro dependency 8046: AppLauncherUtils */;
value = value.isEmbeddedApp(a0.application);
r0 = value;
} else {
r0 = value;
}
if (r0) {
value = environment.__proto__.__proto__;
value = require(10657) /* metro dependency 10657: getPrimaryAppCommand */;
queryForPrimaryAppCommand = value.queryForPrimaryAppCommand;
value2 = environment.__proto__;
value = Reflect.apply(queryForPrimaryAppCommand, value, [context, a0.id]) != null;
r0 = value;
}
return r0;
}
function _fun89390({id}) { // fn#89390, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11847:1303, offset: 0x0200c5f9, size: 30 bytes, params: 2, frame: 11
const binding = env1_5;
return !binding.includes(id);
}
@@ -0,0 +1,115 @@
/* Metro module 11664; source: modules/app_launcher/hooks/useAppsInThisServer.tsx; dependencies: [31, 7861, 1878, 5066, 566, 8060, 1909, 7871, 11663, 22, 8040, 2] */
function _fun89428(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#89428, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11850:6, offset: 0x0200d1dd, size: 185 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(7861) /* metro dependency 7861: ApplicationCommandIndexStore */).useGuildIndexState;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const env0_7 = (require(5066) /* metro dependency 5066: ApplicationCommandConstants */).DISCOVERY_COMMANDS_QUERY_LIMIT;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/app_launcher/hooks/useAppsInThisServer.tsx');
exports.default = useAppsInThisServer;
}
function useAppsInThisServer({context}) { // fn#89429, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11850:281, offset: 0x0200d296, size: 478 bytes, params: 2, frame: 25
var object2;
let value = undefined;
const env0_4 = value;
const channel = context.type !== 'channel' ? value : context.channel;
const value3 = useGuildIndexState(channel == null ? value : channel.guild_id, true);
const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], _fun89430);
const applicationCommandQueryApiModule = importAll(8060) /* metro dependency 8060: ApplicationCommandQueryApi */;
const useDiscovery = applicationCommandQueryApiModule.useDiscovery;
object2 = {context: context};
const {CHAT, PRIMARY_ENTRY_POINT} = (require(1909) /* metro dependency 1909: Server */).ApplicationCommandType;
object2.filters = {commandTypes: [CHAT, PRIMARY_ENTRY_POINT]};
object2.options = {'placeholderCount': 0, 'limit': null, 'includeFrecency': true,
limit: DISCOVERY_COMMANDS_QUERY_LIMIT};
object2.allowFetch = true;
const {commandsByActiveSection, loading} = Reflect.apply(useDiscovery, applicationCommandQueryApiModule, [object2]);
let binding = env0_4;
let useMemo = binding.useMemo;
const value6 = Reflect.apply(useMemo, binding, [_fun89431, [commandsByActiveSection]]);
useMemo = binding.useMemo;
const result = value3.result;
const value7 = Reflect.apply(useMemo, binding, [_fun89433, [result == null ? value : result.sections, value6]]);
value = require(11663) /* metro dependency 11663: ApplicationFrecencyHooks */;
value = value.useSortApplicationsViaFrecency(value7);
binding = value;
useMemo = binding.useMemo;
return {appsInThisServer: Reflect.apply(useMemo, binding, [_fun89436, [value4, value]]),
isLoading: value3.fetchState.fetching || loading};
}
function _fun89430() { // fn#89430, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11850:435, offset: 0x0200d474, size: 35 bytes, params: 1, frame: 10
const value = environment.__proto__;
return UserStore.getCurrentUser()?.nsfwAllowed;
}
function _fun89431() { // fn#89431, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11850:777, offset: 0x0200d497, size: 58 bytes, params: 1, frame: 13
const commandsByActiveSectionBinding = commandsByActiveSection;
const reduce = commandsByActiveSectionBinding.reduce;
const Set = global.Set;
return Reflect.apply(reduce, commandsByActiveSectionBinding, [function(a0, a1) {
if (a1.data.length > 0) {
a0.add(a1.section.id);
}
return a0;
}, new Set()]);
}
function _fun89433() { // fn#89433, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11850:872, offset: 0x0200d4fe, size: 92 bytes, params: 1, frame: 15
const Object = global.Object;
let value = Object.values(env0_0.result?.sections ?? ({}));
value = value.map(function(a0) {
return a0.descriptor;
});
return value.filter(_fun89435);
}
function _fun89436() { // fn#89436, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11850:1172, offset: 0x0200d5ae, size: 98 bytes, params: 1, frame: 14
var environment;
let value = environment.__proto__;
const compact = (importDefault(22) /* metro dependency 22 */).compact;
const binding = env0_4;
value = Reflect.apply(compact, value, [binding.map(function(a0) {
return a0.application;
})]);
value = value.filter(_fun89438);
return value.map(function(a0) {
return {application: a0};
});
}
function _fun89435(a0) { // fn#89435, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11850:994, offset: 0x0200d565, size: 73 bytes, params: 2, frame: 13
var r0;
var binding;
const id = a0.id;
let value = environment.__proto__.__proto__;
const BUILT_IN_SECTIONS = (require(7871) /* metro dependency 7871: ApplicationCommandBuiltIns */).BUILT_IN_SECTIONS;
if (value) {
r0 = !(id in BUILT_IN_SECTIONS);
} else {
value = environment.__proto__;
binding = env1_3;
value = binding.has(a0.id);
r0 = value;
}
return r0;
}
function _fun89438(a0) { // fn#89438, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11850:1231, offset: 0x0200d610, size: 59 bytes, params: 2, frame: 12
var r0;
let value = environment.__proto__;
value = env1_1 === false;
if (value) {
value = environment.__proto__.__proto__;
value = importDefault(8040) /* metro dependency 8040: isApplicationAgeRestricted */;
value = value(a0.id);
r0 = value;
} else {
r0 = value;
}
return !r0;
}
@@ -0,0 +1,12 @@
/* Metro module 11630; source: modules/app_launcher/hooks/useClickOnHomeActivityOpensAppDetails.tsx; dependencies: [3829, 2] */
function _fun89200(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#89200, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11816:6, offset: 0x02003f97, size: 96 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/app_launcher/hooks/useClickOnHomeActivityOpensAppDetails.tsx');
exports.useClickOnHomeActivityOpensAppDetails = function() {
var DeveloperMode = require(dependencyMap[0]).DeveloperMode;
return DeveloperMode.useSetting();
};
}
@@ -0,0 +1,37 @@
/* Metro module 11573; source: modules/app_launcher/hooks/useCommandContext.tsx; dependencies: [31, 1867, 2] */
function _fun88627(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88627, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11759:6, offset: 0x01fec7d8, size: 142 bytes, params: 8, frame: 18
const closure = getCommandContext;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = importAll(31) /* metro dependency 31 */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/app_launcher/hooks/useCommandContext.tsx');
exports.getCommandContext = closure;
exports.useCommandContext = function(a0) {
return a0.useMemo(_fun88630, [a0]);
};
}
function getCommandContext(a0) { // fn#88628, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11759:116, offset: 0x01fec866, size: 80 bytes, params: 2, frame: 12
var r0;
var object2;
var channel;
var getGuild;
if (a0.type === 'contextless') {
r0 = {channel: undefined, guild: undefined};
} else {
object2 = {};
channel = a0.channel;
object2.channel = channel;
getGuild = GuildStore.getGuild;
channel = a0.channel;
object2.guild = Reflect.apply(getGuild, GuildStore, [channel.guild_id]);
r0 = object2;
}
return r0;
}
function useCommandContext(a0) { // fn#88629, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11759:402, offset: 0x01fec8b6, size: 44 bytes, params: 2, frame: 14
return a0.useMemo(_fun88630, [a0]);
}
@@ -0,0 +1,32 @@
/* Metro module 11681; source: modules/app_launcher/hooks/useDelayedSwapToActivityActionLeave.tsx; dependencies: [57, 31, 11598, 2] */
function _fun89531(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#89531, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11867:6, offset: 0x020125f0, size: 133 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(57) /* metro dependency 57 */;
const env0_3 = importAll(31) /* metro dependency 31 */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/app_launcher/hooks/useDelayedSwapToActivityActionLeave.tsx');
exports.useDelayedSwapToActivityActionLeave = useDelayedSwapToActivityActionLeave;
}
function useDelayedSwapToActivityActionLeave(a0) { // fn#89532, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11867:254, offset: 0x02012675, size: 87 bytes, params: 2, frame: 16
const env0_0 = a0;
const binding = env0_3;
const value = env0_2(binding.useState(a0), 2);
const property = value[0];
const env0_1 = value[1];
binding.useLayoutEffect(_fun89533, [a0]);
return property;
}
function _fun89533() { // fn#89533, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11867:371, offset: 0x020126cc, size: 102 bytes, params: 1, frame: 15
const binding = env0_0;
const ActivityAction = (require(11598) /* metro dependency 11598: useActivityShelfItem */).ActivityAction;
const LEAVE = ActivityAction.LEAVE;
if (binding === LEAVE) {
var env0_0 = global.setTimeout(_fun89534, 100);
return _fun89535;
}
env0_1(env0_0);
}
@@ -0,0 +1,41 @@
/* Metro module 11686; source: modules/app_launcher/hooks/useFilterAndSortToOnlyFrecentCommands.tsx; dependencies: [31, 7863, 11573, 7870, 2] */
function _fun89549(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#89549, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11872:6, offset: 0x0201319a, size: 133 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importAll(31) /* metro dependency 31 */;
const applicationCommandFrecencyStore = importDefault(7863) /* metro dependency 7863: ApplicationCommandFrecencyStore */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/app_launcher/hooks/useFilterAndSortToOnlyFrecentCommands.tsx');
exports.default = useFilterAndSortToOnlyFrecentCommands;
}
function useFilterAndSortToOnlyFrecentCommands({context, commands, limit = commands.length}) { // fn#89550, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11872:230, offset: 0x0201321f, size: 191 bytes, params: 2, frame: 19
const value2 = (require(11573) /* metro dependency 11573: useCommandContext */).useCommandContext(context);
const env0_2 = value2;
const value3 = (require(7870) /* metro dependency 7870: ApplicationCommandFrecencyHooks */).useTopCommands(value2);
const binding = env0_2;
return binding.useMemo(_fun89553, [value3, binding.useMemo(function() {
return commands.reduce(_fun89552, {});
}, [commands]), value2, limit]);
}
function _fun89551() { // fn#89551, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11872:394, offset: 0x020132de, size: 32 bytes, params: 1, frame: 13
return commands.reduce(function(a0, a1) {
a0[a1.id] = a1;
return a0;
}, {});
}
function _fun89553() { // fn#89553, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11872:458, offset: 0x020132fe, size: 80 bytes, params: 1, frame: 14
return env0_3.map(_fun89554).filter(function(a0) {
return a0 != null;
}).sort(_fun89556).slice(0, env0_1);
}
function _fun89556(a0, a1) { // fn#89556, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11872:506, offset: 0x0201334e, size: 54 bytes, params: 3, frame: 14
let getScoreWithoutLoadingLatest = ApplicationCommandFrecencyStore.getScoreWithoutLoadingLatest;
const value2 = Reflect.apply(getScoreWithoutLoadingLatest, ApplicationCommandFrecencyStore, [env1_2, a0]);
getScoreWithoutLoadingLatest = ApplicationCommandFrecencyStore.getScoreWithoutLoadingLatest;
return Reflect.apply(getScoreWithoutLoadingLatest, ApplicationCommandFrecencyStore, [env1_2, a1]) - value2;
}
@@ -0,0 +1,100 @@
/* Metro module 11682; source: modules/app_launcher/hooks/useIsPrimaryEntryPointDisabled.tsx; dependencies: [4235, 3784, 482, 566, 9467, 11598, 8448, 8049, 477, 1244, 2] */
function _fun89536(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#89536, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11868:6, offset: 0x02012746, size: 156 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const applicationRecord = importDefault(4235) /* metro dependency 4235: ApplicationRecord */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const env0_5 = (require(482) /* metro dependency 482: Constants */).Permissions;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/app_launcher/hooks/useIsPrimaryEntryPointDisabled.tsx');
exports.default = useIsPrimaryEntryPointDisabled;
}
function useIsPrimaryEntryPointDisabled({context, application, activityAction}) { // fn#89537, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11868:244, offset: 0x020127e2, size: 786 bytes, params: 2, frame: 24
var r5;
var r7;
var r1;
var r2;
var moduleValue3;
var moduleValue4;
var defaultImport;
var moduleValue5;
var supported_platforms;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var value13;
var value14;
const value = undefined;
const channel = context.type !== 'channel' ? value : context.channel;
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], function() {
var USE_EMBEDDED_ACTIVITIES = Permissions.USE_EMBEDDED_ACTIVITIES;
return PermissionStore.can(USE_EMBEDDED_ACTIVITIES, channel);
});
const value4 = (require(9467) /* metro dependency 9467: getEmbeddedActivityLaunchability */).useEmbeddedActivityLaunchability(channel == null ? value : channel.id);
const ActivityAction = (require(11598) /* metro dependency 11598: useActivityShelfItem */).ActivityAction;
let LEAVE = ActivityAction.LEAVE;
if (LEAVE === activityAction) {
r5 = false;
} else if (ActivityAction.START === activityAction) {
if (channel == null) {
r5 = false;
} else if (channel == null) {
moduleValue4 = require(8448) /* metro dependency 8448: ActivitiesInTextUtils */;
r5 = !moduleValue4.isActivitiesInTextEnabled(channel) && true;
} else if (channel.isGuildVoice()) {
r5 = !(value4 === (require(9467) /* metro dependency 9467: getEmbeddedActivityLaunchability */).EmbeddedActivityLaunchability.CAN_LAUNCH) && true;
} else {
moduleValue4 = require(8448) /* metro dependency 8448: ActivitiesInTextUtils */;
r5 = !moduleValue4.isActivitiesInTextEnabled(channel) && true;
}
} else if (ActivityAction.JOIN !== activityAction) {
r5 = false;
} else if (channel == null) {
moduleValue3 = require(8448) /* metro dependency 8448: ActivitiesInTextUtils */;
r5 = !moduleValue3.isActivitiesInTextEnabled(channel) && true;
} else if (channel.isGuildVoice()) {
r5 = !value3;
} else {
moduleValue3 = require(8448) /* metro dependency 8448: ActivitiesInTextUtils */;
r5 = !moduleValue3.isActivitiesInTextEnabled(channel) && true;
}
LEAVE = ActivityAction.LEAVE;
if (activityAction === LEAVE) {
r1 = value;
r2 = r5;
} else {
r7 = application instanceof ApplicationRecord ? application.embeddedActivityConfig : application.embedded_activity_config;
defaultImport = importDefault(8049) /* metro dependency 8049: getPlatform */;
moduleValue5 = require(477) /* metro dependency 477: PlatformUtils */;
if (r7 == null) {
if (channel != null && channel.isThread()) {
value13 = intl.string(t.ddSR3v);
value14 = true;
r1 = value13;
r2 = value14;
} else {
r1 = value;
r2 = r5;
}
} else {
supported_platforms = r7.supported_platforms;
if (supported_platforms.includes(defaultImport(moduleValue5.getOS()))) {
if (channel != null && channel.isThread()) {
value13 = intl.string(t.ddSR3v);
value14 = true;
r1 = value13;
r2 = value14;
} else {
r1 = value;
r2 = r5;
}
} else {
r1 = intl.string(t.z2YTgJ);
r2 = false;
}
}
}
r1 = r2 && r1 == null ? intl.string(t.f41E1g) : r1;
return {disabled: r2, reason: r1};
}
@@ -0,0 +1,105 @@
/* Metro module 11675; source: modules/app_launcher/hooks/useSortedSectionCommands.tsx; dependencies: [57, 31, 11676, 11612, 672, 2] */
function _fun89498(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#89498, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11861:6, offset: 0x02010af9, size: 159 bytes, params: 8, frame: 20
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(11676) /* metro dependency 11676: AppLauncherConstants */).CommandListSortOrder;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/app_launcher/hooks/useSortedSectionCommands.tsx');
exports.default = useSortedSectionCommands;
}
function useSortedSectionCommands({sectionId, commandsByActiveSection}) { // fn#89499, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11861:248, offset: 0x02010b98, size: 249 bytes, params: 2, frame: 21
var r2;
const binding = env0_4;
const useState = binding.useState;
const ALPHABETICAL = CommandListSortOrder.ALPHABETICAL;
const value3 = env0_3(Reflect.apply(useState, binding, [ALPHABETICAL]), 2);
const property = value3[0];
const property2 = value3[1];
const value4 = binding.useMemo(_fun89500, [commandsByActiveSection, sectionId]);
const {popularSortedCommands, canSort} = usePopularSortedCommands({alphabeticalSortedCommands: value4});
binding.useEffect(function() {
var moduleValue = importAll(dependencyMap[3]);
var sectionIdBinding = sectionId;
var object = {};
object.dontRefetchMs = importDefault(dependencyMap[4]).Millis.DAY;
moduleValue.getApplication(sectionIdBinding, object);
}, [sectionId]);
binding.useLayoutEffect(_fun89508, [canSort]);
const POPULAR = CommandListSortOrder.POPULAR;
if (POPULAR === property) {
r2 = popularSortedCommands;
} else {
CommandListSortOrder.ALPHABETICAL;
r2 = value4;
}
return {sortOrder: property, setSortOrder: property2, commands: r2, canSort: canSort};
}
function _fun89500() { // fn#89500, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11861:392, offset: 0x02010c91, size: 53 bytes, params: 1, frame: 12
return commandsByActiveSection.find(function(a0) {
return a0.section.id === sectionId;
})?.data ?? [];
}
function usePopularSortedCommands({alphabeticalSortedCommands}) { // fn#89502, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11861:492, owner: useSortedSectionCommands.usePopularSortedCommands, offset: 0x02010ce1, size: 50 bytes, params: 2, frame: 14
return env1_4.useMemo(_fun89503, [alphabeticalSortedCommands]);
}
function _fun89508() { // fn#89508, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11861:1267, offset: 0x02010e8a, size: 38 bytes, params: 1, frame: 11
var binding;
if (canSort) {
binding = env0_2;
value = environment.__proto__;
binding(CommandListSortOrder.POPULAR);
}
}
function _fun89503() { // fn#89503, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11861:576, offset: 0x02010d13, size: 148 bytes, params: 1, frame: 15
if (alphabeticalSortedCommands.length <= 1) {
return {popularSortedCommands: alphabeticalSortedCommands, canSort: false};
}
const env0_0 = false;
const value2 = alphabeticalSortedCommands.map(_fun89504);
const binding = env0_0;
const object2 = {};
if (binding) {
value2.sort(function(a0, a1) {
var property = a0.command.global_popularity_rank;
var global_popularity_rank = a1.command.global_popularity_rank;
if (property != null) {
if (global_popularity_rank != null) {
if (property !== global_popularity_rank) {
return property - global_popularity_rank;
}
property = a0.alphabeticalSortIndex;
return property - a1.alphabeticalSortIndex;
}
}
if (property != null) {
return -1;
}
if (global_popularity_rank == null) {
return a0.alphabeticalSortIndex - a1.alphabeticalSortIndex;
}
return 1;
});
object2.popularSortedCommands = value2.map(_fun89506);
object2.canSort = true;
} else {
object2.popularSortedCommands = alphabeticalSortedCommands;
object2.canSort = false;
}
return object2;
}
function _fun89504(a0, a1) { // fn#89504, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11861:657, offset: 0x02010da7, size: 46 bytes, params: 3, frame: 5
env0_0 = env0_0 || a0.global_popularity_rank != null;
return {command: a0, alphabeticalSortIndex: a1};
}
function _fun89506(a0) { // fn#89506, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11861:1014, offset: 0x02010e2e, size: 11 bytes, params: 2, frame: 1
return a0.command;
}