decord/source/modules/stickers/native/StickerPicker.tsx

185 lines
7.9 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 10255
// Function ID: 10256
// Dependencies: [32, 19, 17, 1922, 6806, 4072, 676, 21, 4668, 712, 698, 10256, 10258, 589, 7177, 7197, 10230, 705, 10262, 7336, 4828, 10263, 8510, 7204, 10272, 7375, 1236, 10282, 10283, 10288, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 10255
import ThemesDefault from "Themes" /* 712 */;
import closure_3 from "_slicedToArray" /* 32 */;
import importAllResult from "noop" /* 19 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
import closure_7 from "mergeGuildAvatar" /* 1922 */;
import closure_8 from "loadSavedGuildStickers" /* 6806 */;
import ME from "ME" /* 676 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
let c4 = importAllResult;
({ View: c5, ActivityIndicator: closure_6 } = get_ActivityIndicator);
({ AnalyticEvents: c9, AnalyticsPages: c10, AnalyticsSections: unpackModuleId, UpsellTypes: closure_12, ChatInputComponentViewedTypes: map1 } = ME);
2026-07-23 10:11:24 +00:00
({ jsx: closure_14, jsxs: closure_15 } = jsxProd);
2026-07-29 08:29:29 +00:00
let obj = { container: { flex: 1 }, header: null, loadingIndicator: null, emptyState: null };
2026-08-24 06:08:38 +00:00
obj = { paddingVertical: ThemesDefault.space.PX_8 };
2026-07-29 08:29:29 +00:00
obj[1] = obj;
obj[2] = { alignItems: "center", justifyContent: "center", flex: 1 };
obj[3] = { marginTop: require("STICKER_PICKER_TAB_PANEL_ID").STICKER_SEARCH_HEADER_HEIGHT, alignItems: "center", justifyContent: "center", flex: 1 };
let closure_16 = createCacheKey.createStyles(obj);
2026-07-20 16:05:17 +00:00
const memoResult = importAllResult.memo(function StickerPicker(channel) {
channel = channel.channel;
const onPressSticker = channel.onPressSticker;
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
2026-07-29 08:29:29 +00:00
let analyticsLocations;
2026-07-20 16:05:17 +00:00
({ bottomSheetRef, bottomSheetIndex, paddingTop, stickerFormats, inPortalKeyboard } = channel);
2026-07-29 08:29:29 +00:00
let tmp = callback();
2026-08-24 06:08:38 +00:00
let obj = channel(10256);
2026-07-20 16:05:17 +00:00
const fetchStickerPacks = obj.useFetchStickerPacks();
2026-08-24 06:08:38 +00:00
obj1 = channel(10258);
2026-07-20 16:05:17 +00:00
const stickerCategories = obj1.useStickerCategories(channel);
2026-07-29 08:29:29 +00:00
let obj2 = channel(589);
2026-08-24 06:08:38 +00:00
const items = [closure_8];
2026-07-29 08:29:29 +00:00
const stateFromStores = obj2.useStateFromStores(items, () => obj.hasLoadedStickerPacks);
const tmp6 = analyticsLocations(undefined.useState(0), 2);
dependencyMap = tmp7;
2026-08-24 06:08:38 +00:00
analyticsLocations = onPressSticker(7177)(onPressSticker(7197).STICKER_PICKER).analyticsLocations;
const tmp9 = onPressSticker(7177);
2026-07-29 08:29:29 +00:00
[tmp11, c4] = analyticsLocations(undefined.useState(null), 2);
const tmp10 = analyticsLocations(undefined.useState(null), 2);
2026-08-24 06:08:38 +00:00
({ safeAreaStyle, safeAreaBottomKeyboardAware } = onPressSticker(10230)({ hasCategories: true }));
2026-07-20 16:05:17 +00:00
const items1 = [, ];
({ id: arr3[0], guild_id: arr3[1] } = channel);
2026-07-29 08:29:29 +00:00
callback = importAllResult.useCallback((arg0) => {
2026-07-20 16:05:17 +00:00
if ("" === arg0) {
2026-08-24 06:08:38 +00:00
channel(705).batchUpdates(() => {
2026-07-29 08:29:29 +00:00
callback(0);
callback2(null);
2026-07-20 16:05:17 +00:00
});
2026-08-24 06:08:38 +00:00
const obj2 = channel(705);
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
_undefined(channel(10262).searchAllStickers(arg0));
const obj = channel(10262);
2026-07-20 16:05:17 +00:00
}
}, []);
2026-07-23 10:11:24 +00:00
const effect = importAllResult.useEffect(() => {
2026-08-24 06:08:38 +00:00
let obj = onPressSticker(698);
obj = { type: closure_1_13.STICKER, channel_id: channel.id, guild_id: channel.guild_id };
obj.track(closure_1_9.CHAT_INPUT_COMPONENT_VIEWED, obj);
2026-07-20 16:05:17 +00:00
}, items1);
const items2 = [channel, onPressSticker, analyticsLocations];
const items3 = [channel];
2026-07-23 10:11:24 +00:00
const callback1 = importAllResult.useCallback((pack_id) => {
2026-08-24 06:08:38 +00:00
let obj = channel(7336);
const stickerSendability = obj.getStickerSendability(pack_id, closure_1_7.getCurrentUser(), channel);
if (stickerSendability === channel(7336).StickerSendability.SENDABLE) {
2026-07-20 16:05:17 +00:00
onPressSticker(pack_id);
2026-08-24 06:08:38 +00:00
} else if (stickerSendability === tmp(7336).StickerSendability.SENDABLE_WITH_PREMIUM) {
let tmpResult = tmp(4828);
2026-07-29 08:29:29 +00:00
if (tmpResult.isStandardSticker(pack_id)) {
2026-08-24 06:08:38 +00:00
const stickerPack = closure_1_8.getStickerPack(pack_id.pack_id);
2026-07-20 16:05:17 +00:00
if (null != stickerPack) {
2026-07-29 08:29:29 +00:00
if (null != tmp3.guild_id) {
2026-08-24 06:08:38 +00:00
let DM_CHANNEL2 = closure_1_10.GUILD_CHANNEL;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
DM_CHANNEL2 = closure_1_10.DM_CHANNEL;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { analyticsLocation: null, analyticsPopoutType: null, stickerPack: null };
obj = { page: null };
obj[0] = DM_CHANNEL2;
obj[0] = obj;
2026-08-24 06:08:38 +00:00
obj[1] = tmp(10263).AnalyticsPopoutType.STICKER_PACK_DETAIL;
2026-07-29 08:29:29 +00:00
obj[2] = stickerPack;
2026-08-24 06:08:38 +00:00
onPressSticker(10263)(obj);
const tmp17 = onPressSticker(10263);
2026-07-20 16:05:17 +00:00
}
} else {
2026-08-24 06:08:38 +00:00
tmpResult = tmp(4828);
2026-07-29 08:29:29 +00:00
if (tmpResult.isGuildSticker(pack_id)) {
2026-08-24 06:08:38 +00:00
let obj2 = onPressSticker(8510);
obj1 = { initialUpsellKey: null, analyticsLocation: null, analyticsLocations: null };
obj1[0] = closure_1_12.GLOBAL_STICKER;
2026-07-29 08:29:29 +00:00
if (null != tmp3.guild_id) {
2026-08-24 06:08:38 +00:00
let DM_CHANNEL = closure_1_10.GUILD_CHANNEL;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
DM_CHANNEL = closure_1_10.DM_CHANNEL;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj2 = { page: null, section: null };
obj2[0] = DM_CHANNEL;
2026-08-24 06:08:38 +00:00
obj2[1] = closure_1_11.STICKER_PICKER_UPSELL;
2026-07-29 08:29:29 +00:00
obj1[1] = obj2;
obj1[2] = analyticsLocations;
2026-07-20 16:05:17 +00:00
const result = obj2.handleShowUpsellAlert(obj1);
}
}
}
}, items2);
2026-07-29 08:29:29 +00:00
const callback2 = importAllResult.useCallback(() => {
2026-08-24 06:08:38 +00:00
let obj = onPressSticker(698);
obj = { type: closure_1_13.STICKER_SEARCH, channel_id: channel.id, guild_id: channel.guild_id };
obj.track(closure_1_9.CHAT_INPUT_COMPONENT_VIEWED, obj);
2026-07-20 16:05:17 +00:00
}, items3);
2026-08-24 06:08:38 +00:00
let obj3 = onPressSticker(7204);
2026-07-20 16:05:17 +00:00
const items4 = [channel];
2026-07-23 10:11:24 +00:00
const callback3 = importAllResult.useCallback((renderableSticker) => {
2026-08-24 06:08:38 +00:00
let obj = channel(10272);
2026-07-20 16:05:17 +00:00
obj = { renderableSticker, channel };
const result = obj.showStickerDetailActionSheet(obj);
}, items4);
2026-07-29 08:29:29 +00:00
obj = { value: analyticsLocations, children: null };
obj = { style: tmp.container, children: null };
let tmp18Result = null;
2026-07-20 16:05:17 +00:00
if (0 !== stickerCategories.length) {
2026-07-29 08:29:29 +00:00
obj1 = { style: null, children: null };
obj1[0] = tmp.header;
obj2 = { size: "md", placeholder: null, onChange: null, onFocus: null, isRound: true };
const intl = tmp2(1236).intl;
obj2[1] = intl.string(tmp2(1236).t.dt5h1C);
obj2[2] = callback;
obj2[3] = callback2;
2026-08-24 06:08:38 +00:00
obj1[1] = tmp18(tmp2(7375).SearchField, obj2);
2026-07-29 08:29:29 +00:00
tmp18Result = tmp18(tmp20, obj1);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const items5 = [tmp18Result, , ];
2026-07-20 16:05:17 +00:00
if (stateFromStores) {
if (0 === stickerCategories.length) {
2026-07-29 08:29:29 +00:00
obj3 = { style: null, children: null };
obj3[0] = tmp.emptyState;
2026-08-24 06:08:38 +00:00
tmp = tmp18(tmp8(10282), {});
2026-07-29 08:29:29 +00:00
obj3[1] = tmp;
tmp18Result = tmp18(tmp20, obj3);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const obj4 = { bottomSheetRef: null, bottomSheetIndex: null, setCategoryIndex: null, onPressSticker: null, onLongPressStickerDetail: null, insetBottom: null, insetTop: null, channel: null, stickerFormats: null, searchResults: null, inPortalKeyboard: null };
obj4[0] = bottomSheetRef;
obj4[1] = bottomSheetIndex;
obj4[2] = tmp7;
obj4[3] = callback1;
2026-07-20 16:05:17 +00:00
let tmp24;
if (obj3.useExperiment({ location: "StickerPicker" }, { autoTrackExposure: false }).tidaWebformEnabled) {
tmp24 = callback3;
}
2026-07-29 08:29:29 +00:00
obj4[4] = tmp24;
obj4[5] = safeAreaBottomKeyboardAware;
obj4[6] = paddingTop;
obj4[7] = channel;
obj4[8] = stickerFormats;
obj4[9] = tmp11;
obj4[10] = inPortalKeyboard;
2026-08-24 06:08:38 +00:00
tmp18Result = tmp18(tmp8(10283), obj4);
const tmp8Result = tmp8(10283);
2026-07-20 16:05:17 +00:00
}
} else {
2026-07-29 08:29:29 +00:00
const obj5 = { animating: true, size: "large", style: null };
obj5[2] = tmp.loadingIndicator;
items5[1] = tmp18(closure_6, obj5);
const obj6 = { categories: null, categoryIndex: null, style: null };
obj6[0] = stickerCategories;
obj6[1] = tmp6[0];
obj6[2] = safeAreaStyle;
2026-08-24 06:08:38 +00:00
items5[2] = tmp18(tmp8(10288), obj6);
2026-07-29 08:29:29 +00:00
obj[1] = items5;
obj[1] = closure_15(tmp20, obj);
2026-08-24 06:08:38 +00:00
return tmp18(channel(7177).AnalyticsLocationProvider, obj);
2026-07-20 16:05:17 +00:00
}
});
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/stickers/native/StickerPicker.tsx");
2026-07-20 16:05:17 +00:00
export default memoResult;