bry-biometric-collector 3.3.0-RC07 → 3.3.0-RC08

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 (26) hide show
  1. package/README.md +36 -0
  2. package/dist/CaptureBar_4b9ad872_3.3.0-RC08.js +847 -0
  3. package/dist/{DocumentCollector_39a1a662_3.3.0-RC07.js → DocumentCollector_a923befb_3.3.0-RC08.js} +52 -52
  4. package/dist/FaceCollector_28b0cb2f_3.3.0-RC08.js +2260 -0
  5. package/dist/FaceOval_ff5ff03f_3.3.0-RC08.js +212 -0
  6. package/dist/StreamCollector_a93fe7be_3.3.0-RC08.js +349 -0
  7. package/dist/ValidationAlert_7af02ba2_3.3.0-RC08.js +974 -0
  8. package/dist/{___vite-browser-external_commonjs-proxy_d99dffb1_3.3.0-RC07.js → ___vite-browser-external_commonjs-proxy_91447072_3.3.0-RC08.js} +1 -1
  9. package/dist/bry-biometric-collector-main.js +2 -2
  10. package/dist/{fingersApi_0f644f7a_3.3.0-RC07.js → fingersApi_b51da3fa_3.3.0-RC08.js} +2 -2
  11. package/dist/index.js +2 -2
  12. package/dist/{index_b0b3c37a_3.3.0-RC07.js → index_494f9d08_3.3.0-RC08.js} +3 -3
  13. package/dist/{index_8a654b33_3.3.0-RC07.js → index_8edd0e4d_3.3.0-RC08.js} +3 -3
  14. package/dist/{main_866e3050_3.3.0-RC07.js → main_e5443c19_3.3.0-RC08.js} +140 -140
  15. package/dist/style.css +1 -1
  16. package/package.json +1 -1
  17. package/dist/CaptureBar_bbb41c40_3.3.0-RC07.js +0 -893
  18. package/dist/FaceCollector_5e696802_3.3.0-RC07.js +0 -2391
  19. package/dist/StreamCollector_89664342_3.3.0-RC07.js +0 -348
  20. package/dist/ValidationAlert_81eae4eb_3.3.0-RC07.js +0 -847
  21. /package/dist/{en-us_c02e99cd_3.3.0-RC07.js → en-us_c02e99cd_3.3.0-RC08.js} +0 -0
  22. /package/dist/{es-cl_6f3eda53_3.3.0-RC07.js → es-cl_6f3eda53_3.3.0-RC08.js} +0 -0
  23. /package/dist/{face_api_0e3ce8c8_3.3.0-RC07.js → face_api_0e3ce8c8_3.3.0-RC08.js} +0 -0
  24. /package/dist/{index-idlf-detector_39cfdffa_3.3.0-RC07.js → index-idlf-detector_39cfdffa_3.3.0-RC08.js} +0 -0
  25. /package/dist/{index-idlf-detector_a819b3c8_3.3.0-RC07.js → index-idlf-detector_a819b3c8_3.3.0-RC08.js} +0 -0
  26. /package/dist/{pt-br_e7d46668_3.3.0-RC07.js → pt-br_e7d46668_3.3.0-RC08.js} +0 -0
