ray-template/js/awesome-qr@2.1.5-rc.0-Ds7AaOTE.js

2 lines
40 KiB
JavaScript

import{b as Pe}from"./canvas@2.11.2-CVRTzJty.js";import{g as Ce,l as Re,u as Ee}from"./js-binary-schema-parser@2.0.3-D0akQrQ7.js";var N=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ve(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Be={},Jt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QRMath=e.QRUtil=e.QRMaskPattern=e.QRErrorCorrectLevel=e.QRCodeModel=void 0;function u(n,t,a){var s=p(t),r=n-1,i=0;switch(a){case e.QRErrorCorrectLevel.L:i=B[r][0];break;case e.QRErrorCorrectLevel.M:i=B[r][1];break;case e.QRErrorCorrectLevel.Q:i=B[r][2];break;case e.QRErrorCorrectLevel.H:i=B[r][3];break}return s<=i}function o(n,t){for(var a=1,s=p(n),r=0,i=B.length;r<i;r++){var f=0;switch(t){case e.QRErrorCorrectLevel.L:f=B[r][0];break;case e.QRErrorCorrectLevel.M:f=B[r][1];break;case e.QRErrorCorrectLevel.Q:f=B[r][2];break;case e.QRErrorCorrectLevel.H:f=B[r][3];break}if(s<=f)break;a++}if(a>B.length)throw new Error("Too long data");return a}function p(n){var t=encodeURI(n).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return t.length+(t.length!=Number(n)?3:0)}var v=function(){function n(t){this.mode=c.MODE_8BIT_BYTE,this.parsedData=[],this.data=t;for(var a=[],s=0,r=this.data.length;s<r;s++){var i=[],f=this.data.charCodeAt(s);f>65536?(i[0]=240|(f&1835008)>>>18,i[1]=128|(f&258048)>>>12,i[2]=128|(f&4032)>>>6,i[3]=128|f&63):f>2048?(i[0]=224|(f&61440)>>>12,i[1]=128|(f&4032)>>>6,i[2]=128|f&63):f>128?(i[0]=192|(f&1984)>>>6,i[1]=128|f&63):i[0]=f,a.push(i)}this.parsedData=Array.prototype.concat.apply([],a),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}return n.prototype.getLength=function(){return this.parsedData.length},n.prototype.write=function(t){for(var a=0,s=this.parsedData.length;a<s;a++)t.put(this.parsedData[a],8)},n}(),g=function(){function n(t,a){t===void 0&&(t=-1),a===void 0&&(a=e.QRErrorCorrectLevel.L),this.moduleCount=0,this.dataList=[],this.typeNumber=t,this.errorCorrectLevel=a,this.moduleCount=0,this.dataList=[]}return n.prototype.addData=function(t){if(this.typeNumber<=0)this.typeNumber=o(t,this.errorCorrectLevel);else{if(this.typeNumber>40)throw new Error("Invalid QR version: "+this.typeNumber);if(!u(this.typeNumber,t,this.errorCorrectLevel))throw new Error("Data is too long for QR version: "+this.typeNumber)}var a=new v(t);this.dataList.push(a),this.dataCache=void 0},n.prototype.isDark=function(t,a){if(t<0||this.moduleCount<=t||a<0||this.moduleCount<=a)throw new Error(t+","+a);return this.modules[t][a]},n.prototype.getModuleCount=function(){return this.moduleCount},n.prototype.make=function(){this.makeImpl(!1,this.getBestMaskPattern())},n.prototype.makeImpl=function(t,a){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var s=0;s<this.moduleCount;s++){this.modules[s]=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++)this.modules[s][r]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,a),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=n.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,a)},n.prototype.setupPositionProbePattern=function(t,a){for(var s=-1;s<=7;s++)if(!(t+s<=-1||this.moduleCount<=t+s))for(var r=-1;r<=7;r++)a+r<=-1||this.moduleCount<=a+r||(0<=s&&s<=6&&(r==0||r==6)||0<=r&&r<=6&&(s==0||s==6)||2<=s&&s<=4&&2<=r&&r<=4?this.modules[t+s][a+r]=!0:this.modules[t+s][a+r]=!1)},n.prototype.getBestMaskPattern=function(){if(Number.isInteger(this.maskPattern)&&Object.values(e.QRMaskPattern).includes(this.maskPattern))return this.maskPattern;for(var t=0,a=0,s=0;s<8;s++){this.makeImpl(!0,s);var r=P.getLostPoint(this);(s==0||t>r)&&(t=r,a=s)}return a},n.prototype.setupTimingPattern=function(){for(var t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(var a=8;a<this.moduleCount-8;a++)this.modules[6][a]==null&&(this.modules[6][a]=a%2==0)},n.prototype.setupPositionAdjustPattern=function(){for(var t=P.getPatternPosition(this.typeNumber),a=0;a<t.length;a++)for(var s=0;s<t.length;s++){var r=t[a],i=t[s];if(this.modules[r][i]==null)for(var f=-2;f<=2;f++)for(var l=-2;l<=2;l++)f==-2||f==2||l==-2||l==2||f==0&&l==0?this.modules[r+f][i+l]=!0:this.modules[r+f][i+l]=!1}},n.prototype.setupTypeNumber=function(t){for(var a=P.getBCHTypeNumber(this.typeNumber),s=0;s<18;s++){var r=!t&&(a>>s&1)==1;this.modules[Math.floor(s/3)][s%3+this.moduleCount-8-3]=r}for(var s=0;s<18;s++){var r=!t&&(a>>s&1)==1;this.modules[s%3+this.moduleCount-8-3][Math.floor(s/3)]=r}},n.prototype.setupTypeInfo=function(t,a){for(var s=this.errorCorrectLevel<<3|a,r=P.getBCHTypeInfo(s),i=0;i<15;i++){var f=!t&&(r>>i&1)==1;i<6?this.modules[i][8]=f:i<8?this.modules[i+1][8]=f:this.modules[this.moduleCount-15+i][8]=f}for(var i=0;i<15;i++){var f=!t&&(r>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=f:i<9?this.modules[8][15-i-1+1]=f:this.modules[8][15-i-1]=f}this.modules[this.moduleCount-8][8]=!t},n.prototype.mapData=function(t,a){for(var s=-1,r=this.moduleCount-1,i=7,f=0,l=this.moduleCount-1;l>0;l-=2)for(l==6&&l--;;){for(var d=0;d<2;d++)if(this.modules[r][l-d]==null){var m=!1;f<t.length&&(m=(t[f]>>>i&1)==1);var _=P.getMask(a,r,l-d);_&&(m=!m),this.modules[r][l-d]=m,i--,i==-1&&(f++,i=7)}if(r+=s,r<0||this.moduleCount<=r){r-=s,s=-s;break}}},n.createData=function(t,a,s){for(var r=T.getRSBlocks(t,a),i=new E,f=0;f<s.length;f++){var l=s[f];i.put(l.mode,4),i.put(l.getLength(),P.getLengthInBits(l.mode,t)),l.write(i)}for(var d=0,f=0;f<r.length;f++)d+=r[f].dataCount;if(i.getLengthInBits()>d*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+d*8+")");for(i.getLengthInBits()+4<=d*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=d*8||(i.put(n.PAD0,8),i.getLengthInBits()>=d*8));)i.put(n.PAD1,8);return n.createBytes(i,r)},n.createBytes=function(t,a){for(var s=0,r=0,i=0,f=new Array(a.length),l=new Array(a.length),d=0;d<a.length;d++){var m=a[d].dataCount,_=a[d].totalCount-m;r=Math.max(r,m),i=Math.max(i,_),f[d]=new Array(m);for(var y=0;y<f[d].length;y++)f[d][y]=255&t.buffer[y+s];s+=m;var D=P.getErrorCorrectPolynomial(_),M=new w(f[d],D.getLength()-1),h=M.mod(D);l[d]=new Array(D.getLength()-1);for(var y=0;y<l[d].length;y++){var L=y+h.getLength()-l[d].length;l[d][y]=L>=0?h.get(L):0}}for(var R=0,y=0;y<a.length;y++)R+=a[y].totalCount;for(var A=new Array(R),C=0,y=0;y<r;y++)for(var d=0;d<a.length;d++)y<f[d].length&&(A[C++]=f[d][y]);for(var y=0;y<i;y++)for(var d=0;d<a.length;d++)y<l[d].length&&(A[C++]=l[d][y]);return A},n.PAD0=236,n.PAD1=17,n}();e.QRCodeModel=g,e.QRErrorCorrectLevel={L:1,M:0,Q:3,H:2};var c={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8};e.QRMaskPattern={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var P=function(){function n(){}return n.getBCHTypeInfo=function(t){for(var a=t<<10;n.getBCHDigit(a)-n.getBCHDigit(n.G15)>=0;)a^=n.G15<<n.getBCHDigit(a)-n.getBCHDigit(n.G15);return(t<<10|a)^n.G15_MASK},n.getBCHTypeNumber=function(t){for(var a=t<<12;n.getBCHDigit(a)-n.getBCHDigit(n.G18)>=0;)a^=n.G18<<n.getBCHDigit(a)-n.getBCHDigit(n.G18);return t<<12|a},n.getBCHDigit=function(t){for(var a=0;t!=0;)a++,t>>>=1;return a},n.getPatternPosition=function(t){return n.PATTERN_POSITION_TABLE[t-1]},n.getMask=function(t,a,s){switch(t){case e.QRMaskPattern.PATTERN000:return(a+s)%2==0;case e.QRMaskPattern.PATTERN001:return a%2==0;case e.QRMaskPattern.PATTERN010:return s%3==0;case e.QRMaskPattern.PATTERN011:return(a+s)%3==0;case e.QRMaskPattern.PATTERN100:return(Math.floor(a/2)+Math.floor(s/3))%2==0;case e.QRMaskPattern.PATTERN101:return a*s%2+a*s%3==0;case e.QRMaskPattern.PATTERN110:return(a*s%2+a*s%3)%2==0;case e.QRMaskPattern.PATTERN111:return(a*s%3+(a+s)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},n.getErrorCorrectPolynomial=function(t){for(var a=new w([1],0),s=0;s<t;s++)a=a.multiply(new w([1,b.gexp(s)],0));return a},n.getLengthInBits=function(t,a){if(1<=a&&a<10)switch(t){case c.MODE_NUMBER:return 10;case c.MODE_ALPHA_NUM:return 9;case c.MODE_8BIT_BYTE:return 8;case c.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(a<27)switch(t){case c.MODE_NUMBER:return 12;case c.MODE_ALPHA_NUM:return 11;case c.MODE_8BIT_BYTE:return 16;case c.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else if(a<41)switch(t){case c.MODE_NUMBER:return 14;case c.MODE_ALPHA_NUM:return 13;case c.MODE_8BIT_BYTE:return 16;case c.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}else throw new Error("type:"+a)},n.getLostPoint=function(t){for(var a=t.getModuleCount(),s=0,r=0;r<a;r++)for(var i=0;i<a;i++){for(var f=0,l=t.isDark(r,i),d=-1;d<=1;d++)if(!(r+d<0||a<=r+d))for(var m=-1;m<=1;m++)i+m<0||a<=i+m||d==0&&m==0||l==t.isDark(r+d,i+m)&&f++;f>5&&(s+=3+f-5)}for(var r=0;r<a-1;r++)for(var i=0;i<a-1;i++){var _=0;t.isDark(r,i)&&_++,t.isDark(r+1,i)&&_++,t.isDark(r,i+1)&&_++,t.isDark(r+1,i+1)&&_++,(_==0||_==4)&&(s+=3)}for(var r=0;r<a;r++)for(var i=0;i<a-6;i++)t.isDark(r,i)&&!t.isDark(r,i+1)&&t.isDark(r,i+2)&&t.isDark(r,i+3)&&t.isDark(r,i+4)&&!t.isDark(r,i+5)&&t.isDark(r,i+6)&&(s+=40);for(var i=0;i<a;i++)for(var r=0;r<a-6;r++)t.isDark(r,i)&&!t.isDark(r+1,i)&&t.isDark(r+2,i)&&t.isDark(r+3,i)&&t.isDark(r+4,i)&&!t.isDark(r+5,i)&&t.isDark(r+6,i)&&(s+=40);for(var y=0,i=0;i<a;i++)for(var r=0;r<a;r++)t.isDark(r,i)&&y++;var D=Math.abs(100*y/a/a-50)/5;return s+=D*10,s},n.PATTERN_POSITION_TABLE=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],n.G15=1335,n.G18=7973,n.G15_MASK=21522,n}();e.QRUtil=P;var b=function(){function n(){}return n.glog=function(t){if(t<1)throw new Error("glog("+t+")");return n.LOG_TABLE[t]},n.gexp=function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return n.EXP_TABLE[t]},n.EXP_TABLE=new Array(256),n.LOG_TABLE=new Array(256),n._constructor=function(){for(var t=0;t<8;t++)n.EXP_TABLE[t]=1<<t;for(var t=8;t<256;t++)n.EXP_TABLE[t]=n.EXP_TABLE[t-4]^n.EXP_TABLE[t-5]^n.EXP_TABLE[t-6]^n.EXP_TABLE[t-8];for(var t=0;t<255;t++)n.LOG_TABLE[n.EXP_TABLE[t]]=t}(),n}();e.QRMath=b;var w=function(){function n(t,a){if(t.length==null)throw new Error(t.length+"/"+a);for(var s=0;s<t.length&&t[s]==0;)s++;this.num=new Array(t.length-s+a);for(var r=0;r<t.length-s;r++)this.num[r]=t[r+s]}return n.prototype.get=function(t){return this.num[t]},n.prototype.getLength=function(){return this.num.length},n.prototype.multiply=function(t){for(var a=new Array(this.getLength()+t.getLength()-1),s=0;s<this.getLength();s++)for(var r=0;r<t.getLength();r++)a[s+r]^=b.gexp(b.glog(this.get(s))+b.glog(t.get(r)));return new n(a,0)},n.prototype.mod=function(t){if(this.getLength()-t.getLength()<0)return this;for(var a=b.glog(this.get(0))-b.glog(t.get(0)),s=new Array(this.getLength()),r=0;r<this.getLength();r++)s[r]=this.get(r);for(var r=0;r<t.getLength();r++)s[r]^=b.gexp(b.glog(t.get(r))+a);return new n(s,0).mod(t)},n}(),T=function(){function n(t,a){this.totalCount=t,this.dataCount=a}return n.getRSBlocks=function(t,a){var s=n.getRsBlockTable(t,a);if(s==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+a);for(var r=s.length/3,i=[],f=0;f<r;f++)for(var l=s[f*3+0],d=s[f*3+1],m=s[f*3+2],_=0;_<l;_++)i.push(new n(d,m));return i},n.getRsBlockTable=function(t,a){switch(a){case e.QRErrorCorrectLevel.L:return n.RS_BLOCK_TABLE[(t-1)*4+0];case e.QRErrorCorrectLevel.M:return n.RS_BLOCK_TABLE[(t-1)*4+1];case e.QRErrorCorrectLevel.Q:return n.RS_BLOCK_TABLE[(t-1)*4+2];case e.QRErrorCorrectLevel.H:return n.RS_BLOCK_TABLE[(t-1)*4+3];default:return}},n.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],n}(),E=function(){function n(){this.buffer=[],this.length=0}return n.prototype.get=function(t){var a=Math.floor(t/8);return(this.buffer[a]>>>7-t%8&1)==1},n.prototype.put=function(t,a){for(var s=0;s<a;s++)this.putBit((t>>>a-s-1&1)==1)},n.prototype.getLengthInBits=function(){return this.length},n.prototype.putBit=function(t){var a=Math.floor(this.length/8);this.buffer.length<=a&&this.buffer.push(0),t&&(this.buffer[a]|=128>>>this.length%8),this.length++},n}(),B=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]]})(Jt);var It={},pe={},Ft={};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.deinterlace=void 0;Ft.deinterlace=function(e,u){for(var o=new Array(e.length),p=e.length/u,v=function(T,E){var B=e.slice(E*u,(E+1)*u);o.splice.apply(o,[T*u,u].concat(B))},g=[0,4,2,1],c=[8,8,4,2],P=0,b=0;b<4;b++)for(var w=g[b];w<p;w+=c[b])v(w,P),P++;return o};var Qt={};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.lzw=void 0;Qt.lzw=function(e,u,o){var p=4096,v=-1,g=o,c,P,b,w,T,E,B,d,n,t,l,a,m,_,D,y,s=new Array(o),r=new Array(p),i=new Array(p),f=new Array(p+1);for(a=e,P=1<<a,T=P+1,c=P+2,B=v,w=a+1,b=(1<<w)-1,n=0;n<P;n++)r[n]=0,i[n]=n;var l,d,m,_,y,D;for(l=d=m=_=y=D=0,t=0;t<g;){if(_===0){if(d<w){l+=u[D]<<d,d+=8,D++;continue}if(n=l&b,l>>=w,d-=w,n>c||n==T)break;if(n==P){w=a+1,b=(1<<w)-1,c=P+2,B=v;continue}if(B==v){f[_++]=i[n],B=n,m=n;continue}for(E=n,n==c&&(f[_++]=m,n=B);n>P;)f[_++]=i[n],n=r[n];m=i[n]&255,f[_++]=m,c<p&&(r[c]=B,i[c]=m,c++,!(c&b)&&c<p&&(w++,b+=c)),B=E}_--,s[y++]=f[_],t++}for(t=y;t<g;t++)s[t]=0;return s};(function(e){var u=N&&N.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(e,"__esModule",{value:!0}),e.decompressFrames=e.decompressFrame=e.parseGIF=void 0;var o=u(Ce),p=Re,v=Ee,g=Ft,c=Qt;e.parseGIF=function(b){var w=new Uint8Array(b);return p.parse(v.buildStream(w),o.default)};var P=function(b){for(var w=b.pixels.length,T=new Uint8ClampedArray(w*4),E=0;E<w;E++){var B=E*4,n=b.pixels[E],t=b.colorTable[n];T[B]=t[0],T[B+1]=t[1],T[B+2]=t[2],T[B+3]=n!==b.transparentIndex?255:0}return T};e.decompressFrame=function(b,w,T){if(!b.image){console.warn("gif frame does not have associated image.");return}var E=b.image,B=E.descriptor.width*E.descriptor.height,n=c.lzw(E.data.minCodeSize,E.data.blocks,B);E.descriptor.lct.interlaced&&(n=g.deinterlace(n,E.descriptor.width));var t={pixels:n,dims:{top:b.image.descriptor.top,left:b.image.descriptor.left,width:b.image.descriptor.width,height:b.image.descriptor.height}};return E.descriptor.lct&&E.descriptor.lct.exists?t.colorTable=E.lct:t.colorTable=w,b.gce&&(t.delay=(b.gce.delay||10)*10,t.disposalType=b.gce.extras.disposal,b.gce.extras.transparentColorGiven&&(t.transparentIndex=b.gce.transparentColorIndex)),T&&(t.patch=P(t)),t},e.decompressFrames=function(b,w){return b.frames.filter(function(T){return T.image}).map(function(T){return e.decompressFrame(T,b.gct,w)})}})(pe);var Te=100,Q=256,le=Q-1,rt=4,me=16,Wt=1<<me,we=10,Zt=10,De=Wt>>Zt,Ae=Wt<<we-Zt,Me=Q>>3,Xt=6,Le=1<<Xt,ke=Me*Le,Ie=30,be=10,Tt=1<<be,ye=8,fe=1<<ye,Fe=be+ye,lt=1<<Fe,ue=499,he=491,ce=487,_e=503,Qe=3*_e;function xe(e,u){var o,p,v,g,c;function P(){o=[],p=new Int32Array(256),v=new Int32Array(Q),g=new Int32Array(Q),c=new Int32Array(Q>>3);var r,i;for(r=0;r<Q;r++)i=(r<<rt+8)/Q,o[r]=new Float64Array([i,i,i,0]),g[r]=Wt/Q,v[r]=0}function b(){for(var r=0;r<Q;r++)o[r][0]>>=rt,o[r][1]>>=rt,o[r][2]>>=rt,o[r][3]=r}function w(r,i,f,l,d){o[i][0]-=r*(o[i][0]-f)/Tt,o[i][1]-=r*(o[i][1]-l)/Tt,o[i][2]-=r*(o[i][2]-d)/Tt}function T(r,i,f,l,d){for(var m=Math.abs(i-r),_=Math.min(i+r,Q),y=i+1,D=i-1,M=1,h,L;y<_||D>m;)L=c[M++],y<_&&(h=o[y++],h[0]-=L*(h[0]-f)/lt,h[1]-=L*(h[1]-l)/lt,h[2]-=L*(h[2]-d)/lt),D>m&&(h=o[D--],h[0]-=L*(h[0]-f)/lt,h[1]-=L*(h[1]-l)/lt,h[2]-=L*(h[2]-d)/lt)}function E(r,i,f){var l=2147483647,d=l,m=-1,_=m,y,D,M,h,L;for(y=0;y<Q;y++)D=o[y],M=Math.abs(D[0]-r)+Math.abs(D[1]-i)+Math.abs(D[2]-f),M<l&&(l=M,m=y),h=M-(v[y]>>me-rt),h<d&&(d=h,_=y),L=g[y]>>Zt,g[y]-=L,v[y]+=L<<we;return g[m]+=De,v[m]-=Ae,_}function B(){var r,i,f,l,d,m,_=0,y=0;for(r=0;r<Q;r++){for(f=o[r],d=r,m=f[1],i=r+1;i<Q;i++)l=o[i],l[1]<m&&(d=i,m=l[1]);if(l=o[d],r!=d&&(i=l[0],l[0]=f[0],f[0]=i,i=l[1],l[1]=f[1],f[1]=i,i=l[2],l[2]=f[2],f[2]=i,i=l[3],l[3]=f[3],f[3]=i),m!=_){for(p[_]=y+r>>1,i=_+1;i<m;i++)p[i]=r;_=m,y=r}}for(p[_]=y+le>>1,i=_+1;i<256;i++)p[i]=le}function n(r,i,f){for(var l,d,m,_=1e3,y=-1,D=p[i],M=D-1;D<Q||M>=0;)D<Q&&(d=o[D],m=d[1]-i,m>=_?D=Q:(D++,m<0&&(m=-m),l=d[0]-r,l<0&&(l=-l),m+=l,m<_&&(l=d[2]-f,l<0&&(l=-l),m+=l,m<_&&(_=m,y=d[3])))),M>=0&&(d=o[M],m=i-d[1],m>=_?M=-1:(M--,m<0&&(m=-m),l=d[0]-r,l<0&&(l=-l),m+=l,m<_&&(l=d[2]-f,l<0&&(l=-l),m+=l,m<_&&(_=m,y=d[3]))));return y}function t(){var r,i=e.length,f=30+(u-1)/3,l=i/(3*u),d=~~(l/Te),m=Tt,_=ke,y=_>>Xt;for(y<=1&&(y=0),r=0;r<y;r++)c[r]=m*((y*y-r*r)*fe/(y*y));var D;i<Qe?(u=1,D=3):i%ue!==0?D=3*ue:i%he!==0?D=3*he:i%ce!==0?D=3*ce:D=3*_e;var M,h,L,R,A=0;for(r=0;r<l;)if(M=(e[A]&255)<<rt,h=(e[A+1]&255)<<rt,L=(e[A+2]&255)<<rt,R=E(M,h,L),w(m,R,M,h,L),y!==0&&T(y,R,M,h,L),A+=D,A>=i&&(A-=i),r++,d===0&&(d=1),r%d===0)for(m-=m/f,_-=_/Ie,y=_>>Xt,y<=1&&(y=0),R=0;R<y;R++)c[R]=m*((y*y-R*R)*fe/(y*y))}function a(){P(),t(),b(),B()}this.buildColormap=a;function s(){for(var r=[],i=[],f=0;f<Q;f++)i[o[f][3]]=f;for(var l=0,d=0;d<Q;d++){var m=i[d];r[l++]=o[m][0],r[l++]=o[m][1],r[l++]=o[m][2]}return r}this.getColormap=s,this.lookupRGB=n}var Oe=xe,ve=-1,Dt=12,bt=5003,Se=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function Ne(e,u,o,p){var v=Math.max(2,p),g=new Uint8Array(256),c=new Int32Array(bt),P=new Int32Array(bt),b,w=0,T,E=0,B,n=!1,t,a,s,r,i,f;function l(R,A){g[T++]=R,T>=254&&D(A)}function d(R){m(bt),E=a+2,n=!0,L(a,R)}function m(R){for(var A=0;A<R;++A)c[A]=-1}function _(R,A){var C,Y,F,j,Z,q,K;for(t=R,n=!1,f=t,B=M(f),a=1<<R-1,s=a+1,E=a+2,T=0,j=h(),K=0,C=bt;C<65536;C*=2)++K;K=8-K,q=bt,m(q),L(a,A);t:for(;(Y=h())!=ve;){if(C=(Y<<Dt)+j,F=Y<<K^j,c[F]===C){j=P[F];continue}else if(c[F]>=0){Z=q-F,F===0&&(Z=1);do if((F-=Z)<0&&(F+=q),c[F]===C){j=P[F];continue t}while(c[F]>=0)}L(j,A),j=Y,E<1<<Dt?(P[F]=E++,c[F]=C):d(A)}L(j,A),L(s,A)}function y(R){R.writeByte(v),r=e*u,i=0,_(v+1,R),R.writeByte(0)}function D(R){T>0&&(R.writeByte(T),R.writeBytes(g,0,T),T=0)}function M(R){return(1<<R)-1}function h(){if(r===0)return ve;--r;var R=o[i++];return R&255}function L(R,A){for(b&=Se[w],w>0?b|=R<<w:b=R,w+=f;w>=8;)l(b&255,A),b>>=8,w-=8;if((E>B||n)&&(n?(B=M(f=t),n=!1):(++f,f==Dt?B=1<<Dt:B=M(f))),R==s){for(;w>0;)l(b&255,A),b>>=8,w-=8;D(A)}}this.encode=y}var Ge=Ne,Ue=Oe,He=Ge;function G(){this.page=-1,this.pages=[],this.newPage()}G.pageSize=4096;G.charMap={};for(var At=0;At<256;At++)G.charMap[At]=String.fromCharCode(At);G.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(G.pageSize),this.cursor=0};G.prototype.getData=function(){for(var e="",u=0;u<this.pages.length;u++)for(var o=0;o<G.pageSize;o++)e+=G.charMap[this.pages[u][o]];return e};G.prototype.toFlattenUint8Array=function(){for(var e=[],u=0;u<this.pages.length;u++)if(u===this.pages.length-1){var o=Uint8Array.from(this.pages[u].slice(0,this.cursor));e.push(o)}else e.push(this.pages[u]);var p=new Uint8Array(e.reduce(function(v,g){return v+g.length},0));return e.reduce(function(v,g){return p.set(g,v),v+g.length},0),p};G.prototype.writeByte=function(e){this.cursor>=G.pageSize&&this.newPage(),this.pages[this.page][this.cursor++]=e};G.prototype.writeUTFBytes=function(e){for(var u=e.length,o=0;o<u;o++)this.writeByte(e.charCodeAt(o))};G.prototype.writeBytes=function(e,u,o){for(var p=o||e.length,v=u||0;v<p;v++)this.writeByte(e[v])};function I(e,u){this.width=~~e,this.height=~~u,this.transparent=null,this.transIndex=0,this.repeat=-1,this.delay=0,this.image=null,this.pixels=null,this.indexedPixels=null,this.colorDepth=null,this.colorTab=null,this.neuQuant=null,this.usedEntry=new Array,this.palSize=7,this.dispose=-1,this.firstFrame=!0,this.sample=10,this.dither=!1,this.globalPalette=!1,this.out=new G}I.prototype.setDelay=function(e){this.delay=Math.round(e/10)};I.prototype.setFrameRate=function(e){this.delay=Math.round(100/e)};I.prototype.setDispose=function(e){e>=0&&(this.dispose=e)};I.prototype.setRepeat=function(e){this.repeat=e};I.prototype.setTransparent=function(e){this.transparent=e};I.prototype.addFrame=function(e){this.image=e,this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null,this.getImagePixels(),this.analyzePixels(),this.globalPalette===!0&&(this.globalPalette=this.colorTab),this.firstFrame&&(this.writeHeader(),this.writeLSD(),this.writePalette(),this.repeat>=0&&this.writeNetscapeExt()),this.writeGraphicCtrlExt(),this.writeImageDesc(),!this.firstFrame&&!this.globalPalette&&this.writePalette(),this.writePixels(),this.firstFrame=!1};I.prototype.finish=function(){this.out.writeByte(59)};I.prototype.setQuality=function(e){e<1&&(e=1),this.sample=e};I.prototype.setDither=function(e){e===!0&&(e="FloydSteinberg"),this.dither=e};I.prototype.setGlobalPalette=function(e){this.globalPalette=e};I.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};I.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};I.prototype.analyzePixels=function(){this.colorTab||(this.neuQuant=new Ue(this.pixels,this.sample),this.neuQuant.buildColormap(),this.colorTab=this.neuQuant.getColormap()),this.dither?this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null):this.indexPixels(),this.pixels=null,this.colorDepth=8,this.palSize=7,this.transparent!==null&&(this.transIndex=this.findClosest(this.transparent,!0))};I.prototype.indexPixels=function(e){var u=this.pixels.length/3;this.indexedPixels=new Uint8Array(u);for(var o=0,p=0;p<u;p++){var v=this.findClosestRGB(this.pixels[o++]&255,this.pixels[o++]&255,this.pixels[o++]&255);this.usedEntry[v]=!0,this.indexedPixels[p]=v}};I.prototype.ditherPixels=function(e,u){var o={FalseFloydSteinberg:[[.375,1,0],[.375,0,1],[.25,1,1]],FloydSteinberg:[[.4375,1,0],[.1875,-1,1],[.3125,0,1],[.0625,1,1]],Stucki:[[.19047619047619047,1,0],[.09523809523809523,2,0],[.047619047619047616,-2,1],[.09523809523809523,-1,1],[.19047619047619047,0,1],[.09523809523809523,1,1],[.047619047619047616,2,1],[.023809523809523808,-2,2],[.047619047619047616,-1,2],[.09523809523809523,0,2],[.047619047619047616,1,2],[.023809523809523808,2,2]],Atkinson:[[.125,1,0],[.125,2,0],[.125,-1,1],[.125,0,1],[.125,1,1],[.125,0,2]]};if(!e||!o[e])throw"Unknown dithering kernel: "+e;var p=o[e],v=0,g=this.height,c=this.width,P=this.pixels,b=u?-1:1;this.indexedPixels=new Uint8Array(this.pixels.length/3);for(var w=0;w<g;w++){u&&(b=b*-1);for(var T=b==1?0:c-1,E=b==1?c:0;T!==E;T+=b){v=w*c+T;var B=v*3,n=P[B],t=P[B+1],a=P[B+2];B=this.findClosestRGB(n,t,a),this.usedEntry[B]=!0,this.indexedPixels[v]=B,B*=3;for(var s=this.colorTab[B],r=this.colorTab[B+1],i=this.colorTab[B+2],f=n-s,l=t-r,d=a-i,m=b==1?0:p.length-1,_=b==1?p.length:0;m!==_;m+=b){var y=p[m][1],D=p[m][2];if(y+T>=0&&y+T<c&&D+w>=0&&D+w<g){var M=p[m][0];B=v+y+D*c,B*=3,P[B]=Math.max(0,Math.min(255,P[B]+f*M)),P[B+1]=Math.max(0,Math.min(255,P[B+1]+l*M)),P[B+2]=Math.max(0,Math.min(255,P[B+2]+d*M))}}}}};I.prototype.findClosest=function(e,u){return this.findClosestRGB((e&16711680)>>16,(e&65280)>>8,e&255,u)};I.prototype.findClosestRGB=function(e,u,o,p){if(this.colorTab===null)return-1;if(this.neuQuant&&!p)return this.neuQuant.lookupRGB(e,u,o);for(var v=0,g=256*256*256,c=this.colorTab.length,P=0,b=0;P<c;b++){var w=e-(this.colorTab[P++]&255),T=u-(this.colorTab[P++]&255),E=o-(this.colorTab[P++]&255),B=w*w+T*T+E*E;(!p||this.usedEntry[b])&&B<g&&(g=B,v=b)}return v};I.prototype.getImagePixels=function(){var e=this.width,u=this.height;this.pixels=new Uint8Array(e*u*3);for(var o=this.image,p=0,v=0,g=0;g<u;g++)for(var c=0;c<e;c++)this.pixels[v++]=o[p++],this.pixels[v++]=o[p++],this.pixels[v++]=o[p++],p++};I.prototype.writeGraphicCtrlExt=function(){this.out.writeByte(33),this.out.writeByte(249),this.out.writeByte(4);var e,u;this.transparent===null?(e=0,u=0):(e=1,u=2),this.dispose>=0&&(u=this.dispose&7),u<<=2,this.out.writeByte(0|u|0|e),this.writeShort(this.delay),this.out.writeByte(this.transIndex),this.out.writeByte(0)};I.prototype.writeImageDesc=function(){this.out.writeByte(44),this.writeShort(0),this.writeShort(0),this.writeShort(this.width),this.writeShort(this.height),this.firstFrame||this.globalPalette?this.out.writeByte(0):this.out.writeByte(128|this.palSize)};I.prototype.writeLSD=function(){this.writeShort(this.width),this.writeShort(this.height),this.out.writeByte(240|this.palSize),this.out.writeByte(0),this.out.writeByte(0)};I.prototype.writeNetscapeExt=function(){this.out.writeByte(33),this.out.writeByte(255),this.out.writeByte(11),this.out.writeUTFBytes("NETSCAPE2.0"),this.out.writeByte(3),this.out.writeByte(1),this.writeShort(this.repeat),this.out.writeByte(0)};I.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);for(var e=3*256-this.colorTab.length,u=0;u<e;u++)this.out.writeByte(0)};I.prototype.writeShort=function(e){this.out.writeByte(e&255),this.out.writeByte(e>>8&255)};I.prototype.writePixels=function(){var e=new He(this.width,this.height,this.indexedPixels,this.colorDepth);e.encode(this.out)};I.prototype.stream=function(){return this.out};var ze=I,kt=N&&N.__assign||function(){return kt=Object.assign||function(e){for(var u,o=1,p=arguments.length;o<p;o++){u=arguments[o];for(var v in u)Object.prototype.hasOwnProperty.call(u,v)&&(e[v]=u[v])}return e},kt.apply(this,arguments)},je=N&&N.__awaiter||function(e,u,o,p){function v(g){return g instanceof o?g:new o(function(c){c(g)})}return new(o||(o=Promise))(function(g,c){function P(T){try{w(p.next(T))}catch(E){c(E)}}function b(T){try{w(p.throw(T))}catch(E){c(E)}}function w(T){T.done?g(T.value):v(T.value).then(P,b)}w((p=p.apply(e,u||[])).next())})},Ke=N&&N.__generator||function(e,u){var o={label:0,sent:function(){if(g[0]&1)throw g[1];return g[1]},trys:[],ops:[]},p,v,g,c;return c={next:P(0),throw:P(1),return:P(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function P(w){return function(T){return b([w,T])}}function b(w){if(p)throw new TypeError("Generator is already executing.");for(;o;)try{if(p=1,v&&(g=w[0]&2?v.return:w[0]?v.throw||((g=v.return)&&g.call(v),0):v.next)&&!(g=g.call(v,w[1])).done)return g;switch(v=0,g&&(w=[w[0]&2,g.value]),w[0]){case 0:case 1:g=w;break;case 4:return o.label++,{value:w[1],done:!1};case 5:o.label++,v=w[1],w=[0];continue;case 7:w=o.ops.pop(),o.trys.pop();continue;default:if(g=o.trys,!(g=g.length>0&&g[g.length-1])&&(w[0]===6||w[0]===2)){o=0;continue}if(w[0]===3&&(!g||w[1]>g[0]&&w[1]<g[3])){o.label=w[1];break}if(w[0]===6&&o.label<g[1]){o.label=g[1],g=w;break}if(g&&o.label<g[2]){o.label=g[2],o.ops.push(w);break}g[2]&&o.ops.pop(),o.trys.pop();continue}w=u.call(e,o)}catch(T){w=[6,T],v=0}finally{p=g=0}if(w[0]&5)throw w[1];return{value:w[0]?w[1]:void 0,done:!0}}},Xe=N&&N.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(It,"__esModule",{value:!0});It.AwesomeQR=void 0;var J=Pe,ge=pe,Mt=Jt,Je=Xe(ze),Lt=.4,We=function(){function e(u){var o=Object.assign({},u);if(Object.keys(e.defaultOptions).forEach(function(p){p in o||Object.defineProperty(o,p,{value:e.defaultOptions[p],enumerable:!0,writable:!0})}),o.components?typeof o.components=="object"&&Object.keys(e.defaultComponentOptions).forEach(function(p){p in o.components?Object.defineProperty(o.components,p,{value:kt(kt({},e.defaultComponentOptions[p]),o.components[p]),enumerable:!0,writable:!0}):Object.defineProperty(o.components,p,{value:e.defaultComponentOptions[p],enumerable:!0,writable:!0})}):o.components=e.defaultComponentOptions,o.dotScale!==null&&o.dotScale!==void 0){if(o.dotScale<=0||o.dotScale>1)throw new Error("dotScale should be in range (0, 1].");o.components.data.scale=o.dotScale,o.components.timing.scale=o.dotScale,o.components.alignment.scale=o.dotScale}this.options=o,this.canvas=J.createCanvas(u.size,u.size),this.canvasContext=this.canvas.getContext("2d"),this.qrCode=new Mt.QRCodeModel(-1,this.options.correctLevel),Number.isInteger(this.options.maskPattern)&&(this.qrCode.maskPattern=this.options.maskPattern),Number.isInteger(this.options.version)&&(this.qrCode.typeNumber=this.options.version),this.qrCode.addData(this.options.text),this.qrCode.make()}return e.prototype.draw=function(){var u=this;return new Promise(function(o){return u._draw().then(o)})},e.prototype._clear=function(){this.canvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)},e._prepareRoundedCornerClip=function(u,o,p,v,g,c){u.beginPath(),u.moveTo(o,p),u.arcTo(o+v,p,o+v,p+g,c),u.arcTo(o+v,p+g,o,p+g,c),u.arcTo(o,p+g,o,p,c),u.arcTo(o,p,o+v,p,c),u.closePath()},e._getAverageRGB=function(u){var o=5,p={r:0,g:0,b:0},v,g,c=-4,P={r:0,g:0,b:0},b=0;g=u.naturalHeight||u.height,v=u.naturalWidth||u.width;var w=J.createCanvas(v,g),T=w.getContext("2d");if(!T)return p;T.drawImage(u,0,0);var E;try{E=T.getImageData(0,0,v,g)}catch{return p}for(;(c+=o*4)<E.data.length;)E.data[c]>200||E.data[c+1]>200||E.data[c+2]>200||(++b,P.r+=E.data[c],P.g+=E.data[c+1],P.b+=E.data[c+2]);return P.r=~~(P.r/b),P.g=~~(P.g/b),P.b=~~(P.b/b),P},e._drawDot=function(u,o,p,v,g,c){g===void 0&&(g=0),c===void 0&&(c=1),u.fillRect((o+g)*v,(p+g)*v,c*v,c*v)},e._drawAlignProtector=function(u,o,p,v){u.clearRect((o-2)*v,(p-2)*v,5*v,5*v),u.fillRect((o-2)*v,(p-2)*v,5*v,5*v)},e._drawAlign=function(u,o,p,v,g,c,P,b){g===void 0&&(g=0),c===void 0&&(c=1);var w=u.fillStyle;u.fillStyle=P,new Array(4).fill(0).map(function(T,E){e._drawDot(u,o-2+E,p-2,v,g,c),e._drawDot(u,o+2,p-2+E,v,g,c),e._drawDot(u,o+2-E,p+2,v,g,c),e._drawDot(u,o-2,p+2-E,v,g,c)}),e._drawDot(u,o,p,v,g,c),b||(u.fillStyle="rgba(255, 255, 255, 0.6)",new Array(2).fill(0).map(function(T,E){e._drawDot(u,o-1+E,p-1,v,g,c),e._drawDot(u,o+1,p-1+E,v,g,c),e._drawDot(u,o+1-E,p+1,v,g,c),e._drawDot(u,o-1,p+1-E,v,g,c)})),u.fillStyle=w},e.prototype._draw=function(){var u,o,p,v,g,c,P,b,w,T,E,B,n,t,a,s,r,i,f;return je(this,void 0,void 0,function(){var l,d,m,_,y,D,M,h,L,R,A,C,Y,F,j,Z,q,K,ft,ut,ht,k,W,ct,yt,x,at,xt,O,S,Ot,nt,$t,X,k,St,Nt,Vt,U,Yt,k,$,H,z,_t,Gt,k,Ut,qt,Ht,te,k,$,H,z,ee,vt,tt,gt,et,dt,Pt,re,V,ot,pt,st,zt,Ct,ie,ae,jt,ne;return Ke(this,function(mt){switch(mt.label){case 0:if(l=(u=this.qrCode)===null||u===void 0?void 0:u.moduleCount,d=this.options.size,m=this.options.margin,(m<0||m*2>=d)&&(m=0),_=Math.ceil(m),y=d-2*m,D=this.options.whiteMargin,M=this.options.backgroundDimming,h=Math.ceil(y/l),L=h*l,R=L+2*_,A=J.createCanvas(R,R),C=A.getContext("2d"),this._clear(),C.save(),C.translate(_,_),Y=J.createCanvas(R,R),F=Y.getContext("2d"),j=null,Z=[],!this.options.gifBackground)return[3,1];if(q=ge.parseGIF(this.options.gifBackground),j=q,Z=ge.decompressFrames(q,!0),this.options.autoColor){for(K=0,ft=0,ut=0,ht=0,k=0;k<Z[0].colorTable.length;k++)W=Z[0].colorTable[k],!(W[0]>200||W[1]>200||W[2]>200)&&(W[0]===0&&W[1]===0&&W[2]===0||(ht++,K+=W[0],ft+=W[1],ut+=W[2]));K=~~(K/ht),ft=~~(ft/ht),ut=~~(ut/ht),this.options.colorDark="rgb("+K+","+ft+","+ut+")"}return[3,4];case 1:return this.options.backgroundImage?[4,J.loadImage(this.options.backgroundImage)]:[3,3];case 2:return ct=mt.sent(),this.options.autoColor&&(yt=e._getAverageRGB(ct),this.options.colorDark="rgb("+yt.r+","+yt.g+","+yt.b+")"),F.drawImage(ct,0,0,ct.width,ct.height,0,0,R,R),F.rect(0,0,R,R),F.fillStyle=M,F.fill(),[3,4];case 3:F.rect(0,0,R,R),F.fillStyle=this.options.colorLight,F.fill(),mt.label=4;case 4:for(x=Mt.QRUtil.getPatternPosition(this.qrCode.typeNumber),at=((p=(o=this.options.components)===null||o===void 0?void 0:o.data)===null||p===void 0?void 0:p.scale)||Lt,xt=(1-at)*.5,O=0;O<l;O++)for(S=0;S<l;S++){for(Ot=this.qrCode.isDark(O,S),nt=S<8&&(O<8||O>=l-8)||S>=l-8&&O<8,$t=O==6&&S>=8&&S<=l-8||S==6&&O>=8&&O<=l-8,X=nt||$t,k=1;k<x.length-1;k++)X=X||O>=x[k]-2&&O<=x[k]+2&&S>=x[k]-2&&S<=x[k]+2;St=S*h+(X?0:xt*h),Nt=O*h+(X?0:xt*h),C.strokeStyle=Ot?this.options.colorDark:this.options.colorLight,C.lineWidth=.5,C.fillStyle=Ot?this.options.colorDark:"rgba(255, 255, 255, 0.6)",x.length===0?X||C.fillRect(St,Nt,(X?1:at)*h,(X?1:at)*h):(Vt=S<l-4&&S>=l-4-5&&O<l-4&&O>=l-4-5,!X&&!Vt&&C.fillRect(St,Nt,(X?1:at)*h,(X?1:at)*h))}if(U=x[x.length-1],Yt="rgba(255, 255, 255, 0.6)",C.fillStyle=Yt,C.fillRect(0,0,8*h,8*h),C.fillRect(0,(l-8)*h,8*h,8*h),C.fillRect((l-8)*h,0,8*h,8*h),!((g=(v=this.options.components)===null||v===void 0?void 0:v.timing)===null||g===void 0)&&g.protectors&&(C.fillRect(8*h,6*h,(l-8-8)*h,h),C.fillRect(6*h,8*h,h,(l-8-8)*h)),!((P=(c=this.options.components)===null||c===void 0?void 0:c.cornerAlignment)===null||P===void 0)&&P.protectors&&e._drawAlignProtector(C,U,U,h),!((w=(b=this.options.components)===null||b===void 0?void 0:b.alignment)===null||w===void 0)&&w.protectors){for(k=0;k<x.length;k++)for($=0;$<x.length;$++)if(H=x[$],z=x[k],!(H===6&&(z===6||z===U))){if(z===6&&(H===6||H===U))continue;if(H===U&&z===U)continue;e._drawAlignProtector(C,H,z,h)}}for(C.fillStyle=this.options.colorDark,C.fillRect(0,0,7*h,h),C.fillRect((l-7)*h,0,7*h,h),C.fillRect(0,6*h,7*h,h),C.fillRect((l-7)*h,6*h,7*h,h),C.fillRect(0,(l-7)*h,7*h,h),C.fillRect(0,(l-7+6)*h,7*h,h),C.fillRect(0,0,h,7*h),C.fillRect(6*h,0,h,7*h),C.fillRect((l-7)*h,0,h,7*h),C.fillRect((l-7+6)*h,0,h,7*h),C.fillRect(0,(l-7)*h,h,7*h),C.fillRect(6*h,(l-7)*h,h,7*h),C.fillRect(2*h,2*h,3*h,3*h),C.fillRect((l-7+2)*h,2*h,3*h,3*h),C.fillRect(2*h,(l-7+2)*h,3*h,3*h),_t=((E=(T=this.options.components)===null||T===void 0?void 0:T.timing)===null||E===void 0?void 0:E.scale)||Lt,Gt=(1-_t)*.5,k=0;k<l-8;k+=2)e._drawDot(C,8+k,6,h,Gt,_t),e._drawDot(C,6,8+k,h,Gt,_t);for(Ut=((n=(B=this.options.components)===null||B===void 0?void 0:B.cornerAlignment)===null||n===void 0?void 0:n.scale)||Lt,qt=(1-Ut)*.5,e._drawAlign(C,U,U,h,qt,Ut,this.options.colorDark,((a=(t=this.options.components)===null||t===void 0?void 0:t.cornerAlignment)===null||a===void 0?void 0:a.protectors)||!1),Ht=((r=(s=this.options.components)===null||s===void 0?void 0:s.alignment)===null||r===void 0?void 0:r.scale)||Lt,te=(1-Ht)*.5,k=0;k<x.length;k++)for($=0;$<x.length;$++)if(H=x[$],z=x[k],!(H===6&&(z===6||z===U))){if(z===6&&(H===6||H===U))continue;if(H===U&&z===U)continue;e._drawAlign(C,H,z,h,te,Ht,this.options.colorDark,((f=(i=this.options.components)===null||i===void 0?void 0:i.alignment)===null||f===void 0?void 0:f.protectors)||!1)}return D&&(C.fillStyle="#FFFFFF",C.fillRect(-_,-_,R,_),C.fillRect(-_,L,R,_),C.fillRect(L,-_,_,R),C.fillRect(-_,-_,_,R)),this.options.logoImage?[4,J.loadImage(this.options.logoImage)]:[3,6];case 5:ee=mt.sent(),vt=this.options.logoScale,tt=this.options.logoMargin,gt=this.options.logoCornerRadius,(vt<=0||vt>=1)&&(vt=.2),tt<0&&(tt=0),gt<0&&(gt=0),et=L*vt,dt=.5*(R-et),Pt=dt,C.restore(),C.fillStyle="#FFFFFF",C.save(),e._prepareRoundedCornerClip(C,dt-tt,Pt-tt,et+2*tt,et+2*tt,gt+tt),C.clip(),re=C.globalCompositeOperation,C.globalCompositeOperation="destination-out",C.fill(),C.globalCompositeOperation=re,C.restore(),C.save(),e._prepareRoundedCornerClip(C,dt,Pt,et,et,gt),C.clip(),C.drawImage(ee,dt,Pt,et,et),C.restore(),C.save(),C.translate(_,_),mt.label=6;case 6:if(j){if(Z.forEach(function(it){V||(V=new Je.default(d,d),V.setDelay(it.delay),V.setRepeat(0));var Rt=it.dims,Et=Rt.width,Bt=Rt.height;ot||(ot=J.createCanvas(Et,Bt),pt=ot.getContext("2d"),pt.rect(0,0,ot.width,ot.height),pt.fillStyle="#ffffff",pt.fill()),(!st||!Ct||Et!==st.width||Bt!==st.height)&&(st=J.createCanvas(Et,Bt),zt=st.getContext("2d"),Ct=zt.createImageData(Et,Bt)),Ct.data.set(it.patch),zt.putImageData(Ct,0,0),pt.drawImage(st,it.dims.left,it.dims.top);var oe=J.createCanvas(R,R),wt=oe.getContext("2d");wt.drawImage(ot,0,0,R,R),wt.rect(0,0,R,R),wt.fillStyle=M,wt.fill(),wt.drawImage(A,0,0,R,R);var Kt=J.createCanvas(d,d),se=Kt.getContext("2d");se.drawImage(oe,0,0,d,d),V.addFrame(se.getImageData(0,0,Kt.width,Kt.height).data)}),!V)throw new Error("No frames.");return V.finish(),de(this.canvas)?(ie=V.stream().toFlattenUint8Array(),ae=ie.reduce(function(it,Rt){return it+String.fromCharCode(Rt)},""),[2,Promise.resolve("data:image/gif;base64,"+window.btoa(ae))]):[2,Promise.resolve(Buffer.from(V.stream().toFlattenUint8Array()))]}else return F.drawImage(A,0,0,R,R),C.drawImage(Y,-_,-_,R,R),jt=J.createCanvas(d,d),ne=jt.getContext("2d"),ne.drawImage(A,0,0,d,d),this.canvas=jt,de(this.canvas)?[2,Promise.resolve(this.canvas.toDataURL())]:[2,Promise.resolve(this.canvas.toBuffer())]}})})},e.CorrectLevel=Mt.QRErrorCorrectLevel,e.defaultComponentOptions={data:{scale:1},timing:{scale:1,protectors:!1},alignment:{scale:1,protectors:!1},cornerAlignment:{scale:1,protectors:!0}},e.defaultOptions={text:"",size:400,margin:20,colorDark:"#000000",colorLight:"#ffffff",correctLevel:Mt.QRErrorCorrectLevel.M,backgroundImage:void 0,backgroundDimming:"rgba(0,0,0,0)",logoImage:void 0,logoScale:.2,logoMargin:4,logoCornerRadius:8,whiteMargin:!0,components:e.defaultComponentOptions,autoColor:!0},e}();It.AwesomeQR=We;function de(e){try{return e instanceof HTMLElement}catch{return typeof e=="object"&&e.nodeType===1&&typeof e.style=="object"&&typeof e.ownerDocument=="object"}}(function(e){var u=N&&N.__createBinding||(Object.create?function(v,g,c,P){P===void 0&&(P=c),Object.defineProperty(v,P,{enumerable:!0,get:function(){return g[c]}})}:function(v,g,c,P){P===void 0&&(P=c),v[P]=g[c]}),o=N&&N.__exportStar||function(v,g){for(var c in v)c!=="default"&&!g.hasOwnProperty(c)&&u(g,v,c)};Object.defineProperty(e,"__esModule",{value:!0}),o(Jt,e);var p=It;Object.defineProperty(e,"AwesomeQR",{enumerable:!0,get:function(){return p.AwesomeQR}})})(Be);export{N as c,Ve as g,Be as l};