@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,661 +0,0 @@
1
- import { n as e } from "../i18n-9s4OSqwi.js";
2
- import { _ as t, c as n, d as r, l as i, o as a, p as o, v as s } from "../vendor-preact-D6SntenC.js";
3
- import { t as c } from "../uiConfig-CwpQ-IM6.js";
4
- import { o as l } from "../hooks-BVnGysT7.js";
5
- import { t as u } from "../incodeComponent-C1o4M0ZK.js";
6
- import { t as d } from "../transitionSpinner-PIEPU2Vx.js";
7
- import { t as f } from "../incodeModule-BqCjVgEI.js";
8
- import { a as p, c as m, d as h, f as g, h as _, l as v, n as y, o as b, p as x, r as S, s as C, t as w, u as T } from "../useModuleLoader-BFiVA41N.js";
9
- import { getDeviceClass as E } from "@incodetech/core/device";
10
- import { getRequiredWasmPipelines as D } from "@incodetech/core/flow";
11
- import { QrValidationError as O, bootstrapSession as k, refreshQrUrlUuid as A } from "@incodetech/core/session";
12
- //#region src/shared/processing/useDelayedFlag.ts
13
- function j(e, n) {
14
- let [r, i] = o(!1);
15
- return t(() => {
16
- if (e === !1) {
17
- i(!1);
18
- return;
19
- }
20
- let t = window.setTimeout(() => {
21
- i(!0);
22
- }, n);
23
- return () => {
24
- window.clearTimeout(t);
25
- };
26
- }, [e, n]), r;
27
- }
28
- //#endregion
29
- //#region src/modules/flow/createFlowSession.ts
30
- function M(e) {
31
- return Array.from(new Uint8Array(e), (e) => e.toString(16).padStart(2, "0")).join("");
32
- }
33
- async function N(e) {
34
- let t = globalThis.crypto?.subtle;
35
- if (!t) throw Error("SHA-1 is not available in this environment");
36
- return M(await t.digest("SHA-1", new TextEncoder().encode(e)));
37
- }
38
- async function P(e) {
39
- if (typeof e.apiKey == "string") return e.apiKey;
40
- if (typeof e.clientId == "string") return N(e.clientId);
41
- throw Error("Flow self-loading mode requires apiKey or clientId");
42
- }
43
- async function F(e, t) {
44
- return k(await P(e), {
45
- configurationId: e.configurationId,
46
- externalId: e.externalId,
47
- externalCustomerId: e.externalCustomerId,
48
- language: e.lang,
49
- customFields: e.customFields,
50
- uuid: e.uuid,
51
- urlUuid: e.urlUuid,
52
- interviewId: e.interviewId,
53
- onUrlUuidRefreshed: e.onUrlUuidRefreshed
54
- }, t);
55
- }
56
- //#endregion
57
- //#region src/modules/flow/flowConfig.ts
58
- function I(e) {
59
- return typeof e.token == "string";
60
- }
61
- function L(e) {
62
- let t = e;
63
- return typeof t.configurationId == "string" && (typeof t.apiKey == "string" || typeof t.clientId == "string");
64
- }
65
- //#endregion
66
- //#region src/modules/flow/preloadFlow.ts
67
- var R = /* @__PURE__ */ new Map();
68
- function z(e) {
69
- let t = R.get(e);
70
- if (!t) throw Error("Preload state not found");
71
- return {
72
- get isReady() {
73
- return t.status === "ready";
74
- },
75
- get error() {
76
- return t.status === "error" ? t.error ?? null : null;
77
- },
78
- async waitUntilReady() {
79
- if (t.status !== "ready") {
80
- if (t.status === "error") throw Error(t.error ?? "Preload failed");
81
- return t.readyPromise;
82
- }
83
- },
84
- cancel() {
85
- t.status === "loading" && (t.unsubscribe && t.unsubscribe(), t.flowManager.stop(), t.readyReject(/* @__PURE__ */ Error("Preload cancelled")), R.delete(e));
86
- }
87
- };
88
- }
89
- function B(e) {
90
- let { token: t } = e;
91
- if (e.urlUuid) throw Error("preloadIncodeFlow does not support urlUuid; pass it to <IncodeFlow> directly so the SDK can rotate it on mount.");
92
- if (R.has(t)) return z(t);
93
- let n, r, i = new Promise((e, t) => {
94
- n = e, r = t;
95
- }), a = m(e);
96
- a.getState().presentation.shouldPrefetchHome && g();
97
- let o = {
98
- status: "loading",
99
- flowManager: a,
100
- config: e,
101
- readyPromise: i,
102
- readyResolve: n,
103
- readyReject: r
104
- };
105
- return R.set(t, o), (async () => {
106
- try {
107
- await T({
108
- token: e.token,
109
- lang: e.lang,
110
- flowManager: a
111
- });
112
- let t = e.disableDashboardTheme ? Promise.resolve({}) : v().then((e) => {
113
- o.theme = e.theme, o.uiConfig = e.uiConfig;
114
- });
115
- o.unsubscribe = a.subscribe((t) => {
116
- if (t.status === "ready") {
117
- let n = t;
118
- _(n, e.wasmConfig), h(n), o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "ready", o.readyResolve();
119
- } else t.status === "error" && (o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "error", o.error = t.error, o.readyReject(Error(t.error)));
120
- }), await t;
121
- } catch (e) {
122
- o.status = "error", o.error = e instanceof Error ? e.message : "Failed to preload", o.readyReject(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to preload")), R.delete(t);
123
- }
124
- })(), z(t);
125
- }
126
- function V(e) {
127
- return R.get(e) ?? null;
128
- }
129
- function H(e) {
130
- let t = V(e);
131
- return t && R.delete(e), t;
132
- }
133
- //#endregion
134
- //#region src/modules/flow/useFlowInitialization.ts
135
- function U(e) {
136
- e.getState().presentation.shouldPrefetchHome && g();
137
- }
138
- function W() {
139
- E() === "desktop" && x();
140
- }
141
- function G(e) {
142
- let { lang: n, disableDashboardTheme: r, enableHome: a, onError: s, useCPF: l } = e, u = I(e) ? e.token : void 0, d = i(null), [f, p] = o(() => {
143
- let t = u ? V(u) : null;
144
- if (u && t?.status === "ready") {
145
- let e = H(u);
146
- if (e) return d.current = e.flowManager, U(e.flowManager), W(), e.uiConfig && c(e.uiConfig), {
147
- status: "ready",
148
- flowManager: e.flowManager
149
- };
150
- }
151
- let n = m({
152
- authHint: e.authHint,
153
- lang: e.lang,
154
- enableHome: e.enableHome,
155
- useCPF: e.useCPF
156
- });
157
- return d.current = n, U(n), W(), t?.status === "error" ? {
158
- status: "error",
159
- error: t.error ?? "Preload failed",
160
- flowManager: n
161
- } : {
162
- status: "initializing",
163
- flowManager: n
164
- };
165
- }), h = i(!1);
166
- return t(() => {
167
- if (f.status !== "initializing") return;
168
- let t = u ? V(u) : null;
169
- if (u && t?.status === "loading") {
170
- t.readyPromise.then(() => {
171
- let e = H(u);
172
- e && (d.current = e.flowManager, U(e.flowManager), W(), e.uiConfig && c(e.uiConfig), p({
173
- status: "ready",
174
- flowManager: e.flowManager
175
- }));
176
- }).catch((e) => {
177
- let t = e instanceof Error ? e.message : "Preload failed", n = e instanceof O ? e.status : void 0;
178
- p({
179
- status: "error",
180
- error: t,
181
- errorCode: n,
182
- flowManager: f.flowManager
183
- }), s?.(t, n);
184
- });
185
- return;
186
- }
187
- if (h.current) return;
188
- h.current = !0;
189
- let i = new AbortController(), { signal: a } = i;
190
- return (async () => {
191
- try {
192
- let t;
193
- if (I(e)) t = e.token, e.urlUuid && await A({
194
- urlUuid: e.urlUuid,
195
- onboardingId: null,
196
- onRefreshed: e.onUrlUuidRefreshed
197
- }, a);
198
- else if (L(e)) t = (await F(e, a)).token;
199
- else throw Error("Flow requires token, or configurationId with apiKey or clientId");
200
- await T({
201
- token: t,
202
- lang: n,
203
- flowManager: f.flowManager
204
- });
205
- let i = r ? Promise.resolve() : v().then((e) => {
206
- e.uiConfig && c(e.uiConfig);
207
- }), o = f.flowManager.waitForReady();
208
- await Promise.all([o, i]), p({
209
- status: "ready",
210
- flowManager: f.flowManager
211
- });
212
- } catch (e) {
213
- if (a.aborted) return;
214
- let t = e instanceof Error ? e.message : "Failed to initialize SDK", n = e instanceof O ? e.status : void 0;
215
- p({
216
- status: "error",
217
- error: t,
218
- errorCode: n,
219
- flowManager: f.flowManager
220
- }), s?.(t, n);
221
- }
222
- })(), () => i.abort();
223
- }, [
224
- u,
225
- n,
226
- r,
227
- a,
228
- l,
229
- s,
230
- e,
231
- f
232
- ]), f;
233
- }
234
- //#endregion
235
- //#region src/modules/flow/flow.tsx
236
- var K = n(() => import("../homeScreen-DnP1jw9A.js").then((e) => ({ default: e.HomeScreen }))), q = ({ config: n, onFinish: i, onError: o }) => {
237
- let { i18n: c } = e(), u = G(r(() => ({
238
- ...n,
239
- onError: o
240
- }), [n, o])), [f, m] = l(() => u.flowManager, { autoLoad: !1 }), h = f.presentation.lazyModuleKey, v = f.status === "ready" ? f.currentStep : void 0, x = w({
241
- moduleKey: h,
242
- modules: C,
243
- onModuleLoading: n.onModuleLoading,
244
- onModuleLoaded: n.onModuleLoaded,
245
- onError: o
246
- });
247
- y({
248
- moduleKey: f.status === "ready" && f.homeScreen.visible ? v : void 0,
249
- modules: C
250
- });
251
- let T = x.status === "loaded", E = n.enableHome === !0 && f.status === "ready" && f.flow.disableLaunchScreen !== !0 && f.currentStepIndex === 0 && f.homeScreen.visible === !1 && x.status === "loading", O = j(f.presentation.isAwaitingReady === !0, 150), k = j(f.status === "ready" && (x.status === "idle" || x.status === "loading" || x.status === "error"), 150);
252
- S(f?.status === "ready" ? f.steps : [], f?.status === "ready" ? f.currentStepIndex : -1, C, T), t(() => {
253
- if (n.onFlowEvent) return m.subscribeFlowEvent(n.onFlowEvent);
254
- }, [m, n.onFlowEvent]), t(() => {
255
- f.presentation.shouldPrefetchHome && g();
256
- }, [f.presentation.shouldPrefetchHome]), t(() => {
257
- n.lang && c.language !== n.lang && c.changeLanguage(n.lang);
258
- }, [n.lang, c]), t(() => {
259
- if (f?.status !== "ready" || f.currentStep === "REDIRECT_TO_MOBILE") return;
260
- let e = f, t = D(e.flow);
261
- t.length > 0 && (n.onWasmWarmup?.(t), _(e, n.wasmConfig));
262
- }, [f, n]), t(() => {
263
- f?.status === "finished" && i(f.finishStatus);
264
- }, [
265
- f?.status,
266
- i,
267
- f
268
- ]), t(() => {
269
- f?.status === "error" && o && o(f.error, f.errorCode);
270
- }, [
271
- f?.status,
272
- o,
273
- f
274
- ]), t(() => {
275
- f?.status === "ready" && f.currentStep === "ID" && f.steps.includes("TUTORIAL_ID") && m.completeModule();
276
- }, [f, m]);
277
- let A = !(n.spinnerConfig?.title || n.spinnerConfig?.subtitle);
278
- if (u.status === "error") return /* @__PURE__ */ s("div", {
279
- class: "IncodeFlow",
280
- children: /* @__PURE__ */ s("div", { children: ["Error: ", u.error] })
281
- });
282
- if (f.homeScreen.visible || E) return /* @__PURE__ */ s("div", {
283
- class: "IncodeFlow",
284
- children: /* @__PURE__ */ s(a, {
285
- fallback: null,
286
- children: /* @__PURE__ */ s(K, {
287
- isContinueLoading: f.homeScreen.isContinueLoading || E,
288
- onContinue: () => m.continueFromHome()
289
- })
290
- })
291
- });
292
- if (u.status === "initializing") return /* @__PURE__ */ s("div", {
293
- class: "IncodeFlow",
294
- children: /* @__PURE__ */ s(d, {
295
- spinnerConfig: n.spinnerConfig,
296
- hideText: A
297
- })
298
- });
299
- if (f.presentation.isAwaitingReady) return O ? /* @__PURE__ */ s("div", {
300
- class: "IncodeFlow",
301
- children: /* @__PURE__ */ s(d, {
302
- spinnerConfig: n.spinnerConfig,
303
- hideText: A
304
- })
305
- }) : /* @__PURE__ */ s("div", { class: "IncodeFlow" });
306
- if (f.status === "error") return /* @__PURE__ */ s("div", {
307
- class: "IncodeFlow",
308
- children: /* @__PURE__ */ s("div", { children: ["Error: ", f.error] })
309
- });
310
- if (f.status === "finished") return null;
311
- if (f?.status === "ready") {
312
- let { currentStep: e, config: t, flow: r } = f, { flowId: i } = r;
313
- if (!e || !t) return /* @__PURE__ */ s("div", {
314
- class: "IncodeFlow",
315
- children: /* @__PURE__ */ s(d, {
316
- spinnerConfig: n.spinnerConfig,
317
- hideText: A
318
- })
319
- });
320
- if (b.has(e)) return /* @__PURE__ */ s("div", { class: "IncodeFlow" });
321
- if (x.status === "unsupported") return /* @__PURE__ */ s("div", {
322
- class: "IncodeFlow",
323
- children: /* @__PURE__ */ s(p, {
324
- moduleKey: e,
325
- onNext: () => m.completeModule()
326
- })
327
- });
328
- if (x.status === "idle" || x.status === "loading" || x.status === "error") return k ? /* @__PURE__ */ s("div", {
329
- class: "IncodeFlow",
330
- children: /* @__PURE__ */ s(d, {
331
- spinnerConfig: n.spinnerConfig,
332
- hideText: A
333
- })
334
- }) : /* @__PURE__ */ s("div", { class: "IncodeFlow" });
335
- let { Component: a } = x;
336
- if (e === "REDIRECT_TO_MOBILE") return /* @__PURE__ */ s("div", {
337
- class: "IncodeFlow",
338
- children: /* @__PURE__ */ s(a, {
339
- config: t,
340
- onFinish: () => m.completeFlow(),
341
- onContinue: () => m.completeModule(),
342
- onError: o
343
- }, `redirect-to-mobile-${f.currentStepIndex}`)
344
- });
345
- if (e === "SELFIE") return /* @__PURE__ */ s("div", {
346
- class: "IncodeFlow",
347
- children: /* @__PURE__ */ s(a, {
348
- config: t,
349
- onFinish: () => m.completeModule(),
350
- onError: (e) => {
351
- o?.(e ?? "Selfie verification error");
352
- }
353
- }, `selfie-${f.currentStepIndex}`)
354
- });
355
- if (e === "AUTHENTICATION") return /* @__PURE__ */ s("div", {
356
- class: "IncodeFlow",
357
- children: /* @__PURE__ */ s(a, {
358
- config: {
359
- ...t,
360
- authHint: n.authHint
361
- },
362
- onFinish: () => m.completeModule(),
363
- onError: (e) => {
364
- o?.(e ?? "Authentication error");
365
- }
366
- }, `authentication-${f.currentStepIndex}`)
367
- });
368
- if (e === "PHONE") return /* @__PURE__ */ s("div", {
369
- class: "IncodeFlow",
370
- children: /* @__PURE__ */ s(a, {
371
- config: t,
372
- onFinish: () => m.completeModule(),
373
- onError: (e) => {
374
- o?.(e ?? "Phone verification error");
375
- }
376
- }, `phone-${f.currentStepIndex}`)
377
- });
378
- if (e === "EMAIL") {
379
- let e = t;
380
- return !e || typeof e.otpVerification != "boolean" || typeof e.otpExpirationInMinutes != "number" ? /* @__PURE__ */ s("div", {
381
- class: "IncodeFlow",
382
- children: /* @__PURE__ */ s("div", { children: "Error: Invalid email configuration" })
383
- }) : /* @__PURE__ */ s("div", {
384
- class: "IncodeFlow",
385
- children: /* @__PURE__ */ s(a, {
386
- config: e,
387
- onFinish: () => m.completeModule(),
388
- onError: (e) => {
389
- o?.(e ?? "Email verification error");
390
- }
391
- }, `email-${f.currentStepIndex}`)
392
- });
393
- }
394
- if (e === "ID" || e === "SECOND_ID") {
395
- let n = t;
396
- return /* @__PURE__ */ s("div", {
397
- class: "IncodeFlow",
398
- children: /* @__PURE__ */ s(a, {
399
- config: e === "SECOND_ID" ? {
400
- ...n,
401
- isSecondId: !0
402
- } : n,
403
- onFinish: () => m.completeModule(),
404
- onError: (e) => {
405
- o?.(e ?? "ID capture error");
406
- }
407
- }, `id-${f.currentStepIndex}`)
408
- });
409
- }
410
- if (e === "ID_OCR") {
411
- let e = t, n = f.steps.includes("SECOND_ID");
412
- return /* @__PURE__ */ s("div", {
413
- class: "IncodeFlow",
414
- children: /* @__PURE__ */ s(a, {
415
- config: {
416
- ...e,
417
- secondId: e.secondId ?? n,
418
- flowId: i
419
- },
420
- onFinish: () => m.completeModule(),
421
- onError: (e) => {
422
- o?.(e ?? "ID OCR error");
423
- }
424
- }, `id-ocr-${f.currentStepIndex}`)
425
- });
426
- }
427
- if (e === "CPF_OCR") return /* @__PURE__ */ s("div", {
428
- class: "IncodeFlow",
429
- children: /* @__PURE__ */ s(a, {
430
- onFinish: () => m.completeModule(),
431
- onError: (e) => {
432
- o?.(e ?? "CPF OCR error");
433
- }
434
- }, `cpf-ocr-${f.currentStepIndex}`)
435
- });
436
- if (e === "FACE_MATCH") return /* @__PURE__ */ s("div", {
437
- class: "IncodeFlow",
438
- children: /* @__PURE__ */ s(a, {
439
- config: t,
440
- onFinish: () => m.completeModule(),
441
- onError: (e) => {
442
- o?.(e ?? "Face match error");
443
- }
444
- }, `face-match-${f.currentStepIndex}`)
445
- });
446
- if (e === "CURP_VALIDATION") return /* @__PURE__ */ s("div", {
447
- class: "IncodeFlow",
448
- children: /* @__PURE__ */ s(a, {
449
- config: t,
450
- onFinish: () => m.completeModule(),
451
- onError: (e) => {
452
- o?.(e ?? "CURP validation error");
453
- }
454
- }, `curp-validation-${f.currentStepIndex}`)
455
- });
456
- if (e === "GOVT_VALIDATION_PROVISIONING") return /* @__PURE__ */ s("div", {
457
- class: "IncodeFlow",
458
- children: /* @__PURE__ */ s(a, {
459
- config: t,
460
- onFinish: () => m.completeModule(),
461
- onError: (e) => {
462
- o?.(e ?? "Government validation error");
463
- }
464
- }, `govt-validation-${f.currentStepIndex}`)
465
- });
466
- if (e === "GEOLOCATION") return /* @__PURE__ */ s("div", {
467
- class: "IncodeFlow",
468
- children: /* @__PURE__ */ s(a, {
469
- config: t,
470
- onFinish: () => m.completeModule(),
471
- onError: (e) => {
472
- o?.(e ?? "Geolocation error");
473
- }
474
- }, `geolocation-${f.currentStepIndex}`)
475
- });
476
- if (e === "EXTERNAL_VERIFICATION") return /* @__PURE__ */ s("div", {
477
- class: "IncodeFlow",
478
- children: /* @__PURE__ */ s(a, {
479
- config: { flowId: f.flow.flowId },
480
- onFinish: () => m.completeModule(),
481
- onError: (e) => {
482
- o?.(e ?? "External verification error");
483
- }
484
- }, `ekyc-${f.currentStepIndex}`)
485
- });
486
- if (e === "DOCUMENT_CAPTURE") return /* @__PURE__ */ s("div", {
487
- class: "IncodeFlow",
488
- children: /* @__PURE__ */ s(a, {
489
- config: t,
490
- onFinish: () => m.completeModule(),
491
- onError: (e) => {
492
- o?.(e ?? "Document capture error");
493
- }
494
- }, `document-capture-${f.currentStepIndex}`)
495
- });
496
- if (e === "ADDRESS") return /* @__PURE__ */ s("div", {
497
- class: "IncodeFlow",
498
- children: /* @__PURE__ */ s(a, {
499
- config: {
500
- ...t,
501
- processingType: "addressStatement"
502
- },
503
- onFinish: () => m.completeModule(),
504
- onError: (e) => {
505
- o?.(e ?? "Address capture error");
506
- }
507
- }, `address-${f.currentStepIndex}`)
508
- });
509
- if (e === "SIGNATURE") return /* @__PURE__ */ s("div", {
510
- class: "IncodeFlow",
511
- children: /* @__PURE__ */ s(a, {
512
- config: t,
513
- onFinish: () => m.completeModule(),
514
- onError: (e) => {
515
- o?.(e ?? "Signature capture error");
516
- }
517
- }, `signature-${f.currentStepIndex}`)
518
- });
519
- if (e === "EKYB") {
520
- let e = t;
521
- return /* @__PURE__ */ s("div", {
522
- class: "IncodeFlow",
523
- children: /* @__PURE__ */ s(a, {
524
- config: {
525
- flowId: i,
526
- checkBusinessName: e.checkBusinessName,
527
- checkAddress: e.checkAddress,
528
- checkTaxId: e.checkTaxId,
529
- checkUniqueBeneficialOwner: e.checkUniqueBeneficialOwner
530
- },
531
- onFinish: () => m.completeModule(),
532
- onError: (e) => {
533
- o?.(e ?? "eKYB verification error");
534
- }
535
- }, `ekyb-${f.currentStepIndex}`)
536
- });
537
- }
538
- if (e === "COMBINED_CONSENT") return /* @__PURE__ */ s("div", {
539
- class: "IncodeFlow",
540
- children: /* @__PURE__ */ s(a, {
541
- config: t,
542
- onFinish: () => m.completeModule(),
543
- onError: (e) => {
544
- o?.(e ?? "Combined consent error");
545
- }
546
- }, `combined-consent-${f.currentStepIndex}`)
547
- });
548
- if (e === "MANDATORY_CONSENT") return /* @__PURE__ */ s("div", {
549
- class: "IncodeFlow",
550
- children: /* @__PURE__ */ s(a, {
551
- config: t,
552
- onFinish: () => m.completeModule(),
553
- onError: (e) => {
554
- o?.(e ?? "Mandatory consent error");
555
- }
556
- }, `mandatory-consent-${f.currentStepIndex}`)
557
- });
558
- if (e === "AE_SIGNATURE" || e === "QE_SIGNATURE") {
559
- let n = t, r = e === "QE_SIGNATURE" ? "qe" : "ae";
560
- return /* @__PURE__ */ s("div", {
561
- class: "IncodeFlow",
562
- children: /* @__PURE__ */ s(a, {
563
- config: {
564
- uploadDocument: n.uploadDocument,
565
- downloadDocument: n.downloadDocument
566
- },
567
- onFinish: () => m.completeModule(),
568
- onError: (e) => {
569
- o?.(e ?? `${r.toUpperCase()} Signature error`);
570
- }
571
- }, `${r}-signature-${f.currentStepIndex}`)
572
- });
573
- }
574
- if (e === "ANTIFRAUD") return /* @__PURE__ */ s("div", {
575
- class: "IncodeFlow",
576
- children: /* @__PURE__ */ s(a, {
577
- onFinish: () => m.completeModule(),
578
- onError: (e) => {
579
- o?.(e ?? "Antifraud check error");
580
- }
581
- }, `antifraud-${f.currentStepIndex}`)
582
- });
583
- if (e === "CUSTOM_FIELDS") return /* @__PURE__ */ s("div", {
584
- class: "IncodeFlow",
585
- children: /* @__PURE__ */ s(a, {
586
- config: t,
587
- onFinish: () => m.completeModule(),
588
- onError: (e) => {
589
- o?.(e ?? "Custom fields error");
590
- }
591
- }, `custom-fields-${f.currentStepIndex}`)
592
- });
593
- if (e === "WATCHLIST") return /* @__PURE__ */ s("div", {
594
- class: "IncodeFlow",
595
- children: /* @__PURE__ */ s(a, {
596
- onFinish: () => m.completeModule(),
597
- onError: (e) => {
598
- o?.(e ?? "Watchlist check error");
599
- }
600
- }, `watchlist-${f.currentStepIndex}`)
601
- });
602
- if (e === "WATCHLIST_BUSINESS") return /* @__PURE__ */ s("div", {
603
- class: "IncodeFlow",
604
- children: /* @__PURE__ */ s(a, {
605
- onFinish: () => m.completeModule(),
606
- onError: (e) => {
607
- o?.(e ?? "Watchlist for business check error");
608
- }
609
- }, `watchlist-for-business-${f.currentStepIndex}`)
610
- });
611
- if (e === "INCODE_WATCHLIST") return /* @__PURE__ */ s("div", {
612
- class: "IncodeFlow",
613
- children: /* @__PURE__ */ s(a, {
614
- config: t,
615
- onFinish: () => m.completeModule(),
616
- onError: (e) => {
617
- o?.(e ?? "Custom watchlist check error");
618
- }
619
- }, `incode-watchlist-${f.currentStepIndex}`)
620
- });
621
- if (e === "CROSS_DOCUMENT_DATA_MATCH") return /* @__PURE__ */ s("div", {
622
- class: "IncodeFlow",
623
- children: /* @__PURE__ */ s(a, {
624
- onFinish: () => m.completeModule(),
625
- onError: (e) => {
626
- o?.(e ?? "Cross document data match error");
627
- }
628
- }, `cross-document-data-match-${f.currentStepIndex}`)
629
- });
630
- if (e === "DYNAMIC_FORMS") return /* @__PURE__ */ s("div", {
631
- class: "IncodeFlow",
632
- children: /* @__PURE__ */ s(a, {
633
- config: { screens: t.screens.map((e) => ({
634
- title: e.title,
635
- hideTitle: e.hideTitle,
636
- questions: e.questions.map((e) => ({
637
- questionId: e.questionId,
638
- question: e.question,
639
- inputType: e.inputType,
640
- isOptional: e.isOptional,
641
- overrides: e.overrides ?? void 0,
642
- isPredefined: e.isPredefined,
643
- options: e.options
644
- }))
645
- })) },
646
- onFinish: () => m.completeModule(),
647
- onError: (e) => {
648
- o?.(e ?? "Dynamic forms error");
649
- }
650
- }, `dynamic-forms-${f.currentStepIndex}`)
651
- });
652
- }
653
- return null;
654
- }, J = ({ config: e, onFinish: t = () => {}, onError: n }) => /* @__PURE__ */ s(u, { children: e ? /* @__PURE__ */ s(q, {
655
- config: e,
656
- onFinish: t,
657
- onError: n
658
- }) : null });
659
- f(J, "incode-flow");
660
- //#endregion
661
- export { J as IncodeFlow, B as preloadIncodeFlow };