Socket
Socket
Sign inDemoInstall

qrious

Package Overview
Dependencies
14
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.2 to 2.1.0

7

CHANGES.md

@@ -0,1 +1,8 @@

## Version 2.1.0, 2016.10.04
* Allow `padding` to be set explicitly [#44](https://github.com/neocotic/qrious/issues/44)
* Fix support for older browsers [#55](https://github.com/neocotic/qrious/issues/55)
* Update code style to fit with other projects
* Update build system to run on older Node.js versions at a reduced capacity
## Version 2.0.2, 2016.08.05

@@ -2,0 +9,0 @@

6

dist/umd/qrious.min.js

@@ -1,5 +0,7 @@

/*! QRious v2.0.2 | (C) 2016 Alasdair Mercer | GPL v3 License
/*! QRious v2.1.0 | (C) 2016 Alasdair Mercer | GPL v3 License
Based on jsqrencode | (C) 2010 tz@execpc.com | GPL v3 License
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define("qrious",e):t.QRious=e()}(this,function(){"use strict";var t=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},e=function(){function t(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}return function(e,i,s){return i&&t(e.prototype,i),s&&t(e,s),e}}(),i=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},r=function(){function i(){t(this,i)}return e(i,null,[{key:"privatize",value:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t["_"+i]=e[i]);return t}},{key:"setter",value:function(t,e,i,s,r){var n=t[e],a=null!=i?i:s;return"function"==typeof r&&(a=r(a)),t[e]=a,a!==n}},{key:"throwUnimplemented",value:function(t,e){throw new Error('"'+e+'" method must be implemented on the '+t+" class")}},{key:"toUpperCase",value:function(t){return null!=t&&t.toUpperCase()}}]),i}(),n=function(){function i(){t(this,i)}return e(i,[{key:"getName",value:function(){r.throwUnimplemented("Service","getName")}}]),i}(),a=function(n){function a(){return t(this,a),s(this,Object.getPrototypeOf(a).apply(this,arguments))}return i(a,n),e(a,[{key:"createCanvas",value:function(){r.throwUnimplemented("ElementService","createCanvas")}},{key:"createImage",value:function(){r.throwUnimplemented("ElementService","createImage")}},{key:"getName",value:function(){return"element"}},{key:"isCanvas",value:function(t){r.throwUnimplemented("ElementService","isCanvas")}},{key:"isImage",value:function(t){r.throwUnimplemented("ElementService","isImage")}}]),a}(n),h=function(r){function n(){return t(this,n),s(this,Object.getPrototypeOf(n).apply(this,arguments))}return i(n,r),e(n,[{key:"createCanvas",value:function(){return document.createElement("canvas")}},{key:"createImage",value:function(){return document.createElement("img")}},{key:"isCanvas",value:function(t){return t instanceof HTMLCanvasElement}},{key:"isImage",value:function(t){return t instanceof HTMLImageElement}}]),n}(a),o=function(){function i(e){t(this,i),this.qrious=e}return e(i,[{key:"draw",value:function(t){r.throwUnimplemented("Renderer","draw")}},{key:"getModuleSize",value:function(t){var e=Math.floor(this.qrious.size/t.width);return Math.max(1,e)}},{key:"getOffset",value:function(t){var e=this.getModuleSize(t),i=Math.floor((this.qrious.size-e*t.width)/2);return Math.max(0,i)}},{key:"render",value:function(t){this.resize(),this.reset(),this.draw(t)}},{key:"reset",value:function(){r.throwUnimplemented("Renderer","reset")}},{key:"resize",value:function(){r.throwUnimplemented("Renderer","resize")}}]),i}(),f=function(r){function n(){return t(this,n),s(this,Object.getPrototypeOf(n).apply(this,arguments))}return i(n,r),e(n,[{key:"draw",value:function(t){var e=this.qrious,i=this.getModuleSize(t),s=this.getOffset(t),r=e.canvas.getContext("2d");r.fillStyle=e.foreground;for(var n=0;n<t.width;n++)for(var a=0;a<t.width;a++)t.buffer[a*t.width+n]&&r.fillRect(i*n+s,i*a+s,i,i)}},{key:"reset",value:function(){var t=this.qrious,e=t.canvas.getContext("2d");e.lineWidth=1,e.clearRect(0,0,t.size,t.size),e.fillStyle=t.background,e.fillRect(0,0,t.size,t.size)}},{key:"resize",value:function(){var t=this.qrious,e=t.canvas;e.width=t.size,e.height=t.size}}]),n}(o),u=function(){function i(){t(this,i)}return e(i,null,[{key:"BLOCK",get:function(){return[0,11,15,19,23,27,31,16,18,20,22,24,26,28,20,22,24,24,26,28,28,22,24,24,26,26,28,28,24,24,26,26,26,28,28,24,26,26,26,28,28]}}]),i}(),c=function(){function i(){t(this,i)}return e(i,null,[{key:"BLOCKS",get:function(){return[1,0,19,7,1,0,16,10,1,0,13,13,1,0,9,17,1,0,34,10,1,0,28,16,1,0,22,22,1,0,16,28,1,0,55,15,1,0,44,26,2,0,17,18,2,0,13,22,1,0,80,20,2,0,32,18,2,0,24,26,4,0,9,16,1,0,108,26,2,0,43,24,2,2,15,18,2,2,11,22,2,0,68,18,4,0,27,16,4,0,19,24,4,0,15,28,2,0,78,20,4,0,31,18,2,4,14,18,4,1,13,26,2,0,97,24,2,2,38,22,4,2,18,22,4,2,14,26,2,0,116,30,3,2,36,22,4,4,16,20,4,4,12,24,2,2,68,18,4,1,43,26,6,2,19,24,6,2,15,28,4,0,81,20,1,4,50,30,4,4,22,28,3,8,12,24,2,2,92,24,6,2,36,22,4,6,20,26,7,4,14,28,4,0,107,26,8,1,37,22,8,4,20,24,12,4,11,22,3,1,115,30,4,5,40,24,11,5,16,20,11,5,12,24,5,1,87,22,5,5,41,24,5,7,24,30,11,7,12,24,5,1,98,24,7,3,45,28,15,2,19,24,3,13,15,30,1,5,107,28,10,1,46,28,1,15,22,28,2,17,14,28,5,1,120,30,9,4,43,26,17,1,22,28,2,19,14,28,3,4,113,28,3,11,44,26,17,4,21,26,9,16,13,26,3,5,107,28,3,13,41,26,15,5,24,30,15,10,15,28,4,4,116,28,17,0,42,26,17,6,22,28,19,6,16,30,2,7,111,28,17,0,46,28,7,16,24,30,34,0,13,24,4,5,121,30,4,14,47,28,11,14,24,30,16,14,15,30,6,4,117,30,6,14,45,28,11,16,24,30,30,2,16,30,8,4,106,26,8,13,47,28,7,22,24,30,22,13,15,30,10,2,114,28,19,4,46,28,28,6,22,28,33,4,16,30,8,4,122,30,22,3,45,28,8,26,23,30,12,28,15,30,3,10,117,30,3,23,45,28,4,31,24,30,11,31,15,30,7,7,116,30,21,7,45,28,1,37,23,30,19,26,15,30,5,10,115,30,19,10,47,28,15,25,24,30,23,25,15,30,13,3,115,30,2,29,46,28,42,1,24,30,23,28,15,30,17,0,115,30,10,23,46,28,10,35,24,30,19,35,15,30,17,1,115,30,14,21,46,28,29,19,24,30,11,46,15,30,13,6,115,30,14,23,46,28,44,7,24,30,59,1,16,30,12,7,121,30,12,26,47,28,39,14,24,30,22,41,15,30,6,14,121,30,6,34,47,28,46,10,24,30,2,64,15,30,17,4,122,30,29,14,46,28,49,10,24,30,24,46,15,30,4,18,122,30,13,32,46,28,48,14,24,30,42,32,15,30,20,4,117,30,40,7,47,28,43,22,24,30,10,67,15,30,19,6,118,30,18,31,47,28,34,34,24,30,20,61,15,30]}},{key:"FINAL_FORMAT",get:function(){return[30660,29427,32170,30877,26159,25368,27713,26998,21522,20773,24188,23371,17913,16590,20375,19104,13663,12392,16177,14854,9396,8579,11994,11245,5769,5054,7399,6608,1890,597,3340,2107]}},{key:"LEVELS",get:function(){return{L:1,M:2,Q:3,H:4}}}]),i}(),l=function(){function i(){t(this,i)}return e(i,null,[{key:"EXPONENT",get:function(){return[1,2,4,8,16,32,64,128,29,58,116,232,205,135,19,38,76,152,45,90,180,117,234,201,143,3,6,12,24,48,96,192,157,39,78,156,37,74,148,53,106,212,181,119,238,193,159,35,70,140,5,10,20,40,80,160,93,186,105,210,185,111,222,161,95,190,97,194,153,47,94,188,101,202,137,15,30,60,120,240,253,231,211,187,107,214,177,127,254,225,223,163,91,182,113,226,217,175,67,134,17,34,68,136,13,26,52,104,208,189,103,206,129,31,62,124,248,237,199,147,59,118,236,197,151,51,102,204,133,23,46,92,184,109,218,169,79,158,33,66,132,21,42,84,168,77,154,41,82,164,85,170,73,146,57,114,228,213,183,115,230,209,191,99,198,145,63,126,252,229,215,179,123,246,241,255,227,219,171,75,150,49,98,196,149,55,110,220,165,87,174,65,130,25,50,100,200,141,7,14,28,56,112,224,221,167,83,166,81,162,89,178,121,242,249,239,195,155,43,86,172,69,138,9,18,36,72,144,61,122,244,245,247,243,251,235,203,139,11,22,44,88,176,125,250,233,207,131,27,54,108,216,173,71,142,0]}},{key:"LOG",get:function(){return[255,0,1,25,2,50,26,198,3,223,51,238,27,104,199,75,4,100,224,14,52,141,239,129,28,193,105,248,200,8,76,113,5,138,101,47,225,36,15,33,53,147,142,218,240,18,130,69,29,181,194,125,106,39,249,185,201,154,9,120,77,228,114,166,6,191,139,98,102,221,48,253,226,152,37,179,16,145,34,136,54,208,148,206,143,150,219,189,241,210,19,92,131,56,70,64,30,66,182,163,195,72,126,110,107,58,40,84,250,133,186,61,202,94,155,159,10,21,121,43,78,212,229,172,115,243,167,87,7,112,192,247,140,128,99,13,103,74,222,237,49,197,254,24,227,165,153,119,38,184,180,124,17,68,146,217,35,32,137,46,55,63,209,91,149,188,207,205,144,135,151,178,220,252,190,97,242,86,211,171,20,42,93,158,132,60,57,83,71,109,65,162,31,45,67,216,183,123,164,118,196,23,73,236,127,12,111,246,108,161,59,82,41,157,85,170,251,96,134,177,187,204,62,90,203,89,95,176,156,169,160,81,11,245,22,235,122,117,44,215,79,174,213,233,230,231,173,232,116,214,244,234,168,80,88,175]}}]),i}(),_=function(){function i(){t(this,i)}return e(i,null,[{key:"BLOCK",get:function(){return[3220,1468,2713,1235,3062,1890,2119,1549,2344,2936,1117,2583,1330,2470,1667,2249,2028,3780,481,4011,142,3098,831,3445,592,2517,1776,2234,1951,2827,1070,2660,1345,3177]}}]),i}(),v=function(){function i(e){t(this,i),this._badness=[],this._level=c.LEVELS[e.level],this._polynomial=[],this._value=e.value,this._valueLength=this._value.length,this._version=0,this._stringBuffer=[];for(var s=void 0,r=void 0,n=void 0,a=void 0;this._version<40;){this._version++;var h=4*(this._level-1)+16*(this._version-1);if(n=c.BLOCKS[h++],a=c.BLOCKS[h++],s=c.BLOCKS[h++],r=c.BLOCKS[h],h=s*(n+a)+a-3+(this._version<=9),this._valueLength<=h)break}this._dataBlock=s,this._eccBlock=r,this._neccBlock1=n,this._neccBlock2=a,this.width=17+4*this._version,this.buffer=i._createArray(this.width*this.width),this._ecc=i._createArray(this._dataBlock+(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2),this._mask=i._createArray((this.width*(this.width+1)+1)/2),this._insertFinders(),this._insertAlignments(),this.buffer[8+this.width*(this.width-8)]=1,this._insertTimingGap(),this._reverseMask(),this._insertTimingRowAndColumn(),this._insertVersion(),this._syncMask(),this._convertBitStream(this._value.length),this._calculatePolynomial(),this._appendEccToData(),this._interleaveBlocks(),this._pack(),this._finish()}return e(i,null,[{key:"_createArray",value:function(t){for(var e=[],i=0;i<t;i++)e[i]=0;return e}},{key:"_getMaskBit",value:function(t,e){var i=void 0;return t>e&&(i=t,t=e,e=i),i=e,i+=e*e,i>>=1,i+=t}},{key:"_modN",value:function(t){for(;t>=255;)t-=255,t=(t>>8)+(255&t);return t}},{key:"N1",get:function(){return 3}},{key:"N2",get:function(){return 3}},{key:"N3",get:function(){return 40}},{key:"N4",get:function(){return 10}}]),e(i,[{key:"_addAlignment",value:function(t,e){this.buffer[t+this.width*e]=1;for(var i=-2;i<2;i++)this.buffer[t+i+this.width*(e-2)]=1,this.buffer[t-2+this.width*(e+i+1)]=1,this.buffer[t+2+this.width*(e+i)]=1,this.buffer[t+i+1+this.width*(e+2)]=1;for(var s=0;s<2;s++)this._setMask(t-1,e+s),this._setMask(t+1,e-s),this._setMask(t-s,e-1),this._setMask(t+s,e+1)}},{key:"_appendData",value:function(t,e,s,r){for(var n=0;n<r;n++)this._stringBuffer[s+n]=0;for(var a=0;a<e;a++){var h=l.LOG[this._stringBuffer[t+a]^this._stringBuffer[s]];if(255!==h)for(var o=1;o<r;o++)this._stringBuffer[s+o-1]=this._stringBuffer[s+o]^l.EXPONENT[i._modN(h+this._polynomial[r-o])];else for(var f=s;f<s+r;f++)this._stringBuffer[f]=this._stringBuffer[f+1];this._stringBuffer[s+r-1]=255===h?0:l.EXPONENT[i._modN(h+this._polynomial[0])]}}},{key:"_appendEccToData",value:function(){for(var t=0,e=this._calculateMaxLength(),i=0;i<this._neccBlock1;i++)this._appendData(t,this._dataBlock,e,this._eccBlock),t+=this._dataBlock,e+=this._eccBlock;for(var s=0;s<this._neccBlock2;s++)this._appendData(t,this._dataBlock+1,e,this._eccBlock),t+=this._dataBlock+1,e+=this._eccBlock}},{key:"_applyMask",value:function(t){var e=this.width;switch(t){case 0:for(var i=0;i<e;i++)for(var s=0;s<e;s++)s+i&1||this._isMasked(s,i)||(this.buffer[s+i*e]^=1);break;case 1:for(var r=0;r<e;r++)for(var n=0;n<e;n++)1&r||this._isMasked(n,r)||(this.buffer[n+r*e]^=1);break;case 2:for(var a=0;a<e;a++)for(var h=0,o=0;o<e;o++,h++)3===h&&(h=0),h||this._isMasked(o,a)||(this.buffer[o+a*e]^=1);break;case 3:for(var f=0,u=0;u<e;u++,f++){3===f&&(f=0);for(var c=f,l=0;l<e;l++,c++)3===c&&(c=0),c||this._isMasked(l,u)||(this.buffer[l+u*e]^=1)}break;case 4:for(var _=0;_<e;_++)for(var v=0,k=_>>1&1,d=0;d<e;d++,v++)3===v&&(v=0,k=!k),k||this._isMasked(d,_)||(this.buffer[d+_*e]^=1);break;case 5:for(var g=0,y=0;y<e;y++,g++){3===g&&(g=0);for(var m=0,b=0;b<e;b++,m++)3===m&&(m=0),(b&y&1)+!(!m|!g)||this._isMasked(b,y)||(this.buffer[b+y*e]^=1)}break;case 6:for(var p=0,B=0;B<e;B++,p++){3===p&&(p=0);for(var w=0,M=0;M<e;M++,w++)3===w&&(w=0),(M&B&1)+(w&&w===p)&1||this._isMasked(M,B)||(this.buffer[M+B*e]^=1)}break;case 7:for(var O=0,L=0;L<e;L++,O++){3===O&&(O=0);for(var E=0,S=0;S<e;S++,E++)3===E&&(E=0),(E&&E===O)+(S+L&1)&1||this._isMasked(S,L)||(this.buffer[S+L*e]^=1)}}}},{key:"_calculateMaxLength",value:function(){return this._dataBlock*(this._neccBlock1+this._neccBlock2)+this._neccBlock2}},{key:"_calculatePolynomial",value:function(){this._polynomial[0]=1;for(var t=0;t<this._eccBlock;t++){this._polynomial[t+1]=1;for(var e=t;e>0;e--)this._polynomial[e]=this._polynomial[e]?this._polynomial[e-1]^l.EXPONENT[i._modN(l.LOG[this._polynomial[e]]+t)]:this._polynomial[e-1];this._polynomial[0]=l.EXPONENT[i._modN(l.LOG[this._polynomial[0]]+t)]}for(var s=0;s<=this._eccBlock;s++)this._polynomial[s]=l.LOG[this._polynomial[s]]}},{key:"_checkBadness",value:function(){for(var t=0,e=this.width,s=0;s<e-1;s++)for(var r=0;r<e-1;r++)(this.buffer[r+e*s]&&this.buffer[r+1+e*s]&&this.buffer[r+e*(s+1)]&&this.buffer[r+1+e*(s+1)]||!(this.buffer[r+e*s]||this.buffer[r+1+e*s]||this.buffer[r+e*(s+1)]||this.buffer[r+1+e*(s+1)]))&&(t+=i.N2);for(var n=0,a=0;a<e;a++){var h=0;this._badness[0]=0;for(var o=0,f=0;f<e;f++){var u=this.buffer[f+e*a];o===u?this._badness[h]++:this._badness[++h]=1,o=u,n+=o?1:-1}t+=this._getBadness(h)}n<0&&(n=-n);var c=0,l=n;for(l+=l<<2,l<<=1;l>e*e;)l-=e*e,c++;t+=c*i.N4;for(var _=0;_<e;_++){var v=0;this._badness[0]=0;for(var k=0,d=0;d<e;d++){var g=this.buffer[_+e*d];k===g?this._badness[v]++:this._badness[++v]=1,k=g}t+=this._getBadness(v)}return t}},{key:"_convertBitStream",value:function(t){for(var e=0;e<t;e++)this._ecc[e]=this._value.charCodeAt(e);this._stringBuffer=this._ecc.slice(0);var i=this._calculateMaxLength();t>=i-2&&(t=i-2,this._version>9&&t--);var s=t;if(this._version>9){for(this._stringBuffer[s+2]=0,this._stringBuffer[s+3]=0;s--;){var r=this._stringBuffer[s];this._stringBuffer[s+3]|=255&r<<4,this._stringBuffer[s+2]=r>>4}this._stringBuffer[2]|=255&t<<4,this._stringBuffer[1]=t>>4,this._stringBuffer[0]=64|t>>12}else{for(this._stringBuffer[s+1]=0,this._stringBuffer[s+2]=0;s--;){var n=this._stringBuffer[s];this._stringBuffer[s+2]|=255&n<<4,this._stringBuffer[s+1]=n>>4}this._stringBuffer[1]|=255&t<<4,this._stringBuffer[0]=64|t>>4}for(s=t+3-(this._version<10);s<i;)this._stringBuffer[s++]=236,this._stringBuffer[s++]=17}},{key:"_getBadness",value:function(t){for(var e=0,s=0;s<=t;s++)this._badness[s]>=5&&(e+=i.N1+this._badness[s]-5);for(var r=3;r<t-1;r+=2)this._badness[r-2]===this._badness[r+2]&&this._badness[r+2]===this._badness[r-1]&&this._badness[r-1]===this._badness[r+1]&&3*this._badness[r-1]===this._badness[r]&&(0===this._badness[r-3]||r+3>t||3*this._badness[r-3]>=4*this._badness[r]||3*this._badness[r+3]>=4*this._badness[r])&&(e+=i.N3);return e}},{key:"_finish",value:function(){this._stringBuffer=this.buffer.slice(0);var t=0,e=void 0,i=3e4;for(e=0;e<8;e++){this._applyMask(e);var s=this._checkBadness();if(s<i&&(i=s,t=e),7===t)break;this.buffer=this._stringBuffer.slice(0)}for(t!==e&&this._applyMask(t),i=c.FINAL_FORMAT[t+(this._level-1<<3)],e=0;e<8;e++,i>>=1)1&i&&(this.buffer[this.width-1-e+8*this.width]=1,e<6?this.buffer[8+this.width*e]=1:this.buffer[8+this.width*(e+1)]=1);for(e=0;e<7;e++,i>>=1)1&i&&(this.buffer[8+this.width*(this.width-7+e)]=1,e?this.buffer[6-e+8*this.width]=1:this.buffer[7+8*this.width]=1)}},{key:"_interleaveBlocks",value:function(){var t=this._calculateMaxLength(),e=void 0,i=0;for(e=0;e<this._dataBlock;e++){for(var s=0;s<this._neccBlock1;s++)this._ecc[i++]=this._stringBuffer[e+s*this._dataBlock];for(var r=0;r<this._neccBlock2;r++)this._ecc[i++]=this._stringBuffer[this._neccBlock1*this._dataBlock+e+r*(this._dataBlock+1)]}for(var n=0;n<this._neccBlock2;n++)this._ecc[i++]=this._stringBuffer[this._neccBlock1*this._dataBlock+e+n*(this._dataBlock+1)];for(e=0;e<this._eccBlock;e++)for(var a=0;a<this._neccBlock1+this._neccBlock2;a++)this._ecc[i++]=this._stringBuffer[t+e+a*this._eccBlock];this._stringBuffer=this._ecc}},{key:"_insertAlignments",value:function(){var t=this.width;if(this._version>1)for(var e=u.BLOCK[this._version],i=t-7;;){for(var s=t-7;s>e-3&&(this._addAlignment(s,i),!(s<e));)s-=e;if(i<=e+9)break;i-=e,this._addAlignment(6,i),this._addAlignment(i,6)}}},{key:"_insertFinders",value:function(){for(var t=this.width,e=0;e<3;e++){var i=0,s=0;1===e&&(i=t-7),2===e&&(s=t-7),this.buffer[s+3+t*(i+3)]=1;for(var r=0;r<6;r++)this.buffer[s+r+t*i]=1,this.buffer[s+t*(i+r+1)]=1,this.buffer[s+6+t*(i+r)]=1,this.buffer[s+r+1+t*(i+6)]=1;for(var n=1;n<5;n++)this._setMask(s+n,i+1),this._setMask(s+1,i+n+1),this._setMask(s+5,i+n),this._setMask(s+n+1,i+5);for(var a=2;a<4;a++)this.buffer[s+a+t*(i+2)]=1,this.buffer[s+2+t*(i+a+1)]=1,this.buffer[s+4+t*(i+a)]=1,this.buffer[s+a+1+t*(i+4)]=1}}},{key:"_insertTimingGap",value:function(){for(var t=this.width,e=0;e<7;e++)this._setMask(7,e),this._setMask(t-8,e),this._setMask(7,e+t-7);for(var i=0;i<8;i++)this._setMask(i,7),this._setMask(i+t-8,7),this._setMask(i,t-8)}},{key:"_insertTimingRowAndColumn",value:function(){for(var t=this.width,e=0;e<t-14;e++)1&e?(this._setMask(8+e,6),this._setMask(6,8+e)):(this.buffer[8+e+6*t]=1,this.buffer[6+t*(8+e)]=1)}},{key:"_insertVersion",value:function(){var t=this.width;if(this._version>6)for(var e=_.BLOCK[this._version-7],i=17,s=0;s<6;s++)for(var r=0;r<3;r++,i--)1&(i>11?this._version>>i-12:e>>i)?(this.buffer[5-s+t*(2-r+t-11)]=1,this.buffer[2-r+t-11+t*(5-s)]=1):(this._setMask(5-s,2-r+t-11),this._setMask(2-r+t-11,5-s))}},{key:"_isMasked",value:function(t,e){var s=i._getMaskBit(t,e);return 1===this._mask[s]}},{key:"_pack",value:function(){for(var t=this.width-1,e=this.width-1,i=1,s=1,r=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2,n=0;n<r;n++)for(var a=this._stringBuffer[n],h=0;h<8;h++,a<<=1){128&a&&(this.buffer[t+this.width*e]=1);do s?t--:(t++,i?0!==e?e--:(t-=2,i=!i,6===t&&(t--,e=9)):e!==this.width-1?e++:(t-=2,i=!i,6===t&&(t--,e-=8))),s=!s;while(this._isMasked(t,e))}}},{key:"_reverseMask",value:function(){for(var t=this.width,e=0;e<9;e++)this._setMask(e,8);for(var i=0;i<8;i++)this._setMask(i+t-8,8),this._setMask(8,i);for(var s=0;s<7;s++)this._setMask(8,s+t-7)}},{key:"_setMask",value:function(t,e){var s=i._getMaskBit(t,e);this._mask[s]=1}},{key:"_syncMask",value:function(){for(var t=this.width,e=0;e<t;e++)for(var i=0;i<=e;i++)this.buffer[i+t*e]&&this._setMask(i,e)}}]),i}(),k=function(r){function n(){return t(this,n),s(this,Object.getPrototypeOf(n).apply(this,arguments))}return i(n,r),e(n,[{key:"draw",value:function(){var t=this.qrious;t.image.src=t.toDataURL()}},{key:"reset",value:function(){var t=this.qrious;t.image.src=""}},{key:"resize",value:function(){var t=this.qrious,e=t.image;e.width=t.size,e.height=t.size}}]),n}(o),d=function(){function i(){t(this,i),this._services={}}return e(i,[{key:"getService",value:function(t){var e=this._services[t];if(!e)throw new Error("Service is not being managed with name: "+t);return e}},{key:"setService",value:function(t,e){if(this._services[t])throw new Error("Service is already managed with name: "+t);e&&(this._services[t]=e)}}]),i}(),g=function(){function i(e){t(this,i),e=i._parseOptions(e),r.privatize(this,e);var s=this._element,n=i._serviceManager.getService("element");this.canvas=s&&n.isCanvas(s)?s:n.createCanvas(),this.canvas.qrious=this,this.image=s&&n.isImage(s)?s:n.createImage(),this.image.qrious=this,this._renderers=[new f(this),new k(this)],this.update()}return e(i,null,[{key:"use",value:function(t){i._serviceManager.setService(t.getName(),t)}},{key:"_parseOptions",value:function(t){return t=Object.assign({},i.DEFAULTS,t),t.level=r.toUpperCase(t.level),t.size=Math.abs(t.size),t}},{key:"DEFAULTS",get:function(){return{background:"white",foreground:"black",level:"L",mime:"image/png",size:100,value:""}}},{key:"VERSION",get:function(){return"2.0.2"}}]),e(i,[{key:"toDataURL",value:function(t){return this.canvas.toDataURL(t||this.mime)}},{key:"update",value:function(){var t=new v({level:this.level,value:this.value});this._renderers.forEach(function(e){return e.render(t)})}},{key:"background",get:function(){return this._background},set:function(t){var e=r.setter(this,"_background",t,i.DEFAULTS.background);e&&this.update()}},{key:"foreground",get:function(){return this._foreground},set:function(t){var e=r.setter(this,"_foreground",t,i.DEFAULTS.foreground);e&&this.update()}},{key:"level",get:function(){return this._level},set:function(t){var e=r.setter(this,"_level",t,i.DEFAULTS.level,r.toUpperCase);e&&this.update()}},{key:"mime",get:function(){return this._mime},set:function(t){var e=r.setter(this,"_mime",t,i.DEFAULTS.mime);e&&this.update()}},{key:"size",get:function(){return this._size},set:function(t){var e=r.setter(this,"_size",t,i.DEFAULTS.size,Math.abs);e&&this.update()}},{key:"value",get:function(){return this._value},set:function(t){var e=r.setter(this,"_value",t,i.DEFAULTS.value);e&&this.update()}}]),i}();return g._serviceManager=new d,g.use(new h),g});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define("qrious",e):t.QRious=e()}(this,function(){"use strict";function t(t){return t&&t.__esModule?t.default:t}function e(t,e){return e={exports:{}},t(e,e.exports),e.exports}var n=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t},r=n,i=function(t){return Object(r(t))},s={}.hasOwnProperty,o=function(t,e){return s.call(t,e)},u=e(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),a=u,f="__core-js_shared__",c=a[f]||(a[f]={}),h=function(t){return c[t]||(c[t]={})},l=0,_=Math.random(),v=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++l+_).toString(36))},d=h("keys"),p=v,y=function(t){return d[t]||(d[t]=p(t))},k=o,g=i,b=y("IE_PROTO"),m=Object.prototype,w=Object.getPrototypeOf||function(t){return t=g(t),k(t,b)?t[b]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?m:null},B=e(function(t){var e=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=e)}),O=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t},M=O,S=function(t,e,n){if(M(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}},E=function(t){return"object"==typeof t?null!==t:"function"==typeof t},j=E,L=function(t){if(!j(t))throw TypeError(t+" is not an object!");return t},N=function(t){try{return!!t()}catch(t){return!0}},P=!N(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),A=E,T=u.document,C=A(T)&&A(T.createElement),F=function(t){return C?T.createElement(t):{}},x=!P&&!N(function(){return 7!=Object.defineProperty(F("div"),"a",{get:function(){return 7}}).a}),z=E,U=function(t,e){if(!z(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!z(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!z(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!z(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},I=L,D=x,R=U,q=Object.defineProperty,K=P?Object.defineProperty:function(t,e,n){if(I(t),e=R(e,!0),I(n),D)try{return q(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t},G={f:K},W=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},V=G,X=W,J=P?function(t,e,n){return V.f(t,e,X(1,n))}:function(t,e,n){return t[e]=n,t},H=u,Q=B,Y=S,Z=J,$="prototype",tt=function(t,e,n){var r,i,s,o=t&tt.F,u=t&tt.G,a=t&tt.S,f=t&tt.P,c=t&tt.B,h=t&tt.W,l=u?Q:Q[e]||(Q[e]={}),_=l[$],v=u?H:a?H[e]:(H[e]||{})[$];u&&(n=e);for(r in n)i=!o&&v&&void 0!==v[r],i&&r in l||(s=i?v[r]:n[r],l[r]=u&&"function"!=typeof v[r]?n[r]:c&&i?Y(s,H):h&&v[r]==s?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e[$]=t[$],e}(s):f&&"function"==typeof s?Y(Function.call,s):s,f&&((l.virtual||(l.virtual={}))[r]=s,t&tt.R&&_&&!_[r]&&Z(_,r,s)))};tt.F=1,tt.G=2,tt.S=4,tt.P=8,tt.B=16,tt.W=32,tt.U=64,tt.R=128;var et=tt,nt=et,rt=B,it=N,st=function(t,e){var n=(rt.Object||{})[t]||Object[t],r={};r[t]=e(n),nt(nt.S+nt.F*it(function(){n(1)}),"Object",r)},ot=i,ut=w;st("getPrototypeOf",function(){return function(t){return ut(ot(t))}});var at=B.Object.getPrototypeOf,ft=e(function(t){t.exports={default:at,__esModule:!0}}),ct=t(ft),ht=e(function(t,e){e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}}),lt=t(ht),_t=et;_t(_t.S+_t.F*!P,"Object",{defineProperty:G.f});var vt=B.Object,dt=function(t,e,n){return vt.defineProperty(t,e,n)},pt=e(function(t){t.exports={default:dt,__esModule:!0}}),yt=e(function(t,e){function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var r=pt,i=n(r);e.default=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,i.default)(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}()}),kt=t(yt),gt=Math.ceil,bt=Math.floor,mt=function(t){return isNaN(t=+t)?0:(t>0?bt:gt)(t)},wt=mt,Bt=n,Ot=function(t){return function(e,n){var r,i,s=String(Bt(e)),o=wt(n),u=s.length;return o<0||o>=u?t?"":void 0:(r=s.charCodeAt(o),r<55296||r>56319||o+1===u||(i=s.charCodeAt(o+1))<56320||i>57343?t?s.charAt(o):r:t?s.slice(o,o+2):(r-55296<<10)+(i-56320)+65536)}},Mt=!0,St=J,Et={},jt={}.toString,Lt=function(t){return jt.call(t).slice(8,-1)},Nt=Lt,Pt=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==Nt(t)?t.split(""):Object(t)},At=Pt,Tt=n,Ct=function(t){return At(Tt(t))},Ft=mt,xt=Math.min,zt=function(t){return t>0?xt(Ft(t),9007199254740991):0},Ut=mt,It=Math.max,Dt=Math.min,Rt=function(t,e){return t=Ut(t),t<0?It(t+e,0):Dt(t,e)},qt=Ct,Kt=zt,Gt=Rt,Wt=function(t){return function(e,n,r){var i,s=qt(e),o=Kt(s.length),u=Gt(r,o);if(t&&n!=n){for(;o>u;)if(i=s[u++],i!=i)return!0}else for(;o>u;u++)if((t||u in s)&&s[u]===n)return t||u||0;return!t&&-1}},Vt=o,Xt=Ct,Jt=Wt(!1),Ht=y("IE_PROTO"),Qt=function(t,e){var n,r=Xt(t),i=0,s=[];for(n in r)n!=Ht&&Vt(r,n)&&s.push(n);for(;e.length>i;)Vt(r,n=e[i++])&&(~Jt(s,n)||s.push(n));return s},Yt="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),Zt=Qt,$t=Yt,te=Object.keys||function(t){return Zt(t,$t)},ee=G,ne=L,re=te,ie=P?Object.defineProperties:function(t,e){ne(t);for(var n,r=re(e),i=r.length,s=0;i>s;)ee.f(t,n=r[s++],e[n]);return t},se=u.document&&document.documentElement,oe=L,ue=ie,ae=Yt,fe=y("IE_PROTO"),ce=function(){},he="prototype",le=function(){var t,e=F("iframe"),n=ae.length,r="<",i=">";for(e.style.display="none",se.appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(r+"script"+i+"document.F=Object"+r+"/script"+i),t.close(),le=t.F;n--;)delete le[he][ae[n]];return le()},_e=Object.create||function(t,e){var n;return null!==t?(ce[he]=oe(t),n=new ce,ce[he]=null,n[fe]=t):n=le(),void 0===e?n:ue(n,e)},ve=e(function(t){var e=h("wks"),n=v,r=u.Symbol,i="function"==typeof r,s=t.exports=function(t){return e[t]||(e[t]=i&&r[t]||(i?r:n)("Symbol."+t))};s.store=e}),de=G.f,pe=o,ye=ve("toStringTag"),ke=function(t,e,n){t&&!pe(t=n?t:t.prototype,ye)&&de(t,ye,{configurable:!0,value:e})},ge=_e,be=W,me=ke,we={};J(we,ve("iterator"),function(){return this});var Be=function(t,e,n){t.prototype=ge(we,{next:be(1,n)}),me(t,e+" Iterator")},Oe=Mt,Me=et,Se=St,Ee=J,je=o,Le=Et,Ne=Be,Pe=ke,Ae=w,Te=ve("iterator"),Ce=!([].keys&&"next"in[].keys()),Fe="@@iterator",xe="keys",ze="values",Ue=function(){return this},Ie=function(t,e,n,r,i,s,o){Ne(n,e,r);var u,a,f,c=function(t){if(!Ce&&t in v)return v[t];switch(t){case xe:return function(){return new n(this,t)};case ze:return function(){return new n(this,t)}}return function(){return new n(this,t)}},h=e+" Iterator",l=i==ze,_=!1,v=t.prototype,d=v[Te]||v[Fe]||i&&v[i],p=d||c(i),y=i?l?c("entries"):p:void 0,k="Array"==e?v.entries||d:d;if(k&&(f=Ae(k.call(new t)),f!==Object.prototype&&(Pe(f,h,!0),Oe||je(f,Te)||Ee(f,Te,Ue))),l&&d&&d.name!==ze&&(_=!0,p=function(){return d.call(this)}),Oe&&!o||!Ce&&!_&&v[Te]||Ee(v,Te,p),Le[e]=p,Le[h]=Ue,i)if(u={values:l?p:c(ze),keys:s?p:c(xe),entries:y},o)for(a in u)a in v||Se(v,a,u[a]);else Me(Me.P+Me.F*(Ce||_),e,u);return u},De=Ot(!0);Ie(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=De(e,n),this._i+=t.length,{value:t,done:!1})});var Re=function(){},qe=function(t,e){return{value:e,done:!!t}},Ke=Re,Ge=qe,We=Et,Ve=Ct;Ie(Array,"Array",function(t,e){this._t=Ve(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,Ge(1)):"keys"==e?Ge(0,n):"values"==e?Ge(0,t[n]):Ge(0,[n,t[n]])},"values");We.Arguments=We.Array,Ke("keys"),Ke("values"),Ke("entries");for(var Xe=u,Je=J,He=Et,Qe=ve("toStringTag"),Ye=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],Ze=0;Ze<5;Ze++){var $e=Ye[Ze],tn=Xe[$e],en=tn&&tn.prototype;en&&!en[Qe]&&Je(en,Qe,$e),He[$e]=He.Array}var nn=ve,rn={f:nn},sn=rn.f("iterator"),on=e(function(t){t.exports={default:sn,__esModule:!0}}),un=e(function(t){var e=v("meta"),n=E,r=o,i=G.f,s=0,u=Object.isExtensible||function(){return!0},a=!N(function(){return u(Object.preventExtensions({}))}),f=function(t){i(t,e,{value:{i:"O"+ ++s,w:{}}})},c=function(t,i){if(!n(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!r(t,e)){if(!u(t))return"F";if(!i)return"E";f(t)}return t[e].i},h=function(t,n){if(!r(t,e)){if(!u(t))return!0;if(!n)return!1;f(t)}return t[e].w},l=function(t){return a&&_.NEED&&u(t)&&!r(t,e)&&f(t),t},_=t.exports={KEY:e,NEED:!1,fastKey:c,getWeak:h,onFreeze:l}}),an=u,fn=B,cn=Mt,hn=rn,ln=G.f,_n=function(t){var e=fn.Symbol||(fn.Symbol=cn?{}:an.Symbol||{});"_"==t.charAt(0)||t in e||ln(e,t,{value:hn.f(t)})},vn=te,dn=Ct,pn=function(t,e){for(var n,r=dn(t),i=vn(r),s=i.length,o=0;s>o;)if(r[n=i[o++]]===e)return n},yn=Object.getOwnPropertySymbols,kn={f:yn},gn={}.propertyIsEnumerable,bn={f:gn},mn=te,wn=kn,Bn=bn,On=function(t){var e=mn(t),n=wn.f;if(n)for(var r,i=n(t),s=Bn.f,o=0;i.length>o;)s.call(t,r=i[o++])&&e.push(r);return e},Mn=Lt,Sn=Array.isArray||function(t){return"Array"==Mn(t)},En=Qt,jn=Yt.concat("length","prototype"),Ln=Object.getOwnPropertyNames||function(t){return En(t,jn)},Nn={f:Ln},Pn=Ct,An=Nn.f,Tn={}.toString,Cn="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Fn=function(t){try{return An(t)}catch(t){return Cn.slice()}},xn=function(t){return Cn&&"[object Window]"==Tn.call(t)?Fn(t):An(Pn(t))},zn={f:xn},Un=bn,In=W,Dn=Ct,Rn=U,qn=o,Kn=x,Gn=Object.getOwnPropertyDescriptor,Wn=P?Gn:function(t,e){if(t=Dn(t),e=Rn(e,!0),Kn)try{return Gn(t,e)}catch(t){}if(qn(t,e))return In(!Un.f.call(t,e),t[e])},Vn={f:Wn},Xn=u,Jn=o,Hn=P,Qn=et,Yn=St,Zn=un.KEY,$n=N,tr=h,er=ke,nr=v,rr=ve,ir=rn,sr=_n,or=pn,ur=On,ar=Sn,fr=L,cr=Ct,hr=U,lr=W,_r=_e,vr=zn,dr=Vn,pr=G,yr=te,kr=dr.f,gr=pr.f,br=vr.f,mr=Xn.Symbol,wr=Xn.JSON,Br=wr&&wr.stringify,Or="prototype",Mr=rr("_hidden"),Sr=rr("toPrimitive"),Er={}.propertyIsEnumerable,jr=tr("symbol-registry"),Lr=tr("symbols"),Nr=tr("op-symbols"),Pr=Object[Or],Ar="function"==typeof mr,Tr=Xn.QObject,Cr=!Tr||!Tr[Or]||!Tr[Or].findChild,Fr=Hn&&$n(function(){return 7!=_r(gr({},"a",{get:function(){return gr(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=kr(Pr,e);r&&delete Pr[e],gr(t,e,n),r&&t!==Pr&&gr(Pr,e,r)}:gr,xr=function(t){var e=Lr[t]=_r(mr[Or]);return e._k=t,e},zr=Ar&&"symbol"==typeof mr.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof mr},Ur=function(t,e,n){return t===Pr&&Ur(Nr,e,n),fr(t),e=hr(e,!0),fr(n),Jn(Lr,e)?(n.enumerable?(Jn(t,Mr)&&t[Mr][e]&&(t[Mr][e]=!1),n=_r(n,{enumerable:lr(0,!1)})):(Jn(t,Mr)||gr(t,Mr,lr(1,{})),t[Mr][e]=!0),Fr(t,e,n)):gr(t,e,n)},Ir=function(t,e){fr(t);for(var n,r=ur(e=cr(e)),i=0,s=r.length;s>i;)Ur(t,n=r[i++],e[n]);return t},Dr=function(t,e){return void 0===e?_r(t):Ir(_r(t),e)},Rr=function(t){var e=Er.call(this,t=hr(t,!0));return!(this===Pr&&Jn(Lr,t)&&!Jn(Nr,t))&&(!(e||!Jn(this,t)||!Jn(Lr,t)||Jn(this,Mr)&&this[Mr][t])||e)},qr=function(t,e){if(t=cr(t),e=hr(e,!0),t!==Pr||!Jn(Lr,e)||Jn(Nr,e)){var n=kr(t,e);return!n||!Jn(Lr,e)||Jn(t,Mr)&&t[Mr][e]||(n.enumerable=!0),n}},Kr=function(t){for(var e,n=br(cr(t)),r=[],i=0;n.length>i;)Jn(Lr,e=n[i++])||e==Mr||e==Zn||r.push(e);return r},Gr=function(t){for(var e,n=t===Pr,r=br(n?Nr:cr(t)),i=[],s=0;r.length>s;)!Jn(Lr,e=r[s++])||n&&!Jn(Pr,e)||i.push(Lr[e]);return i};Ar||(mr=function(){if(this instanceof mr)throw TypeError("Symbol is not a constructor!");var t=nr(arguments.length>0?arguments[0]:void 0),e=function(n){this===Pr&&e.call(Nr,n),Jn(this,Mr)&&Jn(this[Mr],t)&&(this[Mr][t]=!1),Fr(this,t,lr(1,n))};return Hn&&Cr&&Fr(Pr,t,{configurable:!0,set:e}),xr(t)},Yn(mr[Or],"toString",function(){return this._k}),dr.f=qr,pr.f=Ur,Nn.f=vr.f=Kr,bn.f=Rr,kn.f=Gr,Hn&&!Mt&&Yn(Pr,"propertyIsEnumerable",Rr,!0),ir.f=function(t){return xr(rr(t))}),Qn(Qn.G+Qn.W+Qn.F*!Ar,{Symbol:mr});for(var Wr="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),Vr=0;Wr.length>Vr;)rr(Wr[Vr++]);for(var Wr=yr(rr.store),Vr=0;Wr.length>Vr;)sr(Wr[Vr++]);Qn(Qn.S+Qn.F*!Ar,"Symbol",{for:function(t){return Jn(jr,t+="")?jr[t]:jr[t]=mr(t)},keyFor:function(t){if(zr(t))return or(jr,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){Cr=!0},useSimple:function(){Cr=!1}}),Qn(Qn.S+Qn.F*!Ar,"Object",{create:Dr,defineProperty:Ur,defineProperties:Ir,getOwnPropertyDescriptor:qr,getOwnPropertyNames:Kr,getOwnPropertySymbols:Gr}),wr&&Qn(Qn.S+Qn.F*(!Ar||$n(function(){var t=mr();return"[null]"!=Br([t])||"{}"!=Br({a:t})||"{}"!=Br(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!zr(t)){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);return e=r[1],"function"==typeof e&&(n=e),!n&&ar(e)||(e=function(t,e){if(n&&(e=n.call(this,t,e)),!zr(e))return e}),r[1]=e,Br.apply(wr,r)}}}),mr[Or][Sr]||J(mr[Or],Sr,mr[Or].valueOf),er(mr,"Symbol"),er(Math,"Math",!0),er(Xn.JSON,"JSON",!0),_n("asyncIterator"),_n("observable");var Xr=B.Symbol,Jr=e(function(t){t.exports={default:Xr,__esModule:!0}}),Hr=e(function(t,e){function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var r=on,i=n(r),s=Jr,o=n(s),u="function"==typeof o.default&&"symbol"==typeof i.default?function(t){return typeof t}:function(t){return t&&"function"==typeof o.default&&t.constructor===o.default?"symbol":typeof t};e.default="function"==typeof o.default&&"symbol"===u(i.default)?function(t){return"undefined"==typeof t?"undefined":u(t)}:function(t){return t&&"function"==typeof o.default&&t.constructor===o.default?"symbol":"undefined"==typeof t?"undefined":u(t)}}),Qr=e(function(t,e){function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var r=Hr,i=n(r);e.default=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==("undefined"==typeof e?"undefined":(0,i.default)(e))&&"function"!=typeof e?t:e}}),Yr=t(Qr),Zr=E,$r=L,ti=function(t,e){if($r(t),!Zr(e)&&null!==e)throw TypeError(e+": can't set as prototype!")},ei={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,n){try{n=S(Function.call,Vn.f(Object.prototype,"__proto__").set,2),n(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,r){return ti(t,r),e?t.__proto__=r:n(t,r),t}}({},!1):void 0),check:ti},ni=et;ni(ni.S,"Object",{setPrototypeOf:ei.set});var ri=B.Object.setPrototypeOf,ii=e(function(t){t.exports={default:ri,__esModule:!0}}),si=et;si(si.S,"Object",{create:_e});var oi=B.Object,ui=function(t,e){return oi.create(t,e)},ai=e(function(t){t.exports={default:ui,__esModule:!0}}),fi=e(function(t,e){function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var r=ii,i=n(r),s=ai,o=n(s),u=Hr,a=n(u);e.default=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof e?"undefined":(0,a.default)(e)));t.prototype=(0,o.default)(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(i.default?(0,i.default)(t,e):t.__proto__=e)}}),ci=t(fi),hi=function(){function t(){lt(this,t)}return kt(t,null,[{key:"abs",value:function(t){return null!=t?Math.abs(t):null}},{key:"privatize",value:function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t["_"+n]=e[n]);return t}},{key:"setter",value:function(t,e,n,r,i){var s=t[e],o=null!=n?n:r;return"function"==typeof i&&(o=i(o)),t[e]=o,o!==s}},{key:"throwUnimplemented",value:function(t,e){throw new Error('"'+e+'" method must be implemented on the '+t+" class")}},{key:"toUpperCase",value:function(t){return null!=t&&t.toUpperCase()}}]),t}(),li=function(){function t(){lt(this,t)}return kt(t,[{key:"getName",value:function(){hi.throwUnimplemented("Service","getName")}}]),t}(),_i=function(t){function e(){return lt(this,e),Yr(this,(e.__proto__||ct(e)).apply(this,arguments))}return ci(e,t),kt(e,[{key:"createCanvas",value:function(){hi.throwUnimplemented("ElementService","createCanvas")}},{key:"createImage",value:function(){hi.throwUnimplemented("ElementService","createImage")}},{key:"getName",value:function(){return"element"}},{key:"isCanvas",value:function(t){hi.throwUnimplemented("ElementService","isCanvas")}},{key:"isImage",value:function(t){hi.throwUnimplemented("ElementService","isImage")}}]),e}(li),vi=function(t){function e(){return lt(this,e),Yr(this,(e.__proto__||ct(e)).apply(this,arguments))}return ci(e,t),kt(e,[{key:"createCanvas",value:function(){return document.createElement("canvas")}},{key:"createImage",value:function(){return document.createElement("img")}},{key:"isCanvas",value:function(t){return t instanceof HTMLCanvasElement}},{key:"isImage",value:function(t){return t instanceof HTMLImageElement}}]),e}(_i),di=te,pi=kn,yi=bn,ki=i,gi=Pt,bi=Object.assign,mi=!bi||N(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=bi({},t)[n]||Object.keys(bi({},e)).join("")!=r})?function(t,e){for(var n=ki(t),r=arguments.length,i=1,s=pi.f,o=yi.f;r>i;)for(var u,a=gi(arguments[i++]),f=s?di(a).concat(s(a)):di(a),c=f.length,h=0;c>h;)o.call(a,u=f[h++])&&(n[u]=a[u]);return n}:bi,wi=et;wi(wi.S+wi.F,"Object",{assign:mi});var Bi=B.Object.assign,Oi=e(function(t){t.exports={default:Bi,__esModule:!0}}),Mi=t(Oi),Si=function(){function t(e){lt(this,t),this.qrious=e}return kt(t,[{key:"draw",value:function(t){hi.throwUnimplemented("Renderer","draw")}},{key:"getModuleSize",value:function(t){var e=this.qrious.padding||0,n=Math.floor((this.qrious.size-2*e)/t.width);return Math.max(1,n)}},{key:"getOffset",value:function(t){if(null!=this.qrious.padding)return this.qrious.padding;var e=this.getModuleSize(t),n=Math.floor((this.qrious.size-e*t.width)/2);return Math.max(0,n)}},{key:"render",value:function(t){this.resize(),this.reset(),this.draw(t)}},{key:"reset",value:function(){hi.throwUnimplemented("Renderer","reset")}},{key:"resize",value:function(){hi.throwUnimplemented("Renderer","resize")}}]),t}(),Ei=function(t){function e(){return lt(this,e),Yr(this,(e.__proto__||ct(e)).apply(this,arguments))}return ci(e,t),kt(e,[{key:"draw",value:function(t){var e=this.qrious,n=this.getModuleSize(t),r=this.getOffset(t),i=e.canvas.getContext("2d");i.fillStyle=e.foreground;for(var s=0;s<t.width;s++)for(var o=0;o<t.width;o++)t.buffer[o*t.width+s]&&i.fillRect(n*s+r,n*o+r,n,n)}},{key:"reset",value:function(){var t=this.qrious,e=t.canvas.getContext("2d");e.lineWidth=1,e.clearRect(0,0,t.size,t.size),e.fillStyle=t.background,e.fillRect(0,0,t.size,t.size)}},{key:"resize",value:function(){var t=this.qrious,e=t.canvas;e.width=t.size,e.height=t.size}}]),e}(Si),ji=function(){function t(){lt(this,t)}return kt(t,null,[{key:"BLOCK",get:function(){return[0,11,15,19,23,27,31,16,18,20,22,24,26,28,20,22,24,24,26,28,28,22,24,24,26,26,28,28,24,24,26,26,26,28,28,24,26,26,26,28,28]}}]),t}(),Li=function(){function t(){lt(this,t)}return kt(t,null,[{key:"BLOCKS",get:function(){return[1,0,19,7,1,0,16,10,1,0,13,13,1,0,9,17,1,0,34,10,1,0,28,16,1,0,22,22,1,0,16,28,1,0,55,15,1,0,44,26,2,0,17,18,2,0,13,22,1,0,80,20,2,0,32,18,2,0,24,26,4,0,9,16,1,0,108,26,2,0,43,24,2,2,15,18,2,2,11,22,2,0,68,18,4,0,27,16,4,0,19,24,4,0,15,28,2,0,78,20,4,0,31,18,2,4,14,18,4,1,13,26,2,0,97,24,2,2,38,22,4,2,18,22,4,2,14,26,2,0,116,30,3,2,36,22,4,4,16,20,4,4,12,24,2,2,68,18,4,1,43,26,6,2,19,24,6,2,15,28,4,0,81,20,1,4,50,30,4,4,22,28,3,8,12,24,2,2,92,24,6,2,36,22,4,6,20,26,7,4,14,28,4,0,107,26,8,1,37,22,8,4,20,24,12,4,11,22,3,1,115,30,4,5,40,24,11,5,16,20,11,5,12,24,5,1,87,22,5,5,41,24,5,7,24,30,11,7,12,24,5,1,98,24,7,3,45,28,15,2,19,24,3,13,15,30,1,5,107,28,10,1,46,28,1,15,22,28,2,17,14,28,5,1,120,30,9,4,43,26,17,1,22,28,2,19,14,28,3,4,113,28,3,11,44,26,17,4,21,26,9,16,13,26,3,5,107,28,3,13,41,26,15,5,24,30,15,10,15,28,4,4,116,28,17,0,42,26,17,6,22,28,19,6,16,30,2,7,111,28,17,0,46,28,7,16,24,30,34,0,13,24,4,5,121,30,4,14,47,28,11,14,24,30,16,14,15,30,6,4,117,30,6,14,45,28,11,16,24,30,30,2,16,30,8,4,106,26,8,13,47,28,7,22,24,30,22,13,15,30,10,2,114,28,19,4,46,28,28,6,22,28,33,4,16,30,8,4,122,30,22,3,45,28,8,26,23,30,12,28,15,30,3,10,117,30,3,23,45,28,4,31,24,30,11,31,15,30,7,7,116,30,21,7,45,28,1,37,23,30,19,26,15,30,5,10,115,30,19,10,47,28,15,25,24,30,23,25,15,30,13,3,115,30,2,29,46,28,42,1,24,30,23,28,15,30,17,0,115,30,10,23,46,28,10,35,24,30,19,35,15,30,17,1,115,30,14,21,46,28,29,19,24,30,11,46,15,30,13,6,115,30,14,23,46,28,44,7,24,30,59,1,16,30,12,7,121,30,12,26,47,28,39,14,24,30,22,41,15,30,6,14,121,30,6,34,47,28,46,10,24,30,2,64,15,30,17,4,122,30,29,14,46,28,49,10,24,30,24,46,15,30,4,18,122,30,13,32,46,28,48,14,24,30,42,32,15,30,20,4,117,30,40,7,47,28,43,22,24,30,10,67,15,30,19,6,118,30,18,31,47,28,34,34,24,30,20,61,15,30]}},{key:"FINAL_FORMAT",get:function(){return[30660,29427,32170,30877,26159,25368,27713,26998,21522,20773,24188,23371,17913,16590,20375,19104,13663,12392,16177,14854,9396,8579,11994,11245,5769,5054,7399,6608,1890,597,3340,2107]}},{key:"LEVELS",get:function(){return{L:1,M:2,Q:3,H:4}}}]),t}(),Ni=function(){function t(){lt(this,t)}return kt(t,null,[{key:"EXPONENT",get:function(){return[1,2,4,8,16,32,64,128,29,58,116,232,205,135,19,38,76,152,45,90,180,117,234,201,143,3,6,12,24,48,96,192,157,39,78,156,37,74,148,53,106,212,181,119,238,193,159,35,70,140,5,10,20,40,80,160,93,186,105,210,185,111,222,161,95,190,97,194,153,47,94,188,101,202,137,15,30,60,120,240,253,231,211,187,107,214,177,127,254,225,223,163,91,182,113,226,217,175,67,134,17,34,68,136,13,26,52,104,208,189,103,206,129,31,62,124,248,237,199,147,59,118,236,197,151,51,102,204,133,23,46,92,184,109,218,169,79,158,33,66,132,21,42,84,168,77,154,41,82,164,85,170,73,146,57,114,228,213,183,115,230,209,191,99,198,145,63,126,252,229,215,179,123,246,241,255,227,219,171,75,150,49,98,196,149,55,110,220,165,87,174,65,130,25,50,100,200,141,7,14,28,56,112,224,221,167,83,166,81,162,89,178,121,242,249,239,195,155,43,86,172,69,138,9,18,36,72,144,61,122,244,245,247,243,251,235,203,139,11,22,44,88,176,125,250,233,207,131,27,54,108,216,173,71,142,0]}},{key:"LOG",get:function(){return[255,0,1,25,2,50,26,198,3,223,51,238,27,104,199,75,4,100,224,14,52,141,239,129,28,193,105,248,200,8,76,113,5,138,101,47,225,36,15,33,53,147,142,218,240,18,130,69,29,181,194,125,106,39,249,185,201,154,9,120,77,228,114,166,6,191,139,98,102,221,48,253,226,152,37,179,16,145,34,136,54,208,148,206,143,150,219,189,241,210,19,92,131,56,70,64,30,66,182,163,195,72,126,110,107,58,40,84,250,133,186,61,202,94,155,159,10,21,121,43,78,212,229,172,115,243,167,87,7,112,192,247,140,128,99,13,103,74,222,237,49,197,254,24,227,165,153,119,38,184,180,124,17,68,146,217,35,32,137,46,55,63,209,91,149,188,207,205,144,135,151,178,220,252,190,97,242,86,211,171,20,42,93,158,132,60,57,83,71,109,65,162,31,45,67,216,183,123,164,118,196,23,73,236,127,12,111,246,108,161,59,82,41,157,85,170,251,96,134,177,187,204,62,90,203,89,95,176,156,169,160,81,11,245,22,235,122,117,44,215,79,174,213,233,230,231,173,232,116,214,244,234,168,80,88,175]}}]),t}(),Pi=function(){function t(){lt(this,t)}return kt(t,null,[{key:"BLOCK",get:function(){return[3220,1468,2713,1235,3062,1890,2119,1549,2344,2936,1117,2583,1330,2470,1667,2249,2028,3780,481,4011,142,3098,831,3445,592,2517,1776,2234,1951,2827,1070,2660,1345,3177]}}]),t}(),Ai=function(){function t(e){lt(this,t),this._badness=[],this._level=Li.LEVELS[e.level],this._polynomial=[],this._value=e.value,this._valueLength=this._value.length,this._version=0,this._stringBuffer=[];for(var n=void 0,r=void 0,i=void 0,s=void 0;this._version<40;){this._version++;var o=4*(this._level-1)+16*(this._version-1);if(i=Li.BLOCKS[o++],s=Li.BLOCKS[o++],n=Li.BLOCKS[o++],r=Li.BLOCKS[o],o=n*(i+s)+s-3+(this._version<=9),this._valueLength<=o)break}this._dataBlock=n,this._eccBlock=r,this._neccBlock1=i,this._neccBlock2=s,this.width=17+4*this._version,this.buffer=t._createArray(this.width*this.width),this._ecc=t._createArray(this._dataBlock+(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2),this._mask=t._createArray((this.width*(this.width+1)+1)/2),this._insertFinders(),this._insertAlignments(),this.buffer[8+this.width*(this.width-8)]=1,this._insertTimingGap(),this._reverseMask(),this._insertTimingRowAndColumn(),this._insertVersion(),this._syncMask(),this._convertBitStream(this._value.length),this._calculatePolynomial(),this._appendEccToData(),this._interleaveBlocks(),this._pack(),this._finish()}return kt(t,null,[{key:"_createArray",value:function(t){for(var e=[],n=0;n<t;n++)e[n]=0;return e}},{key:"_getMaskBit",value:function(t,e){var n=void 0;return t>e&&(n=t,t=e,e=n),n=e,n+=e*e,n>>=1,n+=t}},{key:"_modN",value:function(t){for(;t>=255;)t-=255,t=(t>>8)+(255&t);return t}},{key:"N1",get:function(){return 3}},{key:"N2",get:function(){return 3}},{key:"N3",get:function(){return 40}},{key:"N4",get:function(){return 10}}]),kt(t,[{key:"_addAlignment",value:function(t,e){this.buffer[t+this.width*e]=1;for(var n=-2;n<2;n++)this.buffer[t+n+this.width*(e-2)]=1,this.buffer[t-2+this.width*(e+n+1)]=1,this.buffer[t+2+this.width*(e+n)]=1,this.buffer[t+n+1+this.width*(e+2)]=1;for(var r=0;r<2;r++)this._setMask(t-1,e+r),this._setMask(t+1,e-r),this._setMask(t-r,e-1),this._setMask(t+r,e+1)}},{key:"_appendData",value:function(e,n,r,i){for(var s=0;s<i;s++)this._stringBuffer[r+s]=0;for(var o=0;o<n;o++){var u=Ni.LOG[this._stringBuffer[e+o]^this._stringBuffer[r]];if(255!==u)for(var a=1;a<i;a++)this._stringBuffer[r+a-1]=this._stringBuffer[r+a]^Ni.EXPONENT[t._modN(u+this._polynomial[i-a])];else for(var f=r;f<r+i;f++)this._stringBuffer[f]=this._stringBuffer[f+1];this._stringBuffer[r+i-1]=255===u?0:Ni.EXPONENT[t._modN(u+this._polynomial[0])]}}},{key:"_appendEccToData",value:function(){for(var t=0,e=this._calculateMaxLength(),n=0;n<this._neccBlock1;n++)this._appendData(t,this._dataBlock,e,this._eccBlock),t+=this._dataBlock,e+=this._eccBlock;for(var r=0;r<this._neccBlock2;r++)this._appendData(t,this._dataBlock+1,e,this._eccBlock),t+=this._dataBlock+1,e+=this._eccBlock}},{key:"_applyMask",value:function(t){var e=this.width;switch(t){case 0:for(var n=0;n<e;n++)for(var r=0;r<e;r++)r+n&1||this._isMasked(r,n)||(this.buffer[r+n*e]^=1);break;case 1:for(var i=0;i<e;i++)for(var s=0;s<e;s++)1&i||this._isMasked(s,i)||(this.buffer[s+i*e]^=1);break;case 2:for(var o=0;o<e;o++)for(var u=0,a=0;a<e;a++,u++)3===u&&(u=0),u||this._isMasked(a,o)||(this.buffer[a+o*e]^=1);break;case 3:for(var f=0,c=0;c<e;c++,f++){3===f&&(f=0);for(var h=f,l=0;l<e;l++,h++)3===h&&(h=0),h||this._isMasked(l,c)||(this.buffer[l+c*e]^=1)}break;case 4:for(var _=0;_<e;_++)for(var v=0,d=_>>1&1,p=0;p<e;p++,v++)3===v&&(v=0,d=!d),d||this._isMasked(p,_)||(this.buffer[p+_*e]^=1);break;case 5:for(var y=0,k=0;k<e;k++,y++){3===y&&(y=0);for(var g=0,b=0;b<e;b++,g++)3===g&&(g=0),(b&k&1)+!(!g|!y)||this._isMasked(b,k)||(this.buffer[b+k*e]^=1)}break;case 6:for(var m=0,w=0;w<e;w++,m++){3===m&&(m=0);for(var B=0,O=0;O<e;O++,B++)3===B&&(B=0),(O&w&1)+(B&&B===m)&1||this._isMasked(O,w)||(this.buffer[O+w*e]^=1)}break;case 7:for(var M=0,S=0;S<e;S++,M++){3===M&&(M=0);for(var E=0,j=0;j<e;j++,E++)3===E&&(E=0),(E&&E===M)+(j+S&1)&1||this._isMasked(j,S)||(this.buffer[j+S*e]^=1)}}}},{key:"_calculateMaxLength",value:function(){return this._dataBlock*(this._neccBlock1+this._neccBlock2)+this._neccBlock2}},{key:"_calculatePolynomial",value:function(){this._polynomial[0]=1;for(var e=0;e<this._eccBlock;e++){this._polynomial[e+1]=1;for(var n=e;n>0;n--)this._polynomial[n]=this._polynomial[n]?this._polynomial[n-1]^Ni.EXPONENT[t._modN(Ni.LOG[this._polynomial[n]]+e)]:this._polynomial[n-1];this._polynomial[0]=Ni.EXPONENT[t._modN(Ni.LOG[this._polynomial[0]]+e)]}for(var r=0;r<=this._eccBlock;r++)this._polynomial[r]=Ni.LOG[this._polynomial[r]]}},{key:"_checkBadness",value:function(){for(var e=0,n=this.width,r=0;r<n-1;r++)for(var i=0;i<n-1;i++)(this.buffer[i+n*r]&&this.buffer[i+1+n*r]&&this.buffer[i+n*(r+1)]&&this.buffer[i+1+n*(r+1)]||!(this.buffer[i+n*r]||this.buffer[i+1+n*r]||this.buffer[i+n*(r+1)]||this.buffer[i+1+n*(r+1)]))&&(e+=t.N2);for(var s=0,o=0;o<n;o++){var u=0;this._badness[0]=0;for(var a=0,f=0;f<n;f++){var c=this.buffer[f+n*o];a===c?this._badness[u]++:this._badness[++u]=1,a=c,s+=a?1:-1}e+=this._getBadness(u)}s<0&&(s=-s);var h=0,l=s;for(l+=l<<2,l<<=1;l>n*n;)l-=n*n,h++;e+=h*t.N4;for(var _=0;_<n;_++){var v=0;this._badness[0]=0;for(var d=0,p=0;p<n;p++){var y=this.buffer[_+n*p];d===y?this._badness[v]++:this._badness[++v]=1,d=y}e+=this._getBadness(v)}return e}},{key:"_convertBitStream",value:function(t){for(var e=0;e<t;e++)this._ecc[e]=this._value.charCodeAt(e);this._stringBuffer=this._ecc.slice(0);var n=this._calculateMaxLength();t>=n-2&&(t=n-2,this._version>9&&t--);var r=t;if(this._version>9){for(this._stringBuffer[r+2]=0,this._stringBuffer[r+3]=0;r--;){var i=this._stringBuffer[r];this._stringBuffer[r+3]|=255&i<<4,this._stringBuffer[r+2]=i>>4}this._stringBuffer[2]|=255&t<<4,this._stringBuffer[1]=t>>4,this._stringBuffer[0]=64|t>>12}else{for(this._stringBuffer[r+1]=0,this._stringBuffer[r+2]=0;r--;){var s=this._stringBuffer[r];this._stringBuffer[r+2]|=255&s<<4,this._stringBuffer[r+1]=s>>4}this._stringBuffer[1]|=255&t<<4,this._stringBuffer[0]=64|t>>4}for(r=t+3-(this._version<10);r<n;)this._stringBuffer[r++]=236,this._stringBuffer[r++]=17}},{key:"_getBadness",value:function(e){for(var n=0,r=0;r<=e;r++)this._badness[r]>=5&&(n+=t.N1+this._badness[r]-5);for(var i=3;i<e-1;i+=2)this._badness[i-2]===this._badness[i+2]&&this._badness[i+2]===this._badness[i-1]&&this._badness[i-1]===this._badness[i+1]&&3*this._badness[i-1]===this._badness[i]&&(0===this._badness[i-3]||i+3>e||3*this._badness[i-3]>=4*this._badness[i]||3*this._badness[i+3]>=4*this._badness[i])&&(n+=t.N3);return n}},{key:"_finish",value:function(){this._stringBuffer=this.buffer.slice(0);var t=0,e=void 0,n=3e4;for(e=0;e<8;e++){this._applyMask(e);var r=this._checkBadness();if(r<n&&(n=r,t=e),7===t)break;this.buffer=this._stringBuffer.slice(0)}for(t!==e&&this._applyMask(t),n=Li.FINAL_FORMAT[t+(this._level-1<<3)],e=0;e<8;e++,n>>=1)1&n&&(this.buffer[this.width-1-e+8*this.width]=1,e<6?this.buffer[8+this.width*e]=1:this.buffer[8+this.width*(e+1)]=1);for(e=0;e<7;e++,n>>=1)1&n&&(this.buffer[8+this.width*(this.width-7+e)]=1,e?this.buffer[6-e+8*this.width]=1:this.buffer[7+8*this.width]=1)}},{key:"_interleaveBlocks",value:function(){var t=this._calculateMaxLength(),e=void 0,n=0;for(e=0;e<this._dataBlock;e++){for(var r=0;r<this._neccBlock1;r++)this._ecc[n++]=this._stringBuffer[e+r*this._dataBlock];for(var i=0;i<this._neccBlock2;i++)this._ecc[n++]=this._stringBuffer[this._neccBlock1*this._dataBlock+e+i*(this._dataBlock+1)]}for(var s=0;s<this._neccBlock2;s++)this._ecc[n++]=this._stringBuffer[this._neccBlock1*this._dataBlock+e+s*(this._dataBlock+1)];for(e=0;e<this._eccBlock;e++)for(var o=0;o<this._neccBlock1+this._neccBlock2;o++)this._ecc[n++]=this._stringBuffer[t+e+o*this._eccBlock];this._stringBuffer=this._ecc}},{key:"_insertAlignments",value:function(){var t=this.width;if(this._version>1)for(var e=ji.BLOCK[this._version],n=t-7;;){for(var r=t-7;r>e-3&&(this._addAlignment(r,n),!(r<e));)r-=e;if(n<=e+9)break;n-=e,this._addAlignment(6,n),this._addAlignment(n,6)}}},{key:"_insertFinders",value:function(){for(var t=this.width,e=0;e<3;e++){var n=0,r=0;1===e&&(n=t-7),2===e&&(r=t-7),this.buffer[r+3+t*(n+3)]=1;for(var i=0;i<6;i++)this.buffer[r+i+t*n]=1,this.buffer[r+t*(n+i+1)]=1,this.buffer[r+6+t*(n+i)]=1,this.buffer[r+i+1+t*(n+6)]=1;for(var s=1;s<5;s++)this._setMask(r+s,n+1),this._setMask(r+1,n+s+1),this._setMask(r+5,n+s),this._setMask(r+s+1,n+5);for(var o=2;o<4;o++)this.buffer[r+o+t*(n+2)]=1,
this.buffer[r+2+t*(n+o+1)]=1,this.buffer[r+4+t*(n+o)]=1,this.buffer[r+o+1+t*(n+4)]=1}}},{key:"_insertTimingGap",value:function(){for(var t=this.width,e=0;e<7;e++)this._setMask(7,e),this._setMask(t-8,e),this._setMask(7,e+t-7);for(var n=0;n<8;n++)this._setMask(n,7),this._setMask(n+t-8,7),this._setMask(n,t-8)}},{key:"_insertTimingRowAndColumn",value:function(){for(var t=this.width,e=0;e<t-14;e++)1&e?(this._setMask(8+e,6),this._setMask(6,8+e)):(this.buffer[8+e+6*t]=1,this.buffer[6+t*(8+e)]=1)}},{key:"_insertVersion",value:function(){var t=this.width;if(this._version>6)for(var e=Pi.BLOCK[this._version-7],n=17,r=0;r<6;r++)for(var i=0;i<3;i++,n--)1&(n>11?this._version>>n-12:e>>n)?(this.buffer[5-r+t*(2-i+t-11)]=1,this.buffer[2-i+t-11+t*(5-r)]=1):(this._setMask(5-r,2-i+t-11),this._setMask(2-i+t-11,5-r))}},{key:"_isMasked",value:function(e,n){var r=t._getMaskBit(e,n);return 1===this._mask[r]}},{key:"_pack",value:function(){for(var t=this.width-1,e=this.width-1,n=1,r=1,i=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2,s=0;s<i;s++)for(var o=this._stringBuffer[s],u=0;u<8;u++,o<<=1){128&o&&(this.buffer[t+this.width*e]=1);do r?t--:(t++,n?0!==e?e--:(t-=2,n=!n,6===t&&(t--,e=9)):e!==this.width-1?e++:(t-=2,n=!n,6===t&&(t--,e-=8))),r=!r;while(this._isMasked(t,e))}}},{key:"_reverseMask",value:function(){for(var t=this.width,e=0;e<9;e++)this._setMask(e,8);for(var n=0;n<8;n++)this._setMask(n+t-8,8),this._setMask(8,n);for(var r=0;r<7;r++)this._setMask(8,r+t-7)}},{key:"_setMask",value:function(e,n){var r=t._getMaskBit(e,n);this._mask[r]=1}},{key:"_syncMask",value:function(){for(var t=this.width,e=0;e<t;e++)for(var n=0;n<=e;n++)this.buffer[n+t*e]&&this._setMask(n,e)}}]),t}(),Ti=function(t){function e(){return lt(this,e),Yr(this,(e.__proto__||ct(e)).apply(this,arguments))}return ci(e,t),kt(e,[{key:"draw",value:function(){var t=this.qrious;t.image.src=t.toDataURL()}},{key:"reset",value:function(){var t=this.qrious;t.image.src=""}},{key:"resize",value:function(){var t=this.qrious,e=t.image;e.width=t.size,e.height=t.size}}]),e}(Si),Ci=function(){function t(){lt(this,t),this._services={}}return kt(t,[{key:"getService",value:function(t){var e=this._services[t];if(!e)throw new Error("Service is not being managed with name: "+t);return e}},{key:"setService",value:function(t,e){if(this._services[t])throw new Error("Service is already managed with name: "+t);e&&(this._services[t]=e)}}]),t}(),Fi=function(){function t(e){lt(this,t),e=t._parseOptions(e),hi.privatize(this,e);var n=this._element,r=t._serviceManager.getService("element");this.canvas=n&&r.isCanvas(n)?n:r.createCanvas(),this.canvas.qrious=this,this.image=n&&r.isImage(n)?n:r.createImage(),this.image.qrious=this,this._renderers=[new Ei(this),new Ti(this)],this.update()}return kt(t,null,[{key:"use",value:function(e){t._serviceManager.setService(e.getName(),e)}},{key:"_parseOptions",value:function(e){return e=Mi({},t.DEFAULTS,e),e.level=hi.toUpperCase(e.level),e.padding=hi.abs(e.padding),e.size=hi.abs(e.size),e}},{key:"DEFAULTS",get:function(){return{background:"white",foreground:"black",level:"L",mime:"image/png",padding:null,size:100,value:""}}},{key:"VERSION",get:function(){return"2.1.0"}}]),kt(t,[{key:"toDataURL",value:function(t){return this.canvas.toDataURL(t||this.mime)}},{key:"update",value:function(){var t=new Ai({level:this.level,value:this.value});this._renderers.forEach(function(e){return e.render(t)})}},{key:"background",get:function(){return this._background},set:function(e){var n=hi.setter(this,"_background",e,t.DEFAULTS.background);n&&this.update()}},{key:"foreground",get:function(){return this._foreground},set:function(e){var n=hi.setter(this,"_foreground",e,t.DEFAULTS.foreground);n&&this.update()}},{key:"level",get:function(){return this._level},set:function(e){var n=hi.setter(this,"_level",e,t.DEFAULTS.level,hi.toUpperCase);n&&this.update()}},{key:"mime",get:function(){return this._mime},set:function(e){var n=hi.setter(this,"_mime",e,t.DEFAULTS.mime);n&&this.update()}},{key:"padding",get:function(){return this._padding},set:function(e){var n=hi.setter(this,"_padding",e,t.DEFAULTS.padding,hi.abs);n&&this.update()}},{key:"size",get:function(){return this._size},set:function(e){var n=hi.setter(this,"_size",e,t.DEFAULTS.size,hi.abs);n&&this.update()}},{key:"value",get:function(){return this._value},set:function(e){var n=hi.setter(this,"_value",e,t.DEFAULTS.value);n&&this.update()}}]),t}();return Fi._serviceManager=new Ci,Fi.use(new vi),Fi});
//# sourceMappingURL=qrious.min.js.map
{
"name": "qrious",
"version": "2.0.2",
"version": "2.1.0",
"description": "Library for QR code generation using canvas",

@@ -12,3 +12,3 @@ "homepage": "https://github.com/neocotic/qrious",

"email": "mercer.alasdair@gmail.com",
"url": "http://neocotic.com"
"url": "https://neocotic.com"
},

@@ -31,4 +31,7 @@ "license": "GPL-3.0",

"devDependencies": {
"babel-eslint": "^6.1.0",
"babel-preset-es2015-rollup": "^1.1.1",
"babel-eslint": "^7.0.0",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-preset-es2015": "^6.16.0",
"babel-runtime": "^6.11.6",
"eslint-config-skelp": "^0.1.5",
"grunt": "^1.0.1",

@@ -38,8 +41,9 @@ "grunt-cli": "^1.2.0",

"grunt-contrib-watch": "^1.0.0",
"grunt-eslint": "^18.1.0",
"grunt-rollup": "^0.7.1",
"load-grunt-tasks": "^3.5.0",
"grunt-eslint": "^19.0.0",
"grunt-rollup": "^0.8.0",
"rollup-plugin-babel": "^2.6.1",
"rollup-plugin-node-resolve": "^1.7.1",
"rollup-plugin-uglify": "^1.0.1"
"rollup-plugin-commonjs": "^5.0.4",
"rollup-plugin-node-resolve": "^2.0.0",
"rollup-plugin-uglify": "^1.0.1",
"semver": "^5.3.0"
},

@@ -46,0 +50,0 @@ "browser": "dist/umd/qrious.js",

@@ -114,2 +114,3 @@ .oooooo. ooooooooo. o8o

| mime | String | MIME type used to render the image for the QR code | `"image/png"` |
| padding | Number | Padding for the QR code (pixels) | `null` (auto) |
| size | Number | Size of the QR code (pixels) | `100` |

@@ -123,2 +124,3 @@ | value | String | Value encoded within the QR code | `""` |

qr.level = 'H'
qr.padding = 25
qr.size = 500

@@ -135,2 +137,3 @@ qr.value = 'https://github.com/neocotic/qrious'

level: 'H',
padding: 25,
size: 500,

@@ -190,3 +193,3 @@ value: 'https://github.com/neocotic/qrious'

console.log(QRious.VERSION)
//=> "2.0.2"
//=> "2.1.0"
```

@@ -193,0 +196,0 @@

@@ -20,3 +20,3 @@ /*

/* eslint no-multi-spaces: 0 */
/* eslint no-multi-spaces: "off" */

@@ -33,3 +33,3 @@ /**

*
* @return {Number[]} The alignment pattern block.
* @return {number[]} The alignment pattern block.
* @public

@@ -45,4 +45,5 @@ * @static

}
}
export default Alignment

@@ -20,3 +20,3 @@ /*

/* eslint no-multi-spaces: 0 */
/* eslint no-multi-spaces: "off" */

@@ -36,3 +36,3 @@ /**

*
* @return {Number[]} The ECC blocks.
* @return {number[]} The ECC blocks.
* @public

@@ -89,3 +89,3 @@ * @static

*
* @return {Number[]} The final format bits.
* @return {number[]} The final format bits.
* @public

@@ -110,3 +110,3 @@ * @static

*
* @return {Object<String, Number>} A ECC level mapping.
* @return {Object<string, number>} A ECC level mapping.
* @public

@@ -123,4 +123,5 @@ * @static

}
}
export default ErrorCorrection

@@ -105,3 +105,3 @@ /*

let index = (this._level - 1) * 4 + (this._version - 1) * 16
let index = ((this._level - 1) * 4) + ((this._version - 1) * 16)

@@ -113,3 +113,3 @@ neccBlock1 = ErrorCorrection.BLOCKS[index++]

index = dataBlock * (neccBlock1 + neccBlock2) + neccBlock2 - 3 + (this._version <= 9)
index = (dataBlock * (neccBlock1 + neccBlock2)) + neccBlock2 - 3 + (this._version <= 9)

@@ -130,6 +130,6 @@ if (this._valueLength <= index) {

* @public
* @type {Number}
* @type {number}
*/
// FIXME: Ensure that it fits instead of being truncated.
this.width = 17 + 4 * this._version
this.width = 17 + (4 * this._version)

@@ -140,8 +140,9 @@ /**

* @public
* @type {Number[]}
* @type {number[]}
*/
this.buffer = Frame._createArray(this.width * this.width)
this._ecc = Frame._createArray(this._dataBlock + (this._dataBlock + this._eccBlock) * (this._neccBlock1 + this._neccBlock2) + this._neccBlock2)
this._mask = Frame._createArray((this.width * (this.width + 1) + 1) / 2)
this._ecc = Frame._createArray(this._dataBlock + ((this._dataBlock + this._eccBlock) *
(this._neccBlock1 + this._neccBlock2)) + this._neccBlock2)
this._mask = Frame._createArray(((this.width * (this.width + 1)) + 1) / 2)

@@ -152,3 +153,3 @@ this._insertFinders()

// Insert single foreground cell.
this.buffer[8 + this.width * (this.width - 8)] = 1
this.buffer[8 + (this.width * (this.width - 8))] = 1

@@ -169,9 +170,9 @@ this._insertTimingGap()

_addAlignment(x, y) {
this.buffer[x + this.width * y] = 1
this.buffer[x + (this.width * y)] = 1
for (let i = -2; i < 2; i++) {
this.buffer[x + i + this.width * (y - 2)] = 1
this.buffer[x - 2 + this.width * (y + i + 1)] = 1
this.buffer[x + 2 + this.width * (y + i)] = 1
this.buffer[x + i + 1 + this.width * (y + 2)] = 1
this.buffer[x + i + (this.width * (y - 2))] = 1
this.buffer[x - 2 + (this.width * (y + i + 1))] = 1
this.buffer[x + 2 + (this.width * (y + i))] = 1
this.buffer[x + i + 1 + (this.width * (y + 2))] = 1
}

@@ -197,3 +198,4 @@

for (let j = 1; j < eccLength; j++) {
this._stringBuffer[ecc + j - 1] = this._stringBuffer[ecc + j] ^ Galois.EXPONENT[Frame._modN(bit + this._polynomial[eccLength - j])]
this._stringBuffer[ecc + j - 1] = this._stringBuffer[ecc + j] ^
Galois.EXPONENT[Frame._modN(bit + this._polynomial[eccLength - j])]
}

@@ -206,3 +208,4 @@ } else {

this._stringBuffer[ecc + eccLength - 1] = bit === 255 ? 0 : Galois.EXPONENT[Frame._modN(bit + this._polynomial[0])]
this._stringBuffer[ecc + eccLength - 1] = bit === 255 ? 0
: Galois.EXPONENT[Frame._modN(bit + this._polynomial[0])]
}

@@ -237,4 +240,4 @@ }

for (let x = 0; x < width; x++) {
if (!(x + y & 1) && !this._isMasked(x, y)) {
this.buffer[x + y * width] ^= 1
if (!((x + y) & 1) && !this._isMasked(x, y)) {
this.buffer[x + (y * width)] ^= 1
}

@@ -249,3 +252,3 @@ }

if (!(y & 1) && !this._isMasked(x, y)) {
this.buffer[x + y * width] ^= 1
this.buffer[x + (y * width)] ^= 1
}

@@ -264,3 +267,3 @@ }

if (!r3x && !this._isMasked(x, y)) {
this.buffer[x + y * width] ^= 1
this.buffer[x + (y * width)] ^= 1
}

@@ -283,3 +286,3 @@ }

