@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.
@@ -1,77 +1,78 @@
1
- import { u as f, B as N, r as O, a as _ } from "../incodeModule-DR92HDjR.js";
2
- import { createOrchestratedFlowManager as k, getRequiredWasmPipelines as U } from "@incodetech/core/flow";
3
- import { A as E, d as T, y as g } from "../vendor-preact-CjD4WiuC.js";
4
- import { api as P, warmupWasm as H, IdCaptureProvider as W } from "@incodetech/core";
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 M } from "../spinner-CQtj_FFo.js";
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 K } from "@incodetech/core/phone";
10
- import { selfieMachine as q } from "@incodetech/core/selfie";
11
- import { s as V } from "../setup-BhetRn4n.js";
12
- import { s as C } from "../uiConfig-DEqynrWx.js";
13
- function Y(e) {
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((l) => l + l).join(""));
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, a = Number.parseInt(n[2], 16) / 255, r = Number.parseInt(n[3], 16) / 255, o = Math.max(s, a, r), d = Math.min(s, a, r);
19
- let i = 0, p = 0;
20
- const c = (o + d) / 2;
21
- if (o !== d) {
22
- const l = o - d;
23
- switch (p = c > 0.5 ? l / (2 - o - d) : l / (o + d), o) {
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 = ((a - r) / l + (a < r ? 6 : 0)) / 6;
26
+ i = ((l - r) / a + (l < r ? 6 : 0)) / 6;
26
27
  break;
27
- case a:
28
- i = ((r - s) / l + 2) / 6;
28
+ case l:
29
+ i = ((r - s) / a + 2) / 6;
29
30
  break;
30
31
  case r:
31
- i = ((s - a) / l + 4) / 6;
32
+ i = ((s - l) / a + 4) / 6;
32
33
  break;
33
34
  }
34
35
  }
35
- return { h: i * 360, s: p * 100, l: c * 100 };
36
+ return { h: i * 360, s: h * 100, l: c * 100 };
36
37
  }
