qrstylelib 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,42 +1,42 @@
1
- "use strict";var ft=Object.create;var Q=Object.defineProperty;var yt=Object.getOwnPropertyDescriptor;var pt=Object.getOwnPropertyNames;var Ct=Object.getPrototypeOf,mt=Object.prototype.hasOwnProperty;var gt=(i,t)=>{for(var e in t)Q(i,e,{get:t[e],enumerable:!0})},et=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of pt(t))!mt.call(i,n)&&n!==e&&Q(i,n,{get:()=>t[n],enumerable:!(r=yt(t,n))||r.enumerable});return i};var rt=(i,t,e)=>(e=i!=null?ft(Ct(i)):{},et(t||!i||!i.__esModule?Q(e,"default",{value:i,enumerable:!0}):e,i)),bt=i=>et(Q({},"__esModule",{value:!0}),i);var Zt={};gt(Zt,{QRCodeGenerate:()=>Bt,exportQR:()=>st,getQRBounds:()=>$t});module.exports=bt(Zt);var d=class d{constructor(t,e,r,n){this.version=t;this.errorCorrectionLevel=e;this.modules=[];this.isFunction=[];if(t<d.MIN_VERSION||t>d.MAX_VERSION)throw new RangeError("Version value out of range");if(n<-1||n>7)throw new RangeError("Mask value out of range");this.size=t*4+17;let o=[];for(let s=0;s<this.size;s++)o.push(!1);for(let s=0;s<this.size;s++)this.modules.push(o.slice()),this.isFunction.push(o.slice());this.drawFunctionPatterns();let a=this.addEccAndInterleave(r);if(this.drawCodewords(a),n==-1){let s=1e9;for(let h=0;h<8;h++){this.applyMask(h),this.drawFormatBits(h);let l=this.getPenaltyScore();l<s&&(n=h,s=l),this.applyMask(h)}}M(0<=n&&n<=7),this.mask=n,this.applyMask(n),this.drawFormatBits(n),this.isFunction=[]}static encodeText(t,e){let r=$.makeSegments(t);return d.encodeSegments(r,e)}static encodeBinary(t,e){let r=$.makeBytes(t);return d.encodeSegments([r],e)}static encodeSegments(t,e,r=1,n=40,o=-1,a=!0){if(!(d.MIN_VERSION<=r&&r<=n&&n<=d.MAX_VERSION)||o<-1||o>7)throw new RangeError("Invalid value");let s,h;for(s=r;;s++){let f=d.getNumDataCodewords(s,e)*8,c=$.getTotalBits(t,s);if(c<=f){h=c;break}if(s>=n)throw new RangeError("Data too long")}for(let f of[d.Ecc.MEDIUM,d.Ecc.QUARTILE,d.Ecc.HIGH])a&&h<=d.getNumDataCodewords(s,f)*8&&(e=f);let l=[];for(let f of t){x(f.mode.modeBits,4,l),x(f.numChars,f.mode.numCharCountBits(s),l);for(let c of f.getData())l.push(c)}M(l.length==h);let p=d.getNumDataCodewords(s,e)*8;M(l.length<=p),x(0,Math.min(4,p-l.length),l),x(0,(8-l.length%8)%8,l),M(l.length%8==0);for(let f=236;l.length<p;f^=253)x(f,8,l);let m=[];for(;m.length*8<l.length;)m.push(0);return l.forEach((f,c)=>m[c>>>3]|=f<<7-(c&7)),new d(s,e,m,o)}getModule(t,e){return 0<=t&&t<this.size&&0<=e&&e<this.size&&this.modules[e][t]}drawFunctionPatterns(){for(let r=0;r<this.size;r++)this.setFunctionModule(6,r,r%2==0),this.setFunctionModule(r,6,r%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let t=this.getAlignmentPatternPositions(),e=t.length;for(let r=0;r<e;r++)for(let n=0;n<e;n++)r==0&&n==0||r==0&&n==e-1||r==e-1&&n==0||this.drawAlignmentPattern(t[r],t[n]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(t){let e=this.errorCorrectionLevel.formatBits<<3|t,r=e;for(let o=0;o<10;o++)r=r<<1^(r>>>9)*1335;let n=(e<<10|r)^21522;M(n>>>15==0);for(let o=0;o<=5;o++)this.setFunctionModule(8,o,H(n,o));this.setFunctionModule(8,7,H(n,6)),this.setFunctionModule(8,8,H(n,7)),this.setFunctionModule(7,8,H(n,8));for(let o=9;o<15;o++)this.setFunctionModule(14-o,8,H(n,o));for(let o=0;o<8;o++)this.setFunctionModule(this.size-1-o,8,H(n,o));for(let o=8;o<15;o++)this.setFunctionModule(8,this.size-15+o,H(n,o));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let t=this.version;for(let r=0;r<12;r++)t=t<<1^(t>>>11)*7973;let e=this.version<<12|t;M(e>>>18==0);for(let r=0;r<18;r++){let n=H(e,r),o=this.size-11+r%3,a=Math.floor(r/3);this.setFunctionModule(o,a,n),this.setFunctionModule(a,o,n)}}drawFinderPattern(t,e){for(let r=-4;r<=4;r++)for(let n=-4;n<=4;n++){let o=Math.max(Math.abs(n),Math.abs(r)),a=t+n,s=e+r;0<=a&&a<this.size&&0<=s&&s<this.size&&this.setFunctionModule(a,s,o!=2&&o!=4)}}drawAlignmentPattern(t,e){for(let r=-2;r<=2;r++)for(let n=-2;n<=2;n++)this.setFunctionModule(t+n,e+r,Math.max(Math.abs(n),Math.abs(r))!=1)}setFunctionModule(t,e,r){this.modules[e][t]=r,this.isFunction[e][t]=!0}addEccAndInterleave(t){let e=this.version,r=this.errorCorrectionLevel;if(t.length!=d.getNumDataCodewords(e,r))throw new RangeError("Invalid argument");let n=d.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][e],o=d.ECC_CODEWORDS_PER_BLOCK[r.ordinal][e],a=Math.floor(d.getNumRawDataModules(e)/8),s=n-a%n,h=Math.floor(a/n),l=[],p=d.reedSolomonComputeDivisor(o);for(let f=0,c=0;f<n;f++){let b=t.slice(c,c+h-o+(f<s?0:1));c+=b.length;let C=d.reedSolomonComputeRemainder(b,p);f<s&&b.push(0),l.push(b.concat(C))}let m=[];for(let f=0;f<l[0].length;f++)l.forEach((c,b)=>{(f!=h-o||b>=s)&&m.push(c[f])});return M(m.length==a),m}drawCodewords(t){if(t.length!=Math.floor(d.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let e=0;for(let r=this.size-1;r>=1;r-=2){r==6&&(r=5);for(let n=0;n<this.size;n++)for(let o=0;o<2;o++){let a=r-o,h=(r+1&2)==0?this.size-1-n:n;!this.isFunction[h][a]&&e<t.length*8&&(this.modules[h][a]=H(t[e>>>3],7-(e&7)),e++)}}M(e==t.length*8)}applyMask(t){if(t<0||t>7)throw new RangeError("Mask value out of range");for(let e=0;e<this.size;e++)for(let r=0;r<this.size;r++){let n;switch(t){case 0:n=(r+e)%2==0;break;case 1:n=e%2==0;break;case 2:n=r%3==0;break;case 3:n=(r+e)%3==0;break;case 4:n=(Math.floor(r/3)+Math.floor(e/2))%2==0;break;case 5:n=r*e%2+r*e%3==0;break;case 6:n=(r*e%2+r*e%3)%2==0;break;case 7:n=((r+e)%2+r*e%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[e][r]&&n&&(this.modules[e][r]=!this.modules[e][r])}}getPenaltyScore(){let t=0;for(let o=0;o<this.size;o++){let a=!1,s=0,h=[0,0,0,0,0,0,0];for(let l=0;l<this.size;l++)this.modules[o][l]==a?(s++,s==5?t+=d.PENALTY_N1:s>5&&t++):(this.finderPenaltyAddHistory(s,h),a||(t+=this.finderPenaltyCountPatterns(h)*d.PENALTY_N3),a=this.modules[o][l],s=1);t+=this.finderPenaltyTerminateAndCount(a,s,h)*d.PENALTY_N3}for(let o=0;o<this.size;o++){let a=!1,s=0,h=[0,0,0,0,0,0,0];for(let l=0;l<this.size;l++)this.modules[l][o]==a?(s++,s==5?t+=d.PENALTY_N1:s>5&&t++):(this.finderPenaltyAddHistory(s,h),a||(t+=this.finderPenaltyCountPatterns(h)*d.PENALTY_N3),a=this.modules[l][o],s=1);t+=this.finderPenaltyTerminateAndCount(a,s,h)*d.PENALTY_N3}for(let o=0;o<this.size-1;o++)for(let a=0;a<this.size-1;a++){let s=this.modules[o][a];s==this.modules[o][a+1]&&s==this.modules[o+1][a]&&s==this.modules[o+1][a+1]&&(t+=d.PENALTY_N2)}let e=0;for(let o of this.modules)e=o.reduce((a,s)=>a+(s?1:0),e);let r=this.size*this.size,n=Math.ceil(Math.abs(e*20-r*10)/r)-1;return M(0<=n&&n<=9),t+=n*d.PENALTY_N4,M(0<=t&&t<=2568888),t}getAlignmentPatternPositions(){if(this.version==1)return[];{let t=Math.floor(this.version/7)+2,e=Math.floor((this.version*8+t*3+5)/(t*4-4))*2,r=[6];for(let n=this.size-7;r.length<t;n-=e)r.splice(1,0,n);return r}}static getNumRawDataModules(t){if(t<d.MIN_VERSION||t>d.MAX_VERSION)throw new RangeError("Version number out of range");let e=(16*t+128)*t+64;if(t>=2){let r=Math.floor(t/7)+2;e-=(25*r-10)*r-55,t>=7&&(e-=36)}return M(208<=e&&e<=29648),e}static getNumDataCodewords(t,e){return Math.floor(d.getNumRawDataModules(t)/8)-d.ECC_CODEWORDS_PER_BLOCK[e.ordinal][t]*d.NUM_ERROR_CORRECTION_BLOCKS[e.ordinal][t]}static reedSolomonComputeDivisor(t){if(t<1||t>255)throw new RangeError("Degree out of range");let e=[];for(let n=0;n<t-1;n++)e.push(0);e.push(1);let r=1;for(let n=0;n<t;n++){for(let o=0;o<e.length;o++)e[o]=d.reedSolomonMultiply(e[o],r),o+1<e.length&&(e[o]^=e[o+1]);r=d.reedSolomonMultiply(r,2)}return e}static reedSolomonComputeRemainder(t,e){let r=e.map(n=>0);for(let n of t){let o=n^r.shift();r.push(0),e.forEach((a,s)=>r[s]^=d.reedSolomonMultiply(a,o))}return r}static reedSolomonMultiply(t,e){if(t>>>8||e>>>8)throw new RangeError("Byte out of range");let r=0;for(let n=7;n>=0;n--)r=r<<1^(r>>>7)*285,r^=(e>>>n&1)*t;return M(r>>>8==0),r}finderPenaltyCountPatterns(t){let e=t[1];M(e<=this.size*3);let r=e>0&&t[2]==e&&t[3]==e*3&&t[4]==e&&t[5]==e;return(r&&t[0]>=e*4&&t[6]>=e?1:0)+(r&&t[6]>=e*4&&t[0]>=e?1:0)}finderPenaltyTerminateAndCount(t,e,r){return t&&(this.finderPenaltyAddHistory(e,r),e=0),e+=this.size,this.finderPenaltyAddHistory(e,r),this.finderPenaltyCountPatterns(r)}finderPenaltyAddHistory(t,e){e[0]==0&&(t+=this.size),e.pop(),e.unshift(t)}};d.MIN_VERSION=1,d.MAX_VERSION=40,d.PENALTY_N1=3,d.PENALTY_N2=3,d.PENALTY_N3=40,d.PENALTY_N4=10,d.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],d.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];var O=d;function x(i,t,e){if(t<0||t>31||i>>>t)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)e.push(i>>>r&1)}function H(i,t){return(i>>>t&1)!=0}function M(i){if(!i)throw new Error("Assertion error")}var y=class y{constructor(t,e,r){this.mode=t;this.numChars=e;this.bitData=r;if(e<0)throw new RangeError("Invalid argument");this.bitData=r.slice()}static makeBytes(t){let e=[];for(let r of t)x(r,8,e);return new y(y.Mode.BYTE,t.length,e)}static makeNumeric(t){if(!y.isNumeric(t))throw new RangeError("String contains non-numeric characters");let e=[];for(let r=0;r<t.length;){let n=Math.min(t.length-r,3);x(parseInt(t.substring(r,r+n),10),n*3+1,e),r+=n}return new y(y.Mode.NUMERIC,t.length,e)}static makeAlphanumeric(t){if(!y.isAlphanumeric(t))throw new RangeError("String contains unencodable characters in alphanumeric mode");let e=[],r;for(r=0;r+2<=t.length;r+=2){let n=y.ALPHANUMERIC_CHARSET.indexOf(t.charAt(r))*45;n+=y.ALPHANUMERIC_CHARSET.indexOf(t.charAt(r+1)),x(n,11,e)}return r<t.length&&x(y.ALPHANUMERIC_CHARSET.indexOf(t.charAt(r)),6,e),new y(y.Mode.ALPHANUMERIC,t.length,e)}static makeSegments(t){return t==""?[]:y.isNumeric(t)?[y.makeNumeric(t)]:y.isAlphanumeric(t)?[y.makeAlphanumeric(t)]:[y.makeBytes(y.toUtf8ByteArray(t))]}static makeEci(t){let e=[];if(t<0)throw new RangeError("ECI assignment value out of range");if(t<128)x(t,8,e);else if(t<16384)x(2,2,e),x(t,14,e);else if(t<1e6)x(6,3,e),x(t,21,e);else throw new RangeError("ECI assignment value out of range");return new y(y.Mode.ECI,0,e)}static isNumeric(t){return y.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return y.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(t,e){let r=0;for(let n of t){let o=n.mode.numCharCountBits(e);if(n.numChars>=1<<o)return 1/0;r+=4+o+n.bitData.length}return r}static toUtf8ByteArray(t){t=encodeURI(t);let e=[];for(let r=0;r<t.length;r++)t.charAt(r)!="%"?e.push(t.charCodeAt(r)):(e.push(parseInt(t.substring(r+1,r+3),16)),r+=2);return e}};y.NUMERIC_REGEX=/^[0-9]*$/,y.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,y.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";var $=y;(t=>{let e=class e{constructor(n,o){this.ordinal=n;this.formatBits=o}};e.LOW=new e(0,1),e.MEDIUM=new e(1,0),e.QUARTILE=new e(2,3),e.HIGH=new e(3,2);let i=e;t.Ecc=e})(O||(O={}));(t=>{let e=class e{constructor(n,o){this.modeBits=n;this.numBitsCharCount=o}numCharCountBits(n){return this.numBitsCharCount[Math.floor((n+7)/17)]}};e.NUMERIC=new e(1,[10,12,14]),e.ALPHANUMERIC=new e(2,[9,11,13]),e.BYTE=new e(4,[8,16,16]),e.KANJI=new e(8,[8,10,12]),e.ECI=new e(7,[0,0,0]);let i=e;t.Mode=e})($||($={}));var D=class{constructor(t,e="H",r=1,n=40,o=-1){let a={L:O.Ecc.LOW,M:O.Ecc.MEDIUM,Q:O.Ecc.QUARTILE,H:O.Ecc.HIGH},s=$.makeSegments(t);this.qr=O.encodeSegments(s,a[e],r,n,o,!0)}getMatrix(){let t=this.qr.size,e=[];for(let r=0;r<t;r++){let n=[];for(let o=0;o<t;o++){let a=this.qr.getModule(o,r),s=this.identifyType(o,r,t);n.push({x:o,y:r,isDark:a,type:s})}e.push(n)}return e}identifyType(t,e,r){return t<7&&e<7||t>r-8&&e<7||t<7&&e>r-8?"pos-finder":"data"}};var X={"inner-eye-classy":{viewBox:"0 0 24 24",d:"M4 0H20H24V4V20C24 22.2091 22.2091 24 20 24H4H0V20V4C0 1.79086 1.79086 0 4 0Z"},"inner-eye-dot":{viewBox:"0 0 24 24",d:"M24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12Z"},"inner-eye-dots":{viewBox:"0 0 24 24",d:"M8 4C8 6.20914 6.20914 8 4 8C1.79086 8 0 6.20914 0 4C0 1.79086 1.79086 0 4 0C6.20914 0 8 1.79086 8 4Z M16 4C16 6.20914 14.2091 8 12 8C9.79086 8 8 6.20914 8 4C8 1.79086 9.79086 0 12 0C14.2091 0 16 1.79086 16 4Z M24 4C24 6.20914 22.2091 8 20 8C17.7909 8 16 6.20914 16 4C16 1.79086 17.7909 0 20 0C22.2091 0 24 1.79086 24 4Z M24 12C24 14.2091 22.2091 16 20 16C17.7909 16 16 14.2091 16 12C16 9.79086 17.7909 8 20 8C22.2091 8 24 9.79086 24 12Z M24 20C24 22.2091 22.2091 24 20 24C17.7909 24 16 22.2091 16 20C16 17.7909 17.7909 16 20 16C22.2091 16 24 17.7909 24 20Z M16 20C16 22.2091 14.2091 24 12 24C9.79086 24 8 22.2091 8 20C8 17.7909 9.79086 16 12 16C14.2091 16 16 17.7909 16 20Z M8 20C8 22.2091 6.20914 24 4 24C1.79086 24 0 22.2091 0 20C0 17.7909 1.79086 16 4 16C6.20914 16 8 17.7909 8 20Z M8 12C8 14.2091 6.20914 16 4 16C1.79086 16 0 14.2091 0 12C0 9.79086 1.79086 8 4 8C6.20914 8 8 9.79086 8 12Z M16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12Z"},"inner-eye-extra-classy":{viewBox:"0 0 24 24",d:"M8 0H16H24V8V16C24 20.4183 20.4183 24 16 24H8H0V16V8C0 3.58172 3.58172 0 8 0Z"},"inner-eye-extra-rounded":{viewBox:"0 0 24 24",d:"M0 8C0 3.58172 3.58172 0 8 0H16C20.4183 0 24 3.58172 24 8V16C24 20.4183 20.4183 24 16 24H8C3.58172 24 0 20.4183 0 16V8Z"},"inner-eye-rounded":{viewBox:"0 0 24 24",d:"M0 4C0 1.79086 1.79086 0 4 0H20C22.2091 0 24 1.79086 24 4V20C24 22.2091 22.2091 24 20 24H4C1.79086 24 0 22.2091 0 20V4Z"},"inner-eye-square":{viewBox:"0 0 24 24",d:"M0 0H24V24H0V0Z"},"outer-eye-classy":{viewBox:"0 0 24 24",d:"M24 0V22C24 23.1046 23.1046 24 22 24H0V2C0 0.895431 0.895431 0 2 0H24ZM3.5 3.5V20.5H20.5V3.5H3.5Z"},"outer-eye-dot":{viewBox:"0 0 24 24",d:"M12 0C18.6274 0 24 5.37258 24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0ZM12 3.5C7.30558 3.5 3.5 7.30558 3.5 12C3.5 16.6944 7.30558 20.5 12 20.5C16.6944 20.5 20.5 16.6944 20.5 12C20.5 7.30558 16.6944 3.5 12 3.5Z"},"outer-eye-dots":{viewBox:"0 0 24 24",d:"M1.71429 20.5714C2.66106 20.5714 3.42857 21.3389 3.42857 22.2857C3.42857 23.2325 2.66106 24 1.71429 24C0.767512 24 0 23.2325 0 22.2857C0 21.3389 0.767512 20.5714 1.71429 20.5714Z M5.14286 20.5714C6.08963 20.5714 6.85714 21.3389 6.85714 22.2857C6.85714 23.2325 6.08963 24 5.14286 24C4.19608 24 3.42857 23.2325 3.42857 22.2857C3.42857 21.3389 4.19608 20.5714 5.14286 20.5714Z M8.57143 20.5714C9.5182 20.5714 10.2857 21.3389 10.2857 22.2857C10.2857 23.2325 9.5182 24 8.57143 24C7.62466 24 6.85714 23.2325 6.85714 22.2857C6.85714 21.3389 7.62466 20.5714 8.57143 20.5714Z M12 20.5714C12.9468 20.5714 13.7143 21.3389 13.7143 22.2857C13.7143 23.2325 12.9468 24 12 24C11.0532 24 10.2857 23.2325 10.2857 22.2857C10.2857 21.3389 11.0532 20.5714 12 20.5714Z M15.4286 20.5714C16.3753 20.5714 17.1429 21.3389 17.1429 22.2857C17.1429 23.2325 16.3753 24 15.4286 24C14.4818 24 13.7143 23.2325 13.7143 22.2857C13.7143 21.3389 14.4818 20.5714 15.4286 20.5714Z M18.8571 20.5714C19.8039 20.5714 20.5714 21.3389 20.5714 22.2857C20.5714 23.2325 19.8039 24 18.8571 24C17.9104 24 17.1429 23.2325 17.1429 22.2857C17.1429 21.3389 17.9104 20.5714 18.8571 20.5714Z M22.2857 20.5714C23.2325 20.5714 24 21.3389 24 22.2857C24 23.2325 23.2325 24 22.2857 24C21.3389 24 20.5714 23.2325 20.5714 22.2857C20.5714 21.3389 21.3389 20.5714 22.2857 20.5714Z M1.71429 17.1429C2.66106 17.1429 3.42857 17.9104 3.42857 18.8571C3.42857 19.8039 2.66106 20.5714 1.71429 20.5714C0.767512 20.5714 0 19.8039 0 18.8571C0 17.9104 0.767512 17.1429 1.71429 17.1429Z M22.2857 17.1429C23.2325 17.1429 24 17.9104 24 18.8571C24 19.8039 23.2325 20.5714 22.2857 20.5714C21.3389 20.5714 20.5714 19.8039 20.5714 18.8571C20.5714 17.9104 21.3389 17.1429 22.2857 17.1429Z M1.71429 13.7143C2.66106 13.7143 3.42857 14.4818 3.42857 15.4286C3.42857 16.3753 2.66106 17.1429 1.71429 17.1429C0.767512 17.1429 0 16.3753 0 15.4286C0 14.4818 0.767512 13.7143 1.71429 13.7143Z M22.2857 13.7143C23.2325 13.7143 24 14.4818 24 15.4286C24 16.3753 23.2325 17.1429 22.2857 17.1429C21.3389 17.1429 20.5714 16.3753 20.5714 15.4286C20.5714 14.4818 21.3389 13.7143 22.2857 13.7143Z M1.71429 10.2857C2.66106 10.2857 3.42857 11.0532 3.42857 12C3.42857 12.9468 2.66106 13.7143 1.71429 13.7143C0.767512 13.7143 0 12.9468 0 12C0 11.0532 0.767512 10.2857 1.71429 10.2857Z M22.2857 10.2857C23.2325 10.2857 24 11.0532 24 12C24 12.9468 23.2325 13.7143 22.2857 13.7143C21.3389 13.7143 20.5714 12.9468 20.5714 12C20.5714 11.0532 21.3389 10.2857 22.2857 10.2857Z M1.71429 6.85714C2.66106 6.85714 3.42857 7.62466 3.42857 8.57143C3.42857 9.5182 2.66106 10.2857 1.71429 10.2857C0.767512 10.2857 0 9.5182 0 8.57143C0 7.62466 0.767512 6.85714 1.71429 6.85714Z M22.2857 6.85714C23.2325 6.85714 24 7.62466 24 8.57143C24 9.5182 23.2325 10.2857 22.2857 10.2857C21.3389 10.2857 20.5714 9.5182 20.5714 8.57143C20.5714 7.62466 21.3389 6.85714 22.2857 6.85714Z M1.71429 3.42857C2.66106 3.42857 3.42857 4.19608 3.42857 5.14286C3.42857 6.08963 2.66106 6.85714 1.71429 6.85714C0.767512 6.85714 0 6.08963 0 5.14286C0 4.19608 0.767512 3.42857 1.71429 3.42857Z M22.2857 3.42857C23.2325 3.42857 24 4.19608 24 5.14286C24 6.08963 23.2325 6.85714 22.2857 6.85714C21.3389 6.85714 20.5714 6.08963 20.5714 5.14286C20.5714 4.19608 21.3389 3.42857 22.2857 3.42857Z M1.71429 0C2.66106 0 3.42857 0.767512 3.42857 1.71429C3.42857 2.66106 2.66106 3.42857 1.71429 3.42857C0.767512 3.42857 0 2.66106 0 1.71429C0 0.767512 0.767512 0 1.71429 0Z M5.14286 0C6.08963 0 6.85714 0.767512 6.85714 1.71429C6.85714 2.66106 6.08963 3.42857 5.14286 3.42857C4.19608 3.42857 3.42857 2.66106 3.42857 1.71429C3.42857 0.767512 4.19608 0 5.14286 0Z M8.57143 0C9.5182 0 10.2857 0.767512 10.2857 1.71429C10.2857 2.66106 9.5182 3.42857 8.57143 3.42857C7.62466 3.42857 6.85714 2.66106 6.85714 1.71429C6.85714 0.767512 7.62466 0 8.57143 0Z M12 0C12.9468 0 13.7143 0.767512 13.7143 1.71429C13.7143 2.66106 12.9468 3.42857 12 3.42857C11.0532 3.42857 10.2857 2.66106 10.2857 1.71429C10.2857 0.767512 11.0532 0 12 0Z M15.4286 0C16.3753 0 17.1429 0.767512 17.1429 1.71429C17.1429 2.66106 16.3753 3.42857 15.4286 3.42857C14.4818 3.42857 13.7143 2.66106 13.7143 1.71429C13.7143 0.767512 14.4818 0 15.4286 0Z M18.8571 0C19.8039 0 20.5714 0.767512 20.5714 1.71429C20.5714 2.66106 19.8039 3.42857 18.8571 3.42857C17.9104 3.42857 17.1429 2.66106 17.1429 1.71429C17.1429 0.767512 17.9104 0 18.8571 0Z M22.2857 0C23.2325 0 24 0.767512 24 1.71429C24 2.66106 23.2325 3.42857 22.2857 3.42857C21.3389 3.42857 20.5714 2.66106 20.5714 1.71429C20.5714 0.767512 21.3389 0 22.2857 0Z"},"outer-eye-extra-classy":{viewBox:"0 0 24 24",d:"M24 0V20C24 22.2091 22.2091 24 20 24H0V4C2.57702e-07 1.79086 1.79086 0 4 0H24ZM3.5 3.5V20.5H20.5V3.5H3.5Z"},"outer-eye-extra-rounded":{viewBox:"0 0 24 24",d:"M16 0C20.4183 0 24 3.58172 24 8V16C24 20.4183 20.4183 24 16 24H8C3.58172 24 1.28855e-07 20.4183 0 16V8C0 3.58172 3.58172 1.28851e-07 8 0H16ZM9 3.5C5.96243 3.5 3.5 5.96243 3.5 9V15C3.5 18.0376 5.96243 20.5 9 20.5H15C18.0376 20.5 20.5 18.0376 20.5 15V9C20.5 5.96243 18.0376 3.5 15 3.5H9Z"},"outer-eye-rounded":{viewBox:"0 0 24 24",d:"M20 0C22.2091 2.57702e-07 24 1.79086 24 4V20C24 22.2091 22.2091 24 20 24H4C1.79086 24 6.44266e-08 22.2091 0 20V4C2.57702e-07 1.79086 1.79086 6.44266e-08 4 0H20ZM3.5 3.5V20.5H20.5V3.5H3.5Z"},"outer-eye-square":{viewBox:"0 0 24 24",d:"M24 24H0V0H24V24ZM3.5 3.5V20.5H20.5V3.5H3.5Z"},"dots-classy":{viewBox:"0 0 24 24",d:"M16 4C16 1.79086 17.7909 0 20 0H24V4C24 6.20914 22.2091 8 20 8H16V4Z M4 0C1.79086 0 0 1.79086 0 4V8V24H16H20C22.2091 24 24 22.2091 24 20V16H16V8L8 8V0H4Z"},"dots-classy-rounded":{viewBox:"0 0 24 24",d:"M16 4C16 1.79086 17.7909 0 20 0H24V4C24 6.20914 22.2091 8 20 8H16V4Z M8 0C3.58172 5.15422e-07 0 3.58172 0 8V24H16C20.4183 24 24 20.4183 24 16H16V8L8 8V0Z"},"dots-extra-rounded":{viewBox:"0 0 24 24",d:"M16 4.00003C16 1.79089 17.7909 2.47955e-05 20 2.47955e-05C22.2092 2.47955e-05 24 1.79089 24 4.00003C24 6.20916 22.2092 8.00003 20 8.00003C17.7909 8.00003 16 6.20916 16 4.00003Z M8 4V8C12.4183 8 16 11.5817 16 16H20C22.2091 16 24 17.7909 24 20C24 22.2091 22.2091 24 20 24H8C3.58172 24 0 20.4183 0 16V4C0 1.79086 1.79086 0 4 0C6.20914 0 8 1.79086 8 4Z"},dots:{viewBox:"0 0 24 24",d:"M16 20C16 17.7909 17.7909 16 20 16C22.2091 16 24 17.7909 24 20C24 22.2091 22.2091 24 20 24C17.7909 24 16 22.2091 16 20Z M8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12Z M16 4C16 1.79086 17.7909 0 20 0C22.2091 0 24 1.79086 24 4C24 6.20914 22.2091 8 20 8C17.7909 8 16 6.20914 16 4Z M8 20C8 17.7909 9.79086 16 12 16C14.2091 16 16 17.7909 16 20C16 22.2091 14.2091 24 12 24C9.79086 24 8 22.2091 8 20Z M0 4C0 1.79086 1.79086 0 4 0C6.20914 0 8 1.79086 8 4C8 6.20914 6.20914 8 4 8C1.79086 8 0 6.20914 0 4Z M0 12C0 9.79086 1.79086 8 4 8C6.20914 8 8 9.79086 8 12C8 14.2091 6.20914 16 4 16C1.79086 16 0 14.2091 0 12Z M0 20C0 17.7909 1.79086 16 4 16C6.20914 16 8 17.7909 8 20C8 22.2091 6.20914 24 4 24C1.79086 24 0 22.2091 0 20Z"},"dots-rounded":{viewBox:"0 0 24 24",d:"M16 4C16 1.79086 17.7908 0 20 0C22.2091 0 24 1.79086 24 4C24 6.20914 22.2091 8 20 8C17.7908 8 16 6.20914 16 4Z M3.99976 24.0001C1.79062 24.0001 -0.000244141 22.2092 -0.000244141 20.0001L-1.35708e-05 12L-0.000244141 4.00007C-0.000244141 1.79093 1.79062 7.00951e-05 3.99976 7.00951e-05C6.20889 7.00951e-05 7.99976 1.79093 7.99976 4.00007L7.99999 8H12C14.2091 8 16 9.79086 16 12L15.9998 16.0001H19.9998C22.2089 16.0001 23.9998 17.7909 23.9998 20.0001C23.9998 22.2092 22.2089 24.0001 19.9998 24.0001L12 24L3.99976 24.0001Z"},"dots-square":{viewBox:"0 0 24 24",d:"M16 0H24V8H16V0Z M24 24V16H16V8L8 8V0H0V8V24H16H24Z"}};var nt=rt(require("sharp"),1),wt=128,Et=240;async function xt(i){let t;if(i.startsWith("data:")){let n=i.indexOf(","),o=i.slice(n+1);t=Buffer.from(o,"base64")}else t=i;let{data:e,info:r}=await(0,nt.default)(t).ensureAlpha().raw().toBuffer({resolveWithObject:!0});return{data:e,width:r.width,height:r.height}}function Mt(i,t){if(i[t+3]<wt)return!0;let r=i[t],n=i[t+1],o=i[t+2];return .299*r+.587*n+.114*o>Et}function Rt(i){let t=[],e={left:0,width:0,height:0},r=i.length;for(let n=0;n<=r;n++){let o=n<r?i[n]:0;for(;t.length>0&&o<i[t[t.length-1]];){let a=i[t.pop()],s=t.length>0?t[t.length-1]+1:0,h=n-s;h*a>e.width*e.height&&(e={left:s,width:h,height:a})}t.push(n)}return e}async function ot(i,t,e){try{let{data:r,width:n,height:o}=await xt(i),a=new Array(n).fill(0),s={x:0,y:0,width:0,height:0,area:0};for(let p=0;p<o;p++){for(let C=0;C<n;C++){let S=(p*n+C)*4;a[C]=Mt(r,S)?a[C]+1:0}let{left:m,width:f,height:c}=Rt(a),b=f*c;b>s.area&&(s={x:m,y:p-c+1,width:f,height:c,area:b})}if(s.area===0)return null;let h=t/n,l=e/o;return{x:Math.round(s.x*h),y:Math.round(s.y*l),width:Math.round(s.width*h),height:Math.round(s.height*l)}}catch(r){return console.warn("[detectFrameInset] Detection failed:",r),null}}var it=rt(require("sharp"),1);async function st(i,t,e={}){if(t==="svg")return Buffer.from(i,"utf-8");let r=Buffer.from(i,"utf-8"),n=(0,it.default)(r);(e.width||e.height)&&(n=n.resize(e.width,e.height,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}));let o=e.quality??90;switch(t){case"png":return n.png().toBuffer();case"jpeg":return n.jpeg({quality:o}).toBuffer();case"webp":return n.webp({quality:o}).toBuffer();default:throw new Error(`[exportQR] Unsupported format: "${t}". Use: svg | png | jpeg | webp`)}}var at={backgroundOptions:{color:"#ffffff"},dotsOptions:{type:"inner-eye-square",color:"#000000"},cornersDotOptions:{type:"inner-eye-square",color:"#000000"},cornersSquareOptions:{type:"inner-eye-square",color:"#000000"}};function At(i,t,e){let r=i>=0&&i<7&&t>=0&&t<7,n=i>=e-7&&i<e&&t>=0&&t<7,o=i>=0&&i<7&&t>=e-7&&t<e;if(r||n||o){let a=i,s=t;return n&&(a=i-(e-7)),o&&(s=t-(e-7)),a>=2&&a<=4&&s>=2&&s<=4?"cornerDot":"cornerSquare"}return"dots"}function vt(i,t){return[{id:"tl",x:t,y:t},{id:"tr",x:i-7+t,y:t},{id:"bl",x:t,y:i-7+t}]}function Ot(i,t,e){return[{x:2,y:2},{x:e-7+2,y:2},{x:2,y:e-7+2}].some(n=>n.x===i&&n.y===t)}function Y(i,t,e,r,n,o){let a=t.colorStops.map(C=>`<stop offset="${C.offset}" stop-color="${C.color}" />`).join(""),s=(t.rotation||0)*(Math.PI/180),h=e+n/2,l=r+o/2,p=Math.sqrt(n*n+o*o)/2,m=(h-p*Math.cos(s)).toFixed(2),f=(l-p*Math.sin(s)).toFixed(2),c=(h+p*Math.cos(s)).toFixed(2),b=(l+p*Math.sin(s)).toFixed(2);return`
2
- <linearGradient id="${i}" gradientUnits="userSpaceOnUse" x1="${m}" y1="${f}" x2="${c}" y2="${b}">
1
+ "use strict";var ht=Object.create;var U=Object.defineProperty;var ft=Object.getOwnPropertyDescriptor;var yt=Object.getOwnPropertyNames;var pt=Object.getPrototypeOf,Ct=Object.prototype.hasOwnProperty;var mt=(s,t)=>{for(var e in t)U(s,e,{get:t[e],enumerable:!0})},et=(s,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of yt(t))!Ct.call(s,n)&&n!==e&&U(s,n,{get:()=>t[n],enumerable:!(r=ft(t,n))||r.enumerable});return s};var rt=(s,t,e)=>(e=s!=null?ht(pt(s)):{},et(t||!s||!s.__esModule?U(e,"default",{value:s,enumerable:!0}):e,s)),gt=s=>et(U({},"__esModule",{value:!0}),s);var Nt={};mt(Nt,{QRCodeGenerate:()=>Ot,QRShapes:()=>nt,exportQR:()=>it,getQRBounds:()=>St});module.exports=gt(Nt);var h=class h{constructor(t,e,r,n){this.version=t;this.errorCorrectionLevel=e;this.modules=[];this.isFunction=[];if(t<h.MIN_VERSION||t>h.MAX_VERSION)throw new RangeError("Version value out of range");if(n<-1||n>7)throw new RangeError("Mask value out of range");this.size=t*4+17;let o=[];for(let i=0;i<this.size;i++)o.push(!1);for(let i=0;i<this.size;i++)this.modules.push(o.slice()),this.isFunction.push(o.slice());this.drawFunctionPatterns();let a=this.addEccAndInterleave(r);if(this.drawCodewords(a),n==-1){let i=1e9;for(let d=0;d<8;d++){this.applyMask(d),this.drawFormatBits(d);let c=this.getPenaltyScore();c<i&&(n=d,i=c),this.applyMask(d)}}M(0<=n&&n<=7),this.mask=n,this.applyMask(n),this.drawFormatBits(n),this.isFunction=[]}static encodeText(t,e){let r=H.makeSegments(t);return h.encodeSegments(r,e)}static encodeBinary(t,e){let r=H.makeBytes(t);return h.encodeSegments([r],e)}static encodeSegments(t,e,r=1,n=40,o=-1,a=!0){if(!(h.MIN_VERSION<=r&&r<=n&&n<=h.MAX_VERSION)||o<-1||o>7)throw new RangeError("Invalid value");let i,d;for(i=r;;i++){let f=h.getNumDataCodewords(i,e)*8,l=H.getTotalBits(t,i);if(l<=f){d=l;break}if(i>=n)throw new RangeError("Data too long")}for(let f of[h.Ecc.MEDIUM,h.Ecc.QUARTILE,h.Ecc.HIGH])a&&d<=h.getNumDataCodewords(i,f)*8&&(e=f);let c=[];for(let f of t){x(f.mode.modeBits,4,c),x(f.numChars,f.mode.numCharCountBits(i),c);for(let l of f.getData())c.push(l)}M(c.length==d);let p=h.getNumDataCodewords(i,e)*8;M(c.length<=p),x(0,Math.min(4,p-c.length),c),x(0,(8-c.length%8)%8,c),M(c.length%8==0);for(let f=236;c.length<p;f^=253)x(f,8,c);let m=[];for(;m.length*8<c.length;)m.push(0);return c.forEach((f,l)=>m[l>>>3]|=f<<7-(l&7)),new h(i,e,m,o)}getModule(t,e){return 0<=t&&t<this.size&&0<=e&&e<this.size&&this.modules[e][t]}drawFunctionPatterns(){for(let r=0;r<this.size;r++)this.setFunctionModule(6,r,r%2==0),this.setFunctionModule(r,6,r%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let t=this.getAlignmentPatternPositions(),e=t.length;for(let r=0;r<e;r++)for(let n=0;n<e;n++)r==0&&n==0||r==0&&n==e-1||r==e-1&&n==0||this.drawAlignmentPattern(t[r],t[n]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(t){let e=this.errorCorrectionLevel.formatBits<<3|t,r=e;for(let o=0;o<10;o++)r=r<<1^(r>>>9)*1335;let n=(e<<10|r)^21522;M(n>>>15==0);for(let o=0;o<=5;o++)this.setFunctionModule(8,o,$(n,o));this.setFunctionModule(8,7,$(n,6)),this.setFunctionModule(8,8,$(n,7)),this.setFunctionModule(7,8,$(n,8));for(let o=9;o<15;o++)this.setFunctionModule(14-o,8,$(n,o));for(let o=0;o<8;o++)this.setFunctionModule(this.size-1-o,8,$(n,o));for(let o=8;o<15;o++)this.setFunctionModule(8,this.size-15+o,$(n,o));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let t=this.version;for(let r=0;r<12;r++)t=t<<1^(t>>>11)*7973;let e=this.version<<12|t;M(e>>>18==0);for(let r=0;r<18;r++){let n=$(e,r),o=this.size-11+r%3,a=Math.floor(r/3);this.setFunctionModule(o,a,n),this.setFunctionModule(a,o,n)}}drawFinderPattern(t,e){for(let r=-4;r<=4;r++)for(let n=-4;n<=4;n++){let o=Math.max(Math.abs(n),Math.abs(r)),a=t+n,i=e+r;0<=a&&a<this.size&&0<=i&&i<this.size&&this.setFunctionModule(a,i,o!=2&&o!=4)}}drawAlignmentPattern(t,e){for(let r=-2;r<=2;r++)for(let n=-2;n<=2;n++)this.setFunctionModule(t+n,e+r,Math.max(Math.abs(n),Math.abs(r))!=1)}setFunctionModule(t,e,r){this.modules[e][t]=r,this.isFunction[e][t]=!0}addEccAndInterleave(t){let e=this.version,r=this.errorCorrectionLevel;if(t.length!=h.getNumDataCodewords(e,r))throw new RangeError("Invalid argument");let n=h.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][e],o=h.ECC_CODEWORDS_PER_BLOCK[r.ordinal][e],a=Math.floor(h.getNumRawDataModules(e)/8),i=n-a%n,d=Math.floor(a/n),c=[],p=h.reedSolomonComputeDivisor(o);for(let f=0,l=0;f<n;f++){let b=t.slice(l,l+d-o+(f<i?0:1));l+=b.length;let C=h.reedSolomonComputeRemainder(b,p);f<i&&b.push(0),c.push(b.concat(C))}let m=[];for(let f=0;f<c[0].length;f++)c.forEach((l,b)=>{(f!=d-o||b>=i)&&m.push(l[f])});return M(m.length==a),m}drawCodewords(t){if(t.length!=Math.floor(h.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let e=0;for(let r=this.size-1;r>=1;r-=2){r==6&&(r=5);for(let n=0;n<this.size;n++)for(let o=0;o<2;o++){let a=r-o,d=(r+1&2)==0?this.size-1-n:n;!this.isFunction[d][a]&&e<t.length*8&&(this.modules[d][a]=$(t[e>>>3],7-(e&7)),e++)}}M(e==t.length*8)}applyMask(t){if(t<0||t>7)throw new RangeError("Mask value out of range");for(let e=0;e<this.size;e++)for(let r=0;r<this.size;r++){let n;switch(t){case 0:n=(r+e)%2==0;break;case 1:n=e%2==0;break;case 2:n=r%3==0;break;case 3:n=(r+e)%3==0;break;case 4:n=(Math.floor(r/3)+Math.floor(e/2))%2==0;break;case 5:n=r*e%2+r*e%3==0;break;case 6:n=(r*e%2+r*e%3)%2==0;break;case 7:n=((r+e)%2+r*e%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[e][r]&&n&&(this.modules[e][r]=!this.modules[e][r])}}getPenaltyScore(){let t=0;for(let o=0;o<this.size;o++){let a=!1,i=0,d=[0,0,0,0,0,0,0];for(let c=0;c<this.size;c++)this.modules[o][c]==a?(i++,i==5?t+=h.PENALTY_N1:i>5&&t++):(this.finderPenaltyAddHistory(i,d),a||(t+=this.finderPenaltyCountPatterns(d)*h.PENALTY_N3),a=this.modules[o][c],i=1);t+=this.finderPenaltyTerminateAndCount(a,i,d)*h.PENALTY_N3}for(let o=0;o<this.size;o++){let a=!1,i=0,d=[0,0,0,0,0,0,0];for(let c=0;c<this.size;c++)this.modules[c][o]==a?(i++,i==5?t+=h.PENALTY_N1:i>5&&t++):(this.finderPenaltyAddHistory(i,d),a||(t+=this.finderPenaltyCountPatterns(d)*h.PENALTY_N3),a=this.modules[c][o],i=1);t+=this.finderPenaltyTerminateAndCount(a,i,d)*h.PENALTY_N3}for(let o=0;o<this.size-1;o++)for(let a=0;a<this.size-1;a++){let i=this.modules[o][a];i==this.modules[o][a+1]&&i==this.modules[o+1][a]&&i==this.modules[o+1][a+1]&&(t+=h.PENALTY_N2)}let e=0;for(let o of this.modules)e=o.reduce((a,i)=>a+(i?1:0),e);let r=this.size*this.size,n=Math.ceil(Math.abs(e*20-r*10)/r)-1;return M(0<=n&&n<=9),t+=n*h.PENALTY_N4,M(0<=t&&t<=2568888),t}getAlignmentPatternPositions(){if(this.version==1)return[];{let t=Math.floor(this.version/7)+2,e=Math.floor((this.version*8+t*3+5)/(t*4-4))*2,r=[6];for(let n=this.size-7;r.length<t;n-=e)r.splice(1,0,n);return r}}static getNumRawDataModules(t){if(t<h.MIN_VERSION||t>h.MAX_VERSION)throw new RangeError("Version number out of range");let e=(16*t+128)*t+64;if(t>=2){let r=Math.floor(t/7)+2;e-=(25*r-10)*r-55,t>=7&&(e-=36)}return M(208<=e&&e<=29648),e}static getNumDataCodewords(t,e){return Math.floor(h.getNumRawDataModules(t)/8)-h.ECC_CODEWORDS_PER_BLOCK[e.ordinal][t]*h.NUM_ERROR_CORRECTION_BLOCKS[e.ordinal][t]}static reedSolomonComputeDivisor(t){if(t<1||t>255)throw new RangeError("Degree out of range");let e=[];for(let n=0;n<t-1;n++)e.push(0);e.push(1);let r=1;for(let n=0;n<t;n++){for(let o=0;o<e.length;o++)e[o]=h.reedSolomonMultiply(e[o],r),o+1<e.length&&(e[o]^=e[o+1]);r=h.reedSolomonMultiply(r,2)}return e}static reedSolomonComputeRemainder(t,e){let r=e.map(n=>0);for(let n of t){let o=n^r.shift();r.push(0),e.forEach((a,i)=>r[i]^=h.reedSolomonMultiply(a,o))}return r}static reedSolomonMultiply(t,e){if(t>>>8||e>>>8)throw new RangeError("Byte out of range");let r=0;for(let n=7;n>=0;n--)r=r<<1^(r>>>7)*285,r^=(e>>>n&1)*t;return M(r>>>8==0),r}finderPenaltyCountPatterns(t){let e=t[1];M(e<=this.size*3);let r=e>0&&t[2]==e&&t[3]==e*3&&t[4]==e&&t[5]==e;return(r&&t[0]>=e*4&&t[6]>=e?1:0)+(r&&t[6]>=e*4&&t[0]>=e?1:0)}finderPenaltyTerminateAndCount(t,e,r){return t&&(this.finderPenaltyAddHistory(e,r),e=0),e+=this.size,this.finderPenaltyAddHistory(e,r),this.finderPenaltyCountPatterns(r)}finderPenaltyAddHistory(t,e){e[0]==0&&(t+=this.size),e.pop(),e.unshift(t)}};h.MIN_VERSION=1,h.MAX_VERSION=40,h.PENALTY_N1=3,h.PENALTY_N2=3,h.PENALTY_N3=40,h.PENALTY_N4=10,h.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],h.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];var O=h;function x(s,t,e){if(t<0||t>31||s>>>t)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)e.push(s>>>r&1)}function $(s,t){return(s>>>t&1)!=0}function M(s){if(!s)throw new Error("Assertion error")}var y=class y{constructor(t,e,r){this.mode=t;this.numChars=e;this.bitData=r;if(e<0)throw new RangeError("Invalid argument");this.bitData=r.slice()}static makeBytes(t){let e=[];for(let r of t)x(r,8,e);return new y(y.Mode.BYTE,t.length,e)}static makeNumeric(t){if(!y.isNumeric(t))throw new RangeError("String contains non-numeric characters");let e=[];for(let r=0;r<t.length;){let n=Math.min(t.length-r,3);x(parseInt(t.substring(r,r+n),10),n*3+1,e),r+=n}return new y(y.Mode.NUMERIC,t.length,e)}static makeAlphanumeric(t){if(!y.isAlphanumeric(t))throw new RangeError("String contains unencodable characters in alphanumeric mode");let e=[],r;for(r=0;r+2<=t.length;r+=2){let n=y.ALPHANUMERIC_CHARSET.indexOf(t.charAt(r))*45;n+=y.ALPHANUMERIC_CHARSET.indexOf(t.charAt(r+1)),x(n,11,e)}return r<t.length&&x(y.ALPHANUMERIC_CHARSET.indexOf(t.charAt(r)),6,e),new y(y.Mode.ALPHANUMERIC,t.length,e)}static makeSegments(t){return t==""?[]:y.isNumeric(t)?[y.makeNumeric(t)]:y.isAlphanumeric(t)?[y.makeAlphanumeric(t)]:[y.makeBytes(y.toUtf8ByteArray(t))]}static makeEci(t){let e=[];if(t<0)throw new RangeError("ECI assignment value out of range");if(t<128)x(t,8,e);else if(t<16384)x(2,2,e),x(t,14,e);else if(t<1e6)x(6,3,e),x(t,21,e);else throw new RangeError("ECI assignment value out of range");return new y(y.Mode.ECI,0,e)}static isNumeric(t){return y.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return y.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(t,e){let r=0;for(let n of t){let o=n.mode.numCharCountBits(e);if(n.numChars>=1<<o)return 1/0;r+=4+o+n.bitData.length}return r}static toUtf8ByteArray(t){t=encodeURI(t);let e=[];for(let r=0;r<t.length;r++)t.charAt(r)!="%"?e.push(t.charCodeAt(r)):(e.push(parseInt(t.substring(r+1,r+3),16)),r+=2);return e}};y.NUMERIC_REGEX=/^[0-9]*$/,y.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,y.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";var H=y;(t=>{let e=class e{constructor(n,o){this.ordinal=n;this.formatBits=o}};e.LOW=new e(0,1),e.MEDIUM=new e(1,0),e.QUARTILE=new e(2,3),e.HIGH=new e(3,2);let s=e;t.Ecc=e})(O||(O={}));(t=>{let e=class e{constructor(n,o){this.modeBits=n;this.numBitsCharCount=o}numCharCountBits(n){return this.numBitsCharCount[Math.floor((n+7)/17)]}};e.NUMERIC=new e(1,[10,12,14]),e.ALPHANUMERIC=new e(2,[9,11,13]),e.BYTE=new e(4,[8,16,16]),e.KANJI=new e(8,[8,10,12]),e.ECI=new e(7,[0,0,0]);let s=e;t.Mode=e})(H||(H={}));var D=class{constructor(t,e="H",r=1,n=40,o=-1){let a={L:O.Ecc.LOW,M:O.Ecc.MEDIUM,Q:O.Ecc.QUARTILE,H:O.Ecc.HIGH},i=H.makeSegments(t);this.qr=O.encodeSegments(i,a[e],r,n,o,!0)}getMatrix(){let t=this.qr.size,e=[];for(let r=0;r<t;r++){let n=[];for(let o=0;o<t;o++){let a=this.qr.getModule(o,r),i=this.identifyType(o,r,t);n.push({x:o,y:r,isDark:a,type:i})}e.push(n)}return e}identifyType(t,e,r){return t<7&&e<7||t>r-8&&e<7||t<7&&e>r-8?"pos-finder":"data"}};var X={"inner-eye-classy":{viewBox:"0 0 24 24",d:"M4 0H20H24V4V20C24 22.2091 22.2091 24 20 24H4H0V20V4C0 1.79086 1.79086 0 4 0Z"},"inner-eye-dot":{viewBox:"0 0 24 24",d:"M24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12Z"},"inner-eye-dots":{viewBox:"0 0 24 24",d:"M8 4C8 6.20914 6.20914 8 4 8C1.79086 8 0 6.20914 0 4C0 1.79086 1.79086 0 4 0C6.20914 0 8 1.79086 8 4Z M16 4C16 6.20914 14.2091 8 12 8C9.79086 8 8 6.20914 8 4C8 1.79086 9.79086 0 12 0C14.2091 0 16 1.79086 16 4Z M24 4C24 6.20914 22.2091 8 20 8C17.7909 8 16 6.20914 16 4C16 1.79086 17.7909 0 20 0C22.2091 0 24 1.79086 24 4Z M24 12C24 14.2091 22.2091 16 20 16C17.7909 16 16 14.2091 16 12C16 9.79086 17.7909 8 20 8C22.2091 8 24 9.79086 24 12Z M24 20C24 22.2091 22.2091 24 20 24C17.7909 24 16 22.2091 16 20C16 17.7909 17.7909 16 20 16C22.2091 16 24 17.7909 24 20Z M16 20C16 22.2091 14.2091 24 12 24C9.79086 24 8 22.2091 8 20C8 17.7909 9.79086 16 12 16C14.2091 16 16 17.7909 16 20Z M8 20C8 22.2091 6.20914 24 4 24C1.79086 24 0 22.2091 0 20C0 17.7909 1.79086 16 4 16C6.20914 16 8 17.7909 8 20Z M8 12C8 14.2091 6.20914 16 4 16C1.79086 16 0 14.2091 0 12C0 9.79086 1.79086 8 4 8C6.20914 8 8 9.79086 8 12Z M16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12Z"},"inner-eye-extra-classy":{viewBox:"0 0 24 24",d:"M8 0H16H24V8V16C24 20.4183 20.4183 24 16 24H8H0V16V8C0 3.58172 3.58172 0 8 0Z"},"inner-eye-extra-rounded":{viewBox:"0 0 24 24",d:"M0 8C0 3.58172 3.58172 0 8 0H16C20.4183 0 24 3.58172 24 8V16C24 20.4183 20.4183 24 16 24H8C3.58172 24 0 20.4183 0 16V8Z"},"inner-eye-rounded":{viewBox:"0 0 24 24",d:"M0 4C0 1.79086 1.79086 0 4 0H20C22.2091 0 24 1.79086 24 4V20C24 22.2091 22.2091 24 20 24H4C1.79086 24 0 22.2091 0 20V4Z"},"inner-eye-square":{viewBox:"0 0 24 24",d:"M0 0H24V24H0V0Z"},"outer-eye-classy":{viewBox:"0 0 24 24",d:"M24 0V22C24 23.1046 23.1046 24 22 24H0V2C0 0.895431 0.895431 0 2 0H24ZM3.5 3.5V20.5H20.5V3.5H3.5Z"},"outer-eye-dot":{viewBox:"0 0 24 24",d:"M12 0C18.6274 0 24 5.37258 24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0ZM12 3.5C7.30558 3.5 3.5 7.30558 3.5 12C3.5 16.6944 7.30558 20.5 12 20.5C16.6944 20.5 20.5 16.6944 20.5 12C20.5 7.30558 16.6944 3.5 12 3.5Z"},"outer-eye-dots":{viewBox:"0 0 24 24",d:"M1.71429 20.5714C2.66106 20.5714 3.42857 21.3389 3.42857 22.2857C3.42857 23.2325 2.66106 24 1.71429 24C0.767512 24 0 23.2325 0 22.2857C0 21.3389 0.767512 20.5714 1.71429 20.5714Z M5.14286 20.5714C6.08963 20.5714 6.85714 21.3389 6.85714 22.2857C6.85714 23.2325 6.08963 24 5.14286 24C4.19608 24 3.42857 23.2325 3.42857 22.2857C3.42857 21.3389 4.19608 20.5714 5.14286 20.5714Z M8.57143 20.5714C9.5182 20.5714 10.2857 21.3389 10.2857 22.2857C10.2857 23.2325 9.5182 24 8.57143 24C7.62466 24 6.85714 23.2325 6.85714 22.2857C6.85714 21.3389 7.62466 20.5714 8.57143 20.5714Z M12 20.5714C12.9468 20.5714 13.7143 21.3389 13.7143 22.2857C13.7143 23.2325 12.9468 24 12 24C11.0532 24 10.2857 23.2325 10.2857 22.2857C10.2857 21.3389 11.0532 20.5714 12 20.5714Z M15.4286 20.5714C16.3753 20.5714 17.1429 21.3389 17.1429 22.2857C17.1429 23.2325 16.3753 24 15.4286 24C14.4818 24 13.7143 23.2325 13.7143 22.2857C13.7143 21.3389 14.4818 20.5714 15.4286 20.5714Z M18.8571 20.5714C19.8039 20.5714 20.5714 21.3389 20.5714 22.2857C20.5714 23.2325 19.8039 24 18.8571 24C17.9104 24 17.1429 23.2325 17.1429 22.2857C17.1429 21.3389 17.9104 20.5714 18.8571 20.5714Z M22.2857 20.5714C23.2325 20.5714 24 21.3389 24 22.2857C24 23.2325 23.2325 24 22.2857 24C21.3389 24 20.5714 23.2325 20.5714 22.2857C20.5714 21.3389 21.3389 20.5714 22.2857 20.5714Z M1.71429 17.1429C2.66106 17.1429 3.42857 17.9104 3.42857 18.8571C3.42857 19.8039 2.66106 20.5714 1.71429 20.5714C0.767512 20.5714 0 19.8039 0 18.8571C0 17.9104 0.767512 17.1429 1.71429 17.1429Z M22.2857 17.1429C23.2325 17.1429 24 17.9104 24 18.8571C24 19.8039 23.2325 20.5714 22.2857 20.5714C21.3389 20.5714 20.5714 19.8039 20.5714 18.8571C20.5714 17.9104 21.3389 17.1429 22.2857 17.1429Z M1.71429 13.7143C2.66106 13.7143 3.42857 14.4818 3.42857 15.4286C3.42857 16.3753 2.66106 17.1429 1.71429 17.1429C0.767512 17.1429 0 16.3753 0 15.4286C0 14.4818 0.767512 13.7143 1.71429 13.7143Z M22.2857 13.7143C23.2325 13.7143 24 14.4818 24 15.4286C24 16.3753 23.2325 17.1429 22.2857 17.1429C21.3389 17.1429 20.5714 16.3753 20.5714 15.4286C20.5714 14.4818 21.3389 13.7143 22.2857 13.7143Z M1.71429 10.2857C2.66106 10.2857 3.42857 11.0532 3.42857 12C3.42857 12.9468 2.66106 13.7143 1.71429 13.7143C0.767512 13.7143 0 12.9468 0 12C0 11.0532 0.767512 10.2857 1.71429 10.2857Z M22.2857 10.2857C23.2325 10.2857 24 11.0532 24 12C24 12.9468 23.2325 13.7143 22.2857 13.7143C21.3389 13.7143 20.5714 12.9468 20.5714 12C20.5714 11.0532 21.3389 10.2857 22.2857 10.2857Z M1.71429 6.85714C2.66106 6.85714 3.42857 7.62466 3.42857 8.57143C3.42857 9.5182 2.66106 10.2857 1.71429 10.2857C0.767512 10.2857 0 9.5182 0 8.57143C0 7.62466 0.767512 6.85714 1.71429 6.85714Z M22.2857 6.85714C23.2325 6.85714 24 7.62466 24 8.57143C24 9.5182 23.2325 10.2857 22.2857 10.2857C21.3389 10.2857 20.5714 9.5182 20.5714 8.57143C20.5714 7.62466 21.3389 6.85714 22.2857 6.85714Z M1.71429 3.42857C2.66106 3.42857 3.42857 4.19608 3.42857 5.14286C3.42857 6.08963 2.66106 6.85714 1.71429 6.85714C0.767512 6.85714 0 6.08963 0 5.14286C0 4.19608 0.767512 3.42857 1.71429 3.42857Z M22.2857 3.42857C23.2325 3.42857 24 4.19608 24 5.14286C24 6.08963 23.2325 6.85714 22.2857 6.85714C21.3389 6.85714 20.5714 6.08963 20.5714 5.14286C20.5714 4.19608 21.3389 3.42857 22.2857 3.42857Z M1.71429 0C2.66106 0 3.42857 0.767512 3.42857 1.71429C3.42857 2.66106 2.66106 3.42857 1.71429 3.42857C0.767512 3.42857 0 2.66106 0 1.71429C0 0.767512 0.767512 0 1.71429 0Z M5.14286 0C6.08963 0 6.85714 0.767512 6.85714 1.71429C6.85714 2.66106 6.08963 3.42857 5.14286 3.42857C4.19608 3.42857 3.42857 2.66106 3.42857 1.71429C3.42857 0.767512 4.19608 0 5.14286 0Z M8.57143 0C9.5182 0 10.2857 0.767512 10.2857 1.71429C10.2857 2.66106 9.5182 3.42857 8.57143 3.42857C7.62466 3.42857 6.85714 2.66106 6.85714 1.71429C6.85714 0.767512 7.62466 0 8.57143 0Z M12 0C12.9468 0 13.7143 0.767512 13.7143 1.71429C13.7143 2.66106 12.9468 3.42857 12 3.42857C11.0532 3.42857 10.2857 2.66106 10.2857 1.71429C10.2857 0.767512 11.0532 0 12 0Z M15.4286 0C16.3753 0 17.1429 0.767512 17.1429 1.71429C17.1429 2.66106 16.3753 3.42857 15.4286 3.42857C14.4818 3.42857 13.7143 2.66106 13.7143 1.71429C13.7143 0.767512 14.4818 0 15.4286 0Z M18.8571 0C19.8039 0 20.5714 0.767512 20.5714 1.71429C20.5714 2.66106 19.8039 3.42857 18.8571 3.42857C17.9104 3.42857 17.1429 2.66106 17.1429 1.71429C17.1429 0.767512 17.9104 0 18.8571 0Z M22.2857 0C23.2325 0 24 0.767512 24 1.71429C24 2.66106 23.2325 3.42857 22.2857 3.42857C21.3389 3.42857 20.5714 2.66106 20.5714 1.71429C20.5714 0.767512 21.3389 0 22.2857 0Z"},"outer-eye-extra-classy":{viewBox:"0 0 24 24",d:"M24 0V20C24 22.2091 22.2091 24 20 24H0V4C2.57702e-07 1.79086 1.79086 0 4 0H24ZM3.5 3.5V20.5H20.5V3.5H3.5Z"},"outer-eye-extra-rounded":{viewBox:"0 0 24 24",d:"M16 0C20.4183 0 24 3.58172 24 8V16C24 20.4183 20.4183 24 16 24H8C3.58172 24 1.28855e-07 20.4183 0 16V8C0 3.58172 3.58172 1.28851e-07 8 0H16ZM9 3.5C5.96243 3.5 3.5 5.96243 3.5 9V15C3.5 18.0376 5.96243 20.5 9 20.5H15C18.0376 20.5 20.5 18.0376 20.5 15V9C20.5 5.96243 18.0376 3.5 15 3.5H9Z"},"outer-eye-rounded":{viewBox:"0 0 24 24",d:"M20 0C22.2091 2.57702e-07 24 1.79086 24 4V20C24 22.2091 22.2091 24 20 24H4C1.79086 24 6.44266e-08 22.2091 0 20V4C2.57702e-07 1.79086 1.79086 6.44266e-08 4 0H20ZM3.5 3.5V20.5H20.5V3.5H3.5Z"},"outer-eye-square":{viewBox:"0 0 24 24",d:"M24 24H0V0H24V24ZM3.5 3.5V20.5H20.5V3.5H3.5Z"},"dots-classy":{viewBox:"0 0 24 24",d:"M16 4C16 1.79086 17.7909 0 20 0H24V4C24 6.20914 22.2091 8 20 8H16V4Z M4 0C1.79086 0 0 1.79086 0 4V8V24H16H20C22.2091 24 24 22.2091 24 20V16H16V8L8 8V0H4Z"},"dots-classy-rounded":{viewBox:"0 0 24 24",d:"M16 4C16 1.79086 17.7909 0 20 0H24V4C24 6.20914 22.2091 8 20 8H16V4Z M8 0C3.58172 5.15422e-07 0 3.58172 0 8V24H16C20.4183 24 24 20.4183 24 16H16V8L8 8V0Z"},"dots-extra-rounded":{viewBox:"0 0 24 24",d:"M16 4.00003C16 1.79089 17.7909 2.47955e-05 20 2.47955e-05C22.2092 2.47955e-05 24 1.79089 24 4.00003C24 6.20916 22.2092 8.00003 20 8.00003C17.7909 8.00003 16 6.20916 16 4.00003Z M8 4V8C12.4183 8 16 11.5817 16 16H20C22.2091 16 24 17.7909 24 20C24 22.2091 22.2091 24 20 24H8C3.58172 24 0 20.4183 0 16V4C0 1.79086 1.79086 0 4 0C6.20914 0 8 1.79086 8 4Z"},dots:{viewBox:"0 0 24 24",d:"M16 20C16 17.7909 17.7909 16 20 16C22.2091 16 24 17.7909 24 20C24 22.2091 22.2091 24 20 24C17.7909 24 16 22.2091 16 20Z M8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12Z M16 4C16 1.79086 17.7909 0 20 0C22.2091 0 24 1.79086 24 4C24 6.20914 22.2091 8 20 8C17.7909 8 16 6.20914 16 4Z M8 20C8 17.7909 9.79086 16 12 16C14.2091 16 16 17.7909 16 20C16 22.2091 14.2091 24 12 24C9.79086 24 8 22.2091 8 20Z M0 4C0 1.79086 1.79086 0 4 0C6.20914 0 8 1.79086 8 4C8 6.20914 6.20914 8 4 8C1.79086 8 0 6.20914 0 4Z M0 12C0 9.79086 1.79086 8 4 8C6.20914 8 8 9.79086 8 12C8 14.2091 6.20914 16 4 16C1.79086 16 0 14.2091 0 12Z M0 20C0 17.7909 1.79086 16 4 16C6.20914 16 8 17.7909 8 20C8 22.2091 6.20914 24 4 24C1.79086 24 0 22.2091 0 20Z"},"dots-rounded":{viewBox:"0 0 24 24",d:"M16 4C16 1.79086 17.7908 0 20 0C22.2091 0 24 1.79086 24 4C24 6.20914 22.2091 8 20 8C17.7908 8 16 6.20914 16 4Z M3.99976 24.0001C1.79062 24.0001 -0.000244141 22.2092 -0.000244141 20.0001L-1.35708e-05 12L-0.000244141 4.00007C-0.000244141 1.79093 1.79062 7.00951e-05 3.99976 7.00951e-05C6.20889 7.00951e-05 7.99976 1.79093 7.99976 4.00007L7.99999 8H12C14.2091 8 16 9.79086 16 12L15.9998 16.0001H19.9998C22.2089 16.0001 23.9998 17.7909 23.9998 20.0001C23.9998 22.2092 22.2089 24.0001 19.9998 24.0001L12 24L3.99976 24.0001Z"},"dots-square":{viewBox:"0 0 24 24",d:"M16 0H24V8H16V0Z M24 24V16H16V8L8 8V0H0V8V24H16H24Z"}},nt={INNER_EYE_CLASSY:"inner-eye-classy",INNER_EYE_DOT:"inner-eye-dot",INNER_EYE_DOTS:"inner-eye-dots",INNER_EYE_EXTRA_CLASSY:"inner-eye-extra-classy",INNER_EYE_EXTRA_ROUNDED:"inner-eye-extra-rounded",INNER_EYE_ROUNDED:"inner-eye-rounded",INNER_EYE_SQUARE:"inner-eye-square",OUTER_EYE_CLASSY:"outer-eye-classy",OUTER_EYE_DOT:"outer-eye-dot",OUTER_EYE_DOTS:"outer-eye-dots",OUTER_EYE_EXTRA_CLASSY:"outer-eye-extra-classy",OUTER_EYE_EXTRA_ROUNDED:"outer-eye-extra-rounded",OUTER_EYE_ROUNDED:"outer-eye-rounded",OUTER_EYE_SQUARE:"outer-eye-square",DOTS_CLASSY:"dots-classy",DOTS_CLASSY_ROUNDED:"dots-classy-rounded",DOTS_EXTRA_ROUNDED:"dots-extra-rounded",DOTS:"dots",DOTS_ROUNDED:"dots-rounded",DOTS_SQUARE:"dots-square",CUSTOM_ICON:"custom-icon"};async function bt(s){if(typeof window<"u"&&typeof document<"u")return new Promise((o,a)=>{let i=new Image;i.crossOrigin="Anonymous",i.onload=()=>{let d=document.createElement("canvas");d.width=i.width,d.height=i.height;let c=d.getContext("2d");if(!c)return a(new Error("Canvas 2D not supported"));c.drawImage(i,0,0);let p=c.getImageData(0,0,i.width,i.height);o({data:p.data,width:i.width,height:i.height})},i.onerror=a,i.src=s});let t;if(s.startsWith("data:")){let o=s.indexOf(","),a=s.slice(o+1);t=typeof Buffer<"u"?Buffer.from(a,"base64"):s}else t=s;let e;try{let o=await import("sharp");e=o.default||o}catch{throw new Error("The 'sharp' package is required for frame detection in Node.js.")}let{data:r,info:n}=await e(t).ensureAlpha().raw().toBuffer({resolveWithObject:!0});return{data:r,width:n.width,height:n.height}}function wt(s,t){if(s[t+3]<128)return!0;let r=s[t],n=s[t+1],o=s[t+2];return .299*r+.587*n+.114*o>240}function Et(s){let t=[],e={left:0,width:0,height:0},r=s.length;for(let n=0;n<=r;n++){let o=n<r?s[n]:0;for(;t.length>0&&o<s[t[t.length-1]];){let a=s[t.pop()],i=t.length>0?t[t.length-1]+1:0,d=n-i;d*a>e.width*e.height&&(e={left:i,width:d,height:a})}t.push(n)}return e}async function ot(s,t,e){try{let{data:r,width:n,height:o}=await bt(s),a=new Array(n).fill(0),i={x:0,y:0,width:0,height:0,area:0};for(let p=0;p<o;p++){for(let C=0;C<n;C++){let S=(p*n+C)*4;a[C]=wt(r,S)?a[C]+1:0}let{left:m,width:f,height:l}=Et(a),b=f*l;b>i.area&&(i={x:m,y:p-l+1,width:f,height:l,area:b})}if(i.area===0)return null;let d=t/n,c=e/o;return{x:Math.round(i.x*d),y:Math.round(i.y*c),width:Math.round(i.width*d),height:Math.round(i.height*c)}}catch(r){return console.warn("[detectFrameInset] Detection failed:",r),null}}async function it(s,t,e={}){if(t==="svg")return typeof Buffer<"u"?Buffer.from(s,"utf-8"):new TextEncoder().encode(s);let r=typeof Buffer<"u"?Buffer.from(s,"utf-8"):s,n;try{let i=await import("sharp");n=i.default||i}catch{throw new Error("The 'sharp' package is required for PNG/JPEG/WEBP export in Node.js.")}let o=n(r);(e.width||e.height)&&(o=o.resize(e.width,e.height,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}));let a=e.quality??90;switch(t){case"png":return o.png().toBuffer();case"jpeg":return o.jpeg({quality:a}).toBuffer();case"webp":return o.webp({quality:a}).toBuffer();default:throw new Error(`[exportQR] Unsupported format: "${t}". Use: svg | png | jpeg | webp`)}}var st={backgroundOptions:{color:"#ffffff"},dotsOptions:{type:"inner-eye-square",color:"#000000"},cornersDotOptions:{type:"inner-eye-square",color:"#000000"},cornersSquareOptions:{type:"inner-eye-square",color:"#000000"}};function xt(s,t,e){let r=s>=0&&s<7&&t>=0&&t<7,n=s>=e-7&&s<e&&t>=0&&t<7,o=s>=0&&s<7&&t>=e-7&&t<e;if(r||n||o){let a=s,i=t;return n&&(a=s-(e-7)),o&&(i=t-(e-7)),a>=2&&a<=4&&i>=2&&i<=4?"cornerDot":"cornerSquare"}return"dots"}function Mt(s,t){return[{id:"tl",x:t,y:t},{id:"tr",x:s-7+t,y:t},{id:"bl",x:t,y:s-7+t}]}function At(s,t,e){return[{x:2,y:2},{x:e-7+2,y:2},{x:2,y:e-7+2}].some(n=>n.x===s&&n.y===t)}function Q(s,t,e,r,n,o){let a=t.colorStops.map(C=>`<stop offset="${C.offset}" stop-color="${C.color}" />`).join(""),i=(t.rotation||0)*(Math.PI/180),d=e+n/2,c=r+o/2,p=Math.sqrt(n*n+o*o)/2,m=(d-p*Math.cos(i)).toFixed(2),f=(c-p*Math.sin(i)).toFixed(2),l=(d+p*Math.cos(i)).toFixed(2),b=(c+p*Math.sin(i)).toFixed(2);return`
2
+ <linearGradient id="${s}" gradientUnits="userSpaceOnUse" x1="${m}" y1="${f}" x2="${l}" y2="${b}">
3
3
  ${a}
4
4
  </linearGradient>
5
- `}function G(i,t){if(t.type==="custom-icon"&&t.customPath)return`
6
- <symbol id="${i}" viewBox="${t.customViewBox||"0 0 24 24"}">
5
+ `}function G(s,t){if(t.type==="custom-icon"&&t.customPath)return`
6
+ <symbol id="${s}" viewBox="${t.customViewBox||"0 0 24 24"}">
7
7
  <path d="${t.customPath}" />
8
8
  </symbol>
9
9
  `;if(t.type!=="custom-icon"){let e=X[t.type]||X["inner-eye-square"],r=typeof e=="string"?e:e.d,n=typeof e=="string"?"0 0 24 24":e.viewBox||"0 0 24 24";return`
10
- <symbol id="${i}" viewBox="${n}">
10
+ <symbol id="${s}" viewBox="${n}">
11
11
  <path d="${r}" />
12
12
  </symbol>
13
- `}return""}function U(i){return[{id:"top-left",x:0,y:0},{id:"top-right",x:i-7,y:0},{id:"bottom-left",x:0,y:i-7}]}function lt(i,t,e,r,n){for(let o of U(n))if(i<o.x+7&&i+e>o.x&&t<o.y+7&&t+r>o.y)return!0;return!1}function St(i,t,e){let r=i.x,n=i.y;for(let o of U(e)){let a=r<o.x+7&&r+i.width>o.x,s=n<o.y+7&&n+i.height>o.y;if(!a||!s)continue;let h=[{axis:"x",dir:1,depth:o.x+7-r},{axis:"x",dir:-1,depth:r+i.width-o.x},{axis:"y",dir:1,depth:o.y+7-n},{axis:"y",dir:-1,depth:n+i.height-o.y}].filter(f=>f.depth>0).sort((f,c)=>f.depth-c.depth);if(!h.length)continue;let l=h[0],p=r,m=n;l.axis==="x"?r=l.dir>0?o.x+7:o.x-i.width:n=l.dir>0?o.y+7:o.y-i.height,console.warn(`[QR] images[${t}] overlaps the "${o.id}" eye zone. Auto-adjusted: (${p.toFixed(1)}, ${m.toFixed(1)}) \u2192 (${r.toFixed(1)}, ${n.toFixed(1)}).`)}return{...i,x:r,y:n}}function Nt(i,t){let e=i.filter(c=>c.x!=null&&c.y!=null),r=i.filter(c=>c.x==null||c.y==null),n=e.map(c=>{let b=i.indexOf(c);return lt(c.x,c.y,c.width,c.height,t)?St(c,b,t):c});if(r.length===0)return[...n];let o=8,s=t-8-o,h=t/2,l=t/2,p=[{x:h,y:l},{x:o+s*.25,y:l},{x:o+s*.75,y:l},{x:h,y:o+s*.25},{x:h,y:o+s*.75},{x:o+s*.75,y:o+s*.75},{x:o+s*.75,y:o+s*.25},{x:o+s*.25,y:o+s*.75},{x:o+s*.25,y:o+s*.25}],m=[],f=0;for(let c of r){let b=!1;for(;f<p.length;){let C=p[f++],S=C.x-c.width/2,P=C.y-c.height/2;if(!lt(S,P,c.width,c.height,t)){m.push({...c,x:S,y:P}),b=!0;break}}b||m.push({...c,x:(t-c.width)/2,y:(t-c.height)/2})}return[...n,...m]}async function Bt(i){let t={...at,...i},r=new D(t.data,t.qrOptions?.errorCorrectionLevel||"H").getMatrix(),n=r.length,o=t.margin??4,a=U(n).map(u=>({...u,width:7,height:7})),s=(u,g)=>({maxX:Math.max(0,n-u),maxY:Math.max(0,n-g)}),h=u=>({svg:u,matrixSize:n,eyeZones:a,getMaxPos:s}),l=n+o*2,p=t.width??1e3,m=t.height??1e3,f=vt(n,o),c=7,b=3,C="";t.backgroundOptions?.gradient&&(C+=Y("grad-bg",t.backgroundOptions.gradient,0,0,l,l)),t.dotsOptions.gradient&&(C+=Y("grad-dots",t.dotsOptions.gradient,0,0,l,l)),f.forEach(u=>{t.cornersSquareOptions.gradient&&(C+=Y(`grad-sq-${u.id}`,t.cornersSquareOptions.gradient,u.x,u.y,c,c)),t.cornersDotOptions.gradient&&(C+=Y(`grad-dot-${u.id}`,t.cornersDotOptions.gradient,u.x+2,u.y+2,b,b))}),C+=G("icon-dots",t.dotsOptions),C+=G("icon-sq",t.cornersSquareOptions),C+=G("icon-dot",t.cornersDotOptions);let S={dots:"",cornerSquare:"",cornerDot:""},P=Array(n).fill(!1).map(()=>Array(n).fill(!1)),W=Nt(t.images||[],n);for(let u=0;u<n;u++)for(let g=0;g<n;g++){if(P[u][g]||!r[u][g].isDark||W.some(B=>{if(!B.excludeDots)return!1;let I=B.x,tt=B.y;return g>=I-.5&&g<=I+B.width-.5&&u>=tt-.5&&u<=tt+B.height-.5}))continue;let R=At(g,u,n),A,Z="";R==="dots"?(A=t.dotsOptions,Z="#icon-dots"):R==="cornerSquare"?(A=t.cornersSquareOptions,Z="#icon-sq"):(A=t.cornersDotOptions,Z="#icon-dot");let v=1;if(R==="cornerDot"&&A.isSingle){if(!Ot(g,u,n))continue;v=3;for(let B=0;B<3;B++)for(let I=0;I<3;I++)u+B<n&&g+I<n&&(P[u+B][g+I]=!0)}let N=A.scale??1,q=g+o,z=u+o,L=v*N,V=v*N,F=(v-L)/2,k=(v-V)/2;S[R]+=`<use href="${Z}" x="${q+F}" y="${z+k}" width="${L}" height="${V}" />`}let ct=()=>{if(!S.dots)return"";let u=t.dotsOptions.gradient?"url(#grad-dots)":t.dotsOptions.color;return`
13
+ `}return""}function Y(s){return[{id:"top-left",x:0,y:0},{id:"top-right",x:s-7,y:0},{id:"bottom-left",x:0,y:s-7}]}function at(s,t,e,r,n){for(let o of Y(n))if(s<o.x+7&&s+e>o.x&&t<o.y+7&&t+r>o.y)return!0;return!1}function Rt(s,t,e){let r=s.x,n=s.y;for(let o of Y(e)){let a=r<o.x+7&&r+s.width>o.x,i=n<o.y+7&&n+s.height>o.y;if(!a||!i)continue;let d=[{axis:"x",dir:1,depth:o.x+7-r},{axis:"x",dir:-1,depth:r+s.width-o.x},{axis:"y",dir:1,depth:o.y+7-n},{axis:"y",dir:-1,depth:n+s.height-o.y}].filter(f=>f.depth>0).sort((f,l)=>f.depth-l.depth);if(!d.length)continue;let c=d[0],p=r,m=n;c.axis==="x"?r=c.dir>0?o.x+7:o.x-s.width:n=c.dir>0?o.y+7:o.y-s.height,console.warn(`[QR] images[${t}] overlaps the "${o.id}" eye zone. Auto-adjusted: (${p.toFixed(1)}, ${m.toFixed(1)}) \u2192 (${r.toFixed(1)}, ${n.toFixed(1)}).`)}return{...s,x:r,y:n}}function vt(s,t){let e=s.filter(l=>l.x!=null&&l.y!=null),r=s.filter(l=>l.x==null||l.y==null),n=e.map(l=>{let b=s.indexOf(l);return at(l.x,l.y,l.width,l.height,t)?Rt(l,b,t):l});if(r.length===0)return[...n];let o=8,i=t-8-o,d=t/2,c=t/2,p=[{x:d,y:c},{x:o+i*.25,y:c},{x:o+i*.75,y:c},{x:d,y:o+i*.25},{x:d,y:o+i*.75},{x:o+i*.75,y:o+i*.75},{x:o+i*.75,y:o+i*.25},{x:o+i*.25,y:o+i*.75},{x:o+i*.25,y:o+i*.25}],m=[],f=0;for(let l of r){let b=!1;for(;f<p.length;){let C=p[f++],S=C.x-l.width/2,Z=C.y-l.height/2;if(!at(S,Z,l.width,l.height,t)){m.push({...l,x:S,y:Z}),b=!0;break}}b||m.push({...l,x:(t-l.width)/2,y:(t-l.height)/2})}return[...n,...m]}async function Ot(s){let t={...st,...s},r=new D(t.data,t.qrOptions?.errorCorrectionLevel||"H").getMatrix(),n=r.length,o=t.margin??4,a=Y(n).map(u=>({...u,width:7,height:7})),i=(u,g)=>({maxX:Math.max(0,n-u),maxY:Math.max(0,n-g)}),d=u=>({svg:u,matrixSize:n,eyeZones:a,getMaxPos:i}),c=n+o*2,p=t.width??1e3,m=t.height??1e3,f=Mt(n,o),l=7,b=3,C="";t.backgroundOptions?.gradient&&(C+=Q("grad-bg",t.backgroundOptions.gradient,0,0,c,c)),t.dotsOptions.gradient&&(C+=Q("grad-dots",t.dotsOptions.gradient,0,0,c,c)),f.forEach(u=>{t.cornersSquareOptions.gradient&&(C+=Q(`grad-sq-${u.id}`,t.cornersSquareOptions.gradient,u.x,u.y,l,l)),t.cornersDotOptions.gradient&&(C+=Q(`grad-dot-${u.id}`,t.cornersDotOptions.gradient,u.x+2,u.y+2,b,b))}),C+=G("icon-dots",t.dotsOptions),C+=G("icon-sq",t.cornersSquareOptions),C+=G("icon-dot",t.cornersDotOptions);let S={dots:"",cornerSquare:"",cornerDot:""},Z=Array(n).fill(!1).map(()=>Array(n).fill(!1)),_=vt(t.images||[],n);for(let u=0;u<n;u++)for(let g=0;g<n;g++){if(Z[u][g]||!r[u][g].isDark||_.some(B=>{if(!B.excludeDots)return!1;let I=B.x,tt=B.y;return g>=I-.5&&g<=I+B.width-.5&&u>=tt-.5&&u<=tt+B.height-.5}))continue;let A=xt(g,u,n),R,P="";A==="dots"?(R=t.dotsOptions,P="#icon-dots"):A==="cornerSquare"?(R=t.cornersSquareOptions,P="#icon-sq"):(R=t.cornersDotOptions,P="#icon-dot");let v=1;if(A==="cornerDot"&&R.isSingle){if(!At(g,u,n))continue;v=3;for(let B=0;B<3;B++)for(let I=0;I<3;I++)u+B<n&&g+I<n&&(Z[u+B][g+I]=!0)}let N=R.scale??1,q=g+o,z=u+o,L=v*N,V=v*N,k=(v-L)/2,F=(v-V)/2;S[A]+=`<use href="${P}" x="${q+k}" y="${z+F}" width="${L}" height="${V}" />`}let ct=()=>{if(!S.dots)return"";let u=t.dotsOptions.gradient?"url(#grad-dots)":t.dotsOptions.color;return`
14
14
  <mask id="mask-dots">
15
15
  <rect width="100%" height="100%" fill="black" />
16
16
  <g fill="white">${S.dots}</g>
17
17
  </mask>
18
18
  <rect width="100%" height="100%" fill="${u}" mask="url(#mask-dots)" />
19
- `},j=(u,g,E)=>{if(!S[u])return"";let R=`mask-${u}`,A=`
20
- <mask id="${R}">
19
+ `},W=(u,g,E)=>{if(!S[u])return"";let A=`mask-${u}`,R=`
20
+ <mask id="${A}">
21
21
  <rect width="100%" height="100%" fill="black" />
22
22
  <g fill="white" shape-rendering="crispEdges">${S[u]}</g>
23
23
  </mask>
24
- `,Z="";return f.forEach(v=>{let N=E.color;E.gradient&&(N=`url(#${g}-${v.id})`),Z+=`<rect x="${v.x}" y="${v.y}" width="${c}" height="${c}" fill="${N}" mask="url(#${R})" />`}),`<defs>${A}</defs>${Z}`},ut=()=>t.backgroundOptions?.gradient?"url(#grad-bg)":t.backgroundOptions?.color||"white",K="";W.forEach(u=>{let g=u.x+o,E=u.y+o,R=u.preserveAspectRatio??"xMidYMid meet",A=u.opacity!=null?` opacity="${u.opacity}"`:"";K+=`<image href="${u.source}" x="${g}" y="${E}" width="${u.width}" height="${u.height}" preserveAspectRatio="${R}"${A} />`});let T=t.borderRadius?t.borderRadius/p*l:0,_=T>0?`rx="${T.toFixed(3)}"`:"",dt=T>0?`<clipPath id="qr-clip"><rect width="${l}" height="${l}" ${_} /></clipPath>`:"",ht=T>0?'clip-path="url(#qr-clip)"':"",J=`
24
+ `,P="";return f.forEach(v=>{let N=E.color;E.gradient&&(N=`url(#${g}-${v.id})`),P+=`<rect x="${v.x}" y="${v.y}" width="${l}" height="${l}" fill="${N}" mask="url(#${A})" />`}),`<defs>${R}</defs>${P}`},lt=()=>t.backgroundOptions?.gradient?"url(#grad-bg)":t.backgroundOptions?.color||"white",j="";_.forEach(u=>{let g=u.x+o,E=u.y+o,A=u.preserveAspectRatio??"xMidYMid meet",R=u.opacity!=null?` opacity="${u.opacity}"`:"";j+=`<image href="${u.source}" x="${g}" y="${E}" width="${u.width}" height="${u.height}" preserveAspectRatio="${A}"${R} />`});let T=t.borderRadius?t.borderRadius/p*c:0,K=T>0?`rx="${T.toFixed(3)}"`:"",dt=T>0?`<clipPath id="qr-clip"><rect width="${c}" height="${c}" ${K} /></clipPath>`:"",ut=T>0?'clip-path="url(#qr-clip)"':"",J=`
25
25
  <defs>${C}${dt}</defs>
26
- <g ${ht}>
27
- <rect width="100%" height="100%" fill="${ut()}" ${_}/>
26
+ <g ${ut}>
27
+ <rect width="100%" height="100%" fill="${lt()}" ${K}/>
28
28
  ${t.backgroundOptions?.image?`<image href="${t.backgroundOptions.image}" width="100%" height="100%" preserveAspectRatio="none" />`:""}
29
29
  ${ct()}
30
- ${j("cornerSquare","grad-sq",t.cornersSquareOptions)}
31
- ${j("cornerDot","grad-dot",t.cornersDotOptions)}
32
- ${K}
33
- </g>`,w=t.frame;if(w){let u=w.inset,g=!u||u.x==null||u.y==null,E=g?await ot(w.source,w.width,w.height):null;if(g&&!E){let F=w.width*.8,k=w.height*.8;E={x:(w.width-F)/2,y:(w.height-k)/2,width:F,height:k}}let R=u?.width??E.width,A=u?.height??E.height,Z=u?.x??E.x+(E.width-R)/2,v=u?.y??E.y+(E.height-A)/2,N={x:Z,y:v,width:R,height:A},q=t.width??w.width,z=t.height??w.height,L=N.width/l,V=N.height/l;return h(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${w.width} ${w.height}" width="${q}" height="${z}">
30
+ ${W("cornerSquare","grad-sq",t.cornersSquareOptions)}
31
+ ${W("cornerDot","grad-dot",t.cornersDotOptions)}
32
+ ${j}
33
+ </g>`,w=t.frame;if(w){let u=w.inset,g=!u||u.x==null||u.y==null,E=g?await ot(w.source,w.width,w.height):null;if(g&&!E){let k=w.width*.8,F=w.height*.8;E={x:(w.width-k)/2,y:(w.height-F)/2,width:k,height:F}}let A=u?.width??E.width,R=u?.height??E.height,P=u?.x??E.x+(E.width-A)/2,v=u?.y??E.y+(E.height-R)/2,N={x:P,y:v,width:A,height:R},q=t.width??w.width,z=t.height??w.height,L=N.width/c,V=N.height/c;return d(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${w.width} ${w.height}" width="${q}" height="${z}">
34
34
  <!-- Frame image (behind everything) -->
35
35
  <image href="${w.source}" x="0" y="0" width="${w.width}" height="${w.height}" preserveAspectRatio="xMidYMid slice" />
36
36
  <!-- QR code scaled into the inset area -->
37
37
  <g transform="translate(${N.x}, ${N.y}) scale(${L.toFixed(6)}, ${V.toFixed(6)})">
38
38
  ${J}
39
39
  </g>
40
- </svg>`)}return h(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${l} ${l}" width="${p}" height="${m}">
40
+ </svg>`)}return d(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${c} ${c}" width="${p}" height="${m}">
41
41
  ${J}
42
- </svg>`)}function $t(i,t="H"){let r=new D(i,t).getMatrix().length,n=U(r).map(o=>({...o,width:7,height:7}));return{matrixSize:r,eyeZones:n,getMaxPos:(o,a)=>({maxX:Math.max(0,r-o),maxY:Math.max(0,r-a)})}}0&&(module.exports={QRCodeGenerate,exportQR,getQRBounds});
42
+ </svg>`)}function St(s,t="H"){let r=new D(s,t).getMatrix().length,n=Y(r).map(o=>({...o,width:7,height:7}));return{matrixSize:r,eyeZones:n,getMaxPos:(o,a)=>({maxX:Math.max(0,r-o),maxY:Math.max(0,r-a)})}}0&&(module.exports={QRCodeGenerate,QRShapes,exportQR,getQRBounds});
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- var d=class d{constructor(t,e,r,n){this.version=t;this.errorCorrectionLevel=e;this.modules=[];this.isFunction=[];if(t<d.MIN_VERSION||t>d.MAX_VERSION)throw new RangeError("Version value out of range");if(n<-1||n>7)throw new RangeError("Mask value out of range");this.size=t*4+17;let o=[];for(let i=0;i<this.size;i++)o.push(!1);for(let i=0;i<this.size;i++)this.modules.push(o.slice()),this.isFunction.push(o.slice());this.drawFunctionPatterns();let a=this.addEccAndInterleave(r);if(this.drawCodewords(a),n==-1){let i=1e9;for(let h=0;h<8;h++){this.applyMask(h),this.drawFormatBits(h);let l=this.getPenaltyScore();l<i&&(n=h,i=l),this.applyMask(h)}}M(0<=n&&n<=7),this.mask=n,this.applyMask(n),this.drawFormatBits(n),this.isFunction=[]}static encodeText(t,e){let r=$.makeSegments(t);return d.encodeSegments(r,e)}static encodeBinary(t,e){let r=$.makeBytes(t);return d.encodeSegments([r],e)}static encodeSegments(t,e,r=1,n=40,o=-1,a=!0){if(!(d.MIN_VERSION<=r&&r<=n&&n<=d.MAX_VERSION)||o<-1||o>7)throw new RangeError("Invalid value");let i,h;for(i=r;;i++){let f=d.getNumDataCodewords(i,e)*8,c=$.getTotalBits(t,i);if(c<=f){h=c;break}if(i>=n)throw new RangeError("Data too long")}for(let f of[d.Ecc.MEDIUM,d.Ecc.QUARTILE,d.Ecc.HIGH])a&&h<=d.getNumDataCodewords(i,f)*8&&(e=f);let l=[];for(let f of t){x(f.mode.modeBits,4,l),x(f.numChars,f.mode.numCharCountBits(i),l);for(let c of f.getData())l.push(c)}M(l.length==h);let p=d.getNumDataCodewords(i,e)*8;M(l.length<=p),x(0,Math.min(4,p-l.length),l),x(0,(8-l.length%8)%8,l),M(l.length%8==0);for(let f=236;l.length<p;f^=253)x(f,8,l);let m=[];for(;m.length*8<l.length;)m.push(0);return l.forEach((f,c)=>m[c>>>3]|=f<<7-(c&7)),new d(i,e,m,o)}getModule(t,e){return 0<=t&&t<this.size&&0<=e&&e<this.size&&this.modules[e][t]}drawFunctionPatterns(){for(let r=0;r<this.size;r++)this.setFunctionModule(6,r,r%2==0),this.setFunctionModule(r,6,r%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let t=this.getAlignmentPatternPositions(),e=t.length;for(let r=0;r<e;r++)for(let n=0;n<e;n++)r==0&&n==0||r==0&&n==e-1||r==e-1&&n==0||this.drawAlignmentPattern(t[r],t[n]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(t){let e=this.errorCorrectionLevel.formatBits<<3|t,r=e;for(let o=0;o<10;o++)r=r<<1^(r>>>9)*1335;let n=(e<<10|r)^21522;M(n>>>15==0);for(let o=0;o<=5;o++)this.setFunctionModule(8,o,H(n,o));this.setFunctionModule(8,7,H(n,6)),this.setFunctionModule(8,8,H(n,7)),this.setFunctionModule(7,8,H(n,8));for(let o=9;o<15;o++)this.setFunctionModule(14-o,8,H(n,o));for(let o=0;o<8;o++)this.setFunctionModule(this.size-1-o,8,H(n,o));for(let o=8;o<15;o++)this.setFunctionModule(8,this.size-15+o,H(n,o));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let t=this.version;for(let r=0;r<12;r++)t=t<<1^(t>>>11)*7973;let e=this.version<<12|t;M(e>>>18==0);for(let r=0;r<18;r++){let n=H(e,r),o=this.size-11+r%3,a=Math.floor(r/3);this.setFunctionModule(o,a,n),this.setFunctionModule(a,o,n)}}drawFinderPattern(t,e){for(let r=-4;r<=4;r++)for(let n=-4;n<=4;n++){let o=Math.max(Math.abs(n),Math.abs(r)),a=t+n,i=e+r;0<=a&&a<this.size&&0<=i&&i<this.size&&this.setFunctionModule(a,i,o!=2&&o!=4)}}drawAlignmentPattern(t,e){for(let r=-2;r<=2;r++)for(let n=-2;n<=2;n++)this.setFunctionModule(t+n,e+r,Math.max(Math.abs(n),Math.abs(r))!=1)}setFunctionModule(t,e,r){this.modules[e][t]=r,this.isFunction[e][t]=!0}addEccAndInterleave(t){let e=this.version,r=this.errorCorrectionLevel;if(t.length!=d.getNumDataCodewords(e,r))throw new RangeError("Invalid argument");let n=d.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][e],o=d.ECC_CODEWORDS_PER_BLOCK[r.ordinal][e],a=Math.floor(d.getNumRawDataModules(e)/8),i=n-a%n,h=Math.floor(a/n),l=[],p=d.reedSolomonComputeDivisor(o);for(let f=0,c=0;f<n;f++){let b=t.slice(c,c+h-o+(f<i?0:1));c+=b.length;let C=d.reedSolomonComputeRemainder(b,p);f<i&&b.push(0),l.push(b.concat(C))}let m=[];for(let f=0;f<l[0].length;f++)l.forEach((c,b)=>{(f!=h-o||b>=i)&&m.push(c[f])});return M(m.length==a),m}drawCodewords(t){if(t.length!=Math.floor(d.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let e=0;for(let r=this.size-1;r>=1;r-=2){r==6&&(r=5);for(let n=0;n<this.size;n++)for(let o=0;o<2;o++){let a=r-o,h=(r+1&2)==0?this.size-1-n:n;!this.isFunction[h][a]&&e<t.length*8&&(this.modules[h][a]=H(t[e>>>3],7-(e&7)),e++)}}M(e==t.length*8)}applyMask(t){if(t<0||t>7)throw new RangeError("Mask value out of range");for(let e=0;e<this.size;e++)for(let r=0;r<this.size;r++){let n;switch(t){case 0:n=(r+e)%2==0;break;case 1:n=e%2==0;break;case 2:n=r%3==0;break;case 3:n=(r+e)%3==0;break;case 4:n=(Math.floor(r/3)+Math.floor(e/2))%2==0;break;case 5:n=r*e%2+r*e%3==0;break;case 6:n=(r*e%2+r*e%3)%2==0;break;case 7:n=((r+e)%2+r*e%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[e][r]&&n&&(this.modules[e][r]=!this.modules[e][r])}}getPenaltyScore(){let t=0;for(let o=0;o<this.size;o++){let a=!1,i=0,h=[0,0,0,0,0,0,0];for(let l=0;l<this.size;l++)this.modules[o][l]==a?(i++,i==5?t+=d.PENALTY_N1:i>5&&t++):(this.finderPenaltyAddHistory(i,h),a||(t+=this.finderPenaltyCountPatterns(h)*d.PENALTY_N3),a=this.modules[o][l],i=1);t+=this.finderPenaltyTerminateAndCount(a,i,h)*d.PENALTY_N3}for(let o=0;o<this.size;o++){let a=!1,i=0,h=[0,0,0,0,0,0,0];for(let l=0;l<this.size;l++)this.modules[l][o]==a?(i++,i==5?t+=d.PENALTY_N1:i>5&&t++):(this.finderPenaltyAddHistory(i,h),a||(t+=this.finderPenaltyCountPatterns(h)*d.PENALTY_N3),a=this.modules[l][o],i=1);t+=this.finderPenaltyTerminateAndCount(a,i,h)*d.PENALTY_N3}for(let o=0;o<this.size-1;o++)for(let a=0;a<this.size-1;a++){let i=this.modules[o][a];i==this.modules[o][a+1]&&i==this.modules[o+1][a]&&i==this.modules[o+1][a+1]&&(t+=d.PENALTY_N2)}let e=0;for(let o of this.modules)e=o.reduce((a,i)=>a+(i?1:0),e);let r=this.size*this.size,n=Math.ceil(Math.abs(e*20-r*10)/r)-1;return M(0<=n&&n<=9),t+=n*d.PENALTY_N4,M(0<=t&&t<=2568888),t}getAlignmentPatternPositions(){if(this.version==1)return[];{let t=Math.floor(this.version/7)+2,e=Math.floor((this.version*8+t*3+5)/(t*4-4))*2,r=[6];for(let n=this.size-7;r.length<t;n-=e)r.splice(1,0,n);return r}}static getNumRawDataModules(t){if(t<d.MIN_VERSION||t>d.MAX_VERSION)throw new RangeError("Version number out of range");let e=(16*t+128)*t+64;if(t>=2){let r=Math.floor(t/7)+2;e-=(25*r-10)*r-55,t>=7&&(e-=36)}return M(208<=e&&e<=29648),e}static getNumDataCodewords(t,e){return Math.floor(d.getNumRawDataModules(t)/8)-d.ECC_CODEWORDS_PER_BLOCK[e.ordinal][t]*d.NUM_ERROR_CORRECTION_BLOCKS[e.ordinal][t]}static reedSolomonComputeDivisor(t){if(t<1||t>255)throw new RangeError("Degree out of range");let e=[];for(let n=0;n<t-1;n++)e.push(0);e.push(1);let r=1;for(let n=0;n<t;n++){for(let o=0;o<e.length;o++)e[o]=d.reedSolomonMultiply(e[o],r),o+1<e.length&&(e[o]^=e[o+1]);r=d.reedSolomonMultiply(r,2)}return e}static reedSolomonComputeRemainder(t,e){let r=e.map(n=>0);for(let n of t){let o=n^r.shift();r.push(0),e.forEach((a,i)=>r[i]^=d.reedSolomonMultiply(a,o))}return r}static reedSolomonMultiply(t,e){if(t>>>8||e>>>8)throw new RangeError("Byte out of range");let r=0;for(let n=7;n>=0;n--)r=r<<1^(r>>>7)*285,r^=(e>>>n&1)*t;return M(r>>>8==0),r}finderPenaltyCountPatterns(t){let e=t[1];M(e<=this.size*3);let r=e>0&&t[2]==e&&t[3]==e*3&&t[4]==e&&t[5]==e;return(r&&t[0]>=e*4&&t[6]>=e?1:0)+(r&&t[6]>=e*4&&t[0]>=e?1:0)}finderPenaltyTerminateAndCount(t,e,r){return t&&(this.finderPenaltyAddHistory(e,r),e=0),e+=this.size,this.finderPenaltyAddHistory(e,r),this.finderPenaltyCountPatterns(r)}finderPenaltyAddHistory(t,e){e[0]==0&&(t+=this.size),e.pop(),e.unshift(t)}};d.MIN_VERSION=1,d.MAX_VERSION=40,d.PENALTY_N1=3,d.PENALTY_N2=3,d.PENALTY_N3=40,d.PENALTY_N4=10,d.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],d.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];var O=d;function x(s,t,e){if(t<0||t>31||s>>>t)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)e.push(s>>>r&1)}function H(s,t){return(s>>>t&1)!=0}function M(s){if(!s)throw new Error("Assertion error")}var y=class y{constructor(t,e,r){this.mode=t;this.numChars=e;this.bitData=r;if(e<0)throw new RangeError("Invalid argument");this.bitData=r.slice()}static makeBytes(t){let e=[];for(let r of t)x(r,8,e);return new y(y.Mode.BYTE,t.length,e)}static makeNumeric(t){if(!y.isNumeric(t))throw new RangeError("String contains non-numeric characters");let e=[];for(let r=0;r<t.length;){let n=Math.min(t.length-r,3);x(parseInt(t.substring(r,r+n),10),n*3+1,e),r+=n}return new y(y.Mode.NUMERIC,t.length,e)}static makeAlphanumeric(t){if(!y.isAlphanumeric(t))throw new RangeError("String contains unencodable characters in alphanumeric mode");let e=[],r;for(r=0;r+2<=t.length;r+=2){let n=y.ALPHANUMERIC_CHARSET.indexOf(t.charAt(r))*45;n+=y.ALPHANUMERIC_CHARSET.indexOf(t.charAt(r+1)),x(n,11,e)}return r<t.length&&x(y.ALPHANUMERIC_CHARSET.indexOf(t.charAt(r)),6,e),new y(y.Mode.ALPHANUMERIC,t.length,e)}static makeSegments(t){return t==""?[]:y.isNumeric(t)?[y.makeNumeric(t)]:y.isAlphanumeric(t)?[y.makeAlphanumeric(t)]:[y.makeBytes(y.toUtf8ByteArray(t))]}static makeEci(t){let e=[];if(t<0)throw new RangeError("ECI assignment value out of range");if(t<128)x(t,8,e);else if(t<16384)x(2,2,e),x(t,14,e);else if(t<1e6)x(6,3,e),x(t,21,e);else throw new RangeError("ECI assignment value out of range");return new y(y.Mode.ECI,0,e)}static isNumeric(t){return y.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return y.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(t,e){let r=0;for(let n of t){let o=n.mode.numCharCountBits(e);if(n.numChars>=1<<o)return 1/0;r+=4+o+n.bitData.length}return r}static toUtf8ByteArray(t){t=encodeURI(t);let e=[];for(let r=0;r<t.length;r++)t.charAt(r)!="%"?e.push(t.charCodeAt(r)):(e.push(parseInt(t.substring(r+1,r+3),16)),r+=2);return e}};y.NUMERIC_REGEX=/^[0-9]*$/,y.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,y.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";var $=y;(t=>{let e=class e{constructor(n,o){this.ordinal=n;this.formatBits=o}};e.LOW=new e(0,1),e.MEDIUM=new e(1,0),e.QUARTILE=new e(2,3),e.HIGH=new e(3,2);let s=e;t.Ecc=e})(O||(O={}));(t=>{let e=class e{constructor(n,o){this.modeBits=n;this.numBitsCharCount=o}numCharCountBits(n){return this.numBitsCharCount[Math.floor((n+7)/17)]}};e.NUMERIC=new e(1,[10,12,14]),e.ALPHANUMERIC=new e(2,[9,11,13]),e.BYTE=new e(4,[8,16,16]),e.KANJI=new e(8,[8,10,12]),e.ECI=new e(7,[0,0,0]);let s=e;t.Mode=e})($||($={}));var D=class{constructor(t,e="H",r=1,n=40,o=-1){let a={L:O.Ecc.LOW,M:O.Ecc.MEDIUM,Q:O.Ecc.QUARTILE,H:O.Ecc.HIGH},i=$.makeSegments(t);this.qr=O.encodeSegments(i,a[e],r,n,o,!0)}getMatrix(){let t=this.qr.size,e=[];for(let r=0;r<t;r++){let n=[];for(let o=0;o<t;o++){let a=this.qr.getModule(o,r),i=this.identifyType(o,r,t);n.push({x:o,y:r,isDark:a,type:i})}e.push(n)}return e}identifyType(t,e,r){return t<7&&e<7||t>r-8&&e<7||t<7&&e>r-8?"pos-finder":"data"}};var z={"inner-eye-classy":{viewBox:"0 0 24 24",d:"M4 0H20H24V4V20C24 22.2091 22.2091 24 20 24H4H0V20V4C0 1.79086 1.79086 0 4 0Z"},"inner-eye-dot":{viewBox:"0 0 24 24",d:"M24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12Z"},"inner-eye-dots":{viewBox:"0 0 24 24",d:"M8 4C8 6.20914 6.20914 8 4 8C1.79086 8 0 6.20914 0 4C0 1.79086 1.79086 0 4 0C6.20914 0 8 1.79086 8 4Z M16 4C16 6.20914 14.2091 8 12 8C9.79086 8 8 6.20914 8 4C8 1.79086 9.79086 0 12 0C14.2091 0 16 1.79086 16 4Z M24 4C24 6.20914 22.2091 8 20 8C17.7909 8 16 6.20914 16 4C16 1.79086 17.7909 0 20 0C22.2091 0 24 1.79086 24 4Z M24 12C24 14.2091 22.2091 16 20 16C17.7909 16 16 14.2091 16 12C16 9.79086 17.7909 8 20 8C22.2091 8 24 9.79086 24 12Z M24 20C24 22.2091 22.2091 24 20 24C17.7909 24 16 22.2091 16 20C16 17.7909 17.7909 16 20 16C22.2091 16 24 17.7909 24 20Z M16 20C16 22.2091 14.2091 24 12 24C9.79086 24 8 22.2091 8 20C8 17.7909 9.79086 16 12 16C14.2091 16 16 17.7909 16 20Z M8 20C8 22.2091 6.20914 24 4 24C1.79086 24 0 22.2091 0 20C0 17.7909 1.79086 16 4 16C6.20914 16 8 17.7909 8 20Z M8 12C8 14.2091 6.20914 16 4 16C1.79086 16 0 14.2091 0 12C0 9.79086 1.79086 8 4 8C6.20914 8 8 9.79086 8 12Z M16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12Z"},"inner-eye-extra-classy":{viewBox:"0 0 24 24",d:"M8 0H16H24V8V16C24 20.4183 20.4183 24 16 24H8H0V16V8C0 3.58172 3.58172 0 8 0Z"},"inner-eye-extra-rounded":{viewBox:"0 0 24 24",d:"M0 8C0 3.58172 3.58172 0 8 0H16C20.4183 0 24 3.58172 24 8V16C24 20.4183 20.4183 24 16 24H8C3.58172 24 0 20.4183 0 16V8Z"},"inner-eye-rounded":{viewBox:"0 0 24 24",d:"M0 4C0 1.79086 1.79086 0 4 0H20C22.2091 0 24 1.79086 24 4V20C24 22.2091 22.2091 24 20 24H4C1.79086 24 0 22.2091 0 20V4Z"},"inner-eye-square":{viewBox:"0 0 24 24",d:"M0 0H24V24H0V0Z"},"outer-eye-classy":{viewBox:"0 0 24 24",d:"M24 0V22C24 23.1046 23.1046 24 22 24H0V2C0 0.895431 0.895431 0 2 0H24ZM3.5 3.5V20.5H20.5V3.5H3.5Z"},"outer-eye-dot":{viewBox:"0 0 24 24",d:"M12 0C18.6274 0 24 5.37258 24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0ZM12 3.5C7.30558 3.5 3.5 7.30558 3.5 12C3.5 16.6944 7.30558 20.5 12 20.5C16.6944 20.5 20.5 16.6944 20.5 12C20.5 7.30558 16.6944 3.5 12 3.5Z"},"outer-eye-dots":{viewBox:"0 0 24 24",d:"M1.71429 20.5714C2.66106 20.5714 3.42857 21.3389 3.42857 22.2857C3.42857 23.2325 2.66106 24 1.71429 24C0.767512 24 0 23.2325 0 22.2857C0 21.3389 0.767512 20.5714 1.71429 20.5714Z M5.14286 20.5714C6.08963 20.5714 6.85714 21.3389 6.85714 22.2857C6.85714 23.2325 6.08963 24 5.14286 24C4.19608 24 3.42857 23.2325 3.42857 22.2857C3.42857 21.3389 4.19608 20.5714 5.14286 20.5714Z M8.57143 20.5714C9.5182 20.5714 10.2857 21.3389 10.2857 22.2857C10.2857 23.2325 9.5182 24 8.57143 24C7.62466 24 6.85714 23.2325 6.85714 22.2857C6.85714 21.3389 7.62466 20.5714 8.57143 20.5714Z M12 20.5714C12.9468 20.5714 13.7143 21.3389 13.7143 22.2857C13.7143 23.2325 12.9468 24 12 24C11.0532 24 10.2857 23.2325 10.2857 22.2857C10.2857 21.3389 11.0532 20.5714 12 20.5714Z M15.4286 20.5714C16.3753 20.5714 17.1429 21.3389 17.1429 22.2857C17.1429 23.2325 16.3753 24 15.4286 24C14.4818 24 13.7143 23.2325 13.7143 22.2857C13.7143 21.3389 14.4818 20.5714 15.4286 20.5714Z M18.8571 20.5714C19.8039 20.5714 20.5714 21.3389 20.5714 22.2857C20.5714 23.2325 19.8039 24 18.8571 24C17.9104 24 17.1429 23.2325 17.1429 22.2857C17.1429 21.3389 17.9104 20.5714 18.8571 20.5714Z M22.2857 20.5714C23.2325 20.5714 24 21.3389 24 22.2857C24 23.2325 23.2325 24 22.2857 24C21.3389 24 20.5714 23.2325 20.5714 22.2857C20.5714 21.3389 21.3389 20.5714 22.2857 20.5714Z M1.71429 17.1429C2.66106 17.1429 3.42857 17.9104 3.42857 18.8571C3.42857 19.8039 2.66106 20.5714 1.71429 20.5714C0.767512 20.5714 0 19.8039 0 18.8571C0 17.9104 0.767512 17.1429 1.71429 17.1429Z M22.2857 17.1429C23.2325 17.1429 24 17.9104 24 18.8571C24 19.8039 23.2325 20.5714 22.2857 20.5714C21.3389 20.5714 20.5714 19.8039 20.5714 18.8571C20.5714 17.9104 21.3389 17.1429 22.2857 17.1429Z M1.71429 13.7143C2.66106 13.7143 3.42857 14.4818 3.42857 15.4286C3.42857 16.3753 2.66106 17.1429 1.71429 17.1429C0.767512 17.1429 0 16.3753 0 15.4286C0 14.4818 0.767512 13.7143 1.71429 13.7143Z M22.2857 13.7143C23.2325 13.7143 24 14.4818 24 15.4286C24 16.3753 23.2325 17.1429 22.2857 17.1429C21.3389 17.1429 20.5714 16.3753 20.5714 15.4286C20.5714 14.4818 21.3389 13.7143 22.2857 13.7143Z M1.71429 10.2857C2.66106 10.2857 3.42857 11.0532 3.42857 12C3.42857 12.9468 2.66106 13.7143 1.71429 13.7143C0.767512 13.7143 0 12.9468 0 12C0 11.0532 0.767512 10.2857 1.71429 10.2857Z M22.2857 10.2857C23.2325 10.2857 24 11.0532 24 12C24 12.9468 23.2325 13.7143 22.2857 13.7143C21.3389 13.7143 20.5714 12.9468 20.5714 12C20.5714 11.0532 21.3389 10.2857 22.2857 10.2857Z M1.71429 6.85714C2.66106 6.85714 3.42857 7.62466 3.42857 8.57143C3.42857 9.5182 2.66106 10.2857 1.71429 10.2857C0.767512 10.2857 0 9.5182 0 8.57143C0 7.62466 0.767512 6.85714 1.71429 6.85714Z M22.2857 6.85714C23.2325 6.85714 24 7.62466 24 8.57143C24 9.5182 23.2325 10.2857 22.2857 10.2857C21.3389 10.2857 20.5714 9.5182 20.5714 8.57143C20.5714 7.62466 21.3389 6.85714 22.2857 6.85714Z M1.71429 3.42857C2.66106 3.42857 3.42857 4.19608 3.42857 5.14286C3.42857 6.08963 2.66106 6.85714 1.71429 6.85714C0.767512 6.85714 0 6.08963 0 5.14286C0 4.19608 0.767512 3.42857 1.71429 3.42857Z M22.2857 3.42857C23.2325 3.42857 24 4.19608 24 5.14286C24 6.08963 23.2325 6.85714 22.2857 6.85714C21.3389 6.85714 20.5714 6.08963 20.5714 5.14286C20.5714 4.19608 21.3389 3.42857 22.2857 3.42857Z M1.71429 0C2.66106 0 3.42857 0.767512 3.42857 1.71429C3.42857 2.66106 2.66106 3.42857 1.71429 3.42857C0.767512 3.42857 0 2.66106 0 1.71429C0 0.767512 0.767512 0 1.71429 0Z M5.14286 0C6.08963 0 6.85714 0.767512 6.85714 1.71429C6.85714 2.66106 6.08963 3.42857 5.14286 3.42857C4.19608 3.42857 3.42857 2.66106 3.42857 1.71429C3.42857 0.767512 4.19608 0 5.14286 0Z M8.57143 0C9.5182 0 10.2857 0.767512 10.2857 1.71429C10.2857 2.66106 9.5182 3.42857 8.57143 3.42857C7.62466 3.42857 6.85714 2.66106 6.85714 1.71429C6.85714 0.767512 7.62466 0 8.57143 0Z M12 0C12.9468 0 13.7143 0.767512 13.7143 1.71429C13.7143 2.66106 12.9468 3.42857 12 3.42857C11.0532 3.42857 10.2857 2.66106 10.2857 1.71429C10.2857 0.767512 11.0532 0 12 0Z M15.4286 0C16.3753 0 17.1429 0.767512 17.1429 1.71429C17.1429 2.66106 16.3753 3.42857 15.4286 3.42857C14.4818 3.42857 13.7143 2.66106 13.7143 1.71429C13.7143 0.767512 14.4818 0 15.4286 0Z M18.8571 0C19.8039 0 20.5714 0.767512 20.5714 1.71429C20.5714 2.66106 19.8039 3.42857 18.8571 3.42857C17.9104 3.42857 17.1429 2.66106 17.1429 1.71429C17.1429 0.767512 17.9104 0 18.8571 0Z M22.2857 0C23.2325 0 24 0.767512 24 1.71429C24 2.66106 23.2325 3.42857 22.2857 3.42857C21.3389 3.42857 20.5714 2.66106 20.5714 1.71429C20.5714 0.767512 21.3389 0 22.2857 0Z"},"outer-eye-extra-classy":{viewBox:"0 0 24 24",d:"M24 0V20C24 22.2091 22.2091 24 20 24H0V4C2.57702e-07 1.79086 1.79086 0 4 0H24ZM3.5 3.5V20.5H20.5V3.5H3.5Z"},"outer-eye-extra-rounded":{viewBox:"0 0 24 24",d:"M16 0C20.4183 0 24 3.58172 24 8V16C24 20.4183 20.4183 24 16 24H8C3.58172 24 1.28855e-07 20.4183 0 16V8C0 3.58172 3.58172 1.28851e-07 8 0H16ZM9 3.5C5.96243 3.5 3.5 5.96243 3.5 9V15C3.5 18.0376 5.96243 20.5 9 20.5H15C18.0376 20.5 20.5 18.0376 20.5 15V9C20.5 5.96243 18.0376 3.5 15 3.5H9Z"},"outer-eye-rounded":{viewBox:"0 0 24 24",d:"M20 0C22.2091 2.57702e-07 24 1.79086 24 4V20C24 22.2091 22.2091 24 20 24H4C1.79086 24 6.44266e-08 22.2091 0 20V4C2.57702e-07 1.79086 1.79086 6.44266e-08 4 0H20ZM3.5 3.5V20.5H20.5V3.5H3.5Z"},"outer-eye-square":{viewBox:"0 0 24 24",d:"M24 24H0V0H24V24ZM3.5 3.5V20.5H20.5V3.5H3.5Z"},"dots-classy":{viewBox:"0 0 24 24",d:"M16 4C16 1.79086 17.7909 0 20 0H24V4C24 6.20914 22.2091 8 20 8H16V4Z M4 0C1.79086 0 0 1.79086 0 4V8V24H16H20C22.2091 24 24 22.2091 24 20V16H16V8L8 8V0H4Z"},"dots-classy-rounded":{viewBox:"0 0 24 24",d:"M16 4C16 1.79086 17.7909 0 20 0H24V4C24 6.20914 22.2091 8 20 8H16V4Z M8 0C3.58172 5.15422e-07 0 3.58172 0 8V24H16C20.4183 24 24 20.4183 24 16H16V8L8 8V0Z"},"dots-extra-rounded":{viewBox:"0 0 24 24",d:"M16 4.00003C16 1.79089 17.7909 2.47955e-05 20 2.47955e-05C22.2092 2.47955e-05 24 1.79089 24 4.00003C24 6.20916 22.2092 8.00003 20 8.00003C17.7909 8.00003 16 6.20916 16 4.00003Z M8 4V8C12.4183 8 16 11.5817 16 16H20C22.2091 16 24 17.7909 24 20C24 22.2091 22.2091 24 20 24H8C3.58172 24 0 20.4183 0 16V4C0 1.79086 1.79086 0 4 0C6.20914 0 8 1.79086 8 4Z"},dots:{viewBox:"0 0 24 24",d:"M16 20C16 17.7909 17.7909 16 20 16C22.2091 16 24 17.7909 24 20C24 22.2091 22.2091 24 20 24C17.7909 24 16 22.2091 16 20Z M8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12Z M16 4C16 1.79086 17.7909 0 20 0C22.2091 0 24 1.79086 24 4C24 6.20914 22.2091 8 20 8C17.7909 8 16 6.20914 16 4Z M8 20C8 17.7909 9.79086 16 12 16C14.2091 16 16 17.7909 16 20C16 22.2091 14.2091 24 12 24C9.79086 24 8 22.2091 8 20Z M0 4C0 1.79086 1.79086 0 4 0C6.20914 0 8 1.79086 8 4C8 6.20914 6.20914 8 4 8C1.79086 8 0 6.20914 0 4Z M0 12C0 9.79086 1.79086 8 4 8C6.20914 8 8 9.79086 8 12C8 14.2091 6.20914 16 4 16C1.79086 16 0 14.2091 0 12Z M0 20C0 17.7909 1.79086 16 4 16C6.20914 16 8 17.7909 8 20C8 22.2091 6.20914 24 4 24C1.79086 24 0 22.2091 0 20Z"},"dots-rounded":{viewBox:"0 0 24 24",d:"M16 4C16 1.79086 17.7908 0 20 0C22.2091 0 24 1.79086 24 4C24 6.20914 22.2091 8 20 8C17.7908 8 16 6.20914 16 4Z M3.99976 24.0001C1.79062 24.0001 -0.000244141 22.2092 -0.000244141 20.0001L-1.35708e-05 12L-0.000244141 4.00007C-0.000244141 1.79093 1.79062 7.00951e-05 3.99976 7.00951e-05C6.20889 7.00951e-05 7.99976 1.79093 7.99976 4.00007L7.99999 8H12C14.2091 8 16 9.79086 16 12L15.9998 16.0001H19.9998C22.2089 16.0001 23.9998 17.7909 23.9998 20.0001C23.9998 22.2092 22.2089 24.0001 19.9998 24.0001L12 24L3.99976 24.0001Z"},"dots-square":{viewBox:"0 0 24 24",d:"M16 0H24V8H16V0Z M24 24V16H16V8L8 8V0H0V8V24H16H24Z"}};import at from"sharp";var lt=128,ct=240;async function ut(s){let t;if(s.startsWith("data:")){let n=s.indexOf(","),o=s.slice(n+1);t=Buffer.from(o,"base64")}else t=s;let{data:e,info:r}=await at(t).ensureAlpha().raw().toBuffer({resolveWithObject:!0});return{data:e,width:r.width,height:r.height}}function dt(s,t){if(s[t+3]<lt)return!0;let r=s[t],n=s[t+1],o=s[t+2];return .299*r+.587*n+.114*o>ct}function ht(s){let t=[],e={left:0,width:0,height:0},r=s.length;for(let n=0;n<=r;n++){let o=n<r?s[n]:0;for(;t.length>0&&o<s[t[t.length-1]];){let a=s[t.pop()],i=t.length>0?t[t.length-1]+1:0,h=n-i;h*a>e.width*e.height&&(e={left:i,width:h,height:a})}t.push(n)}return e}async function tt(s,t,e){try{let{data:r,width:n,height:o}=await ut(s),a=new Array(n).fill(0),i={x:0,y:0,width:0,height:0,area:0};for(let p=0;p<o;p++){for(let C=0;C<n;C++){let S=(p*n+C)*4;a[C]=dt(r,S)?a[C]+1:0}let{left:m,width:f,height:c}=ht(a),b=f*c;b>i.area&&(i={x:m,y:p-c+1,width:f,height:c,area:b})}if(i.area===0)return null;let h=t/n,l=e/o;return{x:Math.round(i.x*h),y:Math.round(i.y*l),width:Math.round(i.width*h),height:Math.round(i.height*l)}}catch(r){return console.warn("[detectFrameInset] Detection failed:",r),null}}import ft from"sharp";async function yt(s,t,e={}){if(t==="svg")return Buffer.from(s,"utf-8");let r=Buffer.from(s,"utf-8"),n=ft(r);(e.width||e.height)&&(n=n.resize(e.width,e.height,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}));let o=e.quality??90;switch(t){case"png":return n.png().toBuffer();case"jpeg":return n.jpeg({quality:o}).toBuffer();case"webp":return n.webp({quality:o}).toBuffer();default:throw new Error(`[exportQR] Unsupported format: "${t}". Use: svg | png | jpeg | webp`)}}var et={backgroundOptions:{color:"#ffffff"},dotsOptions:{type:"inner-eye-square",color:"#000000"},cornersDotOptions:{type:"inner-eye-square",color:"#000000"},cornersSquareOptions:{type:"inner-eye-square",color:"#000000"}};function pt(s,t,e){let r=s>=0&&s<7&&t>=0&&t<7,n=s>=e-7&&s<e&&t>=0&&t<7,o=s>=0&&s<7&&t>=e-7&&t<e;if(r||n||o){let a=s,i=t;return n&&(a=s-(e-7)),o&&(i=t-(e-7)),a>=2&&a<=4&&i>=2&&i<=4?"cornerDot":"cornerSquare"}return"dots"}function Ct(s,t){return[{id:"tl",x:t,y:t},{id:"tr",x:s-7+t,y:t},{id:"bl",x:t,y:s-7+t}]}function mt(s,t,e){return[{x:2,y:2},{x:e-7+2,y:2},{x:2,y:e-7+2}].some(n=>n.x===s&&n.y===t)}function Q(s,t,e,r,n,o){let a=t.colorStops.map(C=>`<stop offset="${C.offset}" stop-color="${C.color}" />`).join(""),i=(t.rotation||0)*(Math.PI/180),h=e+n/2,l=r+o/2,p=Math.sqrt(n*n+o*o)/2,m=(h-p*Math.cos(i)).toFixed(2),f=(l-p*Math.sin(i)).toFixed(2),c=(h+p*Math.cos(i)).toFixed(2),b=(l+p*Math.sin(i)).toFixed(2);return`
2
- <linearGradient id="${s}" gradientUnits="userSpaceOnUse" x1="${m}" y1="${f}" x2="${c}" y2="${b}">
1
+ var h=class h{constructor(t,e,r,n){this.version=t;this.errorCorrectionLevel=e;this.modules=[];this.isFunction=[];if(t<h.MIN_VERSION||t>h.MAX_VERSION)throw new RangeError("Version value out of range");if(n<-1||n>7)throw new RangeError("Mask value out of range");this.size=t*4+17;let o=[];for(let i=0;i<this.size;i++)o.push(!1);for(let i=0;i<this.size;i++)this.modules.push(o.slice()),this.isFunction.push(o.slice());this.drawFunctionPatterns();let a=this.addEccAndInterleave(r);if(this.drawCodewords(a),n==-1){let i=1e9;for(let d=0;d<8;d++){this.applyMask(d),this.drawFormatBits(d);let c=this.getPenaltyScore();c<i&&(n=d,i=c),this.applyMask(d)}}M(0<=n&&n<=7),this.mask=n,this.applyMask(n),this.drawFormatBits(n),this.isFunction=[]}static encodeText(t,e){let r=H.makeSegments(t);return h.encodeSegments(r,e)}static encodeBinary(t,e){let r=H.makeBytes(t);return h.encodeSegments([r],e)}static encodeSegments(t,e,r=1,n=40,o=-1,a=!0){if(!(h.MIN_VERSION<=r&&r<=n&&n<=h.MAX_VERSION)||o<-1||o>7)throw new RangeError("Invalid value");let i,d;for(i=r;;i++){let f=h.getNumDataCodewords(i,e)*8,l=H.getTotalBits(t,i);if(l<=f){d=l;break}if(i>=n)throw new RangeError("Data too long")}for(let f of[h.Ecc.MEDIUM,h.Ecc.QUARTILE,h.Ecc.HIGH])a&&d<=h.getNumDataCodewords(i,f)*8&&(e=f);let c=[];for(let f of t){x(f.mode.modeBits,4,c),x(f.numChars,f.mode.numCharCountBits(i),c);for(let l of f.getData())c.push(l)}M(c.length==d);let p=h.getNumDataCodewords(i,e)*8;M(c.length<=p),x(0,Math.min(4,p-c.length),c),x(0,(8-c.length%8)%8,c),M(c.length%8==0);for(let f=236;c.length<p;f^=253)x(f,8,c);let m=[];for(;m.length*8<c.length;)m.push(0);return c.forEach((f,l)=>m[l>>>3]|=f<<7-(l&7)),new h(i,e,m,o)}getModule(t,e){return 0<=t&&t<this.size&&0<=e&&e<this.size&&this.modules[e][t]}drawFunctionPatterns(){for(let r=0;r<this.size;r++)this.setFunctionModule(6,r,r%2==0),this.setFunctionModule(r,6,r%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let t=this.getAlignmentPatternPositions(),e=t.length;for(let r=0;r<e;r++)for(let n=0;n<e;n++)r==0&&n==0||r==0&&n==e-1||r==e-1&&n==0||this.drawAlignmentPattern(t[r],t[n]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(t){let e=this.errorCorrectionLevel.formatBits<<3|t,r=e;for(let o=0;o<10;o++)r=r<<1^(r>>>9)*1335;let n=(e<<10|r)^21522;M(n>>>15==0);for(let o=0;o<=5;o++)this.setFunctionModule(8,o,$(n,o));this.setFunctionModule(8,7,$(n,6)),this.setFunctionModule(8,8,$(n,7)),this.setFunctionModule(7,8,$(n,8));for(let o=9;o<15;o++)this.setFunctionModule(14-o,8,$(n,o));for(let o=0;o<8;o++)this.setFunctionModule(this.size-1-o,8,$(n,o));for(let o=8;o<15;o++)this.setFunctionModule(8,this.size-15+o,$(n,o));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let t=this.version;for(let r=0;r<12;r++)t=t<<1^(t>>>11)*7973;let e=this.version<<12|t;M(e>>>18==0);for(let r=0;r<18;r++){let n=$(e,r),o=this.size-11+r%3,a=Math.floor(r/3);this.setFunctionModule(o,a,n),this.setFunctionModule(a,o,n)}}drawFinderPattern(t,e){for(let r=-4;r<=4;r++)for(let n=-4;n<=4;n++){let o=Math.max(Math.abs(n),Math.abs(r)),a=t+n,i=e+r;0<=a&&a<this.size&&0<=i&&i<this.size&&this.setFunctionModule(a,i,o!=2&&o!=4)}}drawAlignmentPattern(t,e){for(let r=-2;r<=2;r++)for(let n=-2;n<=2;n++)this.setFunctionModule(t+n,e+r,Math.max(Math.abs(n),Math.abs(r))!=1)}setFunctionModule(t,e,r){this.modules[e][t]=r,this.isFunction[e][t]=!0}addEccAndInterleave(t){let e=this.version,r=this.errorCorrectionLevel;if(t.length!=h.getNumDataCodewords(e,r))throw new RangeError("Invalid argument");let n=h.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][e],o=h.ECC_CODEWORDS_PER_BLOCK[r.ordinal][e],a=Math.floor(h.getNumRawDataModules(e)/8),i=n-a%n,d=Math.floor(a/n),c=[],p=h.reedSolomonComputeDivisor(o);for(let f=0,l=0;f<n;f++){let b=t.slice(l,l+d-o+(f<i?0:1));l+=b.length;let C=h.reedSolomonComputeRemainder(b,p);f<i&&b.push(0),c.push(b.concat(C))}let m=[];for(let f=0;f<c[0].length;f++)c.forEach((l,b)=>{(f!=d-o||b>=i)&&m.push(l[f])});return M(m.length==a),m}drawCodewords(t){if(t.length!=Math.floor(h.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let e=0;for(let r=this.size-1;r>=1;r-=2){r==6&&(r=5);for(let n=0;n<this.size;n++)for(let o=0;o<2;o++){let a=r-o,d=(r+1&2)==0?this.size-1-n:n;!this.isFunction[d][a]&&e<t.length*8&&(this.modules[d][a]=$(t[e>>>3],7-(e&7)),e++)}}M(e==t.length*8)}applyMask(t){if(t<0||t>7)throw new RangeError("Mask value out of range");for(let e=0;e<this.size;e++)for(let r=0;r<this.size;r++){let n;switch(t){case 0:n=(r+e)%2==0;break;case 1:n=e%2==0;break;case 2:n=r%3==0;break;case 3:n=(r+e)%3==0;break;case 4:n=(Math.floor(r/3)+Math.floor(e/2))%2==0;break;case 5:n=r*e%2+r*e%3==0;break;case 6:n=(r*e%2+r*e%3)%2==0;break;case 7:n=((r+e)%2+r*e%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[e][r]&&n&&(this.modules[e][r]=!this.modules[e][r])}}getPenaltyScore(){let t=0;for(let o=0;o<this.size;o++){let a=!1,i=0,d=[0,0,0,0,0,0,0];for(let c=0;c<this.size;c++)this.modules[o][c]==a?(i++,i==5?t+=h.PENALTY_N1:i>5&&t++):(this.finderPenaltyAddHistory(i,d),a||(t+=this.finderPenaltyCountPatterns(d)*h.PENALTY_N3),a=this.modules[o][c],i=1);t+=this.finderPenaltyTerminateAndCount(a,i,d)*h.PENALTY_N3}for(let o=0;o<this.size;o++){let a=!1,i=0,d=[0,0,0,0,0,0,0];for(let c=0;c<this.size;c++)this.modules[c][o]==a?(i++,i==5?t+=h.PENALTY_N1:i>5&&t++):(this.finderPenaltyAddHistory(i,d),a||(t+=this.finderPenaltyCountPatterns(d)*h.PENALTY_N3),a=this.modules[c][o],i=1);t+=this.finderPenaltyTerminateAndCount(a,i,d)*h.PENALTY_N3}for(let o=0;o<this.size-1;o++)for(let a=0;a<this.size-1;a++){let i=this.modules[o][a];i==this.modules[o][a+1]&&i==this.modules[o+1][a]&&i==this.modules[o+1][a+1]&&(t+=h.PENALTY_N2)}let e=0;for(let o of this.modules)e=o.reduce((a,i)=>a+(i?1:0),e);let r=this.size*this.size,n=Math.ceil(Math.abs(e*20-r*10)/r)-1;return M(0<=n&&n<=9),t+=n*h.PENALTY_N4,M(0<=t&&t<=2568888),t}getAlignmentPatternPositions(){if(this.version==1)return[];{let t=Math.floor(this.version/7)+2,e=Math.floor((this.version*8+t*3+5)/(t*4-4))*2,r=[6];for(let n=this.size-7;r.length<t;n-=e)r.splice(1,0,n);return r}}static getNumRawDataModules(t){if(t<h.MIN_VERSION||t>h.MAX_VERSION)throw new RangeError("Version number out of range");let e=(16*t+128)*t+64;if(t>=2){let r=Math.floor(t/7)+2;e-=(25*r-10)*r-55,t>=7&&(e-=36)}return M(208<=e&&e<=29648),e}static getNumDataCodewords(t,e){return Math.floor(h.getNumRawDataModules(t)/8)-h.ECC_CODEWORDS_PER_BLOCK[e.ordinal][t]*h.NUM_ERROR_CORRECTION_BLOCKS[e.ordinal][t]}static reedSolomonComputeDivisor(t){if(t<1||t>255)throw new RangeError("Degree out of range");let e=[];for(let n=0;n<t-1;n++)e.push(0);e.push(1);let r=1;for(let n=0;n<t;n++){for(let o=0;o<e.length;o++)e[o]=h.reedSolomonMultiply(e[o],r),o+1<e.length&&(e[o]^=e[o+1]);r=h.reedSolomonMultiply(r,2)}return e}static reedSolomonComputeRemainder(t,e){let r=e.map(n=>0);for(let n of t){let o=n^r.shift();r.push(0),e.forEach((a,i)=>r[i]^=h.reedSolomonMultiply(a,o))}return r}static reedSolomonMultiply(t,e){if(t>>>8||e>>>8)throw new RangeError("Byte out of range");let r=0;for(let n=7;n>=0;n--)r=r<<1^(r>>>7)*285,r^=(e>>>n&1)*t;return M(r>>>8==0),r}finderPenaltyCountPatterns(t){let e=t[1];M(e<=this.size*3);let r=e>0&&t[2]==e&&t[3]==e*3&&t[4]==e&&t[5]==e;return(r&&t[0]>=e*4&&t[6]>=e?1:0)+(r&&t[6]>=e*4&&t[0]>=e?1:0)}finderPenaltyTerminateAndCount(t,e,r){return t&&(this.finderPenaltyAddHistory(e,r),e=0),e+=this.size,this.finderPenaltyAddHistory(e,r),this.finderPenaltyCountPatterns(r)}finderPenaltyAddHistory(t,e){e[0]==0&&(t+=this.size),e.pop(),e.unshift(t)}};h.MIN_VERSION=1,h.MAX_VERSION=40,h.PENALTY_N1=3,h.PENALTY_N2=3,h.PENALTY_N3=40,h.PENALTY_N4=10,h.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],h.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];var O=h;function x(s,t,e){if(t<0||t>31||s>>>t)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)e.push(s>>>r&1)}function $(s,t){return(s>>>t&1)!=0}function M(s){if(!s)throw new Error("Assertion error")}var y=class y{constructor(t,e,r){this.mode=t;this.numChars=e;this.bitData=r;if(e<0)throw new RangeError("Invalid argument");this.bitData=r.slice()}static makeBytes(t){let e=[];for(let r of t)x(r,8,e);return new y(y.Mode.BYTE,t.length,e)}static makeNumeric(t){if(!y.isNumeric(t))throw new RangeError("String contains non-numeric characters");let e=[];for(let r=0;r<t.length;){let n=Math.min(t.length-r,3);x(parseInt(t.substring(r,r+n),10),n*3+1,e),r+=n}return new y(y.Mode.NUMERIC,t.length,e)}static makeAlphanumeric(t){if(!y.isAlphanumeric(t))throw new RangeError("String contains unencodable characters in alphanumeric mode");let e=[],r;for(r=0;r+2<=t.length;r+=2){let n=y.ALPHANUMERIC_CHARSET.indexOf(t.charAt(r))*45;n+=y.ALPHANUMERIC_CHARSET.indexOf(t.charAt(r+1)),x(n,11,e)}return r<t.length&&x(y.ALPHANUMERIC_CHARSET.indexOf(t.charAt(r)),6,e),new y(y.Mode.ALPHANUMERIC,t.length,e)}static makeSegments(t){return t==""?[]:y.isNumeric(t)?[y.makeNumeric(t)]:y.isAlphanumeric(t)?[y.makeAlphanumeric(t)]:[y.makeBytes(y.toUtf8ByteArray(t))]}static makeEci(t){let e=[];if(t<0)throw new RangeError("ECI assignment value out of range");if(t<128)x(t,8,e);else if(t<16384)x(2,2,e),x(t,14,e);else if(t<1e6)x(6,3,e),x(t,21,e);else throw new RangeError("ECI assignment value out of range");return new y(y.Mode.ECI,0,e)}static isNumeric(t){return y.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return y.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(t,e){let r=0;for(let n of t){let o=n.mode.numCharCountBits(e);if(n.numChars>=1<<o)return 1/0;r+=4+o+n.bitData.length}return r}static toUtf8ByteArray(t){t=encodeURI(t);let e=[];for(let r=0;r<t.length;r++)t.charAt(r)!="%"?e.push(t.charCodeAt(r)):(e.push(parseInt(t.substring(r+1,r+3),16)),r+=2);return e}};y.NUMERIC_REGEX=/^[0-9]*$/,y.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,y.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";var H=y;(t=>{let e=class e{constructor(n,o){this.ordinal=n;this.formatBits=o}};e.LOW=new e(0,1),e.MEDIUM=new e(1,0),e.QUARTILE=new e(2,3),e.HIGH=new e(3,2);let s=e;t.Ecc=e})(O||(O={}));(t=>{let e=class e{constructor(n,o){this.modeBits=n;this.numBitsCharCount=o}numCharCountBits(n){return this.numBitsCharCount[Math.floor((n+7)/17)]}};e.NUMERIC=new e(1,[10,12,14]),e.ALPHANUMERIC=new e(2,[9,11,13]),e.BYTE=new e(4,[8,16,16]),e.KANJI=new e(8,[8,10,12]),e.ECI=new e(7,[0,0,0]);let s=e;t.Mode=e})(H||(H={}));var D=class{constructor(t,e="H",r=1,n=40,o=-1){let a={L:O.Ecc.LOW,M:O.Ecc.MEDIUM,Q:O.Ecc.QUARTILE,H:O.Ecc.HIGH},i=H.makeSegments(t);this.qr=O.encodeSegments(i,a[e],r,n,o,!0)}getMatrix(){let t=this.qr.size,e=[];for(let r=0;r<t;r++){let n=[];for(let o=0;o<t;o++){let a=this.qr.getModule(o,r),i=this.identifyType(o,r,t);n.push({x:o,y:r,isDark:a,type:i})}e.push(n)}return e}identifyType(t,e,r){return t<7&&e<7||t>r-8&&e<7||t<7&&e>r-8?"pos-finder":"data"}};var z={"inner-eye-classy":{viewBox:"0 0 24 24",d:"M4 0H20H24V4V20C24 22.2091 22.2091 24 20 24H4H0V20V4C0 1.79086 1.79086 0 4 0Z"},"inner-eye-dot":{viewBox:"0 0 24 24",d:"M24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12Z"},"inner-eye-dots":{viewBox:"0 0 24 24",d:"M8 4C8 6.20914 6.20914 8 4 8C1.79086 8 0 6.20914 0 4C0 1.79086 1.79086 0 4 0C6.20914 0 8 1.79086 8 4Z M16 4C16 6.20914 14.2091 8 12 8C9.79086 8 8 6.20914 8 4C8 1.79086 9.79086 0 12 0C14.2091 0 16 1.79086 16 4Z M24 4C24 6.20914 22.2091 8 20 8C17.7909 8 16 6.20914 16 4C16 1.79086 17.7909 0 20 0C22.2091 0 24 1.79086 24 4Z M24 12C24 14.2091 22.2091 16 20 16C17.7909 16 16 14.2091 16 12C16 9.79086 17.7909 8 20 8C22.2091 8 24 9.79086 24 12Z M24 20C24 22.2091 22.2091 24 20 24C17.7909 24 16 22.2091 16 20C16 17.7909 17.7909 16 20 16C22.2091 16 24 17.7909 24 20Z M16 20C16 22.2091 14.2091 24 12 24C9.79086 24 8 22.2091 8 20C8 17.7909 9.79086 16 12 16C14.2091 16 16 17.7909 16 20Z M8 20C8 22.2091 6.20914 24 4 24C1.79086 24 0 22.2091 0 20C0 17.7909 1.79086 16 4 16C6.20914 16 8 17.7909 8 20Z M8 12C8 14.2091 6.20914 16 4 16C1.79086 16 0 14.2091 0 12C0 9.79086 1.79086 8 4 8C6.20914 8 8 9.79086 8 12Z M16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12Z"},"inner-eye-extra-classy":{viewBox:"0 0 24 24",d:"M8 0H16H24V8V16C24 20.4183 20.4183 24 16 24H8H0V16V8C0 3.58172 3.58172 0 8 0Z"},"inner-eye-extra-rounded":{viewBox:"0 0 24 24",d:"M0 8C0 3.58172 3.58172 0 8 0H16C20.4183 0 24 3.58172 24 8V16C24 20.4183 20.4183 24 16 24H8C3.58172 24 0 20.4183 0 16V8Z"},"inner-eye-rounded":{viewBox:"0 0 24 24",d:"M0 4C0 1.79086 1.79086 0 4 0H20C22.2091 0 24 1.79086 24 4V20C24 22.2091 22.2091 24 20 24H4C1.79086 24 0 22.2091 0 20V4Z"},"inner-eye-square":{viewBox:"0 0 24 24",d:"M0 0H24V24H0V0Z"},"outer-eye-classy":{viewBox:"0 0 24 24",d:"M24 0V22C24 23.1046 23.1046 24 22 24H0V2C0 0.895431 0.895431 0 2 0H24ZM3.5 3.5V20.5H20.5V3.5H3.5Z"},"outer-eye-dot":{viewBox:"0 0 24 24",d:"M12 0C18.6274 0 24 5.37258 24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0ZM12 3.5C7.30558 3.5 3.5 7.30558 3.5 12C3.5 16.6944 7.30558 20.5 12 20.5C16.6944 20.5 20.5 16.6944 20.5 12C20.5 7.30558 16.6944 3.5 12 3.5Z"},"outer-eye-dots":{viewBox:"0 0 24 24",d:"M1.71429 20.5714C2.66106 20.5714 3.42857 21.3389 3.42857 22.2857C3.42857 23.2325 2.66106 24 1.71429 24C0.767512 24 0 23.2325 0 22.2857C0 21.3389 0.767512 20.5714 1.71429 20.5714Z M5.14286 20.5714C6.08963 20.5714 6.85714 21.3389 6.85714 22.2857C6.85714 23.2325 6.08963 24 5.14286 24C4.19608 24 3.42857 23.2325 3.42857 22.2857C3.42857 21.3389 4.19608 20.5714 5.14286 20.5714Z M8.57143 20.5714C9.5182 20.5714 10.2857 21.3389 10.2857 22.2857C10.2857 23.2325 9.5182 24 8.57143 24C7.62466 24 6.85714 23.2325 6.85714 22.2857C6.85714 21.3389 7.62466 20.5714 8.57143 20.5714Z M12 20.5714C12.9468 20.5714 13.7143 21.3389 13.7143 22.2857C13.7143 23.2325 12.9468 24 12 24C11.0532 24 10.2857 23.2325 10.2857 22.2857C10.2857 21.3389 11.0532 20.5714 12 20.5714Z M15.4286 20.5714C16.3753 20.5714 17.1429 21.3389 17.1429 22.2857C17.1429 23.2325 16.3753 24 15.4286 24C14.4818 24 13.7143 23.2325 13.7143 22.2857C13.7143 21.3389 14.4818 20.5714 15.4286 20.5714Z M18.8571 20.5714C19.8039 20.5714 20.5714 21.3389 20.5714 22.2857C20.5714 23.2325 19.8039 24 18.8571 24C17.9104 24 17.1429 23.2325 17.1429 22.2857C17.1429 21.3389 17.9104 20.5714 18.8571 20.5714Z M22.2857 20.5714C23.2325 20.5714 24 21.3389 24 22.2857C24 23.2325 23.2325 24 22.2857 24C21.3389 24 20.5714 23.2325 20.5714 22.2857C20.5714 21.3389 21.3389 20.5714 22.2857 20.5714Z M1.71429 17.1429C2.66106 17.1429 3.42857 17.9104 3.42857 18.8571C3.42857 19.8039 2.66106 20.5714 1.71429 20.5714C0.767512 20.5714 0 19.8039 0 18.8571C0 17.9104 0.767512 17.1429 1.71429 17.1429Z M22.2857 17.1429C23.2325 17.1429 24 17.9104 24 18.8571C24 19.8039 23.2325 20.5714 22.2857 20.5714C21.3389 20.5714 20.5714 19.8039 20.5714 18.8571C20.5714 17.9104 21.3389 17.1429 22.2857 17.1429Z M1.71429 13.7143C2.66106 13.7143 3.42857 14.4818 3.42857 15.4286C3.42857 16.3753 2.66106 17.1429 1.71429 17.1429C0.767512 17.1429 0 16.3753 0 15.4286C0 14.4818 0.767512 13.7143 1.71429 13.7143Z M22.2857 13.7143C23.2325 13.7143 24 14.4818 24 15.4286C24 16.3753 23.2325 17.1429 22.2857 17.1429C21.3389 17.1429 20.5714 16.3753 20.5714 15.4286C20.5714 14.4818 21.3389 13.7143 22.2857 13.7143Z M1.71429 10.2857C2.66106 10.2857 3.42857 11.0532 3.42857 12C3.42857 12.9468 2.66106 13.7143 1.71429 13.7143C0.767512 13.7143 0 12.9468 0 12C0 11.0532 0.767512 10.2857 1.71429 10.2857Z M22.2857 10.2857C23.2325 10.2857 24 11.0532 24 12C24 12.9468 23.2325 13.7143 22.2857 13.7143C21.3389 13.7143 20.5714 12.9468 20.5714 12C20.5714 11.0532 21.3389 10.2857 22.2857 10.2857Z M1.71429 6.85714C2.66106 6.85714 3.42857 7.62466 3.42857 8.57143C3.42857 9.5182 2.66106 10.2857 1.71429 10.2857C0.767512 10.2857 0 9.5182 0 8.57143C0 7.62466 0.767512 6.85714 1.71429 6.85714Z M22.2857 6.85714C23.2325 6.85714 24 7.62466 24 8.57143C24 9.5182 23.2325 10.2857 22.2857 10.2857C21.3389 10.2857 20.5714 9.5182 20.5714 8.57143C20.5714 7.62466 21.3389 6.85714 22.2857 6.85714Z M1.71429 3.42857C2.66106 3.42857 3.42857 4.19608 3.42857 5.14286C3.42857 6.08963 2.66106 6.85714 1.71429 6.85714C0.767512 6.85714 0 6.08963 0 5.14286C0 4.19608 0.767512 3.42857 1.71429 3.42857Z M22.2857 3.42857C23.2325 3.42857 24 4.19608 24 5.14286C24 6.08963 23.2325 6.85714 22.2857 6.85714C21.3389 6.85714 20.5714 6.08963 20.5714 5.14286C20.5714 4.19608 21.3389 3.42857 22.2857 3.42857Z M1.71429 0C2.66106 0 3.42857 0.767512 3.42857 1.71429C3.42857 2.66106 2.66106 3.42857 1.71429 3.42857C0.767512 3.42857 0 2.66106 0 1.71429C0 0.767512 0.767512 0 1.71429 0Z M5.14286 0C6.08963 0 6.85714 0.767512 6.85714 1.71429C6.85714 2.66106 6.08963 3.42857 5.14286 3.42857C4.19608 3.42857 3.42857 2.66106 3.42857 1.71429C3.42857 0.767512 4.19608 0 5.14286 0Z M8.57143 0C9.5182 0 10.2857 0.767512 10.2857 1.71429C10.2857 2.66106 9.5182 3.42857 8.57143 3.42857C7.62466 3.42857 6.85714 2.66106 6.85714 1.71429C6.85714 0.767512 7.62466 0 8.57143 0Z M12 0C12.9468 0 13.7143 0.767512 13.7143 1.71429C13.7143 2.66106 12.9468 3.42857 12 3.42857C11.0532 3.42857 10.2857 2.66106 10.2857 1.71429C10.2857 0.767512 11.0532 0 12 0Z M15.4286 0C16.3753 0 17.1429 0.767512 17.1429 1.71429C17.1429 2.66106 16.3753 3.42857 15.4286 3.42857C14.4818 3.42857 13.7143 2.66106 13.7143 1.71429C13.7143 0.767512 14.4818 0 15.4286 0Z M18.8571 0C19.8039 0 20.5714 0.767512 20.5714 1.71429C20.5714 2.66106 19.8039 3.42857 18.8571 3.42857C17.9104 3.42857 17.1429 2.66106 17.1429 1.71429C17.1429 0.767512 17.9104 0 18.8571 0Z M22.2857 0C23.2325 0 24 0.767512 24 1.71429C24 2.66106 23.2325 3.42857 22.2857 3.42857C21.3389 3.42857 20.5714 2.66106 20.5714 1.71429C20.5714 0.767512 21.3389 0 22.2857 0Z"},"outer-eye-extra-classy":{viewBox:"0 0 24 24",d:"M24 0V20C24 22.2091 22.2091 24 20 24H0V4C2.57702e-07 1.79086 1.79086 0 4 0H24ZM3.5 3.5V20.5H20.5V3.5H3.5Z"},"outer-eye-extra-rounded":{viewBox:"0 0 24 24",d:"M16 0C20.4183 0 24 3.58172 24 8V16C24 20.4183 20.4183 24 16 24H8C3.58172 24 1.28855e-07 20.4183 0 16V8C0 3.58172 3.58172 1.28851e-07 8 0H16ZM9 3.5C5.96243 3.5 3.5 5.96243 3.5 9V15C3.5 18.0376 5.96243 20.5 9 20.5H15C18.0376 20.5 20.5 18.0376 20.5 15V9C20.5 5.96243 18.0376 3.5 15 3.5H9Z"},"outer-eye-rounded":{viewBox:"0 0 24 24",d:"M20 0C22.2091 2.57702e-07 24 1.79086 24 4V20C24 22.2091 22.2091 24 20 24H4C1.79086 24 6.44266e-08 22.2091 0 20V4C2.57702e-07 1.79086 1.79086 6.44266e-08 4 0H20ZM3.5 3.5V20.5H20.5V3.5H3.5Z"},"outer-eye-square":{viewBox:"0 0 24 24",d:"M24 24H0V0H24V24ZM3.5 3.5V20.5H20.5V3.5H3.5Z"},"dots-classy":{viewBox:"0 0 24 24",d:"M16 4C16 1.79086 17.7909 0 20 0H24V4C24 6.20914 22.2091 8 20 8H16V4Z M4 0C1.79086 0 0 1.79086 0 4V8V24H16H20C22.2091 24 24 22.2091 24 20V16H16V8L8 8V0H4Z"},"dots-classy-rounded":{viewBox:"0 0 24 24",d:"M16 4C16 1.79086 17.7909 0 20 0H24V4C24 6.20914 22.2091 8 20 8H16V4Z M8 0C3.58172 5.15422e-07 0 3.58172 0 8V24H16C20.4183 24 24 20.4183 24 16H16V8L8 8V0Z"},"dots-extra-rounded":{viewBox:"0 0 24 24",d:"M16 4.00003C16 1.79089 17.7909 2.47955e-05 20 2.47955e-05C22.2092 2.47955e-05 24 1.79089 24 4.00003C24 6.20916 22.2092 8.00003 20 8.00003C17.7909 8.00003 16 6.20916 16 4.00003Z M8 4V8C12.4183 8 16 11.5817 16 16H20C22.2091 16 24 17.7909 24 20C24 22.2091 22.2091 24 20 24H8C3.58172 24 0 20.4183 0 16V4C0 1.79086 1.79086 0 4 0C6.20914 0 8 1.79086 8 4Z"},dots:{viewBox:"0 0 24 24",d:"M16 20C16 17.7909 17.7909 16 20 16C22.2091 16 24 17.7909 24 20C24 22.2091 22.2091 24 20 24C17.7909 24 16 22.2091 16 20Z M8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12Z M16 4C16 1.79086 17.7909 0 20 0C22.2091 0 24 1.79086 24 4C24 6.20914 22.2091 8 20 8C17.7909 8 16 6.20914 16 4Z M8 20C8 17.7909 9.79086 16 12 16C14.2091 16 16 17.7909 16 20C16 22.2091 14.2091 24 12 24C9.79086 24 8 22.2091 8 20Z M0 4C0 1.79086 1.79086 0 4 0C6.20914 0 8 1.79086 8 4C8 6.20914 6.20914 8 4 8C1.79086 8 0 6.20914 0 4Z M0 12C0 9.79086 1.79086 8 4 8C6.20914 8 8 9.79086 8 12C8 14.2091 6.20914 16 4 16C1.79086 16 0 14.2091 0 12Z M0 20C0 17.7909 1.79086 16 4 16C6.20914 16 8 17.7909 8 20C8 22.2091 6.20914 24 4 24C1.79086 24 0 22.2091 0 20Z"},"dots-rounded":{viewBox:"0 0 24 24",d:"M16 4C16 1.79086 17.7908 0 20 0C22.2091 0 24 1.79086 24 4C24 6.20914 22.2091 8 20 8C17.7908 8 16 6.20914 16 4Z M3.99976 24.0001C1.79062 24.0001 -0.000244141 22.2092 -0.000244141 20.0001L-1.35708e-05 12L-0.000244141 4.00007C-0.000244141 1.79093 1.79062 7.00951e-05 3.99976 7.00951e-05C6.20889 7.00951e-05 7.99976 1.79093 7.99976 4.00007L7.99999 8H12C14.2091 8 16 9.79086 16 12L15.9998 16.0001H19.9998C22.2089 16.0001 23.9998 17.7909 23.9998 20.0001C23.9998 22.2092 22.2089 24.0001 19.9998 24.0001L12 24L3.99976 24.0001Z"},"dots-square":{viewBox:"0 0 24 24",d:"M16 0H24V8H16V0Z M24 24V16H16V8L8 8V0H0V8V24H16H24Z"}},at={INNER_EYE_CLASSY:"inner-eye-classy",INNER_EYE_DOT:"inner-eye-dot",INNER_EYE_DOTS:"inner-eye-dots",INNER_EYE_EXTRA_CLASSY:"inner-eye-extra-classy",INNER_EYE_EXTRA_ROUNDED:"inner-eye-extra-rounded",INNER_EYE_ROUNDED:"inner-eye-rounded",INNER_EYE_SQUARE:"inner-eye-square",OUTER_EYE_CLASSY:"outer-eye-classy",OUTER_EYE_DOT:"outer-eye-dot",OUTER_EYE_DOTS:"outer-eye-dots",OUTER_EYE_EXTRA_CLASSY:"outer-eye-extra-classy",OUTER_EYE_EXTRA_ROUNDED:"outer-eye-extra-rounded",OUTER_EYE_ROUNDED:"outer-eye-rounded",OUTER_EYE_SQUARE:"outer-eye-square",DOTS_CLASSY:"dots-classy",DOTS_CLASSY_ROUNDED:"dots-classy-rounded",DOTS_EXTRA_ROUNDED:"dots-extra-rounded",DOTS:"dots",DOTS_ROUNDED:"dots-rounded",DOTS_SQUARE:"dots-square",CUSTOM_ICON:"custom-icon"};async function ct(s){if(typeof window<"u"&&typeof document<"u")return new Promise((o,a)=>{let i=new Image;i.crossOrigin="Anonymous",i.onload=()=>{let d=document.createElement("canvas");d.width=i.width,d.height=i.height;let c=d.getContext("2d");if(!c)return a(new Error("Canvas 2D not supported"));c.drawImage(i,0,0);let p=c.getImageData(0,0,i.width,i.height);o({data:p.data,width:i.width,height:i.height})},i.onerror=a,i.src=s});let t;if(s.startsWith("data:")){let o=s.indexOf(","),a=s.slice(o+1);t=typeof Buffer<"u"?Buffer.from(a,"base64"):s}else t=s;let e;try{let o=await import("sharp");e=o.default||o}catch{throw new Error("The 'sharp' package is required for frame detection in Node.js.")}let{data:r,info:n}=await e(t).ensureAlpha().raw().toBuffer({resolveWithObject:!0});return{data:r,width:n.width,height:n.height}}function lt(s,t){if(s[t+3]<128)return!0;let r=s[t],n=s[t+1],o=s[t+2];return .299*r+.587*n+.114*o>240}function dt(s){let t=[],e={left:0,width:0,height:0},r=s.length;for(let n=0;n<=r;n++){let o=n<r?s[n]:0;for(;t.length>0&&o<s[t[t.length-1]];){let a=s[t.pop()],i=t.length>0?t[t.length-1]+1:0,d=n-i;d*a>e.width*e.height&&(e={left:i,width:d,height:a})}t.push(n)}return e}async function tt(s,t,e){try{let{data:r,width:n,height:o}=await ct(s),a=new Array(n).fill(0),i={x:0,y:0,width:0,height:0,area:0};for(let p=0;p<o;p++){for(let C=0;C<n;C++){let S=(p*n+C)*4;a[C]=lt(r,S)?a[C]+1:0}let{left:m,width:f,height:l}=dt(a),b=f*l;b>i.area&&(i={x:m,y:p-l+1,width:f,height:l,area:b})}if(i.area===0)return null;let d=t/n,c=e/o;return{x:Math.round(i.x*d),y:Math.round(i.y*c),width:Math.round(i.width*d),height:Math.round(i.height*c)}}catch(r){return console.warn("[detectFrameInset] Detection failed:",r),null}}async function ut(s,t,e={}){if(t==="svg")return typeof Buffer<"u"?Buffer.from(s,"utf-8"):new TextEncoder().encode(s);let r=typeof Buffer<"u"?Buffer.from(s,"utf-8"):s,n;try{let i=await import("sharp");n=i.default||i}catch{throw new Error("The 'sharp' package is required for PNG/JPEG/WEBP export in Node.js.")}let o=n(r);(e.width||e.height)&&(o=o.resize(e.width,e.height,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}));let a=e.quality??90;switch(t){case"png":return o.png().toBuffer();case"jpeg":return o.jpeg({quality:a}).toBuffer();case"webp":return o.webp({quality:a}).toBuffer();default:throw new Error(`[exportQR] Unsupported format: "${t}". Use: svg | png | jpeg | webp`)}}var et={backgroundOptions:{color:"#ffffff"},dotsOptions:{type:"inner-eye-square",color:"#000000"},cornersDotOptions:{type:"inner-eye-square",color:"#000000"},cornersSquareOptions:{type:"inner-eye-square",color:"#000000"}};function ht(s,t,e){let r=s>=0&&s<7&&t>=0&&t<7,n=s>=e-7&&s<e&&t>=0&&t<7,o=s>=0&&s<7&&t>=e-7&&t<e;if(r||n||o){let a=s,i=t;return n&&(a=s-(e-7)),o&&(i=t-(e-7)),a>=2&&a<=4&&i>=2&&i<=4?"cornerDot":"cornerSquare"}return"dots"}function ft(s,t){return[{id:"tl",x:t,y:t},{id:"tr",x:s-7+t,y:t},{id:"bl",x:t,y:s-7+t}]}function yt(s,t,e){return[{x:2,y:2},{x:e-7+2,y:2},{x:2,y:e-7+2}].some(n=>n.x===s&&n.y===t)}function U(s,t,e,r,n,o){let a=t.colorStops.map(C=>`<stop offset="${C.offset}" stop-color="${C.color}" />`).join(""),i=(t.rotation||0)*(Math.PI/180),d=e+n/2,c=r+o/2,p=Math.sqrt(n*n+o*o)/2,m=(d-p*Math.cos(i)).toFixed(2),f=(c-p*Math.sin(i)).toFixed(2),l=(d+p*Math.cos(i)).toFixed(2),b=(c+p*Math.sin(i)).toFixed(2);return`
2
+ <linearGradient id="${s}" gradientUnits="userSpaceOnUse" x1="${m}" y1="${f}" x2="${l}" y2="${b}">
3
3
  ${a}
4
4
  </linearGradient>
5
5
  `}function X(s,t){if(t.type==="custom-icon"&&t.customPath)return`
@@ -10,33 +10,33 @@ var d=class d{constructor(t,e,r,n){this.version=t;this.errorCorrectionLevel=e;th
10
10
  <symbol id="${s}" viewBox="${n}">
11
11
  <path d="${r}" />
12
12
  </symbol>
13
- `}return""}function Y(s){return[{id:"top-left",x:0,y:0},{id:"top-right",x:s-7,y:0},{id:"bottom-left",x:0,y:s-7}]}function rt(s,t,e,r,n){for(let o of Y(n))if(s<o.x+7&&s+e>o.x&&t<o.y+7&&t+r>o.y)return!0;return!1}function gt(s,t,e){let r=s.x,n=s.y;for(let o of Y(e)){let a=r<o.x+7&&r+s.width>o.x,i=n<o.y+7&&n+s.height>o.y;if(!a||!i)continue;let h=[{axis:"x",dir:1,depth:o.x+7-r},{axis:"x",dir:-1,depth:r+s.width-o.x},{axis:"y",dir:1,depth:o.y+7-n},{axis:"y",dir:-1,depth:n+s.height-o.y}].filter(f=>f.depth>0).sort((f,c)=>f.depth-c.depth);if(!h.length)continue;let l=h[0],p=r,m=n;l.axis==="x"?r=l.dir>0?o.x+7:o.x-s.width:n=l.dir>0?o.y+7:o.y-s.height,console.warn(`[QR] images[${t}] overlaps the "${o.id}" eye zone. Auto-adjusted: (${p.toFixed(1)}, ${m.toFixed(1)}) \u2192 (${r.toFixed(1)}, ${n.toFixed(1)}).`)}return{...s,x:r,y:n}}function bt(s,t){let e=s.filter(c=>c.x!=null&&c.y!=null),r=s.filter(c=>c.x==null||c.y==null),n=e.map(c=>{let b=s.indexOf(c);return rt(c.x,c.y,c.width,c.height,t)?gt(c,b,t):c});if(r.length===0)return[...n];let o=8,i=t-8-o,h=t/2,l=t/2,p=[{x:h,y:l},{x:o+i*.25,y:l},{x:o+i*.75,y:l},{x:h,y:o+i*.25},{x:h,y:o+i*.75},{x:o+i*.75,y:o+i*.75},{x:o+i*.75,y:o+i*.25},{x:o+i*.25,y:o+i*.75},{x:o+i*.25,y:o+i*.25}],m=[],f=0;for(let c of r){let b=!1;for(;f<p.length;){let C=p[f++],S=C.x-c.width/2,P=C.y-c.height/2;if(!rt(S,P,c.width,c.height,t)){m.push({...c,x:S,y:P}),b=!0;break}}b||m.push({...c,x:(t-c.width)/2,y:(t-c.height)/2})}return[...n,...m]}async function Tt(s){let t={...et,...s},r=new D(t.data,t.qrOptions?.errorCorrectionLevel||"H").getMatrix(),n=r.length,o=t.margin??4,a=Y(n).map(u=>({...u,width:7,height:7})),i=(u,g)=>({maxX:Math.max(0,n-u),maxY:Math.max(0,n-g)}),h=u=>({svg:u,matrixSize:n,eyeZones:a,getMaxPos:i}),l=n+o*2,p=t.width??1e3,m=t.height??1e3,f=Ct(n,o),c=7,b=3,C="";t.backgroundOptions?.gradient&&(C+=Q("grad-bg",t.backgroundOptions.gradient,0,0,l,l)),t.dotsOptions.gradient&&(C+=Q("grad-dots",t.dotsOptions.gradient,0,0,l,l)),f.forEach(u=>{t.cornersSquareOptions.gradient&&(C+=Q(`grad-sq-${u.id}`,t.cornersSquareOptions.gradient,u.x,u.y,c,c)),t.cornersDotOptions.gradient&&(C+=Q(`grad-dot-${u.id}`,t.cornersDotOptions.gradient,u.x+2,u.y+2,b,b))}),C+=X("icon-dots",t.dotsOptions),C+=X("icon-sq",t.cornersSquareOptions),C+=X("icon-dot",t.cornersDotOptions);let S={dots:"",cornerSquare:"",cornerDot:""},P=Array(n).fill(!1).map(()=>Array(n).fill(!1)),G=bt(t.images||[],n);for(let u=0;u<n;u++)for(let g=0;g<n;g++){if(P[u][g]||!r[u][g].isDark||G.some(B=>{if(!B.excludeDots)return!1;let I=B.x,J=B.y;return g>=I-.5&&g<=I+B.width-.5&&u>=J-.5&&u<=J+B.height-.5}))continue;let R=pt(g,u,n),A,Z="";R==="dots"?(A=t.dotsOptions,Z="#icon-dots"):R==="cornerSquare"?(A=t.cornersSquareOptions,Z="#icon-sq"):(A=t.cornersDotOptions,Z="#icon-dot");let v=1;if(R==="cornerDot"&&A.isSingle){if(!mt(g,u,n))continue;v=3;for(let B=0;B<3;B++)for(let I=0;I<3;I++)u+B<n&&g+I<n&&(P[u+B][g+I]=!0)}let N=A.scale??1,U=g+o,q=u+o,L=v*N,V=v*N,F=(v-L)/2,k=(v-V)/2;S[R]+=`<use href="${Z}" x="${U+F}" y="${q+k}" width="${L}" height="${V}" />`}let nt=()=>{if(!S.dots)return"";let u=t.dotsOptions.gradient?"url(#grad-dots)":t.dotsOptions.color;return`
13
+ `}return""}function Q(s){return[{id:"top-left",x:0,y:0},{id:"top-right",x:s-7,y:0},{id:"bottom-left",x:0,y:s-7}]}function rt(s,t,e,r,n){for(let o of Q(n))if(s<o.x+7&&s+e>o.x&&t<o.y+7&&t+r>o.y)return!0;return!1}function pt(s,t,e){let r=s.x,n=s.y;for(let o of Q(e)){let a=r<o.x+7&&r+s.width>o.x,i=n<o.y+7&&n+s.height>o.y;if(!a||!i)continue;let d=[{axis:"x",dir:1,depth:o.x+7-r},{axis:"x",dir:-1,depth:r+s.width-o.x},{axis:"y",dir:1,depth:o.y+7-n},{axis:"y",dir:-1,depth:n+s.height-o.y}].filter(f=>f.depth>0).sort((f,l)=>f.depth-l.depth);if(!d.length)continue;let c=d[0],p=r,m=n;c.axis==="x"?r=c.dir>0?o.x+7:o.x-s.width:n=c.dir>0?o.y+7:o.y-s.height,console.warn(`[QR] images[${t}] overlaps the "${o.id}" eye zone. Auto-adjusted: (${p.toFixed(1)}, ${m.toFixed(1)}) \u2192 (${r.toFixed(1)}, ${n.toFixed(1)}).`)}return{...s,x:r,y:n}}function Ct(s,t){let e=s.filter(l=>l.x!=null&&l.y!=null),r=s.filter(l=>l.x==null||l.y==null),n=e.map(l=>{let b=s.indexOf(l);return rt(l.x,l.y,l.width,l.height,t)?pt(l,b,t):l});if(r.length===0)return[...n];let o=8,i=t-8-o,d=t/2,c=t/2,p=[{x:d,y:c},{x:o+i*.25,y:c},{x:o+i*.75,y:c},{x:d,y:o+i*.25},{x:d,y:o+i*.75},{x:o+i*.75,y:o+i*.75},{x:o+i*.75,y:o+i*.25},{x:o+i*.25,y:o+i*.75},{x:o+i*.25,y:o+i*.25}],m=[],f=0;for(let l of r){let b=!1;for(;f<p.length;){let C=p[f++],S=C.x-l.width/2,Z=C.y-l.height/2;if(!rt(S,Z,l.width,l.height,t)){m.push({...l,x:S,y:Z}),b=!0;break}}b||m.push({...l,x:(t-l.width)/2,y:(t-l.height)/2})}return[...n,...m]}async function Ht(s){let t={...et,...s},r=new D(t.data,t.qrOptions?.errorCorrectionLevel||"H").getMatrix(),n=r.length,o=t.margin??4,a=Q(n).map(u=>({...u,width:7,height:7})),i=(u,g)=>({maxX:Math.max(0,n-u),maxY:Math.max(0,n-g)}),d=u=>({svg:u,matrixSize:n,eyeZones:a,getMaxPos:i}),c=n+o*2,p=t.width??1e3,m=t.height??1e3,f=ft(n,o),l=7,b=3,C="";t.backgroundOptions?.gradient&&(C+=U("grad-bg",t.backgroundOptions.gradient,0,0,c,c)),t.dotsOptions.gradient&&(C+=U("grad-dots",t.dotsOptions.gradient,0,0,c,c)),f.forEach(u=>{t.cornersSquareOptions.gradient&&(C+=U(`grad-sq-${u.id}`,t.cornersSquareOptions.gradient,u.x,u.y,l,l)),t.cornersDotOptions.gradient&&(C+=U(`grad-dot-${u.id}`,t.cornersDotOptions.gradient,u.x+2,u.y+2,b,b))}),C+=X("icon-dots",t.dotsOptions),C+=X("icon-sq",t.cornersSquareOptions),C+=X("icon-dot",t.cornersDotOptions);let S={dots:"",cornerSquare:"",cornerDot:""},Z=Array(n).fill(!1).map(()=>Array(n).fill(!1)),G=Ct(t.images||[],n);for(let u=0;u<n;u++)for(let g=0;g<n;g++){if(Z[u][g]||!r[u][g].isDark||G.some(B=>{if(!B.excludeDots)return!1;let I=B.x,J=B.y;return g>=I-.5&&g<=I+B.width-.5&&u>=J-.5&&u<=J+B.height-.5}))continue;let A=ht(g,u,n),R,P="";A==="dots"?(R=t.dotsOptions,P="#icon-dots"):A==="cornerSquare"?(R=t.cornersSquareOptions,P="#icon-sq"):(R=t.cornersDotOptions,P="#icon-dot");let v=1;if(A==="cornerDot"&&R.isSingle){if(!yt(g,u,n))continue;v=3;for(let B=0;B<3;B++)for(let I=0;I<3;I++)u+B<n&&g+I<n&&(Z[u+B][g+I]=!0)}let N=R.scale??1,Y=g+o,q=u+o,L=v*N,V=v*N,k=(v-L)/2,F=(v-V)/2;S[A]+=`<use href="${P}" x="${Y+k}" y="${q+F}" width="${L}" height="${V}" />`}let nt=()=>{if(!S.dots)return"";let u=t.dotsOptions.gradient?"url(#grad-dots)":t.dotsOptions.color;return`
14
14
  <mask id="mask-dots">
15
15
  <rect width="100%" height="100%" fill="black" />
16
16
  <g fill="white">${S.dots}</g>
17
17
  </mask>
18
18
  <rect width="100%" height="100%" fill="${u}" mask="url(#mask-dots)" />
19
- `},W=(u,g,E)=>{if(!S[u])return"";let R=`mask-${u}`,A=`
20
- <mask id="${R}">
19
+ `},_=(u,g,E)=>{if(!S[u])return"";let A=`mask-${u}`,R=`
20
+ <mask id="${A}">
21
21
  <rect width="100%" height="100%" fill="black" />
22
22
  <g fill="white" shape-rendering="crispEdges">${S[u]}</g>
23
23
  </mask>
24
- `,Z="";return f.forEach(v=>{let N=E.color;E.gradient&&(N=`url(#${g}-${v.id})`),Z+=`<rect x="${v.x}" y="${v.y}" width="${c}" height="${c}" fill="${N}" mask="url(#${R})" />`}),`<defs>${A}</defs>${Z}`},ot=()=>t.backgroundOptions?.gradient?"url(#grad-bg)":t.backgroundOptions?.color||"white",j="";G.forEach(u=>{let g=u.x+o,E=u.y+o,R=u.preserveAspectRatio??"xMidYMid meet",A=u.opacity!=null?` opacity="${u.opacity}"`:"";j+=`<image href="${u.source}" x="${g}" y="${E}" width="${u.width}" height="${u.height}" preserveAspectRatio="${R}"${A} />`});let T=t.borderRadius?t.borderRadius/p*l:0,K=T>0?`rx="${T.toFixed(3)}"`:"",it=T>0?`<clipPath id="qr-clip"><rect width="${l}" height="${l}" ${K} /></clipPath>`:"",st=T>0?'clip-path="url(#qr-clip)"':"",_=`
24
+ `,P="";return f.forEach(v=>{let N=E.color;E.gradient&&(N=`url(#${g}-${v.id})`),P+=`<rect x="${v.x}" y="${v.y}" width="${l}" height="${l}" fill="${N}" mask="url(#${A})" />`}),`<defs>${R}</defs>${P}`},ot=()=>t.backgroundOptions?.gradient?"url(#grad-bg)":t.backgroundOptions?.color||"white",W="";G.forEach(u=>{let g=u.x+o,E=u.y+o,A=u.preserveAspectRatio??"xMidYMid meet",R=u.opacity!=null?` opacity="${u.opacity}"`:"";W+=`<image href="${u.source}" x="${g}" y="${E}" width="${u.width}" height="${u.height}" preserveAspectRatio="${A}"${R} />`});let T=t.borderRadius?t.borderRadius/p*c:0,j=T>0?`rx="${T.toFixed(3)}"`:"",it=T>0?`<clipPath id="qr-clip"><rect width="${c}" height="${c}" ${j} /></clipPath>`:"",st=T>0?'clip-path="url(#qr-clip)"':"",K=`
25
25
  <defs>${C}${it}</defs>
26
26
  <g ${st}>
27
- <rect width="100%" height="100%" fill="${ot()}" ${K}/>
27
+ <rect width="100%" height="100%" fill="${ot()}" ${j}/>
28
28
  ${t.backgroundOptions?.image?`<image href="${t.backgroundOptions.image}" width="100%" height="100%" preserveAspectRatio="none" />`:""}
29
29
  ${nt()}
30
- ${W("cornerSquare","grad-sq",t.cornersSquareOptions)}
31
- ${W("cornerDot","grad-dot",t.cornersDotOptions)}
32
- ${j}
33
- </g>`,w=t.frame;if(w){let u=w.inset,g=!u||u.x==null||u.y==null,E=g?await tt(w.source,w.width,w.height):null;if(g&&!E){let F=w.width*.8,k=w.height*.8;E={x:(w.width-F)/2,y:(w.height-k)/2,width:F,height:k}}let R=u?.width??E.width,A=u?.height??E.height,Z=u?.x??E.x+(E.width-R)/2,v=u?.y??E.y+(E.height-A)/2,N={x:Z,y:v,width:R,height:A},U=t.width??w.width,q=t.height??w.height,L=N.width/l,V=N.height/l;return h(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${w.width} ${w.height}" width="${U}" height="${q}">
30
+ ${_("cornerSquare","grad-sq",t.cornersSquareOptions)}
31
+ ${_("cornerDot","grad-dot",t.cornersDotOptions)}
32
+ ${W}
33
+ </g>`,w=t.frame;if(w){let u=w.inset,g=!u||u.x==null||u.y==null,E=g?await tt(w.source,w.width,w.height):null;if(g&&!E){let k=w.width*.8,F=w.height*.8;E={x:(w.width-k)/2,y:(w.height-F)/2,width:k,height:F}}let A=u?.width??E.width,R=u?.height??E.height,P=u?.x??E.x+(E.width-A)/2,v=u?.y??E.y+(E.height-R)/2,N={x:P,y:v,width:A,height:R},Y=t.width??w.width,q=t.height??w.height,L=N.width/c,V=N.height/c;return d(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${w.width} ${w.height}" width="${Y}" height="${q}">
34
34
  <!-- Frame image (behind everything) -->
35
35
  <image href="${w.source}" x="0" y="0" width="${w.width}" height="${w.height}" preserveAspectRatio="xMidYMid slice" />
36
36
  <!-- QR code scaled into the inset area -->
37
37
  <g transform="translate(${N.x}, ${N.y}) scale(${L.toFixed(6)}, ${V.toFixed(6)})">
38
- ${_}
38
+ ${K}
39
39
  </g>
40
- </svg>`)}return h(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${l} ${l}" width="${p}" height="${m}">
41
- ${_}
42
- </svg>`)}function Lt(s,t="H"){let r=new D(s,t).getMatrix().length,n=Y(r).map(o=>({...o,width:7,height:7}));return{matrixSize:r,eyeZones:n,getMaxPos:(o,a)=>({maxX:Math.max(0,r-o),maxY:Math.max(0,r-a)})}}export{Tt as QRCodeGenerate,yt as exportQR,Lt as getQRBounds};
40
+ </svg>`)}return d(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${c} ${c}" width="${p}" height="${m}">
41
+ ${K}
42
+ </svg>`)}function Pt(s,t="H"){let r=new D(s,t).getMatrix().length,n=Q(r).map(o=>({...o,width:7,height:7}));return{matrixSize:r,eyeZones:n,getMaxPos:(o,a)=>({maxX:Math.max(0,r-o),maxY:Math.max(0,r-a)})}}export{Ht as QRCodeGenerate,at as QRShapes,ut as exportQR,Pt as getQRBounds};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qrstylelib",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",