@incodetech/web 0.0.0-dev-20260330-e91ed6b → 0.0.0-dev-20260331-a4ec4fe

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,62 +1,62 @@
1
- import { u as t, c as T, b as D, S as W } from "./button-B2Ewo0rX.js";
2
- import { D as w, y as h, d as B, A as C, q as $, k as R, P as _, z as A, T as E } from "./vendor-preact-BoMmvSgn.js";
1
+ import { u as t, c as A, b as w, S as W } from "./button-B2Ewo0rX.js";
2
+ import { D as N, y as h, d as B, A as g, q as $, k as R, P as _, z as k, T as E } from "./vendor-preact-BoMmvSgn.js";
3
3
  import { E as M } from "./errorIcon-C-Zd24vb.js";
4
4
  import { S as G } from "./successIcon-DyHNp_UT.js";
5
5
  import "./uiConfig-DmIn-g8M.js";
6
6
  import { b as L, a as S, c as V, C as j } from "./captureFooter-B_3eu8kq.js";
7
7
  import { L as q } from "./manualCaptureButton-CUq6VXLb.js";
8
- const K = w(
9
- (r, a) => {
10
- const { class: e, rows: i = 4, ...n } = r;
8
+ const K = N(
9
+ (e, a) => {
10
+ const { class: r, rows: i = 4, ...n } = e;
11
11
  return /* @__PURE__ */ t(
12
12
  "textarea",
13
13
  {
14
14
  ...n,
15
15
  ref: a,
16
16
  rows: i,
17
- class: T("IncodeTextArea", e)
17
+ class: A("IncodeTextArea", r)
18
18
  }
19
19
  );
20
20
  }
21
- ), U = w(
21
+ ), U = N(
22
22
  ({
23
- id: r,
23
+ id: e,
24
24
  label: a,
25
- "aria-label": e,
25
+ "aria-label": r,
26
26
  error: i,
27
27
  showErrorIcon: n,
28
28
  helper: o,
29
29
  showHelperIcon: l,
30
- required: u,
31
- rows: p = 4,
32
- class: f,
30
+ required: d,
31
+ rows: u = 4,
32
+ class: p,
33
33
  ...b
34
- }, c) => {
35
- const v = `${r}-helper`, m = `${r}-error`, g = [o ? v : null, i ? m : null].filter(Boolean).join(" ");
36
- return /* @__PURE__ */ t("div", { class: T("IncodeTextAreaComposed", f), children: [
34
+ }, s) => {
35
+ const f = `${e}-helper`, v = `${e}-error`, T = [o ? f : null, i ? v : null].filter(Boolean).join(" ");
36
+ return /* @__PURE__ */ t("div", { class: A("IncodeTextAreaComposed", p), children: [
37
37
  a && /* @__PURE__ */ t(
38
38
  "label",
39
39
  {
40
40
  class: "IncodeTextAreaComposedLabel",
41
- htmlFor: r,
42
- "data-testid": `${r}-label`,
41
+ htmlFor: e,
42
+ "data-testid": `${e}-label`,
43
43
  children: [
44
44
  a,
45
- u && /* @__PURE__ */ t("span", { class: "IncodeTextAreaComposedRequired", children: " *" })
45
+ d && /* @__PURE__ */ t("span", { class: "IncodeTextAreaComposedRequired", children: " *" })
46
46
  ]
47
47
  }
48
48
  ),
49
49
  /* @__PURE__ */ t("div", { class: "IncodeTextAreaComposedWrapper", children: /* @__PURE__ */ t(
50
50
  K,
51
51
  {
52
- id: r,
53
- rows: p,
52
+ id: e,
53
+ rows: u,
54
54
  ...b,
55
- ref: c,
56
- required: u,
57
- ...!a && e ? { "aria-label": e } : {},
58
- "aria-describedby": g || void 0,
59
- "aria-required": u ? "true" : void 0,
55
+ ref: s,
56
+ required: d,
57
+ ...!a && r ? { "aria-label": r } : {},
58
+ "aria-describedby": T || void 0,
59
+ "aria-required": d ? "true" : void 0,
60
60
  "aria-invalid": i ? "true" : void 0
61
61
  }
62
62
  ) }),
@@ -64,10 +64,10 @@ const K = w(
64
64
  "div",
65
65
  {
66
66
  class: "IncodeTextAreaComposedErrorWrapper",
67
- "data-testid": `${r}-error-wrapper`,
67
+ "data-testid": `${e}-error-wrapper`,
68
68
  children: [
69
69
  n && /* @__PURE__ */ t("div", { class: "IncodeTextAreaComposedIconWrapper", children: /* @__PURE__ */ t(M, { size: 17 }) }),
70
- /* @__PURE__ */ t("p", { id: m, class: "IncodeTextAreaComposedError", children: i })
70
+ /* @__PURE__ */ t("p", { id: v, class: "IncodeTextAreaComposedError", children: i })
71
71
  ]
72
72
  }
73
73
  ),
@@ -75,10 +75,10 @@ const K = w(
75
75
  "div",
76
76
  {
77
77
  class: "IncodeTextAreaComposedHelperWrapper",
78
- "data-testid": `${r}-helper-wrapper`,
78
+ "data-testid": `${e}-helper-wrapper`,
79
79
  children: [
80
80
  l && /* @__PURE__ */ t("div", { class: "IncodeTextAreaComposedIconWrapper", children: /* @__PURE__ */ t(G, { size: 17 }) }),
81
- /* @__PURE__ */ t("p", { id: v, class: "IncodeTextAreaComposedHelper", children: o })
81
+ /* @__PURE__ */ t("p", { id: f, class: "IncodeTextAreaComposedHelper", children: o })
82
82
  ]
83
83
  }
84
84
  )
@@ -86,7 +86,7 @@ const K = w(
86
86
  }
87
87
  );
88
88
  U.displayName = "TextAreaComposed";
89
- const I = /* @__PURE__ */ new Map();
89
+ const m = /* @__PURE__ */ new Map();
90
90
  let P = !1;
91
91
  const y = {
92
92
  blur: () => import("./blurdevicelottie-_BZRug1c.js"),
@@ -95,15 +95,15 @@ const y = {
95
95
  front: () => import("./frontdevicelottie-KhKxT5n9.js"),
96
96
  back: () => import("./backdevicelottie-B4NgyWmX.js")
97
97
  };
98
- function O(r) {
98
+ function O(e) {
99
99
  P || (P = !0, Promise.all([
100
100
  y.blur(),
101
101
  y.glare(),
102
102
  y.align(),
103
103
  y.front(),
104
104
  y.back()
105
- ]).then(([a, e, i, n, o]) => {
106
- I.set("blur", a.default), I.set("glare", e.default), I.set("align", i.default), I.set("front", n.default), I.set("back", o.default), r?.();
105
+ ]).then(([a, r, i, n, o]) => {
106
+ m.set("blur", a.default), m.set("glare", r.default), m.set("align", i.default), m.set("front", n.default), m.set("back", o.default), e?.();
107
107
  }).catch(() => {
108
108
  }));
109
109
  }
@@ -115,104 +115,95 @@ function Q() {
115
115
  J();
116
116
  }, []);
117
117
  }
118
- function X(r, a) {
119
- const { t: e } = D(), [, i] = B(0);
118
+ function X(e, a) {
119
+ const { t: r } = w(), [, i] = B(0);
120
120
  if (h(() => {
121
121
  O(() => i((n) => n + 1));
122
- }, []), r === "blur")
122
+ }, []), e === "blur")
123
123
  return {
124
- title: e("idv2.capture.notifications.blur.title"),
125
- description: e("idv2.capture.notifications.blur.description"),
126
- animationData: I.get("blur") ?? null
124
+ title: r("idv2.capture.notifications.blur.title"),
125
+ description: r("idv2.capture.notifications.blur.description"),
126
+ animationData: m.get("blur") ?? null
127
127
  };
128
- if (r === "glare")
128
+ if (e === "glare")
129
129
  return {
130
- title: e("idv2.capture.notifications.glare.title"),
131
- description: e("idv2.capture.notifications.glare.description"),
132
- animationData: I.get("glare") ?? null
130
+ title: r("idv2.capture.notifications.glare.title"),
131
+ description: r("idv2.capture.notifications.glare.description"),
132
+ animationData: m.get("glare") ?? null
133
133
  };
134
- if (r === "farAway")
134
+ if (e === "farAway")
135
135
  return {
136
- title: e("idv2.capture.notifications.notAligned.title"),
137
- description: e("idv2.capture.notifications.notAligned.description"),
138
- animationData: I.get("align") ?? null
136
+ title: r("idv2.capture.notifications.notAligned.title"),
137
+ description: r("idv2.capture.notifications.notAligned.description"),
138
+ animationData: m.get("align") ?? null
139
139
  };
140
- if (r === "wrongSide") {
140
+ if (e === "wrongSide") {
141
141
  const n = a === "back";
142
142
  return {
143
- title: e(n ? "idv2.capture.notifications.showBack.title" : "idv2.capture.notifications.showFront.title"),
144
- description: e(n ? "idv2.capture.notifications.showBack.description" : "idv2.capture.notifications.showFront.description"),
145
- animationData: I.get(n ? "back" : "front") ?? null
143
+ title: r(n ? "idv2.capture.notifications.showBack.title" : "idv2.capture.notifications.showFront.title"),
144
+ description: r(n ? "idv2.capture.notifications.showBack.description" : "idv2.capture.notifications.showFront.description"),
145
+ animationData: m.get(n ? "back" : "front") ?? null
146
146
  };
147
147
  }
148
148
  return null;
149
149
  }
150
150
  const Y = ({
151
- detectionStatus: r,
151
+ detectionStatus: e,
152
152
  mode: a,
153
- isCapturing: e
153
+ isCapturing: r
154
154
  }) => {
155
- const { t: i } = D(), n = X(r, a), o = C(null), l = C({
155
+ const { t: i } = w(), n = X(e, a), o = g(null), l = g({
156
156
  message: "",
157
157
  at: 0
158
- }), u = C(r), p = C(!1), f = C(), b = C(), c = r === "detecting" || r === "idNotDetected" || r === "manualCapture", v = r === "manualCapture", m = r === "wrongSide", g = r === "farAway", k = r === "glare", H = r === "blur", s = $((d) => {
159
- const x = Date.now(), N = l.current;
160
- if (d === N.message && x - N.at < 200) return;
161
- l.current = { message: d, at: x };
162
- const z = o.current;
163
- z && (clearTimeout(f.current), z.textContent = "", b.current = setTimeout(() => {
164
- z.textContent = d, f.current = setTimeout(() => {
165
- z.textContent = "";
158
+ }), d = g(e), u = g(!1), p = g(), b = g(), s = e === "detecting" || e === "idNotDetected" || e === "manualCapture", f = e === "manualCapture", v = e === "wrongSide", T = e === "farAway", H = e === "glare", F = e === "blur", I = $((c) => {
159
+ const z = Date.now(), D = l.current;
160
+ if (c === D.message && z - D.at < 200) return;
161
+ l.current = { message: c, at: z };
162
+ const C = o.current;
163
+ C && (clearTimeout(p.current), C.textContent = "", b.current = setTimeout(() => {
164
+ C.textContent = c, p.current = setTimeout(() => {
165
+ C.textContent = "";
166
166
  }, 3e3);
167
167
  }, 50));
168
- }, []), F = $(() => i(a === "passport" ? "idv2.capture.fillFramePassport" : a === "back" ? "idv2.capture.v2.fillFrameBack" : "idv2.capture.v2.fillFrameFront"), [a, i]);
168
+ }, []), x = $(() => i(a === "passport" ? "idv2.capture.fillFramePassport" : a === "back" ? "idv2.capture.v2.fillFrameBack" : "idv2.capture.v2.fillFrameFront"), [a, i]);
169
169
  return h(() => {
170
- if (v) {
171
- p.current = !1;
170
+ if (f) {
171
+ u.current = !1;
172
172
  return;
173
173
  }
174
- if (p.current || !c) return;
175
- const d = setTimeout(() => {
176
- p.current = !0, s(F());
174
+ if (u.current || !s) return;
175
+ const c = setTimeout(() => {
176
+ u.current = !0, I(x());
177
177
  }, 500);
178
- return () => clearTimeout(d);
179
- }, [c, v, s, F]), h(() => {
180
- const d = u.current;
181
- u.current = r, d !== "manualCapture" && v && s(i("idv2.capture.manualCapture.modeSwitchAriaAnnouncement"));
182
- }, [s, r, v, i]), h(() => {
183
- if (!e) {
184
- if (m) {
185
- const x = a === "front" || a === "passport" ? "idv2.capture.notifications.showFront" : "idv2.capture.notifications.showBack";
186
- s(`${i(`${x}.title`)}. ${i(`${x}.description`)}`);
187
- return;
188
- }
189
- if (g) {
190
- s(`${i("idv2.capture.notifications.notAligned.title")}.`);
191
- return;
192
- }
193
- if (k) {
194
- s(`${i("idv2.capture.notifications.glare.title")}.`);
195
- return;
196
- }
197
- if (H) {
198
- s(`${i("idv2.capture.notifications.blur.title")}.`);
199
- return;
200
- }
201
- c && p.current && s(F());
202
- }
178
+ return () => clearTimeout(c);
179
+ }, [s, f, I, x]), h(() => {
180
+ const c = d.current;
181
+ d.current = e, c !== "manualCapture" && f && I(i("idv2.capture.manualCapture.modeSwitchAriaAnnouncement"));
182
+ }, [I, e, f, i]), h(() => {
183
+ if (r) return;
184
+ let c;
185
+ if (v) {
186
+ const C = a === "front" || a === "passport" ? "idv2.capture.notifications.showFront" : "idv2.capture.notifications.showBack";
187
+ c = `${i(`${C}.title`)}. ${i(`${C}.description`)}`;
188
+ } else T ? c = `${i("idv2.capture.notifications.notAligned.title")}.` : H ? c = `${i("idv2.capture.notifications.glare.title")}.` : F ? c = `${i("idv2.capture.notifications.blur.title")}.` : s && u.current && (c = x());
189
+ if (!c) return;
190
+ const z = setTimeout(() => {
191
+ I(c);
192
+ }, 500);
193
+ return () => clearTimeout(z);
203
194
  }, [
204
- s,
195
+ I,
196
+ F,
197
+ r,
198
+ T,
205
199
  H,
206
- e,
207
- g,
208
- k,
209
- c,
210
- m,
200
+ s,
201
+ v,
211
202
  a,
212
203
  i,
213
- F
204
+ x
214
205
  ]), h(() => () => {
215
- clearTimeout(b.current), clearTimeout(f.current);
206
+ clearTimeout(b.current), clearTimeout(p.current);
216
207
  }, []), /* @__PURE__ */ t(R, { children: [
217
208
  /* @__PURE__ */ t(
218
209
  "div",
@@ -223,8 +214,8 @@ const Y = ({
223
214
  "aria-atomic": "true"
224
215
  }
225
216
  ),
226
- n ? /* @__PURE__ */ t("div", { class: T("IncodeIdCaptureNotification"), "aria-hidden": "true", children: /* @__PURE__ */ t("div", { class: "IncodeIdCaptureNotificationContent", children: [
227
- /* @__PURE__ */ t("div", { class: T("IncodeIdCaptureNotificationText"), children: [
217
+ n ? /* @__PURE__ */ t("div", { class: A("IncodeIdCaptureNotification"), "aria-hidden": "true", children: /* @__PURE__ */ t("div", { class: "IncodeIdCaptureNotificationContent", children: [
218
+ /* @__PURE__ */ t("div", { class: A("IncodeIdCaptureNotificationText"), children: [
228
219
  /* @__PURE__ */ t("div", { class: "IncodeIdCaptureNotificationTitle", children: n.title }),
229
220
  n.description && /* @__PURE__ */ t("div", { class: "IncodeIdCaptureNotificationDescription", children: n.description })
230
221
  ] }),
@@ -232,17 +223,17 @@ const Y = ({
232
223
  n.animationData && /* @__PURE__ */ t("div", { class: "IncodeIdCaptureNotificationAnimation", children: /* @__PURE__ */ t(q, { animationData: n.animationData, loop: !0 }) })
233
224
  ] }) }) : null
234
225
  ] });
235
- }, Z = A(
226
+ }, Z = k(
236
227
  () => import("./front-horizontal-hint-lRLKd7vY.js")
237
- ), tt = A(
228
+ ), tt = k(
238
229
  () => import("./front-vertical-hint-qQoJXRE3.js")
239
- ), rt = A(
230
+ ), et = k(
240
231
  () => import("./back-horizontal-hint-CSlf9KI1.js")
241
- ), et = A(
232
+ ), rt = k(
242
233
  () => import("./back-vertical-hint-CNieqiCr.js")
243
- ), it = A(
234
+ ), it = k(
244
235
  () => import("./passport-horizontal-hint-BCtpMp1Y.js")
245
- ), nt = A(
236
+ ), nt = k(
246
237
  () => import("./passport-vertical-hint-GaLnzqHP.js")
247
238
  ), at = {
248
239
  "front-horizontal": 348,
@@ -253,98 +244,98 @@ const Y = ({
253
244
  "back-vertical": 446,
254
245
  "passport-vertical": 342
255
246
  };
256
- function ct(r, a, e, i) {
257
- const n = `${r}-${a}`, o = at[n];
258
- if (o) return e / o;
247
+ function ct(e, a, r, i) {
248
+ const n = `${e}-${a}`, o = at[n];
249
+ if (o) return r / o;
259
250
  const l = ot[n];
260
251
  return l ? i / l : 1;
261
252
  }
262
- const lt = ({ mode: r, orientation: a }) => {
263
- const e = C(null), [i, n] = B(1);
253
+ const st = ({ mode: e, orientation: a }) => {
254
+ const r = g(null), [i, n] = B(1);
264
255
  h(() => {
265
- const l = e.current;
256
+ const l = r.current;
266
257
  if (!l) return;
267
- const u = () => {
258
+ const d = () => {
268
259
  n(
269
- ct(r, a, l.clientWidth, l.clientHeight)
260
+ ct(e, a, l.clientWidth, l.clientHeight)
270
261
  );
271
262
  };
272
- u();
273
- const p = new ResizeObserver(u);
274
- return p.observe(l), () => p.disconnect();
275
- }, [r, a]);
276
- const o = () => r === "front" ? a === "horizontal" ? /* @__PURE__ */ t(Z, {}) : /* @__PURE__ */ t(tt, {}) : r === "back" ? a === "horizontal" ? /* @__PURE__ */ t(rt, {}) : /* @__PURE__ */ t(et, {}) : r === "passport" ? a === "horizontal" ? /* @__PURE__ */ t(it, {}) : /* @__PURE__ */ t(nt, {}) : null;
263
+ d();
264
+ const u = new ResizeObserver(d);
265
+ return u.observe(l), () => u.disconnect();
266
+ }, [e, a]);
267
+ const o = () => e === "front" ? a === "horizontal" ? /* @__PURE__ */ t(Z, {}) : /* @__PURE__ */ t(tt, {}) : e === "back" ? a === "horizontal" ? /* @__PURE__ */ t(et, {}) : /* @__PURE__ */ t(rt, {}) : e === "passport" ? a === "horizontal" ? /* @__PURE__ */ t(it, {}) : /* @__PURE__ */ t(nt, {}) : null;
277
268
  return /* @__PURE__ */ t(
278
269
  "div",
279
270
  {
280
- ref: e,
271
+ ref: r,
281
272
  class: "IncodeIdHint",
282
273
  "aria-hidden": "true",
283
274
  role: "presentation",
284
275
  children: /* @__PURE__ */ t("div", { class: "IncodeIdHintAnimated", children: /* @__PURE__ */ t(_, { fallback: null, children: /* @__PURE__ */ t("div", { class: "IncodeIdHintSvg", style: { transform: `scale(${i})` }, children: o() }) }) })
285
276
  }
286
277
  );
287
- }, It = w(
278
+ }, It = N(
288
279
  ({
289
- mode: r,
280
+ mode: e,
290
281
  orientation: a,
291
- detectionStatus: e,
282
+ detectionStatus: r,
292
283
  counterValue: i,
293
284
  isCapturing: n,
294
285
  showManualCapture: o,
295
286
  onCapture: l,
296
- onOpenHelp: u,
297
- helpButtonRef: p,
298
- captureButtonRef: f
287
+ onOpenHelp: d,
288
+ helpButtonRef: u,
289
+ captureButtonRef: p
299
290
  }, b) => {
300
- const { t: c } = D();
291
+ const { t: s } = w();
301
292
  Q(), h(() => {
302
- o && f && f.current?.focus();
303
- }, [o, f]);
304
- const v = () => n || e === "capturing" ? "capturing" : e === "blur" || e === "glare" || e === "wrongSide" || e === "farAway" ? "error" : "idle", m = E(() => {
305
- if (n || e === "capturing")
293
+ o && p && p.current?.focus();
294
+ }, [o, p]);
295
+ const f = () => n || r === "capturing" ? "capturing" : r === "blur" || r === "glare" || r === "wrongSide" || r === "farAway" ? "error" : "idle", v = E(() => {
296
+ if (n || r === "capturing")
306
297
  return {
307
- title: c("idv2.capture.takingPhoto"),
308
- subtitle: c("idv2.capture.dontMove")
298
+ title: s("idv2.capture.takingPhoto"),
299
+ subtitle: s("idv2.capture.dontMove")
309
300
  };
310
- if (e === "detecting" || e === "idNotDetected" || e === "manualCapture") {
311
- const d = e === "manualCapture";
312
- return r === "passport" ? {
313
- title: c("idv2.capture.fillFramePassport"),
314
- subtitle: d ? "" : c("idv2.capture.v2.autoCapture")
315
- } : r === "back" ? {
316
- title: c("idv2.capture.v2.fillFrameBack"),
317
- subtitle: d ? "" : c("idv2.capture.v2.autoCapture")
301
+ if (r === "detecting" || r === "idNotDetected" || r === "manualCapture") {
302
+ const c = r === "manualCapture";
303
+ return e === "passport" ? {
304
+ title: s("idv2.capture.fillFramePassport"),
305
+ subtitle: c ? "" : s("idv2.capture.v2.autoCapture")
306
+ } : e === "back" ? {
307
+ title: s("idv2.capture.v2.fillFrameBack"),
308
+ subtitle: c ? "" : s("idv2.capture.v2.autoCapture")
318
309
  } : {
319
- title: c("idv2.capture.v2.fillFrameFront"),
320
- subtitle: d ? "" : c("idv2.capture.v2.autoCapture")
310
+ title: s("idv2.capture.v2.fillFrameFront"),
311
+ subtitle: c ? "" : s("idv2.capture.v2.autoCapture")
321
312
  };
322
313
  }
323
314
  return null;
324
- }, [n, e, r, c]), g = v(), k = r === "passport", H = a !== "vertical" || k, s = H ? "horizontal" : "vertical";
315
+ }, [n, r, e, s]), T = f(), H = e === "passport", F = a !== "vertical" || H, I = F ? "horizontal" : "vertical";
325
316
  return /* @__PURE__ */ t(
326
317
  j,
327
318
  {
328
- className: T(
319
+ className: A(
329
320
  "IncodeCaptureOverlayId",
330
- !H && "IncodeCaptureOverlayVertical"
321
+ !F && "IncodeCaptureOverlayVertical"
331
322
  ),
332
323
  children: [
333
324
  /* @__PURE__ */ t("div", { class: "IncodeCaptureTopSection", children: [
334
325
  /* @__PURE__ */ t(
335
326
  Y,
336
327
  {
337
- detectionStatus: e,
338
- mode: r,
328
+ detectionStatus: r,
329
+ mode: e,
339
330
  isCapturing: n
340
331
  }
341
332
  ),
342
333
  /* @__PURE__ */ t(
343
334
  L,
344
335
  {
345
- title: m?.title ?? "",
346
- subtitle: m?.subtitle,
347
- visible: m !== null,
336
+ title: v?.title ?? "",
337
+ subtitle: v?.subtitle,
338
+ visible: v !== null,
348
339
  titleId: "id-capture-heading"
349
340
  }
350
341
  )
@@ -354,12 +345,12 @@ const lt = ({ mode: r, orientation: a }) => {
354
345
  {
355
346
  ref: b,
356
347
  variant: "locked",
357
- orientation: s,
358
- frameState: g,
359
- className: T(k && "IncodeCaptureFramePassport"),
348
+ orientation: I,
349
+ frameState: T,
350
+ className: A(H && "IncodeCaptureFramePassport"),
360
351
  children: [
361
352
  n && i > 0 && /* @__PURE__ */ t("div", { class: "IncodeCaptureCounter", children: i }),
362
- e === "idNotDetected" && /* @__PURE__ */ t(lt, { mode: r, orientation: a ?? "horizontal" })
353
+ r === "idNotDetected" && /* @__PURE__ */ t(st, { mode: e, orientation: a ?? "horizontal" })
363
354
  ]
364
355
  }
365
356
  ),
@@ -367,11 +358,11 @@ const lt = ({ mode: r, orientation: a }) => {
367
358
  /* @__PURE__ */ t(
368
359
  V,
369
360
  {
370
- onOpenHelp: u,
361
+ onOpenHelp: d,
371
362
  onCapture: l,
372
363
  isManualCapture: o,
373
- helpButtonRef: p,
374
- captureButtonRef: f,
364
+ helpButtonRef: u,
365
+ captureButtonRef: p,
375
366
  captureAriaDescribedBy: o ? "manual-capture-tooltip" : void 0,
376
367
  children: o ? /* @__PURE__ */ t("div", { class: "IncodeIdManualCaptureTooltipContainer", children: /* @__PURE__ */ t(
377
368
  "div",
@@ -380,8 +371,8 @@ const lt = ({ mode: r, orientation: a }) => {
380
371
  role: "tooltip",
381
372
  class: "IncodeIdManualCaptureTooltip",
382
373
  children: /* @__PURE__ */ t("ol", { class: "IncodeIdManualCaptureTooltipList", children: [
383
- /* @__PURE__ */ t("li", { children: c("idv2.commonIssues.firstStep") }),
384
- /* @__PURE__ */ t("li", { children: c("idv2.commonIssues.secondStep") })
374
+ /* @__PURE__ */ t("li", { children: s("idv2.commonIssues.firstStep") }),
375
+ /* @__PURE__ */ t("li", { children: s("idv2.commonIssues.secondStep") })
385
376
  ] })
386
377
  }
387
378
  ) }) : null
@@ -1,9 +1,9 @@
1
- import { b as v, u as e, I as O, a as C, S as w, B as y } from "../button-B2Ewo0rX.js";
1
+ import { b, u as e, I as O, a as C, S as w, B as y } from "../button-B2Ewo0rX.js";
2
2
  import { createEmailManager as P } from "@incodetech/core/email";
3
- import { d as b, y as S } from "../vendor-preact-BoMmvSgn.js";
3
+ import { d as h, y as V } from "../vendor-preact-BoMmvSgn.js";
4
4
  import "@incodetech/core";
5
- import { O as V } from "../otpInput-CGlYkmvB.js";
6
- import { P as f } from "../page-DiscPBzz.js";
5
+ import { O as S } from "../otpInput-CGlYkmvB.js";
6
+ import { P as I } from "../page-DiscPBzz.js";
7
7
  import { r as k } from "../incodeModule-C4XIllao.js";
8
8
  import "../uiConfig-DmIn-g8M.js";
9
9
  import "../typography-zMrvftfB.js";
@@ -11,11 +11,11 @@ import { a as L } from "../inputComposed-CJQTXKNA.js";
11
11
  import "../checkbox-CXnQVsbJ.js";
12
12
  import "../phoneInputComposed-Dsf9ZDTj.js";
13
13
  import "../dateInputComposed-DmlHvCmR.js";
14
- import "../captureOverlay-CB8lyLgp.js";
14
+ import "../captureOverlay-rwQkQuBD.js";
15
15
  import "../manualCaptureButton-CUq6VXLb.js";
16
16
  import "../captureFooter-B_3eu8kq.js";
17
17
  import "../countries-DfLkrF0x.js";
18
- const I = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, R = ({
18
+ const v = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, R = ({
19
19
  prefilledEmail: i,
20
20
  emailError: s,
21
21
  label: m,
@@ -23,35 +23,35 @@ const I = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, R = ({
23
23
  required: n = !1,
24
24
  onEmailChange: t
25
25
  }) => {
26
- const { t: o } = v(), [g, p] = b("");
27
- S(() => {
26
+ const { t: r } = b(), [E, p] = h("");
27
+ V(() => {
28
28
  if (i) {
29
29
  p(i);
30
- const a = I.test(i.trim());
30
+ const a = v.test(i.trim());
31
31
  t(i.trim(), a);
32
32
  }
33
33
  }, [i, t]);
34
- const E = (a) => {
34
+ const f = (a) => {
35
35
  const d = a.target.value;
36
36
  p(d);
37
- const r = d.trim(), h = r.length > 0 && I.test(r);
38
- t(r, h);
39
- }, l = s ? "email-error" : void 0;
37
+ const l = d.trim(), g = l.length > 0 && v.test(l);
38
+ t(l, g);
39
+ }, o = s ? "email-error" : void 0;
40
40
  return /* @__PURE__ */ e("div", { class: "IncodeEmailInput", children: /* @__PURE__ */ e("div", { class: "IncodeEmailInputContainer", children: /* @__PURE__ */ e(
41
41
  L,
42
42
  {
43
43
  id: "email-input",
44
44
  type: "email",
45
- value: g,
46
- onInput: E,
47
- placeholder: o("email.placeholder"),
45
+ value: E,
46
+ onInput: f,
47
+ placeholder: r("email.placeholder"),
48
48
  disabled: u,
49
49
  required: n,
50
50
  label: m,
51
51
  "data-testid": "email-input",
52
52
  "aria-label": m ? void 0 : "Email address",
53
53
  "aria-invalid": s ? "true" : void 0,
54
- "aria-describedby": l || void 0,
54
+ "aria-describedby": o || void 0,
55
55
  autocomplete: "email",
56
56
  error: s,
57
57
  showErrorIcon: !0
@@ -63,7 +63,7 @@ const I = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, R = ({
63
63
  onFinish: m,
64
64
  onError: u
65
65
  }) => {
66
- const { t: n } = v(), [t, o] = C(
66
+ const { t: n } = b(), [t, r] = C(
67
67
  () => {
68
68
  if (s) return s;
69
69
  if (!i)
@@ -71,24 +71,24 @@ const I = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, R = ({
71
71
  return P({ config: i });
72
72
  },
73
73
  { manageLifecycle: !s }
74
- ), [g, p] = b(!1);
74
+ ), [E, p] = h(!1);
75
75
  if (t.status === "idle" || t.status === "loadingPrefill" || t.status === "inputting" || t.status === "submitting" || t.status === "sendingInitialOtp") {
76
- const l = t.status === "idle" || t.status === "loadingPrefill" || t.status === "submitting" || t.status === "sendingInitialOtp", a = t.status === "inputting" ? t.prefilledEmail : void 0, c = t.status === "inputting" && t.emailError ? n(t.emailError) : void 0;
76
+ const o = t.status === "idle" || t.status === "loadingPrefill" || t.status === "submitting" || t.status === "sendingInitialOtp", a = t.status === "inputting" ? t.prefilledEmail : void 0, c = t.status === "inputting" && t.emailError ? n(t.emailError) : void 0, d = t.status === "inputting" ? t.otpVerification ?? !1 : !1;
77
77
  return /* @__PURE__ */ e(
78
- f,
78
+ I,
79
79
  {
80
80
  className: "IncodeEmailPage",
81
81
  title: n("otp.enterCodeEmail"),
82
- subtitle: i.otpVerification ? n("email.willSendCode") : void 0,
82
+ subtitle: d ? n("email.willSendCode") : void 0,
83
83
  children: [
84
84
  /* @__PURE__ */ e(
85
85
  R,
86
86
  {
87
87
  prefilledEmail: a,
88
88
  emailError: c,
89
- disabled: l,
90
- onEmailChange: (d, r) => {
91
- o.setEmail(d, r), p(r);
89
+ disabled: o,
90
+ onEmailChange: (l, g) => {
91
+ r.setEmail(l, g), p(g);
92
92
  }
93
93
  }
94
94
  ),
@@ -96,9 +96,9 @@ const I = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, R = ({
96
96
  /* @__PURE__ */ e(
97
97
  y,
98
98
  {
99
- onClick: () => o.submit(),
100
- disabled: !g,
101
- isLoading: l,
99
+ onClick: () => r.submit(),
100
+ disabled: !E,
101
+ isLoading: o,
102
102
  "data-testid": "email-submit",
103
103
  children: n("common.continue")
104
104
  }
@@ -108,23 +108,23 @@ const I = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, R = ({
108
108
  );
109
109
  }
110
110
  if (t.status === "awaitingOtp" || t.status === "verifyingOtp" || t.status === "otpError" || t.status === "resendingOtp") {
111
- const l = t.status === "verifyingOtp", a = t.status === "otpError", c = t.status === "awaitingOtp", d = t.status === "resendingOtp";
111
+ const o = t.status === "verifyingOtp", a = t.status === "otpError", c = t.status === "awaitingOtp", d = t.status === "resendingOtp";
112
112
  return /* @__PURE__ */ e(
113
- f,
113
+ I,
114
114
  {
115
115
  className: "IncodeEmailPage IncodeEmailOtpPage",
116
116
  title: n("otp.enterCodeEmail"),
117
117
  children: /* @__PURE__ */ e(
118
- V,
118
+ S,
119
119
  {
120
120
  resendTimer: c || a ? t.resendTimer : 0,
121
121
  canResend: c || a ? t.canResend : !1,
122
122
  error: a ? n(t.otpError) : void 0,
123
- isLoading: l,
124
- disabled: d || l,
125
- onSubmit: (r) => o.submitOtp(r),
126
- onResend: () => o.resendOtp(),
127
- onBack: () => o.back(),
123
+ isLoading: o,
124
+ disabled: d || o,
125
+ onSubmit: (l) => r.submitOtp(l),
126
+ onResend: () => r.resendOtp(),
127
+ onBack: () => r.back(),
128
128
  backLinkText: "otp.changeEmail"
129
129
  }
130
130
  )
@@ -137,7 +137,7 @@ const I = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, R = ({
137
137
  manager: s,
138
138
  onFinish: m,
139
139
  onError: u
140
- }) => /* @__PURE__ */ e(O, { children: i ? /* @__PURE__ */ e(
140
+ }) => /* @__PURE__ */ e(O, { children: i || s ? /* @__PURE__ */ e(
141
141
  T,
142
142
  {
143
143
  config: i,
@@ -14,8 +14,8 @@ import { C as Y, a as Z } from "./checkbox-CXnQVsbJ.js";
14
14
  import { P as $ } from "./phoneInputComposed-Dsf9ZDTj.js";
15
15
  import { D as ra, S as ea } from "./dropdownComposed-DFrqye1c.js";
16
16
  import { C as ta, D as sa } from "./dateInputComposed-DmlHvCmR.js";
17
- import { T as pa, a as ca } from "./captureOverlay-CB8lyLgp.js";
18
- import { d as ua, C as ma, b as la, I as Ca, c as da, F as fa, T as Ia, S as xa, V as ha, a as ga } from "./flipAnimation-l8x6CJ9Q.js";
17
+ import { T as pa, a as ca } from "./captureOverlay-rwQkQuBD.js";
18
+ import { d as ua, C as ma, b as la, I as Ca, c as da, F as fa, T as Ia, S as xa, V as ha, a as ga } from "./flipAnimation-B48PXORR.js";
19
19
  import { L as Ta, M as va } from "./manualCaptureButton-CUq6VXLb.js";
20
20
  import { a as Ba, C as Fa, b as Pa, d as La, c as Oa, H as ba, L as Ha } from "./captureFooter-B_3eu8kq.js";
21
21
  import { A as i, y as u, q as m } from "./vendor-preact-BoMmvSgn.js";
@@ -7,7 +7,7 @@ import { P as A, C as z } from "./cameraView-CT9-WWcG.js";
7
7
  import { S as H } from "./spinner-DfUoOZN4.js";
8
8
  import { M as w, L as D } from "./manualCaptureButton-CUq6VXLb.js";
9
9
  import { L as G } from "./captureFooter-B_3eu8kq.js";
10
- import { C as N } from "./captureOverlay-CB8lyLgp.js";
10
+ import { C as N } from "./captureOverlay-rwQkQuBD.js";
11
11
  import { B as W } from "./permissions-DbPRF91z.js";
12
12
  import "@incodetech/core";
13
13
  import "./inputComposed-CJQTXKNA.js";
package/dist/id/id.es.js CHANGED
@@ -1,12 +1,12 @@
1
- import { u as r, I as u, a as m } from "../button-B2Ewo0rX.js";
2
- import { createIdCaptureManager as d } from "@incodetech/core/id";
3
- import { z as c, P as l } from "../vendor-preact-BoMmvSgn.js";
1
+ import { u as r, I as u, a as d } from "../button-B2Ewo0rX.js";
2
+ import { createIdCaptureManager as m } from "@incodetech/core/id";
3
+ import { z as c, P as p } from "../vendor-preact-BoMmvSgn.js";
4
4
  import "@incodetech/core";
5
- import { P as p } from "../permissions-DbPRF91z.js";
6
- import { r as f } from "../incodeModule-C4XIllao.js";
7
- import { P as C } from "../processing-De8XWnFp.js";
8
- import { b as g, T as h, F as a, C as I, c as y, I as F } from "../flipAnimation-l8x6CJ9Q.js";
9
- import "../captureOverlay-CB8lyLgp.js";
5
+ import { P as f } from "../permissions-DbPRF91z.js";
6
+ import { r as l } from "../incodeModule-C4XIllao.js";
7
+ import { P as h } from "../processing-De8XWnFp.js";
8
+ import { b as C, T as I, F as a, C as g, c as y, I as F } from "../flipAnimation-B48PXORR.js";
9
+ import "../captureOverlay-rwQkQuBD.js";
10
10
  import "../uiConfig-DmIn-g8M.js";
11
11
  import "../typography-zMrvftfB.js";
12
12
  const M = c(
@@ -19,25 +19,32 @@ const M = c(
19
19
  onFinish: o,
20
20
  onError: i
21
21
  }) => {
22
- const [t, n] = m(
23
- () => e ?? d({ config: s }),
22
+ const [t, n] = d(
23
+ () => {
24
+ if (e) return e;
25
+ if (!s)
26
+ throw new Error(
27
+ "ID capture config is required when no manager is provided"
28
+ );
29
+ return m({ config: s });
30
+ },
24
31
  { manageLifecycle: !e }
25
32
  );
26
- return t.status === "idle" || t.status === "loading" ? null : t.status === "chooser" ? /* @__PURE__ */ r(g, { manager: n, state: t }) : t.status === "tutorial" ? /* @__PURE__ */ r(h, { manager: n, state: t }) : t.status === "permissions" ? /* @__PURE__ */ r(
27
- p,
33
+ return t.status === "idle" || t.status === "loading" ? null : t.status === "chooser" ? /* @__PURE__ */ r(C, { manager: n, state: t }) : t.status === "tutorial" ? /* @__PURE__ */ r(I, { manager: n, state: t }) : t.status === "permissions" ? /* @__PURE__ */ r(
34
+ f,
28
35
  {
29
36
  manager: n,
30
37
  permissionStatus: t.permissionStatus
31
38
  }
32
- ) : t.status === "frontFinished" ? /* @__PURE__ */ r(a, { manager: n, direction: "toBack" }) : t.status === "backFinished" ? /* @__PURE__ */ r(a, { manager: n, direction: "toFront" }) : t.status === "capture" ? /* @__PURE__ */ r(I, { manager: n, state: t, onFinish: () => o?.() }) : t.status === "mandatoryConsent" ? /* @__PURE__ */ r(l, { fallback: null, children: /* @__PURE__ */ r(
39
+ ) : t.status === "frontFinished" ? /* @__PURE__ */ r(a, { manager: n, direction: "toBack" }) : t.status === "backFinished" ? /* @__PURE__ */ r(a, { manager: n, direction: "toFront" }) : t.status === "capture" ? /* @__PURE__ */ r(g, { manager: n, state: t, onFinish: () => o?.() }) : t.status === "mandatoryConsent" ? /* @__PURE__ */ r(p, { fallback: null, children: /* @__PURE__ */ r(
33
40
  M,
34
41
  {
35
42
  config: { consentType: t.regulationType },
36
43
  onFinish: () => n.acceptMandatoryConsent(),
37
44
  onError: () => n.cancelMandatoryConsent()
38
45
  }
39
- ) }) : t.status === "processing" ? /* @__PURE__ */ r(C, {}) : t.status === "expired" ? /* @__PURE__ */ r(y, { manager: n }) : t.status === "finished" ? (o?.(), null) : t.status === "closed" ? (i?.(void 0), null) : t.status === "error" ? /* @__PURE__ */ r(F, { manager: n, state: t, onError: i }) : null;
40
- }, T = ({ config: s, manager: e, onFinish: o, onError: i }) => /* @__PURE__ */ r(u, { children: s ? /* @__PURE__ */ r(
46
+ ) }) : t.status === "processing" ? /* @__PURE__ */ r(h, {}) : t.status === "expired" ? /* @__PURE__ */ r(y, { manager: n }) : t.status === "finished" ? (o?.(), null) : t.status === "closed" ? (i?.(void 0), null) : t.status === "error" ? /* @__PURE__ */ r(F, { manager: n, state: t, onError: i }) : null;
47
+ }, E = ({ config: s, manager: e, onFinish: o, onError: i }) => /* @__PURE__ */ r(u, { children: s || e ? /* @__PURE__ */ r(
41
48
  P,
42
49
  {
43
50
  config: s,
@@ -46,7 +53,7 @@ const M = c(
46
53
  onError: i
47
54
  }
48
55
  ) : null });
49
- f(T, "incode-id");
56
+ l(E, "incode-id");
50
57
  export {
51
- T as Id
58
+ E as Id
52
59
  };
@@ -1,73 +1,73 @@
1
- import { u as e, I, b, a as O, S as h, B as C } from "../button-B2Ewo0rX.js";
2
- import { createPhoneManager as E } from "@incodetech/core/phone";
3
- import { d as v } from "../vendor-preact-BoMmvSgn.js";
1
+ import { u as e, I as O, b as C, a as E, S as f, B as v } from "../button-B2Ewo0rX.js";
2
+ import { createPhoneManager as S } from "@incodetech/core/phone";
3
+ import { d as w } from "../vendor-preact-BoMmvSgn.js";
4
4
  import "../uiConfig-DmIn-g8M.js";
5
5
  import "@incodetech/core";
6
- import { C as S } from "../checkbox-CXnQVsbJ.js";
7
- import { O as w } from "../otpInput-CGlYkmvB.js";
6
+ import { C as y } from "../checkbox-CXnQVsbJ.js";
7
+ import { O as k } from "../otpInput-CGlYkmvB.js";
8
8
  import { P as g } from "../page-DiscPBzz.js";
9
- import { P as y } from "../phoneInputComposed-Dsf9ZDTj.js";
10
- import { r as k } from "../incodeModule-C4XIllao.js";
11
- const R = ({
12
- config: n,
13
- manager: i,
14
- onFinish: p,
15
- onError: l
9
+ import { P as R } from "../phoneInputComposed-Dsf9ZDTj.js";
10
+ import { r as V } from "../incodeModule-C4XIllao.js";
11
+ const B = ({
12
+ config: i,
13
+ manager: s,
14
+ onFinish: d,
15
+ onError: p
16
16
  }) => {
17
- const { t: s } = b(), [t, o] = O(
17
+ const { t: n } = C(), [t, o] = E(
18
18
  () => {
19
- if (i) return i;
20
- if (!n)
19
+ if (s) return s;
20
+ if (!i)
21
21
  throw new Error("Phone config is required");
22
- return E({ config: n });
22
+ return S({ config: i });
23
23
  },
24
- { manageLifecycle: !i }
25
- ), [f, P] = v(!1);
24
+ { manageLifecycle: !s }
25
+ ), [P, b] = w(!1);
26
26
  if (t.status === "idle" || t.status === "loadingPrefill" || t.status === "inputting" || t.status === "submitting" || t.status === "sendingInitialOtp") {
27
- const r = t.status === "idle" || t.status === "loadingPrefill" || t.status === "submitting" || t.status === "sendingInitialOtp", a = t.status === "inputting" ? t.countryCode : "US", d = t.status === "inputting" ? t.prefilledPhone : void 0, c = t.status === "inputting" && t.phoneError ? s(t.phoneError) : void 0;
27
+ const r = t.status === "idle" || t.status === "loadingPrefill" || t.status === "submitting" || t.status === "sendingInitialOtp", a = t.status === "inputting" ? t.countryCode : "US", u = t.status === "inputting" ? t.prefilledPhone : void 0, l = t.status === "inputting" && t.phoneError ? n(t.phoneError) : void 0, c = t.status === "inputting" ? t.otpVerification ?? !1 : !1, I = t.status === "inputting" ? t.optinEnabled ?? !1 : !1;
28
28
  return /* @__PURE__ */ e(
29
29
  g,
30
30
  {
31
31
  className: "IncodePhonePage",
32
- title: s("phone.verify"),
33
- subtitle: n.otpVerification ? s("email.willSendCode") : void 0,
32
+ title: n("phone.verify"),
33
+ subtitle: c ? n("email.willSendCode") : void 0,
34
34
  children: [
35
35
  /* @__PURE__ */ e("div", { class: "IncodePhoneInputContainer", children: [
36
36
  /* @__PURE__ */ e(
37
- y,
37
+ R,
38
38
  {
39
39
  id: "phone",
40
40
  countryCode: a,
41
- value: d,
42
- error: c,
41
+ value: u,
42
+ error: l,
43
43
  disabled: r,
44
- onChange: (u, m) => {
45
- o.setPhoneNumber(u, m), P(m);
44
+ onChange: (m, h) => {
45
+ o.setPhoneNumber(m, h), b(h);
46
46
  },
47
47
  "data-testid": "phone-input",
48
48
  showErrorIcon: !0
49
49
  }
50
50
  ),
51
- /* @__PURE__ */ e(h, { size: 16 }),
52
- n.optinEnabled && /* @__PURE__ */ e(
53
- S,
51
+ /* @__PURE__ */ e(f, { size: 16 }),
52
+ I && /* @__PURE__ */ e(
53
+ y,
54
54
  {
55
55
  id: "phone-optin",
56
- label: s("phone.optIn"),
56
+ label: n("phone.optIn"),
57
57
  size: "s",
58
- onChange: (u) => o.setOptInGranted(u.target.checked)
58
+ onChange: (m) => o.setOptInGranted(m.target.checked)
59
59
  }
60
60
  )
61
61
  ] }),
62
- /* @__PURE__ */ e(h, {}),
62
+ /* @__PURE__ */ e(f, {}),
63
63
  /* @__PURE__ */ e(
64
- C,
64
+ v,
65
65
  {
66
66
  onClick: () => o.submit(),
67
- disabled: !f,
67
+ disabled: !P,
68
68
  isLoading: r,
69
69
  "data-testid": "phone-submit",
70
- children: s("common.continue")
70
+ children: n("common.continue")
71
71
  }
72
72
  )
73
73
  ]
@@ -75,37 +75,37 @@ const R = ({
75
75
  );
76
76
  }
77
77
  if (t.status === "awaitingOtp" || t.status === "verifyingOtp" || t.status === "otpError" || t.status === "resendingOtp") {
78
- const r = t.status === "verifyingOtp", a = t.status === "otpError", d = t.status === "awaitingOtp", c = t.status === "resendingOtp";
79
- return /* @__PURE__ */ e(g, { className: "IncodePhonePage", title: s("otp.enterCodeSMS"), children: /* @__PURE__ */ e(
80
- w,
78
+ const r = t.status === "verifyingOtp", a = t.status === "otpError", u = t.status === "awaitingOtp", l = t.status === "resendingOtp";
79
+ return /* @__PURE__ */ e(g, { className: "IncodePhonePage", title: n("otp.enterCodeSMS"), children: /* @__PURE__ */ e(
80
+ k,
81
81
  {
82
- resendTimer: d || a ? t.resendTimer : 0,
83
- canResend: d || a ? t.canResend : !1,
82
+ resendTimer: u || a ? t.resendTimer : 0,
83
+ canResend: u || a ? t.canResend : !1,
84
84
  isLoading: r,
85
- disabled: c || r,
86
- error: a ? s(t.otpError) : void 0,
87
- onSubmit: (u) => o.submitOtp(u),
85
+ disabled: l || r,
86
+ error: a ? n(t.otpError) : void 0,
87
+ onSubmit: (c) => o.submitOtp(c),
88
88
  onResend: () => o.resendOtp(),
89
89
  onBack: () => o.back()
90
90
  }
91
91
  ) });
92
92
  }
93
- return t.status === "finished" ? (p?.(), null) : (t.status === "error" && l?.(t.error), null);
94
- }, B = ({
95
- config: n,
96
- manager: i,
97
- onFinish: p,
98
- onError: l
99
- }) => /* @__PURE__ */ e(I, { children: n ? /* @__PURE__ */ e(
100
- R,
93
+ return t.status === "finished" ? (d?.(), null) : (t.status === "error" && p?.(t.error), null);
94
+ }, L = ({
95
+ config: i,
96
+ manager: s,
97
+ onFinish: d,
98
+ onError: p
99
+ }) => /* @__PURE__ */ e(O, { children: i || s ? /* @__PURE__ */ e(
100
+ B,
101
101
  {
102
- config: n,
103
- manager: i,
104
- onFinish: p,
105
- onError: l
102
+ config: i,
103
+ manager: s,
104
+ onFinish: d,
105
+ onError: p
106
106
  }
107
107
  ) : null });
108
- k(B, "incode-phone");
108
+ V(L, "incode-phone");
109
109
  export {
110
- B as Phone
110
+ L as Phone
111
111
  };
@@ -1,4 +1,4 @@
1
- import { u as r, I as u, a } from "../button-B2Ewo0rX.js";
1
+ import { u as e, I as u, a } from "../button-B2Ewo0rX.js";
2
2
  import { createSelfieManager as l } from "@incodetech/core/selfie";
3
3
  import "../vendor-preact-BoMmvSgn.js";
4
4
  import "@incodetech/core";
@@ -7,32 +7,39 @@ import { r as f } from "../incodeModule-C4XIllao.js";
7
7
  import { P as p } from "../processing-De8XWnFp.js";
8
8
  import { T as c, C as d } from "../tutorial-BnO6iyLI.js";
9
9
  const g = ({
10
- config: e,
11
- manager: s,
10
+ config: s,
11
+ manager: t,
12
12
  onFinish: n,
13
13
  onError: i
14
14
  }) => {
15
- const [t, o] = a(
16
- () => s ?? l({ config: e }),
17
- { manageLifecycle: !s }
15
+ const [r, o] = a(
16
+ () => {
17
+ if (t) return t;
18
+ if (!s)
19
+ throw new Error(
20
+ "Selfie config is required when no manager is provided"
21
+ );
22
+ return l({ config: s });
23
+ },
24
+ { manageLifecycle: !t }
18
25
  );
19
- return t.status === "idle" || t.status === "loading" ? null : t.status === "tutorial" ? /* @__PURE__ */ r(c, { manager: o }) : t.status === "permissions" ? /* @__PURE__ */ r(
26
+ return r.status === "idle" || r.status === "loading" ? null : r.status === "tutorial" ? /* @__PURE__ */ e(c, { manager: o }) : r.status === "permissions" ? /* @__PURE__ */ e(
20
27
  m,
21
28
  {
22
29
  manager: o,
23
- permissionStatus: t.permissionStatus
30
+ permissionStatus: r.permissionStatus
24
31
  }
25
- ) : t.status === "capture" ? /* @__PURE__ */ r(d, { manager: o, state: t }) : t.status === "processing" ? /* @__PURE__ */ r(p, {}) : t.status === "finished" ? (n?.(), null) : t.status === "closed" ? (i?.(void 0), null) : (t.status === "error" && i?.(t.error), null);
32
+ ) : r.status === "capture" ? /* @__PURE__ */ e(d, { manager: o, state: r }) : r.status === "processing" ? /* @__PURE__ */ e(p, {}) : r.status === "finished" ? (n?.(), null) : r.status === "closed" ? (i?.(void 0), null) : (r.status === "error" && i?.(r.error), null);
26
33
  }, S = ({
27
- config: e,
28
- manager: s,
34
+ config: s,
35
+ manager: t,
29
36
  onFinish: n,
30
37
  onError: i
31
- }) => /* @__PURE__ */ r(u, { children: e ? /* @__PURE__ */ r(
38
+ }) => /* @__PURE__ */ e(u, { children: s || t ? /* @__PURE__ */ e(
32
39
  g,
33
40
  {
34
- config: e,
35
- manager: s,
41
+ config: s,
42
+ manager: t,
36
43
  onFinish: n,
37
44
  onError: i
38
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incodetech/web",
3
- "version": "0.0.0-dev-20260330-e91ed6b",
3
+ "version": "0.0.0-dev-20260331-a4ec4fe",
4
4
  "type": "module",
5
5
  "main": "./dist/index.es.js",
6
6
  "types": "./dist/types/index.d.ts",
@@ -136,7 +136,7 @@
136
136
  "preact-markup": "^2.1.1",
137
137
  "qrcode": "^1.5.4",
138
138
  "tailwindcss": "^4.1.17",
139
- "@incodetech/core": "0.0.0-dev-20260330-e91ed6b"
139
+ "@incodetech/core": "0.0.0-dev-20260331-a4ec4fe"
140
140
  },
141
141
  "devDependencies": {
142
142
  "@microsoft/api-extractor": "^7.53.3",
@@ -167,6 +167,7 @@
167
167
  },
168
168
  "scripts": {
169
169
  "dev": "vite --host",
170
+ "dev:http": "VITE_DEV_HTTPS=false vite --host",
170
171
  "dev:debug": "vite --host --no-open",
171
172
  "build:dev": "vite build --watch",
172
173
  "build": "vite build",