bry-biometric-collector
Version:
BRy web-collector component for biometric capture.
1,232 lines (1,231 loc) • 42.6 kB
JavaScript
import { S as ot, x as rt, y as lt, z as ct, B as z, C as j, D, bm as se, E as Y, G as f, b8 as ne, bn as zt, X as w, H as S, I as M, bo as q, bp as Ci, J as oe, N as H, Z as $, V as Ae, _ as ee, a0 as E, a1 as Oe, a2 as L, a3 as Ne, a4 as te, K as X, aB as v, M as F, O as Mi, a6 as Ve, a7 as Ie, Q as G, T as we, a8 as Di, a9 as ye, ab as _i, aa as ue, ac as Ce, a5 as Je, ad as xe, ae as jt, ah as Me, ak as Ke, al as pi, am as Rt, an as De, $ as Ti, ag as qe, ap as Wt, as as $e, R as Ai, ax as Oi, aA as Ni, f as Et, aD as ki, aG as et, aH as re, m as zi, aI as tt, aV as St, e as _e, l as pe, aW as Zt, aX as it, aY as ji, aM as at, aZ as Pt, a_ as Ri, a$ as Wi, b0 as Ei, aE as Si, b1 as Zi, bq as Pi, b3 as Fi, d as Ft, b4 as Te, b5 as Hi, b7 as Li, b9 as le, ba as ut, W as Ui, U as V, Y as J, w as Ht, aF as Bi, br as Gi, be as st, bs as Yi } from "./main_8f1a8854_3.3.6.js";
import { W as Qi, V as Xi, C as Vi } from "./ValidationAlert_452e8b93_3.3.6.js";
import { matchDimensions as Ji, resizeResults as xi } from "./face_api_d3d25326_3.3.6.js";
import { C as Ki } from "./CaptureBar_66e29ad8_3.3.6.js";
const qi = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwNiIgaGVpZ2h0PSI4OTAiIHZpZXdCb3g9IjAgMCAxMjA2IDg5MCIgZmlsbD0ibm9uZSIgb3BhY2l0eT0iMC4yIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPGcgZmlsdGVyPSJ1cmwoI2ZpbHRlcjBfZF8xOF80KSIgb3BhY2l0eT0iMCI+CiAgICA8bWFzayBpZD0icGF0aC0xLWluc2lkZS0xXzE4XzQiIGZpbGw9IndoaXRlIj4KICAgIDxyZWN0IHg9IjQiIHdpZHRoPSIxMTk4IiBoZWlnaHQ9Ijg4MiIgcng9IjYiLz4KICAgIDwvbWFzaz4KICAgIDxyZWN0IHg9IjQiIHdpZHRoPSIxMTk4IiBoZWlnaHQ9Ijg4MiIgcng9IjYiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS1vcGFjaXR5PSIwLjkiIHN0cm9rZS13aWR0aD0iMTYiIHNoYXBlLXJlbmRlcmluZz0iY3Jpc3BFZGdlcyIgbWFzaz0idXJsKCNwYXRoLTEtaW5zaWRlLTFfMThfNCkiLz4KICAgIDwvZz4KICAgIDxtYXNrIGlkPSJwYXRoLTItaW5zaWRlLTJfMThfNCIgZmlsbD0id2hpdGUiPgogICAgPHJlY3QgeD0iMjE5LjI3OCIgeT0iMjk2IiB3aWR0aD0iMzM4Ljg2MyIgaGVpZ2h0PSI0NjgiIHJ4PSI3Ii8+CiAgICA8L21hc2s+CiAgICA8cmVjdCB4PSIyMTkuMjc4IiB5PSIyOTYiIHdpZHRoPSIzMzguODYzIiBoZWlnaHQ9IjQ2OCIgcng9IjciIHN0cm9rZT0id2hpdGUiIHN0cm9rZS1vcGFjaXR5PSIwLjkiIHN0cm9rZS13aWR0aD0iMTYiIG1hc2s9InVybCgjcGF0aC0yLWluc2lkZS0yXzE4XzQpIi8+CiAgICA8ZWxsaXBzZSBjeD0iMzg5LjIzOCIgY3k9IjUxMS4yMjgiIHJ4PSI4Ni4yMzc2IiByeT0iODUuMjI4NCIgZmlsbD0id2hpdGUiIGZpbGwtb3BhY2l0eT0iMC4wOCIvPgogICAgPHBhdGggZD0iTTQ3MS40NzUgNTExLjIyOEM0NzEuNDc1IDU1Ni4wNDUgNDM0LjcwMSA1OTIuNDU3IDM4OS4yMzggNTkyLjQ1N0MzNDMuNzc0IDU5Mi40NTcgMzA3IDU1Ni4wNDUgMzA3IDUxMS4yMjhDMzA3IDQ2Ni40MTEgMzQzLjc3NCA0MzAgMzg5LjIzOCA0MzBDNDM0LjcwMSA0MzAgNDcxLjQ3NSA0NjYuNDExIDQ3MS40NzUgNTExLjIyOFoiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS1vcGFjaXR5PSIwLjkiIHN0cm9rZS13aWR0aD0iOCIvPgogICAgPHBhdGggZD0iTTM4Ny4zOCA2MDhDNTM1LjI2IDYwOCA1MzkuODggNzQzLjQ3MyA1MzkuODggNzQzLjQ3M0wyMzkgNzQzLjVDMjM5IDc0My41IDIzOS41IDYwOCAzODcuMzggNjA4WiIgZmlsbD0id2hpdGUiIGZpbGwtb3BhY2l0eT0iMC4wOCIvPgogICAgPHBhdGggZD0iTTM4Ny4zOCA2MTJDNDU5Ljc5NCA2MTIgNDk2LjY0OSA2NDUuMDIgNTE1LjYyNSA2NzcuNzQzQzUyNS4xOCA2OTQuMjIgNTMwLjI1NSA3MTAuNzMzIDUzMi45MzggNzIzLjE1QzUzNC4yNzggNzI5LjM1MSA1MzUuMDE2IDczNC41MDggNTM1LjQxOCA3MzguMDk4QzUzNS40NzMgNzM4LjU4NiA1MzUuNTIxIDczOS4wNDUgNTM1LjU2NCA3MzkuNDc0TDI0My4xODQgNzM5LjVDMjQzLjIxNiA3MzkuMDM3IDI0My4yNTMgNzM4LjUzOCAyNDMuMjk3IDczOC4wMDNDMjQzLjU5IDczNC40MTQgMjQ0LjE3MSA3MjkuMjU4IDI0NS4zMjIgNzIzLjA1OEMyNDcuNjI2IDcxMC42NDIgMjUyLjE5NyA2OTQuMTM4IDI2MS4yNDEgNjc3LjY3NkMyNzAuMjczIDY2MS4yMzYgMjgzLjc0OCA2NDQuODY0IDMwMy44OTEgNjMyLjU4N0MzMjQuMDI0IDYyMC4zMTYgMzUxLjA0MiA2MTIgMzg3LjM4IDYxMloiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS1vcGFjaXR5PSIwLjkiIHN0cm9rZS13aWR0aD0iOCIvPgogICAgPGRlZnM+CiAgICA8ZmlsdGVyIGlkPSJmaWx0ZXIwX2RfMThfNCIgeD0iMCIgeT0iMCIgd2lkdGg9IjEyMDYiIGhlaWdodD0iODkwIiBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiI+CiAgICA8ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPgogICAgPGZlQ29sb3JNYXRyaXggaW49IlNvdXJjZUFscGhhIiB0eXBlPSJtYXRyaXgiIHZhbHVlcz0iMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMTI3IDAiIHJlc3VsdD0iaGFyZEFscGhhIi8+CiAgICA8ZmVPZmZzZXQgZHk9IjQiLz4KICAgIDxmZUdhdXNzaWFuQmx1ciBzdGREZXZpYXRpb249IjIiLz4KICAgIDxmZUNvbXBvc2l0ZSBpbjI9ImhhcmRBbHBoYSIgb3BlcmF0b3I9Im91dCIvPgogICAgPGZlQ29sb3JNYXRyaXggdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMjUgMCIvPgogICAgPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJlZmZlY3QxX2Ryb3BTaGFkb3dfMThfNCIvPgogICAgPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJlZmZlY3QxX2Ryb3BTaGFkb3dfMThfNCIgcmVzdWx0PSJzaGFwZSIvPgogICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8L3N2Zz4KICAgIA==";
function $i(a) {
let e, t, s, n, r, o, g, h, d, l, u;
return {
c() {
e = D("div"), t = se("svg"), s = se("defs"), n = se("mask"), r = se("rect"), o = se("rect"), u = se("rect"), this.c = Y, f(r, "width", "100%"), f(r, "height", "100%"), f(r, "fill", "white"), f(o, "id", "transparent-rect"), f(o, "x", g = "calc((100% - " + /*$docDimensions*/
a[2].width + "px) / 2)"), f(o, "y", h = "calc(" + /*y*/
a[3] + ")"), f(o, "width", d = /*$docDimensions*/
a[2].width), f(o, "height", l = /*$docDimensions*/
a[2].height), f(o, "fill", "black"), f(n, "id", "transparentAreaMask"), f(u, "width", "100%"), f(u, "height", "100%"), ne(u, "fill", "rgba(" + zt(
/*videoOverlay*/
a[0]
) + ", " + (1 - /*videoOverlayTransparency*/
a[1] / 100) + ")"), f(u, "mask", "url(#transparentAreaMask)"), f(t, "class", "absolute w-full h-full"), f(t, "xmlns", "http://www.w3.org/2000/svg"), f(e, "id", "overlay-container"), f(e, "class", "flex items-center justify-center absolute inset-0");
},
m(c, b) {
z(c, e, b), w(e, t), w(t, s), w(s, n), w(n, r), w(n, o), w(t, u);
},
p(c, [b]) {
b & /*$docDimensions*/
4 && g !== (g = "calc((100% - " + /*$docDimensions*/
c[2].width + "px) / 2)") && f(o, "x", g), b & /*y*/
8 && h !== (h = "calc(" + /*y*/
c[3] + ")") && f(o, "y", h), b & /*$docDimensions*/
4 && d !== (d = /*$docDimensions*/
c[2].width) && f(o, "width", d), b & /*$docDimensions*/
4 && l !== (l = /*$docDimensions*/
c[2].height) && f(o, "height", l), b & /*videoOverlay, videoOverlayTransparency*/
3 && ne(u, "fill", "rgba(" + zt(
/*videoOverlay*/
c[0]
) + ", " + (1 - /*videoOverlayTransparency*/
c[1] / 100) + ")");
},
i: Y,
o: Y,
d(c) {
c && S(e);
}
};
}
function ea(a, e, t) {
let s, n, r;
M(a, q, (l) => t(2, s = l)), M(a, Ci, (l) => t(5, n = l)), M(a, oe, (l) => t(6, r = l));
let { videoOverlay: o } = e, { videoOverlayTransparency: g } = e, h, d;
return a.$$set = (l) => {
"videoOverlay" in l && t(0, o = l.videoOverlay), "videoOverlayTransparency" in l && t(1, g = l.videoOverlayTransparency);
}, a.$$.update = () => {
a.$$.dirty & /*$videoStore, $docDimensions, $captureBarHeight, divHeight*/
116 && r && s && (t(4, h = r.videoHeight - n), t(3, d = (h - s.height) / 2 + "px"));
}, [
o,
g,
s,
d,
h,
n,
r
];
}
class Qt extends ot {
constructor(e) {
super(), rt(
this,
{
target: this.shadowRoot,
props: ct(this.attributes),
customElement: !0
},
ea,
$i,
lt,
{
videoOverlay: 0,
videoOverlayTransparency: 1
},
null
), e && (e.target && z(e.target, this, e.anchor), e.props && (this.$set(e.props), j()));
}
static get observedAttributes() {
return ["videoOverlay", "videoOverlayTransparency"];
}
get videoOverlay() {
return this.$$.ctx[0];
}
set videoOverlay(e) {
this.$$set({ videoOverlay: e }), j();
}
get videoOverlayTransparency() {
return this.$$.ctx[1];
}
set videoOverlayTransparency(e) {
this.$$set({ videoOverlayTransparency: e }), j();
}
}
customElements.define("document-overlay", Qt);
function Lt(a) {
let e, t;
return e = new Qi({}), {
c() {
$(e.$$.fragment);
},
m(s, n) {
ee(e, s, n), t = !0;
},
i(s) {
t || (E(e.$$.fragment, s), t = !0);
},
o(s) {
L(e.$$.fragment, s), t = !1;
},
d(s) {
te(e, s);
}
};
}
function ta(a) {
let e, t, s, n, r, o, g, h, d, l, u = (
/*showWatermark*/
a[3] && Lt()
);
return d = new Qt({
props: {
videoOverlay: (
/*videoOverlay*/
a[1]
),
videoOverlayTransparency: (
/*videoOverlayTransparency*/
a[2]
),
borderWidth: (
/*borderWidth*/
a[4]
)
}
}), {
c() {
e = D("div"), t = D("div"), s = D("div"), n = D("img"), o = H(), u && u.c(), h = H(), $(d.$$.fragment), this.c = Y, Ae(n.src, r = qi) || f(n, "src", r), f(n, "alt", "document"), f(s, "class", "w-full h-full relative"), f(t, "class", "absolute inset-0 flex justify-center"), f(e, "id", "doc-rectangle"), f(e, "class", g = "doc-loader " + /*loading*/
(a[0] ? "doc-loading" : "") + " z-10"), f(
e,
"style",
/*styleVars*/
a[5]
);
},
m(c, b) {
z(c, e, b), w(e, t), w(t, s), w(s, n), w(e, o), u && u.m(e, null), z(c, h, b), ee(d, c, b), l = !0;
},
p(c, [b]) {
/*showWatermark*/
c[3] ? u ? b & /*showWatermark*/
8 && E(u, 1) : (u = Lt(), u.c(), E(u, 1), u.m(e, null)) : u && (Oe(), L(u, 1, 1, () => {
u = null;
}), Ne()), (!l || b & /*loading*/
1 && g !== (g = "doc-loader " + /*loading*/
(c[0] ? "doc-loading" : "") + " z-10")) && f(e, "class", g), (!l || b & /*styleVars*/
32) && f(
e,
"style",
/*styleVars*/
c[5]
);
const I = {};
b & /*videoOverlay*/
2 && (I.videoOverlay = /*videoOverlay*/
c[1]), b & /*videoOverlayTransparency*/
4 && (I.videoOverlayTransparency = /*videoOverlayTransparency*/
c[2]), b & /*borderWidth*/
16 && (I.borderWidth = /*borderWidth*/
c[4]), d.$set(I);
},
i(c) {
l || (E(u), E(d.$$.fragment, c), l = !0);
},
o(c) {
L(u), L(d.$$.fragment, c), l = !1;
},
d(c) {
c && S(e), u && u.d(), c && S(h), te(d, c);
}
};
}
const nt = 1.36, ia = "hsl(var(--p))", aa = "hsl(var(--su))";
function sa(a, e, t) {
let s, n, r;
M(a, q, (I) => t(9, n = I)), M(a, oe, (I) => t(10, r = I));
let { loading: o } = e, { videoOverlay: g = "" } = e, { videoOverlayTransparency: h = 100 } = e, { showWatermark: d } = e, l, u, c = 6, b = 0.7;
return X() && (b = 0.85, c = 5), a.$$set = (I) => {
"loading" in I && t(0, o = I.loading), "videoOverlay" in I && t(1, g = I.videoOverlay), "videoOverlayTransparency" in I && t(2, h = I.videoOverlayTransparency), "showWatermark" in I && t(3, d = I.showWatermark);
}, a.$$.update = () => {
a.$$.dirty & /*$videoStore, percentage, rectangleHeight, rectangleWidth, $docDimensions*/
1984 && r && (r.videoWidth / r.videoHeight > nt ? (t(7, u = r.videoHeight * b), t(6, l = u * nt)) : (t(6, l = r.videoWidth * b), t(7, u = l / nt)), v(q, n.width = l, n), v(q, n.height = u, n), v(q, n.x = (r.videoWidth - n.width) / 2, n), v(q, n.y = (r.videoHeight - n.height) / 2, n)), a.$$.dirty & /*rectangleWidth, rectangleHeight, borderWidth*/
208 && t(5, s = `
--rectangle-width: ${l}px;
--rectangle-height: ${u}px;
--border-color: ${ia};
--border-color-animation: ${aa};
--rectangle-border: ${c}px;
`);
}, [
o,
g,
h,
d,
c,
s,
l,
u,
b,
n,
r
];
}
class Xt extends ot {
constructor(e) {
super(), rt(
this,
{
target: this.shadowRoot,
props: ct(this.attributes),
customElement: !0
},
sa,
ta,
lt,
{
loading: 0,
videoOverlay: 1,
videoOverlayTransparency: 2,
showWatermark: 3
},
null
), e && (e.target && z(e.target, this, e.anchor), e.props && (this.$set(e.props), j()));
}
static get observedAttributes() {
return ["loading", "videoOverlay", "videoOverlayTransparency", "showWatermark"];
}
get loading() {
return this.$$.ctx[0];
}
set loading(e) {
this.$$set({ loading: e }), j();
}
get videoOverlay() {
return this.$$.ctx[1];
}
set videoOverlay(e) {
this.$$set({ videoOverlay: e }), j();
}
get videoOverlayTransparency() {
return this.$$.ctx[2];
}
set videoOverlayTransparency(e) {
this.$$set({ videoOverlayTransparency: e }), j();
}
get showWatermark() {
return this.$$.ctx[3];
}
set showWatermark(e) {
this.$$set({ showWatermark: e }), j();
}
}
customElements.define("doc-rectangle", Xt);
function Ut(a) {
let e, t, s, n, r, o, g, h, d, l, u, c, b, I, Z, m, C, N, A = (
/*$ready*/
a[12] && Bt(a)
);
return u = new Li({}), b = new Ki({
props: {
showConfigButton: (
/*showConfigButton*/
a[1]
),
showCameraButton: (
/*showCameraButton*/
a[2]
),
videoOverlay: (
/*videoOverlay*/
a[3]
),
videoOverlayTransparency: (
/*videoOverlayTransparency*/
a[4]
),
handler: (
/*capture*/
a[25]
)
}
}), {
c() {
e = D("div"), t = D("div"), s = D("video"), r = H(), o = D("canvas"), g = H(), h = D("div"), d = D("div"), A && A.c(), l = H(), $(u.$$.fragment), c = H(), $(b.$$.fragment), f(s, "id", "bry-cc-camera-video-tag"), f(s, "class", n = /*$ready*/
a[12] ? X() ? "absolute inset-0" : "w-full h-full object-cover" : "w-0 h-0"), s.playsInline = !0, s.muted = !0, s.autoplay = !0, f(o, "id", "bry-ce-detectionsCanvas"), f(o, "class", "absolute top-0 left-0 max-w-full"), f(t, "class", "overflow-hidden"), ne(
t,
"width",
/*$videoStore*/
a[13].videoWidth + "px"
), ne(
t,
"height",
/*$videoStore*/
a[13].videoHeight + "px"
), f(d, "class", "flex flex-grow w-full items-center justify-center relative"), f(h, "class", "absolute inset-0 flex flex-col items-center justify-between w-full h-full"), f(e, "class", I = /*$ready*/
a[12] ? "relative" : "relative w-0 h-0"), e.hidden = Z = /*$cameraStatusStore*/
a[11] !== F.OK;
},
m(T, R) {
z(T, e, R), w(e, t), w(t, s), a[34](s), w(t, r), w(t, o), a[36](o), w(e, g), w(e, h), w(h, d), A && A.m(d, null), w(h, l), ee(u, h, null), w(h, c), ee(b, h, null), m = !0, C || (N = [
le(
s,
"canplay",
/*canplay_handler*/
a[35]
),
le(
s,
"play",
/*play*/
a[6],
{ once: !0 }
)
], C = !0);
},
p(T, R) {
(!m || R[0] & /*$ready*/
4096 && n !== (n = /*$ready*/
T[12] ? X() ? "absolute inset-0" : "w-full h-full object-cover" : "w-0 h-0")) && f(s, "class", n), (!m || R[0] & /*$videoStore*/
8192) && ne(
t,
"width",
/*$videoStore*/
T[13].videoWidth + "px"
), (!m || R[0] & /*$videoStore*/
8192) && ne(
t,
"height",
/*$videoStore*/
T[13].videoHeight + "px"
), /*$ready*/
T[12] ? A ? (A.p(T, R), R[0] & /*$ready*/
4096 && E(A, 1)) : (A = Bt(T), A.c(), E(A, 1), A.m(d, null)) : A && (Oe(), L(A, 1, 1, () => {
A = null;
}), Ne());
const P = {};
R[0] & /*showConfigButton*/
2 && (P.showConfigButton = /*showConfigButton*/
T[1]), R[0] & /*showCameraButton*/
4 && (P.showCameraButton = /*showCameraButton*/
T[2]), R[0] & /*videoOverlay*/
8 && (P.videoOverlay = /*videoOverlay*/
T[3]), R[0] & /*videoOverlayTransparency*/
16 && (P.videoOverlayTransparency = /*videoOverlayTransparency*/
T[4]), b.$set(P), (!m || R[0] & /*$ready*/
4096 && I !== (I = /*$ready*/
T[12] ? "relative" : "relative w-0 h-0")) && f(e, "class", I), (!m || R[0] & /*$cameraStatusStore*/
2048 && Z !== (Z = /*$cameraStatusStore*/
T[11] !== F.OK)) && (e.hidden = Z);
},
i(T) {
m || (E(A), E(u.$$.fragment, T), E(b.$$.fragment, T), m = !0);
},
o(T) {
L(A), L(u.$$.fragment, T), L(b.$$.fragment, T), m = !1;
},
d(T) {
T && S(e), a[34](null), a[36](null), A && A.d(), te(u), te(b), C = !1, ut(N);
}
};
}
function Bt(a) {
let e, t, s, n;
return e = new Xi({
props: {
isCountingDown: (
/*isCountingDown*/
a[10]
)
}
}), s = new Xt({
props: {
loading: (
/*isCountingDown*/
a[10]
),
videoOverlay: (
/*videoOverlay*/
a[3]
),
videoOverlayTransparency: (
/*videoOverlayTransparency*/
a[4]
),
showWatermark: (
/*showWatermark*/
a[5]
)
}
}), {
c() {
$(e.$$.fragment), t = H(), $(s.$$.fragment);
},
m(r, o) {
ee(e, r, o), z(r, t, o), ee(s, r, o), n = !0;
},
p(r, o) {
const g = {};
o[0] & /*isCountingDown*/
1024 && (g.isCountingDown = /*isCountingDown*/
r[10]), e.$set(g);
const h = {};
o[0] & /*isCountingDown*/
1024 && (h.loading = /*isCountingDown*/
r[10]), o[0] & /*videoOverlay*/
8 && (h.videoOverlay = /*videoOverlay*/
r[3]), o[0] & /*videoOverlayTransparency*/
16 && (h.videoOverlayTransparency = /*videoOverlayTransparency*/
r[4]), o[0] & /*showWatermark*/
32 && (h.showWatermark = /*showWatermark*/
r[5]), s.$set(h);
},
i(r) {
n || (E(e.$$.fragment, r), E(s.$$.fragment, r), n = !0);
},
o(r) {
L(e.$$.fragment, r), L(s.$$.fragment, r), n = !1;
},
d(r) {
te(e, r), r && S(t), te(s, r);
}
};
}
function Gt(a) {
let e, t, s, n, r;
function o(d, l) {
return (
/*$isLoading*/
d[21] ? oa : na
);
}
let g = o(a), h = g(a);
return {
c() {
e = D("slot"), t = D("div"), s = D("img"), r = H(), h.c(), Ae(s.src, n = Ui) || f(s, "src", n), 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]");
},
m(d, l) {
z(d, e, l), w(e, t), w(t, s), w(t, r), h.m(t, null);
},
p(d, l) {
g === (g = o(d)) && h ? h.p(d, l) : (h.d(1), h = g(d), h && (h.c(), h.m(t, null)));
},
d(d) {
d && S(e), h.d();
}
};
}
function na(a) {
let e, t = (
/*$_*/
a[19]("faceCollector.initiatingCamera") + ""
), s;
return {
c() {
e = D("span"), s = V(t), f(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
},
m(n, r) {
z(n, e, r), w(e, s);
},
p(n, r) {
r[0] & /*$_*/
524288 && t !== (t = /*$_*/
n[19]("faceCollector.initiatingCamera") + "") && J(s, t);
},
d(n) {
n && S(e);
}
};
}
function oa(a) {
let e;
return {
c() {
e = D("span"), e.textContent = "Loading camera...", f(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
},
m(t, s) {
z(t, e, s);
},
p: Y,
d(t) {
t && S(e);
}
};
}
function Yt(a) {
let e, t, s = (
/*$_*/
a[19]("faceCollector.finish") + ""
), n, r, o, g, h = (
/*$_*/
a[19]("faceCollector.retakePhoto") + ""
), d, l, u;
return {
c() {
e = D("div"), t = D("button"), n = V(s), o = H(), g = D("button"), d = V(h), t.disabled = r = /*$justification*/
a[16].length === 0, f(t, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink"), f(g, "id", "bry-cc-retake-button"), f(g, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink"), f(e, "class", "ce-dui-btn-group flex");
},
m(c, b) {
z(c, e, b), w(e, t), w(t, n), w(e, o), w(e, g), w(g, d), l || (u = [
le(
t,
"click",
/*click_handler*/
a[37]
),
le(
g,
"click",
/*click_handler_1*/
a[38]
)
], l = !0);
},
p(c, b) {
b[0] & /*$_*/
524288 && s !== (s = /*$_*/
c[19]("faceCollector.finish") + "") && J(n, s), b[0] & /*$justification*/
65536 && r !== (r = /*$justification*/
c[16].length === 0) && (t.disabled = r), b[0] & /*$_*/
524288 && h !== (h = /*$_*/
c[19]("faceCollector.retakePhoto") + "") && J(d, h);
},
d(c) {
c && S(e), l = !1, ut(u);
}
};
}
function ra(a) {
let e, t;
return e = new Vi({ props: { handler: (
/*func*/
a[42]
) } }), {
c() {
$(e.$$.fragment);
},
m(s, n) {
ee(e, s, n), t = !0;
},
p: Y,
i(s) {
t || (E(e.$$.fragment, s), t = !0);
},
o(s) {
L(e.$$.fragment, s), t = !1;
},
d(s) {
te(e, s);
}
};
}
function la(a) {
let e, t, s, n, r, o;
function g(l, u) {
return (
/*$captured*/
l[14] ? ca : ua
);
}
let h = g(a), d = h(a);
return {
c() {
e = D("div"), t = D("img"), r = H(), d.c(), f(t, "class", "m-auto col-start-1 col-end-1 max-h-[23.2em]"), Ae(t.src, s = /*$dataTypePrefix*/
a[20] + "," + /*$image*/
a[17]) || f(t, "src", s), t.hidden = n = !/*$captured*/
a[14] || !/*$showFaceWhileValidating*/
a[22], f(t, "alt", ""), f(e, "class", o = "grid-cols-1 grid-rows-2 sm:grid-cols-2 sm:grid-rows-1 gap-[.5em] " + (/*$showFaceWhileValidating*/
a[22] ? "grid overflow-hidden" : "absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible"));
},
m(l, u) {
z(l, e, u), w(e, t), w(e, r), d.m(e, null);
},
p(l, u) {
u[0] & /*$dataTypePrefix, $image*/
1179648 && !Ae(t.src, s = /*$dataTypePrefix*/
l[20] + "," + /*$image*/
l[17]) && f(t, "src", s), u[0] & /*$captured, $showFaceWhileValidating*/
4210688 && n !== (n = !/*$captured*/
l[14] || !/*$showFaceWhileValidating*/
l[22]) && (t.hidden = n), h === (h = g(l)) && d ? d.p(l, u) : (d.d(1), d = h(l), d && (d.c(), d.m(e, null))), u[0] & /*$showFaceWhileValidating*/
4194304 && o !== (o = "grid-cols-1 grid-rows-2 sm:grid-cols-2 sm:grid-rows-1 gap-[.5em] " + (/*$showFaceWhileValidating*/
l[22] ? "grid overflow-hidden" : "absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible")) && f(e, "class", o);
},
i: Y,
o: Y,
d(l) {
l && S(e), d.d();
}
};
}
function ca(a) {
let e, t, s, n, r = (
/*$_*/
a[19]("faceCollector.finish") + ""
), o, g, h, d, l = (
/*$_*/
a[19]("faceCollector.retakePhoto") + ""
), u, c, b;
function I(C, N) {
return (
/*$requestResult*/
C[18] === re.TEMPLATE_EXTRACTION_ERROR ? ga : (
/*$saved*/
C[15] ? da : fa
)
);
}
let Z = I(a), m = Z(a);
return {
c() {
e = D("div"), m.c(), t = H(), s = D("div"), n = D("button"), o = V(r), h = H(), d = D("button"), u = V(l), n.disabled = g = /*$saved*/
a[15] || /*$requestResult*/
a[18] !== re.OK, f(n, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink"), f(d, "id", "bry-cc-retake-button"), f(d, "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");
},
m(C, N) {
z(C, e, N), m.m(e, null), w(e, t), w(e, s), w(s, n), w(n, o), w(s, h), w(s, d), w(d, u), c || (b = [
le(
n,
"click",
/*click_handler_2*/
a[40]
),
le(
d,
"click",
/*click_handler_3*/
a[41]
)
], c = !0);
},
p(C, N) {
Z === (Z = I(C)) && m ? m.p(C, N) : (m.d(1), m = Z(C), m && (m.c(), m.m(e, t))), N[0] & /*$_*/
524288 && r !== (r = /*$_*/
C[19]("faceCollector.finish") + "") && J(o, r), N[0] & /*$saved, $requestResult*/
294912 && g !== (g = /*$saved*/
C[15] || /*$requestResult*/
C[18] !== re.OK) && (n.disabled = g), N[0] & /*$_*/
524288 && l !== (l = /*$_*/
C[19]("faceCollector.retakePhoto") + "") && J(u, l);
},
d(C) {
C && S(e), m.d(), c = !1, ut(b);
}
};
}
function ua(a) {
let e;
return {
c() {
e = D("div"), f(e, "class", "");
},
m(t, s) {
z(t, e, s);
},
p: Y,
d(t) {
t && S(e);
}
};
}
function da(a) {
let e, t = (
/*$_*/
a[19]("docCollector.captured") + ""
), s;
return {
c() {
e = D("h1"), s = V(t), f(e, "class", "text-3xl font-bold pb-[1em] transition-opacity");
},
m(n, r) {
z(n, e, r), w(e, s);
},
p(n, r) {
r[0] & /*$_*/
524288 && t !== (t = /*$_*/
n[19]("docCollector.captured") + "") && J(s, t);
},
d(n) {
n && S(e);
}
};
}
function fa(a) {
let e, t = (
/*$_*/
a[19]("faceCollector.everythingOk") + ""
), s;
return {
c() {
e = D("h1"), s = V(t), f(e, "class", "text-3xl font-bold pb-[1em] transition-opacity");
},
m(n, r) {
z(n, e, r), w(e, s);
},
p(n, r) {
r[0] & /*$_*/
524288 && t !== (t = /*$_*/
n[19]("faceCollector.everythingOk") + "") && J(s, t);
},
d(n) {
n && S(e);
}
};
}
function ga(a) {
let e, t = (
/*$_*/
a[19]("docCollector.docNotFound") + ""
), s;
return {
c() {
e = D("h1"), s = V(t), f(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
},
m(n, r) {
z(n, e, r), w(e, s);
},
p(n, r) {
r[0] & /*$_*/
524288 && t !== (t = /*$_*/
n[19]("docCollector.docNotFound") + "") && J(s, t);
},
d(n) {
n && S(e);
}
};
}
function ha(a) {
let e, t, s, n, r, o, g, h, d, l = (
/*$videoStore*/
a[13] && Ut(a)
), u = !/*$ready*/
a[12] && /*$cameraStatusStore*/
a[11] === F.OK && Gt(a), c = (
/*$captured*/
a[14] && Yt(a)
);
const b = [la, ra], I = [];
function Z(m, C) {
return (
/*showUnconformities*/
m[0] && /*$captured*/
m[14] ? 0 : (
/*$cameraStatusStore*/
m[11] !== F.OK ? 1 : -1
)
);
}
return ~(o = Z(a)) && (g = I[o] = b[o](a)), {
c() {
e = D("div"), t = D("div"), l && l.c(), s = H(), u && u.c(), n = H(), c && c.c(), r = H(), g && g.c(), h = Mi(), this.c = Y, f(t, "class", "relative mx-auto"), f(e, "class", "flex flex-col justify-between");
},
m(m, C) {
z(m, e, C), w(e, t), l && l.m(t, null), w(t, s), u && u.m(t, null), w(t, n), c && c.m(t, null), a[39](e), z(m, r, C), ~o && I[o].m(m, C), z(m, h, C), d = !0;
},
p(m, C) {
/*$videoStore*/
m[13] ? l ? (l.p(m, C), C[0] & /*$videoStore*/
8192 && E(l, 1)) : (l = Ut(m), l.c(), E(l, 1), l.m(t, s)) : l && (Oe(), L(l, 1, 1, () => {
l = null;
}), Ne()), !/*$ready*/
m[12] && /*$cameraStatusStore*/
m[11] === F.OK ? u ? u.p(m, C) : (u = Gt(m), u.c(), u.m(t, n)) : u && (u.d(1), u = null), /*$captured*/
m[14] ? c ? c.p(m, C) : (c = Yt(m), c.c(), c.m(t, null)) : c && (c.d(1), c = null);
let N = o;
o = Z(m), o === N ? ~o && I[o].p(m, C) : (g && (Oe(), L(I[N], 1, 1, () => {
I[N] = null;
}), Ne()), ~o ? (g = I[o], g ? g.p(m, C) : (g = I[o] = b[o](m), g.c()), E(g, 1), g.m(h.parentNode, h)) : g = null);
},
i(m) {
d || (E(l), E(g), d = !0);
},
o(m) {
L(l), L(g), d = !1;
},
d(m) {
m && S(e), l && l.d(), u && u.d(), c && c.d(), a[39](null), m && S(r), ~o && I[o].d(m), m && S(h);
}
};
}
let ma = !1, ba = 0;
function va(a, e, t) {
const s = e.videoWidth / e.videoHeight, n = t.width / t.height;
let r = 0, o = 0, g = e.videoWidth, h = e.videoHeight;
s > n ? (g = e.videoHeight * n, r = (e.videoWidth - g) / 2) : s < n && (h = e.videoWidth / n, o = (e.videoHeight - h) / 2), a.drawImage(e, r, o, g, h, 0, 0, t.width, t.height);
}
function Ia(a, e, t) {
let s, n, r, o, g, h, d, l, u, c, b, I, Z, m, C, N, A, T, R, P, ke, x, de, K, dt, ft, gt;
M(a, Ve, (i) => t(56, s = i)), M(a, Ie, (i) => t(58, r = i)), M(a, G, (i) => t(11, o = i)), M(a, we, (i) => t(12, g = i)), M(a, Di, (i) => t(59, h = i)), M(a, ye, (i) => t(60, d = i)), M(a, _i, (i) => t(61, l = i)), M(a, ue, (i) => t(62, u = i)), M(a, oe, (i) => t(13, c = i)), M(a, Ce, (i) => t(14, b = i)), M(a, Je, (i) => t(63, I = i)), M(a, xe, (i) => t(64, Z = i)), M(a, jt, (i) => t(65, m = i)), M(a, q, (i) => t(66, C = i)), M(a, Me, (i) => t(67, N = i)), M(a, Ke, (i) => t(15, A = i)), M(a, pi, (i) => t(16, T = i)), M(a, Rt, (i) => t(17, R = i)), M(a, De, (i) => t(18, P = i)), M(a, Ti, (i) => t(19, ke = i)), M(a, qe, (i) => t(68, x = i)), M(a, Wt, (i) => t(69, K = i)), M(a, $e, (i) => t(70, dt = i)), M(a, Ai, (i) => t(21, ft = i)), M(a, Oi, (i) => t(22, gt = i));
let _, W, Q, ce = !1, ht = !1, U = {
width: 2560,
height: 1440,
aspectRatio: -1
};
const Vt = { width: 2560, height: 1440 };
let { enableMinutiae: ze } = e, { videoDimensions: je } = e, { noTabs: Re } = e, { weightsPath: We } = e, { showUnconformities: mt } = e, { showConfigButton: bt } = e, { showCameraButton: vt } = e, { videoOverlay: It } = e, { videoOverlayTransparency: wt } = e, { showWatermark: yt } = e, { faceDetectionSensitivity: fe } = e;
const ge = Ht(!1);
M(a, ge, (i) => t(57, n = i));
const Ee = Ht("data:image/png;base64");
M(a, Ee, (i) => t(20, de = i));
let Ct = !1, he = !0, Mt = 0, Se = 0, Ze = !0, Dt = 0, Pe = (/* @__PURE__ */ new Date()).getTime(), Fe = !1;
Ni(async () => {
if (Et("Mounting Document Collector!"), v(we, g = !1, g), _t(), K)
try {
await ki(We), ht = !0;
} catch {
v(Wt, K = !1, K);
}
await ve(), xt();
});
function _t() {
v(Ce, b = !1, b), v(jt, m = !0, m), v(Me, N = "", N), v(ye, d = et.REAR_CAMERA, d), v(Ie, r = !1, r), v(Ke, A = !1, A), v(De, P = re.OK, P), v(qe, x = "", x);
const i = zi(tt);
i.closedMouth = !1, i.isPersonCloseEnough = !1, i.isPersonTooclose = !0, i.isPersonInFrame = !1, tt.set(i);
}
async function Jt() {
const [i, p] = (je ?? "")?.replaceAll(" ", "")?.split("x")?.map((y) => y ? parseInt(y) : void 0);
!i || !p || (X() ? (await Bi(), v(
oe,
c = {
videoWidth: window.innerWidth,
videoHeight: window.innerHeight
},
c
)) : v(oe, c = { videoWidth: i, videoHeight: p }, c));
}
function pt() {
v(G, o = F.OK, o), Ct = !0, he = !1;
}
async function me() {
if (K && !ht)
return Te(_, me);
if (_) {
if (dt !== at.Document && !Re)
return Te(_, me);
v(we, g = !0, g), K && (n || v(ge, n = !0, n)), Te(_, me);
}
}
async function Tt() {
let i = Kt();
if (K && !(await Gi(i, fe)).result) {
Ft("Document capture - document not detected! Resetting capture.");
return;
}
v(Ce, b = !0, b);
let p = [];
try {
const y = i.toDataURL("image/jpeg").split(",");
v(Ee, de = y[0], de), v(Rt, R = y[1], R), v(qe, x = y[1], x), p = [
{
bodyPart: "DOCUMENT",
data: x
}
], v(De, P = re.OK, P), window.dispatchEvent(new CustomEvent(
"document-unconformities-validated",
{
detail: { bodyParts: p, status: P }
}
));
} catch (y) {
pe(y);
let O, k = Yi.DOCUMENT_NOT_FOUND, B = [];
y instanceof Error && ["DOCUMENT_NOT_FOUND"].includes(y.message) && (v(De, P = re.TEMPLATE_EXTRACTION_ERROR, P), O = y.message, B = [
{
bodyPart: "DOCUMENT",
data: x,
format: "jpg"
}
]), window.dispatchEvent(new CustomEvent(
"document-unconformities-validated",
{
detail: {
bodyParts: B,
errorCode: O,
translatedError: ke(k),
status: P
}
}
));
}
}
function He() {
const i = {
bodyPart: "DOCUMENT",
data: R,
justification: T
};
v(Ke, A = !0, A), window.dispatchEvent(new CustomEvent("export-document", { detail: i }));
}
function be() {
window.dispatchEvent(new CustomEvent("document-scrapped")), _t(), he && pt();
}
async function ve(i) {
if (!Ze) {
v(G, o = F.CAMERA_ORIENTATION_PORTRAIT, o);
return;
}
await Jt();
try {
let { stream: p, deviceId: y, width: O, height: k, aspectRatio: B } = await St(U.width, U.height, d, i);
if (v(Je, I = p, I), U.aspectRatio = B || O / k, U.aspectRatio > 1 && O < U.width || U.aspectRatio < 1 && k < U.width) {
U.width = O, U.height = O / 1.7777, I.getTracks()?.forEach((Ue) => Ue?.stop());
const { stream: Le } = await St(U.width, U.height, d, i);
v(Je, I = Le, I);
}
v(ue, u = y || l[0].deviceId, u);
} catch (p) {
const y = p;
he = !0;
const O = _e(p) && p.constraint ? p.constraint : "";
pe(y, O), _e(y) && "message" in y && y.message.includes("Permission denied") && (pe("User didn't give permission to use camera!"), v(G, o = F.CAMERA_DENIED_ERROR, o)), _e(y) && "message" in y && y.message.includes("Requested device not found") && v(G, o = F.DEVICE_NOT_FOUND_ERROR, o), (O.includes("width") || O.includes("height")) && (pe(`Camera does not meet the minimum supported requirements! (${O})`), v(G, o = F.CAMERA_UNSUPPORTED, o));
}
}
async function ie() {
v(ue, u = "", u), await ve();
}
function xt() {
navigator.mediaDevices.ondevicechange = async (i) => {
await Zt(), o !== F.OK ? await ie() : I.active || (it(), v(G, o = F.DEVICE_NOT_FOUND_ERROR, o));
};
}
function At() {
v(Ie, r = !1, r);
const i = (/* @__PURE__ */ new Date()).getTime();
i - Pe > 5e3 ? (Pe = i, v(Me, N = "docCollector.docWasNotFound", N)) : Fe || (Fe = !0, setTimeout(
() => {
Fe = !1, N != "docCollector.docWasNotFound" && v(Me, N = "", N);
},
1500
));
}
function Kt() {
const i = c.videoWidth, p = c.videoHeight, y = Vt.width, O = p / i * y, k = document.createElement("canvas"), B = k.getContext("2d");
k.width = y, k.height = O, B && va(B, _, k);
const Le = k.width / c.videoWidth, Ue = k.height / c.videoHeight, vi = X() ? 0.25 : 0.15, Ii = Math.round(k.height * vi), Be = C.width * Le, Ge = C.height * Ue, Nt = (X() ? 0.15 : 0.2) * Be, kt = 0.2 * Ge, wi = (k.width - Be) / 2 - Nt / 2, yi = (k.height - Ii - Ge) / 2 - kt / 2, Ye = Be + Nt, Qe = Ge + kt, ae = document.createElement("canvas");
ae.width = Ye, ae.height = Qe;
const Xe = ae.getContext("2d");
return Xe?.clearRect(0, 0, ae.width, ae.height), Xe?.drawImage(k, wi, yi, Ye, Qe, 0, 0, Ye, Qe), Xe?.save(), ae;
}
const qt = oe.subscribe((i) => {
_ && W && (t(7, _.width = i.videoWidth, _), t(7, _.height = i.videoHeight, _), t(8, W.width = i.videoWidth, W), t(8, W.height = i.videoHeight, W));
}), $t = tt.subscribe((i) => {
let p = "";
if (i.isPersonCloseEnough ? i.isPersonTooclose ? p = "docCollector.moveAwayCamera" : i.isPersonInFrame || (p = "docCollector.stayInFrame") : p = "docCollector.comeCloserCamera", r && ji(p), !b && m && r && !ce && i.isPersonInFrame && !(!i.isPersonCloseEnough || i.isPersonTooclose)) {
t(10, ce = !0), Dt = (/* @__PURE__ */ new Date()).getTime() + 4500;
const y = setInterval(
async () => {
if (!m || b || !i.isPersonCloseEnough || i.isPersonTooclose || !i.isPersonInFrame) {
t(10, ce = !1), setTimeout(
() => {
},
1500
), clearInterval(y);
return;
}
const O = (/* @__PURE__ */ new Date()).getTime();
Math.floor((Dt - O) % (1e3 * 60) / 1e3) <= 0 && (clearInterval(y), t(10, ce = !1), Tt());
},
100
);
}
}), ei = Ce.subscribe((i) => {
Q && (i ? (Q.classList.remove("flex"), Q.classList.add("hidden")) : (Q.classList.add("flex"), Q.classList.remove("hidden")));
}), ti = xe.subscribe((i) => {
_ && i && (Pt("setting null in video srcObject"), t(7, _.srcObject = null, _), t(7, _.src = "", _), v(ue, u = null, u));
});
$e.subscribe(async (i) => {
i === at.Document && await Zt();
});
const ii = ue.subscribe(async (i) => {
if (!I || !i)
return;
const p = I?.getVideoTracks()[0]?.getSettings()?.deviceId;
p && p !== i && await ve(i);
try {
t(7, _.srcObject = I, _), v(xe, Z = !1, Z), I.getTracks().forEach((y) => {
y.readyState === "live" && Pt(`Camera ${y.label} opened successfully!`);
}), v(G, o = F.OK, o), Ri(_);
} catch (y) {
const O = y;
he = !0, _e(O) && "message" in O && O.message.includes("Requested device not found") && v(G, o = F.DEVICE_NOT_FOUND_ERROR, o);
}
}), ai = $e.subscribe(async (i) => {
i === at.Document && !Ct && !b && ma && await pt();
}), si = ge.subscribe(async (i) => {
i && Ot();
}), ni = we.subscribe((i) => {
i && window.dispatchEvent(new CustomEvent("brycc-camera-ready"));
}), oi = Wi.subscribe(async (i) => {
if (!(!c || l.length <= 1)) {
if (it(), !X()) {
const y = (l.findIndex((k) => k.deviceId === u) + 1) % l.length, O = l[y].deviceId;
await ve(O);
return;
}
i ? (v(ye, d = et.FRONT_CAMERA, d), await ie()) : (v(ye, d = et.REAR_CAMERA, d), await ie());
}
}), ri = Ei.subscribe(async (i) => {
!i.isSupported || !X() || h != "DOCUMENT" || (Ze = i.orientation.includes("portrait"), Ze ? _ && !g ? await ie() : v(G, o = F.OK, o) : v(G, o = F.CAMERA_ORIENTATION_PORTRAIT, o));
});
async function Ot() {
let i;
try {
if (Se >= ba) {
Se = 0;
const p = await Si(fe), y = await import("./face_api_d3d25326_3.3.6.js");
let O;
if (O = y.detectSingleFace(_, p), i = await O.withFaceLandmarks(), W.getContext("2d")?.clearRect(0, 0, W.width, W.height), i != null) {
const k = Ji(W, _, !0);
Zi(W, _, k);
const B = xi(i, k);
Pi(B) ? (Fi(B, W, ze, !0), v(Ie, r = !0, r), Pe = (/* @__PURE__ */ new Date()).getTime()) : At();
} else
At();
} else
Se++;
} catch (p) {
Ft(`FaceapiLoop: ${p}`);
} finally {
n && Te(_, Ot);
}
}
Ve.subscribe(async (i) => {
i && (be(), v(Ve, s = !1, s));
}), Hi(() => {
Et("Destroying document collector"), it(), ei(), $t(), qt(), ti(), ii(), ai(), clearInterval(Mt), si(), oi(), ni(), ri(), Mt = 0;
});
function li(i) {
st[i ? "unshift" : "push"](() => {
_ = i, t(7, _);
});
}
const ci = () => {
t(7, _.width = c.videoWidth, _), t(7, _.height = c.videoHeight, _), t(8, W.width = c.videoWidth, W), t(8, W.height = c.videoHeight, W);
};
function ui(i) {
st[i ? "unshift" : "push"](() => {
W = i, t(8, W);
});
}
const di = () => He(), fi = () => be();
function gi(i) {
st[i ? "unshift" : "push"](() => {
Q = i, t(9, Q);
});
}
const hi = () => He(), mi = () => be(), bi = async () => {
await ie();
};
return a.$$set = (i) => {
"enableMinutiae" in i && t(29, ze = i.enableMinutiae), "videoDimensions" in i && t(30, je = i.videoDimensions), "noTabs" in i && t(31, Re = i.noTabs), "weightsPath" in i && t(32, We = i.weightsPath), "showUnconformities" in i && t(0, mt = i.showUnconformities), "showConfigButton" in i && t(1, bt = i.showConfigButton), "showCameraButton" in i && t(2, vt = i.showCameraButton), "videoOverlay" in i && t(3, It = i.videoOverlay), "videoOverlayTransparency" in i && t(4, wt = i.videoOverlayTransparency), "showWatermark" in i && t(5, yt = i.showWatermark), "faceDetectionSensitivity" in i && t(33, fe = i.faceDetectionSensitivity);
}, [
mt,
bt,
vt,
It,
wt,
yt,
me,
_,
W,
Q,
ce,
o,
g,
c,
b,
A,
T,
R,
P,
ke,
de,
ft,
gt,
ge,
Ee,
Tt,
He,
be,
ie,
ze,
je,
Re,
We,
fe,
li,
ci,
ui,
di,
fi,
gi,
hi,
mi,
bi
];
}
class wa extends ot {
constructor(e) {
super(), rt(
this,
{
target: this.shadowRoot,
props: ct(this.attributes),
customElement: !0
},
Ia,
ha,
lt,
{
enableMinutiae: 29,
videoDimensions: 30,
noTabs: 31,
weightsPath: 32,
showUnconformities: 0,
showConfigButton: 1,
showCameraButton: 2,
videoOverlay: 3,
videoOverlayTransparency: 4,
showWatermark: 5,
faceDetectionSensitivity: 33,
play: 6
},
null,
[-1, -1, -1]
), e && (e.target && z(e.target, this, e.anchor), e.props && (this.$set(e.props), j()));
}
static get observedAttributes() {
return [
"enableMinutiae",
"videoDimensions",
"noTabs",
"weightsPath",
"showUnconformities",
"showConfigButton",
"showCameraButton",
"videoOverlay",
"videoOverlayTransparency",
"showWatermark",
"faceDetectionSensitivity",
"play"
];
}
get enableMinutiae() {
return this.$$.ctx[29];
}
set enableMinutiae(e) {
this.$$set({ enableMinutiae: e }), j();
}
get videoDimensions() {
return this.$$.ctx[30];
}
set videoDimensions(e) {
this.$$set({ videoDimensions: e }), j();
}
get noTabs() {
return this.$$.ctx[31];
}
set noTabs(e) {
this.$$set({ noTabs: e }), j();
}
get weightsPath() {
return this.$$.ctx[32];
}
set weightsPath(e) {
this.$$set({ weightsPath: e }), j();
}
get showUnconformities() {
return this.$$.ctx[0];
}
set showUnconformities(e) {
this.$$set({ showUnconformities: e }), j();
}
get showConfigButton() {
return this.$$.ctx[1];
}
set showConfigButton(e) {
this.$$set({ showConfigButton: e }), j();
}
get showCameraButton() {
return this.$$.ctx[2];
}
set showCameraButton(e) {
this.$$set({ showCameraButton: e }), j();
}
get videoOverlay() {
return this.$$.ctx[3];
}
set videoOverlay(e) {
this.$$set({ videoOverlay: e }), j();
}
get videoOverlayTransparency() {
return this.$$.ctx[4];
}
set videoOverlayTransparency(e) {
this.$$set({ videoOverlayTransparency: e }), j();
}
get showWatermark() {
return this.$$.ctx[5];
}
set showWatermark(e) {
this.$$set({ showWatermark: e }), j();
}
get faceDetectionSensitivity() {
return this.$$.ctx[33];
}
set faceDetectionSensitivity(e) {
this.$$set({ faceDetectionSensitivity: e }), j();
}
get play() {
return this.$$.ctx[6];
}
}
customElements.define("document-collector", wa);
export {
wa as default
};