@incodetech/web 2.0.0-alpha.8 → 2.0.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.
Files changed (182) hide show
  1. package/dist/ae-signature/ae-signature.es.js +15 -0
  2. package/dist/ae-signature/styles.css +348 -0
  3. package/dist/ae-signature/styles2.css +107 -0
  4. package/dist/aligndevicelottie-DoV8xKjh.js +12757 -0
  5. package/dist/antifraud/antifraud.es.js +18 -0
  6. package/dist/antifraud/styles.css +2 -0
  7. package/dist/authentication/authentication.es.js +29 -0
  8. package/dist/autoFocusTitle-QexamZ4i.js +16 -0
  9. package/dist/back-horizontal-hint-B8Brxh3U.js +137 -0
  10. package/dist/back-tutorial-1NOQobGO.js +14585 -0
  11. package/dist/back-vertical-hint-BBo36dxn.js +128 -0
  12. package/dist/backdevicelottie-C_ceuqY7.js +16678 -0
  13. package/dist/base.css +5218 -639
  14. package/dist/blurdevicelottie-UO14Y0WC.js +15939 -0
  15. package/dist/bottomSheet-DE_8TFEC.js +31 -0
  16. package/dist/browser-ponyfill-jOkuz57z.js +299 -0
  17. package/dist/button-DcCUEn2n.js +24 -0
  18. package/dist/checkbox-Cl57ltq_.js +85 -0
  19. package/dist/consent/consent.es.js +90 -0
  20. package/dist/consent/styles.css +116 -0
  21. package/dist/countrySelector-CE-JgIsv.js +58 -0
  22. package/dist/cpf-ocr/styles.css +45 -0
  23. package/dist/cpfOcr-D_tbwbvh.js +78 -0
  24. package/dist/cross-document-data-match/cross-document-data-match.es.js +18 -0
  25. package/dist/curp-validation/curp-validation.es.js +279 -0
  26. package/dist/curp-validation/styles.css +82 -0
  27. package/dist/custom-fields/styles.css +22 -0
  28. package/dist/customFields-CW38fQUv.js +127 -0
  29. package/dist/customWatchlist-D9_yjEQd.js +33 -0
  30. package/dist/dateInputComposed-BpAGsjN6.js +55 -0
  31. package/dist/dateInputComposed-DU3o6PAV.js +1 -0
  32. package/dist/defineProperty-Dh8nSJpJ.js +39 -0
  33. package/dist/document-capture/styles.css +367 -0
  34. package/dist/documentCapture-xX-JT7ZY.js +763 -0
  35. package/dist/dropdownComposed-DFRBG22E.js +284 -0
  36. package/dist/dropdownComposed-DwTzc2YU.js +1 -0
  37. package/dist/dynamic-forms/styles.css +36 -0
  38. package/dist/dynamicForms-CJP1Ia6Q.js +262 -0
  39. package/dist/ekyb/ekyb.es.js +2 -0
  40. package/dist/ekyb/styles.css +137 -0
  41. package/dist/ekybModule-BSs7mndb.js +280 -0
  42. package/dist/ekybModule-D9M3E2Gm.js +2 -0
  43. package/dist/ekyc/ekyc.es.js +2 -0
  44. package/dist/ekyc/styles.css +106 -0
  45. package/dist/ekycModule-CU9pt5YN.js +246 -0
  46. package/dist/ekycModule-CZw9cLno.js +2 -0
  47. package/dist/electronic-signature/electronic-signature.es.js +2 -0
  48. package/dist/electronic-signature-COYXjGdd.js +410 -0
  49. package/dist/email/email.es.js +87 -145
  50. package/dist/email/styles.css +5 -116
  51. package/dist/emailInput-DppGf9pv.js +37 -0
  52. package/dist/expiredId-BnmzE8T3.js +70 -0
  53. package/dist/extensibility-CzEJfRwo.js +2586 -0
  54. package/dist/extensibility.es.js +25 -0
  55. package/dist/face-match/face-match.es.js +2 -0
  56. package/dist/face-match/styles.css +910 -0
  57. package/dist/faceMatch-B8j0g0Yo.js +2 -0
  58. package/dist/faceMatch-BV8UD7tj.js +201 -0
  59. package/dist/flip-animation-CgwRsEmK.js +6983 -0
  60. package/dist/flow/flow.es.js +646 -542
  61. package/dist/flow/styles.css +4524 -440
  62. package/dist/front-horizontal-hint-DGGGi8e1.js +380 -0
  63. package/dist/front-vertical-hint-CNr5mE6Q.js +420 -0
  64. package/dist/frontdevicelottie-Bu6f9fDE.js +17302 -0
  65. package/dist/geolocation/geolocation.es.js +857 -0
  66. package/dist/geolocation/styles.css +158 -0
  67. package/dist/glaredevicelottie-B10axYs_.js +14466 -0
  68. package/dist/governmentValidation/governmentValidation.es.js +98 -0
  69. package/dist/governmentValidation/styles.css +58 -0
  70. package/dist/homeScreen-DnP1jw9A.js +227 -0
  71. package/dist/hooks-BVnGysT7.js +80 -0
  72. package/dist/i18n-9s4OSqwi.js +2010 -0
  73. package/dist/icons-Cc7zwchP.js +310 -0
  74. package/dist/id/id.es.js +832 -0
  75. package/dist/id/styles.css +1287 -0
  76. package/dist/id-laser-h-mBAzHVOK.js +467 -0
  77. package/dist/id-laser-v-CrFg4bcJ.js +483 -0
  78. package/dist/id-ocr/styles.css +46 -0
  79. package/dist/id-tutorial-BCr42Pnn.js +13153 -0
  80. package/dist/id-verification/id-verification.es.js +20 -0
  81. package/dist/idOcr-CCjfWQvH.js +94 -0
  82. package/dist/identity-reuse/identity-reuse.es.js +198 -0
  83. package/dist/identity-reuse/styles.css +163 -0
  84. package/dist/incode-logo-DX016usY.js +4 -0
  85. package/dist/incodeComponent-C1o4M0ZK.js +50 -0
  86. package/dist/incodeModule-BqCjVgEI.js +18 -0
  87. package/dist/index.es.js +16 -6
  88. package/dist/inputComposed-APSw8C7o.js +89 -0
  89. package/dist/inputComposed-XYrarFxS.js +1 -0
  90. package/dist/loadingIcon-BN5YRQUb.js +104 -0
  91. package/dist/mandatoryConsent-DssKMC3v.js +100 -0
  92. package/dist/modal-NMxsQHAO.js +135 -0
  93. package/dist/modal.hooks-CAjcIFZK.js +126 -0
  94. package/dist/numberedStep-CT-alrK5.js +11 -0
  95. package/dist/optionAccessibleLabel-CzEeX3Q4.js +140 -0
  96. package/dist/otpInput-DqRA_egd.js +145 -0
  97. package/dist/page-C1yT4DLb.js +69 -0
  98. package/dist/passport-horizontal-hint-Bgquwtac.js +293 -0
  99. package/dist/passport-tutorial-DwRwtPVX.js +11689 -0
  100. package/dist/passport-vertical-hint-BT1D5BrW.js +267 -0
  101. package/dist/pdf-BurGZ08w.js +14967 -0
  102. package/dist/pdfViewer-BGBNL1Ea.js +63 -0
  103. package/dist/phone/phone.es.js +98 -3441
  104. package/dist/phone/styles.css +3 -297
  105. package/dist/phoneInputComposed-bvWhGLFZ.js +11206 -0
  106. package/dist/processing-G_y3o32b.js +6 -0
  107. package/dist/qe-signature/qe-signature.es.js +15 -0
  108. package/dist/radioGroupComposed-BbmvxmD2.js +177 -0
  109. package/dist/redirect-to-mobile/styles.css +588 -0
  110. package/dist/redirectToMobile-C3k1gloW.js +1514 -0
  111. package/dist/requiredLabelHint-BLwgqozE.js +13 -0
  112. package/dist/richText-DbJ5sl2n.js +1973 -0
  113. package/dist/rolldown-runtime-CYMK-g2i.js +20 -0
  114. package/dist/selfie/selfie.es.js +42 -892
  115. package/dist/selfie/styles.css +298 -184
  116. package/dist/selfieTutorial-BgrlUMXP.js +2677 -0
  117. package/dist/signature/signature.es.js +546 -0
  118. package/dist/snackbar-BDp8x7Cv.js +14 -0
  119. package/dist/spinner-B4dcie2T.js +1 -0
  120. package/dist/spinner-CKnjVHxw.js +39 -0
  121. package/dist/statusPage-CUI7ApcU.js +28 -0
  122. package/dist/successIcon-DbILeIz_.js +28 -0
  123. package/dist/tabs-DaPyP71c.js +78 -0
  124. package/dist/themes/dark.css +846 -151
  125. package/dist/themes/light.css +798 -116
  126. package/dist/transitionSpinner-PIEPU2Vx.js +17 -0
  127. package/dist/tutorial-9vHAHvMK.js +2587 -0
  128. package/dist/types/ae-signature.d.ts +40 -0
  129. package/dist/types/antifraud.d.ts +40 -0
  130. package/dist/types/authentication.d.ts +45 -0
  131. package/dist/types/consent.d.ts +41 -0
  132. package/dist/types/cpf-ocr/styles.d.ts +1 -0
  133. package/dist/types/cross-document-data-match.d.ts +34 -0
  134. package/dist/types/curp-validation.d.ts +40 -0
  135. package/dist/types/custom-fields/styles.d.ts +1 -0
  136. package/dist/types/document-capture/styles.d.ts +1 -0
  137. package/dist/types/dynamic-forms/styles.d.ts +1 -0
  138. package/dist/types/ekyb.d.ts +34 -0
  139. package/dist/types/ekyc.d.ts +34 -0
  140. package/dist/types/electronic-signature.d.ts +43 -0
  141. package/dist/types/email.d.ts +14 -4
  142. package/dist/types/extensibility.d.ts +981 -0
  143. package/dist/types/face-match.d.ts +59 -0
  144. package/dist/types/flow.d.ts +81 -13
  145. package/dist/types/geolocation.d.ts +41 -0
  146. package/dist/types/governmentValidation.d.ts +34 -0
  147. package/dist/types/id-ocr/styles.d.ts +1 -0
  148. package/dist/types/id-verification.d.ts +40 -0
  149. package/dist/types/id.d.ts +41 -0
  150. package/dist/types/identity-reuse.d.ts +43 -0
  151. package/dist/types/index.d.ts +6 -12
  152. package/dist/types/mandatory-consent/styles.d.ts +1 -0
  153. package/dist/types/phone.d.ts +14 -4
  154. package/dist/types/qe-signature.d.ts +40 -0
  155. package/dist/types/redirect-to-mobile/styles.d.ts +1 -0
  156. package/dist/types/selfie.d.ts +14 -4
  157. package/dist/types/signature.d.ts +40 -0
  158. package/dist/types/watchlist-for-business/styles.d.ts +1 -0
  159. package/dist/types/watchlist.d.ts +40 -0
  160. package/dist/types/workflow.d.ts +91 -0
  161. package/dist/typography-CxjaknHN.js +28 -0
  162. package/dist/uiConfig-CwpQ-IM6.js +20 -0
  163. package/dist/useModuleLoader-BFiVA41N.js +432 -0
  164. package/dist/vendor-preact-D6SntenC.js +958 -0
  165. package/dist/verificationResult-BrVbUJ4U.js +97 -0
  166. package/dist/verifiedByIncode-ChZBpqNy.js +101 -0
  167. package/dist/watchlist/watchlist.es.js +33 -0
  168. package/dist/watchlist-for-business/styles.css +18 -0
  169. package/dist/watchlistForBusiness-BcSNtHCV.js +77 -0
  170. package/dist/workflow/styles.css +4612 -0
  171. package/dist/workflow/workflow.es.js +244 -0
  172. package/package.json +211 -15
  173. package/dist/browser-ponyfill-B6W6hHVY.js +0 -344
  174. package/dist/incodeModule-Dv8Qllrv.js +0 -254
  175. package/dist/instance-B-q0ZREN.js +0 -2140
  176. package/dist/otpInput-BtoZe0Wz.js +0 -151
  177. package/dist/page-D9ijzlSn.js +0 -234
  178. package/dist/selfieTutorial-C-u5GufD.js +0 -29
  179. package/dist/setup-wNL83jmW.js +0 -20
  180. package/dist/title-BfO5Dlzk.js +0 -25
  181. package/dist/uiConfig-CQ1W9cUD.js +0 -23
  182. package/dist/vendor-preact-CK0WeTOR.js +0 -584
