Oa("String.prototype.startsWith",function(d){returnd?d:function(c,a){if(null==this)thrownewTypeError("The 'this' value for String.prototype.startsWith must not be null or undefined");if(cinstanceofRegExp)thrownewTypeError("First argument to String.prototype.startsWith must not be a regular expression");varb=this+"";c+="";varg=b.length,d=c.length;a=Math.max(0,Math.min(a|0,b.length));for(varh=0;h<d&&a<g;)if(b[a++]!=c[h++])return!1;returnh>=d}});
ra=qa}varNa="";try{Na=decodeURIComponent(ra)}catch(J){console.log(J),Na=ra}varsb=Na}elsesb=qa;a=xb=sb}catch(J){if(!J.message.startsWith("QR Error"))throwJ;}finally{self.postMessage({type:"qrResult",data:a})}break;case"grayscaleWeights":if(256!==c.red+c.green+c.blue)throwError("Weights have to sum up to 256");Sa=c}};functionRa(d,c){vara=Math.max(Math.floor(Math.min(d,c)/yb),zb);return[a,Math.ceil(d/a),Math.ceil(c/a)]}varyb=40,zb=16,Ta=12;functionr(d,c){this.count=d;this.ra=c}functiony(d,c,a){this.ka=d;this.da=a?[c,a]:Array(c)}
returnMath.sqrt(b*b+c*c)};this.Ka=function(c,a,b,g){c=(Math.round(this.sa(c,a)/g)+Math.round(this.sa(c,b)/g)>>1)+7;switch(c&3){case0:c++;break;case2:c--;break;case3:throwError("QR Error: in detector");}returnc};this.Qa=function(c,a,b,g){g=Math.floor(g*c);vard=Math.max(0,a-g);a=Math.min(f-1,a+g);if(a-d<3*c)throwError("QR Error: in detector");varh=Math.max(0,b-g);return(newJb(this.H,d,h,a-d,Math.min(n-1,b+g)-h,c,this.U)).find()};this.La=function(c,a,b,g,d){d-=3.5;vark;if(null!=g){varl=g.g();
functionFb(d,c){d^=c;returnL[d&15]+L[O(d,4)&15]+L[O(d,8)&15]+L[O(d,12)&15]+L[O(d,16)&15]+L[O(d,20)&15]+L[O(d,24)&15]+L[O(d,28)&15]}functionTb(d){varc=Ub(d);returnnull!=c?c:Ub(d^21522)}functionUb(d){for(varc=4294967295,a=0,b=0;b<Mb.length;b++){varg=Mb[b],k=g[0];if(k==d)returnnewOb(g[1]);k=Fb(d,k);k<c&&(a=g[1],c=k)}return3>=c?newOb(a):null};functionVb(d,c,a){this.gb=d;this.i=c;this.name=a;this.getName=function(){returnthis.name}}varSb=[newVb(1,0,"M"),newVb(0,1,"L"),newVb(3,2,"H"),newVb(2,3,"Q")];functionAb(d){varc;c||(c=d);if(1>d||1>c)throwError("QR Error: Both dimensions must be greater than 0");this.width=d;this.height=c;vara=d>>5;0!=(d&31)&&a++;this.X=a;this.i=Array(a*c);for(d=0;d<this.i.length;d++)this.i[d]=0;this.ea=function(){if(this.width!=this.height)throwError("QR Error: Can't call getDimension() on a non-square matrix");returnthis.width};this.ga=function(b,a){return0!=(O(this.i[a*this.X+(b>>5)],b&31)&1)};this.nb=function(b,a){this.i[a*this.X+(b>>5)]|=1<<(b&31)};this.M=function(b,
a){this.i[a*this.X+(b>>5)]^=1<<(b&31)};this.clear=function(){for(varb=this.i.length,a=0;a<b;a++)this.i[a]=0};this.P=function(b,a,c,d){if(0>a||0>b)throwError("QR Error: Left and top must be nonnegative");if(1>d||1>c)throwError("QR Error: Height and width must be at least 1");c=b+c;d=a+d;if(d>this.height||c>this.width)throwError("QR Error: The region must fit inside the matrix");for(;a<d;a++)for(varg=a*this.X,k=b;k<c;k++)this.i[g+(k>>5)]|=1<<(k&31)}};functionub(d,c){this.ya=d;this.T=c};functiontb(d){varc=d.ea();if(21>c||1!=(c&3))throwError("QR Error: Error BitMatrixParser");this.V=d;this.O=this.J=null;this.K=function(a,b,c){returnthis.V.ga(a,b)?c<<1|1:c<<1};this.Aa=function(){if(null!=this.O)returnthis.O;for(vara=0,b=0;6>b;b++)a=this.K(b,8,a);a=this.K(7,8,a);a=this.K(8,8,a);a=this.K(8,7,a);for(b=5;0<=b;b--)a=this.K(8,b,a);this.O=Tb(a);if(null!=this.O)returnthis.O;varc=this.V.ea();a=0;vard=c-8;for(b=c-1;b>=d;b--)a=this.K(b,8,a);for(b=c-7;b<c;b++)a=this.K(8,b,a);this.O=Tb(a);
if(1==b){for(varc=b=0;c<a;c++)b^=this.f[c];returnb}vard=this.f[0];for(c=1;c<a;c++)d=Xb(this.a.multiply(b,d),this.f[c]);returnd};this.ba=function(b){if(this.a!=b.a)throwError("QR Error: GF256Polys do not have same GF256 field");if(this.l())returnb;if(b.l())returnthis;vara=this.f;b=b.f;if(a.length>b.length){varc=a;a=b;b=c}c=Array(b.length);for(varg=b.length-a.length,m=0;m<g;m++)c[m]=b[m];for(m=g;m<b.length;m++)c[m]=a[m-g]^b[m];returnnewP(d,c)};this.wa=function(b){if(this.a!=b.a)throwError("QR Error: GF256Polys do not have same GF256 field");
function(b){if(0==b)throwError("QR Error: System.ArgumentException");returnthis.aa[b]};this.inverse=function(b){if(0==b)throwError("QR Error: System.ArithmeticException");returnthis.Y[255-this.aa[b]]};this.multiply=function(b,a){return0==b||0==a?0:1==b?a:1==a?b:this.Y[(this.aa[b]+this.aa[a])%255]}}varZb=newYb(285);newYb(301);functionXb(d,c){returnd^c};varvb=newfunction(d){this.a=d;this.decode=function(c,a){for(varb=newP(this.a,c),d=Array(a),k=0;k<d.length;k++)d[k]=0;varh=!0;for(k=0;k<a;k++){varl=b.la(this.a.exp(k));d[d.length-1-k]=l;0!=l&&(h=!1)}if(!h)for(k=newP(this.a,d),a=this.kb(this.a.pa(a,1),k,a),k=a[1],a=this.Ra(a[0]),b=this.Sa(k,a),k=0;k<a.length;k++){d=c.length-1-this.a.log(a[k]);if(0>d)throwError("QR Error: ReedSolomonException Bad error location");c[d]^=b[k]}};this.kb=function(c,a,b){if(c.I()<a.I()){vard=c;c=a;a=d}d=this.a.za;
for(vark=this.a.l(),h=this.a.l(),l=this.a.za;a.I()>=Math.floor(b/2);){varm=c,p=d,w=h;c=a;d=k;h=l;if(c.l())throwError("QR Error: r_{i-1} was zero");a=m;l=this.a.l();for(k=this.a.inverse(c.Z(c.I()));a.I()>=c.I()&&!a.l();){m=a.I()-c.I();varq=this.a.multiply(a.Z(a.I()),k);l=l.ba(this.a.pa(m,q));a=a.ba(c.eb(m,q))}k=l.wa(d).ba(p);l=l.wa(h).ba(w)}b=l.Z(0);if(0==b)throwError("QR Error: ReedSolomonException sigmaTilde(0) was zero");b=this.a.inverse(b);c=l.xa(b);b=a.xa(b);return[c,b]};this.Ra=function(c){vara=
c.I();if(1==a)returnArray(c.Z(1));for(varb=Array(a),d=0,k=1;256>k&&d<a;k++)0==c.la(k)&&(b[d]=this.a.inverse(k),d++);if(d!=a)throwError("QR Error: Error locator degree does not match number of roots");returnb};this.Sa=function(c,a){for(varb=a.length,d=Array(b),k=0;k<b;k++){for(varh=this.a.inverse(a[k]),l=1,m=0;m<b;m++)k!=m&&(l=this.a.multiply(l,Xb(1,this.a.multiply(a[m],h))));d[k]=this.a.multiply(c.la(h),this.a.inverse(l))}returnd}}(Zb);varxb,Qa=null,f=0,n=0,Pa=!1,$b=[[10,9,8,8],[12,11,16,10],[14,13,16,12]],Sa={red:77,blue:150,green:29};functionO(d,c){return0<=d?d>>c:(d>>c)+(2<<~c)};varac=3,bc=57,cc=2;functiondc(d){functionc(b,a){varc=b.g()-a.g();b=b.h()-a.h();returnMath.sqrt(c*c+b*b)}vara=c(d[0],d[1]),b=c(d[1],d[2]),g=c(d[0],d[2]);b>=a&&b>=g?(b=d[0],a=d[1],g=d[2]):g>=b&&g>=a?(b=d[1],a=d[0],g=d[2]):(b=d[2],a=d[0],g=d[1]);if(0>function(b,a,c){vard=a.x;a=a.y;return(c.x-d)*(b.y-a)-(c.y-a)*(b.x-d)}(a,b,g)){vark=a;a=g;g=k}d[0]=a;d[1]=b;d[2]=g}
this._sourceRect,this._qrWorker,this.$canvas,true).then(this._onDecode,(error)=>{if(error!=="QR code not found.")console.error(error)}).then(()=>this._scanFrame())})}_getCameraStream(facingMode,exact=false){constconstraintsToTry=[{width:{min:1024}},{width:{min:768}},{}];if(facingMode){if(exact)facingMode={exact:facingMode};constraintsToTry.forEach((constraint)=>constraint.facingMode=facingMode)}returnthis._getMatchingCameraStream(constraintsToTry)}_getMatchingCameraStream(constraintsToTry){if(constraintsToTry.length===
0)returnPromise.reject("Camera not found.");returnnavigator.mediaDevices.getUserMedia({video:constraintsToTry.shift()}).catch(()=>this._getMatchingCameraStream(constraintsToTry))}start(){if(this._active)returnPromise.resolve();this._active=true;clearTimeout(this._offTimeout);letfacingMode="environment";returnthis._getCameraStream("environment",true).catch(()=>{facingMode="user";returnthis._getCameraStream()}).then((stream)=>{this.$video.srcObject=stream;this._setVideoMirror(facingMode)}).catch((e)=>
null,canvas=null,fixedCanvasSize=false,alsoTryWithoutSourceRect=false){constpromise=newPromise((resolve,reject)=>{worker=worker||newWorker(QrScanner.WORKER_PATH);lettimeout,onMessage,onError;onMessage=(event)=>{if(event.data.type!=="qrResult")return;worker.removeEventListener("message",onMessage);worker.removeEventListener("error",onError);clearTimeout(timeout);if(event.data.data!==null)resolve(event.data.data);elsereject("QR code not found.")};onError=()=>{worker.removeEventListener("message",