@incodetech/web 0.0.0-dev-20260608-c8c427ca → 0.0.0-dev-20260609-11ba3e8a
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/aligndevicelottie-DY_bX_p8.js +12769 -0
- package/dist/antifraud/antifraud.es.js +22 -19
- package/dist/authentication/authentication.es.js +42 -33
- package/dist/autoFocusTitle-DM6PvgcP.js +29 -0
- package/dist/{back-horizontal-hint-DsPhKbR4.js → back-horizontal-hint-BXYix0Wj.js} +26 -26
- package/dist/back-tutorial-vb1MxlrT.js +14597 -0
- package/dist/{back-vertical-hint-BFJbYQrX.js → back-vertical-hint-DNSh6JNH.js} +27 -27
- package/dist/backdevicelottie-HypPqBz7.js +16690 -0
- package/dist/base.css +5 -0
- package/dist/blurdevicelottie-CBXtBFiJ.js +15951 -0
- package/dist/bottomSheet-BuzqNQtG.js +39 -0
- package/dist/browser-ponyfill-CLLvZCVg.js +441 -0
- package/dist/button-B-qlr4iI.js +35 -0
- package/dist/checkbox-CTPETqo5.js +96 -0
- package/dist/consent/consent.es.js +75 -64
- package/dist/countrySelector-CzyuaDIs.js +60 -0
- package/dist/cpf-ocr/cpf-ocr.es.js +2 -2
- package/dist/cpfOcr-DQVs3r8N.js +92 -0
- package/dist/cpfOcr-WNklFuxT.js +2 -0
- package/dist/cross-document-data-match/cross-document-data-match.es.js +20 -17
- package/dist/curp-validation/curp-validation.es.js +246 -211
- package/dist/customFields-B4MqqDI6.js +140 -0
- package/dist/customWatchlist-Dfqw1DQP.js +36 -0
- package/dist/dateInputComposed-BsPQHG5o.js +1 -0
- package/dist/dateInputComposed-DY97tQVK.js +69 -0
- package/dist/defineProperty-mefzVtTv.js +39 -0
- package/dist/document-capture/document-capture.es.js +2 -2
- package/dist/documentCapture-BE78MIlR.js +876 -0
- package/dist/documentCapture-BVfNZL29.js +2 -0
- package/dist/dropdownComposed-BF4L-7mJ.js +380 -0
- package/dist/dropdownComposed-mvHuRFHn.js +1 -0
- package/dist/dynamicForms-BYGGAQoc.js +352 -0
- package/dist/ekyb/ekyb.es.js +2 -2
- package/dist/ekybModule-BUPX0QhW.js +2 -0
- package/dist/ekybModule-CkTXu-4u.js +279 -0
- package/dist/ekyc/ekyc.es.js +2 -2
- package/dist/ekycModule-BWsVX39d.js +257 -0
- package/dist/ekycModule-DNDPqvUc.js +2 -0
- package/dist/electronic-signature/electronic-signature.es.js +2 -2
- package/dist/electronic-signature-BJSyzex9.js +426 -0
- package/dist/email/email.es.js +198 -78
- package/dist/emailInput-BHp4Apt4.js +39 -0
- package/dist/errorIcon-B0rmz3rw.js +26 -0
- package/dist/expiredId-C105HVKv.js +85 -0
- package/dist/extensibility-DJwVxojG.js +3070 -0
- package/dist/extensibility.es.js +26 -26
- package/dist/face-match/face-match.es.js +2 -2
- package/dist/faceMatch-BOFGxzzx.js +343 -0
- package/dist/faceMatch-CDMcFQwR.js +2 -0
- package/dist/field-comparison/field-comparison.es.js +2 -2
- package/dist/fieldComparison-BMDmQ8eA.js +88 -0
- package/dist/fieldComparison-Z1NleSxD.js +2 -0
- package/dist/{flip-animation-CuQ57qTn.js → flip-animation-BGRvygw9.js} +4221 -4221
- package/dist/flow/flow.es.js +597 -493
- package/dist/flow/styles.css +0 -8
- package/dist/{front-horizontal-hint-CKm7PnmS.js → front-horizontal-hint-CLSU0iVo.js} +70 -70
- package/dist/{front-vertical-hint-CLHC2qoH.js → front-vertical-hint-BWq-yWQ8.js} +81 -81
- package/dist/frontdevicelottie-CLqitJhG.js +17314 -0
- package/dist/geolocation/geolocation.es.js +485 -395
- package/dist/glaredevicelottie-BS04U6Fc.js +14478 -0
- package/dist/governmentValidation/governmentValidation.es.js +145 -64
- package/dist/governmentValidation/styles.css +0 -36
- package/dist/homeScreen-BsEYyiDB.js +264 -0
- package/dist/hooks-BtgmGvba.js +149 -0
- package/dist/i18n-gTHArCl9.js +2971 -0
- package/dist/icons-DKY3xDkf.js +360 -0
- package/dist/id/id.es.js +565 -413
- 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 -18
- package/dist/idOcr-BS77o1VC.js +123 -0
- package/dist/identity-reuse/identity-reuse.es.js +168 -130
- package/dist/incode-logo-57XFniXU.js +4 -0
- package/dist/incodeComponent-CDJxFZvS.js +63 -0
- package/dist/incodeModule-DkA_yd0X.js +13 -0
- package/dist/index.es.js +16 -14
- package/dist/inputComposed-5V2nLTqH.js +99 -0
- package/dist/inputComposed-BPOYwUBl.js +1 -0
- package/dist/loadingIcon-DN62ugKs.js +148 -0
- package/dist/lottie_light-Dp9Bz3mf.js +9031 -0
- package/dist/mandatoryConsent-DP189TUn.js +107 -0
- package/dist/modal-B5QeulDu.js +153 -0
- package/dist/modal.hooks-C7K9k_pY.js +202 -0
- package/dist/numberedStep-DVAyTPv1.js +13 -0
- package/dist/optionAccessibleLabel-Czc2YC8z.js +202 -0
- package/dist/otpInput-2IQ-JCK8.js +195 -0
- package/dist/page-BZ-0eNWq.js +71 -0
- package/dist/{passport-horizontal-hint-C_le0HVU.js → passport-horizontal-hint-DfVsf4Cc.js} +55 -55
- package/dist/{passport-tutorial-BYN4T_TE.js → passport-tutorial-zT1ZoA-D.js} +7096 -7084
- package/dist/{passport-vertical-hint-H-pyICSv.js → passport-vertical-hint-DVxbTyQp.js} +49 -49
- package/dist/pdf-BZA70WbM.js +22398 -0
- package/dist/pdfViewer-Dr63sJ51.js +114 -0
- package/dist/phone/phone.es.js +214 -87
- package/dist/phoneInputComposed-D_IabWKJ.js +12142 -0
- package/dist/processing-B_u8wUB7.js +8 -0
- package/dist/qe-signature/qe-signature.es.js +15 -13
- package/dist/radioGroupComposed-DwYW-Ld-.js +215 -0
- package/dist/redirect-to-mobile/redirect-to-mobile.es.js +2099 -859
- package/dist/registerIncodeElement-BJJGzVdq.js +11 -0
- package/dist/requiredLabelHint-DEadtiwx.js +17 -0
- package/dist/richText-C7GUm0WL.js +3153 -0
- package/dist/rolldown-runtime--E5BIlTp.js +33 -0
- package/dist/selfie/selfie.es.js +54 -42
- package/dist/selfieTutorial-CtruLyO2.js +2689 -0
- package/dist/signature/signature.es.js +765 -406
- package/dist/snackbar-Dz9crm39.js +16 -0
- package/dist/spinner-BfBIZkDQ.js +42 -0
- package/dist/spinner-DEDtE7Pz.js +1 -0
- package/dist/statusPage-CVCoieyd.js +28 -0
- package/dist/successIcon-rmzr-pxu.js +30 -0
- package/dist/tabs--UMd6eEB.js +103 -0
- package/dist/transitionSpinner-CWhGcr7c.js +26 -0
- package/dist/{tutorial-QzQ536BL.js → tutorial-Jv0noW4z.js} +832 -578
- package/dist/types/extensibility.d.ts +3 -1
- package/dist/types/index.d.ts +13 -4
- package/dist/typography-BK4AmfKX.js +45 -0
- package/dist/uiConfig-sgEkFuuA.js +25 -0
- package/dist/useModuleLoader-CuhHtmgr.js +670 -0
- package/dist/vendor-preact-BH7vOa2r.js +957 -0
- package/dist/verificationResult-CJ0JyV6A.js +64 -0
- package/dist/verifiedByIncode-8QBn-kgZ.js +103 -0
- package/dist/watchlist/watchlist.es.js +31 -26
- package/dist/watchlistForBusiness-RZcnjVDb.js +80 -0
- package/dist/workflow/styles.css +0 -8
- package/dist/workflow/workflow.es.js +251 -209
- package/package.json +4 -2
- package/dist/aligndevicelottie-D8KsO77t.js +0 -12757
- package/dist/autoFocusTitle-BpYdaSUM.js +0 -16
- package/dist/back-tutorial-DhSE2FJo.js +0 -14585
- package/dist/backdevicelottie-CJWGVMdw.js +0 -16678
- package/dist/blurdevicelottie-Dxt2deEB.js +0 -15939
- package/dist/bottomSheet-QrpyatOD.js +0 -31
- package/dist/browser-ponyfill-Crda_c5R.js +0 -299
- package/dist/button-DcCUEn2n.js +0 -24
- package/dist/checkbox-DCCzBAuF.js +0 -86
- package/dist/countrySelector-CJ8egQ4C.js +0 -58
- package/dist/cpfOcr-Db06i-Lm.js +0 -2
- package/dist/cpfOcr-FixhUeMQ.js +0 -79
- package/dist/customFields-C1G9xHNX.js +0 -125
- package/dist/customWatchlist-IKEblz7u.js +0 -31
- package/dist/dateInputComposed-Cg8BvYSK.js +0 -1
- package/dist/dateInputComposed-Ddd7HLyM.js +0 -58
- package/dist/defineProperty-xczUyn-m.js +0 -39
- package/dist/documentCapture-D9I7FjGe.js +0 -2
- package/dist/documentCapture-b61wlala.js +0 -765
- package/dist/dropdownComposed-B4U0AIak.js +0 -1
- package/dist/dropdownComposed-CS2pyn-g.js +0 -293
- package/dist/dynamicForms-tYQog0kw.js +0 -298
- package/dist/ekybModule-C33C4JES.js +0 -237
- package/dist/ekybModule-LON6G2Bz.js +0 -2
- package/dist/ekycModule-BJOgtTAh.js +0 -225
- package/dist/ekycModule-BSf_DIG7.js +0 -2
- package/dist/electronic-signature-OdgTyso4.js +0 -406
- package/dist/emailInput-CU7mLB21.js +0 -37
- package/dist/errorIcon-DpHzAoAo.js +0 -24
- package/dist/expiredId-nfVAZgTL.js +0 -70
- package/dist/extensibility-BbNy3mVG.js +0 -2602
- package/dist/faceMatch-BIila4kf.js +0 -2
- package/dist/faceMatch-DJ7Mqujx.js +0 -206
- package/dist/fieldComparison-D2RSFYl-.js +0 -84
- package/dist/fieldComparison-DbUyouFd.js +0 -2
- package/dist/frontdevicelottie-65Vyfpff.js +0 -17302
- package/dist/glaredevicelottie-BEyaqtc6.js +0 -14466
- package/dist/homeScreen-CyPddxWl.js +0 -227
- package/dist/hooks-MxHtZWTS.js +0 -112
- package/dist/i18n-Kzzvkz94.js +0 -2019
- package/dist/icons-9I5g9-_1.js +0 -292
- package/dist/id-laser-h-iCPbFixz.js +0 -467
- package/dist/id-laser-v-CNzwliP2.js +0 -483
- package/dist/id-tutorial-CF4nO4oX.js +0 -13153
- package/dist/idOcr-DlMLMDqa.js +0 -97
- package/dist/incode-logo-DX016usY.js +0 -4
- package/dist/incodeComponent-BoFhgK7G.js +0 -50
- package/dist/incodeModule-BiCoAJ5k.js +0 -13
- package/dist/inputComposed-DAEey9xm.js +0 -94
- package/dist/inputComposed-eS4B0Mkh.js +0 -1
- package/dist/loadingIcon-BN5YRQUb.js +0 -104
- package/dist/lottie_light-DLqSnziX.js +0 -4419
- package/dist/mandatoryConsent-DNz2jZ43.js +0 -98
- package/dist/modal-ZqAhwiRF.js +0 -135
- package/dist/modal.hooks-LdusROLW.js +0 -126
- package/dist/numberedStep-CdLWASwL.js +0 -11
- package/dist/optionAccessibleLabel-DcygPaME.js +0 -140
- package/dist/otpInput-C4pk4BJU.js +0 -157
- package/dist/page-DA3R7q0J.js +0 -69
- package/dist/pdf-51QeiFSx.js +0 -14967
- package/dist/pdfViewer-rKzTHket.js +0 -64
- package/dist/phoneInputComposed-CjAxk2Gj.js +0 -11230
- package/dist/processing-DPktVde2.js +0 -6
- package/dist/radioGroupComposed-DRRxVk9Z.js +0 -178
- package/dist/registerIncodeElement-BHWOwdSS.js +0 -7
- package/dist/requiredLabelHint-B6FN3v88.js +0 -13
- package/dist/richText-6pIbydcz.js +0 -1973
- package/dist/rolldown-runtime-CYMK-g2i.js +0 -20
- package/dist/selfieTutorial-Yo9AlUoT.js +0 -2677
- package/dist/snackbar-CQiiWO4p.js +0 -14
- package/dist/spinner-B4dcie2T.js +0 -1
- package/dist/spinner-CKnjVHxw.js +0 -39
- package/dist/statusPage-B8b3Jg6N.js +0 -28
- package/dist/successIcon-SlKgTSty.js +0 -28
- package/dist/tabs-D7lGst3Q.js +0 -78
- package/dist/transitionSpinner-Di3bOyOu.js +0 -17
- package/dist/typography-CxjaknHN.js +0 -28
- package/dist/uiConfig-CwpQ-IM6.js +0 -20
- package/dist/useModuleLoader-Bqs7fglI.js +0 -517
- package/dist/vendor-preact-D6SntenC.js +0 -958
- package/dist/verificationResult-DhT3hH1b.js +0 -90
- package/dist/verifiedByIncode-DpbxzO0y.js +0 -101
- package/dist/watchlistForBusiness-CRXVbH4l.js +0 -75
|
@@ -1,288 +1,330 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { t as
|
|
4
|
-
import { c as
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import { a as
|
|
9
|
-
import { resolveWasmConfig
|
|
10
|
-
import { getDeviceClass
|
|
11
|
-
import { bootstrapSession
|
|
12
|
-
import { createWorkflowManager
|
|
1
|
+
import { n as useTranslation, o as readStoredLanguage } from "../i18n-gTHArCl9.js";
|
|
2
|
+
import { _ as y, c as z, l as A, o as P, p as d, v as u } from "../vendor-preact-BH7vOa2r.js";
|
|
3
|
+
import { t as setUiConfig } from "../uiConfig-sgEkFuuA.js";
|
|
4
|
+
import { c as useManager } from "../hooks-BtgmGvba.js";
|
|
5
|
+
import { t as IncodeComponent } from "../incodeComponent-CDJxFZvS.js";
|
|
6
|
+
import { t as TransitionSpinner } from "../transitionSpinner-CWhGcr7c.js";
|
|
7
|
+
import { t as registerIncodeModuleElement } from "../incodeModule-DkA_yd0X.js";
|
|
8
|
+
import { a as resolveApiKey, g as setupSDK, i as HEADLESS_WORKFLOW_MODULE_KEYS, l as LAZY_UI_MODULES, o as extractIncodeStatus, s as UnsupportedModule, t as useModuleLoader, v as fetchAndApplyTheme, y as TerminalErrorPage } from "../useModuleLoader-CuhHtmgr.js";
|
|
9
|
+
import { resolveWasmConfig, upgradeToWasmHttpClient, warmupWasm } from "@incodetech/core/wasm";
|
|
10
|
+
import { getDeviceClass } from "@incodetech/core/device";
|
|
11
|
+
import { bootstrapSession, refreshQrUrlUuid } from "@incodetech/core/session";
|
|
12
|
+
import { createWorkflowManager } from "@incodetech/core/workflow";
|
|
13
13
|
//#region src/modules/workflow/workflowInit.ts
|
|
14
|
-
var
|
|
15
|
-
...
|
|
16
|
-
REDIRECT_TO_MOBILE: () => import("../redirect-to-mobile/redirect-to-mobile.es.js").then((
|
|
17
|
-
ID: () => import("../id-verification/id-verification.es.js").then((
|
|
18
|
-
IDENTITY_REUSE: () => import("../identity-reuse/identity-reuse.es.js").then((
|
|
14
|
+
var LAZY_WORKFLOW_MODULES = {
|
|
15
|
+
...LAZY_UI_MODULES,
|
|
16
|
+
REDIRECT_TO_MOBILE: () => import("../redirect-to-mobile/redirect-to-mobile.es.js").then((m) => m.RedirectToMobile),
|
|
17
|
+
ID: () => import("../id-verification/id-verification.es.js").then((m) => m.IdVerification),
|
|
18
|
+
IDENTITY_REUSE: () => import("../identity-reuse/identity-reuse.es.js").then((m) => m.IdentityReuse)
|
|
19
19
|
};
|
|
20
|
-
async function
|
|
20
|
+
async function fetchWorkflowTheme() {
|
|
21
21
|
try {
|
|
22
|
-
|
|
22
|
+
const theme = await fetchAndApplyTheme();
|
|
23
23
|
return {
|
|
24
|
-
theme
|
|
24
|
+
theme,
|
|
25
25
|
uiConfig: {
|
|
26
|
-
logoSrc:
|
|
27
|
-
hideFooterBranding:
|
|
26
|
+
logoSrc: theme.logo,
|
|
27
|
+
hideFooterBranding: theme.hideFooterBranding
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
} catch {
|
|
31
31
|
return {};
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
return
|
|
36
|
-
customModuleCallback:
|
|
37
|
-
interviewId:
|
|
38
|
-
isDesktop:
|
|
34
|
+
function createWorkflowUIManager(options = {}) {
|
|
35
|
+
return createWorkflowManager({
|
|
36
|
+
customModuleCallback: options.customModuleCallback,
|
|
37
|
+
interviewId: options.interviewId,
|
|
38
|
+
isDesktop: options.isDesktop ?? getDeviceClass() === "desktop"
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
...
|
|
45
|
-
pipelines:
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
function warmupWorkflowWasm(wasmConfig) {
|
|
42
|
+
if (wasmConfig === false) return;
|
|
43
|
+
const resolved = resolveWasmConfig({
|
|
44
|
+
...wasmConfig,
|
|
45
|
+
pipelines: wasmConfig?.pipelines ?? ["selfie", "idCapture"]
|
|
46
|
+
});
|
|
47
|
+
const upgradeConfig = {
|
|
48
|
+
...resolved,
|
|
49
|
+
pipelines: resolved.pipelines ? [...resolved.pipelines] : void 0
|
|
49
50
|
};
|
|
50
|
-
|
|
51
|
-
console.error("Workflow WASM warmup failed:",
|
|
51
|
+
warmupWasm(resolved).then(() => upgradeToWasmHttpClient(upgradeConfig)).catch((error) => {
|
|
52
|
+
console.error("Workflow WASM warmup failed:", error);
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
55
|
//#endregion
|
|
55
56
|
//#region src/modules/workflow/createWorkflowSession.ts
|
|
56
|
-
async function
|
|
57
|
-
return
|
|
58
|
-
configurationId:
|
|
59
|
-
externalId:
|
|
60
|
-
externalCustomerId:
|
|
61
|
-
language:
|
|
62
|
-
customFields:
|
|
63
|
-
uuid:
|
|
64
|
-
urlUuid:
|
|
65
|
-
loginHint:
|
|
66
|
-
onUrlUuidRefreshed:
|
|
67
|
-
},
|
|
57
|
+
async function createWorkflowSession(config, signal) {
|
|
58
|
+
return bootstrapSession(await resolveApiKey(config), {
|
|
59
|
+
configurationId: config.configurationId,
|
|
60
|
+
externalId: config.externalId,
|
|
61
|
+
externalCustomerId: config.externalCustomerId,
|
|
62
|
+
language: config.lang,
|
|
63
|
+
customFields: config.customFields,
|
|
64
|
+
uuid: config.uuid,
|
|
65
|
+
urlUuid: config.urlUuid,
|
|
66
|
+
loginHint: config.loginHint,
|
|
67
|
+
onUrlUuidRefreshed: config.onUrlUuidRefreshed
|
|
68
|
+
}, signal);
|
|
68
69
|
}
|
|
69
70
|
//#endregion
|
|
70
71
|
//#region src/modules/workflow/workflowConfig.ts
|
|
71
|
-
function
|
|
72
|
-
return typeof
|
|
72
|
+
function hasWorkflowToken(config) {
|
|
73
|
+
return typeof config.token === "string";
|
|
73
74
|
}
|
|
74
|
-
function
|
|
75
|
-
|
|
76
|
-
return typeof
|
|
75
|
+
function isSelfLoadingWorkflowConfig(config) {
|
|
76
|
+
const bootstrapConfig = config;
|
|
77
|
+
return typeof bootstrapConfig.configurationId === "string" && (typeof bootstrapConfig.apiKey === "string" || typeof bootstrapConfig.clientId === "string");
|
|
77
78
|
}
|
|
78
79
|
//#endregion
|
|
79
80
|
//#region src/modules/workflow/useWorkflowInitialization.ts
|
|
80
|
-
function
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
function useWorkflowInitialization(options) {
|
|
82
|
+
const { onError, onUrlUuidRefreshed } = options;
|
|
83
|
+
const [state, setState] = d({ status: "initializing" });
|
|
84
|
+
const managerRef = A(null);
|
|
85
|
+
y(() => {
|
|
86
|
+
if (state.status !== "initializing") return;
|
|
87
|
+
const abortController = new AbortController();
|
|
88
|
+
const { signal } = abortController;
|
|
89
|
+
const initialize = async () => {
|
|
86
90
|
try {
|
|
87
|
-
let
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
91
|
+
let resolvedToken;
|
|
92
|
+
let resolvedInterviewId;
|
|
93
|
+
if (hasWorkflowToken(options)) {
|
|
94
|
+
resolvedToken = options.token;
|
|
95
|
+
resolvedInterviewId = options.interviewId;
|
|
96
|
+
if (options.urlUuid) await refreshQrUrlUuid({
|
|
97
|
+
urlUuid: options.urlUuid,
|
|
98
|
+
onboardingId: null,
|
|
99
|
+
onRefreshed: onUrlUuidRefreshed
|
|
100
|
+
}, signal);
|
|
101
|
+
} else if (isSelfLoadingWorkflowConfig(options)) {
|
|
102
|
+
const session = await createWorkflowSession(options, signal);
|
|
103
|
+
resolvedToken = session.token;
|
|
104
|
+
resolvedInterviewId = session.interviewId;
|
|
105
|
+
} else throw new Error("Workflow requires token, or configurationId with apiKey or clientId");
|
|
106
|
+
if (signal.aborted) return;
|
|
107
|
+
await setupSDK({
|
|
108
|
+
token: resolvedToken,
|
|
109
|
+
lang: options.lang
|
|
110
|
+
});
|
|
111
|
+
if (signal.aborted) return;
|
|
112
|
+
const themePromise = options.disableDashboardTheme ? Promise.resolve() : fetchWorkflowTheme().then((result) => {
|
|
113
|
+
if (result.uiConfig) setUiConfig(result.uiConfig);
|
|
114
|
+
});
|
|
115
|
+
warmupWorkflowWasm(options.wasmConfig);
|
|
116
|
+
if (signal.aborted) return;
|
|
117
|
+
managerRef.current = createWorkflowUIManager({
|
|
118
|
+
customModuleCallback: options.customModuleCallback,
|
|
119
|
+
interviewId: resolvedInterviewId,
|
|
120
|
+
isDesktop: options.isDesktop
|
|
103
121
|
});
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}), l.current.load(), await a, i.aborted)) return;
|
|
109
|
-
s({
|
|
122
|
+
managerRef.current.load();
|
|
123
|
+
await themePromise;
|
|
124
|
+
if (signal.aborted) return;
|
|
125
|
+
setState({
|
|
110
126
|
status: "ready",
|
|
111
|
-
workflowManager:
|
|
127
|
+
workflowManager: managerRef.current
|
|
112
128
|
});
|
|
113
|
-
} catch (
|
|
114
|
-
if (
|
|
115
|
-
|
|
116
|
-
|
|
129
|
+
} catch (error) {
|
|
130
|
+
if (signal.aborted) return;
|
|
131
|
+
const errorMessage = error instanceof Error ? error.message : "Failed to initialize SDK";
|
|
132
|
+
const errorCode = extractIncodeStatus(error);
|
|
133
|
+
setState({
|
|
117
134
|
status: "error",
|
|
118
|
-
error:
|
|
119
|
-
errorCode
|
|
120
|
-
})
|
|
135
|
+
error: errorMessage,
|
|
136
|
+
errorCode
|
|
137
|
+
});
|
|
138
|
+
onError?.(errorMessage, errorCode);
|
|
121
139
|
}
|
|
122
|
-
})(), () => {
|
|
123
|
-
n.abort(), l.current?.stop(), l.current = null;
|
|
124
140
|
};
|
|
125
|
-
|
|
141
|
+
initialize();
|
|
142
|
+
return () => {
|
|
143
|
+
abortController.abort();
|
|
144
|
+
managerRef.current?.stop();
|
|
145
|
+
managerRef.current = null;
|
|
146
|
+
};
|
|
147
|
+
}, []);
|
|
148
|
+
return state;
|
|
126
149
|
}
|
|
127
150
|
//#endregion
|
|
128
151
|
//#region src/modules/workflow/workflow.tsx
|
|
129
|
-
var
|
|
130
|
-
function
|
|
131
|
-
|
|
132
|
-
switch (
|
|
152
|
+
var LazyHomeScreen = z(() => import("../homeScreen-BsEYyiDB.js").then((module) => ({ default: module.HomeScreen })));
|
|
153
|
+
function mapModuleConfig(options) {
|
|
154
|
+
const { moduleKey, config, workflowId, authHint, lang, mergeSessionRecordings, ageAssurance } = options;
|
|
155
|
+
switch (moduleKey) {
|
|
133
156
|
case "AUTHENTICATION": return {
|
|
134
|
-
...
|
|
135
|
-
authHint
|
|
157
|
+
...config,
|
|
158
|
+
authHint
|
|
136
159
|
};
|
|
137
160
|
case "REDIRECT_TO_MOBILE": return {
|
|
138
|
-
...
|
|
139
|
-
flowId:
|
|
140
|
-
authHint
|
|
141
|
-
lang
|
|
161
|
+
...config,
|
|
162
|
+
flowId: workflowId,
|
|
163
|
+
authHint,
|
|
164
|
+
lang
|
|
142
165
|
};
|
|
143
166
|
case "ID_CAPTURE":
|
|
144
167
|
case "TUTORIAL_ID": return {
|
|
145
|
-
...
|
|
146
|
-
mergeSessionRecordings:
|
|
147
|
-
ageAssurance:
|
|
148
|
-
skipProcessId:
|
|
168
|
+
...config,
|
|
169
|
+
mergeSessionRecordings: config.mergeSessionRecordings ?? mergeSessionRecordings,
|
|
170
|
+
ageAssurance: config.ageAssurance ?? ageAssurance,
|
|
171
|
+
skipProcessId: true
|
|
149
172
|
};
|
|
150
|
-
case "ID": return
|
|
173
|
+
case "ID": return config;
|
|
151
174
|
case "SELFIE": return {
|
|
152
|
-
...
|
|
153
|
-
ageAssurance:
|
|
175
|
+
...config,
|
|
176
|
+
ageAssurance: config.ageAssurance ?? ageAssurance
|
|
154
177
|
};
|
|
155
178
|
case "ADDRESS": return {
|
|
156
|
-
...
|
|
179
|
+
...config,
|
|
157
180
|
processingType: "addressStatement"
|
|
158
181
|
};
|
|
159
182
|
case "SECOND_ID": return {
|
|
160
|
-
...
|
|
161
|
-
isSecondId:
|
|
183
|
+
...config,
|
|
184
|
+
isSecondId: true
|
|
162
185
|
};
|
|
163
186
|
case "MANDATORY_CONSENT": return {
|
|
164
|
-
...
|
|
187
|
+
...config,
|
|
165
188
|
type: "MANDATORY"
|
|
166
189
|
};
|
|
167
|
-
default: return
|
|
190
|
+
default: return config;
|
|
168
191
|
}
|
|
169
192
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
193
|
+
/**
|
|
194
|
+
* Inner component mounted only after `useWorkflowInitialization` has resolved
|
|
195
|
+
* the session and constructed the manager. Splitting this out keeps the
|
|
196
|
+
* `useManager` factory call out of the init path — token-mode and
|
|
197
|
+
* self-loading mode both arrive here with a fully-constructed manager.
|
|
198
|
+
*/
|
|
199
|
+
var IncodeWorkflowReady = ({ config, workflowManager: initialManager, onFinish, onError }) => {
|
|
200
|
+
const [workflowState, workflowManager] = useManager(() => initialManager, {
|
|
201
|
+
autoLoad: false,
|
|
202
|
+
manageLifecycle: false
|
|
203
|
+
});
|
|
204
|
+
const moduleLoaderState = useModuleLoader({
|
|
205
|
+
moduleKey: workflowState?.status === "ready" ? workflowState.currentNode.moduleKey : void 0,
|
|
206
|
+
modules: LAZY_WORKFLOW_MODULES,
|
|
207
|
+
headlessModuleKeys: HEADLESS_WORKFLOW_MODULE_KEYS,
|
|
208
|
+
onModuleLoading: config.onModuleLoading,
|
|
209
|
+
onModuleLoaded: config.onModuleLoaded,
|
|
210
|
+
onError
|
|
211
|
+
});
|
|
212
|
+
const terminalFiredRef = A(false);
|
|
213
|
+
y(() => {
|
|
214
|
+
if (terminalFiredRef.current) return;
|
|
215
|
+
if (workflowState?.status === "finished") {
|
|
216
|
+
terminalFiredRef.current = true;
|
|
217
|
+
const finishStatus = workflowState.finishStatus;
|
|
218
|
+
queueMicrotask(() => onFinish?.(finishStatus));
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
if (workflowState?.status === "asyncResolution") {
|
|
222
|
+
terminalFiredRef.current = true;
|
|
223
|
+
queueMicrotask(() => onFinish?.());
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
if (workflowState?.status === "error" && onError) {
|
|
227
|
+
terminalFiredRef.current = true;
|
|
228
|
+
const { error, errorCode } = workflowState;
|
|
229
|
+
queueMicrotask(() => onError(error, errorCode));
|
|
199
230
|
}
|
|
200
231
|
}, [
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
232
|
+
workflowState?.status,
|
|
233
|
+
onFinish,
|
|
234
|
+
onError,
|
|
235
|
+
workflowState
|
|
205
236
|
]);
|
|
206
|
-
|
|
237
|
+
const hideSpinnerText = !(config.spinnerConfig?.title || config.spinnerConfig?.subtitle);
|
|
238
|
+
const renderSpinner = () => /* @__PURE__ */ u("div", {
|
|
207
239
|
class: "IncodeWorkflow",
|
|
208
|
-
children: /* @__PURE__ */
|
|
209
|
-
spinnerConfig:
|
|
210
|
-
hideText:
|
|
240
|
+
children: /* @__PURE__ */ u(TransitionSpinner, {
|
|
241
|
+
spinnerConfig: config.spinnerConfig,
|
|
242
|
+
hideText: hideSpinnerText
|
|
211
243
|
})
|
|
212
|
-
})
|
|
213
|
-
|
|
244
|
+
});
|
|
245
|
+
const handleModuleError = (error, _errorCode, moduleErrorCode) => {
|
|
246
|
+
workflowManager.errorModule(error ?? "Module error", moduleErrorCode);
|
|
214
247
|
};
|
|
215
|
-
if (
|
|
248
|
+
if (workflowState && "homeScreen" in workflowState && workflowState.homeScreen.visible) return /* @__PURE__ */ u("div", {
|
|
216
249
|
class: "IncodeWorkflow",
|
|
217
|
-
children: /* @__PURE__ */
|
|
250
|
+
children: /* @__PURE__ */ u(P, {
|
|
218
251
|
fallback: null,
|
|
219
|
-
children: /* @__PURE__ */
|
|
220
|
-
isContinueLoading:
|
|
221
|
-
onContinue: () =>
|
|
252
|
+
children: /* @__PURE__ */ u(LazyHomeScreen, {
|
|
253
|
+
isContinueLoading: workflowState.homeScreen.isContinueLoading,
|
|
254
|
+
onContinue: () => workflowManager.continueFromHome()
|
|
222
255
|
})
|
|
223
256
|
})
|
|
224
257
|
});
|
|
225
|
-
if (!
|
|
226
|
-
if (
|
|
258
|
+
if (!workflowState || workflowState.status === "idle" || workflowState.status === "loading") return renderSpinner();
|
|
259
|
+
if (workflowState.status === "error") return /* @__PURE__ */ u("div", {
|
|
227
260
|
class: "IncodeWorkflow",
|
|
228
|
-
children: /* @__PURE__ */
|
|
261
|
+
children: /* @__PURE__ */ u(TerminalErrorPage, { message: workflowState.error })
|
|
229
262
|
});
|
|
230
|
-
if (
|
|
231
|
-
if (
|
|
263
|
+
if (workflowState.status === "finished" || workflowState.status === "asyncResolution" || workflowState.status === "closed") return null;
|
|
264
|
+
if (moduleLoaderState.status === "unsupported") return /* @__PURE__ */ u("div", {
|
|
232
265
|
class: "IncodeWorkflow",
|
|
233
|
-
children: /* @__PURE__ */
|
|
234
|
-
moduleKey:
|
|
235
|
-
onNext: () =>
|
|
266
|
+
children: /* @__PURE__ */ u(UnsupportedModule, {
|
|
267
|
+
moduleKey: workflowState.currentNode.moduleKey,
|
|
268
|
+
onNext: () => workflowManager.completeModule()
|
|
236
269
|
})
|
|
237
270
|
});
|
|
238
|
-
if (
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
271
|
+
if (moduleLoaderState.status === "idle" || moduleLoaderState.status === "loading" || moduleLoaderState.status === "error") return renderSpinner();
|
|
272
|
+
const { Component } = moduleLoaderState;
|
|
273
|
+
const moduleConfig = mapModuleConfig({
|
|
274
|
+
moduleKey: workflowState.currentNode.moduleKey,
|
|
275
|
+
config: workflowState.config,
|
|
276
|
+
workflowId: workflowState.workflowConfig.id,
|
|
277
|
+
authHint: config.authHint,
|
|
278
|
+
lang: config.lang,
|
|
279
|
+
mergeSessionRecordings: workflowState.workflowConfig.mergeSessionRecordings,
|
|
280
|
+
ageAssurance: workflowState.workflowConfig.ageAssurance
|
|
281
|
+
});
|
|
282
|
+
let extraProps = {};
|
|
283
|
+
if (workflowState.currentNode.moduleKey === "REDIRECT_TO_MOBILE") extraProps = { onContinue: () => workflowManager.completeModule() };
|
|
284
|
+
return /* @__PURE__ */ u("div", {
|
|
249
285
|
class: "IncodeWorkflow",
|
|
250
|
-
children: /* @__PURE__ */
|
|
251
|
-
config:
|
|
252
|
-
onFinish: () =>
|
|
253
|
-
onError:
|
|
254
|
-
...
|
|
255
|
-
},
|
|
286
|
+
children: /* @__PURE__ */ u(Component, {
|
|
287
|
+
config: moduleConfig,
|
|
288
|
+
onFinish: () => workflowManager.completeModule(),
|
|
289
|
+
onError: handleModuleError,
|
|
290
|
+
...extraProps
|
|
291
|
+
}, workflowState.currentNode.id)
|
|
256
292
|
});
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
293
|
+
};
|
|
294
|
+
var IncodeWorkflowContent = ({ config, onFinish, onError }) => {
|
|
295
|
+
const { i18n } = useTranslation();
|
|
296
|
+
const initState = useWorkflowInitialization({
|
|
297
|
+
...config,
|
|
298
|
+
onError
|
|
261
299
|
});
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
300
|
+
y(() => {
|
|
301
|
+
if (readStoredLanguage()) return;
|
|
302
|
+
if (config.lang && i18n.language !== config.lang) i18n.changeLanguage(config.lang);
|
|
303
|
+
}, [config.lang, i18n]);
|
|
304
|
+
const hideSpinnerText = !(config.spinnerConfig?.title || config.spinnerConfig?.subtitle);
|
|
305
|
+
if (initState.status === "error") return /* @__PURE__ */ u("div", {
|
|
267
306
|
class: "IncodeWorkflow",
|
|
268
|
-
children: /* @__PURE__ */
|
|
269
|
-
})
|
|
307
|
+
children: /* @__PURE__ */ u(TerminalErrorPage, { message: initState.error })
|
|
308
|
+
});
|
|
309
|
+
if (initState.status === "initializing") return /* @__PURE__ */ u("div", {
|
|
270
310
|
class: "IncodeWorkflow",
|
|
271
|
-
children: /* @__PURE__ */
|
|
272
|
-
spinnerConfig:
|
|
273
|
-
hideText:
|
|
311
|
+
children: /* @__PURE__ */ u(TransitionSpinner, {
|
|
312
|
+
spinnerConfig: config.spinnerConfig,
|
|
313
|
+
hideText: hideSpinnerText
|
|
274
314
|
})
|
|
275
|
-
}) : /* @__PURE__ */ s(z, {
|
|
276
|
-
config: r,
|
|
277
|
-
workflowManager: c.workflowManager,
|
|
278
|
-
onFinish: i,
|
|
279
|
-
onError: a
|
|
280
315
|
});
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
316
|
+
return /* @__PURE__ */ u(IncodeWorkflowReady, {
|
|
317
|
+
config,
|
|
318
|
+
workflowManager: initState.workflowManager,
|
|
319
|
+
onFinish,
|
|
320
|
+
onError
|
|
321
|
+
});
|
|
322
|
+
};
|
|
323
|
+
var IncodeWorkflow = ({ config, onFinish, onError }) => /* @__PURE__ */ u(IncodeComponent, { children: config ? /* @__PURE__ */ u(IncodeWorkflowContent, {
|
|
324
|
+
config,
|
|
325
|
+
onFinish,
|
|
326
|
+
onError
|
|
285
327
|
}) : null });
|
|
286
|
-
|
|
328
|
+
registerIncodeModuleElement(IncodeWorkflow, "incode-workflow");
|
|
287
329
|
//#endregion
|
|
288
|
-
export {
|
|
330
|
+
export { IncodeWorkflow, mapModuleConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@incodetech/web",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20260609-11ba3e8a",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/IncodeTechnologies/incode-web-sdk.git"
|
|
@@ -255,7 +255,7 @@
|
|
|
255
255
|
"qrcode": "^1.5.4",
|
|
256
256
|
"signature_pad": "^5.1.3",
|
|
257
257
|
"tailwindcss": "^4.1.17",
|
|
258
|
-
"@incodetech/core": "0.0.0-dev-
|
|
258
|
+
"@incodetech/core": "0.0.0-dev-20260609-11ba3e8a"
|
|
259
259
|
},
|
|
260
260
|
"devDependencies": {
|
|
261
261
|
"@microsoft/api-extractor": "^7.53.3",
|
|
@@ -282,6 +282,7 @@
|
|
|
282
282
|
"rollup-plugin-visualizer": "^7.0.1",
|
|
283
283
|
"storybook": "^10.4.1",
|
|
284
284
|
"stylelint": "^17.5.0",
|
|
285
|
+
"terser": "^5.48.0",
|
|
285
286
|
"typescript": "^5.9.3",
|
|
286
287
|
"vite": "^8.0.0",
|
|
287
288
|
"vite-plugin-dts": "^4.5.4",
|
|
@@ -291,6 +292,7 @@
|
|
|
291
292
|
},
|
|
292
293
|
"scripts": {
|
|
293
294
|
"build": "rm -rf dist && vite build",
|
|
295
|
+
"build:cdn": "rm -rf dist && NODE_OPTIONS=--experimental-strip-types BUILD_TARGET=cdn vite build",
|
|
294
296
|
"build:dev": "NODE_ENV=development vite build",
|
|
295
297
|
"build:analyze": "rm -rf dist && ANALYZE=1 vite build && echo '\\nBundle report: packages/ui/dist/stats.html\\n'",
|
|
296
298
|
"test": "vitest run",
|