@incodetech/web 0.0.0-dev-20260205-bb46959 → 0.0.0-dev-20260206-cd4d6ec
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/face-match/styles.css +771 -0
- package/dist/faceMatch-BUaXZ4NY.js +212 -0
- package/dist/flow/flow.es.js +219 -199
- package/dist/flow/styles.css +557 -0
- package/dist/types/face-match/styles.d.ts +1 -0
- package/package.json +9 -2
package/dist/flow/flow.es.js
CHANGED
|
@@ -1,77 +1,78 @@
|
|
|
1
|
-
import { u
|
|
2
|
-
import { createOrchestratedFlowManager as
|
|
3
|
-
import { A as
|
|
4
|
-
import { api as P, warmupWasm as
|
|
1
|
+
import { u, B as N, r as _, a as O } from "../incodeModule-DR92HDjR.js";
|
|
2
|
+
import { createOrchestratedFlowManager as H, getRequiredWasmPipelines as L } from "@incodetech/core/flow";
|
|
3
|
+
import { A as F, d as U, y as g } from "../vendor-preact-CjD4WiuC.js";
|
|
4
|
+
import { api as P, warmupWasm as k, IdCaptureProvider as W } from "@incodetech/core";
|
|
5
5
|
import "../instance-B-q0ZREN.js";
|
|
6
|
-
import { u as j, S as
|
|
6
|
+
import { u as j, S as I } from "../spinner-CQtj_FFo.js";
|
|
7
7
|
import { emailMachine as B } from "@incodetech/core/email";
|
|
8
|
+
import { faceMatchMachine as K } from "@incodetech/core/face-match";
|
|
8
9
|
import { idCaptureMachine as b } from "@incodetech/core/id";
|
|
9
|
-
import { phoneMachine as
|
|
10
|
-
import { selfieMachine as
|
|
11
|
-
import { s as
|
|
12
|
-
import { s as
|
|
13
|
-
function
|
|
10
|
+
import { phoneMachine as q } from "@incodetech/core/phone";
|
|
11
|
+
import { selfieMachine as V } from "@incodetech/core/selfie";
|
|
12
|
+
import { s as Y } from "../setup-BhetRn4n.js";
|
|
13
|
+
import { s as y } from "../uiConfig-DEqynrWx.js";
|
|
14
|
+
function Z(e) {
|
|
14
15
|
let t = e.replace("#", "");
|
|
15
|
-
t.length === 3 && (t = t.split("").map((
|
|
16
|
+
t.length === 3 && (t = t.split("").map((a) => a + a).join(""));
|
|
16
17
|
const n = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
|
|
17
18
|
if (!n) return null;
|
|
18
|
-
const s = Number.parseInt(n[1], 16) / 255,
|
|
19
|
-
let i = 0,
|
|
20
|
-
const c = (o +
|
|
21
|
-
if (o !==
|
|
22
|
-
const
|
|
23
|
-
switch (
|
|
19
|
+
const s = Number.parseInt(n[1], 16) / 255, l = Number.parseInt(n[2], 16) / 255, r = Number.parseInt(n[3], 16) / 255, o = Math.max(s, l, r), f = Math.min(s, l, r);
|
|
20
|
+
let i = 0, h = 0;
|
|
21
|
+
const c = (o + f) / 2;
|
|
22
|
+
if (o !== f) {
|
|
23
|
+
const a = o - f;
|
|
24
|
+
switch (h = c > 0.5 ? a / (2 - o - f) : a / (o + f), o) {
|
|
24
25
|
case s:
|
|
25
|
-
i = ((
|
|
26
|
+
i = ((l - r) / a + (l < r ? 6 : 0)) / 6;
|
|
26
27
|
break;
|
|
27
|
-
case
|
|
28
|
-
i = ((r - s) /
|
|
28
|
+
case l:
|
|
29
|
+
i = ((r - s) / a + 2) / 6;
|
|
29
30
|
break;
|
|
30
31
|
case r:
|
|
31
|
-
i = ((s -
|
|
32
|
+
i = ((s - l) / a + 4) / 6;
|
|
32
33
|
break;
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
|
-
return { h: i * 360, s:
|
|
36
|
+
return { h: i * 360, s: h * 100, l: c * 100 };
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
-
const s = e / 360,
|
|
39
|
-
let o,
|
|
40
|
-
if (
|
|
41
|
-
o =
|
|
38
|
+
function M(e, t, n) {
|
|
39
|
+
const s = e / 360, l = t / 100, r = n / 100;
|
|
40
|
+
let o, f, i;
|
|
41
|
+
if (l === 0)
|
|
42
|
+
o = f = i = r;
|
|
42
43
|
else {
|
|
43
|
-
const c = (
|
|
44
|
-
o = c(
|
|
44
|
+
const c = (p, v, m) => (m < 0 && (m += 1), m > 1 && (m -= 1), m < 0.16666666666666666 ? p + (v - p) * 6 * m : m < 0.5 ? v : m < 0.6666666666666666 ? p + (v - p) * (0.6666666666666666 - m) * 6 : p), a = r < 0.5 ? r * (1 + l) : r + l - r * l, d = 2 * r - a;
|
|
45
|
+
o = c(d, a, s + 1 / 3), f = c(d, a, s), i = c(d, a, s - 1 / 3);
|
|
45
46
|
}
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
return
|
|
47
|
+
const h = (c) => {
|
|
48
|
+
const a = Math.round(c * 255).toString(16);
|
|
49
|
+
return a.length === 1 ? `0${a}` : a;
|
|
49
50
|
};
|
|
50
|
-
return `#${
|
|
51
|
+
return `#${h(o)}${h(f)}${h(i)}`;
|
|
51
52
|
}
|
|
52
|
-
function
|
|
53
|
-
const t =
|
|
53
|
+
function G(e) {
|
|
54
|
+
const t = Z(e);
|
|
54
55
|
if (!t)
|
|
55
56
|
throw new Error(`Invalid color format: ${e}`);
|
|
56
57
|
return {
|
|
57
|
-
50:
|
|
58
|
-
200:
|
|
59
|
-
300:
|
|
60
|
-
400:
|
|
58
|
+
50: M(t.h, t.s, 95),
|
|
59
|
+
200: M(t.h, t.s, 80),
|
|
60
|
+
300: M(t.h, t.s, 65),
|
|
61
|
+
400: M(t.h, t.s, Math.min(100, t.l + 10)),
|
|
61
62
|
500: e,
|
|
62
|
-
600:
|
|
63
|
-
900:
|
|
63
|
+
600: M(t.h, t.s, Math.max(0, t.l - 10)),
|
|
64
|
+
900: M(t.h, t.s, 20)
|
|
64
65
|
};
|
|
65
66
|
}
|
|
66
|
-
function
|
|
67
|
+
function J(e, t) {
|
|
67
68
|
if (typeof document > "u")
|
|
68
69
|
return;
|
|
69
|
-
const n =
|
|
70
|
+
const n = G(e);
|
|
70
71
|
let s = document.getElementById(
|
|
71
72
|
"incode-theme"
|
|
72
73
|
);
|
|
73
74
|
s || (s = document.createElement("style"), s.id = "incode-theme", document.head.appendChild(s));
|
|
74
|
-
const
|
|
75
|
+
const l = t || "#ffffff", r = `
|
|
75
76
|
:root,
|
|
76
77
|
:host {
|
|
77
78
|
--primitive-color-brand-50: ${n[50]};
|
|
@@ -81,29 +82,29 @@ function G(e, t) {
|
|
|
81
82
|
--primitive-color-brand-500: ${n[500]};
|
|
82
83
|
--primitive-color-brand-600: ${n[600]};
|
|
83
84
|
--primitive-color-brand-900: ${n[900]};
|
|
84
|
-
--button-primary-text-default: ${
|
|
85
|
+
--button-primary-text-default: ${l};
|
|
85
86
|
}
|
|
86
87
|
`;
|
|
87
88
|
s.textContent = r;
|
|
88
89
|
}
|
|
89
|
-
async function
|
|
90
|
+
async function Q() {
|
|
90
91
|
return (await P.get("/omni/asset/fetch-all")).data;
|
|
91
92
|
}
|
|
92
|
-
const
|
|
93
|
-
async function
|
|
93
|
+
const T = /* @__PURE__ */ new Map();
|
|
94
|
+
async function X(e) {
|
|
94
95
|
if (e.startsWith("data:"))
|
|
95
96
|
return e;
|
|
96
|
-
const t =
|
|
97
|
+
const t = T.get(e);
|
|
97
98
|
if (t)
|
|
98
99
|
return t;
|
|
99
|
-
const s = await (await fetch(e)).blob(),
|
|
100
|
-
const
|
|
101
|
-
|
|
100
|
+
const s = await (await fetch(e)).blob(), l = await new Promise((r, o) => {
|
|
101
|
+
const f = new FileReader();
|
|
102
|
+
f.onloadend = () => r(f.result), f.onerror = o, f.readAsDataURL(s);
|
|
102
103
|
});
|
|
103
|
-
return
|
|
104
|
+
return T.set(e, l), l;
|
|
104
105
|
}
|
|
105
|
-
async function
|
|
106
|
-
const e = await
|
|
106
|
+
async function ee() {
|
|
107
|
+
const e = await Q();
|
|
107
108
|
if (!e.theme)
|
|
108
109
|
throw new Error("Theme URL not found in assets response");
|
|
109
110
|
const t = e.theme, n = t.startsWith("http://") || t.startsWith("https://");
|
|
@@ -115,67 +116,69 @@ async function X() {
|
|
|
115
116
|
s = await o.json();
|
|
116
117
|
} else
|
|
117
118
|
s = (await P.get(t)).data;
|
|
118
|
-
const
|
|
119
|
-
let r =
|
|
120
|
-
return
|
|
119
|
+
const l = e["logo.png"] || e["logo.svg"] || e["logo.jpg"] || e["logo.jpeg"] || e["logo.webp"] || s.logo;
|
|
120
|
+
let r = l;
|
|
121
|
+
return l && (r = await X(l)), {
|
|
121
122
|
...s,
|
|
122
123
|
logo: r
|
|
123
124
|
};
|
|
124
125
|
}
|
|
125
|
-
async function
|
|
126
|
-
const e = await
|
|
127
|
-
return e.main &&
|
|
126
|
+
async function te() {
|
|
127
|
+
const e = await ee();
|
|
128
|
+
return e.main && J(e.main, e.buttonColor), e;
|
|
128
129
|
}
|
|
129
|
-
const
|
|
130
|
+
const C = () => import("../id/id.es.js").then((e) => e.Id), S = {
|
|
130
131
|
PHONE: () => import("../phone/phone.es.js").then((e) => e.Phone),
|
|
131
132
|
EMAIL: () => import("../email/email.es.js").then((e) => e.Email),
|
|
132
133
|
SELFIE: () => import("../selfie/selfie.es.js").then((e) => e.Selfie),
|
|
133
|
-
ID:
|
|
134
|
-
TUTORIAL_ID:
|
|
135
|
-
SECOND_ID:
|
|
136
|
-
THIRD_ID:
|
|
134
|
+
ID: C,
|
|
135
|
+
TUTORIAL_ID: C,
|
|
136
|
+
SECOND_ID: C,
|
|
137
|
+
THIRD_ID: C,
|
|
138
|
+
FACE_MATCH: () => import("../faceMatch-BUaXZ4NY.js").then((e) => e.FaceMatch)
|
|
137
139
|
};
|
|
138
140
|
function x() {
|
|
139
|
-
return
|
|
141
|
+
return H({
|
|
140
142
|
modules: {
|
|
141
|
-
PHONE:
|
|
143
|
+
PHONE: q,
|
|
142
144
|
EMAIL: B,
|
|
143
|
-
SELFIE:
|
|
145
|
+
SELFIE: V,
|
|
144
146
|
ID: b,
|
|
145
147
|
TUTORIAL_ID: b,
|
|
146
148
|
SECOND_ID: b,
|
|
147
|
-
THIRD_ID: b
|
|
149
|
+
THIRD_ID: b,
|
|
150
|
+
FACE_MATCH: K
|
|
148
151
|
}
|
|
149
152
|
});
|
|
150
153
|
}
|
|
151
|
-
async function
|
|
152
|
-
await
|
|
154
|
+
async function A(e) {
|
|
155
|
+
await Y({
|
|
153
156
|
apiURL: e.apiURL,
|
|
154
157
|
token: e.token,
|
|
155
158
|
i18n: { lang: e.lang ?? "en" }
|
|
156
159
|
});
|
|
157
160
|
}
|
|
158
|
-
async function
|
|
161
|
+
async function $() {
|
|
159
162
|
try {
|
|
160
|
-
const e = await
|
|
163
|
+
const e = await te(), t = {
|
|
161
164
|
logoSrc: e.logo,
|
|
162
165
|
hideFooterBranding: e.hideFooterBranding
|
|
163
166
|
};
|
|
164
|
-
return
|
|
167
|
+
return y(t), { theme: e, uiConfig: t };
|
|
165
168
|
} catch (e) {
|
|
166
169
|
return console.warn("Failed to fetch dashboard theme:", e), {};
|
|
167
170
|
}
|
|
168
171
|
}
|
|
169
|
-
function
|
|
170
|
-
const n =
|
|
171
|
-
n.length > 0 &&
|
|
172
|
+
function z(e, t) {
|
|
173
|
+
const n = L(e.flow);
|
|
174
|
+
n.length > 0 && k({
|
|
172
175
|
...t,
|
|
173
176
|
pipelines: n
|
|
174
177
|
}).catch((s) => {
|
|
175
178
|
console.error("WASM warmup failed:", s);
|
|
176
179
|
});
|
|
177
180
|
}
|
|
178
|
-
function
|
|
181
|
+
function re(e) {
|
|
179
182
|
const t = e.currentStep;
|
|
180
183
|
if (t) {
|
|
181
184
|
const n = S[t];
|
|
@@ -183,17 +186,17 @@ function te(e) {
|
|
|
183
186
|
});
|
|
184
187
|
}
|
|
185
188
|
}
|
|
186
|
-
const
|
|
189
|
+
const ne = ({
|
|
187
190
|
moduleKey: e,
|
|
188
191
|
onNext: t
|
|
189
|
-
}) => /* @__PURE__ */
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
+
}) => /* @__PURE__ */ u("section", { class: "IncodeUnsupportedModule", "aria-live": "polite", children: /* @__PURE__ */ u("div", { class: "IncodeUnsupportedModuleContent", children: [
|
|
193
|
+
/* @__PURE__ */ u("h2", { class: "IncodeUnsupportedModuleTitle", children: "Module not available" }),
|
|
194
|
+
/* @__PURE__ */ u("p", { class: "IncodeUnsupportedModuleMessage", children: [
|
|
192
195
|
'The "',
|
|
193
196
|
e,
|
|
194
197
|
'" module is not yet supported in this version.'
|
|
195
198
|
] }),
|
|
196
|
-
/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ u(
|
|
197
200
|
N,
|
|
198
201
|
{
|
|
199
202
|
onClick: t,
|
|
@@ -203,7 +206,7 @@ const re = ({
|
|
|
203
206
|
}
|
|
204
207
|
)
|
|
205
208
|
] }) }), w = /* @__PURE__ */ new Map();
|
|
206
|
-
function
|
|
209
|
+
function D(e) {
|
|
207
210
|
const t = w.get(e);
|
|
208
211
|
if (!t)
|
|
209
212
|
throw new Error("Preload state not found");
|
|
@@ -226,171 +229,171 @@ function R(e) {
|
|
|
226
229
|
}
|
|
227
230
|
};
|
|
228
231
|
}
|
|
229
|
-
function
|
|
232
|
+
function ye(e) {
|
|
230
233
|
const { token: t } = e;
|
|
231
234
|
if (w.has(t))
|
|
232
|
-
return
|
|
235
|
+
return D(t);
|
|
233
236
|
let n, s;
|
|
234
|
-
const
|
|
235
|
-
n = i, s =
|
|
237
|
+
const l = new Promise((i, h) => {
|
|
238
|
+
n = i, s = h;
|
|
236
239
|
}), r = x(), o = {
|
|
237
240
|
status: "loading",
|
|
238
241
|
flowManager: r,
|
|
239
242
|
config: e,
|
|
240
|
-
readyPromise:
|
|
243
|
+
readyPromise: l,
|
|
241
244
|
readyResolve: n,
|
|
242
245
|
readyReject: s
|
|
243
246
|
};
|
|
244
247
|
return w.set(t, o), (async () => {
|
|
245
248
|
try {
|
|
246
|
-
await
|
|
249
|
+
await A({
|
|
247
250
|
apiURL: e.apiURL,
|
|
248
251
|
token: e.token,
|
|
249
252
|
lang: e.lang
|
|
250
253
|
});
|
|
251
|
-
const i = e.disableDashboardTheme ? Promise.resolve({}) :
|
|
254
|
+
const i = e.disableDashboardTheme ? Promise.resolve({}) : $().then((c) => {
|
|
252
255
|
o.theme = c.theme, o.uiConfig = c.uiConfig;
|
|
253
|
-
}),
|
|
256
|
+
}), h = r.subscribe((c) => {
|
|
254
257
|
if (c.status === "ready") {
|
|
255
|
-
const
|
|
256
|
-
e.wasmConfig &&
|
|
258
|
+
const a = c;
|
|
259
|
+
e.wasmConfig && z(a, e.wasmConfig), re(a), o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "ready", o.readyResolve();
|
|
257
260
|
} else c.status === "error" && (o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "error", o.error = c.error, o.readyReject(new Error(c.error)));
|
|
258
261
|
});
|
|
259
|
-
o.unsubscribe =
|
|
262
|
+
o.unsubscribe = h, r.load(), await i;
|
|
260
263
|
} catch (i) {
|
|
261
264
|
o.status = "error", o.error = i instanceof Error ? i.message : "Failed to preload", o.readyReject(
|
|
262
265
|
i instanceof Error ? i : new Error("Failed to preload")
|
|
263
266
|
), w.delete(t);
|
|
264
267
|
}
|
|
265
|
-
})(),
|
|
268
|
+
})(), D(t);
|
|
266
269
|
}
|
|
267
|
-
function
|
|
270
|
+
function E(e) {
|
|
268
271
|
return w.get(e) ?? null;
|
|
269
272
|
}
|
|
270
|
-
function
|
|
271
|
-
const t =
|
|
273
|
+
function R(e) {
|
|
274
|
+
const t = E(e);
|
|
272
275
|
return t && w.delete(e), t;
|
|
273
276
|
}
|
|
274
|
-
function
|
|
275
|
-
const { apiURL: t, token: n, lang: s, disableDashboardTheme:
|
|
276
|
-
const c =
|
|
277
|
+
function oe(e) {
|
|
278
|
+
const { apiURL: t, token: n, lang: s, disableDashboardTheme: l, onError: r } = e, o = F(null), [f, i] = U(() => {
|
|
279
|
+
const c = E(n);
|
|
277
280
|
if (c?.status === "ready") {
|
|
278
|
-
const
|
|
279
|
-
if (
|
|
280
|
-
return o.current =
|
|
281
|
+
const d = R(n);
|
|
282
|
+
if (d)
|
|
283
|
+
return o.current = d.flowManager, d.uiConfig && y(d.uiConfig), { status: "ready", flowManager: d.flowManager };
|
|
281
284
|
}
|
|
282
|
-
const
|
|
283
|
-
return o.current =
|
|
285
|
+
const a = x();
|
|
286
|
+
return o.current = a, c?.status === "error" ? {
|
|
284
287
|
status: "error",
|
|
285
288
|
error: c.error ?? "Preload failed",
|
|
286
|
-
flowManager:
|
|
287
|
-
} : { status: "initializing", flowManager:
|
|
288
|
-
}),
|
|
289
|
+
flowManager: a
|
|
290
|
+
} : { status: "initializing", flowManager: a };
|
|
291
|
+
}), h = F(!1);
|
|
289
292
|
return g(() => {
|
|
290
|
-
if (
|
|
293
|
+
if (f.status !== "initializing")
|
|
291
294
|
return;
|
|
292
|
-
const c =
|
|
295
|
+
const c = E(n);
|
|
293
296
|
if (c?.status === "loading") {
|
|
294
297
|
c.readyPromise.then(() => {
|
|
295
|
-
const
|
|
296
|
-
|
|
297
|
-
}).catch((
|
|
298
|
-
const
|
|
298
|
+
const d = R(n);
|
|
299
|
+
d && (o.current = d.flowManager, d.uiConfig && y(d.uiConfig), i({ status: "ready", flowManager: d.flowManager }));
|
|
300
|
+
}).catch((d) => {
|
|
301
|
+
const p = d instanceof Error ? d.message : "Preload failed";
|
|
299
302
|
i({
|
|
300
303
|
status: "error",
|
|
301
|
-
error:
|
|
302
|
-
flowManager:
|
|
303
|
-
}), r?.(
|
|
304
|
+
error: p,
|
|
305
|
+
flowManager: f.flowManager
|
|
306
|
+
}), r?.(p);
|
|
304
307
|
});
|
|
305
308
|
return;
|
|
306
309
|
}
|
|
307
|
-
if (
|
|
310
|
+
if (h.current)
|
|
308
311
|
return;
|
|
309
|
-
|
|
312
|
+
h.current = !0, (async () => {
|
|
310
313
|
try {
|
|
311
|
-
await
|
|
312
|
-
const
|
|
313
|
-
|
|
314
|
+
await A({ apiURL: t, token: n, lang: s });
|
|
315
|
+
const d = l ? Promise.resolve() : $().then((p) => {
|
|
316
|
+
p.uiConfig && y(p.uiConfig);
|
|
314
317
|
});
|
|
315
|
-
|
|
316
|
-
} catch (
|
|
317
|
-
const
|
|
318
|
+
f.flowManager.load(), await d, i({ status: "ready", flowManager: f.flowManager });
|
|
319
|
+
} catch (d) {
|
|
320
|
+
const p = d instanceof Error ? d.message : "Failed to initialize SDK";
|
|
318
321
|
i({
|
|
319
322
|
status: "error",
|
|
320
|
-
error:
|
|
321
|
-
flowManager:
|
|
322
|
-
}), r?.(
|
|
323
|
+
error: p,
|
|
324
|
+
flowManager: f.flowManager
|
|
325
|
+
}), r?.(p);
|
|
323
326
|
}
|
|
324
327
|
})();
|
|
325
|
-
}, [t, n, s,
|
|
328
|
+
}, [t, n, s, l, r, f]), f;
|
|
326
329
|
}
|
|
327
|
-
function
|
|
328
|
-
const { moduleKey: t, onModuleLoading: n, onModuleLoaded: s, onError:
|
|
330
|
+
function se(e) {
|
|
331
|
+
const { moduleKey: t, onModuleLoading: n, onModuleLoaded: s, onError: l } = e, [r, o] = U({ status: "idle" });
|
|
329
332
|
return g(() => {
|
|
330
333
|
if (!t) {
|
|
331
334
|
o({ status: "idle" });
|
|
332
335
|
return;
|
|
333
336
|
}
|
|
334
|
-
const
|
|
335
|
-
if (!
|
|
337
|
+
const f = S[t];
|
|
338
|
+
if (!f) {
|
|
336
339
|
o({ status: "unsupported", moduleKey: t });
|
|
337
340
|
return;
|
|
338
341
|
}
|
|
339
342
|
o({ status: "loading", moduleKey: t }), n?.(t);
|
|
340
343
|
let i = !1;
|
|
341
|
-
return
|
|
342
|
-
i || (o({ status: "loaded", moduleKey: t, Component:
|
|
343
|
-
}).catch((
|
|
344
|
+
return f().then((h) => {
|
|
345
|
+
i || (o({ status: "loaded", moduleKey: t, Component: h }), s?.(t));
|
|
346
|
+
}).catch((h) => {
|
|
344
347
|
if (!i) {
|
|
345
|
-
const c =
|
|
346
|
-
o({ status: "error", moduleKey: t, error: c }),
|
|
348
|
+
const c = h instanceof Error ? h.message : "Failed to load module";
|
|
349
|
+
o({ status: "error", moduleKey: t, error: c }), l?.(`Failed to load ${t}: ${c}`);
|
|
347
350
|
}
|
|
348
351
|
}), () => {
|
|
349
352
|
i = !0;
|
|
350
353
|
};
|
|
351
|
-
}, [t, n, s,
|
|
354
|
+
}, [t, n, s, l]), r;
|
|
352
355
|
}
|
|
353
|
-
function
|
|
354
|
-
const n =
|
|
356
|
+
function ie(e, t) {
|
|
357
|
+
const n = F(/* @__PURE__ */ new Set());
|
|
355
358
|
g(() => {
|
|
356
359
|
if (t < e.length - 1) {
|
|
357
360
|
const s = e[t + 1];
|
|
358
361
|
if (s && !n.current.has(s)) {
|
|
359
362
|
n.current.add(s);
|
|
360
|
-
const
|
|
361
|
-
|
|
363
|
+
const l = S[s];
|
|
364
|
+
l && l().catch(() => {
|
|
362
365
|
n.current.delete(s);
|
|
363
366
|
});
|
|
364
367
|
}
|
|
365
368
|
}
|
|
366
369
|
}, [e, t]);
|
|
367
370
|
}
|
|
368
|
-
const
|
|
371
|
+
const ae = ({
|
|
369
372
|
config: e,
|
|
370
373
|
onFinish: t,
|
|
371
374
|
onError: n
|
|
372
375
|
}) => {
|
|
373
|
-
const { t: s } = j(),
|
|
376
|
+
const { t: s } = j(), l = oe({
|
|
374
377
|
apiURL: e.apiURL,
|
|
375
378
|
token: e.token,
|
|
376
379
|
lang: e.lang,
|
|
377
380
|
disableDashboardTheme: e.disableDashboardTheme,
|
|
378
381
|
onError: n
|
|
379
|
-
}), [r, o] =
|
|
382
|
+
}), [r, o] = O(() => l.flowManager, {
|
|
380
383
|
autoLoad: !1
|
|
381
|
-
}),
|
|
384
|
+
}), f = se({
|
|
382
385
|
moduleKey: r?.status === "ready" ? r.currentStep : void 0,
|
|
383
386
|
onModuleLoading: e.onModuleLoading,
|
|
384
387
|
onModuleLoaded: e.onModuleLoaded,
|
|
385
388
|
onError: n
|
|
386
389
|
});
|
|
387
|
-
if (
|
|
390
|
+
if (ie(
|
|
388
391
|
r?.status === "ready" ? r.steps : [],
|
|
389
392
|
r?.status === "ready" ? r.currentStepIndex : -1
|
|
390
393
|
), g(() => {
|
|
391
394
|
if (r?.status === "ready" && e.wasmConfig) {
|
|
392
|
-
const i = r,
|
|
393
|
-
|
|
395
|
+
const i = r, h = L(i.flow);
|
|
396
|
+
h.length > 0 && (e.onWasmWarmup?.(h), z(i, e.wasmConfig));
|
|
394
397
|
}
|
|
395
398
|
}, [r, e]), g(() => {
|
|
396
399
|
r?.status === "finished" && t(r.finishStatus);
|
|
@@ -398,14 +401,14 @@ const ie = ({
|
|
|
398
401
|
r?.status === "error" && n && n(r.error);
|
|
399
402
|
}, [r?.status, n, r]), g(() => {
|
|
400
403
|
r?.status === "ready" && r.currentStep === "ID" && r.steps.includes("TUTORIAL_ID") && o.completeModule();
|
|
401
|
-
}, [r, o]),
|
|
402
|
-
return /* @__PURE__ */
|
|
404
|
+
}, [r, o]), l.status === "error")
|
|
405
|
+
return /* @__PURE__ */ u("div", { class: "IncodeFlow", children: /* @__PURE__ */ u("div", { children: [
|
|
403
406
|
"Error: ",
|
|
404
|
-
|
|
407
|
+
l.error
|
|
405
408
|
] }) });
|
|
406
|
-
if (
|
|
407
|
-
return /* @__PURE__ */
|
|
408
|
-
|
|
409
|
+
if (l.status === "initializing")
|
|
410
|
+
return /* @__PURE__ */ u("div", { class: "IncodeFlow", children: /* @__PURE__ */ u(
|
|
411
|
+
I,
|
|
409
412
|
{
|
|
410
413
|
title: e.spinnerConfig?.title,
|
|
411
414
|
subtitle: e.spinnerConfig?.subtitle,
|
|
@@ -414,8 +417,8 @@ const ie = ({
|
|
|
414
417
|
}
|
|
415
418
|
) });
|
|
416
419
|
if (!r || r.status === "idle" || r.status === "loading")
|
|
417
|
-
return /* @__PURE__ */
|
|
418
|
-
|
|
420
|
+
return /* @__PURE__ */ u("div", { class: "IncodeFlow", children: /* @__PURE__ */ u(
|
|
421
|
+
I,
|
|
419
422
|
{
|
|
420
423
|
title: e.spinnerConfig?.title,
|
|
421
424
|
subtitle: e.spinnerConfig?.subtitle,
|
|
@@ -424,17 +427,17 @@ const ie = ({
|
|
|
424
427
|
}
|
|
425
428
|
) });
|
|
426
429
|
if (r.status === "error")
|
|
427
|
-
return /* @__PURE__ */
|
|
430
|
+
return /* @__PURE__ */ u("div", { class: "IncodeFlow", children: /* @__PURE__ */ u("div", { children: [
|
|
428
431
|
"Error: ",
|
|
429
432
|
r.error
|
|
430
433
|
] }) });
|
|
431
434
|
if (r.status === "finished")
|
|
432
435
|
return null;
|
|
433
436
|
if (r.status === "ready") {
|
|
434
|
-
const { currentStep: i, config:
|
|
435
|
-
if (!i || !
|
|
436
|
-
return /* @__PURE__ */
|
|
437
|
-
|
|
437
|
+
const { currentStep: i, config: h } = r;
|
|
438
|
+
if (!i || !h)
|
|
439
|
+
return /* @__PURE__ */ u("div", { class: "IncodeFlow", children: /* @__PURE__ */ u(
|
|
440
|
+
I,
|
|
438
441
|
{
|
|
439
442
|
title: e.spinnerConfig?.title ?? s("loadingCircle.hangOn"),
|
|
440
443
|
subtitle: e.spinnerConfig?.subtitle ?? s("loadingCircle.validating"),
|
|
@@ -442,17 +445,17 @@ const ie = ({
|
|
|
442
445
|
fullScreen: !0
|
|
443
446
|
}
|
|
444
447
|
) });
|
|
445
|
-
if (
|
|
446
|
-
return /* @__PURE__ */
|
|
447
|
-
|
|
448
|
+
if (f.status === "unsupported")
|
|
449
|
+
return /* @__PURE__ */ u("div", { class: "IncodeFlow", children: /* @__PURE__ */ u(
|
|
450
|
+
ne,
|
|
448
451
|
{
|
|
449
452
|
moduleKey: i,
|
|
450
453
|
onNext: () => o.completeModule()
|
|
451
454
|
}
|
|
452
455
|
) });
|
|
453
|
-
if (
|
|
454
|
-
return /* @__PURE__ */
|
|
455
|
-
|
|
456
|
+
if (f.status === "idle" || f.status === "loading" || f.status === "error")
|
|
457
|
+
return /* @__PURE__ */ u("div", { class: "IncodeFlow", children: /* @__PURE__ */ u(
|
|
458
|
+
I,
|
|
456
459
|
{
|
|
457
460
|
title: e.spinnerConfig?.title ?? s("loadingCircle.hangOn"),
|
|
458
461
|
subtitle: e.spinnerConfig?.subtitle ?? s("loadingCircle.validating"),
|
|
@@ -460,43 +463,43 @@ const ie = ({
|
|
|
460
463
|
fullScreen: !0
|
|
461
464
|
}
|
|
462
465
|
) });
|
|
463
|
-
const { Component: c } =
|
|
466
|
+
const { Component: c } = f;
|
|
464
467
|
if (i === "SELFIE")
|
|
465
|
-
return /* @__PURE__ */
|
|
468
|
+
return /* @__PURE__ */ u("div", { class: "IncodeFlow", children: /* @__PURE__ */ u(
|
|
466
469
|
c,
|
|
467
470
|
{
|
|
468
|
-
config:
|
|
471
|
+
config: h,
|
|
469
472
|
onFinish: () => o.completeModule(),
|
|
470
|
-
onError: (
|
|
471
|
-
n?.(
|
|
473
|
+
onError: (d) => {
|
|
474
|
+
n?.(d ?? "Selfie verification error");
|
|
472
475
|
}
|
|
473
476
|
},
|
|
474
477
|
`selfie-${r.currentStepIndex}`
|
|
475
478
|
) });
|
|
476
479
|
if (i === "PHONE")
|
|
477
|
-
return /* @__PURE__ */
|
|
480
|
+
return /* @__PURE__ */ u("div", { class: "IncodeFlow", children: /* @__PURE__ */ u(
|
|
478
481
|
c,
|
|
479
482
|
{
|
|
480
|
-
config:
|
|
483
|
+
config: h,
|
|
481
484
|
onFinish: () => o.completeModule(),
|
|
482
|
-
onError: (
|
|
483
|
-
n?.(
|
|
485
|
+
onError: (d) => {
|
|
486
|
+
n?.(d ?? "Phone verification error");
|
|
484
487
|
}
|
|
485
488
|
},
|
|
486
489
|
`phone-${r.currentStepIndex}`
|
|
487
490
|
) });
|
|
488
491
|
if (i === "EMAIL") {
|
|
489
|
-
const
|
|
490
|
-
return !
|
|
492
|
+
const a = h;
|
|
493
|
+
return !a || typeof a.otpVerification != "boolean" || typeof a.otpExpirationInMinutes != "number" ? /* @__PURE__ */ u("div", { class: "IncodeFlow", children: /* @__PURE__ */ u("div", { children: "Error: Invalid email configuration" }) }) : /* @__PURE__ */ u("div", { class: "IncodeFlow", children: /* @__PURE__ */ u(
|
|
491
494
|
c,
|
|
492
495
|
{
|
|
493
496
|
config: {
|
|
494
|
-
...
|
|
495
|
-
prefill:
|
|
497
|
+
...a,
|
|
498
|
+
prefill: a.prefill ?? !1
|
|
496
499
|
},
|
|
497
500
|
onFinish: () => o.completeModule(),
|
|
498
|
-
onError: (
|
|
499
|
-
n?.(
|
|
501
|
+
onError: (d) => {
|
|
502
|
+
n?.(d ?? "Email verification error");
|
|
500
503
|
}
|
|
501
504
|
},
|
|
502
505
|
`email-${r.currentStepIndex}`
|
|
@@ -504,37 +507,54 @@ const ie = ({
|
|
|
504
507
|
}
|
|
505
508
|
if (i === "TUTORIAL_ID" || i === "SECOND_ID" || i === "THIRD_ID" || // Only render ID if TUTORIAL_ID doesn't exist (otherwise useEffect will skip it)
|
|
506
509
|
i === "ID" && !r.steps.includes("TUTORIAL_ID")) {
|
|
507
|
-
const
|
|
508
|
-
return /* @__PURE__ */
|
|
510
|
+
const a = h, d = new W();
|
|
511
|
+
return /* @__PURE__ */ u("div", { class: "IncodeFlow", children: /* @__PURE__ */ u(
|
|
509
512
|
c,
|
|
510
513
|
{
|
|
511
|
-
config:
|
|
512
|
-
provider:
|
|
514
|
+
config: a,
|
|
515
|
+
provider: d,
|
|
513
516
|
onFinish: () => o.completeModule(),
|
|
514
|
-
onError: (
|
|
515
|
-
n?.(
|
|
517
|
+
onError: (p) => {
|
|
518
|
+
n?.(p ?? "ID capture error");
|
|
516
519
|
}
|
|
517
520
|
},
|
|
518
521
|
`id-${r.currentStepIndex}`
|
|
519
522
|
) });
|
|
520
523
|
}
|
|
524
|
+
if (i === "FACE_MATCH") {
|
|
525
|
+
const a = h, d = {
|
|
526
|
+
variant: a.matchingType,
|
|
527
|
+
disableFaceMatchAnimation: a.disableFaceMatchAnimation ?? !1
|
|
528
|
+
};
|
|
529
|
+
return /* @__PURE__ */ u("div", { class: "IncodeFlow", children: /* @__PURE__ */ u(
|
|
530
|
+
c,
|
|
531
|
+
{
|
|
532
|
+
config: d,
|
|
533
|
+
onFinish: () => o.completeModule(),
|
|
534
|
+
onError: (p) => {
|
|
535
|
+
n?.(p ?? "Face match error");
|
|
536
|
+
}
|
|
537
|
+
},
|
|
538
|
+
`face-match-${r.currentStepIndex}`
|
|
539
|
+
) });
|
|
540
|
+
}
|
|
521
541
|
}
|
|
522
542
|
return null;
|
|
523
|
-
},
|
|
543
|
+
}, le = ({
|
|
524
544
|
config: e,
|
|
525
545
|
onFinish: t = () => {
|
|
526
546
|
},
|
|
527
547
|
onError: n
|
|
528
|
-
}) => /* @__PURE__ */
|
|
529
|
-
|
|
548
|
+
}) => /* @__PURE__ */ u("div", { class: "IncodeComponent", children: e ? /* @__PURE__ */ u(
|
|
549
|
+
ae,
|
|
530
550
|
{
|
|
531
551
|
config: e,
|
|
532
552
|
onFinish: t,
|
|
533
553
|
onError: n
|
|
534
554
|
}
|
|
535
555
|
) : null });
|
|
536
|
-
|
|
556
|
+
_(le, "incode-flow");
|
|
537
557
|
export {
|
|
538
|
-
|
|
539
|
-
|
|
558
|
+
le as IncodeFlow,
|
|
559
|
+
ye as preloadIncodeFlow
|
|
540
560
|
};
|