/* Metro module 12067; source: modules/navbars/native/components/ChannelNavbar.tsx; dependencies: [31, 27, 4257, 1383, 1379, 1867, 4396, 3793, 1878, 661, 1386, 1376, 33, 4501, 6597, 697, 566, 1244, 6647, 4805, 8829, 12068, 12069, 1305, 9713, 12070, 5475, 9711, 8581, 5278, 4573, 3995, 8419, 8792, 3968, 1365, 10357, 12071, 2] */ import ChannelStore from '../../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */ import GuildStore from '../../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */ import UserStore from '../../../../stores/UserStore.tsx'; /* Metro dependency 1878 */ import RelationshipStore from '../../../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */ import GatewayConnectionStore from '../../../gateway/GatewayConnectionStore.tsx'; /* Metro dependency 4257 */ import PresenceStore from '../../../../stores/PresenceStore.tsx'; /* Metro dependency 4396 */ import TextStyles from '../../../rebrand/native/TextStyles.tsx'; /* Metro dependency 6597 */ import UseIsViewingPremiumMemberships from '../../../guild_role_subscriptions/useIsViewingPremiumMemberships.tsx'; /* Metro dependency 12069 */ 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 FluxModule from '../../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */ import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */ import * as IndexNativeModule from '../../../../intl/index.native.tsx'; /* Metro dependency 1244 */ import * as NativeModule from '../../../../design/void/native.tsx'; /* Metro dependency 1305 */ import * as Dismissible_contentModule from '../../../../external/discord_common/js/packages/protos/discord_protos/discord_users/v1/dismissible_content.tsx'; /* Metro dependency 1365 */ import * as DismissibleContentConstantsModule from '../../../dismissible_content/DismissibleContentConstants.tsx'; /* Metro dependency 1376 */ import * as ChannelRecordModule from '../../../../records/ChannelRecord.tsx'; /* Metro dependency 1383 */ import * as ChannelConstantsModule from '../../../channel/ChannelConstants.tsx'; /* Metro dependency 1386 */ 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 UseChannelNameModule from '../../../channel/useChannelName.tsx'; /* Metro dependency 4805 */ import * as NavigationPathUtilsModule from '../NavigationPathUtils.tsx'; /* Metro dependency 12068 */ function _fun92711(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#92711, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:6, offset: 0x02095cb4, size: 819 bytes, params: 8, frame: 28 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ReactModule; const Fonts = ConstantsModule.Fonts; const createStyles = CreateStylesModule.createStyles; object = {navbarTitleContainer: {'height': '100%', 'flex': 1, 'flexDirection': 'row', 'alignItems': 'center'}}; const object2 = {}; const DISPLAY_SEMIBOLD = Fonts.DISPLAY_SEMIBOLD; const MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY; copyDataProperties(object2, TextStyles(DISPLAY_SEMIBOLD, MOBILE_TEXT_HEADING_PRIMARY, 18), undefined); object2['flexShrink'] = 1; object.navbarTitlePrimaryText = object2; let TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED; object.navbarTitleSecondaryText = {'fontSize': 12, 'lineHeight': 16, 'color': null, 'marginTop': -4, color: TEXT_MUTED}; object.channelIcon = {'height': 18, 'width': 18, 'marginRight': 8}; const CHANNEL_ICON = (importDefault(697) /* metro dependency 697: native */).colors.CHANNEL_ICON; object.channelIconColor = {color: CHANNEL_ICON}; TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED; object.homeIcon = {'height': 20, 'width': 20, 'tintColor': null, 'marginTop': 0, 'marginRight': 8, tintColor: TEXT_MUTED}; object.premiumIcon = {marginRight: 4}; object.status = {'marginLeft': 1, 'marginTop': 4}; object.channelTextContainer = {'flex': 1, 'flexGrow': 1}; object.channelNameContainer = {flexGrow: 1}; object.channelName = {textAlign: 'left'}; object.flexRow = {'flexDirection': 'row', 'alignItems': 'center'}; const env0_18 = Reflect.apply(createStyles, CreateStylesModule, [object]); value = value.memo(_fun92712); (FileImportTrackerModule).fileFinishedImporting('modules/navbars/native/components/ChannelNavbar.tsx'); exports.ChannelTitleWithoutRoute = ChannelTitleWithoutRoute; exports.ChannelTitle = value; exports.ChannelButtons = ChannelButtons; function _fun92712({onPressTitle, channelId, guildId, threadDraft, style}) { // fn#92712, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:1130, offset: 0x02095fe7, size: 2054 bytes, params: 2, frame: 33 var r14; var moduleValue6; var moduleValue7; var channelName; var channelIconWithGuild; var isThread2; var formatToPlainString; var recipientId; var moduleValue9; const styles = useStyles(); let useStateFromStores = FluxModule.useStateFromStores; const value3 = Reflect.apply(useStateFromStores, FluxModule, [[GatewayConnectionStore], function() { return GatewayConnectionStore.isConnected(); }]); useStateFromStores = FluxModule.useStateFromStores; const channelStoreBinding = ChannelStore; const value4 = Reflect.apply(useStateFromStores, FluxModule, [[channelStoreBinding], _fun92714]); const guild = FluxModule.useStateFromStores([GuildStore], _fun92715); const value5 = FluxModule.useStateFromStores([channelStoreBinding], _fun92716, [value4, threadDraft]); const value6 = (NavigationPathUtilsModule).useSelectedSpecialNavigationPath(); const value7 = (UseIsViewingPremiumMemberships)(); const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; const string = intl.string; const t = (require(1244) /* metro dependency 1244: indexNative */).t; const r13 = value3 ? Reflect.apply(string, intl, [t.ai6Lbr]) : Reflect.apply(string, intl, [t.ZTNur7]); const SpecialNavigationPath = (NavigationPathUtilsModule).SpecialNavigationPath; const FRIENDS = SpecialNavigationPath.FRIENDS; if (value6 === FRIENDS) { return ( ); } const GUILD_HOME = StaticChannelRoute.GUILD_HOME; if (channelId === GUILD_HOME) { return ( )((require(1305) /* metro dependency 1305: native */).Icon)} /> ); } const MEMBER_SAFETY = StaticChannelRoute.MEMBER_SAFETY; if (channelId === MEMBER_SAFETY) { return ( )((require(1305) /* metro dependency 1305: native */).Icon)} /> ); } if (value7) { return ( )(importDefault(5475) /* metro dependency 5475: FastImage */)} /> ); } if (threadDraft == null) { moduleValue6 = require(8581) /* metro dependency 8581: AgeGateUtils */; if (moduleValue6.shouldNSFWGateGuild(guildId)) { return ( ); } if (value4 == null) { return ( ); } moduleValue7 = require(4805) /* metro dependency 4805: useChannelName */; channelName = moduleValue7.computeChannelName(value4, UserStore, RelationshipStore); channelIconWithGuild = (require(6647) /* metro dependency 6647: ChannelUtils */).getChannelIconWithGuild(value4, guild); if (value4.isDM()) { recipientId = value4.getRecipientId(); return ( } icon={channelIconWithGuild} titleSuffix={value4.isSystemDM() ? null : ( )} subTitle={((Component) => )(importDefault(8829) /* metro dependency 8829: ActivityStatus */)} /> ); } isThread2 = value4.isThread(); formatToPlainString = intl.formatToPlainString; if (isThread2) { return ( } /> ); } return ( ); } if (value4 == null) { r14 = threadDraft.name == null ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t['4WNcpu']) : threadDraft.name.length > 0 ? threadDraft.name : intl.string((require(1244) /* metro dependency 1244: indexNative */).t['4WNcpu']); moduleValue9 = require(6647) /* metro dependency 6647: ChannelUtils */; return ( } /> ); } if (value4.isForumLikeChannel()) { moduleValue6 = require(8581) /* metro dependency 8581: AgeGateUtils */; if (moduleValue6.shouldNSFWGateGuild(guildId)) { return ( ); } if (value4 == null) { return ( ); } moduleValue7 = require(4805) /* metro dependency 4805: useChannelName */; channelName = moduleValue7.computeChannelName(value4, UserStore, RelationshipStore); channelIconWithGuild = (require(6647) /* metro dependency 6647: ChannelUtils */).getChannelIconWithGuild(value4, guild); if (value4.isDM()) { recipientId = value4.getRecipientId(); return ( } icon={channelIconWithGuild} titleSuffix={value4.isSystemDM() ? null : ( )} subTitle={((Component) => )(importDefault(8829) /* metro dependency 8829: ActivityStatus */)} /> ); } isThread2 = value4.isThread(); formatToPlainString = intl.formatToPlainString; if (isThread2) { return ( } /> ); } return ( ); } r14 = threadDraft.name == null ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t['4WNcpu']) : threadDraft.name.length > 0 ? threadDraft.name : intl.string((require(1244) /* metro dependency 1244: indexNative */).t['4WNcpu']); moduleValue9 = require(6647) /* metro dependency 6647: ChannelUtils */; const getThreadChannelIcon = moduleValue9.getThreadChannelIcon; return ( } /> ); function _fun92714() { // fn#92714, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:1303, offset: 0x020967ed, size: 66 bytes, params: 1, frame: 14 const channelIdBinding = channelId; const GUILD_HOME = StaticChannelRoute.GUILD_HOME; return channelIdBinding === GUILD_HOME || channelId === StaticChannelRoute.MEMBER_SAFETY ? null : ChannelStore.getChannel(channelId); } function _fun92715() { // fn#92715, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:1403, offset: 0x0209682f, size: 52 bytes, params: 1, frame: 13 const value = environment.__proto__; return GuildStore.getGuild(env0_2?.getGuildId()); } function _fun92716() { // fn#92716, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:1486, offset: 0x02096863, size: 145 bytes, params: 1, frame: 15 const threadDraftBinding = threadDraft; const value2 = null; return value2 == threadDraftBinding ? value2 != env0_2 && value2 != env0_2.parent_id && THREAD_CHANNEL_TYPES.has(env0_2.type) ? ChannelStore.getChannel(env0_2.parent_id) : value2 : value2 != threadDraft.parentChannelId ? ChannelStore.getChannel(threadDraft.parentChannelId) : value2 != env0_2 && value2 != env0_2.parent_id && THREAD_CHANNEL_TYPES.has(env0_2.type) ? ChannelStore.getChannel(env0_2.parent_id) : value2; } } function ChannelTitleWrapper({children, onPressTitle, style}) { // fn#92717, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:4288, offset: 0x020968f4, size: 174 bytes, params: 2, frame: 20 const styles = useStyles(); if (onPressTitle == null) { return ( {children} ); } else { const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity; return ( {children} ); } } function ChannelTitleContent({title, icon, titleSuffix, subTitle, accessibleTitle}) { // fn#92719, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:4565, offset: 0x020969a2, size: 403 bytes, params: 2, frame: 25 const styles = useStyles(); const r5 = ( icon != null ? ( env0_3.isValidElement(icon) ? icon : ((Icon) => )((require(1305) /* metro dependency 1305: native */).Icon) ) : null ); const binding = env0_3; return ( {r5} { binding.isValidElement(title) ? title : ( {((Text) => {title})((require(4573) /* metro dependency 4573: Text */).Text)} ) } {titleSuffix} {subTitle} ); } function ParentChannelSubTitle_92720({parentChannel}) { // fn#92720, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:5214, offset: 0x02096b35, size: 216 bytes, params: 2, frame: 27 const styles = useStyles(); const Text = (TextModule).Text; const intl = (IndexNativeModule).intl; const formatToPlainString = intl.formatToPlainString; const BjYvHO = (IndexNativeModule).t.BjYvHO; const computeChannelName = UseChannelNameModule.computeChannelName; const userStoreBinding = UserStore; const relationshipStoreBinding = RelationshipStore; return ( {UseChannelNameModule.computeChannelName(parentChannel, userStoreBinding, relationshipStoreBinding, true)} ); } function DMChannelName({userId, style}) { // fn#92721, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:5568, offset: 0x02096c0d, size: 206 bytes, params: 2, frame: 21 const value2 = (FluxModule).useStateFromStores([UserStore, RelationshipStore], _fun92722, [userId]); const LegacyText = (NativeModule).LegacyText; const intl = (IndexNativeModule).intl; return ( {value2} ); function _fun92722() { // fn#92722, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:5632, offset: 0x02096cdb, size: 95 bytes, params: 1, frame: 14 var r1; let value = environment.__proto__; const relationshipStoreBinding = RelationshipStore; const getNickname = relationshipStoreBinding.getNickname; const userIdBinding = userId; const value3 = Reflect.apply(getNickname, relationshipStoreBinding, [userIdBinding]); if (value3 != null) { r1 = value3; } else { value = importDefault(3995) /* metro dependency 3995: UserUtils */; value = value.getName(UserStore.getUser(userIdBinding)); r1 = value; } return r1 ?? ''; } } function ConnectedStatus({style, userId}) { // fn#92723, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:5959, offset: 0x02096d3a, size: 178 bytes, params: 2, frame: 21 const {status, isMobileOnline, isVROnline, streaming} = (FluxModule).useStateFromStoresObject([PresenceStore], _fun92724); const Status = (NativeModule).Status; const StatusSizes = (NativeModule).StatusSizes; const SMALL = StatusSizes.SMALL; return ( ); function _fun92724() { // fn#92724, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:6027, offset: 0x02096dec, size: 108 bytes, params: 1, frame: 14 const object = {}; let value = environment.__proto__; const presenceStoreBinding = PresenceStore; const getStatus = presenceStoreBinding.getStatus; const userIdBinding = userId; object.status = Reflect.apply(getStatus, presenceStoreBinding, [userIdBinding]); object.isMobileOnline = presenceStoreBinding.isMobileOnline(userIdBinding); object.isVROnline = presenceStoreBinding.isVROnline(userIdBinding); value = importDefault(8419) /* metro dependency 8419: isStreaming */; const getActivities = presenceStoreBinding.getActivities; object.streaming = value(Reflect.apply(getActivities, presenceStoreBinding, [userIdBinding])); return object; } } function ChannelTitleWithoutRoute({onPressTitle, channelId}) { // fn#92725, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:6453, offset: 0x02096e58, size: 538 bytes, params: 2, frame: 25 var r13; var moduleValue4; var recipientId; const styles = useStyles(); const channel = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() { return ChannelStore.getChannel(channelId); }); const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GatewayConnectionStore], function() { return GatewayConnectionStore.isConnected(); }); const intl = (IndexNativeModule).intl; const string = intl.string; const t = (IndexNativeModule).t; let r12 = value2 ? Reflect.apply(string, intl, [t.ai6Lbr]) : Reflect.apply(string, intl, [t.ZTNur7]); const r8 = channel != null ? (require(6647) /* metro dependency 6647: ChannelUtils */).getChannelIcon(channel) : null; if (channel != null) { moduleValue4 = require(4805) /* metro dependency 4805: useChannelName */; r13 = moduleValue4.computeChannelName(channel, UserStore, RelationshipStore); } else { r13 = null; } if (channel != null) { if (channel.isDM()) { recipientId = channel.getRecipientId(); return ( } icon={r8} titleSuffix={channel.isSystemDM() ? null : ( )} subTitle={((Component) => )(importDefault(8829) /* metro dependency 8829: ActivityStatus */)} /> ); } } r12 = r13 ?? r12; return ( ); } function ChannelButtons({buttons, style}) { // fn#92728, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:7269, offset: 0x02097072, size: 75 bytes, params: 2, frame: 17 return ( {buttons?.map(_fun92729)} ); function _fun92729({onPress, onLongPress, source, color, style, accessibilityLabel, children, disabled, hasActivitiesPrivateChannelTooltip}, a1) { // fn#92729, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:7336, offset: 0x020970bd, size: 288 bytes, params: 3, frame: 29 var environment; const value = environment.__proto__; return ( {((Component) => {children})(importDefault(8792) /* metro dependency 8792: TouchableHitBox */)} { hasActivitiesPrivateChannelTooltip ? ((Component) => {children_92731})(importDefault(10357) /* metro dependency 10357: SelectedDismissibleContent */) : null } ); function children_92731({visibleContent, markAsDismissed}) { // fn#92731, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12253:7909, offset: 0x02097248, size: 110 bytes, params: 2, frame: 16 var environment; var r0; let value = environment.__proto__.__proto__; const DismissibleContent = (Dismissible_contentModule).DismissibleContent; const ACTIVITY_GDM_CALL_TOOLTIP = DismissibleContent.ACTIVITY_GDM_CALL_TOOLTIP; if (visibleContent !== ACTIVITY_GDM_CALL_TOOLTIP) { r0 = null; } else { value = importDefault(12071) /* metro dependency 12071: ActivitiesPrivateChannelCallTooltip */; value = ((Component) => )(value); r0 = value; } return r0; } } } } global.__d(_fun92711, 12067, [31, 27, 4257, 1383, 1379, 1867, 4396, 3793, 1878, 661, 1386, 1376, 33, 4501, 6597, 697, 566, 1244, 6647, 4805, 8829, 12068, 12069, 1305, 9713, 12070, 5475, 9711, 8581, 5278, 4573, 3995, 8419, 8792, 3968, 1365, 10357, 12071, 2]) /* metro module 12067, dependencies: [31, 27, 4257, 1383, 1379, 1867, 4396, 3793, 1878, 661, 1386, 1376, 33, 4501, 6597, 697, 566, 1244, 6647, 4805, 8829, 12068, 12069, 1305, 9713, 12070, 5475, 9711, 8581, 5278, 4573, 3995, 8419, 8792, 3968, 1365, 10357, 12071, 2] */;