@incodetech/web 2.0.1 → 2.1.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 +15 -13
- package/dist/ae-signature/styles.css +3 -17
- package/dist/ae-signature/styles2.css +15 -5
- package/dist/aligndevicelottie-DY_bX_p8.js +12769 -0
- package/dist/antifraud/antifraud.es.js +23 -16
- package/dist/authentication/authentication.es.js +42 -27
- package/dist/autoFocusTitle-BzkUiELM.js +29 -0
- package/dist/{back-horizontal-hint-B8Brxh3U.js → back-horizontal-hint-D_8LptLm.js} +26 -26
- package/dist/back-tutorial-vb1MxlrT.js +14597 -0
- package/dist/{back-vertical-hint-BBo36dxn.js → back-vertical-hint-C1evxxq2.js} +27 -27
- package/dist/backdevicelottie-HypPqBz7.js +16690 -0
- package/dist/base.css +1258 -104
- package/dist/blurdevicelottie-CBXtBFiJ.js +15951 -0
- package/dist/bottomSheet-F1GJfQx_.js +39 -0
- package/dist/browser-ponyfill-CLLvZCVg.js +441 -0
- package/dist/button-CM_hgyIP.js +35 -0
- package/dist/checkbox-BoeLHKgp.js +96 -0
- package/dist/consent/consent.es.js +89 -73
- package/dist/consent/styles.css +35 -22
- package/dist/countrySelector-mSWyHSy4.js +60 -0
- package/dist/cpf-ocr/cpf-ocr.es.js +2 -0
- package/dist/cpfOcr-MtpRztkG.js +92 -0
- package/dist/cpfOcr-jJkYCfsX.js +2 -0
- package/dist/cross-document-data-match/cross-document-data-match.es.js +20 -16
- package/dist/curp-validation/curp-validation.es.js +247 -203
- package/dist/customFields-DXXt9HGM.js +140 -0
- package/dist/customWatchlist-DsW04UF6.js +36 -0
- package/dist/dateInputComposed-C_mh4XBg.js +69 -0
- package/dist/dateInputComposed-Cy6a7ymh.js +1 -0
- package/dist/defineProperty-mefzVtTv.js +39 -0
- package/dist/document-capture/document-capture.es.js +2 -0
- package/dist/document-capture/styles.css +2 -5
- package/dist/documentCapture-8ypBJehw.js +2 -0
- package/dist/documentCapture-BDV_921m.js +880 -0
- package/dist/dropdownComposed-CEWBSdGl.js +1 -0
- package/dist/dropdownComposed-_fgAlo_C.js +380 -0
- package/dist/dynamic-forms/styles.css +25 -13
- package/dist/dynamicForms-DyfnsS7E.js +352 -0
- package/dist/ekyb/ekyb.es.js +2 -2
- package/dist/ekyb/styles.css +2 -0
- package/dist/ekybModule-CIPGmCvD.js +279 -0
- package/dist/ekybModule-DFoYpheB.js +2 -0
- package/dist/ekyc/ekyc.es.js +2 -2
- package/dist/ekyc/styles.css +9 -7
- package/dist/ekycModule-BGzwgjl1.js +2 -0
- package/dist/ekycModule-BuTaC5ct.js +257 -0
- package/dist/electronic-signature/electronic-signature.es.js +2 -2
- package/dist/electronic-signature-B-Q7M0wK.js +430 -0
- package/dist/email/email.es.js +199 -66
- package/dist/emailInput-KZmhjOdZ.js +39 -0
- package/dist/errorIcon-DJRZpd8j.js +26 -0
- package/dist/expiredId-Q1t6aVpk.js +85 -0
- package/dist/extensibility-Cs3KQQdC.js +3070 -0
- package/dist/extensibility.es.js +26 -25
- package/dist/face-match/face-match.es.js +2 -2
- package/dist/face-match/styles.css +0 -4
- package/dist/faceMatch--RDHJe4t.js +343 -0
- package/dist/faceMatch-yEKPYaym.js +2 -0
- package/dist/field-comparison/field-comparison.es.js +2 -0
- package/dist/field-comparison/styles.css +16 -0
- package/dist/fieldComparison-CAF86bTC.js +88 -0
- package/dist/fieldComparison-D0an7T_g.js +2 -0
- package/dist/fiscal-qr/fiscal-qr.es.js +224 -0
- package/dist/fiscal-qr/styles.css +71 -0
- package/dist/{flip-animation-CgwRsEmK.js → flip-animation-BGRvygw9.js} +4221 -4221
- package/dist/flow/flow.es.js +619 -484
- package/dist/flow/styles.css +378 -418
- package/dist/{front-horizontal-hint-DGGGi8e1.js → front-horizontal-hint-Uf5bHCsd.js} +70 -70
- package/dist/{front-vertical-hint-CNr5mE6Q.js → front-vertical-hint-DdWNA45v.js} +81 -81
- package/dist/frontdevicelottie-CLqitJhG.js +17314 -0
- package/dist/geolocation/geolocation.es.js +486 -395
- package/dist/glaredevicelottie-BS04U6Fc.js +14478 -0
- package/dist/governmentValidation/governmentValidation.es.js +166 -93
- package/dist/governmentValidation/styles.css +0 -17
- package/dist/homeScreen-BZnIEDrV.js +264 -0
- package/dist/hooks-Da_yP_Dr.js +149 -0
- package/dist/i18n-CoCO2ZuN.js +2971 -0
- package/dist/icons-Dbs9ZfYM.js +360 -0
- package/dist/id/id.es.js +583 -414
- package/dist/id/styles.css +59 -43
- package/dist/id-laser-h-DX8UbVNH.js +467 -0
- package/dist/id-laser-v-DhnHdjlB.js +490 -0
- package/dist/id-tutorial-lj4iKtYT.js +13165 -0
- package/dist/id-verification/id-verification.es.js +21 -17
- package/dist/idOcr-CjGbb4dB.js +123 -0
- package/dist/identity-reuse/identity-reuse.es.js +311 -182
- package/dist/identity-reuse/styles.css +134 -80
- package/dist/incode-logo-57XFniXU.js +4 -0
- package/dist/incodeComponent-wfnHlnXx.js +63 -0
- package/dist/incodeModule-BUDoTwT9.js +13 -0
- package/dist/index.es.js +16 -13
- package/dist/inputComposed-BEn7_nZd.js +1 -0
- package/dist/inputComposed-CQ4AsvZg.js +99 -0
- package/dist/loadingIcon-B0ysgiNq.js +148 -0
- package/dist/lottie_light-Dp9Bz3mf.js +9031 -0
- package/dist/mandatoryConsent-r0PQHmv-.js +107 -0
- package/dist/modal-nTSaG7nB.js +139 -0
- package/dist/modal.hooks-D2xhIuHA.js +195 -0
- package/dist/numberedStep-CEtwZqLp.js +13 -0
- package/dist/optionAccessibleLabel-CnA-mNAU.js +202 -0
- package/dist/otpInput-_JmtVwa0.js +195 -0
- package/dist/page-DxGQj7Gk.js +71 -0
- package/dist/{passport-horizontal-hint-Bgquwtac.js → passport-horizontal-hint-Bbm2mvSn.js} +55 -55
- package/dist/{passport-tutorial-DwRwtPVX.js → passport-tutorial-zT1ZoA-D.js} +7096 -7084
- package/dist/{passport-vertical-hint-BT1D5BrW.js → passport-vertical-hint-DJbCtBiM.js} +49 -49
- package/dist/pdf-BZA70WbM.js +22398 -0
- package/dist/pdfViewer-BK-yVIve.js +114 -0
- package/dist/phone/phone.es.js +214 -70
- package/dist/phoneInputComposed-DjNdsmPE.js +12142 -0
- package/dist/processing-BM-wT-1W.js +8 -0
- package/dist/qe-signature/qe-signature.es.js +15 -13
- package/dist/radioGroupComposed-BNuaopVr.js +215 -0
- package/dist/redirect-to-mobile/redirect-to-mobile.es.js +2774 -0
- package/dist/redirect-to-mobile/styles.css +19 -269
- package/dist/registerIncodeElement-77NGCDsy.js +11 -0
- package/dist/requiredLabelHint-DEadtiwx.js +17 -0
- package/dist/richText-Cf9aMOCk.js +3153 -0
- package/dist/rolldown-runtime--E5BIlTp.js +33 -0
- package/dist/selfie/selfie.es.js +54 -37
- package/dist/selfie/styles.css +0 -4
- package/dist/selfieTutorial-CtruLyO2.js +2689 -0
- package/dist/signature/signature.es.js +778 -405
- package/dist/snackbar-CxepGC3e.js +16 -0
- package/dist/spinner-B6RxGFrI.js +1 -0
- package/dist/spinner-D8a_2LvW.js +42 -0
- package/dist/statusPage-DMYPUwRZ.js +28 -0
- package/dist/successIcon-BAyDPT7I.js +30 -0
- package/dist/tabs-C8npVBbk.js +103 -0
- package/dist/themes/dark.css +5 -0
- package/dist/themes/light.css +4 -0
- package/dist/transitionSpinner-DRRz-NV8.js +26 -0
- package/dist/{tutorial-9vHAHvMK.js → tutorial-D1qaY2Tm.js} +1105 -856
- package/dist/types/ae-signature.d.ts +4 -1
- package/dist/types/antifraud.d.ts +9 -3
- package/dist/types/authentication.d.ts +4 -1
- package/dist/types/consent.d.ts +4 -1
- package/dist/types/cpf-ocr.d.ts +12 -0
- package/dist/types/cross-document-data-match.d.ts +4 -1
- package/dist/types/curp-validation.d.ts +9 -3
- package/dist/types/document-capture.d.ts +37 -0
- package/dist/types/ekyb.d.ts +4 -1
- package/dist/types/ekyc.d.ts +4 -1
- package/dist/types/electronic-signature.d.ts +4 -1
- package/dist/types/email.d.ts +4 -1
- package/dist/types/extensibility.d.ts +40 -15
- package/dist/types/face-match.d.ts +4 -1
- package/dist/types/field-comparison.d.ts +38 -0
- package/dist/types/fiscal-qr.d.ts +43 -0
- package/dist/types/flow.d.ts +5 -2
- package/dist/types/geolocation.d.ts +4 -1
- package/dist/types/governmentValidation.d.ts +4 -1
- package/dist/types/id-verification.d.ts +4 -1
- package/dist/types/id.d.ts +4 -1
- package/dist/types/identity-reuse.d.ts +4 -1
- package/dist/types/index.d.ts +20 -2
- package/dist/types/phone.d.ts +4 -1
- package/dist/types/qe-signature.d.ts +4 -1
- package/dist/types/redirect-to-mobile.d.ts +17 -0
- package/dist/types/selfie.d.ts +4 -1
- package/dist/types/signature.d.ts +4 -1
- package/dist/types/watchlist.d.ts +4 -1
- package/dist/types/workflow.d.ts +55 -11
- package/dist/typography-YLgHHuao.js +45 -0
- package/dist/uiConfig-D2_wawvr.js +25 -0
- package/dist/useModuleLoader-CeJ2jL25.js +672 -0
- package/dist/vendor-preact-DThS2ZQ_.js +955 -0
- package/dist/verificationResult-Do5SpZ6X.js +64 -0
- package/dist/verifiedByIncode-DjXOdCml.js +103 -0
- package/dist/watchlist/watchlist.es.js +31 -28
- package/dist/watchlistForBusiness-BFFXC9d-.js +80 -0
- package/dist/workflow/styles.css +449 -427
- package/dist/workflow/workflow.es.js +268 -182
- package/package.json +32 -10
- package/dist/aligndevicelottie-DoV8xKjh.js +0 -12757
- package/dist/autoFocusTitle-QexamZ4i.js +0 -16
- package/dist/back-tutorial-1NOQobGO.js +0 -14585
- package/dist/backdevicelottie-C_ceuqY7.js +0 -16678
- package/dist/blurdevicelottie-UO14Y0WC.js +0 -15939
- package/dist/bottomSheet-DE_8TFEC.js +0 -31
- package/dist/browser-ponyfill-jOkuz57z.js +0 -299
- package/dist/button-DcCUEn2n.js +0 -24
- package/dist/checkbox-Cl57ltq_.js +0 -85
- package/dist/countrySelector-CE-JgIsv.js +0 -58
- package/dist/cpfOcr-D_tbwbvh.js +0 -78
- package/dist/customFields-CW38fQUv.js +0 -127
- package/dist/customWatchlist-D9_yjEQd.js +0 -33
- package/dist/dateInputComposed-BpAGsjN6.js +0 -55
- package/dist/dateInputComposed-DU3o6PAV.js +0 -1
- package/dist/defineProperty-Dh8nSJpJ.js +0 -39
- package/dist/documentCapture-xX-JT7ZY.js +0 -763
- package/dist/dropdownComposed-DFRBG22E.js +0 -284
- package/dist/dropdownComposed-DwTzc2YU.js +0 -1
- package/dist/dynamicForms-CJP1Ia6Q.js +0 -262
- package/dist/ekybModule-BSs7mndb.js +0 -280
- package/dist/ekybModule-D9M3E2Gm.js +0 -2
- package/dist/ekycModule-CU9pt5YN.js +0 -246
- package/dist/ekycModule-CZw9cLno.js +0 -2
- package/dist/electronic-signature-COYXjGdd.js +0 -410
- package/dist/emailInput-DppGf9pv.js +0 -37
- package/dist/expiredId-BnmzE8T3.js +0 -70
- package/dist/extensibility-CzEJfRwo.js +0 -2586
- package/dist/faceMatch-B8j0g0Yo.js +0 -2
- package/dist/faceMatch-BV8UD7tj.js +0 -201
- package/dist/frontdevicelottie-Bu6f9fDE.js +0 -17302
- package/dist/glaredevicelottie-B10axYs_.js +0 -14466
- package/dist/homeScreen-DnP1jw9A.js +0 -227
- package/dist/hooks-BVnGysT7.js +0 -80
- package/dist/i18n-9s4OSqwi.js +0 -2010
- package/dist/icons-Cc7zwchP.js +0 -310
- package/dist/id-laser-h-mBAzHVOK.js +0 -467
- package/dist/id-laser-v-CrFg4bcJ.js +0 -483
- package/dist/id-tutorial-BCr42Pnn.js +0 -13153
- package/dist/idOcr-CCjfWQvH.js +0 -94
- package/dist/incode-logo-DX016usY.js +0 -4
- package/dist/incodeComponent-C1o4M0ZK.js +0 -50
- package/dist/incodeModule-BqCjVgEI.js +0 -18
- package/dist/inputComposed-APSw8C7o.js +0 -89
- package/dist/inputComposed-XYrarFxS.js +0 -1
- package/dist/loadingIcon-BN5YRQUb.js +0 -104
- package/dist/mandatoryConsent-DssKMC3v.js +0 -100
- package/dist/modal-NMxsQHAO.js +0 -135
- package/dist/modal.hooks-CAjcIFZK.js +0 -126
- package/dist/numberedStep-CT-alrK5.js +0 -11
- package/dist/optionAccessibleLabel-CzEeX3Q4.js +0 -140
- package/dist/otpInput-DqRA_egd.js +0 -145
- package/dist/page-C1yT4DLb.js +0 -69
- package/dist/pdf-BurGZ08w.js +0 -14967
- package/dist/pdfViewer-BGBNL1Ea.js +0 -63
- package/dist/phoneInputComposed-bvWhGLFZ.js +0 -11206
- package/dist/processing-G_y3o32b.js +0 -6
- package/dist/radioGroupComposed-BbmvxmD2.js +0 -177
- package/dist/redirectToMobile-C3k1gloW.js +0 -1514
- package/dist/requiredLabelHint-BLwgqozE.js +0 -13
- package/dist/richText-DbJ5sl2n.js +0 -1973
- package/dist/rolldown-runtime-CYMK-g2i.js +0 -20
- package/dist/selfieTutorial-BgrlUMXP.js +0 -2677
- package/dist/snackbar-BDp8x7Cv.js +0 -14
- package/dist/spinner-B4dcie2T.js +0 -1
- package/dist/spinner-CKnjVHxw.js +0 -39
- package/dist/statusPage-CUI7ApcU.js +0 -28
- package/dist/successIcon-DbILeIz_.js +0 -28
- package/dist/tabs-DaPyP71c.js +0 -78
- package/dist/transitionSpinner-PIEPU2Vx.js +0 -17
- package/dist/types/cpf-ocr/styles.d.ts +0 -1
- package/dist/types/document-capture/styles.d.ts +0 -1
- package/dist/types/redirect-to-mobile/styles.d.ts +0 -1
- package/dist/typography-CxjaknHN.js +0 -28
- package/dist/uiConfig-CwpQ-IM6.js +0 -20
- package/dist/useModuleLoader-BFiVA41N.js +0 -432
- package/dist/vendor-preact-D6SntenC.js +0 -958
- package/dist/verificationResult-BrVbUJ4U.js +0 -97
- package/dist/verifiedByIncode-ChZBpqNy.js +0 -101
- package/dist/watchlistForBusiness-BcSNtHCV.js +0 -77
package/dist/flow/flow.es.js
CHANGED
|
@@ -1,661 +1,796 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import { a as
|
|
9
|
-
import { getDeviceClass
|
|
10
|
-
import { getRequiredWasmPipelines
|
|
11
|
-
import {
|
|
1
|
+
import { n as useTranslation, o as readStoredLanguage } from "../i18n-CoCO2ZuN.js";
|
|
2
|
+
import { _ as y, c as z, d as T, l as A, o as P, p as d, v as u } from "../vendor-preact-DThS2ZQ_.js";
|
|
3
|
+
import { t as setUiConfig } from "../uiConfig-D2_wawvr.js";
|
|
4
|
+
import { c as useManager } from "../hooks-Da_yP_Dr.js";
|
|
5
|
+
import { t as IncodeComponent } from "../incodeComponent-wfnHlnXx.js";
|
|
6
|
+
import { t as TransitionSpinner } from "../transitionSpinner-DRRz-NV8.js";
|
|
7
|
+
import { t as registerIncodeModuleElement } from "../incodeModule-BUDoTwT9.js";
|
|
8
|
+
import { _ as warmupWasmIfNeeded, a as resolveApiKey, c as HEADLESS_FLOW_MODULE_KEYS, d as fetchTheme, f as initializeFlowManager, h as preloadRedirectToMobile, l as LAZY_UI_MODULES, m as preloadHomeScreen, n as useModulePreloader, o as extractIncodeStatus, p as preloadFirstModule, r as usePrefetchNextModule, s as UnsupportedModule, t as useModuleLoader, u as createFlowManager, y as TerminalErrorPage } from "../useModuleLoader-CeJ2jL25.js";
|
|
9
|
+
import { getDeviceClass } from "@incodetech/core/device";
|
|
10
|
+
import { getRequiredWasmPipelines } from "@incodetech/core/flow";
|
|
11
|
+
import { bootstrapSession, refreshQrUrlUuid } from "@incodetech/core/session";
|
|
12
12
|
//#region src/shared/processing/useDelayedFlag.ts
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Returns `true` only once `isTrue` has stayed `true` continuously for
|
|
15
|
+
* `delayMs`. Resets to `false` immediately when `isTrue` flips back.
|
|
16
|
+
*
|
|
17
|
+
* Useful to suppress transient loading indicators when an operation
|
|
18
|
+
* completes faster than the given threshold.
|
|
19
|
+
*/
|
|
20
|
+
function useDelayedFlag(isTrue, delayMs) {
|
|
21
|
+
const [delayed, setDelayed] = d(false);
|
|
22
|
+
y(() => {
|
|
23
|
+
if (isTrue === false) {
|
|
24
|
+
setDelayed(false);
|
|
18
25
|
return;
|
|
19
26
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
},
|
|
27
|
+
const timeoutId = window.setTimeout(() => {
|
|
28
|
+
setDelayed(true);
|
|
29
|
+
}, delayMs);
|
|
23
30
|
return () => {
|
|
24
|
-
window.clearTimeout(
|
|
31
|
+
window.clearTimeout(timeoutId);
|
|
25
32
|
};
|
|
26
|
-
}, [
|
|
33
|
+
}, [isTrue, delayMs]);
|
|
34
|
+
return delayed;
|
|
27
35
|
}
|
|
28
36
|
//#endregion
|
|
29
37
|
//#region src/modules/flow/createFlowSession.ts
|
|
30
|
-
function
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
async function F(e, t) {
|
|
44
|
-
return k(await P(e), {
|
|
45
|
-
configurationId: e.configurationId,
|
|
46
|
-
externalId: e.externalId,
|
|
47
|
-
externalCustomerId: e.externalCustomerId,
|
|
48
|
-
language: e.lang,
|
|
49
|
-
customFields: e.customFields,
|
|
50
|
-
uuid: e.uuid,
|
|
51
|
-
urlUuid: e.urlUuid,
|
|
52
|
-
interviewId: e.interviewId,
|
|
53
|
-
onUrlUuidRefreshed: e.onUrlUuidRefreshed
|
|
54
|
-
}, t);
|
|
38
|
+
async function createFlowSession(config, signal) {
|
|
39
|
+
return bootstrapSession(await resolveApiKey(config), {
|
|
40
|
+
configurationId: config.configurationId,
|
|
41
|
+
externalId: config.externalId,
|
|
42
|
+
externalCustomerId: config.externalCustomerId,
|
|
43
|
+
language: config.lang,
|
|
44
|
+
customFields: config.customFields,
|
|
45
|
+
uuid: config.uuid,
|
|
46
|
+
urlUuid: config.urlUuid,
|
|
47
|
+
interviewId: config.interviewId,
|
|
48
|
+
loginHint: config.loginHint,
|
|
49
|
+
onUrlUuidRefreshed: config.onUrlUuidRefreshed
|
|
50
|
+
}, signal);
|
|
55
51
|
}
|
|
56
52
|
//#endregion
|
|
57
53
|
//#region src/modules/flow/flowConfig.ts
|
|
58
|
-
function
|
|
59
|
-
return typeof
|
|
54
|
+
function hasFlowToken(config) {
|
|
55
|
+
return typeof config.token === "string";
|
|
60
56
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
63
|
-
return typeof
|
|
57
|
+
function isSelfLoadingFlowConfig(config) {
|
|
58
|
+
const bootstrapConfig = config;
|
|
59
|
+
return typeof bootstrapConfig.configurationId === "string" && (typeof bootstrapConfig.apiKey === "string" || typeof bootstrapConfig.clientId === "string");
|
|
64
60
|
}
|
|
65
61
|
//#endregion
|
|
66
62
|
//#region src/modules/flow/preloadFlow.ts
|
|
67
|
-
var
|
|
68
|
-
function
|
|
69
|
-
|
|
70
|
-
if (!
|
|
63
|
+
var preloadCache = /* @__PURE__ */ new Map();
|
|
64
|
+
function createPreloadHandle(token) {
|
|
65
|
+
const state = preloadCache.get(token);
|
|
66
|
+
if (!state) throw new Error("Preload state not found");
|
|
71
67
|
return {
|
|
72
68
|
get isReady() {
|
|
73
|
-
return
|
|
69
|
+
return state.status === "ready";
|
|
74
70
|
},
|
|
75
71
|
get error() {
|
|
76
|
-
return
|
|
72
|
+
return state.status === "error" ? state.error ?? null : null;
|
|
77
73
|
},
|
|
78
74
|
async waitUntilReady() {
|
|
79
|
-
if (
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
75
|
+
if (state.status === "ready") return;
|
|
76
|
+
if (state.status === "error") throw new Error(state.error ?? "Preload failed");
|
|
77
|
+
return state.readyPromise;
|
|
83
78
|
},
|
|
84
79
|
cancel() {
|
|
85
|
-
|
|
80
|
+
if (state.status === "loading") {
|
|
81
|
+
if (state.unsubscribe) state.unsubscribe();
|
|
82
|
+
state.flowManager.stop();
|
|
83
|
+
state.readyReject(/* @__PURE__ */ new Error("Preload cancelled"));
|
|
84
|
+
preloadCache.delete(token);
|
|
85
|
+
}
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
|
|
91
|
-
if (
|
|
92
|
-
if (
|
|
93
|
-
let
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
89
|
+
function preloadIncodeFlow(config) {
|
|
90
|
+
const { token } = config;
|
|
91
|
+
if (config.urlUuid) throw new Error("preloadIncodeFlow does not support urlUuid; pass it to <IncodeFlow> directly so the SDK can rotate it on mount.");
|
|
92
|
+
if (preloadCache.has(token)) return createPreloadHandle(token);
|
|
93
|
+
let readyResolve;
|
|
94
|
+
let readyReject;
|
|
95
|
+
const readyPromise = new Promise((resolve, reject) => {
|
|
96
|
+
readyResolve = resolve;
|
|
97
|
+
readyReject = reject;
|
|
98
|
+
});
|
|
99
|
+
const flowManager = createFlowManager(config);
|
|
100
|
+
if (flowManager.getState().presentation.shouldPrefetchHome) preloadHomeScreen();
|
|
101
|
+
const state = {
|
|
98
102
|
status: "loading",
|
|
99
|
-
flowManager
|
|
100
|
-
config
|
|
101
|
-
readyPromise
|
|
102
|
-
readyResolve
|
|
103
|
-
readyReject
|
|
103
|
+
flowManager,
|
|
104
|
+
config,
|
|
105
|
+
readyPromise,
|
|
106
|
+
readyResolve,
|
|
107
|
+
readyReject
|
|
104
108
|
};
|
|
105
|
-
|
|
109
|
+
preloadCache.set(token, state);
|
|
110
|
+
const preload = async () => {
|
|
106
111
|
try {
|
|
107
|
-
await
|
|
108
|
-
token:
|
|
109
|
-
lang:
|
|
110
|
-
flowManager
|
|
112
|
+
await initializeFlowManager({
|
|
113
|
+
token: config.token,
|
|
114
|
+
lang: config.lang,
|
|
115
|
+
flowManager
|
|
116
|
+
});
|
|
117
|
+
const themePromise = config.disableDashboardTheme ? Promise.resolve({}) : fetchTheme().then((result) => {
|
|
118
|
+
state.theme = result.theme;
|
|
119
|
+
state.uiConfig = result.uiConfig;
|
|
111
120
|
});
|
|
112
|
-
|
|
113
|
-
|
|
121
|
+
state.unsubscribe = flowManager.subscribe((managerState) => {
|
|
122
|
+
if (managerState.status === "ready") {
|
|
123
|
+
const readyState = managerState;
|
|
124
|
+
warmupWasmIfNeeded(readyState, config.wasmConfig);
|
|
125
|
+
preloadFirstModule(readyState);
|
|
126
|
+
state.unsubscribe?.();
|
|
127
|
+
state.unsubscribe = void 0;
|
|
128
|
+
state.status = "ready";
|
|
129
|
+
state.readyResolve();
|
|
130
|
+
} else if (managerState.status === "error") {
|
|
131
|
+
state.unsubscribe?.();
|
|
132
|
+
state.unsubscribe = void 0;
|
|
133
|
+
state.status = "error";
|
|
134
|
+
state.error = managerState.error;
|
|
135
|
+
state.readyReject(new Error(managerState.error));
|
|
136
|
+
}
|
|
114
137
|
});
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
} catch (e) {
|
|
122
|
-
o.status = "error", o.error = e instanceof Error ? e.message : "Failed to preload", o.readyReject(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to preload")), R.delete(t);
|
|
138
|
+
await themePromise;
|
|
139
|
+
} catch (error) {
|
|
140
|
+
state.status = "error";
|
|
141
|
+
state.error = error instanceof Error ? error.message : "Failed to preload";
|
|
142
|
+
state.readyReject(error instanceof Error ? error : /* @__PURE__ */ new Error("Failed to preload"));
|
|
143
|
+
preloadCache.delete(token);
|
|
123
144
|
}
|
|
124
|
-
}
|
|
145
|
+
};
|
|
146
|
+
preload();
|
|
147
|
+
return createPreloadHandle(token);
|
|
125
148
|
}
|
|
126
|
-
function
|
|
127
|
-
return
|
|
149
|
+
function getPreloadedData(token) {
|
|
150
|
+
return preloadCache.get(token) ?? null;
|
|
128
151
|
}
|
|
129
|
-
function
|
|
130
|
-
|
|
131
|
-
|
|
152
|
+
function consumePreloadedData(token) {
|
|
153
|
+
const state = getPreloadedData(token);
|
|
154
|
+
if (state) preloadCache.delete(token);
|
|
155
|
+
return state;
|
|
132
156
|
}
|
|
133
157
|
//#endregion
|
|
134
158
|
//#region src/modules/flow/useFlowInitialization.ts
|
|
135
|
-
function
|
|
136
|
-
|
|
159
|
+
function maybePreloadHomeScreen(flowManager) {
|
|
160
|
+
if (flowManager.getState().presentation.shouldPrefetchHome) preloadHomeScreen();
|
|
137
161
|
}
|
|
138
|
-
function
|
|
139
|
-
|
|
162
|
+
function maybePreloadRedirectToMobile() {
|
|
163
|
+
if (getDeviceClass() === "desktop") preloadRedirectToMobile();
|
|
140
164
|
}
|
|
141
|
-
function
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
165
|
+
function useFlowInitialization(options) {
|
|
166
|
+
const { lang, disableDashboardTheme, enableHome, onError, useCPF } = options;
|
|
167
|
+
const token = hasFlowToken(options) ? options.token : void 0;
|
|
168
|
+
const flowManagerRef = A(null);
|
|
169
|
+
const [state, setState] = d(() => {
|
|
170
|
+
const preloaded = token ? getPreloadedData(token) : null;
|
|
171
|
+
if (token) {
|
|
172
|
+
if (preloaded?.status === "ready") {
|
|
173
|
+
const consumed = consumePreloadedData(token);
|
|
174
|
+
if (consumed) {
|
|
175
|
+
flowManagerRef.current = consumed.flowManager;
|
|
176
|
+
maybePreloadHomeScreen(consumed.flowManager);
|
|
177
|
+
maybePreloadRedirectToMobile();
|
|
178
|
+
if (consumed.uiConfig) setUiConfig(consumed.uiConfig);
|
|
179
|
+
return {
|
|
180
|
+
status: "ready",
|
|
181
|
+
flowManager: consumed.flowManager
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
}
|
|
150
185
|
}
|
|
151
|
-
|
|
152
|
-
authHint:
|
|
153
|
-
lang:
|
|
154
|
-
enableHome:
|
|
155
|
-
useCPF:
|
|
186
|
+
const flowManager = createFlowManager({
|
|
187
|
+
authHint: options.authHint,
|
|
188
|
+
lang: options.lang,
|
|
189
|
+
enableHome: options.enableHome,
|
|
190
|
+
useCPF: options.useCPF
|
|
156
191
|
});
|
|
157
|
-
|
|
192
|
+
flowManagerRef.current = flowManager;
|
|
193
|
+
maybePreloadHomeScreen(flowManager);
|
|
194
|
+
maybePreloadRedirectToMobile();
|
|
195
|
+
if (preloaded?.status === "error") return {
|
|
158
196
|
status: "error",
|
|
159
|
-
error:
|
|
160
|
-
flowManager
|
|
161
|
-
}
|
|
197
|
+
error: preloaded.error ?? "Preload failed",
|
|
198
|
+
flowManager
|
|
199
|
+
};
|
|
200
|
+
return {
|
|
162
201
|
status: "initializing",
|
|
163
|
-
flowManager
|
|
202
|
+
flowManager
|
|
164
203
|
};
|
|
165
|
-
})
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
204
|
+
});
|
|
205
|
+
const initStartedRef = A(false);
|
|
206
|
+
y(() => {
|
|
207
|
+
if (state.status !== "initializing") return;
|
|
208
|
+
const preloaded = token ? getPreloadedData(token) : null;
|
|
209
|
+
if (token && preloaded?.status === "loading") {
|
|
210
|
+
preloaded.readyPromise.then(() => {
|
|
211
|
+
const consumed = consumePreloadedData(token);
|
|
212
|
+
if (consumed) {
|
|
213
|
+
flowManagerRef.current = consumed.flowManager;
|
|
214
|
+
maybePreloadHomeScreen(consumed.flowManager);
|
|
215
|
+
maybePreloadRedirectToMobile();
|
|
216
|
+
if (consumed.uiConfig) setUiConfig(consumed.uiConfig);
|
|
217
|
+
setState({
|
|
218
|
+
status: "ready",
|
|
219
|
+
flowManager: consumed.flowManager
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
}).catch((error) => {
|
|
223
|
+
const errorMessage = error instanceof Error ? error.message : "Preload failed";
|
|
224
|
+
const errorCode = extractIncodeStatus(error);
|
|
225
|
+
setState({
|
|
179
226
|
status: "error",
|
|
180
|
-
error:
|
|
181
|
-
errorCode
|
|
182
|
-
flowManager:
|
|
183
|
-
})
|
|
227
|
+
error: errorMessage,
|
|
228
|
+
errorCode,
|
|
229
|
+
flowManager: state.flowManager
|
|
230
|
+
});
|
|
231
|
+
onError?.(errorMessage, errorCode);
|
|
184
232
|
});
|
|
185
233
|
return;
|
|
186
234
|
}
|
|
187
|
-
if (
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
235
|
+
if (initStartedRef.current) return;
|
|
236
|
+
initStartedRef.current = true;
|
|
237
|
+
const abortController = new AbortController();
|
|
238
|
+
const { signal } = abortController;
|
|
239
|
+
const initialize = async () => {
|
|
191
240
|
try {
|
|
192
|
-
let
|
|
193
|
-
if (
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
flowManager
|
|
241
|
+
let resolvedToken;
|
|
242
|
+
if (hasFlowToken(options)) {
|
|
243
|
+
resolvedToken = options.token;
|
|
244
|
+
if (options.urlUuid) await refreshQrUrlUuid({
|
|
245
|
+
urlUuid: options.urlUuid,
|
|
246
|
+
onboardingId: null,
|
|
247
|
+
onRefreshed: options.onUrlUuidRefreshed
|
|
248
|
+
}, signal);
|
|
249
|
+
} else if (isSelfLoadingFlowConfig(options)) {
|
|
250
|
+
const session = await createFlowSession(options, signal);
|
|
251
|
+
resolvedToken = session.token;
|
|
252
|
+
state.flowManager.setEndScreenTexts(session.endScreenTitle ?? null, session.endScreenText ?? null);
|
|
253
|
+
} else throw new Error("Flow requires token, or configurationId with apiKey or clientId");
|
|
254
|
+
await initializeFlowManager({
|
|
255
|
+
token: resolvedToken,
|
|
256
|
+
lang,
|
|
257
|
+
flowManager: state.flowManager
|
|
204
258
|
});
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
})
|
|
208
|
-
|
|
259
|
+
const themePromise = disableDashboardTheme ? Promise.resolve() : fetchTheme().then((result) => {
|
|
260
|
+
if (result.uiConfig) setUiConfig(result.uiConfig);
|
|
261
|
+
});
|
|
262
|
+
const flowReadyPromise = state.flowManager.waitForReady();
|
|
263
|
+
await Promise.all([flowReadyPromise, themePromise]);
|
|
264
|
+
setState({
|
|
209
265
|
status: "ready",
|
|
210
|
-
flowManager:
|
|
266
|
+
flowManager: state.flowManager
|
|
211
267
|
});
|
|
212
|
-
} catch (
|
|
213
|
-
if (
|
|
214
|
-
|
|
215
|
-
|
|
268
|
+
} catch (error) {
|
|
269
|
+
if (signal.aborted) return;
|
|
270
|
+
const errorMessage = error instanceof Error ? error.message : "Failed to initialize SDK";
|
|
271
|
+
const errorCode = extractIncodeStatus(error);
|
|
272
|
+
setState({
|
|
216
273
|
status: "error",
|
|
217
|
-
error:
|
|
218
|
-
errorCode
|
|
219
|
-
flowManager:
|
|
220
|
-
})
|
|
274
|
+
error: errorMessage,
|
|
275
|
+
errorCode,
|
|
276
|
+
flowManager: state.flowManager
|
|
277
|
+
});
|
|
278
|
+
onError?.(errorMessage, errorCode);
|
|
221
279
|
}
|
|
222
|
-
}
|
|
280
|
+
};
|
|
281
|
+
initialize();
|
|
282
|
+
return () => abortController.abort();
|
|
223
283
|
}, [
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
])
|
|
284
|
+
token,
|
|
285
|
+
lang,
|
|
286
|
+
disableDashboardTheme,
|
|
287
|
+
enableHome,
|
|
288
|
+
useCPF,
|
|
289
|
+
onError,
|
|
290
|
+
options,
|
|
291
|
+
state
|
|
292
|
+
]);
|
|
293
|
+
return state;
|
|
233
294
|
}
|
|
234
295
|
//#endregion
|
|
235
296
|
//#region src/modules/flow/flow.tsx
|
|
236
|
-
var
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
297
|
+
var LazyHomeScreen = z(() => import("../homeScreen-BZnIEDrV.js").then((module) => ({ default: module.HomeScreen })));
|
|
298
|
+
var IncodeFlowContent = ({ config, onFinish, onError }) => {
|
|
299
|
+
const { i18n } = useTranslation();
|
|
300
|
+
const initState = useFlowInitialization(T(() => ({
|
|
301
|
+
...config,
|
|
302
|
+
onError
|
|
303
|
+
}), [config, onError]));
|
|
304
|
+
const [flowState, flowManager] = useManager(() => initState.flowManager, { autoLoad: false });
|
|
305
|
+
const lazyModuleKey = flowState.presentation.lazyModuleKey;
|
|
306
|
+
const currentModuleKey = flowState.status === "ready" ? flowState.currentStep : void 0;
|
|
307
|
+
const moduleLoaderState = useModuleLoader({
|
|
308
|
+
moduleKey: lazyModuleKey,
|
|
309
|
+
modules: LAZY_UI_MODULES,
|
|
310
|
+
onModuleLoading: config.onModuleLoading,
|
|
311
|
+
onModuleLoaded: config.onModuleLoaded,
|
|
312
|
+
onError
|
|
246
313
|
});
|
|
247
|
-
|
|
248
|
-
moduleKey:
|
|
249
|
-
modules:
|
|
314
|
+
useModulePreloader({
|
|
315
|
+
moduleKey: flowState.status === "ready" && flowState.homeScreen.visible ? currentModuleKey : void 0,
|
|
316
|
+
modules: LAZY_UI_MODULES
|
|
250
317
|
});
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
}, [
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
318
|
+
const currentModuleLoaded = moduleLoaderState.status === "loaded";
|
|
319
|
+
const showHomeLoadingScreen = config.enableHome === true && flowState.status === "ready" && flowState.flow.disableLaunchScreen !== true && flowState.currentStepIndex === 0 && flowState.homeScreen.visible === false && moduleLoaderState.status === "loading";
|
|
320
|
+
const isAwaitingReadyDelayed = useDelayedFlag(flowState.presentation.isAwaitingReady === true, 150);
|
|
321
|
+
const isModuleLoadingDelayed = useDelayedFlag(flowState.status === "ready" && (moduleLoaderState.status === "idle" || moduleLoaderState.status === "loading" || moduleLoaderState.status === "error"), 150);
|
|
322
|
+
usePrefetchNextModule(flowState?.status === "ready" ? flowState.steps : [], flowState?.status === "ready" ? flowState.currentStepIndex : -1, LAZY_UI_MODULES, currentModuleLoaded);
|
|
323
|
+
y(() => {
|
|
324
|
+
if (!config.onFlowEvent) return;
|
|
325
|
+
return flowManager.subscribeFlowEvent(config.onFlowEvent);
|
|
326
|
+
}, [flowManager, config.onFlowEvent]);
|
|
327
|
+
y(() => {
|
|
328
|
+
if (flowState.presentation.shouldPrefetchHome) preloadHomeScreen();
|
|
329
|
+
}, [flowState.presentation.shouldPrefetchHome]);
|
|
330
|
+
y(() => {
|
|
331
|
+
if (readStoredLanguage()) return;
|
|
332
|
+
if (config.lang && i18n.language !== config.lang) i18n.changeLanguage(config.lang);
|
|
333
|
+
}, [config.lang, i18n]);
|
|
334
|
+
y(() => {
|
|
335
|
+
if (flowState?.status !== "ready") return;
|
|
336
|
+
if (flowState.currentStep === "REDIRECT_TO_MOBILE") return;
|
|
337
|
+
const readyState = flowState;
|
|
338
|
+
const requiredPipelines = getRequiredWasmPipelines(readyState.flow);
|
|
339
|
+
if (requiredPipelines.length > 0) {
|
|
340
|
+
config.onWasmWarmup?.(requiredPipelines);
|
|
341
|
+
warmupWasmIfNeeded(readyState, config.wasmConfig);
|
|
342
|
+
}
|
|
343
|
+
}, [flowState, config]);
|
|
344
|
+
const terminalFiredRef = A(false);
|
|
345
|
+
y(() => {
|
|
346
|
+
if (terminalFiredRef.current) return;
|
|
347
|
+
if (flowState?.status === "finished") {
|
|
348
|
+
terminalFiredRef.current = true;
|
|
349
|
+
const finishStatus = flowState.finishStatus;
|
|
350
|
+
queueMicrotask(() => onFinish(finishStatus));
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
if (flowState?.status === "error" && onError) {
|
|
354
|
+
terminalFiredRef.current = true;
|
|
355
|
+
const { error, errorCode } = flowState;
|
|
356
|
+
queueMicrotask(() => onError(error, errorCode));
|
|
357
|
+
}
|
|
270
358
|
}, [
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
359
|
+
flowState?.status,
|
|
360
|
+
onFinish,
|
|
361
|
+
onError,
|
|
362
|
+
flowState
|
|
363
|
+
]);
|
|
364
|
+
y(() => {
|
|
365
|
+
if (flowState?.status === "ready" && flowState.currentStep === "ID" && flowState.steps.includes("TUTORIAL_ID")) flowManager.completeModule();
|
|
366
|
+
}, [flowState, flowManager]);
|
|
367
|
+
const hideSpinnerText = !(config.spinnerConfig?.title || config.spinnerConfig?.subtitle);
|
|
368
|
+
if (initState.status === "error") return /* @__PURE__ */ u("div", {
|
|
279
369
|
class: "IncodeFlow",
|
|
280
|
-
children: /* @__PURE__ */
|
|
370
|
+
children: /* @__PURE__ */ u(TerminalErrorPage, { message: initState.error })
|
|
281
371
|
});
|
|
282
|
-
if (
|
|
372
|
+
if (flowState.homeScreen.visible || showHomeLoadingScreen) return /* @__PURE__ */ u("div", {
|
|
283
373
|
class: "IncodeFlow",
|
|
284
|
-
children: /* @__PURE__ */
|
|
374
|
+
children: /* @__PURE__ */ u(P, {
|
|
285
375
|
fallback: null,
|
|
286
|
-
children: /* @__PURE__ */
|
|
287
|
-
isContinueLoading:
|
|
288
|
-
onContinue: () =>
|
|
376
|
+
children: /* @__PURE__ */ u(LazyHomeScreen, {
|
|
377
|
+
isContinueLoading: flowState.homeScreen.isContinueLoading || showHomeLoadingScreen,
|
|
378
|
+
onContinue: () => flowManager.continueFromHome()
|
|
289
379
|
})
|
|
290
380
|
})
|
|
291
381
|
});
|
|
292
|
-
if (
|
|
382
|
+
if (initState.status === "initializing") return /* @__PURE__ */ u("div", {
|
|
293
383
|
class: "IncodeFlow",
|
|
294
|
-
children: /* @__PURE__ */
|
|
295
|
-
spinnerConfig:
|
|
296
|
-
hideText:
|
|
384
|
+
children: /* @__PURE__ */ u(TransitionSpinner, {
|
|
385
|
+
spinnerConfig: config.spinnerConfig,
|
|
386
|
+
hideText: hideSpinnerText
|
|
297
387
|
})
|
|
298
388
|
});
|
|
299
|
-
if (
|
|
300
|
-
class: "IncodeFlow"
|
|
301
|
-
|
|
302
|
-
spinnerConfig: n.spinnerConfig,
|
|
303
|
-
hideText: A
|
|
304
|
-
})
|
|
305
|
-
}) : /* @__PURE__ */ s("div", { class: "IncodeFlow" });
|
|
306
|
-
if (f.status === "error") return /* @__PURE__ */ s("div", {
|
|
307
|
-
class: "IncodeFlow",
|
|
308
|
-
children: /* @__PURE__ */ s("div", { children: ["Error: ", f.error] })
|
|
309
|
-
});
|
|
310
|
-
if (f.status === "finished") return null;
|
|
311
|
-
if (f?.status === "ready") {
|
|
312
|
-
let { currentStep: e, config: t, flow: r } = f, { flowId: i } = r;
|
|
313
|
-
if (!e || !t) return /* @__PURE__ */ s("div", {
|
|
389
|
+
if (flowState.presentation.isAwaitingReady) {
|
|
390
|
+
if (!isAwaitingReadyDelayed) return /* @__PURE__ */ u("div", { class: "IncodeFlow" });
|
|
391
|
+
return /* @__PURE__ */ u("div", {
|
|
314
392
|
class: "IncodeFlow",
|
|
315
|
-
children: /* @__PURE__ */
|
|
316
|
-
spinnerConfig:
|
|
317
|
-
hideText:
|
|
393
|
+
children: /* @__PURE__ */ u(TransitionSpinner, {
|
|
394
|
+
spinnerConfig: config.spinnerConfig,
|
|
395
|
+
hideText: hideSpinnerText
|
|
318
396
|
})
|
|
319
397
|
});
|
|
320
|
-
|
|
321
|
-
|
|
398
|
+
}
|
|
399
|
+
if (flowState.status === "error") return /* @__PURE__ */ u("div", {
|
|
400
|
+
class: "IncodeFlow",
|
|
401
|
+
children: /* @__PURE__ */ u(TerminalErrorPage, { message: flowState.error })
|
|
402
|
+
});
|
|
403
|
+
if (flowState.status === "finished") return null;
|
|
404
|
+
if (flowState?.status === "ready") {
|
|
405
|
+
const { currentStep, config: flowConfig, flow } = flowState;
|
|
406
|
+
const { flowId } = flow;
|
|
407
|
+
if (!currentStep || !flowConfig) return /* @__PURE__ */ u("div", {
|
|
322
408
|
class: "IncodeFlow",
|
|
323
|
-
children: /* @__PURE__ */
|
|
324
|
-
|
|
325
|
-
|
|
409
|
+
children: /* @__PURE__ */ u(TransitionSpinner, {
|
|
410
|
+
spinnerConfig: config.spinnerConfig,
|
|
411
|
+
hideText: hideSpinnerText
|
|
326
412
|
})
|
|
327
413
|
});
|
|
328
|
-
if (
|
|
414
|
+
if (HEADLESS_FLOW_MODULE_KEYS.has(currentStep)) return /* @__PURE__ */ u("div", { class: "IncodeFlow" });
|
|
415
|
+
if (moduleLoaderState.status === "unsupported") return /* @__PURE__ */ u("div", {
|
|
329
416
|
class: "IncodeFlow",
|
|
330
|
-
children: /* @__PURE__ */
|
|
331
|
-
|
|
332
|
-
|
|
417
|
+
children: /* @__PURE__ */ u(UnsupportedModule, {
|
|
418
|
+
moduleKey: currentStep,
|
|
419
|
+
onNext: () => flowManager.completeModule()
|
|
333
420
|
})
|
|
334
|
-
})
|
|
335
|
-
|
|
336
|
-
|
|
421
|
+
});
|
|
422
|
+
if (moduleLoaderState.status === "idle" || moduleLoaderState.status === "loading" || moduleLoaderState.status === "error") {
|
|
423
|
+
if (!isModuleLoadingDelayed) return /* @__PURE__ */ u("div", { class: "IncodeFlow" });
|
|
424
|
+
return /* @__PURE__ */ u("div", {
|
|
425
|
+
class: "IncodeFlow",
|
|
426
|
+
children: /* @__PURE__ */ u(TransitionSpinner, {
|
|
427
|
+
spinnerConfig: config.spinnerConfig,
|
|
428
|
+
hideText: hideSpinnerText
|
|
429
|
+
})
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
const { Component } = moduleLoaderState;
|
|
433
|
+
if (currentStep === "REDIRECT_TO_MOBILE") return /* @__PURE__ */ u("div", {
|
|
337
434
|
class: "IncodeFlow",
|
|
338
|
-
children: /* @__PURE__ */
|
|
339
|
-
config:
|
|
340
|
-
onFinish: () =>
|
|
341
|
-
onContinue: () =>
|
|
342
|
-
onError
|
|
343
|
-
}, `redirect-to-mobile-${
|
|
435
|
+
children: /* @__PURE__ */ u(Component, {
|
|
436
|
+
config: flowConfig,
|
|
437
|
+
onFinish: () => flowManager.completeFlow(),
|
|
438
|
+
onContinue: () => flowManager.completeModule(),
|
|
439
|
+
onError
|
|
440
|
+
}, `redirect-to-mobile-${flowState.currentStepIndex}`)
|
|
344
441
|
});
|
|
345
|
-
if (
|
|
442
|
+
if (currentStep === "SELFIE") return /* @__PURE__ */ u("div", {
|
|
346
443
|
class: "IncodeFlow",
|
|
347
|
-
children: /* @__PURE__ */
|
|
348
|
-
config:
|
|
349
|
-
onFinish: () =>
|
|
350
|
-
onError: (
|
|
351
|
-
|
|
444
|
+
children: /* @__PURE__ */ u(Component, {
|
|
445
|
+
config: flowConfig,
|
|
446
|
+
onFinish: () => flowManager.completeModule(),
|
|
447
|
+
onError: (error) => {
|
|
448
|
+
onError?.(error ?? "Selfie verification error");
|
|
352
449
|
}
|
|
353
|
-
}, `selfie-${
|
|
450
|
+
}, `selfie-${flowState.currentStepIndex}`)
|
|
354
451
|
});
|
|
355
|
-
if (
|
|
452
|
+
if (currentStep === "AUTHENTICATION") return /* @__PURE__ */ u("div", {
|
|
356
453
|
class: "IncodeFlow",
|
|
357
|
-
children: /* @__PURE__ */
|
|
454
|
+
children: /* @__PURE__ */ u(Component, {
|
|
358
455
|
config: {
|
|
359
|
-
...
|
|
360
|
-
authHint:
|
|
456
|
+
...flowConfig,
|
|
457
|
+
authHint: config.authHint
|
|
361
458
|
},
|
|
362
|
-
onFinish: () =>
|
|
363
|
-
onError: (
|
|
364
|
-
|
|
365
|
-
}
|
|
366
|
-
}, `authentication-${f.currentStepIndex}`)
|
|
459
|
+
onFinish: () => flowManager.completeModule(),
|
|
460
|
+
onError: (error, _errorCode, moduleErrorCode) => flowManager.errorModule(error ?? "Authentication error", moduleErrorCode)
|
|
461
|
+
}, `authentication-${flowState.currentStepIndex}`)
|
|
367
462
|
});
|
|
368
|
-
if (
|
|
463
|
+
if (currentStep === "PHONE") return /* @__PURE__ */ u("div", {
|
|
369
464
|
class: "IncodeFlow",
|
|
370
|
-
children: /* @__PURE__ */
|
|
371
|
-
config:
|
|
372
|
-
onFinish: () =>
|
|
373
|
-
onError: (
|
|
374
|
-
|
|
465
|
+
children: /* @__PURE__ */ u(Component, {
|
|
466
|
+
config: flowConfig,
|
|
467
|
+
onFinish: () => flowManager.completeModule(),
|
|
468
|
+
onError: (error) => {
|
|
469
|
+
onError?.(error ?? "Phone verification error");
|
|
375
470
|
}
|
|
376
|
-
}, `phone-${
|
|
471
|
+
}, `phone-${flowState.currentStepIndex}`)
|
|
377
472
|
});
|
|
378
|
-
if (
|
|
379
|
-
|
|
380
|
-
|
|
473
|
+
if (currentStep === "EMAIL") {
|
|
474
|
+
const emailConfig = flowConfig;
|
|
475
|
+
if (!emailConfig || typeof emailConfig.otpVerification !== "boolean" || typeof emailConfig.otpExpirationInMinutes !== "number") return /* @__PURE__ */ u("div", {
|
|
381
476
|
class: "IncodeFlow",
|
|
382
|
-
children: /* @__PURE__ */
|
|
383
|
-
})
|
|
477
|
+
children: /* @__PURE__ */ u("div", { children: "Error: Invalid email configuration" })
|
|
478
|
+
});
|
|
479
|
+
return /* @__PURE__ */ u("div", {
|
|
384
480
|
class: "IncodeFlow",
|
|
385
|
-
children: /* @__PURE__ */
|
|
386
|
-
config:
|
|
387
|
-
onFinish: () =>
|
|
388
|
-
onError: (
|
|
389
|
-
|
|
481
|
+
children: /* @__PURE__ */ u(Component, {
|
|
482
|
+
config: emailConfig,
|
|
483
|
+
onFinish: () => flowManager.completeModule(),
|
|
484
|
+
onError: (error) => {
|
|
485
|
+
onError?.(error ?? "Email verification error");
|
|
390
486
|
}
|
|
391
|
-
}, `email-${
|
|
487
|
+
}, `email-${flowState.currentStepIndex}`)
|
|
392
488
|
});
|
|
393
489
|
}
|
|
394
|
-
if (
|
|
395
|
-
|
|
396
|
-
return /* @__PURE__ */
|
|
490
|
+
if (currentStep === "ID" || currentStep === "SECOND_ID") {
|
|
491
|
+
const idConfig = flowConfig;
|
|
492
|
+
return /* @__PURE__ */ u("div", {
|
|
397
493
|
class: "IncodeFlow",
|
|
398
|
-
children: /* @__PURE__ */
|
|
399
|
-
config:
|
|
400
|
-
...
|
|
401
|
-
isSecondId:
|
|
402
|
-
} :
|
|
403
|
-
onFinish: () =>
|
|
404
|
-
onError: (
|
|
405
|
-
|
|
494
|
+
children: /* @__PURE__ */ u(Component, {
|
|
495
|
+
config: currentStep === "SECOND_ID" ? {
|
|
496
|
+
...idConfig,
|
|
497
|
+
isSecondId: true
|
|
498
|
+
} : idConfig,
|
|
499
|
+
onFinish: () => flowManager.completeModule(),
|
|
500
|
+
onError: (error) => {
|
|
501
|
+
onError?.(error ?? "ID capture error");
|
|
406
502
|
}
|
|
407
|
-
}, `id-${
|
|
503
|
+
}, `id-${flowState.currentStepIndex}`)
|
|
408
504
|
});
|
|
409
505
|
}
|
|
410
|
-
if (
|
|
411
|
-
|
|
412
|
-
|
|
506
|
+
if (currentStep === "ID_OCR") {
|
|
507
|
+
const idOcrConfig = flowConfig;
|
|
508
|
+
const isSecondId = flowState.steps.includes("SECOND_ID");
|
|
509
|
+
return /* @__PURE__ */ u("div", {
|
|
413
510
|
class: "IncodeFlow",
|
|
414
|
-
children: /* @__PURE__ */
|
|
511
|
+
children: /* @__PURE__ */ u(Component, {
|
|
415
512
|
config: {
|
|
416
|
-
...
|
|
417
|
-
secondId:
|
|
418
|
-
flowId
|
|
513
|
+
...idOcrConfig,
|
|
514
|
+
secondId: idOcrConfig.secondId ?? isSecondId,
|
|
515
|
+
flowId
|
|
419
516
|
},
|
|
420
|
-
onFinish: () =>
|
|
421
|
-
onError: (
|
|
422
|
-
|
|
517
|
+
onFinish: () => flowManager.completeModule(),
|
|
518
|
+
onError: (error) => {
|
|
519
|
+
onError?.(error ?? "ID OCR error");
|
|
423
520
|
}
|
|
424
|
-
}, `id-ocr-${
|
|
521
|
+
}, `id-ocr-${flowState.currentStepIndex}`)
|
|
425
522
|
});
|
|
426
523
|
}
|
|
427
|
-
if (
|
|
524
|
+
if (currentStep === "CPF_OCR") return /* @__PURE__ */ u("div", {
|
|
428
525
|
class: "IncodeFlow",
|
|
429
|
-
children: /* @__PURE__ */
|
|
430
|
-
onFinish: () =>
|
|
431
|
-
onError: (
|
|
432
|
-
|
|
526
|
+
children: /* @__PURE__ */ u(Component, {
|
|
527
|
+
onFinish: () => flowManager.completeModule(),
|
|
528
|
+
onError: (error) => {
|
|
529
|
+
onError?.(error ?? "CPF OCR error");
|
|
433
530
|
}
|
|
434
|
-
}, `cpf-ocr-${
|
|
531
|
+
}, `cpf-ocr-${flowState.currentStepIndex}`)
|
|
435
532
|
});
|
|
436
|
-
if (
|
|
533
|
+
if (currentStep === "FACE_MATCH") return /* @__PURE__ */ u("div", {
|
|
437
534
|
class: "IncodeFlow",
|
|
438
|
-
children: /* @__PURE__ */
|
|
439
|
-
config:
|
|
440
|
-
onFinish: () =>
|
|
441
|
-
onError: (
|
|
442
|
-
|
|
535
|
+
children: /* @__PURE__ */ u(Component, {
|
|
536
|
+
config: flowConfig,
|
|
537
|
+
onFinish: () => flowManager.completeModule(),
|
|
538
|
+
onError: (error) => {
|
|
539
|
+
onError?.(error ?? "Face match error");
|
|
443
540
|
}
|
|
444
|
-
}, `face-match-${
|
|
541
|
+
}, `face-match-${flowState.currentStepIndex}`)
|
|
445
542
|
});
|
|
446
|
-
if (
|
|
543
|
+
if (currentStep === "CURP_VALIDATION") return /* @__PURE__ */ u("div", {
|
|
447
544
|
class: "IncodeFlow",
|
|
448
|
-
children: /* @__PURE__ */
|
|
449
|
-
config:
|
|
450
|
-
onFinish: () =>
|
|
451
|
-
onError: (
|
|
452
|
-
|
|
545
|
+
children: /* @__PURE__ */ u(Component, {
|
|
546
|
+
config: flowConfig,
|
|
547
|
+
onFinish: () => flowManager.completeModule(),
|
|
548
|
+
onError: (error) => {
|
|
549
|
+
onError?.(error ?? "CURP validation error");
|
|
453
550
|
}
|
|
454
|
-
}, `curp-validation-${
|
|
551
|
+
}, `curp-validation-${flowState.currentStepIndex}`)
|
|
455
552
|
});
|
|
456
|
-
if (
|
|
553
|
+
if (currentStep === "GOVT_VALIDATION_PROVISIONING") return /* @__PURE__ */ u("div", {
|
|
457
554
|
class: "IncodeFlow",
|
|
458
|
-
children: /* @__PURE__ */
|
|
459
|
-
config:
|
|
460
|
-
onFinish: () =>
|
|
461
|
-
onError: (
|
|
462
|
-
|
|
555
|
+
children: /* @__PURE__ */ u(Component, {
|
|
556
|
+
config: flowConfig,
|
|
557
|
+
onFinish: () => flowManager.completeModule(),
|
|
558
|
+
onError: (error) => {
|
|
559
|
+
onError?.(error ?? "Government validation error");
|
|
463
560
|
}
|
|
464
|
-
}, `govt-validation-${
|
|
561
|
+
}, `govt-validation-${flowState.currentStepIndex}`)
|
|
465
562
|
});
|
|
466
|
-
if (
|
|
563
|
+
if (currentStep === "INE_VALIDATION") return /* @__PURE__ */ u("div", {
|
|
467
564
|
class: "IncodeFlow",
|
|
468
|
-
children: /* @__PURE__ */
|
|
469
|
-
config:
|
|
470
|
-
onFinish: () =>
|
|
471
|
-
onError: (
|
|
472
|
-
|
|
565
|
+
children: /* @__PURE__ */ u(Component, {
|
|
566
|
+
config: flowConfig,
|
|
567
|
+
onFinish: () => flowManager.completeModule(),
|
|
568
|
+
onError: (error) => {
|
|
569
|
+
onError?.(error ?? "INE validation error");
|
|
473
570
|
}
|
|
474
|
-
}, `
|
|
571
|
+
}, `ine-validation-${flowState.currentStepIndex}`)
|
|
475
572
|
});
|
|
476
|
-
if (
|
|
573
|
+
if (currentStep === "GEOLOCATION") return /* @__PURE__ */ u("div", {
|
|
477
574
|
class: "IncodeFlow",
|
|
478
|
-
children: /* @__PURE__ */
|
|
479
|
-
config:
|
|
480
|
-
onFinish: () =>
|
|
481
|
-
onError: (
|
|
482
|
-
|
|
575
|
+
children: /* @__PURE__ */ u(Component, {
|
|
576
|
+
config: flowConfig,
|
|
577
|
+
onFinish: () => flowManager.completeModule(),
|
|
578
|
+
onError: (error) => {
|
|
579
|
+
onError?.(error ?? "Geolocation error");
|
|
483
580
|
}
|
|
484
|
-
}, `
|
|
581
|
+
}, `geolocation-${flowState.currentStepIndex}`)
|
|
485
582
|
});
|
|
486
|
-
if (
|
|
583
|
+
if (currentStep === "EXTERNAL_VERIFICATION") return /* @__PURE__ */ u("div", {
|
|
487
584
|
class: "IncodeFlow",
|
|
488
|
-
children: /* @__PURE__ */
|
|
489
|
-
config:
|
|
490
|
-
onFinish: () =>
|
|
491
|
-
onError: (
|
|
492
|
-
|
|
585
|
+
children: /* @__PURE__ */ u(Component, {
|
|
586
|
+
config: { flowId: flowState.flow.flowId },
|
|
587
|
+
onFinish: () => flowManager.completeModule(),
|
|
588
|
+
onError: (error) => {
|
|
589
|
+
onError?.(error ?? "External verification error");
|
|
493
590
|
}
|
|
494
|
-
}, `
|
|
591
|
+
}, `ekyc-${flowState.currentStepIndex}`)
|
|
495
592
|
});
|
|
496
|
-
if (
|
|
593
|
+
if (currentStep === "DOCUMENT_CAPTURE") return /* @__PURE__ */ u("div", {
|
|
497
594
|
class: "IncodeFlow",
|
|
498
|
-
children: /* @__PURE__ */
|
|
595
|
+
children: /* @__PURE__ */ u(Component, {
|
|
596
|
+
config: flowConfig,
|
|
597
|
+
onFinish: () => flowManager.completeModule(),
|
|
598
|
+
onError: (error) => {
|
|
599
|
+
onError?.(error ?? "Document capture error");
|
|
600
|
+
}
|
|
601
|
+
}, `document-capture-${flowState.currentStepIndex}`)
|
|
602
|
+
});
|
|
603
|
+
if (currentStep === "ADDRESS") return /* @__PURE__ */ u("div", {
|
|
604
|
+
class: "IncodeFlow",
|
|
605
|
+
children: /* @__PURE__ */ u(Component, {
|
|
499
606
|
config: {
|
|
500
|
-
...
|
|
607
|
+
...flowConfig,
|
|
501
608
|
processingType: "addressStatement"
|
|
502
609
|
},
|
|
503
|
-
onFinish: () =>
|
|
504
|
-
onError: (
|
|
505
|
-
|
|
610
|
+
onFinish: () => flowManager.completeModule(),
|
|
611
|
+
onError: (error) => {
|
|
612
|
+
onError?.(error ?? "Address capture error");
|
|
506
613
|
}
|
|
507
|
-
}, `address-${
|
|
614
|
+
}, `address-${flowState.currentStepIndex}`)
|
|
508
615
|
});
|
|
509
|
-
if (
|
|
616
|
+
if (currentStep === "SIGNATURE") return /* @__PURE__ */ u("div", {
|
|
510
617
|
class: "IncodeFlow",
|
|
511
|
-
children: /* @__PURE__ */
|
|
512
|
-
config:
|
|
513
|
-
onFinish: () =>
|
|
514
|
-
onError: (
|
|
515
|
-
|
|
618
|
+
children: /* @__PURE__ */ u(Component, {
|
|
619
|
+
config: flowConfig,
|
|
620
|
+
onFinish: () => flowManager.completeModule(),
|
|
621
|
+
onError: (error) => {
|
|
622
|
+
onError?.(error ?? "Signature capture error");
|
|
516
623
|
}
|
|
517
|
-
}, `signature-${
|
|
624
|
+
}, `signature-${flowState.currentStepIndex}`)
|
|
518
625
|
});
|
|
519
|
-
if (
|
|
520
|
-
|
|
521
|
-
return /* @__PURE__ */
|
|
626
|
+
if (currentStep === "EKYB") {
|
|
627
|
+
const ekybFlowConfig = flowConfig;
|
|
628
|
+
return /* @__PURE__ */ u("div", {
|
|
522
629
|
class: "IncodeFlow",
|
|
523
|
-
children: /* @__PURE__ */
|
|
630
|
+
children: /* @__PURE__ */ u(Component, {
|
|
524
631
|
config: {
|
|
525
|
-
flowId
|
|
526
|
-
checkBusinessName:
|
|
527
|
-
checkAddress:
|
|
528
|
-
checkTaxId:
|
|
529
|
-
checkUniqueBeneficialOwner:
|
|
632
|
+
flowId,
|
|
633
|
+
checkBusinessName: ekybFlowConfig.checkBusinessName,
|
|
634
|
+
checkAddress: ekybFlowConfig.checkAddress,
|
|
635
|
+
checkTaxId: ekybFlowConfig.checkTaxId,
|
|
636
|
+
checkUniqueBeneficialOwner: ekybFlowConfig.checkUniqueBeneficialOwner
|
|
530
637
|
},
|
|
531
|
-
onFinish: () =>
|
|
532
|
-
onError: (
|
|
533
|
-
|
|
638
|
+
onFinish: () => flowManager.completeModule(),
|
|
639
|
+
onError: (error) => {
|
|
640
|
+
onError?.(error ?? "eKYB verification error");
|
|
534
641
|
}
|
|
535
|
-
}, `ekyb-${
|
|
642
|
+
}, `ekyb-${flowState.currentStepIndex}`)
|
|
536
643
|
});
|
|
537
644
|
}
|
|
538
|
-
if (
|
|
645
|
+
if (currentStep === "COMBINED_CONSENT") return /* @__PURE__ */ u("div", {
|
|
539
646
|
class: "IncodeFlow",
|
|
540
|
-
children: /* @__PURE__ */
|
|
541
|
-
config:
|
|
542
|
-
onFinish: () =>
|
|
543
|
-
onError: (
|
|
544
|
-
|
|
647
|
+
children: /* @__PURE__ */ u(Component, {
|
|
648
|
+
config: flowConfig,
|
|
649
|
+
onFinish: () => flowManager.completeModule(),
|
|
650
|
+
onError: (error) => {
|
|
651
|
+
onError?.(error ?? "Combined consent error");
|
|
545
652
|
}
|
|
546
|
-
}, `combined-consent-${
|
|
653
|
+
}, `combined-consent-${flowState.currentStepIndex}`)
|
|
547
654
|
});
|
|
548
|
-
if (
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
655
|
+
if (currentStep === "MANDATORY_CONSENT" || currentStep === "ML_CONSENT") {
|
|
656
|
+
const isMlConsent = currentStep === "ML_CONSENT";
|
|
657
|
+
return /* @__PURE__ */ u("div", {
|
|
658
|
+
class: "IncodeFlow",
|
|
659
|
+
children: /* @__PURE__ */ u(Component, {
|
|
660
|
+
config: {
|
|
661
|
+
...flowConfig,
|
|
662
|
+
type: isMlConsent ? "ML" : "MANDATORY"
|
|
663
|
+
},
|
|
664
|
+
onFinish: () => flowManager.completeModule(),
|
|
665
|
+
onError: (error) => {
|
|
666
|
+
onError?.(error ?? (isMlConsent ? "ML consent error" : "Mandatory consent error"));
|
|
667
|
+
}
|
|
668
|
+
}, `${isMlConsent ? "ml" : "mandatory"}-consent-${flowState.currentStepIndex}`)
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
if (currentStep === "AE_SIGNATURE" || currentStep === "QE_SIGNATURE") {
|
|
672
|
+
const sigConfig = flowConfig;
|
|
673
|
+
const label = currentStep === "QE_SIGNATURE" ? "qe" : "ae";
|
|
674
|
+
return /* @__PURE__ */ u("div", {
|
|
561
675
|
class: "IncodeFlow",
|
|
562
|
-
children: /* @__PURE__ */
|
|
676
|
+
children: /* @__PURE__ */ u(Component, {
|
|
563
677
|
config: {
|
|
564
|
-
uploadDocument:
|
|
565
|
-
downloadDocument:
|
|
678
|
+
uploadDocument: sigConfig.uploadDocument,
|
|
679
|
+
downloadDocument: sigConfig.downloadDocument
|
|
566
680
|
},
|
|
567
|
-
onFinish: () =>
|
|
568
|
-
onError: (
|
|
569
|
-
|
|
681
|
+
onFinish: () => flowManager.completeModule(),
|
|
682
|
+
onError: (error) => {
|
|
683
|
+
onError?.(error ?? `${label.toUpperCase()} Signature error`);
|
|
570
684
|
}
|
|
571
|
-
}, `${
|
|
685
|
+
}, `${label}-signature-${flowState.currentStepIndex}`)
|
|
572
686
|
});
|
|
573
687
|
}
|
|
574
|
-
if (
|
|
688
|
+
if (currentStep === "ANTIFRAUD") return /* @__PURE__ */ u("div", {
|
|
575
689
|
class: "IncodeFlow",
|
|
576
|
-
children: /* @__PURE__ */
|
|
577
|
-
onFinish: () =>
|
|
578
|
-
onError: (
|
|
579
|
-
|
|
690
|
+
children: /* @__PURE__ */ u(Component, {
|
|
691
|
+
onFinish: () => flowManager.completeModule(),
|
|
692
|
+
onError: (error) => {
|
|
693
|
+
onError?.(error ?? "Antifraud check error");
|
|
580
694
|
}
|
|
581
|
-
}, `antifraud-${
|
|
695
|
+
}, `antifraud-${flowState.currentStepIndex}`)
|
|
582
696
|
});
|
|
583
|
-
if (
|
|
697
|
+
if (currentStep === "CUSTOM_FIELDS") return /* @__PURE__ */ u("div", {
|
|
584
698
|
class: "IncodeFlow",
|
|
585
|
-
children: /* @__PURE__ */
|
|
586
|
-
config:
|
|
587
|
-
onFinish: () =>
|
|
588
|
-
onError: (
|
|
589
|
-
|
|
699
|
+
children: /* @__PURE__ */ u(Component, {
|
|
700
|
+
config: flowConfig,
|
|
701
|
+
onFinish: () => flowManager.completeModule(),
|
|
702
|
+
onError: (error) => {
|
|
703
|
+
onError?.(error ?? "Custom fields error");
|
|
590
704
|
}
|
|
591
|
-
}, `custom-fields-${
|
|
705
|
+
}, `custom-fields-${flowState.currentStepIndex}`)
|
|
592
706
|
});
|
|
593
|
-
if (
|
|
707
|
+
if (currentStep === "WATCHLIST") return /* @__PURE__ */ u("div", {
|
|
594
708
|
class: "IncodeFlow",
|
|
595
|
-
children: /* @__PURE__ */
|
|
596
|
-
onFinish: () =>
|
|
597
|
-
onError: (
|
|
598
|
-
|
|
709
|
+
children: /* @__PURE__ */ u(Component, {
|
|
710
|
+
onFinish: () => flowManager.completeModule(),
|
|
711
|
+
onError: (error) => {
|
|
712
|
+
onError?.(error ?? "Watchlist check error");
|
|
599
713
|
}
|
|
600
|
-
}, `watchlist-${
|
|
714
|
+
}, `watchlist-${flowState.currentStepIndex}`)
|
|
601
715
|
});
|
|
602
|
-
if (
|
|
716
|
+
if (currentStep === "WATCHLIST_BUSINESS") return /* @__PURE__ */ u("div", {
|
|
603
717
|
class: "IncodeFlow",
|
|
604
|
-
children: /* @__PURE__ */
|
|
605
|
-
onFinish: () =>
|
|
606
|
-
onError: (
|
|
607
|
-
|
|
718
|
+
children: /* @__PURE__ */ u(Component, {
|
|
719
|
+
onFinish: () => flowManager.completeModule(),
|
|
720
|
+
onError: (error) => {
|
|
721
|
+
onError?.(error ?? "Watchlist for business check error");
|
|
608
722
|
}
|
|
609
|
-
}, `watchlist-for-business-${
|
|
723
|
+
}, `watchlist-for-business-${flowState.currentStepIndex}`)
|
|
610
724
|
});
|
|
611
|
-
if (
|
|
725
|
+
if (currentStep === "INCODE_WATCHLIST") return /* @__PURE__ */ u("div", {
|
|
612
726
|
class: "IncodeFlow",
|
|
613
|
-
children: /* @__PURE__ */
|
|
614
|
-
config:
|
|
615
|
-
onFinish: () =>
|
|
616
|
-
onError: (
|
|
617
|
-
|
|
727
|
+
children: /* @__PURE__ */ u(Component, {
|
|
728
|
+
config: flowConfig,
|
|
729
|
+
onFinish: () => flowManager.completeModule(),
|
|
730
|
+
onError: (error) => {
|
|
731
|
+
onError?.(error ?? "Custom watchlist check error");
|
|
618
732
|
}
|
|
619
|
-
}, `incode-watchlist-${
|
|
733
|
+
}, `incode-watchlist-${flowState.currentStepIndex}`)
|
|
620
734
|
});
|
|
621
|
-
if (
|
|
735
|
+
if (currentStep === "CROSS_DOCUMENT_DATA_MATCH") return /* @__PURE__ */ u("div", {
|
|
622
736
|
class: "IncodeFlow",
|
|
623
|
-
children: /* @__PURE__ */
|
|
624
|
-
onFinish: () =>
|
|
625
|
-
onError: (
|
|
626
|
-
|
|
737
|
+
children: /* @__PURE__ */ u(Component, {
|
|
738
|
+
onFinish: () => flowManager.completeModule(),
|
|
739
|
+
onError: (error) => {
|
|
740
|
+
onError?.(error ?? "Cross document data match error");
|
|
627
741
|
}
|
|
628
|
-
}, `cross-document-data-match-${
|
|
742
|
+
}, `cross-document-data-match-${flowState.currentStepIndex}`)
|
|
629
743
|
});
|
|
630
|
-
if (
|
|
744
|
+
if (currentStep === "FIELD_COMPARISON") return /* @__PURE__ */ u("div", {
|
|
631
745
|
class: "IncodeFlow",
|
|
632
|
-
children: /* @__PURE__ */
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
746
|
+
children: /* @__PURE__ */ u(Component, {
|
|
747
|
+
onFinish: () => flowManager.completeModule(),
|
|
748
|
+
onError: (error) => {
|
|
749
|
+
onError?.(error ?? "Field comparison error");
|
|
750
|
+
}
|
|
751
|
+
}, `field-comparison-${flowState.currentStepIndex}`)
|
|
752
|
+
});
|
|
753
|
+
if (currentStep === "DYNAMIC_FORMS") return /* @__PURE__ */ u("div", {
|
|
754
|
+
class: "IncodeFlow",
|
|
755
|
+
children: /* @__PURE__ */ u(Component, {
|
|
756
|
+
config: { screens: flowConfig.screens.map((s) => ({
|
|
757
|
+
title: s.title,
|
|
758
|
+
hideTitle: s.hideTitle,
|
|
759
|
+
questions: s.questions.map((q) => ({
|
|
760
|
+
questionId: q.questionId,
|
|
761
|
+
question: q.question,
|
|
762
|
+
inputType: q.inputType,
|
|
763
|
+
isOptional: q.isOptional,
|
|
764
|
+
overrides: q.overrides ?? void 0,
|
|
765
|
+
isPredefined: q.isPredefined,
|
|
766
|
+
options: q.options
|
|
644
767
|
}))
|
|
645
768
|
})) },
|
|
646
|
-
onFinish: () =>
|
|
647
|
-
onError: (
|
|
648
|
-
|
|
769
|
+
onFinish: () => flowManager.completeModule(),
|
|
770
|
+
onError: (error) => {
|
|
771
|
+
onError?.(error ?? "Dynamic forms error");
|
|
772
|
+
}
|
|
773
|
+
}, `dynamic-forms-${flowState.currentStepIndex}`)
|
|
774
|
+
});
|
|
775
|
+
if (currentStep === "FISCAL_QR") return /* @__PURE__ */ u("div", {
|
|
776
|
+
class: "IncodeFlow",
|
|
777
|
+
children: /* @__PURE__ */ u(Component, {
|
|
778
|
+
onFinish: () => flowManager.completeModule(),
|
|
779
|
+
onError: (error) => {
|
|
780
|
+
onError?.(error ?? "Fiscal QR error");
|
|
649
781
|
}
|
|
650
|
-
}, `
|
|
782
|
+
}, `fiscal-qr-${flowState.currentStepIndex}`)
|
|
651
783
|
});
|
|
652
784
|
}
|
|
653
785
|
return null;
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
786
|
+
};
|
|
787
|
+
var IncodeFlow = ({ config, onFinish = () => {}, onError }) => {
|
|
788
|
+
return /* @__PURE__ */ u(IncodeComponent, { children: config ? /* @__PURE__ */ u(IncodeFlowContent, {
|
|
789
|
+
config,
|
|
790
|
+
onFinish,
|
|
791
|
+
onError
|
|
792
|
+
}) : null });
|
|
793
|
+
};
|
|
794
|
+
registerIncodeModuleElement(IncodeFlow, "incode-flow");
|
|
660
795
|
//#endregion
|
|
661
|
-
export {
|
|
796
|
+
export { IncodeFlow, preloadIncodeFlow };
|