bry-biometric-collector 2.2.23 → 2.2.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1887 +0,0 @@
1
- import { S as yi, q as Oi, r as jt, t as Ti, w as L, x as g, y as N, z as $, B as f, C as ye, D as c, E as he, G as W, H as D, I as S, J as at, $ as Ii, K as u, L as re, M as H, N as F, O as Ne, P as Fe, Q as X, R as qe, T as Z, U as Je, V as De, W as Ft, X as ca, Y as dt, Z as Ae, _ as ua, a0 as Se, a1 as Ke, a2 as Dt, a3 as $t, a4 as Mt, a5 as fa, a6 as ei, a7 as Le, a8 as et, a9 as ce, aa as Wt, ab as Bt, ac as Re, ad as da, ae as ha, af as ti, ag as ht, ah as Ut, ai as ma, aj as mt, ak as ii, al as ai, am as bt, an as li, ao as ba, ap as _a, aq as ga, ar as pa, as as va, at as Vt, au as wa, av as _t, aw as z, ax as gt, ay as pt, A as Kt, az as tt, aA as vt, aB as Ca, aC as Ea, d as wt, aD as si, aE as Ct, aF as Ht, aG as ka, aH as Ra, aI as ya, aJ as Oa, aK as He, aL as Ta, aM as oi, aN as yt, aO as Ia, aP as kt, aQ as Pi, aR as ni, j as Et, aS as Pa, aT as Aa, aU as Sa, aV as je, aW as it, aX as La, aY as Na, aZ as ri, a_ as Fa, a$ as Rt, b0 as Da } from "./main_af3a4af6_2.2.23.js";
2
- import { C as K, W as Ma, c as se, a as Wa, T as Ba, b as Ua } from "./WaterMark_99037cc5_2.2.23.js";
3
- function Va(a) {
4
- let e, t, l = (
5
- /*$_*/
6
- a[0]("buttons.startCapture") + ""
7
- ), s, o, h;
8
- return {
9
- c() {
10
- e = g("div"), t = g("button"), s = N(l), this.c = $, f(t, "class", ye() ? "ce-dui-btn ce-dui-btn-primary text-base text-xl absolute z-20 bottom-10" : "ce-dui-btn ce-dui-btn-primary text-base text-xl absolute z-20 bottom-2"), f(e, "class", "flex justify-center items-center");
11
- },
12
- m(n, r) {
13
- L(n, e, r), c(e, t), c(t, s), o || (h = he(
14
- t,
15
- "click",
16
- /*click_handler*/
17
- a[2]
18
- ), o = !0);
19
- },
20
- p(n, [r]) {
21
- r & /*$_*/
22
- 1 && l !== (l = /*$_*/
23
- n[0]("buttons.startCapture") + "") && W(s, l);
24
- },
25
- i: $,
26
- o: $,
27
- d(n) {
28
- n && D(e), o = !1, h();
29
- }
30
- };
31
- }
32
- function Ka(a, e, t) {
33
- let l, s;
34
- S(a, at, (n) => t(3, l = n)), S(a, Ii, (n) => t(0, s = n));
35
- function o() {
36
- u(at, l = !0, l);
37
- }
38
- return [s, o, () => o()];
39
- }
40
- class Ai extends yi {
41
- constructor(e) {
42
- super(), Oi(
43
- this,
44
- {
45
- target: this.shadowRoot,
46
- props: Ti(this.attributes),
47
- customElement: !0
48
- },
49
- Ka,
50
- Va,
51
- jt,
52
- {},
53
- null
54
- ), e && e.target && L(e.target, this, e.anchor);
55
- }
56
- }
57
- customElements.define("start-auto-capture-btn", Ai);
58
- function ci(a, e, t) {
59
- const l = a.slice();
60
- return l[113] = e[t], l;
61
- }
62
- function Ha(a) {
63
- let e;
64
- return {
65
- c() {
66
- e = g("idlive-face-capture"), e.hidden = !0, it(e, "mask_hidden", ""), it(e, "auto_capture_disabled", ""), it(e, "auto_close_disabled", ""), it(
67
- e,
68
- "device_id",
69
- /*$selectedVideoDeviceId*/
70
- a[21]
71
- );
72
- },
73
- m(t, l) {
74
- L(t, e, l), a[52](e);
75
- },
76
- p(t, l) {
77
- l[0] & /*$selectedVideoDeviceId*/
78
- 2097152 && it(
79
- e,
80
- "device_id",
81
- /*$selectedVideoDeviceId*/
82
- t[21]
83
- );
84
- },
85
- d(t) {
86
- t && D(e), a[52](null);
87
- }
88
- };
89
- }
90
- function ui(a) {
91
- let e, t, l;
92
- return {
93
- c() {
94
- e = g("video"), f(e, "id", "bry-cc-camera-video-tag"), f(e, "class", "absolute -z-10"), e.playsInline = !0, e.muted = !0, e.autoplay = !0;
95
- },
96
- m(s, o) {
97
- L(s, e, o), a[53](e), t || (l = [
98
- he(
99
- e,
100
- "canplay",
101
- /*canplay_handler*/
102
- a[54]
103
- ),
104
- he(
105
- e,
106
- "play",
107
- /*play*/
108
- a[8],
109
- { once: !0 }
110
- )
111
- ], t = !0);
112
- },
113
- p: $,
114
- d(s) {
115
- s && D(e), a[53](null), t = !1, yt(l);
116
- }
117
- };
118
- }
119
- function fi(a) {
120
- let e, t;
121
- return e = new Ia({}), {
122
- c() {
123
- Ne(e.$$.fragment);
124
- },
125
- m(l, s) {
126
- Fe(e, l, s), t = !0;
127
- },
128
- i(l) {
129
- t || (X(e.$$.fragment, l), t = !0);
130
- },
131
- o(l) {
132
- Z(e.$$.fragment, l), t = !1;
133
- },
134
- d(l) {
135
- De(e, l);
136
- }
137
- };
138
- }
139
- function di(a) {
140
- let e, t;
141
- return e = new Wa({}), {
142
- c() {
143
- Ne(e.$$.fragment);
144
- },
145
- m(l, s) {
146
- Fe(e, l, s), t = !0;
147
- },
148
- i(l) {
149
- t || (X(e.$$.fragment, l), t = !0);
150
- },
151
- o(l) {
152
- Z(e.$$.fragment, l), t = !1;
153
- },
154
- d(l) {
155
- De(e, l);
156
- }
157
- };
158
- }
159
- function hi(a) {
160
- let e, t;
161
- return e = new Ai({}), {
162
- c() {
163
- Ne(e.$$.fragment);
164
- },
165
- m(l, s) {
166
- Fe(e, l, s), t = !0;
167
- },
168
- i(l) {
169
- t || (X(e.$$.fragment, l), t = !0);
170
- },
171
- o(l) {
172
- Z(e.$$.fragment, l), t = !1;
173
- },
174
- d(l) {
175
- De(e, l);
176
- }
177
- };
178
- }
179
- function mi(a) {
180
- let e, t = (
181
- /*$_*/
182
- a[32]("faceCollector.stayStill") + ""
183
- ), l;
184
- return {
185
- c() {
186
- e = g("span"), l = N(t), f(e, "class", "absolute left-1/2 -translate-x-1/2 ce-dui-badge ce-dui-badge-lg h-[2em] text-2xl xl:text-base w-[12.1em] " + (ye() ? "top-[10%]" : "top-[3%]"));
187
- },
188
- m(s, o) {
189
- L(s, e, o), c(e, l);
190
- },
191
- p(s, o) {
192
- o[1] & /*$_*/
193
- 2 && t !== (t = /*$_*/
194
- s[32]("faceCollector.stayStill") + "") && W(l, t);
195
- },
196
- d(s) {
197
- s && D(e);
198
- }
199
- };
200
- }
201
- function bi(a) {
202
- let e, t = (
203
- /*$_*/
204
- a[32](`${/*$faceValidationAlert*/
205
- a[26]}`) + ""
206
- ), l;
207
- return {
208
- c() {
209
- e = g("span"), l = N(t), f(e, "class", "absolute left-1/2 -translate-x-1/2 ce-dui-badge ce-dui-badge-lg h-[2em] text-2xl xl:text-base w-[12.1em] " + (ye() ? "top-[10%]" : "top-[3%]"));
210
- },
211
- m(s, o) {
212
- L(s, e, o), c(e, l);
213
- },
214
- p(s, o) {
215
- o[0] & /*$faceValidationAlert*/
216
- 67108864 | o[1] & /*$_*/
217
- 2 && t !== (t = /*$_*/
218
- s[32](`${/*$faceValidationAlert*/
219
- s[26]}`) + "") && W(l, t);
220
- },
221
- d(s) {
222
- s && D(e);
223
- }
224
- };
225
- }
226
- function _i(a) {
227
- let e, t, l, s, o;
228
- function h(d, b) {
229
- return (
230
- /*$isLoading*/
231
- d[37] ? qa : ja
232
- );
233
- }
234
- let n = h(a), r = n(a);
235
- return {
236
- c() {
237
- e = g("slot"), t = g("div"), l = g("img"), o = F(), r.c(), kt(l.src, s = Pi) || f(l, "src", s), f(l, "alt", "loading gif"), f(l, "class", "m-auto h-[10em] lg:h-[12em]"), f(t, "class", "translate-y-1/3 md:translate-y-1/4 xl:translate-y-1/2"), f(e, "name", "obtaining-photo-gif"), f(e, "class", "block h-[17em] lg:h-[21.6em] xl:h-[30em]");
238
- },
239
- m(d, b) {
240
- L(d, e, b), c(e, t), c(t, l), c(t, o), r.m(t, null);
241
- },
242
- p(d, b) {
243
- n === (n = h(d)) && r ? r.p(d, b) : (r.d(1), r = n(d), r && (r.c(), r.m(t, null)));
244
- },
245
- d(d) {
246
- d && D(e), r.d();
247
- }
248
- };
249
- }
250
- function ja(a) {
251
- let e, t = (
252
- /*$_*/
253
- a[32]("faceCollector.obtainingPicture") + ""
254
- ), l;
255
- return {
256
- c() {
257
- e = g("span"), l = N(t), f(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
258
- },
259
- m(s, o) {
260
- L(s, e, o), c(e, l);
261
- },
262
- p(s, o) {
263
- o[1] & /*$_*/
264
- 2 && t !== (t = /*$_*/
265
- s[32]("faceCollector.obtainingPicture") + "") && W(l, t);
266
- },
267
- d(s) {
268
- s && D(e);
269
- }
270
- };
271
- }
272
- function qa(a) {
273
- let e;
274
- return {
275
- c() {
276
- e = g("span"), e.textContent = "Obtaining photo...", f(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
277
- },
278
- m(t, l) {
279
- L(t, e, l);
280
- },
281
- p: $,
282
- d(t) {
283
- t && D(e);
284
- }
285
- };
286
- }
287
- function gi(a) {
288
- let e, t, l, s, o;
289
- function h(d, b) {
290
- return (
291
- /*$isLoading*/
292
- d[37] ? za : Ja
293
- );
294
- }
295
- let n = h(a), r = n(a);
296
- return {
297
- c() {
298
- e = g("slot"), t = g("div"), l = g("img"), o = F(), r.c(), kt(l.src, s = Pi) || f(l, "src", s), f(l, "alt", "loading gif"), f(l, "class", "m-auto h-[10em] lg:h-[12em]"), f(t, "class", "translate-y-1/3 md:translate-y-1/4 xl:translate-y-1/2"), f(e, "name", "loading-camera-gif"), f(e, "class", "block h-[17em] lg:h-[21.6em] xl:h-[30em]");
299
- },
300
- m(d, b) {
301
- L(d, e, b), c(e, t), c(t, l), c(t, o), r.m(t, null);
302
- },
303
- p(d, b) {
304
- n === (n = h(d)) && r ? r.p(d, b) : (r.d(1), r = n(d), r && (r.c(), r.m(t, null)));
305
- },
306
- d(d) {
307
- d && D(e), r.d();
308
- }
309
- };
310
- }
311
- function Ja(a) {
312
- let e, t = (
313
- /*$_*/
314
- a[32]("faceCollector.initiatingCamera") + ""
315
- ), l;
316
- return {
317
- c() {
318
- e = g("span"), l = N(t), f(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
319
- },
320
- m(s, o) {
321
- L(s, e, o), c(e, l);
322
- },
323
- p(s, o) {
324
- o[1] & /*$_*/
325
- 2 && t !== (t = /*$_*/
326
- s[32]("faceCollector.initiatingCamera") + "") && W(l, t);
327
- },
328
- d(s) {
329
- s && D(e);
330
- }
331
- };
332
- }
333
- function za(a) {
334
- let e;
335
- return {
336
- c() {
337
- e = g("span"), e.textContent = "Loading camera...", f(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
338
- },
339
- m(t, l) {
340
- L(t, e, l);
341
- },
342
- p: $,
343
- d(t) {
344
- t && D(e);
345
- }
346
- };
347
- }
348
- function Xa(a) {
349
- let e, t, l = (
350
- /*$_*/
351
- a[32]("faceCollector.finish") + ""
352
- ), s, o, h, n, r = (
353
- /*$_*/
354
- a[32]("faceCollector.retakePhoto") + ""
355
- ), d, b, _;
356
- return {
357
- c() {
358
- e = g("div"), t = g("button"), s = N(l), h = F(), n = g("button"), d = N(r), t.disabled = o = /*$justification*/
359
- a[30].length === 0, f(t, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink"), f(n, "id", "bry-cc-retake-button"), f(n, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink"), f(e, "class", "ce-dui-btn-group flex");
360
- },
361
- m(C, m) {
362
- L(C, e, m), c(e, t), c(t, s), c(e, h), c(e, n), c(n, d), b || (_ = [
363
- he(
364
- t,
365
- "click",
366
- /*click_handler*/
367
- a[58]
368
- ),
369
- he(
370
- n,
371
- "click",
372
- /*click_handler_1*/
373
- a[59]
374
- )
375
- ], b = !0);
376
- },
377
- p(C, m) {
378
- m[1] & /*$_*/
379
- 2 && l !== (l = /*$_*/
380
- C[32]("faceCollector.finish") + "") && W(s, l), m[0] & /*$justification*/
381
- 1073741824 && o !== (o = /*$justification*/
382
- C[30].length === 0) && (t.disabled = o), m[1] & /*$_*/
383
- 2 && r !== (r = /*$_*/
384
- C[32]("faceCollector.retakePhoto") + "") && W(d, r);
385
- },
386
- i: $,
387
- o: $,
388
- d(C) {
389
- C && D(e), b = !1, yt(_);
390
- }
391
- };
392
- }
393
- function Qa(a) {
394
- let e, t;
395
- return e = new Ba({
396
- props: {
397
- id: "bry-cc-capture-btn",
398
- disabled: !/*$faceFound*/
399
- a[36] && /*$enableFaceApi*/
400
- a[34] || !/*$ready*/
401
- a[35] && !/*$enableFaceApi*/
402
- a[34],
403
- hidden: !/*showCaptureButton*/
404
- a[2] || /*$cameraStatusStore*/
405
- a[20] !== K.OK || H() && /*idrndLoading*/
406
- (a[16] || /*idrndClosed*/
407
- a[17] || /*waitingIdrndCaptureEvent*/
408
- a[18]),
409
- handler: (
410
- /*capture*/
411
- a[42]
412
- )
413
- }
414
- }), {
415
- c() {
416
- Ne(e.$$.fragment);
417
- },
418
- m(l, s) {
419
- Fe(e, l, s), t = !0;
420
- },
421
- p(l, s) {
422
- const o = {};
423
- s[1] & /*$faceFound, $enableFaceApi, $ready*/
424
- 56 && (o.disabled = !/*$faceFound*/
425
- l[36] && /*$enableFaceApi*/
426
- l[34] || !/*$ready*/
427
- l[35] && !/*$enableFaceApi*/
428
- l[34]), s[0] & /*showCaptureButton, $cameraStatusStore, idrndLoading, idrndClosed, waitingIdrndCaptureEvent*/
429
- 1507332 && (o.hidden = !/*showCaptureButton*/
430
- l[2] || /*$cameraStatusStore*/
431
- l[20] !== K.OK || H() && /*idrndLoading*/
432
- (l[16] || /*idrndClosed*/
433
- l[17] || /*waitingIdrndCaptureEvent*/
434
- l[18])), e.$set(o);
435
- },
436
- i(l) {
437
- t || (X(e.$$.fragment, l), t = !0);
438
- },
439
- o(l) {
440
- Z(e.$$.fragment, l), t = !1;
441
- },
442
- d(l) {
443
- De(e, l);
444
- }
445
- };
446
- }
447
- function Ga(a) {
448
- let e, t;
449
- return e = new Ua({ props: { handler: (
450
- /*func*/
451
- a[68]
452
- ) } }), {
453
- c() {
454
- Ne(e.$$.fragment);
455
- },
456
- m(l, s) {
457
- Fe(e, l, s), t = !0;
458
- },
459
- p: $,
460
- i(l) {
461
- t || (X(e.$$.fragment, l), t = !0);
462
- },
463
- o(l) {
464
- Z(e.$$.fragment, l), t = !1;
465
- },
466
- d(l) {
467
- De(e, l);
468
- }
469
- };
470
- }
471
- function Ya(a) {
472
- let e, t, l, s, o, h, n, r, d;
473
- const b = [
474
- tl,
475
- el,
476
- $a,
477
- xa,
478
- Za
479
- ], _ = [];
480
- function C(m, E) {
481
- return (
482
- /*$captured*/
483
- m[23] ? (
484
- /*$unconformitiesStore*/
485
- m[27].isLoading ? 1 : (
486
- /*$requestResult*/
487
- m[28] !== z.OK ? 2 : (
488
- /*$saved*/
489
- m[29] ? 4 : 3
490
- )
491
- )
492
- ) : 0
493
- );
494
- }
495
- return h = C(a), n = _[h] = b[h](a), {
496
- c() {
497
- e = g("div"), t = g("img"), o = F(), n.c(), f(t, "class", "m-auto col-start-1 col-end-1 max-h-[23.2em]"), kt(t.src, l = /*$dataTypePrefix*/
498
- a[33] + "," + /*$image*/
499
- a[31]) || f(t, "src", l), t.hidden = s = !/*$captured*/
500
- a[23] || !/*$showFaceWhileValidating*/
501
- a[38] && /*$unconformitiesStore*/
502
- a[27].isLoading, f(t, "alt", ""), f(e, "class", r = "grid-cols-1 grid-rows-2 sm:grid-cols-2 sm:grid-rows-1 gap-[.5em] " + (!/*$showFaceWhileValidating*/
503
- a[38] && /*$unconformitiesStore*/
504
- a[27].isLoading ? "absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible" : "grid m-[1em] overflow-hidden"));
505
- },
506
- m(m, E) {
507
- L(m, e, E), c(e, t), c(e, o), _[h].m(e, null), d = !0;
508
- },
509
- p(m, E) {
510
- (!d || E[1] & /*$dataTypePrefix, $image*/
511
- 5 && !kt(t.src, l = /*$dataTypePrefix*/
512
- m[33] + "," + /*$image*/
513
- m[31])) && f(t, "src", l), (!d || E[0] & /*$captured, $unconformitiesStore*/
514
- 142606336 | E[1] & /*$showFaceWhileValidating*/
515
- 128 && s !== (s = !/*$captured*/
516
- m[23] || !/*$showFaceWhileValidating*/
517
- m[38] && /*$unconformitiesStore*/
518
- m[27].isLoading)) && (t.hidden = s);
519
- let p = h;
520
- h = C(m), h === p ? _[h].p(m, E) : (qe(), Z(_[p], 1, 1, () => {
521
- _[p] = null;
522
- }), Je(), n = _[h], n ? n.p(m, E) : (n = _[h] = b[h](m), n.c()), X(n, 1), n.m(e, null)), (!d || E[0] & /*$unconformitiesStore*/
523
- 134217728 | E[1] & /*$showFaceWhileValidating*/
524
- 128 && r !== (r = "grid-cols-1 grid-rows-2 sm:grid-cols-2 sm:grid-rows-1 gap-[.5em] " + (!/*$showFaceWhileValidating*/
525
- m[38] && /*$unconformitiesStore*/
526
- m[27].isLoading ? "absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible" : "grid m-[1em] overflow-hidden"))) && f(e, "class", r);
527
- },
528
- i(m) {
529
- d || (X(n), d = !0);
530
- },
531
- o(m) {
532
- Z(n), d = !1;
533
- },
534
- d(m) {
535
- m && D(e), _[h].d();
536
- }
537
- };
538
- }
539
- function Za(a) {
540
- let e, t, l = (
541
- /*$_*/
542
- a[32]("faceCollector.captured") + ""
543
- ), s, o, h, n, r, d = (
544
- /*$_*/
545
- a[32]("faceCollector.retakePhoto") + ""
546
- ), b, _, C = Et(La).faceStrategy !== Na.DISABLED, m, E, p, w = (
547
- /*$unconformitiesStore*/
548
- a[27].unconformities.length !== 0 && pi(a)
549
- ), I = C && il();
550
- return {
551
- c() {
552
- e = g("div"), t = g("h1"), s = N(l), o = F(), w && w.c(), h = F(), n = g("div"), r = g("button"), b = N(d), _ = F(), I && I.c(), f(t, "class", "text-3xl font-bold pb-[1em] transition-opacity"), f(r, "id", "bry-cc-retake-button"), f(r, "class", "ce-dui-btn ce-dui-btn-block flex-shrink text-base"), f(n, "class", "flex flex-row"), ri(n, "ce-dui-btn-group", !/*$exportButtonDisabled*/
553
- a[39]);
554
- },
555
- m(T, M) {
556
- L(T, e, M), c(e, t), c(t, s), c(e, o), w && w.m(e, null), c(e, h), c(e, n), c(n, r), c(r, b), c(n, _), I && I.m(n, null), m = !0, E || (p = he(
557
- r,
558
- "click",
559
- /*click_handler_6*/
560
- a[67]
561
- ), E = !0);
562
- },
563
- p(T, M) {
564
- (!m || M[1] & /*$_*/
565
- 2) && l !== (l = /*$_*/
566
- T[32]("faceCollector.captured") + "") && W(s, l), /*$unconformitiesStore*/
567
- T[27].unconformities.length !== 0 ? w ? w.p(T, M) : (w = pi(T), w.c(), w.m(e, h)) : w && (w.d(1), w = null), (!m || M[1] & /*$_*/
568
- 2) && d !== (d = /*$_*/
569
- T[32]("faceCollector.retakePhoto") + "") && W(b, d), (!m || M[1] & /*$exportButtonDisabled*/
570
- 256) && ri(n, "ce-dui-btn-group", !/*$exportButtonDisabled*/
571
- T[39]);
572
- },
573
- i(T) {
574
- m || (X(I), m = !0);
575
- },
576
- o(T) {
577
- Z(I), m = !1;
578
- },
579
- d(T) {
580
- T && D(e), w && w.d(), I && I.d(), E = !1, p();
581
- }
582
- };
583
- }
584
- function xa(a) {
585
- let e, t, l = (
586
- /*evaluatePhoto*/
587
- (a[1] ? (
588
- /*$_*/
589
- a[32]("faceCollector.unconformities")
590
- ) : (
591
- /*$_*/
592
- a[32]("faceCollector.previewCapture")
593
- )) + ""
594
- ), s, o, h, n, r, d, b = (
595
- /*$unconformitiesStore*/
596
- a[27].unconformities
597
- ), _ = [];
598
- for (let p = 0; p < b.length; p += 1)
599
- _[p] = vi(ci(a, b, p));
600
- let C = (
601
- /*evaluatePhoto*/
602
- a[1] && /*$unconformitiesStore*/
603
- a[27].unconformities.length == 0 && wi(a)
604
- ), m = (
605
- /*showJustificationField*/
606
- a[7] && Ci(a)
607
- ), E = (
608
- /*$captured*/
609
- a[23] && Ei(a)
610
- );
611
- return {
612
- c() {
613
- e = g("div"), t = g("h1"), s = N(l), o = F(), h = g("div");
614
- for (let p = 0; p < _.length; p += 1)
615
- _[p].c();
616
- n = F(), C && C.c(), r = F(), m && m.c(), d = F(), E && E.c(), f(t, "class", "text-3xl font-bold transition-opacity"), f(h, "class", "flex flex-wrap"), f(e, "class", "flex flex-col justify-between");
617
- },
618
- m(p, w) {
619
- L(p, e, w), c(e, t), c(t, s), c(e, o), c(e, h);
620
- for (let I = 0; I < _.length; I += 1)
621
- _[I] && _[I].m(h, null);
622
- c(h, n), C && C.m(h, null), c(e, r), m && m.m(e, null), c(e, d), E && E.m(e, null);
623
- },
624
- p(p, w) {
625
- if (w[0] & /*evaluatePhoto*/
626
- 2 | w[1] & /*$_*/
627
- 2 && l !== (l = /*evaluatePhoto*/
628
- (p[1] ? (
629
- /*$_*/
630
- p[32]("faceCollector.unconformities")
631
- ) : (
632
- /*$_*/
633
- p[32]("faceCollector.previewCapture")
634
- )) + "") && W(s, l), w[0] & /*$unconformitiesStore*/
635
- 134217728) {
636
- b = /*$unconformitiesStore*/
637
- p[27].unconformities;
638
- let I;
639
- for (I = 0; I < b.length; I += 1) {
640
- const T = ci(p, b, I);
641
- _[I] ? _[I].p(T, w) : (_[I] = vi(T), _[I].c(), _[I].m(h, n));
642
- }
643
- for (; I < _.length; I += 1)
644
- _[I].d(1);
645
- _.length = b.length;
646
- }
647
- /*evaluatePhoto*/
648
- p[1] && /*$unconformitiesStore*/
649
- p[27].unconformities.length == 0 ? C ? C.p(p, w) : (C = wi(p), C.c(), C.m(h, null)) : C && (C.d(1), C = null), /*showJustificationField*/
650
- p[7] ? m ? m.p(p, w) : (m = Ci(p), m.c(), m.m(e, d)) : m && (m.d(1), m = null), /*$captured*/
651
- p[23] ? E ? E.p(p, w) : (E = Ei(p), E.c(), E.m(e, null)) : E && (E.d(1), E = null);
652
- },
653
- i: $,
654
- o: $,
655
- d(p) {
656
- p && D(e), Fa(_, p), C && C.d(), m && m.d(), E && E.d();
657
- }
658
- };
659
- }
660
- function $a(a) {
661
- let e, t, l, s, o = (
662
- /*$_*/
663
- a[32]("faceCollector.finish") + ""
664
- ), h, n, r, d = (
665
- /*$_*/
666
- a[32]("faceCollector.retakePhoto") + ""
667
- ), b, _, C;
668
- function m(w, I) {
669
- return (
670
- /*$requestResult*/
671
- w[28] === z.LIVENESS_DETECTION_FAILURE || /*$requestResult*/
672
- w[28] === z.UNKNOWN_LIVENESS_ERROR ? rl : (
673
- /*$requestResult*/
674
- w[28] === z.LOW_LIVENESS_SCORE ? nl : (
675
- /*$requestResult*/
676
- w[28] === z.TEMPLATE_EXTRACTION_ERROR || /*$requestResult*/
677
- w[28] === z.UNKNOWN_TEMPLATE_EXTRACTION_ERROR ? ol : (
678
- /*$requestResult*/
679
- w[28] === z.UNABLE_TO_COMMUNICATE_WITH_TEMPLATE_EXTRACTION_SERVICE ? sl : (
680
- /*$requestResult*/
681
- w[28] === z.LIVENESS_EVALUATION_ERROR ? ll : al
682
- )
683
- )
684
- )
685
- )
686
- );
687
- }
688
- let E = m(a), p = E(a);
689
- return {
690
- c() {
691
- e = g("div"), p.c(), t = F(), l = g("div"), s = g("button"), h = N(o), n = F(), r = g("button"), b = N(d), s.disabled = !0, f(s, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink"), f(r, "id", "bry-cc-retake-button"), f(r, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink"), f(l, "class", "ce-dui-btn-group flex"), f(e, "class", "flex flex-col justify-between");
692
- },
693
- m(w, I) {
694
- L(w, e, I), p.m(e, null), c(e, t), c(e, l), c(l, s), c(s, h), c(l, n), c(l, r), c(r, b), _ || (C = [
695
- he(
696
- s,
697
- "click",
698
- /*click_handler_2*/
699
- a[61]
700
- ),
701
- he(
702
- r,
703
- "click",
704
- /*click_handler_3*/
705
- a[62]
706
- )
707
- ], _ = !0);
708
- },
709
- p(w, I) {
710
- E === (E = m(w)) && p ? p.p(w, I) : (p.d(1), p = E(w), p && (p.c(), p.m(e, t))), I[1] & /*$_*/
711
- 2 && o !== (o = /*$_*/
712
- w[32]("faceCollector.finish") + "") && W(h, o), I[1] & /*$_*/
713
- 2 && d !== (d = /*$_*/
714
- w[32]("faceCollector.retakePhoto") + "") && W(b, d);
715
- },
716
- i: $,
717
- o: $,
718
- d(w) {
719
- w && D(e), p.d(), _ = !1, yt(C);
720
- }
721
- };
722
- }
723
- function el(a) {
724
- let e, t, l = (
725
- /*$_*/
726
- a[32]("faceCollector.validating") + ""
727
- ), s, o, h;
728
- return {
729
- c() {
730
- e = g("div"), t = g("h1"), s = N(l), o = F(), h = g("div"), f(t, "class", "inline-block text-3xl font-bold pb-[1em] transition-opacity"), f(h, "class", "ml-6 inline-block dot-typing"), f(e, "class", "min-w-[200px]");
731
- },
732
- m(n, r) {
733
- L(n, e, r), c(e, t), c(t, s), c(e, o), c(e, h);
734
- },
735
- p(n, r) {
736
- r[1] & /*$_*/
737
- 2 && l !== (l = /*$_*/
738
- n[32]("faceCollector.validating") + "") && W(s, l);
739
- },
740
- i: $,
741
- o: $,
742
- d(n) {
743
- n && D(e);
744
- }
745
- };
746
- }
747
- function tl(a) {
748
- let e;
749
- return {
750
- c() {
751
- e = g("div"), f(e, "class", "");
752
- },
753
- m(t, l) {
754
- L(t, e, l);
755
- },
756
- p: $,
757
- i: $,
758
- o: $,
759
- d(t) {
760
- t && D(e);
761
- }
762
- };
763
- }
764
- function pi(a) {
765
- let e, t, l = (
766
- /*$_*/
767
- a[32]("faceCollector.justification") + ""
768
- ), s, o, h, n, r;
769
- return {
770
- c() {
771
- e = g("label"), t = g("span"), s = N(l), o = F(), h = g("textarea"), f(t, "class", "ce-dui-label-text text-base"), f(e, "class", "ce-dui-label"), f(e, "for", "justification"), f(h, "contenteditable", ""), f(h, "id", "justification"), f(h, "class", "ce-dui-textarea ce-dui-textarea-bordered textarea-ghost h-[6em] w-full text-base");
772
- },
773
- m(d, b) {
774
- L(d, e, b), c(e, t), c(t, s), L(d, o, b), L(d, h, b), Rt(
775
- h,
776
- /*$justification*/
777
- a[30]
778
- ), n || (r = he(
779
- h,
780
- "input",
781
- /*textarea_input_handler_1*/
782
- a[66]
783
- ), n = !0);
784
- },
785
- p(d, b) {
786
- b[1] & /*$_*/
787
- 2 && l !== (l = /*$_*/
788
- d[32]("faceCollector.justification") + "") && W(s, l), b[0] & /*$justification*/
789
- 1073741824 && Rt(
790
- h,
791
- /*$justification*/
792
- d[30]
793
- );
794
- },
795
- d(d) {
796
- d && D(e), d && D(o), d && D(h), n = !1, r();
797
- }
798
- };
799
- }
800
- function il(a) {
801
- let e, t;
802
- return e = new Da({
803
- props: { cssClass: "ce-dui-btn-block flex-shrink" }
804
- }), {
805
- c() {
806
- Ne(e.$$.fragment);
807
- },
808
- m(l, s) {
809
- Fe(e, l, s), t = !0;
810
- },
811
- i(l) {
812
- t || (X(e.$$.fragment, l), t = !0);
813
- },
814
- o(l) {
815
- Z(e.$$.fragment, l), t = !1;
816
- },
817
- d(l) {
818
- De(e, l);
819
- }
820
- };
821
- }
822
- function vi(a) {
823
- let e, t = (
824
- /*unconformity*/
825
- a[113] + ""
826
- ), l;
827
- return {
828
- c() {
829
- e = g("div"), l = N(t), f(e, "class", "ce-dui-badge ce-dui-badge-lg h-[2em] ce-dui-badge-error text-xl pb-[.25em] m-[.5em]");
830
- },
831
- m(s, o) {
832
- L(s, e, o), c(e, l);
833
- },
834
- p(s, o) {
835
- o[0] & /*$unconformitiesStore*/
836
- 134217728 && t !== (t = /*unconformity*/
837
- s[113] + "") && W(l, t);
838
- },
839
- d(s) {
840
- s && D(e);
841
- }
842
- };
843
- }
844
- function wi(a) {
845
- let e, t = (
846
- /*$_*/
847
- a[32]("faceCollector.noNonconformity") + ""
848
- ), l;
849
- return {
850
- c() {
851
- e = g("div"), l = N(t), f(e, "class", "ce-dui-badge ce-dui-badge-lg h-[2em] ce-dui-badge-info text-xl pb-[.25em] m-[.5em]");
852
- },
853
- m(s, o) {
854
- L(s, e, o), c(e, l);
855
- },
856
- p(s, o) {
857
- o[1] & /*$_*/
858
- 2 && t !== (t = /*$_*/
859
- s[32]("faceCollector.noNonconformity") + "") && W(l, t);
860
- },
861
- d(s) {
862
- s && D(e);
863
- }
864
- };
865
- }
866
- function Ci(a) {
867
- let e, t, l, s = (
868
- /*$_*/
869
- a[32]("faceCollector.provideAReasonForTheLowQualityCapture") + ""
870
- ), o, h, n, r, d, b, _, C, m = (
871
- /*$_*/
872
- a[32]("faceCollector.thisInformationIsRequired") + ""
873
- ), E, p, w, I;
874
- return {
875
- c() {
876
- e = g("div"), t = g("label"), l = g("span"), o = N(s), h = F(), n = g("textarea"), d = F(), b = g("label"), _ = g("span"), C = N("("), E = N(m), p = N(")"), f(l, "class", "ce-dui-label-text text-base"), f(t, "class", "ce-dui-label"), f(t, "for", "justification"), f(n, "contenteditable", ""), f(n, "id", "justification"), f(n, "class", "ce-dui-textarea ce-dui-textarea-bordered h-[6em] text-base"), f(n, "placeholder", r = /*$_*/
877
- a[32]("faceCollector.yourJustification")), f(_, "class", "ce-dui-label-text-alt text-base"), f(b, "class", "ce-dui-label"), f(b, "for", "justification"), f(e, "class", "ce-dui-form-control");
878
- },
879
- m(T, M) {
880
- L(T, e, M), c(e, t), c(t, l), c(l, o), c(e, h), c(e, n), Rt(
881
- n,
882
- /*$justification*/
883
- a[30]
884
- ), c(e, d), c(e, b), c(b, _), c(_, C), c(_, E), c(_, p), w || (I = he(
885
- n,
886
- "input",
887
- /*textarea_input_handler*/
888
- a[63]
889
- ), w = !0);
890
- },
891
- p(T, M) {
892
- M[1] & /*$_*/
893
- 2 && s !== (s = /*$_*/
894
- T[32]("faceCollector.provideAReasonForTheLowQualityCapture") + "") && W(o, s), M[1] & /*$_*/
895
- 2 && r !== (r = /*$_*/
896
- T[32]("faceCollector.yourJustification")) && f(n, "placeholder", r), M[0] & /*$justification*/
897
- 1073741824 && Rt(
898
- n,
899
- /*$justification*/
900
- T[30]
901
- ), M[1] & /*$_*/
902
- 2 && m !== (m = /*$_*/
903
- T[32]("faceCollector.thisInformationIsRequired") + "") && W(E, m);
904
- },
905
- d(T) {
906
- T && D(e), w = !1, I();
907
- }
908
- };
909
- }
910
- function Ei(a) {
911
- let e, t, l = (
912
- /*$_*/
913
- a[32]("faceCollector.finish") + ""
914
- ), s, o, h, n, r = (
915
- /*$_*/
916
- a[32]("faceCollector.retakePhoto") + ""
917
- ), d, b, _;
918
- return {
919
- c() {
920
- e = g("div"), t = g("button"), s = N(l), h = F(), n = g("button"), d = N(r), t.disabled = o = /*$justification*/
921
- a[30].length === 0 && /*showJustificationField*/
922
- a[7], f(t, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink text-base"), f(n, "id", "bry-cc-retake-button"), f(n, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink text-base"), f(e, "class", "ce-dui-btn-group flex");
923
- },
924
- m(C, m) {
925
- L(C, e, m), c(e, t), c(t, s), c(e, h), c(e, n), c(n, d), b || (_ = [
926
- he(
927
- t,
928
- "click",
929
- /*click_handler_4*/
930
- a[64]
931
- ),
932
- he(
933
- n,
934
- "click",
935
- /*click_handler_5*/
936
- a[65]
937
- )
938
- ], b = !0);
939
- },
940
- p(C, m) {
941
- m[1] & /*$_*/
942
- 2 && l !== (l = /*$_*/
943
- C[32]("faceCollector.finish") + "") && W(s, l), m[0] & /*$justification, showJustificationField*/
944
- 1073741952 && o !== (o = /*$justification*/
945
- C[30].length === 0 && /*showJustificationField*/
946
- C[7]) && (t.disabled = o), m[1] & /*$_*/
947
- 2 && r !== (r = /*$_*/
948
- C[32]("faceCollector.retakePhoto") + "") && W(d, r);
949
- },
950
- d(C) {
951
- C && D(e), b = !1, yt(_);
952
- }
953
- };
954
- }
955
- function al(a) {
956
- let e, t = (
957
- /*$_*/
958
- a[32]("faceCollector.everythingOk") + ""
959
- ), l;
960
- return {
961
- c() {
962
- e = g("h1"), l = N(t), f(e, "class", "text-3xl font-bold pb-[1em] transition-opacity");
963
- },
964
- m(s, o) {
965
- L(s, e, o), c(e, l);
966
- },
967
- p(s, o) {
968
- o[1] & /*$_*/
969
- 2 && t !== (t = /*$_*/
970
- s[32]("faceCollector.everythingOk") + "") && W(l, t);
971
- },
972
- d(s) {
973
- s && D(e);
974
- }
975
- };
976
- }
977
- function ll(a) {
978
- let e, t = (
979
- /*$_*/
980
- a[32]("liveness.error.evaluationError") + ""
981
- ), l;
982
- return {
983
- c() {
984
- e = g("h1"), l = N(t), f(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
985
- },
986
- m(s, o) {
987
- L(s, e, o), c(e, l);
988
- },
989
- p(s, o) {
990
- o[1] & /*$_*/
991
- 2 && t !== (t = /*$_*/
992
- s[32]("liveness.error.evaluationError") + "") && W(l, t);
993
- },
994
- d(s) {
995
- s && D(e);
996
- }
997
- };
998
- }
999
- function sl(a) {
1000
- let e, t = (
1001
- /*$_*/
1002
- a[32]("faceCollector.unableToCompleteRequest") + ""
1003
- ), l;
1004
- return {
1005
- c() {
1006
- e = g("h1"), l = N(t), f(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1007
- },
1008
- m(s, o) {
1009
- L(s, e, o), c(e, l);
1010
- },
1011
- p(s, o) {
1012
- o[1] & /*$_*/
1013
- 2 && t !== (t = /*$_*/
1014
- s[32]("faceCollector.unableToCompleteRequest") + "") && W(l, t);
1015
- },
1016
- d(s) {
1017
- s && D(e);
1018
- }
1019
- };
1020
- }
1021
- function ol(a) {
1022
- let e, t = (
1023
- /*$_*/
1024
- a[32]("faceCollector.lowQualityCapture") + ""
1025
- ), l;
1026
- return {
1027
- c() {
1028
- e = g("h1"), l = N(t), f(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1029
- },
1030
- m(s, o) {
1031
- L(s, e, o), c(e, l);
1032
- },
1033
- p(s, o) {
1034
- o[1] & /*$_*/
1035
- 2 && t !== (t = /*$_*/
1036
- s[32]("faceCollector.lowQualityCapture") + "") && W(l, t);
1037
- },
1038
- d(s) {
1039
- s && D(e);
1040
- }
1041
- };
1042
- }
1043
- function nl(a) {
1044
- let e, t = (
1045
- /*$_*/
1046
- a[32]("liveness.error.error") + ""
1047
- ), l, s, o = (
1048
- /*$_*/
1049
- a[32]("faceCollector.unaliveCapture") + ""
1050
- ), h;
1051
- return {
1052
- c() {
1053
- e = g("h1"), l = N(t), s = N(": "), h = N(o), f(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1054
- },
1055
- m(n, r) {
1056
- L(n, e, r), c(e, l), c(e, s), c(e, h);
1057
- },
1058
- p(n, r) {
1059
- r[1] & /*$_*/
1060
- 2 && t !== (t = /*$_*/
1061
- n[32]("liveness.error.error") + "") && W(l, t), r[1] & /*$_*/
1062
- 2 && o !== (o = /*$_*/
1063
- n[32]("faceCollector.unaliveCapture") + "") && W(h, o);
1064
- },
1065
- d(n) {
1066
- n && D(e);
1067
- }
1068
- };
1069
- }
1070
- function rl(a) {
1071
- let e, t = (
1072
- /*$_*/
1073
- a[32]("liveness.error.error") + ""
1074
- ), l, s, o = (
1075
- /*$_*/
1076
- a[32](
1077
- /*livenessError*/
1078
- a[19]
1079
- ) + ""
1080
- ), h, n;
1081
- return {
1082
- c() {
1083
- e = g("h1"), l = N(t), s = N(": "), h = N(o), n = N("."), f(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1084
- },
1085
- m(r, d) {
1086
- L(r, e, d), c(e, l), c(e, s), c(e, h), c(e, n);
1087
- },
1088
- p(r, d) {
1089
- d[1] & /*$_*/
1090
- 2 && t !== (t = /*$_*/
1091
- r[32]("liveness.error.error") + "") && W(l, t), d[0] & /*livenessError*/
1092
- 524288 | d[1] & /*$_*/
1093
- 2 && o !== (o = /*$_*/
1094
- r[32](
1095
- /*livenessError*/
1096
- r[19]
1097
- ) + "") && W(h, o);
1098
- },
1099
- d(r) {
1100
- r && D(e);
1101
- }
1102
- };
1103
- }
1104
- function cl(a) {
1105
- let e, t, l, s, o = H(), h, n = (
1106
- /*unique*/
1107
- a[13]
1108
- ), r, d, b, _, C, m, E, p, w, I, T, M, A, me, pe, j = H() && /*waitingIdrndCaptureEvent*/
1109
- a[18], ve, ue = H() && /*idrndLoading*/
1110
- a[16] && /*$cameraStatusStore*/
1111
- a[20] === K.OK, Me, x, le, Ee, G, ee, ke, be = o && Ha(a), fe = ui(a), U = (
1112
- /*showConfigButton*/
1113
- a[4] && fi()
1114
- ), Q = (
1115
- /*showCameraButton*/
1116
- a[6] && di()
1117
- ), Y = (
1118
- /*showAutoCaptureButton*/
1119
- a[5] && !/*$automaticCapture*/
1120
- a[24] && !/*showCaptureButton*/
1121
- a[2] && hi()
1122
- );
1123
- C = new Ma({});
1124
- let te = (
1125
- /*isCountingDown*/
1126
- a[12] && mi(a)
1127
- ), ie = (
1128
- /*$enableFaceApi*/
1129
- a[34] && !/*isCountingDown*/
1130
- a[12] && /*$faceFound*/
1131
- a[36] && !/*$faceValidated*/
1132
- a[25] && /*$faceValidationAlert*/
1133
- a[26] && bi(a)
1134
- ), R = j && _i(a), B = ue && gi(a);
1135
- const _e = [Qa, Xa], oe = [];
1136
- function ze(v, V) {
1137
- return (
1138
- /*$captured*/
1139
- v[23] ? 1 : 0
1140
- );
1141
- }
1142
- x = ze(a), le = oe[x] = _e[x](a);
1143
- const Xe = [Ya, Ga], de = [];
1144
- function We(v, V) {
1145
- return (!/*idrndClosed*/
1146
- v[17] || /*$captured*/
1147
- v[23]) && /*showUnconformities*/
1148
- v[3] ? 0 : (
1149
- /*$cameraStatusStore*/
1150
- v[20] !== K.OK ? 1 : -1
1151
- );
1152
- }
1153
- return ~(G = We(a)) && (ee = de[G] = Xe[G](a)), {
1154
- c() {
1155
- e = g("div"), t = g("div"), l = g("div"), s = g("div"), be && be.c(), h = F(), fe.c(), r = F(), U && U.c(), d = F(), Q && Q.c(), b = F(), Y && Y.c(), _ = F(), Ne(C.$$.fragment), m = F(), E = g("canvas"), p = F(), w = g("canvas"), I = F(), T = g("canvas"), M = F(), te && te.c(), A = F(), ie && ie.c(), pe = F(), R && R.c(), ve = F(), B && B.c(), Me = F(), le.c(), Ee = F(), ee && ee.c(), this.c = $, f(E, "id", "bry-ce-displayCanvas"), f(E, "class", "max-w-full -scale-x-100"), f(w, "id", "bry-ce-detectionsCanvas"), f(w, "class", "absolute top-0 left-0 max-w-full -scale-x-100"), f(T, "id", "bry-ce-maskCanvas"), f(T, "class", "absolute top-0 left-0 max-w-full -scale-x-100"), f(s, "class", "relative"), s.hidden = me = /*$cameraStatusStore*/
1156
- a[20] !== K.OK || H() && /*idrndLoading*/
1157
- (a[16] || /*idrndClosed*/
1158
- a[17] || /*waitingIdrndCaptureEvent*/
1159
- a[18]), f(l, "class", "relative mx-auto"), f(t, "class", "flex flex-col justify-between");
1160
- },
1161
- m(v, V) {
1162
- L(v, e, V), c(e, t), c(t, l), c(l, s), be && be.m(s, null), c(s, h), fe.m(s, null), c(s, r), U && U.m(s, null), c(s, d), Q && Q.m(s, null), c(s, b), Y && Y.m(s, null), c(s, _), Fe(C, s, null), c(s, m), c(s, E), a[55](E), c(s, p), c(s, w), a[56](w), c(s, I), c(s, T), a[57](T), c(s, M), te && te.m(s, null), c(s, A), ie && ie.m(s, null), c(l, pe), R && R.m(l, null), c(l, ve), B && B.m(l, null), c(l, Me), oe[x].m(l, null), a[60](t), c(e, Ee), ~G && de[G].m(e, null), ke = !0;
1163
- },
1164
- p(v, V) {
1165
- o && be.p(v, V), V[0] & /*unique*/
1166
- 8192 && jt(n, n = /*unique*/
1167
- v[13]) ? (fe.d(1), fe = ui(v), fe.c(), fe.m(s, r)) : fe.p(v, V), /*showConfigButton*/
1168
- v[4] ? U ? V[0] & /*showConfigButton*/
1169
- 16 && X(U, 1) : (U = fi(), U.c(), X(U, 1), U.m(s, d)) : U && (qe(), Z(U, 1, 1, () => {
1170
- U = null;
1171
- }), Je()), /*showCameraButton*/
1172
- v[6] ? Q ? V[0] & /*showCameraButton*/
1173
- 64 && X(Q, 1) : (Q = di(), Q.c(), X(Q, 1), Q.m(s, b)) : Q && (qe(), Z(Q, 1, 1, () => {
1174
- Q = null;
1175
- }), Je()), /*showAutoCaptureButton*/
1176
- v[5] && !/*$automaticCapture*/
1177
- v[24] && !/*showCaptureButton*/
1178
- v[2] ? Y ? V[0] & /*showAutoCaptureButton, $automaticCapture, showCaptureButton*/
1179
- 16777252 && X(Y, 1) : (Y = hi(), Y.c(), X(Y, 1), Y.m(s, _)) : Y && (qe(), Z(Y, 1, 1, () => {
1180
- Y = null;
1181
- }), Je()), /*isCountingDown*/
1182
- v[12] ? te ? te.p(v, V) : (te = mi(v), te.c(), te.m(s, A)) : te && (te.d(1), te = null), /*$enableFaceApi*/
1183
- v[34] && !/*isCountingDown*/
1184
- v[12] && /*$faceFound*/
1185
- v[36] && !/*$faceValidated*/
1186
- v[25] && /*$faceValidationAlert*/
1187
- v[26] ? ie ? ie.p(v, V) : (ie = bi(v), ie.c(), ie.m(s, null)) : ie && (ie.d(1), ie = null), (!ke || V[0] & /*$cameraStatusStore, idrndLoading, idrndClosed, waitingIdrndCaptureEvent*/
1188
- 1507328 && me !== (me = /*$cameraStatusStore*/
1189
- v[20] !== K.OK || H() && /*idrndLoading*/
1190
- (v[16] || /*idrndClosed*/
1191
- v[17] || /*waitingIdrndCaptureEvent*/
1192
- v[18]))) && (s.hidden = me), V[0] & /*waitingIdrndCaptureEvent*/
1193
- 262144 && (j = H() && /*waitingIdrndCaptureEvent*/
1194
- v[18]), j ? R ? R.p(v, V) : (R = _i(v), R.c(), R.m(l, ve)) : R && (R.d(1), R = null), V[0] & /*idrndLoading, $cameraStatusStore*/
1195
- 1114112 && (ue = H() && /*idrndLoading*/
1196
- v[16] && /*$cameraStatusStore*/
1197
- v[20] === K.OK), ue ? B ? B.p(v, V) : (B = gi(v), B.c(), B.m(l, Me)) : B && (B.d(1), B = null);
1198
- let we = x;
1199
- x = ze(v), x === we ? oe[x].p(v, V) : (qe(), Z(oe[we], 1, 1, () => {
1200
- oe[we] = null;
1201
- }), Je(), le = oe[x], le ? le.p(v, V) : (le = oe[x] = _e[x](v), le.c()), X(le, 1), le.m(l, null));
1202
- let Oe = G;
1203
- G = We(v), G === Oe ? ~G && de[G].p(v, V) : (ee && (qe(), Z(de[Oe], 1, 1, () => {
1204
- de[Oe] = null;
1205
- }), Je()), ~G ? (ee = de[G], ee ? ee.p(v, V) : (ee = de[G] = Xe[G](v), ee.c()), X(ee, 1), ee.m(e, null)) : ee = null);
1206
- },
1207
- i(v) {
1208
- ke || (X(U), X(Q), X(Y), X(C.$$.fragment, v), X(le), X(ee), ke = !0);
1209
- },
1210
- o(v) {
1211
- Z(U), Z(Q), Z(Y), Z(C.$$.fragment, v), Z(le), Z(ee), ke = !1;
1212
- },
1213
- d(v) {
1214
- v && D(e), be && be.d(), fe.d(v), U && U.d(), Q && Q.d(), Y && Y.d(), De(C), a[55](null), a[56](null), a[57](null), te && te.d(), ie && ie.d(), R && R.d(), B && B.d(), oe[x].d(), a[60](null), ~G && de[G].d();
1215
- }
1216
- };
1217
- }
1218
- let ul = 5, ki = 3e3;
1219
- function Ri(a, e, t) {
1220
- const l = e.videoHeight >= e.videoWidth && t.height >= t.width || e.videoHeight < e.videoWidth && t.height < t.width;
1221
- a.drawImage(
1222
- e,
1223
- l ? 0 : e.videoWidth / 2 - t.width,
1224
- 0,
1225
- l ? e.videoWidth : e.videoHeight * (t.width / t.height),
1226
- e.videoHeight,
1227
- 0,
1228
- 0,
1229
- t.width,
1230
- t.height
1231
- );
1232
- }
1233
- function fl(a, e, t) {
1234
- let l, s, o, h, n, r, d, b, _, C, m, E, p, w, I, T, M, A, me, pe, j, ve, ue, Me, x, le, Ee, G, ee, ke, be, fe, U, Q, Y, te, ie;
1235
- S(a, Ft, (i) => t(77, l = i)), S(a, se, (i) => t(20, o = i)), S(a, ca, (i) => t(79, h = i)), S(a, dt, (i) => t(80, n = i)), S(a, Ae, (i) => t(21, r = i)), S(a, ua, (i) => t(81, d = i)), S(a, Se, (i) => t(22, b = i)), S(a, Ke, (i) => t(23, _ = i)), S(a, Dt, (i) => t(82, C = i)), S(a, $t, (i) => t(83, m = i)), S(a, at, (i) => t(24, E = i)), S(a, Mt, (i) => t(25, p = i)), S(a, fa, (i) => t(84, w = i)), S(a, ei, (i) => t(26, I = i)), S(a, Le, (i) => t(27, T = i)), S(a, et, (i) => t(85, M = i)), S(a, ce, (i) => t(28, A = i)), S(a, Wt, (i) => t(29, me = i)), S(a, Bt, (i) => t(30, pe = i)), S(a, Re, (i) => t(31, j = i)), S(a, Ii, (i) => t(32, ve = i)), S(a, da, (i) => t(86, Me = i)), S(a, ha, (i) => t(34, x = i)), S(a, ti, (i) => t(87, le = i)), S(a, ht, (i) => t(35, Ee = i)), S(a, Ut, (i) => t(88, G = i)), S(a, ma, (i) => t(89, ee = i)), S(a, mt, (i) => t(90, ke = i)), S(a, ii, (i) => t(91, be = i)), S(a, ai, (i) => t(92, fe = i)), S(a, bt, (i) => t(93, U = i)), S(a, li, (i) => t(36, Q = i)), S(a, ba, (i) => t(37, Y = i)), S(a, _a, (i) => t(38, te = i)), S(a, ga, (i) => t(39, ie = i));
1236
- let R, B, _e, oe = !1, ze = {}, Xe = !1, { enableMinutiae: de } = e, { videoDimensions: We } = e, { noTabs: v } = e, { weightsPath: V } = e, { evaluatePhoto: we } = e, { showCaptureButton: Oe } = e, { showUnconformities: qt } = e, { videoOverlay: lt } = e, { videoOverlayTransparency: Qe } = e, { showConfigButton: Jt } = e, { showAutoCaptureButton: Ge } = e, { showCameraButton: zt } = e, { showJustificationField: Xt } = e;
1237
- const st = ni(!1);
1238
- S(a, st, (i) => t(78, s = i));
1239
- const Ye = ni("data:image/png;base64");
1240
- S(a, Ye, (i) => t(33, ue = i));
1241
- let { widgetInstance: ne } = e, Te, q, Ze = !1, Ot = !1, ot = !0, Ce = !0, nt = !1, Qt = 0, ge = "", Tt = 0, It = !0, Pt = 0, At = !1;
1242
- const rt = pa.mixin({
1243
- toast: !0,
1244
- position: "bottom-left",
1245
- timer: 13e3,
1246
- timerProgressBar: !0
1247
- });
1248
- va(async () => {
1249
- u(ht, Ee = !1, Ee), u(li, Q = !1, Q), u(Ke, _ = !1, _), u(dt, n = Vt.FRONT_CAMERA, n), u(se, o = K.OK, o), Ge && u(at, E = !1, E), H() && (import("./index-no-detector_4b302e78_2.2.23.js"), Si()), x && (await wa(V), Xe = !0), await Be(), Fi();
1250
- });
1251
- function St(i, k) {
1252
- i.clearRect(0, 0, q.width, q.height), i.save(), lt != "none" ? (Qe > 0 && (i.globalAlpha = Qe / 100), i.fillStyle = lt, i.fillRect(0, 0, q.width, q.height)) : (i.beginPath(), i.rect(0, 0, q.width, q.height));
1253
- let y = q.height * 0.8;
1254
- const O = b.videoWidth / 2;
1255
- let P = b.videoHeight * 0.5;
1256
- (Ge || Oe) && (P = b.videoHeight * 0.44), ye() && (y = q.height * 0.65, P = b.videoHeight * 0.51);
1257
- const J = y / 1.45;
1258
- u(bt, U.width = J, U), u(bt, U.height = y, U), u(bt, U.y = P, U), i.ellipse(O, P, J / 2, y / 2, 0, 0, 2 * Math.PI, !0), Qe == 0 && i.clip(), Ri(i, k, q), i.restore(), i.save(), i.beginPath();
1259
- const Ie = window.getComputedStyle(q).getPropertyValue("--p"), Ve = window.getComputedStyle(q).getPropertyValue("--su");
1260
- if (i.strokeStyle = `hsl(${Ie})`, i.lineWidth = 16, i.ellipse(O, P, J / 2, y / 2, 0, 0, 2 * Math.PI), i.stroke(), oe && !At) {
1261
- const $e = 1 - (Pt - (/* @__PURE__ */ new Date()).getTime()) / ki;
1262
- i.save(), i.beginPath(), i.lineWidth = 16, i.strokeStyle = `hsl(${Ve})`, i.ellipse(O, P, J / 2, y / 2, 0, 0 - Math.PI / 2, 1.5 * (Math.PI * 2 * $e) - Math.PI / 2), i.stroke();
1263
- }
1264
- i.beginPath();
1265
- const ae = new Path2D();
1266
- ae.ellipse(O, P, J / 2, y / 2, 0, 0, 2 * Math.PI), i.clip(ae), Ri(i, k, q), i.restore();
1267
- }
1268
- function Si() {
1269
- ne.addEventListener("open", (i) => {
1270
- const k = i.detail[0].video;
1271
- u(
1272
- ai,
1273
- fe = {
1274
- width: k.videoWidth,
1275
- height: k.videoHeight
1276
- },
1277
- fe
1278
- ), t(9, R.srcObject = k.srcObject, R), t(16, ot = !1);
1279
- function y() {
1280
- Ce || (St(q.getContext("2d"), k), He(R, y, !0));
1281
- }
1282
- y();
1283
- }), ne.addEventListener("error", (i) => {
1284
- console.error(i), i.detail[0].message === "Device in use" ? u(se, o = K.CAMERA_IN_USE_ERROR, o) : i.detail[0].message === "Permission denied" || i.detail[0].message === "Permission dismissed" ? u(se, o = K.CAMERA_DENIED_ERROR, o) : i.detail[0].message === "Requested device not found" && u(se, o = K.DEVICE_NOT_FOUND_ERROR, o), t(16, ot = !1);
1285
- }), ne.addEventListener("faceDetection", (i) => {
1286
- }), ne.addEventListener("close", async (i) => {
1287
- _ || (Ze = !1), t(17, Ce = !0), t(18, nt = !1), o === K.OK && u(se, o = K.CAMERA_CLOSED_ERROR, o);
1288
- }), ne.addEventListener("initialize", async (i) => {
1289
- Ot = !0, u(ii, be = !0, be), G === _t.Face && !Ze && !_ && Ot && await ct();
1290
- }), ne.addEventListener("capture", async (i) => {
1291
- t(19, ge = "");
1292
- const { encryptedFile: k, photo: y } = i.detail[0];
1293
- u(mt, ke = k, ke), t(18, nt = !1), u(ce, A = z.OK, A), u(Le, T.isLoading = !0, T), u(Ke, _ = !0, _), Ze = !1;
1294
- const O = (await gt(y)).split(",");
1295
- if (u(Ye, ue = O[0], ue), u(Re, j = O[1], j), u(et, M = O[1], M), !ee) {
1296
- let ae, $e;
1297
- try {
1298
- ({ bodyParts: ae, icaoWarnings: $e } = await pt(M, we, (await gt(k)).split(",")[1])), window.dispatchEvent(new CustomEvent(
1299
- "face-unconformities-validated",
1300
- {
1301
- detail: {
1302
- bodyParts: ae,
1303
- icaoWarnings: $e,
1304
- status: A
1305
- }
1306
- }
1307
- ));
1308
- } catch (Pe) {
1309
- console.error(Pe);
1310
- let ft = tt.UNKNOWN, Nt = [], Zt = [];
1311
- if (Pe instanceof Kt && Pe.response?.status === 400)
1312
- if (Pe.response.data && Array.isArray(Pe.response.data.bodyParts)) {
1313
- Nt = Pe.response.data.bodyParts, Zt = Pe.response.data.icaoWarnings;
1314
- const xt = Nt.find((ra) => ra.livenessResult.error);
1315
- ft = xt?.livenessResult.error_code, u(ce, A = z.LIVENESS_DETECTION_FAILURE, A), xt?.livenessResult.error_code || u(ce, A = z.UNKNOWN_LIVENESS_ERROR, A), t(19, ge = tt[ft]), console.error("Liveness error:", ft);
1316
- } else
1317
- u(ce, A = z.TEMPLATE_EXTRACTION_ERROR, A);
1318
- else
1319
- u(ce, A = z.UNKNOWN_LIVENESS_ERROR, A), rt.fire({
1320
- icon: "error",
1321
- title: "Falha ao comunicar com serviço de Liveness"
1322
- });
1323
- u(Le, T.isLoading = !1, T), window.dispatchEvent(new CustomEvent(
1324
- "face-unconformities-validated",
1325
- {
1326
- detail: {
1327
- bodyParts: Nt,
1328
- errorCode: ft,
1329
- translatedError: ve(ge),
1330
- status: A,
1331
- icaoWarnings: Zt
1332
- }
1333
- }
1334
- ));
1335
- return;
1336
- }
1337
- if (A !== z.OK) {
1338
- u(Le, T.isLoading = !1, T);
1339
- return;
1340
- }
1341
- ae[0].livenessResult && Gt(ae[0].livenessResult), ae.length !== 0 && ae[0].data && u(Re, j = ae[0].data, j), vt($e);
1342
- return;
1343
- }
1344
- let P, J;
1345
- try {
1346
- J = await Ca(k), Gt(J.data);
1347
- } catch (ae) {
1348
- u(ce, A = z.UNKNOWN_LIVENESS_ERROR, A), console.error(ae), ae instanceof Kt && ae.response?.status === 400 ? (P = ae.response.data.error_code, t(19, ge = tt[P]), console.error("Liveness error:", P), u(ce, A = z.LIVENESS_DETECTION_FAILURE, A)) : rt.fire({
1349
- icon: "error",
1350
- title: "Falha ao comunicar com serviço de Liveness"
1351
- });
1352
- }
1353
- if (A !== z.OK) {
1354
- u(Le, T.isLoading = !1, T), window.dispatchEvent(new CustomEvent(
1355
- "face-unconformities-validated",
1356
- {
1357
- detail: {
1358
- bodyParts: [
1359
- {
1360
- bodyPart: "FACE",
1361
- data: M,
1362
- livenessBlob: (await gt(k)).split(",")[1],
1363
- ...J && { livenessResult: J }
1364
- }
1365
- ],
1366
- ...P && { errorCode: P },
1367
- ...ge && { translatedError: ve(ge) },
1368
- status: A
1369
- }
1370
- }
1371
- ));
1372
- return;
1373
- }
1374
- let { bodyParts: Ie, icaoWarnings: Ve } = await pt(M, we);
1375
- window.dispatchEvent(new CustomEvent(
1376
- "face-unconformities-validated",
1377
- {
1378
- detail: {
1379
- bodyParts: Ie,
1380
- icaoWarnings: Ve,
1381
- status: A,
1382
- errorCode: P,
1383
- ...ge && { translatedError: ve(ge) }
1384
- }
1385
- }
1386
- )), Ie[0].data && u(Re, j = Ie[0].data, j), vt(Ve);
1387
- });
1388
- }
1389
- async function Be(i) {
1390
- const [k, y] = (We ?? "")?.replaceAll(" ", "")?.split("x")?.map((O) => O ? parseInt(O) : void 0);
1391
- if (!(!k || !y)) {
1392
- if (u(Se, b = { videoWidth: k, videoHeight: y }, b), H() && y < k && ye() && u(Se, b = { videoWidth: y, videoHeight: k }, b), H()) {
1393
- ct();
1394
- return;
1395
- }
1396
- await Ni(k, y, i);
1397
- }
1398
- }
1399
- function ct() {
1400
- H() && (u(se, o = K.OK, o), ne && "openCamera" in ne && ne.openCamera(), Ze = !0, t(17, Ce = !1), t(16, ot = !0));
1401
- }
1402
- async function xe() {
1403
- if (x && !Xe)
1404
- return He(R, xe);
1405
- if (R) {
1406
- if (G !== _t.Face && !v)
1407
- return He(R, xe);
1408
- u(ht, Ee = !0, Ee), x ? (s || u(st, s = !0, s), H() || St(q.getContext("2d"), R), He(R, xe)) : (St(q.getContext("2d"), R), He(R, xe));
1409
- }
1410
- }
1411
- async function Li() {
1412
- if (le && (oi(), u(ti, le = !1, le)), u(ce, A = z.OK, A), H()) {
1413
- t(18, nt = !0), ne.takePhoto();
1414
- return;
1415
- }
1416
- u(Ke, _ = !0, _);
1417
- try {
1418
- if (x) {
1419
- const [i] = await (await import("./face_api_0e3ce8c8_2.2.23.js")).extractFaces(R, [Me]), k = i.toDataURL("image/jpeg").split(",");
1420
- u(Ye, ue = k[0], ue), u(Re, j = k[1], j), u(et, M = k[1], M);
1421
- let y, O;
1422
- ({ bodyParts: y, icaoWarnings: O } = await pt(j, we)), window.dispatchEvent(new CustomEvent(
1423
- "face-unconformities-validated",
1424
- {
1425
- detail: {
1426
- bodyParts: y,
1427
- icaoWarnings: O,
1428
- status: A
1429
- }
1430
- }
1431
- )), y.length !== 0 && y[0].data && u(Re, j = y[0].data, j), vt(O);
1432
- } else {
1433
- const i = document.createElement("canvas"), k = i.getContext("2d");
1434
- i.width = R.width, i.height = R.height, k?.drawImage(R, 0, 0, i.width, i.height);
1435
- const y = i.toDataURL("image/jpeg").split(",");
1436
- u(Ye, ue = y[0], ue), u(Re, j = y[1], j), u(et, M = y[1], M);
1437
- let { bodyParts: O, icaoWarnings: P } = await pt(j, we);
1438
- window.dispatchEvent(new CustomEvent(
1439
- "face-unconformities-validated",
1440
- {
1441
- detail: {
1442
- bodyParts: O,
1443
- icaoWarnings: P,
1444
- status: A
1445
- }
1446
- }
1447
- )), O.length !== 0 && O[0].data && u(Re, j = O[0].data, j), vt(P);
1448
- }
1449
- } catch (i) {
1450
- console.error(i);
1451
- let k = tt.UNKNOWN, y = [], O = [];
1452
- if (i instanceof Kt && i.response?.status === 400)
1453
- if (i.response.data && Array.isArray(i.response.data.bodyParts)) {
1454
- y = i.response.data.bodyParts, O = i.response.data.icaoWarnings;
1455
- const P = y.find((J) => J.livenessResult.error);
1456
- k = P?.livenessResult.error_code, u(ce, A = z.LIVENESS_DETECTION_FAILURE, A), P?.livenessResult.error_code || u(ce, A = z.UNKNOWN_LIVENESS_ERROR, A), t(19, ge = tt[k]), console.error("Liveness error:", k);
1457
- } else
1458
- u(ce, A = z.TEMPLATE_EXTRACTION_ERROR, A);
1459
- else
1460
- u(ce, A = z.UNKNOWN_LIVENESS_ERROR, A), rt.fire({
1461
- icon: "error",
1462
- title: "Falha ao comunicar com serviço de Liveness"
1463
- });
1464
- u(Le, T.isLoading = !1, T), window.dispatchEvent(new CustomEvent(
1465
- "face-unconformities-validated",
1466
- {
1467
- detail: {
1468
- bodyParts: y,
1469
- errorCode: k,
1470
- translatedError: ve(ge),
1471
- status: A,
1472
- icaoWarnings: O
1473
- }
1474
- }
1475
- ));
1476
- return;
1477
- }
1478
- }
1479
- function ut() {
1480
- const i = {
1481
- bodyPart: "FACE",
1482
- data: j,
1483
- justification: pe
1484
- };
1485
- u(Wt, me = !0, me), Et(mt) && gt(Et(mt)).then((k) => {
1486
- i.livenessBlob = k.split(",")[1];
1487
- }), window.dispatchEvent(new CustomEvent("export-face", { detail: i }));
1488
- }
1489
- function Ue() {
1490
- window.dispatchEvent(new CustomEvent("face-scrapped")), u(Wt, me = !1, me), u(ce, A = z.OK, A), u(Ke, _ = !1, _), u(et, M = "", M), u(Le, T.unconformities = [], T);
1491
- const i = Et(Ht);
1492
- i.closedMouth = !1, i.isPersonCloseEnough = !1, i.isPersonTooclose = !0, i.isPersonInFrame = !1, u(ei, I = "", I), u(Mt, p = !0, p), Ge && u(at, E = !1, E), Ht.set(i), Ce && ct();
1493
- }
1494
- function Gt(i) {
1495
- let k = "", y = "success";
1496
- i.isAlive ? k = `Vivacidade de face (${i.face_liveness.probability.toFixed(2)}) e de captura (${i.capture_liveness.probability}, ${i.capture_liveness.score.toFixed(2)}) verificados!` : i?.face_liveness?.probability && (y = "error", k = `Vivacidade de face (${i.face_liveness.probability.toFixed(2)}) e de captura (${i.capture_liveness.probability}, ${i.capture_liveness.score.toFixed(2)}) insuficientes!`), w && rt.fire({ icon: y, title: k });
1497
- }
1498
- async function Ni(i, k, y) {
1499
- try {
1500
- const { deviceId: O, width: P, height: J, aspectRatio: Ie, facingMode: Ve, touchPoints: ae } = await Ea(i, k, n, y);
1501
- P < i && J < k && u(
1502
- Se,
1503
- b = {
1504
- videoWidth: P,
1505
- videoHeight: J
1506
- },
1507
- b
1508
- ), ye() && (!Ve || ae <= 1) && P > J && u(
1509
- Se,
1510
- b = {
1511
- videoWidth: J,
1512
- videoHeight: P
1513
- },
1514
- b
1515
- ), u(Ae, r = O || d[0].deviceId, r);
1516
- } catch (O) {
1517
- const P = O;
1518
- t(17, Ce = !0);
1519
- const J = wt(O) && O.constraint ? O.constraint : "";
1520
- console.error(P, J), wt(P) && "message" in P && P.message.includes("Permission denied") && (console.error("User didn't give permission to use camera!"), u(se, o = K.CAMERA_DENIED_ERROR, o)), wt(P) && "message" in P && P.message.includes("Requested device not found") && u(se, o = K.DEVICE_NOT_FOUND_ERROR, o), (J.includes("width") || J.includes("height")) && (console.error(`Camera does not meet the minimum supported requirements! (${J})`), u(se, o = K.CAMERA_UNSUPPORTED, o));
1521
- }
1522
- }
1523
- async function Lt() {
1524
- H() || u(Ae, r = "", r), await Be();
1525
- }
1526
- function Fi() {
1527
- navigator.mediaDevices.ondevicechange = async (i) => {
1528
- await si(), o !== K.OK ? await Lt() : m.active || (Ct(), u(se, o = K.DEVICE_NOT_FOUND_ERROR, o));
1529
- };
1530
- }
1531
- const Di = Se.subscribe((i) => {
1532
- R && B && (t(9, R.width = i.videoWidth, R), t(9, R.height = i.videoHeight, R), t(10, B.width = i.videoWidth, B), t(10, B.height = i.videoHeight, B), t(14, Te.width = i.videoWidth, Te), t(14, Te.height = i.videoHeight, Te), t(15, q.width = i.videoWidth, q), t(15, q.height = i.videoHeight, q));
1533
- }), Mi = Ht.subscribe((i) => {
1534
- if (h == "DOCUMENT")
1535
- return;
1536
- let k = "", y = !1;
1537
- if (i.isPersonCloseEnough ? i.isPersonTooclose ? k = "faceCollector.moveAwayCamera" : i.isPersonInFrame ? i.closedMouth ? y = !0 : k = "faceCollector.dontOpenMouth" : k = "faceCollector.stayInFrame" : k = "faceCollector.comeCloserCamera", ka(y, k), !_ && E && !oe && i.isPersonInFrame && i.closedMouth && !(!i.isPersonCloseEnough || i.isPersonTooclose)) {
1538
- t(12, oe = !0), u(Mt, p = !0, p), Pt = (/* @__PURE__ */ new Date()).getTime() + ki;
1539
- const O = setInterval(
1540
- () => {
1541
- if (!E || _ || H() && Ce || !i.isPersonCloseEnough || i.isPersonTooclose || !i.closedMouth || !i.isPersonInFrame) {
1542
- t(12, oe = !1), At = !0, setTimeout(
1543
- () => {
1544
- At = !1;
1545
- },
1546
- 1500
1547
- ), clearInterval(O);
1548
- return;
1549
- }
1550
- const P = (/* @__PURE__ */ new Date()).getTime();
1551
- Math.floor((Pt - P) % (1e3 * 60) / 1e3) <= 0 && (clearInterval(O), t(12, oe = !1), document.getElementsByTagName("biometric-collector")?.[0]?.shadowRoot?.getElementById("bry-cc-capture-btn")?.click());
1552
- },
1553
- 100
1554
- );
1555
- }
1556
- }), Wi = Ke.subscribe((i) => {
1557
- _e && (i ? (_e.classList.remove("flex"), _e.classList.add("hidden")) : (_e.classList.add("flex"), _e.classList.remove("hidden")));
1558
- }), Bi = Dt.subscribe((i) => {
1559
- R && i && (console.log("setting null in video srcObject"), t(9, R.srcObject = null, R), t(9, R.src = "", R), u(Ae, r = null, r));
1560
- });
1561
- Ut.subscribe(async (i) => {
1562
- i === _t.Face && (await si(), H() && u(Ae, r = d[0].deviceId, r));
1563
- });
1564
- const Ui = Ae.subscribe(async (i) => {
1565
- if (!i || h == "DOCUMENT" || H() && Ce)
1566
- return;
1567
- R || t(13, ze = {});
1568
- const { videoHeight: k, videoWidth: y } = b;
1569
- try {
1570
- if (H()) {
1571
- await Ct(ne), await ct();
1572
- return;
1573
- }
1574
- const O = await Ra(y, k, i);
1575
- t(9, R.srcObject = O, R), u($t, m = O, m), u(Dt, C = !1, C), It ? u(se, o = K.OK, o) : u(se, o = K.CAMERA_ORIENTATION_PORTRAIT, o), O.getTracks().forEach((P) => {
1576
- P.readyState === "live" && console.log(`Camera ${P.label} opened successfully!`);
1577
- });
1578
- } catch (O) {
1579
- const P = O;
1580
- t(17, Ce = !0), wt(P) && "message" in P && P.message.includes("Requested device not found") && u(se, o = K.DEVICE_NOT_FOUND_ERROR, o);
1581
- }
1582
- }), Vi = Ut.subscribe(async (i) => {
1583
- i === _t.Face && H() && !Ze && !_ && Ot && await Be();
1584
- }), Ki = st.subscribe(async (i) => {
1585
- i && Yt();
1586
- }), Hi = ya.subscribe(async (i) => {
1587
- if (!(!b || H() && Ce) && b) {
1588
- if (Ct(), !ye()) {
1589
- const y = (d.findIndex((P) => P.deviceId === r) + 1) % d.length, O = d[y].deviceId;
1590
- H() ? u(Ae, r = O, r) : await Be(O);
1591
- return;
1592
- }
1593
- i ? (u(dt, n = Vt.REAR_CAMERA, n), await Be()) : (u(dt, n = Vt.FRONT_CAMERA, n), await Be());
1594
- }
1595
- }), ji = Oa.subscribe(async (i) => {
1596
- !i.isSupported || !ye() || h != "FACE" || (It = i.orientation.includes("portrait"), It ? u(se, o = K.OK, o) : u(se, o = K.CAMERA_ORIENTATION_PORTRAIT, o));
1597
- });
1598
- async function Yt() {
1599
- let i;
1600
- if (Tt >= ul) {
1601
- Tt = 0;
1602
- const k = await Pa(), y = await import("./face_api_0e3ce8c8_2.2.23.js");
1603
- let O;
1604
- O = y.detectSingleFace(q, k), i = await O.withFaceLandmarks(), B.getContext("2d")?.clearRect(0, 0, B.width, B.height);
1605
- } else
1606
- Tt++;
1607
- i ? Aa(i, B, de) : Sa(), s && He(R, Yt);
1608
- }
1609
- Ft.subscribe(async (i) => {
1610
- i && (Ue(), u(Ft, l = !1, l));
1611
- });
1612
- const qi = ht.subscribe((i) => {
1613
- i && window.dispatchEvent(new CustomEvent("brycc-camera-ready"));
1614
- });
1615
- Ta(() => {
1616
- Ct(), Wi(), Mi(), Di(), Bi(), Ui(), Vi(), clearInterval(Qt), Ki(), Hi(), ji(), qi(), oi(), Qt = 0;
1617
- });
1618
- function Ji(i) {
1619
- je[i ? "unshift" : "push"](() => {
1620
- ne = i, t(0, ne);
1621
- });
1622
- }
1623
- function zi(i) {
1624
- je[i ? "unshift" : "push"](() => {
1625
- R = i, t(9, R);
1626
- });
1627
- }
1628
- const Xi = () => {
1629
- H() || u(
1630
- Se,
1631
- b = {
1632
- videoHeight: R.videoHeight,
1633
- videoWidth: R.videoWidth
1634
- },
1635
- b
1636
- );
1637
- };
1638
- function Qi(i) {
1639
- je[i ? "unshift" : "push"](() => {
1640
- q = i, t(15, q);
1641
- });
1642
- }
1643
- function Gi(i) {
1644
- je[i ? "unshift" : "push"](() => {
1645
- B = i, t(10, B);
1646
- });
1647
- }
1648
- function Yi(i) {
1649
- je[i ? "unshift" : "push"](() => {
1650
- Te = i, t(14, Te);
1651
- });
1652
- }
1653
- const Zi = () => ut(), xi = () => Ue();
1654
- function $i(i) {
1655
- je[i ? "unshift" : "push"](() => {
1656
- _e = i, t(11, _e);
1657
- });
1658
- }
1659
- const ea = () => ut(), ta = () => Ue();
1660
- function ia() {
1661
- pe = this.value, Bt.set(pe);
1662
- }
1663
- const aa = () => ut(), la = () => Ue();
1664
- function sa() {
1665
- pe = this.value, Bt.set(pe);
1666
- }
1667
- const oa = () => Ue(), na = async () => {
1668
- await Lt();
1669
- };
1670
- return a.$$set = (i) => {
1671
- "enableMinutiae" in i && t(46, de = i.enableMinutiae), "videoDimensions" in i && t(47, We = i.videoDimensions), "noTabs" in i && t(48, v = i.noTabs), "weightsPath" in i && t(49, V = i.weightsPath), "evaluatePhoto" in i && t(1, we = i.evaluatePhoto), "showCaptureButton" in i && t(2, Oe = i.showCaptureButton), "showUnconformities" in i && t(3, qt = i.showUnconformities), "videoOverlay" in i && t(50, lt = i.videoOverlay), "videoOverlayTransparency" in i && t(51, Qe = i.videoOverlayTransparency), "showConfigButton" in i && t(4, Jt = i.showConfigButton), "showAutoCaptureButton" in i && t(5, Ge = i.showAutoCaptureButton), "showCameraButton" in i && t(6, zt = i.showCameraButton), "showJustificationField" in i && t(7, Xt = i.showJustificationField), "widgetInstance" in i && t(0, ne = i.widgetInstance);
1672
- }, [
1673
- ne,
1674
- we,
1675
- Oe,
1676
- qt,
1677
- Jt,
1678
- Ge,
1679
- zt,
1680
- Xt,
1681
- xe,
1682
- R,
1683
- B,
1684
- _e,
1685
- oe,
1686
- ze,
1687
- Te,
1688
- q,
1689
- ot,
1690
- Ce,
1691
- nt,
1692
- ge,
1693
- o,
1694
- r,
1695
- b,
1696
- _,
1697
- E,
1698
- p,
1699
- I,
1700
- T,
1701
- A,
1702
- me,
1703
- pe,
1704
- j,
1705
- ve,
1706
- ue,
1707
- x,
1708
- Ee,
1709
- Q,
1710
- Y,
1711
- te,
1712
- ie,
1713
- st,
1714
- Ye,
1715
- Li,
1716
- ut,
1717
- Ue,
1718
- Lt,
1719
- de,
1720
- We,
1721
- v,
1722
- V,
1723
- lt,
1724
- Qe,
1725
- Ji,
1726
- zi,
1727
- Xi,
1728
- Qi,
1729
- Gi,
1730
- Yi,
1731
- Zi,
1732
- xi,
1733
- $i,
1734
- ea,
1735
- ta,
1736
- ia,
1737
- aa,
1738
- la,
1739
- sa,
1740
- oa,
1741
- na
1742
- ];
1743
- }
1744
- class dl extends yi {
1745
- constructor(e) {
1746
- super(), Oi(
1747
- this,
1748
- {
1749
- target: this.shadowRoot,
1750
- props: Ti(this.attributes),
1751
- customElement: !0
1752
- },
1753
- fl,
1754
- cl,
1755
- jt,
1756
- {
1757
- enableMinutiae: 46,
1758
- videoDimensions: 47,
1759
- noTabs: 48,
1760
- weightsPath: 49,
1761
- evaluatePhoto: 1,
1762
- showCaptureButton: 2,
1763
- showUnconformities: 3,
1764
- videoOverlay: 50,
1765
- videoOverlayTransparency: 51,
1766
- showConfigButton: 4,
1767
- showAutoCaptureButton: 5,
1768
- showCameraButton: 6,
1769
- showJustificationField: 7,
1770
- widgetInstance: 0,
1771
- play: 8
1772
- },
1773
- null,
1774
- [-1, -1, -1, -1]
1775
- ), e && (e.target && L(e.target, this, e.anchor), e.props && (this.$set(e.props), re()));
1776
- }
1777
- static get observedAttributes() {
1778
- return [
1779
- "enableMinutiae",
1780
- "videoDimensions",
1781
- "noTabs",
1782
- "weightsPath",
1783
- "evaluatePhoto",
1784
- "showCaptureButton",
1785
- "showUnconformities",
1786
- "videoOverlay",
1787
- "videoOverlayTransparency",
1788
- "showConfigButton",
1789
- "showAutoCaptureButton",
1790
- "showCameraButton",
1791
- "showJustificationField",
1792
- "widgetInstance",
1793
- "play"
1794
- ];
1795
- }
1796
- get enableMinutiae() {
1797
- return this.$$.ctx[46];
1798
- }
1799
- set enableMinutiae(e) {
1800
- this.$$set({ enableMinutiae: e }), re();
1801
- }
1802
- get videoDimensions() {
1803
- return this.$$.ctx[47];
1804
- }
1805
- set videoDimensions(e) {
1806
- this.$$set({ videoDimensions: e }), re();
1807
- }
1808
- get noTabs() {
1809
- return this.$$.ctx[48];
1810
- }
1811
- set noTabs(e) {
1812
- this.$$set({ noTabs: e }), re();
1813
- }
1814
- get weightsPath() {
1815
- return this.$$.ctx[49];
1816
- }
1817
- set weightsPath(e) {
1818
- this.$$set({ weightsPath: e }), re();
1819
- }
1820
- get evaluatePhoto() {
1821
- return this.$$.ctx[1];
1822
- }
1823
- set evaluatePhoto(e) {
1824
- this.$$set({ evaluatePhoto: e }), re();
1825
- }
1826
- get showCaptureButton() {
1827
- return this.$$.ctx[2];
1828
- }
1829
- set showCaptureButton(e) {
1830
- this.$$set({ showCaptureButton: e }), re();
1831
- }
1832
- get showUnconformities() {
1833
- return this.$$.ctx[3];
1834
- }
1835
- set showUnconformities(e) {
1836
- this.$$set({ showUnconformities: e }), re();
1837
- }
1838
- get videoOverlay() {
1839
- return this.$$.ctx[50];
1840
- }
1841
- set videoOverlay(e) {
1842
- this.$$set({ videoOverlay: e }), re();
1843
- }
1844
- get videoOverlayTransparency() {
1845
- return this.$$.ctx[51];
1846
- }
1847
- set videoOverlayTransparency(e) {
1848
- this.$$set({ videoOverlayTransparency: e }), re();
1849
- }
1850
- get showConfigButton() {
1851
- return this.$$.ctx[4];
1852
- }
1853
- set showConfigButton(e) {
1854
- this.$$set({ showConfigButton: e }), re();
1855
- }
1856
- get showAutoCaptureButton() {
1857
- return this.$$.ctx[5];
1858
- }
1859
- set showAutoCaptureButton(e) {
1860
- this.$$set({ showAutoCaptureButton: e }), re();
1861
- }
1862
- get showCameraButton() {
1863
- return this.$$.ctx[6];
1864
- }
1865
- set showCameraButton(e) {
1866
- this.$$set({ showCameraButton: e }), re();
1867
- }
1868
- get showJustificationField() {
1869
- return this.$$.ctx[7];
1870
- }
1871
- set showJustificationField(e) {
1872
- this.$$set({ showJustificationField: e }), re();
1873
- }
1874
- get widgetInstance() {
1875
- return this.$$.ctx[0];
1876
- }
1877
- set widgetInstance(e) {
1878
- this.$$set({ widgetInstance: e }), re();
1879
- }
1880
- get play() {
1881
- return this.$$.ctx[8];
1882
- }
1883
- }
1884
- customElements.define("face-collector", dl);
1885
- export {
1886
- dl as default
1887
- };