decord/source/modules/auth/native/RegistrationStepsUtils.tsx

487 lines
16 KiB
TypeScript
Raw Normal View History

2026-08-08 06:10:11 +00:00
// Module ID: 15080
// Function ID: 15081
2026-07-29 08:29:29 +00:00
// Name: headerTitle
2026-08-08 06:10:11 +00:00
// Dependencies: [5, 19, 14007, 5828, 15081, 15082, 676, 21, 503, 15083, 15089, 15090, 15102, 15103, 15109, 8470, 15111, 15112, 8522, 8519, 15116, 15117, 15121, 15122, 1481, 1884, 15092, 4202, 8475, 15129, 2]
2026-07-29 08:29:29 +00:00
// Exports: getAllAuthScreens, getNextRegistrationTransitionStep, getPreviousAuthState, getPreviousRegistrationTransitionStep, getRegistrationSteps, handleNextOrSubmitRegistration
2026-07-20 16:05:17 +00:00
2026-08-08 06:10:11 +00:00
// Module 15080 (headerTitle)
2026-07-23 10:11:24 +00:00
import closure_3 from "RegistrationTransitionActionTypes";
2026-07-29 08:29:29 +00:00
import "ChangePhoneReason";
import isRateLimited from "isRateLimited";
2026-07-23 10:11:24 +00:00
import { usePromoEmailConsentStore } from "setPromoEmailConsentState";
import useRegistrationUIStore from "useRegistrationUIStore";
import RegistrationTransitionActionTypes from "RegistrationTransitionActionTypes";
import { AuthStates } from "ME";
2026-07-29 08:29:29 +00:00
import { jsx } from "RegisterAgeGate";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c10;
let c9;
2026-07-23 10:11:24 +00:00
let closure_12;
let closure_6;
2026-07-29 08:29:29 +00:00
let error;
let map1;
let metroImportAll;
let unpackModuleId;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function headerTitle() {
return null;
}
2026-07-29 08:29:29 +00:00
function getNextAuthState(closure_0) {
const index = items.indexOf(closure_0);
2026-07-20 16:05:17 +00:00
if (-1 !== index) {
if (index !== arr.length - 1) {
return arr[index + 1];
}
}
}
function _handleNextOrSubmitRegistration() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0, arg1, arg2) => {
let closure_0 = arg0;
let closure_1 = arg1;
let closure_2 = arg2;
let c4 = 0;
let c3 = 0;
return (function*(arg0, arg1, arg2) {
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 === c4) {
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_9();
2026-08-06 08:05:19 +00:00
const tmp23 = outer1_18(callback);
if (null != tmp23) {
2026-07-29 08:29:29 +00:00
const obj1 = { step: null, toStep: null, actionType: null };
2026-08-06 08:05:19 +00:00
obj1[0] = outer1_10(tmp18);
obj1[1] = outer1_10(tmp23);
2026-07-29 08:29:29 +00:00
obj1[2] = outer1_13.SUCCESS;
2026-08-06 08:05:19 +00:00
tmp19(obj1);
const StackActions = callback(table[24]).StackActions;
obj6.dispatch(StackActions.push(tmp23));
2026-07-29 08:29:29 +00:00
} else {
c4 = 1;
c3 = 1;
const obj2 = { value: null, done: false };
2026-08-06 08:05:19 +00:00
obj2[0] = outer1_20(tmp18, obj6, tmp19);
2026-07-29 08:29:29 +00:00
return obj2;
}
}
} else if (arg0 === 1) {
c3 = 3;
throw arg1;
} else if (arg0 === 2) {
c3 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
}
c3 = 3;
2026-08-08 06:10:11 +00:00
return { value: "HermesInternal", done: null };
2026-08-06 08:05:19 +00:00
} catch (tmp12) {
2026-07-29 08:29:29 +00:00
c3 = tmp;
2026-08-06 08:05:19 +00:00
throw tmp12;
2026-07-29 08:29:29 +00:00
}
}
})();
});
const _handleNextOrSubmitRegistration = tmp;
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function handleRegistrationSubmit(AGE_GATE, closure_0, context) {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _handleRegistrationSubmit.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function _handleRegistrationSubmit() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0, arg1, arg2) => {
let closure_0 = arg0;
let closure_1 = arg1;
let closure_2 = arg2;
let c7 = 0;
let c8 = 0;
let c6 = 0;
return (function*(arg0, arg1, arg2) {
2026-08-04 21:03:28 +00:00
let authenticationErrorsFromAPIError = tmp3;
const result = outer1_4.registrationUsernameSuggestion();
const registrationOptions = state.getState().registrationOptions;
let tmp37 = null;
if (!obj10.isNullOrEmpty(result)) {
tmp37 = registrationOptions.username === result;
}
let obj1 = {};
const merged = Object.assign(registrationOptions);
obj1.usedUsernameSuggestion = tmp37;
if (state.required) {
obj1.promoEmailConsent = state;
}
v02(true);
v0({});
v0 = 1;
2026-08-08 06:10:11 +00:00
let obj3 = callback(15092);
2026-08-04 21:03:28 +00:00
yield obj3.registerFull(obj1);
if (1 === tmp7) {
v0 = 0;
v0 = closure_5;
v02(false);
2026-08-08 06:10:11 +00:00
if (v0 instanceof callback(4202).APIError) {
obj1 = callback(8475);
2026-08-04 21:03:28 +00:00
authenticationErrorsFromAPIError = obj1.getAuthenticationErrorsFromAPIError(v0);
v0(authenticationErrorsFromAPIError);
closure_5 = callback3(callback);
if (null != closure_5) {
2026-08-08 06:10:11 +00:00
callback2(15129)(callback2, dependencyMap, authenticationErrorsFromAPIError, closure_5);
2026-08-04 21:03:28 +00:00
}
state = 3;
2026-07-29 08:29:29 +00:00
} else {
2026-08-04 21:03:28 +00:00
state = 3;
2026-08-08 06:10:11 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
} else if (arg0 === 1) {
state = 3;
throw arg1;
} else if (arg0 !== 2) {
obj3 = { step: null, actionType: null, overrideRegistrationOptions: null };
obj3[0] = callback3(callback);
obj3[1] = constants2.SUCCESS;
obj3[2] = obj1;
dependencyMap(obj3);
const obj4 = { step: null, actionType: null, overrideRegistrationOptions: null };
obj4[0] = constants.REGISTER;
obj4[1] = constants2.SUCCESS;
obj4[2] = obj1;
dependencyMap(obj4);
v0 = 0;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
v0 = 0;
return arg1;
2026-07-29 08:29:29 +00:00
})();
});
const _handleRegistrationSubmit = tmp;
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
({ setRegistrationErrors: closure_6, setSubmitting: error, useRegistrationUIStore: metroImportAll, clearRegistrationErrorMessage: c9 } = useRegistrationUIStore);
({ authStateToRegisterTransitionStep: c10, RegisterTransitionSteps: unpackModuleId, RegistrationSteps: closure_12, RegistrationTransitionActionTypes: map1 } = RegistrationTransitionActionTypes);
2026-07-20 16:05:17 +00:00
const items = [, , , , ];
({ WELCOME: arr[0], REGISTER_IDENTITY: arr[1], REGISTER_DISPLAY_NAME: arr[2], REGISTER_ACCOUNT_INFORMATION: arr[3], AGE_GATE: arr[4] } = AuthStates);
2026-07-29 08:29:29 +00:00
let result = require("isRateLimited").fileFinishedImporting("modules/auth/native/RegistrationStepsUtils.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export function getRegistrationSteps() {
return items;
}
2026-07-20 16:05:17 +00:00
export const getAllAuthScreens = function getAllAuthScreens() {
let obj = {};
obj = {
2026-07-23 10:11:24 +00:00
ignoreKeyboard: true,
fullscreen: true,
2026-07-29 08:29:29 +00:00
impressionName: require(503) /* encodeProperties */.ImpressionNames.USER_WELCOME,
2026-07-20 16:05:17 +00:00
headerTitle,
2026-07-23 10:11:24 +00:00
headerShown: false,
2026-07-20 16:05:17 +00:00
render() {
2026-08-08 06:10:11 +00:00
return callback4(callback2(15083), {});
2026-07-20 16:05:17 +00:00
}
};
obj[AuthStates.WELCOME] = obj;
2026-07-29 08:29:29 +00:00
obj = { ignoreKeyboard: true, fullscreen: true, impressionName: require(503) /* encodeProperties */.ImpressionNames.USER_REGISTRATION, impressionProperties: null, headerTitle: null, headerLeft: null, render: null };
obj[3] = { impression_group: require(503) /* encodeProperties */.ImpressionGroups.USER_REGISTRATION_FLOW, step: constants.IDENTITY };
obj[4] = headerTitle;
obj[5] = function headerLeft(arg0) {
const obj = {};
const merged = Object.assign(arg0);
const index = closure_16.indexOf(constants2.REGISTER_IDENTITY);
let tmp5;
if (-1 !== index) {
if (0 !== index) {
tmp5 = closure_16[index - 1];
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp6;
if (null != tmp5) {
tmp6 = callback3(tmp5);
}
obj.destinationStep = tmp6;
2026-08-08 06:10:11 +00:00
return closure_15(callback(15089).BackButtonWithTracking, obj);
2026-07-29 08:29:29 +00:00
};
obj[6] = function render() {
2026-08-08 06:10:11 +00:00
return callback4(callback(15090).RegisterIdentity, {});
2026-07-20 16:05:17 +00:00
};
obj[AuthStates.REGISTER_IDENTITY] = obj;
2026-07-29 08:29:29 +00:00
const obj2 = { ignoreKeyboard: true, fullscreen: true, impressionName: require(503) /* encodeProperties */.ImpressionNames.USER_REGISTRATION, impressionProperties: null, headerTitle: null, headerLeft: null, render: null };
const obj1 = { impression_group: require(503) /* encodeProperties */.ImpressionGroups.USER_REGISTRATION_FLOW, step: constants.IDENTITY };
obj2[3] = { impression_group: require(503) /* encodeProperties */.ImpressionGroups.USER_REGISTRATION_FLOW, step: constants.DISPLAY_NAME };
obj2[4] = headerTitle;
obj2[5] = function headerLeft(arg0) {
2026-07-20 16:05:17 +00:00
const obj = {};
const merged = Object.assign(arg0);
2026-07-29 08:29:29 +00:00
const index = closure_16.indexOf(constants2.REGISTER_DISPLAY_NAME);
let tmp5;
if (-1 !== index) {
if (0 !== index) {
tmp5 = closure_16[index - 1];
}
}
let tmp6;
if (null != tmp5) {
tmp6 = callback3(tmp5);
}
obj.destinationStep = tmp6;
2026-08-08 06:10:11 +00:00
return closure_15(callback(15089).BackButtonWithTracking, obj);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj2[6] = function render() {
2026-08-08 06:10:11 +00:00
return callback4(callback2(15102), {});
2026-07-20 16:05:17 +00:00
};
obj[AuthStates.REGISTER_DISPLAY_NAME] = obj2;
2026-07-29 08:29:29 +00:00
const obj4 = { ignoreKeyboard: true, fullscreen: true, impressionName: require(503) /* encodeProperties */.ImpressionNames.USER_REGISTRATION, impressionProperties: null, headerTitle: null, headerLeft: null, render: null };
const obj3 = { impression_group: require(503) /* encodeProperties */.ImpressionGroups.USER_REGISTRATION_FLOW, step: constants.DISPLAY_NAME };
obj4[3] = { impression_group: require(503) /* encodeProperties */.ImpressionGroups.USER_REGISTRATION_FLOW, step: constants.ACCOUNT_INFORMATION };
obj4[4] = headerTitle;
obj4[5] = function headerLeft(arg0) {
2026-07-20 16:05:17 +00:00
const obj = {};
const merged = Object.assign(arg0);
2026-07-29 08:29:29 +00:00
const index = closure_16.indexOf(constants2.REGISTER_ACCOUNT_INFORMATION);
let tmp5;
if (-1 !== index) {
if (0 !== index) {
tmp5 = closure_16[index - 1];
}
}
let tmp6;
if (null != tmp5) {
tmp6 = callback3(tmp5);
}
obj.destinationStep = tmp6;
2026-08-08 06:10:11 +00:00
return closure_15(callback(15089).BackButtonWithTracking, obj);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj4[6] = function render() {
2026-08-08 06:10:11 +00:00
return callback4(callback2(15103), {});
2026-07-20 16:05:17 +00:00
};
obj[AuthStates.REGISTER_ACCOUNT_INFORMATION] = obj4;
2026-07-29 08:29:29 +00:00
const obj6 = { ignoreKeyboard: true, impressionName: require(503) /* encodeProperties */.ImpressionNames.USER_VERIFY_PHONE, impressionProperties: null, headerTitle: null, headerLeft: null, render: null };
const obj5 = { impression_group: require(503) /* encodeProperties */.ImpressionGroups.USER_REGISTRATION_FLOW, step: constants.ACCOUNT_INFORMATION };
obj6[2] = { impression_group: require(503) /* encodeProperties */.ImpressionGroups.USER_REGISTRATION_FLOW };
obj6[3] = headerTitle;
obj6[4] = function headerLeft(arg0) {
2026-07-20 16:05:17 +00:00
const obj = {};
const merged = Object.assign(arg0);
2026-07-29 08:29:29 +00:00
obj.destinationStep = constants.ACCOUNT_IDENTITY;
2026-08-08 06:10:11 +00:00
return callback4(callback(15089).BackButtonWithTracking, obj);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj6[5] = function render(arg0) {
2026-07-20 16:05:17 +00:00
const merged = Object.assign(arg0);
2026-08-08 06:10:11 +00:00
return callback4(callback2(15109), {});
2026-07-20 16:05:17 +00:00
};
obj[AuthStates.VERIFY_PHONE] = obj6;
2026-07-29 08:29:29 +00:00
const obj8 = { ignoreKeyboard: true, fullscreen: true, impressionName: require(503) /* encodeProperties */.ImpressionNames.USER_LOGIN, impressionProperties: null, headerTitle: null, render: null };
const obj7 = { impression_group: require(503) /* encodeProperties */.ImpressionGroups.USER_REGISTRATION_FLOW };
obj8[3] = { impression_group: require(503) /* encodeProperties */.ImpressionGroups.USER_LOGIN_FLOW };
obj8[4] = headerTitle;
obj8[5] = function render() {
2026-08-08 06:10:11 +00:00
return callback4(callback2(8470), {});
2026-07-20 16:05:17 +00:00
};
obj[AuthStates.LOGIN] = obj8;
2026-07-29 08:29:29 +00:00
obj[AuthStates.MFA] = {
2026-07-23 10:11:24 +00:00
fullscreen: true,
ignoreKeyboard: true,
2026-07-20 16:05:17 +00:00
headerTitle,
2026-07-23 10:11:24 +00:00
headerShown: false,
2026-07-20 16:05:17 +00:00
render() {
2026-08-08 06:10:11 +00:00
return callback4(callback2(15111), { inContainer: true });
2026-07-20 16:05:17 +00:00
}
};
2026-07-29 08:29:29 +00:00
obj[AuthStates.ACCOUNT_DISABLED_OR_DELETION_SCHEDULED] = {
2026-07-23 10:11:24 +00:00
ignoreKeyboard: true,
fullscreen: true,
2026-07-20 16:05:17 +00:00
headerTitle,
render(arg0) {
const merged = Object.assign(arg0);
2026-08-08 06:10:11 +00:00
return callback4(callback2(15112), {});
2026-07-20 16:05:17 +00:00
}
};
obj[AuthStates.COUNTRY_SELECT] = {
ignoreKeyboard: true,
headerTitle,
render(arg0, arg1) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg1;
2026-08-08 06:10:11 +00:00
return callback4(callback2(8522), {
2026-07-20 16:05:17 +00:00
onClose() {
2026-07-23 10:11:24 +00:00
return arr.pop();
2026-07-20 16:05:17 +00:00
},
onCountrySelected(countryCode) {
2026-07-29 08:29:29 +00:00
return callback(table[19]).setCountryCode(countryCode);
2026-07-20 16:05:17 +00:00
}
});
}
};
obj[AuthStates.EXTERNAL_LINK] = {
ignoreKeyboard: true,
headerTitle,
render(arg0) {
const merged = Object.assign(arg0);
2026-08-08 06:10:11 +00:00
return callback4(callback2(15116), {});
2026-07-29 08:29:29 +00:00
}
};
const obj9 = { impression_group: require(503) /* encodeProperties */.ImpressionGroups.USER_LOGIN_FLOW };
obj[AuthStates.AGE_GATE] = {
ignoreKeyboard: true,
fullscreen: true,
impressionName: require(503) /* encodeProperties */.ImpressionNames.USER_AGE_GATE,
headerTitle,
headerLeft(arg0) {
const obj = {};
const merged = Object.assign(arg0);
const index = closure_16.indexOf(constants2.AGE_GATE);
let tmp5;
if (-1 !== index) {
if (0 !== index) {
tmp5 = closure_16[index - 1];
}
}
let tmp6;
if (null != tmp5) {
tmp6 = callback3(tmp5);
}
obj.destinationStep = tmp6;
2026-08-08 06:10:11 +00:00
return closure_15(callback(15089).BackButtonWithTracking, obj);
2026-07-29 08:29:29 +00:00
},
render() {
2026-08-08 06:10:11 +00:00
return callback4(callback2(15117), {});
2026-07-20 16:05:17 +00:00
}
};
2026-07-29 08:29:29 +00:00
const obj10 = {
2026-07-23 10:11:24 +00:00
ignoreKeyboard: true,
fullscreen: true,
2026-07-29 08:29:29 +00:00
impressionName: require(503) /* encodeProperties */.ImpressionNames.USER_AGE_GATE,
2026-07-20 16:05:17 +00:00
headerTitle,
headerLeft(arg0) {
const obj = {};
const merged = Object.assign(arg0);
2026-07-29 08:29:29 +00:00
const index = closure_16.indexOf(constants2.AGE_GATE);
let tmp5;
if (-1 !== index) {
if (0 !== index) {
tmp5 = closure_16[index - 1];
}
}
let tmp6;
if (null != tmp5) {
tmp6 = callback3(tmp5);
}
obj.destinationStep = tmp6;
2026-08-08 06:10:11 +00:00
return closure_15(callback(15089).BackButtonWithTracking, obj);
2026-07-20 16:05:17 +00:00
},
render() {
2026-08-08 06:10:11 +00:00
return callback4(callback2(15117), {});
2026-07-20 16:05:17 +00:00
}
};
2026-07-29 08:29:29 +00:00
obj[AuthStates.AGE_GATE_UNDERAGE] = {
2026-07-23 10:11:24 +00:00
ignoreKeyboard: true,
fullscreen: true,
2026-07-29 08:29:29 +00:00
impressionName: require(503) /* encodeProperties */.ImpressionNames.USER_AGE_GATE_UNDERAGE,
2026-07-20 16:05:17 +00:00
impressionProperties(existingUser) {
2026-07-29 08:29:29 +00:00
return { impression_group: callback(503).ImpressionGroups.USER_REGISTRATION_FLOW, existing_user: existingUser.existingUser };
2026-07-20 16:05:17 +00:00
},
headerTitle,
render(arg0, arg1) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg1;
2026-07-20 16:05:17 +00:00
const merged = Object.assign(arg0);
2026-08-08 06:10:11 +00:00
return callback4(callback2(15121), {
2026-07-20 16:05:17 +00:00
onClose() {
2026-07-23 10:11:24 +00:00
return closure_0.popToTop();
2026-07-20 16:05:17 +00:00
}
});
}
};
2026-07-29 08:29:29 +00:00
obj[AuthStates.COMPANION_REMOTE_AUTH] = {
2026-07-23 10:11:24 +00:00
ignoreKeyboard: true,
fullscreen: true,
2026-07-20 16:05:17 +00:00
headerTitle,
render() {
2026-08-08 06:10:11 +00:00
return callback4(callback(15122).CompanionRemoteAuth, {});
2026-07-20 16:05:17 +00:00
}
};
return obj;
};
export { getNextAuthState };
2026-07-29 08:29:29 +00:00
export const getPreviousAuthState = function getPreviousAuthState(arg0) {
const index = items.indexOf(arg0);
if (-1 !== index) {
if (0 !== index) {
return items[index - 1];
}
}
};
export const getPreviousRegistrationTransitionStep = function getPreviousRegistrationTransitionStep(AGE_GATE) {
const index = items.indexOf(AGE_GATE);
let tmp3;
if (-1 !== index) {
if (0 !== index) {
tmp3 = tmp[index - 1];
}
}
if (null != tmp3) {
return callback2(tmp3);
}
tmp = items;
};
2026-07-23 10:11:24 +00:00
export const getNextRegistrationTransitionStep = function getNextRegistrationTransitionStep(closure_0) {
2026-07-29 08:29:29 +00:00
const index = items.indexOf(closure_0);
let tmp2;
if (-1 !== index) {
if (index !== arr.length - 1) {
tmp2 = arr[index + 1];
}
}
if (null != tmp2) {
return callback2(tmp2);
2026-07-20 16:05:17 +00:00
}
};
2026-07-29 08:29:29 +00:00
export const handleNextOrSubmitRegistration = function handleNextOrSubmitRegistration(REGISTER_DISPLAY_NAME, closure_0, outer1_4) {
const self = this;
const apply = _handleNextOrSubmitRegistration.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};
export { handleRegistrationSubmit };