/*!
 * @license
 *
 * Scandit Barcode Scanner SDK for the Web
 * v. 5.15.0
 *
 * Copyright © 2022 Scandit AG. All Rights Reserved.
 *
 * The use of this software is governed by the Scandit Terms and Conditions.
 * https://ssl.scandit.com/terms/test.pdf
 *
 * The following sets forth attribution notices for third party software that may be contained in portions of the product.
 * https://docs.scandit.com/stable/web/LICENSE
 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ScanditSDK={})}(this,(function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=Math.ceil,r=Math.floor,i=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)},a=function(e){if(null==e)throw TypeError("Can't call method on  "+e);return e},o=i,s=a,c={exports:{}},u=c.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=u);var l={exports:{}},d=l.exports={version:"2.6.12"};"number"==typeof __e&&(__e=d);var h=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},m=h,f=function(e,t,n){if(m(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}},g={},p=function(e){return"object"==typeof e?null!==e:"function"==typeof e},v=p,y=function(e){if(!v(e))throw TypeError(e+" is not an object!");return e},b=function(e){try{return!!e()}catch(e){return!0}},S=!b((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),E=p,A=c.exports.document,C=E(A)&&E(A.createElement),w=function(e){return C?A.createElement(e):{}},_=!S&&!b((function(){return 7!=Object.defineProperty(w("div"),"a",{get:function(){return 7}}).a})),T=p,I=function(e,t){if(!T(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!T(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!T(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!T(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},N=y,M=_,L=I,k=Object.defineProperty;g.f=S?Object.defineProperty:function(e,t,n){if(N(e),t=L(t,!0),N(n),M)try{return k(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e};var x=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},V=g,O=x,D=S?function(e,t,n){return V.f(e,t,O(1,n))}:function(e,t,n){return e[t]=n,e},R={}.hasOwnProperty,j=function(e,t){return R.call(e,t)},F=c.exports,P=l.exports,U=f,G=D,B=j,z=function(e,t,n){var r,i,a,o=e&z.F,s=e&z.G,c=e&z.S,u=e&z.P,l=e&z.B,d=e&z.W,h=s?P:P[t]||(P[t]={}),m=h.prototype,f=s?F:c?F[t]:(F[t]||{}).prototype;for(r in s&&(n=t),n)(i=!o&&f&&void 0!==f[r])&&B(h,r)||(a=i?f[r]:n[r],h[r]=s&&"function"!=typeof f[r]?n[r]:l&&i?U(a,F):d&&f[r]==a?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(a):u&&"function"==typeof a?U(Function.call,a):a,u&&((h.virtual||(h.virtual={}))[r]=a,e&z.R&&m&&!m[r]&&G(m,r,a)))};z.F=1,z.G=2,z.S=4,z.P=8,z.B=16,z.W=32,z.U=64,z.R=128;var W=z,Y=D,H={},Q={}.toString,Z=function(e){return Q.call(e).slice(8,-1)},q=Z,X=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==q(e)?e.split(""):Object(e)},J=X,K=a,$=function(e){return J(K(e))},ee=i,te=Math.min,ne=function(e){return e>0?te(ee(e),9007199254740991):0},re=i,ie=Math.max,ae=Math.min,oe=$,se=ne,ce={exports:{}},ue=l.exports,le=c.exports,de="__core-js_shared__",he=le[de]||(le[de]={});(ce.exports=function(e,t){return he[e]||(he[e]=void 0!==t?t:{})})("versions",[]).push({version:ue.version,mode:"pure",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"});var me=0,fe=Math.random(),ge=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++me+fe).toString(36))},pe=ce.exports("keys"),ve=ge,ye=function(e){return pe[e]||(pe[e]=ve(e))},be=j,Se=$,Ee=(!1,function(e,t,n){for(var r=oe(e),i=se(r.length),a=function(e,t){return(e=re(e))<0?ie(e+t,0):ae(e,t)}(n,i);i>a;a++)if(a in r&&r[a]===t)return a||0;return-1}),Ae=ye("IE_PROTO"),Ce=function(e,t){var n,r=Se(e),i=0,a=[];for(n in r)n!=Ae&&be(r,n)&&a.push(n);for(;t.length>i;)be(r,n=t[i++])&&(~Ee(a,n)||a.push(n));return a},we="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),_e=Ce,Te=we,Ie=Object.keys||function(e){return _e(e,Te)},Ne=g,Me=y,Le=Ie,ke=S?Object.defineProperties:function(e,t){Me(e);for(var n,r=Le(t),i=r.length,a=0;i>a;)Ne.f(e,n=r[a++],t[n]);return e},xe=c.exports.document,Ve=xe&&xe.documentElement,Oe=y,De=ke,Re=we,je=ye("IE_PROTO"),Fe=function(){},Pe=function(){var e,t=w("iframe"),n=Re.length;for(t.style.display="none",Ve.appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),Pe=e.F;n--;)delete Pe.prototype[Re[n]];return Pe()},Ue=Object.create||function(e,t){var n;return null!==e?(Fe.prototype=Oe(e),n=new Fe,Fe.prototype=null,n[je]=e):n=Pe(),void 0===t?n:De(n,t)},Ge={exports:{}},Be=ce.exports("wks"),ze=ge,We=c.exports.Symbol,Ye="function"==typeof We;(Ge.exports=function(e){return Be[e]||(Be[e]=Ye&&We[e]||(Ye?We:ze)("Symbol."+e))}).store=Be;var He=g.f,Qe=j,Ze=Ge.exports("toStringTag"),qe=function(e,t,n){e&&!Qe(e=n?e:e.prototype,Ze)&&He(e,Ze,{configurable:!0,value:t})},Xe=Ue,Je=x,Ke=qe,$e={};D($e,Ge.exports("iterator"),(function(){return this}));var et=a,tt=function(e){return Object(et(e))},nt=j,rt=tt,it=ye("IE_PROTO"),at=Object.prototype,ot=Object.getPrototypeOf||function(e){return e=rt(e),nt(e,it)?e[it]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?at:null},st=W,ct=Y,ut=D,lt=H,dt=function(e,t,n){e.prototype=Xe($e,{next:Je(1,n)}),Ke(e,t+" Iterator")},ht=qe,mt=ot,ft=Ge.exports("iterator"),gt=!([].keys&&"next"in[].keys()),pt="keys",vt="values",yt=function(){return this},bt=function(e,t,n,r,i,a,o){dt(n,t,r);var s,c,u,l=function(e){if(!gt&&e in f)return f[e];switch(e){case pt:case vt:return function(){return new n(this,e)}}return function(){return new n(this,e)}},d=t+" Iterator",h=i==vt,m=!1,f=e.prototype,g=f[ft]||f["@@iterator"]||i&&f[i],p=g||l(i),v=i?h?l("entries"):p:void 0,y="Array"==t&&f.entries||g;if(y&&(u=mt(y.call(new e)))!==Object.prototype&&u.next&&ht(u,d,!0),h&&g&&g.name!==vt&&(m=!0,p=function(){return g.call(this)}),o&&(gt||m||!f[ft])&&ut(f,ft,p),lt[t]=p,lt[d]=yt,i)if(s={values:h?p:l(vt),keys:a?p:l(pt),entries:v},o)for(c in s)c in f||ct(f,c,s[c]);else st(st.P+st.F*(gt||m),t,s);return s},St=function(e,t){var n,r,i=String(s(e)),a=o(t),c=i.length;return a<0||a>=c?"":(n=i.charCodeAt(a))<55296||n>56319||a+1===c||(r=i.charCodeAt(a+1))<56320||r>57343?i.charAt(a):i.slice(a,a+2)};bt(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=St(t,n),this._i+=e.length,{value:e,done:!1})}));var Et=function(e,t){return{value:t,done:!!e}},At=Et,Ct=H,wt=$;bt(Array,"Array",(function(e,t){this._t=wt(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,At(1)):At(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values"),Ct.Arguments=Ct.Array;for(var _t=c.exports,Tt=D,It=H,Nt=Ge.exports("toStringTag"),Mt="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),Lt=0;Lt<Mt.length;Lt++){var kt=Mt[Lt],xt=_t[kt],Vt=xt&&xt.prototype;Vt&&!Vt[Nt]&&Tt(Vt,Nt,kt),It[kt]=It.Array}var Ot=Z,Dt=Ge.exports("toStringTag"),Rt="Arguments"==Ot(function(){return arguments}()),jt=function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),Dt))?n:Rt?Ot(t):"Object"==(r=Ot(t))&&"function"==typeof t.callee?"Arguments":r},Ft=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e},Pt={exports:{}},Ut=y,Gt=function(e,t,n,r){try{return r?t(Ut(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&Ut(i.call(e)),t}},Bt=H,zt=Ge.exports("iterator"),Wt=Array.prototype,Yt=function(e){return void 0!==e&&(Bt.Array===e||Wt[zt]===e)},Ht=jt,Qt=Ge.exports("iterator"),Zt=H,qt=l.exports.getIteratorMethod=function(e){if(null!=e)return e[Qt]||e["@@iterator"]||Zt[Ht(e)]},Xt=f,Jt=Gt,Kt=Yt,$t=y,en=ne,tn=qt,nn={},rn={},an=Pt.exports=function(e,t,n,r,i){var a,o,s,c,u=i?function(){return e}:tn(e),l=Xt(n,r,t?2:1),d=0;if("function"!=typeof u)throw TypeError(e+" is not iterable!");if(Kt(u)){for(a=en(e.length);a>d;d++)if((c=t?l($t(o=e[d])[0],o[1]):l(e[d]))===nn||c===rn)return c}else for(s=u.call(e);!(o=s.next()).done;)if((c=Jt(s,l,o.value,t))===nn||c===rn)return c};an.BREAK=nn,an.RETURN=rn;var on,sn,cn,un=y,ln=h,dn=Ge.exports("species"),hn=function(e,t){var n,r=un(e).constructor;return void 0===r||null==(n=un(r)[dn])?t:ln(n)},mn=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)},fn=f,gn=mn,pn=Ve,vn=w,yn=c.exports,bn=yn.process,Sn=yn.setImmediate,En=yn.clearImmediate,An=yn.MessageChannel,Cn=yn.Dispatch,wn=0,_n={},Tn=function(){var e=+this;if(_n.hasOwnProperty(e)){var t=_n[e];delete _n[e],t()}},In=function(e){Tn.call(e.data)};Sn&&En||(Sn=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return _n[++wn]=function(){gn("function"==typeof e?e:Function(e),t)},on(wn),wn},En=function(e){delete _n[e]},"process"==Z(bn)?on=function(e){bn.nextTick(fn(Tn,e,1))}:Cn&&Cn.now?on=function(e){Cn.now(fn(Tn,e,1))}:An?(cn=(sn=new An).port2,sn.port1.onmessage=In,on=fn(cn.postMessage,cn,1)):yn.addEventListener&&"function"==typeof postMessage&&!yn.importScripts?(on=function(e){yn.postMessage(e+"","*")},yn.addEventListener("message",In,!1)):on="onreadystatechange"in vn("script")?function(e){pn.appendChild(vn("script")).onreadystatechange=function(){pn.removeChild(this),Tn.call(e)}}:function(e){setTimeout(fn(Tn,e,1),0)});var Nn={set:Sn,clear:En},Mn=c.exports,Ln=Nn.set,kn=Mn.MutationObserver||Mn.WebKitMutationObserver,xn=Mn.process,Vn=Mn.Promise,On="process"==Z(xn),Dn={},Rn=h;function jn(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=Rn(t),this.reject=Rn(n)}Dn.f=function(e){return new jn(e)};var Fn=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}},Pn=c.exports.navigator,Un=Pn&&Pn.userAgent||"",Gn=y,Bn=p,zn=Dn,Wn=function(e,t){if(Gn(e),Bn(t)&&t.constructor===e)return t;var n=zn.f(e);return(0,n.resolve)(t),n.promise},Yn=D,Hn=function(e,t,n){for(var r in t)n&&e[r]?e[r]=t[r]:Yn(e,r,t[r]);return e},Qn=c.exports,Zn=l.exports,qn=g,Xn=S,Jn=Ge.exports("species"),Kn=function(e){var t="function"==typeof Zn[e]?Zn[e]:Qn[e];Xn&&t&&!t[Jn]&&qn.f(t,Jn,{configurable:!0,get:function(){return this}})},$n=Ge.exports("iterator"),er=!1;try{var tr=[7][$n]();tr.return=function(){er=!0},Array.from(tr,(function(){throw 2}))}catch(e){}var nr,rr,ir,ar,or=function(e,t){if(!t&&!er)return!1;var n=!1;try{var r=[7],i=r[$n]();i.next=function(){return{done:n=!0}},r[$n]=function(){return i},e(r)}catch(e){}return n},sr=c.exports,cr=f,ur=jt,lr=W,dr=p,hr=h,mr=Ft,fr=Pt.exports,gr=hn,pr=Nn.set,vr=function(){var e,t,n,r=function(){var r,i;for(On&&(r=xn.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(On)n=function(){xn.nextTick(r)};else if(!kn||Mn.navigator&&Mn.navigator.standalone)if(Vn&&Vn.resolve){var i=Vn.resolve(void 0);n=function(){i.then(r)}}else n=function(){Ln.call(Mn,r)};else{var a=!0,o=document.createTextNode("");new kn(r).observe(o,{characterData:!0}),n=function(){o.data=a=!a}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}(),yr=Dn,br=Fn,Sr=Un,Er=Wn,Ar="Promise",Cr=sr.TypeError,wr=sr.process,_r=wr&&wr.versions,Tr=_r&&_r.v8||"",Ir=sr.Promise,Nr="process"==ur(wr),Mr=function(){},Lr=rr=yr.f,kr=!!function(){try{var e=Ir.resolve(1),t=(e.constructor={})[Ge.exports("species")]=function(e){e(Mr,Mr)};return(Nr||"function"==typeof PromiseRejectionEvent)&&e.then(Mr)instanceof t&&0!==Tr.indexOf("6.6")&&-1===Sr.indexOf("Chrome/66")}catch(e){}}(),xr=function(e){var t;return!(!dr(e)||"function"!=typeof(t=e.then))&&t},Vr=function(e,t){if(!e._n){e._n=!0;var n=e._c;vr((function(){for(var r=e._v,i=1==e._s,a=0,o=function(t){var n,a,o,s=i?t.ok:t.fail,c=t.resolve,u=t.reject,l=t.domain;try{s?(i||(2==e._h&&Rr(e),e._h=1),!0===s?n=r:(l&&l.enter(),n=s(r),l&&(l.exit(),o=!0)),n===t.promise?u(Cr("Promise-chain cycle")):(a=xr(n))?a.call(n,c,u):c(n)):u(r)}catch(e){l&&!o&&l.exit(),u(e)}};n.length>a;)o(n[a++]);e._c=[],e._n=!1,t&&!e._h&&Or(e)}))}},Or=function(e){pr.call(sr,(function(){var t,n,r,i=e._v,a=Dr(e);if(a&&(t=br((function(){Nr?wr.emit("unhandledRejection",i,e):(n=sr.onunhandledrejection)?n({promise:e,reason:i}):(r=sr.console)&&r.error&&r.error("Unhandled promise rejection",i)})),e._h=Nr||Dr(e)?2:1),e._a=void 0,a&&t.e)throw t.v}))},Dr=function(e){return 1!==e._h&&0===(e._a||e._c).length},Rr=function(e){pr.call(sr,(function(){var t;Nr?wr.emit("rejectionHandled",e):(t=sr.onrejectionhandled)&&t({promise:e,reason:e._v})}))},jr=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),Vr(t,!0))},Fr=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw Cr("Promise can't be resolved itself");(t=xr(e))?vr((function(){var r={_w:n,_d:!1};try{t.call(e,cr(Fr,r,1),cr(jr,r,1))}catch(e){jr.call(r,e)}})):(n._v=e,n._s=1,Vr(n,!1))}catch(e){jr.call({_w:n,_d:!1},e)}}};kr||(Ir=function(e){mr(this,Ir,Ar,"_h"),hr(e),nr.call(this);try{e(cr(Fr,this,1),cr(jr,this,1))}catch(e){jr.call(this,e)}},(nr=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=Hn(Ir.prototype,{then:function(e,t){var n=Lr(gr(this,Ir));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=Nr?wr.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&Vr(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),ir=function(){var e=new nr;this.promise=e,this.resolve=cr(Fr,e,1),this.reject=cr(jr,e,1)},yr.f=Lr=function(e){return e===Ir||e===ar?new ir(e):rr(e)}),lr(lr.G+lr.W+lr.F*!kr,{Promise:Ir}),qe(Ir,Ar),Kn(Ar),ar=l.exports.Promise,lr(lr.S+lr.F*!kr,Ar,{reject:function(e){var t=Lr(this);return(0,t.reject)(e),t.promise}}),lr(lr.S+!0*lr.F,Ar,{resolve:function(e){return Er(this===ar?Ir:this,e)}}),lr(lr.S+lr.F*!(kr&&or((function(e){Ir.all(e).catch(Mr)}))),Ar,{all:function(e){var t=this,n=Lr(t),r=n.resolve,i=n.reject,a=br((function(){var n=[],a=0,o=1;fr(e,!1,(function(e){var s=a++,c=!1;n.push(void 0),o++,t.resolve(e).then((function(e){c||(c=!0,n[s]=e,--o||r(n))}),i)})),--o||r(n)}));return a.e&&i(a.v),n.promise},race:function(e){var t=this,n=Lr(t),r=n.reject,i=br((function(){fr(e,!1,(function(e){t.resolve(e).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}});var Pr=W,Ur=l.exports,Gr=c.exports,Br=hn,zr=Wn;Pr(Pr.P+Pr.R,"Promise",{finally:function(e){var t=Br(this,Ur.Promise||Gr.Promise),n="function"==typeof e;return this.then(n?function(n){return zr(t,e()).then((function(){return n}))}:e,n?function(n){return zr(t,e()).then((function(){throw n}))}:e)}});var Wr=Dn,Yr=Fn;W(W.S,"Promise",{try:function(e){var t=Wr.f(this),n=Yr(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}});var Hr=l.exports.Promise;function Qr(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){return void n(e)}s.done?t(c):Hr.resolve(c).then(r,i)}function Zr(e){return function(){var t=this,n=arguments;return new Hr((function(r,i){var a=e.apply(t,n);function o(e){Qr(a,r,i,o,s,"next",e)}function s(e){Qr(a,r,i,o,s,"throw",e)}o(void 0)}))}}var qr={exports:{}},Xr={exports:{}},Jr={exports:{}},Kr=ge("meta"),$r=p,ei=j,ti=g.f,ni=0,ri=Object.isExtensible||function(){return!0},ii=!b((function(){return ri(Object.preventExtensions({}))})),ai=function(e){ti(e,Kr,{value:{i:"O"+ ++ni,w:{}}})},oi=Jr.exports={KEY:Kr,NEED:!1,fastKey:function(e,t){if(!$r(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!ei(e,Kr)){if(!ri(e))return"F";if(!t)return"E";ai(e)}return e[Kr].i},getWeak:function(e,t){if(!ei(e,Kr)){if(!ri(e))return!0;if(!t)return!1;ai(e)}return e[Kr].w},onFreeze:function(e){return ii&&oi.NEED&&ri(e)&&!ei(e,Kr)&&ai(e),e}},si={};si.f=Ge.exports;var ci=l.exports,ui=si,li=g.f,di=function(e){var t=ci.Symbol||(ci.Symbol={});"_"==e.charAt(0)||e in t||li(t,e,{value:ui.f(e)})},hi={};hi.f=Object.getOwnPropertySymbols;var mi={};mi.f={}.propertyIsEnumerable;var fi=Ie,gi=hi,pi=mi,vi=Z,yi=Array.isArray||function(e){return"Array"==vi(e)},bi={},Si={},Ei=Ce,Ai=we.concat("length","prototype");Si.f=Object.getOwnPropertyNames||function(e){return Ei(e,Ai)};var Ci=$,wi=Si.f,_i={}.toString,Ti="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];bi.f=function(e){return Ti&&"[object Window]"==_i.call(e)?function(e){try{return wi(e)}catch(e){return Ti.slice()}}(e):wi(Ci(e))};var Ii={},Ni=mi,Mi=x,Li=$,ki=I,xi=j,Vi=_,Oi=Object.getOwnPropertyDescriptor;Ii.f=S?Oi:function(e,t){if(e=Li(e),t=ki(t,!0),Vi)try{return Oi(e,t)}catch(e){}if(xi(e,t))return Mi(!Ni.f.call(e,t),e[t])};var Di=c.exports,Ri=j,ji=S,Fi=W,Pi=Y,Ui=Jr.exports.KEY,Gi=b,Bi=ce.exports,zi=qe,Wi=ge,Yi=Ge.exports,Hi=si,Qi=di,Zi=yi,qi=y,Xi=p,Ji=tt,Ki=$,$i=I,ea=x,ta=Ue,na=bi,ra=Ii,ia=hi,aa=g,oa=Ie,sa=ra.f,ca=aa.f,ua=na.f,la=Di.Symbol,da=Di.JSON,ha=da&&da.stringify,ma=Yi("_hidden"),fa=Yi("toPrimitive"),ga={}.propertyIsEnumerable,pa=Bi("symbol-registry"),va=Bi("symbols"),ya=Bi("op-symbols"),ba=Object.prototype,Sa="function"==typeof la&&!!ia.f,Ea=Di.QObject,Aa=!Ea||!Ea.prototype||!Ea.prototype.findChild,Ca=ji&&Gi((function(){return 7!=ta(ca({},"a",{get:function(){return ca(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=sa(ba,t);r&&delete ba[t],ca(e,t,n),r&&e!==ba&&ca(ba,t,r)}:ca,wa=function(e){var t=va[e]=ta(la.prototype);return t._k=e,t},_a=Sa&&"symbol"==typeof la.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof la},Ta=function(e,t,n){return e===ba&&Ta(ya,t,n),qi(e),t=$i(t,!0),qi(n),Ri(va,t)?(n.enumerable?(Ri(e,ma)&&e[ma][t]&&(e[ma][t]=!1),n=ta(n,{enumerable:ea(0,!1)})):(Ri(e,ma)||ca(e,ma,ea(1,{})),e[ma][t]=!0),Ca(e,t,n)):ca(e,t,n)},Ia=function(e,t){qi(e);for(var n,r=function(e){var t=fi(e),n=gi.f;if(n)for(var r,i=n(e),a=pi.f,o=0;i.length>o;)a.call(e,r=i[o++])&&t.push(r);return t}(t=Ki(t)),i=0,a=r.length;a>i;)Ta(e,n=r[i++],t[n]);return e},Na=function(e,t){if(e=Ki(e),t=$i(t,!0),e!==ba||!Ri(va,t)||Ri(ya,t)){var n=sa(e,t);return!n||!Ri(va,t)||Ri(e,ma)&&e[ma][t]||(n.enumerable=!0),n}},Ma=function(e){for(var t,n=ua(Ki(e)),r=[],i=0;n.length>i;)Ri(va,t=n[i++])||t==ma||t==Ui||r.push(t);return r},La=function(e){for(var t,n=e===ba,r=ua(n?ya:Ki(e)),i=[],a=0;r.length>a;)!Ri(va,t=r[a++])||n&&!Ri(ba,t)||i.push(va[t]);return i};Sa||(la=function(){if(this instanceof la)throw TypeError("Symbol is not a constructor!");var e=Wi(arguments.length>0?arguments[0]:void 0),t=function(n){this===ba&&t.call(ya,n),Ri(this,ma)&&Ri(this[ma],e)&&(this[ma][e]=!1),Ca(this,e,ea(1,n))};return ji&&Aa&&Ca(ba,e,{configurable:!0,set:t}),wa(e)},Pi(la.prototype,"toString",(function(){return this._k})),ra.f=Na,aa.f=Ta,Si.f=na.f=Ma,mi.f=function(e){var t=ga.call(this,e=$i(e,!0));return!(this===ba&&Ri(va,e)&&!Ri(ya,e))&&(!(t||!Ri(this,e)||!Ri(va,e)||Ri(this,ma)&&this[ma][e])||t)},ia.f=La,Hi.f=function(e){return wa(Yi(e))}),Fi(Fi.G+Fi.W+Fi.F*!Sa,{Symbol:la});for(var ka="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),xa=0;ka.length>xa;)Yi(ka[xa++]);for(var Va=oa(Yi.store),Oa=0;Va.length>Oa;)Qi(Va[Oa++]);Fi(Fi.S+Fi.F*!Sa,"Symbol",{for:function(e){return Ri(pa,e+="")?pa[e]:pa[e]=la(e)},keyFor:function(e){if(!_a(e))throw TypeError(e+" is not a symbol!");for(var t in pa)if(pa[t]===e)return t},useSetter:function(){Aa=!0},useSimple:function(){Aa=!1}}),Fi(Fi.S+Fi.F*!Sa,"Object",{create:function(e,t){return void 0===t?ta(e):Ia(ta(e),t)},defineProperty:Ta,defineProperties:Ia,getOwnPropertyDescriptor:Na,getOwnPropertyNames:Ma,getOwnPropertySymbols:La});var Da=Gi((function(){ia.f(1)}));Fi(Fi.S+Fi.F*Da,"Object",{getOwnPropertySymbols:function(e){return ia.f(Ji(e))}}),da&&Fi(Fi.S+Fi.F*(!Sa||Gi((function(){var e=la();return"[null]"!=ha([e])||"{}"!=ha({a:e})||"{}"!=ha(Object(e))}))),"JSON",{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],(Xi(t)||void 0!==e)&&!_a(e))return Zi(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!_a(t))return t}),r[1]=t,ha.apply(da,r)}}),la.prototype[fa]||D(la.prototype,fa,la.prototype.valueOf),zi(la,"Symbol"),zi(Math,"Math",!0),zi(Di.JSON,"JSON",!0),di("asyncIterator"),di("observable");var Ra=l.exports.Symbol,ja=si.f("iterator");!function(e){var t=Ra,n=ja;function r(i){return e.exports=r="function"==typeof t&&"symbol"==typeof n?function(e){return typeof e}:function(e){return e&&"function"==typeof t&&e.constructor===t&&e!==t.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,r(i)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(Xr);var Fa=W;Fa(Fa.S+Fa.F*!S,"Object",{defineProperty:g.f});var Pa=l.exports.Object,Ua=function(e,t,n){return Pa.defineProperty(e,t,n)};W(W.S,"Object",{create:Ue});var Ga,Ba,za,Wa,Ya=l.exports.Object,Ha=function(e,t){return Ya.create(e,t)},Qa=W,Za=l.exports,qa=b,Xa=tt,Ja=ot;Ga="getPrototypeOf",Ba=function(){return function(e){return Ja(Xa(e))}},za=(Za.Object||{})[Ga]||Object[Ga],(Wa={})[Ga]=Ba(),Qa(Qa.S+Qa.F*qa((function(){za(1)})),"Object",Wa);var Ka=l.exports.Object.getPrototypeOf,$a=p,eo=y,to=function(e,t){if(eo(e),!$a(t)&&null!==t)throw TypeError(t+": can't set as prototype!")},no={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{(n=f(Function.call,Ii.f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,r){return to(e,r),t?e.__proto__=r:n(e,r),e}}({},!1):void 0),check:to};W(W.S,"Object",{setPrototypeOf:no.set});var ro=l.exports.Object.setPrototypeOf;!function(e){var t=Xr.exports.default,n=Ua,r=Ra,i=Ha,a=Ka,o=ro,s=Hr;function c(){e.exports=c=function(){return u},e.exports.__esModule=!0,e.exports.default=e.exports;var u={},l=Object.prototype,d=l.hasOwnProperty,h=n||function(e,t,n){e[t]=n.value},m="function"==typeof r?r:{},f=m.iterator||"@@iterator",g=m.asyncIterator||"@@asyncIterator",p=m.toStringTag||"@@toStringTag";function v(e,t,r){return n(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{v({},"")}catch(e){v=function(e,t,n){return e[t]=n}}function y(e,t,n,r){var a=t&&t.prototype instanceof E?t:E,o=i(a.prototype),s=new V(r||[]);return h(o,"_invoke",{value:M(e,n,s)}),o}function b(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}u.wrap=y;var S={};function E(){}function A(){}function C(){}var w={};v(w,f,(function(){return this}));var _=a&&a(a(O([])));_&&_!==l&&d.call(_,f)&&(w=_);var T=C.prototype=E.prototype=i(w);function I(e){["next","throw","return"].forEach((function(t){v(e,t,(function(e){return this._invoke(t,e)}))}))}function N(e,n){function r(i,a,o,s){var c=b(e[i],e,a);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==t(l)&&d.call(l,"__await")?n.resolve(l.__await).then((function(e){r("next",e,o,s)}),(function(e){r("throw",e,o,s)})):n.resolve(l).then((function(e){u.value=e,o(u)}),(function(e){return r("throw",e,o,s)}))}s(c.arg)}var i;h(this,"_invoke",{value:function(e,t){function a(){return new n((function(n,i){r(e,t,n,i)}))}return i=i?i.then(a,a):a()}})}function M(e,t,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return{value:void 0,done:!0}}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=L(o,n);if(s){if(s===S)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=b(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===S)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function L(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,L(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),S;var i=b(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,S;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,S):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,S)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function V(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function O(e){if(e){var t=e[f];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(d.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:D}}function D(){return{value:void 0,done:!0}}return A.prototype=C,h(T,"constructor",{value:C,configurable:!0}),h(C,"constructor",{value:A,configurable:!0}),A.displayName=v(C,p,"GeneratorFunction"),u.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===A||"GeneratorFunction"===(t.displayName||t.name))},u.mark=function(e){return o?o(e,C):(e.__proto__=C,v(e,p,"GeneratorFunction")),e.prototype=i(T),e},u.awrap=function(e){return{__await:e}},I(N.prototype),v(N.prototype,g,(function(){return this})),u.AsyncIterator=N,u.async=function(e,t,n,r,i){void 0===i&&(i=s);var a=new N(y(e,t,n,r),i);return u.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},I(T),v(T,p,"Generator"),v(T,f,(function(){return this})),v(T,"toString",(function(){return"[object Generator]"})),u.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},u.values=O,V.prototype={constructor:V,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&d.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var o=d.call(i,"catchLoc"),s=d.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&d.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,S):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),S},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),S}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:O(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),S}},u}e.exports=c,e.exports.__esModule=!0,e.exports.default=e.exports}(qr);var io=qr.exports(),ao=io;try{regeneratorRuntime=io}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=io:Function("r","regeneratorRuntime = r")(io)}!function(){if("undefined"!=typeof window){var e=window.navigator.userAgent.match(/Edge\/(\d{2})\./),t=e?parseInt(e[1],10):null,n=!!t&&16<=t&&t<=18;if("objectFit"in document.documentElement.style==0||n){var r=function(e,t,n){var r,i,a,o,s;if((n=n.split(" ")).length<2&&(n[1]=n[0]),"x"===e)r=n[0],i=n[1],a="left",o="right",s=t.clientWidth;else{if("y"!==e)return;r=n[1],i=n[0],a="top",o="bottom",s=t.clientHeight}if(r!==a&&i!==a){if(r!==o&&i!==o)return"center"===r||"50%"===r?(t.style[a]="50%",void(t.style["margin-"+a]=s/-2+"px")):void(0<=r.indexOf("%")?(r=parseInt(r,10))<50?(t.style[a]=r+"%",t.style["margin-"+a]=s*(r/-100)+"px"):(r=100-r,t.style[o]=r+"%",t.style["margin-"+o]=s*(r/-100)+"px"):t.style[a]=r);t.style[o]="0"}else t.style[a]="0"},i=function(e){var t=e.dataset?e.dataset.objectFit:e.getAttribute("data-object-fit"),n=e.dataset?e.dataset.objectPosition:e.getAttribute("data-object-position");t=t||"cover",n=n||"50% 50%";var i=e.parentNode;return function(e){var t=window.getComputedStyle(e,null),n=t.getPropertyValue("position"),r=t.getPropertyValue("overflow"),i=t.getPropertyValue("display");n&&"static"!==n||(e.style.position="relative"),"hidden"!==r&&(e.style.overflow="hidden"),i&&"inline"!==i||(e.style.display="block"),0===e.clientHeight&&(e.style.height="100%"),-1===e.className.indexOf("object-fit-polyfill")&&(e.className=e.className+" object-fit-polyfill")}(i),function(e){var t=window.getComputedStyle(e,null),n={"max-width":"none","max-height":"none","min-width":"0px","min-height":"0px",top:"auto",right:"auto",bottom:"auto",left:"auto","margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px"};for(var r in n)t.getPropertyValue(r)!==n[r]&&(e.style[r]=n[r])}(e),e.style.position="absolute",e.style.width="auto",e.style.height="auto","scale-down"===t&&(t=e.clientWidth<i.clientWidth&&e.clientHeight<i.clientHeight?"none":"contain"),"none"===t?(r("x",e,n),void r("y",e,n)):"fill"===t?(e.style.width="100%",e.style.height="100%",r("x",e,n),void r("y",e,n)):(e.style.height="100%",void("cover"===t&&e.clientWidth>i.clientWidth||"contain"===t&&e.clientWidth<i.clientWidth?(e.style.top="0",e.style.marginTop="0",r("x",e,n)):(e.style.width="100%",e.style.height="auto",e.style.left="0",e.style.marginLeft="0",r("y",e,n))))},a=function(e){if(void 0===e||e instanceof Event)e=document.querySelectorAll("[data-object-fit]");else if(e&&e.nodeName)e=[e];else if("object"!=typeof e||!e.length||!e[0].nodeName)return!1;for(var t=0;t<e.length;t++)if(e[t].nodeName){var r=e[t].nodeName.toLowerCase();if("img"===r){if(n)continue;e[t].complete?i(e[t]):e[t].addEventListener("load",(function(){i(this)}))}else"video"===r?0<e[t].readyState?i(e[t]):e[t].addEventListener("loadedmetadata",(function(){i(this)})):i(e[t])}return!0};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",a):a(),window.addEventListener("resize",a),window.objectFitPolyfill=a}else window.objectFitPolyfill=function(){return!1}}}();var oo=g,so=x,co=function(e,t,n){t in e?oo.f(e,t,so(0,n)):e[t]=n},uo=f,lo=W,ho=tt,mo=Gt,fo=Yt,go=ne,po=co,vo=qt;lo(lo.S+lo.F*!or((function(e){Array.from(e)})),"Array",{from:function(e){var t,n,r,i,a=ho(e),o="function"==typeof this?this:Array,s=arguments.length,c=s>1?arguments[1]:void 0,u=void 0!==c,l=0,d=vo(a);if(u&&(c=uo(c,s>2?arguments[2]:void 0,2)),null==d||o==Array&&fo(d))for(n=new o(t=go(a.length));t>l;l++)po(n,l,u?c(a[l],l):a[l]);else for(i=d.call(a),n=new o;!(r=i.next()).done;l++)po(n,l,u?mo(i,c,[r.value,l],!0):r.value);return n.length=l,n}});var yo=l.exports.Array.from;function bo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var So=function e(t,n){function r(e,r,i){if("undefined"!=typeof document){"number"==typeof(i=bo({},n,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var o in i)i[o]&&(a+="; "+o,!0!==i[o]&&(a+="="+i[o].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+a}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},i=0;i<n.length;i++){var a=n[i].split("="),o=a.slice(1).join("=");try{var s=decodeURIComponent(a[0]);if(r[s]=t.read(o,s),e===s)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",bo({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,bo({},this.attributes,t))},withConverter:function(t){return e(bo({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),Eo={exports:{}};!function(e,n){!function(t,r){var i="function",a="undefined",o="object",s="string",c="model",u="name",l="type",d="vendor",h="version",m="architecture",f="console",g="mobile",p="tablet",v="smarttv",y="wearable",b="embedded",S="Amazon",E="Apple",A="ASUS",C="BlackBerry",w="Google",_="Huawei",T="LG",I="Microsoft",N="Motorola",M="Samsung",L="Sharp",k="Sony",x="Xiaomi",V="Zebra",O="Facebook",D=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},R=function(e,t){return typeof e===s&&-1!==j(t).indexOf(j(e))},j=function(e){return e.toLowerCase()},F=function(e,t){if(typeof e===s)return e=e.replace(/^\s\s*/,""),typeof t===a?e:e.substring(0,350)},P=function(e,t){for(var n,a,s,c,u,l,d=0;d<t.length&&!u;){var h=t[d],m=t[d+1];for(n=a=0;n<h.length&&!u;)if(u=h[n++].exec(e))for(s=0;s<m.length;s++)l=u[++a],typeof(c=m[s])===o&&c.length>0?2===c.length?typeof c[1]==i?this[c[0]]=c[1].call(this,l):this[c[0]]=c[1]:3===c.length?typeof c[1]!==i||c[1].exec&&c[1].test?this[c[0]]=l?l.replace(c[1],c[2]):r:this[c[0]]=l?c[1].call(this,l,c[2]):r:4===c.length&&(this[c[0]]=l?c[3].call(this,l.replace(c[1],c[2])):r):this[c]=l||r;d+=2}},U=function(e,t){for(var n in t)if(typeof t[n]===o&&t[n].length>0){for(var i=0;i<t[n].length;i++)if(R(t[n][i],e))return"?"===n?r:n}else if(R(t[n],e))return"?"===n?r:n;return e},G={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},B={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[h,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[h,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,h],[/opios[\/ ]+([\w\.]+)/i],[h,[u,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[h,[u,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[u,h],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[h,[u,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[h,[u,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[h,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[h,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[h,[u,"IE"]],[/yabrowser\/([\w\.]+)/i],[h,[u,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure Browser"],h],[/\bfocus\/([\w\.]+)/i],[h,[u,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[h,[u,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[h,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[h,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[h,[u,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[h,[u,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[h,[u,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 Browser"]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 Browser"],h],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],h],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[u,h],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,O],h],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[u,h],[/\bgsa\/([\w\.]+) .*safari\//i],[h,[u,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[h,[u,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,"Chrome WebView"],h],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[h,[u,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,h],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[h,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[h,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[h,U,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,h],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],h],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[h,[u,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[u,h],[/(cobalt)\/([\w\.]+)/i],[u,[h,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[m,"amd64"]],[/(ia32(?=;))/i],[[m,j]],[/((?:i[346]|x)86)[;\)]/i],[[m,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[m,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[m,"armhf"]],[/windows (ce|mobile); ppc;/i],[[m,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[m,/ower/,"",j]],[/(sun4\w)[;\)]/i],[[m,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[m,j]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[c,[d,M],[l,p]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[c,[d,M],[l,g]],[/\((ip(?:hone|od)[\w ]*);/i],[c,[d,E],[l,g]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[d,E],[l,p]],[/(macintosh);/i],[c,[d,E]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[d,_],[l,p]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[c,[d,_],[l,g]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[c,/_/g," "],[d,x],[l,g]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/g," "],[d,x],[l,p]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[c,[d,"OPPO"],[l,g]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[d,"Vivo"],[l,g]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[c,[d,"Realme"],[l,g]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[c,[d,N],[l,g]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[d,N],[l,p]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[d,T],[l,p]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[c,[d,T],[l,g]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[d,"Lenovo"],[l,p]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[d,"Nokia"],[l,g]],[/(pixel c)\b/i],[c,[d,w],[l,p]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[d,w],[l,g]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[c,[d,k],[l,g]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[d,k],[l,p]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[d,"OnePlus"],[l,g]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[d,S],[l,p]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[d,S],[l,g]],[/(playbook);[-\w\),; ]+(rim)/i],[c,d,[l,p]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[d,C],[l,g]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[d,A],[l,p]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[d,A],[l,g]],[/(nexus 9)/i],[c,[d,"HTC"],[l,p]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[c,/_/g," "],[l,g]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[d,"Acer"],[l,p]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[d,"Meizu"],[l,g]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[d,L],[l,g]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,c,[l,g]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,c,[l,p]],[/(surface duo)/i],[c,[d,I],[l,p]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[d,"Fairphone"],[l,g]],[/(u304aa)/i],[c,[d,"AT&T"],[l,g]],[/\bsie-(\w*)/i],[c,[d,"Siemens"],[l,g]],[/\b(rct\w+) b/i],[c,[d,"RCA"],[l,p]],[/\b(venue[\d ]{2,7}) b/i],[c,[d,"Dell"],[l,p]],[/\b(q(?:mv|ta)\w+) b/i],[c,[d,"Verizon"],[l,p]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[c,[d,"Barnes & Noble"],[l,p]],[/\b(tm\d{3}\w+) b/i],[c,[d,"NuVision"],[l,p]],[/\b(k88) b/i],[c,[d,"ZTE"],[l,p]],[/\b(nx\d{3}j) b/i],[c,[d,"ZTE"],[l,g]],[/\b(gen\d{3}) b.+49h/i],[c,[d,"Swiss"],[l,g]],[/\b(zur\d{3}) b/i],[c,[d,"Swiss"],[l,p]],[/\b((zeki)?tb.*\b) b/i],[c,[d,"Zeki"],[l,p]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],c,[l,p]],[/\b(ns-?\w{0,9}) b/i],[c,[d,"Insignia"],[l,p]],[/\b((nxa|next)-?\w{0,9}) b/i],[c,[d,"NextBook"],[l,p]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],c,[l,g]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],c,[l,g]],[/\b(ph-1) /i],[c,[d,"Essential"],[l,g]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[c,[d,"Envizen"],[l,p]],[/\b(trio[-\w\. ]+) b/i],[c,[d,"MachSpeed"],[l,p]],[/\btu_(1491) b/i],[c,[d,"Rotor"],[l,p]],[/(shield[\w ]+) b/i],[c,[d,"Nvidia"],[l,p]],[/(sprint) (\w+)/i],[d,c,[l,g]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[d,I],[l,g]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[d,V],[l,p]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[d,V],[l,g]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,c,[l,f]],[/droid.+; (shield) bui/i],[c,[d,"Nvidia"],[l,f]],[/(playstation [345portablevi]+)/i],[c,[d,k],[l,f]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[d,I],[l,f]],[/smart-tv.+(samsung)/i],[d,[l,v]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[d,M],[l,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,T],[l,v]],[/(apple) ?tv/i],[d,[c,"Apple TV"],[l,v]],[/crkey/i],[[c,"Chromecast"],[d,w],[l,v]],[/droid.+aft(\w)( bui|\))/i],[c,[d,S],[l,v]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[c,[d,L],[l,v]],[/(bravia[\w ]+)( bui|\))/i],[c,[d,k],[l,v]],[/(mitv-\w{5}) bui/i],[c,[d,x],[l,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[d,F],[c,F],[l,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,v]],[/((pebble))app/i],[d,c,[l,y]],[/droid.+; (glass) \d/i],[c,[d,w],[l,y]],[/droid.+; (wt63?0{2,3})\)/i],[c,[d,V],[l,y]],[/(quest( 2)?)/i],[c,[d,O],[l,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[l,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[c,[l,g]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[l,p]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,p]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[l,g]],[/(android[-\w\. ]{0,9});.+buil/i],[c,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[h,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[h,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[u,h],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[h,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,h],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[u,[h,U,G]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[h,U,G]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[h,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,"Mac OS"],[h,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[h,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,h],[/\(bb(10);/i],[h,[u,C]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[h,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[h,[u,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[h,[u,"webOS"]],[/crkey\/([\d\.]+)/i],[h,[u,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[u,"Chromium OS"],h],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,h],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],h],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[u,h]]},z=function(e,n){if(typeof e===o&&(n=e,e=r),!(this instanceof z))return new z(e,n).getResult();var i=e||(typeof t!==a&&t.navigator&&t.navigator.userAgent?t.navigator.userAgent:""),c=n?function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n}(B,n):B;return this.getBrowser=function(){var e,t={};return t.name=r,t.version=r,P.call(t,i,c.browser),t.major=typeof(e=t.version)===s?e.replace(/[^\d\.]/g,"").split(".")[0]:r,t},this.getCPU=function(){var e={};return e.architecture=r,P.call(e,i,c.cpu),e},this.getDevice=function(){var e={};return e.vendor=r,e.model=r,e.type=r,P.call(e,i,c.device),e},this.getEngine=function(){var e={};return e.name=r,e.version=r,P.call(e,i,c.engine),e},this.getOS=function(){var e={};return e.name=r,e.version=r,P.call(e,i,c.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(e){return i=typeof e===s&&e.length>350?F(e,350):e,this},this.setUA(i),this};z.VERSION="1.0.33",z.BROWSER=D([u,h,"major"]),z.CPU=D([m]),z.DEVICE=D([c,d,l,f,g,v,p,y,b]),z.ENGINE=z.OS=D([u,h]),e.exports&&(n=e.exports=z),n.UAParser=z;var W=typeof t!==a&&(t.jQuery||t.Zepto);if(W&&!W.ua){var Y=new z;W.ua=Y.getResult(),W.ua.get=function(){return Y.getUA()},W.ua.set=function(e){Y.setUA(e);var t=Y.getResult();for(var n in t)W.ua[n]=t[n]}}}("object"==typeof window?window:t)}(Eo,Eo.exports);var Ao,Co,wo,_o=Eo.exports;e.BrowserCompatibility=void 0,(Co=(Ao=e.BrowserCompatibility||(e.BrowserCompatibility={})).Feature||(Ao.Feature={})).BLOB="blob",Co.MEDIA_DEVICES="mediaDevices",Co.OFFSCREEN_CANVAS="offscreenCanvas",Co.HTTP_PROTOCOL="httpProtocol",Co.SECURE_CONTEXT="secureContext",Co.URL_OBJECT="urlObject",Co.WEB_WORKERS="webWorkers",Co.WEB_ASSEMBLY="webAssembly",Co.WEB_ASSEMBLY_ERROR_FREE="webAssemblyErrorFree",Co.WEBGL="webgl",e.BrowserHelper=void 0,(wo=e.BrowserHelper||(e.BrowserHelper={})).userAgentInfo=new _o(navigator.userAgent),wo.canvas=document.createElement("canvas"),wo.isDesktopDevice=function(){if("orientation"in window)return!1;var e,t,n="(any-pointer: coarse)",r=null===(e=(t=window).matchMedia)||void 0===e?void 0:e.call(t,n);return 0===navigator.maxTouchPoints||(null==r?void 0:r.media)===n&&!1===(null==r?void 0:r.matches)},wo.isIOSDeviceWithExtendedCameraAccess=function(){var e=wo.userAgentInfo.getOS();return"iOS"===e.name&&null!=e.version&&e.version.localeCompare("16.3",void 0,{numeric:!0})>=0},wo.checkBrowserCompatibility=function(){function t(e,n,r){var i=e[n[0]];return null!=i&&(1===n.length?typeof i===r:("function"==typeof i||"object"==typeof i)&&t(i,n.slice(1),r))}var n,r=!0,i=!0,a=[];location.protocol.startsWith("http")||(a.push(e.BrowserCompatibility.Feature.HTTP_PROTOCOL),r=i=!1),t(window,["isSecureContext"],"boolean")&&!1===window.isSecureContext&&a.push(e.BrowserCompatibility.Feature.SECURE_CONTEXT),t(navigator,["mediaDevices","getUserMedia"],"function")||t(navigator,["enumerateDevices"],"function")||t(window,["MediaStreamTrack","getSources"],"function")||(a.push(e.BrowserCompatibility.Feature.MEDIA_DEVICES),r=!1),t(window,["Worker"],"function")||(a.push(e.BrowserCompatibility.Feature.WEB_WORKERS),r=i=!1),t(window,["WebAssembly"],"object")||(a.push(e.BrowserCompatibility.Feature.WEB_ASSEMBLY),r=i=!1),t(window,["Blob"],"function")||(a.push(e.BrowserCompatibility.Feature.BLOB),r=i=!1),t(window,["URL","createObjectURL"],"function")||(a.push(e.BrowserCompatibility.Feature.URL_OBJECT),r=i=!1),t(window,["OffscreenCanvas"],"function")||a.push(e.BrowserCompatibility.Feature.OFFSCREEN_CANVAS);try{if(!t(window,["WebGLRenderingContext"],"function")||null==wo.canvas.getContext("webgl")&&null==wo.canvas.getContext("experimental-webgl"))throw new Error}catch(t){a.push(e.BrowserCompatibility.Feature.WEBGL)}return"iOS"===(n=wo.userAgentInfo.getOS()).name&&null!=n.version&&["11.2.2","11.2.5","11.2.6"].includes(n.version)&&(a.push(e.BrowserCompatibility.Feature.WEB_ASSEMBLY_ERROR_FREE),r=i=!1),{fullSupport:r,scannerSupport:i,missingFeatures:a}},wo.getDeviceId=function(){var e="scandit-device-id",t=localStorage.getItem(e);if(null!=t&&""!==t)return t;if(null!=(t=So.get(e))&&""!==t)return localStorage.setItem(e,t),t;var n=new Uint8Array(20);return crypto.getRandomValues(n),t=yo(n).map((function(e){var t=e.toString(16);return 1===t.length?"0".concat(t):t})).join(""),localStorage.setItem(e,t),t},wo.isValidHTMLElement=function(e){return e instanceof HTMLElement||null!=e&&"object"==typeof e&&"string"==typeof e.tagName},wo.isIPhone=function(){return"iPhone"===wo.userAgentInfo.getDevice().model};var To=h,Io=p,No=mn,Mo=[].slice,Lo={},ko=function(e,t,n){if(!(t in Lo)){for(var r=[],i=0;i<t;i++)r[i]="a["+i+"]";Lo[t]=Function("F,a","return new F("+r.join(",")+")")}return Lo[t](e,n)},xo=Function.bind||function(e){var t=To(this),n=Mo.call(arguments,1),r=function(){var i=n.concat(Mo.call(arguments));return this instanceof r?ko(t,i.length,i):No(t,i,e)};return Io(t.prototype)&&(r.prototype=t.prototype),r},Vo=W,Oo=Ue,Do=h,Ro=y,jo=p,Fo=b,Po=xo,Uo=(c.exports.Reflect||{}).construct,Go=Fo((function(){function e(){}return!(Uo((function(){}),[],e)instanceof e)})),Bo=!Fo((function(){Uo((function(){}))}));Vo(Vo.S+Vo.F*(Go||Bo),"Reflect",{construct:function(e,t){Do(e),Ro(t);var n=arguments.length<3?e:Do(arguments[2]);if(Bo&&!Go)return Uo(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return r.push.apply(r,t),new(Po.apply(e,r))}var i=n.prototype,a=Oo(jo(i)?i:Object.prototype),o=Function.apply.call(e,a,t);return jo(o)?o:a}});var zo=l.exports.Reflect.construct;function Wo(e){return Wo="function"==typeof Ra&&"symbol"==typeof ja?function(e){return typeof e}:function(e){return e&&"function"==typeof Ra&&e.constructor===Ra&&e!==Ra.prototype?"symbol":typeof e},Wo(e)}var Yo=si.f("toPrimitive");function Ho(e){var t=function(e,t){if("object"!==Wo(e)||null===e)return e;var n=e[Yo];if(void 0!==n){var r=n.call(e,"string");if("object"!==Wo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Wo(t)?t:String(t)}function Qo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Ua(e,Ho(r.key),r)}}function Zo(e,t,n){return t&&Qo(e.prototype,t),n&&Qo(e,n),Ua(e,"prototype",{writable:!1}),e}function qo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Jo(e,t){return Jo=ro?ro.bind():function(e,t){return e.__proto__=t,e},Jo(e,t)}function Ko(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Ha(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Ua(e,"prototype",{writable:!1}),t&&Jo(e,t)}function $o(e,t){if(t&&("object"===Wo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Xo(e)}function es(e){return es=ro?Ka.bind():function(e){return e.__proto__||Ka(e)},es(e)}var ts=p,ns=function(e,t){if(!ts(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e},rs=g.f,is=Ue,as=Hn,os=f,ss=Ft,cs=Pt.exports,us=bt,ls=Et,ds=Kn,hs=S,ms=Jr.exports.fastKey,fs=ns,gs=hs?"_s":"size",ps=function(e,t){var n,r=ms(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n},vs={getConstructor:function(e,t,n,r){var i=e((function(e,a){ss(e,i,t,"_i"),e._t=t,e._i=is(null),e._f=void 0,e._l=void 0,e[gs]=0,null!=a&&cs(a,n,e[r],e)}));return as(i.prototype,{clear:function(){for(var e=fs(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[gs]=0},delete:function(e){var n=fs(this,t),r=ps(n,e);if(r){var i=r.n,a=r.p;delete n._i[r.i],r.r=!0,a&&(a.n=i),i&&(i.p=a),n._f==r&&(n._f=i),n._l==r&&(n._l=a),n[gs]--}return!!r},forEach:function(e){fs(this,t);for(var n,r=os(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!ps(fs(this,t),e)}}),hs&&rs(i.prototype,"size",{get:function(){return fs(this,t)[gs]}}),i},def:function(e,t,n){var r,i,a=ps(e,t);return a?a.v=n:(e._l=a={i:i=ms(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=a),r&&(r.n=a),e[gs]++,"F"!==i&&(e._i[i]=a)),e},getEntry:ps,setStrong:function(e,t,n){us(e,t,(function(e,n){this._t=fs(e,t),this._k=n,this._l=void 0}),(function(){for(var e=this,t=e._k,n=e._l;n&&n.r;)n=n.p;return e._t&&(e._l=n=n?n.n:e._t._f)?ls(0,"keys"==t?n.k:"values"==t?n.v:[n.k,n.v]):(e._t=void 0,ls(1))}),n?"entries":"values",!n,!0),ds(t)}},ys=(Ge.exports("species"),f),bs=X,Ss=tt,Es=ne,As=c.exports,Cs=W,ws=Jr.exports,_s=b,Ts=D,Is=Hn,Ns=Pt.exports,Ms=Ft,Ls=p,ks=qe,xs=g.f,Vs=S,Os=function(e,t,n,r,i,a){var o=As[e],s=o,c=i?"set":"add",u=s&&s.prototype,l={};return Vs&&"function"==typeof s&&(a||u.forEach&&!_s((function(){(new s).entries().next()})))?(s=t((function(t,n){Ms(t,s,e,"_c"),t._c=new o,null!=n&&Ns(n,i,t[c],t)})),function(e,t,n){for(var r=Ss(e),i=bs(r),a=ys(t,n,3),o=Es(i.length),s=0;o>s;s++)s in i&&a(i[s],s,r)}("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),(function(e){var t="add"==e||"set"==e;!(e in u)||a&&"clear"==e||Ts(s.prototype,e,(function(n,r){if(Ms(this,s,e),!t&&a&&!Ls(n))return"get"==e&&void 0;var i=this._c[e](0===n?0:n,r);return t?this:i}))})),a||xs(s.prototype,"size",{get:function(){return this._c.size}})):(s=r.getConstructor(t,e,i,c),Is(s.prototype,n),ws.NEED=!0),ks(s,e),l[e]=s,Cs(Cs.G+Cs.W+Cs.F,l),a||r.setStrong(s,e,i),s},Ds=vs,Rs=ns,js="Map";Os(js,(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(e){var t=Ds.getEntry(Rs(this,js),e);return t&&t.v},set:function(e,t){return Ds.def(Rs(this,js),0===e?0:e,t)}},Ds,!0);var Fs=Pt.exports,Ps=jt,Us=function(e){return function(){if(Ps(this)!=e)throw TypeError(e+"#toJSON isn't generic");return Fs(this,!1,(t=[]).push,t,void 0),t;var t}},Gs=W;Gs(Gs.P+Gs.R,"Map",{toJSON:Us("Map")});var Bs=W,zs=function(e){Bs(Bs.S,e,{of:function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];return new this(t)}})};zs("Map");var Ws=W,Ys=h,Hs=f,Qs=Pt.exports,Zs=function(e){Ws(Ws.S,e,{from:function(e){var t,n,r,i,a=arguments[1];return Ys(this),(t=void 0!==a)&&Ys(a),null==e?new this:(n=[],t?(r=0,i=Hs(a,arguments[2],2),Qs(e,!1,(function(e){n.push(i(e,r++))}))):Qs(e,!1,n.push,n),new this(n))}})};Zs("Map");var qs=l.exports.Map;function Xs(){if("undefined"==typeof Reflect||!zo)return!1;if(zo.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(zo(Boolean,[],(function(){}))),!0}catch(e){return!1}}function Js(e,t,n){return Js=Xs()?zo.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&Jo(i,n.prototype),i},Js.apply(null,arguments)}function Ks(e){var t="function"==typeof qs?new qs:void 0;return Ks=function(e){if(null===e||!function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Js(e,arguments,es(this).constructor)}return n.prototype=Ha(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Jo(n,e)},Ks(e)}var $s=function(e){Ko(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!zo)return!1;if(zo.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(zo(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=es(t);if(n){var i=es(this).constructor;e=zo(r,arguments,i)}else e=r.apply(this,arguments);return $o(this,e)});function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.name,a=void 0===n?"":n,o=t.message,s=void 0===o?"":o;return qo(this,i),e=r.call(this,s),Object.setPrototypeOf(Xo(e),i.prototype),e.name=a,e}return Zo(i)}(Ks(Error));function ec(e,t,n){return(t=Ho(t))in e?Ua(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tc(){const e="/scandit_sync_folder_preload",t=[],n=[],r="function"==typeof self.OffscreenCanvas;let i,a,o,s,c,u,l,d,h,m,f,g,p,v,y=!1,b=!1,S=!1,E=!1,A=!1,C=!1,w=!1,_=!1,T=!1,I=Promise.resolve(),N=!1,M=!1;function L(e,t,n){function r(){postMessage(["context-created",{hiddenScanditLogoAllowed:1===Module._can_hide_logo()}])}if(T)return r();if(null!=e&&(l=e),null!=t&&(d=t),null!=n&&(h=n),!C||null==l||null==d||!b&&!l||null==h)return;const i=lengthBytesUTF8(h)+1,a=Module._malloc(i);stringToUTF8(h,a,i);const o=lengthBytesUTF8(c)+1,s=Module._malloc(o);stringToUTF8(c,s,o);const m=lengthBytesUTF8(u)+1,f=Module._malloc(m);stringToUTF8(u,f,m),Module._create_context(a,s,l,d,f,!1),Module._free(a),Module._free(s),Module._free(f),T=!0,G(),B(),r()}function k(e){if(260===e.errorCode){var t;let n;n=0===(null===(t=location.href)||void 0===t?void 0:t.indexOf("blob:null/"))?"localhost":new URL(null==location.pathname||""===location.pathname||location.pathname.startsWith("/")?location.origin:location.pathname).hostname,n.startsWith("[")&&n.endsWith("]")&&(n=n.slice(1,-1)),e.errorMessage=e.errorMessage.replace("domain name","domain name (".concat(n,")"))}[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,260].includes(e.errorCode)&&null!=h&&h.length>0&&(e.errorMessage+=" License Key: ".concat(h.slice(0,15),"..."))}function x(e){e.highQualitySingleFrameMode&&P(!0);const t=(n=e.data).byteLength!==o?JSON.stringify({barcodeResult:[],textResult:[]}):(Module.HEAPU8.set(n,a),UTF8ToString(Module._scanner_scan(a)));var n;e.highQualitySingleFrameMode&&P(!1);const r=JSON.parse(t);null!=r.error?(k(r.error),postMessage(["work-error",{requestId:e.requestId,error:r.error},e.data],[e.data.buffer])):null!=r.barcodeResult&&null!=r.textResult&&postMessage(["work-result",{requestId:e.requestId,result:{barcodes:r.barcodeResult,texts:r.textResult}},e.data],[e.data.buffer])}function V(){if(C&&0!==t.length&&(T||L(),w||P(),_||U(),T&&w&&_))for(;0!==t.length;){var e;if(t[0].highQualitySingleFrameMode&&!0===(null===(e=g)||void 0===e?void 0:e.includes("code"))&&!y)break;x(t.shift())}}function O(e){const t=function(e,t,n){const r="string"==typeof t?lengthBytesUTF8(t)+1:t.byteLength,i=Module._malloc(r);"string"==typeof t?stringToUTF8(t,i,r):Module.HEAPU8.set(t,i);const a=lengthBytesUTF8(n)+1,o=Module._malloc(a);stringToUTF8(n,o,a);const s=Module._parser_parse_string(e.valueOf(),i,r-1,o);return Module._free(i),Module._free(o),UTF8ToString(s)}(e.dataFormat,e.data,e.options),n=JSON.parse(t);null!=n.error?(k(n.error),postMessage(["parse-error",{requestId:e.requestId,error:n.error}])):null!=n.result&&postMessage(["parse-result",{requestId:e.requestId,result:n.result}])}function D(){if(C&&0!==n.length&&(T||(L(),T)))for(;0!==n.length;)O(n.shift())}function R(){w&&Module._scanner_session_clear()}function j(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];n.forEach((function(e,t){if(e instanceof Error){const r={name:e.name,message:e.message,stack:e.stack};n[t]=r}})),postMessage(["log",{level:e,data:n}])}function F(e,t,n,r){return new Promise((function(i,a){e().then(i).catch((function(o){const s=2*t;if(s>n)return a(o);r(o),setTimeout((function(){F(e,s,n,r).then(i).catch(a)}),t)}))}))}function P(){var e,t,n,i;let a=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!C||!T||!b||null==m)return;w=!1;const o=JSON.parse(m);g=o.recognitionMode,null!==(e=o.textRecognitionSettings)&&void 0!==e||(o.textRecognitionSettings=JSON.stringify({}));const s=lengthBytesUTF8(m)+1,c=Module._malloc(s);stringToUTF8(m,c,s);const u=lengthBytesUTF8(o.textRecognitionSettings)+1,l=Module._malloc(u);stringToUTF8(o.textRecognitionSettings,l,u);const d=Module._scanner_settings_new_from_json(c,l,!0===(null===(t=g)||void 0===t?void 0:t.includes("code")),!0===(null===(n=g)||void 0===n?void 0:n.includes("text")),!0===o.blurryRecognition&&y,null!==(i=o.matrixScanEnabled)&&void 0!==i&&i,a,!0===o.gpuAcceleration&&r);Module._free(c);const h=UTF8ToString(d);""!==h&&(w=!0,j("debug","External Scandit Data Capture scan settings:",JSON.parse(h)))}function U(){if(!C||!T||!b||null==f)return;let e;_=!1,e=1===f.format.valueOf()?3:2===f.format.valueOf()?4:1,Module._scanner_image_settings_new(f.width,f.height,e),null!=a&&Module._free(a),o=f.width*f.height*e,a=Module._malloc(o),_=!0}function G(){C&&T&&null!=p&&Module._report_camera_properties("front"===p.cameraType,p.autofocus)}function B(){if(!C||!T||null==v)return;const e=lengthBytesUTF8(v)+1,t=Module._malloc(e);stringToUTF8(v,t,e),Module._set_device_name(t),Module._free(t)}function z(e,t,n,r){return F((function(){return new Promise((function(i,a){fetch(e).then((function(o){o.ok?(o.clone().arrayBuffer().then((function(a){r&&i(o),function(r){var i,a;"function"==typeof(null===(i=crypto)||void 0===i||null===(a=i.subtle)||void 0===a?void 0:a.digest)?crypto.subtle.digest("SHA-256",r).then((function(r){const i=(a=r,Array.from(new Uint8Array(a)).map((function(e){const t=e.toString(16);return 1===t.length?"0".concat(t):t})).join(""));var a;let o="9381f51f2e47730a322fda5ae18fc4b27da5b35477c78b440f762a19e65c2567";t&&(o=n?"f66f36ada4369d161a55dd0efcfb1dc290b907f2a3ea3588b86d489cf9e79873":"900b975dc7c0e8973dac38464fd7f7bfac8e5543693bc0ed0dfd8e0e2bd09272"),i!==o&&j("error","The Scandit Data Capture library WASM file found at ".concat(e," seems invalid: ")+"expected file hash doesn't match (received: ".concat(i,", ")+"expected: ".concat(o,"). ")+"Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.")})).catch((function(){})):j("warn","Insecure context (see https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts): "+"The hash of the Scandit Data Capture library WASM file found at ".concat(e," could not be verified"))}(a)})).catch((function(e){r&&a(e)})),r||i(o)):a(new Error("HTTP status code is not ok"))})).catch((function(e){a(e)}))}))}),250,4e3,(function(t){j("warn",t),j("warn","Couldn't retrieve Scandit Data Capture library at ".concat(e,", retrying..."))})).catch((function(t){return j("error",t),j("error","Couldn't retrieve/instantiate Scandit Data Capture library at ".concat(e,", ")+"did you configure the path for it correctly?"),Promise.reject(t)}))}function W(e,t,n,r,i,a){(null!=a?Promise.resolve(a):z(t,n,r,!0)).then((function(e){return e.arrayBuffer()})).then((function(n){return self.WebAssembly.instantiate(n,e).then((function(e){i(e.instance)})).catch((function(e){j("error",e),j("error","Couldn't instantiate Scandit Data Capture library at ".concat(t,", ")+"did you configure the path for it correctly?")}))})).catch((function(){}))}function Y(t,n){return null==i?Promise.resolve():(N=!0,new Promise((function(r,a){(!s&&t?function(){const t="FILE_DATA";let n,r,i,a;function o(){var e,t,o,s;clearTimeout(a),null===(e=r)||void 0===e||null===(t=e.result)||void 0===t||t.close(),null===(o=i)||void 0===o||null===(s=o.result)||void 0===s||s.close(),n(0)}return new Promise((function(s){n=s,r=indexedDB.open(e),r.onupgradeneeded=function(){try{r.result.createObjectStore(t)}catch(e){}},r.onsuccess=function(){if(!Array.from(r.result.objectStoreNames).includes(t))return s(0);i=indexedDB.open(c),i.onupgradeneeded=function(){try{i.result.createObjectStore(t)}catch(e){}},i.onsuccess=function(){!function(){try{const s=[],u=r.result.transaction(t,"readonly");u.onerror=u.onabort=o;const l=u.objectStore(t).openCursor();l.onsuccess=function(){const u=l.result;if(null==u)try{let e=0;const c=i.result.transaction(t,"readwrite"),u=c.objectStore(t);c.onerror=c.onabort=o,c.oncomplete=function(){return clearTimeout(a),r.result.close(),i.result.close(),n(e)};for(const t of s){const n=u.count(t.primaryKey);n.onsuccess=function(){0===n.result&&(++e,u.add(t.value,t.primaryKey))},clearTimeout(a),a=self.setTimeout((function(){j("warn","IndexedDB database is blocked! Resetting Scandit Data Capture library..."),postMessage(["reset"])}),500)}}catch(e){o.call({error:e})}else s.push({value:u.value,primaryKey:u.primaryKey.toString().replace("".concat(e,"/"),"".concat(c,"/"))}),u.continue()},l.onerror=o}catch(e){o.call({error:e})}}()},i.onblocked=i.onerror=o},r.onblocked=r.onerror=o}))}():Promise.resolve(0)).then((function(e){if(!s&&t&&!n&&0===e)return N=!1,r();i(t,(function(e){if(N=!1,null!=e)return a(e);r()}))})).catch(a)})))}function H(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return M&&!n||(N?(M=!0,I=I.then((function(){return M=!1,Y(e,t)}))):I=Y(e,t)),I}return{loadLibrary:function(t,n,a,o,l,h,m,f,g,p){function v(){postMessage(["library-loaded"]),L(l,h,f)}function y(){!C&&E&&A&&(S=!1,Module.callMain(),C=!0,v(),l||(V(),D()))}if(S)return Promise.resolve();if(C)return v(),Promise.resolve();S=!0;const b=WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,1,253,15,253,98,11])),w=function(e,t,n){let r=!1;/^https?:\/\/([^\/.]*\.)*cdn.jsdelivr.net\//.test(e)?(e="https://cdn.jsdelivr.net/npm/scandit-sdk@5.15.0/build/",r=!0):/^https?:\/\/([^\/.]*\.)*unpkg.com\//.test(e)&&(e="https://unpkg.com/scandit-sdk@5.15.0/build/",r=!0);let i="";return t&&(i+="-ocr",n&&(i+="-simd")),r?{jsURI:"".concat(e,"scandit-engine-sdk").concat(i,".min.js"),wasmURI:"".concat(e,"scandit-engine-sdk").concat(i,".wasm")}:{jsURI:"".concat(e,"scandit-engine-sdk").concat(i,".min.js?v=5.15.0"),wasmURI:"".concat(e,"scandit-engine-sdk").concat(i,".wasm?v=5.15.0")}}(n,m,b),_=w.jsURI,T=w.wasmURI;return s=o,o?c=e:null!=p?(j("debug","IndexedDB database name override in use to recover from blocked standard database: ".concat(p)),c=p):c="/scandit_sync_folder",u="".concat(n).concat("resources","/"),d=h,self.window=self.document=self,self.path=a,self.deviceModelName=g,Module={arguments:[t],canvas:r?new self.OffscreenCanvas(32,32):{getContext:function(){return null}},instantiateWasm:function(e,t){var n;const r=null!==(n=self.wasmJSVersion)&&void 0!==n?n:"undefined";return"5.15.0"!==r&&j("error","The Scandit Data Capture library JS file found at ".concat(_," seems invalid: ")+"expected version doesn't match (received: ".concat(r,", expected: ","5.15.0","). ")+"Please ensure the correct Scandit Data Capture file (with correct version) is retrieved."),"function"==typeof self.WebAssembly.instantiateStreaming?function(e,t,n,r,i){z(t,n,r,!1).then((function(a){self.WebAssembly.instantiateStreaming(a,e).then((function(e){i(e.instance)})).catch((function(o){j("warn",o),j("warn","WebAssembly streaming compile failed. Falling back to ArrayBuffer instantiation (this will make things slower)"),W(e,t,n,r,i,a)}))})).catch((function(){}))}(e,T,m,b,t):W(e,T,m,b,t),{}},noInitialRun:!0,preRun:[function(){return function(){i=FS.syncfs,FS.syncfs=function(e,t){const n=t;t=function(e){n(e)},H(e).then(t).catch(t)};try{FS.mkdir(c)}catch(e){if("EEXIST"!==e.code)return i=void 0,Promise.reject(e)}return FS.mount(IDBFS,{},c),H(!0,!0)}().catch((function(e){j("debug","No IndexedDB support, some data will not be persisted:",e)})).then((function(){E=!0,y()}))}],onRuntimeInitialized:function(){A=!0,y()},print:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];j("info",...t)},printErr:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];j("error",...t)}},F((function(){try{var e;return null!==(e=importScripts(_))&&void 0!==e?e:Promise.resolve()}catch(e){return Promise.reject(e)}}),250,4e3,(function(e){j("warn",e),j("warn","Couldn't retrieve Scandit Data Capture library at ".concat(_,", retrying..."))})).catch((function(e){return j("error",e),j("error","Couldn't retrieve Scandit Data Capture library at ".concat(_,", did you configure the path for it correctly?")),Promise.resolve(e)}))},setScanSettings:function(e,t,n){function r(){m=e,y=t,P(),V()}m=void 0,w=!1,t&&n?H(!0,!1,!0).then(r).catch(r):r()},setImageSettings:function(e){f=e,U(),V()},workOnScanQueue:V,workOnParseQueue:D,addScanWorkUnit:function(e){b=!0,t.push(e),V()},addParseWorkUnit:function(e){b=!0,n.push(e),D()},clearSession:R,setCameraProperties:function(e,t){p={cameraType:e,autofocus:t},G()},setDeviceName:function(e){v!==e&&(v=e,B())},reset:function(){R(),t.length=0,n.length=0,m=void 0,f=void 0,b=!1,w=!1,_=!1}}}const nc=new Blob(["var Module;".concat(tc.toString(),"(").concat(function(){const e=tc();onmessage=function(t){const n=t.data;switch(n.type){case"load-library":e.loadLibrary(n.deviceId,n.libraryLocation,n.path,n.preload,n.delayedRegistration,n.highEndBlurryRecognition,n.textRecognition,n.licenseKey,n.deviceModelName,n.writableDataPathOverride);break;case"scan-settings":e.setScanSettings(n.settings,n.blurryRecognitionAvailable,n.blurryRecognitionRequiresUpdate);break;case"image-settings":e.setImageSettings(n.imageSettings);break;case"scan-image":e.addScanWorkUnit({requestId:n.requestId,data:n.data,highQualitySingleFrameMode:n.highQualitySingleFrameMode});break;case"parse":e.addParseWorkUnit({requestId:n.requestId,dataFormat:n.dataFormat,data:n.data,options:n.options});break;case"clear-session":e.clearSession();break;case"camera-properties":e.setCameraProperties(n.cameraType,n.autofocus);break;case"device-name":e.setDeviceName(n.deviceName);break;case"reset":e.reset()}}}.toString(),")()")],{type:"text/javascript"});var rc=function(){function t(e){qo(this,t),ec(this,"preloadedDataCaptureWorker",void 0),ec(this,"preloadedDataCaptureWorkerAvailable",void 0),e&&(this.preloadedDataCaptureWorker=new Worker(URL.createObjectURL(nc)),t.load(this.preloadedDataCaptureWorker)),this.preloadedDataCaptureWorkerAvailable=e}return Zo(t,[{key:"getDataCaptureWorker",value:function(){return this.preloadedDataCaptureWorkerAvailable&&null!=this.preloadedDataCaptureWorker?(this.preloadedDataCaptureWorkerAvailable=!1,this.preloadedDataCaptureWorker):new Worker(URL.createObjectURL(nc))}},{key:"returnDataCaptureWorker",value:function(e){null==this.preloadedDataCaptureWorker&&(this.preloadedDataCaptureWorker=e),this.preloadedDataCaptureWorker===e?(this.preloadedDataCaptureWorker.onmessage=null,this.preloadedDataCaptureWorker.postMessage({type:"reset"}),this.preloadedDataCaptureWorkerAvailable=!0):e.terminate()}}],[{key:"load",value:function(t){var n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t.postMessage({type:"load-library",deviceId:Sd,libraryLocation:e.scanditDataCaptureLocation,path:window.location.pathname,preload:r,delayedRegistration:i,highEndBlurryRecognition:e.highEndBlurryRecognition,textRecognition:e.textRecognition,licenseKey:e.userLicenseKey,deviceModelName:e.BrowserHelper.userAgentInfo.getDevice().model,writableDataPathOverride:null!==(n=localStorage.getItem("scanditWritableDataPathOverride"))&&void 0!==n?n:void 0})}}]),t}();e.Logger=void 0,function(e){var t;!function(e){e.DEBUG="debug",e.INFO="info",e.WARN="warn",e.ERROR="error",e.QUIET="quiet"}(t=e.Level||(e.Level={}));var n=new qs([[t.DEBUG,1],[t.INFO,2],[t.WARN,3],[t.ERROR,4],[t.QUIET,5]]),r=t.DEBUG;e.setLevel=function(e){r=e},e.log=function(e){var i,a,o,s;if(!(n.get(r)>n.get(e))){for(var c=arguments.length,u=new Array(c>1?c-1:0),l=1;l<c;l++)u[l-1]=arguments[l];switch(e){case t.DEBUG:(i=console).debug.apply(i,u);break;case t.INFO:(a=console).log.apply(a,u);break;case t.WARN:(o=console).warn.apply(o,u);break;case t.ERROR:(s=console).error.apply(s,u)}}}}(e.Logger||(e.Logger={}));var ic=function(e){Ko(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!zo)return!1;if(zo.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(zo(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=es(t);if(n){var i=es(this).constructor;e=zo(r,arguments,i)}else e=r.apply(this,arguments);return $o(this,e)});function i(e){var t;return qo(this,i),ec(Xo(t=r.call(this,{name:"UnsupportedBrowserError",message:"This OS / browser has one or more missing features preventing it from working correctly (".concat(e.missingFeatures.join(", "),")")})),"data",void 0),t.data=e,t}return Zo(i)}($s),ac=function(e){if("undefined"==typeof window)return;const t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}('.scandit.scandit-container{align-items:center;display:flex;height:100%;justify-content:center;overflow:hidden;width:100%}.scandit.scandit-container:before{animation:scandit-rotation 1s linear infinite;background-color:#fff;content:" ";height:1px;left:0;opacity:0;pointer-events:none;position:absolute;top:0;width:1px}.scandit.scandit-barcode-picker{background-color:#000;height:100%;min-height:1px;min-width:1px;position:relative;width:100%}.scandit .scandit-video{display:block;height:100%;position:relative;width:100%}.scandit .scandit-video.mirrored{transform:scaleX(-1)}.scandit .scandit-logo{bottom:5%;max-height:12.5%;max-width:35%;right:5%;z-index:20}.scandit .scandit-laser,.scandit .scandit-logo{pointer-events:none;position:absolute;transform:translateZ(0)}.scandit .scandit-laser{align-items:center;box-sizing:border-box;display:flex;top:-9999px;z-index:10}.scandit .scandit-laser img{max-height:47px;width:100%}.scandit .scandit-laser img,.scandit .scandit-viewfinder{animation-duration:.25s;position:absolute;transition:opacity .25s ease}.scandit .scandit-viewfinder{border:2px solid #fff;border-radius:10px;box-sizing:border-box;pointer-events:none;top:-9999px;transform:translateZ(0);z-index:10}.scandit .scandit-viewfinder.paused{opacity:.4}.scandit .scandit-camera-fov-switcher,.scandit .scandit-camera-switcher,.scandit .scandit-torch-toggle{-webkit-tap-highlight-color:rgba(255,255,255,0);cursor:pointer;filter:drop-shadow(0 2px 0 #808080);max-height:15%;max-width:15%;position:absolute;transform:translateZ(0);z-index:10}.scandit .scandit-camera-switcher{left:5%;top:5%}.scandit .scandit-camera-fov-switcher{bottom:5%;filter:unset;height:100px;left:5%;width:100px}.scandit .scandit-camera-fov-switcher img{max-height:100%;max-width:100%}.scandit .scandit-torch-toggle{right:5%;top:5%}.scandit .scandit-camera-recovery{background-color:#000;color:#fff;cursor:pointer;position:absolute;top:0;transform:translateZ(0);z-index:15}.scandit .scandit-camera-recovery,.scandit .scandit-camera-upload{align-items:center;display:flex;height:100%;justify-content:center;width:100%}.scandit .scandit-camera-upload{-webkit-tap-highlight-color:rgba(255,255,255,0);flex-direction:column;z-index:5}.scandit .scandit-camera-upload label{align-items:center;border-radius:50%;cursor:pointer;display:flex;flex-direction:column;height:180px;justify-content:center;margin-top:18px;width:180px}.scandit .scandit-camera-upload label input[type=file]{position:absolute;top:-9999px}.scandit .radial-progress{animation-duration:.25s;background-color:transparent;border-radius:50%;border-style:solid;border-width:3px;box-sizing:border-box;height:180px;position:absolute;transition:opacity 1s ease,border-color .5s;width:180px}.scandit .radial-progress[data-progress="0"]{opacity:.2}.scandit .radial-progress[data-progress="5"]{opacity:.24}.scandit .radial-progress[data-progress="10"]{opacity:.28}.scandit .radial-progress[data-progress="15"]{opacity:.32}.scandit .radial-progress[data-progress="20"]{opacity:.36}.scandit .radial-progress[data-progress="25"]{opacity:.4}.scandit .radial-progress[data-progress="30"]{opacity:.44}.scandit .radial-progress[data-progress="35"]{opacity:.48}.scandit .radial-progress[data-progress="40"]{opacity:.52}.scandit .radial-progress[data-progress="45"]{opacity:.56}.scandit .radial-progress[data-progress="50"]{opacity:.6}.scandit .radial-progress[data-progress="55"]{opacity:.64}.scandit .radial-progress[data-progress="60"]{opacity:.68}.scandit .radial-progress[data-progress="65"]{opacity:.72}.scandit .radial-progress[data-progress="70"]{opacity:.76}.scandit .radial-progress[data-progress="75"]{opacity:.8}.scandit .radial-progress[data-progress="80"]{opacity:.84}.scandit .radial-progress[data-progress="85"]{opacity:.88}.scandit .radial-progress[data-progress="90"]{opacity:.92}.scandit .radial-progress[data-progress="95"]{opacity:.96}.scandit .radial-progress[data-progress="100"]{opacity:1}.scandit .scandit-flash-color{animation-name:scandit-flash-color}.scandit .scandit-flash-white{animation-name:scandit-flash-white}.scandit .scandit-flash-inset{animation-name:scandit-flash-inset}.scandit .scandit-opacity-pulse{animation-delay:0s,.333s;animation-duration:.333s,1s;animation-iteration-count:1,infinite;animation-name:scandit-opacity-pulse-before,scandit-opacity-pulse;animation-timing-function:cubic-bezier(.645,.045,.355,1),cubic-bezier(.645,.045,.355,1)}.scandit .scandit-hidden-opacity{opacity:0}.scandit-hidden{display:none!important}@keyframes scandit-rotation{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes scandit-flash-color{0%{filter:none}50%{filter:drop-shadow(0 0 .75rem #fff) drop-shadow(0 0 2.5rem #7ed9e2)}to{filter:none}}@keyframes scandit-flash-white{0%{filter:none}50%{filter:drop-shadow(0 0 .5rem #fff) drop-shadow(0 0 1rem #fff) drop-shadow(0 0 2.5rem #fff)}to{filter:none}}@keyframes scandit-flash-inset{0%{box-shadow:none}50%{box-shadow:inset 0 0 .5rem,inset 0 0 1rem,inset 0 0 2.5rem}to{box-shadow:none}}@keyframes scandit-opacity-pulse-before{0%{opacity:1}to{opacity:.4}}@keyframes scandit-opacity-pulse{0%{opacity:.4}50%{opacity:.6}to{opacity:.4}}'),oc={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,r,a,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,a||e,o),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,o=new Array(a);i<a;i++)o[i]=r[i].fn;return o},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,a,o){var s=n?n+e:e;if(!this._events[s])return!1;var c,u,l=this._events[s],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,i),!0;case 5:return l.fn.call(l.context,t,r,i,a),!0;case 6:return l.fn.call(l.context,t,r,i,a,o),!0}for(u=1,c=new Array(d-1);u<d;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var h,m=l.length;for(u=0;u<m;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),d){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,r);break;case 4:l[u].fn.call(l[u].context,t,r,i);break;default:if(!c)for(h=1,c=new Array(d-1);h<d;h++)c[h-1]=arguments[h];l[u].fn.apply(l[u].context,c)}}return!0},s.prototype.on=function(e,t,n){return a(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return a(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var a=n?n+e:e;if(!this._events[a])return this;if(!t)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==t||i&&!s.once||r&&s.context!==r||o(this,a);else{for(var c=0,u=[],l=s.length;c<l;c++)(s[c].fn!==t||i&&!s[c].once||r&&s[c].context!==r)&&u.push(s[c]);u.length?this._events[a]=1===u.length?u[0]:u:o(this,a)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&o(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s}(oc);var sc,cc,uc=oc.exports,lc={};!function(e){!function(){var n=function(){this.init()};n.prototype={init:function(){var e=this||r;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var t=this||r;if(e=parseFloat(e),t.ctx||d(),void 0!==e&&e>=0&&e<=1){if(t._volume=e,t._muted)return t;t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e,r.ctx.currentTime);for(var n=0;n<t._howls.length;n++)if(!t._howls[n]._webAudio)for(var i=t._howls[n]._getSoundIds(),a=0;a<i.length;a++){var o=t._howls[n]._soundById(i[a]);o&&o._node&&(o._node.volume=o._volume*e)}return t}return t._volume},mute:function(e){var t=this||r;t.ctx||d(),t._muted=e,t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e?0:t._volume,r.ctx.currentTime);for(var n=0;n<t._howls.length;n++)if(!t._howls[n]._webAudio)for(var i=t._howls[n]._getSoundIds(),a=0;a<i.length;a++){var o=t._howls[n]._soundById(i[a]);o&&o._node&&(o._node.muted=!!e||o._muted)}return t},stop:function(){for(var e=this||r,t=0;t<e._howls.length;t++)e._howls[t].stop();return e},unload:function(){for(var e=this||r,t=e._howls.length-1;t>=0;t--)e._howls[t].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,d()),e},codecs:function(e){return(this||r)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||r;if(e.state=e.ctx&&e.ctx.state||"suspended",e._autoSuspend(),!e.usingWebAudio)if("undefined"!=typeof Audio)try{void 0===(new Audio).oncanplaythrough&&(e._canPlayEvent="canplay")}catch(t){e.noAudio=!0}else e.noAudio=!0;try{(new Audio).muted&&(e.noAudio=!0)}catch(e){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||r,t=null;try{t="undefined"!=typeof Audio?new Audio:null}catch(t){return e}if(!t||"function"!=typeof t.canPlayType)return e;var n=t.canPlayType("audio/mpeg;").replace(/^no$/,""),i=e._navigator?e._navigator.userAgent:"",a=i.match(/OPR\/([0-6].)/g),o=a&&parseInt(a[0].split("/")[1],10)<33,s=-1!==i.indexOf("Safari")&&-1===i.indexOf("Chrome"),c=i.match(/Version\/(.*?) /),u=s&&c&&parseInt(c[1],10)<15;return e._codecs={mp3:!(o||!n&&!t.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!n,opus:!!t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(t.canPlayType('audio/wav; codecs="1"')||t.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!t.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!t.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/m4a;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(t.canPlayType("audio/x-m4b;")||t.canPlayType("audio/m4b;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(t.canPlayType("audio/x-mp4;")||t.canPlayType("audio/mp4;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(u||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(u||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!t.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(t.canPlayType("audio/x-flac;")||t.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||r;if(!e._audioUnlocked&&e.ctx){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var t=function(n){for(;e._html5AudioPool.length<e.html5PoolSize;)try{var r=new Audio;r._unlocked=!0,e._releaseHtml5Audio(r)}catch(n){e.noAudio=!0;break}for(var i=0;i<e._howls.length;i++)if(!e._howls[i]._webAudio)for(var a=e._howls[i]._getSoundIds(),o=0;o<a.length;o++){var s=e._howls[i]._soundById(a[o]);s&&s._node&&!s._node._unlocked&&(s._node._unlocked=!0,s._node.load())}e._autoResume();var c=e.ctx.createBufferSource();c.buffer=e._scratchBuffer,c.connect(e.ctx.destination),void 0===c.start?c.noteOn(0):c.start(0),"function"==typeof e.ctx.resume&&e.ctx.resume(),c.onended=function(){c.disconnect(0),e._audioUnlocked=!0,document.removeEventListener("touchstart",t,!0),document.removeEventListener("touchend",t,!0),document.removeEventListener("click",t,!0),document.removeEventListener("keydown",t,!0);for(var n=0;n<e._howls.length;n++)e._howls[n]._emit("unlock")}};return document.addEventListener("touchstart",t,!0),document.addEventListener("touchend",t,!0),document.addEventListener("click",t,!0),document.addEventListener("keydown",t,!0),e}},_obtainHtml5Audio:function(){var e=this||r;if(e._html5AudioPool.length)return e._html5AudioPool.pop();var t=(new Audio).play();return t&&"undefined"!=typeof Promise&&(t instanceof Promise||"function"==typeof t.then)&&t.catch((function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")})),new Audio},_releaseHtml5Audio:function(e){var t=this||r;return e._unlocked&&t._html5AudioPool.push(e),t},_autoSuspend:function(){var e=this;if(e.autoSuspend&&e.ctx&&void 0!==e.ctx.suspend&&r.usingWebAudio){for(var t=0;t<e._howls.length;t++)if(e._howls[t]._webAudio)for(var n=0;n<e._howls[t]._sounds.length;n++)if(!e._howls[t]._sounds[n]._paused)return e;return e._suspendTimer&&clearTimeout(e._suspendTimer),e._suspendTimer=setTimeout((function(){if(e.autoSuspend){e._suspendTimer=null,e.state="suspending";var t=function(){e.state="suspended",e._resumeAfterSuspend&&(delete e._resumeAfterSuspend,e._autoResume())};e.ctx.suspend().then(t,t)}}),3e4),e}},_autoResume:function(){var e=this;if(e.ctx&&void 0!==e.ctx.resume&&r.usingWebAudio)return"running"===e.state&&"interrupted"!==e.ctx.state&&e._suspendTimer?(clearTimeout(e._suspendTimer),e._suspendTimer=null):"suspended"===e.state||"running"===e.state&&"interrupted"===e.ctx.state?(e.ctx.resume().then((function(){e.state="running";for(var t=0;t<e._howls.length;t++)e._howls[t]._emit("resume")})),e._suspendTimer&&(clearTimeout(e._suspendTimer),e._suspendTimer=null)):"suspending"===e.state&&(e._resumeAfterSuspend=!0),e}};var r=new n,i=function(e){e.src&&0!==e.src.length?this.init(e):console.error("An array of source files must be passed with any new Howl.")};i.prototype={init:function(e){var t=this;return r.ctx||d(),t._autoplay=e.autoplay||!1,t._format="string"!=typeof e.format?e.format:[e.format],t._html5=e.html5||!1,t._muted=e.mute||!1,t._loop=e.loop||!1,t._pool=e.pool||5,t._preload="boolean"!=typeof e.preload&&"metadata"!==e.preload||e.preload,t._rate=e.rate||1,t._sprite=e.sprite||{},t._src="string"!=typeof e.src?e.src:[e.src],t._volume=void 0!==e.volume?e.volume:1,t._xhr={method:e.xhr&&e.xhr.method?e.xhr.method:"GET",headers:e.xhr&&e.xhr.headers?e.xhr.headers:null,withCredentials:!(!e.xhr||!e.xhr.withCredentials)&&e.xhr.withCredentials},t._duration=0,t._state="unloaded",t._sounds=[],t._endTimers={},t._queue=[],t._playLock=!1,t._onend=e.onend?[{fn:e.onend}]:[],t._onfade=e.onfade?[{fn:e.onfade}]:[],t._onload=e.onload?[{fn:e.onload}]:[],t._onloaderror=e.onloaderror?[{fn:e.onloaderror}]:[],t._onplayerror=e.onplayerror?[{fn:e.onplayerror}]:[],t._onpause=e.onpause?[{fn:e.onpause}]:[],t._onplay=e.onplay?[{fn:e.onplay}]:[],t._onstop=e.onstop?[{fn:e.onstop}]:[],t._onmute=e.onmute?[{fn:e.onmute}]:[],t._onvolume=e.onvolume?[{fn:e.onvolume}]:[],t._onrate=e.onrate?[{fn:e.onrate}]:[],t._onseek=e.onseek?[{fn:e.onseek}]:[],t._onunlock=e.onunlock?[{fn:e.onunlock}]:[],t._onresume=[],t._webAudio=r.usingWebAudio&&!t._html5,void 0!==r.ctx&&r.ctx&&r.autoUnlock&&r._unlockAudio(),r._howls.push(t),t._autoplay&&t._queue.push({event:"play",action:function(){t.play()}}),t._preload&&"none"!==t._preload&&t.load(),t},load:function(){var e=this,t=null;if(!r.noAudio){"string"==typeof e._src&&(e._src=[e._src]);for(var n=0;n<e._src.length;n++){var i,o;if(e._format&&e._format[n])i=e._format[n];else{if("string"!=typeof(o=e._src[n])){e._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}(i=/^data:audio\/([^;,]+);/i.exec(o))||(i=/\.([^.]+)$/.exec(o.split("?",1)[0])),i&&(i=i[1].toLowerCase())}if(i||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),i&&r.codecs(i)){t=e._src[n];break}}return t?(e._src=t,e._state="loading","https:"===window.location.protocol&&"http:"===t.slice(0,5)&&(e._html5=!0,e._webAudio=!1),new a(e),e._webAudio&&s(e),e):void e._emit("loaderror",null,"No codec support for selected audio sources.")}e._emit("loaderror",null,"No audio support.")},play:function(e,t){var n=this,i=null;if("number"==typeof e)i=e,e=null;else{if("string"==typeof e&&"loaded"===n._state&&!n._sprite[e])return null;if(void 0===e&&(e="__default",!n._playLock)){for(var a=0,o=0;o<n._sounds.length;o++)n._sounds[o]._paused&&!n._sounds[o]._ended&&(a++,i=n._sounds[o]._id);1===a?e=null:i=null}}var s=i?n._soundById(i):n._inactiveSound();if(!s)return null;if(i&&!e&&(e=s._sprite||"__default"),"loaded"!==n._state){s._sprite=e,s._ended=!1;var c=s._id;return n._queue.push({event:"play",action:function(){n.play(c)}}),c}if(i&&!s._paused)return t||n._loadQueue("play"),s._id;n._webAudio&&r._autoResume();var u=Math.max(0,s._seek>0?s._seek:n._sprite[e][0]/1e3),l=Math.max(0,(n._sprite[e][0]+n._sprite[e][1])/1e3-u),d=1e3*l/Math.abs(s._rate),h=n._sprite[e][0]/1e3,m=(n._sprite[e][0]+n._sprite[e][1])/1e3;s._sprite=e,s._ended=!1;var f=function(){s._paused=!1,s._seek=u,s._start=h,s._stop=m,s._loop=!(!s._loop&&!n._sprite[e][2])};if(!(u>=m)){var g=s._node;if(n._webAudio){var p=function(){n._playLock=!1,f(),n._refreshBuffer(s);var e=s._muted||n._muted?0:s._volume;g.gain.setValueAtTime(e,r.ctx.currentTime),s._playStart=r.ctx.currentTime,void 0===g.bufferSource.start?s._loop?g.bufferSource.noteGrainOn(0,u,86400):g.bufferSource.noteGrainOn(0,u,l):s._loop?g.bufferSource.start(0,u,86400):g.bufferSource.start(0,u,l),d!==1/0&&(n._endTimers[s._id]=setTimeout(n._ended.bind(n,s),d)),t||setTimeout((function(){n._emit("play",s._id),n._loadQueue()}),0)};"running"===r.state&&"interrupted"!==r.ctx.state?p():(n._playLock=!0,n.once("resume",p),n._clearTimer(s._id))}else{var v=function(){g.currentTime=u,g.muted=s._muted||n._muted||r._muted||g.muted,g.volume=s._volume*r.volume(),g.playbackRate=s._rate;try{var i=g.play();if(i&&"undefined"!=typeof Promise&&(i instanceof Promise||"function"==typeof i.then)?(n._playLock=!0,f(),i.then((function(){n._playLock=!1,g._unlocked=!0,t?n._loadQueue():n._emit("play",s._id)})).catch((function(){n._playLock=!1,n._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),s._ended=!0,s._paused=!0}))):t||(n._playLock=!1,f(),n._emit("play",s._id)),g.playbackRate=s._rate,g.paused)return void n._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||s._loop?n._endTimers[s._id]=setTimeout(n._ended.bind(n,s),d):(n._endTimers[s._id]=function(){n._ended(s),g.removeEventListener("ended",n._endTimers[s._id],!1)},g.addEventListener("ended",n._endTimers[s._id],!1))}catch(e){n._emit("playerror",s._id,e)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===g.src&&(g.src=n._src,g.load());var y=window&&window.ejecta||!g.readyState&&r._navigator.isCocoonJS;if(g.readyState>=3||y)v();else{n._playLock=!0,n._state="loading";var b=function(){n._state="loaded",v(),g.removeEventListener(r._canPlayEvent,b,!1)};g.addEventListener(r._canPlayEvent,b,!1),n._clearTimer(s._id)}}return s._id}n._ended(s)},pause:function(e){var t=this;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"pause",action:function(){t.pause(e)}}),t;for(var n=t._getSoundIds(e),r=0;r<n.length;r++){t._clearTimer(n[r]);var i=t._soundById(n[r]);if(i&&!i._paused&&(i._seek=t.seek(n[r]),i._rateSeek=0,i._paused=!0,t._stopFade(n[r]),i._node))if(t._webAudio){if(!i._node.bufferSource)continue;void 0===i._node.bufferSource.stop?i._node.bufferSource.noteOff(0):i._node.bufferSource.stop(0),t._cleanBuffer(i._node)}else isNaN(i._node.duration)&&i._node.duration!==1/0||i._node.pause();arguments[1]||t._emit("pause",i?i._id:null)}return t},stop:function(e,t){var n=this;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"stop",action:function(){n.stop(e)}}),n;for(var r=n._getSoundIds(e),i=0;i<r.length;i++){n._clearTimer(r[i]);var a=n._soundById(r[i]);a&&(a._seek=a._start||0,a._rateSeek=0,a._paused=!0,a._ended=!0,n._stopFade(r[i]),a._node&&(n._webAudio?a._node.bufferSource&&(void 0===a._node.bufferSource.stop?a._node.bufferSource.noteOff(0):a._node.bufferSource.stop(0),n._cleanBuffer(a._node)):isNaN(a._node.duration)&&a._node.duration!==1/0||(a._node.currentTime=a._start||0,a._node.pause(),a._node.duration===1/0&&n._clearSound(a._node))),t||n._emit("stop",a._id))}return n},mute:function(e,t){var n=this;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"mute",action:function(){n.mute(e,t)}}),n;if(void 0===t){if("boolean"!=typeof e)return n._muted;n._muted=e}for(var i=n._getSoundIds(t),a=0;a<i.length;a++){var o=n._soundById(i[a]);o&&(o._muted=e,o._interval&&n._stopFade(o._id),n._webAudio&&o._node?o._node.gain.setValueAtTime(e?0:o._volume,r.ctx.currentTime):o._node&&(o._node.muted=!!r._muted||e),n._emit("mute",o._id))}return n},volume:function(){var e,t,n,i=this,a=arguments;if(0===a.length)return i._volume;if(1===a.length||2===a.length&&void 0===a[1]?i._getSoundIds().indexOf(a[0])>=0?t=parseInt(a[0],10):e=parseFloat(a[0]):a.length>=2&&(e=parseFloat(a[0]),t=parseInt(a[1],10)),!(void 0!==e&&e>=0&&e<=1))return(n=t?i._soundById(t):i._sounds[0])?n._volume:0;if("loaded"!==i._state||i._playLock)return i._queue.push({event:"volume",action:function(){i.volume.apply(i,a)}}),i;void 0===t&&(i._volume=e),t=i._getSoundIds(t);for(var o=0;o<t.length;o++)(n=i._soundById(t[o]))&&(n._volume=e,a[2]||i._stopFade(t[o]),i._webAudio&&n._node&&!n._muted?n._node.gain.setValueAtTime(e,r.ctx.currentTime):n._node&&!n._muted&&(n._node.volume=e*r.volume()),i._emit("volume",n._id));return i},fade:function(e,t,n,i){var a=this;if("loaded"!==a._state||a._playLock)return a._queue.push({event:"fade",action:function(){a.fade(e,t,n,i)}}),a;e=Math.min(Math.max(0,parseFloat(e)),1),t=Math.min(Math.max(0,parseFloat(t)),1),n=parseFloat(n),a.volume(e,i);for(var o=a._getSoundIds(i),s=0;s<o.length;s++){var c=a._soundById(o[s]);if(c){if(i||a._stopFade(o[s]),a._webAudio&&!c._muted){var u=r.ctx.currentTime,l=u+n/1e3;c._volume=e,c._node.gain.setValueAtTime(e,u),c._node.gain.linearRampToValueAtTime(t,l)}a._startFadeInterval(c,e,t,n,o[s],void 0===i)}}return a},_startFadeInterval:function(e,t,n,r,i,a){var o=this,s=t,c=n-t,u=Math.abs(c/.01),l=Math.max(4,u>0?r/u:r),d=Date.now();e._fadeTo=n,e._interval=setInterval((function(){var i=(Date.now()-d)/r;d=Date.now(),s+=c*i,s=Math.round(100*s)/100,s=c<0?Math.max(n,s):Math.min(n,s),o._webAudio?e._volume=s:o.volume(s,e._id,!0),a&&(o._volume=s),(n<t&&s<=n||n>t&&s>=n)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,o.volume(n,e._id),o._emit("fade",e._id))}),l)},_stopFade:function(e){var t=this,n=t._soundById(e);return n&&n._interval&&(t._webAudio&&n._node.gain.cancelScheduledValues(r.ctx.currentTime),clearInterval(n._interval),n._interval=null,t.volume(n._fadeTo,e),n._fadeTo=null,t._emit("fade",e)),t},loop:function(){var e,t,n,r=this,i=arguments;if(0===i.length)return r._loop;if(1===i.length){if("boolean"!=typeof i[0])return!!(n=r._soundById(parseInt(i[0],10)))&&n._loop;e=i[0],r._loop=e}else 2===i.length&&(e=i[0],t=parseInt(i[1],10));for(var a=r._getSoundIds(t),o=0;o<a.length;o++)(n=r._soundById(a[o]))&&(n._loop=e,r._webAudio&&n._node&&n._node.bufferSource&&(n._node.bufferSource.loop=e,e&&(n._node.bufferSource.loopStart=n._start||0,n._node.bufferSource.loopEnd=n._stop,r.playing(a[o])&&(r.pause(a[o],!0),r.play(a[o],!0)))));return r},rate:function(){var e,t,n,i=this,a=arguments;if(0===a.length)t=i._sounds[0]._id;else if(1===a.length){var o=i._getSoundIds(),s=o.indexOf(a[0]);s>=0?t=parseInt(a[0],10):e=parseFloat(a[0])}else 2===a.length&&(e=parseFloat(a[0]),t=parseInt(a[1],10));if("number"!=typeof e)return(n=i._soundById(t))?n._rate:i._rate;if("loaded"!==i._state||i._playLock)return i._queue.push({event:"rate",action:function(){i.rate.apply(i,a)}}),i;void 0===t&&(i._rate=e),t=i._getSoundIds(t);for(var c=0;c<t.length;c++)if(n=i._soundById(t[c])){i.playing(t[c])&&(n._rateSeek=i.seek(t[c]),n._playStart=i._webAudio?r.ctx.currentTime:n._playStart),n._rate=e,i._webAudio&&n._node&&n._node.bufferSource?n._node.bufferSource.playbackRate.setValueAtTime(e,r.ctx.currentTime):n._node&&(n._node.playbackRate=e);var u=i.seek(t[c]),l=(i._sprite[n._sprite][0]+i._sprite[n._sprite][1])/1e3-u,d=1e3*l/Math.abs(n._rate);!i._endTimers[t[c]]&&n._paused||(i._clearTimer(t[c]),i._endTimers[t[c]]=setTimeout(i._ended.bind(i,n),d)),i._emit("rate",n._id)}return i},seek:function(){var e,t,n=this,i=arguments;if(0===i.length)n._sounds.length&&(t=n._sounds[0]._id);else if(1===i.length){var a=n._getSoundIds(),o=a.indexOf(i[0]);o>=0?t=parseInt(i[0],10):n._sounds.length&&(t=n._sounds[0]._id,e=parseFloat(i[0]))}else 2===i.length&&(e=parseFloat(i[0]),t=parseInt(i[1],10));if(void 0===t)return 0;if("number"==typeof e&&("loaded"!==n._state||n._playLock))return n._queue.push({event:"seek",action:function(){n.seek.apply(n,i)}}),n;var s=n._soundById(t);if(s){if(!("number"==typeof e&&e>=0)){if(n._webAudio){var c=n.playing(t)?r.ctx.currentTime-s._playStart:0,u=s._rateSeek?s._rateSeek-s._seek:0;return s._seek+(u+c*Math.abs(s._rate))}return s._node.currentTime}var l=n.playing(t);l&&n.pause(t,!0),s._seek=e,s._ended=!1,n._clearTimer(t),n._webAudio||!s._node||isNaN(s._node.duration)||(s._node.currentTime=e);var d=function(){l&&n.play(t,!0),n._emit("seek",t)};if(l&&!n._webAudio){var h=function(){n._playLock?setTimeout(h,0):d()};setTimeout(h,0)}else d()}return n},playing:function(e){var t=this;if("number"==typeof e){var n=t._soundById(e);return!!n&&!n._paused}for(var r=0;r<t._sounds.length;r++)if(!t._sounds[r]._paused)return!0;return!1},duration:function(e){var t=this,n=t._duration,r=t._soundById(e);return r&&(n=t._sprite[r._sprite][1]/1e3),n},state:function(){return this._state},unload:function(){for(var e=this,t=e._sounds,n=0;n<t.length;n++)t[n]._paused||e.stop(t[n]._id),e._webAudio||(e._clearSound(t[n]._node),t[n]._node.removeEventListener("error",t[n]._errorFn,!1),t[n]._node.removeEventListener(r._canPlayEvent,t[n]._loadFn,!1),t[n]._node.removeEventListener("ended",t[n]._endFn,!1),r._releaseHtml5Audio(t[n]._node)),delete t[n]._node,e._clearTimer(t[n]._id);var i=r._howls.indexOf(e);i>=0&&r._howls.splice(i,1);var a=!0;for(n=0;n<r._howls.length;n++)if(r._howls[n]._src===e._src||e._src.indexOf(r._howls[n]._src)>=0){a=!1;break}return o&&a&&delete o[e._src],r.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,t,n,r){var i=this["_on"+e];return"function"==typeof t&&i.push(r?{id:n,fn:t,once:r}:{id:n,fn:t}),this},off:function(e,t,n){var r=this,i=r["_on"+e],a=0;if("number"==typeof t&&(n=t,t=null),t||n)for(a=0;a<i.length;a++){var o=n===i[a].id;if(t===i[a].fn&&o||!t&&o){i.splice(a,1);break}}else if(e)r["_on"+e]=[];else{var s=Object.keys(r);for(a=0;a<s.length;a++)0===s[a].indexOf("_on")&&Array.isArray(r[s[a]])&&(r[s[a]]=[])}return r},once:function(e,t,n){return this.on(e,t,n,1),this},_emit:function(e,t,n){for(var r=this,i=r["_on"+e],a=i.length-1;a>=0;a--)i[a].id&&i[a].id!==t&&"load"!==e||(setTimeout(function(e){e.call(this,t,n)}.bind(r,i[a].fn),0),i[a].once&&r.off(e,i[a].fn,i[a].id));return r._loadQueue(e),r},_loadQueue:function(e){var t=this;if(t._queue.length>0){var n=t._queue[0];n.event===e&&(t._queue.shift(),t._loadQueue()),e||n.action()}return t},_ended:function(e){var t=this,n=e._sprite;if(!t._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime<e._stop)return setTimeout(t._ended.bind(t,e),100),t;var i=!(!e._loop&&!t._sprite[n][2]);if(t._emit("end",e._id),!t._webAudio&&i&&t.stop(e._id,!0).play(e._id),t._webAudio&&i){t._emit("play",e._id),e._seek=e._start||0,e._rateSeek=0,e._playStart=r.ctx.currentTime;var a=1e3*(e._stop-e._start)/Math.abs(e._rate);t._endTimers[e._id]=setTimeout(t._ended.bind(t,e),a)}return t._webAudio&&!i&&(e._paused=!0,e._ended=!0,e._seek=e._start||0,e._rateSeek=0,t._clearTimer(e._id),t._cleanBuffer(e._node),r._autoSuspend()),t._webAudio||i||t.stop(e._id,!0),t},_clearTimer:function(e){var t=this;if(t._endTimers[e]){if("function"!=typeof t._endTimers[e])clearTimeout(t._endTimers[e]);else{var n=t._soundById(e);n&&n._node&&n._node.removeEventListener("ended",t._endTimers[e],!1)}delete t._endTimers[e]}return t},_soundById:function(e){for(var t=this,n=0;n<t._sounds.length;n++)if(e===t._sounds[n]._id)return t._sounds[n];return null},_inactiveSound:function(){var e=this;e._drain();for(var t=0;t<e._sounds.length;t++)if(e._sounds[t]._ended)return e._sounds[t].reset();return new a(e)},_drain:function(){var e=this,t=e._pool,n=0,r=0;if(!(e._sounds.length<t)){for(r=0;r<e._sounds.length;r++)e._sounds[r]._ended&&n++;for(r=e._sounds.length-1;r>=0;r--){if(n<=t)return;e._sounds[r]._ended&&(e._webAudio&&e._sounds[r]._node&&e._sounds[r]._node.disconnect(0),e._sounds.splice(r,1),n--)}}},_getSoundIds:function(e){if(void 0===e){for(var t=[],n=0;n<this._sounds.length;n++)t.push(this._sounds[n]._id);return t}return[e]},_refreshBuffer:function(e){return e._node.bufferSource=r.ctx.createBufferSource(),e._node.bufferSource.buffer=o[this._src],e._panner?e._node.bufferSource.connect(e._panner):e._node.bufferSource.connect(e._node),e._node.bufferSource.loop=e._loop,e._loop&&(e._node.bufferSource.loopStart=e._start||0,e._node.bufferSource.loopEnd=e._stop||0),e._node.bufferSource.playbackRate.setValueAtTime(e._rate,r.ctx.currentTime),this},_cleanBuffer:function(e){var t=r._navigator&&r._navigator.vendor.indexOf("Apple")>=0;if(r._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),t))try{e.bufferSource.buffer=r._scratchBuffer}catch(e){}return e.bufferSource=null,this},_clearSound:function(e){/MSIE |Trident\//.test(r._navigator&&r._navigator.userAgent)||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var a=function(e){this._parent=e,this.init()};a.prototype={init:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++r._counter,t._sounds.push(e),e.create(),e},create:function(){var e=this,t=e._parent,n=r._muted||e._muted||e._parent._muted?0:e._volume;return t._webAudio?(e._node=void 0===r.ctx.createGain?r.ctx.createGainNode():r.ctx.createGain(),e._node.gain.setValueAtTime(n,r.ctx.currentTime),e._node.paused=!0,e._node.connect(r.masterGain)):r.noAudio||(e._node=r._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(r._canPlayEvent,e._loadFn,!1),e._endFn=e._endListener.bind(e),e._node.addEventListener("ended",e._endFn,!1),e._node.src=t._src,e._node.preload=!0===t._preload?"auto":t._preload,e._node.volume=n*r.volume(),e._node.load()),e},reset:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++r._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,!1)},_loadListener:function(){var e=this,t=e._parent;t._duration=Math.ceil(10*e._node.duration)/10,0===Object.keys(t._sprite).length&&(t._sprite={__default:[0,1e3*t._duration]}),"loaded"!==t._state&&(t._state="loaded",t._emit("load"),t._loadQueue()),e._node.removeEventListener(r._canPlayEvent,e._loadFn,!1)},_endListener:function(){var e=this,t=e._parent;t._duration===1/0&&(t._duration=Math.ceil(10*e._node.duration)/10,t._sprite.__default[1]===1/0&&(t._sprite.__default[1]=1e3*t._duration),t._ended(e)),e._node.removeEventListener("ended",e._endFn,!1)}};var o={},s=function(e){var t=e._src;if(o[t])return e._duration=o[t].duration,void l(e);if(/^data:[^;]+;base64,/.test(t)){for(var n=atob(t.split(",")[1]),r=new Uint8Array(n.length),i=0;i<n.length;++i)r[i]=n.charCodeAt(i);u(r.buffer,e)}else{var a=new XMLHttpRequest;a.open(e._xhr.method,t,!0),a.withCredentials=e._xhr.withCredentials,a.responseType="arraybuffer",e._xhr.headers&&Object.keys(e._xhr.headers).forEach((function(t){a.setRequestHeader(t,e._xhr.headers[t])})),a.onload=function(){var t=(a.status+"")[0];"0"===t||"2"===t||"3"===t?u(a.response,e):e._emit("loaderror",null,"Failed loading audio file with status: "+a.status+".")},a.onerror=function(){e._webAudio&&(e._html5=!0,e._webAudio=!1,e._sounds=[],delete o[t],e.load())},c(a)}},c=function(e){try{e.send()}catch(t){e.onerror()}},u=function(e,t){var n=function(){t._emit("loaderror",null,"Decoding audio data failed.")},i=function(e){e&&t._sounds.length>0?(o[t._src]=e,l(t,e)):n()};"undefined"!=typeof Promise&&1===r.ctx.decodeAudioData.length?r.ctx.decodeAudioData(e).then(i).catch(n):r.ctx.decodeAudioData(e,i,n)},l=function(e,t){t&&!e._duration&&(e._duration=t.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},d=function(){if(r.usingWebAudio){try{"undefined"!=typeof AudioContext?r.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?r.ctx=new webkitAudioContext:r.usingWebAudio=!1}catch(e){r.usingWebAudio=!1}r.ctx||(r.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(r._navigator&&r._navigator.platform),t=r._navigator&&r._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),n=t?parseInt(t[1],10):null;if(e&&n&&n<9){var i=/safari/.test(r._navigator&&r._navigator.userAgent.toLowerCase());r._navigator&&!i&&(r.usingWebAudio=!1)}r.usingWebAudio&&(r.masterGain=void 0===r.ctx.createGain?r.ctx.createGainNode():r.ctx.createGain(),r.masterGain.gain.setValueAtTime(r._muted?0:r._volume,r.ctx.currentTime),r.masterGain.connect(r.ctx.destination)),r._setup()}};e.Howler=r,e.Howl=i,void 0!==t?(t.HowlerGlobal=n,t.Howler=r,t.Howl=i,t.Sound=a):"undefined"!=typeof window&&(window.HowlerGlobal=n,window.Howler=r,window.Howl=i,window.Sound=a)}()}(lc),e.Camera=void 0,(cc=(sc=e.Camera||(e.Camera={})).Type||(sc.Type={})).FRONT="front",cc.BACK="back",W(W.S,"Array",{isArray:yi});var dc=l.exports.Array.isArray;function hc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function mc(e){return function(e){if(dc(e))return hc(e)}(e)||function(e){if(void 0!==Ra&&null!=e[ja]||null!=e["@@iterator"])return yo(e)}(e)||function(e,t){if(e){if("string"==typeof e)return hc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?yo(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hc(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var fc,gc,pc,vc,yc=l.exports,bc=yc.JSON||(yc.JSON={stringify:JSON.stringify}),Sc=function(e){return bc.stringify.apply(bc,arguments)};e.ImageSettings=void 0,(gc=(fc=e.ImageSettings||(e.ImageSettings={})).Format||(fc.Format={}))[gc.GRAY_8U=0]="GRAY_8U",gc[gc.RGB_8U=1]="RGB_8U",gc[gc.RGBA_8U=2]="RGBA_8U",e.Parser=function(){function e(t,n){qo(this,e),ec(this,"scanner",void 0),ec(this,"dataFormat",void 0),ec(this,"options",void 0),this.scanner=t,this.dataFormat=n}return Zo(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"parseRawData",value:function(e){return this.scanner.parse(this.dataFormat,e,this.options)}},{key:"parseString",value:function(e){return this.scanner.parse(this.dataFormat,e,this.options)}}]),e}(),(vc=(pc=e.Parser||(e.Parser={})).DataFormat||(pc.DataFormat={}))[vc.GS1_AI=1]="GS1_AI",vc[vc.HIBC=2]="HIBC",vc[vc.DLID=3]="DLID",vc[vc.MRTD=4]="MRTD",vc[vc.SWISSQR=5]="SWISSQR",vc[vc.VIN=6]="VIN",vc[vc.US_USID=7]="US_USID";var Ec=vs,Ac=ns;Os("Set",(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(e){return Ec.def(Ac(this,"Set"),e=0===e?0:e,e)}},Ec);var Cc=W;Cc(Cc.P+Cc.R,"Set",{toJSON:Us("Set")}),zs("Set"),Zs("Set");var wc,_c,Tc,Ic=l.exports.Set;e.Barcode=void 0,(wc=e.Barcode||(e.Barcode={})).createFromWASMResult=function(e){var t;try{t=decodeURIComponent(escape(String.fromCharCode.apply(null,e.rawData)))}catch(e){t=""}return{symbology:e.symbology,data:t,rawData:new Uint8Array(e.rawData),location:{topLeft:{x:e.location[0][0],y:e.location[0][1]},topRight:{x:e.location[1][0],y:e.location[1][1]},bottomRight:{x:e.location[2][0],y:e.location[2][1]},bottomLeft:{x:e.location[3][0],y:e.location[3][1]}},compositeFlag:e.compositeFlag,isGs1DataCarrier:e.isGs1DataCarrier,encodingArray:e.encodingArray}},(_c=wc.Symbology||(wc.Symbology={})).AZTEC="aztec",_c.CODABAR="codabar",_c.CODE11="code11",_c.CODE128="code128",_c.CODE25="code25",_c.CODE32="code32",_c.CODE39="code39",_c.CODE93="code93",_c.DATA_MATRIX="data-matrix",_c.DOTCODE="dotcode",_c.EAN13="ean13",_c.EAN8="ean8",_c.FIVE_DIGIT_ADD_ON="five-digit-add-on",_c.GS1_DATABAR="databar",_c.GS1_DATABAR_EXPANDED="databar-expanded",_c.GS1_DATABAR_LIMITED="databar-limited",_c.IATA_2_OF_5="iata2of5",_c.INTERLEAVED_2_OF_5="itf",_c.KIX="kix",_c.LAPA4SC="lapa4sc",_c.MATRIX_2_OF_5="matrix2of5",_c.MAXICODE="maxicode",_c.MICRO_PDF417="micropdf417",_c.MICRO_QR="microqr",_c.MSI_PLESSEY="msi-plessey",_c.PDF417="pdf417",_c.QR="qr",_c.RM4SCC="rm4scc",_c.TWO_DIGIT_ADD_ON="two-digit-add-on",_c.UPCA="upca",_c.UPCE="upce",_c.USPS_INTELLIGENT_MAIL="usps-intelligent-mail",(Tc=wc.CompositeFlag||(wc.CompositeFlag={}))[Tc.NONE=0]="NONE",Tc[Tc.UNKNOWN=1]="UNKNOWN",Tc[Tc.LINKED=2]="LINKED",Tc[Tc.GS1_A=4]="GS1_A",Tc[Tc.GS1_B=8]="GS1_B",Tc[Tc.GS1_C=16]="GS1_C",function(e){var t=new qs([[e.AZTEC,"Aztec"],[e.CODABAR,"Codabar"],[e.CODE11,"Code 11"],[e.CODE128,"Code 128"],[e.CODE25,"Code 25"],[e.CODE32,"Code 32"],[e.CODE39,"Code 39"],[e.CODE93,"Code 93"],[e.DATA_MATRIX,"Data Matrix"],[e.DOTCODE,"DotCode"],[e.EAN13,"EAN-13"],[e.EAN8,"EAN-8"],[e.FIVE_DIGIT_ADD_ON,"Five-Digit Add-On"],[e.GS1_DATABAR_EXPANDED,"GS1 DataBar Expanded"],[e.GS1_DATABAR_LIMITED,"GS1 DataBar Limited"],[e.GS1_DATABAR,"GS1 DataBar 14"],[e.IATA_2_OF_5,"IATA 2 of 5"],[e.INTERLEAVED_2_OF_5,"Interleaved 2 of 5"],[e.KIX,"KIX"],[e.LAPA4SC,"LAPA4SC"],[e.MATRIX_2_OF_5,"Matrix 2 of 5"],[e.MAXICODE,"MaxiCode"],[e.MICRO_PDF417,"MicroPDF417"],[e.MICRO_QR,"Micro QR"],[e.MSI_PLESSEY,"MSI-Plessey"],[e.PDF417,"PDF417"],[e.QR,"QR"],[e.RM4SCC,"RM4SCC"],[e.TWO_DIGIT_ADD_ON,"Two-Digit Add-On"],[e.UPCA,"UPC-A"],[e.UPCE,"UPC-E"],[e.USPS_INTELLIGENT_MAIL,"USPS Intelligent Mail"]]),n=new qs([[e.AZTEC,"aztec"],[e.CODABAR,"codabar"],[e.CODE11,"code11"],[e.CODE128,"code128"],[e.CODE25,"code25"],[e.CODE32,"code32"],[e.CODE39,"code39"],[e.CODE93,"code93"],[e.DATA_MATRIX,"data-matrix"],[e.DOTCODE,"dotcode"],[e.EAN13,"ean13"],[e.EAN8,"ean8"],[e.FIVE_DIGIT_ADD_ON,"five-digit-add-on"],[e.GS1_DATABAR_EXPANDED,"databar-expanded"],[e.GS1_DATABAR_LIMITED,"databar-limited"],[e.GS1_DATABAR,"databar"],[e.IATA_2_OF_5,"iata2of5"],[e.INTERLEAVED_2_OF_5,"itf"],[e.KIX,"kix"],[e.LAPA4SC,"lapa4sc"],[e.MATRIX_2_OF_5,"matrix2of5"],[e.MAXICODE,"maxicode"],[e.MICRO_PDF417,"micropdf417"],[e.MICRO_QR,"microqr"],[e.MSI_PLESSEY,"msi-plessey"],[e.PDF417,"pdf417"],[e.QR,"qr"],[e.RM4SCC,"rm4scc"],[e.TWO_DIGIT_ADD_ON,"two-digit-add-on"],[e.UPCA,"upca"],[e.UPCE,"upce"],[e.USPS_INTELLIGENT_MAIL,"usps-intelligent-mail"]]);e.toHumanizedName=function(e){var n;return null!==(n=t.get(e.toLowerCase()))&&void 0!==n?n:"Unknown"},e.toJSONName=function(e){var t;return null!==(t=n.get(e.toLowerCase()))&&void 0!==t?t:"unknown"}}(wc.Symbology||(wc.Symbology={})),e.RecognizedText=void 0,(e.RecognizedText||(e.RecognizedText={})).createFromWASMResult=function(e){return{location:{topLeft:{x:e.location[0][0],y:e.location[0][1]},topRight:{x:e.location[1][0],y:e.location[1][1]},bottomRight:{x:e.location[2][0],y:e.location[2][1]},bottomLeft:{x:e.location[3][0],y:e.location[3][1]}},value:e.value}};var Nc=function(){function t(n,r,i,a){var o=this;qo(this,t),ec(this,"barcodes",void 0),ec(this,"texts",void 0),ec(this,"imageData",void 0),ec(this,"imageSettings",void 0),ec(this,"rejectedCodes",void 0),ec(this,"rejectedTexts",void 0),this.barcodes=[],n.forEach((function(t){o.barcodes.push(e.Barcode.createFromWASMResult(t))})),this.texts=[],r.forEach((function(t){o.texts.push(e.RecognizedText.createFromWASMResult(t))})),this.imageData=i,this.imageSettings=a,this.rejectedCodes=new Ic,this.rejectedTexts=new Ic}return Zo(t,[{key:"rejectCode",value:function(e){this.rejectedCodes.add(e)}},{key:"rejectText",value:function(e){this.rejectedTexts.add(e)}}]),t}(),Mc=S,Lc=Ie,kc=$,xc=mi.f,Vc=function(e){for(var t,n=kc(e),r=Lc(n),i=r.length,a=0,o=[];i>a;)t=r[a++],Mc&&!xc.call(n,t)||o.push(n[t]);return o};W(W.S,"Object",{values:function(e){return Vc(e)}});var Oc=l.exports.Object.values;e.SymbologySettings=function(){function e(t){var n,r,i,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];qo(this,e),ec(this,"symbology",void 0),ec(this,"enabled",void 0),ec(this,"colorInvertedEnabled",void 0),ec(this,"activeSymbolCounts",void 0),ec(this,"extensions",void 0),ec(this,"checksums",void 0),this.symbology=t,this.enabled=a,this.colorInvertedEnabled=!1,this.activeSymbolCounts=null!==(n=e.defaultActiveSymbolCounts[t])&&void 0!==n?n:[],this.extensions=new Ic(null!==(r=e.defaultExtensions[t])&&void 0!==r?r:[]),this.checksums=new Ic(null!==(i=e.defaultChecksums[t])&&void 0!==i?i:[])}return Zo(e,[{key:"isEnabled",value:function(){return this.enabled}},{key:"setEnabled",value:function(e){return this.enabled=e,this}},{key:"isColorInvertedEnabled",value:function(){return this.colorInvertedEnabled}},{key:"setColorInvertedEnabled",value:function(e){return this.colorInvertedEnabled=e,this}},{key:"getActiveSymbolCounts",value:function(){return this.activeSymbolCounts}},{key:"setActiveSymbolCounts",value:function(t){var n;return this.activeSymbolCounts=t,0===this.activeSymbolCounts.length&&(this.activeSymbolCounts=null!==(n=e.defaultActiveSymbolCounts[this.symbology])&&void 0!==n?n:[]),this}},{key:"setActiveSymbolCountsRange",value:function(t,n){var r;return this.activeSymbolCounts=e.getNumberRange(t,n),0===this.activeSymbolCounts.length&&(this.activeSymbolCounts=null!==(r=e.defaultActiveSymbolCounts[this.symbology])&&void 0!==r?r:[]),this}},{key:"getEnabledExtensions",value:function(){return this.extensions}},{key:"enableExtensions",value:function(e){var t=this;return"object"==typeof e?this.extensions=new Ic([].concat(mc(this.extensions),mc(yo(e).filter((function(e){return t.isValidExtension(e)}))))):this.isValidExtension(e)&&this.extensions.add(e),this}},{key:"disableExtensions",value:function(e){return"object"==typeof e?this.extensions=new Ic(mc(this.extensions).filter((function(t){return e instanceof Array?!e.includes(t):!e.has(t)}))):this.isValidExtension(e)&&this.extensions.delete(e),this}},{key:"getEnabledChecksums",value:function(){return this.checksums}},{key:"enableChecksums",value:function(e){var t=this;return"object"==typeof e?this.checksums=new Ic([].concat(mc(this.checksums),mc(yo(e).filter((function(e){return t.isValidChecksum(e)}))))):this.isValidChecksum(e)&&this.checksums.add(e),this}},{key:"disableChecksums",value:function(e){return"object"==typeof e?this.checksums=new Ic(mc(this.checksums).filter((function(t){return e instanceof Array?!e.includes(t):!e.has(t)}))):this.isValidChecksum(e)&&this.checksums.delete(e),this}},{key:"toJSON",value:function(){return{enabled:this.enabled,colorInvertedEnabled:this.colorInvertedEnabled,activeSymbolCounts:0===this.activeSymbolCounts.length?void 0:this.activeSymbolCounts,extensions:yo(this.extensions),checksums:yo(this.checksums)}}},{key:"isValidExtension",value:function(t){return t in e.Extension||Oc(e.Extension).includes(t.toLowerCase())}},{key:"isValidChecksum",value:function(t){return t in e.Checksum||Oc(e.Checksum).includes(t.toLowerCase())}}]),e}(),function(t){function n(e,t){return yo({length:t-e+1},(function(t,n){return n+e}))}var r,i;t.getNumberRange=n,function(e){e.DIRECT_PART_MARKING_MODE="direct_part_marking_mode",e.FULL_ASCII="full_ascii",e.RELAXED_SHARP_QUIET_ZONE_CHECK="relaxed_sharp_quiet_zone_check",e.REMOVE_LEADING_ZERO="remove_leading_zero",e.REMOVE_LEADING_UPCA_ZERO="remove_leading_upca_zero",e.RETURN_AS_UPCA="return_as_upca",e.STRICT="strict",e.STRIP_LEADING_FNC1="strip_leading_fnc1",e.DEBUG_CONTROL_CHARACTERS="debug_control_characters",e.GUESS_ENCODING="guess_encoding",e.MIRRORED="mirrored",e.NO_BLURRY_DECODING="no_blurry_decoding",e.USE_UTF8_AS_DEFAULT_ENCODING="use_utf8_as_default_encoding"}(r=t.Extension||(t.Extension={})),function(e){e.MOD_10="mod10",e.MOD_11="mod11",e.MOD_16="mod16",e.MOD_43="mod43",e.MOD_47="mod47",e.MOD_103="mod103",e.MOD_1010="mod1010",e.MOD_1110="mod1110"}(i=t.Checksum||(t.Checksum={})),t.defaultActiveSymbolCounts={[e.Barcode.Symbology.CODABAR]:n(7,20),[e.Barcode.Symbology.CODE11]:n(7,20),[e.Barcode.Symbology.CODE128]:n(6,40),[e.Barcode.Symbology.CODE25]:n(7,20),[e.Barcode.Symbology.CODE32]:[8],[e.Barcode.Symbology.CODE39]:n(6,40),[e.Barcode.Symbology.CODE93]:n(6,40),[e.Barcode.Symbology.EAN13]:[12],[e.Barcode.Symbology.EAN8]:[8],[e.Barcode.Symbology.FIVE_DIGIT_ADD_ON]:[5],[e.Barcode.Symbology.GS1_DATABAR_EXPANDED]:n(1,11),[e.Barcode.Symbology.GS1_DATABAR_LIMITED]:[1],[e.Barcode.Symbology.GS1_DATABAR]:[2],[e.Barcode.Symbology.IATA_2_OF_5]:n(7,20),[e.Barcode.Symbology.INTERLEAVED_2_OF_5]:n(6,40),[e.Barcode.Symbology.KIX]:n(7,24),[e.Barcode.Symbology.LAPA4SC]:[16],[e.Barcode.Symbology.MSI_PLESSEY]:n(6,32),[e.Barcode.Symbology.RM4SCC]:n(7,24),[e.Barcode.Symbology.TWO_DIGIT_ADD_ON]:[2],[e.Barcode.Symbology.UPCA]:[12],[e.Barcode.Symbology.UPCE]:[6]},t.defaultExtensions={[e.Barcode.Symbology.CODE128]:[r.STRIP_LEADING_FNC1],[e.Barcode.Symbology.DATA_MATRIX]:[r.STRIP_LEADING_FNC1]},t.defaultChecksums={[e.Barcode.Symbology.MSI_PLESSEY]:[i.MOD_10],[e.Barcode.Symbology.CODE11]:[i.MOD_11]}}(e.SymbologySettings||(e.SymbologySettings={}));var Dc,Rc,jc,Fc=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.recognizer,r=void 0===n?"mrzFullScreen":n,i=t.regex,a=t.characterWhitelist,o=t.textDuplicateFilter,s=void 0===o?0:o;qo(this,e),ec(this,"properties",void 0),ec(this,"recognizer",void 0),ec(this,"regex",void 0),ec(this,"characterWhitelist",void 0),ec(this,"textDuplicateFilter",void 0),this.recognizer=r,this.regex=i instanceof RegExp?i.source:i,this.characterWhitelist=a,this.textDuplicateFilter=s,this.properties=new qs}return Zo(e,[{key:"toJSONString",value:function(){var e={};return this.properties.forEach((function(t,n){e[n]=t})),Sc({recognizer:this.recognizer,regex:this.regex,characterWhitelist:this.characterWhitelist,duplicateFilter:this.textDuplicateFilter,properties:e})}},{key:"getRegex",value:function(){return this.regex}},{key:"setRegex",value:function(e){return this.regex=e instanceof RegExp?e.source:e,this}},{key:"getCharacterWhitelist",value:function(){return this.characterWhitelist}},{key:"setCharacterWhitelist",value:function(e){return this.characterWhitelist=e,this}},{key:"getTextDuplicateFilter",value:function(){return this.textDuplicateFilter}},{key:"setTextDuplicateFilter",value:function(e){return this.textDuplicateFilter=e,this}},{key:"getProperty",value:function(e){return this.properties.has(e)?this.properties.get(e):-1}},{key:"setProperty",value:function(e,t){return this.properties.set(e,t),this}}]),e}();function Pc(e,t){var n=void 0!==Ra&&e[ja]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Uc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?yo(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Uc(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Uc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}e.ScanSettings=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.textRecognitionSettings,r=void 0===n?new Fc:n,i=e.recognitionMode,a=void 0===i?t.RecognitionMode.CODE:i,o=e.enabledSymbologies,s=void 0===o?[]:o,c=e.codeDuplicateFilter,u=void 0===c?0:c,l=e.maxNumberOfCodesPerFrame,d=void 0===l?1:l,h=e.searchArea,m=void 0===h?{x:0,y:0,width:1,height:1}:h,f=e.gpuAcceleration,g=void 0===f||f,p=e.blurryRecognition,v=void 0===p||p,y=e.codeDirectionHint,b=void 0===y?t.CodeDirection.LEFT_TO_RIGHT:y,S=e.deviceName;qo(this,t),ec(this,"symbologySettings",void 0),ec(this,"properties",void 0),ec(this,"textRecognitionSettings",void 0),ec(this,"recognitionMode",void 0),ec(this,"codeDuplicateFilter",void 0),ec(this,"maxNumberOfCodesPerFrame",void 0),ec(this,"baseSearchArea",void 0),ec(this,"searchArea",void 0),ec(this,"gpuAcceleration",void 0),ec(this,"blurryRecognition",void 0),ec(this,"codeDirectionHint",void 0),ec(this,"deviceName",void 0),this.symbologySettings=new qs,this.textRecognitionSettings=r,this.setRecognitionMode(a),this.enableSymbologies(s),this.codeDuplicateFilter=u,this.maxNumberOfCodesPerFrame=d,this.baseSearchArea={x:0,y:0,width:1,height:1},this.searchArea=m,this.gpuAcceleration=g,this.blurryRecognition=v,this.codeDirectionHint=b,this.deviceName=S,this.properties=new qs([["advanced_localization",0]])}return Zo(t,[{key:"toJSONString",value:function(){var t={};this.symbologySettings.forEach((function(n,r){t[e.Barcode.Symbology.toJSONName(r)]=n}));var n={};this.properties.forEach((function(e,t){n[t]=e}));var r={x:Math.max(0,Math.min(1,this.baseSearchArea.x+this.searchArea.x*this.baseSearchArea.width)),y:Math.max(0,Math.min(1,this.baseSearchArea.y+this.searchArea.y*this.baseSearchArea.height)),width:Math.max(0,Math.min(1,this.baseSearchArea.width*this.searchArea.width)),height:Math.max(0,Math.min(1,this.baseSearchArea.height*this.searchArea.height))},i=0===Math.round(100*r.x)&&0===Math.round(100*r.y)&&100===Math.round(100*r.width)&&100===Math.round(100*r.height);return Sc({textRecognitionSettings:this.textRecognitionSettings.toJSONString(),recognitionMode:this.recognitionMode,symbologies:t,codeDuplicateFilter:this.codeDuplicateFilter,maxNumberOfCodesPerFrame:this.maxNumberOfCodesPerFrame,searchArea:r,codeLocation1d:i?void 0:{area:{x:r.x,y:r.y+.75*r.height/2,width:r.width,height:.25*r.height}},codeLocation2d:i?void 0:{area:r},gpuAcceleration:this.gpuAcceleration,blurryRecognition:this.blurryRecognition,codeDirectionHint:this.codeDirectionHint,properties:n})}},{key:"getTextRecognitionSettings",value:function(){return this.textRecognitionSettings}},{key:"setTextRecognitionSettings",value:function(e){return this.textRecognitionSettings=e,this}},{key:"getRecognitionMode",value:function(){return this.recognitionMode}},{key:"setRecognitionMode",value:function(t){return this.recognitionMode=t,t.includes("text")&&!e.textRecognition&&e.Logger.log(e.Logger.Level.WARN,"The library has not been configured to load text recognition (ScanditSDK.configure() - loadTextRecognition option): ScanSettings' recognition mode for text will be ignored"),this}},{key:"getSymbologySettings",value:function(t){if(this.symbologySettings.has(t))return this.symbologySettings.get(t);if(t in e.Barcode.Symbology||Oc(e.Barcode.Symbology).includes(t))return this.symbologySettings.set(t,new e.SymbologySettings(t)),this.symbologySettings.get(t);throw new TypeError('Invalid symbology "'.concat(t,'"'))}},{key:"isSymbologyEnabled",value:function(e){return this.symbologySettings.has(e)&&this.symbologySettings.get(e).isEnabled()}},{key:"enableSymbologies",value:function(e){return this.setSymbologiesEnabled(e,!0)}},{key:"disableSymbologies",value:function(e){return this.setSymbologiesEnabled(e,!1)}},{key:"getCodeDuplicateFilter",value:function(){return this.codeDuplicateFilter}},{key:"setCodeDuplicateFilter",value:function(e){return this.codeDuplicateFilter=e,this}},{key:"getMaxNumberOfCodesPerFrame",value:function(){return this.maxNumberOfCodesPerFrame}},{key:"setMaxNumberOfCodesPerFrame",value:function(e){return this.maxNumberOfCodesPerFrame=e,this}},{key:"getSearchArea",value:function(){return this.searchArea}},{key:"setSearchArea",value:function(e){return this.searchArea=e,this}},{key:"getBaseSearchArea",value:function(){return this.baseSearchArea}},{key:"setBaseSearchArea",value:function(e){return this.baseSearchArea=e,this}},{key:"isGpuAccelerationEnabled",value:function(){return this.gpuAcceleration}},{key:"setGpuAccelerationEnabled",value:function(e){return this.gpuAcceleration=e,this}},{key:"isBlurryRecognitionEnabled",value:function(){return this.blurryRecognition}},{key:"setBlurryRecognitionEnabled",value:function(e){return this.blurryRecognition=e,this}},{key:"getCodeDirectionHint",value:function(){return this.codeDirectionHint}},{key:"setCodeDirectionHint",value:function(e){return this.codeDirectionHint=e,this}},{key:"getDeviceName",value:function(){return this.deviceName}},{key:"setDeviceName",value:function(e){return this.deviceName=e,this}},{key:"getProperty",value:function(e){return this.properties.has(e)?this.properties.get(e):-1}},{key:"setProperty",value:function(e,t){return this.properties.set(e,t),this}},{key:"setSingleSymbologyEnabled",value:function(t,n){if(!(t in e.Barcode.Symbology)&&!Oc(e.Barcode.Symbology).includes(t))throw new TypeError('Invalid symbology "'.concat(t,'"'));this.symbologySettings.has(t)?this.symbologySettings.get(t).setEnabled(n):this.symbologySettings.set(t,new e.SymbologySettings(t,n))}},{key:"setMultipleSymbologiesEnabled",value:function(t,n){var r,i=Pc(t);try{for(i.s();!(r=i.n()).done;){var a=r.value;if(!(a in e.Barcode.Symbology)&&!Oc(e.Barcode.Symbology).includes(a))throw new TypeError('Invalid symbology "'.concat(a,'"'))}}catch(e){i.e(e)}finally{i.f()}var o,s=Pc(t);try{for(s.s();!(o=s.n()).done;){var c=o.value;this.symbologySettings.has(c)?this.symbologySettings.get(c).setEnabled(n):this.symbologySettings.set(c,new e.SymbologySettings(c,n))}}catch(e){s.e(e)}finally{s.f()}}},{key:"setSymbologiesEnabled",value:function(e,t){return"object"==typeof e?this.setMultipleSymbologiesEnabled(e,t):this.setSingleSymbologyEnabled(e,t),this}}]),t}(),(Rc=(Dc=e.ScanSettings||(e.ScanSettings={})).RecognitionMode||(Dc.RecognitionMode={})).CODE="code",Rc.TEXT="text",Rc.CODE_AND_TEXT="code-and-text",(jc=Dc.CodeDirection||(Dc.CodeDirection={})).LEFT_TO_RIGHT="left-to-right",jc.RIGHT_TO_LEFT="right-to-left",jc.BOTTOM_TO_TOP="bottom-to-top",jc.TOP_TO_BOTTOM="top-to-bottom",jc.HORIZONTAL="horizontal",jc.VERTICAL="vertical",jc.NONE="none";var Gc=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.scanSettings,i=void 0===r?new e.ScanSettings:r,a=n.imageSettings;qo(this,t),ec(this,"eventEmitter",void 0),ec(this,"dataCaptureWorker",void 0),ec(this,"scanSettings",void 0),ec(this,"imageSettings",void 0),ec(this,"workerParseRequestId",void 0),ec(this,"workerScanQueueLength",void 0),ec(this,"isReadyToWork",void 0),ec(this,"licenseKeyFeatures",void 0),ec(this,"imageDataConversionContext",void 0);var o=e.BrowserHelper.checkBrowserCompatibility();if(!o.scannerSupport)throw new ic(o);if("done"!==e.configurePhase)throw new $s({name:"LibraryNotConfiguredError",message:"started"===e.configurePhase?"The library has not completed its configuration yet, please call 'configure' and wait for the returned\n            promise's resolution":"The library was not configured yet, 'configure' must be called with valid parameters before instantiating\n            the Scanner"});this.eventEmitter=new uc,this.isReadyToWork=!1,this.workerScanQueueLength=0,this.workerParseRequestId=0,this.initializeWorker(i,a)}var n,r;return Zo(t,[{key:"destroy",value:function(){null!=this.dataCaptureWorker&&e.dataCaptureLoader.returnDataCaptureWorker(this.dataCaptureWorker),this.eventEmitter.removeAllListeners()}},{key:"applyScanSettings",value:function(e){this.scanSettings=e,this.dataCaptureWorker.postMessage({type:"scan-settings",settings:this.scanSettings.toJSONString(),blurryRecognitionAvailable:!0,blurryRecognitionRequiresUpdate:!1});var t=this.scanSettings.getDeviceName();return null!=t&&this.dataCaptureWorker.postMessage({type:"device-name",deviceName:t}),this.eventEmitter.emit("newScanSettings",this.scanSettings),this}},{key:"applyImageSettings",value:function(e){return this.imageSettings=e,this.dataCaptureWorker.postMessage({type:"image-settings",imageSettings:e}),this}},{key:"clearSession",value:function(){return this.dataCaptureWorker.postMessage({type:"clear-session"}),this}},{key:"processImage",value:(r=Zr(ao.mark((function n(r){var i,a,o=this,s=arguments;return ao.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i=s.length>1&&void 0!==s[1]&&s[1],null!=this.imageSettings){n.next=3;break}throw new $s({name:"NoImageSettings",message:"No image settings set up in the scanner"});case 3:r instanceof HTMLImageElement&&(null==this.imageDataConversionContext&&(this.imageDataConversionContext=document.createElement("canvas").getContext("2d")),this.imageDataConversionContext.canvas.width=r.naturalWidth,this.imageDataConversionContext.canvas.height=r.naturalHeight,this.imageDataConversionContext.drawImage(r,0,0,r.naturalWidth,r.naturalHeight),r=new Uint8Array(this.imageDataConversionContext.getImageData(0,0,r.naturalWidth,r.naturalHeight).data.buffer)),n.t0=this.imageSettings.format.valueOf(),n.next=n.t0===e.ImageSettings.Format.GRAY_8U?7:n.t0===e.ImageSettings.Format.RGB_8U?9:n.t0===e.ImageSettings.Format.RGBA_8U?11:13;break;case 7:case 13:return a=1,n.abrupt("break",15);case 9:return a=3,n.abrupt("break",15);case 11:return a=4,n.abrupt("break",15);case 15:if(this.imageSettings.width*this.imageSettings.height*a===r.length){n.next=17;break}throw new $s({name:"ImageSettingsDataMismatch",message:"The provided image data doesn't match the previously set image settings"});case 17:return t.workerScanRequestId++,this.workerScanQueueLength++,n.abrupt("return",new Hr((function(n,a){var s="workResult-".concat(t.workerScanRequestId),c="workError-".concat(t.workerScanRequestId);o.eventEmitter.once(s,(function(e,t){o.eventEmitter.removeAllListeners(c),o.workerScanQueueLength--,n(new Nc(e.barcodes,e.texts,t,o.imageSettings))})),o.eventEmitter.once(c,(function(t,n){e.Logger.log(e.Logger.Level.ERROR,"Scandit Data Capture error (".concat(t.errorCode,"):"),t.errorMessage),o.eventEmitter.removeAllListeners(s),o.workerScanQueueLength--;var r=new $s({name:"ScanditEngineError",message:"".concat(t.errorMessage," (").concat(t.errorCode,")")});a(r)})),o.dataCaptureWorker.postMessage({type:"scan-image",requestId:t.workerScanRequestId,data:r,highQualitySingleFrameMode:i},[r.buffer])})));case 20:case"end":return n.stop()}}),n,this)}))),function(e){return r.apply(this,arguments)})},{key:"isBusyProcessing",value:function(){return 0!==this.workerScanQueueLength}},{key:"isReady",value:function(){return this.isReadyToWork}},{key:"on",value:function(e,t){return"ready"===e?this.isReadyToWork?t():this.eventEmitter.once(e,t,this):"contextCreated"===e?null!=this.licenseKeyFeatures?t(this.licenseKeyFeatures):this.eventEmitter.once(e,t,this):this.eventEmitter.on(e,t,this),this}},{key:"addListener",value:function(e,t){return this.on(e,t)}},{key:"createParserForFormat",value:function(t){return new e.Parser(this,t)}},{key:"getImageSettings",value:function(){return this.imageSettings}},{key:"getScanSettings",value:function(){return this.scanSettings}},{key:"parse",value:(n=Zr(ao.mark((function t(n,r,i){var a=this;return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.workerParseRequestId++,t.abrupt("return",new Hr((function(t,o){var s="parseResult-".concat(a.workerParseRequestId),c="parseError-".concat(a.workerParseRequestId);a.eventEmitter.once(s,(function(e){a.eventEmitter.removeAllListeners(c);var n={jsonString:e,fields:[],fieldsByName:{}};JSON.parse(e).forEach((function(e){n.fields.push(e),n.fieldsByName[e.name]=e})),t(n)})),a.eventEmitter.once(c,(function(t){e.Logger.log(e.Logger.Level.ERROR,"Scandit Data Capture error (".concat(t.errorCode,"):"),t.errorMessage),a.eventEmitter.removeAllListeners(s);var n=new $s({name:"ScanditEngineError",message:"".concat(t.errorMessage," (").concat(t.errorCode,")")});o(n)})),a.dataCaptureWorker.postMessage({type:"parse",requestId:a.workerParseRequestId,dataFormat:n,data:r,options:null==i?"{}":Sc(i)})})));case 2:case"end":return t.stop()}}),t,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"reportCameraProperties",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.dataCaptureWorker.postMessage({type:"camera-properties",cameraType:e,autofocus:t}),this}},{key:"removeListener",value:function(e,t){return this.eventEmitter.removeListener(e,t),this}},{key:"removeAllListeners",value:function(e){return this.eventEmitter.removeAllListeners(e),this}},{key:"initializeWorker",value:function(t,n){this.dataCaptureWorker=e.dataCaptureLoader.getDataCaptureWorker(),this.dataCaptureWorker.onmessage=this.dataCaptureWorkerOnMessage.bind(this),rc.load(this.dataCaptureWorker),this.applyScanSettings(t),null!=n&&this.applyImageSettings(n)}},{key:"dataCaptureWorkerOnMessage",value:function(t){var n=t.data;if("log"===n[0])return n[1].data.forEach((function(e,t){if(null!=e.name&&null!=e.message){var r=new $s({name:e.name,message:e.message});r.stack=e.stack,n[1].data[t]=r}})),void e.Logger.log.apply(e.Logger,[n[1].level].concat(mc(n[1].data)));if("library-loaded"===n[0])return this.isReadyToWork=!0,void this.eventEmitter.emit("ready");if("reset"===n[0])return this.dataCaptureWorker.terminate(),localStorage.setItem("scanditWritableDataPathOverride","/scandit_sync_folder_".concat(mc(crypto.getRandomValues(new Uint32Array(2))).map((function(e){return e.toString(32)})).join(""))),void this.initializeWorker(this.scanSettings,this.imageSettings);if(null!=n[1])switch(n[0]){case"context-created":this.licenseKeyFeatures=n[1],this.eventEmitter.emit("contextCreated",this.licenseKeyFeatures);break;case"work-result":this.eventEmitter.emit("workResult-".concat(n[1].requestId),n[1].result,n[2]);break;case"work-error":this.eventEmitter.emit("workError-".concat(n[1].requestId),n[1].error,n[2]);break;case"parse-result":this.eventEmitter.emit("parseResult-".concat(n[1].requestId),n[1].result);break;case"parse-error":this.eventEmitter.emit("parseError-".concat(n[1].requestId),n[1].error)}}}],[{key:"ready",value:function(){}}]),t}();ec(Gc,"workerScanRequestId",0),e.SingleImageModeSettings=void 0,function(e){function t(e,t){return{informationElement:document.createRange().createContextualFragment(e).firstElementChild,buttonElement:document.createRange().createContextualFragment(atob(t)).firstElementChild,containerStyle:{backgroundColor:"#333333"},informationStyle:{color:"#FFFFFF"},buttonStyle:{borderColor:"#FFFFFF",color:"#FFFFFF",fill:"#FFFFFF"}}}var n;(n=e.UsageStrategy||(e.UsageStrategy={})).NEVER="never",n.FALLBACK="fallback",n.ALWAYS="always",e.defaultDesktop=t("<p>To scan:<br>1. Click on the folder icon<br>2. Select the picture to scan</p>","PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNzIgMTcyIiB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgZmlsbD0iI2ZmZiI+PHBhdGggZD0iTTEwLjMgMTMuOEM0LjcgMTMuOCAwIDE4LjQgMCAyNHYxMjdjLS4yLjctLjEgMS42LjIgMi4zIDEgNC43IDUuMiA4LjMgMTAuMSA4LjNoMTM0LjJjNS4xIDAgOS4zLTMuOSAxMC04LjhsLjItLjd2LS4ybC4xLS41di0uMWwxNy05Mi4zLjItLjN2LS4zYzAtNS43LTQuNy0xMC4zLTEwLjMtMTAuM1YzNy44YzAtNS42LTQuNy0xMC4zLTEwLjMtMTAuM0g2MmE3IDcgMCAwIDEtMS0xYy0uOS0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LjcgMSAxLjEgMS41IDEgMSAxLjggMWgxMGMuNiAwIDEgLjQgMSAxdjI3YzAgLjYtLjQgMS0xIDFIM2MtLjYgMC0xLS40LTEtMXYtMjdjMC0uNi40LTEgMS0xaDEwYy44IDAgMS40LS41IDEuOC0xcy44LTEgMS4xLTEuNS42LTEgLjgtMS4yLjQtLjMuMy0uM3ptOCA0Yy03LjIgMC0xMyA1LjgtMTMgMTNzNS44IDEzIDEzIDEzIDEzLTUuOCAxMy0xMy01LjgtMTMtMTMtMTN6bTAgMmM2LjEgMCAxMSA0LjkgMTEgMTFzLTQuOSAxMS0xMSAxMS0xMS00LjktMTEtMTEgNC45LTExIDExLTExek04IDE0Yy0xLjEgMC0yIC45LTIgMnMuOSAyIDIgMmgxYzEuMSAwIDItLjkgMi0ycy0uOS0yLTItMnptMTcgMWMtNSAwLTkgNC05IDlzNCA5IDkgOSA5LTQgOS05LTQtOS05LTl6bTAgMmMzLjkgMCA3IDMuMSA3IDdzLTMuMSA3LTcgNy03LTMuMS03LTcgMy4xLTcgNy03eiIvPjwvc3ZnPgo=")}(e.SingleImageModeSettings||(e.SingleImageModeSettings={}));var Bc=l.exports.Object.getOwnPropertySymbols,zc=Si,Wc=hi,Yc=y,Hc=c.exports.Reflect,Qc=Hc&&Hc.ownKeys||function(e){var t=zc.f(Yc(e)),n=Wc.f;return n?t.concat(n(e)):t},Zc=$,qc=Ii,Xc=co;W(W.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,n,r=Zc(e),i=qc.f,a=Qc(r),o={},s=0;a.length>s;)void 0!==(n=i(r,t=a[s++]))&&Xc(o,t,n);return o}});var Jc=l.exports.Object.getOwnPropertyDescriptors,Kc="\t\n\v\f\r   ᠎             　\u2028\u2029\ufeff",$c=W,eu=a,tu=b,nu=Kc,ru="["+nu+"]",iu=RegExp("^"+ru+ru+"*"),au=RegExp(ru+ru+"*$"),ou=function(e,t,n){var r={},i=tu((function(){return!!nu[e]()||"​"!="​"[e]()})),a=r[e]=i?t(su):nu[e];n&&(r[n]=a),$c($c.P+$c.F*i,"String",r)},su=ou.trim=function(e,t){return e=String(eu(e)),1&t&&(e=e.replace(iu,"")),2&t&&(e=e.replace(au,"")),e},cu=ou,uu=c.exports.parseInt,lu=cu.trim,du=Kc,hu=/^[-+]?0[xX]/,mu=W,fu=8!==uu(du+"08")||22!==uu(du+"0x16")?function(e,t){var n=lu(String(e),3);return uu(n,t>>>0||(hu.test(n)?16:10))}:uu;mu(mu.G+mu.F*(parseInt!=fu),{parseInt:fu});var gu,pu,vu,yu,bu=l.exports.parseInt;function Su(e,t){var n=Object.keys(e);if(Bc){var r=Bc(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Eu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Su(Object(n),!0).forEach((function(t){ec(e,t,n[t])})):Jc?Object.defineProperties(e,Jc(n)):Su(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Au(e,t){var n=Object.keys(e);if(Bc){var r=Bc(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Au(Object(n),!0).forEach((function(t){ec(e,t,n[t])})):Jc?Object.defineProperties(e,Jc(n)):Au(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}e.CameraAccess=void 0,function(t){var n,r=new qs([["DeviceCaptureError","AbortError"],["NotSupportedError","AbortError"],["ScreenCaptureError","AbortError"],["TabCaptureError","AbortError"],["TypeError","AbortError"],["InvalidStateError","NotAllowedError"],["MediaDeviceFailedDueToShutdown","NotAllowedError"],["MediaDeviceKillSwitchOn","NotAllowedError"],["PermissionDeniedError","NotAllowedError"],["PermissionDismissedError","NotAllowedError"],["DevicesNotFoundError","NotFoundError"],["SourceUnavailableError","NotReadableError"],["TrackStartError","NotReadableError"],["ConstraintNotSatisfiedError","OverconstrainedError"]]),i=["rear","back","rück","arrière","trasera","trás","traseira","posteriore","后面","後面","背面","后置","後置","背置","задней","الخلفية","후","arka","achterzijde","หลัง","baksidan","bagside","sau","bak","tylny","takakamera","belakang","אחורית","πίσω","spate","hátsó","zadní","darrere","posterior","zadná","задня","stražnja","belakang","बैक"],a=new Ic(["Front Camera","Frontkamera","Appareil photo avant","Cámara frontal","Câmera Frontal","Câmara frontal","Fotocamera (anteriore)","前置相机","前置相機","前面カメラ","Камера на передней панели","Ön Kamera","Camera aan voorzijde","الكاميرا الأمامية","กล้องด้านหน้า","Kamera på framsidan","Forsidekamera","Camera mặt trước","Kamera foran","Przedni aparat","Etukamera","Kamera Depan","מצלמה קדמית","Μπροστινή κάμερα","Cameră față","Elülső kamera","Přední fotoaparát","Càmera frontal","Predná kamera","Передня камера","Prednja kamera","Kamera Depan","फ़्रंट कैमरा"]),o=new Ic(["Back Camera","Rückkamera","Caméra arrière","Cámara trasera","Câmera Traseira","Câmara traseira","Fotocamera (posteriore)","后置相机","後置相機","背面カメラ","Камера на задней панели","Arka Kamera","Camera aan achterzijde","الكاميرا الخلفية","กล้องด้านหลัง","Kamera på baksidan","Bagsidekamera","Camera mặt sau","Kamera bak","Tylny aparat","Takakamera","Kamera Belakang","מצלמה אחורית","Πίσω κάμερα","Cameră spate","Hátsó kamera","Zadní fotoaparát","Càmera posterior","Zadná kamera","Задня камера","Stražnja kamera","Kamera Belakang","बैक कैमरा"]),s=new Ic(["Back Ultra Wide Camera","Rückseitige Ultra-Weitwinkelkamera","Appareil photo ultra grand angle arrière","Cámara trasera con ultra gran angular","Câmera Ultra-Angular Traseira","Câmara ultra grande angular traseira","Fotocamera con ultra-grandangolo (posteriore)","后置超广角相机","後置超廣角相機","背面超広角カメラ","Задняя сверхширокоугольная камера","Ultra Geniş Kamera Arka Yüzü","Ultrabrede camera aan achterzijde","كاميرا خلفية عريضة جدًا","กล้องด้านหลังมุมกว้างอัลตร้า","Ultravidvinkelkamera på baksidan","Ultravidvinkelkameraet på bagsiden","Camera cực rộng mặt sau","Ultravidvinkelkamera bak","Tylny aparat ultraszerokokątny","Ultralaajakulmainen takakamera","Kamera Ultra Lebar Belakang","מצלמה אולטרה רחבה אחורית","Πίσω υπερευρεία κάμερα","Cameră cu obiectiv ultra‑superangular spate","Hátsó, ultraszéles látószögű kamera","Zadní ultra širokoúhlý fotoaparát","Càmera posterior amb ultra gran angular","Zadná ultraširokouhlá kamera","Задня надширококутна камера","Stražnja ultra široka kamera","Kamera Ultralebar Belakang","बैक अल्ट्रा वाइड कैमरा"]),c=new Ic(["Back Dual Wide Camera","Rückseitige Dual-Weitwinkelkamera","Double appareil photo grand angle arrière","Cámara trasera dual con gran angular","Câmera Dupla Grande-Angular Traseira","Câmara grande angular dupla traseira","Fotocamera doppia con grandangolo (posteriore)","后置双广角镜头","後置雙廣角相機","背面デュアル広角カメラ","Задняя двойная широкоугольная камера","Çift Geniş Kamera Arka Yüzü","كاميرا خلفية مزدوجة عريضة","กล้องคู่ด้านหลังมุมกว้าง","Dubbel vidvinkelkamera på baksidan","Camera kép rộng mặt sau","Dobbelt vidvinkelkamera bak","Tylny dwuobiektywowy aparat szerokokątny","Laajakulmainen kaksoistakakamera","Kamera Lebar Belakang Ganda","מצלמה כפולה רחבה אחורית","Πίσω διπλή ευρεία κάμερα","Cameră dublă cu obiectiv superangular spate","Hátsó, kettős, széles látószögű kamera","Zadní duální širokoúhlý fotoaparát","Càmera dual posterior amb gran angular","Zadná duálna širokouhlá kamera","Задня здвоєна ширококутна камера","Stražnja dvostruka široka kamera","Dwikamera Lebar Belakang","बैक ड्युअल वाइड कैमरा"]),u=!1;function l(){u=!0}function d(e){return a.has(e)}function h(e){return o.has(e)}function m(e){return c.has(e)}function f(e){return s.has(e)}function g(e){var t,n;t="Invalid constraint"===e.message?"OverconstrainedError":null!==(n=r.get(e.name))&&void 0!==n?n:e.name,Object.defineProperty(e,"name",{value:t})}function p(t,n){var r=t.getVideoTracks();if(0!==r.length){var i,a,o=r[0];"function"==typeof o.getSettings&&null!=(null===(a=i=o.getSettings())||void 0===a?void 0:a.facingMode)&&i.facingMode.length>0&&(n.cameraType="environment"===i.facingMode?e.Camera.Type.BACK:e.Camera.Type.FRONT),null!=o.label&&o.label.length>0&&(n.label=o.label)}}function v(n){var r=n.map((function(n,r,a){var o;if(t.deviceIdToCameraObjects.has(n.deviceId))return t.deviceIdToCameraObjects.get(n.deviceId);var s,c=null!==(o=n.label)&&void 0!==o?o:"";return s=!e.BrowserHelper.isDesktopDevice()&&a.every((function(e){return""===e.label&&!t.deviceIdToCameraObjects.has(e.deviceId)}))?1===a.length||r+1<=Math.floor(a.length/2)?e.Camera.Type.FRONT:e.Camera.Type.BACK:function(e){var t=e.toLowerCase();return i.some((function(e){return t.includes(e)}))}(c)?e.Camera.Type.BACK:e.Camera.Type.FRONT,{deviceId:n.deviceId,label:c,cameraType:s}})).map((function(e){return""!==e.deviceId&&t.deviceIdToCameraObjects.set(e.deviceId,e),e})).filter((function(e){return!/\b(?:ir|infrared)\b/i.test(e.label)})).filter((function(e){return!t.inaccessibleDeviceIds.has(e.deviceId)}));if(!e.BrowserHelper.isDesktopDevice()&&r.length>1&&!r.some((function(t){return t.cameraType===e.Camera.Type.BACK}))){var a=r.length-1,o=r.map((function(e){var t=e.label.match(/\b([0-9]+)MP?\b/i);return null!=t?bu(t[1],10):NaN}));o.some((function(e){return isNaN(e)}))||(a=o.lastIndexOf(Math.max.apply(Math,mc(o)))),r[a].cameraType=e.Camera.Type.BACK}return r}function y(){return b.apply(this,arguments)}function b(){return(b=Zr(ao.mark((function e(){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(null!=n&&n.length>0&&n.every((function(e){return""===e.label&&!t.deviceIdToCameraObjects.has(e.deviceId)})))){e.next=9;break}return e.prev=1,e.next=4,navigator.mediaDevices.getUserMedia({video:!0,audio:!1});case 4:return e.abrupt("return",e.sent);case 7:e.prev=7,e.t0=e.catch(1);case 9:case"end":return e.stop()}}),e,null,[[1,7]])})))).apply(this,arguments)}function S(n,r){if(r.length>0&&n.length===r.length&&!r.every((function(e,t){return n[t].deviceId===e.deviceId}))){var i={};n.forEach((function(e,n){var a,o=t.deviceIdToCameraObjects.get(e.deviceId);if(null!=o&&o.label===(null!==(a=r[n].label)&&void 0!==a?a:"")){var s=r[n].deviceId;i[o.deviceId]=s,t.inaccessibleDeviceIds.has(o.deviceId)&&t.inaccessibleDeviceIds.add(s),o.deviceId=s,t.deviceIdToCameraObjects.set(s,o)}})),e.Logger.log(e.Logger.Level.DEBUG,"Detected updated camera deviceId information and updated it accordingly",i)}}function E(){return E=Zr(ao.mark((function t(){var r,i,a,o,s,c,d,h=arguments;return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=h.length>0&&void 0!==h[0]&&h[0],i=h.length>1&&void 0!==h[1]&&h[1],(a=e.BrowserHelper.checkBrowserCompatibility()).fullSupport){t.next=5;break}throw new ic(a);case 5:if("function"==typeof navigator.mediaDevices.addEventListener?navigator.mediaDevices.addEventListener("devicechange",l):navigator.mediaDevices.ondevicechange=l,null!=n&&!r&&!u){t.next=33;break}return u=!1,c=null!==(o=n)&&void 0!==o?o:[],n=[],t.prev=10,t.next=13,T();case 13:if(n=t.sent,i){t.next=22;break}return t.next=17,y();case 17:if(null==(s=t.sent)){t.next=22;break}return t.next=21,T();case 21:n=t.sent;case 22:e.Logger.log.apply(e.Logger,[e.Logger.Level.DEBUG,"Camera list (devices):"].concat(mc(n))),S(c,n),t.next=30;break;case 26:throw t.prev=26,t.t0=t.catch(10),g(t.t0),t.t0;case 30:return t.prev=30,null!=s&&s.getVideoTracks().forEach((function(e){e.stop()})),t.finish(30);case 33:return d=v(n),e.Logger.log.apply(e.Logger,[e.Logger.Level.DEBUG,"Camera list (cameras): "].concat(mc(d))),t.abrupt("return",mc(d));case 36:case"end":return t.stop()}}),t,null,[[10,26,30,33]])}))),E.apply(this,arguments)}function A(t){return e.Logger.log(e.Logger.Level.DEBUG,"Attempt to access camera (parameters):",t.video),new Hr((function(e,n){window.setTimeout((function(){var r;(null!==(r=navigator.mediaDevices.getUserMedia(t))&&void 0!==r?r:Hr.reject(new $s({name:"AbortError"}))).then(e).catch(n)}),0)}))}function C(e){var t={resizeMode:"none"};switch(e){case yu.ULTRA_HD:return Eu(Eu({},t),{},{width:{min:3200,ideal:3840,max:4096},height:{min:1800,ideal:2160,max:2400}});case yu.FULL_HD:return Eu(Eu({},t),{},{width:{min:1400,ideal:1920,max:2160},height:{min:900,ideal:1080,max:1440}});case yu.HD:return Eu(Eu({},t),{},{width:{min:960,ideal:1280,max:1440},height:{min:480,ideal:720,max:960}});case yu.SD:return Eu(Eu({},t),{},{width:{min:640,ideal:640,max:800},height:{min:480,ideal:480,max:600}});case yu.NONE:default:return{}}}function w(){return(w=Zr(ao.mark((function t(n,r){var i,a;return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.Logger.log(e.Logger.Level.DEBUG,"Attempt to access camera (camera):",r),i={audio:!1,video:C(n)},""===r.deviceId?i.video.facingMode={ideal:r.cameraType===e.Camera.Type.BACK?"environment":"user"}:i.video.deviceId={exact:r.deviceId},t.prev=3,t.next=6,A(i);case 6:return p(a=t.sent,r),t.abrupt("return",a);case 11:throw t.prev=11,t.t0=t.catch(3),g(t.t0),["OverconstrainedError","NotReadableError","NotAllowedError"].includes(t.t0.name)||_(r),t.t0;case 16:case"end":return t.stop()}}),t,null,[[3,11]])})))).apply(this,arguments)}function _(n){""!==n.deviceId&&(e.Logger.log(e.Logger.Level.DEBUG,"Camera marked to be inaccessible:",n),t.inaccessibleDeviceIds.add(n.deviceId))}function T(){return I.apply(this,arguments)}function I(){return(I=Zr(ao.mark((function t(){var n,r,i;return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("function"!=typeof navigator.enumerateDevices){t.next=6;break}return t.next=3,navigator.enumerateDevices();case 3:case 9:r=t.sent,t.next=24;break;case 6:if("function"!=typeof(null===(n=navigator.mediaDevices)||void 0===n?void 0:n.enumerateDevices)){t.next=12;break}return t.next=9,navigator.mediaDevices.enumerateDevices();case 12:if(t.prev=12,null!=(null===(i=window.MediaStreamTrack)||void 0===i?void 0:i.getSources)){t.next=15;break}throw new Error;case 15:return t.next=17,new Hr((function(e){var t,n;null===(t=window.MediaStreamTrack)||void 0===t||null===(n=t.getSources)||void 0===n||n.call(t,e)}));case 17:r=(r=t.sent).filter((function(e){return"video"===e.kind.toLowerCase()||"videoinput"===e.kind.toLowerCase()})).map((function(e){var t;return{deviceId:null!==(t=e.deviceId)&&void 0!==t?t:"",groupId:e.groupId,kind:"videoinput",label:e.label,toJSON:function(){return this}}})),t.next=24;break;case 21:throw t.prev=21,t.t0=t.catch(12),new ic({fullSupport:!1,scannerSupport:!0,missingFeatures:[e.BrowserCompatibility.Feature.MEDIA_DEVICES]});case 24:return t.abrupt("return",r.filter((function(e){return"videoinput"===e.kind})));case 25:case"end":return t.stop()}}),t,null,[[12,21]])})))).apply(this,arguments)}t.mainCameraForTypeOverridesOnDesktop=new qs,t.deviceIdToCameraObjects=new qs,t.inaccessibleDeviceIds=new Ic,t.isIOSWideFrontCameraLabel=d,t.isIOSWideBackCameraLabel=h,t.isIOSBackDualWideCameraLabel=m,t.isIOSUltraWideBackCameraLabel=f,t.getMainCameraForType=function(n,r){var i;if(e.BrowserHelper.isDesktopDevice())i=t.mainCameraForTypeOverridesOnDesktop.has(r)?t.mainCameraForTypeOverridesOnDesktop.get(r):n.filter((function(e){return e.cameraType===r}))[0];else{var a=n.every((function(e){return""===e.label})),o=n.every((function(e){return""!==e.label})),s=n.length>1&&!a&&!o;if(a)i=n[r===e.Camera.Type.FRONT?0:n.length-1];else if(s){var c=n.filter((function(e){return e.cameraType===r}));1===c.length?i=c[0]:c.length>1&&(i=c[r===e.Camera.Type.FRONT?0:c.length-1])}else{if("iOS"===e.BrowserHelper.userAgentInfo.getOS().name)if(r===e.Camera.Type.BACK){var u=n.find((function(e){return m(e.label)}));if(null!=u)return u;var l=n.find((function(e){return h(e.label)}));if(null!=l)return l}else{var f=n.find((function(e){return d(e.label)}));if(null!=f)return f}i=n.filter((function(e){return e.cameraType===r})).sort((function(e,t){return e.label.localeCompare(t.label)}))[0]}}return i},t.sortCamerasForCameraType=function(n,r){function i(e,n){var r=t.mainCameraForTypeOverridesOnDesktop.get(n);return null!=r&&e.includes(r)&&(e=e.filter((function(e){return e!==r}))).unshift(r),e}var a=n.filter((function(t){return t.cameraType===e.Camera.Type.FRONT})),o=n.filter((function(t){return t.cameraType===e.Camera.Type.BACK}));return e.BrowserHelper.isDesktopDevice()?(a=i(a,e.Camera.Type.FRONT),o=i(o,e.Camera.Type.BACK)):n.every((function(e){return""===e.label}))?o.reverse():(a.sort((function(e,t){return e.label.localeCompare(t.label)})),o.sort((function(e,t){return e.label.localeCompare(t.label)})),"iOS"===e.BrowserHelper.userAgentInfo.getOS().name&&(a.some((function(e,t){return d(e.label)&&a.unshift(a.splice(t,1)[0])>=0})),o.some((function(e,t){return f(e.label)&&o.unshift(o.splice(t,1)[0])>=0})),o.some((function(e,t){return h(e.label)&&o.unshift(o.splice(t,1)[0])>=0})),o.some((function(e,t){return m(e.label)&&o.unshift(o.splice(t,1)[0])>=0})))),r===e.Camera.Type.FRONT?[].concat(mc(a),mc(o)):[].concat(mc(o),mc(a))},t.adjustCameraFromMediaStream=p,t.getCameras=function(){return E.apply(this,arguments)},t.getUserMediaVideoParams=C,t.accessCameraStream=function(e,t){return w.apply(this,arguments)},t.markCameraAsInaccessible=_}(e.CameraAccess||(e.CameraAccess={})),e.CameraSettings=void 0,(pu=(gu=e.CameraSettings||(e.CameraSettings={})).ResolutionPreference||(gu.ResolutionPreference={})).ULTRA_HD="ultra-hd",pu.FULL_HD="full-hd",pu.HD="hd",function(e){e.CONTINUOUS="continuous",e.MANUAL="manual",e.NONE="none",e.SINGLE_SHOT="single-shot"}(vu||(vu={})),function(e){e[e.ULTRA_HD=0]="ULTRA_HD",e[e.FULL_HD=1]="FULL_HD",e[e.HD=2]="HD",e[e.SD=3]="SD",e[e.NONE=4]="NONE"}(yu||(yu={}));var wu=function(){function t(n,r,i){qo(this,t),ec(this,"selectedCamera",void 0),ec(this,"activeCamera",void 0),ec(this,"activeCameraSettings",void 0),ec(this,"scanner",void 0),ec(this,"triggerCameraAccessError",void 0),ec(this,"gui",void 0),ec(this,"postStreamInitializationListener",this.postStreamInitialization.bind(this)),ec(this,"videoResizeListener",this.videoResizeHandle.bind(this)),ec(this,"videoTrackEndedListener",this.videoTrackEndedRecovery.bind(this)),ec(this,"videoTrackMuteListener",this.videoTrackMuteRecovery.bind(this)),ec(this,"triggerManualFocusListener",this.triggerManualFocus.bind(this)),ec(this,"triggerZoomStartListener",this.triggerZoomStart.bind(this)),ec(this,"triggerZoomMoveListener",this.triggerZoomMove.bind(this)),ec(this,"checkCameraVideoStreamAccessIfVisibleListener",this.checkCameraVideoStreamAccessIfVisible.bind(this)),ec(this,"cameraType",void 0),ec(this,"selectedCameraSettings",void 0),ec(this,"mediaStream",void 0),ec(this,"mediaTrackCapabilities",void 0),ec(this,"cameraAccessTimeout",void 0),ec(this,"cameraAccessRejectCallback",void 0),ec(this,"videoMetadataCheckInterval",void 0),ec(this,"getCapabilitiesTimeout",void 0),ec(this,"autofocusInterval",void 0),ec(this,"manualToAutofocusResumeTimeout",void 0),ec(this,"manualFocusWaitTimeout",void 0),ec(this,"cameraSwitcherEnabled",void 0),ec(this,"cameraFOVSwitcherEnabled",void 0),ec(this,"torchToggleEnabled",void 0),ec(this,"tapToFocusEnabled",void 0),ec(this,"pinchToZoomEnabled",void 0),ec(this,"pinchToZoomDistance",void 0),ec(this,"pinchToZoomInitialZoom",void 0),ec(this,"torchEnabled",void 0),ec(this,"cameraInitializationPromise",void 0),ec(this,"abortedCameraInitializationResolveCallback",void 0),ec(this,"cameraSetupPromise",void 0),this.scanner=n,this.triggerCameraAccessError=r,this.gui=i,this.cameraType=e.Camera.Type.BACK}var n,r,i,a,o,s,c,u,l,d,h,m,f,g,p,v,y,b,S,E,A,C,w,_,T,I,N,M,L;return Zo(t,[{key:"setInteractionOptions",value:function(e,t,n,r,i){this.cameraSwitcherEnabled=e,this.cameraFOVSwitcherEnabled=t,this.torchToggleEnabled=n,this.tapToFocusEnabled=r,this.pinchToZoomEnabled=i}},{key:"isCameraSwitcherEnabled",value:function(){return this.cameraSwitcherEnabled}},{key:"setCameraSwitcherEnabled",value:(L=Zr(ao.mark((function t(n){return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.cameraSwitcherEnabled=n,!this.cameraSwitcherEnabled){t.next=8;break}return t.next=4,e.CameraAccess.getCameras();case 4:t.sent.length>1&&this.gui.setCameraSwitcherVisible(!0),t.next=9;break;case 8:this.gui.setCameraSwitcherVisible(!1);case 9:case"end":return t.stop()}}),t,this)}))),function(e){return L.apply(this,arguments)})},{key:"isCameraFOVSwitcherEnabled",value:function(){return this.cameraFOVSwitcherEnabled}},{key:"setCameraFOVSwitcherEnabled",value:(M=Zr(ao.mark((function t(n){var r,i;return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.cameraFOVSwitcherEnabled=n,!n){t.next=9;break}return t.next=4,e.CameraAccess.getCameras();case 4:if(r=t.sent,null==(i=r.find((function(t){return e.CameraAccess.isIOSWideBackCameraLabel(t.label)})))){t.next=9;break}return t.next=9,this.initializeCameraWithSettings(i,this.activeCameraSettings);case 9:this.isCameraFOVSwitcherAllowed()&&null!=this.activeCamera?(this.gui.setCameraFOVSwitcherState(e.CameraAccess.isIOSUltraWideBackCameraLabel(this.activeCamera.label)),this.gui.setCameraFOVSwitcherVisible(!0)):this.gui.setCameraFOVSwitcherVisible(!1);case 10:case"end":return t.stop()}}),t,this)}))),function(e){return M.apply(this,arguments)})},{key:"isTorchToggleEnabled",value:function(){return this.torchToggleEnabled}},{key:"setTorchToggleEnabled",value:function(e){var t;this.torchToggleEnabled=e,this.torchToggleEnabled?null!=this.mediaStream&&!0===(null===(t=this.mediaTrackCapabilities)||void 0===t?void 0:t.torch)&&this.gui.setTorchTogglerVisible(!0):this.gui.setTorchTogglerVisible(!1)}},{key:"isTapToFocusEnabled",value:function(){return this.tapToFocusEnabled}},{key:"setTapToFocusEnabled",value:function(e){this.tapToFocusEnabled=e,null!=this.mediaStream&&(this.tapToFocusEnabled?this.enableTapToFocusListeners():this.disableTapToFocusListeners())}},{key:"isPinchToZoomEnabled",value:function(){return this.pinchToZoomEnabled}},{key:"setPinchToZoomEnabled",value:function(e){this.pinchToZoomEnabled=e,null!=this.mediaStream&&(this.pinchToZoomEnabled?this.enablePinchToZoomListeners():this.disablePinchToZoomListeners())}},{key:"setInitialCameraType",value:function(e){this.cameraType=e}},{key:"setCameraType",value:(N=Zr(ao.mark((function t(n){var r;return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.setInitialCameraType(n),t.t0=e.CameraAccess,t.next=4,e.CameraAccess.getCameras();case 4:if(t.t1=t.sent,t.t2=n,null==(r=t.t0.getMainCameraForType.call(t.t0,t.t1,t.t2))||r===this.selectedCamera){t.next=9;break}return t.abrupt("return",this.initializeCameraWithSettings(r,this.selectedCameraSettings));case 9:case"end":return t.stop()}}),t,this)}))),function(e){return N.apply(this,arguments)})},{key:"setSelectedCamera",value:function(e){this.selectedCamera=e}},{key:"setSelectedCameraSettings",value:function(e){this.selectedCameraSettings=e}},{key:"setupCameras",value:(I=Zr(ao.mark((function e(){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==this.cameraSetupPromise){e.next=2;break}return e.abrupt("return",this.cameraSetupPromise);case 2:return this.cameraSetupPromise=this.setupCamerasAndStream(),e.abrupt("return",this.cameraSetupPromise);case 4:case"end":return e.stop()}}),e,this)}))),function(){return I.apply(this,arguments)})},{key:"stopStream",value:(T=Zr(ao.mark((function t(){var n,r=this,i=arguments;return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=i.length>0&&void 0!==i[0]&&i[0],null!=this.activeCamera&&(this.activeCamera.currentResolution=void 0),this.activeCamera=void 0,this.torchEnabled=!1,this.gui.setTorchTogglerVisible(!1),this.gui.setCameraFOVSwitcherVisible(!1),null==this.mediaStream){t.next=17;break}return e.Logger.log(e.Logger.Level.DEBUG,"Stop camera video stream access".concat(n?" (abort access detection)":"",":"),this.mediaStream),document.removeEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener),window.clearTimeout(this.cameraAccessTimeout),window.clearInterval(this.videoMetadataCheckInterval),window.clearTimeout(this.getCapabilitiesTimeout),window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),window.clearInterval(this.autofocusInterval),this.gui.videoElement.pause(),t.abrupt("return",new Hr((function(e){setTimeout((function(){var t,i;null===(t=r.mediaStream)||void 0===t||t.getVideoTracks().forEach((function(e){e.removeEventListener("ended",r.videoTrackEndedListener),e.stop()})),r.gui.videoElement.srcObject=null,r.mediaStream=void 0,r.mediaTrackCapabilities=void 0,n||null===(i=r.abortedCameraInitializationResolveCallback)||void 0===i||i.call(r),e()}),0)})));case 17:case"end":return t.stop()}}),t,this)}))),function(){return T.apply(this,arguments)})},{key:"applyCameraSettings",value:(_=Zr(ao.mark((function e(n){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.selectedCameraSettings=n,null!=this.activeCamera){e.next=3;break}throw new $s(t.noCameraErrorParameters);case 3:return e.abrupt("return",this.initializeCameraWithSettings(this.activeCamera,n));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return _.apply(this,arguments)})},{key:"reinitializeCamera",value:(w=Zr(ao.mark((function t(){var n;return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=this.activeCamera){t.next=4;break}e.Logger.log(e.Logger.Level.DEBUG,"Camera reinitialization delayed"),t.next=18;break;case 4:return e.Logger.log(e.Logger.Level.DEBUG,"Reinitialize camera:",this.activeCamera),t.prev=5,n=this.activeCamera,t.next=9,this.stopStream();case 9:return t.next=11,this.initializeCameraWithSettings(n,this.activeCameraSettings);case 11:t.next=18;break;case 13:throw t.prev=13,t.t0=t.catch(5),e.Logger.log(e.Logger.Level.WARN,"Couldn't access camera:",this.activeCamera,t.t0),this.triggerCameraAccessError(t.t0),t.t0;case 18:case"end":return t.stop()}}),t,this,[[5,13]])}))),function(){return w.apply(this,arguments)})},{key:"initializeCameraWithSettings",value:(C=Zr(ao.mark((function e(n,r){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==this.cameraInitializationPromise){e.next=3;break}return e.next=3,this.cameraInitializationPromise;case 3:if(null!=n){e.next=5;break}throw new $s(t.noCameraErrorParameters);case 5:return this.setSelectedCamera(n),this.selectedCameraSettings=this.activeCameraSettings=r,this.cameraInitializationPromise=this.initializeCameraAndCheckUpdatedSettings(n),e.abrupt("return",this.cameraInitializationPromise);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return C.apply(this,arguments)})},{key:"setTorchEnabled",value:(A=Zr(ao.mark((function e(t){var n,r;return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==this.mediaStream||!0!==(null===(n=this.mediaTrackCapabilities)||void 0===n?void 0:n.torch)){e.next=6;break}if(this.torchEnabled=t,0===(r=this.mediaStream.getVideoTracks()).length||"function"!=typeof r[0].applyConstraints){e.next=6;break}return e.next=6,r[0].applyConstraints({advanced:[{torch:t}]});case 6:case"end":return e.stop()}}),e,this)}))),function(e){return A.apply(this,arguments)})},{key:"toggleTorch",value:(E=Zr(ao.mark((function e(){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.torchEnabled=!this.torchEnabled,e.next=3,this.setTorchEnabled(this.torchEnabled);case 3:case"end":return e.stop()}}),e,this)}))),function(){return E.apply(this,arguments)})},{key:"setZoom",value:(S=Zr(ao.mark((function e(t,n){var r,i,a,o;return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==this.mediaStream||null==(null===(r=this.mediaTrackCapabilities)||void 0===r?void 0:r.zoom)){e.next=7;break}if(0===(i=this.mediaStream.getVideoTracks()).length||"function"!=typeof i[0].applyConstraints){e.next=7;break}return a=this.mediaTrackCapabilities.zoom.max-this.mediaTrackCapabilities.zoom.min,o=Math.max(this.mediaTrackCapabilities.zoom.min,Math.min((null!=n?n:this.mediaTrackCapabilities.zoom.min)+a*t,this.mediaTrackCapabilities.zoom.max)),e.next=7,i[0].applyConstraints({advanced:[{zoom:o}]});case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)})},{key:"isCameraFOVSwitcherAllowed",value:function(){return this.cameraFOVSwitcherEnabled&&e.BrowserHelper.isIOSDeviceWithExtendedCameraAccess()&&null!=this.activeCamera&&(e.CameraAccess.isIOSWideBackCameraLabel(this.activeCamera.label)||e.CameraAccess.isIOSUltraWideBackCameraLabel(this.activeCamera.label))}},{key:"recoverStreamIfNeeded",value:(b=Zr(ao.mark((function e(){var t,n,r;return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("ended"!==(null==(r=null===(t=this.mediaStream)||void 0===t?void 0:t.getVideoTracks())||null===(n=r[0])||void 0===n?void 0:n.readyState)){e.next=4;break}return e.next=4,this.reinitializeCamera();case 4:case"end":return e.stop()}}),e,this)}))),function(){return b.apply(this,arguments)})},{key:"setupCamerasAndStream",value:(y=Zr(ao.mark((function t(){var n,r,i,a,o,s,c;return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,null!=this.selectedCamera){t.next=6;break}return this.gui.setVideoVisible(!1),t.next=5,this.accessInitialCamera();case 5:a=t.sent;case 6:return t.next=8,e.CameraAccess.getCameras(!1,!0);case 8:if(o=t.sent,this.cameraSwitcherEnabled&&o.length>1&&this.gui.setCameraSwitcherVisible(!0),s=null===(n=this.mediaStream)||void 0===n||null===(r=n.getVideoTracks()[0])||void 0===r||null===(i=r.getSettings)||void 0===i?void 0:i.call(r).deviceId,null==this.mediaStream||null==a){t.next=29;break}if(null==(c=1===o.length?o[0]:o.find((function(e){var t;return e.deviceId===s||""!==e.label&&e.label===(null===(t=a)||void 0===t?void 0:t.label)})))){t.next=28;break}if(e.CameraAccess.adjustCameraFromMediaStream(this.mediaStream,c),e.BrowserHelper.isDesktopDevice()&&(e.CameraAccess.mainCameraForTypeOverridesOnDesktop.set(this.cameraType,c),e.CameraAccess.mainCameraForTypeOverridesOnDesktop.set(c.cameraType,c)),1!==o.length&&e.CameraAccess.getMainCameraForType(o,this.cameraType)!==c){t.next=25;break}return e.Logger.log(e.Logger.Level.DEBUG,"Initial camera access was correct (main camera), keep camera:",c),this.setSelectedCamera(c),this.updateActiveCameraCurrentResolution(c),t.next=22,this.recoverStreamIfNeeded();case 22:return t.abrupt("return");case 25:e.Logger.log(e.Logger.Level.DEBUG,"Initial camera access was incorrect (not main camera), change camera",Cu(Cu({},a),{},{deviceId:s}));case 26:t.next=29;break;case 28:e.Logger.log(e.Logger.Level.DEBUG,"Initial camera access was incorrect (unknown camera), change camera",Cu(Cu({},a),{},{deviceId:s}));case 29:if(null!=this.selectedCamera){t.next=35;break}return t.next=32,this.accessAutoselectedCamera(o);case 32:return t.abrupt("return",t.sent);case 35:return t.next=37,this.initializeCameraWithSettings(this.selectedCamera,this.selectedCameraSettings);case 37:return t.abrupt("return",t.sent);case 38:return t.prev=38,this.gui.setVideoVisible(!0),this.cameraSetupPromise=void 0,t.finish(38);case 42:case"end":return t.stop()}}),t,this,[[0,,38,42]])}))),function(){return y.apply(this,arguments)})},{key:"getInitialCameraResolutionConstraint",value:function(){var t,n;switch(null===(t=this.activeCameraSettings)||void 0===t?void 0:t.resolutionPreference){case e.CameraSettings.ResolutionPreference.ULTRA_HD:n=yu.ULTRA_HD;break;case e.CameraSettings.ResolutionPreference.FULL_HD:n=yu.FULL_HD;break;case e.CameraSettings.ResolutionPreference.HD:default:n=yu.HD}return n}},{key:"accessAutoselectedCamera",value:(v=Zr(ao.mark((function n(r){var i;return ao.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=e.CameraAccess.sortCamerasForCameraType(r,this.cameraType),i=r.shift();case 2:if(null==i){n.next=20;break}return n.prev=3,n.next=6,this.initializeCameraWithSettings(i,this.selectedCameraSettings);case 6:return n.abrupt("return",n.sent);case 9:if(n.prev=9,n.t0=n.catch(3),this.setSelectedCamera(),1===r.length&&this.gui.setCameraSwitcherVisible(!1),!(r.length>=1)){n.next=17;break}return e.Logger.log(e.Logger.Level.WARN,"Couldn't access camera:",i,n.t0),i=r.shift(),n.abrupt("continue",2);case 17:throw n.t0;case 18:n.next=2;break;case 20:throw new $s(t.noCameraErrorParameters);case 21:case"end":return n.stop()}}),n,this,[[3,9]])}))),function(e){return v.apply(this,arguments)})},{key:"accessInitialCamera",value:(p=Zr(ao.mark((function e(){var t;return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={deviceId:"",label:"",cameraType:this.cameraType},e.prev=1,e.next=4,this.initializeCameraWithSettings(t,this.selectedCameraSettings);case 4:e.next=8;break;case 6:e.prev=6,e.t0=e.catch(1);case 8:return e.prev=8,this.setSelectedCamera(),e.finish(8);case 11:return e.abrupt("return",t);case 12:case"end":return e.stop()}}),e,this,[[1,6,8,11]])}))),function(){return p.apply(this,arguments)})},{key:"updateActiveCameraCurrentResolution",value:function(t){this.gui.videoElement.videoWidth>2&&this.gui.videoElement.videoHeight>2&&(t.currentResolution={width:this.gui.videoElement.videoWidth,height:this.gui.videoElement.videoHeight}),""!==t.deviceId&&(this.activeCamera=t,this.gui.setMirrorImageEnabled(this.gui.isMirrorImageEnabled(),!1),this.isCameraFOVSwitcherAllowed()&&(this.gui.setCameraFOVSwitcherState(e.CameraAccess.isIOSUltraWideBackCameraLabel(this.activeCamera.label)),this.gui.setCameraFOVSwitcherVisible(!0)))}},{key:"postStreamInitialization",value:function(){var e=this;window.clearTimeout(this.getCapabilitiesTimeout),this.getCapabilitiesTimeout=window.setTimeout((function(){var t;e.storeStreamCapabilities(),e.setupAutofocus(),e.torchToggleEnabled&&null!=e.mediaStream&&!0===(null===(t=e.mediaTrackCapabilities)||void 0===t?void 0:t.torch)&&e.gui.setTorchTogglerVisible(!0)}),t.getCapabilitiesTimeoutMs)}},{key:"videoResizeHandle",value:function(){null!=this.activeCamera&&this.updateActiveCameraCurrentResolution(this.activeCamera)}},{key:"checkCameraVideoStreamAccessIfVisible",value:function(){"visible"===document.visibilityState&&(e.Logger.log(e.Logger.Level.DEBUG,"Page is visible again, waiting for camera video stream start..."),document.removeEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener),this.setCameraAccessTimeout())}},{key:"videoTrackEndedRecovery",value:(g=Zr(ao.mark((function t(){return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.Logger.log(e.Logger.Level.DEBUG,'Detected video track "ended" event, try to reinitialize camera'),"visible"===document.visibilityState){t.next=6;break}e.Logger.log(e.Logger.Level.DEBUG,"Page is currently not visible, delay camera reinitialization until visible"),document.addEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener),t.next=13;break;case 6:return t.prev=6,t.next=9,this.reinitializeCamera();case 9:t.next=13;break;case 11:t.prev=11,t.t0=t.catch(6);case 13:case"end":return t.stop()}}),t,this,[[6,11]])}))),function(){return g.apply(this,arguments)})},{key:"videoTrackMuteRecovery",value:(f=Zr(ao.mark((function t(n){var r;return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==this.gui.videoElement.onloadeddata){t.next=4;break}return e.Logger.log(e.Logger.Level.DEBUG,'Detected video track "'.concat(n.type,'" event, delay camera video stream access detection')),this.setCameraAccessTimeout(),t.abrupt("return");case 4:(r="mute"===n.type)!==this.gui.isCameraRecoveryVisible()&&(e.Logger.log(e.Logger.Level.DEBUG,'Detected video track "'.concat(n.type,'" event, ').concat(r?"enable":"disable"," camera recovery")),this.gui.setCameraRecoveryVisible(r));case 6:case"end":return t.stop()}}),t,this)}))),function(e){return f.apply(this,arguments)})},{key:"triggerManualFocusForContinuous",value:(m=Zr(ao.mark((function e(){var n,r,i,a=this;return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=this.mediaStream){e.next=2;break}return e.abrupt("return");case 2:if(this.manualToAutofocusResumeTimeout=window.setTimeout(Zr(ao.mark((function e(){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.triggerFocusMode(vu.CONTINUOUS);case 2:case"end":return e.stop()}}),e)}))),t.manualToAutofocusResumeTimeoutMs),n=!0,0!==(r=this.mediaStream.getVideoTracks()).length&&"function"==typeof r[0].getConstraints&&(n=!0===(null===(i=r[0].getConstraints().advanced)||void 0===i?void 0:i.some((function(e){return e.focusMode===vu.MANUAL})))),!n){e.next=12;break}return e.next=9,this.triggerFocusMode(vu.CONTINUOUS);case 9:this.manualFocusWaitTimeout=window.setTimeout(Zr(ao.mark((function e(){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.triggerFocusMode(vu.MANUAL);case 2:case"end":return e.stop()}}),e)}))),t.manualFocusWaitTimeoutMs),e.next=14;break;case 12:return e.next=14,this.triggerFocusMode(vu.MANUAL);case 14:case"end":return e.stop()}}),e,this)}))),function(){return m.apply(this,arguments)})},{key:"triggerManualFocusForSingleShot",value:(h=Zr(ao.mark((function e(){var n=this;return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return window.clearInterval(this.autofocusInterval),this.manualToAutofocusResumeTimeout=window.setTimeout((function(){n.autofocusInterval=window.setInterval(n.triggerAutoFocus.bind(n),t.autofocusIntervalMs)}),t.manualToAutofocusResumeTimeoutMs),e.prev=2,e.next=5,this.triggerFocusMode(vu.SINGLE_SHOT);case 5:e.next=9;break;case 7:e.prev=7,e.t0=e.catch(2);case 9:case"end":return e.stop()}}),e,this,[[2,7]])}))),function(){return h.apply(this,arguments)})},{key:"triggerManualFocus",value:(d=Zr(ao.mark((function e(t){var n;return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==t){e.next=7;break}if(t.preventDefault(),"touchend"!==t.type||0===t.touches.length){e.next=4;break}return e.abrupt("return");case 4:if(null==this.pinchToZoomDistance){e.next=7;break}return this.pinchToZoomDistance=void 0,e.abrupt("return");case 7:if(window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),null==this.mediaStream||null==this.mediaTrackCapabilities){e.next=20;break}if(!((n=this.mediaTrackCapabilities.focusMode)instanceof Array)){e.next=20;break}if(!n.includes(vu.CONTINUOUS)||!n.includes(vu.MANUAL)){e.next=17;break}return e.next=15,this.triggerManualFocusForContinuous();case 15:e.next=20;break;case 17:if(!n.includes(vu.SINGLE_SHOT)){e.next=20;break}return e.next=20,this.triggerManualFocusForSingleShot();case 20:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"triggerZoomStart",value:function(e){var t;if(2===(null==e?void 0:e.touches.length)&&(e.preventDefault(),this.pinchToZoomDistance=Math.hypot((e.touches[1].screenX-e.touches[0].screenX)/screen.width,(e.touches[1].screenY-e.touches[0].screenY)/screen.height),null!=this.mediaStream&&null!=(null===(t=this.mediaTrackCapabilities)||void 0===t?void 0:t.zoom))){var n=this.mediaStream.getVideoTracks();if(0!==n.length&&"function"==typeof n[0].getConstraints){this.pinchToZoomInitialZoom=this.mediaTrackCapabilities.zoom.min;var r=n[0].getConstraints();if(null!=r.advanced){var i=r.advanced.find((function(e){return"zoom"in e}));null!=(null==i?void 0:i.zoom)&&(this.pinchToZoomInitialZoom=i.zoom)}}}}},{key:"triggerZoomMove",value:(l=Zr(ao.mark((function e(t){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=this.pinchToZoomDistance&&2===(null==t?void 0:t.touches.length)){e.next=2;break}return e.abrupt("return");case 2:return t.preventDefault(),e.next=5,this.setZoom(2*(Math.hypot((t.touches[1].screenX-t.touches[0].screenX)/screen.width,(t.touches[1].screenY-t.touches[0].screenY)/screen.height)-this.pinchToZoomDistance),this.pinchToZoomInitialZoom);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"storeStreamCapabilities",value:function(){if(null!=this.mediaStream){var e=this.mediaStream.getVideoTracks();0!==e.length&&"function"==typeof e[0].getCapabilities&&(this.mediaTrackCapabilities=e[0].getCapabilities())}var t;null!=this.activeCamera&&this.scanner.reportCameraProperties(this.activeCamera.cameraType,null==(null===(t=this.mediaTrackCapabilities)||void 0===t?void 0:t.focusMode)||this.mediaTrackCapabilities.focusMode.includes(vu.CONTINUOUS))}},{key:"setupAutofocus",value:function(){if(window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),null!=this.mediaStream&&null!=this.mediaTrackCapabilities){var e=this.mediaTrackCapabilities.focusMode;e instanceof Array&&!e.includes(vu.CONTINUOUS)&&e.includes(vu.SINGLE_SHOT)&&(window.clearInterval(this.autofocusInterval),this.autofocusInterval=window.setInterval(this.triggerAutoFocus.bind(this),t.autofocusIntervalMs))}}},{key:"triggerAutoFocus",value:(u=Zr(ao.mark((function e(){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.triggerFocusMode(vu.SINGLE_SHOT);case 2:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"triggerFocusMode",value:(c=Zr(ao.mark((function e(t){var n;return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==this.mediaStream){e.next=10;break}if(0===(n=this.mediaStream.getVideoTracks()).length||"function"!=typeof n[0].applyConstraints){e.next=10;break}return e.prev=3,e.next=6,n[0].applyConstraints({advanced:[{focusMode:t}]});case 6:e.next=10;break;case 8:e.prev=8,e.t0=e.catch(3);case 10:case"end":return e.stop()}}),e,this,[[3,8]])}))),function(e){return c.apply(this,arguments)})},{key:"enableTapToFocusListeners",value:function(){var e=this;["touchend","mousedown"].forEach((function(t){e.gui.videoElement.addEventListener(t,e.triggerManualFocusListener)}))}},{key:"enablePinchToZoomListeners",value:function(){this.gui.videoElement.addEventListener("touchstart",this.triggerZoomStartListener),this.gui.videoElement.addEventListener("touchmove",this.triggerZoomMoveListener)}},{key:"disableTapToFocusListeners",value:function(){var e=this;["touchend","mousedown"].forEach((function(t){e.gui.videoElement.removeEventListener(t,e.triggerManualFocusListener)}))}},{key:"disablePinchToZoomListeners",value:function(){this.gui.videoElement.removeEventListener("touchstart",this.triggerZoomStartListener),this.gui.videoElement.removeEventListener("touchmove",this.triggerZoomMoveListener)}},{key:"initializeCameraAndCheckUpdatedSettings",value:(s=Zr(ao.mark((function e(t){var n=this;return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.initializeCameraForResolution(t);case 3:if(this.selectedCameraSettings===this.activeCameraSettings||null!=this.selectedCameraSettings&&null!=this.activeCameraSettings&&!Object.keys(this.selectedCameraSettings).some((function(e){return n.selectedCameraSettings[e]!==n.activeCameraSettings[e]}))){e.next=8;break}return this.activeCameraSettings=this.selectedCameraSettings,e.next=7,this.initializeCameraAndCheckUpdatedSettings(t);case 7:return e.abrupt("return",e.sent);case 8:return e.prev=8,this.cameraInitializationPromise=void 0,e.finish(8);case 11:case"end":return e.stop()}}),e,this,[[0,,8,11]])}))),function(e){return s.apply(this,arguments)})},{key:"handleCameraInitializationError",value:(o=Zr(ao.mark((function t(n,r,i){var a;return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(["OverconstrainedError","NotReadableError"].includes(i.name)&&("NotReadableError"!==i.name||r!==yu.NONE)){t.next=4;break}throw e.Logger.log(e.Logger.Level.DEBUG,"Camera video stream access failure (unrecoverable error)",n,i),"NotAllowedError"!==i.name&&e.CameraAccess.markCameraAsInaccessible(n),i;case 4:if("OverconstrainedError"!==i.name||r!==yu.NONE){t.next=20;break}if(""!==n.deviceId){t.next=8;break}throw e.Logger.log(e.Logger.Level.DEBUG,"Camera video stream access failure (no camera with such type error)",n,i),i;case 8:return e.Logger.log(e.Logger.Level.DEBUG,"Detected non-existent deviceId error, attempt to find and reaccess updated camera",n,i),a=n.deviceId,t.next=12,e.CameraAccess.getCameras(!0);case 12:if(a!==n.deviceId){t.next=18;break}throw e.Logger.log(e.Logger.Level.DEBUG,"Camera video stream access failure (updated camera not found after non-existent deviceId error)",n,i),e.CameraAccess.markCameraAsInaccessible(n),i;case 18:return e.Logger.log(e.Logger.Level.DEBUG,"Updated camera found (recovered from non-existent deviceId error), attempt to access it",n),t.abrupt("return",this.initializeCameraForResolution(n));case 20:return t.abrupt("return",this.initializeCameraForResolution(n,r+1));case 21:case"end":return t.stop()}}),t,this)}))),function(e,t,n){return o.apply(this,arguments)})},{key:"updateStreamForResolution",value:(a=Zr(ao.mark((function t(n,r){var i=this;return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=this.mediaStream){t.next=5;break}return t.next=3,this.initializeCameraForResolution(n,r);case 3:t.next=22;break;case 5:return t.prev=5,e.Logger.log(e.Logger.Level.DEBUG,"Setting new resolution for active camera video stream..."),t.next=9,this.mediaStream.getVideoTracks()[0].applyConstraints(e.CameraAccess.getUserMediaVideoParams(r));case 9:return t.next=11,new Hr((function(e){i.gui.videoElement.addEventListener("timeupdate",(function(){e()}),{once:!0})}));case 11:e.Logger.log(e.Logger.Level.DEBUG,"New active camera video stream resolution set"),t.next=22;break;case 14:if(t.prev=14,t.t0=t.catch(5),r!==yu.NONE){t.next=20;break}throw t.t0;case 20:return t.next=22,this.updateStreamForResolution(n,r+1);case 22:case"end":return t.stop()}}),t,this,[[5,14]])}))),function(e,t){return a.apply(this,arguments)})},{key:"initializeStreamForResolution",value:(i=Zr(ao.mark((function n(r,i){var a,o,s=this;return ao.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.stopStream();case 2:return n.prev=2,n.next=5,e.CameraAccess.accessCameraStream(i,r);case 5:if(a=n.sent,e.Logger.log(e.Logger.Level.DEBUG,"Camera accessed, waiting for camera video stream start..."),"function"!=typeof a.getVideoTracks()[0].getSettings){n.next=16;break}if(null==(o=a.getVideoTracks()[0].getSettings()).width||null==o.height||2!==o.width&&2!==o.height){n.next=16;break}if(e.Logger.log(e.Logger.Level.DEBUG,"Camera video stream access failure (invalid video metadata):",r),i!==yu.NONE){n.next=15;break}throw new $s(t.notReadableErrorParameters);case 15:case 29:return n.abrupt("return",this.initializeStreamForResolution(r,i+1));case 16:return this.mediaStream=a,this.mediaStream.getVideoTracks().forEach((function(e){e.addEventListener("ended",s.videoTrackEndedListener),e.addEventListener("mute",s.videoTrackMuteListener),e.addEventListener("unmute",s.videoTrackMuteListener)})),n.prev=18,n.next=21,this.setupCameraStreamVideo(r,a);case 21:n.next=30;break;case 23:if(n.prev=23,n.t0=n.catch(18),i!==yu.NONE){n.next=29;break}throw n.t0;case 30:n.next=35;break;case 32:return n.prev=32,n.t1=n.catch(2),n.abrupt("return",this.handleCameraInitializationError(r,i,n.t1));case 35:case"end":return n.stop()}}),n,this,[[2,32],[18,23]])}))),function(e,t){return i.apply(this,arguments)})},{key:"initializeCameraForResolution",value:(r=Zr(ao.mark((function t(n,r){var i,a;return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.gui.setCameraRecoveryVisible(!1),a=null!=r?r:this.getInitialCameraResolutionConstraint(),null==this.mediaStream||""===n.deviceId||(null===(i=this.activeCamera)||void 0===i?void 0:i.deviceId)!==n.deviceId){t.next=7;break}return t.next=5,e.BrowserHelper.isIPhone()?this.initializeStreamForResolution(n,a):this.updateStreamForResolution(n,a);case 5:t.next=9;break;case 7:return t.next=9,this.initializeStreamForResolution(n,a);case 9:case"end":return t.stop()}}),t,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"setCameraAccessTimeout",value:function(){var n=this;window.clearTimeout(this.cameraAccessTimeout),this.cameraAccessTimeout=window.setTimeout(Zr(ao.mark((function r(){var i;return ao.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("visible"===document.visibilityState){r.next=5;break}e.Logger.log(e.Logger.Level.DEBUG,"Page is currently not visible, delay camera video stream access detection"),document.addEventListener("visibilitychange",n.checkCameraVideoStreamAccessIfVisibleListener),r.next=8;break;case 5:return r.next=7,n.stopStream(!0);case 7:null===(i=n.cameraAccessRejectCallback)||void 0===i||i.call(n,new $s(t.notReadableErrorParameters));case 8:case"end":return r.stop()}}),r)}))),t.cameraAccessTimeoutMs)}},{key:"checkCameraAccess",value:function(t){var n=this;return new Hr((function(r,i){n.cameraAccessRejectCallback=function(r){e.Logger.log(e.Logger.Level.DEBUG,"Camera video stream access failure (video data load timeout):",t),n.gui.setCameraRecoveryVisible(!0),i(r)},n.setCameraAccessTimeout()}))}},{key:"checkVideoMetadata",value:(n=Zr(ao.mark((function n(r){var i=this;return ao.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Hr((function(n,a){i.gui.videoElement.onloadeddata=function(){if(i.gui.videoElement.onloadeddata=null,window.clearTimeout(i.cameraAccessTimeout),i.gui.videoElement.videoWidth>2&&i.gui.videoElement.videoHeight>2&&i.gui.videoElement.currentTime>0)return i.updateActiveCameraCurrentResolution(r),e.Logger.log(e.Logger.Level.DEBUG,"Camera video stream access success:",r),n();var o=performance.now();window.clearInterval(i.videoMetadataCheckInterval),i.videoMetadataCheckInterval=window.setInterval(Zr(ao.mark((function s(){return ao.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if(!(i.gui.videoElement.videoWidth<=2||i.gui.videoElement.videoHeight<=2||0===i.gui.videoElement.currentTime)){s.next=8;break}if(!(performance.now()-o>t.videoMetadataCheckTimeoutMs)){s.next=7;break}return e.Logger.log(e.Logger.Level.DEBUG,"Camera video stream access failure (valid video metadata timeout):",r),window.clearInterval(i.videoMetadataCheckInterval),s.next=6,i.stopStream(!0);case 6:return s.abrupt("return",a(new $s(t.notReadableErrorParameters)));case 7:return s.abrupt("return");case 8:window.clearInterval(i.videoMetadataCheckInterval),i.updateActiveCameraCurrentResolution(r),e.Logger.log(e.Logger.Level.DEBUG,"Camera video stream access success:",r),n();case 12:case"end":return s.stop()}}),s)}))),t.videoMetadataCheckIntervalMs)}})));case 1:case"end":return n.stop()}}),n)}))),function(e){return n.apply(this,arguments)})},{key:"setupCameraStreamVideo",value:function(e,t){var n=this;this.gui.videoElement.addEventListener("loadedmetadata",this.postStreamInitializationListener),this.gui.videoElement.addEventListener("resize",this.videoResizeListener),this.tapToFocusEnabled&&this.enableTapToFocusListeners(),this.pinchToZoomEnabled&&this.enablePinchToZoomListeners();var r=Hr.race([this.checkCameraAccess(e),this.checkVideoMetadata(e),new Hr((function(e){n.abortedCameraInitializationResolveCallback=e}))]);return this.gui.videoElement.srcObject=t,this.gui.videoElement.load(),this.gui.playVideo(),this.scanner.reportCameraProperties(e.cameraType),r}}]),t}();ec(wu,"cameraAccessTimeoutMs",4e3),ec(wu,"videoMetadataCheckTimeoutMs",4e3),ec(wu,"videoMetadataCheckIntervalMs",50),ec(wu,"getCapabilitiesTimeoutMs",500),ec(wu,"autofocusIntervalMs",1500),ec(wu,"manualToAutofocusResumeTimeoutMs",5e3),ec(wu,"manualFocusWaitTimeoutMs",400),ec(wu,"noCameraErrorParameters",{name:"NoCameraAvailableError",message:"No camera available"}),ec(wu,"notReadableErrorParameters",{name:"NotReadableError",message:"Could not initialize camera correctly"});var _u=function(e){Ko(f,e);var t,n,r,i,a,o,s,c,u,l,d,h,m=(d=f,h=function(){if("undefined"==typeof Reflect||!zo)return!1;if(zo.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(zo(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=es(d);if(h){var n=es(this).constructor;e=zo(t,arguments,n)}else e=t.apply(this,arguments);return $o(this,e)});function f(){return qo(this,f),m.apply(this,arguments)}return Zo(f,[{key:"setInteractionOptions",value:function(e,t,n,r){}},{key:"isCameraSwitcherEnabled",value:function(){return!1}},{key:"setCameraSwitcherEnabled",value:(l=Zr(ao.mark((function e(t){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 1:case"end":return e.stop()}}),e)}))),function(e){return l.apply(this,arguments)})},{key:"isTorchToggleEnabled",value:function(){return!1}},{key:"setTorchToggleEnabled",value:function(e){}},{key:"isTapToFocusEnabled",value:function(){return!1}},{key:"setTapToFocusEnabled",value:function(e){}},{key:"isPinchToZoomEnabled",value:function(){return!1}},{key:"setPinchToZoomEnabled",value:function(e){}},{key:"setInitialCameraType",value:function(e){}},{key:"setCameraType",value:(u=Zr(ao.mark((function e(t){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 1:case"end":return e.stop()}}),e)}))),function(e){return u.apply(this,arguments)})},{key:"setSelectedCamera",value:function(e){}},{key:"setSelectedCameraSettings",value:function(e){}},{key:"setupCameras",value:(c=Zr(ao.mark((function e(){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 1:case"end":return e.stop()}}),e)}))),function(){return c.apply(this,arguments)})},{key:"stopStream",value:(s=Zr(ao.mark((function e(){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 1:case"end":return e.stop()}}),e)}))),function(){return s.apply(this,arguments)})},{key:"applyCameraSettings",value:(o=Zr(ao.mark((function e(t){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 1:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)})},{key:"reinitializeCamera",value:(a=Zr(ao.mark((function e(){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 1:case"end":return e.stop()}}),e)}))),function(){return a.apply(this,arguments)})},{key:"initializeCameraWithSettings",value:(i=Zr(ao.mark((function e(t,n){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 1:case"end":return e.stop()}}),e)}))),function(e,t){return i.apply(this,arguments)})},{key:"setTorchEnabled",value:(r=Zr(ao.mark((function e(t){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 1:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"toggleTorch",value:(n=Zr(ao.mark((function e(){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 1:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"setZoom",value:(t=Zr(ao.mark((function e(t,n){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 1:case"end":return e.stop()}}),e)}))),function(e,n){return t.apply(this,arguments)})}]),f}(wu),Tu=S,Iu=Ie,Nu=hi,Mu=mi,Lu=tt,ku=X,xu=Object.assign,Vu=!xu||b((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=xu({},e)[n]||Object.keys(xu({},t)).join("")!=r}))?function(e,t){for(var n=Lu(e),r=arguments.length,i=1,a=Nu.f,o=Mu.f;r>i;)for(var s,c=ku(arguments[i++]),u=a?Iu(c).concat(a(c)):Iu(c),l=u.length,d=0;l>d;)s=u[d++],Tu&&!o.call(c,s)||(n[s]=c[s]);return n}:xu,Ou=W;Ou(Ou.S+Ou.F,"Object",{assign:Vu});var Du,Ru=l.exports.Object.assign,ju=[],Fu="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(Du||(Du={}));var Pu,Uu,Gu,Bu,zu,Wu,Yu=function(e){return Object.freeze(e)},Hu=function(e,t){this.inlineSize=e,this.blockSize=t,Yu(this)},Qu=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Yu(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Zu=function(e){return e instanceof SVGElement&&"getBBox"in e},qu=function(e){if(Zu(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var i=e,a=i.offsetWidth,o=i.offsetHeight;return!(a||o||e.getClientRects().length)},Xu=function(e){var t;if(e instanceof Element)return!0;var n=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},Ju="undefined"!=typeof window?window:{},Ku=new WeakMap,$u=/auto|scroll/,el=/^tb|vertical/,tl=/msie|trident/i.test(Ju.navigator&&Ju.navigator.userAgent),nl=function(e){return parseFloat(e||"0")},rl=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new Hu((n?t:e)||0,(n?e:t)||0)},il=Yu({devicePixelContentBoxSize:rl(),borderBoxSize:rl(),contentBoxSize:rl(),contentRect:new Qu(0,0,0,0)}),al=function(e,t){if(void 0===t&&(t=!1),Ku.has(e)&&!t)return Ku.get(e);if(qu(e))return Ku.set(e,il),il;var n=getComputedStyle(e),r=Zu(e)&&e.ownerSVGElement&&e.getBBox(),i=!tl&&"border-box"===n.boxSizing,a=el.test(n.writingMode||""),o=!r&&$u.test(n.overflowY||""),s=!r&&$u.test(n.overflowX||""),c=r?0:nl(n.paddingTop),u=r?0:nl(n.paddingRight),l=r?0:nl(n.paddingBottom),d=r?0:nl(n.paddingLeft),h=r?0:nl(n.borderTopWidth),m=r?0:nl(n.borderRightWidth),f=r?0:nl(n.borderBottomWidth),g=d+u,p=c+l,v=(r?0:nl(n.borderLeftWidth))+m,y=h+f,b=s?e.offsetHeight-y-e.clientHeight:0,S=o?e.offsetWidth-v-e.clientWidth:0,E=i?g+v:0,A=i?p+y:0,C=r?r.width:nl(n.width)-E-S,w=r?r.height:nl(n.height)-A-b,_=C+g+S+v,T=w+p+b+y,I=Yu({devicePixelContentBoxSize:rl(Math.round(C*devicePixelRatio),Math.round(w*devicePixelRatio),a),borderBoxSize:rl(_,T,a),contentBoxSize:rl(C,w,a),contentRect:new Qu(d,c,C,w)});return Ku.set(e,I),I},ol=function(e,t,n){var r=al(e,n),i=r.borderBoxSize,a=r.contentBoxSize,o=r.devicePixelContentBoxSize;switch(t){case Du.DEVICE_PIXEL_CONTENT_BOX:return o;case Du.BORDER_BOX:return i;default:return a}},sl=function(e){var t=al(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=Yu([t.borderBoxSize]),this.contentBoxSize=Yu([t.contentBoxSize]),this.devicePixelContentBoxSize=Yu([t.devicePixelContentBoxSize])},cl=function(e){if(qu(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},ul=function(){var e=1/0,t=[];ju.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(t){var n=new sl(t.target),i=cl(t.target);r.push(n),t.lastReportedSize=ol(t.target,t.observedBox),i<e&&(e=i)})),t.push((function(){n.callback.call(n.observer,r,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var n=0,r=t;n<r.length;n++)(0,r[n])();return e},ll=function(e){ju.forEach((function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach((function(n){n.isActive()&&(cl(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},dl=[],hl=0,ml={attributes:!0,characterData:!0,childList:!0,subtree:!0},fl=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],gl=function(e){return void 0===e&&(e=0),Date.now()+e},pl=!1,vl=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!pl){pl=!0;var n,r=gl(e);n=function(){var n=!1;try{n=function(){var e,t=0;for(ll(t);ju.some((function(e){return e.activeTargets.length>0}));)t=ul(),ll(t);return ju.some((function(e){return e.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:Fu}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=Fu),window.dispatchEvent(e)),t>0}()}finally{if(pl=!1,e=r-gl(),!hl)return;n?t.run(1e3):e>0?t.run(e):t.start()}},function(e){if(!Pu){var t=0,r=document.createTextNode("");new MutationObserver((function(){return dl.splice(0).forEach((function(e){return e()}))})).observe(r,{characterData:!0}),Pu=function(){r.textContent="".concat(t?t--:t++)}}dl.push((function(){requestAnimationFrame(n)})),Pu()}()}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,ml)};document.body?t():Ju.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),fl.forEach((function(t){return Ju.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),fl.forEach((function(t){return Ju.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),yl=function(e){!hl&&e>0&&vl.start(),!(hl+=e)&&vl.stop()},bl=function(){function e(e,t){this.target=e,this.observedBox=t||Du.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=ol(this.target,this.observedBox,!0);return e=this.target,Zu(e)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),Sl=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},El=new WeakMap,Al=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},Cl=function(){function e(){}return e.connect=function(e,t){var n=new Sl(e,t);El.set(e,n)},e.observe=function(e,t,n){var r=El.get(e),i=0===r.observationTargets.length;Al(r.observationTargets,t)<0&&(i&&ju.push(r),r.observationTargets.push(new bl(t,n&&n.box)),yl(1),vl.schedule())},e.unobserve=function(e,t){var n=El.get(e),r=Al(n.observationTargets,t),i=1===n.observationTargets.length;r>=0&&(i&&ju.splice(ju.indexOf(n),1),n.observationTargets.splice(r,1),yl(-1))},e.disconnect=function(e){var t=this,n=El.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},e}(),wl=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Cl.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Xu(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Cl.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Xu(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Cl.unobserve(this,e)},e.prototype.disconnect=function(){Cl.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),_l=null!==(Uu=window.ResizeObserver)&&void 0!==Uu?Uu:wl,Tl=function(){function t(n){var r=this;qo(this,t),ec(this,"videoElement",void 0),ec(this,"cameraSwitcherElement",void 0),ec(this,"cameraFOVSwitcherElement",void 0),ec(this,"cameraFOVSwitcherUltraWideElement",void 0),ec(this,"cameraFOVSwitcherWideElement",void 0),ec(this,"torchTogglerElement",void 0),ec(this,"cameraRecoveryElement",void 0),ec(this,"scanner",void 0),ec(this,"singleImageModeEnabled",void 0),ec(this,"singleImageModeSettings",void 0),ec(this,"grandParentElement",void 0),ec(this,"parentElement",void 0),ec(this,"laserContainerElement",void 0),ec(this,"laserActiveImageElement",void 0),ec(this,"laserPausedImageElement",void 0),ec(this,"viewfinderElement",void 0),ec(this,"cameraUploadElement",void 0),ec(this,"cameraUploadLabelElement",void 0),ec(this,"cameraUploadInputElement",void 0),ec(this,"cameraUploadProgressElement",void 0),ec(this,"visibilityListener",void 0),ec(this,"videoPauseListener",void 0),ec(this,"videoResizeListener",void 0),ec(this,"webGLContextLostListener",void 0),ec(this,"newScanSettingsListener",void 0),ec(this,"contextCreatedShowLogoListener",void 0),ec(this,"contextCreatedActivateGUIListener",void 0),ec(this,"resizeObserver",void 0),ec(this,"cameraUploadCallback",void 0),ec(this,"mirrorImageOverrides",void 0),ec(this,"contextWebGL",void 0),ec(this,"context2d",void 0),ec(this,"cameraManager",void 0),ec(this,"originElement",void 0),ec(this,"scanningPaused",void 0),ec(this,"visible",void 0),ec(this,"guiStyle",void 0),ec(this,"videoFit",void 0),ec(this,"customLaserArea",void 0),ec(this,"customViewfinderArea",void 0),ec(this,"cameraUploadInProgress",void 0),ec(this,"cameraSwitchInProgress",void 0),ec(this,"dataCaptureContextCreated",void 0),ec(this,"isVideoElementDetached",!1),this.scanner=n.scanner,this.originElement=n.originElement,this.singleImageModeEnabled=n.singleImageModeEnabled,this.singleImageModeSettings=n.singleImageModeSettings,this.scanningPaused=n.scanningPaused,this.cameraUploadCallback=n.cameraUploadCallback,this.mirrorImageOverrides=new qs,this.cameraUploadInProgress=!1,this.cameraSwitchInProgress=!1,this.dataCaptureContextCreated=!1,this.grandParentElement=document.createElement("div"),this.grandParentElement.className=t.grandParentElementClassName,this.originElement.appendChild(this.grandParentElement),this.parentElement=document.createElement("div"),this.parentElement.className=t.parentElementClassName,this.grandParentElement.appendChild(this.parentElement),this.videoElement=document.createElement("video"),this.cameraSwitcherElement=document.createElement("img"),this.cameraFOVSwitcherElement=document.createElement("div"),this.cameraFOVSwitcherUltraWideElement=document.createElement("img"),this.cameraFOVSwitcherWideElement=document.createElement("img"),this.torchTogglerElement=document.createElement("img"),this.laserContainerElement=document.createElement("div"),this.laserActiveImageElement=document.createElement("img"),this.laserPausedImageElement=document.createElement("img"),this.cameraRecoveryElement=document.createElement("div"),this.viewfinderElement=document.createElement("div");var i=document.createElement("canvas");this.webGLContextLostListener=this.handleWebGLContextLost.bind(this),n.singleImageModeEnabled?(this.context2d=i.getContext("2d"),this.cameraUploadElement=document.createElement("div"),this.cameraUploadLabelElement=document.createElement("label"),this.cameraUploadInputElement=document.createElement("input"),this.cameraUploadProgressElement=document.createElement("div"),this.setupCameraUploadGuiAssets(),this.guiStyle=e.BarcodePicker.GuiStyle.NONE):(this.setupContext(i),this.setupVideoElement(),this.setupCameraSwitcher(),this.setupCameraFOVSwitcher(),this.setupTorchToggler(),this.setupCameraRecovery(n.cameraRecoveryText),this.setupFullGuiAssets(),this.setGuiStyle(n.guiStyle),this.setVideoFit(n.videoFit),this.setLaserArea(n.laserArea),this.setViewfinderArea(n.viewfinderArea),this.visibilityListener=this.checkAndRecoverPlayback.bind(this),document.addEventListener("visibilitychange",this.visibilityListener),this.newScanSettingsListener=this.handleNewScanSettings.bind(this),this.scanner.on("newScanSettings",this.newScanSettingsListener),this.handleNewScanSettings(),this.videoPauseListener=this.handleVideoPause.bind(this),this.videoElement.addEventListener("pause",this.videoPauseListener),this.videoResizeListener=this.handleVideoResize.bind(this),this.videoElement.addEventListener("resize",this.videoResizeListener)),n.hideLogo?(this.contextCreatedShowLogoListener=this.showScanditLogo.bind(this,n.hideLogo),this.scanner.on("contextCreated",this.contextCreatedShowLogoListener)):this.showScanditLogo(n.hideLogo),this.contextCreatedActivateGUIListener=this.activateGUI.bind(this),this.scanner.on("contextCreated",this.contextCreatedActivateGUIListener),this.resize(),this.resizeObserver=new _l((function(e){null!=typeof window.requestAnimationFrame?window.requestAnimationFrame((function(){r.resize(e[0])})):r.resize(e[0])})),this.resizeObserver.observe(this.originElement),this.setVisible(n.visible)}var n,r,i,a,o,s;return Zo(t,[{key:"destroy",value:function(){var e,n,r,i;null!=this.visibilityListener&&document.removeEventListener("visibilitychange",this.visibilityListener),null!=this.newScanSettingsListener&&this.scanner.removeListener("newScanSettings",this.newScanSettingsListener),null!=this.videoPauseListener&&this.videoElement.removeEventListener("pause",this.videoPauseListener),null!=this.videoResizeListener&&this.videoElement.removeEventListener("resize",this.videoResizeListener),null!=this.contextCreatedShowLogoListener&&this.scanner.removeListener("contextCreated",this.contextCreatedShowLogoListener),null!=this.contextCreatedActivateGUIListener&&this.scanner.removeListener("contextCreated",this.contextCreatedActivateGUIListener),this.resizeObserver.disconnect(),this.grandParentElement.remove(),this.videoElement.remove(),null===(e=this.contextWebGL)||void 0===e||null===(n=e.canvas)||void 0===n||n.removeEventListener("webglcontextlost",this.webGLContextLostListener),null===(r=this.contextWebGL)||void 0===r||null===(i=r.getExtension("WEBGL_lose_context"))||void 0===i||i.loseContext(),this.contextWebGL=void 0,this.context2d=void 0,this.originElement.classList.remove(t.hiddenClassName)}},{key:"setCameraManager",value:function(e){this.cameraManager=e}},{key:"pauseScanning",value:function(){this.scanningPaused=!0,this.laserActiveImageElement.classList.add(t.hiddenOpacityClassName),this.laserPausedImageElement.classList.remove(t.hiddenOpacityClassName),this.viewfinderElement.classList.add(t.pausedClassName)}},{key:"resumeScanning",value:function(){this.scanningPaused=!1,this.dataCaptureContextCreated&&(this.laserPausedImageElement.classList.add(t.hiddenOpacityClassName),this.laserActiveImageElement.classList.remove(t.hiddenOpacityClassName),this.viewfinderElement.classList.remove(t.pausedClassName))}},{key:"isVisible",value:function(){return this.visible}},{key:"setVisible",value:function(n){this.visible=n,n?(this.originElement.classList.remove(t.hiddenClassName),this.guiStyle===e.BarcodePicker.GuiStyle.LASER?this.laserActiveImageElement.classList.remove(t.flashColorClassName):this.guiStyle===e.BarcodePicker.GuiStyle.VIEWFINDER&&this.viewfinderElement.classList.remove(t.flashWhiteClassName)):this.originElement.classList.add(t.hiddenClassName)}},{key:"isMirrorImageEnabled",value:function(){var t,n;if(null!=(null===(t=this.cameraManager)||void 0===t?void 0:t.selectedCamera)&&null!=(null===(n=this.cameraManager)||void 0===n?void 0:n.activeCamera)){var r=this.mirrorImageOverrides.get(this.cameraManager.activeCamera);return null!=r?r:this.cameraManager.activeCamera.cameraType===e.Camera.Type.FRONT}return!1}},{key:"setMirrorImageEnabled",value:function(e,n){var r;null!=(null===(r=this.cameraManager)||void 0===r?void 0:r.selectedCamera)&&(e?this.videoElement.classList.add(t.mirroredClassName):this.videoElement.classList.remove(t.mirroredClassName),n&&this.mirrorImageOverrides.set(this.cameraManager.selectedCamera,e))}},{key:"setGuiStyle",value:function(n){if(!this.singleImageModeEnabled)switch(n){case e.BarcodePicker.GuiStyle.LASER:this.guiStyle=n,this.laserContainerElement.classList.remove(t.hiddenClassName),this.viewfinderElement.classList.add(t.hiddenClassName);break;case e.BarcodePicker.GuiStyle.VIEWFINDER:this.guiStyle=n,this.laserContainerElement.classList.add(t.hiddenClassName),this.viewfinderElement.classList.remove(t.hiddenClassName);break;case e.BarcodePicker.GuiStyle.NONE:default:this.guiStyle=e.BarcodePicker.GuiStyle.NONE,this.laserContainerElement.classList.add(t.hiddenClassName),this.viewfinderElement.classList.add(t.hiddenClassName)}}},{key:"setLaserArea",value:function(e){this.customLaserArea=e,null==e&&(e=this.scanner.getScanSettings().getSearchArea());var t=.95;this.laserContainerElement.style.left="".concat(100*(.025+e.x*t),"%"),this.laserContainerElement.style.width="".concat(e.width*t*100,"%"),this.laserContainerElement.style.top="".concat(100*(.025+e.y*t),"%"),this.laserContainerElement.style.height="".concat(e.height*t*100,"%")}},{key:"setViewfinderArea",value:function(e){this.customViewfinderArea=e,null==e&&(e=this.scanner.getScanSettings().getSearchArea());var t=.95;this.viewfinderElement.style.left="".concat(100*(.025+e.x*t),"%"),this.viewfinderElement.style.width="".concat(e.width*t*100,"%"),this.viewfinderElement.style.top="".concat(100*(.025+e.y*t),"%"),this.viewfinderElement.style.height="".concat(e.height*t*100,"%")}},{key:"setVideoFit",value:function(t){this.singleImageModeEnabled||(this.videoFit=t,t===e.BarcodePicker.ObjectFit.COVER?(this.videoElement.style.objectFit="cover",this.videoElement.dataset.objectFit="cover"):(this.videoElement.style.objectFit="contain",this.videoElement.dataset.objectFit="contain",this.scanner.applyScanSettings(this.scanner.getScanSettings().setBaseSearchArea({x:0,y:0,width:1,height:1}))),this.resize())}},{key:"reassignOriginElement",value:function(e){this.visible||(this.originElement.classList.remove(t.hiddenClassName),e.classList.add(t.hiddenClassName)),e.appendChild(this.grandParentElement),this.checkAndRecoverPlayback().catch((function(){})),this.resize(),this.resizeObserver.disconnect(),this.resizeObserver.observe(e),this.originElement=e,this.resize()}},{key:"flashGUI",value:function(){this.guiStyle===e.BarcodePicker.GuiStyle.LASER?this.flashLaser():this.guiStyle===e.BarcodePicker.GuiStyle.VIEWFINDER&&this.flashViewfinder()}},{key:"getImageData",value:function(t){function n(e,t){return 4===e.readyState&&e.videoWidth>2&&e.videoHeight>2&&t.canvas.width>2&&t.canvas.height>2}if(this.singleImageModeEnabled&&null!=this.context2d)return new Uint8Array(this.context2d.getImageData(0,0,this.context2d.canvas.width,this.context2d.canvas.height).data.buffer);if(!this.singleImageModeEnabled){if(null!=this.contextWebGL){if(!n(this.videoElement,this.contextWebGL)||this.contextWebGL.drawingBufferWidth<=2||this.contextWebGL.drawingBufferHeight<=2)return;var r=this.contextWebGL.drawingBufferWidth*this.contextWebGL.drawingBufferHeight*4;return null!=t&&0!==t.byteLength&&t.byteLength===r||(t=new Uint8Array(r)),this.contextWebGL.texImage2D(this.contextWebGL.TEXTURE_2D,0,this.contextWebGL.RGBA,this.contextWebGL.RGBA,this.contextWebGL.UNSIGNED_BYTE,this.videoElement),this.contextWebGL.readPixels(0,0,this.contextWebGL.drawingBufferWidth,this.contextWebGL.drawingBufferHeight,this.contextWebGL.RGBA,this.contextWebGL.UNSIGNED_BYTE,t),255!==t[3]?(e.Logger.log(e.Logger.Level.WARN,"Detected incorrect GPU accelerated WebGL image processing, switching to canvas mode"),this.contextWebGL=void 0,this.setupContext(document.createElement("canvas"),!0),this.handleVideoResize(),this.getImageData(t)):t}if(null!=this.context2d){if(!n(this.videoElement,this.context2d))return;return this.context2d.drawImage(this.videoElement,0,0),new Uint8Array(this.context2d.getImageData(0,0,this.context2d.canvas.width,this.context2d.canvas.height).data.buffer)}}}},{key:"getVideoCurrentTime",value:function(){return this.videoElement.currentTime}},{key:"setCameraSwitcherVisible",value:function(e){e?this.cameraSwitcherElement.classList.remove(t.hiddenClassName):this.cameraSwitcherElement.classList.add(t.hiddenClassName)}},{key:"setCameraFOVSwitcherVisible",value:function(e){e?this.cameraFOVSwitcherElement.classList.remove(t.hiddenClassName):this.cameraFOVSwitcherElement.classList.add(t.hiddenClassName)}},{key:"setCameraFOVSwitcherState",value:function(e){e?(this.cameraFOVSwitcherUltraWideElement.classList.remove(t.hiddenClassName),this.cameraFOVSwitcherWideElement.classList.add(t.hiddenClassName)):(this.cameraFOVSwitcherWideElement.classList.remove(t.hiddenClassName),this.cameraFOVSwitcherUltraWideElement.classList.add(t.hiddenClassName))}},{key:"isCameraRecoveryVisible",value:function(){return!this.cameraRecoveryElement.classList.contains(t.hiddenClassName)}},{key:"setCameraRecoveryVisible",value:function(e){e?this.cameraRecoveryElement.classList.remove(t.hiddenClassName):this.cameraRecoveryElement.classList.add(t.hiddenClassName)}},{key:"setTorchTogglerVisible",value:function(e){e?this.torchTogglerElement.classList.remove(t.hiddenClassName):this.torchTogglerElement.classList.add(t.hiddenClassName)}},{key:"playVideo",value:function(){var e=this.videoElement.play();null==e||e.catch((function(){}))}},{key:"setVideoVisible",value:function(e){this.videoElement.style.visibility=e?"visible":"hidden"}},{key:"setCameraType",value:function(t){var n;null===(n=this.cameraUploadInputElement)||void 0===n||n.setAttribute("capture",t===e.Camera.Type.FRONT?"user":"environment")}},{key:"setCameraUploadGuiBusyScanning",value:function(e){e?(this.cameraUploadProgressElement.classList.remove(t.flashInsetClassName),this.cameraUploadElement.classList.add(t.opacityPulseClassName)):(this.cameraUploadProgressElement.classList.add(t.flashInsetClassName),this.cameraUploadElement.classList.remove(t.opacityPulseClassName))}},{key:"setupContext",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t)this.context2d=e.getContext("2d");else{var n=e.getContext("webgl",{alpha:!1,antialias:!1});null==n&&(n=e.getContext("experimental-webgl",{alpha:!1,antialias:!1})),null!=n?(this.setupWebGL(n),e.addEventListener("webglcontextlost",this.webGLContextLostListener)):this.context2d=e.getContext("2d")}}},{key:"setupWebGL",value:function(e){var t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);var n=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,n),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),this.contextWebGL=e}},{key:"setupVideoElement",value:function(){this.videoElement.setAttribute("autoplay","autoplay"),this.videoElement.setAttribute("playsinline","true"),this.videoElement.setAttribute("muted","muted"),this.videoElement.setAttribute("poster","data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="),this.videoElement.className=t.videoElementClassName,this.parentElement.appendChild(this.videoElement)}},{key:"setupCameraUploadGuiAssets",value:function(){var n,r,i=this,a=e.BrowserHelper.userAgentInfo.getDevice().type,o="mobile"===a||"tablet"===a?e.SingleImageModeSettings.defaultMobile:e.SingleImageModeSettings.defaultDesktop;this.cameraUploadElement.className=t.cameraUploadElementClassName,Ru(this.cameraUploadElement.style,o.containerStyle,this.singleImageModeSettings.containerStyle),this.parentElement.appendChild(this.cameraUploadElement);var s=null!==(n=this.singleImageModeSettings.informationElement)&&void 0!==n?n:o.informationElement;Ru(s.style,o.informationStyle,this.singleImageModeSettings.informationStyle),this.cameraUploadElement.appendChild(s),this.cameraUploadInputElement.type="file",this.cameraUploadInputElement.accept="image/*",this.cameraUploadInputElement.addEventListener("change",this.cameraUploadFile.bind(this));var c=function(e){(i.scanningPaused||i.cameraUploadInProgress)&&e.preventDefault()};this.cameraUploadInputElement.addEventListener("click",c),this.cameraUploadInputElement.addEventListener("keydown",c),this.cameraUploadLabelElement.appendChild(this.cameraUploadInputElement);var u=null!==(r=this.singleImageModeSettings.buttonElement)&&void 0!==r?r:o.buttonElement;[this.cameraUploadProgressElement.style,u.style].forEach((function(e){Ru(e,o.buttonStyle,i.singleImageModeSettings.buttonStyle)})),u.style.maxWidth="100px",u.style.maxHeight="100px",this.cameraUploadLabelElement.appendChild(u),this.cameraUploadProgressElement.classList.add("radial-progress"),this.cameraUploadLabelElement.appendChild(this.cameraUploadProgressElement),this.cameraUploadElement.appendChild(this.cameraUploadLabelElement)}},{key:"setupFullGuiAssets",value:function(){this.laserActiveImageElement.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAuwAAAAvCAMAAACPHW/9AAAAwFBMVEVHcExUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFVydJUyNFUyNFUyNFUyNH8/v5UyNFUyNFUyNFVydJUyNFUyNFUyNFVydJUyNFVydL3/f1YytNUyNFUyNFUyNHx+/ve9fbp+PnR8fNUyNGF2N9009q15+uW3ePD7O+l4+dv0dlv0dj///9Ujp4pAAAAP3RSTlMAiXJnBFsIARM5oA1+UKsuG5W3JEULBishQj5iAm0QkTQZ/h5MF3snWISbSHb8plMFjfjv9Oeyua3Ww9/Nn4y/IgemAAAIrElEQVR42u2da1saOxCAq8jRVuql0qOVIgcvg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jW0Yz9sTrHnnFY0fu3jCcCR2vc77ocbwyztf/hmWPbtVjbf6qR1nP3o3Xs9fdevaa3yeithz5bRpxMMT6Fy1o53vlj61tN+I17JEX2Xr282SDh9/TIbs5eD37YDRvPXvpTqV6vcI+Jdou5f1XWzr0fwL5ZiW+a9uZY0T7lBpzNioFsfVOJdr9WXGnkt+DulG+B7Vk+3eyZa+m4qCdbEBVwWCbT41Ke1H1/tOgdbtoE6reg3qa7kHd1HtQo+4Ce2l3gfLeAoO4X0YSBfWstUAr7Bo3jMXtBdiatMGA7i5Qj3pshO4C4rokdtVdwPeNOYv7xnD7o6W6xnzWoTBIWsdwRFjrGGNBw5ikT4YyelDaN+ZU+sYcUp+k4r4xlTqCHc7radcsagiWBINvCGYdwYxqHcFO855g1BWMWs2VtwRTHcHQ9aOoI9jcXo/S3NEP/3tOHBSuRV4WGNbq0ajW7DFr+Mg9F2Oy5qfS6/Eg9HpUib2ki+8ed/HtL27iK91PS9ugWhtf4zW6+H7MO/lux518ky6+2vWsZ3VRf/ZqzdnD70l39m1rz268eoN2TML9/Vi90J/9ZE5/9kUnbyx77gYOfdqGHbxhvPLRGycFZ2+EkzfO+LQZOXnjZi0/Z6boTKVFJyrJLy84UcmOVDJefqhSctDYnDOVotPy3GGQ1Q7LO8JhZ+UZ731cHoqojsuT0/Ju1uYeDpmfg/pmp6DaMajGWx2EOvcc1OTg32oHXN+89HxrO+DaeNMjrqsd7M5Huxfy/Y9ZM4wlWVoyZ+mHd2LdMF7Ma5j4P+hE04Z78rHKAAAAAElFTkSuQmCC",this.laserContainerElement.appendChild(this.laserActiveImageElement),this.laserPausedImageElement.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAuwAAAAvCAMAAACPHW/9AAAAYFBMVEVHcExUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFUyNFTyNFUyNE9ws1UyNFUyNFUyNFTyNFCxM5UyNFHxc9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ym5w0YIoKRNqFYmRCyOmVF43hsopcbEkrJPUrhszXBFMC4LVFcHa4npKqywWaJKIeMvLPoVCw0XB+PxWFwdbYTmwt6o4nlQEex+oCCbWPlbr0RcqxWqTUgGyVebRRUUodPFqj4JYWfDxNav1WLBusOdVfJdVFd/091/k896q4Gs1VduFfF1J1KjoG5pUvZeReR2u4fviSvm6Mr6uii+zvrAqvpzHtOqzj8nXZu/qQu3D9dijPHvoRGn2F/XUkpbPrDC7VWdnyLVA+1B99qrzhnaPmdwehnsgVO0Lou9G6A904ei6svdG1XhDSF8M95nJeyqdbKR0r81tfI8buaBQuY+OSqFLNVVSsvyF76zkQB/oqZThzt3ysPHeYqRDnmtTZh3yrK0Zf+7sD0KhczvkOYQyohyM2jAvsbsY65ZX9UFd/KAP6p2c7vwVd6ksm1ZG787Q+V1P2X4BOYKNDfzOMETKF+N9UH/V4XpRNB1e6BdFM1b+hEKT+lkLLbd5P1+meZGBVzZX/0Fjdwf+dN3+pg98KPRDjbF49S/pJhT6tS5B4j8UFQCShr1YqAAAAABJRU5ErkJggg==",this.laserContainerElement.appendChild(this.laserPausedImageElement),this.laserContainerElement.className=t.laserContainerElementClassName,this.parentElement.appendChild(this.laserContainerElement),this.viewfinderElement.className=t.viewfinderElementClassName,this.parentElement.appendChild(this.viewfinderElement),this.laserActiveImageElement.classList.add(t.hiddenOpacityClassName),this.laserPausedImageElement.classList.remove(t.hiddenOpacityClassName),this.viewfinderElement.classList.add(t.pausedClassName)}},{key:"flashLaser",value:function(){this.laserActiveImageElement.classList.remove(t.flashColorClassName),this.laserActiveImageElement.offsetHeight,this.laserActiveImageElement.classList.add(t.flashColorClassName)}},{key:"flashViewfinder",value:function(){this.viewfinderElement.classList.remove(t.flashWhiteClassName),this.viewfinderElement.offsetHeight,this.viewfinderElement.classList.add(t.flashWhiteClassName)}},{key:"resize",value:function(e){var t;this.parentElement.style.maxWidth="",this.parentElement.style.maxHeight="";var n=null!==(t=null==e?void 0:e.contentRect)&&void 0!==t?t:{width:this.originElement.clientWidth,height:this.originElement.clientHeight},r=n.width,i=n.height;0!==r&&0!==i?this.singleImageModeEnabled?this.resizeCameraUpload(r,i):(this.resizeVideo(r,i),this.handleVideoDisplay(!1)):this.singleImageModeEnabled||this.handleVideoDisplay(!0)}},{key:"resizeCameraUpload",value:function(e,t){this.cameraUploadLabelElement.style.transform="scale(".concat(Math.min(1,e/300,t/300),")")}},{key:"resizeVideo",value:function(t,n){if(!(this.videoElement.videoWidth<=2||this.videoElement.videoHeight<=2)){var r=this.videoElement.videoWidth/this.videoElement.videoHeight;if(this.videoFit===e.BarcodePicker.ObjectFit.COVER){var i=1,a=1;return r<t/n?a=Math.min(1,n/(t/r)):i=Math.min(1,t/(n*r)),void this.scanner.applyScanSettings(this.scanner.getScanSettings().setBaseSearchArea({x:(1-i)/2,y:(1-a)/2,width:i,height:a}))}r>t/n?n=t/r:t=n*r,this.parentElement.style.maxWidth="".concat(Math.ceil(t),"px"),this.parentElement.style.maxHeight="".concat(Math.ceil(n),"px"),window.objectFitPolyfill(this.videoElement)}}},{key:"checkAndRecoverPlayback",value:(s=Zr(ao.mark((function t(){var n,r,i,a;return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.videoElement.srcObject,"visible"!==document.visibilityState||null==(null===(n=this.cameraManager)||void 0===n?void 0:n.activeCamera)||null==(null===(r=this.videoElement)||void 0===r?void 0:r.srcObject)){t.next=15;break}if(i.active&&!1===(null===(a=i.getVideoTracks()[0])||void 0===a?void 0:a.muted)){t.next=13;break}return t.prev=3,e.Logger.log(e.Logger.Level.DEBUG,'Detected visibility change ("visible") event with inactive video source, try to reinitialize camera'),t.next=7,this.cameraManager.reinitializeCamera();case 7:t.next=11;break;case 9:t.prev=9,t.t0=t.catch(3);case 11:t.next=15;break;case 13:e.Logger.log(e.Logger.Level.DEBUG,'Detected visibility change ("visible") event with active video source, replay video'),this.playVideo();case 15:case"end":return t.stop()}}),t,this,[[3,9]])}))),function(){return s.apply(this,arguments)})},{key:"updateCameraUploadProgress",value:function(e){this.cameraUploadProgressElement.setAttribute("data-progress",e)}},{key:"cameraUploadImageLoad",value:(o=Zr(ao.mark((function e(t){var n,r,i;return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateCameraUploadProgress("100"),i=1440,t.naturalWidth<=i&&t.naturalHeight<=i?(n=t.naturalWidth,r=t.naturalHeight):t.naturalWidth>t.naturalHeight?(n=i,r=Math.round(t.naturalHeight/t.naturalWidth*i)):(n=Math.round(t.naturalWidth/t.naturalHeight*i),r=i),e.next=5,this.cameraUploadFileProcess(t,n,r);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"cameraUploadFileProcess",value:(a=Zr(ao.mark((function t(n,r,i){return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return null!=this.context2d&&(this.context2d.canvas.width=r,this.context2d.canvas.height=i,this.context2d.drawImage(n,0,0,r,i),this.scanner.applyImageSettings({width:r,height:i,format:e.ImageSettings.Format.RGBA_8U})),this.setCameraUploadGuiBusyScanning(!0),t.next=4,this.cameraUploadCallback();case 4:this.setCameraUploadGuiBusyScanning(!1),this.cameraUploadInProgress=!1;case 6:case"end":return t.stop()}}),t,this)}))),function(e,t,n){return a.apply(this,arguments)})},{key:"cameraUploadFile",value:function(){var t=this,n=this.cameraUploadInputElement.files;if(null!=n&&0!==n.length){this.cameraUploadInProgress=!0;var r=new Image,i=new FileReader;i.onload=function(){t.cameraUploadInputElement.value="",null!=i.result&&(r.onload=t.cameraUploadImageLoad.bind(t,r),r.onprogress=function(e){if(e.lengthComputable){var n=5*Math.round(e.loaded/e.total*20);n<=100&&t.updateCameraUploadProgress(n.toString())}},r.onerror=function(){t.cameraUploadInProgress=!1,e.Logger.log(e.Logger.Level.WARN,"Could not load image from selected file")},r.src=i.result)},i.onerror=function(){var n;t.cameraUploadInProgress=!1,e.Logger.log(e.Logger.Level.WARN,"Error while reading the file: ".concat(null===(n=i.error)||void 0===n?void 0:n.toString()))},this.updateCameraUploadProgress("0"),i.readAsDataURL(n[0])}}},{key:"cameraSwitcherListener",value:(i=Zr(ao.mark((function t(n){var r,i,a,o;return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.cameraSwitchInProgress||null==this.cameraManager){t.next=40;break}return r=this.cameraManager,n.preventDefault(),t.prev=3,t.next=6,e.CameraAccess.getCameras();case 6:if(i=t.sent,null!=r.activeCamera){t.next=9;break}return t.abrupt("return");case 9:if(!(i.length<=1)){t.next=12;break}return this.setCameraSwitcherVisible(!1),t.abrupt("return");case 12:this.cameraSwitchInProgress=!0,a=i.indexOf(r.activeCamera),o=(a+1)%i.length;case 15:if(o===a){t.next=33;break}return t.prev=16,t.next=19,r.initializeCameraWithSettings(i[o],r.activeCameraSettings);case 19:t.next=30;break;case 21:if(t.prev=21,t.t0=t.catch(16),e.Logger.log(e.Logger.Level.WARN,"Couldn't access camera:",i[o],t.t0),(o=(o+1)%i.length)!==a){t.next=29;break}return this.setCameraSwitcherVisible(!1),t.next=29,r.initializeCameraWithSettings(i[o],r.activeCameraSettings);case 29:return t.abrupt("continue",15);case 30:return t.abrupt("break",33);case 33:this.cameraSwitchInProgress=!1,t.next=40;break;case 36:t.prev=36,t.t1=t.catch(3),e.Logger.log(e.Logger.Level.ERROR,t.t1),this.cameraSwitchInProgress=!1;case 40:case"end":return t.stop()}}),t,this,[[3,36],[16,21]])}))),function(e){return i.apply(this,arguments)})},{key:"cameraFOVSwitcherListener",value:(r=Zr(ao.mark((function t(n){var r,i,a;return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.cameraSwitchInProgress||null==this.cameraManager){t.next=28;break}return r=this.cameraManager,n.preventDefault(),t.prev=3,t.next=6,e.CameraAccess.getCameras();case 6:if(i=t.sent,null!=r.activeCamera){t.next=9;break}return t.abrupt("return");case 9:if(this.cameraSwitchInProgress=!0,null!=(a=i.find((function(t){return e.CameraAccess.isIOSUltraWideBackCameraLabel(r.activeCamera.label)?e.CameraAccess.isIOSWideBackCameraLabel(t.label):e.CameraAccess.isIOSUltraWideBackCameraLabel(t.label)})))){t.next=14;break}return this.setCameraFOVSwitcherVisible(!1),t.abrupt("return");case 14:return t.prev=14,t.next=17,r.initializeCameraWithSettings(a,r.activeCameraSettings);case 17:t.next=22;break;case 19:t.prev=19,t.t0=t.catch(14),e.Logger.log(e.Logger.Level.WARN,"Couldn't access camera:",a,t.t0);case 22:t.next=27;break;case 24:t.prev=24,t.t1=t.catch(3),e.Logger.log(e.Logger.Level.ERROR,t.t1);case 27:this.cameraSwitchInProgress=!1;case 28:case"end":return t.stop()}}),t,this,[[3,24],[14,19]])}))),function(e){return r.apply(this,arguments)})},{key:"cameraRecoveryListener",value:(n=Zr(ao.mark((function e(t){var n;return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),null==this.cameraManager){e.next=5;break}return this.cameraManager.activeCamera=this.cameraManager.selectedCamera,e.next=5,null===(n=this.cameraManager)||void 0===n?void 0:n.reinitializeCamera();case 5:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"setupCameraSwitcher",value:function(){var e=this;this.cameraSwitcherElement.src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiIGZpbGw9IiNmZmYiPjxwYXRoIGQ9Ik0yNi4xNCA4YTQuOTkgNC45OSAwIDAgMC00LjE2IDIuMjI3bC0yLjIxOCAzLjMyOGExLjAwMyAxLjAwMyAwIDAgMS0uODMyLjQ0NUgxOHYtMmMwLTEuMTAyLS44OTgtMi0yLTJoLTZjLTEuMTAyIDAtMiAuODk4LTIgMnYySDVjLTEuNjUyIDAtMyAxLjM0OC0zIDN2MzZjMCAxLjY1MiAxLjM0OCAzIDMgM2g1NGMxLjY1MiAwIDMtMS4zNDggMy0zVjE3YzAtMS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tMi4zMTZjLS4wMDguMjAzLS4wMi40MDYtLjAyLjYwOSAwIDguMjcgNi43MyAxNSAxNSAxNSA1LjM2NyAwIDEwLjM2LTIuODk4IDEzLjAyNy03LjU2M2EuOTk5Ljk5OSAwIDEgMC0xLjczNC0uOTkyQTEzLjA0MiAxMy4wNDIgMCAwIDEgMzIgNDZjLTcuMTY4IDAtMTMtNS44MzItMTMtMTMgMC0uMTg4LjAxMi0uMzc5LjAyLS41NjZsMi4yNzMgMi4yNzNjLjE5NS4xOTUuNDUuMjkzLjcwNy4yOTNhMSAxIDAgMCAwIC43MDctMS43MDdsLTQtNEExIDEgMCAwIDAgMTggMjl6bTkgMmMtLjU1NSAwLTEgLjQ0NS0xIDF2MmMwIC41NTUuNDQ1IDEgMSAxIC41NTUgMCAxLS40NDUgMS0xdi0yYzAtLjU1NS0uNDQ1LTEtMS0xem01IDBjLS41NTUgMC0xIC40NDUtMSAxdjJjMCAuNTU1LjQ0NSAxIDEgMSAuNTU1IDAgMS0uNDQ1IDEtMXYtMmMwLS41NTUtLjQ0NS0xLTEtMXptNSAwYy0uNTU1IDAtMSAuNDQ1LTEgMXYyYzAgLjU1NS40NDUgMSAxIDEgLjU1NSAwIDEtLjQ0NSAxLTF2LTJjMC0uNTU1LS40NDUtMS0xLTF6Ii8+PC9zdmc+Cg==",this.cameraSwitcherElement.className=t.cameraSwitcherElementClassName,this.cameraSwitcherElement.classList.add(t.hiddenClassName),this.parentElement.appendChild(this.cameraSwitcherElement),["touchstart","mousedown"].forEach((function(t){e.cameraSwitcherElement.addEventListener(t,e.cameraSwitcherListener.bind(e))}))}},{key:"setupCameraFOVSwitcher",value:function(){var e=this;this.cameraFOVSwitcherElement.className=t.cameraFOVSwitcherElementClassName,this.cameraFOVSwitcherElement.classList.add(t.hiddenClassName),this.cameraFOVSwitcherUltraWideElement.src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5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xLTIuNTZjMS4wNiAwIDEuNTYtLjQgMi40NC0xLjI1bDUuMjUtNS4yMiA1LjI1IDUuMTljLjg4Ljg3IDEuMzggMS4yNSAyLjQ0IDEuMjVBMi41IDIuNSAwIDAgMCA3MC43NSA2MWMwLS45NC0uNDctMS41Ni0xLjIyLTIuMjhsLTUuMzctNS40NCA1LjM3LTUuNDRjLjc1LS43NSAxLjIyLTEuMzcgMS4yMi0yLjNhMi41IDIuNSAwIDAgMC0yLjU2LTIuNWMtMS4wNiAwLTEuNTYuNC0yLjQ0IDEuMjdsLTUuMjUgNS4yMi01LjIyLTUuMjJjLS44Ny0uODctMS4zNy0xLjI1LTIuNDQtMS4yNWEyLjUgMi41IDAgMCAwLTIuNTYgMi40N2MwIC45Ny40NyAxLjU2IDEuMTkgMi4zMWw1LjM3IDUuNDQtNS4zNyA1LjQ0Yy0uNzUuNzItMS4xOSAxLjM0LTEuMTkgMi4yOGEyLjUgMi41IDAgMCAwIDIuNTMgMi41Wm0wIDAiIGZpbGw9IiNmZmYiLz48L3N2Zz4=",this.cameraFOVSwitcherWideElement.classList.add(t.hiddenClassName),this.cameraFOVSwitcherElement.appendChild(this.cameraFOVSwitcherUltraWideElement),this.cameraFOVSwitcherElement.appendChild(this.cameraFOVSwitcherWideElement),this.parentElement.appendChild(this.cameraFOVSwitcherElement),["touchstart","mousedown"].forEach((function(t){e.cameraFOVSwitcherElement.addEventListener(t,e.cameraFOVSwitcherListener.bind(e))}))}},{key:"setupCameraRecovery",value:function(e){var n=this;this.cameraRecoveryElement.textContent=e,this.cameraRecoveryElement.className=t.cameraRecoveryElementClassName,this.cameraRecoveryElement.classList.add(t.hiddenClassName),this.parentElement.appendChild(this.cameraRecoveryElement),["touchstart","mousedown"].forEach((function(e){n.cameraRecoveryElement.addEventListener(e,n.cameraRecoveryListener.bind(n))}))}},{key:"setupTorchToggler",value:function(){var e=this;this.torchTogglerElement.src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy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4LS4yODJ6Ii8+PC9zdmc+Cg==",this.torchTogglerElement.className=t.torchTogglerElementClassName,this.torchTogglerElement.classList.add(t.hiddenClassName),this.parentElement.appendChild(this.torchTogglerElement),["touchstart","mousedown"].forEach((function(t){e.torchTogglerElement.addEventListener(t,function(){var t=Zr(ao.mark((function t(n){return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==e.cameraManager){t.next=4;break}return n.preventDefault(),t.next=4,e.cameraManager.toggleTorch();case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}))}},{key:"showScanditLogo",value:function(e,n){if(!e||!0!==(null==n?void 0:n.hiddenScanditLogoAllowed)){var r=document.createElement("img");r.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUcAAAAhCAMAAAB9TZmqAAABgFBMVEVHcEyCgoL+/v6Kior///+FhYXW1tbn5+eAgIDp6en+/v6BgYH///////////+BgYH///////////+wsLCCgoL4+PiBgYH///+srKyAgID////s7OyCgoKBgYGDg4P///+BgYH6+vqBgYH////MzMz39/f///+BgYGbm5uDg4OMjIyBgYG+vr6QkJD///////+BgYGDg4P+/v7Hx8eOjo6BgYH09PT7+/v///////+MjIz9/f3////////Y2Nj6+vrPz8+BgYH9/f3///+3t7f///+Ghob///+AgICDg4P///+IiIj///////+CgoL6+vqmpqb////////t7e3////////////b29vj4+PNzc3y8vLl5eXv7+/U1NTDw8O8vLyRkZH////x8fGJiYmZmZnDw8Pf39/S0tLT09PCwsKfn5/4+PjV1dWlpaWwsLCjo6OsrKzj4+OZmZnCwsLq6uqurq7///+AgICfn5+Tk5OFhYXCwsLJycmYmJjU1NS/v79wPZvPAAAAdnRSTlMAcvoPxiTEAsby9L8p/eusNEoJBlEZ2Pb67nz25fVGOv1Eh+RW7oyC/ToXzkALzmqTe8BJHmf9Uu+n/B2Dnt7/+6MvEP2ZKrmzXHIx2dScYv6wkf3o3SL+/uDhqLbnuNrVV4u4ie7LNGlhweeUnrTsZOjkis/PjpWtf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G3pzPQDJbM8PKsaQ7W9D4PniYfP9Sa2mPsJAMBwyfQjgNqGgfBp6IGZKUfCf1vonmkfWiZt9ru+r1bb9++E/f9qThLNBhL5RkKsd1XN9qRIJP2AzNTSTdLJYVv+znWWZu7ow+p4ow1Ys3Snnry7Yj5rHfjfmda/AA1uqYyEPVX6AAAAAElFTkSuQmCC",r.className=t.scanditLogoImageElementClassName,this.parentElement.appendChild(r)}}},{key:"activateGUI",value:function(){this.dataCaptureContextCreated=!0,this.scanningPaused||this.resumeScanning()}},{key:"handleNewScanSettings",value:function(){null==this.customLaserArea&&this.setLaserArea(),null==this.customViewfinderArea&&this.setViewfinderArea()}},{key:"handleVideoDisplay",value:function(e){e&&!this.isVideoElementDetached?(this.videoElement.width=this.videoElement.height=0,this.videoElement.style.opacity="0",document.body.appendChild(this.videoElement),this.isVideoElementDetached=!0):!e&&this.isVideoElementDetached&&(this.parentElement.insertAdjacentElement("afterbegin",this.videoElement),this.isVideoElementDetached=!1,this.videoElement.removeAttribute("width"),this.videoElement.removeAttribute("height"),this.videoElement.style.removeProperty("opacity"),this.resize())}},{key:"handleVideoPause",value:function(){this.playVideo()}},{key:"handleVideoResize",value:function(){if(this.resize(),!(this.videoElement.videoWidth<=2||this.videoElement.videoHeight<=2))if(null!=this.contextWebGL){if(this.contextWebGL.canvas.width===this.videoElement.videoWidth&&this.contextWebGL.canvas.height===this.videoElement.videoHeight)return;this.contextWebGL.canvas.width=this.videoElement.videoWidth,this.contextWebGL.canvas.height=this.videoElement.videoHeight,this.contextWebGL.viewport(0,0,this.contextWebGL.drawingBufferWidth,this.contextWebGL.drawingBufferHeight),this.scanner.applyImageSettings({width:this.contextWebGL.drawingBufferWidth,height:this.contextWebGL.drawingBufferHeight,format:e.ImageSettings.Format.RGBA_8U})}else if(null!=this.context2d){if(this.context2d.canvas.width===this.videoElement.videoWidth&&this.context2d.canvas.height===this.videoElement.videoHeight)return;this.context2d.canvas.width=this.videoElement.videoWidth,this.context2d.canvas.height=this.videoElement.videoHeight,this.scanner.applyImageSettings({width:this.videoElement.videoWidth,height:this.videoElement.videoHeight,format:e.ImageSettings.Format.RGBA_8U})}}},{key:"handleWebGLContextLost",value:function(){e.Logger.log(e.Logger.Level.WARN,"WebGL context has been lost, restoring..."),this.contextWebGL=void 0,this.setupContext(document.createElement("canvas")),this.handleVideoResize(),e.Logger.log(e.Logger.Level.WARN,"WebGL context restored")}}]),t}();function Il(e){throw new Error("Unexpected object: ".concat(e))}function Nl(e,t){if(null==e)return t;var n=Ml(e);return null==n||Array.isArray(n)||"number"==typeof n?t:n}function Ml(e){try{return JSON.parse(e)}catch(e){return}}ec(Tl,"grandParentElementClassName","scandit scandit-container"),ec(Tl,"parentElementClassName","scandit scandit-barcode-picker"),ec(Tl,"hiddenClassName","scandit-hidden"),ec(Tl,"hiddenOpacityClassName","scandit-hidden-opacity"),ec(Tl,"videoElementClassName","scandit-video"),ec(Tl,"scanditLogoImageElementClassName","scandit-logo"),ec(Tl,"laserContainerElementClassName","scandit-laser"),ec(Tl,"viewfinderElementClassName","scandit-viewfinder"),ec(Tl,"cameraSwitcherElementClassName","scandit-camera-switcher"),ec(Tl,"cameraFOVSwitcherElementClassName","scandit-camera-fov-switcher"),ec(Tl,"cameraRecoveryElementClassName","scandit-camera-recovery"),ec(Tl,"torchTogglerElementClassName","scandit-torch-toggle"),ec(Tl,"cameraUploadElementClassName","scandit-camera-upload"),ec(Tl,"flashColorClassName","scandit-flash-color"),ec(Tl,"flashWhiteClassName","scandit-flash-white"),ec(Tl,"flashInsetClassName","scandit-flash-inset"),ec(Tl,"opacityPulseClassName","scandit-opacity-pulse"),ec(Tl,"mirroredClassName","mirrored"),ec(Tl,"pausedClassName","paused"),e.BarcodePicker=function(){function t(e,n){var r,i,a,o,s=n.visible,c=n.singleImageModeEnabled,u=n.singleImageModeSettings,l=n.playSoundOnScan,d=n.vibrateOnScan,h=n.scanningPaused,m=n.guiStyle,f=n.videoFit,g=n.cameraRecoveryText,p=n.laserArea,v=n.viewfinderArea,y=n.scanner,b=n.scanSettings,S=n.cameraType,E=n.targetScanningFPS,A=n.hideLogo;qo(this,t),ec(this,"cameraManager",void 0),ec(this,"gui",void 0),ec(this,"eventEmitter",void 0),ec(this,"scanner",void 0),ec(this,"beepSound",void 0),ec(this,"vibrateFunction",void 0),ec(this,"scannerReadyEventListener",void 0),ec(this,"playSoundOnScan",void 0),ec(this,"vibrateOnScan",void 0),ec(this,"scanningPaused",void 0),ec(this,"latestVideoTimeProcessed",void 0),ec(this,"destroyed",void 0),ec(this,"isReadyToWork",void 0),ec(this,"cameraAccess",void 0),ec(this,"targetScanningFPS",void 0),ec(this,"averageProcessingTime",void 0),ec(this,"externalImageData",void 0),ec(this,"internalImageData",void 0),this.isReadyToWork=!1,this.destroyed=!1,this.scanningPaused=h,lc.Howler.autoSuspend=!1,this.beepSound=new lc.Howl({src:"data:audio/mp3;base64,//uwAAAAA8ROTJVigAB4icmSrFAAE/IjVfj6gAJ+RGq/H1AAADEN55555509PSUkYjEMQ5DCaBiMBmSoGPBh6QGGJAZo8BoDwGYJADEBmQbAAbMBcAJ0IIRQuFwuF8vm6aaaaaaCCH/9RcIubDkCgBQAzBOLL5cLhog3p////6BgTBFC4yZfTah/////WmYFwuBgTh///5cEDgnB8AMQ3nnnnnnT09JSRiMQxDkMJoGIwGZKgY8GHpAYYkBmjwGgPAZgkAMQGZBsABswFwAnQghFC4XC4Xy+bppppppoIIf/1Fwi5sOQKAFADME4svlwuGiDen////oGBMEULjJl9NqH////9aZgXC4GBOH///lwQOCcH7usq4IwABEoZUkABBACSAH6LQxWQ1ekTmN4ZafMA1wANy7UyDUPgZzK4WdA1sdhHQGm0eAcG0Uwxsang94vpi3jMEgeLBTM1nUEFdDatet8mwsLJddIZ0CIGTVYoADBkuf9NrJ1f3UsUMJtLy/dMOCTfrUURBBm/6mKA7P6lkcLj/z5mI2/+plE5/9TFgqrf/qYpFf/9v///9Z7////Weu6yrgjAAEShlSQAEEAJIAfotDFZDV6RO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VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU="}),this.vibrateFunction=null!==(r=null!==(i=null!==(a=navigator.vibrate)&&void 0!==a?a:navigator.webkitVibrate)&&void 0!==i?i:navigator.mozVibrate)&&void 0!==r?r:navigator.msVibrate,this.eventEmitter=new uc,this.setPlaySoundOnScanEnabled(l),this.setVibrateOnScanEnabled(d),this.setTargetScanningFPS(E),this.scanner=null!==(o=null==y?void 0:y.applyScanSettings(b))&&void 0!==o?o:new Gc({scanSettings:b}),this.scannerReadyEventListener=this.handleScannerReady.bind(this),this.scanner.on("ready",this.scannerReadyEventListener),this.gui=new Tl({scanner:this.scanner,originElement:e,singleImageModeEnabled:c,singleImageModeSettings:u,scanningPaused:h,visible:s,guiStyle:m,videoFit:f,hideLogo:A,cameraRecoveryText:g,laserArea:p,viewfinderArea:v,cameraUploadCallback:this.processVideoFrame.bind(this,!0)}),c?(this.cameraManager=new _u(this.scanner,this.triggerCameraAccessError.bind(this),this.gui),this.gui.setCameraType(S)):(this.cameraManager=new wu(this.scanner,this.triggerCameraAccessError.bind(this),this.gui),this.scheduleVideoProcessing()),this.gui.setCameraManager(this.cameraManager)}var n,r,i,a,o,s,c,u,l,d,h;return Zo(t,[{key:"destroy",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.pauseScanning(!0),this.scanner.removeListener("ready",this.scannerReadyEventListener),this.destroyed=!0,e&&this.scanner.destroy(),this.gui.destroy(),this.eventEmitter.removeAllListeners()}},{key:"applyScanSettings",value:function(e){return this.scanner.applyScanSettings(e),this}},{key:"isScanningPaused",value:function(){return this.scanningPaused}},{key:"pauseScanning",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.scanningPaused=!0,e&&this.cameraManager.stopStream().catch((function(){})),this.scanner.isReady()&&this.gui.pauseScanning(),this}},{key:"resumeScanning",value:(h=Zr(ao.mark((function e(){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.scanningPaused=!1,this.scanner.isReady()&&this.gui.resumeScanning(),!this.cameraAccess||null!=this.getActiveCamera()){e.next=5;break}return e.next=5,this.cameraManager.setupCameras();case 5:return e.abrupt("return",this);case 6:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"getActiveCamera",value:function(){return this.cameraManager.activeCamera}},{key:"setActiveCamera",value:(d=Zr(ao.mark((function e(t,n){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t&&this.cameraAccess){e.next=8;break}if(this.cameraManager.setSelectedCamera(t),this.cameraManager.setSelectedCameraSettings(n),!this.cameraAccess){e.next=6;break}return e.next=6,this.cameraManager.setupCameras();case 6:e.next=10;break;case 8:return e.next=10,this.cameraManager.initializeCameraWithSettings(t,n);case 10:return e.abrupt("return",this);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"setCameraType",value:(l=Zr(ao.mark((function e(t){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.gui.setCameraType(t),!this.cameraAccess){e.next=6;break}return e.next=4,this.cameraManager.setCameraType(t);case 4:e.next=7;break;case 6:this.cameraManager.setInitialCameraType(t);case 7:return e.abrupt("return",this);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"applyCameraSettings",value:(u=Zr(ao.mark((function e(t){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.cameraAccess){e.next=4;break}this.cameraManager.setSelectedCameraSettings(t),e.next=6;break;case 4:return e.next=6,this.cameraManager.applyCameraSettings(t);case 6:return e.abrupt("return",this);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"isVisible",value:function(){return this.gui.isVisible()}},{key:"setVisible",value:function(e){return this.gui.setVisible(e),this}},{key:"isMirrorImageEnabled",value:function(){return this.gui.isMirrorImageEnabled()}},{key:"setMirrorImageEnabled",value:function(e){return this.gui.setMirrorImageEnabled(e,!0),this}},{key:"isPlaySoundOnScanEnabled",value:function(){return this.playSoundOnScan}},{key:"setPlaySoundOnScanEnabled",value:function(e){return this.playSoundOnScan=e,this}},{key:"isVibrateOnScanEnabled",value:function(){return this.vibrateOnScan}},{key:"setVibrateOnScanEnabled",value:function(e){return this.vibrateOnScan=e,this}},{key:"isCameraSwitcherEnabled",value:function(){return this.cameraManager.isCameraSwitcherEnabled()}},{key:"setCameraSwitcherEnabled",value:function(e){return this.cameraManager.setCameraSwitcherEnabled(e).catch((function(){})),this}},{key:"isCameraFOVSwitcherEnabled",value:function(){return this.cameraManager.isCameraFOVSwitcherEnabled()}},{key:"setCameraFOVSwitcherEnabled",value:(c=Zr(ao.mark((function e(t){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cameraManager.setCameraFOVSwitcherEnabled(t);case 2:return e.abrupt("return",this);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"isTorchToggleEnabled",value:function(){return this.cameraManager.isTorchToggleEnabled()}},{key:"setTorchToggleEnabled",value:function(e){return this.cameraManager.setTorchToggleEnabled(e),this}},{key:"isTapToFocusEnabled",value:function(){return this.cameraManager.isTapToFocusEnabled()}},{key:"setTapToFocusEnabled",value:function(e){return this.cameraManager.setTapToFocusEnabled(e),this}},{key:"isPinchToZoomEnabled",value:function(){return this.cameraManager.isPinchToZoomEnabled()}},{key:"setPinchToZoomEnabled",value:function(e){return this.cameraManager.setPinchToZoomEnabled(e),this}},{key:"setTorchEnabled",value:(s=Zr(ao.mark((function e(t){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cameraManager.setTorchEnabled(t);case 2:return e.abrupt("return",this);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"setZoom",value:(o=Zr(ao.mark((function e(t){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cameraManager.setZoom(t);case 2:return e.abrupt("return",this);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"isReady",value:function(){return this.isReadyToWork}},{key:"on",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return"ready"===e?this.isReadyToWork?t():this.eventEmitter.once(e,t,this):!0===n?this.eventEmitter.once(e,t,this):this.eventEmitter.on(e,t,this),this}},{key:"removeListener",value:function(e,t){return this.eventEmitter.removeListener(e,t),this}},{key:"removeAllListeners",value:function(e){return this.eventEmitter.removeAllListeners(e),this}},{key:"addListener",value:function(e,t,n){return this.on(e,t,n)}},{key:"setGuiStyle",value:function(e){return this.gui.setGuiStyle(e),this}},{key:"setVideoFit",value:function(e){return this.gui.setVideoFit(e),this}},{key:"accessCamera",value:(a=Zr(ao.mark((function e(){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.cameraAccess&&null!=this.getActiveCamera()){e.next=4;break}return e.next=3,this.cameraManager.setupCameras();case 3:this.cameraAccess=!0;case 4:return e.abrupt("return",this);case 5:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"createParserForFormat",value:function(e){return this.scanner.createParserForFormat(e)}},{key:"reassignOriginElement",value:function(t){if(!e.BrowserHelper.isValidHTMLElement(t))throw new $s({name:"NoOriginElementError",message:"A valid origin HTML element must be given"});return this.gui.reassignOriginElement(t),this}},{key:"setTargetScanningFPS",value:function(e){return e<=0&&(e=30),this.targetScanningFPS=e,this}},{key:"getScanner",value:function(){return this.scanner}},{key:"clearSession",value:function(){return this.scanner.clearSession(),this}},{key:"setLaserArea",value:function(e){return this.gui.setLaserArea(e),this}},{key:"setViewfinderArea",value:function(e){return this.gui.setViewfinderArea(e),this}},{key:"pauseCameraAccess",value:function(){return this.cameraAccess=!1,this.cameraManager.stopStream().catch((function(){})),this}},{key:"triggerCameraAccessError",value:function(e){this.eventEmitter.emit("cameraAccessError",e)}},{key:"handleScanResult",value:function(e){var t=this;e.imageData=this.externalImageData,this.eventEmitter.emit("processFrame",e),0===e.barcodes.length&&0===e.texts.length||(this.eventEmitter.once("scan",(function(){var n,r=e.barcodes.some((function(t){return!e.rejectedCodes.has(t)})),i=e.texts.some((function(t){return!e.rejectedTexts.has(t)}));(r||i)&&(t.gui.flashGUI(),t.playSoundOnScan&&t.beepSound.play(),t.vibrateOnScan&&(null===(n=t.vibrateFunction)||void 0===n||n.call(navigator,300)))})),this.eventEmitter.emit("scan",e))}},{key:"scheduleVideoProcessing",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;window.setTimeout(Zr(ao.mark((function t(){return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.videoProcessing();case 2:case"end":return t.stop()}}),t)}))),t)}},{key:"scheduleNextVideoProcessing",value:(i=Zr(ao.mark((function e(t){var n;return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this.targetScanningFPS<60)){e.next=11;break}if(null==this.averageProcessingTime?this.averageProcessingTime=performance.now()-t:this.averageProcessingTime=.9*this.averageProcessingTime+.1*(performance.now()-t),n=Math.max(0,1e3/this.targetScanningFPS-this.averageProcessingTime),!(Math.round(n)<=16)){e.next=8;break}return e.next=6,this.videoProcessing();case 6:e.next=9;break;case 8:this.scheduleVideoProcessing(n);case 9:e.next=13;break;case 11:return e.next=13,this.videoProcessing();case 13:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"processVideoFrame",value:(r=Zr(ao.mark((function e(t){var n;return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.internalImageData=this.gui.getImageData(this.internalImageData),null!=this.internalImageData){e.next=3;break}return e.abrupt("return");case 3:if(null==this.externalImageData||0===this.externalImageData.byteLength||this.externalImageData.byteLength!==this.internalImageData.byteLength?this.externalImageData=new Uint8Array(this.internalImageData):this.externalImageData.set(this.internalImageData),this.scanningPaused){e.next=21;break}return this.eventEmitter.listenerCount("submitFrame")>0&&this.eventEmitter.emit("submitFrame",new Nc([],[],this.externalImageData,this.scanner.getImageSettings())),e.prev=6,e.next=9,this.scanner.processImage(this.internalImageData,t);case 9:n=e.sent,this.internalImageData=n.imageData,this.scanningPaused||this.handleScanResult(n),e.next=21;break;case 14:if(e.prev=14,e.t0=e.catch(6),this.internalImageData=void 0,"ImageSettingsDataMismatch"!==e.t0.name){e.next=19;break}return e.abrupt("return");case 19:this.pauseScanning(),this.eventEmitter.emit("scanError",e.t0);case 21:case"end":return e.stop()}}),e,this,[[6,14]])}))),function(e){return r.apply(this,arguments)})},{key:"videoProcessing",value:(n=Zr(ao.mark((function e(){var t,n;return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.destroyed){e.next=2;break}return e.abrupt("return");case 2:if(null!=(null===(t=this.getActiveCamera())||void 0===t?void 0:t.currentResolution)&&!this.scanningPaused&&this.scanner.isReady()&&!this.scanner.isBusyProcessing()&&this.latestVideoTimeProcessed!==this.gui.getVideoCurrentTime()){e.next=5;break}return this.scheduleVideoProcessing(),e.abrupt("return");case 5:if(null!=this.latestVideoTimeProcessed){e.next=8;break}return e.next=8,this.resumeScanning();case 8:return n=performance.now(),this.latestVideoTimeProcessed=this.gui.getVideoCurrentTime(),e.next=12,this.processVideoFrame(!1);case 12:return e.next=14,this.scheduleNextVideoProcessing(n);case 14:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"handleScannerReady",value:function(){this.isReadyToWork=!0,this.eventEmitter.emit("ready")}}],[{key:"ready",value:function(){}},{key:"submitFrame",value:function(e){}},{key:"processFrame",value:function(e){}},{key:"scan",value:function(e){}},{key:"scanError",value:function(e){}},{key:"cameraAccessError",value:function(e){}},{key:"create",value:function(){var n=Zr(ao.mark((function n(r){var i,a,o,s,c,u,l,d,h,m,f,g,p,v,y,b,S,E,A,C,w,_,T,I,N,M,L,k,x,V,O,D,R,j,F,P,U,G,B,z,W,Y,H,Q,Z,q,X,J=arguments;return ao.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a=J.length>1&&void 0!==J[1]?J[1]:{},o=a.visible,s=void 0===o||o,c=a.singleImageModeSettings,u=void 0===c?{}:c,l=a.playSoundOnScan,d=void 0!==l&&l,h=a.vibrateOnScan,m=void 0!==h&&h,f=a.scanningPaused,g=void 0!==f&&f,p=a.guiStyle,v=void 0===p?t.GuiStyle.LASER:p,y=a.videoFit,b=void 0===y?t.ObjectFit.CONTAIN:y,S=a.cameraRecoveryText,E=void 0===S?"Tap/click to resume scanning":S,A=a.laserArea,C=a.viewfinderArea,w=a.scanner,_=a.scanSettings,T=void 0===_?new e.ScanSettings:_,I=a.enableCameraSwitcher,N=void 0===I||I,M=a.enableTorchToggle,L=void 0===M||M,k=a.enableTapToFocus,x=void 0===k||k,V=a.enablePinchToZoom,O=void 0===V||V,D=a.accessCamera,R=void 0===D||D,j=a.camera,F=a.cameraType,P=void 0===F?e.Camera.Type.BACK:F,U=a.cameraSettings,G=a.targetScanningFPS,B=void 0===G?30:G,z=a.hideLogo,W=void 0!==z&&z,Y=e.BrowserHelper.userAgentInfo.getDevice().type,H=null!==(i="mobile"===Y||"tablet"===Y?u.mobile:u.desktop)&&void 0!==i?i:{},Q=H.usageStrategy===e.SingleImageModeSettings.UsageStrategy.NEVER,Z=H.usageStrategy===e.SingleImageModeSettings.UsageStrategy.ALWAYS,(q=e.BrowserHelper.checkBrowserCompatibility()).scannerSupport&&(!Q||q.fullSupport)){n.next=9;break}throw new ic(q);case 9:if(q.fullSupport||Z||e.Logger.log(e.Logger.Level.INFO,"BarcodePicker's Single Image Mode is being used as fallback as the OS/browser combination doesn't support camera video stream scanning (https://caniuse.com/#feat=stream). You can configure this behaviour via the \"singleImageModeSettings\" option.",q),"done"===e.configurePhase){n.next=12;break}throw new $s({name:"LibraryNotConfiguredError",message:"started"===e.configurePhase?"The library has not completed its configuration yet, please call 'configure' and wait for the returned\n              promise's resolution":"The library was not configured, 'configure' must be called with valid parameters before instantiating\n              the BarcodePicker"});case 12:if(e.BrowserHelper.isValidHTMLElement(r)){n.next=14;break}throw new $s({name:"NoOriginElementError",message:"A valid origin HTML element must be given"});case 14:if((X=new t(r,{visible:s,singleImageModeEnabled:!q.fullSupport||Z,singleImageModeSettings:H,playSoundOnScan:d,vibrateOnScan:m,scanningPaused:g,guiStyle:v,videoFit:b,cameraRecoveryText:E,laserArea:A,viewfinderArea:C,scanner:w,scanSettings:T,cameraType:P,targetScanningFPS:B,hideLogo:W})).cameraManager.setInteractionOptions(N,!1,L,x,O),X.cameraManager.setInitialCameraType(P),X.cameraManager.setSelectedCamera(j),X.cameraManager.setSelectedCameraSettings(U),X.cameraAccess=R,X.on("scanError",(function(e){["localhost","127.0.0.1",""].includes(window.location.hostname)&&alert(e)})),!R){n.next=24;break}return n.next=24,X.cameraManager.setupCameras();case 24:return n.abrupt("return",X);case 25:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()}]),t}(),(Bu=(Gu=e.BarcodePicker||(e.BarcodePicker={})).GuiStyle||(Gu.GuiStyle={})).NONE="none",Bu.LASER="laser",Bu.VIEWFINDER="viewfinder",(zu=Gu.ObjectFit||(Gu.ObjectFit={})).CONTAIN="contain",zu.COVER="cover",function(e){e.ACCESS_CAMERA="accessCamera",e.CAMERA="camera",e.CAMERA_SETTINGS="cameraSettings",e.CAMERA_TYPE="cameraType",e.CONFIGURE="configure",e.ENABLE_CAMERA_SWITCHER="enableCameraSwitcher",e.ENABLE_PINCH_TO_ZOOM="enablePinchToZoom",e.ENABLE_TAP_TO_FOCUS="enableTapToFocus",e.ENABLE_TORCH_TOGGLE="enableTorchToggle",e.GUI_STYLE="guiStyle",e.LASER_AREA="laserArea",e.PLAY_SOUND_ON_SCAN="playSoundOnScan",e.SCANNING_PAUSED="scanningPaused",e.SINGLE_IMAGE_MODE_SETTINGS="singleImageModeSettings",e.TARGET_SCANNING_FPS="targetScanningFPS",e.VIBRATE_ON_SCAN="vibrateOnScan",e.VIDEO_FIT="videoFit",e.VIEWFINDER_AREA="viewfinderArea",e.VISIBLE="visible",e.CONFIGURE_ENGINE_LOCATION="configure.engineLocation",e.CONFIGURE_LICENSE_KEY="configure.licenseKey",e.CONFIGURE_HIGH_QUALITY_BLURRY_RECOGNITION="configure.highQualityBlurryRecognition",e.CONFIGURE_LOAD_TEXT_RECOGNITION="configure.loadTextRecognition",e.SCAN_SETTINGS_BLURRY_RECOGNITION="scanSettings.blurryRecognition",e.SCAN_SETTINGS_CODE_DIRECTION_HINT="scanSettings.codeDirectionHint",e.SCAN_SETTINGS_CODE_DUPLICATE_FILTER="scanSettings.codeDuplicateFilter",e.SCAN_SETTINGS_DEVICE_NAME="scanSettings.deviceName",e.SCAN_SETTINGS_ENABLED_SYMBOLOGIES="scanSettings.enabledSymbologies",e.SCAN_SETTINGS_GPU_ACCELERATION="scanSettings.gpuAcceleration",e.SCAN_SETTINGS_MAX_NUMBER_OF_CODES_PER_FRAME="scanSettings.maxNumberOfCodesPerFrame",e.SCAN_SETTINGS_RECOGNITION_MODE="scanSettings.recognitionMode",e.SCAN_SETTINGS_SEARCH_AREA="scanSettings.searchArea",e.SCAN_SETTINGS_TEXT_RECOGNITION_SETTINGS="scanSettings.textRecognitionSettings"}(Wu||(Wu={}));var Ll,kl,xl,Vl,Ol,Dl,Rl,jl,Fl,Pl,Ul,Gl,Bl,zl,Wl,Yl,Hl,Ql,Zl,ql,Xl,Jl,Kl,$l,ed,td,nd,rd,id,ad,od,sd,cd,ud,ld=Oc(Wu);function dd(){return null!=Ll?Ll:Ll=Object.freeze({[Wu.ACCESS_CAMERA]:{type:"boolean",default:!0},[Wu.CAMERA]:{type:"camera",default:void 0},[Wu.CAMERA_SETTINGS]:{type:"cameraSettings",default:void 0},[Wu.CAMERA_TYPE]:{type:"cameraType",default:e.Camera.Type.BACK},[Wu.CONFIGURE]:{type:"boolean",default:!0},[Wu.ENABLE_CAMERA_SWITCHER]:{type:"boolean",default:!0},[Wu.ENABLE_PINCH_TO_ZOOM]:{type:"boolean",default:!0},[Wu.ENABLE_TAP_TO_FOCUS]:{type:"boolean",default:!0},[Wu.ENABLE_TORCH_TOGGLE]:{type:"boolean",default:!0},[Wu.GUI_STYLE]:{type:"guiStyle",default:e.BarcodePicker.GuiStyle.LASER},[Wu.LASER_AREA]:{type:"searchArea",default:void 0},[Wu.PLAY_SOUND_ON_SCAN]:{type:"boolean",default:!0},[Wu.SCANNING_PAUSED]:{type:"boolean",default:!1},[Wu.SINGLE_IMAGE_MODE_SETTINGS]:{type:"singleImageModeSettings",default:void 0},[Wu.TARGET_SCANNING_FPS]:{type:"integer",default:30},[Wu.VIBRATE_ON_SCAN]:{type:"boolean",default:!1},[Wu.VIDEO_FIT]:{type:"videoFit",default:e.BarcodePicker.ObjectFit.CONTAIN},[Wu.VIEWFINDER_AREA]:{type:"searchArea",default:void 0},[Wu.VISIBLE]:{type:"boolean",default:!0},[Wu.CONFIGURE_ENGINE_LOCATION]:{type:"string",default:"/"},[Wu.CONFIGURE_LICENSE_KEY]:{type:"string",default:""},[Wu.CONFIGURE_HIGH_QUALITY_BLURRY_RECOGNITION]:{type:"boolean",default:!1},[Wu.CONFIGURE_LOAD_TEXT_RECOGNITION]:{type:"boolean",default:!1},[Wu.SCAN_SETTINGS_BLURRY_RECOGNITION]:{type:"boolean",default:!0},[Wu.SCAN_SETTINGS_CODE_DIRECTION_HINT]:{type:"codeDirection",default:e.ScanSettings.CodeDirection.LEFT_TO_RIGHT},[Wu.SCAN_SETTINGS_CODE_DUPLICATE_FILTER]:{type:"integer",default:0},[Wu.SCAN_SETTINGS_DEVICE_NAME]:{type:"string",default:void 0},[Wu.SCAN_SETTINGS_ENABLED_SYMBOLOGIES]:{type:"array",default:[]},[Wu.SCAN_SETTINGS_GPU_ACCELERATION]:{type:"boolean",default:!0},[Wu.SCAN_SETTINGS_MAX_NUMBER_OF_CODES_PER_FRAME]:{type:"integer",default:1},[Wu.SCAN_SETTINGS_RECOGNITION_MODE]:{type:"recognitionMode",default:e.ScanSettings.RecognitionMode.CODE},[Wu.SCAN_SETTINGS_SEARCH_AREA]:{type:"searchArea",default:void 0},[Wu.SCAN_SETTINGS_TEXT_RECOGNITION_SETTINGS]:{type:"textRecognitionSettings",default:void 0}})}kl=Wu.ACCESS_CAMERA,xl=Wu.CAMERA,Vl=Wu.CAMERA_SETTINGS,Ol=Wu.CAMERA_TYPE,Dl=Wu.CONFIGURE,Rl=Wu.ENABLE_CAMERA_SWITCHER,jl=Wu.ENABLE_PINCH_TO_ZOOM,Fl=Wu.ENABLE_TAP_TO_FOCUS,Pl=Wu.ENABLE_TORCH_TOGGLE,Ul=Wu.GUI_STYLE,Gl=Wu.LASER_AREA,Bl=Wu.PLAY_SOUND_ON_SCAN,zl=Wu.SCANNING_PAUSED,Wl=Wu.SINGLE_IMAGE_MODE_SETTINGS,Yl=Wu.TARGET_SCANNING_FPS,Hl=Wu.VIBRATE_ON_SCAN,Ql=Wu.VIDEO_FIT,Zl=Wu.VIEWFINDER_AREA,ql=Wu.VISIBLE,Xl=Wu.CONFIGURE_ENGINE_LOCATION,Jl=Wu.CONFIGURE_LICENSE_KEY,Kl=Wu.CONFIGURE_HIGH_QUALITY_BLURRY_RECOGNITION,$l=Wu.CONFIGURE_LOAD_TEXT_RECOGNITION,ed=Wu.SCAN_SETTINGS_BLURRY_RECOGNITION,td=Wu.SCAN_SETTINGS_CODE_DIRECTION_HINT,nd=Wu.SCAN_SETTINGS_CODE_DUPLICATE_FILTER,rd=Wu.SCAN_SETTINGS_DEVICE_NAME,id=Wu.SCAN_SETTINGS_ENABLED_SYMBOLOGIES,ad=Wu.SCAN_SETTINGS_GPU_ACCELERATION,od=Wu.SCAN_SETTINGS_MAX_NUMBER_OF_CODES_PER_FRAME,sd=Wu.SCAN_SETTINGS_RECOGNITION_MODE,cd=Wu.SCAN_SETTINGS_SEARCH_AREA,ud=Wu.SCAN_SETTINGS_TEXT_RECOGNITION_SETTINGS;var hd=function(){function e(t,n){qo(this,e),ec(this,"schema",void 0),ec(this,"view",void 0),this.schema=t,this.view=n}return Zo(e,[{key:kl,get:function(){return this.convertToPrimary(Wu.ACCESS_CAMERA)}},{key:xl,get:function(){return this.convertToPrimary(Wu.CAMERA)}},{key:Vl,get:function(){return this.convertToPrimary(Wu.CAMERA_SETTINGS)}},{key:Ol,get:function(){return this.convertToPrimary(Wu.CAMERA_TYPE)}},{key:Dl,get:function(){return this.convertToPrimary(Wu.CONFIGURE)}},{key:Rl,get:function(){return this.convertToPrimary(Wu.ENABLE_CAMERA_SWITCHER)}},{key:jl,get:function(){return this.convertToPrimary(Wu.ENABLE_PINCH_TO_ZOOM)}},{key:Fl,get:function(){return this.convertToPrimary(Wu.ENABLE_TAP_TO_FOCUS)}},{key:Pl,get:function(){return this.convertToPrimary(Wu.ENABLE_TORCH_TOGGLE)}},{key:Ul,get:function(){return this.convertToPrimary(Wu.GUI_STYLE)}},{key:Gl,get:function(){return this.convertToPrimary(Wu.LASER_AREA)}},{key:Bl,get:function(){return this.convertToPrimary(Wu.PLAY_SOUND_ON_SCAN)}},{key:zl,get:function(){return this.convertToPrimary(Wu.SCANNING_PAUSED)}},{key:Wl,get:function(){return this.convertToPrimary(Wu.SINGLE_IMAGE_MODE_SETTINGS)}},{key:Yl,get:function(){return this.convertToPrimary(Wu.TARGET_SCANNING_FPS)}},{key:Hl,get:function(){return this.convertToPrimary(Wu.VIBRATE_ON_SCAN)}},{key:Ql,get:function(){return this.convertToPrimary(Wu.VIDEO_FIT)}},{key:Zl,get:function(){return this.convertToPrimary(Wu.VIEWFINDER_AREA)}},{key:ql,get:function(){return this.convertToPrimary(Wu.VISIBLE)}},{key:Xl,get:function(){return this.convertToPrimary(Wu.CONFIGURE_ENGINE_LOCATION)}},{key:Jl,get:function(){return this.convertToPrimary(Wu.CONFIGURE_LICENSE_KEY)}},{key:Kl,get:function(){return this.convertToPrimary(Wu.CONFIGURE_HIGH_QUALITY_BLURRY_RECOGNITION)}},{key:$l,get:function(){return this.convertToPrimary(Wu.CONFIGURE_LOAD_TEXT_RECOGNITION)}},{key:ed,get:function(){return this.convertToPrimary(Wu.SCAN_SETTINGS_BLURRY_RECOGNITION)}},{key:td,get:function(){return this.convertToPrimary(Wu.SCAN_SETTINGS_CODE_DIRECTION_HINT)}},{key:nd,get:function(){return this.convertToPrimary(Wu.SCAN_SETTINGS_CODE_DUPLICATE_FILTER)}},{key:rd,get:function(){return this.convertToPrimary(Wu.SCAN_SETTINGS_DEVICE_NAME)}},{key:id,get:function(){return this.convertToPrimary(Wu.SCAN_SETTINGS_ENABLED_SYMBOLOGIES)}},{key:ad,get:function(){return this.convertToPrimary(Wu.SCAN_SETTINGS_GPU_ACCELERATION)}},{key:od,get:function(){return this.convertToPrimary(Wu.SCAN_SETTINGS_MAX_NUMBER_OF_CODES_PER_FRAME)}},{key:sd,get:function(){return this.convertToPrimary(Wu.SCAN_SETTINGS_RECOGNITION_MODE)}},{key:cd,get:function(){return this.convertToPrimary(Wu.SCAN_SETTINGS_SEARCH_AREA)}},{key:ud,get:function(){return this.convertToPrimary(Wu.SCAN_SETTINGS_TEXT_RECOGNITION_SETTINGS)}},{key:"convertToPrimary",value:function(e){var t;return function(e,t){switch(e.type){case"boolean":return n=t,r=e.default,null==n?r:"false"!==n;case"string":case"guiStyle":case"cameraType":case"videoFit":case"codeDirection":case"recognitionMode":return function(e,t){return null!=e?e:t}(t,e.default);case"array":return function(e,t){if(null==e)return t;var n=Ml(e);return null!=n&&Array.isArray(n)?n:t}(t,e.default);case"integer":return function(e,t){if(null==e)return t;var n=bu(e,10);return isNaN(n)?t:n}(t,e.default);case"searchArea":case"camera":case"cameraSettings":case"singleImageModeSettings":return Nl(t,e.default);case"textRecognitionSettings":return new Fc(Nl(t,e.default))}var n,r;return Il(e)}(this.schema[e],null!==(t=this.view.getAttribute(e))&&void 0!==t?t:void 0)}}]),e}();function md(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o}var fd=function(){function t(){qo(this,t)}return Zo(t,null,[{key:"isBooleanAttribute",value:function(e){return"true"===e||"false"===e}},{key:"isBooleanProperty",value:function(e){return"boolean"==typeof e}},{key:"isIntegerAttribute",value:function(e){return"string"==typeof e&&/^-?\d+$/.test(e)}},{key:"isIntegerProperty",value:function(e){return Number.isInteger(e)}},{key:"isValidCameraType",value:function(t){return Oc(e.Camera.Type).includes(t)}},{key:"isValidGuiStyle",value:function(t){return Oc(e.BarcodePicker.GuiStyle).includes(t)}},{key:"isValidVideoFit",value:function(t){return Oc(e.BarcodePicker.ObjectFit).includes(t)}},{key:"isValidCodeDirection",value:function(t){return Oc(e.ScanSettings.CodeDirection).includes(t)}},{key:"isValidRecognitionMode",value:function(t){return Oc(e.ScanSettings.RecognitionMode).includes(t)}},{key:"isArray",value:function(e){return Array.isArray(e)}},{key:"isValidJsonArray",value:function(e){var t;try{t=JSON.parse(e)}catch(e){return!1}return Array.isArray(t)}},{key:"isValidSearchAreaAttribute",value:function(e){var n;try{n=JSON.parse(e)}catch(e){return!1}return t.isValidSearchAreaProperty(n)}},{key:"isValidSearchAreaProperty",value:function(e){return null!=e&&"object"==typeof e&&e.x>=0&&e.x<=1&&e.y>=0&&e.y<=1&&e.width>=0&&e.width<=1&&e.height>=0&&e.height<=1}},{key:"isValidCameraObject",value:function(e){var t,n;try{n=JSON.parse(e)}catch(e){return!1}return"string"==typeof(null===(t=n)||void 0===t?void 0:t.deviceId)}},{key:"isValidCameraSettingsObject",value:function(e){var t,n;try{n=JSON.parse(e)}catch(e){return!1}return"string"==typeof(null===(t=n)||void 0===t?void 0:t.resolutionPreference)}},{key:"isValidSingleImageModeSettingsObject",value:function(e){var t;try{t=JSON.parse(e)}catch(e){return!1}return null!=t&&"object"==typeof t}},{key:"isValidTextRecognitionSettingsObject",value:function(e){var t;try{t=JSON.parse(e)}catch(e){return!1}return null!=t&&"object"==typeof t}},{key:"getExpectationMessageForType",value:function(e){return{booleanAttribute:'Expected one of "true" or "false"',boolean:"Boolean expected",integer:"Integer expected",array:"Array expected",jsonArray:"Expected JSON array",videoFit:'Expected a valid BarcodePicker.ObjectFit"',camera:"Expected JSON object having properties of a Camera object",cameraSettings:"Expected JSON object having properties of a CameraSettings object",cameraType:'Expected a valid Camera.Type"',codeDirection:'Expected a valid ScanSettings.CodeDirection"',recognitionMode:'Expected a valid ScanSettings.RecognitionMode"',guiStyle:'Expected a valid BarcodePicker.GuiStyle"',searchArea:"Expected JSON object having properties of a SearchArea object",singleImageModeSettings:"Expected JSON object having properties of a SingleImageModeSettings object",textRecognitionSettings:"Expected JSON object having properties of a TextRecognitionSettings object"}[e]}}]),t}();function gd(e){return function(t,n){t.expectationMessage.set(t[n],t.getExpectationMessageForType(e))}}function pd(e,t){var n=Object.keys(e);if(Bc){var r=Bc(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pd(Object(n),!0).forEach((function(t){ec(e,t,n[t])})):Jc?Object.defineProperties(e,Jc(n)):pd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}ec(fd,"expectationMessage",new qs),md([gd("booleanAttribute")],fd,"isBooleanAttribute",null),md([gd("boolean")],fd,"isBooleanProperty",null),md([gd("integer")],fd,"isIntegerAttribute",null),md([gd("integer")],fd,"isIntegerProperty",null),md([gd("cameraType")],fd,"isValidCameraType",null),md([gd("guiStyle")],fd,"isValidGuiStyle",null),md([gd("videoFit")],fd,"isValidVideoFit",null),md([gd("codeDirection")],fd,"isValidCodeDirection",null),md([gd("recognitionMode")],fd,"isValidRecognitionMode",null),md([gd("array")],fd,"isArray",null),md([gd("jsonArray")],fd,"isValidJsonArray",null),md([gd("searchArea")],fd,"isValidSearchAreaAttribute",null),md([gd("searchArea")],fd,"isValidSearchAreaProperty",null),md([gd("camera")],fd,"isValidCameraObject",null),md([gd("cameraSettings")],fd,"isValidCameraSettingsObject",null),md([gd("singleImageModeSettings")],fd,"isValidSingleImageModeSettingsObject",null),md([gd("textRecognitionSettings")],fd,"isValidTextRecognitionSettingsObject",null);var yd=function(){function t(n){qo(this,t),ec(this,"view",void 0),ec(this,"picker",void 0),ec(this,"lazyAttributeConverter",void 0),ec(this,"scanSettings",void 0),ec(this,"viewConnected",!1),ec(this,"trackAttributes",!0),ec(this,"allSymbologies",Oc(e.Barcode.Symbology).filter((function(e){return"string"==typeof e}))),this.view=n}var n,r,i,a;return Zo(t,[{key:"viewConnectedCallback",value:(a=Zr(ao.mark((function e(){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.viewConnected=!0,this.view.initializeDom(),this.initializeAttributeConversionGetter(),!this.lazyAttributeConverter[Wu.CONFIGURE]){e.next=6;break}return e.next=6,this.initPicker();case 6:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"attributeChangedCallback",value:function(e){if(this.viewConnected&&this.trackAttributes){var t=this.view.getAttribute(e);if(null==t||this.validateAttribute(e,t)){var n=this.attributeToCamelCase(e);this.applyChangeFromAttributeChange(n)}}}},{key:"viewDisconnectedCallback",value:function(){this.viewConnected=!1,this.picker.destroy(),delete this.picker,delete this.scanSettings}},{key:"applyChangeFromAttributeChange",value:function(t){var n=this;switch(t){case Wu.ACCESS_CAMERA:this.lazyAttributeConverter[Wu.ACCESS_CAMERA]?this.picker.accessCamera().catch((function(t){e.Logger.log(e.Logger.Level.WARN,"Error while accessing the camera:",t)})):this.picker.pauseCameraAccess();break;case Wu.ENABLE_CAMERA_SWITCHER:this.picker.setCameraSwitcherEnabled(this.lazyAttributeConverter[Wu.ENABLE_CAMERA_SWITCHER]);break;case Wu.ENABLE_PINCH_TO_ZOOM:this.picker.setPinchToZoomEnabled(this.lazyAttributeConverter[Wu.ENABLE_PINCH_TO_ZOOM]);break;case Wu.ENABLE_TAP_TO_FOCUS:this.picker.setTapToFocusEnabled(this.lazyAttributeConverter[Wu.ENABLE_TAP_TO_FOCUS]);break;case Wu.ENABLE_TORCH_TOGGLE:this.picker.setTorchToggleEnabled(this.lazyAttributeConverter[Wu.ENABLE_TORCH_TOGGLE]);break;case Wu.GUI_STYLE:this.picker.setGuiStyle(this.lazyAttributeConverter[Wu.GUI_STYLE]);break;case Wu.LASER_AREA:this.picker.setLaserArea(this.lazyAttributeConverter[Wu.LASER_AREA]);break;case Wu.PLAY_SOUND_ON_SCAN:this.picker.setPlaySoundOnScanEnabled(this.lazyAttributeConverter[Wu.PLAY_SOUND_ON_SCAN]);break;case Wu.SCANNING_PAUSED:if(this.lazyAttributeConverter[Wu.SCANNING_PAUSED]){this.picker.pauseScanning();break}this.picker.resumeScanning().catch((function(t){e.Logger.log(e.Logger.Level.WARN,"Error while resuming scanning:",t)}));break;case Wu.TARGET_SCANNING_FPS:this.picker.setTargetScanningFPS(this.lazyAttributeConverter[Wu.TARGET_SCANNING_FPS]);break;case Wu.VIBRATE_ON_SCAN:this.picker.setVibrateOnScanEnabled(this.lazyAttributeConverter[Wu.VIBRATE_ON_SCAN]);break;case Wu.VIDEO_FIT:this.picker.setVideoFit(this.lazyAttributeConverter[Wu.VIDEO_FIT]);break;case Wu.VIEWFINDER_AREA:this.picker.setViewfinderArea(this.lazyAttributeConverter[Wu.VIEWFINDER_AREA]);break;case Wu.VISIBLE:this.picker.setVisible(this.lazyAttributeConverter[Wu.VISIBLE]);break;case Wu.CAMERA:this.getCameraFromAttribute().then((function(t){n.picker.setActiveCamera(t).catch((function(t){e.Logger.log(e.Logger.Level.WARN,"Error while setting the active camera:",t)}))})).catch((function(t){e.Logger.log(e.Logger.Level.WARN,"Error while getting the camera:",t)}));break;case Wu.CAMERA_TYPE:this.picker.setCameraType(this.lazyAttributeConverter[Wu.CAMERA_TYPE]).catch((function(t){e.Logger.log(e.Logger.Level.WARN,"Error while setting camera type:",t)}));break;case Wu.CAMERA_SETTINGS:this.picker.applyCameraSettings(this.lazyAttributeConverter[Wu.CAMERA_SETTINGS]).catch((function(t){e.Logger.log(e.Logger.Level.WARN,"Error while applying camera settings:",t)}));break;case Wu.SCAN_SETTINGS_BLURRY_RECOGNITION:this.scanSettings.setBlurryRecognitionEnabled(this.lazyAttributeConverter[Wu.SCAN_SETTINGS_BLURRY_RECOGNITION]),this.picker.applyScanSettings(this.scanSettings);break;case Wu.SCAN_SETTINGS_CODE_DIRECTION_HINT:this.scanSettings.setCodeDirectionHint(this.lazyAttributeConverter[Wu.SCAN_SETTINGS_CODE_DIRECTION_HINT]),this.picker.applyScanSettings(this.scanSettings);break;case Wu.SCAN_SETTINGS_CODE_DUPLICATE_FILTER:this.scanSettings.setCodeDuplicateFilter(this.lazyAttributeConverter[Wu.SCAN_SETTINGS_CODE_DUPLICATE_FILTER]),this.picker.applyScanSettings(this.scanSettings);break;case Wu.SCAN_SETTINGS_DEVICE_NAME:this.scanSettings.setDeviceName(this.lazyAttributeConverter[Wu.SCAN_SETTINGS_DEVICE_NAME]),this.picker.applyScanSettings(this.scanSettings);break;case Wu.SCAN_SETTINGS_ENABLED_SYMBOLOGIES:this.onEnabledSymbologiesChanged();break;case Wu.SCAN_SETTINGS_GPU_ACCELERATION:this.scanSettings.setGpuAccelerationEnabled(this.lazyAttributeConverter[Wu.SCAN_SETTINGS_GPU_ACCELERATION]),this.picker.applyScanSettings(this.scanSettings);break;case Wu.SCAN_SETTINGS_MAX_NUMBER_OF_CODES_PER_FRAME:this.scanSettings.setMaxNumberOfCodesPerFrame(this.lazyAttributeConverter[Wu.SCAN_SETTINGS_MAX_NUMBER_OF_CODES_PER_FRAME]),this.picker.applyScanSettings(this.scanSettings);break;case Wu.SCAN_SETTINGS_RECOGNITION_MODE:this.scanSettings.setRecognitionMode(this.lazyAttributeConverter[Wu.SCAN_SETTINGS_RECOGNITION_MODE]),this.picker.applyScanSettings(this.scanSettings);break;case Wu.SCAN_SETTINGS_SEARCH_AREA:this.scanSettings.setSearchArea(this.lazyAttributeConverter[Wu.SCAN_SETTINGS_SEARCH_AREA]),this.picker.applyScanSettings(this.scanSettings);break;case Wu.SCAN_SETTINGS_TEXT_RECOGNITION_SETTINGS:this.scanSettings.setTextRecognitionSettings(this.lazyAttributeConverter[Wu.SCAN_SETTINGS_TEXT_RECOGNITION_SETTINGS]),this.picker.applyScanSettings(this.scanSettings);break;case Wu.CONFIGURE:this.lazyAttributeConverter[Wu.CONFIGURE]&&this.initPicker().catch((function(t){e.Logger.log(e.Logger.Level.WARN,"Error while initializing barcode picker:",t)}));break;case Wu.SINGLE_IMAGE_MODE_SETTINGS:case Wu.CONFIGURE_ENGINE_LOCATION:case Wu.CONFIGURE_LICENSE_KEY:case Wu.CONFIGURE_HIGH_QUALITY_BLURRY_RECOGNITION:case Wu.CONFIGURE_LOAD_TEXT_RECOGNITION:break;default:Il(t)}}},{key:"initPicker",value:(i=Zr(ao.mark((function t(){return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==this.picker){t.next=2;break}return t.abrupt("return");case 2:return this.validateAllAttributes(),t.prev=3,t.next=6,Ad(this.lazyAttributeConverter[Wu.CONFIGURE_LICENSE_KEY],{engineLocation:this.lazyAttributeConverter[Wu.CONFIGURE_ENGINE_LOCATION],highQualityBlurryRecognition:this.lazyAttributeConverter[Wu.CONFIGURE_HIGH_QUALITY_BLURRY_RECOGNITION],loadTextRecognition:this.lazyAttributeConverter[Wu.CONFIGURE_LOAD_TEXT_RECOGNITION]});case 6:return t.t0=Proxy,t.t1=e.BarcodePicker,t.t2=this.view.root,t.t3=this.lazyAttributeConverter[Wu.ACCESS_CAMERA],t.next=12,this.getCameraFromAttribute();case 12:return t.t4=t.sent,t.t5=this.lazyAttributeConverter[Wu.CAMERA_TYPE],t.t6=this.lazyAttributeConverter[Wu.ENABLE_CAMERA_SWITCHER],t.t7=this.lazyAttributeConverter[Wu.ENABLE_PINCH_TO_ZOOM],t.t8=this.lazyAttributeConverter[Wu.ENABLE_TAP_TO_FOCUS],t.t9=this.lazyAttributeConverter[Wu.ENABLE_TORCH_TOGGLE],t.t10=this.lazyAttributeConverter[Wu.PLAY_SOUND_ON_SCAN],t.t11=this.lazyAttributeConverter[Wu.VIBRATE_ON_SCAN],t.t12=this.lazyAttributeConverter[Wu.SCANNING_PAUSED],t.t13=this.lazyAttributeConverter[Wu.GUI_STYLE],t.t14=this.lazyAttributeConverter[Wu.TARGET_SCANNING_FPS],t.t15=this.lazyAttributeConverter[Wu.VIDEO_FIT],t.t16=this.lazyAttributeConverter[Wu.VISIBLE],t.t17=this.lazyAttributeConverter[Wu.VIEWFINDER_AREA],t.t18=this.lazyAttributeConverter[Wu.LASER_AREA],t.next=29,this.getSingleImageModeSettings();case 29:return t.t19=t.sent,t.t20={accessCamera:t.t3,camera:t.t4,cameraType:t.t5,enableCameraSwitcher:t.t6,enablePinchToZoom:t.t7,enableTapToFocus:t.t8,enableTorchToggle:t.t9,playSoundOnScan:t.t10,vibrateOnScan:t.t11,scanningPaused:t.t12,guiStyle:t.t13,targetScanningFPS:t.t14,videoFit:t.t15,visible:t.t16,viewfinderArea:t.t17,laserArea:t.t18,singleImageModeSettings:t.t19},t.next=33,t.t1.create.call(t.t1,t.t2,t.t20);case 33:t.t21=t.sent,t.t22=this.getBarcodePickerProxyHandler(),this.picker=new t.t0(t.t21,t.t22),t.next=41;break;case 38:return t.prev=38,t.t23=t.catch(3),t.abrupt("return",this.handleException(t.t23));case 41:this.scanSettings=new e.ScanSettings({textRecognitionSettings:this.lazyAttributeConverter[Wu.SCAN_SETTINGS_TEXT_RECOGNITION_SETTINGS],recognitionMode:this.lazyAttributeConverter[Wu.SCAN_SETTINGS_RECOGNITION_MODE],blurryRecognition:this.lazyAttributeConverter[Wu.SCAN_SETTINGS_BLURRY_RECOGNITION],codeDirectionHint:this.lazyAttributeConverter[Wu.SCAN_SETTINGS_CODE_DIRECTION_HINT],codeDuplicateFilter:this.lazyAttributeConverter[Wu.SCAN_SETTINGS_CODE_DUPLICATE_FILTER],deviceName:this.lazyAttributeConverter[Wu.SCAN_SETTINGS_DEVICE_NAME],enabledSymbologies:this.lazyAttributeConverter[Wu.SCAN_SETTINGS_ENABLED_SYMBOLOGIES],gpuAcceleration:this.lazyAttributeConverter[Wu.SCAN_SETTINGS_GPU_ACCELERATION],maxNumberOfCodesPerFrame:this.lazyAttributeConverter[Wu.SCAN_SETTINGS_MAX_NUMBER_OF_CODES_PER_FRAME],searchArea:this.lazyAttributeConverter[Wu.SCAN_SETTINGS_SEARCH_AREA]}),this.picker.applyScanSettings(this.scanSettings),this.picker.on("ready",this.dispatchPickerEvent.bind(this,"ready")),this.picker.on("submitFrame",this.dispatchPickerEvent.bind(this,"submitFrame")),this.picker.on("processFrame",this.dispatchPickerEvent.bind(this,"processFrame")),this.picker.on("scan",this.dispatchPickerEvent.bind(this,"scan")),this.picker.on("scanError",this.dispatchPickerEvent.bind(this,"scanError"));case 48:case"end":return t.stop()}}),t,this,[[3,38]])}))),function(){return i.apply(this,arguments)})},{key:"getBarcodePickerProxyHandler",value:function(){var e,t,n=this,r=this;return{get:function(i,a){return"gui"===a?function(t){return null==e&&(e=new Proxy(t.gui,{set:function(e,t,n){return Reflect.set(e,t,n),r.onPickerPropertyUpdate.call(r,{origin:"gui",key:t,newValue:n}),!0}})),e}(i):"cameraManager"===a?function(e){return null==t&&(t=new Proxy(e.cameraManager,{set:function(e,t,n){return Reflect.set(e,t,n),r.onPickerPropertyUpdate.call(r,{origin:"cameraManager",key:t,newValue:n}),!0}})),t}(i):"applyScanSettings"===a?function(e){Reflect.apply(Reflect.get(i,a),i,[e]),n.onScannerNewScanSettings(e)}:Reflect.get(i,a)},set:function(e,t,r){return Reflect.set(e,t,r),n.onPickerPropertyUpdate({key:t,origin:"picker",newValue:r}),!0}}}},{key:"onScannerNewScanSettings",value:function(t){var n=this,r=Oc(e.Barcode.Symbology).filter((function(e){return"string"==typeof e}));[{key:Wu.SCAN_SETTINGS_BLURRY_RECOGNITION,newValue:t.isBlurryRecognitionEnabled()},{key:Wu.SCAN_SETTINGS_CODE_DIRECTION_HINT,newValue:t.getCodeDirectionHint()},{key:Wu.SCAN_SETTINGS_CODE_DUPLICATE_FILTER,newValue:t.getCodeDuplicateFilter()},{key:Wu.SCAN_SETTINGS_DEVICE_NAME,newValue:t.getDeviceName()},{key:Wu.SCAN_SETTINGS_ENABLED_SYMBOLOGIES,newValue:r.reduce((function(n,r){return t.isSymbologyEnabled(r)&&n.push(e.Barcode.Symbology.toJSONName(r)),n}),[])},{key:Wu.SCAN_SETTINGS_GPU_ACCELERATION,newValue:t.isGpuAccelerationEnabled()},{key:Wu.SCAN_SETTINGS_MAX_NUMBER_OF_CODES_PER_FRAME,newValue:t.getMaxNumberOfCodesPerFrame()},{key:Wu.SCAN_SETTINGS_RECOGNITION_MODE,newValue:t.getRecognitionMode()},{key:Wu.SCAN_SETTINGS_SEARCH_AREA,newValue:t.getSearchArea()},{key:Wu.SCAN_SETTINGS_TEXT_RECOGNITION_SETTINGS,newValue:t.getTextRecognitionSettings()}].forEach((function(e){n.onPickerPropertyUpdate(vd({origin:"scanner"},e))}))}},{key:"initializeAttributeConversionGetter",value:function(){this.lazyAttributeConverter=new hd(dd(),this.view)}},{key:"getCameraFromAttribute",value:(r=Zr(ao.mark((function t(){var n,r,i,a;return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==(null==(r=this.lazyAttributeConverter[Wu.CAMERA])?void 0:r.deviceId)){t.next=8;break}return t.next=4,e.CameraAccess.getCameras();case 4:i=t.sent,a=r.deviceId,null==(n=i.find((function(e){return e.deviceId===a})))&&e.Logger.log(e.Logger.Level.WARN,'Could not find camera with id "'.concat(a,'", will use default camera.'));case 8:return t.abrupt("return",n);case 9:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"onEnabledSymbologiesChanged",value:function(){var e=this,t=this.lazyAttributeConverter[Wu.SCAN_SETTINGS_ENABLED_SYMBOLOGIES];this.allSymbologies.forEach((function(n){var r=t.includes(n);e.scanSettings.getSymbologySettings(n).setEnabled(r)})),this.picker.applyScanSettings(this.scanSettings)}},{key:"onPickerPropertyUpdate",value:function(e){var t,n,r=this,i=null!==(t=null===(n={gui:{customLaserArea:[Wu.LASER_AREA],customViewfinderArea:[Wu.VIEWFINDER_AREA]},cameraManager:{activeCamera:[Wu.CAMERA,Wu.CAMERA_TYPE],cameraSwitcherEnabled:[Wu.ENABLE_CAMERA_SWITCHER],torchToggleEnabled:[Wu.ENABLE_TORCH_TOGGLE],tapToFocusEnabled:[Wu.ENABLE_TAP_TO_FOCUS],pinchToZoomEnabled:[Wu.ENABLE_PINCH_TO_ZOOM]}}[e.origin])||void 0===n?void 0:n[e.key])&&void 0!==t?t:[e.key];this.trackAttributes=!1,i.forEach((function(t){ld.includes(t)&&(null==e.newValue?r.view.removeAttribute(t):r.view.setAttribute(t,function(e,t){switch(e.type){case"boolean":return t?"true":"false";case"guiStyle":case"integer":case"string":case"videoFit":case"codeDirection":case"recognitionMode":return t.toString();case"array":case"camera":case"cameraSettings":case"searchArea":case"singleImageModeSettings":case"textRecognitionSettings":return Sc(t);case"cameraType":return t.cameraType.toString()}return Il(e)}(dd()[t],e.newValue)))})),this.trackAttributes=!0}},{key:"getSingleImageModeSettings",value:(n=Zr(ao.mark((function t(){var n,r,i,a=this;return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n={},null!=this.lazyAttributeConverter[Wu.SINGLE_IMAGE_MODE_SETTINGS]&&(n.desktop=vd(vd({},e.SingleImageModeSettings.defaultDesktop),null!==(r=this.lazyAttributeConverter[Wu.SINGLE_IMAGE_MODE_SETTINGS].desktop)&&void 0!==r?r:{}),n.mobile=vd(vd({},e.SingleImageModeSettings.defaultMobile),null!==(i=this.lazyAttributeConverter[Wu.SINGLE_IMAGE_MODE_SETTINGS].mobile)&&void 0!==i?i:{})),t.next=4,this.view.waitOnChildrenReady();case 4:return["mobile","desktop"].forEach((function(e){["informationElement","buttonElement"].forEach((function(t){var r=a.view.querySelector('*[slot="singleImageModeSettings.'.concat(e,".").concat(t,'"]'));null!=r&&null!=n[e]&&(n[e][t]=r)}))})),t.abrupt("return",n);case 6:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"dispatchPickerEvent",value:function(e,t){var n=new CustomEvent(e,{detail:t});this.view.dispatchCustomEvent(n)}},{key:"validateAllAttributes",value:function(){var e=this;yo(this.view.getAttributes()).forEach((function(t){ld.includes(t.name)&&e.validateAttribute(t.name,t.value)}))}},{key:"validateAttribute",value:function(t,n){var r,i,a=this.attributeToCamelCase(t);switch(a){case Wu.ACCESS_CAMERA:case Wu.CONFIGURE:case Wu.CONFIGURE_HIGH_QUALITY_BLURRY_RECOGNITION:case Wu.CONFIGURE_LOAD_TEXT_RECOGNITION:case Wu.ENABLE_CAMERA_SWITCHER:case Wu.ENABLE_PINCH_TO_ZOOM:case Wu.ENABLE_TAP_TO_FOCUS:case Wu.ENABLE_TORCH_TOGGLE:case Wu.PLAY_SOUND_ON_SCAN:case Wu.SCANNING_PAUSED:case Wu.VIBRATE_ON_SCAN:case Wu.VISIBLE:case Wu.SCAN_SETTINGS_BLURRY_RECOGNITION:case Wu.SCAN_SETTINGS_GPU_ACCELERATION:r=fd.isBooleanAttribute;break;case Wu.TARGET_SCANNING_FPS:case Wu.SCAN_SETTINGS_CODE_DUPLICATE_FILTER:case Wu.SCAN_SETTINGS_MAX_NUMBER_OF_CODES_PER_FRAME:r=fd.isIntegerAttribute;break;case Wu.SCAN_SETTINGS_CODE_DIRECTION_HINT:r=fd.isValidCodeDirection;break;case Wu.SCAN_SETTINGS_RECOGNITION_MODE:r=fd.isValidRecognitionMode;break;case Wu.SCAN_SETTINGS_TEXT_RECOGNITION_SETTINGS:r=fd.isValidTextRecognitionSettingsObject;break;case Wu.CAMERA_TYPE:r=fd.isValidCameraType;break;case Wu.GUI_STYLE:r=fd.isValidGuiStyle;break;case Wu.VIDEO_FIT:r=fd.isValidVideoFit;break;case Wu.SCAN_SETTINGS_ENABLED_SYMBOLOGIES:r=fd.isValidJsonArray;break;case Wu.VIEWFINDER_AREA:case Wu.LASER_AREA:case Wu.SCAN_SETTINGS_SEARCH_AREA:r=fd.isValidSearchAreaAttribute;break;case Wu.CAMERA:r=fd.isValidCameraObject;break;case Wu.CAMERA_SETTINGS:r=fd.isValidCameraSettingsObject;break;case Wu.SINGLE_IMAGE_MODE_SETTINGS:r=fd.isValidSingleImageModeSettingsObject;break;case Wu.CONFIGURE_ENGINE_LOCATION:case Wu.CONFIGURE_LICENSE_KEY:case Wu.SCAN_SETTINGS_DEVICE_NAME:r=function(){return!0};break;default:Il(a)}return!!r(n)||(e.Logger.log(e.Logger.Level.WARN,'Invalid value for attribute "'.concat(a,'": "').concat(n,'". ').concat(null!==(i=fd.expectationMessage.get(r))&&void 0!==i?i:"")),!1)}},{key:"attributeToCamelCase",value:function(e){var t=ld.findIndex((function(t){return t.toLowerCase()===e.toLowerCase()}));return ld[t]}},{key:"handleException",value:function(t){e.Logger.log(e.Logger.Level.ERROR,t)}}]),t}(),bd=function(e){Ko(a,e);var t,n,r,i=(n=a,r=function(){if("undefined"==typeof Reflect||!zo)return!1;if(zo.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(zo(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=es(n);if(r){var i=es(this).constructor;e=zo(t,arguments,i)}else e=t.apply(this,arguments);return $o(this,e)});function a(){var e;return qo(this,a),ec(Xo(e=i.call(this)),"shadowDom",void 0),ec(Xo(e),"controller",void 0),e.controller=new yd(Xo(e)),e.shadowDom=e.attachShadow({mode:"open"}),e}return Zo(a,[{key:"barcodePicker",get:function(){return this.controller.picker}},{key:"root",get:function(){return this.shadowDom.querySelector("#root")}},{key:"connectedCallback",value:(t=Zr(ao.mark((function e(){return ao.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.controller.viewConnectedCallback();case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"disconnectedCallback",value:function(){this.controller.viewDisconnectedCallback()}},{key:"attributeChangedCallback",value:function(e){this.controller.attributeChangedCallback(e)}},{key:"initializeDom",value:function(){this.shadowDom.innerHTML=this.initialDomContent}},{key:"dispatchCustomEvent",value:function(e){this.dispatchEvent(e)}},{key:"getAttributes",value:function(){return yo(this.attributes).map((function(e){return{name:e.name,value:e.value}}))}},{key:"waitOnChildrenReady",value:function(){return new Hr((function(e){setTimeout(e,50)}))}},{key:"initialDomContent",get:function(){return"\n      <style>".concat(this.styles,'</style>\n      <div id="root"></div>\n    ')}},{key:"wcStyles",get:function(){return"\n      :host {\n        display: block;\n      }\n\n      :host([hidden]) {\n        display: none;\n      }\n\n      #root {\n        height: 100%;\n      }\n    "}},{key:"styles",get:function(){return"\n      ".concat(this.wcStyles,"\n      ").concat(ac,"\n    ")}}],[{key:"observedAttributes",get:function(){return ld.map((function(e){return e.toLowerCase()}))}},{key:"registerComponent",value:function(){if("customElements"in window)return null==customElements.get(a.TAG_NAME)&&customElements.define(a.TAG_NAME,a),a.TAG_NAME}}]),a}(Ks(HTMLElement));ec(bd,"TAG_NAME","scandit-barcode-picker"),bd.registerComponent();var Sd=e.BrowserHelper.getDeviceId();function Ed(){e.configurePhase="unconfigured"}function Ad(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.logLevel,i=void 0===r?e.Logger.Level.DEBUG:r,a=n.engineLocation,o=void 0===a?"/":a,s=n.highQualityBlurryRecognition,c=void 0!==s&&s,u=n.loadTextRecognition,l=void 0!==u&&u;return void 0===n.preloadBlurryRecognition&&void 0===n.preloadEngine||e.Logger.log(e.Logger.Level.WARN,"preloadBlurryRecognition and preloadEngine options have been removed and will not have any effect.\n       Such options are now handled automatically"),"unconfigured"!==e.configurePhase&&null!=e.configurePromise||(e.Logger.setLevel(i),e.configurePromise=wd(t,{engineLocation:o,highQualityBlurryRecognition:c,loadTextRecognition:l,logLevel:i}).catch((function(e){throw Ed(),e}))),e.configurePromise}function Cd(e){return e+=e.endsWith("/")?"":"/",/^https?:\/\//.test(e)?"".concat(e):(e=""===(e=e.split("/").filter((function(e){return e.length>0})).join("/"))?"/":"/".concat(e,"/"),"file:"===location.protocol||"null"===location.origin?"".concat(location.href.split("/").slice(0,-1).join("/")).concat(e):"".concat(location.origin).concat(e))}function wd(e){return _d.apply(this,arguments)}function _d(){return _d=Zr(ao.mark((function t(n){var r,i,a,o,s,c,u,l,d,h,m,f=arguments;return ao.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=f.length>1&&void 0!==f[1]?f[1]:{},i=r.engineLocation,a=void 0===i?"/":i,o=r.highQualityBlurryRecognition,s=void 0!==o&&o,c=r.loadTextRecognition,u=void 0!==c&&c,e.Logger.log(e.Logger.Level.INFO,"Scandit Web SDK version: 5.15.0"),e.configurePhase="started",(l=e.BrowserHelper.checkBrowserCompatibility()).fullSupport||l.scannerSupport){t.next=6;break}throw new ic(l);case 6:if(!(null==n||n.trim().length<64)){t.next=8;break}throw new $s({name:"NoLicenseKeyError",message:"No license key provided"});case 8:if(e.userLicenseKey=n,e.scanditDataCaptureLocation=Cd(a),d=e.BrowserHelper.userAgentInfo.getBrowser().name,h=e.BrowserHelper.userAgentInfo.getOS().name,null!=d&&!d.includes("Safari")&&null!=h&&"iOS"!==h||null==window.indexedDB||!("databases"in indexedDB)){t.next=15;break}return t.next=15,new Hr((function(e){function t(){indexedDB.databases().then(e).catch((function(){}))}m=window.setInterval(t,50),t()})).then((function(){clearInterval(m)}));case 15:return e.highEndBlurryRecognition=s,e.textRecognition=u,e.dataCaptureLoader=new rc(!1),t.next=20,new Hr((function(e){e(!0)}));case 20:e.configurePhase="done";case 21:case"end":return t.stop()}}),t)}))),_d.apply(this,arguments)}e.userLicenseKey=void 0,e.scanditDataCaptureLocation=void 0,e.highEndBlurryRecognition=void 0,e.textRecognition=void 0,e.dataCaptureLoader=void 0,e.configurePhase="unconfigured",e.configurePromise=void 0,e.CustomError=$s,e.ScanResult=Nc,e.Scanner=Gc,e.TextRecognitionSettings=Fc,e.UAParser=_o,e.configure=Ad,e.dataCapture=tc,e.dataCaptureWorkerBlob=nc,e.deviceId=Sd,e.resetConfigure=Ed,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=index.min.js.map
