@regulaforensics/idv-document 4.0.670-rc → 4.0.672-nightly
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.
- package/dist/main.iife.js +16 -16
- package/dist/main.js +160 -132
- package/package.json +6 -1
package/dist/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
//#region ../../node_modules/@lit/reactive-element/css-tag.js
|
|
2
2
|
var e = globalThis, t = e.ShadowRoot && (e.ShadyCSS === void 0 || e.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, n = Symbol(), r = /* @__PURE__ */ new WeakMap(), i = class {
|
|
3
3
|
constructor(e, t, r) {
|
|
4
4
|
if (this._$cssResult$ = !0, r !== n) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
@@ -30,7 +30,8 @@ var e = globalThis, t = e.ShadowRoot && (e.ShadyCSS === void 0 || e.ShadyCSS.nat
|
|
|
30
30
|
for (let n of e.cssRules) t += n.cssText;
|
|
31
31
|
return a(t);
|
|
32
32
|
})(e) : e;
|
|
33
|
-
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/asyncToGenerator.js
|
|
34
35
|
function l(e, t, n, r, i, a, o) {
|
|
35
36
|
try {
|
|
36
37
|
var s = e[a](o), c = s.value;
|
|
@@ -55,7 +56,8 @@ function u(e) {
|
|
|
55
56
|
});
|
|
56
57
|
};
|
|
57
58
|
}
|
|
58
|
-
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region ../../node_modules/@lit/reactive-element/reactive-element.js
|
|
59
61
|
var d, f, { is: p, defineProperty: m, getOwnPropertyDescriptor: h, getOwnPropertyNames: g, getOwnPropertySymbols: _, getPrototypeOf: v } = Object, y = globalThis, b = y.trustedTypes, x = b ? b.emptyScript : "", S = y.reactiveElementPolyfillSupport, C = (e, t) => e, w = {
|
|
60
62
|
toAttribute(e, t) {
|
|
61
63
|
switch (t) {
|
|
@@ -309,7 +311,8 @@ var D = class extends HTMLElement {
|
|
|
309
311
|
firstUpdated(e) {}
|
|
310
312
|
};
|
|
311
313
|
D.elementStyles = [], D.shadowRootOptions = { mode: "open" }, D[C("elementProperties")] = /* @__PURE__ */ new Map(), D[C("finalized")] = /* @__PURE__ */ new Map(), S == null || S({ ReactiveElement: D }), ((f = y.reactiveElementVersions) == null ? y.reactiveElementVersions = [] : f).push("2.1.2");
|
|
312
|
-
|
|
314
|
+
//#endregion
|
|
315
|
+
//#region ../../node_modules/lit-html/lit-html.js
|
|
313
316
|
var O, k = globalThis, A = (e) => e, j = k.trustedTypes, M = j ? j.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, N = "$lit$", P = `lit$${Math.random().toFixed(9).slice(2)}$`, F = "?" + P, I = `<${F}>`, L = document, ee = () => L.createComment(""), te = (e) => e === null || typeof e != "object" && typeof e != "function", ne = Array.isArray, R = (e) => ne(e) || typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", re = "[ \n\f\r]", ie = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ae = /-->/g, oe = />/g, se = RegExp(`>|${re}(?:([^\\s"'>=/]+)(${re}*=${re}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`, "g"), ce = /'/g, le = /"/g, ue = /^(?:script|style|textarea|title)$/i, de = ((e) => (t, ...n) => ({
|
|
314
317
|
_$litType$: e,
|
|
315
318
|
strings: t,
|
|
@@ -595,7 +598,8 @@ var Oe = (e, t, n) => {
|
|
|
595
598
|
Me._$litElement$ = !0, Me.finalized = !0, (ke = je.litElementHydrateSupport) == null || ke.call(je, { LitElement: Me });
|
|
596
599
|
var Ne = je.litElementPolyfillSupport;
|
|
597
600
|
Ne == null || Ne({ LitElement: Me }), ((Ae = je.litElementVersions) == null ? je.litElementVersions = [] : Ae).push("4.2.2");
|
|
598
|
-
|
|
601
|
+
//#endregion
|
|
602
|
+
//#region ../../node_modules/lit-html/directive.js
|
|
599
603
|
var Pe = (e) => (...t) => ({
|
|
600
604
|
_$litDirective$: e,
|
|
601
605
|
values: t
|
|
@@ -9765,7 +9769,7 @@ function Nb(...e) {
|
|
|
9765
9769
|
let { caseless: t, skipUndefined: n } = Mb(this) && this || {}, r = {}, i = (e, i) => {
|
|
9766
9770
|
if (i === "__proto__" || i === "constructor" || i === "prototype") return;
|
|
9767
9771
|
let a = t && Ab(r, i) || i, o = Gb(r, a) ? r[a] : void 0;
|
|
9768
|
-
ub(o) && ub(e) ? r[a] = Nb(o, e) : ub(e) ? r[a] = Nb({}, e) : eb(e) ? r[a] = e.slice() : n
|
|
9772
|
+
ub(o) && ub(e) ? r[a] = Nb(o, e) : ub(e) ? r[a] = Nb({}, e) : eb(e) ? r[a] = e.slice() : (!n || !tb(e)) && (r[a] = e);
|
|
9769
9773
|
};
|
|
9770
9774
|
for (let t = 0, n = e.length; t < n; t++) e[t] && kb(e[t], i);
|
|
9771
9775
|
return r;
|
|
@@ -9799,7 +9803,7 @@ var Pb = (e, t, n, { allOwnKeys: r } = {}) => (kb(t, (t, r) => {
|
|
|
9799
9803
|
let i, a, o, s = {};
|
|
9800
9804
|
if (t = t || {}, e == null) return t;
|
|
9801
9805
|
do {
|
|
9802
|
-
for (i = Object.getOwnPropertyNames(e), a = i.length; a-- > 0;) o = i[a], r
|
|
9806
|
+
for (i = Object.getOwnPropertyNames(e), a = i.length; a-- > 0;) o = i[a], (!r || r(o, e, t)) && !s[o] && (t[o] = e[o], s[o] = !0);
|
|
9803
9807
|
e = n !== !1 && Jy(e);
|
|
9804
9808
|
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
|
9805
9809
|
return t;
|
|
@@ -10390,7 +10394,7 @@ function Wx(e) {
|
|
|
10390
10394
|
let a = e[i++];
|
|
10391
10395
|
if (a === "__proto__") return !0;
|
|
10392
10396
|
let o = Number.isFinite(+a), s = i >= e.length;
|
|
10393
|
-
return a = !a && Q.isArray(r) ? r.length : a, s ? (Q.hasOwnProp(r, a) ? r[a] = Q.isArray(r[a]) ? r[a].concat(n) : [r[a], n] : r[a] = n, !o) : (r[a]
|
|
10397
|
+
return a = !a && Q.isArray(r) ? r.length : a, s ? (Q.hasOwnProp(r, a) ? r[a] = Q.isArray(r[a]) ? r[a].concat(n) : [r[a], n] : r[a] = n, !o) : ((!r[a] || !Q.isObject(r[a])) && (r[a] = []), t(e, n, r[a], i) && Q.isArray(r[a]) && (r[a] = Ux(r[a])), !o);
|
|
10394
10398
|
}
|
|
10395
10399
|
if (Q.isFormData(e) && Q.isFunction(e.entries)) {
|
|
10396
10400
|
let n = {};
|
|
@@ -19790,7 +19794,7 @@ var jL = (function(e) {
|
|
|
19790
19794
|
var t;
|
|
19791
19795
|
if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
|
|
19792
19796
|
var n = this.closed;
|
|
19793
|
-
e.prototype.unsubscribe.call(this), n
|
|
19797
|
+
e.prototype.unsubscribe.call(this), !n && ((t = this.onFinalize) == null || t.call(this));
|
|
19794
19798
|
}
|
|
19795
19799
|
}, t;
|
|
19796
19800
|
})(hL), ML = rL(function(e) {
|
|
@@ -20319,7 +20323,7 @@ function LR(e, t) {
|
|
|
20319
20323
|
let n = Array.isArray(t.customProtocols) ? t.customProtocols : [], r = new Set(n.map((e) => OR(e)).filter(Boolean)), i = kR(e);
|
|
20320
20324
|
if (i && !r.has(i)) return e;
|
|
20321
20325
|
let a = e.startsWith("//");
|
|
20322
|
-
|
|
20326
|
+
(a || !/^\.*\//.test(e)) && !i && (e = e.replace(/^(?!(?:\w+:)?\/\/)|^\/\//, t.defaultProtocol));
|
|
20323
20327
|
let o = new URL(e);
|
|
20324
20328
|
if (t.forceHttp && t.forceHttps) throw Error("The `forceHttp` and `forceHttps` options cannot be used together");
|
|
20325
20329
|
if (t.forceHttp && o.protocol === "https:" && (o.protocol = "http:"), t.forceHttps && o.protocol === "http:" && (o.protocol = "https:"), t.stripAuthentication && (o.username = "", o.password = ""), t.stripHash ? o.hash = "" : t.stripTextFragment && (o.hash = o.hash.replace(/#?:~:text.*?$/i, "")), o.pathname) {
|
|
@@ -20607,7 +20611,8 @@ function KR() {
|
|
|
20607
20611
|
]);
|
|
20608
20612
|
});
|
|
20609
20613
|
}
|
|
20610
|
-
|
|
20614
|
+
//#endregion
|
|
20615
|
+
//#region ../../node_modules/@lit/reactive-element/decorators/property.js
|
|
20611
20616
|
var qR = {
|
|
20612
20617
|
attribute: !0,
|
|
20613
20618
|
type: String,
|
|
@@ -20643,12 +20648,14 @@ function YR(e) {
|
|
|
20643
20648
|
return t.constructor.createProperty(n, e), r ? Object.getOwnPropertyDescriptor(t, n) : void 0;
|
|
20644
20649
|
})(e, t, n);
|
|
20645
20650
|
}
|
|
20646
|
-
|
|
20651
|
+
//#endregion
|
|
20652
|
+
//#region ../../node_modules/lit-html/directives/choose.js
|
|
20647
20653
|
var XR = (e, t, n) => {
|
|
20648
20654
|
for (let n of t) if (n[0] === e) return (0, n[1])();
|
|
20649
20655
|
return n == null ? void 0 : n();
|
|
20650
20656
|
};
|
|
20651
|
-
|
|
20657
|
+
//#endregion
|
|
20658
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/typeof.js
|
|
20652
20659
|
function ZR(e) {
|
|
20653
20660
|
"@babel/helpers - typeof";
|
|
20654
20661
|
return ZR = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
@@ -20657,7 +20664,8 @@ function ZR(e) {
|
|
|
20657
20664
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
20658
20665
|
}, ZR(e);
|
|
20659
20666
|
}
|
|
20660
|
-
|
|
20667
|
+
//#endregion
|
|
20668
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/toPrimitive.js
|
|
20661
20669
|
function QR(e, t) {
|
|
20662
20670
|
if (ZR(e) != "object" || !e) return e;
|
|
20663
20671
|
var n = e[Symbol.toPrimitive];
|
|
@@ -20668,12 +20676,14 @@ function QR(e, t) {
|
|
|
20668
20676
|
}
|
|
20669
20677
|
return (t === "string" ? String : Number)(e);
|
|
20670
20678
|
}
|
|
20671
|
-
|
|
20679
|
+
//#endregion
|
|
20680
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/toPropertyKey.js
|
|
20672
20681
|
function $R(e) {
|
|
20673
20682
|
var t = QR(e, "string");
|
|
20674
20683
|
return ZR(t) == "symbol" ? t : t + "";
|
|
20675
20684
|
}
|
|
20676
|
-
|
|
20685
|
+
//#endregion
|
|
20686
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/defineProperty.js
|
|
20677
20687
|
function ez(e, t, n) {
|
|
20678
20688
|
return (t = $R(t)) in e ? Object.defineProperty(e, t, {
|
|
20679
20689
|
value: n,
|
|
@@ -20682,7 +20692,8 @@ function ez(e, t, n) {
|
|
|
20682
20692
|
writable: !0
|
|
20683
20693
|
}) : e[t] = n, e;
|
|
20684
20694
|
}
|
|
20685
|
-
|
|
20695
|
+
//#endregion
|
|
20696
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/objectSpread2.js
|
|
20686
20697
|
function tz(e, t) {
|
|
20687
20698
|
var n = Object.keys(e);
|
|
20688
20699
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -20704,7 +20715,8 @@ function nz(e) {
|
|
|
20704
20715
|
}
|
|
20705
20716
|
return e;
|
|
20706
20717
|
}
|
|
20707
|
-
|
|
20718
|
+
//#endregion
|
|
20719
|
+
//#region ../interfaces-idv/src/index.ts
|
|
20708
20720
|
var rz = class e {
|
|
20709
20721
|
constructor({ errorCode: e, errorCodeKey: t, message: n, underlyingError: r, underlyingBaseError: i, domain: a, module: o, errorEnumName: s, shortDomainCode: c }) {
|
|
20710
20722
|
this.errorCode = e, this.errorCodeKey = t, this.message = n, this.underlyingError = r, this.underlyingBaseError = i, this.module = o, this.domain = a, this.errorEnumName = s, this.shortDomainCode = c;
|
|
@@ -20757,43 +20769,50 @@ function az(e) {
|
|
|
20757
20769
|
var oz = {
|
|
20758
20770
|
FORM: "form",
|
|
20759
20771
|
DATA: "data"
|
|
20760
|
-
}, sz =
|
|
20772
|
+
}, sz = (e) => {
|
|
20773
|
+
if (typeof e != "string") return !1;
|
|
20774
|
+
try {
|
|
20775
|
+
return new URL(e), !0;
|
|
20776
|
+
} catch (e) {
|
|
20777
|
+
return !1;
|
|
20778
|
+
}
|
|
20779
|
+
}, cz = ["ar", "he"], lz = (e) => {
|
|
20761
20780
|
var t;
|
|
20762
20781
|
let n = e ? (t = e.substring(0, 2)) == null ? void 0 : t.toLowerCase() : "";
|
|
20763
|
-
return
|
|
20764
|
-
},
|
|
20782
|
+
return cz.includes(n) ? "rtl" : "ltr";
|
|
20783
|
+
}, uz = (e, t) => e.base64 && !(t != null && t.base64.has(e.base64)) ? e.base64 : e.imageURL && !(t != null && t.imageURL.has(e.imageURL)) ? e.imageURL : "", dz = (e, t, n) => {
|
|
20765
20784
|
var r;
|
|
20766
20785
|
if (!t) return;
|
|
20767
20786
|
let i = (r = e == null ? void 0 : e.idvAsset) == null ? null : r;
|
|
20768
20787
|
for (; i;) {
|
|
20769
|
-
let e =
|
|
20788
|
+
let e = uz(i, n);
|
|
20770
20789
|
if (e) return e;
|
|
20771
20790
|
i = i.failurePolicy === "placeholderImage" && i.placeholderImage || null;
|
|
20772
20791
|
}
|
|
20773
|
-
},
|
|
20792
|
+
}, fz = {
|
|
20774
20793
|
DOC_READER: "DOC_READER",
|
|
20775
20794
|
DOC_READER_GALLERY: "DOC_READER_GALLERY"
|
|
20776
|
-
},
|
|
20795
|
+
}, pz = /* @__PURE__ */ function(e) {
|
|
20777
20796
|
return e[e.NO_INITIALIZED = 0] = "NO_INITIALIZED", e[e.UNKNOWN_STEP = 1] = "UNKNOWN_STEP", e[e.SCAN_ERROR = 2] = "SCAN_ERROR", e[e.RFID_ERROR = 3] = "RFID_ERROR", e[e.IMAGE_LOADING_FAILED = 4] = "IMAGE_LOADING_FAILED", e;
|
|
20778
|
-
}({}),
|
|
20797
|
+
}({}), mz = /* @__PURE__ */ function(e) {
|
|
20779
20798
|
return e[e.CONFIGURATION_FAILED = 0] = "CONFIGURATION_FAILED", e[e.INTERNAL_ERROR = 1] = "INTERNAL_ERROR", e[e.PRESENTER_UNAVAILABLE = 2] = "PRESENTER_UNAVAILABLE", e;
|
|
20780
|
-
}({}),
|
|
20799
|
+
}({}), hz = "idv-document", gz = {
|
|
20781
20800
|
0: ff.auto,
|
|
20782
20801
|
1: ff.captureVideo,
|
|
20783
20802
|
2: ff.captureFrame
|
|
20784
|
-
},
|
|
20803
|
+
}, _z = {
|
|
20785
20804
|
0: vf.line,
|
|
20786
20805
|
1: vf.corners
|
|
20787
|
-
},
|
|
20806
|
+
}, vz = {
|
|
20788
20807
|
0: !0,
|
|
20789
20808
|
1: !0,
|
|
20790
20809
|
2: !1,
|
|
20791
20810
|
3: !0
|
|
20792
|
-
},
|
|
20811
|
+
}, yz = 1920, bz = 4e6, xz = 5e7, Sz = /* @__PURE__ */ function(e) {
|
|
20793
20812
|
return e.BarcodeMRZ = "BarcodeMRZ", e.BoundsLite = "BoundsLite", e;
|
|
20794
|
-
}({}),
|
|
20813
|
+
}({}), Cz, wz, Tz = class e extends rz {
|
|
20795
20814
|
constructor({ errorCode: t, message: n, underlyingError: r, underlyingBaseError: i }) {
|
|
20796
|
-
let a = rz.getErrorKey(t,
|
|
20815
|
+
let a = rz.getErrorKey(t, pz);
|
|
20797
20816
|
super({
|
|
20798
20817
|
errorCode: t,
|
|
20799
20818
|
errorCodeKey: a,
|
|
@@ -20807,10 +20826,10 @@ var oz = {
|
|
|
20807
20826
|
});
|
|
20808
20827
|
}
|
|
20809
20828
|
};
|
|
20810
|
-
|
|
20811
|
-
var
|
|
20829
|
+
Cz = Tz, Cz.MODULE = hz, Cz.ERROR_ENUM_NAME = "ReaderModuleError", Cz.SHORT_CODE = "RM";
|
|
20830
|
+
var Ez = class e extends rz {
|
|
20812
20831
|
constructor({ errorCode: t, message: n, underlyingError: r, underlyingBaseError: i }) {
|
|
20813
|
-
let a = rz.getErrorKey(t,
|
|
20832
|
+
let a = rz.getErrorKey(t, mz);
|
|
20814
20833
|
super({
|
|
20815
20834
|
errorCode: t,
|
|
20816
20835
|
errorCodeKey: a,
|
|
@@ -20824,24 +20843,28 @@ var Tz = class e extends rz {
|
|
|
20824
20843
|
});
|
|
20825
20844
|
}
|
|
20826
20845
|
};
|
|
20827
|
-
|
|
20828
|
-
|
|
20829
|
-
|
|
20846
|
+
wz = Ez, wz.MODULE = hz, wz.ERROR_ENUM_NAME = "ScanError", wz.SHORT_CODE = "RMS";
|
|
20847
|
+
//#endregion
|
|
20848
|
+
//#region ../../node_modules/@lit/reactive-element/decorators/custom-element.js
|
|
20849
|
+
var Dz = (e) => (t, n) => {
|
|
20830
20850
|
n === void 0 ? customElements.define(e, t) : n.addInitializer(() => {
|
|
20831
20851
|
customElements.define(e, t);
|
|
20832
20852
|
});
|
|
20833
20853
|
};
|
|
20834
|
-
|
|
20835
|
-
|
|
20854
|
+
//#endregion
|
|
20855
|
+
//#region ../../node_modules/@lit/reactive-element/decorators/state.js
|
|
20856
|
+
function Oz(e) {
|
|
20836
20857
|
return YR(nz(nz({}, e), {}, {
|
|
20837
20858
|
state: !0,
|
|
20838
20859
|
attribute: !1
|
|
20839
20860
|
}));
|
|
20840
20861
|
}
|
|
20841
|
-
|
|
20842
|
-
|
|
20843
|
-
|
|
20844
|
-
|
|
20862
|
+
//#endregion
|
|
20863
|
+
//#region ../../node_modules/@lit/reactive-element/decorators/base.js
|
|
20864
|
+
var kz = (e, t, n) => (n.configurable = !0, n.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(e, t, n), n);
|
|
20865
|
+
//#endregion
|
|
20866
|
+
//#region ../../node_modules/@lit/reactive-element/decorators/query.js
|
|
20867
|
+
function Az(e, t) {
|
|
20845
20868
|
return (n, r, i) => {
|
|
20846
20869
|
let a = (t) => {
|
|
20847
20870
|
var n, r;
|
|
@@ -20859,30 +20882,31 @@ function kz(e, t) {
|
|
|
20859
20882
|
}
|
|
20860
20883
|
};
|
|
20861
20884
|
})() : i;
|
|
20862
|
-
return
|
|
20885
|
+
return kz(n, r, { get() {
|
|
20863
20886
|
let n = e.call(this);
|
|
20864
20887
|
return n === void 0 && (n = a(this), (n !== null || this.hasUpdated) && t.call(this, n)), n;
|
|
20865
20888
|
} });
|
|
20866
20889
|
}
|
|
20867
|
-
return
|
|
20890
|
+
return kz(n, r, { get() {
|
|
20868
20891
|
return a(this);
|
|
20869
20892
|
} });
|
|
20870
20893
|
};
|
|
20871
20894
|
}
|
|
20872
|
-
|
|
20873
|
-
|
|
20874
|
-
|
|
20895
|
+
//#endregion
|
|
20896
|
+
//#region src/utils/index.ts
|
|
20897
|
+
function jz(e) {
|
|
20898
|
+
return Mz.apply(this, arguments);
|
|
20875
20899
|
}
|
|
20876
|
-
function
|
|
20877
|
-
return
|
|
20900
|
+
function Mz() {
|
|
20901
|
+
return Mz = u(function* (e) {
|
|
20878
20902
|
return new Promise((t) => setTimeout(t, e));
|
|
20879
|
-
}),
|
|
20903
|
+
}), Mz.apply(this, arguments);
|
|
20880
20904
|
}
|
|
20881
|
-
function
|
|
20882
|
-
return
|
|
20905
|
+
function Nz(e) {
|
|
20906
|
+
return Pz.apply(this, arguments);
|
|
20883
20907
|
}
|
|
20884
|
-
function
|
|
20885
|
-
return
|
|
20908
|
+
function Pz() {
|
|
20909
|
+
return Pz = u(function* (e, t = 0, n = 0) {
|
|
20886
20910
|
let r = null, i = n * 1e3;
|
|
20887
20911
|
for (let n = 0; n <= t; n++) {
|
|
20888
20912
|
try {
|
|
@@ -20892,18 +20916,12 @@ function Nz() {
|
|
|
20892
20916
|
} catch (e) {
|
|
20893
20917
|
r = e;
|
|
20894
20918
|
}
|
|
20895
|
-
n < t && (yield
|
|
20919
|
+
n < t && (yield jz(i));
|
|
20896
20920
|
}
|
|
20897
20921
|
throw r;
|
|
20898
|
-
}),
|
|
20922
|
+
}), Pz.apply(this, arguments);
|
|
20899
20923
|
}
|
|
20900
|
-
var
|
|
20901
|
-
try {
|
|
20902
|
-
return new URL(e), !0;
|
|
20903
|
-
} catch (e) {
|
|
20904
|
-
return !1;
|
|
20905
|
-
}
|
|
20906
|
-
};
|
|
20924
|
+
var Fz = (e) => e ? (e.internalScenario && (e.scenario = e.internalScenario), delete e.internalScenario, e) : {};
|
|
20907
20925
|
function Iz(e, t, n, r, i) {
|
|
20908
20926
|
let a = e * t, o = a > i;
|
|
20909
20927
|
return {
|
|
@@ -21187,18 +21205,21 @@ var Vz = (e) => {
|
|
|
21187
21205
|
height: 100%;
|
|
21188
21206
|
}
|
|
21189
21207
|
`;
|
|
21190
|
-
|
|
21208
|
+
//#endregion
|
|
21209
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/decorateMetadata.js
|
|
21191
21210
|
function Wz(e, t) {
|
|
21192
21211
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
|
|
21193
21212
|
}
|
|
21194
|
-
|
|
21213
|
+
//#endregion
|
|
21214
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/decorate.js
|
|
21195
21215
|
function Gz(e, t, n, r) {
|
|
21196
21216
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
21197
21217
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
21198
21218
|
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
21199
21219
|
return i > 3 && a && Object.defineProperty(t, n, a), a;
|
|
21200
21220
|
}
|
|
21201
|
-
|
|
21221
|
+
//#endregion
|
|
21222
|
+
//#region src/web-components/document-idv/components/document-reader-camera/index.ts
|
|
21202
21223
|
var Kz = class extends Me {
|
|
21203
21224
|
constructor(...e) {
|
|
21204
21225
|
super(...e), this._performType = oz.DATA, this.props = null, this._handleDocumentReader = (e) => {
|
|
@@ -21217,9 +21238,12 @@ var Kz = class extends Me {
|
|
|
21217
21238
|
}
|
|
21218
21239
|
let t = (o = e.detail.data) == null ? void 0 : o.status, n = t === rp.OK, r = t === rp.TIMEOUT;
|
|
21219
21240
|
if (!(n || r) || !((s = e.detail.data) != null && s.response)) return;
|
|
21220
|
-
(c = this.props) != null && c.isProcessing
|
|
21241
|
+
if ((c = this.props) != null && c.isProcessing) {
|
|
21242
|
+
var d, f;
|
|
21243
|
+
(d = this.props) == null || (f = d.idvEventListener) == null || f.call(d, "IDV-DOCUMENT", "Success. Start to finalize package", "DEBUG"), this.props.isProcessing(!0);
|
|
21244
|
+
}
|
|
21221
21245
|
let i = (l = this.props) == null || (l = l.moduleProps) == null ? void 0 : l.finalizePackageSettings;
|
|
21222
|
-
|
|
21246
|
+
Nz(() => window.RegulaDocumentSDK.finalizePackage(), i == null ? void 0 : i.retryCount, i == null ? void 0 : i.retryDelay).then((e) => {
|
|
21223
21247
|
var t;
|
|
21224
21248
|
let n = {
|
|
21225
21249
|
transactionId: (e == null ? void 0 : e.transactionId) || "",
|
|
@@ -21239,8 +21263,8 @@ var Kz = class extends Me {
|
|
|
21239
21263
|
});
|
|
21240
21264
|
}
|
|
21241
21265
|
if (((i = e.detail) == null ? void 0 : i.action) === W.CLOSE || e.detail.action === W.CAMERA_PROCESS_CLOSED) {
|
|
21242
|
-
var
|
|
21243
|
-
(
|
|
21266
|
+
var p;
|
|
21267
|
+
(p = this.props) == null || p.perform({
|
|
21244
21268
|
transactionId: "",
|
|
21245
21269
|
cancel: !0,
|
|
21246
21270
|
has_nfc: !1,
|
|
@@ -21308,7 +21332,7 @@ var Kz = class extends Me {
|
|
|
21308
21332
|
background-color: ${a(e.cameraPreviewBackgroundColor)};
|
|
21309
21333
|
}
|
|
21310
21334
|
`), e != null && e.containerCloseButtonImage) {
|
|
21311
|
-
let i =
|
|
21335
|
+
let i = dz(e.containerCloseButtonImage, t, n);
|
|
21312
21336
|
i && r.push(o`
|
|
21313
21337
|
document-reader::part(container-close-button)::before {
|
|
21314
21338
|
background-image: url(${a(i)});
|
|
@@ -21316,7 +21340,7 @@ var Kz = class extends Me {
|
|
|
21316
21340
|
`);
|
|
21317
21341
|
}
|
|
21318
21342
|
if (e != null && e.menuFromCameraButtonImage) {
|
|
21319
|
-
let i =
|
|
21343
|
+
let i = dz(e.menuFromCameraButtonImage, t, n);
|
|
21320
21344
|
i && r.push(o`
|
|
21321
21345
|
document-reader::part(menu-from-camera-button)::before {
|
|
21322
21346
|
background-image: url(${a(i)});
|
|
@@ -21324,7 +21348,7 @@ var Kz = class extends Me {
|
|
|
21324
21348
|
`);
|
|
21325
21349
|
}
|
|
21326
21350
|
if (e != null && e.menuFromGalleryButtonImage) {
|
|
21327
|
-
let i =
|
|
21351
|
+
let i = dz(e.menuFromGalleryButtonImage, t, n);
|
|
21328
21352
|
i && r.push(o`
|
|
21329
21353
|
document-reader::part(menu-from-gallery-button)::before {
|
|
21330
21354
|
background-image: url(${a(i)});
|
|
@@ -21332,7 +21356,7 @@ var Kz = class extends Me {
|
|
|
21332
21356
|
`);
|
|
21333
21357
|
}
|
|
21334
21358
|
if (e != null && e.menuFromMobileButtonImage) {
|
|
21335
|
-
let i =
|
|
21359
|
+
let i = dz(e.menuFromMobileButtonImage, t, n);
|
|
21336
21360
|
i && r.push(o`
|
|
21337
21361
|
document-reader::part(menu-from-mobile-button)::before {
|
|
21338
21362
|
background-image: url(${a(i)});
|
|
@@ -21340,7 +21364,7 @@ var Kz = class extends Me {
|
|
|
21340
21364
|
`);
|
|
21341
21365
|
}
|
|
21342
21366
|
if (e != null && e.closeButton) {
|
|
21343
|
-
let i =
|
|
21367
|
+
let i = dz(e.closeButton, t, n);
|
|
21344
21368
|
i && r.push(o`
|
|
21345
21369
|
document-reader::part(controls-process-close-button)::before {
|
|
21346
21370
|
background-image: url(${a(i)});
|
|
@@ -21348,7 +21372,7 @@ var Kz = class extends Me {
|
|
|
21348
21372
|
`);
|
|
21349
21373
|
}
|
|
21350
21374
|
if (e != null && e.switchButton) {
|
|
21351
|
-
let i =
|
|
21375
|
+
let i = dz(e.switchButton, t, n);
|
|
21352
21376
|
i && r.push(o`
|
|
21353
21377
|
document-reader::part(controls-change-camera-button)::before {
|
|
21354
21378
|
background-image: url(${a(i)});
|
|
@@ -21356,7 +21380,7 @@ var Kz = class extends Me {
|
|
|
21356
21380
|
`);
|
|
21357
21381
|
}
|
|
21358
21382
|
if (e != null && e.infoTryAgainButtonImage) {
|
|
21359
|
-
let i =
|
|
21383
|
+
let i = dz(e.infoTryAgainButtonImage, t, n);
|
|
21360
21384
|
i && r.push(o`
|
|
21361
21385
|
document-reader::part(info-try-again-button)::before {
|
|
21362
21386
|
background-image: url(${a(i)});
|
|
@@ -21415,20 +21439,20 @@ var Kz = class extends Me {
|
|
|
21415
21439
|
uploadFileButton: t == null ? void 0 : t.uploadFileButton,
|
|
21416
21440
|
mirrorButton: t == null ? void 0 : t.mirrorButton,
|
|
21417
21441
|
nonce: (i = this.props) == null ? void 0 : i.nonce
|
|
21418
|
-
}), u = nz(nz(nz(nz(nz({}, !!r && typeof r == "string" && { locale: r.slice(0, 2).toLowerCase() }), typeof (n == null ? void 0 : n.captureMode) == "number" && n.captureMode in
|
|
21442
|
+
}), u = nz(nz(nz(nz(nz({}, !!r && typeof r == "string" && { locale: r.slice(0, 2).toLowerCase() }), typeof (n == null ? void 0 : n.captureMode) == "number" && n.captureMode in gz && { captureMode: gz[n.captureMode] }), typeof (t == null ? void 0 : t.cameraFrameShapeType) == "number" && t.cameraFrameShapeType in _z && { cameraFrameShapeType: _z[t.cameraFrameShapeType] }), (typeof (n == null || (a = n.videoOutputSettings) == null ? void 0 : a.AVVideoWidthKey) == "number" || typeof (n == null || (o = n.videoOutputSettings) == null ? void 0 : o.AVVideoHeightKey) == "number") && { resolution: nz(nz({}, typeof (n == null || (s = n.videoOutputSettings) == null ? void 0 : s.AVVideoWidthKey) == "number" && { width: n.videoOutputSettings.AVVideoWidthKey }), typeof (n == null || (c = n.videoOutputSettings) == null ? void 0 : c.AVVideoHeightKey) == "number" && { height: n.videoOutputSettings.AVVideoHeightKey }) }), typeof (n == null ? void 0 : n.cameraFrame) == "number" && n.cameraFrame in vz && { cameraFrame: vz[n.cameraFrame] });
|
|
21419
21443
|
return nz(nz({}, l), u);
|
|
21420
21444
|
}
|
|
21421
21445
|
_setDocReaderProps() {
|
|
21422
21446
|
var e, t, n;
|
|
21423
21447
|
if (!this.props || !this._component) return;
|
|
21424
21448
|
(e = (t = this.props).isProcessing) == null || e.call(t, !0);
|
|
21425
|
-
let { processParam: r, functionality: i, customization: a, sessionId: o, copyright: c, serviceToken: l, locale: u, preloadAssetsRequired: d, failedAssets: f } = this.props.moduleProps, p =
|
|
21426
|
-
if (!m || !
|
|
21427
|
-
let e = new
|
|
21428
|
-
errorCode:
|
|
21449
|
+
let { processParam: r, functionality: i, customization: a, sessionId: o, copyright: c, serviceToken: l, locale: u, preloadAssetsRequired: d, failedAssets: f } = this.props.moduleProps, p = Fz(r), m = p == null || (n = p.backendProcessing) == null ? void 0 : n.serviceURL;
|
|
21450
|
+
if (!m || !sz(m)) {
|
|
21451
|
+
let e = new Ez({
|
|
21452
|
+
errorCode: mz.CONFIGURATION_FAILED,
|
|
21429
21453
|
message: "serviceURL is not defined or is invalid."
|
|
21430
|
-
}), t = new
|
|
21431
|
-
errorCode:
|
|
21454
|
+
}), t = new Tz({
|
|
21455
|
+
errorCode: pz.SCAN_ERROR,
|
|
21432
21456
|
underlyingBaseError: e
|
|
21433
21457
|
});
|
|
21434
21458
|
this.props.perform(t);
|
|
@@ -21456,8 +21480,9 @@ var Kz = class extends Me {
|
|
|
21456
21480
|
></document-reader>`;
|
|
21457
21481
|
}
|
|
21458
21482
|
}, qz = (Kz.styles = [Uz], Kz);
|
|
21459
|
-
Gz([
|
|
21460
|
-
|
|
21483
|
+
Gz([Oz(), Wz("design:type", Object)], qz.prototype, "props", void 0), Gz([Az("document-reader"), Wz("design:type", wI === void 0 ? Object : wI)], qz.prototype, "_component", void 0), qz = Gz([Dz("document-reader-camera")], qz);
|
|
21484
|
+
//#endregion
|
|
21485
|
+
//#region ../../node_modules/lit-html/directives/if-defined.js
|
|
21461
21486
|
var Jz = (e) => e == null ? z : e, Yz = o`
|
|
21462
21487
|
.gallery-root {
|
|
21463
21488
|
display: flex;
|
|
@@ -21599,11 +21624,12 @@ var Jz = (e) => e == null ? z : e, Yz = o`
|
|
|
21599
21624
|
let a = [...(n = e.target.files) == null ? [] : n];
|
|
21600
21625
|
if (!a.length) return;
|
|
21601
21626
|
(r = t.props) != null && r.isProcessing && t.props.isProcessing(!0), yield window.RegulaDocumentSDK.createBackendTransaction({}, window.RegulaDocumentSDK.recognizerProcessParam);
|
|
21627
|
+
let o = [];
|
|
21602
21628
|
for (let e of a) {
|
|
21603
|
-
let { isExtraLargeResolution: n, isDownscaleNeeded: r } = yield Lz(e,
|
|
21629
|
+
let { isExtraLargeResolution: n, isDownscaleNeeded: r } = yield Lz(e, yz, bz, xz), i = e.type.startsWith("image/webp");
|
|
21604
21630
|
if (n) {
|
|
21605
|
-
var
|
|
21606
|
-
(
|
|
21631
|
+
var s;
|
|
21632
|
+
(s = t.props) == null || s.perform({
|
|
21607
21633
|
transactionId: "",
|
|
21608
21634
|
cancel: !1,
|
|
21609
21635
|
has_nfc: !1,
|
|
@@ -21611,49 +21637,49 @@ var Jz = (e) => e == null ? z : e, Yz = o`
|
|
|
21611
21637
|
}, t._performType);
|
|
21612
21638
|
return;
|
|
21613
21639
|
}
|
|
21614
|
-
let a;
|
|
21615
21640
|
if (r || i) {
|
|
21616
|
-
let n = yield zz(e,
|
|
21641
|
+
let n = yield zz(e, yz, bz);
|
|
21617
21642
|
if (!n.ok) {
|
|
21618
|
-
var
|
|
21643
|
+
var c;
|
|
21619
21644
|
let e = {
|
|
21620
21645
|
transactionId: "",
|
|
21621
21646
|
cancel: !1,
|
|
21622
21647
|
has_nfc: !1,
|
|
21623
21648
|
errorCode: r ? "IMAGE_DOWNSCALING_ERROR" : "IMAGE_PROCESSING_ERROR"
|
|
21624
21649
|
};
|
|
21625
|
-
(
|
|
21650
|
+
(c = t.props) == null || c.perform(e, t._performType);
|
|
21626
21651
|
return;
|
|
21627
21652
|
}
|
|
21628
|
-
|
|
21629
|
-
} else
|
|
21630
|
-
|
|
21631
|
-
|
|
21632
|
-
|
|
21633
|
-
|
|
21634
|
-
|
|
21635
|
-
|
|
21636
|
-
|
|
21637
|
-
|
|
21638
|
-
|
|
21639
|
-
|
|
21640
|
-
}
|
|
21653
|
+
o.push(n.imageData);
|
|
21654
|
+
} else o.push(yield e.arrayBuffer());
|
|
21655
|
+
}
|
|
21656
|
+
try {
|
|
21657
|
+
yield window.RegulaDocumentSDK.processImage(o);
|
|
21658
|
+
} catch (e) {
|
|
21659
|
+
var l;
|
|
21660
|
+
(l = t.props) == null || l.perform({
|
|
21661
|
+
transactionId: "",
|
|
21662
|
+
cancel: !1,
|
|
21663
|
+
has_nfc: !1,
|
|
21664
|
+
errorCode: "IMAGE_PROCESSING_ERROR"
|
|
21665
|
+
}, t._performType);
|
|
21666
|
+
return;
|
|
21641
21667
|
}
|
|
21642
|
-
let
|
|
21668
|
+
let d = (i = t.props) == null || (i = i.moduleProps) == null ? void 0 : i.finalizePackageSettings;
|
|
21643
21669
|
try {
|
|
21644
|
-
var
|
|
21645
|
-
let e = yield
|
|
21670
|
+
var f;
|
|
21671
|
+
let e = yield Nz(u(function* () {
|
|
21646
21672
|
return window.RegulaDocumentSDK.finalizePackage();
|
|
21647
|
-
}),
|
|
21673
|
+
}), d == null ? void 0 : d.retryCount, d == null ? void 0 : d.retryDelay), n = {
|
|
21648
21674
|
transactionId: e == null ? void 0 : e.transactionId,
|
|
21649
21675
|
cancel: !1,
|
|
21650
21676
|
has_nfc: !1,
|
|
21651
21677
|
errorCode: ""
|
|
21652
21678
|
};
|
|
21653
|
-
(
|
|
21679
|
+
(f = t.props) == null || f.perform(n, t._performType);
|
|
21654
21680
|
} catch (e) {
|
|
21655
|
-
var
|
|
21656
|
-
console.log("finalizePackage error: ", e), (
|
|
21681
|
+
var p;
|
|
21682
|
+
console.log("finalizePackage error: ", e), (p = t.props) == null || p.perform({
|
|
21657
21683
|
transactionId: "",
|
|
21658
21684
|
cancel: !0,
|
|
21659
21685
|
has_nfc: !1,
|
|
@@ -21683,13 +21709,13 @@ var Jz = (e) => e == null ? z : e, Yz = o`
|
|
|
21683
21709
|
if (!this.props) return;
|
|
21684
21710
|
let { processParam: t, sessionId: n, serviceToken: r, selectionLimit: i } = this.props.moduleProps;
|
|
21685
21711
|
this._input.multiple = typeof i == "number" && (i === 0 || i > 1);
|
|
21686
|
-
let a =
|
|
21687
|
-
if (!o || !
|
|
21688
|
-
let e = new
|
|
21689
|
-
errorCode:
|
|
21712
|
+
let a = Fz(t), o = a == null || (e = a.backendProcessing) == null ? void 0 : e.serviceURL;
|
|
21713
|
+
if (!o || !sz(o)) {
|
|
21714
|
+
let e = new Ez({
|
|
21715
|
+
errorCode: mz.CONFIGURATION_FAILED,
|
|
21690
21716
|
message: "serviceURL is not defined or is invalid."
|
|
21691
|
-
}), t = new
|
|
21692
|
-
errorCode:
|
|
21717
|
+
}), t = new Tz({
|
|
21718
|
+
errorCode: pz.SCAN_ERROR,
|
|
21693
21719
|
underlyingBaseError: e
|
|
21694
21720
|
});
|
|
21695
21721
|
this.props.perform(t);
|
|
@@ -21707,7 +21733,7 @@ var Jz = (e) => e == null ? z : e, Yz = o`
|
|
|
21707
21733
|
return de`<div
|
|
21708
21734
|
part="gallery-root"
|
|
21709
21735
|
class="gallery-root"
|
|
21710
|
-
dir="${
|
|
21736
|
+
dir="${lz(n)}"
|
|
21711
21737
|
lang="${n}"
|
|
21712
21738
|
style="background: ${Jz((t = this.props) == null || (t = t.moduleProps) == null ? void 0 : t.backgroundColor)}"
|
|
21713
21739
|
>
|
|
@@ -21728,8 +21754,9 @@ var Jz = (e) => e == null ? z : e, Yz = o`
|
|
|
21728
21754
|
</div>`;
|
|
21729
21755
|
}
|
|
21730
21756
|
}, eB = ($z.styles = [Yz], $z);
|
|
21731
|
-
Gz([
|
|
21732
|
-
|
|
21757
|
+
Gz([Oz(), Wz("design:type", Object)], eB.prototype, "props", void 0), Gz([Az("#file-input"), Wz("design:type", typeof HTMLInputElement > "u" ? Object : HTMLInputElement)], eB.prototype, "_input", void 0), eB = Gz([Dz("document-reader-gallery")], eB);
|
|
21758
|
+
//#endregion
|
|
21759
|
+
//#region src/web-components/document-idv/index.ts
|
|
21733
21760
|
var tB, nB = !1, rB = class e extends Me {
|
|
21734
21761
|
constructor(...e) {
|
|
21735
21762
|
super(...e), this.props = null, this.renderVersion = 0;
|
|
@@ -21737,8 +21764,8 @@ var tB, nB = !1, rB = class e extends Me {
|
|
|
21737
21764
|
setProps(t) {
|
|
21738
21765
|
if (!e.getSupportedTemplates().includes(t.moduleProps.templateId)) {
|
|
21739
21766
|
var n;
|
|
21740
|
-
let e = new
|
|
21741
|
-
errorCode:
|
|
21767
|
+
let e = new Tz({
|
|
21768
|
+
errorCode: pz.UNKNOWN_STEP,
|
|
21742
21769
|
message: `TemplateId ${t.moduleProps.templateId} is not supported`
|
|
21743
21770
|
});
|
|
21744
21771
|
(n = t.perform) == null || n.call(t, e);
|
|
@@ -21746,8 +21773,8 @@ var tB, nB = !1, rB = class e extends Me {
|
|
|
21746
21773
|
let r = t.moduleProps.failedAssets;
|
|
21747
21774
|
if (r && r.blockingAssets.size > 0) {
|
|
21748
21775
|
var i;
|
|
21749
|
-
let e = new
|
|
21750
|
-
errorCode:
|
|
21776
|
+
let e = new Tz({
|
|
21777
|
+
errorCode: pz.IMAGE_LOADING_FAILED,
|
|
21751
21778
|
message: `Failed to load image asset${r.blockingAssets.size > 1 ? "s" : ""}: ${[...r.blockingAssets].join(", ")}`
|
|
21752
21779
|
});
|
|
21753
21780
|
(i = t.perform) == null || i.call(t, e);
|
|
@@ -21758,7 +21785,7 @@ var tB, nB = !1, rB = class e extends Me {
|
|
|
21758
21785
|
return nB;
|
|
21759
21786
|
}
|
|
21760
21787
|
static getSupportedTemplates() {
|
|
21761
|
-
return [
|
|
21788
|
+
return [fz.DOC_READER, fz.DOC_READER_GALLERY];
|
|
21762
21789
|
}
|
|
21763
21790
|
static initialize(e) {
|
|
21764
21791
|
var t, n;
|
|
@@ -21775,13 +21802,14 @@ var tB, nB = !1, rB = class e extends Me {
|
|
|
21775
21802
|
nB = !1, (e = window.RegulaDocumentSDK) == null || e.shutdown();
|
|
21776
21803
|
}
|
|
21777
21804
|
static getIdentifier() {
|
|
21778
|
-
return
|
|
21805
|
+
return hz;
|
|
21779
21806
|
}
|
|
21780
21807
|
static cancel() {}
|
|
21781
21808
|
render() {
|
|
21782
21809
|
var e;
|
|
21783
|
-
return de`${ze(this.renderVersion, de`${XR((e = this.props) == null || (e = e.moduleProps) == null ? void 0 : e.templateId, [[
|
|
21810
|
+
return de`${ze(this.renderVersion, de`${XR((e = this.props) == null || (e = e.moduleProps) == null ? void 0 : e.templateId, [[fz.DOC_READER, () => de`<document-reader-camera .props=${this.props}></document-reader-camera>`], [fz.DOC_READER_GALLERY, () => de`<document-reader-gallery .props=${this.props}></document-reader-gallery>`]])}`)}`;
|
|
21784
21811
|
}
|
|
21785
21812
|
};
|
|
21786
|
-
tB = rB, tB.displayName =
|
|
21787
|
-
|
|
21813
|
+
tB = rB, tB.displayName = hz, Gz([YR({ attribute: !1 }), Wz("design:type", Object)], rB.prototype, "props", void 0), Gz([YR({ attribute: !1 }), Wz("design:type", Object)], rB.prototype, "renderVersion", void 0), iz(hz, rB);
|
|
21814
|
+
//#endregion
|
|
21815
|
+
export { rB as DocumentIdv, Sz as ModuleType };
|