647 lines
29 KiB
TypeScript
647 lines
29 KiB
TypeScript
/* Metro module 8060; source: modules/application_commands/ApplicationCommandQueryApi.tsx; dependencies: [57, 31, 1867, 7861, 5066, 661, 5065, 7869, 566, 7871, 1360, 1909, 7866, 8039, 5068, 2] */
|
|
function _fun63958(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#63958, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:6, offset: 0x01b974ce, size: 509 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_63961 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const closure = useCommandsForApplication;
|
|
const createPlaceholderCommands = function(a0, a1) {
|
|
var r3;
|
|
var items = [];
|
|
var value = 0;
|
|
if (value < a0) {
|
|
for (r3 = value; true; r3 = value) {
|
|
items.push(createPlaceholderCommand(r3, a1));
|
|
value = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1;
|
|
if (!(value < a0)) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
return items;
|
|
};
|
|
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 guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const applicationCommandIndexStoreModule = require(7861) /* metro dependency 7861: ApplicationCommandIndexStore */;
|
|
const env0_6 = applicationCommandIndexStoreModule.useContextIndexState;
|
|
const env0_7 = applicationCommandIndexStoreModule.useDiscoveryState;
|
|
const env0_8 = applicationCommandIndexStoreModule.useQueryState;
|
|
const env0_9 = applicationCommandIndexStoreModule.useUserIndexState;
|
|
const applicationCommandIndexStore = importDefault(7861) /* metro dependency 7861: ApplicationCommandIndexStore */;
|
|
const env0_11 = (require(5066) /* metro dependency 5066: ApplicationCommandConstants */).BuiltInSectionId;
|
|
const env0_12 = (require(661) /* metro dependency 661: Constants */).NOOP;
|
|
const ApplicationCommandType = (require(1909) /* metro dependency 1909: Server */).ApplicationCommandType;
|
|
const CHAT = ApplicationCommandType.CHAT;
|
|
object = [CHAT];
|
|
object = {'id': 'placeholder-section', 'type': null, 'name': ''};
|
|
const ApplicationCommandSectionType = (require(5068) /* metro dependency 5068: ApplicationCommandTypes */).ApplicationCommandSectionType;
|
|
const APPLICATION = ApplicationCommandSectionType.APPLICATION;
|
|
object.type = APPLICATION;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/application_commands/ApplicationCommandQueryApi.tsx');
|
|
exports.getCachedCommand = getCachedCommand;
|
|
exports.getCachedApplicationSection = getCachedApplicationSection;
|
|
exports.getCachedResults = getCachedResults_63974;
|
|
exports.getChangeKeys = getChangeKeys;
|
|
exports.useCachedResults = useCachedResults;
|
|
exports.useDiscovery = useDiscovery;
|
|
exports.executeQuery = executeQuery;
|
|
exports.useQuery = useQuery;
|
|
exports.useCommand = useCommand;
|
|
exports.useCommandsForApplication = closure;
|
|
exports.useAccessibleCommandsForApplication = useAccessibleCommandsForApplication;
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_63959(a0, a1) { // fn#63959, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:287, offset: 0x01b976cb, 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 _fun63960;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_63961(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_63961(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_63961(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun63960;
|
|
}
|
|
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 findCommandInSection(a0, a1) { // fn#63962, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:1197, offset: 0x01b9783d, size: 208 bytes, params: 3, frame: 18
|
|
var rootCommand;
|
|
var r2;
|
|
var commands;
|
|
var Object;
|
|
var values;
|
|
var value;
|
|
var value2;
|
|
var buildCommand;
|
|
var application;
|
|
const env0_0 = a1;
|
|
if (a1 != null) {
|
|
commands = a0.commands;
|
|
if (commands[a1] != null) {
|
|
return a0.commands[a1];
|
|
}
|
|
Object = global.Object;
|
|
values = Object.values;
|
|
commands = a0.commands;
|
|
value = Reflect.apply(values, Object, [commands]);
|
|
value = value.find(_fun63963);
|
|
value2 = undefined;
|
|
rootCommand = value == null ? value2 : value.rootCommand;
|
|
if (rootCommand != null) {
|
|
value = require(5065) /* metro dependency 5065: ApplicationCommandUtils */;
|
|
buildCommand = value.buildCommand;
|
|
application = a0.descriptor.application;
|
|
value = Reflect.apply(buildCommand, value, [{rootCommand: rootCommand, command: rootCommand,
|
|
applicationId: (application == null ? value2 : application.id) ?? ''}]);
|
|
r2 = value;
|
|
} else {
|
|
r2 = value2;
|
|
}
|
|
return r2;
|
|
}
|
|
}
|
|
|
|
function useCommandsForApplication(a0, a1, a2) { // fn#63964, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:1576, offset: 0x01b97933, size: 129 bytes, params: 4, frame: 21
|
|
const env0_0 = a1;
|
|
const env0_1 = a2;
|
|
const value2 = undefined;
|
|
const value3 = useUserIndexState(true, true);
|
|
const value4 = useContextIndexState(a0, true, true);
|
|
return env0_4.useMemo(_fun63965, [value3 == null ? value2 : value3.result, value4 == null ? value2 : value4.result,
|
|
a1, a2]);
|
|
}
|
|
|
|
function createPlaceholderCommand(a0, a1) { // fn#63970, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:2673, offset: 0x01b97bd9, size: 110 bytes, params: 3, frame: 13
|
|
const ApplicationCommandInputType = (require(5068) /* metro dependency 5068: ApplicationCommandTypes */).ApplicationCommandInputType;
|
|
const PLACEHOLDER = ApplicationCommandInputType.PLACEHOLDER;
|
|
return {'type': null, 'inputType': null, 'id': null, 'untranslatedName': '', 'displayName': '',
|
|
'untranslatedDescription': '', 'displayDescription': '', 'applicationId': '', type: a1, inputType: PLACEHOLDER,
|
|
id: 'placeholder-' + a0, section: env0_14};
|
|
}
|
|
|
|
function getCachedCommand(a0, a1, a2) { // fn#63971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:3035, offset: 0x01b97c47, size: 322 bytes, params: 4, frame: 22
|
|
var value9;
|
|
var commandInSection;
|
|
var value10;
|
|
var value11;
|
|
const env0_0 = a2;
|
|
if (a1 == null) {
|
|
return {application: undefined, command: undefined};
|
|
}
|
|
const userState = ApplicationCommandIndexStore.getUserState();
|
|
const contextState = ApplicationCommandIndexStore.getContextState(a0);
|
|
let Object = global.Object;
|
|
let values = Object.values;
|
|
let result = userState.result;
|
|
const value4 = undefined;
|
|
const value5 = Reflect.apply(values, Object, [(result == null ? value4 : result.sections) ?? ({})]);
|
|
const concat = value5.concat;
|
|
Object = global.Object;
|
|
values = Object.values;
|
|
result = contextState.result;
|
|
const value6 = Reflect.apply(concat, value5, [Reflect.apply(values, Object,
|
|
[(result == null ? value4 : result.sections) ?? ({})])]);
|
|
if (a2 != null) {
|
|
value11 = value6.find(_fun63972);
|
|
if (value11 != null) {
|
|
return {application: value11.descriptor.application, command: findCommandInSection(value11, a1)};
|
|
}
|
|
return {application: value4, command: value4};
|
|
}
|
|
const value7 = _createForOfIteratorHelperLoose_63959(value6);
|
|
const value8 = value7();
|
|
let done = value8.done;
|
|
if (done) {
|
|
return {application: value4, command: value4};
|
|
}
|
|
let r9 = value8;
|
|
loopExit11: while (true) {
|
|
value9 = r9.value;
|
|
commandInSection = findCommandInSection(value9, a1);
|
|
if (commandInSection != null) {
|
|
break loopExit11;
|
|
}
|
|
value10 = value7();
|
|
done = value10.done;
|
|
if (done) {
|
|
return {application: value4, command: value4};
|
|
}
|
|
r9 = value10;
|
|
continue;
|
|
}
|
|
return {application: value9.descriptor.application, command: commandInSection};
|
|
}
|
|
|
|
function getCachedApplicationSection(a0, a1, a2) { // fn#63973, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:3771, offset: 0x01b97db4, size: 180 bytes, params: 4, frame: 16
|
|
let value = ApplicationCommandIndexStore.getUserState();
|
|
const contextState = ApplicationCommandIndexStore.getContextState(a0);
|
|
const applicationState = ApplicationCommandIndexStore.getApplicationState(a2);
|
|
const result = value.result;
|
|
value = undefined;
|
|
let r1 = result == null || result.sections == null ? value : result.sections[a2];
|
|
r1 = r1 ?? (contextState.result == null || contextState.result.sections == null ? value : contextState.result.sections[a2]);
|
|
r1 = r1 ?? (applicationState.result == null || applicationState.result.sections == null ? value : applicationState.result.sections[a2]);
|
|
return r1 == null ? value : r1.descriptor;
|
|
}
|
|
|
|
function getCachedResults_63974(a0, a1, a2) { // fn#63974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:4139, offset: 0x01b97e68, size: 122 bytes, params: 4, frame: 17
|
|
const query = ApplicationCommandIndexStore.query;
|
|
const ScoreMethod = (require(7869) /* metro dependency 7869: ApplicationCommandQueryTypes */).ScoreMethod;
|
|
const COMMAND_OR_APPLICATION = ScoreMethod.COMMAND_OR_APPLICATION;
|
|
const value = Reflect.apply(query, ApplicationCommandIndexStore, [a0, {commandTypes: [a1], text: a2},
|
|
{scoreMethod: COMMAND_OR_APPLICATION, allowFetch: false}]);
|
|
return {commands: value.commands, sections: value.descriptors};
|
|
}
|
|
|
|
function getChangeKeys(a0) { // fn#63975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:4356, offset: 0x01b97ee2, size: 77 bytes, params: 2, frame: 14
|
|
const userState = ApplicationCommandIndexStore.getUserState();
|
|
const contextState = ApplicationCommandIndexStore.getContextState(a0);
|
|
const value3 = undefined;
|
|
return [userState == null ? value3 : userState.result, contextState == null ? value3 : contextState.result];
|
|
}
|
|
|
|
function useCachedResults(a0, a1, a2) { // fn#63976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:4505, offset: 0x01b97f2f, size: 105 bytes, params: 4, frame: 16
|
|
const env0_0 = a1;
|
|
const binding = env0_4;
|
|
let object = [a1];
|
|
object = {commandTypes: binding.useMemo(function() {
|
|
return [require];
|
|
}, object), text: a2};
|
|
const value = useQueryState(a0, object, {allowFetch: false});
|
|
return {commands: value.commands, sections: value.descriptors};
|
|
}
|
|
|
|
function useDiscovery({context, filters, options, allowFetch}) { // fn#63978, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:4684, offset: 0x01b97fa9, size: 389 bytes, params: 2, frame: 24
|
|
var object2;
|
|
const type = context.type;
|
|
let value = null;
|
|
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() {
|
|
return GuildStore.getGuild(guild_id);
|
|
}, [type !== 'channel' ? value : context.channel.guild_id]);
|
|
object2 = {};
|
|
copyDataProperties(object2, options, undefined);
|
|
object2['allowFetch'] = allowFetch;
|
|
const value4 = useDiscoveryState(context, value3, filters, object2);
|
|
const descriptors = value4.descriptors;
|
|
const env0_3 = descriptors;
|
|
const commands = value4.commands;
|
|
const env0_4 = commands;
|
|
const sectionedCommands = value4.sectionedCommands;
|
|
const loading = value4.loading;
|
|
value = env0_4.useState(value);
|
|
value = env0_3(value, 2);
|
|
const property = value[0];
|
|
const env0_8 = value[1];
|
|
return env0_4.useMemo(_fun63981, [loading, commands, descriptors, sectionedCommands, property,
|
|
env0_4.useMemo(function() {
|
|
var createPlaceholderCommandsBinding = createPlaceholderCommands;
|
|
var placeholderCount = options.placeholderCount;
|
|
var value2 = 0;
|
|
return createPlaceholderCommandsBinding(placeholderCount ?? value2, filters.commandTypes[value2]);
|
|
}, [filters.commandTypes, options.placeholderCount])]);
|
|
}
|
|
|
|
function executeQuery(a0, a1, a2) { // fn#63984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:5778, offset: 0x01b98367, size: 214 bytes, params: 4, frame: 20
|
|
var items2;
|
|
const {descriptors, commands, loading} = ApplicationCommandIndexStore.query(a0, a1, a2);
|
|
const createPlaceholderCommandsBinding = createPlaceholderCommands;
|
|
const value3 = 0;
|
|
let r1 = loading && a2.placeholderCount != null ? a2.placeholderCount : value3;
|
|
const placeholderCommands = createPlaceholderCommandsBinding(r1, a1.commandTypes[value3]);
|
|
const object2 = {};
|
|
if (loading) {
|
|
items2 = [];
|
|
arraySpread(items2, placeholderCommands, arraySpread(items2, commands, value3, placeholderCommands),
|
|
placeholderCommands);
|
|
r1 = items2;
|
|
} else {
|
|
r1 = commands;
|
|
}
|
|
object2.commands = r1;
|
|
object2.sections = loading ? value3 !== descriptors.length ? descriptors : [(require(7871) /* metro dependency 7871: ApplicationCommandBuiltIns */).BUILT_IN_SECTIONS[BuiltInSectionId.BUILT_IN]] : descriptors;
|
|
return object2;
|
|
}
|
|
|
|
function useQuery(a0, a1, a2) { // fn#63985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:6068, offset: 0x01b9843d, size: 178 bytes, params: 4, frame: 20
|
|
const env0_0 = a1;
|
|
const env0_1 = a2;
|
|
const object2 = {};
|
|
copyDataProperties(object2, a2, undefined);
|
|
object2['allowFetch'] = true;
|
|
const {descriptors, commands, loading} = useQueryState(a0, a1, object2);
|
|
const env0_4 = loading;
|
|
return env0_4.useMemo(_fun63987, [loading, commands, descriptors, env0_4.useMemo(function() {
|
|
var createPlaceholderCommandsBinding = createPlaceholderCommands;
|
|
var placeholderCount = importDefault.placeholderCount;
|
|
var value2 = 0;
|
|
return createPlaceholderCommandsBinding(placeholderCount ?? value2, require.commandTypes[value2]);
|
|
}, [a1.commandTypes, a2.placeholderCount])]);
|
|
}
|
|
|
|
function useCommand(a0, a1) { // fn#63988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:6475, offset: 0x01b9858e, size: 98 bytes, params: 3, frame: 18
|
|
const env0_0 = a1;
|
|
return env0_4.useMemo(_fun63989, [useContextIndexState(a0, true, true).result, useUserIndexState(true, true).result,
|
|
a1]);
|
|
}
|
|
|
|
function useAccessibleCommandsForApplication(a0, a1, a2) { // fn#63990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:7031, offset: 0x01b986d6, size: 205 bytes, params: 4, frame: 22
|
|
const env0_0 = a0;
|
|
let binding = env0_4;
|
|
let useMemo = binding.useMemo;
|
|
const {commands, application, sectionDescriptor, isGuildInstalled,
|
|
isUserInstalled} = useCommandsForApplication(Reflect.apply(useMemo, binding, [_fun63991, [a0]]), a1, a2);
|
|
var env0_4 = isUserInstalled;
|
|
const value4 = (require(7866) /* metro dependency 7866: CommandPermissionContext */).usePermissionContext(a0,
|
|
env0_13);
|
|
binding = env0_4;
|
|
useMemo = binding.useMemo;
|
|
return {application: application, commands: Reflect.apply(useMemo, binding, [_fun63992, [commands, value4,
|
|
sectionDescriptor, isGuildInstalled, isUserInstalled, a0]])};
|
|
}
|
|
|
|
function _fun63963({rootCommand}) { // fn#63963, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:1345, offset: 0x01b9790d, size: 38 bytes, params: 2, frame: 3
|
|
return rootCommand?.id === require;
|
|
}
|
|
|
|
function _fun63965() { // fn#63965, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:1664, offset: 0x01b979b4, size: 390 bytes, params: 1, frame: 20
|
|
let result = env0_2.result;
|
|
const value2 = undefined;
|
|
const value3 = (result == null || result.sections == null ? value2 : result.sections[require]) != null;
|
|
result = env0_3.result;
|
|
const value4 = (result == null || result.sections == null ? value2 : result.sections[require]) != null;
|
|
result = env0_2.result;
|
|
let r4 = result == null || result.sections == null ? value2 : result.sections[require];
|
|
r4 = r4 ?? (env0_3.result == null ? value2 : env0_3.result.sections[require]);
|
|
const Object = global.Object;
|
|
const env0_0 = Object.values((r4 == null ? value2 : r4.commands) ?? ({})).map(_fun63966).reduce(function(a0, a1) {
|
|
a0[a1.id] = a1;
|
|
return a0;
|
|
}, {});
|
|
const object2 = {};
|
|
object2.application = r4 == null || r4.descriptor == null ? value2 : r4.descriptor.application;
|
|
const value = importDefault.map(_fun63968);
|
|
object2.commands = value.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish);
|
|
object2.sectionDescriptor = r4 == null ? value2 : r4.descriptor;
|
|
object2.isGuildInstalled = value4;
|
|
object2.isUserInstalled = value3;
|
|
return object2;
|
|
}
|
|
|
|
function _fun63972({descriptor}) { // fn#63972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:3349, offset: 0x01b97d89, size: 43 bytes, params: 2, frame: 3
|
|
return descriptor.application?.id === importDefault;
|
|
}
|
|
|
|
function _fun63981() { // fn#63981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:5162, offset: 0x01b98185, size: 436 bytes, params: 1, frame: 18
|
|
var r7;
|
|
var r1;
|
|
var value3;
|
|
var section;
|
|
var property;
|
|
var object2;
|
|
var data;
|
|
var items8;
|
|
var items9;
|
|
var items10;
|
|
const object4 = {};
|
|
object4.loading = loading;
|
|
object4.commands = commands;
|
|
object4.activeSections = descriptors;
|
|
object4.commandsByActiveSection = sectionedCommands;
|
|
object4.filteredSectionId = env0_7;
|
|
object4.hasMoreAfter = false;
|
|
object4.placeholders = loading ? env0_9 : [];
|
|
object4.sectionDescriptors = descriptors;
|
|
object4.filterSection = filterSection;
|
|
object4.scrollDown = NOOP;
|
|
if (env0_7 != null) {
|
|
value3 = sectionedCommands.find(_fun63983);
|
|
if (value3 != null) {
|
|
section = value3.section;
|
|
r1 = [section];
|
|
r7 = section;
|
|
} else {
|
|
r1 = [];
|
|
}
|
|
object4.activeSections = r1;
|
|
r1 = value3 != null ? [value3] : [];
|
|
object4.commandsByActiveSection = r1;
|
|
}
|
|
if (loading) {
|
|
property = sectionedCommands[0];
|
|
if (property != null) {
|
|
object2 = {};
|
|
object2.section = property.section;
|
|
data = property.data;
|
|
items8 = [];
|
|
arraySpread(items8, env0_9, arraySpread(items8, data, 0, r7), r7);
|
|
object2.data = items8;
|
|
items9 = [object2];
|
|
sectionedCommandsBinding = sectionedCommands;
|
|
arraySpread(items9, sectionedCommandsBinding.slice(1), 1, r7);
|
|
object4.commandsByActiveSection = items9;
|
|
} else {
|
|
property = (require(7871) /* metro dependency 7871: ApplicationCommandBuiltIns */).BUILT_IN_SECTIONS[BuiltInSectionId.BUILT_IN];
|
|
object4.activeSections = [property];
|
|
object4.commandsByActiveSection = [{section: property, data: env0_9}];
|
|
r7 = require;
|
|
}
|
|
commandsBinding = commands;
|
|
items10 = [];
|
|
arraySpread(items10, env0_9, arraySpread(items10, commandsBinding, 0, r7), r7);
|
|
object4.commands = items10;
|
|
}
|
|
return object4;
|
|
}
|
|
|
|
function _fun63987() { // fn#63987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:6334, offset: 0x01b984ef, size: 159 bytes, params: 1, frame: 16
|
|
var r2;
|
|
var items2;
|
|
const object2 = {};
|
|
const loadingBinding = loading;
|
|
const commandsBinding = commands;
|
|
if (loadingBinding) {
|
|
items2 = [];
|
|
arraySpread(items2, env0_5, arraySpread(items2, commandsBinding, 0, commandsBinding), commandsBinding);
|
|
r2 = items2;
|
|
} else {
|
|
r2 = commandsBinding;
|
|
}
|
|
object2.commands = r2;
|
|
object2.sections = loading && descriptors.length === 0 ? [(require(7871) /* metro dependency 7871: ApplicationCommandBuiltIns */).BUILT_IN_SECTIONS[BuiltInSectionId.BUILT_IN]] : descriptors;
|
|
object2.scrollDown = NOOP;
|
|
return object2;
|
|
}
|
|
|
|
function _fun63989() { // fn#63989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:6546, offset: 0x01b985f0, size: 230 bytes, params: 1, frame: 19
|
|
var value7;
|
|
var commands;
|
|
var property;
|
|
var value8;
|
|
if (require == null) {
|
|
return {command: undefined, application: undefined};
|
|
}
|
|
const _createForOfIteratorHelperLoose_63959Binding = _createForOfIteratorHelperLoose_63959;
|
|
let Object = global.Object;
|
|
let values = Object.values;
|
|
let result = env0_1.result;
|
|
const value3 = undefined;
|
|
const value4 = Reflect.apply(values, Object, [(result == null ? value3 : result.sections) ?? ({})]);
|
|
const concat = value4.concat;
|
|
Object = global.Object;
|
|
values = Object.values;
|
|
result = env0_2.result;
|
|
const value5 = _createForOfIteratorHelperLoose_63959Binding(Reflect.apply(concat, value4, [Reflect.apply(values,
|
|
Object, [(result == null ? value3 : result.sections) ?? ({})])]));
|
|
const value6 = value5();
|
|
let done = value6.done;
|
|
if (done) {
|
|
return {command: undefined, application: undefined};
|
|
}
|
|
let r3 = value6;
|
|
loopExit10: while (true) {
|
|
value7 = r3.value;
|
|
commands = value7.commands;
|
|
property = commands[require];
|
|
if (property != null) {
|
|
break loopExit10;
|
|
}
|
|
value8 = value5();
|
|
done = value8.done;
|
|
if (done) {
|
|
return {command: undefined, application: undefined};
|
|
}
|
|
r3 = value8;
|
|
continue;
|
|
}
|
|
return {command: property, application: value7.descriptor.application};
|
|
}
|
|
|
|
function _fun63991() { // fn#63991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:7126, offset: 0x01b987a3, size: 23 bytes, params: 1, frame: 2
|
|
return {channel: env0_0, type: 'channel'};
|
|
}
|
|
|
|
function _fun63992() { // fn#63992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:7341, offset: 0x01b987ba, size: 283 bytes, params: 1, frame: 23
|
|
var environment;
|
|
var permissions;
|
|
var r2;
|
|
var guild_id;
|
|
var value4;
|
|
var moduleValue;
|
|
var computeAllowedForUser;
|
|
var binding;
|
|
var value6;
|
|
var moduleValue2;
|
|
var computeAllowedForChannel;
|
|
var allowedForChannel;
|
|
const commandsBinding = commands;
|
|
const value2 = null;
|
|
if (value2 != commandsBinding) {
|
|
guild_id = env0_0.guild_id;
|
|
if (value2 != guild_id) {
|
|
permissions = value2 == sectionDescriptor ? undefined : sectionDescriptor.permissions;
|
|
if (value2 != permissions) {
|
|
value4 = environment.__proto__;
|
|
moduleValue = importAll(8039) /* metro dependency 8039: CommandPermissionUtils */;
|
|
computeAllowedForUser = moduleValue.computeAllowedForUser;
|
|
permissions = sectionDescriptor.permissions;
|
|
guild_id = env0_0.guild_id;
|
|
binding = env0_5;
|
|
r2 = Reflect.apply(computeAllowedForUser, moduleValue, [permissions, guild_id, binding.userId,
|
|
binding.roleIds,
|
|
binding.isImpersonating]);
|
|
} else {
|
|
r2 = value2;
|
|
}
|
|
} else {
|
|
r2 = value2;
|
|
}
|
|
var env0_0 = r2;
|
|
guild_id = env0_0.guild_id;
|
|
if (value2 != guild_id) {
|
|
permissions = value2 == sectionDescriptor ? undefined : sectionDescriptor.permissions;
|
|
if (value2 != permissions) {
|
|
value6 = environment.__proto__;
|
|
moduleValue2 = importAll(8039) /* metro dependency 8039: CommandPermissionUtils */;
|
|
computeAllowedForChannel = moduleValue2.computeAllowedForChannel;
|
|
permissions = sectionDescriptor.permissions;
|
|
binding = env0_0;
|
|
allowedForChannel = Reflect.apply(computeAllowedForChannel, moduleValue2, [permissions, binding,
|
|
binding.guild_id]);
|
|
}
|
|
}
|
|
return commands.filter(_fun63993);
|
|
}
|
|
}
|
|
|
|
function _fun63966(a0) { // fn#63966, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:1983, offset: 0x01b97b3a, size: 89 bytes, params: 2, frame: 14
|
|
var r0;
|
|
var value2;
|
|
var moduleValue;
|
|
var buildCommand;
|
|
var object2;
|
|
let value = a0;
|
|
let rootCommand = value.rootCommand;
|
|
if (rootCommand == null) {
|
|
r0 = value;
|
|
} else {
|
|
value2 = environment.__proto__.__proto__;
|
|
moduleValue = require(5065) /* metro dependency 5065: ApplicationCommandUtils */;
|
|
buildCommand = moduleValue.buildCommand;
|
|
object2 = {};
|
|
rootCommand = value.rootCommand;
|
|
object2.rootCommand = rootCommand;
|
|
rootCommand = value.rootCommand;
|
|
object2.command = rootCommand;
|
|
object2.applicationId = value.applicationId;
|
|
value = Reflect.apply(buildCommand, moduleValue, [object2]);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun63983({section}) { // fn#63983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:5379, offset: 0x01b9834c, size: 27 bytes, params: 2, frame: 2
|
|
return section.id === env1_7;
|
|
}
|
|
|
|
function _fun63993(a0) { // fn#63993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8238:7661, offset: 0x01b988d5, size: 154 bytes, params: 2, frame: 20
|
|
const value2 = undefined;
|
|
const commandPermissionUtilsModule = importAll(8039) /* metro dependency 8039: CommandPermissionUtils */;
|
|
const hasAccess2 = commandPermissionUtilsModule.hasAccess(a0, env1_5, {applicationAllowedForUser: env0_0,
|
|
applicationAllowedForChannel: env0_1, isGuildInstalled: isGuildInstalled, isUserInstalled: isUserInstalled,
|
|
commandBotId: sectionDescriptor == null ? value2 : sectionDescriptor.botId});
|
|
const HasAccessResult = (require(8039) /* metro dependency 8039: CommandPermissionUtils */).HasAccessResult;
|
|
const ALLOWED = HasAccessResult.ALLOWED;
|
|
return hasAccess2 === ALLOWED;
|
|
}
|
|
|