@incodetech/web 2.0.0-rc.0 → 2.0.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 (178) hide show
  1. package/package.json +3 -3
  2. package/dist/ae-signature/ae-signature.es.js +0 -15
  3. package/dist/ae-signature/styles.css +0 -348
  4. package/dist/ae-signature/styles2.css +0 -107
  5. package/dist/aligndevicelottie-DoV8xKjh.js +0 -12757
  6. package/dist/antifraud/antifraud.es.js +0 -18
  7. package/dist/antifraud/styles.css +0 -2
  8. package/dist/authentication/authentication.es.js +0 -29
  9. package/dist/autoFocusTitle-QexamZ4i.js +0 -16
  10. package/dist/back-horizontal-hint-B8Brxh3U.js +0 -137
  11. package/dist/back-tutorial-1NOQobGO.js +0 -14585
  12. package/dist/back-vertical-hint-BBo36dxn.js +0 -128
  13. package/dist/backdevicelottie-C_ceuqY7.js +0 -16678
  14. package/dist/base.css +0 -5818
  15. package/dist/blurdevicelottie-UO14Y0WC.js +0 -15939
  16. package/dist/bottomSheet-DE_8TFEC.js +0 -31
  17. package/dist/browser-ponyfill-jOkuz57z.js +0 -299
  18. package/dist/button-DcCUEn2n.js +0 -24
  19. package/dist/checkbox-Cl57ltq_.js +0 -85
  20. package/dist/consent/consent.es.js +0 -90
  21. package/dist/consent/styles.css +0 -116
  22. package/dist/countrySelector-CE-JgIsv.js +0 -58
  23. package/dist/cpf-ocr/styles.css +0 -45
  24. package/dist/cpfOcr-D_tbwbvh.js +0 -78
  25. package/dist/cross-document-data-match/cross-document-data-match.es.js +0 -18
  26. package/dist/curp-validation/curp-validation.es.js +0 -279
  27. package/dist/curp-validation/styles.css +0 -82
  28. package/dist/custom-fields/styles.css +0 -22
  29. package/dist/customFields-CW38fQUv.js +0 -127
  30. package/dist/customWatchlist-D9_yjEQd.js +0 -33
  31. package/dist/dateInputComposed-BpAGsjN6.js +0 -55
  32. package/dist/dateInputComposed-DU3o6PAV.js +0 -1
  33. package/dist/defineProperty-Dh8nSJpJ.js +0 -39
  34. package/dist/document-capture/styles.css +0 -367
  35. package/dist/documentCapture-xX-JT7ZY.js +0 -763
  36. package/dist/dropdownComposed-DFRBG22E.js +0 -284
  37. package/dist/dropdownComposed-DwTzc2YU.js +0 -1
  38. package/dist/dynamic-forms/styles.css +0 -36
  39. package/dist/dynamicForms-CJP1Ia6Q.js +0 -262
  40. package/dist/ekyb/ekyb.es.js +0 -2
  41. package/dist/ekyb/styles.css +0 -137
  42. package/dist/ekybModule-BSs7mndb.js +0 -280
  43. package/dist/ekybModule-D9M3E2Gm.js +0 -2
  44. package/dist/ekyc/ekyc.es.js +0 -2
  45. package/dist/ekyc/styles.css +0 -106
  46. package/dist/ekycModule-CU9pt5YN.js +0 -246
  47. package/dist/ekycModule-CZw9cLno.js +0 -2
  48. package/dist/electronic-signature/electronic-signature.es.js +0 -2
  49. package/dist/electronic-signature-COYXjGdd.js +0 -410
  50. package/dist/email/email.es.js +0 -87
  51. package/dist/email/styles.css +0 -12
  52. package/dist/emailInput-DppGf9pv.js +0 -37
  53. package/dist/expiredId-BnmzE8T3.js +0 -70
  54. package/dist/extensibility-CzEJfRwo.js +0 -2586
  55. package/dist/extensibility.es.js +0 -25
  56. package/dist/face-match/face-match.es.js +0 -2
  57. package/dist/face-match/styles.css +0 -910
  58. package/dist/faceMatch-B8j0g0Yo.js +0 -2
  59. package/dist/faceMatch-BV8UD7tj.js +0 -201
  60. package/dist/flip-animation-CgwRsEmK.js +0 -6983
  61. package/dist/flow/flow.es.js +0 -661
  62. package/dist/flow/styles.css +0 -5205
  63. package/dist/front-horizontal-hint-DGGGi8e1.js +0 -380
  64. package/dist/front-vertical-hint-CNr5mE6Q.js +0 -420
  65. package/dist/frontdevicelottie-Bu6f9fDE.js +0 -17302
  66. package/dist/geolocation/geolocation.es.js +0 -857
  67. package/dist/geolocation/styles.css +0 -158
  68. package/dist/glaredevicelottie-B10axYs_.js +0 -14466
  69. package/dist/governmentValidation/governmentValidation.es.js +0 -98
  70. package/dist/governmentValidation/styles.css +0 -58
  71. package/dist/homeScreen-DnP1jw9A.js +0 -227
  72. package/dist/hooks-BVnGysT7.js +0 -80
  73. package/dist/i18n-9s4OSqwi.js +0 -2010
  74. package/dist/icons-Cc7zwchP.js +0 -310
  75. package/dist/id/id.es.js +0 -832
  76. package/dist/id/styles.css +0 -1287
  77. package/dist/id-laser-h-mBAzHVOK.js +0 -467
  78. package/dist/id-laser-v-CrFg4bcJ.js +0 -483
  79. package/dist/id-ocr/styles.css +0 -46
  80. package/dist/id-tutorial-BCr42Pnn.js +0 -13153
  81. package/dist/id-verification/id-verification.es.js +0 -20
  82. package/dist/idOcr-CCjfWQvH.js +0 -94
  83. package/dist/identity-reuse/identity-reuse.es.js +0 -198
  84. package/dist/identity-reuse/styles.css +0 -163
  85. package/dist/incode-logo-DX016usY.js +0 -4
  86. package/dist/incodeComponent-C1o4M0ZK.js +0 -50
  87. package/dist/incodeModule-BqCjVgEI.js +0 -18
  88. package/dist/index.es.js +0 -16
  89. package/dist/inputComposed-APSw8C7o.js +0 -89
  90. package/dist/inputComposed-XYrarFxS.js +0 -1
  91. package/dist/loadingIcon-BN5YRQUb.js +0 -104
  92. package/dist/mandatoryConsent-DssKMC3v.js +0 -100
  93. package/dist/modal-NMxsQHAO.js +0 -135
  94. package/dist/modal.hooks-CAjcIFZK.js +0 -126
  95. package/dist/numberedStep-CT-alrK5.js +0 -11
  96. package/dist/optionAccessibleLabel-CzEeX3Q4.js +0 -140
  97. package/dist/otpInput-DqRA_egd.js +0 -145
  98. package/dist/page-C1yT4DLb.js +0 -69
  99. package/dist/passport-horizontal-hint-Bgquwtac.js +0 -293
  100. package/dist/passport-tutorial-DwRwtPVX.js +0 -11689
  101. package/dist/passport-vertical-hint-BT1D5BrW.js +0 -267
  102. package/dist/pdf-BurGZ08w.js +0 -14967
  103. package/dist/pdfViewer-BGBNL1Ea.js +0 -63
  104. package/dist/phone/phone.es.js +0 -98
  105. package/dist/phone/styles.css +0 -11
  106. package/dist/phoneInputComposed-bvWhGLFZ.js +0 -11206
  107. package/dist/processing-G_y3o32b.js +0 -6
  108. package/dist/qe-signature/qe-signature.es.js +0 -15
  109. package/dist/radioGroupComposed-BbmvxmD2.js +0 -177
  110. package/dist/redirect-to-mobile/styles.css +0 -588
  111. package/dist/redirectToMobile-C3k1gloW.js +0 -1514
  112. package/dist/requiredLabelHint-BLwgqozE.js +0 -13
  113. package/dist/richText-DbJ5sl2n.js +0 -1973
  114. package/dist/rolldown-runtime-CYMK-g2i.js +0 -20
  115. package/dist/selfie/selfie.es.js +0 -43
  116. package/dist/selfie/styles.css +0 -706
  117. package/dist/selfieTutorial-BgrlUMXP.js +0 -2677
  118. package/dist/signature/signature.es.js +0 -546
  119. package/dist/snackbar-BDp8x7Cv.js +0 -14
  120. package/dist/spinner-B4dcie2T.js +0 -1
  121. package/dist/spinner-CKnjVHxw.js +0 -39
  122. package/dist/statusPage-CUI7ApcU.js +0 -28
  123. package/dist/successIcon-DbILeIz_.js +0 -28
  124. package/dist/tabs-DaPyP71c.js +0 -78
  125. package/dist/themes/dark.css +0 -1347
  126. package/dist/themes/light.css +0 -1225
  127. package/dist/transitionSpinner-PIEPU2Vx.js +0 -17
  128. package/dist/tutorial-9vHAHvMK.js +0 -2587
  129. package/dist/types/ae-signature.d.ts +0 -40
  130. package/dist/types/antifraud.d.ts +0 -40
  131. package/dist/types/authentication.d.ts +0 -45
  132. package/dist/types/base.d.ts +0 -1
  133. package/dist/types/consent.d.ts +0 -41
  134. package/dist/types/cpf-ocr/styles.d.ts +0 -1
  135. package/dist/types/cross-document-data-match.d.ts +0 -34
  136. package/dist/types/curp-validation.d.ts +0 -40
  137. package/dist/types/custom-fields/styles.d.ts +0 -1
  138. package/dist/types/dark.d.ts +0 -1
  139. package/dist/types/document-capture/styles.d.ts +0 -1
  140. package/dist/types/dynamic-forms/styles.d.ts +0 -1
  141. package/dist/types/ekyb.d.ts +0 -34
  142. package/dist/types/ekyc.d.ts +0 -34
  143. package/dist/types/electronic-signature.d.ts +0 -43
  144. package/dist/types/email.d.ts +0 -67
  145. package/dist/types/extensibility.d.ts +0 -981
  146. package/dist/types/face-match.d.ts +0 -59
  147. package/dist/types/flow.d.ts +0 -137
  148. package/dist/types/geolocation.d.ts +0 -41
  149. package/dist/types/governmentValidation.d.ts +0 -34
  150. package/dist/types/id-ocr/styles.d.ts +0 -1
  151. package/dist/types/id-verification.d.ts +0 -40
  152. package/dist/types/id.d.ts +0 -41
  153. package/dist/types/identity-reuse.d.ts +0 -43
  154. package/dist/types/index.d.ts +0 -32
  155. package/dist/types/light.d.ts +0 -1
  156. package/dist/types/mandatory-consent/styles.d.ts +0 -1
  157. package/dist/types/phone.d.ts +0 -68
  158. package/dist/types/qe-signature.d.ts +0 -40
  159. package/dist/types/redirect-to-mobile/styles.d.ts +0 -1
  160. package/dist/types/selfie.d.ts +0 -41
  161. package/dist/types/signature.d.ts +0 -40
  162. package/dist/types/styles.d.ts +0 -1
  163. package/dist/types/themes/dark.d.ts +0 -1
  164. package/dist/types/themes/light.d.ts +0 -1
  165. package/dist/types/watchlist-for-business/styles.d.ts +0 -1
  166. package/dist/types/watchlist.d.ts +0 -40
  167. package/dist/types/workflow.d.ts +0 -91
  168. package/dist/typography-CxjaknHN.js +0 -28
  169. package/dist/uiConfig-CwpQ-IM6.js +0 -20
  170. package/dist/useModuleLoader-BFiVA41N.js +0 -432
  171. package/dist/vendor-preact-D6SntenC.js +0 -958
  172. package/dist/verificationResult-BrVbUJ4U.js +0 -97
  173. package/dist/verifiedByIncode-ChZBpqNy.js +0 -101
  174. package/dist/watchlist/watchlist.es.js +0 -33
  175. package/dist/watchlist-for-business/styles.css +0 -18
  176. package/dist/watchlistForBusiness-BcSNtHCV.js +0 -77
  177. package/dist/workflow/styles.css +0 -4612
  178. package/dist/workflow/workflow.es.js +0 -244
