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

362 lines
18 KiB
TypeScript

/* Metro module 10760; source: modules/sound_playback/native/SoundUtils.tsx; dependencies: [6, 7, 27, 1581, 477, 2] */
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 * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
function _fun82759(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#82759, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:6, offset: 0x01f00c9a, size: 687 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_6 = _fun82760();
object = {NOTIFICATION: 'notification', VOICE: 'voice', RING_TONE: 'ring_tone', MEDIA: 'media',
NOTIFICATION_NO_VIBRATION: 'notification_no_vibration'};
const object2 = {};
let VOICE = object.VOICE;
object2.call_calling = VOICE;
let value = require(1581) /* metro dependency 1581: MetaQuestUtilsAndroid */;
object2.call_ringing = value.isMetaQuest() ? object.MEDIA : object.RING_TONE;
value = require(1581) /* metro dependency 1581: MetaQuestUtilsAndroid */;
object2.call_ringing_halloween = value.isMetaQuest() ? object.MEDIA : object.RING_TONE;
VOICE = object.VOICE;
object2.camera_on = VOICE;
VOICE = object.VOICE;
object2.camera_off = VOICE;
VOICE = object.VOICE;
object2.deafen = VOICE;
VOICE = object.VOICE;
object2.disconnect = VOICE;
let NOTIFICATION = object.NOTIFICATION;
object2.mention1 = NOTIFICATION;
NOTIFICATION = object.NOTIFICATION;
object2.mention2 = NOTIFICATION;
NOTIFICATION = object.NOTIFICATION;
object2.mention3 = NOTIFICATION;
NOTIFICATION = object.NOTIFICATION;
object2.message1 = NOTIFICATION;
NOTIFICATION = object.NOTIFICATION;
object2.message2 = NOTIFICATION;
NOTIFICATION = object.NOTIFICATION;
object2.message3 = NOTIFICATION;
VOICE = object.VOICE;
object2.mute = VOICE;
VOICE = object.VOICE;
object2.ptt_start = VOICE;
VOICE = object.VOICE;
object2.ptt_stop = VOICE;
VOICE = object.VOICE;
object2.reconnect = VOICE;
VOICE = object.VOICE;
object2.stage_waiting = VOICE;
VOICE = object.VOICE;
object2.stream_ended = VOICE;
VOICE = object.VOICE;
object2.stream_started = VOICE;
VOICE = object.VOICE;
object2.stream_user_joined = VOICE;
VOICE = object.VOICE;
object2.stream_user_left = VOICE;
VOICE = object.VOICE;
object2.soundboard_sound = VOICE;
VOICE = object.VOICE;
object2.undeafen = VOICE;
VOICE = object.VOICE;
object2.unmute = VOICE;
VOICE = object.VOICE;
object2.user_join = VOICE;
VOICE = object.VOICE;
object2.user_leave = VOICE;
VOICE = object.VOICE;
object2.user_moved = VOICE;
const MEDIA = object.MEDIA;
object2.vibing_wumpus = MEDIA;
let NOTIFICATION_NO_VIBRATION = object.NOTIFICATION_NO_VIBRATION;
object2.activity_end = NOTIFICATION_NO_VIBRATION;
NOTIFICATION_NO_VIBRATION = object.NOTIFICATION_NO_VIBRATION;
object2.activity_launch = NOTIFICATION_NO_VIBRATION;
NOTIFICATION_NO_VIBRATION = object.NOTIFICATION_NO_VIBRATION;
object2.activity_user_join = NOTIFICATION_NO_VIBRATION;
NOTIFICATION_NO_VIBRATION = object.NOTIFICATION_NO_VIBRATION;
object2.activity_user_left = NOTIFICATION_NO_VIBRATION;
value = _fun82773();
(FileImportTrackerModule).fileFinishedImporting('modules/sound_playback/native/SoundUtils.tsx');
exports.MobileAudioSound = value;
function _fun82760() { // fn#82760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:146, offset: 0x01f00f49, size: 260 bytes, params: 1, frame: 15
return CreateClass(RNSound, [{key: '_createSound', value: function(a0, a1, a2) {
var env0_0 = this;
var env0_1 = a2;
var DCDSoundManager = NativeModules.DCDSoundManager;
DCDSoundManager.prepare(a0, a1, this._key, _fun82763);
}}, {key: 'play', value: value_82764}, {key: 'pause', value: value_82765}, {key: 'stop', value: value_82766},
{key: 'release', value: value_82767}, {key: 'volume', get: function() {
return this._volume;
}, set: set_82769}, {key: 'duration', get: function() {
return this._duration;
}}, {key: 'numberOfLoops', get: function() {
return this._numberOfLoops;
}, set: set_82772}]);
function RNSound(a0, a1, a2, a3) { // fn#82761, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:167, offset: 0x01f0104d, size: 137 bytes, params: 5, frame: 16
let binding = env1_2;
binding(this, RNSound);
this._volume = a2;
this._loaded = false;
binding = env1_5;
const value3 = typeof binding === 'bigint' ? binding : +binding;
env1_5 = typeof value3 === 'bigint' ? value3 + 1n : +value3 + 1;
this._key = value3;
this._duration = -1;
this._numberOfChannels = -1;
this._volume = 1;
this._pan = 0;
this._numberOfLoops = 0;
this._sound = this._createSound(a0, a1, a3);
}
function value_82762(a0, a1, a2) { // fn#82762, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:413, offset: 0x01f010d6, size: 65 bytes, params: 4, frame: 17
const env0_1 = a2;
const DCDSoundManager = NativeModules.DCDSoundManager;
DCDSoundManager.prepare(a0, a1, this._key, _fun82763);
function _fun82763(a0, a1) { // fn#82763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:470, offset: 0x01f01117, size: 86 bytes, params: 3, frame: 12
var binding;
if (a1) {
binding = env0_0;
binding._duration = a1.duration;
binding._numberOfChannels = a1.numberOfChannels;
}
if (a0 == null) {
env0_0._loaded = true;
}
if (importDefault != null) {
importDefault(a0);
}
}
}
function value_82764() { // fn#82764, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:615, offset: 0x01f0116d, size: 46 bytes, params: 1, frame: 11
var value;
var DCDSoundManager;
if (this._loaded) {
value = environment.__proto__;
DCDSoundManager = NativeModules.DCDSoundManager;
DCDSoundManager.play(this._key);
}
}
function value_82765() { // fn#82765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:695, offset: 0x01f0119b, size: 46 bytes, params: 1, frame: 11
var value;
var DCDSoundManager;
if (this._loaded) {
value = environment.__proto__;
DCDSoundManager = NativeModules.DCDSoundManager;
DCDSoundManager.pause(this._key);
}
}
function value_82766() { // fn#82766, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:775, offset: 0x01f011c9, size: 46 bytes, params: 1, frame: 11
var value;
var DCDSoundManager;
if (this._loaded) {
value = environment.__proto__;
DCDSoundManager = NativeModules.DCDSoundManager;
DCDSoundManager.stop(this._key);
}
}
function value_82767() { // fn#82767, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:857, offset: 0x01f011f7, size: 54 bytes, params: 1, frame: 12
var value;
var DCDSoundManager;
if (this._loaded) {
value = environment.__proto__;
DCDSoundManager = NativeModules.DCDSoundManager;
DCDSoundManager.release(this._key);
}
this._loaded = false;
}
function set_82769(a0) { // fn#82769, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:991, offset: 0x01f01238, size: 56 bytes, params: 2, frame: 13
var value;
var DCDSoundManager;
this._volume = a0;
if (this._loaded) {
value = environment.__proto__;
DCDSoundManager = NativeModules.DCDSoundManager;
DCDSoundManager.setVolume(this._key, a0);
}
}
function set_82772(a0) { // fn#82772, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:1198, offset: 0x01f01286, size: 58 bytes, params: 2, frame: 13
var value;
var DCDSoundManager;
this._numberOfLoops = a0;
if (this._loaded) {
value = environment.__proto__;
DCDSoundManager = NativeModules.DCDSoundManager;
DCDSoundManager.setNumberOfLoops(this._key, a0);
}
}
}
function _fun82773() { // fn#82773, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:2334, offset: 0x01f012c0, size: 247 bytes, params: 1, frame: 15
return CreateClass(MobileAudioSound, [{key: 'volume', get: function() {
return this._volume;
}, set: function(a0) {
var env0_0 = a0;
this._volume = a0;
this.ensureSound().then(_fun82777);
}}, {key: 'loop', value: function() {
this.ensureSound().then(_fun82779);
}}, {key: 'play', value: function() {
this.ensureSound().then(_fun82781);
}}, {key: 'playWithListener', value: function() {
var env0_0 = this;
var Promise = global.Promise;
var value = Object.create(Promise.prototype, {constructor: {value: Promise}});
var value2 = new Promise(_fun82783);
return value2 instanceof Object ? value2 : value;
}}, {key: 'pause', value: function() {
if (this.soundPromise != null) {
this.soundPromise.then(_fun82788);
}
}}, {key: 'stop', value: function() {
this.destroyAudio();
}}, {key: 'destroyAudio', value: function() {
var env0_0 = this;
if (this.soundPromise != null) {
this.soundPromise.then(_fun82791);
}
}}, {key: 'ensureSound', value: function() {
var env0_0 = this;
this.soundPromise = this.soundPromise ?? new global.Promise(_fun82793);
return this.soundPromise;
}}]);
function MobileAudioSound(a0, a1, a2, a3) { // fn#82774, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:2355, offset: 0x01f013b7, size: 71 bytes, params: 5, frame: 14
env1_2(this, MobileAudioSound);
this.name = a0;
this.usage = env1_7[a1];
this._volume = a2;
this.outputChannel = a3;
}
function set_82776(a0) { // fn#82776, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:2536, offset: 0x01f013fe, size: 49 bytes, params: 2, frame: 12
const env0_0 = a0;
this._volume = a0;
this.ensureSound().then(_fun82777);
function _fun82777(a0) { // fn#82777, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:2588, offset: 0x01f0142f, size: 20 bytes, params: 2, frame: 2
a0.volume = env0_0;
}
}
function value_82778() { // fn#82778, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:2626, offset: 0x01f01443, size: 36 bytes, params: 1, frame: 11
this.ensureSound().then(function(a0) {
a0.numberOfLoops = -1;
a0.play();
});
}
function value_82780() { // fn#82780, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:2717, offset: 0x01f01486, size: 36 bytes, params: 1, frame: 11
this.ensureSound().then(function(a0) {
a0.play();
});
}
function value_82782() { // fn#82782, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:2801, offset: 0x01f014bb, size: 46 bytes, params: 1, frame: 11
const Promise = global.Promise;
const value = Object.create(Promise.prototype, {constructor: {value: Promise}});
const promise = new Promise(_fun82783);
return promise instanceof Object ? promise : value;
function _fun82783(a0, a1) { // fn#82783, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:2832, offset: 0x01f014e9, size: 72 bytes, params: 3, frame: 12
const env0_0 = a0;
const env0_1 = a1;
let value = env0_0.ensureSound();
value = value.then(_fun82784);
value.catch(function(a0) {
require(a0);
});
function _fun82784(a0) { // fn#82784, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:2865, offset: 0x01f01531, size: 142 bytes, params: 2, frame: 13
var environment;
if (!(a0.duration != null && a0.duration !== 0)) {
require('sound has no duration');
}
a0.play();
value = environment.__proto__.__proto__.__proto__;
value = require(477) /* metro dependency 477: PlatformUtils */;
value = value.isIOS();
global.setTimeout(_fun82785, a0.duration * (value ? 1000 : 1));
function _fun82785() { // fn#82785, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:2979, offset: 0x01f015bf, size: 18 bytes, params: 1, frame: 11
env1_0(true);
}
}
}
}
function value_82787() { // fn#82787, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:3052, offset: 0x01f015d1, size: 44 bytes, params: 1, frame: 11
if (this.soundPromise != null) {
this.soundPromise.then(function(a0) {
return a0.pause();
});
}
}
function value_82790() { // fn#82790, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:3206, offset: 0x01f0161f, size: 48 bytes, params: 1, frame: 12
if (this.soundPromise != null) {
this.soundPromise.then(_fun82791);
}
function _fun82791(a0) { // fn#82791, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:3266, offset: 0x01f0164f, size: 42 bytes, params: 2, frame: 9
a0.stop();
a0.release();
env0_0.soundPromise = null;
}
}
function value_82792() { // fn#82792, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:3344, offset: 0x01f01679, size: 70 bytes, params: 1, frame: 13
this.soundPromise = this.soundPromise ?? new global.Promise(_fun82793);
return this.soundPromise;
function _fun82793(a0, a1) { // fn#82793, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:3429, offset: 0x01f016bf, size: 82 bytes, params: 3, frame: 18
var environment;
const env0_0 = a0;
const env0_1 = a1;
const value = environment.__proto__.__proto__;
const binding = env2_6;
const {name, usage, _volume} = env0_0;
const value2 = new binding(name, usage, _volume, _fun82794);
function _fun82794(a0) { // fn#82794, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:3484, offset: 0x01f01711, size: 55 bytes, params: 2, frame: 12
if (a0 == null) {
env0_0(ClassCallCheck);
} else if (a0 !== '') {
require(a0);
} else {
env0_0(ClassCallCheck);
}
}
}
}
}
}
function _fun82779(a0) { // fn#82779, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:2662, offset: 0x01f01467, size: 31 bytes, params: 2, frame: 9
a0.numberOfLoops = -1;
a0.play();
}
function _fun82781(a0) { // fn#82781, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:2753, offset: 0x01f014aa, size: 17 bytes, params: 2, frame: 9
a0.play();
}
function _fun82788(a0) { // fn#82788, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:3112, offset: 0x01f015fd, size: 15 bytes, params: 2, frame: 9
return a0.pause();
}
global.__d(_fun82759, 10760, [6, 7, 27, 1581, 477,
2]) /* metro module 10760, dependencies: [6, 7, 27, 1581, 477, 2] */;