Files
2026-07-28 01:06:53 +03:00

7248 lines
351 KiB
TypeScript

/* Metro module 4259; source: stores/MediaEngineStore.tsx; dependencies: [6, 7, 15, 17, 18, 57, 5, 4260, 4265, 4107, 4266, 4289, 1348, 1226, 4290, 4293, 1379, 4294, 1878, 12412, 661, 4286, 4661, 12413, 670, 12414, 4291, 3, 672, 477, 4406, 4041, 4662, 12415, 12416, 12417, 10750, 12418, 22, 12401, 12419, 12420, 12421, 12422, 12423, 12424, 9235, 683, 694, 10826, 12425, 12426, 4608, 12427, 12472, 12473, 12474, 12475, 12476, 12477, 12384, 4489, 4488, 3767, 587, 12478, 10269, 6731, 12482, 12483, 1244, 4222, 12484, 12485, 44, 12411, 12486, 12396, 1216, 12382, 10684, 4092, 12487, 12488, 566, 12489, 2] */
import Module00005 from '../by-id/module-00005.js'; /* Metro dependency 5 */
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 PossibleConstructorReturn from '../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import Module00017 from '../by-id/module-00017.js'; /* Metro dependency 17 */
import Inherits from '../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
import Module00022 from '../by-id/module-00022.js'; /* Metro dependency 22 */
import Module00044 from '../by-id/module-00044.js'; /* Metro dependency 44 */
import Module00057 from '../by-id/module-00057.js'; /* Metro dependency 57 */
import Flux from '../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import Durations from '../utils/Durations.tsx'; /* Metro dependency 672 */
import AnalyticsUtils from '../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
import Dispatcher from '../Dispatcher.tsx'; /* Metro dependency 694 */
import SentryUtilsNative from '../utils/SentryUtils.native.tsx'; /* Metro dependency 1216 */
import AuthenticationStore from './AuthenticationStore.tsx'; /* Metro dependency 1226 */
import UserSettingsProtoStore from '../modules/user_settings/UserSettingsProtoStore.tsx'; /* Metro dependency 1348 */
import ChannelStore from './ChannelStore.tsx'; /* Metro dependency 1379 */
import UserStore from './UserStore.tsx'; /* Metro dependency 1878 */
import ExperimentStore from '../modules/experiments/ExperimentStore.tsx'; /* Metro dependency 4107 */
import ClipsStore from '../modules/clips/ClipsStore.tsx'; /* Metro dependency 4265 */
import RunningGameStoreNative from '../modules/game_detection/RunningGameStore.native.tsx'; /* Metro dependency 4266 */
import BitRateStore from './BitRateStore.tsx'; /* Metro dependency 4290 */
import CertifiedDeviceStore from './CertifiedDeviceStore.tsx'; /* Metro dependency 4293 */
import RTCConnectionStore from './RTCConnectionStore.tsx'; /* Metro dependency 4294 */
import ProportionalVadIndicatorExperiment from '../modules/calls/ProportionalVadIndicatorExperiment.tsx'; /* Metro dependency 4608 */
import MobileAudioOutputExperiment from '../modules/media_engine/MobileAudioOutputExperiment.tsx'; /* Metro dependency 10269 */
import ExternalPipAndroid from '../modules/external_pip/ExternalPip.android.tsx'; /* Metro dependency 10684 */
import GetEffectiveNoiseCancellation from '../modules/noise_cancellation/getEffectiveNoiseCancellation.tsx'; /* Metro dependency 10826 */
import KrispUtils from '../modules/noise_cancellation/KrispUtils.tsx'; /* Metro dependency 12396 */
import VideoQualityModeStore from './VideoQualityModeStore.tsx'; /* Metro dependency 12412 */
import PTTEducationExperiment from '../modules/voice_calls/PTTEducationExperiment.tsx'; /* Metro dependency 12418 */
import HasPerformanceForKrispFullband from '../modules/device/hasPerformanceForKrispFullband.tsx'; /* Metro dependency 12477 */
import SilenceWarningExperiment from '../modules/media_engine/SilenceWarningExperiment.tsx'; /* Metro dependency 12486 */
import InputWatcher from '../modules/media_engine/InputWatcher.tsx'; /* Metro dependency 12489 */
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as PlatformUtilsModule from '../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
import * as StorageModule from '../external/discord_common/js/packages/storage/Storage.tsx'; /* Metro dependency 587 */
import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 661 */
import * as IndexNativeModule from '../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as TimersModule from '../external/discord_common/js/packages/timers/Timers.tsx'; /* Metro dependency 4041 */
import * as InjectMediaEngineNativeModule from '../lib/injectMediaEngine.native.tsx'; /* Metro dependency 4260 */
import * as SystemAnalyticsStoreNativeModule from '../modules/system_analytics/SystemAnalyticsStore.native.tsx'; /* Metro dependency 4289 */
import * as MediaEngineModule from '../external/discord_common/js/packages/media-engine/index.tsx'; /* Metro dependency 4406 */
import * as AVErrorModule from '../modules/errors/av_errors/AVError.tsx'; /* Metro dependency 9235 */
import * as IsClipsEnabledModule from '../modules/clips/isClipsEnabled.tsx'; /* Metro dependency 12382 */
import * as SpatialAudioConstantsModule from '../modules/spatial_audio/SpatialAudioConstants.tsx'; /* Metro dependency 12413 */
import * as UserSettingsVoiceAndVideoConstantsModule from '../modules/user_settings/voice/UserSettingsVoiceAndVideoConstants.tsx'; /* Metro dependency 12414 */
import * as GoLiveHdrExperimentModule from '../modules/media_engine/GoLiveHdrExperiment.tsx'; /* Metro dependency 12415 */
import * as AGC2ExperimentModule from '../modules/media_engine/AGC2Experiment.tsx'; /* Metro dependency 12417 */
import * as DisableHookFramePacerExperimentModule from '../modules/media_engine/DisableHookFramePacerExperiment.tsx'; /* Metro dependency 12422 */
import * as VideoHookDX12ExperimentModule from '../modules/media_engine/VideoHookDX12Experiment.tsx'; /* Metro dependency 12423 */
import * as LowLatencyRateControlExperimentModule from '../modules/media_engine/LowLatencyRateControlExperiment.tsx'; /* Metro dependency 12426 */
function _fun35470(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#35470, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:6, offset: 0x0107355d, size: 3665 bytes, params: 8, frame: 39
let env0_0 = require;
const _arrayLikeToArray_35476 = function(a0, a1) {
var r0;
var r1;
var r2;
var value3;
var length;
var value5;
var value = undefined;
var value2 = value == null;
reducibleJoin2: while (true) {
if (value2) {
r0 = value2;
break reducibleJoin2;
}
value3 = value > a0.length;
r0 = value3;
break reducibleJoin2;
}
reducibleJoin4: while (true) {
if (r0) {
length = a0.length;
r1 = length;
break reducibleJoin4;
}
r1 = value;
break reducibleJoin4;
}
value = (0, global.Array)(r1);
var value4 = 0;
if (value4 < r1) {
r2 = value4;
reducibleLoop5: while (true) {
value[r2] = a0[r2];
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
if (value5 < r1) {
r2 = value5;
continue reducibleLoop5;
}
break reducibleLoop5;
}
}
return value;
};
const videoFilterErrorToAVUnderlyingError = function(a0) {
if (VideoFilterError.UNSUPPORTED === a0) {
return require(dependencyMap[46]).AVUnderlyingError.VideoBackgroundUnsupported;
}
if (VideoFilterError.INIT_FAILED === a0) {
return require(dependencyMap[46]).AVUnderlyingError.VideoBackgroundInitFailed;
}
};
const setAutomaticGainControl = function(a0, a1) {
a0.setAutomaticGainControl(getAutomaticGainControlConfig(a1));
};
const closure = function(a0) {
return {id: DEFAULT_DEVICE_ID, index: 0, name: a0, disabled: true, guid: undefined, hardwareId: undefined,
containerId: undefined};
};
const hasHardwareMatch = function(a0, a1) {
var env0_0 = a0;
return a1.find(_fun35547) != null;
};
const getDeviceId = function(a0, a1) {
var r1;
var value = a1;
r1 = a0[value] ?? a0[DEFAULT_DEVICE_ID];
r1 = r1 ?? importDefault(dependencyMap[38])(a0).values().first();
return r1 == null ? value : r1.id;
};
const hasHapticsOverAudioOutputDevices = function(a0) {
var Object = global.Object;
return Object.values(a0).some(_fun35555);
};
const closure2 = function({section}) {
if (section === UserSettingsSections.VOICE) {
tryEnable();
}
return false;
};
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
InjectMediaEngineNativeModule;
let value = ConstantsModule;
const env0_23 = value.AnalyticEvents;
const env0_24 = value.AppStates;
const InputModes = value.InputModes;
const env0_26 = value.RTCConnectionStates;
const env0_27 = value.UserSettingsSections;
const env0_28 = value.VideoToggleState;
value = require(4286) /* metro dependency 4286: Constants */;
const env0_29 = value.DARWIN_SCKIT_VERSION;
const env0_30 = value.DARWIN_SCKIT_AUDIO_VERSION;
const env0_31 = value.WINDOWS_GRAPHICS_CAPTURE_NEW_APIS_BUILD;
const env0_32 = value.WINDOWS_GRAPHICS_CAPTURE_NEW_APIS_SEMVER;
const env0_33 = value.WINDOWS_GRAPHICS_CAPTURE_BUILD;
const env0_34 = value.WINDOWS_GRAPHICS_CAPTURE_SEMVER;
const env0_35 = value.WINDOWS_SOUNDSHARE_HOOK_VERSION;
const env0_36 = value.WINDOWS_SOUNDSHARE_NONHOOK_VERSION;
value = require(4661) /* metro dependency 4661: NativePermissionConstants */;
const env0_37 = value.NativePermissionStates;
const NativePermissionTypes = value.NativePermissionTypes;
value = require(670) /* metro dependency 670: UserSettingsConstants */;
const env0_40 = value.ProtoAudioSettingsContextTypes;
const env0_41 = value.UserSettingsTypes;
const InputProfile = (UserSettingsVoiceAndVideoConstantsModule).InputProfile;
value = require(4291) /* metro dependency 4291: Constants */;
const env0_43 = value.AudioSubsystems;
const env0_44 = value.DARWIN_H265_VERSION;
const env0_45 = value.DEFAULT_VOLUME;
const env0_46 = value.DEFAULT_STREAM_VOLUME;
const DEFAULT_DEVICE_ID = value.DEFAULT_DEVICE_ID;
const env0_48 = value.DeviceTypes;
const DISABLED_DEVICE_ID = value.DISABLED_DEVICE_ID;
const env0_50 = value.ExperimentFlags;
const Features = value.Features;
const MediaEngineContextTypes = value.MediaEngineContextTypes;
const NoiseCancellerError = value.NoiseCancellerError;
const env0_54 = value.VideoFilterError;
const env0_55 = value.VideoFilterTarget;
const env0_56 = value.MediaTypes;
const env0_57 = value.QUEUE_METRICS_INTERVAL_MS;
const env0_58 = value.VideoToggleReason;
const env0_59 = value.VIEWERSIDE_CLIP_KFI_MS;
const env0_60 = value.SIMULCAST_HQ_QUALITY;
const env0_61 = value.SIMULCAST_LQ_QUALITY;
value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('MediaEngineStore');
const env0_64 = {'left': 1, 'right': 1};
let Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
let SECOND = Millis.SECOND;
const env0_65 = 5 * SECOND;
Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
SECOND = Millis.SECOND;
const env0_66 = 2 * SECOND;
Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
SECOND = Millis.SECOND;
const env0_67 = 30 * SECOND;
Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
const MINUTE = Millis.MINUTE;
const env0_68 = 1 * MINUTE;
const object2 = {};
const CUSTOM = InputProfile.CUSTOM;
object2[CUSTOM] = {};
const VOICE_ISOLATION = InputProfile.VOICE_ISOLATION;
object2[VOICE_ISOLATION] = {'modeOptions': null, 'echoCancellation': true, 'noiseSuppression': false,
'automaticGainControl': true, 'noiseCancellation': true, 'bypassSystemInputProcessing': true,
modeOptions: {'autoThreshold': true, 'vadUseKrisp': true}};
const STUDIO = InputProfile.STUDIO;
const VOICE_ACTIVITY = InputModes.VOICE_ACTIVITY;
object2[STUDIO] = {'mode': null, 'modeOptions': null, 'echoCancellation': false, 'noiseSuppression': false,
'automaticGainControl': false, 'noiseCancellation': false, 'bypassSystemInputProcessing': true,
mode: VOICE_ACTIVITY, modeOptions: {'threshold': -84, 'autoThreshold': false, 'vadUseKrisp': false}};
({'modeOptions': null, 'noiseCancellation': false, 'noiseSuppression': true}).modeOptions = {vadUseKrisp: false};
const initializeMediaEngine = MediaEngineModule.initializeMediaEngine;
let value4 = MediaEngineModule;
let value5 = Reflect.apply(initializeMediaEngine, MediaEngineModule, [value4.determineMediaEngine()]);
value.enableNativeLogger(true);
let env0_82 = {};
let Set = global.Set;
const DEFAULT = MediaEngineContextTypes.DEFAULT;
const set = new Set([DEFAULT]);
const supports = value5.supports;
const AUTO_ENABLE = Features.AUTO_ENABLE;
const env0_84 = Reflect.apply(supports, value5, [AUTO_ENABLE]);
let env0_86 = MediaEngineContextTypes.STREAM;
const env0_87 = global.performance.now();
({})[DEFAULT_DEVICE_ID] = closure('No Input Devices');
({})[DEFAULT_DEVICE_ID] = closure('No Output Devices');
({})[DEFAULT_DEVICE_ID] = closure('No Video Devices');
const Timeout = (TimersModule).Timeout;
let timeout = new Timeout();
timeout = new Timeout();
timeout = new Timeout();
const env0_118 = [];
const env0_124 = {};
timeout = importDefault(4662) /* metro dependency 4662: NativePermissionUtils */;
let hasPermission = timeout.hasPermission;
const AUDIO = NativePermissionTypes.AUDIO;
Reflect.apply(hasPermission, timeout, [AUDIO, {showAuthorizationError: false}]);
timeout = importDefault(4662) /* metro dependency 4662: NativePermissionUtils */;
hasPermission = timeout.hasPermission;
const CAMERA = NativePermissionTypes.CAMERA;
Reflect.apply(hasPermission, timeout, [CAMERA, {showAuthorizationError: false}]);
Set = global.Set;
timeout = new Set();
Set = global.Set;
timeout = new Set();
let env0_132 = {};
timeout = new Timeout();
const env0_143 = {};
Set = global.Set;
const KRISP_INIT_ERROR = NoiseCancellerError.KRISP_INIT_ERROR;
const KRISP_INIT_ERROR_NATIVE = NoiseCancellerError.KRISP_INIT_ERROR_NATIVE;
const KRISP_INIT_ERROR_SSE4_NOT_SUPPORTED = NoiseCancellerError.KRISP_INIT_ERROR_SSE4_NOT_SUPPORTED;
const KRISP_INIT_ERROR_AVX2_NOT_SUPPORTED = NoiseCancellerError.KRISP_INIT_ERROR_AVX2_NOT_SUPPORTED;
const KRISP_INIT_ERROR_UNSIGNED = NoiseCancellerError.KRISP_INIT_ERROR_UNSIGNED;
const KRISP_INIT_ERROR_GLOBAL_INIT = NoiseCancellerError.KRISP_INIT_ERROR_GLOBAL_INIT;
const KRISP_INIT_ERROR_WEIGHT_8K = NoiseCancellerError.KRISP_INIT_ERROR_WEIGHT_8K;
const KRISP_INIT_ERROR_WEIGHT_16K = NoiseCancellerError.KRISP_INIT_ERROR_WEIGHT_16K;
const KRISP_INIT_ERROR_WEIGHT_32K = NoiseCancellerError.KRISP_INIT_ERROR_WEIGHT_32K;
const KRISP_INIT_ERROR_WEIGHT_VAD = NoiseCancellerError.KRISP_INIT_ERROR_WEIGHT_VAD;
timeout = new Set([KRISP_INIT_ERROR, KRISP_INIT_ERROR_NATIVE, KRISP_INIT_ERROR_SSE4_NOT_SUPPORTED,
KRISP_INIT_ERROR_AVX2_NOT_SUPPORTED, KRISP_INIT_ERROR_UNSIGNED, KRISP_INIT_ERROR_GLOBAL_INIT,
KRISP_INIT_ERROR_WEIGHT_8K, KRISP_INIT_ERROR_WEIGHT_16K, KRISP_INIT_ERROR_WEIGHT_32K,
KRISP_INIT_ERROR_WEIGHT_VAD]);
const env0_146 = RegExp('^HDAUDIO\\\\(?:SUB)?FUNC_\\d+&VEN_(?:8086|1002|10DE)', '');
const Store = (Flux).Store;
_fun35597(Store).displayName = 'MediaEngineStore';
timeout = new timeout(importDefault(694) /* metro dependency 694: Dispatcher */,
{VOICE_CHANNEL_SELECT: VOICE_CHANNEL_SELECT_35743, VOICE_STATE_UPDATES: function({voiceStates}) {
return voiceStates.reduce(_fun35745, false);
}, CONNECTION_OPEN: CONNECTION_OPEN_35746, CONNECTION_CLOSED: function() {
env0_78 = null;
}, POST_CONNECTION_OPEN: POST_CONNECTION_OPEN, RTC_CONNECTION_STATE: RTC_CONNECTION_STATE_35749,
AUDIO_SET_TEMPORARY_SELF_MUTE: AUDIO_SET_TEMPORARY_SELF_MUTE, AUDIO_TOGGLE_SELF_MUTE: AUDIO_TOGGLE_SELF_MUTE,
AUDIO_SET_SELF_MUTE: AUDIO_SET_SELF_MUTE, AUDIO_TOGGLE_SELF_DEAF: AUDIO_TOGGLE_SELF_DEAF,
AUDIO_TOGGLE_LOCAL_MUTE: AUDIO_TOGGLE_LOCAL_MUTE,
AUDIO_SET_LOCAL_VIDEO_DISABLED: AUDIO_SET_LOCAL_VIDEO_DISABLED, AUDIO_SET_LOCAL_VOLUME: AUDIO_SET_LOCAL_VOLUME,
AUDIO_SET_AUDIO_MIXER_SETTINGS: AUDIO_SET_AUDIO_MIXER_SETTINGS, AUDIO_SET_LOCAL_PAN: AUDIO_SET_LOCAL_PAN,
AUDIO_SET_MODE: AUDIO_SET_MODE, AUDIO_SET_INPUT_VOLUME: AUDIO_SET_INPUT_VOLUME,
AUDIO_SET_OUTPUT_VOLUME: AUDIO_SET_OUTPUT_VOLUME, AUDIO_SET_INPUT_DEVICE: AUDIO_SET_INPUT_DEVICE,
AUDIO_SET_OUTPUT_DEVICE: AUDIO_SET_OUTPUT_DEVICE,
AUDIO_SET_ACTIVE_INPUT_PROFILE: AUDIO_SET_ACTIVE_INPUT_PROFILE,
AUDIO_SET_ECHO_CANCELLATION: AUDIO_SET_ECHO_CANCELLATION,
AUDIO_SET_SIDECHAIN_COMPRESSION: AUDIO_SET_SIDECHAIN_COMPRESSION,
AUDIO_SET_SIDECHAIN_COMPRESSION_STRENGTH: AUDIO_SET_SIDECHAIN_COMPRESSION_STRENGTH,
AUDIO_SET_LOOPBACK: AUDIO_SET_LOOPBACK, AUDIO_SET_NOISE_SUPPRESSION: AUDIO_SET_NOISE_SUPPRESSION,
AUDIO_SET_AUTOMATIC_GAIN_CONTROL: AUDIO_SET_AUTOMATIC_GAIN_CONTROL,
AUDIO_SET_NOISE_CANCELLATION: AUDIO_SET_NOISE_CANCELLATION, AUDIO_SET_KRISP_MODEL_OVERRIDE: function(a0) {
importDefault(dependencyMap[77]).setKrispModelOverride(a0.model);
env0_117 = a0.model;
setLoopback();
}, AUDIO_SET_DISPLAY_SILENCE_WARNING: function(a0) {
mergeSettings({silenceWarning: a0.enabled});
}, AUDIO_SET_DEBUG_LOGGING: AUDIO_SET_DEBUG_LOGGING,
AUDIO_SET_KRISP_SUPPRESSION_LEVEL: AUDIO_SET_KRISP_SUPPRESSION_LEVEL,
AUDIO_SET_NOISE_CANCELLATION_ENABLE_STATS: AUDIO_SET_NOISE_CANCELLATION_ENABLE_STATS,
MEDIA_ENGINE_SET_VIDEO_HOOK: function(a0) {
mergeSettings({videoHook: a0.enabled});
}, MEDIA_ENGINE_SET_EXPERIMENTAL_SOUNDSHARE: function(a0) {
mergeSettings({experimentalSoundshare2: a0.enabled});
}, MEDIA_ENGINE_SET_USE_SYSTEM_SCREENSHARE_PICKER: function({enabled}) {
mergeSettings({useSystemScreensharePicker: enabled});
}, AUDIO_SET_ATTENUATION: AUDIO_SET_ATTENUATION, AUDIO_SET_QOS: AUDIO_SET_QOS,
MEDIA_ENGINE_DEVICES: MEDIA_ENGINE_DEVICES, AUDIO_VOLUME_CHANGE: function({inputVolume, outputVolume}) {
var mergeSettingsBinding = mergeSettings;
var object = {};
object.inputVolume = clampVolume(inputVolume);
object.outputVolume = outputVolume;
mergeSettingsBinding(object);
}, AUDIO_RESET: AUDIO_RESET, AUDIO_INPUT_DETECTED: AUDIO_INPUT_DETECTED,
AUDIO_INPUT_DEVICE_OS_CONFIG_FETCHED: function({osVolume, osMuted}) {
env0_110 = osVolume;
env0_109 = osMuted;
}, AUDIO_SET_SUBSYSTEM: function(a0) {
setAudioSubsystem(a0.subsystem);
}, AUDIO_SET_BYPASS_SYSTEM_INPUT_PROCESSING: AUDIO_SET_BYPASS_SYSTEM_INPUT_PROCESSING,
MEDIA_ENGINE_SET_AUDIO_ENABLED: MEDIA_ENGINE_SET_AUDIO_ENABLED,
MEDIA_ENGINE_SET_VIDEO_ENABLED: function({enabled}) {
importDefault(dependencyMap[32]).requestPermission(NativePermissionTypes.CAMERA);
updateVideo(enabled);
}, MEDIA_ENGINE_PERMISSION: MEDIA_ENGINE_PERMISSION,
MEDIA_ENGINE_SET_GO_LIVE_SOURCE: MEDIA_ENGINE_SET_GO_LIVE_SOURCE,
MEDIA_ENGINE_SET_VIDEO_DEVICE: MEDIA_ENGINE_SET_VIDEO_DEVICE,
MEDIA_ENGINE_INTERACTION_REQUIRED: MEDIA_ENGINE_INTERACTION_REQUIRED, USER_SETTINGS_MODAL_INIT: closure2,
USER_SETTINGS_MODAL_SET_SECTION: closure2, CERTIFIED_DEVICES_SET: CERTIFIED_DEVICES_SET,
RPC_APP_CONNECTED: RPC_APP_CONNECTED, RPC_APP_DISCONNECTED: RPC_APP_DISCONNECTED,
OVERLAY_INITIALIZE: function({mediaEngineState}) {
env0_82 = mediaEngineState.settingsByContext;
env0_90 = mediaEngineState.inputDevices;
env0_91 = mediaEngineState.outputDevices;
env0_132 = mediaEngineState.appSupported;
env0_113 = mediaEngineState.krispModuleLoaded;
env0_114 = mediaEngineState.krispFatalError;
env0_115 = mediaEngineState.krispVersion;
env0_86 = mediaEngineState.goLiveContext;
}, APP_STATE_UPDATE: APP_STATE_UPDATE_35816, SET_CHANNEL_BITRATE: SET_CHANNEL_BITRATE,
SET_VAD_PERMISSION: SET_VAD_PERMISSION, SET_NATIVE_PERMISSION: SET_NATIVE_PERMISSION,
SET_CHANNEL_VIDEO_QUALITY_MODE: SET_CHANNEL_VIDEO_QUALITY_MODE,
MEDIA_ENGINE_SET_AEC_DUMP: MEDIA_ENGINE_SET_AEC_DUMP,
MEDIA_ENGINE_SET_OPENH264_ENABLED: MEDIA_ENGINE_SET_OPENH264_ENABLED,
MEDIA_ENGINE_RESET_SETTINGS: MEDIA_ENGINE_RESET_SETTINGS, CHANNEL_DELETE: CHANNEL_DELETE_35827,
MEDIA_ENGINE_NOISE_CANCELLATION_ERROR: MEDIA_ENGINE_NOISE_CANCELLATION_ERROR,
MEDIA_ENGINE_VOICE_ACTIVITY_DETECTION_ERROR: MEDIA_ENGINE_VOICE_ACTIVITY_DETECTION_ERROR,
MEDIA_ENGINE_NOISE_CANCELLATION_ERROR_RESET: MEDIA_ENGINE_NOISE_CANCELLATION_ERROR_RESET,
MEDIA_ENGINE_APPLY_MEDIA_FILTER_SETTINGS: MEDIA_ENGINE_APPLY_MEDIA_FILTER_SETTINGS,
MEDIA_ENGINE_APPLY_MEDIA_FILTER_SETTINGS_START: function() {
env0_122 = true;
}, MEDIA_ENGINE_APPLY_MEDIA_FILTER_SETTINGS_ERROR: function() {
env0_122 = false;
}, USER_SETTINGS_PROTO_UPDATE: function(a0) {
var type = a0.settings.type;
var local = a0.local;
var wasSaved = a0.wasSaved;
if (type !== UserSettingsTypes.PRELOADED_USER_SETTINGS) {
return false;
}
if (local) {
return false;
}
if (wasSaved != null) {
return false;
}
applyRemoteSettings(true);
}, CLIPS_INIT: CLIPS_INIT, CLIPS_SETTINGS_UPDATE: CLIPS_SETTINGS_UPDATE_35839,
MEDIA_ENGINE_SET_ENABLE_HARDWARE_MUTE_NOTICE: function(a0) {
env0_136 = a0.enabled;
}, MEDIA_ENGINE_SET_DEVICE_AUDIO_EFFECTS: MEDIA_ENGINE_SET_DEVICE_AUDIO_EFFECTS});
const value10 = new (InputWatcher)(value5, timeout);
(FileImportTrackerModule).fileFinishedImporting('stores/MediaEngineStore.tsx');
exports.default = timeout;
exports.WINDOWS_NOISE_SUPPRESSION_EFFECT = 'deep_noise_suppression';
exports.LINUX_OPENH264_URL = 'https://ciscobinary.openh264.org/libopenh264-2.5.1-linux64.7.so.bz2';
exports.LINUX_OPENH264_SHA256 = 'd828a944d4d2bb64195ada89cf2cde9bc41733b1547d0788ef49fb8cb231b76f';
exports.DeviceFormFactor = {WEBCAM: 'WEBCAM', INTEGRATED: 'INTEGRATED', BLUETOOTH: 'BLUETOOTH', AIRPLAY: 'AIRPLAY',
HEADSET: 'HEADSET'};
function _isNativeReflectConstruct_35471() { // fn#35471, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:1481, offset: 0x010743ae, size: 94 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_35471_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _createForOfIteratorHelperLoose_35474(a0, a1) { // fn#35474, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:1674, offset: 0x0107440c, size: 370 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun35475;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_35476(a0, value);
r5 = value;
} else {
value3 = ({}).toString.call(a0).slice(8, -1);
r6 = value3 === 'Object' && a0.constructor;
r9 = r6 ? a0.constructor.name : value3;
if (r9 === 'Map') {
r6 = global.Array.from(a0);
} else if (r9 === 'Set') {
r6 = global.Array.from(a0);
} else if (r9 === 'Arguments') {
value = _arrayLikeToArray_35476(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_35476(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun35475;
}
const TypeError = global.TypeError;
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
function _fun35475() { // fn#35475, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:2245, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
return env0_1 >= env0_0.length ? {done: true} : {done: false,
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
}
}
function getDefaultSettings() { // fn#35477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:3108, offset: 0x0107457e, size: 320 bytes, params: 1, frame: 16
const object = {'mode': null, 'modeOptions': null, 'vadUseKrispSettingVersion': 0, 'ncUseKrispSettingVersion': 0,
'ncUseKrispjsSettingVersion': 0, 'mute': false, 'deaf': false, 'echoCancellation': true,
'noiseSuppression': false, 'automaticGainControl': true, 'noiseCancellation': true,
'bypassSystemInputProcessing': true, 'hardwareEnabledVersion': 0, 'silenceWarning': true, 'attenuation': 0,
'attenuateWhileSpeakingSelf': false, 'attenuateWhileSpeakingOthers': true};
const VOICE_ACTIVITY = InputModes.VOICE_ACTIVITY;
object.mode = VOICE_ACTIVITY;
let isPlatformEmbedded = (PlatformUtilsModule).isPlatformEmbedded;
isPlatformEmbedded = !!isPlatformEmbedded && isPlatformEmbedded;
object.modeOptions = {'threshold': -60, 'autoThreshold': null, 'vadUseKrisp': true,
'vadKrispActivationThreshold': 0.5, 'vadLeading': 5, 'vadTrailing': 25, 'delay': 20,
autoThreshold: isPlatformEmbedded, shortcut: [], updatedAt: undefined};
object.localMutes = {};
object.disabledLocalVideos = {};
object.videoToggleStateMap = {};
object.localVolumes = {};
const object3 = {};
copyDataProperties(object3, DEFAULT_AUDIO_MIXER_SETTINGS, undefined);
object.audioMixerSettings = object3;
object.audioMixerSettingsVersion = 0;
object.localPans = {};
object.inputVolume = DEFAULT_VOLUME;
object.outputVolume = DEFAULT_VOLUME;
object.inputDeviceId = DEFAULT_DEVICE_ID;
object.outputDeviceId = DEFAULT_DEVICE_ID;
object.videoDeviceId = DEFAULT_DEVICE_ID;
object.qos = false;
object.qosMigrated = false;
const binding = env0_77;
const supports = binding.supports;
const VIDEO_HOOK = Features.VIDEO_HOOK;
object.videoHook = Reflect.apply(supports, binding, [VIDEO_HOOK]);
object.experimentalSoundshare2 = null;
object.useSystemScreensharePicker = null;
object.h265Enabled = true;
object.vadThrehsoldMigrated = false;
object.aecDumpEnabled = false;
object.openH264Enabled = true;
object.sidechainCompression = true;
object.sidechainCompressionSettingVersion = 1;
object.sidechainCompressionStrength = 50;
object.automaticAudioSubsystem = true;
object.activeInputProfile = null;
return object;
}
function getHdrCaptureMode(a0) { // fn#35478, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:5689, offset: 0x010746be, size: 53 bytes, params: 2, frame: 12
const getGoLiveHdrConfig = GoLiveHdrExperimentModule.getGoLiveHdrConfig;
return Reflect.apply(getGoLiveHdrConfig, GoLiveHdrExperimentModule, [{location: a0}]).hdrCaptureMode;
}
function _detectH265HardwareDecode() { // fn#35479, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:5785, offset: 0x010746f3, size: 48 bytes, params: 1, frame: 14
return Module00005(_fun35481).apply(this, arguments);
}
function startH265HardwareDetection() { // fn#35482, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:6272, offset: 0x010747ea, size: 94 bytes, params: 1, frame: 13
return env0_126 ?? (typeof global.window !== 'undefined' ? (function() {
return _detectH265HardwareDecode.apply(this, arguments);
})().then(function(a0) {
env1_125 = a0;
return a0;
}) : global.Promise.resolve(false));
}
function getStoredSettings() { // fn#35485, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:6498, offset: 0x01074872, size: 60 bytes, params: 1, frame: 12
var r0;
var defaultSettings;
const value = a0;
const r3 = value !== undefined ? value : MediaEngineContextTypes.DEFAULT;
const property = env0_82[r3];
if (property != null) {
r0 = property;
} else {
defaultSettings = getDefaultSettings();
env0_82[r3] = defaultSettings;
r0 = defaultSettings;
}
return r0;
}
function _getSettings0() { // fn#35486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:6602, offset: 0x010748ae, size: 355 bytes, params: 1, frame: 20
var r10;
var moduleValue;
var getVADBeforeProcessingExperimentConfig;
var value3;
let value = a0;
const storedSettings = getStoredSettings(value !== undefined ? value : MediaEngineContextTypes.DEFAULT);
const binding = env0_75;
let r1 = storedSettings.activeInputProfile ?? InputProfile.CUSTOM;
const property = binding[r1];
r1 = isKrispAvailable() ? env0_143 : env0_76;
const object = {};
copyDataProperties(object, storedSettings.modeOptions ?? ({}), r10);
copyDataProperties(object, property.modeOptions ?? ({}), r10);
copyDataProperties(object, r1.modeOptions ?? ({}), r10);
if (object.vadDuringPreProcess == null) {
moduleValue = require(12416) /* metro dependency 12416: VADBeforeProcessingExperiment */;
getVADBeforeProcessingExperimentConfig = moduleValue.getVADBeforeProcessingExperimentConfig;
value3 = 'getSettings';
object.vadDuringPreProcess = Reflect.apply(getVADBeforeProcessingExperimentConfig, moduleValue,
[{location: value3}]).enabled;
r10 = value3;
}
if (object.vadKrispActivationThreshold != null) {
if (storedSettings.automaticGainControl === true) {
value = require(12417) /* metro dependency 12417: AGC2Experiment */;
value = value.getAGC2ExperimentConfig({location: 'getSettings'});
if (value.vadKrispActivationThreshold != null) {
object.vadKrispActivationThreshold = value.vadKrispActivationThreshold;
}
}
} else if (property.automaticGainControl === true) {
value = require(12417) /* metro dependency 12417: AGC2Experiment */;
value = value.getAGC2ExperimentConfig({location: 'getSettings'});
if (value.vadKrispActivationThreshold != null) {
object.vadKrispActivationThreshold = value.vadKrispActivationThreshold;
}
} else if (storedSettings.automaticGainControl === true) {
value = require(12417) /* metro dependency 12417: AGC2Experiment */;
value = value.getAGC2ExperimentConfig({location: 'getSettings'});
if (value.vadKrispActivationThreshold != null) {
object.vadKrispActivationThreshold = value.vadKrispActivationThreshold;
}
}
const object4 = {};
copyDataProperties(object4, storedSettings, r10);
copyDataProperties(object4, property, r10);
copyDataProperties(object4, r1, r10);
object4['modeOptions'] = object;
return object4;
}
function setInputMode(a0) { // fn#35487, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:7287, offset: 0x01074a11, size: 375 bytes, params: 2, frame: 19
const _getSettings0Binding = _getSettings0;
let context = a0.context;
const value2 = _getSettings0Binding(context);
const mode = value2.mode;
context = a0.context;
const DEFAULT = MediaEngineContextTypes.DEFAULT;
if (context === DEFAULT) {
(require(10750) /* metro dependency 10750: MediaEngineActionCreators */).setPushToTalkState(false, false);
}
const defaultImport = PTTEducationExperiment;
const getConfig = defaultImport.getConfig;
let r6 = Reflect.apply(getConfig, defaultImport,
[{location: 'setInputMode'}]).showPTTSpeakingIndicator && mode === InputModes.PUSH_TO_TALK;
const setInputMode = a0.setInputMode;
object = {};
object.vadThreshold = value2.modeOptions.threshold;
const value4 = !!r6;
object.vadAutoThreshold = r6 ? value4 : value2.modeOptions.autoThreshold;
r6 = (r6 ? value4 : value2.modeOptions.vadUseKrisp) && isKrispAvailable();
object.vadUseKrisp = r6;
object.vadKrispActivationThreshold = value2.modeOptions.vadKrispActivationThreshold ?? 0.5;
object.vadLeading = value2.modeOptions.vadLeading;
object.vadTrailing = value2.modeOptions.vadTrailing;
const vadDuringPreProcess = value2.modeOptions.vadDuringPreProcess;
object.vadDuringPreProcess = vadDuringPreProcess != null && vadDuringPreProcess;
const Math = global.Math;
object.pttReleaseDelay = Math.round(value2.modeOptions.delay);
Reflect.apply(setInputMode, a0, [mode, object]);
}
function clampVolume(a0) { // fn#35488, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:7963, offset: 0x01074b88, size: 58 bytes, params: 2, frame: 15
undefined !== undefined;
return (Module00022).clamp(a0, 0, DEFAULT_VOLUME);
}
function updateConnectionMuteDeaf(a0) { // fn#35489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:8023, offset: 0x01074bc2, size: 247 bytes, params: 2, frame: 17
var r4;
var r5;
var defaultImport;
const _getSettings0Binding = _getSettings0;
let context = a0.context;
const value2 = _getSettings0Binding(context);
const binding = env0_84;
let r6 = binding ? value2.mute : !binding;
r6 = !r6 ? value2.deaf : r6;
context = a0.context;
let DEFAULT = MediaEngineContextTypes.DEFAULT;
if (DEFAULT === context) {
r4 = r6 || env0_94;
r4 = !r4 ? env0_95 : r4;
r4 = !r4 ? env0_96 : r4;
if (!r4) {
defaultImport = importDefault(4662) /* metro dependency 4662: NativePermissionUtils */;
r4 = !defaultImport.didHavePermission(NativePermissionTypes.AUDIO);
}
r5 = r4;
} else if (MediaEngineContextTypes.STREAM === context) {
r5 = true;
} else {
a0.context;
r5 = r6;
}
a0.setSelfMute(r5);
a0.setSelfDeaf(value2.deaf);
context = a0.context;
DEFAULT = MediaEngineContextTypes.DEFAULT;
if (context === DEFAULT) {
(importDefault(12401) /* metro dependency 12401: NativeMuteManagerNative */).updateNativeMute();
}
}
function updateVideo() { // fn#35490, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:8348, offset: 0x01074cb9, size: 1444 bytes, params: 1, frame: 27
var id;
var r4;
var videoDeviceGuid;
var audioDeviceGuid;
var r5;
var r12;
var enabled;
var r10;
var r15;
var r9;
var id2;
var moduleValue;
var videoHook;
var moduleValue2;
var moduleValue3;
var setGoLiveSource;
var videoDeviceGuid2;
var value8;
var audioDeviceGuid2;
var videoDeviceId;
var object;
var quality;
var hdrCaptureMode;
var value12;
var isWindows2;
var defaultImport;
var WGCDirtyRegionsAllExperiment;
var WGCDirtyRegionsExperiment;
var DisableHookFramePacerExperiment;
var VideoHookDX12Experiment;
var object5;
var moduleValue7;
var object6;
const value = a0;
const value2 = a1;
const value3 = undefined;
let r2 = value !== value3 ? value : env0_98;
const r8 = value2 !== value3 ? value2 : env0_79;
let binding = env0_79;
let desktopSource = binding == null ? value3 : binding.desktopSource;
const value4 = desktopSource != null;
if (value4) {
desktopSource = binding.desktopSource;
id2 = desktopSource.id;
if (r8 == null) {
id = value3;
} else {
desktopSource = r8.desktopSource;
id = desktopSource == null ? value3 : desktopSource.id;
}
r4 = id2 !== id;
} else {
r4 = value4;
}
if (r4) {
if (binding.desktopSource.soundshareId == null) {
if (binding.desktopSource.sourcePid != null && _getSettings0().videoHook) {
moduleValue2 = importAll(12419) /* metro dependency 12419: HookNative */;
moduleValue2.cancelAttachToProcess(binding.desktopSource.sourcePid);
}
} else {
moduleValue = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue.isWindows()) {
moduleValue3 = importAll(12419) /* metro dependency 12419: HookNative */;
moduleValue3.cancelAttachToProcess(binding.desktopSource.soundshareId);
} else if (binding.desktopSource.sourcePid != null && _getSettings0().videoHook) {
moduleValue2 = importAll(12419) /* metro dependency 12419: HookNative */;
moduleValue2.cancelAttachToProcess(binding.desktopSource.sourcePid);
}
}
env0_77.setGoLiveSource(null, STREAM);
}
let cameraSource = binding == null ? value3 : binding.cameraSource;
const value7 = cameraSource == null;
if (value7) {
r4 = value7;
} else {
cameraSource = binding.cameraSource;
videoDeviceGuid2 = cameraSource.videoDeviceGuid;
if (r8 == null) {
videoDeviceGuid = value3;
} else {
cameraSource = r8.cameraSource;
videoDeviceGuid = cameraSource == null ? value3 : cameraSource.videoDeviceGuid;
}
value8 = videoDeviceGuid2 === videoDeviceGuid;
if (value8) {
cameraSource = binding.cameraSource;
audioDeviceGuid2 = cameraSource.audioDeviceGuid;
if (r8 == null) {
audioDeviceGuid = value3;
} else {
cameraSource = r8.cameraSource;
audioDeviceGuid = cameraSource == null ? value3 : cameraSource.audioDeviceGuid;
}
r5 = audioDeviceGuid2 === audioDeviceGuid;
} else {
r5 = value8;
}
r4 = r5;
}
if (!r4) {
env0_77.setGoLiveSource(null, STREAM);
}
if (env0_98) {
videoDeviceId = _getSettings0().videoDeviceId;
r2 = r2 ? getDeviceId(env0_92,
env0_98 ? videoDeviceId !== DEFAULT_DEVICE_ID || DISABLED_DEVICE_ID !== DEFAULT_DEVICE_ID ? videoDeviceId : DISABLED_DEVICE_ID !== DISABLED_DEVICE_ID ? DISABLED_DEVICE_ID : videoDeviceId : videoDeviceId) : DISABLED_DEVICE_ID;
env0_77.setVideoInputDevice(r2);
} else if (r2) {
videoDeviceId = _getSettings0().videoDeviceId;
r2 = r2 ? getDeviceId(env0_92,
env0_98 ? videoDeviceId !== DEFAULT_DEVICE_ID || DISABLED_DEVICE_ID !== DEFAULT_DEVICE_ID ? videoDeviceId : DISABLED_DEVICE_ID !== DISABLED_DEVICE_ID ? DISABLED_DEVICE_ID : videoDeviceId : videoDeviceId) : DISABLED_DEVICE_ID;
env0_77.setVideoInputDevice(r2);
}
if (r8 != null) {
object = {};
quality = r8.quality;
object.resolution = quality.resolution;
quality = r8.quality;
object.frameRate = quality.frameRate;
desktopSource = r8.desktopSource;
if (desktopSource != null) {
hdrCaptureMode = getHdrCaptureMode('MediaEngineStore go live');
videoHook = _getSettings0().videoHook;
value12 = supportsWindowsGraphicsCapture();
if (value12) {
isWindows2 = (require(477) /* metro dependency 477: PlatformUtils */).isWindows();
if (isWindows2) {
defaultImport = importDefault(12427) /* metro dependency 12427 */;
r2 = defaultImport.satisfies((importDefault(3767) /* metro dependency 3767: DiscordNative */) == null ? value3 : (importDefault(3767) /* metro dependency 3767: DiscordNative */).os.release,
WINDOWS_GRAPHICS_CAPTURE_NEW_APIS_SEMVER);
} else {
r2 = isWindows2;
}
r2 = r2 ? WINDOWS_GRAPHICS_CAPTURE_NEW_APIS_BUILD : WINDOWS_GRAPHICS_CAPTURE_BUILD;
r12 = r2;
} else {
r12 = 0;
}
r2 = (require(477) /* metro dependency 477: PlatformUtils */).isWindows() && r12 >= WINDOWS_GRAPHICS_CAPTURE_NEW_APIS_BUILD;
if (r2) {
if (env0_134 === true) {
WGCDirtyRegionsExperiment = (require(12420) /* metro dependency 12420: WGCDirtyRegionsExperiment */).WGCDirtyRegionsExperiment;
enabled = WGCDirtyRegionsExperiment.getConfig({location: 'updateVideo'}).enabled;
} else {
WGCDirtyRegionsAllExperiment = (require(12421) /* metro dependency 12421: WGCDirtyRegionsAllExperiment */).WGCDirtyRegionsAllExperiment;
enabled = WGCDirtyRegionsAllExperiment.getConfig({location: 'updateVideo'}).enabled;
}
r10 = enabled;
} else {
r10 = false;
}
if (videoHook) {
DisableHookFramePacerExperiment = (require(12422) /* metro dependency 12422: DisableHookFramePacerExperiment */).DisableHookFramePacerExperiment;
r15 = !DisableHookFramePacerExperiment.getConfig({location: 'updateVideo'}).enabled;
} else {
r15 = !videoHook;
}
if (videoHook) {
VideoHookDX12Experiment = (require(12423) /* metro dependency 12423: VideoHookDX12Experiment */).VideoHookDX12Experiment;
r9 = VideoHookDX12Experiment.getConfig({location: 'updateVideo'}).enabled;
} else {
r9 = videoHook;
}
binding = env0_77;
setGoLiveSource = binding.setGoLiveSource;
object5 = {};
desktopSource = r8.desktopSource;
object5.id = desktopSource.id;
desktopSource = r8.desktopSource;
object5.soundshareId = desktopSource.soundshareId;
object5.useVideoHook = videoHook;
object5.useHookFramePacer = r15;
object5.useGraphicsCapture = value12;
object5.useGraphicsCaptureApiLevel = r12;
object5.useCaptureDeviceForEncode = (require(477) /* metro dependency 477: PlatformUtils */).isWindows();
object5.useLoopback = env0_74.getExperimentalSoundshare();
object5.useQuartzCapturer = true;
object5.allowScreenCaptureKit = supportsScreenCaptureKit();
object5.videoHookStaleFrameTimeoutMs = 500;
object5.graphicsCaptureStaleFrameTimeoutMs = env0_65;
object5.hdrCaptureMode = hdrCaptureMode;
moduleValue7 = require(12424) /* metro dependency 12424: GlobalFramePoolLockExperiment */;
enabled = moduleValue7.getGlobalFramePoolLockExperimentConfig({location: 'updateVideo'}).enabled;
object5.enableGlobalFramePoolLock = enabled;
object5.useGraphicsCaptureDirtyRegions = r10;
object5.videoHookAllowDx12 = r9;
Reflect.apply(setGoLiveSource, binding, [{desktopDescription: object5, quality: object}, STREAM]);
}
cameraSource = r8.cameraSource;
if (cameraSource != null) {
binding = env0_77;
setGoLiveSource = binding.setGoLiveSource;
object6 = {};
cameraSource = r8.cameraSource;
object6.videoDeviceGuid = cameraSource.videoDeviceGuid;
cameraSource = r8.cameraSource;
object6.audioDeviceGuid = cameraSource.sound === false ? '' : r8.cameraSource.audioDeviceGuid;
Reflect.apply(setGoLiveSource, binding, [{cameraDescription: object6, quality: object}, STREAM]);
}
}
return value3;
}
function noiseCancellerErrorToAVUnderlyingError(a0) { // fn#35491, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:10782, offset: 0x0107525d, size: 690 bytes, params: 2, frame: 12
const AVUnderlyingError = (AVErrorModule).AVUnderlyingError;
const KRISP_CPU_OVERUSE = NoiseCancellerError.KRISP_CPU_OVERUSE;
if (KRISP_CPU_OVERUSE === a0) {
return AVUnderlyingError.KrispCpuOveruse;
}
const KRISP_FAILED = NoiseCancellerError.KRISP_FAILED;
if (KRISP_FAILED === a0) {
return AVUnderlyingError.KrispFailed;
}
const KRISP_VAD_CPU_OVERUSE = NoiseCancellerError.KRISP_VAD_CPU_OVERUSE;
if (KRISP_VAD_CPU_OVERUSE === a0) {
return AVUnderlyingError.KrispVadCpuOveruse;
}
const KRISP_INIT_ERROR = NoiseCancellerError.KRISP_INIT_ERROR;
if (KRISP_INIT_ERROR === a0) {
return AVUnderlyingError.KrispInitError;
}
const KRISP_INIT_ERROR_NATIVE = NoiseCancellerError.KRISP_INIT_ERROR_NATIVE;
if (KRISP_INIT_ERROR_NATIVE === a0) {
return AVUnderlyingError.KrispInitErrorNative;
}
const KRISP_INIT_ERROR_SSE4_NOT_SUPPORTED = NoiseCancellerError.KRISP_INIT_ERROR_SSE4_NOT_SUPPORTED;
if (KRISP_INIT_ERROR_SSE4_NOT_SUPPORTED === a0) {
return AVUnderlyingError.KrispInitErrorSse4NotSupported;
}
const KRISP_INIT_ERROR_AVX2_NOT_SUPPORTED = NoiseCancellerError.KRISP_INIT_ERROR_AVX2_NOT_SUPPORTED;
if (KRISP_INIT_ERROR_AVX2_NOT_SUPPORTED === a0) {
return AVUnderlyingError.KrispInitErrorAvx2NotSupported;
}
const KRISP_INIT_ERROR_UNSIGNED = NoiseCancellerError.KRISP_INIT_ERROR_UNSIGNED;
if (KRISP_INIT_ERROR_UNSIGNED === a0) {
return AVUnderlyingError.KrispInitErrorUnsigned;
}
const KRISP_INIT_ERROR_GLOBAL_INIT = NoiseCancellerError.KRISP_INIT_ERROR_GLOBAL_INIT;
if (KRISP_INIT_ERROR_GLOBAL_INIT === a0) {
return AVUnderlyingError.KrispInitErrorGlobalInit;
}
const KRISP_INIT_ERROR_WEIGHT_8K = NoiseCancellerError.KRISP_INIT_ERROR_WEIGHT_8K;
if (KRISP_INIT_ERROR_WEIGHT_8K === a0) {
return AVUnderlyingError.KrispInitErrorWeight8k;
}
const KRISP_INIT_ERROR_WEIGHT_16K = NoiseCancellerError.KRISP_INIT_ERROR_WEIGHT_16K;
if (KRISP_INIT_ERROR_WEIGHT_16K === a0) {
return AVUnderlyingError.KrispInitErrorWeight16k;
}
const KRISP_INIT_ERROR_WEIGHT_32K = NoiseCancellerError.KRISP_INIT_ERROR_WEIGHT_32K;
if (KRISP_INIT_ERROR_WEIGHT_32K === a0) {
return AVUnderlyingError.KrispInitErrorWeight32k;
}
const KRISP_INIT_ERROR_WEIGHT_VAD = NoiseCancellerError.KRISP_INIT_ERROR_WEIGHT_VAD;
if (KRISP_INIT_ERROR_WEIGHT_VAD === a0) {
return AVUnderlyingError.KrispInitErrorWeightVad;
}
}
function handleVoiceProcessingError(a0) { // fn#35493, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:12617, offset: 0x0107557d, size: 299 bytes, params: 2, frame: 18
let binding = env0_62;
binding.warn('Voice processing error: ' + a0);
const reportAVError = AVErrorModule.reportAVError;
const object = {};
const AVError = AVErrorModule.AVError;
const NOISE_CANCELLER_ERROR = AVError.NOISE_CANCELLER_ERROR;
object.type = NOISE_CANCELLER_ERROR;
object.underlyingError = noiseCancellerErrorToAVUnderlyingError(a0);
Reflect.apply(reportAVError, AVErrorModule, [object]);
const defaultImport = AnalyticsUtils;
const track = defaultImport.track;
const VOICE_PROCESSING = AnalyticEvents.VOICE_PROCESSING;
Reflect.apply(track, defaultImport, [VOICE_PROCESSING, {noise_canceller_error: a0}]);
binding = env0_144;
if (!binding.has(a0)) {
if (a0 === NoiseCancellerError.KRISP_VAD_CPU_OVERUSE) {
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'MEDIA_ENGINE_VOICE_ACTIVITY_DETECTION_ERROR',
code: a0});
} else {
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'MEDIA_ENGINE_NOISE_CANCELLATION_ERROR',
code: a0});
}
}
}
function handleVideoFilterError(a0, a1) { // fn#35494, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:13103, offset: 0x010756a8, size: 229 bytes, params: 3, frame: 22
var moduleValue;
var reportAVError;
var object;
const LIVE = VideoFilterTarget.LIVE;
const value2 = a1 === LIVE;
const binding = env0_62;
const value3 = 'preview';
binding.warn('Video filter error: ' + a0 + ' (' + (value2 ? 'live' : value3) + ')');
if (value2) {
moduleValue = require(9235) /* metro dependency 9235: AVError */;
reportAVError = moduleValue.reportAVError;
object = {};
object.type = (require(9235) /* metro dependency 9235: AVError */).AVError.VIDEO_BACKGROUND_UNAVAILABLE;
object.underlyingError = videoFilterErrorToAVUnderlyingError(a0);
Reflect.apply(reportAVError, moduleValue, [object]);
}
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'MEDIA_ENGINE_VIDEO_FILTER_ERROR',
code: a0, target: value2 ? 'live' : value3});
}
function getAutomaticGainControlConfig(a0) { // fn#35495, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:13453, offset: 0x0107578d, size: 80 bytes, params: 2, frame: 15
const object = {enabled: a0};
const getAGC2ExperimentConfig = AGC2ExperimentModule.getAGC2ExperimentConfig;
copyDataProperties(object, Reflect.apply(getAGC2ExperimentConfig, AGC2ExperimentModule,
[{location: 'getAutomaticGainControlConfig', disable: !a0}]).noiseCancellationConfig,
'getAutomaticGainControlConfig');
return object;
}
function setNoiseCancellation(a0, a1) { // fn#35497, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:13728, offset: 0x010757fe, size: 157 bytes, params: 3, frame: 16
const defaultImport = GetEffectiveNoiseCancellation;
const binding = env0_74;
const getSystemMicrophoneMode = binding.getSystemMicrophoneMode;
const value2 = defaultImport(a1, Reflect.apply(getSystemMicrophoneMode, binding, []));
if (value2 !== a1) {
env0_62.info('Falling back to system noise suppression.');
}
a0.setNoiseCancellation(value2);
const getAGC2ExperimentConfig = AGC2ExperimentModule.getAGC2ExperimentConfig;
a0.setNoiseCancellationDuringProcessing(Reflect.apply(getAGC2ExperimentConfig, AGC2ExperimentModule,
[{location: 'setNoiseCancellation', disable: !value2}]).noiseCancellationDuringProcessing);
}
function updateConnectionVoiceProcessing(a0) { // fn#35498, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:14066, offset: 0x0107589b, size: 435 bytes, params: 2, frame: 21
var defaultImport;
const _getSettings0Binding = _getSettings0;
const value2 = undefined;
const value3 = _getSettings0Binding();
const inputDeviceId = value3.inputDeviceId;
const setEchoCancellation = a0.setEchoCancellation;
let r4 = CertifiedDeviceStore.hasEchoCancellation(inputDeviceId) || value3.echoCancellation;
Reflect.apply(setEchoCancellation, a0, [r4]);
a0.setNoiseSuppression(CertifiedDeviceStore.hasNoiseSuppression(inputDeviceId) || value3.noiseSuppression);
setAutomaticGainControl(a0,
CertifiedDeviceStore.hasAutomaticGainControl(inputDeviceId) || value3.automaticGainControl);
setNoiseCancellation(a0, value3.noiseCancellation);
a0.setSpatialAudioEnabled(value3.audioMixerSettings.enabled);
const isWindows2 = (PlatformUtilsModule).isWindows();
if (isWindows2) {
defaultImport = importDefault(12427) /* metro dependency 12427 */;
r4 = defaultImport.satisfies((importDefault(3767) /* metro dependency 3767: DiscordNative */) == null ? value2 : (importDefault(3767) /* metro dependency 3767: DiscordNative */).os.release,
env0_145);
} else {
r4 = isWindows2;
}
if (r4) {
if (a0.context === MediaEngineContextTypes.DEFAULT) {
a0.setEchoReferenceMode((require(12425) /* metro dependency 12425: SystemwideEchoCancellationExperiment */).getSystemwideEchoCancellationExperimentConfig({location: 'updateConnectionVoiceProcessing'}).echoReferenceMode);
}
}
if (PlatformUtilsModule.isWeb()) {
a0.setSilenceThreshold(value3.noiseCancellation ? -150 : -100);
}
return value2;
}
function setupMediaEngine() { // fn#35499, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:14881, offset: 0x01075a4e, size: 1043 bytes, params: 1, frame: 20
let binding = env0_93;
binding.start(env0_67, _fun35500);
binding = env0_77;
let on = binding.on;
const MediaEngineEvent = (MediaEngineModule).MediaEngineEvent;
const Connection = MediaEngineEvent.Connection;
Reflect.apply(on, binding, [Connection, _fun35501]);
binding = env0_77;
on = binding.on;
const DeviceChange = MediaEngineEvent.DeviceChange;
Reflect.apply(on, binding, [DeviceChange, _fun35511]);
binding = env0_77;
on = binding.on;
const VolumeChange = MediaEngineEvent.VolumeChange;
Reflect.apply(on, binding, [VolumeChange, _fun35512]);
binding = env0_77;
on = binding.on;
const DesktopSourceEnd = MediaEngineEvent.DesktopSourceEnd;
Reflect.apply(on, binding, [DesktopSourceEnd, _fun35513]);
binding = env0_77;
on = binding.on;
const AudioPermission = MediaEngineEvent.AudioPermission;
Reflect.apply(on, binding, [AudioPermission, _fun35514]);
binding = env0_77;
on = binding.on;
const VideoPermission = MediaEngineEvent.VideoPermission;
Reflect.apply(on, binding, [VideoPermission, _fun35515]);
binding = env0_77;
on = binding.on;
const WatchdogTimeout = MediaEngineEvent.WatchdogTimeout;
Reflect.apply(on, binding, [WatchdogTimeout, Module00005(_fun35517)]);
binding = env0_77;
on = binding.on;
const VideoInputInitialized = MediaEngineEvent.VideoInputInitialized;
Reflect.apply(on, binding, [VideoInputInitialized, _fun35518]);
binding = env0_77;
on = binding.on;
const AudioInputInitialized = MediaEngineEvent.AudioInputInitialized;
Reflect.apply(on, binding, [AudioInputInitialized, _fun35519]);
binding = env0_77;
on = binding.on;
const ClipsRecordingRestartNeeded = MediaEngineEvent.ClipsRecordingRestartNeeded;
Reflect.apply(on, binding, [ClipsRecordingRestartNeeded, _fun35520]);
binding = env0_77;
on = binding.on;
const ClipsInitFailure = MediaEngineEvent.ClipsInitFailure;
Reflect.apply(on, binding, [ClipsInitFailure, _fun35521]);
binding = env0_77;
on = binding.on;
const ClipsRecordingEnded = MediaEngineEvent.ClipsRecordingEnded;
Reflect.apply(on, binding, [ClipsRecordingEnded, _fun35523]);
binding = env0_77;
on = binding.on;
const NativeScreenSharePickerUpdate = MediaEngineEvent.NativeScreenSharePickerUpdate;
Reflect.apply(on, binding, [NativeScreenSharePickerUpdate, _fun35524]);
binding = env0_77;
on = binding.on;
const NativeScreenSharePickerCancel = MediaEngineEvent.NativeScreenSharePickerCancel;
Reflect.apply(on, binding, [NativeScreenSharePickerCancel, _fun35525]);
binding = env0_77;
on = binding.on;
const NativeScreenSharePickerError = MediaEngineEvent.NativeScreenSharePickerError;
Reflect.apply(on, binding, [NativeScreenSharePickerError, _fun35526]);
binding = env0_77;
on = binding.on;
const AudioDeviceModuleError = MediaEngineEvent.AudioDeviceModuleError;
Reflect.apply(on, binding, [AudioDeviceModuleError, function(a0, a1, a2) {
var defaultImport = importDefault(dependencyMap[47]);
var AUDIO_DEVICE_MODULE_ERROR = AnalyticEvents.AUDIO_DEVICE_MODULE_ERROR;
defaultImport.track(AUDIO_DEVICE_MODULE_ERROR, {audio_device_module: a0, code: a1, device_name: a2});
}]);
binding = env0_77;
on = binding.on;
const VideoCodecError = MediaEngineEvent.VideoCodecError;
Reflect.apply(on, binding, [VideoCodecError, _fun35528]);
binding = env0_77;
on = binding.on;
const ConnectionStats = MediaEngineEvent.ConnectionStats;
Reflect.apply(on, binding, [ConnectionStats, _fun35529]);
binding = env0_77;
on = binding.on;
const VoiceProcessingError = MediaEngineEvent.VoiceProcessingError;
Reflect.apply(on, binding, [VoiceProcessingError, handleVoiceProcessingError]);
binding = env0_77;
on = binding.on;
const VideoFilterError = MediaEngineEvent.VideoFilterError;
Reflect.apply(on, binding, [VideoFilterError, handleVideoFilterError]);
binding = env0_77;
on = binding.on;
const VoiceQueueMetrics = MediaEngineEvent.VoiceQueueMetrics;
Reflect.apply(on, binding, [VoiceQueueMetrics, function(a0) {
var value2 = processQueueMetricsForAnalytics(a0);
if (value2 !== null) {
importDefault(dependencyMap[47]).track(AnalyticEvents.VOICE_QUEUE_METRICS, value2);
}
}]);
env0_77.setOnVideoContainerResized(_fun35532);
(function() {
return _setGamescopeVaapiEnabled.apply(this, arguments);
})();
env0_81.reset();
getSystemAnalyticsInfo().then(_fun35535);
binding = env0_77;
on = binding.on;
const SystemMicrophoneModeChange = MediaEngineEvent.SystemMicrophoneModeChange;
Reflect.apply(on, binding, [SystemMicrophoneModeChange, _fun35536]);
function _fun35500() { // fn#35500, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:14922, offset: 0x01075e61, size: 70 bytes, params: 1, frame: 14
env1_62.error('Device enumeration timed out');
const defaultImport = AnalyticsUtils;
const track = defaultImport.track;
const DEVICE_ENUMERATION_TIMEOUT = AnalyticEvents.DEVICE_ENUMERATION_TIMEOUT;
Reflect.apply(track, defaultImport, [DEVICE_ENUMERATION_TIMEOUT, {}]);
}
function _fun35501(a0) { // fn#35501, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:15068, offset: 0x01075ea7, size: 2780 bytes, params: 2, frame: 26
var r2;
var arch;
var release;
var r10;
var r7;
var moduleValue2;
var setExperimentFlag;
var H265_HARDWARE_DECODE_AVAILABLE;
var openH264Enabled;
var USE_LIBOPENH264_DECODER;
var LOW_LATENCY_RATE_CONTROL;
var SWALLOW_VOLUME_ONLY_SPEAKING_EVENTS;
var hasHapticsOverAudioOutputDevices2;
var setSoundshareDiscardRearChannels;
var moduleValue6;
var moduleValue7;
var moduleValue8;
var moduleValue9;
var moduleValue10;
var getAV1DecodeExperimentAndroidConfig;
var SIGNAL_AV1_DECODE;
var SIGNAL_AV1_HARDWARE_DECODE;
var H265_DISABLE_ENCODE;
var window;
var DiscordNative;
var os;
var value5;
var defaultImport2;
var satisfies;
var value6;
var defaultImport3;
var BROWSER_HEVC;
var binding;
var value7;
var startsWith;
var value8;
var moduleValue13;
var getWmfGpuEncode;
var WMF_GPU_ENCODE;
var value9;
var value10;
var moduleValue15;
var getWmfGpuEncodeIntel;
var value11;
var value12;
var value13;
var value14;
var moduleValue17;
var getWmfCpuEncodeIntel;
var INTEL_GPU;
var value15;
var value16;
var moduleValue19;
var setClipsKeyFrameInterval;
var property;
var authenticationStoreBinding;
var getId;
var setLocalMute;
var value20;
var setLocalVolume;
var value22;
var property2;
var setLocalPan;
var left;
var right;
var value24;
var setLocalVideoDisabled;
var value26;
var SpeakingWhileMuted;
var supports;
var ASYNC_VIDEO_INPUT_DEVICE_INIT;
var value27;
var setAsyncVideoInputDeviceInit;
const env0_0 = a0;
const setLoopbackBinding = setLoopback;
const value2 = undefined;
setLoopbackBinding();
setInputMode(a0);
updateConnectionMuteDeaf(a0);
updateConnectionVoiceProcessing(a0);
const value3 = _getSettings0();
a0.setAttenuation(value3.attenuation, value3.attenuateWhileSpeakingSelf, value3.attenuateWhileSpeakingOthers);
a0.setQoS(value3.qos);
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
if (platformUtilsModule.isWindows()) {
a0.setExperimentFlag(ExperimentFlags.H265_HARDWARE_ONLY, true);
startH265HardwareDetection().then(_fun35502);
} else {
moduleValue2 = platformUtilsModule;
reducibleJoin4: while (true) {
if (moduleValue2.isMac()) {
setExperimentFlag = a0.setExperimentFlag;
H265_HARDWARE_DECODE_AVAILABLE = ExperimentFlags.H265_HARDWARE_DECODE_AVAILABLE;
Reflect.apply(setExperimentFlag, a0, [H265_HARDWARE_DECODE_AVAILABLE, true]);
break reducibleJoin4;
}
break reducibleJoin4;
}
}
const isLinux2 = platformUtilsModule.isLinux();
reducibleJoin6: while (true) {
if (isLinux2) {
openH264Enabled = value3.openH264Enabled;
r2 = openH264Enabled;
break reducibleJoin6;
}
r2 = isLinux2;
break reducibleJoin6;
}
reducibleJoin8: while (true) {
if (r2) {
setExperimentFlag = a0.setExperimentFlag;
USE_LIBOPENH264_DECODER = ExperimentFlags.USE_LIBOPENH264_DECODER;
Reflect.apply(setExperimentFlag, a0, [USE_LIBOPENH264_DECODER, true]);
break reducibleJoin8;
}
break reducibleJoin8;
}
const getLowLatencyRateControlExperimentConfig = LowLatencyRateControlExperimentModule.getLowLatencyRateControlExperimentConfig;
let enabled = Reflect.apply(getLowLatencyRateControlExperimentConfig, LowLatencyRateControlExperimentModule,
[{location: 'setupMediaEngine'}]).enabled;
reducibleJoin10: while (true) {
if (enabled) {
setExperimentFlag = a0.setExperimentFlag;
LOW_LATENCY_RATE_CONTROL = ExperimentFlags.LOW_LATENCY_RATE_CONTROL;
Reflect.apply(setExperimentFlag, a0, [LOW_LATENCY_RATE_CONTROL, true]);
break reducibleJoin10;
}
break reducibleJoin10;
}
setExperimentFlag = a0.setExperimentFlag;
const RESET_DECODER_ON_ERRORS = ExperimentFlags.RESET_DECODER_ON_ERRORS;
Reflect.apply(setExperimentFlag, a0, [RESET_DECODER_ON_ERRORS, true]);
setExperimentFlag = a0.setExperimentFlag;
const SOFTWARE_FALLBACK_ON_CONSECUTIVE_ERRORS = ExperimentFlags.SOFTWARE_FALLBACK_ON_CONSECUTIVE_ERRORS;
Reflect.apply(setExperimentFlag, a0, [SOFTWARE_FALLBACK_ON_CONSECUTIVE_ERRORS, true]);
let defaultImport = ProportionalVadIndicatorExperiment;
let getConfig = defaultImport.getConfig;
reducibleJoin12: while (true) {
if (Reflect.apply(getConfig, defaultImport, [{location: 'MediaEngineStore'}]).swallowVolumeOnlySpeakingEvents) {
setExperimentFlag = a0.setExperimentFlag;
SWALLOW_VOLUME_ONLY_SPEAKING_EVENTS = ExperimentFlags.SWALLOW_VOLUME_ONLY_SPEAKING_EVENTS;
Reflect.apply(setExperimentFlag, a0, [SWALLOW_VOLUME_ONLY_SPEAKING_EVENTS, true]);
break reducibleJoin12;
}
break reducibleJoin12;
}
a0.setMinimumJitterBufferLevel(80);
let context = a0.context;
const STREAM = MediaEngineContextTypes.STREAM;
reducibleJoin14: while (true) {
if (context !== STREAM) {
break reducibleJoin14;
}
hasHapticsOverAudioOutputDevices2 = hasHapticsOverAudioOutputDevices(env1_91);
setSoundshareDiscardRearChannels = a0.setSoundshareDiscardRearChannels;
Reflect.apply(setSoundshareDiscardRearChannels, a0, [hasHapticsOverAudioOutputDevices2]);
break reducibleJoin14;
}
const moduleValue5 = platformUtilsModule;
if (moduleValue5.isWindows()) {
a0.setExperimentFlag(ExperimentFlags.SIGNAL_AV1_ENCODE, true);
a0.setExperimentFlag(ExperimentFlags.SIGNAL_AV1_DECODE, true);
a0.setExperimentFlag(ExperimentFlags.SIGNAL_AV1_HARDWARE_DECODE, true);
} else {
moduleValue6 = platformUtilsModule;
if (moduleValue6.isMac()) {
a0.setExperimentFlag(ExperimentFlags.SIGNAL_AV1_DECODE, true);
a0.setExperimentFlag(ExperimentFlags.SIGNAL_AV1_HARDWARE_DECODE, true);
setExperimentFlag = a0.setExperimentFlag;
H265_DISABLE_ENCODE = ExperimentFlags.H265_DISABLE_ENCODE;
window = global.window;
reducibleJoin27: while (true) {
if (window == null) {
arch = value2;
break reducibleJoin27;
}
DiscordNative = window.DiscordNative;
if (DiscordNative == null) {
arch = value2;
break reducibleJoin27;
}
os = DiscordNative.os;
arch = os.arch;
break reducibleJoin27;
}
value5 = arch === 'arm64';
reducibleJoin32: while (true) {
if (value5) {
defaultImport2 = importDefault(12427) /* metro dependency 12427 */;
satisfies = defaultImport2.satisfies;
window = global.window;
reducibleJoin31: while (true) {
if (window == null) {
release = value2;
break reducibleJoin31;
}
DiscordNative = window.DiscordNative;
if (DiscordNative == null) {
release = value2;
break reducibleJoin31;
}
os = DiscordNative.os;
release = os.release;
break reducibleJoin31;
}
value6 = Reflect.apply(satisfies, defaultImport2, [release, DARWIN_H265_VERSION]);
r2 = value6;
break reducibleJoin32;
}
r2 = value5;
break reducibleJoin32;
}
Reflect.apply(setExperimentFlag, a0, [H265_DISABLE_ENCODE, !r2]);
} else {
moduleValue7 = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue7.isLinux()) {
a0.setExperimentFlag(ExperimentFlags.SIGNAL_AV1_DECODE, true);
} else {
moduleValue8 = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue8.isIOS()) {
a0.setExperimentFlag(ExperimentFlags.SIGNAL_AV1_DECODE, true);
a0.setExperimentFlag(ExperimentFlags.SIGNAL_AV1_HARDWARE_DECODE, true);
} else {
moduleValue9 = require(477) /* metro dependency 477: PlatformUtils */;
reducibleJoin34: while (true) {
if (moduleValue9.isAndroid()) {
if (env1_89 !== true) {
break reducibleJoin34;
}
moduleValue10 = require(12472) /* metro dependency 12472: AV1DecodeExperimentAndroid */;
getAV1DecodeExperimentAndroidConfig = moduleValue10.getAV1DecodeExperimentAndroidConfig;
enabled = Reflect.apply(getAV1DecodeExperimentAndroidConfig, moduleValue10,
['MediaEngineStore']).enabled;
if (enabled) {
setExperimentFlag = a0.setExperimentFlag;
SIGNAL_AV1_DECODE = ExperimentFlags.SIGNAL_AV1_DECODE;
Reflect.apply(setExperimentFlag, a0, [SIGNAL_AV1_DECODE, true]);
setExperimentFlag = a0.setExperimentFlag;
SIGNAL_AV1_HARDWARE_DECODE = ExperimentFlags.SIGNAL_AV1_HARDWARE_DECODE;
Reflect.apply(setExperimentFlag, a0, [SIGNAL_AV1_HARDWARE_DECODE, true]);
break reducibleJoin34;
}
break reducibleJoin34;
}
break reducibleJoin34;
}
}
}
}
}
const moduleValue11 = platformUtilsModule;
reducibleJoin36: while (true) {
if (moduleValue11.isWeb()) {
defaultImport3 = importDefault(12473) /* metro dependency 12473: BrowserHevcExperiment */;
getConfig = defaultImport3.getConfig;
enabled = Reflect.apply(getConfig, defaultImport3, [{location: 'MediaEngineStore'}]).enabled;
setExperimentFlag = a0.setExperimentFlag;
BROWSER_HEVC = ExperimentFlags.BROWSER_HEVC;
Reflect.apply(setExperimentFlag, a0, [BROWSER_HEVC, enabled]);
break reducibleJoin36;
}
break reducibleJoin36;
}
const isWindows2 = platformUtilsModule.isWindows();
reducibleJoin38: while (true) {
if (isWindows2) {
binding = env1_133;
value7 = binding != null;
r2 = value7;
r10 = binding;
break reducibleJoin38;
}
r2 = isWindows2;
r10 = value2;
break reducibleJoin38;
}
reducibleJoin40: while (true) {
if (r2) {
startsWith = r10.startsWith;
value8 = Reflect.apply(startsWith, r10, ['AMD']);
r2 = value8;
break reducibleJoin40;
}
break reducibleJoin40;
}
reducibleJoin42: while (true) {
if (r2) {
moduleValue13 = require(12474) /* metro dependency 12474: WindowsMediaFoundationGpuEncode */;
getWmfGpuEncode = moduleValue13.getWmfGpuEncode;
enabled = Reflect.apply(getWmfGpuEncode, moduleValue13, ['MediaEngineStore']).enabled;
r2 = enabled;
break reducibleJoin42;
}
break reducibleJoin42;
}
reducibleJoin44: while (true) {
if (r2) {
setExperimentFlag = a0.setExperimentFlag;
WMF_GPU_ENCODE = ExperimentFlags.WMF_GPU_ENCODE;
Reflect.apply(setExperimentFlag, a0, [WMF_GPU_ENCODE, true]);
break reducibleJoin44;
}
break reducibleJoin44;
}
const isWindows3 = platformUtilsModule.isWindows();
reducibleJoin46: while (true) {
if (isWindows3) {
binding = env1_133;
value9 = binding != null;
r2 = value9;
r10 = binding;
break reducibleJoin46;
}
r2 = isWindows3;
r10 = value2;
break reducibleJoin46;
}
reducibleJoin48: while (true) {
if (r2) {
startsWith = r10.startsWith;
value10 = Reflect.apply(startsWith, r10, ['Intel']);
r2 = value10;
break reducibleJoin48;
}
break reducibleJoin48;
}
reducibleJoin50: while (true) {
if (r2) {
moduleValue15 = require(12475) /* metro dependency 12475: WindowsMediaFoundationGpuEncodeIntel */;
getWmfGpuEncodeIntel = moduleValue15.getWmfGpuEncodeIntel;
enabled = Reflect.apply(getWmfGpuEncodeIntel, moduleValue15, ['MediaEngineStore']).enabled;
r2 = enabled;
break reducibleJoin50;
}
break reducibleJoin50;
}
reducibleJoin52: while (true) {
if (r2) {
setExperimentFlag = a0.setExperimentFlag;
WMF_GPU_ENCODE = ExperimentFlags.WMF_GPU_ENCODE;
Reflect.apply(setExperimentFlag, a0, [WMF_GPU_ENCODE, true]);
break reducibleJoin52;
}
break reducibleJoin52;
}
const isWindows4 = platformUtilsModule.isWindows();
reducibleJoin54: while (true) {
if (isWindows4) {
binding = env1_133;
value11 = binding != null;
r2 = value11;
r10 = binding;
break reducibleJoin54;
}
r2 = isWindows4;
r10 = value2;
break reducibleJoin54;
}
reducibleJoin56: while (true) {
if (r2) {
startsWith = r10.startsWith;
value12 = Reflect.apply(startsWith, r10, ['Intel']);
r2 = value12;
break reducibleJoin56;
}
break reducibleJoin56;
}
reducibleJoin58: while (true) {
if (r2) {
value13 = env1_134 === true;
r2 = value13;
break reducibleJoin58;
}
break reducibleJoin58;
}
reducibleJoin60: while (true) {
if (r2) {
value14 = env1_135 === 1;
r2 = value14;
break reducibleJoin60;
}
break reducibleJoin60;
}
reducibleJoin62: while (true) {
if (r2) {
moduleValue17 = require(12476) /* metro dependency 12476: WindowsMediaFoundationCpuEncodeIntel */;
getWmfCpuEncodeIntel = moduleValue17.getWmfCpuEncodeIntel;
enabled = Reflect.apply(getWmfCpuEncodeIntel, moduleValue17, ['MediaEngineStore']).enabled;
r2 = enabled;
break reducibleJoin62;
}
break reducibleJoin62;
}
reducibleJoin64: while (true) {
if (r2) {
setExperimentFlag = a0.setExperimentFlag;
INTEL_GPU = ExperimentFlags.INTEL_GPU;
Reflect.apply(setExperimentFlag, a0, [INTEL_GPU, true]);
break reducibleJoin64;
}
break reducibleJoin64;
}
const isWindows5 = platformUtilsModule.isWindows();
reducibleJoin66: while (true) {
if (isWindows5) {
binding = env1_133;
value15 = binding != null;
r2 = value15;
r10 = binding;
break reducibleJoin66;
}
r2 = isWindows5;
r10 = value2;
break reducibleJoin66;
}
reducibleJoin68: while (true) {
if (r2) {
startsWith = r10.startsWith;
value16 = Reflect.apply(startsWith, r10, ['Qualcomm']);
r2 = value16;
break reducibleJoin68;
}
break reducibleJoin68;
}
reducibleJoin70: while (true) {
if (r2) {
moduleValue19 = require(12474) /* metro dependency 12474: WindowsMediaFoundationGpuEncode */;
getWmfGpuEncode = moduleValue19.getWmfGpuEncode;
enabled = Reflect.apply(getWmfGpuEncode, moduleValue19, ['MediaEngineStore']).enabled;
r2 = enabled;
break reducibleJoin70;
}
break reducibleJoin70;
}
reducibleJoin72: while (true) {
if (r2) {
setExperimentFlag = a0.setExperimentFlag;
WMF_GPU_ENCODE = ExperimentFlags.WMF_GPU_ENCODE;
Reflect.apply(setExperimentFlag, a0, [WMF_GPU_ENCODE, true]);
break reducibleJoin72;
}
break reducibleJoin72;
}
env1_77.setHasFullbandPerformance((HasPerformanceForKrispFullband)());
a0.setRemoteAudioHistory(1000);
reducibleJoin74: while (true) {
if ((importDefault(12384) /* metro dependency 12384: isClientClipsCapable */)(env1_74)) {
setClipsKeyFrameInterval = a0.setClipsKeyFrameInterval;
Reflect.apply(setClipsKeyFrameInterval, a0, [VIEWERSIDE_CLIP_KFI_MS]);
break reducibleJoin74;
}
break reducibleJoin74;
}
const value17 = _getSettings0(a0.context);
a0.setPostponeDecodeLevel(100);
let Object = global.Object;
let keys = Object.keys;
let localMutes = value17.localMutes;
const value18 = Reflect.apply(keys, Object, [localMutes]);
let length = value18.length;
const value19 = 0;
if (value19 < length) {
r10 = value19;
reducibleLoop75: while (true) {
property = value18[r10];
authenticationStoreBinding = AuthenticationStore;
getId = authenticationStoreBinding.getId;
reducibleJoin77: while (true) {
if (property === Reflect.apply(getId, authenticationStoreBinding, [])) {
break reducibleJoin77;
}
setLocalMute = a0.setLocalMute;
localMutes = value17.localMutes;
Reflect.apply(setLocalMute, a0, [property, localMutes[property]]);
break reducibleJoin77;
}
value20 = typeof r10 === 'bigint' ? r10 + 1n : +r10 + 1;
length = value18.length;
if (value20 < length) {
r10 = value20;
continue reducibleLoop75;
}
break reducibleLoop75;
}
}
Object = global.Object;
keys = Object.keys;
let localVolumes = value17.localVolumes;
const value21 = Reflect.apply(keys, Object, [localVolumes]);
length = value21.length;
if (value19 < length) {
r10 = value19;
reducibleLoop79: while (true) {
property = value21[r10];
authenticationStoreBinding = AuthenticationStore;
getId = authenticationStoreBinding.getId;
reducibleJoin81: while (true) {
if (property === Reflect.apply(getId, authenticationStoreBinding, [])) {
break reducibleJoin81;
}
setLocalVolume = a0.setLocalVolume;
localVolumes = value17.localVolumes;
Reflect.apply(setLocalVolume, a0, [property, localVolumes[property]]);
break reducibleJoin81;
}
value22 = typeof r10 === 'bigint' ? r10 + 1n : +r10 + 1;
length = value21.length;
if (value22 < length) {
r10 = value22;
continue reducibleLoop79;
}
break reducibleLoop79;
}
}
Object = global.Object;
keys = Object.keys;
let localPans = value17.localPans;
const value23 = Reflect.apply(keys, Object, [localPans]);
length = value23.length;
if (value19 < length) {
r10 = value19;
reducibleLoop83: while (true) {
property = value23[r10];
localPans = value17.localPans;
property2 = localPans[property];
setLocalPan = a0.setLocalPan;
left = property2.left;
right = property2.right;
Reflect.apply(setLocalPan, a0, [property, left, right]);
value24 = typeof r10 === 'bigint' ? r10 + 1n : +r10 + 1;
length = value23.length;
if (value24 < length) {
r10 = value24;
continue reducibleLoop83;
}
break reducibleLoop83;
}
}
Object = global.Object;
keys = Object.keys;
let disabledLocalVideos = value17.disabledLocalVideos;
const value25 = Reflect.apply(keys, Object, [disabledLocalVideos]);
length = value25.length;
if (value19 < length) {
r7 = value19;
reducibleLoop85: while (true) {
property = value25[r7];
setLocalVideoDisabled = a0.setLocalVideoDisabled;
disabledLocalVideos = value17.disabledLocalVideos;
Reflect.apply(setLocalVideoDisabled, a0, [property, disabledLocalVideos[property]]);
value26 = typeof r7 === 'bigint' ? r7 + 1n : +r7 + 1;
length = value25.length;
if (value26 < length) {
r7 = value26;
continue reducibleLoop85;
}
break reducibleLoop85;
}
}
let on = a0.on;
const BaseConnectionEvent = (MediaEngineModule).BaseConnectionEvent;
const Speaking = BaseConnectionEvent.Speaking;
Reflect.apply(on, a0, [Speaking, _fun35503]);
context = a0.context;
const DEFAULT = MediaEngineContextTypes.DEFAULT;
reducibleJoin88: while (true) {
if (context !== DEFAULT) {
break reducibleJoin88;
}
env1_102 = false;
on = a0.on;
SpeakingWhileMuted = BaseConnectionEvent.SpeakingWhileMuted;
Reflect.apply(on, a0, [SpeakingWhileMuted, _fun35504]);
break reducibleJoin88;
}
on = a0.on;
const DesktopSourceEnd = BaseConnectionEvent.DesktopSourceEnd;
Reflect.apply(on, a0, [DesktopSourceEnd, _fun35506]);
on = a0.on;
const InteractionRequired = BaseConnectionEvent.InteractionRequired;
Reflect.apply(on, a0, [InteractionRequired, _fun35507]);
on = a0.on;
const VideoHookInitialize = BaseConnectionEvent.VideoHookInitialize;
Reflect.apply(on, a0, [VideoHookInitialize, _fun35508]);
on = a0.on;
const NoiseCancellationError = BaseConnectionEvent.NoiseCancellationError;
const handleVoiceProcessingErrorBinding = handleVoiceProcessingError;
Reflect.apply(on, a0, [NoiseCancellationError, handleVoiceProcessingErrorBinding]);
on = a0.on;
const VoiceActivityDetectorError = BaseConnectionEvent.VoiceActivityDetectorError;
Reflect.apply(on, a0, [VoiceActivityDetectorError, handleVoiceProcessingErrorBinding]);
on = a0.on;
const SdpError = BaseConnectionEvent.SdpError;
Reflect.apply(on, a0, [SdpError, function(a0, a1, a2, a3) {
var defaultImport = importDefault(dependencyMap[47]);
var SDP_ERROR = AnalyticEvents.SDP_ERROR;
defaultImport.track(SDP_ERROR, {operation: a0, error: a1, type: a2, sdp: a3});
}]);
on = a0.on;
const VideoState = BaseConnectionEvent.VideoState;
Reflect.apply(on, a0, [VideoState, _fun35510]);
a0.setBitRate(BitRateStore.bitrate);
a0.applyVideoQualityMode(VideoQualityModeStore.mode);
const isWindows6 = platformUtilsModule.isWindows();
reducibleJoin90: while (true) {
if (isWindows6) {
binding = env1_77;
supports = binding.supports;
ASYNC_VIDEO_INPUT_DEVICE_INIT = Features.ASYNC_VIDEO_INPUT_DEVICE_INIT;
value27 = Reflect.apply(supports, binding, [ASYNC_VIDEO_INPUT_DEVICE_INIT]);
r2 = value27;
break reducibleJoin90;
}
r2 = isWindows6;
break reducibleJoin90;
}
reducibleJoin92: while (true) {
if (r2) {
binding = env1_77;
setAsyncVideoInputDeviceInit = binding.setAsyncVideoInputDeviceInit;
Reflect.apply(setAsyncVideoInputDeviceInit, binding, [true]);
break reducibleJoin92;
}
break reducibleJoin92;
}
return value2;
function _fun35502(a0) { // fn#35502, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:15414, offset: 0x01076983, size: 39 bytes, params: 2, frame: 13
const binding = env0_0;
const setExperimentFlag = binding.setExperimentFlag;
const H265_HARDWARE_DECODE_AVAILABLE = ExperimentFlags.H265_HARDWARE_DECODE_AVAILABLE;
Reflect.apply(setExperimentFlag, binding, [H265_HARDWARE_DECODE_AVAILABLE, a0]);
}
function _fun35503(a0, a1, a2, a3) { // fn#35503, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:18603, offset: 0x010769aa, size: 86 bytes, params: 5, frame: 13
const value = environment.__proto__.__proto__;
(Dispatcher).dispatch({type: 'SPEAKING', context: env0_0.context,
userId: a0, speakingFlags: a1, voiceDb: a3});
}
function _fun35504() { // fn#35504, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:18798, offset: 0x01076a00, size: 60 bytes, params: 1, frame: 13
let binding = env2_102;
if (!binding) {
env2_74.emitChange();
}
binding = env2_103;
binding.start(env2_66, _fun35505);
function _fun35505() { // fn#35505, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:18851, offset: 0x01076a3c, size: 27 bytes, params: 1, frame: 9
env3_74.emitChange();
}
}
function _fun35506(a0, a1) { // fn#35506, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:18939, offset: 0x01076a57, size: 86 bytes, params: 3, frame: 14
const value = environment.__proto__.__proto__;
(Dispatcher).dispatch({type: 'MEDIA_ENGINE_SET_GO_LIVE_SOURCE',
settings: {context: env0_0.context}, endReason: a0, errorCode: a1});
}
function _fun35507(a0) { // fn#35507, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:19123, offset: 0x01076aad, size: 57 bytes, params: 2, frame: 13
const value = environment.__proto__.__proto__;
(Dispatcher).dispatch({type: 'MEDIA_ENGINE_INTERACTION_REQUIRED',
required: a0});
}
function _fun35508(a0, a1, a2, a3, a4, a5) { // fn#35508, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:19263, offset: 0x01076ae6, size: 170 bytes, params: 7, frame: 19
var defaultImport;
var track;
var VIDEOHOOK_INITIALIZED;
var object;
var defaultImport2;
let binding = env2_79;
const value2 = undefined;
if ((binding == null ? value2 : binding.desktopSource) != null) {
defaultImport = importDefault(dependencyMap[47]);
track = defaultImport.track;
VIDEOHOOK_INITIALIZED = AnalyticEvents.VIDEOHOOK_INITIALIZED;
object = {backend: a0, format: a1, framebuffer_format: a2, sample_count: a3, success: a4, reinitialization: a5};
defaultImport2 = importDefault(dependencyMap[61]);
binding = env2_79;
copyDataProperties(object, defaultImport2(binding == null ? value2 : binding.desktopSource), dependencyMap);
Reflect.apply(track, defaultImport, [VIDEOHOOK_INITIALIZED, object]);
}
return value2;
}
function _fun35510(a0) { // fn#35510, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:19869, offset: 0x01076be0, size: 73 bytes, params: 2, frame: 13
const value = environment.__proto__.__proto__;
(Dispatcher).dispatch({type: 'MEDIA_ENGINE_VIDEO_STATE_CHANGED',
videoState: a0, context: env0_0.context});
}
}
function _fun35511(a0, a1, a2) { // fn#35511, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:20185, offset: 0x01076c29, size: 85 bytes, params: 4, frame: 13
const value = environment.__proto__;
env1_93.stop();
(Dispatcher).dispatch({type: 'MEDIA_ENGINE_DEVICES',
inputDevices: a0, outputDevices: a1, videoDevices: a2});
}
function _fun35512(a0, a1) { // fn#35512, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:20354, offset: 0x01076c7e, size: 65 bytes, params: 3, frame: 13
const value = environment.__proto__;
(Dispatcher).dispatch({type: 'AUDIO_VOLUME_CHANGE', inputVolume: a0,
outputVolume: a1});
}
function _fun35513(a0, a1) { // fn#35513, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:20497, offset: 0x01076cbf, size: 67 bytes, params: 3, frame: 13
const value = environment.__proto__;
(Dispatcher).dispatch({'type': 'MEDIA_ENGINE_SET_GO_LIVE_SOURCE',
'settings': null, endReason: a0, errorCode: a1});
}
function _fun35514(a0) { // fn#35514, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:20660, offset: 0x01076d02, size: 65 bytes, params: 2, frame: 13
const value = environment.__proto__;
(Dispatcher).dispatch({'type': 'MEDIA_ENGINE_PERMISSION',
'kind': 'audio', granted: a0});
}
function _fun35515(a0) { // fn#35515, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:20802, offset: 0x01076d43, size: 59 bytes, params: 2, frame: 13
const value = environment.__proto__;
(Dispatcher).dispatch({'type': 'MEDIA_ENGINE_PERMISSION',
'kind': 'video', granted: a0});
}
function* _fun35517() { // fn#35517, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:20940, offset: 0x01076d87, size: 520 bytes, params: 1, frame: 22
var status;
var r11;
var window;
var GLOBAL_ENV;
var RELEASE_CHANNEL;
var value3;
var binding;
var binding2;
var property;
var value4;
var submitLiveCrashReport;
var object;
var object2;
var value5;
var value6;
var value7;
var error;
var value8;
var warn;
var value9;
var binding3;
var value11;
var track;
var VOICE_WATCHDOG_TIMEOUT;
var object3;
var value12;
var value13;
var value14;
var error2;
var info;
var value15;
var value16;
var binding4;
var Storage;
var set;
var Date;
var now;
var value17;
var toString;
var value18;
var app;
var relaunch;
let value = undefined;
if (true) {
reducibleJoin22: while (true) {
reduciblePort21: while (true) {
exceptionLanding19: while (true) {
value = undefined;
window = global.window;
GLOBAL_ENV = window.GLOBAL_ENV;
RELEASE_CHANNEL = GLOBAL_ENV.RELEASE_CHANNEL;
if (RELEASE_CHANNEL !== 'canary') {
status = value;
break reduciblePort21;
}
value3 = environment.__proto__.__proto__;
try {
binding = env2_1;
} catch (error) {
break exceptionLanding19;
}
try {
binding2 = env2_3;
} catch (error) {
break exceptionLanding19;
}
try {
property = binding2[62];
} catch (error) {
break exceptionLanding19;
}
try {
value4 = binding(property);
} catch (error) {
break exceptionLanding19;
}
try {
submitLiveCrashReport = value4.submitLiveCrashReport;
} catch (error) {
break exceptionLanding19;
}
try {
object = {};
} catch (error) {
break exceptionLanding19;
}
try {
object2 = {};
} catch (error) {
break exceptionLanding19;
}
try {
object2.message = 'Voice Watchdog Timeout';
} catch (error) {
break exceptionLanding19;
}
try {
object.message = object2;
} catch (error) {
break exceptionLanding19;
}
try {
value5 = Reflect.apply(submitLiveCrashReport, value4, [object]);
} catch (error) {
break exceptionLanding19;
}
yield value5;
try {
value6 = undefined;
value7 = false;
} catch (error) {
break exceptionLanding19;
}
if (value7) {
return value6;
}
status = value;
break reduciblePort21;
}
status = error.status;
reducibleJoin21: while (true) {
if (typeof status !== 'number') {
status = value;
break reducibleJoin21;
}
status = error.status;
break reducibleJoin21;
}
break reduciblePort21;
}
value8 = environment.__proto__.__proto__;
binding = env2_62;
warn = binding.warn;
value9 = 200;
if (status != null) {
r11 = status;
break reducibleJoin22;
}
r11 = value9;
break reducibleJoin22;
}
Reflect.apply(warn, binding, ['Watchdog timeout, report submission status: ' + r11]);
var processUtils = env2_1(env2_3[63]).processUtils;
var setCrashReason = processUtils.setCrashReason;
var value10 = setCrashReason != null;
reducibleJoin24: while (true) {
reduciblePort44: while (true) {
exceptionLanding43: while (true) {
try {
binding = env2_1;
} catch (error) {
break exceptionLanding43;
}
break reducibleJoin24;
}
binding = env2_62;
error2 = binding.error;
Reflect.apply(error2, binding, ['Failed to flush voice watchdog timeout analytics event', error]);
break reduciblePort44;
}
if (value10) {
binding = env2_62;
info = binding.info;
Reflect.apply(info, binding, ['Relaunching app due to voice watchdog timeout']);
binding = env2_1;
processUtils = binding(env2_3[63]).processUtils;
setCrashReason = processUtils.setCrashReason;
yield Reflect.apply(setCrashReason, processUtils, ['voice-watchdog-timeout']);
value15 = undefined;
value16 = false;
if (value16) {
return value15;
}
binding = env2_0;
binding4 = env2_3;
Storage = binding(binding4[64]).Storage;
set = Storage.set;
Date = global.Date;
now = Date.now;
value17 = Reflect.apply(now, Date, []);
toString = value17.toString;
value18 = Reflect.apply(toString, value17, []);
Reflect.apply(set, Storage, ['discord_watchdog_restart_timestamp', value18]);
binding = env2_1;
app = binding(binding4[63]).app;
relaunch = app.relaunch;
Reflect.apply(relaunch, app, []);
}
return value;
}
try {
binding3 = env2_3;
} catch (error) {
break exceptionLanding43;
}
try {
property = binding3[47];
} catch (error) {
break exceptionLanding43;
}
try {
value11 = binding(property);
} catch (error) {
break exceptionLanding43;
}
try {
track = value11.track;
} catch (error) {
break exceptionLanding43;
}
try {
binding = env2_23;
} catch (error) {
break exceptionLanding43;
}
try {
VOICE_WATCHDOG_TIMEOUT = binding.VOICE_WATCHDOG_TIMEOUT;
} catch (error) {
break exceptionLanding43;
}
try {
object = {};
} catch (error) {
break exceptionLanding43;
}
try {
object.minidump_submission_error = status;
} catch (error) {
break exceptionLanding43;
}
try {
object.will_restart = value10;
} catch (error) {
break exceptionLanding43;
}
try {
object3 = {};
} catch (error) {
break exceptionLanding43;
}
try {
object3.flush = true;
} catch (error) {
break exceptionLanding43;
}
try {
value12 = Reflect.apply(track, value11, [VOICE_WATCHDOG_TIMEOUT, object, object3]);
} catch (error) {
break exceptionLanding43;
}
yield value12;
try {
value13 = undefined;
value14 = false;
} catch (error) {
break exceptionLanding43;
}
if (value14) {
return value13;
}
if (value10) {
binding = env2_62;
binding.info('Relaunching app due to voice watchdog timeout');
binding = env2_1;
processUtils = binding(env2_3[63]).processUtils;
yield processUtils.setCrashReason('voice-watchdog-timeout');
if (false) {
return undefined;
}
binding = env2_0;
binding4 = env2_3;
Storage = binding(binding4[64]).Storage;
Storage.set('discord_watchdog_restart_timestamp', global.Date.now().toString());
binding = env2_1;
binding(binding4[63]).app.relaunch();
}
}
return value;
}
function _fun35518(a0) { // fn#35518, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:21762, offset: 0x01076f8f, size: 208 bytes, params: 2, frame: 23
const defaultImport = AnalyticsUtils;
const track = defaultImport.track;
const VIDEO_INPUT_INITIALIZED = AnalyticEvents.VIDEO_INPUT_INITIALIZED;
const object = {};
object.device_name = a0.description.name;
object.time_to_first_frame_ms = a0.initializationTimerExpired ? null : global.Math.round(a0.timeToFirstFrame * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND);
object.timed_out = a0.initializationTimerExpired;
object.activity = a0.entropy;
object.media_session_id = RTCConnectionStore.getMediaSessionId();
object.rtc_connection_id = RTCConnectionStore.getRTCConnectionId();
Reflect.apply(track, defaultImport, [VIDEO_INPUT_INITIALIZED, object]);
}
function _fun35519({description, timeToInitialized}) { // fn#35519, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:22156, offset: 0x0107705f, size: 148 bytes, params: 2, frame: 21
const defaultImport = AnalyticsUtils;
const track = defaultImport.track;
const AUDIO_INPUT_INITIALIZED = AnalyticEvents.AUDIO_INPUT_INITIALIZED;
const object = {};
object.device_name = description.name;
const Math = global.Math;
const round = Math.round;
const Millis = (Durations).Millis;
const SECOND = Millis.SECOND;
object.time_to_initialized_ms = Reflect.apply(round, Math, [timeToInitialized * SECOND]);
object.rtc_connection_id = RTCConnectionStore.getRTCConnectionId();
Reflect.apply(track, defaultImport, [AUDIO_INPUT_INITIALIZED, object]);
}
function _fun35520() { // fn#35520, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:22426, offset: 0x010770f3, size: 49 bytes, params: 1, frame: 13
const value = environment.__proto__;
(Dispatcher).dispatch({type: 'CLIPS_RESTART'});
}
function _fun35521(a0, a1) { // fn#35521, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:22531, offset: 0x01077124, size: 59 bytes, params: 3, frame: 12
var environment;
const env0_0 = a0;
const env0_1 = a1;
const value = environment.__proto__;
(Dispatcher).wait(_fun35522);
function _fun35522() { // fn#35522, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:22557, offset: 0x0107715f, size: 68 bytes, params: 1, frame: 14
const value = environment.__proto__.__proto__;
(Dispatcher).dispatch({type: 'CLIPS_INIT_FAILURE', errMsg: env0_0,
applicationName: require});
}
}
function _fun35523(a0, a1) { // fn#35523, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:22700, offset: 0x010771a3, size: 135 bytes, params: 3, frame: 16
const binding = env1_80;
const value2 = undefined;
if ((binding == null || binding.desktopSource == null ? value2 : binding.desktopSource.id) === a0) {
if (a1 != null && (env1_79 == null || env1_79.desktopSource == null ? value2 : env1_79.desktopSource.soundshareId) !== a1) {
(importAll(12419) /* metro dependency 12419: HookNative */).cancelAttachToProcess(a1);
}
}
return value2;
}
function _fun35524(a0, a1) { // fn#35524, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:22967, offset: 0x0107722a, size: 62 bytes, params: 3, frame: 13
const value = environment.__proto__;
(Dispatcher).dispatch({type: 'NATIVE_SCREEN_SHARE_PICKER_UPDATE',
existing: a0, content: a1});
}
function _fun35525(a0) { // fn#35525, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:23129, offset: 0x01077268, size: 57 bytes, params: 2, frame: 13
const value = environment.__proto__;
(Dispatcher).dispatch({type: 'NATIVE_SCREEN_SHARE_PICKER_CANCEL',
existing: a0});
}
function _fun35526(a0) { // fn#35526, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:23276, offset: 0x010772a1, size: 56 bytes, params: 2, frame: 13
const value = environment.__proto__;
(Dispatcher).dispatch({type: 'NATIVE_SCREEN_SHARE_PICKER_ERROR',
error: a0});
}
function _fun35528(a0) { // fn#35528, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:23569, offset: 0x01077324, size: 249 bytes, params: 2, frame: 18
var r1;
const AVError = require(dependencyMap[46]).AVError;
var object;
var object2;
const r7 = a0.mode === 'encode' ? AVError.VIDEO_ENCODE_ERROR : AVError.VIDEO_DECODE_ERROR;
const object3 = {};
object3.videoCodec = a0.codecStandard;
object3.errorMessage = a0.message;
let value = environment.__proto__;
value = require(dependencyMap[46]);
const reportAVError = value.reportAVError;
const VIDEO_ENCODE_ERROR = AVError.VIDEO_ENCODE_ERROR;
if (r7 === VIDEO_ENCODE_ERROR) {
object2 = {type: r7};
copyDataProperties(object2, object3, dependencyMap);
object2['videoEncoder'] = a0.implName;
r1 = object2;
} else {
object = {type: r7};
copyDataProperties(object, object3, dependencyMap);
object['videoDecoder'] = a0.implName;
r1 = object;
}
Reflect.apply(reportAVError, value, [r1]);
}
function _fun35529(a0) { // fn#35529, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:23925, offset: 0x0107741d, size: 72 bytes, params: 2, frame: 15
var environment;
let value = environment.__proto__;
value = importDefault(694) /* metro dependency 694: Dispatcher */;
const dispatch = value.dispatch;
const object = {type: 'MEDIA_ENGINE_CONNECTION_STATS'};
object.connectionStats = a0.map(_fun35530);
Reflect.apply(dispatch, value, [object]);
function _fun35530({stats, connection}) { // fn#35530, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:24011, offset: 0x01077465, size: 66 bytes, params: 2, frame: 5
const binding = env2_72;
const value2 = typeof binding === 'bigint' ? binding : +binding;
env2_72 = typeof value2 === 'bigint' ? value2 + 1n : +value2 + 1;
return {stats: stats, mediaEngineConnectionId: connection.mediaEngineConnectionId, version: value2,
context: connection.context};
}
}
function _fun35532(a0, a1, a2) { // fn#35532, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:24480, offset: 0x010774e9, size: 66 bytes, params: 4, frame: 12
var environment;
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const value = environment.__proto__;
(Dispatcher).wait(_fun35533);
function _fun35533() { // fn#35533, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:24508, offset: 0x0107752b, size: 82 bytes, params: 1, frame: 14
const value = environment.__proto__.__proto__;
return (Dispatcher).dispatch({type: 'VIDEO_SIZE_UPDATE',
streamId: env0_0, dimensions: {width: require, height: importDefault}});
}
}
function _fun35535(a0) { // fn#35535, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:24722, offset: 0x0107759b, size: 48 bytes, params: 2, frame: 3
var gpu_brand;
var value;
var has_intel_hybrid_igpu;
var gpu_count;
if (a0 != null) {
gpu_brand = a0.gpu_brand;
value = environment.__proto__;
has_intel_hybrid_igpu = a0.has_intel_hybrid_igpu;
gpu_count = a0.gpu_count;
}
}
function _fun35536(a0) { // fn#35536, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:24859, offset: 0x010775cb, size: 47 bytes, params: 2, frame: 12
env1_131 = a0;
const binding = env1_77;
binding.eachConnection(updateConnectionVoiceProcessing);
env1_74.emitChange();
}
}
function supportsWindowsGraphicsCapture() { // fn#35537, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:24960, offset: 0x010775fa, size: 128 bytes, params: 1, frame: 18
var r0;
var defaultImport;
const value2 = undefined;
const isWindows2 = (PlatformUtilsModule).isWindows();
if (isWindows2) {
defaultImport = importDefault(12427) /* metro dependency 12427 */;
r0 = defaultImport.satisfies((importDefault(3767) /* metro dependency 3767: DiscordNative */) == null ? value2 : (importDefault(3767) /* metro dependency 3767: DiscordNative */).os.release,
WINDOWS_GRAPHICS_CAPTURE_SEMVER);
} else {
r0 = isWindows2;
}
return r0;
}
function supportsScreenCaptureKit() { // fn#35538, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:25106, offset: 0x0107767a, size: 156 bytes, params: 1, frame: 18
var defaultImport;
const value2 = undefined;
let r0 = (require(477) /* metro dependency 477: PlatformUtils */).isMac() && env0_77.supports(Features.SCREEN_CAPTURE_KIT);
if (r0) {
defaultImport = importDefault(12427) /* metro dependency 12427 */;
r0 = defaultImport.satisfies((importDefault(3767) /* metro dependency 3767: DiscordNative */) == null ? value2 : (importDefault(3767) /* metro dependency 3767: DiscordNative */).os.release,
DARWIN_SCKIT_VERSION);
}
return r0;
}
function supportsAutomaticAudioSubsystem() { // fn#35539, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:25278, offset: 0x01077716, size: 93 bytes, params: 1, frame: 13
return (require(477) /* metro dependency 477: PlatformUtils */).isWindows() && env0_77.supports(Features.AUTOMATIC_AUDIO_SUBSYSTEM) && env0_77.supports(Features.AUDIO_SUBSYSTEM_DEFERRED_SWITCH);
}
function isReadyToMigrateToSingleAdmOffering() { // fn#35540, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:25443, offset: 0x01077773, size: 30 bytes, params: 1, frame: 11
const binding = env0_77;
const supports = binding.supports;
const AUDIO_BYPASS_SYSTEM_INPUT_PROCESSING = Features.AUDIO_BYPASS_SYSTEM_INPUT_PROCESSING;
return Reflect.apply(supports, binding, [AUDIO_BYPASS_SYSTEM_INPUT_PROCESSING]);
}
function mergeSettings(a0) { // fn#35541, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:25550, offset: 0x01077791, size: 115 bytes, params: 2, frame: 16
var Storage;
const value = a1;
const value2 = a2;
const r3 = value !== undefined ? value : MediaEngineContextTypes.DEFAULT;
const r2 = !(value2 !== undefined) || value2;
const storedSettings = getStoredSettings(r3);
const Object = global.Object;
Object.assign(storedSettings, a0);
if (r2) {
Storage = (require(587) /* metro dependency 587: Storage */).Storage;
Storage.set(env0_63, env0_82);
}
return storedSettings;
}
function applySettings() { // fn#35542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:25682, offset: 0x01077804, size: 395 bytes, params: 1, frame: 16
var defaultImport3;
const value2 = _getSettings0();
setInputDevice(value2.inputDeviceId);
let binding = env0_77;
binding.setAudioOutputDevice(value2.outputDeviceId);
updateVideo();
binding = env0_77;
binding.setInputVolume(value2.inputVolume);
const defaultImport = MobileAudioOutputExperiment;
const getConfig = defaultImport.getConfig;
const audioOutputPresent = Reflect.apply(getConfig, defaultImport,
[{location: 'MediaEngineStore.applySettings'}]).audioOutputPresent;
binding = env0_77;
const setOutputVolume = binding.setOutputVolume;
if (audioOutputPresent) {
Reflect.apply(setOutputVolume, binding, [value2.outputVolume]);
} else {
Reflect.apply(setOutputVolume, binding, [DEFAULT_VOLUME]);
}
binding = env0_77;
binding.setAecDump(value2.aecDumpEnabled);
binding = env0_77;
binding.setSidechainCompression(value2.sidechainCompression);
binding = env0_77;
binding.setSidechainCompressionStrength(value2.sidechainCompressionStrength);
binding = env0_77;
binding.setAudioInputBypassSystemProcessing(value2.bypassSystemInputProcessing);
if (PlatformUtilsModule.isLinux()) {
if (!((importDefault(6731) /* metro dependency 6731: DesktopNativeUtils */) == null || (importDefault(6731) /* metro dependency 6731: DesktopNativeUtils */).setOpenH264Enabled == null)) {
defaultImport3 = importDefault(6731) /* metro dependency 6731: DesktopNativeUtils */;
defaultImport3.setOpenH264Enabled(value2.openH264Enabled);
}
}
binding = env0_77;
binding.setAudioMixerOptions(value2.audioMixerSettings);
}
function tryEnable() { // fn#35543, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:26390, offset: 0x0107798f, size: 45 bytes, params: 1, frame: 11
if (!env0_84) {
env0_77.enable().then(_fun35544);
}
function _fun35544() { // fn#35544, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:26433, offset: 0x010779bc, size: 51 bytes, params: 1, frame: 11
const value = environment.__proto__;
return (Dispatcher).dispatch({'type': 'MEDIA_ENGINE_SET_AUDIO_ENABLED',
'enabled': true, 'unmute': false});
}
}
function hasHardwareMatch(a0, a1) { // fn#35546, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:26642, offset: 0x01077a22, size: 36 bytes, params: 3, frame: 11
const env0_0 = a0;
return a1.find(_fun35547) != null;
function _fun35547(a0) { // fn#35547, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:26694, offset: 0x01077a46, size: 127 bytes, params: 2, frame: 6
let r0 = a0.containerId != null && a0.containerId === env0_0.containerId;
r0 = !r0 ? a0.hardwareId != null && a0.hardwareId === env0_0.hardwareId : r0;
r0 = !r0 ? a0.originalId != null && a0.originalId === env0_0.originalId : r0;
return r0;
}
}
function inferDeviceFormFactor(a0, {inputDevices, outputDevices, videoDevices}) { // fn#35548, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:26907, offset: 0x01077ac5, size: 432 bytes, params: 3, frame: 22
if (a0.type === 'videoinput' === true) {
return env0_73.WEBCAM;
}
if (hasHardwareMatch(a0, videoDevices) === true) {
return env0_73.WEBCAM;
}
let items2 = ['builtin', 'displayport', 'hdmi'];
const includes = items2.includes;
const macosTransportType = a0.macosTransportType;
const value2 = '';
if (Reflect.apply(includes, items2, [macosTransportType ?? value2]) === true) {
return env0_73.INTEGRATED;
}
if ((a0.hardwareId != null && env0_146.test(a0.hardwareId)) === true) {
return env0_73.INTEGRATED;
}
const value5 = (Module00022)(a0.hardwareId);
if (value5.startsWith('BTHENUM') === true) {
return env0_73.BLUETOOTH;
}
items2 = ['bluetooth', 'bluetoothle'];
if (items2.includes(a0.macosTransportType ?? value2) === true) {
return env0_73.BLUETOOTH;
}
items2 = ['airplay', 'continuitycapturewireless'];
if (items2.includes(a0.macosTransportType ?? value2) === true) {
return env0_73.AIRPLAY;
}
if ((a0.type === 'audioinput' && hasHardwareMatch(a0, outputDevices)) === true) {
return env0_73.HEADSET;
}
if ((a0.type === 'audiooutput' && hasHardwareMatch(a0, inputDevices)) === true) {
return env0_73.HEADSET;
}
}
function convertDevices(a0, {deviceType, defaultName}) { // fn#35549, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:27656, offset: 0x01077c75, size: 156 bytes, params: 3, frame: 14
var value;
const env0_0 = a0;
const property = a0[({'audioinput': 'inputDevices', 'audiooutput': 'outputDevices',
'videoinput': 'videoDevices'})[deviceType]];
if (property.length === 0) {
value = makeDisabledDevice(defaultName);
return {[value.id]: value};
}
value = (importDefault(22) /* metro dependency 22 */)(property);
value = value.map(_fun35550);
value = value.keyBy('id');
return value.value();
function _fun35550(a0) { // fn#35550, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:27895, offset: 0x01077d11, size: 124 bytes, params: 2, frame: 14
const object = {};
object.id = a0.id;
object.index = a0.index;
object.name = a0.name;
object.disabled = false;
object.facing = a0.facing;
object.guid = a0.originalId;
object.hardwareId = a0.hardwareId;
object.containerId = a0.containerId;
object.effects = a0.effects;
object.formFactor = inferDeviceFormFactor(a0, env0_0);
return object;
}
}
function maybeProbeAudioEffects(a0) { // fn#35552, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:28234, offset: 0x01077de8, size: 161 bytes, params: 2, frame: 17
var defaultImport;
var property;
const value2 = undefined;
if (PlatformUtilsModule.isWindows()) {
defaultImport = importDefault(12482) /* metro dependency 12482: AudioEffectsExperiment */;
if (defaultImport.getConfig({location: 'MediaEngineStore.setInputDevice'}).probeAudioEffects) {
property = env0_90[a0];
if ((property == null ? value2 : property.guid) != null) {
(importDefault(12483) /* metro dependency 12483: queryAudioEffects */)(property.guid, a0, env0_77);
}
}
}
return value2;
}
function setInputDevice(a0) { // fn#35553, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:28452, offset: 0x01077e89, size: 36 bytes, params: 2, frame: 12
env0_77.setAudioInputDevice(a0);
maybeProbeAudioEffects(a0);
}
function hasHapticsOverAudioOutputDevices(a0) { // fn#35554, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:28531, offset: 0x01077ead, size: 41 bytes, params: 2, frame: 11
const Object = global.Object;
return Object.values(a0).some(function({name}) {
return name.toLowerCase().includes('dualsense');
});
}
function setOutputDevices(a0) { // fn#35556, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:28654, offset: 0x01077efa, size: 219 bytes, params: 2, frame: 19
var hasHapticsOverAudioOutputDevicesBinding;
var hasHapticsOverAudioOutputDevices2;
var hasHapticsOverAudioOutputDevicesBinding2;
const binding = env0_91;
const convertDevicesBinding = convertDevices;
const object = {};
const AUDIO_OUTPUT = DeviceTypes.AUDIO_OUTPUT;
object.deviceType = AUDIO_OUTPUT;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object.defaultName = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.xlUg0v);
env0_91 = convertDevicesBinding(a0, object);
const defaultImport = Module00022;
if (!defaultImport.isEqual(env0_91, binding)) {
env0_77.setAudioOutputDevice(getDeviceId(env0_91, _getSettings0().outputDeviceId));
hasHapticsOverAudioOutputDevicesBinding = hasHapticsOverAudioOutputDevices;
hasHapticsOverAudioOutputDevices2 = hasHapticsOverAudioOutputDevicesBinding(binding);
hasHapticsOverAudioOutputDevicesBinding2 = hasHapticsOverAudioOutputDevicesBinding(env0_91);
if (hasHapticsOverAudioOutputDevices2 !== hasHapticsOverAudioOutputDevicesBinding2) {
updateConnectionsDiscardRearChannels(hasHapticsOverAudioOutputDevicesBinding2);
}
}
function updateConnectionsDiscardRearChannels(a0) { // fn#35557, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:29000, owner: setOutputDevices.updateConnectionsDiscardRearChannels, offset: 0x01077fd5, size: 36 bytes, params: 2, frame: 11
const env0_0 = a0;
env1_77.eachConnection(_fun35558);
function _fun35558(a0) { // fn#35558, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:29068, offset: 0x01077ff9, size: 47 bytes, params: 2, frame: 11
const context = a0.context;
const STREAM = MediaEngineContextTypes.STREAM;
if (context === STREAM) {
a0.setSoundshareDiscardRearChannels(env0_0);
}
}
}
}
function applyRemoteSettings() { // fn#35559, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:29141, offset: 0x01078028, size: 135 bytes, params: 1, frame: 14
var r1;
var r3;
var r2;
var value3;
let value = a0;
reducibleJoin2: while (true) {
if (value !== undefined) {
r1 = value;
break reducibleJoin2;
}
value = false;
r1 = value;
break reducibleJoin2;
}
var env0_2;
const audioContextSettings = UserSettingsProtoStore.settings.audioContextSettings;
reducibleJoin4: while (true) {
if (audioContextSettings != null) {
r3 = audioContextSettings;
break reducibleJoin4;
}
r3 = {user: {}, stream: {}};
break reducibleJoin4;
}
const applyRemoteSettings_loop2 = applyRemoteSettings_loop;
const Object = global.Object;
value = Object.keys(r3);
let length = value.length;
const value2 = 0;
if (value2 < length) {
r2 = value2;
reducibleLoop5: while (true) {
env0_2 = value[r2];
applyRemoteSettings_loop2();
value3 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
length = value.length;
if (value3 < length) {
r2 = value3;
continue reducibleLoop5;
}
break reducibleLoop5;
}
}
function applyRemoteSettings_loop() { // fn#35560, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:29258, owner: applyRemoteSettings._loop, offset: 0x010780af, size: 387 bytes, params: 1, frame: 26
var r15;
var environment;
var r10;
var r9;
var r6;
var items2;
var value6;
var value7;
var _createForOfIteratorHelperLoose_35474Binding;
var Set;
var keys;
var prototype;
var set;
var value8;
var done;
var value9;
var value10;
let value = environment;
const binding = env0_2;
const USER = ProtoAudioSettingsContextTypes.USER;
const r3 = binding === USER ? MediaEngineContextTypes.DEFAULT : MediaEngineContextTypes.STREAM;
const env0_0 = r3;
const STREAM = MediaEngineContextTypes.STREAM;
let property = (r3 === STREAM ? DEFAULT_STREAM_VOLUME : DEFAULT_VOLUME)[env0_2];
reducibleJoin8: while (true) {
if (property != null) {
r10 = property;
break reducibleJoin8;
}
r10 = {};
break reducibleJoin8;
}
const {localMutes, localVolumes} = _getSettings0(r3);
let closure = _loop_loop2_35561;
let Object = global.Object;
const value4 = Object.entries(r10);
let length = value4.length;
const value5 = 0;
if (value5 < length) {
r9 = value5;
reducibleLoop9: while (true) {
property = value4[r9];
value6 = env1_9(property, 2);
property = value6[value5];
closure(property, value6[1]);
value7 = typeof r9 === 'bigint' ? r9 + 1n : +r9 + 1;
length = value4.length;
if (value7 < length) {
r9 = value7;
continue reducibleLoop9;
}
r15 = property;
break reducibleLoop9;
}
}
reducibleJoin13: while (true) {
if (!env0_0) {
break reducibleJoin13;
}
closure = _loop3;
_createForOfIteratorHelperLoose_35474Binding = _createForOfIteratorHelperLoose_35474;
Set = global.Set;
Object = global.Object;
keys = Object.keys;
value = Reflect.apply(keys, Object, [localMutes]);
items2 = [];
value = arraySpread(items2, value, value5, r15);
Object = global.Object;
keys = Object.keys;
arraySpread(items2, Reflect.apply(keys, Object, [localVolumes]), value, r15);
prototype = Set.prototype;
value = Object.create(prototype, {constructor: {value: Set}});
set = new Set();
value = set instanceof Object ? set : value;
value = _createForOfIteratorHelperLoose_35474Binding(value);
value8 = value();
done = value8.done;
if (done) {
break reducibleJoin13;
}
r6 = value8;
reducibleLoop12: while (true) {
value9 = r6.value;
closure(value9);
value10 = value();
done = value10.done;
if (done) {
break reducibleJoin13;
}
r6 = value10;
continue reducibleLoop12;
}
}
mergeSettings({localMutes: localMutes, localVolumes: localVolumes}, r3);
function _loop_loop2_35561(a0, a1) { // fn#35561, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:29413, owner: applyRemoteSettings._loop._loop2, offset: 0x01078232, size: 161 bytes, params: 3, frame: 18
const env0_0 = a0;
const env0_1 = a1;
if ((require(12484) /* metro dependency 12484: AudioSettingsPending */).getPendingAudioSettings(env0_0,
a0) != null) {
return 1;
}
const muted = a1.muted;
const localMutesBinding = localMutes;
if (muted) {
localMutesBinding[a0] = true;
} else {
delete localMutesBinding[a0];
}
if (a1.volume !== env0_1) {
localVolumes[a0] = a1.volume;
} else {
delete localVolumes[a0];
}
const binding = env2_77;
binding.eachConnection(_fun35562, env0_0);
function _fun35562(a0) { // fn#35562, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:29571, offset: 0x010782d3, size: 54 bytes, params: 2, frame: 14
const setLocalVolume = a0.setLocalVolume;
const binding = env0_0;
Reflect.apply(setLocalVolume, a0, [binding, require.volume]);
a0.setLocalMute(binding, require.muted);
}
}
function _loop3(a0) { // fn#35563, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:29736, owner: applyRemoteSettings._loop._loop3, offset: 0x01078309, size: 79 bytes, params: 2, frame: 14
const env0_0 = a0;
if (env0_2[a0] != null) {
return 1;
}
delete localMutes[a0];
delete localVolumes[a0];
const binding = env2_77;
binding.eachConnection(_fun35564, env0_0);
function _fun35564(a0) { // fn#35564, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:29814, offset: 0x01078358, size: 47 bytes, params: 2, frame: 13
const setLocalVolume = a0.setLocalVolume;
const binding = env0_0;
Reflect.apply(setLocalVolume, a0, [binding, env1_1]);
a0.setLocalMute(binding, false);
}
}
}
}
function maybeTryHookProcess(a0, a1) { // fn#35565, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:30086, offset: 0x01078387, size: 302 bytes, params: 3, frame: 17
var r5;
var object2;
var binding;
var soundshareId;
var soundshareSession;
const value = a0;
if (a1) {
if (env0_74 != null) {
binding = env0_74;
r5 = binding.getExperimentalSoundshare() ? value : (importDefault(4488) /* metro dependency 4488: CrossPlatformNativeUtilsNative */).getAudioPid(value);
object2 = {soundshareId: r5,
soundshareSession: r5 != null ? (importDefault(4488) /* metro dependency 4488: CrossPlatformNativeUtilsNative */).generateSessionFromPid(r5) : ''};
} else {
env0_62.info('Error: trying to get soundshare id before MediaEngineStore is instantiated.');
object2 = {'soundshareId': null, 'soundshareSession': ''};
}
soundshareId = object2.soundshareId;
soundshareSession = object2.soundshareSession;
if (soundshareId != null) {
tryHookSoundshare(soundshareId, soundshareSession);
return {soundshareId: soundshareId, soundshareSession: soundshareSession};
}
if (value != null && _getSettings0().videoHook) {
(importAll(12419) /* metro dependency 12419: HookNative */).attachToProcess(value);
}
} else if (value != null && _getSettings0().videoHook) {
(importAll(12419) /* metro dependency 12419: HookNative */).attachToProcess(value);
}
return {'soundshareId': null, 'soundshareSession': null};
function tryHookSoundshare(a0, a1) { // fn#35566, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:30535, owner: maybeTryHookProcess.tryHookSoundshare, offset: 0x010784b5, size: 116 bytes, params: 3, frame: 16
var environment;
const env0_0 = a0;
let value = environment.__proto__;
if ((require(477) /* metro dependency 477: PlatformUtils */).isWindows() && a0 > 1) {
value = importAll(12419) /* metro dependency 12419: HookNative */;
value = value.attachToProcess(a0, {soundshare_session: a1});
value.then(_fun35567);
}
function _fun35567(a0) { // fn#35567, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:30655, offset: 0x01078529, size: 93 bytes, params: 2, frame: 13
var environment;
var r1;
const env0_0 = a0;
let value = a0 == null;
if (value) {
r1 = value;
} else {
value = environment.__proto__.__proto__;
value = RunningGameStoreNative.shouldContinueWithoutElevatedProcessForPID(env0_0);
r1 = value;
}
if (!r1) {
value = environment.__proto__.__proto__;
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.wait(_fun35568);
}
function _fun35568() { // fn#35568, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:30735, offset: 0x01078586, size: 59 bytes, params: 1, frame: 13
const value = environment.__proto__.__proto__.__proto__;
(Dispatcher).dispatch({type: 'MEDIA_ENGINE_SOUNDSHARE_FAILED',
errorMessage: env0_0});
}
}
}
}
function resetProbingState() { // fn#35569, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:30982, offset: 0x010785c1, size: 145 bytes, params: 1, frame: 22
var r5;
var property;
var value4;
var property2;
var AUTO_PROBING;
var value5;
const DEFAULT = MediaEngineContextTypes.DEFAULT;
const videoToggleStateMap = _getSettings0(DEFAULT).videoToggleStateMap;
const Object = global.Object;
const value2 = Object.entries(videoToggleStateMap);
let length = value2.length;
const value3 = 0;
if (value3 < length) {
r5 = value3;
while (true) {
property = value2[r5];
value4 = Module00057(property, 2);
property = value4[value3];
property2 = value4[1];
AUTO_PROBING = VideoToggleState.AUTO_PROBING;
if (property2 === AUTO_PROBING) {
delete videoToggleStateMap[property];
}
value5 = typeof r5 === 'bigint' ? r5 + 1n : +r5 + 1;
length = value2.length;
if (value5 < length) {
r5 = value5;
continue;
}
break;
}
}
mergeSettings({videoToggleStateMap: videoToggleStateMap}, DEFAULT, false);
}
function trackVoiceProcessing(a0) { // fn#35570, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:31217, offset: 0x01078652, size: 256 bytes, params: 2, frame: 21
const _getSettings0Binding = _getSettings0;
const value2 = undefined;
const value3 = _getSettings0Binding();
let binding = env0_77;
const audioSubsystem = binding.getAudioSubsystem();
const audioLayer = env0_77.getAudioLayer();
const property = env0_90[getDeviceId(env0_90, value3.inputDeviceId)];
const name = property == null ? value2 : property.name;
const defaultImport = GetEffectiveNoiseCancellation;
const noiseCancellation = value3.noiseCancellation;
binding = env0_74;
const getSystemMicrophoneMode = binding.getSystemMicrophoneMode;
const value7 = defaultImport(noiseCancellation, Reflect.apply(getSystemMicrophoneMode, binding, []));
const defaultImport2 = AnalyticsUtils;
const track = defaultImport2.track;
const VOICE_PROCESSING = AnalyticEvents.VOICE_PROCESSING;
Reflect.apply(track, defaultImport2, [VOICE_PROCESSING, {echo_cancellation: value3.echoCancellation,
noise_cancellation: value3.noiseCancellation, noise_suppression: value3.noiseSuppression,
automatic_gain_control: value3.automaticGainControl, location: a0,
bypass_system_input_processing: value3.bypassSystemInputProcessing, audio_subsystem: audioSubsystem,
audio_layer: audioLayer, input_device: name, effective_noise_cancellation: value7}]);
return value2;
}
function setLoopback() { // fn#35571, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:31799, offset: 0x01078752, size: 169 bytes, params: 1, frame: 19
const value2 = _getSettings0();
const value3 = env0_130.size > 0;
const inputDeviceId = value2.inputDeviceId;
const r8 = CertifiedDeviceStore.hasEchoCancellation(inputDeviceId) || value2.echoCancellation;
const r7 = CertifiedDeviceStore.hasNoiseSuppression(inputDeviceId) || value2.noiseSuppression;
const automaticGainControlConfig = getAutomaticGainControlConfig(CertifiedDeviceStore.hasAutomaticGainControl(inputDeviceId) || value2.automaticGainControl);
const noiseCancellation = value2.noiseCancellation;
const binding = env0_77;
binding.setLoopback(value3, {echoCancellation: r8, echoCancellationPreEcho: !value3, noiseSuppression: r7,
automaticGainControlConfig: automaticGainControlConfig, noiseCancellation: noiseCancellation});
}
function _setGamescopeVaapiEnabled() { // fn#35572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:32214, offset: 0x010787fb, size: 48 bytes, params: 1, frame: 14
return Module00005(_fun35574).apply(this, arguments);
function* _fun35574() { // fn#35574, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:32287, offset: 0x01078834, size: 235 bytes, params: 1, frame: 16
var environment;
var getSystemInfo;
var r5;
var window;
var DiscordNative;
var value3;
var processUtils;
var value4;
var electronGPUInfo;
if (true) {
value = environment.__proto__.__proto__;
var binding = env2_77;
var supports = binding.supports;
var VAAPI = env2_51.VAAPI;
if (Reflect.apply(supports, binding, [VAAPI])) {
window = global.window;
DiscordNative = window.DiscordNative;
value3 = undefined;
getSystemInfo = DiscordNative == null || DiscordNative.processUtils == null ? value3 : DiscordNative.processUtils.getSystemInfo;
if (getSystemInfo == null) {
return undefined;
}
window = global.window;
DiscordNative = window.DiscordNative;
processUtils = DiscordNative.processUtils;
getSystemInfo = processUtils.getSystemInfo;
yield Reflect.apply(getSystemInfo, processUtils, []);
value4 = undefined;
if (false) {
return value4;
}
electronGPUInfo = value4.electronGPUInfo;
r5 = (electronGPUInfo == null ? value3 : electronGPUInfo.gpuDevice) ?? [];
if (r5.some(function(a0) {
return a0.vendorId === 4098;
})) {
binding = env2_77;
env2_140 = binding.supports(env2_51.GAMESCOPE_CAPTURE);
}
}
}
}
}
function isKrispAvailable() { // fn#35576, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:32648, offset: 0x01078936, size: 12 bytes, params: 1, frame: 1
return !env0_114;
}
function _setupKrispNativeModule() { // fn#35577, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:32686, offset: 0x01078942, size: 48 bytes, params: 1, frame: 14
return Module00005(_fun35579).apply(this, arguments);
function* _fun35579() { // fn#35579, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:32755, offset: 0x0107897b, size: 726 bytes, params: 1, frame: 24
var environment;
var r9;
var r3;
var r6;
var value;
var value2;
var value3;
var binding;
var binding2;
var property;
var value4;
var ensureModule;
var value5;
var value6;
var value7;
var binding3;
var value8;
var requireModule;
var value9;
var getSdkVersion;
var value10;
var value11;
var getSuppressionLevel;
var value12;
var value13;
var value14;
var value15;
var getNcModels;
var value16;
var value17;
var then;
var closure;
var emitChange;
var binding4;
var value18;
var value19;
var value20;
var value21;
var binding5;
var value22;
var value23;
var setupKrispPath;
var value24;
var error;
var warn;
var message;
var HermesInternal;
var concat;
var value25;
var binding6;
var value26;
var captureException;
var KRISP_INIT_ERROR;
var includes;
var value27;
var parseInt;
var substring;
var message2;
var indexOf;
var value28;
var value29;
var value30;
var int;
var isNaN;
var isNaN2;
var value31;
var binding7;
var value32;
var reportAVError;
var object;
var value33;
var AVError;
var NOISE_CANCELLER_ERROR;
var value34;
var value35;
var track;
var VOICE_PROCESSING;
exceptionLanding152: while (true) {
value = undefined;
value2 = false;
if (value2) {
return value;
}
value = undefined;
value3 = environment.__proto__.__proto__;
reducibleJoin4: while (true) {
reduciblePort151: while (true) {
exceptionLanding80: while (true) {
try {
try {
binding = env2_1;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
break reducibleJoin4;
}
try {
binding = env2_62;
} catch (error) {
break exceptionLanding152;
}
try {
warn = binding.warn;
} catch (error) {
break exceptionLanding152;
}
try {
message = error.message;
} catch (error) {
break exceptionLanding152;
}
try {
HermesInternal = global.HermesInternal;
} catch (error) {
break exceptionLanding152;
}
try {
concat = HermesInternal.concat;
} catch (error) {
break exceptionLanding152;
}
try {
value25 = 'Failed to load Krisp module: ' + message;
} catch (error) {
break exceptionLanding152;
}
try {
Reflect.apply(warn, binding, [value25]);
} catch (error) {
break exceptionLanding152;
}
try {
binding = env2_1;
} catch (error) {
break exceptionLanding152;
}
try {
binding6 = env2_3;
} catch (error) {
break exceptionLanding152;
}
try {
property = binding6[78];
} catch (error) {
break exceptionLanding152;
}
try {
value26 = binding(property);
} catch (error) {
break exceptionLanding152;
}
try {
captureException = value26.captureException;
} catch (error) {
break exceptionLanding152;
}
try {
Reflect.apply(captureException, value26, [error]);
} catch (error) {
break exceptionLanding152;
}
try {
binding = env2_53;
} catch (error) {
break exceptionLanding152;
}
try {
KRISP_INIT_ERROR = binding.KRISP_INIT_ERROR;
} catch (error) {
break exceptionLanding152;
}
try {
message = error.message;
} catch (error) {
break exceptionLanding152;
}
try {
includes = message.includes;
} catch (error) {
break exceptionLanding152;
}
try {
value27 = Reflect.apply(includes, message, [': ']);
} catch (error) {
break exceptionLanding152;
}
reducibleJoin125: while (true) {
if (value27) {
try {
parseInt = global.parseInt;
} catch (error) {
break exceptionLanding152;
}
try {
message = error.message;
} catch (error) {
break exceptionLanding152;
}
try {
substring = message.substring;
} catch (error) {
break exceptionLanding152;
}
try {
message2 = error.message;
} catch (error) {
break exceptionLanding152;
}
try {
indexOf = message2.indexOf;
} catch (error) {
break exceptionLanding152;
}
try {
value28 = Reflect.apply(indexOf, message2, [': ']);
} catch (error) {
break exceptionLanding152;
}
try {
value29 = value28 + 1;
} catch (error) {
break exceptionLanding152;
}
try {
value30 = Reflect.apply(substring, message, [value29]);
} catch (error) {
break exceptionLanding152;
}
try {
int = parseInt(value30);
} catch (error) {
break exceptionLanding152;
}
try {
isNaN = global.isNaN;
} catch (error) {
break exceptionLanding152;
}
try {
isNaN2 = isNaN(int);
} catch (error) {
break exceptionLanding152;
}
reducibleJoin124: while (true) {
reducibleJoin123: while (true) {
if (isNaN2) {
try {
binding = env2_53;
} catch (error) {
break exceptionLanding152;
}
break reducibleJoin123;
}
try {
value31 = int === 0;
} catch (error) {
break exceptionLanding152;
}
if (value31) {
try {
binding = env2_53;
} catch (error) {
break exceptionLanding152;
}
break reducibleJoin123;
}
r3 = int;
break reducibleJoin124;
}
try {
KRISP_INIT_ERROR = binding.KRISP_INIT_ERROR;
} catch (error) {
break exceptionLanding152;
}
r3 = KRISP_INIT_ERROR;
break reducibleJoin124;
}
r6 = r3;
break reducibleJoin125;
}
r6 = KRISP_INIT_ERROR;
break reducibleJoin125;
}
try {
binding = env2_0;
} catch (error) {
break exceptionLanding152;
}
try {
binding7 = env2_3;
} catch (error) {
break exceptionLanding152;
}
try {
property = binding7[46];
} catch (error) {
break exceptionLanding152;
}
try {
value32 = binding(property);
} catch (error) {
break exceptionLanding152;
}
try {
reportAVError = value32.reportAVError;
} catch (error) {
break exceptionLanding152;
}
try {
object = {};
} catch (error) {
break exceptionLanding152;
}
try {
property = binding7[46];
} catch (error) {
break exceptionLanding152;
}
try {
value33 = binding(property);
} catch (error) {
break exceptionLanding152;
}
try {
AVError = value33.AVError;
} catch (error) {
break exceptionLanding152;
}
try {
NOISE_CANCELLER_ERROR = AVError.NOISE_CANCELLER_ERROR;
} catch (error) {
break exceptionLanding152;
}
try {
object.type = NOISE_CANCELLER_ERROR;
} catch (error) {
break exceptionLanding152;
}
try {
binding = env2_160;
} catch (error) {
break exceptionLanding152;
}
try {
value34 = binding(r6);
} catch (error) {
break exceptionLanding152;
}
try {
object.underlyingError = value34;
} catch (error) {
break exceptionLanding152;
}
try {
Reflect.apply(reportAVError, value32, [object]);
} catch (error) {
break exceptionLanding152;
}
try {
binding = env2_1;
} catch (error) {
break exceptionLanding152;
}
try {
property = binding7[47];
} catch (error) {
break exceptionLanding152;
}
try {
value35 = binding(property);
} catch (error) {
break exceptionLanding152;
}
try {
track = value35.track;
} catch (error) {
break exceptionLanding152;
}
try {
binding = env2_23;
} catch (error) {
break exceptionLanding152;
}
try {
VOICE_PROCESSING = binding.VOICE_PROCESSING;
} catch (error) {
break exceptionLanding152;
}
try {
object = {};
} catch (error) {
break exceptionLanding152;
}
try {
object.noise_canceller_error = r6;
} catch (error) {
break exceptionLanding152;
}
try {
Reflect.apply(track, value35, [VOICE_PROCESSING, object]);
} catch (error) {
break exceptionLanding152;
}
break reduciblePort151;
}
env2_112 = false;
return value;
}
try {
try {
binding2 = env2_3;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
property = binding2[67];
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
value4 = binding(property);
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
ensureModule = value4.ensureModule;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
value5 = Reflect.apply(ensureModule, value4, ['discord_krisp']);
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
yield value5;
try {
try {
value6 = undefined;
value7 = false;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
if (value7) {
env2_112 = false;
return value6;
}
try {
try {
binding = env2_1;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
binding3 = env2_3;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
property = binding3[67];
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
value8 = binding(property);
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
requireModule = value8.requireModule;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
value9 = Reflect.apply(requireModule, value8, ['discord_krisp']);
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
env2_113 = true;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
getSdkVersion = value9.getSdkVersion;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
value10 = getSdkVersion == null;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
reducibleJoin29: while (true) {
if (value10) {
r9 = value;
break reducibleJoin29;
}
try {
try {
getSdkVersion = value9.getSdkVersion;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
value11 = Reflect.apply(getSdkVersion, value9, []);
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
r9 = value11;
break reducibleJoin29;
}
try {
try {
env2_115 = r9;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
getSuppressionLevel = value9.getSuppressionLevel;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
value12 = getSuppressionLevel == null;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
reducibleJoin37: while (true) {
if (value12) {
r9 = value;
break reducibleJoin37;
}
try {
try {
getSuppressionLevel = value9.getSuppressionLevel;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
value13 = Reflect.apply(getSuppressionLevel, value9, []);
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
r9 = value13;
break reducibleJoin37;
}
try {
try {
value14 = r9 != null;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
value15 = 100;
reducibleJoin41: while (true) {
if (value14) {
break reducibleJoin41;
}
r9 = value15;
break reducibleJoin41;
}
try {
try {
env2_116 = r9;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
getNcModels = value9.getNcModels;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
value16 = getNcModels == null;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
reducibleJoin52: while (true) {
if (value16) {
break reducibleJoin52;
}
try {
try {
getNcModels = value9.getNcModels;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
value17 = Reflect.apply(getNcModels, value9, []);
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
then = value17.then;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
closure = _fun35580;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
Reflect.apply(then, value17, [closure]);
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
break reducibleJoin52;
}
try {
try {
binding = env2_74;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
emitChange = binding.emitChange;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
Reflect.apply(emitChange, binding, []);
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
binding = env2_1;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
binding4 = env2_3;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
property = binding4[67];
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
value18 = binding(property);
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
ensureModule = value18.ensureModule;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
value19 = Reflect.apply(ensureModule, value18, ['discord_voice']);
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
yield value19;
try {
try {
value20 = undefined;
value21 = false;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
if (value21) {
env2_112 = false;
return value20;
}
try {
try {
binding = env2_1;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
binding5 = env2_3;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
property = binding5[67];
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
value22 = binding(property);
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
requireModule = value22.requireModule;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
value23 = Reflect.apply(requireModule, value22, ['discord_voice']);
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
setupKrispPath = value23.setupKrispPath;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
value24 = setupKrispPath == null;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
reducibleJoin77: while (true) {
if (value24) {
break reducibleJoin77;
}
try {
try {
setupKrispPath = value23.setupKrispPath;
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
try {
try {
Reflect.apply(setupKrispPath, value23, []);
} catch (error) {
break exceptionLanding80;
}
} catch (error) {
break exceptionLanding152;
}
break reducibleJoin77;
}
env2_112 = false;
return value;
}
throw error;
function _fun35580(a0) { // fn#35580, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:33051, offset: 0x01078c51, size: 28 bytes, params: 2, frame: 9
env3_118 = a0;
env3_74.emitChange();
}
}
}
function maybeSetupKrispModule() { // fn#35581, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:33724, offset: 0x01078c6d, size: 264 bytes, params: 1, frame: 14
var moduleValue4;
var binding;
var moduleValue5;
let r2 = (require(477) /* metro dependency 477: PlatformUtils */).isWindows() || (require(477) /* metro dependency 477: PlatformUtils */).isLinux();
r2 = !r2 ? (require(477) /* metro dependency 477: PlatformUtils */).isMac() : r2;
if (r2) {
if (env0_112) {
moduleValue4 = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue4.isWeb()) {
binding = env0_77;
if (binding.supports(Features.NOISE_CANCELLATION)) {
env0_74.emitChange();
} else {
moduleValue5 = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue5.isWeb()) {
mergeSettings({noiseCancellation: false});
}
}
} else {
moduleValue5 = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue5.isWeb()) {
mergeSettings({noiseCancellation: false});
}
}
} else if (env0_113) {
moduleValue4 = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue4.isWeb()) {
binding = env0_77;
if (binding.supports(Features.NOISE_CANCELLATION)) {
env0_74.emitChange();
} else {
moduleValue5 = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue5.isWeb()) {
mergeSettings({noiseCancellation: false});
}
}
} else {
moduleValue5 = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue5.isWeb()) {
mergeSettings({noiseCancellation: false});
}
}
} else {
(function() {
return _setupKrispNativeModule.apply(this, arguments);
})();
}
} else {
moduleValue4 = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue4.isWeb()) {
binding = env0_77;
if (binding.supports(Features.NOISE_CANCELLATION)) {
env0_74.emitChange();
} else {
moduleValue5 = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue5.isWeb()) {
mergeSettings({noiseCancellation: false});
}
}
} else {
moduleValue5 = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue5.isWeb()) {
mergeSettings({noiseCancellation: false});
}
}
}
}
function _downloadOpenH() { // fn#35583, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:34111, offset: 0x01078d93, size: 48 bytes, params: 1, frame: 14
return Module00005(_fun35585).apply(this, arguments);
function* _fun35585() { // fn#35585, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:34162, offset: 0x01078dcc, size: 464 bytes, params: 1, frame: 26
var environment;
var r5;
var r10;
var fetchedFromNetwork;
var URL;
var parse;
var binding;
var value5;
var value6;
var pathname;
var split;
var value7;
var length;
var value8;
var property;
var replace;
var value9;
var binding2;
var value10;
var downloadOpenH264;
var binding3;
var closure;
var value11;
var value12;
var value13;
var log;
var error;
var error2;
var message;
var binding4;
var track;
var VIDEO_OPENH264_DOWNLOADED;
var object;
var binding5;
var cleanupUnusedOpenH264Files;
var value15;
var error3;
let value = undefined;
if (false) {
return value;
}
const value3 = false;
reducibleJoin4: while (true) {
reduciblePort91: while (true) {
exceptionLanding90: while (true) {
try {
URL = global.URL;
} catch (error) {
break exceptionLanding90;
}
break reducibleJoin4;
}
value = environment.__proto__.__proto__;
binding = env2_62;
error3 = binding.error;
Reflect.apply(error3, binding, ['OpenH264 download failed', error]);
break reduciblePort91;
}
return undefined;
}
try {
parse = URL.parse;
} catch (error) {
break exceptionLanding90;
}
try {
binding = env2_70;
} catch (error) {
break exceptionLanding90;
}
try {
value5 = Reflect.apply(parse, URL, [binding]);
} catch (error) {
break exceptionLanding90;
}
try {
value6 = value5 === null;
} catch (error) {
break exceptionLanding90;
}
if (value6) {
try {
binding = env2_62;
} catch (error) {
break exceptionLanding90;
}
try {
log = binding.log;
} catch (error) {
break exceptionLanding90;
}
try {
Reflect.apply(log, binding, ['OpenH264 URL ', value5, ' is invalid']);
} catch (error) {
break exceptionLanding90;
}
} else {
try {
pathname = value5.pathname;
} catch (error) {
break exceptionLanding90;
}
try {
split = pathname.split;
} catch (error) {
break exceptionLanding90;
}
try {
value7 = Reflect.apply(split, pathname, ['/']);
} catch (error) {
break exceptionLanding90;
}
try {
length = value7.length;
} catch (error) {
break exceptionLanding90;
}
try {
value8 = length - 1;
} catch (error) {
break exceptionLanding90;
}
try {
property = value7[value8];
} catch (error) {
break exceptionLanding90;
}
try {
replace = property.replace;
} catch (error) {
break exceptionLanding90;
}
try {
value9 = Reflect.apply(replace, property, ['.bz2', value]);
} catch (error) {
break exceptionLanding90;
}
reducibleJoin23: while (true) {
reduciblePort53: while (true) {
exceptionLanding46: while (true) {
try {
try {
binding = env2_1;
} catch (error) {
break exceptionLanding46;
}
} catch (error) {
break exceptionLanding90;
}
break reducibleJoin23;
}
try {
binding = env2_62;
} catch (error) {
break exceptionLanding90;
}
try {
error2 = binding.error;
} catch (error) {
break exceptionLanding90;
}
try {
Reflect.apply(error2, binding, ['OpenH264 download failed', error]);
} catch (error) {
break exceptionLanding90;
}
try {
message = error.message;
} catch (error) {
break exceptionLanding90;
}
r5 = value3;
r10 = message;
fetchedFromNetwork = value3;
break reduciblePort53;
}
try {
binding = env2_1;
} catch (error) {
break exceptionLanding90;
}
try {
binding4 = env2_3;
} catch (error) {
break exceptionLanding90;
}
try {
property = binding4[47];
} catch (error) {
break exceptionLanding90;
}
try {
value = binding(property);
} catch (error) {
break exceptionLanding90;
}
try {
track = value.track;
} catch (error) {
break exceptionLanding90;
}
try {
binding = env2_23;
} catch (error) {
break exceptionLanding90;
}
try {
VIDEO_OPENH264_DOWNLOADED = binding.VIDEO_OPENH264_DOWNLOADED;
} catch (error) {
break exceptionLanding90;
}
try {
object = {};
} catch (error) {
break exceptionLanding90;
}
try {
object.success = r5;
} catch (error) {
break exceptionLanding90;
}
try {
object.fetched_from_network = fetchedFromNetwork;
} catch (error) {
break exceptionLanding90;
}
try {
object.error_message = r10;
} catch (error) {
break exceptionLanding90;
}
try {
Reflect.apply(track, value, [VIDEO_OPENH264_DOWNLOADED, object]);
} catch (error) {
break exceptionLanding90;
}
if (r5) {
try {
binding = env2_1;
} catch (error) {
break exceptionLanding90;
}
try {
binding5 = env2_3;
} catch (error) {
break exceptionLanding90;
}
try {
property = binding5[67];
} catch (error) {
break exceptionLanding90;
}
try {
value = binding(property);
} catch (error) {
break exceptionLanding90;
}
try {
cleanupUnusedOpenH264Files = value.cleanupUnusedOpenH264Files;
} catch (error) {
break exceptionLanding90;
}
try {
object = [];
} catch (error) {
break exceptionLanding90;
}
try {
object[0] = value9;
} catch (error) {
break exceptionLanding90;
}
try {
value = Reflect.apply(cleanupUnusedOpenH264Files, value, [object]);
} catch (error) {
break exceptionLanding90;
}
yield value;
try {
value = undefined;
value15 = false;
} catch (error) {
break exceptionLanding90;
}
if (value15) {
return value;
}
try {
binding = env2_62;
} catch (error) {
break exceptionLanding90;
}
try {
log = binding.log;
} catch (error) {
break exceptionLanding90;
}
try {
Reflect.apply(log, binding, ['OpenH264 cleanup', value]);
} catch (error) {
break exceptionLanding90;
}
}
return undefined;
}
try {
try {
binding2 = env2_3;
} catch (error) {
break exceptionLanding46;
}
} catch (error) {
break exceptionLanding90;
}
try {
try {
property = binding2[67];
} catch (error) {
break exceptionLanding46;
}
} catch (error) {
break exceptionLanding90;
}
try {
try {
value10 = binding(property);
} catch (error) {
break exceptionLanding46;
}
} catch (error) {
break exceptionLanding90;
}
try {
try {
downloadOpenH264 = value10.downloadOpenH264;
} catch (error) {
break exceptionLanding46;
}
} catch (error) {
break exceptionLanding90;
}
try {
try {
binding = env2_70;
} catch (error) {
break exceptionLanding46;
}
} catch (error) {
break exceptionLanding90;
}
try {
try {
binding3 = env2_71;
} catch (error) {
break exceptionLanding46;
}
} catch (error) {
break exceptionLanding90;
}
try {
try {
} catch (error) {
break exceptionLanding46;
}
} catch (error) {
break exceptionLanding90;
}
try {
try {
closure = _fun35586;
} catch (error) {
break exceptionLanding46;
}
} catch (error) {
break exceptionLanding90;
}
try {
try {
value11 = Reflect.apply(downloadOpenH264, value10, [binding, value9, binding3, closure]);
} catch (error) {
break exceptionLanding46;
}
} catch (error) {
break exceptionLanding90;
}
yield value11;
try {
try {
value12 = undefined;
value13 = false;
} catch (error) {
break exceptionLanding46;
}
} catch (error) {
break exceptionLanding90;
}
if (value13) {
return value12;
}
try {
try {
binding = env2_62;
} catch (error) {
break exceptionLanding46;
}
} catch (error) {
break exceptionLanding90;
}
try {
try {
log = binding.log;
} catch (error) {
break exceptionLanding46;
}
} catch (error) {
break exceptionLanding90;
}
try {
try {
Reflect.apply(log, binding, ['OpenH264 is ready', value12]);
} catch (error) {
break exceptionLanding46;
}
} catch (error) {
break exceptionLanding90;
}
try {
try {
fetchedFromNetwork = value12.fetchedFromNetwork;
} catch (error) {
break exceptionLanding46;
}
} catch (error) {
break exceptionLanding90;
}
r5 = true;
r10 = value;
try {
binding = env2_1;
} catch (error) {
break exceptionLanding90;
}
try {
binding4 = env2_3;
} catch (error) {
break exceptionLanding90;
}
try {
property = binding4[47];
} catch (error) {
break exceptionLanding90;
}
try {
value = binding(property);
} catch (error) {
break exceptionLanding90;
}
try {
track = value.track;
} catch (error) {
break exceptionLanding90;
}
try {
binding = env2_23;
} catch (error) {
break exceptionLanding90;
}
try {
VIDEO_OPENH264_DOWNLOADED = binding.VIDEO_OPENH264_DOWNLOADED;
} catch (error) {
break exceptionLanding90;
}
try {
object = {};
} catch (error) {
break exceptionLanding90;
}
try {
object.success = r5;
} catch (error) {
break exceptionLanding90;
}
try {
object.fetched_from_network = fetchedFromNetwork;
} catch (error) {
break exceptionLanding90;
}
try {
object.error_message = r10;
} catch (error) {
break exceptionLanding90;
}
try {
Reflect.apply(track, value, [VIDEO_OPENH264_DOWNLOADED, object]);
} catch (error) {
break exceptionLanding90;
}
if (r5) {
try {
binding = env2_1;
} catch (error) {
break exceptionLanding90;
}
try {
binding5 = env2_3;
} catch (error) {
break exceptionLanding90;
}
try {
property = binding5[67];
} catch (error) {
break exceptionLanding90;
}
try {
value = binding(property);
} catch (error) {
break exceptionLanding90;
}
try {
cleanupUnusedOpenH264Files = value.cleanupUnusedOpenH264Files;
} catch (error) {
break exceptionLanding90;
}
try {
object = [];
} catch (error) {
break exceptionLanding90;
}
try {
object[0] = value9;
} catch (error) {
break exceptionLanding90;
}
try {
value = Reflect.apply(cleanupUnusedOpenH264Files, value, [object]);
} catch (error) {
break exceptionLanding90;
}
yield value;
try {
value = undefined;
value15 = false;
} catch (error) {
break exceptionLanding90;
}
if (value15) {
return value;
}
try {
binding = env2_62;
} catch (error) {
break exceptionLanding90;
}
try {
log = binding.log;
} catch (error) {
break exceptionLanding90;
}
try {
Reflect.apply(log, binding, ['OpenH264 cleanup', value]);
} catch (error) {
break exceptionLanding90;
}
}
}
function _fun35586(a0) { // fn#35586, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:34391, offset: 0x01078f9c, size: 32 bytes, params: 2, frame: 13
env3_62.log('OpenH264 download status', a0);
}
}
}
function maybeDownloadOpenH264() { // fn#35587, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:34823, offset: 0x01078fbc, size: 51 bytes, params: 1, frame: 11
if (PlatformUtilsModule.isLinux()) {
(function() {
return _downloadOpenH.apply(this, arguments);
})();
}
}
function setAudioSubsystem(a0) { // fn#35589, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:34953, offset: 0x0107900d, size: 89 bytes, params: 2, frame: 13
const AUTOMATIC = AudioSubsystems.AUTOMATIC;
if (a0 === AUTOMATIC) {
mergeSettings({automaticAudioSubsystem: true});
interpretAutomaticAudioSubsystem();
} else {
mergeSettings({automaticAudioSubsystem: false});
env0_77.setAudioSubsystem(a0);
}
}
function interpretAutomaticAudioSubsystem() { // fn#35590, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:35150, offset: 0x01079066, size: 32 bytes, params: 1, frame: 11
const binding = env0_77;
const queueAudioSubsystem = binding.queueAudioSubsystem;
const EXPERIMENTAL = AudioSubsystems.EXPERIMENTAL;
Reflect.apply(queueAudioSubsystem, binding, [EXPERIMENTAL]);
}
function processQueueMetricsForAnalytics(a0) { // fn#35592, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:53403, offset: 0x010790ae, size: 442 bytes, params: 2, frame: 26
var r3;
var property;
var value4;
var name;
var value5;
var longestExecTimeNs;
var value6;
var longestQueueTimeNs;
let taskMetrics = a0.taskMetrics;
if (taskMetrics == null) {
return null;
}
let length = a0.taskMetrics.length;
let value = 0;
if (value === length) {
return null;
}
if (a0.taskMetrics.length === 1) {
return null;
}
const object = {'metrics_period_ms': null, 'total_tasks': 0, 'total_exec_time_ns': 0};
object.metrics_period_ms = a0.periodMs;
object.queue_name = a0.queueName;
object.total_tasks = a0.taskMetrics.reduce(function(a0, a1) {
return a0 + a1.count;
}, value);
object.total_exec_time_ns = a0.taskMetrics.reduce(function(a0, a1) {
return a0 + a1.totalExecTimeNs;
}, value);
taskMetrics = a0.taskMetrics;
const items3 = [];
arraySpread(items3, taskMetrics, value, undefined);
const value2 = items3.sort(function(a0, {longestExecTimeNs}) {
return longestExecTimeNs - a0.longestExecTimeNs;
});
taskMetrics = a0.taskMetrics;
const items2 = [];
arraySpread(items2, taskMetrics, value, undefined);
const value3 = items2.sort(function(a0, {longestQueueTimeNs}) {
return longestQueueTimeNs - a0.longestQueueTimeNs;
});
let r10 = value;
while (true) {
length = value2.length;
if (r10 < length) {
property = value2[r10];
value4 = 'slow_task_' + r10 + '_name';
name = property.name;
object[value4] = name;
value5 = 'slow_task_' + r10 + '_longest_exec_time_ns';
longestExecTimeNs = property.longestExecTimeNs;
object[value5] = longestExecTimeNs;
}
value6 = typeof r10 === 'bigint' ? r10 + 1n : +r10 + 1;
if (value6 < 3) {
r10 = value6;
continue;
}
r3 = value;
break;
}
while (true) {
length = value3.length;
if (r3 < length) {
property = value3[r3];
value = 'delayed_task_' + r3 + '_name';
name = property.name;
object[value] = name;
value = 'delayed_task_' + r3 + '_longest_queue_time_ns';
longestQueueTimeNs = property.longestQueueTimeNs;
object[value] = longestQueueTimeNs;
}
value = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1;
if (value < 3) {
r3 = value;
continue;
}
break;
}
const JSON = global.JSON;
object.full_task_report = JSON.stringify(value2);
return object;
}
function _fun35597(a0) { // fn#35597, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:35321, offset: 0x010792bd, size: 2966 bytes, params: 2, frame: 16
const MediaEngineStore2 = MediaEngineStore;
Inherits(MediaEngineStore2, a0);
return CreateClass(MediaEngineStore2, [{key: 'initialize', value: value_35599}, {key: 'supports', value: value_35618},
{key: 'supportsInApp', value: value_35619}, {key: 'isSupported', value: value_35620},
{key: 'isNoiseSuppressionSupported', value: value_35621}, {key: 'isNoiseCancellationSupported',
value: function() {
return isKrispAvailable();
}}, {key: 'isNoiseCancellationError', value: value_35623}, {key: 'isAutomaticGainControlSupported',
value: value_35624}, {key: 'shouldOfferManualSubsystemSelection', value: value_35625},
{key: 'showBypassSystemInputProcessing', value: value_35626}, {key: 'isAdvancedVoiceActivitySupported',
value: function() {
return isKrispAvailable();
}}, {key: 'isAecDumpSupported', value: value_35628}, {key: 'isSimulcastSupported', value: value_35629},
{key: 'getAecDump', value: function() {
return _getSettings0().aecDumpEnabled;
}}, {key: 'getMediaEngine', value: value_35631}, {key: 'getVideoComponent', value: value_35632},
{key: 'getCameraComponent', value: value_35633}, {key: 'getKrispSuppressionLevel', value: value_35634},
{key: 'getKrispEnableStats', value: value_35635}, {key: 'isEnabled', value: value_35636}, {key: 'isMute',
value: value_35637}, {key: 'isDeaf', value: value_35638}, {key: 'isServerMute', value: value_35639},
{key: 'isServerDeaf', value: value_35640}, {key: 'getAudioMixerSettings', value: function() {
return _getSettings0().audioMixerSettings;
}}, {key: 'hasContext', value: value_35642}, {key: 'isSelfMutedTemporarily', value: value_35643},
{key: 'isSelfMute', value: value_35644}, {key: 'shouldSkipMuteUnmuteSound', value: value_35645},
{key: 'notifyMuteUnmuteSoundWasSkipped', value: function() {
env1_101 = false;
}}, {key: 'isHardwareMute', value: value_35647}, {key: 'isHardwareMuteNoticeEnabled', value: value_35648},
{key: 'isSelfDeaf', value: value_35649}, {key: 'isVideoEnabled', value: value_35650}, {key: 'isVideoAvailable',
value: value_35651}, {key: 'hasVideoDevice', value: value_35653}, {key: 'isScreenSharing', value: value_35654},
{key: 'isSoundSharing', value: value_35655}, {key: 'isLocalMute', value: value_35656},
{key: 'supportsDisableLocalVideo', value: value_35657}, {key: 'isLocalVideoDisabled', value: value_35658},
{key: 'getVideoToggleState', value: value_35659}, {key: 'isLocalVideoAutoDisabled', value: value_35660},
{key: 'isAnyLocalVideoAutoDisabled', value: value_35661}, {key: 'isMediaFilterSettingLoading',
value: value_35662}, {key: 'isNativeAudioPermissionReady', value: value_35663}, {key: 'getGoLiveSource',
value: value_35664}, {key: 'getGoLiveContext', value: function() {
return STREAM;
}}, {key: 'getLastAudioInputDeviceChangeTimestamp', value: value_35666}, {key: 'isH264MfDecodeAvailable',
value: value_35667}, {key: 'getLocalPan', value: value_35668}, {key: 'getLocalVolume', value: value_35669},
{key: 'getInputVolume', value: function() {
return _getSettings0().inputVolume;
}}, {key: 'getOutputVolume', value: function() {
return importDefault(dependencyMap[66]).getConfig({location: 'MediaEngineStore.getOutputVolume'}).audioOutputPresent ? _getSettings0().outputVolume : DEFAULT_VOLUME;
}}, {key: 'getMode', value: value_35672}, {key: 'getModeOptions', value: value_35673}, {key: 'getShortcuts',
value: value_35674}, {key: 'getInputDeviceId', value: value_35676}, {key: 'getOutputDeviceId',
value: value_35677}, {key: 'getVideoDeviceId', value: value_35678}, {key: 'getInputDevices',
value: value_35679}, {key: 'getOutputDevices', value: value_35680}, {key: 'getVideoDevices',
value: value_35681}, {key: 'getEchoCancellation', value: value_35682}, {key: 'getSidechainCompression',
value: value_35683}, {key: 'getSidechainCompressionStrength', value: function() {
return _getSettings0().sidechainCompressionStrength;
}}, {key: 'getH265Enabled', value: function() {
return _getSettings0().h265Enabled;
}}, {key: 'hasH265HardwareDecode', value: value_35686}, {key: 'getOpenH264Enabled', value: function() {
return require(dependencyMap[29]).isLinux() && _getSettings0().openH264Enabled;
}}, {key: 'getLoopback', value: value_35688}, {key: 'getLoopbackReasons', value: value_35689},
{key: 'getNoiseSuppression', value: value_35690}, {key: 'getAutomaticGainControl', value: value_35691},
{key: 'getBypassSystemInputProcessing', value: function() {
return _getSettings0().bypassSystemInputProcessing;
}}, {key: 'getNoiseCancellation', value: function() {
return _getSettings0().noiseCancellation;
}}, {key: 'getHardwareEncoding', value: function() {
return true;
}}, {key: 'getEnableSilenceWarning', value: function() {
return _getSettings0().silenceWarning;
}}, {key: 'getDebugLogging', value: value_35696}, {key: 'getQoS', value: function() {
return _getSettings0().qos;
}}, {key: 'getAttenuation', value: function() {
return _getSettings0().attenuation;
}}, {key: 'getAttenuateWhileSpeakingSelf', value: function() {
return _getSettings0().attenuateWhileSpeakingSelf;
}}, {key: 'getAttenuateWhileSpeakingOthers', value: function() {
return _getSettings0().attenuateWhileSpeakingOthers;
}}, {key: 'getAudioSubsystem', value: value_35701}, {key: 'getMLSSigningKey', value: value_35702},
{key: 'getActiveInputProfile', value: function() {
return _getSettings0().activeInputProfile;
}}, {key: 'isInputProfileCustom', value: function() {
var value = this.getActiveInputProfile();
return value == null || value === InputProfile.CUSTOM;
}}, {key: 'getSettings', value: value_35705}, {key: 'getState', value: value_35706},
{key: 'getInputDetectedThisConnection', value: value_35707}, {key: 'getInputDetected', value: value_35708},
{key: 'getLastInputDetectedUpdateTime', value: value_35709}, {key: 'getNoInputDetectedNotice',
value: value_35710}, {key: 'getInputDeviceOSMuted', value: value_35711}, {key: 'getInputDeviceOSVolume',
value: value_35712}, {key: 'getPacketDelay', value: function() {
return require(dependencyMap[29]).isPlatformEmbedded || this.getMode() !== InputModes.VOICE_ACTIVITY ? 0 : this.getModeOptions().vadLeading;
}}, {key: 'setCanHavePriority', value: value_35714}, {key: 'isInteractionRequired', value: value_35716},
{key: 'getVideoHook', value: function() {
return _getSettings0().videoHook;
}}, {key: 'supportsVideoHook', value: value_35718}, {key: 'getExperimentalSoundshare', value: value_35719},
{key: 'supportsExperimentalSoundshare', value: value_35720}, {key: 'supportsHookSoundshare',
value: value_35721}, {key: 'getUseSystemScreensharePicker', value: function() {
var value = this.supportsSystemScreensharePicker();
var useSystemScreensharePicker = _getSettings0().useSystemScreensharePicker;
return value && (useSystemScreensharePicker ?? require(dependencyMap[29]).isLinux());
}}, {key: 'supportsSystemScreensharePicker', value: value_35723}, {key: 'getUseVaapiEncoder', value: value_35724},
{key: 'getVideoEncoderExperiments', value: value_35725}, {key: 'getUseGamescopeCapture', value: value_35726},
{key: 'getSpeakingWhileMuted', value: value_35727}, {key: 'getKrispModelOverride', value: value_35728},
{key: 'getKrispModels', value: value_35729}, {key: 'getKrispVadActivationThreshold', value: value_35730},
{key: 'hasActiveCallKitCall', value: value_35731}, {key: 'setHasActiveCallKitCall', value: function(a0) {
env1_139 = a0;
}}, {key: 'supportsScreenSoundshare', value: value_35733}, {key: 'getSystemMicrophoneMode', value: value_35734},
{key: 'getVideoStreamParameters', value: value_35736}, {key: 'fetchAsyncResources', value: value_35737},
{key: 'startDavePreload', value: value_35738}, {key: 'getSupportedSecureFramesProtocolVersion',
value: value_35740}, {key: 'hasClipsSource', value: value_35741}, {key: 'getGpuBrand', value: value_35742}]);
function MediaEngineStore() { // fn#35598, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:35333, offset: 0x01079e53, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_4(this, MediaEngineStore);
const value3 = env1_7(MediaEngineStore);
return env1_6(this, _isNativeReflectConstruct_35471() ? global.Reflect.construct(value3, arguments,
env1_7(this).constructor) : value3.apply(this, arguments));
}
function value_35599() { // fn#35599, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:35631, offset: 0x01079ec4, size: 444 bytes, params: 1, frame: 32
setupMediaEngine();
loadSettings();
maybeSetupKrispModule();
maybeDownloadOpenH264();
resetProbingState();
maybeStartPollQueueMetrics();
if ((require(477) /* metro dependency 477: PlatformUtils */).isWindows() && (require(477) /* metro dependency 477: PlatformUtils */).isPlatformEmbedded) {
checkH264MfDecodeAvailability();
}
if ((require(477) /* metro dependency 477: PlatformUtils */).isAndroid() && (require(4092) /* metro dependency 4092: DeviceUtils */).getSystemVersion != null && global.parseInt((require(4092) /* metro dependency 4092: DeviceUtils */).getSystemVersion(),
10) >= 30) {
checkAndroidAV1HwDecodeAvailability();
}
const object = {};
const VIDEO = Features.VIDEO;
let binding = env1_77;
let supports = binding.supports;
const VIDEO2 = Features.VIDEO;
object[VIDEO] = Reflect.apply(supports, binding, [VIDEO2]);
const DESKTOP_CAPTURE = Features.DESKTOP_CAPTURE;
binding = env1_77;
supports = binding.supports;
const DESKTOP_CAPTURE2 = Features.DESKTOP_CAPTURE;
object[DESKTOP_CAPTURE] = Reflect.apply(supports, binding, [DESKTOP_CAPTURE2]);
const HYBRID_VIDEO = Features.HYBRID_VIDEO;
binding = env1_77;
supports = binding.supports;
const HYBRID_VIDEO2 = Features.HYBRID_VIDEO;
object[HYBRID_VIDEO] = Reflect.apply(supports, binding, [HYBRID_VIDEO2]);
this.waitFor(AuthenticationStore, BitRateStore, CertifiedDeviceStore, ChannelStore, ClipsStore, ExperimentStore,
RTCConnectionStore, RunningGameStoreNative, UserSettingsProtoStore, UserStore, VideoQualityModeStore);
function loadSettings() { // fn#35600, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:35672, owner: value_35599.loadSettings, offset: 0x0107a080, size: 232 bytes, params: 1, frame: 22
const Storage = (StorageModule).Storage;
const value2 = Storage.get('audio');
if (value2 != null) {
Storage.set(env2_63, {[MediaEngineContextTypes.DEFAULT]: value2});
Storage.remove('audio');
}
env2_82 = Storage.get(env2_63) ?? ({});
const defaultImport = Module00022;
defaultImport.each(env2_82, _fun35601);
applySettings();
function _fun35601(a0) { // fn#35601, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:35892, offset: 0x0107a168, size: 487 bytes, params: 2, frame: 17
var r7;
var moduleValue;
var object;
let value = environment.__proto__.__proto__.__proto__;
const value2 = undefined;
const defaultImport = Module00022;
defaultImport.defaultsDeep(a0, getDefaultSettings());
let modeOptions = a0.modeOptions;
if (modeOptions != null && typeof a0.modeOptions.shortcut === 'string') {
modeOptions = a0.modeOptions;
moduleValue = require(12478) /* metro dependency 12478: KeyboardUtils */;
modeOptions.shortcut = moduleValue.toCombo(a0.modeOptions.shortcut);
r7 = moduleValue;
}
if (a0.modeOptions != null && a0.vadUseKrispSettingVersion !== 4) {
a0.vadUseKrispSettingVersion = 4;
a0.modeOptions.vadUseKrisp = true;
}
if (!a0.qosMigrated) {
a0.qosMigrated = true;
a0.qos = false;
}
if (!a0.vadThrehsoldMigrated) {
a0.vadThrehsoldMigrated = true;
modeOptions = a0.modeOptions;
if ((modeOptions == null ? value2 : modeOptions.threshold) === -40) {
a0.modeOptions.threshold = -60;
}
}
const binding = env3_77;
const supports = binding.supports;
const SIDECHAIN_COMPRESSION = Features.SIDECHAIN_COMPRESSION;
if (Reflect.apply(supports, binding, [SIDECHAIN_COMPRESSION]) && a0.sidechainCompressionSettingVersion < 1) {
a0.sidechainCompressionSettingVersion = 1;
a0.sidechainCompression = true;
}
if (a0.audioMixerSettingsVersion < 1) {
a0.audioMixerSettingsVersion = 1;
object = {};
copyDataProperties(object, DEFAULT_AUDIO_MIXER_SETTINGS, r7);
a0.audioMixerSettings = object;
}
value = require(477) /* metro dependency 477: PlatformUtils */;
if (value.isWeb()) {
if (a0.ncUseKrispjsSettingVersion !== 1) {
a0.ncUseKrispjsSettingVersion = 1;
a0.noiseSuppression = false;
a0.noiseCancellation = true;
}
} else if (a0.ncUseKrispSettingVersion !== 1) {
a0.ncUseKrispSettingVersion = 1;
a0.noiseSuppression = false;
a0.noiseCancellation = true;
}
return value2;
}
}
function maybeStartPollQueueMetrics() { // fn#35602, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:36939, owner: value_35599.maybeStartPollQueueMetrics, offset: 0x0107a34f, size: 112 bytes, params: 1, frame: 15
if (PlatformUtilsModule.isDesktop()) {
if (PlatformUtilsModule.isPlatformEmbedded) {
if (!env2_142) {
global.setTimeout(_fun35603(), QUEUE_METRICS_INTERVAL_MS);
}
}
}
function _fun35603() { // fn#35603, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:37052, offset: 0x0107a3bf, size: 32 bytes, params: 1, frame: 12
const env0_0 = env3_10(_fun35605);
return pollMetrics;
function* _fun35605() { // fn#35605, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:37072, offset: 0x0107a3e8, size: 158 bytes, params: 1, frame: 18
var environment;
var value5;
if (true) {
var Promise = global.Promise;
var promise = new Promise(_fun35606);
yield promise;
promise = undefined;
if (false) {
return promise;
}
promise.periodMs = env5_57;
promise = env5_198(promise);
if (promise !== null) {
value5 = env5_1(env5_3[47]);
value5.track(env5_23.VOICE_QUEUE_METRICS, promise);
}
var setTimeout = global.setTimeout;
promise = environment.__proto__.__proto__;
setTimeout(env2_0, env5_57);
}
function _fun35606(a0) { // fn#35606, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:37109, offset: 0x0107a486, size: 52 bytes, params: 2, frame: 12
var environment;
const env0_0 = a0;
const value = environment.__proto__.__proto__.__proto__.__proto__.__proto__.__proto__;
env6_1(env6_3[67]).pollQueueMetrics(_fun35607);
function _fun35607(a0) { // fn#35607, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:37143, offset: 0x00cee816, size: 19 bytes, params: 2, frame: 11
env0_0(a0);
}
}
}
function pollMetrics() { // fn#35608, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:37293, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
}
}
function checkH264MfDecodeAvailability() { // fn#35609, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:37427, owner: value_35599.checkH264MfDecodeAvailability, offset: 0x0107a4ba, size: 80 bytes, params: 1, frame: 12
var environment;
let value = environment.__proto__.__proto__;
if (env2_88 === null) {
value = env2_77.getCodecSurvey();
value = value.then(_fun35610);
value = value.catch(_fun35612);
value.finally(_fun35613);
}
function _fun35610(a0) { // fn#35610, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:37505, offset: 0x0107a50a, size: 149 bytes, params: 2, frame: 15
var environment;
var JSON;
var parse;
var value;
var value2;
var available_video_decoders;
var value3;
var some;
var closure;
var value4;
var Error;
var prototype;
var error;
var binding;
var error2;
reducibleJoin3: while (true) {
reduciblePort25: while (true) {
exceptionLanding24: while (true) {
try {
JSON = global.JSON;
} catch (error) {
break exceptionLanding24;
}
break reducibleJoin3;
}
value = environment.__proto__.__proto__.__proto__;
binding = env3_62;
error2 = binding.error;
Reflect.apply(error2, binding, ['Failed to parse codec survey', error]);
env3_88 = false;
break reduciblePort25;
}
return undefined;
}
try {
parse = JSON.parse;
} catch (error) {
break exceptionLanding24;
}
try {
value = Reflect.apply(parse, JSON, [a0]);
} catch (error) {
break exceptionLanding24;
}
try {
value2 = value == null;
} catch (error) {
break exceptionLanding24;
}
if (!value2) {
try {
available_video_decoders = value.available_video_decoders;
} catch (error) {
break exceptionLanding24;
}
try {
value3 = available_video_decoders == null;
} catch (error) {
break exceptionLanding24;
}
reducibleJoin17: while (true) {
if (!value3) {
try {
available_video_decoders = value.available_video_decoders;
} catch (error) {
break exceptionLanding24;
}
try {
some = available_video_decoders.some;
} catch (error) {
break exceptionLanding24;
}
try {
} catch (error) {
break exceptionLanding24;
}
try {
closure = function(a0) {
return a0 === 'MediaFoundation H.264';
};
} catch (error) {
break exceptionLanding24;
}
try {
value = Reflect.apply(some, available_video_decoders, [closure]);
} catch (error) {
break exceptionLanding24;
}
value4 = environment.__proto__.__proto__.__proto__;
try {
env3_88 = value;
} catch (error) {
break exceptionLanding24;
}
return undefined;
}
break reducibleJoin17;
}
}
try {
Error = global.Error;
} catch (error) {
break exceptionLanding24;
}
try {
prototype = Error.prototype;
} catch (error) {
break exceptionLanding24;
}
try {
} catch (error) {
break exceptionLanding24;
}
try {
error = new Error('decoder survey is not available');
} catch (error) {
break exceptionLanding24;
}
try {
value = error instanceof Object ? error : value;
} catch (error) {
break exceptionLanding24;
}
try {
throw value;
} catch (error) {
break exceptionLanding24;
}
}
function _fun35612(a0) { // fn#35612, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:37775, offset: 0x0107a5ae, size: 37 bytes, params: 2, frame: 14
env3_62.error('Failed to get codec survey', a0);
}
function _fun35613() { // fn#35613, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:37838, offset: 0x0107a5d3, size: 49 bytes, params: 1, frame: 13
const value = environment.__proto__.__proto__.__proto__;
(Dispatcher).dispatch({type: 'MEDIA_ENGINE_MF_AVAILABILITY_CHECKED'});
}
}
function checkAndroidAV1HwDecodeAvailability() { // fn#35614, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:38024, owner: value_35599.checkAndroidAV1HwDecodeAvailability, offset: 0x0107a604, size: 64 bytes, params: 1, frame: 12
var environment;
let value = environment.__proto__.__proto__;
if (env2_89 === null) {
value = env2_77.getCodecSurvey();
value = value.then(_fun35615);
value.catch(_fun35617);
}
function _fun35615(a0) { // fn#35615, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:38108, offset: 0x0107a644, size: 175 bytes, params: 2, frame: 15
var environment;
var JSON;
var parse;
var value;
var value2;
var available_video_decoders;
var value3;
var some;
var closure;
var value4;
var binding;
var info;
var binding2;
var Error;
var prototype;
var error;
var error2;
reducibleJoin3: while (true) {
reduciblePort30: while (true) {
exceptionLanding29: while (true) {
try {
JSON = global.JSON;
} catch (error) {
break exceptionLanding29;
}
break reducibleJoin3;
}
value = environment.__proto__.__proto__.__proto__;
binding = env3_62;
error2 = binding.error;
Reflect.apply(error2, binding, ['Failed to parse codec survey', error]);
env3_89 = false;
break reduciblePort30;
}
return undefined;
}
try {
parse = JSON.parse;
} catch (error) {
break exceptionLanding29;
}
try {
value = Reflect.apply(parse, JSON, [a0]);
} catch (error) {
break exceptionLanding29;
}
try {
value2 = value == null;
} catch (error) {
break exceptionLanding29;
}
if (!value2) {
try {
available_video_decoders = value.available_video_decoders;
} catch (error) {
break exceptionLanding29;
}
try {
value3 = available_video_decoders == null;
} catch (error) {
break exceptionLanding29;
}
reducibleJoin22: while (true) {
if (!value3) {
try {
available_video_decoders = value.available_video_decoders;
} catch (error) {
break exceptionLanding29;
}
try {
some = available_video_decoders.some;
} catch (error) {
break exceptionLanding29;
}
try {
} catch (error) {
break exceptionLanding29;
}
try {
closure = function(a0) {
return a0.startsWith('video/av01') && a0.endsWith('(HW)');
};
} catch (error) {
break exceptionLanding29;
}
try {
value = Reflect.apply(some, available_video_decoders, [closure]);
} catch (error) {
break exceptionLanding29;
}
value4 = environment.__proto__.__proto__.__proto__;
try {
env3_89 = value;
} catch (error) {
break exceptionLanding29;
}
try {
binding = env3_62;
} catch (error) {
break exceptionLanding29;
}
try {
info = binding.info;
} catch (error) {
break exceptionLanding29;
}
try {
binding2 = env3_89;
} catch (error) {
break exceptionLanding29;
}
try {
Reflect.apply(info, binding, ['AV1 decode detection complete. presence = ', binding2]);
} catch (error) {
break exceptionLanding29;
}
return undefined;
}
break reducibleJoin22;
}
}
try {
Error = global.Error;
} catch (error) {
break exceptionLanding29;
}
try {
prototype = Error.prototype;
} catch (error) {
break exceptionLanding29;
}
try {
} catch (error) {
break exceptionLanding29;
}
try {
error = new Error('decoder survey is not available');
} catch (error) {
break exceptionLanding29;
}
try {
value = error instanceof Object ? error : value;
} catch (error) {
break exceptionLanding29;
}
try {
throw value;
} catch (error) {
break exceptionLanding29;
}
}
function _fun35617(a0) { // fn#35617, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:38454, offset: 0x0107a71d, size: 37 bytes, params: 2, frame: 14
env3_62.error('Failed to get codec survey', a0);
}
}
}
function value_35618(a0) { // fn#35618, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:38709, offset: 0x0107a742, size: 23 bytes, params: 2, frame: 11
return env1_77.supports(a0);
}
function value_35619(a0) { // fn#35619, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:38781, offset: 0x0107a759, size: 34 bytes, params: 2, frame: 12
const value = environment.__proto__;
return env1_132[a0] || env1_77.supports(a0);
}
function value_35620() { // fn#35620, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:38863, offset: 0x0107a77b, size: 19 bytes, params: 1, frame: 9
return env1_77.supported();
}
function value_35621() { // fn#35621, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:38951, offset: 0x0107a78e, size: 30 bytes, params: 1, frame: 11
const binding = env1_77;
const supports = binding.supports;
const NOISE_SUPPRESSION = Features.NOISE_SUPPRESSION;
return Reflect.apply(supports, binding, [NOISE_SUPPRESSION]);
}
function value_35623() { // fn#35623, offset: 0x0107a7bb, size: 9 bytes, params: 1, frame: 1
return env1_121;
}
function value_35624() { // fn#35624, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:39274, offset: 0x0107a7c4, size: 30 bytes, params: 1, frame: 11
const binding = env1_77;
const supports = binding.supports;
const AUTOMATIC_GAIN_CONTROL = Features.AUTOMATIC_GAIN_CONTROL;
return Reflect.apply(supports, binding, [AUTOMATIC_GAIN_CONTROL]);
}
function value_35625() { // fn#35625, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:39414, offset: 0x0107a7e2, size: 77 bytes, params: 1, frame: 13
const value = environment.__proto__;
return !isReadyToMigrateToSingleAdmOffering() && (env1_77.supports(Features.LEGACY_AUDIO_SUBSYSTEM) || env1_77.supports(Features.EXPERIMENTAL_AUDIO_SUBSYSTEM));
}
function value_35626() { // fn#35626, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:39641, offset: 0x0107a82f, size: 55 bytes, params: 1, frame: 12
var r0;
let value = environment.__proto__;
const binding = env1_77;
const supports = binding.supports;
const AUDIO_BYPASS_SYSTEM_INPUT_PROCESSING = Features.AUDIO_BYPASS_SYSTEM_INPUT_PROCESSING;
const value2 = Reflect.apply(supports, binding, [AUDIO_BYPASS_SYSTEM_INPUT_PROCESSING]);
if (value2) {
value = env1_77.getAudioSubsystem();
value = value === 'experimental';
r0 = value;
} else {
r0 = value2;
}
return r0;
}
function value_35628() { // fn#35628, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:39937, offset: 0x0107a866, size: 30 bytes, params: 1, frame: 11
const binding = env1_77;
const supports = binding.supports;
const AEC_DUMP = Features.AEC_DUMP;
return Reflect.apply(supports, binding, [AEC_DUMP]);
}
function value_35629() { // fn#35629, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:40035, offset: 0x0107a884, size: 58 bytes, params: 1, frame: 12
const value = environment.__proto__;
const binding = env1_77;
const supports = binding.supports;
const VIDEO = Features.VIDEO;
return Reflect.apply(supports, binding, [VIDEO]) && env1_77.supports(Features.SIMULCAST);
}
function value_35631() { // fn#35631, offset: 0x0107a8d3, size: 9 bytes, params: 1, frame: 1
return env1_77;
}
function value_35632() { // fn#35632, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:40308, offset: 0x0107a8dc, size: 15 bytes, params: 1, frame: 1
return env1_77.Video;
}
function value_35633() { // fn#35633, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:40387, offset: 0x0107a8eb, size: 15 bytes, params: 1, frame: 1
return env1_77.Camera;
}
function value_35634() { // fn#35634, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:40474, offset: 0x0107a8fa, size: 25 bytes, params: 1, frame: 3
return env1_116 ?? 100;
}
function value_35635() { // fn#35635, offset: 0x0107a913, size: 9 bytes, params: 1, frame: 1
return env1_119;
}
function value_35636() { // fn#35636, offset: 0x0107a91c, size: 9 bytes, params: 1, frame: 1
return env1_84;
}
function value_35637() { // fn#35637, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:40687, offset: 0x0107a925, size: 25 bytes, params: 1, frame: 9
return this.isSelfMute() || env1_94;
}
function value_35638() { // fn#35638, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:40756, offset: 0x0107a93e, size: 25 bytes, params: 1, frame: 9
return this.isSelfDeaf() || env1_97;
}
function value_35639() { // fn#35639, offset: 0x0107a957, size: 9 bytes, params: 1, frame: 1
return env1_94;
}
function value_35640() { // fn#35640, offset: 0x0107a960, size: 9 bytes, params: 1, frame: 1
return env1_97;
}
function value_35642(a0) { // fn#35642, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:41065, offset: 0x0107a97e, size: 22 bytes, params: 2, frame: 2
return env1_82[a0] != null;
}
function value_35643() { // fn#35643, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:41145, offset: 0x0107a994, size: 48 bytes, params: 1, frame: 3
let value = a0;
const r2 = value !== undefined ? value : MediaEngineContextTypes.DEFAULT;
value = environment.__proto__;
const DEFAULT = MediaEngineContextTypes.DEFAULT;
return r2 === DEFAULT && env1_95;
}
function value_35644() { // fn#35644, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:41243, offset: 0x0107a9c4, size: 155 bytes, params: 1, frame: 16
var r3;
var r0;
var defaultImport;
let value = a0;
if (value !== undefined) {
r3 = value;
} else {
value = environment.__proto__;
r3 = MediaEngineContextTypes.DEFAULT;
}
if (value) {
value = environment.__proto__;
r0 = _getSettings0(r3).mute;
} else {
r0 = !this.isEnabled();
}
if (!r0) {
value = environment.__proto__;
defaultImport = importDefault(4662) /* metro dependency 4662: NativePermissionUtils */;
value = !defaultImport.didHavePermission(NativePermissionTypes.AUDIO);
r0 = value;
}
r0 = !r0 ? this.isSelfDeaf(r3) : r0;
r0 = !r0 ? r3 === MediaEngineContextTypes.DEFAULT && env1_96 : r0;
return r0;
}
function value_35645() { // fn#35645, offset: 0x0107aa5f, size: 9 bytes, params: 1, frame: 1
return env1_101;
}
function value_35647() { // fn#35647, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:41619, offset: 0x0107aa75, size: 157 bytes, params: 1, frame: 15
let value = a0;
const r4 = value !== undefined ? value : MediaEngineContextTypes.DEFAULT;
value = environment.__proto__;
return !this.isMute() && !this.isSelfMutedTemporarily(r4) && (CertifiedDeviceStore.isHardwareMute(this.getInputDeviceId()) || env1_137 && this.getSystemMicrophoneMode() !== 'voice_isolation' && _getSettings0(r4).mode === InputModes.VOICE_ACTIVITY);
}
function value_35648() { // fn#35648, offset: 0x0107ab12, size: 9 bytes, params: 1, frame: 1
return env1_136;
}
function value_35649() { // fn#35649, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:41980, offset: 0x0107ab1b, size: 61 bytes, params: 1, frame: 12
return a0 ? _getSettings0(environment.__proto__ !== undefined ? environment.__proto__ : MediaEngineContextTypes.DEFAULT).deaf : !this.isSupported();
}
function value_35650() { // fn#35650, offset: 0x0107ab58, size: 16 bytes, params: 1, frame: 3
return env1_98 && env1_105;
}
function value_35651() { // fn#35651, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:42165, offset: 0x0107ab68, size: 45 bytes, params: 1, frame: 11
var environment;
const Object = global.Object;
const values = Object.values;
const value = environment.__proto__;
return Reflect.apply(values, Object, [env1_92]).some(function(a0) {
return !a0.disabled;
});
}
function value_35653() { // fn#35653, offset: 0x0107aba2, size: 9 bytes, params: 1, frame: 1
return env1_105;
}
function value_35654() { // fn#35654, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:42342, offset: 0x0107abab, size: 48 bytes, params: 1, frame: 3
let value = a0;
const r2 = value !== undefined ? value : MediaEngineContextTypes.STREAM;
value = environment.__proto__;
return STREAM === r2 && env1_79 != null;
}
function value_35655() { // fn#35655, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:42434, offset: 0x0107abdb, size: 82 bytes, params: 1, frame: 5
let value = a0;
const value2 = undefined;
const r3 = value !== value2 ? value : MediaEngineContextTypes.STREAM;
value = environment.__proto__;
return STREAM === r3 && env1_79 != null && (env1_79.desktopSource == null ? value2 : env1_79.desktopSource.soundshareId) != null;
}
function value_35656(a0) { // fn#35656, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:42586, offset: 0x0107ac2d, size: 78 bytes, params: 2, frame: 14
let value = a1;
const r4 = value !== undefined ? value : MediaEngineContextTypes.DEFAULT;
value = environment.__proto__;
const authenticationStoreBinding = AuthenticationStore;
const getId = authenticationStoreBinding.getId;
return a0 !== Reflect.apply(getId, authenticationStoreBinding, []) && (_getSettings0(r4).localMutes[a0] || false);
}
function value_35657() { // fn#35657, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:42723, offset: 0x0107ac7b, size: 30 bytes, params: 1, frame: 11
const binding = env1_77;
const supports = binding.supports;
const DISABLE_VIDEO = Features.DISABLE_VIDEO;
return Reflect.apply(supports, binding, [DISABLE_VIDEO]);
}
function value_35658(a0) { // fn#35658, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:42833, offset: 0x0107ac99, size: 61 bytes, params: 2, frame: 11
let value = a1;
const r2 = value !== undefined ? value : MediaEngineContextTypes.DEFAULT;
value = environment.__proto__;
const property = _getSettings0(r2).disabledLocalVideos[a0];
return property != null && property;
}
function value_35659(a0) { // fn#35659, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:42980, offset: 0x0107acd6, size: 65 bytes, params: 2, frame: 12
let value = a1;
const r3 = value !== undefined ? value : MediaEngineContextTypes.DEFAULT;
value = environment.__proto__;
return _getSettings0(r3).videoToggleStateMap[a0] ?? VideoToggleState.NONE;
}
function value_35660(a0) { // fn#35660, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:43137, offset: 0x0107ad17, size: 61 bytes, params: 2, frame: 12
let value = a1;
const r2 = value !== undefined ? value : MediaEngineContextTypes.DEFAULT;
value = environment.__proto__;
const DEFAULT = MediaEngineContextTypes.DEFAULT;
return r2 === DEFAULT && env1_128.has(a0);
}
function value_35661() { // fn#35661, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:43263, offset: 0x0107ad54, size: 59 bytes, params: 1, frame: 3
let value = a0;
const r2 = value !== undefined ? value : MediaEngineContextTypes.DEFAULT;
value = environment.__proto__;
const DEFAULT = MediaEngineContextTypes.DEFAULT;
return r2 === DEFAULT && env1_128.size > 0;
}
function value_35662() { // fn#35662, offset: 0x0107ad8f, size: 9 bytes, params: 1, frame: 1
return env1_122;
}
function value_35663() { // fn#35663, offset: 0x0107ad98, size: 9 bytes, params: 1, frame: 1
return env1_127;
}
function value_35664() { // fn#35664, offset: 0x0107ada1, size: 9 bytes, params: 1, frame: 1
return env1_79;
}
function value_35666() { // fn#35666, offset: 0x0107adaa, size: 9 bytes, params: 1, frame: 1
return env1_87;
}
function value_35667() { // fn#35667, offset: 0x0107adb3, size: 9 bytes, params: 1, frame: 1
return env1_88;
}
function value_35668(a0) { // fn#35668, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:43896, offset: 0x0107adbc, size: 59 bytes, params: 2, frame: 12
let value = a1;
const r3 = value !== undefined ? value : MediaEngineContextTypes.DEFAULT;
value = environment.__proto__;
return _getSettings0(r3).localPans[a0] ?? env1_64;
}
function value_35669(a0) { // fn#35669, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:44019, offset: 0x0107adf7, size: 82 bytes, params: 2, frame: 13
let value = a1;
const r3 = value !== undefined ? value : MediaEngineContextTypes.DEFAULT;
value = environment.__proto__;
const STREAM = MediaEngineContextTypes.STREAM;
let r0 = r3 === STREAM ? DEFAULT_STREAM_VOLUME : DEFAULT_VOLUME;
r0 = _getSettings0(r3).localVolumes[a0] ?? r0;
return r0;
}
function value_35672() { // fn#35672, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:44435, offset: 0x0107aead, size: 41 bytes, params: 1, frame: 11
let value = a0;
const r2 = value !== undefined ? value : MediaEngineContextTypes.DEFAULT;
value = environment.__proto__;
return _getSettings0(r2).mode;
}
function value_35673() { // fn#35673, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:44525, offset: 0x0107aed6, size: 42 bytes, params: 1, frame: 11
let value = a0;
const r2 = value !== undefined ? value : MediaEngineContextTypes.DEFAULT;
value = environment.__proto__;
return _getSettings0(r2).modeOptions;
}
function value_35674() { // fn#35674, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:44627, offset: 0x0107af00, size: 56 bytes, params: 1, frame: 15
const defaultImport = Module00022;
defaultImport.each(env1_82, _fun35675);
return {};
function _fun35675({mode, modeOptions}, a1) { // fn#35675, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:44688, offset: 0x0107af38, size: 75 bytes, params: 3, frame: 13
const shortcut = modeOptions.shortcut;
const value = environment.__proto__.__proto__;
const PUSH_TO_TALK = InputModes.PUSH_TO_TALK;
if (mode === PUSH_TO_TALK && env2_83.has(a1)) {
env0_0[a1] = shortcut;
}
}
}
function value_35676() { // fn#35676, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:44805, offset: 0x0107af83, size: 35 bytes, params: 1, frame: 13
return getDeviceId(env1_90, _getSettings0().inputDeviceId);
}
function value_35677() { // fn#35677, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:44919, offset: 0x0107afa6, size: 35 bytes, params: 1, frame: 13
return getDeviceId(env1_91, _getSettings0().outputDeviceId);
}
function value_35678() { // fn#35678, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:45034, offset: 0x0107afc9, size: 35 bytes, params: 1, frame: 13
return getDeviceId(env1_92, _getSettings0().videoDeviceId);
}
function value_35679() { // fn#35679, offset: 0x0107afec, size: 9 bytes, params: 1, frame: 1
return env1_90;
}
function value_35680() { // fn#35680, offset: 0x0107aff5, size: 9 bytes, params: 1, frame: 1
return env1_91;
}
function value_35681() { // fn#35681, offset: 0x0107affe, size: 9 bytes, params: 1, frame: 1
return env1_92;
}
function value_35682() { // fn#35682, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:45356, offset: 0x0107b007, size: 45 bytes, params: 1, frame: 12
const value = environment.__proto__;
const value2 = _getSettings0();
const certifiedDeviceStoreBinding = CertifiedDeviceStore;
return certifiedDeviceStoreBinding.hasEchoCancellation(value2.inputDeviceId) || value2.echoCancellation;
}
function value_35683() { // fn#35683, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:45514, offset: 0x0107b034, size: 49 bytes, params: 1, frame: 12
const binding = env1_77;
const supports = binding.supports;
const SIDECHAIN_COMPRESSION = Features.SIDECHAIN_COMPRESSION;
return Reflect.apply(supports, binding, [SIDECHAIN_COMPRESSION]) && _getSettings0().sidechainCompression;
}
function value_35686() { // fn#35686, offset: 0x0107b08f, size: 22 bytes, params: 1, frame: 3
return env1_125 !== null && env1_125;
}
function value_35688() { // fn#35688, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:46108, offset: 0x0107b0db, size: 20 bytes, params: 1, frame: 2
return env1_130.size > 0;
}
function value_35689() { // fn#35689, offset: 0x0107b0ef, size: 9 bytes, params: 1, frame: 1
return env1_130;
}
function value_35690() { // fn#35690, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:46257, offset: 0x0107b0f8, size: 45 bytes, params: 1, frame: 12
const value = environment.__proto__;
const value2 = _getSettings0();
const certifiedDeviceStoreBinding = CertifiedDeviceStore;
return certifiedDeviceStoreBinding.hasNoiseSuppression(value2.inputDeviceId) || value2.noiseSuppression;
}
function value_35691() { // fn#35691, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:46415, offset: 0x0107b125, size: 45 bytes, params: 1, frame: 12
const value = environment.__proto__;
const value2 = _getSettings0();
const certifiedDeviceStoreBinding = CertifiedDeviceStore;
return certifiedDeviceStoreBinding.hasAutomaticGainControl(value2.inputDeviceId) || value2.automaticGainControl;
}
function value_35696() { // fn#35696, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:47015, offset: 0x0107b191, size: 19 bytes, params: 1, frame: 9
return env1_77.getDebugLogging();
}
function value_35701() { // fn#35701, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:47539, offset: 0x0107b1f8, size: 61 bytes, params: 1, frame: 10
const value = environment.__proto__;
return supportsAutomaticAudioSubsystem() && _getSettings0().automaticAudioSubsystem ? AudioSubsystems.AUTOMATIC : env1_77.getAudioSubsystem();
}
function value_35702(a0, a1) { // fn#35702, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:47717, offset: 0x0107b235, size: 27 bytes, params: 3, frame: 13
return env1_77.getMLSSigningKey(a0, a1);
}
function value_35705() { // fn#35705, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:48051, offset: 0x0107b28e, size: 36 bytes, params: 1, frame: 11
let value = a0;
const r2 = value !== undefined ? value : MediaEngineContextTypes.DEFAULT;
value = environment.__proto__;
return _getSettings0(r2);
}
function value_35706() { // fn#35706, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:48134, offset: 0x0107b2b2, size: 101 bytes, params: 1, frame: 3
return {settingsByContext: env1_82, inputDevices: env1_90, outputDevices: env1_91, appSupported: env1_132,
krispModuleLoaded: env1_113, krispFatalError: env1_114, krispVersion: env1_115, krispSuppressionLevel: env1_116,
goLiveSource: env1_79, goLiveContext: STREAM};
}
function value_35707() { // fn#35707, offset: 0x0107b317, size: 9 bytes, params: 1, frame: 1
return env1_106;
}
function value_35708() { // fn#35708, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:48476, offset: 0x0107b320, size: 15 bytes, params: 1, frame: 1
return env1_81.inputDetected;
}
function value_35709() { // fn#35709, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:48574, offset: 0x0107b32f, size: 15 bytes, params: 1, frame: 1
return env1_81.lastUpdateTime;
}
function value_35710() { // fn#35710, offset: 0x0107b33e, size: 9 bytes, params: 1, frame: 1
return env1_107;
}
function value_35711() { // fn#35711, offset: 0x0107b347, size: 9 bytes, params: 1, frame: 1
return env1_109;
}
function value_35712() { // fn#35712, offset: 0x0107b350, size: 9 bytes, params: 1, frame: 1
return env1_110;
}
function value_35714(a0, a1) { // fn#35714, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:49086, offset: 0x0107b3ac, size: 43 bytes, params: 3, frame: 11
const env0_0 = a0;
const env0_1 = a1;
env1_77.eachConnection(_fun35715);
function _fun35715(a0) { // fn#35715, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:49138, offset: 0x0107b3d7, size: 28 bytes, params: 2, frame: 13
return a0.setCanHavePriority(env0_0, require);
}
}
function value_35716() { // fn#35716, offset: 0x0107b3f3, size: 9 bytes, params: 1, frame: 1
return env1_85;
}
function value_35718() { // fn#35718, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:49367, offset: 0x0107b411, size: 30 bytes, params: 1, frame: 11
const binding = env1_77;
const supports = binding.supports;
const VIDEO_HOOK = Features.VIDEO_HOOK;
return Reflect.apply(supports, binding, [VIDEO_HOOK]);
}
function value_35719() { // fn#35719, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:49471, offset: 0x0107b42f, size: 72 bytes, params: 1, frame: 12
var r1;
var r0;
let value = environment.__proto__;
const experimentalSoundshare2 = _getSettings0().experimentalSoundshare2;
value = this.supportsExperimentalSoundshare();
if (value) {
r1 = experimentalSoundshare2 == null || experimentalSoundshare2;
r1 = !r1 ? !this.supportsHookSoundshare() : r1;
r0 = r1;
} else {
r0 = value;
}
return r0;
}
function value_35720() { // fn#35720, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:49691, offset: 0x0107b477, size: 123 bytes, params: 1, frame: 18
var r0;
var value3;
var defaultImport;
const value = environment.__proto__;
const binding = env1_77;
const supports = binding.supports;
const EXPERIMENTAL_SOUNDSHARE = Features.EXPERIMENTAL_SOUNDSHARE;
const value2 = Reflect.apply(supports, binding, [EXPERIMENTAL_SOUNDSHARE]);
if (value2) {
value3 = undefined;
defaultImport = importDefault(12427) /* metro dependency 12427 */;
r0 = defaultImport.satisfies((importDefault(3767) /* metro dependency 3767: DiscordNative */) == null ? value3 : (importDefault(3767) /* metro dependency 3767: DiscordNative */).os.release,
WINDOWS_SOUNDSHARE_NONHOOK_VERSION);
} else {
r0 = value2;
}
return r0;
}
function value_35721() { // fn#35721, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:49892, offset: 0x0107b4f2, size: 156 bytes, params: 1, frame: 18
var defaultImport;
const value = environment.__proto__;
const value2 = undefined;
let r0 = (require(477) /* metro dependency 477: PlatformUtils */).isWindows() && env1_77.supports(Features.SOUNDSHARE);
if (r0) {
defaultImport = importDefault(12427) /* metro dependency 12427 */;
r0 = defaultImport.satisfies((importDefault(3767) /* metro dependency 3767: DiscordNative */) == null ? value2 : (importDefault(3767) /* metro dependency 3767: DiscordNative */).os.release,
WINDOWS_SOUNDSHARE_HOOK_VERSION);
}
return r0;
}
function value_35723() { // fn#35723, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:50328, offset: 0x0107b5df, size: 30 bytes, params: 1, frame: 11
const binding = env1_77;
const supports = binding.supports;
const NATIVE_SCREENSHARE_PICKER = Features.NATIVE_SCREENSHARE_PICKER;
return Reflect.apply(supports, binding, [NATIVE_SCREENSHARE_PICKER]);
}
function value_35724() { // fn#35724, offset: 0x0107b5fd, size: 9 bytes, params: 1, frame: 1
return env1_141;
}
function value_35725(a0, a1) { // fn#35725, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:50536, offset: 0x0107b606, size: 328 bytes, params: 3, frame: 14
var VideoCaptureDeviceNoReuseExperiment;
const Array = global.Array;
const array = new Array('unk');
array.push('nvNewPresets');
let STREAM = MediaEngineContextTypes.STREAM;
if (a0 === STREAM) {
array.push('nvRelaxRc=250');
} else {
array.push('nvRelaxRc=75');
}
const getUseVaapiEncoder = this.getUseVaapiEncoder;
if (Reflect.apply(getUseVaapiEncoder, this, [])) {
array.push('vaapi');
}
STREAM = MediaEngineContextTypes.STREAM;
if (a0 === STREAM && a1 === 'streamer' && (require(477) /* metro dependency 477: PlatformUtils */).isWindows()) {
array.push('useCaptureDeviceForEncode');
VideoCaptureDeviceNoReuseExperiment = (require(12487) /* metro dependency 12487: VideoCaptureDeviceNoReuse */).VideoCaptureDeviceNoReuseExperiment;
if (VideoCaptureDeviceNoReuseExperiment.getConfig({location: 'handleReady'}).overrideDeviceReuse) {
array.push('videoCaptureDeviceOverrideReuse');
}
}
array.push('linux-vulkan');
return array.join(',');
}
function value_35726() { // fn#35726, offset: 0x0107b74e, size: 9 bytes, params: 1, frame: 1
return env1_140;
}
function value_35727() { // fn#35727, offset: 0x0107b757, size: 9 bytes, params: 1, frame: 1
return env1_102;
}
function value_35728() { // fn#35728, offset: 0x0107b760, size: 9 bytes, params: 1, frame: 1
return env1_117;
}
function value_35729() { // fn#35729, offset: 0x0107b769, size: 9 bytes, params: 1, frame: 1
return env1_118;
}
function value_35730() { // fn#35730, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:51364, offset: 0x0107b772, size: 49 bytes, params: 1, frame: 10
const value = environment.__proto__;
return _getSettings0().modeOptions.vadKrispActivationThreshold ?? 0.5;
}
function value_35731() { // fn#35731, offset: 0x0107b7a3, size: 9 bytes, params: 1, frame: 1
return env1_139;
}
function value_35733() { // fn#35733, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:51688, offset: 0x0107b7ba, size: 315 bytes, params: 1, frame: 19
var r0;
var r1;
var moduleValue2;
var isLinux2;
var binding;
var value4;
var defaultImport;
const value = environment.__proto__;
const value2 = undefined;
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
if (platformUtilsModule.isMac()) {
binding = env1_77;
value4 = binding.supports(Features.SOUNDSHARE);
if (value4) {
defaultImport = importDefault(12427) /* metro dependency 12427 */;
r1 = defaultImport.satisfies((importDefault(3767) /* metro dependency 3767: DiscordNative */) == null ? value2 : (importDefault(3767) /* metro dependency 3767: DiscordNative */).os.release,
DARWIN_SCKIT_AUDIO_VERSION);
} else {
r1 = value4;
}
r1 = r1 && supportsScreenCaptureKit();
r0 = r1;
} else {
moduleValue2 = platformUtilsModule;
if (moduleValue2.isWindows()) {
binding = env1_77;
r0 = binding.supports(Features.SCREEN_SOUNDSHARE) && this.getExperimentalSoundshare();
} else {
isLinux2 = (require(477) /* metro dependency 477: PlatformUtils */).isLinux();
r0 = isLinux2 ? env1_77.supports(Features.SCREEN_SOUNDSHARE) : !!isLinux2;
}
}
return r0;
}
function value_35734() { // fn#35734, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:52067, offset: 0x0107b8f5, size: 190 bytes, params: 1, frame: 14
var environment;
var property;
const value = environment.__proto__;
const value2 = undefined;
if (PlatformUtilsModule.isWindows()) {
if (this.getBypassSystemInputProcessing()) {
return value2;
}
property = env1_124[this.getInputDeviceId()];
return property == null || property.active == null ? value2 : property.active.find(_fun35735);
}
if (PlatformUtilsModule.isMac()) {
return env1_131;
}
if (PlatformUtilsModule.isIOS()) {
return env1_131;
}
return value2;
function _fun35735(a0) { // fn#35735, offset: 0x0107b9b3, size: 16 bytes, params: 2, frame: 2
return a0 === env2_69;
}
}
function value_35736() { // fn#35736, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:52367, offset: 0x0107b9c3, size: 269 bytes, params: 1, frame: 16
var DisableCameraSimulcastExperiment;
let value = a0;
const r4 = value !== undefined ? value : MediaEngineContextTypes.DEFAULT;
const supports = this.supports;
value = environment.__proto__;
const VIDEO = Features.VIDEO;
const r0 = Reflect.apply(supports, this, [VIDEO]) ? [{rid: '100',
type: r4 === MediaEngineContextTypes.DEFAULT ? MediaTypes.VIDEO : MediaTypes.SCREEN,
quality: SIMULCAST_HQ_QUALITY}] : [];
let r1 = this.isSimulcastSupported() && r4 === MediaEngineContextTypes.DEFAULT;
if (r1) {
DisableCameraSimulcastExperiment = (require(12488) /* metro dependency 12488: DisableCameraSimulcastExperiment */).DisableCameraSimulcastExperiment;
r1 = DisableCameraSimulcastExperiment.getConfig({location: 'MediaEngineStore.getVideoStreamParameters'}).enableSimulcast;
}
if (r1) {
r0.push({rid: '50', type: MediaTypes.VIDEO, quality: SIMULCAST_LQ_QUALITY});
}
return r0;
}
function value_35737() { // fn#35737, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:52772, offset: 0x0107bad0, size: 59 bytes, params: 1, frame: 13
const object = {};
object.fetchDave = (require(477) /* metro dependency 477: PlatformUtils */).isWeb();
return env1_77.fetchAsyncResources(object);
}
function value_35738() { // fn#35738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:52905, offset: 0x0107bb0b, size: 95 bytes, params: 1, frame: 13
var environment;
var moduleValue;
const value = environment.__proto__;
if (!env1_123) {
moduleValue = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue.isWeb()) {
env1_77.fetchAsyncResources({fetchDave: true}).catch(_fun35739);
}
}
function _fun35739(a0) { // fn#35739, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:53015, offset: 0x0107bb6a, size: 62 bytes, params: 2, frame: 14
const value = environment.__proto__.__proto__;
env2_62.warn('DAVE preload failed:', a0);
(SentryUtilsNative).captureException(a0);
}
}
function value_35740() { // fn#35740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:53144, offset: 0x0107bba8, size: 19 bytes, params: 1, frame: 9
return env1_77.getSupportedSecureFramesProtocolVersion();
}
function value_35741() { // fn#35741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:53277, offset: 0x0107bbbb, size: 15 bytes, params: 1, frame: 2
return env1_80 != null;
}
function value_35742() { // fn#35742, offset: 0x0107bbca, size: 9 bytes, params: 1, frame: 1
return env1_133;
}
}
function VOICE_CHANNEL_SELECT_35743({guildId, channelId, currentVoiceChannelId, video}) { // fn#35743, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:54338, offset: 0x0107bbd3, size: 157 bytes, params: 2, frame: 15
var value2;
var binding;
if (currentVoiceChannelId !== channelId) {
updateVideo(video, null);
}
if (guildId == null) {
if (channelId != null) {
if (!env0_111) {
value2 = _getSettings0();
if (value2.mute || value2.deaf) {
mergeSettings({'deaf': false, 'mute': false});
binding = env0_77;
binding.eachConnection(updateConnectionMuteDeaf);
}
}
}
}
}
function VOICE_STATE_UPDATES_35744({voiceStates}) { // fn#35744, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:54643, offset: 0x0107bc70, size: 32 bytes, params: 2, frame: 13
return voiceStates.reduce(_fun35745, false);
function _fun35745(a0, a1) { // fn#35745, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:54710, offset: 0x0107bc90, size: 247 bytes, params: 3, frame: 15
var r2;
var r5;
var r3;
var updateVideoBinding;
var deaf;
var channelId;
let binding = env1_78;
if (binding === a1.sessionId) {
r2 = a1.mute || a1.suppress;
deaf = a1.deaf;
binding = env1_77;
binding.eachConnection(updateConnectionMuteDeaf);
r5 = a1.guildId != null && a1.channelId != null;
r5 = r5 && env1_120 != null;
r5 = r5 && env1_120 !== a1.channelId;
binding = env1_111;
r2 = !binding && a1.channelId == null;
updateVideoBinding = updateVideo;
r3 = !r5 && !r2;
r3 = r3 && env1_98;
updateVideoBinding(r3);
channelId = a1.channelId;
return true;
}
const userId = a1.userId;
const authenticationStoreBinding = AuthenticationStore;
const getId = authenticationStoreBinding.getId;
if (userId === Reflect.apply(getId, authenticationStoreBinding, []) && RTCConnectionStore.getChannelId() == null) {
updateVideo(false, null);
}
return a0;
}
}
function CONNECTION_OPEN_35746({sessionId}) { // fn#35746, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:55057, offset: 0x0107bd87, size: 268 bytes, params: 2, frame: 16
var r3;
var moduleValue2;
const value2 = _getSettings0();
if (supportsAutomaticAudioSubsystem()) {
if (isReadyToMigrateToSingleAdmOffering()) {
setAudioSubsystem(AudioSubsystems.AUTOMATIC);
} else if (value2.automaticAudioSubsystem) {
interpretAutomaticAudioSubsystem();
}
}
const binding = env0_77;
const supports = binding.supports;
const OFFLOAD_ADM_CONTROLS = Features.OFFLOAD_ADM_CONTROLS;
if (Reflect.apply(supports, binding, [OFFLOAD_ADM_CONTROLS])) {
env0_77.setOffloadAdmControls(true);
}
const isIOS2 = (PlatformUtilsModule).isIOS();
if (isIOS2) {
moduleValue2 = require(12485) /* metro dependency 12485: IOSAudioInterruptExperiment */;
r3 = moduleValue2.getIOSAudioInterruptExperimentConfig('handleConnectionOpen').enabled;
} else {
r3 = isIOS2;
}
if (r3) {
env0_77.updateFieldTrial('WebRTC-Audio-iOS-Holding', 'Enabled');
}
maybeProbeAudioEffects(value2.inputDeviceId);
applyRemoteSettings();
}
function POST_CONNECTION_OPEN() { // fn#35748, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:55678, offset: 0x0107bea0, size: 58 bytes, params: 1, frame: 12
if (PlatformUtilsModule.isWeb()) {
env0_74.startDavePreload();
}
return false;
}
function RTC_CONNECTION_STATE_35749({state}) { // fn#35749, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:55788, offset: 0x0107beda, size: 193 bytes, params: 2, frame: 11
var binding;
const CONNECTING = RTCConnectionStates.CONNECTING;
if (CONNECTING === state) {
tryEnable();
} else if (RTCConnectionStates.RTC_CONNECTING === state) {
binding = env0_138;
binding.stop();
binding = env0_108;
binding.stop();
binding = env0_81;
binding.reset();
} else if (RTCConnectionStates.RTC_CONNECTED === state) {
updateVideo();
} else if (RTCConnectionStates.DISCONNECTED === state) {
env0_143 = {};
resetAutoDisabledVideoState();
resetProbingState();
}
function resetAutoDisabledVideoState() { // fn#35750, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:56047, owner: RTC_CONNECTION_STATE_35749.resetAutoDisabledVideoState, offset: 0x0107bf9b, size: 114 bytes, params: 1, frame: 17
if (env1_128.size !== 0) {
var DEFAULT = MediaEngineContextTypes.DEFAULT;
var disabledLocalVideos = _getSettings0(DEFAULT).disabledLocalVideos;
var binding = env1_128;
binding.forEach(_fun35751);
binding = env1_128;
binding.clear();
mergeSettings({disabledLocalVideos: disabledLocalVideos}, DEFAULT, false);
}
function _fun35751(a0) { // fn#35751, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:56176, offset: 0x0107c00d, size: 92 bytes, params: 2, frame: 17
const env0_0 = a0;
(Module00044)(disabledLocalVideos[a0],
'If you are auto-disabled, then you are also disabled.');
delete disabledLocalVideos[a0];
env2_77.eachConnection(_fun35752, DEFAULT);
function _fun35752(a0) { // fn#35752, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:56285, offset: 0x0107c069, size: 26 bytes, params: 2, frame: 13
return a0.setLocalVideoDisabled(env0_0, false);
}
}
}
}
function AUDIO_SET_TEMPORARY_SELF_MUTE({mute}) { // fn#35753, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:56435, offset: 0x0107c083, size: 39 bytes, params: 2, frame: 11
const binding = env0_77;
binding.eachConnection(updateConnectionMuteDeaf);
}
function AUDIO_TOGGLE_SELF_MUTE({context, playSoundEffect}) { // fn#35754, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:56554, offset: 0x0107c0aa, size: 172 bytes, params: 2, frame: 18
var r6;
var binding;
let {mute, deaf} = _getSettings0(context);
const DEFAULT = MediaEngineContextTypes.DEFAULT;
if (context !== DEFAULT) {
r6 = !deaf && !mute;
deaf = !!r6 && deaf;
if (playSoundEffect) {
}
mergeSettings({mute: r6, deaf: deaf}, context);
binding = env0_77;
binding.eachConnection(updateConnectionMuteDeaf);
} else {
var defaultImport = importDefault(4662) /* metro dependency 4662: NativePermissionUtils */;
var requestPermission = defaultImport.requestPermission;
var AUDIO = NativePermissionTypes.AUDIO;
Reflect.apply(requestPermission, defaultImport, [AUDIO]);
if (env0_96) {
return false;
}
r6 = !deaf && !mute;
deaf = !!r6 && deaf;
if (playSoundEffect) {
}
mergeSettings({mute: r6, deaf: deaf}, context);
binding = env0_77;
binding.eachConnection(updateConnectionMuteDeaf);
}
}
function AUDIO_SET_SELF_MUTE({context, mute, playSoundEffect}) { // fn#35755, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:56856, offset: 0x0107c156, size: 72 bytes, params: 2, frame: 15
mergeSettings({mute: mute}, context);
if (playSoundEffect) {
}
const binding = env0_77;
binding.eachConnection(updateConnectionMuteDeaf);
}
function AUDIO_TOGGLE_SELF_DEAF({context}) { // fn#35756, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:57026, offset: 0x0107c19e, size: 69 bytes, params: 2, frame: 15
const mergeSettingsBinding = mergeSettings;
const object = {};
object.deaf = !_getSettings0(context).deaf;
mergeSettingsBinding(object, context);
const binding = env0_77;
binding.eachConnection(updateConnectionMuteDeaf);
}
function AUDIO_TOGGLE_LOCAL_MUTE({context, userId}) { // fn#35757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:57187, offset: 0x0107c1e3, size: 124 bytes, params: 2, frame: 16
var localMutes;
const authenticationStoreBinding = AuthenticationStore;
const getId = authenticationStoreBinding.getId;
if (userId !== Reflect.apply(getId, authenticationStoreBinding, [])) {
localMutes = _getSettings0(context).localMutes;
if (localMutes[userId]) {
delete localMutes[userId];
} else {
localMutes[userId] = true;
}
mergeSettings({localMutes: localMutes}, context);
env0_77.eachConnection(_fun35758, context);
}
function _fun35758(a0) { // fn#35758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:57368, offset: 0x0107c25f, size: 37 bytes, params: 2, frame: 14
const setLocalMute = a0.setLocalMute;
const userIdBinding = userId;
return Reflect.apply(setLocalMute, a0, [userIdBinding, localMutes[userIdBinding] || false]);
}
}
function AUDIO_SET_LOCAL_VIDEO_DISABLED({context, userId, videoToggleState, persist, isAutomatic}) { // fn#35759, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:57435, offset: 0x0107c284, size: 1092 bytes, params: 2, frame: 38
var r13;
var r105;
var rTCConnection;
var rTCConnection2;
var rTCConnection3;
var value15;
var videoHealthManager;
var rTCConnection4;
var value19;
var videoHealthManager2;
(importDefault(44) /* metro dependency 44 */)(!(persist && isAutomatic), 'These are not allowed to both be true.');
const DISABLED = VideoToggleState.DISABLED;
const value2 = videoToggleState === DISABLED;
const disabledLocalVideos = _getSettings0(context).disabledLocalVideos;
let property = disabledLocalVideos[userId];
const r8 = property != null && property;
let binding = env0_128;
const value4 = binding.has(userId);
const AUTO_ENABLED = VideoToggleState.AUTO_ENABLED;
const r10 = videoToggleState === AUTO_ENABLED || videoToggleState === VideoToggleState.MANUAL_ENABLED;
env0_62.info('disableVideo=' + value2 + ' currentlyDisabled=' + r8 + ' currentlyAutoDisabled=' + value4 + ', isVideoShown=' + r10);
(importDefault(44) /* metro dependency 44 */)(!(value4 && !r8),
'If you are auto-disabled, then you are also disabled.');
const value8 = value2 !== r8;
const DEFAULT = MediaEngineContextTypes.DEFAULT;
const value9 = context === DEFAULT;
let r12 = isAutomatic && value8 && value9;
const r104 = persist && value8 && value9;
env0_62.info('changed=' + value8 + ' isDefaultContext=' + value9 + ' isUpdateCausedByVideoHealthManager=' + r12 + ' isManualToggleByUser=' + r104);
const videoToggleStateMap = _getSettings0(context).videoToggleStateMap;
property = videoToggleStateMap[userId];
let AUTO_PROBING = VideoToggleState.AUTO_PROBING;
let r15 = property === AUTO_PROBING && videoToggleState === VideoToggleState.AUTO_ENABLED;
if (r15) {
(importDefault(12411) /* metro dependency 12411: trackVideoToggle */)(userId,
value2 ? VideoToggleReason.AUTO_DISABLE : VideoToggleReason.AUTO_ENABLE, r10);
}
videoToggleStateMap[userId] = videoToggleState;
mergeSettings({videoToggleStateMap: videoToggleStateMap}, context, persist);
AUTO_PROBING = VideoToggleState.AUTO_PROBING;
if (videoToggleState === AUTO_PROBING) {
rTCConnection2 = RTCConnectionStore.getRTCConnection();
if (rTCConnection2 != null) {
rTCConnection2.pauseStatsCollectionForUser(userId, true);
}
} else {
rTCConnection = RTCConnectionStore.getRTCConnection();
if (rTCConnection != null) {
rTCConnection.pauseStatsCollectionForUser(userId, false);
}
}
if (!env0_129) {
binding = env0_62;
binding.info('isAutoDisableAllowed=' + env0_129 + ' - disabling VideoHealthManager');
rTCConnection3 = RTCConnectionStore.getRTCConnection();
value15 = rTCConnection3 == null;
if (value15) {
r13 = value15;
r15 = rTCConnection3;
} else {
videoHealthManager = rTCConnection3.getVideoHealthManager();
r13 = videoHealthManager == null;
r15 = videoHealthManager;
}
if (!r13) {
r15.disable();
}
}
if (r12) {
if (value2) {
if (value2) {
if (env0_129) {
(importDefault(12411) /* metro dependency 12411: trackVideoToggle */)(userId,
value2 ? VideoToggleReason.AUTO_DISABLE : VideoToggleReason.AUTO_ENABLE, r10);
binding = env0_128;
if (value2) {
binding.add(userId);
} else {
binding.delete(userId);
}
if (value9 && !value2) {
env0_128.delete(userId);
}
if (value2) {
disabledLocalVideos[userId] = true;
} else {
delete disabledLocalVideos[userId];
}
mergeSettings({disabledLocalVideos: disabledLocalVideos}, context, persist);
binding = env0_77;
binding.eachConnection(_fun35760, context);
return undefined;
}
return undefined;
}
(importDefault(12411) /* metro dependency 12411: trackVideoToggle */)(userId,
value2 ? VideoToggleReason.AUTO_DISABLE : VideoToggleReason.AUTO_ENABLE, r10);
binding = env0_128;
if (value2) {
binding.add(userId);
} else {
binding.delete(userId);
}
if (value9 && !value2) {
env0_128.delete(userId);
}
if (value2) {
disabledLocalVideos[userId] = true;
} else {
delete disabledLocalVideos[userId];
}
mergeSettings({disabledLocalVideos: disabledLocalVideos}, context, persist);
binding = env0_77;
binding.eachConnection(_fun35760, context);
return undefined;
}
if (value4) {
if (value2) {
if (env0_129) {
(importDefault(12411) /* metro dependency 12411: trackVideoToggle */)(userId,
value2 ? VideoToggleReason.AUTO_DISABLE : VideoToggleReason.AUTO_ENABLE, r10);
binding = env0_128;
if (value2) {
binding.add(userId);
} else {
binding.delete(userId);
}
if (value9 && !value2) {
env0_128.delete(userId);
}
if (value2) {
disabledLocalVideos[userId] = true;
} else {
delete disabledLocalVideos[userId];
}
mergeSettings({disabledLocalVideos: disabledLocalVideos}, context, persist);
binding = env0_77;
binding.eachConnection(_fun35760, context);
return undefined;
}
return undefined;
}
(importDefault(12411) /* metro dependency 12411: trackVideoToggle */)(userId,
value2 ? VideoToggleReason.AUTO_DISABLE : VideoToggleReason.AUTO_ENABLE, r10);
binding = env0_128;
if (value2) {
binding.add(userId);
} else {
binding.delete(userId);
}
if (value9 && !value2) {
env0_128.delete(userId);
}
if (value2) {
disabledLocalVideos[userId] = true;
} else {
delete disabledLocalVideos[userId];
}
mergeSettings({disabledLocalVideos: disabledLocalVideos}, context, persist);
binding = env0_77;
binding.eachConnection(_fun35760, context);
return undefined;
}
} else {
if (r104) {
if (value4) {
if (value2) {
(importDefault(12411) /* metro dependency 12411: trackVideoToggle */)(userId,
value2 ? VideoToggleReason.MANUAL_DISABLE : VideoToggleReason.MANUAL_ENABLE, r10);
} else {
env0_62.info('disallowing auto-disable for this session because of manual override by user');
rTCConnection4 = RTCConnectionStore.getRTCConnection();
value19 = rTCConnection4 == null;
if (value19) {
r105 = value19;
r12 = rTCConnection4;
} else {
videoHealthManager2 = rTCConnection4.getVideoHealthManager();
r105 = videoHealthManager2 == null;
r12 = videoHealthManager2;
}
if (!r105) {
r12.disable();
}
(importDefault(12411) /* metro dependency 12411: trackVideoToggle */)(userId,
VideoToggleReason.MANUAL_REENABLE,
r10);
}
} else {
(importDefault(12411) /* metro dependency 12411: trackVideoToggle */)(userId,
value2 ? VideoToggleReason.MANUAL_DISABLE : VideoToggleReason.MANUAL_ENABLE, r10);
}
}
if (value9 && !value2) {
env0_128.delete(userId);
}
if (value2) {
disabledLocalVideos[userId] = true;
} else {
delete disabledLocalVideos[userId];
}
mergeSettings({disabledLocalVideos: disabledLocalVideos}, context, persist);
env0_77.eachConnection(_fun35760, context);
}
function _fun35760(a0) { // fn#35760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:59095, offset: 0x0107c6c8, size: 44 bytes, params: 2, frame: 15
const setLocalVideoDisabled = a0.setLocalVideoDisabled;
const userIdBinding = userId;
const property = disabledLocalVideos[userIdBinding];
return Reflect.apply(setLocalVideoDisabled, a0, [userIdBinding, property != null && property]);
}
}
function AUDIO_SET_LOCAL_VOLUME({context, userId, volume}) { // fn#35761, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:59186, offset: 0x0107c6f4, size: 147 bytes, params: 2, frame: 17
var r7;
var localVolumes;
const authenticationStoreBinding = AuthenticationStore;
const getId = authenticationStoreBinding.getId;
if (userId !== Reflect.apply(getId, authenticationStoreBinding, [])) {
r7 = context === MediaEngineContextTypes.STREAM ? DEFAULT_STREAM_VOLUME : DEFAULT_VOLUME;
localVolumes = _getSettings0(context).localVolumes;
if (volume === r7) {
delete localVolumes[userId];
} else {
localVolumes[userId] = volume;
}
mergeSettings({localVolumes: localVolumes}, context);
env0_77.eachConnection(function(a0) {
return a0.setLocalVolume(userId, volume);
}, context);
}
}
function AUDIO_SET_AUDIO_MIXER_SETTINGS({context, settings}) { // fn#35763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:59461, offset: 0x0107c7a3, size: 90 bytes, params: 2, frame: 16
mergeSettings({audioMixerSettings: settings}, context);
let binding = env0_77;
binding.setAudioMixerOptions(settings);
binding = env0_77;
const eachConnection = binding.eachConnection;
const DEFAULT = MediaEngineContextTypes.DEFAULT;
Reflect.apply(eachConnection, binding, [function(a0) {
return a0.setSpatialAudioEnabled(settings.enabled);
}, DEFAULT]);
}
function AUDIO_SET_LOCAL_PAN({context, userId, left, right}) { // fn#35765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:59681, offset: 0x0107c819, size: 111 bytes, params: 2, frame: 18
const localPans = _getSettings0(context).localPans;
localPans[userId] = {left: left, right: right};
mergeSettings({localPans: localPans}, context);
env0_77.eachConnection(function(a0) {
return a0.setLocalPan(userId, left, right);
}, context);
}
function AUDIO_SET_MODE({context, mode, options}) { // fn#35767, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:59894, offset: 0x0107c8a9, size: 100 bytes, params: 2, frame: 16
const mergeSettingsBinding = mergeSettings;
const object = {mode: mode};
const object2 = {};
copyDataProperties(object2, options, undefined);
const Date = global.Date;
object2['updatedAt'] = Date.now();
object.modeOptions = object2;
mergeSettingsBinding(object, context);
const binding = env0_77;
binding.eachConnection(setInputMode);
}
function AUDIO_SET_INPUT_VOLUME({volume}) { // fn#35768, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:60074, offset: 0x0107c90d, size: 56 bytes, params: 2, frame: 14
const mergeSettingsBinding = mergeSettings;
const object = {};
object.inputVolume = clampVolume(volume);
mergeSettingsBinding(object);
env0_77.setInputVolume(volume);
}
function AUDIO_SET_OUTPUT_VOLUME({volume}) { // fn#35769, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:60211, offset: 0x0107c945, size: 47 bytes, params: 2, frame: 13
mergeSettings({outputVolume: volume});
env0_77.setOutputVolume(volume);
}
function AUDIO_SET_INPUT_DEVICE({id}) { // fn#35770, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:60337, offset: 0x0107c974, size: 192 bytes, params: 2, frame: 16
const deviceId = getDeviceId(env0_90, id);
env0_87 = global.performance.now();
mergeSettings({inputDeviceId: deviceId});
setInputDevice(deviceId);
const binding = env0_77;
binding.eachConnection(updateConnectionVoiceProcessing);
env0_138.stop();
const defaultImport = SilenceWarningExperiment;
const getConfig = defaultImport.getConfig;
if (Reflect.apply(getConfig, defaultImport,
[{location: 'MediaEngineStore.handleSetInputDevice'}]).resetSilenceWarningOnDeviceChange) {
env0_81.reset();
}
}
function AUDIO_SET_OUTPUT_DEVICE({id}) { // fn#35771, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:60707, offset: 0x0107ca34, size: 60 bytes, params: 2, frame: 16
const mergeSettingsBinding = mergeSettings;
const deviceId = getDeviceId(env0_91, id);
mergeSettingsBinding({outputDeviceId: deviceId});
env0_77.setAudioOutputDevice(deviceId);
}
function AUDIO_SET_ACTIVE_INPUT_PROFILE({inputProfile}) { // fn#35772, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:60857, offset: 0x0107ca70, size: 91 bytes, params: 2, frame: 14
mergeSettings({activeInputProfile: inputProfile});
const value2 = _getSettings0();
let binding = env0_77;
binding.eachConnection(function(a0) {
setInputMode(a0);
updateConnectionVoiceProcessing(a0);
});
binding = env0_77;
binding.setAudioInputBypassSystemProcessing(value2.bypassSystemInputProcessing);
setLoopback();
}
function AUDIO_SET_ECHO_CANCELLATION({enabled, location}) { // fn#35774, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:61162, offset: 0x0107cae7, size: 79 bytes, params: 2, frame: 14
const env0_0 = mergeSettings({echoCancellation: enabled});
env0_77.eachConnection(_fun35775);
setLoopback();
trackVoiceProcessing(location);
function _fun35775(a0) { // fn#35775, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:61269, offset: 0x0107cb36, size: 29 bytes, params: 2, frame: 11
return a0.setEchoCancellation(env0_0.echoCancellation);
}
}
function AUDIO_SET_SIDECHAIN_COMPRESSION({enabled}) { // fn#35776, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:61396, offset: 0x0107cb53, size: 52 bytes, params: 2, frame: 12
const value2 = mergeSettings({sidechainCompression: enabled});
const binding = env0_77;
binding.setSidechainCompression(value2.sidechainCompression);
}
function AUDIO_SET_SIDECHAIN_COMPRESSION_STRENGTH({strength}) { // fn#35777, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:61626, offset: 0x0107cb87, size: 53 bytes, params: 2, frame: 12
const value2 = mergeSettings({sidechainCompressionStrength: strength});
const binding = env0_77;
binding.setSidechainCompressionStrength(value2.sidechainCompressionStrength);
}
function AUDIO_SET_LOOPBACK({enabled, loopbackReason}) { // fn#35778, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:61826, offset: 0x0107cbbc, size: 58 bytes, params: 2, frame: 12
const binding = env0_130;
if (enabled) {
binding.add(loopbackReason);
} else {
binding.delete(loopbackReason);
}
setLoopback();
}
function AUDIO_SET_NOISE_SUPPRESSION({enabled, location}) { // fn#35779, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:61958, offset: 0x0107cbf6, size: 79 bytes, params: 2, frame: 14
const env0_0 = mergeSettings({noiseSuppression: enabled});
env0_77.eachConnection(_fun35780);
setLoopback();
trackVoiceProcessing(location);
function _fun35780(a0) { // fn#35780, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:62065, offset: 0x0107cc45, size: 29 bytes, params: 2, frame: 11
return a0.setNoiseSuppression(env0_0.noiseSuppression);
}
}
function AUDIO_SET_AUTOMATIC_GAIN_CONTROL({enabled, location}) { // fn#35781, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:62193, offset: 0x0107cc62, size: 79 bytes, params: 2, frame: 14
const env0_0 = mergeSettings({automaticGainControl: enabled});
env0_77.eachConnection(_fun35782);
setLoopback();
trackVoiceProcessing(location);
function _fun35782(a0) { // fn#35782, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:62308, offset: 0x0107ccb1, size: 33 bytes, params: 2, frame: 13
setAutomaticGainControl(a0, env0_0.automaticGainControl);
}
}
function AUDIO_SET_NOISE_CANCELLATION({enabled, location}) { // fn#35783, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:62440, offset: 0x0107ccd2, size: 79 bytes, params: 2, frame: 14
const env0_0 = mergeSettings({noiseCancellation: enabled});
env0_77.eachConnection(_fun35784);
setLoopback();
trackVoiceProcessing(location);
function _fun35784(a0) { // fn#35784, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:62549, offset: 0x0107cd21, size: 33 bytes, params: 2, frame: 13
setNoiseCancellation(a0, env0_0.noiseCancellation);
}
}
function AUDIO_SET_DEBUG_LOGGING({enabled}) { // fn#35787, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:62923, offset: 0x0107cda2, size: 30 bytes, params: 2, frame: 11
env0_77.setDebugLogging(enabled);
}
function AUDIO_SET_KRISP_SUPPRESSION_LEVEL({level}) { // fn#35788, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:63022, offset: 0x0107cdc0, size: 51 bytes, params: 2, frame: 12
(KrispUtils).setKrispSuppressionLevel(level);
}
function AUDIO_SET_NOISE_CANCELLATION_ENABLE_STATS(a0) { // fn#35789, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:63161, offset: 0x0107cdf3, size: 88 bytes, params: 2, frame: 13
var enabled;
var binding;
if (!PlatformUtilsModule.isWeb()) {
enabled = a0.enabled;
if (env0_77.setNoiseCancellationEnableStats != null) {
binding = env0_77;
binding.setNoiseCancellationEnableStats(a0.enabled);
}
}
}
function AUDIO_SET_ATTENUATION({attenuation, attenuateWhileSpeakingSelf, attenuateWhileSpeakingOthers}) { // fn#35793, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:63743, offset: 0x0107cea8, size: 80 bytes, params: 2, frame: 15
const env0_0 = mergeSettings({attenuation: attenuation, attenuateWhileSpeakingSelf: attenuateWhileSpeakingSelf,
attenuateWhileSpeakingOthers: attenuateWhileSpeakingOthers});
env0_77.eachConnection(_fun35794);
function _fun35794(a0) { // fn#35794, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:63966, offset: 0x0107cef8, size: 43 bytes, params: 2, frame: 15
const setAttenuation = a0.setAttenuation;
const binding = env0_0;
return Reflect.apply(setAttenuation, a0, [binding.attenuation, binding.attenuateWhileSpeakingSelf,
binding.attenuateWhileSpeakingOthers]);
}
}
function AUDIO_SET_QOS({enabled}) { // fn#35795, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:64078, offset: 0x0107cf23, size: 57 bytes, params: 2, frame: 13
mergeSettings({qos: enabled});
env0_77.eachConnection(function(a0) {
return a0.setQoS(enabled);
});
}
function MEDIA_ENGINE_DEVICES(a0) { // fn#35797, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:64194, offset: 0x0107cf73, size: 563 bytes, params: 2, frame: 21
var r4;
var r3;
var r2;
var value3;
var setInputDeviceBinding;
var getDeviceIdBinding;
var defaultImport2;
var value4;
var updateVideoBinding;
let binding = env0_90;
let convertDevicesBinding = convertDevices;
const object = {};
const AUDIO_INPUT = DeviceTypes.AUDIO_INPUT;
object.deviceType = AUDIO_INPUT;
const value2 = undefined;
const intl = (IndexNativeModule).intl;
let string = intl.string;
const t = (IndexNativeModule).t;
object.defaultName = Reflect.apply(string, intl, [t['/QIjDA']]);
env0_90 = convertDevicesBinding(a0, object);
const defaultImport = Module00022;
if (!defaultImport.isEqual(env0_90, binding)) {
value3 = _getSettings0();
setInputDeviceBinding = setInputDevice;
getDeviceIdBinding = getDeviceId;
binding = env0_90;
setInputDeviceBinding(getDeviceIdBinding(binding, value3.inputDeviceId));
binding = env0_77;
binding.eachConnection(updateConnectionVoiceProcessing);
}
setOutputDevices(a0);
result = a0.videoDevices.length > 0;
binding = env0_92;
convertDevicesBinding = convertDevices;
const VIDEO_INPUT = DeviceTypes.VIDEO_INPUT;
string = intl.string;
const WKWARY = t.WKWARY;
env0_92 = convertDevicesBinding(a0, {deviceType: VIDEO_INPUT, defaultName: Reflect.apply(string, intl, [WKWARY])});
if (env0_98) {
defaultImport2 = defaultImport;
if (!defaultImport2.isEqual(env0_92, binding)) {
value4 = value2 !== env0_92[DISABLED_DEVICE_ID];
r4 = DISABLED_DEVICE_ID === DEFAULT_DEVICE_ID && (binding[DEFAULT_DEVICE_ID] == null ? value2 : binding[DEFAULT_DEVICE_ID].disabled);
r3 = (importDefault(4222) /* metro dependency 4222 */).name === 'Firefox' && DISABLED_DEVICE_ID === '';
r3 = r3 && (binding[DISABLED_DEVICE_ID] == null ? value2 : binding[DISABLED_DEVICE_ID].name) === 'Default';
r3 = r3 && !(binding[DISABLED_DEVICE_ID] != null && binding[DISABLED_DEVICE_ID].disabled);
updateVideoBinding = updateVideo;
r2 = value4 || r4;
r2 = !r2 ? r3 : r2;
updateVideoBinding(r2);
}
}
return value2;
}
function AUDIO_RESET() { // fn#35799, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:65114, offset: 0x0107d1da, size: 48 bytes, params: 1, frame: 12
const Storage = (StorageModule).Storage;
Storage.remove(env0_63);
}
function AUDIO_INPUT_DETECTED({inputDetected}) { // fn#35800, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:65218, offset: 0x0107d20a, size: 281 bytes, params: 2, frame: 19
var config;
var enableHardwareSilenceWarning;
var resetSilenceWarningAfterNMinutes;
var binding;
if (inputDetected == null) {
return false;
}
env0_107 = env0_106 !== true && !inputDetected;
if (inputDetected) {
binding = env0_138;
binding.stop();
binding = env0_108;
binding.stop();
} else if (_getSettings0().mode === InputModes.VOICE_ACTIVITY) {
if (env0_106) {
config = (importDefault(12486) /* metro dependency 12486: SilenceWarningExperiment */).getConfig({location: 'MediaEngineStore.handleInputDetected'});
enableHardwareSilenceWarning = config.enableHardwareSilenceWarning;
resetSilenceWarningAfterNMinutes = config.resetSilenceWarningAfterNMinutes;
if (enableHardwareSilenceWarning) {
binding = env0_138;
binding.start(env0_68, _fun35801);
}
if (resetSilenceWarningAfterNMinutes != null) {
binding = env0_108;
binding.start(resetSilenceWarningAfterNMinutes * (importDefault(672) /* metro dependency 672: Durations */).Millis.MINUTE,
_fun35802);
}
}
}
function _fun35801() { // fn#35801, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:65556, offset: 0x0107d323, size: 142 bytes, params: 1, frame: 18
const value2 = undefined;
const defaultImport = AnalyticsUtils;
const track = defaultImport.track;
const HARDWARE_MUTE_GUESSED = AnalyticEvents.HARDWARE_MUTE_GUESSED;
const object = {};
const binding = env1_90;
const property = binding[getDeviceId(binding, _getSettings0().inputDeviceId)];
object.input_device_name = property == null ? value2 : property.name;
object.rtc_connection_id = RTCConnectionStore.getRTCConnectionId();
Reflect.apply(track, defaultImport, [HARDWARE_MUTE_GUESSED, object]);
env1_74.emitChange();
return value2;
}
function _fun35802() { // fn#35802, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:65817, offset: 0x0107d3b1, size: 27 bytes, params: 1, frame: 9
env1_81.reset();
}
}
function AUDIO_SET_BYPASS_SYSTEM_INPUT_PROCESSING({bypassEnabled, location}) { // fn#35805, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:66081, offset: 0x0107d403, size: 61 bytes, params: 2, frame: 14
mergeSettings({bypassSystemInputProcessing: bypassEnabled});
env0_77.setAudioInputBypassSystemProcessing(bypassEnabled);
trackVoiceProcessing(location);
}
function MEDIA_ENGINE_SET_AUDIO_ENABLED(a0) { // fn#35806, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:66303, offset: 0x0107d440, size: 72 bytes, params: 2, frame: 12
const enabled = a0.enabled;
if (a0.unmute) {
mergeSettings({'mute': false, 'deaf': false});
}
const binding = env0_77;
binding.eachConnection(updateConnectionMuteDeaf);
}
function MEDIA_ENGINE_PERMISSION(a0) { // fn#35808, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:66593, offset: 0x0107d4c9, size: 83 bytes, params: 2, frame: 11
var binding;
const kind = a0.kind;
if (!a0.granted) {
if (kind === 'audio') {
binding = env0_77;
binding.eachConnection(updateConnectionMuteDeaf);
} else if (kind === 'video') {
updateVideo(false);
}
}
}
function MEDIA_ENGINE_SET_GO_LIVE_SOURCE({settings}) { // fn#35809, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:66785, offset: 0x0107d51c, size: 517 bytes, params: 2, frame: 21
var cameraSettings;
var r4;
var r6;
var r5;
var soundshareSession;
var soundshareId;
var updateVideoBinding;
var context;
var videoDeviceGuid;
var audioDeviceGuid;
var sound;
var qualityOptions;
var sourceId;
var pidFromDesktopSource;
var value10;
let value = null;
let desktopSettings = value == settings ? undefined : settings.desktopSettings;
if (value != desktopSettings) {
desktopSettings = settings.desktopSettings;
sourceId = desktopSettings.sourceId;
sound = desktopSettings.sound;
context = settings.context;
r4 = value != context ? context : MediaEngineContextTypes.DEFAULT;
qualityOptions = settings.qualityOptions;
r5 = value != qualityOptions ? qualityOptions : {'resolution': 720, 'frameRate': 30};
pidFromDesktopSource = (importDefault(4488) /* metro dependency 4488: CrossPlatformNativeUtilsNative */).getPidFromDesktopSource(sourceId);
if ((require(477) /* metro dependency 477: PlatformUtils */).isPlatformEmbedded) {
value10 = maybeTryHookProcess(pidFromDesktopSource, sound);
soundshareId = value10.soundshareId;
soundshareSession = value10.soundshareSession;
} else {
soundshareSession = value;
soundshareId = value;
}
if (r4 !== STREAM) {
if (value != env0_79) {
env0_77.setGoLiveSource(value, STREAM);
}
}
updateVideoBinding = updateVideo;
value = r4 === MediaEngineContextTypes.STREAM;
updateVideoBinding(value && env0_98, {desktopSource: {id: sourceId, sourcePid: pidFromDesktopSource,
soundshareId: soundshareId, soundshareSession: soundshareSession}, quality: {resolution: r5.resolution,
frameRate: r5.frameRate}});
} else {
cameraSettings = value == settings ? undefined : settings.cameraSettings;
if (value != cameraSettings) {
context = settings.context;
r4 = value != context ? context : MediaEngineContextTypes.DEFAULT;
cameraSettings = settings.cameraSettings;
videoDeviceGuid = cameraSettings.videoDeviceGuid;
audioDeviceGuid = cameraSettings.audioDeviceGuid;
sound = cameraSettings.sound;
r4 = r4 === MediaEngineContextTypes.STREAM && env0_98;
qualityOptions = settings.qualityOptions;
r6 = value != qualityOptions ? qualityOptions : {'resolution': 720, 'frameRate': 30};
updateVideo(r4, {cameraSource: {videoDeviceGuid: videoDeviceGuid, audioDeviceGuid: audioDeviceGuid,
sound: sound},
quality: {resolution: r6.resolution, frameRate: r6.frameRate}});
} else {
updateVideo(env0_98, value);
}
}
}
function MEDIA_ENGINE_SET_VIDEO_DEVICE({id}) { // fn#35810, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:67858, offset: 0x0107d721, size: 53 bytes, params: 2, frame: 16
const mergeSettingsBinding = mergeSettings;
const object = {};
object.videoDeviceId = getDeviceId(env0_92, id);
mergeSettingsBinding(object);
updateVideo();
}
function MEDIA_ENGINE_INTERACTION_REQUIRED(a0) { // fn#35811, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:67996, offset: 0x0107d756, size: 62 bytes, params: 2, frame: 11
var r0;
var value3;
const binding = env0_85;
let required = a0.required;
const value2 = binding !== required;
if (value2) {
required = a0.required;
required = a0.required;
value3 = true;
if (required) {
r0 = value3;
} else {
env0_77.interact();
r0 = value3;
}
} else {
r0 = value2;
}
return r0;
}
function CERTIFIED_DEVICES_SET() { // fn#35812, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:68231, offset: 0x0107d794, size: 26 bytes, params: 1, frame: 11
const binding = env0_77;
binding.eachConnection(updateConnectionVoiceProcessing);
return false;
}
function RPC_APP_CONNECTED({application}) { // fn#35813, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:68348, offset: 0x0107d7ae, size: 34 bytes, params: 2, frame: 11
const binding = env0_83;
binding.add(application.id);
}
function RPC_APP_DISCONNECTED({application}) { // fn#35814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:68428, offset: 0x0107d7d0, size: 34 bytes, params: 2, frame: 11
env0_83.delete(application.id);
}
function APP_STATE_UPDATE_35816({state}) { // fn#35816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:68744, offset: 0x0107d854, size: 132 bytes, params: 2, frame: 13
const isEnabled2 = (ExternalPipAndroid).isEnabled();
const BACKGROUND = AppStates.BACKGROUND;
if (state !== BACKGROUND) {
if (state !== AppStates.ACTIVE) {
return false;
}
} else {
if (env0_98) {
if (isEnabled2) {
if (state !== AppStates.ACTIVE) {
return false;
}
if (env0_104) {
updateVideo(true);
return true;
}
return false;
}
env0_104 = true;
updateVideo(false);
return true;
}
if (state !== AppStates.ACTIVE) {
return false;
}
}
if (env0_104) {
updateVideo(true);
return true;
}
return false;
}
function SET_CHANNEL_BITRATE(a0) { // fn#35817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:68943, offset: 0x0107d8d8, size: 36 bytes, params: 2, frame: 11
const env0_0 = a0;
env0_77.eachConnection(_fun35818);
function _fun35818(a0) { // fn#35818, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:68998, offset: 0x0107d8fc, size: 29 bytes, params: 2, frame: 11
return a0.setBitRate(env0_0.bitrate);
}
}
function SET_VAD_PERMISSION({hasPermission}) { // fn#35819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:69047, offset: 0x0107d919, size: 54 bytes, params: 2, frame: 11
if (!hasPermission === env0_96) {
return false;
}
const binding = env0_77;
binding.eachConnection(updateConnectionMuteDeaf);
}
function SET_NATIVE_PERMISSION({state, permissionType}) { // fn#35820, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:69201, offset: 0x0107d94f, size: 120 bytes, params: 2, frame: 12
var binding;
const ACCEPTED = NativePermissionStates.ACCEPTED;
const value2 = state === ACCEPTED;
const AUDIO = NativePermissionTypes.AUDIO;
if (AUDIO === permissionType) {
binding = env0_77;
binding.eachConnection(updateConnectionMuteDeaf);
return undefined;
}
const CAMERA = NativePermissionTypes.CAMERA;
if (CAMERA === permissionType) {
if (!value2 && env0_98) {
updateVideo(false);
}
return undefined;
}
return false;
}
function SET_CHANNEL_VIDEO_QUALITY_MODE(a0) { // fn#35821, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:69461, offset: 0x0107d9c7, size: 36 bytes, params: 2, frame: 11
const env0_0 = a0;
env0_77.eachConnection(_fun35822);
function _fun35822(a0) { // fn#35822, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:69525, offset: 0x0107d9eb, size: 28 bytes, params: 2, frame: 11
return a0.applyVideoQualityMode(env0_0.mode);
}
}
function MEDIA_ENGINE_SET_AEC_DUMP({enabled}) { // fn#35823, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:69589, offset: 0x0107da07, size: 52 bytes, params: 2, frame: 12
const value2 = mergeSettings({aecDumpEnabled: enabled});
const binding = env0_77;
binding.setAecDump(value2.aecDumpEnabled);
}
function MEDIA_ENGINE_SET_OPENH264_ENABLED({enabled}) { // fn#35824, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:69735, offset: 0x0107da3b, size: 118 bytes, params: 2, frame: 16
mergeSettings({openH264Enabled: enabled});
if (!((importDefault(6731) /* metro dependency 6731: DesktopNativeUtils */) == null || (importDefault(6731) /* metro dependency 6731: DesktopNativeUtils */).setOpenH264Enabled == null)) {
(importDefault(6731) /* metro dependency 6731: DesktopNativeUtils */).setOpenH264Enabled(enabled);
}
}
function MEDIA_ENGINE_RESET_SETTINGS({overrides}) { // fn#35825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:69937, offset: 0x0107dab1, size: 120 bytes, params: 2, frame: 15
const Object = global.Object;
env0_82 = Object.values(MediaEngineContextTypes).reduce(_fun35826, {});
const Storage = (StorageModule).Storage;
Storage.set(env0_63, env0_82);
applySettings();
function _fun35826(a0, a1) { // fn#35826, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:70010, offset: 0x0107db29, size: 68 bytes, params: 3, frame: 16
let value = environment.__proto__;
const defaultSettings = getDefaultSettings();
value = importDefault(22) /* metro dependency 22 */;
a0[a1] = value.merge(defaultSettings, overrides[a1]);
return a0;
}
}
function CHANNEL_DELETE_35827() { // fn#35827, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:70157, offset: 0x0107db6d, size: 60 bytes, params: 1, frame: 13
if (env0_98) {
if (RTCConnectionStore.getRTCConnectionId() != null) {
return false;
}
updateVideo(false, null);
} else {
if (env0_79 == null) {
return false;
}
if (RTCConnectionStore.getRTCConnectionId() != null) {
return false;
}
updateVideo(false, null);
}
}
function MEDIA_ENGINE_NOISE_CANCELLATION_ERROR({code}) { // fn#35828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:70304, offset: 0x0107dba9, size: 107 bytes, params: 2, frame: 14
const KRISP_CPU_OVERUSE = NoiseCancellerError.KRISP_CPU_OVERUSE;
if (code === KRISP_CPU_OVERUSE) {
env0_143.noiseCancellation = false;
env0_143.noiseSuppression = true;
var env0_0 = _getSettings0();
env0_77.eachConnection(_fun35829);
setLoopback();
trackVoiceProcessing();
return true;
}
return false;
function _fun35829(a0) { // fn#35829, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:70474, offset: 0x0107cd21, size: 33 bytes, params: 2, frame: 13
setNoiseCancellation(a0, env0_0.noiseCancellation);
}
}
function MEDIA_ENGINE_VOICE_ACTIVITY_DETECTION_ERROR({code}) { // fn#35830, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:70617, offset: 0x0107dc14, size: 73 bytes, params: 2, frame: 13
var r0;
var binding;
const KRISP_VAD_CPU_OVERUSE = NoiseCancellerError.KRISP_VAD_CPU_OVERUSE;
const value2 = code === KRISP_VAD_CPU_OVERUSE;
if (value2) {
binding = env0_143;
binding.modeOptions = {vadUseKrisp: false};
binding = env0_77;
binding.eachConnection(function(a0) {
setInputMode(a0);
});
r0 = true;
} else {
r0 = value2;
}
return r0;
}
function MEDIA_ENGINE_NOISE_CANCELLATION_ERROR_RESET() { // fn#35832, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:70827, offset: 0x0107dc70, size: 26 bytes, params: 1, frame: 3
const binding = env0_121;
return binding || !!binding;
}
function MEDIA_ENGINE_APPLY_MEDIA_FILTER_SETTINGS({settings}) { // fn#35833, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:70937, offset: 0x0107dc8a, size: 49 bytes, params: 2, frame: 11
env0_77.applyMediaFilterSettings(settings).finally(_fun35834);
function _fun35834() { // fn#35834, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:71031, offset: 0x0107dcbb, size: 27 bytes, params: 1, frame: 9
env1_74.emitChange();
}
}
function CLIPS_INIT({sourceId, applicationName, quality}) { // fn#35838, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:71460, offset: 0x0107dd37, size: 816 bytes, params: 2, frame: 23
var object4;
var id;
var r11;
var r8;
var binding;
var desktopSource;
var setClipsSource;
var moduleValue2;
var soundshareId;
var videoHook;
var moduleValue3;
var moduleValue4;
var pidFromDesktopSource;
var value5;
var hdrCaptureMode;
const DisableHookFramePacerExperiment = (DisableHookFramePacerExperimentModule).DisableHookFramePacerExperiment;
const VideoHookDX12Experiment = (VideoHookDX12ExperimentModule).VideoHookDX12Experiment;
var object3;
var binding3;
if (IsClipsEnabledModule.isDecoupledClipsEnabled()) {
if ((importDefault(3767) /* metro dependency 3767: DiscordNative */) == null) {
return false;
}
binding = object4;
id = binding == null ? undefined : binding.desktopSource.id;
if (id !== sourceId) {
if (object4 != null) {
env0_77.setClipsSource(null);
moduleValue2 = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue2.isWindows()) {
if (object4.desktopSource.soundshareId != null) {
moduleValue4 = importAll(12419) /* metro dependency 12419: HookNative */;
moduleValue4.cancelAttachToProcess(object4.desktopSource.soundshareId);
} else if (object4.desktopSource.sourcePid != null && _getSettings0().videoHook) {
moduleValue3 = importAll(12419) /* metro dependency 12419: HookNative */;
moduleValue3.cancelAttachToProcess(object4.desktopSource.sourcePid);
}
}
}
pidFromDesktopSource = (importDefault(4488) /* metro dependency 4488: CrossPlatformNativeUtilsNative */).getPidFromDesktopSource(sourceId);
value5 = maybeTryHookProcess(pidFromDesktopSource, true);
soundshareId = value5.soundshareId;
object4 = {desktopSource: {id: sourceId, sourcePid: pidFromDesktopSource, soundshareId: soundshareId,
soundshareSession: value5.soundshareSession}, quality: quality};
hdrCaptureMode = getHdrCaptureMode('MediaEngineStore clips');
videoHook = _getSettings0().videoHook;
r11 = videoHook ? !DisableHookFramePacerExperiment.getConfig({location: 'handleClipsInit'}).enabled : !videoHook;
r8 = videoHook && VideoHookDX12Experiment.getConfig({location: 'handleClipsInit'}).enabled;
binding = env0_77;
setClipsSource = binding.setClipsSource;
object3 = {};
desktopSource = object4.desktopSource;
object3.id = desktopSource.id;
desktopSource = object4.desktopSource;
soundshareId = desktopSource.soundshareId;
object3.soundshareId = soundshareId;
object3.useVideoHook = videoHook;
object3.useHookFramePacer = r11;
object3.useGraphicsCapture = supportsWindowsGraphicsCapture();
object3.useCaptureDeviceForEncode = false;
object3.useLoopback = env0_74.getExperimentalSoundshare();
object3.useQuartzCapturer = true;
object3.allowScreenCaptureKit = supportsScreenCaptureKit();
object3.videoHookStaleFrameTimeoutMs = 500;
object3.graphicsCaptureStaleFrameTimeoutMs = env0_65;
object3.hdrCaptureMode = hdrCaptureMode;
object3.videoHookAllowDx12 = r8;
binding3 = env0_74;
Reflect.apply(setClipsSource, binding, [{desktopDescription: object3, quality: quality,
applicationName: applicationName,
videoEncoderExperiments: binding3.getVideoEncoderExperiments(MediaEngineContextTypes.STREAM,
'streamer')}]);
return undefined;
}
if (object4.quality === quality) {
return false;
}
if (object4 != null) {
env0_77.setClipsSource(null);
moduleValue2 = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue2.isWindows()) {
if (object4.desktopSource.soundshareId != null) {
moduleValue4 = importAll(12419) /* metro dependency 12419: HookNative */;
moduleValue4.cancelAttachToProcess(object4.desktopSource.soundshareId);
} else if (object4.desktopSource.sourcePid != null && _getSettings0().videoHook) {
moduleValue3 = importAll(12419) /* metro dependency 12419: HookNative */;
moduleValue3.cancelAttachToProcess(object4.desktopSource.sourcePid);
}
}
}
pidFromDesktopSource = (importDefault(4488) /* metro dependency 4488: CrossPlatformNativeUtilsNative */).getPidFromDesktopSource(sourceId);
value5 = maybeTryHookProcess(pidFromDesktopSource, true);
soundshareId = value5.soundshareId;
object4 = {desktopSource: {id: sourceId, sourcePid: pidFromDesktopSource, soundshareId: soundshareId,
soundshareSession: value5.soundshareSession}, quality: quality};
hdrCaptureMode = getHdrCaptureMode('MediaEngineStore clips');
videoHook = _getSettings0().videoHook;
r11 = videoHook ? !DisableHookFramePacerExperiment.getConfig({location: 'handleClipsInit'}).enabled : !videoHook;
r8 = videoHook && VideoHookDX12Experiment.getConfig({location: 'handleClipsInit'}).enabled;
binding = env0_77;
setClipsSource = binding.setClipsSource;
object3 = {};
desktopSource = object4.desktopSource;
id = desktopSource.id;
object3.id = id;
desktopSource = object4.desktopSource;
soundshareId = desktopSource.soundshareId;
object3.soundshareId = soundshareId;
object3.useVideoHook = videoHook;
object3.useHookFramePacer = r11;
object3.useGraphicsCapture = supportsWindowsGraphicsCapture();
object3.useCaptureDeviceForEncode = false;
object3.useLoopback = env0_74.getExperimentalSoundshare();
object3.useQuartzCapturer = true;
object3.allowScreenCaptureKit = supportsScreenCaptureKit();
object3.videoHookStaleFrameTimeoutMs = 500;
object3.graphicsCaptureStaleFrameTimeoutMs = env0_65;
object3.hdrCaptureMode = hdrCaptureMode;
object3.videoHookAllowDx12 = r8;
binding3 = env0_74;
Reflect.apply(setClipsSource, binding, [{desktopDescription: object3, quality: quality,
applicationName: applicationName,
videoEncoderExperiments: binding3.getVideoEncoderExperiments(MediaEngineContextTypes.STREAM, 'streamer')}]);
return undefined;
}
return false;
}
function CLIPS_SETTINGS_UPDATE_35839({settings}) { // fn#35839, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:72991, offset: 0x0107e067, size: 49 bytes, params: 2, frame: 11
if (settings.decoupledClipsEnabled === false) {
env0_77.setClipsSource(null);
}
}
function MEDIA_ENGINE_SET_DEVICE_AUDIO_EFFECTS({deviceId, active, available}) { // fn#35841, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:73248, offset: 0x0107e0ab, size: 48 bytes, params: 2, frame: 5
env0_124[deviceId] = {active: active, available: available};
}
}
function* _fun35481() { // fn#35481, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:5858, offset: 0x0107472c, size: 190 bytes, params: 1, frame: 14
var r2;
var decodingInfo;
var object;
var object2;
var value3;
var supported;
var powerEfficient;
var error;
let value = undefined;
if (false) {
return value;
}
if (typeof global.window === 'undefined') {
return false;
}
let navigator = global.navigator;
if (typeof navigator === 'undefined') {
return false;
}
if (!('mediaCapabilities' in global.navigator)) {
return false;
}
let mediaCapabilities = global.navigator.mediaCapabilities;
if (mediaCapabilities == null) {
return false;
}
try {
navigator = global.navigator;
} catch (error) {
return false;
}
try {
mediaCapabilities = navigator.mediaCapabilities;
} catch (error) {
return false;
}
try {
decodingInfo = mediaCapabilities.decodingInfo;
} catch (error) {
return false;
}
try {
object = {};
} catch (error) {
return false;
}
try {
object.type = 'file';
} catch (error) {
return false;
}
try {
object2 = {'contentType': 'video/mp4; codecs="hev1.1.6.L153.B0"', 'width': 1920, 'height': 1080,
'bitrate': 2000000,
'framerate': 30};
} catch (error) {
return false;
}
try {
object.video = object2;
} catch (error) {
return false;
}
try {
value = Reflect.apply(decodingInfo, mediaCapabilities, [object]);
} catch (error) {
return false;
}
yield value;
try {
value = undefined;
value3 = false;
} catch (error) {
return false;
}
if (value3) {
return value;
}
try {
supported = value.supported;
} catch (error) {
return false;
}
if (supported) {
try {
powerEfficient = value.powerEfficient;
} catch (error) {
return false;
}
r2 = powerEfficient;
} else {
r2 = supported;
}
return r2;
}
function _fun35555({name}) { // fn#35555, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4431:28606, offset: 0x01077ed6, size: 36 bytes, params: 2, frame: 11
return name.toLowerCase().includes('dualsense');
}
global.__d(_fun35470, 4259, [6, 7, 15, 17, 18, 57, 5, 4260, 4265, 4107, 4266, 4289, 1348, 1226, 4290, 4293, 1379,
4294, 1878, 12412, 661, 4286, 4661, 12413, 670, 12414, 4291, 3, 672, 477, 4406, 4041, 4662, 12415, 12416, 12417,
10750, 12418, 22, 12401, 12419, 12420, 12421, 12422, 12423, 12424, 9235, 683, 694, 10826, 12425, 12426, 4608,
12427, 12472, 12473, 12474, 12475, 12476, 12477, 12384, 4489, 4488, 3767, 587, 12478, 10269, 6731, 12482, 12483,
1244, 4222, 12484, 12485, 44, 12411, 12486, 12396, 1216, 12382, 10684, 4092, 12487, 12488, 566, 12489,
2]) /* metro module 4259, dependencies: [6, 7, 15, 17, 18, 57, 5, 4260, 4265, 4107, 4266, 4289, 1348, 1226, 4290, 4293, 1379, 4294, 1878, 12412, 661, 4286, 4661, 12413, 670, 12414, 4291, 3, 672, 477, 4406, 4041, 4662, 12415, 12416, 12417, 10750, 12418, 22, 12401, 12419, 12420, 12421, 12422, 12423, 12424, 9235, 683, 694, 10826, 12425, 12426, 4608, 12427, 12472, 12473, 12474, 12475, 12476, 12477, 12384, 4489, 4488, 3767, 587, 12478, 10269, 6731, 12482, 12483, 1244, 4222, 12484, 12485, 44, 12411, 12486, 12396, 1216, 12382, 10684, 4092, 12487, 12488, 566, 12489, 2] */;