@@ -0,0 +1,91 @@
1
+ import { CustomModuleCallback } from '@incodetech/core/workflow';
2
+ import { FC } from 'preact/compat';
3
+ import { FinishStatus } from '@incodetech/core/flow';
4
+ import { WasmConfig } from '@incodetech/core/wasm';
5
+
6
+ declare type IncodeModuleProps<TConfig, TResult = void, TManager = unknown> = {
7
+ /**
8
+ * Module configuration required to render the flow.
9
+ * For Web Components, this is typically assigned via `element.config = ...`.
10
+ */
11
+ config?: TConfig;
12
+ /**
13
+ * Optional pre-built manager. When provided, the module does not create or manage the manager lifecycle.
14
+ */
15
+ manager?: TManager;
16
+ /**
17
+ * Callback invoked when the module completes successfully.
18
+ * @param result - Optional result data from the module completion
19
+ */
20
+ onFinish?: (result?: TResult) => void;
21
+ /**
22
+ * Callback invoked when a fatal module error occurs.
23
+ *
24
+ * @param error - Human-readable error message.
25
+ * @param errorCode - Optional numeric code (e.g. HTTP status). Populated by
26
+ * the workflow and flow modules on QR validation failures —
27
+ * `4026` (`expiredUUID`), `4081` (`invalidQRuuid`) or `4083` (`onboardingUrlAlreadyUsed`).
28
+ */
29
+ onError?: (error: string | undefined, errorCode?: number) => void;
30
+ };
31
+
32
+ export declare const IncodeWorkflow: FC<IncodeWorkflowProps>;
33
+
34
+ declare type IncodeWorkflowProps = IncodeModuleProps<WorkflowComponentConfig, FinishStatus>;
35
+
36
+ export declare function mapModuleConfig(options: MapModuleConfigOptions): Record<string, unknown>;
37
+
38
+ /**
39
+ * Maps backend moduleConfiguration to the shape each UI component expects.
40
+ * Most modules receive config as-is. Some need field renaming or extra fields.
41
+ */
42
+ declare type MapModuleConfigOptions = {
43
+ moduleKey: string;
44
+ config: Record<string, unknown>;
45
+ workflowId: string;
46
+ authHint?: string;
47
+ lang?: string;
48
+ mergeSessionRecordings?: boolean;
49
+ ageAssurance?: boolean;
50
+ };
51
+
52
+ declare type SpinnerConfig = {
53
+ title?: string;
54
+ subtitle?: string;
55
+ size?: SpinnerSize;
56
+ };
57
+
58
+ declare type SpinnerSize = 'small' | 'medium' | 'large';
59
+
60
+ export declare type WorkflowComponentConfig = {
61
+ token: string;
62
+ lang?: string;
63
+ disableDashboardTheme?: boolean;
64
+ wasmConfig?: WasmConfig | false;
65
+ spinnerConfig?: SpinnerConfig;
66
+ customModuleCallback?: CustomModuleCallback;
67
+ interviewId?: string;
68
+ isDesktop?: boolean;
69
+ /** Authentication hint for AUTHENTICATION module. Required when workflow includes face authentication. */
70
+ authHint?: string;
71
+ /**
72
+ * QR anti-phishing token from the incoming URL. When provided, the SDK burns
73
+ * it via `POST /omni/qr/validate` on mount and invokes `onUrlUuidRefreshed`
74
+ * with the rotated value so the host can update the address bar (e.g.,
75
+ * `history.replaceState`). Validation failures abort initialization via
76
+ * `onError`.
77
+ */
78
+ urlUuid?: string;
79
+ onModuleLoading?: (moduleKey: string) => void;
80
+ onModuleLoaded?: (moduleKey: string) => void;
81
+ onUrlUuidRefreshed?: (urlUuid: string) => void;
82
+ };
83
+
84
+ export { }
85
+
86
+ declare global {
87
+ interface HTMLElementTagNameMap {
88
+ 'incode-workflow': HTMLElement & IncodeModuleProps<WorkflowComponentConfig,
89
+ FinishStatus>;
90
+ }
91
+ }
@@ -0,0 +1,28 @@
1
+ import { a as e, v as t } from "./vendor-preact-D6SntenC.js";
2
+ import { n } from "./loadingIcon-BN5YRQUb.js";
3
+ //#region src/shared/typography/typography.tsx
4
+ var r = e(({ children: e, className: n, ...r }, i) => /* @__PURE__ */ t("h2", {
5
+ ref: i,
6
+ class: `IncodeTitle ${n ?? ""}`,
7
+ ...r,
8
+ children: e
9
+ })), i = e(({ children: e, className: r, ...i }, a) => /* @__PURE__ */ t("h1", {
10
+ ref: a,
11
+ class: n("IncodeTypographyH1", r),
12
+ ...i,
13
+ children: e
14
+ })), a = ({ children: e, className: r }) => /* @__PURE__ */ t("h3", {
15
+ class: n("IncodeTypographyH3", r),
16
+ children: e
17
+ }), o = ({ children: e, className: r }) => /* @__PURE__ */ t("h4", {
18
+ class: n("IncodeTypographyH4", r),
19
+ children: e
20
+ }), s = ({ children: e, className: r }) => /* @__PURE__ */ t("h5", {
21
+ class: n("IncodeTypographyH5", r),
22
+ children: e
23
+ }), c = ({ children: e, className: r }) => /* @__PURE__ */ t("p", {
24
+ class: n("IncodeTypographyP", r),
25
+ children: e
26
+ });
27
+ //#endregion
28
+ export { s as a, o as i, i as n, c as o, a as r, r as t };
@@ -0,0 +1,20 @@
1
+ import { i as e } from "./vendor-preact-D6SntenC.js";
2
+ //#region src/shared/uiConfig/uiConfig.ts
3
+ var t = {}, n = /* @__PURE__ */ new Set();
4
+ function r(e) {
5
+ return n.add(e), () => {
6
+ n.delete(e);
7
+ };
8
+ }
9
+ function i() {
10
+ return t;
11
+ }
12
+ function a(e) {
13
+ t = e;
14
+ for (let e of n) e();
15
+ }
16
+ function o() {
17
+ return e(r, i);
18
+ }
19
+ //#endregion
20
+ export { o as n, a as t };
@@ -0,0 +1,432 @@
1
+ import { i as e, r as t } from "./i18n-9s4OSqwi.js";
2
+ import { _ as n, l as r, p as i, v as a } from "./vendor-preact-D6SntenC.js";
3
+ import { t as o } from "./uiConfig-CwpQ-IM6.js";
4
+ import { t as s } from "./button-DcCUEn2n.js";
5
+ import { initializeWasmUtil as c, resolveWasmConfig as l, setWasmConfig as u, upgradeToWasmHttpClient as d, warmupWasm as f } from "@incodetech/core/wasm";
6
+ import { getDeviceClass as p } from "@incodetech/core/device";
7
+ import { createOrchestratedFlowManager as m, getFlow as h, getRequiredWasmPipelines as g } from "@incodetech/core/flow";
8
+ import { initializeSession as _ } from "@incodetech/core/session";
9
+ import { api as v } from "@incodetech/core/http";
10
+ //#region src/styles/generatePalette.ts
11
+ function y(e) {
12
+ let t = e.replace("#", "");
13
+ t.length === 3 && (t = t.split("").map((e) => e + e).join(""));
14
+ let n = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
15
+ if (!n) return null;
16
+ let r = Number.parseInt(n[1], 16) / 255, i = Number.parseInt(n[2], 16) / 255, a = Number.parseInt(n[3], 16) / 255, o = Math.max(r, i, a), s = Math.min(r, i, a), c = 0, l = 0, u = (o + s) / 2;
17
+ if (o !== s) {
18
+ let e = o - s;
19
+ switch (l = u > .5 ? e / (2 - o - s) : e / (o + s), o) {
20
+ case r:
21
+ c = ((i - a) / e + (i < a ? 6 : 0)) / 6;
22
+ break;
23
+ case i:
24
+ c = ((a - r) / e + 2) / 6;
25
+ break;
26
+ case a:
27
+ c = ((r - i) / e + 4) / 6;
28
+ break;
29
+ }
30
+ }
31
+ return {
32
+ h: c * 360,
33
+ s: l * 100,
34
+ l: u * 100
35
+ };
36
+ }
37
+ function b(e, t, n) {
38
+ let r = e / 360, i = t / 100, a = n / 100, o, s, c;
39
+ if (i === 0) o = s = c = a;
40
+ else {
41
+ let e = (e, t, n) => (n < 0 && (n += 1), n > 1 && --n, n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e), t = a < .5 ? a * (1 + i) : a + i - a * i, n = 2 * a - t;
42
+ o = e(n, t, r + 1 / 3), s = e(n, t, r), c = e(n, t, r - 1 / 3);
43
+ }
44
+ let l = (e) => {
45
+ let t = Math.round(e * 255).toString(16);
46
+ return t.length === 1 ? `0${t}` : t;
47
+ };
48
+ return `#${l(o)}${l(s)}${l(c)}`;
49
+ }
50
+ function ee(e) {
51
+ let t = y(e);
52
+ if (!t) throw Error(`Invalid color format: ${e}`);
53
+ return {
54
+ 50: b(t.h, t.s, 95),
55
+ 200: b(t.h, t.s, 80),
56
+ 300: b(t.h, t.s, 65),
57
+ 400: b(t.h, t.s, Math.min(100, t.l + 10)),
58
+ 500: e,
59
+ 600: b(t.h, t.s, Math.max(0, t.l - 10)),
60
+ 900: b(t.h, t.s, 20)
61
+ };
62
+ }
63
+ //#endregion
64
+ //#region src/styles/applyTheme.ts
65
+ function x(e, t) {
66
+ if (typeof document > "u") return;
67
+ let n = ee(e), r = document.getElementById("incode-theme");
68
+ r || (r = document.createElement("style"), r.id = "incode-theme", document.head.appendChild(r));
69
+ let i = t || "#ffffff", a = `
70
+ :root,
71
+ :host {
72
+ --primitive-color-brand-50: ${n[50]};
73
+ --primitive-color-brand-200: ${n[200]};
74
+ --primitive-color-brand-300: ${n[300]};
75
+ --primitive-color-brand-400: ${n[400]};
76
+ --primitive-color-brand-500: ${n[500]};
77
+ --primitive-color-brand-600: ${n[600]};
78
+ --primitive-color-brand-900: ${n[900]};
79
+ --button-primary-text-default: ${i};
80
+ }
81
+ `;
82
+ r.textContent = a;
83
+ }
84
+ //#endregion
85
+ //#region src/styles/fetchTheme.ts
86
+ async function S() {
87
+ return (await v.get("/omni/asset/fetch-all")).data;
88
+ }
89
+ var C = /* @__PURE__ */ new Map();
90
+ async function w(e) {
91
+ if (e.startsWith("data:")) return e;
92
+ let t = C.get(e);
93
+ if (t) return t;
94
+ let n = await (await fetch(e)).blob(), r = await new Promise((e, t) => {
95
+ let r = new FileReader();
96
+ r.onloadend = () => e(r.result), r.onerror = t, r.readAsDataURL(n);
97
+ });
98
+ return C.set(e, r), r;
99
+ }
100
+ async function T() {
101
+ let e = await S();
102
+ if (!e.theme) throw Error("Theme URL not found in assets response");
103
+ let t = e.theme, n = t.startsWith("http://") || t.startsWith("https://"), r;
104
+ if (n) {
105
+ let e = await fetch(t);
106
+ if (!e.ok) throw Error(`Failed to fetch theme: ${e.statusText}`);
107
+ r = await e.json();
108
+ } else r = (await v.get(t)).data;
109
+ let i = e["logo.png"] || e["logo.svg"] || e["logo.jpg"] || e["logo.jpeg"] || e["logo.webp"] || r.logo, a = i;
110
+ return i && (a = await w(i)), {
111
+ ...r,
112
+ logo: a
113
+ };
114
+ }
115
+ async function E() {
116
+ let e = await T();
117
+ return e.main && x(e.main, e.buttonColor), e;
118
+ }
119
+ //#endregion
120
+ //#region src/modules/flow/flowInit.ts
121
+ var D = () => import("./id/id.es.js").then((e) => e.Id), O = () => import("./homeScreen-DnP1jw9A.js").then((e) => e.HomeScreen), k, te = new Set(["IP_ADDRESS", "TRUST_GRAPH"]);
122
+ function A(e) {
123
+ if (e === "IP_ADDRESS") return () => import("@incodetech/core/flow").then((e) => e.noOpFlowModuleMachine);
124
+ if (e === "TRUST_GRAPH") return () => import("@incodetech/core/trust-graph").then((e) => e.trustGraphMachine);
125
+ if (e === "REDIRECT_TO_MOBILE") return () => import("@incodetech/core/redirect-to-mobile").then((e) => e.redirectToMobileMachine);
126
+ if (e === "PHONE") return () => import("@incodetech/core/phone").then((e) => e.phoneMachine);
127
+ if (e === "EMAIL") return () => import("@incodetech/core/email").then((e) => e.emailMachine);
128
+ if (e === "SELFIE") return () => import("@incodetech/core/selfie").then((e) => e.selfieMachine);
129
+ if (e === "AUTHENTICATION") return () => import("@incodetech/core/authentication").then((e) => e.authenticationMachine);
130
+ if (e === "ID" || e === "TUTORIAL_ID" || e === "SECOND_ID") return () => import("@incodetech/core/id").then((e) => e.idCaptureMachine);
131
+ if (e === "ID_OCR") return () => import("@incodetech/core/id-ocr").then((e) => e.idOcrStateMachine);
132
+ if (e === "CPF_OCR") return () => import("@incodetech/core/cpf-ocr").then((e) => e.cpfOcrMachine);
133
+ if (e === "FACE_MATCH") return () => import("@incodetech/core/face-match").then((e) => e.faceMatchMachine);
134
+ if (e === "CURP_VALIDATION") return () => import("@incodetech/core/curp-validation").then((e) => e.curpValidationMachine);
135
+ if (e === "GOVT_VALIDATION_PROVISIONING") return () => import("@incodetech/core/government-validation").then((e) => e.governmentValidationMachine);
136
+ if (e === "GEOLOCATION") return () => import("@incodetech/core/geolocation").then((e) => e.geolocationMachine);
137
+ if (e === "EXTERNAL_VERIFICATION") return () => import("@incodetech/core/ekyc").then((e) => e.ekycMachine);
138
+ if (e === "EKYB") return () => import("@incodetech/core/ekyb").then((e) => e.ekybMachine);
139
+ if (e === "DOCUMENT_CAPTURE" || e === "ADDRESS") return () => import("@incodetech/core/document-capture").then((e) => e.documentCaptureMachine);
140
+ if (e === "COMBINED_CONSENT") return () => import("@incodetech/core/consent").then((e) => e.consentMachine);
141
+ if (e === "MANDATORY_CONSENT") return () => import("@incodetech/core/mandatory-consent").then((e) => e.mandatoryConsentMachine);
142
+ if (e === "SIGNATURE") return () => import("@incodetech/core/signature").then((e) => e.signatureMachine);
143
+ if (e === "ANTIFRAUD") return () => import("@incodetech/core/antifraud").then((e) => e.antifraudMachine);
144
+ if (e === "CUSTOM_FIELDS") return () => import("@incodetech/core/custom-fields").then((e) => e.customFieldsMachine);
145
+ if (e === "WATCHLIST") return () => import("@incodetech/core/watchlist").then((e) => e.watchlistMachine);
146
+ if (e === "WATCHLIST_BUSINESS") return () => import("@incodetech/core/watchlist-for-business").then((e) => e.watchlistForBusinessMachine);
147
+ if (e === "INCODE_WATCHLIST") return () => import("@incodetech/core/custom-watchlist").then((e) => e.customWatchlistMachine);
148
+ if (e === "AE_SIGNATURE") return () => import("@incodetech/core/ae-signature").then((e) => e.aeSignatureMachine);
149
+ if (e === "QE_SIGNATURE") return () => import("@incodetech/core/qe-signature").then((e) => e.qeSignatureMachine);
150
+ if (e === "CROSS_DOCUMENT_DATA_MATCH") return () => import("@incodetech/core/cross-document-data-match").then((e) => e.crossDocumentDataMatchMachine);
151
+ if (e === "DYNAMIC_FORMS") return () => import("@incodetech/core/dynamic-forms").then((e) => e.dynamicFormsMachine);
152
+ }
153
+ function j(e) {
154
+ let t = {};
155
+ for (let n of e) {
156
+ let e = n.key;
157
+ if (t[e]) continue;
158
+ let r = A(e);
159
+ r && (t[e] = r);
160
+ }
161
+ return t;
162
+ }
163
+ var M = {
164
+ REDIRECT_TO_MOBILE: () => import("./redirectToMobile-C3k1gloW.js").then((e) => e.RedirectToMobile),
165
+ PHONE: () => import("./phone/phone.es.js").then((e) => e.Phone),
166
+ EMAIL: () => import("./email/email.es.js").then((e) => e.Email),
167
+ SELFIE: () => import("./selfie/selfie.es.js").then((e) => e.Selfie),
168
+ AUTHENTICATION: () => import("./authentication/authentication.es.js").then((e) => e.Authentication),
169
+ ID: D,
170
+ ID_CAPTURE: D,
171
+ TUTORIAL_ID: D,
172
+ SECOND_ID: D,
173
+ FACE_MATCH: () => import("./faceMatch-B8j0g0Yo.js").then((e) => e.FaceMatch),
174
+ CURP_VALIDATION: () => import("./curp-validation/curp-validation.es.js").then((e) => e.CurpValidation),
175
+ GOVT_VALIDATION_PROVISIONING: () => import("./governmentValidation/governmentValidation.es.js").then((e) => e.GovernmentValidation),
176
+ GEOLOCATION: () => import("./geolocation/geolocation.es.js").then((e) => e.Geolocation),
177
+ EXTERNAL_VERIFICATION: () => import("./ekycModule-CZw9cLno.js").then((e) => e.EkycModule),
178
+ EKYB: () => import("./ekybModule-D9M3E2Gm.js").then((e) => e.EkybModule),
179
+ DOCUMENT_CAPTURE: () => import("./documentCapture-xX-JT7ZY.js").then((e) => e.DocumentCapture),
180
+ ADDRESS: () => import("./documentCapture-xX-JT7ZY.js").then((e) => e.DocumentCapture),
181
+ COMBINED_CONSENT: () => import("./consent/consent.es.js").then((e) => e.Consent),
182
+ MANDATORY_CONSENT: () => import("./mandatoryConsent-DssKMC3v.js").then((e) => e.MandatoryConsent),
183
+ SIGNATURE: () => import("./signature/signature.es.js").then((e) => e.Signature),
184
+ ID_OCR: () => import("./idOcr-CCjfWQvH.js").then((e) => e.IdOcr),
185
+ CPF_OCR: () => import("./cpfOcr-D_tbwbvh.js").then((e) => e.CpfOcr),
186
+ ANTIFRAUD: () => import("./antifraud/antifraud.es.js").then((e) => e.Antifraud),
187
+ CUSTOM_FIELDS: () => import("./customFields-CW38fQUv.js").then((e) => e.CustomFields),
188
+ WATCHLIST: () => import("./watchlist/watchlist.es.js").then((e) => e.Watchlist),
189
+ WATCHLIST_BUSINESS: () => import("./watchlistForBusiness-BcSNtHCV.js").then((e) => e.WatchlistForBusiness),
190
+ INCODE_WATCHLIST: () => import("./customWatchlist-D9_yjEQd.js").then((e) => e.CustomWatchlist),
191
+ AE_SIGNATURE: () => import("./ae-signature/ae-signature.es.js").then((e) => e.AeSignature),
192
+ QE_SIGNATURE: () => import("./qe-signature/qe-signature.es.js").then((e) => e.QeSignature),
193
+ CROSS_DOCUMENT_DATA_MATCH: () => import("./cross-document-data-match/cross-document-data-match.es.js").then((e) => e.CrossDocumentDataMatch),
194
+ DYNAMIC_FORMS: () => import("./dynamicForms-CJP1Ia6Q.js").then((e) => e.DynamicForms)
195
+ };
196
+ function N() {
197
+ return O();
198
+ }
199
+ function P() {
200
+ k || (k = N(), k.catch(() => {
201
+ k = void 0;
202
+ }));
203
+ }
204
+ var F;
205
+ function I() {
206
+ if (F) return;
207
+ let e = M.REDIRECT_TO_MOBILE, t = A("REDIRECT_TO_MOBILE"), n = [];
208
+ e && n.push(e()), t && n.push(t()), F = Promise.all(n), F.catch(() => {
209
+ F = void 0;
210
+ });
211
+ }
212
+ function L(e = {}) {
213
+ let t = {}, n = e.isDesktop ?? p() === "desktop", { enableHome: r, ...i } = e;
214
+ return m({
215
+ enableHome: r,
216
+ getFlow: async (e) => {
217
+ let r = await h(e, {
218
+ ...i,
219
+ isDesktop: n
220
+ }), a = j(r.flowModules ?? []);
221
+ for (let e of Object.keys(t)) delete t[e];
222
+ return Object.assign(t, a), r;
223
+ },
224
+ lazyModules: t
225
+ });
226
+ }
227
+ async function R(n) {
228
+ await _({ token: n.token }), t(e(n.lang ? { lang: n.lang } : void 0));
229
+ }
230
+ async function z(e) {
231
+ let { token: t, lang: n, flowManager: r } = e;
232
+ await R({
233
+ token: t,
234
+ lang: n
235
+ }), r.load();
236
+ }
237
+ async function B() {
238
+ try {
239
+ let e = await E(), t = {
240
+ logoSrc: e.logo,
241
+ subtitle: e.subtitle,
242
+ hideFooterBranding: e.hideFooterBranding
243
+ };
244
+ return o(t), {
245
+ theme: e,
246
+ uiConfig: t
247
+ };
248
+ } catch {
249
+ return {};
250
+ }
251
+ }
252
+ function V(e, t) {
253
+ if (e.currentStep === "REDIRECT_TO_MOBILE") return;
254
+ let n = g(e.flow);
255
+ if (n.length > 0) {
256
+ let e = l({
257
+ ...t ?? {},
258
+ pipelines: n
259
+ }), r = {
260
+ ...e,
261
+ pipelines: e.pipelines ? [...e.pipelines] : void 0
262
+ };
263
+ u(r), f(e).then(() => c(r)).then(() => d(r)).catch((e) => {
264
+ console.error("WASM warmup failed:", e);
265
+ });
266
+ }
267
+ }
268
+ function H(e) {
269
+ let t = e.currentStep;
270
+ if (t) {
271
+ let e = M[t];
272
+ e && e().catch(() => {});
273
+ }
274
+ }
275
+ //#endregion
276
+ //#region src/modules/flow/unsupportedModule.tsx
277
+ var U = ({ moduleKey: e, onNext: t }) => /* @__PURE__ */ a("section", {
278
+ class: "IncodeUnsupportedModule",
279
+ "aria-live": "polite",
280
+ children: /* @__PURE__ */ a("div", {
281
+ class: "IncodeUnsupportedModuleContent",
282
+ children: [
283
+ /* @__PURE__ */ a("h2", {
284
+ class: "IncodeUnsupportedModuleTitle",
285
+ children: "Module not available"
286
+ }),
287
+ /* @__PURE__ */ a("p", {
288
+ class: "IncodeUnsupportedModuleMessage",
289
+ children: [
290
+ "The \"",
291
+ e,
292
+ "\" module is not yet supported in this version."
293
+ ]
294
+ }),
295
+ /* @__PURE__ */ a(s, {
296
+ onClick: t,
297
+ class: "IncodeUnsupportedModuleButton",
298
+ "data-testid": "unsupported-module-next-button",
299
+ children: "Next"
300
+ })
301
+ ]
302
+ })
303
+ }), W = () => null, G = () => Promise.resolve(W), K = new Set(["IDENTITY_SEARCH"]);
304
+ //#endregion
305
+ //#region src/modules/flow/useModuleLoader.ts
306
+ function q(e, t) {
307
+ return e instanceof Error ? e.message : t;
308
+ }
309
+ var J = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap();
310
+ function X(e) {
311
+ return e;
312
+ }
313
+ function Z(e) {
314
+ if (e) return J.get(X(e));
315
+ }
316
+ function ne(e) {
317
+ let t = X(e), n = J.get(t);
318
+ if (n) return Promise.resolve(n);
319
+ let r = Y.get(t);
320
+ if (r) return r;
321
+ let i = e().then((e) => (J.set(t, e), Y.delete(t), e)).catch((e) => {
322
+ throw Y.delete(t), e;
323
+ });
324
+ return Y.set(t, i), i;
325
+ }
326
+ function Q(e) {
327
+ if (!e) return { status: "idle" };
328
+ let t = Z(e);
329
+ return t ? {
330
+ status: "loaded",
331
+ Component: t
332
+ } : { status: "loading" };
333
+ }
334
+ function re(e, t, n) {
335
+ if (e) return t[e] ?? (n?.has(e) ? G : void 0);
336
+ }
337
+ function $(e) {
338
+ let { loader: t, onLoading: a, onLoaded: o, onError: s } = e, [c, l] = i(() => Q(t)), u = r(t), d = r(a), f = r(o), p = r(s);
339
+ return n(() => {
340
+ d.current = a, f.current = o, p.current = s;
341
+ }, [
342
+ a,
343
+ o,
344
+ s
345
+ ]), u.current !== t && (u.current = t, l(Q(t))), n(() => {
346
+ if (!t) return;
347
+ if (Z(t)) {
348
+ f.current?.();
349
+ return;
350
+ }
351
+ d.current?.();
352
+ let e = !1;
353
+ return ne(t).then((t) => {
354
+ e || (l({
355
+ status: "loaded",
356
+ Component: t
357
+ }), f.current?.());
358
+ }).catch((t) => {
359
+ if (!e) {
360
+ let e = q(t, "Failed to load component");
361
+ l({
362
+ status: "error",
363
+ error: e
364
+ }), p.current?.(e);
365
+ }
366
+ }), () => {
367
+ e = !0;
368
+ };
369
+ }, [t]), c;
370
+ }
371
+ function ie(e) {
372
+ let { moduleKey: t, modules: r, headlessModuleKeys: a, onModuleLoading: o, onModuleLoaded: s, onError: c } = e, [l, u] = i(void 0), d = re(t, r, a), f = $({
373
+ loader: d,
374
+ onLoading: t ? () => o?.(t) : void 0,
375
+ onLoaded: t ? () => s?.(t) : void 0,
376
+ onError: t ? (e) => c?.(`Failed to load ${t}: ${e}`) : void 0
377
+ });
378
+ return n(() => {
379
+ if (!t) {
380
+ u(void 0);
381
+ return;
382
+ }
383
+ u(d ? void 0 : t);
384
+ }, [d, t]), t ? l ? {
385
+ status: "unsupported",
386
+ moduleKey: l
387
+ } : f.status === "idle" || f.status === "loading" ? {
388
+ status: "loading",
389
+ moduleKey: t
390
+ } : f.status === "error" ? {
391
+ status: "error",
392
+ moduleKey: t,
393
+ error: f.error
394
+ } : {
395
+ status: "loaded",
396
+ moduleKey: t,
397
+ Component: f.Component
398
+ } : { status: "idle" };
399
+ }
400
+ function ae(e) {
401
+ let { moduleKey: t, modules: n } = e, r = t ? n[t] : void 0, i = $({ loader: r });
402
+ return r != null && i.status === "loaded";
403
+ }
404
+ function oe(e) {
405
+ typeof requestIdleCallback < "u" ? requestIdleCallback(() => {
406
+ e();
407
+ }) : setTimeout(e, 0);
408
+ }
409
+ function se(e, t, i, a) {
410
+ let o = r(/* @__PURE__ */ new Set());
411
+ n(() => {
412
+ if (a && t < e.length - 1) {
413
+ let n = e[t + 1];
414
+ if (n && !o.current.has(n)) {
415
+ o.current.add(n);
416
+ let e = i[n];
417
+ e && oe(() => {
418
+ e().catch(() => {
419
+ o.current.delete(n);
420
+ });
421
+ });
422
+ }
423
+ }
424
+ }, [
425
+ e,
426
+ t,
427
+ i,
428
+ a
429
+ ]);
430
+ }
431
+ //#endregion
432
+ export { U as a, L as c, H as d, P as f, E as g, V as h, K as i, B as l, R as m, ae as n, te as o, I as p, se as r, M as s, ie as t, z as u };