@baas-id/react 0.3.5 → 0.3.7

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.
Files changed (49) hide show
  1. package/README.md +27 -3
  2. package/dist/esm/baas-id-react.css +1 -1
  3. package/dist/esm/chunks/ContinueFlow-BzKnkzHf.js +11597 -0
  4. package/dist/esm/chunks/provider-DqpgUBfH.js +87 -0
  5. package/dist/esm/continue.js +11 -7
  6. package/dist/esm/index.js +156 -119
  7. package/dist/esm/native.js +91 -0
  8. package/dist/esm/preview.js +220 -181
  9. package/dist/types/continue.d.ts +3 -0
  10. package/dist/types/index.d.ts +10 -1
  11. package/dist/types/native.d.ts +38 -0
  12. package/dist/types/react/DocumentCapture.d.ts +1 -0
  13. package/dist/types/react/FingerCapture.d.ts +20 -0
  14. package/dist/types/react/capture/api.d.ts +53 -0
  15. package/dist/types/react/capture/camera.d.ts +1 -1
  16. package/dist/types/react/capture/demo.d.ts +10 -0
  17. package/dist/types/react/capture/index.d.ts +3 -2
  18. package/dist/types/react/capture/torch.d.ts +14 -0
  19. package/dist/types/react/chip/ChipRead.d.ts +21 -0
  20. package/dist/types/react/chip/capability.d.ts +11 -0
  21. package/dist/types/react/chip/evidence.d.ts +9 -0
  22. package/dist/types/react/chip/provider.d.ts +42 -0
  23. package/dist/types/react/chip/useChipRead.d.ts +32 -0
  24. package/dist/types/react/chip/webNfcPresence.d.ts +2 -0
  25. package/dist/types/react/document/DocumentParts.d.ts +1 -0
  26. package/dist/types/react/face/useFaceCapture.d.ts +6 -0
  27. package/dist/types/react/finger/FingerGuide.d.ts +14 -0
  28. package/dist/types/react/finger/detector.d.ts +39 -0
  29. package/dist/types/react/finger/qualityGate.d.ts +37 -0
  30. package/dist/types/react/finger/runFingerCapture.d.ts +77 -0
  31. package/dist/types/react/finger/upload.d.ts +10 -0
  32. package/dist/types/react/finger/useFingerCapture.d.ts +31 -0
  33. package/dist/types/react/flows/experience.d.ts +4 -0
  34. package/dist/types/react/flows/index.d.ts +1 -1
  35. package/dist/types/react/flows/renewal.d.ts +27 -0
  36. package/dist/types/react/flows/session.d.ts +5 -1
  37. package/dist/types/react/flows/state.d.ts +34 -2
  38. package/dist/types/react/flows/types.d.ts +57 -0
  39. package/dist/types/react/flows/useFlowSession.d.ts +12 -2
  40. package/dist/types/react/handoff/ContinueFlow.d.ts +6 -2
  41. package/dist/types/react/handoff/api.d.ts +3 -2
  42. package/dist/types/react/handoff/phoneLink.d.ts +2 -1
  43. package/dist/types/react/i18n/types.d.ts +40 -3
  44. package/dist/types/react/preview/FlowPreview.d.ts +1 -0
  45. package/dist/types/react/telemetry/bus.d.ts +1 -1
  46. package/dist/types/react/version.d.ts +1 -1
  47. package/dist/types/react/vision/resample.d.ts +7 -0
  48. package/package.json +6 -1
  49. package/dist/esm/chunks/ContinueFlow-C2PNt2ZN.js +0 -10122
@@ -1,100 +1,100 @@
1
1
  import "./baas-id-react.css";
