644 lines
36 KiB
TypeScript
644 lines
36 KiB
TypeScript
/* Metro module 4500; source: design/components/AlertModal/native/AlertModal.native.tsx; dependencies: [5, 57, 862, 31, 27, 482, 33, 4501, 697, 4508, 4497, 4017, 1848, 4509, 4555, 690, 4562, 1244, 3875, 1585, 4570, 1478, 4571, 4572, 4573, 4577, 4578, 2] */
|
|
import Module00005 from '../../../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import Module00862 from '../../../../by-id/module-00862.js'; /* Metro dependency 862 */
|
|
import UseWindowDimensionsNative from '../../../../modules/screen/useWindowDimensions.native.tsx'; /* Metro dependency 1478 */
|
|
import UseSafeAreaInsetsNative from '../../../../modules/safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
|
|
import ReanimatedRexport from '../../../../modules/reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
import OverlayView from '../../../void/OverlayView/native/OverlayView.tsx'; /* Metro dependency 4509 */
|
|
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 ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as ConstantsModule from '../../../../external/discord_common/js/shared/Constants.tsx'; /* Metro dependency 482 */
|
|
import * as IndexNativeModule from '../../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as AccessibilityPreferencesContextModule from '../../../../external/discord_common/js/packages/design/components/AccessibilityPreferencesContext/AccessibilityPreferencesContext.tsx'; /* Metro dependency 3875 */
|
|
import * as ReanimatedRexportModule from '../../../../modules/reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
import * as UseAlertStoreNativeModule from './useAlertStore.native.tsx'; /* Metro dependency 4497 */
|
|
import * as CreateStylesModule from '../../Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as TransitionGroupModule from '../../TransitionGroup/TransitionGroup.tsx'; /* Metro dependency 4508 */
|
|
import * as DialogNativeModule from '../../Dialog/native/Dialog.native.tsx'; /* Metro dependency 4555 */
|
|
import * as BackdropNativeModule from '../../Backdrop/native/Backdrop.native.tsx'; /* Metro dependency 4562 */
|
|
import * as StackNativeModule from '../../Stack/native/Stack.native.tsx'; /* Metro dependency 4572 */
|
|
import * as TextModule from '../../Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as SpringModule from '../../../animation/reanimated/spring/spring.tsx'; /* Metro dependency 4577 */
|
|
import * as ButtonNativeModule from '../../Button/native/Button.native.tsx'; /* Metro dependency 4578 */
|
|
|
|
function _fun38389(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#38389, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:6, offset: 0x010be8a8, size: 808 bytes, params: 8, frame: 29
|
|
const env0_0 = require;
|
|
const getAlertModalItemKey = function(a0) {
|
|
return a0.key;
|
|
};
|
|
const AlertModal2 = AlertModal;
|
|
const AlertActions2 = AlertActions;
|
|
const AlertActionButton2 = AlertActionButton;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const NOOP = (ConstantsModule).NOOP;
|
|
const createStyles = CreateStylesModule.createStyles;
|
|
const object2 = {'backgroundColor': null, 'margin': 16, 'width': '100%', 'maxWidth': 400, 'height': '100%',
|
|
'borderRadius': null, 'borderWidth': 1};
|
|
const MOBILE_ALERT_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_ALERT_BACKGROUND_DEFAULT;
|
|
object2.backgroundColor = MOBILE_ALERT_BACKGROUND_DEFAULT;
|
|
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xl;
|
|
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object2.borderColor = BORDER_SUBTLE;
|
|
const SHADOW_TOP_HIGH = (importDefault(697) /* metro dependency 697: native */).shadows.SHADOW_TOP_HIGH;
|
|
copyDataProperties(object2, SHADOW_TOP_HIGH, undefined);
|
|
const env0_13 = Reflect.apply(createStyles, CreateStylesModule, [{root: {'flex': 1, 'position': 'relative',
|
|
'justifyContent': 'center', 'alignItems': 'center', 'paddingHorizontal': 16}, content: object2,
|
|
overflow: {'width': '100%', 'height': '100%', 'overflow': 'hidden', 'padding': 24, 'position': 'relative'},
|
|
body: {alignItems: 'center'}, contentText: {textAlign: 'center'}}]);
|
|
const env0_14 = {'overshootClamping': true, 'damping': 35, 'stiffness': 450, 'mass': 0.5,
|
|
'restDisplacementThreshold': 0.001};
|
|
const createContext = value.createContext;
|
|
const TransitionStates = (TransitionGroupModule).TransitionStates;
|
|
const YEETED = TransitionStates.YEETED;
|
|
const env0_15 = Reflect.apply(createContext, value, [YEETED]);
|
|
const env0_16 = value.createContext(NOOP);
|
|
const env0_17 = value.createContext(0);
|
|
const env0_18 = value.createContext('');
|
|
const env0_19 = value.createContext(null);
|
|
value = value.memo(_fun38414);
|
|
object = {code: 'function AlertModalNativeTsx1(){const{withAlertModalSpring,sharedVisible,sharedTransitionState,TransitionStates,runOnJS,cleanUp}=this.__closure;return{opacity:withAlertModalSpring(sharedVisible.get(),function(finished){if(finished===true&&sharedVisible.get()===0&&sharedTransitionState.get()===TransitionStates.YEETED){runOnJS(cleanUp)();}})};}'};
|
|
object = {code: "function AlertModalNativeTsx2(){const{sharedVisible,sharedTransitionState,TransitionStates,runOnJS,cleanUp,windowHeight,ALERT_MODAL_MARGIN,safeAreaTop,safeAreaBottom,withAlertModalSpring,sharedIndex,sharedTopHeight,useReducedMotion}=this.__closure;var _CARD_OFFSETS$sharedI;function onComplete(finished){if(finished===true&&sharedVisible.get()===0&&sharedTransitionState.get()===TransitionStates.YEETED){runOnJS(cleanUp)();}}const CARD_OFFSETS=[0,-20,-34];const maxHeight=windowHeight-ALERT_MODAL_MARGIN*2-Math.max(safeAreaTop,safeAreaBottom)*2;return{position:'absolute',opacity:withAlertModalSpring(sharedVisible.get(),onComplete),zIndex:10-sharedIndex.get(),height:sharedIndex.get()>0?sharedTopHeight.get():'auto',maxHeight:maxHeight,transform:useReducedMotion?[]:[{scale:withAlertModalSpring(sharedVisible.get()===1?1-sharedIndex.get()*0.1:0.7)},{translateY:withAlertModalSpring(sharedVisible.get()===1?(_CARD_OFFSETS$sharedI=CARD_OFFSETS[sharedIndex.get()])!==null&&_CARD_OFFSETS$sharedI!==void 0?_CARD_OFFSETS$sharedI:sharedVisible.get()*-12:50-sharedIndex.get()*50)}]};}"};
|
|
object = {code: "function withAlertModalSpring_AlertModalNativeTsx3(value,callback){const{withSpring,MODAL_SPRING}=this.__closure;return withSpring(value,MODAL_SPRING,'animate-always',callback);}"};
|
|
const env0_23 = _fun38421();
|
|
object = {code: 'function AlertModalNativeTsx4(){const{sharedTransitionState}=this.__closure;return sharedTransitionState.get();}'};
|
|
object = {code: 'function AlertModalNativeTsx5(transitionState){const{TransitionStates,sharedVisible,runOnJS,cleanUp}=this.__closure;if(transitionState===TransitionStates.YEETED){if(sharedVisible.get()===1){sharedVisible.set(0);}else{runOnJS(cleanUp)();}}else{sharedVisible.set(1);}}'};
|
|
(FileImportTrackerModule).fileFinishedImporting('design/components/AlertModal/native/AlertModal.native.tsx');
|
|
exports.AlertModalContainer = value;
|
|
exports.useDismissModalCallback = useDismissModalCallback;
|
|
exports.AlertModal = AlertModal2;
|
|
exports.AlertActions = AlertActions2;
|
|
exports.AlertActionButton = AlertActionButton2;
|
|
exports.showConfirmModal = showConfirmModal;
|
|
function dismissTopAlert() { // fn#38391, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:2052, offset: 0x010bebd0, size: 185 bytes, params: 1, frame: 17
|
|
var moduleValue;
|
|
const value2 = undefined;
|
|
const useAlertStore = (require(4497) /* metro dependency 4497: useAlertStoreNative */).useAlertStore;
|
|
const getState = useAlertStore.getState;
|
|
const value3 = Module00862(Reflect.apply(getState, useAlertStore, []).alerts);
|
|
const property = value3[0];
|
|
const env0_0 = value3.slice(1);
|
|
if (!(property != null && property.dismissable === false)) {
|
|
moduleValue = require(4497) /* metro dependency 4497: useAlertStoreNative */;
|
|
moduleValue.dismissAlert(property == null ? value2 : property.key);
|
|
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun38392);
|
|
}
|
|
return value2;
|
|
function _fun38392() { // fn#38392, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:2250, offset: 0x010bec89, size: 58 bytes, params: 1, frame: 12
|
|
const useAlertStore = (UseAlertStoreNativeModule).useAlertStore;
|
|
return useAlertStore.setState({alerts: env0_0});
|
|
}
|
|
|
|
}
|
|
|
|
function AlertModalBackdrop() { // fn#38393, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:2661, offset: 0x010becc3, size: 355 bytes, params: 1, frame: 23
|
|
const value2 = env0_6.useContext(env0_16);
|
|
const value4 = Module00057(useSharedAnimationState(), 2);
|
|
const property = value4[0];
|
|
const property2 = value4[1];
|
|
const value5 = (require(4497) /* metro dependency 4497: useAlertStoreNative */).useAlertStore(function(a0) {
|
|
return a0.alerts[0]?.dismissable !== false;
|
|
});
|
|
const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
|
|
const AlertModalBackdropT2 = AlertModalBackdropT;
|
|
const object = {withAlertModalSpring: env0_23, sharedVisible: property2, sharedTransitionState: property};
|
|
const TransitionStates = (TransitionGroupModule).TransitionStates;
|
|
object.TransitionStates = TransitionStates;
|
|
object.runOnJS = ReanimatedRexportModule.runOnJS;
|
|
object.cleanUp = value2;
|
|
AlertModalBackdropT2.__closure = object;
|
|
AlertModalBackdropT2.__workletHash = 4470729133936;
|
|
AlertModalBackdropT2.__initData = env0_20;
|
|
const value6 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [AlertModalBackdropT2]);
|
|
const Backdrop = (BackdropNativeModule).Backdrop;
|
|
const dismissTopAlert2 = value5 ? dismissTopAlert : null;
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const Xkfav5 = (IndexNativeModule).t.Xkfav5;
|
|
return (
|
|
<Backdrop
|
|
blur="strong"
|
|
style={value6}
|
|
onDismiss={dismissTopAlert2}
|
|
accessibilityLabel={Reflect.apply(string, intl, [Xkfav5])}
|
|
/>
|
|
);
|
|
function AlertModalBackdropT() { // fn#38395, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:2893, owner: AlertModalBackdrop.t, offset: 0x010bee4e, size: 46 bytes, params: 1, frame: 14
|
|
var environment;
|
|
const object = {};
|
|
const value = environment.__proto__;
|
|
object.opacity = env1_23(env0_2.get(), _fun38396);
|
|
return object;
|
|
function _fun38396(a0) { // fn#38396, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:2930, offset: 0x010bee7c, size: 147 bytes, params: 2, frame: 13
|
|
var r0;
|
|
var value2;
|
|
var runOnJS;
|
|
var value3;
|
|
let value = a0 === true;
|
|
if (value) {
|
|
value = environment.__proto__;
|
|
value = env1_2.get();
|
|
value = value === 0;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
if (r0) {
|
|
value = environment.__proto__;
|
|
value = env1_1.get();
|
|
value2 = environment.__proto__.__proto__;
|
|
value = value === (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionStates.YEETED;
|
|
r0 = value;
|
|
}
|
|
if (r0) {
|
|
value = environment.__proto__.__proto__;
|
|
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
runOnJS = value.runOnJS;
|
|
value3 = environment.__proto__;
|
|
Reflect.apply(runOnJS, value, [env1_0])();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function AlertModal({header, title, content, actions, extraContent}) { // fn#38397, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:4464, offset: 0x010bef0f, size: 1015 bytes, params: 2, frame: 39
|
|
const Text = (TextModule).Text;
|
|
let binding = property3;
|
|
let useContext = binding.useContext;
|
|
const value2 = Reflect.apply(useContext, binding, [env0_16]);
|
|
const value3 = property3.useContext(env0_17);
|
|
const styles = useStyles();
|
|
const value4 = property3.useContext(env0_19);
|
|
binding = property3;
|
|
useContext = binding.useContext;
|
|
const AccessibilityPreferencesContext = (AccessibilityPreferencesContextModule).AccessibilityPreferencesContext;
|
|
const enabled = Reflect.apply(useContext, binding, [AccessibilityPreferencesContext]).reducedMotion.enabled;
|
|
const value6 = property3.useRef(null);
|
|
const env0_4 = value6;
|
|
const value7 = (ReanimatedRexportModule).useSharedValue(value3);
|
|
const value9 = env0_4(useSharedAnimationState(), 2);
|
|
const property = value9[0];
|
|
var property3 = property;
|
|
const property2 = value9[1];
|
|
const {top, bottom} = (UseSafeAreaInsetsNative)();
|
|
property3.useEffect(_fun38398, [value3]);
|
|
const height = (UseWindowDimensionsNative)().height;
|
|
const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
|
|
const AlertModalB2 = AlertModalB;
|
|
object = {sharedVisible: property2, sharedTransitionState: property};
|
|
const TransitionStates = (TransitionGroupModule).TransitionStates;
|
|
object.TransitionStates = TransitionStates;
|
|
object.runOnJS = ReanimatedRexportModule.runOnJS;
|
|
object.cleanUp = value2;
|
|
object.windowHeight = height;
|
|
object.ALERT_MODAL_MARGIN = 16;
|
|
object.safeAreaTop = top;
|
|
object.safeAreaBottom = bottom;
|
|
object.withAlertModalSpring = env0_23;
|
|
object.sharedIndex = value7;
|
|
object.sharedTopHeight = value4;
|
|
object.useReducedMotion = enabled;
|
|
AlertModalB2.__closure = object;
|
|
AlertModalB2.__workletHash = 655123755546;
|
|
AlertModalB2.__initData = env0_21;
|
|
const value11 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [AlertModalB2]);
|
|
property3.useLayoutEffect(_fun38401, [value3, value7]);
|
|
(importDefault(4571) /* metro dependency 4571: useBackPressHandler */)(function() {
|
|
dismissTopAlert();
|
|
return true;
|
|
});
|
|
const View2 = (ReanimatedRexport).View;
|
|
object = {importantForAccessibility: value3 !== 0 ? 'no-hide-descendants' : 'auto',
|
|
accessibilityElementsHidden: value3 !== 0, style: [styles.content, value11], onLayout: onLayout_38403};
|
|
const Stack = (StackNativeModule).Stack;
|
|
const items2 = [header];
|
|
const Stack2 = (StackNativeModule).Stack;
|
|
items2[1] = (
|
|
<Stack2 spacing={8} style={[styles.body]}>
|
|
<Text
|
|
ref={value6}
|
|
variant="heading-lg/bold"
|
|
accessibilityRole="header"
|
|
color="mobile-text-heading-primary"
|
|
>
|
|
{title}
|
|
</Text>
|
|
{
|
|
content != null
|
|
? (
|
|
content === ''
|
|
? null
|
|
: (
|
|
<Text
|
|
variant="text-md/medium"
|
|
color="text-default"
|
|
style={styles.contentText}
|
|
>
|
|
{content}
|
|
</Text>
|
|
)
|
|
)
|
|
: null
|
|
}
|
|
</Stack2>
|
|
);
|
|
items2[2] = extraContent;
|
|
items2[3] = (
|
|
actions != null
|
|
? (
|
|
<AlertActions>
|
|
{actions}
|
|
</AlertActions>
|
|
)
|
|
: null
|
|
);
|
|
return (
|
|
<View2 {...object}>
|
|
<ScrollView alwaysBounceVertical={false}>
|
|
<View style={styles.overflow}>
|
|
<Stack spacing={24}>
|
|
{items2}
|
|
</Stack>
|
|
</View>
|
|
</ScrollView>
|
|
</View2>
|
|
);
|
|
function _fun38398() { // fn#38398, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:4824, offset: 0x010bf306, size: 74 bytes, params: 1, frame: 12
|
|
var value2;
|
|
var moduleValue;
|
|
if (env0_1 === 0) {
|
|
value2 = environment.__proto__;
|
|
moduleValue = require(4570) /* metro dependency 4570: setAccessibilityFocusAndroid */;
|
|
moduleValue.setAccessibilityFocus({ref: env0_4, delay: 300});
|
|
}
|
|
}
|
|
|
|
function AlertModalB() { // fn#38399, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:4951, owner: AlertModal.B, offset: 0x010bf350, size: 419 bytes, params: 1, frame: 19
|
|
var r1;
|
|
var r6;
|
|
var r3;
|
|
var object;
|
|
var items2;
|
|
var object2;
|
|
var binding5;
|
|
var binding7;
|
|
var property;
|
|
var value;
|
|
const value2 = height - 32;
|
|
const Math = global.Math;
|
|
const value4 = 2 * Math.max(top, bottom);
|
|
const object3 = {position: 'absolute'};
|
|
let binding = env1_23;
|
|
object3.opacity = binding(ReactNativeModule.View.get(), _fun38400);
|
|
binding = Module00862;
|
|
object3.zIndex = 10 - binding.get();
|
|
object3.height = binding.get() > 0 ? env0_2.get() : 'auto';
|
|
object3.maxHeight = value2 - value4;
|
|
if (enabled) {
|
|
r1 = [];
|
|
} else {
|
|
object = {};
|
|
binding = env1_23;
|
|
r1 = ReactNativeModule.View.get() !== 1 ? 0.7 : 1 - 0.1 * Module00862.get();
|
|
object.scale = binding(r1);
|
|
items2 = [object];
|
|
object2 = {};
|
|
binding = env1_23;
|
|
binding5 = ReactNativeModule.View;
|
|
if (binding5.get() === 1) {
|
|
binding7 = Module00862;
|
|
property = [0, -20, -34][binding7.get()];
|
|
if (property != null) {
|
|
r6 = property;
|
|
} else {
|
|
value = ReactNativeModule.View.get();
|
|
value = -12 * value;
|
|
r6 = value;
|
|
}
|
|
r3 = r6;
|
|
} else {
|
|
value = Module00862.get();
|
|
value = 50 - 50 * value;
|
|
r3 = value;
|
|
}
|
|
object2.translateY = binding(r3);
|
|
items2[1] = object2;
|
|
r1 = items2;
|
|
}
|
|
object3.transform = r1;
|
|
return object3;
|
|
function _fun38400(a0) { // fn#38400, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:5037, offset: 0x010bf4f3, size: 147 bytes, params: 2, frame: 13
|
|
var r0;
|
|
var value2;
|
|
var runOnJS;
|
|
var value3;
|
|
let value = a0 === true;
|
|
if (value) {
|
|
value = environment.__proto__;
|
|
value = env1_7.get();
|
|
value = value === 0;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
if (r0) {
|
|
value = environment.__proto__;
|
|
value = env1_6.get();
|
|
value2 = environment.__proto__.__proto__;
|
|
value = value === (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionStates.YEETED;
|
|
r0 = value;
|
|
}
|
|
if (r0) {
|
|
value = environment.__proto__.__proto__;
|
|
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
runOnJS = value.runOnJS;
|
|
value3 = environment.__proto__;
|
|
Reflect.apply(runOnJS, value, [env1_0])();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun38401() { // fn#38401, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:5691, offset: 0x010bf586, size: 25 bytes, params: 1, frame: 11
|
|
Module00862.set(env0_1);
|
|
}
|
|
|
|
function AlertModalOnLayout({nativeEvent}) { // fn#38403, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:5894, owner: AlertModal.onLayout, offset: 0x010bf5b0, size: 41 bytes, params: 2, frame: 11
|
|
const binding = env0_2;
|
|
binding.set(nativeEvent.layout.height);
|
|
}
|
|
|
|
}
|
|
|
|
function useSharedAnimationState() { // fn#38404, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:7297, offset: 0x010bf5d9, size: 356 bytes, params: 1, frame: 24
|
|
const value2 = env0_6.useContext(env0_15);
|
|
const value3 = env0_6.useContext(env0_16);
|
|
const useSharedValue = ReanimatedRexportModule.useSharedValue;
|
|
const TransitionStates = (TransitionGroupModule).TransitionStates;
|
|
const MOUNTED = TransitionStates.MOUNTED;
|
|
const value6 = Reflect.apply(useSharedValue, ReanimatedRexportModule, [value2 !== MOUNTED ? 0 : 1]);
|
|
const value7 = ReanimatedRexportModule.useSharedValue(value2);
|
|
env0_6.useLayoutEffect(_fun38405, [value6, value2, value7]);
|
|
const useAnimatedReaction = ReanimatedRexportModule.useAnimatedReaction;
|
|
const useSharedAnimationStateN2 = useSharedAnimationStateN;
|
|
useSharedAnimationStateN2.__closure = {sharedTransitionState: value7};
|
|
useSharedAnimationStateN2.__workletHash = 14603144870585;
|
|
useSharedAnimationStateN2.__initData = env0_24;
|
|
const useSharedAnimationStateT2 = useSharedAnimationStateT;
|
|
object = {};
|
|
object.TransitionStates = TransitionStates;
|
|
object.sharedVisible = value6;
|
|
object.runOnJS = ReanimatedRexportModule.runOnJS;
|
|
object.cleanUp = value3;
|
|
useSharedAnimationStateT2.__closure = object;
|
|
useSharedAnimationStateT2.__workletHash = 9486923983340;
|
|
useSharedAnimationStateT2.__initData = env0_25;
|
|
Reflect.apply(useAnimatedReaction, ReanimatedRexportModule, [useSharedAnimationStateN2, useSharedAnimationStateT2]);
|
|
return [value7, value6];
|
|
function _fun38405() { // fn#38405, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:7499, offset: 0x010bf73d, size: 25 bytes, params: 1, frame: 11
|
|
Module00005.set(env0_0);
|
|
}
|
|
|
|
function useSharedAnimationStateN() { // fn#38406, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:7557, owner: useSharedAnimationState.n, offset: 0x010bf756, size: 18 bytes, params: 1, frame: 9
|
|
return Module00005.get();
|
|
}
|
|
|
|
function useSharedAnimationStateT(a0) { // fn#38407, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:7657, owner: useSharedAnimationState.t, offset: 0x010bf768, size: 147 bytes, params: 2, frame: 13
|
|
let value = environment.__proto__;
|
|
const TransitionStates = (TransitionGroupModule).TransitionStates;
|
|
const YEETED = TransitionStates.YEETED;
|
|
if (a0 === YEETED) {
|
|
if (env0_2.get() === 1) {
|
|
env0_2.set(0);
|
|
} else {
|
|
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
value.runOnJS(env0_1)();
|
|
}
|
|
} else {
|
|
env0_2.set(1);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function AlertActions({children}) { // fn#38408, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:7920, offset: 0x010bf7fb, size: 65 bytes, params: 2, frame: 15
|
|
const Stack = (StackNativeModule).Stack;
|
|
return (
|
|
<Stack spacing={12}>
|
|
{children}
|
|
</Stack>
|
|
);
|
|
}
|
|
|
|
function AlertActionButton(a0) { // fn#38409, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:8005, offset: 0x010bf83c, size: 214 bytes, params: 2, frame: 20
|
|
const env0_0 = a0.onPress;
|
|
const loading = a0.loading;
|
|
const value = Object.create(null);
|
|
value.onPress = 0;
|
|
value.loading = 0;
|
|
const value2 = copyDataProperties({}, a0, value, undefined);
|
|
const [property, env0_1] = Module00057(env0_6.useState(false), 2);
|
|
const env0_2 = env0_6.useContext(env0_18);
|
|
const Button = (ButtonNativeModule).Button;
|
|
const buttonProps = {...value2};
|
|
buttonProps['grow'] = true;
|
|
buttonProps['loading'] = loading ?? property;
|
|
buttonProps['onPress'] = _fun38410();
|
|
return <Button {...buttonProps} />;
|
|
function _fun38410() { // fn#38410, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:8189, offset: 0x010bf912, size: 32 bytes, params: 1, frame: 12
|
|
const env0_0 = env1_3(_fun38412);
|
|
return _fun38413;
|
|
function* _fun38412(a0) { // fn#38412, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:8209, offset: 0x010bf93b, size: 155 bytes, params: 2, frame: 16
|
|
var r4;
|
|
var value4;
|
|
var value5;
|
|
var value6;
|
|
var error;
|
|
let value = undefined;
|
|
if (true) {
|
|
value = undefined;
|
|
r4 = require == null ? value : require(a0);
|
|
if (r4 == null) {
|
|
value6 = environment.__proto__.__proto__.__proto__;
|
|
env3_0(env3_2[10]).dismissAlert(dependencyMap);
|
|
return value;
|
|
}
|
|
var Promise = global.Promise;
|
|
if (r4 instanceof Promise) {
|
|
importDefault(true);
|
|
yield r4;
|
|
try {
|
|
value4 = undefined;
|
|
value5 = false;
|
|
} catch (error) {
|
|
importDefault(false);
|
|
return value;
|
|
}
|
|
if (value5) {
|
|
return value4;
|
|
}
|
|
value6 = environment.__proto__.__proto__.__proto__;
|
|
env3_0(env3_2[10]).dismissAlert(dependencyMap);
|
|
return value;
|
|
}
|
|
env3_0(env3_2[10]).dismissAlert(dependencyMap);
|
|
}
|
|
return value;
|
|
}
|
|
|
|
function _fun38413() { // fn#38413, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:8363, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
|
|
return env0_0.apply(this, arguments);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun38414() { // fn#38414, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:1043, offset: 0x010bf9d6, size: 239 bytes, params: 1, frame: 21
|
|
const styles = useStyles();
|
|
const value2 = (require(4497) /* metro dependency 4497: useAlertStoreNative */).useAlertStore(function(a0) {
|
|
return a0.alerts;
|
|
});
|
|
const value3 = (ReanimatedRexportModule).useSharedValue(0);
|
|
const value4 = ((a0) => {
|
|
if (a0.length === 0) {
|
|
return [];
|
|
}
|
|
a0.slice(0, 3).forEach(_fun38417);
|
|
return [{'type': 'backdrop', 'key': 'backdrop'}];
|
|
})(value2);
|
|
env0_6.useLayoutEffect(_fun38418, [value4]);
|
|
const value5 = env0_6.useCallback(_fun38419, [styles]);
|
|
const value6 = env0_6.useCallback(_fun38420, [value3]);
|
|
const TransitionGroup = (TransitionGroupModule).TransitionGroup;
|
|
return (
|
|
<TransitionGroup
|
|
wrapChildren={value5}
|
|
items={value4}
|
|
renderItem={value6}
|
|
getItemKey={getAlertModalItemKey}
|
|
/>
|
|
);
|
|
function createTransitionGroupItems(a0) { // fn#38416, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:1135, offset: 0x010bfad0, size: 79 bytes, params: 2, frame: 15
|
|
if (a0.length === 0) {
|
|
return [];
|
|
}
|
|
a0.slice(0, 3).forEach(_fun38417);
|
|
return [{'type': 'backdrop', 'key': 'backdrop'}];
|
|
function _fun38417(a0, a1) { // fn#38417, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:1269, offset: 0x010bfb1f, size: 55 bytes, params: 3, frame: 13
|
|
env0_0.push({type: 'alert', alert: a0, key: a0.key, index: a1});
|
|
}
|
|
|
|
}
|
|
|
|
function _fun38418() { // fn#38418, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:1354, offset: 0x010bfb56, size: 57 bytes, params: 1, frame: 11
|
|
var value;
|
|
if (env0_2.length > 0) {
|
|
value = environment.__proto__;
|
|
value = require(1848) /* metro dependency 1848: KeyboardManagerUtils */;
|
|
value.dismissGlobalKeyboard();
|
|
}
|
|
}
|
|
|
|
function _fun38419(a0) { // fn#38419, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:1432, offset: 0x010bfb8f, size: 155 bytes, params: 2, frame: 20
|
|
const absoluteFillObject = StyleSheet.absoluteFillObject;
|
|
const Dialog = (DialogNativeModule).Dialog;
|
|
return (
|
|
<OverlayView style={absoluteFillObject}>
|
|
<Dialog onDismiss={dismissTopAlert}>
|
|
<View style={styles.root} pointerEvents="box-none">
|
|
{a0}
|
|
</View>
|
|
</Dialog>
|
|
</OverlayView>
|
|
);
|
|
}
|
|
|
|
function _fun38420(a0, a1, a2, a3) { // fn#38420, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:1620, offset: 0x010bfc2a, size: 278 bytes, params: 5, frame: 31
|
|
var r0;
|
|
var value;
|
|
if (a1.type === 'alert') {
|
|
r0 = a1.alert.node;
|
|
} else {
|
|
value = environment.__proto__;
|
|
value = <AlertModalBackdrop />;
|
|
r0 = value;
|
|
}
|
|
const index = a1.type !== 'alert' ? -1 : a1.index;
|
|
value = environment.__proto__;
|
|
const Provider = env1_19.Provider;
|
|
const Provider2 = env1_16.Provider;
|
|
const Provider3 = env1_15.Provider;
|
|
const Provider4 = env1_17.Provider;
|
|
const Provider5 = env1_18.Provider;
|
|
const Suspense = env1_6.Suspense;
|
|
return (
|
|
<Provider value={env0_1} key={a0}>
|
|
<Provider2 value={a3}>
|
|
<Provider3 value={a2}>
|
|
<Provider4 value={index}>
|
|
<Provider5 value={a0}>
|
|
<Suspense fallback={null}>
|
|
{r0}
|
|
</Suspense>
|
|
</Provider5>
|
|
</Provider4>
|
|
</Provider3>
|
|
</Provider2>
|
|
</Provider>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun38421() { // fn#38421, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:6600, offset: 0x010bfd40, size: 88 bytes, params: 1, frame: 14
|
|
const withAlertModalSpring2 = withAlertModalSpring;
|
|
const object = {};
|
|
object.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
|
|
object.MODAL_SPRING = env0_14;
|
|
withAlertModalSpring2.__closure = object;
|
|
withAlertModalSpring2.__workletHash = 15556562210180;
|
|
withAlertModalSpring2.__initData = env0_22;
|
|
return withAlertModalSpring2;
|
|
function withAlertModalSpring(a0, a1) { // fn#38422, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:6636, offset: 0x010bfd98, size: 55 bytes, params: 3, frame: 17
|
|
return (SpringModule).withSpring(a0, env1_14, 'animate-always', a1);
|
|
}
|
|
|
|
}
|
|
|
|
function useDismissModalCallback() { // fn#38423, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:8553, offset: 0x010bfdcf, size: 58 bytes, params: 1, frame: 14
|
|
return env0_6.useCallback(_fun38424, [env0_6.useContext(env0_18)]);
|
|
function _fun38424() { // fn#38424, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:8632, offset: 0x010bfe09, size: 45 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__;
|
|
(UseAlertStoreNativeModule).dismissAlert(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
function showConfirmModal({key, title, content, confirmText, cancelText, extraContent, variant, onConfirm, onCancel, onCloseCallback, dismissable}) { // fn#38425, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4678:8779, offset: 0x010bfe36, size: 312 bytes, params: 2, frame: 32
|
|
var r17;
|
|
var intl;
|
|
if (cancelText !== undefined) {
|
|
r17 = cancelText;
|
|
} else {
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
r17 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['ETE/oC']);
|
|
}
|
|
variant = variant === undefined ? 'destructive' : variant;
|
|
UseAlertStoreNativeModule.openAlert(key,
|
|
<AlertModal title={title} content={content} extraContent={extraContent} actions={<><AlertActionButton variant={variant} text={confirmText} onPress={onConfirm} /><AlertActionButton variant="secondary" text={r17} onPress={onCancel} /></>} />,
|
|
onCloseCallback, {dismissable: dismissable});
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun38389, 4500, [5, 57, 862, 31, 27, 482, 33, 4501, 697, 4508, 4497, 4017, 1848, 4509, 4555, 690, 4562,
|
|
1244, 3875, 1585, 4570, 1478, 4571, 4572, 4573, 4577, 4578,
|
|
2]) /* metro module 4500, dependencies: [5, 57, 862, 31, 27, 482, 33, 4501, 697, 4508, 4497, 4017, 1848, 4509, 4555, 690, 4562, 1244, 3875, 1585, 4570, 1478, 4571, 4572, 4573, 4577, 4578, 2] */;
|