/* Metro module 14428; source: modules/home_drawer/native/HomeDrawerGuildRow.tsx; dependencies: [31, 27, 1379, 1935, 5214, 1867, 4605, 4864, 4865, 482, 33, 4501, 566, 4013, 4010, 14429, 10629, 4573, 6915, 1305, 14431, 14432, 11566, 1244, 14407, 2] */ import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */ import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */ import GuildChannelStore from '../../../stores/GuildChannelStore.tsx'; /* Metro dependency 1935 */ import ReadStateStore from '../../../stores/ReadStateStore.tsx'; /* Metro dependency 4605 */ import UserGuildSettingsStore from '../../../stores/UserGuildSettingsStore.tsx'; /* Metro dependency 4864 */ import GuildReadStateStore from '../../../stores/GuildReadStateStore.tsx'; /* Metro dependency 5214 */ import GuildBadgeV2 from '../../guild/native/GuildBadgeV2.tsx'; /* Metro dependency 6915 */ import UseTypingText from '../../chat/useTypingText.tsx'; /* Metro dependency 11566 */ import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */ import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */ import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */ import * as ConstantsModule from '../../../external/discord_common/js/shared/Constants.tsx'; /* Metro dependency 482 */ import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */ import * as HomeDrawerExperimentModule from './HomeDrawerExperiment.tsx'; /* Metro dependency 4013 */ import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */ import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */ import * as ReadStateConstantsModule from '../../read_states/ReadStateConstants.tsx'; /* Metro dependency 4865 */ import * as HomeDrawerSharedModule from './HomeDrawerShared.tsx'; /* Metro dependency 14407 */ import * as UseHomeDrawerGuildTypingModule from './useHomeDrawerGuildTyping.tsx'; /* Metro dependency 14432 */ function _fun109194(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#109194, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14625:6, offset: 0x02341019, size: 380 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_16 = (CreateStylesModule).createStyles({guildName: {'flexDirection': 'row', 'alignItems': 'center', 'gap': 4}}); (FileImportTrackerModule).fileFinishedImporting('modules/home_drawer/native/HomeDrawerGuildRow.tsx'); exports.default = HomeDrawerGuildRow; function GuildRowWrapper({guild, disableSubtitle}) { // fn#109195, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14625:346, offset: 0x02341195, size: 877 bytes, params: 2, frame: 34 const styles = useStyles(); const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildReadStateStore], function() { return GuildReadStateStore.hasUnread(guild.id); }); const env0_3 = value2; const value3 = env0_3.useMemo(_fun109198, [(require(566) /* metro dependency 566: flux */).useStateFromStores([UserGuildSettingsStore], function() { return UserGuildSettingsStore.getMuteConfig(guild.id); })]); const value4 = env0_3.useMemo(_fun109199, [guild, value3, styles.guildName]); const {unreadChannelName, unreadChannelCount} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([GuildChannelStore, ReadStateStore, UserGuildSettingsStore, ChannelStore], _fun109200, [guild.id]); const {mentionChannelName, mentionChannelCount} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([GuildReadStateStore, ChannelStore], _fun109202, [guild.id]); const {voiceUsers, streamingUser, streamingChannelId} = (require(14431) /* metro dependency 14431: HomeDrawerGuildVoiceState */).useVoiceUsers(guild); const {typingChannelId, typingChannelName, typingUserIds} = (UseHomeDrawerGuildTypingModule).useHomeDrawerGuildTyping(guild.id); const value9 = (UseTypingText)({channelId: typingChannelId, guildId: guild.id, typingUserIds: typingUserIds}); let r2 = value3.isMuted || disableSubtitle; r2 = !r2 ? voiceUsers.length === 0 : r2; const value11 = !r2; const value12 = env0_3.useMemo(_fun109204, [disableSubtitle, value3.isMuted, value2, unreadChannelName, unreadChannelCount, mentionChannelName, mentionChannelCount, typingChannelId, typingChannelName, value9]); const value13 = env0_3.useMemo(_fun109207, [value11, voiceUsers]); const value14 = env0_3.useMemo(_fun109209, [value11, streamingUser]); const HomeDrawerSharedItem = (HomeDrawerSharedModule).HomeDrawerSharedItem; return ( )((require(14431) /* metro dependency 14431: HomeDrawerGuildVoiceState */).GuildVoiceState)} /> ); function _fun109198() { // fn#109198, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14625:545, offset: 0x02341542, size: 142 bytes, params: 1, frame: 16 var r3; var object2; var end_time; var value2; var Date; var prototype; var value3; var date; var value4; var value5; if (muteConfig == null) { object2 = {'isMuted': false, 'isTemporary': false}; } else { end_time = muteConfig.end_time; value2 = end_time == null; if (value2) { r3 = value2; } else { Date = global.Date; end_time = muteConfig.end_time; prototype = Date.prototype; value3 = Object.create(prototype, {constructor: {value: Date}}); date = new Date(); value4 = date instanceof Object ? date : value3; Date = global.Date; prototype = Date.prototype; value5 = Object.create(prototype, {constructor: {value: Date}}); date = new Date(); r3 = value4 > (date instanceof Object ? date : value5); } end_time = muteConfig.end_time; object2 = {isMuted: r3, isTemporary: end_time != null}; } return object2; } function _fun109199() { // fn#109199, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14625:691, offset: 0x023415d0, size: 308 bytes, params: 1, frame: 23 const items2 = [ ((Component) => )(env0_5.isMuted ? env0_5.isTemporary ? (require(14429) /* metro dependency 14429: BellZIcon */).BellZIcon : (require(10629) /* metro dependency 10629: BellSlashIcon */).BellSlashIcon : NOOP), ]; const Text = (TextModule).Text; const guildBinding = guild; items2[1] = ( {guildBinding.name} ); const Icon = (NativeModule).Icon; const Sizes = Icon.Sizes; const REFRESH_SMALL_16 = Sizes.REFRESH_SMALL_16; items2[2] = ; return ( {items2} ); } function _fun109200() { // fn#109200, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14625:1076, offset: 0x02341704, size: 121 bytes, params: 1, frame: 15 var environment; var r2; let value = environment.__proto__; const guildChannelStoreBinding = GuildChannelStore; const getSelectableChannelIds = guildChannelStoreBinding.getSelectableChannelIds; const value4 = Reflect.apply(getSelectableChannelIds, guildChannelStoreBinding, [guild.id]).filter(_fun109201); const length = value4.length; const value5 = undefined; if (length > 0) { value = ChannelStore.getChannel(value4[0]); r2 = value == null ? value5 : value.name; } else { r2 = value5; } return {unreadChannelName: r2, unreadChannelCount: value4.length}; function _fun109201(a0) { // fn#109201, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14625:1129, offset: 0x0234177d, size: 82 bytes, params: 2, frame: 14 const value = environment.__proto__.__proto__; const basicChannel = ChannelStore.getBasicChannel(a0); return basicChannel != null && (ReadStateStore.hasUnread(a0) && UserGuildSettingsStore.resolveUnreadSetting(basicChannel) === UnreadSetting.ALL_MESSAGES); } } function _fun109202() { // fn#109202, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14625:1453, offset: 0x023417cf, size: 174 bytes, params: 1, frame: 16 var environment; var r2; var object; let value = environment.__proto__; const property = GuildReadStateStore.getMutableGuildStates()[guild.id]; if (property == null) { object = {mentionChannelName: undefined, mentionChannelCount: 0}; } else { var Object = global.Object; var value5 = Object.keys(property.mentionCounts).filter(_fun109203); object = {}; var length = value5.length; var value6 = undefined; if (length > 0) { value = ChannelStore.getChannel(value5[0]); r2 = value == null ? value6 : value.name; } else { r2 = value6; } object.mentionChannelName = r2; length = value5.length; object.mentionChannelCount = length; } return object; function _fun109203(a0) { // fn#109203, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14625:1608, offset: 0x0234187d, size: 33 bytes, params: 2, frame: 2 return env0_0.mentionCounts[a0].count > 0; } } function _fun109204() { // fn#109204, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14625:2100, offset: 0x0234189e, size: 633 bytes, params: 1, frame: 27 const Text = (TextModule).Text; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; const disableSubtitleBinding = disableSubtitle; const value2 = null; return ( disableSubtitleBinding ? value2 : ( value2 == mentionChannelName ? ( value2 == typingChannelId || value2 == JsxRuntimeModule.jsxs || env0_5.isMuted ? ( env0_3 && value2 != unreadChannelName && unreadChannelCount > 0 ? ( {intl.format((require(1244) /* metro dependency 1244: indexNative */).t.OqlmU6, {channelName: unreadChannelName, channelHook: channelHook_109206, count: unreadChannelCount - 1})} ) : value2 ) : ( { value2 != typingChannelName ? ( <> {'#' + typingChannelName} {' · '} ) : value2 } {JsxRuntimeModule.jsxs} ) ) : ( mentionChannelCount > 0 ? ( {intl.format((require(1244) /* metro dependency 1244: indexNative */).t.L9YdGH, {channelName: mentionChannelName, channelHook: channelHook_109205, count: mentionChannelCount - 1})} ) : ( value2 == typingChannelId || value2 == JsxRuntimeModule.jsxs || env0_5.isMuted ? ( env0_3 && value2 != unreadChannelName && unreadChannelCount > 0 ? ( {intl.format((require(1244) /* metro dependency 1244: indexNative */).t.OqlmU6, {channelName: unreadChannelName, channelHook: channelHook_109206, count: unreadChannelCount - 1})} ) : value2 ) : ( { value2 != typingChannelName ? ( <> {'#' + typingChannelName} {' · '} ) : value2 } {JsxRuntimeModule.jsxs} ) ) ) ) ); function channelHook_109205(a0) { // fn#109205, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14625:2273, offset: 0x02341b17, size: 83 bytes, params: 2, frame: 16 const Text = (TextModule).Text; return ( {'#' + a0} ); } function channelHook_109206(a0) { // fn#109206, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14625:2546, offset: 0x02341b17, size: 83 bytes, params: 2, frame: 16 const Text = (TextModule).Text; return ( {'#' + a0} ); } } function _fun109207() { // fn#109207, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14625:2866, offset: 0x02341b6a, size: 220 bytes, params: 1, frame: 24 var environment; var r0; var value3; var Text; var intl; var format; var r1Vkoc; var object2; var voiceUsersBinding; var Math; var value; if (JsxRuntimeModule.Fragment) { value3 = environment.__proto__; Text = (require(4573) /* metro dependency 4573: Text */).Text; intl = (require(1244) /* metro dependency 1244: indexNative */).intl; format = intl.format; r1Vkoc = (require(1244) /* metro dependency 1244: indexNative */).t.r1Vkoc; object2 = {}; voiceUsersBinding = voiceUsers; value = voiceUsersBinding.slice(0, 2); value = value.map(function(a0) { return a0.username; }); object2.users = value.join(', '); Math = global.Math; object2.overflowCount = Math.max(voiceUsersBinding.length - 2, 0); value = ( {Reflect.apply(format, intl, [r1Vkoc, object2])} ); r0 = value; } else { r0 = null; } return r0; } function _fun109209() { // fn#109209, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14625:3124, offset: 0x02341c46, size: 171 bytes, params: 1, frame: 22 var username; var r0; var value3; var value4; var Text; var intl; var format; var k5IKep; var value; const value2 = null; if (JsxRuntimeModule.Fragment) { value3 = environment.__proto__; value4 = undefined; Text = (require(4573) /* metro dependency 4573: Text */).Text; intl = (require(1244) /* metro dependency 1244: indexNative */).intl; format = intl.format; k5IKep = (require(1244) /* metro dependency 1244: indexNative */).t.k5IKep; username = value2 == streamingUser ? value4 : streamingUser.username; value = ''; value = ( {Reflect.apply(format, intl, [k5IKep, {username: value2 != username ? username : value}])} ); r0 = value; } else { r0 = value2; } return r0; } } function HomeDrawerGuildRow({guildId, disableSubtitle}) { // fn#109210, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14625:3646, offset: 0x02341cf1, size: 196 bytes, params: 2, frame: 19 const guild = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() { return GuildStore.getGuild(guildId); }); const MobileHomeDrawerExperiment = (HomeDrawerExperimentModule).MobileHomeDrawerExperiment; const useConfig = MobileHomeDrawerExperiment.useConfig; return ( guild == null ? null : ( Reflect.apply(useConfig, MobileHomeDrawerExperiment, [{location: 'guild-row'}]).enableHome ? ( (importDefault(4010) /* metro dependency 4010: useChatLayout */)().isChatBesideChannelList ? null : ( ) ) : null ) ); } } global.__d(_fun109194, 14428, [31, 27, 1379, 1935, 5214, 1867, 4605, 4864, 4865, 482, 33, 4501, 566, 4013, 4010, 14429, 10629, 4573, 6915, 1305, 14431, 14432, 11566, 1244, 14407, 2]) /* metro module 14428, dependencies: [31, 27, 1379, 1935, 5214, 1867, 4605, 4864, 4865, 482, 33, 4501, 566, 4013, 4010, 14429, 10629, 4573, 6915, 1305, 14431, 14432, 11566, 1244, 14407, 2] */;