btcpayserver/BTCPayServer/wwwroot/vendor/vue-qrcode/vue-qrcode.min.js

10 lines
No EOL
32 KiB
JavaScript

/*!
* vue-qrcode v1.0.0
* https://fengyuanchen.github.io/vue-qrcode
*
* Copyright 2018-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2018-10-21T13:04:02.951Z
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueQrcode=e()}(this,function(){"use strict";var n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}var t,o=(function(t,e){t.exports=function i(a,u,s){function f(r,t){if(!u[r]){if(!a[r]){var e=c;if(!t&&e)return e(r,!0);if(l)return l(r,!0);var n=new Error("Cannot find module '"+r+"'");throw n.code="MODULE_NOT_FOUND",n}var o=u[r]={exports:{}};a[r][0].call(o.exports,function(t){var e=a[r][1][t];return f(e||t)},o,o.exports,i,a,u,s)}return u[r].exports}for(var l=c,t=0;t<s.length;t++)f(s[t]);return f}({1:[function(t,e,a){var u=t("./utils").getSymbolSize;a.getRowColCoords=function(t){if(1===t)return[];for(var e=Math.floor(t/7)+2,r=u(t),n=145===r?26:2*Math.ceil((r-13)/(2*e-2)),o=[r-7],i=1;i<e-1;i++)o[i]=o[i-1]-n;return o.push(6),o.reverse()},a.getPositions=function(t){for(var e=[],r=a.getRowColCoords(t),n=r.length,o=0;o<n;o++)for(var i=0;i<n;i++)0===o&&0===i||0===o&&i===n-1||o===n-1&&0===i||e.push([r[o],r[i]]);return e}},{"./utils":20}],2:[function(t,e,r){var n=t("./mode"),o=["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"," ","$","%","*","+","-",".","/",":"];function i(t){this.mode=n.ALPHANUMERIC,this.data=t}i.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){var e;for(e=0;e+2<=this.data.length;e+=2){var r=45*o.indexOf(this.data[e]);r+=o.indexOf(this.data[e+1]),t.put(r,11)}this.data.length%2&&t.put(o.indexOf(this.data[e]),6)},e.exports=i},{"./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){var n=t("../utils/buffer");function o(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new n(t*t),this.data.fill(0),this.reservedBit=new n(t*t),this.reservedBit.fill(0)}o.prototype.set=function(t,e,r,n){var o=t*this.size+e;this.data[o]=r,n&&(this.reservedBit[o]=!0)},o.prototype.get=function(t,e){return this.data[t*this.size+e]},o.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},o.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},e.exports=o},{"../utils/buffer":27}],5:[function(t,e,r){var n=t("../utils/buffer"),o=t("./mode");function i(t){this.mode=o.BYTE,this.data=new n(t)}i.getBitsLength=function(t){return 8*t},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){for(var e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)},e.exports=i},{"../utils/buffer":27,"./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){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&&0<=t.bit&&t.bit<4},r.from=function(t,e){if(r.isValid(t))return t;try{return function(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)}}(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 o=t("./utils"),i=o.getBCHDigit(1335);r.getEncodedBits=function(t,e){for(var r=t.bit<<3|e,n=r<<10;0<=o.getBCHDigit(n)-i;)n^=1335<<o.getBCHDigit(n)-i;return 21522^(r<<10|n)}},{"./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":27}],11:[function(t,e,r){var n=t("./mode"),o=t("./utils");function i(t){this.mode=n.KANJI,this.data=t}i.getBitsLength=function(t){return 13*t},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){var e;for(e=0;e<this.data.length;e++){var r=o.toSJIS(this.data[e]);if(33088<=r&&r<=40956)r-=33088;else{if(!(57408<=r&&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=i},{"./mode":13,"./utils":20}],12:[function(t,e,u){u.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var l={N1:3,N2:3,N3:40,N4:10};function i(t,e,r){switch(t){case u.Patterns.PATTERN000:return(e+r)%2==0;case u.Patterns.PATTERN001:return e%2==0;case u.Patterns.PATTERN010:return r%3==0;case u.Patterns.PATTERN011:return(e+r)%3==0;case u.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case u.Patterns.PATTERN101:return e*r%2+e*r%3==0;case u.Patterns.PATTERN110:return(e*r%2+e*r%3)%2==0;case u.Patterns.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}u.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&0<=t&&t<=7},u.from=function(t){return u.isValid(t)?parseInt(t,10):void 0},u.getPenaltyN1=function(t){for(var e=t.size,r=0,n=0,o=0,i=null,a=null,u=0;u<e;u++){n=o=0,i=a=null;for(var s=0;s<e;s++){var f=t.get(u,s);f===i?n++:(5<=n&&(r+=l.N1+(n-5)),i=f,n=1),(f=t.get(s,u))===a?o++:(5<=o&&(r+=l.N1+(o-5)),a=f,o=1)}5<=n&&(r+=l.N1+(n-5)),5<=o&&(r+=l.N1+(o-5))}return r},u.getPenaltyN2=function(t){for(var e=t.size,r=0,n=0;n<e-1;n++)for(var o=0;o<e-1;o++){var i=t.get(n,o)+t.get(n,o+1)+t.get(n+1,o)+t.get(n+1,o+1);4!==i&&0!==i||r++}return r*l.N2},u.getPenaltyN3=function(t){for(var e=t.size,r=0,n=0,o=0,i=0;i<e;i++){n=o=0;for(var a=0;a<e;a++)n=n<<1&2047|t.get(i,a),10<=a&&(1488===n||93===n)&&r++,o=o<<1&2047|t.get(a,i),10<=a&&(1488===o||93===o)&&r++}return r*l.N3},u.getPenaltyN4=function(t){for(var e=0,r=t.data.length,n=0;n<r;n++)e+=t.data[n];var o=Math.abs(Math.ceil(100*e/r/5)-10);return o*l.N4},u.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,i(t,o,n))},u.getBestMask=function(t,e){for(var r=Object.keys(u.Patterns).length,n=0,o=1/0,i=0;i<r;i++){e(i),u.applyMask(i,t);var a=u.getPenaltyN1(t)+u.getPenaltyN2(t)+u.getPenaltyN3(t)+u.getPenaltyN4(t);u.applyMask(i,t),a<o&&(o=a,n=i)}return n}},{}],13:[function(t,e,r){var n=t("./version-check"),o=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(!n.isValid(e))throw new Error("Invalid version: "+e);return 1<=e&&e<10?t.ccBits[0]:e<27?t.ccBits[1]:t.ccBits[2]},r.getBestModeForData=function(t){return o.testNumeric(t)?r.NUMERIC:o.testAlphanumeric(t)?r.ALPHANUMERIC:o.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 function(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)}}(t)}catch(t){return e}}},{"./regex":18,"./version-check":21}],14:[function(t,e,r){var n=t("./mode");function o(t){this.mode=n.NUMERIC,this.data=t.toString()}o.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.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;0<o&&(r=this.data.substr(e),n=parseInt(r,10),t.put(n,3*o+1))},e.exports=o},{"./mode":13}],15:[function(t,e,n){var a=t("../utils/buffer"),u=t("./galois-field");n.mul=function(t,e){var r=new a(t.length+e.length-1);r.fill(0);for(var n=0;n<t.length;n++)for(var o=0;o<e.length;o++)r[n+o]^=u.mul(t[n],e[o]);return r},n.mod=function(t,e){for(var r=new a(t);0<=r.length-e.length;){for(var n=r[0],o=0;o<e.length;o++)r[o]^=u.mul(e[o],n);for(var i=0;i<r.length&&0===r[i];)i++;r=r.slice(i)}return r},n.generateECPolynomial=function(t){for(var e=new a([1]),r=0;r<t;r++)e=n.mul(e,[1,u.exp(r)]);return e}},{"../utils/buffer":27,"./galois-field":10}],16:[function(t,e,r){var R=t("../utils/buffer"),P=t("./utils"),i=t("./error-correction-level"),f=t("./bit-buffer"),c=t("./bit-matrix"),h=t("./alignment-pattern"),d=t("./finder-pattern"),g=t("./mask-pattern"),T=t("./error-correction-code"),C=t("./reed-solomon-encoder"),p=t("./version"),u=t("./format-info"),l=t("./mode"),v=t("./segments"),m=t("isarray");function w(t,e,r){var n,o,i=t.size,a=u.getEncodedBits(e,r);for(n=0;n<15;n++)o=1==(a>>n&1),n<6?t.set(n,8,o,!0):n<8?t.set(n+1,8,o,!0):t.set(i-15+n,8,o,!0),n<8?t.set(8,i-n-1,o,!0):n<9?t.set(8,15-n-1+1,o,!0):t.set(8,15-n-1,o,!0);t.set(i-8,8,1,!0)}function y(e,t,r){var n=new f;r.forEach(function(t){n.put(t.mode.bit,4),n.put(t.getLength(),l.getCharCountIndicator(t.mode,e)),t.write(n)});var o=P.getSymbolTotalCodewords(e),i=T.getTotalCodewordsCount(e,t),a=8*(o-i);for(n.getLengthInBits()+4<=a&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(0);for(var u=(a-n.getLengthInBits())/8,s=0;s<u;s++)n.put(s%2?17:236,8);return function(t,e,r){for(var n=P.getSymbolTotalCodewords(e),o=T.getTotalCodewordsCount(e,r),i=n-o,a=T.getBlocksCount(e,r),u=a-n%a,s=Math.floor(n/a),f=Math.floor(i/a),l=f+1,c=s-f,h=new C(c),d=0,g=new Array(a),p=new Array(a),v=0,m=new R(t.buffer),w=0;w<a;w++){var y=w<u?f:l;g[w]=m.slice(d,d+y),p[w]=h.encode(g[w]),d+=y,v=Math.max(v,y)}var E,b,A=new R(n),B=0;for(E=0;E<v;E++)for(b=0;b<a;b++)E<g[b].length&&(A[B++]=g[b][E]);for(E=0;E<c;E++)for(b=0;b<a;b++)A[B++]=p[b][E];return A}(n,e,t)}function a(t,e,r,n){var o;if(m(t))o=v.fromArray(t);else{if("string"!=typeof t)throw new Error("Invalid data");var i=e;if(!i){var a=v.rawSplit(t);i=p.getBestVersionForData(a,r)}o=v.fromString(t,i||40)}var u=p.getBestVersionForData(o,r);if(!u)throw new Error("The amount of data is too big to be stored in a QR Code");if(e){if(e<u)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+u+".\n")}else e=u;var s=y(e,r,o),f=P.getSymbolSize(e),l=new c(f);return function(t,e){for(var r=t.size,n=d.getPositions(e),o=0;o<n.length;o++)for(var i=n[o][0],a=n[o][1],u=-1;u<=7;u++)if(!(i+u<=-1||r<=i+u))for(var s=-1;s<=7;s++)a+s<=-1||r<=a+s||(0<=u&&u<=6&&(0===s||6===s)||0<=s&&s<=6&&(0===u||6===u)||2<=u&&u<=4&&2<=s&&s<=4?t.set(i+u,a+s,!0,!0):t.set(i+u,a+s,!1,!0))}(l,e),function(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)}}(l),function(t,e){for(var r=h.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 u=-2;u<=2;u++)-2===a||2===a||-2===u||2===u||0===a&&0===u?t.set(o+a,i+u,!0,!0):t.set(o+a,i+u,!1,!0)}(l,e),w(l,r,0),7<=e&&function(t,e){for(var r,n,o,i=t.size,a=p.getEncodedBits(e),u=0;u<18;u++)r=Math.floor(u/3),n=u%3+i-8-3,o=1==(a>>u&1),t.set(r,n,o,!0),t.set(n,r,o,!0)}(l,e),function(t,e){for(var r=t.size,n=-1,o=r-1,i=7,a=0,u=r-1;0<u;u-=2)for(6===u&&u--;;){for(var s=0;s<2;s++)if(!t.isReserved(o,u-s)){var f=!1;a<e.length&&(f=1==(e[a]>>>i&1)),t.set(o,u-s,f),-1==--i&&(a++,i=7)}if((o+=n)<0||r<=o){o-=n,n=-n;break}}}(l,s),isNaN(n)&&(n=g.getBestMask(l,w.bind(null,l,r))),g.applyMask(n,l),w(l,r,n),{modules:l,version:e,errorCorrectionLevel:r,maskPattern:n,segments:o}}r.create=function(t,e){if(void 0===t||""===t)throw new Error("No input text");var r,n,o=i.M;return void 0!==e&&(o=i.from(e.errorCorrectionLevel,i.M),r=p.from(e.version),n=g.from(e.maskPattern),e.toSJISFunc&&P.setToSJISFunction(e.toSJISFunc)),a(t,r,o,n)}},{"../utils/buffer":27,"./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":22,isarray:30}],17:[function(t,e,r){var a=t("../utils/buffer"),u=t("./polynomial");function n(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}n.prototype.initialize=function(t){this.degree=t,this.genPoly=u.generateECPolynomial(this.degree)},n.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");var e=new a(this.degree);e.fill(0);var r=a.concat([t,e],t.length+this.degree),n=u.mod(r,this.genPoly),o=this.degree-n.length;if(0<o){var i=new a(this.degree);return i.fill(0),n.copy(i,o),i}return n},e.exports=n},{"../utils/buffer":27,"./polynomial":15}],18:[function(t,e,r){var n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",o="(?:(?![A-Z0-9 $%*+\\-./:]|"+(n=n.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";r.KANJI=new RegExp(n,"g"),r.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),r.BYTE=new RegExp(o,"g"),r.NUMERIC=new RegExp("[0-9]+","g"),r.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");var i=new RegExp("^"+n+"$"),a=new RegExp("^[0-9]+$"),u=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");r.testKanji=function(t){return i.test(t)},r.testNumeric=function(t){return a.test(t)},r.testAlphanumeric=function(t){return u.test(t)}},{}],19:[function(t,e,s){var d=t("./mode"),o=t("./numeric-data"),i=t("./alphanumeric-data"),a=t("./byte-data"),u=t("./kanji-data"),f=t("./regex"),l=t("./utils"),c=t("dijkstrajs");function h(t){return unescape(encodeURIComponent(t)).length}function g(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 p(t){var e,r,n=g(f.NUMERIC,d.NUMERIC,t),o=g(f.ALPHANUMERIC,d.ALPHANUMERIC,t);r=l.isKanjiModeEnabled()?(e=g(f.BYTE,d.BYTE,t),g(f.KANJI,d.KANJI,t)):(e=g(f.BYTE_KANJI,d.BYTE,t),[]);var i=n.concat(o,e,r);return i.sort(function(t,e){return t.index-e.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function v(t,e){switch(e){case d.NUMERIC:return o.getBitsLength(t);case d.ALPHANUMERIC:return i.getBitsLength(t);case d.KANJI:return u.getBitsLength(t);case d.BYTE:return a.getBitsLength(t)}}function r(t,e){var r,n=d.getBestModeForData(t);if((r=d.from(e,n))!==d.BYTE&&r.bit<n.bit)throw new Error('"'+t+'" cannot be encoded with mode '+d.toString(r)+".\n Suggested mode is: "+d.toString(n));switch(r!==d.KANJI||l.isKanjiModeEnabled()||(r=d.BYTE),r){case d.NUMERIC:return new o(t);case d.ALPHANUMERIC:return new i(t);case d.KANJI:return new u(t);case d.BYTE:return new a(t)}}s.fromArray=function(t){return t.reduce(function(t,e){return"string"==typeof e?t.push(r(e,null)):e.data&&t.push(r(e.data,e.mode)),t},[])},s.fromString=function(t,e){for(var r=p(t,l.isKanjiModeEnabled()),n=function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];switch(n.mode){case d.NUMERIC:e.push([n,{data:n.data,mode:d.ALPHANUMERIC,length:n.length},{data:n.data,mode:d.BYTE,length:n.length}]);break;case d.ALPHANUMERIC:e.push([n,{data:n.data,mode:d.BYTE,length:n.length}]);break;case d.KANJI:e.push([n,{data:n.data,mode:d.BYTE,length:h(n.data)}]);break;case d.BYTE:e.push([{data:n.data,mode:d.BYTE,length:h(n.data)}])}}return e}(r),o=function(t,e){for(var r={},n={start:{}},o=["start"],i=0;i<t.length;i++){for(var a=t[i],u=[],s=0;s<a.length;s++){var f=a[s],l=""+i+s;u.push(l),r[l]={node:f,lastCount:0},n[l]={};for(var c=0;c<o.length;c++){var h=o[c];r[h]&&r[h].node.mode===f.mode?(n[h][l]=v(r[h].lastCount+f.length,f.mode)-v(r[h].lastCount,f.mode),r[h].lastCount+=f.length):(r[h]&&(r[h].lastCount=f.length),n[h][l]=v(f.length,f.mode)+4+d.getCharCountIndicator(f.mode,e))}}o=u}for(c=0;c<o.length;c++)n[o[c]].end=0;return{map:n,table:r}}(n,e),i=c.find_path(o.map,"start","end"),a=[],u=1;u<i.length-1;u++)a.push(o.table[i[u]].node);return s.fromArray(a.reduce(function(t,e){var r=0<=t.length-1?t[t.length-1]:null;return r&&r.mode===e.mode?t[t.length-1].data+=e.data:t.push(e),t},[]))},s.rawSplit=function(t){return s.fromArray(p(t,l.isKanjiModeEnabled()))}},{"./alphanumeric-data":2,"./byte-data":5,"./kanji-data":11,"./mode":13,"./numeric-data":14,"./regex":18,"./utils":20,dijkstrajs:29}],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||40<t)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){r.isValid=function(t){return!isNaN(t)&&1<=t&&t<=40}},{}],22:[function(t,e,o){var u=t("./utils"),s=t("./error-correction-code"),i=t("./error-correction-level"),f=t("./mode"),l=t("./version-check"),a=t("isarray"),r=u.getBCHDigit(7973);function c(t,e){return f.getCharCountIndicator(t,e)+4}function h(t,r){var n=0;return t.forEach(function(t){var e=c(t.mode,r);n+=e+t.getBitsLength()}),n}o.from=function(t,e){return l.isValid(t)?parseInt(t,10):e},o.getCapacity=function(t,e,r){if(!l.isValid(t))throw new Error("Invalid QR Code version");void 0===r&&(r=f.BYTE);var n=u.getSymbolTotalCodewords(t),o=s.getTotalCodewordsCount(t,e),i=8*(n-o);if(r===f.MIXED)return i;var a=i-c(r,t);switch(r){case f.NUMERIC:return Math.floor(a/10*3);case f.ALPHANUMERIC:return Math.floor(a/11*2);case f.KANJI:return Math.floor(a/13);case f.BYTE:default:return Math.floor(a/8)}},o.getBestVersionForData=function(t,e){var r,n=i.from(e,i.M);if(a(t)){if(1<t.length)return function(t,e){for(var r=1;r<=40;r++){var n=h(t,r);if(n<=o.getCapacity(r,e,f.MIXED))return r}}(t,n);if(0===t.length)return 1;r=t[0]}else r=t;return function(t,e,r){for(var n=1;n<=40;n++)if(e<=o.getCapacity(n,r,t))return n}(r.mode,r.getLength(),n)},o.getEncodedBits=function(t){if(!l.isValid(t)||t<7)throw new Error("Invalid QR Code version");for(var e=t<<12;0<=u.getBCHDigit(e)-r;)e^=7973<<u.getBCHDigit(e)-r;return t<<12|e}},{"./error-correction-code":6,"./error-correction-level":7,"./mode":13,"./utils":20,"./version-check":21,isarray:30}],23:[function(t,e,r){var f=t("can-promise"),l=t("./core/qrcode"),n=t("./renderer/canvas"),o=t("./renderer/svg-tag.js");function i(n,o,i,a,e){var t=[].slice.call(arguments,1),r=t.length,u="function"==typeof t[r-1];if(!u&&!f())throw new Error("Callback required as last argument");if(!u){if(r<1)throw new Error("Too few arguments provided");return 1===r?(i=o,o=a=void 0):2!==r||o.getContext||(a=i,i=o,o=void 0),new Promise(function(t,e){try{var r=l.create(i,a);t(n(r,o,a))}catch(t){e(t)}})}if(r<2)throw new Error("Too few arguments provided");2===r?(e=i,i=o,o=a=void 0):3===r&&(o.getContext&&void 0===e?(e=a,a=void 0):(e=a,a=i,i=o,o=void 0));try{var s=l.create(i,a);e(null,n(s,o,a))}catch(t){e(t)}}r.create=l.create,r.toCanvas=i.bind(null,n.render),r.toDataURL=i.bind(null,n.renderToDataURL),r.toString=i.bind(null,function(t,e,r){return o.render(t,r)})},{"./core/qrcode":16,"./renderer/canvas":24,"./renderer/svg-tag.js":25,"can-promise":28}],24:[function(t,e,u){var l=t("./utils");u.render=function(t,e,r){var n=r,o=e;void 0!==n||e&&e.getContext||(n=e,e=void 0),e||(o=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),n=l.getOptions(n);var i,a,u=l.getImageWidth(t.modules.size,n),s=o.getContext("2d"),f=s.createImageData(u,u);return l.qrToImageData(f.data,t,n),i=o,a=u,s.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=a,i.width=a,i.style.height=a+"px",i.style.width=a+"px",s.putImageData(f,0,0),o},u.renderToDataURL=function(t,e,r){var n=r;void 0!==n||e&&e.getContext||(n=e,e=void 0),n||(n={});var o=u.render(t,e,n),i=n.type||"image/png",a=n.rendererOpts||{};return o.toDataURL(i,a.quality)}},{"./utils":26}],25:[function(t,e,r){var h=t("./utils");function d(t,e){var r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function g(t,e,r){var n=t+e;return void 0!==r&&(n+=" "+r),n}r.render=function(t,e,r){var n=h.getOptions(e),o=t.modules.size,i=t.modules.data,a=o+2*n.margin,u=n.color.light.a?"<path "+d(n.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",s="<path "+d(n.color.dark,"stroke")+' d="'+function(t,e,r){for(var n="",o=0,i=!1,a=0,u=0;u<t.length;u++){var s=Math.floor(u%e),f=Math.floor(u/e);s||i||(i=!0),t[u]?(a++,0<u&&0<s&&t[u-1]||(n+=i?g("M",s+r,.5+f+r):g("m",o,0),o=0,i=!1),s+1<e&&t[u+1]||(n+=g("h",a),a=0)):o++}return n}(i,o,n.margin)+'"/>',f='viewBox="0 0 '+a+" "+a+'"',l=n.width?'width="'+n.width+'" height="'+n.width+'" ':"",c='<svg xmlns="http://www.w3.org/2000/svg" '+l+f+' shape-rendering="crispEdges">'+u+s+"</svg>\n";return"function"==typeof r&&r(null,c),c}},{"./utils":26}],26:[function(t,e,p){function o(t){if("string"!=typeof t)throw new Error("Color should be defined as hex string");var e=t.slice().replace("#","").split("");if(e.length<3||5===e.length||8<e.length)throw new Error("Invalid hex color: "+t);3!==e.length&&4!==e.length||(e=Array.prototype.concat.apply([],e.map(function(t){return[t,t]}))),6===e.length&&e.push("F","F");var r=parseInt(e.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+e.slice(0,6).join("")}}p.getOptions=function(t){t||(t={}),t.color||(t.color={});var e=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,r=t.width&&21<=t.width?t.width:void 0,n=t.scale||4;return{width:r,scale:r?4:n,margin:e,color:{dark:o(t.color.dark||"#000000ff"),light:o(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},p.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},p.getImageWidth=function(t,e){var r=p.getScale(t,e);return Math.floor((t+2*e.margin)*r)},p.qrToImageData=function(t,e,r){for(var n=e.modules.size,o=e.modules.data,i=p.getScale(n,r),a=Math.floor((n+2*r.margin)*i),u=r.margin*i,s=[r.color.light,r.color.dark],f=0;f<a;f++)for(var l=0;l<a;l++){var c=4*(f*a+l),h=r.color.light;if(u<=f&&u<=l&&f<a-u&&l<a-u){var d=Math.floor((f-u)/i),g=Math.floor((l-u)/i);h=s[o[d*n+g]?1:0]}t[c++]=h.r,t[c++]=h.g,t[c++]=h.b,t[c]=h.a}}},{}],27:[function(t,e,r){var a=t("isarray"),n=(f.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())?2147483647:1073741823;function f(t,e,r){return f.TYPED_ARRAY_SUPPORT||this instanceof f?"number"==typeof t?u(this,t):function(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");var o;return o=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),f.TYPED_ARRAY_SUPPORT?o.__proto__=f.prototype:o=h(t,o),o}(t,e,r,n):"string"!=typeof e?function(t,e){if(f.isBuffer(e)){var r=0|l(e.length),n=c(t,r);return 0===n.length||e.copy(n,0,0,r),n}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(o=e.length)!=o?c(t,0):h(t,e);if("Buffer"===e.type&&Array.isArray(e.data))return h(t,e.data)}var o;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e):(o=t,a=0|d(i=e),u=c(o,a),(s=u.write(i))!==a&&(u=u.slice(0,s)),u);var o,i,a,u,s}(this,t,e,r):new f(t,e,r)}function l(t){if(n<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|t}function c(t,e){var r;return f.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e)).__proto__=f.prototype:(null===(r=t)&&(r=new f(e)),r.length=e),r}function u(t,e){var r=c(t,e<0?0:0|l(e));if(!f.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)r[n]=0;return r}function h(t,e){for(var r=e.length<0?0:0|l(e.length),n=c(t,r),o=0;o<r;o+=1)n[o]=255&e[o];return n}function s(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],a=0;a<n;++a){if(55295<(r=t.charCodeAt(a))&&r<57344){if(!o){if(56319<r){-1<(e-=3)&&i.push(239,191,189);continue}if(a+1===n){-1<(e-=3)&&i.push(239,191,189);continue}o=r;continue}if(r<56320){-1<(e-=3)&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&-1<(e-=3)&&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(f.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:s(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}f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),f.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,o,i,a=this.length-e;if((void 0===r||a<r)&&(r=a),0<t.length&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");return o=e,i=r,g(s(t,(n=this).length-o),n,o,i)},f.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):n<t&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):n<e&&(e=n),e<t&&(e=t),f.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=f.prototype;else{var o=e-t;r=new f(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},f.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),0<n&&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;0<=o;--o)t[o+e]=this[o+r];else if(i<1e3||!f.TYPED_ARRAY_SUPPORT)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},f.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 n=t.charCodeAt(0);n<256&&(t=n)}}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;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var i=f.isBuffer(t)?t:new f(t),a=i.length;for(o=0;o<r-e;++o)this[o+e]=i[o%a]}return this},f.concat=function(t,e){if(!a(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c(null,0);var r;if(void 0===e)for(r=e=0;r<t.length;++r)e+=t[r].length;var n=u(null,e),o=0;for(r=0;r<t.length;++r){var i=t[r];if(!f.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},f.byteLength=d,f.prototype._isBuffer=!0,f.isBuffer=function(t){return!(null==t||!t._isBuffer)},e.exports=f},{isarray:30}],28:[function(t,e,r){var n=t("window-or-global");e.exports=function(){return"function"==typeof n.Promise&&"function"==typeof n.Promise.prototype.then}},{"window-or-global":31}],29:[function(t,e,r){var p={single_source_shortest_paths:function(t,e,r){var n={},o={};o[e]=0;var i,a,u,s,f,l,c,h,d=p.PriorityQueue.make();for(d.push(e,0);!d.empty();)for(u in i=d.pop(),a=i.value,s=i.cost,f=t[a]||{})f.hasOwnProperty(u)&&(l=f[u],c=s+l,h=o[u],(void 0===o[u]||c<h)&&(o[u]=c,d.push(u,c),n[u]=a));if(void 0===r||void 0!==o[r])return n;var g=["Could not find a path from ",e," to ",r,"."].join("");throw new Error(g)},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 n=p.single_source_shortest_paths(t,e,r);return p.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(t){var e,r=p.PriorityQueue,n={};for(e in t=t||{},r)r.hasOwnProperty(e)&&(n[e]=r[e]);return n.queue=[],n.sorter=t.sorter||r.default_sorter,n},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=p)},{}],30:[function(t,e,r){var n={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],31:[function(t,e,r){(function(t){e.exports="object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t||this}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[23])(23)}(t={exports:{}},t.exports),t.exports);return{name:"qrcode",props:{options:Object,tag:{type:String,default:"canvas"},value:null},render:function(t){return t(this.tag,this.$slots.default)},watch:{$props:{deep:!0,immediate:!0,handler:function(){this.$el&&this.generate()}}},methods:{generate:function(){var r=this,t=this.options,e=this.tag,n=String(this.value);"canvas"===e?o.toCanvas(this.$el,n,t,function(t){if(t)throw t}):"img"===e?o.toDataURL(n,t,function(t,e){if(t)throw t;r.$el.src=e}):o.toString(n,t,function(t,e){if(t)throw t;r.$el.innerHTML=e})}},mounted:function(){this.generate()}}});