Files
discord-decomp/sources/modules/voice_panel/native/VoicePanelSystemUIManager.tsx
T
2026-07-27 16:20:00 +03:00

152 lines
8.6 KiB
TypeScript

/* Metro module 15448; source: modules/voice_panel/native/VoicePanelSystemUIManager.tsx; dependencies: [57, 31, 4606, 11795, 11793, 4299, 33, 11794, 690, 477, 6949, 4017, 7739, 7725, 7727, 2] */
function _fun118240(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#118240, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15645:6, offset: 0x024d2865, size: 301 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
let value = importAll(31) /* metro dependency 31 */;
const channelRTCStore = importDefault(4606) /* metro dependency 4606: ChannelRTCStore */;
const env0_6 = (require(11795) /* metro dependency 11795: VoicePanelConstants */).VoicePanelModes;
const env0_7 = (require(11793) /* metro dependency 11793: VoicePanelControlsConstants */).VoicePanelControlsModes;
const env0_8 = (require(4299) /* metro dependency 4299: CallConstants */).ParticipantTypes;
const value2 = require(33) /* metro dependency 33 */;
const env0_9 = value2.jsx;
const env0_10 = value2.Fragment;
const env0_11 = value2.jsxs;
object = {code: 'function VoicePanelSystemUIManagerTsx1(){const{focused,mode,controlsSpecs,windowDimensions}=this.__closure;var _focused$get;return{focusedId:(_focused$get=focused.get())===null||_focused$get===void 0?void 0:_focused$get.id,mode:mode.get(),controlsMode:controlsSpecs.get().mode,landscape:windowDimensions.get().landscape};}'};
object = {code: 'function VoicePanelSystemUIManagerTsx2(props,previous){const{cheapWorkletShallowEqual,runOnJS,handleStateChange}=this.__closure;if(cheapWorkletShallowEqual(props,previous!==null&&previous!==void 0?previous:undefined))return;runOnJS(handleStateChange)(props);}'};
value = value.memo(VoicePanelSystemUIManager);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/voice_panel/native/VoicePanelSystemUIManager.tsx');
exports.default = value;
}
function VoicePanelSystemUIManager() { // fn#118241, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15645:872, offset: 0x024d2992, size: 597 bytes, params: 1, frame: 28
const binding = env0_4;
const value2 = binding.useContext(importDefault(11794) /* metro dependency 11794: VoicePanelStateContext */);
const focused = value2.focused;
const channelId = value2.channelId;
const mode = value2.mode;
const controlsSpecs = value2.controlsSpecs;
const env0_3 = controlsSpecs;
const windowDimensions = value2.windowDimensions;
let useState = binding.useState;
const value3 = Reflect.apply(useState, binding, [true]);
const binding2 = env0_3;
const value4 = binding2(value3, 2);
const property = value4[0];
const env0_5 = value4[1];
useState = binding.useState;
const value5 = binding2(Reflect.apply(useState, binding, [true]), 2);
const property2 = value5[0];
const env0_6 = value5[1];
useState = binding.useState;
const value6 = binding2(Reflect.apply(useState, binding, [false]), 2);
const property3 = value6[0];
const env0_7 = value6[1];
useState = binding.useState;
const value7 = binding2(Reflect.apply(useState, binding, [false]), 2);
const property4 = value7[0];
const env0_8 = value7[1];
const {cancelPendingDebounce, handleStateChange} = binding.useMemo(_fun118242, [channelId]);
binding.useEffect(function() {
return _fun118248;
}, [cancelPendingDebounce]);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedReaction = reanimatedRexportModule.useAnimatedReaction;
const closure = function() {
var object = {};
object.focusedId = focused.get()?.id;
object.mode = mode.get();
object.controlsMode = controlsSpecs.get().mode;
object.landscape = windowDimensions.get().landscape;
return object;
};
closure.__closure = {focused: focused, mode: mode, controlsSpecs: controlsSpecs, windowDimensions: windowDimensions};
closure.__workletHash = 2478376475717;
closure.__initData = env0_12;
const closure2 = VoicePanelSystemUIManagerU;
closure2.__closure = {cheapWorkletShallowEqual: (require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */).cheapWorkletShallowEqual,
runOnJS: reanimatedRexportModule.runOnJS, handleStateChange: handleStateChange};
closure2.__workletHash = 3592680244658;
closure2.__initData = env0_13;
Reflect.apply(useAnimatedReaction, reanimatedRexportModule, [closure, closure2]);
return (
<>
{property2 ? ((Component) => <Component hidden={!property} barStyle="light-content" />)(importDefault(7725) /* metro dependency 7725: StatusBarAndroid */) : null}
{((Component) => <Component prefersHidden={property3} prefersDeferringSystemGestures={property4} />)(importDefault(7727) /* metro dependency 7727: HomeIndicator */)}
</>
);
}
function _fun118242() { // fn#118242, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15645:1188, offset: 0x024d2be7, size: 100 bytes, params: 1, frame: 16
var environment;
const closure = updateState_118243;
const value = environment.__proto__;
const env0_1 = (importDefault(6949) /* metro dependency 6949 */)(closure, 500, {maxWait: 2000});
return {cancelPendingDebounce: cancelPendingDebounce, handleStateChange: handleStateChange_118246};
}
function _fun118247() { // fn#118247, offset: 0x024d2dea, size: 11 bytes, params: 1, frame: 1
return function() {
return cancelPendingDebounce();
};
}
function VoicePanelSystemUIManagerU(a0, a1) { // fn#118250, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15645:2021, owner: VoicePanelSystemUIManager.u, offset: 0x024d2e5e, size: 104 bytes, params: 3, frame: 17
let value = a1;
const value3 = undefined;
const cheapWorkletShallowEqualModule = require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */;
if (!cheapWorkletShallowEqualModule.cheapWorkletShallowEqual(a0, value ?? value3)) {
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value.runOnJS(handleStateChange)(a0);
}
return value3;
}
function updateState_118243({focusedId, mode, controlsMode, landscape}) { // fn#118243, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15645:1209, offset: 0x024d2c4b, size: 89 bytes, params: 2, frame: 12
var environment;
const value = environment.__proto__.__proto__;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun118244);
}
function cancelPendingDebounce() { // fn#118245, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15645:1527, offset: 0x024d2d8d, size: 21 bytes, params: 1, frame: 9
env0_1.cancel();
}
function handleStateChange_118246(a0) { // fn#118246, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15645:1563, offset: 0x024d2da2, size: 72 bytes, params: 2, frame: 12
const binding = env0_2;
let focusedId = a0.focusedId;
if (binding !== focusedId) {
focusedId = a0.focusedId;
env0_1(a0);
} else {
env0_1.cancel();
updateState_118243(a0);
}
}
function _fun118244() { // fn#118244, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15645:1283, offset: 0x024d2ca4, size: 233 bytes, params: 1, frame: 19
const value = environment.__proto__.__proto__;
const binding = env2_6;
const modeBinding = mode;
const PIP = VoicePanelModes.PIP;
const value4 = undefined;
binding(modeBinding !== PIP);
const controlsModeBinding = controlsMode;
const HIDDEN = VoicePanelControlsModes.HIDDEN;
const value5 = controlsModeBinding !== HIDDEN;
let r2 = !(focusedId != null) && !landscape;
r2 = !r2 ? value5 : r2;
env2_5(r2);
const r22 = focusedId != null ? ChannelRTCStore.getParticipant(channelId, focusedId) : value4;
const type = r22 == null ? value4 : r22.type;
const ACTIVITY = ParticipantTypes.ACTIVITY;
const value10 = type === ACTIVITY;
const isIOS2 = (require(477) /* metro dependency 477: PlatformUtils */).isIOS();
const r3 = isIOS2 ? value10 : !!isIOS2;
env2_8(r3);
env2_7(!r2 && !r3);
return value4;
}