decord/source/modules/verification/native/components/PhoneVerificationModal.tsx

204 lines
7 KiB
TypeScript
Raw Normal View History

// Module ID: 7156
// Function ID: 7157
2026-07-20 16:05:17 +00:00
// Name: PhoneVerificationModal
// Dependencies: [5, 19, 1074, 7157, 21, 5712, 7158, 7159, 4843, 1249, 7192, 7107, 7114, 1115, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 7156 (PhoneVerificationModal)
import UserSettingsConfirmPasswordDefault from "UserSettingsConfirmPassword" /* 7107 */;
import AddPhoneDefault from "AddPhone" /* 7158 */;
import PhoneActionCreatorsDefault from "PhoneActionCreators" /* 7159 */;
import VerifyPhoneDefault from "VerifyPhone" /* 7192 */;
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
const require = globalThis.__r;
const require = fn;
const VerificationModalScenes = fn(1074).VerificationModalScenes;
let closure_5 = fn(7157).PHONE_VERIFICATION_MODAL_KEY;
const jsx = fn(21).jsx;
const size = fn(2);
const result = size.fileFinishedImporting("modules/verification/native/components/PhoneVerificationModal.tsx");
2026-07-20 16:05:17 +00:00
export default function PhoneVerificationModal(onClose) {
2026-07-29 08:29:29 +00:00
let obj = { screens: null, initialRouteName: null, headerBackTitle: null };
_require = onClose;
let obj2 = {};
let obj3 = { headerTitle: require("NavigatorHeader").getHeaderNoTitle(), headerLeft: null, render: null };
const obj4 = require("NavigatorHeader");
obj3.headerLeft = require("NavigatorHeader").getHeaderCloseButton(onClose.onClose);
obj3.render = function render(reason, arg1) {
2026-08-24 06:08:38 +00:00
onClose = reason;
closure_1 = arg1;
2026-07-20 16:05:17 +00:00
const obj = {};
const merged = Object.assign(reason);
reason = undefined;
2026-07-29 08:29:29 +00:00
if (reason != null) {
2026-07-20 16:05:17 +00:00
reason = reason.reason;
}
2026-07-29 08:29:29 +00:00
if (reason == null) {
2026-07-23 10:11:24 +00:00
reason = onClose.reason;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj.reason = reason;
obj.onComplete = function onComplete(phone) {
return closure_1.push(VerificationModalScenes.VERIFY_PHONE, {
2026-07-20 16:05:17 +00:00
phone,
onVerified(arg0) {
reason = arg0;
closure_1.push(constants.VERIFY_PASSWORD, {
hideUnverifiedBanner: true,
onSubmit(password) {
reason = undefined;
if (reason != null) {
reason = reason.reason;
}
if (reason == null) {
reason = reason.reason;
}
return PhoneActionCreatorsDefault.addPhone(reason, password, reason);
},
onSuccess() {
closure_1_1(closure_1_2[8]).popWithKey(closure_1_5);
}
});
2026-07-20 16:05:17 +00:00
}
});
};
let fn = null;
2026-07-23 10:11:24 +00:00
if (onClose.allowDeletePhone) {
2026-07-20 16:05:17 +00:00
fn = () => {
closure_1.push(VerificationModalScenes.VERIFY_PASSWORD, {
hideUnverifiedBanner: true,
onSubmit(password) {
reason = undefined;
if (closure_1_0 != null) {
reason = closure_1_0.reason;
}
if (reason == null) {
reason = closure_0.reason;
}
return PhoneActionCreatorsDefault.removePhone(password, reason);
},
onSuccess() {
closure_1_1(closure_1_2[8]).pop();
}
});
2026-07-20 16:05:17 +00:00
};
}
2026-07-29 08:29:29 +00:00
obj.onDeletePhone = fn;
return jsx(AddPhoneDefault, {});
2026-07-20 16:05:17 +00:00
};
obj2[VerificationModalScenes.ADD_PHONE] = obj3;
let obj6 = { headerTitle: null, impressionName: null, render: null };
let obj5 = require("NavigatorHeader");
obj6.headerTitle = require("NavigatorHeader").getHeaderNoTitle();
obj6.impressionName = require("discord_common/AnalyticsUtils").ImpressionNames.USER_VERIFY_PHONE;
obj6.render = function render(arg0, arg1) {
2026-08-24 06:08:38 +00:00
closure_0 = arg1;
2026-07-23 10:11:24 +00:00
let obj = {};
2026-07-20 16:05:17 +00:00
const merged = Object.assign(arg0);
2026-07-29 08:29:29 +00:00
obj.disableKeyboardAvoidingView = true;
obj.onVerified = function onVerified(arg0) {
closure_0 = arg0;
2026-07-29 08:29:29 +00:00
let obj = { hideUnverifiedBanner: true, onSubmit: null, onSuccess: null };
closure_1 = asyncGeneratorStep(async (arg0) => {
const reason = arg0;
2026-08-24 06:08:38 +00:00
c2 = 0;
c1 = 0;
c4 = 0;
return (async (arg0, value) => {
2026-07-29 08:29:29 +00:00
if (c1 === 2) {
c1 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
2026-07-29 08:29:29 +00:00
} else if (tmp5 === 3) {
if (arg0 === 1) {
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
const obj2 = { value, done: true };
return obj2;
2026-07-29 08:29:29 +00:00
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c1 = 2;
if (0 === c2) {
if (arg0 === 1) {
c1 = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
c1 = 3;
const obj3 = { value, done: true };
return obj3;
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
c4 = 1;
2026-07-29 08:29:29 +00:00
c2 = 2;
c1 = 1;
const obj5 = { value: v3(7159).addPhone(reason, reason, reason.reason), done: false };
return obj5;
2026-07-29 08:29:29 +00:00
}
} else if (1 === tmp6) {
c4 = 0;
c1 = 3;
const obj6 = { value, done: true };
return obj6;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 1) {
c1 = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
c4 = 0;
c1 = 3;
const obj7 = { value, done: true };
return obj7;
2026-07-29 08:29:29 +00:00
} else {
c4 = 0;
c1 = 3;
const obj = { value, done: true };
2026-07-29 08:29:29 +00:00
return obj;
}
} catch (tmp13) {
value = tmp13;
2026-07-29 08:29:29 +00:00
if (tmp3 === c4) {
c1 = tmp2;
throw tmp13;
} else {
c2 = tmp;
}
}
}
})();
});
obj.onSubmit = function() {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = closure_1.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
};
obj.onSuccess = function onSuccess() {
closure_1(4843).popWithKey(closure_1_5);
2026-07-20 16:05:17 +00:00
};
closure_0.push(VerificationModalScenes.VERIFY_PASSWORD, obj);
2026-07-20 16:05:17 +00:00
};
return jsx(VerifyPhoneDefault, {});
2026-07-20 16:05:17 +00:00
};
obj2[VerificationModalScenes.VERIFY_PHONE] = obj6;
const obj8 = { headerTitle: null, render: null };
let obj7 = require("NavigatorHeader");
obj8.headerTitle = require("NavigatorHeader").getHeaderNoTitle();
obj8.render = function render(arg0) {
2026-07-20 16:05:17 +00:00
const merged = Object.assign(arg0);
return jsx(UserSettingsConfirmPasswordDefault, {});
2026-07-20 16:05:17 +00:00
};
obj2[VerificationModalScenes.VERIFY_PASSWORD] = obj8;
obj.screens = obj2;
obj.initialRouteName = VerificationModalScenes.ADD_PHONE;
const intl = require("util").intl;
obj.headerBackTitle = intl.string(require("util").t["13/7kX"]);
return jsx(require("Navigator").Navigator, { screens: null, initialRouteName: null, headerBackTitle: null });
2026-07-20 16:05:17 +00:00
};