UNPKG

bitcoin-qr

Version:

A zero-dependency, zero-framework QR code web component for Bitcoin on-chain, Lightning, and unified BIP-21 payments.

1 lines 56.6 kB
import{r as t,h as r,g as i}from"./p-a1ecfd5f.js";function n(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var o={exports:{}};self,o.exports=(()=>{var t={192:(t,r)=>{var i,n,o=function(){var t=function(t,r){var i=t,n=a[r],o=null,e=0,s=null,g=[],p={},y=function(t,r){o=function(t){for(var r=new Array(t),i=0;i<t;i+=1){r[i]=new Array(t);for(var n=0;n<t;n+=1)r[i][n]=null}return r}(e=4*i+17),m(0,0),m(e-7,0),m(0,e-7),x(),M(),k(t,r),i>=7&&S(t),null==s&&(s=q(i,n,g)),z(s,r)},m=function(t,r){for(var i=-1;i<=7;i+=1)if(!(t+i<=-1||e<=t+i))for(var n=-1;n<=7;n+=1)r+n<=-1||e<=r+n||(o[t+i][r+n]=0<=i&&i<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==i||6==i)||2<=i&&i<=4&&2<=n&&n<=4)},M=function(){for(var t=8;t<e-8;t+=1)null==o[t][6]&&(o[t][6]=t%2==0);for(var r=8;r<e-8;r+=1)null==o[6][r]&&(o[6][r]=r%2==0)},x=function(){for(var t=u.getPatternPosition(i),r=0;r<t.length;r+=1)for(var n=0;n<t.length;n+=1){var e=t[r],a=t[n];if(null==o[e][a])for(var s=-2;s<=2;s+=1)for(var c=-2;c<=2;c+=1)o[e+s][a+c]=-2==s||2==s||-2==c||2==c||0==s&&0==c}},S=function(t){for(var r=u.getBCHTypeNumber(i),n=0;n<18;n+=1){var a=!t&&1==(r>>n&1);o[Math.floor(n/3)][n%3+e-8-3]=a}for(n=0;n<18;n+=1)a=!t&&1==(r>>n&1),o[n%3+e-8-3][Math.floor(n/3)]=a},k=function(t,r){for(var i=u.getBCHTypeInfo(n<<3|r),a=0;a<15;a+=1){var s=!t&&1==(i>>a&1);a<6?o[a][8]=s:a<8?o[a+1][8]=s:o[e-15+a][8]=s}for(a=0;a<15;a+=1)s=!t&&1==(i>>a&1),a<8?o[8][e-a-1]=s:a<9?o[8][15-a-1+1]=s:o[8][15-a-1]=s;o[e-8][8]=!t},z=function(t,r){for(var i=-1,n=e-1,a=7,s=0,c=u.getMaskFunction(r),h=e-1;h>0;h-=2)for(6==h&&(h-=1);;){for(var f=0;f<2;f+=1)if(null==o[n][h-f]){var v=!1;s<t.length&&(v=1==(t[s]>>>a&1)),c(n,h-f)&&(v=!v),o[n][h-f]=v,-1==(a-=1)&&(s+=1,a=7)}if((n+=i)<0||e<=n){n-=i,i=-i;break}}},q=function(t,r,i){for(var n=h.getRSBlocks(t,r),o=f(),e=0;e<i.length;e+=1){var a=i[e];o.put(a.getMode(),4),o.put(a.getLength(),u.getLengthInBits(a.getMode(),t)),a.write(o)}var s=0;for(e=0;e<n.length;e+=1)s+=n[e].dataCount;if(o.getLengthInBits()>8*s)throw"code length overflow. ("+o.getLengthInBits()+">"+8*s+")";for(o.getLengthInBits()+4<=8*s&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(!1);for(;!(o.getLengthInBits()>=8*s||(o.put(236,8),o.getLengthInBits()>=8*s));)o.put(17,8);return function(t,r){for(var i=0,n=0,o=0,e=new Array(r.length),a=new Array(r.length),s=0;s<r.length;s+=1){var h=r[s].dataCount,f=r[s].totalCount-h;n=Math.max(n,h),o=Math.max(o,f),e[s]=new Array(h);for(var v=0;v<e[s].length;v+=1)e[s][v]=255&t.getBuffer()[v+i];i+=h;var d=u.getErrorCorrectPolynomial(f),l=c(e[s],d.getLength()-1).mod(d);for(a[s]=new Array(d.getLength()-1),v=0;v<a[s].length;v+=1){var w=v+l.getLength()-a[s].length;a[s][v]=w>=0?l.getAt(w):0}}var g=0;for(v=0;v<r.length;v+=1)g+=r[v].totalCount;var p=new Array(g),b=0;for(v=0;v<n;v+=1)for(s=0;s<r.length;s+=1)v<e[s].length&&(p[b]=e[s][v],b+=1);for(v=0;v<o;v+=1)for(s=0;s<r.length;s+=1)v<a[s].length&&(p[b]=a[s][v],b+=1);return p}(o,n)};p.addData=function(t,r){var i=null;switch(r=r||"Byte"){case"Numeric":i=v(t);break;case"Alphanumeric":i=d(t);break;case"Byte":i=l(t);break;case"Kanji":i=w(t);break;default:throw"mode:"+r}g.push(i),s=null},p.isDark=function(t,r){if(t<0||e<=t||r<0||e<=r)throw t+","+r;return o[t][r]},p.getModuleCount=function(){return e},p.make=function(){if(i<1){for(var t=1;t<40;t++){for(var r=h.getRSBlocks(t,n),o=f(),e=0;e<g.length;e++){var a=g[e];o.put(a.getMode(),4),o.put(a.getLength(),u.getLengthInBits(a.getMode(),t)),a.write(o)}var s=0;for(e=0;e<r.length;e++)s+=r[e].dataCount;if(o.getLengthInBits()<=8*s)break}i=t}y(!1,function(){for(var t=0,r=0,i=0;i<8;i+=1){y(!0,i);var n=u.getLostPoint(p);(0==i||t>n)&&(t=n,r=i)}return r}())},p.createTableTag=function(t,r){t=t||2;var i="";i+='<table style="',i+=" border-width: 0px; border-style: none;",i+=" border-collapse: collapse;",i+=" padding: 0px; margin: "+(r=void 0===r?4*t:r)+"px;",i+='">',i+="<tbody>";for(var n=0;n<p.getModuleCount();n+=1){i+="<tr>";for(var o=0;o<p.getModuleCount();o+=1)i+='<td style="',i+=" border-width: 0px; border-style: none;",i+=" border-collapse: collapse;",i+=" padding: 0px; margin: 0px;",i+=" width: "+t+"px;",i+=" height: "+t+"px;",i+=" background-color: ",i+=p.isDark(n,o)?"#000000":"#ffffff",i+=";",i+='"/>';i+="</tr>"}return(i+="</tbody>")+"</table>"},p.createSvgTag=function(t,r,i,n){var o={};"object"==typeof arguments[0]&&(t=(o=arguments[0]).cellSize,r=o.margin,i=o.alt,n=o.title),t=t||2,r=void 0===r?4*t:r,(i="string"==typeof i?{text:i}:i||{}).text=i.text||null,i.id=i.text?i.id||"qrcode-description":null,(n="string"==typeof n?{text:n}:n||{}).text=n.text||null,n.id=n.text?n.id||"qrcode-title":null;var e,a,u,s,c=p.getModuleCount()*t+2*r,h="";for(s="l"+t+",0 0,"+t+" -"+t+",0 0,-"+t+"z ",h+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',h+=o.scalable?"":' width="'+c+'px" height="'+c+'px"',h+=' viewBox="0 0 '+c+" "+c+'" ',h+=' preserveAspectRatio="xMinYMin meet"',h+=n.text||i.text?' role="img" aria-labelledby="'+O([n.id,i.id].join(" ").trim())+'"':"",h+=">",h+=n.text?'<title id="'+O(n.id)+'">'+O(n.text)+"</title>":"",h+=i.text?'<description id="'+O(i.id)+'">'+O(i.text)+"</description>":"",h+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',h+='<path d="',a=0;a<p.getModuleCount();a+=1)for(u=a*t+r,e=0;e<p.getModuleCount();e+=1)p.isDark(a,e)&&(h+="M"+(e*t+r)+","+u+s);return(h+='" stroke="transparent" fill="black"/>')+"</svg>"},p.createDataURL=function(t,r){t=t||2,r=void 0===r?4*t:r;var i=p.getModuleCount()*t+2*r,n=r,o=i-r;return b(i,i,(function(r,i){if(n<=r&&r<o&&n<=i&&i<o){var e=Math.floor((r-n)/t),a=Math.floor((i-n)/t);return p.isDark(a,e)?0:1}return 1}))},p.createImgTag=function(t,r,i){t=t||2,r=void 0===r?4*t:r;var n=p.getModuleCount()*t+2*r,o="";return o+="<img",o+=' src="',o+=p.createDataURL(t,r),o+='"',o+=' width="',o+=n,o+='"',o+=' height="',o+=n,o+='"',i&&(o+=' alt="',o+=O(i),o+='"'),o+"/>"};var O=function(t){for(var r="",i=0;i<t.length;i+=1){var n=t.charAt(i);switch(n){case"<":r+="&lt;";break;case">":r+="&gt;";break;case"&":r+="&amp;";break;case'"':r+="&quot;";break;default:r+=n}}return r};return p.createASCII=function(t,r){if((t=t||1)<2)return function(t){t=void 0===t?2:t;var r,i,n,o,e,a=1*p.getModuleCount()+2*t,u=t,s=a-t,c={"██":"█","█ ":"▀"," █":"▄"," ":" "},h={"██":"▀","█ ":"▀"," █":" "," ":" "},f="";for(r=0;r<a;r+=2){for(n=Math.floor((r-u)/1),o=Math.floor((r+1-u)/1),i=0;i<a;i+=1)e="█",u<=i&&i<s&&u<=r&&r<s&&p.isDark(n,Math.floor((i-u)/1))&&(e=" "),u<=i&&i<s&&u<=r+1&&r+1<s&&p.isDark(o,Math.floor((i-u)/1))?e+=" ":e+="█",f+=t<1&&r+1>=s?h[e]:c[e];f+="\n"}return a%2&&t>0?f.substring(0,f.length-a-1)+Array(a+1).join("▀"):f.substring(0,f.length-1)}(r);t-=1,r=void 0===r?2*t:r;var i,n,o,e,a=p.getModuleCount()*t+2*r,u=r,s=a-r,c=Array(t+1).join("██"),h=Array(t+1).join(" "),f="",v="";for(i=0;i<a;i+=1){for(o=Math.floor((i-u)/t),v="",n=0;n<a;n+=1)e=1,u<=n&&n<s&&u<=i&&i<s&&p.isDark(o,Math.floor((n-u)/t))&&(e=0),v+=e?c:h;for(o=0;o<t;o+=1)f+=v+"\n"}return f.substring(0,f.length-1)},p.renderTo2dContext=function(t,r){r=r||2;for(var i=p.getModuleCount(),n=0;n<i;n++)for(var o=0;o<i;o++)t.fillStyle=p.isDark(n,o)?"black":"white",t.fillRect(n*r,o*r,r,r)},p};t.stringToBytes=(t.stringToBytesFuncs={default:function(t){for(var r=[],i=0;i<t.length;i+=1){var n=t.charCodeAt(i);r.push(255&n)}return r}}).default,t.createStringToBytes=function(t,r){var i=function(){for(var i=p(t),n=function(){var t=i.read();if(-1==t)throw"eof";return t},o=0,e={};;){var a=i.read();if(-1==a)break;var u=n(),s=n()<<8|n();e[String.fromCharCode(a<<8|u)]=s,o+=1}if(o!=r)throw o+" != "+r;return e}(),n="?".charCodeAt(0);return function(t){for(var r=[],o=0;o<t.length;o+=1){var e=t.charCodeAt(o);if(e<128)r.push(e);else{var a=i[t.charAt(o)];"number"==typeof a?(255&a)==a?r.push(a):(r.push(a>>>8),r.push(255&a)):r.push(n)}}return r}};var r,i,n,o,e,a={L:1,M:0,Q:3,H:2},u=(r=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],i=1335,n=7973,e=function(t){for(var r=0;0!=t;)r+=1,t>>>=1;return r},(o={}).getBCHTypeInfo=function(t){for(var r=t<<10;e(r)-e(i)>=0;)r^=i<<e(r)-e(i);return 21522^(t<<10|r)},o.getBCHTypeNumber=function(t){for(var r=t<<12;e(r)-e(n)>=0;)r^=n<<e(r)-e(n);return t<<12|r},o.getPatternPosition=function(t){return r[t-1]},o.getMaskFunction=function(t){switch(t){case 0:return function(t,r){return(t+r)%2==0};case 1:return function(t){return t%2==0};case 2:return function(t,r){return r%3==0};case 3:return function(t,r){return(t+r)%3==0};case 4:return function(t,r){return(Math.floor(t/2)+Math.floor(r/3))%2==0};case 5:return function(t,r){return t*r%2+t*r%3==0};case 6:return function(t,r){return(t*r%2+t*r%3)%2==0};case 7:return function(t,r){return(t*r%3+(t+r)%2)%2==0};default:throw"bad maskPattern:"+t}},o.getErrorCorrectPolynomial=function(t){for(var r=c([1],0),i=0;i<t;i+=1)r=r.multiply(c([1,s.gexp(i)],0));return r},o.getLengthInBits=function(t,r){if(1<=r&&r<10)switch(t){case 1:return 10;case 2:return 9;case 4:case 8:return 8;default:throw"mode:"+t}else if(r<27)switch(t){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw"mode:"+t}else{if(!(r<41))throw"type:"+r;switch(t){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw"mode:"+t}}},o.getLostPoint=function(t){for(var r=t.getModuleCount(),i=0,n=0;n<r;n+=1)for(var o=0;o<r;o+=1){for(var e=0,a=t.isDark(n,o),u=-1;u<=1;u+=1)if(!(n+u<0||r<=n+u))for(var s=-1;s<=1;s+=1)o+s<0||r<=o+s||0==u&&0==s||a==t.isDark(n+u,o+s)&&(e+=1);e>5&&(i+=3+e-5)}for(n=0;n<r-1;n+=1)for(o=0;o<r-1;o+=1){var c=0;t.isDark(n,o)&&(c+=1),t.isDark(n+1,o)&&(c+=1),t.isDark(n,o+1)&&(c+=1),t.isDark(n+1,o+1)&&(c+=1),0!=c&&4!=c||(i+=3)}for(n=0;n<r;n+=1)for(o=0;o<r-6;o+=1)t.isDark(n,o)&&!t.isDark(n,o+1)&&t.isDark(n,o+2)&&t.isDark(n,o+3)&&t.isDark(n,o+4)&&!t.isDark(n,o+5)&&t.isDark(n,o+6)&&(i+=40);for(o=0;o<r;o+=1)for(n=0;n<r-6;n+=1)t.isDark(n,o)&&!t.isDark(n+1,o)&&t.isDark(n+2,o)&&t.isDark(n+3,o)&&t.isDark(n+4,o)&&!t.isDark(n+5,o)&&t.isDark(n+6,o)&&(i+=40);var h=0;for(o=0;o<r;o+=1)for(n=0;n<r;n+=1)t.isDark(n,o)&&(h+=1);return i+Math.abs(100*h/r/r-50)/5*10},o),s=function(){for(var t=new Array(256),r=new Array(256),i=0;i<8;i+=1)t[i]=1<<i;for(i=8;i<256;i+=1)t[i]=t[i-4]^t[i-5]^t[i-6]^t[i-8];for(i=0;i<255;i+=1)r[t[i]]=i;return{glog:function(t){if(t<1)throw"glog("+t+")";return r[t]},gexp:function(r){for(;r<0;)r+=255;for(;r>=256;)r-=255;return t[r]}}}();function c(t,r){if(void 0===t.length)throw t.length+"/"+r;var i=function(){for(var i=0;i<t.length&&0==t[i];)i+=1;for(var n=new Array(t.length-i+r),o=0;o<t.length-i;o+=1)n[o]=t[o+i];return n}(),n={getAt:function(t){return i[t]},getLength:function(){return i.length},multiply:function(t){for(var r=new Array(n.getLength()+t.getLength()-1),i=0;i<n.getLength();i+=1)for(var o=0;o<t.getLength();o+=1)r[i+o]^=s.gexp(s.glog(n.getAt(i))+s.glog(t.getAt(o)));return c(r,0)},mod:function(t){if(n.getLength()-t.getLength()<0)return n;for(var r=s.glog(n.getAt(0))-s.glog(t.getAt(0)),i=new Array(n.getLength()),o=0;o<n.getLength();o+=1)i[o]=n.getAt(o);for(o=0;o<t.getLength();o+=1)i[o]^=s.gexp(s.glog(t.getAt(o))+r);return c(i,0).mod(t)}};return n}var h=function(){var t=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],r=function(t,r){var i={};return i.totalCount=t,i.dataCount=r,i},i={getRSBlocks:function(i,n){var o=function(r,i){switch(i){case a.L:return t[4*(r-1)+0];case a.M:return t[4*(r-1)+1];case a.Q:return t[4*(r-1)+2];case a.H:return t[4*(r-1)+3];default:return}}(i,n);if(void 0===o)throw"bad rs block @ typeNumber:"+i+"/errorCorrectionLevel:"+n;for(var e=o.length/3,u=[],s=0;s<e;s+=1)for(var c=o[3*s+0],h=o[3*s+1],f=o[3*s+2],v=0;v<c;v+=1)u.push(r(h,f));return u}};return i}(),f=function(){var t=[],r=0,i={getBuffer:function(){return t},getAt:function(r){var i=Math.floor(r/8);return 1==(t[i]>>>7-r%8&1)},put:function(t,r){for(var n=0;n<r;n+=1)i.putBit(1==(t>>>r-n-1&1))},getLengthInBits:function(){return r},putBit:function(i){var n=Math.floor(r/8);t.length<=n&&t.push(0),i&&(t[n]|=128>>>r%8),r+=1}};return i},v=function(t){var r=t,i={getMode:function(){return 1},getLength:function(){return r.length},write:function(t){for(var i=r,o=0;o+2<i.length;)t.put(n(i.substring(o,o+3)),10),o+=3;o<i.length&&(i.length-o==1?t.put(n(i.substring(o,o+1)),4):i.length-o==2&&t.put(n(i.substring(o,o+2)),7))}},n=function(t){for(var r=0,i=0;i<t.length;i+=1)r=10*r+o(t.charAt(i));return r},o=function(t){if("0"<=t&&t<="9")return t.charCodeAt(0)-"0".charCodeAt(0);throw"illegal char :"+t};return i},d=function(t){var r=t,i={getMode:function(){return 2},getLength:function(){return r.length},write:function(t){for(var i=r,o=0;o+1<i.length;)t.put(45*n(i.charAt(o))+n(i.charAt(o+1)),11),o+=2;o<i.length&&t.put(n(i.charAt(o)),6)}},n=function(t){if("0"<=t&&t<="9")return t.charCodeAt(0)-"0".charCodeAt(0);if("A"<=t&&t<="Z")return t.charCodeAt(0)-"A".charCodeAt(0)+10;switch(t){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+t}};return i},l=function(r){var i=t.stringToBytes(r);return{getMode:function(){return 4},getLength:function(){return i.length},write:function(t){for(var r=0;r<i.length;r+=1)t.put(i[r],8)}}},w=function(r){var i=t.stringToBytesFuncs.SJIS;if(!i)throw"sjis not supported.";!function(){var t=i("友");if(2!=t.length||38726!=(t[0]<<8|t[1]))throw"sjis not supported."}();var n=i(r);return{getMode:function(){return 8},getLength:function(){return~~(n.length/2)},write:function(t){for(var r=n,i=0;i+1<r.length;){var o=(255&r[i])<<8|255&r[i+1];if(33088<=o&&o<=40956)o-=33088;else{if(!(57408<=o&&o<=60351))throw"illegal char at "+(i+1)+"/"+o;o-=49472}t.put(o=192*(o>>>8&255)+(255&o),13),i+=2}if(i<r.length)throw"illegal char at "+(i+1)}}},g=function(){var t=[],r={writeByte:function(r){t.push(255&r)},writeShort:function(t){r.writeByte(t),r.writeByte(t>>>8)},writeBytes:function(t,i,n){i=i||0,n=n||t.length;for(var o=0;o<n;o+=1)r.writeByte(t[o+i])},writeString:function(t){for(var i=0;i<t.length;i+=1)r.writeByte(t.charCodeAt(i))},toByteArray:function(){return t},toString:function(){var r="";r+="[";for(var i=0;i<t.length;i+=1)i>0&&(r+=","),r+=t[i];return r+"]"}};return r},p=function(t){var r=t,i=0,n=0,o=0,e={read:function(){for(;o<8;){if(i>=r.length){if(0==o)return-1;throw"unexpected end of file./"+o}var t=r.charAt(i);if(i+=1,"="==t)return o=0,-1;t.match(/^\s$/)||(n=n<<6|a(t.charCodeAt(0)),o+=6)}var e=n>>>o-8&255;return o-=8,e}},a=function(t){if(65<=t&&t<=90)return t-65;if(97<=t&&t<=122)return t-97+26;if(48<=t&&t<=57)return t-48+52;if(43==t)return 62;if(47==t)return 63;throw"c:"+t};return e},b=function(t,r,i){for(var n=function(t,r){var i=t,n=r,o=new Array(t*r),e={setPixel:function(t,r,n){o[r*i+t]=n},write:function(t){t.writeString("GIF87a"),t.writeShort(i),t.writeShort(n),t.writeByte(128),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(255),t.writeByte(255),t.writeByte(255),t.writeString(","),t.writeShort(0),t.writeShort(0),t.writeShort(i),t.writeShort(n),t.writeByte(0);var r=a(2);t.writeByte(2);for(var o=0;r.length-o>255;)t.writeByte(255),t.writeBytes(r,o,255),o+=255;t.writeByte(r.length-o),t.writeBytes(r,o,r.length-o),t.writeByte(0),t.writeString(";")}},a=function(t){for(var r=1<<t,i=1+(1<<t),n=t+1,e=u(),a=0;a<r;a+=1)e.add(String.fromCharCode(a));e.add(String.fromCharCode(r)),e.add(String.fromCharCode(i));var s,c,h,f=g(),v=(s=f,c=0,h=0,{write:function(t,r){if(t>>>r!=0)throw"length over";for(;c+r>=8;)s.writeByte(255&(t<<c|h)),r-=8-c,t>>>=8-c,h=0,c=0;h|=t<<c,c+=r},flush:function(){c>0&&s.writeByte(h)}});v.write(r,n);var d=0,l=String.fromCharCode(o[d]);for(d+=1;d<o.length;){var w=String.fromCharCode(o[d]);d+=1,e.contains(l+w)?l+=w:(v.write(e.indexOf(l),n),e.size()<4095&&(e.size()==1<<n&&(n+=1),e.add(l+w)),l=w)}return v.write(e.indexOf(l),n),v.write(i,n),v.flush(),f.toByteArray()},u=function(){var t={},r=0,i={add:function(n){if(i.contains(n))throw"dup key:"+n;t[n]=r,r+=1},size:function(){return r},indexOf:function(r){return t[r]},contains:function(r){return void 0!==t[r]}};return i};return e}(t,r),o=0;o<r;o+=1)for(var e=0;e<t;e+=1)n.setPixel(e,o,i(e,o));var a=g();n.write(a);for(var u=function(){var t=0,r=0,i=0,n="",o={},e=function(t){n+=String.fromCharCode(a(63&t))},a=function(t){if(t<0);else{if(t<26)return 65+t;if(t<52)return t-26+97;if(t<62)return t-52+48;if(62==t)return 43;if(63==t)return 47}throw"n:"+t};return o.writeByte=function(n){for(t=t<<8|255&n,r+=8,i+=1;r>=6;)e(t>>>r-6),r-=6},o.flush=function(){if(r>0&&(e(t<<6-r),t=0,r=0),i%3!=0)for(var o=3-i%3,a=0;a<o;a+=1)n+="="},o.toString=function(){return n},o}(),s=a.toByteArray(),c=0;c<s.length;c+=1)u.writeByte(s[c]);return u.flush(),"data:image/gif;base64,"+u};return t}();o.stringToBytesFuncs["UTF-8"]=function(t){return function(t){for(var r=[],i=0;i<t.length;i++){var n=t.charCodeAt(i);n<128?r.push(n):n<2048?r.push(192|n>>6,128|63&n):n<55296||n>=57344?r.push(224|n>>12,128|n>>6&63,128|63&n):(i++,n=65536+((1023&n)<<10|1023&t.charCodeAt(i)),r.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return r}(t)},void 0===(n="function"==typeof(i=function(){return o})?i.apply(r,[]):i)||(t.exports=n)},676:(t,r,i)=>{i.d(r,{default:()=>P});var n=function(){return(n=Object.assign||function(t){for(var r,i=1,n=arguments.length;i<n;i++)for(var o in r=arguments[i])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},o=function(t){return!!t&&"object"==typeof t&&!Array.isArray(t)};function e(t){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];if(!r.length)return t;var a=r.shift();return void 0!==a&&o(t)&&o(a)?(t=n({},t),Object.keys(a).forEach((function(r){var i=t[r],n=a[r];t[r]=Array.isArray(i)&&Array.isArray(n)?n:o(i)&&o(n)?e(Object.assign({},i),n):n})),e.apply(void 0,function(){for(var t=0,r=0,i=arguments.length;r<i;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<i;r++)for(var e=arguments[r],a=0,u=e.length;a<u;a++,o++)n[o]=e[a];return n}([t],r))):t}function a(t,r){var i=document.createElement("a");i.download=r,i.href=t,document.body.appendChild(i),i.click(),document.body.removeChild(i)}function u(t){return r=this,void 0,n=function(){return function(t,r){var i,n,o,e,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return e={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function u(e){return function(u){return function(e){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(o=2&e[0]?n.return:e[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,e[1])).done)return o;switch(n=0,o&&(e=[2&e[0],o.value]),e[0]){case 0:case 1:o=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,n=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==e[0]&&2!==e[0])){a=0;continue}if(3===e[0]&&(!o||e[1]>o[0]&&e[1]<o[3])){a.label=e[1];break}if(6===e[0]&&a.label<o[1]){a.label=o[1],o=e;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(e);break}o[2]&&a.ops.pop(),a.trys.pop();continue}e=r.call(t,a)}catch(t){e=[6,t],n=0}finally{i=o=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,u])}}}(this,(function(){return[2,new Promise((function(r){var i=new XMLHttpRequest;i.onload=function(){var t=new FileReader;t.onloadend=function(){r(t.result)},t.readAsDataURL(i.response)},i.open("GET",t),i.responseType="blob",i.send()}))]}))},new((i=void 0)||(i=Promise))((function(t,o){function e(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(r){var n;r.done?t(r.value):(n=r.value,n instanceof i?n:new i((function(t){t(n)}))).then(e,a)}u((n=n.apply(r,[])).next())}));var r,i,n}const s={L:.07,M:.15,Q:.25,H:.3};var c=function(){return(c=Object.assign||function(t){for(var r,i=1,n=arguments.length;i<n;i++)for(var o in r=arguments[i])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)};const h=function(){function t(t){var r=t.type;this._svg=t.svg,this._type=r}return t.prototype.draw=function(t,r,i,n){var o;switch(this._type){case"dots":o=this._drawDot;break;case"classy":o=this._drawClassy;break;case"classy-rounded":o=this._drawClassyRounded;break;case"rounded":o=this._drawRounded;break;case"extra-rounded":o=this._drawExtraRounded;break;default:o=this._drawSquare}o.call(this,{x:t,y:r,size:i,getNeighbor:n})},t.prototype._rotateFigure=function(t){var r,i=t.size,n=t.rotation,o=void 0===n?0:n,e=t.x+i/2,a=t.y+i/2;(0,t.draw)(),null===(r=this._element)||void 0===r||r.setAttribute("transform","rotate("+180*o/Math.PI+","+e+","+a+")")},t.prototype._basicDot=function(t){var r=this,i=t.size,n=t.x,o=t.y;this._rotateFigure(c(c({},t),{draw:function(){r._element=document.createElementNS("http://www.w3.org/2000/svg","circle"),r._element.setAttribute("cx",String(n+i/2)),r._element.setAttribute("cy",String(o+i/2)),r._element.setAttribute("r",String(i/2))}}))},t.prototype._basicSquare=function(t){var r=this,i=t.size,n=t.x,o=t.y;this._rotateFigure(c(c({},t),{draw:function(){r._element=document.createElementNS("http://www.w3.org/2000/svg","rect"),r._element.setAttribute("x",String(n)),r._element.setAttribute("y",String(o)),r._element.setAttribute("width",String(i)),r._element.setAttribute("height",String(i))}}))},t.prototype._basicSideRounded=function(t){var r=this,i=t.size,n=t.x,o=t.y;this._rotateFigure(c(c({},t),{draw:function(){r._element=document.createElementNS("http://www.w3.org/2000/svg","path"),r._element.setAttribute("d","M "+n+" "+o+"v "+i+"h "+i/2+"a "+i/2+" "+i/2+", 0, 0, 0, 0 "+-i)}}))},t.prototype._basicCornerRounded=function(t){var r=this,i=t.size,n=t.x,o=t.y;this._rotateFigure(c(c({},t),{draw:function(){r._element=document.createElementNS("http://www.w3.org/2000/svg","path"),r._element.setAttribute("d","M "+n+" "+o+"v "+i+"h "+i+"v "+-i/2+"a "+i/2+" "+i/2+", 0, 0, 0, "+-i/2+" "+-i/2)}}))},t.prototype._basicCornerExtraRounded=function(t){var r=this,i=t.size,n=t.x,o=t.y;this._rotateFigure(c(c({},t),{draw:function(){r._element=document.createElementNS("http://www.w3.org/2000/svg","path"),r._element.setAttribute("d","M "+n+" "+o+"v "+i+"h "+i+"a "+i+" "+i+", 0, 0, 0, "+-i+" "+-i)}}))},t.prototype._basicCornersRounded=function(t){var r=this,i=t.size,n=t.x,o=t.y;this._rotateFigure(c(c({},t),{draw:function(){r._element=document.createElementNS("http://www.w3.org/2000/svg","path"),r._element.setAttribute("d","M "+n+" "+o+"v "+i/2+"a "+i/2+" "+i/2+", 0, 0, 0, "+i/2+" "+i/2+"h "+i/2+"v "+-i/2+"a "+i/2+" "+i/2+", 0, 0, 0, "+-i/2+" "+-i/2)}}))},t.prototype._drawDot=function(t){this._basicDot({x:t.x,y:t.y,size:t.size,rotation:0})},t.prototype._drawSquare=function(t){this._basicSquare({x:t.x,y:t.y,size:t.size,rotation:0})},t.prototype._drawRounded=function(t){var r=t.x,i=t.y,n=t.size,o=t.getNeighbor,e=o?+o(-1,0):0,a=o?+o(1,0):0,u=o?+o(0,-1):0,s=o?+o(0,1):0,c=e+a+u+s;if(0!==c)if(c>2||e&&a||u&&s)this._basicSquare({x:r,y:i,size:n,rotation:0});else{if(2===c){var h=0;return e&&u?h=Math.PI/2:u&&a?h=Math.PI:a&&s&&(h=-Math.PI/2),void this._basicCornerRounded({x:r,y:i,size:n,rotation:h})}if(1===c)return h=0,u?h=Math.PI/2:a?h=Math.PI:s&&(h=-Math.PI/2),void this._basicSideRounded({x:r,y:i,size:n,rotation:h})}else this._basicDot({x:r,y:i,size:n,rotation:0})},t.prototype._drawExtraRounded=function(t){var r=t.x,i=t.y,n=t.size,o=t.getNeighbor,e=o?+o(-1,0):0,a=o?+o(1,0):0,u=o?+o(0,-1):0,s=o?+o(0,1):0,c=e+a+u+s;if(0!==c)if(c>2||e&&a||u&&s)this._basicSquare({x:r,y:i,size:n,rotation:0});else{if(2===c){var h=0;return e&&u?h=Math.PI/2:u&&a?h=Math.PI:a&&s&&(h=-Math.PI/2),void this._basicCornerExtraRounded({x:r,y:i,size:n,rotation:h})}if(1===c)return h=0,u?h=Math.PI/2:a?h=Math.PI:s&&(h=-Math.PI/2),void this._basicSideRounded({x:r,y:i,size:n,rotation:h})}else this._basicDot({x:r,y:i,size:n,rotation:0})},t.prototype._drawClassy=function(t){var r=t.x,i=t.y,n=t.size,o=t.getNeighbor,e=o?+o(-1,0):0,a=o?+o(1,0):0,u=o?+o(0,-1):0,s=o?+o(0,1):0;0!==e+a+u+s?e||u?a||s?this._basicSquare({x:r,y:i,size:n,rotation:0}):this._basicCornerRounded({x:r,y:i,size:n,rotation:Math.PI/2}):this._basicCornerRounded({x:r,y:i,size:n,rotation:-Math.PI/2}):this._basicCornersRounded({x:r,y:i,size:n,rotation:Math.PI/2})},t.prototype._drawClassyRounded=function(t){var r=t.x,i=t.y,n=t.size,o=t.getNeighbor,e=o?+o(-1,0):0,a=o?+o(1,0):0,u=o?+o(0,-1):0,s=o?+o(0,1):0;0!==e+a+u+s?e||u?a||s?this._basicSquare({x:r,y:i,size:n,rotation:0}):this._basicCornerExtraRounded({x:r,y:i,size:n,rotation:Math.PI/2}):this._basicCornerExtraRounded({x:r,y:i,size:n,rotation:-Math.PI/2}):this._basicCornersRounded({x:r,y:i,size:n,rotation:Math.PI/2})},t}();var f=function(){return(f=Object.assign||function(t){for(var r,i=1,n=arguments.length;i<n;i++)for(var o in r=arguments[i])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)};const v=function(){function t(t){var r=t.type;this._svg=t.svg,this._type=r}return t.prototype.draw=function(t,r,i,n){var o;switch(this._type){case"square":o=this._drawSquare;break;case"extra-rounded":o=this._drawExtraRounded;break;default:o=this._drawDot}o.call(this,{x:t,y:r,size:i,rotation:n})},t.prototype._rotateFigure=function(t){var r,i=t.size,n=t.rotation,o=void 0===n?0:n,e=t.x+i/2,a=t.y+i/2;(0,t.draw)(),null===(r=this._element)||void 0===r||r.setAttribute("transform","rotate("+180*o/Math.PI+","+e+","+a+")")},t.prototype._basicDot=function(t){var r=this,i=t.size,n=t.x,o=t.y,e=i/7;this._rotateFigure(f(f({},t),{draw:function(){r._element=document.createElementNS("http://www.w3.org/2000/svg","path"),r._element.setAttribute("clip-rule","evenodd"),r._element.setAttribute("d","M "+(n+i/2)+" "+o+"a "+i/2+" "+i/2+" 0 1 0 0.1 0zm 0 "+e+"a "+(i/2-e)+" "+(i/2-e)+" 0 1 1 -0.1 0Z")}}))},t.prototype._basicSquare=function(t){var r=this,i=t.size,n=t.x,o=t.y,e=i/7;this._rotateFigure(f(f({},t),{draw:function(){r._element=document.createElementNS("http://www.w3.org/2000/svg","path"),r._element.setAttribute("clip-rule","evenodd"),r._element.setAttribute("d","M "+n+" "+o+"v "+i+"h "+i+"v "+-i+"zM "+(n+e)+" "+(o+e)+"h "+(i-2*e)+"v "+(i-2*e)+"h "+(2*e-i)+"z")}}))},t.prototype._basicExtraRounded=function(t){var r=this,i=t.x,n=t.y,o=t.size/7;this._rotateFigure(f(f({},t),{draw:function(){r._element=document.createElementNS("http://www.w3.org/2000/svg","path"),r._element.setAttribute("clip-rule","evenodd"),r._element.setAttribute("d","M "+i+" "+(n+2.5*o)+"v "+2*o+"a "+2.5*o+" "+2.5*o+", 0, 0, 0, "+2.5*o+" "+2.5*o+"h "+2*o+"a "+2.5*o+" "+2.5*o+", 0, 0, 0, "+2.5*o+" "+2.5*-o+"v "+-2*o+"a "+2.5*o+" "+2.5*o+", 0, 0, 0, "+2.5*-o+" "+2.5*-o+"h "+-2*o+"a "+2.5*o+" "+2.5*o+", 0, 0, 0, "+2.5*-o+" "+2.5*o+"M "+(i+2.5*o)+" "+(n+o)+"h "+2*o+"a "+1.5*o+" "+1.5*o+", 0, 0, 1, "+1.5*o+" "+1.5*o+"v "+2*o+"a "+1.5*o+" "+1.5*o+", 0, 0, 1, "+1.5*-o+" "+1.5*o+"h "+-2*o+"a "+1.5*o+" "+1.5*o+", 0, 0, 1, "+1.5*-o+" "+1.5*-o+"v "+-2*o+"a "+1.5*o+" "+1.5*o+", 0, 0, 1, "+1.5*o+" "+1.5*-o)}}))},t.prototype._drawDot=function(t){this._basicDot({x:t.x,y:t.y,size:t.size,rotation:t.rotation})},t.prototype._drawSquare=function(t){this._basicSquare({x:t.x,y:t.y,size:t.size,rotation:t.rotation})},t.prototype._drawExtraRounded=function(t){this._basicExtraRounded({x:t.x,y:t.y,size:t.size,rotation:t.rotation})},t}();var d=function(){return(d=Object.assign||function(t){for(var r,i=1,n=arguments.length;i<n;i++)for(var o in r=arguments[i])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)};const l=function(){function t(t){var r=t.type;this._svg=t.svg,this._type=r}return t.prototype.draw=function(t,r,i,n){("square"===this._type?this._drawSquare:this._drawDot).call(this,{x:t,y:r,size:i,rotation:n})},t.prototype._rotateFigure=function(t){var r,i=t.size,n=t.rotation,o=void 0===n?0:n,e=t.x+i/2,a=t.y+i/2;(0,t.draw)(),null===(r=this._element)||void 0===r||r.setAttribute("transform","rotate("+180*o/Math.PI+","+e+","+a+")")},t.prototype._basicDot=function(t){var r=this,i=t.size,n=t.x,o=t.y;this._rotateFigure(d(d({},t),{draw:function(){r._element=document.createElementNS("http://www.w3.org/2000/svg","circle"),r._element.setAttribute("cx",String(n+i/2)),r._element.setAttribute("cy",String(o+i/2)),r._element.setAttribute("r",String(i/2))}}))},t.prototype._basicSquare=function(t){var r=this,i=t.size,n=t.x,o=t.y;this._rotateFigure(d(d({},t),{draw:function(){r._element=document.createElementNS("http://www.w3.org/2000/svg","rect"),r._element.setAttribute("x",String(n)),r._element.setAttribute("y",String(o)),r._element.setAttribute("width",String(i)),r._element.setAttribute("height",String(i))}}))},t.prototype._drawDot=function(t){this._basicDot({x:t.x,y:t.y,size:t.size,rotation:t.rotation})},t.prototype._drawSquare=function(t){this._basicSquare({x:t.x,y:t.y,size:t.size,rotation:t.rotation})},t}(),w="circle";var g=function(t,r,i,n){return new(i||(i=Promise))((function(o,e){function a(t){try{s(n.next(t))}catch(t){e(t)}}function u(t){try{s(n.throw(t))}catch(t){e(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof i?r:new i((function(t){t(r)}))).then(a,u)}s((n=n.apply(t,r||[])).next())}))},p=function(t,r){var i,n,o,e,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return e={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function u(e){return function(u){return function(e){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(o=2&e[0]?n.return:e[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,e[1])).done)return o;switch(n=0,o&&(e=[2&e[0],o.value]),e[0]){case 0:case 1:o=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,n=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==e[0]&&2!==e[0])){a=0;continue}if(3===e[0]&&(!o||e[1]>o[0]&&e[1]<o[3])){a.label=e[1];break}if(6===e[0]&&a.label<o[1]){a.label=o[1],o=e;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(e);break}o[2]&&a.ops.pop(),a.trys.pop();continue}e=r.call(t,a)}catch(t){e=[6,t],n=0}finally{i=o=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,u])}}},b=[[1,1,1,1,1,1,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,1,1,1,1,1,1]],y=[[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]];const m=function(){function t(t){this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("width",String(t.width)),this._element.setAttribute("height",String(t.height)),this._defs=document.createElementNS("http://www.w3.org/2000/svg","defs"),this._element.appendChild(this._defs),this._options=t}return Object.defineProperty(t.prototype,"width",{get:function(){return this._options.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._options.height},enumerable:!1,configurable:!0}),t.prototype.getElement=function(){return this._element},t.prototype.drawQR=function(t){return g(this,void 0,void 0,(function(){var r,i,n,o,e,a,u,c=this;return p(this,(function(h){switch(h.label){case 0:return r=t.getModuleCount(),i=Math.min(this._options.width,this._options.height)-2*this._options.margin,n=this._options.shape===w?i/Math.sqrt(2):i,o=Math.floor(n/r),e={hideXDots:0,hideYDots:0,width:0,height:0},this._qr=t,this._options.image?[4,this.loadImage()]:[3,2];case 1:if(h.sent(),!this._image)return[2];a=this._options,u=Math.floor(a.imageOptions.imageSize*s[a.qrOptions.errorCorrectionLevel]*r*r),e=function(t){var r=t.originalHeight,i=t.originalWidth,n=t.maxHiddenDots,o=t.maxHiddenAxisDots,e=t.dotSize,a={x:0,y:0},u={x:0,y:0};if(r<=0||i<=0||n<=0||e<=0)return{height:0,width:0,hideYDots:0,hideXDots:0};var s=r/i;return a.x=Math.floor(Math.sqrt(n/s)),a.x<=0&&(a.x=1),o&&o<a.x&&(a.x=o),a.x%2==0&&a.x--,u.x=a.x*e,a.y=1+2*Math.ceil((a.x*s-1)/2),u.y=Math.round(u.x*s),(a.y*a.x>n||o&&o<a.y)&&(o&&o<a.y?(a.y=o,a.y%2==0&&a.x--):a.y-=2,u.y=a.y*e,a.x=1+2*Math.ceil((a.y/s-1)/2),u.x=Math.round(u.y/s)),{height:u.y,width:u.x,hideYDots:a.y,hideXDots:a.x}}({originalWidth:this._image.width,originalHeight:this._image.height,maxHiddenDots:u,maxHiddenAxisDots:r-14,dotSize:o}),h.label=2;case 2:return this.drawBackground(),this.drawDots((function(t,i){var n,o,a,u,s,h;return!(c._options.imageOptions.hideBackgroundDots&&t>=(r-e.hideXDots)/2&&t<(r+e.hideXDots)/2&&i>=(r-e.hideYDots)/2&&i<(r+e.hideYDots)/2||(null===(n=b[t])||void 0===n?void 0:n[i])||(null===(o=b[t-r+7])||void 0===o?void 0:o[i])||(null===(a=b[t])||void 0===a?void 0:a[i-r+7])||(null===(u=y[t])||void 0===u?void 0:u[i])||(null===(s=y[t-r+7])||void 0===s?void 0:s[i])||(null===(h=y[t])||void 0===h?void 0:h[i-r+7]))})),this.drawCorners(),this._options.image?[4,this.drawImage({width:e.width,height:e.height,count:r,dotSize:o})]:[3,4];case 3:h.sent(),h.label=4;case 4:return[2]}}))}))},t.prototype.drawBackground=function(){var t,r,i,n=this._options;if(this._element){var o=null===(t=n.backgroundOptions)||void 0===t?void 0:t.gradient,e=null===(r=n.backgroundOptions)||void 0===r?void 0:r.color;if((o||e)&&this._createColor({options:o,color:e,additionalRotation:0,x:0,y:0,height:n.height,width:n.width,name:"background-color"}),null===(i=n.backgroundOptions)||void 0===i?void 0:i.round){var a=Math.min(n.width,n.height),u=document.createElementNS("http://www.w3.org/2000/svg","rect");this._backgroundClipPath=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._backgroundClipPath.setAttribute("id","clip-path-background-color"),this._defs.appendChild(this._backgroundClipPath),u.setAttribute("x",String((n.width-a)/2)),u.setAttribute("y",String((n.height-a)/2)),u.setAttribute("width",String(a)),u.setAttribute("height",String(a)),u.setAttribute("rx",String(a/2*n.backgroundOptions.round)),this._backgroundClipPath.appendChild(u)}}},t.prototype.drawDots=function(t){var r,i,n=this;if(!this._qr)throw"QR code is not defined";var o=this._options,e=this._qr.getModuleCount();if(e>o.width||e>o.height)throw"The canvas is too small.";var a=Math.min(o.width,o.height)-2*o.margin,u=o.shape===w?a/Math.sqrt(2):a,s=Math.floor(u/e),c=Math.floor((o.width-e*s)/2),f=Math.floor((o.height-e*s)/2),v=new h({svg:this._element,type:o.dotsOptions.type});this._dotsClipPath=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._dotsClipPath.setAttribute("id","clip-path-dot-color"),this._defs.appendChild(this._dotsClipPath),this._createColor({options:null===(r=o.dotsOptions)||void 0===r?void 0:r.gradient,color:o.dotsOptions.color,additionalRotation:0,x:0,y:0,height:o.height,width:o.width,name:"dot-color"});for(var d=function(r){for(var o=function(o){return t&&!t(r,o)?"continue":(null===(i=l._qr)||void 0===i?void 0:i.isDark(r,o))?(v.draw(c+r*s,f+o*s,s,(function(i,a){return!(r+i<0||o+a<0||r+i>=e||o+a>=e)&&!(t&&!t(r+i,o+a))&&!!n._qr&&n._qr.isDark(r+i,o+a)})),void(v._element&&l._dotsClipPath&&l._dotsClipPath.appendChild(v._element))):"continue"},a=0;a<e;a++)o(a)},l=this,g=0;g<e;g++)d(g);if(o.shape===w){var p=Math.floor((a/s-e)/2),b=e+2*p,y=c-p*s,m=f-p*s,M=[],x=Math.floor(b/2);for(g=0;g<b;g++){M[g]=[];for(var S=0;S<b;S++)M[g][S]=g>=p-1&&g<=b-p&&S>=p-1&&S<=b-p||Math.sqrt((g-x)*(g-x)+(S-x)*(S-x))>x?0:this._qr.isDark(S-2*p<0?S:S>=e?S-2*p:S-p,g-2*p<0?g:g>=e?g-2*p:g-p)?1:0}var k=function(t){for(var r=function(r){if(!M[t][r])return"continue";v.draw(y+t*s,m+r*s,s,(function(i,n){var o;return!!(null===(o=M[t+i])||void 0===o?void 0:o[r+n])})),v._element&&z._dotsClipPath&&z._dotsClipPath.appendChild(v._element)},i=0;i<b;i++)r(i)},z=this;for(g=0;g<b;g++)k(g)}},t.prototype.drawCorners=function(){var t=this;if(!this._qr)throw"QR code is not defined";var r=this._options;if(!this._element)throw"Element code is not defined";var i=this._qr.getModuleCount(),n=Math.min(r.width,r.height)-2*r.margin,o=r.shape===w?n/Math.sqrt(2):n,e=Math.floor(o/i),a=7*e,u=3*e,s=Math.floor((r.width-i*e)/2),c=Math.floor((r.height-i*e)/2);[[0,0,0],[1,0,Math.PI/2],[0,1,-Math.PI/2]].forEach((function(n){var o,f,d,w,g,p,m,M,x,S,k,z,q=n[0],O=n[1],A=n[2],j=s+q*e*(i-7),R=c+O*e*(i-7),L=t._dotsClipPath,P=t._dotsClipPath;if(((null===(o=r.cornersSquareOptions)||void 0===o?void 0:o.gradient)||(null===(f=r.cornersSquareOptions)||void 0===f?void 0:f.color))&&((L=document.createElementNS("http://www.w3.org/2000/svg","clipPath")).setAttribute("id","clip-path-corners-square-color-"+q+"-"+O),t._defs.appendChild(L),t._cornersSquareClipPath=t._cornersDotClipPath=P=L,t._createColor({options:null===(d=r.cornersSquareOptions)||void 0===d?void 0:d.gradient,color:null===(w=r.cornersSquareOptions)||void 0===w?void 0:w.color,additionalRotation:A,x:j,y:R,height:a,width:a,name:"corners-square-color-"+q+"-"+O})),null===(g=r.cornersSquareOptions)||void 0===g?void 0:g.type){var $=new v({svg:t._element,type:r.cornersSquareOptions.type});$.draw(j,R,a,A),$._element&&L&&L.appendChild($._element)}else for(var D=new h({svg:t._element,type:r.dotsOptions.type}),B=function(t){for(var r=function(r){if(!(null===(p=b[t])||void 0===p?void 0:p[r]))return"continue";D.draw(j+t*e,R+r*e,e,(function(i,n){var o;return!!(null===(o=b[t+i])||void 0===o?void 0:o[r+n])})),D._element&&L&&L.appendChild(D._element)},i=0;i<b[t].length;i++)r(i)},E=0;E<b.length;E++)B(E);if(((null===(m=r.cornersDotOptions)||void 0===m?void 0:m.gradient)||(null===(M=r.cornersDotOptions)||void 0===M?void 0:M.color))&&((P=document.createElementNS("http://www.w3.org/2000/svg","clipPath")).setAttribute("id","clip-path-corners-dot-color-"+q+"-"+O),t._defs.appendChild(P),t._cornersDotClipPath=P,t._createColor({options:null===(x=r.cornersDotOptions)||void 0===x?void 0:x.gradient,color:null===(S=r.cornersDotOptions)||void 0===S?void 0:S.color,additionalRotation:A,x:j+2*e,y:R+2*e,height:u,width:u,name:"corners-dot-color-"+q+"-"+O})),null===(k=r.cornersDotOptions)||void 0===k?void 0:k.type){var I=new l({svg:t._element,type:r.cornersDotOptions.type});I.draw(j+2*e,R+2*e,u,A),I._element&&P&&P.appendChild(I._element)}else{D=new h({svg:t._element,type:r.dotsOptions.type});var C=function(t){for(var r=function(r){if(!(null===(z=y[t])||void 0===z?void 0:z[r]))return"continue";D.draw(j+t*e,R+r*e,e,(function(i,n){var o;return!!(null===(o=y[t+i])||void 0===o?void 0:o[r+n])})),D._element&&P&&P.appendChild(D._element)},i=0;i<y[t].length;i++)r(i)};for(E=0;E<y.length;E++)C(E)}}))},t.prototype.loadImage=function(){var t=this;return new Promise((function(r,i){var n=t._options,o=new Image;if(!n.image)return i("Image is not defined");"string"==typeof n.imageOptions.crossOrigin&&(o.crossOrigin=n.imageOptions.crossOrigin),t._image=o,o.onload=function(){r()},o.src=n.image}))},t.prototype.drawImage=function(t){var r=t.width,i=t.height,n=t.count,o=t.dotSize;return g(this,void 0,void 0,(function(){var t,e,a,s,c,h,f,v,d;return p(this,(function(l){switch(l.label){case 0:return t=this._options,e=Math.floor((t.width-n*o)/2),a=Math.floor((t.height-n*o)/2),s=e+t.imageOptions.margin+(n*o-r)/2,c=a+t.imageOptions.margin+(n*o-i)/2,h=r-2*t.imageOptions.margin,f=i-2*t.imageOptions.margin,(v=document.createElementNS("http://www.w3.org/2000/svg","image")).setAttribute("x",String(s)),v.setAttribute("y",String(c)),v.setAttribute("width",h+"px"),v.setAttribute("height",f+"px"),[4,u(t.image||"")];case 1:return d=l.sent(),v.setAttribute("href",d||""),this._element.appendChild(v),[2]}}))}))},t.prototype._createColor=function(t){var r=t.options,i=t.color,n=t.additionalRotation,o=t.x,e=t.y,a=t.height,u=t.width,s=t.name,c=u>a?u:a,h=document.createElementNS("http://www.w3.org/2000/svg","rect");if(h.setAttribute("x",String(o)),h.setAttribute("y",String(e)),h.setAttribute("height",String(a)),h.setAttribute("width",String(u)),h.setAttribute("clip-path","url('#clip-path-"+s+"')"),r){var f;if("radial"===r.type)(f=document.createElementNS("http://www.w3.org/2000/svg","radialGradient")).setAttribute("id",s),f.setAttribute("gradientUnits","userSpaceOnUse"),f.setAttribute("fx",String(o+u/2)),f.setAttribute("fy",String(e+a/2)),f.setAttribute("cx",String(o+u/2)),f.setAttribute("cy",String(e+a/2)),f.setAttribute("r",String(c/2));else{var v=((r.rotation||0)+n)%(2*Math.PI),d=(v+2*Math.PI)%(2*Math.PI),l=o+u/2,w=e+a/2,g=o+u/2,p=e+a/2;d>=0&&d<=.25*Math.PI||d>1.75*Math.PI&&d<=2*Math.PI?(l-=u/2,w-=a/2*Math.tan(v),g+=u/2,p+=a/2*Math.tan(v)):d>.25*Math.PI&&d<=.75*Math.PI?(w-=a/2,l-=u/2/Math.tan(v),p+=a/2,g+=u/2/Math.tan(v)):d>.75*Math.PI&&d<=1.25*Math.PI?(l+=u/2,w+=a/2*Math.tan(v),g-=u/2,p-=a/2*Math.tan(v)):d>1.25*Math.PI&&d<=1.75*Math.PI&&(w+=a/2,l+=u/2/Math.tan(v),p-=a/2,g-=u/2/Math.tan(v)),(f=document.createElementNS("http://www.w3.org/2000/svg","linearGradient")).setAttribute("id",s),f.setAttribute("gradientUnits","userSpaceOnUse"),f.setAttribute("x1",String(Math.round(l))),f.setAttribute("y1",String(Math.round(w))),f.setAttribute("x2",String(Math.round(g))),f.setAttribute("y2",String(Math.round(p)))}r.colorStops.forEach((function(t){var r=t.offset,i=t.color,n=document.createElementNS("http://www.w3.org/2000/svg","stop");n.setAttribute("offset",100*r+"%"),n.setAttribute("stop-color",i),f.appendChild(n)})),h.setAttribute("fill","url('#"+s+"')"),this._defs.appendChild(f)}else i&&h.setAttribute("fill",i);this._element.appendChild(h)},t}(),M="canvas";for(var x={},S=0;S<=40;S++)x[S]=S;const k={type:M,shape:"square",width:300,height:300,data:"",margin:0,qrOptions:{typeNumber:x[0],mode:void 0,errorCorrectionLevel:"Q"},imageOptions:{hideBackgroundDots:!0,imageSize:.4,crossOrigin:void 0,margin:0},dotsOptions:{type:"square",color:"#000"},backgroundOptions:{round:0,color:"#fff"}};var z=function(){return(z=Object.assign||function(t){for(var r,i=1,n=arguments.length;i<n;i++)for(var o in r=arguments[i])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)};function q(t){var r=z({},t);if(!r.colorStops||!r.colorStops.length)throw"Field 'colorStops' is required in gradient";return r.rotation=r.rotation?Number(r.rotation):0,r.colorStops=r.colorStops.map((function(t){return z(z({},t),{offset:Number(t.offset)})})),r}function O(t){var r=z({},t);return r.width=Number(r.width),r.height=Number(r.height),r.margin=Number(r.margin),r.imageOptions=z(z({},r.imageOptions),{hideBackgroundDots:Boolean(r.imageOptions.hideBackgroundDots),imageSize:Number(r.imageOptions.imageSize),margin:Number(r.imageOptions.margin)}),r.margin>Math.min(r.width,r.height)&&(r.margin=Math.min(r.width,r.height)),r.dotsOptions=z({},r.dotsOptions),r.dotsOptions.gradient&&(r.dotsOptions.gradient=q(r.dotsOptions.gradient)),r.cornersSquareOptions&&(r.cornersSquareOptions=z({},r.cornersSquareOptions),r.cornersSquareOptions.gradient&&(r.cornersSquareOptions.gradient=q(r.cornersSquareOptions.gradient))),r.cornersDotOptions&&(r.cornersDotOptions=z({},r.cornersDotOptions),r.cornersDotOptions.gradient&&(r.cornersDotOptions.gradient=q(r.cornersDotOptions.gradient))),r.backgroundOptions&&(r.backgroundOptions=z({},r.backgroundOptions),r.backgroundOptions.gradient&&(r.backgroundOptions.gradient=q(r.backgroundOptions.gradient))),r}var A=i(192),j=i.n(A),R=function(t,r,i,n){return new(i||(i=Promise))((function(o,e){function a(t){try{s(n.next(t))}catch(t){e(t)}}function u(t){try{s(n.throw(t))}catch(t){e(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof i?r:new i((function(t){t(r)}))).then(a,u)}s((n=n.apply(t,r||[])).next())}))},L=function(t,r){var i,n,o,e,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return e={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function u(e){return function(u){return function(e){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(o=2&e[0]?n.return:e[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,e[1])).done)return o;switch(n=0,o&&(e=[2&e[0],o.value]),e[0]){case 0:case 1:o=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,n=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==e[0]&&2!==e[0])){a=0;continue}if(3===e[0]&&(!o||e[1]>o[0]&&e[1]<o[3])){a.label=e[1];break}if(6===e[0]&&a.label<o[1]){a.label=o[1],o=e;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(e);break}o[2]&&a.ops.pop(),a.trys.pop();continue}e=r.call(t,a)}catch(t){e=[6,t],n=0}finally{i=o=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,u])}}};const P=function(){function t(t){this._options=t?O(e(k,t)):k,this.update()}return t._clearContainer=function(t){t&&(t.innerHTML="")},t.prototype._setupSvg=function(){var t=this;if(this._qr){var r=new m(this._options);this._svg=r.getElement(),this._svgDrawingPromise=r.drawQR(this._qr).then((function(){var i;t._svg&&(null===(i=t._extension)||void 0===i||i.call(t,r.getElement(),t._options))}))}},t.prototype._setupCanvas=function(){var t,r=this;this._qr&&(this._canvas=document.createElement("canvas"),this._canvas.width=this._options.width,this._canvas.height=this._options.height,this._setupSvg(),this._canvasDrawingPromise=null===(t=this._svgDrawingPromise)||void 0===t?void 0:t.then((function(){if(r._svg){var t=r._svg,i=(new XMLSerializer).serializeToString(t),n="data:image/svg+xml;base64,"+btoa(i),o=new Image;return new Promise((function(t){o.onload=function(){var i,n;null===(n=null===(i=r._canvas)||void 0===i?void 0:i.getContext("2d"))||void 0===n||n.drawImage(o,0,0),t()},o.src=n}))}})))},t.prototype._getElement=function(t){return void 0===t&&(t="png"),R(this,void 0,void 0,(function(){return L(this,(function(r){switch(r.label){case 0:if(!this._qr)throw"QR code is empty";return"svg"!==t.toLowerCase()?[3,2]:(this._svg&&this._svgDrawingPromise||this._setupSvg(),[4,this._svgDrawingPromise]);case 1:return r.sent(),[2,this._svg];case 2:return this._canvas&&this._canvasDrawingPromise||this._setupCanvas(),[4,this._canvasDrawingPromise];case 3:return r.sent(),[2,this._canvas]}}))}))},t.prototype.update=function(r){t._clearContainer(this._container),this._options=r?O(e(this._options,r)):this._options,this._options.data&&(this._qr=j()(this._options.qrOptions.typeNumber,this._options.qrOptions.errorCorrectionLevel),this._qr.addData(this._options.data,this._options.qrOptions.mode||function(t){switch(!0){case/^[0-9]*$/.test(t):return"Numeric";case/^[0-9A-Z $%*+\-./:]*$/.test(t):return"Alphanumeric";default:return"Byte"}}(this._options.data)),this._qr.make(),this._options.type===M?this._setupCanvas():this._setupSvg(),this.append(this._container))},t.prototype.append=function(t){if(t){if("function"!=typeof t.appendChild)throw"Container should be a single DOM node";this._options.type===M?this._canvas&&t.appendChild(this._canvas):this._svg&&t.appendChild(this._svg),this._container=t}},t.prototype.applyExt