@@ -1,40 +0,0 @@
1
- import { FC } from 'preact/compat';
2
- import { WatchlistConfig } from '@incodetech/core/watchlist';
3
-
4
- declare type IncodeModuleProps<TConfig, TResult = void, TManager = unknown> = {
5
- /**
6
- * Module configuration required to render the flow.
7
- * For Web Components, this is typically assigned via `element.config = ...`.
8
- */
9
- config?: TConfig;
10
- /**
11
- * Optional pre-built manager. When provided, the module does not create or manage the manager lifecycle.
12
- */
13
- manager?: TManager;
14
- /**
15
- * Callback invoked when the module completes successfully.
16
- * @param result - Optional result data from the module completion
17
- */
18
- onFinish?: (result?: TResult) => void;
19
- /**
20
- * Callback invoked when a fatal module error occurs.
21
- *
22
- * @param error - Human-readable error message.
23
- * @param errorCode - Optional numeric code (e.g. HTTP status). Populated by
24
- * the workflow and flow modules on QR validation failures —
25
- * `4026` (`expiredUUID`), `4081` (`invalidQRuuid`) or `4083` (`onboardingUrlAlreadyUsed`).
26
- */
27
- onError?: (error: string | undefined, errorCode?: number) => void;
28
- };
29
-
30
- export declare const Watchlist: FC<WatchlistProps>;
31
-
32
- declare type WatchlistProps = IncodeModuleProps<WatchlistConfig>;
33
-
34
- export { }
35
-
36
- declare global {
37
- interface HTMLElementTagNameMap {
38
- 'incode-watchlist': HTMLElement & IncodeModuleProps<WatchlistConfig>;
39
- }
40
- }
@@ -1,91 +0,0 @@
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
- }
@@ -1,28 +0,0 @@
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 };
@@ -1,20 +0,0 @@
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 };
@@ -1,432 +0,0 @@
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 };