decord/source/modules/auth/native/components/VerifyPhone.tsx

226 lines
6.7 KiB
TypeScript
Raw Normal View History

2026-08-08 06:10:11 +00:00
// Module ID: 15109
// Function ID: 15110
2026-07-20 16:05:17 +00:00
// Name: VerifyPhone
2026-08-08 06:10:11 +00:00
// Dependencies: [5, 32, 19, 15081, 15082, 676, 21, 15079, 15097, 4730, 8519, 1236, 8546, 15110, 8547, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-08 06:10:11 +00:00
// Module 15109 (VerifyPhone)
2026-07-23 10:11:24 +00:00
import ME from "ME";
import _slicedToArray from "_slicedToArray";
2026-07-29 08:29:29 +00:00
import noop from "noop";
2026-07-23 10:11:24 +00:00
import { doesRegistrationHaveIdentityType as closure_6 } from "useRegistrationUIStore";
import RegistrationTransitionActionTypes from "RegistrationTransitionActionTypes";
import { Links } from "ME";
import { jsx } from "jsxProd";
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
let c9;
let error;
let metroImportAll;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ authStateToRegisterTransitionStep: error, RegisterTransitionSteps: metroImportAll, RegistrationTransitionActionTypes: c9 } = RegistrationTransitionActionTypes);
const result = require("noop").fileFinishedImporting("modules/auth/native/components/VerifyPhone.tsx");
2026-07-20 16:05:17 +00:00
export default function VerifyPhone(phone) {
2026-07-29 08:29:29 +00:00
let c5;
let c6;
2026-07-23 10:11:24 +00:00
let dependencyMap;
2026-07-20 16:05:17 +00:00
let description;
let onBail;
let sourceState;
let title;
let tmp3;
let tmp5;
phone = phone.phone;
2026-07-29 08:29:29 +00:00
let _require = phone;
2026-07-20 16:05:17 +00:00
const onPhoneTokenReceived = phone.onPhoneTokenReceived;
2026-07-23 10:11:24 +00:00
({ onClose: dependencyMap, onBail } = phone);
2026-07-29 08:29:29 +00:00
let callback;
let React;
c6 = undefined;
let callback2;
let context;
callback = undefined;
2026-07-20 16:05:17 +00:00
({ title, description, sourceState } = phone);
2026-07-29 08:29:29 +00:00
const tmp = callback(React.useState(false), 2);
2026-07-23 10:11:24 +00:00
callback = tmp[1];
2026-07-29 08:29:29 +00:00
[tmp3, c5] = callback(React.useState(null), 2);
let tmp2 = callback(React.useState(null), 2);
[tmp5, c6] = callback(React.useState(false), 2);
callback2 = React.useRef(false);
2026-08-08 06:10:11 +00:00
context = React.useContext(_require(15079).TrackRegistrationContext);
2026-07-20 16:05:17 +00:00
const tmp4 = callback(React.useState(false), 2);
2026-08-08 06:10:11 +00:00
onPhoneTokenReceived(15097)(callback2(sourceState));
2026-07-20 16:05:17 +00:00
const items = [context];
const effect = React.useEffect(() => {
2026-07-29 08:29:29 +00:00
if (_undefined()) {
const obj = { step: null, actionType: null };
obj[0] = context.PHONE_VERIFICATION;
obj[1] = callback.VIEWED;
2026-07-20 16:05:17 +00:00
context(obj);
}
}, items);
2026-08-08 06:10:11 +00:00
onPhoneTokenReceived(4730)(() => () => {
2026-07-29 08:29:29 +00:00
let tmpResult;
if (closure_2 != null) {
tmpResult = tmp(ref.current);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmpResult;
});
_require = undefined;
_require = onBail((arg0) => {
let closure_0 = arg0;
let c5 = 0;
let c6 = 0;
let c4 = 0;
return (function*(arg0, token) {
2026-08-04 21:03:28 +00:00
let closure_2 = tmp3;
v0(true);
v0 = 1;
if (v02()) {
const obj1 = { step: null, actionType: null };
obj1[0] = context.PHONE_VERIFICATION;
obj1[1] = callback.SUBMITTED;
outer1_8(obj1);
}
let obj4 = onPhoneTokenReceived(outer2_2[10]);
yield obj4.verifyPhone(callback, token, false);
if (1 === tmp7) {
v0 = 0;
let closure_1 = ME;
v0(false);
if (v02()) {
const obj3 = { step: null, actionType: null, details: null };
obj3[0] = context.PHONE_VERIFICATION;
obj3[1] = callback.RESPONSE_ERROR;
obj3[2] = ["code"];
outer1_8(obj3);
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
const body = outer1_1.body;
let message;
if (body != null) {
message = body.message;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
if (!message) {
const intl = callback(outer2_2[11]).intl;
obj4 = { statusPageURL: null };
obj4[0] = outer2_10.STATUS;
message = intl.format(callback(outer2_2[11]).t.aTVNes, obj4);
}
c5(message);
v02 = 3;
const tmp28 = c5;
} else if (arg0 === 1) {
v02 = 3;
throw token;
} else if (arg0 !== 2) {
token = token.token;
outer1_7.current = true;
outer1_1(token);
v0 = 0;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
v0 = 0;
return token;
2026-07-29 08:29:29 +00:00
})();
2026-07-20 16:05:17 +00:00
});
const items1 = [phone, onPhoneTokenReceived, context];
2026-07-29 08:29:29 +00:00
callback = React.useCallback(function() {
const self = this;
const apply = closure_0.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
}, items1);
_require = undefined;
_require = onBail((arg0) => {
let closure_0 = arg0;
let c2 = 0;
let c3 = 0;
return (function*(arg0) {
if (c3 === 2) {
c3 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-08 06:10:11 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c3 = 2;
if (0 === c2) {
if (arg0 === 1) {
c3 = 3;
throw arg1;
} else if (arg0 === 2) {
c3 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
let closure_1 = tmp4;
outer1_6(true);
c2 = 1;
c3 = 1;
const obj1 = { value: null, done: false };
obj1[0] = outer1_9(closure_0);
return obj1;
}
} else if (arg0 === 1) {
c3 = 3;
throw arg1;
} else if (arg0 === 2) {
c3 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
outer1_6(false);
c3 = 3;
2026-08-08 06:10:11 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} catch (tmp12) {
c3 = tmp;
throw tmp12;
}
}
})();
});
2026-07-20 16:05:17 +00:00
const items2 = [callback];
2026-07-29 08:29:29 +00:00
const callback1 = React.useCallback(function() {
const self = this;
const apply = closure_0.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
}, items2);
2026-08-08 06:10:11 +00:00
onPhoneTokenReceived(8546)(callback1);
2026-07-20 16:05:17 +00:00
const items3 = [onBail];
const memo = React.useMemo(() => {
2026-07-29 08:29:29 +00:00
let tmp2 = null;
2026-07-20 16:05:17 +00:00
if (null != onBail) {
2026-07-29 08:29:29 +00:00
const obj = { onBail: null };
obj[0] = tmp;
tmp2 = outer1_11(onPhoneTokenReceived(outer1_2[13]), obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp2;
2026-07-20 16:05:17 +00:00
}, items3);
2026-07-29 08:29:29 +00:00
let obj = { title, description, error: tmp3, onCodeEntered: callback, codeType: null, footer: null, disabled: null, loading: null, disableKeyboardAvoidingView: true };
2026-08-08 06:10:11 +00:00
const tmp7 = onPhoneTokenReceived(15097);
obj[4] = _require(8547).CodeType.NUMERIC;
2026-07-29 08:29:29 +00:00
obj[5] = memo;
obj[6] = tmp5;
obj[7] = tmp[0];
2026-08-08 06:10:11 +00:00
return jsx(onPhoneTokenReceived(8547), { title, description, error: tmp3, onCodeEntered: callback, codeType: null, footer: null, disabled: null, loading: null, disableKeyboardAvoidingView: true });
2026-07-20 16:05:17 +00:00
};