@@ -1,2391 +0,0 @@
1
- import { w as Gt, S as mt, x as _t, y as bt, z as gt, B as R, C as W, D as p, E as X, G as m, H, I as Je, J as Q, K as Qe, L as I, M as D, N as ze, O as qe, P as fe, Q as _, R as he, T as me, U as _e, V as j, W as V, X as N, Y as Gi, $ as Yi, Z as Zi, _ as q, a0 as Fs, a1 as Fe, a2 as P, a3 as Xe, a4 as Zt, a5 as g, a6 as M, a7 as Wt, a8 as Mt, a9 as it, aa as Ns, ab as st, ac as pe, ad as Ps, ae as Le, af as Ut, ag as yi, ah as Bs, ai as je, aj as ke, ak as Ws, al as Ms, am as Vt, an as zt, ao as de, ap as ee, aq as Te, ar as ki, as as jt, at, au as Kt, av as Us, aw as nt, ax as Ti, ay as Oi, az as Vs, aA as zs, aB as js, aC as Ks, f as Ri, aD as Hs, aE as qs, aF as Js, aG as Ht, aH as K, m as dt, aI as qt, aJ as Qs, l as ie, aK as Di, aL as Xs, aM as ot, aN as lt, aO as Ii, aP as Gs, aQ as rt, A as Jt, aR as Oe, aS as Ys, aT as Ke, aU as Zs, aV as Ai, e as Se, aW as Qt, aX as ct, aY as xs, aZ as Xt, a_ as $s, a$ as ea, b0 as ta, b1 as ia, b2 as sa, b3 as aa, b4 as He, b5 as na, b6 as oa, b7 as ut, b8 as oe, b9 as vt, ba as la, bb as ra, d as Li, bc as ca, bd as ft, be as se, bf as ua, bg as fa, bh as Si, bi as xi, bj as ht, bk as da } from "./main_866e3050_3.3.0-RC07.js";
2
- import { V as ha, C as ma } from "./ValidationAlert_81eae4eb_3.3.0-RC07.js";
3
- import { detectSingleFace as _a, matchDimensions as ba, resizeResults as ga } from "./face_api_0e3ce8c8_3.3.0-RC07.js";
4
- import { W as va, C as pa } from "./CaptureBar_bbb41c40_3.3.0-RC07.js";
5
- const Yt = Gt(!1);
6
- class wa {
7
- isDevToolsOpen = !1;
8
- detectionCount = 0;
9
- checkSizeTimeout = null;
10
- detectionInterval = null;
11
- detectDevToolsBySize() {
12
- const e = window.outerWidth - window.innerWidth > 200, t = window.outerHeight - window.innerHeight > 200;
13
- return e || t;
14
- }
15
- checkForDevTools = () => {
16
- this.detectDevToolsBySize() ? (this.detectionCount++, this.detectionCount >= 2 && !this.isDevToolsOpen && (this.isDevToolsOpen = !0, Yt.set(this.isDevToolsOpen))) : (this.detectionCount = 0, this.isDevToolsOpen && (this.isDevToolsOpen = !1, Yt.set(this.isDevToolsOpen)));
17
- };
18
- startDetection() {
19
- this.stopDetection(), window.addEventListener("resize", () => {
20
- this.checkSizeTimeout && clearTimeout(this.checkSizeTimeout), this.checkSizeTimeout = window.setTimeout(this.checkForDevTools, 500);
21
- }), window.addEventListener("focus", () => setTimeout(this.checkForDevTools, 300)), this.detectionInterval = window.setInterval(this.checkForDevTools, 1e3), this.checkForDevTools();
22
- }
23
- stopDetection() {
24
- this.detectionInterval && (clearInterval(this.detectionInterval), this.detectionInterval = null), this.checkSizeTimeout && (clearTimeout(this.checkSizeTimeout), this.checkSizeTimeout = null);
25
- }
26
- }
27
- function Fi(i) {
28
- let e, t;
29
- return e = new va({}), {
30
- c() {
31
- he(e.$$.fragment);
32
- },
33
- m(a, o) {
34
- me(e, a, o), t = !0;
35
- },
36
- i(a) {
37
- t || (H(e.$$.fragment, a), t = !0);
38
- },
39
- o(a) {
40
- Q(e.$$.fragment, a), t = !1;
41
- },
42
- d(a) {
43
- _e(e, a);
44
- }
45
- };
46
- }
47
- function Ca(i) {
48
- let e, t, a, o = (
49
- /*showWatermark*/
50
- i[1] && Fi()
51
- );
52
- return {
53
- c() {
54
- e = p("div"), o && o.c(), this.c = X, m(e, "id", "face-oval"), m(e, "class", t = "loader " + /*loading*/
55
- (i[0] ? "loading" : "") + " z-10"), m(
56
- e,
57
- "style",
58
- /*styleVars*/
59
- i[2]
60
- );
61
- },
62
- m(r, f) {
63
- R(r, e, f), o && o.m(e, null), a = !0;
64
- },
65
- p(r, [f]) {
66
- /*showWatermark*/
67
- r[1] ? o ? f & /*showWatermark*/
68
- 2 && H(o, 1) : (o = Fi(), o.c(), H(o, 1), o.m(e, null)) : o && (Je(), Q(o, 1, 1, () => {
69
- o = null;
70
- }), Qe()), (!a || f & /*loading*/
71
- 1 && t !== (t = "loader " + /*loading*/
72
- (r[0] ? "loading" : "") + " z-10")) && m(e, "class", t), (!a || f & /*styleVars*/
73
- 4) && m(
74
- e,
75
- "style",
76
- /*styleVars*/
77
- r[2]
78
- );
79
- },
80
- i(r) {
81
- a || (H(o), a = !0);
82
- },
83
- o(r) {
84
- Q(o), a = !1;
85
- },
86
- d(r) {
87
- r && I(e), o && o.d();
88
- }
89
- };
90
- }
91
- const Ea = "hsl(var(--p))", ya = "hsl(var(--su))";
92
- function ka(i, e, t) {
93
- let a, o, r;
94
- D(i, ze, (h) => t(8, o = h)), D(i, qe, (h) => t(9, r = h));
95
- let { loading: f } = e, { showWatermark: n } = e, l, u, c = 0.8, d = 8, b = 0.15;
96
- return fe() && (c = 0.65, d = 10, b = 0.25), i.$$set = (h) => {
97
- "loading" in h && t(0, f = h.loading), "showWatermark" in h && t(1, n = h.showWatermark);
98
- }, i.$$.update = () => {
99
- if (i.$$.dirty & /*$videoStore, percentage, ovalHeight, ovalWidth, $ovalDimensions, captureBarPercentage*/
100
- 952 && r) {
101
- t(4, u = r.videoHeight * c), t(3, l = u / 1.45), _(ze, o.width = l, o), _(ze, o.height = u, o), _(ze, o.x = (r.videoWidth - o.width) / 2, o);
102
- let h = r.videoHeight - r.videoHeight * b;
103
- _(ze, o.y = h - o.height, o);
104
- }
105
- i.$$.dirty & /*ovalWidth, ovalHeight, borderWidth*/
106
- 88 && t(2, a = `
107
- --oval-width: ${l}px;
108
- --oval-height: ${u}px;
109
- --border-color: ${Ea};
110
- --border-color-animation: ${ya};
111
- --oval-border: ${d}px;
112
- `);
113
- }, [
114
- f,
115
- n,
116
- a,
117
- l,
118
- u,
119
- c,
120
- d,
121
- b,
122
- o,
123
- r
124
- ];
125
- }
126
- class $i extends mt {
127
- constructor(e) {
128
- super(), _t(
129
- this,
130
- {
131
- target: this.shadowRoot,
132
- props: gt(this.attributes),
133
- customElement: !0
134
- },
135
- ka,
136
- Ca,
137
- bt,
138
- { loading: 0, showWatermark: 1 },
139
- null
140
- ), e && (e.target && R(e.target, this, e.anchor), e.props && (this.$set(e.props), W()));
141
- }
142
- static get observedAttributes() {
143
- return ["loading", "showWatermark"];
144
- }
145
- get loading() {
146
- return this.$$.ctx[0];
147
- }
148
- set loading(e) {
149
- this.$$set({ loading: e }), W();
150
- }
151
- get showWatermark() {
152
- return this.$$.ctx[1];
153
- }
154
- set showWatermark(e) {
155
- this.$$set({ showWatermark: e }), W();
156
- }
157
- }
158
- customElements.define("face-oval", $i);
159
- function Ta(i) {
160
- let e;
161
- return {
162
- c() {
163
- e = p("div"), this.c = X, m(e, "class", "video-overlay z-0"), m(
164
- e,
165
- "style",
166
- /*styleVars*/
167
- i[0]
168
- );
169
- },
170
- m(t, a) {
171
- R(t, e, a);
172
- },
173
- p(t, [a]) {
174
- a & /*styleVars*/
175
- 1 && m(
176
- e,
177
- "style",
178
- /*styleVars*/
179
- t[0]
180
- );
181
- },
182
- i: X,
183
- o: X,
184
- d(t) {
185
- t && I(e);
186
- }
187
- };
188
- }
189
- function Oa(i, e, t) {
190
- let a, o;
191
- D(i, qe, (c) => t(6, o = c));
192
- let r, f, n = 0.8, { overlayColor: l } = e, { overlayTransparency: u } = e;
193
- return fe() && (n = 0.65), i.$$set = (c) => {
194
- "overlayColor" in c && t(1, l = c.overlayColor), "overlayTransparency" in c && t(2, u = c.overlayTransparency);
195
- }, i.$$.update = () => {
196
- i.$$.dirty & /*$videoStore, percentage, ovalHeight*/
197
- 112 && o && (t(4, f = o.videoHeight * n), t(3, r = f / 1.45)), i.$$.dirty & /*ovalWidth, ovalHeight, overlayColor, overlayTransparency*/
198
- 30 && t(0, a = `
199
- --oval-width: ${r}px;
200
- --oval-height: ${f}px;
201
- --overlay-color: ${l};
202
- --overlay-transparency: ${u};
203
- `);
204
- }, [
205
- a,
206
- l,
207
- u,
208
- r,
209
- f,
210
- n,
211
- o
212
- ];
213
- }
214
- class es extends mt {
215
- constructor(e) {
216
- super(), _t(
217
- this,
218
- {
219
- target: this.shadowRoot,
220
- props: gt(this.attributes),
221
- customElement: !0
222
- },
223
- Oa,
224
- Ta,
225
- bt,
226
- { overlayColor: 1, overlayTransparency: 2 },
227
- null
228
- ), e && (e.target && R(e.target, this, e.anchor), e.props && (this.$set(e.props), W()));
229
- }
230
- static get observedAttributes() {
231
- return ["overlayColor", "overlayTransparency"];
232
- }
233
- get overlayColor() {
234
- return this.$$.ctx[1];
235
- }
236
- set overlayColor(e) {
237
- this.$$set({ overlayColor: e }), W();
238
- }
239
- get overlayTransparency() {
240
- return this.$$.ctx[2];
241
- }
242
- set overlayTransparency(e) {
243
- this.$$set({ overlayTransparency: e }), W();
244
- }
245
- }
246
- customElements.define("overlay-oval", es);
247
- function Ni(i) {
248
- let e, t, a, o, r, f, n = (
249
- /*$_*/
250
- i[2]("faceCollector.obtainingPicture") + ""
251
- ), l;
252
- return {
253
- c() {
254
- e = p("slot"), t = p("div"), a = p("img"), r = N(), f = p("span"), l = P(n), Xe(a.src, o = Zt) || m(a, "src", o), m(a, "alt", "loading gif"), m(a, "class", "m-auto h-[10em] lg:h-[12em]"), m(f, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center"), m(t, "class", "translate-y-1/3 md:translate-y-1/4 xl:translate-y-1/2"), m(e, "name", "loading-camera-gif"), m(e, "class", "block h-[17em] lg:h-[21.6em] xl:h-[30em]");
255
- },
256
- m(u, c) {
257
- R(u, e, c), g(e, t), g(t, a), g(t, r), g(t, f), g(f, l);
258
- },
259
- p(u, c) {
260
- c & /*$_*/
261
- 4 && n !== (n = /*$_*/
262
- u[2]("faceCollector.obtainingPicture") + "") && M(l, n);
263
- },
264
- d(u) {
265
- u && I(e);
266
- }
267
- };
268
- }
269
- function Pi(i) {
270
- let e, t, a, o, r, f;
271
- function n(c, d) {
272
- return (
273
- /*$isLoading*/
274
- c[5] ? Da : Ra
275
- );
276
- }
277
- let l = n(i), u = l(i);
278
- return {
279
- c() {
280
- e = p("div"), t = p("slot"), a = p("div"), o = p("img"), f = N(), u.c(), Xe(o.src, r = Zt) || m(o, "src", r), m(o, "alt", "loading gif"), m(o, "class", "m-auto h-[10em] lg:h-[12em]"), m(a, "class", "translate-y-1/3 md:translate-y-1/4 xl:translate-y-1/2"), m(t, "name", "loading-camera-gif"), m(t, "class", "block h-[17em] lg:h-[21.6em] xl:h-[30em]"), m(e, "class", "bg-white absolute inset-0 z-10 flex items-center justify-center");
281
- },
282
- m(c, d) {
283
- R(c, e, d), g(e, t), g(t, a), g(a, o), g(a, f), u.m(a, null);
284
- },
285
- p(c, d) {
286
- l === (l = n(c)) && u ? u.p(c, d) : (u.d(1), u = l(c), u && (u.c(), u.m(a, null)));
287
- },
288
- d(c) {
289
- c && I(e), u.d();
290
- }
291
- };
292
- }
293
- function Ra(i) {
294
- let e, t = (
295
- /*$_*/
296
- i[2]("faceCollector.obtainingPicture") + ""
297
- ), a;
298
- return {
299
- c() {
300
- e = p("span"), a = P(t), m(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
301
- },
302
- m(o, r) {
303
- R(o, e, r), g(e, a);
304
- },
305
- p(o, r) {
306
- r & /*$_*/
307
- 4 && t !== (t = /*$_*/
308
- o[2]("faceCollector.obtainingPicture") + "") && M(a, t);
309
- },
310
- d(o) {
311
- o && I(e);
312
- }
313
- };
314
- }
315
- function Da(i) {
316
- let e;
317
- return {
318
- c() {
319
- e = p("span"), e.textContent = "Obtaining photo...", m(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
320
- },
321
- m(t, a) {
322
- R(t, e, a);
323
- },
324
- p: X,
325
- d(t) {
326
- t && I(e);
327
- }
328
- };
329
- }
330
- function Bi(i) {
331
- let e, t, a, o, r;
332
- function f(u, c) {
333
- return (
334
- /*$isLoading*/
335
- u[5] ? Aa : Ia
336
- );
337
- }
338
- let n = f(i), l = n(i);
339
- return {
340
- c() {
341
- e = p("slot"), t = p("div"), a = p("img"), r = N(), l.c(), Xe(a.src, o = Zt) || m(a, "src", o), m(a, "alt", "loading gif"), m(a, "class", "m-auto h-[10em] lg:h-[12em]"), m(t, "class", "translate-y-1/3 md:translate-y-1/4 xl:translate-y-1/2"), m(e, "name", "loading-camera-gif"), m(e, "class", "block h-[17em] lg:h-[21.6em] xl:h-[30em]");
342
- },
343
- m(u, c) {
344
- R(u, e, c), g(e, t), g(t, a), g(t, r), l.m(t, null);
345
- },
346
- p(u, c) {
347
- n === (n = f(u)) && l ? l.p(u, c) : (l.d(1), l = n(u), l && (l.c(), l.m(t, null)));
348
- },
349
- d(u) {
350
- u && I(e), l.d();
351
- }
352
- };
353
- }
354
- function Ia(i) {
355
- let e, t = (
356
- /*$_*/
357
- i[2]("faceCollector.initiatingCamera") + ""
358
- ), a;
359
- return {
360
- c() {
361
- e = p("span"), a = P(t), m(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
362
- },
363
- m(o, r) {
364
- R(o, e, r), g(e, a);
365
- },
366
- p(o, r) {
367
- r & /*$_*/
368
- 4 && t !== (t = /*$_*/
369
- o[2]("faceCollector.initiatingCamera") + "") && M(a, t);
370
- },
371
- d(o) {
372
- o && I(e);
373
- }
374
- };
375
- }
376
- function Aa(i) {
377
- let e;
378
- return {
379
- c() {
380
- e = p("span"), e.textContent = "Loading camera...", m(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
381
- },
382
- m(t, a) {
383
- R(t, e, a);
384
- },
385
- p: X,
386
- d(t) {
387
- t && I(e);
388
- }
389
- };
390
- }
391
- function La(i) {
392
- let e = j() && /*waitingIdrndCaptureEvent*/
393
- i[0], t, a, o = (j() && /*idrndLoading*/
394
- (i[1] || !/*$ready*/
395
- i[6]) || !j() && !/*$ready*/
396
- i[6]) && /*$cameraStatusStore*/
397
- i[4] === V.OK, r, f = e && Ni(i), n = (
398
- /*$detectingFace*/
399
- i[3] && /*$cameraStatusStore*/
400
- i[4] === V.OK && Pi(i)
401
- ), l = o && Bi(i);
402
- return {
403
- c() {
404
- f && f.c(), t = N(), n && n.c(), a = N(), l && l.c(), r = Gi(), this.c = X;
405
- },
406
- m(u, c) {
407
- f && f.m(u, c), R(u, t, c), n && n.m(u, c), R(u, a, c), l && l.m(u, c), R(u, r, c);
408
- },
409
- p(u, [c]) {
410
- c & /*waitingIdrndCaptureEvent*/
411
- 1 && (e = j() && /*waitingIdrndCaptureEvent*/
412
- u[0]), e ? f ? f.p(u, c) : (f = Ni(u), f.c(), f.m(t.parentNode, t)) : f && (f.d(1), f = null), /*$detectingFace*/
413
- u[3] && /*$cameraStatusStore*/
414
- u[4] === V.OK ? n ? n.p(u, c) : (n = Pi(u), n.c(), n.m(a.parentNode, a)) : n && (n.d(1), n = null), c & /*idrndLoading, $ready, $cameraStatusStore*/
415
- 82 && (o = (j() && /*idrndLoading*/
416
- (u[1] || !/*$ready*/
417
- u[6]) || !j() && !/*$ready*/
418
- u[6]) && /*$cameraStatusStore*/
419
- u[4] === V.OK), o ? l ? l.p(u, c) : (l = Bi(u), l.c(), l.m(r.parentNode, r)) : l && (l.d(1), l = null);
420
- },
421
- i: X,
422
- o: X,
423
- d(u) {
424
- f && f.d(u), u && I(t), n && n.d(u), u && I(a), l && l.d(u), u && I(r);
425
- }
426
- };
427
- }
428
- function Sa(i, e, t) {
429
- let a, o, r, f, n;
430
- D(i, Yi, (c) => t(2, a = c)), D(i, Zi, (c) => t(3, o = c)), D(i, q, (c) => t(4, r = c)), D(i, Fs, (c) => t(5, f = c)), D(i, Fe, (c) => t(6, n = c));
431
- let { waitingIdrndCaptureEvent: l } = e, { idrndLoading: u } = e;
432
- return i.$$set = (c) => {
433
- "waitingIdrndCaptureEvent" in c && t(0, l = c.waitingIdrndCaptureEvent), "idrndLoading" in c && t(1, u = c.idrndLoading);
434
- }, [
435
- l,
436
- u,
437
- a,
438
- o,
439
- r,
440
- f,
441
- n
442
- ];
443
- }
444
- class ts extends mt {
445
- constructor(e) {
446
- super(), _t(
447
- this,
448
- {
449
- target: this.shadowRoot,
450
- props: gt(this.attributes),
451
- customElement: !0
452
- },
453
- Sa,
454
- La,
455
- bt,
456
- {
457
- waitingIdrndCaptureEvent: 0,
458
- idrndLoading: 1
459
- },
460
- null
461
- ), e && (e.target && R(e.target, this, e.anchor), e.props && (this.$set(e.props), W()));
462
- }
463
- static get observedAttributes() {
464
- return ["waitingIdrndCaptureEvent", "idrndLoading"];
465
- }
466
- get waitingIdrndCaptureEvent() {
467
- return this.$$.ctx[0];
468
- }
469
- set waitingIdrndCaptureEvent(e) {
470
- this.$$set({ waitingIdrndCaptureEvent: e }), W();
471
- }
472
- get idrndLoading() {
473
- return this.$$.ctx[1];
474
- }
475
- set idrndLoading(e) {
476
- this.$$set({ idrndLoading: e }), W();
477
- }
478
- }
479
- customElements.define("loading-component", ts);
480
- function Wi(i, e, t) {
481
- const a = i.slice();
482
- return a[123] = e[t], a;
483
- }
484
- function Mi(i, e, t) {
485
- const a = i.slice();
486
- return a[123] = e[t], a;
487
- }
488
- function Ui(i) {
489
- let e, t, a = j(), o, r, f, n, l, u, c, d, b, h, E, w, v, C, y, S, Re, le = a && Fa(i), z = (
490
- /*$ready*/
491
- i[24] && !/*$detectingFace*/
492
- i[27] && Vi(i)
493
- );
494
- return h = new oa({}), w = new pa({
495
- props: {
496
- showConfigButton: (
497
- /*showConfigButton*/
498
- i[4]
499
- ),
500
- showAutoCaptureButton: (
501
- /*showAutoCaptureButton*/
502
- i[5]
503
- ),
504
- showCaptureButton: (
505
- /*showCaptureButton*/
506
- i[0]
507
- ),
508
- showCameraButton: (
509
- /*showCameraButton*/
510
- i[6]
511
- ),
512
- enableCaptureButton: (
513
- /*enableCaptureButton*/
514
- i[18]
515
- ),
516
- videoOverlay: (
517
- /*videoOverlay*/
518
- i[9]
519
- ),
520
- videoOverlayTransparency: (
521
- /*videoOverlayTransparency*/
522
- i[10]
523
- ),
524
- idrndClosed: (
525
- /*idrndClosed*/
526
- i[20]
527
- ),
528
- idrndLoading: (
529
- /*idrndLoading*/
530
- i[19]
531
- ),
532
- waitingIdrndCaptureEvent: (
533
- /*waitingIdrndCaptureEvent*/
534
- i[21]
535
- ),
536
- handler: (
537
- /*capture*/
538
- i[13]
539
- )
540
- }
541
- }), {
542
- c() {
543
- e = p("div"), t = p("div"), le && le.c(), o = N(), r = p("video"), n = N(), l = p("canvas"), u = N(), c = p("div"), d = p("div"), z && z.c(), b = N(), he(h.$$.fragment), E = N(), he(w.$$.fragment), m(r, "id", "bry-cc-camera-video-tag"), m(r, "class", f = /*$ready*/
544
- i[24] ? fe() ? "absolute inset-0 -scale-x-100" : "w-full h-full object-cover -scale-x-100" : "w-0 h-0"), r.playsInline = !0, r.muted = !0, r.autoplay = !0, m(l, "id", "bry-ce-detectionsCanvas"), m(l, "class", "absolute top-0 left-0 max-w-full -scale-x-100"), m(t, "class", "overflow-hidden"), ut(
545
- t,
546
- "width",
547
- /*$videoStore*/
548
- i[35].videoWidth + "px"
549
- ), ut(
550
- t,
551
- "height",
552
- /*$videoStore*/
553
- i[35].videoHeight + "px"
554
- ), m(d, "class", "flex flex-grow w-full items-center justify-center relative"), m(c, "class", "absolute inset-0 flex flex-col items-center justify-between w-full h-full"), m(e, "class", v = /*$ready*/
555
- i[24] ? "relative" : "relative w-0 h-0"), e.hidden = C = /*$cameraStatusStore*/
556
- i[23] !== V.OK || j() && /*idrndLoading*/
557
- (i[19] || /*idrndClosed*/
558
- i[20] || /*waitingIdrndCaptureEvent*/
559
- i[21]);
560
- },
561
- m(L, A) {
562
- R(L, e, A), g(e, t), le && le.m(t, null), g(t, o), g(t, r), i[51](r), g(t, n), g(t, l), i[53](l), g(e, u), g(e, c), g(c, d), z && z.m(d, null), g(c, b), me(h, c, null), g(c, E), me(w, c, null), y = !0, S || (Re = [
563
- oe(
564
- r,
565
- "canplay",
566
- /*canplay_handler*/
567
- i[52]
568
- ),
569
- oe(
570
- r,
571
- "play",
572
- /*play*/
573
- i[12],
574
- { once: !0 }
575
- )
576
- ], S = !0);
577
- },
578
- p(L, A) {
579
- a && le.p(L, A), (!y || A[0] & /*$ready*/
580
- 16777216 && f !== (f = /*$ready*/
581
- L[24] ? fe() ? "absolute inset-0 -scale-x-100" : "w-full h-full object-cover -scale-x-100" : "w-0 h-0")) && m(r, "class", f), (!y || A[1] & /*$videoStore*/
582
- 16) && ut(
583
- t,
584
- "width",
585
- /*$videoStore*/
586
- L[35].videoWidth + "px"
587
- ), (!y || A[1] & /*$videoStore*/
588
- 16) && ut(
589
- t,
590
- "height",
591
- /*$videoStore*/
592
- L[35].videoHeight + "px"
593
- ), /*$ready*/
594
- L[24] && !/*$detectingFace*/
595
- L[27] ? z ? (z.p(L, A), A[0] & /*$ready, $detectingFace*/
596
- 150994944 && H(z, 1)) : (z = Vi(L), z.c(), H(z, 1), z.m(d, null)) : z && (Je(), Q(z, 1, 1, () => {
597
- z = null;
598
- }), Qe());
599
- const T = {};
600
- A[0] & /*showConfigButton*/
601
- 16 && (T.showConfigButton = /*showConfigButton*/
602
- L[4]), A[0] & /*showAutoCaptureButton*/
603
- 32 && (T.showAutoCaptureButton = /*showAutoCaptureButton*/
604
- L[5]), A[0] & /*showCaptureButton*/
605
- 1 && (T.showCaptureButton = /*showCaptureButton*/
606
- L[0]), A[0] & /*showCameraButton*/
607
- 64 && (T.showCameraButton = /*showCameraButton*/
608
- L[6]), A[0] & /*enableCaptureButton*/
609
- 262144 && (T.enableCaptureButton = /*enableCaptureButton*/
610
- L[18]), A[0] & /*videoOverlay*/
611
- 512 && (T.videoOverlay = /*videoOverlay*/
612
- L[9]), A[0] & /*videoOverlayTransparency*/
613
- 1024 && (T.videoOverlayTransparency = /*videoOverlayTransparency*/
614
- L[10]), A[0] & /*idrndClosed*/
615
- 1048576 && (T.idrndClosed = /*idrndClosed*/
616
- L[20]), A[0] & /*idrndLoading*/
617
- 524288 && (T.idrndLoading = /*idrndLoading*/
618
- L[19]), A[0] & /*waitingIdrndCaptureEvent*/
619
- 2097152 && (T.waitingIdrndCaptureEvent = /*waitingIdrndCaptureEvent*/
620
- L[21]), w.$set(T), (!y || A[0] & /*$ready*/
621
- 16777216 && v !== (v = /*$ready*/
622
- L[24] ? "relative" : "relative w-0 h-0")) && m(e, "class", v), (!y || A[0] & /*$cameraStatusStore, idrndLoading, idrndClosed, waitingIdrndCaptureEvent*/
623
- 12058624 && C !== (C = /*$cameraStatusStore*/
624
- L[23] !== V.OK || j() && /*idrndLoading*/
625
- (L[19] || /*idrndClosed*/
626
- L[20] || /*waitingIdrndCaptureEvent*/
627
- L[21]))) && (e.hidden = C);
628
- },
629
- i(L) {
630
- y || (H(z), H(h.$$.fragment, L), H(w.$$.fragment, L), y = !0);
631
- },
632
- o(L) {
633
- Q(z), Q(h.$$.fragment, L), Q(w.$$.fragment, L), y = !1;
634
- },
635
- d(L) {
636
- L && I(e), le && le.d(), i[51](null), i[53](null), z && z.d(), _e(h), _e(w), S = !1, vt(Re);
637
- }
638
- };
639
- }
640
- function Fa(i) {
641
- let e;
642
- return {
643
- c() {
644
- e = p("idlive-face-capture"), e.hidden = !0, se(e, "mask_hidden", ""), se(e, "auto_capture_disabled", ""), se(e, "auto_close_disabled", ""), se(
645
- e,
646
- "device_id",
647
- /*$selectedVideoDeviceId*/
648
- i[25]
649
- ), se(e, "face_not_centered_check_enabled", ""), se(e, "sunglasses_detected_check_enabled", ""), se(e, "mouth_open_check_enabled", ""), se(e, "face_blurry_check_enabled", ""), se(e, "dark_image_check_enabled", ""), se(e, "eyes_closed_check_enabled", ""), se(
650
- e,
651
- "payload_size",
652
- /*livenessBlobSize*/
653
- i[11]
654
- );
655
- },
656
- m(t, a) {
657
- R(t, e, a), i[50](e);
658
- },
659
- p(t, a) {
660
- a[0] & /*$selectedVideoDeviceId*/
661
- 33554432 && se(
662
- e,
663
- "device_id",
664
- /*$selectedVideoDeviceId*/
665
- t[25]
666
- ), a[0] & /*livenessBlobSize*/
667
- 2048 && se(
668
- e,
669
- "payload_size",
670
- /*livenessBlobSize*/
671
- t[11]
672
- );
673
- },
674
- d(t) {
675
- t && I(e), i[50](null);
676
- }
677
- };
678
- }
679
- function Vi(i) {
680
- let e, t, a, o, r, f;
681
- return e = new ha({
682
- props: {
683
- isCountingDown: (
684
- /*isCountingDown*/
685
- i[17]
686
- )
687
- }
688
- }), a = new $i({
689
- props: {
690
- loading: (
691
- /*isCountingDown*/
692
- i[17]
693
- ),
694
- showWatermark: (
695
- /*showWatermark*/
696
- i[8]
697
- )
698
- }
699
- }), r = new es({
700
- props: {
701
- overlayColor: (
702
- /*videoOverlay*/
703
- i[9]
704
- ),
705
- overlayTransparency: (
706
- /*videoOverlayTransparency*/
707
- i[10]
708
- )
709
- }
710
- }), {
711
- c() {
712
- he(e.$$.fragment), t = N(), he(a.$$.fragment), o = N(), he(r.$$.fragment);
713
- },
714
- m(n, l) {
715
- me(e, n, l), R(n, t, l), me(a, n, l), R(n, o, l), me(r, n, l), f = !0;
716
- },
717
- p(n, l) {
718
- const u = {};
719
- l[0] & /*isCountingDown*/
720
- 131072 && (u.isCountingDown = /*isCountingDown*/
721
- n[17]), e.$set(u);
722
- const c = {};
723
- l[0] & /*isCountingDown*/
724
- 131072 && (c.loading = /*isCountingDown*/
725
- n[17]), l[0] & /*showWatermark*/
726
- 256 && (c.showWatermark = /*showWatermark*/
727
- n[8]), a.$set(c);
728
- const d = {};
729
- l[0] & /*videoOverlay*/
730
- 512 && (d.overlayColor = /*videoOverlay*/
731
- n[9]), l[0] & /*videoOverlayTransparency*/
732
- 1024 && (d.overlayTransparency = /*videoOverlayTransparency*/
733
- n[10]), r.$set(d);
734
- },
735
- i(n) {
736
- f || (H(e.$$.fragment, n), H(a.$$.fragment, n), H(r.$$.fragment, n), f = !0);
737
- },
738
- o(n) {
739
- Q(e.$$.fragment, n), Q(a.$$.fragment, n), Q(r.$$.fragment, n), f = !1;
740
- },
741
- d(n) {
742
- _e(e, n), n && I(t), _e(a, n), n && I(o), _e(r, n);
743
- }
744
- };
745
- }
746
- function zi(i) {
747
- let e, t, a = (
748
- /*$_*/
749
- i[32]("faceCollector.finish") + ""
750
- ), o, r, f, n, l = (
751
- /*$_*/
752
- i[32]("faceCollector.retakePhoto") + ""
753
- ), u, c, d;
754
- return {
755
- c() {
756
- e = p("div"), t = p("button"), o = P(a), f = N(), n = p("button"), u = P(l), t.disabled = r = /*$justification*/
757
- i[29].length === 0, m(t, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink"), m(n, "id", "bry-cc-retake-button"), m(n, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink"), m(e, "class", "ce-dui-btn-group flex");
758
- },
759
- m(b, h) {
760
- R(b, e, h), g(e, t), g(t, o), g(e, f), g(e, n), g(n, u), c || (d = [
761
- oe(
762
- t,
763
- "click",
764
- /*click_handler*/
765
- i[54]
766
- ),
767
- oe(
768
- n,
769
- "click",
770
- /*click_handler_1*/
771
- i[55]
772
- )
773
- ], c = !0);
774
- },
775
- p(b, h) {
776
- h[1] & /*$_*/
777
- 2 && a !== (a = /*$_*/
778
- b[32]("faceCollector.finish") + "") && M(o, a), h[0] & /*$justification*/
779
- 536870912 && r !== (r = /*$justification*/
780
- b[29].length === 0) && (t.disabled = r), h[1] & /*$_*/
781
- 2 && l !== (l = /*$_*/
782
- b[32]("faceCollector.retakePhoto") + "") && M(u, l);
783
- },
784
- d(b) {
785
- b && I(e), c = !1, vt(d);
786
- }
787
- };
788
- }
789
- function Na(i) {
790
- let e, t;
791
- return e = new ma({ props: { handler: (
792
- /*func*/
793
- i[64]
794
- ) } }), {
795
- c() {
796
- he(e.$$.fragment);
797
- },
798
- m(a, o) {
799
- me(e, a, o), t = !0;
800
- },
801
- p: X,
802
- i(a) {
803
- t || (H(e.$$.fragment, a), t = !0);
804
- },
805
- o(a) {
806
- Q(e.$$.fragment, a), t = !1;
807
- },
808
- d(a) {
809
- _e(e, a);
810
- }
811
- };
812
- }
813
- function Pa(i) {
814
- let e, t, a, o, r, f, n, l, u;
815
- const c = [
816
- Va,
817
- Ua,
818
- Ma,
819
- Wa,
820
- Ba
821
- ], d = [];
822
- function b(h, E) {
823
- return (
824
- /*$captured*/
825
- h[26] ? (
826
- /*$unconformitiesStore*/
827
- h[33].isLoading ? 1 : (
828
- /*$requestResult*/
829
- h[31] !== K.OK ? 2 : (
830
- /*$saved*/
831
- h[28] ? 4 : 3
832
- )
833
- )
834
- ) : 0
835
- );
836
- }
837
- return f = b(i), n = d[f] = c[f](i), {
838
- c() {
839
- e = p("div"), t = p("img"), r = N(), n.c(), m(t, "class", "m-auto col-start-1 col-end-1 max-h-[23.2em]"), Xe(t.src, a = /*$dataTypePrefix*/
840
- i[34] + "," + /*$image*/
841
- i[30]) || m(t, "src", a), t.hidden = o = !/*$captured*/
842
- i[26] || !/*$showFaceWhileValidating*/
843
- i[36] && /*$unconformitiesStore*/
844
- i[33].isLoading, m(t, "alt", ""), m(e, "class", l = "grid-cols-1 grid-rows-2 sm:grid-cols-2 sm:grid-rows-1 gap-[.5em] " + (!/*$showFaceWhileValidating*/
845
- i[36] && /*$unconformitiesStore*/
846
- i[33].isLoading ? "absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible" : "grid overflow-hidden"));
847
- },
848
- m(h, E) {
849
- R(h, e, E), g(e, t), g(e, r), d[f].m(e, null), u = !0;
850
- },
851
- p(h, E) {
852
- (!u || E[0] & /*$image*/
853
- 1073741824 | E[1] & /*$dataTypePrefix*/
854
- 8 && !Xe(t.src, a = /*$dataTypePrefix*/
855
- h[34] + "," + /*$image*/
856
- h[30])) && m(t, "src", a), (!u || E[0] & /*$captured*/
857
- 67108864 | E[1] & /*$showFaceWhileValidating, $unconformitiesStore*/
858
- 36 && o !== (o = !/*$captured*/
859
- h[26] || !/*$showFaceWhileValidating*/
860
- h[36] && /*$unconformitiesStore*/
861
- h[33].isLoading)) && (t.hidden = o);
862
- let w = f;
863
- f = b(h), f === w ? d[f].p(h, E) : (Je(), Q(d[w], 1, 1, () => {
864
- d[w] = null;
865
- }), Qe(), n = d[f], n ? n.p(h, E) : (n = d[f] = c[f](h), n.c()), H(n, 1), n.m(e, null)), (!u || E[1] & /*$showFaceWhileValidating, $unconformitiesStore*/
866
- 36 && l !== (l = "grid-cols-1 grid-rows-2 sm:grid-cols-2 sm:grid-rows-1 gap-[.5em] " + (!/*$showFaceWhileValidating*/
867
- h[36] && /*$unconformitiesStore*/
868
- h[33].isLoading ? "absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible" : "grid overflow-hidden"))) && m(e, "class", l);
869
- },
870
- i(h) {
871
- u || (H(n), u = !0);
872
- },
873
- o(h) {
874
- Q(n), u = !1;
875
- },
876
- d(h) {
877
- h && I(e), d[f].d();
878
- }
879
- };
880
- }
881
- function Ba(i) {
882
- let e, t, a = (
883
- /*$_*/
884
- i[32]("faceCollector.captured") + ""
885
- ), o, r, f, n, l, u = (
886
- /*$_*/
887
- i[32]("faceCollector.retakePhoto") + ""
888
- ), c, d, b = dt(ua).faceStrategy !== fa.DISABLED, h, E, w, v = (
889
- /*$unconformitiesStore*/
890
- i[33].unconformities.length !== 0 && ji(i)
891
- ), C = b && za();
892
- return {
893
- c() {
894
- e = p("div"), t = p("h1"), o = P(a), r = N(), v && v.c(), f = N(), n = p("div"), l = p("button"), c = P(u), d = N(), C && C.c(), m(t, "class", "text-3xl font-bold pb-[1em] transition-opacity"), m(l, "id", "bry-cc-retake-button"), m(l, "class", "ce-dui-btn ce-dui-btn-block flex-shrink text-base"), m(n, "class", "flex flex-row"), Si(n, "ce-dui-btn-group", !/*$exportButtonDisabled*/
895
- i[37]);
896
- },
897
- m(y, S) {
898
- R(y, e, S), g(e, t), g(t, o), g(e, r), v && v.m(e, null), g(e, f), g(e, n), g(n, l), g(l, c), g(n, d), C && C.m(n, null), h = !0, E || (w = oe(
899
- l,
900
- "click",
901
- /*click_handler_6*/
902
- i[63]
903
- ), E = !0);
904
- },
905
- p(y, S) {
906
- (!h || S[1] & /*$_*/
907
- 2) && a !== (a = /*$_*/
908
- y[32]("faceCollector.captured") + "") && M(o, a), /*$unconformitiesStore*/
909
- y[33].unconformities.length !== 0 ? v ? v.p(y, S) : (v = ji(y), v.c(), v.m(e, f)) : v && (v.d(1), v = null), (!h || S[1] & /*$_*/
910
- 2) && u !== (u = /*$_*/
911
- y[32]("faceCollector.retakePhoto") + "") && M(c, u), (!h || S[1] & /*$exportButtonDisabled*/
912
- 64) && Si(n, "ce-dui-btn-group", !/*$exportButtonDisabled*/
913
- y[37]);
914
- },
915
- i(y) {
916
- h || (H(C), h = !0);
917
- },
918
- o(y) {
919
- Q(C), h = !1;
920
- },
921
- d(y) {
922
- y && I(e), v && v.d(), C && C.d(), E = !1, w();
923
- }
924
- };
925
- }
926
- function Wa(i) {
927
- let e, t, a = (
928
- /*evaluatePhoto*/
929
- (i[2] ? (
930
- /*$unconformitiesStore*/
931
- i[33].unconformities.length === 0 ? (
932
- /*$_*/
933
- i[32]("faceCollector.everythingOk")
934
- ) : (
935
- /*$_*/
936
- i[32]("faceCollector.unconformities")
937
- )
938
- ) : (
939
- /*$_*/
940
- i[32]("faceCollector.previewCapture")
941
- )) + ""
942
- ), o, r, f, n, l, u, c = (
943
- /*$unconformitiesStore*/
944
- i[33].unconformities
945
- ), d = [];
946
- for (let w = 0; w < c.length; w += 1)
947
- d[w] = Ki(Wi(i, c, w));
948
- let b = (
949
- /*evaluatePhoto*/
950
- i[2] && /*$unconformitiesStore*/
951
- i[33].unconformities.length == 0 && Hi(i)
952
- ), h = (
953
- /*showJustificationField*/
954
- i[7] && /*$unconformitiesStore*/
955
- i[33].unconformities.length > 0 && qi(i)
956
- ), E = (
957
- /*$captured*/
958
- i[26] && Ji(i)
959
- );
960
- return {
961
- c() {
962
- e = p("div"), t = p("h1"), o = P(a), r = N(), f = p("div");
963
- for (let w = 0; w < d.length; w += 1)
964
- d[w].c();
965
- n = N(), b && b.c(), l = N(), h && h.c(), u = N(), E && E.c(), m(t, "class", "text-3xl font-bold transition-opacity"), m(f, "class", "flex flex-wrap"), m(e, "class", "flex flex-col justify-between");
966
- },
967
- m(w, v) {
968
- R(w, e, v), g(e, t), g(t, o), g(e, r), g(e, f);
969
- for (let C = 0; C < d.length; C += 1)
970
- d[C] && d[C].m(f, null);
971
- g(f, n), b && b.m(f, null), g(e, l), h && h.m(e, null), g(e, u), E && E.m(e, null);
972
- },
973
- p(w, v) {
974
- if (v[0] & /*evaluatePhoto*/
975
- 4 | v[1] & /*$unconformitiesStore, $_*/
976
- 6 && a !== (a = /*evaluatePhoto*/
977
- (w[2] ? (
978
- /*$unconformitiesStore*/
979
- w[33].unconformities.length === 0 ? (
980
- /*$_*/
981
- w[32]("faceCollector.everythingOk")
982
- ) : (
983
- /*$_*/
984
- w[32]("faceCollector.unconformities")
985
- )
986
- ) : (
987
- /*$_*/
988
- w[32]("faceCollector.previewCapture")
989
- )) + "") && M(o, a), v[1] & /*$unconformitiesStore*/
990
- 4) {
991
- c = /*$unconformitiesStore*/
992
- w[33].unconformities;
993
- let C;
994
- for (C = 0; C < c.length; C += 1) {
995
- const y = Wi(w, c, C);
996
- d[C] ? d[C].p(y, v) : (d[C] = Ki(y), d[C].c(), d[C].m(f, n));
997
- }
998
- for (; C < d.length; C += 1)
999
- d[C].d(1);
1000
- d.length = c.length;
1001
- }
1002
- /*evaluatePhoto*/
1003
- w[2] && /*$unconformitiesStore*/
1004
- w[33].unconformities.length == 0 ? b ? b.p(w, v) : (b = Hi(w), b.c(), b.m(f, null)) : b && (b.d(1), b = null), /*showJustificationField*/
1005
- w[7] && /*$unconformitiesStore*/
1006
- w[33].unconformities.length > 0 ? h ? h.p(w, v) : (h = qi(w), h.c(), h.m(e, u)) : h && (h.d(1), h = null), /*$captured*/
1007
- w[26] ? E ? E.p(w, v) : (E = Ji(w), E.c(), E.m(e, null)) : E && (E.d(1), E = null);
1008
- },
1009
- i: X,
1010
- o: X,
1011
- d(w) {
1012
- w && I(e), xi(d, w), b && b.d(), h && h.d(), E && E.d();
1013
- }
1014
- };
1015
- }
1016
- function Ma(i) {
1017
- let e, t, a, o, r = (
1018
- /*$_*/
1019
- i[32]("faceCollector.finish") + ""
1020
- ), f, n, l, u = (
1021
- /*$_*/
1022
- i[32]("faceCollector.retakePhoto") + ""
1023
- ), c, d, b;
1024
- function h(v, C) {
1025
- return (
1026
- /*$requestResult*/
1027
- v[31] === K.LIVENESS_DETECTION_FAILURE || /*$requestResult*/
1028
- v[31] === K.UNKNOWN_LIVENESS_ERROR ? Xa : (
1029
- /*$requestResult*/
1030
- v[31] === K.LOW_LIVENESS_SCORE ? Qa : (
1031
- /*$requestResult*/
1032
- v[31] === K.TEMPLATE_EXTRACTION_ERROR || /*$requestResult*/
1033
- v[31] === K.UNKNOWN_TEMPLATE_EXTRACTION_ERROR ? Ja : (
1034
- /*$requestResult*/
1035
- v[31] === K.UNABLE_TO_COMMUNICATE_WITH_TEMPLATE_EXTRACTION_SERVICE ? qa : (
1036
- /*$requestResult*/
1037
- v[31] === K.LIVENESS_EVALUATION_ERROR ? Ha : (
1038
- /*$requestResult*/
1039
- v[31] === K.INSUFFICIENT_FACE_QUALITY ? Ka : ja
1040
- )
1041
- )
1042
- )
1043
- )
1044
- )
1045
- );
1046
- }
1047
- let E = h(i), w = E(i);
1048
- return {
1049
- c() {
1050
- e = p("div"), w.c(), t = N(), a = p("div"), o = p("button"), f = P(r), n = N(), l = p("button"), c = P(u), o.disabled = !0, m(o, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink"), m(l, "id", "bry-cc-retake-button"), m(l, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink"), m(a, "class", "ce-dui-btn-group flex"), m(e, "class", "flex flex-col justify-between");
1051
- },
1052
- m(v, C) {
1053
- R(v, e, C), w.m(e, null), g(e, t), g(e, a), g(a, o), g(o, f), g(a, n), g(a, l), g(l, c), d || (b = [
1054
- oe(
1055
- o,
1056
- "click",
1057
- /*click_handler_2*/
1058
- i[57]
1059
- ),
1060
- oe(
1061
- l,
1062
- "click",
1063
- /*click_handler_3*/
1064
- i[58]
1065
- )
1066
- ], d = !0);
1067
- },
1068
- p(v, C) {
1069
- E === (E = h(v)) && w ? w.p(v, C) : (w.d(1), w = E(v), w && (w.c(), w.m(e, t))), C[1] & /*$_*/
1070
- 2 && r !== (r = /*$_*/
1071
- v[32]("faceCollector.finish") + "") && M(f, r), C[1] & /*$_*/
1072
- 2 && u !== (u = /*$_*/
1073
- v[32]("faceCollector.retakePhoto") + "") && M(c, u);
1074
- },
1075
- i: X,
1076
- o: X,
1077
- d(v) {
1078
- v && I(e), w.d(), d = !1, vt(b);
1079
- }
1080
- };
1081
- }
1082
- function Ua(i) {
1083
- let e, t, a = (
1084
- /*$_*/
1085
- i[32]("faceCollector.validating") + ""
1086
- ), o, r, f;
1087
- return {
1088
- c() {
1089
- e = p("div"), t = p("h1"), o = P(a), r = N(), f = p("div"), m(t, "class", "inline-block text-3xl font-bold pb-[1em] transition-opacity"), m(f, "class", "ml-6 inline-block dot-typing"), m(e, "class", "min-w-[200px]");
1090
- },
1091
- m(n, l) {
1092
- R(n, e, l), g(e, t), g(t, o), g(e, r), g(e, f);
1093
- },
1094
- p(n, l) {
1095
- l[1] & /*$_*/
1096
- 2 && a !== (a = /*$_*/
1097
- n[32]("faceCollector.validating") + "") && M(o, a);
1098
- },
1099
- i: X,
1100
- o: X,
1101
- d(n) {
1102
- n && I(e);
1103
- }
1104
- };
1105
- }
1106
- function Va(i) {
1107
- let e;
1108
- return {
1109
- c() {
1110
- e = p("div"), m(e, "class", "");
1111
- },
1112
- m(t, a) {
1113
- R(t, e, a);
1114
- },
1115
- p: X,
1116
- i: X,
1117
- o: X,
1118
- d(t) {
1119
- t && I(e);
1120
- }
1121
- };
1122
- }
1123
- function ji(i) {
1124
- let e, t, a = (
1125
- /*$_*/
1126
- i[32]("faceCollector.justification") + ""
1127
- ), o, r, f, n, l;
1128
- return {
1129
- c() {
1130
- e = p("label"), t = p("span"), o = P(a), r = N(), f = p("textarea"), m(t, "class", "ce-dui-label-text text-base"), m(e, "class", "ce-dui-label"), m(e, "for", "justification"), m(f, "contenteditable", ""), m(f, "id", "justification"), m(f, "class", "ce-dui-textarea ce-dui-textarea-bordered textarea-ghost h-[6em] w-full text-base");
1131
- },
1132
- m(u, c) {
1133
- R(u, e, c), g(e, t), g(t, o), R(u, r, c), R(u, f, c), ht(
1134
- f,
1135
- /*$justification*/
1136
- i[29]
1137
- ), n || (l = oe(
1138
- f,
1139
- "input",
1140
- /*textarea_input_handler_1*/
1141
- i[62]
1142
- ), n = !0);
1143
- },
1144
- p(u, c) {
1145
- c[1] & /*$_*/
1146
- 2 && a !== (a = /*$_*/
1147
- u[32]("faceCollector.justification") + "") && M(o, a), c[0] & /*$justification*/
1148
- 536870912 && ht(
1149
- f,
1150
- /*$justification*/
1151
- u[29]
1152
- );
1153
- },
1154
- d(u) {
1155
- u && I(e), u && I(r), u && I(f), n = !1, l();
1156
- }
1157
- };
1158
- }
1159
- function za(i) {
1160
- let e, t;
1161
- return e = new da({
1162
- props: { cssClass: "ce-dui-btn-block flex-shrink" }
1163
- }), {
1164
- c() {
1165
- he(e.$$.fragment);
1166
- },
1167
- m(a, o) {
1168
- me(e, a, o), t = !0;
1169
- },
1170
- i(a) {
1171
- t || (H(e.$$.fragment, a), t = !0);
1172
- },
1173
- o(a) {
1174
- Q(e.$$.fragment, a), t = !1;
1175
- },
1176
- d(a) {
1177
- _e(e, a);
1178
- }
1179
- };
1180
- }
1181
- function Ki(i) {
1182
- let e, t = (
1183
- /*unconformity*/
1184
- i[123] + ""
1185
- ), a;
1186
- return {
1187
- c() {
1188
- e = p("div"), a = P(t), m(e, "class", "ce-dui-badge ce-dui-badge-lg h-[2em] ce-dui-badge-error text-xl pb-[.25em] m-[.5em]");
1189
- },
1190
- m(o, r) {
1191
- R(o, e, r), g(e, a);
1192
- },
1193
- p(o, r) {
1194
- r[1] & /*$unconformitiesStore*/
1195
- 4 && t !== (t = /*unconformity*/
1196
- o[123] + "") && M(a, t);
1197
- },
1198
- d(o) {
1199
- o && I(e);
1200
- }
1201
- };
1202
- }
1203
- function Hi(i) {
1204
- let e, t = (
1205
- /*$_*/
1206
- i[32]("faceCollector.noNonconformity") + ""
1207
- ), a;
1208
- return {
1209
- c() {
1210
- e = p("div"), a = P(t), m(e, "class", "ce-dui-badge ce-dui-badge-lg h-[2em] ce-dui-badge-info text-xl pb-[.25em] m-[.5em]");
1211
- },
1212
- m(o, r) {
1213
- R(o, e, r), g(e, a);
1214
- },
1215
- p(o, r) {
1216
- r[1] & /*$_*/
1217
- 2 && t !== (t = /*$_*/
1218
- o[32]("faceCollector.noNonconformity") + "") && M(a, t);
1219
- },
1220
- d(o) {
1221
- o && I(e);
1222
- }
1223
- };
1224
- }
1225
- function qi(i) {
1226
- let e, t, a, o = (
1227
- /*$_*/
1228
- i[32]("faceCollector.provideAReasonForTheLowQualityCapture") + ""
1229
- ), r, f, n, l, u, c, d, b, h = (
1230
- /*$_*/
1231
- i[32]("faceCollector.thisInformationIsRequired") + ""
1232
- ), E, w, v, C;
1233
- return {
1234
- c() {
1235
- e = p("div"), t = p("label"), a = p("span"), r = P(o), f = N(), n = p("textarea"), u = N(), c = p("label"), d = p("span"), b = P("("), E = P(h), w = P(")"), m(a, "class", "ce-dui-label-text text-base"), m(t, "class", "ce-dui-label"), m(t, "for", "justification"), m(n, "contenteditable", ""), m(n, "id", "justification"), m(n, "class", "ce-dui-textarea ce-dui-textarea-bordered h-[6em] text-base"), m(n, "placeholder", l = /*$_*/
1236
- i[32]("faceCollector.yourJustification")), m(d, "class", "ce-dui-label-text-alt text-base"), m(c, "class", "ce-dui-label"), m(c, "for", "justification"), m(e, "class", "ce-dui-form-control");
1237
- },
1238
- m(y, S) {
1239
- R(y, e, S), g(e, t), g(t, a), g(a, r), g(e, f), g(e, n), ht(
1240
- n,
1241
- /*$justification*/
1242
- i[29]
1243
- ), g(e, u), g(e, c), g(c, d), g(d, b), g(d, E), g(d, w), v || (C = oe(
1244
- n,
1245
- "input",
1246
- /*textarea_input_handler*/
1247
- i[59]
1248
- ), v = !0);
1249
- },
1250
- p(y, S) {
1251
- S[1] & /*$_*/
1252
- 2 && o !== (o = /*$_*/
1253
- y[32]("faceCollector.provideAReasonForTheLowQualityCapture") + "") && M(r, o), S[1] & /*$_*/
1254
- 2 && l !== (l = /*$_*/
1255
- y[32]("faceCollector.yourJustification")) && m(n, "placeholder", l), S[0] & /*$justification*/
1256
- 536870912 && ht(
1257
- n,
1258
- /*$justification*/
1259
- y[29]
1260
- ), S[1] & /*$_*/
1261
- 2 && h !== (h = /*$_*/
1262
- y[32]("faceCollector.thisInformationIsRequired") + "") && M(E, h);
1263
- },
1264
- d(y) {
1265
- y && I(e), v = !1, C();
1266
- }
1267
- };
1268
- }
1269
- function Ji(i) {
1270
- let e, t, a = (
1271
- /*$_*/
1272
- i[32]("faceCollector.finish") + ""
1273
- ), o, r, f, n, l = (
1274
- /*$_*/
1275
- i[32]("faceCollector.retakePhoto") + ""
1276
- ), u, c, d;
1277
- return {
1278
- c() {
1279
- e = p("div"), t = p("button"), o = P(a), f = N(), n = p("button"), u = P(l), t.disabled = r = /*evaluatePhoto*/
1280
- i[2] && /*showJustificationField*/
1281
- i[7] && /*$justification*/
1282
- i[29].length === 0 && /*$unconformitiesStore*/
1283
- i[33].unconformities.length !== 0, m(t, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink text-base"), m(n, "id", "bry-cc-retake-button"), m(n, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink text-base"), m(e, "class", "ce-dui-btn-group flex");
1284
- },
1285
- m(b, h) {
1286
- R(b, e, h), g(e, t), g(t, o), g(e, f), g(e, n), g(n, u), c || (d = [
1287
- oe(
1288
- t,
1289
- "click",
1290
- /*click_handler_4*/
1291
- i[60]
1292
- ),
1293
- oe(
1294
- n,
1295
- "click",
1296
- /*click_handler_5*/
1297
- i[61]
1298
- )
1299
- ], c = !0);
1300
- },
1301
- p(b, h) {
1302
- h[1] & /*$_*/
1303
- 2 && a !== (a = /*$_*/
1304
- b[32]("faceCollector.finish") + "") && M(o, a), h[0] & /*evaluatePhoto, showJustificationField, $justification*/
1305
- 536871044 | h[1] & /*$unconformitiesStore*/
1306
- 4 && r !== (r = /*evaluatePhoto*/
1307
- b[2] && /*showJustificationField*/
1308
- b[7] && /*$justification*/
1309
- b[29].length === 0 && /*$unconformitiesStore*/
1310
- b[33].unconformities.length !== 0) && (t.disabled = r), h[1] & /*$_*/
1311
- 2 && l !== (l = /*$_*/
1312
- b[32]("faceCollector.retakePhoto") + "") && M(u, l);
1313
- },
1314
- d(b) {
1315
- b && I(e), c = !1, vt(d);
1316
- }
1317
- };
1318
- }
1319
- function ja(i) {
1320
- let e, t = (
1321
- /*$_*/
1322
- i[32]("faceCollector.everythingOk") + ""
1323
- ), a;
1324
- return {
1325
- c() {
1326
- e = p("h1"), a = P(t), m(e, "class", "text-3xl font-bold pb-[1em] transition-opacity");
1327
- },
1328
- m(o, r) {
1329
- R(o, e, r), g(e, a);
1330
- },
1331
- p(o, r) {
1332
- r[1] & /*$_*/
1333
- 2 && t !== (t = /*$_*/
1334
- o[32]("faceCollector.everythingOk") + "") && M(a, t);
1335
- },
1336
- d(o) {
1337
- o && I(e);
1338
- }
1339
- };
1340
- }
1341
- function Ka(i) {
1342
- let e, t, a, o, r = (
1343
- /*$_*/
1344
- i[32]("liveness.error.faceQualityInsufficient") + ""
1345
- ), f, n = (
1346
- /*$unconformitiesStore*/
1347
- i[33].unconformities
1348
- ), l = [];
1349
- for (let c = 0; c < n.length; c += 1)
1350
- l[c] = Qi(Mi(i, n, c));
1351
- let u = (
1352
- /*evaluatePhoto*/
1353
- i[2] && /*$unconformitiesStore*/
1354
- i[33].unconformities.length == 0 && Xi(i)
1355
- );
1356
- return {
1357
- c() {
1358
- e = p("div");
1359
- for (let c = 0; c < l.length; c += 1)
1360
- l[c].c();
1361
- t = N(), u && u.c(), a = N(), o = p("h1"), f = P(r), m(e, "class", "flex flex-wrap"), m(o, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1362
- },
1363
- m(c, d) {
1364
- R(c, e, d);
1365
- for (let b = 0; b < l.length; b += 1)
1366
- l[b] && l[b].m(e, null);
1367
- g(e, t), u && u.m(e, null), R(c, a, d), R(c, o, d), g(o, f);
1368
- },
1369
- p(c, d) {
1370
- if (d[1] & /*$unconformitiesStore*/
1371
- 4) {
1372
- n = /*$unconformitiesStore*/
1373
- c[33].unconformities;
1374
- let b;
1375
- for (b = 0; b < n.length; b += 1) {
1376
- const h = Mi(c, n, b);
1377
- l[b] ? l[b].p(h, d) : (l[b] = Qi(h), l[b].c(), l[b].m(e, t));
1378
- }
1379
- for (; b < l.length; b += 1)
1380
- l[b].d(1);
1381
- l.length = n.length;
1382
- }
1383
- /*evaluatePhoto*/
1384
- c[2] && /*$unconformitiesStore*/
1385
- c[33].unconformities.length == 0 ? u ? u.p(c, d) : (u = Xi(c), u.c(), u.m(e, null)) : u && (u.d(1), u = null), d[1] & /*$_*/
1386
- 2 && r !== (r = /*$_*/
1387
- c[32]("liveness.error.faceQualityInsufficient") + "") && M(f, r);
1388
- },
1389
- d(c) {
1390
- c && I(e), xi(l, c), u && u.d(), c && I(a), c && I(o);
1391
- }
1392
- };
1393
- }
1394
- function Ha(i) {
1395
- let e, t = (
1396
- /*$_*/
1397
- i[32]("liveness.error.evaluationError") + ""
1398
- ), a;
1399
- return {
1400
- c() {
1401
- e = p("h1"), a = P(t), m(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1402
- },
1403
- m(o, r) {
1404
- R(o, e, r), g(e, a);
1405
- },
1406
- p(o, r) {
1407
- r[1] & /*$_*/
1408
- 2 && t !== (t = /*$_*/
1409
- o[32]("liveness.error.evaluationError") + "") && M(a, t);
1410
- },
1411
- d(o) {
1412
- o && I(e);
1413
- }
1414
- };
1415
- }
1416
- function qa(i) {
1417
- let e, t = (
1418
- /*$_*/
1419
- i[32]("faceCollector.unableToCompleteRequest") + ""
1420
- ), a;
1421
- return {
1422
- c() {
1423
- e = p("h1"), a = P(t), m(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1424
- },
1425
- m(o, r) {
1426
- R(o, e, r), g(e, a);
1427
- },
1428
- p(o, r) {
1429
- r[1] & /*$_*/
1430
- 2 && t !== (t = /*$_*/
1431
- o[32]("faceCollector.unableToCompleteRequest") + "") && M(a, t);
1432
- },
1433
- d(o) {
1434
- o && I(e);
1435
- }
1436
- };
1437
- }
1438
- function Ja(i) {
1439
- let e, t = (
1440
- /*$_*/
1441
- i[32]("faceCollector.lowQualityCapture") + ""
1442
- ), a;
1443
- return {
1444
- c() {
1445
- e = p("h1"), a = P(t), m(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1446
- },
1447
- m(o, r) {
1448
- R(o, e, r), g(e, a);
1449
- },
1450
- p(o, r) {
1451
- r[1] & /*$_*/
1452
- 2 && t !== (t = /*$_*/
1453
- o[32]("faceCollector.lowQualityCapture") + "") && M(a, t);
1454
- },
1455
- d(o) {
1456
- o && I(e);
1457
- }
1458
- };
1459
- }
1460
- function Qa(i) {
1461
- let e, t = (
1462
- /*$_*/
1463
- i[32]("liveness.error.error") + ""
1464
- ), a, o, r = (
1465
- /*$_*/
1466
- i[32]("faceCollector.unaliveCapture") + ""
1467
- ), f;
1468
- return {
1469
- c() {
1470
- e = p("h1"), a = P(t), o = P(": "), f = P(r), m(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1471
- },
1472
- m(n, l) {
1473
- R(n, e, l), g(e, a), g(e, o), g(e, f);
1474
- },
1475
- p(n, l) {
1476
- l[1] & /*$_*/
1477
- 2 && t !== (t = /*$_*/
1478
- n[32]("liveness.error.error") + "") && M(a, t), l[1] & /*$_*/
1479
- 2 && r !== (r = /*$_*/
1480
- n[32]("faceCollector.unaliveCapture") + "") && M(f, r);
1481
- },
1482
- d(n) {
1483
- n && I(e);
1484
- }
1485
- };
1486
- }
1487
- function Xa(i) {
1488
- let e, t = (
1489
- /*$_*/
1490
- i[32]("liveness.error.error") + ""
1491
- ), a, o, r = (
1492
- /*$_*/
1493
- i[32](
1494
- /*livenessError*/
1495
- i[22]
1496
- ) + ""
1497
- ), f;
1498
- return {
1499
- c() {
1500
- e = p("h1"), a = P(t), o = P(": "), f = P(r), m(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1501
- },
1502
- m(n, l) {
1503
- R(n, e, l), g(e, a), g(e, o), g(e, f);
1504
- },
1505
- p(n, l) {
1506
- l[1] & /*$_*/
1507
- 2 && t !== (t = /*$_*/
1508
- n[32]("liveness.error.error") + "") && M(a, t), l[0] & /*livenessError*/
1509
- 4194304 | l[1] & /*$_*/
1510
- 2 && r !== (r = /*$_*/
1511
- n[32](
1512
- /*livenessError*/
1513
- n[22]
1514
- ) + "") && M(f, r);
1515
- },
1516
- d(n) {
1517
- n && I(e);
1518
- }
1519
- };
1520
- }
1521
- function Qi(i) {
1522
- let e, t = (
1523
- /*unconformity*/
1524
- i[123] + ""
1525
- ), a;
1526
- return {
1527
- c() {
1528
- e = p("div"), a = P(t), m(e, "class", "ce-dui-badge ce-dui-badge-lg h-[2em] ce-dui-badge-error text-xl pb-[.25em] m-[.5em]");
1529
- },
1530
- m(o, r) {
1531
- R(o, e, r), g(e, a);
1532
- },
1533
- p(o, r) {
1534
- r[1] & /*$unconformitiesStore*/
1535
- 4 && t !== (t = /*unconformity*/
1536
- o[123] + "") && M(a, t);
1537
- },
1538
- d(o) {
1539
- o && I(e);
1540
- }
1541
- };
1542
- }
1543
- function Xi(i) {
1544
- let e, t = (
1545
- /*$_*/
1546
- i[32]("faceCollector.noNonconformity") + ""
1547
- ), a;
1548
- return {
1549
- c() {
1550
- e = p("div"), a = P(t), m(e, "class", "ce-dui-badge ce-dui-badge-lg h-[2em] ce-dui-badge-info text-xl pb-[.25em] m-[.5em]");
1551
- },
1552
- m(o, r) {
1553
- R(o, e, r), g(e, a);
1554
- },
1555
- p(o, r) {
1556
- r[1] & /*$_*/
1557
- 2 && t !== (t = /*$_*/
1558
- o[32]("faceCollector.noNonconformity") + "") && M(a, t);
1559
- },
1560
- d(o) {
1561
- o && I(e);
1562
- }
1563
- };
1564
- }
1565
- function Ga(i) {
1566
- let e, t, a, o, r, f, n, l, u, c, d = (
1567
- /*$videoStore*/
1568
- i[35] && Ui(i)
1569
- );
1570
- o = new ts({
1571
- props: {
1572
- waitingIdrndCaptureEvent: (
1573
- /*waitingIdrndCaptureEvent*/
1574
- i[21]
1575
- ),
1576
- idrndLoading: (
1577
- /*idrndLoading*/
1578
- i[19]
1579
- )
1580
- }
1581
- });
1582
- let b = (
1583
- /*$captured*/
1584
- i[26] && zi(i)
1585
- );
1586
- const h = [Pa, Na], E = [];
1587
- function w(v, C) {
1588
- return (!/*idrndClosed*/
1589
- v[20] || /*$captured*/
1590
- v[26]) && /*showUnconformities*/
1591
- v[3] ? 0 : (
1592
- /*$cameraStatusStore*/
1593
- v[23] !== V.OK ? 1 : -1
1594
- );
1595
- }
1596
- return ~(n = w(i)) && (l = E[n] = h[n](i)), {
1597
- c() {
1598
- e = p("div"), t = p("div"), d && d.c(), a = N(), he(o.$$.fragment), r = N(), b && b.c(), f = N(), l && l.c(), u = Gi(), this.c = X, m(t, "class", "relative mx-auto"), m(e, "class", "flex flex-col justify-between");
1599
- },
1600
- m(v, C) {
1601
- R(v, e, C), g(e, t), d && d.m(t, null), g(t, a), me(o, t, null), g(t, r), b && b.m(t, null), i[56](e), R(v, f, C), ~n && E[n].m(v, C), R(v, u, C), c = !0;
1602
- },
1603
- p(v, C) {
1604
- /*$videoStore*/
1605
- v[35] ? d ? (d.p(v, C), C[1] & /*$videoStore*/
1606
- 16 && H(d, 1)) : (d = Ui(v), d.c(), H(d, 1), d.m(t, a)) : d && (Je(), Q(d, 1, 1, () => {
1607
- d = null;
1608
- }), Qe());
1609
- const y = {};
1610
- C[0] & /*waitingIdrndCaptureEvent*/
1611
- 2097152 && (y.waitingIdrndCaptureEvent = /*waitingIdrndCaptureEvent*/
1612
- v[21]), C[0] & /*idrndLoading*/
1613
- 524288 && (y.idrndLoading = /*idrndLoading*/
1614
- v[19]), o.$set(y), /*$captured*/
1615
- v[26] ? b ? b.p(v, C) : (b = zi(v), b.c(), b.m(t, null)) : b && (b.d(1), b = null);
1616
- let S = n;
1617
- n = w(v), n === S ? ~n && E[n].p(v, C) : (l && (Je(), Q(E[S], 1, 1, () => {
1618
- E[S] = null;
1619
- }), Qe()), ~n ? (l = E[n], l ? l.p(v, C) : (l = E[n] = h[n](v), l.c()), H(l, 1), l.m(u.parentNode, u)) : l = null);
1620
- },
1621
- i(v) {
1622
- c || (H(d), H(o.$$.fragment, v), H(l), c = !0);
1623
- },
1624
- o(v) {
1625
- Q(d), Q(o.$$.fragment, v), Q(l), c = !1;
1626
- },
1627
- d(v) {
1628
- v && I(e), d && d.d(), _e(o), b && b.d(), i[56](null), v && I(f), ~n && E[n].d(v), v && I(u);
1629
- }
1630
- };
1631
- }
1632
- let Ya = 0, Za = 3e3;
1633
- function xa() {
1634
- ({}).VITE_USE_DEV === "true" ? import("./index-idlf-detector_39cfdffa_3.3.0-RC07.js") : import("./index-idlf-detector_a819b3c8_3.3.0-RC07.js");
1635
- }
1636
- function $a(i, e, t) {
1637
- let a, o, r, f, n, l, u, c, d, b, h, E, w, v, C, y, S, Re, le, z, L, A, T, De, x, re, we, Ce, Ne, pt, ae, xt, wt, Ct, Et, $t, ei;
1638
- D(i, Wt, (s) => t(76, a = s)), D(i, Mt, (s) => t(77, o = s)), D(i, it, (s) => t(79, f = s)), D(i, q, (s) => t(23, n = s)), D(i, Fe, (s) => t(24, l = s)), D(i, Ns, (s) => t(80, u = s)), D(i, st, (s) => t(81, c = s)), D(i, pe, (s) => t(25, d = s)), D(i, Ps, (s) => t(82, b = s)), D(i, Le, (s) => t(26, h = s)), D(i, Ut, (s) => t(83, E = s)), D(i, Zi, (s) => t(27, w = s)), D(i, yi, (s) => t(84, v = s)), D(i, Bs, (s) => t(85, C = s)), D(i, je, (s) => t(86, y = s)), D(i, ke, (s) => t(87, S = s)), D(i, Ws, (s) => t(88, Re = s)), D(i, Ms, (s) => t(89, le = s)), D(i, Vt, (s) => t(28, z = s)), D(i, zt, (s) => t(29, L = s)), D(i, de, (s) => t(30, A = s)), D(i, ee, (s) => t(31, T = s)), D(i, Yi, (s) => t(32, De = s)), D(i, Te, (s) => t(33, x = s)), D(i, ki, (s) => t(90, we = s)), D(i, jt, (s) => t(91, Ce = s)), D(i, at, (s) => t(92, Ne = s)), D(i, Kt, (s) => t(93, pt = s)), D(i, qe, (s) => t(35, ae = s)), D(i, Us, (s) => t(94, xt = s)), D(i, nt, (s) => t(95, wt = s)), D(i, Ti, (s) => t(96, Ct = s)), D(i, Oi, (s) => t(97, Et = s)), D(i, Vs, (s) => t(36, $t = s)), D(i, zs, (s) => t(37, ei = s));
1639
- let F, te, be, ti, ii = !1, Pe = !1, yt = !1, kt = !1, Tt = (/* @__PURE__ */ new Date()).getTime(), { enableMinutiae: Ot } = e, { videoDimensions: Rt } = e, { noTabs: Dt } = e, { weightsPath: It } = e, { evaluatePhoto: ge } = e, { showCaptureButton: At } = e, { showUnconformities: si } = e, { showConfigButton: ai } = e, { showAutoCaptureButton: Lt } = e, { showCameraButton: ni } = e, { showJustificationField: oi } = e, { minEyeToEyeDist: Be } = e, { showWatermark: li } = e, { videoOverlay: ri } = e, { videoOverlayTransparency: ci } = e, { faceDetectionSensitivity: St } = e, { hidden: Ge } = e, { livenessBlobSize: ui } = e;
1640
- const Ye = Gt(!1);
1641
- D(i, Ye, (s) => t(78, r = s));
1642
- const Ie = Gt("data:image/png;base64");
1643
- D(i, Ie, (s) => t(34, re = s));
1644
- let { widgetInstance: J } = e, fi = new wa(), We = !1, Ft = !1, Ze = !0, ne = !0, Me = !1, di = 0, $ = "", Nt = 0, xe = !0, hi = 0;
1645
- const $e = js.mixin({
1646
- toast: !0,
1647
- position: "bottom-left",
1648
- timer: 13e3,
1649
- timerProgressBar: !0
1650
- });
1651
- Ks(async () => {
1652
- if (Ri("Mounting Face Collector!"), _(at, Ne = !0, Ne), _(Fe, l = !1, l), mi(), Pt(), j() ? (xa(), is(), fi.startDetection()) : await Ee(), we)
1653
- try {
1654
- await Hs(It), ii = !0, ti = await qs();
1655
- } catch {
1656
- _(ki, we = !1, we), t(0, At = !0);
1657
- }
1658
- fe() || as();
1659
- });
1660
- async function Pt() {
1661
- const [s, O] = (Rt ?? "")?.replaceAll(" ", "")?.split("x")?.map((k) => k ? parseInt(k) : void 0);
1662
- !s || !O || (fe() ? (await Js(), _(
1663
- qe,
1664
- ae = {
1665
- videoWidth: window.innerWidth,
1666
- videoHeight: window.innerHeight
1667
- },
1668
- ae
1669
- )) : _(qe, ae = { videoWidth: s, videoHeight: O }, ae));
1670
- }
1671
- function mi() {
1672
- _(it, f = !1, f), _(Le, h = !1, h), _(st, c = Ht.FRONT_CAMERA, c), Lt && _(yi, v = !1, v), _(Vt, z = !1, z), _(ee, T = K.OK, T), _(je, y = "", y), _(Te, x.unconformities = [], x);
1673
- const s = dt(qt);
1674
- s.closedMouth = !1, s.isPersonCloseEnough = !1, s.isPersonTooclose = !0, s.isPersonInFrame = !1, qt.set(s), _(ke, S = "", S), _(jt, Ce = !0, Ce);
1675
- }
1676
- function is() {
1677
- J.addEventListener("open", (s) => {
1678
- const O = s.detail[0].video;
1679
- _(
1680
- Oi,
1681
- Et = {
1682
- width: O.videoWidth,
1683
- height: O.videoHeight
1684
- },
1685
- Et
1686
- ), t(14, F.srcObject = O.srcObject, F), _(Wt, a = F.srcObject, a), t(19, Ze = !1), Ge || Qs(J), _(Fe, l = !0, l);
1687
- function k() {
1688
- ne || He(F, k, !0);
1689
- }
1690
- k();
1691
- }), J.addEventListener("error", (s) => {
1692
- ie(s), s.detail[0].message.toLowerCase().includes("device in use") ? _(q, n = V.CAMERA_IN_USE_ERROR, n) : s.detail[0].message.toLowerCase().includes("permission") ? _(q, n = V.CAMERA_DENIED_ERROR, n) : s.detail[0].message.toLowerCase().includes("not found") && !fe() ? _(q, n = V.DEVICE_NOT_FOUND_ERROR, n) : _(q, n = V.CAMERA_DENIED_ERROR, n), t(19, Ze = !1);
1693
- }), J.addEventListener("faceDetection", (s) => {
1694
- s.detail[0].errors.length > 0 && Di(s.detail[0].errors);
1695
- }), J.addEventListener("detection", (s) => {
1696
- s.detail[0].errors.length > 0 && Di(s.detail[0].errors);
1697
- }), J.addEventListener("close", async (s) => {
1698
- h || (We = !1), t(20, ne = !0), t(21, Me = !1), n === V.OK && (_(q, n = V.CAMERA_CLOSED_ERROR, n), setTimeout(
1699
- () => {
1700
- ne && Ge && (Ri("Reopening camera after close (lost focus on widget)"), Ue());
1701
- },
1702
- 1e3
1703
- ));
1704
- }), J.addEventListener("initialize", async (s) => {
1705
- Ft = !0, _(Ti, Ct = !0, Ct);
1706
- try {
1707
- J.setLicense(Xs, "faceDetector");
1708
- } catch (O) {
1709
- ie("Error setting license:", O);
1710
- }
1711
- pt === ot.Face && !We && !h && Ft && await Bt();
1712
- }), J.addEventListener("capture", async (s) => {
1713
- t(22, $ = "");
1714
- const { encryptedFile: O, photo: k } = s.detail[0];
1715
- _(nt, wt = O, wt);
1716
- const B = (await lt(k)).split(",");
1717
- if (t(21, Me = !1), _(ee, T = K.OK, T), _(Te, x.isLoading = !0, x), _(Le, h = !0, h), We = !1, _(Ie, re = B[0], re), _(de, A = B[1], A), _(je, y = B[1], y), !xt) {
1718
- let G, ve, wi, Ci;
1719
- try {
1720
- if (Ce && !Ii(Be))
1721
- throw new Error("FACE_TOO_SMALL");
1722
- const Z = Gs();
1723
- if (Ce && Z)
1724
- throw new Error(Z);
1725
- ({ bodyParts: G, icaoWarnings: ve } = await rt(y, ge, (await lt(O)).split(",")[1])), window.dispatchEvent(new CustomEvent(
1726
- "face-unconformities-validated",
1727
- {
1728
- detail: {
1729
- bodyParts: G,
1730
- icaoWarnings: ve,
1731
- status: T
1732
- }
1733
- }
1734
- ));
1735
- } catch (Z) {
1736
- ie(Z);
1737
- let ye = Oe.UNKNOWN, Ve = [], Ei = [];
1738
- Z instanceof Jt && Z.response?.status === 400 ? Z.response.data && Array.isArray(Z.response.data.bodyParts) ? (Ve = Z.response.data.bodyParts, Ei = Z.response.data.icaoWarnings, wi = Z.response.data.invalidLivenessCounter, Ci = Z.response.data.invalidLivenessLimit, ye = Ve.find((Ss) => Ss.livenessResult.error)?.livenessResult.error_code, _(ee, T = K.LIVENESS_DETECTION_FAILURE, T), t(22, $ = Oe[ye]), ie("Liveness error:", ye)) : _(ee, T = K.TEMPLATE_EXTRACTION_ERROR, T) : Z instanceof Error && Ys.includes(Z.message) ? (_(ee, T = K.UNKNOWN_LIVENESS_ERROR, T), ye = Z.message, t(22, $ = Oe[ye]), Ve = vi(), Ve[0].livenessResult = {
1739
- error: $,
1740
- error_code: ye
1741
- }) : ge && $e.fire({
1742
- icon: "error",
1743
- title: "Falha ao comunicar com serviço de Liveness"
1744
- }), _(Te, x.isLoading = !1, x), window.dispatchEvent(new CustomEvent(
1745
- "face-unconformities-validated",
1746
- {
1747
- detail: {
1748
- bodyParts: Ve,
1749
- errorCode: ye,
1750
- translatedError: De($),
1751
- status: T,
1752
- icaoWarnings: Ei,
1753
- invalidLivenessCounter: wi,
1754
- invalidLivenessLimit: Ci
1755
- }
1756
- }
1757
- ));
1758
- return;
1759
- }
1760
- if (T !== K.OK) {
1761
- ve && Ke(ve), _(Te, x.isLoading = !1, x);
1762
- return;
1763
- }
1764
- G[0].livenessResult && bi(G[0].livenessResult), G.length !== 0 && G[0].data && _(de, A = G[0].data, A), Ke(ve);
1765
- return;
1766
- }
1767
- let U, Y;
1768
- try {
1769
- Y = await Zs(O), bi(Y.data);
1770
- } catch (G) {
1771
- _(ee, T = K.UNKNOWN_LIVENESS_ERROR, T), ie(G), G instanceof Jt && G.response?.status === 400 ? (U = G.response.data.error_code, t(22, $ = Oe[U]), ie("Liveness error:", U), _(ee, T = K.LIVENESS_DETECTION_FAILURE, T)) : $e.fire({
1772
- icon: "error",
1773
- title: "Falha ao comunicar com serviço de Liveness"
1774
- });
1775
- }
1776
- if (T !== K.OK) {
1777
- _(Te, x.isLoading = !1, x), window.dispatchEvent(new CustomEvent(
1778
- "face-unconformities-validated",
1779
- {
1780
- detail: {
1781
- bodyParts: [
1782
- {
1783
- bodyPart: "FACE",
1784
- data: y,
1785
- livenessBlob: (await lt(O)).split(",")[1],
1786
- ...Y && { livenessResult: Y }
1787
- }
1788
- ],
1789
- ...U && { errorCode: U },
1790
- ...$ && { translatedError: De($) },
1791
- status: T
1792
- }
1793
- }
1794
- ));
1795
- return;
1796
- }
1797
- let { bodyParts: ce, icaoWarnings: ue } = await rt(y, ge);
1798
- window.dispatchEvent(new CustomEvent(
1799
- "face-unconformities-validated",
1800
- {
1801
- detail: {
1802
- bodyParts: ce,
1803
- icaoWarnings: ue,
1804
- status: T,
1805
- errorCode: U,
1806
- ...$ && { translatedError: De($) }
1807
- }
1808
- }
1809
- )), ce[0].data && _(de, A = ce[0].data, A), Ke(ue);
1810
- });
1811
- }
1812
- async function Ee(s) {
1813
- if (!xe) {
1814
- _(q, n = V.CAMERA_ORIENTATION_PORTRAIT, n);
1815
- return;
1816
- }
1817
- await Pt(), j() ? Bt() : await ss(ae.videoWidth, ae.videoHeight, s);
1818
- }
1819
- async function Bt() {
1820
- if (j()) {
1821
- if (await Pt(), !b[0]?.deviceId) {
1822
- try {
1823
- await Ai(640, 480);
1824
- } catch (s) {
1825
- const O = s, k = Se(s) && s.constraint ? s.constraint : "";
1826
- ie(O.message, k), Se(O) && "message" in O && O.message.includes("Requested device not found") && _(q, n = V.DEVICE_NOT_FOUND_ERROR, n);
1827
- }
1828
- await Qt(), _(pe, d = b[0].deviceId, d);
1829
- }
1830
- _(q, n = V.OK, n), J && "openCamera" in J && J.openCamera(), We = !0, t(20, ne = !1), t(19, Ze = !0);
1831
- }
1832
- }
1833
- async function et() {
1834
- if (we && !ii)
1835
- return He(F, et);
1836
- if (F) {
1837
- if (pt !== ot.Face && !Dt)
1838
- return He(F, et);
1839
- _(Fe, l = !0, l), _(at, Ne = !1, Ne), we && (r || _(Ye, r = !0, r)), He(F, et);
1840
- }
1841
- }
1842
- async function _i(s = !0) {
1843
- if (_(ee, T = K.OK, T), j()) {
1844
- _(jt, Ce = s, Ce), t(21, Me = !0), J.takePhoto();
1845
- return;
1846
- }
1847
- let O = null;
1848
- try {
1849
- if (we) {
1850
- const Y = await la(F, St);
1851
- if (O = Y.canvas, _(Le, h = !0, h), !Y.result && s) {
1852
- const ve = O.toDataURL("image/jpeg").split(",");
1853
- throw _(Ie, re = ve[0], re), _(de, A = ve[1], A), new Error("FACE_NOT_FOUND");
1854
- }
1855
- const ce = O.toDataURL("image/jpeg").split(",");
1856
- _(Ie, re = ce[0], re), _(de, A = ce[1], A), _(je, y = ce[1], y);
1857
- let ue, G;
1858
- if (!Ii(Be) && s)
1859
- throw new Error("FACE_TOO_SMALL");
1860
- ({ bodyParts: ue, icaoWarnings: G } = await rt(A, ge)), window.dispatchEvent(new CustomEvent(
1861
- "face-unconformities-validated",
1862
- {
1863
- detail: {
1864
- bodyParts: ue,
1865
- icaoWarnings: G,
1866
- status: T
1867
- }
1868
- }
1869
- )), ue.length !== 0 && ue[0].data && _(de, A = ue[0].data, A), Ke(G);
1870
- return;
1871
- }
1872
- _(Le, h = !0, h);
1873
- const k = await ns();
1874
- _(Ie, re = k[0], re), _(de, A = k[1], A), _(je, y = k[1], y);
1875
- let { bodyParts: B, icaoWarnings: U } = await rt(A, ge);
1876
- window.dispatchEvent(new CustomEvent(
1877
- "face-unconformities-validated",
1878
- {
1879
- detail: {
1880
- bodyParts: B,
1881
- icaoWarnings: U,
1882
- status: T
1883
- }
1884
- }
1885
- )), B.length !== 0 && B[0].data && _(de, A = B[0].data, A), Ke(U);
1886
- } catch (k) {
1887
- ie(k);
1888
- let B = Oe.UNKNOWN, U = [], Y = [];
1889
- if (k instanceof Jt && k.response?.status === 400)
1890
- if (k.response.data && Array.isArray(k.response.data.bodyParts)) {
1891
- U = k.response.data.bodyParts, Y = k.response.data.icaoWarnings;
1892
- const ce = U.find((ue) => ue.livenessResult.error);
1893
- B = ce?.livenessResult.error_code, _(ee, T = K.LIVENESS_DETECTION_FAILURE, T), ce?.livenessResult.error_code || _(ee, T = K.UNKNOWN_LIVENESS_ERROR, T), t(22, $ = Oe[B]), ie("Liveness error:", B);
1894
- } else
1895
- _(ee, T = K.TEMPLATE_EXTRACTION_ERROR, T);
1896
- else
1897
- k instanceof Error && ["FACE_NOT_FOUND", "FACE_TOO_SMALL"].includes(k.message) ? (_(ee, T = K.LIVENESS_DETECTION_FAILURE, T), B = k.message, t(22, $ = Oe[B]), U = vi()) : (_(ee, T = K.UNABLE_TO_COMMUNICATE_WITH_TEMPLATE_EXTRACTION_SERVICE, T), ge && $e.fire({
1898
- icon: "error",
1899
- title: "Falha ao comunicar com serviço de Liveness"
1900
- }));
1901
- _(Te, x.isLoading = !1, x), window.dispatchEvent(new CustomEvent(
1902
- "face-unconformities-validated",
1903
- {
1904
- detail: {
1905
- bodyParts: U,
1906
- errorCode: B,
1907
- translatedError: De($),
1908
- status: T,
1909
- icaoWarnings: Y
1910
- }
1911
- }
1912
- ));
1913
- }
1914
- }
1915
- function tt() {
1916
- const s = {
1917
- bodyPart: "FACE",
1918
- data: A,
1919
- justification: L
1920
- };
1921
- _(Vt, z = !0, z), dt(nt) && lt(dt(nt)).then((O) => {
1922
- s.livenessBlob = O.split(",")[1];
1923
- }), window.dispatchEvent(new CustomEvent("export-face", { detail: s }));
1924
- }
1925
- function Ae() {
1926
- window.dispatchEvent(new CustomEvent("face-scrapped")), mi(), ne && Bt();
1927
- }
1928
- function bi(s) {
1929
- let O = "", k = "success";
1930
- s.isAlive ? O = `Vivacidade de face (${s.face_liveness.probability.toFixed(2)}) e de captura (${s.capture_liveness.probability}, ${s.capture_liveness.score.toFixed(2)}) verificados!` : s?.face_liveness?.probability && (k = "error", O = `Vivacidade de face (${s.face_liveness.probability.toFixed(2)}) e de captura (${s.capture_liveness.probability}, ${s.capture_liveness.score.toFixed(2)}) insuficientes!`), le && $e.fire({ icon: k, title: O });
1931
- }
1932
- async function ss(s, O, k) {
1933
- try {
1934
- const { stream: B, deviceId: U } = await Ai(Re.width, Re.height, c, k);
1935
- _(Wt, a = B, a), _(pe, d = U || b[0].deviceId, d);
1936
- } catch (B) {
1937
- const U = B, Y = Se(B) && B.constraint ? B.constraint : "";
1938
- ie(U.message, Y), Se(U) && "message" in U && U.message.toLowerCase().includes("permission") ? (ie("User didn't give permission to use camera!"), _(q, n = V.CAMERA_DENIED_ERROR, n)) : Se(U) && "message" in U && U.message.toLowerCase().includes("not found") && !fe() ? _(q, n = V.DEVICE_NOT_FOUND_ERROR, n) : Y.includes("width") || Y.includes("height") ? (ie(`Camera does not meet the minimum supported requirements! (${Y})`), _(q, n = V.CAMERA_UNSUPPORTED, n)) : (_(q, n = V.CAMERA_DENIED_ERROR, n), ie("Unable to open camera!"));
1939
- }
1940
- }
1941
- async function Ue() {
1942
- _(pe, d = "", d), await Ee();
1943
- }
1944
- function as() {
1945
- navigator.mediaDevices.ondevicechange = async (s) => {
1946
- s.type == "devicechange" && (await Qt(), n !== V.OK ? await Ue() : (!j() && !a.active || j() && !ne) && (ct(J), _(q, n = V.DEVICE_NOT_FOUND_ERROR, n), t(20, ne = !0)));
1947
- };
1948
- }
1949
- async function gi() {
1950
- _(it, f = !1, f);
1951
- const s = (/* @__PURE__ */ new Date()).getTime();
1952
- if (s - Tt > 5e3) {
1953
- Tt = s;
1954
- try {
1955
- if (F.width === 0 || F.height === 0)
1956
- return;
1957
- const k = await ra(F);
1958
- if (k < 50) {
1959
- _(ke, S = "faceCollector.illuminationTooLow", S);
1960
- return;
1961
- }
1962
- if (k > 180) {
1963
- _(ke, S = "faceCollector.illuminationTooHigh", S);
1964
- return;
1965
- }
1966
- } catch (k) {
1967
- Li("An error occurred while getting the video lighting level: ", k);
1968
- }
1969
- try {
1970
- if (await ca(F) < 4.5) {
1971
- _(ke, S = "faceCollector.lowSharpness", S);
1972
- return;
1973
- }
1974
- } catch (k) {
1975
- Li("An error occurred while getting the video sharpness level: ", k);
1976
- }
1977
- _(ke, S = "faceCollector.faceWasNotFound", S);
1978
- } else
1979
- yt || (yt = !0, setTimeout(
1980
- () => {
1981
- let k = [
1982
- "faceCollector.faceWasNotFound",
1983
- "faceCollector.illuminationTooLow",
1984
- "faceCollector.lowSharpness",
1985
- "faceCollector.illuminationTooHigh"
1986
- ];
1987
- yt = !1, t(18, kt = !1), S && !k.includes(S) && _(ke, S = "", S);
1988
- },
1989
- 1500
1990
- ));
1991
- }
1992
- function vi() {
1993
- return [
1994
- {
1995
- bodyPart: "FACE",
1996
- data: y,
1997
- format: "jpg",
1998
- capturedEyeToEyeDist: C,
1999
- minEyeToEyeDist: Be
2000
- }
2001
- ];
2002
- }
2003
- async function ns() {
2004
- const s = document.createElement("canvas"), O = s.getContext("2d");
2005
- return s.width = F.width, s.height = F.height, O?.drawImage(F, 0, 0, s.width, s.height), s.toDataURL("image/jpeg").split(",");
2006
- }
2007
- const os = qt.subscribe((s) => {
2008
- let O = "";
2009
- if (s.isPersonCloseEnough ? s.isPersonTooclose ? O = "faceCollector.moveAwayCamera" : s.isPersonInFrame ? s.closedMouth || (O = "faceCollector.dontOpenMouth") : O = "faceCollector.stayInFrame" : O = "faceCollector.comeCloserCamera", f && xs(O), !h && v && f && !w && !Pe && s.isPersonInFrame && s.closedMouth && !(!s.isPersonCloseEnough || s.isPersonTooclose)) {
2010
- t(17, Pe = !0), hi = (/* @__PURE__ */ new Date()).getTime() + Za;
2011
- const k = setInterval(
2012
- async () => {
2013
- if (!v || h || w || Me || j() && ne || !s.isPersonCloseEnough || s.isPersonTooclose || !s.closedMouth || !s.isPersonInFrame) {
2014
- t(17, Pe = !1), setTimeout(
2015
- () => {
2016
- },
2017
- 1500
2018
- ), clearInterval(k);
2019
- return;
2020
- }
2021
- const B = (/* @__PURE__ */ new Date()).getTime();
2022
- Math.floor((hi - B) % (1e3 * 60) / 1e3) <= 0 && (clearInterval(k), t(17, Pe = !1), _i());
2023
- },
2024
- 100
2025
- );
2026
- }
2027
- }), ls = Le.subscribe((s) => {
2028
- be && (s ? (be.classList.remove("flex"), be.classList.add("hidden")) : (be.classList.add("flex"), be.classList.remove("hidden")));
2029
- }), rs = Ut.subscribe((s) => {
2030
- F && s && (Xt("setting null in video srcObject"), t(14, F.srcObject = null, F), t(14, F.src = "", F), _(pe, d = null, d));
2031
- });
2032
- Kt.subscribe(async (s) => {
2033
- s === ot.Face && (await Qt(), j() && _(pe, d = b[0]?.deviceId, d));
2034
- });
2035
- const cs = pe.subscribe(async (s) => {
2036
- if (!(!j() && !a || !s || j() && ne))
2037
- try {
2038
- if (j()) {
2039
- await ct(J), await Ee();
2040
- return;
2041
- }
2042
- t(14, F.srcObject = a, F), _(Ut, E = !1, E), xe ? _(q, n = V.OK, n) : _(q, n = V.CAMERA_ORIENTATION_PORTRAIT, n), a.getTracks().forEach((O) => {
2043
- O.readyState === "live" && Xt(`Camera ${O.label} (${O.id}) opened successfully!`);
2044
- }), _(q, n = V.OK, n), $s(F);
2045
- } catch (O) {
2046
- const k = O;
2047
- t(20, ne = !0), Se(k) && "message" in k && k.message.includes("Requested device not found") && _(q, n = V.DEVICE_NOT_FOUND_ERROR, n);
2048
- }
2049
- }), us = Kt.subscribe(async (s) => {
2050
- s === ot.Face && j() && !We && !h && Ft && await Ee();
2051
- }), fs = Ye.subscribe(async (s) => {
2052
- s && pi();
2053
- }), ds = ea.subscribe(async (s) => {
2054
- if (b[0]?.deviceId) {
2055
- if (ct(), !fe() || j()) {
2056
- const k = (b.findIndex((U) => U.deviceId === d) + 1) % b.length, B = b[k].deviceId;
2057
- j() ? _(pe, d = B, d) : await Ee(B);
2058
- return;
2059
- }
2060
- s ? (_(st, c = Ht.REAR_CAMERA, c), await Ee()) : (_(st, c = Ht.FRONT_CAMERA, c), await Ee());
2061
- }
2062
- }), hs = ta.subscribe(async (s) => {
2063
- !s.isSupported || !fe() || u != "FACE" || (xe = s.orientation.includes("portrait"), xe ? F && !l ? await Ue() : l && _(q, n = V.OK, n) : _(q, n = V.CAMERA_ORIENTATION_PORTRAIT, n));
2064
- }), ms = Yt.subscribe((s) => {
2065
- s && window.dispatchEvent(new CustomEvent("console-open-status", { detail: { isOpen: s } }));
2066
- });
2067
- async function pi() {
2068
- let s;
2069
- try {
2070
- if (Nt >= Ya) {
2071
- Nt = 0;
2072
- let O;
2073
- if (O = _a(F, ti), s = await O.withFaceLandmarks(), te.getContext("2d")?.clearRect(0, 0, te.width, te.height), s != null) {
2074
- const k = ba(te, F, !0);
2075
- ia(te, F, k);
2076
- const B = ga(s, k);
2077
- sa(B) ? (aa(B, te, Ot), _(it, f = !0, f), t(18, kt = !0), Tt = (/* @__PURE__ */ new Date()).getTime()) : gi();
2078
- } else
2079
- gi();
2080
- } else
2081
- Nt++;
2082
- } catch {
2083
- } finally {
2084
- r && He(F, pi);
2085
- }
2086
- }
2087
- Mt.subscribe(async (s) => {
2088
- s && (Ae(), _(Mt, o = !1, o));
2089
- });
2090
- const _s = Fe.subscribe((s) => {
2091
- s && window.dispatchEvent(new CustomEvent("brycc-camera-ready", { detail: { stream: a } }));
2092
- }), bs = at.subscribe((s) => {
2093
- s && window.dispatchEvent(new CustomEvent("brycc-face-initialized"));
2094
- });
2095
- na(() => {
2096
- Xt("Destroying face collector"), ct(J), ls(), os(), rs(), cs(), us(), clearInterval(di), fs(), ds(), hs(), ms(), _s(), bs(), di = 0, fi.stopDetection();
2097
- });
2098
- function gs(s) {
2099
- ft[s ? "unshift" : "push"](() => {
2100
- J = s, t(1, J);
2101
- });
2102
- }
2103
- function vs(s) {
2104
- ft[s ? "unshift" : "push"](() => {
2105
- F = s, t(14, F);
2106
- });
2107
- }
2108
- const ps = () => {
2109
- j() || (t(14, F.width = ae.videoWidth, F), t(14, F.height = ae.videoHeight, F), t(15, te.width = ae.videoWidth, te), t(15, te.height = ae.videoHeight, te));
2110
- };
2111
- function ws(s) {
2112
- ft[s ? "unshift" : "push"](() => {
2113
- te = s, t(15, te);
2114
- });
2115
- }
2116
- const Cs = () => tt(), Es = () => Ae();
2117
- function ys(s) {
2118
- ft[s ? "unshift" : "push"](() => {
2119
- be = s, t(16, be);
2120
- });
2121
- }
2122
- const ks = () => tt(), Ts = () => Ae();
2123
- function Os() {
2124
- L = this.value, zt.set(L);
2125
- }
2126
- const Rs = () => tt(), Ds = () => Ae();
2127
- function Is() {
2128
- L = this.value, zt.set(L);
2129
- }
2130
- const As = () => Ae(), Ls = async () => {
2131
- await Ue();
2132
- };
2133
- return i.$$set = (s) => {
2134
- "enableMinutiae" in s && t(43, Ot = s.enableMinutiae), "videoDimensions" in s && t(44, Rt = s.videoDimensions), "noTabs" in s && t(45, Dt = s.noTabs), "weightsPath" in s && t(46, It = s.weightsPath), "evaluatePhoto" in s && t(2, ge = s.evaluatePhoto), "showCaptureButton" in s && t(0, At = s.showCaptureButton), "showUnconformities" in s && t(3, si = s.showUnconformities), "showConfigButton" in s && t(4, ai = s.showConfigButton), "showAutoCaptureButton" in s && t(5, Lt = s.showAutoCaptureButton), "showCameraButton" in s && t(6, ni = s.showCameraButton), "showJustificationField" in s && t(7, oi = s.showJustificationField), "minEyeToEyeDist" in s && t(47, Be = s.minEyeToEyeDist), "showWatermark" in s && t(8, li = s.showWatermark), "videoOverlay" in s && t(9, ri = s.videoOverlay), "videoOverlayTransparency" in s && t(10, ci = s.videoOverlayTransparency), "faceDetectionSensitivity" in s && t(48, St = s.faceDetectionSensitivity), "hidden" in s && t(49, Ge = s.hidden), "livenessBlobSize" in s && t(11, ui = s.livenessBlobSize), "widgetInstance" in s && t(1, J = s.widgetInstance);
2135
- }, [
2136
- At,
2137
- J,
2138
- ge,
2139
- si,
2140
- ai,
2141
- Lt,
2142
- ni,
2143
- oi,
2144
- li,
2145
- ri,
2146
- ci,
2147
- ui,
2148
- et,
2149
- _i,
2150
- F,
2151
- te,
2152
- be,
2153
- Pe,
2154
- kt,
2155
- Ze,
2156
- ne,
2157
- Me,
2158
- $,
2159
- n,
2160
- l,
2161
- d,
2162
- h,
2163
- w,
2164
- z,
2165
- L,
2166
- A,
2167
- T,
2168
- De,
2169
- x,
2170
- re,
2171
- ae,
2172
- $t,
2173
- ei,
2174
- Ye,
2175
- Ie,
2176
- tt,
2177
- Ae,
2178
- Ue,
2179
- Ot,
2180
- Rt,
2181
- Dt,
2182
- It,
2183
- Be,
2184
- St,
2185
- Ge,
2186
- gs,
2187
- vs,
2188
- ps,
2189
- ws,
2190
- Cs,
2191
- Es,
2192
- ys,
2193
- ks,
2194
- Ts,
2195
- Os,
2196
- Rs,
2197
- Ds,
2198
- Is,
2199
- As,
2200
- Ls
2201
- ];
2202
- }
2203
- class en extends mt {
2204
- constructor(e) {
2205
- super(), _t(
2206
- this,
2207
- {
2208
- target: this.shadowRoot,
2209
- props: gt(this.attributes),
2210
- customElement: !0
2211
- },
2212
- $a,
2213
- Ga,
2214
- bt,
2215
- {
2216
- enableMinutiae: 43,
2217
- videoDimensions: 44,
2218
- noTabs: 45,
2219
- weightsPath: 46,
2220
- evaluatePhoto: 2,
2221
- showCaptureButton: 0,
2222
- showUnconformities: 3,
2223
- showConfigButton: 4,
2224
- showAutoCaptureButton: 5,
2225
- showCameraButton: 6,
2226
- showJustificationField: 7,
2227
- minEyeToEyeDist: 47,
2228
- showWatermark: 8,
2229
- videoOverlay: 9,
2230
- videoOverlayTransparency: 10,
2231
- faceDetectionSensitivity: 48,
2232
- hidden: 49,
2233
- livenessBlobSize: 11,
2234
- widgetInstance: 1,
2235
- play: 12,
2236
- capture: 13
2237
- },
2238
- null,
2239
- [-1, -1, -1, -1, -1]
2240
- ), e && (e.target && R(e.target, this, e.anchor), e.props && (this.$set(e.props), W()));
2241
- }
2242
- static get observedAttributes() {
2243
- return [
2244
- "enableMinutiae",
2245
- "videoDimensions",
2246
- "noTabs",
2247
- "weightsPath",
2248
- "evaluatePhoto",
2249
- "showCaptureButton",
2250
- "showUnconformities",
2251
- "showConfigButton",
2252
- "showAutoCaptureButton",
2253
- "showCameraButton",
2254
- "showJustificationField",
2255
- "minEyeToEyeDist",
2256
- "showWatermark",
2257
- "videoOverlay",
2258
- "videoOverlayTransparency",
2259
- "faceDetectionSensitivity",
2260
- "hidden",
2261
- "livenessBlobSize",
2262
- "widgetInstance",
2263
- "play",
2264
- "capture"
2265
- ];
2266
- }
2267
- get enableMinutiae() {
2268
- return this.$$.ctx[43];
2269
- }
2270
- set enableMinutiae(e) {
2271
- this.$$set({ enableMinutiae: e }), W();
2272
- }
2273
- get videoDimensions() {
2274
- return this.$$.ctx[44];
2275
- }
2276
- set videoDimensions(e) {
2277
- this.$$set({ videoDimensions: e }), W();
2278
- }
2279
- get noTabs() {
2280
- return this.$$.ctx[45];
2281
- }
2282
- set noTabs(e) {
2283
- this.$$set({ noTabs: e }), W();
2284
- }
2285
- get weightsPath() {
2286
- return this.$$.ctx[46];
2287
- }
2288
- set weightsPath(e) {
2289
- this.$$set({ weightsPath: e }), W();
2290
- }
2291
- get evaluatePhoto() {
2292
- return this.$$.ctx[2];
2293
- }
2294
- set evaluatePhoto(e) {
2295
- this.$$set({ evaluatePhoto: e }), W();
2296
- }
2297
- get showCaptureButton() {
2298
- return this.$$.ctx[0];
2299
- }
2300
- set showCaptureButton(e) {
2301
- this.$$set({ showCaptureButton: e }), W();
2302
- }
2303
- get showUnconformities() {
2304
- return this.$$.ctx[3];
2305
- }
2306
- set showUnconformities(e) {
2307
- this.$$set({ showUnconformities: e }), W();
2308
- }
2309
- get showConfigButton() {
2310
- return this.$$.ctx[4];
2311
- }
2312
- set showConfigButton(e) {
2313
- this.$$set({ showConfigButton: e }), W();
2314
- }
2315
- get showAutoCaptureButton() {
2316
- return this.$$.ctx[5];
2317
- }
2318
- set showAutoCaptureButton(e) {
2319
- this.$$set({ showAutoCaptureButton: e }), W();
2320
- }
2321
- get showCameraButton() {
2322
- return this.$$.ctx[6];
2323
- }
2324
- set showCameraButton(e) {
2325
- this.$$set({ showCameraButton: e }), W();
2326
- }
2327
- get showJustificationField() {
2328
- return this.$$.ctx[7];
2329
- }
2330
- set showJustificationField(e) {
2331
- this.$$set({ showJustificationField: e }), W();
2332
- }
2333
- get minEyeToEyeDist() {
2334
- return this.$$.ctx[47];
2335
- }
2336
- set minEyeToEyeDist(e) {
2337
- this.$$set({ minEyeToEyeDist: e }), W();
2338
- }
2339
- get showWatermark() {
2340
- return this.$$.ctx[8];
2341
- }
2342
- set showWatermark(e) {
2343
- this.$$set({ showWatermark: e }), W();
2344
- }
2345
- get videoOverlay() {
2346
- return this.$$.ctx[9];
2347
- }
2348
- set videoOverlay(e) {
2349
- this.$$set({ videoOverlay: e }), W();
2350
- }
2351
- get videoOverlayTransparency() {
2352
- return this.$$.ctx[10];
2353
- }
2354
- set videoOverlayTransparency(e) {
2355
- this.$$set({ videoOverlayTransparency: e }), W();
2356
- }
2357
- get faceDetectionSensitivity() {
2358
- return this.$$.ctx[48];
2359
- }
2360
- set faceDetectionSensitivity(e) {
2361
- this.$$set({ faceDetectionSensitivity: e }), W();
2362
- }
2363
- get hidden() {
2364
- return this.$$.ctx[49];
2365
- }
2366
- set hidden(e) {
2367
- this.$$set({ hidden: e }), W();
2368
- }
2369
- get livenessBlobSize() {
2370
- return this.$$.ctx[11];
2371
- }
2372
- set livenessBlobSize(e) {
2373
- this.$$set({ livenessBlobSize: e }), W();
2374
- }
2375
- get widgetInstance() {
2376
- return this.$$.ctx[1];
2377
- }
2378
- set widgetInstance(e) {
2379
- this.$$set({ widgetInstance: e }), W();
2380
- }
2381
- get play() {
2382
- return this.$$.ctx[12];
2383
- }
2384
- get capture() {
2385
- return this.$$.ctx[13];
2386
- }
2387
- }
2388
- customElements.define("face-collector", en);
2389
- export {
2390
- en as default
2391
- };