browser-legacy.2ab737c2.js 23 KB

1
  1. System.register([],(function(t){"use strict";return{execute:function(){t("i","./assets/icon_logo.d4268eb2.png");var r,e=t("b",{}),n={},o={},i=[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];o.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},o.getSymbolTotalCodewords=function(t){return i[t]},o.getBCHDigit=function(t){for(var r=0;0!==t;)r++,t>>>=1;return r},o.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');r=t},o.isKanjiModeEnabled=function(){return void 0!==r},o.toSJIS=function(t){return r(t)};var a={};function u(){this.buffer=[],this.length=0}!function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},t.from=function(r,e){if(t.isValid(r))return r;try{return function(r){if("string"!=typeof r)throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+r)}}(r)}catch(n){return e}}}(a),u.prototype={get:function(t){var r=Math.floor(t/8);return 1==(this.buffer[r]>>>7-t%8&1)},put:function(t,r){for(var e=0;e<r;e++)this.putBit(1==(t>>>r-e-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),t&&(this.buffer[r]|=128>>>this.length%8),this.length++}};var s=u;function f(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}f.prototype.set=function(t,r,e,n){var o=t*this.size+r;this.data[o]=e,n&&(this.reservedBit[o]=!0)},f.prototype.get=function(t,r){return this.data[t*this.size+r]},f.prototype.xor=function(t,r,e){this.data[t*this.size+r]^=e},f.prototype.isReserved=function(t,r){return this.reservedBit[t*this.size+r]};var h=f,c={};!function(t){var r=o.getSymbolSize;t.getRowColCoords=function(t){if(1===t)return[];for(var e=Math.floor(t/7)+2,n=r(t),o=145===n?26:2*Math.ceil((n-13)/(2*e-2)),i=[n-7],a=1;a<e-1;a++)i[a]=i[a-1]-o;return i.push(6),i.reverse()},t.getPositions=function(r){for(var e=[],n=t.getRowColCoords(r),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}}(c);var g={},d=o.getSymbolSize;g.getPositions=function(t){var r=d(t);return[[0,0],[r-7,0],[0,r-7]]};var l={};!function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var r=3,e=3,n=40,o=10;function i(r,e,n){switch(r){case t.Patterns.PATTERN000:return(e+n)%2==0;case t.Patterns.PATTERN001:return e%2==0;case t.Patterns.PATTERN010:return n%3==0;case t.Patterns.PATTERN011:return(e+n)%3==0;case t.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(n/3))%2==0;case t.Patterns.PATTERN101:return e*n%2+e*n%3==0;case t.Patterns.PATTERN110:return(e*n%2+e*n%3)%2==0;case t.Patterns.PATTERN111:return(e*n%3+(e+n)%2)%2==0;default:throw new Error("bad maskPattern:"+r)}}t.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},t.from=function(r){return t.isValid(r)?parseInt(r,10):void 0},t.getPenaltyN1=function(t){for(var e=t.size,n=0,o=0,i=0,a=null,u=null,s=0;s<e;s++){o=i=0,a=u=null;for(var f=0;f<e;f++){var h=t.get(s,f);h===a?o++:(o>=5&&(n+=r+(o-5)),a=h,o=1),(h=t.get(f,s))===u?i++:(i>=5&&(n+=r+(i-5)),u=h,i=1)}o>=5&&(n+=r+(o-5)),i>=5&&(n+=r+(i-5))}return n},t.getPenaltyN2=function(t){for(var r=t.size,n=0,o=0;o<r-1;o++)for(var i=0;i<r-1;i++){var a=t.get(o,i)+t.get(o,i+1)+t.get(o+1,i)+t.get(o+1,i+1);4!==a&&0!==a||n++}return n*e},t.getPenaltyN3=function(t){for(var r=t.size,e=0,o=0,i=0,a=0;a<r;a++){o=i=0;for(var u=0;u<r;u++)o=o<<1&2047|t.get(a,u),u>=10&&(1488===o||93===o)&&e++,i=i<<1&2047|t.get(u,a),u>=10&&(1488===i||93===i)&&e++}return e*n},t.getPenaltyN4=function(t){for(var r=0,e=t.data.length,n=0;n<e;n++)r+=t.data[n];return Math.abs(Math.ceil(100*r/e/5)-10)*o},t.applyMask=function(t,r){for(var e=r.size,n=0;n<e;n++)for(var o=0;o<e;o++)r.isReserved(o,n)||r.xor(o,n,i(t,o,n))},t.getBestMask=function(r,e){for(var n=Object.keys(t.Patterns).length,o=0,i=1/0,a=0;a<n;a++){e(a),t.applyMask(a,r);var u=t.getPenaltyN1(r)+t.getPenaltyN2(r)+t.getPenaltyN3(r)+t.getPenaltyN4(r);t.applyMask(a,r),u<i&&(i=u,o=a)}return o}}(l);var v={},p=a,w=[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],m=[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];v.getBlocksCount=function(t,r){switch(r){case p.L:return w[4*(t-1)+0];case p.M:return w[4*(t-1)+1];case p.Q:return w[4*(t-1)+2];case p.H:return w[4*(t-1)+3];default:return}},v.getTotalCodewordsCount=function(t,r){switch(r){case p.L:return m[4*(t-1)+0];case p.M:return m[4*(t-1)+1];case p.Q:return m[4*(t-1)+2];case p.H:return m[4*(t-1)+3];default:return}};var E={},y={},A=new Uint8Array(512),C=new Uint8Array(256);!function(){for(var t=1,r=0;r<255;r++)A[r]=t,C[t]=r,256&(t<<=1)&&(t^=285);for(var e=255;e<512;e++)A[e]=A[e-255]}(),y.log=function(t){if(t<1)throw new Error("log("+t+")");return C[t]},y.exp=function(t){return A[t]},y.mul=function(t,r){return 0===t||0===r?0:A[C[t]+C[r]]},function(t){var r=y;t.mul=function(t,e){for(var n=new Uint8Array(t.length+e.length-1),o=0;o<t.length;o++)for(var i=0;i<e.length;i++)n[o+i]^=r.mul(t[o],e[i]);return n},t.mod=function(t,e){for(var n=new Uint8Array(t);n.length-e.length>=0;){for(var o=n[0],i=0;i<e.length;i++)n[i]^=r.mul(e[i],o);for(var a=0;a<n.length&&0===n[a];)a++;n=n.slice(a)}return n},t.generateECPolynomial=function(e){for(var n=new Uint8Array([1]),o=0;o<e;o++)n=t.mul(n,new Uint8Array([1,r.exp(o)]));return n}}(E);var B=E;function I(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}I.prototype.initialize=function(t){this.degree=t,this.genPoly=B.generateECPolynomial(this.degree)},I.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");var r=new Uint8Array(t.length+this.degree);r.set(t);var e=B.mod(r,this.genPoly),n=this.degree-e.length;if(n>0){var o=new Uint8Array(this.degree);return o.set(e,n),o}return e};var M=I,T={},N={},P={isValid:function(t){return!isNaN(t)&&t>=1&&t<=40}},b={},R="[0-9]+",L="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",U="(?:(?![A-Z0-9 $%*+\\-./:]|"+(L=L.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";b.KANJI=new RegExp(L,"g"),b.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),b.BYTE=new RegExp(U,"g"),b.NUMERIC=new RegExp(R,"g"),b.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");var S=new RegExp("^"+L+"$"),x=new RegExp("^[0-9]+$"),k=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");b.testKanji=function(t){return S.test(t)},b.testNumeric=function(t){return x.test(t)},b.testAlphanumeric=function(t){return k.test(t)},function(t){var r=P,e=b;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(t,e){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!r.isValid(e))throw new Error("Invalid version: "+e);return e>=1&&e<10?t.ccBits[0]:e<27?t.ccBits[1]:t.ccBits[2]},t.getBestModeForData=function(r){return e.testNumeric(r)?t.NUMERIC:e.testAlphanumeric(r)?t.ALPHANUMERIC:e.testKanji(r)?t.KANJI:t.BYTE},t.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},t.isValid=function(t){return t&&t.bit&&t.ccBits},t.from=function(r,e){if(t.isValid(r))return r;try{return function(r){if("string"!=typeof r)throw new Error("Param is not a string");switch(r.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+r)}}(r)}catch(n){return e}}}(N),function(t){var r=o,e=v,n=a,i=N,u=P,s=r.getBCHDigit(7973);function f(t,r){return i.getCharCountIndicator(t,r)+4}function h(t,r){var e=0;return t.forEach((function(t){var n=f(t.mode,r);e+=n+t.getBitsLength()})),e}t.from=function(t,r){return u.isValid(t)?parseInt(t,10):r},t.getCapacity=function(t,n,o){if(!u.isValid(t))throw new Error("Invalid QR Code version");void 0===o&&(o=i.BYTE);var a=8*(r.getSymbolTotalCodewords(t)-e.getTotalCodewordsCount(t,n));if(o===i.MIXED)return a;var s=a-f(o,t);switch(o){case i.NUMERIC:return Math.floor(s/10*3);case i.ALPHANUMERIC:return Math.floor(s/11*2);case i.KANJI:return Math.floor(s/13);case i.BYTE:default:return Math.floor(s/8)}},t.getBestVersionForData=function(r,e){var o,a=n.from(e,n.M);if(Array.isArray(r)){if(r.length>1)return function(r,e){for(var n=1;n<=40;n++)if(h(r,n)<=t.getCapacity(n,e,i.MIXED))return n}(r,a);if(0===r.length)return 1;o=r[0]}else o=r;return function(r,e,n){for(var o=1;o<=40;o++)if(e<=t.getCapacity(o,n,r))return o}(o.mode,o.getLength(),a)},t.getEncodedBits=function(t){if(!u.isValid(t)||t<7)throw new Error("Invalid QR Code version");for(var e=t<<12;r.getBCHDigit(e)-s>=0;)e^=7973<<r.getBCHDigit(e)-s;return t<<12|e}}(T);var F={},z=o,D=z.getBCHDigit(1335);F.getEncodedBits=function(t,r){for(var e=t.bit<<3|r,n=e<<10;z.getBCHDigit(n)-D>=0;)n^=1335<<z.getBCHDigit(n)-D;return 21522^(e<<10|n)};var H={},J=N;function K(t){this.mode=J.NUMERIC,this.data=t.toString()}K.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},K.prototype.getLength=function(){return this.data.length},K.prototype.getBitsLength=function(){return K.getBitsLength(this.data.length)},K.prototype.write=function(t){var r,e,n;for(r=0;r+3<=this.data.length;r+=3)e=this.data.substr(r,3),n=parseInt(e,10),t.put(n,10);var o=this.data.length-r;o>0&&(e=this.data.substr(r),n=parseInt(e,10),t.put(n,3*o+1))};var Y=K,_=N,V=["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 j(t){this.mode=_.ALPHANUMERIC,this.data=t}j.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},j.prototype.getLength=function(){return this.data.length},j.prototype.getBitsLength=function(){return j.getBitsLength(this.data.length)},j.prototype.write=function(t){var r;for(r=0;r+2<=this.data.length;r+=2){var e=45*V.indexOf(this.data[r]);e+=V.indexOf(this.data[r+1]),t.put(e,11)}this.data.length%2&&t.put(V.indexOf(this.data[r]),6)};var O=j,q=function(t){for(var r=[],e=t.length,n=0;n<e;n++){var o=t.charCodeAt(n);if(o>=55296&&o<=56319&&e>n+1){var i=t.charCodeAt(n+1);i>=56320&&i<=57343&&(o=1024*(o-55296)+i-56320+65536,n+=1)}o<128?r.push(o):o<2048?(r.push(o>>6|192),r.push(63&o|128)):o<55296||o>=57344&&o<65536?(r.push(o>>12|224),r.push(o>>6&63|128),r.push(63&o|128)):o>=65536&&o<=1114111?(r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)):r.push(239,191,189)}return new Uint8Array(r).buffer},Q=N;function $(t){this.mode=Q.BYTE,"string"==typeof t&&(t=q(t)),this.data=new Uint8Array(t)}$.getBitsLength=function(t){return 8*t},$.prototype.getLength=function(){return this.data.length},$.prototype.getBitsLength=function(){return $.getBitsLength(this.data.length)},$.prototype.write=function(t){for(var r=0,e=this.data.length;r<e;r++)t.put(this.data[r],8)};var Z=$,X=N,W=o;function G(t){this.mode=X.KANJI,this.data=t}G.getBitsLength=function(t){return 13*t},G.prototype.getLength=function(){return this.data.length},G.prototype.getBitsLength=function(){return G.getBitsLength(this.data.length)},G.prototype.write=function(t){var r;for(r=0;r<this.data.length;r++){var e=W.toSJIS(this.data[r]);if(e>=33088&&e<=40956)e-=33088;else{if(!(e>=57408&&e<=60351))throw new Error("Invalid SJIS character: "+this.data[r]+"\nMake sure your charset is UTF-8");e-=49472}e=192*(e>>>8&255)+(255&e),t.put(e,13)}};var tt=G,rt={exports:{}};!function(t){var r={single_source_shortest_paths:function(t,e,n){var o={},i={};i[e]=0;var a,u,s,f,h,c,g,d=r.PriorityQueue.make();for(d.push(e,0);!d.empty();)for(s in u=(a=d.pop()).value,f=a.cost,h=t[u]||{})h.hasOwnProperty(s)&&(c=f+h[s],g=i[s],(void 0===i[s]||g>c)&&(i[s]=c,d.push(s,c),o[s]=u));if(void 0!==n&&void 0===i[n]){var l=["Could not find a path from ",e," to ",n,"."].join("");throw new Error(l)}return o},extract_shortest_path_from_predecessor_list:function(t,r){for(var e=[],n=r;n;)e.push(n),t[n],n=t[n];return e.reverse(),e},find_path:function(t,e,n){var o=r.single_source_shortest_paths(t,e,n);return r.extract_shortest_path_from_predecessor_list(o,n)},PriorityQueue:{make:function(t){var e,n=r.PriorityQueue,o={};for(e in t=t||{},n)n.hasOwnProperty(e)&&(o[e]=n[e]);return o.queue=[],o.sorter=t.sorter||n.default_sorter,o},default_sorter:function(t,r){return t.cost-r.cost},push:function(t,r){var e={value:t,cost:r};this.queue.push(e),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};t.exports=r}(rt),function(t){var r=N,e=Y,n=O,i=Z,a=tt,u=b,s=o,f=rt.exports;function h(t){return unescape(encodeURIComponent(t)).length}function c(t,r,e){for(var n,o=[];null!==(n=t.exec(e));)o.push({data:n[0],index:n.index,mode:r,length:n[0].length});return o}function g(t){var e,n,o=c(u.NUMERIC,r.NUMERIC,t),i=c(u.ALPHANUMERIC,r.ALPHANUMERIC,t);return s.isKanjiModeEnabled()?(e=c(u.BYTE,r.BYTE,t),n=c(u.KANJI,r.KANJI,t)):(e=c(u.BYTE_KANJI,r.BYTE,t),n=[]),o.concat(i,e,n).sort((function(t,r){return t.index-r.index})).map((function(t){return{data:t.data,mode:t.mode,length:t.length}}))}function d(t,o){switch(o){case r.NUMERIC:return e.getBitsLength(t);case r.ALPHANUMERIC:return n.getBitsLength(t);case r.KANJI:return a.getBitsLength(t);case r.BYTE:return i.getBitsLength(t)}}function l(t,o){var u,f=r.getBestModeForData(t);if((u=r.from(o,f))!==r.BYTE&&u.bit<f.bit)throw new Error('"'+t+'" cannot be encoded with mode '+r.toString(u)+".\n Suggested mode is: "+r.toString(f));switch(u!==r.KANJI||s.isKanjiModeEnabled()||(u=r.BYTE),u){case r.NUMERIC:return new e(t);case r.ALPHANUMERIC:return new n(t);case r.KANJI:return new a(t);case r.BYTE:return new i(t)}}t.fromArray=function(t){return t.reduce((function(t,r){return"string"==typeof r?t.push(l(r,null)):r.data&&t.push(l(r.data,r.mode)),t}),[])},t.fromString=function(e,n){for(var o=function(t){for(var e=[],n=0;n<t.length;n++){var o=t[n];switch(o.mode){case r.NUMERIC:e.push([o,{data:o.data,mode:r.ALPHANUMERIC,length:o.length},{data:o.data,mode:r.BYTE,length:o.length}]);break;case r.ALPHANUMERIC:e.push([o,{data:o.data,mode:r.BYTE,length:o.length}]);break;case r.KANJI:e.push([o,{data:o.data,mode:r.BYTE,length:h(o.data)}]);break;case r.BYTE:e.push([{data:o.data,mode:r.BYTE,length:h(o.data)}])}}return e}(g(e,s.isKanjiModeEnabled())),i=function(t,e){for(var n={},o={start:{}},i=["start"],a=0;a<t.length;a++){for(var u=t[a],s=[],f=0;f<u.length;f++){var h=u[f],c=""+a+f;s.push(c),n[c]={node:h,lastCount:0},o[c]={};for(var g=0;g<i.length;g++){var l=i[g];n[l]&&n[l].node.mode===h.mode?(o[l][c]=d(n[l].lastCount+h.length,h.mode)-d(n[l].lastCount,h.mode),n[l].lastCount+=h.length):(n[l]&&(n[l].lastCount=h.length),o[l][c]=d(h.length,h.mode)+4+r.getCharCountIndicator(h.mode,e))}}i=s}for(var v=0;v<i.length;v++)o[i[v]].end=0;return{map:o,table:n}}(o,n),a=f.find_path(i.map,"start","end"),u=[],c=1;c<a.length-1;c++)u.push(i.table[a[c]].node);return t.fromArray(function(t){return t.reduce((function(t,r){var e=t.length-1>=0?t[t.length-1]:null;return e&&e.mode===r.mode?(t[t.length-1].data+=r.data,t):(t.push(r),t)}),[])}(u))},t.rawSplit=function(r){return t.fromArray(g(r,s.isKanjiModeEnabled()))}}(H);var et=o,nt=a,ot=s,it=h,at=c,ut=g,st=l,ft=v,ht=M,ct=T,gt=F,dt=N,lt=H;function vt(t,r,e){var n,o,i=t.size,a=gt.getEncodedBits(r,e);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 pt(t,r,e){var n=new ot;e.forEach((function(r){n.put(r.mode.bit,4),n.put(r.getLength(),dt.getCharCountIndicator(r.mode,t)),r.write(n)}));var o=8*(et.getSymbolTotalCodewords(t)-ft.getTotalCodewordsCount(t,r));for(n.getLengthInBits()+4<=o&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(0);for(var i=(o-n.getLengthInBits())/8,a=0;a<i;a++)n.put(a%2?17:236,8);return function(t,r,e){for(var n=et.getSymbolTotalCodewords(r),o=ft.getTotalCodewordsCount(r,e),i=n-o,a=ft.getBlocksCount(r,e),u=a-n%a,s=Math.floor(n/a),f=Math.floor(i/a),h=f+1,c=s-f,g=new ht(c),d=0,l=new Array(a),v=new Array(a),p=0,w=new Uint8Array(t.buffer),m=0;m<a;m++){var E=m<u?f:h;l[m]=w.slice(d,d+E),v[m]=g.encode(l[m]),d+=E,p=Math.max(p,E)}var y,A,C=new Uint8Array(n),B=0;for(y=0;y<p;y++)for(A=0;A<a;A++)y<l[A].length&&(C[B++]=l[A][y]);for(y=0;y<c;y++)for(A=0;A<a;A++)C[B++]=v[A][y];return C}(n,t,r)}function wt(t,r,e,n){var o;if(Array.isArray(t))o=lt.fromArray(t);else{if("string"!=typeof t)throw new Error("Invalid data");var i=r;if(!i){var a=lt.rawSplit(t);i=ct.getBestVersionForData(a,e)}o=lt.fromString(t,i||40)}var u=ct.getBestVersionForData(o,e);if(!u)throw new Error("The amount of data is too big to be stored in a QR Code");if(r){if(r<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 r=u;var s=pt(r,e,o),f=et.getSymbolSize(r),h=new it(f);return function(t,r){for(var e=t.size,n=ut.getPositions(r),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||e<=i+u))for(var s=-1;s<=7;s++)a+s<=-1||e<=a+s||(u>=0&&u<=6&&(0===s||6===s)||s>=0&&s<=6&&(0===u||6===u)||u>=2&&u<=4&&s>=2&&s<=4?t.set(i+u,a+s,!0,!0):t.set(i+u,a+s,!1,!0))}(h,r),function(t){for(var r=t.size,e=8;e<r-8;e++){var n=e%2==0;t.set(e,6,n,!0),t.set(6,e,n,!0)}}(h),function(t,r){for(var e=at.getPositions(r),n=0;n<e.length;n++)for(var o=e[n][0],i=e[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)}(h,r),vt(h,e,0),r>=7&&function(t,r){for(var e,n,o,i=t.size,a=ct.getEncodedBits(r),u=0;u<18;u++)e=Math.floor(u/3),n=u%3+i-8-3,o=1==(a>>u&1),t.set(e,n,o,!0),t.set(n,e,o,!0)}(h,r),function(t,r){for(var e=t.size,n=-1,o=e-1,i=7,a=0,u=e-1;u>0;u-=2)for(6===u&&u--;;){for(var s=0;s<2;s++)if(!t.isReserved(o,u-s)){var f=!1;a<r.length&&(f=1==(r[a]>>>i&1)),t.set(o,u-s,f),-1==--i&&(a++,i=7)}if((o+=n)<0||e<=o){o-=n,n=-n;break}}}(h,s),isNaN(n)&&(n=st.getBestMask(h,vt.bind(null,h,e))),st.applyMask(n,h),vt(h,e,n),{modules:h,version:r,errorCorrectionLevel:e,maskPattern:n,segments:o}}n.create=function(t,r){if(void 0===t||""===t)throw new Error("No input text");var e,n,o=nt.M;return void 0!==r&&(o=nt.from(r.errorCorrectionLevel,nt.M),e=ct.from(r.version),n=st.from(r.maskPattern),r.toSJISFunc&&et.setToSJISFunction(r.toSJISFunc)),wt(t,e,o,n)};var mt={},Et={};!function(t){function r(t){if("number"==typeof t&&(t=t.toString()),"string"!=typeof t)throw new Error("Color should be defined as hex string");var r=t.slice().replace("#","").split("");if(r.length<3||5===r.length||r.length>8)throw new Error("Invalid hex color: "+t);3!==r.length&&4!==r.length||(r=Array.prototype.concat.apply([],r.map((function(t){return[t,t]})))),6===r.length&&r.push("F","F");var e=parseInt(r.join(""),16);return{r:e>>24&255,g:e>>16&255,b:e>>8&255,a:255&e,hex:"#"+r.slice(0,6).join("")}}t.getOptions=function(t){t||(t={}),t.color||(t.color={});var e=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,n=t.width&&t.width>=21?t.width:void 0,o=t.scale||4;return{width:n,scale:n?4:o,margin:e,color:{dark:r(t.color.dark||"#000000ff"),light:r(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},t.getScale=function(t,r){return r.width&&r.width>=t+2*r.margin?r.width/(t+2*r.margin):r.scale},t.getImageWidth=function(r,e){var n=t.getScale(r,e);return Math.floor((r+2*e.margin)*n)},t.qrToImageData=function(r,e,n){for(var o=e.modules.size,i=e.modules.data,a=t.getScale(o,n),u=Math.floor((o+2*n.margin)*a),s=n.margin*a,f=[n.color.light,n.color.dark],h=0;h<u;h++)for(var c=0;c<u;c++){var g=4*(h*u+c),d=n.color.light;h>=s&&c>=s&&h<u-s&&c<u-s&&(d=f[i[Math.floor((h-s)/a)*o+Math.floor((c-s)/a)]?1:0]),r[g++]=d.r,r[g++]=d.g,r[g++]=d.b,r[g]=d.a}}}(Et),function(t){var r=Et;t.render=function(t,e,n){var o=n,i=e;void 0!==o||e&&e.getContext||(o=e,e=void 0),e||(i=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),o=r.getOptions(o);var a=r.getImageWidth(t.modules.size,o),u=i.getContext("2d"),s=u.createImageData(a,a);return r.qrToImageData(s.data,t,o),function(t,r,e){t.clearRect(0,0,r.width,r.height),r.style||(r.style={}),r.height=e,r.width=e,r.style.height=e+"px",r.style.width=e+"px"}(u,i,a),u.putImageData(s,0,0),i},t.renderToDataURL=function(r,e,n){var o=n;void 0!==o||e&&e.getContext||(o=e,e=void 0),o||(o={});var i=t.render(r,e,o),a=o.type||"image/png",u=o.rendererOpts||{};return i.toDataURL(a,u.quality)}}(mt);var yt={},At=Et;function Ct(t,r){var e=t.a/255,n=r+'="'+t.hex+'"';return e<1?n+" "+r+'-opacity="'+e.toFixed(2).slice(1)+'"':n}function Bt(t,r,e){var n=t+r;return void 0!==e&&(n+=" "+e),n}yt.render=function(t,r,e){var n=At.getOptions(r),o=t.modules.size,i=t.modules.data,a=o+2*n.margin,u=n.color.light.a?"<path "+Ct(n.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",s="<path "+Ct(n.color.dark,"stroke")+' d="'+function(t,r,e){for(var n="",o=0,i=!1,a=0,u=0;u<t.length;u++){var s=Math.floor(u%r),f=Math.floor(u/r);s||i||(i=!0),t[u]?(a++,u>0&&s>0&&t[u-1]||(n+=i?Bt("M",s+e,.5+f+e):Bt("m",o,0),o=0,i=!1),s+1<r&&t[u+1]||(n+=Bt("h",a),a=0)):o++}return n}(i,o,n.margin)+'"/>',f='viewBox="0 0 '+a+" "+a+'"',h='<svg xmlns="http://www.w3.org/2000/svg" '+(n.width?'width="'+n.width+'" height="'+n.width+'" ':"")+f+' shape-rendering="crispEdges">'+u+s+"</svg>\n";return"function"==typeof e&&e(null,h),h};var It=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then},Mt=n,Tt=mt,Nt=yt;function Pt(t,r,e,n,o){var i=[].slice.call(arguments,1),a=i.length,u="function"==typeof i[a-1];if(!u&&!It())throw new Error("Callback required as last argument");if(!u){if(a<1)throw new Error("Too few arguments provided");return 1===a?(e=r,r=n=void 0):2!==a||r.getContext||(n=e,e=r,r=void 0),new Promise((function(o,i){try{var a=Mt.create(e,n);o(t(a,r,n))}catch(u){i(u)}}))}if(a<2)throw new Error("Too few arguments provided");2===a?(o=e,e=r,r=n=void 0):3===a&&(r.getContext&&void 0===o?(o=n,n=void 0):(o=n,n=e,e=r,r=void 0));try{var s=Mt.create(e,n);o(null,t(s,r,n))}catch(f){o(f)}}e.create=Mt.create,e.toCanvas=Pt.bind(null,Tt.render),e.toDataURL=Pt.bind(null,Tt.renderToDataURL),e.toString=Pt.bind(null,(function(t,r,e){return Nt.render(t,e)}))}}}));