Initial commit

This commit is contained in:
janisslsm committed 2026-07-27 16:20:00 +03:00
commit af3b49f756
16065 files changed
+2938410

No files matched your search

@@ -0,0 +1,12 @@
/* Metro module 13080; source: modules/media_panel/native/MediaPlaybackPanelConstants.tsx; dependencies: [2] */
function _fun99947(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99947, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13270:6, offset: 0x021da3ad, size: 141 bytes, params: 8, frame: 16
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_panel/native/MediaPlaybackPanelConstants.tsx');
exports.MediaPlaybackPanelModes = {DISMISSED: 'dismissed', PIP: 'pip'};
exports.PLAYBACK_COMPLETION_DETECTION_TOLERANCE = 100;
exports.PLAYBACK_PROGRESS_UPDATE_INTERVAL = 500;
exports.MEDIA_PLAYBACK_PANEL_LAYOUT_PHYSICS = {'stiffness': 320, 'mass': 0.25, 'damping': 15,
'overshootClamping': true};
}
@@ -0,0 +1,72 @@
/* Metro module 15567; source: modules/media_panel/native/MediaPlaybackPanelContainer.tsx; dependencies: [31, 33, 13079, 3771, 15568, 15570, 2] */
function _fun119228(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#119228, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15764:6, offset: 0x02502049, size: 148 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const env0_3 = (require(33) /* metro dependency 33 */).jsx;
value = value.memo(MediaPlaybackPanelContainer);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_panel/native/MediaPlaybackPanelContainer.tsx');
exports.default = value;
}
function MediaPlaybackPanelContainer() { // fn#119229, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15764:134, offset: 0x025020dd, size: 131 bytes, params: 1, frame: 17
var r0;
var value;
const mediaPlayerManagerModule = require(13079) /* metro dependency 13079: MediaPlayerManager */;
const useMediaPlayerManagerStore = mediaPlayerManagerModule.useMediaPlayerManagerStore;
const moduleValue2 = require(3771) /* metro dependency 3771 */;
const useShallow = moduleValue2.useShallow;
if (Reflect.apply(useMediaPlayerManagerStore, mediaPlayerManagerModule, [Reflect.apply(useShallow, moduleValue2,
[_fun119230])])) {
value = importDefault(15568) /* metro dependency 15568: MediaPlaybackPanelController */;
value = ((Component) => <Component>{((Component) => <Component />)(importDefault(15570) /* metro dependency 15570: MediaPlaybackPanelUI */)}</Component>)(value);
r0 = value;
} else {
r0 = null;
}
return r0;
}
function _fun119230(a0) { // fn#119230, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15764:235, offset: 0x02502160, size: 190 bytes, params: 2, frame: 16
var attachmentIndex;
var r4;
var r3;
var r1;
var r0;
var activeMediaPlayerSource;
var mediaSourceMessage;
var value2;
var contentMessage;
const showPip = a0.showPip;
let r2 = showPip ? !a0.canAccessMedia : !showPip;
r2 = !r2 ? a0.activeMediaPlayerSource == null : r2;
value = !r2;
if (r2) {
r0 = value;
} else {
mediaSourceMessage = a0.mediaSourceMessage;
activeMediaPlayerSource = a0.activeMediaPlayerSource;
value = undefined;
attachmentIndex = activeMediaPlayerSource == null ? value : activeMediaPlayerSource.attachmentIndex;
value2 = false;
if (mediaSourceMessage == null) {
r1 = value2;
} else if (attachmentIndex == null) {
r1 = value2;
} else {
if (mediaSourceMessage == null) {
r4 = value;
} else {
contentMessage = mediaSourceMessage.getContentMessage();
r4 = contentMessage == null ? value : contentMessage.attachments[attachmentIndex];
}
r3 = r4 == null || r4.content_type == null ? value : r4.content_type.startsWith('audio');
value = r3 != null;
r1 = value && r3;
}
r0 = r1;
}
return r0;
}
@@ -0,0 +1,144 @@
/* Metro module 15568; source: modules/media_panel/native/MediaPlaybackPanelController.tsx; dependencies: [57, 31, 4502, 1378, 7710, 13080, 8044, 11796, 33, 4017, 1585, 15363, 13079, 566, 15569, 2] */
function _fun119231(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#119231, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15765:6, offset: 0x0250221e, size: 288 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 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
const embeddedActivitiesStore = importDefault(1378) /* metro dependency 1378: EmbeddedActivitiesStore */;
const voicePanelStore = importDefault(7710) /* metro dependency 7710: VoicePanelStore */;
const env0_8 = (require(13080) /* metro dependency 13080: MediaPlaybackPanelConstants */).MediaPlaybackPanelModes;
const env0_9 = (require(8044) /* metro dependency 8044: ActivityPanelConstants */).ActivityPanelModes;
const env0_10 = (require(11796) /* metro dependency 11796: MorphablePanelConstants */).MorphablePanelModes;
const env0_11 = (require(33) /* metro dependency 33 */).jsx;
object = {code: 'function MediaPlaybackPanelControllerTsx1(){const{mode,MediaPlaybackPanelModes,MorphablePanelModes}=this.__closure;switch(mode.get()){case MediaPlaybackPanelModes.PIP:{return MorphablePanelModes.PIP;}default:{return MorphablePanelModes.UNDEFINED;}}}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_panel/native/MediaPlaybackPanelController.tsx');
exports.default = MediaPlaybackPanelController;
}
function MediaPlaybackPanelController({children}) { // fn#119232, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15765:618, offset: 0x0250233e, size: 410 bytes, params: 2, frame: 24
const value = useCoreState();
const mode = value.mode;
const env0_1 = value.morphablePanelMode;
const env0_2 = value.wrapperDimensions;
const env0_3 = value.useReducedMotion;
const env0_4 = value.pipState;
const env0_5 = value.pipAvoidanceSpecs;
const env0_6 = value.scrollPosition;
const canShowPIP = value.canShowPIP;
const env0_8 = value.lockScrolling;
const env0_9 = value.wrapperOffset;
const binding = env0_4;
const env0_10 = binding.useRef(undefined);
let useState = binding.useState;
const get = mode.get;
const value2 = Reflect.apply(useState, binding, [Reflect.apply(get, mode, [])]);
const binding2 = env0_3;
const value3 = binding2(value2, 2);
let property = value3[0];
const env0_13 = binding.useCallback(_fun119238, [property, value3[1]]);
binding.useLayoutEffect(_fun119241, [canShowPIP, VoicePanelStore(function(a0) {
return a0.voicePanelsPIP.size > 0;
}), (require(566) /* metro dependency 566: flux */).useStateFromStores([EmbeddedActivitiesStore], function() {
return EmbeddedActivitiesStore.getActivityPanelMode() === ActivityPanelModes.PIP;
})]);
useState = binding.useState;
property = binding2(Reflect.apply(useState, binding, [_fun119242]), 1)[0];
const Provider = (importDefault(15569) /* metro dependency 15569: MediaPlaybackPanelStateContext */).Provider;
return (
<Provider value={property}>
{children}
</Provider>
);
}
function useCoreState() { // fn#119233, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15765:676, owner: MediaPlaybackPanelController.useCoreState, offset: 0x025024d8, size: 445 bytes, params: 1, frame: 26
var environment;
let value = environment.__proto__;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
let useSharedValue = reanimatedRexportModule.useSharedValue;
const PIP = MediaPlaybackPanelModes.PIP;
const value2 = Reflect.apply(useSharedValue, reanimatedRexportModule, [PIP]);
const value3 = reanimatedRexportModule.useSharedValue({'height': 0, 'width': 0});
const value4 = reanimatedRexportModule.useSharedValue({'x': -1, 'y': -1});
const moduleValue4 = reanimatedRexportModule;
useSharedValue = moduleValue4.useSharedValue;
const useReducedMotion = AccessibilityStore.useReducedMotion;
const value5 = Reflect.apply(useSharedValue, moduleValue4, [useReducedMotion]);
env1_4.useEffect(function() {
var closure = _fun119235;
var env0_0 = closure;
AccessibilityStore.addReactChangeListener(closure);
return _fun119236;
}, [value5]);
const value6 = reanimatedRexportModule.useSharedValue(true);
const value7 = reanimatedRexportModule.useSharedValue(0);
const moduleValue7 = reanimatedRexportModule;
const useDerivedValue = moduleValue7.useDerivedValue;
let closure = useCoreStateP;
closure.__closure = {mode: value2, MediaPlaybackPanelModes: MediaPlaybackPanelModes,
MorphablePanelModes: MorphablePanelModes};
closure.__workletHash = 10375114450450;
closure.__initData = env1_12;
const value8 = Reflect.apply(useDerivedValue, moduleValue7, [closure]);
value = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)();
value = (importDefault(15363) /* metro dependency 15363: usePIPAvoidanceSpecs */)(value);
return {mode: value2, morphablePanelMode: value8, wrapperDimensions: value3, useReducedMotion: value5,
pipState: value4, pipAvoidanceSpecs: value, scrollPosition: value7, canShowPIP: value6,
lockScrolling: reanimatedRexportModule.useSharedValue(false),
wrapperOffset: reanimatedRexportModule.useSharedValue({'x': 0, 'y': 0, 'gestureActive': false})};
}
function _fun119238() { // fn#119238, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15765:1846, offset: 0x02502746, size: 82 bytes, params: 1, frame: 13
var r0;
var value;
const binding = env0_11;
const PIP = MediaPlaybackPanelModes.PIP;
const value3 = binding === PIP;
if (value3) {
env0_12(MediaPlaybackPanelModes.DISMISSED);
value = importDefault(13079) /* metro dependency 13079: MediaPlayerManager */;
value.userDidClosePip();
value = true;
r0 = value;
} else {
r0 = value3;
}
return r0;
}
function _fun119241() { // fn#119241, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15765:2043, offset: 0x025027cf, size: 38 bytes, params: 1, frame: 13
const canShowPIPBinding = canShowPIP;
canShowPIPBinding.set(!env0_14 && !env0_15);
}
function _fun119242() { // fn#119242, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15765:2091, offset: 0x025027f5, size: 123 bytes, params: 1, frame: 3
return {mode: mode, setMode: env0_12, morphablePanelMode: morphablePanelMode, wrapperDimensions: wrapperDimensions,
useReducedMotion: useReducedMotion, pipState: pipState, pipAvoidanceSpecs: pipAvoidanceSpecs,
dismissToPipGestureRef: env0_10, dismissPanel: env0_13, scrollPosition: scrollPosition, canShowPIP: canShowPIP,
lockScrolling: lockScrolling, wrapperOffset: wrapperOffset};
}
function _fun119234() { // fn#119234, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15765:877, offset: 0x02502695, size: 40 bytes, params: 1, frame: 12
AccessibilityStore.addReactChangeListener(onChange_119235);
return function() {
AccessibilityStore.removeReactChangeListener(onChange_119235);
};
}
function useCoreStateP() { // fn#119237, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15765:1135, owner: MediaPlaybackPanelController.useCoreState.p, offset: 0x0250270d, size: 57 bytes, params: 1, frame: 10
const value = env0_0.get();
const PIP = MediaPlaybackPanelModes.PIP;
return value === PIP ? MorphablePanelModes.PIP : MorphablePanelModes.UNDEFINED;
}
function onChange_119235() { // fn#119235, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15765:882, offset: 0x025026bd, size: 51 bytes, params: 1, frame: 12
const useReducedMotion = AccessibilityStore.useReducedMotion;
const binding = env1_1;
const get = binding.get;
if (useReducedMotion !== Reflect.apply(get, binding, [])) {
env1_1.set(useReducedMotion);
}
}
@@ -0,0 +1,40 @@
/* Metro module 15569; source: modules/media_panel/native/MediaPlaybackPanelStateContext.tsx; dependencies: [31, 13080, 11796, 8142, 2] */
function _fun119243(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#119243, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15766:6, offset: 0x02502870, size: 489 bytes, params: 8, frame: 25
var object2;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const MediaPlaybackPanelModes = (require(13080) /* metro dependency 13080: MediaPlaybackPanelConstants */).MediaPlaybackPanelModes;
const MorphablePanelModes = (require(11796) /* metro dependency 11796: MorphablePanelConstants */).MorphablePanelModes;
const createContext = value.createContext;
object2 = {};
const reanimatedHelperTypesModule = require(8142) /* metro dependency 8142: ReanimatedHelperTypes */;
let createFakeSharedValue = reanimatedHelperTypesModule.createFakeSharedValue;
let PIP = MediaPlaybackPanelModes.PIP;
object2.mode = Reflect.apply(createFakeSharedValue, reanimatedHelperTypesModule, [PIP]);
object2.setMode = function() {
var Error = global.Error;
throw new Error('MediaPlaybackPanelModes.Provider.setMode: not called within a context provider');
};
const value3 = reanimatedHelperTypesModule;
createFakeSharedValue = value3.createFakeSharedValue;
PIP = MorphablePanelModes.PIP;
object2.morphablePanelMode = Reflect.apply(createFakeSharedValue, value3, [PIP]);
object2.wrapperDimensions = reanimatedHelperTypesModule.createFakeSharedValue({'width': 0, 'height': 0});
object2.useReducedMotion = reanimatedHelperTypesModule.createFakeSharedValue(false);
object2.pipState = reanimatedHelperTypesModule.createFakeSharedValue({'x': -1, 'y': -1});
object2.pipAvoidanceSpecs = reanimatedHelperTypesModule.createFakeSharedValue({'top': 0, 'bottom': 0});
object2.dismissToPipGestureRef = {current: undefined};
object2.dismissPanel = function() {
var Error = global.Error;
throw new Error('VoicePanelContextType.Provider.dismissDrawer: not called within a context provider');
};
object2.scrollPosition = reanimatedHelperTypesModule.createFakeSharedValue(0);
object2.canShowPIP = reanimatedHelperTypesModule.createFakeSharedValue(true);
object2.lockScrolling = reanimatedHelperTypesModule.createFakeSharedValue(false);
object2.wrapperOffset = reanimatedHelperTypesModule.createFakeSharedValue({'x': 0, 'y': 0, 'gestureActive': false});
value = Reflect.apply(createContext, value, [object2]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_panel/native/MediaPlaybackPanelStateContext.tsx');
exports.default = value;
}
@@ -0,0 +1,401 @@
/* Metro module 15570; source: modules/media_panel/native/MediaPlaybackPanelUI.tsx; dependencies: [57, 31, 10724, 13080, 11796, 11795, 33, 4501, 697, 1585, 1478, 15569, 4017, 7739, 11282, 15372, 4504, 4507, 4577, 15374, 6517, 5321, 15571, 2] */
function _fun119246(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#119246, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15767:6, offset: 0x02502a7d, size: 611 bytes, params: 8, frame: 23
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importDefault(31) /* metro dependency 31 */;
const env0_5 = (require(31) /* metro dependency 31 */).useContext;
const safeAreaDisabledStore = importDefault(10724) /* metro dependency 10724: SafeAreaDisabledStore */;
let value = require(13080) /* metro dependency 13080: MediaPlaybackPanelConstants */;
const env0_7 = value.MEDIA_PLAYBACK_PANEL_LAYOUT_PHYSICS;
const env0_8 = value.MediaPlaybackPanelModes;
const env0_9 = (require(11796) /* metro dependency 11796: MorphablePanelConstants */).IS_IOS;
const env0_10 = (require(11795) /* metro dependency 11795: VoicePanelConstants */).BORDER_RADIUS_PHYSICS;
const env0_11 = (require(33) /* metro dependency 33 */).jsx;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object2 = {};
object2.wrapperAnimationPresets = {opacity: 0};
object2.wrapper = {'position': 'absolute', 'top': 0, 'left': 0, 'zIndex': 1};
const object5 = {'position': 'absolute', 'top': 0, 'left': 0, 'right': 0, 'bottom': 0, 'overflow': 'hidden',
'borderWidth': 1};
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xl;
const CHAT_BORDER = (importDefault(697) /* metro dependency 697: native */).colors.CHAT_BORDER;
object5.borderColor = CHAT_BORDER;
object2.mask = object5;
const object6 = {};
const SHADOW_LOW_HOVER = (importDefault(697) /* metro dependency 697: native */).shadows.SHADOW_LOW_HOVER;
copyDataProperties(object6, SHADOW_LOW_HOVER, undefined);
object2.maskElevation = object6;
object2.maskEmptyElevation = {'xOffset': 0, 'yOffset': 0, 'shadowColorIos': '#000000', 'shadowOpacity': 0,
'shadowRadius': 0, 'elevation': 0, 'shadowColorAndroid': '#000000'};
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
object2.content = {flex: 1, backgroundColor: BACKGROUND_SURFACE_HIGH};
const env0_12 = Reflect.apply(createStyles, value, [object2]);
object2 = {code: 'function MediaPlaybackPanelUITsx1(){const{mode,windowDimensions,canShowPIP}=this.__closure;return{mode:mode.get(),windowDimensions:windowDimensions,canShowPIP:canShowPIP.get()};}'};
object2 = {code: 'function MediaPlaybackPanelUITsx2(props,previous){const{cheapWorkletShallowEqual,MediaPlaybackPanelModes,updateSharedValueIfChanged,wrapperDimensions,wrapperOffset}=this.__closure;if(cheapWorkletShallowEqual(props,previous!==null&&previous!==void 0?previous:undefined))return;const{mode:modeToSet,windowDimensions:windowDimensions,canShowPIP:canShowPIP}=props;switch(modeToSet){case MediaPlaybackPanelModes.PIP:{const{width:width,height:height}=canShowPIP?{width:120,height:120}:{width:0,height:0};updateSharedValueIfChanged(wrapperDimensions,{width:width,height:height});break;}case MediaPlaybackPanelModes.DISMISSED:updateSharedValueIfChanged(wrapperOffset,{y:windowDimensions.height});break;default:modeToSet;}}'};
object2 = {code: 'function MediaPlaybackPanelUITsx3(){const{mode,wrapperDimensions,pipAvoidanceSpecs,wrapperOffset,windowDimensions,safeArea,pipState}=this.__closure;return{mode:mode.get(),wrapperDimensions:wrapperDimensions.get(),pipAvoidanceSpecs:pipAvoidanceSpecs.get(),wrapperOffset:wrapperOffset.get(),windowDimensions:windowDimensions,safeArea:safeArea,pipState:pipState.get()};}'};
object2 = {code: 'function MediaPlaybackPanelUITsx4(props,previous){const{cheapWorkletShallowEqual,MediaPlaybackPanelModes,getClampedPIPPosition,safeArea,disableHorizontalSafeAreas,wrapperOpacity,animateWrapperTranslation,wrapperTranslationX,wrapperTranslationY}=this.__closure;if(cheapWorkletShallowEqual(props,previous!==null&&previous!==void 0?previous:undefined))return;const{mode:mode,wrapperDimensions:wrapperDimensions,pipAvoidanceSpecs:pipAvoidanceSpecs,wrapperOffset:wrapperOffset,windowDimensions:windowDimensions,pipState:pipState}=props;let x=0;let y=0;const{gestureActive:gestureActive}=wrapperOffset;const{x:pipX,y:pipY}=pipState;switch(mode){case MediaPlaybackPanelModes.PIP:{const clampedPosition=getClampedPIPPosition({pipX:pipX,pipY:pipY,width:120,height:120,windowDimensions:windowDimensions,safeArea:safeArea,bottomAvoidanceRegion:pipAvoidanceSpecs.bottom,topAvoidanceRegion:pipAvoidanceSpecs.top,positionOffset:gestureActive?wrapperOffset:undefined,disableHorizontalSafeAreas:disableHorizontalSafeAreas});x=clampedPosition.x;y=clampedPosition.y;wrapperOpacity.set(1);break;}case MediaPlaybackPanelModes.DISMISSED:{y=wrapperDimensions.height;wrapperOpacity.set(0);break;}}const previousPIPState=previous===null||previous===void 0?void 0:previous.pipState;const pipPositionChanged=pipX!==(previousPIPState===null||previousPIPState===void 0?void 0:previousPIPState.x)||pipY!==(previousPIPState===null||previousPIPState===void 0?void 0:previousPIPState.y);const shouldAnimateForPIP=mode===MediaPlaybackPanelModes.PIP&&pipPositionChanged&&!wrapperOffset.gestureActive;animateWrapperTranslation.set(shouldAnimateForPIP||mode!==MediaPlaybackPanelModes.PIP);wrapperTranslationX.set(x);wrapperTranslationY.set(y);}'};
object2 = {code: "function MediaPlaybackPanelUITsx5(){const{withTiming,wrapperOpacity,timingFast,animateWrapperTranslation,withSpring,wrapperTranslationX,MEDIA_PLAYBACK_PANEL_LAYOUT_PHYSICS,wrapperTranslationY,wrapperDimensions,wrapperElevationStyles}=this.__closure;const opacity=withTiming(wrapperOpacity.get(),timingFast,'respect-motion-settings');return{transform:[{translateX:animateWrapperTranslation.get()?withSpring(wrapperTranslationX.get(),MEDIA_PLAYBACK_PANEL_LAYOUT_PHYSICS,'animate-always'):wrapperTranslationX.get()},{translateY:animateWrapperTranslation.get()?withSpring(wrapperTranslationY.get(),MEDIA_PLAYBACK_PANEL_LAYOUT_PHYSICS,animateWrapperTranslation.get()?'respect-motion-settings':'animate-never'):wrapperTranslationY.get()}],opacity:opacity,width:wrapperDimensions.get().width,height:wrapperDimensions.get().height,...wrapperElevationStyles};}"};
object2 = {code: "function MediaPlaybackPanelUITsx6(){const{withSpring,borderRadius,BORDER_RADIUS_PHYSICS,maskElevationStyles}=this.__closure;return{borderRadius:withSpring(borderRadius,BORDER_RADIUS_PHYSICS,'animate-always'),...maskElevationStyles};}"};
object2 = {code: "function MediaPlaybackPanelUITsx7(){const{windowDimensions}=this.__closure;const{height:height,width:width}=windowDimensions;return{position:'absolute',top:0,left:0,width:width,height:height,overflow:'hidden'};}"};
object2 = {code: "function MediaPlaybackPanelUITsx8(){const{styles}=this.__closure;const topBorderRadius=0;const top=0;return{flexDirection:'column',backgroundColor:styles.content.backgroundColor,borderTopStartRadius:topBorderRadius,borderTopEndRadius:topBorderRadius,top:top,overflow:'hidden'};}"};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_panel/native/MediaPlaybackPanelUI.tsx');
exports.default = MediaPlaybackPanelUI;
}
function MediaPlaybackPanelUI() { // fn#119247, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15767:5558, offset: 0x02502ce0, size: 594 bytes, params: 1, frame: 28
const styles = useStyles();
const value2 = (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)();
var {wrapperDimensions,
wrapperOffset} = useContext(importDefault(15569) /* metro dependency 15569: MediaPlaybackPanelStateContext */);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
let useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
let closure = MediaPlaybackPanelUIP;
closure.__closure = {windowDimensions: value2};
closure.__workletHash = 5768037716653;
closure.__initData = env0_19;
const value4 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const value6 = env0_3(MediaPlaybackPanelUIUseWrapperStyles(wrapperDimensions, wrapperOffset), 2);
const property = value6[0];
const property2 = value6[1];
const moduleValue2 = reanimatedRexportModule;
useAnimatedStyle = moduleValue2.useAnimatedStyle;
closure = function() {
return {'flexDirection': 'column', 'backgroundColor': null, 'borderTopStartRadius': 0, 'borderTopEndRadius': 0,
'top': 0, 'overflow': 'hidden', backgroundColor: styles.content.backgroundColor};
};
closure.__closure = {styles: styles};
closure.__workletHash = 8557652955267;
closure.__initData = env0_20;
const value7 = Reflect.apply(useAnimatedStyle, moduleValue2, [closure]);
var {wrapperOffset,
pipState} = env0_4.useContext(importDefault(15569) /* metro dependency 15569: MediaPlaybackPanelStateContext */);
const defaultImport = importDefault(15374) /* metro dependency 15374: useMorphablePanelGesture */;
const MorphablePanelModes = (require(15374) /* metro dependency 15374: useMorphablePanelGesture */).MorphablePanelModes;
const PIP = MorphablePanelModes.PIP;
const value9 = defaultImport({panGestureEnabled: true, mode: PIP, pipState: pipState, wrapperOffset: wrapperOffset});
const LayerScope = (require(6517) /* metro dependency 6517: LayerScopeNative */).LayerScope;
const View = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const View3 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const GestureDetector = (require(5321) /* metro dependency 5321 */).GestureDetector;
const View4 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
return (
<LayerScope>
<View style={value4} pointerEvents="box-none">
<View2 style={property}>
<View3 style={property2}>
<GestureDetector gesture={value9}>
<View4 style={[styles.content, value7]}>
{((Component) => <Component />)(importDefault(15571) /* metro dependency 15571: MediaPlaybackPip */)}
</View4>
</GestureDetector>
</View3>
</View2>
</View>
</LayerScope>
);
}
function MediaPlaybackPanelUIP() { // fn#119248, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15767:5703, owner: MediaPlaybackPanelUI.p, offset: 0x02502f32, size: 45 bytes, params: 1, frame: 3
const binding = env0_1;
return {'position': 'absolute', 'top': 0, 'left': 0, 'width': null, 'height': null, 'overflow': 'hidden',
width: binding.width, height: binding.height};
}
function MediaPlaybackPanelUIUseWrapperStyles(a0, a1) { // fn#119249, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15767:5895, owner: MediaPlaybackPanelUI.useWrapperStyles, offset: 0x02502f5f, size: 1170 bytes, params: 3, frame: 35
var environment;
const env0_0 = a0;
const env0_1 = a1;
const value = environment.__proto__;
const styles = useStyles();
const value2 = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)();
const value3 = (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)();
let binding = env1_4;
const {mode, pipState, pipAvoidanceSpecs,
canShowPIP} = binding.useContext(importDefault(15569) /* metro dependency 15569: MediaPlaybackPanelStateContext */);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
let useAnimatedReaction = reanimatedRexportModule.useAnimatedReaction;
let closure = useWrapperStylesU;
closure.__closure = {mode: mode, windowDimensions: value3, canShowPIP: canShowPIP};
closure.__workletHash = 4412661953046;
closure.__initData = env1_13;
const closure2 = useWrapperStylesP;
object = {};
const cheapWorkletShallowEqual = (require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */).cheapWorkletShallowEqual;
object.cheapWorkletShallowEqual = cheapWorkletShallowEqual;
object.MediaPlaybackPanelModes = MediaPlaybackPanelModes;
object.updateSharedValueIfChanged = importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */;
object.wrapperDimensions = a0;
object.wrapperOffset = a1;
closure2.__closure = object;
closure2.__workletHash = 5458787116551;
closure2.__initData = env1_14;
Reflect.apply(useAnimatedReaction, reanimatedRexportModule, [closure, closure2]);
const value5 = reanimatedRexportModule.useSharedValue(0);
const value6 = reanimatedRexportModule.useSharedValue(0);
const value7 = reanimatedRexportModule.useSharedValue(0);
const value8 = reanimatedRexportModule.useSharedValue(false);
const value9 = SafeAreaDisabledStore(function(a0) {
return a0.shouldDisableSafeAreas();
});
const moduleValue6 = reanimatedRexportModule;
useAnimatedReaction = moduleValue6.useAnimatedReaction;
closure = useWrapperStylesR;
closure.__closure = {mode: mode, wrapperDimensions: a0, pipAvoidanceSpecs: pipAvoidanceSpecs, wrapperOffset: a1,
windowDimensions: value3, safeArea: value2, pipState: pipState};
closure.__workletHash = 4950432193502;
closure.__initData = env1_15;
const closure3 = useWrapperStylesC_119254;
object = {};
object.cheapWorkletShallowEqual = cheapWorkletShallowEqual;
object.MediaPlaybackPanelModes = MediaPlaybackPanelModes;
const getClampedPIPPosition = (require(15372) /* metro dependency 15372: MorphablePanelUtils */).getClampedPIPPosition;
object.getClampedPIPPosition = getClampedPIPPosition;
object.safeArea = value2;
object.disableHorizontalSafeAreas = value9;
object.wrapperOpacity = value7;
object.animateWrapperTranslation = value8;
object.wrapperTranslationX = value5;
object.wrapperTranslationY = value6;
closure3.__closure = object;
closure3.__workletHash = 10793489581273;
closure3.__initData = env1_16;
Reflect.apply(useAnimatedReaction, moduleValue6, [closure, closure3]);
const value10 = mode.get();
let PIP = MediaPlaybackPanelModes.PIP;
const r9 = value10 !== PIP ? styles.maskEmptyElevation : IS_IOS ? styles.maskElevation : styles.maskEmptyElevation;
const value11 = mode.get();
PIP = MediaPlaybackPanelModes.PIP;
const r8 = value11 !== PIP || IS_IOS ? styles.maskEmptyElevation : styles.maskElevation;
const moduleValue7 = reanimatedRexportModule;
let useAnimatedStyle = moduleValue7.useAnimatedStyle;
closure = useWrapperStylesL_119255;
object = {};
object.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
object.wrapperOpacity = value7;
object.timingFast = (require(4507) /* metro dependency 4507: timingPresets */).timingFast;
object.animateWrapperTranslation = value8;
const withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object.withSpring = withSpring;
object.wrapperTranslationX = value5;
object.MEDIA_PLAYBACK_PANEL_LAYOUT_PHYSICS = MEDIA_PLAYBACK_PANEL_LAYOUT_PHYSICS;
object.wrapperTranslationY = value6;
object.wrapperDimensions = a0;
object.wrapperElevationStyles = r9;
closure.__closure = object;
closure.__workletHash = 11049335639852;
closure.__initData = env1_17;
const value12 = Reflect.apply(useAnimatedStyle, moduleValue7, [closure]);
const xl = (importDefault(697) /* metro dependency 697: native */).radii.xl;
const moduleValue8 = reanimatedRexportModule;
useAnimatedStyle = moduleValue8.useAnimatedStyle;
closure = useWrapperStylesB;
closure.__closure = {withSpring: withSpring, borderRadius: xl, BORDER_RADIUS_PHYSICS: BORDER_RADIUS_PHYSICS,
maskElevationStyles: r8};
closure.__workletHash = 7035830192327;
closure.__initData = env1_18;
const value13 = Reflect.apply(useAnimatedStyle, moduleValue8, [closure]);
binding = env1_4;
let useMemo = binding.useMemo;
object = [value12];
object[1] = styles.wrapper;
object[2] = styles.wrapperAnimationPresets;
object = [Reflect.apply(useMemo, binding, [_fun119257, object])];
useMemo = binding.useMemo;
object[1] = Reflect.apply(useMemo, binding, [_fun119258, [value13, styles.mask]]);
return object;
}
function useWrapperStylesU() { // fn#119250, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15767:6082, owner: MediaPlaybackPanelUI.useWrapperStyles.u, offset: 0x025033f1, size: 51 bytes, params: 1, frame: 11
const object2 = {};
object2.mode = mode.get();
object2.windowDimensions = env0_4;
object2.canShowPIP = canShowPIP.get();
return object2;
}
function useWrapperStylesP(a0, a1) { // fn#119251, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15767:6244, owner: MediaPlaybackPanelUI.useWrapperStyles.p, offset: 0x02503424, size: 241 bytes, params: 3, frame: 17
var r2;
var mode;
const value = a1;
const value3 = undefined;
const cheapWorkletShallowEqualModule = require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */;
if (!cheapWorkletShallowEqualModule.cheapWorkletShallowEqual(a0, value ?? value3)) {
mode = a0.mode;
if (MediaPlaybackPanelModes.PIP === mode) {
r2 = a0.canShowPIP ? {'width': 120, 'height': 120} : {'width': 0, 'height': 0};
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(env0_0,
{width: r2.width,
height: r2.height});
} else if (MediaPlaybackPanelModes.DISMISSED === mode) {
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(require,
{y: a0.windowDimensions.height});
}
}
return value3;
}
function useWrapperStylesR() { // fn#119253, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15767:6955, owner: MediaPlaybackPanelUI.useWrapperStyles.R, offset: 0x02503515, size: 114 bytes, params: 1, frame: 11
const object2 = {};
object2.mode = mode.get();
object2.wrapperDimensions = env0_0.get();
object2.pipAvoidanceSpecs = pipAvoidanceSpecs.get();
object2.wrapperOffset = require.get();
object2.windowDimensions = env0_4;
object2.safeArea = env0_3;
object2.pipState = pipState.get();
return object2;
}
function useWrapperStylesC_119254(a0, a1) { // fn#119254, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15767:7265, owner: MediaPlaybackPanelUI.useWrapperStyles.C, offset: 0x02503587, size: 470 bytes, params: 3, frame: 27
var r3;
var x;
var pipState;
var y;
var r2;
var r6;
var mode;
var wrapperDimensions;
var pipAvoidanceSpecs;
var wrapperOffset;
var windowDimensions;
var gestureActive;
var x3;
var y2;
var PIP;
var DISMISSED;
var value4;
var height;
var binding;
var set;
var clampedPIPPosition;
let value = a1;
const value3 = undefined;
const cheapWorkletShallowEqualModule = require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */;
if (!cheapWorkletShallowEqualModule.cheapWorkletShallowEqual(a0, value ?? value3)) {
mode = a0.mode;
wrapperDimensions = a0.wrapperDimensions;
pipAvoidanceSpecs = a0.pipAvoidanceSpecs;
wrapperOffset = a0.wrapperOffset;
windowDimensions = a0.windowDimensions;
pipState = a0.pipState;
gestureActive = wrapperOffset.gestureActive;
x3 = pipState.x;
y2 = pipState.y;
PIP = MediaPlaybackPanelModes.PIP;
if (PIP === mode) {
clampedPIPPosition = (require(15372) /* metro dependency 15372: MorphablePanelUtils */).getClampedPIPPosition({pipX: x3,
pipY: y2, width: 120, height: 120, windowDimensions: windowDimensions, safeArea: env0_3,
bottomAvoidanceRegion: pipAvoidanceSpecs.bottom, topAvoidanceRegion: pipAvoidanceSpecs.top,
positionOffset: gestureActive ? wrapperOffset : value3, disableHorizontalSafeAreas: env0_13});
x = clampedPIPPosition.x;
y = clampedPIPPosition.y;
env0_11.set(1);
r3 = y;
} else {
DISMISSED = MediaPlaybackPanelModes.DISMISSED;
value4 = 0;
if (DISMISSED !== mode) {
r3 = value4;
x = value4;
} else {
height = wrapperDimensions.height;
env0_11.set(value4);
r3 = height;
x = value4;
}
}
pipState = value == null ? value3 : value.pipState;
value = x3 !== (pipState == null ? value3 : pipState.x);
r2 = value || y2 !== (pipState == null ? value3 : pipState.y);
PIP = MediaPlaybackPanelModes.PIP;
value = mode === PIP;
r6 = value && r2;
r6 = r6 && !wrapperOffset.gestureActive;
binding = env0_12;
set = binding.set;
r6 = !r6 ? mode !== MediaPlaybackPanelModes.PIP : r6;
Reflect.apply(set, binding, [r6]);
binding = env0_9;
binding.set(x);
binding = env0_10;
binding.set(r3);
}
return value3;
}
function useWrapperStylesL_119255() { // fn#119255, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15767:8430, owner: MediaPlaybackPanelUI.useWrapperStyles.L, offset: 0x0250375d, size: 357 bytes, params: 1, frame: 23
var r3;
var r5;
var moduleValue2;
var withSpring;
var moduleValue3;
var value9;
let value = environment.__proto__.__proto__;
const timingModule = require(4504) /* metro dependency 4504: timing */;
const withTiming = timingModule.withTiming;
let binding = env0_11;
let get = binding.get;
const value3 = Reflect.apply(get, binding, []);
const timingFast = (require(4507) /* metro dependency 4507: timingPresets */).timingFast;
const value4 = 'respect-motion-settings';
const value5 = Reflect.apply(withTiming, timingModule, [value3, timingFast, value4]);
const object2 = {};
binding = env0_12;
get = binding.get;
if (Reflect.apply(get, binding, [])) {
moduleValue2 = require(4577) /* metro dependency 4577: spring */;
r3 = moduleValue2.withSpring(env0_9.get(), MEDIA_PLAYBACK_PANEL_LAYOUT_PHYSICS, 'animate-always');
} else {
r3 = env0_9.get();
}
const items2 = [{translateX: r3}];
get = env0_12.get;
if (Reflect.apply(get, binding, [])) {
moduleValue3 = require(4577) /* metro dependency 4577: spring */;
withSpring = moduleValue3.withSpring;
binding = env0_10;
value9 = binding.get();
binding = env0_12;
value = binding.get();
value = Reflect.apply(withSpring, moduleValue3, [value9, MEDIA_PLAYBACK_PANEL_LAYOUT_PHYSICS,
value ? value4 : 'animate-never']);
r5 = value;
} else {
r5 = env0_10.get();
}
items2[1] = {translateY: r5};
object2.transform = items2;
object2.opacity = value5;
binding = env0_0;
get = binding.get;
object2.width = Reflect.apply(get, binding, []).width;
get = binding.get;
object2.height = Reflect.apply(get, binding, []).height;
copyDataProperties(object2, env0_14, undefined);
return object2;
}
function useWrapperStylesB() { // fn#119256, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15767:9165, owner: MediaPlaybackPanelUI.useWrapperStyles.B, offset: 0x025038c2, size: 73 bytes, params: 1, frame: 17
const object2 = {};
const springModule = require(4577) /* metro dependency 4577: spring */;
object2.borderRadius = springModule.withSpring(xl, BORDER_RADIUS_PHYSICS, 'animate-always');
copyDataProperties(object2, env0_15, undefined);
return object2;
}
function _fun119257() { // fn#119257, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15767:9417, offset: 0x0250390b, size: 41 bytes, params: 1, frame: 3
const stylesBinding = styles;
return [env0_16, stylesBinding.wrapper, stylesBinding.wrapperAnimationPresets];
}
function _fun119258() { // fn#119258, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15767:9514, offset: 0x02503934, size: 31 bytes, params: 1, frame: 3
return [env0_18, styles.mask];
}
@@ -0,0 +1,504 @@
/* Metro module 15571; source: modules/media_panel/native/MediaPlaybackPip.tsx; dependencies: [57, 31, 27, 1379, 4814, 3793, 1878, 661, 15440, 33, 4501, 697, 3860, 566, 4805, 8430, 4573, 15572, 4589, 7067, 6837, 4017, 4504, 1244, 8554, 5284, 4066, 683, 13079, 3771, 15569, 9554, 9376, 15573, 2] */
function _fun119260(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#119260, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:6, offset: 0x0250397a, size: 832 bytes, params: 8, frame: 26
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
const env0_5 = value.Easing;
const StyleSheet = value.StyleSheet;
const env0_6 = value.TouchableOpacity;
const env0_7 = value.View;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */;
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
value = require(661) /* metro dependency 661: Constants */;
const env0_12 = value.AnalyticEvents;
const env0_13 = value.MessageFlags;
const env0_14 = value.Routes;
const SquarePIPReferenceDimensions = (require(15440) /* metro dependency 15440: VoicePanelPIPConstants */).SquarePIPReferenceDimensions;
value = require(33) /* metro dependency 33 */;
const env0_15 = value.jsx;
const env0_16 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object2 = {};
object2.container = {'justifyContent': 'center', 'alignItems': 'center',
height: SquarePIPReferenceDimensions.height, width: SquarePIPReferenceDimensions.width};
const object5 = {};
copyDataProperties(object5, StyleSheet.absoluteFillObject, undefined);
object5['zIndex'] = 5;
object2.pipControls = object5;
const object6 = {'position': 'absolute', 'top': 8, 'padding': 8, 'borderRadius': null, 'borderWidth': 1};
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
const CONTROL_SECONDARY_BORDER_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_SECONDARY_BORDER_DEFAULT;
object6.borderColor = CONTROL_SECONDARY_BORDER_DEFAULT;
const CONTROL_SECONDARY_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_SECONDARY_TEXT_DEFAULT;
object6.tintColor = CONTROL_SECONDARY_TEXT_DEFAULT;
const CONTROL_SECONDARY_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_SECONDARY_BACKGROUND_DEFAULT;
object6.backgroundColor = CONTROL_SECONDARY_BACKGROUND_DEFAULT;
const SHADOW_LOW_HOVER = (importDefault(697) /* metro dependency 697: native */).shadows.SHADOW_LOW_HOVER;
copyDataProperties(object6, SHADOW_LOW_HOVER, undefined);
object2.pipButton = object6;
object2.dismissButton = {right: 8};
object2.backButton = {left: 8};
object2.infoContainer = {'justifyContent': 'center', 'alignItems': 'center', 'marginBottom': 8, 'height': 34};
const object10 = {};
copyDataProperties(object10, StyleSheet.absoluteFillObject, undefined);
object2.infoContainerGradient = object10;
object2.infoContent = {'justifyContent': 'center', 'alignItems': 'center', 'alignSelf': 'stretch',
'marginHorizontal': 4};
object2.actionContainer = {'justifyContent': 'center', 'alignItems': 'center', 'width': 48, 'height': 48,
'zIndex': 100};
const object11 = {'justifyContent': 'center', 'alignItems': 'center', 'width': 32, 'height': 32, 'zIndex': 100};
object11.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
const BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BRAND;
object11.backgroundColor = BACKGROUND_BRAND;
object2.playPauseButton = object11;
const object12 = {};
copyDataProperties(object12, StyleSheet.absoluteFillObject, undefined);
object12['justifyContent'] = 'center';
object12['alignItems'] = 'center';
object2.progressBar = object12;
const env0_17 = Reflect.apply(createStyles, value, [object2]);
const convertMsToSecs = function(a0) {
return a0 != null ? a0 / 1000 : undefined;
};
object2 = {code: 'function MediaPlaybackPipTsx1(){const{withTiming,visible}=this.__closure;return{opacity:withTiming(visible?1:0,{duration:200})};}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_panel/native/MediaPlaybackPip.tsx');
exports.default = _default_119270;
}
function MediaInfo({message, activeMediaPlayerSource, isVoiceMessage, isControlVisible}) { // fn#119262, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:1500, offset: 0x02503cd4, size: 866 bytes, params: 2, frame: 34
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const styles = useStyles();
const useTokenModule = require(3860) /* metro dependency 3860: useToken */;
const useToken = useTokenModule.useToken;
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
const value3 = Reflect.apply(useToken, useTokenModule, [BACKGROUND_SURFACE_HIGH]);
const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore, UserStore,
RelationshipStore], _fun119263, [message]);
const binding = env0_4;
let useState = binding.useState;
const value5 = Reflect.apply(useState, binding, [0]);
const binding2 = env0_3;
const value6 = binding2(value5, 2);
const property = value6[0];
const env0_2 = value6[1];
useState = binding.useState;
const value7 = binding2(Reflect.apply(useState, binding, [0]), 2);
const property2 = value7[0];
var env0_4 = value7[1];
const value8 = binding.useMemo(_fun119264, [property2, property]);
const contentMessage = message?.getContentMessage();
if (message == null) {
return null;
}
if (contentMessage == null) {
return null;
}
if (activeMediaPlayerSource == null) {
return null;
}
const text = <Text variant="text-md/semibold" lineClamp={1} ellipsizeMode="clip" onLayout={onLayout_119265}>{isVoiceMessage ? message.author.username : contentMessage.attachments.length > 0 && activeMediaPlayerSource.attachmentIndex != null ? (importDefault(8430) /* metro dependency 8430: getDisplayFilename */)(contentMessage.attachments[activeMediaPlayerSource.attachmentIndex]) : ''}</Text>;
const viewBindingProps = {accessibilityElementsHidden: isControlVisible, style: styles.infoContent,
onLayout: onLayout_119266};
const items4 = [value8 ? <View style={{flex: 1}}>{((Marquee) => <Marquee spacing={20} speed={0.2}>{text}</Marquee>)((require(15572) /* metro dependency 15572 */).Marquee)}{((Component) => <Component start={{'x': 0,
'y': 0}} end={{'x': 1, 'y': 0}} locations={[0, 0.1, 0.2, 0.8, 0.9, 1]} colors={[value3, value3 + 'CC',
value3 + '00', value3 + '00', value3 + 'CC',
value3]} style={styles.infoContainerGradient} />)(importDefault(4589) /* metro dependency 4589 */)}</View> : text];
items4[1] = value4 != null && <Text variant="text-xs/medium" color="text-subtle" lineClamp={1}>{value4}</Text>;
return (
<View {...viewBindingProps}>
<View style={styles.infoContainer}>
{items4}
</View>
</View>
);
}
function PiPControls({message, handleClosePip, visible, isVoiceMessage}) { // fn#119267, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:2917, offset: 0x025040f8, size: 647 bytes, params: 2, frame: 29
const styles = useStyles();
const value2 = env0_4.useCallback(_fun119268, [message]);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = PiPControlsU;
closure.__closure = {withTiming: (require(4504) /* metro dependency 4504: timing */).withTiming, visible: visible};
closure.__workletHash = 3641278982291;
closure.__initData = env0_20;
const value3 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const r10 = isVoiceMessage ? Reflect.apply(string, intl, [t.KTonHP]) : Reflect.apply(string, intl, [t['13/7kX']]);
string = intl.string;
const r8 = isVoiceMessage ? Reflect.apply(string, intl, [t['6rhrVG']]) : Reflect.apply(string, intl, [t.WAI6xu]);
const View = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const items5 = [styles.pipControls, value3];
const BackgroundBlurFill = (require(8554) /* metro dependency 8554: native */).BackgroundBlurFill;
const items2 = [<BackgroundBlurFill blurAmount={0.05} />];
const value = !visible;
const items3 = [styles.pipButton];
items3[1] = styles.backButton;
const ArrowLargeLeftIcon = (require(5284) /* metro dependency 5284: ArrowLargeLeftIcon */).ArrowLargeLeftIcon;
items2[1] = <TouchableOpacity disabled={value} style={items3} onPress={value2} accessible accessibilityRole="button" accessibilityLabel={r10}><ArrowLargeLeftIcon size="sm" /></TouchableOpacity>;
const items4 = [styles.pipButton];
items4[1] = styles.dismissButton;
const XLargeIcon = (require(4066) /* metro dependency 4066: XLargeIcon */).XLargeIcon;
items2[2] = <TouchableOpacity disabled={value} style={items4} onPress={handleClosePip} accessible accessibilityRole="button" accessibilityLabel={r8}><XLargeIcon size="sm" /></TouchableOpacity>;
return (
<View style={items5}>
{items2}
</View>
);
}
function _default_119270() { // fn#119270, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:4109, offset: 0x025044a0, size: 1201 bytes, params: 1, frame: 35
var object2;
var r9;
var r13;
var contentMessage;
var value8;
const value2 = undefined;
const styles = useStyles();
let binding = env0_4;
const value3 = binding.useRef(null);
const mediaPlayerManagerModule = require(13079) /* metro dependency 13079: MediaPlayerManager */;
const useMediaPlayerManagerStore = mediaPlayerManagerModule.useMediaPlayerManagerStore;
const moduleValue2 = require(3771) /* metro dependency 3771 */;
const useShallow = moduleValue2.useShallow;
const {isPlaying, progress, activeMediaPlayerSource, mediaSourceMessage,
closePip} = Reflect.apply(useMediaPlayerManagerStore, mediaPlayerManagerModule, [Reflect.apply(useShallow,
moduleValue2, [function(a0) {
return {isPlaying: a0.isPlaying, progress: a0.progress, activeMediaPlayerSource: a0.activeMediaPlayerSource,
mediaSourceMessage: a0.mediaSourceMessage, closePip: a0.closePip};
}])]);
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStores = fluxModule.useStateFromStores;
let r21 = Reflect.apply(useStateFromStores, fluxModule, [[MessageStore], _fun119272,
[activeMediaPlayerSource]]) ?? mediaSourceMessage;
const env0_3 = r21;
const value6 = r21 == null;
if (value6) {
r9 = value2;
r13 = value6;
} else {
contentMessage = r21.getContentMessage();
value8 = contentMessage == null;
r9 = contentMessage;
r13 = value8;
}
r13 = !r13 ? !r9.hasFlag(MessageFlags.IS_VOICE_MESSAGE) : r13;
const value10 = !r13;
useAnalyticsEffects(activeMediaPlayerSource, progress, r21);
binding = env0_4;
const value12 = env0_3(binding.useState(false), 2);
const value13 = 0;
const property = value12[value13];
binding.useEffect(_fun119277, [property, value12[1], isPlaying]);
const useContext = binding.useContext;
const value14 = binding.useCallback(_fun119280, [Reflect.apply(useContext, binding,
[importDefault(15569) /* metro dependency 15569: MediaPlaybackPanelStateContext */]).dismissPanel, closePip]);
usePlaybackCompletionEffects(progress, value14);
const r19 = property || (progress == null ? value2 : progress.isCompleted) === true;
binding = env0_4;
const value16 = binding.useCallback(_fun119285, [isPlaying]);
const value17 = binding.useMemo(_fun119286, [isPlaying]);
const value18 = binding.useMemo(_fun119287, [r21, activeMediaPlayerSource, value10, r19]);
const value19 = binding.useMemo(_fun119288, [r21, value14, r19, value10]);
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
let r12 = r13 ? Reflect.apply(string, intl, [t.RscU7I]) : Reflect.apply(string, intl, [t.AlHqHT]);
string = intl.string;
r13 = r13 ? Reflect.apply(string, intl, [t.ZcgDJX]) : Reflect.apply(string, intl, [t['3XohGn']]);
const r20 = progress == null ? value13 : progress.time / progress.duration * 100;
r21 = progress == null ? value13 : progress.duration - progress.time;
object2 = {style: styles.container, activeOpacity: 1, onPress: onPress_119289, accessible: false};
const AnimatedCircularProgress = (require(15573) /* metro dependency 15573 */).AnimatedCircularProgress;
const animatedCircularProgressProps2 = {'style': null, 'size': 48, 'width': 2, style: styles.progressBar,
prefill: r20, easing: Easing.out(Easing.linear), duration: isPlaying ? r21 : value13,
fill: isPlaying ? 100 : r20, rotation: value13, lineCap: 'round', ref: value3};
const useTokenModule = require(3860) /* metro dependency 3860: useToken */;
let useToken = useTokenModule.useToken;
const CONTROL_PRIMARY_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_PRIMARY_BACKGROUND_DEFAULT;
animatedCircularProgressProps2.tintColor = Reflect.apply(useToken, useTokenModule,
[CONTROL_PRIMARY_BACKGROUND_DEFAULT]);
const moduleValue5 = useTokenModule;
useToken = moduleValue5.useToken;
const BACKGROUND_MOD_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_MUTED;
animatedCircularProgressProps2.backgroundColor = Reflect.apply(useToken, moduleValue5, [BACKGROUND_MOD_MUTED]);
const animatedCircularProgress = <AnimatedCircularProgress {...animatedCircularProgressProps2} />;
r12 = isPlaying ? r13 : r12;
return (
<TouchableOpacity {...object2}>
{value19}
{value18}
<View style={styles.actionContainer}>
{animatedCircularProgress}
<TouchableOpacity
style={styles.playPauseButton}
onPress={value16}
accessibilityRole="button"
accessibilityLabel={r12}
>
{value17}
</TouchableOpacity>
</View>
</TouchableOpacity>
);
}
function _fun119263() { // fn#119263, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:1688, offset: 0x02504036, size: 105 bytes, params: 1, frame: 20
const value = environment.__proto__;
const getChannel = ChannelStore.getChannel;
const messageBinding = message;
const value3 = null;
const value5 = Reflect.apply(getChannel, ChannelStore, [value3 == messageBinding ? undefined : message.channel_id]);
return value3 != value5 ? (require(4805) /* metro dependency 4805: useChannelName */).computeChannelName(value5,
UserStore, RelationshipStore, true, true) : value3;
}
function _fun119264() { // fn#119264, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:1900, offset: 0x0250409f, size: 17 bytes, params: 1, frame: 2
return env0_3 >= env0_1;
}
function MediaInfoOnLayout({nativeEvent}) { // fn#119265, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:2233, owner: MediaInfo.onLayout, offset: 0x025040b0, size: 36 bytes, params: 2, frame: 11
return env0_4(nativeEvent.layout.width);
}
function MediaInfoOnLayout_119266({nativeEvent}) { // fn#119266, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:2350, owner: MediaInfo.onLayout, offset: 0x025040d4, size: 36 bytes, params: 2, frame: 11
return env0_2(nativeEvent.layout.width);
}
function _fun119268() { // fn#119268, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:3006, offset: 0x0250437f, size: 221 bytes, params: 1, frame: 22
var r6;
var channel_id;
var id;
var value2;
var value3;
var defaultImport;
var trackJump;
var getChannel;
var value4;
var defaultImport2;
var CHANNEL;
let messageBinding = message;
if (messageBinding != null) {
channel_id = message.channel_id;
if (channel_id != null) {
id = message.id;
if (id != null) {
value2 = environment.__proto__;
value3 = undefined;
defaultImport = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
trackJump = defaultImport.trackJump;
messageBinding = message;
channel_id = messageBinding.channel_id;
id = messageBinding.id;
Reflect.apply(trackJump, defaultImport, [channel_id, id, 'Media PIP', {}]);
getChannel = ChannelStore.getChannel;
channel_id = messageBinding.channel_id;
value4 = Reflect.apply(getChannel, ChannelStore, [channel_id]);
r6 = value4 == null ? value3 : value4.getGuildId();
defaultImport2 = importDefault(6837) /* metro dependency 6837: safeTransitionToNative */;
CHANNEL = Routes.CHANNEL;
messageBinding = message;
channel_id = messageBinding.channel_id;
id = messageBinding.id;
defaultImport2(Reflect.apply(CHANNEL, Routes, [r6, channel_id, id]), {'navigationReplace': true,
'openChannel': true});
}
}
}
}
function PiPControlsU() { // fn#119269, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:3292, owner: PiPControls.u, offset: 0x0250445c, size: 68 bytes, params: 1, frame: 15
let value = environment.__proto__;
value = require(4504) /* metro dependency 4504: timing */;
return {opacity: value.withTiming(visible ? 1 : 0, {duration: 200})};
}
function _fun119272() { // fn#119272, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:4490, offset: 0x0250498f, size: 88 bytes, params: 1, frame: 14
var r0;
var value;
const activeMediaPlayerSourceBinding = activeMediaPlayerSource;
const value2 = null;
const value3 = undefined;
const channelId = value2 == activeMediaPlayerSourceBinding ? value3 : activeMediaPlayerSource.channelId;
const messageId = value2 == activeMediaPlayerSource ? value3 : activeMediaPlayerSource.messageId;
if (value2 == channelId) {
r0 = value2;
} else if (value2 == messageId) {
r0 = value2;
} else {
value = environment.__proto__;
value = MessageStore.getMessage(channelId, messageId);
r0 = value;
}
return r0;
}
function useAnalyticsEffects(a0, a1, a2) { // fn#119273, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:4704, owner: _default_119270.useAnalyticsEffects, offset: 0x025049e7, size: 106 bytes, params: 4, frame: 16
let env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const binding = env1_4;
const env0_3 = binding.useRef(null);
binding.useEffect(_fun119274, [a1, a0, a2]);
binding.useEffect(function() {
var Date = global.Date;
var env0_0 = new Date();
return _fun119276;
}, []);
}
function _fun119277() { // fn#119277, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:5846, offset: 0x02504cc7, size: 54 bytes, params: 1, frame: 14
if (env0_5) {
var env0_0 = global.setTimeout(_fun119278, 3000);
}
return _fun119279;
}
function _fun119280() { // fn#119280, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:5994, offset: 0x02504d18, size: 56 bytes, params: 1, frame: 12
dismissPanel();
closePip();
const value = environment.__proto__;
(importDefault(13079) /* metro dependency 13079: MediaPlayerManager */).pauseCurrentPlayer();
}
function usePlaybackCompletionEffects(a0, a1) { // fn#119281, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:6047, owner: _default_119270.usePlaybackCompletionEffects, offset: 0x02504d50, size: 74 bytes, params: 3, frame: 17
var environment;
const env0_0 = a0;
const env0_1 = a1;
let value = environment.__proto__;
const binding = env1_4;
value = undefined;
binding.useEffect(_fun119282, [a0 == null ? value : a0.isCompleted, a1]);
return value;
}
function _fun119285() { // fn#119285, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:6303, offset: 0x02504de3, size: 70 bytes, params: 1, frame: 13
const isPlayingBinding = isPlaying;
const defaultImport = importDefault(13079) /* metro dependency 13079: MediaPlayerManager */;
if (isPlayingBinding) {
defaultImport.pauseCurrentPlayer();
env0_6(true);
} else {
defaultImport.playCurrentPlayer();
}
}
function _fun119286() { // fn#119286, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:6397, offset: 0x02504e29, size: 122 bytes, params: 1, frame: 15
const r2 = isPlaying ? (require(9554) /* metro dependency 9554: PauseIcon */).PauseIcon : (require(9376) /* metro dependency 9376: PlayIcon */).PlayIcon;
const WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE;
return ((Component) => <Component color={WHITE} size="md" />)(r2);
}
function _fun119287() { // fn#119287, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:6502, offset: 0x02504ea3, size: 61 bytes, params: 1, frame: 14
return (
<MediaInfo
message={env0_3}
activeMediaPlayerSource={activeMediaPlayerSource}
isVoiceMessage={result}
isControlVisible={env0_9}
/>
);
}
function _fun119288() { // fn#119288, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:6618, offset: 0x02504ee0, size: 61 bytes, params: 1, frame: 14
return (
<PiPControls
message={env0_3}
handleClosePip={env0_8}
visible={env0_9}
isVoiceMessage={result}
/>
);
}
function _default_119270OnPress() { // fn#119289, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:6994, owner: _default_119270.onPress, offset: 0x02504f1d, size: 42 bytes, params: 1, frame: 11
if (!(!isPlaying && env0_9)) {
env0_6(!env0_5);
}
}
function _fun119274() { // fn#119274, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:4774, offset: 0x02504a51, size: 142 bytes, params: 1, frame: 5
if (env0_3.current == null && env0_0 != null && require != null && importDefault != null) {
env0_3.current = {initialProgress: require, activeMediaPlayerSource: env0_0, message: importDefault};
}
if (env0_3.current != null && require != null) {
env0_3.current.finalProgress = require;
}
}
function _fun119275() { // fn#119275, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:4969, offset: 0x02504adf, size: 43 bytes, params: 1, frame: 10
const Date = global.Date;
const date = new Date();
return _fun119276;
}
function _fun119278() { // fn#119278, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:5882, offset: 0x02504cfd, size: 27 bytes, params: 1, frame: 11
if (isPlaying) {
env1_6(false);
}
}
function _fun119282() { // fn#119282, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:6103, offset: 0x02504d9a, size: 73 bytes, params: 1, frame: 14
if (env0_0 != null && env0_0.isCompleted) {
var env0_0 = global.setTimeout(function() {
require();
}, 2000);
}
return _fun119284;
}
function _fun119276() { // fn#119276, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15768:4995, offset: 0x02504b0a, size: 445 bytes, params: 1, frame: 19
var r1;
var r3;
var contentMessage;
var contentMessage2;
let value = environment.__proto__;
const current = env1_3.current;
value = null;
const {activeMediaPlayerSource, message, initialProgress, finalProgress} = value != current ? current : {};
const value2 = undefined;
if (value != (value == activeMediaPlayerSource ? value2 : activeMediaPlayerSource.attachmentIndex)) {
if (value == message) {
r1 = value2;
} else {
contentMessage = message.getContentMessage();
r1 = value == contentMessage ? value2 : contentMessage.attachments[activeMediaPlayerSource.attachmentIndex];
}
r3 = r1;
} else {
r3 = value;
}
const object2 = {};
object2.message_id = value == activeMediaPlayerSource ? value2 : activeMediaPlayerSource.messageId;
object2.sender_user_id = value == message ? value2 : message.author.id;
object2.type = value == r3 ? value2 : r3.content_type;
if (value == message) {
r1 = value2;
} else {
contentMessage2 = message.getContentMessage();
r1 = value == contentMessage2 ? value2 : contentMessage2.hasFlag(MessageFlags.IS_VOICE_MESSAGE);
}
object2.is_voice_message = r1;
object2.total_duration_secs = convertMsToSecs(value == finalProgress ? value2 : finalProgress.duration);
object2.pip_playback_start_time_secs = convertMsToSecs(value == initialProgress ? value2 : initialProgress.time);
object2.pip_playback_end_time_secs = convertMsToSecs(value == finalProgress ? value2 : finalProgress.time);
object2.pip_opened_timestamp = env0_0.toISOString();
const Date = global.Date;
let date = new Date();
object2.pip_closed_timestamp = date.toISOString();
date = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = date.track;
const MEDIA_PIP_ENDED = AnalyticEvents.MEDIA_PIP_ENDED;
Reflect.apply(track, date, [MEDIA_PIP_ENDED, object2]);
return value2;
}