bry-biometric-collector 2.2.7 → 2.2.8-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,1009 +0,0 @@
1
- import { S as ai, r as li, t as At, w as ni, x as J, y as ae, B as w, C as B, D as Se, E as se, G as d, H as r, I as Te, J as x, K as Ze, L as ie, M as xe, N as Q, O as Fe, P as R, Q as Ke, W as _e, T as de, U as ri, R as De, V as ci, X as pe, Y as qe, _ as ut, Z as ui, a0 as je, a2 as dt, a4 as Ye, a5 as Xe, a6 as Re, a7 as ft, a8 as ht, ab as bt, aa as di, ac as Pe, ad as Je, aj as mt, $ as fi, ak as hi, al as bi, am as mi, an as gi, ao as _i, ap as g, aq as Qe, ar as pi, aA as wi, az as ze, f as Ae, aB as gt, aC as we, aD as vi, aE as Ci, as as Ge, aF as ki, aG as yi, aH as Ei, aV as Di, aI as ve, aJ as Ri, aK as _t, aL as oe, aM as Oe, aN as Pi, aO as V, aP as X, aS as pt, at as $e, aT as Ai, aU as Si, aW as Ce, aQ as wt, l as Ti, aY as Fi, aZ as Oi, a_ as vt, a$ as Ct, b1 as Ii } from "./main_dd4c53c5_2.2.7.js";
2
- import { a as Li, C as j, c as Z, b as Ni } from "./CameraBtn_ced4ca16_2.2.7.js";
3
- function kt(s) {
4
- let t, i, o;
5
- return {
6
- c() {
7
- t = w("video"), d(t, "id", "bry-cc-camera-video-tag"), d(t, "class", "absolute -z-10"), t.playsInline = !0, t.muted = !0, t.autoplay = !0;
8
- },
9
- m(a, n) {
10
- J(a, t, n), s[40](t), i || (o = [
11
- oe(
12
- t,
13
- "canplay",
14
- /*canplay_handler*/
15
- s[41]
16
- ),
17
- oe(
18
- t,
19
- "play",
20
- /*play*/
21
- s[3],
22
- { once: !0 }
23
- )
24
- ], i = !0);
25
- },
26
- p: se,
27
- d(a) {
28
- a && Q(t), s[40](null), i = !1, Oe(o);
29
- }
30
- };
31
- }
32
- function yt(s) {
33
- let t, i;
34
- return t = new Pi({ props: { className: "bottom-0" } }), {
35
- c() {
36
- Se(t.$$.fragment);
37
- },
38
- m(o, a) {
39
- Te(t, o, a), i = !0;
40
- },
41
- i(o) {
42
- i || (x(t.$$.fragment, o), i = !0);
43
- },
44
- o(o) {
45
- ie(t.$$.fragment, o), i = !1;
46
- },
47
- d(o) {
48
- Fe(t, o);
49
- }
50
- };
51
- }
52
- function Et(s) {
53
- let t, i = (
54
- /*$_*/
55
- s[25]("faceCollector.stayStill") + ""
56
- ), o;
57
- return {
58
- c() {
59
- t = w("span"), o = V(i), d(t, "class", "absolute left-1/2 -translate-x-1/2 top-[7%] ce-dui-badge ce-dui-badge-lg h-[2em] text-xl xl:text-base w-[12.1em]");
60
- },
61
- m(a, n) {
62
- J(a, t, n), r(t, o);
63
- },
64
- p(a, n) {
65
- n[0] & /*$_*/
66
- 33554432 && i !== (i = /*$_*/
67
- a[25]("faceCollector.stayStill") + "") && X(o, i);
68
- },
69
- d(a) {
70
- a && Q(t);
71
- }
72
- };
73
- }
74
- function Dt(s) {
75
- let t, i = (
76
- /*$_*/
77
- s[25](`${/*$faceValidationAlert*/
78
- s[16]}`) + ""
79
- ), o;
80
- return {
81
- c() {
82
- t = w("span"), o = V(i), d(t, "class", "absolute left-1/2 -translate-x-1/2 top-[7%] ce-dui-badge ce-dui-badge-lg h-[2em] text-xl xl:text-base w-[12.1em]");
83
- },
84
- m(a, n) {
85
- J(a, t, n), r(t, o);
86
- },
87
- p(a, n) {
88
- n[0] & /*$_, $faceValidationAlert*/
89
- 33619968 && i !== (i = /*$_*/
90
- a[25](`${/*$faceValidationAlert*/
91
- a[16]}`) + "") && X(o, i);
92
- },
93
- d(a) {
94
- a && Q(t);
95
- }
96
- };
97
- }
98
- function Wi(s) {
99
- let t, i, o = (
100
- /*$_*/
101
- s[25]("faceCollector.finish") + ""
102
- ), a, n, c, l, b = (
103
- /*$_*/
104
- s[25]("faceCollector.retakePhoto") + ""
105
- ), u, p, _;
106
- return {
107
- c() {
108
- t = w("div"), i = w("button"), a = V(o), c = B(), l = w("button"), u = V(b), i.disabled = n = /*$justification*/
109
- s[19].length === 0, d(i, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink"), d(l, "id", "bry-cc-retake-button"), d(l, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink"), d(t, "class", "ce-dui-btn-group flex");
110
- },
111
- m(h, f) {
112
- J(h, t, f), r(t, i), r(i, a), r(t, c), r(t, l), r(l, u), p || (_ = [
113
- oe(
114
- i,
115
- "click",
116
- /*click_handler_1*/
117
- s[46]
118
- ),
119
- oe(
120
- l,
121
- "click",
122
- /*click_handler_2*/
123
- s[47]
124
- )
125
- ], p = !0);
126
- },
127
- p(h, f) {
128
- f[0] & /*$_*/
129
- 33554432 && o !== (o = /*$_*/
130
- h[25]("faceCollector.finish") + "") && X(a, o), f[0] & /*$justification*/
131
- 524288 && n !== (n = /*$justification*/
132
- h[19].length === 0) && (i.disabled = n), f[0] & /*$_*/
133
- 33554432 && b !== (b = /*$_*/
134
- h[25]("faceCollector.retakePhoto") + "") && X(u, b);
135
- },
136
- d(h) {
137
- h && Q(t), p = !1, Oe(_);
138
- }
139
- };
140
- }
141
- function Mi(s) {
142
- let t, i, o, a, n;
143
- function c(u, p) {
144
- return (
145
- /*$isLoading*/
146
- u[26] ? Hi : Bi
147
- );
148
- }
149
- let l = c(s), b = l(s);
150
- return {
151
- c() {
152
- t = w("button"), b.c(), d(t, "id", "bry-cc-capture-btn"), t.disabled = i = !/*$faceFound*/
153
- s[24] && /*$enableFaceApi*/
154
- s[22] || !/*$ready*/
155
- s[23] && !/*$enableFaceApi*/
156
- s[22], t.hidden = o = !/*showCaptureButton*/
157
- s[0], d(t, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-primary text-xl");
158
- },
159
- m(u, p) {
160
- J(u, t, p), b.m(t, null), a || (n = oe(
161
- t,
162
- "click",
163
- /*click_handler*/
164
- s[45]
165
- ), a = !0);
166
- },
167
- p(u, p) {
168
- l === (l = c(u)) && b ? b.p(u, p) : (b.d(1), b = l(u), b && (b.c(), b.m(t, null))), p[0] & /*$faceFound, $enableFaceApi, $ready*/
169
- 29360128 && i !== (i = !/*$faceFound*/
170
- u[24] && /*$enableFaceApi*/
171
- u[22] || !/*$ready*/
172
- u[23] && !/*$enableFaceApi*/
173
- u[22]) && (t.disabled = i), p[0] & /*showCaptureButton*/
174
- 1 && o !== (o = !/*showCaptureButton*/
175
- u[0]) && (t.hidden = o);
176
- },
177
- d(u) {
178
- u && Q(t), b.d(), a = !1, n();
179
- }
180
- };
181
- }
182
- function Bi(s) {
183
- let t = (
184
- /*$_*/
185
- s[25]("faceCollector.takePicture") + ""
186
- ), i;
187
- return {
188
- c() {
189
- i = V(t);
190
- },
191
- m(o, a) {
192
- J(o, i, a);
193
- },
194
- p(o, a) {
195
- a[0] & /*$_*/
196
- 33554432 && t !== (t = /*$_*/
197
- o[25]("faceCollector.takePicture") + "") && X(i, t);
198
- },
199
- d(o) {
200
- o && Q(i);
201
- }
202
- };
203
- }
204
- function Hi(s) {
205
- let t;
206
- return {
207
- c() {
208
- t = V("Take picture");
209
- },
210
- m(i, o) {
211
- J(i, t, o);
212
- },
213
- p: se,
214
- d(i) {
215
- i && Q(t);
216
- }
217
- };
218
- }
219
- function Ui(s) {
220
- let t, i;
221
- return t = new Ni({ props: { handler: (
222
- /*func*/
223
- s[55]
224
- ) } }), {
225
- c() {
226
- Se(t.$$.fragment);
227
- },
228
- m(o, a) {
229
- Te(t, o, a), i = !0;
230
- },
231
- p: se,
232
- i(o) {
233
- i || (x(t.$$.fragment, o), i = !0);
234
- },
235
- o(o) {
236
- ie(t.$$.fragment, o), i = !1;
237
- },
238
- d(o) {
239
- Fe(t, o);
240
- }
241
- };
242
- }
243
- function Vi(s) {
244
- let t, i, o, a, n, c, l, b, u;
245
- const p = [Yi, ji, qi, Ki], _ = [];
246
- function h(f, P) {
247
- return (
248
- /*$captured*/
249
- f[14] ? (
250
- /*$requestResult*/
251
- f[17] !== $e.OK ? 1 : (
252
- /*$saved*/
253
- f[18] ? 3 : 2
254
- )
255
- ) : 0
256
- );
257
- }
258
- return c = h(s), l = _[c] = p[c](s), {
259
- c() {
260
- t = w("div"), i = w("img"), n = B(), l.c(), d(i, "class", "m-auto col-start-1 col-end-1 max-h-[23.2em]"), wt(i.src, o = /*$dataTypePrefix*/
261
- s[21] + "," + /*$image*/
262
- s[20]) || d(i, "src", o), i.hidden = a = !/*$captured*/
263
- s[14] || !/*$showFaceWhileValidating*/
264
- s[27], d(i, "alt", ""), d(t, "class", b = "grid-cols-1 grid-rows-2 sm:grid-cols-2 sm:grid-rows-1 gap-[.5em] " + (/*$showFaceWhileValidating*/
265
- s[27] ? "grid m-[1em] overflow-hidden" : "absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible"));
266
- },
267
- m(f, P) {
268
- J(f, t, P), r(t, i), r(t, n), _[c].m(t, null), u = !0;
269
- },
270
- p(f, P) {
271
- (!u || P[0] & /*$dataTypePrefix, $image*/
272
- 3145728 && !wt(i.src, o = /*$dataTypePrefix*/
273
- f[21] + "," + /*$image*/
274
- f[20])) && d(i, "src", o), (!u || P[0] & /*$captured, $showFaceWhileValidating*/
275
- 134234112 && a !== (a = !/*$captured*/
276
- f[14] || !/*$showFaceWhileValidating*/
277
- f[27])) && (i.hidden = a);
278
- let C = c;
279
- c = h(f), c === C ? _[c].p(f, P) : (Ze(), ie(_[C], 1, 1, () => {
280
- _[C] = null;
281
- }), xe(), l = _[c], l ? l.p(f, P) : (l = _[c] = p[c](f), l.c()), x(l, 1), l.m(t, null)), (!u || P[0] & /*$showFaceWhileValidating*/
282
- 134217728 && b !== (b = "grid-cols-1 grid-rows-2 sm:grid-cols-2 sm:grid-rows-1 gap-[.5em] " + (/*$showFaceWhileValidating*/
283
- f[27] ? "grid m-[1em] overflow-hidden" : "absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible"))) && d(t, "class", b);
284
- },
285
- i(f) {
286
- u || (x(l), u = !0);
287
- },
288
- o(f) {
289
- ie(l), u = !1;
290
- },
291
- d(f) {
292
- f && Q(t), _[c].d();
293
- }
294
- };
295
- }
296
- function Ki(s) {
297
- let t, i, o = (
298
- /*$_*/
299
- s[25]("docCollector.captured") + ""
300
- ), a, n, c, l, b = (
301
- /*$_*/
302
- s[25]("faceCollector.retakePhoto") + ""
303
- ), u, p, _ = Ti(Fi).faceStrategy !== Oi.DISABLED, h, f, P, C = _ && Xi();
304
- return {
305
- c() {
306
- t = w("div"), i = w("h1"), a = V(o), n = B(), c = w("div"), l = w("button"), u = V(b), p = B(), C && C.c(), d(i, "class", "text-3xl font-bold pb-[1em] transition-opacity"), d(l, "id", "bry-cc-retake-button"), d(l, "class", "ce-dui-btn ce-dui-btn-block flex-shrink text-base"), d(c, "class", "flex flex-row"), vt(c, "ce-dui-btn-group", !/*$exportButtonDisabled*/
307
- s[28]);
308
- },
309
- m(v, T) {
310
- J(v, t, T), r(t, i), r(i, a), r(t, n), r(t, c), r(c, l), r(l, u), r(c, p), C && C.m(c, null), h = !0, f || (P = oe(
311
- l,
312
- "click",
313
- /*click_handler_7*/
314
- s[54]
315
- ), f = !0);
316
- },
317
- p(v, T) {
318
- (!h || T[0] & /*$_*/
319
- 33554432) && o !== (o = /*$_*/
320
- v[25]("docCollector.captured") + "") && X(a, o), (!h || T[0] & /*$_*/
321
- 33554432) && b !== (b = /*$_*/
322
- v[25]("faceCollector.retakePhoto") + "") && X(u, b), (!h || T[0] & /*$exportButtonDisabled*/
323
- 268435456) && vt(c, "ce-dui-btn-group", !/*$exportButtonDisabled*/
324
- v[28]);
325
- },
326
- i(v) {
327
- h || (x(C), h = !0);
328
- },
329
- o(v) {
330
- ie(C), h = !1;
331
- },
332
- d(v) {
333
- v && Q(t), C && C.d(), f = !1, P();
334
- }
335
- };
336
- }
337
- function qi(s) {
338
- let t, i, o = (
339
- /*$_*/
340
- s[25]("faceCollector.unconformities") + ""
341
- ), a, n, c, l, b, u = (
342
- /*$_*/
343
- s[25]("faceCollector.provideAReasonForTheLowQualityCapture") + ""
344
- ), p, _, h, f, P, C, v, T, Y = (
345
- /*$_*/
346
- s[25]("faceCollector.thisInformationIsRequired") + ""
347
- ), M, z, $, F, I, S = (
348
- /*$captured*/
349
- s[14] && Rt(s)
350
- );
351
- return {
352
- c() {
353
- t = w("div"), i = w("h1"), a = V(o), n = B(), c = w("div"), l = w("label"), b = w("span"), p = V(u), _ = B(), h = w("textarea"), P = B(), C = w("label"), v = w("span"), T = V("("), M = V(Y), z = V(")"), $ = B(), S && S.c(), d(i, "class", "text-3xl font-bold pb-[1em] transition-opacity"), d(b, "class", "ce-dui-label-text text-base"), d(l, "class", "ce-dui-label"), d(l, "for", "justification"), d(h, "contenteditable", ""), d(h, "id", "justification"), d(h, "class", "ce-dui-textarea ce-dui-textarea-bordered h-[6em] text-base"), d(h, "placeholder", f = /*$_*/
354
- s[25]("faceCollector.yourJustification")), d(v, "class", "ce-dui-label-text-alt text-base"), d(C, "class", "ce-dui-label"), d(C, "for", "justification"), d(c, "class", "ce-dui-form-control mt-[2.5em]");
355
- },
356
- m(A, D) {
357
- J(A, t, D), r(t, i), r(i, a), r(t, n), r(t, c), r(c, l), r(l, b), r(b, p), r(c, _), r(c, h), Ct(
358
- h,
359
- /*$justification*/
360
- s[19]
361
- ), r(c, P), r(c, C), r(C, v), r(v, T), r(v, M), r(v, z), r(t, $), S && S.m(t, null), F || (I = oe(
362
- h,
363
- "input",
364
- /*textarea_input_handler*/
365
- s[51]
366
- ), F = !0);
367
- },
368
- p(A, D) {
369
- D[0] & /*$_*/
370
- 33554432 && o !== (o = /*$_*/
371
- A[25]("faceCollector.unconformities") + "") && X(a, o), D[0] & /*$_*/
372
- 33554432 && u !== (u = /*$_*/
373
- A[25]("faceCollector.provideAReasonForTheLowQualityCapture") + "") && X(p, u), D[0] & /*$_*/
374
- 33554432 && f !== (f = /*$_*/
375
- A[25]("faceCollector.yourJustification")) && d(h, "placeholder", f), D[0] & /*$justification*/
376
- 524288 && Ct(
377
- h,
378
- /*$justification*/
379
- A[19]
380
- ), D[0] & /*$_*/
381
- 33554432 && Y !== (Y = /*$_*/
382
- A[25]("faceCollector.thisInformationIsRequired") + "") && X(M, Y), /*$captured*/
383
- A[14] ? S ? S.p(A, D) : (S = Rt(A), S.c(), S.m(t, null)) : S && (S.d(1), S = null);
384
- },
385
- i: se,
386
- o: se,
387
- d(A) {
388
- A && Q(t), S && S.d(), F = !1, I();
389
- }
390
- };
391
- }
392
- function ji(s) {
393
- let t, i, o = (
394
- /*$_*/
395
- s[25]("faceCollector.everythingOk") + ""
396
- ), a, n, c, l, b = (
397
- /*$_*/
398
- s[25]("faceCollector.finish") + ""
399
- ), u, p, _, h = (
400
- /*$_*/
401
- s[25]("faceCollector.retakePhoto") + ""
402
- ), f, P, C;
403
- return {
404
- c() {
405
- t = w("div"), i = w("h1"), a = V(o), n = B(), c = w("div"), l = w("button"), u = V(b), p = B(), _ = w("button"), f = V(h), d(i, "class", "text-3xl font-bold pb-[1em] transition-opacity"), l.disabled = !0, d(l, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink"), d(_, "id", "bry-cc-retake-button"), d(_, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink"), d(c, "class", "ce-dui-btn-group flex"), d(t, "class", "flex flex-col justify-between");
406
- },
407
- m(v, T) {
408
- J(v, t, T), r(t, i), r(i, a), r(t, n), r(t, c), r(c, l), r(l, u), r(c, p), r(c, _), r(_, f), P || (C = [
409
- oe(
410
- l,
411
- "click",
412
- /*click_handler_3*/
413
- s[49]
414
- ),
415
- oe(
416
- _,
417
- "click",
418
- /*click_handler_4*/
419
- s[50]
420
- )
421
- ], P = !0);
422
- },
423
- p(v, T) {
424
- T[0] & /*$_*/
425
- 33554432 && o !== (o = /*$_*/
426
- v[25]("faceCollector.everythingOk") + "") && X(a, o), T[0] & /*$_*/
427
- 33554432 && b !== (b = /*$_*/
428
- v[25]("faceCollector.finish") + "") && X(u, b), T[0] & /*$_*/
429
- 33554432 && h !== (h = /*$_*/
430
- v[25]("faceCollector.retakePhoto") + "") && X(f, h);
431
- },
432
- i: se,
433
- o: se,
434
- d(v) {
435
- v && Q(t), P = !1, Oe(C);
436
- }
437
- };
438
- }
439
- function Yi(s) {
440
- let t;
441
- return {
442
- c() {
443
- t = w("div"), d(t, "class", "");
444
- },
445
- m(i, o) {
446
- J(i, t, o);
447
- },
448
- p: se,
449
- i: se,
450
- o: se,
451
- d(i) {
452
- i && Q(t);
453
- }
454
- };
455
- }
456
- function Xi(s) {
457
- let t, i;
458
- return t = new Ii({
459
- props: { cssClass: "ce-dui-btn-block flex-shrink" }
460
- }), {
461
- c() {
462
- Se(t.$$.fragment);
463
- },
464
- m(o, a) {
465
- Te(t, o, a), i = !0;
466
- },
467
- i(o) {
468
- i || (x(t.$$.fragment, o), i = !0);
469
- },
470
- o(o) {
471
- ie(t.$$.fragment, o), i = !1;
472
- },
473
- d(o) {
474
- Fe(t, o);
475
- }
476
- };
477
- }
478
- function Rt(s) {
479
- let t, i, o = (
480
- /*$_*/
481
- s[25]("faceCollector.finish") + ""
482
- ), a, n, c, l, b = (
483
- /*$_*/
484
- s[25]("faceCollector.retakePhoto") + ""
485
- ), u, p, _;
486
- return {
487
- c() {
488
- t = w("div"), i = w("button"), a = V(o), c = B(), l = w("button"), u = V(b), i.disabled = n = /*$justification*/
489
- s[19].length === 0, d(i, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink text-base"), d(l, "id", "bry-cc-retake-button"), d(l, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink text-base"), d(t, "class", "ce-dui-btn-group flex");
490
- },
491
- m(h, f) {
492
- J(h, t, f), r(t, i), r(i, a), r(t, c), r(t, l), r(l, u), p || (_ = [
493
- oe(
494
- i,
495
- "click",
496
- /*click_handler_5*/
497
- s[52]
498
- ),
499
- oe(
500
- l,
501
- "click",
502
- /*click_handler_6*/
503
- s[53]
504
- )
505
- ], p = !0);
506
- },
507
- p(h, f) {
508
- f[0] & /*$_*/
509
- 33554432 && o !== (o = /*$_*/
510
- h[25]("faceCollector.finish") + "") && X(a, o), f[0] & /*$justification*/
511
- 524288 && n !== (n = /*$justification*/
512
- h[19].length === 0) && (i.disabled = n), f[0] & /*$_*/
513
- 33554432 && b !== (b = /*$_*/
514
- h[25]("faceCollector.retakePhoto") + "") && X(u, b);
515
- },
516
- d(h) {
517
- h && Q(t), p = !1, Oe(_);
518
- }
519
- };
520
- }
521
- function Ji(s) {
522
- let t, i, o, a, n = (
523
- /*unique*/
524
- s[8]
525
- ), c, l, b, u, p, _, h, f, P, C, v, T, Y, M, z, $, F, I, S, A = kt(s), D = (
526
- /*showConfigButton*/
527
- s[2] && yt()
528
- );
529
- b = new Li({ props: { className: "bottom-0" } });
530
- let H = (
531
- /*isCountingDown*/
532
- s[7] && Et(s)
533
- ), K = (
534
- /*$enableFaceApi*/
535
- s[22] && !/*isCountingDown*/
536
- s[7] && /*$faceFound*/
537
- s[24] && !/*$faceValidated*/
538
- s[15] && Dt(s)
539
- );
540
- function fe(m, q) {
541
- return (
542
- /*$captured*/
543
- m[14] ? Wi : Mi
544
- );
545
- }
546
- let le = fe(s), G = le(s);
547
- const k = [Vi, Ui], W = [];
548
- function ee(m, q) {
549
- return (
550
- /*showUnconformities*/
551
- m[1] && (!/*idrndClosed*/
552
- m[11] || /*$captured*/
553
- m[14]) ? 0 : (
554
- /*$cameraStatusStore*/
555
- m[12] !== j.OK ? 1 : -1
556
- )
557
- );
558
- }
559
- return ~(F = ee(s)) && (I = W[F] = k[F](s)), {
560
- c() {
561
- t = w("div"), i = w("div"), o = w("div"), a = w("div"), A.c(), c = B(), D && D.c(), l = B(), Se(b.$$.fragment), u = B(), p = w("canvas"), _ = B(), h = w("canvas"), f = B(), P = w("canvas"), C = B(), H && H.c(), v = B(), K && K.c(), Y = B(), M = w("div"), G.c(), $ = B(), I && I.c(), this.c = se, d(p, "id", "bry-ce-displayCanvas"), d(p, "class", "max-w-full"), d(h, "id", "bry-ce-detectionsCanvas"), d(h, "class", "absolute top-0 left-0 max-w-full"), d(P, "id", "bry-ce-maskCanvas"), d(P, "class", "absolute top-0 left-0 max-w-full"), d(a, "class", "relative"), a.hidden = T = /*$cameraStatusStore*/
562
- s[12] !== j.OK, d(M, "class", "px-4 sm:px-0 mt-[1em]"), M.hidden = z = !/*showCaptureButton*/
563
- s[0], d(o, "class", "relative mx-auto"), d(i, "class", "flex flex-col justify-between");
564
- },
565
- m(m, q) {
566
- J(m, t, q), r(t, i), r(i, o), r(o, a), A.m(a, null), r(a, c), D && D.m(a, null), r(a, l), Te(b, a, null), r(a, u), r(a, p), s[42](p), r(a, _), r(a, h), s[43](h), r(a, f), r(a, P), s[44](P), r(a, C), H && H.m(a, null), r(a, v), K && K.m(a, null), r(o, Y), r(o, M), G.m(M, null), s[48](i), r(t, $), ~F && W[F].m(t, null), S = !0;
567
- },
568
- p(m, q) {
569
- q[0] & /*unique*/
570
- 256 && At(n, n = /*unique*/
571
- m[8]) ? (A.d(1), A = kt(m), A.c(), A.m(a, c)) : A.p(m, q), /*showConfigButton*/
572
- m[2] ? D ? q[0] & /*showConfigButton*/
573
- 4 && x(D, 1) : (D = yt(), D.c(), x(D, 1), D.m(a, l)) : D && (Ze(), ie(D, 1, 1, () => {
574
- D = null;
575
- }), xe()), /*isCountingDown*/
576
- m[7] ? H ? H.p(m, q) : (H = Et(m), H.c(), H.m(a, v)) : H && (H.d(1), H = null), /*$enableFaceApi*/
577
- m[22] && !/*isCountingDown*/
578
- m[7] && /*$faceFound*/
579
- m[24] && !/*$faceValidated*/
580
- m[15] ? K ? K.p(m, q) : (K = Dt(m), K.c(), K.m(a, null)) : K && (K.d(1), K = null), (!S || q[0] & /*$cameraStatusStore*/
581
- 4096 && T !== (T = /*$cameraStatusStore*/
582
- m[12] !== j.OK)) && (a.hidden = T), le === (le = fe(m)) && G ? G.p(m, q) : (G.d(1), G = le(m), G && (G.c(), G.m(M, null))), (!S || q[0] & /*showCaptureButton*/
583
- 1 && z !== (z = !/*showCaptureButton*/
584
- m[0])) && (M.hidden = z);
585
- let re = F;
586
- F = ee(m), F === re ? ~F && W[F].p(m, q) : (I && (Ze(), ie(W[re], 1, 1, () => {
587
- W[re] = null;
588
- }), xe()), ~F ? (I = W[F], I ? I.p(m, q) : (I = W[F] = k[F](m), I.c()), x(I, 1), I.m(t, null)) : I = null);
589
- },
590
- i(m) {
591
- S || (x(D), x(b.$$.fragment, m), x(I), S = !0);
592
- },
593
- o(m) {
594
- ie(D), ie(b.$$.fragment, m), ie(I), S = !1;
595
- },
596
- d(m) {
597
- m && Q(t), A.d(m), D && D.d(), Fe(b), s[42](null), s[43](null), s[44](null), H && H.d(), K && K.d(), G.d(), s[48](null), ~F && W[F].d();
598
- }
599
- };
600
- }
601
- let Qi = !1, zi = 5;
602
- function Pt(s, t, i) {
603
- const o = t.videoHeight >= t.videoWidth && i.height >= i.width || t.videoHeight < t.videoWidth && i.height < i.width;
604
- s.drawImage(
605
- t,
606
- o ? 0 : t.videoWidth / 2 - i.width,
607
- 0,
608
- o ? t.videoWidth : t.videoHeight * (i.width / i.height),
609
- t.videoHeight,
610
- 0,
611
- 0,
612
- i.width,
613
- i.height
614
- );
615
- }
616
- function Gi(s, t, i) {
617
- let o, a, n, c, l, b, u, p, _, h, f, P, C, v, T, Y, M, z, $, F, I, S, A, D, H, K, fe, le, G;
618
- R(s, Ke, (e) => i(65, o = e)), R(s, Z, (e) => i(12, n = e)), R(s, _e, (e) => i(67, c = e)), R(s, de, (e) => i(13, l = e)), R(s, ri, (e) => i(68, b = e)), R(s, De, (e) => i(69, u = e)), R(s, ci, (e) => i(70, p = e)), R(s, pe, (e) => i(14, _ = e)), R(s, qe, (e) => i(71, h = e)), R(s, ut, (e) => i(72, f = e)), R(s, ui, (e) => i(73, P = e)), R(s, je, (e) => i(15, C = e)), R(s, dt, (e) => i(16, v = e)), R(s, Ye, (e) => i(74, T = e)), R(s, Xe, (e) => i(17, Y = e)), R(s, Re, (e) => i(18, M = e)), R(s, ft, (e) => i(19, z = e)), R(s, ht, (e) => i(20, $ = e)), R(s, bt, (e) => i(75, I = e)), R(s, di, (e) => i(22, S = e)), R(s, Pe, (e) => i(23, A = e)), R(s, Je, (e) => i(76, D = e)), R(s, mt, (e) => i(24, H = e)), R(s, fi, (e) => i(25, K = e)), R(s, hi, (e) => i(26, fe = e)), R(s, bi, (e) => i(27, le = e)), R(s, mi, (e) => i(28, G = e));
619
- let k, W, ee, m = !1, q = {}, re = !1, { enableMinutiae: Ie } = t, { videoDimensions: Le } = t, { noTabs: Ne } = t, { weightsPath: We } = t, { showCaptureButton: et } = t, { showUnconformities: tt } = t, { videoFilter: he } = t, { showConfigButton: it } = t;
620
- const ke = pt(!1);
621
- R(s, ke, (e) => i(66, a = e));
622
- const Me = pt("data:image/png;base64");
623
- R(s, Me, (e) => i(21, F = e));
624
- let ne, L, st = !1, be = !0, ot = 0, Be = 0, He = !0, Ue = 0, Ve = !1, y = {
625
- topLeftX: 130,
626
- topLeftY: 70,
627
- width: 540,
628
- height: 400
629
- };
630
- gi.mixin({
631
- toast: !0,
632
- position: "bottom-left",
633
- timer: 13e3,
634
- timerProgressBar: !0
635
- }), _i(async () => {
636
- g(Pe, A = !1, A), g(mt, H = !1, H), g(pe, _ = !1, _), g(De, u = Qe.REAR_CAMERA, u), g(Z, n = j.OK, n), await Ee(), S && (await pi(We), re = !0), Tt();
637
- });
638
- function St() {
639
- const e = l.videoWidth, O = l.videoHeight, N = O * 0.75, E = N * 1.36;
640
- y.topLeftX = (e - E) / 2, y.topLeftY = (O - N) / 1.42, y.width = E, y.height = N;
641
- }
642
- function at(e, O) {
643
- e.clearRect(0, 0, L.width, L.height), e.save(), St(), he == "blur" ? (e.filter = `blur(${O.width / 60}px)`, e.rect(0, 0, L.width, L.height)) : he != "none" ? (e.fillStyle = he, e.fillRect(0, 0, L.width, L.height)) : (e.beginPath(), e.rect(0, 0, L.width, L.height)), e.rect(y.topLeftX, y.topLeftY, y.width, y.height), e.clip(), Pt(e, O, L), e.restore(), e.save(), e.beginPath();
644
- const N = window.getComputedStyle(L).getPropertyValue("--p"), E = window.getComputedStyle(L).getPropertyValue("--su");
645
- if (e.strokeStyle = `hsl(${N})`, e.lineWidth = 16, e.rect(y.topLeftX, y.topLeftY, y.width, y.height), e.stroke(), m && !Ve) {
646
- const te = 1 - (Ue - (/* @__PURE__ */ new Date()).getTime()) / 4500;
647
- e.save(), e.beginPath(), e.lineWidth = 16, e.strokeStyle = `hsl(${E})`;
648
- const ue = y.width * 3 * te, ct = y.height * 2 * te, si = ue < y.width ? ue : y.width, oi = ct < y.height ? ct : y.height;
649
- e.rect(y.topLeftX, y.topLeftY, si, oi), e.stroke();
650
- }
651
- e.beginPath();
652
- const U = new Path2D();
653
- U.rect(y.topLeftX, y.topLeftY, y.width, y.height), e.clip(U), Pt(e, O, L), e.restore();
654
- }
655
- function lt() {
656
- g(Z, n = j.OK, n), st = !0, i(11, be = !1);
657
- }
658
- async function me() {
659
- if (S && !re)
660
- return ve(k, me);
661
- if (k) {
662
- if (D !== Ge.Document && !Ne)
663
- return ve(k, me);
664
- g(Pe, A = !0, A), S ? (a || g(ke, a = !0, a), at(L.getContext("2d"), k), ve(k, me)) : (at(L.getContext("2d"), k), ve(k, me));
665
- }
666
- }
667
- async function nt() {
668
- I && (_t(), g(bt, I = !1, I)), g(Xe, Y = $e.OK, Y), g(pe, _ = !0, _), g(Re, M = !0, M);
669
- const e = document.createElement("canvas"), O = e.getContext("2d");
670
- e.width = y.width, e.height = y.height, O?.drawImage(k, y.topLeftX, y.topLeftY, y.width, y.height, 0, 0, e.width, e.height);
671
- const N = e.toDataURL("image/jpeg").split(",");
672
- g(Me, F = N[0], F), g(ht, $ = N[1], $), g(Ye, T = N[1], T);
673
- const E = [{ data: T }];
674
- window.dispatchEvent(new CustomEvent(
675
- "document-unconformities-validated",
676
- {
677
- detail: { bodyParts: E, status: Y }
678
- }
679
- ));
680
- }
681
- function ye() {
682
- const e = {
683
- bodyPart: "DOCUMENT",
684
- data: $,
685
- justification: z
686
- };
687
- g(Re, M = !0, M), window.dispatchEvent(new CustomEvent("export-document", { detail: e }));
688
- }
689
- function ce() {
690
- window.dispatchEvent(new CustomEvent("document-scrapped")), g(Re, M = !1, M), g(Xe, Y = $e.OK, Y), g(pe, _ = !1, _), g(Ye, T = "", T), g(dt, v = "", v), g(je, C = !0, C), be && lt();
691
- }
692
- async function Ee(e) {
693
- const [O, N] = (Le ?? "")?.replaceAll(" ", "")?.split("x")?.map((E) => E ? parseInt(E) : void 0);
694
- if (!(!O || !N)) {
695
- g(de, l = { videoWidth: O, videoHeight: N }, l);
696
- try {
697
- if (n == j.CAMERA_ORIENTATION_LANDSCAPE || f?.active)
698
- return;
699
- const { deviceId: E, width: U, height: te, aspectRatio: ue } = await wi(O, N, u, e);
700
- ue && ue < 1 && ze() ? g(
701
- de,
702
- l = {
703
- videoWidth: te,
704
- videoHeight: U
705
- },
706
- l
707
- ) : g(
708
- de,
709
- l = {
710
- videoWidth: U,
711
- videoHeight: te
712
- },
713
- l
714
- ), g(_e, c = E || p[0].deviceId, c), g(Z, n = j.OK, n);
715
- } catch (E) {
716
- const U = E;
717
- i(11, be = !0);
718
- const te = Ae(E) && E.constraint ? E.constraint : "";
719
- console.error(U, te), Ae(U) && "message" in U && U.message.includes("Permission denied") && (console.error("User didn't give permission to use camera!"), g(Z, n = j.CAMERA_DENIED_ERROR, n)), Ae(U) && "message" in U && U.message.includes("Requested device not found") && g(Z, n = j.DEVICE_NOT_FOUND_ERROR, n), (te.includes("width") || te.includes("height")) && (console.error(`Camera does not meet the minimum supported requirements! (${te})`), g(Z, n = j.CAMERA_UNSUPPORTED, n));
720
- }
721
- }
722
- }
723
- async function ge() {
724
- g(_e, c = "", c), await Ee();
725
- }
726
- function Tt() {
727
- navigator.mediaDevices.ondevicechange = async (e) => {
728
- await gt(), n !== j.OK ? await ge() : f.active || (we(), g(Z, n = j.DEVICE_NOT_FOUND_ERROR, n));
729
- };
730
- }
731
- const Ft = de.subscribe((e) => {
732
- k && W && (i(4, k.width = e.videoWidth, k), i(4, k.height = e.videoHeight, k), i(5, W.width = e.videoWidth, W), i(5, W.height = e.videoHeight, W), i(9, ne.width = e.videoWidth, ne), i(9, ne.height = e.videoHeight, ne), i(10, L.width = e.videoWidth, L), i(10, L.height = e.videoHeight, L));
733
- }), Ot = vi.subscribe((e) => {
734
- if (b != "DOCUMENT")
735
- return;
736
- let O = "", N = !1;
737
- if (e.isPersonCloseEnough ? e.isPersonTooclose ? O = "docCollector.moveAwayCamera" : e.isPersonInFrame ? N = !0 : O = "docCollector.stayInFrame" : O = "docCollector.comeCloserCamera", Ci(N, O), !_ && P && !m && e.isPersonInFrame && !(!e.isPersonCloseEnough || e.isPersonTooclose)) {
738
- i(7, m = !0), g(je, C = !0, C), Ue = (/* @__PURE__ */ new Date()).getTime() + 4500;
739
- const E = setInterval(
740
- () => {
741
- if (!P || _ || !e.isPersonCloseEnough || e.isPersonTooclose || !e.isPersonInFrame) {
742
- i(7, m = !1), Ve = !0, setTimeout(
743
- () => {
744
- Ve = !1;
745
- },
746
- 1500
747
- ), clearInterval(E);
748
- return;
749
- }
750
- const U = (/* @__PURE__ */ new Date()).getTime();
751
- Math.floor((Ue - U) % (1e3 * 60) / 1e3) <= 0 && (clearInterval(E), i(7, m = !1), document.getElementsByTagName("biometric-collector")?.[0]?.shadowRoot?.getElementById("bry-cc-capture-btn")?.click());
752
- },
753
- 250
754
- );
755
- }
756
- }), It = pe.subscribe((e) => {
757
- ee && (e ? (ee.classList.remove("flex"), ee.classList.add("hidden")) : (ee.classList.add("flex"), ee.classList.remove("hidden")));
758
- }), Lt = qe.subscribe((e) => {
759
- k && e && (console.log("setting null in video srcObject"), i(4, k.srcObject = null, k), i(4, k.src = "", k));
760
- });
761
- Je.subscribe(async (e) => {
762
- e === Ge.Document && await gt();
763
- });
764
- const Nt = _e.subscribe(async (e) => {
765
- if (!e)
766
- return;
767
- k || i(8, q = {});
768
- const { videoHeight: O, videoWidth: N } = l;
769
- try {
770
- const E = await ki(N, O, e);
771
- i(4, k.srcObject = E, k), g(ut, f = E, f), g(qe, h = !1, h), He || (g(Z, n = j.CAMERA_ORIENTATION_LANDSCAPE, n), we());
772
- } catch (E) {
773
- const U = E;
774
- i(11, be = !0), Ae(U) && "message" in U && U.message.includes("Requested device not found") && g(Z, n = j.DEVICE_NOT_FOUND_ERROR, n);
775
- }
776
- }), Wt = Je.subscribe(async (e) => {
777
- e === Ge.Document && !st && !_ && Qi && await lt();
778
- }), Mt = ke.subscribe(async (e) => {
779
- e && rt();
780
- }), Bt = Pe.subscribe((e) => {
781
- e && window.dispatchEvent(new CustomEvent("brycc-camera-ready"));
782
- }), Ht = yi.subscribe(async (e) => {
783
- if (l) {
784
- if (we(), !ze()) {
785
- const O = p.find((E) => E.deviceId !== c), N = O ? O.deviceId : p[0].deviceId;
786
- await Ee(N);
787
- return;
788
- }
789
- e ? (g(De, u = Qe.FRONT_CAMERA, u), await ge()) : (g(De, u = Qe.REAR_CAMERA, u), await ge());
790
- }
791
- }), Ut = Ei.subscribe(async (e) => {
792
- !e.isSupported || !ze() || b != "DOCUMENT" || (He = e.orientation.includes("landscape"), He ? (g(Z, n = j.OK, n), l && (g(_e, c = "", c), await Ee())) : (g(Z, n = j.CAMERA_ORIENTATION_LANDSCAPE, n), we()));
793
- });
794
- async function rt() {
795
- let e;
796
- if (Be >= zi) {
797
- Be = 0;
798
- const O = await Ai(), N = await import("./face_api_0e3ce8c8_2.2.7.js");
799
- let E;
800
- E = N.detectSingleFace(L, O), e = await E.withFaceLandmarks(), W.getContext("2d")?.clearRect(0, 0, W.width, W.height);
801
- } else
802
- Be++;
803
- e ? Si(e, W, Ie, !0) : Di(), a && ve(k, rt);
804
- }
805
- Ke.subscribe(async (e) => {
806
- e && (ce(), g(Ke, o = !1, o));
807
- }), Ri(() => {
808
- we(), It(), Ot(), Ft(), Lt(), Nt(), Wt(), clearInterval(ot), Mt(), Ht(), Bt(), Ut(), _t(), ot = 0;
809
- });
810
- function Vt(e) {
811
- Ce[e ? "unshift" : "push"](() => {
812
- k = e, i(4, k);
813
- });
814
- }
815
- const Kt = () => {
816
- g(
817
- de,
818
- l = {
819
- videoHeight: k.videoHeight,
820
- videoWidth: k.videoWidth
821
- },
822
- l
823
- );
824
- };
825
- function qt(e) {
826
- Ce[e ? "unshift" : "push"](() => {
827
- L = e, i(10, L);
828
- });
829
- }
830
- function jt(e) {
831
- Ce[e ? "unshift" : "push"](() => {
832
- W = e, i(5, W);
833
- });
834
- }
835
- function Yt(e) {
836
- Ce[e ? "unshift" : "push"](() => {
837
- ne = e, i(9, ne);
838
- });
839
- }
840
- const Xt = () => nt(), Jt = () => ye(), Qt = () => ce();
841
- function zt(e) {
842
- Ce[e ? "unshift" : "push"](() => {
843
- ee = e, i(6, ee);
844
- });
845
- }
846
- const Gt = () => ye(), Zt = () => ce();
847
- function xt() {
848
- z = this.value, ft.set(z);
849
- }
850
- const $t = () => ye(), ei = () => ce(), ti = () => ce(), ii = async () => {
851
- await ge();
852
- };
853
- return s.$$set = (e) => {
854
- "enableMinutiae" in e && i(35, Ie = e.enableMinutiae), "videoDimensions" in e && i(36, Le = e.videoDimensions), "noTabs" in e && i(37, Ne = e.noTabs), "weightsPath" in e && i(38, We = e.weightsPath), "showCaptureButton" in e && i(0, et = e.showCaptureButton), "showUnconformities" in e && i(1, tt = e.showUnconformities), "videoFilter" in e && i(39, he = e.videoFilter), "showConfigButton" in e && i(2, it = e.showConfigButton);
855
- }, [
856
- et,
857
- tt,
858
- it,
859
- me,
860
- k,
861
- W,
862
- ee,
863
- m,
864
- q,
865
- ne,
866
- L,
867
- be,
868
- n,
869
- l,
870
- _,
871
- C,
872
- v,
873
- Y,
874
- M,
875
- z,
876
- $,
877
- F,
878
- S,
879
- A,
880
- H,
881
- K,
882
- fe,
883
- le,
884
- G,
885
- ke,
886
- Me,
887
- nt,
888
- ye,
889
- ce,
890
- ge,
891
- Ie,
892
- Le,
893
- Ne,
894
- We,
895
- he,
896
- Vt,
897
- Kt,
898
- qt,
899
- jt,
900
- Yt,
901
- Xt,
902
- Jt,
903
- Qt,
904
- zt,
905
- Gt,
906
- Zt,
907
- xt,
908
- $t,
909
- ei,
910
- ti,
911
- ii
912
- ];
913
- }
914
- class Zi extends ai {
915
- constructor(t) {
916
- super(), li(
917
- this,
918
- {
919
- target: this.shadowRoot,
920
- props: ni(this.attributes),
921
- customElement: !0
922
- },
923
- Gi,
924
- Ji,
925
- At,
926
- {
927
- enableMinutiae: 35,
928
- videoDimensions: 36,
929
- noTabs: 37,
930
- weightsPath: 38,
931
- showCaptureButton: 0,
932
- showUnconformities: 1,
933
- videoFilter: 39,
934
- showConfigButton: 2,
935
- play: 3
936
- },
937
- null,
938
- [-1, -1, -1, -1]
939
- ), t && (t.target && J(t.target, this, t.anchor), t.props && (this.$set(t.props), ae()));
940
- }
941
- static get observedAttributes() {
942
- return [
943
- "enableMinutiae",
944
- "videoDimensions",
945
- "noTabs",
946
- "weightsPath",
947
- "showCaptureButton",
948
- "showUnconformities",
949
- "videoFilter",
950
- "showConfigButton",
951
- "play"
952
- ];
953
- }
954
- get enableMinutiae() {
955
- return this.$$.ctx[35];
956
- }
957
- set enableMinutiae(t) {
958
- this.$$set({ enableMinutiae: t }), ae();
959
- }
960
- get videoDimensions() {
961
- return this.$$.ctx[36];
962
- }
963
- set videoDimensions(t) {
964
- this.$$set({ videoDimensions: t }), ae();
965
- }
966
- get noTabs() {
967
- return this.$$.ctx[37];
968
- }
969
- set noTabs(t) {
970
- this.$$set({ noTabs: t }), ae();
971
- }
972
- get weightsPath() {
973
- return this.$$.ctx[38];
974
- }
975
- set weightsPath(t) {
976
- this.$$set({ weightsPath: t }), ae();
977
- }
978
- get showCaptureButton() {
979
- return this.$$.ctx[0];
980
- }
981
- set showCaptureButton(t) {
982
- this.$$set({ showCaptureButton: t }), ae();
983
- }
984
- get showUnconformities() {
985
- return this.$$.ctx[1];
986
- }
987
- set showUnconformities(t) {
988
- this.$$set({ showUnconformities: t }), ae();
989
- }
990
- get videoFilter() {
991
- return this.$$.ctx[39];
992
- }
993
- set videoFilter(t) {
994
- this.$$set({ videoFilter: t }), ae();
995
- }
996
- get showConfigButton() {
997
- return this.$$.ctx[2];
998
- }
999
- set showConfigButton(t) {
1000
- this.$$set({ showConfigButton: t }), ae();
1001
- }
1002
- get play() {
1003
- return this.$$.ctx[3];
1004
- }
1005
- }
1006
- customElements.define("document-collector", Zi);
1007
- export {
1008
- Zi as default
1009
- };