/* Metro module 9579; source: modules/icymi/ICYMIUtils.tsx; dependencies: [5, 4117, 1383, 1379, 1867, 4814, 4605, 9569, 9578, 661, 7230, 9580, 4625, 21, 566, 9581, 9585, 8370, 9586, 9587, 1244, 5097, 1962, 661, 2] */ function _fun74965(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74965, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:6, offset: 0x01d9ea24, size: 669 bytes, params: 8, frame: 24 var object2; let env0_0 = require; const closure = function(a0, a1) { return 'hydration-' + a0 + '-' + a1; }; const closure2 = function() { return _hydrateItems.apply(this, arguments); }; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_3 = importDefault(5) /* metro dependency 5 */; const guildScheduledEventStore = importDefault(4117) /* metro dependency 4117: GuildScheduledEventStore */; const env0_5 = (require(1383) /* metro dependency 1383: ChannelRecord */).ThreadChannelRecord; const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */; const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */; const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */; const readStateStore = importDefault(4605) /* metro dependency 4605: ReadStateStore */; const icymiStore = importDefault(9569) /* metro dependency 9569: ICYMIStore */; const icymiUnreadStateStore = importDefault(9578) /* metro dependency 9578: ICYMIUnreadStateStore */; const constantsModule = require(661) /* metro dependency 661: Constants */; const env0_12 = constantsModule.ChannelTypes; const env0_13 = constantsModule.GuildNSFWContentLevel; object2 = {UNKNOWN: 0}; object2[0] = 'UNKNOWN'; object2.DEFAULT = 1; object2[1] = 'DEFAULT'; object2.MORE = 2; object2[2] = 'MORE'; object2.LESS = 3; object2[3] = 'LESS'; object2.MUTED = 4; object2[4] = 'MUTED'; (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/icymi/ICYMIUtils.tsx'); exports.generateHydrationId = closure; exports.ICYMICustomScore = object2; exports.isGuildItem = isGuildItem; exports.isChannelCustomScoreEligible = isChannelCustomScoreEligible; exports.numberToCustomScore = numberToCustomScore; exports.customScoreToNumber = customScoreToNumber; exports.hydrateItems = closure2; exports.hydrateNextPage = function() { return _hydrateNextPage.apply(this, arguments); }; exports.createGravityMessageFromServer = createGravityMessageFromServer; exports.isItemUnreadInChannel = isItemUnreadInChannel; exports.useGravityMessage = function(a0) { var env0_0 = a0; return require(dependencyMap[14]).useStateFromStores([MessageStore, ICYMIStore], _fun74992, [a0]); }; exports.useGravityMessageItem = function(a0) { var env0_0 = a0; return require(dependencyMap[14]).useStateFromStores([ICYMIStore], _fun74994, [a0.id]); }; exports.useICYMIMessage = function(a0, a1) { var env0_0 = a0; var env0_1 = a1; return require(dependencyMap[14]).useStateFromStores([MessageStore, ICYMIStore], _fun74996, [a0, a1]); }; exports.icymiEnabled = icymiEnabled; exports.customStatusToContentInventoryEntry = customStatusToContentInventoryEntry; exports.compareGravityUnreadIds = compareGravityUnreadIds; exports.getViewableFeedItemsArray = getViewableFeedItemsArray; exports.isItemNSFW = isItemNSFW; exports.itemToType = itemToType; exports.determineContentType = determineContentType; exports.contentTypeToText = contentTypeToText; exports.regenerateFeedAndClearReadStates = function() { return _regenerateFeedAndClearReadStates.apply(this, arguments); }; } function _hydrateItems() { // fn#74968, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:539, offset: 0x01d9ece7, size: 50 bytes, params: 1, frame: 14 return env0_3(_fun74970).apply(this, arguments); } function _hydrateNextPage() { // fn#74977, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:1708, offset: 0x01d9f05a, size: 50 bytes, params: 1, frame: 14 return env0_3(_fun74979).apply(this, arguments); } function _regenerateFeedAndClearReadStates() { // fn#74980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:1948, offset: 0x01d9f123, size: 50 bytes, params: 1, frame: 14 return env0_3(_fun74982).apply(this, arguments); } function isGuildItem(a0) { // fn#74984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:2840, offset: 0x01d9f3f6, size: 92 bytes, params: 2, frame: 15 const type = a0.type; const ICYMIItemTypes = (require(7230) /* metro dependency 7230: ICYMITypes */).ICYMIItemTypes; const MESSAGE = ICYMIItemTypes.MESSAGE; return type === MESSAGE || a0.type === ICYMIItemTypes.GUILD_EVENT; } function isChannelCustomScoreEligible(a0) { // fn#74985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:2990, offset: 0x01d9f452, size: 74 bytes, params: 2, frame: 5 const type = a0.type; const GUILD_FORUM = ChannelTypes.GUILD_FORUM; return type === GUILD_FORUM || (a0.type === ChannelTypes.GUILD_ANNOUNCEMENT || a0.type === ChannelTypes.GUILD_TEXT); } function numberToCustomScore(a0) { // fn#74986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:3140, offset: 0x01d9f49c, size: 87 bytes, params: 2, frame: 3 return a0 < -1.5 ? env0_14.MUTED : a0 < 0 ? env0_14.LESS : a0 > 0 ? env0_14.MORE : env0_14.DEFAULT; } function customScoreToNumber(a0) { // fn#74987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:3249, offset: 0x01d9f4f3, size: 73 bytes, params: 2, frame: 3 const MORE = env0_14.MORE; if (MORE === a0) { return 1; } const LESS = env0_14.LESS; if (LESS === a0) { return -1; } const MUTED = env0_14.MUTED; if (MUTED === a0) { return -2; } return 0; } function createGravityMessageFromServer(a0, a1) { // fn#74989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:3527, offset: 0x01d9f53c, size: 118 bytes, params: 3, frame: 16 const object2 = {}; copyDataProperties(object2, a1, undefined); const value2 = undefined; const messageRecordUtilsModule = require(4625) /* metro dependency 4625: MessageRecordUtils */; object2['message'] = messageRecordUtilsModule.createMessageRecord(a0.message); object2['threadChannel'] = a0.thread_channel != null ? ThreadChannelRecord.fromServer(a0.thread_channel, a0.guild_id) : value2; return object2; } function isItemUnreadInChannel(a0, a1) { // fn#74990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:3744, offset: 0x01d9f5b2, size: 92 bytes, params: 3, frame: 17 var r0; var defaultImport; var value; const trackedAckMessageId = ReadStateStore.getTrackedAckMessageId(a0); const value3 = trackedAckMessageId == null; if (value3) { r0 = value3; } else { value = importDefault(21) /* metro dependency 21: SnowflakeUtils */; value = value.extractTimestamp(a1); defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */; value = value > defaultImport.extractTimestamp(trackedAckMessageId); r0 = value; } return r0; } function useGravityMessage(a0) { // fn#74991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:3911, offset: 0x01d9f60e, size: 83 bytes, params: 2, frame: 17 const env0_0 = a0; return (require(566) /* metro dependency 566: flux */).useStateFromStores([MessageStore, ICYMIStore], _fun74992, [a0]); } function useGravityMessageItem(a0) { // fn#74993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:4150, offset: 0x01d9f6c3, size: 80 bytes, params: 2, frame: 16 const env0_0 = a0; return (require(566) /* metro dependency 566: flux */).useStateFromStores([ICYMIStore], _fun74994, [a0.id]); } function useICYMIMessage(a0, a1) { // fn#74995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:4280, offset: 0x01d9f733, size: 94 bytes, params: 3, frame: 18 const env0_0 = a0; const env0_1 = a1; return (require(566) /* metro dependency 566: flux */).useStateFromStores([MessageStore, ICYMIStore], _fun74996, [a0, a1]); } function icymiEnabled(a0) { // fn#74997, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:4488, offset: 0x01d9f7eb, size: 41 bytes, params: 2, frame: 11 return (require(9581) /* metro dependency 9581: ICYMIExperiment */).getICYMIEnabled(a0); } function customStatusToContentInventoryEntry(a0) { // fn#74998, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:4587, offset: 0x01d9f814, size: 298 bytes, params: 2, frame: 15 const object3 = {}; object3.id = a0.id; const ICYMIItemTypes = (require(7230) /* metro dependency 7230: ICYMITypes */).ICYMIItemTypes; let CUSTOM_STATUS = ICYMIItemTypes.CUSTOM_STATUS; object3.type = CUSTOM_STATUS; const object4 = {}; object4.id = a0.id; const user_id = a0.data.user_id; object4.author_id = user_id; const ContentInventoryAuthorType = (require(9585) /* metro dependency 9585: ContentInventoryAuthorType */).ContentInventoryAuthorType; const USER = ContentInventoryAuthorType.USER; object4.author_type = USER; object4.traits = []; object4.participants = []; const ContentInventoryEntryType = (require(8370) /* metro dependency 8370: ContentInventoryEntryType */).ContentInventoryEntryType; CUSTOM_STATUS = ContentInventoryEntryType.CUSTOM_STATUS; object4.content_type = CUSTOM_STATUS; object4.extra = {type: 'custom_status_extra', status: a0.data.text ?? '', emoji_id: a0.data.emoji_id, emoji_name: a0.data.emoji_name, emoji_animated: a0.data.emoji_animated, attachments: a0.data.attachments}; object3.activity = object4; object3.score = a0.score; object3.score_components = a0.score_components; return object3; } function compareGravityUnreadIds(a0, a1, a2) { // fn#74999, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:5153, offset: 0x01d9f93e, size: 132 bytes, params: 4, frame: 16 const r4 = ICYMIUnreadStateStore.getReadTimestamp(a0) ?? a2?.[a0]; const r3 = ICYMIUnreadStateStore.getReadTimestamp(a1) ?? a2?.[a1]; return r4 != null ? r4 == null ? -1 : r3 == null ? 1 : r3 - r4 : r3 == null ? 0 : r4 == null ? -1 : r3 == null ? 1 : r3 - r4; } function getViewableFeedItemsArray(a0) { // fn#75000, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:5395, offset: 0x01d9f9c2, size: 229 bytes, params: 2, frame: 25 var r8; var r1; var r0; var property; var NON_ELIGIBLE_SCROLL_ITEMS; var has; var item; var data; var kind; var id; var value6; const unreadDisplayItems = ICYMIStore.getUnreadDisplayItems(); const items2 = []; const value3 = arraySpread(items2, unreadDisplayItems, 0, undefined); const getReadDisplayItems = ICYMIStore.getReadDisplayItems; arraySpread(items2, Reflect.apply(getReadDisplayItems, ICYMIStore, []), value3, undefined); const value4 = null; var env0_0; const value5 = a0.length - 1; if (value5 >= 0) { r8 = value5; reducibleLoop1: while (true) { property = a0[r8]; if (value4 != property) { NON_ELIGIBLE_SCROLL_ITEMS = (require(9586) /* metro dependency 9586: ICYMIItemTypes */).NON_ELIGIBLE_SCROLL_ITEMS; has = NON_ELIGIBLE_SCROLL_ITEMS.has; item = property.item; data = item.data; kind = data.kind; reducibleJoin4: while (true) { if (Reflect.apply(has, NON_ELIGIBLE_SCROLL_ITEMS, [kind])) { break reducibleJoin4; } item = property.item; id = item.id; env0_0 = id; r1 = id; break reducibleLoop1; } } value6 = typeof r8 === 'bigint' ? r8 - 1n : +r8 - 1; if (value6 >= 0) { r8 = value6; continue reducibleLoop1; } r1 = value4; break reducibleLoop1; } } else { r1 = value4; } if (value4 == r1) { return []; } let value = items2.findIndex(function({id}) { return id === id; }); if (value < 0) { r0 = []; } else { value = items2.slice(0, value + 1); r0 = value; } return r0; } function isItemNSFW(a0) { // fn#75002, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:5728, offset: 0x01d9faa7, size: 273 bytes, params: 2, frame: 15 var guild_id; var r3; var guild_id2; var r6; var value; var value2; var id; var channel_id; var channel; var value4; var value5; const kind = a0.data.kind; if (kind === 'message') { channel_id = a0.data.message.channel_id; value = undefined; r3 = channel_id; guild_id = value; channel = ChannelStore.getChannel(r3); value4 = null; if (value4 == channel) { value5 = undefined; guild_id2 = value4 == channel ? value5 : channel.guild_id; r6 = value4 == guild_id2 ? guild_id : guild_id2; r3 = value4 != r6 ? GuildStore.getGuild(r6) : value4; return (value4 == r3 ? value5 : r3.nsfwLevel) === GuildNSFWContentLevel.EXPLICIT || (value4 == r3 ? value5 : r3.nsfwLevel) === GuildNSFWContentLevel.AGE_RESTRICTED; } if (channel.nsfw) { return true; } value5 = undefined; guild_id2 = value4 == channel ? value5 : channel.guild_id; r6 = value4 == guild_id2 ? guild_id : guild_id2; r3 = value4 != r6 ? GuildStore.getGuild(r6) : value4; return (value4 == r3 ? value5 : r3.nsfwLevel) === GuildNSFWContentLevel.EXPLICIT || (value4 == r3 ? value5 : r3.nsfwLevel) === GuildNSFWContentLevel.AGE_RESTRICTED; } if (kind === 'forumThread') { id = a0.data.threadChannel.id; value = undefined; r3 = id; guild_id = value; channel = ChannelStore.getChannel(r3); value4 = null; if (value4 == channel) { value5 = undefined; guild_id2 = value4 == channel ? value5 : channel.guild_id; r6 = value4 == guild_id2 ? guild_id : guild_id2; r3 = value4 != r6 ? GuildStore.getGuild(r6) : value4; return (value4 == r3 ? value5 : r3.nsfwLevel) === GuildNSFWContentLevel.EXPLICIT || (value4 == r3 ? value5 : r3.nsfwLevel) === GuildNSFWContentLevel.AGE_RESTRICTED; } if (channel.nsfw) { return true; } value5 = undefined; guild_id2 = value4 == channel ? value5 : channel.guild_id; r6 = value4 == guild_id2 ? guild_id : guild_id2; r3 = value4 != r6 ? GuildStore.getGuild(r6) : value4; return (value4 == r3 ? value5 : r3.nsfwLevel) === GuildNSFWContentLevel.EXPLICIT || (value4 == r3 ? value5 : r3.nsfwLevel) === GuildNSFWContentLevel.AGE_RESTRICTED; } if (kind === 'guildEvent') { value = GuildScheduledEventStore.getGuildScheduledEvent(a0.data.eventId); value2 = undefined; guild_id = value == null ? value2 : value.guild_id; r3 = value2; channel = ChannelStore.getChannel(r3); value4 = null; if (value4 == channel) { value5 = undefined; guild_id2 = value4 == channel ? value5 : channel.guild_id; r6 = value4 == guild_id2 ? guild_id : guild_id2; r3 = value4 != r6 ? GuildStore.getGuild(r6) : value4; return (value4 == r3 ? value5 : r3.nsfwLevel) === GuildNSFWContentLevel.EXPLICIT || (value4 == r3 ? value5 : r3.nsfwLevel) === GuildNSFWContentLevel.AGE_RESTRICTED; } if (channel.nsfw) { return true; } value5 = undefined; guild_id2 = value4 == channel ? value5 : channel.guild_id; r6 = value4 == guild_id2 ? guild_id : guild_id2; r3 = value4 != r6 ? GuildStore.getGuild(r6) : value4; return (value4 == r3 ? value5 : r3.nsfwLevel) === GuildNSFWContentLevel.EXPLICIT || (value4 == r3 ? value5 : r3.nsfwLevel) === GuildNSFWContentLevel.AGE_RESTRICTED; } return false; } function itemToType(a0) { // fn#75003, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:6228, offset: 0x01d9fbb8, size: 298 bytes, params: 2, frame: 17 const kind = a0.data.kind; if (kind === 'end') { return 'end'; } if (kind === 'loading') { return 'loading'; } if (kind === 'bottomLoading') { return 'bottomLoading'; } const value = 'message'; if (value === kind) { return a0.channelType === ChannelTypes.GUILD_ANNOUNCEMENT ? 'announcement' : a0.data.messageContext?.external_content_application_id != null ? 'game_message' : value; } if (kind === 'guildEvent') { return 'guild_event'; } if (kind === 'contentInventory') { return a0.data.content.content_type !== (require(8370) /* metro dependency 8370: ContentInventoryEntryType */).ContentInventoryEntryType.CUSTOM_STATUS ? 'hotwheels_gaming_activity' : 'hotwheels_custom_status'; } if (kind === 'recommendedGuilds') { return 'recommended_guilds'; } if (kind === 'forumThread') { return 'forum_thread'; } if (kind === 'icymiHeader') { return 'icymi_header'; } return 'unknown'; } function determineContentType(a0, a1) { // fn#75004, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:6928, offset: 0x01d9fce2, size: 499 bytes, params: 3, frame: 18 var r1; var r3; const ContentType = (require(7230) /* metro dependency 7230: ICYMITypes */).ContentType; var moduleValue; var moduleValue2; let type = a0.type; const GUILD_ANNOUNCEMENT = ChannelTypes.GUILD_ANNOUNCEMENT; if (type === GUILD_ANNOUNCEMENT) { return ContentType.ANNOUNCEMENT; } type = a0.type; const GUILD_FORUM = ChannelTypes.GUILD_FORUM; if (type === GUILD_FORUM) { return ContentType.FORUM_POST; } if (a1.reactions != null) { var value2 = a1.reactions.map(function(a0) { var r1; var r0; var property; var value = 0; if (a0.count_details == null) { r0 = value; } else { property = a0.count_details.burst; r1 = property ?? value; property = a0.count_details.normal; value = r1 + (property ?? value); r0 = value; } return r0; }); if (value2.length === 0) { if (a1.attachments.length > 0) { moduleValue = require(9587) /* metro dependency 9587: ForumPostMediaUtils */; if (moduleValue.isValidImageAttachment(a1.attachments[0])) { r3 = ContentType.IMAGE; } else { moduleValue2 = require(9587) /* metro dependency 9587: ForumPostMediaUtils */; r3 = moduleValue2.isValidVideoAttachment(a1.attachments[0]) ? ContentType.VIDEO : ContentType.FILE; } r1 = r3; } else { r1 = a1.embeds.length > 0 ? ContentType.LINK : ContentType.INTERESTING; } return r1; } if (value2.reduce(function(a0, a1) { return a0 + a1; }) > 10) { return ContentType.POPULAR_MESSAGE; } } if (a1.attachments.length > 0) { moduleValue = require(9587) /* metro dependency 9587: ForumPostMediaUtils */; if (moduleValue.isValidImageAttachment(a1.attachments[0])) { r3 = ContentType.IMAGE; } else { moduleValue2 = require(9587) /* metro dependency 9587: ForumPostMediaUtils */; r3 = moduleValue2.isValidVideoAttachment(a1.attachments[0]) ? ContentType.VIDEO : ContentType.FILE; } r1 = r3; } else { r1 = a1.embeds.length > 0 ? ContentType.LINK : ContentType.INTERESTING; } return r1; } function contentTypeToText(a0) { // fn#75007, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:7667, offset: 0x01d9ff1f, size: 984 bytes, params: 2, frame: 16 const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; var string; const t = (require(1244) /* metro dependency 1244: indexNative */).t; const value = a1; let r1 = value !== undefined ? value : false; const ContentType = (require(7230) /* metro dependency 7230: ICYMITypes */).ContentType; const POPULAR_MESSAGE = ContentType.POPULAR_MESSAGE; if (POPULAR_MESSAGE === a0) { return intl.string(t['H/2+cl']); } const IMAGE = ContentType.IMAGE; if (IMAGE === a0) { return intl.string(t.gmOWAo); } const VIDEO = ContentType.VIDEO; if (VIDEO === a0) { return intl.string(t.swhcPM); } const LINK = ContentType.LINK; if (LINK === a0) { return intl.string(t.oj5yvD); } const THREAD = ContentType.THREAD; if (THREAD === a0) { return intl.string(t.DwLrLK); } const FORUM_POST = ContentType.FORUM_POST; if (FORUM_POST === a0) { return intl.string(t['Q9/6BS']); } const CHANGED_STATUS = ContentType.CHANGED_STATUS; if (CHANGED_STATUS === a0) { return intl.string(t.TGrUmi); } const INTERESTING = ContentType.INTERESTING; if (INTERESTING === a0) { return intl.string(t['TahE/i']); } const ANNOUNCEMENT = ContentType.ANNOUNCEMENT; if (ANNOUNCEMENT === a0) { string = intl.string; r1 = r1 ? Reflect.apply(string, intl, [t.E0MW8I]) : Reflect.apply(string, intl, [t['2ih63V']]); return r1; } const FILE = ContentType.FILE; if (FILE === a0) { return intl.string(t.pYrnTY); } } function* _fun74970(a0, a1, a2) { // fn#74970, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:588, offset: 0x01d9ed24, size: 320 bytes, params: 4, frame: 24 var environment; if (true) { var env0_0; value = environment.__proto__.__proto__; var binding = env2_10; env0_0 = binding.getHydratedItems(); var value3 = a0.slice(a1, a2); if (value3.length === 0) { return undefined; } binding = env2_1; var binding2 = env2_2; binding(binding2[11]).loadHydratedAttempt(env2_15(a1, a2)); var filter = value3.filter; value = Reflect.apply(filter, value3, [_fun74971]); var value6 = value.filter(_fun74972).map(function(a0) { return {channel_id: a0.data.channel_id, message_id: a0.data.message_id}; }); var value8 = value.map(_fun74974).flat(); filter = value8.filter; var Boolean = global.Boolean; var value9 = Reflect.apply(filter, value8, [Boolean]); var value11 = value.filter(_fun74975).map(function(a0) { return {user_id: a0.data.user_id, content_id: a0.data.content_id}; }); var value12 = binding(binding2[11]); var fetchHydrated = value12.fetchHydrated; var items2 = []; arraySpread(items2, value9, arraySpread(items2, value6, 0, value), value); yield Reflect.apply(fetchHydrated, value12, [a1, a2, {messageItems: items2, activityItems: value11}]); } } function* _fun74979() { // fn#74979, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:1763, offset: 0x01d9f097, size: 140 bytes, params: 1, frame: 18 if (true) { value = environment.__proto__.__proto__; var binding = env2_10; var unreadDisplayItems = binding.getUnreadDisplayItems(); var readDisplayItems = env2_10.getReadDisplayItems(); var nextIndexToHydrate = env2_10.getNextIndexToHydrate(); binding = env2_16; var items2 = []; arraySpread(items2, readDisplayItems, arraySpread(items2, unreadDisplayItems, 0, undefined), undefined); var ICYMI_PAGE_SIZE = env2_0(env2_2[10]).ICYMI_PAGE_SIZE; yield binding(items2, nextIndexToHydrate, nextIndexToHydrate + ICYMI_PAGE_SIZE); } } function* _fun74982(a0) { // fn#74982, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:2037, offset: 0x01d9f160, size: 402 bytes, params: 2, frame: 20 var environment; if (true) { var env0_0 = a0; var env0_1; var env0_2; value = environment.__proto__.__proto__; var binding = env2_0; var binding2 = env2_2; yield binding(binding2[22])(binding2[21], binding2.paths); var value4 = undefined; if (false) { return value4; } env0_1 = value4.ack; binding = env2_0; var binding3 = env2_2; yield binding(binding3[22])(binding3[23], binding3.paths); var value7 = undefined; if (false) { return value7; } env0_2 = value7.AnalyticsObjectTypes; env2_10.getDehydratedItems().forEach(_fun74983); var value10 = env2_1(env2_2[11]); yield value10.clearReadStates(); if (false) { return undefined; } var value13 = env2_1(env2_2[11]); yield value13.fetchDehydrated({'isReloading': true, 'forceRefresh': true}); if (false) { return undefined; } var value16 = env2_1(env2_2[11]); yield value16.reloadICYMITab(); if (false) { return undefined; } var value19 = env2_1(env2_2[11]); var getGuildChannelScores = value19.getGuildChannelScores; yield Reflect.apply(getGuildChannelScores, value19, []); if (false) { return undefined; } env2_1(env2_2[11]).getRecommendedGuilds(); } } function _fun74992() { // fn#74992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:3983, offset: 0x01d9f661, size: 98 bytes, params: 1, frame: 15 const value = environment.__proto__; const getMessage = MessageStore.getMessage; const binding = env0_0; let r0 = Reflect.apply(getMessage, MessageStore, [binding.getChannelId(), binding.id]) ?? ICYMIStore.getHydratedItem(env0_0.id)?.message; r0 = r0 ?? env0_0; return r0; } function _fun74994() { // fn#74994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:4224, offset: 0x01d9f713, size: 32 bytes, params: 1, frame: 11 return ICYMIStore.getHydratedItem(env0_0.id); } function _fun74996() { // fn#74996, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:4352, offset: 0x01d9f791, size: 90 bytes, params: 1, frame: 17 const value2 = null; return value2 != require ? value2 != MessageStore.getMessage(env0_0, require) ? MessageStore.getMessage(env0_0, require) : value2 == ICYMIStore.getHydratedItem(require) ? undefined : ICYMIStore.getHydratedItem(require).message : value2; } function _fun74971({id}) { // fn#74971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:736, offset: 0x01d9ee64, size: 27 bytes, params: 2, frame: 2 return env0_0[id] == null; } function _fun74972({type}) { // fn#74972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:767, offset: 0x01d9ee7f, size: 51 bytes, params: 2, frame: 12 const ICYMIItemTypes = env3_0(env3_2[10]).ICYMIItemTypes; const MESSAGE = ICYMIItemTypes.MESSAGE; return type === MESSAGE; } function _fun74974(a0) { // fn#74974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:894, offset: 0x01d9eed7, size: 297 bytes, params: 2, frame: 15 var items2; var data; var message_context; var push; var object4; var object5; var object6; const type = a0.type; let value = environment.__proto__.__proto__.__proto__; const binding = env3_0; value = undefined; const ICYMIItemTypes = binding(env3_2[10]).ICYMIItemTypes; const MESSAGE = ICYMIItemTypes.MESSAGE; if (type === MESSAGE) { items2 = []; data = a0.data; message_context = data.message_context; if ((message_context == null ? value : message_context.reply_message_id) != null) { push = items2.push; object4 = {}; data = a0.data; object4.channel_id = data.channel_id; data = a0.data; object4.message_id = data.message_context.reply_message_id; Reflect.apply(push, items2, [object4]); } data = a0.data; message_context = data.message_context; if ((message_context == null ? value : message_context.before_message_id) != null) { push = items2.push; object5 = {}; data = a0.data; object5.channel_id = data.channel_id; data = a0.data; object5.message_id = data.message_context.before_message_id; Reflect.apply(push, items2, [object5]); } data = a0.data; message_context = data.message_context; if ((message_context == null ? value : message_context.after_message_id) != null) { push = items2.push; object6 = {}; data = a0.data; object6.channel_id = data.channel_id; data = a0.data; object6.message_id = data.message_context.after_message_id; Reflect.apply(push, items2, [object6]); } return items2; } return []; } function _fun74975({type}) { // fn#74975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:1490, offset: 0x01d9f000, size: 51 bytes, params: 2, frame: 12 const ICYMIItemTypes = env3_0(env3_2[10]).ICYMIItemTypes; const ACTIVITY = ICYMIItemTypes.ACTIVITY; return type === ACTIVITY; } function _fun74983(a0) { // fn#74983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9765:2179, offset: 0x01d9f2f2, size: 260 bytes, params: 2, frame: 21 var data; var value4; var compare; var ackMessageId; var channel_id; var value5; var ackBinding; var object2; var atPreviousMillisecond; const type = a0.type; let value = environment.__proto__.__proto__.__proto__; let binding = env3_0; const ICYMIItemTypes = binding(env3_2[10]).ICYMIItemTypes; const MESSAGE = ICYMIItemTypes.MESSAGE; let r3 = type === MESSAGE && a0.data.channel_type === env3_12.GUILD_ANNOUNCEMENT; if (r3) { binding = env3_1; value4 = binding(env3_2[13]); compare = value4.compare; binding = env3_9; ackMessageId = binding.ackMessageId; data = a0.data; value5 = Reflect.apply(ackMessageId, binding, [data.channel_id]); data = a0.data; r3 = Reflect.apply(compare, value4, [value5, data.message_id]) >= 0; } if (r3) { ackBinding = ack; data = a0.data; channel_id = data.channel_id; object2 = {object: env0_0}; object2.objectType = AnalyticsObjectTypes.ACK_SEMI_AUTOMATIC; value = env3_1(env3_2[13]); atPreviousMillisecond = value.atPreviousMillisecond; data = a0.data; value = Reflect.apply(atPreviousMillisecond, value, [data.message_id]); ackBinding(channel_id, object2, true, true, value); } }