2
- /* empty css */
3
- import { jsxs as R, jsx as p } from "react/jsx-runtime";
4
- import { useMemo as E, useRef as M, useState as W, useEffect as U } from "react";
5
- import { t as $, n as K, a as Q, m as Y, b as J, g as O, f as X, i as Z, c as ee, F as B, H as te, d as oe, e as ne, S as re, E as se, h as ie, j as ae, k as le, l as ce, o as L, p as de, q as H, s as fe, G, u as ue, v as pe, w as he, x as ye } from "./chunks/ContinueFlow-C2PNt2ZN.js";
6
- import { y as we, z as xe, A as De, B as Oe, I as Be, L as Le, J as Ne, K as Ue, N as He, O as Ge, P as je, Q as qe, R as Ve, T as ze } from "./chunks/ContinueFlow-C2PNt2ZN.js";
7
- function me(e) {
8
- let r = e >>> 0;
9
- return () => (r = r * 1664525 + 1013904223 >>> 0, r / 4294967296);
2
+ /* empty css */
3
+ import { jsxs as C, jsx as d } from "react/jsx-runtime";
4
+ import { useMemo as E, useRef as R, useState as z, useEffect as H } from "react";
5
+ import { t as $, n as K, a as Q, m as Y, b as J, g as B, f as X, d as Z, i as ee, e as te, F as L, H as oe, h as re, j as ie, S as ne, E as se, k as ae, l as le, o as ce, p as de, q as U, s as ue, u as F, v as fe, G as A, w as pe, x as he, y as me, z as ye, A as ge, B as ve } from "./chunks/ContinueFlow-BzKnkzHf.js";
6
+ import { I as Be, J as Le, K as Ue, N as Ge, O as He, L as qe, P as Ve, Q as je, R as We, T as ze, U as $e, V as Ke, W as Qe, X as Ye } from "./chunks/ContinueFlow-BzKnkzHf.js";
7
+ function Se(e) {
8
+ let n = e >>> 0;
9
+ return () => (n = n * 1664525 + 1013904223 >>> 0, n / 4294967296);
10
10
  }
11
- function j(e, r) {
12
- const n = $(e, r, 0.8), s = 0.012;
11
+ function q(e, n) {
12
+ const r = $(e, n, 0.8), i = 0.012;
13
13
  return [
14
- { x: n[0].x + s, y: n[0].y + s * 0.6 },
15
- { x: n[1].x - s * 0.4, y: n[1].y },
16
- { x: n[2].x, y: n[2].y - s * 0.3 },
17
- { x: n[3].x + s * 0.5, y: n[3].y - s * 0.8 }
14
+ { x: r[0].x + i, y: r[0].y + i * 0.6 },
15
+ { x: r[1].x - i * 0.4, y: r[1].y },
16
+ { x: r[2].x, y: r[2].y - i * 0.3 },
17
+ { x: r[3].x + i * 0.5, y: r[3].y - i * 0.8 }
18
18
  ];
19
19
  }
20
- function T(e, r, n, s, i, t) {
21
- e.beginPath(), e.moveTo(r + t, n), e.arcTo(r + s, n, r + s, n + i, t), e.arcTo(r + s, n + i, r, n + i, t), e.arcTo(r, n + i, r, n, t), e.arcTo(r, n, r + s, n, t), e.closePath();
20
+ function _(e, n, r, i, s, t) {
21
+ e.beginPath(), e.moveTo(n + t, r), e.arcTo(n + i, r, n + i, r + s, t), e.arcTo(n + i, r + s, n, r + s, t), e.arcTo(n, r + s, n, r, t), e.arcTo(n, r, n + i, r, t), e.closePath();
22
22
  }
23
- function q(e, r, n, s) {
24
- const i = n * 0.037;
25
- T(e, 0, 0, n, s, i), e.save(), e.clip();
26
- const t = e.createLinearGradient(0, 0, n, s);
27
- t.addColorStop(0, "#E8EEEC"), t.addColorStop(1, "#D5DFDC"), e.fillStyle = t, e.fillRect(0, 0, n, s), e.strokeStyle = "rgba(19, 94, 110, 0.13)", e.lineWidth = Math.max(0.6, n * 16e-4);
23
+ function V(e, n, r, i) {
24
+ const s = r * 0.037;
25
+ _(e, 0, 0, r, i, s), e.save(), e.clip();
26
+ const t = e.createLinearGradient(0, 0, r, i);
27
+ t.addColorStop(0, "#E8EEEC"), t.addColorStop(1, "#D5DFDC"), e.fillStyle = t, e.fillRect(0, 0, r, i), e.strokeStyle = "rgba(19, 94, 110, 0.13)", e.lineWidth = Math.max(0.6, r * 16e-4);
28
28
  for (let o = 0; o < 26; o++)
29
- e.beginPath(), e.ellipse(n * 0.72, s * 0.55, n * (0.08 + o * 0.012), s * (0.12 + o * 0.016), o * 0.11, 0, Math.PI * 2), e.stroke();
30
- e.fillStyle = "#135E6E", e.fillRect(0, 0, n, s * 0.13), e.fillStyle = "rgba(255,255,255,0.9)", e.font = `600 ${Math.round(s * 0.06)}px system-ui, sans-serif`, e.textBaseline = "middle", e.fillText(r === "front" ? "IDENTITY CARD · SPECIMEN" : "SPECIMEN", n * 0.05, s * 0.066);
29
+ e.beginPath(), e.ellipse(r * 0.72, i * 0.55, r * (0.08 + o * 0.012), i * (0.12 + o * 0.016), o * 0.11, 0, Math.PI * 2), e.stroke();
30
+ e.fillStyle = "#135E6E", e.fillRect(0, 0, r, i * 0.13), e.fillStyle = "rgba(255,255,255,0.9)", e.font = `600 ${Math.round(i * 0.06)}px system-ui, sans-serif`, e.textBaseline = "middle", e.fillText(n === "front" ? "IDENTITY CARD · SPECIMEN" : "SPECIMEN", r * 0.05, i * 0.066);
31
31
  const l = "rgba(22, 35, 44, 0.55)";
32
- if (r === "front") {
33
- const o = n * 0.05, a = s * 0.2, c = n * 0.27, d = s * 0.62;
34
- e.fillStyle = "#B9C7CE", T(e, o, a, c, d, n * 0.012), e.fill(), e.fillStyle = "#8EA2AC", e.beginPath(), e.ellipse(o + c / 2, a + d * 0.38, c * 0.22, d * 0.2, 0, 0, Math.PI * 2), e.fill(), e.beginPath(), e.ellipse(o + c / 2, a + d * 0.98, c * 0.42, d * 0.3, 0, Math.PI, 0), e.fill(), e.fillStyle = l;
35
- const u = n * 0.37;
36
- [[0.24, 0.3], [0.32, 0.45], [0.44, 0.2], [0.52, 0.38], [0.64, 0.22], [0.72, 0.42]].forEach(([m, g], h) => {
37
- e.globalAlpha = h % 2 ? 1 : 0.55, e.fillRect(u, s * m, n * g, s * (h % 2 ? 0.045 : 0.03));
32
+ if (n === "front") {
33
+ const o = r * 0.05, a = i * 0.2, c = r * 0.27, f = i * 0.62;
34
+ e.fillStyle = "#B9C7CE", _(e, o, a, c, f, r * 0.012), e.fill(), e.fillStyle = "#8EA2AC", e.beginPath(), e.ellipse(o + c / 2, a + f * 0.38, c * 0.22, f * 0.2, 0, 0, Math.PI * 2), e.fill(), e.beginPath(), e.ellipse(o + c / 2, a + f * 0.98, c * 0.42, f * 0.3, 0, Math.PI, 0), e.fill(), e.fillStyle = l;
35
+ const p = r * 0.37;
36
+ [[0.24, 0.3], [0.32, 0.45], [0.44, 0.2], [0.52, 0.38], [0.64, 0.22], [0.72, 0.42]].forEach(([g, v], h) => {
37
+ e.globalAlpha = h % 2 ? 1 : 0.55, e.fillRect(p, i * g, r * v, i * (h % 2 ? 0.045 : 0.03));
38
38
  }), e.globalAlpha = 1;
39
39
  } else {
40
- const o = me(41), a = n * 0.05, c = s * 0.2, d = n * 0.9, u = s * 0.3;
40
+ const o = Se(41), a = r * 0.05, c = i * 0.2, f = r * 0.9, p = i * 0.3;
41
41
  e.fillStyle = "#16232C";
42
- const m = 64, g = 10;
43
- for (let h = 0; h < m; h++) for (let f = 0; f < g; f++)
44
- o() > 0.5 && e.fillRect(a + h * d / m, c + f * u / g, d / m + 0.4, u / g + 0.4);
42
+ const g = 64, v = 10;
43
+ for (let h = 0; h < g; h++) for (let u = 0; u < v; u++)
44
+ o() > 0.5 && e.fillRect(a + h * f / g, c + u * p / v, f / g + 0.4, p / v + 0.4);
45
45
  e.fillStyle = l;
46
- for (let h = 0; h < 3; h++) e.fillRect(n * 0.05, s * (0.62 + h * 0.11), n * 0.9, s * 0.055);
46
+ for (let h = 0; h < 3; h++) e.fillRect(r * 0.05, i * (0.62 + h * 0.11), r * 0.9, i * 0.055);
47
47
  }
48
- e.save(), e.translate(n / 2, s / 2), e.rotate(-0.2), e.fillStyle = "rgba(178, 67, 78, 0.22)", e.font = `800 ${Math.round(s * 0.2)}px system-ui, sans-serif`, e.textAlign = "center", e.textBaseline = "middle", e.fillText("SPECIMEN", 0, 0), e.restore(), e.restore();
48
+ e.save(), e.translate(r / 2, i / 2), e.rotate(-0.2), e.fillStyle = "rgba(178, 67, 78, 0.22)", e.font = `800 ${Math.round(i * 0.2)}px system-ui, sans-serif`, e.textAlign = "center", e.textBaseline = "middle", e.fillText("SPECIMEN", 0, 0), e.restore(), e.restore();
49
49
  }
50
- function ve(e, r) {
51
- const n = e.getBoundingClientRect(), s = Math.max(1, n.width || 390), i = Math.max(1, n.height || 300), t = Math.min(2, typeof devicePixelRatio == "number" ? devicePixelRatio : 1);
52
- e.width = Math.round(s * t), e.height = Math.round(i * t);
50
+ function be(e, n) {
51
+ const r = e.getBoundingClientRect(), i = Math.max(1, r.width || 390), s = Math.max(1, r.height || 300), t = Math.min(2, typeof devicePixelRatio == "number" ? devicePixelRatio : 1);
52
+ e.width = Math.round(i * t), e.height = Math.round(s * t);
53
53
  const l = e.getContext("2d");
54
54
  if (!l) return;
55
55
  l.setTransform(t, 0, 0, t, 0, 0);
56
- const o = l.createRadialGradient(s * 0.5, i * 0.2, 10, s * 0.5, i * 0.6, s);
57
- o.addColorStop(0, "#2B3A44"), o.addColorStop(1, "#141D23"), l.fillStyle = o, l.fillRect(0, 0, s, i);
58
- const a = j(s, i).map((u) => ({ x: u.x * s, y: u.y * i })), c = Math.hypot(a[1].x - a[0].x, a[1].y - a[0].y), d = Math.hypot(a[3].x - a[0].x, a[3].y - a[0].y);
59
- l.save(), l.transform((a[1].x - a[0].x) / c, (a[1].y - a[0].y) / c, (a[3].x - a[0].x) / d, (a[3].y - a[0].y) / d, a[0].x, a[0].y), l.shadowColor = "rgba(0,0,0,0.45)", l.shadowBlur = 18, l.shadowOffsetY = 6, l.fillStyle = "#000", T(l, 0, 0, c, d, c * 0.037), l.fill(), l.shadowColor = "transparent", q(l, r, c, d), l.restore();
56
+ const o = l.createRadialGradient(i * 0.5, s * 0.2, 10, i * 0.5, s * 0.6, i);
57
+ o.addColorStop(0, "#2B3A44"), o.addColorStop(1, "#141D23"), l.fillStyle = o, l.fillRect(0, 0, i, s);
58
+ const a = q(i, s).map((p) => ({ x: p.x * i, y: p.y * s })), c = Math.hypot(a[1].x - a[0].x, a[1].y - a[0].y), f = Math.hypot(a[3].x - a[0].x, a[3].y - a[0].y);
59
+ l.save(), l.transform((a[1].x - a[0].x) / c, (a[1].y - a[0].y) / c, (a[3].x - a[0].x) / f, (a[3].y - a[0].y) / f, a[0].x, a[0].y), l.shadowColor = "rgba(0,0,0,0.45)", l.shadowBlur = 18, l.shadowOffsetY = 6, l.fillStyle = "#000", _(l, 0, 0, c, f, c * 0.037), l.fill(), l.shadowColor = "transparent", V(l, n, c, f), l.restore();
60
60
  }
61
- function N(e) {
61
+ function G(e) {
62
62
  if (typeof document > "u") return;
63
- const r = document.createElement("canvas");
64
- r.width = 254, r.height = 160;
65
- const n = r.getContext("2d");
66
- if (n) {
67
- q(n, e, 254, 160);
63
+ const n = document.createElement("canvas");
64
+ n.width = 254, n.height = 160;
65
+ const r = n.getContext("2d");
66
+ if (r) {
67
+ V(r, e, 254, 160);
68
68
  try {
69
- return r.toDataURL("image/png");
69
+ return n.toDataURL("image/png");
70
70
  } catch {
71
71
  return;
72
72
  }
73
73
  }
74
74
  }
75
- const b = { w: 720, h: 1280 };
76
- function ge(e = 0, r = 1) {
77
- const { w: n, h: s } = b, i = n / 2 + e * 26, t = s * 0.44, l = 160 * r, o = 205 * r, a = e * l * 0.32;
75
+ const M = { w: 720, h: 1280 };
76
+ function Ce(e = 0, n = 1) {
77
+ const { w: r, h: i } = M, s = r / 2 + e * 26, t = i * 0.44, l = 160 * n, o = 205 * n, a = e * l * 0.32;
78
78
  return {
79
- cx: i,
79
+ cx: s,
80
80
  cy: t,
81
81
  rx: l,
82
82
  ry: o,
83
- eyes: [{ x: i - l * 0.36 + a, y: t - o * 0.12 }, { x: i + l * 0.36 + a, y: t - o * 0.12 }],
84
- nose: { x: i + a * 1.25, y: t + o * 0.12 },
85
- mouth: { x: i + a * 1.1, y: t + o * 0.43 },
86
- ears: [{ x: i - l * 0.98 + a * 0.3, y: t }, { x: i + l * 0.98 + a * 0.3, y: t }]
83
+ eyes: [{ x: s - l * 0.36 + a, y: t - o * 0.12 }, { x: s + l * 0.36 + a, y: t - o * 0.12 }],
84
+ nose: { x: s + a * 1.25, y: t + o * 0.12 },
85
+ mouth: { x: s + a * 1.1, y: t + o * 0.43 },
86
+ ears: [{ x: s - l * 0.98 + a * 0.3, y: t }, { x: s + l * 0.98 + a * 0.3, y: t }]
87
87
  };
88
88
  }
89
- function Se(e, r = 0, n = 1) {
90
- const { w: s, h: i } = b;
91
- e.width = s, e.height = i;
89
+ function ke(e, n = 0, r = 1) {
90
+ const { w: i, h: s } = M;
91
+ e.width = i, e.height = s;
92
92
  const t = e.getContext("2d");
93
93
  if (!t) return;
94
- const l = t.createLinearGradient(0, 0, 0, i);
95
- l.addColorStop(0, "#5D6E77"), l.addColorStop(1, "#2E3B43"), t.fillStyle = l, t.fillRect(0, 0, s, i);
96
- const o = ge(r, n);
97
- t.fillStyle = "#24343E", t.beginPath(), t.ellipse(s / 2 + r * 10, i * 0.98, s * 0.56 * n, i * 0.28 * n, 0, Math.PI, 0), t.fill(), t.fillStyle = "#B88C73", t.fillRect(o.cx - o.rx * 0.36, o.cy + o.ry * 0.6, o.rx * 0.72, o.ry * 0.65);
94
+ const l = t.createLinearGradient(0, 0, 0, s);
95
+ l.addColorStop(0, "#5D6E77"), l.addColorStop(1, "#2E3B43"), t.fillStyle = l, t.fillRect(0, 0, i, s);
96
+ const o = Ce(n, r);
97
+ t.fillStyle = "#24343E", t.beginPath(), t.ellipse(i / 2 + n * 10, s * 0.98, i * 0.56 * r, s * 0.28 * r, 0, Math.PI, 0), t.fill(), t.fillStyle = "#B88C73", t.fillRect(o.cx - o.rx * 0.36, o.cy + o.ry * 0.6, o.rx * 0.72, o.ry * 0.65);
98
98
  const a = t.createRadialGradient(o.cx - o.rx * 0.3, o.cy - o.ry * 0.3, 10, o.cx, o.cy, o.ry * 1.1);
99
99
  a.addColorStop(0, "#D8AE92"), a.addColorStop(1, "#B98A6E"), t.fillStyle = a, t.beginPath(), t.ellipse(o.cx, o.cy, o.rx, o.ry, 0, 0, Math.PI * 2), t.fill(), t.fillStyle = "#B4856A";
100
100
  for (const c of o.ears)
@@ -107,72 +107,72 @@ function Se(e, r = 0, n = 1) {
107
107
  t.beginPath(), t.ellipse(c.x, c.y, 24, 13, 0, 0, Math.PI * 2), t.fill();
108
108
  t.fillStyle = "#3B2A20";
109
109
  for (const c of o.eyes)
110
- t.beginPath(), t.arc(c.x + r * 6, c.y, 9, 0, Math.PI * 2), t.fill();
110
+ t.beginPath(), t.arc(c.x + n * 6, c.y, 9, 0, Math.PI * 2), t.fill();
111
111
  t.strokeStyle = "rgba(120, 78, 58, 0.7)", t.lineWidth = 6, t.beginPath(), t.moveTo(o.nose.x - 4, o.nose.y - 60), t.quadraticCurveTo(o.nose.x + 10, o.nose.y, o.nose.x - 12, o.nose.y + 6), t.stroke(), t.strokeStyle = "#8A4C42", t.lineWidth = 8, t.beginPath(), t.moveTo(o.mouth.x - 46, o.mouth.y), t.quadraticCurveTo(o.mouth.x, o.mouth.y + 22, o.mouth.x + 46, o.mouth.y), t.stroke();
112
112
  }
113
- const P = "k7qxm2dpa4vbn6tr3hsy5ecwz2";
114
- function Ce(e) {
115
- const r = e && typeof e == "object" ? e : null;
116
- if (!r) return;
117
- const n = r.reasons && typeof r.reasons == "object" ? r.reasons : null;
118
- if (!n) return L(r);
119
- const s = {};
120
- for (const [i, t] of Object.entries(n))
121
- for (const [l, o] of Object.entries(t ?? {})) (s[l] ?? (s[l] = {}))[i] = o;
122
- return L(s);
113
+ const w = "k7qxm2dpa4vbn6tr3hsy5ecwz2";
114
+ function Me(e) {
115
+ const n = e && typeof e == "object" ? e : null;
116
+ if (!n) return;
117
+ const r = n.reasons && typeof n.reasons == "object" ? n.reasons : null;
118
+ if (!r) return U(n);
119
+ const i = {};
120
+ for (const [s, t] of Object.entries(r))
121
+ for (const [l, o] of Object.entries(t ?? {})) (i[l] ?? (i[l] = {}))[s] = o;
122
+ return U(i);
123
123
  }
124
- const be = {
124
+ const Ee = {
125
125
  enrollment: { verdict: "VERIFIED", purpose: "enrollment", reason: null, score: 0.8412, assurance: "pilot", policy_version: "preview" },
126
126
  signin: { verdict: "VERIFIED", purpose: "signin", reason: null, score: 0.8806, assurance: "pilot", policy_version: "preview" },
127
127
  reverification: { verdict: "VERIFIED", purpose: "reverification", reason: null, score: 0.8517, assurance: "pilot", policy_version: "preview" },
128
128
  identify: { verdict: "VERIFIED", purpose: "identify", reason: null, score: 0.8633, assurance: "pilot", policy_version: "preview" }
129
129
  };
130
- function Fe(e) {
130
+ function Ne(e) {
131
131
  const {
132
- screen: r,
133
- step: n = "front",
134
- challenge: s = "center",
135
- purpose: i = "enrollment",
132
+ screen: n,
133
+ step: r = "front",
134
+ challenge: i = "center",
135
+ purpose: s = "enrollment",
136
136
  locale: t,
137
137
  errorCode: l = "FACE_MISMATCH",
138
138
  documentSides: o,
139
139
  document: a = !0,
140
140
  challenges: c = 2,
141
- privacyNote: d,
142
- formality: u = "informal"
143
- } = e, m = E(() => K(e.appearance), [e.appearance]), g = E(() => Q(e.instructions), [e.instructions]), h = E(() => Ce(e.messages), [e.messages]), f = E(() => {
141
+ privacyNote: f,
142
+ formality: p = "informal"
143
+ } = e, g = E(() => K(e.appearance), [e.appearance]), v = E(() => Q(e.instructions), [e.instructions]), h = E(() => Me(e.messages), [e.messages]), u = E(() => {
144
144
  const y = Y(
145
- X(t, u),
146
- J(h, t, O(t, void 0, u))
145
+ X(t, p),
146
+ J(h, t, B(t, void 0, p))
147
147
  );
148
- return { t: O(t, y, u), overrides: y };
149
- }, [h, t, u]), C = de(i, { document: a, documentSides: o }), S = C.includes(n) ? n : C[0], v = r === "success" ? { k: "done", result: be[i] } : r === "error" ? { k: "failed", reason: l } : S === "face" ? { k: "face" } : { k: "doc", side: S }, k = r === "intro" && Z(S, g), _ = ee(S, t, f.t, g), w = v.k === "doc" || v.k === "face", x = C.length > 1, I = E(() => ({
150
- front: S !== "front" && C.includes("front") ? N("front") : void 0,
151
- back: S === "face" && C.includes("back") ? N("back") : void 0
152
- }), [S, C.join()]);
153
- if (r === "handoff" || r === "continue" || r === "continueDone") {
154
- const y = e.handoff ?? {}, D = y.copy?.[t] ?? null, A = y.tenant || "Acme", F = P.slice(-4).toUpperCase(), V = y.continueUrl ? y.continueUrl.includes("{code}") ? y.continueUrl.replace("{code}", P) : `${y.continueUrl}${y.continueUrl.includes("?") ? "&" : "?"}h=${P}` : `https://baaslatam.com/c/${P}`, z = r === "handoff" ? D?.title || f.t.handoff.title : r === "continue" ? f.t.handoff.phoneTitle : f.t.handoff.doneTitle;
155
- return /* @__PURE__ */ R(
156
- B,
148
+ return { t: B(t, y, p), overrides: y };
149
+ }, [h, t, p]), S = Z(s, { document: a, documentSides: o, ...e.steps ? { steps: e.steps } : {} }), b = S.includes(r) ? r : S[0], m = n === "success" ? { k: "done", result: Ee[s] } : n === "error" ? { k: "failed", reason: l } : ue(b), k = n === "intro" && ee(b, v), T = te(b, t, u.t, v), N = m.k === "doc" || m.k === "face" || m.k === "chip" || m.k === "finger", D = S.length > 1, x = E(() => ({
150
+ front: b !== "front" && S.includes("front") ? G("front") : void 0,
151
+ back: b === "face" && S.includes("back") ? G("back") : void 0
152
+ }), [b, S.join()]);
153
+ if (n === "handoff" || n === "continue" || n === "continueDone") {
154
+ const y = e.handoff ?? {}, O = y.copy?.[t] ?? null, P = y.tenant || "Acme", I = w.slice(-4).toUpperCase(), j = y.continueUrl ? y.continueUrl.includes("{code}") ? y.continueUrl.replace("{code}", w) : `${y.continueUrl}${y.continueUrl.includes("?") ? "&" : "?"}h=${w}` : `https://baaslatam.com/c/${w}`, W = n === "handoff" ? O?.title || u.t.handoff.title : n === "continue" ? u.t.handoff.phoneTitle : u.t.handoff.doneTitle;
155
+ return /* @__PURE__ */ C(
156
+ L,
157
157
  {
158
158
  step: { k: "opening" },
159
- purpose: i,
160
- t: f.t,
161
- privacy: d,
162
- appearance: m,
159
+ purpose: s,
160
+ t: u.t,
161
+ privacy: f,
162
+ appearance: g,
163
163
  forceAppearance: !0,
164
164
  manageFocus: !1,
165
165
  colorScheme: e.colorScheme,
166
- screen: r === "handoff" ? "handoff" : r === "continue" ? "confirm" : "done",
167
- title: z,
166
+ screen: n === "handoff" ? "handoff" : n === "continue" ? "confirm" : "done",
167
+ title: W,
168
168
  children: [
169
- r === "handoff" && /* @__PURE__ */ p(
170
- te,
169
+ n === "handoff" && /* @__PURE__ */ d(
170
+ oe,
171
171
  {
172
- t: f.t,
172
+ t: u.t,
173
173
  mode: y.mode ?? "suggest",
174
- copy: D,
175
- link: { url: V, codeHint: F, tenant: A },
174
+ copy: O,
175
+ link: { url: j, codeHint: I, tenant: P },
176
176
  leftMs: (y.ttlMinutes ?? 10) * 6e4 - 18e3,
177
177
  expired: !1,
178
178
  failed: !1,
@@ -183,144 +183,183 @@ function Fe(e) {
183
183
  }
184
184
  }
185
185
  ),
186
- r === "continue" && /* @__PURE__ */ p(oe, { t: f.t, tenant: A, codeHint: F }),
187
- r === "continueDone" && /* @__PURE__ */ p(ne, { t: f.t, tenant: A, codeHint: F })
186
+ n === "continue" && /* @__PURE__ */ d(re, { t: u.t, tenant: P, codeHint: I }),
187
+ n === "continueDone" && /* @__PURE__ */ d(ie, { t: u.t, tenant: P, codeHint: I })
188
188
  ]
189
189
  }
190
190
  );
191
191
  }
192
- return /* @__PURE__ */ R(
193
- B,
192
+ return /* @__PURE__ */ C(
193
+ L,
194
194
  {
195
- step: v,
196
- purpose: i,
197
- t: f.t,
198
- privacy: d,
199
- appearance: m,
195
+ step: m,
196
+ purpose: s,
197
+ t: u.t,
198
+ privacy: f,
199
+ appearance: g,
200
200
  forceAppearance: !0,
201
201
  manageFocus: !1,
202
202
  colorScheme: e.colorScheme,
203
203
  screen: k ? "intro" : void 0,
204
- title: k ? _.title : ce(v, i, f.t),
204
+ title: k ? T.title : de(m, s, u.t),
205
205
  children: [
206
- w && x && /* @__PURE__ */ p(re, { step: v, t: f.t, plan: C }),
207
- w && x && (I.front || I.back) && /* @__PURE__ */ p(se, { thumbs: I, t: f.t, plan: C }),
208
- k && /* @__PURE__ */ p(
209
- ie,
206
+ N && D && /* @__PURE__ */ d(ne, { step: m, t: u.t, plan: S }),
207
+ N && D && (x.front || x.back) && /* @__PURE__ */ d(se, { thumbs: x, t: u.t, plan: S }),
208
+ k && /* @__PURE__ */ d(
209
+ ae,
210
210
  {
211
- step: S,
212
- body: _.body,
213
- t: f.t,
214
- movements: S === "face" ? c : void 0,
215
- sessionMinutes: C.indexOf(S) === 0 ? 15 : null,
211
+ step: b,
212
+ body: T.body,
213
+ t: u.t,
214
+ movements: b === "face" ? c : void 0,
215
+ sessionMinutes: S.indexOf(b) === 0 ? 15 : null,
216
216
  onStart: () => {
217
217
  }
218
218
  }
219
219
  ),
220
- !k && v.k === "doc" && /* @__PURE__ */ p(Ee, { side: v.side, t: f.t }),
221
- !k && v.k === "face" && /* @__PURE__ */ p(Re, { challenge: s, count: c, t: f.t }),
222
- v.k === "done" && /* @__PURE__ */ p(ae, { result: v.result, t: f.t }),
223
- v.k === "failed" && /* @__PURE__ */ p(le, { reason: l, locale: t, t: f.t, overrides: f.overrides, onRestart: () => {
220
+ !k && m.k === "doc" && /* @__PURE__ */ d(xe, { side: m.side, t: u.t }),
221
+ !k && m.k === "face" && /* @__PURE__ */ d(Ie, { challenge: i, count: c, t: u.t }),
222
+ !k && m.k === "chip" && /* @__PURE__ */ d(Re, { t: u.t }),
223
+ !k && m.k === "finger" && /* @__PURE__ */ d(we, { t: u.t }),
224
+ m.k === "done" && /* @__PURE__ */ d(le, { result: m.result, t: u.t }),
225
+ m.k === "failed" && /* @__PURE__ */ d(ce, { reason: l, locale: t, t: u.t, overrides: u.overrides, onRestart: () => {
224
226
  }, takeFocus: !1 })
225
227
  ]
226
228
  }
227
229
  );
228
230
  }
229
- function Ee({ side: e, t: r }) {
230
- const n = M(null), s = M(null), [i, t] = W({ w: 0, h: 0 });
231
- U(() => {
232
- const o = s.current;
231
+ function Re({ t: e }) {
232
+ return /* @__PURE__ */ C("div", { className: "baas-id-scope rpid-chip", "data-rpid-chip": "waiting", "data-rpid-preview": !0, children: [
233
+ /* @__PURE__ */ d("div", { className: "rpid-chip-stage", "data-active": !0, children: /* @__PURE__ */ C("svg", { className: "rpid-chip-art", viewBox: "0 0 200 120", "aria-hidden": "true", focusable: "false", children: [
234
+ /* @__PURE__ */ d("rect", { className: "rpid-chip-card", x: "18", y: "44", width: "124", height: "70", rx: "8" }),
235
+ /* @__PURE__ */ d("rect", { className: "rpid-chip-portrait", x: "28", y: "56", width: "28", height: "36", rx: "3" }),
236
+ /* @__PURE__ */ d("path", { className: "rpid-chip-lines", d: "M66 60h52M66 70h40M66 80h46M28 102h104" }),
237
+ /* @__PURE__ */ d("rect", { className: "rpid-chip-die", x: "104", y: "88", width: "16", height: "12", rx: "2" }),
238
+ /* @__PURE__ */ d("rect", { className: "rpid-chip-phone", x: "96", y: "6", width: "62", height: "104", rx: "10" }),
239
+ /* @__PURE__ */ d("path", { className: "rpid-chip-speaker", d: "M118 16h18" }),
240
+ /* @__PURE__ */ C("g", { className: "rpid-chip-waves", children: [
241
+ /* @__PURE__ */ d("path", { d: "M118 74a12 12 0 0 1 16 0" }),
242
+ /* @__PURE__ */ d("path", { d: "M112 66a21 21 0 0 1 28 0" }),
243
+ /* @__PURE__ */ d("path", { d: "M106 58a30 30 0 0 1 40 0" })
244
+ ] })
245
+ ] }) }),
246
+ /* @__PURE__ */ d("p", { className: "rpid-chip-status", role: "status", children: e.chip.place }),
247
+ /* @__PURE__ */ d("div", { className: "rpid-chip-actions", children: /* @__PURE__ */ d("button", { type: "button", className: "rpid-action rpid-action-quiet", tabIndex: -1, children: e.chip.skip }) })
248
+ ] });
249
+ }
250
+ function we({ t: e }) {
251
+ const n = R(null), r = R(null), i = { w: 960, h: 1280 }, s = ge(["right_little", "right_ring", "right_middle", "right_index"], i.w / i.h);
252
+ return /* @__PURE__ */ d("div", { className: "baas-id-scope rpid-finger-capture", "data-rpid-preview": !0, children: /* @__PURE__ */ C(
253
+ F,
254
+ {
255
+ className: "rpid-viewport rpid-finger rpid-holding",
256
+ attrs: { "data-rpid-finger-phase": "holding" },
257
+ style: { "--rpid-video-ar": (i.w / i.h).toFixed(4) },
258
+ source: "demo",
259
+ videoRef: n,
260
+ canvasRef: r,
261
+ children: [
262
+ /* @__PURE__ */ d(ve, { src: i, slots: s, states: ["good", "good", "found", "good"], hold: 0.4, t: e }),
263
+ /* @__PURE__ */ d(A, { tone: "info", marker: !0, children: e.guide.hold_fingers_still })
264
+ ]
265
+ }
266
+ ) });
267
+ }
268
+ function xe({ side: e, t: n }) {
269
+ const r = R(null), i = R(null), [s, t] = z({ w: 0, h: 0 });
270
+ H(() => {
271
+ const o = i.current;
233
272
  if (!o) return;
234
273
  const a = () => {
235
- const d = o.getBoundingClientRect();
236
- t((u) => Math.abs(u.w - d.width) < 0.5 && Math.abs(u.h - d.height) < 0.5 ? u : { w: d.width, h: d.height }), ve(o, e);
274
+ const f = o.getBoundingClientRect();
275
+ t((p) => Math.abs(p.w - f.width) < 0.5 && Math.abs(p.h - f.height) < 0.5 ? p : { w: f.width, h: f.height }), be(o, e);
237
276
  };
238
277
  if (a(), typeof ResizeObserver > "u") return;
239
278
  const c = new ResizeObserver(a);
240
279
  return c.observe(o), () => c.disconnect();
241
280
  }, [e]);
242
281
  const l = E(() => {
243
- const o = j(i.w || 4, i.h || 3);
282
+ const o = q(s.w || 4, s.h || 3);
244
283
  return { at: () => o, info: () => ({ kind: "edges", locks: [!0, !0, !0, !0] }) };
245
- }, [i.w, i.h]);
246
- return /* @__PURE__ */ p("div", { className: "baas-id-scope rpid-doc-capture", "data-rpid-preview": !0, children: /* @__PURE__ */ R(
247
- H,
284
+ }, [s.w, s.h]);
285
+ return /* @__PURE__ */ d("div", { className: "baas-id-scope rpid-doc-capture", "data-rpid-preview": !0, children: /* @__PURE__ */ C(
286
+ F,
248
287
  {
249
288
  className: "rpid-viewport rpid-doc rpid-locked",
250
289
  attrs: { "data-rpid-side": e, "data-rpid-frame": "holding" },
251
290
  source: "demo",
252
- videoRef: n,
253
- canvasRef: s,
291
+ videoRef: r,
292
+ canvasRef: i,
254
293
  children: [
255
- /* @__PURE__ */ p(fe, { source: i.w ? l : null, pct: 0.62, state: "holding", t: r }),
256
- /* @__PURE__ */ p(G, { tone: "ok", children: /* @__PURE__ */ p("span", { className: "rpid-guide-line", children: r.guide.steady }) })
294
+ /* @__PURE__ */ d(fe, { source: s.w ? l : null, pct: 0.62, state: "holding", t: n }),
295
+ /* @__PURE__ */ d(A, { tone: "ok", children: /* @__PURE__ */ d("span", { className: "rpid-guide-line", children: n.guide.steady }) })
257
296
  ]
258
297
  }
259
298
  ) });
260
299
  }
261
- const ke = {
300
+ const Pe = {
262
301
  center: ["turn_left", "move_closer"],
263
302
  turn_left: ["turn_left", "move_closer"],
264
303
  turn_right: ["turn_right", "move_closer"],
265
304
  move_closer: ["turn_left", "move_closer"]
266
305
  };
267
- function Re({ challenge: e, count: r, t: n }) {
268
- const s = M(null), i = M(null), t = ke[e].slice(0, Math.max(1, Math.min(3, r)));
306
+ function Ie({ challenge: e, count: n, t: r }) {
307
+ const i = R(null), s = R(null), t = Pe[e].slice(0, Math.max(1, Math.min(3, n)));
269
308
  e !== "center" && !t.includes(e) && (t[t.length - 1] = e);
270
309
  const l = e === "center" ? -1 : t.indexOf(e), o = e === "turn_left" ? -0.55 : e === "turn_right" ? 0.55 : 0, a = e === "move_closer" ? 1.12 : 1;
271
- U(() => {
272
- i.current && Se(i.current, o, a);
310
+ H(() => {
311
+ s.current && ke(s.current, o, a);
273
312
  }, [o, a]);
274
- const c = ue({ videoWidth: b.w, videoHeight: b.h }), d = e === "center" ? null : e, u = e === "center" ? "perfect" : e === "move_closer" ? "closer_more" : e, m = e === "center" ? 0 : 0.45, g = pe({ step: l, total: t.length, hold: 0.65, progress: m, done: !1 }), h = { "--rpid-video-ar": (b.w / b.h).toFixed(4) };
275
- return /* @__PURE__ */ R("div", { className: "baas-id-scope", "data-rpid-preview": !0, children: [
276
- /* @__PURE__ */ R(
277
- H,
313
+ const c = pe({ videoWidth: M.w, videoHeight: M.h }), f = e === "center" ? null : e, p = e === "center" ? "perfect" : e === "move_closer" ? "closer_more" : e, g = e === "center" ? 0 : 0.45, v = he({ step: l, total: t.length, hold: 0.65, progress: g, done: !1 }), h = { "--rpid-video-ar": (M.w / M.h).toFixed(4) };
314
+ return /* @__PURE__ */ C("div", { className: "baas-id-scope", "data-rpid-preview": !0, children: [
315
+ /* @__PURE__ */ C(
316
+ F,
278
317
  {
279
318
  className: `rpid-viewport rpid-face rpid-${e === "center" ? "searching" : "locked"}`,
280
319
  attrs: { "data-rpid-guide-state": e === "center" ? "aligned" : "capturing" },
281
320
  style: h,
282
321
  source: "demo",
283
- videoRef: s,
284
- canvasRef: i,
322
+ videoRef: i,
323
+ canvasRef: s,
285
324
  mirror: !0,
286
325
  children: [
287
- /* @__PURE__ */ p(
288
- he,
326
+ /* @__PURE__ */ d(
327
+ me,
289
328
  {
290
- src: b,
329
+ src: M,
291
330
  oval: c,
292
331
  state: e === "center" ? "aligned" : "capturing",
293
332
  scan: e === "center" ? "aligned" : "challenge",
294
- fills: g,
295
- progress: m,
296
- cue: d,
297
- guide: u,
298
- t: n
333
+ fills: v,
334
+ progress: g,
335
+ cue: f,
336
+ guide: p,
337
+ t: r
299
338
  }
300
339
  ),
301
- /* @__PURE__ */ p(G, { tone: "ok", marker: !0, children: e === "center" ? n.guide.perfect : n.guide[u] })
340
+ /* @__PURE__ */ d(A, { tone: "ok", marker: !0, children: e === "center" ? r.guide.perfect : r.guide[p] })
302
341
  ]
303
342
  }
304
343
  ),
305
- /* @__PURE__ */ p(ye, { script: t, step: l, t: n })
344
+ /* @__PURE__ */ d(ye, { script: t, step: l, t: r })
306
345
  ] });
307
346
  }
308
347
  export {
309
- we as CONTRAST_PAIRS,
310
- xe as DARK,
311
- De as DEFAULT_COLORS,
312
- Oe as DEFAULT_RADIUS,
313
- Be as FONT_STACKS,
314
- Fe as FlowPreview,
315
- Le as LOCALES,
316
- Ne as SDK_DEFAULTS,
317
- Ue as appearanceGroups,
318
- He as appearanceStyle,
319
- Ge as contrastChecks,
320
- je as contrastRatio,
321
- qe as darkPalette,
322
- O as getStrings,
323
- ee as introFor,
324
- Ve as liftOn,
325
- ze as parseIntroBody
348
+ Be as CONTRAST_PAIRS,
349
+ Le as DARK,
350
+ Ue as DEFAULT_COLORS,
351
+ Ge as DEFAULT_RADIUS,
352
+ He as FONT_STACKS,
353
+ Ne as FlowPreview,
354
+ qe as LOCALES,
355
+ Ve as SDK_DEFAULTS,
356
+ je as appearanceGroups,
357
+ We as appearanceStyle,
358
+ ze as contrastChecks,
359
+ $e as contrastRatio,
360
+ Ke as darkPalette,
361
+ B as getStrings,
362
+ te as introFor,
363
+ Qe as liftOn,
364
+ Ye as parseIntroBody
326
365
  };
@@ -1,3 +1,6 @@
1
1
  export { ContinueFlow, readHandoffCode, type ContinueFlowProps } from "./react/handoff/ContinueFlow";
2
2
  export { DEFAULT_MODELS_URL, MODELS_VERSION } from "./react/vision/modelsCdn";
3
3
  export { getStrings, LOCALES, type Locale, type Strings, type StringOverrides, type Formality } from "./react/i18n";
4
+ export { nativeChipReader, ChipReadError, type ChipReader, type ChipReadout, type ChipReadInput, type ChipReadProgress, type ChipReaderName, } from "./react/chip/provider";
5
+ export { chipCapability, type ChipCapability } from "./react/chip/capability";
6
+ export type { FingerDetector, FingerBox } from "./react/finger/detector";
@@ -1,4 +1,4 @@
1
- export { EnrollmentFlow, SignInFlow, ReverificationFlow, IdentifyFlow, normalizeSession, captureNonceOf, type ApiSessionBody, type EnrollmentFlowProps, type SignInFlowProps, type ReverificationFlowProps, type IdentifyFlowProps, type Purpose, type IdentifyCandidate, type DuplicateCandidate, type VerificationFlowProps, type RpidSession, type SessionFlow, type VerificationResult, type VerificationAssessment, type DocumentAuthenticity, type RpidFlowEvent, type ExtractionRecord, type ExtractionField, type Appearance, type TenantInstructions, type TenantMessages, type SessionHandoff, type HandoffOption, } from "./react/flows";
1
+ export { EnrollmentFlow, SignInFlow, ReverificationFlow, IdentifyFlow, normalizeSession, captureNonceOf, type ApiSessionBody, type EnrollmentFlowProps, type SignInFlowProps, type ReverificationFlowProps, type IdentifyFlowProps, type Purpose, type IdentifyCandidate, type DuplicateCandidate, type VerificationFlowProps, type RpidSession, type SessionFlow, type VerificationResult, type VerificationAssessment, type DocumentAuthenticity, type RpidFlowEvent, type ExtractionRecord, type ExtractionField, type Appearance, type TenantInstructions, type TenantMessages, type SessionHandoff, type HandoffOption, type SessionChip, type SessionFinger, type FingerPosition, type StepId, } from "./react/flows";
2
2
  export type { ColorScheme } from "./react/theme/scheme";
3
3
  export { ContinueOnPhone, HandoffPanel, HandoffView, type ContinueOnPhoneProps, type HandoffMode, type HandoffCopy, } from "./react/handoff/ContinueOnPhone";
4
4
  export { ContinueFlow, readHandoffCode, type ContinueFlowProps } from "./react/handoff/ContinueFlow";
@@ -10,6 +10,15 @@ export { SDK_VERSION } from "./react/version";
10
10
  export { DocumentCapture, type DocumentCaptureProps, type SideRetake } from "./react/DocumentCapture";
11
11
  export { sideOutcomeOf, type SideOutcome } from "./react/document/sideCheck";
12
12
  export { FaceCapture, type FaceCaptureProps } from "./react/FaceCapture";
13
+ export { ChipRead, type ChipReadProps } from "./react/chip/ChipRead";
14
+ export type { ChipOutcome } from "./react/chip/useChipRead";
15
+ export { nativeChipReader, ChipReadError, normalizeChipError, type ChipReader, type ChipReadout, type ChipReadInput, type ChipReadProgress, type ChipReaderName, type ChipReadErrorCode, type ChipMrzKey, } from "./react/chip/provider";
16
+ export { chipCapability, unavailableReason, webNfcAvailable, type ChipCapability, type ChipUnavailableReason, type ChipDevice, } from "./react/chip/capability";
17
+ export { watchChipPresence, type NfcPresence } from "./react/chip/webNfcPresence";
18
+ export { FingerCapture, type FingerCaptureProps } from "./react/FingerCapture";
19
+ export { silhouetteDetector, fingerSlots, fingerGroups, type FingerDetector, type FingerBox, type FingerPixels, type FingerGroup, type Slot as FingerSlot, } from "./react/finger/detector";
20
+ export { fingertipStats, fingerGate, FINGER_FLOORS, type FingertipStats, type FingerFloors, type FingerGuideId, } from "./react/finger/qualityGate";
21
+ export { uploadChip, reportChipUnavailable, uploadFinger, torchSupported, setTorch, type ChipUploadMeta, type FingerUploadMeta, } from "./react/capture";
13
22
  export { selfieQualityIssue, faceCropStats, floorsFrom, SELFIE_QUALITY_DEFAULTS, type SelfieQualityFloors, type SelfieQualityReading, type QualityIssue, } from "./react/face/qualityGate";
14
23
  export { finalizeSession, uploadCapture, probeDocument, type Quality, type RpidClientConfig, type MrzProbe, } from "./react/capture";
15
24
  export { webAttestation, nativeAttestation, requestHash, type AttestationProvider, type AttestationClaim, type AttestationName, type NativeMint, } from "./react/capture";