if (!r3x && !this._isMasked(x, y)) {
this.buffer[x + y * width] ^= 1
this.buffer[x + (y * width)] ^= 1
}

@@ -292,3 +295,3 @@ }

for (let y = 0; y < width; y++) {
for (let r3x = 0, r3y = y >> 1 & 1, x = 0; x < width; x++, r3x++) {
for (let r3x = 0, r3y = (y >> 1) & 1, x = 0; x < width; x++, r3x++) {
if (r3x === 3) {

@@ -300,3 +303,3 @@ r3x = 0

if (!r3y && !this._isMasked(x, y)) {
this.buffer[x + y * width] ^= 1
this.buffer[x + (y * width)] ^= 1
}

@@ -319,3 +322,3 @@ }

if (!((x & y & 1) + !(!r3x | !r3y)) && !this._isMasked(x, y)) {
this.buffer[x + y * width] ^= 1
this.buffer[x + (y * width)] ^= 1
}

@@ -338,3 +341,3 @@ }

if (!((x & y & 1) + (r3x && r3x === r3y) & 1) && !this._isMasked(x, y)) {
this.buffer[x + y * width] ^= 1
this.buffer[x + (y * width)] ^= 1
}

@@ -357,3 +360,3 @@ }

if (!((r3x && r3x === r3y) + (x + y & 1) & 1) && !this._isMasked(x, y)) {
this.buffer[x + y * width] ^= 1
this.buffer[x + (y * width)] ^= 1
}

@@ -368,3 +371,3 @@ }

