/* Metro module 14434; source: modules/guilds_bar/native/GuildsBarDirectMessage.tsx; dependencies: [31, 1226, 4258, 1379, 5214, 3793, 1878, 661, 33, 4501, 697, 14395, 566, 9122, 1244, 14397, 4601, 12129, 14435, 9719, 1305, 5475, 2] */ import AuthenticationStore from '../../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */ import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */ import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */ import RelationshipStore from '../../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */ import CallStore from '../../../stores/CallStore.tsx'; /* Metro dependency 4258 */ import GuildReadStateStore from '../../../stores/GuildReadStateStore.tsx'; /* Metro dependency 5214 */ import GuildsBarAnimatedItemWrapper from './GuildsBarAnimatedItemWrapper.tsx'; /* Metro dependency 14395 */ import UseGuildsBarBottomRightBadge from './hooks/useGuildsBarBottomRightBadge.tsx'; /* Metro dependency 14397 */ 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 JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */ import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */ import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */ import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */ import * as GuildsBarAnimatedItemWrapperModule from './GuildsBarAnimatedItemWrapper.tsx'; /* Metro dependency 14395 */ function _fun109238(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#109238, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14631:6, offset: 0x02342934, size: 370 bytes, params: 8, frame: 23 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ReactModule; const createStyles = CreateStylesModule.createStyles; const object2 = {}; let GUILD_BAR_ITEM_SIZE = (importDefault(697) /* metro dependency 697: native */).modules.mobile.GUILD_BAR_ITEM_SIZE; object2.width = GUILD_BAR_ITEM_SIZE; GUILD_BAR_ITEM_SIZE = (importDefault(697) /* metro dependency 697: native */).modules.mobile.GUILD_BAR_ITEM_SIZE; object2.height = GUILD_BAR_ITEM_SIZE; const env0_12 = Reflect.apply(createStyles, CreateStylesModule, [{dm: object2}]); value = value.memo(GuildsBarDirectMessage); (FileImportTrackerModule).fileFinishedImporting('modules/guilds_bar/native/GuildsBarDirectMessage.tsx'); exports.default = value; function GuildsBarDirectMessage({channelId}) { // fn#109239, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14631:349, offset: 0x02342aa6, size: 635 bytes, params: 2, frame: 27 var r4; const AvatarSizes = (NativeModule).AvatarSizes; var value; const styles = useStyles(); const value2 = (GuildsBarAnimatedItemWrapperModule).useGuildsBarAnimatedWrapperStyles({'disableSelectedColor': true, 'disableBGColor': true}); const count = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildReadStateStore], function() { return GuildReadStateStore.getMentionCountForPrivateChannel(channelId).count; }); const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([ChannelStore, UserStore, RelationshipStore, CallStore, AuthenticationStore], _fun109241); const channel = value3.channel; const dmRecipient = value3.dmRecipient; const dmRecipient2 = dmRecipient; const label = value3.label; const {badge, cutouts} = (UseGuildsBarBottomRightBadge)({mentionCount: count}); const binding = dmRecipient2; const value5 = binding.useMemo(_fun109242, [channel, dmRecipient]); const value6 = binding.useMemo(function() { return {onPress: _fun109244, onLongPress: _fun109245}; }, [channel]); const r15 = channel != null && channel.isMultiUserDM(); const r5 = ( channel != null ? ((Component) => )(importDefault(14435) /* metro dependency 14435: HomeDrawerDM */) : null ); if (channel == null) { if (value5 != null) { value = importDefault(5475) /* metro dependency 5475: FastImage */; value = ((Component) => )(value); r4 = value; } else { r4 = null; } } else if (channel.isMultiUserDM()) { r4 = ((Component) => )(importDefault(9719) /* metro dependency 9719: GroupDMAvatar */); } else if (value5 != null) { value = importDefault(5475) /* metro dependency 5475: FastImage */; value = ((Component) => )(value); r4 = value; } else { r4 = null; } return ( {r4} ); function _fun109241() { // fn#109241, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14631:630, offset: 0x02342d43, size: 310 bytes, params: 1, frame: 20 var r1; var intl; var countBinding; let value = environment.__proto__; const channel = ChannelStore.getChannel(channelId); const value4 = undefined; const type = channel == null ? value4 : channel.type; const DM = ChannelTypes.DM; const r3 = type !== DM ? value4 : UserStore.getUser(channel.getRecipientId()); const call = CallStore.getCall(channelId); const id = AuthenticationStore.getId(); const r6 = call != null && id != null && call.ringing.includes(id); callStoreBinding = CallStore; const r5 = callStoreBinding.isCallActive(channelId) && !r6; const object = {channel: channel, dmRecipient: r3}; if (channel != null) { value = importDefault(9122) /* metro dependency 9122: getChannelA11yLabel */; countBinding = count; value = value({channel: channel, unread: countBinding > 0, mentionCount: countBinding, isIncomingCall: r6, isOngoingCall: r5}); r1 = value; } else { intl = (require(1244) /* metro dependency 1244: indexNative */).intl; r1 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.zLZPmk); } object.label = r1; return object; } function _fun109242() { // fn#109242, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14631:1092, offset: 0x02342e79, size: 72 bytes, params: 1, frame: 14 const channelBinding = channel; const value2 = undefined; return channelBinding != null && channel.isDM() ? dmRecipient == null ? value2 : dmRecipient.getAvatarSource(value2) : value2; } function _fun109243() { // fn#109243, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14631:1183, offset: 0x02342ec1, size: 29 bytes, params: 1, frame: 3 return {onPress: onPress_109244, onLongPress: onLongPress_109245}; function onPress_109244() { // fn#109244, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14631:1189, offset: 0x02342ede, size: 62 bytes, params: 1, frame: 12 var value2; var moduleValue; if (channel != null) { value2 = environment.__proto__.__proto__; moduleValue = require(4601) /* metro dependency 4601: transitionToChannel */; moduleValue.transitionToChannel(channel.id); } } function onLongPress_109245() { // fn#109245, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14631:1244, offset: 0x02342f1c, size: 62 bytes, params: 1, frame: 12 var value2; var moduleValue; if (channel != null) { value2 = environment.__proto__.__proto__; moduleValue = require(12129) /* metro dependency 12129: openChannelLongPressActionSheet */; moduleValue.openChannelLongPressActionSheet(channel.id); } } } } } global.__d(_fun109238, 14434, [31, 1226, 4258, 1379, 5214, 3793, 1878, 661, 33, 4501, 697, 14395, 566, 9122, 1244, 14397, 4601, 12129, 14435, 9719, 1305, 5475, 2]) /* metro module 14434, dependencies: [31, 1226, 4258, 1379, 5214, 3793, 1878, 661, 33, 4501, 697, 14395, 566, 9122, 1244, 14397, 4601, 12129, 14435, 9719, 1305, 5475, 2] */;