decord/source/modules/autocompleter/native/AutocompleteWrapper.tsx

1141 lines
45 KiB
TypeScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 11484
// Function ID: 11485
// Name: getStickersItemLayout
// Dependencies: [32, 19, 17, 6091, 5048, 4865, 5092, 676, 4623, 9579, 4624, 9660, 1877, 21, 4189, 500, 712, 11485, 1474, 5215, 5140, 589, 3893, 9911, 11488, 3862, 5219, 9659, 9661, 11489, 9337, 5702, 1906, 9578, 11169, 1579, 4384, 11490, 1348, 4586, 11491, 6191, 11391, 1297, 4050, 11492, 5704, 11499, 4185, 1236, 7641, 11500, 11501, 2]
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
// Module 11484 (getStickersItemLayout)
import PermissionOverwriteType from "PermissionOverwriteType";
import importAllResult from "useSafeAreaInsetsKeyboardAware";
import get_ActivityIndicator from "AutocompleteLabel";
import handleInit from "handleInit";
import getEmojiToGroupId from "getEmojiToGroupId";
import _handleConnectionOpen from "_handleConnectionOpen";
import loadSavedGuildStickers from "loadSavedGuildStickers";
2026-07-23 10:11:24 +00:00
import ME from "ME";
import { BOOLEAN_CHOICES } from "TRUE_OPTION_NAME";
import AUTOCOMPLETE_ROW_HEIGHT from "AUTOCOMPLETE_ROW_HEIGHT";
2026-07-24 07:16:23 +00:00
import regExp from "regExp";
2026-07-23 10:11:24 +00:00
import { AutocompleteTypes } from "AutocompleteTypes";
import { EmojiInteractionPoint } from "set";
2026-07-29 08:29:29 +00:00
import jsxProd from "initialize";
import createCacheKey from "createCacheKey";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let StyleSheet;
let c5;
2026-07-23 10:11:24 +00:00
let closure_12;
let closure_14;
let closure_16;
let closure_17;
let closure_18;
let closure_19;
let closure_20;
2026-07-24 07:16:23 +00:00
let closure_21;
2026-07-23 10:11:24 +00:00
let closure_24;
let closure_25;
2026-07-24 07:16:23 +00:00
let closure_26;
2026-07-23 10:11:24 +00:00
let closure_6;
2026-07-29 08:29:29 +00:00
let map1;
let unpackModuleId;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
function getStickersItemLayout(arg0, arg1) {
const obj = { length: require(11485) /* AutocompleteLabel */.AUTOCOMPLETE_STICKER_NODE_SIZE, offset: null, index: null };
const result = arg1 * (require(11485) /* AutocompleteLabel */.AUTOCOMPLETE_STICKER_NODE_SIZE + require(11485) /* AutocompleteLabel */.AUTOCOMPLETE_STICKER_NODE_MARGIN);
const diff = arg1 - 1;
obj[1] = result + diff * require(11485) /* AutocompleteLabel */.AUTOCOMPLETE_STICKER_NODE_MARGIN;
obj[2] = arg1;
2026-07-20 16:05:17 +00:00
return obj;
}
2026-07-29 08:29:29 +00:00
let c4 = importAllResult;
({ View: c5, FlatList: closure_6, StyleSheet } = get_ActivityIndicator);
({ AutoCompleteResultTypes: unpackModuleId, WHITESPACE_RE: closure_12, AnalyticEvents: map1, UpsellTypes: closure_14 } = ME);
2026-07-23 10:11:24 +00:00
({ AUTOCOMPLETE_EMOJI_ROW_HEIGHT: closure_16, AUTOCOMPLETE_ROW_HEIGHT: closure_17 } = AUTOCOMPLETE_ROW_HEIGHT);
2026-07-24 07:16:23 +00:00
({ MENTION_SENTINEL: closure_18, CHANNEL_SENTINEL: closure_19, EMOJI_SENTINEL: closure_20, GAME_MENTION_INPUT_PREFIX: closure_21 } = regExp);
({ jsx: closure_24, Fragment: closure_25, jsxs: closure_26 } = jsxProd);
2026-07-29 08:29:29 +00:00
let c27 = "text-sm/semibold";
const hairlineWidth = StyleSheet.hairlineWidth;
let closure_29 = createCacheKey.createStyles((borderRadius, borderWidth, borderTopWidth, marginHorizontal, marginBottom) => {
let obj = { autocompletePositionRelative: { position: "relative" }, autocompleteWrapper: null, autocompleteWrapperAbsolute: null, autocompleteContainer: null, autocomplete: null, sectionDivider: null, sectionTitle: null, stickersAutocompleteList: null, newTag: null };
let obj1 = require(500) /* set */;
2026-07-20 16:05:17 +00:00
let str = "absolute";
2026-07-29 08:29:29 +00:00
if (obj1.isAndroid()) {
2026-07-20 16:05:17 +00:00
str = "relative";
}
2026-07-29 08:29:29 +00:00
obj[1] = { position: str, marginHorizontal, marginBottom };
obj[2] = { left: 0, right: 0, bottom: 0 };
obj = { backgroundColor: importDefault(712).colors.MOBILE_FLOATING_ACCESSORY_BACKGROUND, borderRadius, borderWidth, borderTopWidth, borderColor: importDefault(712).colors.MOBILE_FLOATING_ACCESSORY_BORDER, overflow: "hidden" };
obj[3] = obj;
obj = { flexGrow: 0, flexShrink: 1, backgroundColor: importDefault(712).colors.MOBILE_FLOATING_ACCESSORY_BACKGROUND };
obj[4] = obj;
obj1 = { backgroundColor: importDefault(712).colors.MOBILE_FLOATING_ACCESSORY_BORDER, marginLeft: -16 };
obj[5] = obj1;
obj[6] = { backgroundColor: importDefault(712).colors.MOBILE_FLOATING_ACCESSORY_BACKGROUND, paddingLeft: 12, marginVertical: 12, justifyContent: "center" };
const obj2 = { backgroundColor: importDefault(712).colors.MOBILE_FLOATING_ACCESSORY_BACKGROUND, paddingLeft: 12, marginVertical: 12, justifyContent: "center" };
obj[7] = { paddingLeft: 12 - require(11485) /* AutocompleteLabel */.AUTOCOMPLETE_STICKER_NODE_MARGIN, marginBottom: 12, height: require(11485) /* AutocompleteLabel */.AUTOCOMPLETE_STICKER_NODE_SIZE, flexShrink: 0 };
const obj3 = { paddingLeft: 12 - require(11485) /* AutocompleteLabel */.AUTOCOMPLETE_STICKER_NODE_MARGIN, marginBottom: 12, height: require(11485) /* AutocompleteLabel */.AUTOCOMPLETE_STICKER_NODE_SIZE, flexShrink: 0 };
obj[8] = { backgroundColor: importDefault(712).colors.BADGE_BACKGROUND_BRAND };
2026-07-20 16:05:17 +00:00
return obj;
});
2026-07-29 08:29:29 +00:00
let closure_31 = { resultCount: 0, stickerResults: [], nonStickerResults: [], hasStickerResults: false, hasNonStickerResults: false };
const forwardRefResult = importAllResult.forwardRef((analyticsLocations, ref) => {
let c27;
2026-07-20 16:05:17 +00:00
let canOnlyUseTextCommands;
let screenIndex;
2026-07-29 08:29:29 +00:00
let tmp20;
2026-07-20 16:05:17 +00:00
analyticsLocations = analyticsLocations.analyticsLocations;
const channel = analyticsLocations.channel;
2026-07-23 10:11:24 +00:00
let canMentionEveryone = analyticsLocations.canMentionEveryone;
2026-07-20 16:05:17 +00:00
const keyboardType = analyticsLocations.keyboardType;
const onChangeAutoCompleteVisibility = analyticsLocations.onChangeAutoCompleteVisibility;
const commandsDisabled = analyticsLocations.commandsDisabled;
const chatInputRef = analyticsLocations.chatInputRef;
2026-07-29 08:29:29 +00:00
let optionStates;
let activeOption;
let activeCommand;
let token;
let scaledTextLineHeight;
let c12;
let setting;
let resultCount;
let stickerResults;
let nonStickerResults;
let hasStickerResults;
let hasNonStickerResults;
let closure_19;
let context;
let memo;
let focused;
let c23;
let selectionStart;
let selectionEnd;
let closure_26;
c27 = undefined;
let gameMentionsAutocompleteConfig;
2026-07-24 07:16:23 +00:00
let c29;
let anchor;
let beginSearch;
let autocompleteType;
let query;
let queryOptions;
let autocompleteSelectionStart;
let showOptionValuesPicker;
let callback;
let callback1;
let memo2;
let closure_40;
let closure_41;
let diff1;
let memo3;
let first2;
let c45;
let chatInputFloating;
let c47;
let token5;
let c49;
2026-07-20 16:05:17 +00:00
let isScreenReaderEnabled;
let callback2;
let callback4;
let first3;
2026-07-24 07:16:23 +00:00
let closure_54;
2026-07-20 16:05:17 +00:00
({ canOnlyUseTextCommands, screenIndex } = analyticsLocations);
2026-07-23 10:11:24 +00:00
let obj = analyticsLocations(canMentionEveryone[21]);
let items = [optionStates];
2026-07-29 08:29:29 +00:00
const stateFromStoresObject = obj.useStateFromStoresObject(items, () => ({ optionStates: optionStates.getOptionStates(channel.id), activeOption: optionStates.getActiveOption(channel.id), activeCommand: optionStates.getActiveCommand(channel.id), activeSection: optionStates.getActiveCommandSection(channel.id) }));
2026-07-23 10:11:24 +00:00
optionStates = stateFromStoresObject.optionStates;
2026-07-29 08:29:29 +00:00
activeOption = stateFromStoresObject.activeOption;
activeCommand = stateFromStoresObject.activeCommand;
2026-07-23 10:11:24 +00:00
let obj1 = analyticsLocations(canMentionEveryone[22]);
2026-07-29 08:29:29 +00:00
token = obj1.useToken(channel(canMentionEveryone[16]).modules.mobile.TABLE_ROW_HEIGHT);
2026-07-23 10:11:24 +00:00
let obj2 = analyticsLocations(canMentionEveryone[23]);
2026-07-29 08:29:29 +00:00
scaledTextLineHeight = obj2.useScaledTextLineHeight(c27);
let tmp8 = channel(canMentionEveryone[24])();
c12 = tmp8;
2026-07-24 07:16:23 +00:00
const IncludeStickersInAutocomplete = analyticsLocations(canMentionEveryone[25]).IncludeStickersInAutocomplete;
2026-07-29 08:29:29 +00:00
setting = IncludeStickersInAutocomplete.getSetting();
let obj3 = onChangeAutoCompleteVisibility;
let tmp11 = keyboardType(onChangeAutoCompleteVisibility.useState(beginSearch), 2);
const first = tmp11[0];
resultCount = first.resultCount;
stickerResults = first.stickerResults;
nonStickerResults = first.nonStickerResults;
hasStickerResults = first.hasStickerResults;
hasNonStickerResults = first.hasNonStickerResults;
closure_19 = tmp11[1];
2026-07-23 10:11:24 +00:00
let obj4 = analyticsLocations(canMentionEveryone[21]);
2026-07-29 08:29:29 +00:00
let items1 = [activeOption];
const stateFromStores = obj4.useStateFromStores(items1, () => activeOption.loadState);
let obj5 = analyticsLocations(canMentionEveryone[21]);
2026-07-23 10:11:24 +00:00
const items2 = [token];
2026-07-29 08:29:29 +00:00
const stateFromStores1 = obj5.useStateFromStores(items2, () => token.loadState);
context = onChangeAutoCompleteVisibility.useContext(analyticsLocations(canMentionEveryone[26]).RedesignCompatContext);
2026-07-20 16:05:17 +00:00
const items3 = [channel, setting];
2026-07-29 08:29:29 +00:00
memo = onChangeAutoCompleteVisibility.useMemo(() => analyticsLocations(canMentionEveryone[27]).getAutocompleteOptions(channel, true, setting), items3);
let tmp17 = keyboardType(onChangeAutoCompleteVisibility.useState({ focused: false, text: "", selectionStart: 0, selectionEnd: 0 }), 2);
const first1 = tmp17[0];
focused = first1.focused;
2026-07-23 10:11:24 +00:00
let text = first1.text;
2026-07-29 08:29:29 +00:00
c23 = text;
selectionStart = first1.selectionStart;
selectionEnd = first1.selectionEnd;
closure_26 = tmp17[1];
[tmp20, c27] = keyboardType(onChangeAutoCompleteVisibility.useState(0), 2);
let obj6 = analyticsLocations(canMentionEveryone[28]);
gameMentionsAutocompleteConfig = obj6.getGameMentionsAutocompleteConfig("AutocompleteWrapper game search");
c29 = tmp22;
const tmp23 = channel(canMentionEveryone[29])(text, selectionEnd, chatInputRef, gameMentionsAutocompleteConfig.enabled && !gameMentionsAutocompleteConfig.combineMentionAutocomplete, memo);
anchor = tmp23.anchor;
beginSearch = tmp23.beginSearch;
const effect = obj3.useEffect(() => {
2026-07-23 10:11:24 +00:00
let c0 = false;
let result = activeCommand.addConditionalChangeListener(() => {
2026-07-29 08:29:29 +00:00
let tmp = !callback;
if (!callback) {
2026-07-20 16:05:17 +00:00
let flag;
2026-07-29 08:29:29 +00:00
if (outer1_9.isConnected()) {
const result = callback(outer1_2[30]).initiateEmojiInteraction(outer1_23.AutocompleteWrapperShown);
2026-07-20 16:05:17 +00:00
flag = false;
2026-07-29 08:29:29 +00:00
const obj = callback(outer1_2[30]);
2026-07-20 16:05:17 +00:00
}
tmp = flag;
}
return tmp;
});
return () => {
2026-07-23 10:11:24 +00:00
let c0 = true;
2026-07-20 16:05:17 +00:00
};
}, []);
2026-07-29 08:29:29 +00:00
const imperativeHandle = obj3.useImperativeHandle(ref, obj3.useMemo(() => {
2026-07-23 10:11:24 +00:00
let c0 = -1;
2026-07-20 16:05:17 +00:00
return () => ({
2026-07-24 07:16:23 +00:00
setChatInputHeight: outer1_27,
2026-07-29 08:29:29 +00:00
setData(arg0) {
2026-07-23 10:11:24 +00:00
let closure_0;
let closure_1;
let closure_2;
2026-07-29 08:29:29 +00:00
let PermissionOverwriteType;
({ focused: closure_0, text: closure_1, selectionStart: closure_2, selectionEnd: PermissionOverwriteType } = arg0);
if (-1 !== timeout) {
2026-07-20 16:05:17 +00:00
const _clearTimeout = clearTimeout;
2026-07-29 08:29:29 +00:00
clearTimeout(timeout);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
timeout = setTimeout(() => {
outer1_26(() => { ... });
2026-07-20 16:05:17 +00:00
}, 16);
}
});
}, []));
2026-07-24 07:16:23 +00:00
const items4 = [selectionStart, selectionEnd, text, activeCommand, optionStates, activeOption, canMentionEveryone, commandsDisabled, memo, stateFromStores, stateFromStores1, gameMentionsAutocompleteConfig.enabled && !gameMentionsAutocompleteConfig.combineMentionAutocomplete, anchor];
2026-07-29 08:29:29 +00:00
const memo1 = obj3.useMemo(() => {
2026-07-20 16:05:17 +00:00
let canMentionEveryone = selectionStart;
2026-07-29 08:29:29 +00:00
if (null != c23) {
if (0 !== str.trim().length) {
2026-07-20 16:05:17 +00:00
if (null != activeOption) {
2026-07-24 07:16:23 +00:00
let obj1 = analyticsLocations(canMentionEveryone[31]);
2026-07-29 08:29:29 +00:00
let applicationCommandOptionQueryOptions = obj1.getApplicationCommandOptionQueryOptions(tmp69);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
applicationCommandOptionQueryOptions = { canMentionEveryone: null, canMentionHere: null, canMentionChannels: true, canMentionUsers: true, canMentionRoles: true, canMentionAnyGuildUser: false, canMentionNonMentionableRoles: false, canMentionOtherGlobals: true, canMentionGames: true };
applicationCommandOptionQueryOptions[0] = canMentionEveryone;
applicationCommandOptionQueryOptions[1] = canMentionEveryone;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp5;
2026-07-20 16:05:17 +00:00
if (null != activeOption) {
2026-07-29 08:29:29 +00:00
tmp5 = optionStates[tmp69.name];
2026-07-20 16:05:17 +00:00
}
if (null != activeCommand) {
2026-07-29 08:29:29 +00:00
if (null != tmp69) {
if (null != tmp5) {
let num = tmp5.location;
if (num == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let num2 = tmp5.length;
if (num2 == null) {
num2 = 0;
2026-07-20 16:05:17 +00:00
}
let substr;
2026-07-29 08:29:29 +00:00
if (tmp >= num + num2) {
substr = str.substring(num + num2, tmp);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let query = substr;
2026-07-29 08:29:29 +00:00
if (null == tmp69.choices) {
if (!tmp69.autocomplete) {
const type = tmp69.type;
2026-07-24 07:16:23 +00:00
if (analyticsLocations(canMentionEveryone[32]).ApplicationCommandOptionType.BOOLEAN === type) {
2026-07-23 10:11:24 +00:00
let prefix = "";
2026-07-21 22:01:30 +00:00
let CHOICES = focused.CHOICES;
2026-07-24 07:16:23 +00:00
let choices = stickerResults;
2026-07-20 16:05:17 +00:00
let flag = true;
2026-07-29 08:29:29 +00:00
let str2 = "";
2026-07-24 07:16:23 +00:00
} else if (analyticsLocations(canMentionEveryone[32]).ApplicationCommandOptionType.CHANNEL === type) {
prefix = closure_19;
2026-07-21 22:01:30 +00:00
CHOICES = focused.CHANNELS;
2026-07-29 08:29:29 +00:00
const channelTypes = tmp69.channelTypes;
2026-07-20 16:05:17 +00:00
flag = true;
2026-07-29 08:29:29 +00:00
str2 = closure_19;
2026-07-20 16:05:17 +00:00
} else {
2026-07-24 07:16:23 +00:00
if (analyticsLocations(canMentionEveryone[32]).ApplicationCommandOptionType.ROLE !== type) {
if (analyticsLocations(canMentionEveryone[32]).ApplicationCommandOptionType.USER !== type) {
2026-07-20 16:05:17 +00:00
flag = false;
}
}
2026-07-24 07:16:23 +00:00
prefix = hasNonStickerResults;
2026-07-21 22:01:30 +00:00
CHOICES = focused.MENTIONS;
2026-07-20 16:05:17 +00:00
flag = true;
2026-07-29 08:29:29 +00:00
str2 = hasNonStickerResults;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
let tmp8 = substr;
let tmp9 = CHOICES;
2026-07-20 16:05:17 +00:00
if (flag) {
2026-07-29 08:29:29 +00:00
let startsWithResult = null != str2;
2026-07-20 16:05:17 +00:00
if (startsWithResult) {
2026-07-29 08:29:29 +00:00
startsWithResult = "" !== str2;
2026-07-20 16:05:17 +00:00
}
if (startsWithResult) {
startsWithResult = null != substr;
}
if (startsWithResult) {
2026-07-29 08:29:29 +00:00
startsWithResult = substr.startsWith(str2);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp62 = substr;
2026-07-20 16:05:17 +00:00
if (startsWithResult) {
2026-07-29 08:29:29 +00:00
let str8 = "";
if (substr.length > str2.length) {
str8 = substr.substring(str2.length);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
query = str8;
tmp62 = str8;
2026-07-20 16:05:17 +00:00
}
let obj = {};
const _Object2 = Object;
const entries = Object.entries(optionStates);
const item = entries.forEach((arg0) => {
let tmp;
let tmp2;
[tmp, tmp2] = arg0;
if (null != tmp2.optionValue) {
obj[tmp] = tmp2.optionValue;
}
});
2026-07-29 08:29:29 +00:00
obj = { query: null, autocompleteType: null, autocompleteSelectionStart: null, queryOptions: null, showOptionValuesPicker: null };
obj[0] = tmp62;
obj[1] = CHOICES;
obj[2] = num + num2;
obj1 = { activeCommand: null, optionValues: null, isActiveApplicationCommand: null, option: null, choices: null, channelTypes: null };
obj1[0] = tmp7;
obj1[1] = obj;
obj1[2] = flag;
obj1[3] = tmp69;
obj1[4] = choices;
obj1[5] = channelTypes;
2026-07-20 16:05:17 +00:00
const merged = Object.assign(applicationCommandOptionQueryOptions);
2026-07-29 08:29:29 +00:00
obj[3] = obj1;
obj[4] = flag;
2026-07-20 16:05:17 +00:00
return obj;
}
}
2026-07-23 10:11:24 +00:00
prefix = "";
2026-07-21 22:01:30 +00:00
CHOICES = focused.CHOICES;
2026-07-29 08:29:29 +00:00
choices = tmp69.choices;
2026-07-20 16:05:17 +00:00
flag = true;
2026-07-29 08:29:29 +00:00
str2 = "";
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-24 07:16:23 +00:00
if (c29) {
if (null != anchor) {
2026-07-29 08:29:29 +00:00
let obj2 = { query: null, autocompleteType: null, autocompleteSelectionStart: null, queryOptions: null };
obj2[0] = str.slice(tmp24 + memo.length, selectionEnd).toLowerCase();
obj2[1] = focused.GAME_MENTIONS;
obj2[2] = tmp24;
2026-07-24 07:16:23 +00:00
let obj3 = {};
const merged1 = Object.assign(applicationCommandOptionQueryOptions);
2026-07-29 08:29:29 +00:00
obj2[3] = obj3;
2026-07-24 07:16:23 +00:00
return obj2;
}
}
2026-07-20 16:05:17 +00:00
let sum = null;
2026-07-29 08:29:29 +00:00
if (null != tmp5) {
let num3 = tmp5.location;
if (num3 == null) {
num3 = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let num4 = tmp5.length;
if (num4 == null) {
num4 = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
sum = num3 + num4;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp28 = tmp;
2026-07-20 16:05:17 +00:00
while (true) {
2026-07-29 08:29:29 +00:00
let tmp29 = analyticsLocations;
let tmp30 = canMentionEveryone;
2026-07-24 07:16:23 +00:00
obj2 = analyticsLocations(canMentionEveryone[33]);
2026-07-29 08:29:29 +00:00
let arr = c23;
let tmp32 = tmp28;
let tmp33 = tmp8;
let tmp34 = tmp9;
let num5 = sum;
let result = obj2.isWhitespaceSeparatingBoundary(c23, tmp28);
if (tmp27) {
num5 = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp28 === num5) {
let tmp36 = selectionEnd;
let substr1 = arr.slice(tmp28, selectionEnd);
let tmp38 = analyticsLocations;
let tmp39 = canMentionEveryone;
2026-07-24 07:16:23 +00:00
obj3 = analyticsLocations(canMentionEveryone[33]);
prefix = obj3.getPrefix(substr1);
2026-07-29 08:29:29 +00:00
let tmp40 = analyticsLocations;
let tmp41 = canMentionEveryone;
2026-07-24 07:16:23 +00:00
let obj4 = analyticsLocations(canMentionEveryone[33]);
query = obj4.getQuery(substr1);
2026-07-20 16:05:17 +00:00
if (null == query) {
let _Object = Object;
2026-07-29 08:29:29 +00:00
let tmp46 = memo;
2026-07-20 16:05:17 +00:00
let keys = Object.keys(memo);
let found = keys.find((arg0) => {
2026-07-29 08:29:29 +00:00
let tmp = arg0 !== focused.SLASHES && arg0 !== focused.SLASHES_DISCOVERY;
2026-07-20 16:05:17 +00:00
if (!tmp) {
2026-07-29 08:29:29 +00:00
let tmp4 = null == outer1_9;
if (tmp4) {
tmp4 = !outer1_5;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp = tmp4;
2026-07-20 16:05:17 +00:00
}
if (tmp) {
2026-07-29 08:29:29 +00:00
let matchesResult = undefined !== closure_0;
2026-07-20 16:05:17 +00:00
if (matchesResult) {
2026-07-23 10:11:24 +00:00
matchesResult = undefined !== query;
2026-07-20 16:05:17 +00:00
}
if (matchesResult) {
2026-07-29 08:29:29 +00:00
matchesResult = obj.matches(tmp6, query, closure_2);
2026-07-20 16:05:17 +00:00
}
tmp = matchesResult;
2026-07-29 08:29:29 +00:00
tmp6 = closure_0;
2026-07-20 16:05:17 +00:00
}
return tmp;
});
2026-07-29 08:29:29 +00:00
tmp33 = query;
let tmp44 = tmp28;
let tmp45 = query;
tmp34 = found;
2026-07-20 16:05:17 +00:00
if (null != found) {
break;
}
} else {
2026-07-29 08:29:29 +00:00
let tmp43 = _undefined;
tmp44 = tmp28;
tmp45 = query;
if (_undefined.test(query)) {
2026-07-20 16:05:17 +00:00
break;
}
}
2026-07-29 08:29:29 +00:00
let tmp48 = focused;
let tmp49 = tmp45;
if (tmp34 === focused.SLASHES) {
let tmp50 = analyticsLocations;
let tmp51 = canMentionEveryone;
2026-07-24 07:16:23 +00:00
let obj5 = analyticsLocations(canMentionEveryone[34]);
2026-07-29 08:29:29 +00:00
let str5 = tmp45;
if (tmp45 == null) {
str5 = "";
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let text = obj5.getTextBeforeFirstOption(str5).text;
2026-07-23 10:11:24 +00:00
query = text;
2026-07-29 08:29:29 +00:00
tmp49 = text;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj4 = { query: null, autocompleteType: null, autocompleteSelectionStart: null, queryOptions: null };
obj4[0] = tmp49;
obj4[1] = tmp34;
obj4[2] = tmp44;
2026-07-24 07:16:23 +00:00
obj5 = {};
2026-07-29 08:29:29 +00:00
let tmp52 = obj5;
let tmp53 = applicationCommandOptionQueryOptions;
2026-07-24 07:16:23 +00:00
let merged2 = Object.assign(applicationCommandOptionQueryOptions);
2026-07-29 08:29:29 +00:00
obj4[3] = obj5;
2026-07-24 07:16:23 +00:00
return obj4;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
found = tmp34;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let diff = tmp28 - 1;
2026-07-20 16:05:17 +00:00
canMentionEveryone = diff;
2026-07-29 08:29:29 +00:00
let num6 = sum;
if (tmp27) {
num6 = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp28 = diff;
tmp8 = tmp33;
tmp9 = found;
tmp45 = tmp33;
tmp34 = found;
tmp44 = diff;
if (diff < num6) {
2026-07-20 16:05:17 +00:00
break;
}
}
}
}
2026-07-23 10:11:24 +00:00
return { query: null, autocompleteType: null, autocompleteSelectionStart: null };
2026-07-20 16:05:17 +00:00
}, items4);
2026-07-24 07:16:23 +00:00
autocompleteType = memo1.autocompleteType;
2026-07-23 10:11:24 +00:00
query = memo1.query;
2026-07-24 07:16:23 +00:00
queryOptions = memo1.queryOptions;
autocompleteSelectionStart = memo1.autocompleteSelectionStart;
showOptionValuesPicker = memo1.showOptionValuesPicker;
2026-07-20 16:05:17 +00:00
const items5 = [autocompleteType, query, queryOptions, memo];
2026-07-29 08:29:29 +00:00
callback = obj3.useCallback((arg0) => {
2026-07-20 16:05:17 +00:00
if (null != autocompleteType) {
if (null != query) {
2026-07-29 08:29:29 +00:00
let obj = memo[tmp];
const queryResultsResult = obj.queryResults(tmp2, queryOptions, arg0);
2026-07-20 16:05:17 +00:00
const items = [];
const items1 = [];
const item = queryResultsResult.forEach((type) => {
2026-07-29 08:29:29 +00:00
if (type.type === outer1_11.STICKER) {
2026-07-20 16:05:17 +00:00
items.push(type);
} else {
items1.push(type);
}
});
2026-07-29 08:29:29 +00:00
obj = { resultCount: null, stickerResults: null, nonStickerResults: null, hasStickerResults: null, hasNonStickerResults: null };
obj[0] = queryResultsResult.length;
obj[1] = items;
obj[2] = items1;
obj[3] = items.length > 0;
obj[4] = items1.length > 0;
2026-07-20 16:05:17 +00:00
callback(obj);
}
}
2026-07-29 08:29:29 +00:00
callback(beginSearch);
2026-07-20 16:05:17 +00:00
}, items5);
const items6 = [autocompleteType, callback, memo];
2026-07-29 08:29:29 +00:00
const effect1 = obj3.useEffect(() => {
let tmp2 = null;
2026-07-20 16:05:17 +00:00
if (null != autocompleteType) {
let stores;
2026-07-29 08:29:29 +00:00
if (memo != null) {
stores = memo[tmp].stores;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp2 = stores;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (null != tmp2) {
const batchedStoreListener = new analyticsLocations(canMentionEveryone[21]).BatchedStoreListener(tmp2, () => callback(false));
2026-07-20 16:05:17 +00:00
batchedStoreListener.attach("AutocompleteWrapper");
return () => batchedStoreListener.detach();
}
}, items6);
const items7 = [callback];
2026-07-29 08:29:29 +00:00
const effect2 = obj3.useEffect(() => {
2026-07-20 16:05:17 +00:00
callback(true);
}, items7);
2026-07-23 10:11:24 +00:00
const items8 = [stickerResults, nonStickerResults];
2026-07-29 08:29:29 +00:00
callback1 = obj3.useCallback(() => ({ numStickerResults: stickerResults.length, numEmojiResults: nonStickerResults.filter((type) => type.type === constants.EMOJI).length }), items8);
2026-07-20 16:05:17 +00:00
const items9 = [autocompleteType, focused, keyboardType, resultCount];
2026-07-29 08:29:29 +00:00
memo2 = obj3.useMemo(() => {
2026-07-24 07:16:23 +00:00
let tmp = resultCount > 0;
2026-07-20 16:05:17 +00:00
if (!tmp) {
2026-07-29 08:29:29 +00:00
tmp = autocompleteType === focused.SLASHES || tmp2 === focused.SLASHES_DISCOVERY;
const tmp3 = autocompleteType === focused.SLASHES || tmp2 === focused.SLASHES_DISCOVERY;
2026-07-20 16:05:17 +00:00
}
if (!tmp) {
2026-07-24 07:16:23 +00:00
tmp = autocompleteType === focused.GAME_MENTIONS;
}
let tmp7 = focused;
if (focused) {
tmp7 = tmp;
2026-07-20 16:05:17 +00:00
}
2026-07-24 07:16:23 +00:00
if (tmp7) {
2026-07-29 08:29:29 +00:00
tmp7 = keyboardType === analyticsLocations(canMentionEveryone[35]).KeyboardTypes.SYSTEM;
2026-07-24 07:16:23 +00:00
}
return tmp7;
2026-07-20 16:05:17 +00:00
}, items9);
2026-07-29 08:29:29 +00:00
closure_40 = obj3.useRef(false);
2026-07-20 16:05:17 +00:00
const items10 = [autocompleteType, activeCommand];
2026-07-29 08:29:29 +00:00
const effect3 = obj3.useEffect(() => {
let tmp4 = autocompleteType === focused.SLASHES;
2026-07-20 16:05:17 +00:00
if (ref.current) {
2026-07-29 08:29:29 +00:00
if (!tmp4) {
tmp4 = tmp2 === tmp3.SLASHES_DISCOVERY;
}
if (!tmp4) {
tmp4 = null != activeCommand;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp.current = tmp4;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
let tmp5 = tmp4;
if (!tmp4) {
tmp5 = tmp2 === tmp3.SLASHES_DISCOVERY;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp5) {
tmp5 = null != activeCommand;
}
tmp.current = tmp5;
if (tmp.current) {
analyticsLocations(canMentionEveryone[36]).trackWithMetadata(setting.APPLICATION_COMMAND_TOP_OF_FUNNEL, { location: "slash_ui" });
const obj = analyticsLocations(canMentionEveryone[36]);
2026-07-20 16:05:17 +00:00
}
}
}, items10);
2026-07-29 08:29:29 +00:00
closure_41 = obj3.useRef(null);
2026-07-24 07:16:23 +00:00
const items11 = [onChangeAutoCompleteVisibility, activeCommand, memo2, autocompleteType, channel, callback1, gameMentionsAutocompleteConfig.enabled];
2026-07-29 08:29:29 +00:00
const effect4 = obj3.useEffect(() => {
2026-07-20 16:05:17 +00:00
let tmp = memo2;
if (!memo2) {
tmp = null != activeCommand;
}
2026-07-29 08:29:29 +00:00
if (onChangeAutoCompleteVisibility != null) {
tmp4(tmp);
2026-07-20 16:05:17 +00:00
}
if (tmp) {
2026-07-29 08:29:29 +00:00
let str = autocompleteType;
if (autocompleteType == null) {
str = "";
2026-07-24 07:16:23 +00:00
}
const _HermesInternal = HermesInternal;
2026-07-29 08:29:29 +00:00
const combined = "" + channel.id + ":" + str;
2026-07-24 07:16:23 +00:00
if (ref2.current !== combined) {
ref2.current = combined;
let obj = analyticsLocations(canMentionEveryone[37]);
obj = {};
const merged = Object.assign(callback1());
2026-07-29 08:29:29 +00:00
let enabled;
if (tmp8 === focused.MENTIONS) {
2026-07-24 07:16:23 +00:00
enabled = gameMentionsAutocompleteConfig.enabled;
}
2026-07-29 08:29:29 +00:00
obj.gameMentionsAvailable = enabled;
const result = obj.iOSTrackAutocompleteOpen(tmp8, tmp7, obj);
2026-07-24 07:16:23 +00:00
}
2026-07-29 08:29:29 +00:00
tmp7 = channel;
2026-07-24 07:16:23 +00:00
} else {
ref2.current = null;
2026-07-20 16:05:17 +00:00
}
}, items11);
2026-07-29 08:29:29 +00:00
const tmp19 = keyboardType(onChangeAutoCompleteVisibility.useState(0), 2);
const insets = tmp4(tmp2[19])({ includeKeyboardHeight: true }).insets;
2026-07-23 10:11:24 +00:00
let diff = channel(canMentionEveryone[18])({ ignoreKeyboard: true }).height - insets.top - insets.bottom;
2026-07-29 08:29:29 +00:00
diff1 = diff - tmp(tmp2[20]).NAV_BAR_HEIGHT - tmp20;
const items12 = [autocompleteType, stickerResults.length, diff1, scaledTextLineHeight, tmp8];
memo3 = obj3.useMemo(() => {
2026-07-21 22:01:30 +00:00
const sum = scaledTextLineHeight + 24;
const sum1 = 200 + sum;
2026-07-20 16:05:17 +00:00
if (stickerResults.length > 0) {
2026-07-29 08:29:29 +00:00
let sum2 = sum1 + sum + analyticsLocations(canMentionEveryone[17]).AUTOCOMPLETE_STICKER_NODE_SIZE + 12 + gameMentionsAutocompleteConfig;
2026-07-24 07:16:23 +00:00
} else {
sum2 = sum1;
if (autocompleteType !== focused.EMOJIS_AND_STICKERS) {
let num = 200;
2026-07-29 08:29:29 +00:00
if (tmp3 === focused.GAME_MENTIONS) {
num = 200 + c12;
2026-07-24 07:16:23 +00:00
}
sum2 = num;
}
2026-07-20 16:05:17 +00:00
}
2026-07-24 07:16:23 +00:00
return Math.min(diff1, sum2);
2026-07-20 16:05:17 +00:00
}, items12);
2026-07-29 08:29:29 +00:00
let tmp10Result = tmp10(obj3.useState(null), 2);
first2 = tmp10Result[0];
c45 = tmp40;
const items13 = [resultCount, autocompleteType, memo2, hasStickerResults, hasNonStickerResults, nonStickerResults.length, memo3, first2, context, token, scaledTextLineHeight, tmp8];
const memo4 = obj3.useMemo(() => {
2026-07-21 22:01:30 +00:00
if (autocompleteType === focused.EMOJIS_AND_STICKERS) {
2026-07-29 08:29:29 +00:00
let num6 = 0;
if (0 !== nonStickerResults.length) {
if (context) {
num6 = length * token + (length - 1) * gameMentionsAutocompleteConfig;
}
}
let sum = num6;
2026-07-20 16:05:17 +00:00
if (hasNonStickerResults) {
2026-07-29 08:29:29 +00:00
sum = num6 + (scaledTextLineHeight + 24);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp14 = hasStickerResults;
2026-07-21 22:01:30 +00:00
let sum2 = sum;
2026-07-20 16:05:17 +00:00
if (hasStickerResults) {
2026-07-21 22:01:30 +00:00
const sum1 = scaledTextLineHeight + 24;
sum2 = sum + (sum1 + analyticsLocations(canMentionEveryone[17]).AUTOCOMPLETE_STICKER_NODE_SIZE + 12);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp14) {
tmp14 = tmp11;
2026-07-20 16:05:17 +00:00
}
2026-07-21 22:01:30 +00:00
let sum3 = sum2;
2026-07-29 08:29:29 +00:00
if (tmp14) {
sum3 = sum2 + gameMentionsAutocompleteConfig;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let num2 = sum3;
tmp11 = hasNonStickerResults;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
if (tmp3) {
let num5 = first2;
if (first2 == null) {
num5 = 0;
}
num2 = num5;
} else {
num2 = 0;
if (null != tmp) {
let num3 = 0;
if (0 !== resultCount) {
if (context) {
num3 = tmp5 * token + (tmp5 - 1) * gameMentionsAutocompleteConfig;
}
}
num2 = num3;
if (tmp === tmp2.GAME_MENTIONS) {
num2 = num3 + c12;
}
2026-07-24 07:16:23 +00:00
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp3 = tmp === tmp2.SLASHES || tmp === tmp2.SLASHES_DISCOVERY;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let num11 = 0;
2026-07-20 16:05:17 +00:00
if (memo2) {
2026-07-29 08:29:29 +00:00
num11 = num2;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return Math.min(num11, memo3);
2026-07-20 16:05:17 +00:00
}, items13);
2026-07-29 08:29:29 +00:00
let tmpResult = tmp(tmp2[38]);
chatInputFloating = tmpResult.useMobileVisualRefreshConfig({ location: "AutocompleteWrapper" }).chatInputFloating;
c47 = tmp42;
tmpResult = tmp(tmp2[22]);
const token1 = tmpResult.useToken(tmp4(tmp2[16]).modules.mobile.CHAT_INPUT_FLOATING_BORDER_RADIUS);
let tmp34 = channel(canMentionEveryone[18])({ ignoreKeyboard: true });
const token2 = analyticsLocations(canMentionEveryone[22]).useToken(tmp4(tmp2[16]).modules.mobile.CHAT_INPUT_FLOATING_ACCESSORY_BORDER_WIDTH);
const tmpResult1 = analyticsLocations(canMentionEveryone[22]);
const token3 = analyticsLocations(canMentionEveryone[22]).useToken(tmp4(tmp2[16]).modules.mobile.CHAT_INPUT_FLOATING_ACCESSORY_TOP_BORDER_WIDTH);
const tmpResult2 = analyticsLocations(canMentionEveryone[22]);
const token4 = analyticsLocations(canMentionEveryone[22]).useToken(tmp4(tmp2[16]).modules.mobile.CHAT_INPUT_FLOATING_ACCESSORY_MARGIN_HORIZONTAL);
const tmpResult3 = analyticsLocations(canMentionEveryone[22]);
token5 = analyticsLocations(canMentionEveryone[22]).useToken(tmp4(tmp2[16]).modules.mobile.CHAT_INPUT_FLOATING_ACCESSORY_MARGIN_BOTTOM);
2026-07-20 16:05:17 +00:00
let num = 0;
2026-07-23 10:11:24 +00:00
if (memo4 > 0) {
2026-07-20 16:05:17 +00:00
num = token2;
}
let num2 = 0;
2026-07-23 10:11:24 +00:00
if (memo4 > 0) {
2026-07-20 16:05:17 +00:00
num2 = token3;
}
2026-07-23 10:11:24 +00:00
if (memo4 > 0) {
2026-07-20 16:05:17 +00:00
let num3 = token5;
} else {
num3 = 0;
if (null != activeCommand) {
num3 = 0;
}
}
2026-07-29 08:29:29 +00:00
const tmp48Result = c29(token1, num, num2, token4, num3);
c49 = tmp48Result;
let tmp48 = c29;
const tmpResult4 = analyticsLocations(canMentionEveryone[22]);
isScreenReaderEnabled = analyticsLocations(canMentionEveryone[39]).useIsScreenReaderEnabled();
const tmpResult5 = analyticsLocations(canMentionEveryone[39]);
let isAndroidResult = analyticsLocations(canMentionEveryone[15]).isAndroid();
2026-07-20 16:05:17 +00:00
if (!isAndroidResult) {
2026-07-29 08:29:29 +00:00
let isIOSResult = tmp(tmp2[15]).isIOS();
2026-07-20 16:05:17 +00:00
if (isIOSResult) {
2026-07-29 08:29:29 +00:00
let tmp53 = isScreenReaderEnabled;
2026-07-20 16:05:17 +00:00
if (!isScreenReaderEnabled) {
2026-07-29 08:29:29 +00:00
tmp53 = chatInputFloating;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
isIOSResult = tmp53;
2026-07-20 16:05:17 +00:00
}
isAndroidResult = isIOSResult;
2026-07-29 08:29:29 +00:00
const tmpResult7 = tmp(tmp2[15]);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const items14 = [isScreenReaderEnabled, chatInputFloating, tmp48Result.autocompletePositionRelative];
2026-07-23 10:11:24 +00:00
const items15 = [memo4 > 0, token5];
2026-07-29 08:29:29 +00:00
const memo5 = obj3.useMemo(() => {
2026-07-20 16:05:17 +00:00
let prop = null;
if (obj.isIOS()) {
if (isScreenReaderEnabled) {
2026-07-24 07:16:23 +00:00
prop = _undefined2.autocompletePositionRelative;
2026-07-20 16:05:17 +00:00
} else {
prop = null;
}
}
return prop;
}, items14);
2026-07-29 08:29:29 +00:00
const memo6 = obj3.useMemo(() => {
2026-07-20 16:05:17 +00:00
let tmp;
2026-07-24 07:16:23 +00:00
if (c47) {
2026-07-29 08:29:29 +00:00
const obj = { marginTop: null };
obj[0] = token5;
2026-07-20 16:05:17 +00:00
tmp = obj;
}
return tmp;
}, items15);
2026-07-24 07:16:23 +00:00
const items16 = [analyticsLocations, beginSearch, channel, chatInputRef];
2026-07-29 08:29:29 +00:00
const tmpResult6 = analyticsLocations(canMentionEveryone[15]);
callback2 = obj3.useCallback((type) => {
2026-07-21 22:01:30 +00:00
if (type.type !== scaledTextLineHeight.EMOJI_PREMIUM_UPSELL) {
2026-07-29 08:29:29 +00:00
if (type.type === tmp.GLOBAL) {
2026-07-24 07:16:23 +00:00
if ("gameMentionInput" === type.inlineAutocompleteType) {
2026-07-28 08:39:19 +00:00
const current4 = chatInputRef.current;
current4.insertText(memo, arg1, false);
2026-07-24 07:16:23 +00:00
beginSearch(arg1);
}
}
const autocompleteResultText = analyticsLocations(canMentionEveryone[33]).getAutocompleteResultText(type, channel);
2026-07-28 08:39:19 +00:00
const current = chatInputRef.current;
const applicationCommandManager = current.getApplicationCommandManager();
2026-07-29 08:29:29 +00:00
if (type.type === tmp.GAME_MENTION) {
if (applicationCommandManager != null) {
2026-07-24 07:16:23 +00:00
applicationCommandManager.addGameMention(type.game);
}
2026-07-28 08:39:19 +00:00
let gameMentionNode;
2026-07-29 08:29:29 +00:00
if (applicationCommandManager != null) {
2026-07-28 08:39:19 +00:00
gameMentionNode = applicationCommandManager.buildGameMentionNode(type.game);
}
let tmp17;
if (null != gameMentionNode) {
const items = [gameMentionNode];
tmp17 = items;
}
2026-07-24 07:16:23 +00:00
}
2026-07-20 16:05:17 +00:00
let result;
2026-07-29 08:29:29 +00:00
if (applicationCommandManager != null) {
result = applicationCommandManager.setAutoCompleteResult(tmp10.id, autocompleteResultText, arg2, type);
2026-07-20 16:05:17 +00:00
}
if (!result) {
2026-07-29 08:29:29 +00:00
const current2 = tmp12.current;
current2.insertText(autocompleteResultText, arg1, type.type !== tmp.STICKER, tmp13);
if (type.type === tmp.STICKER) {
const current3 = tmp12.current;
2026-07-28 08:39:19 +00:00
current3.handleSelectSticker(type.sticker, arg1);
2026-07-20 16:05:17 +00:00
}
}
2026-07-24 07:16:23 +00:00
const obj3 = analyticsLocations(canMentionEveryone[33]);
2026-07-29 08:29:29 +00:00
tmp10 = channel;
2026-07-20 16:05:17 +00:00
} else {
2026-07-24 07:16:23 +00:00
let obj = channel(canMentionEveryone[41]);
2026-07-29 08:29:29 +00:00
obj = { initialUpsellKey: null, analyticsLocations: null };
obj[0] = resultCount.EMOJI_AUTOCOMPLETE;
obj[1] = analyticsLocations;
2026-07-20 16:05:17 +00:00
const result1 = obj.handleShowUpsellAlert(obj);
}
}, items16);
const items17 = [chatInputRef, optionStates, channel];
const items18 = [autocompleteSelectionStart, autocompleteType, callback1, channel, callback2, showOptionValuesPicker];
2026-07-29 08:29:29 +00:00
const callback3 = obj3.useCallback((type) => {
2026-07-20 16:05:17 +00:00
const current = chatInputRef.current;
const applicationCommandManager = current.getApplicationCommandManager();
2026-07-24 07:16:23 +00:00
if (type.type === analyticsLocations(canMentionEveryone[32]).ApplicationCommandOptionType.ATTACHMENT) {
2026-07-29 08:29:29 +00:00
let success;
if (optionStates[type.name].lastValidationResult != null) {
success = lastValidationResult.success;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (success) {
const result = analyticsLocations(canMentionEveryone[42]).openCommandAttachmentPreview(applicationCommandManager, channel.id, type.name);
const tmpResult = analyticsLocations(canMentionEveryone[42]);
} else if (applicationCommandManager != null) {
2026-07-20 16:05:17 +00:00
const result1 = applicationCommandManager.insertOrJumpCommandOption(type);
}
} else {
2026-07-29 08:29:29 +00:00
if (applicationCommandManager != null) {
2026-07-20 16:05:17 +00:00
const length = applicationCommandManager.props.text.length;
}
2026-07-29 08:29:29 +00:00
if (applicationCommandManager != null) {
2026-07-20 16:05:17 +00:00
const result2 = applicationCommandManager.insertOrJumpCommandOption(type, length);
}
}
}, items17);
2026-07-29 08:29:29 +00:00
callback4 = obj3.useCallback((type) => {
2026-07-24 07:16:23 +00:00
if (type.type === scaledTextLineHeight.GLOBAL) {
if ("gameMentionInput" === type.inlineAutocompleteType) {
2026-07-29 08:29:29 +00:00
type = tmp.GAME_MENTION;
2026-07-24 07:16:23 +00:00
}
let obj = analyticsLocations(canMentionEveryone[37]);
2026-07-29 08:29:29 +00:00
obj = { selectionType: null, stickerId: null, gameId: null };
obj[0] = type;
2026-07-24 07:16:23 +00:00
let id = null;
2026-07-29 08:29:29 +00:00
if (type.type === tmp.STICKER) {
2026-07-24 07:16:23 +00:00
id = type.sticker.id;
}
2026-07-29 08:29:29 +00:00
obj[1] = id;
2026-07-24 07:16:23 +00:00
let id1 = null;
2026-07-29 08:29:29 +00:00
if (type.type === tmp.GAME_MENTION) {
2026-07-24 07:16:23 +00:00
id1 = type.game.id;
}
2026-07-29 08:29:29 +00:00
obj[2] = id1;
2026-07-24 07:16:23 +00:00
const merged = Object.assign(callback1());
const result = obj.iOSTrackAutocompleteSelect(autocompleteType, channel, obj);
2026-07-29 08:29:29 +00:00
let num = autocompleteSelectionStart;
if (autocompleteSelectionStart == null) {
num = 0;
2026-07-24 07:16:23 +00:00
}
2026-07-29 08:29:29 +00:00
callback2(type, num, showOptionValuesPicker);
2026-07-20 16:05:17 +00:00
}
2026-07-24 07:16:23 +00:00
type = type.type;
2026-07-20 16:05:17 +00:00
}, items18);
2026-07-29 08:29:29 +00:00
tmp10Result = tmp10(obj3.useState(null), 2);
first3 = tmp10Result[0];
closure_54 = tmp10Result[1];
const items19 = [autocompleteType, callback4, first3, channel, activeCommand, gameMentionsAutocompleteConfig.showNewTag, tmp48Result];
const callback5 = obj3.useCallback((item) => {
2026-07-20 16:05:17 +00:00
item = item.item;
const type = item.type;
2026-07-21 22:01:30 +00:00
if (scaledTextLineHeight.USER === type) {
2026-07-20 16:05:17 +00:00
let obj = {};
const merged = Object.assign(item);
2026-07-29 08:29:29 +00:00
obj.guildId = channel.guild_id;
obj.onPress = function onPress() {
2026-07-24 07:16:23 +00:00
return outer1_52(item);
2026-07-20 16:05:17 +00:00
};
2026-07-21 22:01:30 +00:00
return selectionStart(channel(canMentionEveryone[17]).User, obj);
2026-07-29 08:29:29 +00:00
} else if (tmp.GLOBAL === type) {
2026-07-20 16:05:17 +00:00
obj = {};
const merged1 = Object.assign(item);
2026-07-29 08:29:29 +00:00
obj.onPress = function onPress() {
2026-07-24 07:16:23 +00:00
return outer1_52(item);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
let tmp62Result;
2026-07-24 07:16:23 +00:00
if ("gameMentionInput" === item.inlineAutocompleteType) {
if (gameMentionsAutocompleteConfig.showNewTag) {
2026-07-29 08:29:29 +00:00
const obj1 = { containerStyle: null, variant: "text-xs/bold", color: "badge-text-brand" };
obj1[0] = _undefined2.newTag;
tmp62Result = tmp62(analyticsLocations(canMentionEveryone[43]).NewTag, obj1);
2026-07-24 07:16:23 +00:00
}
}
2026-07-29 08:29:29 +00:00
obj.badge = tmp62Result;
2026-07-21 22:01:30 +00:00
return selectionStart(channel(canMentionEveryone[17]).Global, obj);
2026-07-29 08:29:29 +00:00
} else if (tmp.ROLE === type) {
2026-07-24 07:16:23 +00:00
const obj2 = {};
2026-07-20 16:05:17 +00:00
const merged2 = Object.assign(item);
2026-07-29 08:29:29 +00:00
obj2.onPress = function onPress() {
2026-07-24 07:16:23 +00:00
return outer1_52(item);
2026-07-20 16:05:17 +00:00
};
2026-07-24 07:16:23 +00:00
let tmp59 = autocompleteType === focused.MENTIONS;
if (tmp59) {
tmp59 = null == activeCommand;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj2.showDescription = tmp59;
2026-07-24 07:16:23 +00:00
return selectionStart(channel(canMentionEveryone[17]).Role, obj2);
2026-07-29 08:29:29 +00:00
} else if (tmp.CHANNEL === type) {
2026-07-24 07:16:23 +00:00
const obj3 = {};
2026-07-20 16:05:17 +00:00
const merged3 = Object.assign(item);
2026-07-29 08:29:29 +00:00
obj3.onPress = function onPress() {
2026-07-24 07:16:23 +00:00
return outer1_52(item);
2026-07-20 16:05:17 +00:00
};
2026-07-24 07:16:23 +00:00
return selectionStart(channel(canMentionEveryone[17]).Channel, obj3);
2026-07-29 08:29:29 +00:00
} else if (tmp.EMOJI === type) {
2026-07-24 07:16:23 +00:00
const obj4 = {};
2026-07-20 16:05:17 +00:00
const merged4 = Object.assign(item);
2026-07-29 08:29:29 +00:00
obj4.onPress = function onPress() {
2026-07-24 07:16:23 +00:00
return outer1_52(item);
2026-07-20 16:05:17 +00:00
};
2026-07-24 07:16:23 +00:00
return selectionStart(channel(canMentionEveryone[17]).Emoji, obj4);
2026-07-29 08:29:29 +00:00
} else if (tmp.EMOJI_PREMIUM_UPSELL === type) {
2026-07-24 07:16:23 +00:00
const obj5 = {};
2026-07-20 16:05:17 +00:00
const merged5 = Object.assign(item);
2026-07-29 08:29:29 +00:00
obj5.onPress = function onPress() {
2026-07-24 07:16:23 +00:00
return outer1_52(item);
2026-07-20 16:05:17 +00:00
};
2026-07-24 07:16:23 +00:00
return selectionStart(channel(canMentionEveryone[17]).EmojiPremiumUpsell, obj5);
2026-07-29 08:29:29 +00:00
} else if (tmp.CHOICE === type) {
2026-07-24 07:16:23 +00:00
const obj6 = {};
2026-07-20 16:05:17 +00:00
const merged6 = Object.assign(item);
2026-07-29 08:29:29 +00:00
obj6.onPress = function onPress() {
2026-07-24 07:16:23 +00:00
return outer1_52(item);
2026-07-20 16:05:17 +00:00
};
2026-07-24 07:16:23 +00:00
return selectionStart(channel(canMentionEveryone[17]).Choice, obj6);
2026-07-29 08:29:29 +00:00
} else if (tmp.CHOICE_LOADING === type) {
2026-07-21 22:01:30 +00:00
return selectionStart(channel(canMentionEveryone[17]).ChoiceLoading, {});
2026-07-29 08:29:29 +00:00
} else if (tmp.STICKER === type) {
2026-07-24 07:16:23 +00:00
const obj7 = {};
2026-07-20 16:05:17 +00:00
const merged7 = Object.assign(item);
2026-07-29 08:29:29 +00:00
obj7.onPress = function onPress() {
2026-07-24 07:16:23 +00:00
return outer1_52(item);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj7.onLongPress = function onLongPress() {
2026-07-24 07:16:23 +00:00
return outer1_54(item.sticker.id);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj7.isInteracting = first3 === item.sticker.id;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
2026-07-24 07:16:23 +00:00
return selectionStart(channel(canMentionEveryone[17]).Sticker, obj7, "" + item.sticker.id + "-" + first3 === item.sticker.id);
2026-07-29 08:29:29 +00:00
} else if (tmp.GAME_MENTION === type) {
2026-07-24 07:16:23 +00:00
const obj8 = {};
const merged8 = Object.assign(item);
2026-07-29 08:29:29 +00:00
obj8.onPress = function onPress() {
2026-07-24 07:16:23 +00:00
return outer1_52(item);
};
return selectionStart(channel(canMentionEveryone[17]).Game, obj8);
2026-07-29 08:29:29 +00:00
} else if (tmp.LABEL === type) {
2026-07-20 16:05:17 +00:00
obj = {};
2026-07-24 07:16:23 +00:00
const merged9 = Object.assign(item);
2026-07-21 22:01:30 +00:00
return selectionStart(channel(canMentionEveryone[17]).Label, obj);
2026-07-20 16:05:17 +00:00
} else {
return null;
}
}, items19);
2026-07-29 08:29:29 +00:00
const items20 = [tmp48Result.autocomplete, { maxHeight: memo3 }];
const items21 = [tmp48Result.autocompleteWrapper, , ];
2026-07-20 16:05:17 +00:00
let autocompleteWrapperAbsolute = !isAndroidResult;
2026-07-29 08:29:29 +00:00
if (!isAndroidResult) {
autocompleteWrapperAbsolute = tmp48Result.autocompleteWrapperAbsolute;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { style: items21, children: null };
2026-07-20 16:05:17 +00:00
items21[1] = autocompleteWrapperAbsolute;
items21[2] = memo5;
2026-07-29 08:29:29 +00:00
obj = { style: items22, children: null };
items22 = [tmp48Result.autocompleteContainer, channel(canMentionEveryone[40])(memo4, screenIndex)];
let tmp63Result1 = null != autocompleteType;
if (tmp63Result1) {
let tmp65Result = autocompleteType === focused.SLASHES_DISCOVERY;
if (tmp65Result) {
obj1 = { channel: null, onPressSlashItem: null, onHeightChange: null, canOnlyUseTextCommands: null };
obj1[0] = channel;
obj1[1] = function onPressSlashItem(command, section, visualSection) {
let num = autocompleteSelectionStart;
if (autocompleteSelectionStart == null) {
num = 0;
}
callback2({ command, section, type: scaledTextLineHeight.SLASH, visualSection, location: analyticsLocations(canMentionEveryone[46]).ApplicationCommandTriggerLocations.DISCOVERY }, num);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj1[2] = tmp40;
obj1[3] = canOnlyUseTextCommands;
tmp65Result = tmp65(tmp4(tmp2[45]), obj1);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const items23 = [tmp65Result, , , , ];
tmp65Result = autocompleteType === tmp68.SLASHES;
if (tmp65Result) {
obj2 = { channel: null, query: null, onPressCommandItem: null, style: null, ItemSeparatorComponent: null, getItemLayout: null, onCommandsChange: null };
obj2[0] = channel;
let str = query;
if (query == null) {
str = "";
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj2[1] = str;
obj2[2] = function onPressCommandItem(command) {
let num = autocompleteSelectionStart;
if (autocompleteSelectionStart == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-24 07:16:23 +00:00
callback2({ command, section: arg1, type: scaledTextLineHeight.SLASH, location: analyticsLocations(canMentionEveryone[46]).ApplicationCommandTriggerLocations.DISCOVERY, query }, num);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj2[3] = items20;
obj2[4] = tmp(tmp2[33]).getItemSeparator;
obj2[5] = tmp(tmp2[33]).getItemLayout;
obj2[6] = function onCommandsChange(arg0) {
let num = 0;
if (0 !== arg0) {
if (context) {
num = arg0 * token + (arg0 - 1) * gameMentionsAutocompleteConfig;
}
}
c45(num);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
tmp65Result = tmp65(tmp4(tmp2[47]), obj2);
const tmp4Result = tmp4(tmp2[47]);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items23[1] = tmp65Result;
let tmp63Result = autocompleteType === tmp68.EMOJIS_AND_STICKERS;
if (tmp63Result) {
tmp63Result = hasStickerResults;
2026-07-20 16:05:17 +00:00
if (hasStickerResults) {
2026-07-29 08:29:29 +00:00
obj3 = { children: null };
obj4 = { style: null, children: null };
const items24 = [tmp48Result.sectionTitle, ];
obj5 = { height: null };
obj5[0] = scaledTextLineHeight;
items24[1] = obj5;
obj4[0] = items24;
obj6 = { variant: null, children: null };
obj6[0] = tmp6;
const intl = tmp(tmp2[49]).intl;
let obj7 = { prefix: null };
obj7[0] = query;
obj6[1] = intl.format(tmp(tmp2[49]).t.uferGG, obj7);
obj4[1] = tmp65(tmp(tmp2[48]).Text, obj6);
const items25 = [tmp65(tmp64, obj4), ];
let obj8 = { horizontal: true, style: null, keyExtractor: null, data: null, renderItem: null, showsHorizontalScrollIndicator: false, getItemLayout: null, contentInset: null };
const obj9 = {};
2026-07-23 10:11:24 +00:00
let merged = Object.assign(items20);
2026-07-29 08:29:29 +00:00
let merged1 = Object.assign(tmp48Result.stickersAutocompleteList);
obj8[1] = obj9;
obj8[2] = function keyExtractor(sticker) {
2026-07-20 16:05:17 +00:00
return sticker.sticker.id;
};
2026-07-29 08:29:29 +00:00
obj8[3] = stickerResults;
obj8[4] = callback5;
obj8[6] = anchor;
obj8[7] = { right: 12 };
items25[1] = tmp65(chatInputRef, obj8);
obj3[0] = items25;
tmp63Result = tmp63(tmp67, obj3);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const items26 = [tmp63Result, , ];
2026-07-20 16:05:17 +00:00
if (hasStickerResults) {
hasStickerResults = hasNonStickerResults;
}
if (hasStickerResults) {
2026-07-29 08:29:29 +00:00
const obj10 = { style: null };
obj10[0] = tmp48Result.sectionDivider;
hasStickerResults = tmp65(tmp4(tmp2[50]), obj10);
2026-07-20 16:05:17 +00:00
}
2026-07-21 22:01:30 +00:00
items26[1] = hasStickerResults;
2026-07-20 16:05:17 +00:00
if (hasNonStickerResults) {
2026-07-29 08:29:29 +00:00
const obj11 = { style: null, children: null };
const items27 = [tmp48Result.sectionTitle, ];
const obj12 = { height: null };
obj12[0] = scaledTextLineHeight;
items27[1] = obj12;
obj11[0] = items27;
const obj13 = { variant: null, children: null };
obj13[0] = tmp6;
const intl2 = tmp(tmp2[49]).intl;
const obj14 = { prefix: null };
2026-07-23 10:11:24 +00:00
let _HermesInternal = HermesInternal;
2026-07-29 08:29:29 +00:00
obj14[0] = "" + context + query;
obj13[1] = intl2.format(tmp(tmp2[49]).t.ksAVYt, obj14);
obj11[1] = tmp65(tmp(tmp2[48]).Text, obj13);
hasNonStickerResults = tmp65(tmp64, obj11);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj15 = { children: null };
2026-07-21 22:01:30 +00:00
items26[2] = hasNonStickerResults;
2026-07-29 08:29:29 +00:00
obj15[0] = items26;
tmp63Result = tmp63(tmp67, obj15);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items23[2] = tmp63Result;
const obj16 = { children: null };
items23[3] = autocompleteType === focused.GAME_MENTIONS && tmp65(tmp4(tmp2[51]), {});
const obj17 = { style: null, keyExtractor: null, data: null, renderItem: null, ItemSeparatorComponent: null, getItemLayout: null };
obj17[0] = items20;
obj17[1] = function keyExtractor(arg0, arg1) {
return String(arg1);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj17[2] = nonStickerResults;
obj17[3] = callback5;
obj17[4] = tmp(tmp2[33]).getItemSeparator;
obj17[5] = tmp(tmp2[33]).getItemLayout;
items23[4] = tmp65(chatInputRef, obj17);
obj16[0] = items23;
tmp63Result1 = tmp63(tmp67, obj16);
const tmp83 = autocompleteType === focused.GAME_MENTIONS && tmp65(tmp4(tmp2[51]), {});
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[1] = tmp63Result1;
2026-07-24 07:16:23 +00:00
const items28 = [selectionStart(channel(canMentionEveryone[44]).View, obj), ];
2026-07-29 08:29:29 +00:00
let tmp65Result1 = null != activeCommand && !commandsDisabled;
if (tmp65Result1) {
const obj18 = { style: null, children: null };
obj18[0] = memo6;
const obj19 = { command: null, section: null, guildId: null, onPressOption: null, currentOption: null, optionStates: null };
obj19[0] = activeCommand;
obj19[1] = stateFromStoresObject.activeSection;
obj19[2] = channel.guild_id;
obj19[3] = callback3;
obj19[4] = activeOption;
obj19[5] = optionStates;
obj18[1] = tmp65(tmp4(tmp2[52]), obj19);
tmp65Result1 = tmp65(tmp64, obj18);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items28[1] = tmp65Result1;
obj[1] = items28;
const tmp56 = channel(canMentionEveryone[40])(memo4, screenIndex);
return selectionStart(commandsDisabled, { style: tmp48Result.autocompletePositionRelative, children: closure_26(commandsDisabled, obj) });
2026-07-20 16:05:17 +00:00
});
forwardRefResult.displayName = "AutocompleteWrapper";
2026-07-21 22:01:30 +00:00
const memoResult = importAllResult.memo(forwardRefResult);
2026-07-23 10:11:24 +00:00
let result = require("get ActivityIndicator").fileFinishedImporting("modules/autocompleter/native/AutocompleteWrapper.tsx");
2026-07-20 16:05:17 +00:00
2026-07-21 22:01:30 +00:00
export default memoResult;