bry-biometric-collector 2.2.17 → 2.2.18-RC02

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