188 lines
11 KiB
TypeScript
188 lines
11 KiB
TypeScript
/* Metro module 15317; source: modules/launchpad/native/LaunchPadWrapper.tsx; dependencies: [57, 31, 27, 11324, 661, 33, 4501, 697, 12080, 1239, 15318, 8621, 683, 15315, 4081, 4571, 6619, 4017, 15320, 4556, 1244, 4521, 15322, 2] */
|
|
function _fun117091(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117091, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15514:6, offset: 0x024a39a4, size: 388 bytes, params: 8, frame: 22
|
|
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.View;
|
|
const env0_6 = value.Pressable;
|
|
const env0_7 = value.TouchableOpacity;
|
|
const env0_8 = value.StyleSheet;
|
|
const env0_9 = (require(11324) /* metro dependency 11324: LaunchPadConstants */).LaunchPadTypes;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_10 = value.AnalyticEvents;
|
|
const env0_11 = value.ComponentActions;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_12 = value.jsx;
|
|
const env0_13 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object2 = {};
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object2.modalWrapper = {'height': '100%', 'width': '100%', paddingTop: PX_8};
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object2.a11yDismiss = {'position': 'absolute', 'top': 0, 'width': '100%', height: PX_8};
|
|
const env0_14 = Reflect.apply(createStyles, value, [object2]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/launchpad/native/LaunchPadWrapper.tsx');
|
|
exports.default = LaunchPadWrapper;
|
|
}
|
|
|
|
function LaunchPadWrapper({launchPadType, gestureState, launchPadShown, launchPadSharedState, launchPadPullTabState, updaters}) { // fn#117092, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15514:554, offset: 0x024a3b28, size: 946 bytes, params: 2, frame: 34
|
|
const styles = useStyles();
|
|
const {launchPadCoverStyles,
|
|
launchPadStyles} = (importDefault(15318) /* metro dependency 15318: useLaunchPadAnimatedStylesNative */)({launchPadSharedState: launchPadSharedState,
|
|
launchPadShown: launchPadShown, gestureState: gestureState});
|
|
const value4 = (importDefault(8621) /* metro dependency 8621: useStateFromSharedValue */)(launchPadShown);
|
|
const binding = env0_4;
|
|
const useRef = binding.useRef;
|
|
const value5 = !value4;
|
|
const value6 = Reflect.apply(useRef, binding, [value5]);
|
|
var env0_4 = value6(binding.useState({}), 2)[1];
|
|
binding.useEffect(_fun117093, [value4]);
|
|
const value9 = binding.useCallback(function() {
|
|
return updaters.setLaunchPadPosition(0);
|
|
}, [updaters]);
|
|
binding.useEffect(_fun117097, [value4]);
|
|
binding.useEffect(_fun117098, [launchPadType, value4]);
|
|
binding.useEffect(function() {
|
|
return _fun117100;
|
|
}, [launchPadShown]);
|
|
(importDefault(4571) /* metro dependency 4571: useBackPressHandler */)(_fun117101);
|
|
useLaunchPadComponentDispatchListeners(updaters);
|
|
const value10 = (importDefault(6619) /* metro dependency 6619: useRefValue */)(value6);
|
|
const absoluteFill = StyleSheet.absoluteFill;
|
|
const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
|
|
const value11 = 'none';
|
|
const view = <View2 style={launchPadCoverStyles} pointerEvents={value11} />;
|
|
const PULL_TAB = LaunchPadTypes.PULL_TAB;
|
|
const r5 = launchPadType !== PULL_TAB ? null : ((Component) => <Component gestureState={gestureState} launchPadSharedState={launchPadSharedState} launchPadPullTabState={launchPadPullTabState} updaters={updaters} />)(importDefault(15320) /* metro dependency 15320: LaunchPadPullTab */);
|
|
const View3 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
|
|
const r8 = value4 ? undefined : value11;
|
|
const AccessibilityView = (require(4556) /* metro dependency 4556: AccessibilityViewNative */).AccessibilityView;
|
|
const r13 = value4 ? 'yes' : 'no';
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const WAI6xu = (require(1244) /* metro dependency 1244: indexNative */).t.WAI6xu;
|
|
const items2 = [<Pressable importantForAccessibility={r13} accessibilityRole="button" accessibilityLabel={Reflect.apply(string,
|
|
intl, [WAI6xu])} onPress={value9} style={styles.a11yDismiss} />];
|
|
items2[1] = <TouchableOpacity accessible={false} {...{'aria-hidden': true}} onPress={value9} style={StyleSheet.absoluteFillObject} />;
|
|
const Freeze = (require(4521) /* metro dependency 4521 */).Freeze;
|
|
items2[2] = <Freeze freeze={value4 ? value5 : value10}>{((Component) => <Component visible={value4} sharedState={launchPadSharedState} />)(importDefault(15322) /* metro dependency 15322: LaunchPad */)}</Freeze>;
|
|
return (
|
|
<View style={absoluteFill} pointerEvents="box-none">
|
|
{view}
|
|
{r5}
|
|
<View3 style={launchPadStyles} pointerEvents={r8}>
|
|
<AccessibilityView
|
|
nativeID="launch-pad"
|
|
style={styles.modalWrapper}
|
|
onAccessibilityEscape={value9}
|
|
accessibilityViewIsModal={value4}
|
|
>
|
|
{items2}
|
|
</AccessibilityView>
|
|
</View3>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _fun117093() { // fn#117093, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15514:884, offset: 0x024a3eda, size: 70 bytes, params: 1, frame: 15
|
|
if (env0_2) {
|
|
env0_3.current = false;
|
|
return undefined;
|
|
}
|
|
const env0_0 = global.setTimeout(_fun117094, 1000);
|
|
return _fun117095;
|
|
}
|
|
|
|
function _fun117097() { // fn#117097, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15514:1061, offset: 0x024a3f54, size: 59 bytes, params: 1, frame: 12
|
|
var defaultImport;
|
|
if (env0_2) {
|
|
value = environment.__proto__;
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
defaultImport.track(AnalyticEvents.LAUNCHPAD_OPENED);
|
|
}
|
|
}
|
|
|
|
function _fun117098() { // fn#117098, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15514:1124, offset: 0x024a3f8f, size: 153 bytes, params: 1, frame: 15
|
|
var value;
|
|
const launchPadTypeBinding = launchPadType;
|
|
const PULL_TAB = LaunchPadTypes.PULL_TAB;
|
|
if (launchPadTypeBinding !== PULL_TAB) {
|
|
(require(15315) /* metro dependency 15315: LaunchPadPullTabCache */).clearLaunchPadPullTabExclusionRect();
|
|
} else {
|
|
(require(15315) /* metro dependency 15315: LaunchPadPullTabCache */).setLaunchPadPullTabExclusionRect();
|
|
if (env0_2) {
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
value.triggerHapticFeedback((require(4081) /* metro dependency 4081: HapticUtilsNative */).HapticFeedbackTypes.IMPACT_LIGHT);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun117099() { // fn#117099, offset: 0x024a4028, size: 11 bytes, params: 1, frame: 1
|
|
return _fun117100;
|
|
}
|
|
|
|
function _fun117101() { // fn#117101, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15514:1405, offset: 0x024a4058, size: 26 bytes, params: 1, frame: 10
|
|
if (env0_2) {
|
|
env0_5();
|
|
}
|
|
return env0_2;
|
|
}
|
|
|
|
function useLaunchPadComponentDispatchListeners(a0) { // fn#117102, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15514:1422, owner: LaunchPadWrapper.useLaunchPadComponentDispatchListeners, offset: 0x024a4072, size: 46 bytes, params: 2, frame: 14
|
|
const env0_0 = a0;
|
|
env1_4.useEffect(_fun117103, [a0]);
|
|
}
|
|
|
|
function _fun117094() { // fn#117094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15514:914, offset: 0x024a3f20, size: 30 bytes, params: 1, frame: 11
|
|
env1_3.current = true;
|
|
env1_4({});
|
|
}
|
|
|
|
function _fun117100() { // fn#117100, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15514:1339, offset: 0x024a4033, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__.__proto__;
|
|
return (require(15315) /* metro dependency 15315: LaunchPadPullTabCache */).clearLaunchPadPullTabExclusionRect();
|
|
}
|
|
|
|
function _fun117103() { // fn#117103, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15514:1486, offset: 0x024a40a0, size: 150 bytes, params: 1, frame: 20
|
|
const closure = showLaunchPad_117104;
|
|
const closure2 = hideLaunchPad_117105;
|
|
const env0_2 = (importDefault(12080) /* metro dependency 12080: RouteManager */).addRouteChangeListener(closure2);
|
|
const ComponentDispatch = (require(1239) /* metro dependency 1239: ComponentDispatchUtils */).ComponentDispatch;
|
|
let subscribe = ComponentDispatch.subscribe;
|
|
const LAUNCH_PAD_SHOW = ComponentActions.LAUNCH_PAD_SHOW;
|
|
Reflect.apply(subscribe, ComponentDispatch, [LAUNCH_PAD_SHOW, closure]);
|
|
subscribe = ComponentDispatch.subscribe;
|
|
const LAUNCH_PAD_HIDE = ComponentActions.LAUNCH_PAD_HIDE;
|
|
Reflect.apply(subscribe, ComponentDispatch, [LAUNCH_PAD_HIDE, closure2]);
|
|
return _fun117106;
|
|
}
|
|
|
|
function showLaunchPad_117104() { // fn#117104, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15514:1509, offset: 0x024a4136, size: 38 bytes, params: 1, frame: 11
|
|
const binding = env1_0;
|
|
binding.setLaunchPadShown(true);
|
|
binding.setLaunchPadPosition(1);
|
|
}
|
|
|
|
function hideLaunchPad_117105() { // fn#117105, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15514:1579, offset: 0x024a415c, size: 37 bytes, params: 1, frame: 11
|
|
const binding = env1_0;
|
|
binding.setLaunchPadShown(false);
|
|
binding.setLaunchPadPosition(0);
|
|
}
|
|
|
|
function _fun117106() { // fn#117106, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15514:1828, offset: 0x024a4181, size: 107 bytes, params: 1, frame: 19
|
|
env0_2();
|
|
const ComponentDispatch = (require(1239) /* metro dependency 1239: ComponentDispatchUtils */).ComponentDispatch;
|
|
let unsubscribe = ComponentDispatch.unsubscribe;
|
|
const LAUNCH_PAD_SHOW = ComponentActions.LAUNCH_PAD_SHOW;
|
|
Reflect.apply(unsubscribe, ComponentDispatch, [LAUNCH_PAD_SHOW, showLaunchPad_117104]);
|
|
unsubscribe = ComponentDispatch.unsubscribe;
|
|
const LAUNCH_PAD_HIDE = ComponentActions.LAUNCH_PAD_HIDE;
|
|
Reflect.apply(unsubscribe, ComponentDispatch, [LAUNCH_PAD_HIDE, hideLaunchPad_117105]);
|
|
}
|
|
|