This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,132 @@
// Metro module 2741 (f2742).
import { loadJsonAsset } from "../asset_json/native/AssetJsonUtils";
import * as _Module2742 from "../../_bundle/Module2742";
import * as _Module2743 from "../../_bundle/Module2743";
import * as _Module2744 from "../../_bundle/Module2744";
import * as _Module2745 from "../../_bundle/Module2745";
import * as _Module2746 from "../../_bundle/Module2746";
import * as _Module2747 from "../../_bundle/Module2747";
import * as _Module2748 from "../../_bundle/Module2748";
import * as _Module2749 from "../../_bundle/Module2749";
import * as _Module2750 from "../../_bundle/Module2750";
import * as _Module2751 from "../../_bundle/Module2751";
import * as _Module2752 from "../../_bundle/Module2752";
import * as _Module2753 from "../../_bundle/Module2753";
import * as _Module2754 from "../../_bundle/Module2754";
import * as _Module2755 from "../../_bundle/Module2755";
import * as _Module2756 from "../../_bundle/Module2756";
import * as _Module2757 from "../../_bundle/Module2757";
import * as _Module2758 from "../../_bundle/Module2758";
import * as _Module2759 from "../../_bundle/Module2759";
import * as _Module2760 from "../../_bundle/Module2760";
import * as _Module2761 from "../../_bundle/Module2761";
import * as _Module2762 from "../../_bundle/Module2762";
import * as _Module2763 from "../../_bundle/Module2763";
import * as _Module2764 from "../../_bundle/Module2764";
import * as _Module2765 from "../../_bundle/Module2765";
import * as _Module2766 from "../../_bundle/Module2766";
import * as _Module2767 from "../../_bundle/Module2767";
import * as _Module2768 from "../../_bundle/Module2768";
import * as _Module2769 from "../../_bundle/Module2769";
import * as _Module2770 from "../../_bundle/Module2770";
import * as _Module2771 from "../../_bundle/Module2771";
import * as _Module2772 from "../../_bundle/Module2772";
import { createLoader, makeMessagesProxy } from "../../_bundle/Module1274";
const loader = createLoader({
bg: () => loadJsonAsset(_Module2742).then((result) => ({
default: result
})),
cs: () => loadJsonAsset(_Module2743).then((result) => ({
default: result
})),
da: () => loadJsonAsset(_Module2744).then((result) => ({
default: result
})),
de: () => loadJsonAsset(_Module2745).then((result) => ({
default: result
})),
el: () => loadJsonAsset(_Module2746).then((result) => ({
default: result
})),
"en-GB": () => loadJsonAsset(_Module2747).then((result) => ({
default: result
})),
"es-419": () => loadJsonAsset(_Module2748).then((result) => ({
default: result
})),
"es-ES": () => loadJsonAsset(_Module2749).then((result) => ({
default: result
})),
fi: () => loadJsonAsset(_Module2750).then((result) => ({
default: result
})),
fr: () => loadJsonAsset(_Module2751).then((result) => ({
default: result
})),
hi: () => loadJsonAsset(_Module2752).then((result) => ({
default: result
})),
hr: () => loadJsonAsset(_Module2753).then((result) => ({
default: result
})),
hu: () => loadJsonAsset(_Module2754).then((result) => ({
default: result
})),
it: () => loadJsonAsset(_Module2755).then((result) => ({
default: result
})),
ja: () => loadJsonAsset(_Module2756).then((result) => ({
default: result
})),
ko: () => loadJsonAsset(_Module2757).then((result) => ({
default: result
})),
lt: () => loadJsonAsset(_Module2758).then((result) => ({
default: result
})),
nl: () => loadJsonAsset(_Module2759).then((result) => ({
default: result
})),
no: () => loadJsonAsset(_Module2760).then((result) => ({
default: result
})),
pl: () => loadJsonAsset(_Module2761).then((result) => ({
default: result
})),
"pt-BR": () => loadJsonAsset(_Module2762).then((result) => ({
default: result
})),
ro: () => loadJsonAsset(_Module2763).then((result) => ({
default: result
})),
ru: () => loadJsonAsset(_Module2764).then((result) => ({
default: result
})),
"sv-SE": () => loadJsonAsset(_Module2765).then((result) => ({
default: result
})),
th: () => loadJsonAsset(_Module2766).then((result) => ({
default: result
})),
tr: () => loadJsonAsset(_Module2767).then((result) => ({
default: result
})),
uk: () => loadJsonAsset(_Module2768).then((result) => ({
default: result
})),
vi: () => loadJsonAsset(_Module2769).then((result) => ({
default: result
})),
"zh-CN": () => loadJsonAsset(_Module2770).then((result) => ({
default: result
})),
"zh-TW": () => loadJsonAsset(_Module2771).then((result) => ({
default: result
})),
"en-US": () => loadJsonAsset(_Module2772).then((result) => ({
default: result
}))
}, "en-US");
const r51 = makeMessagesProxy(loader);
export default r51;
export { loader as messagesLoader };
@@ -0,0 +1,266 @@
// Metro module 6747 (f6748).
import _asyncToGenerator from "../../_bundle/_asyncToGenerator";
import UserStore from "../../stores/UserStore";
import { AGE_VERIFICATION_MODAL_KEY, AGE_VERIFICATION_QUEST_UNSUPPORTED_ALERT_KEY, VerificationVendorName, AGE_VERIFICATION_GET_STARTED_MODAL_KEY } from "./AgeVerificationConstants";
import { AGE_VERIFICATION_INCODE_PATH } from "./AgeVerificationIncodeWebViewConstants";
import { NativePermissionTypes } from "../native_permissions/NativePermissionConstants";
import { SafetyToastType } from "../safety_common/Constants";
import { jsx } from "react/jsx-runtime";
import NativePermissionUtils from "../native_permissions/NativePermissionUtils";
import ModalActionCreators from "../../actions/ModalActionCreators";
import SafetyToastsActionCreators_native from "../safety_common/SafetyToastsActionCreators.native";
import { isMetaQuest } from "../device/MetaQuestUtils.android";
import { openAlert } from "../../design/components/AlertModal/native/useAlertStore.native";
import AgeVerificationQuestUnsupportedAlertModal from "./native/AgeVerificationQuestUnsupportedAlertModal";
import { isAgeVerificationIncodeEnabled } from "./AgeVerificationIncodeExperiment";
import { isAgeVerified } from "./AgeVerificationUtils";
import { hasAgeGatedFeatures } from "../regional_feature_config/RegionalFeatureConfigUtils";
import Dispatcher from "../../Dispatcher";
import { isExpressiveModalV2Enabled } from "./ExpressiveModalV2Experiment";
import { isAgeVerificationExpressiveModalEverywhereEnabled } from "./AgeVerificationExpressiveModalEverywhereExperiment";
import Linking from "../../lib/native/Linking";
function $mk115026($env) {
return function*() {
let env31436 = {
$parent: $env
};
env31436[1] = 0;
env31436[2] = 0;
let env31969;
const r22 = void 0;
const r9 = env31969 = {
$parent: r22
};
env31436[0] = r9;
env31969[0] = void 0;
const r35 = yield import("./native/AgeVerificationIncodeModal");
const r43 = env31436[0];
r43[0] = r35.default;
return $mk118783(r43);
};
}
function $mk115027($env) {
return () => {
const Component = $env[0];
const r4 = $env.$parent;
return <Component webviewUrl={r4[1]} onClose={r4[0]} {...r4[2]} />;
};
}
function $mk115028($env) {
return () => {
const Component = $env[0];
const r4 = $env.$parent;
return <Component entryPoint={r4[0]} onClose={$mk118018(r4)} />;
};
}
function $mk115029($env) {
return () => {
const Component = $env[0];
const r4 = $env.$parent;
return <Component entryPoint={r4[0]} isRetry={r4[2]} useEmbeddedMethods={r4[4]} />;
};
}
function $mk118018($env) {
return () => {
const r3 = $env[1];
return r3 == null ? void 0 : r3();
};
}
function $mk118783($env) {
return () => {
const r3 = $env.$parent.$parent[12];
const r2 = $env[0];
const r4 = $env.$parent;
return r3(r2, {
webviewUrl: r4[2],
onClose: r4[0],
onComplete: r4[1]
});
};
}
let env4334 = {};
const openIncodeAgeVerificationModal = function openIncodeAgeVerificationModal({ onClose: onClose2, onComplete: onComplete2 }) {
const WEBAPP_ENDPOINT = window.GLOBAL_ENV?.WEBAPP_ENDPOINT;
const r21 = WEBAPP_ENDPOINT == null;
let r22 = null;
if (!r21) {
r22 = null;
if (WEBAPP_ENDPOINT !== "") {
const r12 = URL;
const concat = HermesInternal.concat;
let r8 = "https:";
const hostname = new r12(concat.call("https:", WEBAPP_ENDPOINT)).hostname;
if (!(hostname !== "localhost" && (hostname !== "127.0.0.1" && !/^(10\.|192\.168\.|172\.(1[6-9]|2\d|3[01])\.)/.test(hostname)))) {
r8 = "http:";
}
r22 = `${r8}${WEBAPP_ENDPOINT}${AGE_VERIFICATION_INCODE_PATH}`;
}
}
let c15892_2 = r22;
let r35 = r22 != null;
if (r35) {
(async () => {
let c25979_0, c25979_1;
let c25979_2 = 0;
const r11 = void 0;
L12: {
try {
c25979_1 = r11;
c25979_0 = r11;
c25979_2 = 1;
await NativePermissionUtils.requestPermission(NativePermissionTypes.CAMERA, {
showAuthorizationError: true
});
await ModalActionCreators.pushLazy((0, _asyncToGenerator)($mk115026(c25979_0)), {}, AGE_VERIFICATION_MODAL_KEY);
c25979_2 = 0;
} catch ($e) {
let r27 = $e;
if (c25979_2 !== 0) {
while (true) {
try {
c25979_2 = 0;
SafetyToastsActionCreators_native.showFailedToast(SafetyToastType.TIGGER_PAWTECT_ERROR);
(0, onClose2)();
break L12;
} catch ($e) {
r27 = $e;
if (c25979_2 === 0) {
break;
}
}
}
}
throw r27;
}
}
})();
r35 = true;
}
return r35;
};
const r36 = {
showAgeVerification: function showAgeVerification(a0) {
let r29;
let onClose3 = a0.onClose;
if (onClose3 === void 0) {
onClose3 = () => {};
}
let env15893;
L11: {
env15893 = {
$parent: env4334
};
env15893[0] = onClose3;
a0.shouldShowExpressiveModal;
const { webviewUrl, onClose, shouldShowExpressiveModal, verificationVendorName, incodeParameters, ...rest } = a0;
env15893[1] = webviewUrl;
a0.incodeParameters;
env15893[2] = rest;
if (isMetaQuest()) {
openAlert(AGE_VERIFICATION_QUEST_UNSUPPORTED_ALERT_KEY, (0, jsx)(AgeVerificationQuestUnsupportedAlertModal, {}), onClose3);
r29 = true;
} else {
if (verificationVendorName === VerificationVendorName.INCODE && isAgeVerificationIncodeEnabled(rest.entryPoint)) {
r29 = openIncodeAgeVerificationModal({
onClose: onClose3,
onComplete: rest.onComplete
});
break L11;
}
r29 = webviewUrl != null;
if (r29) {
ModalActionCreators.pushLazy(async () => {
let env29832;
const r9 = env29832 = {
$parent: env15893
};
let c25980_0 = r9;
env29832[0] = void 0;
const r35 = await import("./native/AgeVerificationModal");
env29832[0] = r35.default;
return $mk115027(c25980_0);
}, {}, AGE_VERIFICATION_MODAL_KEY);
r29 = true;
}
}
}
return r29;
},
showAgeVerificationGetStartedModal: function showAgeVerificationGetStartedModal(a0) {
let env15894 = {
$parent: env4334
};
const entryPoint = a0.entryPoint;
env15894[0] = entryPoint;
const onClose3 = a0.onClose;
env15894[1] = onClose3;
env15894[2] = void 0;
env15894[3] = void 0;
env15894[4] = void 0;
if (isMetaQuest()) {
openAlert(AGE_VERIFICATION_QUEST_UNSUPPORTED_ALERT_KEY, (0, jsx)(AgeVerificationQuestUnsupportedAlertModal, {}), onClose3);
} else {
env15894[2] = isAgeVerified() && hasAgeGatedFeatures();
if (isAgeVerificationIncodeEnabled(entryPoint)) {
const ageVerificationStatus = UserStore.getCurrentUser()?.ageVerificationStatus;
const handleClose = function handleClose() {
Dispatcher.dispatch({
type: "CLOSE_AGE_VERIFICATION_MODAL",
status: env15894[3]
});
const r12 = env15894[1];
if (r12 != null) {
r12();
}
};
env15894[3] = ageVerificationStatus;
Dispatcher.dispatch({
type: "INITIATE_AGE_VERIFICATION"
});
if (!openIncodeAgeVerificationModal({
onClose: handleClose,
onComplete: () => {}
})) {
Dispatcher.dispatch({
type: "CLOSE_AGE_VERIFICATION_MODAL",
status: ageVerificationStatus
});
if (onClose3 != null) {
onClose3();
}
}
return void 0;
}
if (isExpressiveModalV2Enabled(entryPoint)) {
ModalActionCreators.pushLazy(async () => {
let env29833;
const r9 = env29833 = {
$parent: env15894
};
let c25981_0 = r9;
env29833[0] = void 0;
const r35 = await import("./native/AgeVerificationExpressiveV2Modal");
env29833[0] = r35.default;
return $mk115028(c25981_0);
}, {}, AGE_VERIFICATION_GET_STARTED_MODAL_KEY);
} else {
env15894[4] = isAgeVerificationExpressiveModalEverywhereEnabled(entryPoint);
ModalActionCreators.pushLazy(async () => {
let env29834;
const r9 = env29834 = {
$parent: env15894
};
let c25982_0 = r9;
env29834[0] = void 0;
const r35 = await import("./native/AgeVerificationGetStartedModal");
env29834[0] = r35.default;
return $mk115029(c25982_0);
}, {}, AGE_VERIFICATION_GET_STARTED_MODAL_KEY);
}
}
},
openUrl: function openUrl(a0) {
Linking.openURL(a0);
}
};
export default r36;
@@ -0,0 +1,122 @@
// Metro module 6749 (f6750).
import ChannelStore from "../../stores/ChannelStore";
import { AnalyticEvents } from "../../Constants";
import AnalyticsUtils from "../../utils/AnalyticsUtils";
const r10 = {
GET_STARTED_MODAL: "get_started_modal",
RETRY_MODAL: "retry_modal",
NSFW_GUILD: "nsfw_guild",
NSFW_AGE_GATE: "nsfw_age_gate",
OBSCURED_MEDIA: "obscured_media",
SYSTEM_DM_RETRY_BUTTON: "system_dm_retry_button",
DEV_TOOLS_QUICK_ACTIONS: "dev_tools_quick_actions",
SENSITIVE_MEDIA_FILTER_SETTINGS: "sensitive_media_filter_settings",
SENSITIVE_MEDIA_LEARN_MORE: "sensitive_media_learn_more",
MESSAGE_REQUESTS_SETTINGS: "message_requests_settings",
ACCOUNT_AGE_GROUP: "account_age_group",
FORUM_POST_MEDIA_PREVIEW: "forum_post_media_preview",
SEARCH_MEDIA_PREVIEW: "search_media_preview",
CONTENT_AND_SOCIAL_NOTICE: "content_and_social_notice",
DEV_TOOLS_AGE_VERIFICATION_RETRY_MODAL: "dev_tools_age_verification_retry_modal",
SAFETY_FLOWS: "safety_flows",
AUTOMATED_UNDERAGE_APPEALS: "automated_underage_appeals",
EXPRESSIVE_GET_STARTED: "expressive_get_started",
STAGE_CHANNEL_RAISE_HAND: "stage_channel_raise_hand",
STAGE_CHANNEL_AGE_VERIFICATION_PROMPT: "stage_channel_age_verification_prompt",
START_STAGE_PROMPT: "start_stage_prompt",
AGE_RESTRICTED_DM_COMMANDS_SETTINGS: "age_restricted_dm_commands_settings",
AGE_RESTRICTED_SERVERS_ACCESS_SETTINGS: "age_restricted_servers_access_settings",
FAMILY_CENTER_CONNECTION: "family_center_connection",
PARENTAL_CONSENT_LOCKOUT: "parental_consent_lockout"
};
const r9 = {
PRIMARY: 1,
1: "PRIMARY",
RETRY: 2,
2: "RETRY",
EXPRESSIVE_PRIMARY: 3,
3: "EXPRESSIVE_PRIMARY",
SAFETY_FLOWS: 4,
4: "SAFETY_FLOWS"
};
const r53 = {
MANUAL_REVIEW_REQUEST: "manual_review_request",
LEARN_MORE: "learn_more",
GET_STARTED: "get_started",
SYSTEM_DMS_LEARN_MORE: "system_dms_learn_more",
METHOD_SELECT: "method_select",
LOG_OUT: "log_out"
};
const r60 = {
RETRY: "retry",
CONNECT_TO_TEEN: "connect_to_teen"
};
const r63 = {
NSFW_CHANNEL_AGE_VERIFY: "nsfw_channel_age_verify",
NSFW_CHANNEL_UNDERAGE: "nsfw_channel_underage",
NSFW_CHANNEL_VERIFIED: "nsfw_channel_verified",
GUILD_LARGE_SERVER: "guild_large_server",
GUILD_LARGE_SERVER_UNDERAGE: "guild_large_server_underage",
NSFW_EMBEDDED_ACTIVITY: "nsfw_embedded_activity",
NSFW_APP_LISTING: "nsfw_app_listing",
SPOILER_CHANNEL: "spoiler_channel"
};
const r72 = {
NSFW_CHANNEL_AGREE_CTA: "nsfw_channel_agree_cta",
NSFW_CHANNEL_DISAGREE_CTA: "nsfw_channel_disagree_cta"
};
const r75 = {
VERIFIED_TEEN: "verified_teen",
VERIFIED_ADULT: "verified_adult",
ERROR: "error"
};
export { r10 as AgeVerificationModalEntryPoint };
export { r9 as AgeVerificationModalVersion };
export { r53 as AgeVerificationModalCta };
export { r60 as AgeVerificationDmCta };
export { r63 as NsfwSpaceWarningModalType };
export { r72 as NsfwSpaceWarningModalCta };
export function trackAgeVerificationModalViewed(a0, a1, a2) {
AnalyticsUtils.track(AnalyticEvents.AGE_VERIFICATION_MODAL_VIEWED, {
modal_session_id: a0,
modal_version: a1,
entry_point: a2
});
}
export function trackAgeVerificationModalClicked(a0, a1, a2, a3) {
AnalyticsUtils.track(AnalyticEvents.AGE_VERIFICATION_MODAL_CLICKED, {
modal_session_id: a0,
modal_version: a1,
cta: a2,
method: a3
});
}
export function trackAgeVerificationDmClicked(a0, a1) {
AnalyticsUtils.track(AnalyticEvents.AGE_VERIFICATION_DM_CLICKED, {
cta: a0,
channel_id: a1
});
}
export function trackNsfwSpaceWarningModalViewed(a0, a1, a2) {
AnalyticsUtils.track(AnalyticEvents.NSFW_SPACE_WARNING_MODAL_VIEWED, {
channel_id: a1,
guild_id: a2,
modal_type: a0
});
}
export function trackNsfwSpaceWarningModalClicked(a0, a1, a2, a3) {
const r4 = a2 != null ? ChannelStore.getChannel(a2) : null;
AnalyticsUtils.track(AnalyticEvents.NSFW_SPACE_WARNING_MODAL_CLICKED, {
cta: a0,
modal_type: a1,
channel_id: a2,
guild_id: a3,
has_channel_topic: r4?.topic != null && r4.topic.trim() !== ""
});
}
export { r75 as AgeVerificationToastType };
export function trackAgeVerificationToastViewed(a0) {
AnalyticsUtils.track(AnalyticEvents.AGE_VERIFICATION_TOAST_VIEWED, {
toast_type: a0
});
}
@@ -0,0 +1,60 @@
// Metro module 6748 (f6749).
import { HelpdeskArticles } from "../../Constants";
import { AgeVerificationModalEntryPoint, trackAgeVerificationModalClicked, AgeVerificationModalVersion, AgeVerificationModalCta } from "./AgeVerificationAnalyticsUtils";
import { intl, t } from "../../intl/index.native";
import AgeVerificationActionCreators_native from "./AgeVerificationActionCreators.native";
import HelpdeskUtils from "../../utils/HelpdeskUtils";
import AgeAssurance_messages from "./AgeAssurance.messages";
const set = new Set([AgeVerificationModalEntryPoint.NSFW_GUILD]);
const r31 = {
K_ID: "K_ID",
GOOGLE_WALLET: "GOOGLE_WALLET",
INCODE: "INCODE"
};
const r35 = {
FACIAL_AGE_ESTIMATION: 1,
1: "FACIAL_AGE_ESTIMATION",
ID_VERIFICATION: 2,
2: "ID_VERIFICATION",
MODULAR: 3,
3: "MODULAR",
GOOGLE_WALLET: 9,
9: "GOOGLE_WALLET"
};
const r41 = {};
r41[r35.FACIAL_AGE_ESTIMATION] = {
title: AgeAssurance_messages["2yLvkS"],
description: AgeAssurance_messages.eJmat5
};
r41[r35.ID_VERIFICATION] = {
title: AgeAssurance_messages.dwkwo0,
description: AgeAssurance_messages.ZdmRwW
};
r41[r35.GOOGLE_WALLET] = {
title: AgeAssurance_messages.Y9sLpR,
description: AgeAssurance_messages.dah4bF
};
export { set as FULLSCREEN_AGE_VERIFICATION_ENTRY_POINTS };
export function getAgeVerificationGetStartedSteps(c15895_0) {
return [{
title: intl.string(t.HphYKp),
description: intl.string(t["GCZC+9"])
}, {
title: intl.string(t.nkO4L3),
description: intl.string(t.rHZFsH)
}, {
title: intl.string(t.aVwLfn),
description: intl.format(t.n5vd1E, {
handleOnHelpUrlHook: () => {
AgeVerificationActionCreators_native.openUrl(HelpdeskUtils.getArticleURL(HelpdeskArticles.TIGGER_PAWTECT_SYSTEM_DMS));
trackAgeVerificationModalClicked(c15895_0, AgeVerificationModalVersion.PRIMARY, AgeVerificationModalCta.SYSTEM_DMS_LEARN_MORE);
}
})
}];
}
export const AGE_VERIFICATION_MODAL_KEY = "AGE_VERIFICATION_MODAL_KEY";
export const AGE_VERIFICATION_GET_STARTED_MODAL_KEY = "AGE_VERIFICATION_GET_STARTED_MODAL_KEY";
export const AGE_VERIFICATION_QUEST_UNSUPPORTED_ALERT_KEY = "AGE_VERIFICATION_QUEST_UNSUPPORTED_ALERT_KEY";
export { r31 as VerificationVendorName };
export { r35 as VerificationMethod };
export { r41 as VERIFICATION_METHOD_TITLE_MAP };
@@ -0,0 +1,24 @@
// Metro module 7617 (f7618).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
kind: "user",
name: "2025-11-age-verification-expressive-everywhere",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export function useIsAgeVerificationExpressiveModalEverywhereEnabled(a0) {
return apexExperiment.useConfig({
location: a0
}).enabled;
}
export function isAgeVerificationExpressiveModalEverywhereEnabled(a0) {
return apexExperiment.getConfig({
location: a0
}).enabled;
}
@@ -0,0 +1,24 @@
// Metro module 6768 (f6769).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
kind: "user",
name: "2026-06-age-verification-incode",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export function useIsAgeVerificationIncodeEnabled(a0) {
return apexExperiment.useConfig({
location: a0
}).enabled;
}
export function isAgeVerificationIncodeEnabled(a0) {
return apexExperiment.getConfig({
location: a0
}).enabled;
}
@@ -0,0 +1,139 @@
// Metro module 6750 (f6751).
let c4337_0 = "__DISCORD_AGE_VERIFICATION_INCODE_PARAMS__";
const eventType = "Verification.Result";
const eventType2 = "Verification.CaptureComplete";
const eventType3 = "Verification.FallbackRequest";
let c4337_4 = "__DISCORD_APPLY_INCODE_FALLBACK_SESSION__";
let c4337_5 = {
COMPLETED: "completed",
CANCELLED: "cancelled",
ERROR: "error"
};
export const AGE_VERIFICATION_INCODE_PATH = "/age-verification/incode";
export const AGE_VERIFICATION_INCODE_PARAMS_KEY = "__DISCORD_AGE_VERIFICATION_INCODE_PARAMS__";
export const AGE_VERIFICATION_INCODE_PARAMS_SCHEMA_VERSION = 2;
export const VERIFICATION_RESULT_EVENT_TYPE = "Verification.Result";
export const VERIFICATION_CAPTURE_COMPLETE_EVENT_TYPE = "Verification.CaptureComplete";
export const VERIFICATION_FALLBACK_REQUEST_EVENT_TYPE = "Verification.FallbackRequest";
export const INCODE_FALLBACK_SESSION_CALLBACK_KEY = "__DISCORD_APPLY_INCODE_FALLBACK_SESSION__";
export { c4337_5 as AgeVerificationIncodeResultStatus };
export function readInjectedIncodeParams() {
let r14;
const r12 = window[c4337_0];
if (r12 != null && typeof r12 === "object") {
L15: {
const { schemaVersion, apiUrl, sessionToken, consentId, interviewId } = r12;
let theme = r12.theme;
let method = r12.method;
if (schemaVersion != null) {
r14 = null;
if (schemaVersion !== 2) {
break L15;
}
}
r14 = null;
if (typeof apiUrl === "string") {
r14 = null;
if (typeof sessionToken === "string") {
r14 = null;
if (typeof consentId === "string") {
r14 = null;
if (typeof interviewId === "string") {
if (theme != null) {
r14 = null;
if (typeof theme !== "string") {
break L15;
}
}
if (theme == null) {
theme = null;
}
if (method == null) {
method = null;
}
r14 = {
apiUrl,
sessionToken,
consentId,
interviewId,
theme,
method
};
}
}
}
}
}
return r14;
}
return null;
}
export function buildIncodeParamsInjection(a0, a1) {
const r10 = JSON.stringify(JSON.stringify({
...a0,
schemaVersion: 2
}));
return `if (window.location.origin === ${JSON.stringify(a1)}) { window.${c4337_0} = JSON.parse(${r10}); } true;`;
}
export function parseIncodeWebViewMessage(a0) {
if (a0 == null) {
return null;
}
const r5 = typeof a0 === "string" ? JSON.parse(a0) : a0;
if (r5?.eventType === eventType2) {
return typeof r5.interviewId === "string" ? r5.interviewId.length !== 0 ? {
kind: "capture_complete",
interviewId: r5.interviewId
} : null : null;
}
if (r5?.eventType === eventType3) {
return typeof r5.previousInterviewId === "string" ? r5.previousInterviewId.length !== 0 ? {
kind: "fallback_request",
previousInterviewId: r5.previousInterviewId
} : null : null;
}
if (r5?.eventType !== eventType) {
return null;
}
const status = r5.status;
return status !== c4337_5.COMPLETED && status !== c4337_5.CANCELLED ? status === c4337_5.ERROR ? {
kind: "result",
status
} : null : {
kind: "result",
status
};
}
export function postIncodeResult(a0) {
const r8 = JSON.stringify({
eventType,
status: a0
});
const ReactNativeWebView = window.ReactNativeWebView;
if (ReactNativeWebView != null) {
ReactNativeWebView.postMessage(r8);
}
}
export function postIncodeCaptureComplete(a0) {
const r8 = JSON.stringify({
eventType: eventType2,
interviewId: a0
});
const ReactNativeWebView = window.ReactNativeWebView;
if (ReactNativeWebView != null) {
ReactNativeWebView.postMessage(r8);
}
}
export function postIncodeFallbackRequest(a0) {
const r8 = JSON.stringify({
eventType: eventType3,
previousInterviewId: a0
});
const ReactNativeWebView = window.ReactNativeWebView;
if (ReactNativeWebView != null) {
ReactNativeWebView.postMessage(r8);
}
}
export function buildIncodeFallbackSessionInjection(a0) {
return `(function(){var detail=JSON.parse(${JSON.stringify(JSON.stringify(a0))});var key=${JSON.stringify(c4337_4)};var n=0;var apply=function(){var cb=window[key];if(typeof cb==="function"){cb(detail);return true;}return false;};if(apply()){return;}var id=setInterval(function(){n+=1;if(apply()||n>40){clearInterval(id);}},50);})();true;`;
}
@@ -0,0 +1,89 @@
// Metro module 16131 (f16132).
import ChannelStore from "../../stores/ChannelStore";
import MessageStore from "../../stores/MessageStore";
import SelectedChannelStore from "../../stores/SelectedChannelStore";
import UserStore, { transformUser } from "../../stores/UserStore";
import { ChannelTypes, MAX_MESSAGES_PER_CHANNEL } from "../../Constants";
import { SafetyToastType } from "../safety_common/Constants";
import Logger from "../debug/Logger";
import MessageActionCreators from "../../actions/MessageActionCreators";
import { preloadForumThreads } from "../forums/ForumPostDataLoader";
import AutomaticLifecycleManager from "../../lib/AutomaticLifecycleManager";
import { AgeVerificationStatusUkAndAusOnly } from "../../flow/Server";
import { isFeatureAgeGated } from "../regional_feature_config/RegionalFeatureConfigUtils";
import { AgeGatedFeature } from "../../_bundle/Module5013";
import ChannelMessages from "../../lib/ChannelMessages";
let c11552_10;
const handleMessageCreate = function handleMessageCreate(a0) {
MessageStore.getMessage(a0.channelId, a0.message.id);
};
SafetyToastType;
c11552_10 = new Logger("AgeVerificationManager");
class AgeVerificationManager extends AutomaticLifecycleManager {
constructor() {
super(...arguments);
const _this = this;
this._previousAgeVerificationStatus = null;
this.handlePostConnectionOpen = () => {
let _previousAgeVerificationStatus = UserStore.getCurrentUser()?.ageVerificationStatus;
if (_previousAgeVerificationStatus == null) {
_previousAgeVerificationStatus = null;
}
_this._previousAgeVerificationStatus = _previousAgeVerificationStatus;
};
this.handleCurrentUserUpdate = ({ user }) => {
let channelId, c28233_1;
channelId = void 0;
c28233_1 = void 0;
let ageVerificationStatus = transformUser(user).ageVerificationStatus;
if (ageVerificationStatus == null) {
ageVerificationStatus = null;
}
const r17 = _this._previousAgeVerificationStatus !== ageVerificationStatus && ageVerificationStatus === AgeVerificationStatusUkAndAusOnly.VERIFIED_ADULT && isFeatureAgeGated(AgeGatedFeature.AGE_GATED_SPACES);
try {
try {
if (r17) {
const channelId2 = SelectedChannelStore.getChannelId();
channelId = channelId2;
c28233_1 = false;
ChannelMessages.forEach(({ channelId: channelId2 }) => {
if (ChannelStore.getChannel(channelId2)?.nsfw) {
ChannelMessages.clear(channelId2);
if (channelId2 === channelId) {
c28233_1 = true;
}
}
});
if (c28233_1 && channelId2 != null) {
(function handleLoadChannelMessages(a0) {
MessageActionCreators.fetchMessages({
channelId: a0,
limit: MAX_MESSAGES_PER_CHANNEL
});
})(channelId2);
(function handleLoadForumPosts(a0) {
const channel = ChannelStore.getChannel(a0);
if (!(channel?.type !== ChannelTypes.GUILD_FORUM && channel?.type !== ChannelTypes.GUILD_MEDIA)) {
preloadForumThreads(channel);
}
})(channelId2);
}
}
} catch ($e) {
c11552_10.warn("Error clearing cache and refetching messages", $e);
}
} catch (r54) {
_this._previousAgeVerificationStatus = ageVerificationStatus;
throw r54;
}
_this._previousAgeVerificationStatus = ageVerificationStatus;
};
this.actions = {
POST_CONNECTION_OPEN: this.handlePostConnectionOpen,
CURRENT_USER_UPDATE: this.handleCurrentUserUpdate,
MESSAGE_CREATE: handleMessageCreate
};
}
}
const ageVerificationManager = new AgeVerificationManager();
export default ageVerificationManager;
@@ -0,0 +1,35 @@
// Metro module 6780 (f6781).
import * as _AgeVerificationConstants from "./AgeVerificationConstants";
import { Endpoints } from "../../Constants";
import { AgeAssuranceMethod, AgeAssuranceVendor } from "../../_bundle/Module1892";
import { HTTP } from "../../_bundle/sendRequest";
const { VerificationMethod, VerificationVendorName } = _AgeVerificationConstants;
const r23 = {};
r23[AgeAssuranceMethod.FACIAL_AGE_ESTIMATION] = VerificationMethod.FACIAL_AGE_ESTIMATION;
r23[AgeAssuranceMethod.ID_SELFIE_MATCH] = VerificationMethod.ID_VERIFICATION;
const r33 = {};
r33[AgeAssuranceVendor.K_ID] = VerificationVendorName.K_ID;
r33[AgeAssuranceVendor.INCODE] = VerificationVendorName.INCODE;
r33[AgeAssuranceVendor.GOOGLE_WALLET] = VerificationVendorName.GOOGLE_WALLET;
export { r23 as V2_METHOD_TO_VERIFICATION_METHOD };
export { r33 as V2_VENDOR_TO_VERIFICATION_VENDOR };
export async function fetchAgeVerificationMethodsV2() {
let c26001_0;
c26001_0 = void 0;
return (await HTTP.get({
url: Endpoints.AGE_VERIFICATION_METHODS_V2,
rejectWithError: true
})).body.methods.map((a0) => {
let provided_by = a0.provided_by;
if (provided_by == null) {
provided_by = null;
}
return {
method: a0.method,
vendor: a0.vendor,
title: a0.title,
description: a0.description,
providedBy: provided_by
};
});
}
@@ -0,0 +1,115 @@
// Metro module 6779 (f6780).
import UserStore from "../../stores/UserStore";
import { Storage } from "../../_bundle/Module595";
import Module589 from "../../_bundle/Module589";
import Dispatcher from "../../Dispatcher";
let c4358_3 = 86400000;
let methods2 = null;
let methods3 = null;
let c4358_6 = false;
const status = "unchecked";
let reactiveCheckMissAt = null;
class AgeVerificationStore extends Module589.Store {
static displayName = "AgeVerificationStore";
initialize() {
this.waitFor(UserStore);
}
get loading() {
return c4358_6;
}
get methods() {
return methods2;
}
get methodsV2() {
return methods3;
}
getReactiveCheckStatus() {
return status;
}
getReactiveCheckMiss() {
return status === "miss" && reactiveCheckMissAt != null && Date.now() - reactiveCheckMissAt < c4358_3;
}
getReactiveCheckPassed() {
return status === "passed";
}
shouldCallReactiveCheck() {
return status !== "passed" && (status !== "suppress" && !(status === "miss" && reactiveCheckMissAt != null && Date.now() - reactiveCheckMissAt < c4358_3));
}
}
const ageVerificationStore = new AgeVerificationStore(Dispatcher, {
AGE_VERIFICATION_METHODS_LOAD_START: function handleAgeVerificationMethodsLoadStart() {
c4358_6 = true;
},
AGE_VERIFICATION_METHODS_LOAD_SUCCESS: function handleAgeVerificationMethodsLoadSuccess(a0) {
methods2 = a0.methods;
c4358_6 = false;
},
AGE_VERIFICATION_METHODS_LOAD_FAILURE: function handleAgeVerificationMethodsLoadFailure() {
c4358_6 = false;
},
AGE_VERIFICATION_METHODS_V2_LOAD_SUCCESS: function handleAgeVerificationMethodsV2LoadSuccess(a0) {
methods3 = a0.methods;
},
INITIATE_AGE_VERIFICATION: function invalidateAgeVerificationMethodsV2() {
methods3 = null;
},
CONNECTION_OPEN: function handleConnectionOpen() {
const id = UserStore.getCurrentUser()?.id;
const r7 = id == null ? null : `AgeVerificationStore_${id}`;
L20: {
if (r7 != null) {
const r22 = Storage.get(r7);
if (r22 != null && typeof r22 === "object") {
let reactiveCheckStatus = r22.reactiveCheckStatus;
if (reactiveCheckStatus == null) {
reactiveCheckStatus = "unchecked";
}
let reactiveCheckMissAt2 = r22.reactiveCheckMissAt;
if (reactiveCheckMissAt2 == null) {
reactiveCheckMissAt2 = null;
}
if (reactiveCheckStatus === "miss" && reactiveCheckMissAt2 != null && Date.now() - reactiveCheckMissAt2 >= c4358_3) {
status = "unchecked";
reactiveCheckMissAt = null;
break L20;
}
status = reactiveCheckStatus;
reactiveCheckMissAt = reactiveCheckMissAt2;
break L20;
}
status = "unchecked";
reactiveCheckMissAt = null;
} else {
status = "unchecked";
reactiveCheckMissAt = null;
}
}
methods3 = null;
},
AGE_VERIFICATION_CHECK_RESULT_SET: function handleReactiveCheckResultSet(a0) {
status = a0.status;
reactiveCheckMissAt = status === "miss" ? Date.now() : null;
const id = UserStore.getCurrentUser()?.id;
const r6 = id == null ? null : `AgeVerificationStore_${id}`;
if (r6 != null) {
Storage.set(r6, {
reactiveCheckStatus: status,
reactiveCheckMissAt
});
}
},
AGE_VERIFICATION_RESET: function handleAgeVerificationReset() {
status = "suppress";
reactiveCheckMissAt = null;
const id = UserStore.getCurrentUser()?.id;
const r7 = id == null ? null : `AgeVerificationStore_${id}`;
if (r7 != null) {
Storage.set(r7, {
reactiveCheckStatus: status,
reactiveCheckMissAt
});
}
methods3 = null;
}
});
export default ageVerificationStore;
@@ -0,0 +1,142 @@
// Metro module 6754 (f6755).
import AuthenticationStore from "../../stores/AuthenticationStore";
import { VerificationVendorName } from "./AgeVerificationConstants";
import { Endpoints } from "../../Constants";
import { isCurrentUserSuspended } from "../safety_hub/SafetyHubUtils";
import { HTTP } from "../../_bundle/sendRequest";
import Dispatcher from "../../Dispatcher";
let initiateAgeVerification, initiateSuspendedUserAgeVerification, fetchAgeVerificationMethods, fetchAgeVerificationMethodsSuspendedUser;
const requestAgeVerification = async function requestAgeVerification(c25985_0) {
let r82;
let c25985_2;
let c29836_0, c29836_1, c29836_2;
L14: {
c25985_2 = void 0;
c29836_0 = void 0;
c29836_1 = void 0;
c29836_2 = void 0;
c29836_0 = c25985_0.method;
c29836_1 = c25985_0.classificationId;
c29836_2 = c25985_0.vendor;
await void 0;
if (isCurrentUserSuspended()) {
r82 = await (0, initiateSuspendedUserAgeVerification)({
classificationId: c29836_1,
method: c29836_0
});
break L14;
}
return await (0, initiateAgeVerification)(c29836_0, c29836_2);
}
return r82;
};
initiateAgeVerification = async function initiateAgeVerification(method2, vendor) {
return (await HTTP.post({
url: Endpoints.VERIFY_AGE,
body: {
method: method2,
vendor
},
rejectWithError: true
})).body;
};
initiateSuspendedUserAgeVerification = async function initiateSuspendedUserAgeVerification(c25988_0) {
let c25988_2;
c25988_2 = void 0;
let c29838_0 = c25988_0.classificationId;
let c29838_1 = c25988_0.method;
await void 0;
let c29838_2 = AuthenticationStore.getSuspendedUserToken();
return (await HTTP.post({
url: Endpoints.SAFETY_HUB_REQUEST_SUSPENDED_AGE_VERIFICATION,
body: {
token: c29838_2,
from_classification_id: c29838_0,
method: c29838_1
},
rejectWithError: true
})).body;
};
fetchAgeVerificationMethods = function fetchAgeVerificationMethods() {
return HTTP.get({
url: Endpoints.AGE_VERIFICATION_METHODS,
rejectWithError: true
});
};
fetchAgeVerificationMethodsSuspendedUser = function fetchAgeVerificationMethodsSuspendedUser() {
return HTTP.post({
url: Endpoints.SAFETY_HUB_GET_SUSPENDED_AGE_VERIFICATION_METHODS,
rejectWithError: true,
body: {
token: AuthenticationStore.getSuspendedUserToken()
}
});
};
export { requestAgeVerification };
export async function requestIncodeMethodSession(method) {
const incode_parameters2 = (await requestAgeVerification({
method,
vendor: VerificationVendorName.INCODE
})).incode_parameters;
let incode_parameters = incode_parameters2;
if (incode_parameters2 == null) {
incode_parameters = {};
}
let c29837_0 = incode_parameters;
let c29837_1 = c29837_0.api_url;
let c29837_2 = c29837_0.session_token;
let c29837_3 = c29837_0.consent_id;
let c29837_4 = c29837_0.interview_id;
return c29837_1 == null ? null : c29837_2 == null ? null : c29837_3 == null ? null : c29837_4 == null ? null : {
apiUrl: c29837_1,
sessionToken: c29837_2,
consentId: c29837_3,
interviewId: c29837_4
};
}
export { initiateAgeVerification };
export { initiateSuspendedUserAgeVerification };
export async function registerIncodeInterview(interview_id) {
await HTTP.post({
url: Endpoints.REGISTER_INCODE_INTERVIEW,
body: {
interview_id
},
rejectWithError: true
});
}
export async function requestIncodeSessionBootstrap(c25990_0) {
let c25990_2;
c25990_2 = void 0;
let r27 = c25990_0;
if (r27 === void 0) {
r27 = {};
}
let c29839_0 = r27;
await void 0;
return (await HTTP.post({
url: Endpoints.CREATE_INCODE_SESSION,
body: c29839_0.previousInterviewId != null ? {
previous_interview_id: c29839_0.previousInterviewId
} : void 0,
rejectWithError: true
})).body;
}
export async function getAgeVerificationMethods() {
Dispatcher.dispatch({
type: "AGE_VERIFICATION_METHODS_LOAD_START"
});
const r34 = isCurrentUserSuspended() ? fetchAgeVerificationMethodsSuspendedUser() : fetchAgeVerificationMethods();
return await (r34 == null ? void 0 : r34.then((result) => {
Dispatcher.dispatch({
type: "AGE_VERIFICATION_METHODS_LOAD_SUCCESS",
methods: result.body.methods
});
}).catch(() => {
Dispatcher.dispatch({
type: "AGE_VERIFICATION_METHODS_LOAD_FAILURE"
});
}));
}
export { fetchAgeVerificationMethods };
export { fetchAgeVerificationMethodsSuspendedUser };
@@ -0,0 +1,323 @@
// Metro module 4405 (f4406).
import _slicedToArray from "../../_bundle/_slicedToArray";
import { useState, useRef, useCallback, useEffect } from "react";
import FamilyCenterPendingConnectionStore from "../parent_tools/FamilyCenterPendingConnectionStore";
import RegionalFeatureConfigStore from "../regional_feature_config/RegionalFeatureConfigStore";
import AuthenticationStore from "../../stores/AuthenticationStore";
import MessageStore from "../../stores/MessageStore";
import UserStore from "../../stores/UserStore";
import AgeVerificationStore from "./AgeVerificationStore";
import { FULLSCREEN_AGE_VERIFICATION_ENTRY_POINTS } from "./AgeVerificationConstants";
import { MessageEmbedTypes } from "../../Constants";
import { AgeGateSource, REACTIVE_CHECK_AGE_GATE_SOURCES } from "../age_gate/AgeGateConstants";
import { SafetyToastType } from "../safety_common/Constants";
import { AgeVerificationModalEntryPoint } from "./AgeVerificationAnalyticsUtils";
import { AgeGatedFeature } from "../../_bundle/Module5013";
import { useIsFeatureAgeGated } from "../regional_feature_config/RegionalFeatureConfigUtils";
import { AgeVerificationStatusUkAndAusOnly } from "../../flow/Server";
import { useStateFromStores } from "../../_bundle/Module589";
import { FamilyCenterConnectionPrereqExperiment } from "../parent_tools/FamilyCenterConnectionPrereqExperiment";
import Dispatcher from "../../Dispatcher";
import { requestAgeVerification } from "./AgeVerificationURLActionCreators";
import AgeVerificationActionCreators_native from "./AgeVerificationActionCreators.native";
import SafetyToastsActionCreators_native from "../safety_common/SafetyToastsActionCreators.native";
import usePrevious from "../../hooks/usePrevious";
import { intl, t } from "../../intl/index.native";
import AgeAssurance_messages from "./AgeAssurance.messages";
import { fetchReactiveCheckResult } from "./ReactiveCheckActionCreators";
let shouldCallReactiveCheck, c2635_16, c2635_17, c2635_18, c2635_19;
let $mk74512 = function() {
return () => UserStore.getCurrentUser()?.ageVerificationStatus === AgeVerificationStatusUkAndAusOnly.INFERRED_ADULT;
}, $mk74513 = function() {
return () => UserStore.getCurrentUser();
};
let env2635 = {};
export function useShouldCallReactiveCheck() {
const stateFromStores = useStateFromStores([UserStore], $mk74513());
const r18 = stateFromStores?.ageVerificationStatus !== AgeVerificationStatusUkAndAusOnly.UNVERIFIED && stateFromStores?.ageVerificationStatus !== AgeVerificationStatusUkAndAusOnly.CLIENT_ONLY_PENDING;
let c14234_0 = r18;
const isFeatureAgeGated = useIsFeatureAgeGated(AgeGatedFeature.REACTIVE_CHECK);
return useStateFromStores([AgeVerificationStore], () => {
let r1 = !c14234_0;
if (!c14234_0) {
let r5 = isFeatureAgeGated;
if (isFeatureAgeGated) {
r5 = AgeVerificationStore.shouldCallReactiveCheck();
}
r1 = r5;
}
return r1;
}, [r18, isFeatureAgeGated]);
}
shouldCallReactiveCheck = function shouldCallReactiveCheck() {
const currentUser = UserStore.getCurrentUser();
const r14 = currentUser?.ageVerificationStatus !== AgeVerificationStatusUkAndAusOnly.UNVERIFIED && currentUser?.ageVerificationStatus !== AgeVerificationStatusUkAndAusOnly.CLIENT_ONLY_PENDING;
return r14 ? !r14 : RegionalFeatureConfigStore.isFeatureAgeGated(AgeGatedFeature.REACTIVE_CHECK) && AgeVerificationStore.shouldCallReactiveCheck();
};
c2635_16 = new Set([AgeVerificationModalEntryPoint.STAGE_CHANNEL_AGE_VERIFICATION_PROMPT, AgeVerificationModalEntryPoint.START_STAGE_PROMPT, AgeVerificationModalEntryPoint.STAGE_CHANNEL_RAISE_HAND]);
c2635_17 = new Set([AgeGateSource.NSFW_SERVER, AgeGateSource.NSFW_SERVER_INVITE, AgeGateSource.NSFW_SERVER_INVITE_EMBED, AgeGateSource.LARGE_GUILD, AgeGateSource.JOIN_LARGE_GUILD_UNDERAGE, AgeGateSource.ACCESS_LARGE_GUILD_UNDERAGE]);
c2635_18 = {
CTAS: "ctas",
CONTENT_TYPE: "content_type"
};
c2635_19 = {
RETRY: "retry",
CONNECT_TO_TEEN: "connect_to_teen"
};
const r87 = {
VERIFIED_ADULT: "verified_adult",
VERIFIED_TEEN: "verified_teen",
ERROR: "error"
};
export function ageGateSourceHasLightboxBackdrop(a0) {
return c2635_17.has(a0);
}
export function shouldShowTiggerPawtect() {
const ageVerificationStatus = UserStore.getCurrentUser()?.ageVerificationStatus;
let r16 = ageVerificationStatus !== AgeVerificationStatusUkAndAusOnly.VERIFIED_ADULT;
if (r16) {
const isFeatureAgeGated2 = RegionalFeatureConfigStore.isFeatureAgeGated(AgeGatedFeature.REACTIVE_CHECK);
r16 = isFeatureAgeGated2 ? ageVerificationStatus !== AgeVerificationStatusUkAndAusOnly.INFERRED_ADULT : !isFeatureAgeGated2;
}
return r16;
}
export function useShouldShowTiggerPawtect() {
const stateFromStores = useStateFromStores([UserStore], () => UserStore.getCurrentUser());
const r19 = useIsFeatureAgeGated(AgeGatedFeature.REACTIVE_CHECK) && stateFromStores?.ageVerificationStatus === AgeVerificationStatusUkAndAusOnly.INFERRED_ADULT;
return stateFromStores?.ageVerificationStatus !== AgeVerificationStatusUkAndAusOnly.VERIFIED_ADULT && !r19;
}
export function isVerifiedTeen() {
return UserStore.getCurrentUser()?.ageVerificationStatus === AgeVerificationStatusUkAndAusOnly.VERIFIED_TEEN;
}
export function useIsVerifiedTeen() {
return useStateFromStores([UserStore], () => UserStore.getCurrentUser())?.ageVerificationStatus === AgeVerificationStatusUkAndAusOnly.VERIFIED_TEEN;
}
export function isVerifiedAdult() {
const ageVerificationStatus = UserStore.getCurrentUser()?.ageVerificationStatus;
return ageVerificationStatus === AgeVerificationStatusUkAndAusOnly.VERIFIED_ADULT || RegionalFeatureConfigStore.isFeatureAgeGated(AgeGatedFeature.REACTIVE_CHECK) && ageVerificationStatus === AgeVerificationStatusUkAndAusOnly.INFERRED_ADULT;
}
export function useIsVerifiedAdult() {
const stateFromStores = useStateFromStores([UserStore], () => UserStore.getCurrentUser());
const r19 = useIsFeatureAgeGated(AgeGatedFeature.REACTIVE_CHECK) && stateFromStores?.ageVerificationStatus === AgeVerificationStatusUkAndAusOnly.INFERRED_ADULT;
return stateFromStores?.ageVerificationStatus === AgeVerificationStatusUkAndAusOnly.VERIFIED_ADULT || r19;
}
export function useIsExplicitlyVerifiedAdult() {
return useStateFromStores([UserStore], () => UserStore.getCurrentUser())?.ageVerificationStatus === AgeVerificationStatusUkAndAusOnly.VERIFIED_ADULT;
}
export function isAssignedByDiscord() {
return UserStore.getCurrentUser()?.ageVerificationStatus === AgeVerificationStatusUkAndAusOnly.INFERRED_ADULT;
}
export function useIsAssignedByDiscord() {
return useStateFromStores([UserStore], $mk74512());
}
export function useShowAssignedAgeGroupSettings() {
const stateFromStores = useStateFromStores([UserStore], $mk74512());
return useIsFeatureAgeGated(AgeGatedFeature.REACTIVE_CHECK) && stateFromStores;
}
export { c2635_18 as AgeVerificationSystemNotificationEmbedKeys };
export { c2635_19 as AgeVerificationSystemNotificationCtaTypes };
export { r87 as AgeVerificationSystemNotificationContentType };
export function isAgeVerificationMessageWithRetryCta(a0, a1) {
const message = MessageStore.getMessage(a0, a1);
if (message != null && message.embeds != null && message.embeds.length !== 0 && message.embeds[0].fields != null && message.embeds[0].type === MessageEmbedTypes.AGE_VERIFICATION_SYSTEM_NOTIFICATION) {
const r24 = message.embeds[0].fields.find((field) => field.rawName === c2635_18.CTAS);
return r24 == null ? void 0 : r24.rawValue.split(",").includes(c2635_19.RETRY);
}
return false;
}
export function isAgeVerificationMessageWithConnectToTeenCta(a0, a1) {
if (FamilyCenterPendingConnectionStore.getPendingConnection() == null) {
return false;
}
const message = MessageStore.getMessage(a0, a1);
if (message != null && message.embeds != null && message.embeds.length !== 0 && message.embeds[0].fields != null && message.embeds[0].type === MessageEmbedTypes.AGE_VERIFICATION_SYSTEM_NOTIFICATION) {
const r28 = message.embeds[0].fields.find((field) => field.rawName === c2635_18.CTAS);
return !((r28 == null ? void 0 : r28.rawValue.split(",").includes(c2635_19.CONNECT_TO_TEEN)) !== true) && FamilyCenterConnectionPrereqExperiment.getConfig({
location: "isAgeVerificationMessageWithConnectToTeenCta"
}).enabled;
}
return false;
}
export function isAgeVerified() {
const currentUser = UserStore.getCurrentUser();
return currentUser?.ageVerificationStatus !== AgeVerificationStatusUkAndAusOnly.UNVERIFIED && currentUser?.ageVerificationStatus !== AgeVerificationStatusUkAndAusOnly.CLIENT_ONLY_PENDING;
}
export function useIsAgeVerified() {
const stateFromStores = useStateFromStores([UserStore], $mk74513());
return stateFromStores?.ageVerificationStatus !== AgeVerificationStatusUkAndAusOnly.UNVERIFIED && stateFromStores?.ageVerificationStatus !== AgeVerificationStatusUkAndAusOnly.CLIENT_ONLY_PENDING;
}
export function useInitiateAgeVerification(a0) {
let env14235 = {
$parent: env2635
};
const onComplete = a0.onComplete;
env14235[0] = onComplete;
const entryPoint = a0.entryPoint;
env14235[1] = entryPoint;
let shouldShowExpressiveModal = a0.shouldShowExpressiveModal;
if (shouldShowExpressiveModal === void 0) {
shouldShowExpressiveModal = false;
}
env14235[2] = shouldShowExpressiveModal;
let classificationId2 = a0.classificationId;
if (classificationId2 === void 0) {
classificationId2 = null;
}
env14235[3] = classificationId2;
env14235[4] = void 0;
env14235[5] = void 0;
env14235[6] = void 0;
const r17 = _slicedToArray(useState(false), 2);
const loading = r17[0];
env14235[4] = r17[1];
const ageVerificationStatus = useStateFromStores([UserStore], () => UserStore.getCurrentUser())?.ageVerificationStatus;
let c14236_0;
const current = useRef(ageVerificationStatus).current;
env14235[5] = current;
const callback = useCallback(() => {
Dispatcher.dispatch({
type: "CLOSE_AGE_VERIFICATION_MODAL",
status: env14235[5]
});
}, [current]);
env14235[6] = callback;
c14236_0 = void 0;
c14236_0 = async (method, vendor) => {
let classificationId, c29335_5;
let c29335_6 = 0;
let c31344_0;
L14: {
try {
c31344_0 = void 0;
(0, env14235[4])(true);
c29335_6 = 2;
Dispatcher.dispatch({
type: "INITIATE_AGE_VERIFICATION"
});
classificationId = env14235[3];
if (classificationId == null) {
classificationId = void 0;
}
c31344_0 = await requestAgeVerification({
method,
classificationId,
vendor
});
if (AgeVerificationActionCreators_native.showAgeVerification({
webviewUrl: c31344_0.verification_webview_url,
verificationRequestId: c31344_0.verification_request_id,
verificationVendorName: c31344_0.verification_vendor_name,
incodeParameters: c31344_0.incode_parameters,
onComplete: env14235[0],
onClose: env14235[6],
onCancel: env14235[6],
entryPoint: env14235[1],
shouldShowExpressiveModal: env14235[2]
}) === false) {
SafetyToastsActionCreators_native.showFailedToast(SafetyToastType.TIGGER_PAWTECT_ERROR);
(0, env14235[6])();
}
c29335_6 = 1;
c29335_6 = 0;
(0, env14235[4])(false);
} catch ($e) {
const r29 = $e;
let r7 = r29;
c29335_5 = r29;
let r30 = c29335_6;
if (r30 !== 0) {
while (true) {
if (r30 === 1) {
try {
const r136 = c29335_5;
c29335_6 = 0;
(0, env14235[4])(false);
throw r136;
} catch (r134) {
r7 = r134;
c29335_5 = r134;
r30 = c29335_6;
if (r30 === 0) {
break;
}
}
} else {
try {
c29335_6 = 1;
SafetyToastsActionCreators_native.showFailedToast(SafetyToastType.TIGGER_PAWTECT_ERROR);
(0, env14235[6])();
c29335_6 = 0;
(0, env14235[4])(false);
break L14;
} catch (r112) {
r7 = r112;
c29335_5 = r112;
r30 = c29335_6;
if (r30 === 0) {
break;
}
}
}
}
}
throw r7;
}
}
};
return {
loading,
initiateAgeVerification: useCallback(function() {
return c14236_0.apply(this, arguments);
}, [onComplete, callback, shouldShowExpressiveModal, classificationId2, entryPoint])
};
}
export function useWatchAgeVerificationStatusChange(a0) {
let c14237_1, c14237_2;
const stateFromStores = useStateFromStores([UserStore], () => UserStore.getCurrentUser()?.ageVerificationStatus);
const previous = usePrevious(stateFromStores);
const stateFromStores2 = useStateFromStores([AuthenticationStore], () => AuthenticationStore.getSuspendedUserToken() != null);
const stateFromStores3 = useStateFromStores([AuthenticationStore], () => AuthenticationStore.isAuthenticated());
const r0 = previous != null && stateFromStores != null && previous !== stateFromStores;
c14237_1 = r0;
const r33 = stateFromStores2 ? !stateFromStores2 : !stateFromStores3;
c14237_2 = r33;
useEffect(() => {
if (c14237_1 || c14237_2) {
a0();
}
}, [a0, r0, r33]);
}
export function isFullscreenAgeVerificationEntryPoint(a0) {
return a0 != null && FULLSCREEN_AGE_VERIFICATION_ENTRY_POINTS.has(a0);
}
export function getAgeVerificationGetStartedTitle(a0) {
return c2635_16.has(a0) ? intl.string(t.lSWVTM) : intl.string(t.xYXsr6);
}
export function getAgeVerificationGetStartedSubtitle(a0, a1, r2 = false) {
return c2635_16.has(a0) ? intl.string(t["S/xS/w"]) : r2 ? intl.string(AgeAssurance_messages.h7qzoa) : a1 != null ? intl.format(AgeAssurance_messages.RpMIT0, {
handleOnHelpUrlHook: a1
}) : intl.string(t.HxS3oQ);
}
export function useMaybePerformReactiveCheckForSource(a0) {
const shouldCallReactiveCheck2 = useShouldCallReactiveCheck();
let c14238_1 = shouldCallReactiveCheck2;
useEffect(() => {
if (c14238_1 && REACTIVE_CHECK_AGE_GATE_SOURCES.has(a0)) {
fetchReactiveCheckResult();
}
}, [shouldCallReactiveCheck2, a0]);
}
export { shouldCallReactiveCheck };
export async function maybePerformReactiveCheck() {
let reactiveCheckResult;
L11: {
const shouldCallReactiveCheck2 = shouldCallReactiveCheck();
const r12 = null;
if (shouldCallReactiveCheck2) {
reactiveCheckResult = await fetchReactiveCheckResult();
break L11;
}
return r12;
}
return reactiveCheckResult;
}
@@ -0,0 +1,24 @@
// Metro module 6770 (f6771).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
kind: "user",
name: "2026-07-expressive-modal-v2",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export function useIsExpressiveModalV2Enabled(a0) {
return apexExperiment.useConfig({
location: a0
}).enabled;
}
export function isExpressiveModalV2Enabled(a0) {
return apexExperiment.getConfig({
location: a0
}).enabled;
}
@@ -0,0 +1,63 @@
// Metro module 6781 (f6782).
import { Endpoints } from "../../Constants";
import { HTTP } from "../../_bundle/sendRequest";
import Module6782 from "../../_bundle/Module6782";
export async function requestGoogleWalletVerification() {
return (await HTTP.post({
url: Endpoints.GOOGLE_WALLET_REQUEST,
body: {},
rejectWithError: true,
failImmediatelyWhenRateLimited: true
})).body;
}
export async function verifyGoogleWalletCredential(credential_json) {
await HTTP.post({
url: Endpoints.GOOGLE_WALLET_VERIFY,
body: {
credential_json
},
rejectWithError: true,
failImmediatelyWhenRateLimited: true
});
}
export async function checkGoogleWalletAvailable() {
let r16, isAvailable;
let c26004_2 = 0;
L12: {
try {
c26004_2 = 1;
r16 = Module6782 != null;
if (r16) {
isAvailable = await Module6782.isAvailable();
c26004_2 = 0;
break L12;
}
c26004_2 = 0;
} catch ($e) {
let r23 = $e;
if (c26004_2 !== 0) {
while (true) {
try {
c26004_2 = 0;
} catch ($e) {
r23 = $e;
if (c26004_2 === 0) {
break;
}
continue;
}
return false;
}
}
throw r23;
}
return r16;
}
return isAvailable;
}
export async function getGoogleWalletCredential(c26005_0) {
if (Module6782 == null) {
throw new Error("Digital credential module is not available");
}
return await Module6782.getCredential(c26005_0);
}
@@ -0,0 +1,24 @@
// Metro module 7627 (f7628).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
kind: "user",
name: "2026-03-age-verification-google-wallet",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export function useIsGoogleWalletEnabled(a0) {
return apexExperiment.useConfig({
location: a0
}).enabled;
}
export function isGoogleWalletEnabled(a0) {
return apexExperiment.getConfig({
location: a0
}).enabled;
}
@@ -0,0 +1,24 @@
// Metro module 7620 (f7621).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
kind: "user",
name: "2025-11-hide-manual-link",
defaultConfig: {
isHidden: false
},
variations: {
1: {
isHidden: true
}
}
});
export function useIsManualAgeVerificationHidden(a0) {
return apexExperiment.useConfig({
location: a0
}).isHidden;
}
export function isManualAgeVerificationHidden(a0) {
return apexExperiment.getConfig({
location: a0
}).isHidden;
}
@@ -0,0 +1,52 @@
// Metro module 12821 (f12822).
import { Endpoints } from "../../Constants";
import { HTTP } from "../../_bundle/sendRequest";
import Dispatcher from "../../Dispatcher";
export async function fetchReactiveCheckResult() {
let status;
let c27370_3 = 0;
let c30584_0;
try {
c30584_0 = void 0;
c27370_3 = 1;
c30584_0 = (await HTTP.get({
url: Endpoints.AGE_VERIFICATION_REACTIVE_CHECK,
rejectWithError: true
})).body;
Dispatcher.dispatch({
type: "AGE_VERIFICATION_CHECK_RESULT_SET",
status: c30584_0.status
});
status = c30584_0.status;
c27370_3 = 0;
} catch ($e) {
let r8 = $e;
if (c27370_3 !== 0) {
while (true) {
try {
c27370_3 = 0;
} catch ($e) {
r8 = $e;
if (c27370_3 === 0) {
break;
}
continue;
}
return null;
}
}
throw r8;
}
return status;
}
export async function resetAgeVerification() {
let c27371_0;
c27371_0 = void 0;
await HTTP.post({
url: Endpoints.AGE_VERIFICATION_RESET,
rejectWithError: true
});
Dispatcher.dispatch({
type: "AGE_VERIFICATION_RESET"
});
}
@@ -0,0 +1,106 @@
// Metro module 7626 (f7627).
import { useState, useEffect, useMemo } from "react";
import AgeVerificationStore from "../AgeVerificationStore";
import { VERIFICATION_METHOD_TITLE_MAP, VerificationMethod } from "../AgeVerificationConstants";
import { useStateFromStoresObject } from "../../../_bundle/Module589";
import { useInitiateAgeVerification } from "../AgeVerificationUtils";
import { AgeVerificationModalEntryPoint, AgeVerificationModalVersion, AgeVerificationModalCta, trackAgeVerificationModalClicked } from "../AgeVerificationAnalyticsUtils";
import { checkGoogleWalletAvailable } from "../GoogleWalletActionCreators.native";
import MonitoringAgent from "../../monitoring/MonitoringAgent";
import { MetricEvents } from "../../../_bundle/Module5872";
import { isGoogleWalletEnabled } from "../GoogleWalletExperiment";
import { getAgeVerificationMethods } from "../AgeVerificationURLActionCreators";
import { intl } from "../../../intl/index.native";
export default function useAgeVerificationMethods({ onClose, classificationId, onGoogleWalletSelect }) {
let methods, initiateAgeVerification, state, setState;
methods = void 0;
initiateAgeVerification = void 0;
state = void 0;
setState = void 0;
const stateFromStoresObject = useStateFromStoresObject([AgeVerificationStore], () => ({
methods: AgeVerificationStore.methods,
loading: AgeVerificationStore.loading
}));
methods = stateFromStoresObject.methods;
const loading = stateFromStoresObject.loading;
initiateAgeVerification = useInitiateAgeVerification({
onComplete: onClose,
entryPoint: AgeVerificationModalEntryPoint.EXPRESSIVE_GET_STARTED,
shouldShowExpressiveModal: true,
classificationId
}).initiateAgeVerification;
[state, setState] = useState(false);
useEffect(() => {
let c26011_0 = false;
checkGoogleWalletAvailable().then((result) => {
if (!c26011_0) {
let r9 = result;
MonitoringAgent.increment({
name: MetricEvents.GOOGLE_WALLET_AVAILABILITY_CHECK,
tags: [`available:${result}`]
});
if (result) {
r9 = isGoogleWalletEnabled("age_verification_methods");
}
setState(r9);
}
});
return () => {
c26011_0 = true;
};
}, []);
useEffect(() => {
if (methods == null) {
getAgeVerificationMethods();
}
}, [methods]);
return {
ageVerificationMethods: useMemo(() => {
let r6 = methods == null ? void 0 : methods.filter((method) => method !== VerificationMethod.GOOGLE_WALLET).map((item) => {
const r11 = VERIFICATION_METHOD_TITLE_MAP[item];
if (r11 == null) {
return null;
}
const { title, description } = r11;
const r21 = {
id: item,
title: intl.string(title),
description: intl.string(description),
onClick: null
};
let c29844_1 = async (c31439_0) => {
const EXPRESSIVE_PRIMARY = AgeVerificationModalVersion.EXPRESSIVE_PRIMARY;
const METHOD_SELECT = AgeVerificationModalCta.METHOD_SELECT;
trackAgeVerificationModalClicked(c31439_0, EXPRESSIVE_PRIMARY, METHOD_SELECT, item);
await initiateAgeVerification(item);
};
r21.onClick = function() {
return c29844_1.apply(this, arguments);
};
return r21;
}).filter((item) => item != null);
if (r6 == null) {
r6 = [];
}
if (state && onGoogleWalletSelect != null) {
const r28 = VERIFICATION_METHOD_TITLE_MAP[VerificationMethod.GOOGLE_WALLET];
if (r28 != null) {
return [...r6, {
id: VerificationMethod.GOOGLE_WALLET,
title: intl.string(r28.title),
description: intl.string(r28.description),
onClick: (a0) => {
MonitoringAgent.increment({
name: MetricEvents.GOOGLE_WALLET_METHOD_SELECTED
});
trackAgeVerificationModalClicked(a0, AgeVerificationModalVersion.EXPRESSIVE_PRIMARY, AgeVerificationModalCta.METHOD_SELECT, VerificationMethod.GOOGLE_WALLET);
onGoogleWalletSelect();
}
}];
}
}
return r6;
}, [methods, state, onGoogleWalletSelect, initiateAgeVerification]),
loading
};
};
@@ -0,0 +1,133 @@
// Metro module 6778 (f6779).
import _slicedToArray from "../../../_bundle/_slicedToArray";
import { useState, useRef, useCallback, useEffect } from "react";
import AgeVerificationStore from "../AgeVerificationStore";
import { fetchAgeVerificationMethodsV2 } from "../AgeVerificationMethodsV2";
import Dispatcher from "../../../Dispatcher";
let env4357 = {};
export function useAgeVerificationMethodsV2() {
let c15909_0;
let env15908 = {
$parent: env4357
};
const r13 = _slicedToArray(useState(() => {
let methodsV2 = AgeVerificationStore.methodsV2;
if (methodsV2 == null) {
methodsV2 = [];
}
return methodsV2;
}), 2);
const methods = r13[0];
env15908[0] = r13[1];
const r18 = _slicedToArray(useState(() => AgeVerificationStore.methodsV2 == null), 2);
const loading = r18[0];
env15908[1] = r18[1];
const r23 = _slicedToArray(useState(false), 2);
const error = r23[0];
env15908[2] = r23[1];
env15908[3] = useRef(true);
c15909_0 = void 0;
c15909_0 = async (c29841_0) => {
let c29841_3;
let c29841_4 = 0;
let c31438_0;
L18: {
L10: {
try {
c31438_0 = void 0;
if (!c29841_0 && AgeVerificationStore.methodsV2 != null) {
(0, env15908[0])(AgeVerificationStore.methodsV2);
(0, env15908[1])(false);
(0, env15908[2])(false);
break L10;
}
(0, env15908[1])(true);
(0, env15908[2])(false);
c29841_4 = 2;
c31438_0 = await fetchAgeVerificationMethodsV2();
Dispatcher.dispatch({
type: "AGE_VERIFICATION_METHODS_V2_LOAD_SUCCESS",
methods: c31438_0
});
if (env15908[3].current) {
(0, env15908[0])(c31438_0);
}
c29841_4 = 1;
c29841_4 = 0;
if (!env15908[3].current) {
break L18;
}
(0, env15908[1])(false);
break L18;
} catch ($e) {
const r27 = $e;
let r7 = r27;
c29841_3 = r27;
let r28 = c29841_4;
if (r28 !== 0) {
while (true) {
if (r28 === 1) {
try {
const r122 = c29841_3;
c29841_4 = 0;
if (env15908[3].current) {
(0, env15908[1])(false);
}
throw r122;
} catch (r120) {
r7 = r120;
c29841_3 = r120;
r28 = c29841_4;
if (r28 === 0) {
break;
}
}
} else {
try {
c29841_4 = 1;
if (env15908[3].current) {
(0, env15908[2])(true);
}
c29841_4 = 0;
if (!env15908[3].current) {
break L18;
}
(0, env15908[1])(false);
break L18;
} catch (r100) {
r7 = r100;
c29841_3 = r100;
r28 = c29841_4;
if (r28 === 0) {
break;
}
}
}
}
}
throw r7;
}
}
return void 0;
}
};
const callback = useCallback(function() {
return c15909_0.apply(this, arguments);
}, []);
env15908[4] = callback;
useEffect(() => {
env15908[3].current = true;
(0, env15908[4])(false);
return () => {
env15908[3].current = false;
};
}, [callback]);
return {
loading,
error,
methods,
refetch: useCallback(() => {
(0, env15908[4])(true);
}, [callback])
};
}
@@ -0,0 +1,65 @@
// Metro module 7625 (f7626).
import { useCallback } from "react";
import { HelpdeskArticles } from "../../../Constants";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { useIsSuspendedUser } from "../../safety_hub/SafetyHubUtils";
import { AgeVerificationGetStartedModalScenes } from "./AgeVerificationGetStartedModal";
import useAgeVerificationMethods from "../hooks/useAgeVerificationMethods";
import { ModalScreen } from "../../../design/components/Modal/native/ModalScreen.native";
import { ModalContent } from "../../../design/components/Modal/native/ModalContent.native";
import { Stack } from "../../../design/components/Stack/native/Stack.native";
import { ShieldSpotIllustration } from "../../../design/assets/native";
import { Text } from "../../../design/components/Text/native/Text";
import { getAgeVerificationGetStartedTitle, getAgeVerificationGetStartedSubtitle } from "../AgeVerificationUtils";
import { AgeVerificationMethodsContainer } from "./AgeVerificationMethodsContainer";
import { intl } from "../../../intl/index.native";
import AgeAssurance_messages from "../AgeAssurance.messages";
import AgeVerificationActionCreators_native from "../AgeVerificationActionCreators.native";
import HelpdeskUtils from "../../../utils/HelpdeskUtils";
const useStyles = createStyles({
header: {
textAlign: "center"
},
helpLink: {
marginTop: Module712.space.PX_16,
textAlign: "center"
}
});
export default function AgeVerificationEmbeddedIntroScreen(props) {
const { onClose, modalSessionId, classificationId, entryPoint, navigation } = props;
const styles = useStyles();
const isSuspendedUser = useIsSuspendedUser();
const ageVerificationMethods = useAgeVerificationMethods({
onClose,
classificationId,
onGoogleWalletSelect: useCallback(() => {
navigation.navigate(AgeVerificationGetStartedModalScenes.GOOGLE_WALLET_VERIFICATION);
}, [navigation])
}).ageVerificationMethods;
return <ModalScreen>
<ModalContent>
<Stack align="center" justify="center" spacing={24}>
<Stack align="center" justify="center" spacing={16}>
<ShieldSpotIllustration height={100} width={177} />
<Stack align="center" justify="center" spacing={8}>
<Text accessibilityRole="header" variant="heading-xl/bold" color="mobile-text-heading-primary">
{getAgeVerificationGetStartedTitle(entryPoint)}
</Text>
<Text variant="text-md/medium" color="text-strong" style={styles.header}>
{getAgeVerificationGetStartedSubtitle(entryPoint, void 0, isSuspendedUser)}
</Text>
</Stack>
</Stack>
<AgeVerificationMethodsContainer ageVerificationMethods={ageVerificationMethods} modalSessionId={modalSessionId} />
</Stack>
<Text variant="text-xs/medium" color="text-muted" style={styles.helpLink}>
{intl.format(AgeAssurance_messages.lG69e1, {
handleOnHelpUrlHook: () => {
AgeVerificationActionCreators_native.openUrl(HelpdeskUtils.getArticleURL(HelpdeskArticles.TIGGER_PAWTECT_LEARN_MORE));
}
})}
</Text>
</ModalContent>
</ModalScreen>;
};
@@ -0,0 +1,255 @@
// Metro module 6771 (f6772).
import _slicedToArray from "../../../_bundle/_slicedToArray";
import { useState, useEffect, useMemo, useRef, useCallback } from "react";
import { ActivityIndicator } from "react-native";
import { HelpdeskArticles } from "../../../Constants";
import { jsx } from "react/jsx-runtime";
import { AgeAssuranceMethod } from "../../../_bundle/Module1892";
import { WalletIcon } from "../../../design/components/Icon/native/redesign/generated/WalletIcon";
import { UserCircleIcon } from "../../../design/components/Icon/native/redesign/generated/UserCircleIcon";
import { IdIcon } from "../../../design/components/Icon/native/redesign/generated/IdIcon";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { useIsSuspendedUser } from "../../safety_hub/SafetyHubUtils";
import { useAgeVerificationMethodsV2 } from "../hooks/useAgeVerificationMethodsV2";
import { checkGoogleWalletAvailable } from "../GoogleWalletActionCreators.native";
import { useInitiateAgeVerification, getAgeVerificationGetStartedTitle, getAgeVerificationGetStartedSubtitle } from "../AgeVerificationUtils";
import { V2_METHOD_TO_VERIFICATION_METHOD, V2_VENDOR_TO_VERIFICATION_VENDOR } from "../AgeVerificationMethodsV2";
import { ModalScreen } from "../../../design/components/Modal/native/ModalScreen.native";
import { ModalContent } from "../../../design/components/Modal/native/ModalContent.native";
import { Stack } from "../../../design/components/Stack/native/Stack.native";
import { AgeVerificationSpotIllustration } from "../../../design/assets/native";
import { Text } from "../../../design/components/Text/native/Text";
import AgeVerificationActionCreators_native from "../AgeVerificationActionCreators.native";
import HelpdeskUtils from "../../../utils/HelpdeskUtils";
import { HelpMessage, HelpMessageTypes } from "../../../design/void/native";
import { Button } from "../../../design/components/Button/native/Button.native";
import { intl, t } from "../../../intl/index.native";
import AgeAssurance_messages from "../AgeAssurance.messages";
import { TableRowGroup } from "../../../design/components/TableRow/native/TableRowGroup.native";
import { TableRow } from "../../../design/components/TableRow/native/TableRow.native";
import ModalActionCreators from "../../../actions/ModalActionCreators";
import { getHeaderCloseButton, getHeaderBackButton } from "../../../design/components/Navigator/native/NavigatorHeader.native";
import GoogleWalletVerificationScreen from "./GoogleWalletVerificationScreen";
import { v4 } from "../../../_bundle/Module514";
import { Navigator } from "../../../design/components/Navigator/native/Navigator.native";
let MethodErrorScreen, c4353_10, useStyles, c4353_12;
let env4353 = {};
const MethodsScreen = function MethodsScreen(props) {
let c15906_0;
let env15905 = {
$parent: env4353
};
const { entryPoint: entryPoint3, navigation } = props;
env15905[0] = navigation;
const onClose3 = props.onClose;
env15905[1] = void 0;
env15905[2] = void 0;
env15905[3] = void 0;
env15905[4] = void 0;
env15905[5] = void 0;
env15905[6] = void 0;
const styles = useStyles();
const isSuspendedUser = useIsSuspendedUser();
const ageVerificationMethodsV2 = useAgeVerificationMethodsV2();
const { loading, error, methods } = ageVerificationMethodsV2;
env15905[1] = methods;
const refetch = ageVerificationMethodsV2.refetch;
const r42 = _slicedToArray(useState(false), 2);
const r43 = r42[0];
env15905[2] = r43;
env15905[3] = r42[1];
useEffect(() => {
let c25998_0 = false;
checkGoogleWalletAvailable().then((result) => {
if (!c25998_0) {
(0, env15905[3])(result);
}
});
return () => {
c25998_0 = true;
};
}, []);
const memo3 = useMemo(() => env15905[1].filter((item) => item.method !== AgeAssuranceMethod.GOOGLE_WALLET || env15905[2]), [methods, r43]);
const r3 = memo3.length > 0;
const initiateAgeVerification = useInitiateAgeVerification({
onComplete: onClose3,
entryPoint: entryPoint3,
shouldShowExpressiveModal: true
}).initiateAgeVerification;
env15905[4] = initiateAgeVerification;
env15905[5] = useRef(false);
c15906_0 = void 0;
c15906_0 = async (c29840_0) => {
let c29840_3;
let c29840_4 = 0;
L18: {
L17: {
try {
if (env15905[5].current) {
break L18;
}
if (c29840_0.method !== AgeAssuranceMethod.GOOGLE_WALLET) {
const r43 = V2_METHOD_TO_VERIFICATION_METHOD[c29840_0.method];
const r48 = V2_VENDOR_TO_VERIFICATION_VENDOR[c29840_0.vendor];
if (r43 != null && r48 != null) {
env15905[5].current = true;
c29840_4 = 1;
await (0, env15905[4])(r43, r48);
c29840_4 = 0;
env15905[5].current = false;
break L17;
}
env15905[0].navigate(c4353_12.METHOD_ERROR);
break L18;
}
env15905[0].navigate(c4353_12.GOOGLE_WALLET_VERIFICATION);
break L18;
} catch ($e) {
const r30 = $e;
let r7 = r30;
c29840_3 = r30;
if (c29840_4 !== 0) {
while (true) {
try {
const r90 = c29840_3;
c29840_4 = 0;
env15905[5].current = false;
throw r90;
} catch (r87) {
r7 = r87;
c29840_3 = r87;
if (c29840_4 === 0) {
break;
}
}
}
}
throw r7;
}
}
return void 0;
}
};
env15905[6] = useCallback(function() {
return c15906_0.apply(this, arguments);
}, [navigation, initiateAgeVerification]);
const r109 = [<Stack align="center" justify="center" spacing={16}>
<AgeVerificationSpotIllustration width={150} height={100} />
<Stack align="center" justify="center" spacing={8}>
<Text accessibilityRole="header" variant="heading-xl/bold" color="mobile-text-heading-primary">
{getAgeVerificationGetStartedTitle(entryPoint3)}
</Text>
<Text variant="text-md/medium" color="text-strong" style={styles.header}>
{getAgeVerificationGetStartedSubtitle(entryPoint3, () => {
AgeVerificationActionCreators_native.openUrl(HelpdeskUtils.getArticleURL(HelpdeskArticles.TIGGER_PAWTECT_LEARN_MORE));
}, isSuspendedUser)}
</Text>
</Stack>
</Stack>, loading && <Stack align="center" justify="center" style={styles.loadingContainer}>
<ActivityIndicator size="large" />
</Stack>, (loading ? !loading : !r3) && <Stack style={styles.emptyContainer}>
<HelpMessage messageType={HelpMessageTypes.ERROR} button={<Button variant="primary" size="sm" text={intl.string(AgeAssurance_messages.hDvmYP)} onPress={refetch} />}>
{intl.string(error ? AgeAssurance_messages.Bkmk4Y : AgeAssurance_messages.cR6336)}
</HelpMessage>
</Stack>, (loading ? !loading : r3) && <TableRowGroup hasIcons>
{memo3.map((item) => {
const IconComponent = c4353_10[item.method];
return <TableRow key={`${item.method}-${item.vendor}`} arrow icon={IconComponent != null ? <TableRow.Icon IconComponent={IconComponent} variant="secondary" /> : void 0} label={item.title} subLabel={<Stack direction="vertical" spacing={4}>
<Text variant="text-sm/normal" color="text-muted">{item.description}</Text>
{item.providedBy != null && <Text variant="text-sm/normal" color="text-subtle">{item.providedBy}</Text>}
</Stack>} onPress={() => {
(0, env15905[6])(item);
}} />;
})}
</TableRowGroup>];
return <ModalScreen>
<ModalContent>
<Stack align="stretch" spacing={24} style={styles.container}>{r109}</Stack>
</ModalContent>
</ModalScreen>;
};
MethodErrorScreen = function MethodErrorScreen() {
return <ModalScreen>
<ModalContent>
<Stack style={useStyles().errorMessage}>
<HelpMessage messageType={HelpMessageTypes.ERROR}>
{intl.string(AgeAssurance_messages["1RD2jW"])}
</HelpMessage>
</Stack>
</ModalContent>
</ModalScreen>;
};
const r32 = {};
r32[AgeAssuranceMethod.GOOGLE_WALLET] = WalletIcon;
r32[AgeAssuranceMethod.FACIAL_AGE_ESTIMATION] = UserCircleIcon;
r32[AgeAssuranceMethod.ID_SELFIE_MATCH] = IdIcon;
c4353_10 = r32;
useStyles = createStyles({
headerStyle: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWER,
shadowColor: "transparent"
},
container: {
alignSelf: "stretch"
},
header: {
textAlign: "center"
},
loadingContainer: {
marginTop: Module712.space.PX_24
},
emptyContainer: {
marginTop: Module712.space.PX_24
},
errorMessage: {
marginTop: Module712.space.PX_24
}
});
c4353_12 = {
METHODS: "METHODS",
GOOGLE_WALLET_VERIFICATION: "GOOGLE_WALLET_VERIFICATION",
METHOD_ERROR: "METHOD_ERROR"
};
export default function AgeVerificationExpressiveV2Modal(props) {
const { entryPoint, onClose } = props;
const styles = useStyles();
let c15907_2 = styles;
const memo = useMemo(() => v4(), []);
return <Navigator screens={useMemo(() => {
const memo2 = memo;
const entryPoint2 = entryPoint;
const onClose2 = onClose;
const closeModal2 = function closeModal() {
ModalActionCreators.pop();
onClose2();
};
const r14 = {};
r14[c4353_12.METHODS] = {
headerStyle: c15907_2.headerStyle,
headerTitle: () => null,
headerLeft: getHeaderCloseButton(closeModal2),
render: (a0, a1) => (0, jsx)(MethodsScreen, {
entryPoint: entryPoint2,
navigation: a1,
onClose: closeModal2
})
};
r14[c4353_12.GOOGLE_WALLET_VERIFICATION] = {
headerStyle: c15907_2.headerStyle,
headerTitle: () => null,
headerLeft: getHeaderBackButton(),
render: () => (0, jsx)(GoogleWalletVerificationScreen, {
onClose: closeModal2,
modalSessionId: memo2
})
};
r14[c4353_12.METHOD_ERROR] = {
headerStyle: c15907_2.headerStyle,
headerTitle: () => null,
headerLeft: getHeaderBackButton(),
render: () => (0, jsx)(MethodErrorScreen, {})
};
return r14;
}, [styles, memo, entryPoint, onClose])} initialRouteName={c4353_12.METHODS} headerBackTitle={intl.string(t["13/7kX"])} />;
};
@@ -0,0 +1,83 @@
// Metro module 7618 (f7619).
import { useMemo, useEffect } from "react";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import ModalActionCreators from "../../../actions/ModalActionCreators";
import { getHeaderCloseButton, getHeaderBackButton } from "../../../design/components/Navigator/native/NavigatorHeader.native";
import AgeVerificationIntroScreen from "./AgeVerificationIntroScreen";
import AgeVerificationRetryScreen from "./AgeVerificationRetryScreen";
import AgeVerificationEmbeddedIntroScreen from "./AgeVerificationEmbeddedIntroScreen";
import GoogleWalletVerificationScreen from "./GoogleWalletVerificationScreen";
import { v4 } from "../../../_bundle/Module514";
import { AgeVerificationModalVersion, trackAgeVerificationModalViewed } from "../AgeVerificationAnalyticsUtils";
import { Navigator } from "../../../design/components/Navigator/native/Navigator.native";
import { intl, t } from "../../../intl/index.native";
const useStyles = createStyles({
headerStyle: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWER,
shadowColor: "transparent"
}
});
let c4780_6 = {
INTRO: "INTRO",
RETRY: "RETRY",
EXPRESSIVE_INTRO: "EXPRESSIVE_INTRO",
GOOGLE_WALLET_VERIFICATION: "GOOGLE_WALLET_VERIFICATION"
};
export default function AgeVerificationGetStartedModal(props) {
let memo2;
const { entryPoint, isRetry, useEmbeddedMethods = false } = props;
let c15911_2 = useEmbeddedMethods;
const { classificationId, onComplete } = props;
memo2 = void 0;
const styles = useStyles();
const memo = useMemo(() => v4(), []);
const memo4 = useMemo(() => {
let closeModalWithOnComplete2;
const memo3 = memo;
const entryPoint2 = entryPoint;
const classificationId2 = classificationId;
const onComplete2 = onComplete;
const closeModal2 = function closeModal() {
return ModalActionCreators.pop();
};
closeModalWithOnComplete2 = function closeModalWithOnComplete() {
ModalActionCreators.pop();
if (onComplete2 != null) {
onComplete2();
}
};
const r14 = {};
r14[c4780_6.INTRO] = {
headerStyle: styles.headerStyle,
headerTitle: () => null,
headerLeft: getHeaderCloseButton(closeModal2),
render: () => <AgeVerificationIntroScreen onClose={closeModal2} modalSessionId={memo3} entryPoint={entryPoint2} />
};
r14[c4780_6.RETRY] = {
headerStyle: styles.headerStyle,
headerTitle: () => null,
headerLeft: getHeaderCloseButton(closeModal2),
render: () => <AgeVerificationRetryScreen onClose={closeModal2} modalSessionId={memo3} />
};
r14[c4780_6.EXPRESSIVE_INTRO] = {
headerStyle: styles.headerStyle,
headerTitle: () => null,
headerLeft: getHeaderCloseButton(closeModal2),
render: (a0, a1) => <AgeVerificationEmbeddedIntroScreen onClose={closeModalWithOnComplete2} modalSessionId={memo3} classificationId={classificationId2} entryPoint={entryPoint2} navigation={a1} />
};
r14[c4780_6.GOOGLE_WALLET_VERIFICATION] = {
headerStyle: styles.headerStyle,
headerTitle: () => null,
headerLeft: getHeaderBackButton(),
render: () => <GoogleWalletVerificationScreen onClose={closeModalWithOnComplete2} modalSessionId={memo3} />
};
return r14;
}, [styles, memo, classificationId, onComplete, entryPoint]);
memo2 = useMemo(() => c15911_2 ? AgeVerificationModalVersion.EXPRESSIVE_PRIMARY : isRetry ? AgeVerificationModalVersion.RETRY : AgeVerificationModalVersion.PRIMARY, [useEmbeddedMethods, isRetry]);
useEffect(() => {
trackAgeVerificationModalViewed(memo, memo2, entryPoint);
}, [memo, entryPoint, memo2]);
return <Navigator screens={memo4} initialRouteName={useEmbeddedMethods ? c4780_6.EXPRESSIVE_INTRO : isRetry ? c4780_6.RETRY : c4780_6.INTRO} headerBackTitle={intl.string(t["13/7kX"])} />;
};
export { c4780_6 as AgeVerificationGetStartedModalScenes };
@@ -0,0 +1,166 @@
// Metro module 6753 (f6754).
import _slicedToArray from "../../../_bundle/_slicedToArray";
import { useState, useCallback } from "react";
import { View } from "react-native";
import ThemeStore from "../../user_settings/ThemeStore";
import { VerificationMethod } from "../AgeVerificationConstants";
import { buildIncodeParamsInjection } from "../AgeVerificationIncodeWebViewConstants";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { requestIncodeMethodSession } from "../AgeVerificationURLActionCreators";
import { ActivityIndicator } from "../../../design/components/ActivityIndicator/native/ActivityIndicator.native";
import { Stack } from "../../../design/components/Stack/native/Stack.native";
import { Heading, Text } from "../../../design/components/Text/native/Text";
import { intl, t } from "../../../intl/index.native";
import AgeAssurance_messages from "../AgeAssurance.messages";
import { TableRowGroup } from "../../../design/components/TableRow/native/TableRowGroup.native";
import { TableRow } from "../../../design/components/TableRow/native/TableRow.native";
let env4340 = {};
const useStyles = createStyles({
container: {
flex: 1,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST
},
content: {
padding: Module712.space.PX_16
},
loadingOverlay: {
flex: 1,
alignItems: "center",
justifyContent: "center",
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST
}
});
export default function AgeVerificationIncodeMethodSelectScreen(props) {
let props2;
let env15897 = {
$parent: env4340
};
const onMethodSelected = props.onMethodSelected;
env15897[0] = onMethodSelected;
const trustedOrigin = props.trustedOrigin;
env15897[1] = trustedOrigin;
env15897[2] = void 0;
env15897[3] = void 0;
env15897[4] = void 0;
const r4 = _slicedToArray(useState(false), 2);
const r26 = r4[0];
env15897[2] = r4[1];
const r30 = _slicedToArray(useState(false), 2);
let r12 = r30[0];
env15897[3] = r30[1];
const styles = useStyles();
let c15898_0 = async (c29835_0) => {
let c29835_3;
let c29835_4 = 0;
let c31437_0, c31437_1, c31437_2;
L13: {
L12: {
try {
c31437_0 = c29835_0;
c31437_1 = void 0;
c31437_2 = void 0;
(0, env15897[2])(true);
(0, env15897[3])(false);
c29835_4 = 2;
c31437_1 = await requestIncodeMethodSession(c29835_0);
if (c31437_1 == null) {
(0, env15897[3])(true);
c29835_4 = 0;
(0, env15897[2])(false);
break L13;
}
c31437_2 = buildIncodeParamsInjection({
apiUrl: c31437_1.apiUrl,
sessionToken: c31437_1.sessionToken,
consentId: c31437_1.consentId,
interviewId: c31437_1.interviewId,
theme: ThemeStore.theme,
method: c31437_0
}, env15897[1]);
(0, env15897[0])(c31437_2);
c29835_4 = 1;
c29835_4 = 0;
(0, env15897[2])(false);
} catch ($e) {
const r30 = $e;
let r7 = r30;
c29835_3 = r30;
let r31 = c29835_4;
if (r31 !== 0) {
while (true) {
if (r31 === 1) {
try {
const r115 = c29835_3;
c29835_4 = 0;
(0, env15897[2])(false);
throw r115;
} catch (r113) {
r7 = r113;
c29835_3 = r113;
r31 = c29835_4;
if (r31 === 0) {
break;
}
}
} else {
try {
c29835_4 = 1;
(0, env15897[3])(true);
c29835_4 = 0;
(0, env15897[2])(false);
break L12;
} catch (r101) {
r7 = r101;
c29835_3 = r101;
r31 = c29835_4;
if (r31 === 0) {
break;
}
}
}
}
}
throw r7;
}
}
return void 0;
}
};
env15897[4] = useCallback(function() {
return c15898_0.apply(this, arguments);
}, [onMethodSelected, trustedOrigin]);
const r41 = {
style: null,
children: null
};
if (r26) {
r41.style = styles.loadingOverlay;
r41.children = <ActivityIndicator />;
props2 = r41;
} else {
r41.style = styles.container;
const r59 = [<Heading variant="heading-lg/bold" color="text-strong">
{intl.string(AgeAssurance_messages.eZvwAe)}
</Heading>, <Text variant="text-md/normal" color="text-muted">
{intl.string(AgeAssurance_messages["5yWXmT"])}
</Text>, , ,];
if (r12) {
r12 = <Text variant="text-sm/medium" color="text-feedback-critical">
{intl.string(t.c6kn6F)}
</Text>;
}
r59[2] = r12;
r59[3] = <TableRowGroup hasIcons={false}>
<TableRow arrow label={intl.string(AgeAssurance_messages.rgXXcW)} subLabel={intl.string(AgeAssurance_messages.fm7qBC)} onPress={() => {
(0, env15897[4])(VerificationMethod.FACIAL_AGE_ESTIMATION);
}} />
<TableRow arrow label={intl.string(AgeAssurance_messages["NeVlw/"])} subLabel={intl.string(AgeAssurance_messages.ARmJ0M)} onPress={() => {
(0, env15897[4])(VerificationMethod.ID_VERIFICATION);
}} />
</TableRowGroup>;
r41.children = <Stack spacing={16} style={styles.content}>{r59}</Stack>;
props2 = r41;
}
return <View {...props2} />;
};
@@ -0,0 +1,51 @@
// Metro module 6751 (f6752).
import { useMemo } from "react";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import ModalActionCreators from "../../../actions/ModalActionCreators";
import { intl, t } from "../../../intl/index.native";
import { HeaderActionButton } from "../../../design/components/Navigator/native/HeaderActionButton.native";
import AgeVerificationIncodeMethodSelectScreen from "./AgeVerificationIncodeMethodSelectScreen";
import AgeVerificationWebViewScreen from "./AgeVerificationWebViewScreen";
import { Navigator } from "../../../design/components/Navigator/native/Navigator.native";
let c4338_5 = {
METHOD_SELECT: "METHOD_SELECT",
VERIFY_AGE: "VERIFY_AGE"
};
const useStyles = createStyles({
headerStyle: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWER
}
});
export default function AgeVerificationIncodeModal(props) {
const { webviewUrl, onComplete, onClose } = props;
const styles = useStyles();
const headerTitle = intl.string(t.wJVyYR);
return <Navigator screens={useMemo(() => {
let origin;
const webviewUrl2 = webviewUrl;
const onComplete2 = onComplete;
const onClose2 = onClose;
const handleClose2 = function handleClose() {
onClose2();
ModalActionCreators.pop();
};
origin = new URL(webviewUrl).origin;
const r22 = {};
r22[c4338_5.METHOD_SELECT] = {
headerStyle: styles.headerStyle,
headerTitle: intl.string(t.wJVyYR),
headerLeft: () => <HeaderActionButton onPress={handleClose2} text={intl.string(t.cpT0Cq)} />,
render: (a0, c25983_0) => <AgeVerificationIncodeMethodSelectScreen onClose={handleClose2} trustedOrigin={origin} onMethodSelected={(event) => c25983_0.navigate(c4338_5.VERIFY_AGE, {
injectedJavaScriptBeforeContentLoaded: event
})} />
};
r22[c4338_5.VERIFY_AGE] = {
headerStyle: styles.headerStyle,
headerTitle,
headerLeft: () => <HeaderActionButton onPress={handleClose2} text={intl.string(t.cpT0Cq)} />,
render: (a0) => <AgeVerificationWebViewScreen webviewUrl={webviewUrl2} onComplete={onComplete2} onClose={handleClose2} injectedJavaScriptBeforeContentLoaded={a0.injectedJavaScriptBeforeContentLoaded} />
};
return r22;
}, [styles, webviewUrl, onComplete, onClose, headerTitle])} initialRouteName={c4338_5.METHOD_SELECT} headerBackTitle={intl.string(t["13/7kX"])} />;
};
@@ -0,0 +1,111 @@
// Metro module 7619 (f7620).
import { ScrollView, View } from "react-native";
import { getAgeVerificationGetStartedSteps } from "../AgeVerificationConstants";
import { HelpdeskArticles } from "../../../Constants";
import { SafetyHubLinks } from "../../safety_hub/SafetyHubConstants";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import useSafeAreaInsets_native from "../../safe_area/useSafeAreaInsets.native";
import { useInitiateAgeVerification, getAgeVerificationGetStartedTitle, getAgeVerificationGetStartedSubtitle } from "../AgeVerificationUtils";
import { useIsManualAgeVerificationHidden } from "../HideManualAgeVerificationExperiment";
import { ShieldSpotIllustration } from "../../../design/assets/native";
import { Text } from "../../../design/components/Text/native/Text";
import { TableRowGroup } from "../../../design/components/TableRow/native/TableRowGroup.native";
import SafetyTipsRow from "../../self_mod/shared/native/SafetyTipsRow";
import { intl, t } from "../../../intl/index.native";
import AgeVerificationActionCreators_native from "../AgeVerificationActionCreators.native";
import HelpdeskUtils from "../../../utils/HelpdeskUtils";
import { trackAgeVerificationModalClicked, AgeVerificationModalVersion, AgeVerificationModalCta } from "../AgeVerificationAnalyticsUtils";
import { Button } from "../../../design/components/Button/native/Button.native";
import { LinkExternalSmallIcon } from "../../../design/components/Icon/native/redesign/generated/LinkExternalSmallIcon";
const useStyles = createStyles({
getStartedContainer: {
paddingHorizontal: Module712.space.PX_16,
gap: Module712.space.PX_16,
flex: 1
},
getStartedHeaderContainer: {
alignItems: "center",
gap: Module712.space.PX_8
},
ageGroupLearnMoreContainer: {
alignItems: "center",
marginTop: -Module712.space.PX_8
},
getStartedHeaderText: {
textAlign: "center"
},
getStartedRequestTextContainer: {
alignItems: "center"
},
getStartedFooterContainer: {
paddingHorizontal: Module712.space.PX_16,
paddingTop: Module712.space.PX_48
},
getStartedRequestText: {
textAlign: "center",
marginBottom: Module712.space.PX_16
},
getStartedFooterButtonsContainer: {
gap: Module712.space.PX_8
}
});
export default function GetStartedScreen(props) {
const { modalSessionId, onClose, entryPoint } = props;
const styles = useStyles();
const bottom = useSafeAreaInsets_native().bottom;
const initiateAgeVerification2 = useInitiateAgeVerification({
onComplete: onClose,
entryPoint
});
const { loading, initiateAgeVerification } = initiateAgeVerification2;
const isManualAgeVerificationHidden = useIsManualAgeVerificationHidden("age_verification_get_started_modal");
return <>
<ScrollView>
<View style={styles.getStartedContainer}>
<View style={styles.getStartedHeaderContainer}>
<ShieldSpotIllustration />
<Text variant="heading-xl/bold" color="mobile-text-heading-primary" style={styles.getStartedHeaderText}>
{getAgeVerificationGetStartedTitle(entryPoint)}
</Text>
<Text variant="heading-md/medium" color="text-default" style={styles.getStartedHeaderText}>
{getAgeVerificationGetStartedSubtitle(entryPoint)}
</Text>
</View>
<TableRowGroup hasIcons>
{getAgeVerificationGetStartedSteps(modalSessionId).map(({ title, description }, a1) => <SafetyTipsRow key={a1} index={a1 + 1} tip={<Text variant="text-md/medium" color="mobile-text-heading-primary">{title}</Text>} description={description != null ? <Text variant="text-xs/medium" color="text-subtle">{description}</Text> : null} />)}
</TableRowGroup>
<View style={styles.ageGroupLearnMoreContainer}>
<Text variant="text-xs/medium" color="text-muted">
{intl.format(t["L+FgkZ"], {
handleOnHelpUrlHook: () => {
AgeVerificationActionCreators_native.openUrl(HelpdeskUtils.getArticleURL(HelpdeskArticles.TIGGER_PAWTECT_LEARN_MORE));
trackAgeVerificationModalClicked(modalSessionId, AgeVerificationModalVersion.PRIMARY, AgeVerificationModalCta.LEARN_MORE);
}
})}
</Text>
</View>
</View>
</ScrollView>
<View style={[styles.getStartedFooterContainer, {
paddingBottom: bottom
}]}>
{isManualAgeVerificationHidden ? !isManualAgeVerificationHidden : <View style={styles.getStartedRequestTextContainer}>
<Text variant="text-xs/medium" color="text-muted" style={styles.getStartedRequestText}>
{intl.format(t.pJAxgQ, {
handleOnRequestHook: () => {
AgeVerificationActionCreators_native.openUrl(SafetyHubLinks.APPEALS_LINK);
trackAgeVerificationModalClicked(modalSessionId, AgeVerificationModalVersion.PRIMARY, AgeVerificationModalCta.MANUAL_REVIEW_REQUEST);
}
})}
</Text>
</View>}
<View style={styles.getStartedFooterButtonsContainer}>
<Button variant="primary" size="lg" text={intl.string(t.SJMnkX)} onPress={async () => {
trackAgeVerificationModalClicked(modalSessionId, AgeVerificationModalVersion.PRIMARY, AgeVerificationModalCta.GET_STARTED);
await initiateAgeVerification();
}} icon={<LinkExternalSmallIcon color={Module712.colors.WHITE} />} loading={loading} iconPosition="end" />
</View>
</View>
</>;
};
@@ -0,0 +1,74 @@
// Metro module 7628 (f7629).
import { useEffect } from "react";
import { VerificationMethod } from "../AgeVerificationConstants";
import { SafetyHubLinks } from "../../safety_hub/SafetyHubConstants";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { useIsSuspendedUser } from "../../safety_hub/SafetyHubUtils";
import MonitoringAgent from "../../monitoring/MonitoringAgent";
import { MetricEvents } from "../../../_bundle/Module5872";
import { Stack } from "../../../design/components/Stack/native/Stack.native";
import { HelpMessage, HelpMessageTypes } from "../../../design/void/native";
import { intl, t } from "../../../intl/index.native";
import { TableRowGroup } from "../../../design/components/TableRow/native/TableRowGroup.native";
import { Text } from "../../../design/components/Text/native/Text";
import AgeAssurance_messages from "../AgeAssurance.messages";
import { ButtonGroup } from "../../../design/components/ButtonGroup/native/ButtonGroup.native";
import { Button } from "../../../design/components/Button/native/Button.native";
import { getAgeVerificationMethods } from "../AgeVerificationURLActionCreators";
import { TableRow } from "../../../design/components/TableRow/native/TableRow.native";
import AgeVerificationActionCreators_native from "../AgeVerificationActionCreators.native";
const useStyles = createStyles({
content: {
marginTop: Module712.space.PX_8
},
errorContainer: {
marginTop: Module712.space.PX_24,
marginBottom: Module712.space.PX_24
},
noMethodsText: {
paddingHorizontal: Module712.space.PX_40,
textAlign: "center"
},
buttonGroup: {
paddingVertical: 0
}
});
export function AgeVerificationMethodsContainer(props) {
const { ageVerificationMethods, modalSessionId } = props;
const styles = useStyles();
const isSuspendedUser = useIsSuspendedUser();
useEffect(() => {
if (ageVerificationMethods == null ? void 0 : ageVerificationMethods.some((ageVerificationMethod) => ageVerificationMethod.id === VerificationMethod.GOOGLE_WALLET)) {
MonitoringAgent.increment({
name: MetricEvents.GOOGLE_WALLET_METHOD_IMPRESSION
});
}
}, [ageVerificationMethods]);
return <Stack spacing={8} align="center">
<Stack spacing={16} style={styles.content}>
<HelpMessage messageType={HelpMessageTypes.INFO} textColor="text-feedback-info" textVariant="text-sm/medium">
{intl.string(t.El4aXl)}
</HelpMessage>
<TableRowGroup hasIcons={false}>
{ageVerificationMethods != null && ageVerificationMethods.length !== 0 ? ageVerificationMethods.map((ageVerificationMethod) => {
return <TableRow key={ageVerificationMethod.id} label={ageVerificationMethod.title} subLabel={ageVerificationMethod.description} onPress={() => ageVerificationMethod.onClick(modalSessionId)} arrow />;
}) : <Stack direction="vertical" align="center" spacing={16} style={styles.errorContainer}>
<Text variant="text-sm/medium" color="text-subtle" style={styles.noMethodsText}>
{intl.string(AgeAssurance_messages.cR6336)}
</Text>
<ButtonGroup style={styles.buttonGroup}>
<Button variant="primary" size="lg" text={intl.string(AgeAssurance_messages.hDvmYP)} onPress={getAgeVerificationMethods} />
</ButtonGroup>
</Stack>}
</TableRowGroup>
</Stack>
{isSuspendedUser && <Text variant="text-xs/medium">
{intl.format(AgeAssurance_messages.htWh1G, {
handleOnHelpUrlHook: () => {
AgeVerificationActionCreators_native.openUrl(SafetyHubLinks.LEARN_MORE_UU_APPEAL_LINK);
}
})}
</Text>}
</Stack>;
}
@@ -0,0 +1,73 @@
// Metro module 6769 (f6770).
import { useCallback, useMemo } from "react";
import { AGE_VERIFICATION_MODAL_KEY } from "../AgeVerificationConstants";
import { useIsSuspendedUser } from "../../safety_hub/SafetyHubUtils";
import { isModalOpen } from "../../main_tabs_v2/helpers/NavigationRouteUtils.native";
import { useWatchAgeVerificationStatusChange } from "../AgeVerificationUtils";
import Module6759 from "../../../_bundle/Module6759";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import ModalActionCreators from "../../../actions/ModalActionCreators";
import { HeaderActionButton } from "../../../design/components/Navigator/native/HeaderActionButton.native";
import { intl, t } from "../../../intl/index.native";
import { Navigator } from "../../../design/components/Navigator/native/Navigator.native";
let c4351_6, useStyles;
const AgeVerifyScreen = function AgeVerifyScreen(props) {
const { webviewUrl: webviewUrl3, onComplete, onClose } = props;
const isSuspendedUser = useIsSuspendedUser();
const callback = useCallback(() => {
onComplete();
onClose();
}, [onComplete, onClose]);
useWatchAgeVerificationStatusChange(useCallback(() => {
if (isModalOpen(AGE_VERIFICATION_MODAL_KEY)) {
callback();
}
}, [callback]));
return <Module6759 allowsInlineMediaPlayback javaScriptEnabled source={{
uri: webviewUrl3
}} onMessage={useCallback((a0) => {
if (a0.nativeEvent.data != null) {
try {
const r16 = typeof a0.nativeEvent.data === "string" ? JSON.parse(a0.nativeEvent.data) : a0.nativeEvent.data;
let r17 = isSuspendedUser;
if (isSuspendedUser) {
r17 = r16?.eventType === "Verification.Result";
}
if (r17) {
callback();
}
} catch ($e) {}
}
}, [callback, isSuspendedUser])} injectedJavaScript={"\n window.addEventListener('message', function(event) {\n window.ReactNativeWebView.postMessage(event.data);\n }, true);\n"} />;
};
c4351_6 = {
VERIFY_AGE: "VERIFY_AGE"
};
useStyles = createStyles({
headerStyle: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWER
}
});
export default function AgeVerificationModal(props) {
const { webviewUrl, onComplete: onComplete2, onClose: onClose2 } = props;
const styles = useStyles();
const headerTitle = intl.string(t.wJVyYR);
return <Navigator screens={useMemo(() => {
const webviewUrl2 = webviewUrl;
const onComplete3 = onComplete2;
const onClose3 = onClose2;
const handleClose2 = function handleClose() {
onClose3();
ModalActionCreators.pop();
};
const r9 = {};
r9[c4351_6.VERIFY_AGE] = {
headerStyle: styles.headerStyle,
headerTitle,
headerLeft: () => <HeaderActionButton onPress={handleClose2} text={intl.string(t.cpT0Cq)} />,
render: () => <AgeVerifyScreen webviewUrl={webviewUrl2} onComplete={onComplete3} onClose={handleClose2} />
};
return r9;
}, [styles, webviewUrl, onComplete2, onClose2, headerTitle])} initialRouteName={c4351_6.VERIFY_AGE} headerBackTitle={intl.string(t["13/7kX"])} />;
};
@@ -0,0 +1,10 @@
// Metro module 6767 (f6768).
import { AlertModal, AlertActionButton } from "../../../design/components/AlertModal/native/AlertModal.native";
import { intl, t } from "../../../intl/index.native";
import AgeAssurance_messages from "../AgeAssurance.messages";
import { AlertActions } from "../../../design/components/AlertModal/native/AlertModal.native";
export default function AgeVerificationQuestUnsupportedAlertModal() {
return <AlertModal title={intl.string(AgeAssurance_messages.gUqXQN)} content={intl.string(AgeAssurance_messages.yBHwMy)} actions={<AlertActions>
<AlertActionButton key="got-it" text={intl.string(t["NX+WJN"])} />
</AlertActions>} />;
};
@@ -0,0 +1,107 @@
// Metro module 7624 (f7625).
import { useMemo } from "react";
import { ActivityIndicator, ScrollView, View } from "react-native";
import { HelpdeskArticles } from "../../../Constants";
import { SafetyHubLinks } from "../../safety_hub/SafetyHubConstants";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { useInitiateAgeVerification } from "../AgeVerificationUtils";
import { AgeVerificationModalEntryPoint, trackAgeVerificationModalClicked, AgeVerificationModalVersion, AgeVerificationModalCta } from "../AgeVerificationAnalyticsUtils";
import { useIsManualAgeVerificationHidden } from "../HideManualAgeVerificationExperiment";
import { intl, t } from "../../../intl/index.native";
import AgeVerificationActionCreators_native from "../AgeVerificationActionCreators.native";
import { isAndroid } from "../../../utils/PlatformUtils";
import { ShieldSpotIllustration } from "../../../design/assets/native";
import { Text } from "../../../design/components/Text/native/Text";
import { TableRowGroup } from "../../../design/components/TableRow/native/TableRowGroup.native";
import { TableRow } from "../../../design/components/TableRow/native/TableRow.native";
import HelpdeskUtils from "../../../utils/HelpdeskUtils";
const useStyles = createStyles({
loadingIndicator: {
position: "absolute",
top: 0,
left: 0,
right: 0,
bottom: 0,
zIndex: 1
},
container: {
paddingHorizontal: Module712.space.PX_16,
flex: 1
},
headerContainer: {
paddingVertical: Module712.space.PX_16,
alignItems: "center",
gap: Module712.space.PX_8
},
centerText: {
textAlign: "center"
},
helpLink: {
marginTop: Module712.space.PX_8
}
});
export default function GetStartedScreen(props) {
const { onClose, modalSessionId } = props;
const styles = useStyles();
const initiateAgeVerification2 = useInitiateAgeVerification({
onComplete: onClose,
entryPoint: AgeVerificationModalEntryPoint.RETRY_MODAL
});
let loading = initiateAgeVerification2.loading;
const initiateAgeVerification = initiateAgeVerification2.initiateAgeVerification;
const isManualAgeVerificationHidden = useIsManualAgeVerificationHidden("age_verification_retry_modal");
const r20 = intl.string(t.JSdbBe);
const r19 = intl.string(t.JNK1ue);
const title = intl.string(t.mFvt9M);
const memo = useMemo(() => {
const r2 = {
title,
description: intl.string(t.ecdUKD),
onPress: null
};
let c26010_0 = async () => {
trackAgeVerificationModalClicked(modalSessionId, AgeVerificationModalVersion.RETRY, AgeVerificationModalCta.GET_STARTED);
await initiateAgeVerification();
};
r2.onPress = function() {
return c26010_0.apply(this, arguments);
};
const r21 = [r2];
if (!isManualAgeVerificationHidden) {
r21.push({
title: intl.string(t["LZO+Hd"]),
description: intl.string(t["ty+iWP"]),
onPress: () => {
AgeVerificationActionCreators_native.openUrl(SafetyHubLinks.APPEALS_LINK);
trackAgeVerificationModalClicked(modalSessionId, AgeVerificationModalVersion.RETRY, AgeVerificationModalCta.MANUAL_REVIEW_REQUEST);
}
});
}
return r21;
}, [initiateAgeVerification, modalSessionId, isManualAgeVerificationHidden, title]);
if (loading) {
loading = <ActivityIndicator style={styles.loadingIndicator} size="small" color={isAndroid() ? Module712.unsafe_rawColors.WHITE : void 0} />;
}
return <>
{loading}
<ScrollView style={styles.container}>
<View style={styles.headerContainer}>
<ShieldSpotIllustration />
<Text variant="heading-xl/bold" color="mobile-text-heading-primary" style={styles.centerText}>{r20}</Text>
<Text variant="heading-md/medium" color="text-strong" style={styles.centerText}>{r19}</Text>
</View>
<TableRowGroup hasIcons={false}>
{memo.map((item, index) => <TableRow key={index} arrow label={item.title} subLabel={item.description} onPress={item.onPress} />)}
</TableRowGroup>
<Text variant="text-xs/medium" color="text-muted" style={[styles.centerText, styles.helpLink]}>
{intl.format(t["L+FgkZ"], {
handleOnHelpUrlHook: () => {
AgeVerificationActionCreators_native.openUrl(HelpdeskUtils.getArticleURL(HelpdeskArticles.TIGGER_PAWTECT_LEARN_MORE));
trackAgeVerificationModalClicked(modalSessionId, AgeVerificationModalVersion.RETRY, AgeVerificationModalCta.LEARN_MORE);
}
})}
</Text>
</ScrollView>
</>;
};
@@ -0,0 +1,188 @@
// Metro module 6758 (f6759).
import { useRef, useState, useCallback, useEffect, useMemo } from "react";
import { View } from "react-native";
import { AGE_VERIFICATION_MODAL_KEY } from "../AgeVerificationConstants";
import { AgeVerificationIncodeResultStatus, buildIncodeFallbackSessionInjection, parseIncodeWebViewMessage } from "../AgeVerificationIncodeWebViewConstants";
import Logger from "../../debug/Logger";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { isModalOpen } from "../../main_tabs_v2/helpers/NavigationRouteUtils.native";
import { useWatchAgeVerificationStatusChange, isAgeVerified } from "../AgeVerificationUtils";
import { registerIncodeInterview, requestIncodeSessionBootstrap } from "../AgeVerificationURLActionCreators";
import Linking from "../../../lib/native/Linking";
import Module6759 from "../../../_bundle/Module6759";
import { ActivityIndicator } from "../../../design/components/ActivityIndicator/native/ActivityIndicator.native";
let c4343_12 = new Logger("AgeVerificationWebViewScreen");
const useStyles = createStyles({
container: {
flex: 1,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST
},
loadingOverlay: {
position: "absolute",
top: 0,
left: 0,
right: 0,
bottom: 0,
alignItems: "center",
justifyContent: "center",
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST
},
webView: {
flex: 1,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST
}
});
export default function AgeVerificationWebViewScreen(props) {
let callback2, callback3, memo;
const { webviewUrl, onComplete, onClose, injectedJavaScriptBeforeContentLoaded } = props;
callback2 = void 0;
callback3 = void 0;
memo = void 0;
const ref = useRef(null);
const ref2 = useRef(false);
const ref3 = useRef(false);
let [state, setState] = useState(true);
const callback = useCallback(() => {
if (!ref3.current) {
ref3.current = true;
setState(false);
}
}, []);
useEffect(() => {
let c25992_0 = setTimeout(() => {
if (!ref3.current) {
c4343_12.warn("WebView initial load timed out", {
timeoutMs: 15000
});
}
callback();
}, 15000);
return () => clearTimeout(c25992_0);
}, [callback]);
callback2 = useCallback(() => {
if (!ref2.current) {
ref2.current = true;
onComplete();
onClose();
}
}, [onComplete, onClose]);
useWatchAgeVerificationStatusChange(useCallback(() => {
if (isModalOpen(AGE_VERIFICATION_MODAL_KEY) && isAgeVerified()) {
callback2();
}
}, [callback2]));
callback3 = useCallback((a0) => {
const current = ref.current;
if (current != null) {
current.injectJavaScript(buildIncodeFallbackSessionInjection(a0));
}
}, []);
const callback4 = useCallback((a0) => {
L14: {
L13: {
L16: {
L11: {
try {
const r10 = parseIncodeWebViewMessage(a0.nativeEvent.data);
if (r10 == null) {
break L14;
}
if (r10.kind === "capture_complete") {
registerIncodeInterview(r10.interviewId).then(() => {
const current = ref2.current;
if (current ? !current : isAgeVerified()) {
callback2();
}
}).catch((a0) => {
c4343_12.warn("Failed to register Incode interview from WebView", {
error: a0
});
});
break L13;
}
if (r10.kind === "fallback_request") {
requestIncodeSessionBootstrap({
previousInterviewId: r10.previousInterviewId
}).then(({ incode_parameters }) => {
if (incode_parameters?.session_token != null && incode_parameters.interview_id != null) {
callback3({
sessionToken: incode_parameters.session_token,
interviewId: incode_parameters.interview_id
});
} else {
callback3({
error: true
});
}
}).catch((a0) => {
c4343_12.warn("Failed to bootstrap Incode fallback session from WebView", {
error: a0
});
callback3({
error: true
});
});
break L11;
}
if (r10.status !== AgeVerificationIncodeResultStatus.COMPLETED) {
if (ref2.current) {
break L16;
}
ref2.current = true;
onClose();
break L16;
}
callback2();
} catch ($e) {
c4343_12.warn("Failed to parse WebView message", {
error: $e
});
break L16;
}
return void 0;
}
return void 0;
}
return void 0;
}
return void 0;
}
}, [callback2, callback3, onClose]);
memo = useMemo(() => new URL(webviewUrl).origin, [webviewUrl]);
const callback5 = useCallback((a0) => {
let origin;
if (a0.isTopFrame != null && !a0.isTopFrame) {
return true;
}
try {
origin = new URL(a0.url).origin;
} catch ($e) {
origin = null;
}
let r19 = origin === memo;
if (!r19) {
Linking.openURL(a0.url);
r19 = false;
}
return r19;
}, [memo]);
const styles = useStyles();
const r80 = [<Module6759 ref={ref} allowsInlineMediaPlayback mediaCapturePermissionGrantType="grant" javaScriptEnabled source={{
uri: webviewUrl
}} onShouldStartLoadWithRequest={callback5} onMessage={callback4} onError={(event) => {
c4343_12.warn("WebView load error", {
code: event.nativeEvent.code
});
callback();
}} onLoadEnd={() => {
callback();
}} injectedJavaScriptBeforeContentLoaded={injectedJavaScriptBeforeContentLoaded} style={styles.webView} containerStyle={styles.webView} />, ,];
if (state) {
state = <View style={styles.loadingOverlay}>
<ActivityIndicator />
</View>;
}
r80[1] = state;
return <View style={styles.container}>{r80}</View>;
};
@@ -0,0 +1,57 @@
// Metro module 16287 (f16288).
import * as _PlayAgeSignals from "./PlayAgeSignals";
import { AgeSignalsVerificationStatus } from "./PlayAgeSignals";
let env11704 = {};
const r14 = {};
r14[AgeSignalsVerificationStatus.VERIFIED] = "VERIFIED";
r14[AgeSignalsVerificationStatus.SUPERVISED] = "SUPERVISED";
r14[AgeSignalsVerificationStatus.SUPERVISED_APPROVAL_PENDING] = "SUPERVISED_APPROVAL_PENDING";
r14[AgeSignalsVerificationStatus.SUPERVISED_APPROVAL_DENIED] = "SUPERVISED_APPROVAL_DENIED";
r14[AgeSignalsVerificationStatus.UNKNOWN] = "UNKNOWN";
r14[AgeSignalsVerificationStatus.DECLARED] = "DECLARED";
const c11704_3 = r14;
const c11704_4 = Object.fromEntries(Object.entries(r14).map((item) => {
const [r22, r23] = item;
return [r23, Number(r22)];
}));
const r56 = {
getAgeSignals: async () => {
const toAppStoreAgeCheck2 = function toAppStoreAgeCheck(a0) {
return {
platform: "android",
ageLower: a0.ageLower,
ageUpper: a0.ageUpper,
googleUserStatus: a0.userStatus == null ? void 0 : c11704_3[a0.userStatus]
};
};
return toAppStoreAgeCheck2(await _PlayAgeSignals.getAgeSignals());
},
getIsConsideredOlderThan: async (c22951_0, c22951_1) => {
let isConsideredOlderThan;
let c28324_0, c28324_1;
L13: {
let env31024;
c28324_1 = void 0;
const r13 = env31024 = {
$parent: env11704
};
c28324_0 = r13;
env31024[0] = void 0;
if (c22951_1 != null) {
env31024[0] = (function toPlayAgeSignals(a0) {
return {
userStatus: a0.googleUserStatus == null ? void 0 : c11704_4[a0.googleUserStatus],
ageLower: a0.ageLower,
ageUpper: a0.ageUpper
};
})(c22951_1);
isConsideredOlderThan = _PlayAgeSignals.isConsideredOlderThan(env31024[0], c22951_0);
break L13;
}
env31024[0] = await _PlayAgeSignals.getAgeSignals();
return _PlayAgeSignals.isConsideredOlderThan(env31024[0], c22951_0);
}
return isConsideredOlderThan;
}
};
export default r56;
@@ -0,0 +1,179 @@
// Metro module 7616 (f7617).
import { useState, useCallback, useRef, useEffect } from "react";
import { ActivityIndicator } from "react-native";
import { jsxs } from "react/jsx-runtime";
import { useNavigation } from "../../../design/components/Navigator/native/useNavigation.native";
import { useWatchAgeVerificationStatusChange } from "../AgeVerificationUtils";
import { requestGoogleWalletVerification, getGoogleWalletCredential, verifyGoogleWalletCredential } from "../GoogleWalletActionCreators.native";
import MonitoringAgent from "../../monitoring/MonitoringAgent";
import { MetricEvents } from "../../../_bundle/Module5872";
import { intl } from "../../../intl/index.native";
import AgeAssurance_messages from "../AgeAssurance.messages";
import { ModalScreen } from "../../../design/components/Modal/native/ModalScreen.native";
import { ModalContent } from "../../../design/components/Modal/native/ModalContent.native";
import { Stack } from "../../../design/components/Stack/native/Stack.native";
import { Text } from "../../../design/components/Text/native/Text";
import { ButtonGroup } from "../../../design/components/ButtonGroup/native/ButtonGroup.native";
import { Button } from "../../../design/components/Button/native/Button.native";
import { trackAgeVerificationModalClicked, AgeVerificationModalVersion, AgeVerificationModalCta } from "../AgeVerificationAnalyticsUtils";
function $mk115044($env) {
return function getFailureReason(a0) {
const status = a0?.status;
let r3 = "rate_limited";
if (status !== 429) {
const r10 = a0?.code != null;
let r11 = "unknown";
if (r10) {
const code = a0.code;
r11 = code in c4778_9 ? c4778_9[a0.code] : "unknown";
}
r3 = r11;
}
return r3;
};
}
let env4778 = {};
const c4778_9 = {
NOT_AVAILABLE: "not_available",
FAILED: "credential_error"
};
export default function GoogleWalletVerificationScreen(props) {
let callback2, ref;
const { onClose, modalSessionId } = props;
callback2 = void 0;
ref = void 0;
const navigation = useNavigation();
const [state, setState] = useState({
type: "loading"
});
useWatchAgeVerificationStatusChange(onClose);
const callback = useCallback(() => {
navigation.goBack();
}, [navigation]);
callback2 = useCallback(async () => {
let c26006_0, c26006_1, c26006_2;
let c26006_3 = 0;
const r17 = void 0;
const r16 = env4778;
L14: {
try {
let env29842;
c26006_1 = r17;
const r39 = env29842 = {
$parent: r16
};
c26006_0 = r39;
env29842[0] = void 0;
env29842[1] = void 0;
env29842[2] = void 0;
env29842[3] = void 0;
c26006_3 = 1;
env29842[0] = (await requestGoogleWalletVerification()).request_json;
env29842[1] = await getGoogleWalletCredential(env29842[0]);
await verifyGoogleWalletCredential(env29842[1]);
c26006_3 = 0;
} catch ($e) {
const r37 = $e;
let r7 = r37;
c26006_2 = r37;
if (c26006_3 !== 0) {
while (true) {
L32: {
try {
const r138 = c26006_2;
c26006_3 = 0;
env29842[2] = r138;
if (env29842[2]?.code === "CANCELLED") {
MonitoringAgent.increment({
name: MetricEvents.GOOGLE_WALLET_VERIFICATION_FAILED,
tags: ["reason:user_cancelled"]
});
(0, callback)();
break L32;
}
const r160 = env29842[2];
if ((r160 == null ? void 0 : r160.body?.reason) !== "unsupported_issuing_country") {
const r198 = env29842[2];
env29842[3] = $mk115044(env4778)(r198);
MonitoringAgent.increment({
name: MetricEvents.GOOGLE_WALLET_VERIFICATION_FAILED,
tags: [`reason:${env29842[3]}`]
});
(0, setState)({
type: "error",
message: intl.string(AgeAssurance_messages["+pwfOA"])
});
break L14;
}
MonitoringAgent.increment({
name: MetricEvents.GOOGLE_WALLET_VERIFICATION_FAILED,
tags: ["reason:unsupported_issuing_country"]
});
(0, setState)({
type: "error",
message: intl.string(AgeAssurance_messages.Pf5xUq)
});
} catch (r135) {
r7 = r135;
c26006_2 = r135;
if (c26006_3 === 0) {
break;
}
continue;
}
return void 0;
}
return void 0;
}
}
throw r7;
}
}
}, [callback]);
ref = useRef(false);
useEffect(() => {
let c26007_1;
let c26007_0 = navigation.addListener("transitionEnd", (a0) => {
if (!(ref.current || a0.data.closing === true)) {
ref.current = true;
callback2();
}
});
c26007_1 = setTimeout(() => {
if (!ref.current) {
ref.current = true;
callback2();
}
}, 1000);
return () => {
c26007_0();
clearTimeout(c26007_1);
};
}, [navigation, callback2]);
return state.type === "loading" ? <ModalScreen>
<ModalContent>
{(0, jsxs)(Stack, {
align: "center",
justify: "center",
spacing: 16,
children: [<ActivityIndicator size="large" />, <Text variant="text-md/medium" color="text-strong">
{intl.string(AgeAssurance_messages.MlFuBI)}
</Text>]
})}
</ModalContent>
</ModalScreen> : <ModalScreen>
<ModalContent>
{(0, jsxs)(Stack, {
align: "center",
justify: "center",
spacing: 16,
children: [<Text variant="text-md/medium" color="text-strong">{state.message}</Text>, <ButtonGroup>
<Button variant="primary" size="lg" text={intl.string(AgeAssurance_messages.fEUKEv)} onPress={() => {
trackAgeVerificationModalClicked(modalSessionId, AgeVerificationModalVersion.EXPRESSIVE_PRIMARY, AgeVerificationModalCta.METHOD_SELECT);
callback();
}} />
</ButtonGroup>]
})}
</ModalContent>
</ModalScreen>;
};
@@ -0,0 +1,19 @@
// Metro module 16286 (f16287).
import { createApexExperiment } from "../../experiments/apex/index";
const apexExperiment = createApexExperiment({
kind: "user",
name: "2026-07-native-app-store-age-signals",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export function isNativeAppStoreAgeSignalsEnabled(a0) {
return apexExperiment.getConfig({
location: a0
}).enabled;
}
@@ -0,0 +1,19 @@
// Metro module 16285 (f16286).
import { createApexExperiment } from "../../experiments/apex/index";
const apexExperiment = createApexExperiment({
kind: "user",
name: "2026-01-age-and-parental-consent-check",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export function isParentalConsentCheckEnabled(a0) {
return apexExperiment.getConfig({
location: a0
}).enabled;
}
@@ -0,0 +1,122 @@
// Metro module 16284 (f16285).
import UserStore from "../../../stores/UserStore";
import { AnalyticEvents } from "../../../Constants";
import { isMetaQuest } from "../../device/MetaQuestUtils.android";
import { getIsRunningOnSimulator, getSystemVersion } from "../../../utils/native/DeviceUtils";
import { isIOS, getNativePlatform } from "../../../utils/PlatformUtils";
import AutomaticLifecycleManager from "../../../lib/AutomaticLifecycleManager";
import { isParentalConsentCheckEnabled } from "./ParentalConsentExperiment";
import { isNativeAppStoreAgeSignalsEnabled } from "./NativeAppStoreAgeSignalsExperiment";
import * as _AppStoreAgeAssurance_android from "./AppStoreAgeAssurance.android";
import { setAgeRangeThresholds, getIsConsideredOlderThan } from "../../../_bundle/getAndroidPlayAgeRangeStatus";
import { HTTP } from "../../../_bundle/sendRequest";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
import SentryUtils_native from "../../../utils/SentryUtils.native";
let c11701_6 = 26;
let c11701_7 = 2;
class ParentalConsentManager extends AutomaticLifecycleManager {
actions = {
POST_CONNECTION_OPEN: () => this.onPostConnectionOpen()
};
async onPostConnectionOpen() {
const _this = this;
L14: {
L13: {
if (!isParentalConsentCheckEnabled("ParentalConsentManager")) {
break L14;
}
if (UserStore.getCurrentUser() != null && (function isPlatformSupported() {
if (isMetaQuest()) {
return false;
}
if (getIsRunningOnSimulator()) {
return false;
}
const r23 = getSystemVersion().split(".");
const r26 = parseInt(r23[0], 10);
const r27 = parseInt;
let r28 = r23[1];
if (r28 == null) {
r28 = "0";
}
const r29 = r27(r28, 10);
return isIOS() ? r26 > c11701_6 || r26 === c11701_6 && r29 >= c11701_7 : r26 >= 35;
})()) {
await _this.performAgeCheck();
break L13;
}
break L14;
}
return void 0;
}
}
async performAgeCheck() {
let c28322_2;
let c28322_3 = 0;
let c31023_0, c31023_1, c31023_2, c31023_3, c31023_4;
L17: {
try {
c31023_0 = void 0;
c31023_1 = void 0;
c31023_2 = void 0;
c31023_3 = void 0;
c28322_3 = 1;
if (isNativeAppStoreAgeSignalsEnabled("ParentalConsentManager")) {
c31023_1 = _AppStoreAgeAssurance_android.default;
c31023_2 = await _AppStoreAgeAssurance_android.default.getAgeSignals({
firstAgeGate: 18
});
c31023_0 = await c31023_1.getIsConsideredOlderThan(18, c31023_2);
} else {
if (isIOS()) {
setAgeRangeThresholds([18]);
}
c31023_0 = await getIsConsideredOlderThan(18);
}
c31023_3 = (await HTTP.post({
url: "/users/@me/parental-consent-status",
body: {
platform: getNativePlatform(),
parental_consent: c31023_0
},
rejectWithError: true
})).body.should_block;
AnalyticsUtils.track(AnalyticEvents.PARENTAL_CONSENT_CHECKED, {
eligible: c31023_0,
should_block: c31023_3,
platform: getNativePlatform()
});
c28322_3 = 0;
} catch ($e) {
const r37 = $e;
let r8 = r37;
c28322_2 = r37;
if (c28322_3 !== 0) {
while (true) {
try {
const r190 = c28322_2;
c28322_3 = 0;
c31023_4 = r190;
SentryUtils_native.captureException(c31023_4, {
tags: {
source: "parental_consent_manager",
step: "perform_age_check"
}
});
break L17;
} catch (r186) {
r8 = r186;
c28322_2 = r186;
if (c28322_3 === 0) {
break;
}
}
}
}
throw r8;
}
}
}
}
const parentalConsentManager = new ParentalConsentManager();
export default parentalConsentManager;
@@ -0,0 +1,30 @@
// Metro module 16288 (f16289).
import Module16289 from "../../../_bundle/Module16289";
let c11705_3 = {
VERIFIED: 0,
SUPERVISED: 1,
SUPERVISED_APPROVAL_PENDING: 2,
SUPERVISED_APPROVAL_DENIED: 3,
UNKNOWN: 4,
DECLARED: 5
};
export { c11705_3 as AgeSignalsVerificationStatus };
export async function getAgeSignals() {
if (Module16289 == null) {
throw new Error("NativePlayAgeSignalsModule is not available on this platform");
}
return await Module16289.getAgeSignals();
}
export function isConsideredOlderThan(a0, a1) {
if (a0.userStatus == null) {
return true;
}
const userStatus = a0.userStatus;
if (c11705_3.VERIFIED === userStatus) {
return true;
}
if (c11705_3.SUPERVISED !== userStatus && c11705_3.SUPERVISED_APPROVAL_PENDING !== userStatus && c11705_3.SUPERVISED_APPROVAL_DENIED !== userStatus) {
return false;
}
return a0.ageLower != null && a0.ageLower >= a1;
}