/* Metro module 15276; source: modules/soundplayer/SoundPlayer.tsx; dependencies: [31, 1378, 8065, 4295, 1383, 4492, 1226, 1379, 1867, 4259, 10907, 4294, 1934, 4607, 4297, 4300, 661, 33, 566, 10756, 4802, 4285, 3774, 1360, 2] */ function _fun116798(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#116798, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:6, offset: 0x02496d14, size: 585 bytes, params: 8, frame: 19 let env0_0 = require; const useSound = function(a0, a1, a2, a3) { var env0_0 = a0; var env0_1 = a1; a2.useEffect(_fun116800); }; const MuteDeafen = function() { useSound([MediaEngineStore, SelectedChannelStore], _fun116804, _fun116805); return null; }; const Camera_116806 = function() { useSound([MediaEngineStore, SelectedChannelStore], _fun116807, _fun116808); return null; }; const RTCConnect = function() { useSound([ChannelStore, RTCConnectionStore, SelectedChannelStore, GameConsoleStore], _fun116810, _fun116811); return null; }; const Speaking = function() { useSound([SpeakingStore], _fun116813, _fun116814); return null; }; const SelfMutedTemporarily = function() { useSound([MediaEngineStore], _fun116816, _fun116817); return null; }; const PriorityVAD = function() { useSound([SpeakingStore], _fun116819, _fun116820); return null; }; const UserHasBeenMoved = function() { useSound([VoiceStateStore], _fun116822, _fun116823); return null; }; const UserInvitedToSpeak = function() { useSound([SelectedChannelStore, VoiceStateStore], _fun116825, _fun116826); return null; }; const VoiceChannel = function() { useSound([SelectedChannelStore, ApplicationStreamingStore, AuthenticationStore, VoiceStateStore, ChannelStore], _fun116828, _fun116831); return null; }; const ActivitySounds = function() { useSound([SelectedChannelStore, EmbeddedActivitiesStore, FramesStore, AuthenticationStore], _fun116836, _fun116837); return null; }; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_2 = importAll(31) /* metro dependency 31 */; const embeddedActivitiesStore = importDefault(1378) /* metro dependency 1378: EmbeddedActivitiesStore */; const env0_4 = (require(1378) /* metro dependency 1378: EmbeddedActivitiesStore */).NO_ACTIVITIES; const framesStore = importDefault(8065) /* metro dependency 8065: FramesStore */; const gameConsoleStore = importDefault(4295) /* metro dependency 4295: GameConsoleStore */; const env0_7 = (require(1383) /* metro dependency 1383: ChannelRecord */).SILENT_JOIN_LEAVE_CHANNEL_TYPES; const applicationStreamingStore = importDefault(4492) /* metro dependency 4492: ApplicationStreamingStore */; const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */; const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */; const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */; const mediaEngineStore = importDefault(4259) /* metro dependency 4259: MediaEngineStore */; const notificationSettingsStore = importDefault(10907) /* metro dependency 10907: NotificationSettingsStore */; const rtcConnectionStore = importDefault(4294) /* metro dependency 4294: RTCConnectionStore */; const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */; const speakingStore = importDefault(4607) /* metro dependency 4607: SpeakingStore */; const voiceStateStore = importDefault(4297) /* metro dependency 4297: VoiceStateStore */; const sortedVoiceStateStore = importDefault(4300) /* metro dependency 4300: SortedVoiceStateStore */; let value = require(661) /* metro dependency 661: Constants */; const env0_19 = value.InputModes; const env0_20 = value.ApplicationStreamStates; const env0_21 = value.RTCConnectionStates; value = require(33) /* metro dependency 33 */; const env0_22 = value.jsx; const env0_23 = value.Fragment; const env0_24 = value.jsxs; (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundplayer/SoundPlayer.tsx'); exports.default = SoundPlayer; } function useSound(a0, a1, a2, a3) { // fn#116799, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:437, offset: 0x02496f5d, size: 51 bytes, params: 5, frame: 11 const env0_0 = a0; const env0_1 = a1; a2.useEffect(_fun116800); } function MuteDeafen() { // fn#116803, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:675, offset: 0x0249708e, size: 56 bytes, params: 1, frame: 15 useSound([MediaEngineStore, SelectedChannelStore], function() { var object = {}; object.inVoiceChannel = SelectedChannelStore.getVoiceChannelId() != null; object.selfMute = MediaEngineStore.isSelfMute(); object.selfDeaf = MediaEngineStore.isSelfDeaf(); object.audioPermissionReady = MediaEngineStore.isNativeAudioPermissionReady(); object.shouldSkipMuteUnmuteSound = MediaEngineStore.shouldSkipMuteUnmuteSound(); return object; }, _fun116805); return null; } function Camera_116806() { // fn#116806, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:1215, offset: 0x024971bb, size: 56 bytes, params: 1, frame: 15 useSound([MediaEngineStore, SelectedChannelStore], _fun116807, function(a0, a1) { var videoEnabled = a1.videoEnabled; if (a0.videoEnabled !== videoEnabled) { if (a0.inVoiceChannel) { if (a1.inVoiceChannel) { return videoEnabled ? 'camera_on' : 'camera_off'; } return undefined; } } }); return null; } function RTCConnect() { // fn#116809, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:1478, offset: 0x0249725f, size: 72 bytes, params: 1, frame: 15 useSound([ChannelStore, RTCConnectionStore, SelectedChannelStore, GameConsoleStore], _fun116810, _fun116811); return null; } function Speaking() { // fn#116812, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:2196, offset: 0x0249741d, size: 48 bytes, params: 1, frame: 15 useSound([SpeakingStore], function() { return SpeakingStore.isCurrentUserPTTActive(); }, _fun116814); return null; } function SelfMutedTemporarily() { // fn#116815, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:2386, offset: 0x024974ad, size: 48 bytes, params: 1, frame: 15 useSound([MediaEngineStore], function() { return MediaEngineStore.isSelfMutedTemporarily(); }, _fun116817); return null; } function PriorityVAD() { // fn#116818, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:2590, offset: 0x0249753b, size: 48 bytes, params: 1, frame: 15 useSound([SpeakingStore], function() { return SpeakingStore.isCurrentUserPrioritySpeaker(); }, _fun116820); return null; } function UserHasBeenMoved() { // fn#116821, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:2791, offset: 0x024975cb, size: 48 bytes, params: 1, frame: 15 useSound([VoiceStateStore], function() { return VoiceStateStore.userHasBeenMovedVersion; }, function(a0, a1) { if (a0 !== a1) { return 'user_moved'; } }); return null; } function UserInvitedToSpeak() { // fn#116824, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:2916, offset: 0x02497620, size: 56 bytes, params: 1, frame: 15 useSound([SelectedChannelStore, VoiceStateStore], _fun116825, function(a0, a1) { if (a0 !== a1) { if (a1 === require(dependencyMap[20]).RequestToSpeakStates.REQUESTED_TO_SPEAK_AND_AWAITING_USER_ACK) { return 'reconnect'; } } }); return null; } function VoiceChannel() { // fn#116827, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:3262, offset: 0x02497702, size: 80 bytes, params: 1, frame: 15 useSound([SelectedChannelStore, ApplicationStreamingStore, AuthenticationStore, VoiceStateStore, ChannelStore], _fun116828, _fun116831); return null; } function ActivitySounds() { // fn#116835, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:5012, offset: 0x02497b22, size: 72 bytes, params: 1, frame: 15 useSound([SelectedChannelStore, EmbeddedActivitiesStore, FramesStore, AuthenticationStore], _fun116836, _fun116837); return null; } function SoundPlayer() { // fn#116841, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:7486, offset: 0x0249811b, size: 195 bytes, params: 1, frame: 18 return ( <> ); } function _fun116800() { // fn#116800, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:477, offset: 0x02496f90, size: 109 bytes, params: 1, frame: 15 const env0_0 = require(); const BatchedStoreListener = (require(566) /* metro dependency 566: flux */).BatchedStoreListener; new BatchedStoreListener(env0_0, _fun116801).attach('useSound'); return _fun116802; } function _fun116805(a0, {inVoiceChannel, selfMute, selfDeaf, audioPermissionReady, shouldSkipMuteUnmuteSound}) { // fn#116805, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:931, offset: 0x02497134, size: 135 bytes, params: 3, frame: 14 var r2; var r0; var selfMute2; var value; var value2; if (inVoiceChannel) { if (a0.selfDeaf !== selfDeaf) { return selfDeaf ? 'deafen' : 'undeafen'; } if (audioPermissionReady) { if (inVoiceChannel) { selfMute2 = a0.selfMute; value = undefined; if (selfMute2 === selfMute) { r0 = value; } else { if (shouldSkipMuteUnmuteSound) { value2 = environment.__proto__; MediaEngineStore.notifyMuteUnmuteSoundWasSkipped(); r2 = value; } else { r2 = selfMute ? 'mute' : 'unmute'; } r0 = r2; } return r0; } if (a0.audioPermissionReady) { selfMute2 = a0.selfMute; value = undefined; if (selfMute2 === selfMute) { r0 = value; } else { if (shouldSkipMuteUnmuteSound) { value2 = environment.__proto__; MediaEngineStore.notifyMuteUnmuteSoundWasSkipped(); r2 = value; } else { r2 = selfMute ? 'mute' : 'unmute'; } r0 = r2; } return r0; } return undefined; } } } function _fun116807() { // fn#116807, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:1256, offset: 0x024971f3, size: 51 bytes, params: 1, frame: 11 const object2 = {}; const value = environment.__proto__; object2.videoEnabled = MediaEngineStore.isVideoEnabled(); object2.inVoiceChannel = SelectedChannelStore.getVoiceChannelId() != null; return object2; } function _fun116810() { // fn#116810, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:1527, offset: 0x024972a7, size: 214 bytes, params: 1, frame: 15 const getChannel = ChannelStore.getChannel; const getVoiceChannelId = SelectedChannelStore.getVoiceChannelId; const value2 = Reflect.apply(getChannel, ChannelStore, [Reflect.apply(getVoiceChannelId, SelectedChannelStore, [])]); const value3 = undefined; const type = value2 == null ? value3 : value2.type; const r4 = value2 == null ? value3 : value2.getGuildId(); const wasEverRtcConnected = RTCConnectionStore.getWasEverRtcConnected(); const state = RTCConnectionStore.getState(); const RTC_CONNECTED = RTCConnectionStates.RTC_CONNECTED; let r3 = !wasEverRtcConnected && state !== RTCConnectionStates.DISCONNECTED; r3 = !r3 ? state === RTCConnectionStates.RTC_CONNECTED : r3; const getAwaitingRemoteSessionInfo = GameConsoleStore.getAwaitingRemoteSessionInfo; const getRemoteSessionId = GameConsoleStore.getRemoteSessionId; return {channelType: type, guildId: r4, connected: state === RTC_CONNECTED, connectHasStarted: r3, awaitingRemote: Reflect.apply(getAwaitingRemoteSessionInfo, GameConsoleStore, []) != null, connectedRemote: Reflect.apply(getRemoteSessionId, GameConsoleStore, []) != null}; } function _fun116811(a0, {channelType, connected, connectHasStarted, awaitingRemote, connectedRemote}) { // fn#116811, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:1900, offset: 0x0249737d, size: 160 bytes, params: 3, frame: 17 var value; const channelType2 = a0.channelType; const connectedRemote2 = a0.connectedRemote; const connected2 = a0.connected; if (!a0.connectHasStarted) { if (connectHasStarted) { if (channelType == null) { return 'user_join'; } value = environment.__proto__; if (SILENT_JOIN_LEAVE_CHANNEL_TYPES.has(channelType)) { return undefined; } return 'user_join'; } } if (connectedRemote) { if (connectedRemote2) { if (connected2) { if (connected) { return undefined; } if (awaitingRemote) { return undefined; } if (connectedRemote) { return undefined; } if (channelType2 == null) { return 'disconnect'; } value = environment.__proto__; if (SILENT_JOIN_LEAVE_CHANNEL_TYPES.has(channelType2)) { return undefined; } return 'disconnect'; } return undefined; } if (channelType == null) { return 'user_join'; } value = environment.__proto__; if (SILENT_JOIN_LEAVE_CHANNEL_TYPES.has(channelType)) { return undefined; } return 'user_join'; } if (connected2) { if (connected) { return undefined; } if (awaitingRemote) { return undefined; } if (connectedRemote) { return undefined; } if (channelType2 == null) { return 'disconnect'; } value = environment.__proto__; if (SILENT_JOIN_LEAVE_CHANNEL_TYPES.has(channelType2)) { return undefined; } return 'disconnect'; } } function _fun116814(a0, a1) { // fn#116814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:2270, offset: 0x02497462, size: 75 bytes, params: 3, frame: 12 if (a0 === a1) { return undefined; } const value = environment.__proto__; const isSelfMute2 = MediaEngineStore.isSelfMute(); const mode = MediaEngineStore.getMode(); const PUSH_TO_TALK = InputModes.PUSH_TO_TALK; if (mode !== PUSH_TO_TALK) { return undefined; } if (isSelfMute2) { return undefined; } return a1 ? 'ptt_start' : 'ptt_stop'; } function _fun116817(a0, a1) { // fn#116817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:2472, offset: 0x024974f0, size: 75 bytes, params: 3, frame: 12 if (a0 === a1) { return undefined; } const value = environment.__proto__; const isSelfMute2 = MediaEngineStore.isSelfMute(); const mode = MediaEngineStore.getMode(); const VOICE_ACTIVITY = InputModes.VOICE_ACTIVITY; if (mode !== VOICE_ACTIVITY) { return undefined; } if (isSelfMute2) { return undefined; } return a1 ? 'ptt_stop' : 'ptt_start'; } function _fun116820(a0, a1) { // fn#116820, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:2673, offset: 0x02497580, size: 75 bytes, params: 3, frame: 12 if (a0 === a1) { return undefined; } const value = environment.__proto__; const isSelfMute2 = MediaEngineStore.isSelfMute(); const mode = MediaEngineStore.getMode(); const VOICE_ACTIVITY = InputModes.VOICE_ACTIVITY; if (mode !== VOICE_ACTIVITY) { return undefined; } if (isSelfMute2) { return undefined; } return a1 ? 'ptt_start' : 'ptt_stop'; } function _fun116825() { // fn#116825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:2969, offset: 0x02497658, size: 109 bytes, params: 1, frame: 13 const value = environment.__proto__; const voiceChannelId = SelectedChannelStore.getVoiceChannelId(); if (voiceChannelId == null) { return (require(4802) /* metro dependency 4802: useAudienceRequestToSpeakState */).RequestToSpeakStates.NONE; } return (require(4802) /* metro dependency 4802: useAudienceRequestToSpeakState */).getAudienceRequestToSpeakState(VoiceStateStore.getVoiceStateForChannel(voiceChannelId)); } function _fun116828() { // fn#116828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:3315, offset: 0x02497752, size: 391 bytes, params: 1, frame: 24 var environment; var r5; var r6; var r8; var r4; var channel; var type; var countVoiceStatesForChannel; var id; var value8; var isInChannel; var value11; var getAllApplicationStreamsForChannel; var value16; let value = environment.__proto__; const voiceChannelId = SelectedChannelStore.getVoiceChannelId(); const id2 = AuthenticationStore.getId(); const items = []; const allActiveStreams = ApplicationStreamingStore.getAllActiveStreams(); const value5 = null; const value6 = undefined; if (value5 != voiceChannelId) { channel = ChannelStore.getChannel(voiceChannelId); if (value5 != channel) { type = channel.type; countVoiceStatesForChannel = SortedVoiceStateStore.countVoiceStatesForChannel; id = channel.id; value8 = Reflect.apply(countVoiceStatesForChannel, SortedVoiceStateStore, [id]); isInChannel = VoiceStateStore.isInChannel; id = channel.id; value11 = value8 - (Reflect.apply(isInChannel, VoiceStateStore, [id]) ? 1 : 0); getAllApplicationStreamsForChannel = ApplicationStreamingStore.getAllApplicationStreamsForChannel; id = channel.id; r5 = Reflect.apply(getAllApplicationStreamsForChannel, ApplicationStreamingStore, [id]).map(function(a0) { return a0.ownerId; }); r6 = value11; r8 = type; } else { r5 = items; r6 = value6; r8 = value6; } } else { r5 = items; r6 = value6; r8 = value6; } let length = allActiveStreams.length; let r12 = length === 1 ? allActiveStreams[0] : ApplicationStreamingStore.getCurrentUserActiveStream(); const state = value5 == r12 ? value6 : r12.state; const CONNECTING = ApplicationStreamStates.CONNECTING; r12 = state === CONNECTING ? value5 : r12; if (value5 != r12) { value16 = (require(4285) /* metro dependency 4285: StreamKeyUtils */).encodeStreamKey(r12); value = ApplicationStreamingStore.getViewerIds(value16); length = value.filter(_fun116830).length; r4 = value16; } else { length = 0; r4 = value5; } return {channelType: r8, voiceChannelId: voiceChannelId, voiceChannelUserCount: r6, streamingUserIds: r5, singleActiveStreamKey: r4, singleActiveStreamViewerCount: length, currentUserId: id2, allActiveStreams: allActiveStreams}; } function _fun116831(a0, {channelType, voiceChannelId, voiceChannelUserCount, streamingUserIds, singleActiveStreamKey, singleActiveStreamViewerCount, currentUserId}) { // fn#116831, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:3974, offset: 0x024978e4, size: 487 bytes, params: 3, frame: 23 var environment; var r11; var r9; var r6; var r5; var r4; var r3; var r2; var r1; var value2; var getChannel; var value3; var value4; var getGuildId; var value5; var getGuild; var value6; var value7; var afkChannelId; var id; var value8; var has; var value9; var singleActiveStreamKey2; var value10; var some; var value11; var allActiveStreams; var map; var value12; var value13; var value14; var singleActiveStreamViewerCount2; var singleActiveStreamViewerCount3; var value15; var voiceChannelUserCount2; var voiceChannelUserCount3; var voiceChannelUserCount4; var value16; var voiceChannelUserCount5; var voiceChannelUserCount6; var voiceChannelUserCount7; var value17; var singleActiveStreamViewerCount4; var singleActiveStreamViewerCount5; const env0_0 = a0; let value = undefined; var env0_3; if (a0.voiceChannelId === voiceChannelId) { reducibleJoin35: while (true) { if (voiceChannelId == null) { break reducibleJoin35; } value2 = environment.__proto__; getChannel = ChannelStore.getChannel; value3 = Reflect.apply(getChannel, ChannelStore, [voiceChannelId]); value4 = false; reducibleJoin7: while (true) { if (value3 == null) { r9 = value4; break reducibleJoin7; } getGuildId = value3.getGuildId; value5 = Reflect.apply(getGuildId, value3, []); if (value5 == null) { r9 = value4; break reducibleJoin7; } getGuild = GuildStore.getGuild; value6 = Reflect.apply(getGuild, GuildStore, [value5]); value7 = value6 != null; reducibleJoin6: while (true) { if (value7) { afkChannelId = value6.afkChannelId; id = value3.id; value8 = afkChannelId === id; r11 = value8; break reducibleJoin6; } r11 = value7; break reducibleJoin6; } r9 = r11; break reducibleJoin7; } if (!r9) { if (channelType != null) { has = SILENT_JOIN_LEAVE_CHANNEL_TYPES.has; reducibleJoin10: while (true) { if (Reflect.apply(has, SILENT_JOIN_LEAVE_CHANNEL_TYPES, [channelType])) { break reducibleJoin35; } break reducibleJoin10; } } value9 = singleActiveStreamKey != null; reducibleJoin12: while (true) { if (value9) { singleActiveStreamKey2 = a0.singleActiveStreamKey; value10 = singleActiveStreamKey2 === singleActiveStreamKey; r9 = value10; break reducibleJoin12; } r9 = value9; break reducibleJoin12; } some = streamingUserIds.some; value11 = Reflect.apply(some, streamingUserIds, [_fun116832]); allActiveStreams = a0.allActiveStreams; map = allActiveStreams.map; env0_3 = Reflect.apply(map, allActiveStreams, [function(a0) { return a0.ownerId; }]); streamingUserIds = a0.streamingUserIds; some = streamingUserIds.some; value12 = Reflect.apply(some, streamingUserIds, [_fun116834]); value13 = 'stream_started'; reducibleJoin34: while (true) { if (value11) { r1 = value13; break reducibleJoin34; } value14 = 'stream_ended'; reducibleJoin33: while (true) { if (value12) { r2 = value14; break reducibleJoin33; } singleActiveStreamViewerCount2 = a0.singleActiveStreamViewerCount; reducibleJoin32: while (true) { reducibleJoin31: while (true) { if (singleActiveStreamViewerCount2 <= 25) { if (r9) { singleActiveStreamViewerCount3 = a0.singleActiveStreamViewerCount; value15 = 'stream_user_joined'; if (singleActiveStreamViewerCount > singleActiveStreamViewerCount3) { r3 = value15; break reducibleJoin32; } } if (a0.voiceChannelUserCount != null) { if (voiceChannelUserCount != null) { voiceChannelUserCount3 = a0.voiceChannelUserCount; if (voiceChannelUserCount3 <= 25) { voiceChannelUserCount4 = a0.voiceChannelUserCount; value16 = 'user_join'; if (voiceChannelUserCount > voiceChannelUserCount4) { r4 = value16; break reducibleJoin31; } } } } reducibleJoin30: while (true) { reducibleJoin29: while (true) { if (a0.voiceChannelUserCount == null) { if (a0.singleActiveStreamViewerCount <= 25) { if (r9) { singleActiveStreamViewerCount5 = a0.singleActiveStreamViewerCount; if (singleActiveStreamViewerCount < singleActiveStreamViewerCount5) { value = 'stream_user_left'; r6 = value; break reducibleJoin29; } r6 = value; break reducibleJoin29; } r6 = value; break reducibleJoin29; } r6 = value; break reducibleJoin29; } if (voiceChannelUserCount != null) { voiceChannelUserCount6 = a0.voiceChannelUserCount; if (voiceChannelUserCount6 <= 25) { voiceChannelUserCount7 = a0.voiceChannelUserCount; value17 = 'user_leave'; if (voiceChannelUserCount < voiceChannelUserCount7) { r5 = value17; break reducibleJoin30; } } } singleActiveStreamViewerCount4 = a0.singleActiveStreamViewerCount; if (singleActiveStreamViewerCount4 <= 25) { if (r9) { singleActiveStreamViewerCount5 = a0.singleActiveStreamViewerCount; if (singleActiveStreamViewerCount < singleActiveStreamViewerCount5) { value = 'stream_user_left'; r6 = value; break reducibleJoin29; } r6 = value; break reducibleJoin29; } r6 = value; break reducibleJoin29; } r6 = value; break reducibleJoin29; } r5 = r6; break reducibleJoin30; } r4 = r5; break reducibleJoin31; } voiceChannelUserCount2 = a0.voiceChannelUserCount; if (voiceChannelUserCount2 != null) { if (voiceChannelUserCount != null) { voiceChannelUserCount3 = a0.voiceChannelUserCount; if (voiceChannelUserCount3 <= 25) { voiceChannelUserCount4 = a0.voiceChannelUserCount; value16 = 'user_join'; if (voiceChannelUserCount > voiceChannelUserCount4) { r4 = value16; break reducibleJoin31; } } } } voiceChannelUserCount5 = a0.voiceChannelUserCount; reducibleJoin30: while (true) { reducibleJoin29: while (true) { if (voiceChannelUserCount5 == null) { if (a0.singleActiveStreamViewerCount <= 25) { if (r9) { singleActiveStreamViewerCount5 = a0.singleActiveStreamViewerCount; if (singleActiveStreamViewerCount < singleActiveStreamViewerCount5) { value = 'stream_user_left'; r6 = value; break reducibleJoin29; } r6 = value; break reducibleJoin29; } r6 = value; break reducibleJoin29; } r6 = value; break reducibleJoin29; } if (voiceChannelUserCount != null) { voiceChannelUserCount6 = a0.voiceChannelUserCount; if (voiceChannelUserCount6 <= 25) { voiceChannelUserCount7 = a0.voiceChannelUserCount; value17 = 'user_leave'; if (voiceChannelUserCount < voiceChannelUserCount7) { r5 = value17; break reducibleJoin30; } } } singleActiveStreamViewerCount4 = a0.singleActiveStreamViewerCount; if (singleActiveStreamViewerCount4 <= 25) { if (r9) { singleActiveStreamViewerCount5 = a0.singleActiveStreamViewerCount; if (singleActiveStreamViewerCount < singleActiveStreamViewerCount5) { value = 'stream_user_left'; r6 = value; break reducibleJoin29; } r6 = value; break reducibleJoin29; } r6 = value; break reducibleJoin29; } r6 = value; break reducibleJoin29; } r5 = r6; break reducibleJoin30; } r4 = r5; break reducibleJoin31; } r3 = r4; break reducibleJoin32; } r2 = r3; break reducibleJoin33; } r1 = r2; break reducibleJoin34; } return r1; } break reducibleJoin35; } } return value; } function _fun116836() { // fn#116836, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:5065, offset: 0x02497b6a, size: 349 bytes, params: 1, frame: 19 const voiceChannelId = SelectedChannelStore.getVoiceChannelId(); const channelId = SelectedChannelStore.getChannelId(); const connectedActivityLocation = EmbeddedActivitiesStore.getConnectedActivityLocation(); const embeddedActivityLocationChannelId = (require(3774) /* metro dependency 3774: embeddedActivityLocationUtils */).getEmbeddedActivityLocationChannelId(connectedActivityLocation); const id = AuthenticationStore.getId(); const globalUtilsModule = require(1360) /* metro dependency 1360: GlobalUtils */; const r3 = globalUtilsModule.isNotNullish(channelId) ? EmbeddedActivitiesStore.getEmbeddedActivitiesForChannel(channelId) : NO_ACTIVITIES; const moduleValue3 = globalUtilsModule; const r2 = moduleValue3.isNotNullish(voiceChannelId) ? EmbeddedActivitiesStore.getEmbeddedActivitiesForChannel(voiceChannelId) : NO_ACTIVITIES; const object2 = {connectedActivityLocation: connectedActivityLocation, voiceChannelId: voiceChannelId, currentUserId: id, channelActivities: r3}; const moduleValue4 = globalUtilsModule; object2.connectedChannelActivities = moduleValue4.isNotNullish(embeddedActivityLocationChannelId) ? EmbeddedActivitiesStore.getEmbeddedActivitiesForChannel(embeddedActivityLocationChannelId) : NO_ACTIVITIES; object2.userConnectedActivity = globalUtilsModule.isNotNullish(connectedActivityLocation) ? EmbeddedActivitiesStore.getSelfEmbeddedActivityForLocation(connectedActivityLocation) : null; object2.voiceChannelActivities = r2; object2.connectedFrame = FramesStore.getConnectedFrame(); return object2; } function _fun116837(a0, {connectedActivityLocation, voiceChannelId, currentUserId, channelActivities, connectedChannelActivities, userConnectedActivity, voiceChannelActivities, connectedFrame}) { // fn#116837, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:5684, offset: 0x02497cc7, size: 1016 bytes, params: 3, frame: 25 var r14; var r8; var r0; var r2; var r4; var r7; var r6; var r1; var value4; var value5; var value6; var moduleValue2; var userIds; var size; var userConnectedActivity2; let value = voiceChannelActivities.some(_fun116838); const globalUtilsModule = require(1360) /* metro dependency 1360: GlobalUtils */; if (globalUtilsModule.isNotNullish(voiceChannelId)) { value4 = a0.voiceChannelActivities.find(function({userIds}) { return userIds.has(currentUserId); }); value5 = voiceChannelActivities.find(_fun116840); value6 = a0.voiceChannelActivities.length < voiceChannelActivities.length; if (value6) { moduleValue2 = globalUtilsModule; r14 = moduleValue2.isNotNullish(a0.voiceChannelId); } else { r14 = value6; } r8 = r14 ? 'activity_launch' : undefined; r14 = value5 === undefined && (require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish(value4); r8 = r14 ? 'activity_end' : r8; r14 = value4 === undefined && (require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish(value5); r14 = r14 && value5.userIds.size > 1; r8 = r14 ? 'activity_user_join' : r8; r14 = (require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish(value5) && (require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish(value4); if (r14) { userIds = value5.userIds; size = userIds.size; userIds = value4.userIds; r8 = size > userIds.size ? 'activity_user_join' : r8; userIds = value5.userIds; size = userIds.size; userIds = value4.userIds; r8 = size < userIds.size ? 'activity_user_left' : r8; r0 = r8; } else { r0 = r8; } } else { r0 = undefined; } if (value) { r8 = r0; } else { value = a0.connectedChannelActivities.length < connectedChannelActivities.length; r0 = value && a0.channelActivities.length < channelActivities.length ? 'activity_launch' : r0; userConnectedActivity2 = a0.userConnectedActivity; value = userConnectedActivity == null; if (value) { value = globalUtilsModule; value = value.isNotNullish(userConnectedActivity2); r4 = value; } else { r4 = value; } r0 = r4 ? 'activity_end' : r0; value = require(1360) /* metro dependency 1360: GlobalUtils */; value = value.isNotNullish(userConnectedActivity); if (value) { value = require(1360) /* metro dependency 1360: GlobalUtils */; value = value.isNotNullish(userConnectedActivity2); r4 = value; } else { r4 = value; } if (r4) { userIds = userConnectedActivity.userIds; size = userIds.size; userIds = userConnectedActivity2.userIds; r0 = size > userIds.size ? 'activity_user_join' : r0; userIds = userConnectedActivity.userIds; size = userIds.size; userIds = userConnectedActivity2.userIds; r0 = size < userIds.size ? 'activity_user_left' : r0; r8 = r0; } else { r8 = r0; } } r0 = r8 != null || a0.connectedActivityLocation == null && connectedActivityLocation == null; if (r0) { r2 = r8; } else { if (a0.connectedActivityLocation != null) { if (a0.connectedActivityLocation == null) { r7 = userConnectedActivity != null && a0.userConnectedActivity != null; if (r7) { userIds = a0.userConnectedActivity.userIds; size = userIds.size; userIds = userConnectedActivity.userIds; if (size < userIds.size) { r7 = 'activity_user_join'; } else { userIds = a0.userConnectedActivity.userIds; size = userIds.size; userIds = userConnectedActivity.userIds; r8 = size > userIds.size ? 'activity_user_leave' : r8; r7 = r8; } r6 = r7; } else { r6 = r8; } r1 = r6; } else if (connectedActivityLocation == null) { r1 = 'activity_end'; } else { r7 = userConnectedActivity != null && a0.userConnectedActivity != null; if (r7) { userIds = a0.userConnectedActivity.userIds; size = userIds.size; userIds = userConnectedActivity.userIds; if (size < userIds.size) { r7 = 'activity_user_join'; } else { userIds = a0.userConnectedActivity.userIds; size = userIds.size; userIds = userConnectedActivity.userIds; r8 = size > userIds.size ? 'activity_user_leave' : r8; r7 = r8; } r6 = r7; } else { r6 = r8; } r1 = r6; } r0 = r1; } else if (connectedActivityLocation != null) { r0 = 'activity_launch'; } else { if (a0.connectedActivityLocation == null) { r7 = userConnectedActivity != null && a0.userConnectedActivity != null; if (r7) { userIds = a0.userConnectedActivity.userIds; size = userIds.size; userIds = userConnectedActivity.userIds; if (size < userIds.size) { r7 = 'activity_user_join'; } else { userIds = a0.userConnectedActivity.userIds; size = userIds.size; userIds = userConnectedActivity.userIds; r8 = size > userIds.size ? 'activity_user_leave' : r8; r7 = r8; } r6 = r7; } else { r6 = r8; } r1 = r6; } else if (connectedActivityLocation == null) { r1 = 'activity_end'; } else { r7 = userConnectedActivity != null && a0.userConnectedActivity != null; if (r7) { userIds = a0.userConnectedActivity.userIds; size = userIds.size; userIds = userConnectedActivity.userIds; if (size < userIds.size) { r7 = 'activity_user_join'; } else { userIds = a0.userConnectedActivity.userIds; size = userIds.size; userIds = userConnectedActivity.userIds; r8 = size > userIds.size ? 'activity_user_leave' : r8; r7 = r8; } r6 = r7; } else { r6 = r8; } r1 = r6; } r0 = r1; } r2 = r0; } return r2 != null || a0.connectedFrame == null && connectedFrame == null ? r2 : a0.connectedFrame != null ? a0.connectedFrame != null && connectedFrame == null ? 'activity_end' : r2 : connectedFrame != null ? 'activity_launch' : a0.connectedFrame != null && connectedFrame == null ? 'activity_end' : r2; } function _fun116801() { // fn#116801, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:532, offset: 0x02496ffd, size: 126 bytes, params: 1, frame: 18 var value5; var moduleValue2; const defaultImport = importDefault(env0_0, require()); if (!(defaultImport == null || NotificationSettingsStore.isSoundDisabled(defaultImport))) { value5 = environment.__proto__.__proto__; moduleValue2 = require(10756) /* metro dependency 10756: SoundUtils */; moduleValue2.playSound(defaultImport, env1_3 ?? 0.4); } } function _fun116802() { // fn#116802, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:657, offset: 0x0249707b, size: 19 bytes, params: 1, frame: 9 return env0_1.detach(); } function _fun116832(a0) { // fn#116832, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:4401, offset: 0x02497acb, size: 31 bytes, params: 2, frame: 11 const streamingUserIds = env0_0.streamingUserIds; return !streamingUserIds.includes(a0); } function _fun116834(a0) { // fn#116834, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:4506, offset: 0x02497aea, size: 56 bytes, params: 2, frame: 13 return !streamingUserIds.includes(a0) && (a0 === currentUserId || env0_3.includes(a0)); } function _fun116838(a0) { // fn#116838, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15473:5891, offset: 0x024980bf, size: 64 bytes, params: 2, frame: 5 return a0.applicationId === userConnectedActivity?.applicationId && a0.launchId === userConnectedActivity.launchId; }