/* Metro module 8579; source: modules/emoji_picker/analytics/trackOnEmojiPickerOpened.tsx; dependencies: [31, 6540, 1379, 1934, 661, 1881, 1346, 8537, 8538, 4863, 3801, 2] */ import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */ import SelectedChannelStore from '../../../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */ import AppAnalyticsUtils from '../../app_analytics/AppAnalyticsUtils.tsx'; /* Metro dependency 4863 */ import EmojiStore from '../../emojis/EmojiStore.tsx'; /* Metro dependency 6540 */ import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */ import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */ import * as ExpressionPickerConstantsModule from '../../expression_picker/ExpressionPickerConstants.tsx'; /* Metro dependency 1346 */ import * as EmojiConstantsModule from '../../emojis/EmojiConstants.tsx'; /* Metro dependency 1881 */ import * as UseEmojiHotrailModule from '../hooks/useEmojiHotrail.tsx'; /* Metro dependency 8538 */ function _fun67859(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#67859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8764:6, offset: 0x01c35678, size: 252 bytes, params: 8, frame: 20 const env0_0 = require; const trackOnEmojiPickerOpened2 = trackOnEmojiPickerOpened; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); (FileImportTrackerModule).fileFinishedImporting('modules/emoji_picker/analytics/trackOnEmojiPickerOpened.tsx'); exports.default = trackOnEmojiPickerOpened2; exports.useTrackOnEmojiPickerOpenedForReactions = useTrackOnEmojiPickerOpenedForReactions; function trackOnEmojiPickerOpened({intention, containerWidth, rowSize, isBurstReaction, analyticsObject}) { // fn#67860, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8764:221, offset: 0x01c35774, size: 948 bytes, params: 2, frame: 31 const channelStoreBinding = ChannelStore; const getChannel = channelStoreBinding.getChannel; const selectedChannelStoreBinding = SelectedChannelStore; const getChannelId = selectedChannelStoreBinding.getChannelId; const value2 = Reflect.apply(getChannel, channelStoreBinding, [Reflect.apply(getChannelId, selectedChannelStoreBinding, [])]); const guildId = value2?.getGuildId(); let REACTION = EmojiIntention.REACTION; const r11 = intention === REACTION ? EmojiStore.emojiReactionFrecencyWithoutFetchingLatest.frequently.slice() : EmojiStore.emojiFrecencyWithoutFetchingLatest.frequently.slice(); const r21 = value2 != null ? EmojiStore.getDisambiguatedEmojiContext(value2.getGuildId()).favoriteEmojisWithoutFetchingLatest : []; REACTION = EmojiIntention.REACTION; const value7 = r11.slice(0, intention === REACTION ? EmojiStore.emojiReactionFrecencyWithoutFetchingLatest.numFrequentlyItems : EmojiStore.emojiFrecencyWithoutFetchingLatest.numFrequentlyItems); const r13 = guildId != null ? EmojiStore.getGuildEmoji(guildId) : []; const emojiStoreBinding = EmojiStore; const getDisambiguatedEmojiContext = emojiStoreBinding.getDisambiguatedEmojiContext; const customEmoji = Reflect.apply(getDisambiguatedEmojiContext, emojiStoreBinding, [value2?.getGuildId()]).getCustomEmoji(); const {topEmojis, newlyAddedEmojis} = (require(8537) /* metro dependency 8537: useTopAndNewlyAddedEmojis */).getTopAndNewlyAddedEmojis({guildId: value2?.getGuildId(), pickerIntention: intention}); const {visibleTopEmojis, visibleNewlyAddedEmojis} = (UseEmojiHotrailModule).getEmojiHotrail({topEmojis: topEmojis, newlyAddedEmojis: newlyAddedEmojis, rowSize: rowSize}); const defaultImport = AppAnalyticsUtils; const trackWithMetadata = defaultImport.trackWithMetadata; REACTION = EmojiIntention.REACTION; const r2 = intention === REACTION ? AnalyticEvents.REACTION_PICKER_OPENED : AnalyticEvents.EXPRESSION_PICKER_OPENED; const object = {width: containerWidth}; const EMOJI = ExpressionPickerViewType.EMOJI; object.tab = EMOJI; object.badged = false; object.num_expressions_favorites = r21.length; object.num_animated_expressions_favorites = r21.filter(function(a0) { return a0?.animated; }).length; object.num_custom_expressions_favorites = r21.filter((importDefault(3801) /* metro dependency 3801: EmojiUtils */).isCustomEmoji).length; object.num_standard_expressions_favorites = r21.filter(function(a0) { return a0.id == null; }).length; object.num_expressions_frecent = value7.length; object.num_animated_expressions_frecent = value7.filter(function(a0) { return a0?.animated; }).length; object.num_custom_expressions_frecent = value7.filter((importDefault(3801) /* metro dependency 3801: EmojiUtils */).isCustomEmoji).length; object.num_standard_expressions_frecent = value7.filter(function(a0) { return a0.id == null; }).length; object.num_current_guild_expressions = r13.length; object.num_custom_expressions_total = customEmoji.size; object.num_expressions_top_server = visibleTopEmojis.length; object.num_animated_expressions_top_server = visibleTopEmojis.filter(function(a0) { return a0.animated; }).length; object.num_expressions_newly_added = visibleNewlyAddedEmojis.length; object.num_animated_expressions_newly_added = visibleNewlyAddedEmojis.filter(function(a0) { return a0.animated; }).length; REACTION = EmojiIntention.REACTION; copyDataProperties(object, intention === REACTION && ({is_burst: isBurstReaction}), r21); copyDataProperties(object, analyticsObject != null && ({location_object: analyticsObject}), r21); Reflect.apply(trackWithMetadata, defaultImport, [r2, object]); } function useTrackOnEmojiPickerOpenedForReactions(a0) { // fn#67867, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8764:2307, offset: 0x01c35b4e, size: 52 bytes, params: 2, frame: 13 const env0_0 = ReactModule.useRef(a0); ReactModule.useEffect(_fun67868, []); function _fun67868() { // fn#67868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8764:2390, offset: 0x01c35b82, size: 59 bytes, params: 1, frame: 12 const intention = env0_0.current.intention; const REACTION = EmojiIntention.REACTION; if (intention === REACTION) { trackOnEmojiPickerOpened(env0_0.current); } } } } global.__d(_fun67859, 8579, [31, 6540, 1379, 1934, 661, 1881, 1346, 8537, 8538, 4863, 3801, 2]) /* metro module 8579, dependencies: [31, 6540, 1379, 1934, 661, 1881, 1346, 8537, 8538, 4863, 3801, 2] */;