459 lines
19 KiB
TypeScript
459 lines
19 KiB
TypeScript
/* Metro module 9015; source: modules/verification/native/components/AddPhone.tsx; dependencies: [5, 57, 31, 27, 8972, 1373, 1878, 661, 482, 33, 4501, 697, 566, 8961, 9016, 4131, 4573, 1244, 9017, 8993, 5080, 9018, 1962, 4578, 4496, 9023, 2] */
|
|
function _fun70131(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#70131, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9200:6, offset: 0x01cefc01, size: 460 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(5) /* metro dependency 5 */;
|
|
const env0_4 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_5 = importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const env0_6 = value.View;
|
|
const env0_7 = value.ScrollView;
|
|
const phoneStore = importDefault(8972) /* metro dependency 8972: PhoneStore */;
|
|
const userRequiredActionStore = importDefault(1373) /* metro dependency 1373: UserRequiredActionStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const env0_11 = (require(661) /* metro dependency 661: Constants */).UserFlags;
|
|
const env0_12 = (require(482) /* metro dependency 482: Constants */).NOOP_NULL;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_13 = value.jsx;
|
|
const env0_14 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object2 = {};
|
|
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
object2.background = {flex: 1, backgroundColor: BACKGROUND_BASE_LOW};
|
|
object2.container = {'padding': 16, 'flex': 1};
|
|
object2.title = {textAlign: 'center'};
|
|
object2.input = {marginTop: 24};
|
|
const object3 = {};
|
|
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
object2.redesignInput = object3;
|
|
object2.button = {marginTop: 8};
|
|
const env0_15 = Reflect.apply(createStyles, value, [object2]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/verification/native/components/AddPhone.tsx');
|
|
exports.default = AddPhone;
|
|
}
|
|
|
|
function AddPhone({header, onComplete, onDeletePhone, reason, style}) { // fn#70132, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9200:601, offset: 0x01cefdcd, size: 1496 bytes, params: 2, frame: 40
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const closure = function() {
|
|
return AddPhone_handleSubmit.apply(this, arguments);
|
|
};
|
|
const styles = useStyles();
|
|
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getCurrentUser();
|
|
});
|
|
const action = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserRequiredActionStore],
|
|
function() {
|
|
return UserRequiredActionStore.getAction();
|
|
});
|
|
const phone = currentUser?.phone;
|
|
const isPhoneReverification2 = (importDefault(8961) /* metro dependency 8961: VerificationUtils */).isPhoneReverification(currentUser,
|
|
action);
|
|
const env0_4 = isPhoneReverification2;
|
|
const r9 = onDeletePhone != null && phone != null && currentUser?.email != null && !isPhoneReverification2;
|
|
const countryCode = (require(566) /* metro dependency 566: flux */).useStateFromStores([PhoneStore], function() {
|
|
return PhoneStore.getCountryCode();
|
|
});
|
|
const value9 = env0_4(countryCode.code.split(' '), 2);
|
|
const property = value9[0];
|
|
const property2 = value9[1];
|
|
const env0_5 = property2;
|
|
let binding = env0_5;
|
|
let useState = binding.useState;
|
|
const value10 = '';
|
|
const value12 = env0_4(Reflect.apply(useState, binding, [property ?? value10]), 2);
|
|
const property3 = value12[0];
|
|
const env0_7 = value12[1];
|
|
const r7 = phone != null ? phone.replace(property3, value10) : property2 ?? value10;
|
|
binding = env0_5;
|
|
const value14 = binding.useState(r7);
|
|
const binding2 = env0_4;
|
|
const value15 = binding2(value14, 2);
|
|
const property4 = value15[0];
|
|
const env0_9 = value15[1];
|
|
useState = binding.useState;
|
|
const value16 = binding2(Reflect.apply(useState, binding, [null]), 2);
|
|
const property5 = value16[0];
|
|
const env0_10 = value16[1];
|
|
const env0_11 = binding.useRef(true);
|
|
useState = binding.useState;
|
|
const value17 = binding2(Reflect.apply(useState, binding, [false]), 2);
|
|
const property6 = value17[0];
|
|
const env0_12 = value17[1];
|
|
binding.useEffect(_fun70140, [property2]);
|
|
const items3 = [styles.background, style];
|
|
const items2 = [header ?? ((Text) => <Text style={styles.title} accessibilityRole="header" variant="heading-xl/extrabold" color="mobile-text-heading-primary">{phone == null || isPhoneReverification2 ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.hY8QTR) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.WO0zBE)}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)];
|
|
const FormPhoneOrEmail = importDefault(9017) /* metro dependency 9017: FormPhoneOrEmail */;
|
|
const formPhoneOrEmailProps = {style: styles.input, textInputStyle: styles.redesignInput,
|
|
label: phone == null || isPhoneReverification2 ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t['64bX0M']) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.K6R0UP),
|
|
alpha2: countryCode.alpha2, countryCode: property, value: property4, onChangeText: onChangeText};
|
|
const PhoneOrEmailSelectorForceMode = (require(8993) /* metro dependency 8993: PhoneOrEmailUtils */).PhoneOrEmailSelectorForceMode;
|
|
const PHONE = PhoneOrEmailSelectorForceMode.PHONE;
|
|
formPhoneOrEmailProps.forceMode = PHONE;
|
|
formPhoneOrEmailProps.returnKeyType = 'done';
|
|
formPhoneOrEmailProps.onSubmitEditing = closure;
|
|
formPhoneOrEmailProps.error = property5;
|
|
formPhoneOrEmailProps.onPressCountrySelector = onPressCountrySelector;
|
|
formPhoneOrEmailProps.autoFocus = true;
|
|
items2[1] = <FormPhoneOrEmail {...formPhoneOrEmailProps} />;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
const r19 = r9 ? 'md' : 'lg';
|
|
const string = intl.string;
|
|
const PDTjLN = (require(1244) /* metro dependency 1244: indexNative */).t.PDTjLN;
|
|
items2[2] = <View style={styles.button}><Button variant="primary" size={r19} text={Reflect.apply(string, intl,
|
|
[PDTjLN])} onPress={closure} loading={property6} /></View>;
|
|
items2[3] = r9 ? <View style={styles.button}><Button variant="secondary" size="md" text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.kYvzoQ)} onPress={onPress_70143} /></View> : null;
|
|
return (
|
|
<ScrollView
|
|
style={items3}
|
|
keyboardShouldPersistTaps="handled"
|
|
alwaysBounceVertical={false}
|
|
>
|
|
<View style={styles.container}>
|
|
{items2}
|
|
</View>
|
|
</ScrollView>
|
|
);
|
|
}
|
|
|
|
function AddPhone_handleSubmit() { // fn#70134, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9200:1315, owner: AddPhone._handleSubmit, offset: 0x01cf03a5, size: 53 bytes, params: 1, frame: 13
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
return env1_3(_fun70136).apply(this, arguments);
|
|
}
|
|
|
|
function _fun70140() { // fn#70140, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9200:1611, offset: 0x01cf052e, size: 65 bytes, params: 1, frame: 12
|
|
if (env0_11.current) {
|
|
env0_11.current = false;
|
|
} else {
|
|
env0_9(env0_5 ?? '');
|
|
}
|
|
}
|
|
|
|
function AddPhoneOnChangeText(a0, a1) { // fn#70141, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9200:2237, owner: AddPhone.onChangeText, offset: 0x01cf056f, size: 31 bytes, params: 3, frame: 12
|
|
env0_9(a0);
|
|
env0_7(a1);
|
|
}
|
|
|
|
function AddPhoneOnPressCountrySelector() { // fn#70142, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9200:2392, owner: AddPhone.onPressCountrySelector, offset: 0x01cf058e, size: 72 bytes, params: 1, frame: 15
|
|
const value = environment.__proto__;
|
|
const defaultImport = importDefault(dependencyMap[20]);
|
|
return defaultImport.pushLazy(require(dependencyMap[22])(dependencyMap[21], dependencyMap.paths));
|
|
}
|
|
|
|
function AddPhoneOnPress_70143() { // fn#70143, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9200:2750, owner: AddPhone.onPress, offset: 0x01cf05d6, size: 117 bytes, params: 1, frame: 14
|
|
var environment;
|
|
var hasFlag;
|
|
var value2;
|
|
var value;
|
|
let currentUserBinding = currentUser;
|
|
if (currentUserBinding != null) {
|
|
currentUserBinding = currentUser;
|
|
hasFlag = currentUserBinding.hasFlag;
|
|
value2 = environment.__proto__;
|
|
if (Reflect.apply(hasFlag, currentUserBinding, [UserFlags.MFA_SMS])) {
|
|
value = importDefault(4496) /* metro dependency 4496: AlertActionCreators */;
|
|
value.openLazy({importer: importer_70144});
|
|
} else if (onDeletePhone != null) {
|
|
onDeletePhone();
|
|
}
|
|
}
|
|
}
|
|
|
|
function* _fun70136() { // fn#70136, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9200:1364, offset: 0x01cf03e5, size: 291 bytes, params: 1, frame: 17
|
|
var value;
|
|
var value2;
|
|
var HermesInternal;
|
|
var concat;
|
|
var value3;
|
|
var binding;
|
|
var value4;
|
|
var binding2;
|
|
var binding3;
|
|
var property;
|
|
var value5;
|
|
var beginAddPhone;
|
|
var value6;
|
|
var value7;
|
|
var value8;
|
|
var beginReverifyPhone;
|
|
var value9;
|
|
var value10;
|
|
var value11;
|
|
var error;
|
|
var value12;
|
|
var binding4;
|
|
var value13;
|
|
var APIError;
|
|
var prototype;
|
|
var aPIError;
|
|
var value15;
|
|
var getAnyErrorMessage;
|
|
var value16;
|
|
exceptionLanding47: while (true) {
|
|
value = undefined;
|
|
value2 = false;
|
|
if (value2) {
|
|
return value;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
HermesInternal = global.HermesInternal;
|
|
concat = HermesInternal.concat;
|
|
value3 = '' + View + PhoneStore;
|
|
NOOP_NULL(true);
|
|
reducibleJoin3: while (true) {
|
|
reduciblePort46: while (true) {
|
|
exceptionLanding29: while (true) {
|
|
try {
|
|
try {
|
|
binding = env2_4;
|
|
} catch (error) {
|
|
break exceptionLanding29;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
break reducibleJoin3;
|
|
}
|
|
value12 = environment.__proto__.__proto__.__proto__;
|
|
try {
|
|
binding = env3_0;
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
try {
|
|
binding4 = env3_2;
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
try {
|
|
property = binding4[15];
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
try {
|
|
value13 = binding(property);
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
try {
|
|
APIError = value13.APIError;
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
try {
|
|
prototype = APIError.prototype;
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
try {
|
|
aPIError = new APIError();
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
try {
|
|
value15 = aPIError instanceof Object ? aPIError : undefined;
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
try {
|
|
getAnyErrorMessage = value15.getAnyErrorMessage;
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
try {
|
|
value16 = Reflect.apply(getAnyErrorMessage, value15, []);
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
try {
|
|
UserStore(value16);
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
break reduciblePort46;
|
|
}
|
|
NOOP_NULL(false);
|
|
return undefined;
|
|
}
|
|
value4 = environment.__proto__.__proto__.__proto__;
|
|
try {
|
|
try {
|
|
binding2 = env3_1;
|
|
} catch (error) {
|
|
break exceptionLanding29;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
try {
|
|
try {
|
|
binding3 = env3_2;
|
|
} catch (error) {
|
|
break exceptionLanding29;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
try {
|
|
try {
|
|
property = binding3[14];
|
|
} catch (error) {
|
|
break exceptionLanding29;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
try {
|
|
try {
|
|
value5 = binding2(property);
|
|
} catch (error) {
|
|
break exceptionLanding29;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
if (binding) {
|
|
try {
|
|
try {
|
|
beginReverifyPhone = value5.beginReverifyPhone;
|
|
} catch (error) {
|
|
break exceptionLanding29;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
try {
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding29;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
try {
|
|
try {
|
|
value9 = Reflect.apply(beginReverifyPhone, value5, [value3, dependencyMap]);
|
|
} catch (error) {
|
|
break exceptionLanding29;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
yield value9;
|
|
try {
|
|
try {
|
|
value10 = undefined;
|
|
value11 = false;
|
|
} catch (error) {
|
|
break exceptionLanding29;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
reducibleJoin25: while (true) {
|
|
if (value11) {
|
|
NOOP_NULL(false);
|
|
return value10;
|
|
}
|
|
break reducibleJoin25;
|
|
}
|
|
} else {
|
|
try {
|
|
try {
|
|
beginAddPhone = value5.beginAddPhone;
|
|
} catch (error) {
|
|
break exceptionLanding29;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
try {
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding29;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
try {
|
|
try {
|
|
value6 = Reflect.apply(beginAddPhone, value5, [value3, dependencyMap]);
|
|
} catch (error) {
|
|
break exceptionLanding29;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
yield value6;
|
|
try {
|
|
try {
|
|
value7 = undefined;
|
|
value8 = false;
|
|
} catch (error) {
|
|
break exceptionLanding29;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
reducibleJoin25: while (true) {
|
|
if (value8) {
|
|
NOOP_NULL(false);
|
|
return value7;
|
|
}
|
|
break reducibleJoin25;
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding29;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
try {
|
|
try {
|
|
require(value3);
|
|
} catch (error) {
|
|
break exceptionLanding29;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding47;
|
|
}
|
|
NOOP_NULL(false);
|
|
return undefined;
|
|
}
|
|
NOOP_NULL(false);
|
|
throw error;
|
|
}
|
|
|
|
function onPressImporter() { // fn#70144, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9200:2820, owner: AddPhone.onPress.importer, offset: 0x01cf064b, size: 64 bytes, params: 1, frame: 13
|
|
var environment;
|
|
let value = environment.__proto__.__proto__;
|
|
value = require(dependencyMap[22]);
|
|
value = value(dependencyMap[25], dependencyMap.paths);
|
|
return value.then(function({default: env0_0}) {
|
|
return _fun70146;
|
|
});
|
|
}
|
|
|
|
function _fun70145({default: env0_0}) { // fn#70145, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9200:2854, offset: 0x01cf068b, size: 23 bytes, params: 2, frame: 2
|
|
return _fun70146;
|
|
}
|
|
|
|
function _fun70146(a0) { // fn#70146, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9200:2869, offset: 0x01cf06a2, size: 68 bytes, params: 2, frame: 16
|
|
return ((Component) => <Component {...a0} {...{['onConfirm']: onDeletePhone ?? NOOP_NULL}} />)(env0_0);
|
|
}
|
|
|