@exige/web-scanner-sdk 0.2.37 → 0.2.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{driver-license-DWQiITx8.js → driver-license-BmeEh0a_.js} +624 -525
- package/dist/driver-license-BmeEh0a_.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/react/guidance.d.ts +1 -0
- package/dist/react/types.d.ts +10 -2
- package/dist/react.js +453 -416
- package/dist/react.js.map +1 -1
- package/dist/scanner-sdk.js +3 -3
- package/dist/sdk/barcode.d.ts +15 -1
- package/dist/sdk/driver-license.d.ts +13 -2
- package/package.json +1 -1
- package/dist/driver-license-DWQiITx8.js.map +0 -1
package/dist/react.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { Fragment as
|
|
2
|
+
import { B as e, E as t, G as n, J as r, M as i, R as a, T as o, U as s, Y as c, Z as l, a as u, b as d, m as f, o as p, p as ee, q as te, r as m, s as ne, z as re } from "./driver-license-BmeEh0a_.js";
|
|
3
|
+
import { createContext as ie, useCallback as h, useContext as ae, useEffect as g, useLayoutEffect as oe, useMemo as se, useRef as _, useState as v } from "react";
|
|
4
|
+
import { Fragment as ce, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
5
5
|
//#region src/sdk/display-quad.ts
|
|
6
|
-
function
|
|
6
|
+
function x(e) {
|
|
7
7
|
return [
|
|
8
8
|
e.topLeft,
|
|
9
9
|
e.topRight,
|
|
@@ -11,7 +11,7 @@ function w(e) {
|
|
|
11
11
|
e.bottomLeft
|
|
12
12
|
];
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function S(e) {
|
|
15
15
|
let [t, n, r, i] = e;
|
|
16
16
|
return {
|
|
17
17
|
topLeft: t,
|
|
@@ -38,10 +38,10 @@ function T(e) {
|
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
return
|
|
41
|
+
function C(e) {
|
|
42
|
+
return S(x(e).map((e) => ({ ...e })));
|
|
43
43
|
}
|
|
44
|
-
var
|
|
44
|
+
var le = class {
|
|
45
45
|
current;
|
|
46
46
|
target;
|
|
47
47
|
response;
|
|
@@ -50,11 +50,11 @@ var ae = class {
|
|
|
50
50
|
this.response = e.response ?? 14, this.snapDistance = e.snapDistance ?? .1;
|
|
51
51
|
}
|
|
52
52
|
setTarget(e, t, n) {
|
|
53
|
-
let r = Math.max(1, Math.hypot(t, n)), i = !this.current ||
|
|
54
|
-
let n =
|
|
53
|
+
let r = Math.max(1, Math.hypot(t, n)), i = !this.current || x(e).some((e, t) => {
|
|
54
|
+
let n = x(this.current)[t];
|
|
55
55
|
return Math.hypot(e.x - n.x, e.y - n.y) / r > this.snapDistance;
|
|
56
56
|
});
|
|
57
|
-
return this.target =
|
|
57
|
+
return this.target = C(e), i && (this.current = C(e)), {
|
|
58
58
|
quad: this.current,
|
|
59
59
|
snapped: i
|
|
60
60
|
};
|
|
@@ -62,8 +62,8 @@ var ae = class {
|
|
|
62
62
|
step(e) {
|
|
63
63
|
if (!this.current || !this.target) return this.current;
|
|
64
64
|
let t = 1 - Math.exp(-this.response * Math.max(0, e) / 1e3);
|
|
65
|
-
return this.current =
|
|
66
|
-
let r =
|
|
65
|
+
return this.current = S(x(this.current).map((e, n) => {
|
|
66
|
+
let r = x(this.target)[n];
|
|
67
67
|
return {
|
|
68
68
|
x: e.x + (r.x - e.x) * t,
|
|
69
69
|
y: e.y + (r.y - e.y) * t
|
|
@@ -76,13 +76,22 @@ var ae = class {
|
|
|
76
76
|
getCurrent() {
|
|
77
77
|
return this.current;
|
|
78
78
|
}
|
|
79
|
-
},
|
|
79
|
+
}, ue = ie(null);
|
|
80
80
|
//#endregion
|
|
81
81
|
//#region src/react/context.tsx
|
|
82
|
-
function
|
|
82
|
+
function de(e) {
|
|
83
83
|
e?.startsWith("blob:") && URL.revokeObjectURL(e);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function fe() {
|
|
86
|
+
return new Promise((e) => {
|
|
87
|
+
if (typeof requestAnimationFrame == "function") {
|
|
88
|
+
requestAnimationFrame(() => requestAnimationFrame(() => e()));
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
setTimeout(e, 0);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function pe(e) {
|
|
86
95
|
try {
|
|
87
96
|
let t = e.toDataURL("image/jpeg", .92);
|
|
88
97
|
return t.startsWith("data:image/") ? t : void 0;
|
|
@@ -90,371 +99,392 @@ function ce(e) {
|
|
|
90
99
|
return;
|
|
91
100
|
}
|
|
92
101
|
}
|
|
93
|
-
function
|
|
102
|
+
function me(e, t) {
|
|
94
103
|
if (typeof e == "function") return e(t);
|
|
95
104
|
}
|
|
96
|
-
function
|
|
97
|
-
let
|
|
98
|
-
onCapture:
|
|
99
|
-
onDriverLicense:
|
|
100
|
-
onCancel:
|
|
101
|
-
onError:
|
|
102
|
-
onSettings:
|
|
103
|
-
onFinderStatus:
|
|
104
|
-
useCase:
|
|
105
|
-
}),
|
|
105
|
+
function he({ open: d, useCase: m = "document", autoCapture: ie = "defaultOn", captureMode: ae = "auto", torch: ce = "defaultOff", onCapture: b, onDriverLicense: x, onCancel: S, onError: C, onSettings: he, onFinderStatus: ge, modelUrl: w, ortWasmPaths: T, detectionIntervalMs: _e, apiRef: E, children: ve }) {
|
|
106
|
+
let D = r(ae), O = _(void 0), k = _(void 0), ye = _(void 0), A = _(void 0), j = _({}), M = _(new le()), N = _(!1), be = _(!1), P = _({
|
|
107
|
+
onCapture: b,
|
|
108
|
+
onDriverLicense: x,
|
|
109
|
+
onCancel: S,
|
|
110
|
+
onError: C,
|
|
111
|
+
onSettings: he,
|
|
112
|
+
onFinderStatus: ge,
|
|
113
|
+
useCase: m
|
|
114
|
+
}), xe = _(void 0), Se = _(void 0), F = _(async () => void 0), I = _(!1), L = _(void 0), R = _(void 0), Ce = _(null), [z, we] = v(null), [Te, B] = v(D && d ? "capturing" : D ? "ready" : "starting"), [V, H] = v(), [Ee, U] = v(), [De, W] = v(), [Oe, ke] = v({
|
|
106
115
|
width: 1,
|
|
107
116
|
height: 1
|
|
108
|
-
}), [
|
|
117
|
+
}), [Ae, je] = v(), [Me, G] = v(), [Ne, K] = v(""), [Pe, Fe] = v(0), [Ie, q] = v(), [Le, J] = v(), [Re, ze] = v("idle"), [Be, Ve] = v(), He = _(void 0), [Ue, We] = v("front"), Y = _("front"), [Ge, Ke] = v(!1), [qe, Je] = v({
|
|
109
118
|
downloading: !1,
|
|
110
119
|
loaded: 0,
|
|
111
120
|
total: null
|
|
112
|
-
}),
|
|
113
|
-
|
|
114
|
-
}, []),
|
|
115
|
-
let n =
|
|
116
|
-
|
|
121
|
+
}), X = h(() => {
|
|
122
|
+
de(He.current), He.current = void 0, Ve(void 0);
|
|
123
|
+
}, []), Z = h((e, t) => {
|
|
124
|
+
let n = pe(e);
|
|
125
|
+
de(He.current), He.current = n, Ve(n), t?.pause();
|
|
126
|
+
}, []), Q = h(async (e, t) => {
|
|
127
|
+
t && (W({
|
|
128
|
+
width: e.width,
|
|
129
|
+
height: e.height
|
|
130
|
+
}), U(t), await fe(), await new Promise((e) => {
|
|
131
|
+
window.setTimeout(e, 280);
|
|
132
|
+
}));
|
|
117
133
|
}, []);
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
onCapture:
|
|
121
|
-
onDriverLicense:
|
|
122
|
-
onCancel:
|
|
123
|
-
onError:
|
|
124
|
-
onSettings:
|
|
125
|
-
onFinderStatus:
|
|
126
|
-
useCase:
|
|
134
|
+
oe(() => {
|
|
135
|
+
P.current = {
|
|
136
|
+
onCapture: b,
|
|
137
|
+
onDriverLicense: x,
|
|
138
|
+
onCancel: S,
|
|
139
|
+
onError: C,
|
|
140
|
+
onSettings: he,
|
|
141
|
+
onFinderStatus: ge,
|
|
142
|
+
useCase: m
|
|
127
143
|
};
|
|
128
144
|
}, [
|
|
145
|
+
b,
|
|
146
|
+
x,
|
|
147
|
+
S,
|
|
129
148
|
C,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
]), y(() => s(He), []), y(() => {
|
|
137
|
-
if (!m || h !== "drivers-license") {
|
|
138
|
-
ge.current = void 0, he.current = void 0, B.current = !1, Le("front"), Be(!1);
|
|
149
|
+
he,
|
|
150
|
+
ge,
|
|
151
|
+
m
|
|
152
|
+
]), g(() => l(Je), []), g(() => {
|
|
153
|
+
if (!d || m !== "drivers-license") {
|
|
154
|
+
R.current?.abort(), R.current = void 0, Se.current = void 0, xe.current = void 0, I.current = !1, Y.current = "front", We("front"), Ke(!1);
|
|
139
155
|
return;
|
|
140
156
|
}
|
|
141
|
-
let e =
|
|
142
|
-
modelUrl:
|
|
143
|
-
ortWasmPaths:
|
|
157
|
+
let e = u({ scan: {
|
|
158
|
+
modelUrl: w,
|
|
159
|
+
ortWasmPaths: T
|
|
144
160
|
} });
|
|
145
|
-
return
|
|
146
|
-
|
|
161
|
+
return Se.current = e, e.then((e) => {
|
|
162
|
+
xe.current = e;
|
|
147
163
|
}), () => {
|
|
148
|
-
e.then((e) => e.cancel()),
|
|
164
|
+
R.current?.abort(), R.current = void 0, e.then((e) => e.cancel()), xe.current &&= void 0, Se.current = void 0;
|
|
149
165
|
};
|
|
150
166
|
}, [
|
|
167
|
+
d,
|
|
151
168
|
m,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
O
|
|
169
|
+
w,
|
|
170
|
+
T
|
|
155
171
|
]);
|
|
156
|
-
let
|
|
157
|
-
|
|
172
|
+
let Ye = h((e) => {
|
|
173
|
+
we(e);
|
|
158
174
|
}, []);
|
|
159
|
-
|
|
160
|
-
if (!
|
|
175
|
+
g(() => {
|
|
176
|
+
if (!d || !z) return;
|
|
161
177
|
let e = () => {
|
|
162
|
-
let e =
|
|
163
|
-
|
|
178
|
+
let e = z.getBoundingClientRect();
|
|
179
|
+
ke({
|
|
164
180
|
width: e.width,
|
|
165
181
|
height: e.height
|
|
166
182
|
});
|
|
167
183
|
};
|
|
168
184
|
if (e(), typeof ResizeObserver > "u") return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
169
185
|
let t = new ResizeObserver(e);
|
|
170
|
-
return t.observe(
|
|
171
|
-
}, [
|
|
172
|
-
if (!
|
|
186
|
+
return t.observe(z), () => t.disconnect();
|
|
187
|
+
}, [d, z]), g(() => {
|
|
188
|
+
if (!d) return;
|
|
173
189
|
let e = window.setInterval(() => {
|
|
174
|
-
let e =
|
|
175
|
-
e &&
|
|
190
|
+
let e = O.current?.getDiagnostics();
|
|
191
|
+
e && q(e);
|
|
176
192
|
}, 500);
|
|
177
193
|
return () => window.clearInterval(e);
|
|
178
|
-
}, [
|
|
179
|
-
if (!
|
|
194
|
+
}, [d, Pe]), g(() => {
|
|
195
|
+
if (!d) return;
|
|
180
196
|
let e = 0, t = performance.now(), n = (r) => {
|
|
181
|
-
let i =
|
|
182
|
-
t = r, i &&
|
|
197
|
+
let i = M.current.step(r - t);
|
|
198
|
+
t = r, i && U(i), e = requestAnimationFrame(n);
|
|
183
199
|
};
|
|
184
200
|
return e = requestAnimationFrame(n), () => cancelAnimationFrame(e);
|
|
185
|
-
}, [
|
|
186
|
-
if (!
|
|
187
|
-
let e = !1,
|
|
188
|
-
|
|
189
|
-
let
|
|
190
|
-
|
|
201
|
+
}, [d]), g(() => {
|
|
202
|
+
if (!d || D || !z) return;
|
|
203
|
+
let e = !1, n = new AbortController();
|
|
204
|
+
L.current = n;
|
|
205
|
+
let r = () => {
|
|
206
|
+
n.abort(), L.current === n && (L.current = void 0), k.current?.stop(), k.current = void 0, O.current?.stop(), O.current = void 0, A.current = void 0, ye.current = void 0, j.current = {}, X();
|
|
191
207
|
};
|
|
192
208
|
return (async () => {
|
|
193
|
-
|
|
209
|
+
r(), n = new AbortController(), L.current = n, N.current = !1, B("starting"), K(""), H(void 0), G(void 0), J(void 0), ze("idle"), X();
|
|
194
210
|
try {
|
|
195
|
-
let
|
|
211
|
+
let r = await c(z, { torch: ce });
|
|
196
212
|
if (e) {
|
|
197
|
-
|
|
213
|
+
r.stop();
|
|
198
214
|
return;
|
|
199
215
|
}
|
|
200
|
-
|
|
201
|
-
let
|
|
202
|
-
if (
|
|
203
|
-
|
|
216
|
+
O.current = r;
|
|
217
|
+
let i = r.getSettings();
|
|
218
|
+
if (je(i), P.current.onSettings?.(i), console.info("[ScannerProvider] camera settings", i), P.current.useCase === "drivers-license" && Y.current === "back") {
|
|
219
|
+
H(void 0), U(void 0), W(void 0), M.current.clear(), B("ready"), (async () => {
|
|
204
220
|
try {
|
|
205
|
-
let t = 0,
|
|
221
|
+
let t = 0, i = await p(async () => {
|
|
206
222
|
t += 1;
|
|
207
|
-
let e =
|
|
208
|
-
if (t % 4 == 0 &&
|
|
209
|
-
let e = await
|
|
223
|
+
let e = a();
|
|
224
|
+
if (t % 4 == 0 && te(e, "ImageCapture" in globalThis)) try {
|
|
225
|
+
let e = await r.capturePhoto();
|
|
210
226
|
if (e.frame && e.luminance > 10) return e.frame;
|
|
211
227
|
} catch {}
|
|
212
228
|
try {
|
|
213
|
-
return await
|
|
229
|
+
return await r.captureLiveFrame(ee);
|
|
214
230
|
} catch {
|
|
215
231
|
return;
|
|
216
232
|
}
|
|
217
233
|
}, {
|
|
218
|
-
intervalMs:
|
|
219
|
-
signal:
|
|
234
|
+
intervalMs: _e ?? 140,
|
|
235
|
+
signal: n.signal
|
|
220
236
|
});
|
|
221
|
-
if (e ||
|
|
222
|
-
|
|
223
|
-
frame:
|
|
237
|
+
if (e || n.signal.aborted || I.current || (I.current = !0, Z(i.frame, z), G("live-mirror"), B("captured"), await Q(i.frame, i.quad), e || n.signal.aborted)) return;
|
|
238
|
+
await F.current({
|
|
239
|
+
frame: i.frame,
|
|
224
240
|
reason: "auto",
|
|
225
241
|
method: "live-mirror",
|
|
226
|
-
settings:
|
|
242
|
+
settings: r.getSettings()
|
|
227
243
|
});
|
|
228
244
|
} catch (t) {
|
|
229
|
-
if (e ||
|
|
230
|
-
let
|
|
231
|
-
|
|
245
|
+
if (e || n.signal.aborted || t instanceof DOMException && t.name === "AbortError") return;
|
|
246
|
+
let r = t instanceof Error ? t : /* @__PURE__ */ Error("Could not read the barcode.");
|
|
247
|
+
N.current = !0, K(r.message), B("error"), P.current.onError?.(r);
|
|
232
248
|
}
|
|
233
249
|
})();
|
|
234
250
|
return;
|
|
235
251
|
}
|
|
236
|
-
|
|
237
|
-
source:
|
|
238
|
-
autoCapture:
|
|
239
|
-
intervalMs:
|
|
252
|
+
k.current = await t({
|
|
253
|
+
source: z,
|
|
254
|
+
autoCapture: ie,
|
|
255
|
+
intervalMs: _e,
|
|
240
256
|
detection: {
|
|
241
|
-
modelUrl:
|
|
242
|
-
ortWasmPaths:
|
|
257
|
+
modelUrl: w,
|
|
258
|
+
ortWasmPaths: T
|
|
243
259
|
},
|
|
244
260
|
onStatus: (e) => {
|
|
245
|
-
if (
|
|
246
|
-
let t =
|
|
247
|
-
|
|
248
|
-
} else
|
|
249
|
-
e.state !== "captured" && !
|
|
261
|
+
if (ye.current = e, H(e), P.current.onFinderStatus?.(e), e.quad && e.sourceWidth && e.sourceHeight) {
|
|
262
|
+
let t = M.current.setTarget(e.quad, e.sourceWidth, e.sourceHeight);
|
|
263
|
+
U(t.quad);
|
|
264
|
+
} else M.current.clear(), U(void 0);
|
|
265
|
+
e.state !== "captured" && !N.current && B("ready");
|
|
250
266
|
},
|
|
251
267
|
captureFrame: async () => {
|
|
252
|
-
|
|
253
|
-
quad:
|
|
254
|
-
sourceWidth:
|
|
255
|
-
sourceHeight:
|
|
268
|
+
B("capturing"), j.current = {
|
|
269
|
+
quad: M.current.getCurrent(),
|
|
270
|
+
sourceWidth: ye.current?.sourceWidth,
|
|
271
|
+
sourceHeight: ye.current?.sourceHeight
|
|
256
272
|
};
|
|
257
|
-
let e = await
|
|
258
|
-
if (
|
|
259
|
-
return
|
|
273
|
+
let e = await r.capturePhoto();
|
|
274
|
+
if (A.current = e, G(e.method), J(e.diagnostics), q(e.diagnostics), e.luminance <= 10) throw Error(`The captured frame was blank (luminance ${e.luminance.toFixed(1)} via ${e.method}). Keep the scanner visible while capturing and retake.`);
|
|
275
|
+
return Z(e.frame, z), B("captured"), e.frame;
|
|
260
276
|
},
|
|
261
277
|
onCaptureError: (e) => {
|
|
262
|
-
|
|
263
|
-
let t =
|
|
264
|
-
t &&
|
|
278
|
+
N.current = !0, B("error"), K(e.message);
|
|
279
|
+
let t = O.current?.getDiagnostics();
|
|
280
|
+
t && q(t), P.current.onError?.(e);
|
|
265
281
|
},
|
|
266
282
|
onCapture: async (e) => {
|
|
267
|
-
let t =
|
|
283
|
+
let t = A.current;
|
|
268
284
|
await new Promise((e) => window.setTimeout(e, 140));
|
|
269
285
|
let n = {
|
|
270
286
|
...e,
|
|
271
287
|
method: t?.method ?? "video-frame",
|
|
272
|
-
settings: t?.settings ??
|
|
288
|
+
settings: t?.settings ?? r.getSettings(),
|
|
273
289
|
fallbackReason: t?.fallbackReason,
|
|
274
290
|
luminance: t?.luminance,
|
|
275
291
|
diagnostics: t?.diagnostics,
|
|
276
|
-
displayedQuad:
|
|
277
|
-
displaySourceWidth:
|
|
278
|
-
displaySourceHeight:
|
|
292
|
+
displayedQuad: j.current.quad,
|
|
293
|
+
displaySourceWidth: j.current.sourceWidth,
|
|
294
|
+
displaySourceHeight: j.current.sourceHeight
|
|
279
295
|
};
|
|
280
|
-
if (
|
|
281
|
-
await
|
|
296
|
+
if (P.current.useCase === "drivers-license") {
|
|
297
|
+
await F.current(n);
|
|
282
298
|
return;
|
|
283
299
|
}
|
|
284
|
-
await
|
|
300
|
+
await me(P.current.onCapture, n);
|
|
285
301
|
}
|
|
286
302
|
});
|
|
287
303
|
} catch (t) {
|
|
288
304
|
if (e) return;
|
|
289
|
-
|
|
305
|
+
r();
|
|
290
306
|
let n = t instanceof Error ? t : /* @__PURE__ */ Error("Camera access failed.");
|
|
291
|
-
|
|
307
|
+
K(n.message), B("error"), P.current.onError?.(n);
|
|
292
308
|
}
|
|
293
309
|
})(), () => {
|
|
294
|
-
e = !0,
|
|
310
|
+
e = !0, r();
|
|
295
311
|
};
|
|
296
312
|
}, [
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
A,
|
|
300
|
-
g,
|
|
301
|
-
ie,
|
|
313
|
+
d,
|
|
314
|
+
z,
|
|
302
315
|
D,
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
316
|
+
ie,
|
|
317
|
+
ce,
|
|
318
|
+
w,
|
|
319
|
+
T,
|
|
320
|
+
_e,
|
|
321
|
+
Pe,
|
|
322
|
+
X,
|
|
306
323
|
Z,
|
|
307
324
|
Q
|
|
308
325
|
]);
|
|
309
|
-
let
|
|
310
|
-
open:
|
|
311
|
-
phase:
|
|
312
|
-
autoCapture:
|
|
313
|
-
captureMode:
|
|
314
|
-
usingSystemCamera:
|
|
315
|
-
finderStatus:
|
|
316
|
-
displayQuad:
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
326
|
+
let Xe = {
|
|
327
|
+
open: d,
|
|
328
|
+
phase: Te,
|
|
329
|
+
autoCapture: ie,
|
|
330
|
+
captureMode: ae,
|
|
331
|
+
usingSystemCamera: D,
|
|
332
|
+
finderStatus: V,
|
|
333
|
+
displayQuad: Ee,
|
|
334
|
+
barcodeOverlay: De,
|
|
335
|
+
previewSize: Oe,
|
|
336
|
+
settings: Ae,
|
|
337
|
+
captureMethod: Me,
|
|
338
|
+
error: Ne,
|
|
339
|
+
diagnostics: Ie,
|
|
340
|
+
shutterDiagnostics: Le,
|
|
341
|
+
copyState: Re,
|
|
342
|
+
guidanceHint: V ? o(V.guidance, V.lighting) : void 0,
|
|
343
|
+
detectorStatus: m === "drivers-license" && Ue === "back" && !D ? "zxing" : V?.modelStatus === "failed" ? `ML failed${V.modelError ? `: ${V.modelError}` : ""}` : V?.detector === "ml" ? `ML ${V.modelProvider ?? ""}`.trim() : "ML loading",
|
|
344
|
+
modelDownload: qe,
|
|
345
|
+
frozenPreviewUrl: Be,
|
|
346
|
+
useCase: m,
|
|
347
|
+
licenseSide: m === "drivers-license" ? Ue : void 0,
|
|
348
|
+
licenseBusy: m === "drivers-license" ? Ge : void 0
|
|
331
349
|
};
|
|
332
|
-
|
|
333
|
-
|
|
350
|
+
g(() => {
|
|
351
|
+
Ce.current = Xe;
|
|
334
352
|
});
|
|
335
|
-
let
|
|
336
|
-
|
|
337
|
-
}, []), $ =
|
|
338
|
-
if (!
|
|
339
|
-
|
|
353
|
+
let Ze = h(() => {
|
|
354
|
+
P.current.onCancel();
|
|
355
|
+
}, []), $ = h(async () => {
|
|
356
|
+
if (!be.current) {
|
|
357
|
+
be.current = !0, N.current = !1, K(""), U(void 0), W(void 0), M.current.clear(), B("capturing");
|
|
340
358
|
try {
|
|
341
|
-
let
|
|
342
|
-
|
|
343
|
-
let
|
|
344
|
-
width:
|
|
345
|
-
height:
|
|
359
|
+
let e = await n();
|
|
360
|
+
Z(e);
|
|
361
|
+
let t = {
|
|
362
|
+
width: e.width,
|
|
363
|
+
height: e.height
|
|
346
364
|
};
|
|
347
|
-
|
|
365
|
+
je(t), P.current.onSettings?.(t), G("system-camera");
|
|
348
366
|
let r;
|
|
349
367
|
try {
|
|
350
|
-
let
|
|
351
|
-
|
|
368
|
+
let t = e.getContext("2d", { willReadFrequently: !0 })?.getImageData(0, 0, e.width, e.height).data;
|
|
369
|
+
t && (r = s(t));
|
|
352
370
|
} catch {
|
|
353
371
|
r = void 0;
|
|
354
372
|
}
|
|
355
|
-
if (
|
|
356
|
-
|
|
357
|
-
|
|
373
|
+
if (P.current.useCase === "drivers-license" && Y.current === "back") {
|
|
374
|
+
U(void 0), W(void 0), M.current.clear(), j.current = {}, B("captured");
|
|
375
|
+
let n = await f(e);
|
|
376
|
+
await Q(e, n?.quad), await F.current({
|
|
377
|
+
frame: e,
|
|
358
378
|
reason: "manual",
|
|
359
379
|
method: "system-camera",
|
|
360
|
-
settings:
|
|
380
|
+
settings: t,
|
|
361
381
|
luminance: r
|
|
362
382
|
});
|
|
363
383
|
return;
|
|
364
384
|
}
|
|
365
|
-
let
|
|
366
|
-
modelUrl:
|
|
367
|
-
ortWasmPaths:
|
|
385
|
+
let a = await i(e, {
|
|
386
|
+
modelUrl: w,
|
|
387
|
+
ortWasmPaths: T
|
|
368
388
|
});
|
|
369
|
-
if (
|
|
370
|
-
|
|
389
|
+
if (a.status !== "success" || !a.corners || !a.quad) {
|
|
390
|
+
N.current = !0, B("error"), K(a.message), P.current.onError?.(Error(a.message));
|
|
371
391
|
return;
|
|
372
392
|
}
|
|
373
|
-
|
|
374
|
-
quad:
|
|
375
|
-
sourceWidth:
|
|
376
|
-
sourceHeight:
|
|
377
|
-
},
|
|
378
|
-
let
|
|
379
|
-
frame:
|
|
380
|
-
detection:
|
|
393
|
+
j.current = {
|
|
394
|
+
quad: a.quad,
|
|
395
|
+
sourceWidth: a.sourceWidth,
|
|
396
|
+
sourceHeight: a.sourceHeight
|
|
397
|
+
}, a.quad && U(a.quad), B("captured");
|
|
398
|
+
let o = {
|
|
399
|
+
frame: e,
|
|
400
|
+
detection: a,
|
|
381
401
|
reason: "manual",
|
|
382
402
|
method: "system-camera",
|
|
383
|
-
settings:
|
|
403
|
+
settings: t,
|
|
384
404
|
luminance: r,
|
|
385
|
-
displayedQuad:
|
|
386
|
-
displaySourceWidth:
|
|
387
|
-
displaySourceHeight:
|
|
405
|
+
displayedQuad: a.quad,
|
|
406
|
+
displaySourceWidth: a.sourceWidth,
|
|
407
|
+
displaySourceHeight: a.sourceHeight
|
|
388
408
|
};
|
|
389
|
-
if (
|
|
390
|
-
await
|
|
409
|
+
if (P.current.useCase === "drivers-license") {
|
|
410
|
+
await F.current(o);
|
|
391
411
|
return;
|
|
392
412
|
}
|
|
393
|
-
await
|
|
413
|
+
await me(P.current.onCapture, o);
|
|
394
414
|
} catch (e) {
|
|
395
415
|
let t = e instanceof Error ? e : /* @__PURE__ */ Error("Could not take a photo.");
|
|
396
416
|
if (t.message === "No photo was selected.") {
|
|
397
|
-
if (
|
|
398
|
-
|
|
417
|
+
if (He.current) {
|
|
418
|
+
B("error");
|
|
399
419
|
return;
|
|
400
420
|
}
|
|
401
|
-
|
|
421
|
+
P.current.onCancel();
|
|
402
422
|
return;
|
|
403
423
|
}
|
|
404
|
-
|
|
424
|
+
N.current = !0, K(t.message), B("error"), P.current.onError?.(t);
|
|
405
425
|
} finally {
|
|
406
|
-
|
|
426
|
+
be.current = !1;
|
|
407
427
|
}
|
|
408
428
|
}
|
|
409
429
|
}, [
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
430
|
+
Z,
|
|
431
|
+
w,
|
|
432
|
+
T,
|
|
433
|
+
Q
|
|
434
|
+
]), Qe = h(async (e) => {
|
|
435
|
+
let t = await Se.current;
|
|
415
436
|
if (t) {
|
|
416
|
-
|
|
437
|
+
Ke(!0);
|
|
417
438
|
try {
|
|
418
439
|
let n = await t.submitStill(e.frame, e.detection);
|
|
419
440
|
if (n.kind === "need-back") {
|
|
420
|
-
|
|
421
|
-
|
|
441
|
+
R.current?.abort();
|
|
442
|
+
let e = new AbortController();
|
|
443
|
+
R.current = e, k.current?.stop(), k.current = void 0, Y.current = "front", I.current = !1, We("flip"), N.current = !1, K(""), H(void 0), U(void 0), W(void 0), M.current.clear(), B("ready"), Ke(!1);
|
|
444
|
+
try {
|
|
445
|
+
await ne(e.signal);
|
|
446
|
+
} catch {
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
if (R.current !== e || e.signal.aborted) return;
|
|
450
|
+
if (R.current = void 0, Y.current = "back", We("back"), X(), D) {
|
|
451
|
+
B("ready");
|
|
422
452
|
return;
|
|
423
453
|
}
|
|
424
|
-
|
|
454
|
+
z?.paused && z.play(), B("starting"), Fe((e) => e + 1);
|
|
425
455
|
return;
|
|
426
456
|
}
|
|
427
457
|
if (n.kind === "retry") {
|
|
428
|
-
|
|
458
|
+
N.current = !0, K(n.message), B("error");
|
|
429
459
|
return;
|
|
430
460
|
}
|
|
431
|
-
await
|
|
461
|
+
await me(P.current.onDriverLicense, n.result);
|
|
432
462
|
} catch (e) {
|
|
433
463
|
let t = e instanceof Error ? e : /* @__PURE__ */ Error("Driver’s license scan failed.");
|
|
434
|
-
|
|
464
|
+
N.current = !0, K(t.message), B("error"), P.current.onError?.(t);
|
|
435
465
|
} finally {
|
|
436
|
-
|
|
466
|
+
Ke(!1);
|
|
437
467
|
}
|
|
438
468
|
}
|
|
439
469
|
}, [
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
470
|
+
X,
|
|
471
|
+
z,
|
|
472
|
+
D
|
|
443
473
|
]);
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
}, [
|
|
447
|
-
let
|
|
448
|
-
if (
|
|
474
|
+
oe(() => {
|
|
475
|
+
F.current = Qe;
|
|
476
|
+
}, [Qe]);
|
|
477
|
+
let $e = h(async () => {
|
|
478
|
+
if (D) {
|
|
449
479
|
await $();
|
|
450
480
|
return;
|
|
451
481
|
}
|
|
452
|
-
let e =
|
|
453
|
-
if (e &&
|
|
482
|
+
let e = O.current;
|
|
483
|
+
if (e && P.current.useCase === "drivers-license" && Y.current === "back") {
|
|
454
484
|
try {
|
|
455
|
-
let t = await e.capturePhoto();
|
|
456
|
-
if (!
|
|
457
|
-
|
|
485
|
+
let t = await e.capturePhoto(), n = await f(t.frame);
|
|
486
|
+
if (!n?.text || I.current) return;
|
|
487
|
+
I.current = !0, L.current?.abort(), A.current = t, G(t.method), J(t.diagnostics), q(t.diagnostics), Z(t.frame, z), B("captured"), await Q(t.frame, n.quad), await F.current({
|
|
458
488
|
frame: t.frame,
|
|
459
489
|
reason: "manual",
|
|
460
490
|
method: t.method,
|
|
@@ -465,74 +495,75 @@ function ue({ open: m, useCase: h = "document", autoCapture: g = "defaultOn", ca
|
|
|
465
495
|
});
|
|
466
496
|
} catch (e) {
|
|
467
497
|
let t = e instanceof Error ? e : /* @__PURE__ */ Error("Could not capture the camera frame.");
|
|
468
|
-
|
|
469
|
-
let n =
|
|
470
|
-
n &&
|
|
498
|
+
N.current = !0, K(t.message);
|
|
499
|
+
let n = O.current?.getDiagnostics();
|
|
500
|
+
n && q(n), A.current?.diagnostics && J(A.current.diagnostics), B("error"), P.current.onError?.(t);
|
|
471
501
|
}
|
|
472
502
|
return;
|
|
473
503
|
}
|
|
474
504
|
try {
|
|
475
|
-
await
|
|
505
|
+
await k.current?.capture();
|
|
476
506
|
} catch (e) {
|
|
477
507
|
let t = e instanceof Error ? e : /* @__PURE__ */ Error("Could not capture the camera frame.");
|
|
478
|
-
|
|
479
|
-
let n =
|
|
480
|
-
n &&
|
|
508
|
+
N.current = !0, K(t.message);
|
|
509
|
+
let n = O.current?.getDiagnostics();
|
|
510
|
+
n && q(n), A.current?.diagnostics && J(A.current.diagnostics), B("error"), P.current.onError?.(t);
|
|
481
511
|
}
|
|
482
512
|
}, [
|
|
483
513
|
$,
|
|
514
|
+
Z,
|
|
515
|
+
z,
|
|
484
516
|
Q,
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
Ye.current = !1;
|
|
517
|
+
D
|
|
518
|
+
]), et = _($);
|
|
519
|
+
et.current = $;
|
|
520
|
+
let tt = _(!1);
|
|
521
|
+
oe(() => {
|
|
522
|
+
if (!d || !D) {
|
|
523
|
+
tt.current = !1;
|
|
493
524
|
return;
|
|
494
525
|
}
|
|
495
|
-
if (!
|
|
496
|
-
if (
|
|
497
|
-
|
|
526
|
+
if (!tt.current) {
|
|
527
|
+
if (tt.current = !0, N.current = !1, K(""), H(void 0), G(void 0), J(void 0), ze("idle"), U(void 0), W(void 0), M.current.clear(), X(), !e()) {
|
|
528
|
+
B("ready");
|
|
498
529
|
return;
|
|
499
530
|
}
|
|
500
|
-
|
|
531
|
+
et.current();
|
|
501
532
|
}
|
|
502
533
|
}, [
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
534
|
+
d,
|
|
535
|
+
D,
|
|
536
|
+
X
|
|
506
537
|
]);
|
|
507
|
-
let
|
|
508
|
-
if (
|
|
538
|
+
let nt = h(() => {
|
|
539
|
+
if (N.current = !1, I.current = !1, K(""), J(void 0), ze("idle"), H(void 0), U(void 0), W(void 0), M.current.clear(), D) {
|
|
509
540
|
$();
|
|
510
541
|
return;
|
|
511
542
|
}
|
|
512
|
-
if (
|
|
513
|
-
|
|
543
|
+
if (X(), m === "drivers-license") {
|
|
544
|
+
B("starting"), Fe((e) => e + 1);
|
|
514
545
|
return;
|
|
515
546
|
}
|
|
516
|
-
let e =
|
|
517
|
-
|
|
547
|
+
let e = O.current;
|
|
548
|
+
z?.paused && z.play(), B(e ? "ready" : "starting"), e || Fe((e) => e + 1);
|
|
518
549
|
}, [
|
|
519
550
|
$,
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
]),
|
|
525
|
-
let t =
|
|
526
|
-
t && (await t.setTorch(e),
|
|
527
|
-
}, []),
|
|
528
|
-
|
|
529
|
-
}, []),
|
|
530
|
-
let e =
|
|
551
|
+
X,
|
|
552
|
+
z,
|
|
553
|
+
m,
|
|
554
|
+
D
|
|
555
|
+
]), rt = h(async (e) => {
|
|
556
|
+
let t = O.current;
|
|
557
|
+
t && (await t.setTorch(e), q(t.getDiagnostics()));
|
|
558
|
+
}, []), it = h((e) => {
|
|
559
|
+
k.current?.setAutoCapture(e);
|
|
560
|
+
}, []), at = h(async () => {
|
|
561
|
+
let e = Ce.current, t = O.current?.getDiagnostics() ?? e.diagnostics, n = e.finderStatus, r = re({
|
|
531
562
|
error: e.error || void 0,
|
|
532
563
|
captureMethod: e.captureMethod,
|
|
533
|
-
luminance:
|
|
534
|
-
fallbackReason:
|
|
535
|
-
shutter: e.shutterDiagnostics ??
|
|
564
|
+
luminance: A.current?.luminance,
|
|
565
|
+
fallbackReason: A.current?.fallbackReason,
|
|
566
|
+
shutter: e.shutterDiagnostics ?? A.current?.diagnostics,
|
|
536
567
|
live: t,
|
|
537
568
|
finder: n ? {
|
|
538
569
|
state: n.state,
|
|
@@ -557,55 +588,55 @@ function ue({ open: m, useCase: h = "document", autoCapture: g = "defaultOn", ca
|
|
|
557
588
|
let t = document.execCommand("copy");
|
|
558
589
|
if (e.remove(), !t) throw Error("Clipboard copy is unavailable.");
|
|
559
590
|
}
|
|
560
|
-
|
|
591
|
+
ze("copied");
|
|
561
592
|
} catch {
|
|
562
|
-
|
|
593
|
+
ze("failed");
|
|
563
594
|
}
|
|
564
|
-
}, []),
|
|
565
|
-
capture:
|
|
566
|
-
cancel:
|
|
567
|
-
retry:
|
|
568
|
-
setTorch:
|
|
569
|
-
setAutoCapture:
|
|
570
|
-
copyReport:
|
|
571
|
-
getState:
|
|
595
|
+
}, []), ot = h(() => Ce.current, []), st = se(() => ({
|
|
596
|
+
capture: $e,
|
|
597
|
+
cancel: Ze,
|
|
598
|
+
retry: nt,
|
|
599
|
+
setTorch: rt,
|
|
600
|
+
setAutoCapture: it,
|
|
601
|
+
copyReport: at,
|
|
602
|
+
getState: ot
|
|
572
603
|
}), [
|
|
573
|
-
qe,
|
|
574
|
-
Ge,
|
|
575
|
-
Xe,
|
|
576
|
-
Ze,
|
|
577
|
-
Qe,
|
|
578
604
|
$e,
|
|
579
|
-
|
|
605
|
+
Ze,
|
|
606
|
+
nt,
|
|
607
|
+
rt,
|
|
608
|
+
it,
|
|
609
|
+
at,
|
|
610
|
+
ot
|
|
580
611
|
]);
|
|
581
|
-
|
|
582
|
-
if (
|
|
583
|
-
|
|
612
|
+
g(() => {
|
|
613
|
+
if (E) return E.current = st, () => {
|
|
614
|
+
E.current = null;
|
|
584
615
|
};
|
|
585
|
-
}, [
|
|
586
|
-
let
|
|
587
|
-
...
|
|
588
|
-
...
|
|
589
|
-
bindPreview:
|
|
616
|
+
}, [st, E]);
|
|
617
|
+
let ct = {
|
|
618
|
+
...Xe,
|
|
619
|
+
...st,
|
|
620
|
+
bindPreview: Ye
|
|
590
621
|
};
|
|
591
|
-
return /* @__PURE__ */
|
|
592
|
-
value:
|
|
593
|
-
children:
|
|
622
|
+
return /* @__PURE__ */ y(ue.Provider, {
|
|
623
|
+
value: ct,
|
|
624
|
+
children: ve
|
|
594
625
|
});
|
|
595
626
|
}
|
|
596
627
|
//#endregion
|
|
597
628
|
//#region src/react/hooks.ts
|
|
598
|
-
function
|
|
599
|
-
return
|
|
629
|
+
function ge() {
|
|
630
|
+
return _(null);
|
|
600
631
|
}
|
|
601
|
-
function
|
|
602
|
-
let e =
|
|
632
|
+
function w() {
|
|
633
|
+
let e = ae(ue);
|
|
603
634
|
if (!e) throw Error("useScanner must be used within ScannerProvider.");
|
|
604
635
|
return e;
|
|
605
636
|
}
|
|
606
637
|
//#endregion
|
|
607
638
|
//#region src/live-overlay-geometry.ts
|
|
608
|
-
function
|
|
639
|
+
function T(e, t, n, r, i) {
|
|
609
640
|
let a = Math.max(1, e), o = Math.max(1, t), s = Math.max(1, n), c = Math.max(1, r), l = s / a, u = c / o, d = i === "cover" ? Math.max(l, u) : Math.min(l, u), f = (s - a * d) / 2, p = (c - o * d) / 2;
|
|
610
641
|
if (i === "contain") return {
|
|
611
642
|
viewBox: `0 0 ${a} ${o}`,
|
|
@@ -614,9 +645,9 @@ function O(e, t, n, r, i) {
|
|
|
614
645
|
offsetX: f,
|
|
615
646
|
offsetY: p
|
|
616
647
|
};
|
|
617
|
-
let
|
|
648
|
+
let ee = s / d, te = c / d;
|
|
618
649
|
return {
|
|
619
|
-
viewBox: `${-f / d} ${-p / d} ${
|
|
650
|
+
viewBox: `${-f / d} ${-p / d} ${ee} ${te}`,
|
|
620
651
|
preserveAspectRatio: "none",
|
|
621
652
|
scale: d,
|
|
622
653
|
offsetX: f,
|
|
@@ -625,10 +656,10 @@ function O(e, t, n, r, i) {
|
|
|
625
656
|
}
|
|
626
657
|
//#endregion
|
|
627
658
|
//#region src/components/ModelDownloadRing.tsx
|
|
628
|
-
function
|
|
659
|
+
function _e({ snapshot: e }) {
|
|
629
660
|
if (!e.downloading) return null;
|
|
630
661
|
let t = e.total && e.total > 0 ? Math.min(1, e.loaded / e.total) : null, n = t === null ? null : Math.round(t * 100), r = 2 * Math.PI * 28;
|
|
631
|
-
return /* @__PURE__ */
|
|
662
|
+
return /* @__PURE__ */ b("div", {
|
|
632
663
|
className: `model-download-ring${t === null ? " is-indeterminate" : ""}`,
|
|
633
664
|
role: "progressbar",
|
|
634
665
|
"aria-label": "Model download",
|
|
@@ -637,15 +668,15 @@ function fe({ snapshot: e }) {
|
|
|
637
668
|
"aria-valuenow": n ?? void 0,
|
|
638
669
|
"data-loaded": e.loaded,
|
|
639
670
|
"data-total": e.total ?? "",
|
|
640
|
-
children: [/* @__PURE__ */
|
|
671
|
+
children: [/* @__PURE__ */ b("svg", {
|
|
641
672
|
viewBox: "0 0 72 72",
|
|
642
673
|
"aria-hidden": "true",
|
|
643
|
-
children: [/* @__PURE__ */
|
|
674
|
+
children: [/* @__PURE__ */ y("circle", {
|
|
644
675
|
className: "track",
|
|
645
676
|
cx: "36",
|
|
646
677
|
cy: "36",
|
|
647
678
|
r: 28
|
|
648
|
-
}), /* @__PURE__ */
|
|
679
|
+
}), /* @__PURE__ */ y("circle", {
|
|
649
680
|
className: "value",
|
|
650
681
|
cx: "36",
|
|
651
682
|
cy: "36",
|
|
@@ -653,20 +684,20 @@ function fe({ snapshot: e }) {
|
|
|
653
684
|
strokeDasharray: t === null ? void 0 : `${r} ${r}`,
|
|
654
685
|
strokeDashoffset: t === null ? void 0 : r * (1 - t)
|
|
655
686
|
})]
|
|
656
|
-
}), n === null ? /* @__PURE__ */
|
|
687
|
+
}), n === null ? /* @__PURE__ */ y("strong", {
|
|
657
688
|
className: "model-download-ring__pending",
|
|
658
689
|
children: "…"
|
|
659
|
-
}) : /* @__PURE__ */
|
|
690
|
+
}) : /* @__PURE__ */ b("strong", { children: [n, "%"] })]
|
|
660
691
|
});
|
|
661
692
|
}
|
|
662
693
|
//#endregion
|
|
663
694
|
//#region src/react/guidance.ts
|
|
664
|
-
function
|
|
665
|
-
if (!(e.usingSystemCamera || e.licenseBusy) && e.phase !== "error") return e.phase === "starting" ? e.licenseHeadline : e.phase === "capturing" ? "Capturing full resolution…" : e.phase === "captured" ? "Document captured" : e.holdStillSeconds && e.holdStillSeconds > 0 ?
|
|
695
|
+
function E(e) {
|
|
696
|
+
if (!(e.usingSystemCamera || e.licenseBusy) && e.phase !== "error") return e.licenseFlipCue || e.phase === "starting" ? e.licenseHeadline : e.phase === "capturing" ? "Capturing full resolution…" : e.phase === "captured" ? "Document captured" : e.holdStillSeconds && e.holdStillSeconds > 0 ? d(e.holdStillSeconds) : e.guidanceHint && e.guidanceReason && e.guidanceReason !== "place-document" ? e.guidanceHint : e.licenseHeadline ?? e.guidanceHint ?? "Place the document in the frame";
|
|
666
697
|
}
|
|
667
698
|
//#endregion
|
|
668
699
|
//#region src/react/parts.tsx
|
|
669
|
-
var
|
|
700
|
+
var ve = {
|
|
670
701
|
primaryColorHex: "--scanner-overlay-primary",
|
|
671
702
|
seekingColorHex: "--scanner-overlay-seeking",
|
|
672
703
|
detectingColorHex: "--scanner-overlay-detecting",
|
|
@@ -674,46 +705,46 @@ var pe = {
|
|
|
674
705
|
readyColorHex: "--scanner-overlay-ready",
|
|
675
706
|
capturedColorHex: "--scanner-overlay-captured"
|
|
676
707
|
};
|
|
677
|
-
function
|
|
708
|
+
function D(e) {
|
|
678
709
|
if (!e) return;
|
|
679
710
|
let t = {};
|
|
680
|
-
for (let [n, r] of Object.entries(
|
|
711
|
+
for (let [n, r] of Object.entries(ve)) {
|
|
681
712
|
let i = e[n]?.trim();
|
|
682
713
|
i && (t[r] = i);
|
|
683
714
|
}
|
|
684
715
|
return Object.keys(t).length > 0 ? t : void 0;
|
|
685
716
|
}
|
|
686
|
-
function
|
|
687
|
-
let i =
|
|
717
|
+
function O({ theme: e, style: t, title: n, children: r }) {
|
|
718
|
+
let i = w();
|
|
688
719
|
if (!i.open) return null;
|
|
689
|
-
let a = n ?? (i.useCase === "drivers-license" ? "Scan a driver’s license" : "Scan a document"), o =
|
|
720
|
+
let a = n ?? (i.useCase === "drivers-license" ? "Scan a driver’s license" : "Scan a document"), o = D(e), s = o ? {
|
|
690
721
|
...t,
|
|
691
722
|
...o
|
|
692
723
|
} : t;
|
|
693
|
-
return /* @__PURE__ */
|
|
724
|
+
return /* @__PURE__ */ b("div", {
|
|
694
725
|
className: `scanner-camera-overlay ${i.phase === "captured" || i.finderStatus?.state === "captured" ? "is-captured" : ""} ${i.usingSystemCamera ? "is-system-camera" : ""}`.trim(),
|
|
695
726
|
style: s,
|
|
696
727
|
role: "dialog",
|
|
697
728
|
"aria-modal": "true",
|
|
698
729
|
"aria-label": a,
|
|
699
|
-
children: [r, /* @__PURE__ */
|
|
730
|
+
children: [r, /* @__PURE__ */ y(P, {})]
|
|
700
731
|
});
|
|
701
732
|
}
|
|
702
|
-
function
|
|
703
|
-
let { bindPreview: e, frozenPreviewUrl: t, usingSystemCamera: n } =
|
|
733
|
+
function k() {
|
|
734
|
+
let { bindPreview: e, frozenPreviewUrl: t, usingSystemCamera: n } = w(), r = _(null), i = h((t) => {
|
|
704
735
|
r.current = t, e(t);
|
|
705
736
|
}, [e]);
|
|
706
|
-
return
|
|
737
|
+
return g(() => {
|
|
707
738
|
t && r.current?.pause();
|
|
708
|
-
}, [t]), n ? t ? /* @__PURE__ */
|
|
739
|
+
}, [t]), n ? t ? /* @__PURE__ */ y("img", {
|
|
709
740
|
src: t,
|
|
710
741
|
className: "scanner-camera-overlay__video scanner-camera-overlay__still",
|
|
711
742
|
alt: "",
|
|
712
743
|
"aria-label": "Captured document"
|
|
713
|
-
}) : /* @__PURE__ */
|
|
744
|
+
}) : /* @__PURE__ */ y("div", {
|
|
714
745
|
className: "scanner-camera-overlay__video",
|
|
715
746
|
"aria-hidden": "true"
|
|
716
|
-
}) : /* @__PURE__ */
|
|
747
|
+
}) : /* @__PURE__ */ b(ce, { children: [/* @__PURE__ */ y("video", {
|
|
717
748
|
ref: i,
|
|
718
749
|
className: "scanner-camera-overlay__video",
|
|
719
750
|
muted: !0,
|
|
@@ -722,35 +753,36 @@ function M() {
|
|
|
722
753
|
style: { objectFit: "cover" },
|
|
723
754
|
"aria-hidden": !!t,
|
|
724
755
|
"aria-label": "Rear camera preview"
|
|
725
|
-
}), t ? /* @__PURE__ */
|
|
756
|
+
}), t ? /* @__PURE__ */ y("img", {
|
|
726
757
|
src: t,
|
|
727
758
|
className: "scanner-camera-overlay__video scanner-camera-overlay__still",
|
|
728
759
|
alt: "",
|
|
729
760
|
"aria-label": "Captured document"
|
|
730
761
|
}) : null] });
|
|
731
762
|
}
|
|
732
|
-
function
|
|
733
|
-
let { finderStatus: e, displayQuad: t, previewSize: n } =
|
|
734
|
-
if (!t || !
|
|
735
|
-
let
|
|
736
|
-
return /* @__PURE__ */
|
|
737
|
-
className: `scanner-camera-overlay__quad ${
|
|
738
|
-
viewBox:
|
|
739
|
-
preserveAspectRatio:
|
|
740
|
-
"aria-label": `${e
|
|
741
|
-
children: /* @__PURE__ */
|
|
763
|
+
function ye() {
|
|
764
|
+
let { finderStatus: e, displayQuad: t, previewSize: n, barcodeOverlay: r } = w(), i = e?.sourceWidth ?? r?.width, a = e?.sourceHeight ?? r?.height;
|
|
765
|
+
if (!t || !i || !a) return null;
|
|
766
|
+
let o = T(i, a, n.width, n.height, "cover"), s = r ? "ready" : e?.state;
|
|
767
|
+
return /* @__PURE__ */ y("svg", {
|
|
768
|
+
className: `scanner-camera-overlay__quad ${s ?? ""}`.trim(),
|
|
769
|
+
viewBox: o.viewBox,
|
|
770
|
+
preserveAspectRatio: o.preserveAspectRatio,
|
|
771
|
+
"aria-label": r ? "PDF417 barcode boundary" : `${e?.state ?? "document"} document boundary`,
|
|
772
|
+
children: /* @__PURE__ */ y("polygon", { points: `${t.topLeft.x},${t.topLeft.y} ${t.topRight.x},${t.topRight.y} ${t.bottomRight.x},${t.bottomRight.y} ${t.bottomLeft.x},${t.bottomLeft.y}` })
|
|
742
773
|
});
|
|
743
774
|
}
|
|
744
|
-
function
|
|
745
|
-
let { phase: t, cancel: n, usingSystemCamera: r, useCase: i, licenseSide: a, licenseBusy: o } =
|
|
746
|
-
return /* @__PURE__ */
|
|
775
|
+
function A({ title: e }) {
|
|
776
|
+
let { phase: t, cancel: n, usingSystemCamera: r, useCase: i, licenseSide: a, licenseBusy: o } = w(), s = i === "drivers-license" ? m(a ?? "front", r) : void 0, c = e ?? s?.title ?? "Scan a document";
|
|
777
|
+
return /* @__PURE__ */ b("div", {
|
|
747
778
|
className: "scanner-camera-overlay__topbar",
|
|
748
|
-
children: [/* @__PURE__ */
|
|
779
|
+
children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("strong", { children: c }), /* @__PURE__ */ b("span", {
|
|
749
780
|
"aria-live": "polite",
|
|
750
781
|
children: [
|
|
751
782
|
o && (a === "back" ? "Reading the barcode…" : "Reading the front…"),
|
|
783
|
+
!o && s && a === "flip" && "Turn the license over",
|
|
752
784
|
!o && s && t === "error" && (a === "back" ? "Could not read the back" : "Could not read the front"),
|
|
753
|
-
!o && !s && r && /* @__PURE__ */
|
|
785
|
+
!o && !s && r && /* @__PURE__ */ b(ce, { children: [
|
|
754
786
|
t === "starting" && "Preparing the system camera…",
|
|
755
787
|
t === "ready" && "Take a photo. There is no live document guide.",
|
|
756
788
|
t === "capturing" && "Looking for a document…",
|
|
@@ -759,7 +791,7 @@ function P({ title: e }) {
|
|
|
759
791
|
] }),
|
|
760
792
|
!o && !s && !r && t === "error" && "Camera unavailable"
|
|
761
793
|
]
|
|
762
|
-
})] }), /* @__PURE__ */
|
|
794
|
+
})] }), /* @__PURE__ */ y("button", {
|
|
763
795
|
type: "button",
|
|
764
796
|
onClick: n,
|
|
765
797
|
"aria-label": "Close camera",
|
|
@@ -767,71 +799,75 @@ function P({ title: e }) {
|
|
|
767
799
|
})]
|
|
768
800
|
});
|
|
769
801
|
}
|
|
770
|
-
function
|
|
771
|
-
let { phase: e, error: t, diagnostics: n, copyState: r, retry: i, copyReport: a, cancel: o, usingSystemCamera: s, frozenPreviewUrl: c, useCase: l, licenseSide: u, licenseBusy: d } =
|
|
772
|
-
return
|
|
802
|
+
function j() {
|
|
803
|
+
let { phase: e, error: t, diagnostics: n, copyState: r, retry: i, copyReport: a, cancel: o, usingSystemCamera: s, frozenPreviewUrl: c, useCase: l, licenseSide: u, licenseBusy: d } = w(), f = l === "drivers-license" ? m(u ?? "front", s) : void 0;
|
|
804
|
+
return u === "flip" && f ? s ? /* @__PURE__ */ b("div", {
|
|
805
|
+
className: "scanner-camera-overlay__message",
|
|
806
|
+
"aria-live": "polite",
|
|
807
|
+
children: [/* @__PURE__ */ y("strong", { children: f.headline }), /* @__PURE__ */ y("p", { children: f.detail })]
|
|
808
|
+
}) : null : e === "error" ? /* @__PURE__ */ b("div", {
|
|
773
809
|
className: "scanner-camera-overlay__message",
|
|
774
810
|
role: "alert",
|
|
775
811
|
children: [
|
|
776
|
-
/* @__PURE__ */
|
|
777
|
-
/* @__PURE__ */
|
|
778
|
-
/* @__PURE__ */
|
|
779
|
-
/* @__PURE__ */
|
|
812
|
+
/* @__PURE__ */ y("strong", { children: f ? u === "back" ? "Could not read the back" : "Could not read the front" : s ? c ? "No document found" : "Could not take a photo" : n ? "Capture failed" : "Could not open the camera" }),
|
|
813
|
+
/* @__PURE__ */ y("p", { children: t }),
|
|
814
|
+
/* @__PURE__ */ b("div", { children: [
|
|
815
|
+
/* @__PURE__ */ y("button", {
|
|
780
816
|
type: "button",
|
|
781
817
|
onClick: i,
|
|
782
818
|
children: "Try again"
|
|
783
819
|
}),
|
|
784
|
-
/* @__PURE__ */
|
|
820
|
+
/* @__PURE__ */ y("button", {
|
|
785
821
|
type: "button",
|
|
786
822
|
onClick: () => void a(),
|
|
787
823
|
children: r === "copied" ? "Copied" : r === "failed" ? "Copy failed" : "Copy report"
|
|
788
824
|
}),
|
|
789
|
-
/* @__PURE__ */
|
|
825
|
+
/* @__PURE__ */ y("button", {
|
|
790
826
|
type: "button",
|
|
791
827
|
onClick: o,
|
|
792
828
|
children: "Cancel"
|
|
793
829
|
})
|
|
794
830
|
] })
|
|
795
831
|
]
|
|
796
|
-
}) : d ? /* @__PURE__ */
|
|
832
|
+
}) : d ? /* @__PURE__ */ b("div", {
|
|
797
833
|
className: "scanner-camera-overlay__message",
|
|
798
834
|
"aria-live": "polite",
|
|
799
835
|
children: [
|
|
800
|
-
/* @__PURE__ */
|
|
801
|
-
/* @__PURE__ */
|
|
802
|
-
/* @__PURE__ */
|
|
836
|
+
/* @__PURE__ */ y("span", { className: "scanner-camera-overlay__spinner" }),
|
|
837
|
+
/* @__PURE__ */ y("strong", { children: u === "back" ? "Reading the barcode" : "Reading the front" }),
|
|
838
|
+
/* @__PURE__ */ y("p", { children: u === "back" ? "Decoding the AAMVA PDF417 on the back." : "Finding the card and reading the front with OCR." })
|
|
803
839
|
]
|
|
804
|
-
}) : s && e === "capturing" && !c ? /* @__PURE__ */
|
|
840
|
+
}) : s && e === "capturing" && !c ? /* @__PURE__ */ b("div", {
|
|
805
841
|
className: "scanner-camera-overlay__message",
|
|
806
842
|
"aria-live": "polite",
|
|
807
843
|
children: [
|
|
808
|
-
/* @__PURE__ */
|
|
809
|
-
/* @__PURE__ */
|
|
810
|
-
/* @__PURE__ */
|
|
844
|
+
/* @__PURE__ */ y("span", { className: "scanner-camera-overlay__spinner" }),
|
|
845
|
+
/* @__PURE__ */ y("strong", { children: f ? f.headline : "Opening the system camera" }),
|
|
846
|
+
/* @__PURE__ */ y("p", { children: f ? f.detail : "There is no live document guide. We find the page after you take the photo." })
|
|
811
847
|
]
|
|
812
|
-
}) : s && e === "ready" && !c ? /* @__PURE__ */
|
|
848
|
+
}) : s && e === "ready" && !c ? /* @__PURE__ */ b("div", {
|
|
813
849
|
className: "scanner-camera-overlay__message",
|
|
814
850
|
"aria-live": "polite",
|
|
815
|
-
children: [/* @__PURE__ */
|
|
816
|
-
}) : e === "starting" && !s ? /* @__PURE__ */
|
|
851
|
+
children: [/* @__PURE__ */ y("strong", { children: f ? f.headline : "System camera" }), /* @__PURE__ */ y("p", { children: f ? f.detail : "Tap the shutter to open the Camera app. There is no live document guide." })]
|
|
852
|
+
}) : e === "starting" && !s ? /* @__PURE__ */ b("div", {
|
|
817
853
|
className: "scanner-camera-overlay__message",
|
|
818
854
|
"aria-live": "polite",
|
|
819
855
|
children: [
|
|
820
|
-
/* @__PURE__ */
|
|
821
|
-
/* @__PURE__ */
|
|
822
|
-
/* @__PURE__ */
|
|
856
|
+
/* @__PURE__ */ y("span", { className: "scanner-camera-overlay__spinner" }),
|
|
857
|
+
/* @__PURE__ */ y("strong", { children: "Requesting the highest practical resolution" }),
|
|
858
|
+
/* @__PURE__ */ y("p", { children: "Allow camera access to continue." })
|
|
823
859
|
]
|
|
824
860
|
}) : null;
|
|
825
861
|
}
|
|
826
|
-
function
|
|
827
|
-
let { finderStatus: e, detectorStatus: t, settings: n, usingSystemCamera: r, captureMethod: i, phase: a, useCase: o, licenseSide: s } =
|
|
828
|
-
if (r) return /* @__PURE__ */
|
|
862
|
+
function M() {
|
|
863
|
+
let { finderStatus: e, detectorStatus: t, settings: n, usingSystemCamera: r, captureMethod: i, phase: a, useCase: o, licenseSide: s } = w(), c = n?.width, l = n?.height, u = o === "drivers-license" ? ` · ${s === "back" ? "back" : s === "flip" ? "flip" : "front"}` : "";
|
|
864
|
+
if (r) return /* @__PURE__ */ y("div", {
|
|
829
865
|
className: "scanner-camera-overlay__status",
|
|
830
866
|
"aria-live": "polite",
|
|
831
|
-
children: /* @__PURE__ */
|
|
867
|
+
children: /* @__PURE__ */ b("div", {
|
|
832
868
|
className: "scanner-camera-overlay__status-line",
|
|
833
869
|
children: [
|
|
834
|
-
/* @__PURE__ */
|
|
870
|
+
/* @__PURE__ */ y("span", { className: a === "captured" ? "ready" : a === "error" ? "seeking" : "detecting" }),
|
|
835
871
|
i === "system-camera" ? "system camera" : "system camera · waiting",
|
|
836
872
|
u,
|
|
837
873
|
c && l ? ` · ${c}×${l}` : ""
|
|
@@ -839,13 +875,13 @@ function I() {
|
|
|
839
875
|
})
|
|
840
876
|
});
|
|
841
877
|
let d = o === "drivers-license" && s === "back", f = d && !e ? "reading" : e?.state ?? "detecting";
|
|
842
|
-
return /* @__PURE__ */
|
|
878
|
+
return /* @__PURE__ */ y("div", {
|
|
843
879
|
className: "scanner-camera-overlay__status",
|
|
844
880
|
"aria-live": "polite",
|
|
845
|
-
children: /* @__PURE__ */
|
|
881
|
+
children: /* @__PURE__ */ b("div", {
|
|
846
882
|
className: "scanner-camera-overlay__status-line",
|
|
847
883
|
children: [
|
|
848
|
-
/* @__PURE__ */
|
|
884
|
+
/* @__PURE__ */ y("span", { className: d && !e ? "detecting" : e?.state ?? "detecting" }),
|
|
849
885
|
f,
|
|
850
886
|
u,
|
|
851
887
|
e ? ` · ${Math.round(e.confidence * 100)}% · ${e.stableFrames}/${e.requiredStableFrames}` : "",
|
|
@@ -856,77 +892,78 @@ function I() {
|
|
|
856
892
|
})
|
|
857
893
|
});
|
|
858
894
|
}
|
|
859
|
-
function
|
|
860
|
-
let { diagnostics: e, shutterDiagnostics: t, captureMethod: n, copyState:
|
|
861
|
-
return /* @__PURE__ */
|
|
895
|
+
function N() {
|
|
896
|
+
let { diagnostics: e, shutterDiagnostics: t, captureMethod: n, copyState: r, copyReport: i } = w(), o = e?.engine ?? a();
|
|
897
|
+
return /* @__PURE__ */ b("dl", {
|
|
862
898
|
className: "scanner-camera-overlay__diagnostics",
|
|
863
899
|
"aria-label": "Camera diagnostics",
|
|
864
900
|
children: [
|
|
865
|
-
/* @__PURE__ */
|
|
901
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", { children: "engine" }), /* @__PURE__ */ b("dd", { children: [
|
|
866
902
|
o.engine,
|
|
867
903
|
"/",
|
|
868
904
|
o.browser,
|
|
869
905
|
o.iosWebKit ? " ios" : ""
|
|
870
906
|
] })] }),
|
|
871
|
-
/* @__PURE__ */
|
|
872
|
-
/* @__PURE__ */
|
|
873
|
-
/* @__PURE__ */
|
|
874
|
-
/* @__PURE__ */
|
|
875
|
-
/* @__PURE__ */
|
|
876
|
-
t ? /* @__PURE__ */
|
|
877
|
-
/* @__PURE__ */
|
|
907
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", { children: "video" }), /* @__PURE__ */ y("dd", { children: e ? `${e.videoWidth}×${e.videoHeight} rs${e.readyState}${e.paused ? " paused" : ""}${e.rendered ? "" : " hidden"}` : "starting" })] }),
|
|
908
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", { children: "track" }), /* @__PURE__ */ y("dd", { children: e ? `${e.trackReadyState}${e.trackMuted ? " muted" : ""}${e.trackEnabled ? "" : " disabled"}` : "—" })] }),
|
|
909
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", { children: "torch" }), /* @__PURE__ */ y("dd", { children: e ? `${e.torch.mode} · ${e.torch.supported ? e.torch.on ? "on" : "off" : "unsupported"}` : "starting" })] }),
|
|
910
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", { children: "luma" }), /* @__PURE__ */ y("dd", { children: e ? `live ${e.liveLuminance.toFixed(1)} · mirror ${e.mirrorLuminance.toFixed(1)}${Number.isFinite(e.mirrorAgeMs) ? ` (${Math.round(e.mirrorAgeMs)}ms)` : " (none)"}` : "—" })] }),
|
|
911
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", { children: "path" }), /* @__PURE__ */ y("dd", { children: n ?? "video-frame / live-mirror" })] }),
|
|
912
|
+
t ? /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", { children: "shutter" }), /* @__PURE__ */ y("dd", { children: `live ${t.liveLuminance.toFixed(1)} · mirror ${t.mirrorLuminance.toFixed(1)}${Number.isFinite(t.mirrorAgeMs) ? ` (${Math.round(t.mirrorAgeMs)}ms)` : " (none)"}` })] }) : null,
|
|
913
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", { children: "share" }), /* @__PURE__ */ y("dd", { children: /* @__PURE__ */ y("button", {
|
|
878
914
|
type: "button",
|
|
879
915
|
className: "scanner-camera-overlay__copy",
|
|
880
|
-
onClick: () => void
|
|
881
|
-
children:
|
|
916
|
+
onClick: () => void i(),
|
|
917
|
+
children: r === "copied" ? "Copied report" : r === "failed" ? "Copy failed" : "Copy report"
|
|
882
918
|
}) })] })
|
|
883
919
|
]
|
|
884
920
|
});
|
|
885
921
|
}
|
|
886
|
-
function
|
|
887
|
-
let { autoCapture: e, phase: t, finderStatus: n, diagnostics: r, captureMethod: i, settings: a, cancel: o, capture: s, setAutoCapture: c, setTorch: l, usingSystemCamera: u, licenseBusy: d, useCase: f, licenseSide: p, guidanceHint: ee } =
|
|
922
|
+
function be() {
|
|
923
|
+
let { autoCapture: e, phase: t, finderStatus: n, diagnostics: r, captureMethod: i, settings: a, cancel: o, capture: s, setAutoCapture: c, setTorch: l, usingSystemCamera: u, licenseBusy: d, useCase: f, licenseSide: p, guidanceHint: ee } = w(), te = a?.width, ne = a?.height, re = p !== "flip" && (u ? t === "ready" : e !== "only"), ie = f === "drivers-license" ? m(p ?? "front", u) : void 0, h = E({
|
|
888
924
|
usingSystemCamera: u,
|
|
889
925
|
phase: t,
|
|
890
926
|
licenseBusy: d,
|
|
891
927
|
holdStillSeconds: n?.holdStillSeconds,
|
|
892
928
|
guidanceHint: ee,
|
|
893
929
|
guidanceReason: n?.guidance.reason,
|
|
894
|
-
licenseHeadline:
|
|
895
|
-
|
|
896
|
-
|
|
930
|
+
licenseHeadline: ie?.headline,
|
|
931
|
+
licenseFlipCue: p === "flip"
|
|
932
|
+
}), ae = !!n?.holdStillSeconds;
|
|
933
|
+
return /* @__PURE__ */ b("div", {
|
|
897
934
|
className: "scanner-camera-overlay__controls",
|
|
898
935
|
children: [
|
|
899
|
-
/* @__PURE__ */
|
|
936
|
+
/* @__PURE__ */ y("button", {
|
|
900
937
|
type: "button",
|
|
901
938
|
className: "scanner-camera-overlay__cancel",
|
|
902
939
|
onClick: o,
|
|
903
940
|
children: "Cancel"
|
|
904
941
|
}),
|
|
905
|
-
/* @__PURE__ */
|
|
942
|
+
/* @__PURE__ */ b("div", {
|
|
906
943
|
className: "scanner-camera-overlay__capture",
|
|
907
944
|
children: [
|
|
908
|
-
|
|
909
|
-
className: `scanner-camera-overlay__guidance${
|
|
945
|
+
h && /* @__PURE__ */ y("p", {
|
|
946
|
+
className: `scanner-camera-overlay__guidance${ae ? " is-ready" : ""}`,
|
|
910
947
|
"aria-live": "polite",
|
|
911
|
-
children:
|
|
948
|
+
children: h
|
|
912
949
|
}),
|
|
913
|
-
|
|
950
|
+
re && /* @__PURE__ */ y("button", {
|
|
914
951
|
type: "button",
|
|
915
952
|
className: "scanner-camera-overlay__shutter",
|
|
916
953
|
onClick: () => void s(),
|
|
917
954
|
disabled: t !== "ready" || !!d,
|
|
918
955
|
"aria-label": u ? "Take a photo with the system camera" : "Capture full-resolution photo",
|
|
919
|
-
children: /* @__PURE__ */
|
|
956
|
+
children: /* @__PURE__ */ y("span", {})
|
|
920
957
|
}),
|
|
921
|
-
!u && /* @__PURE__ */
|
|
958
|
+
!u && /* @__PURE__ */ b("div", {
|
|
922
959
|
className: "scanner-camera-overlay__toggles",
|
|
923
|
-
children: [n?.autoCapture.visible && /* @__PURE__ */
|
|
960
|
+
children: [n?.autoCapture.visible && /* @__PURE__ */ b("label", { children: [/* @__PURE__ */ y("input", {
|
|
924
961
|
type: "checkbox",
|
|
925
962
|
checked: n.autoCapture.checked,
|
|
926
963
|
onChange: (e) => c(e.target.checked)
|
|
927
|
-
}), "Auto-capture"] }), r?.torch.visible && /* @__PURE__ */
|
|
964
|
+
}), "Auto-capture"] }), r?.torch.visible && /* @__PURE__ */ b("label", {
|
|
928
965
|
title: r.torch.automatic ? "Torch is controlled automatically from scene brightness" : void 0,
|
|
929
|
-
children: [/* @__PURE__ */
|
|
966
|
+
children: [/* @__PURE__ */ y("input", {
|
|
930
967
|
type: "checkbox",
|
|
931
968
|
checked: r.torch.on,
|
|
932
969
|
disabled: !r.torch.mutable,
|
|
@@ -936,18 +973,18 @@ function me() {
|
|
|
936
973
|
})
|
|
937
974
|
]
|
|
938
975
|
}),
|
|
939
|
-
/* @__PURE__ */
|
|
976
|
+
/* @__PURE__ */ b("div", {
|
|
940
977
|
className: "scanner-camera-overlay__quality",
|
|
941
|
-
children: [/* @__PURE__ */
|
|
978
|
+
children: [/* @__PURE__ */ y("span", { children: u ? "System camera" : i === "live-mirror" ? "Mirror" : "Camera" }), /* @__PURE__ */ y("strong", { children: te && ne ? `${te} × ${ne}` : u ? "Tap to photograph" : "Measuring…" })]
|
|
942
979
|
})
|
|
943
980
|
]
|
|
944
981
|
});
|
|
945
982
|
}
|
|
946
|
-
function
|
|
947
|
-
let { modelDownload: t } =
|
|
948
|
-
return /* @__PURE__ */
|
|
983
|
+
function P({ snapshot: e }) {
|
|
984
|
+
let { modelDownload: t } = w();
|
|
985
|
+
return /* @__PURE__ */ y(_e, { snapshot: e ?? t });
|
|
949
986
|
}
|
|
950
987
|
//#endregion
|
|
951
|
-
export {
|
|
988
|
+
export { be as ScannerControls, N as ScannerDiagnostics, O as ScannerFrame, P as ScannerModelDownload, j as ScannerNotice, k as ScannerPreview, he as ScannerProvider, ye as ScannerQuad, M as ScannerStatus, A as ScannerTopBar, w as useScanner, ge as useScannerRef };
|
|
952
989
|
|
|
953
990
|
//# sourceMappingURL=react.js.map
|