2026-07-25 08:10:48 +00:00
|
|
|
// Module ID: 15609
|
|
|
|
|
// Function ID: 120397
|
2026-07-20 16:05:17 +00:00
|
|
|
// Name: ContextMenuCommandRootScreen
|
2026-07-25 08:10:48 +00:00
|
|
|
// Dependencies: [57, 31, 27, 1838, 4567, 33, 4131, 689, 566, 7962, 5680, 7957, 5159, 8759, 9849, 1212, 4127, 15610, 9171, 9173, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: default
|
|
|
|
|
|
2026-07-25 08:10:48 +00:00
|
|
|
// Module 15609 (ContextMenuCommandRootScreen)
|
2026-07-23 10:11:24 +00:00
|
|
|
import _slicedToArray from "_slicedToArray";
|
|
|
|
|
import result from "result";
|
|
|
|
|
import { View } from "get ActivityIndicator";
|
|
|
|
|
import closure_7 from "_createForOfIteratorHelperLoose";
|
|
|
|
|
import TRUE_OPTION_NAME from "TRUE_OPTION_NAME";
|
|
|
|
|
import jsxProd from "jsxProd";
|
|
|
|
|
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
|
|
|
|
|
|
|
|
|
|
let closure_10;
|
|
|
|
|
let closure_11;
|
|
|
|
|
let closure_8;
|
|
|
|
|
let closure_9;
|
|
|
|
|
const require = arg1;
|
|
|
|
|
({ CONTEXT_MENU_COMMANDS_QUERY_LIMIT: closure_8, BuiltInSectionId: closure_9 } = TRUE_OPTION_NAME);
|
|
|
|
|
({ jsx: closure_10, jsxs: closure_11 } = jsxProd);
|
|
|
|
|
_createForOfIteratorHelperLoose = {};
|
2026-07-25 08:10:48 +00:00
|
|
|
_createForOfIteratorHelperLoose = { flex: 1, marginHorizontal: require("_createForOfIteratorHelperLoose").space.PX_16, paddingTop: require("_createForOfIteratorHelperLoose").space.PX_16 };
|
2026-07-23 10:11:24 +00:00
|
|
|
_createForOfIteratorHelperLoose.container = _createForOfIteratorHelperLoose;
|
|
|
|
|
_createForOfIteratorHelperLoose.sectionHeader = { paddingTop: require("_createForOfIteratorHelperLoose").space.PX_16, paddingBottom: require("_createForOfIteratorHelperLoose").space.PX_8, backgroundColor: require("_createForOfIteratorHelperLoose").colors.BACKGROUND_BASE_LOWER };
|
|
|
|
|
_createForOfIteratorHelperLoose = _createForOfIteratorHelperLoose.createStyles(_createForOfIteratorHelperLoose);
|
|
|
|
|
let obj1 = { paddingTop: require("_createForOfIteratorHelperLoose").space.PX_16, paddingBottom: require("_createForOfIteratorHelperLoose").space.PX_8, backgroundColor: require("_createForOfIteratorHelperLoose").colors.BACKGROUND_BASE_LOWER };
|
|
|
|
|
const result = require("get ActivityIndicator").fileFinishedImporting("modules/application_commands/native/ContextMenuCommandRootScreen.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export default function ContextMenuCommandRootScreen(navigation) {
|
|
|
|
|
navigation = navigation.navigation;
|
|
|
|
|
const params = navigation.route.params;
|
|
|
|
|
const channel = params.channel;
|
|
|
|
|
const commandTargetId = params.commandTargetId;
|
|
|
|
|
const onPressAppCommand = params.onPressAppCommand;
|
|
|
|
|
const onClose = params.onClose;
|
|
|
|
|
let commands;
|
|
|
|
|
let commandsByActiveSection;
|
|
|
|
|
let sectionDescriptors;
|
|
|
|
|
let loading;
|
2026-07-23 10:11:24 +00:00
|
|
|
let sections;
|
|
|
|
|
let callback;
|
2026-07-20 16:05:17 +00:00
|
|
|
let callback1;
|
|
|
|
|
let frecencyItems;
|
|
|
|
|
let appItems;
|
|
|
|
|
let memo1;
|
2026-07-23 10:11:24 +00:00
|
|
|
let c18;
|
|
|
|
|
let c19;
|
2026-07-20 16:05:17 +00:00
|
|
|
let scaledTextLineHeight;
|
2026-07-23 10:11:24 +00:00
|
|
|
let obj = navigation(onPressAppCommand[8]);
|
|
|
|
|
let items = [closure_7];
|
2026-07-20 16:05:17 +00:00
|
|
|
const stateFromStores = obj.useStateFromStores(items, () => tmp4.getGuild(channel.guild_id));
|
2026-07-23 10:11:24 +00:00
|
|
|
let closure_6 = stateFromStores.useRef(false);
|
|
|
|
|
const tmp2 = onClose(stateFromStores.useState(""), 2);
|
2026-07-20 16:05:17 +00:00
|
|
|
const first = tmp2[0];
|
|
|
|
|
closure_7 = tmp4;
|
2026-07-23 10:11:24 +00:00
|
|
|
let items1 = [navigation, onClose];
|
|
|
|
|
const effect = stateFromStores.useEffect(() => navigation.addListener("beforeRemove", () => {
|
|
|
|
|
let current = outer1_6.current;
|
2026-07-20 16:05:17 +00:00
|
|
|
if (!current) {
|
2026-07-23 10:11:24 +00:00
|
|
|
current = null == outer1_4;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
if (!current) {
|
2026-07-23 10:11:24 +00:00
|
|
|
outer1_4();
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
}), items1);
|
2026-07-23 10:11:24 +00:00
|
|
|
let obj1 = commandTargetId(onPressAppCommand[9]);
|
2026-07-20 16:05:17 +00:00
|
|
|
obj = { context: { channel, type: "channel" } };
|
|
|
|
|
obj = {};
|
|
|
|
|
let tmp6;
|
|
|
|
|
if ("" !== first) {
|
|
|
|
|
tmp6 = first;
|
|
|
|
|
}
|
|
|
|
|
obj.text = tmp6;
|
2026-07-23 10:11:24 +00:00
|
|
|
let items2 = [params.commandType];
|
2026-07-20 16:05:17 +00:00
|
|
|
obj.commandTypes = items2;
|
|
|
|
|
obj.filters = obj;
|
|
|
|
|
obj1 = { limit: commands, includeFrecency: !tmp4 };
|
|
|
|
|
let prop;
|
|
|
|
|
if ("" !== first) {
|
2026-07-23 10:11:24 +00:00
|
|
|
prop = navigation(onPressAppCommand[10]).ScoreMethod.COMMAND_OR_APPLICATION;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
obj1.scoreMethod = prop;
|
|
|
|
|
obj.options = obj1;
|
|
|
|
|
obj.allowFetch = true;
|
|
|
|
|
const discovery = obj1.useDiscovery(obj);
|
|
|
|
|
commands = discovery.commands;
|
|
|
|
|
commandsByActiveSection = discovery.commandsByActiveSection;
|
|
|
|
|
sectionDescriptors = discovery.sectionDescriptors;
|
|
|
|
|
loading = discovery.loading;
|
2026-07-23 10:11:24 +00:00
|
|
|
let items3 = [sectionDescriptors];
|
|
|
|
|
sections = stateFromStores.useMemo(() => {
|
2026-07-20 16:05:17 +00:00
|
|
|
const sections = {};
|
|
|
|
|
const item = sectionDescriptors.forEach((id) => {
|
|
|
|
|
sections[id.id] = id;
|
|
|
|
|
});
|
|
|
|
|
return { sections };
|
|
|
|
|
}, items3).sections;
|
2026-07-23 10:11:24 +00:00
|
|
|
let items4 = [channel, commandTargetId, stateFromStores, navigation, onPressAppCommand];
|
|
|
|
|
callback = stateFromStores.useCallback((command) => {
|
2026-07-20 16:05:17 +00:00
|
|
|
if (null != onPressAppCommand) {
|
|
|
|
|
onPressAppCommand();
|
|
|
|
|
}
|
|
|
|
|
closure_6.current = true;
|
2026-07-23 10:11:24 +00:00
|
|
|
obj = { command, optionValues: {}, context: obj, commandTargetId };
|
2026-07-20 16:05:17 +00:00
|
|
|
obj = { channel, guild: stateFromStores };
|
|
|
|
|
channel(onPressAppCommand[11])(obj);
|
|
|
|
|
let parent = navigation.getParent();
|
|
|
|
|
if (null == parent) {
|
|
|
|
|
parent = navigation;
|
|
|
|
|
}
|
|
|
|
|
parent.goBack();
|
|
|
|
|
}, items4);
|
2026-07-23 10:11:24 +00:00
|
|
|
let items5 = [commandsByActiveSection, navigation, callback];
|
|
|
|
|
callback1 = stateFromStores.useCallback((section) => {
|
2026-07-20 16:05:17 +00:00
|
|
|
const navigation = section;
|
|
|
|
|
const found = commandsByActiveSection.find((section) => section.section.id === section.id);
|
|
|
|
|
let data;
|
|
|
|
|
if (null != found) {
|
|
|
|
|
data = found.data;
|
|
|
|
|
}
|
|
|
|
|
if (null == data) {
|
|
|
|
|
data = [];
|
|
|
|
|
}
|
|
|
|
|
const obj = { section, commands: data, onPressCommand: callback };
|
|
|
|
|
navigation.navigate("app", obj);
|
|
|
|
|
}, items5);
|
|
|
|
|
const items6 = [loading, commands.length, commandsByActiveSection];
|
2026-07-23 10:11:24 +00:00
|
|
|
const memo = stateFromStores.useMemo(() => {
|
2026-07-20 16:05:17 +00:00
|
|
|
if (!loading) {
|
|
|
|
|
if (0 !== commands.length) {
|
2026-07-23 10:11:24 +00:00
|
|
|
const found = commandsByActiveSection.find((section) => section.section.id === commandsByActiveSection.FRECENCY);
|
|
|
|
|
const found1 = commandsByActiveSection.filter((section) => section.section.id !== commandsByActiveSection.FRECENCY);
|
2026-07-20 16:05:17 +00:00
|
|
|
const obj = {};
|
|
|
|
|
let mapped;
|
|
|
|
|
if (null != found) {
|
|
|
|
|
const data = found.data;
|
|
|
|
|
mapped = data.map((command) => ({ type: "command", command }));
|
|
|
|
|
}
|
|
|
|
|
if (null == mapped) {
|
|
|
|
|
mapped = [];
|
|
|
|
|
}
|
|
|
|
|
obj.frecencyItems = mapped;
|
|
|
|
|
obj.appItems = found1.map((section) => ({ type: "app", section: section.section }));
|
|
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return { frecencyItems: [], appItems: [] };
|
|
|
|
|
}, items6);
|
|
|
|
|
frecencyItems = memo.frecencyItems;
|
|
|
|
|
appItems = memo.appItems;
|
|
|
|
|
const items7 = [loading, commands, "" !== first, frecencyItems, appItems];
|
2026-07-23 10:11:24 +00:00
|
|
|
memo1 = stateFromStores.useMemo(() => {
|
2026-07-20 16:05:17 +00:00
|
|
|
if (loading) {
|
|
|
|
|
let obj = { type: "placeholder" };
|
|
|
|
|
const items = [obj];
|
|
|
|
|
const items1 = [items];
|
|
|
|
|
return items1;
|
|
|
|
|
} else if (0 === commands.length) {
|
|
|
|
|
obj = { type: "no_commands" };
|
|
|
|
|
const items2 = [obj];
|
|
|
|
|
const items3 = [items2];
|
|
|
|
|
return items3;
|
2026-07-23 10:11:24 +00:00
|
|
|
} else if (closure_7) {
|
2026-07-20 16:05:17 +00:00
|
|
|
const items4 = [commands.map((command) => ({ type: "command", command }))];
|
|
|
|
|
return items4;
|
|
|
|
|
} else {
|
|
|
|
|
const items5 = [];
|
|
|
|
|
if (frecencyItems.length > 0) {
|
|
|
|
|
items5.push(frecencyItems);
|
|
|
|
|
}
|
|
|
|
|
if (appItems.length > 0) {
|
|
|
|
|
items5.push(appItems);
|
|
|
|
|
}
|
|
|
|
|
return items5;
|
|
|
|
|
}
|
|
|
|
|
}, items7);
|
|
|
|
|
const items8 = [memo1];
|
2026-07-23 10:11:24 +00:00
|
|
|
const memo2 = stateFromStores.useMemo(() => memo1.map((arg0) => arg0.length), items8);
|
|
|
|
|
const tmp17 = sections();
|
|
|
|
|
c18 = tmp17;
|
|
|
|
|
c19 = "text-sm/semibold";
|
|
|
|
|
let obj5 = navigation(onPressAppCommand[14]);
|
2026-07-20 16:05:17 +00:00
|
|
|
scaledTextLineHeight = obj5.useScaledTextLineHeight("text-sm/semibold");
|
|
|
|
|
const items9 = [loading, commands.length, "" !== first, frecencyItems.length, tmp17.sectionHeader];
|
|
|
|
|
const items10 = [memo1, callback, callback1, sections];
|
2026-07-23 10:11:24 +00:00
|
|
|
const callback2 = stateFromStores.useCallback((arg0) => {
|
2026-07-20 16:05:17 +00:00
|
|
|
if (!loading) {
|
|
|
|
|
if (0 !== commands.length) {
|
2026-07-23 10:11:24 +00:00
|
|
|
if (!closure_7) {
|
2026-07-20 16:05:17 +00:00
|
|
|
if (0 === arg0) {
|
|
|
|
|
if (frecencyItems.length > 0) {
|
|
|
|
|
const intl2 = navigation(onPressAppCommand[15]).intl;
|
|
|
|
|
let stringResult = intl2.string(navigation(onPressAppCommand[15]).t.V0w2ap);
|
|
|
|
|
}
|
2026-07-23 10:11:24 +00:00
|
|
|
const obj = { variant: c19, color: "text-default", style: _undefined.sectionHeader, children: stringResult };
|
2026-07-20 16:05:17 +00:00
|
|
|
return sectionDescriptors(navigation(onPressAppCommand[16]).Text, obj);
|
|
|
|
|
}
|
|
|
|
|
const intl = navigation(onPressAppCommand[15]).intl;
|
|
|
|
|
stringResult = intl.string(navigation(onPressAppCommand[15]).t.PHjkRE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}, items9);
|
|
|
|
|
const items11 = [loading, commands.length, "" !== first, scaledTextLineHeight, tmp17.sectionHeader.paddingTop, tmp17.sectionHeader.paddingBottom];
|
2026-07-23 10:11:24 +00:00
|
|
|
const callback3 = stateFromStores.useCallback((arg0, arg1) => {
|
2026-07-20 16:05:17 +00:00
|
|
|
const navigation = tmp;
|
|
|
|
|
const type = tmp.type;
|
|
|
|
|
if ("placeholder" === type) {
|
|
|
|
|
let obj = { start: tmp2, end: tmp3 };
|
|
|
|
|
return sectionDescriptors(navigation(onPressAppCommand[17]).ContextMenuCommandLoadingItem, obj, "placeholder");
|
|
|
|
|
} else if ("no_commands" === type) {
|
|
|
|
|
obj = { start: tmp2, end: tmp3 };
|
|
|
|
|
return sectionDescriptors(navigation(onPressAppCommand[17]).ContextMenuCommandEmptyItem, obj, "no_commands");
|
|
|
|
|
} else if ("command" === type) {
|
|
|
|
|
const obj1 = {
|
|
|
|
|
item: tmp.command,
|
|
|
|
|
onPress() {
|
2026-07-23 10:11:24 +00:00
|
|
|
return outer1_13(tmp.command);
|
2026-07-20 16:05:17 +00:00
|
|
|
},
|
|
|
|
|
section: sections[tmp.command.applicationId],
|
|
|
|
|
start: tmp2,
|
|
|
|
|
end: tmp3
|
|
|
|
|
};
|
|
|
|
|
return sectionDescriptors(channel(onPressAppCommand[17]), obj1, tmp.command.id);
|
|
|
|
|
} else if ("app" === type) {
|
|
|
|
|
obj = {
|
|
|
|
|
section: tmp.section,
|
|
|
|
|
onPress() {
|
2026-07-23 10:11:24 +00:00
|
|
|
return outer1_14(tmp.section);
|
2026-07-20 16:05:17 +00:00
|
|
|
},
|
|
|
|
|
start: tmp2,
|
|
|
|
|
end: tmp3
|
|
|
|
|
};
|
|
|
|
|
return sectionDescriptors(navigation(onPressAppCommand[17]).ContextMenuCommandAppItem, obj, tmp.section.id);
|
|
|
|
|
}
|
|
|
|
|
}, items10);
|
|
|
|
|
const obj2 = { style: tmp17.container };
|
|
|
|
|
let tmp26Result = tmp4;
|
2026-07-23 10:11:24 +00:00
|
|
|
const memo3 = stateFromStores.useMemo(() => {
|
2026-07-20 16:05:17 +00:00
|
|
|
let num = 0;
|
|
|
|
|
if (!loading) {
|
|
|
|
|
num = 0;
|
|
|
|
|
if (0 !== commands.length) {
|
|
|
|
|
num = 0;
|
2026-07-23 10:11:24 +00:00
|
|
|
if (!closure_7) {
|
|
|
|
|
num = scaledTextLineHeight + _undefined.sectionHeader.paddingTop + _undefined.sectionHeader.paddingBottom;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return num;
|
|
|
|
|
}, items11);
|
|
|
|
|
if ("" === first) {
|
|
|
|
|
tmp26Result = !loading && commands.length > 0;
|
|
|
|
|
const tmp25 = !loading && commands.length > 0;
|
|
|
|
|
}
|
|
|
|
|
if (tmp26Result) {
|
|
|
|
|
const obj3 = {};
|
|
|
|
|
const obj4 = {};
|
|
|
|
|
let num2 = 0;
|
|
|
|
|
if (tmp4) {
|
2026-07-23 10:11:24 +00:00
|
|
|
num2 = channel(onPressAppCommand[7]).space.PX_16;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
obj4.marginBottom = num2;
|
|
|
|
|
obj3.style = obj4;
|
|
|
|
|
obj5 = { size: "md", onChange: tmp2[1] };
|
2026-07-23 10:11:24 +00:00
|
|
|
let intl = navigation(onPressAppCommand[15]).intl;
|
|
|
|
|
obj5.placeholder = intl.string(navigation(onPressAppCommand[15]).t.m1UwbP);
|
|
|
|
|
obj3.children = sectionDescriptors(navigation(onPressAppCommand[18]).SearchField, obj5);
|
2026-07-20 16:05:17 +00:00
|
|
|
tmp26Result = sectionDescriptors(closure_6, obj3);
|
|
|
|
|
const tmp26 = sectionDescriptors;
|
|
|
|
|
const tmp27 = closure_6;
|
|
|
|
|
}
|
|
|
|
|
const items12 = [tmp26Result, ];
|
2026-07-23 10:11:24 +00:00
|
|
|
const tmp15 = channel(onPressAppCommand[13])();
|
2026-07-20 16:05:17 +00:00
|
|
|
const tmp22 = loading;
|
|
|
|
|
const tmp23 = closure_6;
|
2026-07-23 10:11:24 +00:00
|
|
|
items12[1] = sectionDescriptors(channel(onPressAppCommand[19]), { sections: memo2, estimatedListSize: "windowSize", itemSize: channel(onPressAppCommand[13])(), insetEnd: channel(onPressAppCommand[12])({ includeKeyboardHeight: true }).insets.bottom, renderItem: callback3, renderSectionHeader: callback2, sectionHeaderSize: memo3 });
|
2026-07-20 16:05:17 +00:00
|
|
|
obj2.children = items12;
|
|
|
|
|
return tmp22(tmp23, obj2);
|
|
|
|
|
};
|