@incodetech/web 2.1.1 → 2.2.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ae-signature/ae-signature.es.js +7 -4
- package/dist/antifraud/antifraud.es.js +6 -6
- package/dist/authentication/authentication.es.js +7 -7
- package/dist/{autoFocusTitle-CuRu2lPg.js → autoFocusTitle-gLba2mgp.js} +6 -3
- package/dist/{back-horizontal-hint-xTnSQbzn.js → back-horizontal-hint-BBGuJ75y.js} +1 -1
- package/dist/{back-vertical-hint-BWWlHfX2.js → back-vertical-hint-B9usJ5lY.js} +1 -1
- package/dist/base.css +425 -3290
- package/dist/{bottomSheet-CnWbbUAM.js → bottomSheet-Cp8DLulN.js} +7 -8
- package/dist/certificate-issuance/certificate-issuance.es.js +34 -87
- package/dist/certificate-issuance/styles.css +0 -41
- package/dist/{checkbox-1wUHSoaK.js → checkbox-C38Elx0O.js} +5 -5
- package/dist/connectionError-DAeXp8sE.js +45 -0
- package/dist/consent/consent.es.js +10 -12
- package/dist/consent/styles.css +5 -4
- package/dist/{countrySelector-SvUOyPo0.js → countrySelector-2t-ZTgGo.js} +3 -3
- package/dist/cross-document-data-match/cross-document-data-match.es.js +13 -10
- package/dist/curp-validation/curp-validation.es.js +28 -29
- package/dist/curp-validation/styles.css +47 -0
- package/dist/{customFields-BDsXR7A-.js → customFields-B8HQZ7Mh.js} +13 -14
- package/dist/{customWatchlist-CYoRNCim.js → customWatchlist-_tUmZ855.js} +9 -9
- package/dist/dashboardTheme-CVliZSR-.js +223 -0
- package/dist/{dateInputComposed-DuaofcBl.js → dateInputComposed-eRcbt_SL.js} +5 -5
- package/dist/dateInputComposed-ks0-opuq.js +1 -0
- package/dist/document-capture/document-capture.es.js +1 -1
- package/dist/document-capture/styles.css +85 -70
- package/dist/{documentCapture-DhbO-A-V.js → documentCapture-BvEGCYj-.js} +218 -136
- package/dist/documentCapture-DdHdRPzR.js +2 -0
- package/dist/{dropdownComposed-CoU0enG6.js → dropdownComposed-OHDHzt1Q.js} +18 -11
- package/dist/dropdownComposed-kjG4UblM.js +1 -0
- package/dist/dynamic-forms/styles.css +58 -6
- package/dist/{dynamicForms-BifGbC9F.js → dynamicForms-P-4E42IA.js} +53 -45
- package/dist/ekyb/ekyb.es.js +1 -1
- package/dist/ekyb/styles.css +1 -28
- package/dist/ekybModule-CiaxFHXo.js +2 -0
- package/dist/{ekybModule-DGnTw5UV.js → ekybModule-DmjkzVWE.js} +51 -27
- package/dist/ekyc/ekyc.es.js +1 -1
- package/dist/ekyc/styles.css +2 -2
- package/dist/ekycModule-BVt10kgv.js +2 -0
- package/dist/{ekycModule-Dxpdd0ns.js → ekycModule-Da1Fm7ai.js} +45 -19
- package/dist/electronic-signature/electronic-signature.es.js +1 -1
- package/dist/{ae-signature → electronic-signature}/styles.css +2 -2
- package/dist/{electronic-signature-Ueoffasr.js → electronic-signature-yamI6zHM.js} +31 -23
- package/dist/email/email.es.js +10 -11
- package/dist/{emailInput-DsLkDtER.js → emailInput-B0P2Q-pk.js} +4 -4
- package/dist/{expiredId-BZXLrLk-.js → expiredId-BXXE3srN.js} +6 -6
- package/dist/{extensibility-7sRIN0JC.js → extensibility-iJYzpW6H.js} +440 -374
- package/dist/extensibility.es.js +24 -28
- package/dist/face-match/face-match.es.js +1 -1
- package/dist/face-match/styles.css +9 -609
- package/dist/faceMatch-D4XFihTc.js +2 -0
- package/dist/{faceMatch-DyTBoMDm.js → faceMatch-VtEZvsen.js} +71 -79
- package/dist/field-comparison/field-comparison.es.js +1 -1
- package/dist/fieldComparison-B_r9Bal7.js +2 -0
- package/dist/{fieldComparison-L_knHqgw.js → fieldComparison-NLdDSOEh.js} +11 -12
- package/dist/finalSuccessScreen-DryADx1n.js +500 -0
- package/dist/fiscal-qr/fiscal-qr.es.js +12 -12
- package/dist/flip-animation-CvN8FLNc.js +6996 -0
- package/dist/flow/flow.es.js +81 -45
- package/dist/flow/styles.css +908 -5423
- package/dist/{front-horizontal-hint-B84GgTO1.js → front-horizontal-hint-D3CrWViZ.js} +1 -1
- package/dist/{front-vertical-hint-Bs_avngq.js → front-vertical-hint-BoLZvyx5.js} +1 -1
- package/dist/geolocation/geolocation.es.js +36 -13
- package/dist/geolocation/styles.css +1 -1
- package/dist/government-validation/government-validation.es.js +11 -12
- package/dist/{homeScreen-B6T0JVh8.js → homeScreen-Pv3v_0ji.js} +7 -9
- package/dist/{icons-CJJbIpBq.js → icons--ezYG2Fb.js} +92 -7
- package/dist/id/id.es.js +222 -52
- package/dist/id/styles.css +290 -10
- package/dist/id-back-of-card-DO593HH8.js +83 -0
- package/dist/id-back-of-card-vertical-DArEQ0hE.js +88 -0
- package/dist/id-front-of-card-Bcit7Pnq.js +308 -0
- package/dist/id-front-of-card-vertical-Bcr-KXcl.js +278 -0
- package/dist/id-laser-h-BaUHzX-d.js +480 -0
- package/dist/{id-laser-v-BiUXkM4x.js → id-laser-v-Dv9yEYJE.js} +7 -17
- package/dist/id-selfie-flow/id-selfie-flow.es.js +239 -0
- package/dist/id-selfie-flow/styles.css +749 -0
- package/dist/id-verification/id-verification.es.js +13 -9
- package/dist/{idOcr-WFBvqy3b.js → idOcr-gsIXHq6R.js} +14 -15
- package/dist/identity-reuse/identity-reuse.es.js +6 -8
- package/dist/identity-reuse/styles.css +1 -1
- package/dist/{incode-logo-57XFniXU.js → incode-logo-rGFjZHqi.js} +64 -1
- package/dist/incodeComponent-K9ZWg302.js +713 -0
- package/dist/incodeModule-CcLzar_X.js +25 -0
- package/dist/index.es.js +16 -5
- package/dist/{inputComposed-C1R2LAa3.js → inputComposed-BeROn635.js} +9 -9
- package/dist/inputComposed-CADVQW-o.js +1 -0
- package/dist/{mandatoryConsent-D0GTKu-H.js → mandatoryConsent-BtqB-FxY.js} +9 -11
- package/dist/{capture-CkGvdDNH.js → manualCaptureButton-quGa2ufS.js} +68 -198
- package/dist/manualCaptureButton-t_oIol88.js +300 -0
- package/dist/{modal-OxkFuuiR.js → modal-BjjJFpZu.js} +4 -4
- package/dist/{modal.hooks-ZrzmHAUa.js → modal.hooks-BvXzNWvY.js} +1 -1
- package/dist/{numberedStep-CEb-lFJm.js → numberedStep-DUs77Gy3.js} +1 -1
- package/dist/{optionAccessibleLabel-gfF-58Mv.js → optionAccessibleLabel-DgfHD_mx.js} +6 -6
- package/dist/{otpInput-CnDc6pQm.js → otpInput-D5dLXrmC.js} +72 -36
- package/dist/{passport-horizontal-hint-Bj0ZJY0g.js → passport-horizontal-hint-DgnU-8bl.js} +1 -1
- package/dist/{passport-vertical-hint-Dfk77xUJ.js → passport-vertical-hint-Dd2Wknw7.js} +1 -1
- package/dist/{pdf-BqtJTlor.js → pdf-BUoY_2gv.js} +1 -1
- package/dist/pdfViewer-CZb6obcZ.js +2 -0
- package/dist/{pdfViewer-B97DmT9m.js → pdfViewer-vud1VZv6.js} +5 -7
- package/dist/phone/phone.es.js +13 -12
- package/dist/{phoneInputComposed-DMiXfF-1.js → phoneInputComposed-CeVWTS_O.js} +7 -6
- package/dist/{processing-BeUMfdJJ.js → processing-BsvHyDWa.js} +2 -2
- package/dist/qe-signature/qe-signature.es.js +7 -4
- package/dist/{radioGroupComposed-DuQxslB2.js → radioGroupComposed-DzNGUbZQ.js} +16 -15
- package/dist/redirect-to-mobile/redirect-to-mobile.es.js +132 -45
- package/dist/redirect-to-mobile/styles.css +20 -10
- package/dist/{registerIncodeElement-DaNjbAwZ.js → registerIncodeElement-BduCekz5.js} +1 -1
- package/dist/{richText-CB1fmegc.js → richText-CTHBpZOw.js} +3 -1607
- package/dist/selfie/selfie.es.js +10 -10
- package/dist/selfie/styles.css +16 -949
- package/dist/signature/signature.es.js +27 -19
- package/dist/{ae-signature/styles2.css → signature/styles.css} +4 -4
- package/dist/{snackbar-DS7Mv62v.js → snackbar-C9Mqrh0e.js} +2 -2
- package/dist/spacer-CDlQd12V.js +2344 -0
- package/dist/{spinner-BMeIEK1d.js → spinner-CLZ2fz4u.js} +45 -4
- package/dist/statusPage--GVFSUJp.js +36 -0
- package/dist/{successIcon-B5mGvdx1.js → successIcon-Bj8Y9CuI.js} +1 -1
- package/dist/{tabs-C__chW-u.js → tabs-DweBZTV2.js} +4 -3
- package/dist/themes/dark.css +35 -0
- package/dist/themes/light.css +35 -0
- package/dist/{tutorial-CCfPuVKX.js → tutorial-BZZC93Ur.js} +222 -180
- package/dist/types/ae-signature.d.ts +91 -5
- package/dist/types/antifraud.d.ts +86 -3
- package/dist/types/authentication.d.ts +86 -3
- package/dist/types/certificate-issuance.d.ts +86 -3
- package/dist/types/consent.d.ts +86 -3
- package/dist/types/cross-document-data-match.d.ts +88 -4
- package/dist/types/curp-validation.d.ts +86 -3
- package/dist/types/document-capture.d.ts +88 -4
- package/dist/types/ekyb.d.ts +88 -4
- package/dist/types/ekyc.d.ts +88 -4
- package/dist/types/electronic-signature.d.ts +87 -4
- package/dist/types/email.d.ts +82 -22
- package/dist/types/extensibility.d.ts +157 -5
- package/dist/types/face-match.d.ts +84 -22
- package/dist/types/field-comparison.d.ts +86 -3
- package/dist/types/fiscal-qr.d.ts +89 -5
- package/dist/types/flow.d.ts +92 -2
- package/dist/types/geolocation.d.ts +86 -3
- package/dist/types/government-validation.d.ts +86 -3
- package/dist/types/id-selfie-flow.d.ts +161 -0
- package/dist/types/id-verification.d.ts +87 -4
- package/dist/types/id.d.ts +88 -5
- package/dist/types/identity-reuse.d.ts +82 -2
- package/dist/types/index.d.ts +106 -1
- package/dist/types/phone.d.ts +83 -24
- package/dist/types/qe-signature.d.ts +91 -5
- package/dist/types/redirect-to-mobile.d.ts +4 -1
- package/dist/types/selfie.d.ts +86 -3
- package/dist/types/signature.d.ts +91 -5
- package/dist/types/video-selfie.d.ts +83 -6
- package/dist/types/watchlist.d.ts +91 -5
- package/dist/types/workflow.d.ts +85 -2
- package/dist/{i18n-CU4xq8qC.js → uiConfig-B5ASPUL4.js} +26 -3
- package/dist/{useModuleLoader-Bi26kJbg.js → useModuleLoader-D_YpuVsS.js} +37 -248
- package/dist/{vendor-preact-DThS2ZQ_.js → vendor-preact-mvwZ8mJj.js} +1 -1
- package/dist/{verificationResult-BWWkmeiA.js → verificationResult-B8HwR07t.js} +26 -15
- package/dist/video-selfie/styles.css +349 -1202
- package/dist/video-selfie/video-selfie.es.js +120 -381
- package/dist/watchlist/watchlist.es.js +16 -13
- package/dist/{watchlistForBusiness-D2Uo_TwF.js → watchlistForBusiness-D8Is99bZ.js} +12 -13
- package/dist/workflow/styles.css +501 -3977
- package/dist/workflow/workflow.es.js +25 -18
- package/package.json +22 -20
- package/dist/button-Dz6AsbmF.js +0 -40
- package/dist/cameraView-DIEzM5ru.js +0 -47
- package/dist/cpf-ocr/cpf-ocr.es.js +0 -2
- package/dist/cpf-ocr/styles.css +0 -45
- package/dist/cpfOcr-B79245-3.js +0 -2
- package/dist/cpfOcr-BhxT-lRN.js +0 -92
- package/dist/dateInputComposed-DRzZi6uy.js +0 -1
- package/dist/documentCapture-DXYYyxZl.js +0 -2
- package/dist/dropdownComposed-BAoxIIsE.js +0 -1
- package/dist/ekybModule-C6Nttked.js +0 -2
- package/dist/ekycModule-CDIEjI6V.js +0 -2
- package/dist/errorIcon-BA4T6iy-.js +0 -26
- package/dist/faceMatch-B_HvxLm_.js +0 -2
- package/dist/fieldComparison-DfNEuEE5.js +0 -2
- package/dist/flip-animation-CZYSUtMm.js +0 -6983
- package/dist/hooks-CNu7o-v8.js +0 -186
- package/dist/id-laser-h-CzPegPMn.js +0 -467
- package/dist/incodeComponent-CfzJGETt.js +0 -64
- package/dist/incodeModule-B-4_3JrK.js +0 -13
- package/dist/inputComposed-BaY5q9WM.js +0 -1
- package/dist/loadingIcon-B0ysgiNq.js +0 -148
- package/dist/page-DidH_RkX.js +0 -171
- package/dist/spinner-BCDCoi9C.js +0 -1
- package/dist/statusPage-Bk8nJwXV.js +0 -28
- package/dist/transitionSpinner-CuNCqHNi.js +0 -30
- package/dist/types/cpf-ocr.d.ts +0 -12
- package/dist/typography-BZIpjo97.js +0 -45
- package/dist/uiConfig-D2_wawvr.js +0 -25
- /package/dist/{aligndevicelottie-DFscByAI.js → aligndevicelottie-CfoZ5Uus.js} +0 -0
- /package/dist/{back-tutorial-cI_4VHmE.js → back-tutorial-BHyRHyET.js} +0 -0
- /package/dist/{backdevicelottie-COyhTrxM.js → backdevicelottie-yKkczgFy.js} +0 -0
- /package/dist/{blurdevicelottie-BLVeJHEG.js → blurdevicelottie-8BbophdM.js} +0 -0
- /package/dist/{browser-ponyfill-Df13Th-G.js → browser-ponyfill-CBjGwwPW.js} +0 -0
- /package/dist/{defineProperty-Qjefk7Uf.js → defineProperty-BbpBna-2.js} +0 -0
- /package/dist/{frontdevicelottie-B4tE2PYQ.js → frontdevicelottie-CFcahVLk.js} +0 -0
- /package/dist/{glaredevicelottie-D1pR73sx.js → glaredevicelottie-Cnvah0kz.js} +0 -0
- /package/dist/{id-tutorial-DwO90SAm.js → id-tutorial-BOOsXlAJ.js} +0 -0
- /package/dist/{lottie_light-C6B2ec41.js → lottie_light-Bv56F2Ae.js} +0 -0
- /package/dist/{passport-tutorial-D9JNsMsM.js → passport-tutorial-CeSup6m9.js} +0 -0
- /package/dist/{requiredLabelHint-D0RhuMed.js → requiredLabelHint-Dx0WS2cR.js} +0 -0
- /package/dist/{selfieTutorial-pB-N-fj5.js → selfieTutorial-CYa8bq6B.js} +0 -0
|
@@ -1,29 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import {
|
|
11
|
-
import { t as SuccessIcon } from "./successIcon-B5mGvdx1.js";
|
|
12
|
-
import { t as Modal } from "./modal-OxkFuuiR.js";
|
|
13
|
-
import { n as LoadingBorder, r as FaceOutline, t as Notification } from "./capture-CkGvdDNH.js";
|
|
1
|
+
import { i as useTranslation } from "./uiConfig-B5ASPUL4.js";
|
|
2
|
+
import { S as k, _ as y, d as T, h as q, l as A, m as g, p as d, v as u } from "./vendor-preact-mvwZ8mJj.js";
|
|
3
|
+
import { l as TransitionSpinner, o as Page } from "./incodeComponent-K9ZWg302.js";
|
|
4
|
+
import { a as useAnimationData, n as LoadingIcon, o as Lottie, t as Spacer, u as cn } from "./spacer-CDlQd12V.js";
|
|
5
|
+
import { n as Title } from "./spinner-CLZ2fz4u.js";
|
|
6
|
+
import { n as ErrorIcon, r as Button } from "./incode-logo-rGFjZHqi.js";
|
|
7
|
+
import { v as WarningIcon } from "./icons--ezYG2Fb.js";
|
|
8
|
+
import { t as SuccessIcon } from "./successIcon-Bj8Y9CuI.js";
|
|
9
|
+
import { t as Modal } from "./modal-BjjJFpZu.js";
|
|
10
|
+
import { t as ManualCaptureButton } from "./manualCaptureButton-quGa2ufS.js";
|
|
14
11
|
//#region src/shared/errorContent/errorContent.tsx
|
|
15
12
|
var ErrorContent = ({ title, description, attemptsRemaining, onButtonClick, "data-testid": testId }) => {
|
|
16
13
|
const { t } = useTranslation();
|
|
17
14
|
const noMoreAttempts = attemptsRemaining <= 0;
|
|
18
|
-
const titleRef = A(null);
|
|
19
|
-
y(() => {
|
|
20
|
-
titleRef.current?.focus();
|
|
21
|
-
}, []);
|
|
22
15
|
return /* @__PURE__ */ u(Modal.Root, {
|
|
23
16
|
open: true,
|
|
24
17
|
dismissible: false,
|
|
25
18
|
hasBackdrop: false,
|
|
26
|
-
manageInitialFocus: false,
|
|
27
19
|
class: "IncodeErrorContent",
|
|
28
20
|
children: /* @__PURE__ */ u(Modal.Content, {
|
|
29
21
|
class: "IncodeErrorContentContent",
|
|
@@ -37,15 +29,12 @@ var ErrorContent = ({ title, description, attemptsRemaining, onButtonClick, "dat
|
|
|
37
29
|
children: [
|
|
38
30
|
noMoreAttempts ? /* @__PURE__ */ u(ErrorIcon, { size: 32 }) : /* @__PURE__ */ u(WarningIcon, { size: 32 }),
|
|
39
31
|
/* @__PURE__ */ u(Spacer, { size: 16 }),
|
|
40
|
-
/* @__PURE__ */ u(Title, {
|
|
41
|
-
|
|
42
|
-
id: "incode-modal-title",
|
|
43
|
-
tabIndex: -1,
|
|
44
|
-
className: "IncodeErrorContentTitle",
|
|
32
|
+
/* @__PURE__ */ u(Modal.Title, {
|
|
33
|
+
class: "IncodeErrorContentTitle",
|
|
45
34
|
children: title
|
|
46
35
|
}),
|
|
47
36
|
/* @__PURE__ */ u(Spacer, { size: 12 }),
|
|
48
|
-
/* @__PURE__ */ u(
|
|
37
|
+
/* @__PURE__ */ u(Modal.Subtitle, {
|
|
49
38
|
class: "IncodeErrorContentDescription",
|
|
50
39
|
children: description
|
|
51
40
|
})
|
|
@@ -53,10 +42,10 @@ var ErrorContent = ({ title, description, attemptsRemaining, onButtonClick, "dat
|
|
|
53
42
|
}), /* @__PURE__ */ u("div", {
|
|
54
43
|
class: "IncodeErrorContentAttemptsContainer",
|
|
55
44
|
children: [
|
|
56
|
-
!noMoreAttempts ? /* @__PURE__ */ u("p", {
|
|
45
|
+
!noMoreAttempts ? /* @__PURE__ */ u(k, { children: [/* @__PURE__ */ u("p", {
|
|
57
46
|
class: "IncodeErrorContentAttemptsText",
|
|
58
47
|
children: t("common.attemptsRemaining", { count: attemptsRemaining })
|
|
59
|
-
}) : null,
|
|
48
|
+
}), /* @__PURE__ */ u(Spacer, { size: 24 })] }) : null,
|
|
60
49
|
/* @__PURE__ */ u(Button, {
|
|
61
50
|
onClick: onButtonClick,
|
|
62
51
|
children: noMoreAttempts ? t("common.continue") : t("common.tryAgain")
|
|
@@ -70,88 +59,6 @@ var ErrorContent = ({ title, description, attemptsRemaining, onButtonClick, "dat
|
|
|
70
59
|
});
|
|
71
60
|
};
|
|
72
61
|
//#endregion
|
|
73
|
-
//#region src/shared/lottie/lottie.tsx
|
|
74
|
-
var lottiePromise = null;
|
|
75
|
-
async function loadLottie() {
|
|
76
|
-
if (lottiePromise) return lottiePromise;
|
|
77
|
-
lottiePromise = import("./lottie_light-C6B2ec41.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1)).then((mod) => mod.default);
|
|
78
|
-
return lottiePromise;
|
|
79
|
-
}
|
|
80
|
-
var AUTO_STOP_AFTER_MS = 5e3;
|
|
81
|
-
function Lottie({ animationData, loop = true, autoplay = true, reverse = false, style, className, onComplete, autoStop = false, stopFramePosition }) {
|
|
82
|
-
const containerRef = A(null);
|
|
83
|
-
const effectiveAutoplay = reverse ? false : autoplay;
|
|
84
|
-
const animationOptionsRef = A({
|
|
85
|
-
container: containerRef.current,
|
|
86
|
-
renderer: "svg",
|
|
87
|
-
loop,
|
|
88
|
-
autoplay: effectiveAutoplay,
|
|
89
|
-
animationData
|
|
90
|
-
});
|
|
91
|
-
y(() => {
|
|
92
|
-
animationOptionsRef.current = {
|
|
93
|
-
container: containerRef.current,
|
|
94
|
-
renderer: "svg",
|
|
95
|
-
loop,
|
|
96
|
-
autoplay: effectiveAutoplay,
|
|
97
|
-
animationData
|
|
98
|
-
};
|
|
99
|
-
}, [
|
|
100
|
-
animationData,
|
|
101
|
-
loop,
|
|
102
|
-
effectiveAutoplay
|
|
103
|
-
]);
|
|
104
|
-
y(() => {
|
|
105
|
-
if (!containerRef.current) return;
|
|
106
|
-
let anim;
|
|
107
|
-
let stopTimer;
|
|
108
|
-
let isMounted = true;
|
|
109
|
-
loadLottie().then((lottie) => {
|
|
110
|
-
if (!isMounted) return;
|
|
111
|
-
anim = lottie.loadAnimation(animationOptionsRef.current);
|
|
112
|
-
if (reverse) {
|
|
113
|
-
anim.setDirection(-1);
|
|
114
|
-
anim.goToAndPlay(anim.totalFrames - 1, true);
|
|
115
|
-
}
|
|
116
|
-
if (onComplete) anim.addEventListener("complete", onComplete);
|
|
117
|
-
if (autoStop) stopTimer = window.setTimeout(() => {
|
|
118
|
-
const current = anim;
|
|
119
|
-
if (!current) return;
|
|
120
|
-
if (!stopFramePosition) {
|
|
121
|
-
current.pause();
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
const totalFrames = current.totalFrames;
|
|
125
|
-
if (!totalFrames || totalFrames <= 0) {
|
|
126
|
-
current.stop();
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
const targetFrame = stopFramePosition === "last" ? Math.max(totalFrames - 1, 0) : stopFramePosition === "first" ? 0 : Math.floor((totalFrames - 1) / 2);
|
|
130
|
-
current.goToAndStop(targetFrame, true);
|
|
131
|
-
}, AUTO_STOP_AFTER_MS);
|
|
132
|
-
});
|
|
133
|
-
return () => {
|
|
134
|
-
isMounted = false;
|
|
135
|
-
if (stopTimer !== void 0) window.clearTimeout(stopTimer);
|
|
136
|
-
if (anim) {
|
|
137
|
-
if (onComplete) anim.removeEventListener("complete", onComplete);
|
|
138
|
-
anim.destroy();
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
}, [
|
|
142
|
-
onComplete,
|
|
143
|
-
reverse,
|
|
144
|
-
autoStop,
|
|
145
|
-
stopFramePosition
|
|
146
|
-
]);
|
|
147
|
-
return /* @__PURE__ */ u("div", {
|
|
148
|
-
ref: containerRef,
|
|
149
|
-
style,
|
|
150
|
-
className,
|
|
151
|
-
"aria-hidden": "true"
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
//#endregion
|
|
155
62
|
//#region src/shared/baseTutorial/replaceBaseTutorial.ts
|
|
156
63
|
/**
|
|
157
64
|
* The brand blues baked into the tutorial animations. The selfie oval/shoulders
|
|
@@ -257,8 +164,12 @@ function replaceLottieColor(animationData, hexColor) {
|
|
|
257
164
|
}
|
|
258
165
|
//#endregion
|
|
259
166
|
//#region src/shared/baseTutorial/baseTutorial.tsx
|
|
260
|
-
var BaseTutorial = ({ className = "", animationData, title, titleId, subtitle, onContinue, buttonText, disclaimerText, isLoading, stopFramePosition = "middle" }) => {
|
|
261
|
-
const themedAnimationData = T(() =>
|
|
167
|
+
var BaseTutorial = ({ className = "", animationData, title, titleId, subtitle, onContinue, buttonText, disclaimerText, isLoading, stopFramePosition = "middle", recolor = true }) => {
|
|
168
|
+
const themedAnimationData = T(() => {
|
|
169
|
+
if (!animationData) return null;
|
|
170
|
+
if (!recolor) return animationData;
|
|
171
|
+
return replaceLottieColor(animationData, getCssVariableAsHex("--primitive-color-brand-500"));
|
|
172
|
+
}, [animationData, recolor]);
|
|
262
173
|
return /* @__PURE__ */ u(Page, {
|
|
263
174
|
className: cn("IncodeTutorialPage", className),
|
|
264
175
|
title,
|
|
@@ -283,7 +194,7 @@ var BaseTutorial = ({ className = "", animationData, title, titleId, subtitle, o
|
|
|
283
194
|
class: "IncodeBaseTutorialButtonContainer",
|
|
284
195
|
children: /* @__PURE__ */ u(Button, {
|
|
285
196
|
onClick: onContinue,
|
|
286
|
-
class: "
|
|
197
|
+
class: "IncodeBaseTutorialButton",
|
|
287
198
|
isLoading,
|
|
288
199
|
children: buttonText
|
|
289
200
|
})
|
|
@@ -291,6 +202,198 @@ var BaseTutorial = ({ className = "", animationData, title, titleId, subtitle, o
|
|
|
291
202
|
});
|
|
292
203
|
};
|
|
293
204
|
//#endregion
|
|
205
|
+
//#region src/shared/capture/faceOutline.tsx
|
|
206
|
+
var FaceOutline = () => {
|
|
207
|
+
return /* @__PURE__ */ u("svg", {
|
|
208
|
+
width: "292",
|
|
209
|
+
height: "272",
|
|
210
|
+
viewBox: "0 0 292 272",
|
|
211
|
+
fill: "none",
|
|
212
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
213
|
+
class: "IncodeFaceOutline",
|
|
214
|
+
"aria-hidden": "true",
|
|
215
|
+
children: [/* @__PURE__ */ u("title", { children: "Outline" }), /* @__PURE__ */ u("path", {
|
|
216
|
+
opacity: "0.8",
|
|
217
|
+
d: "M145.633 8.0625C115.606 8.06268 85.6206 26.5984 76.9712 54.293L76.771 54.9492C70.4539 76.1063 75.0139 100.802 76.8687 110.58L77.3628 113.188L75.1528 114.656C66.1187 120.66 63.5861 124.089 62.8472 126.92C62.4669 128.377 62.4644 130.035 62.8003 132.412C63.1635 134.983 63.7533 137.484 64.4233 141.347L64.5142 141.841C65.5056 146.956 68.1062 152.133 71.2749 156.618C74.5527 161.257 78.2056 164.826 80.7349 166.584L82.4517 167.777V169.869C82.4517 177.866 85.3476 186.144 89.6763 194.128C93.9906 202.085 99.5748 209.473 104.623 215.646L105.526 216.751V218.178C105.526 220.891 105.68 223.73 105.801 226.9C105.92 230.011 106.003 233.347 105.828 236.771C105.475 243.652 104.077 251.044 99.7446 258.227C91.1977 272.397 72.1081 284.401 31.8677 291.776L29.936 292.124C-41.1597 304.684 -61.4563 361.617 -63.2153 392.062H145.633V400.062H-71.3638L-71.3462 396.044C-71.2048 364.597 -50.9804 298.295 28.5444 284.246L30.4448 283.904C69.9919 276.654 86.1642 265.253 92.894 254.095C96.3216 248.412 97.5261 242.442 97.8374 236.362C97.9939 233.307 97.9241 230.262 97.8071 227.206C97.7111 224.697 97.5799 222.105 97.5396 219.615C92.5931 213.5 87.048 206.064 82.644 197.941C78.308 189.944 74.9442 181.04 74.5024 171.896C71.3932 169.387 67.8531 165.638 64.7417 161.234C61.1656 156.173 57.9337 149.942 56.6587 143.353L56.5415 142.714C55.9864 139.514 55.2491 136.155 54.8784 133.531C54.4806 130.715 54.3377 127.843 55.106 124.899C56.5344 119.427 60.7885 114.886 68.5259 109.489C66.4692 98.2995 62.7062 74.0938 69.106 52.6602L69.3345 51.9092C79.2266 20.2173 112.853 0.0626788 145.633 0.0625V8.0625ZM145.635 0.0625C178.415 0.0625 212.042 20.2172 221.934 51.9092L222.163 52.6602C228.562 74.0938 224.799 98.2996 222.743 109.489C230.48 114.886 234.734 119.427 236.163 124.899C236.931 127.843 236.788 130.715 236.39 133.531C236.019 136.155 235.282 139.514 234.727 142.714L234.61 143.353C233.335 149.942 230.103 156.173 226.527 161.234C223.415 165.638 219.875 169.387 216.766 171.896C216.324 181.04 212.961 189.944 208.625 197.941C204.221 206.064 198.676 213.5 193.729 219.615C193.689 222.105 193.557 224.697 193.461 227.206C193.344 230.262 193.275 233.307 193.431 236.362C193.742 242.442 194.947 248.412 198.375 254.095C205.104 265.253 221.277 276.654 260.824 283.904L262.724 284.246C342.249 298.294 362.473 364.597 362.615 396.044L362.632 400.062H145.635V392.062H354.484C352.725 361.616 332.429 304.683 261.333 292.124L259.401 291.776C219.161 284.401 200.071 272.397 191.524 258.227C187.192 251.044 185.793 243.652 185.441 236.771C185.266 233.347 185.348 230.011 185.467 226.9C185.589 223.73 185.743 220.891 185.743 218.178V216.751L186.646 215.646C191.694 209.473 197.278 202.085 201.592 194.128C205.921 186.144 208.817 177.866 208.817 169.869V167.777L210.534 166.584C213.063 164.826 216.716 161.257 219.994 156.618C223.162 152.133 225.763 146.956 226.754 141.841L226.845 141.347C227.515 137.484 228.105 134.983 228.468 132.412C228.804 130.034 228.802 128.377 228.421 126.92C227.682 124.089 225.15 120.66 216.116 114.656L213.906 113.188L214.4 110.58C216.255 100.802 220.815 76.1064 214.498 54.9492L214.297 54.293C205.648 26.5983 175.662 8.0625 145.635 8.0625V0.0625Z",
|
|
218
|
+
fill: "white"
|
|
219
|
+
})]
|
|
220
|
+
});
|
|
221
|
+
};
|
|
222
|
+
//#endregion
|
|
223
|
+
//#region src/shared/capture/loadingBorder.tsx
|
|
224
|
+
var IDLE_COLOR = "var(--surface-neutral-100)";
|
|
225
|
+
var getColor = (borderState) => {
|
|
226
|
+
switch (borderState) {
|
|
227
|
+
case "success":
|
|
228
|
+
case "capturing": return "var(--surface-status-positive-500)";
|
|
229
|
+
case "loading": return "var(--surface-brand-500)";
|
|
230
|
+
case "error": return "var(--surface-status-negative-500)";
|
|
231
|
+
case "idle": return IDLE_COLOR;
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
var BorderRing = ({ fill, gradientId, gradientColor }) => /* @__PURE__ */ u("svg", {
|
|
235
|
+
width: "100%",
|
|
236
|
+
height: "100%",
|
|
237
|
+
viewBox: "0 0 335 335",
|
|
238
|
+
fill: "none",
|
|
239
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
240
|
+
children: [
|
|
241
|
+
/* @__PURE__ */ u("title", { children: "Loading Border" }),
|
|
242
|
+
/* @__PURE__ */ u("path", {
|
|
243
|
+
"fill-rule": "evenodd",
|
|
244
|
+
"clip-rule": "evenodd",
|
|
245
|
+
d: "M335 167.5C335 260.008 260.008 335 167.5 335C74.9923 335 0 260.008 0 167.5C0 74.9923 74.9923 0 167.5 0C260.008 0 335 74.9923 335 167.5ZM167.5 325C254.485 325 325 254.485 325 167.5C325 80.5152 254.485 10 167.5 10C80.5152 10 10 80.5152 10 167.5C10 254.485 80.5152 325 167.5 325Z",
|
|
246
|
+
class: "IncodeLoadingBorderPath",
|
|
247
|
+
fill
|
|
248
|
+
}),
|
|
249
|
+
gradientId && gradientColor ? /* @__PURE__ */ u("defs", { children: /* @__PURE__ */ u("radialGradient", {
|
|
250
|
+
id: gradientId,
|
|
251
|
+
cx: "0",
|
|
252
|
+
cy: "0",
|
|
253
|
+
r: "1",
|
|
254
|
+
gradientUnits: "userSpaceOnUse",
|
|
255
|
+
gradientTransform: "translate(240.418 17.4369) rotate(115.674) scale(167.087)",
|
|
256
|
+
children: [/* @__PURE__ */ u("stop", { "stop-color": gradientColor }), /* @__PURE__ */ u("stop", {
|
|
257
|
+
offset: "1",
|
|
258
|
+
"stop-color": gradientColor,
|
|
259
|
+
"stop-opacity": "0"
|
|
260
|
+
})]
|
|
261
|
+
}) }) : null
|
|
262
|
+
]
|
|
263
|
+
});
|
|
264
|
+
var LoadingBorder = ({ borderState = "idle" }) => {
|
|
265
|
+
const gradientId = g();
|
|
266
|
+
const isLoadingOrCapturing = borderState === "loading" || borderState === "capturing";
|
|
267
|
+
const color = getColor(borderState);
|
|
268
|
+
const fill = isLoadingOrCapturing ? `url(#${gradientId})` : color;
|
|
269
|
+
return /* @__PURE__ */ u("div", {
|
|
270
|
+
class: "IncodeLoadingBorder",
|
|
271
|
+
"aria-hidden": "true",
|
|
272
|
+
children: [isLoadingOrCapturing ? /* @__PURE__ */ u("div", {
|
|
273
|
+
class: "IncodeLoadingBorderBase",
|
|
274
|
+
children: /* @__PURE__ */ u(BorderRing, { fill: IDLE_COLOR })
|
|
275
|
+
}) : null, /* @__PURE__ */ u("div", {
|
|
276
|
+
class: cn("IncodeLoadingBorderForeground", { IncodeLoadingBorderSpinning: isLoadingOrCapturing }),
|
|
277
|
+
children: /* @__PURE__ */ u(BorderRing, {
|
|
278
|
+
fill,
|
|
279
|
+
gradientId: isLoadingOrCapturing ? gradientId : void 0,
|
|
280
|
+
gradientColor: isLoadingOrCapturing ? color : void 0
|
|
281
|
+
})
|
|
282
|
+
})]
|
|
283
|
+
});
|
|
284
|
+
};
|
|
285
|
+
//#endregion
|
|
286
|
+
//#region src/shared/capture/notification.tsx
|
|
287
|
+
var Notification = ({ detectionState, disabled, guideStyle = "silhouette" }) => {
|
|
288
|
+
const { t } = useTranslation();
|
|
289
|
+
const liveRef = A(null);
|
|
290
|
+
const lastAnnouncedRef = A({
|
|
291
|
+
message: "",
|
|
292
|
+
at: 0
|
|
293
|
+
});
|
|
294
|
+
const prevDetectionStateRef = A(detectionState);
|
|
295
|
+
const prevDisabledRef = A(disabled);
|
|
296
|
+
const hasAnnouncedInstructionsRef = A(false);
|
|
297
|
+
const clearTimerRef = A();
|
|
298
|
+
const outerTimerRef = A();
|
|
299
|
+
const dotted = guideStyle === "dottedOutline";
|
|
300
|
+
const centerFaceText = t(dotted ? "notifications.centerFace" : "notifications.centerFaceV2");
|
|
301
|
+
const text = {
|
|
302
|
+
idle: centerFaceText,
|
|
303
|
+
noFace: t("notifications.faceNotFound"),
|
|
304
|
+
tooManyFaces: t("notifications.tooManyFaces"),
|
|
305
|
+
tooClose: t("notifications.moveAway"),
|
|
306
|
+
tooFar: t("notifications.moveCloser"),
|
|
307
|
+
blur: t("notifications.onBlur"),
|
|
308
|
+
dark: t("notifications.onDark"),
|
|
309
|
+
faceAngle: t(dotted ? "notifications.onFaceAngle" : "notifications.onFaceAngleV2"),
|
|
310
|
+
headWear: t("notifications.removeHeadwear"),
|
|
311
|
+
lenses: t("notifications.removeLenses"),
|
|
312
|
+
eyesClosed: t("notifications.eyesClosed"),
|
|
313
|
+
faceMask: t("notifications.mask"),
|
|
314
|
+
centerFace: centerFaceText,
|
|
315
|
+
getReady: t("notifications.getReady"),
|
|
316
|
+
capturing: t("idv2.capture.takingPhoto"),
|
|
317
|
+
error: t("common.tryAgain")
|
|
318
|
+
}[detectionState] ?? "";
|
|
319
|
+
const announce = q((message) => {
|
|
320
|
+
const now = Date.now();
|
|
321
|
+
const last = lastAnnouncedRef.current;
|
|
322
|
+
if (message === last.message && now - last.at < 200) return;
|
|
323
|
+
lastAnnouncedRef.current = {
|
|
324
|
+
message,
|
|
325
|
+
at: now
|
|
326
|
+
};
|
|
327
|
+
const node = liveRef.current;
|
|
328
|
+
if (!node) return;
|
|
329
|
+
clearTimeout(clearTimerRef.current);
|
|
330
|
+
node.textContent = "";
|
|
331
|
+
outerTimerRef.current = setTimeout(() => {
|
|
332
|
+
node.textContent = message;
|
|
333
|
+
clearTimerRef.current = setTimeout(() => {
|
|
334
|
+
node.textContent = "";
|
|
335
|
+
}, 3e3);
|
|
336
|
+
}, 50);
|
|
337
|
+
}, []);
|
|
338
|
+
y(() => {
|
|
339
|
+
const wasDisabled = prevDisabledRef.current;
|
|
340
|
+
prevDisabledRef.current = disabled;
|
|
341
|
+
if (disabled || detectionState === "manualCapture") {
|
|
342
|
+
hasAnnouncedInstructionsRef.current = false;
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
if (hasAnnouncedInstructionsRef.current) return;
|
|
346
|
+
const timer = setTimeout(() => {
|
|
347
|
+
hasAnnouncedInstructionsRef.current = true;
|
|
348
|
+
announce(t("selfiev2.autoCapture.defaultAriaInstructions"));
|
|
349
|
+
}, wasDisabled ? 1e3 : 500);
|
|
350
|
+
return () => clearTimeout(timer);
|
|
351
|
+
}, [
|
|
352
|
+
detectionState,
|
|
353
|
+
disabled,
|
|
354
|
+
announce,
|
|
355
|
+
t
|
|
356
|
+
]);
|
|
357
|
+
y(() => {
|
|
358
|
+
const prev = prevDetectionStateRef.current;
|
|
359
|
+
prevDetectionStateRef.current = detectionState;
|
|
360
|
+
if (disabled) return;
|
|
361
|
+
if (prev !== "manualCapture" && detectionState === "manualCapture") announce(t("idv2.capture.manualCapture.modeSwitchAriaAnnouncement"));
|
|
362
|
+
}, [
|
|
363
|
+
announce,
|
|
364
|
+
detectionState,
|
|
365
|
+
t,
|
|
366
|
+
disabled
|
|
367
|
+
]);
|
|
368
|
+
y(() => {
|
|
369
|
+
if (disabled || !text) return;
|
|
370
|
+
announce(text);
|
|
371
|
+
}, [
|
|
372
|
+
text,
|
|
373
|
+
announce,
|
|
374
|
+
disabled
|
|
375
|
+
]);
|
|
376
|
+
y(() => {
|
|
377
|
+
return () => {
|
|
378
|
+
clearTimeout(outerTimerRef.current);
|
|
379
|
+
clearTimeout(clearTimerRef.current);
|
|
380
|
+
};
|
|
381
|
+
}, []);
|
|
382
|
+
return /* @__PURE__ */ u(k, { children: [/* @__PURE__ */ u("div", {
|
|
383
|
+
ref: liveRef,
|
|
384
|
+
class: "IncodeCaptureVisuallyHidden",
|
|
385
|
+
"aria-live": "assertive",
|
|
386
|
+
"aria-atomic": "true"
|
|
387
|
+
}), text ? /* @__PURE__ */ u(k, { children: [/* @__PURE__ */ u("div", {
|
|
388
|
+
class: "IncodeNotification",
|
|
389
|
+
"aria-hidden": "true",
|
|
390
|
+
children: /* @__PURE__ */ u("p", {
|
|
391
|
+
class: "IncodeNotificationText",
|
|
392
|
+
children: text
|
|
393
|
+
})
|
|
394
|
+
}), /* @__PURE__ */ u(Spacer, { size: 24 })] }) : null] });
|
|
395
|
+
};
|
|
396
|
+
//#endregion
|
|
294
397
|
//#region src/modules/selfie/avatarCanvas.tsx
|
|
295
398
|
/**
|
|
296
399
|
* Mounts the avatar `<canvas>` in place of the live selfie video. The element
|
|
@@ -490,67 +593,9 @@ var ErrorModal = ({ error, attemptsRemaining, onTryAgain }) => {
|
|
|
490
593
|
});
|
|
491
594
|
};
|
|
492
595
|
//#endregion
|
|
493
|
-
//#region src/modules/selfie/cameraButton.tsx
|
|
494
|
-
var CameraButton = () => {
|
|
495
|
-
return /* @__PURE__ */ u("div", {
|
|
496
|
-
class: "IncodeCameraButton",
|
|
497
|
-
children: /* @__PURE__ */ u("svg", {
|
|
498
|
-
width: "64",
|
|
499
|
-
height: "64",
|
|
500
|
-
viewBox: "0 0 64 64",
|
|
501
|
-
fill: "none",
|
|
502
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
503
|
-
"aria-hidden": "true",
|
|
504
|
-
children: [
|
|
505
|
-
/* @__PURE__ */ u("circle", {
|
|
506
|
-
cx: "32",
|
|
507
|
-
cy: "32",
|
|
508
|
-
r: "32",
|
|
509
|
-
class: "IncodeCameraButtonBackground"
|
|
510
|
-
}),
|
|
511
|
-
/* @__PURE__ */ u("path", {
|
|
512
|
-
d: "M55.5874 31.8191C55.5872 18.6938 44.9464 8.0537 31.821 8.0537C18.6958 8.05385 8.05581 18.6939 8.05566 31.8191C8.05566 44.9444 18.6958 55.5853 31.821 55.5854C44.9465 55.5854 55.5874 44.9445 55.5874 31.8191ZM57.5566 31.8191C57.5566 46.0321 46.034 57.5547 31.821 57.5547C17.6082 57.5545 6.08643 46.032 6.08643 31.8191C6.08657 17.6063 17.6083 6.08462 31.821 6.08447C46.0339 6.08447 57.5565 17.6062 57.5566 31.8191Z",
|
|
513
|
-
class: "IncodeCameraButtonRing"
|
|
514
|
-
}),
|
|
515
|
-
/* @__PURE__ */ u("path", {
|
|
516
|
-
d: "M35.5186 20.6768C36.887 20.677 37.995 21.777 37.9951 23.1338V24.1045H41.4766C43.0397 24.1052 44.3074 25.3626 44.3076 26.9131V38.5459C44.3076 40.0966 43.0398 41.3535 41.4766 41.3535H21.5381C19.975 41.3533 18.7081 40.0965 18.708 38.5459V26.9131C18.7083 25.3627 19.9751 24.1057 21.5381 24.1055H25.0205V23.1338C25.0206 21.7769 26.1285 20.6768 27.4971 20.6768H35.5186ZM31.5068 26.5273C28.0604 26.5273 25.2559 29.309 25.2559 32.7285C25.2559 36.148 28.0604 38.9297 31.5068 38.9297C34.954 38.9297 37.7588 36.148 37.7588 32.7285C37.7588 29.309 34.954 26.5274 31.5068 26.5273ZM31.5068 28.6348C33.7835 28.6348 35.6357 30.4728 35.6357 32.7305C35.6356 34.9887 33.7833 36.8252 31.5068 36.8252C29.2303 36.8252 27.3791 34.9887 27.3789 32.7305C27.3789 30.4721 29.2302 28.6348 31.5068 28.6348Z",
|
|
517
|
-
class: "IncodeCameraButtonPath"
|
|
518
|
-
})
|
|
519
|
-
]
|
|
520
|
-
})
|
|
521
|
-
});
|
|
522
|
-
};
|
|
523
|
-
//#endregion
|
|
524
|
-
//#region src/modules/selfie/manualCaptureButton.tsx
|
|
525
|
-
var ManualCaptureButton = D(({ onClick, disabled }, ref) => {
|
|
526
|
-
const { t } = useTranslation();
|
|
527
|
-
return /* @__PURE__ */ u("div", {
|
|
528
|
-
class: "IncodeSelfieManualCapture",
|
|
529
|
-
"data-testid": "manual-capture-button",
|
|
530
|
-
children: [
|
|
531
|
-
/* @__PURE__ */ u("p", {
|
|
532
|
-
id: "manual-capture-instructions",
|
|
533
|
-
class: "IncodeSelfieManualCaptureText",
|
|
534
|
-
children: t("selfiev2.manualCapture.instructions")
|
|
535
|
-
}),
|
|
536
|
-
/* @__PURE__ */ u(Spacer, { size: 32 }),
|
|
537
|
-
/* @__PURE__ */ u("div", { children: /* @__PURE__ */ u(Button, {
|
|
538
|
-
ref,
|
|
539
|
-
id: "manual-capture-button",
|
|
540
|
-
variant: "link",
|
|
541
|
-
onClick,
|
|
542
|
-
disabled,
|
|
543
|
-
class: "IncodeSelfieManualCaptureButton",
|
|
544
|
-
"aria-label": t("selfiev2.manualCapture.captureButton"),
|
|
545
|
-
children: /* @__PURE__ */ u(CameraButton, {})
|
|
546
|
-
}) })
|
|
547
|
-
]
|
|
548
|
-
});
|
|
549
|
-
});
|
|
550
|
-
//#endregion
|
|
551
596
|
//#region src/modules/selfie/capture.tsx
|
|
552
597
|
var Capture = ({ manager, state }) => {
|
|
553
|
-
const { captureStatus, stream, detectionStatus, attemptsRemaining, uploadError,
|
|
598
|
+
const { captureStatus, stream, detectionStatus, attemptsRemaining, uploadError, usingBackCamera, ageAssurance, onDeviceMode, obfuscateWithAvatar, avatarCanvas, avatarVariant } = state;
|
|
554
599
|
const [isManualCapturing, setIsManualCapturing] = d(false);
|
|
555
600
|
const { t } = useTranslation();
|
|
556
601
|
const manualCaptureRef = A(null);
|
|
@@ -593,10 +638,10 @@ var Capture = ({ manager, state }) => {
|
|
|
593
638
|
"aria-hidden": "true",
|
|
594
639
|
children: stream ? /* @__PURE__ */ u(k, { children: [obfuscateWithAvatar ? /* @__PURE__ */ u(AvatarCanvas, {
|
|
595
640
|
canvas: avatarCanvas,
|
|
596
|
-
mirrored: !
|
|
641
|
+
mirrored: !usingBackCamera
|
|
597
642
|
}) : /* @__PURE__ */ u(Video, {
|
|
598
643
|
stream,
|
|
599
|
-
mirrored: !
|
|
644
|
+
mirrored: !usingBackCamera
|
|
600
645
|
}), obfuscateWithAvatar && avatarVariant !== "privacy-lens" ? null : /* @__PURE__ */ u("div", {
|
|
601
646
|
class: "IncodeCaptureVideo",
|
|
602
647
|
children: /* @__PURE__ */ u(FaceOutline, {})
|
|
@@ -606,7 +651,8 @@ var Capture = ({ manager, state }) => {
|
|
|
606
651
|
/* @__PURE__ */ u(Spacer, { size: 32 }),
|
|
607
652
|
detectionStatus ? /* @__PURE__ */ u(Notification, {
|
|
608
653
|
detectionState: detectionStatus,
|
|
609
|
-
disabled: !!uploadError || isManualCapturing
|
|
654
|
+
disabled: !!uploadError || isManualCapturing,
|
|
655
|
+
guideStyle: obfuscateWithAvatar && avatarVariant === "avatar-2d" ? "dottedOutline" : "silhouette"
|
|
610
656
|
}) : null,
|
|
611
657
|
detectionStatus === "manualCapture" && !onDeviceMode ? /* @__PURE__ */ u(ManualCaptureButton, {
|
|
612
658
|
ref: manualCaptureRef,
|
|
@@ -680,18 +726,14 @@ var Video = ({ stream, mirrored }) => {
|
|
|
680
726
|
var Tutorial = ({ manager, ageAssurance = false }) => {
|
|
681
727
|
const { t } = useTranslation();
|
|
682
728
|
const [isLoading, setIsLoading] = d(false);
|
|
683
|
-
const
|
|
684
|
-
y(() => {
|
|
685
|
-
import("./selfieTutorial-pB-N-fj5.js").then((module) => {
|
|
686
|
-
setAnimationData(module.default);
|
|
687
|
-
});
|
|
688
|
-
}, []);
|
|
729
|
+
const { data: animationData, isOverride } = useAnimationData("selfie.tutorial");
|
|
689
730
|
const handleContinue = async () => {
|
|
690
731
|
setIsLoading(true);
|
|
691
732
|
await manager.nextStep();
|
|
692
733
|
};
|
|
693
734
|
return /* @__PURE__ */ u(BaseTutorial, {
|
|
694
735
|
animationData,
|
|
736
|
+
recolor: !isOverride,
|
|
695
737
|
title: t(ageAssurance ? "face.tutorial.ageAssuranceTitle" : "face.tutorial.title"),
|
|
696
738
|
titleId: "face-tutorial-heading",
|
|
697
739
|
subtitle: t(ageAssurance ? "face.tutorial.ageAssuranceSubtitle" : "face.tutorial.subtitle"),
|
|
@@ -703,4 +745,4 @@ var Tutorial = ({ manager, ageAssurance = false }) => {
|
|
|
703
745
|
});
|
|
704
746
|
};
|
|
705
747
|
//#endregion
|
|
706
|
-
export { ErrorContent as
|
|
748
|
+
export { ErrorContent as i, Capture as n, BaseTutorial as r, Tutorial as t };
|
|
@@ -1,9 +1,65 @@
|
|
|
1
1
|
import { AeSignatureConfig } from '@incodetech/core/ae-signature';
|
|
2
|
+
import { AeSignatureManager } from '@incodetech/core/ae-signature';
|
|
3
|
+
import { DeepPartial } from '@incodetech/core/flow';
|
|
2
4
|
import { FC } from 'preact/compat';
|
|
5
|
+
import { FunctionComponent } from 'preact';
|
|
6
|
+
import { SVGProps } from 'preact/compat';
|
|
3
7
|
|
|
4
|
-
export declare const AeSignature: FC<AeSignatureModuleProps
|
|
8
|
+
export declare const AeSignature: FC<Omit<AeSignatureModuleProps, "config"> & {
|
|
9
|
+
config?: (Omit<unknown, never> & DeepPartial<Pick<unknown, never>>) | undefined;
|
|
10
|
+
}>;
|
|
5
11
|
|
|
6
|
-
declare type AeSignatureModuleProps = IncodeModuleProps<AeSignatureConfig>;
|
|
12
|
+
declare type AeSignatureModuleProps = IncodeModuleProps<AeSignatureConfig, void, AeSignatureManager>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Allowlisted keys for overridable Lottie animations
|
|
16
|
+
*/
|
|
17
|
+
declare type AnimationKey = 'id.tutorial.front' | 'id.tutorial.back' | 'id.tutorial.passport' | 'id.flip' | 'id.processing' | 'selfie.tutorial' | 'loader.spinner';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A customer-supplied replacement for a built-in Lottie animation.
|
|
21
|
+
*
|
|
22
|
+
* - `LottieAnimationData` — a parsed Lottie JSON object.
|
|
23
|
+
* - `{ url }` — fetched and cached at runtime.
|
|
24
|
+
* - `{ animationData }` — explicit object form.
|
|
25
|
+
*/
|
|
26
|
+
declare type AnimationOverride = LottieAnimationData | {
|
|
27
|
+
url: string;
|
|
28
|
+
} | {
|
|
29
|
+
animationData: LottieAnimationData;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
declare type AnimationOverrides = Partial<Record<AnimationKey, AnimationOverride>>;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Allowlisted keys for overridable branded SVG illustrations
|
|
36
|
+
*/
|
|
37
|
+
declare type AssetKey = 'faceMatch.success' | 'faceMatch.fail' | 'documentCapture.tutorial' | 'id.uploadScreen' | 'id.ageVerification.dob' | 'id.ageVerification.scan' | 'id.ageVerification.privacy' | 'videoSelfie.success' | 'videoSelfie.fail' | 'videoSelfie.tutorial.permission' | 'videoSelfie.tutorial.selfie' | 'videoSelfie.tutorial.frontId' | 'videoSelfie.tutorial.backId' | 'videoSelfie.tutorial.poa' | 'videoSelfie.tutorial.questions' | 'videoSelfie.tutorial.speech' | 'loader.spinner';
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* A customer-supplied replacement for a built-in SVG illustration.
|
|
41
|
+
*
|
|
42
|
+
* - `string` — a URL, or raw `<svg …>` markup (detected by a leading `<`).
|
|
43
|
+
* - `{ url }` — fetched and rendered via `<img>`; no script execution.
|
|
44
|
+
* - `{ raw }` — inline markup; sanitized before injection.
|
|
45
|
+
* - `{ svg }` — a precompiled component, for build-time integrations.
|
|
46
|
+
*/
|
|
47
|
+
declare type AssetOverride = string | {
|
|
48
|
+
url: string;
|
|
49
|
+
} | {
|
|
50
|
+
raw: string;
|
|
51
|
+
} | {
|
|
52
|
+
svg: SvgComponent;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
declare type AssetOverrides = Partial<Record<AssetKey, AssetOverride>>;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* A module `config` intersected with the per-instance override maps. Typed at
|
|
59
|
+
* the UI boundary so core config types (e.g. `IdCaptureConfig`) stay untouched;
|
|
60
|
+
* `FlowConfig` also declares the maps directly.
|
|
61
|
+
*/
|
|
62
|
+
declare type ConfigWithOverrides<TConfig> = TConfig & InstanceOverrides;
|
|
7
63
|
|
|
8
64
|
/**
|
|
9
65
|
* Extra context passed to `onFinish` alongside the result. Lets a host decide
|
|
@@ -25,12 +81,16 @@ declare type IncodeFinishMeta = {
|
|
|
25
81
|
sdkOwnsTerminalScreen?: boolean;
|
|
26
82
|
};
|
|
27
83
|
|
|
28
|
-
declare type IncodeModuleProps<TConfig, TResult = void, TManager = unknown
|
|
84
|
+
declare type IncodeModuleProps<TConfig, TResult = void, TManager = unknown, TConfigInput = ConfigWithOverrides<TConfig>> = {
|
|
29
85
|
/**
|
|
30
86
|
* Module configuration required to render the flow.
|
|
31
87
|
* For Web Components, this is typically assigned via `element.config = ...`.
|
|
88
|
+
*
|
|
89
|
+
* Also carries optional per-instance `assets`/`animations` override maps;
|
|
90
|
+
* they override the global `setup({ uiConfig })` values for this
|
|
91
|
+
* element only and are ignored by the core manager.
|
|
32
92
|
*/
|
|
33
|
-
config?:
|
|
93
|
+
config?: TConfigInput;
|
|
34
94
|
/**
|
|
35
95
|
* Optional pre-built manager. When provided, the module does not create or manage the manager lifecycle.
|
|
36
96
|
*/
|
|
@@ -56,10 +116,36 @@ declare type IncodeModuleProps<TConfig, TResult = void, TManager = unknown> = {
|
|
|
56
116
|
onError?: (error: string | undefined, errorCode?: number, moduleErrorCode?: string) => void;
|
|
57
117
|
};
|
|
58
118
|
|
|
119
|
+
/**
|
|
120
|
+
* Per-instance asset/animation overrides for a single mounted SDK module.
|
|
121
|
+
*
|
|
122
|
+
* These ride on the module's `config` prop and are published once at the
|
|
123
|
+
* module root by `registerIncodeModuleElement`, so a deep `<Asset>`/`<AnimatedAsset>`
|
|
124
|
+
* reads them via {@link useInstanceOverrides} without any prop drilling.
|
|
125
|
+
*/
|
|
126
|
+
declare type InstanceOverrides = {
|
|
127
|
+
assets?: AssetOverrides;
|
|
128
|
+
animations?: AnimationOverrides;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
declare type LottieAnimationData = {
|
|
132
|
+
fr: number;
|
|
133
|
+
v: string;
|
|
134
|
+
ip: number;
|
|
135
|
+
op: number;
|
|
136
|
+
w: number;
|
|
137
|
+
h: number;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
/** An SVG imported as a Preact component (the `?react` import shape). */
|
|
141
|
+
declare type SvgComponent = FunctionComponent<SVGProps<SVGSVGElement>>;
|
|
142
|
+
|
|
59
143
|
export { }
|
|
60
144
|
|
|
61
145
|
declare global {
|
|
62
146
|
interface HTMLElementTagNameMap {
|
|
63
|
-
'incode-ae-signature': HTMLElement & IncodeModuleProps<AeSignatureConfig
|
|
147
|
+
'incode-ae-signature': HTMLElement & IncodeModuleProps<AeSignatureConfig,
|
|
148
|
+
void,
|
|
149
|
+
AeSignatureManager>;
|
|
64
150
|
}
|
|
65
151
|
}
|