@incodetech/web 0.0.0-dev-20260224-e49e03c → 0.0.0-dev-20260226-4cb58f5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Trans-CkYswaqC.js → Trans-Bdg0o_Cr.js} +3 -3
- package/dist/authentication/authentication.es.js +5 -5
- package/dist/base.css +62 -0
- package/dist/{baseTutorial-BdLJBzYE.js → baseTutorial-BgA1dpRi.js} +5 -5
- package/dist/{chevronDown-CU4P7j2Z.js → chevronDown-C5Kn1woB.js} +1 -1
- package/dist/curp-validation/curp-validation.es.js +8 -8
- package/dist/documentUpload-h5GfSa2m.js +102 -0
- package/dist/email/email.es.js +4 -4
- package/dist/{errorIcon-DjGwgLyL.js → errorIcon-BT7Rf4z7.js} +1 -1
- package/dist/{faceMatch-iEplxPox.js → faceMatch-DL5ICOMJ.js} +4 -4
- package/dist/flow/flow.es.js +213 -200
- package/dist/flow/styles.css +79 -0
- package/dist/geolocation/geolocation.es.js +5 -5
- package/dist/governmentValidation/governmentValidation.es.js +8 -8
- package/dist/id/id.es.js +7 -7
- package/dist/{incodeComponent-3T8Qyjnt.js → incodeComponent-BUltqUSz.js} +3 -3
- package/dist/{incodeModule-DPTWfWvu.js → incodeModule-BwGymwZT.js} +1 -1
- package/dist/index.es.js +2 -2
- package/dist/{otpInput-BZD0CPE9.js → otpInput-B7TR21xE.js} +2 -2
- package/dist/phone/phone.es.js +5 -5
- package/dist/{processing-Dnu3slQ9.js → processing-B7fzlPZl.js} +3 -3
- package/dist/selfie/selfie.es.js +6 -6
- package/dist/{setup-BhetRn4n.js → setup-CFo1IZlN.js} +2 -2
- package/dist/{spinner-C-EwvA9l.js → spinner-BiENeSCl.js} +2 -2
- package/dist/{successIcon-DV200b2L.js → successIcon-CTA9p_2h.js} +1 -1
- package/dist/{tutorial-DAI0vAip.js → tutorial-DGo0fw3f.js} +7 -7
- package/dist/types/index.d.ts +1 -11
- package/dist/{uiConfig-DEqynrWx.js → uiConfig-BG6lJ_HG.js} +1 -1
- package/dist/{useTranslation-CD9ZxEvP.js → useTranslation-Cm51-Wm-.js} +1 -1
- package/dist/{vendor-preact-CjD4WiuC.js → vendor-preact-CM6KQyKc.js} +73 -67
- package/package.json +3 -3
package/dist/flow/flow.es.js
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import { u as l, B as
|
|
2
|
-
import { createOrchestratedFlowManager as V, getRequiredWasmPipelines as
|
|
3
|
-
import { A as y, d as
|
|
4
|
-
import { api as
|
|
1
|
+
import { u as l, B as $, r as _, a as H } from "../incodeModule-BwGymwZT.js";
|
|
2
|
+
import { createOrchestratedFlowManager as V, getRequiredWasmPipelines as O } from "@incodetech/core/flow";
|
|
3
|
+
import { A as y, d as U, y as g } from "../vendor-preact-CM6KQyKc.js";
|
|
4
|
+
import { api as L, warmupWasm as z } from "@incodetech/core";
|
|
5
5
|
import "../instance-B-q0ZREN.js";
|
|
6
|
-
import { u as G } from "../useTranslation-
|
|
7
|
-
import { S as C } from "../spinner-
|
|
6
|
+
import { u as G } from "../useTranslation-Cm51-Wm-.js";
|
|
7
|
+
import { S as C } from "../spinner-BiENeSCl.js";
|
|
8
8
|
import { emailMachine as k } from "@incodetech/core/email";
|
|
9
9
|
import { faceMatchMachine as W } from "@incodetech/core/face-match";
|
|
10
10
|
import { geolocationMachine as j } from "@incodetech/core/geolocation";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { s as
|
|
19
|
-
|
|
11
|
+
import { documentUploadMachine as B } from "@incodetech/core/document-upload";
|
|
12
|
+
import { idCaptureMachine as v } from "@incodetech/core/id";
|
|
13
|
+
import { phoneMachine as K } from "@incodetech/core/phone";
|
|
14
|
+
import { selfieMachine as q } from "@incodetech/core/selfie";
|
|
15
|
+
import { authenticationMachine as Y } from "@incodetech/core/authentication";
|
|
16
|
+
import { curpValidationMachine as Z } from "@incodetech/core/curp-validation";
|
|
17
|
+
import { governmentValidationMachine as J } from "@incodetech/core/government-validation";
|
|
18
|
+
import { s as Q } from "../setup-CFo1IZlN.js";
|
|
19
|
+
import { s as b } from "../uiConfig-BG6lJ_HG.js";
|
|
20
|
+
function X(e) {
|
|
20
21
|
let t = e.replace("#", "");
|
|
21
22
|
t.length === 3 && (t = t.split("").map((s) => s + s).join(""));
|
|
22
|
-
const
|
|
23
|
-
if (!
|
|
24
|
-
const a = Number.parseInt(
|
|
25
|
-
let i = 0,
|
|
26
|
-
const d = (
|
|
27
|
-
if (
|
|
28
|
-
const s =
|
|
29
|
-
switch (
|
|
23
|
+
const o = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
|
|
24
|
+
if (!o) return null;
|
|
25
|
+
const a = Number.parseInt(o[1], 16) / 255, u = Number.parseInt(o[2], 16) / 255, n = Number.parseInt(o[3], 16) / 255, r = Math.max(a, u, n), p = Math.min(a, u, n);
|
|
26
|
+
let i = 0, f = 0;
|
|
27
|
+
const d = (r + p) / 2;
|
|
28
|
+
if (r !== p) {
|
|
29
|
+
const s = r - p;
|
|
30
|
+
switch (f = d > 0.5 ? s / (2 - r - p) : s / (r + p), r) {
|
|
30
31
|
case a:
|
|
31
32
|
i = ((u - n) / s + (u < n ? 6 : 0)) / 6;
|
|
32
33
|
break;
|
|
@@ -38,25 +39,25 @@ function Q(e) {
|
|
|
38
39
|
break;
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
|
-
return { h: i * 360, s:
|
|
42
|
+
return { h: i * 360, s: f * 100, l: d * 100 };
|
|
42
43
|
}
|
|
43
|
-
function w(e, t,
|
|
44
|
-
const a = e / 360, u = t / 100, n =
|
|
45
|
-
let
|
|
44
|
+
function w(e, t, o) {
|
|
45
|
+
const a = e / 360, u = t / 100, n = o / 100;
|
|
46
|
+
let r, p, i;
|
|
46
47
|
if (u === 0)
|
|
47
|
-
|
|
48
|
+
r = p = i = n;
|
|
48
49
|
else {
|
|
49
|
-
const d = (
|
|
50
|
-
|
|
50
|
+
const d = (h, M, m) => (m < 0 && (m += 1), m > 1 && (m -= 1), m < 0.16666666666666666 ? h + (M - h) * 6 * m : m < 0.5 ? M : m < 0.6666666666666666 ? h + (M - h) * (0.6666666666666666 - m) * 6 : h), s = n < 0.5 ? n * (1 + u) : n + u - n * u, c = 2 * n - s;
|
|
51
|
+
r = d(c, s, a + 1 / 3), p = d(c, s, a), i = d(c, s, a - 1 / 3);
|
|
51
52
|
}
|
|
52
|
-
const
|
|
53
|
+
const f = (d) => {
|
|
53
54
|
const s = Math.round(d * 255).toString(16);
|
|
54
55
|
return s.length === 1 ? `0${s}` : s;
|
|
55
56
|
};
|
|
56
|
-
return `#${
|
|
57
|
+
return `#${f(r)}${f(p)}${f(i)}`;
|
|
57
58
|
}
|
|
58
|
-
function
|
|
59
|
-
const t =
|
|
59
|
+
function ee(e) {
|
|
60
|
+
const t = X(e);
|
|
60
61
|
if (!t)
|
|
61
62
|
throw new Error(`Invalid color format: ${e}`);
|
|
62
63
|
return {
|
|
@@ -69,10 +70,10 @@ function X(e) {
|
|
|
69
70
|
900: w(t.h, t.s, 20)
|
|
70
71
|
};
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
+
function te(e, t) {
|
|
73
74
|
if (typeof document > "u")
|
|
74
75
|
return;
|
|
75
|
-
const
|
|
76
|
+
const o = ee(e);
|
|
76
77
|
let a = document.getElementById(
|
|
77
78
|
"incode-theme"
|
|
78
79
|
);
|
|
@@ -80,57 +81,57 @@ function ee(e, t) {
|
|
|
80
81
|
const u = t || "#ffffff", n = `
|
|
81
82
|
:root,
|
|
82
83
|
:host {
|
|
83
|
-
--primitive-color-brand-50: ${
|
|
84
|
-
--primitive-color-brand-200: ${
|
|
85
|
-
--primitive-color-brand-300: ${
|
|
86
|
-
--primitive-color-brand-400: ${
|
|
87
|
-
--primitive-color-brand-500: ${
|
|
88
|
-
--primitive-color-brand-600: ${
|
|
89
|
-
--primitive-color-brand-900: ${
|
|
84
|
+
--primitive-color-brand-50: ${o[50]};
|
|
85
|
+
--primitive-color-brand-200: ${o[200]};
|
|
86
|
+
--primitive-color-brand-300: ${o[300]};
|
|
87
|
+
--primitive-color-brand-400: ${o[400]};
|
|
88
|
+
--primitive-color-brand-500: ${o[500]};
|
|
89
|
+
--primitive-color-brand-600: ${o[600]};
|
|
90
|
+
--primitive-color-brand-900: ${o[900]};
|
|
90
91
|
--button-primary-text-default: ${u};
|
|
91
92
|
}
|
|
92
93
|
`;
|
|
93
94
|
a.textContent = n;
|
|
94
95
|
}
|
|
95
|
-
async function
|
|
96
|
-
return (await
|
|
96
|
+
async function ne() {
|
|
97
|
+
return (await L.get("/omni/asset/fetch-all")).data;
|
|
97
98
|
}
|
|
98
99
|
const A = /* @__PURE__ */ new Map();
|
|
99
|
-
async function
|
|
100
|
+
async function oe(e) {
|
|
100
101
|
if (e.startsWith("data:"))
|
|
101
102
|
return e;
|
|
102
103
|
const t = A.get(e);
|
|
103
104
|
if (t)
|
|
104
105
|
return t;
|
|
105
|
-
const a = await (await fetch(e)).blob(), u = await new Promise((n,
|
|
106
|
-
const
|
|
107
|
-
|
|
106
|
+
const a = await (await fetch(e)).blob(), u = await new Promise((n, r) => {
|
|
107
|
+
const p = new FileReader();
|
|
108
|
+
p.onloadend = () => n(p.result), p.onerror = r, p.readAsDataURL(a);
|
|
108
109
|
});
|
|
109
110
|
return A.set(e, u), u;
|
|
110
111
|
}
|
|
111
112
|
async function re() {
|
|
112
|
-
const e = await
|
|
113
|
+
const e = await ne();
|
|
113
114
|
if (!e.theme)
|
|
114
115
|
throw new Error("Theme URL not found in assets response");
|
|
115
|
-
const t = e.theme,
|
|
116
|
+
const t = e.theme, o = t.startsWith("http://") || t.startsWith("https://");
|
|
116
117
|
let a;
|
|
117
|
-
if (
|
|
118
|
-
const
|
|
119
|
-
if (!
|
|
120
|
-
throw new Error(`Failed to fetch theme: ${
|
|
121
|
-
a = await
|
|
118
|
+
if (o) {
|
|
119
|
+
const r = await fetch(t);
|
|
120
|
+
if (!r.ok)
|
|
121
|
+
throw new Error(`Failed to fetch theme: ${r.statusText}`);
|
|
122
|
+
a = await r.json();
|
|
122
123
|
} else
|
|
123
|
-
a = (await
|
|
124
|
+
a = (await L.get(t)).data;
|
|
124
125
|
const u = e["logo.png"] || e["logo.svg"] || e["logo.jpg"] || e["logo.jpeg"] || e["logo.webp"] || a.logo;
|
|
125
126
|
let n = u;
|
|
126
|
-
return u && (n = await
|
|
127
|
+
return u && (n = await oe(u)), {
|
|
127
128
|
...a,
|
|
128
129
|
logo: n
|
|
129
130
|
};
|
|
130
131
|
}
|
|
131
|
-
async function
|
|
132
|
+
async function ie() {
|
|
132
133
|
const e = await re();
|
|
133
|
-
return e.main &&
|
|
134
|
+
return e.main && te(e.main, e.buttonColor), e;
|
|
134
135
|
}
|
|
135
136
|
const T = () => import("../id/id.es.js").then((e) => e.Id), S = {
|
|
136
137
|
PHONE: () => import("../phone/phone.es.js").then((e) => e.Phone),
|
|
@@ -140,34 +141,34 @@ const T = () => import("../id/id.es.js").then((e) => e.Id), S = {
|
|
|
140
141
|
ID: T,
|
|
141
142
|
TUTORIAL_ID: T,
|
|
142
143
|
SECOND_ID: T,
|
|
143
|
-
THIRD_ID:
|
|
144
|
-
FACE_MATCH: () => import("../faceMatch-
|
|
144
|
+
THIRD_ID: () => import("../documentUpload-h5GfSa2m.js").then((e) => e.DocumentUpload),
|
|
145
|
+
FACE_MATCH: () => import("../faceMatch-DL5ICOMJ.js").then((e) => e.FaceMatch),
|
|
145
146
|
CURP_VALIDATION: () => import("../curp-validation/curp-validation.es.js").then((e) => e.CurpValidation),
|
|
146
147
|
GOVT_VALIDATION_PROVISIONING: () => import("../governmentValidation/governmentValidation.es.js").then(
|
|
147
148
|
(e) => e.GovernmentValidation
|
|
148
149
|
),
|
|
149
150
|
GEOLOCATION: () => import("../geolocation/geolocation.es.js").then((e) => e.Geolocation)
|
|
150
151
|
};
|
|
151
|
-
function
|
|
152
|
+
function R() {
|
|
152
153
|
return V({
|
|
153
154
|
modules: {
|
|
154
|
-
PHONE:
|
|
155
|
+
PHONE: K,
|
|
155
156
|
EMAIL: k,
|
|
156
|
-
SELFIE:
|
|
157
|
-
AUTHENTICATION:
|
|
158
|
-
ID:
|
|
159
|
-
TUTORIAL_ID:
|
|
160
|
-
SECOND_ID:
|
|
161
|
-
THIRD_ID:
|
|
157
|
+
SELFIE: q,
|
|
158
|
+
AUTHENTICATION: Y,
|
|
159
|
+
ID: v,
|
|
160
|
+
TUTORIAL_ID: v,
|
|
161
|
+
SECOND_ID: v,
|
|
162
|
+
THIRD_ID: B,
|
|
162
163
|
FACE_MATCH: W,
|
|
163
|
-
CURP_VALIDATION:
|
|
164
|
-
GOVT_VALIDATION_PROVISIONING:
|
|
164
|
+
CURP_VALIDATION: Z,
|
|
165
|
+
GOVT_VALIDATION_PROVISIONING: J,
|
|
165
166
|
GEOLOCATION: j
|
|
166
167
|
}
|
|
167
168
|
});
|
|
168
169
|
}
|
|
169
170
|
async function N(e) {
|
|
170
|
-
await
|
|
171
|
+
await Q({
|
|
171
172
|
apiURL: e.apiURL,
|
|
172
173
|
token: e.token,
|
|
173
174
|
i18n: { lang: e.lang ?? "en" }
|
|
@@ -175,33 +176,33 @@ async function N(e) {
|
|
|
175
176
|
}
|
|
176
177
|
async function P() {
|
|
177
178
|
try {
|
|
178
|
-
const e = await
|
|
179
|
+
const e = await ie(), t = {
|
|
179
180
|
logoSrc: e.logo,
|
|
180
181
|
hideFooterBranding: e.hideFooterBranding
|
|
181
182
|
};
|
|
182
|
-
return
|
|
183
|
+
return b(t), { theme: e, uiConfig: t };
|
|
183
184
|
} catch {
|
|
184
185
|
return {};
|
|
185
186
|
}
|
|
186
187
|
}
|
|
187
188
|
function x(e, t) {
|
|
188
|
-
const
|
|
189
|
-
|
|
189
|
+
const o = O(e.flow);
|
|
190
|
+
o.length > 0 && z({
|
|
190
191
|
...t,
|
|
191
|
-
pipelines:
|
|
192
|
+
pipelines: o
|
|
192
193
|
}).catch((a) => {
|
|
193
194
|
console.error("WASM warmup failed:", a);
|
|
194
195
|
});
|
|
195
196
|
}
|
|
196
|
-
function
|
|
197
|
+
function ae(e) {
|
|
197
198
|
const t = e.currentStep;
|
|
198
199
|
if (t) {
|
|
199
|
-
const
|
|
200
|
-
|
|
200
|
+
const o = S[t];
|
|
201
|
+
o && o().catch(() => {
|
|
201
202
|
});
|
|
202
203
|
}
|
|
203
204
|
}
|
|
204
|
-
const
|
|
205
|
+
const se = ({
|
|
205
206
|
moduleKey: e,
|
|
206
207
|
onNext: t
|
|
207
208
|
}) => /* @__PURE__ */ l("section", { class: "IncodeUnsupportedModule", "aria-live": "polite", children: /* @__PURE__ */ l("div", { class: "IncodeUnsupportedModuleContent", children: [
|
|
@@ -212,7 +213,7 @@ const ae = ({
|
|
|
212
213
|
'" module is not yet supported in this version.'
|
|
213
214
|
] }),
|
|
214
215
|
/* @__PURE__ */ l(
|
|
215
|
-
|
|
216
|
+
$,
|
|
216
217
|
{
|
|
217
218
|
onClick: t,
|
|
218
219
|
class: "IncodeUnsupportedModuleButton",
|
|
@@ -244,22 +245,22 @@ function E(e) {
|
|
|
244
245
|
}
|
|
245
246
|
};
|
|
246
247
|
}
|
|
247
|
-
function
|
|
248
|
+
function Le(e) {
|
|
248
249
|
const { token: t } = e;
|
|
249
250
|
if (I.has(t))
|
|
250
251
|
return E(t);
|
|
251
|
-
let
|
|
252
|
-
const u = new Promise((i,
|
|
253
|
-
|
|
254
|
-
}), n =
|
|
252
|
+
let o, a;
|
|
253
|
+
const u = new Promise((i, f) => {
|
|
254
|
+
o = i, a = f;
|
|
255
|
+
}), n = R(), r = {
|
|
255
256
|
status: "loading",
|
|
256
257
|
flowManager: n,
|
|
257
258
|
config: e,
|
|
258
259
|
readyPromise: u,
|
|
259
|
-
readyResolve:
|
|
260
|
+
readyResolve: o,
|
|
260
261
|
readyReject: a
|
|
261
262
|
};
|
|
262
|
-
return I.set(t,
|
|
263
|
+
return I.set(t, r), (async () => {
|
|
263
264
|
try {
|
|
264
265
|
await N({
|
|
265
266
|
apiURL: e.apiURL,
|
|
@@ -267,16 +268,16 @@ function De(e) {
|
|
|
267
268
|
lang: e.lang
|
|
268
269
|
});
|
|
269
270
|
const i = e.disableDashboardTheme ? Promise.resolve({}) : P().then((d) => {
|
|
270
|
-
|
|
271
|
-
}),
|
|
271
|
+
r.theme = d.theme, r.uiConfig = d.uiConfig;
|
|
272
|
+
}), f = n.subscribe((d) => {
|
|
272
273
|
if (d.status === "ready") {
|
|
273
274
|
const s = d;
|
|
274
|
-
e.wasmConfig && x(s, e.wasmConfig),
|
|
275
|
-
} else d.status === "error" && (
|
|
275
|
+
e.wasmConfig && x(s, e.wasmConfig), ae(s), r.unsubscribe?.(), r.unsubscribe = void 0, r.status = "ready", r.readyResolve();
|
|
276
|
+
} else d.status === "error" && (r.unsubscribe?.(), r.unsubscribe = void 0, r.status = "error", r.error = d.error, r.readyReject(new Error(d.error)));
|
|
276
277
|
});
|
|
277
|
-
|
|
278
|
+
r.unsubscribe = f, n.load(), await i;
|
|
278
279
|
} catch (i) {
|
|
279
|
-
|
|
280
|
+
r.status = "error", r.error = i instanceof Error ? i.message : "Failed to preload", r.readyReject(
|
|
280
281
|
i instanceof Error ? i : new Error("Failed to preload")
|
|
281
282
|
), I.delete(t);
|
|
282
283
|
}
|
|
@@ -285,138 +286,138 @@ function De(e) {
|
|
|
285
286
|
function F(e) {
|
|
286
287
|
return I.get(e) ?? null;
|
|
287
288
|
}
|
|
288
|
-
function
|
|
289
|
+
function D(e) {
|
|
289
290
|
const t = F(e);
|
|
290
291
|
return t && I.delete(e), t;
|
|
291
292
|
}
|
|
292
|
-
function
|
|
293
|
-
const { apiURL: t, token:
|
|
294
|
-
const d = F(
|
|
293
|
+
function le(e) {
|
|
294
|
+
const { apiURL: t, token: o, lang: a, disableDashboardTheme: u, onError: n } = e, r = y(null), [p, i] = U(() => {
|
|
295
|
+
const d = F(o);
|
|
295
296
|
if (d?.status === "ready") {
|
|
296
|
-
const c =
|
|
297
|
+
const c = D(o);
|
|
297
298
|
if (c)
|
|
298
|
-
return
|
|
299
|
+
return r.current = c.flowManager, c.uiConfig && b(c.uiConfig), { status: "ready", flowManager: c.flowManager };
|
|
299
300
|
}
|
|
300
|
-
const s =
|
|
301
|
-
return
|
|
301
|
+
const s = R();
|
|
302
|
+
return r.current = s, d?.status === "error" ? {
|
|
302
303
|
status: "error",
|
|
303
304
|
error: d.error ?? "Preload failed",
|
|
304
305
|
flowManager: s
|
|
305
306
|
} : { status: "initializing", flowManager: s };
|
|
306
|
-
}),
|
|
307
|
+
}), f = y(!1);
|
|
307
308
|
return g(() => {
|
|
308
|
-
if (
|
|
309
|
+
if (p.status !== "initializing")
|
|
309
310
|
return;
|
|
310
|
-
const d = F(
|
|
311
|
+
const d = F(o);
|
|
311
312
|
if (d?.status === "loading") {
|
|
312
313
|
d.readyPromise.then(() => {
|
|
313
|
-
const c =
|
|
314
|
-
c && (
|
|
314
|
+
const c = D(o);
|
|
315
|
+
c && (r.current = c.flowManager, c.uiConfig && b(c.uiConfig), i({ status: "ready", flowManager: c.flowManager }));
|
|
315
316
|
}).catch((c) => {
|
|
316
|
-
const
|
|
317
|
+
const h = c instanceof Error ? c.message : "Preload failed";
|
|
317
318
|
i({
|
|
318
319
|
status: "error",
|
|
319
|
-
error:
|
|
320
|
-
flowManager:
|
|
321
|
-
}), n?.(
|
|
320
|
+
error: h,
|
|
321
|
+
flowManager: p.flowManager
|
|
322
|
+
}), n?.(h);
|
|
322
323
|
});
|
|
323
324
|
return;
|
|
324
325
|
}
|
|
325
|
-
if (
|
|
326
|
+
if (f.current)
|
|
326
327
|
return;
|
|
327
|
-
|
|
328
|
+
f.current = !0, (async () => {
|
|
328
329
|
try {
|
|
329
|
-
await N({ apiURL: t, token:
|
|
330
|
-
const c = u ? Promise.resolve() : P().then((
|
|
331
|
-
|
|
330
|
+
await N({ apiURL: t, token: o, lang: a });
|
|
331
|
+
const c = u ? Promise.resolve() : P().then((h) => {
|
|
332
|
+
h.uiConfig && b(h.uiConfig);
|
|
332
333
|
});
|
|
333
|
-
|
|
334
|
+
p.flowManager.load(), await c, i({ status: "ready", flowManager: p.flowManager });
|
|
334
335
|
} catch (c) {
|
|
335
|
-
const
|
|
336
|
+
const h = c instanceof Error ? c.message : "Failed to initialize SDK";
|
|
336
337
|
i({
|
|
337
338
|
status: "error",
|
|
338
|
-
error:
|
|
339
|
-
flowManager:
|
|
340
|
-
}), n?.(
|
|
339
|
+
error: h,
|
|
340
|
+
flowManager: p.flowManager
|
|
341
|
+
}), n?.(h);
|
|
341
342
|
}
|
|
342
343
|
})();
|
|
343
|
-
}, [t,
|
|
344
|
+
}, [t, o, a, u, n, p]), p;
|
|
344
345
|
}
|
|
345
|
-
function
|
|
346
|
-
const { moduleKey: t, onModuleLoading:
|
|
346
|
+
function ce(e) {
|
|
347
|
+
const { moduleKey: t, onModuleLoading: o, onModuleLoaded: a, onError: u } = e, [n, r] = U({ status: "idle" });
|
|
347
348
|
return g(() => {
|
|
348
349
|
if (!t) {
|
|
349
|
-
|
|
350
|
+
r({ status: "idle" });
|
|
350
351
|
return;
|
|
351
352
|
}
|
|
352
|
-
const
|
|
353
|
-
if (!
|
|
354
|
-
|
|
353
|
+
const p = S[t];
|
|
354
|
+
if (!p) {
|
|
355
|
+
r({ status: "unsupported", moduleKey: t });
|
|
355
356
|
return;
|
|
356
357
|
}
|
|
357
|
-
|
|
358
|
+
r({ status: "loading", moduleKey: t }), o?.(t);
|
|
358
359
|
let i = !1;
|
|
359
|
-
return
|
|
360
|
-
i || (
|
|
361
|
-
}).catch((
|
|
360
|
+
return p().then((f) => {
|
|
361
|
+
i || (r({ status: "loaded", moduleKey: t, Component: f }), a?.(t));
|
|
362
|
+
}).catch((f) => {
|
|
362
363
|
if (!i) {
|
|
363
|
-
const d =
|
|
364
|
-
|
|
364
|
+
const d = f instanceof Error ? f.message : "Failed to load module";
|
|
365
|
+
r({ status: "error", moduleKey: t, error: d }), u?.(`Failed to load ${t}: ${d}`);
|
|
365
366
|
}
|
|
366
367
|
}), () => {
|
|
367
368
|
i = !0;
|
|
368
369
|
};
|
|
369
|
-
}, [t,
|
|
370
|
+
}, [t, o, a, u]), n;
|
|
370
371
|
}
|
|
371
|
-
function
|
|
372
|
-
const
|
|
372
|
+
function de(e, t) {
|
|
373
|
+
const o = y(/* @__PURE__ */ new Set());
|
|
373
374
|
g(() => {
|
|
374
375
|
if (t < e.length - 1) {
|
|
375
376
|
const a = e[t + 1];
|
|
376
|
-
if (a && !
|
|
377
|
-
|
|
377
|
+
if (a && !o.current.has(a)) {
|
|
378
|
+
o.current.add(a);
|
|
378
379
|
const u = S[a];
|
|
379
380
|
u && u().catch(() => {
|
|
380
|
-
|
|
381
|
+
o.current.delete(a);
|
|
381
382
|
});
|
|
382
383
|
}
|
|
383
384
|
}
|
|
384
385
|
}, [e, t]);
|
|
385
386
|
}
|
|
386
|
-
const
|
|
387
|
+
const ue = ({
|
|
387
388
|
config: e,
|
|
388
389
|
onFinish: t,
|
|
389
|
-
onError:
|
|
390
|
+
onError: o
|
|
390
391
|
}) => {
|
|
391
|
-
const { t: a } = G(), u =
|
|
392
|
+
const { t: a } = G(), u = le({
|
|
392
393
|
apiURL: e.apiURL,
|
|
393
394
|
token: e.token,
|
|
394
395
|
lang: e.lang,
|
|
395
396
|
disableDashboardTheme: e.disableDashboardTheme,
|
|
396
|
-
onError:
|
|
397
|
-
}), [n,
|
|
397
|
+
onError: o
|
|
398
|
+
}), [n, r] = H(() => u.flowManager, {
|
|
398
399
|
autoLoad: !1
|
|
399
|
-
}),
|
|
400
|
+
}), p = ce({
|
|
400
401
|
moduleKey: n?.status === "ready" ? n.currentStep : void 0,
|
|
401
402
|
onModuleLoading: e.onModuleLoading,
|
|
402
403
|
onModuleLoaded: e.onModuleLoaded,
|
|
403
|
-
onError:
|
|
404
|
+
onError: o
|
|
404
405
|
});
|
|
405
|
-
if (
|
|
406
|
+
if (de(
|
|
406
407
|
n?.status === "ready" ? n.steps : [],
|
|
407
408
|
n?.status === "ready" ? n.currentStepIndex : -1
|
|
408
409
|
), g(() => {
|
|
409
410
|
if (n?.status === "ready" && e.wasmConfig) {
|
|
410
|
-
const i = n,
|
|
411
|
-
|
|
411
|
+
const i = n, f = O(i.flow);
|
|
412
|
+
f.length > 0 && (e.onWasmWarmup?.(f), x(i, e.wasmConfig));
|
|
412
413
|
}
|
|
413
414
|
}, [n, e]), g(() => {
|
|
414
415
|
n?.status === "finished" && t(n.finishStatus);
|
|
415
416
|
}, [n?.status, t, n]), g(() => {
|
|
416
|
-
n?.status === "error" &&
|
|
417
|
-
}, [n?.status,
|
|
418
|
-
n?.status === "ready" && n.currentStep === "ID" && n.steps.includes("TUTORIAL_ID") &&
|
|
419
|
-
}, [n,
|
|
417
|
+
n?.status === "error" && o && o(n.error);
|
|
418
|
+
}, [n?.status, o, n]), g(() => {
|
|
419
|
+
n?.status === "ready" && n.currentStep === "ID" && n.steps.includes("TUTORIAL_ID") && r.completeModule();
|
|
420
|
+
}, [n, r]), u.status === "error")
|
|
420
421
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l("div", { children: [
|
|
421
422
|
"Error: ",
|
|
422
423
|
u.error
|
|
@@ -449,8 +450,8 @@ const de = ({
|
|
|
449
450
|
if (n.status === "finished")
|
|
450
451
|
return null;
|
|
451
452
|
if (n.status === "ready") {
|
|
452
|
-
const { currentStep: i, config:
|
|
453
|
-
if (!i || !
|
|
453
|
+
const { currentStep: i, config: f } = n;
|
|
454
|
+
if (!i || !f)
|
|
454
455
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
455
456
|
C,
|
|
456
457
|
{
|
|
@@ -460,15 +461,15 @@ const de = ({
|
|
|
460
461
|
fullScreen: !0
|
|
461
462
|
}
|
|
462
463
|
) });
|
|
463
|
-
if (
|
|
464
|
+
if (p.status === "unsupported")
|
|
464
465
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
465
|
-
|
|
466
|
+
se,
|
|
466
467
|
{
|
|
467
468
|
moduleKey: i,
|
|
468
|
-
onNext: () =>
|
|
469
|
+
onNext: () => r.completeModule()
|
|
469
470
|
}
|
|
470
471
|
) });
|
|
471
|
-
if (
|
|
472
|
+
if (p.status === "idle" || p.status === "loading" || p.status === "error")
|
|
472
473
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
473
474
|
C,
|
|
474
475
|
{
|
|
@@ -478,15 +479,15 @@ const de = ({
|
|
|
478
479
|
fullScreen: !0
|
|
479
480
|
}
|
|
480
481
|
) });
|
|
481
|
-
const { Component: d } =
|
|
482
|
+
const { Component: d } = p;
|
|
482
483
|
if (i === "SELFIE")
|
|
483
484
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
484
485
|
d,
|
|
485
486
|
{
|
|
486
|
-
config:
|
|
487
|
-
onFinish: () =>
|
|
487
|
+
config: f,
|
|
488
|
+
onFinish: () => r.completeModule(),
|
|
488
489
|
onError: (c) => {
|
|
489
|
-
|
|
490
|
+
o?.(c ?? "Selfie verification error");
|
|
490
491
|
}
|
|
491
492
|
},
|
|
492
493
|
`selfie-${n.currentStepIndex}`
|
|
@@ -495,10 +496,10 @@ const de = ({
|
|
|
495
496
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
496
497
|
d,
|
|
497
498
|
{
|
|
498
|
-
config: { ...
|
|
499
|
-
onFinish: () =>
|
|
499
|
+
config: { ...f, authHint: e.authHint },
|
|
500
|
+
onFinish: () => r.completeModule(),
|
|
500
501
|
onError: (c) => {
|
|
501
|
-
|
|
502
|
+
o?.(c ?? "Authentication error");
|
|
502
503
|
}
|
|
503
504
|
},
|
|
504
505
|
`authentication-${n.currentStepIndex}`
|
|
@@ -507,16 +508,16 @@ const de = ({
|
|
|
507
508
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
508
509
|
d,
|
|
509
510
|
{
|
|
510
|
-
config:
|
|
511
|
-
onFinish: () =>
|
|
511
|
+
config: f,
|
|
512
|
+
onFinish: () => r.completeModule(),
|
|
512
513
|
onError: (c) => {
|
|
513
|
-
|
|
514
|
+
o?.(c ?? "Phone verification error");
|
|
514
515
|
}
|
|
515
516
|
},
|
|
516
517
|
`phone-${n.currentStepIndex}`
|
|
517
518
|
) });
|
|
518
519
|
if (i === "EMAIL") {
|
|
519
|
-
const s =
|
|
520
|
+
const s = f;
|
|
520
521
|
return !s || typeof s.otpVerification != "boolean" || typeof s.otpExpirationInMinutes != "number" ? /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l("div", { children: "Error: Invalid email configuration" }) }) : /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
521
522
|
d,
|
|
522
523
|
{
|
|
@@ -524,31 +525,43 @@ const de = ({
|
|
|
524
525
|
...s,
|
|
525
526
|
prefill: s.prefill ?? !1
|
|
526
527
|
},
|
|
527
|
-
onFinish: () =>
|
|
528
|
+
onFinish: () => r.completeModule(),
|
|
528
529
|
onError: (c) => {
|
|
529
|
-
|
|
530
|
+
o?.(c ?? "Email verification error");
|
|
530
531
|
}
|
|
531
532
|
},
|
|
532
533
|
`email-${n.currentStepIndex}`
|
|
533
534
|
) });
|
|
534
535
|
}
|
|
535
|
-
if (i === "
|
|
536
|
+
if (i === "THIRD_ID")
|
|
537
|
+
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
538
|
+
d,
|
|
539
|
+
{
|
|
540
|
+
config: f,
|
|
541
|
+
onFinish: () => r.completeModule(),
|
|
542
|
+
onError: (c) => {
|
|
543
|
+
o?.(c ?? "Document upload error");
|
|
544
|
+
}
|
|
545
|
+
},
|
|
546
|
+
`document-upload-${n.currentStepIndex}`
|
|
547
|
+
) });
|
|
548
|
+
if (i === "TUTORIAL_ID" || i === "SECOND_ID" || // Only render ID if TUTORIAL_ID doesn't exist (otherwise useEffect will skip it)
|
|
536
549
|
i === "ID" && !n.steps.includes("TUTORIAL_ID")) {
|
|
537
|
-
const s =
|
|
550
|
+
const s = f, h = i === "SECOND_ID" ? { ...s, isSecondId: !0 } : s;
|
|
538
551
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
539
552
|
d,
|
|
540
553
|
{
|
|
541
|
-
config:
|
|
542
|
-
onFinish: () =>
|
|
554
|
+
config: h,
|
|
555
|
+
onFinish: () => r.completeModule(),
|
|
543
556
|
onError: (M) => {
|
|
544
|
-
|
|
557
|
+
o?.(M ?? "ID capture error");
|
|
545
558
|
}
|
|
546
559
|
},
|
|
547
560
|
`id-${n.currentStepIndex}`
|
|
548
561
|
) });
|
|
549
562
|
}
|
|
550
563
|
if (i === "FACE_MATCH") {
|
|
551
|
-
const s =
|
|
564
|
+
const s = f, c = {
|
|
552
565
|
variant: s.matchingType,
|
|
553
566
|
disableFaceMatchAnimation: s.disableFaceMatchAnimation ?? !1
|
|
554
567
|
};
|
|
@@ -556,9 +569,9 @@ const de = ({
|
|
|
556
569
|
d,
|
|
557
570
|
{
|
|
558
571
|
config: c,
|
|
559
|
-
onFinish: () =>
|
|
560
|
-
onError: (
|
|
561
|
-
|
|
572
|
+
onFinish: () => r.completeModule(),
|
|
573
|
+
onError: (h) => {
|
|
574
|
+
o?.(h ?? "Face match error");
|
|
562
575
|
}
|
|
563
576
|
},
|
|
564
577
|
`face-match-${n.currentStepIndex}`
|
|
@@ -568,10 +581,10 @@ const de = ({
|
|
|
568
581
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
569
582
|
d,
|
|
570
583
|
{
|
|
571
|
-
config:
|
|
572
|
-
onFinish: () =>
|
|
584
|
+
config: f,
|
|
585
|
+
onFinish: () => r.completeModule(),
|
|
573
586
|
onError: (c) => {
|
|
574
|
-
|
|
587
|
+
o?.(c ?? "CURP validation error");
|
|
575
588
|
}
|
|
576
589
|
},
|
|
577
590
|
`curp-validation-${n.currentStepIndex}`
|
|
@@ -580,10 +593,10 @@ const de = ({
|
|
|
580
593
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
581
594
|
d,
|
|
582
595
|
{
|
|
583
|
-
config:
|
|
584
|
-
onFinish: () =>
|
|
596
|
+
config: f,
|
|
597
|
+
onFinish: () => r.completeModule(),
|
|
585
598
|
onError: (c) => {
|
|
586
|
-
|
|
599
|
+
o?.(c ?? "Government validation error");
|
|
587
600
|
}
|
|
588
601
|
},
|
|
589
602
|
`govt-validation-${n.currentStepIndex}`
|
|
@@ -592,31 +605,31 @@ const de = ({
|
|
|
592
605
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
593
606
|
d,
|
|
594
607
|
{
|
|
595
|
-
config: { allowSkip:
|
|
596
|
-
onFinish: () =>
|
|
608
|
+
config: { allowSkip: f.allowUserToSkipGeolocation },
|
|
609
|
+
onFinish: () => r.completeModule(),
|
|
597
610
|
onError: (c) => {
|
|
598
|
-
|
|
611
|
+
o?.(c ?? "Geolocation error");
|
|
599
612
|
}
|
|
600
613
|
},
|
|
601
614
|
`geolocation-${n.currentStepIndex}`
|
|
602
615
|
) });
|
|
603
616
|
}
|
|
604
617
|
return null;
|
|
605
|
-
},
|
|
618
|
+
}, fe = ({
|
|
606
619
|
config: e,
|
|
607
620
|
onFinish: t = () => {
|
|
608
621
|
},
|
|
609
|
-
onError:
|
|
622
|
+
onError: o
|
|
610
623
|
}) => /* @__PURE__ */ l("div", { class: "IncodeComponent", children: e ? /* @__PURE__ */ l(
|
|
611
|
-
|
|
624
|
+
ue,
|
|
612
625
|
{
|
|
613
626
|
config: e,
|
|
614
627
|
onFinish: t,
|
|
615
|
-
onError:
|
|
628
|
+
onError: o
|
|
616
629
|
}
|
|
617
630
|
) : null });
|
|
618
|
-
|
|
631
|
+
_(fe, "incode-flow");
|
|
619
632
|
export {
|
|
620
|
-
|
|
621
|
-
|
|
633
|
+
fe as IncodeFlow,
|
|
634
|
+
Le as preloadIncodeFlow
|
|
622
635
|
};
|