@incodetech/web 0.0.0-dev-20260218-b7223be → 0.0.0-dev-20260218-d80e4b9
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/flow/flow.es.js +127 -127
- package/package.json +2 -2
package/dist/flow/flow.es.js
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import { u as l, B as
|
|
2
|
-
import { createOrchestratedFlowManager as V, getRequiredWasmPipelines as
|
|
3
|
-
import { A as
|
|
1
|
+
import { u as l, B as _, r as $, a as H } from "../incodeModule-DPTWfWvu.js";
|
|
2
|
+
import { createOrchestratedFlowManager as V, getRequiredWasmPipelines as R } from "@incodetech/core/flow";
|
|
3
|
+
import { A as T, d as L, y as g } from "../vendor-preact-CjD4WiuC.js";
|
|
4
4
|
import { api as U, warmupWasm as z, IdCaptureProvider as k } from "@incodetech/core";
|
|
5
5
|
import "../instance-B-q0ZREN.js";
|
|
6
|
-
import { u as W, S as
|
|
6
|
+
import { u as W, S as C } from "../spinner-BERSXem_.js";
|
|
7
7
|
import { emailMachine as j } from "@incodetech/core/email";
|
|
8
8
|
import { faceMatchMachine as G } from "@incodetech/core/face-match";
|
|
9
|
-
import { idCaptureMachine as
|
|
9
|
+
import { idCaptureMachine as b } from "@incodetech/core/id";
|
|
10
10
|
import { phoneMachine as B } from "@incodetech/core/phone";
|
|
11
11
|
import { selfieMachine as K } from "@incodetech/core/selfie";
|
|
12
12
|
import { authenticationMachine as q } from "@incodetech/core/authentication";
|
|
13
13
|
import { curpValidationMachine as Y } from "@incodetech/core/curp-validation";
|
|
14
14
|
import { governmentValidationMachine as Z } from "@incodetech/core/government-validation";
|
|
15
15
|
import { s as J } from "../setup-BhetRn4n.js";
|
|
16
|
-
import { s as
|
|
16
|
+
import { s as y } from "../uiConfig-DEqynrWx.js";
|
|
17
17
|
function Q(e) {
|
|
18
18
|
let t = e.replace("#", "");
|
|
19
19
|
t.length === 3 && (t = t.split("").map((s) => s + s).join(""));
|
|
20
20
|
const n = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
|
|
21
21
|
if (!n) return null;
|
|
22
|
-
const
|
|
23
|
-
let
|
|
22
|
+
const a = Number.parseInt(n[1], 16) / 255, d = Number.parseInt(n[2], 16) / 255, r = Number.parseInt(n[3], 16) / 255, o = Math.max(a, d, r), f = Math.min(a, d, r);
|
|
23
|
+
let i = 0, h = 0;
|
|
24
24
|
const u = (o + f) / 2;
|
|
25
25
|
if (o !== f) {
|
|
26
26
|
const s = o - f;
|
|
27
27
|
switch (h = u > 0.5 ? s / (2 - o - f) : s / (o + f), o) {
|
|
28
|
-
case
|
|
29
|
-
|
|
28
|
+
case a:
|
|
29
|
+
i = ((d - r) / s + (d < r ? 6 : 0)) / 6;
|
|
30
30
|
break;
|
|
31
31
|
case d:
|
|
32
|
-
|
|
32
|
+
i = ((r - a) / s + 2) / 6;
|
|
33
33
|
break;
|
|
34
34
|
case r:
|
|
35
|
-
|
|
35
|
+
i = ((a - d) / s + 4) / 6;
|
|
36
36
|
break;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
return { h:
|
|
39
|
+
return { h: i * 360, s: h * 100, l: u * 100 };
|
|
40
40
|
}
|
|
41
41
|
function w(e, t, n) {
|
|
42
|
-
const
|
|
43
|
-
let o, f,
|
|
42
|
+
const a = e / 360, d = t / 100, r = n / 100;
|
|
43
|
+
let o, f, i;
|
|
44
44
|
if (d === 0)
|
|
45
|
-
o = f =
|
|
45
|
+
o = f = i = r;
|
|
46
46
|
else {
|
|
47
|
-
const u = (p,
|
|
48
|
-
o = u(c, s,
|
|
47
|
+
const u = (p, M, m) => (m < 0 && (m += 1), m > 1 && (m -= 1), m < 0.16666666666666666 ? p + (M - p) * 6 * m : m < 0.5 ? M : m < 0.6666666666666666 ? p + (M - p) * (0.6666666666666666 - m) * 6 : p), s = r < 0.5 ? r * (1 + d) : r + d - r * d, c = 2 * r - s;
|
|
48
|
+
o = u(c, s, a + 1 / 3), f = u(c, s, a), i = u(c, s, a - 1 / 3);
|
|
49
49
|
}
|
|
50
50
|
const h = (u) => {
|
|
51
51
|
const s = Math.round(u * 255).toString(16);
|
|
52
52
|
return s.length === 1 ? `0${s}` : s;
|
|
53
53
|
};
|
|
54
|
-
return `#${h(o)}${h(f)}${h(
|
|
54
|
+
return `#${h(o)}${h(f)}${h(i)}`;
|
|
55
55
|
}
|
|
56
56
|
function X(e) {
|
|
57
57
|
const t = Q(e);
|
|
@@ -71,10 +71,10 @@ function ee(e, t) {
|
|
|
71
71
|
if (typeof document > "u")
|
|
72
72
|
return;
|
|
73
73
|
const n = X(e);
|
|
74
|
-
let
|
|
74
|
+
let a = document.getElementById(
|
|
75
75
|
"incode-theme"
|
|
76
76
|
);
|
|
77
|
-
|
|
77
|
+
a || (a = document.createElement("style"), a.id = "incode-theme", document.head.appendChild(a));
|
|
78
78
|
const d = t || "#ffffff", r = `
|
|
79
79
|
:root,
|
|
80
80
|
:host {
|
|
@@ -88,41 +88,41 @@ function ee(e, t) {
|
|
|
88
88
|
--button-primary-text-default: ${d};
|
|
89
89
|
}
|
|
90
90
|
`;
|
|
91
|
-
|
|
91
|
+
a.textContent = r;
|
|
92
92
|
}
|
|
93
93
|
async function te() {
|
|
94
94
|
return (await U.get("/omni/asset/fetch-all")).data;
|
|
95
95
|
}
|
|
96
|
-
const
|
|
96
|
+
const A = /* @__PURE__ */ new Map();
|
|
97
97
|
async function re(e) {
|
|
98
98
|
if (e.startsWith("data:"))
|
|
99
99
|
return e;
|
|
100
|
-
const t =
|
|
100
|
+
const t = A.get(e);
|
|
101
101
|
if (t)
|
|
102
102
|
return t;
|
|
103
|
-
const
|
|
103
|
+
const a = await (await fetch(e)).blob(), d = await new Promise((r, o) => {
|
|
104
104
|
const f = new FileReader();
|
|
105
|
-
f.onloadend = () => r(f.result), f.onerror = o, f.readAsDataURL(
|
|
105
|
+
f.onloadend = () => r(f.result), f.onerror = o, f.readAsDataURL(a);
|
|
106
106
|
});
|
|
107
|
-
return
|
|
107
|
+
return A.set(e, d), d;
|
|
108
108
|
}
|
|
109
109
|
async function ne() {
|
|
110
110
|
const e = await te();
|
|
111
111
|
if (!e.theme)
|
|
112
112
|
throw new Error("Theme URL not found in assets response");
|
|
113
113
|
const t = e.theme, n = t.startsWith("http://") || t.startsWith("https://");
|
|
114
|
-
let
|
|
114
|
+
let a;
|
|
115
115
|
if (n) {
|
|
116
116
|
const o = await fetch(t);
|
|
117
117
|
if (!o.ok)
|
|
118
118
|
throw new Error(`Failed to fetch theme: ${o.statusText}`);
|
|
119
|
-
|
|
119
|
+
a = await o.json();
|
|
120
120
|
} else
|
|
121
|
-
|
|
122
|
-
const d = e["logo.png"] || e["logo.svg"] || e["logo.jpg"] || e["logo.jpeg"] || e["logo.webp"] ||
|
|
121
|
+
a = (await U.get(t)).data;
|
|
122
|
+
const d = e["logo.png"] || e["logo.svg"] || e["logo.jpg"] || e["logo.jpeg"] || e["logo.webp"] || a.logo;
|
|
123
123
|
let r = d;
|
|
124
124
|
return d && (r = await re(d)), {
|
|
125
|
-
...
|
|
125
|
+
...a,
|
|
126
126
|
logo: r
|
|
127
127
|
};
|
|
128
128
|
}
|
|
@@ -130,69 +130,69 @@ async function oe() {
|
|
|
130
130
|
const e = await ne();
|
|
131
131
|
return e.main && ee(e.main, e.buttonColor), e;
|
|
132
132
|
}
|
|
133
|
-
const
|
|
133
|
+
const v = () => import("../id/id.es.js").then((e) => e.Id), S = {
|
|
134
134
|
PHONE: () => import("../phone/phone.es.js").then((e) => e.Phone),
|
|
135
135
|
EMAIL: () => import("../email/email.es.js").then((e) => e.Email),
|
|
136
136
|
SELFIE: () => import("../selfie/selfie.es.js").then((e) => e.Selfie),
|
|
137
137
|
AUTHENTICATION: () => import("../authentication/authentication.es.js").then((e) => e.Authentication),
|
|
138
|
-
ID:
|
|
139
|
-
TUTORIAL_ID:
|
|
140
|
-
SECOND_ID:
|
|
141
|
-
THIRD_ID:
|
|
138
|
+
ID: v,
|
|
139
|
+
TUTORIAL_ID: v,
|
|
140
|
+
SECOND_ID: v,
|
|
141
|
+
THIRD_ID: v,
|
|
142
142
|
FACE_MATCH: () => import("../faceMatch-IT9RDlHh.js").then((e) => e.FaceMatch),
|
|
143
143
|
CURP_VALIDATION: () => import("../curp-validation/curp-validation.es.js").then((e) => e.CurpValidation),
|
|
144
144
|
GOVT_VALIDATION_PROVISIONING: () => import("../governmentValidation/governmentValidation.es.js").then(
|
|
145
145
|
(e) => e.GovernmentValidation
|
|
146
146
|
)
|
|
147
147
|
};
|
|
148
|
-
function
|
|
148
|
+
function O() {
|
|
149
149
|
return V({
|
|
150
150
|
modules: {
|
|
151
151
|
PHONE: B,
|
|
152
152
|
EMAIL: j,
|
|
153
153
|
SELFIE: K,
|
|
154
154
|
AUTHENTICATION: q,
|
|
155
|
-
ID:
|
|
156
|
-
TUTORIAL_ID:
|
|
157
|
-
SECOND_ID:
|
|
158
|
-
THIRD_ID:
|
|
155
|
+
ID: b,
|
|
156
|
+
TUTORIAL_ID: b,
|
|
157
|
+
SECOND_ID: b,
|
|
158
|
+
THIRD_ID: b,
|
|
159
159
|
FACE_MATCH: G,
|
|
160
160
|
CURP_VALIDATION: Y,
|
|
161
161
|
GOVT_VALIDATION_PROVISIONING: Z
|
|
162
162
|
}
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
|
-
async function
|
|
165
|
+
async function P(e) {
|
|
166
166
|
await J({
|
|
167
167
|
apiURL: e.apiURL,
|
|
168
168
|
token: e.token,
|
|
169
169
|
i18n: { lang: e.lang ?? "en" }
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
|
-
async function
|
|
172
|
+
async function N() {
|
|
173
173
|
try {
|
|
174
174
|
const e = await oe(), t = {
|
|
175
175
|
logoSrc: e.logo,
|
|
176
176
|
hideFooterBranding: e.hideFooterBranding
|
|
177
177
|
};
|
|
178
|
-
return
|
|
178
|
+
return y(t), { theme: e, uiConfig: t };
|
|
179
179
|
} catch (e) {
|
|
180
180
|
return console.warn("Failed to fetch dashboard theme:", e), {};
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
function x(e, t) {
|
|
184
|
-
const n =
|
|
184
|
+
const n = R(e.flow);
|
|
185
185
|
n.length > 0 && z({
|
|
186
186
|
...t,
|
|
187
187
|
pipelines: n
|
|
188
|
-
}).catch((
|
|
189
|
-
console.error("WASM warmup failed:",
|
|
188
|
+
}).catch((a) => {
|
|
189
|
+
console.error("WASM warmup failed:", a);
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
192
|
function ie(e) {
|
|
193
193
|
const t = e.currentStep;
|
|
194
194
|
if (t) {
|
|
195
|
-
const n =
|
|
195
|
+
const n = S[t];
|
|
196
196
|
n && n().catch(() => {
|
|
197
197
|
});
|
|
198
198
|
}
|
|
@@ -208,7 +208,7 @@ const ae = ({
|
|
|
208
208
|
'" module is not yet supported in this version.'
|
|
209
209
|
] }),
|
|
210
210
|
/* @__PURE__ */ l(
|
|
211
|
-
|
|
211
|
+
_,
|
|
212
212
|
{
|
|
213
213
|
onClick: t,
|
|
214
214
|
class: "IncodeUnsupportedModuleButton",
|
|
@@ -217,7 +217,7 @@ const ae = ({
|
|
|
217
217
|
}
|
|
218
218
|
)
|
|
219
219
|
] }) }), I = /* @__PURE__ */ new Map();
|
|
220
|
-
function
|
|
220
|
+
function E(e) {
|
|
221
221
|
const t = I.get(e);
|
|
222
222
|
if (!t)
|
|
223
223
|
throw new Error("Preload state not found");
|
|
@@ -240,29 +240,29 @@ function S(e) {
|
|
|
240
240
|
}
|
|
241
241
|
};
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function Ee(e) {
|
|
244
244
|
const { token: t } = e;
|
|
245
245
|
if (I.has(t))
|
|
246
|
-
return
|
|
247
|
-
let n,
|
|
248
|
-
const d = new Promise((
|
|
249
|
-
n =
|
|
250
|
-
}), r =
|
|
246
|
+
return E(t);
|
|
247
|
+
let n, a;
|
|
248
|
+
const d = new Promise((i, h) => {
|
|
249
|
+
n = i, a = h;
|
|
250
|
+
}), r = O(), o = {
|
|
251
251
|
status: "loading",
|
|
252
252
|
flowManager: r,
|
|
253
253
|
config: e,
|
|
254
254
|
readyPromise: d,
|
|
255
255
|
readyResolve: n,
|
|
256
|
-
readyReject:
|
|
256
|
+
readyReject: a
|
|
257
257
|
};
|
|
258
258
|
return I.set(t, o), (async () => {
|
|
259
259
|
try {
|
|
260
|
-
await
|
|
260
|
+
await P({
|
|
261
261
|
apiURL: e.apiURL,
|
|
262
262
|
token: e.token,
|
|
263
263
|
lang: e.lang
|
|
264
264
|
});
|
|
265
|
-
const
|
|
265
|
+
const i = e.disableDashboardTheme ? Promise.resolve({}) : N().then((u) => {
|
|
266
266
|
o.theme = u.theme, o.uiConfig = u.uiConfig;
|
|
267
267
|
}), h = r.subscribe((u) => {
|
|
268
268
|
if (u.status === "ready") {
|
|
@@ -270,47 +270,47 @@ function Se(e) {
|
|
|
270
270
|
e.wasmConfig && x(s, e.wasmConfig), ie(s), o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "ready", o.readyResolve();
|
|
271
271
|
} else u.status === "error" && (o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "error", o.error = u.error, o.readyReject(new Error(u.error)));
|
|
272
272
|
});
|
|
273
|
-
o.unsubscribe = h, r.load(), await
|
|
274
|
-
} catch (
|
|
275
|
-
o.status = "error", o.error =
|
|
276
|
-
|
|
273
|
+
o.unsubscribe = h, r.load(), await i;
|
|
274
|
+
} catch (i) {
|
|
275
|
+
o.status = "error", o.error = i instanceof Error ? i.message : "Failed to preload", o.readyReject(
|
|
276
|
+
i instanceof Error ? i : new Error("Failed to preload")
|
|
277
277
|
), I.delete(t);
|
|
278
278
|
}
|
|
279
|
-
})(),
|
|
279
|
+
})(), E(t);
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function F(e) {
|
|
282
282
|
return I.get(e) ?? null;
|
|
283
283
|
}
|
|
284
|
-
function
|
|
285
|
-
const t =
|
|
284
|
+
function D(e) {
|
|
285
|
+
const t = F(e);
|
|
286
286
|
return t && I.delete(e), t;
|
|
287
287
|
}
|
|
288
288
|
function se(e) {
|
|
289
|
-
const { apiURL: t, token: n, lang:
|
|
290
|
-
const u =
|
|
289
|
+
const { apiURL: t, token: n, lang: a, disableDashboardTheme: d, onError: r } = e, o = T(null), [f, i] = L(() => {
|
|
290
|
+
const u = F(n);
|
|
291
291
|
if (u?.status === "ready") {
|
|
292
|
-
const c =
|
|
292
|
+
const c = D(n);
|
|
293
293
|
if (c)
|
|
294
|
-
return o.current = c.flowManager, c.uiConfig &&
|
|
294
|
+
return o.current = c.flowManager, c.uiConfig && y(c.uiConfig), { status: "ready", flowManager: c.flowManager };
|
|
295
295
|
}
|
|
296
|
-
const s =
|
|
296
|
+
const s = O();
|
|
297
297
|
return o.current = s, u?.status === "error" ? {
|
|
298
298
|
status: "error",
|
|
299
299
|
error: u.error ?? "Preload failed",
|
|
300
300
|
flowManager: s
|
|
301
301
|
} : { status: "initializing", flowManager: s };
|
|
302
|
-
}), h =
|
|
302
|
+
}), h = T(!1);
|
|
303
303
|
return g(() => {
|
|
304
304
|
if (f.status !== "initializing")
|
|
305
305
|
return;
|
|
306
|
-
const u =
|
|
306
|
+
const u = F(n);
|
|
307
307
|
if (u?.status === "loading") {
|
|
308
308
|
u.readyPromise.then(() => {
|
|
309
|
-
const c =
|
|
310
|
-
c && (o.current = c.flowManager, c.uiConfig &&
|
|
309
|
+
const c = D(n);
|
|
310
|
+
c && (o.current = c.flowManager, c.uiConfig && y(c.uiConfig), i({ status: "ready", flowManager: c.flowManager }));
|
|
311
311
|
}).catch((c) => {
|
|
312
312
|
const p = c instanceof Error ? c.message : "Preload failed";
|
|
313
|
-
|
|
313
|
+
i({
|
|
314
314
|
status: "error",
|
|
315
315
|
error: p,
|
|
316
316
|
flowManager: f.flowManager
|
|
@@ -322,58 +322,58 @@ function se(e) {
|
|
|
322
322
|
return;
|
|
323
323
|
h.current = !0, (async () => {
|
|
324
324
|
try {
|
|
325
|
-
await
|
|
326
|
-
const c = d ? Promise.resolve() :
|
|
327
|
-
p.uiConfig &&
|
|
325
|
+
await P({ apiURL: t, token: n, lang: a });
|
|
326
|
+
const c = d ? Promise.resolve() : N().then((p) => {
|
|
327
|
+
p.uiConfig && y(p.uiConfig);
|
|
328
328
|
});
|
|
329
|
-
f.flowManager.load(), await c,
|
|
329
|
+
f.flowManager.load(), await c, i({ status: "ready", flowManager: f.flowManager });
|
|
330
330
|
} catch (c) {
|
|
331
331
|
const p = c instanceof Error ? c.message : "Failed to initialize SDK";
|
|
332
|
-
|
|
332
|
+
i({
|
|
333
333
|
status: "error",
|
|
334
334
|
error: p,
|
|
335
335
|
flowManager: f.flowManager
|
|
336
336
|
}), r?.(p);
|
|
337
337
|
}
|
|
338
338
|
})();
|
|
339
|
-
}, [t, n,
|
|
339
|
+
}, [t, n, a, d, r, f]), f;
|
|
340
340
|
}
|
|
341
341
|
function le(e) {
|
|
342
|
-
const { moduleKey: t, onModuleLoading: n, onModuleLoaded:
|
|
342
|
+
const { moduleKey: t, onModuleLoading: n, onModuleLoaded: a, onError: d } = e, [r, o] = L({ status: "idle" });
|
|
343
343
|
return g(() => {
|
|
344
344
|
if (!t) {
|
|
345
345
|
o({ status: "idle" });
|
|
346
346
|
return;
|
|
347
347
|
}
|
|
348
|
-
const f =
|
|
348
|
+
const f = S[t];
|
|
349
349
|
if (!f) {
|
|
350
350
|
o({ status: "unsupported", moduleKey: t });
|
|
351
351
|
return;
|
|
352
352
|
}
|
|
353
353
|
o({ status: "loading", moduleKey: t }), n?.(t);
|
|
354
|
-
let
|
|
354
|
+
let i = !1;
|
|
355
355
|
return f().then((h) => {
|
|
356
|
-
|
|
356
|
+
i || (o({ status: "loaded", moduleKey: t, Component: h }), a?.(t));
|
|
357
357
|
}).catch((h) => {
|
|
358
|
-
if (!
|
|
358
|
+
if (!i) {
|
|
359
359
|
const u = h instanceof Error ? h.message : "Failed to load module";
|
|
360
360
|
o({ status: "error", moduleKey: t, error: u }), d?.(`Failed to load ${t}: ${u}`);
|
|
361
361
|
}
|
|
362
362
|
}), () => {
|
|
363
|
-
|
|
363
|
+
i = !0;
|
|
364
364
|
};
|
|
365
|
-
}, [t, n,
|
|
365
|
+
}, [t, n, a, d]), r;
|
|
366
366
|
}
|
|
367
367
|
function ce(e, t) {
|
|
368
|
-
const n =
|
|
368
|
+
const n = T(/* @__PURE__ */ new Set());
|
|
369
369
|
g(() => {
|
|
370
370
|
if (t < e.length - 1) {
|
|
371
|
-
const
|
|
372
|
-
if (
|
|
373
|
-
n.current.add(
|
|
374
|
-
const d =
|
|
371
|
+
const a = e[t + 1];
|
|
372
|
+
if (a && !n.current.has(a)) {
|
|
373
|
+
n.current.add(a);
|
|
374
|
+
const d = S[a];
|
|
375
375
|
d && d().catch(() => {
|
|
376
|
-
n.current.delete(
|
|
376
|
+
n.current.delete(a);
|
|
377
377
|
});
|
|
378
378
|
}
|
|
379
379
|
}
|
|
@@ -384,7 +384,7 @@ const de = ({
|
|
|
384
384
|
onFinish: t,
|
|
385
385
|
onError: n
|
|
386
386
|
}) => {
|
|
387
|
-
const { t:
|
|
387
|
+
const { t: a } = W(), d = se({
|
|
388
388
|
apiURL: e.apiURL,
|
|
389
389
|
token: e.token,
|
|
390
390
|
lang: e.lang,
|
|
@@ -403,8 +403,8 @@ const de = ({
|
|
|
403
403
|
r?.status === "ready" ? r.currentStepIndex : -1
|
|
404
404
|
), g(() => {
|
|
405
405
|
if (r?.status === "ready" && e.wasmConfig) {
|
|
406
|
-
const
|
|
407
|
-
h.length > 0 && (e.onWasmWarmup?.(h), x(
|
|
406
|
+
const i = r, h = R(i.flow);
|
|
407
|
+
h.length > 0 && (e.onWasmWarmup?.(h), x(i, e.wasmConfig));
|
|
408
408
|
}
|
|
409
409
|
}, [r, e]), g(() => {
|
|
410
410
|
r?.status === "finished" && t(r.finishStatus);
|
|
@@ -419,7 +419,7 @@ const de = ({
|
|
|
419
419
|
] }) });
|
|
420
420
|
if (d.status === "initializing")
|
|
421
421
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
422
|
-
|
|
422
|
+
C,
|
|
423
423
|
{
|
|
424
424
|
title: e.spinnerConfig?.title,
|
|
425
425
|
subtitle: e.spinnerConfig?.subtitle,
|
|
@@ -429,7 +429,7 @@ const de = ({
|
|
|
429
429
|
) });
|
|
430
430
|
if (!r || r.status === "idle" || r.status === "loading")
|
|
431
431
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
432
|
-
|
|
432
|
+
C,
|
|
433
433
|
{
|
|
434
434
|
title: e.spinnerConfig?.title,
|
|
435
435
|
subtitle: e.spinnerConfig?.subtitle,
|
|
@@ -445,13 +445,13 @@ const de = ({
|
|
|
445
445
|
if (r.status === "finished")
|
|
446
446
|
return null;
|
|
447
447
|
if (r.status === "ready") {
|
|
448
|
-
const { currentStep:
|
|
449
|
-
if (!
|
|
448
|
+
const { currentStep: i, config: h } = r;
|
|
449
|
+
if (!i || !h)
|
|
450
450
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
451
|
-
|
|
451
|
+
C,
|
|
452
452
|
{
|
|
453
|
-
title: e.spinnerConfig?.title ??
|
|
454
|
-
subtitle: e.spinnerConfig?.subtitle ??
|
|
453
|
+
title: e.spinnerConfig?.title ?? a("loadingCircle.hangOn"),
|
|
454
|
+
subtitle: e.spinnerConfig?.subtitle ?? a("loadingCircle.validating"),
|
|
455
455
|
size: e.spinnerConfig?.size,
|
|
456
456
|
fullScreen: !0
|
|
457
457
|
}
|
|
@@ -460,22 +460,22 @@ const de = ({
|
|
|
460
460
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
461
461
|
ae,
|
|
462
462
|
{
|
|
463
|
-
moduleKey:
|
|
463
|
+
moduleKey: i,
|
|
464
464
|
onNext: () => o.completeModule()
|
|
465
465
|
}
|
|
466
466
|
) });
|
|
467
467
|
if (f.status === "idle" || f.status === "loading" || f.status === "error")
|
|
468
468
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
469
|
-
|
|
469
|
+
C,
|
|
470
470
|
{
|
|
471
|
-
title: e.spinnerConfig?.title ??
|
|
472
|
-
subtitle: e.spinnerConfig?.subtitle ??
|
|
471
|
+
title: e.spinnerConfig?.title ?? a("loadingCircle.hangOn"),
|
|
472
|
+
subtitle: e.spinnerConfig?.subtitle ?? a("loadingCircle.validating"),
|
|
473
473
|
size: e.spinnerConfig?.size,
|
|
474
474
|
fullScreen: !0
|
|
475
475
|
}
|
|
476
476
|
) });
|
|
477
477
|
const { Component: u } = f;
|
|
478
|
-
if (
|
|
478
|
+
if (i === "SELFIE")
|
|
479
479
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
480
480
|
u,
|
|
481
481
|
{
|
|
@@ -487,7 +487,7 @@ const de = ({
|
|
|
487
487
|
},
|
|
488
488
|
`selfie-${r.currentStepIndex}`
|
|
489
489
|
) });
|
|
490
|
-
if (
|
|
490
|
+
if (i === "AUTHENTICATION") {
|
|
491
491
|
const s = h;
|
|
492
492
|
return e.authHint ? /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
493
493
|
u,
|
|
@@ -501,7 +501,7 @@ const de = ({
|
|
|
501
501
|
`authentication-${r.currentStepIndex}`
|
|
502
502
|
) }) : (n?.("Authentication requires authHint to be provided"), /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l("div", { children: "Error: authHint is required for authentication" }) }));
|
|
503
503
|
}
|
|
504
|
-
if (
|
|
504
|
+
if (i === "PHONE")
|
|
505
505
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
506
506
|
u,
|
|
507
507
|
{
|
|
@@ -513,7 +513,7 @@ const de = ({
|
|
|
513
513
|
},
|
|
514
514
|
`phone-${r.currentStepIndex}`
|
|
515
515
|
) });
|
|
516
|
-
if (
|
|
516
|
+
if (i === "EMAIL") {
|
|
517
517
|
const s = h;
|
|
518
518
|
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(
|
|
519
519
|
u,
|
|
@@ -530,23 +530,23 @@ const de = ({
|
|
|
530
530
|
`email-${r.currentStepIndex}`
|
|
531
531
|
) });
|
|
532
532
|
}
|
|
533
|
-
if (
|
|
534
|
-
|
|
535
|
-
const s = h,
|
|
533
|
+
if (i === "TUTORIAL_ID" || i === "SECOND_ID" || i === "THIRD_ID" || // Only render ID if TUTORIAL_ID doesn't exist (otherwise useEffect will skip it)
|
|
534
|
+
i === "ID" && !r.steps.includes("TUTORIAL_ID")) {
|
|
535
|
+
const s = h, p = i === "SECOND_ID" || i === "THIRD_ID" ? { ...s, isSecondId: !0 } : s, M = new k();
|
|
536
536
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
537
537
|
u,
|
|
538
538
|
{
|
|
539
|
-
config:
|
|
540
|
-
provider:
|
|
539
|
+
config: p,
|
|
540
|
+
provider: M,
|
|
541
541
|
onFinish: () => o.completeModule(),
|
|
542
|
-
onError: (
|
|
543
|
-
n?.(
|
|
542
|
+
onError: (m) => {
|
|
543
|
+
n?.(m ?? "ID capture error");
|
|
544
544
|
}
|
|
545
545
|
},
|
|
546
546
|
`id-${r.currentStepIndex}`
|
|
547
547
|
) });
|
|
548
548
|
}
|
|
549
|
-
if (
|
|
549
|
+
if (i === "FACE_MATCH") {
|
|
550
550
|
const s = h, c = {
|
|
551
551
|
variant: s.matchingType,
|
|
552
552
|
disableFaceMatchAnimation: s.disableFaceMatchAnimation ?? !1
|
|
@@ -563,7 +563,7 @@ const de = ({
|
|
|
563
563
|
`face-match-${r.currentStepIndex}`
|
|
564
564
|
) });
|
|
565
565
|
}
|
|
566
|
-
if (
|
|
566
|
+
if (i === "CURP_VALIDATION")
|
|
567
567
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
568
568
|
u,
|
|
569
569
|
{
|
|
@@ -575,7 +575,7 @@ const de = ({
|
|
|
575
575
|
},
|
|
576
576
|
`curp-validation-${r.currentStepIndex}`
|
|
577
577
|
) });
|
|
578
|
-
if (
|
|
578
|
+
if (i === "GOVT_VALIDATION_PROVISIONING")
|
|
579
579
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
580
580
|
u,
|
|
581
581
|
{
|
|
@@ -602,8 +602,8 @@ const de = ({
|
|
|
602
602
|
onError: n
|
|
603
603
|
}
|
|
604
604
|
) : null });
|
|
605
|
-
|
|
605
|
+
$(ue, "incode-flow");
|
|
606
606
|
export {
|
|
607
607
|
ue as IncodeFlow,
|
|
608
|
-
|
|
608
|
+
Ee as preloadIncodeFlow
|
|
609
609
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@incodetech/web",
|
|
3
|
-
"version": "0.0.0-dev-20260218-
|
|
3
|
+
"version": "0.0.0-dev-20260218-d80e4b9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.es.js",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"libphonenumber-js": "^1.11.0",
|
|
80
80
|
"preact-custom-element": "^4.6.0",
|
|
81
81
|
"tailwindcss": "^4.1.17",
|
|
82
|
-
"@incodetech/core": "0.0.0-dev-20260218-
|
|
82
|
+
"@incodetech/core": "0.0.0-dev-20260218-d80e4b9"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@microsoft/api-extractor": "^7.53.3",
|