/* Metro module 11048; source: modules/stickers/native/StickerPicker.tsx; dependencies: [57, 31, 27, 1878, 6583, 3832, 661, 33, 4501, 697, 683, 11049, 11051, 566, 6771, 6789, 11032, 690, 11055, 6943, 4643, 11056, 7882, 6796, 11065, 6984, 1244, 11075, 11076, 11081, 2] */ function _fun84543(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84543, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11234:6, offset: 0x01f4f02f, size: 435 bytes, params: 8, frame: 23 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_3 = importDefault(57) /* metro dependency 57 */; let value = importAll(31) /* metro dependency 31 */; const value2 = require(27) /* metro dependency 27 */; const env0_5 = value2.View; const env0_6 = value2.ActivityIndicator; const userStore = importDefault(1878) /* metro dependency 1878: UserStore */; const stickersStore = importDefault(6583) /* metro dependency 6583: StickersStore */; const STICKER_SEARCH_HEADER_HEIGHT = (require(3832) /* metro dependency 3832: StickersConstants */).STICKER_SEARCH_HEADER_HEIGHT; const constantsModule = require(661) /* metro dependency 661: Constants */; const env0_9 = constantsModule.AnalyticEvents; const env0_10 = constantsModule.AnalyticsPages; const env0_11 = constantsModule.AnalyticsSections; const env0_12 = constantsModule.UpsellTypes; const env0_13 = constantsModule.ChatInputComponentViewedTypes; const value4 = require(33) /* metro dependency 33 */; const env0_14 = value4.jsx; const env0_15 = value4.jsxs; const createStylesModule = require(4501) /* metro dependency 4501: createStyles */; const createStyles = createStylesModule.createStyles; const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8; const env0_16 = Reflect.apply(createStyles, createStylesModule, [{container: {flex: 1}, header: {paddingVertical: PX_8}, loadingIndicator: {'alignItems': 'center', 'justifyContent': 'center', 'flex': 1}, emptyState: {'marginTop': null, 'alignItems': 'center', 'justifyContent': 'center', 'flex': 1, marginTop: STICKER_SEARCH_HEADER_HEIGHT}}]); value = value.memo(StickerPicker); (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/stickers/native/StickerPicker.tsx'); exports.default = value; } function StickerPicker({bottomSheetRef, bottomSheetIndex, channel, paddingTop, onPressSticker, stickerFormats, inPortalKeyboard}) { // fn#84544, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11234:612, offset: 0x01f4f1e2, size: 1014 bytes, params: 2, frame: 49 var r10; var SearchField; var intl; const styles = useStyles(); (require(11049) /* metro dependency 11049: StickersHooks */).useFetchStickerPacks(); const value3 = (require(11051) /* metro dependency 11051: StickersUtils */).useStickerCategories(channel); const hasLoadedStickerPacks = (require(566) /* metro dependency 566: flux */).useStateFromStores([StickersStore], function() { return StickersStore.hasLoadedStickerPacks; }); const binding = env0_4; let useState = binding.useState; const value4 = Reflect.apply(useState, binding, [0]); const binding2 = env0_3; const value5 = binding2(value4, 2); const property = value5[0]; const property2 = value5[1]; let defaultImport = importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */; const STICKER_PICKER = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).STICKER_PICKER; const analyticsLocations = defaultImport(STICKER_PICKER).analyticsLocations; useState = binding.useState; const value7 = binding2(Reflect.apply(useState, binding, [null]), 2); const property3 = value7[0]; var env0_4 = value7[1]; const {safeAreaStyle, safeAreaBottomKeyboardAware} = (importDefault(11032) /* metro dependency 11032: useExpressionPickerInsets */)({hasCategories: true}); const value9 = binding.useCallback(_fun84546, []); binding.useEffect(function() { var defaultImport = importDefault(dependencyMap[10]); var CHAT_INPUT_COMPONENT_VIEWED = AnalyticEvents.CHAT_INPUT_COMPONENT_VIEWED; var channelBinding = channel; defaultImport.track(CHAT_INPUT_COMPONENT_VIEWED, {type: ChatInputComponentViewedTypes.STICKER, channel_id: channelBinding.id, guild_id: channelBinding.guild_id}); }, [channel.id, channel.guild_id]); const value10 = binding.useCallback(_fun84549, [channel, onPressSticker, analyticsLocations]); const value11 = binding.useCallback(function() { var channelBinding = channel; var defaultImport = importDefault(dependencyMap[10]); var CHAT_INPUT_COMPONENT_VIEWED = AnalyticEvents.CHAT_INPUT_COMPONENT_VIEWED; defaultImport.track(CHAT_INPUT_COMPONENT_VIEWED, {type: ChatInputComponentViewedTypes.STICKER_SEARCH, channel_id: channelBinding.id, guild_id: channelBinding.guild_id}); }, [channel]); const defaultImport3 = importDefault(6796) /* metro dependency 6796: TidaWebformExperiment */; const useExperiment = defaultImport3.useExperiment; const tidaWebformEnabled = Reflect.apply(useExperiment, defaultImport3, [{location: 'StickerPicker'}, {autoTrackExposure: false}]).tidaWebformEnabled; const value12 = binding.useCallback(_fun84551, [channel]); const AnalyticsLocationProvider = (require(6771) /* metro dependency 6771: useAnalyticsLocations */).AnalyticsLocationProvider; if (value3.length === 0) { r10 = null; } else { var viewBinding2Props = {style: styles.header}; SearchField = (require(6984) /* metro dependency 6984: SearchFieldNative */).SearchField; intl = (require(1244) /* metro dependency 1244: indexNative */).intl; r10 = ; } return ( {r10} {hasLoadedStickerPacks ? value3.length === 0 ? {((Component) => )(importDefault(11075) /* metro dependency 11075: StickerPickerEmptyState */)} : ((Component) => )(importDefault(11076) /* metro dependency 11076: StickerPickerList */) : } {((Component) => )(importDefault(11081) /* metro dependency 11081: StickerPickerCategories */)} ); } function _fun84546(a0) { // fn#84546, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11234:1130, offset: 0x01f4f5e7, size: 110 bytes, params: 2, frame: 13 var environment; var value; var binding; if (a0 === '') { value = environment.__proto__; value = require(690) /* metro dependency 690: ReactBatchUpdatesNative */; value.batchUpdates(_fun84547); } else { binding = env0_4; value = environment.__proto__; value = require(11055) /* metro dependency 11055: StickersSearchUtils */; binding(value.searchAllStickers(a0)); } } function _fun84549(a0) { // fn#84549, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11234:1383, offset: 0x01f4f6cb, size: 477 bytes, params: 2, frame: 21 var object2; var value5; var defaultImport2; const stickerSendability = (require(6943) /* metro dependency 6943: StickerSendability */).getStickerSendability(a0, UserStore.getCurrentUser(), channel); const StickerSendability = (require(6943) /* metro dependency 6943: StickerSendability */).StickerSendability; const SENDABLE = StickerSendability.SENDABLE; if (stickerSendability === SENDABLE) { onPressSticker(a0); } else { var SENDABLE_WITH_PREMIUM = StickerSendability.SENDABLE_WITH_PREMIUM; if (stickerSendability !== SENDABLE_WITH_PREMIUM) { return undefined; } var moduleValue2 = require(4643) /* metro dependency 4643: StickersUtils */; if (moduleValue2.isStandardSticker(a0)) { value5 = StickersStore.getStickerPack(a0.pack_id); if (value5 == null) { return undefined; } defaultImport2 = importDefault(11056) /* metro dependency 11056: openStickerPackDetailActionSheet */; object2 = {}; object2.analyticsLocation = {page: channel.guild_id != null ? AnalyticsPages.GUILD_CHANNEL : AnalyticsPages.DM_CHANNEL}; object2.analyticsPopoutType = (require(11056) /* metro dependency 11056: openStickerPackDetailActionSheet */).AnalyticsPopoutType.STICKER_PACK_DETAIL; object2.stickerPack = value5; defaultImport2(object2); return undefined; } var moduleValue3 = require(4643) /* metro dependency 4643: StickersUtils */; if (moduleValue3.isGuildSticker(a0)) { (importDefault(7882) /* metro dependency 7882: PremiumUpsellUtils */).handleShowUpsellAlert({initialUpsellKey: UpsellTypes.GLOBAL_STICKER, analyticsLocation: {page: channel.guild_id != null ? AnalyticsPages.GUILD_CHANNEL : AnalyticsPages.DM_CHANNEL, section: AnalyticsSections.STICKER_PICKER_UPSELL}, analyticsLocations: analyticsLocations}); } } } function _fun84551(a0) { // fn#84551, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11234:2304, offset: 0x01f4f901, size: 59 bytes, params: 2, frame: 13 const value = environment.__proto__; (require(11065) /* metro dependency 11065: showStickerDetailActionSheet */).showStickerDetailActionSheet({renderableSticker: a0, channel: channel}); } function _fun84547() { // fn#84547, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11234:1164, offset: 0x01f4f655, size: 29 bytes, params: 1, frame: 12 env1_2(0); env1_4(null); }