37
- function I(e, t, n) {
38
- const s = e / 360, a = t / 100, r = n / 100;
39
- let o, d, i;
40
- if (a === 0)
41
- o = d = i = r;
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 = (h, v, m) => (m < 0 && (m += 1), m > 1 && (m -= 1), m < 0.16666666666666666 ? h + (v - h) * 6 * m : m < 0.5 ? v : m < 0.6666666666666666 ? h + (v - h) * (0.6666666666666666 - m) * 6 : h), l = r < 0.5 ? r * (1 + a) : r + a - r * a, u = 2 * r - l;
44
- o = c(u, l, s + 1 / 3), d = c(u, l, s), i = c(u, l, s - 1 / 3);
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 p = (c) => {
47
- const l = Math.round(c * 255).toString(16);
48
- return l.length === 1 ? `0${l}` : l;
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 `#${p(o)}${p(d)}${p(i)}`;
51
+ return `#${h(o)}${h(f)}${h(i)}`;
51
52
  }
52
- function Z(e) {
53
- const t = Y(e);
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: I(t.h, t.s, 95),
58
- 200: I(t.h, t.s, 80),
59
- 300: I(t.h, t.s, 65),
60
- 400: I(t.h, t.s, Math.min(100, t.l + 10)),
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: I(t.h, t.s, Math.max(0, t.l - 10)),
63
- 900: I(t.h, t.s, 20)
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 G(e, t) {
67
+ function J(e, t) {
67
68
  if (typeof document > "u")
68
69
  return;
69
- const n = Z(e);
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 a = t || "#ffffff", r = `
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: ${a};
85
+ --button-primary-text-default: ${l};
85
86
  }
86
87
  `;
87
88
  s.textContent = r;
88
89
  }
89
- async function J() {
90
+ async function Q() {
90
91
  return (await P.get("/omni/asset/fetch-all")).data;
91
92
  }
92
- const D = /* @__PURE__ */ new Map();
93
- async function Q(e) {
93
+ const T = /* @__PURE__ */ new Map();
94
+ async function X(e) {
94
95
  if (e.startsWith("data:"))
95
96
  return e;
96
- const t = D.get(e);
97
+ const t = T.get(e);
97
98
  if (t)
98
99
  return t;
99
- const s = await (await fetch(e)).blob(), a = await new Promise((r, o) => {
100
- const d = new FileReader();
101
- d.onloadend = () => r(d.result), d.onerror = o, d.readAsDataURL(s);
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 D.set(e, a), a;
104
+ return T.set(e, l), l;
104
105
  }
105
- async function X() {
106
- const e = await J();
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 a = e["logo.png"] || e["logo.svg"] || e["logo.jpg"] || e["logo.jpeg"] || e["logo.webp"] || s.logo;
119
- let r = a;
120
- return a && (r = await Q(a)), {
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 ee() {
126
- const e = await X();
127
- return e.main && G(e.main, e.buttonColor), e;
126
+ async function te() {
127
+ const e = await ee();
128
+ return e.main && J(e.main, e.buttonColor), e;
128
129
  }
129
- const y = () => import("../id/id.es.js").then((e) => e.Id), S = {
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: y,
134
- TUTORIAL_ID: y,
135
- SECOND_ID: y,
136
- THIRD_ID: y
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 k({
141
+ return H({
140
142
  modules: {
141
- PHONE: K,
143
+ PHONE: q,
142
144
  EMAIL: B,
143
- SELFIE: q,
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 $(e) {
152
- await V({
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 z() {
161
+ async function $() {
159
162
  try {
160
- const e = await ee(), t = {
163
+ const e = await te(), t = {
161
164
  logoSrc: e.logo,
162
165
  hideFooterBranding: e.hideFooterBranding
163
166
  };
164
- return C(t), { theme: e, uiConfig: t };
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 A(e, t) {
170
- const n = U(e.flow);
171
- n.length > 0 && H({
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 te(e) {
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 re = ({
189
+ const ne = ({
187
190
  moduleKey: e,
188
191
  onNext: t
189
- }) => /* @__PURE__ */ f("section", { class: "IncodeUnsupportedModule", "aria-live": "polite", children: /* @__PURE__ */ f("div", { class: "IncodeUnsupportedModuleContent", children: [
190
- /* @__PURE__ */ f("h2", { class: "IncodeUnsupportedModuleTitle", children: "Module not available" }),
191
- /* @__PURE__ */ f("p", { class: "IncodeUnsupportedModuleMessage", children: [
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__ */ f(
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 R(e) {
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 be(e) {
232
+ function ye(e) {
230
233
  const { token: t } = e;
231
234
  if (w.has(t))
232
- return R(t);
235
+ return D(t);
233
236
  let n, s;
234
- const a = new Promise((i, p) => {
235
- n = i, s = p;
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: a,
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({}) : z().then((c) => {
254
+ const i = e.disableDashboardTheme ? Promise.resolve({}) : $().then((c) => {
252
255
  o.theme = c.theme, o.uiConfig = c.uiConfig;
253
- }), p = r.subscribe((c) => {
256
+ }), h = r.subscribe((c) => {
254
257
  if (c.status === "ready") {
255
- const l = c;
256
- e.wasmConfig && A(l, e.wasmConfig), te(l), o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "ready", o.readyResolve();
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 = p, r.load(), await i;
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
- })(), R(t);
268
+ })(), D(t);
266
269
  }
267
- function F(e) {
270
+ function E(e) {
268
271
  return w.get(e) ?? null;
269
272
  }
270
- function L(e) {
271
- const t = F(e);
273
+ function R(e) {
274
+ const t = E(e);
272
275
  return t && w.delete(e), t;
273
276
  }
274
- function ne(e) {
275
- const { apiURL: t, token: n, lang: s, disableDashboardTheme: a, onError: r } = e, o = E(null), [d, i] = T(() => {
276
- const c = F(n);
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 u = L(n);
279
- if (u)
280
- return o.current = u.flowManager, u.uiConfig && C(u.uiConfig), { status: "ready", flowManager: u.flowManager };
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 l = x();
283
- return o.current = l, c?.status === "error" ? {
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: l
287
- } : { status: "initializing", flowManager: l };
288
- }), p = E(!1);
289
+ flowManager: a
290
+ } : { status: "initializing", flowManager: a };
291
+ }), h = F(!1);
289
292
  return g(() => {
290
- if (d.status !== "initializing")
293
+ if (f.status !== "initializing")
291
294
  return;
292
- const c = F(n);
295
+ const c = E(n);
293
296
  if (c?.status === "loading") {
294
297
  c.readyPromise.then(() => {
295
- const u = L(n);
296
- u && (o.current = u.flowManager, u.uiConfig && C(u.uiConfig), i({ status: "ready", flowManager: u.flowManager }));
297
- }).catch((u) => {
298
- const h = u instanceof Error ? u.message : "Preload failed";
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: h,
302
- flowManager: d.flowManager
303
- }), r?.(h);
304
+ error: p,
305
+ flowManager: f.flowManager
306
+ }), r?.(p);
304
307
  });
305
308
  return;
306
309
  }
307
- if (p.current)
310
+ if (h.current)
308
311
  return;
309
- p.current = !0, (async () => {
312
+ h.current = !0, (async () => {
310
313
  try {
311
- await $({ apiURL: t, token: n, lang: s });
312
- const u = a ? Promise.resolve() : z().then((h) => {
313
- h.uiConfig && C(h.uiConfig);
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
- d.flowManager.load(), await u, i({ status: "ready", flowManager: d.flowManager });
316
- } catch (u) {
317
- const h = u instanceof Error ? u.message : "Failed to initialize SDK";
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: h,
321
- flowManager: d.flowManager
322
- }), r?.(h);
323
+ error: p,
324
+ flowManager: f.flowManager
325
+ }), r?.(p);
323
326
  }
324
327
  })();
325
- }, [t, n, s, a, r, d]), d;
328
+ }, [t, n, s, l, r, f]), f;
326
329
  }
327
- function oe(e) {
328
- const { moduleKey: t, onModuleLoading: n, onModuleLoaded: s, onError: a } = e, [r, o] = T({ status: "idle" });
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 d = S[t];
335
- if (!d) {
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 d().then((p) => {
342
- i || (o({ status: "loaded", moduleKey: t, Component: p }), s?.(t));
343
- }).catch((p) => {
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 = p instanceof Error ? p.message : "Failed to load module";
346
- o({ status: "error", moduleKey: t, error: c }), a?.(`Failed to load ${t}: ${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, a]), r;
354
+ }, [t, n, s, l]), r;
352
355
  }
353
- function se(e, t) {
354
- const n = E(/* @__PURE__ */ new Set());
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 a = S[s];
361
- a && a().catch(() => {
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 ie = ({
371
+ const ae = ({
369
372
  config: e,
370
373
  onFinish: t,
371
374
  onError: n
372
375
  }) => {
373
- const { t: s } = j(), a = ne({
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] = _(() => a.flowManager, {
382
+ }), [r, o] = O(() => l.flowManager, {
380
383
  autoLoad: !1
381
- }), d = oe({
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 (se(
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, p = U(i.flow);
393
- p.length > 0 && (e.onWasmWarmup?.(p), A(i, e.wasmConfig));
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]), a.status === "error")
402
- return /* @__PURE__ */ f("div", { class: "IncodeFlow", children: /* @__PURE__ */ f("div", { children: [
404
+ }, [r, o]), l.status === "error")
405
+ return /* @__PURE__ */ u("div", { class: "IncodeFlow", children: /* @__PURE__ */ u("div", { children: [
403
406
  "Error: ",
404
- a.error
407
+ l.error
405
408
  ] }) });
406
- if (a.status === "initializing")
407
- return /* @__PURE__ */ f("div", { class: "IncodeFlow", children: /* @__PURE__ */ f(
408
- M,
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__ */ f("div", { class: "IncodeFlow", children: /* @__PURE__ */ f(
418
- M,
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__ */ f("div", { class: "IncodeFlow", children: /* @__PURE__ */ f("div", { children: [
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: p } = r;
435
- if (!i || !p)
436
- return /* @__PURE__ */ f("div", { class: "IncodeFlow", children: /* @__PURE__ */ f(
437
- M,
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 (d.status === "unsupported")
446
- return /* @__PURE__ */ f("div", { class: "IncodeFlow", children: /* @__PURE__ */ f(
447
- re,
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 (d.status === "idle" || d.status === "loading" || d.status === "error")
454
- return /* @__PURE__ */ f("div", { class: "IncodeFlow", children: /* @__PURE__ */ f(
455
- M,
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 } = d;
466
+ const { Component: c } = f;
464
467
  if (i === "SELFIE")
465
- return /* @__PURE__ */ f("div", { class: "IncodeFlow", children: /* @__PURE__ */ f(
468
+ return /* @__PURE__ */ u("div", { class: "IncodeFlow", children: /* @__PURE__ */ u(
466
469
  c,
467
470
  {
468
- config: p,
471
+ config: h,
469
472
  onFinish: () => o.completeModule(),
470
- onError: (u) => {
471
- n?.(u ?? "Selfie verification error");
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__ */ f("div", { class: "IncodeFlow", children: /* @__PURE__ */ f(
480
+ return /* @__PURE__ */ u("div", { class: "IncodeFlow", children: /* @__PURE__ */ u(
478
481
  c,
479
482
  {
480
- config: p,
483
+ config: h,
481
484
  onFinish: () => o.completeModule(),
482
- onError: (u) => {
483
- n?.(u ?? "Phone verification error");
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 l = p;
490
- return !l || typeof l.otpVerification != "boolean" || typeof l.otpExpirationInMinutes != "number" ? /* @__PURE__ */ f("div", { class: "IncodeFlow", children: /* @__PURE__ */ f("div", { children: "Error: Invalid email configuration" }) }) : /* @__PURE__ */ f("div", { class: "IncodeFlow", children: /* @__PURE__ */ f(
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
- ...l,
495
- prefill: l.prefill ?? !1
497
+ ...a,
498
+ prefill: a.prefill ?? !1
496
499
  },
497
500
  onFinish: () => o.completeModule(),
498
- onError: (u) => {
499
- n?.(u ?? "Email verification error");
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 l = p, u = new W();
508
- return /* @__PURE__ */ f("div", { class: "IncodeFlow", children: /* @__PURE__ */ f(
510
+ const a = h, d = new W();
511
+ return /* @__PURE__ */ u("div", { class: "IncodeFlow", children: /* @__PURE__ */ u(
509
512
  c,
510
513
  {
511
- config: l,
512
- provider: u,
514
+ config: a,
515
+ provider: d,
513
516
  onFinish: () => o.completeModule(),
514
- onError: (h) => {
515
- n?.(h ?? "ID capture error");
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
- }, ae = ({
543
+ }, le = ({
524
544
  config: e,
525
545
  onFinish: t = () => {
526
546
  },
527
547
  onError: n
528
- }) => /* @__PURE__ */ f("div", { class: "IncodeComponent", children: e ? /* @__PURE__ */ f(
529
- ie,
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
- O(ae, "incode-flow");
556
+ _(le, "incode-flow");
537
557
  export {
538
- ae as IncodeFlow,
539
- be as preloadIncodeFlow
558
+ le as IncodeFlow,
559
+ ye as preloadIncodeFlow
540
560
  };