_calculateMaxLength() {
return this._dataBlock * (this._neccBlock1 + this._neccBlock2) + this._neccBlock2
return (this._dataBlock * (this._neccBlock1 + this._neccBlock2)) + this._neccBlock2
}

@@ -379,3 +382,4 @@

for (let j = i; j > 0; j--) {
this._polynomial[j] = this._polynomial[j] ? this._polynomial[j - 1] ^ Galois.EXPONENT[Frame._modN(Galois.LOG[this._polynomial[j]] + i)] : this._polynomial[j - 1]
this._polynomial[j] = this._polynomial[j] ? this._polynomial[j - 1] ^
Galois.EXPONENT[Frame._modN(Galois.LOG[this._polynomial[j]] + i)] : this._polynomial[j - 1]
}

@@ -400,11 +404,11 @@

// All foreground colour.
if (this.buffer[x + width * y] &&
this.buffer[x + 1 + width * y] &&
this.buffer[x + width * (y + 1)] &&
this.buffer[x + 1 + width * (y + 1)] ||
if ((this.buffer[x + (width * y)] &&
this.buffer[x + 1 + (width * y)] &&
this.buffer[x + (width * (y + 1))] &&
this.buffer[x + 1 + (width * (y + 1))]) ||
// All background colour.
!(this.buffer[x + width * y] ||
this.buffer[x + 1 + width * y] ||
this.buffer[x + width * (y + 1)] ||
this.buffer[x + 1 + width * (y + 1)])) {
!(this.buffer[x + (width * y)] ||
this.buffer[x + 1 + (width * y)] ||
this.buffer[x + (width * (y + 1))] ||
this.buffer[x + 1 + (width * (y + 1))])) {
bad += Frame.N2

@@ -424,3 +428,3 @@ }

for (let b = 0, x = 0; x < width; x++) {
let b1 = this.buffer[x + width * y]
const b1 = this.buffer[x + (width * y)]

@@ -463,3 +467,3 @@ if (b === b1) {

for (let b = 0, y = 0; y < width; y++) {
let b1 = this.buffer[x + width * y]
const b1 = this.buffer[x + (width * y)]

@@ -482,3 +486,3 @@ if (b === b1) {

_convertBitStream(length) {
// Convert string to bit stream. 8-bit data to QR-coded 8-bit data (numeric, alphanum, or kanji not supported).
// Convert string to bit stream. 8-bit data to QR-coded 8-bit data (numeric, alphanumeric, or kanji not supported).
for (let i = 0; i < length; i++) {

@@ -510,9 +514,9 @@ this._ecc[i] = this._value.charCodeAt(i)

this._stringBuffer[index + 3] |= 255 & bit << 4
this._stringBuffer[index + 3] |= 255 & (bit << 4)
this._stringBuffer[index + 2] = bit >> 4
}
this._stringBuffer[2] |= 255 & length << 4
this._stringBuffer[2] |= 255 & (length << 4)
this._stringBuffer[1] = length >> 4
this._stringBuffer[0] = 0x40 | length >> 12
this._stringBuffer[0] = 0x40 | (length >> 12)
} else {

@@ -525,8 +529,8 @@ this._stringBuffer[index + 1] = 0

this._stringBuffer[index + 2] |= 255 & bit << 4
this._stringBuffer[index + 2] |= 255 & (bit << 4)
this._stringBuffer[index + 1] = bit >> 4
}
this._stringBuffer[1] |= 255 & length << 4
this._stringBuffer[0] = 0x40 | length >> 4
this._stringBuffer[1] |= 255 & (length << 4)
this._stringBuffer[0] = 0x40 | (length >> 4)
}

@@ -613,8 +617,8 @@

if (mask & 1) {
this.buffer[this.width - 1 - i + this.width * 8] = 1
this.buffer[this.width - 1 - i + (this.width * 8)] = 1
if (i < 6) {
this.buffer[8 + this.width * i] = 1
this.buffer[8 + (this.width * i)] = 1
} else {
this.buffer[8 + this.width * (i + 1)] = 1
this.buffer[8 + (this.width * (i + 1))] = 1
}

@@ -627,8 +631,8 @@ }

if (mask & 1) {
this.buffer[8 + this.width * (this.width - 7 + i)] = 1
this.buffer[8 + (this.width * (this.width - 7 + i))] = 1
if (i) {
this.buffer[6 - i + this.width * 8] = 1
this.buffer[6 - i + (this.width * 8)] = 1
} else {
this.buffer[7 + this.width * 8] = 1
this.buffer[7 + (this.width * 8)] = 1
}

@@ -646,7 +650,7 @@ }

for (let j = 0; j < this._neccBlock1; j++) {
this._ecc[k++] = this._stringBuffer[i + j * this._dataBlock]
this._ecc[k++] = this._stringBuffer[i + (j * this._dataBlock)]
}
for (let j = 0; j < this._neccBlock2; j++) {
this._ecc[k++] = this._stringBuffer[this._neccBlock1 * this._dataBlock + i + j * (this._dataBlock + 1)]
this._ecc[k++] = this._stringBuffer[(this._neccBlock1 * this._dataBlock) + i + (j * (this._dataBlock + 1))]
}

@@ -656,3 +660,3 @@ }

for (let j = 0; j < this._neccBlock2; j++) {
this._ecc[k++] = this._stringBuffer[this._neccBlock1 * this._dataBlock + i + j * (this._dataBlock + 1)]
this._ecc[k++] = this._stringBuffer[(this._neccBlock1 * this._dataBlock) + i + (j * (this._dataBlock + 1))]
}

@@ -662,3 +666,3 @@

for (let j = 0; j < this._neccBlock1 + this._neccBlock2; j++) {
this._ecc[k++] = this._stringBuffer[maxLength + i + j * this._eccBlock]
this._ecc[k++] = this._stringBuffer[maxLength + i + (j * this._eccBlock)]
}

@@ -716,9 +720,9 @@ }

this.buffer[y + 3 + width * (j + 3)] = 1
this.buffer[y + 3 + (width * (j + 3))] = 1
for (let x = 0; x < 6; x++) {
this.buffer[y + x + width * j] = 1
this.buffer[y + width * (j + x + 1)] = 1
this.buffer[y + 6 + width * (j + x)] = 1
this.buffer[y + x + 1 + width * (j + 6)] = 1
this.buffer[y + x + (width * j)] = 1
this.buffer[y + (width * (j + x + 1))] = 1
this.buffer[y + 6 + (width * (j + x))] = 1
this.buffer[y + x + 1 + (width * (j + 6))] = 1
}

@@ -734,6 +738,6 @@

for (let x = 2; x < 4; x++) {
this.buffer[y + x + width * (j + 2)] = 1
this.buffer[y + 2 + width * (j + x + 1)] = 1
this.buffer[y + 4 + width * (j + x)] = 1
this.buffer[y + x + 1 + width * (j + 4)] = 1
this.buffer[y + x + (width * (j + 2))] = 1
this.buffer[y + 2 + (width * (j + x + 1))] = 1
this.buffer[y + 4 + (width * (j + x))] = 1
this.buffer[y + x + 1 + (width * (j + 4))] = 1
}

@@ -767,4 +771,4 @@ }

} else {
this.buffer[8 + x + width * 6] = 1
this.buffer[6 + width * (8 + x)] = 1
this.buffer[8 + x + (width * 6)] = 1
this.buffer[6 + (width * (8 + x))] = 1
}

