@regulaforensics/idv-document 4.0.679-nightly → 4.0.682-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/index.d.ts CHANGED
@@ -1,13 +1,14 @@
1
- import { BaseModule } from '../../../../interfaces-idv/src';
2
- import { FailedAssets } from '../../interfaces-idv/src';
3
- import { IdvAsset } from '../../interfaces-idv/src';
4
- import { IdvModuleProps } from '../../../../interfaces-idv/src';
5
1
  import { InternalScenarios } from '@regulaforensics/vp-frontend-document-components';
6
2
  import { LitElement } from 'lit';
7
3
  import { MirrorType } from '@regulaforensics/vp-frontend-document-components';
8
- import { ModuleType as ModuleType_2 } from '@regulaforensics/vp-frontend-document-components';
4
+ import { ModuleType } from '@regulaforensics/vp-frontend-document-components';
9
5
  import { TemplateResult } from 'lit-html';
10
6
 
7
+ declare abstract class BaseModule<TModuleProps = unknown, TModulesConfig = unknown> extends HTMLElement {
8
+ abstract props: IdvModuleProps<TModuleProps, TModulesConfig> | null;
9
+ abstract setProps(config: IdvModuleProps<TModuleProps, TModulesConfig>): void;
10
+ }
11
+
11
12
  declare type DocumentGalleryProps = {
12
13
  processParam?: {
13
14
  multipageProcessing?: boolean;
@@ -59,7 +60,7 @@ declare type DocumentModuleProps = DocumentGalleryProps | DocumentReaderProps;
59
60
  declare type DocumentModulesConfig = {
60
61
  docreader: {
61
62
  devLicense?: string;
62
- module?: ModuleType_2;
63
+ module?: ModuleType;
63
64
  };
64
65
  };
65
66
 
@@ -164,9 +165,47 @@ declare type DocumentReaderProps = {
164
165
  };
165
166
  };
166
167
 
167
- export declare enum ModuleType {
168
- BarcodeMRZ = "BarcodeMRZ",
169
- BoundsLite = "BoundsLite"
170
- }
168
+ declare type FailedAssets = {
169
+ imageURL: Set<string>;
170
+ base64: Set<string>;
171
+ blockingAssets: Set<string>;
172
+ };
173
+
174
+ declare type IdvAsset = {
175
+ idvAsset: ImageLike;
176
+ };
177
+
178
+ declare type IdvModuleProps<TModuleProps, TModulesConfig> = {
179
+ isProcessing?: (isProcessing: boolean) => void;
180
+ moduleProps: TModuleProps;
181
+ modulesConfig?: TModulesConfig;
182
+ perform: (data: any, type?: PerformType) => void;
183
+ idvEventListener: (module: string, data: any, logLevel?: 'INFO' | 'DEBUG') => void;
184
+ nonce?: string;
185
+ };
186
+
187
+ declare type ImageBase = {
188
+ imageURL?: string;
189
+ imageId?: string;
190
+ base64?: string;
191
+ prepareRequired?: boolean;
192
+ failurePolicy?: ImageFailurePolicy;
193
+ timeout?: number;
194
+ };
195
+
196
+ declare type ImageFailurePolicy = 'ignore' | 'placeholderImage' | 'error';
197
+
198
+ declare type ImageLike = ImageBase & {
199
+ placeholderImage?: ImageLike;
200
+ };
201
+
202
+ export { ModuleType }
203
+
204
+ declare type PerformType = (typeof PerformTypes)[keyof typeof PerformTypes] | undefined;
205
+
206
+ declare const PerformTypes: {
207
+ readonly FORM: "form";
208
+ readonly DATA: "data";
209
+ };
171
210
 
172
211
  export { }
package/dist/main.iife.js CHANGED
@@ -32,7 +32,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
32
32
  <slot />
33
33
  `}},qI=function(e,t){return qI=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},qI(e,t)};function JI(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);qI(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function YI(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function XI(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function ZI(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function QI(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function $I(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function eL(e){return this instanceof eL?(this.v=e,this):new eL(e)}function tL(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof eL?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function nL(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof ZI==`function`?ZI(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}function rL(e){return typeof e==`function`}function iL(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var aL=iL(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
34
34
  `+t.map(function(e,t){return t+1+`) `+e.toString()}).join(`
35
- `):``,this.name=`UnsubscriptionError`,this.errors=t}});function oL(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var sL=(function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a){if(this._parentage=null,Array.isArray(a))try{for(var o=ZI(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this)}var c=this.initialTeardown;if(rL(c))try{c()}catch(e){i=e instanceof aL?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=ZI(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{uL(f)}catch(e){i=i==null?[]:i,e instanceof aL?i=$I($I([],QI(i)),QI(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new aL(i)}},e.prototype.add=function(t){var n;if(t&&t!==this){if(this.closed)uL(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)==null?[]:n).push(t)}}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&oL(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&oL(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),cL=sL.EMPTY;function lL(e){return e instanceof sL||e&&`closed`in e&&rL(e.remove)&&rL(e.add)&&rL(e.unsubscribe)}function uL(e){rL(e)?e():e.unsubscribe()}var dL={Promise:void 0},fL={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,$I([e,t],QI(n)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function pL(e){fL.setTimeout(function(){throw e})}function mL(){}function hL(e){e()}var gL=(function(e){JI(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,lL(t)&&t.add(n)):n.destination=xL,n}return t.create=function(e,t,n){return new vL(e,t,n)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(sL),_L=(function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){yL(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){yL(e)}else yL(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){yL(e)}},e})(),vL=(function(e){JI(t,e);function t(t,n,r){var i=e.call(this)||this;return i.destination=new _L(rL(t)||!t?{next:t==null?void 0:t,error:n==null?void 0:n,complete:r==null?void 0:r}:t),i}return t})(gL);function yL(e){pL(e)}function bL(e){throw e}var xL={closed:!0,next:mL,error:bL,complete:mL},SL=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function CL(e){return e}function wL(e){return e.length===0?CL:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var TL=(function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=OL(e)?e:new vL(e,t,n);return hL(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=EL(t),new t(function(t,r){var i=new vL({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){var t;return(t=this.source)==null?void 0:t.subscribe(e)},e.prototype[SL]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return wL(e)(this)},e.prototype.toPromise=function(e){var t=this;return e=EL(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e})();function EL(e){var t;return(t=e==null?dL.Promise:e)==null?Promise:t}function DL(e){return e&&rL(e.next)&&rL(e.error)&&rL(e.complete)}function OL(e){return e&&e instanceof gL||DL(e)&&lL(e)}function kL(e){return rL(e==null?void 0:e.lift)}function AL(e){return function(t){if(kL(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function jL(e,t,n,r,i){return new ML(e,t,n,r,i)}var ML=(function(e){JI(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t})(gL),NL=iL(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),PL=(function(e){JI(t,e);function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.prototype.lift=function(e){var t=new FL(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new NL},t.prototype.next=function(e){var t=this;hL(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=ZI(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;hL(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;hL(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)==null?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?cL:(this.currentObservers=null,a.push(e),new sL(function(){t.currentObservers=null,oL(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new TL;return e.source=this,e},t.create=function(e,t){return new FL(e,t)},t})(TL),FL=(function(e){JI(t,e);function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.prototype.next=function(e){var t,n;(n=(t=this.destination)==null?void 0:t.next)==null||n.call(t,e)},t.prototype.error=function(e){var t,n;(n=(t=this.destination)==null?void 0:t.error)==null||n.call(t,e)},t.prototype.complete=function(){var e,t;(t=(e=this.destination)==null?void 0:e.complete)==null||t.call(e)},t.prototype._subscribe=function(e){var t,n;return(n=(t=this.source)==null?void 0:t.subscribe(e))==null?cL:n},t})(PL),IL=(function(e){return e&&typeof e.length==`number`&&typeof e!=`function`});function LL(e){return rL(e==null?void 0:e.then)}function RL(e){return rL(e[SL])}function zL(e){return Symbol.asyncIterator&&rL(e==null?void 0:e[Symbol.asyncIterator])}function BL(e){return TypeError(`You provided `+(typeof e==`object`&&e?`an invalid object`:`'`+e+`'`)+` where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function VL(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}var HL=VL();function UL(e){return rL(e==null?void 0:e[HL])}function WL(e){return tL(this,arguments,function(){var t,n,r,i;return XI(this,function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,eL(t.read())];case 3:return n=a.sent(),r=n.value,i=n.done,i?[4,eL(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,eL(r)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function GL(e){return rL(e==null?void 0:e.getReader)}function KL(e){if(e instanceof TL)return e;if(e!=null){if(RL(e))return qL(e);if(IL(e))return JL(e);if(LL(e))return YL(e);if(zL(e))return ZL(e);if(UL(e))return XL(e);if(GL(e))return QL(e)}throw BL(e)}function qL(e){return new TL(function(t){var n=e[SL]();if(rL(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}function JL(e){return new TL(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function YL(e){return new TL(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,pL)})}function XL(e){return new TL(function(t){var n,r;try{for(var i=ZI(e),a=i.next();!a.done;a=i.next()){var o=a.value;if(t.next(o),t.closed)return}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function ZL(e){return new TL(function(t){$L(e,t).catch(function(e){return t.error(e)})})}function QL(e){return ZL(WL(e))}function $L(e,t){var n,r,i,a;return YI(this,void 0,void 0,function(){var o,s;return XI(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=nL(e),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),r.done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),i={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function eR(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}function tR(e,t){return t===void 0&&(t=0),AL(function(n,r){n.subscribe(jL(r,function(n){return eR(r,e,function(){return r.next(n)},t)},function(){return eR(r,e,function(){return r.complete()},t)},function(n){return eR(r,e,function(){return r.error(n)},t)}))})}function nR(e,t){return t===void 0&&(t=0),AL(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function rR(e,t){return KL(e).pipe(nR(t),tR(t))}function iR(e,t){return KL(e).pipe(nR(t),tR(t))}function aR(e,t){return new TL(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function oR(e,t){return new TL(function(n){var r;return eR(n,t,function(){r=e[HL](),eR(n,t,function(){var e,t,i;try{e=r.next(),t=e.value,i=e.done}catch(e){n.error(e);return}i?n.complete():n.next(t)},0,!0)}),function(){return rL(r==null?void 0:r.return)&&r.return()}})}function sR(e,t){if(!e)throw Error(`Iterable cannot be null`);return new TL(function(n){eR(n,t,function(){var r=e[Symbol.asyncIterator]();eR(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function cR(e,t){return sR(WL(e),t)}function lR(e,t){if(e!=null){if(RL(e))return rR(e,t);if(IL(e))return aR(e,t);if(LL(e))return iR(e,t);if(zL(e))return sR(e,t);if(UL(e))return oR(e,t);if(GL(e))return cR(e,t)}throw BL(e)}function uR(e,t){return t?lR(e,t):KL(e)}function dR(e,t){return AL(function(n,r){var i=0;n.subscribe(jL(r,function(n){r.next(e.call(t,n,i++))}))})}function fR(e,t,n,r,i,a,o,s){var c=[],l=0,u=0,d=!1,f=function(){d&&!c.length&&!l&&t.complete()},p=function(e){return l<r?m(e):c.push(e)},m=function(e){l++;var i=!1;KL(n(e,u++)).subscribe(jL(t,function(e){t.next(e)},function(){i=!0},void 0,function(){if(i)try{l--;for(var e=function(){var e=c.shift();o||m(e)};c.length&&l<r;)e();f()}catch(e){t.error(e)}}))};return e.subscribe(jL(t,p,function(){d=!0,f()})),function(){}}function pR(e,t,n){return n===void 0&&(n=1/0),rL(t)?pR(function(n,r){return dR(function(e,i){return t(n,e,r,i)})(KL(e(n,r)))},n):(typeof t==`number`&&(n=t),AL(function(t,r){return fR(t,r,e,n)}))}function mR(e){return AL(function(t,n){var r=null,i=!1,a;r=t.subscribe(jL(n,void 0,void 0,function(o){a=KL(e(o,mR(e)(t))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function hR(e,t){return rL(t)?pR(e,t,1):pR(e,1)}function gR(e,t,n){return(t=_R(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _R(e){var t=vR(e,`string`);return typeof t==`symbol`?t:t+``}function vR(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var yR=class{constructor(){gR(this,`taskSubject`,new PL),this.taskSubject.pipe(hR(e=>uR(e()).pipe(mR(e=>uR(Promise.reject(e)))))).subscribe()}addTask(e){return new Promise((t,n)=>{this.taskSubject.next(()=>V(this,null,function*(){try{t(yield e())}catch(e){n(e)}}))})}},bR=`text/plain`,xR=`us-ascii`,SR=`%(?:3A|2F|3F|23|5B|5D|40|21|24|26|27|28|29|2A|2B|2C|3B|3D)`,CR=`__normalize_url_encoded_reserved__`,wR=/__normalize_url_encoded_reserved__(\d+)__/g,TR=new RegExp(SR,`i`),ER=new RegExp(SR,`gi`),DR=(e,t)=>Array.isArray(t)&&t.some(t=>t instanceof RegExp?t.flags.includes(`g`)||t.flags.includes(`y`)?new RegExp(t.source,t.flags.replaceAll(/[gy]/g,``)).test(e):t.test(e):t===e),OR=new Set([`https:`,`http:`,`file:`]),kR=e=>{if(typeof e!=`string`)return;let t=e.trim().toLowerCase().replace(/:$/,``);return t===``?void 0:`${t}:`},AR=e=>{try{let{protocol:t}=new URL(e),n=e.slice(0,t.length+2).toLowerCase()===`${t}//`;if(t.endsWith(`:`)&&(!t.includes(`.`)||n)&&!OR.has(t))return t}catch(e){}},jR=e=>{try{return decodeURIComponent(e.replaceAll(`+`,`%20`))}catch(t){return new URLSearchParams(`${e}=`).keys().next().value}},MR=e=>{let t=new Set;if(!e)return t;for(let n of e.slice(1).split(`&`))n&&!n.includes(`=`)&&t.add(jR(n));return t},NR=e=>{let t=e;try{t=decodeURIComponent(e)}catch(n){t=new URLSearchParams(e).toString()}let n=e=>{let t=new Set;for(let n of e.matchAll(wR))t.add(Number.parseInt(n[1],10));return t},r=n(e);for(let e of n(t))r.add(e);let i=0;for(;r.has(i);)i++;return`${CR}${i}__`},PR=(e,t)=>{if(!t)return e.sort(),e.toString();let n=e=>e.replace(t,(e,t)=>String.fromCodePoint(Number.parseInt(t,16))),r=[...e.entries()];return r.sort(([e],[t])=>{let r=n(e),i=n(t);return r<i?-1:+(r>i)}),new URLSearchParams(r).toString()},FR=(e,t)=>t?e.replace(t,(e,t)=>String.fromCodePoint(Number.parseInt(t,16))):e,IR=(e,t,n)=>{let r=t===`always`,i=t===`never`,a=r||i?void 0:MR(n),o=e=>e.replaceAll(`+`,`%20`),s=e=>r?`${e}=`:i||a.has(jR(e))?e:`${e}=`,c=e=>{let t=e.indexOf(`=`);if(t===-1)return s(o(e));let n=e.slice(0,t),r=e.slice(t+1);return r===``?n===``?`=`:s(o(n)):`${o(n)}=${r}`},l=e.slice(1).split(`&`).filter(Boolean);return l.length===0?``:`?${l.map(e=>c(e)).join(`&`)}`},LR=(e,{stripHash:t})=>{let n=RegExp(`^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$`).exec(e);if(!n)throw Error(`Invalid URL: ${e}`);let{type:r,data:i,hash:a}=n.groups,o=r.split(`;`),s=o.at(-1)===`base64`;s&&o.pop();let c=o.shift().toLowerCase(),l=[...o.map(e=>{let[t,n=``]=e.split(`=`).map(e=>e.trim());return t===`charset`&&(n=n.toLowerCase(),n===xR)?``:`${t}${n?`=${n}`:``}`}).filter(Boolean)];s&&l.push(`base64`),(l.length>0||c&&c!==bR)&&l.unshift(c);let u=t||!a?``:`#${a}`;return`data:${l.join(`;`)},${s?i.trim():i}${u}`};function RR(e,t){if(t=B({defaultProtocol:`http`,normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,removeExplicitPort:!1,sortQueryParameters:!0,removePath:!1,transformPath:!1,emptyQueryValue:`preserve`},t),typeof t.defaultProtocol==`string`&&!t.defaultProtocol.endsWith(`:`)&&(t.defaultProtocol=`${t.defaultProtocol}:`),e=e.trim(),/^data:/i.test(e))return LR(e,t);let n=Array.isArray(t.customProtocols)?t.customProtocols:[],r=new Set(n.map(e=>kR(e)).filter(Boolean)),i=AR(e);if(i&&!r.has(i))return e;let a=e.startsWith(`//`);(a||!/^\.*\//.test(e))&&!i&&(e=e.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,t.defaultProtocol));let o=new URL(e);if(t.forceHttp&&t.forceHttps)throw Error("The `forceHttp` and `forceHttps` options cannot be used together");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){let e=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,t=0,n=``;for(;;){let r=e.exec(o.pathname);if(!r)break;let i=r[0],a=r.index,s=o.pathname.slice(t,a);n+=s.replaceAll(/\/{2,}/g,`/`),n+=i,t=a+i.length}let r=o.pathname.slice(t);n+=r.replaceAll(/\/{2,}/g,`/`),o.pathname=n}if(o.pathname)try{o.pathname=decodeURI(o.pathname).replaceAll(`\\`,`%5C`)}catch(e){}if(t.removeDirectoryIndex===!0&&(t.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(t.removeDirectoryIndex)&&t.removeDirectoryIndex.length>0){let e=o.pathname.split(`/`).filter(Boolean),n=e.at(-1);n&&DR(n,t.removeDirectoryIndex)&&(e.pop(),o.pathname=e.length>0?`/${e.join(`/`)}/`:`/`)}if(t.removePath&&(o.pathname=`/`),t.transformPath&&typeof t.transformPath==`function`){let e=o.pathname.split(`/`).filter(Boolean),n=t.transformPath(e);o.pathname=(n==null?void 0:n.length)>0?`/${n.join(`/`)}`:`/`}o.hostname&&(o.hostname=o.hostname.replace(/\.$/,``),t.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(o.hostname)&&(o.hostname=o.hostname.replace(/^www\./,``)));let s=o.search,c;if(t.sortQueryParameters&&TR.test(s)){let e=NR(s);o.search=s.replaceAll(ER,t=>`${e}${t.slice(1).toUpperCase()}`),c=RegExp(`${e}([0-9A-F]{2})`,`g`)}let l=Array.isArray(t.keepQueryParameters),{searchParams:u}=o;if(!l&&Array.isArray(t.removeQueryParameters)&&t.removeQueryParameters.length>0)for(let e of[...u.keys()])DR(FR(e,c),t.removeQueryParameters)&&u.delete(e);if(!l&&t.removeQueryParameters===!0&&(o.search=``),l&&t.keepQueryParameters.length>0)for(let e of[...u.keys()])DR(FR(e,c),t.keepQueryParameters)||u.delete(e);else l&&(o.search=``);t.sortQueryParameters&&(o.search=PR(o.searchParams,c),o.search=decodeURIComponent(o.search.replaceAll(/%(?:26|23|3f|25|2b)/gi,e=>`%25${e.slice(1)}`)),c&&(o.search=o.search.replace(c,`%$1`))),o.search=IR(o.search,t.emptyQueryValue,s),t.removeTrailingSlash&&(o.pathname=o.pathname.replace(/\/$/,``)),t.removeExplicitPort&&o.port&&(o.port=``);let d=e;return e=o.toString(),!t.removeSingleSlash&&o.pathname===`/`&&!d.endsWith(`/`)&&o.hash===``&&(e=e.replace(/\/$/,``)),(t.removeTrailingSlash||o.pathname===`/`)&&o.hash===``&&t.removeSingleSlash&&(e=e.replace(/\/$/,``)),a&&!t.normalizeProtocol&&(e=e.replace(/^http:\/\//,`//`)),t.stripProtocol&&(e=e.replace(/^(?:https?:)?\/\//,``)),e}function zR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function BR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?zR(Object(n),!0).forEach(function(t){VR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function VR(e,t,n){return(t=HR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HR(e){var t=UR(e,`string`);return typeof t==`symbol`?t:t+``}function UR(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var WR=x_.create(`wasm`),GR=x_.create(`main`),KR=class{constructor(){VR(this,`_worker`,null),VR(this,`_initializeListener`,null),VR(this,`_processingListener`,null),VR(this,`_queueService`,new yR),VR(this,`_initProcess`,null),VR(this,`version`,{component:`9.5.2892`}),VR(this,`onFinalize`,null),VR(this,`isPrepared`,!1),VR(this,`isInitialized`,!1),VR(this,`isProcessing`,!1),VR(this,`initData`,null),VR(this,`recognizerProcessParam`,{processParam:{}}),VR(this,`imageProcessParam`,{processParam:{}}),VR(this,`recognizeListener`,null),VR(this,`workerPath`,`https://wasm.regulaforensics.com/document/release/9.5/barcodemrz/1f57dab0-9204d6578`)}get processingListener(){return this._processingListener}set processingListener(e){this._processingListener=e,e&&e({isProcessing:this.isProcessing})}get initializeListener(){return this._initializeListener}set initializeListener(e){this._initializeListener=e,e&&e({isInitialized:this.isInitialized})}createProcessImageRequest(e,t){let n=e.map((e,t)=>({data:e,light:6,pageIdx:t}));return BR(BR({},t),{},{imagesList:n})}prepareImageData(e){return e.map(e=>e instanceof ImageData?{width:e.width,height:e.height,data:e.data.buffer}:{data:e})}sendMessage(e){return this._queueService.addTask(()=>new Promise((t,n)=>{if(!this._worker)return GR(`Worker is missing)`),n(`Worker is missing`);this._worker.onmessage=e=>{if(e.data.target===lp.custom){let{method:r,response:i,code:a}=e.data.data,o=i&&`reject_message`in i?i.reject_message:``;if(a===xf.ok||a===xf.badLicense&&!o)GR(`Method ${r}: { code: ${a} } `),t(i);else{let e=`Method ${r}: ${Qf[a]||a}${o?` Reject message: ${o}`:``}`;GR(e),n(e)}}e.data.target===lp.stdout&&WR(JSON.stringify(e.data.content)),e.data.target===lp.stderr&&(WR(JSON.stringify(e.data.content)),n(e.data.content))},this._worker.onerror=e=>{WR(JSON.stringify(e.message)),n(e)},GR(`Send message to worker: { target: ${e.target}, method: ${e.method} }`),this._worker.postMessage(BR(BR({},e),{},{preMain:!0}),`data`in e&&e.data?e.data.map(e=>e.data):[])}))}prepare(e){return V(this,null,function*(){var t;GR(`Preparing the service`);{let t=this.workerPath===`https://wasm.regulaforensics.com/document/release/9.5/barcodemrz/1f57dab0-9204d6578`,n=RR(e&&t?vE(e,`PROD`):this.workerPath),r=yield(yield fetch(`${n}/${Kf}`)).text();t||(r=_E(r,n));let i=new Blob([r],{type:`text/plain`}),a=URL.createObjectURL(i);this._worker=new Worker(a),URL.revokeObjectURL(a)}(t=this._worker)==null||t.postMessage({method:vf.prepare,target:lp.gl,preMain:!0,op:`setPrefetched`}),yield this.sendMessage({method:vf.prepare,target:lp.init,URL:document.URL}),this.isPrepared=!0,GR(`Service prepared`)})}initialize(e){return V(this,null,function*(){return this._initProcess||(this._initProcess=this.doInitialize(e),this._initProcess.catch(()=>{this._initProcess=null})),this._initProcess})}doInitialize(e){return V(this,null,function*(){var t,n;this.isPrepared||(yield this.prepare(e==null?void 0:e.module)),GR(`Initializing the service`);let{scenario:r,license:i}=yield this.sendMessage({target:lp.custom,method:vf.initialize,request:{systemInfo:{userID:p_(Sp),hostName:(t=document.location)==null?void 0:t.origin,license:e==null?void 0:e.license},telemetry:yield __({sdkVersion:`9.5.2892`}),processParam:this.recognizerProcessParam.processParam||this.imageProcessParam.processParam}});return this.initData={scenario:r,license:i},this.isInitialized=!0,(n=this._initializeListener)==null||n.call(this,{isInitialized:this.isInitialized}),GR(`Service initialized: ${JSON.stringify({scenario:r,license:i})}`),this.initData})}doProcess(e,t,n){return V(this,null,function*(){var r,i;GR(`Process method ${e} started`),this.isProcessing=!0,(r=this._processingListener)==null||r.call(this,{isProcessing:this.isProcessing});let a=yield this.sendMessage({target:lp.custom,method:e,request:t,data:n});return this.isProcessing=!1,(i=this._processingListener)==null||i.call(this,{isProcessing:this.isProcessing}),GR(`Process method ${e} finished`),new oE(a)})}processImageBase64(e,t){return V(this,null,function*(){return this.doProcess(vf.processImage,this.createProcessImageRequest(e,t))})}process(e,t){return V(this,null,function*(){var n;let r=this.prepareImageData(e),i=yield this.doProcess(vf.process,t||this.recognizerProcessParam,r);return(n=this.recognizeListener)==null||n.call(this,i),i})}processImage(e,t){return V(this,null,function*(){let n=this.prepareImageData(e);return this.doProcess(vf.processImage,t||this.imageProcessParam,n)})}startNewPage(){return V(this,null,function*(){GR(`Starting new page`),yield this.sendMessage({target:lp.custom,method:vf.startNewPage})})}startNewDocument(e,t){return V(this,null,function*(){return GR(`Starting new document`),yield this.sendMessage({target:lp.custom,method:vf.startNewDocument,request:BR(BR({},t||this.recognizerProcessParam),{},{metadata:e})})})}createBackendTransaction(e,t){return V(this,null,function*(){return GR(`Create backend transaction`),yield this.sendMessage({target:lp.custom,method:vf.createBackendTransaction,request:BR(BR({},t||this.recognizerProcessParam),{},{metadata:e})})})}finalizePackage(){return V(this,null,function*(){try{var e;GR(`Finalize package`);let t=yield this.sendMessage({target:lp.custom,method:vf.finalizePackage});return(e=this.onFinalize)==null||e.call(this,t),t}catch(e){var t;return(t=this.onFinalize)==null||t.call(this,{tag:``,transactionId:``}),Promise.reject(e)}})}addDataToPackage(e,t){return V(this,null,function*(){GR(`Add data to package`),yield this.sendMessage({target:lp.custom,method:vf.addDataToPackage,request:t,data:[{data:e.buffer}]}),GR(`Data added to package`)})}shutdown(){GR(`Shutdown service`),this._worker&&(this._worker.terminate(),GR(`Worker terminated`)),this.isPrepared=!1,this.isInitialized=!1,this.isProcessing=!1,this._initProcess=null}};function qR(){return V(this,null,function*(){let e=window.customElements.get(`document-reader`),t=window.customElements.get(`camera-snapshot`),n=window.customElements.get(`fullscreen-container`);e||window.customElements.define(`document-reader`,TI),t||window.customElements.define(`camera-snapshot`,HI),n||window.customElements.define(`fullscreen-container`,KI);let r=window.customElements.whenDefined(`document-reader`),i=window.customElements.whenDefined(`camera-snapshot`),a=window.customElements.whenDefined(`fullscreen-container`);yield Promise.all([r,i,a])})}var JR={attribute:!0,type:String,converter:T,reflect:!1,hasChanged:E},YR=(e=JR,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function XR(e){return(t,n)=>typeof n==`object`?YR(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}var ZR=(e,t,n)=>{for(let n of t)if(n[0]===e)return(0,n[1])();return n==null?void 0:n()};function QR(e){"@babel/helpers - typeof";return QR=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},QR(e)}function $R(e,t){if(QR(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(QR(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ez(e){var t=$R(e,`string`);return QR(t)==`symbol`?t:t+``}function tz(e,t,n){return(t=ez(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?nz(Object(n),!0).forEach(function(t){tz(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var iz=class e{constructor({errorCode:e,errorCodeKey:t,message:n,underlyingError:r,underlyingBaseError:i,domain:a,module:o,errorEnumName:s,shortDomainCode:c}){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}static getErrorKey(e,t){let n=Object.keys(t).find(n=>t[n]===e);if(!n)throw Error(`Invalid errorCode: ${e} in enum`);return n}get lastUnderlyingError(){let t=this.underlyingBaseError;for(;(t==null?void 0:t.underlyingBaseError)instanceof e;)t=t.underlyingBaseError;return t==null?void 0:t.underlyingError}toObject(){let t={errorCode:this.errorCode,errorCodeKey:this.errorCodeKey,errorEnumName:this.errorEnumName,message:this.message,module:this.module,underlyingError:this.underlyingError,lastUnderlineError:this.lastUnderlyingError};return this.underlyingBaseError&&this.underlyingBaseError instanceof e&&(t.underlyingBaseError=this.underlyingBaseError.toObject()),t}get shortChain(){let t=`${this.shortDomainCode}:${this.errorCode}${this.underlyingError?`-`+this.underlyingError:``}`;return this.underlyingBaseError instanceof e&&(t+=`-${this.underlyingBaseError.shortChain}`),t}get fullChain(){let t=`${this.module}.${this.domain}:${this.errorCodeKey}${this.underlyingError?`-`+this.underlyingError:``}`;return this.underlyingBaseError instanceof e&&(t+=`-${this.underlyingBaseError.fullChain}`),t}};function az(e,t){if(t.displayName?console.log(`Register module: ${t.displayName}`):console.error(`Missed "displayName" when register module`),t.getSupportedTemplates&&typeof t.getSupportedTemplates==`function`){let e=t.getSupportedTemplates();console.log(`${t==null?void 0:t.displayName} supported templates: ${e.join(`, `)}`)}else console.error(`Missed "getSupportedTemplates" method when register module`);if(t.initialize&&typeof t.initialize==`function`||console.error(`${t==null?void 0:t.displayName} "initialize" method was not implemented`),t.deinitialize&&typeof t.deinitialize==`function`||console.error(`${t==null?void 0:t.displayName} "deinitialize" method was not implemented`),t.cancel&&typeof t.cancel==`function`||console.error(`${t==null?void 0:t.displayName} "cancel" method was not implemented`),t.isReady&&typeof t.isReady==`function`||console.error(`${t==null?void 0:t.displayName} "isReady" method was not implemented`),t.getIdentifier&&typeof t.getIdentifier==`function`){let e=t.getIdentifier();console.log(`Module id: ${e}`)}else console.error(`Missed "getIdentifier" when register module`);customElements.get(t.getIdentifier())?console.log(`Module ${e} has already registered`):customElements.define(e,t),console.log(`-------`)}function oz(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var sz={FORM:`form`,DATA:`data`},cz=e=>{if(typeof e!=`string`)return!1;try{return new URL(e),!0}catch(e){return!1}},lz=[`ar`,`he`],uz=e=>{var t;let n=e?(t=e.substring(0,2))==null?void 0:t.toLowerCase():``;return lz.includes(n)?`rtl`:`ltr`},dz=(e,t)=>e.base64&&!(t!=null&&t.base64.has(e.base64))?e.base64:e.imageURL&&!(t!=null&&t.imageURL.has(e.imageURL))?e.imageURL:``,fz=(e,t,n)=>{var r;if(!t)return;let i=(r=e==null?void 0:e.idvAsset)==null?null:r;for(;i;){let e=dz(i,n);if(e)return e;i=i.failurePolicy===`placeholderImage`&&i.placeholderImage||null}},pz={DOC_READER:`DOC_READER`,DOC_READER_GALLERY:`DOC_READER_GALLERY`},mz=function(e){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}({}),hz=function(e){return e[e.CONFIGURATION_FAILED=0]=`CONFIGURATION_FAILED`,e[e.INTERNAL_ERROR=1]=`INTERNAL_ERROR`,e[e.PRESENTER_UNAVAILABLE=2]=`PRESENTER_UNAVAILABLE`,e}({}),gz=`idv-document`,_z={0:pf.auto,1:pf.captureVideo,2:pf.captureFrame},vz={0:yf.line,1:yf.corners},yz={0:!0,1:!0,2:!1,3:!0},bz=1920,xz=4e6,Sz=5e7,Cz=function(e){return e.BarcodeMRZ=`BarcodeMRZ`,e.BoundsLite=`BoundsLite`,e}({}),wz,Tz,Ez=class e extends iz{constructor({errorCode:t,message:n,underlyingError:r,underlyingBaseError:i}){let a=iz.getErrorKey(t,mz);super({errorCode:t,errorCodeKey:a,errorEnumName:e.ERROR_ENUM_NAME,module:e.MODULE,message:n,underlyingError:r,underlyingBaseError:i,domain:e.ERROR_ENUM_NAME,shortDomainCode:e.SHORT_CODE})}};wz=Ez,wz.MODULE=gz,wz.ERROR_ENUM_NAME=`ReaderModuleError`,wz.SHORT_CODE=`RM`;var Dz=class e extends iz{constructor({errorCode:t,message:n,underlyingError:r,underlyingBaseError:i}){let a=iz.getErrorKey(t,hz);super({errorCode:t,errorCodeKey:a,errorEnumName:e.ERROR_ENUM_NAME,module:e.MODULE,message:n,underlyingError:r,underlyingBaseError:i,domain:e.ERROR_ENUM_NAME,shortDomainCode:e.SHORT_CODE})}};Tz=Dz,Tz.MODULE=gz,Tz.ERROR_ENUM_NAME=`ScanError`,Tz.SHORT_CODE=`RMS`;var Oz=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})};function kz(e){return XR(rz(rz({},e),{},{state:!0,attribute:!1}))}var Az=(e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof t!=`object`&&Object.defineProperty(e,t,n),n);function jz(e,t){return(n,r,i)=>{let a=t=>{var n,r;return(n=(r=t.renderRoot)==null?void 0:r.querySelector(e))==null?null:n};if(t){let{get:e,set:t}=typeof r==`object`?n:i==null?(()=>{let e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})():i;return Az(n,r,{get(){let n=e.call(this);return n===void 0&&(n=a(this),(n!==null||this.hasUpdated)&&t.call(this,n)),n}})}return Az(n,r,{get(){return a(this)}})}}function Mz(e){return Nz.apply(this,arguments)}function Nz(){return Nz=d(function*(e){return new Promise(t=>setTimeout(t,e))}),Nz.apply(this,arguments)}function Pz(e){return Fz.apply(this,arguments)}function Fz(){return Fz=d(function*(e,t=0,n=0){let r=null,i=n*1e3;for(let n=0;n<=t;n++){try{let t=yield e();if(t!=null&&t.transactionId)return t;break}catch(e){r=e}n<t&&(yield Mz(i))}throw r}),Fz.apply(this,arguments)}var Iz=e=>e?(e.internalScenario&&(e.scenario=e.internalScenario),delete e.internalScenario,e):{};function Lz(e,t,n,r,i){let a=e*t,o=a>i;return{width:e,height:t,isExtraLargeResolution:o,isDownscaleNeeded:(e>n||t>n||a>r)&&!o}}var Rz=function(){var e=d(function*(e,t,n,r){let i=yield createImageBitmap(e),{width:a,height:o}=i;return i==null||i.close(),Lz(a,o,t,n,r)});return function(t,n,r,i){return e.apply(this,arguments)}}();function zz({width:e,height:t,softSideLimit:n,softPixelLimit:r}){if(!(e>0&&t>0))return{width:1,height:1};let i=Math.max(e,t),a=e*t,o=i>n?n/i:1,s=a>r?Math.sqrt(r/a):1,c=Math.min(o,s,1);return{width:Math.max(1,Math.floor(e*c)),height:Math.max(1,Math.floor(t*c))}}function Bz(e,t,n){return Vz.apply(this,arguments)}function Vz(){return Vz=d(function*(e,t,n){return new Promise(r=>{if(!e||!e.size)return r({ok:!1});let i=document.createElement(`canvas`),a=i.getContext(`2d`),o=URL.createObjectURL(e),s=new Image,c=e=>{try{URL.revokeObjectURL(o)}catch(e){}try{i.width=0,i.height=0}catch(e){}s.onload=null,s.onerror=null,s.src=``,r(e)};s.onload=function(){let e=zz({width:s.width,height:s.height,softSideLimit:t,softPixelLimit:n});if(i.width=e.width,i.height=e.height,a)try{a.drawImage(s,0,0,e.width,e.height);let t=a.getImageData(0,0,e.width,e.height);return c(t?{ok:!0,imageData:t}:{ok:!1})}catch(e){return c({ok:!1})}return c({ok:!1})},s.onerror=()=>c({ok:!1}),s.src=o})}),Vz.apply(this,arguments)}var Hz=e=>{let{translationKeysData:t,translationKeysProps:n,locale:r}=e,i={},a=null;for(let e in t)i[t[e].key]=e;for(let e in n)i[e]&&n[e]&&(a?a[i[e]]=n[e]:a={[i[e]]:n[e]});return a?{[r]:a}:{}},Uz={preparingCamera:{fallback:`Preparing the camera...`,key:`strPrepareCamera`},timeout:{fallback:`Timeout`,key:`strTimeout`},noFocus:{fallback:`No camera focus`,key:`strNoFocus`},somethingWentWrong:{fallback:`Something went wrong`,key:`messageUnknownError`},incorrectCameraId:{fallback:`No camera with the specified ID found.`,key:`InfoScreenIncorrectCameraIdTitle`},done:{fallback:`Done!`,key:`strDoneMessage`},cameraUnavailable:{fallback:`Camera unavailable!`,key:`statusCameraUnavailableTitle`},versionNotSupported:{fallback:`Your browser version is not supported`,key:`statusBrowserNotSupportedTitle`},httpNotSupported:{fallback:`HTTPS not used`,key:`statusBrowserHTTPNotSupportedSubtitle`},insecurePageContext:{fallback:`Insecure context`,key:`statusBrowserInsecurePageContextSubtitle`},badLicense:{fallback:`The license cannot be found or has expired`,key:`statusProcMgrBadLicenseSubtitle`},fileCorrupt:{fallback:`This file is corrupt or not supported`,key:`statusIncorrectDataTitle`},largeFile:{fallback:`This file is too large to be uploaded`,key:`statusLargeDataTitle`},placeDocumentIntoFrame:{fallback:`Fit the document into the frame`,key:`strPlaceDocumentInFrame`},holdDocumentStraight:{fallback:`Hold the document straight`,key:`strHoldDocumentStraight`},glaresOnDocument:{fallback:`Avoid glare on the document`,key:`strGlaresOnDocument`},tryAgain:{fallback:`Try again`,key:`faceLivenessScreenButton`},noCameraAvailable:{fallback:`No camera available`,key:`InfoScreenNoCameraTitle`},positionDocumentCenter:{fallback:`Position the document in the center`,key:`documentReaderDocumentReaderLayoutDocumentCenter`},uploadPhoto:{fallback:`Upload a photo`,key:`cameraCaptureCameraCaptureStartScreenTitle`},moveCloser:{fallback:`Move closer`,key:`hint.moveCloser`},keepDeviceStill:{fallback:`Hold the device still`,key:`strKeepDeviceStill`},camera:{fallback:`Camera`,key:`strCamera`},switchToMobile:{fallback:`Switch to mobile`,key:`switchToMobile`},openPhoneCamera:{fallback:`Open the camera on your mobile device, scan the QR code, and follow the link`,key:`openPhoneCamera`},pleaseWait:{fallback:`Please wait...`,key:`strPleaseWait`},mobileDevice:{fallback:`Mobile device`,key:`mobileDevice`},verifyYourIdentity:{fallback:`Identity document verification`,key:`verifyYourIdentity`},fromCameraFilesMobileDesktop:{fallback:`Capture a document using the computer’s camera, upload it from files, or scan it on a mobile device`,key:`fromCameraFilesMobileDesktop`},fromCameraFilesDesktop:{fallback:`Capture a document using the computer’s camera or upload it from files`,key:`fromCameraFilesDesktop`},fromCameraMobileDesktop:{fallback:`Capture a document using the computer’s camera or scan it on a mobile device`,key:`fromCameraMobileDesktop`},fromFilesMobileDesktop:{fallback:`Upload a document from files or scan it on a mobile device`,key:`fromFilesMobileDesktop`},fromCameraDesktop:{fallback:`Use the computer's camera to capture a document`,key:`fromCameraDesktop`},fromFilesDesktop:{fallback:`Pick a document from files and upload it`,key:`fromFilesDesktop`},fromMobileDesktop:{fallback:`Use your mobile camera to capture a document`,key:`fromMobileDesktop`},fromCameraGalleryMobile:{fallback:`Capture a document using the mobile's camera or upload it from gallery`,key:`fromCameraGalleryMobile`},fromGalleryMobile:{fallback:`Pick a document from the gallery and upload it`,key:`fromGalleryMobile`},gallery:{fallback:`Gallery`,key:`gallery`},files:{fallback:`Files`,key:`files`},returnToComputer:{fallback:`Return to the computer`,key:`returnToComputer`},documentCaptured:{fallback:`Your document has been captured`,key:`documentCaptured`},or:{fallback:`or`,key:`strOr`},continueInBrowser:{fallback:`Click here to continue in browser`,key:`continueInBrowser`},skip:{fallback:`Skip`,key:`strSkip`},flipTheDocument:{fallback:`Flip the document`,key:`documentReaderDocumentReaderLayoutFlipDocument`},tiltTheDocument:{fallback:`Tilt the document`,key:`strTiltDocument`}},Wz=s`
35
+ `):``,this.name=`UnsubscriptionError`,this.errors=t}});function oL(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var sL=(function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a){if(this._parentage=null,Array.isArray(a))try{for(var o=ZI(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this)}var c=this.initialTeardown;if(rL(c))try{c()}catch(e){i=e instanceof aL?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=ZI(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{uL(f)}catch(e){i=i==null?[]:i,e instanceof aL?i=$I($I([],QI(i)),QI(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new aL(i)}},e.prototype.add=function(t){var n;if(t&&t!==this){if(this.closed)uL(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)==null?[]:n).push(t)}}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&oL(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&oL(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),cL=sL.EMPTY;function lL(e){return e instanceof sL||e&&`closed`in e&&rL(e.remove)&&rL(e.add)&&rL(e.unsubscribe)}function uL(e){rL(e)?e():e.unsubscribe()}var dL={Promise:void 0},fL={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,$I([e,t],QI(n)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function pL(e){fL.setTimeout(function(){throw e})}function mL(){}function hL(e){e()}var gL=(function(e){JI(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,lL(t)&&t.add(n)):n.destination=xL,n}return t.create=function(e,t,n){return new vL(e,t,n)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(sL),_L=(function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){yL(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){yL(e)}else yL(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){yL(e)}},e})(),vL=(function(e){JI(t,e);function t(t,n,r){var i=e.call(this)||this;return i.destination=new _L(rL(t)||!t?{next:t==null?void 0:t,error:n==null?void 0:n,complete:r==null?void 0:r}:t),i}return t})(gL);function yL(e){pL(e)}function bL(e){throw e}var xL={closed:!0,next:mL,error:bL,complete:mL},SL=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function CL(e){return e}function wL(e){return e.length===0?CL:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var TL=(function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=OL(e)?e:new vL(e,t,n);return hL(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=EL(t),new t(function(t,r){var i=new vL({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){var t;return(t=this.source)==null?void 0:t.subscribe(e)},e.prototype[SL]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return wL(e)(this)},e.prototype.toPromise=function(e){var t=this;return e=EL(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e})();function EL(e){var t;return(t=e==null?dL.Promise:e)==null?Promise:t}function DL(e){return e&&rL(e.next)&&rL(e.error)&&rL(e.complete)}function OL(e){return e&&e instanceof gL||DL(e)&&lL(e)}function kL(e){return rL(e==null?void 0:e.lift)}function AL(e){return function(t){if(kL(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function jL(e,t,n,r,i){return new ML(e,t,n,r,i)}var ML=(function(e){JI(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t})(gL),NL=iL(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),PL=(function(e){JI(t,e);function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.prototype.lift=function(e){var t=new FL(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new NL},t.prototype.next=function(e){var t=this;hL(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=ZI(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;hL(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;hL(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)==null?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?cL:(this.currentObservers=null,a.push(e),new sL(function(){t.currentObservers=null,oL(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new TL;return e.source=this,e},t.create=function(e,t){return new FL(e,t)},t})(TL),FL=(function(e){JI(t,e);function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.prototype.next=function(e){var t,n;(n=(t=this.destination)==null?void 0:t.next)==null||n.call(t,e)},t.prototype.error=function(e){var t,n;(n=(t=this.destination)==null?void 0:t.error)==null||n.call(t,e)},t.prototype.complete=function(){var e,t;(t=(e=this.destination)==null?void 0:e.complete)==null||t.call(e)},t.prototype._subscribe=function(e){var t,n;return(n=(t=this.source)==null?void 0:t.subscribe(e))==null?cL:n},t})(PL),IL=(function(e){return e&&typeof e.length==`number`&&typeof e!=`function`});function LL(e){return rL(e==null?void 0:e.then)}function RL(e){return rL(e[SL])}function zL(e){return Symbol.asyncIterator&&rL(e==null?void 0:e[Symbol.asyncIterator])}function BL(e){return TypeError(`You provided `+(typeof e==`object`&&e?`an invalid object`:`'`+e+`'`)+` where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function VL(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}var HL=VL();function UL(e){return rL(e==null?void 0:e[HL])}function WL(e){return tL(this,arguments,function(){var t,n,r,i;return XI(this,function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,eL(t.read())];case 3:return n=a.sent(),r=n.value,i=n.done,i?[4,eL(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,eL(r)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function GL(e){return rL(e==null?void 0:e.getReader)}function KL(e){if(e instanceof TL)return e;if(e!=null){if(RL(e))return qL(e);if(IL(e))return JL(e);if(LL(e))return YL(e);if(zL(e))return ZL(e);if(UL(e))return XL(e);if(GL(e))return QL(e)}throw BL(e)}function qL(e){return new TL(function(t){var n=e[SL]();if(rL(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}function JL(e){return new TL(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function YL(e){return new TL(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,pL)})}function XL(e){return new TL(function(t){var n,r;try{for(var i=ZI(e),a=i.next();!a.done;a=i.next()){var o=a.value;if(t.next(o),t.closed)return}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function ZL(e){return new TL(function(t){$L(e,t).catch(function(e){return t.error(e)})})}function QL(e){return ZL(WL(e))}function $L(e,t){var n,r,i,a;return YI(this,void 0,void 0,function(){var o,s;return XI(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=nL(e),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),r.done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),i={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function eR(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}function tR(e,t){return t===void 0&&(t=0),AL(function(n,r){n.subscribe(jL(r,function(n){return eR(r,e,function(){return r.next(n)},t)},function(){return eR(r,e,function(){return r.complete()},t)},function(n){return eR(r,e,function(){return r.error(n)},t)}))})}function nR(e,t){return t===void 0&&(t=0),AL(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function rR(e,t){return KL(e).pipe(nR(t),tR(t))}function iR(e,t){return KL(e).pipe(nR(t),tR(t))}function aR(e,t){return new TL(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function oR(e,t){return new TL(function(n){var r;return eR(n,t,function(){r=e[HL](),eR(n,t,function(){var e,t,i;try{e=r.next(),t=e.value,i=e.done}catch(e){n.error(e);return}i?n.complete():n.next(t)},0,!0)}),function(){return rL(r==null?void 0:r.return)&&r.return()}})}function sR(e,t){if(!e)throw Error(`Iterable cannot be null`);return new TL(function(n){eR(n,t,function(){var r=e[Symbol.asyncIterator]();eR(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function cR(e,t){return sR(WL(e),t)}function lR(e,t){if(e!=null){if(RL(e))return rR(e,t);if(IL(e))return aR(e,t);if(LL(e))return iR(e,t);if(zL(e))return sR(e,t);if(UL(e))return oR(e,t);if(GL(e))return cR(e,t)}throw BL(e)}function uR(e,t){return t?lR(e,t):KL(e)}function dR(e,t){return AL(function(n,r){var i=0;n.subscribe(jL(r,function(n){r.next(e.call(t,n,i++))}))})}function fR(e,t,n,r,i,a,o,s){var c=[],l=0,u=0,d=!1,f=function(){d&&!c.length&&!l&&t.complete()},p=function(e){return l<r?m(e):c.push(e)},m=function(e){l++;var i=!1;KL(n(e,u++)).subscribe(jL(t,function(e){t.next(e)},function(){i=!0},void 0,function(){if(i)try{l--;for(var e=function(){var e=c.shift();o||m(e)};c.length&&l<r;)e();f()}catch(e){t.error(e)}}))};return e.subscribe(jL(t,p,function(){d=!0,f()})),function(){}}function pR(e,t,n){return n===void 0&&(n=1/0),rL(t)?pR(function(n,r){return dR(function(e,i){return t(n,e,r,i)})(KL(e(n,r)))},n):(typeof t==`number`&&(n=t),AL(function(t,r){return fR(t,r,e,n)}))}function mR(e){return AL(function(t,n){var r=null,i=!1,a;r=t.subscribe(jL(n,void 0,void 0,function(o){a=KL(e(o,mR(e)(t))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function hR(e,t){return rL(t)?pR(e,t,1):pR(e,1)}function gR(e,t,n){return(t=_R(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _R(e){var t=vR(e,`string`);return typeof t==`symbol`?t:t+``}function vR(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var yR=class{constructor(){gR(this,`taskSubject`,new PL),this.taskSubject.pipe(hR(e=>uR(e()).pipe(mR(e=>uR(Promise.reject(e)))))).subscribe()}addTask(e){return new Promise((t,n)=>{this.taskSubject.next(()=>V(this,null,function*(){try{t(yield e())}catch(e){n(e)}}))})}},bR=`text/plain`,xR=`us-ascii`,SR=`%(?:3A|2F|3F|23|5B|5D|40|21|24|26|27|28|29|2A|2B|2C|3B|3D)`,CR=`__normalize_url_encoded_reserved__`,wR=/__normalize_url_encoded_reserved__(\d+)__/g,TR=new RegExp(SR,`i`),ER=new RegExp(SR,`gi`),DR=(e,t)=>Array.isArray(t)&&t.some(t=>t instanceof RegExp?t.flags.includes(`g`)||t.flags.includes(`y`)?new RegExp(t.source,t.flags.replaceAll(/[gy]/g,``)).test(e):t.test(e):t===e),OR=new Set([`https:`,`http:`,`file:`]),kR=e=>{if(typeof e!=`string`)return;let t=e.trim().toLowerCase().replace(/:$/,``);return t===``?void 0:`${t}:`},AR=e=>{try{let{protocol:t}=new URL(e),n=e.slice(0,t.length+2).toLowerCase()===`${t}//`;if(t.endsWith(`:`)&&(!t.includes(`.`)||n)&&!OR.has(t))return t}catch(e){}},jR=e=>{try{return decodeURIComponent(e.replaceAll(`+`,`%20`))}catch(t){return new URLSearchParams(`${e}=`).keys().next().value}},MR=e=>{let t=new Set;if(!e)return t;for(let n of e.slice(1).split(`&`))n&&!n.includes(`=`)&&t.add(jR(n));return t},NR=e=>{let t=e;try{t=decodeURIComponent(e)}catch(n){t=new URLSearchParams(e).toString()}let n=e=>{let t=new Set;for(let n of e.matchAll(wR))t.add(Number.parseInt(n[1],10));return t},r=n(e);for(let e of n(t))r.add(e);let i=0;for(;r.has(i);)i++;return`${CR}${i}__`},PR=(e,t)=>{if(!t)return e.sort(),e.toString();let n=e=>e.replace(t,(e,t)=>String.fromCodePoint(Number.parseInt(t,16))),r=[...e.entries()];return r.sort(([e],[t])=>{let r=n(e),i=n(t);return r<i?-1:+(r>i)}),new URLSearchParams(r).toString()},FR=(e,t)=>t?e.replace(t,(e,t)=>String.fromCodePoint(Number.parseInt(t,16))):e,IR=(e,t,n)=>{let r=t===`always`,i=t===`never`,a=r||i?void 0:MR(n),o=e=>e.replaceAll(`+`,`%20`),s=e=>r?`${e}=`:i||a.has(jR(e))?e:`${e}=`,c=e=>{let t=e.indexOf(`=`);if(t===-1)return s(o(e));let n=e.slice(0,t),r=e.slice(t+1);return r===``?n===``?`=`:s(o(n)):`${o(n)}=${r}`},l=e.slice(1).split(`&`).filter(Boolean);return l.length===0?``:`?${l.map(e=>c(e)).join(`&`)}`},LR=(e,{stripHash:t})=>{let n=RegExp(`^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$`).exec(e);if(!n)throw Error(`Invalid URL: ${e}`);let{type:r,data:i,hash:a}=n.groups,o=r.split(`;`),s=o.at(-1)===`base64`;s&&o.pop();let c=o.shift().toLowerCase(),l=[...o.map(e=>{let[t,n=``]=e.split(`=`).map(e=>e.trim());return t===`charset`&&(n=n.toLowerCase(),n===xR)?``:`${t}${n?`=${n}`:``}`}).filter(Boolean)];s&&l.push(`base64`),(l.length>0||c&&c!==bR)&&l.unshift(c);let u=t||!a?``:`#${a}`;return`data:${l.join(`;`)},${s?i.trim():i}${u}`};function RR(e,t){if(t=B({defaultProtocol:`http`,normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,removeExplicitPort:!1,sortQueryParameters:!0,removePath:!1,transformPath:!1,emptyQueryValue:`preserve`},t),typeof t.defaultProtocol==`string`&&!t.defaultProtocol.endsWith(`:`)&&(t.defaultProtocol=`${t.defaultProtocol}:`),e=e.trim(),/^data:/i.test(e))return LR(e,t);let n=Array.isArray(t.customProtocols)?t.customProtocols:[],r=new Set(n.map(e=>kR(e)).filter(Boolean)),i=AR(e);if(i&&!r.has(i))return e;let a=e.startsWith(`//`);(a||!/^\.*\//.test(e))&&!i&&(e=e.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,t.defaultProtocol));let o=new URL(e);if(t.forceHttp&&t.forceHttps)throw Error("The `forceHttp` and `forceHttps` options cannot be used together");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){let e=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,t=0,n=``;for(;;){let r=e.exec(o.pathname);if(!r)break;let i=r[0],a=r.index,s=o.pathname.slice(t,a);n+=s.replaceAll(/\/{2,}/g,`/`),n+=i,t=a+i.length}let r=o.pathname.slice(t);n+=r.replaceAll(/\/{2,}/g,`/`),o.pathname=n}if(o.pathname)try{o.pathname=decodeURI(o.pathname).replaceAll(`\\`,`%5C`)}catch(e){}if(t.removeDirectoryIndex===!0&&(t.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(t.removeDirectoryIndex)&&t.removeDirectoryIndex.length>0){let e=o.pathname.split(`/`).filter(Boolean),n=e.at(-1);n&&DR(n,t.removeDirectoryIndex)&&(e.pop(),o.pathname=e.length>0?`/${e.join(`/`)}/`:`/`)}if(t.removePath&&(o.pathname=`/`),t.transformPath&&typeof t.transformPath==`function`){let e=o.pathname.split(`/`).filter(Boolean),n=t.transformPath(e);o.pathname=(n==null?void 0:n.length)>0?`/${n.join(`/`)}`:`/`}o.hostname&&(o.hostname=o.hostname.replace(/\.$/,``),t.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(o.hostname)&&(o.hostname=o.hostname.replace(/^www\./,``)));let s=o.search,c;if(t.sortQueryParameters&&TR.test(s)){let e=NR(s);o.search=s.replaceAll(ER,t=>`${e}${t.slice(1).toUpperCase()}`),c=RegExp(`${e}([0-9A-F]{2})`,`g`)}let l=Array.isArray(t.keepQueryParameters),{searchParams:u}=o;if(!l&&Array.isArray(t.removeQueryParameters)&&t.removeQueryParameters.length>0)for(let e of[...u.keys()])DR(FR(e,c),t.removeQueryParameters)&&u.delete(e);if(!l&&t.removeQueryParameters===!0&&(o.search=``),l&&t.keepQueryParameters.length>0)for(let e of[...u.keys()])DR(FR(e,c),t.keepQueryParameters)||u.delete(e);else l&&(o.search=``);t.sortQueryParameters&&(o.search=PR(o.searchParams,c),o.search=decodeURIComponent(o.search.replaceAll(/%(?:26|23|3f|25|2b)/gi,e=>`%25${e.slice(1)}`)),c&&(o.search=o.search.replace(c,`%$1`))),o.search=IR(o.search,t.emptyQueryValue,s),t.removeTrailingSlash&&(o.pathname=o.pathname.replace(/\/$/,``)),t.removeExplicitPort&&o.port&&(o.port=``);let d=e;return e=o.toString(),!t.removeSingleSlash&&o.pathname===`/`&&!d.endsWith(`/`)&&o.hash===``&&(e=e.replace(/\/$/,``)),(t.removeTrailingSlash||o.pathname===`/`)&&o.hash===``&&t.removeSingleSlash&&(e=e.replace(/\/$/,``)),a&&!t.normalizeProtocol&&(e=e.replace(/^http:\/\//,`//`)),t.stripProtocol&&(e=e.replace(/^(?:https?:)?\/\//,``)),e}function zR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function BR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?zR(Object(n),!0).forEach(function(t){VR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function VR(e,t,n){return(t=HR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HR(e){var t=UR(e,`string`);return typeof t==`symbol`?t:t+``}function UR(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var WR=x_.create(`wasm`),GR=x_.create(`main`),KR=class{constructor(){VR(this,`_worker`,null),VR(this,`_initializeListener`,null),VR(this,`_processingListener`,null),VR(this,`_queueService`,new yR),VR(this,`_initProcess`,null),VR(this,`version`,{component:`9.5.2892`}),VR(this,`onFinalize`,null),VR(this,`isPrepared`,!1),VR(this,`isInitialized`,!1),VR(this,`isProcessing`,!1),VR(this,`initData`,null),VR(this,`recognizerProcessParam`,{processParam:{}}),VR(this,`imageProcessParam`,{processParam:{}}),VR(this,`recognizeListener`,null),VR(this,`workerPath`,`https://wasm.regulaforensics.com/document/release/9.5/barcodemrz/1f57dab0-9204d6578`)}get processingListener(){return this._processingListener}set processingListener(e){this._processingListener=e,e&&e({isProcessing:this.isProcessing})}get initializeListener(){return this._initializeListener}set initializeListener(e){this._initializeListener=e,e&&e({isInitialized:this.isInitialized})}createProcessImageRequest(e,t){let n=e.map((e,t)=>({data:e,light:6,pageIdx:t}));return BR(BR({},t),{},{imagesList:n})}prepareImageData(e){return e.map(e=>e instanceof ImageData?{width:e.width,height:e.height,data:e.data.buffer}:{data:e})}sendMessage(e){return this._queueService.addTask(()=>new Promise((t,n)=>{if(!this._worker)return GR(`Worker is missing)`),n(`Worker is missing`);this._worker.onmessage=e=>{if(e.data.target===lp.custom){let{method:r,response:i,code:a}=e.data.data,o=i&&`reject_message`in i?i.reject_message:``;if(a===xf.ok||a===xf.badLicense&&!o)GR(`Method ${r}: { code: ${a} } `),t(i);else{let e=`Method ${r}: ${Qf[a]||a}${o?` Reject message: ${o}`:``}`;GR(e),n(e)}}e.data.target===lp.stdout&&WR(JSON.stringify(e.data.content)),e.data.target===lp.stderr&&(WR(JSON.stringify(e.data.content)),n(e.data.content))},this._worker.onerror=e=>{WR(JSON.stringify(e.message)),n(e)},GR(`Send message to worker: { target: ${e.target}, method: ${e.method} }`),this._worker.postMessage(BR(BR({},e),{},{preMain:!0}),`data`in e&&e.data?e.data.map(e=>e.data):[])}))}prepare(e){return V(this,null,function*(){var t;GR(`Preparing the service`);{let t=this.workerPath===`https://wasm.regulaforensics.com/document/release/9.5/barcodemrz/1f57dab0-9204d6578`,n=RR(e&&t?vE(e,`PROD`):this.workerPath),r=yield(yield fetch(`${n}/${Kf}`)).text();t||(r=_E(r,n));let i=new Blob([r],{type:`text/plain`}),a=URL.createObjectURL(i);this._worker=new Worker(a),URL.revokeObjectURL(a)}(t=this._worker)==null||t.postMessage({method:vf.prepare,target:lp.gl,preMain:!0,op:`setPrefetched`}),yield this.sendMessage({method:vf.prepare,target:lp.init,URL:document.URL}),this.isPrepared=!0,GR(`Service prepared`)})}initialize(e){return V(this,null,function*(){return this._initProcess||(this._initProcess=this.doInitialize(e),this._initProcess.catch(()=>{this._initProcess=null})),this._initProcess})}doInitialize(e){return V(this,null,function*(){var t,n;this.isPrepared||(yield this.prepare(e==null?void 0:e.module)),GR(`Initializing the service`);let{scenario:r,license:i}=yield this.sendMessage({target:lp.custom,method:vf.initialize,request:{systemInfo:{userID:p_(Sp),hostName:(t=document.location)==null?void 0:t.origin,license:e==null?void 0:e.license},telemetry:yield __({sdkVersion:`9.5.2892`}),processParam:this.recognizerProcessParam.processParam||this.imageProcessParam.processParam}});return this.initData={scenario:r,license:i},this.isInitialized=!0,(n=this._initializeListener)==null||n.call(this,{isInitialized:this.isInitialized}),GR(`Service initialized: ${JSON.stringify({scenario:r,license:i})}`),this.initData})}doProcess(e,t,n){return V(this,null,function*(){var r,i;GR(`Process method ${e} started`),this.isProcessing=!0,(r=this._processingListener)==null||r.call(this,{isProcessing:this.isProcessing});let a=yield this.sendMessage({target:lp.custom,method:e,request:t,data:n});return this.isProcessing=!1,(i=this._processingListener)==null||i.call(this,{isProcessing:this.isProcessing}),GR(`Process method ${e} finished`),new oE(a)})}processImageBase64(e,t){return V(this,null,function*(){return this.doProcess(vf.processImage,this.createProcessImageRequest(e,t))})}process(e,t){return V(this,null,function*(){var n;let r=this.prepareImageData(e),i=yield this.doProcess(vf.process,t||this.recognizerProcessParam,r);return(n=this.recognizeListener)==null||n.call(this,i),i})}processImage(e,t){return V(this,null,function*(){let n=this.prepareImageData(e);return this.doProcess(vf.processImage,t||this.imageProcessParam,n)})}startNewPage(){return V(this,null,function*(){GR(`Starting new page`),yield this.sendMessage({target:lp.custom,method:vf.startNewPage})})}startNewDocument(e,t){return V(this,null,function*(){return GR(`Starting new document`),yield this.sendMessage({target:lp.custom,method:vf.startNewDocument,request:BR(BR({},t||this.recognizerProcessParam),{},{metadata:e})})})}createBackendTransaction(e,t){return V(this,null,function*(){return GR(`Create backend transaction`),yield this.sendMessage({target:lp.custom,method:vf.createBackendTransaction,request:BR(BR({},t||this.recognizerProcessParam),{},{metadata:e})})})}finalizePackage(){return V(this,null,function*(){try{var e;GR(`Finalize package`);let t=yield this.sendMessage({target:lp.custom,method:vf.finalizePackage});return(e=this.onFinalize)==null||e.call(this,t),t}catch(e){var t;return(t=this.onFinalize)==null||t.call(this,{tag:``,transactionId:``}),Promise.reject(e)}})}addDataToPackage(e,t){return V(this,null,function*(){GR(`Add data to package`),yield this.sendMessage({target:lp.custom,method:vf.addDataToPackage,request:t,data:[{data:e.buffer}]}),GR(`Data added to package`)})}shutdown(){GR(`Shutdown service`),this._worker&&(this._worker.terminate(),GR(`Worker terminated`)),this.isPrepared=!1,this.isInitialized=!1,this.isProcessing=!1,this._initProcess=null}};function qR(){return V(this,null,function*(){let e=window.customElements.get(`document-reader`),t=window.customElements.get(`camera-snapshot`),n=window.customElements.get(`fullscreen-container`);e||window.customElements.define(`document-reader`,TI),t||window.customElements.define(`camera-snapshot`,HI),n||window.customElements.define(`fullscreen-container`,KI);let r=window.customElements.whenDefined(`document-reader`),i=window.customElements.whenDefined(`camera-snapshot`),a=window.customElements.whenDefined(`fullscreen-container`);yield Promise.all([r,i,a])})}var JR={attribute:!0,type:String,converter:T,reflect:!1,hasChanged:E},YR=(e=JR,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function XR(e){return(t,n)=>typeof n==`object`?YR(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}var ZR=(e,t,n)=>{for(let n of t)if(n[0]===e)return(0,n[1])();return n==null?void 0:n()};function QR(e){"@babel/helpers - typeof";return QR=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},QR(e)}function $R(e,t){if(QR(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(QR(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ez(e){var t=$R(e,`string`);return QR(t)==`symbol`?t:t+``}function tz(e,t,n){return(t=ez(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?nz(Object(n),!0).forEach(function(t){tz(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var iz=class e{constructor({errorCode:e,errorCodeKey:t,message:n,underlyingError:r,underlyingBaseError:i,domain:a,module:o,errorEnumName:s,shortDomainCode:c}){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}static getErrorKey(e,t){let n=Object.keys(t).find(n=>t[n]===e);if(!n)throw Error(`Invalid errorCode: ${e} in enum`);return n}get lastUnderlyingError(){let t=this.underlyingBaseError;for(;(t==null?void 0:t.underlyingBaseError)instanceof e;)t=t.underlyingBaseError;return t==null?void 0:t.underlyingError}toObject(){let t={errorCode:this.errorCode,errorCodeKey:this.errorCodeKey,errorEnumName:this.errorEnumName,message:this.message,module:this.module,underlyingError:this.underlyingError,lastUnderlineError:this.lastUnderlyingError};return this.underlyingBaseError&&this.underlyingBaseError instanceof e&&(t.underlyingBaseError=this.underlyingBaseError.toObject()),t}get shortChain(){let t=`${this.shortDomainCode}:${this.errorCode}${this.underlyingError?`-`+this.underlyingError:``}`;return this.underlyingBaseError instanceof e&&(t+=`-${this.underlyingBaseError.shortChain}`),t}get fullChain(){let t=`${this.module}.${this.domain}:${this.errorCodeKey}${this.underlyingError?`-`+this.underlyingError:``}`;return this.underlyingBaseError instanceof e&&(t+=`-${this.underlyingBaseError.fullChain}`),t}};function az(e,t){if(t.displayName?console.log(`Register module: ${t.displayName}`):console.error(`Missed "displayName" when register module`),t.getSupportedTemplates&&typeof t.getSupportedTemplates==`function`){let e=t.getSupportedTemplates();console.log(`${t==null?void 0:t.displayName} supported templates: ${e.join(`, `)}`)}else console.error(`Missed "getSupportedTemplates" method when register module`);if(t.initialize&&typeof t.initialize==`function`||console.error(`${t==null?void 0:t.displayName} "initialize" method was not implemented`),t.deinitialize&&typeof t.deinitialize==`function`||console.error(`${t==null?void 0:t.displayName} "deinitialize" method was not implemented`),t.cancel&&typeof t.cancel==`function`||console.error(`${t==null?void 0:t.displayName} "cancel" method was not implemented`),t.isReady&&typeof t.isReady==`function`||console.error(`${t==null?void 0:t.displayName} "isReady" method was not implemented`),t.getIdentifier&&typeof t.getIdentifier==`function`){let e=t.getIdentifier();console.log(`Module id: ${e}`)}else console.error(`Missed "getIdentifier" when register module`);customElements.get(t.getIdentifier())?console.log(`Module ${e} has already registered`):customElements.define(e,t),console.log(`-------`)}function oz(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var sz={FORM:`form`,DATA:`data`},cz=e=>{if(typeof e!=`string`)return!1;try{return new URL(e),!0}catch(e){return!1}},lz=[`ar`,`he`],uz=e=>{var t;let n=e?(t=e.substring(0,2))==null?void 0:t.toLowerCase():``;return lz.includes(n)?`rtl`:`ltr`},dz=(e,t)=>e.base64&&!(t!=null&&t.base64.has(e.base64))?e.base64:e.imageURL&&!(t!=null&&t.imageURL.has(e.imageURL))?e.imageURL:``,fz=(e,t,n)=>{var r;if(!t)return;let i=(r=e==null?void 0:e.idvAsset)==null?null:r;for(;i;){let e=dz(i,n);if(e)return e;i=i.failurePolicy===`placeholderImage`&&i.placeholderImage||null}},pz={DOC_READER:`DOC_READER`,DOC_READER_GALLERY:`DOC_READER_GALLERY`},mz=function(e){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}({}),hz=function(e){return e[e.CONFIGURATION_FAILED=0]=`CONFIGURATION_FAILED`,e[e.INTERNAL_ERROR=1]=`INTERNAL_ERROR`,e[e.PRESENTER_UNAVAILABLE=2]=`PRESENTER_UNAVAILABLE`,e}({}),gz=`idv-document`,_z={0:pf.auto,1:pf.captureVideo,2:pf.captureFrame},vz={0:yf.line,1:yf.corners},yz={0:!0,1:!0,2:!1,3:!0},bz=1920,xz=4e6,Sz=5e7,Cz,wz,Tz=class e extends iz{constructor({errorCode:t,message:n,underlyingError:r,underlyingBaseError:i}){let a=iz.getErrorKey(t,mz);super({errorCode:t,errorCodeKey:a,errorEnumName:e.ERROR_ENUM_NAME,module:e.MODULE,message:n,underlyingError:r,underlyingBaseError:i,domain:e.ERROR_ENUM_NAME,shortDomainCode:e.SHORT_CODE})}};Cz=Tz,Cz.MODULE=gz,Cz.ERROR_ENUM_NAME=`ReaderModuleError`,Cz.SHORT_CODE=`RM`;var Ez=class e extends iz{constructor({errorCode:t,message:n,underlyingError:r,underlyingBaseError:i}){let a=iz.getErrorKey(t,hz);super({errorCode:t,errorCodeKey:a,errorEnumName:e.ERROR_ENUM_NAME,module:e.MODULE,message:n,underlyingError:r,underlyingBaseError:i,domain:e.ERROR_ENUM_NAME,shortDomainCode:e.SHORT_CODE})}};wz=Ez,wz.MODULE=gz,wz.ERROR_ENUM_NAME=`ScanError`,wz.SHORT_CODE=`RMS`;var Dz=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})};function Oz(e){return XR(rz(rz({},e),{},{state:!0,attribute:!1}))}var kz=(e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof t!=`object`&&Object.defineProperty(e,t,n),n);function Az(e,t){return(n,r,i)=>{let a=t=>{var n,r;return(n=(r=t.renderRoot)==null?void 0:r.querySelector(e))==null?null:n};if(t){let{get:e,set:t}=typeof r==`object`?n:i==null?(()=>{let e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})():i;return kz(n,r,{get(){let n=e.call(this);return n===void 0&&(n=a(this),(n!==null||this.hasUpdated)&&t.call(this,n)),n}})}return kz(n,r,{get(){return a(this)}})}}function jz(e){return Mz.apply(this,arguments)}function Mz(){return Mz=d(function*(e){return new Promise(t=>setTimeout(t,e))}),Mz.apply(this,arguments)}function Nz(e){return Pz.apply(this,arguments)}function Pz(){return Pz=d(function*(e,t=0,n=0){let r=null,i=n*1e3;for(let n=0;n<=t;n++){try{let t=yield e();if(t!=null&&t.transactionId)return t;break}catch(e){r=e}n<t&&(yield jz(i))}throw r}),Pz.apply(this,arguments)}var Fz=e=>e?(e.internalScenario&&(e.scenario=e.internalScenario),delete e.internalScenario,e):{};function Iz(e,t,n,r,i){let a=e*t,o=a>i;return{width:e,height:t,isExtraLargeResolution:o,isDownscaleNeeded:(e>n||t>n||a>r)&&!o}}var Lz=function(){var e=d(function*(e,t,n,r){let i=yield createImageBitmap(e),{width:a,height:o}=i;return i==null||i.close(),Iz(a,o,t,n,r)});return function(t,n,r,i){return e.apply(this,arguments)}}();function Rz({width:e,height:t,softSideLimit:n,softPixelLimit:r}){if(!(e>0&&t>0))return{width:1,height:1};let i=Math.max(e,t),a=e*t,o=i>n?n/i:1,s=a>r?Math.sqrt(r/a):1,c=Math.min(o,s,1);return{width:Math.max(1,Math.floor(e*c)),height:Math.max(1,Math.floor(t*c))}}function zz(e,t,n){return Bz.apply(this,arguments)}function Bz(){return Bz=d(function*(e,t,n){return new Promise(r=>{if(!e||!e.size)return r({ok:!1});let i=document.createElement(`canvas`),a=i.getContext(`2d`),o=URL.createObjectURL(e),s=new Image,c=e=>{try{URL.revokeObjectURL(o)}catch(e){}try{i.width=0,i.height=0}catch(e){}s.onload=null,s.onerror=null,s.src=``,r(e)};s.onload=function(){let e=Rz({width:s.width,height:s.height,softSideLimit:t,softPixelLimit:n});if(i.width=e.width,i.height=e.height,a)try{a.drawImage(s,0,0,e.width,e.height);let t=a.getImageData(0,0,e.width,e.height);return c(t?{ok:!0,imageData:t}:{ok:!1})}catch(e){return c({ok:!1})}return c({ok:!1})},s.onerror=()=>c({ok:!1}),s.src=o})}),Bz.apply(this,arguments)}var Vz=e=>{let{translationKeysData:t,translationKeysProps:n,locale:r}=e,i={},a=null;for(let e in t)i[t[e].key]=e;for(let e in n)i[e]&&n[e]&&(a?a[i[e]]=n[e]:a={[i[e]]:n[e]});return a?{[r]:a}:{}},Hz={preparingCamera:{fallback:`Preparing the camera...`,key:`strPrepareCamera`},timeout:{fallback:`Timeout`,key:`strTimeout`},noFocus:{fallback:`No camera focus`,key:`strNoFocus`},somethingWentWrong:{fallback:`Something went wrong`,key:`messageUnknownError`},incorrectCameraId:{fallback:`No camera with the specified ID found.`,key:`InfoScreenIncorrectCameraIdTitle`},done:{fallback:`Done!`,key:`strDoneMessage`},cameraUnavailable:{fallback:`Camera unavailable!`,key:`statusCameraUnavailableTitle`},versionNotSupported:{fallback:`Your browser version is not supported`,key:`statusBrowserNotSupportedTitle`},httpNotSupported:{fallback:`HTTPS not used`,key:`statusBrowserHTTPNotSupportedSubtitle`},insecurePageContext:{fallback:`Insecure context`,key:`statusBrowserInsecurePageContextSubtitle`},badLicense:{fallback:`The license cannot be found or has expired`,key:`statusProcMgrBadLicenseSubtitle`},fileCorrupt:{fallback:`This file is corrupt or not supported`,key:`statusIncorrectDataTitle`},largeFile:{fallback:`This file is too large to be uploaded`,key:`statusLargeDataTitle`},placeDocumentIntoFrame:{fallback:`Fit the document into the frame`,key:`strPlaceDocumentInFrame`},holdDocumentStraight:{fallback:`Hold the document straight`,key:`strHoldDocumentStraight`},glaresOnDocument:{fallback:`Avoid glare on the document`,key:`strGlaresOnDocument`},tryAgain:{fallback:`Try again`,key:`faceLivenessScreenButton`},noCameraAvailable:{fallback:`No camera available`,key:`InfoScreenNoCameraTitle`},positionDocumentCenter:{fallback:`Position the document in the center`,key:`documentReaderDocumentReaderLayoutDocumentCenter`},uploadPhoto:{fallback:`Upload a photo`,key:`cameraCaptureCameraCaptureStartScreenTitle`},moveCloser:{fallback:`Move closer`,key:`hint.moveCloser`},keepDeviceStill:{fallback:`Hold the device still`,key:`strKeepDeviceStill`},camera:{fallback:`Camera`,key:`strCamera`},switchToMobile:{fallback:`Switch to mobile`,key:`switchToMobile`},openPhoneCamera:{fallback:`Open the camera on your mobile device, scan the QR code, and follow the link`,key:`openPhoneCamera`},pleaseWait:{fallback:`Please wait...`,key:`strPleaseWait`},mobileDevice:{fallback:`Mobile device`,key:`mobileDevice`},verifyYourIdentity:{fallback:`Identity document verification`,key:`verifyYourIdentity`},fromCameraFilesMobileDesktop:{fallback:`Capture a document using the computer’s camera, upload it from files, or scan it on a mobile device`,key:`fromCameraFilesMobileDesktop`},fromCameraFilesDesktop:{fallback:`Capture a document using the computer’s camera or upload it from files`,key:`fromCameraFilesDesktop`},fromCameraMobileDesktop:{fallback:`Capture a document using the computer’s camera or scan it on a mobile device`,key:`fromCameraMobileDesktop`},fromFilesMobileDesktop:{fallback:`Upload a document from files or scan it on a mobile device`,key:`fromFilesMobileDesktop`},fromCameraDesktop:{fallback:`Use the computer's camera to capture a document`,key:`fromCameraDesktop`},fromFilesDesktop:{fallback:`Pick a document from files and upload it`,key:`fromFilesDesktop`},fromMobileDesktop:{fallback:`Use your mobile camera to capture a document`,key:`fromMobileDesktop`},fromCameraGalleryMobile:{fallback:`Capture a document using the mobile's camera or upload it from gallery`,key:`fromCameraGalleryMobile`},fromGalleryMobile:{fallback:`Pick a document from the gallery and upload it`,key:`fromGalleryMobile`},gallery:{fallback:`Gallery`,key:`gallery`},files:{fallback:`Files`,key:`files`},returnToComputer:{fallback:`Return to the computer`,key:`returnToComputer`},documentCaptured:{fallback:`Your document has been captured`,key:`documentCaptured`},or:{fallback:`or`,key:`strOr`},continueInBrowser:{fallback:`Click here to continue in browser`,key:`continueInBrowser`},skip:{fallback:`Skip`,key:`strSkip`},flipTheDocument:{fallback:`Flip the document`,key:`documentReaderDocumentReaderLayoutFlipDocument`},tiltTheDocument:{fallback:`Tilt the document`,key:`strTiltDocument`}},Uz=s`
36
36
  *,
37
37
  ::after,
38
38
  ::before {
@@ -57,7 +57,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
57
57
  width: 100%;
58
58
  height: 100%;
59
59
  }
60
- `;function Gz(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)}function Kz(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);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);return i>3&&a&&Object.defineProperty(t,n,a),a}var qz=class extends Ne{constructor(...e){super(...e),this._performType=sz.DATA,this.props=null,this._handleDocumentReader=e=>{var t,n,r,i;if((t=this.props)==null||(n=t.idvEventListener)==null||n.call(t,`IDV-DOCUMENT`,e.detail.action),e.detail.action===W.CAMERA_PROCESS_STARTED&&(r=this.props)!=null&&r.isProcessing&&this.props.isProcessing(!1),e.detail.action===W.PROCESS_FINISHED){var a,o,s,c,l;if(((a=e.detail.data)==null?void 0:a.status)===ip.ERROR){var u;let t={transactionId:``,cancel:!1,has_nfc:!1,errorCode:e.detail.data.reason};(u=this.props)==null||u.perform(t,this._performType)}let t=(o=e.detail.data)==null?void 0:o.status,n=t===ip.OK,r=t===ip.TIMEOUT;if(!(n||r)||!((s=e.detail.data)!=null&&s.response))return;if((c=this.props)!=null&&c.isProcessing){var d,f;(d=this.props)==null||(f=d.idvEventListener)==null||f.call(d,`IDV-DOCUMENT`,`Success. Start to finalize package`,`DEBUG`),this.props.isProcessing(!0)}let i=(l=this.props)==null||(l=l.moduleProps)==null?void 0:l.finalizePackageSettings;Pz(()=>window.RegulaDocumentSDK.finalizePackage(),i==null?void 0:i.retryCount,i==null?void 0:i.retryDelay).then(e=>{var t;let n={transactionId:(e==null?void 0:e.transactionId)||``,cancel:!1,has_nfc:!1,errorCode:``};(t=this.props)==null||t.perform(n,this._performType)}).catch(e=>{var t;console.log(`finalizePackage error: `,e),(t=this.props)==null||t.perform({transactionId:``,cancel:!0,has_nfc:!1,errorCode:``},this._performType)})}if(((i=e.detail)==null?void 0:i.action)===W.CLOSE||e.detail.action===W.CAMERA_PROCESS_CLOSED){var p;(p=this.props)==null||p.perform({transactionId:``,cancel:!0,has_nfc:!1,errorCode:``},this._performType)}}}_prepareCustomizationStyles(e,t,n){let r=[];if(e!=null&&e.fontFamily&&r.push(s`
60
+ `;function Wz(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)}function Gz(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);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);return i>3&&a&&Object.defineProperty(t,n,a),a}var Kz=class extends Ne{constructor(...e){super(...e),this._performType=sz.DATA,this.props=null,this._handleDocumentReader=e=>{var t,n,r,i;if((t=this.props)==null||(n=t.idvEventListener)==null||n.call(t,`IDV-DOCUMENT`,e.detail.action),e.detail.action===W.CAMERA_PROCESS_STARTED&&(r=this.props)!=null&&r.isProcessing&&this.props.isProcessing(!1),e.detail.action===W.PROCESS_FINISHED){var a,o,s,c,l;if(((a=e.detail.data)==null?void 0:a.status)===ip.ERROR){var u;let t={transactionId:``,cancel:!1,has_nfc:!1,errorCode:e.detail.data.reason};(u=this.props)==null||u.perform(t,this._performType)}let t=(o=e.detail.data)==null?void 0:o.status,n=t===ip.OK,r=t===ip.TIMEOUT;if(!(n||r)||!((s=e.detail.data)!=null&&s.response))return;if((c=this.props)!=null&&c.isProcessing){var d,f;(d=this.props)==null||(f=d.idvEventListener)==null||f.call(d,`IDV-DOCUMENT`,`Success. Start to finalize package`,`DEBUG`),this.props.isProcessing(!0)}let i=(l=this.props)==null||(l=l.moduleProps)==null?void 0:l.finalizePackageSettings;Nz(()=>window.RegulaDocumentSDK.finalizePackage(),i==null?void 0:i.retryCount,i==null?void 0:i.retryDelay).then(e=>{var t;let n={transactionId:(e==null?void 0:e.transactionId)||``,cancel:!1,has_nfc:!1,errorCode:``};(t=this.props)==null||t.perform(n,this._performType)}).catch(e=>{var t;console.log(`finalizePackage error: `,e),(t=this.props)==null||t.perform({transactionId:``,cancel:!0,has_nfc:!1,errorCode:``},this._performType)})}if(((i=e.detail)==null?void 0:i.action)===W.CLOSE||e.detail.action===W.CAMERA_PROCESS_CLOSED){var p;(p=this.props)==null||p.perform({transactionId:``,cancel:!0,has_nfc:!1,errorCode:``},this._performType)}}}_prepareCustomizationStyles(e,t,n){let r=[];if(e!=null&&e.fontFamily&&r.push(s`
61
61
  document-reader::part(container) {
62
62
  font-family: ${o(e.fontFamily)};
63
63
  }
@@ -141,11 +141,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
141
141
  document-reader::part(info-try-again-button)::before {
142
142
  background-image: url(${o(i)});
143
143
  }
144
- `)}return r}_prepareTranslations(e){let{locale:t,localizationKeys:n}=e,r=t&&typeof t==`string`?t.slice(0,2).toLowerCase():``;return!r||!n?null:Hz({translationKeysData:Uz,translationKeysProps:n,locale:r})}_prepareSettings({copyright:e,customization:t,functionality:n,locale:r}){var i,a,o,s,c;let l=oz({copyright:e,skipButton:n==null?void 0:n.showSkipNextPageButton,captureButton:n==null?void 0:n.showCaptureButton,captureButtonDelay:n==null?void 0:n.showCaptureButtonDelayFromStart,cameraFrameOffsetWidth:t==null?void 0:t.cameraFrameWidthOffset,cameraFrameActiveColor:t==null?void 0:t.cameraFrameActiveColor,cameraFrameDefaultColor:t==null?void 0:t.cameraFrameDefaultColor,closeButton:n==null?void 0:n.showCloseButton,changeCameraButton:n==null?void 0:n.showCameraSwitchButton,videoCaptureMotionControl:n==null?void 0:n.videoCaptureMotionControl,statusIcon:t==null?void 0:t.showStatusMessages,cameraFrameBorderWidth:t==null?void 0:t.cameraFrameBorderWidth,cameraFrameLineLength:t==null?void 0:t.cameraFrameLineLength,nextPageAnimationEndDelay:t==null?void 0:t.nextPageAnimationEndDelay,nextPageAnimationStartDelay:t==null?void 0:t.nextPageAnimationStartDelay,statusPositionMultiplier:t==null?void 0:t.statusPositionMultiplier,cameraFrameLandscapeAspectRatio:t==null?void 0:t.cameraFrameLandscapeAspectRatio,cameraFramePortraitAspectRatio:t==null?void 0:t.cameraFramePortraitAspectRatio,cameraFrameCornerRadius:t==null?void 0:t.cameraFrameCornerRadius,cameraFrameVerticalPositionMultiplier:t==null?void 0:t.cameraFramePositionMultiplier,cameraFrameHorizontalPositionMultiplier:t==null?void 0:t.cameraFramePositionMultiplier,internalScenario:n==null?void 0:n.internalScenario,multipageProcessing:n==null?void 0:n.multipageProcessing,multipleFileInput:n==null?void 0:n.multipleFileInput,cameraId:n==null?void 0:n.cameraId,mirrorType:n==null?void 0:n.mirrorType,mobileDelegate:n==null?void 0:n.mobileDelegate,finalizeOnTimeout:n==null?void 0:n.finalizeOnTimeout,maxImageSize:n==null?void 0:n.maxImageSize,maxResolutionSize:n==null?void 0:n.maxResolutionSize,cameraMode:n==null?void 0:n.cameraMode,videoRecord:n==null?void 0:n.recordScanningProcess,activityIndicatorLandscapePositionMultiplier:t==null?void 0:t.activityIndicatorLandscapePositionMultiplier,activityIndicatorPortraitPositionMultiplier:t==null?void 0:t.activityIndicatorPortraitPositionMultiplier,cameraFrameLineCap:t==null?void 0:t.cameraFrameLineCap,fromCameraButton:t==null?void 0:t.fromCameraButton,uploadFileButton:t==null?void 0:t.uploadFileButton,mirrorButton:t==null?void 0:t.mirrorButton,nonce:(i=this.props)==null?void 0:i.nonce}),u=rz(rz(rz(rz(rz({},!!r&&typeof r==`string`&&{locale:r.slice(0,2).toLowerCase()}),typeof(n==null?void 0:n.captureMode)==`number`&&n.captureMode in _z&&{captureMode:_z[n.captureMode]}),typeof(t==null?void 0:t.cameraFrameShapeType)==`number`&&t.cameraFrameShapeType in vz&&{cameraFrameShapeType:vz[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:rz(rz({},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 yz&&{cameraFrame:yz[n.cameraFrame]});return rz(rz({},l),u)}_setDocReaderProps(){var e,t,n;if(!this.props||!this._component)return;(e=(t=this.props).isProcessing)==null||e.call(t,!0);let{processParam:r,functionality:i,customization:a,sessionId:o,copyright:s,serviceToken:l,locale:u,preloadAssetsRequired:d,failedAssets:f}=this.props.moduleProps,p=Iz(r),m=p==null||(n=p.backendProcessing)==null?void 0:n.serviceURL;if(!m||!cz(m)){let e=new Dz({errorCode:hz.CONFIGURATION_FAILED,message:`serviceURL is not defined or is invalid.`}),t=new Ez({errorCode:mz.SCAN_ERROR,underlyingBaseError:e});this.props.perform(t)}if(l&&p!=null&&p.backendProcessing){var h;p.backendProcessing.httpHeaders=rz({Authorization:`Connection ${l}`},p==null||(h=p.backendProcessing)==null?void 0:h.httpHeaders)}let g={processParam:rz({},p)};o&&(g.tag=o),window.RegulaDocumentSDK.recognizerProcessParam=g,window.RegulaDocumentSDK.imageProcessParam={processParam:{scenario:_f.MrzAndLocate}},c(this.shadowRoot,[...this.shadowRoot.adoptedStyleSheets,...this._prepareCustomizationStyles(a,d,f)]),this._component.settings=this._prepareSettings({copyright:s,customization:a,functionality:i,locale:u}),this._component.translations=this._prepareTranslations(this.props.moduleProps)}updated(e){e.has(`props`)&&this._setDocReaderProps()}render(){return fe`<document-reader
144
+ `)}return r}_prepareTranslations(e){let{locale:t,localizationKeys:n}=e,r=t&&typeof t==`string`?t.slice(0,2).toLowerCase():``;return!r||!n?null:Vz({translationKeysData:Hz,translationKeysProps:n,locale:r})}_prepareSettings({copyright:e,customization:t,functionality:n,locale:r}){var i,a,o,s,c;let l=oz({copyright:e,skipButton:n==null?void 0:n.showSkipNextPageButton,captureButton:n==null?void 0:n.showCaptureButton,captureButtonDelay:n==null?void 0:n.showCaptureButtonDelayFromStart,cameraFrameOffsetWidth:t==null?void 0:t.cameraFrameWidthOffset,cameraFrameActiveColor:t==null?void 0:t.cameraFrameActiveColor,cameraFrameDefaultColor:t==null?void 0:t.cameraFrameDefaultColor,closeButton:n==null?void 0:n.showCloseButton,changeCameraButton:n==null?void 0:n.showCameraSwitchButton,videoCaptureMotionControl:n==null?void 0:n.videoCaptureMotionControl,statusIcon:t==null?void 0:t.showStatusMessages,cameraFrameBorderWidth:t==null?void 0:t.cameraFrameBorderWidth,cameraFrameLineLength:t==null?void 0:t.cameraFrameLineLength,nextPageAnimationEndDelay:t==null?void 0:t.nextPageAnimationEndDelay,nextPageAnimationStartDelay:t==null?void 0:t.nextPageAnimationStartDelay,statusPositionMultiplier:t==null?void 0:t.statusPositionMultiplier,cameraFrameLandscapeAspectRatio:t==null?void 0:t.cameraFrameLandscapeAspectRatio,cameraFramePortraitAspectRatio:t==null?void 0:t.cameraFramePortraitAspectRatio,cameraFrameCornerRadius:t==null?void 0:t.cameraFrameCornerRadius,cameraFrameVerticalPositionMultiplier:t==null?void 0:t.cameraFramePositionMultiplier,cameraFrameHorizontalPositionMultiplier:t==null?void 0:t.cameraFramePositionMultiplier,internalScenario:n==null?void 0:n.internalScenario,multipageProcessing:n==null?void 0:n.multipageProcessing,multipleFileInput:n==null?void 0:n.multipleFileInput,cameraId:n==null?void 0:n.cameraId,mirrorType:n==null?void 0:n.mirrorType,mobileDelegate:n==null?void 0:n.mobileDelegate,finalizeOnTimeout:n==null?void 0:n.finalizeOnTimeout,maxImageSize:n==null?void 0:n.maxImageSize,maxResolutionSize:n==null?void 0:n.maxResolutionSize,cameraMode:n==null?void 0:n.cameraMode,videoRecord:n==null?void 0:n.recordScanningProcess,activityIndicatorLandscapePositionMultiplier:t==null?void 0:t.activityIndicatorLandscapePositionMultiplier,activityIndicatorPortraitPositionMultiplier:t==null?void 0:t.activityIndicatorPortraitPositionMultiplier,cameraFrameLineCap:t==null?void 0:t.cameraFrameLineCap,fromCameraButton:t==null?void 0:t.fromCameraButton,uploadFileButton:t==null?void 0:t.uploadFileButton,mirrorButton:t==null?void 0:t.mirrorButton,nonce:(i=this.props)==null?void 0:i.nonce}),u=rz(rz(rz(rz(rz({},!!r&&typeof r==`string`&&{locale:r.slice(0,2).toLowerCase()}),typeof(n==null?void 0:n.captureMode)==`number`&&n.captureMode in _z&&{captureMode:_z[n.captureMode]}),typeof(t==null?void 0:t.cameraFrameShapeType)==`number`&&t.cameraFrameShapeType in vz&&{cameraFrameShapeType:vz[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:rz(rz({},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 yz&&{cameraFrame:yz[n.cameraFrame]});return rz(rz({},l),u)}_setDocReaderProps(){var e,t,n;if(!this.props||!this._component)return;(e=(t=this.props).isProcessing)==null||e.call(t,!0);let{processParam:r,functionality:i,customization:a,sessionId:o,copyright:s,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;if(!m||!cz(m)){let e=new Ez({errorCode:hz.CONFIGURATION_FAILED,message:`serviceURL is not defined or is invalid.`}),t=new Tz({errorCode:mz.SCAN_ERROR,underlyingBaseError:e});this.props.perform(t)}if(l&&p!=null&&p.backendProcessing){var h;p.backendProcessing.httpHeaders=rz({Authorization:`Connection ${l}`},p==null||(h=p.backendProcessing)==null?void 0:h.httpHeaders)}let g={processParam:rz({},p)};o&&(g.tag=o),window.RegulaDocumentSDK.recognizerProcessParam=g,window.RegulaDocumentSDK.imageProcessParam={processParam:{scenario:_f.MrzAndLocate}},c(this.shadowRoot,[...this.shadowRoot.adoptedStyleSheets,...this._prepareCustomizationStyles(a,d,f)]),this._component.settings=this._prepareSettings({copyright:s,customization:a,functionality:i,locale:u}),this._component.translations=this._prepareTranslations(this.props.moduleProps)}updated(e){e.has(`props`)&&this._setDocReaderProps()}render(){return fe`<document-reader
145
145
  new-layout
146
146
  start-screen=${!1}
147
147
  @document-reader=${this._handleDocumentReader}
148
- ></document-reader>`}},Jz=(qz.styles=[Wz],qz);Kz([kz(),Gz(`design:type`,Object)],Jz.prototype,`props`,void 0),Kz([jz(`document-reader`),Gz(`design:type`,TI===void 0?Object:TI)],Jz.prototype,`_component`,void 0),Jz=Kz([Oz(`document-reader-camera`)],Jz);var Yz=e=>e==null?z:e,Xz=s`
148
+ ></document-reader>`}},qz=(Kz.styles=[Uz],Kz);Gz([Oz(),Wz(`design:type`,Object)],qz.prototype,`props`,void 0),Gz([Az(`document-reader`),Wz(`design:type`,TI===void 0?Object:TI)],qz.prototype,`_component`,void 0),qz=Gz([Dz(`document-reader-camera`)],qz);var Jz=e=>e==null?z:e,Yz=s`
149
149
  .gallery-root {
150
150
  display: flex;
151
151
  width: 100%;
@@ -206,7 +206,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
206
206
  align-items: center;
207
207
  justify-content: center;
208
208
  }
209
- `,Zz=fe`<svg
209
+ `,Xz=fe`<svg
210
210
  xmlns="http://www.w3.org/2000/svg"
211
211
  viewBox="0 0 24 24"
212
212
  width="24"
@@ -214,7 +214,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
214
214
  fill="rgba(0,0,0,0.6)"
215
215
  >
216
216
  <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" />
217
- </svg>`,Qz=fe` <svg
217
+ </svg>`,Zz=fe` <svg
218
218
  width="40"
219
219
  height="40"
220
220
  viewBox="0 0 23 22"
@@ -245,7 +245,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
245
245
  <rect width="22" height="22" fill="white" transform="translate(0.5 1.90735e-05)" />
246
246
  </clipPath>
247
247
  </defs>
248
- </svg>`,$z=fe`<svg
248
+ </svg>`,Qz=fe`<svg
249
249
  width="113"
250
250
  height="16"
251
251
  viewBox="0 0 113 16"
@@ -277,17 +277,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
277
277
  d="M93.1547 5.85404C92.7965 5.24412 91.9727 4.77991 90.8981 4.77991C89.0174 4.77991 87.459 6.35794 87.459 8.38431C87.459 10.3925 89.0174 11.9336 90.8981 11.9336C91.9191 11.9336 92.5637 11.6287 93.0651 10.9996V11.6455C93.0651 13.0442 92.08 13.5462 91.1308 13.5462C90.1816 13.5462 89.4292 13.0792 89.286 12.0578H87.7099C87.7818 13.8512 89.2142 15 91.1308 15C93.0474 15 94.6758 13.9063 94.6758 11.539V4.83175H93.1547V5.85404ZM91.0772 10.3911C89.9307 10.3911 89.1069 9.54811 89.1069 8.38291C89.1069 7.21772 89.9307 6.32058 91.0772 6.32058C92.2237 6.32058 93.0651 7.21725 93.0651 8.38291C93.0651 9.54858 92.2232 10.3911 91.0772 10.3911Z"
278
278
  fill="#BD7DFF"
279
279
  />
280
- </svg>`,eB=class extends Ne{constructor(...e){var t;super(...e),t=this,this._performType=sz.DATA,this.props=null,this._handleInputChange=function(){var e=d(function*(e){var n,r,i;let a=[...(n=e.target.files)==null?[]:n];if(!a.length)return;(r=t.props)!=null&&r.isProcessing&&t.props.isProcessing(!0),yield window.RegulaDocumentSDK.createBackendTransaction({},window.RegulaDocumentSDK.recognizerProcessParam);let o=[];for(let e of a){let{isExtraLargeResolution:n,isDownscaleNeeded:r}=yield Rz(e,bz,xz,Sz),i=e.type.startsWith(`image/webp`);if(n){var s;(s=t.props)==null||s.perform({transactionId:``,cancel:!1,has_nfc:!1,errorCode:`IMAGE_RESOLUTION_EXCEEDS_LIMIT`},t._performType);return}if(r||i){let n=yield Bz(e,bz,xz);if(!n.ok){var c;let e={transactionId:``,cancel:!1,has_nfc:!1,errorCode:r?`IMAGE_DOWNSCALING_ERROR`:`IMAGE_PROCESSING_ERROR`};(c=t.props)==null||c.perform(e,t._performType);return}o.push(n.imageData)}else o.push(yield e.arrayBuffer())}try{yield window.RegulaDocumentSDK.processImage(o)}catch(e){var l;(l=t.props)==null||l.perform({transactionId:``,cancel:!1,has_nfc:!1,errorCode:`IMAGE_PROCESSING_ERROR`},t._performType);return}let u=(i=t.props)==null||(i=i.moduleProps)==null?void 0:i.finalizePackageSettings;try{var f;let e=yield Pz(d(function*(){return window.RegulaDocumentSDK.finalizePackage()}),u==null?void 0:u.retryCount,u==null?void 0:u.retryDelay),n={transactionId:e==null?void 0:e.transactionId,cancel:!1,has_nfc:!1,errorCode:``};(f=t.props)==null||f.perform(n,t._performType)}catch(e){var p;console.log(`finalizePackage error: `,e),(p=t.props)==null||p.perform({transactionId:``,cancel:!0,has_nfc:!1,errorCode:``},t._performType)}});return function(t){return e.apply(this,arguments)}}()}_handleUploadClick(){this._input.click()}_handleCloseClick(){var e;(e=this.props)==null||e.perform({transactionId:``,cancel:!0,has_nfc:!1,errorCode:``},this._performType)}_setDocReaderGalleryProps(){var e;if(!this.props)return;let{processParam:t,sessionId:n,serviceToken:r,selectionLimit:i}=this.props.moduleProps;this._input.multiple=typeof i==`number`&&(i===0||i>1);let a=Iz(t),o=a==null||(e=a.backendProcessing)==null?void 0:e.serviceURL;if(!o||!cz(o)){let e=new Dz({errorCode:hz.CONFIGURATION_FAILED,message:`serviceURL is not defined or is invalid.`}),t=new Ez({errorCode:mz.SCAN_ERROR,underlyingBaseError:e});this.props.perform(t)}r&&a!=null&&a.backendProcessing&&(a.backendProcessing.httpHeaders={Authorization:`Connection ${r}`});let s={processParam:rz({},a)};n&&(s.tag=n),window.RegulaDocumentSDK.recognizerProcessParam=s,window.RegulaDocumentSDK.imageProcessParam={processParam:{scenario:_f.MrzAndLocate}}}updated(e){e.has(`props`)&&this._setDocReaderGalleryProps()}render(){var e,t;let n=(e=this.props)==null?void 0:e.moduleProps.locale;return fe`<div
280
+ </svg>`,$z=class extends Ne{constructor(...e){var t;super(...e),t=this,this._performType=sz.DATA,this.props=null,this._handleInputChange=function(){var e=d(function*(e){var n,r,i;let a=[...(n=e.target.files)==null?[]:n];if(!a.length)return;(r=t.props)!=null&&r.isProcessing&&t.props.isProcessing(!0),yield window.RegulaDocumentSDK.createBackendTransaction({},window.RegulaDocumentSDK.recognizerProcessParam);let o=[];for(let e of a){let{isExtraLargeResolution:n,isDownscaleNeeded:r}=yield Lz(e,bz,xz,Sz),i=e.type.startsWith(`image/webp`);if(n){var s;(s=t.props)==null||s.perform({transactionId:``,cancel:!1,has_nfc:!1,errorCode:`IMAGE_RESOLUTION_EXCEEDS_LIMIT`},t._performType);return}if(r||i){let n=yield zz(e,bz,xz);if(!n.ok){var c;let e={transactionId:``,cancel:!1,has_nfc:!1,errorCode:r?`IMAGE_DOWNSCALING_ERROR`:`IMAGE_PROCESSING_ERROR`};(c=t.props)==null||c.perform(e,t._performType);return}o.push(n.imageData)}else o.push(yield e.arrayBuffer())}try{yield window.RegulaDocumentSDK.processImage(o)}catch(e){var l;(l=t.props)==null||l.perform({transactionId:``,cancel:!1,has_nfc:!1,errorCode:`IMAGE_PROCESSING_ERROR`},t._performType);return}let u=(i=t.props)==null||(i=i.moduleProps)==null?void 0:i.finalizePackageSettings;try{var f;let e=yield Nz(d(function*(){return window.RegulaDocumentSDK.finalizePackage()}),u==null?void 0:u.retryCount,u==null?void 0:u.retryDelay),n={transactionId:e==null?void 0:e.transactionId,cancel:!1,has_nfc:!1,errorCode:``};(f=t.props)==null||f.perform(n,t._performType)}catch(e){var p;console.log(`finalizePackage error: `,e),(p=t.props)==null||p.perform({transactionId:``,cancel:!0,has_nfc:!1,errorCode:``},t._performType)}});return function(t){return e.apply(this,arguments)}}()}_handleUploadClick(){this._input.click()}_handleCloseClick(){var e;(e=this.props)==null||e.perform({transactionId:``,cancel:!0,has_nfc:!1,errorCode:``},this._performType)}_setDocReaderGalleryProps(){var e;if(!this.props)return;let{processParam:t,sessionId:n,serviceToken:r,selectionLimit:i}=this.props.moduleProps;this._input.multiple=typeof i==`number`&&(i===0||i>1);let a=Fz(t),o=a==null||(e=a.backendProcessing)==null?void 0:e.serviceURL;if(!o||!cz(o)){let e=new Ez({errorCode:hz.CONFIGURATION_FAILED,message:`serviceURL is not defined or is invalid.`}),t=new Tz({errorCode:mz.SCAN_ERROR,underlyingBaseError:e});this.props.perform(t)}r&&a!=null&&a.backendProcessing&&(a.backendProcessing.httpHeaders={Authorization:`Connection ${r}`});let s={processParam:rz({},a)};n&&(s.tag=n),window.RegulaDocumentSDK.recognizerProcessParam=s,window.RegulaDocumentSDK.imageProcessParam={processParam:{scenario:_f.MrzAndLocate}}}updated(e){e.has(`props`)&&this._setDocReaderGalleryProps()}render(){var e,t;let n=(e=this.props)==null?void 0:e.moduleProps.locale;return fe`<div
281
281
  part="gallery-root"
282
282
  class="gallery-root"
283
283
  dir="${uz(n)}"
284
284
  lang="${n}"
285
- style="background: ${Yz((t=this.props)==null||(t=t.moduleProps)==null?void 0:t.backgroundColor)}"
285
+ style="background: ${Jz((t=this.props)==null||(t=t.moduleProps)==null?void 0:t.backgroundColor)}"
286
286
  >
287
287
  <div class="header">
288
- <button @click="${this._handleCloseClick}" class="close-btn">${Zz}</button>
288
+ <button @click="${this._handleCloseClick}" class="close-btn">${Xz}</button>
289
289
  </div>
290
- <button @click="${this._handleUploadClick}" class="btn">${Qz}</button>
290
+ <button @click="${this._handleUploadClick}" class="btn">${Zz}</button>
291
291
  <input
292
292
  @change="${this._handleInputChange}"
293
293
  id="file-input"
@@ -296,6 +296,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
296
296
  accept="image/png, image/jpeg, image/bmp, image/webp, image/gif, .jpg, .jpeg"
297
297
  />
298
298
  <div class="footer">
299
- <a href>${$z} </a>
299
+ <a href>${Qz} </a>
300
300
  </div>
301
- </div>`}},tB=(eB.styles=[Xz],eB);Kz([kz(),Gz(`design:type`,Object)],tB.prototype,`props`,void 0),Kz([jz(`#file-input`),Gz(`design:type`,typeof HTMLInputElement>`u`?Object:HTMLInputElement)],tB.prototype,`_input`,void 0),tB=Kz([Oz(`document-reader-gallery`)],tB);var nB,rB=!1,iB=class e extends Ne{constructor(...e){super(...e),this.props=null,this.renderVersion=0}setProps(t){if(!e.getSupportedTemplates().includes(t.moduleProps.templateId)){var n;let e=new Ez({errorCode:mz.UNKNOWN_STEP,message:`TemplateId ${t.moduleProps.templateId} is not supported`});(n=t.perform)==null||n.call(t,e)}let r=t.moduleProps.failedAssets;if(r&&r.blockingAssets.size>0){var i;let e=new Ez({errorCode:mz.IMAGE_LOADING_FAILED,message:`Failed to load image asset${r.blockingAssets.size>1?`s`:``}: ${[...r.blockingAssets].join(`, `)}`});(i=t.perform)==null||i.call(t,e)}this.renderVersion++,this.props=t}static isReady(){return rB}static getSupportedTemplates(){return[pz.DOC_READER,pz.DOC_READER_GALLERY]}static initialize(e){var t,n;let r=e==null||(t=e.docreader)==null?void 0:t.devLicense,i=e==null||(n=e.docreader)==null?void 0:n.module;window.RegulaDocumentSDK=new KR,console.info(`%cDocument Reader web component version: %s`,`color: #6e56b0;`,window.RegulaDocumentSDK.version.component),qR().then(()=>{window.RegulaDocumentSDK.initialize({license:r,module:i}).then(()=>rB=!0)})}static deinitialize(){var e;rB=!1,(e=window.RegulaDocumentSDK)==null||e.shutdown()}static getIdentifier(){return gz}static cancel(){}render(){var e;return fe`${Be(this.renderVersion,fe`${ZR((e=this.props)==null||(e=e.moduleProps)==null?void 0:e.templateId,[[pz.DOC_READER,()=>fe`<document-reader-camera .props=${this.props}></document-reader-camera>`],[pz.DOC_READER_GALLERY,()=>fe`<document-reader-gallery .props=${this.props}></document-reader-gallery>`]])}`)}`}};return nB=iB,nB.displayName=gz,Kz([XR({attribute:!1}),Gz(`design:type`,Object)],iB.prototype,`props`,void 0),Kz([XR({attribute:!1}),Gz(`design:type`,Object)],iB.prototype,`renderVersion`,void 0),az(gz,iB),e.DocumentIdv=iB,e.ModuleType=Cz,e})({});
301
+ </div>`}},eB=($z.styles=[Yz],$z);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);var tB,nB=!1,rB=class e extends Ne{constructor(...e){super(...e),this.props=null,this.renderVersion=0}setProps(t){if(!e.getSupportedTemplates().includes(t.moduleProps.templateId)){var n;let e=new Tz({errorCode:mz.UNKNOWN_STEP,message:`TemplateId ${t.moduleProps.templateId} is not supported`});(n=t.perform)==null||n.call(t,e)}let r=t.moduleProps.failedAssets;if(r&&r.blockingAssets.size>0){var i;let e=new Tz({errorCode:mz.IMAGE_LOADING_FAILED,message:`Failed to load image asset${r.blockingAssets.size>1?`s`:``}: ${[...r.blockingAssets].join(`, `)}`});(i=t.perform)==null||i.call(t,e)}this.renderVersion++,this.props=t}static isReady(){return nB}static getSupportedTemplates(){return[pz.DOC_READER,pz.DOC_READER_GALLERY]}static initialize(e){var t,n;let r=e==null||(t=e.docreader)==null?void 0:t.devLicense,i=e==null||(n=e.docreader)==null?void 0:n.module;window.RegulaDocumentSDK=new KR,console.info(`%cDocument Reader web component version: %s`,`color: #6e56b0;`,window.RegulaDocumentSDK.version.component),qR().then(()=>{window.RegulaDocumentSDK.initialize({license:r,module:i}).then(()=>nB=!0)})}static deinitialize(){var e;nB=!1,(e=window.RegulaDocumentSDK)==null||e.shutdown()}static getIdentifier(){return gz}static cancel(){}render(){var e;return fe`${Be(this.renderVersion,fe`${ZR((e=this.props)==null||(e=e.moduleProps)==null?void 0:e.templateId,[[pz.DOC_READER,()=>fe`<document-reader-camera .props=${this.props}></document-reader-camera>`],[pz.DOC_READER_GALLERY,()=>fe`<document-reader-gallery .props=${this.props}></document-reader-gallery>`]])}`)}`}};return tB=rB,tB.displayName=gz,Gz([XR({attribute:!1}),Wz(`design:type`,Object)],rB.prototype,`props`,void 0),Gz([XR({attribute:!1}),Wz(`design:type`,Object)],rB.prototype,`renderVersion`,void 0),az(gz,rB),e.DocumentIdv=rB,e.ModuleType=Ef,e})({});
package/dist/main.js CHANGED
@@ -20808,9 +20808,7 @@ var oz = {
20808
20808
  1: !0,
20809
20809
  2: !1,
20810
20810
  3: !0
20811
- }, yz = 1920, bz = 4e6, xz = 5e7, Sz = /* @__PURE__ */ function(e) {
20812
- return e.BarcodeMRZ = "BarcodeMRZ", e.BoundsLite = "BoundsLite", e;
20813
- }({}), Cz, wz, Tz = class e extends rz {
20811
+ }, yz = 1920, bz = 4e6, xz = 5e7, Sz, Cz, wz = class e extends rz {
20814
20812
  constructor({ errorCode: t, message: n, underlyingError: r, underlyingBaseError: i }) {
20815
20813
  let a = rz.getErrorKey(t, pz);
20816
20814
  super({
@@ -20826,8 +20824,8 @@ var oz = {
20826
20824
  });
20827
20825
  }
20828
20826
  };
20829
- Cz = Tz, Cz.MODULE = hz, Cz.ERROR_ENUM_NAME = "ReaderModuleError", Cz.SHORT_CODE = "RM";
20830
- var Ez = class e extends rz {
20827
+ Sz = wz, Sz.MODULE = hz, Sz.ERROR_ENUM_NAME = "ReaderModuleError", Sz.SHORT_CODE = "RM";
20828
+ var Tz = class e extends rz {
20831
20829
  constructor({ errorCode: t, message: n, underlyingError: r, underlyingBaseError: i }) {
20832
20830
  let a = rz.getErrorKey(t, mz);
20833
20831
  super({
@@ -20843,17 +20841,17 @@ var Ez = class e extends rz {
20843
20841
  });
20844
20842
  }
20845
20843
  };
20846
- wz = Ez, wz.MODULE = hz, wz.ERROR_ENUM_NAME = "ScanError", wz.SHORT_CODE = "RMS";
20844
+ Cz = Tz, Cz.MODULE = hz, Cz.ERROR_ENUM_NAME = "ScanError", Cz.SHORT_CODE = "RMS";
20847
20845
  //#endregion
20848
20846
  //#region ../../node_modules/@lit/reactive-element/decorators/custom-element.js
20849
- var Dz = (e) => (t, n) => {
20847
+ var Ez = (e) => (t, n) => {
20850
20848
  n === void 0 ? customElements.define(e, t) : n.addInitializer(() => {
20851
20849
  customElements.define(e, t);
20852
20850
  });
20853
20851
  };
20854
20852
  //#endregion
20855
20853
  //#region ../../node_modules/@lit/reactive-element/decorators/state.js
20856
- function Oz(e) {
20854
+ function Dz(e) {
20857
20855
  return YR(nz(nz({}, e), {}, {
20858
20856
  state: !0,
20859
20857
  attribute: !1
@@ -20861,10 +20859,10 @@ function Oz(e) {
20861
20859
  }
20862
20860
  //#endregion
20863
20861
  //#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);
20862
+ var Oz = (e, t, n) => (n.configurable = !0, n.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(e, t, n), n);
20865
20863
  //#endregion
20866
20864
  //#region ../../node_modules/@lit/reactive-element/decorators/query.js
20867
- function Az(e, t) {
20865
+ function kz(e, t) {
20868
20866
  return (n, r, i) => {
20869
20867
  let a = (t) => {
20870
20868
  var n, r;
@@ -20882,31 +20880,31 @@ function Az(e, t) {
20882
20880
  }
20883
20881
  };
20884
20882
  })() : i;
20885
- return kz(n, r, { get() {
20883
+ return Oz(n, r, { get() {
20886
20884
  let n = e.call(this);
20887
20885
  return n === void 0 && (n = a(this), (n !== null || this.hasUpdated) && t.call(this, n)), n;
20888
20886
  } });
20889
20887
  }
20890
- return kz(n, r, { get() {
20888
+ return Oz(n, r, { get() {
20891
20889
  return a(this);
20892
20890
  } });
20893
20891
  };
20894
20892
  }
20895
20893
  //#endregion
20896
20894
  //#region src/utils/index.ts
20897
- function jz(e) {
20898
- return Mz.apply(this, arguments);
20895
+ function Az(e) {
20896
+ return jz.apply(this, arguments);
20899
20897
  }
20900
- function Mz() {
20901
- return Mz = u(function* (e) {
20898
+ function jz() {
20899
+ return jz = u(function* (e) {
20902
20900
  return new Promise((t) => setTimeout(t, e));
20903
- }), Mz.apply(this, arguments);
20901
+ }), jz.apply(this, arguments);
20904
20902
  }
20905
- function Nz(e) {
20906
- return Pz.apply(this, arguments);
20903
+ function Mz(e) {
20904
+ return Nz.apply(this, arguments);
20907
20905
  }
20908
- function Pz() {
20909
- return Pz = u(function* (e, t = 0, n = 0) {
20906
+ function Nz() {
20907
+ return Nz = u(function* (e, t = 0, n = 0) {
20910
20908
  let r = null, i = n * 1e3;
20911
20909
  for (let n = 0; n <= t; n++) {
20912
20910
  try {
@@ -20916,13 +20914,13 @@ function Pz() {
20916
20914
  } catch (e) {
20917
20915
  r = e;
20918
20916
  }
20919
- n < t && (yield jz(i));
20917
+ n < t && (yield Az(i));
20920
20918
  }
20921
20919
  throw r;
20922
- }), Pz.apply(this, arguments);
20920
+ }), Nz.apply(this, arguments);
20923
20921
  }
20924
- var Fz = (e) => e ? (e.internalScenario && (e.scenario = e.internalScenario), delete e.internalScenario, e) : {};
20925
- function Iz(e, t, n, r, i) {
20922
+ var Pz = (e) => e ? (e.internalScenario && (e.scenario = e.internalScenario), delete e.internalScenario, e) : {};
20923
+ function Fz(e, t, n, r, i) {
20926
20924
  let a = e * t, o = a > i;
20927
20925
  return {
20928
20926
  width: e,
@@ -20931,16 +20929,16 @@ function Iz(e, t, n, r, i) {
20931
20929
  isDownscaleNeeded: (e > n || t > n || a > r) && !o
20932
20930
  };
20933
20931
  }
20934
- var Lz = function() {
20932
+ var Iz = function() {
20935
20933
  var e = u(function* (e, t, n, r) {
20936
20934
  let i = yield createImageBitmap(e), { width: a, height: o } = i;
20937
- return i == null || i.close(), Iz(a, o, t, n, r);
20935
+ return i == null || i.close(), Fz(a, o, t, n, r);
20938
20936
  });
20939
20937
  return function(t, n, r, i) {
20940
20938
  return e.apply(this, arguments);
20941
20939
  };
20942
20940
  }();
20943
- function Rz({ width: e, height: t, softSideLimit: n, softPixelLimit: r }) {
20941
+ function Lz({ width: e, height: t, softSideLimit: n, softPixelLimit: r }) {
20944
20942
  if (!(e > 0 && t > 0)) return {
20945
20943
  width: 1,
20946
20944
  height: 1
@@ -20951,11 +20949,11 @@ function Rz({ width: e, height: t, softSideLimit: n, softPixelLimit: r }) {
20951
20949
  height: Math.max(1, Math.floor(t * c))
20952
20950
  };
20953
20951
  }
20954
- function zz(e, t, n) {
20955
- return Bz.apply(this, arguments);
20952
+ function Rz(e, t, n) {
20953
+ return zz.apply(this, arguments);
20956
20954
  }
20957
- function Bz() {
20958
- return Bz = u(function* (e, t, n) {
20955
+ function zz() {
20956
+ return zz = u(function* (e, t, n) {
20959
20957
  return new Promise((r) => {
20960
20958
  if (!e || !e.size) return r({ ok: !1 });
20961
20959
  let i = document.createElement("canvas"), a = i.getContext("2d"), o = URL.createObjectURL(e), s = new Image(), c = (e) => {
@@ -20968,7 +20966,7 @@ function Bz() {
20968
20966
  s.onload = null, s.onerror = null, s.src = "", r(e);
20969
20967
  };
20970
20968
  s.onload = function() {
20971
- let e = Rz({
20969
+ let e = Lz({
20972
20970
  width: s.width,
20973
20971
  height: s.height,
20974
20972
  softSideLimit: t,
@@ -20987,14 +20985,14 @@ function Bz() {
20987
20985
  return c({ ok: !1 });
20988
20986
  }, s.onerror = () => c({ ok: !1 }), s.src = o;
20989
20987
  });
20990
- }), Bz.apply(this, arguments);
20988
+ }), zz.apply(this, arguments);
20991
20989
  }
20992
- var Vz = (e) => {
20990
+ var Bz = (e) => {
20993
20991
  let { translationKeysData: t, translationKeysProps: n, locale: r } = e, i = {}, a = null;
20994
20992
  for (let e in t) i[t[e].key] = e;
20995
20993
  for (let e in n) i[e] && n[e] && (a ? a[i[e]] = n[e] : a = { [i[e]]: n[e] });
20996
20994
  return a ? { [r]: a } : {};
20997
- }, Hz = {
20995
+ }, Vz = {
20998
20996
  preparingCamera: {
20999
20997
  fallback: "Preparing the camera...",
21000
20998
  key: "strPrepareCamera"
@@ -21179,7 +21177,7 @@ var Vz = (e) => {
21179
21177
  fallback: "Tilt the document",
21180
21178
  key: "strTiltDocument"
21181
21179
  }
21182
- }, Uz = o`
21180
+ }, Hz = o`
21183
21181
  *,
21184
21182
  ::after,
21185
21183
  ::before {
@@ -21207,12 +21205,12 @@ var Vz = (e) => {
21207
21205
  `;
21208
21206
  //#endregion
21209
21207
  //#region \0@oxc-project+runtime@0.154.0/helpers/esm/decorateMetadata.js
21210
- function Wz(e, t) {
21208
+ function Uz(e, t) {
21211
21209
  if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
21212
21210
  }
21213
21211
  //#endregion
21214
21212
  //#region \0@oxc-project+runtime@0.154.0/helpers/esm/decorate.js
21215
- function Gz(e, t, n, r) {
21213
+ function Wz(e, t, n, r) {
21216
21214
  var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
21217
21215
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
21218
21216
  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);
@@ -21220,7 +21218,7 @@ function Gz(e, t, n, r) {
21220
21218
  }
21221
21219
  //#endregion
21222
21220
  //#region src/web-components/document-idv/components/document-reader-camera/index.ts
21223
- var Kz = class extends Me {
21221
+ var Gz = class extends Me {
21224
21222
  constructor(...e) {
21225
21223
  super(...e), this._performType = oz.DATA, this.props = null, this._handleDocumentReader = (e) => {
21226
21224
  var t, n, r, i;
@@ -21243,7 +21241,7 @@ var Kz = class extends Me {
21243
21241
  (d = this.props) == null || (f = d.idvEventListener) == null || f.call(d, "IDV-DOCUMENT", "Success. Start to finalize package", "DEBUG"), this.props.isProcessing(!0);
21244
21242
  }
21245
21243
  let i = (l = this.props) == null || (l = l.moduleProps) == null ? void 0 : l.finalizePackageSettings;
21246
- Nz(() => window.RegulaDocumentSDK.finalizePackage(), i == null ? void 0 : i.retryCount, i == null ? void 0 : i.retryDelay).then((e) => {
21244
+ Mz(() => window.RegulaDocumentSDK.finalizePackage(), i == null ? void 0 : i.retryCount, i == null ? void 0 : i.retryDelay).then((e) => {
21247
21245
  var t;
21248
21246
  let n = {
21249
21247
  transactionId: (e == null ? void 0 : e.transactionId) || "",
@@ -21391,8 +21389,8 @@ var Kz = class extends Me {
21391
21389
  }
21392
21390
  _prepareTranslations(e) {
21393
21391
  let { locale: t, localizationKeys: n } = e, r = t && typeof t == "string" ? t.slice(0, 2).toLowerCase() : "";
21394
- return !r || !n ? null : Vz({
21395
- translationKeysData: Hz,
21392
+ return !r || !n ? null : Bz({
21393
+ translationKeysData: Vz,
21396
21394
  translationKeysProps: n,
21397
21395
  locale: r
21398
21396
  });
@@ -21446,12 +21444,12 @@ var Kz = class extends Me {
21446
21444
  var e, t, n;
21447
21445
  if (!this.props || !this._component) return;
21448
21446
  (e = (t = this.props).isProcessing) == null || e.call(t, !0);
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;
21447
+ let { processParam: r, functionality: i, customization: a, sessionId: o, copyright: c, serviceToken: l, locale: u, preloadAssetsRequired: d, failedAssets: f } = this.props.moduleProps, p = Pz(r), m = p == null || (n = p.backendProcessing) == null ? void 0 : n.serviceURL;
21450
21448
  if (!m || !sz(m)) {
21451
- let e = new Ez({
21449
+ let e = new Tz({
21452
21450
  errorCode: mz.CONFIGURATION_FAILED,
21453
21451
  message: "serviceURL is not defined or is invalid."
21454
- }), t = new Tz({
21452
+ }), t = new wz({
21455
21453
  errorCode: pz.SCAN_ERROR,
21456
21454
  underlyingBaseError: e
21457
21455
  });
@@ -21479,11 +21477,11 @@ var Kz = class extends Me {
21479
21477
  @document-reader=${this._handleDocumentReader}
21480
21478
  ></document-reader>`;
21481
21479
  }
21482
- }, qz = (Kz.styles = [Uz], Kz);
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);
21480
+ }, Kz = (Gz.styles = [Hz], Gz);
21481
+ Wz([Dz(), Uz("design:type", Object)], Kz.prototype, "props", void 0), Wz([kz("document-reader"), Uz("design:type", wI === void 0 ? Object : wI)], Kz.prototype, "_component", void 0), Kz = Wz([Ez("document-reader-camera")], Kz);
21484
21482
  //#endregion
21485
21483
  //#region ../../node_modules/lit-html/directives/if-defined.js
21486
- var Jz = (e) => e == null ? z : e, Yz = o`
21484
+ var qz = (e) => e == null ? z : e, Jz = o`
21487
21485
  .gallery-root {
21488
21486
  display: flex;
21489
21487
  width: 100%;
@@ -21544,7 +21542,7 @@ var Jz = (e) => e == null ? z : e, Yz = o`
21544
21542
  align-items: center;
21545
21543
  justify-content: center;
21546
21544
  }
21547
- `, Xz = de`<svg
21545
+ `, Yz = de`<svg
21548
21546
  xmlns="http://www.w3.org/2000/svg"
21549
21547
  viewBox="0 0 24 24"
21550
21548
  width="24"
@@ -21552,7 +21550,7 @@ var Jz = (e) => e == null ? z : e, Yz = o`
21552
21550
  fill="rgba(0,0,0,0.6)"
21553
21551
  >
21554
21552
  <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" />
21555
- </svg>`, Zz = de` <svg
21553
+ </svg>`, Xz = de` <svg
21556
21554
  width="40"
21557
21555
  height="40"
21558
21556
  viewBox="0 0 23 22"
@@ -21583,7 +21581,7 @@ var Jz = (e) => e == null ? z : e, Yz = o`
21583
21581
  <rect width="22" height="22" fill="white" transform="translate(0.5 1.90735e-05)" />
21584
21582
  </clipPath>
21585
21583
  </defs>
21586
- </svg>`, Qz = de`<svg
21584
+ </svg>`, Zz = de`<svg
21587
21585
  width="113"
21588
21586
  height="16"
21589
21587
  viewBox="0 0 113 16"
@@ -21615,7 +21613,7 @@ var Jz = (e) => e == null ? z : e, Yz = o`
21615
21613
  d="M93.1547 5.85404C92.7965 5.24412 91.9727 4.77991 90.8981 4.77991C89.0174 4.77991 87.459 6.35794 87.459 8.38431C87.459 10.3925 89.0174 11.9336 90.8981 11.9336C91.9191 11.9336 92.5637 11.6287 93.0651 10.9996V11.6455C93.0651 13.0442 92.08 13.5462 91.1308 13.5462C90.1816 13.5462 89.4292 13.0792 89.286 12.0578H87.7099C87.7818 13.8512 89.2142 15 91.1308 15C93.0474 15 94.6758 13.9063 94.6758 11.539V4.83175H93.1547V5.85404ZM91.0772 10.3911C89.9307 10.3911 89.1069 9.54811 89.1069 8.38291C89.1069 7.21772 89.9307 6.32058 91.0772 6.32058C92.2237 6.32058 93.0651 7.21725 93.0651 8.38291C93.0651 9.54858 92.2232 10.3911 91.0772 10.3911Z"
21616
21614
  fill="#BD7DFF"
21617
21615
  />
21618
- </svg>`, $z = class extends Me {
21616
+ </svg>`, Qz = class extends Me {
21619
21617
  constructor(...e) {
21620
21618
  var t;
21621
21619
  super(...e), t = this, this._performType = oz.DATA, this.props = null, this._handleInputChange = function() {
@@ -21626,7 +21624,7 @@ var Jz = (e) => e == null ? z : e, Yz = o`
21626
21624
  (r = t.props) != null && r.isProcessing && t.props.isProcessing(!0), yield window.RegulaDocumentSDK.createBackendTransaction({}, window.RegulaDocumentSDK.recognizerProcessParam);
21627
21625
  let o = [];
21628
21626
  for (let e of a) {
21629
- let { isExtraLargeResolution: n, isDownscaleNeeded: r } = yield Lz(e, yz, bz, xz), i = e.type.startsWith("image/webp");
21627
+ let { isExtraLargeResolution: n, isDownscaleNeeded: r } = yield Iz(e, yz, bz, xz), i = e.type.startsWith("image/webp");
21630
21628
  if (n) {
21631
21629
  var s;
21632
21630
  (s = t.props) == null || s.perform({
@@ -21638,7 +21636,7 @@ var Jz = (e) => e == null ? z : e, Yz = o`
21638
21636
  return;
21639
21637
  }
21640
21638
  if (r || i) {
21641
- let n = yield zz(e, yz, bz);
21639
+ let n = yield Rz(e, yz, bz);
21642
21640
  if (!n.ok) {
21643
21641
  var c;
21644
21642
  let e = {
@@ -21668,7 +21666,7 @@ var Jz = (e) => e == null ? z : e, Yz = o`
21668
21666
  let d = (i = t.props) == null || (i = i.moduleProps) == null ? void 0 : i.finalizePackageSettings;
21669
21667
  try {
21670
21668
  var f;
21671
- let e = yield Nz(u(function* () {
21669
+ let e = yield Mz(u(function* () {
21672
21670
  return window.RegulaDocumentSDK.finalizePackage();
21673
21671
  }), d == null ? void 0 : d.retryCount, d == null ? void 0 : d.retryDelay), n = {
21674
21672
  transactionId: e == null ? void 0 : e.transactionId,
@@ -21709,12 +21707,12 @@ var Jz = (e) => e == null ? z : e, Yz = o`
21709
21707
  if (!this.props) return;
21710
21708
  let { processParam: t, sessionId: n, serviceToken: r, selectionLimit: i } = this.props.moduleProps;
21711
21709
  this._input.multiple = typeof i == "number" && (i === 0 || i > 1);
21712
- let a = Fz(t), o = a == null || (e = a.backendProcessing) == null ? void 0 : e.serviceURL;
21710
+ let a = Pz(t), o = a == null || (e = a.backendProcessing) == null ? void 0 : e.serviceURL;
21713
21711
  if (!o || !sz(o)) {
21714
- let e = new Ez({
21712
+ let e = new Tz({
21715
21713
  errorCode: mz.CONFIGURATION_FAILED,
21716
21714
  message: "serviceURL is not defined or is invalid."
21717
- }), t = new Tz({
21715
+ }), t = new wz({
21718
21716
  errorCode: pz.SCAN_ERROR,
21719
21717
  underlyingBaseError: e
21720
21718
  });
@@ -21735,12 +21733,12 @@ var Jz = (e) => e == null ? z : e, Yz = o`
21735
21733
  class="gallery-root"
21736
21734
  dir="${lz(n)}"
21737
21735
  lang="${n}"
21738
- style="background: ${Jz((t = this.props) == null || (t = t.moduleProps) == null ? void 0 : t.backgroundColor)}"
21736
+ style="background: ${qz((t = this.props) == null || (t = t.moduleProps) == null ? void 0 : t.backgroundColor)}"
21739
21737
  >
21740
21738
  <div class="header">
21741
- <button @click="${this._handleCloseClick}" class="close-btn">${Xz}</button>
21739
+ <button @click="${this._handleCloseClick}" class="close-btn">${Yz}</button>
21742
21740
  </div>
21743
- <button @click="${this._handleUploadClick}" class="btn">${Zz}</button>
21741
+ <button @click="${this._handleUploadClick}" class="btn">${Xz}</button>
21744
21742
  <input
21745
21743
  @change="${this._handleInputChange}"
21746
21744
  id="file-input"
@@ -21749,22 +21747,22 @@ var Jz = (e) => e == null ? z : e, Yz = o`
21749
21747
  accept="image/png, image/jpeg, image/bmp, image/webp, image/gif, .jpg, .jpeg"
21750
21748
  />
21751
21749
  <div class="footer">
21752
- <a href>${Qz} </a>
21750
+ <a href>${Zz} </a>
21753
21751
  </div>
21754
21752
  </div>`;
21755
21753
  }
21756
- }, eB = ($z.styles = [Yz], $z);
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);
21754
+ }, $z = (Qz.styles = [Jz], Qz);
21755
+ Wz([Dz(), Uz("design:type", Object)], $z.prototype, "props", void 0), Wz([kz("#file-input"), Uz("design:type", typeof HTMLInputElement > "u" ? Object : HTMLInputElement)], $z.prototype, "_input", void 0), $z = Wz([Ez("document-reader-gallery")], $z);
21758
21756
  //#endregion
21759
21757
  //#region src/web-components/document-idv/index.ts
21760
- var tB, nB = !1, rB = class e extends Me {
21758
+ var eB, tB = !1, nB = class e extends Me {
21761
21759
  constructor(...e) {
21762
21760
  super(...e), this.props = null, this.renderVersion = 0;
21763
21761
  }
21764
21762
  setProps(t) {
21765
21763
  if (!e.getSupportedTemplates().includes(t.moduleProps.templateId)) {
21766
21764
  var n;
21767
- let e = new Tz({
21765
+ let e = new wz({
21768
21766
  errorCode: pz.UNKNOWN_STEP,
21769
21767
  message: `TemplateId ${t.moduleProps.templateId} is not supported`
21770
21768
  });
@@ -21773,7 +21771,7 @@ var tB, nB = !1, rB = class e extends Me {
21773
21771
  let r = t.moduleProps.failedAssets;
21774
21772
  if (r && r.blockingAssets.size > 0) {
21775
21773
  var i;
21776
- let e = new Tz({
21774
+ let e = new wz({
21777
21775
  errorCode: pz.IMAGE_LOADING_FAILED,
21778
21776
  message: `Failed to load image asset${r.blockingAssets.size > 1 ? "s" : ""}: ${[...r.blockingAssets].join(", ")}`
21779
21777
  });
@@ -21782,7 +21780,7 @@ var tB, nB = !1, rB = class e extends Me {
21782
21780
  this.renderVersion++, this.props = t;
21783
21781
  }
21784
21782
  static isReady() {
21785
- return nB;
21783
+ return tB;
21786
21784
  }
21787
21785
  static getSupportedTemplates() {
21788
21786
  return [fz.DOC_READER, fz.DOC_READER_GALLERY];
@@ -21794,12 +21792,12 @@ var tB, nB = !1, rB = class e extends Me {
21794
21792
  window.RegulaDocumentSDK.initialize({
21795
21793
  license: r,
21796
21794
  module: i
21797
- }).then(() => nB = !0);
21795
+ }).then(() => tB = !0);
21798
21796
  });
21799
21797
  }
21800
21798
  static deinitialize() {
21801
21799
  var e;
21802
- nB = !1, (e = window.RegulaDocumentSDK) == null || e.shutdown();
21800
+ tB = !1, (e = window.RegulaDocumentSDK) == null || e.shutdown();
21803
21801
  }
21804
21802
  static getIdentifier() {
21805
21803
  return hz;
@@ -21810,6 +21808,6 @@ var tB, nB = !1, rB = class e extends Me {
21810
21808
  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>`]])}`)}`;
21811
21809
  }
21812
21810
  };
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);
21811
+ eB = nB, eB.displayName = hz, Wz([YR({ attribute: !1 }), Uz("design:type", Object)], nB.prototype, "props", void 0), Wz([YR({ attribute: !1 }), Uz("design:type", Object)], nB.prototype, "renderVersion", void 0), iz(hz, nB);
21814
21812
  //#endregion
21815
- export { rB as DocumentIdv, Sz as ModuleType };
21813
+ export { nB as DocumentIdv, Tf as ModuleType };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regulaforensics/idv-document",
3
- "version": "4.0.679-nightly",
3
+ "version": "4.0.682-nightly",
4
4
  "description": "Regula framework agnostic web components to work with document idv",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/main.iife.js",