var QRCode;(function(){function t(t){this.mode=r.MODE_8BIT_BYTE;this.data=t;this.parsedData=[];for(var e=0,i=this.data.length;e65536){a[0]=240|(n&1835008)>>>18;a[1]=128|(n&258048)>>>12;a[2]=128|(n&4032)>>>6;a[3]=128|n&63}else if(n>2048){a[0]=224|(n&61440)>>>12;a[1]=128|(n&4032)>>>6;a[2]=128|n&63}else if(n>128){a[0]=192|(n&1984)>>>6;a[1]=128|n&63}else{a[0]=n}this.parsedData.push(a)}this.parsedData=Array.prototype.concat.apply([],this.parsedData);if(this.parsedData.length!=this.data.length){this.parsedData.unshift(191);this.parsedData.unshift(187);this.parsedData.unshift(239)}}t.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e=7){this.setupTypeNumber(t)}if(this.dataCache==null){this.dataCache=e.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)}this.mapData(this.dataCache,r)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++){if(t+r<=-1||this.moduleCount<=t+r)continue;for(var i=-1;i<=7;i++){if(e+i<=-1||this.moduleCount<=e+i)continue;if(0<=r&&r<=6&&(i==0||i==6)||0<=i&&i<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=i&&i<=4){this.modules[t+r][e+i]=true}else{this.modules[t+r][e+i]=false}}}},getBestMaskPattern:function(){var t=0;var e=0;for(var r=0;r<8;r++){this.makeImpl(true,r);var i=n.getLostPoint(this);if(r==0||t>i){t=i;e=r}}return e},createMovieClip:function(t,e,r){var i=t.createEmptyMovieClip(e,r);var a=1;this.make();for(var n=0;n>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=i}for(var r=0;r<18;r++){var i=!t&&(e>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=i}},setupTypeInfo:function(t,e){var r=this.errorCorrectLevel<<3|e;var i=n.getBCHTypeInfo(r);for(var a=0;a<15;a++){var o=!t&&(i>>a&1)==1;if(a<6){this.modules[a][8]=o}else if(a<8){this.modules[a+1][8]=o}else{this.modules[this.moduleCount-15+a][8]=o}}for(var a=0;a<15;a++){var o=!t&&(i>>a&1)==1;if(a<8){this.modules[8][this.moduleCount-a-1]=o}else if(a<9){this.modules[8][15-a-1+1]=o}else{this.modules[8][15-a-1]=o}}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){var r=-1;var i=this.moduleCount-1;var a=7;var o=0;for(var s=this.moduleCount-1;s>0;s-=2){if(s==6)s--;while(true){for(var h=0;h<2;h++){if(this.modules[i][s-h]==null){var u=false;if(o>>a&1)==1}var l=n.getMask(e,i,s-h);if(l){u=!u}this.modules[i][s-h]=u;a--;if(a==-1){o++;a=7}}}i+=r;if(i<0||this.moduleCount<=i){i-=r;r=-r;break}}}}};e.PAD0=236;e.PAD1=17;e.createData=function(t,r,i){var a=u.getRSBlocks(t,r);var o=new l;for(var s=0;sf*8){throw new Error("code length overflow. ("+o.getLengthInBits()+">"+f*8+")")}if(o.getLengthInBits()+4<=f*8){o.put(0,4)}while(o.getLengthInBits()%8!=0){o.putBit(false)}while(true){if(o.getLengthInBits()>=f*8){break}o.put(e.PAD0,8);if(o.getLengthInBits()>=f*8){break}o.put(e.PAD1,8)}return e.createBytes(o,a)};e.createBytes=function(t,e){var r=0;var i=0;var a=0;var o=new Array(e.length);var s=new Array(e.length);for(var u=0;u=0?c.get(p):0}}var m=0;for(var g=0;g=0){e^=n.G15<=0){e^=n.G18<>>=1}return e},getPatternPosition:function(t){return n.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){var e=new h([1],0);for(var r=0;r5){r+=3+n-5}}}for(var i=0;i=256){t-=255}return o.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var s=0;s<8;s++){o.EXP_TABLE[s]=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);if(this.buffer.length<=e){this.buffer.push(0)}if(t){this.buffer[e]|=128>>>this.length%8}this.length++}};function f(){return typeof CanvasRenderingContext2D!="undefined"}function g(){var t=false;var e=navigator.userAgent;if(/android/i.test(e)){t=true;aMat=e.toString().match(/android ([0-9]\.[0-9])/i);if(aMat&&aMat[1]){t=parseFloat(aMat[1])}}return t}var d=function(){var t=function(t,e){this._el=t;this._htOption=e};t.prototype.draw=function(t){var e=this._htOption;var r=this._el;var i=t.getModuleCount();var a=Math.floor(e.width/i);var n=Math.floor(e.height/i);this.clear();function o(t,e){var r=document.createElementNS("http://www.w3.org/2000/svg",t);for(var i in e)if(e.hasOwnProperty(i))r.setAttribute(i,e[i]);return r}var s=o("svg",{viewBox:"0 0 "+String(i)+" "+String(i),width:"100%",height:"100%",fill:e.colorLight});s.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink");r.appendChild(s);s.appendChild(o("rect",{fill:e.colorDark,width:"1",height:"1",id:"template"}));for(var h=0;h'];for(var s=0;s");for(var h=0;h')}o.push("")}o.push("");r.innerHTML=o.join("");var u=r.childNodes[0];var l=(e.width-u.offsetWidth)/2;var f=(e.height-u.offsetHeight)/2;if(l>0&&f>0){u.style.margin=f+"px "+l+"px"}};t.prototype.clear=function(){this._el.innerHTML=""};return t}():function(){function t(){this._elImage.src=this._elCanvas.toDataURL("image/png");this._elImage.style.display="block";this._elCanvas.style.display="none"}if(this._android&&this._android<=2.1){var e=1/window.devicePixelRatio;var r=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(t,i,a,n,o,s,h,u,l){if("nodeName"in t&&/img/i.test(t.nodeName)){for(var f=arguments.length-1;f>=1;f--){arguments[f]=arguments[f]*e}}else if(typeof u=="undefined"){arguments[1]*=e;arguments[2]*=e;arguments[3]*=e;arguments[4]*=e}r.apply(this,arguments)}}function i(t,e){var r=this;r._fFail=e;r._fSuccess=t;if(r._bSupportDataURI===null){var i=document.createElement("img");var a=function(){r._bSupportDataURI=false;if(r._fFail){_fFail.call(r)}};var n=function(){r._bSupportDataURI=true;if(r._fSuccess){r._fSuccess.call(r)}};i.onabort=a;i.onerror=a;i.onload=n;i.src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";return}else if(r._bSupportDataURI===true&&r._fSuccess){r._fSuccess.call(r)}else if(r._bSupportDataURI===false&&r._fFail){r._fFail.call(r)}}var a=function(t,e){this._bIsPainted=false;this._android=g();this._htOption=e;this._elCanvas=document.createElement("canvas");this._elCanvas.width=e.width;this._elCanvas.height=e.height;t.appendChild(this._elCanvas);this._el=t;this._oContext=this._elCanvas.getContext("2d");this._bIsPainted=false;this._elImage=document.createElement("img");this._elImage.alt="Scan me!";this._elImage.style.display="none";this._el.appendChild(this._elImage);this._bSupportDataURI=null};a.prototype.draw=function(t){var e=this._elImage;var r=this._oContext;var i=this._htOption;var a=t.getModuleCount();var n=i.width/a;var o=i.height/a;var s=Math.round(n);var h=Math.round(o);e.style.display="none";this.clear();for(var u=0;u=3)){this._oDrawing.makeImage()}};QRCode.prototype.clear=function(){this._oDrawing.clear()};QRCode.CorrectLevel=i})(); //# sourceMappingURL=qrcode.map.js