decord/source/modules/age_assurance/hooks/useAgeVerificationMethods.tsx

197 lines
7.7 KiB
TypeScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 7626
// Function ID: 7627
2026-07-20 16:05:17 +00:00
// Name: useAgeVerificationMethods
2026-07-29 08:29:29 +00:00
// Dependencies: [5, 32, 19, 6779, 6748, 589, 4405, 6749, 6781, 5867, 5872, 7627, 6754, 1236, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-29 08:29:29 +00:00
// Module 7626 (useAgeVerificationMethods)
2026-07-23 10:11:24 +00:00
import initialize from "initialize";
import _slicedToArray from "_slicedToArray";
2026-07-29 08:29:29 +00:00
import noop from "noop";
import closure_6 from "initialize";
2026-07-23 10:11:24 +00:00
import set from "set";
2026-07-29 08:29:29 +00:00
import set from "noop";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let error;
let metroImportAll;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ VERIFICATION_METHOD_TITLE_MAP: error, VerificationMethod: metroImportAll } = set);
2026-07-23 10:11:24 +00:00
let result = set.fileFinishedImporting("modules/age_assurance/hooks/useAgeVerificationMethods.tsx");
2026-07-20 16:05:17 +00:00
export default function useAgeVerificationMethods(onGoogleWalletSelect) {
let classificationId;
let onClose;
onGoogleWalletSelect = onGoogleWalletSelect.onGoogleWalletSelect;
2026-07-29 08:29:29 +00:00
let methods;
let initiateAgeVerification;
let first;
let callback;
2026-07-20 16:05:17 +00:00
({ onClose, classificationId } = onGoogleWalletSelect);
2026-07-23 10:11:24 +00:00
let obj = onGoogleWalletSelect(initiateAgeVerification[5]);
2026-07-29 08:29:29 +00:00
let items = [closure_6];
const stateFromStoresObject = obj.useStateFromStoresObject(items, () => ({ methods: closure_6.methods, loading: closure_6.loading }));
methods = stateFromStoresObject.methods;
2026-07-23 10:11:24 +00:00
obj = { onComplete: onClose, entryPoint: onGoogleWalletSelect(initiateAgeVerification[7]).AgeVerificationModalEntryPoint.EXPRESSIVE_GET_STARTED, shouldShowExpressiveModal: true, classificationId };
initiateAgeVerification = onGoogleWalletSelect(initiateAgeVerification[6]).useInitiateAgeVerification(obj).initiateAgeVerification;
2026-07-20 16:05:17 +00:00
const tmp2 = callback(React.useState(false), 2);
2026-07-29 08:29:29 +00:00
first = tmp2[0];
2026-07-23 10:11:24 +00:00
callback = tmp2[1];
2026-07-20 16:05:17 +00:00
const effect = React.useEffect(() => {
2026-07-23 10:11:24 +00:00
let c0 = false;
let result = onGoogleWalletSelect(initiateAgeVerification[8]).checkGoogleWalletAvailable();
2026-07-20 16:05:17 +00:00
result.then((arg0) => {
2026-07-23 10:11:24 +00:00
if (!c0) {
2026-07-29 08:29:29 +00:00
let result = arg0;
2026-07-23 10:11:24 +00:00
let obj = methods(initiateAgeVerification[9]);
2026-07-29 08:29:29 +00:00
obj = { name: null, tags: null };
obj[0] = onGoogleWalletSelect(initiateAgeVerification[10]).MetricEvents.GOOGLE_WALLET_AVAILABILITY_CHECK;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
2026-07-29 08:29:29 +00:00
const items = ["available:" + arg0];
obj[1] = items;
2026-07-20 16:05:17 +00:00
obj.increment(obj);
2026-07-29 08:29:29 +00:00
if (arg0) {
result = tmp4(tmp3[11]).isGoogleWalletEnabled("age_verification_methods");
const tmp4Result = tmp4(tmp3[11]);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
outer1_4(result);
2026-07-29 08:29:29 +00:00
tmp3 = initiateAgeVerification;
tmp4 = onGoogleWalletSelect;
2026-07-23 10:11:24 +00:00
const tmp7 = outer1_4;
2026-07-20 16:05:17 +00:00
}
});
return () => {
2026-07-23 10:11:24 +00:00
let c0 = true;
2026-07-20 16:05:17 +00:00
};
}, []);
const items1 = [methods];
const effect1 = React.useEffect(() => {
if (null == methods) {
const ageVerificationMethods = onGoogleWalletSelect(initiateAgeVerification[12]).getAgeVerificationMethods();
const obj = onGoogleWalletSelect(initiateAgeVerification[12]);
}
}, items1);
const items2 = [methods, first, onGoogleWalletSelect, initiateAgeVerification];
obj = {
ageVerificationMethods: React.useMemo(() => {
let found1;
2026-07-29 08:29:29 +00:00
if (methods != null) {
const found = methods.filter((arg0) => arg0 !== constants.GOOGLE_WALLET);
const mapped = found.map((arg0) => {
2026-07-20 16:05:17 +00:00
let description;
let title;
2026-07-29 08:29:29 +00:00
let closure_0 = arg0;
if (null == outer1_7[arg0]) {
2026-07-20 16:05:17 +00:00
return null;
} else {
2026-07-29 08:29:29 +00:00
let obj = { id: null, title: null, description: null, onClick: null };
obj[0] = arg0;
2026-07-20 16:05:17 +00:00
({ title, description } = tmp);
2026-07-29 08:29:29 +00:00
const intl = outer1_0(outer1_2[13]).intl;
obj[1] = intl.string(title);
const intl2 = outer1_0(outer1_2[13]).intl;
obj[2] = intl2.string(description);
let closure_1 = outer1_3((arg0) => {
let closure_0 = arg0;
let c2 = 0;
let c1 = 0;
return (function*(arg0) {
if (c1 === 2) {
c1 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
return { value: "HermesInternal", done: null };
}
} else {
try {
c1 = 2;
if (0 === v0) {
if (arg0 === 1) {
c1 = 3;
throw arg1;
} else if (arg0 === 2) {
c1 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
const obj5 = callback(outer2_2[7]);
const result = obj5.trackAgeVerificationModalClicked(callback, callback(outer2_2[7]).AgeVerificationModalVersion.EXPRESSIVE_PRIMARY, callback(outer2_2[7]).AgeVerificationModalCta.METHOD_SELECT, callback);
v0 = 1;
c1 = 1;
const obj1 = { value: null, done: false };
obj1[0] = v0(callback);
return obj1;
}
} else if (arg0 === 1) {
c1 = 3;
throw arg1;
} else if (arg0 === 2) {
c1 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
c1 = 3;
return { value: "HermesInternal", done: null };
}
} catch (tmp5) {
c1 = tmp;
throw tmp5;
}
}
})();
2026-07-20 16:05:17 +00:00
});
2026-07-29 08:29:29 +00:00
obj[3] = function() {
const self = this;
const apply = closure_1.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};
return obj;
}
});
found1 = mapped.filter((arg0) => null != arg0);
}
2026-07-29 08:29:29 +00:00
if (found1 == null) {
2026-07-20 16:05:17 +00:00
found1 = [];
}
if (first) {
if (null != onGoogleWalletSelect) {
2026-07-23 10:11:24 +00:00
if (null != outer1_7[outer1_8.GOOGLE_WALLET]) {
2026-07-29 08:29:29 +00:00
let obj = { id: null, title: null, description: null, onClick: null };
obj[0] = tmp3.GOOGLE_WALLET;
2026-07-23 10:11:24 +00:00
let intl = onGoogleWalletSelect(initiateAgeVerification[13]).intl;
2026-07-29 08:29:29 +00:00
obj[1] = intl.string(tmp4.title);
2026-07-23 10:11:24 +00:00
let intl2 = onGoogleWalletSelect(initiateAgeVerification[13]).intl;
2026-07-29 08:29:29 +00:00
obj[2] = intl2.string(tmp4.description);
obj[3] = function onClick(modalSessionId) {
let obj = outer1_1(outer1_2[9]);
obj = { name: outer1_0(outer1_2[10]).MetricEvents.GOOGLE_WALLET_METHOD_SELECTED };
2026-07-20 16:05:17 +00:00
obj.increment(obj);
2026-07-29 08:29:29 +00:00
const result = outer1_0(outer1_2[7]).trackAgeVerificationModalClicked(modalSessionId, outer1_0(outer1_2[7]).AgeVerificationModalVersion.EXPRESSIVE_PRIMARY, outer1_0(outer1_2[7]).AgeVerificationModalCta.METHOD_SELECT, outer1_8.GOOGLE_WALLET);
callback();
2026-07-20 16:05:17 +00:00
};
const items = [];
2026-07-29 08:29:29 +00:00
items[HermesBuiltin.arraySpread(found1, 0)] = obj;
2026-07-20 16:05:17 +00:00
return items;
}
}
}
return found1;
}, items2),
loading: stateFromStoresObject.loading
};
return obj;
};