@@ -778,3 +782,3 @@ }

if (this._version > 6) {
let i = Version.BLOCK[this._version - 7]
const i = Version.BLOCK[this._version - 7]
let j = 17

@@ -785,4 +789,4 @@

if (1 & (j > 11 ? this._version >> j - 12 : i >> j)) {
this.buffer[5 - x + width * (2 - y + width - 11)] = 1
this.buffer[2 - y + width - 11 + width * (5 - x)] = 1
this.buffer[5 - x + (width * (2 - y + width - 11))] = 1
this.buffer[2 - y + width - 11 + (width * (5 - x))] = 1
} else {

@@ -810,3 +814,3 @@ this._setMask(5 - x, 2 - y + width - 11)

// Interleaved data and ECC codes.
const length = (this._dataBlock + this._eccBlock) * (this._neccBlock1 + this._neccBlock2) + this._neccBlock2
const length = ((this._dataBlock + this._eccBlock) * (this._neccBlock1 + this._neccBlock2)) + this._neccBlock2

@@ -818,3 +822,3 @@ for (let i = 0; i < length; i++) {

if (0x80 & bit) {
this.buffer[x + this.width * y] = 1
this.buffer[x + (this.width * y)] = 1
}

@@ -888,3 +892,3 @@

for (let x = 0; x <= y; x++) {
if (this.buffer[x + width * y]) {
if (this.buffer[x + (width * y)]) {
this._setMask(x, y)

@@ -895,2 +899,3 @@ }

}
}

@@ -904,4 +909,4 @@

* @typedef {Object} Frame~Options
* @property {String} level - The ECC level to be used.
* @property {String} value - The value to be encoded.
* @property {string} level - The ECC level to be used.
* @property {string} value - The value to be encoded.
*/

@@ -30,3 +30,3 @@ /*

*
* @return {Number[]} The Galois field exponent table.
* @return {number[]} The Galois field exponent table.
* @public

@@ -59,3 +59,3 @@ * @static

*
* @return {Number[]} The Galois field log table.
* @return {number[]} The Galois field log table.
* @public

@@ -84,4 +84,5 @@ * @static

}
}
export default Galois

@@ -46,2 +46,3 @@ /*

mime: 'image/png',
padding: null,
size: 100,

@@ -55,3 +56,3 @@ value: ''

*
* @return {String} The current version.
* @return {string} The current version.
* @public

@@ -61,3 +62,3 @@ * @static

static get VERSION() {
return '2.0.2'
return '2.1.0'
}

@@ -69,2 +70,3 @@

* @param {Service} service - the {@link Service} to be configured
* @return {void}
* @throws {Error} If a {@link Service} has already been configured with the same name.

@@ -81,3 +83,4 @@ * @public

options.level = Utilities.toUpperCase(options.level)
options.size = Math.abs(options.size)
options.padding = Utilities.abs(options.padding)
options.size = Utilities.abs(options.size)

@@ -98,4 +101,4 @@ return options

let element = this._element
let elementService = QRious._serviceManager.getService('element')
const element = this._element
const elementService = QRious._serviceManager.getService('element')

@@ -131,4 +134,4 @@ /**

*
* @param {String} [mime] - the MIME type for the image
* @return {String} The image data URI for the QR code.
* @param {string} [mime] - the MIME type for the image
* @return {string} The image data URI for the QR code.
* @public

@@ -143,2 +146,3 @@ */

*
* @return {void}
* @protected

@@ -158,3 +162,3 @@ */

*
* @return {String} The background color.
* @return {string} The background color.
* @public

@@ -169,3 +173,3 @@ */

*
* @param {String} [background="white"] - the background color to be set
* @param {string} [background="white"] - the background color to be set
* @public

@@ -184,3 +188,3 @@ */

*
* @return {String} The foreground color.
* @return {string} The foreground color.
* @public

@@ -195,3 +199,3 @@ */

*
* @param {String} [foreground="black"] - the foreground color to be set
* @param {string} [foreground="black"] - the foreground color to be set
* @public

@@ -210,3 +214,3 @@ */

*
* @return {String} The ECC level.
* @return {string} The ECC level.
* @public

@@ -223,3 +227,3 @@ */

*
* @param {String} [level="L"] - the ECC level to be set
* @param {string} [level="L"] - the ECC level to be set
* @public

@@ -238,3 +242,3 @@ */

*
* @return {String} The image MIME type.
* @return {string} The image MIME type.
* @public

@@ -249,3 +253,3 @@ */

*
* @param {String} [mime="image/png"] - the image MIME type to be set
* @param {string} [mime="image/png"] - the image MIME type to be set
* @public

@@ -262,5 +266,32 @@ */

/**
* Returns the padding for the QR code.
*
* @return {number} The padding in pixels.
* @public
*/
get padding() {
return this._padding
}
/**
* Sets the padding for the QR code to <code>padding</code>.
*
* <code>padding</code> will be transformed to ensure that it is always an absolute positive numbers (e.g.
* <code>-10</code> would become <code>10</code>).
*
* @param {number} [padding] - the padding in pixels to be set
* @public
*/
set padding(padding) {
const changed = Utilities.setter(this, '_padding', padding, QRious.DEFAULTS.padding, Utilities.abs)
if (changed) {
this.update()
}
}
/**
* Returns the size of the QR code.
*
* @return {Number} The size in pixels.
* @return {number} The size in pixels.
* @public

@@ -278,7 +309,7 @@ */

*
* @param {Number} [size=100] - the size in pixels to be set
* @param {number} [size=100] - the size in pixels to be set
* @public
*/
set size(size) {
const changed = Utilities.setter(this, '_size', size, QRious.DEFAULTS.size, Math.abs)
const changed = Utilities.setter(this, '_size', size, QRious.DEFAULTS.size, Utilities.abs)

@@ -293,3 +324,3 @@ if (changed) {

*
* @return {String} The value.
* @return {string} The value.
* @public

@@ -304,3 +335,3 @@ */

*
* @param {String} [value=""] - the value to be set
* @param {string} [value=""] - the value to be set
* @public

@@ -315,2 +346,3 @@ */

}
}

@@ -326,10 +358,11 @@

* @typedef {Object} QRious~Options
* @property {String} [background="white"] - The background color to be applied to the QR code.
* @property {string} [background="white"] - The background color to be applied to the QR code.
* @property {*} [element] - The element to be used to render the QR code which may either be an <code>canvas</code> or
* <code>img</code>. The element(s) will be created if needed.
* @property {String} [foreground="black"] - The foreground color to be applied to the QR code.
* @property {String} [level="L"] - The error correction level to be applied to the QR code.
* @property {String} [mime="image/png"] - The MIME type to be used to render the image for the QR code.
* @property {Number} [size=100] - The size of the QR code in pixels.
* @property {String} [value=""] - The value to be encoded within the QR code.
* @property {string} [foreground="black"] - The foreground color to be applied to the QR code.
* @property {string} [level="L"] - The error correction level to be applied to the QR code.
* @property {string} [mime="image/png"] - The MIME type to be used to render the image for the QR code.
* @property {number} [padding] - The padding for the QR code in pixels.
* @property {number} [size=100] - The size of the QR code in pixels.
* @property {string} [value=""] - The value to be encoded within the QR code.
*/

@@ -43,4 +43,4 @@ /*

for (let j = 0; j < frame.width; j++) {
if (frame.buffer[j * frame.width + i]) {
context.fillRect(moduleSize * i + offset, moduleSize * j + offset, moduleSize, moduleSize)
if (frame.buffer[(j * frame.width) + i]) {
context.fillRect((moduleSize * i) + offset, (moduleSize * j) + offset, moduleSize, moduleSize)
}

@@ -74,4 +74,5 @@ }

}
}
export default CanvasRenderer

@@ -61,4 +61,5 @@ /*

}
}
export default ImageRenderer

@@ -53,2 +53,3 @@ /*

* @param {Frame} frame - the {@link Frame} to be drawn
* @return {void}
* @protected

@@ -64,2 +65,4 @@ */

*
* Any configured padding will be excluded from the returned size.
*
* The returned value will be at least one, even in cases where the size of the QR code does not fit its contents.

@@ -70,7 +73,8 @@ * This is done so that the inevitable clipping is handled more gracefully since this way at least something is

* @param {Frame} frame - the {@link Frame} from which the module size is to be derived
* @return {Number} The pixel size for each module in the QR code which will be no less than one.
* @return {number} The pixel size for each module in the QR code which will be no less than one.
* @protected
*/
getModuleSize(frame) {
const pixels = Math.floor(this.qrious.size / frame.width)
const padding = this.qrious.padding || 0
const pixels = Math.floor((this.qrious.size - (padding * 2)) / frame.width)

@@ -89,8 +93,12 @@ return Math.max(1, pixels)

* @param {Frame} frame - the {@link Frame} from which the offset is to be derived
* @return {Number} The pixel offset for the QR code which will be no less than zero.
* @return {number} The pixel offset for the QR code which will be no less than zero.
* @protected
*/
getOffset(frame) {
if (this.qrious.padding != null) {
return this.qrious.padding
}
const moduleSize = this.getModuleSize(frame)
const offset = Math.floor((this.qrious.size - moduleSize * frame.width) / 2)
const offset = Math.floor((this.qrious.size - (moduleSize * frame.width)) / 2)

@@ -104,2 +112,3 @@ return Math.max(0, offset)

* @param {Frame} frame - the {@link Frame} to be rendered
* @return {void}
* @public

@@ -118,2 +127,3 @@ */

*
* @return {void}
* @protected

@@ -130,2 +140,3 @@ */

*
* @return {void}
* @protected

@@ -136,4 +147,5 @@ */

}
}
export default Renderer

@@ -57,4 +57,5 @@ /*

}
}
export default BrowserElementService

@@ -62,3 +62,3 @@ /*

* @param {*} element - the element to be checked
* @return {Boolean} <code>true</code> if <code>element</code> is a canvas; otherwise <code>false</code>.
* @return {boolean} <code>true</code> if <code>element</code> is a canvas; otherwise <code>false</code>.
* @public

@@ -74,3 +74,3 @@ */

* @param {*} element - the element to be checked
* @return {Boolean} <code>true</code> if <code>element</code> is an image; otherwise <code>false</code>.
* @return {boolean} <code>true</code> if <code>element</code> is an image; otherwise <code>false</code>.
* @public

@@ -81,4 +81,5 @@ */

}
}
export default ElementService

@@ -67,4 +67,5 @@ /*

}
}
export default NodeElementService

@@ -32,3 +32,3 @@ /*

*
* @return {String} The service name.
* @return {string} The service name.
* @public

@@ -39,4 +39,5 @@ */

}
}
export default Service

