294 lines
14 KiB
TypeScript
294 lines
14 KiB
TypeScript
/* Metro module 14302; source: modules/auth/native/components/Auth.tsx; dependencies: [57, 31, 27, 661, 33, 14303, 5282, 14312, 5315, 8980, 4501, 697, 14353, 8973, 1599, 8584, 14354, 9002, 5280, 478, 1244, 14355, 4884, 14359, 2] */
|
|
function _fun108193(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#108193, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14499:6, offset: 0x02317f07, size: 676 bytes, params: 8, frame: 25
|
|
var object2;
|
|
const env0_0 = require;
|
|
const getInitialAuthScreen = function() {
|
|
return AuthStates.WELCOME;
|
|
};
|
|
let Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
let value = importAll(31) /* metro dependency 31 */;
|
|
const value2 = require(27) /* metro dependency 27 */;
|
|
const env0_5 = value2.Keyboard;
|
|
const StyleSheet = value2.StyleSheet;
|
|
const env0_6 = value2.View;
|
|
const AuthStates = (require(661) /* metro dependency 661: Constants */).AuthStates;
|
|
const value3 = require(33) /* metro dependency 33 */;
|
|
const env0_8 = value3.jsx;
|
|
const env0_9 = value3.Fragment;
|
|
const env0_10 = value3.jsxs;
|
|
const allAuthScreens = (require(14303) /* metro dependency 14303: RegistrationStepsUtils */).getAllAuthScreens();
|
|
Object = global.Object;
|
|
const fromEntries = Object.fromEntries;
|
|
const Object2 = global.Object;
|
|
const value6 = Object2.entries(allAuthScreens);
|
|
const env0_12 = Reflect.apply(fromEntries, Object, [value6.map(_fun108198)]);
|
|
object2 = {};
|
|
const LOGIN = AuthStates.LOGIN;
|
|
object2[LOGIN] = (require(8980) /* metro dependency 8980: MFAUtils */).hasWebAuthn ? 600 : 540;
|
|
const MFA = AuthStates.MFA;
|
|
object2[MFA] = 600;
|
|
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = createStylesModule.createStyles;
|
|
object2 = {};
|
|
object2.transparent = {backgroundColor: 'transparent'};
|
|
object2.cardContainer = {'flex': 1, 'position': 'relative', 'backgroundColor': 'transparent'};
|
|
object2.wideOuterContainer = {'flex': 1, 'justifyContent': 'center'};
|
|
const object4 = {'backgroundColor': 'transparent', 'borderRadius': null, 'maxWidth': 480, 'alignSelf': 'center',
|
|
'width': '100%', 'maxHeight': '90%', 'overflow': 'hidden', 'height': 520};
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
object2.wideCard = object4;
|
|
let BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
object2.wideHeaderFlat = {borderBottomWidth: 0, backgroundColor: BACKGROUND_BASE_LOW};
|
|
const object6 = {};
|
|
object6.borderBottomWidth = StyleSheet.hairlineWidth;
|
|
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object6.borderBottomColor = BORDER_SUBTLE;
|
|
BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
object6.backgroundColor = BACKGROUND_BASE_LOW;
|
|
object2.wideHeader = object6;
|
|
const env0_14 = Reflect.apply(createStyles, createStylesModule, [object2]);
|
|
const context = value.createContext(function() {
|
|
});
|
|
value = value.memo(Auth);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/auth/native/components/Auth.tsx');
|
|
exports.default = value;
|
|
exports.TrackRegistrationContext = context;
|
|
}
|
|
|
|
function NavigatorWithCaptchaHook() { // fn#108195, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14499:1453, offset: 0x023181ba, size: 977 bytes, params: 1, frame: 38
|
|
var r16;
|
|
var transparent;
|
|
var r5;
|
|
const Navigator = (require(5280) /* metro dependency 5280: NavigatorNative */).Navigator;
|
|
var object;
|
|
var intl;
|
|
var Provider;
|
|
var object2;
|
|
var object4;
|
|
var value11;
|
|
var object7;
|
|
var items3;
|
|
var object9;
|
|
var space;
|
|
(require(14353) /* metro dependency 14353: useIsHCaptchaModalOpenTracking */).useIsHCaptchaModalOpenTracking();
|
|
const value2 = (importDefault(8973) /* metro dependency 8973: useWideAuthView */)();
|
|
const styles = useStyles();
|
|
const binding = env0_4;
|
|
const useState = binding.useState;
|
|
const value4 = env0_3(Reflect.apply(useState, binding, [getInitialAuthScreen()]), 2);
|
|
const property = value4[0];
|
|
const env0_0 = value4[1];
|
|
const [property2, property3] = env0_3(env0_4.useState(false), 2);
|
|
const value7 = (require(1599) /* metro dependency 1599 */).useKeyboardState(function(a0) {
|
|
return a0.height;
|
|
});
|
|
const value8 = value7 > 200;
|
|
const value9 = env0_4.useCallback(_fun108197, []);
|
|
const jsxRuntimeEnv0_9Binding = jsxRuntimeEnv0_9;
|
|
const value10 = ((Component) => <Component backgroundImageSource={require(14354) /* metro dependency 14354 */} backgroundImageCover />)(importDefault(8584) /* metro dependency 8584: BackgroundImage */);
|
|
if (value2) {
|
|
Provider = (require(9002) /* metro dependency 9002: WideAuthScrollContext */).WideAuthScrollContext.Provider;
|
|
object2 = {value: property3};
|
|
object4 = {};
|
|
value11 = null;
|
|
object4.style = [styles.wideOuterContainer, value8 ? {paddingBottom: value7} : value11];
|
|
object7 = {};
|
|
items3 = [styles.wideCard];
|
|
r16 = value11 != property ? {height: value11 != env0_13[property] ? env0_13[property] : 520} : value11;
|
|
items3[1] = r16;
|
|
r16 = value8 ? {'maxHeight': '100%', 'height': '100%', 'marginTop': 32, 'borderBottomLeftRadius': 0,
|
|
'borderBottomRightRadius': 0} : value11;
|
|
items3[2] = r16;
|
|
object7.style = items3;
|
|
var navigatorProps2 = {'screens': null, 'containerStyle': null, 'viewStyle': null, 'headerStatusBarHeight': 0,
|
|
'cardOverlayEnabled': false, 'cardShadowEnabled': false, screens: env0_12,
|
|
containerStyle: styles.cardContainer,
|
|
viewStyle: property !== AuthStates.WELCOME ? value11 : styles.transparent,
|
|
initialRouteName: getInitialAuthScreen(), onWillFocus: Keyboard.dismiss, onStateChange: value9,
|
|
headerStyle: property2 ? styles.wideHeader : styles.wideHeaderFlat};
|
|
object9 = {};
|
|
object9.paddingLeft = (require(478) /* metro dependency 478: PlatformUtils */).isAndroid() ? (importDefault(697) /* metro dependency 697: native */).space.PX_12 : 20;
|
|
space = (importDefault(697) /* metro dependency 697: native */).space;
|
|
object9.paddingTop = space.PX_24;
|
|
space = (importDefault(697) /* metro dependency 697: native */).space;
|
|
object9.paddingBottom = space.PX_16;
|
|
navigatorProps2.headerLeftContainerStyle = object9;
|
|
navigatorProps2.disableHeaderAnimation = true;
|
|
r5 = <Provider {...object2}><View {...object4}><View {...object7}><Navigator {...navigatorProps2} /></View></View></Provider>;
|
|
} else {
|
|
object = {screens: env0_11};
|
|
transparent = styles.transparent;
|
|
object.viewStyle = transparent;
|
|
transparent = styles.transparent;
|
|
object.containerStyle = transparent;
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
object.headerBackTitle = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['13/7kX']);
|
|
object.initialRouteName = getInitialAuthScreen();
|
|
object.onWillFocus = Keyboard.dismiss;
|
|
object.headerStyle = {borderBottomWidth: 0};
|
|
r5 = <Navigator {...object} />;
|
|
}
|
|
return (
|
|
<>
|
|
{value10}
|
|
{r5}
|
|
</>
|
|
);
|
|
}
|
|
|
|
function _fun108198(a0) { // fn#108198, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14499:351, offset: 0x023185e7, size: 336 bytes, params: 2, frame: 18
|
|
var environment;
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var r8;
|
|
var item3;
|
|
var value4;
|
|
var closure;
|
|
var object2;
|
|
const value = Object.create(environment);
|
|
const iterator = a0[Symbol.iterator]();
|
|
const iterator2 = iterator.next;
|
|
let item2 = Reflect.apply(iterator2, iterator, []);
|
|
let item = item2.value;
|
|
item2 = item2.done ? undefined : iterator;
|
|
const value2 = undefined;
|
|
const value3 = item2 === value2;
|
|
const r7 = value3 ? value2 : item;
|
|
if (value3) {
|
|
r0 = item2;
|
|
r1 = value3;
|
|
r2 = value2;
|
|
} else {
|
|
item3 = Reflect.apply(iterator2, item2, []);
|
|
item = item3.value;
|
|
item3 = item3.done ? undefined : item2;
|
|
value4 = item3 === value2;
|
|
if (value4) {
|
|
r0 = item3;
|
|
r1 = value4;
|
|
r2 = value2;
|
|
} else {
|
|
r0 = item3;
|
|
r1 = value4;
|
|
r2 = item;
|
|
}
|
|
}
|
|
if (!r1) {
|
|
r0.return();
|
|
}
|
|
const items2 = [r7];
|
|
const object3 = {};
|
|
copyDataProperties(object3, r2, value);
|
|
const fullscreen = r2.fullscreen;
|
|
const value5 = null;
|
|
let r3 = fullscreen ? {'fullscreen': false, 'headerTransparent': false} : value5;
|
|
copyDataProperties(object3, r3, value);
|
|
const MFA = AuthStates.MFA;
|
|
if (r7 === MFA) {
|
|
r3 = value5;
|
|
r8 = value;
|
|
} else if (r7 === AuthStates.WELCOME) {
|
|
r3 = value5;
|
|
r8 = value;
|
|
} else {
|
|
closure = headerLeft_108199;
|
|
r3 = {headerLeft: closure};
|
|
r8 = closure;
|
|
}
|
|
copyDataProperties(object3, r3, r8);
|
|
const Set = global.Set;
|
|
const REGISTER_IDENTITY = AuthStates.REGISTER_IDENTITY;
|
|
const LOGIN = AuthStates.LOGIN;
|
|
const AGE_GATE_UNDERAGE = AuthStates.AGE_GATE_UNDERAGE;
|
|
const set = new Set([REGISTER_IDENTITY, LOGIN, AGE_GATE_UNDERAGE]);
|
|
if (set.has(r7)) {
|
|
object2 = {};
|
|
object2.cardStyleInterpolator = (require(5315) /* metro dependency 5315 */).CardStyleInterpolators.forFadeFromCenter;
|
|
r2 = object2;
|
|
} else {
|
|
r2 = value5;
|
|
}
|
|
copyDataProperties(object3, r2, Set);
|
|
items2[1] = object3;
|
|
return items2;
|
|
}
|
|
|
|
function Auth() { // fn#108202, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14499:2995, offset: 0x023187e9, size: 180 bytes, params: 1, frame: 16
|
|
env0_4.useEffect(_fun108203, []);
|
|
env0_4.useLayoutEffect(_fun108205, []);
|
|
(importDefault(14359) /* metro dependency 14359: useOrientationLock */)();
|
|
const env0_0 = env0_4.useRef(undefined);
|
|
const value2 = env0_4.useCallback(_fun108206, []);
|
|
const Provider = env0_15.Provider;
|
|
return (
|
|
<Provider value={value2()}>
|
|
<NavigatorWithCaptchaHook />
|
|
</Provider>
|
|
);
|
|
}
|
|
|
|
function _fun108197(a0) { // fn#108197, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14499:1728, offset: 0x02318595, size: 82 bytes, params: 2, frame: 15
|
|
const binding = env0_0;
|
|
const value2 = null;
|
|
const value3 = undefined;
|
|
const name = value2 == a0 || value2 == a0.routes[a0.index] ? value3 : a0.routes[a0.index].name;
|
|
binding(value2 != name ? name : value2);
|
|
env0_1(false);
|
|
return value3;
|
|
}
|
|
|
|
function headerLeft_108199(a0) { // fn#108199, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14499:456, offset: 0x02318737, size: 133 bytes, params: 2, frame: 17
|
|
var environment;
|
|
var r0;
|
|
var object2;
|
|
var binding;
|
|
const closure = backImage;
|
|
var value;
|
|
let headerLeft = env0_0.headerLeft;
|
|
if (headerLeft != null) {
|
|
binding = env0_0;
|
|
headerLeft = binding.headerLeft;
|
|
object2 = {};
|
|
copyDataProperties(object2, a0, undefined);
|
|
object2['backImage'] = closure;
|
|
r0 = Reflect.apply(headerLeft, binding, [object2]);
|
|
} else {
|
|
value = environment.__proto__;
|
|
const BackButtonWithTracking = (require(14312) /* metro dependency 14312: RegistrationUtils */).BackButtonWithTracking;
|
|
value = <BackButtonWithTracking {...a0} {...{['backImage']: closure}} />;
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun108203() { // fn#108203, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14499:3024, offset: 0x0231889d, size: 46 bytes, params: 1, frame: 11
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
(importDefault(14355) /* metro dependency 14355: AuthManager */).initialize();
|
|
return _fun108204;
|
|
}
|
|
|
|
function _fun108205() { // fn#108205, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14499:3101, offset: 0x023188f0, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (require(4884) /* metro dependency 4884: TTIAnalyticsUtils */).trackAppUIViewed();
|
|
}
|
|
|
|
function _fun108206() { // fn#108206, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14499:3189, offset: 0x02318915, size: 45 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (require(14312) /* metro dependency 14312: RegistrationUtils */).getTrackRegTransition(env0_0);
|
|
}
|
|
|
|
function backImage() { // fn#108200, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14499:484, owner: headerLeft_108199.backImage, offset: 0x023187bc, size: 45 bytes, params: 1, frame: 13
|
|
const HeaderBackImage = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).HeaderBackImage;
|
|
return <HeaderBackImage />;
|
|
}
|
|
|
|
function _fun108204() { // fn#108204, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14499:3051, offset: 0x023188cb, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__.__proto__;
|
|
return (importDefault(14355) /* metro dependency 14355: AuthManager */).terminate();
|
|
}
|
|
|