import{g as F,m as G}from"./index.27cf50e8.js";var N={exports:{}};(function(O,X){var T;(function(R,_){O.exports=_()})(F,function(){function R(t){this.mode=p.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,r=this.data.length;e65536?(a[0]=240|(i&1835008)>>>18,a[1]=128|(i&258048)>>>12,a[2]=128|(i&4032)>>>6,a[3]=128|i&63):i>2048?(a[0]=224|(i&61440)>>>12,a[1]=128|(i&4032)>>>6,a[2]=128|i&63):i>128?(a[0]=192|(i&1984)>>>6,a[1]=128|i&63):a[0]=i,this.parsedData.push(a)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}R.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=_.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var a=-1;a<=7;a++)e+a<=-1||this.moduleCount<=e+a||(0<=r&&r<=6&&(a==0||a==6)||0<=a&&a<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=a&&a<=4?this.modules[t+r][e+a]=!0:this.modules[t+r][e+a]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var a=f.getLostPoint(this);(r==0||t>a)&&(t=a,e=r)}return e},createMovieClip:function(t,e,r){var a=t.createEmptyMovieClip(e,r),i=1;this.make();for(var o=0;o>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=a}for(var r=0;r<18;r++){var a=!t&&(e>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=a}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,a=f.getBCHTypeInfo(r),i=0;i<15;i++){var o=!t&&(a>>i&1)==1;i<6?this.modules[i][8]=o:i<8?this.modules[i+1][8]=o:this.modules[this.moduleCount-15+i][8]=o}for(var i=0;i<15;i++){var o=!t&&(a>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=o:i<9?this.modules[8][15-i-1+1]=o:this.modules[8][15-i-1]=o}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,a=this.moduleCount-1,i=7,o=0,s=this.moduleCount-1;s>0;s-=2)for(s==6&&s--;;){for(var n=0;n<2;n++)if(this.modules[a][s-n]==null){var h=!1;o>>i&1)==1);var l=f.getMask(e,a,s-n);l&&(h=!h),this.modules[a][s-n]=h,i--,i==-1&&(o++,i=7)}if(a+=r,a<0||this.moduleCount<=a){a-=r,r=-r;break}}}},_.PAD0=236,_.PAD1=17,_.createData=function(t,e,r){for(var a=E.getRSBlocks(t,e),i=new x,o=0;on*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+n*8+")");for(i.getLengthInBits()+4<=n*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=n*8||(i.put(_.PAD0,8),i.getLengthInBits()>=n*8));)i.put(_.PAD1,8);return _.createBytes(i,a)},_.createBytes=function(t,e){for(var r=0,a=0,i=0,o=new Array(e.length),s=new Array(e.length),n=0;n=0?C.get(c):0}}for(var w=0,u=0;u=0;)e^=f.G15<=0;)e^=f.G18<>>=1;return e},getPatternPosition:function(t){return f.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case A.PATTERN000:return(e+r)%2==0;case A.PATTERN001:return e%2==0;case A.PATTERN010:return r%3==0;case A.PATTERN011:return(e+r)%3==0;case A.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case A.PATTERN101:return e*r%2+e*r%3==0;case A.PATTERN110:return(e*r%2+e*r%3)%2==0;case A.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new L([1],0),r=0;r5&&(r+=3+o-5)}for(var a=0;a=256;)t-=255;return g.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},v=0;v<8;v++)g.EXP_TABLE[v]=1<>>7-t%8&1)==1},put:function(t,e){for(var r=0;r>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var 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]];function S(){return typeof CanvasRenderingContext2D<"u"}function k(){var t=!1,e=navigator.userAgent;if(/android/i.test(e)){t=!0;var r=e.toString().match(/android ([0-9]\.[0-9])/i);r&&r[1]&&(t=parseFloat(r[1]))}return t}var b=function(){var t=function(e,r){this._el=e,this._htOption=r};return t.prototype.draw=function(e){var r=this._htOption,a=this._el,i=e.getModuleCount();Math.floor(r.width/i),Math.floor(r.height/i),this.clear();function o(u,d){var m=document.createElementNS("http://www.w3.org/2000/svg",u);for(var C in d)d.hasOwnProperty(C)&&m.setAttribute(C,d[C]);return m}var s=o("svg",{viewBox:"0 0 "+String(i)+" "+String(i),width:"100%",height:"100%",fill:r.colorLight});s.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),a.appendChild(s),s.appendChild(o("rect",{fill:r.colorLight,width:"100%",height:"100%"})),s.appendChild(o("rect",{fill:r.colorDark,width:"1",height:"1",id:"template"}));for(var n=0;n=1;c--)arguments[c]=arguments[c]*e;else typeof m>"u"&&(arguments[1]*=e,arguments[2]*=e,arguments[3]*=e,arguments[4]*=e);r.apply(this,arguments)}}function a(o,s){var n=this;if(n._fFail=s,n._fSuccess=o,n._bSupportDataURI===null){var h=document.createElement("img"),l=function(){n._bSupportDataURI=!1,n._fFail&&n._fFail.call(n)},u=function(){n._bSupportDataURI=!0,n._fSuccess&&n._fSuccess.call(n)};h.onabort=l,h.onerror=l,h.onload=u,h.src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";return}else n._bSupportDataURI===!0&&n._fSuccess?n._fSuccess.call(n):n._bSupportDataURI===!1&&n._fFail&&n._fFail.call(n)}var i=function(o,s){this._bIsPainted=!1,this._android=k(),this._htOption=s,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=s.width,this._elCanvas.height=s.height,o.appendChild(this._elCanvas),this._el=o,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._elImage=document.createElement("img"),this._elImage.alt="Scan me!",this._elImage.style.display="none",this._el.appendChild(this._elImage),this._bSupportDataURI=null};return i.prototype.draw=function(o){var s=this._elImage,n=this._oContext,h=this._htOption,l=o.getModuleCount(),u=h.width/l,d=h.height/l,m=Math.round(u),C=Math.round(d);s.style.display="none",this.clear();for(var c=0;c'],h=0;h");for(var l=0;l');n.push("")}n.push(""),a.innerHTML=n.join("");var u=a.childNodes[0],d=(r.width-u.offsetWidth)/2,m=(r.height-u.offsetHeight)/2;d>0&&m>0&&(u.style.margin=m+"px "+d+"px")},t.prototype.clear=function(){this._el.innerHTML=""},t}();function U(t,e){for(var r=1,a=Q(t),i=0,o=B.length;iB.length)throw new Error("Too long data");return r}function Q(t){var e=encodeURI(t).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return e.length+(e.length!=t?3:0)}return T=function(t,e){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:D.H},typeof e=="string"&&(e={text:e}),e)for(var r in e)this._htOption[r]=e[r];typeof t=="string"&&(t=document.getElementById(t)),this._htOption.useSVG&&(y=b),this._android=k(),this._el=t,this._oQRCode=null,this._oDrawing=new y(this._el,this._htOption),this._htOption.text&&this.makeCode(this._htOption.text)},T.prototype.makeCode=function(t){this._oQRCode=new _(U(t,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(t),this._oQRCode.make(),this._el.title=t,this._oDrawing.draw(this._oQRCode),this.makeImage()},T.prototype.makeImage=function(){typeof this._oDrawing.makeImage=="function"&&(!this._android||this._android>=3)&&this._oDrawing.makeImage()},T.prototype.clear=function(){this._oDrawing.clear()},T.CorrectLevel=D,T})})(N);var K=N.exports;const J=G(K);export{J as Q}; //# sourceMappingURL=qrcode.59c5ce85.js.map