@@ -39,3 +39,3 @@ /*

*
* @param {String} name - the name of the {@link Service} to be returned
* @param {string} name - the name of the {@link Service} to be returned
* @return {Service} The {@link Service} is being managed with <code>name</code>.

@@ -58,4 +58,5 @@ * @throws {Error} If no {@link Service} is being managed with <code>name</code>.

*
* @param {String} name - the name of the {@link Service} to be managed with <code>name</code>
* @param {string} name - the name of the {@link Service} to be managed with <code>name</code>
* @param {Service} service - the {@link Service} implementation to be managed
* @return {void}
* @throws {Error} If a {@link Service} is already being managed with the same <code>name</code>.

@@ -73,4 +74,5 @@ * @public

}
}
export default ServiceManager

@@ -28,2 +28,18 @@ /*

/**
* Returns the absolute value of a given number.
*
* This method is simply a convenient shorthand for <code>Math.abs</code> while ensuring that nulls are returned as
* <code>null</code> instead of zero.
*
* @param {number} value - the number whose absolute value is to be returned
* @return {number} The absolute value of <code>value</code> or <code>null</code> if <code>value</code> is
* <code>null</code>.
* @public
* @static
*/
static abs(value) {
return value != null ? Math.abs(value) : null
}
/**
* Copies all properties from the <code>source</code> object to the <code>target</code> object, however, all property

@@ -39,4 +55,4 @@ * names on the <code>target</code> will be prefixed with an underscore, used to indicate that they are private.

static privatize(target, source) {
for (let key in source) {
if (source.hasOwnProperty(key)) {
for (const key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[`_${key}`] = source[key]

@@ -58,7 +74,7 @@ }

* @param {Object} object - the object whose field is to be set with <code>value</code>
* @param {String} fieldName - the field to be set with <code>value</code>
* @param {string} fieldName - the field to be set with <code>value</code>
* @param {*} value - the value to be set on the named field
* @param {*} [defaultValue] - the value to be used if <code>value</code> is <code>null</code>
* @param {Function} [transformer] - a function used to transform the value before it is assigned to the named field
* @return {Boolean} <code>true</code> if the value of the field has changed as a result of the assignment; otherwise
* @return {boolean} <code>true</code> if the value of the field has changed as a result of the assignment; otherwise
* <code>false</code>.

@@ -83,4 +99,5 @@ * @public

*
* @param {String} className - the name of the class on which the method has not been implemented
* @param {String} methodName - the name of the method which has not been implemented
* @param {string} className - the name of the class on which the method has not been implemented
* @param {string} methodName - the name of the method which has not been implemented
* @return {void}
* @throws {Error} The error describing the class method which has not been implemented.

@@ -97,4 +114,4 @@ * @public

*
* @param {String} string - the string to be transformed to upper case
* @return {String} <code>string</code> transformed to upper case if <code>string</code> is not <code>null</code>.
* @param {string} string - the string to be transformed to upper case
* @return {string} <code>string</code> transformed to upper case if <code>string</code> is not <code>null</code>.
* @public

@@ -106,4 +123,5 @@ * @static

}
}
export default Utilities

@@ -30,3 +30,3 @@ /*

*
* @return {Number[]} The version pattern block.
* @return {number[]} The version pattern block.
* @public

@@ -42,4 +42,5 @@ * @static

}
}
export default Version

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc