Socket
Socket
Sign inDemoInstall

qrcode

Package Overview
Dependencies
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qrcode - npm Package Compare versions

Comparing version 0.7.0 to 0.7.1

README.md

2

build/qrcode.min.js

@@ -1,2 +0,2 @@

!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.qrcodelib=t()}}(function(){return function t(e,r,n){function o(a,s){if(!r[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var c=r[a]={exports:{}};e[a][0].call(c.exports,function(t){var r=e[a][1][t];return o(r?r:t)},c,c.exports,t,e,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(t,e,r){var n=t("./utils").getSymbolSize;r.getRowColCoords=function(t){if(1===t)return[];for(var e=Math.floor(t/7)+2,r=n(t),o=145===r?26:2*Math.ceil((r-13)/(2*e-2)),i=[r-7],a=1;a<e-1;a++)i[a]=i[a-1]-o;return i.push(6),i.reverse()},r.getPositions=function(t){for(var e=[],n=r.getRowColCoords(t),o=n.length,i=0;i<o;i++)for(var a=0;a<o;a++)0===i&&0===a||0===i&&a===o-1||i===o-1&&0===a||e.push([n[i],n[a]]);return e}},{"./utils":20}],2:[function(t,e,r){function n(t){this.mode=o.ALPHANUMERIC,this.data=t}var o=t("./mode"),i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];n.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){var e;for(e=0;e+2<=this.data.length;e+=2){var r=45*i.indexOf(this.data[e]);r+=i.indexOf(this.data[e+1]),t.put(r,11)}this.data.length%2&&t.put(i.indexOf(this.data[e]),6)},e.exports=n},{"./mode":13}],3:[function(t,e,r){function n(){this.buffer=[],this.length=0}n.prototype={get:function(t){var e=Math.floor(t/8);return 1===(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(var r=0;r<e;r++)this.putBit(1===(t>>>e-r-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++}},e.exports=n},{}],4:[function(t,e,r){function n(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new o(t*t),this.data.fill(0),this.reservedBit=new o(t*t),this.reservedBit.fill(0)}var o=t("../utils/buffer");n.prototype.set=function(t,e,r,n){var o=t*this.size+e;this.data[o]=r,n&&(this.reservedBit[o]=!0)},n.prototype.get=function(t,e){return this.data[t*this.size+e]},n.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},n.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},e.exports=n},{"../utils/buffer":25}],5:[function(t,e,r){function n(t){this.mode=i.BYTE,this.data=new o(t)}var o=t("../utils/buffer"),i=t("./mode");n.getBitsLength=function(t){return 8*t},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){for(var e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)},e.exports=n},{"../utils/buffer":25,"./mode":13}],6:[function(t,e,r){var n=t("./error-correction-level"),o=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];r.getBlocksCount=function(t,e){switch(e){case n.L:return o[4*(t-1)+0];case n.M:return o[4*(t-1)+1];case n.Q:return o[4*(t-1)+2];case n.H:return o[4*(t-1)+3];default:return}},r.getTotalCodewordsCount=function(t,e){switch(e){case n.L:return i[4*(t-1)+0];case n.M:return i[4*(t-1)+1];case n.Q:return i[4*(t-1)+2];case n.H:return i[4*(t-1)+3];default:return}}},{"./error-correction-level":7}],7:[function(t,e,r){function n(t){if("string"!=typeof t)throw new Error("Param is not a string");var e=t.toLowerCase();switch(e){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+t)}}r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2},r.isValid=function(t){return t&&"undefined"!=typeof t.bit&&t.bit>=0&&t.bit<4},r.from=function(t,e){if(r.isValid(t))return t;try{return n(t)}catch(t){return e}}},{}],8:[function(t,e,r){var n=t("./utils").getSymbolSize,o=7;r.getPositions=function(t){var e=n(t);return[[0,0],[e-o,0],[0,e-o]]}},{"./utils":20}],9:[function(t,e,r){var n=t("./utils"),o=1335,i=21522,a=n.getBCHDigit(o);r.getEncodedBits=function(t,e){for(var r=t.bit<<3|e,s=r<<10;n.getBCHDigit(s)-a>=0;)s^=o<<n.getBCHDigit(s)-a;return(r<<10|s)^i}},{"./utils":20}],10:[function(t,e,r){var n=t("../utils/buffer"),o=new n(512),i=new n(256);!function(){for(var t=1,e=0;e<255;e++)o[e]=t,i[t]=e,t<<=1,256&t&&(t^=285);for(e=255;e<512;e++)o[e]=o[e-255]}(),r.log=function(t){if(t<1)throw new Error("log("+t+")");return i[t]},r.exp=function(t){return o[t]},r.mul=function(t,e){return 0===t||0===e?0:o[i[t]+i[e]]}},{"../utils/buffer":25}],11:[function(t,e,r){function n(t){this.mode=o.KANJI,this.data=t}var o=t("./mode"),i=t("./utils");n.getBitsLength=function(t){return 13*t},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){var e;for(e=0;e<this.data.length;e++){var r=i.toSJIS(this.data[e]);if(r>=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),t.put(r,13)}},e.exports=n},{"./mode":13,"./utils":20}],12:[function(t,e,r){function n(t){for(var e=t.size,r=0,n=0;n<e;n++)for(var o=0;o<e;o++){for(var i=0,a=t.get(n,o),s=-1;s<=1;s++)if(!(n+s<0||e<=n+s))for(var f=-1;f<=1;f++)o+f<0||e<=o+f||0===s&&0===f||a===t.get(n+s,o+f)&&i++;i>5&&(r+=u.N1+i-5)}return r}function o(t){for(var e=t.size,r=0,n=0;n<e-1;n++)for(var o=0;o<e-1;o++){var i=0;t.get(n,o)&&i++,t.get(n+1,o)&&i++,t.get(n,o+1)&&i++,t.get(n+1,o+1)&&i++,0!==i&&4!==i||(r+=u.N2)}return r}function i(t){var e,r,n=t.size,o=0;for(e=0;e<n;e++)for(r=0;r<n-6;r++)t.get(e,r)&&!t.get(e,r+1)&&t.get(e,r+2)&&t.get(e,r+3)&&t.get(e,r+4)&&!t.get(e,r+5)&&t.get(e,r+6)&&(o+=u.N3);for(r=0;r<n;r++)for(e=0;e<n-6;e++)t.get(e,r)&&!t.get(e+1,r)&&t.get(e+2,r)&&t.get(e+3,r)&&t.get(e+4,r)&&!t.get(e+5,r)&&t.get(e+6,r)&&(o+=u.N3);return o}function a(t){for(var e=0,r=t.size,n=0;n<r;n++)for(var o=0;o<r;o++)t.get(o,n)&&e++;var i=Math.abs(100*e/r/r-50)/5;return i*u.N4}function s(t,e,n){switch(t){case r.Patterns.PATTERN000:return(e+n)%2===0;case r.Patterns.PATTERN001:return e%2===0;case r.Patterns.PATTERN010:return n%3===0;case r.Patterns.PATTERN011:return(e+n)%3===0;case r.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(n/3))%2===0;case r.Patterns.PATTERN101:return e*n%2+e*n%3===0;case r.Patterns.PATTERN110:return(e*n%2+e*n%3)%2===0;case r.Patterns.PATTERN111:return(e*n%3+(e+n)%2)%2===0;default:throw new Error("bad maskPattern:"+t)}}r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var u={N1:3,N2:3,N3:40,N4:10};r.applyMask=function(t,e){for(var r=e.size,n=0;n<r;n++)for(var o=0;o<r;o++)e.isReserved(o,n)||e.xor(o,n,s(t,o,n))},r.getBestMask=function(t){for(var e=Object.keys(r.Patterns).length,s=0,u=1/0,f=0;f<e;f++){r.applyMask(f,t);var c=n(t)+o(t)+i(t)+a(t);r.applyMask(f,t),c<u&&(u=c,s=f)}return s}},{}],13:[function(t,e,r){function n(t){if("string"!=typeof t)throw new Error("Param is not a string");var e=t.toLowerCase();switch(e){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+t)}}var o=t("./version"),i=t("./regex");r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(t,e){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!o.isValid(e))throw new Error("Invalid version: "+e);return e>=1&&e<10?t.ccBits[0]:e<27?t.ccBits[1]:t.ccBits[2]},r.getBestModeForData=function(t){return i.testNumeric(t)?r.NUMERIC:i.testAlphanumeric(t)?r.ALPHANUMERIC:i.testKanji(t)?r.KANJI:r.BYTE},r.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},r.isValid=function(t){return t&&t.bit&&t.ccBits},r.from=function(t,e){if(r.isValid(t))return t;try{return n(t)}catch(t){return e}}},{"./regex":18,"./version":21}],14:[function(t,e,r){function n(t){this.mode=o.NUMERIC,this.data=t.toString()}var o=t("./mode");n.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){var e,r,n;for(e=0;e+3<=this.data.length;e+=3)r=this.data.substr(e,3),n=parseInt(r,10),t.put(n,10);var o=this.data.length-e;o>0&&(r=this.data.substr(e),n=parseInt(r,10),t.put(n,3*o+1))},e.exports=n},{"./mode":13}],15:[function(t,e,r){var n=t("../utils/buffer"),o=t("./galois-field");r.mul=function(t,e){var r=new n(t.length+e.length-1);r.fill(0);for(var i=0;i<t.length;i++)for(var a=0;a<e.length;a++)r[i+a]^=o.mul(t[i],e[a]);return r},r.mod=function(t,e){for(var r=new n(t);r.length-e.length>=0;){for(var i=r[0],a=0;a<e.length;a++)r[a]^=o.mul(e[a],i);for(var s=0;s<r.length&&0===r[s];)s++;r=r.slice(s)}return r},r.generateECPolynomial=function(t){for(var e=new n([1]),i=0;i<t;i++)e=r.mul(e,[1,o.exp(i)]);return e}},{"../utils/buffer":25,"./galois-field":10}],16:[function(t,e,r){function n(t,e){for(var r=t.size,n=m.getPositions(e),o=0;o<n.length;o++)for(var i=n[o][0],a=n[o][1],s=-1;s<=7;s++)if(!(i+s<=-1||r<=i+s))for(var u=-1;u<=7;u++)a+u<=-1||r<=a+u||(s>=0&&s<=6&&(0===u||6===u)||u>=0&&u<=6&&(0===s||6===s)||s>=2&&s<=4&&u>=2&&u<=4?t.set(i+s,a+u,!0,!0):t.set(i+s,a+u,!1,!0))}function o(t){for(var e=t.size,r=8;r<e-8;r++){var n=r%2===0;t.set(r,6,n,!0),t.set(6,r,n,!0)}}function i(t,e){for(var r=w.getPositions(e),n=0;n<r.length;n++)for(var o=r[n][0],i=r[n][1],a=-2;a<=2;a++)for(var s=-2;s<=2;s++)a===-2||2===a||s===-2||2===s||0===a&&0===s?t.set(o+a,i+s,!0,!0):t.set(o+a,i+s,!1,!0)}function a(t,e,r){for(var n,o,i,a=t.size,s=A.getEncodedBits(e),u=0;u<18;u++)n=Math.floor(u/3),o=u%3+a-8-3,i=!r&&1===(s>>u&1),t.set(n,o,i,!0),t.set(o,n,i,!0)}function s(t,e,r,n){var o,i,a=t.size,s=C.getEncodedBits(e,r);for(o=0;o<15;o++)i=!n&&1===(s>>o&1),o<6?t.set(o,8,i,!0):o<8?t.set(o+1,8,i,!0):t.set(a-15+o,8,i,!0),o<8?t.set(8,a-o-1,i,!0):o<9?t.set(8,15-o-1+1,i,!0):t.set(8,15-o-1,i,!0);t.set(a-8,8,!n,!0)}function u(t,e){for(var r=t.size,n=-1,o=r-1,i=7,a=0,s=r-1;s>0;s-=2)for(6===s&&s--;;){for(var u=0;u<2;u++)if(!t.isReserved(o,s-u)){var f=!1;a<e.length&&(f=1===(e[a]>>>i&1)),t.set(o,s-u,f),i--,i===-1&&(a++,i=7)}if(o+=n,o<0||r<=o){o-=n,n=-n;break}}}function f(t,e,r){var n=new v;r.forEach(function(e){n.put(e.mode.bit,4),n.put(e.getLength(),M.getCharCountIndicator(e.mode,t)),e.write(n)});var o=g.getSymbolTotalCodewords(t),i=b.getTotalCodewordsCount(t,e),a=8*(o-i);for(n.getLengthInBits()+4<=a&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);for(var s=(a-n.getLengthInBits())/8,u=0;u<s;u++)n.put(u%2?17:236,8);return c(n,t,e)}function c(t,e,r){for(var n=g.getSymbolTotalCodewords(e),o=b.getTotalCodewordsCount(e,r),i=n-o,a=b.getBlocksCount(e,r),s=n%a,u=a-s,f=Math.floor(n/a),c=Math.floor(i/a),h=c+1,l=f-c,p=new B(l),v=0,y=new Array(a),w=new Array(a),m=0,E=new d(t.buffer),A=0;A<a;A++){var C=A<u?c:h;y[A]=E.slice(v,v+C),w[A]=p.encode(y[A]),v+=C,m=Math.max(m,C)}var M,R,T=new d(n),N=0;for(M=0;M<m;M++)for(R=0;R<a;R++)M<y[R].length&&(T[N++]=y[R][M]);for(M=0;M<l;M++)for(R=0;R<a;R++)M<w[R].length&&(T[N++]=w[R][M]);return T}function h(t,e,r){var c;if(T(t))c=R.fromArray(t);else{if("string"!=typeof t)throw new Error("Invalid data");var h=e;if(!h){var l=R.rawSplit(t);h=A.getBestVersionForData(l,r)}c=R.fromString(t,h)}var d=A.getBestVersionForData(c,r);if(!d)throw new Error("The amount of data is too big to be stored in a QR Code");if(e){if(e<d)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+d+".\n")}else e=d;var p=f(e,r,c),v=g.getSymbolSize(e),w=new y(v);n(w,e),o(w),i(w,e),s(w,r,0,!0),e>=7&&a(w,e,!0),u(w,p);var m=E.getBestMask(w);return E.applyMask(m,w),s(w,r,m),e>=7&&a(w,e),{data:w,version:e,errorCorrectionLevel:r,maskPattern:m}}function l(t,e){if("undefined"==typeof t||""===t)throw new Error("No input text");this.errorCorrectionLevel=p.M,this.version=void 0,"undefined"!=typeof e&&(this.errorCorrectionLevel=p.from(e.errorCorrectionLevel,p.M),this.version=A.from(e.version),e.toSJISFunc&&g.setToSJISFunction(e.toSJISFunc));var r=h(t,this.version,this.errorCorrectionLevel);this.version=r.version,this.modules=r.data}var d=t("../utils/buffer"),g=t("./utils"),p=t("./error-correction-level"),v=t("./bit-buffer"),y=t("./bit-matrix"),w=t("./alignment-pattern"),m=t("./finder-pattern"),E=t("./mask-pattern"),b=t("./error-correction-code"),B=t("./reed-solomon-encoder"),A=t("./version"),C=t("./format-info"),M=t("./mode"),R=t("./segments"),T=t("../utils/is-array");e.exports=l,l.prototype.isDark=function(t,e){var r=this.modules.size;if(t<0||r<=t||e<0||r<=e)throw new Error(t+","+e);return this.modules.get(t,e)},l.prototype.getModuleCount=function(){return this.modules.size}},{"../utils/buffer":25,"../utils/is-array":24,"./alignment-pattern":1,"./bit-buffer":3,"./bit-matrix":4,"./error-correction-code":6,"./error-correction-level":7,"./finder-pattern":8,"./format-info":9,"./mask-pattern":12,"./mode":13,"./reed-solomon-encoder":17,"./segments":19,"./utils":20,"./version":21}],17:[function(t,e,r){function n(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}var o=t("../utils/buffer"),i=t("./polynomial");n.prototype.initialize=function(t){this.degree=t,this.genPoly=i.generateECPolynomial(this.degree)},n.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");var e=new o(this.degree);e.fill(0);var r=o.concat([t,e],t.length+this.degree),n=i.mod(r,this.genPoly),a=this.degree-n.length;if(a>0){var s=new o(this.degree);return s.fill(0),n.copy(s,a),s}return n},e.exports=n},{"../utils/buffer":25,"./polynomial":15}],18:[function(t,e,r){var n="[0-9]+",o="[A-Z $%*+-./:]+",i="(?:[ -〿]|[぀-ゟ]|[゠-ヿ]|[＀-￯]|[一-龯]|[★-☆]|[←-↕]|※|[―‐∥…‥‘’“”≠]|[Α-ё]|[§¨±´×÷])+",a="(?:(?![A-Z0-9 $%*+-./:]|"+i+").)+";r.KANJI=new RegExp(i,"g"),r.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+-./:]+","g"),r.BYTE=new RegExp(a,"g"),r.NUMERIC=new RegExp(n,"g"),r.ALPHANUMERIC=new RegExp(o,"g");var s=new RegExp("^"+i+"$"),u=new RegExp("^"+n+"$"),f=new RegExp("^[A-Z0-9 $%*+-./:]+$");r.testKanji=function(t){return s.test(t)},r.testNumeric=function(t){return u.test(t)},r.testAlphanumeric=function(t){return f.test(t)}},{}],19:[function(t,e,r){function n(t){return unescape(encodeURIComponent(t)).length}function o(t,e,r){for(var n,o=[];null!==(n=t.exec(r));)o.push({data:n[0],index:n.index,mode:e,length:n[0].length});return o}function i(t){var e,r,n=o(v.NUMERIC,h.NUMERIC,t),i=o(v.ALPHANUMERIC,h.ALPHANUMERIC,t);y.isKanjiModeEnabled()?(e=o(v.BYTE,h.BYTE,t),r=o(v.KANJI,h.KANJI,t)):(e=o(v.BYTE_KANJI,h.BYTE,t),r=[]);var a=n.concat(i,e,r);return a.sort(function(t,e){return t.index-e.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function a(t,e){switch(e){case h.NUMERIC:return l.getBitsLength(t);case h.ALPHANUMERIC:return d.getBitsLength(t);case h.KANJI:return p.getBitsLength(t);case h.BYTE:return g.getBitsLength(t)}}function s(t){return t.reduce(function(t,e){var r=t.length-1>=0?t[t.length-1]:null;return r&&r.mode===e.mode?(t[t.length-1].data+=e.data,t):(t.push(e),t)},[])}function u(t){for(var e=[],r=0;r<t.length;r++){var o=t[r];switch(o.mode){case h.NUMERIC:e.push([o,{data:o.data,mode:h.ALPHANUMERIC,length:o.length},{data:o.data,mode:h.BYTE,length:o.length}]);break;case h.ALPHANUMERIC:e.push([o,{data:o.data,mode:h.BYTE,length:o.length}]);break;case h.KANJI:e.push([o,{data:o.data,mode:h.BYTE,length:n(o.data)}]);break;case h.BYTE:e.push([{data:o.data,mode:h.BYTE,length:n(o.data)}])}}return e}function f(t,e){for(var r={},n={start:{}},o=["start"],i=0;i<t.length;i++){for(var s=t[i],u=[],f=0;f<s.length;f++){var c=s[f],l=""+i+f;u.push(l),r[l]={node:c,lastCount:0},n[l]={};for(var d=0;d<o.length;d++){var g=o[d];r[g]&&r[g].node.mode===c.mode?(n[g][l]=a(r[g].lastCount+c.length,c.mode)-a(r[g].lastCount,c.mode),r[g].lastCount+=c.length):(r[g]&&(r[g].lastCount=c.length),n[g][l]=a(c.length,c.mode)+4+h.getCharCountIndicator(c.mode,e))}}o=u}for(d=0;d<o.length;d++)n[o[d]].end=0;return{map:n,table:r}}function c(t,e){var r,n=h.getBestModeForData(t);if(r=h.from(e,n),r!==h.BYTE&&r.bit<n.bit)throw new Error('"'+t+'" cannot be encoded with mode '+h.toString(r)+".\n Suggested mode is: "+h.toString(n));switch(r!==h.KANJI||y.isKanjiModeEnabled()||(r=h.BYTE),r){case h.NUMERIC:return new l(t);case h.ALPHANUMERIC:return new d(t);case h.KANJI:return new p(t);case h.BYTE:return new g(t)}}var h=t("./mode"),l=t("./numeric-data"),d=t("./alphanumeric-data"),g=t("./byte-data"),p=t("./kanji-data"),v=t("./regex"),y=t("./utils"),w=t("dijkstrajs");r.fromArray=function(t){return t.reduce(function(t,e){return"string"==typeof e?t.push(c(e,null)):e.data&&t.push(c(e.data,e.mode)),t},[])},r.fromString=function(t,e){for(var n=i(t,y.isKanjiModeEnabled()),o=u(n),a=f(o,e),c=w.find_path(a.map,"start","end"),h=[],l=1;l<c.length-1;l++)h.push(a.table[c[l]].node);return r.fromArray(s(h))},r.rawSplit=function(t){return r.fromArray(i(t,y.isKanjiModeEnabled()))}},{"./alphanumeric-data":2,"./byte-data":5,"./kanji-data":11,"./mode":13,"./numeric-data":14,"./regex":18,"./utils":20,dijkstrajs:26}],20:[function(t,e,r){var n,o=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];r.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},r.getSymbolTotalCodewords=function(t){return o[t]},r.getBCHDigit=function(t){for(var e=0;0!==t;)e++,t>>>=1;return e},r.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');n=t},r.isKanjiModeEnabled=function(){return"undefined"!=typeof n},r.toSJIS=function(t){return n(t)}},{}],21:[function(t,e,r){function n(t,e,n){for(var o=1;o<=40;o++)if(e<=r.getCapacity(o,n,t))return o}function o(t,e){return c.getCharCountIndicator(t,e)+4}function i(t,e){var r=0;return t.forEach(function(t){var n=o(t.mode,e);r+=n+t.getBitsLength()}),r}function a(t,e){for(var n=1;n<=40;n++){var o=i(t,n);if(o<=r.getCapacity(n,e,c.MIXED))return n}}var s=t("./utils"),u=t("./error-correction-code"),f=t("./error-correction-level"),c=t("./mode"),h=t("../utils/is-array"),l=7973,d=s.getBCHDigit(l);r.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40},r.from=function(t,e){return r.isValid(t)?parseInt(t,10):e},r.getCapacity=function(t,e,n){if(!r.isValid(t))throw new Error("Invalid QR Code version");"undefined"==typeof n&&(n=c.BYTE);var i=s.getSymbolTotalCodewords(t),a=u.getTotalCodewordsCount(t,e),f=8*(i-a);if(n===c.MIXED)return f;var h=f-o(n,t);switch(n){case c.NUMERIC:return Math.floor(h/10*3);case c.ALPHANUMERIC:return Math.floor(h/11*2);case c.KANJI:return Math.floor(h/13);case c.BYTE:default:return Math.floor(h/8)}},r.getBestVersionForData=function(t,e){var r,o=f.from(e,f.M);if(h(t)){if(t.length>1)return a(t,o);if(0===t.length)return 1;r=t[0]}else r=t;return n(r.mode,r.getLength(),o)},r.getEncodedBits=function(t){if(!r.isValid(t)||t<7)throw new Error("Invalid QR Code version");for(var e=t<<12;s.getBCHDigit(e)-d>=0;)e^=l<<s.getBCHDigit(e)-d;return t<<12|e}},{"../utils/is-array":24,"./error-correction-code":6,"./error-correction-level":7,"./mode":13,"./utils":20}],22:[function(t,e,r){var n=t("./renderer/qrcode-draw.js");n.qrcodedraw=n.QRCodeDraw,e.exports=n},{"./renderer/qrcode-draw.js":23}],23:[function(t,e,r){function n(){}var o=t("../core/qrcode"),i=t("../core/error-correction-level");r.QRCodeDraw=n,r.QRErrorCorrectLevel=i,r.QRCode=o,n.prototype={scale:4,defaultMargin:20,marginScaleFactor:5,color:{dark:"black",light:"white"},QRErrorCorrectLevel:i,draw:function(t,e,r,n){var i,a=Array.prototype.slice.call(arguments);if(n=a.pop(),t=a.shift(),e=a.shift(),r=a.shift()||{},"function"!=typeof n)throw new Error("callback required");"object"!=typeof r&&(r.errorCorrectionLevel=r),this.scale=r.scale||this.scale,this.margin="undefined"==typeof r.margin?this.defaultMargin:r.margin;try{var s=new o(e,r),u=this.scale||4,f=t.getContext("2d"),c=0,h=this.marginWidth(),l=h;c=this.dataWidth(s)+2*h,this.resetCanvas(t,f,c);for(var d=0,g=s.getModuleCount();d<g;d++){for(var p=h,v=0,y=s.getModuleCount();v<y;v++)s.isDark(d,v)?(f.fillStyle=this.color.dark,f.fillRect(p,l,u,u)):this.color.light&&(f.fillStyle=this.color.light,f.fillRect(p,l,u,u)),p+=u;l+=u}}catch(t){i=t}n(i,t,c)},drawBitArray:function(){var t,e=Array.prototype.slice.call(arguments),r=e.pop(),n=e.shift(),i=e.shift()||{};if("function"!=typeof r)throw new Error("callback required as last argument");try{var a,s=new o(n,i),u=0,f=0;u=this.dataWidth(s,1),a=new Array(u*u);for(var c=0,h=s.getModuleCount();c<h;c++)for(var l=0,d=s.getModuleCount();l<d;l++)s.isDark(c,l)?a[f]=1:a[f]=0,f++}catch(e){t=e,console.log(e.stack)}r(t,a,u)},marginWidth:function(){var t=this.margin;return this.scale=this.scale||4,this.scale*this.marginScaleFactor>t&&t>0&&(t=this.scale*this.marginScaleFactor),t},dataWidth:function(t,e){return t.getModuleCount()*(e||this.scale||4)},resetCanvas:function(t,e,r){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.style.height=t.height=r,t.style.width=t.width=r,this.color.light?(e.fillStyle=this.color.light,e.fillRect(0,0,t.width,t.height)):e.clearRect(0,0,t.width,t.height)}}},{"../core/error-correction-level":7,"../core/qrcode":16}],24:[function(t,e,r){e.exports=Array.isArray||function(t){return"[object Array]"==={}.toString.call(t)}},{}],25:[function(t,e,r){"use strict";function n(t,e,r){return"number"==typeof t?s(t):v(t,e,r)}function o(t){if(t>=w)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+w.toString(16)+" bytes");return 0|t}function i(t){return t!==t}function a(t){var e=new Uint8Array(t);return e.__proto__=n.prototype,e}function s(t){return a(t<0?0:0|o(t))}function u(t){var e=0|d(t),r=a(e),n=r.write(t);return n!==e&&(r=r.slice(0,n)),r}function f(t){for(var e=t.length<0?0:0|o(t.length),r=a(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function c(t,e,r){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(r||0))throw new RangeError("'length' is out of bounds");var o;return o=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),o.__proto__=n.prototype,o}function h(t){if(n.isBuffer(t)){var e=0|o(t.length),r=a(e);return 0===r.length?r:(t.copy(r,0,0,e),r)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||i(t.length)?a(0):f(t);if("Buffer"===t.type&&Array.isArray(t.data))return f(t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function l(t,e){e=e||1/0;for(var r,n=t.length,o=null,i=[],a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function d(t){if(n.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;return 0===e?0:l(t).length}function g(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function p(t,e,r,n){return g(l(e,t.length-r),t,r,n)}function v(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?c(t,e,r):"string"==typeof t?u(t,e):h(t)}var y=t("./is-array"),w=2147483647;n.prototype.__proto__=Uint8Array.prototype,n.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&n[Symbol.species]===n&&Object.defineProperty(n,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),n.prototype.write=function(t,e,r){void 0===e?(r=this.length,e=0):void 0===r&&"string"==typeof e?(r=this.length,e=0):isFinite(e)&&(e|=0,isFinite(r)?r|=0:r=void 0);var n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");return p(this,t,e,r)},n.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e<t&&(e=t);var o=this.subarray(t,e);return o.__proto__=n.prototype,o},n.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},n.prototype.fill=function(t,e,r){if("string"==typeof t){if("string"==typeof e?(e=0,r=this.length):"string"==typeof r&&(r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var i;if("number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var a=n.isBuffer(t)?t:new n(t),s=a.length;for(i=0;i<r-e;++i)this[i+e]=a[i%s]}return this},n.concat=function(t,e){if(!y(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a(null,0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var o=s(e),i=0;for(r=0;r<t.length;++r){var u=t[r];if(!n.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(o,i),i+=u.length}return o},n.byteLength=d,n.prototype._isBuffer=!0,n.isBuffer=function(t){return!(null==t||!t._isBuffer)},e.exports=n},{"./is-array":24}],26:[function(t,e,r){"use strict";var n={single_source_shortest_paths:function(t,e,r){var o={},i={};i[e]=0;var a=n.PriorityQueue.make();a.push(e,0);for(var s,u,f,c,h,l,d,g,p;!a.empty();){s=a.pop(),u=s.value,c=s.cost,h=t[u]||{};for(f in h)h.hasOwnProperty(f)&&(l=h[f],d=c+l,g=i[f],p="undefined"==typeof i[f],(p||g>d)&&(i[f]=d,a.push(f,d),o[f]=u))}if("undefined"!=typeof r&&"undefined"==typeof i[r]){var v=["Could not find a path from ",e," to ",r,"."].join("");throw new Error(v)}return o},extract_shortest_path_from_predecessor_list:function(t,e){for(var r,n=[],o=e;o;)n.push(o),r=t[o],o=t[o];return n.reverse(),n},find_path:function(t,e,r){var o=n.single_source_shortest_paths(t,e,r);return n.extract_shortest_path_from_predecessor_list(o,r)},PriorityQueue:{make:function(t){var e,r=n.PriorityQueue,o={};t=t||{};for(e in r)r.hasOwnProperty(e)&&(o[e]=r[e]);return o.queue=[],o.sorter=t.sorter||r.default_sorter,o},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var r={value:t,cost:e};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};"undefined"!=typeof e&&(e.exports=n)},{}]},{},[22])(22)});
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.qrcodelib=t()}}(function(){return function t(e,r,n){function o(a,s){if(!r[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var c=r[a]={exports:{}};e[a][0].call(c.exports,function(t){var r=e[a][1][t];return o(r?r:t)},c,c.exports,t,e,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(t,e,r){var n=t("./utils").getSymbolSize;r.getRowColCoords=function(t){if(1===t)return[];for(var e=Math.floor(t/7)+2,r=n(t),o=145===r?26:2*Math.ceil((r-13)/(2*e-2)),i=[r-7],a=1;a<e-1;a++)i[a]=i[a-1]-o;return i.push(6),i.reverse()},r.getPositions=function(t){for(var e=[],n=r.getRowColCoords(t),o=n.length,i=0;i<o;i++)for(var a=0;a<o;a++)0===i&&0===a||0===i&&a===o-1||i===o-1&&0===a||e.push([n[i],n[a]]);return e}},{"./utils":20}],2:[function(t,e,r){function n(t){this.mode=o.ALPHANUMERIC,this.data=t}var o=t("./mode"),i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];n.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){var e;for(e=0;e+2<=this.data.length;e+=2){var r=45*i.indexOf(this.data[e]);r+=i.indexOf(this.data[e+1]),t.put(r,11)}this.data.length%2&&t.put(i.indexOf(this.data[e]),6)},e.exports=n},{"./mode":13}],3:[function(t,e,r){function n(){this.buffer=[],this.length=0}n.prototype={get:function(t){var e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(var r=0;r<e;r++)this.putBit(1==(t>>>e-r-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++}},e.exports=n},{}],4:[function(t,e,r){function n(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new o(t*t),this.data.fill(0),this.reservedBit=new o(t*t),this.reservedBit.fill(0)}var o=t("../utils/buffer");n.prototype.set=function(t,e,r,n){var o=t*this.size+e;this.data[o]=r,n&&(this.reservedBit[o]=!0)},n.prototype.get=function(t,e){return this.data[t*this.size+e]},n.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},n.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},e.exports=n},{"../utils/buffer":25}],5:[function(t,e,r){function n(t){this.mode=i.BYTE,this.data=new o(t)}var o=t("../utils/buffer"),i=t("./mode");n.getBitsLength=function(t){return 8*t},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){for(var e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)},e.exports=n},{"../utils/buffer":25,"./mode":13}],6:[function(t,e,r){var n=t("./error-correction-level"),o=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];r.getBlocksCount=function(t,e){switch(e){case n.L:return o[4*(t-1)+0];case n.M:return o[4*(t-1)+1];case n.Q:return o[4*(t-1)+2];case n.H:return o[4*(t-1)+3];default:return}},r.getTotalCodewordsCount=function(t,e){switch(e){case n.L:return i[4*(t-1)+0];case n.M:return i[4*(t-1)+1];case n.Q:return i[4*(t-1)+2];case n.H:return i[4*(t-1)+3];default:return}}},{"./error-correction-level":7}],7:[function(t,e,r){function n(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+t)}}r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2},r.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},r.from=function(t,e){if(r.isValid(t))return t;try{return n(t)}catch(t){return e}}},{}],8:[function(t,e,r){var n=t("./utils").getSymbolSize;r.getPositions=function(t){var e=n(t);return[[0,0],[e-7,0],[0,e-7]]}},{"./utils":20}],9:[function(t,e,r){var n=t("./utils"),o=n.getBCHDigit(1335);r.getEncodedBits=function(t,e){for(var r=t.bit<<3|e,i=r<<10;n.getBCHDigit(i)-o>=0;)i^=1335<<n.getBCHDigit(i)-o;return 21522^(r<<10|i)}},{"./utils":20}],10:[function(t,e,r){var n=t("../utils/buffer"),o=new n(512),i=new n(256);!function(){for(var t=1,e=0;e<255;e++)o[e]=t,i[t]=e,256&(t<<=1)&&(t^=285);for(e=255;e<512;e++)o[e]=o[e-255]}(),r.log=function(t){if(t<1)throw new Error("log("+t+")");return i[t]},r.exp=function(t){return o[t]},r.mul=function(t,e){return 0===t||0===e?0:o[i[t]+i[e]]}},{"../utils/buffer":25}],11:[function(t,e,r){function n(t){this.mode=o.KANJI,this.data=t}var o=t("./mode"),i=t("./utils");n.getBitsLength=function(t){return 13*t},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){var e;for(e=0;e<this.data.length;e++){var r=i.toSJIS(this.data[e]);if(r>=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),t.put(r,13)}},e.exports=n},{"./mode":13,"./utils":20}],12:[function(t,e,r){function n(t){for(var e=t.size,r=0,n=0;n<e;n++)for(var o=0;o<e;o++){for(var i=0,a=t.get(n,o),s=-1;s<=1;s++)if(!(n+s<0||e<=n+s))for(var f=-1;f<=1;f++)o+f<0||e<=o+f||0===s&&0===f||a===t.get(n+s,o+f)&&i++;i>5&&(r+=u.N1+i-5)}return r}function o(t){for(var e=t.size,r=0,n=0;n<e-1;n++)for(var o=0;o<e-1;o++){var i=0;t.get(n,o)&&i++,t.get(n+1,o)&&i++,t.get(n,o+1)&&i++,t.get(n+1,o+1)&&i++,0!==i&&4!==i||(r+=u.N2)}return r}function i(t){var e,r,n=t.size,o=0;for(e=0;e<n;e++)for(r=0;r<n-6;r++)t.get(e,r)&&!t.get(e,r+1)&&t.get(e,r+2)&&t.get(e,r+3)&&t.get(e,r+4)&&!t.get(e,r+5)&&t.get(e,r+6)&&(o+=u.N3);for(r=0;r<n;r++)for(e=0;e<n-6;e++)t.get(e,r)&&!t.get(e+1,r)&&t.get(e+2,r)&&t.get(e+3,r)&&t.get(e+4,r)&&!t.get(e+5,r)&&t.get(e+6,r)&&(o+=u.N3);return o}function a(t){for(var e=0,r=t.size,n=0;n<r;n++)for(var o=0;o<r;o++)t.get(o,n)&&e++;return Math.abs(100*e/r/r-50)/5*u.N4}function s(t,e,n){switch(t){case r.Patterns.PATTERN000:return(e+n)%2==0;case r.Patterns.PATTERN001:return e%2==0;case r.Patterns.PATTERN010:return n%3==0;case r.Patterns.PATTERN011:return(e+n)%3==0;case r.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(n/3))%2==0;case r.Patterns.PATTERN101:return e*n%2+e*n%3==0;case r.Patterns.PATTERN110:return(e*n%2+e*n%3)%2==0;case r.Patterns.PATTERN111:return(e*n%3+(e+n)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var u={N1:3,N2:3,N3:40,N4:10};r.applyMask=function(t,e){for(var r=e.size,n=0;n<r;n++)for(var o=0;o<r;o++)e.isReserved(o,n)||e.xor(o,n,s(t,o,n))},r.getBestMask=function(t){for(var e=Object.keys(r.Patterns).length,s=0,u=1/0,f=0;f<e;f++){r.applyMask(f,t);var c=n(t)+o(t)+i(t)+a(t);r.applyMask(f,t),c<u&&(u=c,s=f)}return s}},{}],13:[function(t,e,r){function n(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+t)}}var o=t("./version"),i=t("./regex");r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(t,e){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!o.isValid(e))throw new Error("Invalid version: "+e);return e>=1&&e<10?t.ccBits[0]:e<27?t.ccBits[1]:t.ccBits[2]},r.getBestModeForData=function(t){return i.testNumeric(t)?r.NUMERIC:i.testAlphanumeric(t)?r.ALPHANUMERIC:i.testKanji(t)?r.KANJI:r.BYTE},r.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},r.isValid=function(t){return t&&t.bit&&t.ccBits},r.from=function(t,e){if(r.isValid(t))return t;try{return n(t)}catch(t){return e}}},{"./regex":18,"./version":21}],14:[function(t,e,r){function n(t){this.mode=o.NUMERIC,this.data=t.toString()}var o=t("./mode");n.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){var e,r,n;for(e=0;e+3<=this.data.length;e+=3)r=this.data.substr(e,3),n=parseInt(r,10),t.put(n,10);var o=this.data.length-e;o>0&&(r=this.data.substr(e),n=parseInt(r,10),t.put(n,3*o+1))},e.exports=n},{"./mode":13}],15:[function(t,e,r){var n=t("../utils/buffer"),o=t("./galois-field");r.mul=function(t,e){var r=new n(t.length+e.length-1);r.fill(0);for(var i=0;i<t.length;i++)for(var a=0;a<e.length;a++)r[i+a]^=o.mul(t[i],e[a]);return r},r.mod=function(t,e){for(var r=new n(t);r.length-e.length>=0;){for(var i=r[0],a=0;a<e.length;a++)r[a]^=o.mul(e[a],i);for(var s=0;s<r.length&&0===r[s];)s++;r=r.slice(s)}return r},r.generateECPolynomial=function(t){for(var e=new n([1]),i=0;i<t;i++)e=r.mul(e,[1,o.exp(i)]);return e}},{"../utils/buffer":25,"./galois-field":10}],16:[function(t,e,r){function n(t,e){for(var r=t.size,n=m.getPositions(e),o=0;o<n.length;o++)for(var i=n[o][0],a=n[o][1],s=-1;s<=7;s++)if(!(i+s<=-1||r<=i+s))for(var u=-1;u<=7;u++)a+u<=-1||r<=a+u||(s>=0&&s<=6&&(0===u||6===u)||u>=0&&u<=6&&(0===s||6===s)||s>=2&&s<=4&&u>=2&&u<=4?t.set(i+s,a+u,!0,!0):t.set(i+s,a+u,!1,!0))}function o(t){for(var e=t.size,r=8;r<e-8;r++){var n=r%2==0;t.set(r,6,n,!0),t.set(6,r,n,!0)}}function i(t,e){for(var r=w.getPositions(e),n=0;n<r.length;n++)for(var o=r[n][0],i=r[n][1],a=-2;a<=2;a++)for(var s=-2;s<=2;s++)a===-2||2===a||s===-2||2===s||0===a&&0===s?t.set(o+a,i+s,!0,!0):t.set(o+a,i+s,!1,!0)}function a(t,e,r){for(var n,o,i,a=t.size,s=A.getEncodedBits(e),u=0;u<18;u++)n=Math.floor(u/3),o=u%3+a-8-3,i=!r&&1==(s>>u&1),t.set(n,o,i,!0),t.set(o,n,i,!0)}function s(t,e,r,n){var o,i,a=t.size,s=C.getEncodedBits(e,r);for(o=0;o<15;o++)i=!n&&1==(s>>o&1),o<6?t.set(o,8,i,!0):o<8?t.set(o+1,8,i,!0):t.set(a-15+o,8,i,!0),o<8?t.set(8,a-o-1,i,!0):o<9?t.set(8,15-o-1+1,i,!0):t.set(8,15-o-1,i,!0);t.set(a-8,8,!n,!0)}function u(t,e){for(var r=t.size,n=-1,o=r-1,i=7,a=0,s=r-1;s>0;s-=2)for(6===s&&s--;;){for(var u=0;u<2;u++)if(!t.isReserved(o,s-u)){var f=!1;a<e.length&&(f=1==(e[a]>>>i&1)),t.set(o,s-u,f),i--,i===-1&&(a++,i=7)}if((o+=n)<0||r<=o){o-=n,n=-n;break}}}function f(t,e,r){var n=new v;r.forEach(function(e){n.put(e.mode.bit,4),n.put(e.getLength(),M.getCharCountIndicator(e.mode,t)),e.write(n)});var o=g.getSymbolTotalCodewords(t),i=b.getTotalCodewordsCount(t,e),a=8*(o-i);for(n.getLengthInBits()+4<=a&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(0);for(var s=(a-n.getLengthInBits())/8,u=0;u<s;u++)n.put(u%2?17:236,8);return c(n,t,e)}function c(t,e,r){for(var n=g.getSymbolTotalCodewords(e),o=b.getTotalCodewordsCount(e,r),i=n-o,a=b.getBlocksCount(e,r),s=n%a,u=a-s,f=Math.floor(n/a),c=Math.floor(i/a),h=c+1,l=f-c,p=new B(l),v=0,y=new Array(a),w=new Array(a),m=0,E=new d(t.buffer),A=0;A<a;A++){var C=A<u?c:h;y[A]=E.slice(v,v+C),w[A]=p.encode(y[A]),v+=C,m=Math.max(m,C)}var M,R,T=new d(n),N=0;for(M=0;M<m;M++)for(R=0;R<a;R++)M<y[R].length&&(T[N++]=y[R][M]);for(M=0;M<l;M++)for(R=0;R<a;R++)M<w[R].length&&(T[N++]=w[R][M]);return T}function h(t,e,r){var c;if(T(t))c=R.fromArray(t);else{if("string"!=typeof t)throw new Error("Invalid data");var h=e;if(!h){var l=R.rawSplit(t);h=A.getBestVersionForData(l,r)}c=R.fromString(t,h)}var d=A.getBestVersionForData(c,r);if(!d)throw new Error("The amount of data is too big to be stored in a QR Code");if(e){if(e<d)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+d+".\n")}else e=d;var p=f(e,r,c),v=g.getSymbolSize(e),w=new y(v);n(w,e),o(w),i(w,e),s(w,r,0,!0),e>=7&&a(w,e,!0),u(w,p);var m=E.getBestMask(w);return E.applyMask(m,w),s(w,r,m),e>=7&&a(w,e),{data:w,version:e,errorCorrectionLevel:r,maskPattern:m}}function l(t,e){if(void 0===t||""===t)throw new Error("No input text");this.errorCorrectionLevel=p.M,this.version=void 0,void 0!==e&&(this.errorCorrectionLevel=p.from(e.errorCorrectionLevel,p.M),this.version=A.from(e.version),e.toSJISFunc&&g.setToSJISFunction(e.toSJISFunc));var r=h(t,this.version,this.errorCorrectionLevel);this.version=r.version,this.modules=r.data}var d=t("../utils/buffer"),g=t("./utils"),p=t("./error-correction-level"),v=t("./bit-buffer"),y=t("./bit-matrix"),w=t("./alignment-pattern"),m=t("./finder-pattern"),E=t("./mask-pattern"),b=t("./error-correction-code"),B=t("./reed-solomon-encoder"),A=t("./version"),C=t("./format-info"),M=t("./mode"),R=t("./segments"),T=t("../utils/is-array");e.exports=l,l.prototype.isDark=function(t,e){var r=this.modules.size;if(t<0||r<=t||e<0||r<=e)throw new Error(t+","+e);return this.modules.get(t,e)},l.prototype.getModuleCount=function(){return this.modules.size}},{"../utils/buffer":25,"../utils/is-array":24,"./alignment-pattern":1,"./bit-buffer":3,"./bit-matrix":4,"./error-correction-code":6,"./error-correction-level":7,"./finder-pattern":8,"./format-info":9,"./mask-pattern":12,"./mode":13,"./reed-solomon-encoder":17,"./segments":19,"./utils":20,"./version":21}],17:[function(t,e,r){function n(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}var o=t("../utils/buffer"),i=t("./polynomial");n.prototype.initialize=function(t){this.degree=t,this.genPoly=i.generateECPolynomial(this.degree)},n.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");var e=new o(this.degree);e.fill(0);var r=o.concat([t,e],t.length+this.degree),n=i.mod(r,this.genPoly),a=this.degree-n.length;if(a>0){var s=new o(this.degree);return s.fill(0),n.copy(s,a),s}return n},e.exports=n},{"../utils/buffer":25,"./polynomial":15}],18:[function(t,e,r){var n="(?:[ -〿]|[぀-ゟ]|[゠-ヿ]|[＀-￯]|[一-龯]|[★-☆]|[←-↕]|※|[―‐∥…‥‘’“”≠]|[Α-ё]|[§¨±´×÷])+";r.KANJI=new RegExp(n,"g"),r.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+-./:]+","g"),r.BYTE=new RegExp("(?:(?![A-Z0-9 $%*+-./:]|"+n+").)+","g"),r.NUMERIC=new RegExp("[0-9]+","g"),r.ALPHANUMERIC=new RegExp("[A-Z $%*+-./:]+","g");var o=new RegExp("^"+n+"$"),i=new RegExp("^[0-9]+$"),a=new RegExp("^[A-Z0-9 $%*+-./:]+$");r.testKanji=function(t){return o.test(t)},r.testNumeric=function(t){return i.test(t)},r.testAlphanumeric=function(t){return a.test(t)}},{}],19:[function(t,e,r){function n(t){return unescape(encodeURIComponent(t)).length}function o(t,e,r){for(var n,o=[];null!==(n=t.exec(r));)o.push({data:n[0],index:n.index,mode:e,length:n[0].length});return o}function i(t){var e,r,n=o(v.NUMERIC,h.NUMERIC,t),i=o(v.ALPHANUMERIC,h.ALPHANUMERIC,t);return y.isKanjiModeEnabled()?(e=o(v.BYTE,h.BYTE,t),r=o(v.KANJI,h.KANJI,t)):(e=o(v.BYTE_KANJI,h.BYTE,t),r=[]),n.concat(i,e,r).sort(function(t,e){return t.index-e.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function a(t,e){switch(e){case h.NUMERIC:return l.getBitsLength(t);case h.ALPHANUMERIC:return d.getBitsLength(t);case h.KANJI:return p.getBitsLength(t);case h.BYTE:return g.getBitsLength(t)}}function s(t){return t.reduce(function(t,e){var r=t.length-1>=0?t[t.length-1]:null;return r&&r.mode===e.mode?(t[t.length-1].data+=e.data,t):(t.push(e),t)},[])}function u(t){for(var e=[],r=0;r<t.length;r++){var o=t[r];switch(o.mode){case h.NUMERIC:e.push([o,{data:o.data,mode:h.ALPHANUMERIC,length:o.length},{data:o.data,mode:h.BYTE,length:o.length}]);break;case h.ALPHANUMERIC:e.push([o,{data:o.data,mode:h.BYTE,length:o.length}]);break;case h.KANJI:e.push([o,{data:o.data,mode:h.BYTE,length:n(o.data)}]);break;case h.BYTE:e.push([{data:o.data,mode:h.BYTE,length:n(o.data)}])}}return e}function f(t,e){for(var r={},n={start:{}},o=["start"],i=0;i<t.length;i++){for(var s=t[i],u=[],f=0;f<s.length;f++){var c=s[f],l=""+i+f;u.push(l),r[l]={node:c,lastCount:0},n[l]={};for(var d=0;d<o.length;d++){var g=o[d];r[g]&&r[g].node.mode===c.mode?(n[g][l]=a(r[g].lastCount+c.length,c.mode)-a(r[g].lastCount,c.mode),r[g].lastCount+=c.length):(r[g]&&(r[g].lastCount=c.length),n[g][l]=a(c.length,c.mode)+4+h.getCharCountIndicator(c.mode,e))}}o=u}for(d=0;d<o.length;d++)n[o[d]].end=0;return{map:n,table:r}}function c(t,e){var r,n=h.getBestModeForData(t);if((r=h.from(e,n))!==h.BYTE&&r.bit<n.bit)throw new Error('"'+t+'" cannot be encoded with mode '+h.toString(r)+".\n Suggested mode is: "+h.toString(n));switch(r!==h.KANJI||y.isKanjiModeEnabled()||(r=h.BYTE),r){case h.NUMERIC:return new l(t);case h.ALPHANUMERIC:return new d(t);case h.KANJI:return new p(t);case h.BYTE:return new g(t)}}var h=t("./mode"),l=t("./numeric-data"),d=t("./alphanumeric-data"),g=t("./byte-data"),p=t("./kanji-data"),v=t("./regex"),y=t("./utils"),w=t("dijkstrajs");r.fromArray=function(t){return t.reduce(function(t,e){return"string"==typeof e?t.push(c(e,null)):e.data&&t.push(c(e.data,e.mode)),t},[])},r.fromString=function(t,e){for(var n=i(t,y.isKanjiModeEnabled()),o=u(n),a=f(o,e),c=w.find_path(a.map,"start","end"),h=[],l=1;l<c.length-1;l++)h.push(a.table[c[l]].node);return r.fromArray(s(h))},r.rawSplit=function(t){return r.fromArray(i(t,y.isKanjiModeEnabled()))}},{"./alphanumeric-data":2,"./byte-data":5,"./kanji-data":11,"./mode":13,"./numeric-data":14,"./regex":18,"./utils":20,dijkstrajs:26}],20:[function(t,e,r){var n,o=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];r.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},r.getSymbolTotalCodewords=function(t){return o[t]},r.getBCHDigit=function(t){for(var e=0;0!==t;)e++,t>>>=1;return e},r.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');n=t},r.isKanjiModeEnabled=function(){return void 0!==n},r.toSJIS=function(t){return n(t)}},{}],21:[function(t,e,r){function n(t,e,n){for(var o=1;o<=40;o++)if(e<=r.getCapacity(o,n,t))return o}function o(t,e){return c.getCharCountIndicator(t,e)+4}function i(t,e){var r=0;return t.forEach(function(t){r+=o(t.mode,e)+t.getBitsLength()}),r}function a(t,e){for(var n=1;n<=40;n++){if(i(t,n)<=r.getCapacity(n,e,c.MIXED))return n}}var s=t("./utils"),u=t("./error-correction-code"),f=t("./error-correction-level"),c=t("./mode"),h=t("../utils/is-array"),l=s.getBCHDigit(7973);r.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40},r.from=function(t,e){return r.isValid(t)?parseInt(t,10):e},r.getCapacity=function(t,e,n){if(!r.isValid(t))throw new Error("Invalid QR Code version");void 0===n&&(n=c.BYTE);var i=s.getSymbolTotalCodewords(t),a=u.getTotalCodewordsCount(t,e),f=8*(i-a);if(n===c.MIXED)return f;var h=f-o(n,t);switch(n){case c.NUMERIC:return Math.floor(h/10*3);case c.ALPHANUMERIC:return Math.floor(h/11*2);case c.KANJI:return Math.floor(h/13);case c.BYTE:default:return Math.floor(h/8)}},r.getBestVersionForData=function(t,e){var r,o=f.from(e,f.M);if(h(t)){if(t.length>1)return a(t,o);if(0===t.length)return 1;r=t[0]}else r=t;return n(r.mode,r.getLength(),o)},r.getEncodedBits=function(t){if(!r.isValid(t)||t<7)throw new Error("Invalid QR Code version");for(var e=t<<12;s.getBCHDigit(e)-l>=0;)e^=7973<<s.getBCHDigit(e)-l;return t<<12|e}},{"../utils/is-array":24,"./error-correction-code":6,"./error-correction-level":7,"./mode":13,"./utils":20}],22:[function(t,e,r){var n=t("./renderer/qrcode-draw.js");n.qrcodedraw=n.QRCodeDraw,e.exports=n},{"./renderer/qrcode-draw.js":23}],23:[function(t,e,r){function n(){}var o=t("../core/qrcode"),i=t("../core/error-correction-level");r.QRCodeDraw=n,r.QRErrorCorrectLevel=i,r.QRCode=o,n.prototype={scale:4,defaultMargin:20,marginScaleFactor:5,color:{dark:"black",light:"white"},QRErrorCorrectLevel:i,draw:function(t,e,r,n){var i,a=Array.prototype.slice.call(arguments);if(n=a.pop(),t=a.shift(),e=a.shift(),r=a.shift()||{},"function"!=typeof n)throw new Error("callback required");"object"!=typeof r&&(r.errorCorrectionLevel=r),this.scale=r.scale||this.scale,this.margin=void 0===r.margin?this.defaultMargin:r.margin;try{var s=new o(e,r),u=this.scale||4,f=t.getContext("2d"),c=0,h=this.marginWidth(),l=h;c=this.dataWidth(s)+2*h,this.resetCanvas(t,f,c);for(var d=0,g=s.getModuleCount();d<g;d++){for(var p=h,v=0,y=s.getModuleCount();v<y;v++)s.isDark(d,v)?(f.fillStyle=this.color.dark,f.fillRect(p,l,u,u)):this.color.light&&(f.fillStyle=this.color.light,f.fillRect(p,l,u,u)),p+=u;l+=u}}catch(t){i=t}n(i,t,c)},drawBitArray:function(){var t,e=Array.prototype.slice.call(arguments),r=e.pop(),n=e.shift(),i=e.shift()||{};if("function"!=typeof r)throw new Error("callback required as last argument");try{var a,s=new o(n,i),u=0,f=0;u=this.dataWidth(s,1),a=new Array(u*u);for(var c=0,h=s.getModuleCount();c<h;c++)for(var l=0,d=s.getModuleCount();l<d;l++)s.isDark(c,l)?a[f]=1:a[f]=0,f++}catch(e){t=e,console.log(e.stack)}r(t,a,u)},marginWidth:function(){var t=this.margin;return this.scale=this.scale||4,this.scale*this.marginScaleFactor>t&&t>0&&(t=this.scale*this.marginScaleFactor),t},dataWidth:function(t,e){return t.getModuleCount()*(e||this.scale||4)},resetCanvas:function(t,e,r){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.style.height=t.height=r,t.style.width=t.width=r,this.color.light?(e.fillStyle=this.color.light,e.fillRect(0,0,t.width,t.height)):e.clearRect(0,0,t.width,t.height)}}},{"../core/error-correction-level":7,"../core/qrcode":16}],24:[function(t,e,r){e.exports=Array.isArray||function(t){return"[object Array]"==={}.toString.call(t)}},{}],25:[function(t,e,r){"use strict";function n(t,e,r){return"number"==typeof t?s(t):v(t,e,r)}function o(t){if(t>=w)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+w.toString(16)+" bytes");return 0|t}function i(t){return t!==t}function a(t){var e=new Uint8Array(t);return e.__proto__=n.prototype,e}function s(t){return a(t<0?0:0|o(t))}function u(t){var e=0|d(t),r=a(e),n=r.write(t);return n!==e&&(r=r.slice(0,n)),r}function f(t){for(var e=t.length<0?0:0|o(t.length),r=a(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function c(t,e,r){if(e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(r||0))throw new RangeError("'length' is out of bounds");var o;return o=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),o.__proto__=n.prototype,o}function h(t){if(n.isBuffer(t)){var e=0|o(t.length),r=a(e);return 0===r.length?r:(t.copy(r,0,0,e),r)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||i(t.length)?a(0):f(t);if("Buffer"===t.type&&Array.isArray(t.data))return f(t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function l(t,e){e=e||1/0;for(var r,n=t.length,o=null,i=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function d(t){return n.isBuffer(t)?t.length:"undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer)?t.byteLength:("string"!=typeof t&&(t=""+t),0===t.length?0:l(t).length)}function g(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function p(t,e,r,n){return g(l(e,t.length-r),t,r,n)}function v(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?c(t,e,r):"string"==typeof t?u(t,e):h(t)}var y=t("./is-array"),w=2147483647;n.prototype.__proto__=Uint8Array.prototype,n.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&n[Symbol.species]===n&&Object.defineProperty(n,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),n.prototype.write=function(t,e,r){void 0===e?(r=this.length,e=0):void 0===r&&"string"==typeof e?(r=this.length,e=0):isFinite(e)&&(e|=0,isFinite(r)?r|=0:r=void 0);var n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");return p(this,t,e,r)},n.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var o=this.subarray(t,e);return o.__proto__=n.prototype,o},n.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},n.prototype.fill=function(t,e,r){if("string"==typeof t){if("string"==typeof e?(e=0,r=this.length):"string"==typeof r&&(r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var i;if("number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var a=n.isBuffer(t)?t:new n(t),s=a.length;for(i=0;i<r-e;++i)this[i+e]=a[i%s]}return this},n.concat=function(t,e){if(!y(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a(null,0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var o=s(e),i=0;for(r=0;r<t.length;++r){var u=t[r];if(!n.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(o,i),i+=u.length}return o},n.byteLength=d,n.prototype._isBuffer=!0,n.isBuffer=function(t){return!(null==t||!t._isBuffer)},e.exports=n},{"./is-array":24}],26:[function(t,e,r){"use strict";var n={single_source_shortest_paths:function(t,e,r){var o={},i={};i[e]=0;var a=n.PriorityQueue.make();a.push(e,0);for(var s,u,f,c,h,l,d,g;!a.empty();){s=a.pop(),u=s.value,c=s.cost,h=t[u]||{};for(f in h)h.hasOwnProperty(f)&&(l=h[f],d=c+l,g=i[f],(void 0===i[f]||g>d)&&(i[f]=d,a.push(f,d),o[f]=u))}if(void 0!==r&&void 0===i[r]){var p=["Could not find a path from ",e," to ",r,"."].join("");throw new Error(p)}return o},extract_shortest_path_from_predecessor_list:function(t,e){for(var r=[],n=e;n;)r.push(n),t[n],n=t[n];return r.reverse(),r},find_path:function(t,e,r){var o=n.single_source_shortest_paths(t,e,r);return n.extract_shortest_path_from_predecessor_list(o,r)},PriorityQueue:{make:function(t){var e,r=n.PriorityQueue,o={};t=t||{};for(e in r)r.hasOwnProperty(e)&&(o[e]=r[e]);return o.queue=[],o.sorter=t.sorter||r.default_sorter,o},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var r={value:t,cost:e};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};void 0!==e&&(e.exports=n)},{}]},{},[22])(22)});
//# sourceMappingURL=qrcode.min.js.map

@@ -72,5 +72,5 @@ /**

// Skip if position is occupied by finder patterns
if (i === 0 && j === 0 || // top-left
i === 0 && j === posLength - 1 || // bottom-left
i === posLength - 1 && j === 0) { // top-right
if ((i === 0 && j === 0) || // top-left
(i === 0 && j === posLength - 1) || // bottom-left
(i === posLength - 1 && j === 0)) { // top-right
continue

@@ -77,0 +77,0 @@ }

@@ -60,2 +60,1 @@ var Mode = require('./mode')

module.exports = AlphanumericData

@@ -28,2 +28,1 @@ var Buffer = require('../utils/buffer')

module.exports = ByteData

@@ -331,2 +331,1 @@ var Mode = require('./mode')

}

@@ -179,3 +179,3 @@ /*

function saveSvg (path, text, options, cb) {
exports.drawSvg(text, function (error, code) {
exports.drawSvg(text, options, function (error, code) {
if (!error) {

@@ -182,0 +182,0 @@ fs.writeFile(path, code, function (fsErr) {

@@ -167,2 +167,1 @@ /*

}

@@ -11,3 +11,3 @@ exports.renderBits = function renderBits (bits, width, options) {

var dotsize = options.scale || 4
var margin = options.margin || 20
var margin = options.margin !== undefined ? options.margin : 20
var qrcodesize = width * dotsize + margin * 2

@@ -14,0 +14,0 @@ var lightColor = options.lightColor || '#ffffff'

@@ -86,4 +86,2 @@ /**

function fromArrayBuffer (array, byteOffset, length) {
array.byteLength // this throws if `array` is not a valid ArrayBuffer
if (byteOffset < 0 || array.byteLength < byteOffset) {

@@ -90,0 +88,0 @@ throw new RangeError('\'offset\' is out of bounds')

{
"name": "qrcode",
"description": "QRCode / 2d Barcode api with both server side and client side support using canvas",
"version": "0.7.0",
"version": "0.7.1",
"author": "Ryan Day <soldair@gmail.com>",

@@ -6,0 +6,0 @@ "contributors": [

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc