/* Metro module 12401; source: modules/calls/NativeMuteManager.native.tsx; dependencies: [6, 7, 9229, 4259, 3, 4041, 694, 8899, 4261, 2] */ import Logger from '../debug/Logger.tsx'; /* Metro dependency 3 */ import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */ import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */ import MediaEngineStore from '../../stores/MediaEngineStore.tsx'; /* Metro dependency 4259 */ import AudioRouteStoreNative from '../voice_calls/AudioRouteStore.native.tsx'; /* Metro dependency 9229 */ import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as TimersModule from '../../external/discord_common/js/packages/timers/Timers.tsx'; /* Metro dependency 4041 */ function _fun94506(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#94506, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12587:6, offset: 0x0211aaf6, size: 278 bytes, params: 8, frame: 20 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = Logger; value = new value('NativeMuteManager'); value.enableNativeLogger(true); value = _fun94507(); value = new value(); value = _fun94514(); value = new value(); (FileImportTrackerModule).fileFinishedImporting('modules/calls/NativeMuteManager.native.tsx'); exports.default = value; function _fun94507() { // fn#94507, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12587:207, offset: 0x0211ac0c, size: 109 bytes, params: 1, frame: 15 return CreateClass(NativeMuteManager, [{key: 'nativeMuteChanged', value: value_94511}, {key: 'updateNativeMute', value: value_94512}, {key: 'handleVoiceChannelSelect', value: value_94513}]); function NativeMuteManager() { // fn#94508, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12587:228, offset: 0x0211ac79, size: 189 bytes, params: 1, frame: 16 var environment; let value = environment.__proto__; env1_3(this, NativeMuteManager); this.ignoreForNativeUnmute = false; this.needToUnmuteNative = false; this.ignoreForAudioRouteChange = false; const Timeout = (TimersModule).Timeout; const value3 = Object.create(Timeout.prototype, {constructor: {value: Timeout}}); const timeout = new Timeout(); this.audioRouteChangeIgnoreTimer = timeout instanceof Object ? timeout : value3; this.AUDIO_ROUTE_CHANGE_IGNORE_DURATION_MS = 300; this.handleAudioRouteChange = handleAudioRouteChange; const audioRouteStoreNativeBinding = AudioRouteStoreNative; const addChangeListener = audioRouteStoreNativeBinding.addChangeListener; var handleAudioRouteChange = this.handleAudioRouteChange; Reflect.apply(addChangeListener, audioRouteStoreNativeBinding, [handleAudioRouteChange]); value = importDefault(694) /* metro dependency 694: Dispatcher */; value.subscribe('VOICE_CHANNEL_SELECT', this.handleVoiceChannelSelect); function handleAudioRouteChange() { // fn#94509, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12587:503, owner: NativeMuteManager.handleAudioRouteChange, offset: 0x0211ad36, size: 94 bytes, params: 1, frame: 13 let audioRouteChangeIgnoreTimer = env0_0.audioRouteChangeIgnoreTimer; if (audioRouteChangeIgnoreTimer.isStarted()) { env0_0.audioRouteChangeIgnoreTimer.stop(); } const binding = env0_0; binding.ignoreForAudioRouteChange = true; audioRouteChangeIgnoreTimer = binding.audioRouteChangeIgnoreTimer; const start = audioRouteChangeIgnoreTimer.start; const AUDIO_ROUTE_CHANGE_IGNORE_DURATION_MS = binding.AUDIO_ROUTE_CHANGE_IGNORE_DURATION_MS; Reflect.apply(start, audioRouteChangeIgnoreTimer, [AUDIO_ROUTE_CHANGE_IGNORE_DURATION_MS, _fun94510]); function _fun94510() { // fn#94510, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12587:711, offset: 0x0211ad94, size: 19 bytes, params: 1, frame: 2 env1_0.ignoreForAudioRouteChange = false; } } } function value_94511() { // fn#94511, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12587:909, offset: 0x0211ada7, size: 126 bytes, params: 1, frame: 13 const value = environment.__proto__; const mediaEngineStoreBinding = MediaEngineStore; if (!mediaEngineStoreBinding.hasActiveCallKitCall()) { if (this.ignoreForNativeUnmute) { this.ignoreForNativeUnmute = false; } else if (!this.ignoreForAudioRouteChange) { this.needToUnmuteNative = true; env1_7.log('Native mute changed > toggling mute'); (importDefault(8899) /* metro dependency 8899: AudioActionCreators */).toggleSelfMute({playSoundEffect: false}); } } } function value_94512() { // fn#94512, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12587:1188, offset: 0x0211ae25, size: 128 bytes, params: 1, frame: 14 var setNativeMuteState; let value = environment.__proto__; const mediaEngineStoreBinding = MediaEngineStore; if (!mediaEngineStoreBinding.hasActiveCallKitCall()) { if (this.needToUnmuteNative) { this.needToUnmuteNative = false; this.ignoreForNativeUnmute = true; env1_7.log('Update native mute > unmuting native'); value = require(4261) /* metro dependency 4261: inject */; value = value.getVoiceEngine(); setNativeMuteState = value.setNativeMuteState; if (setNativeMuteState != null) { setNativeMuteState.call(value, false); } } } } function value_94513({channelId}) { // fn#94513, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12587:1475, offset: 0x0211aea5, size: 97 bytes, params: 2, frame: 14 var value; var setNativeMuteState; if (channelId == null) { value = environment.__proto__; env1_7.log('Leaving voice channel > unmuting native'); value = require(4261) /* metro dependency 4261: inject */; value = value.getVoiceEngine(); setNativeMuteState = value.setNativeMuteState; if (setNativeMuteState != null) { setNativeMuteState.call(value, false); } } } } function _fun94514() { // fn#94514, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12587:1653, offset: 0x0211af06, size: 84 bytes, params: 1, frame: 15 return CreateClass(NativeMuteManagerWrapper, [{key: 'nativeMuteChanged', value: value_94516}, {key: 'updateNativeMute', value: value_94517}]); function NativeMuteManagerWrapper() { // fn#94515, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12587:1674, offset: 0x00c61ad8, size: 27 bytes, params: 1, frame: 13 env1_3(this, NativeMuteManagerWrapper); } function value_94516(a0) { // fn#94516, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12587:1777, offset: 0x0211af5a, size: 25 bytes, params: 2, frame: 11 env1_8.nativeMuteChanged(a0); } function value_94517() { // fn#94517, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12587:1844, offset: 0x0211af73, size: 21 bytes, params: 1, frame: 9 env1_8.updateNativeMute(); } } } global.__d(_fun94506, 12401, [6, 7, 9229, 4259, 3, 4041, 694, 8899, 4261, 2]) /* metro module 12401, dependencies: [6, 7, 9229, 4259, 3, 4041, 694, 8899, 4261, 2] */;