bry-biometric-collector 2.2.18 → 2.2.19-RC05

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