decord/source/modules/age_assurance/native/GoogleWalletVerificationScreen.tsx

210 lines
7.6 KiB
TypeScript
Raw Normal View History

// Module ID: 8687
// Function ID: 8688
2026-07-20 16:05:17 +00:00
// Name: GoogleWalletVerificationScreen
// Dependencies: [5, 32, 19, 17, 21, 1483, 4849, 8558, 8536, 7704, 7709, 1114, 2946, 8539, 8540, 5054, 4632, 5514, 5056, 8531, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 8687 (GoogleWalletVerificationScreen)
import AgeVerificationAnalyticsUtils from "AgeVerificationAnalyticsUtils" /* 8531 */;
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
import _slicedToArray from "module_32" /* 32 */;
import noop from "module_19" /* 19 */;
2026-07-20 16:05:17 +00:00
require = fn;
const ActivityIndicator = fn(17).ActivityIndicator;
const jsxProd = fn(21);
({ jsx: closure_7, jsxs: closure_8 } = jsxProd);
2026-07-23 10:11:24 +00:00
let closure_9 = { NOT_AVAILABLE: "not_available", FAILED: "credential_error" };
const size = fn(2);
let result = size.fileFinishedImporting("modules/age_assurance/native/GoogleWalletVerificationScreen.tsx");
2026-07-20 16:05:17 +00:00
2026-09-03 10:05:34 +00:00
export default function GoogleWalletVerificationScreen(onClose) {
onClose = onClose.onClose;
const onComplete = onClose.onComplete;
const modalSessionId = onClose.modalSessionId;
_slicedToArray = undefined;
2026-07-29 08:29:29 +00:00
let callback;
const navigation = onClose(modalSessionId[5]).useNavigation();
2026-09-03 10:05:34 +00:00
let obj = onClose(modalSessionId[5]);
[tmp5, c4] = callback.useState({ type: "loading" });
2026-09-03 10:05:34 +00:00
let items = [onComplete, onClose];
callback = callback.useCallback(() => {
if (onComplete != null) {
tmp();
}
onClose();
2026-07-20 16:05:17 +00:00
}, items);
const tmp4 = _slicedToArray(callback.useState({ type: "loading" }), 2);
const watchAgeVerificationStatusChange = onClose(modalSessionId[6]).useWatchAgeVerificationStatusChange(callback);
2026-09-03 10:05:34 +00:00
const items1 = [navigation];
const callback1 = callback.useCallback(() => {
2026-09-03 10:05:34 +00:00
navigation.goBack();
}, items1);
const items2 = [callback1, callback];
const callback2 = callback.useCallback(navigation(function*(arg0, value) {
yield closure_0(tmp51[7]).requestGoogleWalletVerification();
2026-08-04 21:03:28 +00:00
if (1 === tmp7) {
2026-09-03 10:05:34 +00:00
c3 = 0;
closure_128_2 = tmp51;
2026-08-04 21:03:28 +00:00
let code;
if (closure_128_2 != null) {
code = closure_128_2.code;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
if ("CANCELLED" === code) {
tmp3(tmp51[9]).increment({ name: onClose(tmp51[10]).MetricEvents.GOOGLE_WALLET_VERIFICATION_FAILED, tags: ["reason:user_cancelled"] });
closure_129_6();
c5 = 3;
return { value: undefined, done: true };
2026-08-04 21:03:28 +00:00
} else {
let reason;
if (closure_128_2 != null) {
const body = closure_128_2.body;
2026-08-04 21:03:28 +00:00
if (body != null) {
reason = body.reason;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
}
if ("unsupported_issuing_country" === reason) {
tmp3(tmp51[9]).increment({ name: onClose(tmp51[10]).MetricEvents.GOOGLE_WALLET_VERIFICATION_FAILED, tags: ["reason:unsupported_issuing_country"] });
const obj11 = { type: "error", message: null };
const intl = onClose(tmp51[11]).intl;
obj11.message = intl.string(tmp3(tmp51[12]).Pf5xUq);
closure_129_4(obj11);
c5 = 3;
return { value: undefined, done: true };
2026-07-29 08:29:29 +00:00
} else {
closure_128_3 = (function getFailureReason(status) {
status = undefined;
if (status != null) {
status = status.status;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
let str = "rate_limited";
if (429 !== status) {
let code;
if (status != null) {
code = status.code;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
let str3 = "unknown";
if (null != code) {
str3 = "unknown";
if (status.code in closure_1_9) {
str3 = tmp3[status.code];
2026-08-04 21:03:28 +00:00
}
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
str = str3;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
return str;
})(closure_128_2);
const obj14 = { name: onClose(tmp51[10]).MetricEvents.GOOGLE_WALLET_VERIFICATION_FAILED, tags: null };
2026-08-04 21:03:28 +00:00
const _HermesInternal = HermesInternal;
const items = ["reason:" + closure_128_3];
obj14.tags = items;
tmp3(tmp51[9]).increment(obj14);
const obj15 = { type: "error", message: null };
const intl2 = onClose(tmp51[11]).intl;
obj15.message = intl2.string(tmp3(tmp51[12])["+pwfOA"]);
closure_129_4(obj15);
c5 = 3;
tmp3(tmp51[9]);
2026-07-29 08:29:29 +00:00
}
}
2026-08-04 21:03:28 +00:00
} else if (2 === tmp7) {
if (arg0 === 1) {
c5 = 3;
throw value;
2026-08-04 21:03:28 +00:00
} else if (arg0 === 2) {
2026-09-03 10:05:34 +00:00
c3 = 0;
c5 = 3;
return { value, done: true };
2026-08-04 21:03:28 +00:00
} else {
const request_json = value.request_json;
c4 = 3;
c5 = 1;
return { value: onClose(tmp51[7]).getGoogleWalletCredential(request_json), done: false };
2026-08-04 21:03:28 +00:00
}
} else if (3 === tmp7) {
if (arg0 === 1) {
c5 = 3;
throw value;
2026-08-04 21:03:28 +00:00
} else if (arg0 === 2) {
2026-09-03 10:05:34 +00:00
c3 = 0;
c5 = 3;
return { value, done: true };
2026-08-04 21:03:28 +00:00
} else {
closure_128_1 = value;
c4 = 4;
c5 = 1;
return { value: onClose(tmp51[7]).verifyGoogleWalletCredential(closure_128_1), done: false };
2026-08-04 21:03:28 +00:00
}
} else if (arg0 === 1) {
c5 = 3;
throw value;
2026-08-04 21:03:28 +00:00
} else if (arg0 !== 2) {
2026-09-03 10:05:34 +00:00
if (obj.isCurrentUserSuspended()) {
closure_129_5();
2026-09-03 10:05:34 +00:00
}
c3 = 0;
obj = onClose(tmp51[8]);
2026-07-29 08:29:29 +00:00
}
return value;
2026-09-03 10:05:34 +00:00
}), items2);
closure_8 = callback.useRef(false);
2026-09-03 10:05:34 +00:00
const items3 = [navigation, callback2];
const effect = callback.useEffect(() => {
2026-08-24 06:08:38 +00:00
closure_0 = navigation.addListener("transitionEnd", (data) => {
2026-07-29 08:29:29 +00:00
let current = ref.current;
2026-07-20 16:05:17 +00:00
if (!current) {
current = true === data.data.closing;
}
if (!current) {
2026-07-29 08:29:29 +00:00
ref.current = true;
callback2();
2026-07-20 16:05:17 +00:00
}
});
2026-09-03 10:05:34 +00:00
const timeout = setTimeout(() => {
2026-07-29 08:29:29 +00:00
if (!ref.current) {
tmp.current = true;
callback2();
2026-07-20 16:05:17 +00:00
}
}, 1000);
return () => {
closure_0();
2026-07-20 16:05:17 +00:00
clearTimeout(closure_1);
};
2026-09-03 10:05:34 +00:00
}, items3);
2026-07-29 08:29:29 +00:00
if ("loading" === tmp5.type) {
const obj3 = { children: null };
const obj4 = { children: null };
const obj5 = { align: "center", justify: "center", spacing: 16, children: null };
2026-09-03 10:05:34 +00:00
const items4 = [callback2(callback1, { size: "large" }), ];
const obj6 = { variant: "text-md/medium", color: "text-strong", children: null };
2026-09-03 10:05:34 +00:00
let intl = tmp(tmp2[11]).intl;
obj6.children = intl.string(onComplete(tmp2[12]).MlFuBI);
items4[1] = callback2(tmp(tmp2[16]).Text, obj6);
obj5.children = items4;
obj4.children = closure_8(tmp(tmp2[15]).Stack, obj5);
obj3.children = callback2(tmp(tmp2[14]).ModalContent, obj4);
let tmp15 = callback2(tmp(tmp2[13]).ModalScreen, obj3);
2026-07-20 16:05:17 +00:00
} else {
const obj7 = { children: null };
const obj8 = { children: null };
const obj9 = { align: "center", justify: "center", spacing: 16, children: null };
const obj10 = { variant: "text-md/medium", color: "text-strong", children: tmp5.message };
const items5 = [callback2(tmp(tmp2[16]).Text, obj10), ];
let obj11 = { children: null };
const obj12 = { variant: "primary", size: "lg", text: null, onPress: null };
2026-09-03 10:05:34 +00:00
let intl2 = tmp(tmp2[11]).intl;
obj12.text = intl2.string(onComplete(tmp2[12]).fEUKEv);
obj12.onPress = function onPress() {
const result = AgeVerificationAnalyticsUtils.trackAgeVerificationModalClicked(modalSessionId, AgeVerificationAnalyticsUtils.AgeVerificationModalVersion.EXPRESSIVE_PRIMARY, AgeVerificationAnalyticsUtils.AgeVerificationModalCta.METHOD_SELECT);
2026-09-03 10:05:34 +00:00
callback1();
2026-07-20 16:05:17 +00:00
};
obj11.children = callback2(tmp(tmp2[18]).Button, obj12);
items5[1] = callback2(tmp(tmp2[17]).ButtonGroup, obj11);
obj9.children = items5;
obj8.children = closure_8(tmp(tmp2[15]).Stack, obj9);
obj7.children = callback2(tmp(tmp2[14]).ModalContent, obj8);
tmp15 = callback2(tmp(tmp2[13]).ModalScreen, obj7);
2026-07-20 16:05:17 +00:00
}
2026-09-03 10:05:34 +00:00
return tmp15;
2026-07-20 16:05:17 +00:00
};