203 lines
12 KiB
TypeScript
203 lines
12 KiB
TypeScript
/* Metro module 13085; source: modules/voice_messages/native/VoiceMessagesPlaybackManager.tsx; dependencies: [6, 7, 15, 17, 18, 27, 4502, 1934, 477, 13086, 4560, 694, 4561, 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 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 Dispatcher from '../../../Dispatcher.tsx'; /* Metro dependency 694 */
|
|
import SelectedChannelStore from '../../../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */
|
|
import AccessibilityStore from '../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
|
|
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 */
|
|
import * as PlatformUtilsModule from '../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
|
|
|
|
function _fun99980(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13275:6, offset: 0x021db066, size: 349 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const pauseCurrentAudioPlayer2 = pauseCurrentAudioPlayer;
|
|
const playCurrentAudioPlayer2 = playCurrentAudioPlayer;
|
|
const handleVoiceMessageDeleted2 = handleVoiceMessageDeleted;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const env0_8 = value.AppState;
|
|
const env0_9 = value.NativeModules;
|
|
value = importDefault(4561) /* metro dependency 4561: LifecycleManager */;
|
|
value = _fun99987(value);
|
|
value = new value();
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/voice_messages/native/VoiceMessagesPlaybackManager.tsx');
|
|
exports.default = value;
|
|
exports.pauseCurrentAudioPlayer = pauseCurrentAudioPlayer2;
|
|
exports.playCurrentAudioPlayer = playCurrentAudioPlayer2;
|
|
exports.handleVoiceMessageDeleted = handleVoiceMessageDeleted2;
|
|
function _isNativeReflectConstruct_99981() { // fn#99981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13275:209, offset: 0x021db1c3, size: 98 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_99981_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function pauseCurrentAudioPlayer(a0) { // fn#99984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13275:402, offset: 0x021db225, size: 103 bytes, params: 2, frame: 13
|
|
var DCDAudioPlayerManager;
|
|
if (PlatformUtilsModule.isAndroid()) {
|
|
(importDefault(13086) /* metro dependency 13086: NativeAudioPlayerModule */).pauseCurrentPlayer(a0);
|
|
} else {
|
|
DCDAudioPlayerManager = NativeModules.DCDAudioPlayerManager;
|
|
if (DCDAudioPlayerManager != null) {
|
|
DCDAudioPlayerManager.pauseCurrentPlayer(a0);
|
|
}
|
|
}
|
|
}
|
|
|
|
function playCurrentAudioPlayer() { // fn#99985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13275:553, offset: 0x021db28c, size: 98 bytes, params: 1, frame: 12
|
|
var DCDAudioPlayerManager;
|
|
if (PlatformUtilsModule.isAndroid()) {
|
|
(importDefault(13086) /* metro dependency 13086: NativeAudioPlayerModule */).maybePlayCurrentPlayer();
|
|
} else {
|
|
DCDAudioPlayerManager = NativeModules.DCDAudioPlayerManager;
|
|
if (DCDAudioPlayerManager != null) {
|
|
DCDAudioPlayerManager.maybePlayCurrentPlayer();
|
|
}
|
|
}
|
|
}
|
|
|
|
function handleVoiceMessageDeleted(a0) { // fn#99986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13275:708, offset: 0x021db2ee, size: 103 bytes, params: 2, frame: 13
|
|
var DCDAudioPlayerManager;
|
|
if (PlatformUtilsModule.isAndroid()) {
|
|
(importDefault(13086) /* metro dependency 13086: NativeAudioPlayerModule */).handleVoiceMessageDeleted(a0);
|
|
} else {
|
|
DCDAudioPlayerManager = NativeModules.DCDAudioPlayerManager;
|
|
if (DCDAudioPlayerManager != null) {
|
|
DCDAudioPlayerManager.handleVoiceMessageDeleted(a0);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun99987(a0) { // fn#99987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13275:885, offset: 0x021db355, size: 97 bytes, params: 2, frame: 16
|
|
const VoiceMessagesPlaybackManager2 = VoiceMessagesPlaybackManager;
|
|
Inherits(VoiceMessagesPlaybackManager2, a0);
|
|
return CreateClass(VoiceMessagesPlaybackManager2, [{key: '_terminate', value: value_99993}, {key: '_initialize',
|
|
value: value_99994}]);
|
|
function VoiceMessagesPlaybackManager(a0) { // fn#99988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13275:897, offset: 0x021db3b6, size: 200 bytes, params: 2, frame: 21
|
|
var environment;
|
|
var r0;
|
|
var Reflect;
|
|
let value = copyRestArgs(0, undefined);
|
|
let value2 = environment.__proto__;
|
|
let binding = env1_3;
|
|
binding(this, VoiceMessagesPlaybackManager);
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, items2);
|
|
value = env1_6(VoiceMessagesPlaybackManager);
|
|
binding = env1_5;
|
|
if (_isNativeReflectConstruct_99981()) {
|
|
Reflect = global.Reflect;
|
|
value = Reflect.construct(value, items2, env1_6(this).constructor);
|
|
r0 = value;
|
|
} else {
|
|
value = value.apply(this, items2);
|
|
r0 = value;
|
|
}
|
|
value = binding(this, r0);
|
|
value.appState = AppState.currentState;
|
|
value.handleSetPrefersReducedMotion = handleSetPrefersReducedMotion;
|
|
value.handleMessageDelete = function({id, channelId}) {
|
|
var value2 = channelId === SelectedChannelStore.getCurrentlySelectedChannelId();
|
|
if (value2 != null && value2) {
|
|
if (handleVoiceMessageDeleted != null) {
|
|
handleVoiceMessageDeleted(id);
|
|
}
|
|
}
|
|
};
|
|
value.handleLogout = function() {
|
|
pauseCurrentAudioPlayer(false);
|
|
};
|
|
value.handleAppStateChanged = handleAppStateChanged_99992;
|
|
return value;
|
|
function handleSetPrefersReducedMotion(a0) { // fn#99989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13275:1225, owner: VoiceMessagesPlaybackManager.handleSetPrefersReducedMotion, offset: 0x021db47e, size: 109 bytes, params: 2, frame: 14
|
|
var DCDAccessibilityManager;
|
|
let value = environment.__proto__.__proto__;
|
|
if (PlatformUtilsModule.isAndroid()) {
|
|
value = importDefault(4560) /* metro dependency 4560: NativeDeviceAccessibilityModule */;
|
|
value.handleSetPrefersReducedMotion(a0.prefersReducedMotion);
|
|
} else {
|
|
DCDAccessibilityManager = NativeModules.DCDAccessibilityManager;
|
|
DCDAccessibilityManager.handleSetPrefersReducedMotion(a0.prefersReducedMotion);
|
|
}
|
|
}
|
|
|
|
function VoiceMessagesPlaybackManagerHandleAppStateChanged({state}) { // fn#99992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13275:1634, owner: VoiceMessagesPlaybackManager.handleAppStateChanged, offset: 0x021db533, size: 114 bytes, params: 2, frame: 14
|
|
var binding;
|
|
var appState;
|
|
if (PlatformUtilsModule.isAndroid()) {
|
|
binding = env0_0;
|
|
appState = binding.appState;
|
|
binding.appState = state;
|
|
if (state !== 'active') {
|
|
if (state !== 'active' && appState === 'active') {
|
|
pauseCurrentAudioPlayer(true);
|
|
}
|
|
} else if (appState !== 'active') {
|
|
playCurrentAudioPlayer();
|
|
} else if (state !== 'active' && appState === 'active') {
|
|
pauseCurrentAudioPlayer(true);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function value_99993() { // fn#99993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13275:1911, offset: 0x021db5a5, size: 147 bytes, params: 1, frame: 18
|
|
let value = environment.__proto__;
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('LOGOUT', this.handleLogout);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('MESSAGE_DELETE', this.handleMessageDelete);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('APP_STATE_UPDATE', this.handleAppStateChanged);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('ACCESSIBILITY_SET_PREFERS_REDUCED_MOTION', this.handleSetPrefersReducedMotion);
|
|
}
|
|
|
|
function value_99994() { // fn#99994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13275:2230, offset: 0x021db638, size: 179 bytes, params: 1, frame: 19
|
|
const defaultImport = Dispatcher;
|
|
defaultImport.subscribe('LOGOUT', this.handleLogout);
|
|
const defaultImport2 = defaultImport;
|
|
defaultImport2.subscribe('MESSAGE_DELETE', this.handleMessageDelete);
|
|
const defaultImport3 = defaultImport;
|
|
defaultImport3.subscribe('APP_STATE_UPDATE', this.handleAppStateChanged);
|
|
const defaultImport4 = defaultImport;
|
|
defaultImport4.subscribe('ACCESSIBILITY_SET_PREFERS_REDUCED_MOTION', this.handleSetPrefersReducedMotion);
|
|
this.handleSetPrefersReducedMotion({type: 'ACCESSIBILITY_SET_PREFERS_REDUCED_MOTION',
|
|
prefersReducedMotion: AccessibilityStore.rawPrefersReducedMotion});
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun99980, 13085, [6, 7, 15, 17, 18, 27, 4502, 1934, 477, 13086, 4560, 694, 4561,
|
|
2]) /* metro module 13085, dependencies: [6, 7, 15, 17, 18, 27, 4502, 1934, 477, 13086, 4560, 694, 4561, 2] */;
|