qrdx 0.0.58 → 0.0.59
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/core.js +4 -4
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +4 -4
- package/dist/core.mjs.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -7
- package/dist/index.mjs.map +1 -1
- package/dist/src/qr-code-props.d.ts +10 -1
- package/dist/src/qr-code-props.d.ts.map +1 -1
- package/dist/src/qr-code.d.ts.map +1 -1
- package/dist/vanilla.browser.mjs +4 -4
- package/dist/vanilla.browser.mjs.map +1 -1
- package/package.json +1 -1
- package/src/qr-code-props.ts +38 -25
- package/src/qr-code.tsx +7 -39
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime'),schemas_js=require('./schemas.js'),framesIndex_js=require('./frames-index.js'),framesOfficial_js=require('./frames-official.js'),qrCodeCanvas_js=require('./qr-code-canvas.js');function Qt(t){return t.children}var nd=t=>t==null?null:`${t}`;function ya(t,e,n){let o=e??{},r=n;if("key"in o){let{key:a,...i}=o;a!==void 0&&(r=a),o=i;}return {type:t,props:o,key:nd(r)}}function rd(t,e){let n=t;return {type:n.type,props:{...n.props,...e},key:n.key??null}}function od(t,e,...n){let o={...e};return n.length>0&&(o.children=n.length===1?n[0]:n),ya(t,o)}var ad={jsx:ya,jsxs:ya,createElement:od,cloneElement:rd,Fragment:Qt},be=ad;function gn(t,e){let n=be;be=t;try{return e()}finally{be=n;}}var _a=t=>t===Qt?be.Fragment:t;function P(t,e,n){return be.jsx(_a(t),e,n)}function xt(t,e,n){return be.jsxs(_a(t),e,n)}function Dr(t,e,...n){return be.createElement(_a(t),e??null,...n)}function Ne(t,e){return be.cloneElement(t,e)}var id=new Set([Symbol.for("react.element"),Symbol.for("react.transitional.element")]),ml=Symbol.for("react.fragment");function Oe(t){if(typeof t!="object"||t===null||Array.isArray(t))return false;let e=t;return e.$$typeof!==void 0&&!id.has(e.$$typeof)?false:(typeof e.type=="string"||typeof e.type=="function"||e.type===ml)&&typeof e.props=="object"&&e.props!==null}var bn=t=>t===Qt||t===ml;var yn;(a=>{class t{constructor(l,s,c,u){this.version=l;this.errorCorrectionLevel=s;if(l<t.MIN_VERSION||l>t.MAX_VERSION)throw new RangeError("Version value out of range");if(u<-1||u>7)throw new RangeError("Mask value out of range");this.size=l*4+17;let m=[];for(let d=0;d<this.size;d++)m.push(false);for(let d=0;d<this.size;d++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();let f=this.addEccAndInterleave(c);if(this.drawCodewords(f),u==-1){let d=1e9;for(let g=0;g<8;g++){this.applyMask(g),this.drawFormatBits(g);let h=this.getPenaltyScore();h<d&&(u=g,d=h),this.applyMask(g);}}o(0<=u&&u<=7),this.mask=u,this.applyMask(u),this.drawFormatBits(u),this.isFunction=[];}version;errorCorrectionLevel;static encodeText(l,s){let c=a.QrSegment.makeSegments(l);return t.encodeSegments(c,s)}static encodeBinary(l,s){let c=a.QrSegment.makeBytes(l);return t.encodeSegments([c],s)}static encodeSegments(l,s,c=1,u=40,m=-1,f=true){if(!(t.MIN_VERSION<=c&&c<=u&&u<=t.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let d,g;for(d=c;;d++){let y=t.getNumDataCodewords(d,s)*8,_=r.getTotalBits(l,d);if(_<=y){g=_;break}if(d>=u)throw new RangeError("Data too long")}for(let y of [t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])f&&g<=t.getNumDataCodewords(d,y)*8&&(s=y);let h=[];for(let y of l){e(y.mode.modeBits,4,h),e(y.numChars,y.mode.numCharCountBits(d),h);for(let _ of y.getData())h.push(_);}o(h.length==g);let p=t.getNumDataCodewords(d,s)*8;o(h.length<=p),e(0,Math.min(4,p-h.length),h),e(0,(8-h.length%8)%8,h),o(h.length%8==0);for(let y=236;h.length<p;y^=253)e(y,8,h);let b=[];for(;b.length*8<h.length;)b.push(0);return h.forEach((y,_)=>b[_>>>3]|=y<<7-(_&7)),new t(d,s,b,m)}size;mask;modules=[];isFunction=[];getModule(l,s){return 0<=l&&l<this.size&&0<=s&&s<this.size&&this.modules[s][l]}getModules(){return this.modules}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2==0),this.setFunctionModule(c,6,c%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let l=this.getAlignmentPatternPositions(),s=l.length;for(let c=0;c<s;c++)for(let u=0;u<s;u++)c==0&&u==0||c==0&&u==s-1||c==s-1&&u==0||this.drawAlignmentPattern(l[c],l[u]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(l){let s=this.errorCorrectionLevel.formatBits<<3|l,c=s;for(let m=0;m<10;m++)c=c<<1^(c>>>9)*1335;let u=(s<<10|c)^21522;o(u>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,n(u,m));this.setFunctionModule(8,7,n(u,6)),this.setFunctionModule(8,8,n(u,7)),this.setFunctionModule(7,8,n(u,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,n(u,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,n(u,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,n(u,m));this.setFunctionModule(8,this.size-8,true);}drawVersion(){if(this.version<7)return;let l=this.version;for(let c=0;c<12;c++)l=l<<1^(l>>>11)*7973;let s=this.version<<12|l;o(s>>>18==0);for(let c=0;c<18;c++){let u=n(s,c),m=this.size-11+c%3,f=Math.floor(c/3);this.setFunctionModule(m,f,u),this.setFunctionModule(f,m,u);}}drawFinderPattern(l,s){for(let c=-4;c<=4;c++)for(let u=-4;u<=4;u++){let m=Math.max(Math.abs(u),Math.abs(c)),f=l+u,d=s+c;0<=f&&f<this.size&&0<=d&&d<this.size&&this.setFunctionModule(f,d,m!=2&&m!=4);}}drawAlignmentPattern(l,s){for(let c=-2;c<=2;c++)for(let u=-2;u<=2;u++)this.setFunctionModule(l+u,s+c,Math.max(Math.abs(u),Math.abs(c))!=1);}setFunctionModule(l,s,c){this.modules[s][l]=c,this.isFunction[s][l]=true;}addEccAndInterleave(l){let s=this.version,c=this.errorCorrectionLevel;if(l.length!=t.getNumDataCodewords(s,c))throw new RangeError("Invalid argument");let u=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][s],m=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][s],f=Math.floor(t.getNumRawDataModules(s)/8),d=u-f%u,g=Math.floor(f/u),h=[],p=t.reedSolomonComputeDivisor(m);for(let y=0,_=0;y<u;y++){let w=l.slice(_,_+g-m+(y<d?0:1));_+=w.length;let C=t.reedSolomonComputeRemainder(w,p);y<d&&w.push(0),h.push(w.concat(C));}let b=[];for(let y=0;y<h[0].length;y++)h.forEach((_,w)=>{(y!=g-m||w>=d)&&b.push(_[y]);});return o(b.length==f),b}drawCodewords(l){if(l.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let s=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let u=0;u<this.size;u++)for(let m=0;m<2;m++){let f=c-m,g=(c+1&2)==0?this.size-1-u:u;!this.isFunction[g][f]&&s<l.length*8&&(this.modules[g][f]=n(l[s>>>3],7-(s&7)),s++);}}o(s==l.length*8);}applyMask(l){if(l<0||l>7)throw new RangeError("Mask value out of range");for(let s=0;s<this.size;s++)for(let c=0;c<this.size;c++){let u;switch(l){case 0:u=(c+s)%2==0;break;case 1:u=s%2==0;break;case 2:u=c%3==0;break;case 3:u=(c+s)%3==0;break;case 4:u=(Math.floor(c/3)+Math.floor(s/2))%2==0;break;case 5:u=c*s%2+c*s%3==0;break;case 6:u=(c*s%2+c*s%3)%2==0;break;case 7:u=((c+s)%2+c*s%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[s][c]&&u&&(this.modules[s][c]=!this.modules[s][c]);}}getPenaltyScore(){let l=0;for(let m=0;m<this.size;m++){let f=false,d=0,g=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[m][h]==f?(d++,d==5?l+=t.PENALTY_N1:d>5&&l++):(this.finderPenaltyAddHistory(d,g),f||(l+=this.finderPenaltyCountPatterns(g)*t.PENALTY_N3),f=this.modules[m][h],d=1);l+=this.finderPenaltyTerminateAndCount(f,d,g)*t.PENALTY_N3;}for(let m=0;m<this.size;m++){let f=false,d=0,g=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][m]==f?(d++,d==5?l+=t.PENALTY_N1:d>5&&l++):(this.finderPenaltyAddHistory(d,g),f||(l+=this.finderPenaltyCountPatterns(g)*t.PENALTY_N3),f=this.modules[h][m],d=1);l+=this.finderPenaltyTerminateAndCount(f,d,g)*t.PENALTY_N3;}for(let m=0;m<this.size-1;m++)for(let f=0;f<this.size-1;f++){let d=this.modules[m][f];d==this.modules[m][f+1]&&d==this.modules[m+1][f]&&d==this.modules[m+1][f+1]&&(l+=t.PENALTY_N2);}let s=0;for(let m of this.modules)s=m.reduce((f,d)=>f+(d?1:0),s);let c=this.size*this.size,u=Math.ceil(Math.abs(s*20-c*10)/c)-1;return o(0<=u&&u<=9),l+=u*t.PENALTY_N4,o(0<=l&&l<=2568888),l}getAlignmentPatternPositions(){if(this.version==1)return [];{let l=Math.floor(this.version/7)+2,s=this.version==32?26:Math.ceil((this.version*4+4)/(l*2-2))*2,c=[6];for(let u=this.size-7;c.length<l;u-=s)c.splice(1,0,u);return c}}static getNumRawDataModules(l){if(l<t.MIN_VERSION||l>t.MAX_VERSION)throw new RangeError("Version number out of range");let s=(16*l+128)*l+64;if(l>=2){let c=Math.floor(l/7)+2;s-=(25*c-10)*c-55,l>=7&&(s-=36);}return o(208<=s&&s<=29648),s}static getNumDataCodewords(l,s){return Math.floor(t.getNumRawDataModules(l)/8)-t.ECC_CODEWORDS_PER_BLOCK[s.ordinal][l]*t.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][l]}static reedSolomonComputeDivisor(l){if(l<1||l>255)throw new RangeError("Degree out of range");let s=[];for(let u=0;u<l-1;u++)s.push(0);s.push(1);let c=1;for(let u=0;u<l;u++){for(let m=0;m<s.length;m++)s[m]=t.reedSolomonMultiply(s[m],c),m+1<s.length&&(s[m]^=s[m+1]);c=t.reedSolomonMultiply(c,2);}return s}static reedSolomonComputeRemainder(l,s){let c=s.map(u=>0);for(let u of l){let m=u^c.shift();c.push(0),s.forEach((f,d)=>c[d]^=t.reedSolomonMultiply(f,m));}return c}static reedSolomonMultiply(l,s){if(l>>>8||s>>>8)throw new RangeError("Byte out of range");let c=0;for(let u=7;u>=0;u--)c=c<<1^(c>>>7)*285,c^=(s>>>u&1)*l;return o(c>>>8==0),c}finderPenaltyCountPatterns(l){let s=l[1];o(s<=this.size*3);let c=s>0&&l[2]==s&&l[3]==s*3&&l[4]==s&&l[5]==s;return (c&&l[0]>=s*4&&l[6]>=s?1:0)+(c&&l[6]>=s*4&&l[0]>=s?1:0)}finderPenaltyTerminateAndCount(l,s,c){return l&&(this.finderPenaltyAddHistory(s,c),s=0),s+=this.size,this.finderPenaltyAddHistory(s,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(l,s){s[0]==0&&(l+=this.size),s.pop(),s.unshift(l);}static MIN_VERSION=1;static MAX_VERSION=40;static PENALTY_N1=3;static PENALTY_N2=3;static PENALTY_N3=40;static PENALTY_N4=10;static 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]];static 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]]}a.QrCode=t;function e(i,l,s){if(l<0||l>31||i>>>l)throw new RangeError("Value out of range");for(let c=l-1;c>=0;c--)s.push(i>>>c&1);}function n(i,l){return (i>>>l&1)!=0}function o(i){if(!i)throw new Error("Assertion error")}class r{constructor(l,s,c){this.mode=l;this.numChars=s;this.bitData=c;if(s<0)throw new RangeError("Invalid argument");this.bitData=c.slice();}mode;numChars;bitData;static makeBytes(l){let s=[];for(let c of l)e(c,8,s);return new r(r.Mode.BYTE,l.length,s)}static makeNumeric(l){if(!r.isNumeric(l))throw new RangeError("String contains non-numeric characters");let s=[];for(let c=0;c<l.length;){let u=Math.min(l.length-c,3);e(parseInt(l.substr(c,u),10),u*3+1,s),c+=u;}return new r(r.Mode.NUMERIC,l.length,s)}static makeAlphanumeric(l){if(!r.isAlphanumeric(l))throw new RangeError("String contains unencodable characters in alphanumeric mode");let s=[],c;for(c=0;c+2<=l.length;c+=2){let u=r.ALPHANUMERIC_CHARSET.indexOf(l.charAt(c))*45;u+=r.ALPHANUMERIC_CHARSET.indexOf(l.charAt(c+1)),e(u,11,s);}return c<l.length&&e(r.ALPHANUMERIC_CHARSET.indexOf(l.charAt(c)),6,s),new r(r.Mode.ALPHANUMERIC,l.length,s)}static makeSegments(l){return l==""?[]:r.isNumeric(l)?[r.makeNumeric(l)]:r.isAlphanumeric(l)?[r.makeAlphanumeric(l)]:[r.makeBytes(r.toUtf8ByteArray(l))]}static makeEci(l){let s=[];if(l<0)throw new RangeError("ECI assignment value out of range");if(l<128)e(l,8,s);else if(l<16384)e(2,2,s),e(l,14,s);else if(l<1e6)e(6,3,s),e(l,21,s);else throw new RangeError("ECI assignment value out of range");return new r(r.Mode.ECI,0,s)}static isNumeric(l){return r.NUMERIC_REGEX.test(l)}static isAlphanumeric(l){return r.ALPHANUMERIC_REGEX.test(l)}getData(){return this.bitData.slice()}static getTotalBits(l,s){let c=0;for(let u of l){let m=u.mode.numCharCountBits(s);if(u.numChars>=1<<m)return 1/0;c+=4+m+u.bitData.length;}return c}static toUtf8ByteArray(l){l=encodeURI(l);let s=[];for(let c=0;c<l.length;c++)l.charAt(c)!="%"?s.push(l.charCodeAt(c)):(s.push(parseInt(l.substr(c+1,2),16)),c+=2);return s}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}a.QrSegment=r;})(yn||={});(e=>{(o=>{class n{constructor(a,i){this.ordinal=a;this.formatBits=i;}ordinal;formatBits;static LOW=new n(0,1);static MEDIUM=new n(1,0);static QUARTILE=new n(2,3);static HIGH=new n(3,2)}o.Ecc=n;})(e.QrCode||={});})(yn||={});(e=>{(o=>{class n{constructor(a,i){this.modeBits=a;this.numBitsCharCount=i;}modeBits;numBitsCharCount;static NUMERIC=new n(1,[10,12,14]);static ALPHANUMERIC=new n(2,[9,11,13]);static BYTE=new n(4,[8,16,16]);static KANJI=new n(8,[8,10,12]);static ECI=new n(7,[0,0,0]);numCharCountBits(a){return this.numBitsCharCount[Math.floor((a+7)/17)]}}o.Mode=n;})(e.QrSegment||={});})(yn||={});var mt=yn;var $t={L:mt.QrCode.Ecc.LOW,M:mt.QrCode.Ecc.MEDIUM,Q:mt.QrCode.Ecc.QUARTILE,H:mt.QrCode.Ecc.HIGH},it=128,Kt="Q",dt="#FFFFFF",Mt="#000000";var ct=0;var Br=.1;var Gr=["logo","halftone"],xa={logo:["blend","badge"],halftone:["color","mono"]},jn=192,sd=["square","rounded","circle","message","message-reverse","diya","diya-reverse","rounded-triangle","leaf","drop","plus","cross-rounded","hexagon","octagon","flower","heart","squircle","dots","extra-rounded","leaf-reverse","drop-reverse"],ld=["diamond","star","banner"],cd=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse"],ud=["curly"],md=["circle","circle-large","square","diamond","circle-mixed","pacman","rounded","small-square","vertical-line","horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"],dd=["none","banner-bottom","banner-top","border","rounded-border","speech-bubble","banner-top-bottom","speech-bubble-top","chat-bubble","circle","polaroid","phone","ticket","badge","envelope","tag","menu-card","sticker","gradient-border","focus"],ie=24,$a="Scan me",Zn=.5,_n=1.5,fd=["square","rounded","circle"],hd=.1,Sa=.3,wa=.25,pd=2,Qr=.5,Ca=1,Ma=.07,gd=["square","circle","heart"],Ra=3,De=64,ye=8,Ea=.42,Be=["topLeft","topRight","bottomLeft"],Ur=.5,Aa=2,Pa=.1,va=.5,Ia=.25,Hr="#e5e7eb",_e="#d1d5db",zr=.3,La=.2,ka=.1,Fa=.4,Ta=.3,Na="#000000",bd=["corner","code"];function K(t,e=3){let n=10**e;return Math.round(t*n)/n+0}function $(t,e=3){return String(K(t,e))}function A(t,...e){let n=t[0]??"";for(let o=0;o<e.length;o++){let r=e[o];n+=(typeof r=="number"?$(r):r)+(t[o+1]??"");}return n}var yd={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},_d=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,Oa=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function Yn(t,e=Number.POSITIVE_INFINITY){if(!_d.test(t))return null;let n=[],o=0,r=()=>{for(;o<t.length&&/[\s,]/.test(t[o]);)o++;},a=()=>{r(),Oa.lastIndex=o;let s=Oa.exec(t);if(!s)return null;let c=s[0],u=c.indexOf(".");if(u>=0&&c.length-u-1>e)return null;o=Oa.lastIndex;let m=Number(c);return Number.isFinite(m)?m:null},i=()=>{r();let s=t[o];return s==="0"||s==="1"?(o++,s==="1"?1:0):null},l=()=>(r(),o<t.length&&/[0-9.+-]/.test(t[o]));for(r();o<t.length;){let s=t[o],c=s.toUpperCase(),u=yd[c];if(u===void 0||n.length===0&&c!=="M")return null;if(o++,u===0){n.push({command:s,values:[]}),r();continue}let m=s,f=true;for(;f||l();){let d=[];for(let g=0;g<u;g++){let h=c==="A"&&(g===3||g===4)?i():a();if(h===null)return null;d.push(h);}n.push({command:m,values:d}),c==="M"&&(m=s==="M"?"L":"l"),f=false;}r();}return n}function dl(t){let e=0;for(let{command:n}of t)e+=n.toUpperCase()==="A"?4:1;return e}function Da(t,e=1,n=0,o=0){let r="";for(let{command:a,values:i}of t){let l=a.toUpperCase(),s=a===l,c=s?n:0,u=s?o:0,m;switch(l){case "Z":m=[];break;case "H":m=[$(i[0]*e+c)];break;case "V":m=[$(i[0]*e+u)];break;case "A":m=[$(Math.abs(i[0])*e),$(Math.abs(i[1])*e),$(i[2]),String(i[3]),String(i[4]),$(i[5]*e+c),$(i[6]*e+u)];break;default:m=i.map((f,d)=>$(f*e+(d%2===0?c:u)));}r+=a+m.join(" ");}return r}function qr(t,e=.25){let n=[],o=[],r=[0,0],a=[0,0],i=()=>{o.length>2&&n.push(o),o=[];};for(let l of t)if(l.op==="M")i(),r=[l.x,l.y],a=r,o.push(r);else if(l.op==="L")a=[l.x,l.y],o.push(a);else if(l.op==="C"){let s=a,c=[l.x1,l.y1],u=[l.x2,l.y2],m=[l.x,l.y],f=Math.hypot(c[0]-s[0],c[1]-s[1])+Math.hypot(u[0]-c[0],u[1]-c[1])+Math.hypot(m[0]-u[0],m[1]-u[1]),d=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(f/(4*e)))));for(let g=1;g<=d;g++){let h=g/d,p=1-h;o.push([p*p*p*s[0]+3*p*p*h*c[0]+3*p*h*h*u[0]+h*h*h*m[0],p*p*p*s[1]+3*p*p*h*c[1]+3*p*h*h*u[1]+h*h*h*m[1]]);}a=m;}else i(),a=r;return i(),n}function xn(t,e){let n=[r=>r[0]-e.x0,r=>e.x1-r[0],r=>r[1]-e.y0,r=>e.y1-r[1]],o=t;for(let r of n){if(o.length===0)break;let a=o;o=[];for(let i=0;i<a.length;i++){let l=a[i],s=a[(i+a.length-1)%a.length],c=r(l),u=r(s);c>=0?(u<0&&o.push(fl(s,l,u,c)),o.push(l)):u>=0&&o.push(fl(s,l,u,c));}}return o.length>2?o:[]}function fl(t,e,n,o){let r=n/(n-o);return [t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function hl(t){return t.filter(e=>e.length>2).map(e=>`M${e.map(([n,o])=>`${$(n)} ${$(o)}`).join("L")}Z`).join("")}function Ge(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(i,l)=>{e=Math.min(e,i),n=Math.min(n,l),o=Math.max(o,i),r=Math.max(r,l);};for(let i of t)i.op==="C"?(a(i.x1,i.y1),a(i.x2,i.y2),a(i.x,i.y)):i.op!=="Z"&&a(i.x,i.y);return Number.isFinite(e)?{x0:e,y0:n,x1:o,y1:r}:null}var xd={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function bl(t){return t.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(e,n)=>{if(n[0]==="#"){let o=n[1].toLowerCase()==="x"?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return Number.isInteger(o)&&o>0&&o<=1114111&&!(o>=55296&&o<=57343)?String.fromCodePoint(o):e}return xd[n.toLowerCase()]??e})}var $d=60,Ba=62,Ga=47,Sd=61,pl=34,gl=39,Ua=/\s*/y,wd=/[^\s/>]*/y,Cd=/[^\s>]*/y,Md=/[^\s=]*/y;function $n(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function Rd(t,e){let n=t.length,o=S=>{let x=Number.POSITIVE_INFINITY,M=-1;return R=>((R<x||M>=0&&M<R)&&(x=R,M=t.indexOf(S,R)),M)},r=o("-->"),a=o("?>"),i=o("]]>"),l=o(">"),s,c=S=>{let x=t.charCodeAt(S);if(x!==pl&&x!==gl)return S+1;let M=t.indexOf(t[S],S+1);return M<0?n:M+1},u=S=>{for(let x=S;x<n&&!s?.[x];x=c(x)){let M=t.charCodeAt(x);if(M===Ba||M===Ga&&t.charCodeAt(x+1)===Ba)return x}s??=new Uint8Array(n);for(let x=S;x<n&&!s[x];x=c(x))s[x]=1;return -1},m=-1,f=-1,d=-1,g=-1,h=S=>{let x=S+1;if(x<m||x>=f){m=x,f=$n(wd,t,x),d=-1;for(let R=f;R>x;R--){let E=t.charCodeAt(R);if((R===f||E===pl||E===gl)&&(g=u(R),g>=0)){d=R;break}}}if(d<=x)return -1;let M=t.charCodeAt(g)===Ga;return e.open(t.slice(x,d),t.slice(d,g),M),g+(M?2:1)},p=-1,b=-1,y=-1,_=S=>{let x=S+2;if(x<p||x>=b){p=x,b=$n(Cd,t,x);let M=$n(Ua,t,b);y=b>x&&t.charCodeAt(M)===Ba?M:-1;}return y},w=S=>{if(t.startsWith("<!--",S)){let x=r(S+4);if(x>=0)return x+3}if(t.startsWith("<?",S)){let x=a(S+2);if(x>=0)return x+2}if(t.startsWith("<![CDATA[",S)){let x=i(S+9);if(x>=0)return e.cdata(t.slice(S+9,x)),x+3}if(t.startsWith("<!",S)){let x=l(S+2);if(x>=0)return x+1}if(t.charCodeAt(S+1)===Ga){let x=_(S);return x<0?-1:(e.close(),x+1)}return h(S)},C=0;for(;C<n;)if(t.charCodeAt(C)===$d){let S=w(C);C=S<0?C+1:S;}else {let S=t.indexOf("<",C),x=S<0?n:S;e.text(t.slice(C,x)),C=x;}}function Ed(t){let e={},n=0;for(;n<t.length;){let o=$n(Md,t,n);if(o===n){n++;continue}let r=$n(Ua,t,o);if(t.charCodeAt(r)===Sd){let a=$n(Ua,t,r+1),i=t[a],l=i==='"'||i==="'"?t.indexOf(i,a+1):-1;if(l>=0){e[t.slice(n,o)]=bl(t.slice(a+1,l)),n=l+1;continue}}n=o;}return e}function xe(t){let e={name:"#root",attrs:{},children:[],text:""},n=[e],o=()=>n.at(-1);Rd(t,{open(a,i,l){let s=Ed(i),c={name:a,attrs:s,children:[],text:""};o().children.push(c),l||n.push(c);},close(){n.length>1&&n.pop();},text(a){o().text+=bl(a);},cdata(a){o().text+=a;}});let r=a=>{for(let i of a.children){if(i.name==="svg")return i;let l=r(i);if(l)return l}return null};return r(e)}var Sn=[1,0,0,1,0,0];function ut(t,e){let[n,o,r,a,i,l]=t,[s,c,u,m,f,d]=e;return [n*s+r*c,o*s+a*c,n*u+r*m,o*u+a*m,n*f+r*d+i,o*f+a*d+l]}function V(t,e,n){return [t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}function wn(t){return Math.sqrt(Math.abs(t[0]*t[3]-t[1]*t[2]))}function Jt(t){return t?(t.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)??[]).map(Number):[]}function Ut(t){let e=Sn;if(!t)return e;for(let[,n,o]of t.matchAll(/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g)){let r=Jt(o),a=Sn;switch(n){case "matrix":r.length===6&&(a=r);break;case "translate":a=[1,0,0,1,r[0]??0,r[1]??0];break;case "scale":a=[r[0]??1,0,0,r[1]??r[0]??1,0,0];break;case "rotate":{let i=(r[0]??0)*Math.PI/180,l=Math.cos(i),s=Math.sin(i),[c,u]=[r[1]??0,r[2]??0];a=ut(ut([1,0,0,1,c,u],[l,s,-s,l,0,0]),[1,0,0,1,-c,-u]);break}case "skewX":a=[1,0,Math.tan((r[0]??0)*Math.PI/180),1,0,0];break;case "skewY":a=[1,Math.tan((r[0]??0)*Math.PI/180),0,1,0,0];break;}e=ut(e,a);}return e}var Qa=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function Ad(t,e,n,o,r,a,i,l,s){if(t===l&&e===s)return [];let c=Math.abs(n),u=Math.abs(o);if(c===0||u===0)return [{op:"L",x:l,y:s}];let m=r*Math.PI/180,f=Math.cos(m),d=Math.sin(m),g=(t-l)/2,h=(e-s)/2,p=f*g+d*h,b=-d*g+f*h,y=p*p/(c*c)+b*b/(u*u);y>1&&(c*=Math.sqrt(y),u*=Math.sqrt(y));let _=c*c*u*u-c*c*b*b-u*u*p*p,w=c*c*b*b+u*u*p*p,C=(a===i?-1:1)*Math.sqrt(Math.max(0,_/w)),S=C*c*b/u,x=-C*u*p/c,M=f*S-d*x+(t+l)/2,R=d*S+f*x+(e+s)/2,E=(H,G,U,Z)=>Math.atan2(H*Z-G*U,H*U+G*Z),v=E(1,0,(p-S)/c,(b-x)/u),I=E((p-S)/c,(b-x)/u,(-p-S)/c,(-b-x)/u);!i&&I>0?I-=2*Math.PI:i&&I<0&&(I+=2*Math.PI);let L=Math.max(1,Math.ceil(Math.abs(I)/(Math.PI/2)-1e-9)),T=I/L,F=4/3*Math.tan(T/4),k=(H,G)=>[M+c*f*H-u*d*G,R+c*d*H+u*f*G],q=[];for(let H=0;H<L;H++){let G=v+H*T,U=G+T,[Z,rt]=k(Math.cos(G)-F*Math.sin(G),Math.sin(G)+F*Math.cos(G)),[W,O]=k(Math.cos(U)+F*Math.sin(U),Math.sin(U)-F*Math.cos(U)),[N,_t]=H===L-1?[l,s]:k(Math.cos(U),Math.sin(U));q.push({op:"C",x1:Z,y1:rt,x2:W,y2:O,x:N,y:_t});}return q}function se(t){let e=[],n=0,o=0,r=0,a=0,i=0,l="",s=null,c=null,u=()=>{for(;n<t.length&&/[\s,]/.test(t[n]);)n++;},m=()=>{u(),Qa.lastIndex=n;let g=Qa.exec(t);return g?(n=Qa.lastIndex,Number(g[0])):null},f=()=>{u();let g=t[n];return g==="0"||g==="1"?(n++,g==="1"):null},d=g=>{let h=[];for(let p=0;p<g;p++){let b=m();if(b===null)return null;h.push(b);}return h};for(;u(),!(n>=t.length);){let g=t[n];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(g))l=g,n++;else if(!l||l==="Z"||l==="z")break;let h=l===l.toLowerCase(),p=h?o:0,b=h?r:0,y=l.toUpperCase();if(y==="Z"){e.push({op:"Z"}),o=a,r=i,s=null,c=null;continue}if(y==="A"){let S=d(3),x=f(),M=f(),R=d(2);if(!(S&&R)||x===null||M===null)break;let[E,v,I]=S,L=R[0]+p,T=R[1]+b;e.push(...Ad(o,r,E,v,I,x,M,L,T)),o=L,r=T,s=null,c=null;continue}let _={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[y]??0,w=d(_);if(!w)break;let C=w;switch(y){case "M":o=C[0]+p,r=C[1]+b,a=o,i=r,e.push({op:"M",x:o,y:r}),l=h?"l":"L",s=null,c=null;break;case "L":case "H":case "V":y!=="V"&&(o=C[0]+p),y==="V"?r=C[0]+b:y==="L"&&(r=C[1]+b),e.push({op:"L",x:o,y:r}),s=null,c=null;break;case "C":case "S":{let S,x;y==="C"?(S=[C[0]+p,C[1]+b],x=C.slice(2)):(S=s?[2*o-s[0],2*r-s[1]]:[o,r],x=C);let M=[x[0]+p,x[1]+b],R=[x[2]+p,x[3]+b];e.push({op:"C",x1:S[0],y1:S[1],x2:M[0],y2:M[1],x:R[0],y:R[1]}),[o,r]=R,s=M,c=null;break}case "Q":case "T":{let S,x;y==="Q"?(S=[C[0]+p,C[1]+b],x=[C[2]+p,C[3]+b]):(S=c?[2*o-c[0],2*r-c[1]]:[o,r],x=[C[0]+p,C[1]+b]),e.push({op:"C",x1:o+2/3*(S[0]-o),y1:r+2/3*(S[1]-r),x2:x[0]+2/3*(S[0]-x[0]),y2:x[1]+2/3*(S[1]-x[1]),x:x[0],y:x[1]}),[o,r]=x,c=S,s=null;break}}}return e}var Wr=.5522847498;function te(t,e,n,o){if(n<=0||o<=0)return [];let r=n*Wr,a=o*Wr;return [{op:"M",x:t+n,y:e},{op:"C",x1:t+n,y1:e+a,x2:t+r,y2:e+o,x:t,y:e+o},{op:"C",x1:t-r,y1:e+o,x2:t-n,y2:e+a,x:t-n,y:e},{op:"C",x1:t-n,y1:e-a,x2:t-r,y2:e-o,x:t,y:e-o},{op:"C",x1:t+r,y1:e-o,x2:t+n,y2:e-a,x:t+n,y:e},{op:"Z"}]}function ee(t,e,n,o,r=0,a=0){if(n<=0||o<=0)return [];let i=Math.min(Math.max(r,0),n/2),l=Math.min(Math.max(a,0),o/2);if(i===0||l===0)return [{op:"M",x:t,y:e},{op:"L",x:t+n,y:e},{op:"L",x:t+n,y:e+o},{op:"L",x:t,y:e+o},{op:"Z"}];let s=i*Wr,c=l*Wr,u=t+n,m=e+o;return [{op:"M",x:t+i,y:e},{op:"L",x:u-i,y:e},{op:"C",x1:u-i+s,y1:e,x2:u,y2:e+l-c,x:u,y:e+l},{op:"L",x:u,y:m-l},{op:"C",x1:u,y1:m-l+c,x2:u-i+s,y2:m,x:u-i,y:m},{op:"L",x:t+i,y:m},{op:"C",x1:t+i-s,y1:m,x2:t,y2:m-l+c,x:t,y:m-l},{op:"L",x:t,y:e+l},{op:"C",x1:t,y1:e+l-c,x2:t+i-s,y2:e,x:t+i,y:e},{op:"Z"}]}var Kn="qrdx.frame",Jn=1,tr="custom",at={minArtboard:50,maxArtboard:2e3,maxCoordinate:4e3,maxDecimals:3,maxShapes:64,maxLabels:8,maxPolygonPoints:256,maxPathLength:16e3,maxSegments:2e3,maxGradientSteps:64,maxGradientWork:16e3,maxBytes:32768,minQrShare:.5,minPadding:.04,defaultPadding:.08,maxTextLength:ie},za=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],er=.95,_l=200,qa=["frame","text","accent","background"],Pd=/[\t\n\v\f\r\u0085\u2028\u2029]/g,vd=/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u115f\u1160\u17b4\u17b5\u180b-\u180f\u200b-\u200f\u202a-\u202e\u2060-\u206f\u3164\ufe00-\ufe0f\ufeff\uffa0\ufff0-\ufffb]|\udb40[\udc00-\udcff]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/g;function Cn(t,e=ie){let n=t.slice(0,1e3).normalize("NFC").replace(Pd," ").replace(vd,"").replace(/\s+/g," ").trim();return Array.from(n).slice(0,Math.max(0,e)).join("").trim()}function Id(t){for(let e of t)if((e.codePointAt(0)??0)>255)return false;return true}var Vr=t=>Math.abs(t*1e3-Math.round(t*1e3))<1e-6;function Xr(t){let e=Mn(t);return {x0:t.qr.x-e,y0:t.qr.y-e,x1:t.qr.x+t.qr.size+e,y1:t.qr.y+t.qr.size+e}}function Ld(t){return {x0:t.qr.x,y0:t.qr.y,x1:t.qr.x+t.qr.size,y1:t.qr.y+t.qr.size}}function Mn(t){return t.qr.padding??t.qr.size*at.defaultPadding}var Wa=.52,kd=.35;function Fd(t){let e=t.fontSize??t.box.height*Wa;return Math.min(e*_n,t.box.height*er)}var Ha=(t,e)=>Math.min(t.x1,e.x1)-Math.max(t.x0,e.x0)>1e-6&&Math.min(t.y1,e.y1)-Math.max(t.y0,e.y0)>1e-6;function yl(t){let e=Xr(t),n=Math.min(t.qr.radius??0,(e.x1-e.x0)/2,(e.y1-e.y0)/2),o=[[e.x0+n,e.y0+n,Math.PI],[e.x1-n,e.y0+n,-Math.PI/2],[e.x1-n,e.y1-n,0],[e.x0+n,e.y1-n,Math.PI/2]],r=[];for(let[a,i,l]of o)for(let s=0;s<=8;s++){let c=l+Math.PI/2*(s/8);r.push([a+n*Math.cos(c),i+n*Math.sin(c)]);}return r}function Td([t,e],n,o){if(t<n.x-.01||e<n.y-.01||t>n.x+n.width+.01||e>n.y+n.height+.01)return false;let a=Math.min(o,n.width/2,n.height/2),i=Math.min(Math.max(t,n.x+a),n.x+n.width-a),l=Math.min(Math.max(e,n.y+a),n.y+n.height-a);return Math.hypot(t-i,e-l)<=a+.01}function Nd(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),Math.abs(e)/2}function Od(t,e,n){let o=Xr(e);if(!Ha(n,o))return false;if("stroke"in t&&t.stroke)return true;if(t.fill==="background")return false;if(t.type==="rect"&&t.hole){let{hole:r}=t;return !yl(e).every(a=>Td(a,r,r.radius??0))}if(t.type==="circle"&&t.hole){let r=t.hole;return !yl(e).every(([a,i])=>Math.hypot(a-t.cx,i-t.cy)<=r+.01)}if(t.type==="polygon"){let r=xn(t.points,o);return r.length>2&&Nd(r)>1e-6}return true}function Va(t){let e=Dd(t),n="stroke"in t?t.stroke:void 0;if(!(n&&e.bounds))return e;let o=t.type==="circle"||t.type==="ellipse"?n.width/2:t.type==="rect"?n.width*Math.SQRT2/2:n.width*2,{x0:r,y0:a,x1:i,y1:l}=e.bounds;return {bounds:{x0:r-o,y0:a-o,x1:i+o,y1:l+o},segments:e.segments*2}}function Dd(t){switch(t.type){case "rect":return {bounds:{x0:t.x,y0:t.y,x1:t.x+t.width,y1:t.y+t.height},segments:t.hole?18:9};case "circle":return {bounds:{x0:t.cx-t.r,y0:t.cy-t.r,x1:t.cx+t.r,y1:t.cy+t.r},segments:t.hole?10:5};case "ellipse":return {bounds:{x0:t.cx-t.rx,y0:t.cy-t.ry,x1:t.cx+t.rx,y1:t.cy+t.ry},segments:5};case "polygon":{let e=t.points.map(([o])=>o),n=t.points.map(([,o])=>o);return {bounds:{x0:Math.min(...e),y0:Math.min(...n),x1:Math.max(...e),y1:Math.max(...n)},segments:t.points.length}}case "path":{let e=Yn(t.d,at.maxDecimals);return e?{bounds:Ge(se(t.d)),segments:dl(e)}:{bounds:null,segments:0}}case "line":{let e=t.width/2,n=Math.hypot(t.x2-t.x1,t.y2-t.y1),o=t.dash?Math.ceil(n/(t.dash[0]+t.dash[1])):1;return {bounds:{x0:Math.min(t.x1,t.x2)-e,y0:Math.min(t.y1,t.y2)-e,x1:Math.max(t.x1,t.x2)+e,y1:Math.max(t.y1,t.y2)+e},segments:o*(t.cap==="round"?4:5)}}default:return {bounds:{x0:t.x,y0:t.y,x1:t.x+t.size,y1:t.y+t.size},segments:_l}}}function xl(t,e){let n=at,o=new TextEncoder().encode(JSON.stringify(t)).length;if(o>n.maxBytes){e(`The spec is ${o} bytes; the limit is ${n.maxBytes}`);return}let{width:r,height:a}=t.artboard,i=Math.max(r,a)*.005,l={x0:-i,y0:-i,x1:r+i,y1:a+i},s=b=>b.x0>=l.x0&&b.y0>=l.y0&&b.x1<=l.x1&&b.y1<=l.y1,{qr:c}=t,u=Mn(t);c.plate!=="none"&&u<c.size*n.minPadding-1e-9&&e(`qr.padding must be at least ${n.minPadding*100}% of qr.size`,["qr","padding"]),c.size<Math.min(r,a)*n.minQrShare-1e-9&&e(`qr.size must be at least ${n.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let m=Xr(t);(m.x0<-1e-9||m.y0<-1e-9||m.x1>r+1e-9||m.y1>a+1e-9)&&e("The code and its padding must sit inside the artboard",["qr"]),(c.radius??0)>(c.size+2*u)/2&&e("qr.radius is larger than half the plate",["qr","radius"]);let f=0,d=0;t.shapes.forEach((b,y)=>{let _=["shapes",y],{bounds:w,segments:C}=Va(b);if(!w){e("Path data must use only M L H V C S Q T A Z, plain numbers (up to 3 decimals) and start with M",[..._,"d"]);return}if(s(w)||e("The shape extends outside the artboard",_),b.type==="rect"&&b.hole){let{hole:S}=b;(S.x<b.x||S.y<b.y||S.x+S.width>b.x+b.width+1e-9||S.y+S.height>b.y+b.height+1e-9)&&e("The hole must sit inside its rect",[..._,"hole"]);}b.type==="circle"&&b.hole&&b.hole>=b.r&&e("The hole must be smaller than the circle",[..._,"hole"]),"stroke"in b&&b.stroke&&b.stroke.width>Math.min(r,a)*.1+1e-9&&e("A stroke may be at most 10% of the artboard's shorter side",[..._,"stroke","width"]),c.plate==="background"&&Od(b,t,w)&&e('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',_),f+=C,typeof b.fill=="object"&&"gradient"in b.fill&&(d+=(b.fill.gradient.steps??32)*C);}),f>n.maxSegments&&e(`The shapes have ${f} segments; the limit is ${n.maxSegments}`,["shapes"]),d>n.maxGradientWork&&e("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let g=[],h=new Set,p=new Set;t.labels.forEach((b,y)=>{let _=["labels",y];h.has(b.id)&&e(`Label id "${b.id}" is used twice`,[..._,"id"]),h.add(b.id),b.slot!=="fixed"&&(p.has(b.slot)&&e(`Only one label may use the ${b.slot} slot`,[..._,"slot"]),p.add(b.slot));let w=b.maxLength??n.maxTextLength;b.text!==Cn(b.text,w)&&e(`Label text must be at most ${w} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[..._,"text"]);let C;if(b.type==="text"){C={x0:b.box.x,y0:b.box.y,x1:b.box.x+b.box.width,y1:b.box.y+b.box.height},b.fontSize!==void 0&&b.fontSize>b.box.height*er+1e-9&&e("fontSize may be at most 95% of the label's row height",[..._,"fontSize"]);let S=b.box.y+b.box.height/2,x=Fd(b)*kd,M={x0:C.x0,x1:C.x1,y0:S-x,y1:S+x};(Ha(C,Ld(t))||Ha(M,m))&&e("The label overlaps the code or its padding",[..._,"box"]);}else {let{cx:S,cy:x,radius:M}=b.curve,R=b.fontSize*_n*.6;C={x0:S-M-R,y0:x-M-R,x1:S+M+R,y1:x+M+R};let E=Math.hypot(Math.max(m.x0-S,0,S-m.x1),Math.max(m.y0-x,0,x-m.y1));Math.hypot(Math.max(Math.abs(m.x0-S),Math.abs(m.x1-S)),Math.max(Math.abs(m.y0-x),Math.abs(m.y1-x)))<=M-R||E>=M+R||e("The curved label crosses the code or its padding",[..._,"curve"]);}if(s(C)||e("The label extends outside the artboard",_),b.collapse){let S=b.collapse,x=S.y+S.height;(S.y<-1e-9||x>a+1e-9)&&e("The collapse band must sit inside the artboard",[..._,"collapse"]),x>m.y0+1e-6&&S.y<m.y1-1e-6&&e("The collapse band crosses the code or its padding",[..._,"collapse"]);for(let M of g)x>M.y+1e-6&&S.y<M.y+M.height-1e-6&&e("Collapse bands may not overlap",[..._,"collapse"]);g.push(S);}});}var Xa=(t,e=0)=>{for(let n=e;n<t.length;n++)if(t[n]?.continue!==true)return true;return false};function $e(t,e=[],n={}){return {...n,run(o){let r=t({value:o,issues:[]}),a=Xa(r.issues);for(let i of e){if(i.hasLength){let s=r.value;if(r.issues.some(c=>c.continue===false)||s===null||s===void 0||s.length===void 0)continue}else if(a)continue;let l=r.issues.length;i.run(r),!a&&r.issues.length>l&&(a=Xa(r.issues,l));}return r}}}function Bd(t){if(typeof t=="number")return Number.isNaN(t)?"NaN":Number.isFinite(t)?"number":String(t);if(t===null)return "null";if(Array.isArray(t))return "array";if(typeof t=="object"){let e=t.constructor;if(Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&e)return e.name}return typeof t}var Ue=(t,e)=>({path:[],message:`Invalid input: expected ${t}, received ${Bd(e)}`}),Gd={string:"characters",array:"items"};function le(t,e,n,o){let r=Gd[e],a=t?"Too big":"Too small",i=`${t?"<=":">="}${n}`;return {path:[],message:r?`${a}: expected ${e} to have ${i} ${r}`:`${a}: expected ${e} to be ${i}`,continue:o}}var ja=t=>typeof t=="string"?`"${t}"`:`${t}`,Cl=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function Ja(t,e,n){for(let o of n)o.path.unshift(e),t.push(o);}var Qd=t=>t>=55296&&t<=56319,Ud=t=>t>=56320&&t<=57343;function Hd(t){let e=t.length;for(let n=0;n<t.length-1;n++)Qd(t.charCodeAt(n))&&Ud(t.charCodeAt(n+1))&&(e--,n++);return e}var Ml=t=>Array.isArray(t)?"array":typeof t=="string"?"string":"unknown",or=t=>({run(e){e.value<t&&e.issues.push(le(false,"number",t,true));}}),ar=t=>({run(e){e.value>t&&e.issues.push(le(true,"number",t,true));}}),An=(t,e="Invalid input")=>({run(n){t(n.value)||n.issues.push({path:[],message:e,continue:true});}}),Rl=t=>typeof t=="string"?Hd(t):t.length,El=t=>({hasLength:true,run(e){let n=e.value;Rl(n)<t&&e.issues.push(le(false,Ml(n),t,true));}}),ti=t=>({hasLength:true,run(e){let n=e.value;Rl(n)>t&&e.issues.push(le(true,Ml(n),t,true));}}),Al=(t,e)=>({run(n){t.lastIndex=0,t.test(n.value)||n.issues.push({path:[],message:e??`Invalid string: must match pattern ${t}`,continue:true});}}),zd={run(t){let e=t.value;Number.isInteger(e)?Number.isSafeInteger(e)||t.issues.push(e>0?le(true,"int",Number.MAX_SAFE_INTEGER,true):le(false,"int",Number.MIN_SAFE_INTEGER,true)):t.issues.push({...Ue("int",e),continue:false});}},He=(...t)=>$e(e=>{let n=e.value;return typeof n=="number"&&Number.isFinite(n)||e.issues.push(Ue("number",n)),e},t),Pl=(...t)=>He(zd,...t),jr=(...t)=>$e(e=>(typeof e.value!="string"&&e.issues.push(Ue("string",e.value)),e),t);function zt(t){let e=t.length===1?`Invalid input: expected ${ja(t[0])}`:`Invalid option: expected one of ${t.map(ja).join("|")}`;return $e(n=>(t.includes(n.value)||n.issues.push({path:[],message:e}),n),[],{values:t})}var Ht=t=>zt([t]),st=t=>({optional:true,run:e=>e===void 0?{value:e,issues:[]}:t.run(e)});function gt(t,e=[]){let n=Object.keys(t),o=new Set(n);return $e(r=>{let a=r.value;if(!Cl(a))return r.issues.push(Ue("object",a)),r;let i={};for(let s of n){let c=t[s],u=c.run(a[s]),m=s in a;Ja(r.issues,s,u.issues),m||c.optional||u.issues.length>0||r.issues.push({path:[s],message:"Invalid input: expected nonoptional, received undefined"}),m&&(i[s]=u.value);}r.value=i;let l=[];for(let s in a)o.has(s)||l.push(s);return l.length>0&&r.issues.push({path:[],message:`Unrecognized key${l.length>1?"s":""}: ${l.map(ja).join(", ")}`,continue:true}),r},e,{shape:t})}function Za(t,e,n){let o=[];return e!==void 0&&o.push(El(e)),n!==void 0&&o.push(ti(n)),$e(r=>{let a=r.value;if(Array.isArray(a)&&n!==void 0&&a.length>n)return r.issues.push(le(true,"array",n,false)),r;if(!Array.isArray(a))return r.issues.push(Ue("array",a)),r;let i=new Array(a.length);for(let l=0;l<a.length;l++){let s=t.run(a[l]);Ja(r.issues,l,s.issues),i[l]=s.value;}return r.value=i,r},o)}function Ya(t){return $e(e=>{let n=e.value;if(!Array.isArray(n))return e.issues.push(Ue("tuple",n)),e;if(n.length<t.length)return e.issues.push(le(false,"array",t.length,void 0)),e;n.length>t.length&&e.issues.push(le(true,"array",t.length,void 0));let o=[];return t.forEach((r,a)=>{let i=r.run(n[a]);Ja(e.issues,a,i.issues),o[a]=i.value;}),e.value=o,e})}function En(t){return $e(e=>{let n=[];for(let r of t){let a=r.run(e.value);if(a.issues.length===0)return a;n.push(a);}let o=n.filter(r=>!Xa(r.issues));return o.length===1?o[0]:(e.issues.push({path:[],message:"Invalid input"}),e)})}function vl(t,e){let n=new Map;for(let r of e)for(let a of r.shape?.[t]?.values??[])n.set(a,r);let o=`Invalid discriminator value. Expected ${[...n.keys()].map(r=>`'${r}'`).join(" | ")}`;return $e(r=>{let a=r.value;if(!Cl(a))return r.issues.push(Ue("object",a)),r;let i=n.get(a[t]);return i?i.run(a):(r.issues.push({path:[t],message:o}),r)})}var qd=An(Vr,`Numbers may have at most ${at.maxDecimals} decimals`),Yr=[or(-at.maxCoordinate),ar(at.maxCoordinate),qd],St=He(...Yr),Pt=He(...Yr,An(t=>t>0,"Must be greater than 0")),Zr=He(...Yr,An(t=>t>=0,"Must not be negative")),rr=jr(Al(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color")),$l=En([zt(qa),rr]),Il=t=>gt({mix:Ya([t,t]),amount:He(or(0),ar(1),An(Vr))}),Rn=En([$l,Il($l)]),Wd=En([rr,Il(En([zt(["frame","accent","background"]),rr]))]),Qe=En([Rn,gt({gradient:gt({from:Rn,to:Rn,direction:st(zt(["horizontal","vertical"])),steps:st(Pl(or(2),ar(at.maxGradientSteps)))})})]),Ka=()=>({x:St,y:St,width:Pt,height:Pt}),nr=gt({color:Rn,width:Pt}),Vd=vl("type",[gt({type:Ht("rect"),...Ka(),radius:st(Zr),fill:Qe,hole:st(gt({...Ka(),radius:st(Zr)})),stroke:st(nr)}),gt({type:Ht("circle"),cx:St,cy:St,r:Pt,hole:st(Pt),fill:Qe,stroke:st(nr)}),gt({type:Ht("ellipse"),cx:St,cy:St,rx:Pt,ry:Pt,fill:Qe,stroke:st(nr)}),gt({type:Ht("polygon"),points:Za(Ya([St,St]),3,at.maxPolygonPoints),fill:Qe,stroke:st(nr)}),gt({type:Ht("path"),d:jr(El(2),ti(at.maxPathLength)),fill:Qe,fillRule:st(zt(["nonzero","evenodd"])),stroke:st(nr)}),gt({type:Ht("line"),x1:St,y1:St,x2:St,y2:St,width:Pt,cap:st(zt(["butt","round"])),dash:st(Ya([Pt,Pt])),fill:Qe}),gt({type:Ht("icon"),icon:zt(za),x:St,y:St,size:Pt,fill:Qe})]),Sl=()=>({id:jr(Al(/^[a-z][a-z0-9-]{0,31}$/)),slot:zt(["primary","secondary","fixed"]),text:jr(ti(200)),maxLength:st(Pl(or(1),ar(ie))),color:Rn,weight:st(zt(["bold","regular"])),collapse:st(gt({y:St,height:Pt}))}),Xd=vl("type",[gt({type:Ht("text"),...Sl(),box:gt(Ka()),align:st(zt(["start","middle","end"])),fontSize:st(Pt)}),gt({type:Ht("curved"),...Sl(),curve:gt({cx:St,cy:St,radius:Pt,side:zt(["top","bottom"]),spread:st(He(or(20),ar(300),An(Vr)))}),fontSize:Pt})]),wl=He(...Yr,An(t=>t>=at.minArtboard&&t<=at.maxArtboard,`Artboard sides must be ${at.minArtboard} to ${at.maxArtboard} units`)),jd=gt({kind:Ht(Kn),version:Ht(Jn),artboard:gt({width:wl,height:wl}),qr:gt({x:St,y:St,size:Pt,padding:st(Zr),radius:st(Zr),plate:st(zt(["opaque","background","none"]))}),colors:gt({frame:rr,text:st(Wd),accent:st(rr)}),shapes:Za(Vd,void 0,at.maxShapes),labels:Za(Xd,void 0,at.maxLabels),bleed:st(En([Ht("none"),Rn]))},[{run(t){xl(t.value,(e,n=[])=>{t.issues.push({path:[...n],message:e,continue:true});});}}]);function Kr(t){let e=jd.run(t);return e.issues.length===0?{success:true,data:e.value}:{success:false,issues:e.issues.map(({path:n,message:o})=>({path:n,message:o}))}}var Ll=({path:t,message:e})=>t.length>0?`${t.join(".")}: ${e}`:e;function et(t){if(t.length===0)return "";let[e,...n]=t;return `M${$(e[0])} ${$(e[1])}${n.map(([o,r])=>`L${$(o)} ${$(r)}`).join("")}Z`}function J(t,e,n){return `M${$(t-n)} ${$(e)}A${$(n)} ${$(n)} 0 1 1 ${$(t+n)} ${$(e)}A${$(n)} ${$(n)} 0 1 1 ${$(t-n)} ${$(e)}Z`}function D(t,e,n,o,r=0){let a=Math.min(n,o)/2,[i,l,s,c]=(typeof r=="number"?[r,r,r,r]:r).map(m=>Math.max(0,Math.min(m,a))),u=(m,f,d)=>m>0?`A${$(m)} ${$(m)} 0 0 1 ${$(f)} ${$(d)}`:"";return `M${$(t+i)} ${$(e)}H${$(t+n-l)}${u(l,t+n,e+l)}V${$(e+o-s)}${u(s,t+n-s,e+o)}H${$(t+c)}${u(c,t,e+o-c)}V${$(e+i)}${u(i,t+i,e)}Z`}function Pn(t,e,n,o,r=-90){return Array.from({length:o},(a,i)=>{let l=(r+360/o*i)*Math.PI/180;return [t+n*Math.cos(l),e+n*Math.sin(l)]})}function vn(t,e,n,o,r=5){return Array.from({length:r*2},(a,i)=>{let l=i%2===0?n:o,s=-Math.PI/2+Math.PI/r*i;return [t+l*Math.cos(s),e+l*Math.sin(s)]})}function ir(t,e,n,o,r=4,a=64){return Array.from({length:a},(i,l)=>{let s=2*Math.PI*l/a,c=Math.cos(s),u=Math.sin(s);return [t+n*Math.sign(c)*Math.abs(c)**(2/r),e+o*Math.sign(u)*Math.abs(u)**(2/r)]})}function In(t,e,n){let o=n/2,r=(a,i)=>`${$(t+a*o)} ${$(e+i*o)}`;return `M${r(0,-0.52)}C${r(.18,-0.92)} ${r(.98,-0.94)} ${r(1,-0.34)}C${r(1,.12)} ${r(.5,.48)} ${r(0,.92)}C${r(-0.5,.48)} ${r(-1,.12)} ${r(-1,-0.34)}C${r(-0.98,-0.94)} ${r(-0.18,-0.92)} ${r(0,-0.52)}Z`}function kl(t,e,n,o){if(o===0)return t;let r=o*Math.PI/180,a=Math.cos(r),i=Math.sin(r);return t.map(([l,s])=>[e+(l-e)*a-(s-n)*i,n+(l-e)*i+(s-n)*a])}function Jr(t,e,n=0){let o=Math.imul(t+2654435769,2246822507)^Math.imul(e+n,3266489909);return o=Math.imul(o^o>>>15,739982445),o=Math.imul(o^o>>>12,695872825),o^=o>>>15,(o>>>0)/4294967296}function ze(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return (e>>>0).toString(36)}var ei=24,Se=(t,e,n,o)=>{let r=o*Math.PI/180;return [t+n*Math.cos(r),e+n*Math.sin(r)]},to=([t,e])=>`${$(t)} ${$(e)}`;function Ln(t,e,n,o,r,a){let i=a-r>180?1:0;return `M${to(Se(t,e,o,r))}A${$(o)} ${$(o)} 0 ${i} 1 ${to(Se(t,e,o,a))}L${to(Se(t,e,n,a))}A${$(n)} ${$(n)} 0 ${i} 0 ${to(Se(t,e,n,r))}Z`}function sr(t,e,n,o){return `M${$(t-n)} ${$(e)}A${$(n)} ${$(o)} 0 1 1 ${$(t+n)} ${$(e)}A${$(n)} ${$(o)} 0 1 1 ${$(t-n)} ${$(e)}Z`}function Zd(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),e/2}function Fl(t){return et(Zd(t)<0?[...t].reverse():t)}function eo(t,e,n,o,r){let a=Math.hypot(n-t,o-e)||1,i=-(o-e)/a*(r/2),l=(n-t)/a*(r/2);return Fl([[t+i,e+l],[n+i,o+l],[n-i,o-l],[t-i,e-l]])}var It=(...t)=>({d:t.join(""),fillRule:"nonzero"}),ce=(...t)=>({d:t.join(""),fillRule:"evenodd"});function Yd(){let t=[];for(let e of [0,60,120]){let[n,o]=Se(12,12,10.5,e+180),[r,a]=Se(12,12,10.5,e);t.push(eo(n,o,r,a,2));}for(let e=0;e<6;e++){let n=e*60,[o,r]=Se(12,12,6.2,n);for(let a of [-45,45]){let[i,l]=Se(o,r,3.6,n+a);t.push(eo(o,r,i,l,1.7));}}return It(...t)}var Kd={wifi:()=>It(Ln(12,20,4.6,7.2,-135,-45),Ln(12,20,9.2,11.8,-135,-45),Ln(12,20,13.8,16.4,-135,-45),J(12,20,2.2)),star:()=>It(et(vn(12,12.8,11.6,4.8))),heart:()=>It(In(12,12.4,22)),phone:()=>ce(D(6,1.5,12,21,2.6),D(7.8,4.2,8.4,13.4,.6),J(12,19.8,1.1)),headphones:()=>It(Ln(12,13,7.6,9.8,-180,0),D(2,12,5,9.5,2),D(17,12,5,9.5,2)),calendar:()=>ce(D(2.5,4,19,17.5,2.5),D(4.6,9,14.8,10.6,.8),D(7,11.4,2.6,2.6,.4),D(10.7,11.4,2.6,2.6,.4),D(14.4,11.4,2.6,2.6,.4),D(7,15.1,2.6,2.6,.4),D(10.7,15.1,2.6,2.6,.4),D(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),D(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>It(J(12,7.5,4.6),"M3 21.5C3 16.2 7 13.6 12 13.6C17 13.6 21 16.2 21 21.5Z"),chat:()=>ce(D(2,3,20,14,4),et([[6.5,17],[11.5,17],[5.8,21.8]]),J(7.5,10,1.5),J(12,10,1.5),J(16.5,10,1.5)),bag:()=>It(D(3.5,7.5,17,14.5,2),Ln(12,7.5,3.1,4.8,-180,0)),bell:()=>It("M3.5 17.2A8.5 8.5 0 0 1 20.5 17.2Z",D(1.5,18.2,21,2.6,1.3),D(11.2,6.6,1.6,2.6,0),D(9.8,4.6,4.4,2.4,1.2)),cup:()=>It("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",Ln(17,10.2,1.7,3.6,-90,90),D(2,20.6,17,2,1),D(7,1.6,1.6,3.4,.8),D(11.6,1.6,1.6,3.4,.8)),card:()=>ce(D(1.5,4.5,21,15,2.5),D(1.5,8,21,3,0),D(4.5,13.6,4.6,3.2,.6)),check:()=>ce(J(12,12,10.5),et([[6.6,12.4],[8.4,10.6],[10.6,12.8],[15.8,7.6],[17.6,9.4],[10.6,16.4]])),info:()=>ce(J(12,12,10.5),J(12,7.2,1.6),D(10.6,10,2.8,8,.8)),home:()=>ce(et([[12,2.5],[22.5,11.5],[19.5,11.5],[19.5,21.5],[4.5,21.5],[4.5,11.5],[1.5,11.5]]),D(10,14.5,4,7,[.6,.6,0,0])),pin:()=>ce("M12 22.5C8.5 17.6 4.5 14 4.5 9.5A7.5 7.5 0 0 1 19.5 9.5C19.5 14 15.5 17.6 12 22.5Z",J(12,9.5,3)),share:()=>It(eo(6,12,18,5,1.8),eo(6,12,18,19,1.8),J(18,5,3.2),J(6,12,3.2),J(18,19,3.2)),download:()=>It(D(10.6,2,2.8,9.5,0),et([[6,10],[18,10],[12,16.5]]),et([[2.5,15],[5.3,15],[5.3,19],[18.7,19],[18.7,15],[21.5,15],[21.5,21.8],[2.5,21.8]])),clock:()=>ce(J(12,12,10.5),J(12,12,8.4),et([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:Yd,pumpkin:()=>It(sr(7.8,14.6,5.8,6.9),sr(16.2,14.6,5.8,6.9),sr(12,14.6,4.8,7.4),D(10.9,3.4,2.2,4.6,.8),Fl([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>It(et([[12,1.5],[16.8,8.2],[7.2,8.2]]),et([[12,5.2],[19,13.6],[5,13.6]]),et([[12,9.4],[21.2,19.2],[2.8,19.2]]),D(10.4,18.6,3.2,3.9,.4)),sparkle:()=>It(et(vn(9.5,13.5,9,2.4,4)),et(vn(19,5,4,1.1,4))),gift:()=>It(D(3,11.2,7.8,10.6,1),D(13.2,11.2,7.8,10.6,1),D(2,7.4,8.8,3.2,1),D(13.2,7.4,8.8,3.2,1),sr(8.8,4.8,2.9,1.9),sr(15.2,4.8,2.9,1.9))};function ni(t){return Kd[t]()}var Jd={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},tf=Object.fromEntries(Object.entries(Jd).map(([t,e])=>[t,[Number.parseInt(e.slice(0,2),16),Number.parseInt(e.slice(2,4),16),Number.parseInt(e.slice(4,6),16)]]));function Tl(t,e){let n=t.trim(),o=Number.parseFloat(n);return Number.isNaN(o)?Number.NaN:n.endsWith("%")?o/100*e:o}function lt(t){if(!t)return null;let e=t.trim().toLowerCase();if(e==="transparent")return {r:0,g:0,b:0,a:0};let n=tf[e];if(n)return {r:n[0],g:n[1],b:n[2],a:1};if(e.startsWith("#")){let r=e.slice(1);return (r.length===3||r.length===4)&&(r=r.split("").map(a=>a+a).join("")),/^[0-9a-f]{6}([0-9a-f]{2})?$/.test(r)?{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.slice(4,6),16),a:r.length===8?Number.parseInt(r.slice(6,8),16)/255:1}:null}let o=/^rgba?\(([^)]*)\)$/.exec(e);if(o){let[r,a]=o[1].split("/"),i=r.split(/[\s,]+/).filter(Boolean);if(i.length!==(a===void 0&&i.length===4?4:3))return null;let l=a??i[3],[s,c,u]=i.slice(0,3).map(d=>Tl(d,255)),m=l===void 0?1:Tl(l,1);if([s,c,u,m].some(d=>Number.isNaN(d)))return null;let f=(d,g)=>Math.min(Math.max(d,0),g);return {r:f(s,255),g:f(c,255),b:f(u,255),a:f(m,1)}}return null}function we(t,e,n){let o=t/255,r=e/255,a=n/255,i=1-Math.max(o,r,a);return i>=1?[0,0,0,1]:[K((1-o-i)/(1-i)),K((1-r-i)/(1-i)),K((1-a-i)/(1-i)),K(i)]}function Nl(t){return t===" "?.3:/[MWmw@%]/.test(t)?.92:/[A-Z0-9#&]/.test(t)?.72:/[il.,:;!'|1]/.test(t)?.32:.6}function oi(t){let e=0;for(let n of t)e+=Nl(n);return Math.max(e,1)}var ri=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function lr(t,e,n){let o=lt(t)??{r:0,g:0,b:0},r=lt(e)??{r:255,g:255,b:255},a=Math.min(1,Math.max(0,n));return `#${ri(o.r+(r.r-o.r)*a)}${ri(o.g+(r.g-o.g)*a)}${ri(o.b+(r.b-o.b)*a)}`}function Ol(t,e,n,o,r,a,i,l){let s=[...t],c=r*.08,u=s.map(h=>Nl(h)*r),m=u.reduce((h,p)=>h+p,0)+c*Math.max(0,s.length-1),f=a==="top"?o-r*.35:o+r*.35,d=[],g=0;return s.forEach((h,p)=>{let b=u[p],y=(g+b/2)/f;if(g+=b+c,h.trim()==="")return;let _=a==="top"?-Math.PI/2-m/2/f+y:Math.PI/2+m/2/f-y;d.push({text:h,x:e+f*Math.cos(_),y:n+f*Math.sin(_),fontSize:r,maxWidth:r*2,color:i,rotate:_*180/Math.PI+(a==="top"?90:-90),field:l});}),d}function bt(t,e="#000000"){return t?typeof t=="string"?t:t.type==="solid"?t.color:t.type==="image"?t.underlay||e:(t.type==="linear"||t.type==="radial"||t.type==="angular")&&t.stops[0]?.color||e:e}var cr=class extends Error{issues;constructor(e){super(`Invalid frame spec: ${e.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=e;}},Dl=new WeakMap;function qe(t){if(t&&typeof t=="object"){let n=Dl.get(t);if(n)return n}if(t==null)throw new cr(['A "custom" frame needs a spec']);let e=Kr(t);if(!e.success)throw new cr(e.issues.map(Ll));return typeof t=="object"&&Dl.set(t,e.data),e.data}function ai(t){let e=qe(t);return Mn(e)/e.qr.size}var ef=t=>{let e=lt(t);return !!(e&&e.a>=1)};function nf(t,e){let n=bt(e,dt);return t.qr.plate==="none"?{color:n,plate:false}:ef(n)?{color:n,plate:true}:t.qr.plate==="background"?{color:n,plate:false}:{color:dt,plate:true}}function no(t,e,n=dt){let o=e.color||t.colors.frame,r=e.secondaryColor||t.colors.accent||o,a=s=>s==="frame"?o:s==="accent"?r:s==="background"?n:s,i=t.colors.text,l=e.textColor||(i===void 0?o:typeof i=="string"?i:lr(a(i.mix[0]),a(i.mix[1]),i.amount));return {frame:o,text:l,accent:r}}function rf(t,e,n){let o=no(e,t,n),r=a=>{switch(a){case "frame":return o.frame;case "text":return o.text;case "accent":return o.accent;case "background":return n;default:return a}};return a=>typeof a=="string"?r(a):lr(r(a.mix[0]),r(a.mix[1]),a.amount)}function Bl(t,e,n=0,o=0){let r=Yn(t);return r?Da(r,e,n,o):""}function of(t,e,n,o){return `M${$(t-n)} ${$(e)}A${$(n)} ${$(o)} 0 1 1 ${$(t+n)} ${$(e)}A${$(n)} ${$(o)} 0 1 1 ${$(t-n)} ${$(e)}Z`}function af(t,e){let[n,o,r,a]=[t.x1*e,t.y1*e,t.x2*e,t.y2*e],i=Math.hypot(r-n,a-o),l=t.width*e/2,s=i>0?(r-n)/i:1,c=i>0?(a-o)/i:0,u=-c*l,m=s*l,f=(p,b)=>{let y=[n+s*p,o+c*p],_=[n+s*b,o+c*b];if(t.cap==="round"&&b-p>2*l){let w=[y[0]+s*l,y[1]+c*l],C=[_[0]-s*l,_[1]-c*l];return `M${$(w[0]-u)} ${$(w[1]-m)}L${$(C[0]-u)} ${$(C[1]-m)}A${$(l)} ${$(l)} 0 0 1 ${$(C[0]+u)} ${$(C[1]+m)}L${$(w[0]+u)} ${$(w[1]+m)}A${$(l)} ${$(l)} 0 0 1 ${$(w[0]-u)} ${$(w[1]-m)}Z`}return `M${$(y[0]-u)} ${$(y[1]-m)}L${$(_[0]-u)} ${$(_[1]-m)}L${$(_[0]+u)} ${$(_[1]+m)}L${$(y[0]+u)} ${$(y[1]+m)}Z`};if(!t.dash)return {type:"path",d:f(0,i),fillRule:"nonzero"};let d=t.dash[0]*e,g=d+t.dash[1]*e,h=[];for(let p=0;p+d<=i+1e-6;p+=g)h.push(f(p,p+d));return {type:"path",d:h.join(""),fillRule:"nonzero"}}function sf(t,e){switch(t.type){case "rect":return {type:"rect",x:t.x*e,y:t.y*e,width:t.width*e,height:t.height*e,radius:(t.radius??0)*e,...t.hole&&{hole:{x:t.hole.x*e,y:t.hole.y*e,width:t.hole.width*e,height:t.hole.height*e,radius:(t.hole.radius??0)*e}}};case "circle":return {type:"path",d:J(t.cx*e,t.cy*e,t.r*e)+(t.hole?J(t.cx*e,t.cy*e,t.hole*e):""),fillRule:t.hole?"evenodd":"nonzero"};case "ellipse":return {type:"path",d:of(t.cx*e,t.cy*e,t.rx*e,t.ry*e),fillRule:"nonzero"};case "polygon":return {type:"polygon",points:t.points.map(([n,o])=>[n*e,o*e])};case "path":return {type:"path",d:Bl(t.d,e),fillRule:t.fillRule??"nonzero"};case "line":return af(t,e);default:{let n=ni(t.icon);return {type:"path",d:Bl(n.d,t.size*e/ei,t.x*e,t.y*e),fillRule:n.fillRule}}}}function lf(t){if(t.type==="rect"){let{x:e,y:n,width:o,height:r,radius:a,hole:i}=t;return [...ee(e,n,o,r,a,a),...i?ee(i.x,i.y,i.width,i.height,i.radius,i.radius):[]]}return t.type==="polygon"?[...t.points.map(([e,n],o)=>o===0?{op:"M",x:e,y:n}:{op:"L",x:e,y:n}),{op:"Z"}]:se(t.d)}function cf(t,e,n){let o=lf(t),r=qr(o,.2),a=t.type==="rect"?t.hole?"evenodd":"nonzero":t.type==="path"?t.fillRule??"nonzero":"nonzero",i=e.direction==="vertical",l=p=>i?p[1]:p[0],s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;for(let p of r)for(let b of p)s=Math.min(s,l(b)),c=Math.max(c,l(b));if(!(c>s))return [];let u=e.steps??32,m=n(e.from),f=n(e.to),d=c-s,g=d*.002,h=[];for(let p=0;p<u;p++){let b=s+d*p/u,y=Math.min(c,s+d*(p+1)/u+(p+1<u?g:0)),_=i?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:b,y1:y}:{x0:b,x1:y,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},w=r.map(C=>xn(C,_)).filter(C=>C.length>2);w.length!==0&&h.push({type:"path",d:hl(w),fill:lr(m,f,(p+.5)/u),fillRule:a});}return h}function uf(t,e,n){let o=sf(t,e),r="stroke"in t&&t.stroke?{stroke:n(t.stroke.color),strokeWidth:t.stroke.width*e}:void 0;if(typeof t.fill=="object"&&"gradient"in t.fill){let a=cf(o,t.fill.gradient,n);return r?[...a,{...o,fill:"none",...r}]:a}return [{...o,fill:n(t.fill),...r}]}function mf(t,e){let n=Math.min(t.maxLength??at.maxTextLength,at.maxTextLength),o=t.slot==="primary"?e.text??t.text:t.slot==="secondary"?e.secondaryText??t.text:t.text;return Cn(o,n)}function df(t){return t===void 0||!Number.isFinite(t)?1:Math.min(_n,Math.max(Zn,t))}function ff(t,e,n,o,r,a){let i=r(t.color),l=t.weight==="regular"?{fontWeight:400}:{};if(t.type==="curved"){let{cx:h,cy:p,radius:b,side:y,spread:_=140}=t.curve,w=b*o*(_*Math.PI/180),C=Math.min(t.fontSize*o*n,w/(oi(e)+.08*e.length));return Ol(e,h*o,p*o,b*o,C,y,i,a).map(S=>({...S,...l}))}let s=t.box.x*o,c=t.box.y*o,u=t.box.width*o,m=t.box.height*o;if(!(m>0))return [];let f=(t.fontSize??t.box.height*Wa)*o,d=Math.min(f*n,m*er,u/oi(e)),g=t.align??"middle";return [{text:e,x:g==="start"?s:g==="end"?s+u:s+u/2,y:c+m/2+d*.35,fontSize:d,maxWidth:u,color:i,...g!=="middle"&&{align:g},...l,field:a}]}function hf(t){let e=0,n=0,o=0,r=0;return t.map(({command:a,values:i})=>{let l=a.toUpperCase(),s=a!==l;switch(l){case "Z":return e=o,n=r,{command:"Z",values:[]};case "H":return e=(s?e:0)+i[0],{command:"H",values:[e]};case "V":return n=(s?n:0)+i[0],{command:"V",values:[n]};case "A":return e=(s?e:0)+i[5],n=(s?n:0)+i[6],{command:"A",values:[...i.slice(0,5),e,n]};default:{let c=i.map((u,m)=>s?u+(m%2===0?e:n):u);return e=c.at(-2),n=c.at(-1),l==="M"&&(o=e,r=n),{command:l,values:c}}}})}function pf(t,e){let n=Yn(t);return n?Da(hf(n).map(({command:o,values:r})=>o==="V"?{command:o,values:[e(r[0])]}:o==="H"||o==="Z"?{command:o,values:r}:o==="A"?{command:o,values:[...r.slice(0,6),e(r[6])]}:{command:o,values:r.map((a,i)=>i%2===1?e(a):a)})):t}function gf(t,e){let n=(o,r)=>{let a=e(o);return {y:a,height:e(o+r)-a}};switch(t.type){case "rect":return {...t,...n(t.y,t.height),...t.hole&&{hole:{...t.hole,...n(t.hole.y,t.hole.height)}}};case "circle":case "ellipse":return {...t,cy:e(t.cy)};case "polygon":return {...t,points:t.points.map(([o,r])=>[o,e(r)])};case "path":return {...t,d:pf(t.d,e)};case "line":return {...t,y1:e(t.y1),y2:e(t.y2)};default:return {...t,y:e(t.y)}}}function bf(t,e){if(e.length===0)return t;let n=r=>{let a=r;for(let i of e)a-=Math.min(Math.max(r-i.y,0),i.height);return a},o=(r,a)=>e.some(i=>r>=i.y-1e-6&&a<=i.y+i.height+1e-6);return {...t,artboard:{...t.artboard,height:n(t.artboard.height)},qr:{...t.qr,y:n(t.qr.y)},shapes:t.shapes.filter(r=>{let{bounds:a}=Va(r);return !(a&&o(a.y0,a.y1))}).map(r=>gf(r,n)),labels:t.labels.map(r=>{if(r.type==="curved")return {...r,curve:{...r.curve,cy:n(r.curve.cy)}};let a=n(r.box.y);return {...r,box:{...r.box,y:a,height:n(r.box.y+r.box.height)-a}}})}}function ur(t,e,n,o,r={}){let a=new Map(e.labels.map(p=>[p.id,mf(p,n)])),i=bf(e,e.labels.flatMap(p=>p.collapse&&!a.get(p.id)?[p.collapse]:[])),l=t/i.qr.size,s=nf(i,o),c=rf(n,i,s.color),u=i.shapes.flatMap(p=>uf(p,l,c));if(s.plate){let p=Mn(i)*l;u.push({type:"rect",x:i.qr.x*l-p,y:i.qr.y*l-p,width:t+2*p,height:t+2*p,radius:(i.qr.radius??0)*l,fill:s.color});}let m=df(n.fontScale),f=i.labels.flatMap(p=>{let b=a.get(p.id);if(!b)return [];let y=(p.slot==="fixed"?void 0:r[p.slot])??p.id;return ff(p,b,m,l,c,y)}),d=f[0],g=d&&d.rotate===void 0?d:null,h=i.bleed??"none";return {width:i.artboard.width*l,height:i.artboard.height*l,qrX:i.qr.x*l,qrY:i.qr.y*l,qrSize:t,shapes:u,label:g,extraLabels:g?f.slice(1):f,squareEdges:h!=="none",color:c(h==="none"?"frame":h)}}function ii(t,e,n){return ur(t,qe(e.spec),e,n)}var Gl={kind:"qrdx.frame",version:1,artboard:{width:1600,height:1470},qr:{x:300,y:120,size:1e3,padding:70,radius:10,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"polygon",points:[[0,1250],[190,1250],[190,1470],[0,1470],[50.4,1360]],fill:{mix:["frame","#000000"],amount:.28}},{type:"polygon",points:[[1600,1250],[1549.6,1360],[1600,1470],[1410,1470],[1410,1250]],fill:{mix:["frame","#000000"],amount:.28}},{type:"polygon",points:[[90,1420],[170,1470],[90,1470]],fill:{mix:["frame","#000000"],amount:.5}},{type:"polygon",points:[[1510,1420],[1510,1470],[1430,1470]],fill:{mix:["frame","#000000"],amount:.5}},{type:"rect",x:220,y:40,width:1160,height:1160,radius:20,fill:"background"},{type:"rect",x:180,y:0,width:1240,height:1240,radius:60,fill:"frame",hole:{x:220,y:40,width:1160,height:1160,radius:20}},{type:"rect",x:90,y:1200,width:1420,height:220,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:170,y:1200,width:1260,height:220}}]};var si={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1420},qr:{x:120,y:120,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1420,fill:"frame",hole:{x:40,y:40,width:1160,height:1160}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1200,width:1e3,height:220}}],bleed:"frame"};var Ql={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1420},qr:{x:120,y:300,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:220,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1420,fill:"frame",hole:{x:40,y:220,width:1160,height:1160}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:0,width:1e3,height:220}}],bleed:"frame"};var Ul={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1600},qr:{x:120,y:300,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:220,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1600,fill:"frame",hole:{x:40,y:220,width:1160,height:1160}}],labels:[{type:"text",id:"top",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:0,width:1e3,height:220}},{type:"text",id:"bottom",slot:"secondary",text:"",color:"text",box:{x:120,y:1380,width:1e3,height:220}}],bleed:"frame"};var Hl={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1340},qr:{x:120,y:120,size:1e3,padding:40,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1260,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1340,fill:"frame",hole:{x:40,y:40,width:1160,height:1260}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1120,width:1e3,height:180},collapse:{y:1200,height:100}}],bleed:"frame"};var zl={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1530},qr:{x:120,y:120,size:1e3,padding:80,radius:80},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:0,y:0,width:1240,height:1400,radius:120,fill:"frame"},{type:"path",d:"M161.2 1380L62 1530Q198.4 1458.5 396.8 1380Z",fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1200,width:1e3,height:200},collapse:{y:1220,height:160}}]};var ql={kind:"qrdx.frame",version:1,artboard:{width:1978.214,height:1978.214},qr:{x:489.107,y:489.107,size:1e3,padding:50,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"circle",cx:989.107,cy:989.107,r:779.107,fill:"background"},{type:"circle",cx:989.107,cy:989.107,r:989.107,hole:779.107,fill:"frame"},{type:"circle",cx:105,cy:989.107,r:14.7,fill:"text"},{type:"circle",cx:1873.214,cy:989.107,r:14.7,fill:"text"}],labels:[{type:"curved",id:"top",slot:"primary",text:"Scan me",color:"text",curve:{cx:989.107,cy:989.107,radius:884.107,side:"top",spread:140},fontSize:105},{type:"curved",id:"bottom",slot:"secondary",text:"",color:"text",curve:{cx:989.107,cy:989.107,radius:884.107,side:"bottom",spread:140},fontSize:105}]};var Wl={kind:"qrdx.frame",version:1,artboard:{width:1320,height:1558},qr:{x:160,y:130,size:1e3,padding:60},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:0,y:370,width:1320,height:1188,fill:{mix:["frame","#FFFFFF"],amount:.45}},{type:"polygon",points:[[0,370],[660,0],[1320,370]],fill:{mix:["frame","#FFFFFF"],amount:.25}},{type:"rect",x:80,y:50,width:1160,height:1268,fill:"background"},{type:"rect",x:68,y:38,width:1184,height:1280,fill:"frame",hole:{x:80,y:50,width:1160,height:1268}},{type:"polygon",points:[[0,1178],[660,1318],[1320,1178],[1320,1558],[0,1558]],fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:160,y:1318,width:1e3,height:220}}]};var Vl={kind:"qrdx.frame",version:1,artboard:{width:1230,height:1430},qr:{x:115,y:115,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:0,y:0,width:1230,height:1430,fill:"background"},{type:"polygon",points:[[0,0],[200,0],[200,35],[35,35],[35,200],[0,200]],fill:"frame"},{type:"polygon",points:[[1230,0],[1030,0],[1030,35],[1195,35],[1195,200],[1230,200]],fill:"frame"},{type:"polygon",points:[[1230,1230],[1030,1230],[1030,1195],[1195,1195],[1195,1030],[1230,1030]],fill:"frame"},{type:"polygon",points:[[0,1230],[200,1230],[200,1195],[35,1195],[35,1030],[0,1030]],fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:80,y:1210,width:1070,height:200},collapse:{y:1230,height:200}}]};var ro={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1360},qr:{x:130,y:130,size:1e3,padding:40,plate:"background"},colors:{frame:"#7c3aed",text:{mix:["frame","accent"],amount:.5},accent:"#db2777"},shapes:[{type:"rect",x:50,y:50,width:1160,height:1260,radius:50,fill:"background"},{type:"rect",x:0,y:0,width:1260,height:1360,radius:100,fill:{gradient:{from:"frame",to:"accent",direction:"horizontal",steps:48}},hole:{x:50,y:50,width:1160,height:1260,radius:50}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:1130,width:1e3,height:180},collapse:{y:1210,height:100}}]};var Xl={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1460},qr:{x:130,y:260,size:1e3,padding:46,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:0,y:0,width:1260,height:1460,radius:30,fill:"background"},{type:"rect",x:0,y:0,width:1260,height:1460,radius:30,fill:"frame",hole:{x:22,y:22,width:1216,height:1416,radius:8}},{type:"rect",x:45,y:45,width:1170,height:1370,fill:"frame",hole:{x:53,y:53,width:1154,height:1354}},{type:"rect",x:378,y:181,width:504,height:8,fill:"frame"},{type:"polygon",points:[[630,163],[652,185],[630,207],[608,185]],fill:"frame"}],labels:[{type:"text",id:"title",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:30,width:1e3,height:170},collapse:{y:84,height:130}},{type:"text",id:"footer",slot:"secondary",text:"",color:"text",box:{x:130,y:1270,width:1e3,height:160},collapse:{y:1306,height:70}}]};var jl={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1610},qr:{x:130,y:250,size:1e3,padding:75,radius:55},colors:{frame:"#000000"},shapes:[{type:"rect",x:0,y:0,width:1260,height:1610,radius:170,fill:"frame"},{type:"rect",x:50,y:170,width:1160,height:1290,radius:60,fill:"background"},{type:"rect",x:520,y:67,width:220,height:36,radius:18,fill:"background"},{type:"rect",x:480,y:1520,width:300,height:30,radius:15,fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:1290,width:1e3,height:170},collapse:{y:1330,height:130}}]};var Zl={kind:"qrdx.frame",version:1,artboard:{width:1325,height:1555},qr:{x:150,y:150,size:1e3,padding:80},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:25,y:25,width:1300,height:1530,radius:15,fill:{mix:["frame","#FFFFFF"],amount:.72}},{type:"rect",x:0,y:0,width:1300,height:1530,radius:15,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:150,y:1260,width:1e3,height:240}}]};var Yl={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1340},qr:{x:120,y:120,size:1e3,padding:40,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1260,radius:60,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1340,radius:100,fill:"frame",hole:{x:40,y:40,width:1160,height:1260,radius:60}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1120,width:1e3,height:180},collapse:{y:1200,height:100}}]};var Kl={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1565},qr:{x:120,y:120,size:1e3,padding:70,radius:20,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1160,radius:30,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1240,radius:70,fill:"frame",hole:{x:40,y:40,width:1160,height:1160,radius:30}},{type:"polygon",points:[[540,1385],[620,1265],[700,1385]],fill:"frame"},{type:"rect",x:0,y:1345,width:1240,height:220,radius:110,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1345,width:1e3,height:220}}]};var Jl={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1565},qr:{x:120,y:445,size:1e3,padding:70,radius:20,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:0,y:0,width:1240,height:220,radius:110,fill:"frame"},{type:"polygon",points:[[540,180],[700,180],[620,300]],fill:"frame"},{type:"rect",x:40,y:365,width:1160,height:1160,radius:30,fill:"background"},{type:"rect",x:0,y:325,width:1240,height:1240,radius:70,fill:"frame",hole:{x:40,y:365,width:1160,height:1160,radius:30}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:0,width:1e3,height:220}}]};var tc={kind:"qrdx.frame",version:1,artboard:{width:1420,height:1590},qr:{x:195,y:195,size:1e3,padding:80},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:30,y:30,width:1390,height:1560,radius:155,fill:{mix:["frame","#FFFFFF"],amount:.7}},{type:"rect",x:0,y:0,width:1390,height:1560,radius:155,fill:"#FFFFFF"},{type:"rect",x:25,y:25,width:1340,height:1510,radius:130,fill:"frame"},{type:"rect",x:95,y:95,width:1200,height:1200,radius:40,fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:175,y:1295,width:1040,height:240},collapse:{y:1365,height:170}}]};var ec={kind:"qrdx.frame",version:1,artboard:{width:1280,height:1620},qr:{x:140,y:320,size:1e3,padding:80,radius:20},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"path",d:"M140 0H1140L1280 140V1580A40 40 0 0 1 1240 1620H40A40 40 0 0 1 0 1580V140ZM600 115.2A40 40 0 1 1 680 115.2A40 40 0 1 1 600 115.2Z",fill:"frame",fillRule:"evenodd"},{type:"path",d:"M572 115.2A68 68 0 1 1 708 115.2A68 68 0 1 1 572 115.2ZM600 115.2A40 40 0 1 1 680 115.2A40 40 0 1 1 600 115.2Z",fill:{mix:["frame","#FFFFFF"],amount:.35},fillRule:"evenodd"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:140,y:1400,width:1e3,height:220},collapse:{y:1420,height:160}}]};var nc={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1490},qr:{x:130,y:130,size:1e3,padding:80,radius:20},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"path",d:"M40 0H1220A40 40 0 0 1 1260 40V1215A55 55 0 0 0 1260 1325V1450A40 40 0 0 1 1220 1490H40A40 40 0 0 1 0 1450V1325A55 55 0 0 0 0 1215V40A40 40 0 0 1 40 0Z",fill:"frame"},{type:"line",x1:77,y1:1270,x2:1147,y2:1270,width:12,dash:[30,22],fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:1270,width:1e3,height:220}}]};var wt=(t,e,n,o,r)=>({style:t,name:e,tags:r,labelOn:o,spec:n}),li=[wt("banner-bottom","Banner",si,"frame",["bottom","band"]),wt("banner-top","Top banner",Ql,"frame",["top","band"]),wt("banner-top-bottom","Two banners",Ul,"frame",["top","bottom","band"]),wt("border","Border",Hl,"background",["square","outline"]),wt("rounded-border","Rounded",Yl,"background",["border","outline"]),wt("gradient-border","Gradient",ro,"background",["border","colorful"]),wt("focus","Focus",Vl,"background",["corners","brackets"]),wt("speech-bubble","Bubble",Kl,"frame",["speech"]),wt("speech-bubble-top","Bubble top",Jl,"frame",["speech"]),wt("chat-bubble","Chat",zl,"frame",["message","bubble"]),wt("circle","Circle",ql,"frame",["round","ring","curved"]),wt("badge","Ribbon",Gl,"frame",["badge","banner"]),wt("sticker","Sticker",tc,"frame",["label"]),wt("polaroid","Polaroid",Zl,"frame",["photo","picture"]),wt("phone","Phone",jl,"background",["mobile","screen"]),wt("ticket","Ticket",nc,"frame",["event","pass"]),wt("tag","Tag",ec,"frame",["price","label"]),wt("envelope","Envelope",Wl,"frame",["mail","letter"]),wt("menu-card","Menu card",Xl,"background",["menu","restaurant"])],Of=new Map(li.map(t=>[t.style,t]));function ci(t){return Of.get(t)}var Df=Object.fromEntries(li.map(t=>[t.style,t.spec])),Bf={from:ro.colors.frame,to:ro.colors.accent};function oo(t){return !t||t.style==="none"?null:t.style===tr?t.spec??null:ci(t.style)?.spec??null}function Gf(t){let e=oo(t);return t&&typeof e?.colors?.frame=="string"?no(e,t):null}var Qf={primary:"text",secondary:"secondaryText"};function rc(t,e,n){let o=ci(e.style)?.spec??si;return ur(t,qe(o),e,n,Qf)}var io="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",ac=.08,ic="data-qrdx-frame-label";function Tt(t){return !!(t?.style&&t.style!=="none")}function ui(t){let e=oo(t);return e?ai(e):ac}function Uf(t){return (t.text??$a).trim().slice(0,ie)}function Hf(t){return (t.secondaryText??"").trim().slice(0,ie)}function We(t,e,n){return e.style===tr?ii(t,e,n):rc(t,e,n)}function ue(t,e){if(!Tt(e))return {width:t,height:t};let{width:n,height:o}=We(t,e);return {width:n,height:o}}var nt=t=>K(t,2);function oc({x:t,y:e,width:n,height:o,radius:r}){let a=nt(Math.min(r,n/2,o/2)),[i,l,s,c]=[nt(t),nt(e),nt(n),nt(o)];return a<=0?A`M${i} ${l}h${s}v${c}h${-s}z`:A`M${i+a} ${l}h${nt(s-2*a)}a${a} ${a} 0 0 1 ${a} ${a}`+A`v${nt(c-2*a)}a${a} ${a} 0 0 1 ${-a} ${a}`+A`h${nt(-(s-2*a))}a${a} ${a} 0 0 1 ${-a} ${-a}`+A`v${nt(-(c-2*a))}a${a} ${a} 0 0 1 ${a} ${-a}z`}function ao(t){return t.stroke&&t.strokeWidth?{stroke:t.stroke,strokeWidth:nt(t.strokeWidth)}:{}}function sc(t,e){return t.type==="rect"&&t.hole?P("path",{d:oc(t)+oc(t.hole),fill:t.fill,fillRule:"evenodd",...ao(t)},e):t.type==="polygon"?P("polygon",{fill:t.fill,points:t.points.map(([n,o])=>`${nt(n)},${nt(o)}`).join(" "),...ao(t)},e):t.type==="path"?P("path",{d:t.d,fill:t.fill,...t.fillRule==="evenodd"&&{fillRule:"evenodd"},...ao(t)},e):Dr("rect",{...ao(t),fill:t.fill,height:nt(t.height),key:e,width:nt(t.width),x:nt(t.x),y:nt(t.y),...t.radius>0&&{rx:nt(t.radius),ry:nt(t.radius)}})}function lc(t){return t.shapes.map((e,n)=>sc(e,n))}function mr(t,e){let{size:n,frame:o,bgColor:r,svgProps:a,markLabels:i}=e,l=We(n,o,r),s=cc(l),c=nt(l.width),u=nt(l.height);return xt("svg",{height:u,viewBox:`0 0 ${c} ${u}`,width:c,xmlns:"http://www.w3.org/2000/svg",...a,children:[P("g",{"data-qrdx-frame":o.style,children:l.shapes.map((m,f)=>sc(m,f))}),Ne(t,{x:nt(l.qrX),y:nt(l.qrY),width:n,height:n}),s.map((m,f)=>P("text",{"data-max-width":nt(m.maxWidth),fill:m.color,fontFamily:io,fontSize:nt(m.fontSize),fontWeight:m.fontWeight??700,textAnchor:m.align??"middle",x:nt(m.x),y:nt(m.y),...m.rotate&&{transform:`rotate(${nt(m.rotate)} ${nt(m.x)} ${nt(m.y)})`},...i&&m.field&&{[ic]:m.field},children:m.text},f))]})}function mi(t){let{frame:e,size:n=it,bgColor:o,slot:r,svgProps:a}=t,i=r??P("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg"});return Tt(e)?mr(i,{size:n,frame:e,bgColor:o,svgProps:a}):P("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg",...a,children:Ne(i,{x:0,y:0,width:n,height:n})})}function cc(t){return [...t.label?[t.label]:[],...t.extraLabels??[]]}var so=.22,lo=.14;function uc(t,e,n={}){if(t==="circle")return P("circle",{cx:$(e.x+e.w/2),cy:$(e.y+e.h/2),r:$(Math.min(e.w,e.h)/2),...n});let o=t==="rounded"?Math.min(e.w,e.h)*so:0;return P("rect",{height:$(e.h),width:$(e.w),x:$(e.x),y:$(e.y),...o>0&&{rx:$(o),ry:$(o)},...n})}function zf(t,e){let n=t.w*e,o=t.h*e;return {x:t.x+n,y:t.y+o,w:t.w-2*n,h:t.h-2*o}}function co(t,e){let n=t.shape??"square",o=t.plate,r=o?zf(e,lo):e,a=l=>P("image",{height:$(r.h),href:t.src,preserveAspectRatio:"none",width:$(r.w),x:$(r.x),y:$(r.y),...l&&{clipPath:`url(#${l})`}});if(n==="square"&&!o)return a();let i=n==="square"?void 0:`qrdx-logo-${ze(`${n}|${$(r.x)}|${$(r.y)}|${$(r.w)}|${$(r.h)}`)}`;return xt("g",{children:[o&&uc(n,e,{fill:o}),i&&P("clipPath",{id:i,children:uc(n,r)}),a(i)]})}var{QrCode:di}=mt,qf={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function Wf(t){let e=t*4+17,n=new Uint8Array(e*e),o=(i,l)=>{i>=0&&l>=0&&i<e&&l<e&&(n[l*e+i]=1);};for(let i=0;i<e;i++)o(6,i),o(i,6);for(let[i,l]of [[3,3],[e-4,3],[3,e-4]])for(let s=-4;s<=4;s++)for(let c=-4;c<=4;c++)o(i+c,l+s);let r=[];if(t>1){let i=Math.floor(t/7)+2,l=t===32?26:Math.ceil((t*4+4)/(i*2-2))*2;r.push(6);for(let s=e-7;r.length<i;s-=l)r.splice(1,0,s);}let a=r.length-1;for(let[i,l]of r.entries())for(let[s,c]of r.entries())if(!(i===0&&s===0||i===0&&s===a||i===a&&s===0))for(let u=-2;u<=2;u++)for(let m=-2;m<=2;m++)o(l+m,c+u);for(let i=0;i<=8;i++)o(8,i),o(i,8);for(let i=0;i<8;i++)o(e-1-i,8),o(8,e-1-i);if(t>=7)for(let i=0;i<18;i++){let l=e-11+i%3,s=Math.floor(i/3);o(l,s),o(s,l);}return n}function Vf(t,e){let n=t*4+17,o=$t[e].ordinal,r=di.NUM_ERROR_CORRECTION_BLOCKS[o]?.[t]??0,a=di.ECC_CODEWORDS_PER_BLOCK[o]?.[t]??0,i=Math.floor(di.getNumRawDataModules(t)/8),l=r-i%r,s=Math.floor(i/r),c=Array.from({length:r},(w,C)=>s+(C<l?0:1)),u=[],m=[],f=s-a;for(let w=0;w<=s;w++)for(let C=0;C<r;C++)if(C<l){if(w===f)continue;u.push(C),m.push(w<f?w:w-1);}else u.push(C),m.push(w);if(u.length!==i)throw new Error(`Codeword map: interleave mismatch at version ${t}`);let d=Wf(t),g=new Int16Array(n*n).fill(-1),h=new Int16Array(n*n).fill(-1),p=new Int8Array(n*n).fill(-1),b=i*8,y=0;for(let w=n-1;w>=1;w-=2){w===6&&(w=5);let C=(w+1&2)===0;for(let S=0;S<n;S++)for(let x=0;x<2;x++){let M=w-x,E=(C?n-1-S:S)*n+M;if(!d[E]&&y<b){let v=y>>>3;g[E]=u[v],h[E]=m[v],p[E]=7-(y&7),y++;}}}if(y!==b)throw new Error(`Codeword map: placement mismatch at version ${t}`);let _=qf[`${t}${e}`]??0;return {version:t,level:e,size:n,blocks:r,eccPerBlock:a,blockLengths:c,correctable:Math.floor((a-_)/2),block:g,codeword:h,bit:p}}var Xf=8,Ve=new Map;function dr(t,e){if(!(Number.isInteger(t)&&t>=1&&t<=40))throw new RangeError(`QR version must be 1\u201340, got ${t}`);let n=`${t}${e}`,o=Ve.get(n);if(o)return Ve.delete(n),Ve.set(n,o),o;let r=Vf(t,e);if(Ve.size>=Xf){let a=Ve.keys().next().value;a!==void 0&&Ve.delete(a);}return Ve.set(n,r),r}function fr(t,e){let n=new Array(t.blocks).fill(0),o=new Set;for(let r of e){let a=t.block[r]??-1;if(a<0)continue;let i=a*4096+t.codeword[r];o.has(i)||(o.add(i),n[a]=n[a]+1);}return n}var jf={2:6,3:12};function mc(t){let e=[t.start],n=t.start;for(let o of t.segments){let r=o.at(-1);if(o.length===1)e.push(r);else {let a=jf[o.length];for(let i=1;i<=a;i++){let l=i/a,s=1-l;if(o.length===2){let[c]=o;e.push([s*s*n[0]+2*s*l*c[0]+l*l*r[0],s*s*n[1]+2*s*l*c[1]+l*l*r[1]]);}else {let[c,u]=o;e.push([s*s*s*n[0]+3*s*s*l*c[0]+3*s*l*l*u[0]+l*l*l*r[0],s*s*s*n[1]+3*s*s*l*c[1]+3*s*l*l*u[1]+l*l*l*r[1]]);}}}n=r;}return e}function fc(t,e){let n=[];for(let o of t)for(let r=0;r<o.length;r++){let[a,i]=o[r],[l,s]=o[(r+1)%o.length];i<=e!=s<=e&&n.push(a+(e-i)/(s-i)*(l-a));}return n.sort((o,r)=>o-r)}function hc(t,e){let n=0;for(let o of t)if(o<e)n++;else break;return n%2===1}function Zf(t,e,n){return hc(fc(t,n),e)}function pc(t){let e=new Map;return (n,o)=>{let r=e.get(o);return r||(r=fc(t,o),e.set(o,r)),hc(r,n)}}function Yf(t,e,n,o){let r=n[0]-t,a=n[1]-e,i=o[0]-n[0],l=o[1]-n[1],s=u=>Math.max(Math.abs(r+u*i),Math.abs(a+u*l)),c=Math.min(s(0),s(1));for(let[u,m]of [[a-r,i-l],[-(r+a),i+l]])if(m!==0){let f=u/m;f>0&&f<1&&(c=Math.min(c,s(f)));}return c}function Kf(t,e,n){if(!Zf(t,e,n))return 0;let o=Number.POSITIVE_INFINITY;for(let r of t)for(let a=0;a<r.length;a++)o=Math.min(o,Yf(e,n,r[a],r[(a+1)%r.length]));return Number.isFinite(o)?o:0}function Jf(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let a of t)for(let[i,l]of a)e=Math.min(e,i),n=Math.min(n,l),o=Math.max(o,i),r=Math.max(r,l);return {x0:e,y0:n,x1:o,y1:r}}function gc(t){let e=t.map(mc),n=Jf(e),o=n.x1-n.x0,r=n.y1-n.y0;if(!(o>0&&r>0))return null;let a=(g,h)=>{let p=Math.max(g-n.x0,n.x1-g,h-n.y0,n.y1-h);return p>0?Kf(e,g,h)/(2*p):0},i={cx:n.x0+o/2,cy:n.y0+r/2,value:0};i.value=a(i.cx,i.cy);let l=32;for(let g=1;g<l;g++)for(let h=1;h<l;h++){let p=n.x0+o*h/l,b=n.y0+r*g/l,y=a(p,b);y>i.value&&(i={cx:p,cy:b,value:y});}let s=o/l,c=r/l;for(let g=0;g<6;g++){let h=i;for(let p=-2;p<=2;p++)for(let b=-2;b<=2;b++){let y=h.cx+s*b/2,_=h.cy+c*p/2,w=a(y,_);w>i.value&&(i={cx:y,cy:_,value:w});}s/=2,c/=2;}if(i.value<=0)return null;let m=.5/Math.max(i.cx-n.x0,n.x1-i.cx,i.cy-n.y0,n.y1-i.cy),f=([g,h])=>[.5+(g-i.cx)*m,.5+(h-i.cy)*m],d=t.map(g=>({start:f(g.start),segments:g.segments.map(h=>h.map(f))}));return {rings:d,polygons:d.map(mc),half:i.value}}function bc(t,e){let n=([r,a])=>`${$(r*e)} ${$(a*e)}`,o="";for(let r of t.rings){o+=`M${n(r.start)}`;for(let a of r.segments){let i=a.length===1?"L":a.length===2?"Q":"C";o+=i+a.map(n).join(" ");}o+="Z";}return o}var t1={start:[0,-0.58],segments:[[[.2,-0.92],[1,-0.97],[1,-0.3]],[[1,.3],[.62,.6],[0,.92]],[[-0.62,.6],[-1,.3],[-1,-0.3]],[[-1,-0.97],[-0.2,-0.92],[0,-0.58]]]},dc;function yc(){return dc??=gc([t1]),dc}function e1(t){let{width:e,height:n,cells:o}=t;return Number.isInteger(e)&&Number.isInteger(n)&&e>=ye&&n>=ye&&e<=De&&n<=De&&typeof o=="string"&&o.length===e*n&&/^[01]*$/.test(o)?(r,a)=>r>=0&&a>=0&&r<e&&a<n&&o[a*e+r]==="1":null}var me=([t,e])=>`${t},${e}`;function n1(t,e,n){let o=(s,c)=>t(s-1,c-1),r=new Map,a=(s,c)=>{for(let[u,m]of [[s,c],[c,s]]){let f=r.get(me(u))??[];f.push(m),r.set(me(u),f);}};for(let s=0;s<=n;s++)for(let c=0;c<=e;c++){let u=o(c,s),m=o(c+1,s),f=o(c+1,s+1),d=o(c,s+1),g=[c,s-.5],h=[c+.5,s],p=[c,s+.5],b=[c-.5,s];switch((u?8:0)+(m?4:0)+(f?2:0)+(d?1:0)){case 1:case 14:a(b,p);break;case 2:case 13:a(p,h);break;case 3:case 12:a(b,h);break;case 4:case 11:a(g,h);break;case 6:case 9:a(g,p);break;case 7:case 8:a(b,g);break;case 5:a(g,h),a(b,p);break;case 10:a(b,g),a(p,h);break;}}let i=[],l=new Set;for(let[s,c]of r){if(l.has(s)||c.length===0)continue;let[u,m]=s.split(",").map(Number),f=[[u,m]];l.add(s);let d=[u,m],g=c[0];for(;!l.has(me(g));){l.add(me(g)),f.push(g);let h=r1(r.get(me(g))??[],d,l);if(!h)break;d=g,g=h;}f.length>=3&&i.push(o1(f));}return i}function r1(t,e,n){let o=me(e);return t.find(r=>me(r)!==o&&!n.has(me(r)))??t.find(r=>me(r)!==o)}function o1(t){let e=[];for(let n=0;n<t.length;n++){let o=t[(n-1+t.length)%t.length],r=t[n],a=t[(n+1)%t.length],i=(r[0]-o[0])*(a[1]-r[1])-(r[1]-o[1])*(a[0]-r[0]);Math.abs(i)>1e-9&&e.push(r);}return e.length>=3?e:t}function a1(t){let e=(a,i)=>[(a[0]+i[0])/2,(a[1]+i[1])/2],n=t.length,o=e(t[n-1],t[0]),r=t.map((a,i)=>[a,e(a,t[(i+1)%n])]);return {start:o,segments:r}}var hr=new Map;function fi(t){let e=`${t.width}x${t.height}:${t.cells}`,n=hr.get(e);if(n)return n;let o=e1(t),r;if(!o)r={outline:null,problem:"invalid"};else if(t.cells.includes("1")){let a=n1(o,t.width,t.height),i=a.length>0?gc(a.map(a1)):null;r=i&&2*i.half>=Ea?{outline:i,problem:null}:{outline:null,problem:i?"thin":"empty"};}else r={outline:null,problem:"empty"};return hr.size>16&&hr.delete(hr.keys().next().value),hr.set(e,r),r}var i1=1,_c=.5,xc=.5,s1=.5;function Xe(t){return Math.max(t,Ra)}function uo(t){return t==="heart"?yc():typeof t=="object"&&t?.type==="silhouette"?fi(t).outline:null}function pr(t){return t==="circle"||uo(t)!==null}var l1={invalid:"This silhouette isn't a valid shape grid.",empty:"No shape found: use a picture with a dark or opaque shape on a light or clear background.",thin:"This shape is too thin to hold the code with its quiet zone. Try a rounder, fuller shape."};function c1(t){let{outline:e,problem:n}=fi(t);if(e&&!n)return {ok:true,share:2*e.half};let o=n??"invalid";return {ok:false,reason:o,message:l1[o]}}function Rt(t,e,n){if(n==="circle"){let i=Xe(e),l=(t/2+i)*Math.SQRT2+i1;return Math.ceil(l-t/2)}let o=uo(n);if(!o)return e;let r=Xe(e),a=(t+2*(r+s1))/(2*o.half);return Math.ceil((a-t)/2-1e-9)}function $c(t){let e=t>>>0;return ()=>{e=e+1831565813>>>0;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function u1(t,e,n){let o=Rt(e,n,"circle"),r=Xe(n),a=e+2*o,i=a/2,l=i-_c-.5,s=$c(Number.parseInt(ze(t),36)||1),c=o-r,u=o+e+r;return Array.from({length:a},(m,f)=>Array.from({length:a},(d,g)=>{let h=s()<xc;return g>=c&&g<u&&f>=c&&f<u?false:h&&Math.hypot(g+.5-i,f+.5-i)<=l}))}var m1=Array.from({length:8},(t,e)=>{let n=e*Math.PI/4;return [Math.cos(n),Math.sin(n)]});function Sc(t,e,n,o){if(o==="circle")return u1(t,e,n);let r=uo(o);if(!r)return null;let a=Rt(e,n,o),i=Xe(n),l=e+2*a,s=pc(r.polygons),c=.5+_c,u=(g,h)=>{let p=g+.5,b=h+.5;return s(p/l,b/l)?m1.every(([y,_])=>s((p+y*c)/l,(b+_*c)/l)):false},m=$c(Number.parseInt(ze(t),36)||1),f=a-i,d=a+e+i;return Array.from({length:l},(g,h)=>Array.from({length:l},(p,b)=>{let y=m()<xc;return b>=f&&b<d&&h>=f&&h<d?false:y&&u(b,h)}))}function hi(t,e){if(t==="circle")return {circle:e/2};let n=uo(t);return n?{path:bc(n,e)}:null}function d1(t,e){let n=hi(t,e);return n?"circle"in n?J(e/2,e/2,n.circle):n.path:null}function Lt(t,e="#000000"){return t?typeof t=="string"?{type:"solid",color:t}:t:{type:"solid",color:e}}function je(t){return !t||typeof t=="string"?false:t.type==="linear"||t.type==="radial"||t.type==="angular"}function pi(t){return typeof t=="object"&&t!==null&&t.type==="image"}function f1(t,e="#000000"){let n=Lt(t,e);return n.type==="solid"?n.color:n.type==="image"?n.underlay||e:n.stops[0]?.color||e}function wc(t="center"){let[e,n]=t.split("-");return t==="center"?"center":n?`${n} ${e}`:e==="top"||e==="bottom"?`center ${e}`:`${e} center`}function h1(t){if(!t)return "#000000";if(typeof t=="string")return t;let e=Lt(t);if(e.type==="solid")return e.color;if(e.type==="image"){let r=e.fit==="tile"?`${25*(e.scale??1)}% auto`:(e.scale??1)===1?e.fit==="contain"?"contain":"cover":`${100*(e.scale??1)}% auto`,a=e.fit==="tile"?"repeat":"no-repeat";return `${`url("${e.src.replace(/"/g,"%22")}")`} ${wc(e.position)} / ${r} ${a}, ${e.underlay??"transparent"}`}let o=[...e.stops].sort((r,a)=>r.offset-a.offset).map(r=>`${r.color} ${r.offset}%`).join(", ");return e.type==="linear"?`linear-gradient(${(e.angle??0)+90}deg, ${o})`:e.type==="angular"?`conic-gradient(from ${e.angle??0}deg, ${o})`:`radial-gradient(circle, ${o})`}var kt=t=>t/255,gr=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,tt=t=>.2126*t[0]+.7152*t[1]+.0722*t[2];function gi(t){let{width:e,height:n,data:o}=t,r=[0,e-1,(n-1)*e,n*e-1].map(i=>{let l=i*4;return {color:[kt(o[l]),kt(o[l+1]),kt(o[l+2])],alpha:o[l+3]/255}});if(r.some(i=>i.alpha<.9))return null;let a=r[0].color;return r.every(({color:i})=>gr(i,a)<.006)?a:null}function p1(t){let{width:e,height:n,data:o}=t,r=gi(t),a=new Float32Array(e*n);for(let i=0;i<a.length;i++){let l=i*4,s=o[l+3]/255;if(r&&s>0){let c=Math.sqrt(gr([kt(o[l]),kt(o[l+1]),kt(o[l+2])],r));s*=Math.min(1,Math.max(0,(c-.06)/.1));}a[i]=s;}return a}var g1=8,b1=.14,Cc=.006;function y1(t,e){let{width:n,height:o,data:r}=t,a=new Float64Array(4096),i=new Float64Array(4096*3),l=0;for(let d=0;d<e.length;d++){if(e[d]<.9)continue;let g=d*4,h=Math.floor(r[g]/16)*256+Math.floor(r[g+1]/16)*16+Math.floor(r[g+2]/16);a[h]+=1,i[h*3]+=kt(r[g]),i[h*3+1]+=kt(r[g+1]),i[h*3+2]+=kt(r[g+2]),l++;}if(l===0)return {palette:[],error:0};let s=[...a.keys()].filter(d=>a[d]>0).sort((d,g)=>a[g]-a[d]),c=[];for(let d of s){if(a[d]/l<Cc/2||c.length>=g1)break;let g=[i[d*3]/a[d],i[d*3+1]/a[d],i[d*3+2]/a[d]];c.every(h=>gr(h,g)>=b1**2)&&c.push(g);}let u=[],m=0;for(let d=0;d<3;d++){u=c.map(()=>({n:0,r:0,g:0,b:0,x:0,y:0})),m=0;for(let g=0;g<e.length;g++){if(e[g]<.9)continue;let h=g*4,p=[kt(r[h]),kt(r[h+1]),kt(r[h+2])],b=0,y=Number.POSITIVE_INFINITY;for(let[w,C]of c.entries()){let S=gr(p,C);S<y&&(y=S,b=w);}let _=u[b];_.n++,_.r+=p[0],_.g+=p[1],_.b+=p[2],_.x+=g%n,_.y+=Math.floor(g/n),m+=Math.sqrt(y);}for(let[g,h]of u.entries())h.n>0&&(c[g]=[h.r/h.n,h.g/h.n,h.b/h.n]);}return {palette:c.map((d,g)=>({color:d,area:u[g].n/l,cx:u[g].n?u[g].x/u[g].n+.5:n/2,cy:u[g].n?u[g].y/u[g].n+.5:o/2})).filter(d=>d.area>=Cc).sort((d,g)=>g.area-d.area),error:m/l}}function _1(t,e,n){let o=e+2,r=n+2,a=(m,f)=>m<=0||f<=0||m>e||f>n?0:t[(f-1)*e+(m-1)],i=new Map,l=new Map,s=m=>{let f=l.get(m);if(f)return f;let d=Math.floor(m/2),g=d%o,h=Math.floor(d/o),p=a(g,h),b=m%2===1,y=b?a(g,h+1):a(g+1,h),_=p===y?.5:Math.min(1,Math.max(0,(.5-p)/(y-p))),w=b?[g-.5,h-.5+_]:[g-.5+_,h-.5];return l.set(m,w),w},c=(m,f)=>{i.set(m,f);};for(let m=0;m<r-1;m++)for(let f=0;f<o-1;f++){let d=a(f,m)>=.5,g=a(f+1,m)>=.5,h=a(f+1,m+1)>=.5,p=a(f,m+1)>=.5,b=2*(m*o+f),y=2*((m+1)*o+f),_=2*(m*o+f)+1,w=2*(m*o+f+1)+1;switch((d?8:0)+(g?4:0)+(h?2:0)+(p?1:0)){case 1:c(y,_);break;case 2:c(w,y);break;case 3:c(w,_);break;case 4:c(b,w);break;case 5:{(a(f,m)+a(f+1,m)+a(f+1,m+1)+a(f,m+1))/4>=.5?(c(b,_),c(y,w)):(c(b,w),c(y,_));break}case 6:c(b,y);break;case 7:c(b,_);break;case 8:c(_,b);break;case 9:c(y,b);break;case 10:{(a(f,m)+a(f+1,m)+a(f+1,m+1)+a(f,m+1))/4>=.5?(c(_,y),c(w,b)):(c(_,b),c(w,y));break}case 11:c(w,b);break;case 12:c(_,w);break;case 13:c(y,w);break;case 14:c(_,y);break;}}let u=[];for(let m of i.keys()){if(!i.has(m))continue;let f=[],d=m;for(;d!==void 0&&i.has(d);){f.push(s(d));let g=i.get(d);i.delete(d),d=g;}f.length>=3&&u.push(f);}return u}function x1(t){let e=0;for(let n=0;n<t.length;n++){let o=t[n],r=t[(n+1)%t.length];e+=o[0]*r[1]-r[0]*o[1];}return e/2}function Mc(t,e){if(t.length<=2)return t;let n=new Uint8Array(t.length);n[0]=1,n[t.length-1]=1;let o=[[0,t.length-1]];for(;o.length>0;){let[r,a]=o.pop(),i=t[r],l=t[a],s=l[0]-i[0],c=l[1]-i[1],u=Math.hypot(s,c)||1,m=-1,f=e;for(let d=r+1;d<a;d++){let g=t[d],h=Math.abs(c*(g[0]-i[0])-s*(g[1]-i[1]))/u;h>f&&(f=h,m=d);}m>=0&&(n[m]=1,o.push([r,m],[m,a]));}return t.filter((r,a)=>n[a]===1)}function $1(t,e){let n=0,o=-1;for(let[i,l]of t.entries()){let s=(l[0]-t[0][0])**2+(l[1]-t[0][1])**2;s>o&&(o=s,n=i);}let r=Mc(t.slice(0,n+1),e),a=Mc([...t.slice(n),t[0]],e);return [...r.slice(0,-1),...a.slice(0,-1)]}var Ce=t=>K(t,2);function S1(t,e){let n=t.length,o=(a,i)=>{let l=Math.hypot(i[0]-a[0],i[1]-a[1])||1,s=Math.min(.5,e/l);return [a[0]+(i[0]-a[0])*s,a[1]+(i[1]-a[1])*s]},r="";for(let a=0;a<n;a++){let i=t[a],l=o(i,t[(a-1+n)%n]),s=o(i,t[(a+1)%n]);r+=a===0?`M${Ce(l[0])} ${Ce(l[1])}`:`L${Ce(l[0])} ${Ce(l[1])}`,r+=`Q${Ce(i[0])} ${Ce(i[1])} ${Ce(s[0])} ${Ce(s[1])}`;}return `${r}Z`}function w1(t,e,n){let o="";for(let r of _1(t,e,n)){if(Math.abs(x1(r))<.8)continue;let a=$1(r,.18);a.length>=3&&(o+=S1(a,.9));}return o}var C1=.075;function Rc(t){let{width:e,height:n,data:o}=t,r=p1(t),a=0;for(let h of r)a+=h;let{palette:i,error:l}=y1(t,r),s={width:e,height:n,palette:i,alpha:r,coverage:a/(e*n)};if(i.length===0||l>C1)return {...s,layers:[],photographic:i.length>0};let c=i.length,u=Array.from({length:c},()=>new Float32Array(e*n)),m=i.map(h=>h.color);for(let h=0;h<r.length;h++){let p=r[h];if(p<=0)continue;let b=h*4,y=[kt(o[b]),kt(o[b+1]),kt(o[b+2])],_=0,w=-1,C=Number.POSITIVE_INFINITY,S=Number.POSITIVE_INFINITY;for(let v=0;v<c;v++){let I=gr(y,m[v]);I<C?(w=_,S=C,_=v,C=I):I<S&&(w=v,S=I);}if(w<0||C<1e-6){u[_][h]=p;continue}let x=m[_],M=m[w],R=[M[0]-x[0],M[1]-x[1],M[2]-x[2]],E=Math.min(1,Math.max(0,((y[0]-x[0])*R[0]+(y[1]-x[1])*R[1]+(y[2]-x[2])*R[2])/(R[0]**2+R[1]**2+R[2]**2)));u[_][h]=p*(1-E),u[w][h]=p*E;}let f=[],d=new Float32Array(e*n),g=new Array(c);for(let h=c-1;h>=0;h--){let p=u[h];for(let b=0;b<d.length;b++)d[b]+=p[b];g[h]=d.slice();}for(let h=0;h<c;h++){let p=w1(g[h],e,n);p&&f.push({color:m[h],d:p});}return {...s,layers:f,photographic:false}}var Lc=.6,_i={logo:160,halftone:160};function M1(t){let e="";for(let o=0;o<t.length;o+=32768)e+=String.fromCharCode(...t.subarray(o,o+32768));return btoa(e)}var kn=class{entries=new Map;limit;constructor(e){this.limit=e;}get(e,n){let o=this.entries.get(e);if(o!==void 0)return this.entries.delete(e),this.entries.set(e,o),o;let r=n();if(this.entries.size>=this.limit){let a=this.entries.keys().next().value;a!==void 0&&this.entries.delete(a);}return this.entries.set(e,r),r}},R1=new kn(8);function E1(t){return R1.get(t,()=>{let e=atob(t),n=new Uint8Array(e.length);for(let o=0;o<e.length;o++)n[o]=e.charCodeAt(o);return n})}function xi(t){let{width:e,height:n,data:o}=t;if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>jn||n>jn||typeof o!="string")return null;try{let r=E1(o);return r.length===e*n*4?{width:e,height:n,data:r}:null}catch{return null}}function kc(t,e={}){let{width:n,height:o,data:r}=t;if(!(n>0&&o>0)||r.length<n*o*4)throw new Error("Art image pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=Math.min(n,o),i=e.square?Math.floor((n-a)/2):0,l=e.square?Math.floor((o-a)/2):0,s=e.square?a:n,c=e.square?a:o,u=Math.min(Math.max(Math.round(e.maxSize??_i.halftone),1),jn),m=Math.min(1,u/Math.max(s,c)),f=Math.max(1,Math.round(s*m)),d=Math.max(1,Math.round(c*m)),g=new Uint8Array(f*d*4);for(let h=0;h<d;h++){let p=Math.floor(h*c/d),b=Math.max(p+1,Math.floor((h+1)*c/d));for(let y=0;y<f;y++){let _=Math.floor(y*s/f),w=Math.max(_+1,Math.floor((y+1)*s/f)),C=0,S=0,x=0,M=0,R=0;for(let v=p;v<b;v++)for(let I=_;I<w;I++){let L=((v+l)*n+I+i)*4,T=r[L+3]/255;C+=r[L]*T,S+=r[L+1]*T,x+=r[L+2]*T,M+=T,R++;}let E=(h*f+y)*4;g[E]=M>0?Math.round(C/M):0,g[E+1]=M>0?Math.round(S/M):0,g[E+2]=M>0?Math.round(x/M):0,g[E+3]=Math.round(M/R*255);}}return {width:f,height:d,data:M1(g)}}async function A1(t){if(typeof t!="string"&&!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=typeof t=="string"?t:URL.createObjectURL(t);try{return await new Promise((n,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>n(r),r.onerror=()=>o(new Error("Could not load the art image")),r.src=e;})}finally{typeof t!="string"&&setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function P1(t,e={}){if(typeof document>"u")throw new Error("loadQRArtImage needs a browser; pass decoded pixels to createQRArtImage instead");let n=e.mode??"halftone",o=e.maxSize??_i[n],r=await A1(t),a=r.naturalWidth||r.width||o,i=r.naturalHeight||r.height||o,l=n==="halftone",s=Math.min(1,o*4/(l?Math.min(a,i):Math.max(a,i))),c=Math.max(1,Math.round(a*s)),u=Math.max(1,Math.round(i*s)),m=document.createElement("canvas");m.width=c,m.height=u;let f=m.getContext("2d",{willReadFrequently:true});if(!f)throw new Error("Could not get a canvas context");f.imageSmoothingQuality="high",f.drawImage(r,0,0,c,u);let d;try{d=f.getImageData(0,0,c,u);}catch{throw new Error("Could not read the art image (cross-origin images need CORS); upload it instead")}finally{m.remove();}return kc(d,{maxSize:o,square:l})}function $i(t){return !!(t&&Gr.includes(t.mode)&&t.image&&xi(t.image))}function ho(t){let e=xa[t.mode];return t.variant&&e.includes(t.variant)?t.variant:e[0]}function v1(t,e){if(t===1)return [];let n=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(n*2-2))*2,r=[6];for(let a=e-7;r.length<n;a-=o)r.splice(1,0,a);return r}function br(t,e){let n=v1(t,e),o=n.length-1,r=[];for(let[a,i]of n.entries())for(let[l,s]of n.entries())a===0&&l===0||a===0&&l===o||a===o&&l===0||r.push([i,s]);return r}var I1=0,qt=1,Vt=2,Me=3,Ec=4,Ac=new Map;function Fc(t){let e=Ac.get(t);if(e)return e;let n=t*4+17,o=new Uint8Array(n*n),r=(a,i,l,s,c)=>{for(let u=Math.max(0,i);u<Math.min(n,i+s);u++)for(let m=Math.max(0,a);m<Math.min(n,a+l);m++)o[u*n+m]=c;};r(6,0,1,n,Ec),r(0,6,n,1,Ec),r(0,8,9,1,Me),r(8,0,1,9,Me),r(n-8,8,8,1,Me),r(8,n-8,1,8,Me),t>=7&&(r(n-11,0,3,6,Me),r(0,n-11,6,3,Me));for(let[a,i]of br(t,n))r(a-2,i-2,5,5,Vt);return r(0,0,8,8,qt),r(n-8,0,8,8,qt),r(0,n-8,8,8,qt),Ac.set(t,o),o}function L1(t){let e=t*4+17,n=Fc(t);return Array.from({length:e},(o,r)=>Array.from({length:e},(a,i)=>n[r*e+i]!==I1))}function k1(t){let e=t[8],n=e?.[0]?1:0,o=e?.[1]?1:0,r=(1-n)*2+o;return ["M","L","H","Q"][r]??"M"}function Fn(t,e){let n=lt(t);return !n||n.a===0?e:[n.r/255,n.g/255,n.b/255]}var Ye=(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n];function Re(t,e,n,o){let r=tt(t);if(o?r<=n:r>=n)return t;let a=tt(e);return Math.abs(r-a)<1e-6?e:Ye(t,e,Math.min(1,Math.max(0,(r-n)/(r-a))))}var Tc=t=>Math.max(...t)-Math.min(...t),F1=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,bi=t=>t.toString(16).padStart(2,"0");function Ft(t,e=1){let n=o=>Math.min(255,Math.round(Math.round(Math.min(Math.max(o,0),1)*255)/e)*e);return `#${bi(n(t[0]))}${bi(n(t[1]))}${bi(n(t[2]))}`}function T1(t){let e=t<0?-1:1,n=Math.abs(t),o=1/(1+.3275911*n),r=1-((((1.061405429*o-1.453152027)*o+1.421413741)*o-.284496736)*o+.254829592)*o*Math.exp(-n*n);return e*r}var Si=.3,Pc=t=>1-Math.exp(-((t/2)**2)/(2*Si**2)),N1=t=>T1(t/(2*Si*Math.SQRT2))**2,O1=(t,e,n)=>{let o=Math.min(1,Math.max(0,(n-t)/(e-t)));return o*o*(3-2*o)};function wi(t,e,n,o){let r=o==="cover"?Math.max(n/t,n/e):Math.min(n/t,n/e);return {scale:r,offsetX:(n-t*r)/2,offsetY:(n-e*r)/2}}function Nc(t,e){let{width:n,height:o,data:r}=t,a=new Float32Array(n*o*3),i=e??new Float32Array(n*o);for(let l=0;l<n*o;l++)a[l*3]=r[l*4]/255,a[l*3+1]=r[l*4+1]/255,a[l*3+2]=r[l*4+2]/255,e||(i[l]=r[l*4+3]/255);return {width:n,height:o,rgb:a,alpha:i}}function D1(t){let e=Nc(t),{rgb:n,alpha:o}=e,r=new Float64Array(256),a=0;for(let m=0;m<o.length;m++){if(o[m]<.5)continue;let f=tt([n[m*3],n[m*3+1],n[m*3+2]]);r[Math.min(255,Math.floor(f*256))]+=1,a++;}let i=m=>{let f=0;for(let d=0;d<256;d++)if(f+=r[d],f>=m*a)return d/255;return 1},l=a?i(.01):0,s=a?i(.99):1;s-l<.15&&(l=0,s=1);let c=Math.min(1.6,1/(s-l)),u=(l+s)/2;for(let m=0;m<o.length;m++){let f=[n[m*3],n[m*3+1],n[m*3+2]],d=tt(f),g=.5+(d-u)*c;for(let h=0;h<3;h++)n[m*3+h]=Math.min(1,Math.max(0,g+(f[h]-d)*1.12));}return e}function Oc(t,e,n,o,r=1){let{width:a,height:i,rgb:l,alpha:s}=t,c=Math.min(Math.max(e-.5,0),a-1),u=Math.min(Math.max(n-.5,0),i-1),m=Math.floor(c),f=Math.floor(u),d=Math.min(m+1,a-1),g=Math.min(f+1,i-1),h=c-m,p=u-f,b=0,y=0,_=0,w=0,C=(x,M,R)=>{let E=M*a+x,v=s[E]*R;b+=l[E*3]*v,y+=l[E*3+1]*v,_+=l[E*3+2]*v,w+=v;};if(C(m,f,(1-h)*(1-p)),C(d,f,h*(1-p)),C(m,g,(1-h)*p),C(d,g,h*p),w<=0)return o;let S=w*r;return [o[0]+(b/w-o[0])*S,o[1]+(y/w-o[1])*S,o[2]+(_/w-o[2])*S]}var B1=new kn(4),G1=new kn(6),Q1=new kn(6);function Ci(t,e){return G1.get(t.image.data,()=>Rc(e))}function Dc(t,e,n){return Q1.get(t.image.data,()=>Nc(e,n.alpha))}var Ct=t=>K(t,2),Bc=t=>K(t,4),Ke=class{groups=new Map;add(e,n){let o=this.groups.get(e);o?o.push(n):this.groups.set(e,[n]);}cellRun(e,n,o,r){this.add(e,`M${n} ${o}h${r}.04v1.04h-${r}.04z`);}circle(e,n,o,r){this.add(e,U1(n,o,r));}toElements(e){return [...this.groups].map(([n,o],r)=>P("path",{d:o.join(""),fill:n},`${e}-${r}`))}};function U1(t,e,n){let o=Ct(n*2),r=Ct(n);return `M${Ct(t-n)} ${Ct(e)}a${r} ${r} 0 1 0 ${o} 0a${r} ${r} 0 1 0 ${-o} 0z`}function Ze(t,e,n,o,r){let a=Math.min(r,n/2,o/2);if(a<=0)return `M${Ct(t)} ${Ct(e)}h${Ct(n)}v${Ct(o)}h${Ct(-n)}z`;let i=Ct(a);return `M${Ct(t+a)} ${Ct(e)}h${Ct(n-2*a)}a${i} ${i} 0 0 1 ${i} ${i}v${Ct(o-2*a)}a${i} ${i} 0 0 1 ${-i} ${i}h${Ct(-(n-2*a))}a${i} ${i} 0 0 1 ${-i} ${-i}v${Ct(-(o-2*a))}a${i} ${i} 0 0 1 ${i} ${-i}z`}function Gc(t,e,n){let o="";for(let[r,a]of t){let i=(r-2+e)*n,l=(a-2+e)*n;o+=Ze(i,l,5*n,5*n,n*.35),o+=Ze(i+n,l+n,3*n,3*n,n*.15),o+=Ze(i+2*n,l+2*n,n,n,n*.12);}return o}var H1={blend:1,badge:1,color:.9,mono:.7},fo=.35;function z1(t,e){let n=Fn(t,[0,0,0]),o=Fn(e,[1,1,1]),r=tt(o)-tt(n);return r>=fo?null:r<=-fo?"inverted":"low-contrast"}function Qc(t,e,n){let o=Math.min(Math.max(t.intensity??Lc,0),H1[ho(t)]);return tt(n)-tt(e)>=fo?o:0}function q1(t){let{art:e,modules:n,version:o}=t,r=e.image&&xi(e.image);if(!(r&&Gr.includes(e.mode)))return null;let a=n.length;if(a!==o*4+17)return null;let i=Fn(t.fgColor,[0,0,0]),l=Fn(t.bgColor,[1,1,1]),s=Qc(e,i,l);return s<=0?null:{art:e,image:r,modules:n,size:a,version:o,kinds:Fc(o),margin:t.margin,pixelSize:t.pixelSize,t:s,fg:i,bg:l,variant:ho(e),body:t.body}}function Mi(t){let e=q1(t);if(!e)return null;let n;return e.art.mode==="halftone"?n=e.variant==="mono"?Y1(e):Z1(e):n=e.variant==="badge"?ih(e):K1(e),P("g",{"data-qrdx-art":e.art.mode,"data-qrdx-art-variant":e.variant,children:n})}function W1(t,e){return {margin:.42-.17*t+(e===3?.04:0),darkCap:.4+.3*t}}var Uc=8.5,vc=new Map;function Ri(t){let e=t*4+17,n=vc.get(t);if(!n){let a=e*2,i=new Uint8Array(a*a),l=Uc*2;for(let s=0;s<a;s++)for(let c=0;c<a;c++){let u=c<l||c>=a-l,m=s<l||s>=a-l;u&&m&&!(c>=a-l&&s>=a-l)&&(i[s*a+c]=1);}for(let[s,c]of br(t,e))for(let u=(c-2)*2-1;u<(c+3)*2+1;u++)for(let m=(s-2)*2-1;m<(s+3)*2+1;m++)m>=0&&u>=0&&m<a&&u<a&&(i[u*a+m]=1);vc.set(t,i),n=i;}let o=n,r=e*2;return (a,i)=>{let l=Math.floor(a*2),s=Math.floor(i*2);return l>=0&&s>=0&&l<r&&s<r&&o[s*r+l]===1}}function Hc(t,e,n=false){let{image:o,size:r,kinds:a,fg:i,bg:l}=t,s=B1.get(t.art.image.data,()=>D1(o)),c=wi(o.width,o.height,r,"cover"),u=r*e,m=new Float32Array(u*u*3).fill(Number.NaN),d=1/(e*c.scale)>1.3?2:1,g=tt(l)-.1*(tt(l)-tt(i)),h=Ri(t.version);for(let p=0;p<r;p++)for(let b=0;b<r;b++){let y=a[p*r+b],_=y===qt||y===Vt;if(!(_&&!n))for(let w=0;w<e;w++)for(let C=0;C<e;C++){let S=0,x=0,M=0;for(let F=0;F<d;F++)for(let k=0;k<d;k++){let q=b+(C+(k+.5)/d)/e,H=p+(w+(F+.5)/d)/e,G=Oc(s,(q-c.offsetX)/c.scale,(H-c.offsetY)/c.scale,l);S+=G[0],x+=G[1],M+=G[2];}let R=d*d,E=[S/R,x/R,M/R],v=b+(C+.5)/e,I=p+(w+.5)/e,L=Math.min(v,I,r-v,r-I);L<1.5&&(E=Ye(E,l,.35*(1-L/1.5))),n&&(_||h(v,I))&&(E=Re(E,l,g,false));let T=((p*e+w)*u+b*e+C)*3;m[T]=E[0],m[T+1]=E[1],m[T+2]=E[2];}}return {n:e,count:u,rgb:m}}function V1(t,e,n){let{size:o,kinds:r,modules:a,fg:i,bg:l,t:s}=t,{n:c,count:u,rgb:m}=e,f=tt(i),d=tt(l),g=d-f,h=W1(s,c),p=M=>.2126*m[M]+.7152*m[M+1]+.0722*m[M+2],b=new Float32Array(o*o),y=new Float32Array(o*o);for(let M=0;M<o;M++)for(let R=0;R<o;R++){let E=r[M*o+R];if(E===qt){b[M*o+R]=d;continue}if(E===Vt){b[M*o+R]=a[M]?.[R]?f:d;continue}let v=0,I=0,L=0;for(let T=0;T<c;T++)for(let F=0;F<c;F++){let k=p(((M*c+T)*u+R*c+F)*3);v+=k,n.under[T*c+F]||(I+=k,L++);}b[M*o+R]=v/(c*c),y[M*o+R]=L?I/L:v/(c*c);}let _=o+1,w=new Float64Array(_*_);for(let M=0;M<o;M++)for(let R=0;R<o;R++)w[(M+1)*_+R+1]=b[M*o+R]+w[M*_+R+1]+w[(M+1)*_+R]-w[M*_+R];let C=2,S=(M,R)=>{let E=Math.max(0,M-C),v=Math.max(0,R-C),I=Math.min(o,M+C+1),L=Math.min(o,R+C+1);return (w[L*_+I]-w[v*_+I]-w[L*_+E]+w[v*_+E])/((I-E)*(L-v))},x=n.weight;for(let M=0;M<o;M++)for(let R=0;R<o;R++){let E=r[M*o+R];if(E===qt||E===Vt)continue;let v=E===Me,I=(h.margin+(v?.08:0))*g,L=(h.darkCap-(v?.12:0))*g,T=(x*((n.light-n.dark)/2)-I)/(1-x),F=S(R,M),k=y[M*o+R],q=!!a[M]?.[R],H=0,G=l;if(q){let U=Math.min(F+T,f+L);k>U&&(H=(k-U)/Math.max(k-f,1e-6),G=i);}else {let U=Math.max(F-T,d-L);k<U&&(H=(U-k)/Math.max(d-k,1e-6));}if(!(H<=0)){H=Math.min(1,H);for(let U=0;U<c;U++)for(let Z=0;Z<c;Z++){let rt=((M*c+U)*u+R*c+Z)*3;for(let W=0;W<3;W++)m[rt+W]+=(G[W]-m[rt+W])*H;}}}}function zc(t,e,n,o){let{count:r}=e,a=new Ke;for(let s=0;s<r;s++){let c=0,u=n(s*r);for(let m=1;m<=r;m++){let f=m<r?n(s*r+m):null;(m===r||f!==u)&&(u&&a.cellRun(u,c,s,m-c),c=m,u=f);}}let i=t.pixelSize/e.n,l=Ct(t.margin*t.pixelSize);return P("g",{transform:`translate(${l} ${l}) scale(${Bc(i)})`,children:a.toElements(o)},o)}function Ei(t,e){let n=br(t.version,t.size);return n.length===0?[]:[P("path",{d:Gc(n,t.margin,t.pixelSize),fill:e,fillRule:"evenodd"},"art-alignment")]}function qc(t){let{image:e,size:n}=t;return Math.floor(Math.min(e.width,e.height)/n)>=4&&n<=45?4:3}var X1=t=>2*Si*Math.sqrt(-2*Math.log(1-Math.min(t,.95)));function j1(t,e,n){let o=e+1,r=new Float64Array(o*o);for(let i=0;i<e;i++)for(let l=0;l<e;l++)r[(i+1)*o+l+1]=t[i*e+l]+r[i*o+l+1]+r[(i+1)*o+l]-r[i*o+l];let a=new Float32Array(e*e);for(let i=0;i<e;i++)for(let l=0;l<e;l++){let s=Math.max(0,l-n),c=Math.max(0,i-n),u=Math.min(e,l+n+1),m=Math.min(e,i+n+1);a[i*e+l]=(r[m*o+u]-r[c*o+u]-r[m*o+s]+r[c*o+s])/((u-s)*(m-c));}return a}function Wc(t,e,n,o){let{size:r,kinds:a,modules:i,fg:l,bg:s}=t,c=tt(l),u=tt(s),m=u-c,f=j1(e,r,2),d=new Float32Array(r*r),g=new Float32Array(r*r).fill(Number.NaN);for(let h=0;h<r;h++)for(let p=0;p<r;p++){let b=h*r+p,y=a[b];if(y===qt||y===Vt)continue;let _=y===Me,w=o.base+(_?.08:0),C=(o.margin+(_?.03:0))*m,S=(o.cap-(_?.04:0))*m,x=Pc(w),M=Pc(_?Math.max(o.max,.94):o.max),R=x*((o.dark+o.light)/2)+(1-x)*f[b],E=n[b],v=!!i[h]?.[p],I=v?o.dark:o.light,L=v?Math.min(R-C,c+S):Math.max(R+C,u-S),F=(v?E<=L:E>=L)?0:(E-L)/(E-I);F>M&&(F=M,g[b]=Math.min(u,Math.max(c,(L-M*I)/(1-M))));let k=v?E<=L-.06:E>=L+.06;o.skip&&k&&!_||(F=Math.max(F,x)),d[b]=F>0?X1(F):0;}return {diameter:d,surround:g}}function Z1(t){let{size:e,kinds:n,modules:o,fg:r,bg:a,t:i,margin:l,pixelSize:s}=t,c=qc(t),u=Hc(t,c,true),m=tt(r),f=tt(a),d=m+.1*(f-m),g=f-.05*(f-m),{count:h,rgb:p}=u,b=(S,x,M,R)=>((x*c+R)*h+S*c+M)*3,y=new Float32Array(e*e);for(let S=0;S<e;S++)for(let x=0;x<e;x++){let M=n[S*e+x];if(M===qt||M===Vt){y[S*e+x]=M===Vt&&o[S]?.[x]?m:f;continue}let R=0;for(let E=0;E<c;E++)for(let v=0;v<c;v++){let I=b(x,S,v,E);R+=.2126*p[I]+.7152*p[I+1]+.0722*p[I+2];}y[S*e+x]=R/(c*c);}let _=Wc(t,y,y,{base:.6-.28*i,max:.86,dark:d,light:g,margin:.2-.1*i,cap:.4+.14*i,skip:false});for(let S=0;S<e;S++)for(let x=0;x<e;x++){let M=_.surround[S*e+x];if(Number.isNaN(M))continue;let R=y[S*e+x],v=M<R?r:a,I=Math.min(1,Math.abs(R-M)/Math.max(Math.abs(R-tt(v)),1e-6));for(let L=0;L<c;L++)for(let T=0;T<c;T++){let F=b(x,S,T,L);for(let k=0;k<3;k++)p[F+k]+=(v[k]-p[F+k])*I;}}let w=[zc(t,u,S=>{let x=S*3;return Number.isNaN(p[x])?null:Ft([p[x],p[x+1],p[x+2]],8)},"art-photo")],C=new Ke;for(let S=0;S<e;S++)for(let x=0;x<e;x++){let M=_.diameter[S*e+x];if(!(M>0))continue;let R=0,E=0,v=0;for(let T=0;T<c;T++)for(let F=0;F<c;F++){let k=b(x,S,F,T);R+=p[k],E+=p[k+1],v+=p[k+2];}let I=[R/(c*c),E/(c*c),v/(c*c)],L=o[S]?.[x]?Re(I,r,d,true):Re(I,a,g,false);C.circle(Ft(L,10),(x+l+.5)*s,(S+l+.5)*s,M/2*s);}return w.push(...C.toElements("art-dot"),...Ei(t,Ft(r))),w}function Y1(t){let{size:e,kinds:n,modules:o,fg:r,bg:a}=t,i=qc(t),l=Hc(t,i),s=tt(r),c=tt(a),u=i%2===1?1:2,m=(i-u)/2,f=R=>R>=m&&R<m+u,d=[];for(let R=0;R<i;R++)for(let E=0;E<i;E++)d.push(f(E)&&f(R));V1(t,l,{weight:N1(u/i),dark:s,light:c,under:d});let{count:g,rgb:h}=l,p=new Float32Array(g*g),b=new Int8Array(g*g).fill(-1);for(let R=0;R<g*g;R++){let E=R*3;if(Number.isNaN(h[E])){p[R]=Number.NaN;continue}let v=(.2126*h[E]+.7152*h[E+1]+.0722*h[E+2]-s)/(c-s);p[R]=.5+(O1(0,1,v)-.5)*1.15;}for(let R=0;R<e;R++)for(let E=0;E<e;E++){let v=n[R*e+E];if(!(v===qt||v===Vt))for(let I=m;I<m+u;I++)for(let L=m;L<m+u;L++)b[(R*i+I)*g+E*i+L]=o[R]?.[E]?0:1;}let y=Ri(t.version);for(let R=0;R<g;R++)for(let E=0;E<g;E++){let v=R*g+E;b[v]<0&&y((E+.5)/i,(R+.5)/i)&&(b[v]=1);}let _=new Uint8Array(g*g),w=.3,C=0,S=0,x=(R,E,v)=>{if(R<0||R>=g||E>=g)return;let I=E*g+R;if(!Number.isNaN(p[I])){let L=Math.floor(R/i)===Math.floor(C/i)&&Math.floor(E/i)===Math.floor(S/i);p[I]+=L?v:v*w;}};for(let R=0;R<g;R++){let E=R%2===0?1:-1;for(let v=0;v<g;v++){let I=E===1?v:g-1-v,L=R*g+I,T=p[L];if(Number.isNaN(T))continue;let F=b[L]>=0?b[L]:T>=.5?1:0;_[L]=F===0?1:0;let k=Math.min(.75,Math.max(-0.75,T-F));C=I,S=R,x(I+E,R,k*7/16),x(I-E,R+1,k*3/16),x(I,R+1,k*5/16),x(I+E,R+1,k/16);}}let M=Ft(r);return [zc(t,l,R=>_[R]?M:null,"art-halftone"),...Ei(t,M)]}function Ic(t,e){let n=null,o=0;for(let r of t.palette){if(e&&F1(r.color,e)<.02)continue;let a=r.area*(.35+Tc(r.color))*(tt(r.color)>.86?.05:1);a>o&&(o=a,n=r.color);}return n}function Vc(t,e,n,o,r){let a;if(t.photographic){let i=new Ke,{width:l,height:s,rgb:c,alpha:u}=e;for(let m=0;m<s;m++){let f=0,d=null;for(let g=0;g<=l;g++){let h=m*l+g,p=g<l&&u[h]>=.5?Ft(o([c[h*3],c[h*3+1],c[h*3+2]]),6):null;(g===l||p!==d)&&(d&&i.cellRun(d,f,m,g-f),f=g,d=p);}}a=i.toElements(`${r}-px`);}else a=t.layers.map((i,l)=>P("path",{d:i.d,fill:Ft(o(i.color)),fillRule:"evenodd"},`${r}-${l}`));return P("g",{transform:`translate(${Ct(n.x)} ${Ct(n.y)}) scale(${Bc(n.scale)})`,children:a},r)}function K1(t){let{art:e,image:n,size:o,kinds:r,modules:a,fg:i,bg:l,t:s,margin:c,pixelSize:u}=t,m=Ci(e,n),f=Dc(e,n,m),d=wi(m.width,m.height,o,"contain"),g=Math.min(1,.3+1.4*s),h=k=>Ye(l,k,g),p=Ft(l),b=Ft(i),y=[Vc(m,f,{x:(c+d.offsetX)*u,y:(c+d.offsetY)*u,scale:d.scale*u},h,"art-logo")],_=Uc,w=(k,q)=>Ze((k+c)*u,(q+c)*u,(_+.4)*u,(_+.4)*u,1.2*u),C=br(t.version,o).map(([k,q])=>Ze((k-2.5+c)*u,(q-2.5+c)*u,6*u,6*u,u*.8)).join("");y.push(P("path",{d:w(-0.4,-0.4)+w(o-_,-0.4)+w(-0.4,o-_)+C,fill:p},"art-plates"));let S=Ri(t.version),x=tt(l),M=tt(i),R=new Float32Array(o*o),E=new Float32Array(o*o),v=new Array(o*o);for(let k=0;k<o;k++)for(let q=0;q<o;q++){let H=k*o+q,G=r[H];if(G===qt||G===Vt){R[H]=G===Vt&&a[k]?.[q]?M:x;continue}let U=1,Z=0,rt=0,W=0,O=0;for(let N=0;N<4;N++)for(let _t=0;_t<4;_t++){let At=q+(_t+.5)/4,Fe=k+(N+.5)/4,Gt=S(At,Fe)?l:Oc(f,(At-d.offsetX)/d.scale,(Fe-d.offsetY)/d.scale,l,g),Dt=tt(Gt);U=Math.min(U,Dt),Z+=Dt,rt+=Gt[0],W+=Gt[1],O+=Gt[2];}R[H]=Z/16,E[H]=U,v[H]=[rt/16,W/16,O/16];}let I=M+.08*(x-M),L=x-.04*(x-M),T=Wc(t,R,R,{base:.74-.26*s,max:.9,dark:I,light:L,margin:.23-.1*s,cap:.4+.1*s,skip:s>=.7}),F=new Ke;for(let k=0;k<o;k++)for(let q=0;q<o;q++){let H=k*o+q,G=T.diameter[H],U=!!a[k]?.[q];if(!(G>0)||!U&&E[H]>=x-.02)continue;let Z=U?Re(v[H],i,I,true):Re(v[H],l,L,false);F.circle(Ft(Z,8),(q+c+.5)*u,(k+c+.5)*u,G/2*u);}return y.push(...F.toElements("art-dot")),y.push(...Ei(t,b)),y}var J1={L:.5,M:.72,Q:.88,H:1},Xc=.32,jc=.55,th=.6,eh=2;function Zc(t,e,n){let o=e>=1?t:t*e,r=e>=1?t/e:t,a=Math.max(.7,t*.09),i=o+2*a,l=r+2*a;return {logoW:o,logoH:r,plateW:i,plateH:l,radius:Math.min(i,l)*.26,cx:n/2,cy:n/2}}var Yc=t=>({cx:t.cx,cy:t.cy,w:t.plateW,h:t.plateH,r:t.radius});function Kc(t,e,n){return tu(e+.5,n+.5,t)<jc}function nh(t,e){let n=Yc(t),o=jc+1,r=Math.max(0,Math.floor(t.cx-t.plateW/2-o)),a=Math.min(e-1,Math.ceil(t.cx+t.plateW/2+o)),i=Math.max(0,Math.floor(t.cy-t.plateH/2-o)),l=Math.min(e-1,Math.ceil(t.cy+t.plateH/2+o)),s=[];for(let c=i;c<=l;c++)for(let u=r;u<=a;u++)Kc(n,u,c)&&s.push(c*e+u);return s}var rh=t=>Math.floor(t.correctable*th);function yi(t,e,n){let o=Zc(t,e,n.size),r=rh(n);return fr(n,nh(o,n.size)).every(a=>a<=r)}function Jc(t,e,n){if(yi(n,e,t))return n;let o=0,r=n;if(!yi(o,e,t))return -1;for(;r-o>1/64;){let a=(o+r)/2;yi(a,e,t)?o=a:r=a;}return o}var mo=new Map;function oh(t,e){let n=`${t.version}${t.level}:${e.toFixed(3)}`,o=mo.get(n);return o===void 0&&(o=Jc(t,e,Xc*t.size),mo.size>=64&&mo.clear(),mo.set(n,o)),o}function ah(t,e){let{size:n,t:o,modules:r,version:a}=t,i=k1(r),l=(.18+.15*o)*J1[i],s=e.width/e.height,c=Math.min(Xc,l)*n,u=dr(a,i),m=Math.max(0,oh(u,s));if(m<eh)return {wantedBox:c,maxBox:m,box:0,plate:null};let f=Jc(u,s,Math.min(c,m));return f<0?{wantedBox:c,maxBox:m,box:0,plate:null}:{wantedBox:c,maxBox:m,box:f,plate:Zc(f,s,n)}}function tu(t,e,n){let o=Math.abs(t-n.cx)-(n.w/2-n.r),r=Math.abs(e-n.cy)-(n.h/2-n.r);return Math.hypot(Math.max(o,0),Math.max(r,0))+Math.min(Math.max(o,r),0)-n.r}function eu(t,e){let{fg:n,bg:o,t:r}=t,a=tt(n),i=tt(o),l=Ic(e),s=Math.min(1,r/.6),c=l?Re(l,n,a+.3*(i-a),true):n,u=Ye(n,c,s),m=l?Ic(e,l):null,f=a+.42*(i-a),d=m&&tt(m)<=f+.22?Ye(n,Re(m,n,f,true),s):u;return {body:u,inner:d}}function ih(t){let{art:e,image:n,size:o,kinds:r,modules:a,bg:i,margin:l,pixelSize:s,version:c}=t,u=Ci(e,n),m=ah(t,u).plate,{body:f}=eu(t,u),d=Ft(f),g=m&&Yc(m),h=a.map(v=>[...v]);for(let v=0;v<o;v++)for(let I=0;I<o;I++){let L=r[v*o+I];(L===Vt||g&&L!==qt&&Kc(g,I,v))&&(h[v][I]=false);}let p=[],b=t.body?.(h);if(b)p.push(P("g",{fill:d,children:b},"art-body"));else {let v=new Ke;for(let I=0;I<o;I++)for(let L=0;L<o;L++)h[I]?.[L]&&r[I*o+L]!==qt&&v.circle(d,(L+l+.5)*s,(I+l+.5)*s,.45*s);p.push(...v.toElements("art-body"));}let y=br(c,o).filter(([v,I])=>!g||tu(v+.5,I+.5,g)>3.2);if(y.length>0&&p.push(P("path",{d:Gc(y,l,s),fill:d,fillRule:"evenodd"},"art-alignment")),!m)return p;let _=Dc(e,n,u),w=(m.cx-m.plateW/2+l)*s,C=(m.cy-m.plateH/2+l)*s,S=m.plateW*s,x=m.plateH*s,M=m.radius*s,R=.1*s,E=Ze(w,C,S,x,M);return p.push(P("path",{d:E,fill:Ft(i)},"art-plate"),P("path",{d:E+Ze(w+R,C+R,S-2*R,x-2*R,M-R),fill:Ft(Ye(i,f,.16)),fillRule:"evenodd"},"art-plate-ring"),Vc(u,_,{x:(m.cx-m.logoW/2+l)*s,y:(m.cy-m.logoH/2+l)*s,scale:m.logoW/u.width*s},v=>v,"art-logo")),p}function Ai(t){let{art:e}=t;if(e.mode!=="logo"||e.matchEyes===false)return null;let n=e.image&&xi(e.image);if(!n)return null;let o=Fn(t.fgColor,[0,0,0]),r=Fn(t.bgColor,[1,1,1]),a=Qc(e,o,r);if(a<=0)return null;let i=Ci(e,n);if(i.palette.length===0)return null;if(ho(e)==="badge"){let{body:g,inner:h}=eu({fg:o,bg:r,t:a},i),p={outer:Ft(g),inner:Ft(h)};return {topLeft:p,topRight:p,bottomLeft:p}}let l=tt(o),s=tt(r),c=Math.min(1,a/.6),u=t.version*4+17,m=wi(i.width,i.height,u,"contain"),f=.45*Math.max(i.width,i.height),d=(g,h)=>{let p=(g-m.offsetX)/m.scale,b=(h-m.offsetY)/m.scale,y=null,_=0;for(let C of i.palette){if(tt(C.color)>.86)continue;let S=(C.cx-p)**2+(C.cy-b)**2,x=C.area*(.35+Tc(C.color))*Math.exp(-S/(2*f**2));x>_&&(_=x,y=C.color);}if(!y)return {};let w=Re(y,o,l+.42*(s-l),true);return {inner:Ft(Ye(o,w,c))}};return {topLeft:d(3.5,3.5),topRight:d(u-3.5,3.5),bottomLeft:d(3.5,u-3.5)}}var sh=["horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"];function nu(t){return sh.includes(t)}var ru={circle:.95,"circle-large":.85,square:.75,diamond:.95,pacman:.9,rounded:.75,"vertical-line":.8,liquid:.75,"liquid-horizontal":.85,"liquid-vertical":.85,classy:.7,"classy-rounded":.7,leaf:.75,plus:.8,hexagon:.75,star:.85,heart:.85,"random-dots":.85,mosaic:.8,octagon:.8};function po(t,e){if(t===void 0||!Number.isFinite(t))return 1;let n=e?ru[e]??1:Qr;return Math.min(Ca,Math.max(Qr,n,t))}function lh(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}function ch(t,e){if(t===1)return [];let n=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(n*2-2))*2,r=[6];for(let a=e-7;r.length<n;a-=o)r.splice(1,0,a);return r}function Pi(t){let e=(t-17)/4,n=Number.isInteger(e)?ch(e,t):[],o=n.length-1,r=[];for(let[a,i]of n.entries())for(let[l,s]of n.entries())a===0&&l===0||a===0&&l===o||a===o&&l===0||r.push([i,s]);return (a,i)=>r.some(([l,s])=>Math.abs(a-l)<=2&&Math.abs(i-s)<=2)}var uh={liquid:{horizontal:true,vertical:true,thickness:1,radius:()=>1,fillets:true},"liquid-horizontal":{horizontal:true,vertical:false,thickness:.86,radius:()=>1,fillets:false},"liquid-vertical":{horizontal:false,vertical:true,thickness:.86,radius:()=>1,fillets:false},classy:{horizontal:true,vertical:true,thickness:1,radius:t=>t===0||t===2?1:0,fillets:false},"classy-rounded":{horizontal:true,vertical:true,thickness:1,radius:t=>t===0||t===2?1:.4,fillets:false}};function mh(t,e,n,o,r,a){switch(t){case "horizontal-line":{let i=o*.43;return D(e-o/2,n-i,o,2*i)}case "leaf":{let i=o*.5;return D(e-i,n-i,2*i,2*i,[o*.4,o*.05,o*.4,o*.05])}case "plus":{let i=o*.22,l=o*.5;return et([[e-i,n-l],[e+i,n-l],[e+i,n-i],[e+l,n-i],[e+l,n+i],[e+i,n+i],[e+i,n+l],[e-i,n+l],[e-i,n+i],[e-l,n+i],[e-l,n-i],[e-i,n-i]])}case "hexagon":return et(Pn(e,n,o*.54,6));case "star":return et(vn(e,n+o*.04,o*.62,o*.34));case "heart":return In(e,n+o*.02,o*1.08);case "random-dots":return J(e,n,o*(.38+.15*Jr(r,a)));case "mosaic":{let i=o*(.8+.14*Jr(r,a,1))/2,l=[[e-i,n-i],[e+i,n-i],[e+i,n+i],[e-i,n+i]];return et(kl(l,e,n,(Jr(r,a,2)-.5)*16))}case "octagon":return et(Pn(e,n,o*.48/Math.cos(Math.PI/8),8,22.5));default:return J(e,n,o*.45)}}function ou(t,e){let{margin:n,pixelSize:o,pattern:r}=e,a=po(e.scale,r),i=t.length,l=e.plain?()=>false:Pi(i),s=(h,p)=>!e.plain&&lh(h,p,i),c=(h,p)=>h>=0&&p>=0&&h<i&&p<i&&!!t[p]?.[h]&&!s(h,p),u=h=>(h+.5+n)*o,m=[],f=[],d=uh[r];for(let h=0;h<i;h++)for(let p=0;p<i;p++){if(!c(p,h))continue;let b=u(p),y=u(h);if(l(p,h)){m.push(A`M${b-o/2} ${y-o/2}h${o}v${o}h${-o}z`);continue}if(!d){f.push(mh(r,b,y,o*a,p,h));continue}let _=o*d.thickness*a/2,w=d.horizontal&&c(p+1,h),C=d.horizontal&&c(p-1,h),S=d.vertical&&c(p,h-1),x=d.vertical&&c(p,h+1),R=[!(S||C),!(S||w),!(x||w),!(x||C)].map((E,v)=>E?_*d.radius(v):0);f.push(D(b-_,y-_,2*_,2*_,R)),2*_<o&&(w&&f.push(D(b,y-_,o,2*_)),x&&f.push(D(b-_,y,2*_,o)));}if(d?.fillets&&a===1){let h=o*.3;for(let p=0;p<i;p++)for(let b=0;b<i;b++){if(c(b,p)||s(b,p))continue;let y=u(b)-o/2,_=u(p)-o/2,w=y+o,C=_+o;c(b-1,p)&&c(b,p-1)&&c(b-1,p-1)&&f.push(A`M${y} ${_}h${h}A${h} ${h} 0 0 0 ${y} ${_+h}Z`),c(b+1,p)&&c(b,p-1)&&c(b+1,p-1)&&f.push(A`M${w} ${_}v${h}A${h} ${h} 0 0 0 ${w-h} ${_}Z`),c(b+1,p)&&c(b,p+1)&&c(b+1,p+1)&&f.push(A`M${w} ${C}h${-h}A${h} ${h} 0 0 0 ${w} ${C-h}Z`),c(b-1,p)&&c(b,p+1)&&c(b-1,p+1)&&f.push(A`M${y} ${C}v${-h}A${h} ${h} 0 0 0 ${y+h} ${C}Z`);}}let g=[];return f.length>0&&g.push(P("path",{d:f.join("")},"modules")),m.length>0&&g.push(P("path",{d:m.join("")},"alignment")),g}function dh(t){return t==="top-left"?0:t==="top-right"?1:3}function go(t,e,n,o="circle",r="top-left"){let a=n*2,i=n,l=a/3;switch(o){case "leaf":case "leaf-reverse":case "drop":case "drop-reverse":{let s=dh(r),c=(s+2)%4,u=1.3*l,m=.7*l,f=g=>{switch(o){case "leaf":return g===s||g===c;case "leaf-reverse":return !(g===s||g===c);case "drop":return g===s;default:return g===c}},d=[0,1,2,3].map(g=>f(g)?m:u);return P("path",{d:D(t-n,e-n,a,a,d)})}case "extra-rounded":return P("path",{d:D(t-n,e-n,a,a,1.15*l)});case "plus":{let s=1.15*l,c=n;return P("path",{d:et([[t-s,e-c],[t+s,e-c],[t+s,e-s],[t+c,e-s],[t+c,e+s],[t+s,e+s],[t+s,e+c],[t-s,e+c],[t-s,e+s],[t-c,e+s],[t-c,e-s],[t-s,e-s]])})}case "cross-rounded":{let s=1.15*l,c=.5*l;return P("path",{d:D(t-n,e-s,a,2*s,c)+D(t-s,e-n,2*s,a,c)})}case "hexagon":return P("path",{d:et(Pn(t,e,1.72*l,6))});case "octagon":return P("path",{d:et(Pn(t,e,n/Math.cos(Math.PI/8),8,22.5))});case "flower":{let s=.6*l,c=.9*l;return P("path",{d:J(t-s,e-s,c)+J(t+s,e-s,c)+J(t+s,e+s,c)+J(t-s,e+s,c)+J(t,e,1.2*l)})}case "heart":return P("path",{d:In(t,e+.12*l,3.5*l)});case "squircle":return P("path",{d:et(ir(t,e,n,n,4,64))});case "dots":{let s=[];for(let c of [-1,0,1])for(let u of [-1,0,1])s.push(J(t+u*l*.82,e+c*l*.82,.58*l));return P("path",{d:s.join("")})}case "square":return P("rect",{height:$(a),transform:A`rotate(0,${t},${e})`,width:$(a),x:$(t-i),y:$(e-i)});case "rounded":return P("rect",{height:$(a),rx:$(n*.5),ry:$(n*.5),transform:A`rotate(0,${t},${e})`,width:$(a),x:$(t-i),y:$(e-i)});case "diamond":return P("path",{d:A`M ${t-i*.714286} ${e-i*.714286}v ${a*.714286}h ${a*.714286}v -${a*.714286}z`,transform:A`rotate(45,${t},${e})`});case "message":{let s=a/30,c=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}`;return P("path",{clipRule:"evenodd",d:m,transform:A`rotate(0,${t},${e})`})}case "message-reverse":{let s=a/30,c=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}`;return P("path",{clipRule:"evenodd",d:m,transform:A`rotate(-180,${t},${e})`})}case "diya":{let s=a/30,c=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}H ${c(25)}z`;return P("path",{clipRule:"evenodd",d:m,transform:A`rotate(0,${t},${e})`})}case "diya-reverse":{let s=a/30,c=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${c(25)} ${u(35.714285714285715)}v ${19.285714285714285*s}h ${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} -${10.714285714285714*s}v -${19.285714285714285*s}h -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}z`;return P("path",{clipRule:"evenodd",d:m,transform:A`rotate(0,${t},${e})`})}case "rounded-triangle":{let s=a/21,c=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${c(33.57142857142857)} ${u(29.285714285714285)}h ${12.857142857142856*s}c ${4.285714285714286*s} 0 ${4.285714285714286*s} ${4.285714285714286*s} ${4.285714285714286*s} ${4.285714285714286*s}v ${12.857142857142856*s}c 0 ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s}h -${12.857142857142856*s}c -${4.285714285714286*s} 0 -${4.285714285714286*s} -${4.285714285714286*s} -${4.285714285714286*s} -${4.285714285714286*s}v -${12.857142857142856*s}c 0 -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s}z`;return P("path",{d:m,transform:A`rotate(45,${t},${e})`})}case "star":{let s=a/27,c=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${c(38.84615384615385)},${u(26.546153846153846)}c${.6692307692307691*s},-${1.0153846153846153*s},${2.215384615384615*s},-${1.0153846153846153*s},${2.884615384615384*s},0l${4.038461538461538*s},${6.069230769230768*s}c${.23076923076923075*s},${.3461538461538461*s},${.6*s},${.6*s},${1.0153846153846153*s},${.7153846153846153*s}l${7.223076923076922*s},${1.823076923076923*s}c${1.2*s},${.3*s},${1.6846153846153844*s},${1.7076923076923076*s},${.8999999999999999*s},${2.6538461538461533*s}l-${4.73076923076923*s},${5.584615384615384*s}c-${.2769230769230769*s},${.3230769230769231*s},-${.41538461538461535*s},${.7384615384615384*s},-${.3923076923076923*s},${1.1307692307692307*s}l${.4384615384615384*s},${7.199999999999999*s}c${.06923076923076922*s},${1.2*s},-${1.1769230769230767*s},${2.0769230769230766*s},-${2.3307692307692305*s},${1.6384615384615382*s}l-${6.9692307692307685*s},-${2.6076923076923073*s}c-${.3923076923076923*s},-${.16153846153846155*s},-${.8538461538461538*s},-${.16153846153846155*s},-${1.2461538461538462*s},0l-${6.9692307692307685*s},${2.6076923076923073*s}c-${1.1538461538461537*s},${.4384615384615384*s},-${2.4*s},-${.4384615384615384*s},-${2.3307692307692305*s},-${1.6384615384615382*s}l${.4384615384615384*s},-${7.199999999999999*s}c${.023076923076923075*s},-${.41538461538461535*s},-${.11538461538461538*s},-${.8307692307692307*s},-${.3923076923076923*s},-${1.1307692307692307*s}l-${4.73076923076923*s},-${5.584615384615384*s}c-${.7846153846153846*s},-${.923076923076923*s},-${.3230769230769231*s},-${2.3307692307692305*s},${.8999999999999999*s},-${2.6538461538461533*s}l${7.223076923076922*s},-${1.823076923076923*s}c${.41538461538461535*s},-${.11538461538461538*s},${.7846153846153846*s},-${.3461538461538461*s},${1.0153846153846153*s},-${.7153846153846153*s}l${4.038461538461538*s},-${6.069230769230768*s}z`;return P("path",{clipRule:"evenodd",d:m,transform:A`rotate(0,${t},${e})`})}case "banner":{let s=a/28;return P("g",{transform:A`translate(${t-40*s},${e-40*s}) scale(${$(s,6)})`,children:P("path",{clipRule:"evenodd",d:"M38.235 26.104C38.759 25.677, 39.51 25.677, 40.034 26.104L41.776 27.52C42.091 27.777, 42.501 27.887, 42.902 27.822L45.118 27.466C45.785 27.359, 46.436 27.735, 46.677 28.366L47.477 30.464C47.621 30.843, 47.921 31.143, 48.301 31.288L50.399 32.088C51.03 32.328, 51.406 32.979, 51.298 33.646L50.942 35.863C50.878 36.264, 50.988 36.674, 51.244 36.989L52.661 38.73C53.087 39.254, 53.087 40.006, 52.661 40.53L51.244 42.271C50.988 42.587, 50.878 42.996, 50.942 43.397L51.298 45.614C51.406 46.281, 51.03 46.932, 50.399 47.173L48.301 47.972C47.921 48.117, 47.621 48.417, 47.477 48.797L46.677 50.894C46.436 51.526, 45.785 51.901, 45.118 51.794L42.902 51.438C42.501 51.374, 42.091 51.483, 41.776 51.74L40.034 53.157C39.51 53.583, 38.759 53.583, 38.235 53.157L36.493 51.74C36.178 51.483, 35.768 51.374, 35.367 51.438L33.15 51.794C32.483 51.901, 31.833 51.526, 31.592 50.894L30.792 48.797C30.647 48.417, 30.347 48.117, 29.968 47.972L27.87 47.173C27.239 46.932, 26.863 46.281, 26.97 45.614L27.326 43.397C27.391 42.996, 27.281 42.587, 27.025 42.271L25.608 40.53C25.182 40.006, 25.182 39.254, 25.608 38.73L27.025 36.989C27.281 36.674, 27.391 36.264, 27.326 35.863L26.97 33.646C26.863 32.979, 27.239 32.328, 27.87 32.088L29.968 31.288C30.347 31.143, 30.647 30.843, 30.792 30.464L31.592 28.366C31.833 27.735, 32.483 27.359, 33.15 27.466L35.367 27.822C35.768 27.887, 36.178 27.777, 36.493 27.52L38.235 26.104Z"})})}default:return P("circle",{cx:$(t),cy:$(e),r:$(n),transform:A`rotate(0,${t},${e})`})}}function Tn(t,e,n,o){let r=t==="top-left"?0:t==="top-right"?1:3,a=(r+2)%4;return [0,1,2,3].map(i=>i===r||o&&i===a?n:e)}function au(t,e,n,o){return [[t+o,e],[t+n-o,e],[t+n,e+o],[t+n,e+n-o],[t+n-o,e+n],[t+o,e+n],[t,e+n-o],[t,e+o]]}function iu(t,e,n,o){let r=n/7,a=Math.max(0,(o+Math.SQRT2-2)*r);return et(au(t,e,n,o*r))+et(au(t+r,e+r,5*r,a))}function su(t,e,n,o,r=false){let a=n/7,i=l=>r?Tn(o,0,l,true):Tn(o,l,0,true);return D(t,e,n,n,i(2.5*a))+D(t+a,e+a,5*a,5*a,i(1.5*a))}function fh(t,e,n,o){let r=n/7;return D(t,e,n,n,Tn(o,2.6*r,0,false))+D(t+r,e+r,5*r,5*r,Tn(o,1.6*r,0,false))}function hh(t,e,n){let o=n/7,r=t+n/2,a=e+n/2;return et(ir(r,a,3.5*o,3.5*o,4,96))+et(ir(r,a,2.5*o,2.5*o,4,96))}function lu(t,e,n,o,r){let a=o,i=n/2,l=(i-a)*.55,s=(c,u)=>A`${t+c} ${e+u}`;return A`M${s(a,0)}`+A`C${s(a+l,0)} ${s(i-l,r)} ${s(i,r)}`+A`C${s(i+l,r)} ${s(n-a-l,0)} ${s(n-a,0)}`+A`A${a} ${a} 0 0 1 ${s(n,a)}`+A`C${s(n,a+l)} ${s(n-r,i-l)} ${s(n-r,i)}`+A`C${s(n-r,i+l)} ${s(n,n-a-l)} ${s(n,n-a)}`+A`A${a} ${a} 0 0 1 ${s(n-a,n)}`+A`C${s(n-a-l,n)} ${s(i+l,n-r)} ${s(i,n-r)}`+A`C${s(i-l,n-r)} ${s(a+l,n)} ${s(a,n)}`+A`A${a} ${a} 0 0 1 ${s(0,n-a)}`+A`C${s(0,n-a-l)} ${s(r,i+l)} ${s(r,i)}`+A`C${s(r,i-l)} ${s(0,a+l)} ${s(0,a)}`+A`A${a} ${a} 0 0 1 ${s(a,0)}Z`}function ph(t,e,n){let o=n/7,r=.12*o;return lu(t,e,n,1.4*o,r)+lu(t+o,e+o,5*o,.7*o,r)}function cu(t,e,n,o,r,a){let i=n/2,l=(s,c)=>A`${t+s} ${e+c}`;return A`M${l(o,0)}H${t+n-o}`+A`A${o} ${o} 0 0 1 ${l(n,o)}`+A`V${e+r}`+A`C${l(n,r+1.55*a)} ${l(i+1.6*a,n)} ${l(i,n)}`+A`C${l(i-1.6*a,n)} ${l(0,r+1.55*a)} ${l(0,r)}`+A`V${e+o}A${o} ${o} 0 0 1 ${l(o,0)}Z`}function gh(t,e,n){let o=n/7;return cu(t,e,n,.7*o,3.9*o,o)+cu(t+o,e+o,5*o,.35*o,2.7*o,.8*o)}function bh(t,e,n,o){let r=n/7;return D(t,e,n,n,Tn(o,.5*r,2.5*r,false))+D(t+r,e+r,5*r,5*r,Tn(o,.25*r,1.5*r,false))}function yh(t,e,n){let o=n/7;return A`M ${t} ${e}v ${n}h ${n}v -${n}z`+A`M ${t+o} ${e+o}h ${5*o}v ${5*o}h -${5*o}z`}function _h(t,e,n){let o=n/7,r=o*.875,a=o*.4375,i=A`M ${t+r} ${e}`+A`h ${n-2*r}`+A`a ${r} ${r} 0 0 1 ${r} ${r}`+A`v ${n-2*r}`+A`a ${r} ${r} 0 0 1 ${-r} ${r}`+A`h ${-(n-2*r)}`+A`a ${r} ${r} 0 0 1 ${-r} ${-r}`+A`v ${-(n-2*r)}`+A`a ${r} ${r} 0 0 1 ${r} ${-r}z`,l=A`M ${t+o+a} ${e+o}`+A`h ${5*o-2*a}`+A`a ${a} ${a} 0 0 1 ${a} ${a}`+A`v ${5*o-2*a}`+A`a ${a} ${a} 0 0 1 ${-a} ${a}`+A`h ${-(5*o-2*a)}`+A`a ${a} ${a} 0 0 1 ${-a} ${-a}`+A`v ${-(5*o-2*a)}`+A`a ${a} ${a} 0 0 1 ${a} ${-a}z`;return i+l}function xh(t,e,n){let o=t+n/2,r=e+n/2,a=K(n/2),i=K(n*(2.5/7));return A`M ${o-a} ${r}`+A`a ${a} ${a} 0 1 0 ${a*2} 0`+A`a ${a} ${a} 0 1 0 ${-a*2} 0z`+A`M ${o-i} ${r}`+A`a ${i} ${i} 0 1 1 ${i*2} 0`+A`a ${i} ${i} 0 1 1 ${-i*2} 0z`}function $h(t,e,n){let o=n/74.7002,r=l=>l*o+t,a=l=>l*o+e;return A`M${r(37.3496)} ${a(0)}C${r(39.2939)} ${a(0)} ${r(40.9948)} ${a(1.03842)} ${r(41.9287)} ${a(2.59082)}C${r(43.2293)} ${a(1.34013)} ${r(45.1347)} ${a(.780267)} ${r(47.0098)} ${a(1.28027)}C${r(48.8871)} ${a(1.78928)} ${r(50.261)} ${a(3.23767)} ${r(50.7578)} ${a(4.98438)}C${r(52.3454)} ${a(4.0996)} ${r(54.3432)} ${a(4.047)} ${r(56.0303)} ${a(5.01953)}C${r(57.7094)} ${a(5.98752)} ${r(58.6586)} ${a(7.73647)} ${r(58.6924)} ${a(9.5459)}C${r(60.4517)} ${a(9.10661)} ${r(62.3883)} ${a(9.57215)} ${r(63.7598)} ${a(10.9502)}C${r(65.1282)} ${a(12.3253)} ${r(65.5963)} ${a(14.2585)} ${r(65.1641)} ${a(16.0127)}C${r(66.974)} ${a(16.044)} ${r(68.7242)} ${a(16.9982)} ${r(69.7002)} ${a(18.6797)}C${r(70.6781)} ${a(20.3647)} ${r(70.6241)} ${a(22.3635)} ${r(69.7402)} ${a(23.9502)}C${r(71.4776)} ${a(24.4496)} ${r(72.9194)} ${a(25.8232)} ${r(73.4199)} ${a(27.7002)}C${r(73.927)} ${a(29.5707)} ${r(73.3661)} ${a(31.4794)} ${r(72.1104)} ${a(32.7822)}C${r(73.6621)} ${a(33.7163)} ${r(74.7002)} ${a(35.4166)} ${r(74.7002)} ${a(37.3604)}C${r(74.7001)} ${a(39.307)} ${r(73.6582)} ${a(41.0084)} ${r(72.1025)} ${a(41.9414)}C${r(73.357)} ${a(43.245)} ${r(73.9207)} ${a(45.1525)} ${r(73.4199)} ${a(47.0303)}C${r(72.9187)} ${a(48.9027)} ${r(71.4782)} ${a(50.2735)} ${r(69.7383)} ${a(50.7734)}C${r(70.6201)} ${a(52.3601)} ${r(70.6716)} ${a(54.3549)} ${r(69.7002)} ${a(56.04)}C${r(68.7237)} ${a(57.7225)} ${r(66.9721)} ${a(58.6729)} ${r(65.1611)} ${a(58.7031)}C${r(65.598)} ${a(60.4623)} ${r(65.131)} ${a(62.3982)} ${r(63.7598)} ${a(63.7695)}C${r(62.3847)} ${a(65.138)} ${r(60.4515)} ${a(65.6061)} ${r(58.6973)} ${a(65.1738)}C${r(58.6635)} ${a(66.9833)} ${r(57.7094)} ${a(68.7322)} ${r(56.0303)} ${a(69.7002)}C${r(54.3461)} ${a(70.6777)} ${r(52.348)} ${a(70.6248)} ${r(50.7617)} ${a(69.7422)}C${r(50.2643)} ${a(71.4831)} ${r(48.8896)} ${a(72.9284)} ${r(47.0098)} ${a(73.4297)}C${r(45.1389)} ${a(73.9368)} ${r(43.2296)} ${a(73.3763)} ${r(41.9268)} ${a(72.1201)}C${r(40.9927)} ${a(73.6717)} ${r(39.2932)} ${a(74.71)} ${r(37.3496)} ${a(74.71)}C${r(35.4051)} ${a(74.7098)} ${r(33.7042)} ${a(73.6711)} ${r(32.7705)} ${a(72.1182)}C${r(31.4697)} ${a(73.3758)} ${r(29.5597)} ${a(73.9418)} ${r(27.6797)} ${a(73.4404)}V${a(73.4502)}C${r(25.8065)} ${a(72.9422)} ${r(24.434)} ${a(71.4985)} ${r(23.9346)} ${a(69.7568)}C${r(22.3504)} ${a(70.6301)} ${r(20.3591)} ${a(70.6781)} ${r(18.6797)} ${a(69.71)}C${r(16.9957)} ${a(68.7391)} ${r(16.045)} ${a(66.9831)} ${r(16.0166)} ${a(65.168)}C${r(14.2547)} ${a(65.6091)} ${r(12.3134)} ${a(65.1435)} ${r(10.9395)} ${a(63.7695)}C${r(9.5687)} ${a(62.3919)} ${r(9.10168)} ${a(60.454)} ${r(9.53809)} ${a(58.6973)}C${r(7.72791)} ${a(58.6641)} ${r(5.97815)} ${a(57.71)} ${r(5.00977)} ${a(56.0303)}C${r(4.03552)} ${a(54.3517)} ${r(4.08377)} ${a(52.3649)} ${r(4.95801)} ${a(50.7812)}C${r(3.21705)} ${a(50.2839)} ${r(1.77087)} ${a(48.9101)} ${r(1.26953)} ${a(47.0303)}V${a(47.0205)}C${r(.762081)} ${a(45.1489)} ${r(1.32758)} ${a(43.2375)} ${r(2.58496)} ${a(41.9346)}C${r(1.03604)} ${a(41)} ${r(108484e-9)} ${a(39.3019)} ${r(0)} ${a(37.3604)}C${r(0)} ${a(35.4159)} ${r(1.03815)} ${a(33.7141)} ${r(2.59082)} ${a(32.7803)}C${r(1.34044)} ${a(31.4797)} ${r(.780389)} ${a(29.575)} ${r(1.28027)} ${a(27.7002)}C${r(1.78258)} ${a(25.8232)} ${r(3.22806)} ${a(24.4482)} ${r(4.97363)} ${a(23.9512)}C${r(4.08938)} ${a(22.3638)} ${r(4.03743)} ${a(20.3664)} ${r(5.00977)} ${a(18.6797)}C${r(5.97815)} ${a(16.9999)} ${r(7.72788)} ${a(16.0496)} ${r(9.53809)} ${a(16.0166)}C${r(9.10139)} ${a(14.2576)} ${r(9.56846)} ${a(12.3214)} ${r(10.9395)} ${a(10.9502)}C${r(12.3171)} ${a(9.57911)} ${r(14.2558)} ${a(9.11137)} ${r(16.0127)} ${a(9.54785)}C${r(16.0426)} ${a(7.73421)} ${r(16.9969)} ${a(5.97989)} ${r(18.6797)} ${a(5.00977)}C${r(20.3596)} ${a(4.03474)} ${r(22.3521)} ${a(4.08468)} ${r(23.9365)} ${a(4.96094)}C${r(24.4378)} ${a(3.22749)} ${r(25.8059)} ${a(1.7898)} ${r(27.6797)} ${a(1.29004)}C${r(29.5511)} ${a(.78264)} ${r(31.4617)} ${a(1.34357)} ${r(32.7646)} ${a(2.60059)}C${r(33.6971)} ${a(1.04268)} ${r(35.4013)} ${a(152405e-9)} ${r(37.3496)} ${a(0)}ZM${r(41.0615)} ${a(9.17578)}C${r(40.1006)} ${a(10.1057)} ${r(38.793)} ${a(10.6797)} ${r(37.3496)} ${a(10.6797)}C${r(35.9064)} ${a(10.6796)} ${r(34.5985)} ${a(10.1066)} ${r(33.6377)} ${a(9.17676)}C${r(32.9511)} ${a(10.3241)} ${r(31.8358)} ${a(11.2176)} ${r(30.4404)} ${a(11.5898)}C${r(29.0527)} ${a(11.9661)} ${r(27.6436)} ${a(11.7542)} ${r(26.4766)} ${a(11.1074)}C${r(26.1072)} ${a(12.3879)} ${r(25.2629)} ${a(13.5333)} ${r(24.0195)} ${a(14.25)}C${r(22.7695)} ${a(14.9754)} ${r(21.347)} ${a(15.1322)} ${r(20.0479)} ${a(14.8047)}C${r(20.0289)} ${a(16.1454)} ${r(19.5108)} ${a(17.4793)} ${r(18.4902)} ${a(18.5)}C${r(17.4696)} ${a(19.5158)} ${r(16.1409)} ${a(20.033)} ${r(14.8066)} ${a(20.0566)}C${r(15.1312)} ${a(21.3534)} ${r(14.9738)} ${a(22.7723)} ${r(14.25)} ${a(24.0195)}C${r(13.5243)} ${a(25.2699)} ${r(12.3701)} ${a(26.1148)} ${r(11.082)} ${a(26.4795)}C${r(11.7347)} ${a(27.6479)} ${r(11.9529)} ${a(29.062)} ${r(11.5801)} ${a(30.46)}C${r(11.2085)} ${a(31.8485)} ${r(10.3194)} ${a(32.9607)} ${r(9.17578)} ${a(33.6475)}C${r(10.106)} ${a(34.6084)} ${r(10.6797)} ${a(35.9167)} ${r(10.6797)} ${a(37.3604)}C${r(10.6796)} ${a(38.805)} ${r(10.1053)} ${a(40.1141)} ${r(9.17383)} ${a(41.0752)}C${r(10.3132)} ${a(41.7614)} ${r(11.1999)} ${a(42.871)} ${r(11.5703)} ${a(44.2598)}C${r(11.946)} ${a(45.6504)} ${r(11.7335)} ${a(47.0592)} ${r(11.0889)} ${a(48.2266)}C${r(12.377)} ${a(48.593)} ${r(13.5297)} ${a(49.441)} ${r(14.25)} ${a(50.6904)}C${r(14.9754)} ${a(51.9405)} ${r(15.1322)} ${a(53.3629)} ${r(14.8047)} ${a(54.6621)}C${r(16.142)} ${a(54.6835)} ${r(17.4721)} ${a(55.2016)} ${r(18.4902)} ${a(56.2197)}C${r(19.5097)} ${a(57.2441)} ${r(20.0278)} ${a(58.5787)} ${r(20.0479)} ${a(59.918)}C${r(21.3469)} ${a(59.5917)} ${r(22.7696)} ${a(59.7493)} ${r(24.0195)} ${a(60.4697)}C${r(25.2676)} ${a(61.1892)} ${r(26.1117)} ${a(62.3406)} ${r(26.4775)} ${a(63.627)}C${r(27.6424)} ${a(62.9822)} ${r(29.0498)} ${a(62.7688)} ${r(30.4404)} ${a(63.1396)}C${r(31.8284)} ${a(63.5112)} ${r(32.9402)} ${a(64.3999)} ${r(33.627)} ${a(65.543)}C${r(34.5887)} ${a(64.6072)} ${r(35.9012)} ${a(64.0304)} ${r(37.3496)} ${a(64.0303)}C${r(38.7912)} ${a(64.0303)} ${r(40.098)} ${a(64.6023)} ${r(41.0586)} ${a(65.5303)}C${r(41.7458)} ${a(64.3887)} ${r(42.8594)} ${a(63.5007)} ${r(44.25)} ${a(63.1299)}C${r(45.643)} ${a(62.7522)} ${r(47.057)} ${a(62.9676)} ${r(48.2266)} ${a(63.6201)}C${r(48.5931)} ${a(62.3323)} ${r(49.4413)} ${a(61.1801)} ${r(50.6904)} ${a(60.46)}C${r(51.9373)} ${a(59.7364)} ${r(53.3558)} ${a(59.5781)} ${r(54.6523)} ${a(59.9023)}C${r(54.6744)} ${a(58.5659)} ${r(55.1925)} ${a(57.2372)} ${r(56.21)} ${a(56.2197)}C${r(57.2339)} ${a(55.2007)} ${r(58.5676)} ${a(54.6816)} ${r(59.9062)} ${a(54.6611)}C${r(59.5835)} ${a(53.3649)} ${r(59.7414)} ${a(51.9468)} ${r(60.46)} ${a(50.7002)}C${r(61.1797)} ${a(49.4517)} ${r(62.3312)} ${a(48.6068)} ${r(63.6182)} ${a(48.2412)}C${r(62.9651)} ${a(47.0726)} ${r(62.7473)} ${a(45.658)} ${r(63.1201)} ${a(44.2598)}C${r(63.4916)} ${a(42.8718)} ${r(64.3794)} ${a(41.7591)} ${r(65.5225)} ${a(41.0723)}C${r(64.5929)} ${a(40.1115)} ${r(64.0206)} ${a(38.8033)} ${r(64.0205)} ${a(37.3604)}C${r(64.0205)} ${a(35.9186)} ${r(64.5915)} ${a(34.611)} ${r(65.5195)} ${a(33.6504)}C${r(64.3785)} ${a(32.9631)} ${r(63.4908)} ${a(31.8501)} ${r(63.1201)} ${a(30.46)}C${r(62.7421)} ${a(29.0656)} ${r(62.9572)} ${a(27.6498)} ${r(63.6113)} ${a(26.4795)}C${r(62.3272)} ${a(26.1115)} ${r(61.1784)} ${a(25.2657)} ${r(60.46)} ${a(24.0195)}C${r(59.7364)} ${a(22.7727)} ${r(59.5781)} ${a(21.3541)} ${r(59.9023)} ${a(20.0576)}C${r(58.5626)} ${a(20.038)} ${r(57.23)} ${a(19.52)} ${r(56.21)} ${a(18.5)}C${r(55.1931)} ${a(17.4783)} ${r(54.675)} ${a(16.1482)} ${r(54.6523)} ${a(14.8125)}C${r(53.3557)} ${a(15.1357)} ${r(51.9374)} ${a(14.9785)} ${r(50.6904)} ${a(14.2598)}C${r(49.4399)} ${a(13.5339)} ${r(48.5931)} ${a(12.3801)} ${r(48.2285)} ${a(11.0918)}C${r(47.0603)} ${a(11.7439)} ${r(45.6474)} ${a(11.9624)} ${r(44.25)} ${a(11.5898)}V${a(11.5801)}C${r(42.8613)} ${a(11.2085)} ${r(41.7483)} ${a(10.3196)} ${r(41.0615)} ${a(9.17578)}Z`}function vi(t){let e=t/70;return {scale:e,transform:(o,r)=>(o-5)*e+r}}function Sh(t,e,n){let{scale:o,transform:r}=vi(n);return A`M ${r(5,t)} ${r(30,e)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}H ${r(5,t)}zM ${r(30,t)} ${r(15,e)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${35*o}z`}function wh(t,e,n){let o=n/7,r=o*1.5,a=o*.75,i=A`M ${t+r} ${e}`+A`h ${n-2*r}`+A`a ${r} ${r} 0 0 1 ${r} ${r}`+A`v ${n-2*r}`+A`a ${r} ${r} 0 0 1 ${-r} ${r}`+A`h ${-(n-2*r)}`+A`a ${r} ${r} 0 0 1 ${-r} ${-r}`+A`v ${-(n-2*r)}`+A`a ${r} ${r} 0 0 1 ${r} ${-r}z`,l=A`M ${t+o+a} ${e+o}`+A`h ${5*o-2*a}`+A`a ${a} ${a} 0 0 1 ${a} ${a}`+A`v ${5*o-2*a}`+A`a ${a} ${a} 0 0 1 ${-a} ${a}`+A`h ${-(5*o-2*a)}`+A`a ${a} ${a} 0 0 1 ${-a} ${-a}`+A`v ${-(5*o-2*a)}`+A`a ${a} ${a} 0 0 1 ${a} ${-a}z`;return i+l}function Ch(t,e,n){let{scale:o,transform:r}=vi(n);return A`M ${r(5,t)} ${r(40,e)}a ${35*o} ${35*o}, 0, 0, 0, ${35*o} ${35*o}h ${30*o}a ${5*o} ${5*o}, 0, 0, 0, ${5*o} -${5*o}v -${30*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} -${35*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} ${35*o}zM ${r(40,t)} ${r(15,e)}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} ${25*o}v ${25*o}h -${25*o}a ${25*o} ${25*o}, 0, 0, 1, -${25*o} -${25*o}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} -${25*o}z`}function Mh(t,e,n){let{scale:o,transform:r}=vi(n);return A`M ${r(5,t)} ${r(30,e)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} ${25*o}M ${r(30,t)} ${r(15,e)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} -${15*o}z`}function Rh(t,e,n){let o=n/70,r=t+n/2-40*o,a=e+n/2-40*o,i=(s,c)=>s*o+c;return A`M${i(35.19239999999999,r)} ${i(5.837547376725838,a)}C${i(37.69667692307692,r)} ${i(3.8737070690335305,a)}, ${i(41.218430769230764,r)} ${i(3.8737092228796843,a)}, ${i(43.722707692307694,r)} ${i(5.837547376725838,a)}L${i(46.62781538461539,r)} ${i(8.115648915187375,a)}L${i(50.23356923076923,r)} ${i(7.32361506903353,a)}C${i(53.342,r)} ${i(6.640824299802762,a)}, ${i(56.51483076923077,r)} ${i(8.168784299802759,a)}, ${i(57.91892307692308,r)} ${i(11.024719684418145,a)}L${i(59.54787692307692,r)} ${i(14.337679684418145,a)}L${i(63.14027692307692,r)} ${i(15.188578145956608,a)}C${i(66.23707692307693,r)} ${i(15.922091992110452,a)}, ${i(68.43270769230769,r)} ${i(18.675396607495067,a)}, ${i(68.45876923076924,r)} ${i(21.857768915187375,a)}L${i(68.48892307692307,r)} ${i(25.54931045364891,a)}L${i(71.35633846153846,r)} ${i(27.874602761341222,a)}C${i(73.82830769230769,r)} ${i(29.879187376725838,a)}, ${i(74.61187692307692,r)} ${i(33.312418145956606,a)}, ${i(73.25452307692306,r)} ${i(36.19103353057199,a)}L${i(71.68006153846153,r)} ${i(39.530141222879685,a)}L${i(73.25452307692306,r)} ${i(42.86924891518738,a)}C${i(74.61187692307692,r)} ${i(45.747864299802764,a)}, ${i(73.82830769230769,r)} ${i(49.18109506903353,a)}, ${i(71.35633846153846,r)} ${i(51.18567968441815,a)}L${i(68.48892307692307,r)} ${i(53.510971992110456,a)}L${i(68.45876923076924,r)} ${i(57.202664299802755,a)}C${i(68.43270769230769,r)} ${i(60.38497199211046,a)}, ${i(66.23707692307693,r)} ${i(63.13823353057199,a)}, ${i(63.14027692307692,r)} ${i(63.871833530572,a)}L${i(59.54787692307692,r)} ${i(64.72260276134121,a)}L${i(57.91892307692308,r)} ${i(68.03564891518737,a)}C${i(56.51483076923077,r)} ${i(70.89164891518737,a)}, ${i(53.342,r)} ${i(72.41958737672583,a)}, ${i(50.23356923076923,r)} ${i(71.7368181459566,a)}L${i(46.62781538461539,r)} ${i(70.94463353057199,a)}L${i(43.722707692307694,r)} ${i(73.22275660749506,a)}C${i(41.218430769230764,r)} ${i(75.18663353057198,a)}, ${i(37.69667692307692,r)} ${i(75.18663353057198,a)}, ${i(35.19239999999999,r)} ${i(73.22275660749506,a)}L${i(32.28729230769231,r)} ${i(70.94463353057199,a)}L${i(28.68153846153846,r)} ${i(71.7368181459566,a)}C${i(25.573215384615384,r)} ${i(72.41958737672583,a)}, ${i(22.400384615384613,r)} ${i(70.89164891518737,a)}, ${i(20.996141538461536,r)} ${i(68.03564891518737,a)}L${i(19.36720923076923,r)} ${i(64.72260276134121,a)}L${i(15.774852307692306,r)} ${i(63.871833530572,a)}C${i(12.67803076923077,r)} ${i(63.13823353057199,a)}, ${i(10.48237846153846,r)} ${i(60.38497199211046,a)}, ${i(10.45636,r)} ${i(57.202664299802755,a)}L${i(10.426163076923077,r)} ${i(53.510971992110456,a)}L${i(7.558747692307692,r)} ${i(51.18567968441815,a)}C${i(5.086880338461539,r)} ${i(49.18109506903353,a)}, ${i(4.303258769230769,r)} ${i(45.747864299802764,a)}, ${i(5.660599692307692,r)} ${i(42.86924891518738,a)}L${i(7.235153846153846,r)} ${i(39.530141222879685,a)}L${i(5.660599692307692,r)} ${i(36.19103353057199,a)}C${i(4.3032566153846155,r)} ${i(33.312418145956606,a)}, ${i(5.086885938461538,r)} ${i(29.879187376725838,a)}, ${i(7.558747692307692,r)} ${i(27.874602761341222,a)}L${i(10.426163076923077,r)} ${i(25.54931045364891,a)}L${i(10.45636,r)} ${i(21.857768915187375,a)}C${i(10.48237846153846,r)} ${i(18.67537506903353,a)}, ${i(12.678052307692308,r)} ${i(15.922091992110452,a)}, ${i(15.774852307692306,r)} ${i(15.188578145956608,a)}L${i(19.36720923076923,r)} ${i(14.337679684418145,a)}L${i(20.996141538461536,r)} ${i(11.024719684418145,a)}C${i(22.400384615384613,r)} ${i(8.168784299802759,a)}, ${i(25.573215384615384,r)} ${i(6.640824299802762,a)}, ${i(28.68153846153846,r)} ${i(7.32361506903353,a)}L${i(32.28729230769231,r)} ${i(8.115648915187375,a)}L${i(35.19239999999999,r)} ${i(5.837547376725838,a)}M${i(39.45766153846154,r)} ${i(13.665055069033532,a)}L${i(37.01498461538461,r)} ${i(15.58053506903353,a)}C${i(35.39098461538461,r)} ${i(16.854061222879682,a)}, ${i(33.282799999999995,r)} ${i(17.335251992110454,a)}, ${i(31.26701538461538,r)} ${i(16.892464299802757,a)}L${i(28.235046153846152,r)} ${i(16.22649506903353,a)}L${i(26.865415384615382,r)} ${i(19.012107376725837,a)}C${i(25.954812307692308,r)} ${i(20.864178145956608,a)}, ${i(24.264193846153844,r)} ${i(22.212399684418145,a)}, ${i(22.255926153846154,r)} ${i(22.688076607495066,a)}L${i(19.235393846153844,r)} ${i(23.40354122287968,a)}L${i(19.21,r)} ${i(26.507556607495065,a)}C${i(19.19313538461538,r)} ${i(28.57137199211045,a)}, ${i(18.25492,r)} ${i(30.519525838264297,a)}, ${i(16.651919999999997,r)} ${i(31.81937199211045,a)}L${i(14.240926153846154,r)} ${i(33.774633530572,a)}L${i(15.564830769230769,r)} ${i(36.58238737672584,a)}C${i(16.445064615384617,r)} ${i(38.44891045364892,a)}, ${i(16.445064615384617,r)} ${i(40.611371992110456,a)}, ${i(15.564830769230769,r)} ${i(42.47811045364892,a)}L${i(14.240926153846154,r)} ${i(45.28564891518738,a)}L${i(16.651919999999997,r)} ${i(47.240910453648915,a)}L${i(13.883236923076923,r)} ${i(50.654971992110454,a)}L${i(16.651919999999997,r)} ${i(47.240910453648915,a)}C${i(18.25492,r)} ${i(48.54075660749507,a)}, ${i(19.19313538461538,r)} ${i(50.4891258382643,a)}, ${i(19.21,r)} ${i(52.5527258382643,a)}L${i(19.235393846153844,r)} ${i(55.65684891518738,a)}L${i(22.255926153846154,r)} ${i(56.37235660749507,a)}C${i(24.264193846153844,r)} ${i(56.847925838264295,a)}, ${i(25.954812307692308,r)} ${i(58.196233530571995,a)}, ${i(26.865415384615382,r)} ${i(60.0483258382643,a)}L${i(28.235046153846152,r)} ${i(62.833895069033524,a)}L${i(31.26701538461538,r)} ${i(62.1679258382643,a)}C${i(33.282799999999995,r)} ${i(61.72509506903353,a)}, ${i(35.39098461538461,r)} ${i(62.20626429980276,a)}, ${i(37.01498461538461,r)} ${i(63.47983353057199,a)}L${i(39.45766153846154,r)} ${i(65.39524891518737,a)}L${i(41.90012307692308,r)} ${i(63.47983353057199,a)}C${i(43.524123076923075,r)} ${i(62.20626429980276,a)}, ${i(45.632307692307684,r)} ${i(61.72509506903353,a)}, ${i(47.6480923076923,r)} ${i(62.1679258382643,a)}L${i(50.68006153846154,r)} ${i(62.833895069033524,a)}L${i(52.049692307692304,r)} ${i(60.0483258382643,a)}C${i(52.960338461538456,r)} ${i(58.196233530571995,a)}, ${i(54.6508923076923,r)} ${i(56.847925838264295,a)}, ${i(56.65913846153846,r)} ${i(56.37235660749507,a)}L${i(59.67969230769231,r)} ${i(55.65684891518738,a)}L${i(59.70510769230769,r)} ${i(52.5527258382643,a)}C${i(59.72190769230769,r)} ${i(50.4891258382643,a)}, ${i(60.66012307692307,r)} ${i(48.54075660749507,a)}, ${i(62.263230769230766,r)} ${i(47.240910453648915,a)}L${i(64.67424615384616,r)} ${i(45.28564891518738,a)}L${i(63.35027692307692,r)} ${i(42.47811045364892,a)}C${i(62.47,r)} ${i(40.611371992110456,a)}, ${i(62.47,r)} ${i(38.44891045364892,a)}, ${i(63.35027692307692,r)} ${i(36.58238737672584,a)}L${i(64.67424615384616,r)} ${i(33.774633530572,a)}L${i(62.263230769230766,r)} ${i(31.81958737672584,a)}C${i(60.66012307692307,r)} ${i(30.519525838264297,a)}, ${i(59.72190769230769,r)} ${i(28.57137199211045,a)}, ${i(59.70510769230769,r)} ${i(26.507556607495065,a)}L${i(59.67969230769231,r)} ${i(23.40354122287968,a)}L${i(56.65913846153846,r)} ${i(22.688076607495066,a)}C${i(54.6508923076923,r)} ${i(22.212399684418145,a)}, ${i(52.960338461538456,r)} ${i(20.864178145956608,a)}, ${i(52.049692307692304,r)} ${i(19.012128915187375,a)}L${i(50.68006153846154,r)} ${i(16.22649506903353,a)}L${i(47.6480923076923,r)} ${i(16.892464299802757,a)}C${i(45.632307692307684,r)} ${i(17.335251992110454,a)}, ${i(43.524338461538456,r)} ${i(16.85408276134122,a)}, ${i(41.90012307692308,r)} ${i(15.58053506903353,a)}L${i(39.45766153846154,r)} ${i(13.665055069033532,a)}Z`}function bo(t,e,n,o,r="top-left"){switch(o){case "leaf":return su(t,e,n,r);case "leaf-reverse":return su(t,e,n,r,true);case "drop":return fh(t,e,n,r);case "octagon":return iu(t,e,n,1.6);case "bevel":return iu(t,e,n,1.1);case "squircle":return hh(t,e,n);case "cushion":return ph(t,e,n);case "shield":return gh(t,e,n);case "petal":return bh(t,e,n,r);case "gear":return $h(t,e,n);case "rounded":return _h(t,e,n);case "circle":return xh(t,e,n);case "diya":return Sh(t,e,n);case "extra-rounded":return wh(t,e,n);case "message":return Ch(t,e,n);case "pointy":return Mh(t,e,n);case "curly":return Rh(t,e,n);default:return yh(t,e,n)}}var uu={diamond:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"],banner:["square","rounded","diya","leaf"],square:["curly"],diya:["curly"],message:["curly"]},mu={diamond:["square"],pacman:["rounded"],"small-square":["square","rounded"]},du=["circle","curly"],fu=["diamond","banner","star"],hu={circle:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"]},Xt=["square","liquid","classy","classy-rounded"],pu={"circle/rounded":Xt,"circle/extra-rounded":Xt,"circle/message":[...Xt,"leaf"],"circle/pointy":Xt,"circle/leaf-reverse":Xt,"circle/drop":Xt,"circle/bevel":[...Xt,"leaf"],"circle/squircle":[...Xt,"circle","diamond","circle-mixed","rounded","horizontal-line","leaf","heart","mosaic","octagon"],"circle/cushion":Xt,"circle/shield":[...Xt,"rounded","horizontal-line","leaf"],"circle/petal":Xt};function gu(t,e,n){return (hu[t]?.includes(e)??false)&&!pu[`${t}/${e}`]?.includes(n)}function Ii(t){let e=t.bodyPattern??"circle",n=t.cornerEyePattern??"gear",o=t.cornerEyeDotPattern??"circle";return uu[o]?.includes(n)?{kind:"dot-eye",message:`${o} centres in ${n} eyes are missed by strict decoders`,fix:"Pick a square, rounded or circle centre, or another eye shape"}:mu[e]?.includes(n)?{kind:"body-eye",message:`${e} dots next to ${n} eyes are missed up close`,fix:"Pick a fuller dot shape or another eye shape"}:fu.includes(o)?{kind:"dot",message:`${o} centres are missed in sharp renders and up close`,fix:"Pick a square, rounded or circle centre"}:du.includes(n)?{kind:"eye",message:`${n} eyes only read in lenient decoders`,fix:"Pick square, rounded or gear eyes"}:gu(o,n,e)?{kind:"sharp-dot-eye",message:`${o} centres in ${n} eyes are missed by some decoders on screens and in sharp prints`,fix:"Pick a rounded centre, or gear or octagon eyes"}:null}var xu="gear",Eh="circle";function ne(t,e){let n=t.eyeShapes?.[e];return {outer:n?.outer??t.cornerEyePattern??xu,inner:n?.inner??t.cornerEyeDotPattern??Eh}}var Ah=["curly","circle"];function Fi(t){let e=Be.map(n=>ne(t,n));for(let n of Ah)if(e.some(o=>o.outer===n))return n;return e[0]?.outer??xu}var bu=["dot-eye","body-eye","dot","sharp-dot-eye","eye"];function Ti(t){let e=null,n=new Set;for(let o of Be){let{outer:r,inner:a}=ne(t,o),i=`${r}/${a}`;if(n.has(i))continue;n.add(i);let l=Ii({bodyPattern:t.bodyPattern,cornerEyePattern:r,cornerEyeDotPattern:a});l&&(!e||bu.indexOf(l.kind)<bu.indexOf(e.kind))&&(e=l);}return e}function Nn(t,e,n,o){if(!(t&&Number.isFinite(t))||t<=0||pr(o)||n<=0)return 0;let r=Math.min(Ur,Aa*n/(e+2*n));return Math.min(t,r)}function Ph(t){let{value:e,level:n,shape:o,autoLevel:r,isOGContext:a}=t,i=t.size??it,l=t.margin??ct,s=On({value:`${e}`,size:i,margin:l,level:n,shape:o,autoLevel:r,isOGContext:a},t.imageSettings),c=Et({value:`${e}`,size:i,level:n,margin:l,imageSettings:s,isOGContext:a,autoLevel:r,shape:o}),u=mt.QrCode.encodeText(`${e}`,$t[c]).size;return Nn(Ur,u,l,o)}var ki=(t,e,n,o)=>Math.min(o,Math.max(n,typeof t=="number"&&Number.isFinite(t)?t:e)),vh=/^hsla?\(([^)]*)\)$/,Ih=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?$/,Lh=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)%?$/;function Li(t,e){let n=t?.trim()??"";if(!Lh.test(n))return Number.NaN;let o=Number.parseFloat(n),r=n.endsWith("%")||e?o/100:o;return Math.min(1,Math.max(0,r))}function kh(t){let e=vh.exec(t);if(!e)return null;let[n="",o]=(e[1]??"").split("/"),r=n.split(/[\s,]+/).filter(Boolean);if(r.length!==(o===void 0&&r.length===4?4:3))return null;let[a="",i,l,s]=r,c=Li(i,true),u=Li(l,true),m=Li(o??s??"1",false),f=Number.parseFloat(a);if(!(Ih.test(a)&&[c,u,m].every(Number.isFinite)))return null;let d=c*Math.min(u,1-u),g=h=>{let p=(h+f/30)%12,b=p<0?p+12:p;return 255*(u-d*Math.max(-1,Math.min(b-3,9-b,1)))};return {r:g(0),g:g(8),b:g(4),a:m}}function Ni(t){let e=t?.trim().toLowerCase()??"";return e==="none"?{r:0,g:0,b:0,a:0}:lt(e)??kh(e)}function yo(t){return Ni(t)?.a??1}function $u(t){let e=Lt(t,dt);return e.type==="solid"?yo(e.color)<1:e.type==="image"?yo(e.underlay??"transparent")<1:e.stops.some(n=>yo(n.color)<1)}var Su=({r:t,g:e,b:n})=>Math.min(.2126*t+.7152*e+.0722*n,.299*t+.587*e+.114*n),yu=Su(lt(_e)),_u=t=>{let e=Ni(t);return e?Su(e):null};function wu(t){let e=Ni(t.color||Hr);return e&&e.a>0?`#${[e.r,e.g,e.b].map(n=>Math.round(n).toString(16).padStart(2,"0")).join("")}`:Hr}function _o(t){if(!t.halo)return null;let e="or turn the halo off",n=Lt(t.bgColor,dt);if(n.type==="image")return {reason:"picture",message:"A halo isn't drawn on a picture background: on the picture's darker parts the rim makes the code unreadable",fix:`Use a background color, ${e}`};if($u(t.bgColor))return {reason:"see-through",message:"A halo isn't drawn on a see-through background: on a grey surface under the code the rim makes it unreadable",fix:`Give the code an opaque background, ${e}`};let o=(n.type==="solid"?[n.color]:n.stops.map(i=>i.color)).map(_u),r=o.includes(null)?null:Math.min(...o);if(r===null||r<yu-1e-9)return {reason:"dark-background",message:`A halo is drawn only on a background at least as light as ${_e}: on a darker one the rim makes the code unreadable`,fix:`Lighten the background to ${_e} or lighter, ${e}`};let a=_u(wu(t.halo));return a<yu-1e-9||a>r+1e-9?{reason:"rim",message:`A halo is drawn only in a color between ${_e} and the background's own: a rim lighter than the background, or darker than ${_e}, makes the code unreadable`,fix:`Pick a halo color no lighter than the background and at least as light as ${_e}, ${e}`}:null}function yr(t,e){if(!t||e&&_o({halo:t,bgColor:e.bgColor}))return null;let n=ki(t.width,Ia,Pa,va);return {color:wu(t),width:n}}function Oi(t){if(!t)return null;let e=r=>ki(r,La,-zr,zr),n=e(t.dx),o=e(t.dy);return n===0&&o===0?null:{color:t.color||Na,opacity:ki(t.opacity,Ta,ka,Fa),dx:n,dy:o}}var Di="data-qrdx-part",Cu="data-qrdx-eye",Fh=["eye-outer","eye-centre","body","logo","background"];function Bi(t,e,n){if(t)return n?{[Di]:e,[Cu]:n}:{[Di]:e}}var _r=300;function re(t){return {id:t.id,name:t.name,description:t.description,spec:t.spec,wrapper:(e,n)=>{let o=qe(t.spec),r=n?.fgColor,a=(typeof r=="string"?r:bt(r,""))||"black",i=ur(o.qr.size,o,{color:a}),{x:l,y:s,scale:c}=t.at;return P("svg",{height:_r,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${_r} ${_r}`,width:_r,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:xt("g",{"data-qrdx-template":t.id,transform:`translate(${$(l)} ${$(s)})${c===1?"":` scale(${c})`}`,children:[lc(i),P("g",{fill:"none",transform:`translate(${$(i.qrX)} ${$(i.qrY)}) scale(${i.qrSize/_r})`,children:e})]})})}}}var Mu={kind:"qrdx.frame",version:1,artboard:{width:185,height:178},qr:{x:35,y:0,size:150,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M26.57 80.23h0c0.12 -2.06 0.31 -4.19 0.49 -6.25s0.48 -4.13 0.85 -6.13s0.79 -4 1.27 -5.95a30.21 30.21 0 0 1 1.94 -5.28h0c0.06 -0.18 0.13 -0.43 0.19 -0.67a3.55 3.55 0 0 0 -2.8 -4.19l-0.18 -0.06a1.85 1.85 0 0 0 -0.54 -0.06c-0.19 0 -0.31 -0.06 -0.49 -0.06s-0.61 -0.06 -0.91 -0.06c-0.61 0 -1.21 0.06 -1.82 0.06c-1.21 0.12 -2.37 0.25 -3.52 0.43a62.08 62.08 0 0 0 -6.8 1.45a58.45 58.45 0 0 0 -6.43 2.31c-1 0.42 -2.07 1 -3.1 1.4s-2 1.09 -3 1.57a0.76 0.76 0 0 0 0.54 1.4h0.07c1.09 -0.24 2.12 -0.55 3.15 -0.79s2.13 -0.48 3.16 -0.61A46 46 0 0 1 15 58c1.34 -0.06 2.73 -0.06 4.07 -0.06a62.58 62.58 0 0 0 -7.23 10.43a85.58 85.58 0 0 0 -6.55 15.36a107.86 107.86 0 0 0 -5 32.53a104.06 104.06 0 0 0 5 32.29a90.47 90.47 0 0 0 15.54 28.52a0.94 0.94 0 0 0 1.27 0.19a0.89 0.89 0 0 0 0.18 -1.28h0a87.24 87.24 0 0 1 -13.89 -28.28A102.85 102.85 0 0 1 11 85.87a82.15 82.15 0 0 1 6.68 -14a51.58 51.58 0 0 1 5.71 -7.76c0 1.21 0 2.36 0.06 3.58c0.12 2.18 0.24 4.31 0.48 6.43s0.49 4.25 0.85 6.37a1 1 0 0 0 0.91 0.85A1.37 1.37 0 0 0 26.57 80.23Z",fill:"frame"}],labels:[]};var Ru=re({id:"Arrow",name:"Arrow",description:"QR code with arrow",spec:Mu,at:{x:47,y:95,scale:1}});var Eu={id:"default",name:"Default",description:"Simple QR code without decorative elements",wrapper:t=>P("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:P("g",{fill:"none",transform:"translate(9, 9) scale(0.95)",children:t})})};var $r=593,Ee=296.5,xr=146.5,ku=294.5,Fu=231.228,Tu="M296.5 0C460.252 -7.15782e-06 593 132.748 593 296.5C593 460.252 460.253 593 296.5 593C132.748 593 7.15782e-06 460.252 0 296.5C-7.15788e-06 132.748 132.748 7.15788e-06 296.5 0ZM296.5 527.728C424.204 527.728 527.728 424.204 527.728 296.5C527.728 168.796 424.204 65.2713 296.5 65.2713C168.796 65.2713 65.2714 168.796 65.2714 296.5C65.2714 424.204 168.796 527.728 296.5 527.728Z",Nh="iaa2 1z3g 1z0y 1z18 1z18 1we8 2mq 1uta 47y 1rx4 73u 1rx4 73u 1rxe 73u 1rx4 73u 1rxe 73u 1rx4 73u 1rxe 73u 1rx4 73u 1rzm 71m 1rzm 71m 1rzc 73u okq 13ce 744 1rx4 744 1rwu 744 1rx4 744 1rx4 73u 1rx4 744 1rx4 73u 1rx4 73u 1rx4 744 1rx4 73u 1rxe 73u 1rx4 73u 1rx4 744 1rzm 71c 1rzm 73u 1rxe 73u 1rx4 744 1rx4 73u 1rx4 73u 1rxe 73u 1rx4 618 12m 1rxe 73u 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z18",Oh="hqpr 5 1z36 1z0y 1z18 1z18 1z0y 1z0y 1a7w otc 1z0y 1z18 1z0y 1z18 1z0y 1z1i 1z0o 1z18 1z0y 1z3q 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z0y 1lk8 dgq 1z18 1z18 1z3g 1z0y 1z0y 1z18 1z18 1z0y 1z0y 1z18 1yx2 3w 1z18 60o 1t0a 1z18 1z0y 1z18 1z0y",Au="3cf27f17c00j3ch21n1ek00l1el3cj1vv1kd00n3cl3cn1q31q500p3cp1vx00r1kb3cs3aw1ej21p00t3ax3ay17b27h00w3b02g20yq01w2d611m01x3b52aa14i01y24i1bq0203bd3be1q21q60253bf39e39f39h14e2ae02d39j11i2da02e39l0ym02f39n2lt0sz03a39p2ix0vv03b39r2d511n39t03d27d17f03f39x39y21l1en03h3a03a11vt1kf03j37w37x1q11q703l37z1k903n1vz3821eh03p21r38714d03t11h03u2db38a0vp2j303w2lz38g03x0st2rk0n804o38l2oo0q404p38n2iw0vw04r36f36h2a814k04u36k36l1vs1kg04z36o36p1n41t405236q36x36y0ss2m005d3720n02rs05f3742uf0kd0633763772on0q506537834y2fz0yt06834z2d311p06935235424f1bt06c35621j1ep06d3581yn1hl06e35a1sv1nd06g35b1pz1q906h35d35e35g1ef21t06l35h1bj24p06m35k35l11f2dd06q35n0vn2j506s35p35q0pv2ox06u35s0mz2rt06v35t33h0k32up06w2x90hi08y2ud0ke08z33r2lp0t20922fx0yu0942a514m09624d1bu0983441yl1hm09a1vp1ki09b1px1qa09d34e1n11t609e1h91yy09g1ed21u09h1a227m0831492ai09l0yh2ga09n0sp2m209p0pt2oy09q0k12uq09s2xo0h52z209t31k0en0bt2780c319z0az0e831z0cq",Pu=52,Dh=240;function vu(t){let e=0;return t.split(" ").map(n=>(e+=Number.parseInt(n,36),e/1e4))}var Gi;function Bh(){if(!Gi){let t=vu(Nh),e=vu(Oh),n=[];for(let o=0;o<Au.length;o+=3){let r=Number.parseInt(Au.slice(o,o+3),36);n.push({cx:t[Math.floor(r/Pu)],cy:e[r%Pu]});}Gi=n;}return Gi}function Gh(t){let e=0;for(let n=0;n<t.length;n++)e=e*32-e+t.charCodeAt(n),e%=2147483647;return Math.abs(e)}function Nu(t){let e=Bh(),n=Gh(t),o=()=>(n=(n*9301+49297)%233280,n/233280),r=e.map((a,i)=>i);for(let a=r.length-1;a>0;a--){let i=Math.floor(o()*(a+1));[r[a],r[i]]=[r[i],r[a]];}return r.slice(0,Dh).sort((a,i)=>a-i).map(a=>e[a])}var Iu=300,Qh=49,Uh=6;function Ou(t,e){if(Iu/e<=Qh+.5)return t;let n=xr,o=xr+Iu,r=Uh*e+e/2;return t.filter(({cx:a,cy:i})=>Math.max(n-a,a-o,n-i,i-o)>=r)}var Du="Scan the QR code * Scan the QR code * Scan the QR code * Scan the QR code *",Sr=32,Bu=3.5,Hh=Sr*Zn,Gu=246.5,de=2*Math.PI*Gu,Hi=.36,Lu=Gu+Hi*Sr,Qi=400;function Dn(t,e){return t===" "||/[il1|!']/.test(t)?e*.3:/[mwMW@%&]/.test(t)?e*.8:e*.6}function zh(t){let e=t.slice(0,Qi).split(" ").map(n=>Cn(n,Qi)).join(" ");return Array.from(e).slice(0,Qi)}var qh="\u2026",Qu=1;function Uu(t,e,n,o=false){return o&&e===t.length-1?Qu*n:Dn(t[e],n)}function zi(t,e,n=false){let o=0;for(let r=0;r<t.length;r++)o+=Uu(t,r,e,n);return o}function Ui(t,e,n,o=false){return zi(t,e,o)+n*Math.max(0,t.length-1)+Dn(" ",e)+2*n<=de}var Hu=t=>t.join("").split(" ").filter(Boolean),Wh=(t,e)=>Array.from(Array.from({length:e},()=>t.join(" ")).join(" "));function zu(t,e,n){if(Ui(t,e,n))return {chars:t,fontSize:e,letterSpacing:n};let o=Math.min(n,0),r=Math.min(e,Hh),a=(h,p=false)=>{let b=zi(h,e,p)+Dn(" ",e),y=h.length+1,_=(de-b)/y;if(_>=o)return {chars:h,fontSize:e,letterSpacing:_,cut:p};let w=(de-o*y)/b*e;return w>=r?{chars:h,fontSize:w,letterSpacing:o,cut:p}:null},i=a(t);if(i)return i;let l=Hu(t),s=qu(l);for(let h=l.length/s.length-1;h>=1;h--){let p=Wh(s,h);if(Ui(p,r,o))return a(p)??{chars:p,fontSize:r,letterSpacing:o}}let c=de-Dn(" ",r)-Qu*r-2*o,u=0,m=0,f=0;for(let[h,p]of t.entries()){if(u+=Dn(p,r)+o,u>c)break;f=h+1,(f===t.length||t[f]===" ")&&(m=f);}let d=[...Vh(t.slice(0,m>0?m:f)),qh];return (Ui(d,e,n,true)?{chars:d,fontSize:e,letterSpacing:n,cut:true}:null)??a(d,true)??{chars:d,fontSize:r,letterSpacing:o,cut:true}}function Vh(t){let e=t.length;for(;e>0&&/[\s.,;:!?*·•\-–—]/u.test(t[e-1]);)e--;return t.slice(0,e)}function qu(t){for(let e=1;e<t.length;e++)if(t.length%e===0&&t.every((n,o)=>n===t[o%e]))return t.slice(0,e);return t}function Xh(t,e,n){let o=Hu(t);if(o.length===0)return {chars:[],fontSize:e,letterSpacing:n};let r=Array.from(qu(o).join(" ")),a=zi(r,e)+Dn(" ",e),i=a+(r.length+1)*n,l=Math.min(n,0),s=null;for(let c of new Set([Math.floor(de/i),Math.ceil(de/i)])){if(c<1)continue;let u=(de-c*a)/(c*(r.length+1));if(u>=l&&(!s||Math.abs(u-n)<Math.abs(s.letterSpacing-n))){let m=Array.from({length:c},()=>r.join(""));s={chars:Array.from(m.join(" ")),fontSize:e,letterSpacing:u};}}return s??zu(r,e,n)}function Wu(t,e){let{position:n,rotation:o}=e,r=zh(t),a=e.fill==="repeat"?Xh(r,e.fontSize,e.letterSpacing):zu(r,e.fontSize,e.letterSpacing),{fontSize:i,letterSpacing:l}=a,s=[],c=0;for(let[h,p]of a.chars.entries()){let b=Uu(a.chars,h,i,a.cut);s.push({char:p,along:c+b/2}),c+=b+l;}let u=c-(s.length>0?l:0),m=n!=="bottom",f=m?Lu-Hi*i:Lu+Hi*i,d=u/de*180,g=[];for(let{char:h,along:p}of s){if(h.trim()==="")continue;let b=p/de*360,y=m?o-d+b:o+180+d-b,_=y*Math.PI/180;g.push({char:h,x:K(Ee+f*Math.sin(_)),y:K(Ee-f*Math.cos(_)),rotate:K(m?y:y-180)});}return {text:a.chars.join(""),letters:g,fontSize:i===e.fontSize?i:K(i),letterSpacing:l}}var Bn=(t,e)=>typeof t=="number"&&Number.isFinite(t)?t:e,Vu={id:"DotRing",name:"Dot Ring",description:"A round code in a ring of dots of its own for every link, with text along the ring",wrapper:(t,e,n)=>{let o=bt(e?.fgColor,"#000000"),r=bt(e?.bgColor,"#ffffff"),a=n?.pixelSize??9,i=K(a/2),l=Ou(Nu(n?.url??""),a),s=Bn(e?.fontSize,Sr),c=s>0?s:Sr,u=typeof e?.customText=="string"?e.customText:Du,m=Wu(u,{fontSize:c,letterSpacing:Bn(e?.fontLetterSpacing,Bu),position:e?.textPosition==="bottom"?"bottom":"top",rotation:Bn(e?.textRotation,0),fill:e?.textFill==="repeat"?"repeat":"none"}),f=e?.textColor||"#ffffff",d=e?.fontFamily||io,g=e?.fontWeight??900,h=Bn(e?.strokeWidth,0),p=e?.strokeColor||"#000000",b=[{radius:Ee,width:Bn(e?.outerStrokeWidth,h),color:e?.outerStrokeColor||p},{radius:Fu,width:Bn(e?.innerStrokeWidth,h),color:e?.innerStrokeColor||p}].filter(y=>y.width>0);return xt("svg",{height:$r,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${$r} ${$r}`,width:$r,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[P("circle",{cx:Ee,cy:Ee,fill:r,r:ku}),P("g",{fill:o,children:l.map((y,_)=>P("circle",{cx:y.cx,cy:y.cy,r:i},_))}),P("path",{d:Tu,fill:e?.outerCircleColor||o}),b.map((y,_)=>P("circle",{cx:Ee,cy:Ee,fill:"none",r:y.radius,stroke:y.color,strokeWidth:y.width},_)),P("g",{"aria-hidden":"true",children:m.letters.map((y,_)=>P("text",{fill:f,fontFamily:d,fontSize:m.fontSize,fontWeight:g,textAnchor:"middle",transform:`rotate(${y.rotate} ${y.x} ${y.y})`,x:y.x,y:y.y,children:y.char},_))}),P("g",{transform:`translate(${xr} ${xr})`,children:t})]})}};var Xu={kind:"qrdx.frame",version:1,artboard:{width:220,height:277},qr:{x:52,y:122,size:114,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"circle",cx:110,cy:167.682,r:99.318,fill:"#FFFFFF",stroke:{color:"#F89941",width:20}},{type:"ellipse",cx:139.989,cy:67.895,rx:35.445,ry:48.442,fill:"#F89941"},{type:"path",d:"M159.937 69.076C159.937 82.657 156.092 94.845 150.005 103.57C143.912 112.304 135.736 117.381 126.992 117.381C118.247 117.381 110.072 112.304 103.979 103.57C97.891 94.845 94.047 82.657 94.047 69.076C94.047 55.495 97.891 43.308 103.979 34.582C110.072 25.849 118.247 20.771 126.992 20.771C135.736 20.771 143.912 25.849 150.005 34.582C156.092 43.308 159.937 55.495 159.937 69.076Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:126.072,cy:69.487,rx:34.051,ry:50.662,fill:"#F89941"},{type:"path",d:"M143.396 69.667C143.396 82.739 139.562 94.472 133.488 102.874C127.412 111.279 119.235 116.2 110.451 116.2C101.666 116.2 93.489 111.279 87.413 102.874C81.34 94.472 77.506 82.739 77.506 69.667C77.506 56.595 81.34 44.862 87.413 36.46C93.489 28.055 101.666 23.134 110.451 23.134C119.235 23.134 127.412 28.055 133.488 36.46C139.562 44.862 143.396 56.595 143.396 69.667Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:106.316,cy:70.849,rx:33.673,ry:47.851,fill:"#F89941"},{type:"ellipse",cx:78.743,cy:68.448,rx:35.445,ry:48.442,fill:"#F89941"},{type:"path",d:"M58.794 69.63C58.794 83.211 62.639 95.399 68.726 104.124C74.819 112.858 82.995 117.935 91.739 117.935C100.484 117.935 108.659 112.858 114.753 104.124C120.84 95.399 124.685 83.211 124.685 69.63C124.685 56.049 120.84 43.861 114.753 35.136C108.659 26.402 100.484 21.325 91.739 21.325C82.995 21.325 74.819 26.402 68.726 35.136C62.639 43.861 58.794 56.049 58.794 69.63Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:91.744,cy:69.763,rx:32.944,ry:50.385,fill:"#F89941"},{type:"path",d:"M75.335 70.221C75.335 83.293 79.169 95.025 85.243 103.427C91.319 111.833 99.496 116.753 108.281 116.753C117.065 116.753 125.242 111.833 131.318 103.427C137.392 95.025 141.226 83.293 141.226 70.221C141.226 57.148 137.392 45.416 131.318 37.014C125.242 28.609 117.065 23.688 108.281 23.688C99.496 23.688 91.319 28.609 85.243 37.014C79.169 45.416 75.335 57.148 75.335 70.221Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:111.677,cy:70.871,rx:32.39,ry:47.616,fill:"#F89941"},{type:"ellipse",cx:106.971,cy:71.425,rx:33.221,ry:47.616,fill:"#F89941"},{type:"path",d:"M130.85 46.678C137.21 42.252 138.538 40.633 139.867 39.014C139.867 39.014 141.806 43.824 141.88 46.357C141.954 48.89 141.712 50.147 139.248 51.647C136.783 53.146 127.406 53.045 122.083 52.975C121.31 52.5 122.72 52.337 130.85 46.678Z",fill:"#000000"},{type:"path",d:"M87.765 46.512C81.392 42.141 80.058 40.548 78.724 38.954C78.724 38.954 76.783 45.836 76.758 46.822C76.733 47.808 76.657 50.805 80.247 52C83.837 53.194 91.234 52.772 96.551 52.727C97.322 52.265 95.912 52.099 87.765 46.512Z",fill:"#000000"},{type:"path",d:"M132 90.5C139.156 83.16 141.5 78.283 143.351 72.935C144.24 70.367 134.909 72.043 130 72.935C129.276 73.066 127.751 76.915 127 77C126.182 77.093 123.841 73.076 123 73.086C121.725 73.101 119.727 73.086 117.875 73.429C117.345 74.365 118.367 77.575 117.875 78.283C117.321 78.283 113.796 77.26 113.242 76.43C112.689 74.492 112.949 73.363 112.118 72.532C109.555 72.908 110.023 72.657 107.412 73.086C106.768 73.192 105.09 77.721 104.441 77.82C103.615 77.945 100.644 74.009 99.809 74.114C98.747 74.248 96.821 74.468 95.64 74.577C95.126 74.624 95.554 77.502 95.177 78.283C94.898 78.862 91.426 77.892 90.5 77.5C90.037 76.502 89.844 74.558 89 74.577C83 74.114 81.4 73.843 75.575 70.871C75.575 70.871 74.5 80 83 89C91.5 98 119.127 103.706 132 90.5Z",fill:"#000000"},{type:"path",d:"M107.238 7.252C109.192 1.731 114.678 0.363 117.935 0L120.377 1.816C121.158 2.397 121.842 2.409 122.331 3.257C122.331 4.225 118.337 5.42 114.429 6.582C109.545 8.035 111.482 17.053 114.429 19.281C115.401 20.015 115.524 19.964 117.966 19.964C120.029 19.964 122.387 18.247 123.566 17.353C123.566 17.353 123.861 20.257 121.798 21.478C119.735 22.698 115.578 21.858 115.608 21.966C116.493 23.918 118.89 22.489 120.029 23.336C119.346 23.336 118.556 24.289 116.198 24.533C114.672 24.58 114.135 24.533 112.956 23.918C111.777 23.304 111.482 22.87 110.893 22.14C108.83 23.36 110.893 25.431 110.893 25.431C110.893 25.431 106.472 25.851 105.587 23.918C105.264 23.212 105.882 22.14 105.587 21.966C103.819 22.454 102.935 23.481 99.373 22.87C96.312 22.344 97.102 18.321 96.451 17.353C99.381 18.079 97.131 20.039 101.327 19.964C112.838 19.758 104.796 14.153 107.238 7.252Z",fill:"#5D725F"}],labels:[]};var ju=re({id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",spec:Xu,at:{x:38,y:10,scale:1}});var Zu={kind:"qrdx.frame",version:1,artboard:{width:316,height:316},qr:{x:20,y:20,size:276,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M308 8H8v300h300V8ZM0 0v316h316V0H0Z",fill:"frame",fillRule:"evenodd"}],labels:[]};var Yu=re({id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",spec:Zu,at:{x:0,y:0,scale:300/316}});var Ku={kind:"qrdx.frame",version:1,artboard:{width:208,height:298},qr:{x:14,y:14,size:180,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M197 0.7h-186a10.25 10.25 0 0 0 -10.2 10.12v186A10.13 10.13 0 0 0 11 207H197a10.13 10.13 0 0 0 10.12 -10.12v-186A10.13 10.13 0 0 0 197 0.7Zm2.36 193.05a5.46 5.46 0 0 1 -5.47 5.47H14.16a5.46 5.46 0 0 1 -5.47 -5.47V13.93a5.46 5.46 0 0 1 5.47 -5.47H193.91a5.46 5.46 0 0 1 5.47 5.47Z",fill:"frame"},{type:"path",d:"M197.54 237.81H127.61a2.29 2.29 0 0 1 -1.62 -0.67l-20.55 -20.55a2.33 2.33 0 0 0 -3.25 0l-20.55 20.55a2.29 2.29 0 0 1 -1.62 0.67H10.09A9.15 9.15 0 0 0 0.93 247v41.17a9.16 9.16 0 0 0 9.16 9.16H197.61a9.09 9.09 0 0 0 9.09 -9.16V247A9.16 9.16 0 0 0 197.54 237.81Z",fill:"frame"}],labels:[]};var Ju=re({id:"StandardBox",name:"Standard Box",description:"QR code with standard box",spec:Ku,at:{x:46,y:1,scale:1}});var t0={kind:"qrdx.frame",version:1,artboard:{width:252,height:300},qr:{x:40,y:38,size:174,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M171.11 290.77l-7.28 4.88a2.16 2.16 0 0 0 -0.57 3a2.21 2.21 0 0 0 1.77 0.92a2.4 2.4 0 0 0 1.2 -0.35l7.28 -4.88a2.14 2.14 0 0 0 -2.4 -3.54Z",fill:"#22071b"},{type:"path",d:"M242.85 227.52l-7.28 4.87a2.16 2.16 0 0 0 -0.57 3a2.21 2.21 0 0 0 1.77 0.92a1.86 1.86 0 0 0 1.2 -0.35l7.28 -4.88a2.13 2.13 0 1 0 -2.4 -3.53Z",fill:"#22071b"},{type:"path",d:"M17 176.34l-9.11 6.08a2.15 2.15 0 0 0 -0.57 3a2.19 2.19 0 0 0 1.77 0.92a2.14 2.14 0 0 0 1.2 -0.35l9.12 -6.08A2.14 2.14 0 0 0 17 176.34Z",fill:"#22071b"},{type:"path",d:"M17 269.08l-9.11 6.07a2.15 2.15 0 0 0 -0.57 3a2.19 2.19 0 0 0 1.77 0.92a2.92 2.92 0 0 0 1.2 -0.35l9.12 -6.08A2.14 2.14 0 0 0 17 269.08Z",fill:"#22071b"},{type:"path",d:"M123 10.1a2.4 2.4 0 0 0 1.14 -0.35l7.7 -5.16a2.13 2.13 0 0 0 -2.4 -3.53l-7.64 5.15a2.15 2.15 0 0 0 -0.56 3A2.19 2.19 0 0 0 123 10.1Z",fill:"#22071b"},{type:"path",d:"M251.54 54.77a2.14 2.14 0 0 0 -3 -0.56l-17.1 11.45V31.31a10.18 10.18 0 0 0 -10.18 -10.18H113.22l-10.39 7a2.4 2.4 0 0 1 -1.2 0.35a2.21 2.21 0 0 1 -1.77 -0.92a2.15 2.15 0 0 1 0.57 -3l1.41 -0.92l13.64 -8.76a2.1 2.1 0 1 0 -2.26 -3.54L98 21.2h-8.13l-10.39 7a2.37 2.37 0 0 1 -1.2 0.35a2.19 2.19 0 0 1 -1.76 -0.92a2.15 2.15 0 0 1 0.56 -3L100 9.25a2.13 2.13 0 1 0 -2.4 -3.53l-23 15.48H34.2A10.18 10.18 0 0 0 24 31.38v28L7.34 70.46a2.09 2.09 0 0 0 -0.57 3a2 2 0 0 0 1.77 0.92a2.58 2.58 0 0 0 1.2 -0.35l14.35 -9.54l3.18 -2.12a2.14 2.14 0 1 1 2.41 3.53l-5.52 3.67V76.9l-7 4.66a2.15 2.15 0 0 0 -0.56 3a2 2 0 0 0 1.77 0.92a2.34 2.34 0 0 0 1.2 -0.36l7.35 -4.94A2.13 2.13 0 0 1 28.69 84l-4.46 3v65.66L1.05 168.07a2.15 2.15 0 0 0 -0.57 3a2 2 0 0 0 1.77 0.92a2.37 2.37 0 0 0 1.2 -0.35l25 -16.75a2 2 0 0 1 2.62 0.77a2.16 2.16 0 0 1 -0.57 3l-6.36 4.24V275a10.09 10.09 0 0 0 9.83 10.11l-5.87 4a2.15 2.15 0 0 0 -0.57 3a2.06 2.06 0 0 0 1.77 0.92a2.38 2.38 0 0 0 1.2 -0.36l23 -15.41a2.14 2.14 0 0 1 2.41 3.54l-6.58 4.45h52l-5.58 3.75a2.14 2.14 0 0 0 -0.56 3a2 2 0 0 0 1.76 0.91a2.37 2.37 0 0 0 1.2 -0.35l30.54 -20.28a2.15 2.15 0 0 1 3 0.56a2.1 2.1 0 0 1 -0.57 3l-14.21 9.54H193l-4.6 3a2.16 2.16 0 0 0 -0.63 3a2.11 2.11 0 0 0 1.76 1a2 2 0 0 0 1.13 -0.36L213 277.35a2.14 2.14 0 1 1 2.33 3.6l-6.78 4.38h13a10.18 10.18 0 0 0 10.18 -10.18v-91.1l-4.38 3a2.43 2.43 0 0 1 -1.2 0.35a2.19 2.19 0 0 1 -1.77 -0.92a2.15 2.15 0 0 1 0.57 -3l24.38 -16.33a2.13 2.13 0 1 0 -2.4 -3.53l-15.48 10.25V91.53l-4.38 3a2.34 2.34 0 0 1 -1.21 0.36a2.22 2.22 0 0 1 -1.76 -0.92a2.15 2.15 0 0 1 0.56 -3l6.72 -4.52l13.71 -9.19a2.14 2.14 0 0 0 -2.4 -3.54l-11.24 7.57V75.84l-4.38 3a2.34 2.34 0 0 1 -1.21 0.36a2.22 2.22 0 0 1 -1.76 -0.92a2.15 2.15 0 0 1 0.56 -3l6.72 -4.52l19.43 -13.08A2.05 2.05 0 0 0 251.54 54.77ZM213 216.07h-172a5.23 5.23 0 0 1 -5.23 -5.24V38.94a5.22 5.22 0 0 1 5.23 -5.23H213a5.22 5.22 0 0 1 5.23 5.23V210.83h0.07A5.22 5.22 0 0 1 213 216.07Z",fill:"#22071b"},{type:"path",d:"M246.45 139.8l-7.28 4.88a2.15 2.15 0 0 0 -0.56 3a2.22 2.22 0 0 0 1.76 0.92a2.44 2.44 0 0 0 1.21 -0.36l7.28 -4.87a2.14 2.14 0 0 0 -2.41 -3.54Z",fill:"#22071b"}],labels:[]};var e0=re({id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",spec:t0,at:{x:24,y:0,scale:1}});var wr={default:Eu,Arrow:Ru,StandardBox:Ju,SquareBorder:Yu,StrikedBox:e0,Halloween:ju,DotRing:Vu},n0={FlamQR:"DotRing"},xo=t=>{if(Object.hasOwn(wr,t))return wr[t];let e=Object.hasOwn(n0,t)?n0[t]:void 0;return e?wr[e]:void 0},g5=()=>Object.values(wr),b5=()=>Object.keys(wr);var qi=t=>Math.round(Math.min(Math.max(t,0),255)).toString(16).padStart(2,"0");function i0(t){return `#${qi(t.r)}${qi(t.g)}${qi(t.b)}`}function Gn(t){let e=lt(t);return !e||e.a>=1||e.a<=0?{color:t}:{color:i0(e),opacity:K(e.a,3)}}function $o(t,e){let n=Math.min(Math.max(t.a,0),1);return {r:t.r*n+e.r*(1-n),g:t.g*n+e.g*(1-n),b:t.b*n+e.b*(1-n),a:1}}var s0={r:0,g:0,b:0,a:1};function Jh(t){return [...t].map(e=>({offset:Math.min(Math.max(e.offset/100,0),1),color:lt(e.color)??s0})).sort((e,n)=>e.offset-n.offset)}function Wi(t,e){let n=t[0],o=t.at(-1);if(!(n&&o))return s0;if(e<=n.offset)return n.color;if(e>=o.offset)return o.color;for(let r=0;r+1<t.length;r++){let a=t[r],i=t[r+1];if(e>=a.offset&&e<=i.offset){let l=i.offset-a.offset,s=l>0?(e-a.offset)/l:1,c=a.color.a+(i.color.a-a.color.a)*s,u=(m,f)=>{let d=m*a.color.a+(f*i.color.a-m*a.color.a)*s;return c>0?d/c:m+(f-m)*s};return {r:u(a.color.r,i.color.r),g:u(a.color.g,i.color.g),b:u(a.color.b,i.color.b),a:c}}}return o.color}var r0=4,o0=720,tp=2;function l0(t,e,n,o,r){let a=Jh(t);if(a.length===0)return {wedges:[]};let i=a[0].color.a,l=a.every(y=>Math.abs(y.color.a-i)<.002),s=[...new Set([0,...a.map(y=>y.offset),1])].sort((y,_)=>y-_),c=[];for(let y=0;y+1<s.length;y++){let _=s[y],w=s[y+1];if(w<=_)continue;let C=Wi(a,_+1e-9),S=Wi(a,w-1e-9),x=Math.max(Math.abs(C.r*C.a-S.r*S.a),Math.abs(C.g*C.a-S.g*S.a),Math.abs(C.b*C.a-S.b*S.a),Math.abs(C.a-S.a)*255),M=Math.ceil(x/tp),R=Math.ceil((w-_)*360/r0),E=Math.max(1,M,R);for(let v=0;v<E;v++)c.push([_+(w-_)*v/E,_+(w-_)*(v+1)/E]);}let u=c;if(c.length>o0){let y=Math.ceil(c.length/o0);u=[];for(let _=0;_<c.length;_+=y){let w=c.slice(_,_+y);u.push([w[0][0],w.at(-1)[1]]);}}let m=e-90,f=r/Math.cos(2*r0/2*(Math.PI/180)),d=y=>{let _=y*Math.PI/180;return [$(n+f*Math.cos(_)),$(o+f*Math.sin(_))]},g=`${$(n)} ${$(o)}`,h=y=>K((y%360+360)%360,4),p=u.length-1,b=u.map(([y,_],w)=>{let C=Wi(a,(y+_)/2),S=(_-y)*360,x=l&&w===0&&p>0?S:0,M=l&&w<p?S:0,R=m+y*360-x,E=m+_*360+M,[v,I]=d(R),[L,T]=d(E);return {d:`M${g}L${v} ${I}L${L} ${T}Z`,color:i0(C),...l||C.a>=1?{}:{opacity:K(C.a,3)},from:h(R),sweep:K(E-R,4)}});return l&&i<1?{wedges:b,opacity:K(i,3)}:{wedges:b}}function a0(t,e,n,o){return (Math.atan2(o-e,n-t)*180/Math.PI%360+360)%360}function c0(t,e,n){if(t>=n.x-1e-6&&t<=n.x+n.width+1e-6&&e>=n.y-1e-6&&e<=n.y+n.height+1e-6)return null;let r=[[n.x,n.y],[n.x+n.width,n.y],[n.x,n.y+n.height],[n.x+n.width,n.y+n.height]],a=a0(t,e,n.x+n.width/2,n.y+n.height/2),i=0,l=0;for(let[s,c]of r){let u=a0(t,e,s,c)-a;u>180?u-=360:u<=-180&&(u+=360),i=Math.min(i,u),l=Math.max(l,u);}return [a+i,a+l]}function u0(t,e){let n=t[1]-t[0],o=e[1]-e[0];if(n>=360||o>=360)return true;let r=((e[0]-t[0])%360+360)%360;return r<=n||r+o>=360}function Xi(t,e){return t.slice().map((n,o)=>o<e.y||o>=e.y+e.h?n:n.map((r,a)=>a<e.x||a>=e.x+e.w?r:false))}function f0(t,e=0){let n=[];return t.forEach((o,r)=>{let a=null;o.forEach((i,l)=>{if(!i&&a!==null){n.push(A`M${a+e} ${r+e}h${l-a}v1H${a+e}z`),a=null;return}if(l===o.length-1){if(!i)return;a===null?n.push(A`M${l+e},${r+e} h1v1H${l+e}z`):n.push(A`M${a+e},${r+e} h${l+1-a}v1H${a+e}z`);return}i&&a===null&&(a=l);});}),n.join("")}function ep(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}var np=.9;function Vi(t,e){let{margin:n,pixelSize:o,pattern:r="circle",plain:a=false}=e;if(nu(r))return ou(t,{margin:n,pixelSize:o,pattern:r,scale:e.scale,plain:a});let i=po(e.scale,r),l=[],s=t.length,c=o*.45,u=a?()=>false:Pi(s);return t.forEach((m,f)=>{m.forEach((d,g)=>{if(d&&(a||!ep(g,f,s))){let h=(g+.5+n)*o,p=(f+.5+n)*o,b=`${g}-${f}`,y=l.length;if(u(g,f)){l.push(P("rect",{height:$(o),width:$(o),x:$(h-o/2),y:$(p-o/2)},b));return}switch(r){case "circle":l.push(P("circle",{cx:$(h),cy:$(p),r:$(c),transform:A`rotate(0,${h},${p})`},b));break;case "circle-large":{let _=o*.5;l.push(P("circle",{cx:$(h),cy:$(p),r:$(_),transform:A`rotate(0,${h},${p})`},b));}break;case "small-square":{let _=o*.357143;l.push(P("path",{d:A`M ${h-_} ${p-_}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:A`rotate(0,${h},${p})`},b));}break;case "diamond":{let _=o*.357143;l.push(P("path",{d:A`M ${h-_} ${p-_}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:A`rotate(45,${h},${p})`},b));}break;case "circle-mixed":{let _=(g+f)%3===0?np:(g+f)%2===0?1:1.25,w=c*_;l.push(P("circle",{cx:$(h),cy:$(p),r:$(w),transform:A`rotate(0,${h},${p})`},b));}break;case "pacman":{let _=o*.5,w=o*.357143;l.push(P("path",{d:A`M ${h-_} ${p-w}v ${o*.714286}h ${_}a ${_*.5} ${_*.5}, 0, 0, 0, 0 -${o*.714286}h -${_}v -${o*.714286}z`,transform:A`rotate(${(g+f)%2===0?0:90},${h},${p})`},b));}break;case "rounded":{let _=o*.5,w=o*.2;l.push(P("rect",{height:$(o),rx:$(w),ry:$(w),transform:A`rotate(0,${h},${p})`,width:$(o),x:$(h-_),y:$(p-_)},b));}break;case "square":{let _=o*.5;l.push(P("rect",{height:$(o),transform:A`rotate(0,${h},${p})`,width:$(o),x:$(h-_),y:$(p-_)},b));}break;case "vertical-line":{let _=o*.714286,w=o;l.push(P("path",{d:A`M ${h-o*.5} ${p-_*.5}v ${_}h ${w}v -${_}z`,transform:A`rotate(90,${h},${p})`},b));}break;default:l.push(P("circle",{cx:$(h),cy:$(p),r:$(c),transform:A`rotate(0,${h},${p})`},b));}if(i!==1&&l.length>y){let _=l.pop();l.push(P("g",{transform:A`translate(${h},${p}) scale(${$(i,6)}) translate(${-h},${-p})`,children:_},b));}}});}),l}function rp(t,e){let n=t*Math.PI/180,o=e/2,r=e/2,a=Math.sqrt(e*e+e*e)/2,i=o-a*Math.cos(n),l=r-a*Math.sin(n),s=o+a*Math.cos(n),c=r+a*Math.sin(n);return {x1:i,y1:l,x2:s,y2:c}}function ji(t,e){return `${t}-${ze(JSON.stringify(e))}`}function op(t,e,n,o,r){let a=t;if(t===0)switch(r){case "top-left":a=0;break;case "top-right":a=90;break;case "bottom-left":a=270;break;default:a=0;}let i=a*Math.PI/180,l=e+o/2,s=n+o/2,c=Math.sqrt(o*o+o*o)/2,u=l-c*Math.cos(i),m=s-c*Math.sin(i),f=l+c*Math.cos(i),d=s+c*Math.sin(i);return {x1:u,y1:m,x2:f,y2:d}}function Co(t,e){return e.map((n,o)=>{let{color:r,opacity:a}=Gn(n.color);return P("stop",{offset:`${n.offset}%`,stopColor:r,stopOpacity:a},`${t}-stop-${o}`)})}function h0(t,e,n,o,r,a){let i=l0(e.stops,e.angle??0,n,o,r),l=i.wedges.map((s,c)=>P("path",{d:s.d,"data-arc":`${s.from} ${s.sweep}`,fill:s.color,fillOpacity:s.opacity,shapeRendering:s.opacity===void 0?void 0:"crispEdges"},`${t}-w-${c}`));return P("pattern",{"data-qrdx-conic":`${$(n)} ${$(o)}`,height:$(a),id:t,patternUnits:"userSpaceOnUse",width:$(a),x:0,y:0,children:i.opacity===void 0?l:P("g",{opacity:i.opacity,children:l})},t)}function ap(t="center"){let[e,n]=t.split("-"),o=t==="center"?"center":e,r=n??(e==="left"||e==="right"?e:"center");return {x:r==="left"?0:r==="right"?1:.5,y:o==="top"?0:o==="bottom"?1:.5}}var ip=["xMin","xMid","xMax"],sp=["YMin","YMid","YMax"];function p0(t,e,n){let o=e.scale??1,r=e.fit==="tile",a=r?n/4*o:n,i=e.underlay?Gn(e.underlay):null,l=r?a:n*o,s=ap(e.position),c=r?0:s.x*(n-l),u=r?0:s.y*(n-l),m=r?"xMidYMid slice":`${ip[s.x*2]??"xMid"}${sp[s.y*2]??"YMid"} ${e.fit==="contain"?"meet":"slice"}`;return xt("pattern",{height:$(a),id:t,patternUnits:"userSpaceOnUse",width:$(a),x:0,y:0,children:[i&&P("rect",{fill:i.color,fillOpacity:i.opacity,height:$(a),width:$(a),x:0,y:0}),P("image",{height:$(l),href:e.src,opacity:(e.opacity??1)<1?e.opacity:void 0,preserveAspectRatio:m,width:$(l),x:$(c),y:$(u)})]},t)}var g0=(t,e)=>ji("img",[t,e]);function lp(t,e,n,o,r,a,i){let l=Lt(t);if(l.type==="solid")return null;if(l.type==="image"){let c=g0(l,i);return {id:c,element:p0(c,l,i)}}let s=ji(a,[l,e,n,o,r,...l.type==="angular"?[i]:[]]);if(l.type==="linear"){let c=l,u=c.angle??0,{x1:m,y1:f,x2:d,y2:g}=op(u,e,n,o,r);return {id:s,element:P("linearGradient",{gradientUnits:"userSpaceOnUse",id:s,x1:$(m),x2:$(d),y1:$(f),y2:$(g),children:Co(s,c.stops)},s)}}if(l.type==="radial"){let c=l,u=e+o/2,m=n+o/2,f=o/2*.97;return {id:s,element:P("radialGradient",{cx:$(u),cy:$(m),fx:$(u),fy:$(m),gradientUnits:"userSpaceOnUse",id:s,r:$(f),children:Co(s,c.stops)},s)}}return l.type==="angular"?{id:s,element:h0(s,l,e+o/2,n+o/2,o*.75,i)}:null}function So(t,e,n){let o=Lt(t);if(o.type==="solid")return null;if(o.type==="image"){let a=g0(o,e);return {id:a,element:p0(a,o,e)}}let r=ji(n,[o,e]);if(o.type==="linear"){let a=o,i=a.angle??0,{x1:l,y1:s,x2:c,y2:u}=rp(i,e);return {id:r,element:P("linearGradient",{gradientUnits:"userSpaceOnUse",id:r,x1:$(l),x2:$(c),y1:$(s),y2:$(u),children:Co(r,a.stops)},r)}}if(o.type==="radial"){let a=o,i=e/2,l=e/2,s=e/2*.97;return {id:r,element:P("radialGradient",{cx:$(i),cy:$(l),fx:$(i),fy:$(l),gradientUnits:"userSpaceOnUse",id:r,r:$(s),children:Co(r,a.stops)},r)}}return o.type==="angular"?{id:r,element:h0(r,o,e/2,e/2,e*.75,e)}:null}var wo=t=>je(t)||pi(t);function m0(t){let e=new Set,n=[];for(let o of t)o&&!e.has(o.id)&&(e.add(o.id),n.push(o.element));return n}function fe(t,e,n){if(e)return {fill:`url(#${e})`};let o=Lt(t,n),r=o.type==="solid"?o.color:o.type==="image"?o.underlay??n:n,{color:a,opacity:i}=Gn(r);return i===void 0?{fill:a}:{fill:a,fillOpacity:i}}function Ae(t,e,n,o){if(o==null)return null;let r=t.length,a=Math.floor(e*Br),i=(r+2*n)/e,l=(o.width||a)*i,s=(o.height||a)*i,c=o.x==null?r/2-l/2:o.x*i,u=o.y==null?r/2-s/2:o.y*i,m=null;if(o.excavate){let f=Math.max(0,o.padding??0)*i,d=Math.floor(c-f),g=Math.floor(u-f),h=Math.ceil(l+c+f-d),p=Math.ceil(s+u+f-g);m={x:d,y:g,w:h,h:p};}return {x:c,y:u,h:s,w:l,excavation:m}}function Et(t){let e=t.level??Kt,{imageSettings:n}=t,o=t.isOGContext&&n?.excavate&&(e==="L"||e==="M")?"Q":e;if(t.autoLevel&&n&&o!=="H"){let r=mt.QrCode.encodeText(t.value,$t[o]).getModules(),a=Ae(r,t.size??it,Rt(r.length,t.margin??ct,t.shape),n);a&&(a.excavation?a.excavation.w*a.excavation.h:a.w*a.h)/(r.length*r.length)>Ma&&(o="H");}return o}function cp(t,e,n,o){let r=e/n,a=t.w*r,i=t.h*r,l=(t.x+o)*r,s=(t.y+o)*r;return {imgWidth:a,imgHeight:i,imgLeft:l,imgTop:s}}function Cr(t){let{value:e,size:n=it,level:o=Kt,bgColor:r=dt,fgColor:a=Mt,eyeColor:i,dotColor:l,bodyPattern:s="circle",cornerEyePattern:c="gear",cornerEyeDotPattern:u="circle",margin:m=ct,isOGContext:f=false,imageSettings:d,templateId:g,customTemplate:h,customProps:p,frame:b,art:y,eyeColors:_,moduleScale:w,autoLevel:C,shape:S,eyeShapes:x,eyeGradient:M,bgRadius:R,backdrop:E,halo:v,shadow:I,frameLabelMarkers:L,partMarkers:T,...F}=t,k=On({value:e,size:n,margin:m,level:o,shape:S,autoLevel:C,isOGContext:f},d),q=Tt(b),H=q?{}:F,G=z=>q?mr(z,{size:n,frame:b,bgColor:r,svgProps:F,markLabels:L}):z,U=Et({value:e,size:n,level:o,margin:m,imageSettings:k,isOGContext:f,autoLevel:C,shape:S}),Z=mt.QrCode.encodeText(e,$t[U]),rt=Z.getModules(),W=Rt(rt.length,m,S),O=Sc(e,rt.length,m,S),N=(z,vt)=>Bi(T,z,vt),_t=Nn(R,rt.length,W,S),At=(z,vt)=>{let Yt=hi(S,z);if(!Yt){if(_t>0){let ae=$(_t*z),Wt=E?Gn(E):null;return xt(Qt,{children:[Wt&&P("rect",{"data-qrdx-look":"backdrop",fill:Wt.color,fillOpacity:Wt.opacity,height:z,width:z,x:0,y:0}),P("rect",{...vt,height:z,rx:ae,ry:ae,width:z,x:0,y:0,...N("background")})]})}return P("rect",{...vt,height:z,width:z,x:0,y:0,...N("background")})}return "circle"in Yt?P("circle",{cx:$(z/2),cy:$(z/2),...vt,r:$(z/2),...N("background")}):P("path",{d:Yt.path,...vt,...N("background")})},Fe=rt.length+W*2,Gt=Ae(rt,n,W,k),Dt=null;if(k!=null&&Gt!=null){Gt.excavation!=null&&(rt=Xi(rt,Gt.excavation));let{imgWidth:z,imgHeight:vt,imgLeft:Yt,imgTop:ae}=cp(Gt,n,Fe,W);if(f){let Wt=k.shape??"square";Dt=P("img",{alt:"Logo",src:k.src,style:{position:"absolute",left:`${$(Yt)}px`,top:`${$(ae)}px`,width:`${$(z)}px`,height:`${$(vt)}px`,...Wt!=="square"&&{borderRadius:Wt==="circle"?"50%":`${$(Math.min(z,vt)*so)}px`},...k.plate&&{backgroundColor:k.plate,padding:`${$(z*lo)}px`,boxSizing:"border-box"}}});}else Dt=co(k,{x:Yt,y:ae,w:z,h:vt}),T&&(Dt=Ne(Dt,N("logo")));}let ht=n/Fe,Q=rt.length,B=7*ht,Y=1.5*ht,pt={fgColor:bt(a,Mt),bgColor:bt(r,dt)},oe=$i(y)?Mi({art:y,modules:rt,version:Z.version,margin:W,pixelSize:ht,...pt,body:z=>Vi(z,{margin:W,pixelSize:ht,pattern:s,scale:w})}):null,Zs=oe&&T?Ne(oe,N("body")):oe,Ys=oe&&y?Ai({art:y,version:Z.version,...pt}):null,Ks=oe?null:Vi(rt,{margin:W,pixelSize:ht,pattern:s,scale:w}),Nr=O?Vi(O,{margin:0,pixelSize:ht,pattern:s,scale:w,plain:true}):null,Or=Lt(r,dt),ta=Lt(a,Mt),Js=wo(Or)?So(Or,n,"bg-color"):null,ea=wo(ta)?So(ta,n,"fg-color"):null,Jm=fe(r,Js?.id??null,dt),tl=fe(a,ea?.id??null,Mt),el=Zs?xt(Qt,{children:[Zs,Nr&&P("g",{...tl,...N("body"),children:Nr})]}):xt("g",{...tl,...N("body"),children:[Ks,Nr]}),on=W*ht,an=W*ht,sn=(Q-7+W)*ht,ln=W*ht,cn=W*ht,un=(Q-7+W)*ht,Te=bt(a,Mt),mn=z=>_?.[z]?.outer??Ys?.[z]?.outer??i,dn=z=>_?.[z]?.inner??Ys?.[z]?.inner??l,fn=(z,vt,Yt,ae,Wt)=>{let pn=Lt(z,Te);if(!wo(pn))return null;if(M==="code"&&je(pn)){let ba=JSON.stringify(pn)===JSON.stringify(ta);return So(pn,n,ba?"fg-color":Wt)}return lp(pn,vt,Yt,B,ae,Wt,n)},na=fn(mn("topLeft"),on,an,"top-left","corners-square-color-0-0"),ra=fn(mn("topRight"),sn,ln,"top-right","corners-square-color-1-0"),oa=fn(mn("bottomLeft"),cn,un,"bottom-left","corners-square-color-0-1"),aa=fn(dn("topLeft"),on,an,"top-left","corners-dot-color-0-0"),ia=fn(dn("topRight"),sn,ln,"top-right","corners-dot-color-1-0"),sa=fn(dn("bottomLeft"),cn,un,"bottom-left","corners-dot-color-0-1"),nl=fe(mn("topLeft"),na?.id??null,Te),rl=fe(mn("topRight"),ra?.id??null,Te),ol=fe(mn("bottomLeft"),oa?.id??null,Te),al=fe(dn("topLeft"),aa?.id??null,Te),il=fe(dn("topRight"),ia?.id??null,Te),sl=fe(dn("bottomLeft"),sa?.id??null,Te),hn={cornerEyePattern:c,cornerEyeDotPattern:u,eyeShapes:x},la=bo(on,an,B,ne(hn,"topLeft").outer,"top-left"),ca=go(on+B/2,an+B/2,Y,ne(hn,"topLeft").inner,"top-left"),ua=bo(sn,ln,B,ne(hn,"topRight").outer,"top-right"),ma=go(sn+B/2,ln+B/2,Y,ne(hn,"topRight").inner,"top-right"),da=bo(cn,un,B,ne(hn,"bottomLeft").outer,"bottom-left"),fa=go(cn+B/2,un+B/2,Y,ne(hn,"bottomLeft").inner,"bottom-left"),ha=yr(v,{bgColor:r}),Xn=Oi(I),ll=z=>xt(Qt,{children:[oe?null:Ks,Nr,P("path",{d:la,fillRule:z}),ca,P("path",{d:ua,fillRule:z}),ma,P("path",{d:da,fillRule:z}),fa]}),pa=null;if(ha){let{color:z}=ha;pa=P("g",{"data-qrdx-look":"halo",fill:z,stroke:z,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:$(2*ha.width*ht),children:ll("nonzero")});}let ga=null;if(Xn){let{color:z}=Gn(Xn.color);ga=P("g",{"data-qrdx-look":"shadow",fill:z,opacity:$(Xn.opacity),transform:A`translate(${Xn.dx*ht},${Xn.dy*ht})`,children:ll("evenodd")});}let td=xt(Qt,{children:[P("defs",{children:m0([Js,ea,na,ra,oa,aa,ia,sa])}),At(n,Jm),pa,ga,el,P("g",{...nl,...N("eye-outer","top-left"),children:P("path",{d:la,fillRule:"evenodd",transform:A`rotate(0,${on+B/2},${an+B/2})`})}),P("g",{...al,...N("eye-centre","top-left"),children:ca}),P("g",{...rl,...N("eye-outer","top-right"),children:P("path",{d:ua,fillRule:"evenodd",transform:A`rotate(0,${sn+B/2},${ln+B/2})`})}),P("g",{...il,...N("eye-centre","top-right"),children:ma}),P("g",{...ol,...N("eye-outer","bottom-left"),children:P("path",{d:da,fillRule:"evenodd",transform:A`rotate(0,${cn+B/2},${un+B/2})`})}),P("g",{...sl,...N("eye-centre","bottom-left"),children:fa}),Dt]}),cl=h||(g?xo(g):void 0);if(cl){let vt=wo(Or)?So(Or,300,"bg-color-template"):null,Yt=fe(r,vt?.id??null,dt),ae=xt("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[P("defs",{children:m0([vt,ea,na,ra,oa,aa,ia,sa])}),At(300,Yt),xt("g",{transform:`scale(${$(300/n,6)})`,children:[pa,ga,el,P("g",{...nl,...N("eye-outer","top-left"),children:P("path",{d:la,fillRule:"evenodd",transform:A`rotate(0,${on+B/2},${an+B/2})`})}),P("g",{...al,...N("eye-centre","top-left"),children:ca}),P("g",{...rl,...N("eye-outer","top-right"),children:P("path",{d:ua,fillRule:"evenodd",transform:A`rotate(0,${sn+B/2},${ln+B/2})`})}),P("g",{...il,...N("eye-centre","top-right"),children:ma}),P("g",{...ol,...N("eye-outer","bottom-left"),children:P("path",{d:da,fillRule:"evenodd",transform:A`rotate(0,${cn+B/2},${un+B/2})`})}),P("g",{...sl,...N("eye-centre","bottom-left"),children:fa}),Dt]})]}),Wt=300/n,ba={pixelSize:ht*Wt,url:e},ul=cl.wrapper(ae,{fgColor:a,bgColor:r,...p||{},...F},ba),ed={...ul?.props?.style||{},width:void 0,height:void 0,...H.style};return G(Ne(ul,{...H,width:n,height:n,style:ed}))}return G(P("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg",...H,children:td}))}var z5=(()=>{try{new Path2D().addPath(new Path2D);}catch{return false}return true})(),q5=t=>{let e=t.trim().replace(/^#/,"");e.length===3||e.length===4?e=e.slice(0,3).split("").map(o=>o+o).join(""):e.length===8&&(e=e.slice(0,6));let n=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:Number.parseInt(n[1],16),g:Number.parseInt(n[2],16),b:Number.parseInt(n[3],16)}:null},Qn=(t,e,n)=>{let[o,r,a]=[t,e,n].map(i=>(i/=255,i<=.03928?i/12.92:((i+.055)/1.055)**2.4));return .2126*o+.7152*r+.0722*a},d0=t=>{let e=lt(t);if(!e)return null;let n=o=>o*e.a+255*(1-e.a);return {r:n(e.r),g:n(e.g),b:n(e.b)}},W5=(t,e)=>{let n=d0(t),o=d0(e);if(!(n&&o))return 1;let r=Qn(n.r,n.g,n.b),a=Qn(o.r,o.g,o.b),i=Math.max(r,a),l=Math.min(r,a);return (i+.05)/(l+.05)},V5=t=>t>=7?{level:"AAA",warning:false,message:"Excellent contrast"}:t>=4.5?{level:"AA",warning:false,message:"Good contrast"}:t>=3?{level:"AA Large",warning:true,message:"Low contrast - may be difficult to scan"}:{level:"Fail",warning:true,message:"Poor contrast - QR code may not scan properly"};var b0=.6,up=["L","M","Q","H"];function y0(t){let e=mt.QrCode.encodeText(t.value,$t[t.level]),n=up[e.errorCorrectionLevel.ordinal]??t.level;return {code:t,cells:e.getModules(),layoutMargin:Rt(e.size,t.margin,t.shape),map:dr(e.version,n),level:n,version:e.version}}function _0(t,e){let{cells:n,map:o}=t,r=n.length,a=Ae(n,t.code.size,t.layoutMargin,e);if(!a)return null;let i=a.excavation??{x:Math.floor(a.x),y:Math.floor(a.y),w:Math.ceil(a.x+a.w)-Math.floor(a.x),h:Math.ceil(a.y+a.h)-Math.floor(a.y)},l=[];for(let c=Math.max(0,i.y);c<Math.min(r,i.y+i.h);c++)for(let u=Math.max(0,i.x);u<Math.min(r,i.x+i.w);u++)l.push(c*r+u);let s=fr(o,l);return {worst:Math.max(0,...s),correctable:o.correctable,budget:Math.floor(o.correctable*b0),level:t.level,version:t.version}}function Mo(t,e){return _0(y0(t),e)}var x0=t=>!t||t.worst<=t.budget;function mp(t,e){return x0(Mo(t,e))}function Zi(t,e,n,o){let r=e.map(l=>y0({...t,level:l})),a=l=>{let s=o(l);return r.every(c=>x0(_0(c,s)))};if(a(n))return n;let i=t.size*.005;for(let l=n-i;l>0;l-=i)if(a(l))return l;return 0}function On(t,e){if(!e)return;let n=Math.floor(t.size*Br),o=e.width||n,r=e.height||n,a=f=>{if(f===o)return e;let d=r*f/o;return {...e,width:f,height:d,...e.x!=null&&{x:e.x+(o-f)/2},...e.y!=null&&{y:e.y+(r-d)/2}}},i=t.level??Kt,l={value:t.value,size:t.size,margin:t.margin,shape:t.shape},s=f=>Et({...t,level:i,imageSettings:f}),c=f=>{let d=Zi(l,[f],o,a);return d>0?a(d):void 0},u=s(e);if(u===i)return c(i);let m=c(u);return m&&s(m)===u?m:c(i)}async function Yi(t){let{value:e,size:n=it,level:o=Kt,bgColor:r=dt,fgColor:a=Mt,margin:i=ct,imageSettings:l,eyeColor:s,dotColor:c,bodyPattern:u,cornerEyePattern:m,cornerEyeDotPattern:f,isOGContext:d,templateId:g,customTemplate:h,customProps:p,frame:b,art:y,eyeColors:_,moduleScale:w,eyeShapes:C,eyeGradient:S,bgRadius:x,backdrop:M,halo:R,shadow:E,frameLabelMarkers:v,partMarkers:I,autoLevel:L,...T}=t,F=On({value:e,size:n,margin:i,level:o,autoLevel:L},l),k=Et({value:e,size:n,level:o,margin:i,imageSettings:F,autoLevel:L}),q=mt.QrCode.encodeText(e,$t[k]).getModules(),H=q.length+i*2,G=Ae(q,n,i,F),U=null;if(F!=null&&G!=null){G.excavation!=null&&(q=Xi(q,G.excavation));let rt=F.src.startsWith("data:")?F.src:await fetch(`https://wsrv.nl/?url=${encodeURIComponent(F.src)}&w=100&h=100&encoding=base64`).then(W=>{if(!W.ok)throw new Error(`Failed to load QR logo (${W.status}): ${F.src}`);return W.text()});U={settings:{...F,src:rt},box:{x:G.x+i,y:G.y+i,w:G.w,h:G.h}};}let Z=f0(q,i);return {size:n,numCells:H,fgPath:Z,bgColor:r,fgColor:a,frame:b,svgProps:T,logo:U}}function Ki(t){let{size:e,numCells:n,fgPath:o,bgColor:r,fgColor:a,frame:i,svgProps:l,logo:s}=t,c=Tt(i),u=s?co(s.settings,s.box):P(Qt,{}),m=xt("svg",{height:e,viewBox:`0 0 ${n} ${n}`,width:e,xmlns:"http://www.w3.org/2000/svg",...c?{}:l,children:[P("path",{d:`M0,0 h${n}v${n}H0z`,fill:bt(r,dt),shapeRendering:"crispEdges"}),P("path",{d:o,fill:bt(a,Mt),shapeRendering:"crispEdges"}),u]});return c&&i?mr(m,{size:e,frame:i,bgColor:r,svgProps:l}):m}async function dp(t){return Ki(await Yi(t))}var Un={jsx:jsxRuntime.jsx,jsxs:jsxRuntime.jsxs,createElement:react.createElement,cloneElement:react.cloneElement,Fragment:react.Fragment};async function b3(t){let e=await Yi(t);return gn(Un,()=>Ki(e))}var yp=16384;var $0=t=>t*3+3&-4,Ji=(t,e)=>Math.floor((t*e+255*(255-e)+127)/255);function ts(t,e,n){if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>16384||n>16384)throw new RangeError(`BMP width and height must be whole numbers from 1 to 16384, got ${e} x ${n}`);if(t.length!==e*n*4)throw new RangeError(`Expected ${e*n*4} RGBA bytes for ${e} x ${n}, got ${t.length}`);let o=$0(e),r=o*n,a=new Uint8Array(54+r),i=new DataView(a.buffer);a[0]=66,a[1]=77,i.setUint32(2,a.length,true),i.setUint32(10,54,true),i.setUint32(14,40,true),i.setInt32(18,e,true),i.setInt32(22,n,true),i.setUint16(26,1,true),i.setUint16(28,24,true),i.setUint32(30,0,true),i.setUint32(34,r,true),i.setInt32(38,2835,true),i.setInt32(42,2835,true);for(let l=0;l<n;l++){let s=l*e*4,c=54+(n-1-l)*o;for(let u=0;u<e;u++){let m=t[s+3],f=t[s],d=t[s+1],g=t[s+2];m===255?(a[c]=g,a[c+1]=d,a[c+2]=f):(a[c]=Ji(g,m),a[c+1]=Ji(d,m),a[c+2]=Ji(f,m)),s+=4,c+=3;}}return a}function es(t){if(t.length<54||t[0]!==66||t[1]!==77)return false;let e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=e.getInt32(18,true),o=e.getInt32(22,true);return e.getUint32(2,true)===t.length&&e.getUint32(10,true)===54&&e.getUint32(14,true)===40&&n>0&&o>0&&e.getUint16(26,true)===1&&e.getUint16(28,true)===24&&e.getUint32(30,true)===0&&t.length===54+$0(n)*o}function Ro(t){let e=t.getContext("2d");if(!e)throw new Error("Could not get canvas context");let{data:n}=e.getImageData(0,0,t.width,t.height),o=ts(n,t.width,t.height);if(!es(o))throw new Error("Could not write a BMP file");return new Blob([o],{type:"image/bmp"})}var P3=(t,e,n,o)=>{let r=document.createElement("canvas");r.width=e,r.height=n;let a=r.getContext("2d");if(!a)return;a.putImageData(t,0,0);let i=r.toDataURL("image/png"),l=document.createElement("a");l.href=i,l.download=o,document.body.appendChild(l),l.click(),document.body.removeChild(l);},_p=async(t,e,n,o)=>{let{default:r}=await import('jsqr');return new Promise(a=>{t.complete?i():(t.onload=()=>i(),t.onerror=()=>a(null));function i(){let l=document.createElement("canvas");requestAnimationFrame(()=>{if(!(t.naturalWidth&&t.naturalHeight)){a(null);return}let s=t.naturalWidth/t.naturalHeight<=.33||t.naturalWidth/t.naturalHeight>=3?Math.sqrt(t.naturalWidth*t.naturalHeight/12e5):t.naturalWidth/t.naturalHeight<=.5||t.naturalWidth/t.naturalHeight>=2?Math.sqrt(t.naturalWidth*t.naturalHeight/9e5):Math.sqrt(t.naturalWidth*t.naturalHeight/64e4),c=l.getContext("2d",{willReadFrequently:true});if(!c){a(null);return}let u=[1,.8,.6,.4,.2,.1];for(let m of u){let f=Math.floor(t.naturalWidth*e*m/s),d=Math.floor(t.naturalHeight*e*m/s);l.width=f,l.height=d,c.clearRect(0,0,f,d),c.imageSmoothingEnabled=true,c.imageSmoothingQuality="high";try{c.drawImage(t,Math.floor(n),Math.floor(o),Math.floor(t.naturalWidth*e),Math.floor(t.naturalHeight*e),0,0,f,d);let g=c.getImageData(0,0,f,d);try{let h=r(g.data,f,d);if(h?.data){a(h);return}}catch(h){console.error("QR Detection error:",h);}}catch(g){console.error("Canvas drawing error:",g);}}a(null);});}})},S0=async(t,e,n=false)=>{if(!t)return "NO_QR";await new Promise(r=>setTimeout(r,100));let o=[{dx:0,dy:0,ratio:1},{dx:0,dy:t.naturalHeight*.35,ratio:.65},{dx:t.naturalWidth*.35,dy:t.naturalHeight*.35,ratio:.65},{dx:t.naturalWidth*.35,dy:0,ratio:.65},{dx:t.naturalWidth*.35/2,dy:t.naturalHeight*.35/2,ratio:.65}];for(let r of o)try{let a=await _p(t,r.ratio,r.dx,r.dy);if(a?.data)return n?a:a.data}catch(a){console.warn("QR decode error:",a);}return "NO_QR"};function v3(t,e,n){if(!(t&&e)||e.length!==4)return;let o=document.createElement("canvas");o.width=t.naturalWidth,o.height=t.naturalHeight;let r=o.getContext("2d");if(!r)return;r.drawImage(t,0,0),r.save(),r.strokeStyle="#ff0000",r.lineWidth=Math.max(5,Math.min(t.naturalWidth,t.naturalHeight)/200),r.shadowColor="transparent",r.shadowBlur=0,r.beginPath(),r.moveTo(e[0].x,e[0].y),r.lineTo(e[1].x,e[1].y),r.lineTo(e[3].x,e[3].y),r.lineTo(e[2].x,e[2].y),r.closePath(),r.stroke(),r.fillStyle="#ff0000",e.forEach((l,s)=>{r.fillRect(l.x-3,l.y-3,6,6),r.fillStyle="#ffffff",r.font="16px Arial",r.fillText(`${s}`,l.x+5,l.y-5),r.fillStyle="#ff0000";}),r.restore();let a=o.toDataURL("image/png"),i=document.createElement("a");i.href=a,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i);}var xp=256,$p=16384,Sp=128;var C0=(t,e)=>{if(!(Number.isInteger(t)&&Number.isInteger(e))||t<1||e<1||t>16384||e>16384)throw new RangeError(`GIF width and height must be whole numbers from 1 to 16384, got ${t} x ${e}`)},ns=(t,e)=>t>>6*(2-e)&63;function M0(t,e,n){C0(e,n);let o=e*n;if(t.length!==o*4)throw new RangeError(`Expected ${o*4} RGBA bytes for ${e} x ${n}, got ${t.length}`);let r=new Map,a=false,i=false,l=false;for(let b=0;b<o;b++){let y=b*4,_=t[y+3];if(_<128){a=true,i||=_>0;continue}if(i||=_<255,!l){let w=t[y]<<16|t[y+1]<<8|t[y+2];r.has(w)||(r.set(w,r.size),l=r.size>256);}}let s=a?255:256,c=!l&&r.size<=s,u=new Uint8Array(o),m,f,d;if(c){f=[];for(let b of r.keys())f.push(b>>16&255,b>>8&255,b&255);m=r.size,d=(b,y,_)=>r.get(b<<16|y<<8|_);}else {let b=wp(t,o,s);f=b.palette,m=b.palette.length/3,d=(y,_,w)=>b.bucketIndex[R0(y,_,w)];}let g=a?m:null;for(let b=0;b<o;b++){let y=b*4;t[y+3]<128?u[b]=g:u[b]=d(t[y],t[y+1],t[y+2]);}let h=m+(a?1:0),p=new Uint8Array(h*3);return p.set(f),a&&p.fill(255,m*3),{width:e,height:n,palette:p,indices:u,transparentIndex:g,colors:h,lossless:c&&!i}}var R0=(t,e,n)=>t>>2<<12|e>>2<<6|n>>2;function wp(t,e,n){let o=new Uint32Array(262144),r=new Float64Array(262144),a=new Float64Array(262144),i=new Float64Array(262144);for(let f=0;f<e;f++){let d=f*4;if(t[d+3]<128)continue;let g=t[d],h=t[d+1],p=t[d+2],b=R0(g,h,p);o[b]=o[b]+1,r[b]=r[b]+g,a[b]=a[b]+h,i[b]=i[b]+p;}let l=[];for(let f=0;f<262144;f++)o[f]>0&&l.push(f);let s=[{keys:l,pixels:l.reduce((f,d)=>f+o[d],0)}];for(;s.length<n;){let f=-1;for(let x=0;x<s.length;x++){let M=s[x];M.keys.length>1&&(f===-1||M.pixels>s[f].pixels)&&(f=x);}if(f===-1)break;let d=s[f],g=0,h=-1;for(let x of [0,1,2]){let M=255,R=0;for(let E of d.keys){let v=ns(E,x);M=Math.min(M,v),R=Math.max(R,v);}R-M>h&&(h=R-M,g=x);}let p=[...d.keys].sort((x,M)=>ns(x,g)-ns(M,g)||x-M),b=d.pixels/2,y=0,_=1;for(let x=0;x<p.length-1&&(y+=o[p[x]],_=x+1,!(y>=b));x++);let w=p.slice(0,_),C=p.slice(_),S=x=>x.reduce((M,R)=>M+o[R],0);s.splice(f,1,{keys:w,pixels:S(w)},{keys:C,pixels:S(C)});}let c=[];for(let f of s){let d=0,g=0,h=0;for(let p of f.keys)d+=r[p],g+=a[p],h+=i[p];c.push(Math.round(d/f.pixels),Math.round(g/f.pixels),Math.round(h/f.pixels));}let u=new Uint8Array(262144),m=c.length/3;for(let f of l){let d=o[f],g=r[f]/d,h=a[f]/d,p=i[f]/d,b=0,y=Number.POSITIVE_INFINITY;for(let _=0;_<m;_++){let w=g-c[_*3],C=h-c[_*3+1],S=p-c[_*3+2],x=w*w+C*C+S*S;x<y&&(y=x,b=_);}u[f]=b;}return {palette:c,bucketIndex:u}}var Cp=t=>Math.max(1,Math.ceil(Math.log2(t))),Eo=class{buffer=new Uint8Array(1024);length=0;push(...e){this.ensure(e.length);for(let n of e)this.buffer[this.length++]=n;}u16(e){this.push(e&255,e>>8&255);}ascii(e){for(let n=0;n<e.length;n++)this.push(e.charCodeAt(n));}bytes(e){this.ensure(e.length),this.buffer.set(e,this.length),this.length+=e.length;}ensure(e){if(this.length+e<=this.buffer.length)return;let n=this.buffer.length;for(;n<this.length+e;)n*=2;let o=new Uint8Array(n);o.set(this.buffer.subarray(0,this.length)),this.buffer=o;}result(){return this.buffer.slice(0,this.length)}};function Mp(t,e){let n=new Eo,o=1<<e,r=o+1,a=[],i=0,l=0,s=()=>{a.length>0&&(n.push(a.length,...a),a=[]);},c=h=>{a.push(h),a.length===255&&s();},u=(h,p)=>{for(i|=h<<l,l+=p;l>=8;)c(i&255),i>>>=8,l-=8;},m=new Int32Array(1048576),f=e+1,d=r+1;u(o,f);let g=t[0];for(let h=1;h<t.length;h++){let p=t[h],b=g<<8|p,y=m[b];if(y!==0){g=y-1;continue}u(g,f),d===4096?(u(o,f),m=new Int32Array(1048576),d=r+1,f=e+1):(d>=1<<f&&f++,m[b]=d+1,d++),g=p;}return u(g,f),u(r,f),l>0&&c(i&255),s(),n.result()}function E0(t){let{width:e,height:n,palette:o,indices:r,transparentIndex:a}=t;C0(e,n);let i=o.length/3;if(!Number.isInteger(i)||i<1||i>256)throw new RangeError(`A GIF palette holds 1 to 256 colors, got ${o.length} bytes`);if(r.length!==e*n)throw new RangeError(`Expected ${e*n} palette indices for ${e} x ${n}, got ${r.length}`);if(a!==null&&!(Number.isInteger(a)&&a>=0&&a<i))throw new RangeError(`The transparent index ${a} isn't in a palette of ${i} colors`);for(let m=0;m<r.length;m++)if(r[m]>=i)throw new RangeError(`Pixel ${m} points at color ${r[m]}, past the palette of ${i}`);let l=Cp(i),s=1<<l,c=Math.max(2,l),u=new Eo;return u.ascii("GIF89a"),u.u16(e),u.u16(n),u.push(240|l-1,0,0),u.bytes(o),u.bytes(new Uint8Array((s-i)*3)),a!==null&&u.push(33,249,4,1,0,0,a,0),u.push(44),u.u16(0),u.u16(0),u.u16(e),u.u16(n),u.push(0),u.push(c),u.bytes(Mp(r,c)),u.push(0),u.push(59),u.result()}function rs(t,e,n){let o=M0(t,e,n);return {file:E0(o),image:o}}function os(t){let{palette:e,indices:n,transparentIndex:o}=t,r=new Uint8ClampedArray(n.length*4);for(let a=0;a<n.length;a++){let i=n[a],l=a*4;r[l]=e[i*3],r[l+1]=e[i*3+1],r[l+2]=e[i*3+2],r[l+3]=i===o?0:255;}return r}var w0="GIF89a";function as(t){if(t.length<32)return false;for(let s=0;s<w0.length;s++)if(t[s]!==w0.charCodeAt(s))return false;let e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=e.getUint16(6,true),o=e.getUint16(8,true),r=t[10];if(n<1||o<1||!(r&128))return false;let a=13+3*(1<<(r&7)+1);if(t.length<a)return false;let i=s=>{let c=s;for(;c<t.length;){let u=t[c];if(c+=1,u===0)return c;c+=u;}return -1},l=0;for(;a<t.length;){let s=t[a];if(s===59)return l===1&&a===t.length-1;if(s===33)a=i(a+2);else if(s===44){if(a+10>t.length||e.getUint16(a+5,true)!==n||e.getUint16(a+7,true)!==o||t[a+9]&128)return false;let c=t[a+10];if(c<2||c>8)return false;l+=1,a=i(a+11);}else return false;if(a===-1)return false}return false}var Mr="image/gif",Po=class extends Error{constructor(e){super(e),this.name="GIFScanError";}},Ao=255;function A0(t){let e=new Uint8ClampedArray(t.length);for(let n=0;n<t.length;n+=4){let o=t[n+3];for(let r=0;r<3;r++)e[n+r]=Math.round((t[n+r]*o+Ao*(Ao-o))/Ao);e[n+3]=Ao;}return e}function P0(t,e,n){let o=Uint8ClampedArray.from(e.data),r=t(o,e.width,e.height,{inversionAttempts:"dontInvert"});if(!r)return false;if(r.data===n)return true;try{return new TextDecoder().decode(Uint8Array.from(r.binaryData))===n}catch{return false}}async function Rp(t,e,n){let{width:o,height:r}=t,a=A0(t.data),i=A0(e.data);if(e.width===o&&e.height===r&&a.every((c,u)=>c===i[u]))return;let l;try{l=(await import('jsqr')).default;}catch{throw new Po("This design uses more colors than a GIF holds (256), and the reduced image could not be checked because jsqr is not available. Download a PNG instead.")}if(!P0(l,{data:a,width:o,height:r},n))return;if(!P0(l,{data:i,width:e.width,height:e.height},n))throw new Po("This design uses more colors than a GIF holds (256), and the reduced image would not scan. Download a PNG instead.")}async function Ep(t,e){let{file:n,image:o}=rs(t.data,t.width,t.height);if(!as(n))throw new Error("Could not write a GIF file");return e!==void 0&&!o.lossless&&await Rp(t,{data:os(o),width:t.width,height:t.height},e),{file:n,colors:o.colors,lossless:o.lossless}}async function vo(t,e){let n=t.getContext("2d");if(!n)throw new Error("Could not get canvas context");let{data:o}=n.getImageData(0,0,t.width,t.height),{file:r}=await Ep({data:o,width:t.width,height:t.height},e);return new Blob([r],{type:Mr})}var Io=[16,32,48,256],en="image/vnd.microsoft.icon",tn=256,is=64,Rr=6,Er=16,Ap=[137,80,78,71,13,10,26,10],Pp=16,v0=20,vp=32,I0=t=>t.length>=v0+4&&Ap.every((e,n)=>t[n]===e),L0=t=>{let e=new DataView(t.buffer,t.byteOffset,t.byteLength);return {width:e.getUint32(Pp),height:e.getUint32(v0)}};function ss(t){if(t.length<1||t.length>is)throw new RangeError(`An ICO holds 1 to ${is} images, got ${t.length}`);for(let{width:i,height:l,png:s}of t){let c=m=>Number.isInteger(m)&&m>=1&&m<=tn;if(!(c(i)&&c(l)))throw new RangeError(`ICO images must be whole numbers from 1 to ${tn} px, got ${i} x ${l}`);if(!I0(s))throw new RangeError("Every ICO image must be a PNG file");let u=L0(s);if(u.width!==i||u.height!==l)throw new RangeError(`An ICO image says ${i} x ${l} but its PNG is ${u.width} x ${u.height}`)}let e=Rr+Er*t.length,n=t.reduce((i,l)=>i+l.png.length,0),o=new Uint8Array(e+n),r=new DataView(o.buffer);r.setUint16(0,0,true),r.setUint16(2,1,true),r.setUint16(4,t.length,true);let a=e;return t.forEach(({width:i,height:l,png:s},c)=>{let u=Rr+Er*c;o[u]=i===tn?0:i,o[u+1]=l===tn?0:l,o[u+2]=0,o[u+3]=0,r.setUint16(u+4,1,true),r.setUint16(u+6,vp,true),r.setUint32(u+8,s.length,true),r.setUint32(u+12,a,true),o.set(s,a),a+=s.length;}),o}function ls(t){if(t.length<Rr+Er)return false;let e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=e.getUint16(4,true);if(e.getUint16(0,true)!==0||e.getUint16(2,true)!==1||n<1||n>is||t.length<Rr+Er*n)return false;for(let o=0;o<n;o++){let r=Rr+Er*o,a=t[r]||tn,i=t[r+1]||tn,l=e.getUint32(r+8,true),s=e.getUint32(r+12,true);if(s+l>t.length)return false;let c=t.subarray(s,s+l);if(!I0(c))return false;let u=L0(c);if(u.width!==a||u.height!==i)return false}return true}var k0="data:image/png;base64,";function Ip(t){let e=t.toDataURL("image/png");if(!e.startsWith(k0))throw new Error("This browser can't write a PNG from a canvas");let n=atob(e.slice(k0.length)),o=new Uint8Array(n.length);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r);return o}function cs(t){let e=ss(t.map(n=>({width:n.width,height:n.height,png:Ip(n)})));if(!ls(e))throw new Error("Could not write an ICO file");return new Blob([e],{type:en})}function F0(t){return cs([t])}var Lp=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),kp=new Map([["className","class"],["tabIndex","tabindex"],["dir","dir"],["role","role"],["viewBox","viewBox"],["width","width"],["height","height"],["xlinkActuate","xlink:actuate"],["xlinkArcrole","xlink:arcrole"],["xlinkRole","xlink:role"],["xlinkShow","xlink:show"],["xlinkTitle","xlink:title"],["xlinkType","xlink:type"],["xmlBase","xml:base"],["xmlLang","xml:lang"],["xmlSpace","xml:space"]]),Fp=new Set(["children","dangerouslySetInnerHTML","key","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","ref"]),Tp=new Set(["inert","allowFullScreen","async","autoPlay","controls","credentialless","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"]),Np=new Set(["autoFocus","multiple","muted"]),Op=new Set(["contentEditable","spellCheck","draggable","value","autoReverse","externalResourcesRequired","focusable","preserveAlpha"]),Dp=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" ")),T0=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",Bp=new RegExp(`^[${T0}][${T0}\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Lo=/^[a-zA-Z][a-zA-Z:_.\-\d]*$/,Gp=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i,Qp="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')",Up=t=>Gp.test(t)?Qp:t,O0=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Hp=/["'&<>]/;function us(t){if(!Hp.test(t))return t;let e="",n=0;for(let o=0;o<t.length;o++){let r;switch(t.charCodeAt(o)){case 34:r=""";break;case 38:r="&";break;case 39:r="'";break;case 60:r="<";break;case 62:r=">";break;default:continue}e+=t.slice(n,o)+r,n=o+1;}return e+t.slice(n)}var he=t=>typeof t=="function"||typeof t=="symbol",N0=new Map,zp=t=>{let e=N0.get(t);return e===void 0&&(e=t.replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^ms-/,"-ms-"),N0.set(t,e)),e};function qp(t){if(typeof t=="string")return t;if(typeof t!="object"||t===null)return "";let e="";for(let n of Object.keys(t)){let o=t[n];if(o==null||typeof o=="boolean"||o==="")continue;let r;if(n.startsWith("--"))r=`${n}:${`${o}`.trim()}`;else {let a=typeof o=="number"?o===0||Dp.has(n)?`${o}`:`${o}px`:`${o}`.trim();r=`${zp(n)}:${a}`;}e=e?`${e};${r}`:r;}return e}function Hn(t,e){if(e==null||Fp.has(t))return null;let n=kp.get(t);if(n!==void 0)return he(e)||typeof e=="boolean"?null:{name:n,value:`${e}`};switch(t){case "style":{let r=qp(e);return r?{name:"style",value:r}:null}case "src":case "href":case "action":case "formAction":case "xlinkHref":return (t==="src"||t==="href")&&e===""||he(e)||typeof e=="boolean"?null:{name:t==="xlinkHref"?"xlink:href":t,value:Up(`${e}`)};case "capture":case "download":return e===true?{name:t,value:""}:e===false||he(e)?null:{name:t,value:`${e}`};case "cols":case "rows":case "size":case "span":return he(e)||Number.isNaN(Number(e))||!(e>=1)?null:{name:t,value:`${e}`};case "rowSpan":case "start":return he(e)||Number.isNaN(Number(e))?null:{name:t,value:`${e}`};}if(Np.has(t))return e&&!he(e)?{name:t.toLowerCase(),value:""}:null;if(Op.has(t))return he(e)?null:{name:t,value:`${e}`};if(Tp.has(t))return e&&!he(e)?{name:t,value:""}:null;if(t.length>2&&(t[0]==="o"||t[0]==="O")&&(t[1]==="n"||t[1]==="N"))return null;let o=Lp.get(t)??t;if(!Bp.test(o)||he(e))return null;if(typeof e=="boolean"){let r=o.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-")return null}return {name:o,value:`${e}`}}var D0="http://www.w3.org/2000/svg",B0="http://www.w3.org/1999/xhtml",Wp="http://www.w3.org/1999/xlink",Vp="http://www.w3.org/XML/1998/namespace",Xp="http://www.w3.org/2000/xmlns/";function jp(t,e,n){e==="xmlns"||e.startsWith("xmlns:")?t.setAttributeNS(Xp,e,n):e.startsWith("xlink:")?t.setAttributeNS(Wp,e,n):e.startsWith("xml:")?t.setAttributeNS(Vp,e,n):t.setAttribute(e,n);}function Ar(t,e,n,o){if(e==null||typeof e=="boolean")return;if(typeof e=="string"||typeof e=="number"||typeof e=="bigint"){t.appendChild(o.createTextNode(`${e}`));return}if(Array.isArray(e)){for(let s of e)Ar(t,s,n,o);return}if(!Oe(e))throw new TypeError("qrdx: can't render this value as DOM nodes");let{type:r,props:a}=e;if(bn(r)){Ar(t,a.children,n,o);return}if(typeof r=="function"){Ar(t,r(a),n,o);return}if(!Lo.test(r))throw new TypeError(`qrdx: invalid element name: ${r}`);let i=r==="svg"?D0:n,l=o.createElementNS(i,r);for(let s of Object.keys(a)){let c=Hn(s,a[s]);c&&jp(l,c.name,c.value);}Ar(l,a.children,i===D0&&r==="foreignObject"?B0:i,o),t.appendChild(l);}function ms(t,e=document){let n=e.createDocumentFragment();return Ar(n,t,B0,e),n}function nn(t){if(t==null||typeof t=="boolean")return "";if(typeof t=="string")return us(t);if(typeof t=="number"||typeof t=="bigint")return `${t}`;if(Array.isArray(t)){let e="";for(let n of t)e+=nn(n);return e}if(!Oe(t))throw new TypeError("qrdx: can't render this value as SVG markup");return Zp(t)}function Zp(t){let{type:e,props:n}=t;if(bn(e))return nn(n.children);if(typeof e=="function")return nn(e(n));if(!Lo.test(e))throw new TypeError(`qrdx: invalid element name: ${e}`);let o=`<${e}`;for(let i of Object.keys(n)){let l=Hn(i,n[i]);l&&(o+=` ${l.name}="${us(l.value)}"`);}if(O0.has(e))return `${o}/>`;let r=n.dangerouslySetInnerHTML?.__html,a=r==null?nn(n.children):`${r}`;return `${o}>${a}</${e}>`}function ds(t){return nn(Cr(t))}function Yp(t,e=document){return ms(Cr(t),e).firstChild}var Kp=16384;var fs=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Jp=8,hs=class{buffer;position=0;bits=0;used=0;constructor(e){this.buffer=new Uint8Array(Math.max(e,64));}write(e,n){if(n!==0)for(this.bits|=e<<this.used,this.used+=n;this.used>=8;){if(this.position===this.buffer.length){let o=new Uint8Array(this.buffer.length*2);o.set(this.buffer),this.buffer=o;}this.buffer[this.position++]=this.bits&255,this.bits>>>=8,this.used-=8;}}finish(){return this.used>0&&this.write(0,8-this.used),this.buffer.subarray(0,this.position)}};function q0(t,e){let n=new Uint8Array(t.length),o=[];for(let c=0;c<t.length;c++)(t[c]??0)>0&&o.push(c);if(o.length===0)return n;if(o.length===1)return n[o[0]]=1,n;let r=o.length,a=2*r-1,i=new Float64Array(a),l=new Int32Array(a),s=new Uint8Array(a);for(let c=1;;c*=2){for(let h=0;h<r;h++)i[h]=Math.max(t[o[h]]??0,c);let u=Array.from({length:r},(h,p)=>p).sort((h,p)=>i[h]-i[p]||h-p),m=0,f=r,d=h=>m<r&&(f>=h||i[u[m]]<=i[f])?u[m++]:f++;for(let h=r;h<a;h++){let p=d(h),b=d(h);i[h]=i[p]+i[b],l[p]=h,l[b]=h;}s[a-1]=0;let g=0;for(let h=a-2;h>=0;h--){let p=s[l[h]]+1;s[h]=p,h<r&&p>g&&(g=p);}if(g<=e){for(let h=0;h<r;h++)n[o[h]]=s[h];return n}}}function tg(t,e){let n=0;for(let o=0;o<e;o++)n=n<<1|t>>o&1;return n}function W0(t){let e=new Uint16Array(16),n=0;for(let l of t)l>0&&(e[l]=e[l]+1,n++);let o=new Uint16Array(16),r=0;for(let l=1;l<=15;l++)r=r+e[l-1]<<1,o[l]=r;let a=new Uint16Array(t.length),i=new Uint8Array(t.length);return t.forEach((l,s)=>{if(l===0)return;let c=o[l];o[l]=c+1,a[s]=tg(c,l),i[s]=n===1?0:l;}),{lengths:t,codes:a,emitted:i}}function rn(t,e,n){t.write(e.codes[n],e.emitted[n]);}function eg(t){let e=[],n=a=>e.push({code:a,extra:0,extraBits:0}),o=Jp,r=0;for(;r<t.length;){let a=t[r],i=1;for(;r+i<t.length&&t[r+i]===a;)i++;r+=i;let l=i;if(a===0){for(;l>0;)if(l<3)for(;l>0;l--)n(0);else if(l<=10)e.push({code:17,extra:l-3,extraBits:3}),l=0;else {let s=Math.min(l,138);e.push({code:18,extra:s-11,extraBits:7}),l-=s;}continue}for(a!==o&&(n(a),o=a,l--);l>0;)if(l<3)for(;l>0;l--)n(a);else {let s=Math.min(l,6);e.push({code:16,extra:s-3,extraBits:2}),l-=s;}}return e}function ng(t,e){let n=[];if(e.forEach((l,s)=>{l>0&&n.push(s);}),n.length<=2&&n.every(l=>l<256)){let[l=0,s]=n;t.write(1,1),t.write(n.length===2?1:0,1),l<2?(t.write(0,1),t.write(l,1)):(t.write(1,1),t.write(l,8)),s!==void 0&&t.write(s,8);return}let o=eg(e),r=new Uint32Array(19);for(let l of o)r[l.code]=r[l.code]+1;let a=W0(q0(r,7)),i=fs.length;for(;i>4&&a.lengths[fs[i-1]]===0;)i--;t.write(0,1),t.write(i-4,4);for(let l=0;l<i;l++)t.write(a.lengths[fs[l]],3);t.write(0,1);for(let l of o)rn(t,a,l.code),t.write(l.extra,l.extraBits);}function ko(t){let e=t-1;if(e<4)return {symbol:e,extra:0,extraBits:0};let n=31-Math.clz32(e),o=e>>n-1&1,r=n-1;return {symbol:2*n+o,extra:e&(1<<r)-1,extraBits:r}}function G0(t,e,n,o){let r=0;for(;r<o&&t[e+r]===t[e+r-n];)r++;return r}function Q0(t,e,n){let o=t.length,r=0;for(;r<o;){let a=Math.min(4096,o-r),i=r>=1?G0(t,r,1,a):0,l=r>=e?G0(t,r,e,a):0;if(Math.max(i,l)>=3){l>=i?(n.copy(l,e===1?2:1),r+=l):(n.copy(i,2),r+=i);continue}n.literal(t[r]),r++;}}var U0=20;function H0(t,e,n){for(let o=0;o<n.length;o++)t[e+o]=n.charCodeAt(o);}function z0(t,e,n){t[e]=n&255,t[e+1]=n>>>8&255,t[e+2]=n>>>16&255,t[e+3]=n>>>24&255;}function gs(t,e,n){if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>16384||n>16384)throw new RangeError(`WebP images are 1 to 16384 pixels wide and high (got ${e} \xD7 ${n})`);let o=e*n;if(t.length<o*4)throw new RangeError(`Expected ${o*4} bytes of RGBA for ${e} \xD7 ${n}, got ${t.length}`);let r=new Uint32Array(o),a=false;for(let C=0;C<o;C++){let S=C*4,x=t[S],M=t[S+1],R=t[S+2],E=t[S+3];E!==255&&(a=true),r[C]=(E<<24|(x-M&255)<<16|M<<8|R-M&255)>>>0;}let i=new Uint32Array(280),l=new Uint32Array(256),s=new Uint32Array(256),c=new Uint32Array(256),u=new Uint32Array(40);Q0(r,e,{literal(C){i[C>>>8&255]++,l[C>>>16&255]++,s[C&255]++,c[C>>>24]++;},copy(C,S){i[256+ko(C).symbol]++,u[ko(S).symbol]++;}});let m=[i,l,s,c,u].map(C=>q0(C,15)),[f,d,g,h,p]=m.map(W0),b=new hs(Math.ceil(o/4)+1024);b.write(47,8),b.write(e-1,14),b.write(n-1,14),b.write(a?1:0,1),b.write(0,3),b.write(1,1),b.write(2,2),b.write(0,1),b.write(0,1),b.write(0,1);for(let C of m)ng(b,C);Q0(r,e,{literal(C){rn(b,f,C>>>8&255),rn(b,d,C>>>16&255),rn(b,g,C&255),rn(b,h,C>>>24);},copy(C,S){let x=ko(C);rn(b,f,256+x.symbol),b.write(x.extra,x.extraBits);let M=ko(S);rn(b,p,M.symbol),b.write(M.extra,M.extraBits);}});let y=b.finish(),_=y.length+(y.length&1),w=new Uint8Array(U0+_);return H0(w,0,"RIFF"),z0(w,4,w.length-8),H0(w,8,"WEBPVP8L"),z0(w,16,y.length),w.set(y,U0),w}function ps(t,e,n){return String.fromCharCode(...t.subarray(e,e+n))}function V0(t){return t.length>=12&&ps(t,0,4)==="RIFF"&&ps(t,8,4)==="WEBP"}function bs(t){if(!V0(t))return null;let e=12;for(;e+8<=t.length;){let n=ps(t,e,4);if(n==="VP8L")return "lossless";if(n==="VP8 ")return "lossy";let o=(t[e+4]|t[e+5]<<8|t[e+6]<<16|t[e+7]<<24)>>>0;e+=8+o+(o&1);}return null}function rg(t,e,n){return typeof t.toBlob!="function"?Promise.resolve(null):new Promise(o=>{try{t.toBlob(o,e,n);}catch{o(null);}})}async function Fo(t,e={}){let n=e.quality!==void 0,o=n?Math.min(1,Math.max(0,Number(e.quality))):1,r=await rg(t,"image/webp",o);if(r){let s=new Uint8Array(await r.arrayBuffer()),c=bs(s);if(c==="lossless"||n&&c==="lossy")return new Blob([s],{type:"image/webp"})}let a=t.getContext("2d");if(!a)throw new Error("Could not get canvas context");let{data:i}=a.getImageData(0,0,t.width,t.height),l=gs(i,t.width,t.height);return new Blob([l],{type:"image/webp"})}var X0=32768;async function Nt(t){let e=new Uint8Array(await t.arrayBuffer()),n="";for(let o=0;o<e.length;o+=X0)n+=String.fromCharCode(...e.subarray(o,o+X0));return `data:${t.type||"application/octet-stream"};base64,${btoa(n)}`}async function jt(t){let e={...t};if(t.imageSettings?.src)try{let u=await og(t.imageSettings.src);e={...t,imageSettings:{...t.imageSettings,src:u}};}catch{let{imageSettings:u,...m}=t;e=m;}let{hideLogo:n,url:o,logo:r,scale:a,frameLabelMarkers:i,partMarkers:l,...s}=e,c=ds({...s,templateId:e.templateId,customTemplate:e.customTemplate});return `data:image/svg+xml,${encodeURIComponent(c)}`}var og=t=>new Promise((e,n)=>{if(t.startsWith("data:")){e(t);return}let o=new Image;o.crossOrigin="anonymous",o.onload=()=>{try{let r=document.createElement("canvas");r.width=o.naturalWidth||o.width,r.height=o.naturalHeight||o.height;let a=r.getContext("2d");if(!a){n(new Error("Could not get canvas context"));return}a.drawImage(o,0,0);let i=r.toDataURL("image/png");r.remove(),e(i);}catch(r){n(new Error(`Failed to convert image to base64: ${r}`));}},o.onerror=()=>{n(new Error(`Could not load image from ${t.slice(0,100)}... Check CORS settings or use a data URL.`));},o.src=t;});async function pe(t,e,n){let o=await jt(t),r=decodeURIComponent(o.replace("data:image/svg+xml,","")),a;try{let i=new TextEncoder().encode(r),l=Array.from(i,c=>String.fromCharCode(c)).join("");a=`data:image/svg+xml;base64,${btoa(l)}`;}catch(i){throw new Error(`Failed to encode SVG for canvas conversion: ${i}`)}return new Promise((i,l)=>{let s=document.createElement("canvas"),c=s.getContext("2d");if(!c){l(new Error("Could not get canvas context"));return}let u=new Image,{width:m,height:f}=ue(t.size||it,t.frame);s.width=Math.round(m),s.height=Math.round(f);let d=setTimeout(()=>{s.remove(),l(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);u.onload=()=>{clearTimeout(d);try{if(e==="image/jpeg"&&(c.fillStyle="white",c.fillRect(0,0,s.width,s.height)),c.drawImage(u,0,0,s.width,s.height),n)i(s);else if(e==="image/webp")Fo(s).then(Nt).then(i,l).finally(()=>s.remove());else if(e==="image/bmp")Nt(Ro(s)).then(i,l).finally(()=>s.remove());else if(e===Mr)vo(s,t.value).then(Nt).then(i,l).finally(()=>s.remove());else if(e===en||e==="image/x-icon")Nt(F0(s)).then(i,l).finally(()=>s.remove());else {let g=s.toDataURL(e,1);s.remove(),i(g);}}catch(g){clearTimeout(d),s.remove(),l(new Error(`Failed to draw SVG to canvas: ${g}`));}},u.onerror=()=>{clearTimeout(d),s.remove(),l(new Error("Could not load SVG"));},u.src=a;})}var j0=["gradientUnits","gradientTransform","spreadMethod"],ag={linear:["x1","y1","x2","y2"],radial:["cx","cy","r","fx","fy","fr"]},ig={r:0,g:0,b:0,a:1};function Z0(t,e){for(let n of (t.attrs.style??"").split(";")){let[o,...r]=n.split(":");if(o?.trim()===e)return r.join(":").trim()}return t.attrs[e]}function ys(t){return t.name==="linearGradient"?"linear":t.name==="radialGradient"?"radial":null}function sg(t){let e=[],n=0;for(let o of t.children){if(o.name!=="stop")continue;let r=(o.attrs.offset??"0").trim(),a=Number.parseFloat(r),i=Number.isFinite(a)?r.endsWith("%")?a/100:a:0;n=Math.max(n,Math.min(Math.max(i,0),1));let l=Z0(o,"stop-color")??"#000000",s=lt(l==="currentColor"?"#000000":l)??ig,c=Number.parseFloat(Z0(o,"stop-opacity")??"1");e.push({offset:n,color:Number.isFinite(c)?{...s,a:s.a*Math.min(Math.max(c,0),1)}:s});}return e}function To(t){let e=new Map,n=r=>{let a=r.attrs.id;ys(r)&&a&&!e.has(a)&&e.set(a,r);for(let i of r.children)n(i);};n(t);let o=new Map;for(let[r,a]of e){let i=ys(a),l={},s=[],c=new Set,u=a;for(;u&&!c.has(u);){c.add(u);let m=ys(u)===i?[...j0,...ag[i]]:j0;for(let d of m){let g=u.attrs[d];l[d]===void 0&&g!==void 0&&(l[d]=g);}s.length===0&&(s=sg(u));let f=u.attrs.href??u.attrs["xlink:href"];u=f?.startsWith("#")?e.get(f.slice(1)):void 0;}o.set(r,{kind:i,attrs:l,stops:s});}return o}function _s(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(m,f)=>{e=Math.min(e,m),o=Math.max(o,m),n=Math.min(n,f),r=Math.max(r,f);},i=(m,f,d,g)=>{let h=-m+3*f-3*d+g,p=2*(m-2*f+d),b=f-m;if(Math.abs(h)<1e-12)return Math.abs(p)<1e-12?[]:[-b/p];let y=p*p-4*h*b;if(y<0)return [];let _=Math.sqrt(y);return [(-p+_)/(2*h),(-p-_)/(2*h)]},l=(m,f,d,g,h)=>{let p=1-m;return p*p*p*f+3*p*p*m*d+3*p*m*m*g+m**3*h},s=0,c=0,u=[0,0];for(let m of t)if(m.op==="M"&&(u=[m.x,m.y]),m.op==="M"||m.op==="L")a(m.x,m.y),s=m.x,c=m.y;else if(m.op==="C"){a(m.x,m.y);for(let f of [...i(s,m.x1,m.x2,m.x),...i(c,m.y1,m.y2,m.y)])f>0&&f<1&&a(l(f,s,m.x1,m.x2,m.x),l(f,c,m.y1,m.y2,m.y));s=m.x,c=m.y;}else [s,c]=u;return Number.isFinite(e)?{x:e,y:n,width:o-e,height:r-n}:null}var lg=t=>t[0]*t[3]-t[1]*t[2];function Pe(t){let e=lg(t);if(!Number.isFinite(e)||Math.abs(e)<1e-12)return null;let[n,o,r,a,i,l]=t;return [a/e,-o/e,-r/e,n/e,(r*l-a*i)/e,(o*i-n*l)/e]}function K0(t,e,n){let{kind:o,attrs:r,stops:a}=t,i=a[0],l=a.at(-1);if(!(i&&l)||a.every(S=>S.color.a===0))return null;if(a.length===1)return i.color;let s=r.gradientUnits==="userSpaceOnUse",c=Sn;if(!s){let S=_s(e);if(!S||S.width<=0||S.height<=0)return null;c=[S.width,0,0,S.height,S.x,S.y];}let u=ut(c,Ut(r.gradientTransform));if(!Pe(u))return l.color;let[m,f]=n,d=Math.sqrt((m*m+f*f)/2),g=(S,x)=>{let M=Number.parseFloat(S);return Number.isFinite(M)?S.trim().endsWith("%")?M/100*(s?x:1):M:null},h=(S,x,M)=>g(r[S]??x,M)??g(x,M)??0;if(o==="linear"){let S=[h("x1","0%",m),h("y1","0%",f),h("x2","100%",m),h("y2","0%",f)],[x,M,R,E]=S;return x===R&&M===E?l.color:{kind:o,coords:S,matrix:u,stops:a}}let p=h("cx","50%",m),b=h("cy","50%",f),y=h("r","50%",d),_=r.fx===void 0?p:h("fx","50%",m),w=r.fy===void 0?b:h("fy","50%",f),C=Math.max(0,h("fr","0%",d));return y<0?null:y===0?l.color:{kind:o,coords:[_,w,C,p,b,y],matrix:u,stops:a}}function No(t){return t.map(e=>$(e,6)).join(" ")}function cg(t,e){return (e==="cmyk"?we(t.r,t.g,t.b):[t.r/255,t.g/255,t.b/255]).map(o=>$(o,4)).join(" ")}var Y0=(t,e)=>`<< /FunctionType 2 /Domain [0 1] /C0 [${t}] /C1 [${e}] /N 1 >>`;function ug(t,e){let n=[],o=t.map(l=>K(l.offset,4)),r=t.map(l=>cg(l.color,e)),a=o[0],i=o.at(-1);if(a>0){let l=r[0];n.push({from:0,to:a,c0:l,c1:l});}for(let l=0;l+1<t.length;l++){let s=o[l],c=o[l+1];c>s&&n.push({from:s,to:c,c0:r[l],c1:r[l+1]});}if(i<1){let l=r.at(-1);n.push({from:i,to:1,c0:l,c1:l});}if(n.length===1){let[l]=n;return Y0(l.c0,l.c1)}return ["<< /FunctionType 3 /Domain [0 1]",`/Functions [${n.map(l=>Y0(l.c0,l.c1)).join(" ")}]`,`/Bounds [${n.slice(1).map(l=>$(l.from,4)).join(" ")}]`,`/Encode [${n.map(()=>"0 1").join(" ")}] >>`].join(" ")}function Oo(t,e){return [`<< /ShadingType ${t.kind==="linear"?2:3}`,`/ColorSpace /Device${e==="cmyk"?"CMYK":"RGB"}`,`/Coords [${t.coords.map(n=>$(n,6)).join(" ")}]`,`/Function ${ug(t.stops,e)}`,"/Extend [true true] >>"].join(" ")}function mg(t,e){if(t.op==="Z")return t;if(t.op==="C"){let[r,a]=V(e,t.x1,t.y1),[i,l]=V(e,t.x2,t.y2),[s,c]=V(e,t.x,t.y);return {op:"C",x1:r,y1:a,x2:i,y2:l,x:s,y:c}}let[n,o]=V(e,t.x,t.y);return {op:t.op,x:n,y:o}}function Bo(t){let e={round:1,bevel:2}[t.strokeLinejoin?.trim()??""],n={round:1,square:2}[t.strokeLinecap?.trim()??""];return {join:e??0,cap:n??0}}var J0={r:255,g:255,b:255,a:1},dg=/^url\(\s*#bg-color-/,Do=/^url\(\s*#([^)\s]+)\s*\)/,fg=new Set(["defs","clipPath","mask","pattern","linearGradient","radialGradient","symbol","title","desc","metadata","style","script","use","foreignObject"]);function j(t,e){let n=t.attrs.style;if(n)for(let o of n.split(";")){let[r,...a]=o.split(":");if(r?.trim()===e)return a.join(":").trim()}return t.attrs[e]}function X(t,e,n=0){if(t===void 0||t==="")return n;let o=Number.parseFloat(t);return Number.isNaN(o)?n:t.trim().endsWith("%")?o/100*e:o}function Pr(t,e){if((t.name==="linearGradient"||t.name==="radialGradient")&&t.attrs.id){let n=t.children.find(r=>r.name==="stop"),o=n&&(j(n,"stop-color")??"#000000");o&&e.set(t.attrs.id,o);}for(let n of t.children)Pr(n,e);return e}function vr(t,e){if(t.name==="image"){let n=t.attrs.href??t.attrs["xlink:href"];n&&e.add(n);}for(let n of t.children)vr(n,e);return e}function Go(t){return /^data:image\/png[;,]/i.test(t)?"PNG":/^data:image\/jpe?g[;,]/i.test(t)?"JPEG":null}async function Qo(t){return typeof document>"u"||typeof Image>"u"?null:await new Promise(e=>{let n=new Image;n.crossOrigin="anonymous",n.onload=()=>{let o=document.createElement("canvas"),r=Math.max(n.naturalWidth||512,n.naturalHeight||512),a=Math.min(1024/r,4);o.width=Math.round((n.naturalWidth||512)*a),o.height=Math.round((n.naturalHeight||512)*a);let i=o.getContext("2d");if(!i){e(null);return}i.drawImage(n,0,0,o.width,o.height);try{e(o.toDataURL("image/png"));}catch{e(null);}},n.onerror=()=>e(null),n.src=t;})}function tm(t,e,n){let o={x:X(t.attrs.x,e[0]),y:X(t.attrs.y,e[1]),width:X(t.attrs.width,e[0]),height:X(t.attrs.height,e[1])};if(o.width<=0||o.height<=0)return null;let r=(t.attrs.preserveAspectRatio??"").trim();if(!r||r.startsWith("none")||!n||!(n.width>0&&n.height>0))return {draw:o,clip:null};let[a="xMidYMid",i="meet"]=r.split(/\s+/),l=i==="slice",s=(l?Math.max:Math.min)(o.width/n.width,o.height/n.height),c=n.width*s,u=n.height*s,m=f=>{let d=f==="x"?a.slice(0,4):a.slice(4);return d.endsWith("Min")?0:d.endsWith("Max")?1:.5};return {draw:{x:o.x+(o.width-c)*m("x"),y:o.y+(o.height-u)*m("y"),width:c,height:u},clip:l?o:null}}function em(t,e){t.name==="clipPath"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)em(n,e);return e}function nm(t,e){t.name==="pattern"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)nm(n,e);return e}function hg(t,e){let[n,o]=e,r=(a,i)=>X(t.attrs[a],i);switch(t.name){case "path":return se(t.attrs.d??"");case "rect":{let a=t.attrs.rx??t.attrs.ry,i=t.attrs.ry??t.attrs.rx;return ee(r("x",n),r("y",o),r("width",n),r("height",o),X(a,n),X(i,o))}case "circle":{let a=r("r",Math.hypot(n,o)/Math.SQRT2);return te(r("cx",n),r("cy",o),a,a)}case "ellipse":return te(r("cx",n),r("cy",o),r("rx",n),r("ry",o));default:return []}}var zn=class{gradients;shadings;clipPaths=new Map;patterns=new Map;backdrop=J0;paper=J0;background=null;onPaper=false;inConic=false;constructor(e,n=null){this.gradients=e,this.shadings=n;}resolveColor(e){if(!e||e==="none")return null;let n=Do.exec(e);if(n)return this.resolveColor(this.gradients.get(n[1]));let o=lt(e==="currentColor"?"#000000":e);return o&&o.a>0?o:null}shadedGradient(e){let n=e?Do.exec(e)?.[1]:void 0;return n?this.shadings?.get(n):void 0}resolveFill(e,n,o,r=1){if(r<=0)return null;let a=this.patternOf(e);if(a)return {pattern:a,alpha:r};let i=this.shadedGradient(e);if(i){let c=K0(i,n,o);if(!c)return null;if("coords"in c)return {gradient:c,alpha:r};let u={...c,a:c.a*r};return u.a>0?{color:u}:null}let l=this.resolveColor(e);if(!l)return null;let s={...l,a:l.a*r};return s.a>0?{color:s}:null}patternOf(e){let n=e?Do.exec(e)?.[1]:void 0,o=n?this.patterns.get(n):void 0;if(!(o?.attrs.patternUnits!=="userSpaceOnUse"||(o.attrs.patternContentUnits??"userSpaceOnUse")!=="userSpaceOnUse"||o.attrs.viewBox))return o}flatten(e){if(e.a>=1)return e;let n=this.background,o=n!==null&&Math.abs(n.r-e.r)<.5&&Math.abs(n.g-e.g)<.5&&Math.abs(n.b-e.b)<.5&&Math.abs(n.a-e.a)<.002;return $o(e,this.onPaper||o?this.paper:this.backdrop)}paintPattern(e,n,o,r){let a=_s(e);if(!a||a.width<=0||a.height<=0)return true;let[i,l]=n.viewport,s=X(o.attrs.x,i),c=X(o.attrs.y,l),u=X(o.attrs.width,i),m=X(o.attrs.height,l);if(!(u>0&&m>0))return true;let f=Ut(o.attrs.patternTransform),d=Pe(f);if(!d)return true;if(!this.beginClip(e,n.matrix,n.fillRule==="evenodd"))return false;let g=this.inConic;this.inConic=o.attrs["data-qrdx-conic"]!==void 0;try{let h=[V(d,a.x,a.y),V(d,a.x+a.width,a.y),V(d,a.x,a.y+a.height),V(d,a.x+a.width,a.y+a.height)],p=h.map(([L])=>L),b=h.map(([,L])=>L),y=Math.min(...p),_=Math.max(...p),w=Math.min(...b),C=Math.max(...b),S=Math.floor((y-s)/u),x=Math.ceil((_-s)/u)-1,M=Math.floor((w-c)/m),R=Math.ceil((C-c)/m)-1,E=(x-S+1)*(R-M+1);if(E>4096)return !0;let v=(o.attrs["data-qrdx-conic"]??"").trim().split(/\s+/).map(Number),I=ut(n.matrix,f);for(let L=M;L<=R;L++)for(let T=S;T<=x;T++){let F=s+T*u,k=c+L*m,q=ut(I,[1,0,0,1,F,k]),H={x:y-F,y:w-k,width:_-y,height:C-w},G=v.length===2&&v.every(Number.isFinite)?c0(v[0],v[1],H):null,U=E>1&&this.beginClip([{op:"M",x:0,y:0},{op:"L",x:u,y:0},{op:"L",x:u,y:m},{op:"L",x:0,y:m},{op:"Z"}],q,!1);try{let Z={matrix:q,viewport:n.viewport,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start",fillOpacity:1,opacity:r},rt=(W,O)=>{for(let N of W){if(N.name==="g"&&!N.attrs.transform){let _t=Number.parseFloat(N.attrs.opacity??"1");rt(N.children,{...O,opacity:(O.opacity??1)*(Number.isFinite(_t)?_t:1)});continue}if(G&&N.attrs["data-arc"]){let[_t,At]=N.attrs["data-arc"].split(/\s+/).map(Number);if(!u0([_t,_t+At],G))continue}this.walk(N,O);}};rt(o.children,Z);}finally{U&&this.endClip();}}}finally{this.inConic=g,this.endClip();}return true}paintBleed(e,n,o,r){if(!this.shadedGradient(o))return false;let[a,i]=this.viewportMatrix({...e,attrs:{...e.attrs,x:"0",y:"0"}},{...n,matrix:ut(n.matrix,Ut(e.attrs.transform))}),l=Pe(a);if(!l)return false;let[s,c,u,m]=r,d=[[s,c],[u,c],[u,m],[s,m]].map(([g,h])=>V(l,g,h)).map(([g,h],p)=>({op:p===0?"M":"L",x:g,y:h}));return d.push({op:"Z"}),this.paint(d,{name:"rect",attrs:{},children:[],text:""},{...n,matrix:a,viewport:i,fill:o,fillRule:"nonzero",stroke:"none"}),true}beginClip(e,n,o){return false}endClip(){}clipOf(e,n){let o=j(e,"clip-path"),r=o?Do.exec(o)?.[1]:void 0,a=r?this.clipPaths.get(r):void 0;if(!a)return null;let i=[],l=false;for(let s of a.children){let c=hg(s,n.viewport);if(c.length===0)continue;let u=Ut(s.attrs.transform),m=u[0]===1&&u[1]===0&&u[2]===0&&u[3]===1&&u[4]===0&&u[5]===0;i.push(...m?c:c.map(f=>mg(f,u))),l||=j(s,"clip-rule")==="evenodd";}return i.length>0?{segments:i,matrix:n.matrix,evenOdd:l}:null}viewportMatrix(e,n){let o=X(e.attrs.x,n.viewport[0]),r=X(e.attrs.y,n.viewport[1]),a=X(e.attrs.width,n.viewport[0],n.viewport[0]),i=X(e.attrs.height,n.viewport[1],n.viewport[1]),l=Jt(e.attrs.viewBox);if(l.length!==4||!(l[2]&&l[3]))return [ut(n.matrix,[1,0,0,1,o,r]),[a,i]];let[s,c,u,m]=l,f=a/u,d=i/m,g=o,h=r;if((e.attrs.preserveAspectRatio??"").trim()!=="none"){let p=e.attrs.preserveAspectRatio?.includes("slice")?Math.max(f,d):Math.min(f,d);g+=(a-u*p)/2,h+=(i-m*p)/2,f=p,d=p;}return [ut(n.matrix,[f,0,0,d,g-s*f,h-c*d]),[u,m]]}walk(e,n,o=false){if(o&&(this.clipPaths=em(e,new Map),this.patterns=nm(e,new Map)),fg.has(e.name)||j(e,"display")==="none"||j(e,"visibility")==="hidden")return;let r=ut(n.matrix,Ut(e.attrs.transform)),a=n.viewport;if(e.name==="svg"){let[f,d]=this.viewportMatrix(o?{...e,attrs:{...e.attrs,x:"0",y:"0"}}:e,{...n,matrix:r});r=f,a=d;}let i=j(e,"font-size"),l=Number.parseFloat(j(e,"opacity")??"1"),s=j(e,"fill-opacity"),c=s===void 0?n.fillOpacity??1:Number.parseFloat(s),u={fillOpacity:Number.isFinite(c)?Math.min(Math.max(c,0),1):1,opacity:(n.opacity??1)*(Number.isFinite(l)?Math.min(Math.max(l,0),1):1),matrix:r,viewport:a,fill:j(e,"fill")??n.fill,fillRule:j(e,"fill-rule")??n.fillRule,stroke:j(e,"stroke")??n.stroke,strokeWidth:j(e,"stroke-width")===void 0?n.strokeWidth:X(j(e,"stroke-width"),a[0],1),strokeLinejoin:j(e,"stroke-linejoin")??n.strokeLinejoin,strokeLinecap:j(e,"stroke-linecap")??n.strokeLinecap,fontSize:i===void 0?n.fontSize:X(i,16,16),fontWeight:j(e,"font-weight")??n.fontWeight,textAnchor:j(e,"text-anchor")??n.textAnchor},m=this.onPaper;(e.name==="rect"||e.name==="circle"||e.name==="path")&&dg.test(j(e,"fill")??"")&&(this.onPaper=true);try{let f=e.attrs["clip-path"]?this.clipOf(e,u):null;if(f&&this.beginClip(f.segments,f.matrix,f.evenOdd)){try{this.paintNode(e,u);}finally{this.endClip();}return}this.paintNode(e,u);}finally{this.onPaper=m;}}paintNode(e,n){let[o,r]=n.viewport,a=(i,l)=>X(e.attrs[i],l);switch(e.name){case "path":this.paint(se(e.attrs.d??""),e,n);return;case "rect":{let i=e.attrs.rx??e.attrs.ry,l=e.attrs.ry??e.attrs.rx;this.paint(ee(a("x",o),a("y",r),a("width",o),a("height",r),X(i,o),X(l,r)),e,n);return}case "circle":{let i=a("r",Math.hypot(o,r)/Math.SQRT2);this.paint(te(a("cx",o),a("cy",r),i,i),e,n);return}case "ellipse":this.paint(te(a("cx",o),a("cy",r),a("rx",o),a("ry",r)),e,n);return;case "line":this.paint([{op:"M",x:a("x1",o),y:a("y1",r)},{op:"L",x:a("x2",o),y:a("y2",r)}],e,{...n,fill:"none"});return;case "polygon":case "polyline":{let i=Jt(e.attrs.points),l=[];for(let s=0;s+1<i.length;s+=2)l.push({op:s===0?"M":"L",x:i[s],y:i[s+1]});e.name==="polygon"&&l.length>0&&l.push({op:"Z"}),this.paint(l,e,n);return}case "text":this.text(e,n);return;case "image":this.image(e,n);return;default:for(let i of e.children)this.walk(i,n);}}};var Uo=1e3;async function Ir(t){let e=await jt(ve({...t,size:t.size??it},Uo));return decodeURIComponent(e.replace("data:image/svg+xml,",""))}function xs(t){if(Tt(t.frame)){let e=We(Uo,t.frame);return e.squareEdges?e.color:null}if(t.backdrop&&t.bgRadius){let e=mt.QrCode.encodeText(t.value,$t[Et(t)]).size,n=Rt(e,t.margin??ct,t.shape);if(Nn(t.bgRadius,e,n,t.shape)>0)return bt(t.backdrop,dt)}return bt(t.bgColor,dt)}function Ho(t,e){let n=xs(t);if(!(n&&je(t.bgColor))||Tt(t.frame)||t.templateId||t.customTemplate)return n;let o=xe(e)?.children.find(a=>a.name==="rect"),r=o&&j(o,"fill");return r?.startsWith("url(")?r:n}function zo(t,e){let n={r:255,g:255,b:255,a:1},o=lt(bt(e.bgColor,dt));t.paper=n,t.background=o&&!je(e.bgColor)?o:null,t.backdrop=o?$o(o,n):n;}var qo=25.4,rm=5,om=2e3,ge=Uo,$s=5,am=2,gg=.25*(qo/72);function bg(t,e="mm"){return e==="in"?t*qo:t}function yg(t){let e=Et(t),n=mt.QrCode.encodeText(t.value,$t[e]).size;return n+Rt(n,t.margin??ct,t.shape)*2}function Wo(t,e){let n=bg(e.size,e.unit);if(!Number.isFinite(n)||n<rm||n>om)throw new Error(`Print size must be between ${rm} mm and ${om/1e3} m`);let o=Math.min(Math.max(e.bleed??0,0),20),r=n/ge,a=Tt(t.frame)?We(ge,t.frame):null,i=(a?.width??ge)*r,l=(a?.height??ge)*r,s=e.cropMarks?o+am+$s+1:o,c=yg(t);return {codeWidth:n,trimWidth:i,trimHeight:l,bleed:o,pageWidth:i+2*s,pageHeight:l+2*s,trimX:s,trimY:s,moduleSize:n/c,moduleCount:c,maxScanDistance:n*10}}var Ss=class t{pdf;internals;names=new Map;constructor(e,n){this.pdf=e,this.internals=n;}static attach(e){let n=e.internal;return typeof e.advancedAPI!="function"||typeof e.addShadingPattern!="function"||typeof n.write!="function"||typeof n.events?.subscribe!="function"?null:new t(e,n)}name(e){let n=this.names.get(e);return n||(this.names.size===0&&this.install(),n=`Sh${this.names.size}`,this.names.set(e,n)),n}install(){this.pdf.advancedAPI(e=>{e.addShadingPattern("qrdx-shadings",{});}),this.internals.events.subscribe("putShadingPatternDict",()=>{for(let[e,n]of this.names)this.internals.write(`/${n} ${e}`);});}},ws=class extends zn{pdf;cmyk;images;shadingResources;constructor(e,n,o,r,a){super(o,r?.gradients??null),this.pdf=e,this.cmyk=n,this.images=a,this.shadingResources=r?.resources??null;}setColor(e,n){let o=e==="fill"?this.pdf.setFillColor.bind(this.pdf):e==="draw"?this.pdf.setDrawColor.bind(this.pdf):this.pdf.setTextColor.bind(this.pdf);if(this.cmyk){let[r,a,i,l]=we(n.r,n.g,n.b);o(r,a,i,l);}else o(Math.round(n.r),Math.round(n.g),Math.round(n.b));}setRegistrationColor(){this.cmyk?this.pdf.setDrawColor(1,1,1,1):this.pdf.setDrawColor(0,0,0);}tracePath(e,n){let o=false;for(let r of e)if(r.op==="M"){let[a,i]=V(n,r.x,r.y);this.pdf.moveTo(a,i),o=true;}else if(r.op==="L"){let[a,i]=V(n,r.x,r.y);o?this.pdf.lineTo(a,i):(this.pdf.moveTo(a,i),o=true);}else if(r.op==="C"){let[a,i]=V(n,r.x1,r.y1),[l,s]=V(n,r.x2,r.y2),[c,u]=V(n,r.x,r.y);this.pdf.curveTo(a,i,l,s,c,u);}else o&&this.pdf.close();}shade(e,n,o){let r=this.pdf.internal,a=r.scaleFactor,i=[a,0,0,-a,0,r.pageSize.getHeight()*a],l=ut(i,ut(n.matrix,o.matrix));if(!(this.shadingResources&&Pe(l)))return;let s=this.shadingResources.name(Oo(o,this.cmyk?"cmyk":"rgb"));this.pdf.saveGraphicsState(),this.tracePath(e,n.matrix),this.pdf.clip(n.fillRule==="evenodd"?"evenodd":void 0),this.pdf.discardPath(),r.write(`${No(l)} cm /${s} sh`),this.pdf.restoreGraphicsState();}beginClip(e,n,o){return this.pdf.saveGraphicsState(),this.tracePath(e,n),this.pdf.clip(o?"evenodd":void 0),this.pdf.discardPath(),true}endClip(){this.pdf.restoreGraphicsState();}withAlpha(e,n,o){if(e>=1&&n>=1){o();return}this.pdf.saveGraphicsState();let r=this.pdf.GState;this.pdf.setGState(new r({opacity:e,"stroke-opacity":n}));try{o();}finally{this.pdf.restoreGraphicsState();}}opaqueGradient(e,n){let o=e.stops[0]?.color.a??1;return e.stops.every(a=>Math.abs(a.color.a-o)<.002)?{gradient:{...e,stops:e.stops.map(a=>({...a,color:{...a.color,a:1}}))},alpha:o*n}:{gradient:{...e,stops:e.stops.map(a=>({...a,color:this.flatten({...a.color,a:a.color.a*n})}))},alpha:1}}paint(e,n,o){if(e.length===0)return;let r=o.opacity??1;if(r<=0)return;let a=this.resolveFill(o.fill,e,o.viewport,(o.fillOpacity??1)*r);if(a&&"pattern"in a)this.paintPattern(e,o,a.pattern,a.alpha);else if(a&&"gradient"in a){let{gradient:m,alpha:f}=this.opaqueGradient(a.gradient,a.alpha);this.withAlpha(f,1,()=>this.shade(e,o,m));}let i=a&&"color"in a?a.color:null,l=i&&this.inConic?this.flatten(i):i,s=o.strokeWidth>0?this.resolveColor(o.stroke):null,c=s&&{...s,a:s.a*r};if(!(l||c))return;let u=o.fillRule==="evenodd";this.withAlpha(l?.a??1,c?.a??1,()=>{l&&this.setColor("fill",l);let m=c?Bo(o):{join:0,cap:0};c&&(this.setColor("draw",c),this.pdf.setLineWidth(o.strokeWidth*wn(o.matrix)),(m.join||m.cap)&&(this.pdf.setLineJoin(m.join),this.pdf.setLineCap(m.cap))),this.tracePath(e,o.matrix),l&&c?u?this.pdf.fillStrokeEvenOdd():this.pdf.fillStroke():l?u?this.pdf.fillEvenOdd():this.pdf.fill():this.pdf.stroke(),(m.join||m.cap)&&(this.pdf.setLineJoin(0),this.pdf.setLineCap(0));});}text(e,n){let o=e.text.replace(/\s+/g," ").trim(),r=this.resolveColor(n.fill);if(!(o&&r))return;let a=wn(n.matrix),[i,l]=V(n.matrix,X(e.attrs.x,n.viewport[0]),X(e.attrs.y,n.viewport[1])),s=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600;this.pdf.setFont("helvetica",s?"bold":"normal");let c=n.fontSize*a*(72/qo);this.pdf.setFontSize(c);let u=Number.parseFloat(e.attrs["data-max-width"]??"");if(u>0){let d=u*a,g=this.pdf.getTextWidth(o);g>d&&(c*=d/g,this.pdf.setFontSize(c));}this.setColor("text",r);let m=Math.atan2(n.matrix[1],n.matrix[0]);if(Math.abs(m)>2e-4){let d=n.textAnchor==="middle"?this.pdf.getTextWidth(o)/2:n.textAnchor==="end"?this.pdf.getTextWidth(o):0;this.pdf.text(o,i-d*Math.cos(m),l-d*Math.sin(m),{angle:-m*180/Math.PI,baseline:"alphabetic"});return}let f=n.textAnchor==="middle"?"center":n.textAnchor==="end"?"right":"left";this.pdf.text(o,i,l,{align:f,baseline:"alphabetic"});}aliases=new Map;image(e,n){let o=e.attrs.href??e.attrs["xlink:href"],r=o&&(Go(o)?o:this.images.get(o)),a=r&&Go(r);if(!(r&&a))return;let i=this.aliases.get(r);i||(i=`qrdx-image-${this.aliases.size}`,this.aliases.set(r,i));let l=null;if(e.attrs.preserveAspectRatio)try{let p=this.pdf.getImageProperties(r);l={width:p.width,height:p.height};}catch{l=null;}let s=tm(e,n.viewport,l);if(!s)return;let{draw:c,clip:u}=s,[m,f]=V(n.matrix,c.x,c.y),[d,g]=V(n.matrix,c.x+c.width,c.y+c.height),h=u!==null&&this.beginClip([{op:"M",x:u.x,y:u.y},{op:"L",x:u.x+u.width,y:u.y},{op:"L",x:u.x+u.width,y:u.y+u.height},{op:"L",x:u.x,y:u.y+u.height},{op:"Z"}],n.matrix,false);try{this.withAlpha(n.opacity??1,1,()=>{this.pdf.addImage(r,a,Math.min(m,d),Math.min(f,g),Math.abs(d-m),Math.abs(g-f),i);});}finally{h&&this.endClip();}}};function _g(t,e,n){let{trimX:o,trimY:r,trimWidth:a,trimHeight:i,bleed:l}=n,s=l+am,c=o,u=o+a,m=r,f=r+i;e.setRegistrationColor(),t.setLineWidth(gg);for(let d of [c,u]){let g=d===c?-1:1;for(let h of [m,f]){let p=h===m?-1:1;t.line(d+g*s,h,d+g*(s+$s),h),t.line(d,h+p*s,d,h+p*(s+$s));}}}async function xg(t,e){return (await im(t,e)).output("dataurlstring")}async function qx(t,e){return (await im(t,e)).output("arraybuffer")}async function im(t,e){let n=Wo(t,e),o;try{({jsPDF:o}=await import('jspdf'));}catch(b){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${b})`)}let r=await Ir(t),a=xe(r);if(!a)throw new Error("Failed to render the QR code for printing");let i=new Map;for(let b of vr(a,new Set))if(!Go(b)){let y=await Qo(b);y&&i.set(b,y);}let l=new o({orientation:n.pageWidth>n.pageHeight?"landscape":"portrait",unit:"mm",format:[n.pageWidth,n.pageHeight],compress:true,floatPrecision:3});l.setProperties({title:"QR code",creator:"qrdx"});let s=To(a),c=s.size>0?Ss.attach(l):null,u=new ws(l,e.colorMode==="cmyk",Pr(a,new Map),c?{gradients:s,resources:c}:null,i);zo(u,t);let m=n.codeWidth/ge,f=X(a.attrs.width,ge,ge),d=X(a.attrs.height,ge,ge),g={matrix:ut([1,0,0,1,n.trimX,n.trimY],[m,0,0,m,0,0]),viewport:[f,d],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},h=n.bleed>0?Ho(t,r):null,p=[n.trimX-n.bleed,n.trimY-n.bleed,n.trimX+n.trimWidth+n.bleed,n.trimY+n.trimHeight+n.bleed];if(!(h&&u.paintBleed(a,g,h,p))){let b=h?u.resolveColor(h):null;b&&(u.setColor("fill",b),l.rect(n.trimX-n.bleed,n.trimY-n.bleed,n.trimWidth+2*n.bleed,n.trimHeight+2*n.bleed,"F"));}return u.walk(a,g,true),e.cropMarks&&_g(l,u,n),l}async function $g(t,e){let n=Wo(t,{size:e.size,unit:e.unit}),o=await Ir(t),r=e.unit??"mm",a=s=>`${$(r==="in"?s/qo:s)}${r}`,i=/^<svg\b[^>]*>/.exec(o)?.[0];if(!i)throw new Error("Failed to render the QR code for printing");return `<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
${i.replace(/\swidth="[^"]*"/,` width="${a(n.trimWidth)}"`).replace(/\sheight="[^"]*"/,` height="${a(n.trimHeight)}"`)}${o.slice(i.length)}`}async function
|
|
3
|
-
`,n=0);};for(let r=0;r<t.length;r+=4){let a=Math.min(4,t.length-r),i=0;for(let s=0;s<4;s++)i=i*256+(s<a?t[r+s]:0);if(i===0&&a===4){o("z");continue}let l=[];for(let s=0;s<5;s++)l.unshift(String.fromCharCode(i%85+33)),i=Math.floor(i/85);o(l.slice(0,a+1).join(""));}return `${e}~>`}var
|
|
1
|
+
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime'),schemas_js=require('./schemas.js'),framesIndex_js=require('./frames-index.js'),framesOfficial_js=require('./frames-official.js'),qrCodeCanvas_js=require('./qr-code-canvas.js');function Qt(t){return t.children}var rd=t=>t==null?null:`${t}`;function ya(t,e,n){let o=e??{},r=n;if("key"in o){let{key:a,...i}=o;a!==void 0&&(r=a),o=i;}return {type:t,props:o,key:rd(r)}}function od(t,e){let n=t;return {type:n.type,props:{...n.props,...e},key:n.key??null}}function ad(t,e,...n){let o={...e};return n.length>0&&(o.children=n.length===1?n[0]:n),ya(t,o)}var id={jsx:ya,jsxs:ya,createElement:ad,cloneElement:od,Fragment:Qt},be=id;function gn(t,e){let n=be;be=t;try{return e()}finally{be=n;}}var _a=t=>t===Qt?be.Fragment:t;function P(t,e,n){return be.jsx(_a(t),e,n)}function xt(t,e,n){return be.jsxs(_a(t),e,n)}function Dr(t,e,...n){return be.createElement(_a(t),e??null,...n)}function Ne(t,e){return be.cloneElement(t,e)}var sd=new Set([Symbol.for("react.element"),Symbol.for("react.transitional.element")]),dl=Symbol.for("react.fragment");function Oe(t){if(typeof t!="object"||t===null||Array.isArray(t))return false;let e=t;return e.$$typeof!==void 0&&!sd.has(e.$$typeof)?false:(typeof e.type=="string"||typeof e.type=="function"||e.type===dl)&&typeof e.props=="object"&&e.props!==null}var bn=t=>t===Qt||t===dl;var yn;(a=>{class t{constructor(l,s,c,u){this.version=l;this.errorCorrectionLevel=s;if(l<t.MIN_VERSION||l>t.MAX_VERSION)throw new RangeError("Version value out of range");if(u<-1||u>7)throw new RangeError("Mask value out of range");this.size=l*4+17;let m=[];for(let d=0;d<this.size;d++)m.push(false);for(let d=0;d<this.size;d++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();let f=this.addEccAndInterleave(c);if(this.drawCodewords(f),u==-1){let d=1e9;for(let g=0;g<8;g++){this.applyMask(g),this.drawFormatBits(g);let h=this.getPenaltyScore();h<d&&(u=g,d=h),this.applyMask(g);}}o(0<=u&&u<=7),this.mask=u,this.applyMask(u),this.drawFormatBits(u),this.isFunction=[];}version;errorCorrectionLevel;static encodeText(l,s){let c=a.QrSegment.makeSegments(l);return t.encodeSegments(c,s)}static encodeBinary(l,s){let c=a.QrSegment.makeBytes(l);return t.encodeSegments([c],s)}static encodeSegments(l,s,c=1,u=40,m=-1,f=true){if(!(t.MIN_VERSION<=c&&c<=u&&u<=t.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let d,g;for(d=c;;d++){let y=t.getNumDataCodewords(d,s)*8,_=r.getTotalBits(l,d);if(_<=y){g=_;break}if(d>=u)throw new RangeError("Data too long")}for(let y of [t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])f&&g<=t.getNumDataCodewords(d,y)*8&&(s=y);let h=[];for(let y of l){e(y.mode.modeBits,4,h),e(y.numChars,y.mode.numCharCountBits(d),h);for(let _ of y.getData())h.push(_);}o(h.length==g);let p=t.getNumDataCodewords(d,s)*8;o(h.length<=p),e(0,Math.min(4,p-h.length),h),e(0,(8-h.length%8)%8,h),o(h.length%8==0);for(let y=236;h.length<p;y^=253)e(y,8,h);let b=[];for(;b.length*8<h.length;)b.push(0);return h.forEach((y,_)=>b[_>>>3]|=y<<7-(_&7)),new t(d,s,b,m)}size;mask;modules=[];isFunction=[];getModule(l,s){return 0<=l&&l<this.size&&0<=s&&s<this.size&&this.modules[s][l]}getModules(){return this.modules}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2==0),this.setFunctionModule(c,6,c%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let l=this.getAlignmentPatternPositions(),s=l.length;for(let c=0;c<s;c++)for(let u=0;u<s;u++)c==0&&u==0||c==0&&u==s-1||c==s-1&&u==0||this.drawAlignmentPattern(l[c],l[u]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(l){let s=this.errorCorrectionLevel.formatBits<<3|l,c=s;for(let m=0;m<10;m++)c=c<<1^(c>>>9)*1335;let u=(s<<10|c)^21522;o(u>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,n(u,m));this.setFunctionModule(8,7,n(u,6)),this.setFunctionModule(8,8,n(u,7)),this.setFunctionModule(7,8,n(u,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,n(u,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,n(u,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,n(u,m));this.setFunctionModule(8,this.size-8,true);}drawVersion(){if(this.version<7)return;let l=this.version;for(let c=0;c<12;c++)l=l<<1^(l>>>11)*7973;let s=this.version<<12|l;o(s>>>18==0);for(let c=0;c<18;c++){let u=n(s,c),m=this.size-11+c%3,f=Math.floor(c/3);this.setFunctionModule(m,f,u),this.setFunctionModule(f,m,u);}}drawFinderPattern(l,s){for(let c=-4;c<=4;c++)for(let u=-4;u<=4;u++){let m=Math.max(Math.abs(u),Math.abs(c)),f=l+u,d=s+c;0<=f&&f<this.size&&0<=d&&d<this.size&&this.setFunctionModule(f,d,m!=2&&m!=4);}}drawAlignmentPattern(l,s){for(let c=-2;c<=2;c++)for(let u=-2;u<=2;u++)this.setFunctionModule(l+u,s+c,Math.max(Math.abs(u),Math.abs(c))!=1);}setFunctionModule(l,s,c){this.modules[s][l]=c,this.isFunction[s][l]=true;}addEccAndInterleave(l){let s=this.version,c=this.errorCorrectionLevel;if(l.length!=t.getNumDataCodewords(s,c))throw new RangeError("Invalid argument");let u=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][s],m=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][s],f=Math.floor(t.getNumRawDataModules(s)/8),d=u-f%u,g=Math.floor(f/u),h=[],p=t.reedSolomonComputeDivisor(m);for(let y=0,_=0;y<u;y++){let w=l.slice(_,_+g-m+(y<d?0:1));_+=w.length;let C=t.reedSolomonComputeRemainder(w,p);y<d&&w.push(0),h.push(w.concat(C));}let b=[];for(let y=0;y<h[0].length;y++)h.forEach((_,w)=>{(y!=g-m||w>=d)&&b.push(_[y]);});return o(b.length==f),b}drawCodewords(l){if(l.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let s=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let u=0;u<this.size;u++)for(let m=0;m<2;m++){let f=c-m,g=(c+1&2)==0?this.size-1-u:u;!this.isFunction[g][f]&&s<l.length*8&&(this.modules[g][f]=n(l[s>>>3],7-(s&7)),s++);}}o(s==l.length*8);}applyMask(l){if(l<0||l>7)throw new RangeError("Mask value out of range");for(let s=0;s<this.size;s++)for(let c=0;c<this.size;c++){let u;switch(l){case 0:u=(c+s)%2==0;break;case 1:u=s%2==0;break;case 2:u=c%3==0;break;case 3:u=(c+s)%3==0;break;case 4:u=(Math.floor(c/3)+Math.floor(s/2))%2==0;break;case 5:u=c*s%2+c*s%3==0;break;case 6:u=(c*s%2+c*s%3)%2==0;break;case 7:u=((c+s)%2+c*s%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[s][c]&&u&&(this.modules[s][c]=!this.modules[s][c]);}}getPenaltyScore(){let l=0;for(let m=0;m<this.size;m++){let f=false,d=0,g=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[m][h]==f?(d++,d==5?l+=t.PENALTY_N1:d>5&&l++):(this.finderPenaltyAddHistory(d,g),f||(l+=this.finderPenaltyCountPatterns(g)*t.PENALTY_N3),f=this.modules[m][h],d=1);l+=this.finderPenaltyTerminateAndCount(f,d,g)*t.PENALTY_N3;}for(let m=0;m<this.size;m++){let f=false,d=0,g=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][m]==f?(d++,d==5?l+=t.PENALTY_N1:d>5&&l++):(this.finderPenaltyAddHistory(d,g),f||(l+=this.finderPenaltyCountPatterns(g)*t.PENALTY_N3),f=this.modules[h][m],d=1);l+=this.finderPenaltyTerminateAndCount(f,d,g)*t.PENALTY_N3;}for(let m=0;m<this.size-1;m++)for(let f=0;f<this.size-1;f++){let d=this.modules[m][f];d==this.modules[m][f+1]&&d==this.modules[m+1][f]&&d==this.modules[m+1][f+1]&&(l+=t.PENALTY_N2);}let s=0;for(let m of this.modules)s=m.reduce((f,d)=>f+(d?1:0),s);let c=this.size*this.size,u=Math.ceil(Math.abs(s*20-c*10)/c)-1;return o(0<=u&&u<=9),l+=u*t.PENALTY_N4,o(0<=l&&l<=2568888),l}getAlignmentPatternPositions(){if(this.version==1)return [];{let l=Math.floor(this.version/7)+2,s=this.version==32?26:Math.ceil((this.version*4+4)/(l*2-2))*2,c=[6];for(let u=this.size-7;c.length<l;u-=s)c.splice(1,0,u);return c}}static getNumRawDataModules(l){if(l<t.MIN_VERSION||l>t.MAX_VERSION)throw new RangeError("Version number out of range");let s=(16*l+128)*l+64;if(l>=2){let c=Math.floor(l/7)+2;s-=(25*c-10)*c-55,l>=7&&(s-=36);}return o(208<=s&&s<=29648),s}static getNumDataCodewords(l,s){return Math.floor(t.getNumRawDataModules(l)/8)-t.ECC_CODEWORDS_PER_BLOCK[s.ordinal][l]*t.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][l]}static reedSolomonComputeDivisor(l){if(l<1||l>255)throw new RangeError("Degree out of range");let s=[];for(let u=0;u<l-1;u++)s.push(0);s.push(1);let c=1;for(let u=0;u<l;u++){for(let m=0;m<s.length;m++)s[m]=t.reedSolomonMultiply(s[m],c),m+1<s.length&&(s[m]^=s[m+1]);c=t.reedSolomonMultiply(c,2);}return s}static reedSolomonComputeRemainder(l,s){let c=s.map(u=>0);for(let u of l){let m=u^c.shift();c.push(0),s.forEach((f,d)=>c[d]^=t.reedSolomonMultiply(f,m));}return c}static reedSolomonMultiply(l,s){if(l>>>8||s>>>8)throw new RangeError("Byte out of range");let c=0;for(let u=7;u>=0;u--)c=c<<1^(c>>>7)*285,c^=(s>>>u&1)*l;return o(c>>>8==0),c}finderPenaltyCountPatterns(l){let s=l[1];o(s<=this.size*3);let c=s>0&&l[2]==s&&l[3]==s*3&&l[4]==s&&l[5]==s;return (c&&l[0]>=s*4&&l[6]>=s?1:0)+(c&&l[6]>=s*4&&l[0]>=s?1:0)}finderPenaltyTerminateAndCount(l,s,c){return l&&(this.finderPenaltyAddHistory(s,c),s=0),s+=this.size,this.finderPenaltyAddHistory(s,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(l,s){s[0]==0&&(l+=this.size),s.pop(),s.unshift(l);}static MIN_VERSION=1;static MAX_VERSION=40;static PENALTY_N1=3;static PENALTY_N2=3;static PENALTY_N3=40;static PENALTY_N4=10;static 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]];static 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]]}a.QrCode=t;function e(i,l,s){if(l<0||l>31||i>>>l)throw new RangeError("Value out of range");for(let c=l-1;c>=0;c--)s.push(i>>>c&1);}function n(i,l){return (i>>>l&1)!=0}function o(i){if(!i)throw new Error("Assertion error")}class r{constructor(l,s,c){this.mode=l;this.numChars=s;this.bitData=c;if(s<0)throw new RangeError("Invalid argument");this.bitData=c.slice();}mode;numChars;bitData;static makeBytes(l){let s=[];for(let c of l)e(c,8,s);return new r(r.Mode.BYTE,l.length,s)}static makeNumeric(l){if(!r.isNumeric(l))throw new RangeError("String contains non-numeric characters");let s=[];for(let c=0;c<l.length;){let u=Math.min(l.length-c,3);e(parseInt(l.substr(c,u),10),u*3+1,s),c+=u;}return new r(r.Mode.NUMERIC,l.length,s)}static makeAlphanumeric(l){if(!r.isAlphanumeric(l))throw new RangeError("String contains unencodable characters in alphanumeric mode");let s=[],c;for(c=0;c+2<=l.length;c+=2){let u=r.ALPHANUMERIC_CHARSET.indexOf(l.charAt(c))*45;u+=r.ALPHANUMERIC_CHARSET.indexOf(l.charAt(c+1)),e(u,11,s);}return c<l.length&&e(r.ALPHANUMERIC_CHARSET.indexOf(l.charAt(c)),6,s),new r(r.Mode.ALPHANUMERIC,l.length,s)}static makeSegments(l){return l==""?[]:r.isNumeric(l)?[r.makeNumeric(l)]:r.isAlphanumeric(l)?[r.makeAlphanumeric(l)]:[r.makeBytes(r.toUtf8ByteArray(l))]}static makeEci(l){let s=[];if(l<0)throw new RangeError("ECI assignment value out of range");if(l<128)e(l,8,s);else if(l<16384)e(2,2,s),e(l,14,s);else if(l<1e6)e(6,3,s),e(l,21,s);else throw new RangeError("ECI assignment value out of range");return new r(r.Mode.ECI,0,s)}static isNumeric(l){return r.NUMERIC_REGEX.test(l)}static isAlphanumeric(l){return r.ALPHANUMERIC_REGEX.test(l)}getData(){return this.bitData.slice()}static getTotalBits(l,s){let c=0;for(let u of l){let m=u.mode.numCharCountBits(s);if(u.numChars>=1<<m)return 1/0;c+=4+m+u.bitData.length;}return c}static toUtf8ByteArray(l){l=encodeURI(l);let s=[];for(let c=0;c<l.length;c++)l.charAt(c)!="%"?s.push(l.charCodeAt(c)):(s.push(parseInt(l.substr(c+1,2),16)),c+=2);return s}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}a.QrSegment=r;})(yn||={});(e=>{(o=>{class n{constructor(a,i){this.ordinal=a;this.formatBits=i;}ordinal;formatBits;static LOW=new n(0,1);static MEDIUM=new n(1,0);static QUARTILE=new n(2,3);static HIGH=new n(3,2)}o.Ecc=n;})(e.QrCode||={});})(yn||={});(e=>{(o=>{class n{constructor(a,i){this.modeBits=a;this.numBitsCharCount=i;}modeBits;numBitsCharCount;static NUMERIC=new n(1,[10,12,14]);static ALPHANUMERIC=new n(2,[9,11,13]);static BYTE=new n(4,[8,16,16]);static KANJI=new n(8,[8,10,12]);static ECI=new n(7,[0,0,0]);numCharCountBits(a){return this.numBitsCharCount[Math.floor((a+7)/17)]}}o.Mode=n;})(e.QrSegment||={});})(yn||={});var ut=yn;var $t={L:ut.QrCode.Ecc.LOW,M:ut.QrCode.Ecc.MEDIUM,Q:ut.QrCode.Ecc.QUARTILE,H:ut.QrCode.Ecc.HIGH},it=128,Kt="Q",mt="#FFFFFF",Mt="#000000";var ft=0;var Br=.1;var Gr=["logo","halftone"],xa={logo:["blend","badge"],halftone:["color","mono"]},jn=192,ld=["square","rounded","circle","message","message-reverse","diya","diya-reverse","rounded-triangle","leaf","drop","plus","cross-rounded","hexagon","octagon","flower","heart","squircle","dots","extra-rounded","leaf-reverse","drop-reverse"],cd=["diamond","star","banner"],ud=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse"],md=["curly"],dd=["circle","circle-large","square","diamond","circle-mixed","pacman","rounded","small-square","vertical-line","horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"],fd=["none","banner-bottom","banner-top","border","rounded-border","speech-bubble","banner-top-bottom","speech-bubble-top","chat-bubble","circle","polaroid","phone","ticket","badge","envelope","tag","menu-card","sticker","gradient-border","focus"],ie=24,$a="Scan me",Zn=.5,_n=1.5,hd=["square","rounded","circle"],pd=.1,Sa=.3,wa=.25,gd=2,Qr=.5,Ca=1,Ma=.07,bd=["square","circle","heart"],Ra=3,De=64,ye=8,Ea=.42,Be=["topLeft","topRight","bottomLeft"],Ur=.5,Aa=2,Pa=.1,va=.5,Ia=.25,Hr="#e5e7eb",_e="#d1d5db",zr=.3,La=.2,ka=.1,Fa=.4,Ta=.3,Na="#000000",yd=["corner","code"];function K(t,e=3){let n=10**e;return Math.round(t*n)/n+0}function $(t,e=3){return String(K(t,e))}function A(t,...e){let n=t[0]??"";for(let o=0;o<e.length;o++){let r=e[o];n+=(typeof r=="number"?$(r):r)+(t[o+1]??"");}return n}var _d={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},xd=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,Oa=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function Yn(t,e=Number.POSITIVE_INFINITY){if(!xd.test(t))return null;let n=[],o=0,r=()=>{for(;o<t.length&&/[\s,]/.test(t[o]);)o++;},a=()=>{r(),Oa.lastIndex=o;let s=Oa.exec(t);if(!s)return null;let c=s[0],u=c.indexOf(".");if(u>=0&&c.length-u-1>e)return null;o=Oa.lastIndex;let m=Number(c);return Number.isFinite(m)?m:null},i=()=>{r();let s=t[o];return s==="0"||s==="1"?(o++,s==="1"?1:0):null},l=()=>(r(),o<t.length&&/[0-9.+-]/.test(t[o]));for(r();o<t.length;){let s=t[o],c=s.toUpperCase(),u=_d[c];if(u===void 0||n.length===0&&c!=="M")return null;if(o++,u===0){n.push({command:s,values:[]}),r();continue}let m=s,f=true;for(;f||l();){let d=[];for(let g=0;g<u;g++){let h=c==="A"&&(g===3||g===4)?i():a();if(h===null)return null;d.push(h);}n.push({command:m,values:d}),c==="M"&&(m=s==="M"?"L":"l"),f=false;}r();}return n}function fl(t){let e=0;for(let{command:n}of t)e+=n.toUpperCase()==="A"?4:1;return e}function Da(t,e=1,n=0,o=0){let r="";for(let{command:a,values:i}of t){let l=a.toUpperCase(),s=a===l,c=s?n:0,u=s?o:0,m;switch(l){case "Z":m=[];break;case "H":m=[$(i[0]*e+c)];break;case "V":m=[$(i[0]*e+u)];break;case "A":m=[$(Math.abs(i[0])*e),$(Math.abs(i[1])*e),$(i[2]),String(i[3]),String(i[4]),$(i[5]*e+c),$(i[6]*e+u)];break;default:m=i.map((f,d)=>$(f*e+(d%2===0?c:u)));}r+=a+m.join(" ");}return r}function qr(t,e=.25){let n=[],o=[],r=[0,0],a=[0,0],i=()=>{o.length>2&&n.push(o),o=[];};for(let l of t)if(l.op==="M")i(),r=[l.x,l.y],a=r,o.push(r);else if(l.op==="L")a=[l.x,l.y],o.push(a);else if(l.op==="C"){let s=a,c=[l.x1,l.y1],u=[l.x2,l.y2],m=[l.x,l.y],f=Math.hypot(c[0]-s[0],c[1]-s[1])+Math.hypot(u[0]-c[0],u[1]-c[1])+Math.hypot(m[0]-u[0],m[1]-u[1]),d=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(f/(4*e)))));for(let g=1;g<=d;g++){let h=g/d,p=1-h;o.push([p*p*p*s[0]+3*p*p*h*c[0]+3*p*h*h*u[0]+h*h*h*m[0],p*p*p*s[1]+3*p*p*h*c[1]+3*p*h*h*u[1]+h*h*h*m[1]]);}a=m;}else i(),a=r;return i(),n}function xn(t,e){let n=[r=>r[0]-e.x0,r=>e.x1-r[0],r=>r[1]-e.y0,r=>e.y1-r[1]],o=t;for(let r of n){if(o.length===0)break;let a=o;o=[];for(let i=0;i<a.length;i++){let l=a[i],s=a[(i+a.length-1)%a.length],c=r(l),u=r(s);c>=0?(u<0&&o.push(hl(s,l,u,c)),o.push(l)):u>=0&&o.push(hl(s,l,u,c));}}return o.length>2?o:[]}function hl(t,e,n,o){let r=n/(n-o);return [t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function pl(t){return t.filter(e=>e.length>2).map(e=>`M${e.map(([n,o])=>`${$(n)} ${$(o)}`).join("L")}Z`).join("")}function Ge(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(i,l)=>{e=Math.min(e,i),n=Math.min(n,l),o=Math.max(o,i),r=Math.max(r,l);};for(let i of t)i.op==="C"?(a(i.x1,i.y1),a(i.x2,i.y2),a(i.x,i.y)):i.op!=="Z"&&a(i.x,i.y);return Number.isFinite(e)?{x0:e,y0:n,x1:o,y1:r}:null}var $d={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function yl(t){return t.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(e,n)=>{if(n[0]==="#"){let o=n[1].toLowerCase()==="x"?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return Number.isInteger(o)&&o>0&&o<=1114111&&!(o>=55296&&o<=57343)?String.fromCodePoint(o):e}return $d[n.toLowerCase()]??e})}var Sd=60,Ba=62,Ga=47,wd=61,gl=34,bl=39,Ua=/\s*/y,Cd=/[^\s/>]*/y,Md=/[^\s>]*/y,Rd=/[^\s=]*/y;function $n(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function Ed(t,e){let n=t.length,o=S=>{let x=Number.POSITIVE_INFINITY,M=-1;return R=>((R<x||M>=0&&M<R)&&(x=R,M=t.indexOf(S,R)),M)},r=o("-->"),a=o("?>"),i=o("]]>"),l=o(">"),s,c=S=>{let x=t.charCodeAt(S);if(x!==gl&&x!==bl)return S+1;let M=t.indexOf(t[S],S+1);return M<0?n:M+1},u=S=>{for(let x=S;x<n&&!s?.[x];x=c(x)){let M=t.charCodeAt(x);if(M===Ba||M===Ga&&t.charCodeAt(x+1)===Ba)return x}s??=new Uint8Array(n);for(let x=S;x<n&&!s[x];x=c(x))s[x]=1;return -1},m=-1,f=-1,d=-1,g=-1,h=S=>{let x=S+1;if(x<m||x>=f){m=x,f=$n(Cd,t,x),d=-1;for(let R=f;R>x;R--){let E=t.charCodeAt(R);if((R===f||E===gl||E===bl)&&(g=u(R),g>=0)){d=R;break}}}if(d<=x)return -1;let M=t.charCodeAt(g)===Ga;return e.open(t.slice(x,d),t.slice(d,g),M),g+(M?2:1)},p=-1,b=-1,y=-1,_=S=>{let x=S+2;if(x<p||x>=b){p=x,b=$n(Md,t,x);let M=$n(Ua,t,b);y=b>x&&t.charCodeAt(M)===Ba?M:-1;}return y},w=S=>{if(t.startsWith("<!--",S)){let x=r(S+4);if(x>=0)return x+3}if(t.startsWith("<?",S)){let x=a(S+2);if(x>=0)return x+2}if(t.startsWith("<![CDATA[",S)){let x=i(S+9);if(x>=0)return e.cdata(t.slice(S+9,x)),x+3}if(t.startsWith("<!",S)){let x=l(S+2);if(x>=0)return x+1}if(t.charCodeAt(S+1)===Ga){let x=_(S);return x<0?-1:(e.close(),x+1)}return h(S)},C=0;for(;C<n;)if(t.charCodeAt(C)===Sd){let S=w(C);C=S<0?C+1:S;}else {let S=t.indexOf("<",C),x=S<0?n:S;e.text(t.slice(C,x)),C=x;}}function Ad(t){let e={},n=0;for(;n<t.length;){let o=$n(Rd,t,n);if(o===n){n++;continue}let r=$n(Ua,t,o);if(t.charCodeAt(r)===wd){let a=$n(Ua,t,r+1),i=t[a],l=i==='"'||i==="'"?t.indexOf(i,a+1):-1;if(l>=0){e[t.slice(n,o)]=yl(t.slice(a+1,l)),n=l+1;continue}}n=o;}return e}function xe(t){let e={name:"#root",attrs:{},children:[],text:""},n=[e],o=()=>n.at(-1);Ed(t,{open(a,i,l){let s=Ad(i),c={name:a,attrs:s,children:[],text:""};o().children.push(c),l||n.push(c);},close(){n.length>1&&n.pop();},text(a){o().text+=yl(a);},cdata(a){o().text+=a;}});let r=a=>{for(let i of a.children){if(i.name==="svg")return i;let l=r(i);if(l)return l}return null};return r(e)}var Sn=[1,0,0,1,0,0];function ct(t,e){let[n,o,r,a,i,l]=t,[s,c,u,m,f,d]=e;return [n*s+r*c,o*s+a*c,n*u+r*m,o*u+a*m,n*f+r*d+i,o*f+a*d+l]}function V(t,e,n){return [t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}function wn(t){return Math.sqrt(Math.abs(t[0]*t[3]-t[1]*t[2]))}function Jt(t){return t?(t.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)??[]).map(Number):[]}function Ut(t){let e=Sn;if(!t)return e;for(let[,n,o]of t.matchAll(/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g)){let r=Jt(o),a=Sn;switch(n){case "matrix":r.length===6&&(a=r);break;case "translate":a=[1,0,0,1,r[0]??0,r[1]??0];break;case "scale":a=[r[0]??1,0,0,r[1]??r[0]??1,0,0];break;case "rotate":{let i=(r[0]??0)*Math.PI/180,l=Math.cos(i),s=Math.sin(i),[c,u]=[r[1]??0,r[2]??0];a=ct(ct([1,0,0,1,c,u],[l,s,-s,l,0,0]),[1,0,0,1,-c,-u]);break}case "skewX":a=[1,0,Math.tan((r[0]??0)*Math.PI/180),1,0,0];break;case "skewY":a=[1,Math.tan((r[0]??0)*Math.PI/180),0,1,0,0];break;}e=ct(e,a);}return e}var Qa=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function Pd(t,e,n,o,r,a,i,l,s){if(t===l&&e===s)return [];let c=Math.abs(n),u=Math.abs(o);if(c===0||u===0)return [{op:"L",x:l,y:s}];let m=r*Math.PI/180,f=Math.cos(m),d=Math.sin(m),g=(t-l)/2,h=(e-s)/2,p=f*g+d*h,b=-d*g+f*h,y=p*p/(c*c)+b*b/(u*u);y>1&&(c*=Math.sqrt(y),u*=Math.sqrt(y));let _=c*c*u*u-c*c*b*b-u*u*p*p,w=c*c*b*b+u*u*p*p,C=(a===i?-1:1)*Math.sqrt(Math.max(0,_/w)),S=C*c*b/u,x=-C*u*p/c,M=f*S-d*x+(t+l)/2,R=d*S+f*x+(e+s)/2,E=(H,G,U,Z)=>Math.atan2(H*Z-G*U,H*U+G*Z),v=E(1,0,(p-S)/c,(b-x)/u),I=E((p-S)/c,(b-x)/u,(-p-S)/c,(-b-x)/u);!i&&I>0?I-=2*Math.PI:i&&I<0&&(I+=2*Math.PI);let L=Math.max(1,Math.ceil(Math.abs(I)/(Math.PI/2)-1e-9)),T=I/L,F=4/3*Math.tan(T/4),k=(H,G)=>[M+c*f*H-u*d*G,R+c*d*H+u*f*G],q=[];for(let H=0;H<L;H++){let G=v+H*T,U=G+T,[Z,rt]=k(Math.cos(G)-F*Math.sin(G),Math.sin(G)+F*Math.cos(G)),[W,O]=k(Math.cos(U)+F*Math.sin(U),Math.sin(U)-F*Math.cos(U)),[N,_t]=H===L-1?[l,s]:k(Math.cos(U),Math.sin(U));q.push({op:"C",x1:Z,y1:rt,x2:W,y2:O,x:N,y:_t});}return q}function se(t){let e=[],n=0,o=0,r=0,a=0,i=0,l="",s=null,c=null,u=()=>{for(;n<t.length&&/[\s,]/.test(t[n]);)n++;},m=()=>{u(),Qa.lastIndex=n;let g=Qa.exec(t);return g?(n=Qa.lastIndex,Number(g[0])):null},f=()=>{u();let g=t[n];return g==="0"||g==="1"?(n++,g==="1"):null},d=g=>{let h=[];for(let p=0;p<g;p++){let b=m();if(b===null)return null;h.push(b);}return h};for(;u(),!(n>=t.length);){let g=t[n];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(g))l=g,n++;else if(!l||l==="Z"||l==="z")break;let h=l===l.toLowerCase(),p=h?o:0,b=h?r:0,y=l.toUpperCase();if(y==="Z"){e.push({op:"Z"}),o=a,r=i,s=null,c=null;continue}if(y==="A"){let S=d(3),x=f(),M=f(),R=d(2);if(!(S&&R)||x===null||M===null)break;let[E,v,I]=S,L=R[0]+p,T=R[1]+b;e.push(...Pd(o,r,E,v,I,x,M,L,T)),o=L,r=T,s=null,c=null;continue}let _={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[y]??0,w=d(_);if(!w)break;let C=w;switch(y){case "M":o=C[0]+p,r=C[1]+b,a=o,i=r,e.push({op:"M",x:o,y:r}),l=h?"l":"L",s=null,c=null;break;case "L":case "H":case "V":y!=="V"&&(o=C[0]+p),y==="V"?r=C[0]+b:y==="L"&&(r=C[1]+b),e.push({op:"L",x:o,y:r}),s=null,c=null;break;case "C":case "S":{let S,x;y==="C"?(S=[C[0]+p,C[1]+b],x=C.slice(2)):(S=s?[2*o-s[0],2*r-s[1]]:[o,r],x=C);let M=[x[0]+p,x[1]+b],R=[x[2]+p,x[3]+b];e.push({op:"C",x1:S[0],y1:S[1],x2:M[0],y2:M[1],x:R[0],y:R[1]}),[o,r]=R,s=M,c=null;break}case "Q":case "T":{let S,x;y==="Q"?(S=[C[0]+p,C[1]+b],x=[C[2]+p,C[3]+b]):(S=c?[2*o-c[0],2*r-c[1]]:[o,r],x=[C[0]+p,C[1]+b]),e.push({op:"C",x1:o+2/3*(S[0]-o),y1:r+2/3*(S[1]-r),x2:x[0]+2/3*(S[0]-x[0]),y2:x[1]+2/3*(S[1]-x[1]),x:x[0],y:x[1]}),[o,r]=x,c=S,s=null;break}}}return e}var Wr=.5522847498;function te(t,e,n,o){if(n<=0||o<=0)return [];let r=n*Wr,a=o*Wr;return [{op:"M",x:t+n,y:e},{op:"C",x1:t+n,y1:e+a,x2:t+r,y2:e+o,x:t,y:e+o},{op:"C",x1:t-r,y1:e+o,x2:t-n,y2:e+a,x:t-n,y:e},{op:"C",x1:t-n,y1:e-a,x2:t-r,y2:e-o,x:t,y:e-o},{op:"C",x1:t+r,y1:e-o,x2:t+n,y2:e-a,x:t+n,y:e},{op:"Z"}]}function ee(t,e,n,o,r=0,a=0){if(n<=0||o<=0)return [];let i=Math.min(Math.max(r,0),n/2),l=Math.min(Math.max(a,0),o/2);if(i===0||l===0)return [{op:"M",x:t,y:e},{op:"L",x:t+n,y:e},{op:"L",x:t+n,y:e+o},{op:"L",x:t,y:e+o},{op:"Z"}];let s=i*Wr,c=l*Wr,u=t+n,m=e+o;return [{op:"M",x:t+i,y:e},{op:"L",x:u-i,y:e},{op:"C",x1:u-i+s,y1:e,x2:u,y2:e+l-c,x:u,y:e+l},{op:"L",x:u,y:m-l},{op:"C",x1:u,y1:m-l+c,x2:u-i+s,y2:m,x:u-i,y:m},{op:"L",x:t+i,y:m},{op:"C",x1:t+i-s,y1:m,x2:t,y2:m-l+c,x:t,y:m-l},{op:"L",x:t,y:e+l},{op:"C",x1:t,y1:e+l-c,x2:t+i-s,y2:e,x:t+i,y:e},{op:"Z"}]}var Kn="qrdx.frame",Jn=1,tr="custom",at={minArtboard:50,maxArtboard:2e3,maxCoordinate:4e3,maxDecimals:3,maxShapes:64,maxLabels:8,maxPolygonPoints:256,maxPathLength:16e3,maxSegments:2e3,maxGradientSteps:64,maxGradientWork:16e3,maxBytes:32768,minQrShare:.5,minPadding:.04,defaultPadding:.08,maxTextLength:ie},za=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],er=.95,xl=200,qa=["frame","text","accent","background"],vd=/[\t\n\v\f\r\u0085\u2028\u2029]/g,Id=/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u115f\u1160\u17b4\u17b5\u180b-\u180f\u200b-\u200f\u202a-\u202e\u2060-\u206f\u3164\ufe00-\ufe0f\ufeff\uffa0\ufff0-\ufffb]|\udb40[\udc00-\udcff]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/g;function Cn(t,e=ie){let n=t.slice(0,1e3).normalize("NFC").replace(vd," ").replace(Id,"").replace(/\s+/g," ").trim();return Array.from(n).slice(0,Math.max(0,e)).join("").trim()}function Ld(t){for(let e of t)if((e.codePointAt(0)??0)>255)return false;return true}var Vr=t=>Math.abs(t*1e3-Math.round(t*1e3))<1e-6;function Xr(t){let e=Mn(t);return {x0:t.qr.x-e,y0:t.qr.y-e,x1:t.qr.x+t.qr.size+e,y1:t.qr.y+t.qr.size+e}}function kd(t){return {x0:t.qr.x,y0:t.qr.y,x1:t.qr.x+t.qr.size,y1:t.qr.y+t.qr.size}}function Mn(t){return t.qr.padding??t.qr.size*at.defaultPadding}var Wa=.52,Fd=.35;function Td(t){let e=t.fontSize??t.box.height*Wa;return Math.min(e*_n,t.box.height*er)}var Ha=(t,e)=>Math.min(t.x1,e.x1)-Math.max(t.x0,e.x0)>1e-6&&Math.min(t.y1,e.y1)-Math.max(t.y0,e.y0)>1e-6;function _l(t){let e=Xr(t),n=Math.min(t.qr.radius??0,(e.x1-e.x0)/2,(e.y1-e.y0)/2),o=[[e.x0+n,e.y0+n,Math.PI],[e.x1-n,e.y0+n,-Math.PI/2],[e.x1-n,e.y1-n,0],[e.x0+n,e.y1-n,Math.PI/2]],r=[];for(let[a,i,l]of o)for(let s=0;s<=8;s++){let c=l+Math.PI/2*(s/8);r.push([a+n*Math.cos(c),i+n*Math.sin(c)]);}return r}function Nd([t,e],n,o){if(t<n.x-.01||e<n.y-.01||t>n.x+n.width+.01||e>n.y+n.height+.01)return false;let a=Math.min(o,n.width/2,n.height/2),i=Math.min(Math.max(t,n.x+a),n.x+n.width-a),l=Math.min(Math.max(e,n.y+a),n.y+n.height-a);return Math.hypot(t-i,e-l)<=a+.01}function Od(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),Math.abs(e)/2}function Dd(t,e,n){let o=Xr(e);if(!Ha(n,o))return false;if("stroke"in t&&t.stroke)return true;if(t.fill==="background")return false;if(t.type==="rect"&&t.hole){let{hole:r}=t;return !_l(e).every(a=>Nd(a,r,r.radius??0))}if(t.type==="circle"&&t.hole){let r=t.hole;return !_l(e).every(([a,i])=>Math.hypot(a-t.cx,i-t.cy)<=r+.01)}if(t.type==="polygon"){let r=xn(t.points,o);return r.length>2&&Od(r)>1e-6}return true}function Va(t){let e=Bd(t),n="stroke"in t?t.stroke:void 0;if(!(n&&e.bounds))return e;let o=t.type==="circle"||t.type==="ellipse"?n.width/2:t.type==="rect"?n.width*Math.SQRT2/2:n.width*2,{x0:r,y0:a,x1:i,y1:l}=e.bounds;return {bounds:{x0:r-o,y0:a-o,x1:i+o,y1:l+o},segments:e.segments*2}}function Bd(t){switch(t.type){case "rect":return {bounds:{x0:t.x,y0:t.y,x1:t.x+t.width,y1:t.y+t.height},segments:t.hole?18:9};case "circle":return {bounds:{x0:t.cx-t.r,y0:t.cy-t.r,x1:t.cx+t.r,y1:t.cy+t.r},segments:t.hole?10:5};case "ellipse":return {bounds:{x0:t.cx-t.rx,y0:t.cy-t.ry,x1:t.cx+t.rx,y1:t.cy+t.ry},segments:5};case "polygon":{let e=t.points.map(([o])=>o),n=t.points.map(([,o])=>o);return {bounds:{x0:Math.min(...e),y0:Math.min(...n),x1:Math.max(...e),y1:Math.max(...n)},segments:t.points.length}}case "path":{let e=Yn(t.d,at.maxDecimals);return e?{bounds:Ge(se(t.d)),segments:fl(e)}:{bounds:null,segments:0}}case "line":{let e=t.width/2,n=Math.hypot(t.x2-t.x1,t.y2-t.y1),o=t.dash?Math.ceil(n/(t.dash[0]+t.dash[1])):1;return {bounds:{x0:Math.min(t.x1,t.x2)-e,y0:Math.min(t.y1,t.y2)-e,x1:Math.max(t.x1,t.x2)+e,y1:Math.max(t.y1,t.y2)+e},segments:o*(t.cap==="round"?4:5)}}default:return {bounds:{x0:t.x,y0:t.y,x1:t.x+t.size,y1:t.y+t.size},segments:xl}}}function $l(t,e){let n=at,o=new TextEncoder().encode(JSON.stringify(t)).length;if(o>n.maxBytes){e(`The spec is ${o} bytes; the limit is ${n.maxBytes}`);return}let{width:r,height:a}=t.artboard,i=Math.max(r,a)*.005,l={x0:-i,y0:-i,x1:r+i,y1:a+i},s=b=>b.x0>=l.x0&&b.y0>=l.y0&&b.x1<=l.x1&&b.y1<=l.y1,{qr:c}=t,u=Mn(t);c.plate!=="none"&&u<c.size*n.minPadding-1e-9&&e(`qr.padding must be at least ${n.minPadding*100}% of qr.size`,["qr","padding"]),c.size<Math.min(r,a)*n.minQrShare-1e-9&&e(`qr.size must be at least ${n.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let m=Xr(t);(m.x0<-1e-9||m.y0<-1e-9||m.x1>r+1e-9||m.y1>a+1e-9)&&e("The code and its padding must sit inside the artboard",["qr"]),(c.radius??0)>(c.size+2*u)/2&&e("qr.radius is larger than half the plate",["qr","radius"]);let f=0,d=0;t.shapes.forEach((b,y)=>{let _=["shapes",y],{bounds:w,segments:C}=Va(b);if(!w){e("Path data must use only M L H V C S Q T A Z, plain numbers (up to 3 decimals) and start with M",[..._,"d"]);return}if(s(w)||e("The shape extends outside the artboard",_),b.type==="rect"&&b.hole){let{hole:S}=b;(S.x<b.x||S.y<b.y||S.x+S.width>b.x+b.width+1e-9||S.y+S.height>b.y+b.height+1e-9)&&e("The hole must sit inside its rect",[..._,"hole"]);}b.type==="circle"&&b.hole&&b.hole>=b.r&&e("The hole must be smaller than the circle",[..._,"hole"]),"stroke"in b&&b.stroke&&b.stroke.width>Math.min(r,a)*.1+1e-9&&e("A stroke may be at most 10% of the artboard's shorter side",[..._,"stroke","width"]),c.plate==="background"&&Dd(b,t,w)&&e('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',_),f+=C,typeof b.fill=="object"&&"gradient"in b.fill&&(d+=(b.fill.gradient.steps??32)*C);}),f>n.maxSegments&&e(`The shapes have ${f} segments; the limit is ${n.maxSegments}`,["shapes"]),d>n.maxGradientWork&&e("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let g=[],h=new Set,p=new Set;t.labels.forEach((b,y)=>{let _=["labels",y];h.has(b.id)&&e(`Label id "${b.id}" is used twice`,[..._,"id"]),h.add(b.id),b.slot!=="fixed"&&(p.has(b.slot)&&e(`Only one label may use the ${b.slot} slot`,[..._,"slot"]),p.add(b.slot));let w=b.maxLength??n.maxTextLength;b.text!==Cn(b.text,w)&&e(`Label text must be at most ${w} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[..._,"text"]);let C;if(b.type==="text"){C={x0:b.box.x,y0:b.box.y,x1:b.box.x+b.box.width,y1:b.box.y+b.box.height},b.fontSize!==void 0&&b.fontSize>b.box.height*er+1e-9&&e("fontSize may be at most 95% of the label's row height",[..._,"fontSize"]);let S=b.box.y+b.box.height/2,x=Td(b)*Fd,M={x0:C.x0,x1:C.x1,y0:S-x,y1:S+x};(Ha(C,kd(t))||Ha(M,m))&&e("The label overlaps the code or its padding",[..._,"box"]);}else {let{cx:S,cy:x,radius:M}=b.curve,R=b.fontSize*_n*.6;C={x0:S-M-R,y0:x-M-R,x1:S+M+R,y1:x+M+R};let E=Math.hypot(Math.max(m.x0-S,0,S-m.x1),Math.max(m.y0-x,0,x-m.y1));Math.hypot(Math.max(Math.abs(m.x0-S),Math.abs(m.x1-S)),Math.max(Math.abs(m.y0-x),Math.abs(m.y1-x)))<=M-R||E>=M+R||e("The curved label crosses the code or its padding",[..._,"curve"]);}if(s(C)||e("The label extends outside the artboard",_),b.collapse){let S=b.collapse,x=S.y+S.height;(S.y<-1e-9||x>a+1e-9)&&e("The collapse band must sit inside the artboard",[..._,"collapse"]),x>m.y0+1e-6&&S.y<m.y1-1e-6&&e("The collapse band crosses the code or its padding",[..._,"collapse"]);for(let M of g)x>M.y+1e-6&&S.y<M.y+M.height-1e-6&&e("Collapse bands may not overlap",[..._,"collapse"]);g.push(S);}});}var Xa=(t,e=0)=>{for(let n=e;n<t.length;n++)if(t[n]?.continue!==true)return true;return false};function $e(t,e=[],n={}){return {...n,run(o){let r=t({value:o,issues:[]}),a=Xa(r.issues);for(let i of e){if(i.hasLength){let s=r.value;if(r.issues.some(c=>c.continue===false)||s===null||s===void 0||s.length===void 0)continue}else if(a)continue;let l=r.issues.length;i.run(r),!a&&r.issues.length>l&&(a=Xa(r.issues,l));}return r}}}function Gd(t){if(typeof t=="number")return Number.isNaN(t)?"NaN":Number.isFinite(t)?"number":String(t);if(t===null)return "null";if(Array.isArray(t))return "array";if(typeof t=="object"){let e=t.constructor;if(Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&e)return e.name}return typeof t}var Ue=(t,e)=>({path:[],message:`Invalid input: expected ${t}, received ${Gd(e)}`}),Qd={string:"characters",array:"items"};function le(t,e,n,o){let r=Qd[e],a=t?"Too big":"Too small",i=`${t?"<=":">="}${n}`;return {path:[],message:r?`${a}: expected ${e} to have ${i} ${r}`:`${a}: expected ${e} to be ${i}`,continue:o}}var ja=t=>typeof t=="string"?`"${t}"`:`${t}`,Ml=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function Ja(t,e,n){for(let o of n)o.path.unshift(e),t.push(o);}var Ud=t=>t>=55296&&t<=56319,Hd=t=>t>=56320&&t<=57343;function zd(t){let e=t.length;for(let n=0;n<t.length-1;n++)Ud(t.charCodeAt(n))&&Hd(t.charCodeAt(n+1))&&(e--,n++);return e}var Rl=t=>Array.isArray(t)?"array":typeof t=="string"?"string":"unknown",or=t=>({run(e){e.value<t&&e.issues.push(le(false,"number",t,true));}}),ar=t=>({run(e){e.value>t&&e.issues.push(le(true,"number",t,true));}}),An=(t,e="Invalid input")=>({run(n){t(n.value)||n.issues.push({path:[],message:e,continue:true});}}),El=t=>typeof t=="string"?zd(t):t.length,Al=t=>({hasLength:true,run(e){let n=e.value;El(n)<t&&e.issues.push(le(false,Rl(n),t,true));}}),ti=t=>({hasLength:true,run(e){let n=e.value;El(n)>t&&e.issues.push(le(true,Rl(n),t,true));}}),Pl=(t,e)=>({run(n){t.lastIndex=0,t.test(n.value)||n.issues.push({path:[],message:e??`Invalid string: must match pattern ${t}`,continue:true});}}),qd={run(t){let e=t.value;Number.isInteger(e)?Number.isSafeInteger(e)||t.issues.push(e>0?le(true,"int",Number.MAX_SAFE_INTEGER,true):le(false,"int",Number.MIN_SAFE_INTEGER,true)):t.issues.push({...Ue("int",e),continue:false});}},He=(...t)=>$e(e=>{let n=e.value;return typeof n=="number"&&Number.isFinite(n)||e.issues.push(Ue("number",n)),e},t),vl=(...t)=>He(qd,...t),jr=(...t)=>$e(e=>(typeof e.value!="string"&&e.issues.push(Ue("string",e.value)),e),t);function zt(t){let e=t.length===1?`Invalid input: expected ${ja(t[0])}`:`Invalid option: expected one of ${t.map(ja).join("|")}`;return $e(n=>(t.includes(n.value)||n.issues.push({path:[],message:e}),n),[],{values:t})}var Ht=t=>zt([t]),st=t=>({optional:true,run:e=>e===void 0?{value:e,issues:[]}:t.run(e)});function gt(t,e=[]){let n=Object.keys(t),o=new Set(n);return $e(r=>{let a=r.value;if(!Ml(a))return r.issues.push(Ue("object",a)),r;let i={};for(let s of n){let c=t[s],u=c.run(a[s]),m=s in a;Ja(r.issues,s,u.issues),m||c.optional||u.issues.length>0||r.issues.push({path:[s],message:"Invalid input: expected nonoptional, received undefined"}),m&&(i[s]=u.value);}r.value=i;let l=[];for(let s in a)o.has(s)||l.push(s);return l.length>0&&r.issues.push({path:[],message:`Unrecognized key${l.length>1?"s":""}: ${l.map(ja).join(", ")}`,continue:true}),r},e,{shape:t})}function Za(t,e,n){let o=[];return e!==void 0&&o.push(Al(e)),n!==void 0&&o.push(ti(n)),$e(r=>{let a=r.value;if(Array.isArray(a)&&n!==void 0&&a.length>n)return r.issues.push(le(true,"array",n,false)),r;if(!Array.isArray(a))return r.issues.push(Ue("array",a)),r;let i=new Array(a.length);for(let l=0;l<a.length;l++){let s=t.run(a[l]);Ja(r.issues,l,s.issues),i[l]=s.value;}return r.value=i,r},o)}function Ya(t){return $e(e=>{let n=e.value;if(!Array.isArray(n))return e.issues.push(Ue("tuple",n)),e;if(n.length<t.length)return e.issues.push(le(false,"array",t.length,void 0)),e;n.length>t.length&&e.issues.push(le(true,"array",t.length,void 0));let o=[];return t.forEach((r,a)=>{let i=r.run(n[a]);Ja(e.issues,a,i.issues),o[a]=i.value;}),e.value=o,e})}function En(t){return $e(e=>{let n=[];for(let r of t){let a=r.run(e.value);if(a.issues.length===0)return a;n.push(a);}let o=n.filter(r=>!Xa(r.issues));return o.length===1?o[0]:(e.issues.push({path:[],message:"Invalid input"}),e)})}function Il(t,e){let n=new Map;for(let r of e)for(let a of r.shape?.[t]?.values??[])n.set(a,r);let o=`Invalid discriminator value. Expected ${[...n.keys()].map(r=>`'${r}'`).join(" | ")}`;return $e(r=>{let a=r.value;if(!Ml(a))return r.issues.push(Ue("object",a)),r;let i=n.get(a[t]);return i?i.run(a):(r.issues.push({path:[t],message:o}),r)})}var Wd=An(Vr,`Numbers may have at most ${at.maxDecimals} decimals`),Yr=[or(-at.maxCoordinate),ar(at.maxCoordinate),Wd],St=He(...Yr),Pt=He(...Yr,An(t=>t>0,"Must be greater than 0")),Zr=He(...Yr,An(t=>t>=0,"Must not be negative")),rr=jr(Pl(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color")),Sl=En([zt(qa),rr]),Ll=t=>gt({mix:Ya([t,t]),amount:He(or(0),ar(1),An(Vr))}),Rn=En([Sl,Ll(Sl)]),Vd=En([rr,Ll(En([zt(["frame","accent","background"]),rr]))]),Qe=En([Rn,gt({gradient:gt({from:Rn,to:Rn,direction:st(zt(["horizontal","vertical"])),steps:st(vl(or(2),ar(at.maxGradientSteps)))})})]),Ka=()=>({x:St,y:St,width:Pt,height:Pt}),nr=gt({color:Rn,width:Pt}),Xd=Il("type",[gt({type:Ht("rect"),...Ka(),radius:st(Zr),fill:Qe,hole:st(gt({...Ka(),radius:st(Zr)})),stroke:st(nr)}),gt({type:Ht("circle"),cx:St,cy:St,r:Pt,hole:st(Pt),fill:Qe,stroke:st(nr)}),gt({type:Ht("ellipse"),cx:St,cy:St,rx:Pt,ry:Pt,fill:Qe,stroke:st(nr)}),gt({type:Ht("polygon"),points:Za(Ya([St,St]),3,at.maxPolygonPoints),fill:Qe,stroke:st(nr)}),gt({type:Ht("path"),d:jr(Al(2),ti(at.maxPathLength)),fill:Qe,fillRule:st(zt(["nonzero","evenodd"])),stroke:st(nr)}),gt({type:Ht("line"),x1:St,y1:St,x2:St,y2:St,width:Pt,cap:st(zt(["butt","round"])),dash:st(Ya([Pt,Pt])),fill:Qe}),gt({type:Ht("icon"),icon:zt(za),x:St,y:St,size:Pt,fill:Qe})]),wl=()=>({id:jr(Pl(/^[a-z][a-z0-9-]{0,31}$/)),slot:zt(["primary","secondary","fixed"]),text:jr(ti(200)),maxLength:st(vl(or(1),ar(ie))),color:Rn,weight:st(zt(["bold","regular"])),collapse:st(gt({y:St,height:Pt}))}),jd=Il("type",[gt({type:Ht("text"),...wl(),box:gt(Ka()),align:st(zt(["start","middle","end"])),fontSize:st(Pt)}),gt({type:Ht("curved"),...wl(),curve:gt({cx:St,cy:St,radius:Pt,side:zt(["top","bottom"]),spread:st(He(or(20),ar(300),An(Vr)))}),fontSize:Pt})]),Cl=He(...Yr,An(t=>t>=at.minArtboard&&t<=at.maxArtboard,`Artboard sides must be ${at.minArtboard} to ${at.maxArtboard} units`)),Zd=gt({kind:Ht(Kn),version:Ht(Jn),artboard:gt({width:Cl,height:Cl}),qr:gt({x:St,y:St,size:Pt,padding:st(Zr),radius:st(Zr),plate:st(zt(["opaque","background","none"]))}),colors:gt({frame:rr,text:st(Vd),accent:st(rr)}),shapes:Za(Xd,void 0,at.maxShapes),labels:Za(jd,void 0,at.maxLabels),bleed:st(En([Ht("none"),Rn]))},[{run(t){$l(t.value,(e,n=[])=>{t.issues.push({path:[...n],message:e,continue:true});});}}]);function Kr(t){let e=Zd.run(t);return e.issues.length===0?{success:true,data:e.value}:{success:false,issues:e.issues.map(({path:n,message:o})=>({path:n,message:o}))}}var kl=({path:t,message:e})=>t.length>0?`${t.join(".")}: ${e}`:e;function et(t){if(t.length===0)return "";let[e,...n]=t;return `M${$(e[0])} ${$(e[1])}${n.map(([o,r])=>`L${$(o)} ${$(r)}`).join("")}Z`}function J(t,e,n){return `M${$(t-n)} ${$(e)}A${$(n)} ${$(n)} 0 1 1 ${$(t+n)} ${$(e)}A${$(n)} ${$(n)} 0 1 1 ${$(t-n)} ${$(e)}Z`}function D(t,e,n,o,r=0){let a=Math.min(n,o)/2,[i,l,s,c]=(typeof r=="number"?[r,r,r,r]:r).map(m=>Math.max(0,Math.min(m,a))),u=(m,f,d)=>m>0?`A${$(m)} ${$(m)} 0 0 1 ${$(f)} ${$(d)}`:"";return `M${$(t+i)} ${$(e)}H${$(t+n-l)}${u(l,t+n,e+l)}V${$(e+o-s)}${u(s,t+n-s,e+o)}H${$(t+c)}${u(c,t,e+o-c)}V${$(e+i)}${u(i,t+i,e)}Z`}function Pn(t,e,n,o,r=-90){return Array.from({length:o},(a,i)=>{let l=(r+360/o*i)*Math.PI/180;return [t+n*Math.cos(l),e+n*Math.sin(l)]})}function vn(t,e,n,o,r=5){return Array.from({length:r*2},(a,i)=>{let l=i%2===0?n:o,s=-Math.PI/2+Math.PI/r*i;return [t+l*Math.cos(s),e+l*Math.sin(s)]})}function ir(t,e,n,o,r=4,a=64){return Array.from({length:a},(i,l)=>{let s=2*Math.PI*l/a,c=Math.cos(s),u=Math.sin(s);return [t+n*Math.sign(c)*Math.abs(c)**(2/r),e+o*Math.sign(u)*Math.abs(u)**(2/r)]})}function In(t,e,n){let o=n/2,r=(a,i)=>`${$(t+a*o)} ${$(e+i*o)}`;return `M${r(0,-0.52)}C${r(.18,-0.92)} ${r(.98,-0.94)} ${r(1,-0.34)}C${r(1,.12)} ${r(.5,.48)} ${r(0,.92)}C${r(-0.5,.48)} ${r(-1,.12)} ${r(-1,-0.34)}C${r(-0.98,-0.94)} ${r(-0.18,-0.92)} ${r(0,-0.52)}Z`}function Fl(t,e,n,o){if(o===0)return t;let r=o*Math.PI/180,a=Math.cos(r),i=Math.sin(r);return t.map(([l,s])=>[e+(l-e)*a-(s-n)*i,n+(l-e)*i+(s-n)*a])}function Jr(t,e,n=0){let o=Math.imul(t+2654435769,2246822507)^Math.imul(e+n,3266489909);return o=Math.imul(o^o>>>15,739982445),o=Math.imul(o^o>>>12,695872825),o^=o>>>15,(o>>>0)/4294967296}function ze(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return (e>>>0).toString(36)}var ei=24,Se=(t,e,n,o)=>{let r=o*Math.PI/180;return [t+n*Math.cos(r),e+n*Math.sin(r)]},to=([t,e])=>`${$(t)} ${$(e)}`;function Ln(t,e,n,o,r,a){let i=a-r>180?1:0;return `M${to(Se(t,e,o,r))}A${$(o)} ${$(o)} 0 ${i} 1 ${to(Se(t,e,o,a))}L${to(Se(t,e,n,a))}A${$(n)} ${$(n)} 0 ${i} 0 ${to(Se(t,e,n,r))}Z`}function sr(t,e,n,o){return `M${$(t-n)} ${$(e)}A${$(n)} ${$(o)} 0 1 1 ${$(t+n)} ${$(e)}A${$(n)} ${$(o)} 0 1 1 ${$(t-n)} ${$(e)}Z`}function Yd(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),e/2}function Tl(t){return et(Yd(t)<0?[...t].reverse():t)}function eo(t,e,n,o,r){let a=Math.hypot(n-t,o-e)||1,i=-(o-e)/a*(r/2),l=(n-t)/a*(r/2);return Tl([[t+i,e+l],[n+i,o+l],[n-i,o-l],[t-i,e-l]])}var It=(...t)=>({d:t.join(""),fillRule:"nonzero"}),ce=(...t)=>({d:t.join(""),fillRule:"evenodd"});function Kd(){let t=[];for(let e of [0,60,120]){let[n,o]=Se(12,12,10.5,e+180),[r,a]=Se(12,12,10.5,e);t.push(eo(n,o,r,a,2));}for(let e=0;e<6;e++){let n=e*60,[o,r]=Se(12,12,6.2,n);for(let a of [-45,45]){let[i,l]=Se(o,r,3.6,n+a);t.push(eo(o,r,i,l,1.7));}}return It(...t)}var Jd={wifi:()=>It(Ln(12,20,4.6,7.2,-135,-45),Ln(12,20,9.2,11.8,-135,-45),Ln(12,20,13.8,16.4,-135,-45),J(12,20,2.2)),star:()=>It(et(vn(12,12.8,11.6,4.8))),heart:()=>It(In(12,12.4,22)),phone:()=>ce(D(6,1.5,12,21,2.6),D(7.8,4.2,8.4,13.4,.6),J(12,19.8,1.1)),headphones:()=>It(Ln(12,13,7.6,9.8,-180,0),D(2,12,5,9.5,2),D(17,12,5,9.5,2)),calendar:()=>ce(D(2.5,4,19,17.5,2.5),D(4.6,9,14.8,10.6,.8),D(7,11.4,2.6,2.6,.4),D(10.7,11.4,2.6,2.6,.4),D(14.4,11.4,2.6,2.6,.4),D(7,15.1,2.6,2.6,.4),D(10.7,15.1,2.6,2.6,.4),D(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),D(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>It(J(12,7.5,4.6),"M3 21.5C3 16.2 7 13.6 12 13.6C17 13.6 21 16.2 21 21.5Z"),chat:()=>ce(D(2,3,20,14,4),et([[6.5,17],[11.5,17],[5.8,21.8]]),J(7.5,10,1.5),J(12,10,1.5),J(16.5,10,1.5)),bag:()=>It(D(3.5,7.5,17,14.5,2),Ln(12,7.5,3.1,4.8,-180,0)),bell:()=>It("M3.5 17.2A8.5 8.5 0 0 1 20.5 17.2Z",D(1.5,18.2,21,2.6,1.3),D(11.2,6.6,1.6,2.6,0),D(9.8,4.6,4.4,2.4,1.2)),cup:()=>It("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",Ln(17,10.2,1.7,3.6,-90,90),D(2,20.6,17,2,1),D(7,1.6,1.6,3.4,.8),D(11.6,1.6,1.6,3.4,.8)),card:()=>ce(D(1.5,4.5,21,15,2.5),D(1.5,8,21,3,0),D(4.5,13.6,4.6,3.2,.6)),check:()=>ce(J(12,12,10.5),et([[6.6,12.4],[8.4,10.6],[10.6,12.8],[15.8,7.6],[17.6,9.4],[10.6,16.4]])),info:()=>ce(J(12,12,10.5),J(12,7.2,1.6),D(10.6,10,2.8,8,.8)),home:()=>ce(et([[12,2.5],[22.5,11.5],[19.5,11.5],[19.5,21.5],[4.5,21.5],[4.5,11.5],[1.5,11.5]]),D(10,14.5,4,7,[.6,.6,0,0])),pin:()=>ce("M12 22.5C8.5 17.6 4.5 14 4.5 9.5A7.5 7.5 0 0 1 19.5 9.5C19.5 14 15.5 17.6 12 22.5Z",J(12,9.5,3)),share:()=>It(eo(6,12,18,5,1.8),eo(6,12,18,19,1.8),J(18,5,3.2),J(6,12,3.2),J(18,19,3.2)),download:()=>It(D(10.6,2,2.8,9.5,0),et([[6,10],[18,10],[12,16.5]]),et([[2.5,15],[5.3,15],[5.3,19],[18.7,19],[18.7,15],[21.5,15],[21.5,21.8],[2.5,21.8]])),clock:()=>ce(J(12,12,10.5),J(12,12,8.4),et([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:Kd,pumpkin:()=>It(sr(7.8,14.6,5.8,6.9),sr(16.2,14.6,5.8,6.9),sr(12,14.6,4.8,7.4),D(10.9,3.4,2.2,4.6,.8),Tl([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>It(et([[12,1.5],[16.8,8.2],[7.2,8.2]]),et([[12,5.2],[19,13.6],[5,13.6]]),et([[12,9.4],[21.2,19.2],[2.8,19.2]]),D(10.4,18.6,3.2,3.9,.4)),sparkle:()=>It(et(vn(9.5,13.5,9,2.4,4)),et(vn(19,5,4,1.1,4))),gift:()=>It(D(3,11.2,7.8,10.6,1),D(13.2,11.2,7.8,10.6,1),D(2,7.4,8.8,3.2,1),D(13.2,7.4,8.8,3.2,1),sr(8.8,4.8,2.9,1.9),sr(15.2,4.8,2.9,1.9))};function ni(t){return Jd[t]()}var tf={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},ef=Object.fromEntries(Object.entries(tf).map(([t,e])=>[t,[Number.parseInt(e.slice(0,2),16),Number.parseInt(e.slice(2,4),16),Number.parseInt(e.slice(4,6),16)]]));function Nl(t,e){let n=t.trim(),o=Number.parseFloat(n);return Number.isNaN(o)?Number.NaN:n.endsWith("%")?o/100*e:o}function lt(t){if(!t)return null;let e=t.trim().toLowerCase();if(e==="transparent")return {r:0,g:0,b:0,a:0};let n=ef[e];if(n)return {r:n[0],g:n[1],b:n[2],a:1};if(e.startsWith("#")){let r=e.slice(1);return (r.length===3||r.length===4)&&(r=r.split("").map(a=>a+a).join("")),/^[0-9a-f]{6}([0-9a-f]{2})?$/.test(r)?{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.slice(4,6),16),a:r.length===8?Number.parseInt(r.slice(6,8),16)/255:1}:null}let o=/^rgba?\(([^)]*)\)$/.exec(e);if(o){let[r,a]=o[1].split("/"),i=r.split(/[\s,]+/).filter(Boolean);if(i.length!==(a===void 0&&i.length===4?4:3))return null;let l=a??i[3],[s,c,u]=i.slice(0,3).map(d=>Nl(d,255)),m=l===void 0?1:Nl(l,1);if([s,c,u,m].some(d=>Number.isNaN(d)))return null;let f=(d,g)=>Math.min(Math.max(d,0),g);return {r:f(s,255),g:f(c,255),b:f(u,255),a:f(m,1)}}return null}function we(t,e,n){let o=t/255,r=e/255,a=n/255,i=1-Math.max(o,r,a);return i>=1?[0,0,0,1]:[K((1-o-i)/(1-i)),K((1-r-i)/(1-i)),K((1-a-i)/(1-i)),K(i)]}function Ol(t){return t===" "?.3:/[MWmw@%]/.test(t)?.92:/[A-Z0-9#&]/.test(t)?.72:/[il.,:;!'|1]/.test(t)?.32:.6}function oi(t){let e=0;for(let n of t)e+=Ol(n);return Math.max(e,1)}var ri=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function lr(t,e,n){let o=lt(t)??{r:0,g:0,b:0},r=lt(e)??{r:255,g:255,b:255},a=Math.min(1,Math.max(0,n));return `#${ri(o.r+(r.r-o.r)*a)}${ri(o.g+(r.g-o.g)*a)}${ri(o.b+(r.b-o.b)*a)}`}function Dl(t,e,n,o,r,a,i,l){let s=[...t],c=r*.08,u=s.map(h=>Ol(h)*r),m=u.reduce((h,p)=>h+p,0)+c*Math.max(0,s.length-1),f=a==="top"?o-r*.35:o+r*.35,d=[],g=0;return s.forEach((h,p)=>{let b=u[p],y=(g+b/2)/f;if(g+=b+c,h.trim()==="")return;let _=a==="top"?-Math.PI/2-m/2/f+y:Math.PI/2+m/2/f-y;d.push({text:h,x:e+f*Math.cos(_),y:n+f*Math.sin(_),fontSize:r,maxWidth:r*2,color:i,rotate:_*180/Math.PI+(a==="top"?90:-90),field:l});}),d}function bt(t,e="#000000"){return t?typeof t=="string"?t:t.type==="solid"?t.color:t.type==="image"?t.underlay||e:(t.type==="linear"||t.type==="radial"||t.type==="angular")&&t.stops[0]?.color||e:e}var cr=class extends Error{issues;constructor(e){super(`Invalid frame spec: ${e.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=e;}},Bl=new WeakMap;function qe(t){if(t&&typeof t=="object"){let n=Bl.get(t);if(n)return n}if(t==null)throw new cr(['A "custom" frame needs a spec']);let e=Kr(t);if(!e.success)throw new cr(e.issues.map(kl));return typeof t=="object"&&Bl.set(t,e.data),e.data}function ai(t){let e=qe(t);return Mn(e)/e.qr.size}var nf=t=>{let e=lt(t);return !!(e&&e.a>=1)};function rf(t,e){let n=bt(e,mt);return t.qr.plate==="none"?{color:n,plate:false}:nf(n)?{color:n,plate:true}:t.qr.plate==="background"?{color:n,plate:false}:{color:mt,plate:true}}function no(t,e,n=mt){let o=e.color||t.colors.frame,r=e.secondaryColor||t.colors.accent||o,a=s=>s==="frame"?o:s==="accent"?r:s==="background"?n:s,i=t.colors.text,l=e.textColor||(i===void 0?o:typeof i=="string"?i:lr(a(i.mix[0]),a(i.mix[1]),i.amount));return {frame:o,text:l,accent:r}}function of(t,e,n){let o=no(e,t,n),r=a=>{switch(a){case "frame":return o.frame;case "text":return o.text;case "accent":return o.accent;case "background":return n;default:return a}};return a=>typeof a=="string"?r(a):lr(r(a.mix[0]),r(a.mix[1]),a.amount)}function Gl(t,e,n=0,o=0){let r=Yn(t);return r?Da(r,e,n,o):""}function af(t,e,n,o){return `M${$(t-n)} ${$(e)}A${$(n)} ${$(o)} 0 1 1 ${$(t+n)} ${$(e)}A${$(n)} ${$(o)} 0 1 1 ${$(t-n)} ${$(e)}Z`}function sf(t,e){let[n,o,r,a]=[t.x1*e,t.y1*e,t.x2*e,t.y2*e],i=Math.hypot(r-n,a-o),l=t.width*e/2,s=i>0?(r-n)/i:1,c=i>0?(a-o)/i:0,u=-c*l,m=s*l,f=(p,b)=>{let y=[n+s*p,o+c*p],_=[n+s*b,o+c*b];if(t.cap==="round"&&b-p>2*l){let w=[y[0]+s*l,y[1]+c*l],C=[_[0]-s*l,_[1]-c*l];return `M${$(w[0]-u)} ${$(w[1]-m)}L${$(C[0]-u)} ${$(C[1]-m)}A${$(l)} ${$(l)} 0 0 1 ${$(C[0]+u)} ${$(C[1]+m)}L${$(w[0]+u)} ${$(w[1]+m)}A${$(l)} ${$(l)} 0 0 1 ${$(w[0]-u)} ${$(w[1]-m)}Z`}return `M${$(y[0]-u)} ${$(y[1]-m)}L${$(_[0]-u)} ${$(_[1]-m)}L${$(_[0]+u)} ${$(_[1]+m)}L${$(y[0]+u)} ${$(y[1]+m)}Z`};if(!t.dash)return {type:"path",d:f(0,i),fillRule:"nonzero"};let d=t.dash[0]*e,g=d+t.dash[1]*e,h=[];for(let p=0;p+d<=i+1e-6;p+=g)h.push(f(p,p+d));return {type:"path",d:h.join(""),fillRule:"nonzero"}}function lf(t,e){switch(t.type){case "rect":return {type:"rect",x:t.x*e,y:t.y*e,width:t.width*e,height:t.height*e,radius:(t.radius??0)*e,...t.hole&&{hole:{x:t.hole.x*e,y:t.hole.y*e,width:t.hole.width*e,height:t.hole.height*e,radius:(t.hole.radius??0)*e}}};case "circle":return {type:"path",d:J(t.cx*e,t.cy*e,t.r*e)+(t.hole?J(t.cx*e,t.cy*e,t.hole*e):""),fillRule:t.hole?"evenodd":"nonzero"};case "ellipse":return {type:"path",d:af(t.cx*e,t.cy*e,t.rx*e,t.ry*e),fillRule:"nonzero"};case "polygon":return {type:"polygon",points:t.points.map(([n,o])=>[n*e,o*e])};case "path":return {type:"path",d:Gl(t.d,e),fillRule:t.fillRule??"nonzero"};case "line":return sf(t,e);default:{let n=ni(t.icon);return {type:"path",d:Gl(n.d,t.size*e/ei,t.x*e,t.y*e),fillRule:n.fillRule}}}}function cf(t){if(t.type==="rect"){let{x:e,y:n,width:o,height:r,radius:a,hole:i}=t;return [...ee(e,n,o,r,a,a),...i?ee(i.x,i.y,i.width,i.height,i.radius,i.radius):[]]}return t.type==="polygon"?[...t.points.map(([e,n],o)=>o===0?{op:"M",x:e,y:n}:{op:"L",x:e,y:n}),{op:"Z"}]:se(t.d)}function uf(t,e,n){let o=cf(t),r=qr(o,.2),a=t.type==="rect"?t.hole?"evenodd":"nonzero":t.type==="path"?t.fillRule??"nonzero":"nonzero",i=e.direction==="vertical",l=p=>i?p[1]:p[0],s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;for(let p of r)for(let b of p)s=Math.min(s,l(b)),c=Math.max(c,l(b));if(!(c>s))return [];let u=e.steps??32,m=n(e.from),f=n(e.to),d=c-s,g=d*.002,h=[];for(let p=0;p<u;p++){let b=s+d*p/u,y=Math.min(c,s+d*(p+1)/u+(p+1<u?g:0)),_=i?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:b,y1:y}:{x0:b,x1:y,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},w=r.map(C=>xn(C,_)).filter(C=>C.length>2);w.length!==0&&h.push({type:"path",d:pl(w),fill:lr(m,f,(p+.5)/u),fillRule:a});}return h}function mf(t,e,n){let o=lf(t,e),r="stroke"in t&&t.stroke?{stroke:n(t.stroke.color),strokeWidth:t.stroke.width*e}:void 0;if(typeof t.fill=="object"&&"gradient"in t.fill){let a=uf(o,t.fill.gradient,n);return r?[...a,{...o,fill:"none",...r}]:a}return [{...o,fill:n(t.fill),...r}]}function df(t,e){let n=Math.min(t.maxLength??at.maxTextLength,at.maxTextLength),o=t.slot==="primary"?e.text??t.text:t.slot==="secondary"?e.secondaryText??t.text:t.text;return Cn(o,n)}function ff(t){return t===void 0||!Number.isFinite(t)?1:Math.min(_n,Math.max(Zn,t))}function hf(t,e,n,o,r,a){let i=r(t.color),l=t.weight==="regular"?{fontWeight:400}:{};if(t.type==="curved"){let{cx:h,cy:p,radius:b,side:y,spread:_=140}=t.curve,w=b*o*(_*Math.PI/180),C=Math.min(t.fontSize*o*n,w/(oi(e)+.08*e.length));return Dl(e,h*o,p*o,b*o,C,y,i,a).map(S=>({...S,...l}))}let s=t.box.x*o,c=t.box.y*o,u=t.box.width*o,m=t.box.height*o;if(!(m>0))return [];let f=(t.fontSize??t.box.height*Wa)*o,d=Math.min(f*n,m*er,u/oi(e)),g=t.align??"middle";return [{text:e,x:g==="start"?s:g==="end"?s+u:s+u/2,y:c+m/2+d*.35,fontSize:d,maxWidth:u,color:i,...g!=="middle"&&{align:g},...l,field:a}]}function pf(t){let e=0,n=0,o=0,r=0;return t.map(({command:a,values:i})=>{let l=a.toUpperCase(),s=a!==l;switch(l){case "Z":return e=o,n=r,{command:"Z",values:[]};case "H":return e=(s?e:0)+i[0],{command:"H",values:[e]};case "V":return n=(s?n:0)+i[0],{command:"V",values:[n]};case "A":return e=(s?e:0)+i[5],n=(s?n:0)+i[6],{command:"A",values:[...i.slice(0,5),e,n]};default:{let c=i.map((u,m)=>s?u+(m%2===0?e:n):u);return e=c.at(-2),n=c.at(-1),l==="M"&&(o=e,r=n),{command:l,values:c}}}})}function gf(t,e){let n=Yn(t);return n?Da(pf(n).map(({command:o,values:r})=>o==="V"?{command:o,values:[e(r[0])]}:o==="H"||o==="Z"?{command:o,values:r}:o==="A"?{command:o,values:[...r.slice(0,6),e(r[6])]}:{command:o,values:r.map((a,i)=>i%2===1?e(a):a)})):t}function bf(t,e){let n=(o,r)=>{let a=e(o);return {y:a,height:e(o+r)-a}};switch(t.type){case "rect":return {...t,...n(t.y,t.height),...t.hole&&{hole:{...t.hole,...n(t.hole.y,t.hole.height)}}};case "circle":case "ellipse":return {...t,cy:e(t.cy)};case "polygon":return {...t,points:t.points.map(([o,r])=>[o,e(r)])};case "path":return {...t,d:gf(t.d,e)};case "line":return {...t,y1:e(t.y1),y2:e(t.y2)};default:return {...t,y:e(t.y)}}}function yf(t,e){if(e.length===0)return t;let n=r=>{let a=r;for(let i of e)a-=Math.min(Math.max(r-i.y,0),i.height);return a},o=(r,a)=>e.some(i=>r>=i.y-1e-6&&a<=i.y+i.height+1e-6);return {...t,artboard:{...t.artboard,height:n(t.artboard.height)},qr:{...t.qr,y:n(t.qr.y)},shapes:t.shapes.filter(r=>{let{bounds:a}=Va(r);return !(a&&o(a.y0,a.y1))}).map(r=>bf(r,n)),labels:t.labels.map(r=>{if(r.type==="curved")return {...r,curve:{...r.curve,cy:n(r.curve.cy)}};let a=n(r.box.y);return {...r,box:{...r.box,y:a,height:n(r.box.y+r.box.height)-a}}})}}function ur(t,e,n,o,r={}){let a=new Map(e.labels.map(p=>[p.id,df(p,n)])),i=yf(e,e.labels.flatMap(p=>p.collapse&&!a.get(p.id)?[p.collapse]:[])),l=t/i.qr.size,s=rf(i,o),c=of(n,i,s.color),u=i.shapes.flatMap(p=>mf(p,l,c));if(s.plate){let p=Mn(i)*l;u.push({type:"rect",x:i.qr.x*l-p,y:i.qr.y*l-p,width:t+2*p,height:t+2*p,radius:(i.qr.radius??0)*l,fill:s.color});}let m=ff(n.fontScale),f=i.labels.flatMap(p=>{let b=a.get(p.id);if(!b)return [];let y=(p.slot==="fixed"?void 0:r[p.slot])??p.id;return hf(p,b,m,l,c,y)}),d=f[0],g=d&&d.rotate===void 0?d:null,h=i.bleed??"none";return {width:i.artboard.width*l,height:i.artboard.height*l,qrX:i.qr.x*l,qrY:i.qr.y*l,qrSize:t,shapes:u,label:g,extraLabels:g?f.slice(1):f,squareEdges:h!=="none",color:c(h==="none"?"frame":h)}}function ii(t,e,n){return ur(t,qe(e.spec),e,n)}var Ql={kind:"qrdx.frame",version:1,artboard:{width:1600,height:1470},qr:{x:300,y:120,size:1e3,padding:70,radius:10,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"polygon",points:[[0,1250],[190,1250],[190,1470],[0,1470],[50.4,1360]],fill:{mix:["frame","#000000"],amount:.28}},{type:"polygon",points:[[1600,1250],[1549.6,1360],[1600,1470],[1410,1470],[1410,1250]],fill:{mix:["frame","#000000"],amount:.28}},{type:"polygon",points:[[90,1420],[170,1470],[90,1470]],fill:{mix:["frame","#000000"],amount:.5}},{type:"polygon",points:[[1510,1420],[1510,1470],[1430,1470]],fill:{mix:["frame","#000000"],amount:.5}},{type:"rect",x:220,y:40,width:1160,height:1160,radius:20,fill:"background"},{type:"rect",x:180,y:0,width:1240,height:1240,radius:60,fill:"frame",hole:{x:220,y:40,width:1160,height:1160,radius:20}},{type:"rect",x:90,y:1200,width:1420,height:220,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:170,y:1200,width:1260,height:220}}]};var si={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1420},qr:{x:120,y:120,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1420,fill:"frame",hole:{x:40,y:40,width:1160,height:1160}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1200,width:1e3,height:220}}],bleed:"frame"};var Ul={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1420},qr:{x:120,y:300,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:220,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1420,fill:"frame",hole:{x:40,y:220,width:1160,height:1160}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:0,width:1e3,height:220}}],bleed:"frame"};var Hl={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1600},qr:{x:120,y:300,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:220,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1600,fill:"frame",hole:{x:40,y:220,width:1160,height:1160}}],labels:[{type:"text",id:"top",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:0,width:1e3,height:220}},{type:"text",id:"bottom",slot:"secondary",text:"",color:"text",box:{x:120,y:1380,width:1e3,height:220}}],bleed:"frame"};var zl={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1340},qr:{x:120,y:120,size:1e3,padding:40,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1260,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1340,fill:"frame",hole:{x:40,y:40,width:1160,height:1260}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1120,width:1e3,height:180},collapse:{y:1200,height:100}}],bleed:"frame"};var ql={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1530},qr:{x:120,y:120,size:1e3,padding:80,radius:80},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:0,y:0,width:1240,height:1400,radius:120,fill:"frame"},{type:"path",d:"M161.2 1380L62 1530Q198.4 1458.5 396.8 1380Z",fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1200,width:1e3,height:200},collapse:{y:1220,height:160}}]};var Wl={kind:"qrdx.frame",version:1,artboard:{width:1978.214,height:1978.214},qr:{x:489.107,y:489.107,size:1e3,padding:50,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"circle",cx:989.107,cy:989.107,r:779.107,fill:"background"},{type:"circle",cx:989.107,cy:989.107,r:989.107,hole:779.107,fill:"frame"},{type:"circle",cx:105,cy:989.107,r:14.7,fill:"text"},{type:"circle",cx:1873.214,cy:989.107,r:14.7,fill:"text"}],labels:[{type:"curved",id:"top",slot:"primary",text:"Scan me",color:"text",curve:{cx:989.107,cy:989.107,radius:884.107,side:"top",spread:140},fontSize:105},{type:"curved",id:"bottom",slot:"secondary",text:"",color:"text",curve:{cx:989.107,cy:989.107,radius:884.107,side:"bottom",spread:140},fontSize:105}]};var Vl={kind:"qrdx.frame",version:1,artboard:{width:1320,height:1558},qr:{x:160,y:130,size:1e3,padding:60},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:0,y:370,width:1320,height:1188,fill:{mix:["frame","#FFFFFF"],amount:.45}},{type:"polygon",points:[[0,370],[660,0],[1320,370]],fill:{mix:["frame","#FFFFFF"],amount:.25}},{type:"rect",x:80,y:50,width:1160,height:1268,fill:"background"},{type:"rect",x:68,y:38,width:1184,height:1280,fill:"frame",hole:{x:80,y:50,width:1160,height:1268}},{type:"polygon",points:[[0,1178],[660,1318],[1320,1178],[1320,1558],[0,1558]],fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:160,y:1318,width:1e3,height:220}}]};var Xl={kind:"qrdx.frame",version:1,artboard:{width:1230,height:1430},qr:{x:115,y:115,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:0,y:0,width:1230,height:1430,fill:"background"},{type:"polygon",points:[[0,0],[200,0],[200,35],[35,35],[35,200],[0,200]],fill:"frame"},{type:"polygon",points:[[1230,0],[1030,0],[1030,35],[1195,35],[1195,200],[1230,200]],fill:"frame"},{type:"polygon",points:[[1230,1230],[1030,1230],[1030,1195],[1195,1195],[1195,1030],[1230,1030]],fill:"frame"},{type:"polygon",points:[[0,1230],[200,1230],[200,1195],[35,1195],[35,1030],[0,1030]],fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:80,y:1210,width:1070,height:200},collapse:{y:1230,height:200}}]};var ro={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1360},qr:{x:130,y:130,size:1e3,padding:40,plate:"background"},colors:{frame:"#7c3aed",text:{mix:["frame","accent"],amount:.5},accent:"#db2777"},shapes:[{type:"rect",x:50,y:50,width:1160,height:1260,radius:50,fill:"background"},{type:"rect",x:0,y:0,width:1260,height:1360,radius:100,fill:{gradient:{from:"frame",to:"accent",direction:"horizontal",steps:48}},hole:{x:50,y:50,width:1160,height:1260,radius:50}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:1130,width:1e3,height:180},collapse:{y:1210,height:100}}]};var jl={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1460},qr:{x:130,y:260,size:1e3,padding:46,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:0,y:0,width:1260,height:1460,radius:30,fill:"background"},{type:"rect",x:0,y:0,width:1260,height:1460,radius:30,fill:"frame",hole:{x:22,y:22,width:1216,height:1416,radius:8}},{type:"rect",x:45,y:45,width:1170,height:1370,fill:"frame",hole:{x:53,y:53,width:1154,height:1354}},{type:"rect",x:378,y:181,width:504,height:8,fill:"frame"},{type:"polygon",points:[[630,163],[652,185],[630,207],[608,185]],fill:"frame"}],labels:[{type:"text",id:"title",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:30,width:1e3,height:170},collapse:{y:84,height:130}},{type:"text",id:"footer",slot:"secondary",text:"",color:"text",box:{x:130,y:1270,width:1e3,height:160},collapse:{y:1306,height:70}}]};var Zl={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1610},qr:{x:130,y:250,size:1e3,padding:75,radius:55},colors:{frame:"#000000"},shapes:[{type:"rect",x:0,y:0,width:1260,height:1610,radius:170,fill:"frame"},{type:"rect",x:50,y:170,width:1160,height:1290,radius:60,fill:"background"},{type:"rect",x:520,y:67,width:220,height:36,radius:18,fill:"background"},{type:"rect",x:480,y:1520,width:300,height:30,radius:15,fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:1290,width:1e3,height:170},collapse:{y:1330,height:130}}]};var Yl={kind:"qrdx.frame",version:1,artboard:{width:1325,height:1555},qr:{x:150,y:150,size:1e3,padding:80},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:25,y:25,width:1300,height:1530,radius:15,fill:{mix:["frame","#FFFFFF"],amount:.72}},{type:"rect",x:0,y:0,width:1300,height:1530,radius:15,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:150,y:1260,width:1e3,height:240}}]};var Kl={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1340},qr:{x:120,y:120,size:1e3,padding:40,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1260,radius:60,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1340,radius:100,fill:"frame",hole:{x:40,y:40,width:1160,height:1260,radius:60}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1120,width:1e3,height:180},collapse:{y:1200,height:100}}]};var Jl={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1565},qr:{x:120,y:120,size:1e3,padding:70,radius:20,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1160,radius:30,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1240,radius:70,fill:"frame",hole:{x:40,y:40,width:1160,height:1160,radius:30}},{type:"polygon",points:[[540,1385],[620,1265],[700,1385]],fill:"frame"},{type:"rect",x:0,y:1345,width:1240,height:220,radius:110,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1345,width:1e3,height:220}}]};var tc={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1565},qr:{x:120,y:445,size:1e3,padding:70,radius:20,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:0,y:0,width:1240,height:220,radius:110,fill:"frame"},{type:"polygon",points:[[540,180],[700,180],[620,300]],fill:"frame"},{type:"rect",x:40,y:365,width:1160,height:1160,radius:30,fill:"background"},{type:"rect",x:0,y:325,width:1240,height:1240,radius:70,fill:"frame",hole:{x:40,y:365,width:1160,height:1160,radius:30}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:0,width:1e3,height:220}}]};var ec={kind:"qrdx.frame",version:1,artboard:{width:1420,height:1590},qr:{x:195,y:195,size:1e3,padding:80},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:30,y:30,width:1390,height:1560,radius:155,fill:{mix:["frame","#FFFFFF"],amount:.7}},{type:"rect",x:0,y:0,width:1390,height:1560,radius:155,fill:"#FFFFFF"},{type:"rect",x:25,y:25,width:1340,height:1510,radius:130,fill:"frame"},{type:"rect",x:95,y:95,width:1200,height:1200,radius:40,fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:175,y:1295,width:1040,height:240},collapse:{y:1365,height:170}}]};var nc={kind:"qrdx.frame",version:1,artboard:{width:1280,height:1620},qr:{x:140,y:320,size:1e3,padding:80,radius:20},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"path",d:"M140 0H1140L1280 140V1580A40 40 0 0 1 1240 1620H40A40 40 0 0 1 0 1580V140ZM600 115.2A40 40 0 1 1 680 115.2A40 40 0 1 1 600 115.2Z",fill:"frame",fillRule:"evenodd"},{type:"path",d:"M572 115.2A68 68 0 1 1 708 115.2A68 68 0 1 1 572 115.2ZM600 115.2A40 40 0 1 1 680 115.2A40 40 0 1 1 600 115.2Z",fill:{mix:["frame","#FFFFFF"],amount:.35},fillRule:"evenodd"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:140,y:1400,width:1e3,height:220},collapse:{y:1420,height:160}}]};var rc={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1490},qr:{x:130,y:130,size:1e3,padding:80,radius:20},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"path",d:"M40 0H1220A40 40 0 0 1 1260 40V1215A55 55 0 0 0 1260 1325V1450A40 40 0 0 1 1220 1490H40A40 40 0 0 1 0 1450V1325A55 55 0 0 0 0 1215V40A40 40 0 0 1 40 0Z",fill:"frame"},{type:"line",x1:77,y1:1270,x2:1147,y2:1270,width:12,dash:[30,22],fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:1270,width:1e3,height:220}}]};var wt=(t,e,n,o,r)=>({style:t,name:e,tags:r,labelOn:o,spec:n}),li=[wt("banner-bottom","Banner",si,"frame",["bottom","band"]),wt("banner-top","Top banner",Ul,"frame",["top","band"]),wt("banner-top-bottom","Two banners",Hl,"frame",["top","bottom","band"]),wt("border","Border",zl,"background",["square","outline"]),wt("rounded-border","Rounded",Kl,"background",["border","outline"]),wt("gradient-border","Gradient",ro,"background",["border","colorful"]),wt("focus","Focus",Xl,"background",["corners","brackets"]),wt("speech-bubble","Bubble",Jl,"frame",["speech"]),wt("speech-bubble-top","Bubble top",tc,"frame",["speech"]),wt("chat-bubble","Chat",ql,"frame",["message","bubble"]),wt("circle","Circle",Wl,"frame",["round","ring","curved"]),wt("badge","Ribbon",Ql,"frame",["badge","banner"]),wt("sticker","Sticker",ec,"frame",["label"]),wt("polaroid","Polaroid",Yl,"frame",["photo","picture"]),wt("phone","Phone",Zl,"background",["mobile","screen"]),wt("ticket","Ticket",rc,"frame",["event","pass"]),wt("tag","Tag",nc,"frame",["price","label"]),wt("envelope","Envelope",Vl,"frame",["mail","letter"]),wt("menu-card","Menu card",jl,"background",["menu","restaurant"])],Df=new Map(li.map(t=>[t.style,t]));function ci(t){return Df.get(t)}var Bf=Object.fromEntries(li.map(t=>[t.style,t.spec])),Gf={from:ro.colors.frame,to:ro.colors.accent};function oo(t){return !t||t.style==="none"?null:t.style===tr?t.spec??null:ci(t.style)?.spec??null}function Qf(t){let e=oo(t);return t&&typeof e?.colors?.frame=="string"?no(e,t):null}var Uf={primary:"text",secondary:"secondaryText"};function oc(t,e,n){let o=ci(e.style)?.spec??si;return ur(t,qe(o),e,n,Uf)}var io="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",ic=.08,sc="data-qrdx-frame-label";function Tt(t){return !!(t?.style&&t.style!=="none")}function ui(t){let e=oo(t);return e?ai(e):ic}function Hf(t){return (t.text??$a).trim().slice(0,ie)}function zf(t){return (t.secondaryText??"").trim().slice(0,ie)}function We(t,e,n){return e.style===tr?ii(t,e,n):oc(t,e,n)}function ue(t,e){if(!Tt(e))return {width:t,height:t};let{width:n,height:o}=We(t,e);return {width:n,height:o}}var nt=t=>K(t,2);function ac({x:t,y:e,width:n,height:o,radius:r}){let a=nt(Math.min(r,n/2,o/2)),[i,l,s,c]=[nt(t),nt(e),nt(n),nt(o)];return a<=0?A`M${i} ${l}h${s}v${c}h${-s}z`:A`M${i+a} ${l}h${nt(s-2*a)}a${a} ${a} 0 0 1 ${a} ${a}`+A`v${nt(c-2*a)}a${a} ${a} 0 0 1 ${-a} ${a}`+A`h${nt(-(s-2*a))}a${a} ${a} 0 0 1 ${-a} ${-a}`+A`v${nt(-(c-2*a))}a${a} ${a} 0 0 1 ${a} ${-a}z`}function ao(t){return t.stroke&&t.strokeWidth?{stroke:t.stroke,strokeWidth:nt(t.strokeWidth)}:{}}function lc(t,e){return t.type==="rect"&&t.hole?P("path",{d:ac(t)+ac(t.hole),fill:t.fill,fillRule:"evenodd",...ao(t)},e):t.type==="polygon"?P("polygon",{fill:t.fill,points:t.points.map(([n,o])=>`${nt(n)},${nt(o)}`).join(" "),...ao(t)},e):t.type==="path"?P("path",{d:t.d,fill:t.fill,...t.fillRule==="evenodd"&&{fillRule:"evenodd"},...ao(t)},e):Dr("rect",{...ao(t),fill:t.fill,height:nt(t.height),key:e,width:nt(t.width),x:nt(t.x),y:nt(t.y),...t.radius>0&&{rx:nt(t.radius),ry:nt(t.radius)}})}function cc(t){return t.shapes.map((e,n)=>lc(e,n))}function mr(t,e){let{size:n,frame:o,bgColor:r,svgProps:a,markLabels:i}=e,l=We(n,o,r),s=uc(l),c=nt(l.width),u=nt(l.height);return xt("svg",{height:u,viewBox:`0 0 ${c} ${u}`,width:c,xmlns:"http://www.w3.org/2000/svg",...a,children:[P("g",{"data-qrdx-frame":o.style,children:l.shapes.map((m,f)=>lc(m,f))}),Ne(t,{x:nt(l.qrX),y:nt(l.qrY),width:n,height:n}),s.map((m,f)=>P("text",{"data-max-width":nt(m.maxWidth),fill:m.color,fontFamily:io,fontSize:nt(m.fontSize),fontWeight:m.fontWeight??700,textAnchor:m.align??"middle",x:nt(m.x),y:nt(m.y),...m.rotate&&{transform:`rotate(${nt(m.rotate)} ${nt(m.x)} ${nt(m.y)})`},...i&&m.field&&{[sc]:m.field},children:m.text},f))]})}function mi(t){let{frame:e,size:n=it,bgColor:o,slot:r,svgProps:a}=t,i=r??P("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg"});return Tt(e)?mr(i,{size:n,frame:e,bgColor:o,svgProps:a}):P("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg",...a,children:Ne(i,{x:0,y:0,width:n,height:n})})}function uc(t){return [...t.label?[t.label]:[],...t.extraLabels??[]]}var so=.22,lo=.14;function mc(t,e,n={}){if(t==="circle")return P("circle",{cx:$(e.x+e.w/2),cy:$(e.y+e.h/2),r:$(Math.min(e.w,e.h)/2),...n});let o=t==="rounded"?Math.min(e.w,e.h)*so:0;return P("rect",{height:$(e.h),width:$(e.w),x:$(e.x),y:$(e.y),...o>0&&{rx:$(o),ry:$(o)},...n})}function qf(t,e){let n=t.w*e,o=t.h*e;return {x:t.x+n,y:t.y+o,w:t.w-2*n,h:t.h-2*o}}function co(t,e){let n=t.shape??"square",o=t.plate,r=o?qf(e,lo):e,a=l=>P("image",{height:$(r.h),href:t.src,preserveAspectRatio:"none",width:$(r.w),x:$(r.x),y:$(r.y),...l&&{clipPath:`url(#${l})`}});if(n==="square"&&!o)return a();let i=n==="square"?void 0:`qrdx-logo-${ze(`${n}|${$(r.x)}|${$(r.y)}|${$(r.w)}|${$(r.h)}`)}`;return xt("g",{children:[o&&mc(n,e,{fill:o}),i&&P("clipPath",{id:i,children:mc(n,r)}),a(i)]})}var{QrCode:di}=ut,Wf={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function Vf(t){let e=t*4+17,n=new Uint8Array(e*e),o=(i,l)=>{i>=0&&l>=0&&i<e&&l<e&&(n[l*e+i]=1);};for(let i=0;i<e;i++)o(6,i),o(i,6);for(let[i,l]of [[3,3],[e-4,3],[3,e-4]])for(let s=-4;s<=4;s++)for(let c=-4;c<=4;c++)o(i+c,l+s);let r=[];if(t>1){let i=Math.floor(t/7)+2,l=t===32?26:Math.ceil((t*4+4)/(i*2-2))*2;r.push(6);for(let s=e-7;r.length<i;s-=l)r.splice(1,0,s);}let a=r.length-1;for(let[i,l]of r.entries())for(let[s,c]of r.entries())if(!(i===0&&s===0||i===0&&s===a||i===a&&s===0))for(let u=-2;u<=2;u++)for(let m=-2;m<=2;m++)o(l+m,c+u);for(let i=0;i<=8;i++)o(8,i),o(i,8);for(let i=0;i<8;i++)o(e-1-i,8),o(8,e-1-i);if(t>=7)for(let i=0;i<18;i++){let l=e-11+i%3,s=Math.floor(i/3);o(l,s),o(s,l);}return n}function Xf(t,e){let n=t*4+17,o=$t[e].ordinal,r=di.NUM_ERROR_CORRECTION_BLOCKS[o]?.[t]??0,a=di.ECC_CODEWORDS_PER_BLOCK[o]?.[t]??0,i=Math.floor(di.getNumRawDataModules(t)/8),l=r-i%r,s=Math.floor(i/r),c=Array.from({length:r},(w,C)=>s+(C<l?0:1)),u=[],m=[],f=s-a;for(let w=0;w<=s;w++)for(let C=0;C<r;C++)if(C<l){if(w===f)continue;u.push(C),m.push(w<f?w:w-1);}else u.push(C),m.push(w);if(u.length!==i)throw new Error(`Codeword map: interleave mismatch at version ${t}`);let d=Vf(t),g=new Int16Array(n*n).fill(-1),h=new Int16Array(n*n).fill(-1),p=new Int8Array(n*n).fill(-1),b=i*8,y=0;for(let w=n-1;w>=1;w-=2){w===6&&(w=5);let C=(w+1&2)===0;for(let S=0;S<n;S++)for(let x=0;x<2;x++){let M=w-x,E=(C?n-1-S:S)*n+M;if(!d[E]&&y<b){let v=y>>>3;g[E]=u[v],h[E]=m[v],p[E]=7-(y&7),y++;}}}if(y!==b)throw new Error(`Codeword map: placement mismatch at version ${t}`);let _=Wf[`${t}${e}`]??0;return {version:t,level:e,size:n,blocks:r,eccPerBlock:a,blockLengths:c,correctable:Math.floor((a-_)/2),block:g,codeword:h,bit:p}}var jf=8,Ve=new Map;function dr(t,e){if(!(Number.isInteger(t)&&t>=1&&t<=40))throw new RangeError(`QR version must be 1\u201340, got ${t}`);let n=`${t}${e}`,o=Ve.get(n);if(o)return Ve.delete(n),Ve.set(n,o),o;let r=Xf(t,e);if(Ve.size>=jf){let a=Ve.keys().next().value;a!==void 0&&Ve.delete(a);}return Ve.set(n,r),r}function fr(t,e){let n=new Array(t.blocks).fill(0),o=new Set;for(let r of e){let a=t.block[r]??-1;if(a<0)continue;let i=a*4096+t.codeword[r];o.has(i)||(o.add(i),n[a]=n[a]+1);}return n}var Zf={2:6,3:12};function dc(t){let e=[t.start],n=t.start;for(let o of t.segments){let r=o.at(-1);if(o.length===1)e.push(r);else {let a=Zf[o.length];for(let i=1;i<=a;i++){let l=i/a,s=1-l;if(o.length===2){let[c]=o;e.push([s*s*n[0]+2*s*l*c[0]+l*l*r[0],s*s*n[1]+2*s*l*c[1]+l*l*r[1]]);}else {let[c,u]=o;e.push([s*s*s*n[0]+3*s*s*l*c[0]+3*s*l*l*u[0]+l*l*l*r[0],s*s*s*n[1]+3*s*s*l*c[1]+3*s*l*l*u[1]+l*l*l*r[1]]);}}}n=r;}return e}function hc(t,e){let n=[];for(let o of t)for(let r=0;r<o.length;r++){let[a,i]=o[r],[l,s]=o[(r+1)%o.length];i<=e!=s<=e&&n.push(a+(e-i)/(s-i)*(l-a));}return n.sort((o,r)=>o-r)}function pc(t,e){let n=0;for(let o of t)if(o<e)n++;else break;return n%2===1}function Yf(t,e,n){return pc(hc(t,n),e)}function gc(t){let e=new Map;return (n,o)=>{let r=e.get(o);return r||(r=hc(t,o),e.set(o,r)),pc(r,n)}}function Kf(t,e,n,o){let r=n[0]-t,a=n[1]-e,i=o[0]-n[0],l=o[1]-n[1],s=u=>Math.max(Math.abs(r+u*i),Math.abs(a+u*l)),c=Math.min(s(0),s(1));for(let[u,m]of [[a-r,i-l],[-(r+a),i+l]])if(m!==0){let f=u/m;f>0&&f<1&&(c=Math.min(c,s(f)));}return c}function Jf(t,e,n){if(!Yf(t,e,n))return 0;let o=Number.POSITIVE_INFINITY;for(let r of t)for(let a=0;a<r.length;a++)o=Math.min(o,Kf(e,n,r[a],r[(a+1)%r.length]));return Number.isFinite(o)?o:0}function t1(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let a of t)for(let[i,l]of a)e=Math.min(e,i),n=Math.min(n,l),o=Math.max(o,i),r=Math.max(r,l);return {x0:e,y0:n,x1:o,y1:r}}function bc(t){let e=t.map(dc),n=t1(e),o=n.x1-n.x0,r=n.y1-n.y0;if(!(o>0&&r>0))return null;let a=(g,h)=>{let p=Math.max(g-n.x0,n.x1-g,h-n.y0,n.y1-h);return p>0?Jf(e,g,h)/(2*p):0},i={cx:n.x0+o/2,cy:n.y0+r/2,value:0};i.value=a(i.cx,i.cy);let l=32;for(let g=1;g<l;g++)for(let h=1;h<l;h++){let p=n.x0+o*h/l,b=n.y0+r*g/l,y=a(p,b);y>i.value&&(i={cx:p,cy:b,value:y});}let s=o/l,c=r/l;for(let g=0;g<6;g++){let h=i;for(let p=-2;p<=2;p++)for(let b=-2;b<=2;b++){let y=h.cx+s*b/2,_=h.cy+c*p/2,w=a(y,_);w>i.value&&(i={cx:y,cy:_,value:w});}s/=2,c/=2;}if(i.value<=0)return null;let m=.5/Math.max(i.cx-n.x0,n.x1-i.cx,i.cy-n.y0,n.y1-i.cy),f=([g,h])=>[.5+(g-i.cx)*m,.5+(h-i.cy)*m],d=t.map(g=>({start:f(g.start),segments:g.segments.map(h=>h.map(f))}));return {rings:d,polygons:d.map(dc),half:i.value}}function yc(t,e){let n=([r,a])=>`${$(r*e)} ${$(a*e)}`,o="";for(let r of t.rings){o+=`M${n(r.start)}`;for(let a of r.segments){let i=a.length===1?"L":a.length===2?"Q":"C";o+=i+a.map(n).join(" ");}o+="Z";}return o}var e1={start:[0,-0.58],segments:[[[.2,-0.92],[1,-0.97],[1,-0.3]],[[1,.3],[.62,.6],[0,.92]],[[-0.62,.6],[-1,.3],[-1,-0.3]],[[-1,-0.97],[-0.2,-0.92],[0,-0.58]]]},fc;function _c(){return fc??=bc([e1]),fc}function n1(t){let{width:e,height:n,cells:o}=t;return Number.isInteger(e)&&Number.isInteger(n)&&e>=ye&&n>=ye&&e<=De&&n<=De&&typeof o=="string"&&o.length===e*n&&/^[01]*$/.test(o)?(r,a)=>r>=0&&a>=0&&r<e&&a<n&&o[a*e+r]==="1":null}var me=([t,e])=>`${t},${e}`;function r1(t,e,n){let o=(s,c)=>t(s-1,c-1),r=new Map,a=(s,c)=>{for(let[u,m]of [[s,c],[c,s]]){let f=r.get(me(u))??[];f.push(m),r.set(me(u),f);}};for(let s=0;s<=n;s++)for(let c=0;c<=e;c++){let u=o(c,s),m=o(c+1,s),f=o(c+1,s+1),d=o(c,s+1),g=[c,s-.5],h=[c+.5,s],p=[c,s+.5],b=[c-.5,s];switch((u?8:0)+(m?4:0)+(f?2:0)+(d?1:0)){case 1:case 14:a(b,p);break;case 2:case 13:a(p,h);break;case 3:case 12:a(b,h);break;case 4:case 11:a(g,h);break;case 6:case 9:a(g,p);break;case 7:case 8:a(b,g);break;case 5:a(g,h),a(b,p);break;case 10:a(b,g),a(p,h);break;}}let i=[],l=new Set;for(let[s,c]of r){if(l.has(s)||c.length===0)continue;let[u,m]=s.split(",").map(Number),f=[[u,m]];l.add(s);let d=[u,m],g=c[0];for(;!l.has(me(g));){l.add(me(g)),f.push(g);let h=o1(r.get(me(g))??[],d,l);if(!h)break;d=g,g=h;}f.length>=3&&i.push(a1(f));}return i}function o1(t,e,n){let o=me(e);return t.find(r=>me(r)!==o&&!n.has(me(r)))??t.find(r=>me(r)!==o)}function a1(t){let e=[];for(let n=0;n<t.length;n++){let o=t[(n-1+t.length)%t.length],r=t[n],a=t[(n+1)%t.length],i=(r[0]-o[0])*(a[1]-r[1])-(r[1]-o[1])*(a[0]-r[0]);Math.abs(i)>1e-9&&e.push(r);}return e.length>=3?e:t}function i1(t){let e=(a,i)=>[(a[0]+i[0])/2,(a[1]+i[1])/2],n=t.length,o=e(t[n-1],t[0]),r=t.map((a,i)=>[a,e(a,t[(i+1)%n])]);return {start:o,segments:r}}var hr=new Map;function fi(t){let e=`${t.width}x${t.height}:${t.cells}`,n=hr.get(e);if(n)return n;let o=n1(t),r;if(!o)r={outline:null,problem:"invalid"};else if(t.cells.includes("1")){let a=r1(o,t.width,t.height),i=a.length>0?bc(a.map(i1)):null;r=i&&2*i.half>=Ea?{outline:i,problem:null}:{outline:null,problem:i?"thin":"empty"};}else r={outline:null,problem:"empty"};return hr.size>16&&hr.delete(hr.keys().next().value),hr.set(e,r),r}var s1=1,xc=.5,$c=.5,l1=.5;function Xe(t){return Math.max(t,Ra)}function uo(t){return t==="heart"?_c():typeof t=="object"&&t?.type==="silhouette"?fi(t).outline:null}function pr(t){return t==="circle"||uo(t)!==null}var c1={invalid:"This silhouette isn't a valid shape grid.",empty:"No shape found: use a picture with a dark or opaque shape on a light or clear background.",thin:"This shape is too thin to hold the code with its quiet zone. Try a rounder, fuller shape."};function u1(t){let{outline:e,problem:n}=fi(t);if(e&&!n)return {ok:true,share:2*e.half};let o=n??"invalid";return {ok:false,reason:o,message:c1[o]}}function Rt(t,e,n){if(n==="circle"){let i=Xe(e),l=(t/2+i)*Math.SQRT2+s1;return Math.ceil(l-t/2)}let o=uo(n);if(!o)return e;let r=Xe(e),a=(t+2*(r+l1))/(2*o.half);return Math.ceil((a-t)/2-1e-9)}function Sc(t){let e=t>>>0;return ()=>{e=e+1831565813>>>0;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function m1(t,e,n){let o=Rt(e,n,"circle"),r=Xe(n),a=e+2*o,i=a/2,l=i-xc-.5,s=Sc(Number.parseInt(ze(t),36)||1),c=o-r,u=o+e+r;return Array.from({length:a},(m,f)=>Array.from({length:a},(d,g)=>{let h=s()<$c;return g>=c&&g<u&&f>=c&&f<u?false:h&&Math.hypot(g+.5-i,f+.5-i)<=l}))}var d1=Array.from({length:8},(t,e)=>{let n=e*Math.PI/4;return [Math.cos(n),Math.sin(n)]});function wc(t,e,n,o){if(o==="circle")return m1(t,e,n);let r=uo(o);if(!r)return null;let a=Rt(e,n,o),i=Xe(n),l=e+2*a,s=gc(r.polygons),c=.5+xc,u=(g,h)=>{let p=g+.5,b=h+.5;return s(p/l,b/l)?d1.every(([y,_])=>s((p+y*c)/l,(b+_*c)/l)):false},m=Sc(Number.parseInt(ze(t),36)||1),f=a-i,d=a+e+i;return Array.from({length:l},(g,h)=>Array.from({length:l},(p,b)=>{let y=m()<$c;return b>=f&&b<d&&h>=f&&h<d?false:y&&u(b,h)}))}function hi(t,e){if(t==="circle")return {circle:e/2};let n=uo(t);return n?{path:yc(n,e)}:null}function f1(t,e){let n=hi(t,e);return n?"circle"in n?J(e/2,e/2,n.circle):n.path:null}function Lt(t,e="#000000"){return t?typeof t=="string"?{type:"solid",color:t}:t:{type:"solid",color:e}}function je(t){return !t||typeof t=="string"?false:t.type==="linear"||t.type==="radial"||t.type==="angular"}function pi(t){return typeof t=="object"&&t!==null&&t.type==="image"}function h1(t,e="#000000"){let n=Lt(t,e);return n.type==="solid"?n.color:n.type==="image"?n.underlay||e:n.stops[0]?.color||e}function Cc(t="center"){let[e,n]=t.split("-");return t==="center"?"center":n?`${n} ${e}`:e==="top"||e==="bottom"?`center ${e}`:`${e} center`}function p1(t){if(!t)return "#000000";if(typeof t=="string")return t;let e=Lt(t);if(e.type==="solid")return e.color;if(e.type==="image"){let r=e.fit==="tile"?`${25*(e.scale??1)}% auto`:(e.scale??1)===1?e.fit==="contain"?"contain":"cover":`${100*(e.scale??1)}% auto`,a=e.fit==="tile"?"repeat":"no-repeat";return `${`url("${e.src.replace(/"/g,"%22")}")`} ${Cc(e.position)} / ${r} ${a}, ${e.underlay??"transparent"}`}let o=[...e.stops].sort((r,a)=>r.offset-a.offset).map(r=>`${r.color} ${r.offset}%`).join(", ");return e.type==="linear"?`linear-gradient(${(e.angle??0)+90}deg, ${o})`:e.type==="angular"?`conic-gradient(from ${e.angle??0}deg, ${o})`:`radial-gradient(circle, ${o})`}var kt=t=>t/255,gr=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,tt=t=>.2126*t[0]+.7152*t[1]+.0722*t[2];function gi(t){let{width:e,height:n,data:o}=t,r=[0,e-1,(n-1)*e,n*e-1].map(i=>{let l=i*4;return {color:[kt(o[l]),kt(o[l+1]),kt(o[l+2])],alpha:o[l+3]/255}});if(r.some(i=>i.alpha<.9))return null;let a=r[0].color;return r.every(({color:i})=>gr(i,a)<.006)?a:null}function g1(t){let{width:e,height:n,data:o}=t,r=gi(t),a=new Float32Array(e*n);for(let i=0;i<a.length;i++){let l=i*4,s=o[l+3]/255;if(r&&s>0){let c=Math.sqrt(gr([kt(o[l]),kt(o[l+1]),kt(o[l+2])],r));s*=Math.min(1,Math.max(0,(c-.06)/.1));}a[i]=s;}return a}var b1=8,y1=.14,Mc=.006;function _1(t,e){let{width:n,height:o,data:r}=t,a=new Float64Array(4096),i=new Float64Array(4096*3),l=0;for(let d=0;d<e.length;d++){if(e[d]<.9)continue;let g=d*4,h=Math.floor(r[g]/16)*256+Math.floor(r[g+1]/16)*16+Math.floor(r[g+2]/16);a[h]+=1,i[h*3]+=kt(r[g]),i[h*3+1]+=kt(r[g+1]),i[h*3+2]+=kt(r[g+2]),l++;}if(l===0)return {palette:[],error:0};let s=[...a.keys()].filter(d=>a[d]>0).sort((d,g)=>a[g]-a[d]),c=[];for(let d of s){if(a[d]/l<Mc/2||c.length>=b1)break;let g=[i[d*3]/a[d],i[d*3+1]/a[d],i[d*3+2]/a[d]];c.every(h=>gr(h,g)>=y1**2)&&c.push(g);}let u=[],m=0;for(let d=0;d<3;d++){u=c.map(()=>({n:0,r:0,g:0,b:0,x:0,y:0})),m=0;for(let g=0;g<e.length;g++){if(e[g]<.9)continue;let h=g*4,p=[kt(r[h]),kt(r[h+1]),kt(r[h+2])],b=0,y=Number.POSITIVE_INFINITY;for(let[w,C]of c.entries()){let S=gr(p,C);S<y&&(y=S,b=w);}let _=u[b];_.n++,_.r+=p[0],_.g+=p[1],_.b+=p[2],_.x+=g%n,_.y+=Math.floor(g/n),m+=Math.sqrt(y);}for(let[g,h]of u.entries())h.n>0&&(c[g]=[h.r/h.n,h.g/h.n,h.b/h.n]);}return {palette:c.map((d,g)=>({color:d,area:u[g].n/l,cx:u[g].n?u[g].x/u[g].n+.5:n/2,cy:u[g].n?u[g].y/u[g].n+.5:o/2})).filter(d=>d.area>=Mc).sort((d,g)=>g.area-d.area),error:m/l}}function x1(t,e,n){let o=e+2,r=n+2,a=(m,f)=>m<=0||f<=0||m>e||f>n?0:t[(f-1)*e+(m-1)],i=new Map,l=new Map,s=m=>{let f=l.get(m);if(f)return f;let d=Math.floor(m/2),g=d%o,h=Math.floor(d/o),p=a(g,h),b=m%2===1,y=b?a(g,h+1):a(g+1,h),_=p===y?.5:Math.min(1,Math.max(0,(.5-p)/(y-p))),w=b?[g-.5,h-.5+_]:[g-.5+_,h-.5];return l.set(m,w),w},c=(m,f)=>{i.set(m,f);};for(let m=0;m<r-1;m++)for(let f=0;f<o-1;f++){let d=a(f,m)>=.5,g=a(f+1,m)>=.5,h=a(f+1,m+1)>=.5,p=a(f,m+1)>=.5,b=2*(m*o+f),y=2*((m+1)*o+f),_=2*(m*o+f)+1,w=2*(m*o+f+1)+1;switch((d?8:0)+(g?4:0)+(h?2:0)+(p?1:0)){case 1:c(y,_);break;case 2:c(w,y);break;case 3:c(w,_);break;case 4:c(b,w);break;case 5:{(a(f,m)+a(f+1,m)+a(f+1,m+1)+a(f,m+1))/4>=.5?(c(b,_),c(y,w)):(c(b,w),c(y,_));break}case 6:c(b,y);break;case 7:c(b,_);break;case 8:c(_,b);break;case 9:c(y,b);break;case 10:{(a(f,m)+a(f+1,m)+a(f+1,m+1)+a(f,m+1))/4>=.5?(c(_,y),c(w,b)):(c(_,b),c(w,y));break}case 11:c(w,b);break;case 12:c(_,w);break;case 13:c(y,w);break;case 14:c(_,y);break;}}let u=[];for(let m of i.keys()){if(!i.has(m))continue;let f=[],d=m;for(;d!==void 0&&i.has(d);){f.push(s(d));let g=i.get(d);i.delete(d),d=g;}f.length>=3&&u.push(f);}return u}function $1(t){let e=0;for(let n=0;n<t.length;n++){let o=t[n],r=t[(n+1)%t.length];e+=o[0]*r[1]-r[0]*o[1];}return e/2}function Rc(t,e){if(t.length<=2)return t;let n=new Uint8Array(t.length);n[0]=1,n[t.length-1]=1;let o=[[0,t.length-1]];for(;o.length>0;){let[r,a]=o.pop(),i=t[r],l=t[a],s=l[0]-i[0],c=l[1]-i[1],u=Math.hypot(s,c)||1,m=-1,f=e;for(let d=r+1;d<a;d++){let g=t[d],h=Math.abs(c*(g[0]-i[0])-s*(g[1]-i[1]))/u;h>f&&(f=h,m=d);}m>=0&&(n[m]=1,o.push([r,m],[m,a]));}return t.filter((r,a)=>n[a]===1)}function S1(t,e){let n=0,o=-1;for(let[i,l]of t.entries()){let s=(l[0]-t[0][0])**2+(l[1]-t[0][1])**2;s>o&&(o=s,n=i);}let r=Rc(t.slice(0,n+1),e),a=Rc([...t.slice(n),t[0]],e);return [...r.slice(0,-1),...a.slice(0,-1)]}var Ce=t=>K(t,2);function w1(t,e){let n=t.length,o=(a,i)=>{let l=Math.hypot(i[0]-a[0],i[1]-a[1])||1,s=Math.min(.5,e/l);return [a[0]+(i[0]-a[0])*s,a[1]+(i[1]-a[1])*s]},r="";for(let a=0;a<n;a++){let i=t[a],l=o(i,t[(a-1+n)%n]),s=o(i,t[(a+1)%n]);r+=a===0?`M${Ce(l[0])} ${Ce(l[1])}`:`L${Ce(l[0])} ${Ce(l[1])}`,r+=`Q${Ce(i[0])} ${Ce(i[1])} ${Ce(s[0])} ${Ce(s[1])}`;}return `${r}Z`}function C1(t,e,n){let o="";for(let r of x1(t,e,n)){if(Math.abs($1(r))<.8)continue;let a=S1(r,.18);a.length>=3&&(o+=w1(a,.9));}return o}var M1=.075;function Ec(t){let{width:e,height:n,data:o}=t,r=g1(t),a=0;for(let h of r)a+=h;let{palette:i,error:l}=_1(t,r),s={width:e,height:n,palette:i,alpha:r,coverage:a/(e*n)};if(i.length===0||l>M1)return {...s,layers:[],photographic:i.length>0};let c=i.length,u=Array.from({length:c},()=>new Float32Array(e*n)),m=i.map(h=>h.color);for(let h=0;h<r.length;h++){let p=r[h];if(p<=0)continue;let b=h*4,y=[kt(o[b]),kt(o[b+1]),kt(o[b+2])],_=0,w=-1,C=Number.POSITIVE_INFINITY,S=Number.POSITIVE_INFINITY;for(let v=0;v<c;v++){let I=gr(y,m[v]);I<C?(w=_,S=C,_=v,C=I):I<S&&(w=v,S=I);}if(w<0||C<1e-6){u[_][h]=p;continue}let x=m[_],M=m[w],R=[M[0]-x[0],M[1]-x[1],M[2]-x[2]],E=Math.min(1,Math.max(0,((y[0]-x[0])*R[0]+(y[1]-x[1])*R[1]+(y[2]-x[2])*R[2])/(R[0]**2+R[1]**2+R[2]**2)));u[_][h]=p*(1-E),u[w][h]=p*E;}let f=[],d=new Float32Array(e*n),g=new Array(c);for(let h=c-1;h>=0;h--){let p=u[h];for(let b=0;b<d.length;b++)d[b]+=p[b];g[h]=d.slice();}for(let h=0;h<c;h++){let p=C1(g[h],e,n);p&&f.push({color:m[h],d:p});}return {...s,layers:f,photographic:false}}var kc=.6,_i={logo:160,halftone:160};function R1(t){let e="";for(let o=0;o<t.length;o+=32768)e+=String.fromCharCode(...t.subarray(o,o+32768));return btoa(e)}var kn=class{entries=new Map;limit;constructor(e){this.limit=e;}get(e,n){let o=this.entries.get(e);if(o!==void 0)return this.entries.delete(e),this.entries.set(e,o),o;let r=n();if(this.entries.size>=this.limit){let a=this.entries.keys().next().value;a!==void 0&&this.entries.delete(a);}return this.entries.set(e,r),r}},E1=new kn(8);function A1(t){return E1.get(t,()=>{let e=atob(t),n=new Uint8Array(e.length);for(let o=0;o<e.length;o++)n[o]=e.charCodeAt(o);return n})}function xi(t){let{width:e,height:n,data:o}=t;if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>jn||n>jn||typeof o!="string")return null;try{let r=A1(o);return r.length===e*n*4?{width:e,height:n,data:r}:null}catch{return null}}function Fc(t,e={}){let{width:n,height:o,data:r}=t;if(!(n>0&&o>0)||r.length<n*o*4)throw new Error("Art image pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=Math.min(n,o),i=e.square?Math.floor((n-a)/2):0,l=e.square?Math.floor((o-a)/2):0,s=e.square?a:n,c=e.square?a:o,u=Math.min(Math.max(Math.round(e.maxSize??_i.halftone),1),jn),m=Math.min(1,u/Math.max(s,c)),f=Math.max(1,Math.round(s*m)),d=Math.max(1,Math.round(c*m)),g=new Uint8Array(f*d*4);for(let h=0;h<d;h++){let p=Math.floor(h*c/d),b=Math.max(p+1,Math.floor((h+1)*c/d));for(let y=0;y<f;y++){let _=Math.floor(y*s/f),w=Math.max(_+1,Math.floor((y+1)*s/f)),C=0,S=0,x=0,M=0,R=0;for(let v=p;v<b;v++)for(let I=_;I<w;I++){let L=((v+l)*n+I+i)*4,T=r[L+3]/255;C+=r[L]*T,S+=r[L+1]*T,x+=r[L+2]*T,M+=T,R++;}let E=(h*f+y)*4;g[E]=M>0?Math.round(C/M):0,g[E+1]=M>0?Math.round(S/M):0,g[E+2]=M>0?Math.round(x/M):0,g[E+3]=Math.round(M/R*255);}}return {width:f,height:d,data:R1(g)}}async function P1(t){if(typeof t!="string"&&!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=typeof t=="string"?t:URL.createObjectURL(t);try{return await new Promise((n,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>n(r),r.onerror=()=>o(new Error("Could not load the art image")),r.src=e;})}finally{typeof t!="string"&&setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function v1(t,e={}){if(typeof document>"u")throw new Error("loadQRArtImage needs a browser; pass decoded pixels to createQRArtImage instead");let n=e.mode??"halftone",o=e.maxSize??_i[n],r=await P1(t),a=r.naturalWidth||r.width||o,i=r.naturalHeight||r.height||o,l=n==="halftone",s=Math.min(1,o*4/(l?Math.min(a,i):Math.max(a,i))),c=Math.max(1,Math.round(a*s)),u=Math.max(1,Math.round(i*s)),m=document.createElement("canvas");m.width=c,m.height=u;let f=m.getContext("2d",{willReadFrequently:true});if(!f)throw new Error("Could not get a canvas context");f.imageSmoothingQuality="high",f.drawImage(r,0,0,c,u);let d;try{d=f.getImageData(0,0,c,u);}catch{throw new Error("Could not read the art image (cross-origin images need CORS); upload it instead")}finally{m.remove();}return Fc(d,{maxSize:o,square:l})}function $i(t){return !!(t&&Gr.includes(t.mode)&&t.image&&xi(t.image))}function ho(t){let e=xa[t.mode];return t.variant&&e.includes(t.variant)?t.variant:e[0]}function I1(t,e){if(t===1)return [];let n=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(n*2-2))*2,r=[6];for(let a=e-7;r.length<n;a-=o)r.splice(1,0,a);return r}function br(t,e){let n=I1(t,e),o=n.length-1,r=[];for(let[a,i]of n.entries())for(let[l,s]of n.entries())a===0&&l===0||a===0&&l===o||a===o&&l===0||r.push([i,s]);return r}var L1=0,qt=1,Vt=2,Me=3,Ac=4,Pc=new Map;function Tc(t){let e=Pc.get(t);if(e)return e;let n=t*4+17,o=new Uint8Array(n*n),r=(a,i,l,s,c)=>{for(let u=Math.max(0,i);u<Math.min(n,i+s);u++)for(let m=Math.max(0,a);m<Math.min(n,a+l);m++)o[u*n+m]=c;};r(6,0,1,n,Ac),r(0,6,n,1,Ac),r(0,8,9,1,Me),r(8,0,1,9,Me),r(n-8,8,8,1,Me),r(8,n-8,1,8,Me),t>=7&&(r(n-11,0,3,6,Me),r(0,n-11,6,3,Me));for(let[a,i]of br(t,n))r(a-2,i-2,5,5,Vt);return r(0,0,8,8,qt),r(n-8,0,8,8,qt),r(0,n-8,8,8,qt),Pc.set(t,o),o}function k1(t){let e=t*4+17,n=Tc(t);return Array.from({length:e},(o,r)=>Array.from({length:e},(a,i)=>n[r*e+i]!==L1))}function F1(t){let e=t[8],n=e?.[0]?1:0,o=e?.[1]?1:0,r=(1-n)*2+o;return ["M","L","H","Q"][r]??"M"}function Fn(t,e){let n=lt(t);return !n||n.a===0?e:[n.r/255,n.g/255,n.b/255]}var Ye=(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n];function Re(t,e,n,o){let r=tt(t);if(o?r<=n:r>=n)return t;let a=tt(e);return Math.abs(r-a)<1e-6?e:Ye(t,e,Math.min(1,Math.max(0,(r-n)/(r-a))))}var Nc=t=>Math.max(...t)-Math.min(...t),T1=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,bi=t=>t.toString(16).padStart(2,"0");function Ft(t,e=1){let n=o=>Math.min(255,Math.round(Math.round(Math.min(Math.max(o,0),1)*255)/e)*e);return `#${bi(n(t[0]))}${bi(n(t[1]))}${bi(n(t[2]))}`}function N1(t){let e=t<0?-1:1,n=Math.abs(t),o=1/(1+.3275911*n),r=1-((((1.061405429*o-1.453152027)*o+1.421413741)*o-.284496736)*o+.254829592)*o*Math.exp(-n*n);return e*r}var Si=.3,vc=t=>1-Math.exp(-((t/2)**2)/(2*Si**2)),O1=t=>N1(t/(2*Si*Math.SQRT2))**2,D1=(t,e,n)=>{let o=Math.min(1,Math.max(0,(n-t)/(e-t)));return o*o*(3-2*o)};function wi(t,e,n,o){let r=o==="cover"?Math.max(n/t,n/e):Math.min(n/t,n/e);return {scale:r,offsetX:(n-t*r)/2,offsetY:(n-e*r)/2}}function Oc(t,e){let{width:n,height:o,data:r}=t,a=new Float32Array(n*o*3),i=e??new Float32Array(n*o);for(let l=0;l<n*o;l++)a[l*3]=r[l*4]/255,a[l*3+1]=r[l*4+1]/255,a[l*3+2]=r[l*4+2]/255,e||(i[l]=r[l*4+3]/255);return {width:n,height:o,rgb:a,alpha:i}}function B1(t){let e=Oc(t),{rgb:n,alpha:o}=e,r=new Float64Array(256),a=0;for(let m=0;m<o.length;m++){if(o[m]<.5)continue;let f=tt([n[m*3],n[m*3+1],n[m*3+2]]);r[Math.min(255,Math.floor(f*256))]+=1,a++;}let i=m=>{let f=0;for(let d=0;d<256;d++)if(f+=r[d],f>=m*a)return d/255;return 1},l=a?i(.01):0,s=a?i(.99):1;s-l<.15&&(l=0,s=1);let c=Math.min(1.6,1/(s-l)),u=(l+s)/2;for(let m=0;m<o.length;m++){let f=[n[m*3],n[m*3+1],n[m*3+2]],d=tt(f),g=.5+(d-u)*c;for(let h=0;h<3;h++)n[m*3+h]=Math.min(1,Math.max(0,g+(f[h]-d)*1.12));}return e}function Dc(t,e,n,o,r=1){let{width:a,height:i,rgb:l,alpha:s}=t,c=Math.min(Math.max(e-.5,0),a-1),u=Math.min(Math.max(n-.5,0),i-1),m=Math.floor(c),f=Math.floor(u),d=Math.min(m+1,a-1),g=Math.min(f+1,i-1),h=c-m,p=u-f,b=0,y=0,_=0,w=0,C=(x,M,R)=>{let E=M*a+x,v=s[E]*R;b+=l[E*3]*v,y+=l[E*3+1]*v,_+=l[E*3+2]*v,w+=v;};if(C(m,f,(1-h)*(1-p)),C(d,f,h*(1-p)),C(m,g,(1-h)*p),C(d,g,h*p),w<=0)return o;let S=w*r;return [o[0]+(b/w-o[0])*S,o[1]+(y/w-o[1])*S,o[2]+(_/w-o[2])*S]}var G1=new kn(4),Q1=new kn(6),U1=new kn(6);function Ci(t,e){return Q1.get(t.image.data,()=>Ec(e))}function Bc(t,e,n){return U1.get(t.image.data,()=>Oc(e,n.alpha))}var Ct=t=>K(t,2),Gc=t=>K(t,4),Ke=class{groups=new Map;add(e,n){let o=this.groups.get(e);o?o.push(n):this.groups.set(e,[n]);}cellRun(e,n,o,r){this.add(e,`M${n} ${o}h${r}.04v1.04h-${r}.04z`);}circle(e,n,o,r){this.add(e,H1(n,o,r));}toElements(e){return [...this.groups].map(([n,o],r)=>P("path",{d:o.join(""),fill:n},`${e}-${r}`))}};function H1(t,e,n){let o=Ct(n*2),r=Ct(n);return `M${Ct(t-n)} ${Ct(e)}a${r} ${r} 0 1 0 ${o} 0a${r} ${r} 0 1 0 ${-o} 0z`}function Ze(t,e,n,o,r){let a=Math.min(r,n/2,o/2);if(a<=0)return `M${Ct(t)} ${Ct(e)}h${Ct(n)}v${Ct(o)}h${Ct(-n)}z`;let i=Ct(a);return `M${Ct(t+a)} ${Ct(e)}h${Ct(n-2*a)}a${i} ${i} 0 0 1 ${i} ${i}v${Ct(o-2*a)}a${i} ${i} 0 0 1 ${-i} ${i}h${Ct(-(n-2*a))}a${i} ${i} 0 0 1 ${-i} ${-i}v${Ct(-(o-2*a))}a${i} ${i} 0 0 1 ${i} ${-i}z`}function Qc(t,e,n){let o="";for(let[r,a]of t){let i=(r-2+e)*n,l=(a-2+e)*n;o+=Ze(i,l,5*n,5*n,n*.35),o+=Ze(i+n,l+n,3*n,3*n,n*.15),o+=Ze(i+2*n,l+2*n,n,n,n*.12);}return o}var z1={blend:1,badge:1,color:.9,mono:.7},fo=.35;function q1(t,e){let n=Fn(t,[0,0,0]),o=Fn(e,[1,1,1]),r=tt(o)-tt(n);return r>=fo?null:r<=-fo?"inverted":"low-contrast"}function Uc(t,e,n){let o=Math.min(Math.max(t.intensity??kc,0),z1[ho(t)]);return tt(n)-tt(e)>=fo?o:0}function W1(t){let{art:e,modules:n,version:o}=t,r=e.image&&xi(e.image);if(!(r&&Gr.includes(e.mode)))return null;let a=n.length;if(a!==o*4+17)return null;let i=Fn(t.fgColor,[0,0,0]),l=Fn(t.bgColor,[1,1,1]),s=Uc(e,i,l);return s<=0?null:{art:e,image:r,modules:n,size:a,version:o,kinds:Tc(o),margin:t.margin,pixelSize:t.pixelSize,t:s,fg:i,bg:l,variant:ho(e),body:t.body}}function Mi(t){let e=W1(t);if(!e)return null;let n;return e.art.mode==="halftone"?n=e.variant==="mono"?K1(e):Y1(e):n=e.variant==="badge"?sh(e):J1(e),P("g",{"data-qrdx-art":e.art.mode,"data-qrdx-art-variant":e.variant,children:n})}function V1(t,e){return {margin:.42-.17*t+(e===3?.04:0),darkCap:.4+.3*t}}var Hc=8.5,Ic=new Map;function Ri(t){let e=t*4+17,n=Ic.get(t);if(!n){let a=e*2,i=new Uint8Array(a*a),l=Hc*2;for(let s=0;s<a;s++)for(let c=0;c<a;c++){let u=c<l||c>=a-l,m=s<l||s>=a-l;u&&m&&!(c>=a-l&&s>=a-l)&&(i[s*a+c]=1);}for(let[s,c]of br(t,e))for(let u=(c-2)*2-1;u<(c+3)*2+1;u++)for(let m=(s-2)*2-1;m<(s+3)*2+1;m++)m>=0&&u>=0&&m<a&&u<a&&(i[u*a+m]=1);Ic.set(t,i),n=i;}let o=n,r=e*2;return (a,i)=>{let l=Math.floor(a*2),s=Math.floor(i*2);return l>=0&&s>=0&&l<r&&s<r&&o[s*r+l]===1}}function zc(t,e,n=false){let{image:o,size:r,kinds:a,fg:i,bg:l}=t,s=G1.get(t.art.image.data,()=>B1(o)),c=wi(o.width,o.height,r,"cover"),u=r*e,m=new Float32Array(u*u*3).fill(Number.NaN),d=1/(e*c.scale)>1.3?2:1,g=tt(l)-.1*(tt(l)-tt(i)),h=Ri(t.version);for(let p=0;p<r;p++)for(let b=0;b<r;b++){let y=a[p*r+b],_=y===qt||y===Vt;if(!(_&&!n))for(let w=0;w<e;w++)for(let C=0;C<e;C++){let S=0,x=0,M=0;for(let F=0;F<d;F++)for(let k=0;k<d;k++){let q=b+(C+(k+.5)/d)/e,H=p+(w+(F+.5)/d)/e,G=Dc(s,(q-c.offsetX)/c.scale,(H-c.offsetY)/c.scale,l);S+=G[0],x+=G[1],M+=G[2];}let R=d*d,E=[S/R,x/R,M/R],v=b+(C+.5)/e,I=p+(w+.5)/e,L=Math.min(v,I,r-v,r-I);L<1.5&&(E=Ye(E,l,.35*(1-L/1.5))),n&&(_||h(v,I))&&(E=Re(E,l,g,false));let T=((p*e+w)*u+b*e+C)*3;m[T]=E[0],m[T+1]=E[1],m[T+2]=E[2];}}return {n:e,count:u,rgb:m}}function X1(t,e,n){let{size:o,kinds:r,modules:a,fg:i,bg:l,t:s}=t,{n:c,count:u,rgb:m}=e,f=tt(i),d=tt(l),g=d-f,h=V1(s,c),p=M=>.2126*m[M]+.7152*m[M+1]+.0722*m[M+2],b=new Float32Array(o*o),y=new Float32Array(o*o);for(let M=0;M<o;M++)for(let R=0;R<o;R++){let E=r[M*o+R];if(E===qt){b[M*o+R]=d;continue}if(E===Vt){b[M*o+R]=a[M]?.[R]?f:d;continue}let v=0,I=0,L=0;for(let T=0;T<c;T++)for(let F=0;F<c;F++){let k=p(((M*c+T)*u+R*c+F)*3);v+=k,n.under[T*c+F]||(I+=k,L++);}b[M*o+R]=v/(c*c),y[M*o+R]=L?I/L:v/(c*c);}let _=o+1,w=new Float64Array(_*_);for(let M=0;M<o;M++)for(let R=0;R<o;R++)w[(M+1)*_+R+1]=b[M*o+R]+w[M*_+R+1]+w[(M+1)*_+R]-w[M*_+R];let C=2,S=(M,R)=>{let E=Math.max(0,M-C),v=Math.max(0,R-C),I=Math.min(o,M+C+1),L=Math.min(o,R+C+1);return (w[L*_+I]-w[v*_+I]-w[L*_+E]+w[v*_+E])/((I-E)*(L-v))},x=n.weight;for(let M=0;M<o;M++)for(let R=0;R<o;R++){let E=r[M*o+R];if(E===qt||E===Vt)continue;let v=E===Me,I=(h.margin+(v?.08:0))*g,L=(h.darkCap-(v?.12:0))*g,T=(x*((n.light-n.dark)/2)-I)/(1-x),F=S(R,M),k=y[M*o+R],q=!!a[M]?.[R],H=0,G=l;if(q){let U=Math.min(F+T,f+L);k>U&&(H=(k-U)/Math.max(k-f,1e-6),G=i);}else {let U=Math.max(F-T,d-L);k<U&&(H=(U-k)/Math.max(d-k,1e-6));}if(!(H<=0)){H=Math.min(1,H);for(let U=0;U<c;U++)for(let Z=0;Z<c;Z++){let rt=((M*c+U)*u+R*c+Z)*3;for(let W=0;W<3;W++)m[rt+W]+=(G[W]-m[rt+W])*H;}}}}function qc(t,e,n,o){let{count:r}=e,a=new Ke;for(let s=0;s<r;s++){let c=0,u=n(s*r);for(let m=1;m<=r;m++){let f=m<r?n(s*r+m):null;(m===r||f!==u)&&(u&&a.cellRun(u,c,s,m-c),c=m,u=f);}}let i=t.pixelSize/e.n,l=Ct(t.margin*t.pixelSize);return P("g",{transform:`translate(${l} ${l}) scale(${Gc(i)})`,children:a.toElements(o)},o)}function Ei(t,e){let n=br(t.version,t.size);return n.length===0?[]:[P("path",{d:Qc(n,t.margin,t.pixelSize),fill:e,fillRule:"evenodd"},"art-alignment")]}function Wc(t){let{image:e,size:n}=t;return Math.floor(Math.min(e.width,e.height)/n)>=4&&n<=45?4:3}var j1=t=>2*Si*Math.sqrt(-2*Math.log(1-Math.min(t,.95)));function Z1(t,e,n){let o=e+1,r=new Float64Array(o*o);for(let i=0;i<e;i++)for(let l=0;l<e;l++)r[(i+1)*o+l+1]=t[i*e+l]+r[i*o+l+1]+r[(i+1)*o+l]-r[i*o+l];let a=new Float32Array(e*e);for(let i=0;i<e;i++)for(let l=0;l<e;l++){let s=Math.max(0,l-n),c=Math.max(0,i-n),u=Math.min(e,l+n+1),m=Math.min(e,i+n+1);a[i*e+l]=(r[m*o+u]-r[c*o+u]-r[m*o+s]+r[c*o+s])/((u-s)*(m-c));}return a}function Vc(t,e,n,o){let{size:r,kinds:a,modules:i,fg:l,bg:s}=t,c=tt(l),u=tt(s),m=u-c,f=Z1(e,r,2),d=new Float32Array(r*r),g=new Float32Array(r*r).fill(Number.NaN);for(let h=0;h<r;h++)for(let p=0;p<r;p++){let b=h*r+p,y=a[b];if(y===qt||y===Vt)continue;let _=y===Me,w=o.base+(_?.08:0),C=(o.margin+(_?.03:0))*m,S=(o.cap-(_?.04:0))*m,x=vc(w),M=vc(_?Math.max(o.max,.94):o.max),R=x*((o.dark+o.light)/2)+(1-x)*f[b],E=n[b],v=!!i[h]?.[p],I=v?o.dark:o.light,L=v?Math.min(R-C,c+S):Math.max(R+C,u-S),F=(v?E<=L:E>=L)?0:(E-L)/(E-I);F>M&&(F=M,g[b]=Math.min(u,Math.max(c,(L-M*I)/(1-M))));let k=v?E<=L-.06:E>=L+.06;o.skip&&k&&!_||(F=Math.max(F,x)),d[b]=F>0?j1(F):0;}return {diameter:d,surround:g}}function Y1(t){let{size:e,kinds:n,modules:o,fg:r,bg:a,t:i,margin:l,pixelSize:s}=t,c=Wc(t),u=zc(t,c,true),m=tt(r),f=tt(a),d=m+.1*(f-m),g=f-.05*(f-m),{count:h,rgb:p}=u,b=(S,x,M,R)=>((x*c+R)*h+S*c+M)*3,y=new Float32Array(e*e);for(let S=0;S<e;S++)for(let x=0;x<e;x++){let M=n[S*e+x];if(M===qt||M===Vt){y[S*e+x]=M===Vt&&o[S]?.[x]?m:f;continue}let R=0;for(let E=0;E<c;E++)for(let v=0;v<c;v++){let I=b(x,S,v,E);R+=.2126*p[I]+.7152*p[I+1]+.0722*p[I+2];}y[S*e+x]=R/(c*c);}let _=Vc(t,y,y,{base:.6-.28*i,max:.86,dark:d,light:g,margin:.2-.1*i,cap:.4+.14*i,skip:false});for(let S=0;S<e;S++)for(let x=0;x<e;x++){let M=_.surround[S*e+x];if(Number.isNaN(M))continue;let R=y[S*e+x],v=M<R?r:a,I=Math.min(1,Math.abs(R-M)/Math.max(Math.abs(R-tt(v)),1e-6));for(let L=0;L<c;L++)for(let T=0;T<c;T++){let F=b(x,S,T,L);for(let k=0;k<3;k++)p[F+k]+=(v[k]-p[F+k])*I;}}let w=[qc(t,u,S=>{let x=S*3;return Number.isNaN(p[x])?null:Ft([p[x],p[x+1],p[x+2]],8)},"art-photo")],C=new Ke;for(let S=0;S<e;S++)for(let x=0;x<e;x++){let M=_.diameter[S*e+x];if(!(M>0))continue;let R=0,E=0,v=0;for(let T=0;T<c;T++)for(let F=0;F<c;F++){let k=b(x,S,F,T);R+=p[k],E+=p[k+1],v+=p[k+2];}let I=[R/(c*c),E/(c*c),v/(c*c)],L=o[S]?.[x]?Re(I,r,d,true):Re(I,a,g,false);C.circle(Ft(L,10),(x+l+.5)*s,(S+l+.5)*s,M/2*s);}return w.push(...C.toElements("art-dot"),...Ei(t,Ft(r))),w}function K1(t){let{size:e,kinds:n,modules:o,fg:r,bg:a}=t,i=Wc(t),l=zc(t,i),s=tt(r),c=tt(a),u=i%2===1?1:2,m=(i-u)/2,f=R=>R>=m&&R<m+u,d=[];for(let R=0;R<i;R++)for(let E=0;E<i;E++)d.push(f(E)&&f(R));X1(t,l,{weight:O1(u/i),dark:s,light:c,under:d});let{count:g,rgb:h}=l,p=new Float32Array(g*g),b=new Int8Array(g*g).fill(-1);for(let R=0;R<g*g;R++){let E=R*3;if(Number.isNaN(h[E])){p[R]=Number.NaN;continue}let v=(.2126*h[E]+.7152*h[E+1]+.0722*h[E+2]-s)/(c-s);p[R]=.5+(D1(0,1,v)-.5)*1.15;}for(let R=0;R<e;R++)for(let E=0;E<e;E++){let v=n[R*e+E];if(!(v===qt||v===Vt))for(let I=m;I<m+u;I++)for(let L=m;L<m+u;L++)b[(R*i+I)*g+E*i+L]=o[R]?.[E]?0:1;}let y=Ri(t.version);for(let R=0;R<g;R++)for(let E=0;E<g;E++){let v=R*g+E;b[v]<0&&y((E+.5)/i,(R+.5)/i)&&(b[v]=1);}let _=new Uint8Array(g*g),w=.3,C=0,S=0,x=(R,E,v)=>{if(R<0||R>=g||E>=g)return;let I=E*g+R;if(!Number.isNaN(p[I])){let L=Math.floor(R/i)===Math.floor(C/i)&&Math.floor(E/i)===Math.floor(S/i);p[I]+=L?v:v*w;}};for(let R=0;R<g;R++){let E=R%2===0?1:-1;for(let v=0;v<g;v++){let I=E===1?v:g-1-v,L=R*g+I,T=p[L];if(Number.isNaN(T))continue;let F=b[L]>=0?b[L]:T>=.5?1:0;_[L]=F===0?1:0;let k=Math.min(.75,Math.max(-0.75,T-F));C=I,S=R,x(I+E,R,k*7/16),x(I-E,R+1,k*3/16),x(I,R+1,k*5/16),x(I+E,R+1,k/16);}}let M=Ft(r);return [qc(t,l,R=>_[R]?M:null,"art-halftone"),...Ei(t,M)]}function Lc(t,e){let n=null,o=0;for(let r of t.palette){if(e&&T1(r.color,e)<.02)continue;let a=r.area*(.35+Nc(r.color))*(tt(r.color)>.86?.05:1);a>o&&(o=a,n=r.color);}return n}function Xc(t,e,n,o,r){let a;if(t.photographic){let i=new Ke,{width:l,height:s,rgb:c,alpha:u}=e;for(let m=0;m<s;m++){let f=0,d=null;for(let g=0;g<=l;g++){let h=m*l+g,p=g<l&&u[h]>=.5?Ft(o([c[h*3],c[h*3+1],c[h*3+2]]),6):null;(g===l||p!==d)&&(d&&i.cellRun(d,f,m,g-f),f=g,d=p);}}a=i.toElements(`${r}-px`);}else a=t.layers.map((i,l)=>P("path",{d:i.d,fill:Ft(o(i.color)),fillRule:"evenodd"},`${r}-${l}`));return P("g",{transform:`translate(${Ct(n.x)} ${Ct(n.y)}) scale(${Gc(n.scale)})`,children:a},r)}function J1(t){let{art:e,image:n,size:o,kinds:r,modules:a,fg:i,bg:l,t:s,margin:c,pixelSize:u}=t,m=Ci(e,n),f=Bc(e,n,m),d=wi(m.width,m.height,o,"contain"),g=Math.min(1,.3+1.4*s),h=k=>Ye(l,k,g),p=Ft(l),b=Ft(i),y=[Xc(m,f,{x:(c+d.offsetX)*u,y:(c+d.offsetY)*u,scale:d.scale*u},h,"art-logo")],_=Hc,w=(k,q)=>Ze((k+c)*u,(q+c)*u,(_+.4)*u,(_+.4)*u,1.2*u),C=br(t.version,o).map(([k,q])=>Ze((k-2.5+c)*u,(q-2.5+c)*u,6*u,6*u,u*.8)).join("");y.push(P("path",{d:w(-0.4,-0.4)+w(o-_,-0.4)+w(-0.4,o-_)+C,fill:p},"art-plates"));let S=Ri(t.version),x=tt(l),M=tt(i),R=new Float32Array(o*o),E=new Float32Array(o*o),v=new Array(o*o);for(let k=0;k<o;k++)for(let q=0;q<o;q++){let H=k*o+q,G=r[H];if(G===qt||G===Vt){R[H]=G===Vt&&a[k]?.[q]?M:x;continue}let U=1,Z=0,rt=0,W=0,O=0;for(let N=0;N<4;N++)for(let _t=0;_t<4;_t++){let At=q+(_t+.5)/4,Fe=k+(N+.5)/4,Gt=S(At,Fe)?l:Dc(f,(At-d.offsetX)/d.scale,(Fe-d.offsetY)/d.scale,l,g),Dt=tt(Gt);U=Math.min(U,Dt),Z+=Dt,rt+=Gt[0],W+=Gt[1],O+=Gt[2];}R[H]=Z/16,E[H]=U,v[H]=[rt/16,W/16,O/16];}let I=M+.08*(x-M),L=x-.04*(x-M),T=Vc(t,R,R,{base:.74-.26*s,max:.9,dark:I,light:L,margin:.23-.1*s,cap:.4+.1*s,skip:s>=.7}),F=new Ke;for(let k=0;k<o;k++)for(let q=0;q<o;q++){let H=k*o+q,G=T.diameter[H],U=!!a[k]?.[q];if(!(G>0)||!U&&E[H]>=x-.02)continue;let Z=U?Re(v[H],i,I,true):Re(v[H],l,L,false);F.circle(Ft(Z,8),(q+c+.5)*u,(k+c+.5)*u,G/2*u);}return y.push(...F.toElements("art-dot")),y.push(...Ei(t,b)),y}var th={L:.5,M:.72,Q:.88,H:1},jc=.32,Zc=.55,eh=.6,nh=2;function Yc(t,e,n){let o=e>=1?t:t*e,r=e>=1?t/e:t,a=Math.max(.7,t*.09),i=o+2*a,l=r+2*a;return {logoW:o,logoH:r,plateW:i,plateH:l,radius:Math.min(i,l)*.26,cx:n/2,cy:n/2}}var Kc=t=>({cx:t.cx,cy:t.cy,w:t.plateW,h:t.plateH,r:t.radius});function Jc(t,e,n){return eu(e+.5,n+.5,t)<Zc}function rh(t,e){let n=Kc(t),o=Zc+1,r=Math.max(0,Math.floor(t.cx-t.plateW/2-o)),a=Math.min(e-1,Math.ceil(t.cx+t.plateW/2+o)),i=Math.max(0,Math.floor(t.cy-t.plateH/2-o)),l=Math.min(e-1,Math.ceil(t.cy+t.plateH/2+o)),s=[];for(let c=i;c<=l;c++)for(let u=r;u<=a;u++)Jc(n,u,c)&&s.push(c*e+u);return s}var oh=t=>Math.floor(t.correctable*eh);function yi(t,e,n){let o=Yc(t,e,n.size),r=oh(n);return fr(n,rh(o,n.size)).every(a=>a<=r)}function tu(t,e,n){if(yi(n,e,t))return n;let o=0,r=n;if(!yi(o,e,t))return -1;for(;r-o>1/64;){let a=(o+r)/2;yi(a,e,t)?o=a:r=a;}return o}var mo=new Map;function ah(t,e){let n=`${t.version}${t.level}:${e.toFixed(3)}`,o=mo.get(n);return o===void 0&&(o=tu(t,e,jc*t.size),mo.size>=64&&mo.clear(),mo.set(n,o)),o}function ih(t,e){let{size:n,t:o,modules:r,version:a}=t,i=F1(r),l=(.18+.15*o)*th[i],s=e.width/e.height,c=Math.min(jc,l)*n,u=dr(a,i),m=Math.max(0,ah(u,s));if(m<nh)return {wantedBox:c,maxBox:m,box:0,plate:null};let f=tu(u,s,Math.min(c,m));return f<0?{wantedBox:c,maxBox:m,box:0,plate:null}:{wantedBox:c,maxBox:m,box:f,plate:Yc(f,s,n)}}function eu(t,e,n){let o=Math.abs(t-n.cx)-(n.w/2-n.r),r=Math.abs(e-n.cy)-(n.h/2-n.r);return Math.hypot(Math.max(o,0),Math.max(r,0))+Math.min(Math.max(o,r),0)-n.r}function nu(t,e){let{fg:n,bg:o,t:r}=t,a=tt(n),i=tt(o),l=Lc(e),s=Math.min(1,r/.6),c=l?Re(l,n,a+.3*(i-a),true):n,u=Ye(n,c,s),m=l?Lc(e,l):null,f=a+.42*(i-a),d=m&&tt(m)<=f+.22?Ye(n,Re(m,n,f,true),s):u;return {body:u,inner:d}}function sh(t){let{art:e,image:n,size:o,kinds:r,modules:a,bg:i,margin:l,pixelSize:s,version:c}=t,u=Ci(e,n),m=ih(t,u).plate,{body:f}=nu(t,u),d=Ft(f),g=m&&Kc(m),h=a.map(v=>[...v]);for(let v=0;v<o;v++)for(let I=0;I<o;I++){let L=r[v*o+I];(L===Vt||g&&L!==qt&&Jc(g,I,v))&&(h[v][I]=false);}let p=[],b=t.body?.(h);if(b)p.push(P("g",{fill:d,children:b},"art-body"));else {let v=new Ke;for(let I=0;I<o;I++)for(let L=0;L<o;L++)h[I]?.[L]&&r[I*o+L]!==qt&&v.circle(d,(L+l+.5)*s,(I+l+.5)*s,.45*s);p.push(...v.toElements("art-body"));}let y=br(c,o).filter(([v,I])=>!g||eu(v+.5,I+.5,g)>3.2);if(y.length>0&&p.push(P("path",{d:Qc(y,l,s),fill:d,fillRule:"evenodd"},"art-alignment")),!m)return p;let _=Bc(e,n,u),w=(m.cx-m.plateW/2+l)*s,C=(m.cy-m.plateH/2+l)*s,S=m.plateW*s,x=m.plateH*s,M=m.radius*s,R=.1*s,E=Ze(w,C,S,x,M);return p.push(P("path",{d:E,fill:Ft(i)},"art-plate"),P("path",{d:E+Ze(w+R,C+R,S-2*R,x-2*R,M-R),fill:Ft(Ye(i,f,.16)),fillRule:"evenodd"},"art-plate-ring"),Xc(u,_,{x:(m.cx-m.logoW/2+l)*s,y:(m.cy-m.logoH/2+l)*s,scale:m.logoW/u.width*s},v=>v,"art-logo")),p}function Ai(t){let{art:e}=t;if(e.mode!=="logo"||e.matchEyes===false)return null;let n=e.image&&xi(e.image);if(!n)return null;let o=Fn(t.fgColor,[0,0,0]),r=Fn(t.bgColor,[1,1,1]),a=Uc(e,o,r);if(a<=0)return null;let i=Ci(e,n);if(i.palette.length===0)return null;if(ho(e)==="badge"){let{body:g,inner:h}=nu({fg:o,bg:r,t:a},i),p={outer:Ft(g),inner:Ft(h)};return {topLeft:p,topRight:p,bottomLeft:p}}let l=tt(o),s=tt(r),c=Math.min(1,a/.6),u=t.version*4+17,m=wi(i.width,i.height,u,"contain"),f=.45*Math.max(i.width,i.height),d=(g,h)=>{let p=(g-m.offsetX)/m.scale,b=(h-m.offsetY)/m.scale,y=null,_=0;for(let C of i.palette){if(tt(C.color)>.86)continue;let S=(C.cx-p)**2+(C.cy-b)**2,x=C.area*(.35+Nc(C.color))*Math.exp(-S/(2*f**2));x>_&&(_=x,y=C.color);}if(!y)return {};let w=Re(y,o,l+.42*(s-l),true);return {inner:Ft(Ye(o,w,c))}};return {topLeft:d(3.5,3.5),topRight:d(u-3.5,3.5),bottomLeft:d(3.5,u-3.5)}}var lh=["horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"];function ru(t){return lh.includes(t)}var ou={circle:.95,"circle-large":.85,square:.75,diamond:.95,pacman:.9,rounded:.75,"vertical-line":.8,liquid:.75,"liquid-horizontal":.85,"liquid-vertical":.85,classy:.7,"classy-rounded":.7,leaf:.75,plus:.8,hexagon:.75,star:.85,heart:.85,"random-dots":.85,mosaic:.8,octagon:.8};function po(t,e){if(t===void 0||!Number.isFinite(t))return 1;let n=e?ou[e]??1:Qr;return Math.min(Ca,Math.max(Qr,n,t))}function ch(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}function uh(t,e){if(t===1)return [];let n=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(n*2-2))*2,r=[6];for(let a=e-7;r.length<n;a-=o)r.splice(1,0,a);return r}function Pi(t){let e=(t-17)/4,n=Number.isInteger(e)?uh(e,t):[],o=n.length-1,r=[];for(let[a,i]of n.entries())for(let[l,s]of n.entries())a===0&&l===0||a===0&&l===o||a===o&&l===0||r.push([i,s]);return (a,i)=>r.some(([l,s])=>Math.abs(a-l)<=2&&Math.abs(i-s)<=2)}var mh={liquid:{horizontal:true,vertical:true,thickness:1,radius:()=>1,fillets:true},"liquid-horizontal":{horizontal:true,vertical:false,thickness:.86,radius:()=>1,fillets:false},"liquid-vertical":{horizontal:false,vertical:true,thickness:.86,radius:()=>1,fillets:false},classy:{horizontal:true,vertical:true,thickness:1,radius:t=>t===0||t===2?1:0,fillets:false},"classy-rounded":{horizontal:true,vertical:true,thickness:1,radius:t=>t===0||t===2?1:.4,fillets:false}};function dh(t,e,n,o,r,a){switch(t){case "horizontal-line":{let i=o*.43;return D(e-o/2,n-i,o,2*i)}case "leaf":{let i=o*.5;return D(e-i,n-i,2*i,2*i,[o*.4,o*.05,o*.4,o*.05])}case "plus":{let i=o*.22,l=o*.5;return et([[e-i,n-l],[e+i,n-l],[e+i,n-i],[e+l,n-i],[e+l,n+i],[e+i,n+i],[e+i,n+l],[e-i,n+l],[e-i,n+i],[e-l,n+i],[e-l,n-i],[e-i,n-i]])}case "hexagon":return et(Pn(e,n,o*.54,6));case "star":return et(vn(e,n+o*.04,o*.62,o*.34));case "heart":return In(e,n+o*.02,o*1.08);case "random-dots":return J(e,n,o*(.38+.15*Jr(r,a)));case "mosaic":{let i=o*(.8+.14*Jr(r,a,1))/2,l=[[e-i,n-i],[e+i,n-i],[e+i,n+i],[e-i,n+i]];return et(Fl(l,e,n,(Jr(r,a,2)-.5)*16))}case "octagon":return et(Pn(e,n,o*.48/Math.cos(Math.PI/8),8,22.5));default:return J(e,n,o*.45)}}function au(t,e){let{margin:n,pixelSize:o,pattern:r}=e,a=po(e.scale,r),i=t.length,l=e.plain?()=>false:Pi(i),s=(h,p)=>!e.plain&&ch(h,p,i),c=(h,p)=>h>=0&&p>=0&&h<i&&p<i&&!!t[p]?.[h]&&!s(h,p),u=h=>(h+.5+n)*o,m=[],f=[],d=mh[r];for(let h=0;h<i;h++)for(let p=0;p<i;p++){if(!c(p,h))continue;let b=u(p),y=u(h);if(l(p,h)){m.push(A`M${b-o/2} ${y-o/2}h${o}v${o}h${-o}z`);continue}if(!d){f.push(dh(r,b,y,o*a,p,h));continue}let _=o*d.thickness*a/2,w=d.horizontal&&c(p+1,h),C=d.horizontal&&c(p-1,h),S=d.vertical&&c(p,h-1),x=d.vertical&&c(p,h+1),R=[!(S||C),!(S||w),!(x||w),!(x||C)].map((E,v)=>E?_*d.radius(v):0);f.push(D(b-_,y-_,2*_,2*_,R)),2*_<o&&(w&&f.push(D(b,y-_,o,2*_)),x&&f.push(D(b-_,y,2*_,o)));}if(d?.fillets&&a===1){let h=o*.3;for(let p=0;p<i;p++)for(let b=0;b<i;b++){if(c(b,p)||s(b,p))continue;let y=u(b)-o/2,_=u(p)-o/2,w=y+o,C=_+o;c(b-1,p)&&c(b,p-1)&&c(b-1,p-1)&&f.push(A`M${y} ${_}h${h}A${h} ${h} 0 0 0 ${y} ${_+h}Z`),c(b+1,p)&&c(b,p-1)&&c(b+1,p-1)&&f.push(A`M${w} ${_}v${h}A${h} ${h} 0 0 0 ${w-h} ${_}Z`),c(b+1,p)&&c(b,p+1)&&c(b+1,p+1)&&f.push(A`M${w} ${C}h${-h}A${h} ${h} 0 0 0 ${w} ${C-h}Z`),c(b-1,p)&&c(b,p+1)&&c(b-1,p+1)&&f.push(A`M${y} ${C}v${-h}A${h} ${h} 0 0 0 ${y+h} ${C}Z`);}}let g=[];return f.length>0&&g.push(P("path",{d:f.join("")},"modules")),m.length>0&&g.push(P("path",{d:m.join("")},"alignment")),g}function fh(t){return t==="top-left"?0:t==="top-right"?1:3}function go(t,e,n,o="circle",r="top-left"){let a=n*2,i=n,l=a/3;switch(o){case "leaf":case "leaf-reverse":case "drop":case "drop-reverse":{let s=fh(r),c=(s+2)%4,u=1.3*l,m=.7*l,f=g=>{switch(o){case "leaf":return g===s||g===c;case "leaf-reverse":return !(g===s||g===c);case "drop":return g===s;default:return g===c}},d=[0,1,2,3].map(g=>f(g)?m:u);return P("path",{d:D(t-n,e-n,a,a,d)})}case "extra-rounded":return P("path",{d:D(t-n,e-n,a,a,1.15*l)});case "plus":{let s=1.15*l,c=n;return P("path",{d:et([[t-s,e-c],[t+s,e-c],[t+s,e-s],[t+c,e-s],[t+c,e+s],[t+s,e+s],[t+s,e+c],[t-s,e+c],[t-s,e+s],[t-c,e+s],[t-c,e-s],[t-s,e-s]])})}case "cross-rounded":{let s=1.15*l,c=.5*l;return P("path",{d:D(t-n,e-s,a,2*s,c)+D(t-s,e-n,2*s,a,c)})}case "hexagon":return P("path",{d:et(Pn(t,e,1.72*l,6))});case "octagon":return P("path",{d:et(Pn(t,e,n/Math.cos(Math.PI/8),8,22.5))});case "flower":{let s=.6*l,c=.9*l;return P("path",{d:J(t-s,e-s,c)+J(t+s,e-s,c)+J(t+s,e+s,c)+J(t-s,e+s,c)+J(t,e,1.2*l)})}case "heart":return P("path",{d:In(t,e+.12*l,3.5*l)});case "squircle":return P("path",{d:et(ir(t,e,n,n,4,64))});case "dots":{let s=[];for(let c of [-1,0,1])for(let u of [-1,0,1])s.push(J(t+u*l*.82,e+c*l*.82,.58*l));return P("path",{d:s.join("")})}case "square":return P("rect",{height:$(a),transform:A`rotate(0,${t},${e})`,width:$(a),x:$(t-i),y:$(e-i)});case "rounded":return P("rect",{height:$(a),rx:$(n*.5),ry:$(n*.5),transform:A`rotate(0,${t},${e})`,width:$(a),x:$(t-i),y:$(e-i)});case "diamond":return P("path",{d:A`M ${t-i*.714286} ${e-i*.714286}v ${a*.714286}h ${a*.714286}v -${a*.714286}z`,transform:A`rotate(45,${t},${e})`});case "message":{let s=a/30,c=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}`;return P("path",{clipRule:"evenodd",d:m,transform:A`rotate(0,${t},${e})`})}case "message-reverse":{let s=a/30,c=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}`;return P("path",{clipRule:"evenodd",d:m,transform:A`rotate(-180,${t},${e})`})}case "diya":{let s=a/30,c=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} ${10.714285714285714*s}h ${19.285714285714285*s}v -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} -${10.714285714285714*s}h -${8.571428571428571*s}H ${c(25)}z`;return P("path",{clipRule:"evenodd",d:m,transform:A`rotate(0,${t},${e})`})}case "diya-reverse":{let s=a/30,c=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${c(25)} ${u(35.714285714285715)}v ${19.285714285714285*s}h ${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, ${10.714285714285714*s} -${10.714285714285714*s}v -${19.285714285714285*s}h -${19.285714285714285*s}a ${10.714285714285714*s} ${10.714285714285714*s}, 0, 0, 0, -${10.714285714285714*s} ${10.714285714285714*s}z`;return P("path",{clipRule:"evenodd",d:m,transform:A`rotate(0,${t},${e})`})}case "rounded-triangle":{let s=a/21,c=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${c(33.57142857142857)} ${u(29.285714285714285)}h ${12.857142857142856*s}c ${4.285714285714286*s} 0 ${4.285714285714286*s} ${4.285714285714286*s} ${4.285714285714286*s} ${4.285714285714286*s}v ${12.857142857142856*s}c 0 ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s}h -${12.857142857142856*s}c -${4.285714285714286*s} 0 -${4.285714285714286*s} -${4.285714285714286*s} -${4.285714285714286*s} -${4.285714285714286*s}v -${12.857142857142856*s}c 0 -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s} ${4.285714285714286*s} -${4.285714285714286*s}z`;return P("path",{d:m,transform:A`rotate(45,${t},${e})`})}case "star":{let s=a/27,c=f=>(f-40)*s+t,u=f=>(f-40)*s+e,m=A`M ${c(38.84615384615385)},${u(26.546153846153846)}c${.6692307692307691*s},-${1.0153846153846153*s},${2.215384615384615*s},-${1.0153846153846153*s},${2.884615384615384*s},0l${4.038461538461538*s},${6.069230769230768*s}c${.23076923076923075*s},${.3461538461538461*s},${.6*s},${.6*s},${1.0153846153846153*s},${.7153846153846153*s}l${7.223076923076922*s},${1.823076923076923*s}c${1.2*s},${.3*s},${1.6846153846153844*s},${1.7076923076923076*s},${.8999999999999999*s},${2.6538461538461533*s}l-${4.73076923076923*s},${5.584615384615384*s}c-${.2769230769230769*s},${.3230769230769231*s},-${.41538461538461535*s},${.7384615384615384*s},-${.3923076923076923*s},${1.1307692307692307*s}l${.4384615384615384*s},${7.199999999999999*s}c${.06923076923076922*s},${1.2*s},-${1.1769230769230767*s},${2.0769230769230766*s},-${2.3307692307692305*s},${1.6384615384615382*s}l-${6.9692307692307685*s},-${2.6076923076923073*s}c-${.3923076923076923*s},-${.16153846153846155*s},-${.8538461538461538*s},-${.16153846153846155*s},-${1.2461538461538462*s},0l-${6.9692307692307685*s},${2.6076923076923073*s}c-${1.1538461538461537*s},${.4384615384615384*s},-${2.4*s},-${.4384615384615384*s},-${2.3307692307692305*s},-${1.6384615384615382*s}l${.4384615384615384*s},-${7.199999999999999*s}c${.023076923076923075*s},-${.41538461538461535*s},-${.11538461538461538*s},-${.8307692307692307*s},-${.3923076923076923*s},-${1.1307692307692307*s}l-${4.73076923076923*s},-${5.584615384615384*s}c-${.7846153846153846*s},-${.923076923076923*s},-${.3230769230769231*s},-${2.3307692307692305*s},${.8999999999999999*s},-${2.6538461538461533*s}l${7.223076923076922*s},-${1.823076923076923*s}c${.41538461538461535*s},-${.11538461538461538*s},${.7846153846153846*s},-${.3461538461538461*s},${1.0153846153846153*s},-${.7153846153846153*s}l${4.038461538461538*s},-${6.069230769230768*s}z`;return P("path",{clipRule:"evenodd",d:m,transform:A`rotate(0,${t},${e})`})}case "banner":{let s=a/28;return P("g",{transform:A`translate(${t-40*s},${e-40*s}) scale(${$(s,6)})`,children:P("path",{clipRule:"evenodd",d:"M38.235 26.104C38.759 25.677, 39.51 25.677, 40.034 26.104L41.776 27.52C42.091 27.777, 42.501 27.887, 42.902 27.822L45.118 27.466C45.785 27.359, 46.436 27.735, 46.677 28.366L47.477 30.464C47.621 30.843, 47.921 31.143, 48.301 31.288L50.399 32.088C51.03 32.328, 51.406 32.979, 51.298 33.646L50.942 35.863C50.878 36.264, 50.988 36.674, 51.244 36.989L52.661 38.73C53.087 39.254, 53.087 40.006, 52.661 40.53L51.244 42.271C50.988 42.587, 50.878 42.996, 50.942 43.397L51.298 45.614C51.406 46.281, 51.03 46.932, 50.399 47.173L48.301 47.972C47.921 48.117, 47.621 48.417, 47.477 48.797L46.677 50.894C46.436 51.526, 45.785 51.901, 45.118 51.794L42.902 51.438C42.501 51.374, 42.091 51.483, 41.776 51.74L40.034 53.157C39.51 53.583, 38.759 53.583, 38.235 53.157L36.493 51.74C36.178 51.483, 35.768 51.374, 35.367 51.438L33.15 51.794C32.483 51.901, 31.833 51.526, 31.592 50.894L30.792 48.797C30.647 48.417, 30.347 48.117, 29.968 47.972L27.87 47.173C27.239 46.932, 26.863 46.281, 26.97 45.614L27.326 43.397C27.391 42.996, 27.281 42.587, 27.025 42.271L25.608 40.53C25.182 40.006, 25.182 39.254, 25.608 38.73L27.025 36.989C27.281 36.674, 27.391 36.264, 27.326 35.863L26.97 33.646C26.863 32.979, 27.239 32.328, 27.87 32.088L29.968 31.288C30.347 31.143, 30.647 30.843, 30.792 30.464L31.592 28.366C31.833 27.735, 32.483 27.359, 33.15 27.466L35.367 27.822C35.768 27.887, 36.178 27.777, 36.493 27.52L38.235 26.104Z"})})}default:return P("circle",{cx:$(t),cy:$(e),r:$(n),transform:A`rotate(0,${t},${e})`})}}function Tn(t,e,n,o){let r=t==="top-left"?0:t==="top-right"?1:3,a=(r+2)%4;return [0,1,2,3].map(i=>i===r||o&&i===a?n:e)}function iu(t,e,n,o){return [[t+o,e],[t+n-o,e],[t+n,e+o],[t+n,e+n-o],[t+n-o,e+n],[t+o,e+n],[t,e+n-o],[t,e+o]]}function su(t,e,n,o){let r=n/7,a=Math.max(0,(o+Math.SQRT2-2)*r);return et(iu(t,e,n,o*r))+et(iu(t+r,e+r,5*r,a))}function lu(t,e,n,o,r=false){let a=n/7,i=l=>r?Tn(o,0,l,true):Tn(o,l,0,true);return D(t,e,n,n,i(2.5*a))+D(t+a,e+a,5*a,5*a,i(1.5*a))}function hh(t,e,n,o){let r=n/7;return D(t,e,n,n,Tn(o,2.6*r,0,false))+D(t+r,e+r,5*r,5*r,Tn(o,1.6*r,0,false))}function ph(t,e,n){let o=n/7,r=t+n/2,a=e+n/2;return et(ir(r,a,3.5*o,3.5*o,4,96))+et(ir(r,a,2.5*o,2.5*o,4,96))}function cu(t,e,n,o,r){let a=o,i=n/2,l=(i-a)*.55,s=(c,u)=>A`${t+c} ${e+u}`;return A`M${s(a,0)}`+A`C${s(a+l,0)} ${s(i-l,r)} ${s(i,r)}`+A`C${s(i+l,r)} ${s(n-a-l,0)} ${s(n-a,0)}`+A`A${a} ${a} 0 0 1 ${s(n,a)}`+A`C${s(n,a+l)} ${s(n-r,i-l)} ${s(n-r,i)}`+A`C${s(n-r,i+l)} ${s(n,n-a-l)} ${s(n,n-a)}`+A`A${a} ${a} 0 0 1 ${s(n-a,n)}`+A`C${s(n-a-l,n)} ${s(i+l,n-r)} ${s(i,n-r)}`+A`C${s(i-l,n-r)} ${s(a+l,n)} ${s(a,n)}`+A`A${a} ${a} 0 0 1 ${s(0,n-a)}`+A`C${s(0,n-a-l)} ${s(r,i+l)} ${s(r,i)}`+A`C${s(r,i-l)} ${s(0,a+l)} ${s(0,a)}`+A`A${a} ${a} 0 0 1 ${s(a,0)}Z`}function gh(t,e,n){let o=n/7,r=.12*o;return cu(t,e,n,1.4*o,r)+cu(t+o,e+o,5*o,.7*o,r)}function uu(t,e,n,o,r,a){let i=n/2,l=(s,c)=>A`${t+s} ${e+c}`;return A`M${l(o,0)}H${t+n-o}`+A`A${o} ${o} 0 0 1 ${l(n,o)}`+A`V${e+r}`+A`C${l(n,r+1.55*a)} ${l(i+1.6*a,n)} ${l(i,n)}`+A`C${l(i-1.6*a,n)} ${l(0,r+1.55*a)} ${l(0,r)}`+A`V${e+o}A${o} ${o} 0 0 1 ${l(o,0)}Z`}function bh(t,e,n){let o=n/7;return uu(t,e,n,.7*o,3.9*o,o)+uu(t+o,e+o,5*o,.35*o,2.7*o,.8*o)}function yh(t,e,n,o){let r=n/7;return D(t,e,n,n,Tn(o,.5*r,2.5*r,false))+D(t+r,e+r,5*r,5*r,Tn(o,.25*r,1.5*r,false))}function _h(t,e,n){let o=n/7;return A`M ${t} ${e}v ${n}h ${n}v -${n}z`+A`M ${t+o} ${e+o}h ${5*o}v ${5*o}h -${5*o}z`}function xh(t,e,n){let o=n/7,r=o*.875,a=o*.4375,i=A`M ${t+r} ${e}`+A`h ${n-2*r}`+A`a ${r} ${r} 0 0 1 ${r} ${r}`+A`v ${n-2*r}`+A`a ${r} ${r} 0 0 1 ${-r} ${r}`+A`h ${-(n-2*r)}`+A`a ${r} ${r} 0 0 1 ${-r} ${-r}`+A`v ${-(n-2*r)}`+A`a ${r} ${r} 0 0 1 ${r} ${-r}z`,l=A`M ${t+o+a} ${e+o}`+A`h ${5*o-2*a}`+A`a ${a} ${a} 0 0 1 ${a} ${a}`+A`v ${5*o-2*a}`+A`a ${a} ${a} 0 0 1 ${-a} ${a}`+A`h ${-(5*o-2*a)}`+A`a ${a} ${a} 0 0 1 ${-a} ${-a}`+A`v ${-(5*o-2*a)}`+A`a ${a} ${a} 0 0 1 ${a} ${-a}z`;return i+l}function $h(t,e,n){let o=t+n/2,r=e+n/2,a=K(n/2),i=K(n*(2.5/7));return A`M ${o-a} ${r}`+A`a ${a} ${a} 0 1 0 ${a*2} 0`+A`a ${a} ${a} 0 1 0 ${-a*2} 0z`+A`M ${o-i} ${r}`+A`a ${i} ${i} 0 1 1 ${i*2} 0`+A`a ${i} ${i} 0 1 1 ${-i*2} 0z`}function Sh(t,e,n){let o=n/74.7002,r=l=>l*o+t,a=l=>l*o+e;return A`M${r(37.3496)} ${a(0)}C${r(39.2939)} ${a(0)} ${r(40.9948)} ${a(1.03842)} ${r(41.9287)} ${a(2.59082)}C${r(43.2293)} ${a(1.34013)} ${r(45.1347)} ${a(.780267)} ${r(47.0098)} ${a(1.28027)}C${r(48.8871)} ${a(1.78928)} ${r(50.261)} ${a(3.23767)} ${r(50.7578)} ${a(4.98438)}C${r(52.3454)} ${a(4.0996)} ${r(54.3432)} ${a(4.047)} ${r(56.0303)} ${a(5.01953)}C${r(57.7094)} ${a(5.98752)} ${r(58.6586)} ${a(7.73647)} ${r(58.6924)} ${a(9.5459)}C${r(60.4517)} ${a(9.10661)} ${r(62.3883)} ${a(9.57215)} ${r(63.7598)} ${a(10.9502)}C${r(65.1282)} ${a(12.3253)} ${r(65.5963)} ${a(14.2585)} ${r(65.1641)} ${a(16.0127)}C${r(66.974)} ${a(16.044)} ${r(68.7242)} ${a(16.9982)} ${r(69.7002)} ${a(18.6797)}C${r(70.6781)} ${a(20.3647)} ${r(70.6241)} ${a(22.3635)} ${r(69.7402)} ${a(23.9502)}C${r(71.4776)} ${a(24.4496)} ${r(72.9194)} ${a(25.8232)} ${r(73.4199)} ${a(27.7002)}C${r(73.927)} ${a(29.5707)} ${r(73.3661)} ${a(31.4794)} ${r(72.1104)} ${a(32.7822)}C${r(73.6621)} ${a(33.7163)} ${r(74.7002)} ${a(35.4166)} ${r(74.7002)} ${a(37.3604)}C${r(74.7001)} ${a(39.307)} ${r(73.6582)} ${a(41.0084)} ${r(72.1025)} ${a(41.9414)}C${r(73.357)} ${a(43.245)} ${r(73.9207)} ${a(45.1525)} ${r(73.4199)} ${a(47.0303)}C${r(72.9187)} ${a(48.9027)} ${r(71.4782)} ${a(50.2735)} ${r(69.7383)} ${a(50.7734)}C${r(70.6201)} ${a(52.3601)} ${r(70.6716)} ${a(54.3549)} ${r(69.7002)} ${a(56.04)}C${r(68.7237)} ${a(57.7225)} ${r(66.9721)} ${a(58.6729)} ${r(65.1611)} ${a(58.7031)}C${r(65.598)} ${a(60.4623)} ${r(65.131)} ${a(62.3982)} ${r(63.7598)} ${a(63.7695)}C${r(62.3847)} ${a(65.138)} ${r(60.4515)} ${a(65.6061)} ${r(58.6973)} ${a(65.1738)}C${r(58.6635)} ${a(66.9833)} ${r(57.7094)} ${a(68.7322)} ${r(56.0303)} ${a(69.7002)}C${r(54.3461)} ${a(70.6777)} ${r(52.348)} ${a(70.6248)} ${r(50.7617)} ${a(69.7422)}C${r(50.2643)} ${a(71.4831)} ${r(48.8896)} ${a(72.9284)} ${r(47.0098)} ${a(73.4297)}C${r(45.1389)} ${a(73.9368)} ${r(43.2296)} ${a(73.3763)} ${r(41.9268)} ${a(72.1201)}C${r(40.9927)} ${a(73.6717)} ${r(39.2932)} ${a(74.71)} ${r(37.3496)} ${a(74.71)}C${r(35.4051)} ${a(74.7098)} ${r(33.7042)} ${a(73.6711)} ${r(32.7705)} ${a(72.1182)}C${r(31.4697)} ${a(73.3758)} ${r(29.5597)} ${a(73.9418)} ${r(27.6797)} ${a(73.4404)}V${a(73.4502)}C${r(25.8065)} ${a(72.9422)} ${r(24.434)} ${a(71.4985)} ${r(23.9346)} ${a(69.7568)}C${r(22.3504)} ${a(70.6301)} ${r(20.3591)} ${a(70.6781)} ${r(18.6797)} ${a(69.71)}C${r(16.9957)} ${a(68.7391)} ${r(16.045)} ${a(66.9831)} ${r(16.0166)} ${a(65.168)}C${r(14.2547)} ${a(65.6091)} ${r(12.3134)} ${a(65.1435)} ${r(10.9395)} ${a(63.7695)}C${r(9.5687)} ${a(62.3919)} ${r(9.10168)} ${a(60.454)} ${r(9.53809)} ${a(58.6973)}C${r(7.72791)} ${a(58.6641)} ${r(5.97815)} ${a(57.71)} ${r(5.00977)} ${a(56.0303)}C${r(4.03552)} ${a(54.3517)} ${r(4.08377)} ${a(52.3649)} ${r(4.95801)} ${a(50.7812)}C${r(3.21705)} ${a(50.2839)} ${r(1.77087)} ${a(48.9101)} ${r(1.26953)} ${a(47.0303)}V${a(47.0205)}C${r(.762081)} ${a(45.1489)} ${r(1.32758)} ${a(43.2375)} ${r(2.58496)} ${a(41.9346)}C${r(1.03604)} ${a(41)} ${r(108484e-9)} ${a(39.3019)} ${r(0)} ${a(37.3604)}C${r(0)} ${a(35.4159)} ${r(1.03815)} ${a(33.7141)} ${r(2.59082)} ${a(32.7803)}C${r(1.34044)} ${a(31.4797)} ${r(.780389)} ${a(29.575)} ${r(1.28027)} ${a(27.7002)}C${r(1.78258)} ${a(25.8232)} ${r(3.22806)} ${a(24.4482)} ${r(4.97363)} ${a(23.9512)}C${r(4.08938)} ${a(22.3638)} ${r(4.03743)} ${a(20.3664)} ${r(5.00977)} ${a(18.6797)}C${r(5.97815)} ${a(16.9999)} ${r(7.72788)} ${a(16.0496)} ${r(9.53809)} ${a(16.0166)}C${r(9.10139)} ${a(14.2576)} ${r(9.56846)} ${a(12.3214)} ${r(10.9395)} ${a(10.9502)}C${r(12.3171)} ${a(9.57911)} ${r(14.2558)} ${a(9.11137)} ${r(16.0127)} ${a(9.54785)}C${r(16.0426)} ${a(7.73421)} ${r(16.9969)} ${a(5.97989)} ${r(18.6797)} ${a(5.00977)}C${r(20.3596)} ${a(4.03474)} ${r(22.3521)} ${a(4.08468)} ${r(23.9365)} ${a(4.96094)}C${r(24.4378)} ${a(3.22749)} ${r(25.8059)} ${a(1.7898)} ${r(27.6797)} ${a(1.29004)}C${r(29.5511)} ${a(.78264)} ${r(31.4617)} ${a(1.34357)} ${r(32.7646)} ${a(2.60059)}C${r(33.6971)} ${a(1.04268)} ${r(35.4013)} ${a(152405e-9)} ${r(37.3496)} ${a(0)}ZM${r(41.0615)} ${a(9.17578)}C${r(40.1006)} ${a(10.1057)} ${r(38.793)} ${a(10.6797)} ${r(37.3496)} ${a(10.6797)}C${r(35.9064)} ${a(10.6796)} ${r(34.5985)} ${a(10.1066)} ${r(33.6377)} ${a(9.17676)}C${r(32.9511)} ${a(10.3241)} ${r(31.8358)} ${a(11.2176)} ${r(30.4404)} ${a(11.5898)}C${r(29.0527)} ${a(11.9661)} ${r(27.6436)} ${a(11.7542)} ${r(26.4766)} ${a(11.1074)}C${r(26.1072)} ${a(12.3879)} ${r(25.2629)} ${a(13.5333)} ${r(24.0195)} ${a(14.25)}C${r(22.7695)} ${a(14.9754)} ${r(21.347)} ${a(15.1322)} ${r(20.0479)} ${a(14.8047)}C${r(20.0289)} ${a(16.1454)} ${r(19.5108)} ${a(17.4793)} ${r(18.4902)} ${a(18.5)}C${r(17.4696)} ${a(19.5158)} ${r(16.1409)} ${a(20.033)} ${r(14.8066)} ${a(20.0566)}C${r(15.1312)} ${a(21.3534)} ${r(14.9738)} ${a(22.7723)} ${r(14.25)} ${a(24.0195)}C${r(13.5243)} ${a(25.2699)} ${r(12.3701)} ${a(26.1148)} ${r(11.082)} ${a(26.4795)}C${r(11.7347)} ${a(27.6479)} ${r(11.9529)} ${a(29.062)} ${r(11.5801)} ${a(30.46)}C${r(11.2085)} ${a(31.8485)} ${r(10.3194)} ${a(32.9607)} ${r(9.17578)} ${a(33.6475)}C${r(10.106)} ${a(34.6084)} ${r(10.6797)} ${a(35.9167)} ${r(10.6797)} ${a(37.3604)}C${r(10.6796)} ${a(38.805)} ${r(10.1053)} ${a(40.1141)} ${r(9.17383)} ${a(41.0752)}C${r(10.3132)} ${a(41.7614)} ${r(11.1999)} ${a(42.871)} ${r(11.5703)} ${a(44.2598)}C${r(11.946)} ${a(45.6504)} ${r(11.7335)} ${a(47.0592)} ${r(11.0889)} ${a(48.2266)}C${r(12.377)} ${a(48.593)} ${r(13.5297)} ${a(49.441)} ${r(14.25)} ${a(50.6904)}C${r(14.9754)} ${a(51.9405)} ${r(15.1322)} ${a(53.3629)} ${r(14.8047)} ${a(54.6621)}C${r(16.142)} ${a(54.6835)} ${r(17.4721)} ${a(55.2016)} ${r(18.4902)} ${a(56.2197)}C${r(19.5097)} ${a(57.2441)} ${r(20.0278)} ${a(58.5787)} ${r(20.0479)} ${a(59.918)}C${r(21.3469)} ${a(59.5917)} ${r(22.7696)} ${a(59.7493)} ${r(24.0195)} ${a(60.4697)}C${r(25.2676)} ${a(61.1892)} ${r(26.1117)} ${a(62.3406)} ${r(26.4775)} ${a(63.627)}C${r(27.6424)} ${a(62.9822)} ${r(29.0498)} ${a(62.7688)} ${r(30.4404)} ${a(63.1396)}C${r(31.8284)} ${a(63.5112)} ${r(32.9402)} ${a(64.3999)} ${r(33.627)} ${a(65.543)}C${r(34.5887)} ${a(64.6072)} ${r(35.9012)} ${a(64.0304)} ${r(37.3496)} ${a(64.0303)}C${r(38.7912)} ${a(64.0303)} ${r(40.098)} ${a(64.6023)} ${r(41.0586)} ${a(65.5303)}C${r(41.7458)} ${a(64.3887)} ${r(42.8594)} ${a(63.5007)} ${r(44.25)} ${a(63.1299)}C${r(45.643)} ${a(62.7522)} ${r(47.057)} ${a(62.9676)} ${r(48.2266)} ${a(63.6201)}C${r(48.5931)} ${a(62.3323)} ${r(49.4413)} ${a(61.1801)} ${r(50.6904)} ${a(60.46)}C${r(51.9373)} ${a(59.7364)} ${r(53.3558)} ${a(59.5781)} ${r(54.6523)} ${a(59.9023)}C${r(54.6744)} ${a(58.5659)} ${r(55.1925)} ${a(57.2372)} ${r(56.21)} ${a(56.2197)}C${r(57.2339)} ${a(55.2007)} ${r(58.5676)} ${a(54.6816)} ${r(59.9062)} ${a(54.6611)}C${r(59.5835)} ${a(53.3649)} ${r(59.7414)} ${a(51.9468)} ${r(60.46)} ${a(50.7002)}C${r(61.1797)} ${a(49.4517)} ${r(62.3312)} ${a(48.6068)} ${r(63.6182)} ${a(48.2412)}C${r(62.9651)} ${a(47.0726)} ${r(62.7473)} ${a(45.658)} ${r(63.1201)} ${a(44.2598)}C${r(63.4916)} ${a(42.8718)} ${r(64.3794)} ${a(41.7591)} ${r(65.5225)} ${a(41.0723)}C${r(64.5929)} ${a(40.1115)} ${r(64.0206)} ${a(38.8033)} ${r(64.0205)} ${a(37.3604)}C${r(64.0205)} ${a(35.9186)} ${r(64.5915)} ${a(34.611)} ${r(65.5195)} ${a(33.6504)}C${r(64.3785)} ${a(32.9631)} ${r(63.4908)} ${a(31.8501)} ${r(63.1201)} ${a(30.46)}C${r(62.7421)} ${a(29.0656)} ${r(62.9572)} ${a(27.6498)} ${r(63.6113)} ${a(26.4795)}C${r(62.3272)} ${a(26.1115)} ${r(61.1784)} ${a(25.2657)} ${r(60.46)} ${a(24.0195)}C${r(59.7364)} ${a(22.7727)} ${r(59.5781)} ${a(21.3541)} ${r(59.9023)} ${a(20.0576)}C${r(58.5626)} ${a(20.038)} ${r(57.23)} ${a(19.52)} ${r(56.21)} ${a(18.5)}C${r(55.1931)} ${a(17.4783)} ${r(54.675)} ${a(16.1482)} ${r(54.6523)} ${a(14.8125)}C${r(53.3557)} ${a(15.1357)} ${r(51.9374)} ${a(14.9785)} ${r(50.6904)} ${a(14.2598)}C${r(49.4399)} ${a(13.5339)} ${r(48.5931)} ${a(12.3801)} ${r(48.2285)} ${a(11.0918)}C${r(47.0603)} ${a(11.7439)} ${r(45.6474)} ${a(11.9624)} ${r(44.25)} ${a(11.5898)}V${a(11.5801)}C${r(42.8613)} ${a(11.2085)} ${r(41.7483)} ${a(10.3196)} ${r(41.0615)} ${a(9.17578)}Z`}function vi(t){let e=t/70;return {scale:e,transform:(o,r)=>(o-5)*e+r}}function wh(t,e,n){let{scale:o,transform:r}=vi(n);return A`M ${r(5,t)} ${r(30,e)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}H ${r(5,t)}zM ${r(30,t)} ${r(15,e)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${35*o}z`}function Ch(t,e,n){let o=n/7,r=o*1.5,a=o*.75,i=A`M ${t+r} ${e}`+A`h ${n-2*r}`+A`a ${r} ${r} 0 0 1 ${r} ${r}`+A`v ${n-2*r}`+A`a ${r} ${r} 0 0 1 ${-r} ${r}`+A`h ${-(n-2*r)}`+A`a ${r} ${r} 0 0 1 ${-r} ${-r}`+A`v ${-(n-2*r)}`+A`a ${r} ${r} 0 0 1 ${r} ${-r}z`,l=A`M ${t+o+a} ${e+o}`+A`h ${5*o-2*a}`+A`a ${a} ${a} 0 0 1 ${a} ${a}`+A`v ${5*o-2*a}`+A`a ${a} ${a} 0 0 1 ${-a} ${a}`+A`h ${-(5*o-2*a)}`+A`a ${a} ${a} 0 0 1 ${-a} ${-a}`+A`v ${-(5*o-2*a)}`+A`a ${a} ${a} 0 0 1 ${a} ${-a}z`;return i+l}function Mh(t,e,n){let{scale:o,transform:r}=vi(n);return A`M ${r(5,t)} ${r(40,e)}a ${35*o} ${35*o}, 0, 0, 0, ${35*o} ${35*o}h ${30*o}a ${5*o} ${5*o}, 0, 0, 0, ${5*o} -${5*o}v -${30*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} -${35*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} ${35*o}zM ${r(40,t)} ${r(15,e)}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} ${25*o}v ${25*o}h -${25*o}a ${25*o} ${25*o}, 0, 0, 1, -${25*o} -${25*o}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} -${25*o}z`}function Rh(t,e,n){let{scale:o,transform:r}=vi(n);return A`M ${r(5,t)} ${r(30,e)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} ${25*o}M ${r(30,t)} ${r(15,e)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} -${15*o}z`}function Eh(t,e,n){let o=n/70,r=t+n/2-40*o,a=e+n/2-40*o,i=(s,c)=>s*o+c;return A`M${i(35.19239999999999,r)} ${i(5.837547376725838,a)}C${i(37.69667692307692,r)} ${i(3.8737070690335305,a)}, ${i(41.218430769230764,r)} ${i(3.8737092228796843,a)}, ${i(43.722707692307694,r)} ${i(5.837547376725838,a)}L${i(46.62781538461539,r)} ${i(8.115648915187375,a)}L${i(50.23356923076923,r)} ${i(7.32361506903353,a)}C${i(53.342,r)} ${i(6.640824299802762,a)}, ${i(56.51483076923077,r)} ${i(8.168784299802759,a)}, ${i(57.91892307692308,r)} ${i(11.024719684418145,a)}L${i(59.54787692307692,r)} ${i(14.337679684418145,a)}L${i(63.14027692307692,r)} ${i(15.188578145956608,a)}C${i(66.23707692307693,r)} ${i(15.922091992110452,a)}, ${i(68.43270769230769,r)} ${i(18.675396607495067,a)}, ${i(68.45876923076924,r)} ${i(21.857768915187375,a)}L${i(68.48892307692307,r)} ${i(25.54931045364891,a)}L${i(71.35633846153846,r)} ${i(27.874602761341222,a)}C${i(73.82830769230769,r)} ${i(29.879187376725838,a)}, ${i(74.61187692307692,r)} ${i(33.312418145956606,a)}, ${i(73.25452307692306,r)} ${i(36.19103353057199,a)}L${i(71.68006153846153,r)} ${i(39.530141222879685,a)}L${i(73.25452307692306,r)} ${i(42.86924891518738,a)}C${i(74.61187692307692,r)} ${i(45.747864299802764,a)}, ${i(73.82830769230769,r)} ${i(49.18109506903353,a)}, ${i(71.35633846153846,r)} ${i(51.18567968441815,a)}L${i(68.48892307692307,r)} ${i(53.510971992110456,a)}L${i(68.45876923076924,r)} ${i(57.202664299802755,a)}C${i(68.43270769230769,r)} ${i(60.38497199211046,a)}, ${i(66.23707692307693,r)} ${i(63.13823353057199,a)}, ${i(63.14027692307692,r)} ${i(63.871833530572,a)}L${i(59.54787692307692,r)} ${i(64.72260276134121,a)}L${i(57.91892307692308,r)} ${i(68.03564891518737,a)}C${i(56.51483076923077,r)} ${i(70.89164891518737,a)}, ${i(53.342,r)} ${i(72.41958737672583,a)}, ${i(50.23356923076923,r)} ${i(71.7368181459566,a)}L${i(46.62781538461539,r)} ${i(70.94463353057199,a)}L${i(43.722707692307694,r)} ${i(73.22275660749506,a)}C${i(41.218430769230764,r)} ${i(75.18663353057198,a)}, ${i(37.69667692307692,r)} ${i(75.18663353057198,a)}, ${i(35.19239999999999,r)} ${i(73.22275660749506,a)}L${i(32.28729230769231,r)} ${i(70.94463353057199,a)}L${i(28.68153846153846,r)} ${i(71.7368181459566,a)}C${i(25.573215384615384,r)} ${i(72.41958737672583,a)}, ${i(22.400384615384613,r)} ${i(70.89164891518737,a)}, ${i(20.996141538461536,r)} ${i(68.03564891518737,a)}L${i(19.36720923076923,r)} ${i(64.72260276134121,a)}L${i(15.774852307692306,r)} ${i(63.871833530572,a)}C${i(12.67803076923077,r)} ${i(63.13823353057199,a)}, ${i(10.48237846153846,r)} ${i(60.38497199211046,a)}, ${i(10.45636,r)} ${i(57.202664299802755,a)}L${i(10.426163076923077,r)} ${i(53.510971992110456,a)}L${i(7.558747692307692,r)} ${i(51.18567968441815,a)}C${i(5.086880338461539,r)} ${i(49.18109506903353,a)}, ${i(4.303258769230769,r)} ${i(45.747864299802764,a)}, ${i(5.660599692307692,r)} ${i(42.86924891518738,a)}L${i(7.235153846153846,r)} ${i(39.530141222879685,a)}L${i(5.660599692307692,r)} ${i(36.19103353057199,a)}C${i(4.3032566153846155,r)} ${i(33.312418145956606,a)}, ${i(5.086885938461538,r)} ${i(29.879187376725838,a)}, ${i(7.558747692307692,r)} ${i(27.874602761341222,a)}L${i(10.426163076923077,r)} ${i(25.54931045364891,a)}L${i(10.45636,r)} ${i(21.857768915187375,a)}C${i(10.48237846153846,r)} ${i(18.67537506903353,a)}, ${i(12.678052307692308,r)} ${i(15.922091992110452,a)}, ${i(15.774852307692306,r)} ${i(15.188578145956608,a)}L${i(19.36720923076923,r)} ${i(14.337679684418145,a)}L${i(20.996141538461536,r)} ${i(11.024719684418145,a)}C${i(22.400384615384613,r)} ${i(8.168784299802759,a)}, ${i(25.573215384615384,r)} ${i(6.640824299802762,a)}, ${i(28.68153846153846,r)} ${i(7.32361506903353,a)}L${i(32.28729230769231,r)} ${i(8.115648915187375,a)}L${i(35.19239999999999,r)} ${i(5.837547376725838,a)}M${i(39.45766153846154,r)} ${i(13.665055069033532,a)}L${i(37.01498461538461,r)} ${i(15.58053506903353,a)}C${i(35.39098461538461,r)} ${i(16.854061222879682,a)}, ${i(33.282799999999995,r)} ${i(17.335251992110454,a)}, ${i(31.26701538461538,r)} ${i(16.892464299802757,a)}L${i(28.235046153846152,r)} ${i(16.22649506903353,a)}L${i(26.865415384615382,r)} ${i(19.012107376725837,a)}C${i(25.954812307692308,r)} ${i(20.864178145956608,a)}, ${i(24.264193846153844,r)} ${i(22.212399684418145,a)}, ${i(22.255926153846154,r)} ${i(22.688076607495066,a)}L${i(19.235393846153844,r)} ${i(23.40354122287968,a)}L${i(19.21,r)} ${i(26.507556607495065,a)}C${i(19.19313538461538,r)} ${i(28.57137199211045,a)}, ${i(18.25492,r)} ${i(30.519525838264297,a)}, ${i(16.651919999999997,r)} ${i(31.81937199211045,a)}L${i(14.240926153846154,r)} ${i(33.774633530572,a)}L${i(15.564830769230769,r)} ${i(36.58238737672584,a)}C${i(16.445064615384617,r)} ${i(38.44891045364892,a)}, ${i(16.445064615384617,r)} ${i(40.611371992110456,a)}, ${i(15.564830769230769,r)} ${i(42.47811045364892,a)}L${i(14.240926153846154,r)} ${i(45.28564891518738,a)}L${i(16.651919999999997,r)} ${i(47.240910453648915,a)}L${i(13.883236923076923,r)} ${i(50.654971992110454,a)}L${i(16.651919999999997,r)} ${i(47.240910453648915,a)}C${i(18.25492,r)} ${i(48.54075660749507,a)}, ${i(19.19313538461538,r)} ${i(50.4891258382643,a)}, ${i(19.21,r)} ${i(52.5527258382643,a)}L${i(19.235393846153844,r)} ${i(55.65684891518738,a)}L${i(22.255926153846154,r)} ${i(56.37235660749507,a)}C${i(24.264193846153844,r)} ${i(56.847925838264295,a)}, ${i(25.954812307692308,r)} ${i(58.196233530571995,a)}, ${i(26.865415384615382,r)} ${i(60.0483258382643,a)}L${i(28.235046153846152,r)} ${i(62.833895069033524,a)}L${i(31.26701538461538,r)} ${i(62.1679258382643,a)}C${i(33.282799999999995,r)} ${i(61.72509506903353,a)}, ${i(35.39098461538461,r)} ${i(62.20626429980276,a)}, ${i(37.01498461538461,r)} ${i(63.47983353057199,a)}L${i(39.45766153846154,r)} ${i(65.39524891518737,a)}L${i(41.90012307692308,r)} ${i(63.47983353057199,a)}C${i(43.524123076923075,r)} ${i(62.20626429980276,a)}, ${i(45.632307692307684,r)} ${i(61.72509506903353,a)}, ${i(47.6480923076923,r)} ${i(62.1679258382643,a)}L${i(50.68006153846154,r)} ${i(62.833895069033524,a)}L${i(52.049692307692304,r)} ${i(60.0483258382643,a)}C${i(52.960338461538456,r)} ${i(58.196233530571995,a)}, ${i(54.6508923076923,r)} ${i(56.847925838264295,a)}, ${i(56.65913846153846,r)} ${i(56.37235660749507,a)}L${i(59.67969230769231,r)} ${i(55.65684891518738,a)}L${i(59.70510769230769,r)} ${i(52.5527258382643,a)}C${i(59.72190769230769,r)} ${i(50.4891258382643,a)}, ${i(60.66012307692307,r)} ${i(48.54075660749507,a)}, ${i(62.263230769230766,r)} ${i(47.240910453648915,a)}L${i(64.67424615384616,r)} ${i(45.28564891518738,a)}L${i(63.35027692307692,r)} ${i(42.47811045364892,a)}C${i(62.47,r)} ${i(40.611371992110456,a)}, ${i(62.47,r)} ${i(38.44891045364892,a)}, ${i(63.35027692307692,r)} ${i(36.58238737672584,a)}L${i(64.67424615384616,r)} ${i(33.774633530572,a)}L${i(62.263230769230766,r)} ${i(31.81958737672584,a)}C${i(60.66012307692307,r)} ${i(30.519525838264297,a)}, ${i(59.72190769230769,r)} ${i(28.57137199211045,a)}, ${i(59.70510769230769,r)} ${i(26.507556607495065,a)}L${i(59.67969230769231,r)} ${i(23.40354122287968,a)}L${i(56.65913846153846,r)} ${i(22.688076607495066,a)}C${i(54.6508923076923,r)} ${i(22.212399684418145,a)}, ${i(52.960338461538456,r)} ${i(20.864178145956608,a)}, ${i(52.049692307692304,r)} ${i(19.012128915187375,a)}L${i(50.68006153846154,r)} ${i(16.22649506903353,a)}L${i(47.6480923076923,r)} ${i(16.892464299802757,a)}C${i(45.632307692307684,r)} ${i(17.335251992110454,a)}, ${i(43.524338461538456,r)} ${i(16.85408276134122,a)}, ${i(41.90012307692308,r)} ${i(15.58053506903353,a)}L${i(39.45766153846154,r)} ${i(13.665055069033532,a)}Z`}function bo(t,e,n,o,r="top-left"){switch(o){case "leaf":return lu(t,e,n,r);case "leaf-reverse":return lu(t,e,n,r,true);case "drop":return hh(t,e,n,r);case "octagon":return su(t,e,n,1.6);case "bevel":return su(t,e,n,1.1);case "squircle":return ph(t,e,n);case "cushion":return gh(t,e,n);case "shield":return bh(t,e,n);case "petal":return yh(t,e,n,r);case "gear":return Sh(t,e,n);case "rounded":return xh(t,e,n);case "circle":return $h(t,e,n);case "diya":return wh(t,e,n);case "extra-rounded":return Ch(t,e,n);case "message":return Mh(t,e,n);case "pointy":return Rh(t,e,n);case "curly":return Eh(t,e,n);default:return _h(t,e,n)}}var mu={diamond:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"],banner:["square","rounded","diya","leaf"],square:["curly"],diya:["curly"],message:["curly"]},du={diamond:["square"],pacman:["rounded"],"small-square":["square","rounded"]},fu=["circle","curly"],hu=["diamond","banner","star"],pu={circle:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"]},Xt=["square","liquid","classy","classy-rounded"],gu={"circle/rounded":Xt,"circle/extra-rounded":Xt,"circle/message":[...Xt,"leaf"],"circle/pointy":Xt,"circle/leaf-reverse":Xt,"circle/drop":Xt,"circle/bevel":[...Xt,"leaf"],"circle/squircle":[...Xt,"circle","diamond","circle-mixed","rounded","horizontal-line","leaf","heart","mosaic","octagon"],"circle/cushion":Xt,"circle/shield":[...Xt,"rounded","horizontal-line","leaf"],"circle/petal":Xt};function bu(t,e,n){return (pu[t]?.includes(e)??false)&&!gu[`${t}/${e}`]?.includes(n)}function Ii(t){let e=t.bodyPattern??"circle",n=t.cornerEyePattern??"gear",o=t.cornerEyeDotPattern??"circle";return mu[o]?.includes(n)?{kind:"dot-eye",message:`${o} centres in ${n} eyes are missed by strict decoders`,fix:"Pick a square, rounded or circle centre, or another eye shape"}:du[e]?.includes(n)?{kind:"body-eye",message:`${e} dots next to ${n} eyes are missed up close`,fix:"Pick a fuller dot shape or another eye shape"}:hu.includes(o)?{kind:"dot",message:`${o} centres are missed in sharp renders and up close`,fix:"Pick a square, rounded or circle centre"}:fu.includes(n)?{kind:"eye",message:`${n} eyes only read in lenient decoders`,fix:"Pick square, rounded or gear eyes"}:bu(o,n,e)?{kind:"sharp-dot-eye",message:`${o} centres in ${n} eyes are missed by some decoders on screens and in sharp prints`,fix:"Pick a rounded centre, or gear or octagon eyes"}:null}var $u="gear",Ah="circle";function ne(t,e){let n=t.eyeShapes?.[e];return {outer:n?.outer??t.cornerEyePattern??$u,inner:n?.inner??t.cornerEyeDotPattern??Ah}}var Ph=["curly","circle"];function Fi(t){let e=Be.map(n=>ne(t,n));for(let n of Ph)if(e.some(o=>o.outer===n))return n;return e[0]?.outer??$u}var yu=["dot-eye","body-eye","dot","sharp-dot-eye","eye"];function Ti(t){let e=null,n=new Set;for(let o of Be){let{outer:r,inner:a}=ne(t,o),i=`${r}/${a}`;if(n.has(i))continue;n.add(i);let l=Ii({bodyPattern:t.bodyPattern,cornerEyePattern:r,cornerEyeDotPattern:a});l&&(!e||yu.indexOf(l.kind)<yu.indexOf(e.kind))&&(e=l);}return e}function Nn(t,e,n,o){if(!(t&&Number.isFinite(t))||t<=0||pr(o)||n<=0)return 0;let r=Math.min(Ur,Aa*n/(e+2*n));return Math.min(t,r)}function vh(t){let{value:e,level:n,shape:o,autoLevel:r,isOGContext:a}=t,i=t.size??it,l=t.margin??ft,s=On({value:`${e}`,size:i,margin:l,level:n,shape:o,autoLevel:r,isOGContext:a},t.imageSettings),c=Et({value:`${e}`,size:i,level:n,margin:l,imageSettings:s,isOGContext:a,autoLevel:r,shape:o}),u=ut.QrCode.encodeText(`${e}`,$t[c]).size;return Nn(Ur,u,l,o)}var ki=(t,e,n,o)=>Math.min(o,Math.max(n,typeof t=="number"&&Number.isFinite(t)?t:e)),Ih=/^hsla?\(([^)]*)\)$/,Lh=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?$/,kh=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)%?$/;function Li(t,e){let n=t?.trim()??"";if(!kh.test(n))return Number.NaN;let o=Number.parseFloat(n),r=n.endsWith("%")||e?o/100:o;return Math.min(1,Math.max(0,r))}function Fh(t){let e=Ih.exec(t);if(!e)return null;let[n="",o]=(e[1]??"").split("/"),r=n.split(/[\s,]+/).filter(Boolean);if(r.length!==(o===void 0&&r.length===4?4:3))return null;let[a="",i,l,s]=r,c=Li(i,true),u=Li(l,true),m=Li(o??s??"1",false),f=Number.parseFloat(a);if(!(Lh.test(a)&&[c,u,m].every(Number.isFinite)))return null;let d=c*Math.min(u,1-u),g=h=>{let p=(h+f/30)%12,b=p<0?p+12:p;return 255*(u-d*Math.max(-1,Math.min(b-3,9-b,1)))};return {r:g(0),g:g(8),b:g(4),a:m}}function Ni(t){let e=t?.trim().toLowerCase()??"";return e==="none"?{r:0,g:0,b:0,a:0}:lt(e)??Fh(e)}function yo(t){return Ni(t)?.a??1}function Su(t){let e=Lt(t,mt);return e.type==="solid"?yo(e.color)<1:e.type==="image"?yo(e.underlay??"transparent")<1:e.stops.some(n=>yo(n.color)<1)}var wu=({r:t,g:e,b:n})=>Math.min(.2126*t+.7152*e+.0722*n,.299*t+.587*e+.114*n),_u=wu(lt(_e)),xu=t=>{let e=Ni(t);return e?wu(e):null};function Cu(t){let e=Ni(t.color||Hr);return e&&e.a>0?`#${[e.r,e.g,e.b].map(n=>Math.round(n).toString(16).padStart(2,"0")).join("")}`:Hr}function _o(t){if(!t.halo)return null;let e="or turn the halo off",n=Lt(t.bgColor,mt);if(n.type==="image")return {reason:"picture",message:"A halo isn't drawn on a picture background: on the picture's darker parts the rim makes the code unreadable",fix:`Use a background color, ${e}`};if(Su(t.bgColor))return {reason:"see-through",message:"A halo isn't drawn on a see-through background: on a grey surface under the code the rim makes it unreadable",fix:`Give the code an opaque background, ${e}`};let o=(n.type==="solid"?[n.color]:n.stops.map(i=>i.color)).map(xu),r=o.includes(null)?null:Math.min(...o);if(r===null||r<_u-1e-9)return {reason:"dark-background",message:`A halo is drawn only on a background at least as light as ${_e}: on a darker one the rim makes the code unreadable`,fix:`Lighten the background to ${_e} or lighter, ${e}`};let a=xu(Cu(t.halo));return a<_u-1e-9||a>r+1e-9?{reason:"rim",message:`A halo is drawn only in a color between ${_e} and the background's own: a rim lighter than the background, or darker than ${_e}, makes the code unreadable`,fix:`Pick a halo color no lighter than the background and at least as light as ${_e}, ${e}`}:null}function yr(t,e){if(!t||e&&_o({halo:t,bgColor:e.bgColor}))return null;let n=ki(t.width,Ia,Pa,va);return {color:Cu(t),width:n}}function Oi(t){if(!t)return null;let e=r=>ki(r,La,-zr,zr),n=e(t.dx),o=e(t.dy);return n===0&&o===0?null:{color:t.color||Na,opacity:ki(t.opacity,Ta,ka,Fa),dx:n,dy:o}}var Di="data-qrdx-part",Mu="data-qrdx-eye",Th=["eye-outer","eye-centre","body","logo","background"];function Bi(t,e,n){if(t)return n?{[Di]:e,[Mu]:n}:{[Di]:e}}var _r=300;function re(t){return {id:t.id,name:t.name,description:t.description,spec:t.spec,wrapper:(e,n)=>{let o=qe(t.spec),r=n?.fgColor,a=(typeof r=="string"?r:bt(r,""))||"black",i=ur(o.qr.size,o,{color:a}),{x:l,y:s,scale:c}=t.at;return P("svg",{height:_r,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${_r} ${_r}`,width:_r,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:xt("g",{"data-qrdx-template":t.id,transform:`translate(${$(l)} ${$(s)})${c===1?"":` scale(${c})`}`,children:[cc(i),P("g",{fill:"none",transform:`translate(${$(i.qrX)} ${$(i.qrY)}) scale(${i.qrSize/_r})`,children:e})]})})}}}var Ru={kind:"qrdx.frame",version:1,artboard:{width:185,height:178},qr:{x:35,y:0,size:150,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M26.57 80.23h0c0.12 -2.06 0.31 -4.19 0.49 -6.25s0.48 -4.13 0.85 -6.13s0.79 -4 1.27 -5.95a30.21 30.21 0 0 1 1.94 -5.28h0c0.06 -0.18 0.13 -0.43 0.19 -0.67a3.55 3.55 0 0 0 -2.8 -4.19l-0.18 -0.06a1.85 1.85 0 0 0 -0.54 -0.06c-0.19 0 -0.31 -0.06 -0.49 -0.06s-0.61 -0.06 -0.91 -0.06c-0.61 0 -1.21 0.06 -1.82 0.06c-1.21 0.12 -2.37 0.25 -3.52 0.43a62.08 62.08 0 0 0 -6.8 1.45a58.45 58.45 0 0 0 -6.43 2.31c-1 0.42 -2.07 1 -3.1 1.4s-2 1.09 -3 1.57a0.76 0.76 0 0 0 0.54 1.4h0.07c1.09 -0.24 2.12 -0.55 3.15 -0.79s2.13 -0.48 3.16 -0.61A46 46 0 0 1 15 58c1.34 -0.06 2.73 -0.06 4.07 -0.06a62.58 62.58 0 0 0 -7.23 10.43a85.58 85.58 0 0 0 -6.55 15.36a107.86 107.86 0 0 0 -5 32.53a104.06 104.06 0 0 0 5 32.29a90.47 90.47 0 0 0 15.54 28.52a0.94 0.94 0 0 0 1.27 0.19a0.89 0.89 0 0 0 0.18 -1.28h0a87.24 87.24 0 0 1 -13.89 -28.28A102.85 102.85 0 0 1 11 85.87a82.15 82.15 0 0 1 6.68 -14a51.58 51.58 0 0 1 5.71 -7.76c0 1.21 0 2.36 0.06 3.58c0.12 2.18 0.24 4.31 0.48 6.43s0.49 4.25 0.85 6.37a1 1 0 0 0 0.91 0.85A1.37 1.37 0 0 0 26.57 80.23Z",fill:"frame"}],labels:[]};var Eu=re({id:"Arrow",name:"Arrow",description:"QR code with arrow",spec:Ru,at:{x:47,y:95,scale:1}});var Au={id:"default",name:"Default",description:"Simple QR code without decorative elements",wrapper:t=>P("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:P("g",{fill:"none",transform:"translate(9, 9) scale(0.95)",children:t})})};var $r=593,Ee=296.5,xr=146.5,Fu=294.5,Tu=231.228,Nu="M296.5 0C460.252 -7.15782e-06 593 132.748 593 296.5C593 460.252 460.253 593 296.5 593C132.748 593 7.15782e-06 460.252 0 296.5C-7.15788e-06 132.748 132.748 7.15788e-06 296.5 0ZM296.5 527.728C424.204 527.728 527.728 424.204 527.728 296.5C527.728 168.796 424.204 65.2713 296.5 65.2713C168.796 65.2713 65.2714 168.796 65.2714 296.5C65.2714 424.204 168.796 527.728 296.5 527.728Z",Oh="iaa2 1z3g 1z0y 1z18 1z18 1we8 2mq 1uta 47y 1rx4 73u 1rx4 73u 1rxe 73u 1rx4 73u 1rxe 73u 1rx4 73u 1rxe 73u 1rx4 73u 1rzm 71m 1rzm 71m 1rzc 73u okq 13ce 744 1rx4 744 1rwu 744 1rx4 744 1rx4 73u 1rx4 744 1rx4 73u 1rx4 73u 1rx4 744 1rx4 73u 1rxe 73u 1rx4 73u 1rx4 744 1rzm 71c 1rzm 73u 1rxe 73u 1rx4 744 1rx4 73u 1rx4 73u 1rxe 73u 1rx4 618 12m 1rxe 73u 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z18",Dh="hqpr 5 1z36 1z0y 1z18 1z18 1z0y 1z0y 1a7w otc 1z0y 1z18 1z0y 1z18 1z0y 1z1i 1z0o 1z18 1z0y 1z3q 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z0y 1lk8 dgq 1z18 1z18 1z3g 1z0y 1z0y 1z18 1z18 1z0y 1z0y 1z18 1yx2 3w 1z18 60o 1t0a 1z18 1z0y 1z18 1z0y",Pu="3cf27f17c00j3ch21n1ek00l1el3cj1vv1kd00n3cl3cn1q31q500p3cp1vx00r1kb3cs3aw1ej21p00t3ax3ay17b27h00w3b02g20yq01w2d611m01x3b52aa14i01y24i1bq0203bd3be1q21q60253bf39e39f39h14e2ae02d39j11i2da02e39l0ym02f39n2lt0sz03a39p2ix0vv03b39r2d511n39t03d27d17f03f39x39y21l1en03h3a03a11vt1kf03j37w37x1q11q703l37z1k903n1vz3821eh03p21r38714d03t11h03u2db38a0vp2j303w2lz38g03x0st2rk0n804o38l2oo0q404p38n2iw0vw04r36f36h2a814k04u36k36l1vs1kg04z36o36p1n41t405236q36x36y0ss2m005d3720n02rs05f3742uf0kd0633763772on0q506537834y2fz0yt06834z2d311p06935235424f1bt06c35621j1ep06d3581yn1hl06e35a1sv1nd06g35b1pz1q906h35d35e35g1ef21t06l35h1bj24p06m35k35l11f2dd06q35n0vn2j506s35p35q0pv2ox06u35s0mz2rt06v35t33h0k32up06w2x90hi08y2ud0ke08z33r2lp0t20922fx0yu0942a514m09624d1bu0983441yl1hm09a1vp1ki09b1px1qa09d34e1n11t609e1h91yy09g1ed21u09h1a227m0831492ai09l0yh2ga09n0sp2m209p0pt2oy09q0k12uq09s2xo0h52z209t31k0en0bt2780c319z0az0e831z0cq",vu=52,Bh=240;function Iu(t){let e=0;return t.split(" ").map(n=>(e+=Number.parseInt(n,36),e/1e4))}var Gi;function Gh(){if(!Gi){let t=Iu(Oh),e=Iu(Dh),n=[];for(let o=0;o<Pu.length;o+=3){let r=Number.parseInt(Pu.slice(o,o+3),36);n.push({cx:t[Math.floor(r/vu)],cy:e[r%vu]});}Gi=n;}return Gi}function Qh(t){let e=0;for(let n=0;n<t.length;n++)e=e*32-e+t.charCodeAt(n),e%=2147483647;return Math.abs(e)}function Ou(t){let e=Gh(),n=Qh(t),o=()=>(n=(n*9301+49297)%233280,n/233280),r=e.map((a,i)=>i);for(let a=r.length-1;a>0;a--){let i=Math.floor(o()*(a+1));[r[a],r[i]]=[r[i],r[a]];}return r.slice(0,Bh).sort((a,i)=>a-i).map(a=>e[a])}var Lu=300,Uh=49,Hh=6;function Du(t,e){if(Lu/e<=Uh+.5)return t;let n=xr,o=xr+Lu,r=Hh*e+e/2;return t.filter(({cx:a,cy:i})=>Math.max(n-a,a-o,n-i,i-o)>=r)}var Bu="Scan the QR code * Scan the QR code * Scan the QR code * Scan the QR code *",Sr=32,Gu=3.5,zh=Sr*Zn,Qu=246.5,de=2*Math.PI*Qu,Hi=.36,ku=Qu+Hi*Sr,Qi=400;function Dn(t,e){return t===" "||/[il1|!']/.test(t)?e*.3:/[mwMW@%&]/.test(t)?e*.8:e*.6}function qh(t){let e=t.slice(0,Qi).split(" ").map(n=>Cn(n,Qi)).join(" ");return Array.from(e).slice(0,Qi)}var Wh="\u2026",Uu=1;function Hu(t,e,n,o=false){return o&&e===t.length-1?Uu*n:Dn(t[e],n)}function zi(t,e,n=false){let o=0;for(let r=0;r<t.length;r++)o+=Hu(t,r,e,n);return o}function Ui(t,e,n,o=false){return zi(t,e,o)+n*Math.max(0,t.length-1)+Dn(" ",e)+2*n<=de}var zu=t=>t.join("").split(" ").filter(Boolean),Vh=(t,e)=>Array.from(Array.from({length:e},()=>t.join(" ")).join(" "));function qu(t,e,n){if(Ui(t,e,n))return {chars:t,fontSize:e,letterSpacing:n};let o=Math.min(n,0),r=Math.min(e,zh),a=(h,p=false)=>{let b=zi(h,e,p)+Dn(" ",e),y=h.length+1,_=(de-b)/y;if(_>=o)return {chars:h,fontSize:e,letterSpacing:_,cut:p};let w=(de-o*y)/b*e;return w>=r?{chars:h,fontSize:w,letterSpacing:o,cut:p}:null},i=a(t);if(i)return i;let l=zu(t),s=Wu(l);for(let h=l.length/s.length-1;h>=1;h--){let p=Vh(s,h);if(Ui(p,r,o))return a(p)??{chars:p,fontSize:r,letterSpacing:o}}let c=de-Dn(" ",r)-Uu*r-2*o,u=0,m=0,f=0;for(let[h,p]of t.entries()){if(u+=Dn(p,r)+o,u>c)break;f=h+1,(f===t.length||t[f]===" ")&&(m=f);}let d=[...Xh(t.slice(0,m>0?m:f)),Wh];return (Ui(d,e,n,true)?{chars:d,fontSize:e,letterSpacing:n,cut:true}:null)??a(d,true)??{chars:d,fontSize:r,letterSpacing:o,cut:true}}function Xh(t){let e=t.length;for(;e>0&&/[\s.,;:!?*·•\-–—]/u.test(t[e-1]);)e--;return t.slice(0,e)}function Wu(t){for(let e=1;e<t.length;e++)if(t.length%e===0&&t.every((n,o)=>n===t[o%e]))return t.slice(0,e);return t}function jh(t,e,n){let o=zu(t);if(o.length===0)return {chars:[],fontSize:e,letterSpacing:n};let r=Array.from(Wu(o).join(" ")),a=zi(r,e)+Dn(" ",e),i=a+(r.length+1)*n,l=Math.min(n,0),s=null;for(let c of new Set([Math.floor(de/i),Math.ceil(de/i)])){if(c<1)continue;let u=(de-c*a)/(c*(r.length+1));if(u>=l&&(!s||Math.abs(u-n)<Math.abs(s.letterSpacing-n))){let m=Array.from({length:c},()=>r.join(""));s={chars:Array.from(m.join(" ")),fontSize:e,letterSpacing:u};}}return s??qu(r,e,n)}function Vu(t,e){let{position:n,rotation:o}=e,r=qh(t),a=e.fill==="repeat"?jh(r,e.fontSize,e.letterSpacing):qu(r,e.fontSize,e.letterSpacing),{fontSize:i,letterSpacing:l}=a,s=[],c=0;for(let[h,p]of a.chars.entries()){let b=Hu(a.chars,h,i,a.cut);s.push({char:p,along:c+b/2}),c+=b+l;}let u=c-(s.length>0?l:0),m=n!=="bottom",f=m?ku-Hi*i:ku+Hi*i,d=u/de*180,g=[];for(let{char:h,along:p}of s){if(h.trim()==="")continue;let b=p/de*360,y=m?o-d+b:o+180+d-b,_=y*Math.PI/180;g.push({char:h,x:K(Ee+f*Math.sin(_)),y:K(Ee-f*Math.cos(_)),rotate:K(m?y:y-180)});}return {text:a.chars.join(""),letters:g,fontSize:i===e.fontSize?i:K(i),letterSpacing:l}}var Bn=(t,e)=>typeof t=="number"&&Number.isFinite(t)?t:e,Xu={id:"DotRing",name:"Dot Ring",description:"A round code in a ring of dots of its own for every link, with text along the ring",wrapper:(t,e,n)=>{let o=bt(e?.fgColor,"#000000"),r=bt(e?.bgColor,"#ffffff"),a=n?.pixelSize??9,i=K(a/2),l=Du(Ou(n?.url??""),a),s=Bn(e?.fontSize,Sr),c=s>0?s:Sr,u=typeof e?.customText=="string"?e.customText:Bu,m=Vu(u,{fontSize:c,letterSpacing:Bn(e?.fontLetterSpacing,Gu),position:e?.textPosition==="bottom"?"bottom":"top",rotation:Bn(e?.textRotation,0),fill:e?.textFill==="repeat"?"repeat":"none"}),f=e?.textColor||"#ffffff",d=e?.fontFamily||io,g=e?.fontWeight??900,h=Bn(e?.strokeWidth,0),p=e?.strokeColor||"#000000",b=[{radius:Ee,width:Bn(e?.outerStrokeWidth,h),color:e?.outerStrokeColor||p},{radius:Tu,width:Bn(e?.innerStrokeWidth,h),color:e?.innerStrokeColor||p}].filter(y=>y.width>0);return xt("svg",{height:$r,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${$r} ${$r}`,width:$r,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[P("circle",{cx:Ee,cy:Ee,fill:r,r:Fu}),P("g",{fill:o,children:l.map((y,_)=>P("circle",{cx:y.cx,cy:y.cy,r:i},_))}),P("path",{d:Nu,fill:e?.outerCircleColor||o}),b.map((y,_)=>P("circle",{cx:Ee,cy:Ee,fill:"none",r:y.radius,stroke:y.color,strokeWidth:y.width},_)),P("g",{"aria-hidden":"true",children:m.letters.map((y,_)=>P("text",{fill:f,fontFamily:d,fontSize:m.fontSize,fontWeight:g,textAnchor:"middle",transform:`rotate(${y.rotate} ${y.x} ${y.y})`,x:y.x,y:y.y,children:y.char},_))}),P("g",{transform:`translate(${xr} ${xr})`,children:t})]})}};var ju={kind:"qrdx.frame",version:1,artboard:{width:220,height:277},qr:{x:52,y:122,size:114,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"circle",cx:110,cy:167.682,r:99.318,fill:"#FFFFFF",stroke:{color:"#F89941",width:20}},{type:"ellipse",cx:139.989,cy:67.895,rx:35.445,ry:48.442,fill:"#F89941"},{type:"path",d:"M159.937 69.076C159.937 82.657 156.092 94.845 150.005 103.57C143.912 112.304 135.736 117.381 126.992 117.381C118.247 117.381 110.072 112.304 103.979 103.57C97.891 94.845 94.047 82.657 94.047 69.076C94.047 55.495 97.891 43.308 103.979 34.582C110.072 25.849 118.247 20.771 126.992 20.771C135.736 20.771 143.912 25.849 150.005 34.582C156.092 43.308 159.937 55.495 159.937 69.076Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:126.072,cy:69.487,rx:34.051,ry:50.662,fill:"#F89941"},{type:"path",d:"M143.396 69.667C143.396 82.739 139.562 94.472 133.488 102.874C127.412 111.279 119.235 116.2 110.451 116.2C101.666 116.2 93.489 111.279 87.413 102.874C81.34 94.472 77.506 82.739 77.506 69.667C77.506 56.595 81.34 44.862 87.413 36.46C93.489 28.055 101.666 23.134 110.451 23.134C119.235 23.134 127.412 28.055 133.488 36.46C139.562 44.862 143.396 56.595 143.396 69.667Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:106.316,cy:70.849,rx:33.673,ry:47.851,fill:"#F89941"},{type:"ellipse",cx:78.743,cy:68.448,rx:35.445,ry:48.442,fill:"#F89941"},{type:"path",d:"M58.794 69.63C58.794 83.211 62.639 95.399 68.726 104.124C74.819 112.858 82.995 117.935 91.739 117.935C100.484 117.935 108.659 112.858 114.753 104.124C120.84 95.399 124.685 83.211 124.685 69.63C124.685 56.049 120.84 43.861 114.753 35.136C108.659 26.402 100.484 21.325 91.739 21.325C82.995 21.325 74.819 26.402 68.726 35.136C62.639 43.861 58.794 56.049 58.794 69.63Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:91.744,cy:69.763,rx:32.944,ry:50.385,fill:"#F89941"},{type:"path",d:"M75.335 70.221C75.335 83.293 79.169 95.025 85.243 103.427C91.319 111.833 99.496 116.753 108.281 116.753C117.065 116.753 125.242 111.833 131.318 103.427C137.392 95.025 141.226 83.293 141.226 70.221C141.226 57.148 137.392 45.416 131.318 37.014C125.242 28.609 117.065 23.688 108.281 23.688C99.496 23.688 91.319 28.609 85.243 37.014C79.169 45.416 75.335 57.148 75.335 70.221Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:111.677,cy:70.871,rx:32.39,ry:47.616,fill:"#F89941"},{type:"ellipse",cx:106.971,cy:71.425,rx:33.221,ry:47.616,fill:"#F89941"},{type:"path",d:"M130.85 46.678C137.21 42.252 138.538 40.633 139.867 39.014C139.867 39.014 141.806 43.824 141.88 46.357C141.954 48.89 141.712 50.147 139.248 51.647C136.783 53.146 127.406 53.045 122.083 52.975C121.31 52.5 122.72 52.337 130.85 46.678Z",fill:"#000000"},{type:"path",d:"M87.765 46.512C81.392 42.141 80.058 40.548 78.724 38.954C78.724 38.954 76.783 45.836 76.758 46.822C76.733 47.808 76.657 50.805 80.247 52C83.837 53.194 91.234 52.772 96.551 52.727C97.322 52.265 95.912 52.099 87.765 46.512Z",fill:"#000000"},{type:"path",d:"M132 90.5C139.156 83.16 141.5 78.283 143.351 72.935C144.24 70.367 134.909 72.043 130 72.935C129.276 73.066 127.751 76.915 127 77C126.182 77.093 123.841 73.076 123 73.086C121.725 73.101 119.727 73.086 117.875 73.429C117.345 74.365 118.367 77.575 117.875 78.283C117.321 78.283 113.796 77.26 113.242 76.43C112.689 74.492 112.949 73.363 112.118 72.532C109.555 72.908 110.023 72.657 107.412 73.086C106.768 73.192 105.09 77.721 104.441 77.82C103.615 77.945 100.644 74.009 99.809 74.114C98.747 74.248 96.821 74.468 95.64 74.577C95.126 74.624 95.554 77.502 95.177 78.283C94.898 78.862 91.426 77.892 90.5 77.5C90.037 76.502 89.844 74.558 89 74.577C83 74.114 81.4 73.843 75.575 70.871C75.575 70.871 74.5 80 83 89C91.5 98 119.127 103.706 132 90.5Z",fill:"#000000"},{type:"path",d:"M107.238 7.252C109.192 1.731 114.678 0.363 117.935 0L120.377 1.816C121.158 2.397 121.842 2.409 122.331 3.257C122.331 4.225 118.337 5.42 114.429 6.582C109.545 8.035 111.482 17.053 114.429 19.281C115.401 20.015 115.524 19.964 117.966 19.964C120.029 19.964 122.387 18.247 123.566 17.353C123.566 17.353 123.861 20.257 121.798 21.478C119.735 22.698 115.578 21.858 115.608 21.966C116.493 23.918 118.89 22.489 120.029 23.336C119.346 23.336 118.556 24.289 116.198 24.533C114.672 24.58 114.135 24.533 112.956 23.918C111.777 23.304 111.482 22.87 110.893 22.14C108.83 23.36 110.893 25.431 110.893 25.431C110.893 25.431 106.472 25.851 105.587 23.918C105.264 23.212 105.882 22.14 105.587 21.966C103.819 22.454 102.935 23.481 99.373 22.87C96.312 22.344 97.102 18.321 96.451 17.353C99.381 18.079 97.131 20.039 101.327 19.964C112.838 19.758 104.796 14.153 107.238 7.252Z",fill:"#5D725F"}],labels:[]};var Zu=re({id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",spec:ju,at:{x:38,y:10,scale:1}});var Yu={kind:"qrdx.frame",version:1,artboard:{width:316,height:316},qr:{x:20,y:20,size:276,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M308 8H8v300h300V8ZM0 0v316h316V0H0Z",fill:"frame",fillRule:"evenodd"}],labels:[]};var Ku=re({id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",spec:Yu,at:{x:0,y:0,scale:300/316}});var Ju={kind:"qrdx.frame",version:1,artboard:{width:208,height:298},qr:{x:14,y:14,size:180,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M197 0.7h-186a10.25 10.25 0 0 0 -10.2 10.12v186A10.13 10.13 0 0 0 11 207H197a10.13 10.13 0 0 0 10.12 -10.12v-186A10.13 10.13 0 0 0 197 0.7Zm2.36 193.05a5.46 5.46 0 0 1 -5.47 5.47H14.16a5.46 5.46 0 0 1 -5.47 -5.47V13.93a5.46 5.46 0 0 1 5.47 -5.47H193.91a5.46 5.46 0 0 1 5.47 5.47Z",fill:"frame"},{type:"path",d:"M197.54 237.81H127.61a2.29 2.29 0 0 1 -1.62 -0.67l-20.55 -20.55a2.33 2.33 0 0 0 -3.25 0l-20.55 20.55a2.29 2.29 0 0 1 -1.62 0.67H10.09A9.15 9.15 0 0 0 0.93 247v41.17a9.16 9.16 0 0 0 9.16 9.16H197.61a9.09 9.09 0 0 0 9.09 -9.16V247A9.16 9.16 0 0 0 197.54 237.81Z",fill:"frame"}],labels:[]};var t0=re({id:"StandardBox",name:"Standard Box",description:"QR code with standard box",spec:Ju,at:{x:46,y:1,scale:1}});var e0={kind:"qrdx.frame",version:1,artboard:{width:252,height:300},qr:{x:40,y:38,size:174,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M171.11 290.77l-7.28 4.88a2.16 2.16 0 0 0 -0.57 3a2.21 2.21 0 0 0 1.77 0.92a2.4 2.4 0 0 0 1.2 -0.35l7.28 -4.88a2.14 2.14 0 0 0 -2.4 -3.54Z",fill:"#22071b"},{type:"path",d:"M242.85 227.52l-7.28 4.87a2.16 2.16 0 0 0 -0.57 3a2.21 2.21 0 0 0 1.77 0.92a1.86 1.86 0 0 0 1.2 -0.35l7.28 -4.88a2.13 2.13 0 1 0 -2.4 -3.53Z",fill:"#22071b"},{type:"path",d:"M17 176.34l-9.11 6.08a2.15 2.15 0 0 0 -0.57 3a2.19 2.19 0 0 0 1.77 0.92a2.14 2.14 0 0 0 1.2 -0.35l9.12 -6.08A2.14 2.14 0 0 0 17 176.34Z",fill:"#22071b"},{type:"path",d:"M17 269.08l-9.11 6.07a2.15 2.15 0 0 0 -0.57 3a2.19 2.19 0 0 0 1.77 0.92a2.92 2.92 0 0 0 1.2 -0.35l9.12 -6.08A2.14 2.14 0 0 0 17 269.08Z",fill:"#22071b"},{type:"path",d:"M123 10.1a2.4 2.4 0 0 0 1.14 -0.35l7.7 -5.16a2.13 2.13 0 0 0 -2.4 -3.53l-7.64 5.15a2.15 2.15 0 0 0 -0.56 3A2.19 2.19 0 0 0 123 10.1Z",fill:"#22071b"},{type:"path",d:"M251.54 54.77a2.14 2.14 0 0 0 -3 -0.56l-17.1 11.45V31.31a10.18 10.18 0 0 0 -10.18 -10.18H113.22l-10.39 7a2.4 2.4 0 0 1 -1.2 0.35a2.21 2.21 0 0 1 -1.77 -0.92a2.15 2.15 0 0 1 0.57 -3l1.41 -0.92l13.64 -8.76a2.1 2.1 0 1 0 -2.26 -3.54L98 21.2h-8.13l-10.39 7a2.37 2.37 0 0 1 -1.2 0.35a2.19 2.19 0 0 1 -1.76 -0.92a2.15 2.15 0 0 1 0.56 -3L100 9.25a2.13 2.13 0 1 0 -2.4 -3.53l-23 15.48H34.2A10.18 10.18 0 0 0 24 31.38v28L7.34 70.46a2.09 2.09 0 0 0 -0.57 3a2 2 0 0 0 1.77 0.92a2.58 2.58 0 0 0 1.2 -0.35l14.35 -9.54l3.18 -2.12a2.14 2.14 0 1 1 2.41 3.53l-5.52 3.67V76.9l-7 4.66a2.15 2.15 0 0 0 -0.56 3a2 2 0 0 0 1.77 0.92a2.34 2.34 0 0 0 1.2 -0.36l7.35 -4.94A2.13 2.13 0 0 1 28.69 84l-4.46 3v65.66L1.05 168.07a2.15 2.15 0 0 0 -0.57 3a2 2 0 0 0 1.77 0.92a2.37 2.37 0 0 0 1.2 -0.35l25 -16.75a2 2 0 0 1 2.62 0.77a2.16 2.16 0 0 1 -0.57 3l-6.36 4.24V275a10.09 10.09 0 0 0 9.83 10.11l-5.87 4a2.15 2.15 0 0 0 -0.57 3a2.06 2.06 0 0 0 1.77 0.92a2.38 2.38 0 0 0 1.2 -0.36l23 -15.41a2.14 2.14 0 0 1 2.41 3.54l-6.58 4.45h52l-5.58 3.75a2.14 2.14 0 0 0 -0.56 3a2 2 0 0 0 1.76 0.91a2.37 2.37 0 0 0 1.2 -0.35l30.54 -20.28a2.15 2.15 0 0 1 3 0.56a2.1 2.1 0 0 1 -0.57 3l-14.21 9.54H193l-4.6 3a2.16 2.16 0 0 0 -0.63 3a2.11 2.11 0 0 0 1.76 1a2 2 0 0 0 1.13 -0.36L213 277.35a2.14 2.14 0 1 1 2.33 3.6l-6.78 4.38h13a10.18 10.18 0 0 0 10.18 -10.18v-91.1l-4.38 3a2.43 2.43 0 0 1 -1.2 0.35a2.19 2.19 0 0 1 -1.77 -0.92a2.15 2.15 0 0 1 0.57 -3l24.38 -16.33a2.13 2.13 0 1 0 -2.4 -3.53l-15.48 10.25V91.53l-4.38 3a2.34 2.34 0 0 1 -1.21 0.36a2.22 2.22 0 0 1 -1.76 -0.92a2.15 2.15 0 0 1 0.56 -3l6.72 -4.52l13.71 -9.19a2.14 2.14 0 0 0 -2.4 -3.54l-11.24 7.57V75.84l-4.38 3a2.34 2.34 0 0 1 -1.21 0.36a2.22 2.22 0 0 1 -1.76 -0.92a2.15 2.15 0 0 1 0.56 -3l6.72 -4.52l19.43 -13.08A2.05 2.05 0 0 0 251.54 54.77ZM213 216.07h-172a5.23 5.23 0 0 1 -5.23 -5.24V38.94a5.22 5.22 0 0 1 5.23 -5.23H213a5.22 5.22 0 0 1 5.23 5.23V210.83h0.07A5.22 5.22 0 0 1 213 216.07Z",fill:"#22071b"},{type:"path",d:"M246.45 139.8l-7.28 4.88a2.15 2.15 0 0 0 -0.56 3a2.22 2.22 0 0 0 1.76 0.92a2.44 2.44 0 0 0 1.21 -0.36l7.28 -4.87a2.14 2.14 0 0 0 -2.41 -3.54Z",fill:"#22071b"}],labels:[]};var n0=re({id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",spec:e0,at:{x:24,y:0,scale:1}});var wr={default:Au,Arrow:Eu,StandardBox:t0,SquareBorder:Ku,StrikedBox:n0,Halloween:Zu,DotRing:Xu},r0={FlamQR:"DotRing"},xo=t=>{if(Object.hasOwn(wr,t))return wr[t];let e=Object.hasOwn(r0,t)?r0[t]:void 0;return e?wr[e]:void 0},b5=()=>Object.values(wr),y5=()=>Object.keys(wr);var qi=t=>Math.round(Math.min(Math.max(t,0),255)).toString(16).padStart(2,"0");function s0(t){return `#${qi(t.r)}${qi(t.g)}${qi(t.b)}`}function Gn(t){let e=lt(t);return !e||e.a>=1||e.a<=0?{color:t}:{color:s0(e),opacity:K(e.a,3)}}function $o(t,e){let n=Math.min(Math.max(t.a,0),1);return {r:t.r*n+e.r*(1-n),g:t.g*n+e.g*(1-n),b:t.b*n+e.b*(1-n),a:1}}var l0={r:0,g:0,b:0,a:1};function tp(t){return [...t].map(e=>({offset:Math.min(Math.max(e.offset/100,0),1),color:lt(e.color)??l0})).sort((e,n)=>e.offset-n.offset)}function Wi(t,e){let n=t[0],o=t.at(-1);if(!(n&&o))return l0;if(e<=n.offset)return n.color;if(e>=o.offset)return o.color;for(let r=0;r+1<t.length;r++){let a=t[r],i=t[r+1];if(e>=a.offset&&e<=i.offset){let l=i.offset-a.offset,s=l>0?(e-a.offset)/l:1,c=a.color.a+(i.color.a-a.color.a)*s,u=(m,f)=>{let d=m*a.color.a+(f*i.color.a-m*a.color.a)*s;return c>0?d/c:m+(f-m)*s};return {r:u(a.color.r,i.color.r),g:u(a.color.g,i.color.g),b:u(a.color.b,i.color.b),a:c}}}return o.color}var o0=4,a0=720,ep=2;function c0(t,e,n,o,r){let a=tp(t);if(a.length===0)return {wedges:[]};let i=a[0].color.a,l=a.every(y=>Math.abs(y.color.a-i)<.002),s=[...new Set([0,...a.map(y=>y.offset),1])].sort((y,_)=>y-_),c=[];for(let y=0;y+1<s.length;y++){let _=s[y],w=s[y+1];if(w<=_)continue;let C=Wi(a,_+1e-9),S=Wi(a,w-1e-9),x=Math.max(Math.abs(C.r*C.a-S.r*S.a),Math.abs(C.g*C.a-S.g*S.a),Math.abs(C.b*C.a-S.b*S.a),Math.abs(C.a-S.a)*255),M=Math.ceil(x/ep),R=Math.ceil((w-_)*360/o0),E=Math.max(1,M,R);for(let v=0;v<E;v++)c.push([_+(w-_)*v/E,_+(w-_)*(v+1)/E]);}let u=c;if(c.length>a0){let y=Math.ceil(c.length/a0);u=[];for(let _=0;_<c.length;_+=y){let w=c.slice(_,_+y);u.push([w[0][0],w.at(-1)[1]]);}}let m=e-90,f=r/Math.cos(2*o0/2*(Math.PI/180)),d=y=>{let _=y*Math.PI/180;return [$(n+f*Math.cos(_)),$(o+f*Math.sin(_))]},g=`${$(n)} ${$(o)}`,h=y=>K((y%360+360)%360,4),p=u.length-1,b=u.map(([y,_],w)=>{let C=Wi(a,(y+_)/2),S=(_-y)*360,x=l&&w===0&&p>0?S:0,M=l&&w<p?S:0,R=m+y*360-x,E=m+_*360+M,[v,I]=d(R),[L,T]=d(E);return {d:`M${g}L${v} ${I}L${L} ${T}Z`,color:s0(C),...l||C.a>=1?{}:{opacity:K(C.a,3)},from:h(R),sweep:K(E-R,4)}});return l&&i<1?{wedges:b,opacity:K(i,3)}:{wedges:b}}function i0(t,e,n,o){return (Math.atan2(o-e,n-t)*180/Math.PI%360+360)%360}function u0(t,e,n){if(t>=n.x-1e-6&&t<=n.x+n.width+1e-6&&e>=n.y-1e-6&&e<=n.y+n.height+1e-6)return null;let r=[[n.x,n.y],[n.x+n.width,n.y],[n.x,n.y+n.height],[n.x+n.width,n.y+n.height]],a=i0(t,e,n.x+n.width/2,n.y+n.height/2),i=0,l=0;for(let[s,c]of r){let u=i0(t,e,s,c)-a;u>180?u-=360:u<=-180&&(u+=360),i=Math.min(i,u),l=Math.max(l,u);}return [a+i,a+l]}function m0(t,e){let n=t[1]-t[0],o=e[1]-e[0];if(n>=360||o>=360)return true;let r=((e[0]-t[0])%360+360)%360;return r<=n||r+o>=360}function Xi(t,e){return t.slice().map((n,o)=>o<e.y||o>=e.y+e.h?n:n.map((r,a)=>a<e.x||a>=e.x+e.w?r:false))}function h0(t,e=0){let n=[];return t.forEach((o,r)=>{let a=null;o.forEach((i,l)=>{if(!i&&a!==null){n.push(A`M${a+e} ${r+e}h${l-a}v1H${a+e}z`),a=null;return}if(l===o.length-1){if(!i)return;a===null?n.push(A`M${l+e},${r+e} h1v1H${l+e}z`):n.push(A`M${a+e},${r+e} h${l+1-a}v1H${a+e}z`);return}i&&a===null&&(a=l);});}),n.join("")}function np(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}var rp=.9;function Vi(t,e){let{margin:n,pixelSize:o,pattern:r="circle",plain:a=false}=e;if(ru(r))return au(t,{margin:n,pixelSize:o,pattern:r,scale:e.scale,plain:a});let i=po(e.scale,r),l=[],s=t.length,c=o*.45,u=a?()=>false:Pi(s);return t.forEach((m,f)=>{m.forEach((d,g)=>{if(d&&(a||!np(g,f,s))){let h=(g+.5+n)*o,p=(f+.5+n)*o,b=`${g}-${f}`,y=l.length;if(u(g,f)){l.push(P("rect",{height:$(o),width:$(o),x:$(h-o/2),y:$(p-o/2)},b));return}switch(r){case "circle":l.push(P("circle",{cx:$(h),cy:$(p),r:$(c),transform:A`rotate(0,${h},${p})`},b));break;case "circle-large":{let _=o*.5;l.push(P("circle",{cx:$(h),cy:$(p),r:$(_),transform:A`rotate(0,${h},${p})`},b));}break;case "small-square":{let _=o*.357143;l.push(P("path",{d:A`M ${h-_} ${p-_}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:A`rotate(0,${h},${p})`},b));}break;case "diamond":{let _=o*.357143;l.push(P("path",{d:A`M ${h-_} ${p-_}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:A`rotate(45,${h},${p})`},b));}break;case "circle-mixed":{let _=(g+f)%3===0?rp:(g+f)%2===0?1:1.25,w=c*_;l.push(P("circle",{cx:$(h),cy:$(p),r:$(w),transform:A`rotate(0,${h},${p})`},b));}break;case "pacman":{let _=o*.5,w=o*.357143;l.push(P("path",{d:A`M ${h-_} ${p-w}v ${o*.714286}h ${_}a ${_*.5} ${_*.5}, 0, 0, 0, 0 -${o*.714286}h -${_}v -${o*.714286}z`,transform:A`rotate(${(g+f)%2===0?0:90},${h},${p})`},b));}break;case "rounded":{let _=o*.5,w=o*.2;l.push(P("rect",{height:$(o),rx:$(w),ry:$(w),transform:A`rotate(0,${h},${p})`,width:$(o),x:$(h-_),y:$(p-_)},b));}break;case "square":{let _=o*.5;l.push(P("rect",{height:$(o),transform:A`rotate(0,${h},${p})`,width:$(o),x:$(h-_),y:$(p-_)},b));}break;case "vertical-line":{let _=o*.714286,w=o;l.push(P("path",{d:A`M ${h-o*.5} ${p-_*.5}v ${_}h ${w}v -${_}z`,transform:A`rotate(90,${h},${p})`},b));}break;default:l.push(P("circle",{cx:$(h),cy:$(p),r:$(c),transform:A`rotate(0,${h},${p})`},b));}if(i!==1&&l.length>y){let _=l.pop();l.push(P("g",{transform:A`translate(${h},${p}) scale(${$(i,6)}) translate(${-h},${-p})`,children:_},b));}}});}),l}function op(t,e){let n=t*Math.PI/180,o=e/2,r=e/2,a=Math.sqrt(e*e+e*e)/2,i=o-a*Math.cos(n),l=r-a*Math.sin(n),s=o+a*Math.cos(n),c=r+a*Math.sin(n);return {x1:i,y1:l,x2:s,y2:c}}function ji(t,e){return `${t}-${ze(JSON.stringify(e))}`}function ap(t,e,n,o,r){let a=t;if(t===0)switch(r){case "top-left":a=0;break;case "top-right":a=90;break;case "bottom-left":a=270;break;default:a=0;}let i=a*Math.PI/180,l=e+o/2,s=n+o/2,c=Math.sqrt(o*o+o*o)/2,u=l-c*Math.cos(i),m=s-c*Math.sin(i),f=l+c*Math.cos(i),d=s+c*Math.sin(i);return {x1:u,y1:m,x2:f,y2:d}}function Co(t,e){return e.map((n,o)=>{let{color:r,opacity:a}=Gn(n.color);return P("stop",{offset:`${n.offset}%`,stopColor:r,stopOpacity:a},`${t}-stop-${o}`)})}function p0(t,e,n,o,r,a){let i=c0(e.stops,e.angle??0,n,o,r),l=i.wedges.map((s,c)=>P("path",{d:s.d,"data-arc":`${s.from} ${s.sweep}`,fill:s.color,fillOpacity:s.opacity,shapeRendering:s.opacity===void 0?void 0:"crispEdges"},`${t}-w-${c}`));return P("pattern",{"data-qrdx-conic":`${$(n)} ${$(o)}`,height:$(a),id:t,patternUnits:"userSpaceOnUse",width:$(a),x:0,y:0,children:i.opacity===void 0?l:P("g",{opacity:i.opacity,children:l})},t)}function ip(t="center"){let[e,n]=t.split("-"),o=t==="center"?"center":e,r=n??(e==="left"||e==="right"?e:"center");return {x:r==="left"?0:r==="right"?1:.5,y:o==="top"?0:o==="bottom"?1:.5}}var sp=["xMin","xMid","xMax"],lp=["YMin","YMid","YMax"];function g0(t,e,n){let o=e.scale??1,r=e.fit==="tile",a=r?n/4*o:n,i=e.underlay?Gn(e.underlay):null,l=r?a:n*o,s=ip(e.position),c=r?0:s.x*(n-l),u=r?0:s.y*(n-l),m=r?"xMidYMid slice":`${sp[s.x*2]??"xMid"}${lp[s.y*2]??"YMid"} ${e.fit==="contain"?"meet":"slice"}`;return xt("pattern",{height:$(a),id:t,patternUnits:"userSpaceOnUse",width:$(a),x:0,y:0,children:[i&&P("rect",{fill:i.color,fillOpacity:i.opacity,height:$(a),width:$(a),x:0,y:0}),P("image",{height:$(l),href:e.src,opacity:(e.opacity??1)<1?e.opacity:void 0,preserveAspectRatio:m,width:$(l),x:$(c),y:$(u)})]},t)}var b0=(t,e)=>ji("img",[t,e]);function cp(t,e,n,o,r,a,i){let l=Lt(t);if(l.type==="solid")return null;if(l.type==="image"){let c=b0(l,i);return {id:c,element:g0(c,l,i)}}let s=ji(a,[l,e,n,o,r,...l.type==="angular"?[i]:[]]);if(l.type==="linear"){let c=l,u=c.angle??0,{x1:m,y1:f,x2:d,y2:g}=ap(u,e,n,o,r);return {id:s,element:P("linearGradient",{gradientUnits:"userSpaceOnUse",id:s,x1:$(m),x2:$(d),y1:$(f),y2:$(g),children:Co(s,c.stops)},s)}}if(l.type==="radial"){let c=l,u=e+o/2,m=n+o/2,f=o/2*.97;return {id:s,element:P("radialGradient",{cx:$(u),cy:$(m),fx:$(u),fy:$(m),gradientUnits:"userSpaceOnUse",id:s,r:$(f),children:Co(s,c.stops)},s)}}return l.type==="angular"?{id:s,element:p0(s,l,e+o/2,n+o/2,o*.75,i)}:null}function So(t,e,n){let o=Lt(t);if(o.type==="solid")return null;if(o.type==="image"){let a=b0(o,e);return {id:a,element:g0(a,o,e)}}let r=ji(n,[o,e]);if(o.type==="linear"){let a=o,i=a.angle??0,{x1:l,y1:s,x2:c,y2:u}=op(i,e);return {id:r,element:P("linearGradient",{gradientUnits:"userSpaceOnUse",id:r,x1:$(l),x2:$(c),y1:$(s),y2:$(u),children:Co(r,a.stops)},r)}}if(o.type==="radial"){let a=o,i=e/2,l=e/2,s=e/2*.97;return {id:r,element:P("radialGradient",{cx:$(i),cy:$(l),fx:$(i),fy:$(l),gradientUnits:"userSpaceOnUse",id:r,r:$(s),children:Co(r,a.stops)},r)}}return o.type==="angular"?{id:r,element:p0(r,o,e/2,e/2,e*.75,e)}:null}var wo=t=>je(t)||pi(t);function d0(t){let e=new Set,n=[];for(let o of t)o&&!e.has(o.id)&&(e.add(o.id),n.push(o.element));return n}function fe(t,e,n){if(e)return {fill:`url(#${e})`};let o=Lt(t,n),r=o.type==="solid"?o.color:o.type==="image"?o.underlay??n:n,{color:a,opacity:i}=Gn(r);return i===void 0?{fill:a}:{fill:a,fillOpacity:i}}function Ae(t,e,n,o){if(o==null)return null;let r=t.length,a=Math.floor(e*Br),i=(r+2*n)/e,l=(o.width||a)*i,s=(o.height||a)*i,c=o.x==null?r/2-l/2:o.x*i,u=o.y==null?r/2-s/2:o.y*i,m=null;if(o.excavate){let f=Math.max(0,o.padding??0)*i,d=Math.floor(c-f),g=Math.floor(u-f),h=Math.ceil(l+c+f-d),p=Math.ceil(s+u+f-g);m={x:d,y:g,w:h,h:p};}return {x:c,y:u,h:s,w:l,excavation:m}}function Et(t){let e=t.level??Kt,{imageSettings:n}=t,o=t.isOGContext&&n?.excavate&&(e==="L"||e==="M")?"Q":e;if(t.autoLevel&&n&&o!=="H"){let r=ut.QrCode.encodeText(t.value,$t[o]).getModules(),a=Ae(r,t.size??it,Rt(r.length,t.margin??ft,t.shape),n);a&&(a.excavation?a.excavation.w*a.excavation.h:a.w*a.h)/(r.length*r.length)>Ma&&(o="H");}return o}function up(t,e,n,o){let r=e/n,a=t.w*r,i=t.h*r,l=(t.x+o)*r,s=(t.y+o)*r;return {imgWidth:a,imgHeight:i,imgLeft:l,imgTop:s}}function Cr(t){let{value:e,size:n=it,level:o=Kt,bgColor:r=mt,fgColor:a=Mt,eyeColor:i,dotColor:l,bodyPattern:s="circle",cornerEyePattern:c="gear",cornerEyeDotPattern:u="circle",margin:m=ft,isOGContext:f=false,imageSettings:d,templateId:g,customTemplate:h,customProps:p,frame:b,art:y,eyeColors:_,moduleScale:w,autoLevel:C,shape:S,eyeShapes:x,eyeGradient:M,bgRadius:R,backdrop:E,halo:v,shadow:I,frameLabelMarkers:L,partMarkers:T,...F}=t,k=On({value:e,size:n,margin:m,level:o,shape:S,autoLevel:C,isOGContext:f},d),q=Tt(b),H=q?{}:F,G=z=>q?mr(z,{size:n,frame:b,bgColor:r,svgProps:F,markLabels:L}):z,U=Et({value:e,size:n,level:o,margin:m,imageSettings:k,isOGContext:f,autoLevel:C,shape:S}),Z=ut.QrCode.encodeText(e,$t[U]),rt=Z.getModules(),W=Rt(rt.length,m,S),O=wc(e,rt.length,m,S),N=(z,vt)=>Bi(T,z,vt),_t=Nn(R,rt.length,W,S),At=(z,vt)=>{let Yt=hi(S,z);if(!Yt){if(_t>0){let ae=$(_t*z),Wt=E?Gn(E):null;return xt(Qt,{children:[Wt&&P("rect",{"data-qrdx-look":"backdrop",fill:Wt.color,fillOpacity:Wt.opacity,height:z,width:z,x:0,y:0}),P("rect",{...vt,height:z,rx:ae,ry:ae,width:z,x:0,y:0,...N("background")})]})}return P("rect",{...vt,height:z,width:z,x:0,y:0,...N("background")})}return "circle"in Yt?P("circle",{cx:$(z/2),cy:$(z/2),...vt,r:$(z/2),...N("background")}):P("path",{d:Yt.path,...vt,...N("background")})},Fe=rt.length+W*2,Gt=Ae(rt,n,W,k),Dt=null;if(k!=null&&Gt!=null){Gt.excavation!=null&&(rt=Xi(rt,Gt.excavation));let{imgWidth:z,imgHeight:vt,imgLeft:Yt,imgTop:ae}=up(Gt,n,Fe,W);if(f){let Wt=k.shape??"square";Dt=P("img",{alt:"Logo",src:k.src,style:{position:"absolute",left:`${$(Yt)}px`,top:`${$(ae)}px`,width:`${$(z)}px`,height:`${$(vt)}px`,...Wt!=="square"&&{borderRadius:Wt==="circle"?"50%":`${$(Math.min(z,vt)*so)}px`},...k.plate&&{backgroundColor:k.plate,padding:`${$(z*lo)}px`,boxSizing:"border-box"}}});}else Dt=co(k,{x:Yt,y:ae,w:z,h:vt}),T&&(Dt=Ne(Dt,N("logo")));}let ht=n/Fe,Q=rt.length,B=7*ht,Y=1.5*ht,pt={fgColor:bt(a,Mt),bgColor:bt(r,mt)},oe=$i(y)?Mi({art:y,modules:rt,version:Z.version,margin:W,pixelSize:ht,...pt,body:z=>Vi(z,{margin:W,pixelSize:ht,pattern:s,scale:w})}):null,Ys=oe&&T?Ne(oe,N("body")):oe,Ks=oe&&y?Ai({art:y,version:Z.version,...pt}):null,Js=oe?null:Vi(rt,{margin:W,pixelSize:ht,pattern:s,scale:w}),Nr=O?Vi(O,{margin:0,pixelSize:ht,pattern:s,scale:w,plain:true}):null,Or=Lt(r,mt),ta=Lt(a,Mt),tl=wo(Or)?So(Or,n,"bg-color"):null,ea=wo(ta)?So(ta,n,"fg-color"):null,td=fe(r,tl?.id??null,mt),el=fe(a,ea?.id??null,Mt),nl=Ys?xt(Qt,{children:[Ys,Nr&&P("g",{...el,...N("body"),children:Nr})]}):xt("g",{...el,...N("body"),children:[Js,Nr]}),on=W*ht,an=W*ht,sn=(Q-7+W)*ht,ln=W*ht,cn=W*ht,un=(Q-7+W)*ht,Te=bt(a,Mt),mn=z=>_?.[z]?.outer??Ks?.[z]?.outer??i,dn=z=>_?.[z]?.inner??Ks?.[z]?.inner??l,fn=(z,vt,Yt,ae,Wt)=>{let pn=Lt(z,Te);if(!wo(pn))return null;if(M==="code"&&je(pn)){let ba=JSON.stringify(pn)===JSON.stringify(ta);return So(pn,n,ba?"fg-color":Wt)}return cp(pn,vt,Yt,B,ae,Wt,n)},na=fn(mn("topLeft"),on,an,"top-left","corners-square-color-0-0"),ra=fn(mn("topRight"),sn,ln,"top-right","corners-square-color-1-0"),oa=fn(mn("bottomLeft"),cn,un,"bottom-left","corners-square-color-0-1"),aa=fn(dn("topLeft"),on,an,"top-left","corners-dot-color-0-0"),ia=fn(dn("topRight"),sn,ln,"top-right","corners-dot-color-1-0"),sa=fn(dn("bottomLeft"),cn,un,"bottom-left","corners-dot-color-0-1"),rl=fe(mn("topLeft"),na?.id??null,Te),ol=fe(mn("topRight"),ra?.id??null,Te),al=fe(mn("bottomLeft"),oa?.id??null,Te),il=fe(dn("topLeft"),aa?.id??null,Te),sl=fe(dn("topRight"),ia?.id??null,Te),ll=fe(dn("bottomLeft"),sa?.id??null,Te),hn={cornerEyePattern:c,cornerEyeDotPattern:u,eyeShapes:x},la=bo(on,an,B,ne(hn,"topLeft").outer,"top-left"),ca=go(on+B/2,an+B/2,Y,ne(hn,"topLeft").inner,"top-left"),ua=bo(sn,ln,B,ne(hn,"topRight").outer,"top-right"),ma=go(sn+B/2,ln+B/2,Y,ne(hn,"topRight").inner,"top-right"),da=bo(cn,un,B,ne(hn,"bottomLeft").outer,"bottom-left"),fa=go(cn+B/2,un+B/2,Y,ne(hn,"bottomLeft").inner,"bottom-left"),ha=yr(v,{bgColor:r}),Xn=Oi(I),cl=z=>xt(Qt,{children:[oe?null:Js,Nr,P("path",{d:la,fillRule:z}),ca,P("path",{d:ua,fillRule:z}),ma,P("path",{d:da,fillRule:z}),fa]}),pa=null;if(ha){let{color:z}=ha;pa=P("g",{"data-qrdx-look":"halo",fill:z,stroke:z,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:$(2*ha.width*ht),children:cl("nonzero")});}let ga=null;if(Xn){let{color:z}=Gn(Xn.color);ga=P("g",{"data-qrdx-look":"shadow",fill:z,opacity:$(Xn.opacity),transform:A`translate(${Xn.dx*ht},${Xn.dy*ht})`,children:cl("evenodd")});}let ed=xt(Qt,{children:[P("defs",{children:d0([tl,ea,na,ra,oa,aa,ia,sa])}),At(n,td),pa,ga,nl,P("g",{...rl,...N("eye-outer","top-left"),children:P("path",{d:la,fillRule:"evenodd",transform:A`rotate(0,${on+B/2},${an+B/2})`})}),P("g",{...il,...N("eye-centre","top-left"),children:ca}),P("g",{...ol,...N("eye-outer","top-right"),children:P("path",{d:ua,fillRule:"evenodd",transform:A`rotate(0,${sn+B/2},${ln+B/2})`})}),P("g",{...sl,...N("eye-centre","top-right"),children:ma}),P("g",{...al,...N("eye-outer","bottom-left"),children:P("path",{d:da,fillRule:"evenodd",transform:A`rotate(0,${cn+B/2},${un+B/2})`})}),P("g",{...ll,...N("eye-centre","bottom-left"),children:fa}),Dt]}),ul=h||(g?xo(g):void 0);if(ul){let vt=wo(Or)?So(Or,300,"bg-color-template"):null,Yt=fe(r,vt?.id??null,mt),ae=xt("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[P("defs",{children:d0([vt,ea,na,ra,oa,aa,ia,sa])}),At(300,Yt),xt("g",{transform:`scale(${$(300/n,6)})`,children:[pa,ga,nl,P("g",{...rl,...N("eye-outer","top-left"),children:P("path",{d:la,fillRule:"evenodd",transform:A`rotate(0,${on+B/2},${an+B/2})`})}),P("g",{...il,...N("eye-centre","top-left"),children:ca}),P("g",{...ol,...N("eye-outer","top-right"),children:P("path",{d:ua,fillRule:"evenodd",transform:A`rotate(0,${sn+B/2},${ln+B/2})`})}),P("g",{...sl,...N("eye-centre","top-right"),children:ma}),P("g",{...al,...N("eye-outer","bottom-left"),children:P("path",{d:da,fillRule:"evenodd",transform:A`rotate(0,${cn+B/2},${un+B/2})`})}),P("g",{...ll,...N("eye-centre","bottom-left"),children:fa}),Dt]})]}),Wt=300/n,ba={pixelSize:ht*Wt,url:e},ml=ul.wrapper(ae,{fgColor:a,bgColor:r,...p||{},...F},ba),nd={...ml?.props?.style||{},width:void 0,height:void 0,...H.style};return G(Ne(ml,{...H,width:n,height:n,style:nd}))}return G(P("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg",...H,children:ed}))}var q5=(()=>{try{new Path2D().addPath(new Path2D);}catch{return false}return true})(),W5=t=>{let e=t.trim().replace(/^#/,"");e.length===3||e.length===4?e=e.slice(0,3).split("").map(o=>o+o).join(""):e.length===8&&(e=e.slice(0,6));let n=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:Number.parseInt(n[1],16),g:Number.parseInt(n[2],16),b:Number.parseInt(n[3],16)}:null},Qn=(t,e,n)=>{let[o,r,a]=[t,e,n].map(i=>(i/=255,i<=.03928?i/12.92:((i+.055)/1.055)**2.4));return .2126*o+.7152*r+.0722*a},f0=t=>{let e=lt(t);if(!e)return null;let n=o=>o*e.a+255*(1-e.a);return {r:n(e.r),g:n(e.g),b:n(e.b)}},V5=(t,e)=>{let n=f0(t),o=f0(e);if(!(n&&o))return 1;let r=Qn(n.r,n.g,n.b),a=Qn(o.r,o.g,o.b),i=Math.max(r,a),l=Math.min(r,a);return (i+.05)/(l+.05)},X5=t=>t>=7?{level:"AAA",warning:false,message:"Excellent contrast"}:t>=4.5?{level:"AA",warning:false,message:"Good contrast"}:t>=3?{level:"AA Large",warning:true,message:"Low contrast - may be difficult to scan"}:{level:"Fail",warning:true,message:"Poor contrast - QR code may not scan properly"};var y0=.6,mp=["L","M","Q","H"];function _0(t){let e=ut.QrCode.encodeText(t.value,$t[t.level]),n=mp[e.errorCorrectionLevel.ordinal]??t.level;return {code:t,cells:e.getModules(),layoutMargin:Rt(e.size,t.margin,t.shape),map:dr(e.version,n),level:n,version:e.version}}function x0(t,e){let{cells:n,map:o}=t,r=n.length,a=Ae(n,t.code.size,t.layoutMargin,e);if(!a)return null;let i=a.excavation??{x:Math.floor(a.x),y:Math.floor(a.y),w:Math.ceil(a.x+a.w)-Math.floor(a.x),h:Math.ceil(a.y+a.h)-Math.floor(a.y)},l=[];for(let c=Math.max(0,i.y);c<Math.min(r,i.y+i.h);c++)for(let u=Math.max(0,i.x);u<Math.min(r,i.x+i.w);u++)l.push(c*r+u);let s=fr(o,l);return {worst:Math.max(0,...s),correctable:o.correctable,budget:Math.floor(o.correctable*y0),level:t.level,version:t.version}}function Mo(t,e){return x0(_0(t),e)}var $0=t=>!t||t.worst<=t.budget;function dp(t,e){return $0(Mo(t,e))}function Zi(t,e,n,o){let r=e.map(l=>_0({...t,level:l})),a=l=>{let s=o(l);return r.every(c=>$0(x0(c,s)))};if(a(n))return n;let i=t.size*.005;for(let l=n-i;l>0;l-=i)if(a(l))return l;return 0}function On(t,e){if(!e)return;let n=Math.floor(t.size*Br),o=e.width||n,r=e.height||n,a=f=>{if(f===o)return e;let d=r*f/o;return {...e,width:f,height:d,...e.x!=null&&{x:e.x+(o-f)/2},...e.y!=null&&{y:e.y+(r-d)/2}}},i=t.level??Kt,l={value:t.value,size:t.size,margin:t.margin,shape:t.shape},s=f=>Et({...t,level:i,imageSettings:f}),c=f=>{let d=Zi(l,[f],o,a);return d>0?a(d):void 0},u=s(e);if(u===i)return c(i);let m=c(u);return m&&s(m)===u?m:c(i)}async function Yi(t){let{value:e,size:n=it,level:o=Kt,bgColor:r=mt,fgColor:a=Mt,margin:i=ft,imageSettings:l,eyeColor:s,dotColor:c,bodyPattern:u,cornerEyePattern:m,cornerEyeDotPattern:f,isOGContext:d,templateId:g,customTemplate:h,customProps:p,frame:b,art:y,eyeColors:_,moduleScale:w,eyeShapes:C,eyeGradient:S,bgRadius:x,backdrop:M,halo:R,shadow:E,frameLabelMarkers:v,partMarkers:I,autoLevel:L,...T}=t,F=On({value:e,size:n,margin:i,level:o,autoLevel:L},l),k=Et({value:e,size:n,level:o,margin:i,imageSettings:F,autoLevel:L}),q=ut.QrCode.encodeText(e,$t[k]).getModules(),H=q.length+i*2,G=Ae(q,n,i,F),U=null;if(F!=null&&G!=null){G.excavation!=null&&(q=Xi(q,G.excavation));let rt=F.src.startsWith("data:")?F.src:await fetch(`https://wsrv.nl/?url=${encodeURIComponent(F.src)}&w=100&h=100&encoding=base64`).then(W=>{if(!W.ok)throw new Error(`Failed to load QR logo (${W.status}): ${F.src}`);return W.text()});U={settings:{...F,src:rt},box:{x:G.x+i,y:G.y+i,w:G.w,h:G.h}};}let Z=h0(q,i);return {size:n,numCells:H,fgPath:Z,bgColor:r,fgColor:a,frame:b,svgProps:T,logo:U}}function Ki(t){let{size:e,numCells:n,fgPath:o,bgColor:r,fgColor:a,frame:i,svgProps:l,logo:s}=t,c=Tt(i),u=s?co(s.settings,s.box):P(Qt,{}),m=xt("svg",{height:e,viewBox:`0 0 ${n} ${n}`,width:e,xmlns:"http://www.w3.org/2000/svg",...c?{}:l,children:[P("path",{d:`M0,0 h${n}v${n}H0z`,fill:bt(r,mt),shapeRendering:"crispEdges"}),P("path",{d:o,fill:bt(a,Mt),shapeRendering:"crispEdges"}),u]});return c&&i?mr(m,{size:e,frame:i,bgColor:r,svgProps:l}):m}async function fp(t){return Ki(await Yi(t))}var Un={jsx:jsxRuntime.jsx,jsxs:jsxRuntime.jsxs,createElement:react.createElement,cloneElement:react.cloneElement,Fragment:react.Fragment};async function y3(t){let e=await Yi(t);return gn(Un,()=>Ki(e))}var _p=16384;var S0=t=>t*3+3&-4,Ji=(t,e)=>Math.floor((t*e+255*(255-e)+127)/255);function ts(t,e,n){if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>16384||n>16384)throw new RangeError(`BMP width and height must be whole numbers from 1 to 16384, got ${e} x ${n}`);if(t.length!==e*n*4)throw new RangeError(`Expected ${e*n*4} RGBA bytes for ${e} x ${n}, got ${t.length}`);let o=S0(e),r=o*n,a=new Uint8Array(54+r),i=new DataView(a.buffer);a[0]=66,a[1]=77,i.setUint32(2,a.length,true),i.setUint32(10,54,true),i.setUint32(14,40,true),i.setInt32(18,e,true),i.setInt32(22,n,true),i.setUint16(26,1,true),i.setUint16(28,24,true),i.setUint32(30,0,true),i.setUint32(34,r,true),i.setInt32(38,2835,true),i.setInt32(42,2835,true);for(let l=0;l<n;l++){let s=l*e*4,c=54+(n-1-l)*o;for(let u=0;u<e;u++){let m=t[s+3],f=t[s],d=t[s+1],g=t[s+2];m===255?(a[c]=g,a[c+1]=d,a[c+2]=f):(a[c]=Ji(g,m),a[c+1]=Ji(d,m),a[c+2]=Ji(f,m)),s+=4,c+=3;}}return a}function es(t){if(t.length<54||t[0]!==66||t[1]!==77)return false;let e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=e.getInt32(18,true),o=e.getInt32(22,true);return e.getUint32(2,true)===t.length&&e.getUint32(10,true)===54&&e.getUint32(14,true)===40&&n>0&&o>0&&e.getUint16(26,true)===1&&e.getUint16(28,true)===24&&e.getUint32(30,true)===0&&t.length===54+S0(n)*o}function Ro(t){let e=t.getContext("2d");if(!e)throw new Error("Could not get canvas context");let{data:n}=e.getImageData(0,0,t.width,t.height),o=ts(n,t.width,t.height);if(!es(o))throw new Error("Could not write a BMP file");return new Blob([o],{type:"image/bmp"})}var v3=(t,e,n,o)=>{let r=document.createElement("canvas");r.width=e,r.height=n;let a=r.getContext("2d");if(!a)return;a.putImageData(t,0,0);let i=r.toDataURL("image/png"),l=document.createElement("a");l.href=i,l.download=o,document.body.appendChild(l),l.click(),document.body.removeChild(l);},xp=async(t,e,n,o)=>{let{default:r}=await import('jsqr');return new Promise(a=>{t.complete?i():(t.onload=()=>i(),t.onerror=()=>a(null));function i(){let l=document.createElement("canvas");requestAnimationFrame(()=>{if(!(t.naturalWidth&&t.naturalHeight)){a(null);return}let s=t.naturalWidth/t.naturalHeight<=.33||t.naturalWidth/t.naturalHeight>=3?Math.sqrt(t.naturalWidth*t.naturalHeight/12e5):t.naturalWidth/t.naturalHeight<=.5||t.naturalWidth/t.naturalHeight>=2?Math.sqrt(t.naturalWidth*t.naturalHeight/9e5):Math.sqrt(t.naturalWidth*t.naturalHeight/64e4),c=l.getContext("2d",{willReadFrequently:true});if(!c){a(null);return}let u=[1,.8,.6,.4,.2,.1];for(let m of u){let f=Math.floor(t.naturalWidth*e*m/s),d=Math.floor(t.naturalHeight*e*m/s);l.width=f,l.height=d,c.clearRect(0,0,f,d),c.imageSmoothingEnabled=true,c.imageSmoothingQuality="high";try{c.drawImage(t,Math.floor(n),Math.floor(o),Math.floor(t.naturalWidth*e),Math.floor(t.naturalHeight*e),0,0,f,d);let g=c.getImageData(0,0,f,d);try{let h=r(g.data,f,d);if(h?.data){a(h);return}}catch(h){console.error("QR Detection error:",h);}}catch(g){console.error("Canvas drawing error:",g);}}a(null);});}})},w0=async(t,e,n=false)=>{if(!t)return "NO_QR";await new Promise(r=>setTimeout(r,100));let o=[{dx:0,dy:0,ratio:1},{dx:0,dy:t.naturalHeight*.35,ratio:.65},{dx:t.naturalWidth*.35,dy:t.naturalHeight*.35,ratio:.65},{dx:t.naturalWidth*.35,dy:0,ratio:.65},{dx:t.naturalWidth*.35/2,dy:t.naturalHeight*.35/2,ratio:.65}];for(let r of o)try{let a=await xp(t,r.ratio,r.dx,r.dy);if(a?.data)return n?a:a.data}catch(a){console.warn("QR decode error:",a);}return "NO_QR"};function I3(t,e,n){if(!(t&&e)||e.length!==4)return;let o=document.createElement("canvas");o.width=t.naturalWidth,o.height=t.naturalHeight;let r=o.getContext("2d");if(!r)return;r.drawImage(t,0,0),r.save(),r.strokeStyle="#ff0000",r.lineWidth=Math.max(5,Math.min(t.naturalWidth,t.naturalHeight)/200),r.shadowColor="transparent",r.shadowBlur=0,r.beginPath(),r.moveTo(e[0].x,e[0].y),r.lineTo(e[1].x,e[1].y),r.lineTo(e[3].x,e[3].y),r.lineTo(e[2].x,e[2].y),r.closePath(),r.stroke(),r.fillStyle="#ff0000",e.forEach((l,s)=>{r.fillRect(l.x-3,l.y-3,6,6),r.fillStyle="#ffffff",r.font="16px Arial",r.fillText(`${s}`,l.x+5,l.y-5),r.fillStyle="#ff0000";}),r.restore();let a=o.toDataURL("image/png"),i=document.createElement("a");i.href=a,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i);}var $p=256,Sp=16384,wp=128;var M0=(t,e)=>{if(!(Number.isInteger(t)&&Number.isInteger(e))||t<1||e<1||t>16384||e>16384)throw new RangeError(`GIF width and height must be whole numbers from 1 to 16384, got ${t} x ${e}`)},ns=(t,e)=>t>>6*(2-e)&63;function R0(t,e,n){M0(e,n);let o=e*n;if(t.length!==o*4)throw new RangeError(`Expected ${o*4} RGBA bytes for ${e} x ${n}, got ${t.length}`);let r=new Map,a=false,i=false,l=false;for(let b=0;b<o;b++){let y=b*4,_=t[y+3];if(_<128){a=true,i||=_>0;continue}if(i||=_<255,!l){let w=t[y]<<16|t[y+1]<<8|t[y+2];r.has(w)||(r.set(w,r.size),l=r.size>256);}}let s=a?255:256,c=!l&&r.size<=s,u=new Uint8Array(o),m,f,d;if(c){f=[];for(let b of r.keys())f.push(b>>16&255,b>>8&255,b&255);m=r.size,d=(b,y,_)=>r.get(b<<16|y<<8|_);}else {let b=Cp(t,o,s);f=b.palette,m=b.palette.length/3,d=(y,_,w)=>b.bucketIndex[E0(y,_,w)];}let g=a?m:null;for(let b=0;b<o;b++){let y=b*4;t[y+3]<128?u[b]=g:u[b]=d(t[y],t[y+1],t[y+2]);}let h=m+(a?1:0),p=new Uint8Array(h*3);return p.set(f),a&&p.fill(255,m*3),{width:e,height:n,palette:p,indices:u,transparentIndex:g,colors:h,lossless:c&&!i}}var E0=(t,e,n)=>t>>2<<12|e>>2<<6|n>>2;function Cp(t,e,n){let o=new Uint32Array(262144),r=new Float64Array(262144),a=new Float64Array(262144),i=new Float64Array(262144);for(let f=0;f<e;f++){let d=f*4;if(t[d+3]<128)continue;let g=t[d],h=t[d+1],p=t[d+2],b=E0(g,h,p);o[b]=o[b]+1,r[b]=r[b]+g,a[b]=a[b]+h,i[b]=i[b]+p;}let l=[];for(let f=0;f<262144;f++)o[f]>0&&l.push(f);let s=[{keys:l,pixels:l.reduce((f,d)=>f+o[d],0)}];for(;s.length<n;){let f=-1;for(let x=0;x<s.length;x++){let M=s[x];M.keys.length>1&&(f===-1||M.pixels>s[f].pixels)&&(f=x);}if(f===-1)break;let d=s[f],g=0,h=-1;for(let x of [0,1,2]){let M=255,R=0;for(let E of d.keys){let v=ns(E,x);M=Math.min(M,v),R=Math.max(R,v);}R-M>h&&(h=R-M,g=x);}let p=[...d.keys].sort((x,M)=>ns(x,g)-ns(M,g)||x-M),b=d.pixels/2,y=0,_=1;for(let x=0;x<p.length-1&&(y+=o[p[x]],_=x+1,!(y>=b));x++);let w=p.slice(0,_),C=p.slice(_),S=x=>x.reduce((M,R)=>M+o[R],0);s.splice(f,1,{keys:w,pixels:S(w)},{keys:C,pixels:S(C)});}let c=[];for(let f of s){let d=0,g=0,h=0;for(let p of f.keys)d+=r[p],g+=a[p],h+=i[p];c.push(Math.round(d/f.pixels),Math.round(g/f.pixels),Math.round(h/f.pixels));}let u=new Uint8Array(262144),m=c.length/3;for(let f of l){let d=o[f],g=r[f]/d,h=a[f]/d,p=i[f]/d,b=0,y=Number.POSITIVE_INFINITY;for(let _=0;_<m;_++){let w=g-c[_*3],C=h-c[_*3+1],S=p-c[_*3+2],x=w*w+C*C+S*S;x<y&&(y=x,b=_);}u[f]=b;}return {palette:c,bucketIndex:u}}var Mp=t=>Math.max(1,Math.ceil(Math.log2(t))),Eo=class{buffer=new Uint8Array(1024);length=0;push(...e){this.ensure(e.length);for(let n of e)this.buffer[this.length++]=n;}u16(e){this.push(e&255,e>>8&255);}ascii(e){for(let n=0;n<e.length;n++)this.push(e.charCodeAt(n));}bytes(e){this.ensure(e.length),this.buffer.set(e,this.length),this.length+=e.length;}ensure(e){if(this.length+e<=this.buffer.length)return;let n=this.buffer.length;for(;n<this.length+e;)n*=2;let o=new Uint8Array(n);o.set(this.buffer.subarray(0,this.length)),this.buffer=o;}result(){return this.buffer.slice(0,this.length)}};function Rp(t,e){let n=new Eo,o=1<<e,r=o+1,a=[],i=0,l=0,s=()=>{a.length>0&&(n.push(a.length,...a),a=[]);},c=h=>{a.push(h),a.length===255&&s();},u=(h,p)=>{for(i|=h<<l,l+=p;l>=8;)c(i&255),i>>>=8,l-=8;},m=new Int32Array(1048576),f=e+1,d=r+1;u(o,f);let g=t[0];for(let h=1;h<t.length;h++){let p=t[h],b=g<<8|p,y=m[b];if(y!==0){g=y-1;continue}u(g,f),d===4096?(u(o,f),m=new Int32Array(1048576),d=r+1,f=e+1):(d>=1<<f&&f++,m[b]=d+1,d++),g=p;}return u(g,f),u(r,f),l>0&&c(i&255),s(),n.result()}function A0(t){let{width:e,height:n,palette:o,indices:r,transparentIndex:a}=t;M0(e,n);let i=o.length/3;if(!Number.isInteger(i)||i<1||i>256)throw new RangeError(`A GIF palette holds 1 to 256 colors, got ${o.length} bytes`);if(r.length!==e*n)throw new RangeError(`Expected ${e*n} palette indices for ${e} x ${n}, got ${r.length}`);if(a!==null&&!(Number.isInteger(a)&&a>=0&&a<i))throw new RangeError(`The transparent index ${a} isn't in a palette of ${i} colors`);for(let m=0;m<r.length;m++)if(r[m]>=i)throw new RangeError(`Pixel ${m} points at color ${r[m]}, past the palette of ${i}`);let l=Mp(i),s=1<<l,c=Math.max(2,l),u=new Eo;return u.ascii("GIF89a"),u.u16(e),u.u16(n),u.push(240|l-1,0,0),u.bytes(o),u.bytes(new Uint8Array((s-i)*3)),a!==null&&u.push(33,249,4,1,0,0,a,0),u.push(44),u.u16(0),u.u16(0),u.u16(e),u.u16(n),u.push(0),u.push(c),u.bytes(Rp(r,c)),u.push(0),u.push(59),u.result()}function rs(t,e,n){let o=R0(t,e,n);return {file:A0(o),image:o}}function os(t){let{palette:e,indices:n,transparentIndex:o}=t,r=new Uint8ClampedArray(n.length*4);for(let a=0;a<n.length;a++){let i=n[a],l=a*4;r[l]=e[i*3],r[l+1]=e[i*3+1],r[l+2]=e[i*3+2],r[l+3]=i===o?0:255;}return r}var C0="GIF89a";function as(t){if(t.length<32)return false;for(let s=0;s<C0.length;s++)if(t[s]!==C0.charCodeAt(s))return false;let e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=e.getUint16(6,true),o=e.getUint16(8,true),r=t[10];if(n<1||o<1||!(r&128))return false;let a=13+3*(1<<(r&7)+1);if(t.length<a)return false;let i=s=>{let c=s;for(;c<t.length;){let u=t[c];if(c+=1,u===0)return c;c+=u;}return -1},l=0;for(;a<t.length;){let s=t[a];if(s===59)return l===1&&a===t.length-1;if(s===33)a=i(a+2);else if(s===44){if(a+10>t.length||e.getUint16(a+5,true)!==n||e.getUint16(a+7,true)!==o||t[a+9]&128)return false;let c=t[a+10];if(c<2||c>8)return false;l+=1,a=i(a+11);}else return false;if(a===-1)return false}return false}var Mr="image/gif",Po=class extends Error{constructor(e){super(e),this.name="GIFScanError";}},Ao=255;function P0(t){let e=new Uint8ClampedArray(t.length);for(let n=0;n<t.length;n+=4){let o=t[n+3];for(let r=0;r<3;r++)e[n+r]=Math.round((t[n+r]*o+Ao*(Ao-o))/Ao);e[n+3]=Ao;}return e}function v0(t,e,n){let o=Uint8ClampedArray.from(e.data),r=t(o,e.width,e.height,{inversionAttempts:"dontInvert"});if(!r)return false;if(r.data===n)return true;try{return new TextDecoder().decode(Uint8Array.from(r.binaryData))===n}catch{return false}}async function Ep(t,e,n){let{width:o,height:r}=t,a=P0(t.data),i=P0(e.data);if(e.width===o&&e.height===r&&a.every((c,u)=>c===i[u]))return;let l;try{l=(await import('jsqr')).default;}catch{throw new Po("This design uses more colors than a GIF holds (256), and the reduced image could not be checked because jsqr is not available. Download a PNG instead.")}if(!v0(l,{data:a,width:o,height:r},n))return;if(!v0(l,{data:i,width:e.width,height:e.height},n))throw new Po("This design uses more colors than a GIF holds (256), and the reduced image would not scan. Download a PNG instead.")}async function Ap(t,e){let{file:n,image:o}=rs(t.data,t.width,t.height);if(!as(n))throw new Error("Could not write a GIF file");return e!==void 0&&!o.lossless&&await Ep(t,{data:os(o),width:t.width,height:t.height},e),{file:n,colors:o.colors,lossless:o.lossless}}async function vo(t,e){let n=t.getContext("2d");if(!n)throw new Error("Could not get canvas context");let{data:o}=n.getImageData(0,0,t.width,t.height),{file:r}=await Ap({data:o,width:t.width,height:t.height},e);return new Blob([r],{type:Mr})}var Io=[16,32,48,256],en="image/vnd.microsoft.icon",tn=256,is=64,Rr=6,Er=16,Pp=[137,80,78,71,13,10,26,10],vp=16,I0=20,Ip=32,L0=t=>t.length>=I0+4&&Pp.every((e,n)=>t[n]===e),k0=t=>{let e=new DataView(t.buffer,t.byteOffset,t.byteLength);return {width:e.getUint32(vp),height:e.getUint32(I0)}};function ss(t){if(t.length<1||t.length>is)throw new RangeError(`An ICO holds 1 to ${is} images, got ${t.length}`);for(let{width:i,height:l,png:s}of t){let c=m=>Number.isInteger(m)&&m>=1&&m<=tn;if(!(c(i)&&c(l)))throw new RangeError(`ICO images must be whole numbers from 1 to ${tn} px, got ${i} x ${l}`);if(!L0(s))throw new RangeError("Every ICO image must be a PNG file");let u=k0(s);if(u.width!==i||u.height!==l)throw new RangeError(`An ICO image says ${i} x ${l} but its PNG is ${u.width} x ${u.height}`)}let e=Rr+Er*t.length,n=t.reduce((i,l)=>i+l.png.length,0),o=new Uint8Array(e+n),r=new DataView(o.buffer);r.setUint16(0,0,true),r.setUint16(2,1,true),r.setUint16(4,t.length,true);let a=e;return t.forEach(({width:i,height:l,png:s},c)=>{let u=Rr+Er*c;o[u]=i===tn?0:i,o[u+1]=l===tn?0:l,o[u+2]=0,o[u+3]=0,r.setUint16(u+4,1,true),r.setUint16(u+6,Ip,true),r.setUint32(u+8,s.length,true),r.setUint32(u+12,a,true),o.set(s,a),a+=s.length;}),o}function ls(t){if(t.length<Rr+Er)return false;let e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=e.getUint16(4,true);if(e.getUint16(0,true)!==0||e.getUint16(2,true)!==1||n<1||n>is||t.length<Rr+Er*n)return false;for(let o=0;o<n;o++){let r=Rr+Er*o,a=t[r]||tn,i=t[r+1]||tn,l=e.getUint32(r+8,true),s=e.getUint32(r+12,true);if(s+l>t.length)return false;let c=t.subarray(s,s+l);if(!L0(c))return false;let u=k0(c);if(u.width!==a||u.height!==i)return false}return true}var F0="data:image/png;base64,";function Lp(t){let e=t.toDataURL("image/png");if(!e.startsWith(F0))throw new Error("This browser can't write a PNG from a canvas");let n=atob(e.slice(F0.length)),o=new Uint8Array(n.length);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r);return o}function cs(t){let e=ss(t.map(n=>({width:n.width,height:n.height,png:Lp(n)})));if(!ls(e))throw new Error("Could not write an ICO file");return new Blob([e],{type:en})}function T0(t){return cs([t])}var kp=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Fp=new Map([["className","class"],["tabIndex","tabindex"],["dir","dir"],["role","role"],["viewBox","viewBox"],["width","width"],["height","height"],["xlinkActuate","xlink:actuate"],["xlinkArcrole","xlink:arcrole"],["xlinkRole","xlink:role"],["xlinkShow","xlink:show"],["xlinkTitle","xlink:title"],["xlinkType","xlink:type"],["xmlBase","xml:base"],["xmlLang","xml:lang"],["xmlSpace","xml:space"]]),Tp=new Set(["children","dangerouslySetInnerHTML","key","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","ref"]),Np=new Set(["inert","allowFullScreen","async","autoPlay","controls","credentialless","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"]),Op=new Set(["autoFocus","multiple","muted"]),Dp=new Set(["contentEditable","spellCheck","draggable","value","autoReverse","externalResourcesRequired","focusable","preserveAlpha"]),Bp=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" ")),N0=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",Gp=new RegExp(`^[${N0}][${N0}\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Lo=/^[a-zA-Z][a-zA-Z:_.\-\d]*$/,Qp=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i,Up="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')",Hp=t=>Qp.test(t)?Up:t,D0=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),zp=/["'&<>]/;function us(t){if(!zp.test(t))return t;let e="",n=0;for(let o=0;o<t.length;o++){let r;switch(t.charCodeAt(o)){case 34:r=""";break;case 38:r="&";break;case 39:r="'";break;case 60:r="<";break;case 62:r=">";break;default:continue}e+=t.slice(n,o)+r,n=o+1;}return e+t.slice(n)}var he=t=>typeof t=="function"||typeof t=="symbol",O0=new Map,qp=t=>{let e=O0.get(t);return e===void 0&&(e=t.replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^ms-/,"-ms-"),O0.set(t,e)),e};function Wp(t){if(typeof t=="string")return t;if(typeof t!="object"||t===null)return "";let e="";for(let n of Object.keys(t)){let o=t[n];if(o==null||typeof o=="boolean"||o==="")continue;let r;if(n.startsWith("--"))r=`${n}:${`${o}`.trim()}`;else {let a=typeof o=="number"?o===0||Bp.has(n)?`${o}`:`${o}px`:`${o}`.trim();r=`${qp(n)}:${a}`;}e=e?`${e};${r}`:r;}return e}function Hn(t,e){if(e==null||Tp.has(t))return null;let n=Fp.get(t);if(n!==void 0)return he(e)||typeof e=="boolean"?null:{name:n,value:`${e}`};switch(t){case "style":{let r=Wp(e);return r?{name:"style",value:r}:null}case "src":case "href":case "action":case "formAction":case "xlinkHref":return (t==="src"||t==="href")&&e===""||he(e)||typeof e=="boolean"?null:{name:t==="xlinkHref"?"xlink:href":t,value:Hp(`${e}`)};case "capture":case "download":return e===true?{name:t,value:""}:e===false||he(e)?null:{name:t,value:`${e}`};case "cols":case "rows":case "size":case "span":return he(e)||Number.isNaN(Number(e))||!(e>=1)?null:{name:t,value:`${e}`};case "rowSpan":case "start":return he(e)||Number.isNaN(Number(e))?null:{name:t,value:`${e}`};}if(Op.has(t))return e&&!he(e)?{name:t.toLowerCase(),value:""}:null;if(Dp.has(t))return he(e)?null:{name:t,value:`${e}`};if(Np.has(t))return e&&!he(e)?{name:t,value:""}:null;if(t.length>2&&(t[0]==="o"||t[0]==="O")&&(t[1]==="n"||t[1]==="N"))return null;let o=kp.get(t)??t;if(!Gp.test(o)||he(e))return null;if(typeof e=="boolean"){let r=o.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-")return null}return {name:o,value:`${e}`}}var B0="http://www.w3.org/2000/svg",G0="http://www.w3.org/1999/xhtml",Vp="http://www.w3.org/1999/xlink",Xp="http://www.w3.org/XML/1998/namespace",jp="http://www.w3.org/2000/xmlns/";function Zp(t,e,n){e==="xmlns"||e.startsWith("xmlns:")?t.setAttributeNS(jp,e,n):e.startsWith("xlink:")?t.setAttributeNS(Vp,e,n):e.startsWith("xml:")?t.setAttributeNS(Xp,e,n):t.setAttribute(e,n);}function Ar(t,e,n,o){if(e==null||typeof e=="boolean")return;if(typeof e=="string"||typeof e=="number"||typeof e=="bigint"){t.appendChild(o.createTextNode(`${e}`));return}if(Array.isArray(e)){for(let s of e)Ar(t,s,n,o);return}if(!Oe(e))throw new TypeError("qrdx: can't render this value as DOM nodes");let{type:r,props:a}=e;if(bn(r)){Ar(t,a.children,n,o);return}if(typeof r=="function"){Ar(t,r(a),n,o);return}if(!Lo.test(r))throw new TypeError(`qrdx: invalid element name: ${r}`);let i=r==="svg"?B0:n,l=o.createElementNS(i,r);for(let s of Object.keys(a)){let c=Hn(s,a[s]);c&&Zp(l,c.name,c.value);}Ar(l,a.children,i===B0&&r==="foreignObject"?G0:i,o),t.appendChild(l);}function ms(t,e=document){let n=e.createDocumentFragment();return Ar(n,t,G0,e),n}function nn(t){if(t==null||typeof t=="boolean")return "";if(typeof t=="string")return us(t);if(typeof t=="number"||typeof t=="bigint")return `${t}`;if(Array.isArray(t)){let e="";for(let n of t)e+=nn(n);return e}if(!Oe(t))throw new TypeError("qrdx: can't render this value as SVG markup");return Yp(t)}function Yp(t){let{type:e,props:n}=t;if(bn(e))return nn(n.children);if(typeof e=="function")return nn(e(n));if(!Lo.test(e))throw new TypeError(`qrdx: invalid element name: ${e}`);let o=`<${e}`;for(let i of Object.keys(n)){let l=Hn(i,n[i]);l&&(o+=` ${l.name}="${us(l.value)}"`);}if(D0.has(e))return `${o}/>`;let r=n.dangerouslySetInnerHTML?.__html,a=r==null?nn(n.children):`${r}`;return `${o}>${a}</${e}>`}function ds(t){return nn(Cr(t))}function Kp(t,e=document){return ms(Cr(t),e).firstChild}var Jp=16384;var fs=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],tg=8,hs=class{buffer;position=0;bits=0;used=0;constructor(e){this.buffer=new Uint8Array(Math.max(e,64));}write(e,n){if(n!==0)for(this.bits|=e<<this.used,this.used+=n;this.used>=8;){if(this.position===this.buffer.length){let o=new Uint8Array(this.buffer.length*2);o.set(this.buffer),this.buffer=o;}this.buffer[this.position++]=this.bits&255,this.bits>>>=8,this.used-=8;}}finish(){return this.used>0&&this.write(0,8-this.used),this.buffer.subarray(0,this.position)}};function W0(t,e){let n=new Uint8Array(t.length),o=[];for(let c=0;c<t.length;c++)(t[c]??0)>0&&o.push(c);if(o.length===0)return n;if(o.length===1)return n[o[0]]=1,n;let r=o.length,a=2*r-1,i=new Float64Array(a),l=new Int32Array(a),s=new Uint8Array(a);for(let c=1;;c*=2){for(let h=0;h<r;h++)i[h]=Math.max(t[o[h]]??0,c);let u=Array.from({length:r},(h,p)=>p).sort((h,p)=>i[h]-i[p]||h-p),m=0,f=r,d=h=>m<r&&(f>=h||i[u[m]]<=i[f])?u[m++]:f++;for(let h=r;h<a;h++){let p=d(h),b=d(h);i[h]=i[p]+i[b],l[p]=h,l[b]=h;}s[a-1]=0;let g=0;for(let h=a-2;h>=0;h--){let p=s[l[h]]+1;s[h]=p,h<r&&p>g&&(g=p);}if(g<=e){for(let h=0;h<r;h++)n[o[h]]=s[h];return n}}}function eg(t,e){let n=0;for(let o=0;o<e;o++)n=n<<1|t>>o&1;return n}function V0(t){let e=new Uint16Array(16),n=0;for(let l of t)l>0&&(e[l]=e[l]+1,n++);let o=new Uint16Array(16),r=0;for(let l=1;l<=15;l++)r=r+e[l-1]<<1,o[l]=r;let a=new Uint16Array(t.length),i=new Uint8Array(t.length);return t.forEach((l,s)=>{if(l===0)return;let c=o[l];o[l]=c+1,a[s]=eg(c,l),i[s]=n===1?0:l;}),{lengths:t,codes:a,emitted:i}}function rn(t,e,n){t.write(e.codes[n],e.emitted[n]);}function ng(t){let e=[],n=a=>e.push({code:a,extra:0,extraBits:0}),o=tg,r=0;for(;r<t.length;){let a=t[r],i=1;for(;r+i<t.length&&t[r+i]===a;)i++;r+=i;let l=i;if(a===0){for(;l>0;)if(l<3)for(;l>0;l--)n(0);else if(l<=10)e.push({code:17,extra:l-3,extraBits:3}),l=0;else {let s=Math.min(l,138);e.push({code:18,extra:s-11,extraBits:7}),l-=s;}continue}for(a!==o&&(n(a),o=a,l--);l>0;)if(l<3)for(;l>0;l--)n(a);else {let s=Math.min(l,6);e.push({code:16,extra:s-3,extraBits:2}),l-=s;}}return e}function rg(t,e){let n=[];if(e.forEach((l,s)=>{l>0&&n.push(s);}),n.length<=2&&n.every(l=>l<256)){let[l=0,s]=n;t.write(1,1),t.write(n.length===2?1:0,1),l<2?(t.write(0,1),t.write(l,1)):(t.write(1,1),t.write(l,8)),s!==void 0&&t.write(s,8);return}let o=ng(e),r=new Uint32Array(19);for(let l of o)r[l.code]=r[l.code]+1;let a=V0(W0(r,7)),i=fs.length;for(;i>4&&a.lengths[fs[i-1]]===0;)i--;t.write(0,1),t.write(i-4,4);for(let l=0;l<i;l++)t.write(a.lengths[fs[l]],3);t.write(0,1);for(let l of o)rn(t,a,l.code),t.write(l.extra,l.extraBits);}function ko(t){let e=t-1;if(e<4)return {symbol:e,extra:0,extraBits:0};let n=31-Math.clz32(e),o=e>>n-1&1,r=n-1;return {symbol:2*n+o,extra:e&(1<<r)-1,extraBits:r}}function Q0(t,e,n,o){let r=0;for(;r<o&&t[e+r]===t[e+r-n];)r++;return r}function U0(t,e,n){let o=t.length,r=0;for(;r<o;){let a=Math.min(4096,o-r),i=r>=1?Q0(t,r,1,a):0,l=r>=e?Q0(t,r,e,a):0;if(Math.max(i,l)>=3){l>=i?(n.copy(l,e===1?2:1),r+=l):(n.copy(i,2),r+=i);continue}n.literal(t[r]),r++;}}var H0=20;function z0(t,e,n){for(let o=0;o<n.length;o++)t[e+o]=n.charCodeAt(o);}function q0(t,e,n){t[e]=n&255,t[e+1]=n>>>8&255,t[e+2]=n>>>16&255,t[e+3]=n>>>24&255;}function gs(t,e,n){if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>16384||n>16384)throw new RangeError(`WebP images are 1 to 16384 pixels wide and high (got ${e} \xD7 ${n})`);let o=e*n;if(t.length<o*4)throw new RangeError(`Expected ${o*4} bytes of RGBA for ${e} \xD7 ${n}, got ${t.length}`);let r=new Uint32Array(o),a=false;for(let C=0;C<o;C++){let S=C*4,x=t[S],M=t[S+1],R=t[S+2],E=t[S+3];E!==255&&(a=true),r[C]=(E<<24|(x-M&255)<<16|M<<8|R-M&255)>>>0;}let i=new Uint32Array(280),l=new Uint32Array(256),s=new Uint32Array(256),c=new Uint32Array(256),u=new Uint32Array(40);U0(r,e,{literal(C){i[C>>>8&255]++,l[C>>>16&255]++,s[C&255]++,c[C>>>24]++;},copy(C,S){i[256+ko(C).symbol]++,u[ko(S).symbol]++;}});let m=[i,l,s,c,u].map(C=>W0(C,15)),[f,d,g,h,p]=m.map(V0),b=new hs(Math.ceil(o/4)+1024);b.write(47,8),b.write(e-1,14),b.write(n-1,14),b.write(a?1:0,1),b.write(0,3),b.write(1,1),b.write(2,2),b.write(0,1),b.write(0,1),b.write(0,1);for(let C of m)rg(b,C);U0(r,e,{literal(C){rn(b,f,C>>>8&255),rn(b,d,C>>>16&255),rn(b,g,C&255),rn(b,h,C>>>24);},copy(C,S){let x=ko(C);rn(b,f,256+x.symbol),b.write(x.extra,x.extraBits);let M=ko(S);rn(b,p,M.symbol),b.write(M.extra,M.extraBits);}});let y=b.finish(),_=y.length+(y.length&1),w=new Uint8Array(H0+_);return z0(w,0,"RIFF"),q0(w,4,w.length-8),z0(w,8,"WEBPVP8L"),q0(w,16,y.length),w.set(y,H0),w}function ps(t,e,n){return String.fromCharCode(...t.subarray(e,e+n))}function X0(t){return t.length>=12&&ps(t,0,4)==="RIFF"&&ps(t,8,4)==="WEBP"}function bs(t){if(!X0(t))return null;let e=12;for(;e+8<=t.length;){let n=ps(t,e,4);if(n==="VP8L")return "lossless";if(n==="VP8 ")return "lossy";let o=(t[e+4]|t[e+5]<<8|t[e+6]<<16|t[e+7]<<24)>>>0;e+=8+o+(o&1);}return null}function og(t,e,n){return typeof t.toBlob!="function"?Promise.resolve(null):new Promise(o=>{try{t.toBlob(o,e,n);}catch{o(null);}})}async function Fo(t,e={}){let n=e.quality!==void 0,o=n?Math.min(1,Math.max(0,Number(e.quality))):1,r=await og(t,"image/webp",o);if(r){let s=new Uint8Array(await r.arrayBuffer()),c=bs(s);if(c==="lossless"||n&&c==="lossy")return new Blob([s],{type:"image/webp"})}let a=t.getContext("2d");if(!a)throw new Error("Could not get canvas context");let{data:i}=a.getImageData(0,0,t.width,t.height),l=gs(i,t.width,t.height);return new Blob([l],{type:"image/webp"})}var j0=32768;async function Nt(t){let e=new Uint8Array(await t.arrayBuffer()),n="";for(let o=0;o<e.length;o+=j0)n+=String.fromCharCode(...e.subarray(o,o+j0));return `data:${t.type||"application/octet-stream"};base64,${btoa(n)}`}async function jt(t){let e={...t};if(t.imageSettings?.src)try{let u=await ag(t.imageSettings.src);e={...t,imageSettings:{...t.imageSettings,src:u}};}catch{let{imageSettings:u,...m}=t;e=m;}let{hideLogo:n,url:o,logo:r,scale:a,frameLabelMarkers:i,partMarkers:l,...s}=e,c=ds({...s,templateId:e.templateId,customTemplate:e.customTemplate});return `data:image/svg+xml,${encodeURIComponent(c)}`}var ag=t=>new Promise((e,n)=>{if(t.startsWith("data:")){e(t);return}let o=new Image;o.crossOrigin="anonymous",o.onload=()=>{try{let r=document.createElement("canvas");r.width=o.naturalWidth||o.width,r.height=o.naturalHeight||o.height;let a=r.getContext("2d");if(!a){n(new Error("Could not get canvas context"));return}a.drawImage(o,0,0);let i=r.toDataURL("image/png");r.remove(),e(i);}catch(r){n(new Error(`Failed to convert image to base64: ${r}`));}},o.onerror=()=>{n(new Error(`Could not load image from ${t.slice(0,100)}... Check CORS settings or use a data URL.`));},o.src=t;});async function pe(t,e,n){let o=await jt(t),r=decodeURIComponent(o.replace("data:image/svg+xml,","")),a;try{let i=new TextEncoder().encode(r),l=Array.from(i,c=>String.fromCharCode(c)).join("");a=`data:image/svg+xml;base64,${btoa(l)}`;}catch(i){throw new Error(`Failed to encode SVG for canvas conversion: ${i}`)}return new Promise((i,l)=>{let s=document.createElement("canvas"),c=s.getContext("2d");if(!c){l(new Error("Could not get canvas context"));return}let u=new Image,{width:m,height:f}=ue(t.size||it,t.frame);s.width=Math.round(m),s.height=Math.round(f);let d=setTimeout(()=>{s.remove(),l(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);u.onload=()=>{clearTimeout(d);try{if(e==="image/jpeg"&&(c.fillStyle="white",c.fillRect(0,0,s.width,s.height)),c.drawImage(u,0,0,s.width,s.height),n)i(s);else if(e==="image/webp")Fo(s).then(Nt).then(i,l).finally(()=>s.remove());else if(e==="image/bmp")Nt(Ro(s)).then(i,l).finally(()=>s.remove());else if(e===Mr)vo(s,t.value).then(Nt).then(i,l).finally(()=>s.remove());else if(e===en||e==="image/x-icon")Nt(T0(s)).then(i,l).finally(()=>s.remove());else {let g=s.toDataURL(e,1);s.remove(),i(g);}}catch(g){clearTimeout(d),s.remove(),l(new Error(`Failed to draw SVG to canvas: ${g}`));}},u.onerror=()=>{clearTimeout(d),s.remove(),l(new Error("Could not load SVG"));},u.src=a;})}var Z0=["gradientUnits","gradientTransform","spreadMethod"],ig={linear:["x1","y1","x2","y2"],radial:["cx","cy","r","fx","fy","fr"]},sg={r:0,g:0,b:0,a:1};function Y0(t,e){for(let n of (t.attrs.style??"").split(";")){let[o,...r]=n.split(":");if(o?.trim()===e)return r.join(":").trim()}return t.attrs[e]}function ys(t){return t.name==="linearGradient"?"linear":t.name==="radialGradient"?"radial":null}function lg(t){let e=[],n=0;for(let o of t.children){if(o.name!=="stop")continue;let r=(o.attrs.offset??"0").trim(),a=Number.parseFloat(r),i=Number.isFinite(a)?r.endsWith("%")?a/100:a:0;n=Math.max(n,Math.min(Math.max(i,0),1));let l=Y0(o,"stop-color")??"#000000",s=lt(l==="currentColor"?"#000000":l)??sg,c=Number.parseFloat(Y0(o,"stop-opacity")??"1");e.push({offset:n,color:Number.isFinite(c)?{...s,a:s.a*Math.min(Math.max(c,0),1)}:s});}return e}function To(t){let e=new Map,n=r=>{let a=r.attrs.id;ys(r)&&a&&!e.has(a)&&e.set(a,r);for(let i of r.children)n(i);};n(t);let o=new Map;for(let[r,a]of e){let i=ys(a),l={},s=[],c=new Set,u=a;for(;u&&!c.has(u);){c.add(u);let m=ys(u)===i?[...Z0,...ig[i]]:Z0;for(let d of m){let g=u.attrs[d];l[d]===void 0&&g!==void 0&&(l[d]=g);}s.length===0&&(s=lg(u));let f=u.attrs.href??u.attrs["xlink:href"];u=f?.startsWith("#")?e.get(f.slice(1)):void 0;}o.set(r,{kind:i,attrs:l,stops:s});}return o}function _s(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(m,f)=>{e=Math.min(e,m),o=Math.max(o,m),n=Math.min(n,f),r=Math.max(r,f);},i=(m,f,d,g)=>{let h=-m+3*f-3*d+g,p=2*(m-2*f+d),b=f-m;if(Math.abs(h)<1e-12)return Math.abs(p)<1e-12?[]:[-b/p];let y=p*p-4*h*b;if(y<0)return [];let _=Math.sqrt(y);return [(-p+_)/(2*h),(-p-_)/(2*h)]},l=(m,f,d,g,h)=>{let p=1-m;return p*p*p*f+3*p*p*m*d+3*p*m*m*g+m**3*h},s=0,c=0,u=[0,0];for(let m of t)if(m.op==="M"&&(u=[m.x,m.y]),m.op==="M"||m.op==="L")a(m.x,m.y),s=m.x,c=m.y;else if(m.op==="C"){a(m.x,m.y);for(let f of [...i(s,m.x1,m.x2,m.x),...i(c,m.y1,m.y2,m.y)])f>0&&f<1&&a(l(f,s,m.x1,m.x2,m.x),l(f,c,m.y1,m.y2,m.y));s=m.x,c=m.y;}else [s,c]=u;return Number.isFinite(e)?{x:e,y:n,width:o-e,height:r-n}:null}var cg=t=>t[0]*t[3]-t[1]*t[2];function Pe(t){let e=cg(t);if(!Number.isFinite(e)||Math.abs(e)<1e-12)return null;let[n,o,r,a,i,l]=t;return [a/e,-o/e,-r/e,n/e,(r*l-a*i)/e,(o*i-n*l)/e]}function J0(t,e,n){let{kind:o,attrs:r,stops:a}=t,i=a[0],l=a.at(-1);if(!(i&&l)||a.every(S=>S.color.a===0))return null;if(a.length===1)return i.color;let s=r.gradientUnits==="userSpaceOnUse",c=Sn;if(!s){let S=_s(e);if(!S||S.width<=0||S.height<=0)return null;c=[S.width,0,0,S.height,S.x,S.y];}let u=ct(c,Ut(r.gradientTransform));if(!Pe(u))return l.color;let[m,f]=n,d=Math.sqrt((m*m+f*f)/2),g=(S,x)=>{let M=Number.parseFloat(S);return Number.isFinite(M)?S.trim().endsWith("%")?M/100*(s?x:1):M:null},h=(S,x,M)=>g(r[S]??x,M)??g(x,M)??0;if(o==="linear"){let S=[h("x1","0%",m),h("y1","0%",f),h("x2","100%",m),h("y2","0%",f)],[x,M,R,E]=S;return x===R&&M===E?l.color:{kind:o,coords:S,matrix:u,stops:a}}let p=h("cx","50%",m),b=h("cy","50%",f),y=h("r","50%",d),_=r.fx===void 0?p:h("fx","50%",m),w=r.fy===void 0?b:h("fy","50%",f),C=Math.max(0,h("fr","0%",d));return y<0?null:y===0?l.color:{kind:o,coords:[_,w,C,p,b,y],matrix:u,stops:a}}function No(t){return t.map(e=>$(e,6)).join(" ")}function ug(t,e){return (e==="cmyk"?we(t.r,t.g,t.b):[t.r/255,t.g/255,t.b/255]).map(o=>$(o,4)).join(" ")}var K0=(t,e)=>`<< /FunctionType 2 /Domain [0 1] /C0 [${t}] /C1 [${e}] /N 1 >>`;function mg(t,e){let n=[],o=t.map(l=>K(l.offset,4)),r=t.map(l=>ug(l.color,e)),a=o[0],i=o.at(-1);if(a>0){let l=r[0];n.push({from:0,to:a,c0:l,c1:l});}for(let l=0;l+1<t.length;l++){let s=o[l],c=o[l+1];c>s&&n.push({from:s,to:c,c0:r[l],c1:r[l+1]});}if(i<1){let l=r.at(-1);n.push({from:i,to:1,c0:l,c1:l});}if(n.length===1){let[l]=n;return K0(l.c0,l.c1)}return ["<< /FunctionType 3 /Domain [0 1]",`/Functions [${n.map(l=>K0(l.c0,l.c1)).join(" ")}]`,`/Bounds [${n.slice(1).map(l=>$(l.from,4)).join(" ")}]`,`/Encode [${n.map(()=>"0 1").join(" ")}] >>`].join(" ")}function Oo(t,e){return [`<< /ShadingType ${t.kind==="linear"?2:3}`,`/ColorSpace /Device${e==="cmyk"?"CMYK":"RGB"}`,`/Coords [${t.coords.map(n=>$(n,6)).join(" ")}]`,`/Function ${mg(t.stops,e)}`,"/Extend [true true] >>"].join(" ")}function dg(t,e){if(t.op==="Z")return t;if(t.op==="C"){let[r,a]=V(e,t.x1,t.y1),[i,l]=V(e,t.x2,t.y2),[s,c]=V(e,t.x,t.y);return {op:"C",x1:r,y1:a,x2:i,y2:l,x:s,y:c}}let[n,o]=V(e,t.x,t.y);return {op:t.op,x:n,y:o}}function Bo(t){let e={round:1,bevel:2}[t.strokeLinejoin?.trim()??""],n={round:1,square:2}[t.strokeLinecap?.trim()??""];return {join:e??0,cap:n??0}}var tm={r:255,g:255,b:255,a:1},fg=/^url\(\s*#bg-color-/,Do=/^url\(\s*#([^)\s]+)\s*\)/,hg=new Set(["defs","clipPath","mask","pattern","linearGradient","radialGradient","symbol","title","desc","metadata","style","script","use","foreignObject"]);function j(t,e){let n=t.attrs.style;if(n)for(let o of n.split(";")){let[r,...a]=o.split(":");if(r?.trim()===e)return a.join(":").trim()}return t.attrs[e]}function X(t,e,n=0){if(t===void 0||t==="")return n;let o=Number.parseFloat(t);return Number.isNaN(o)?n:t.trim().endsWith("%")?o/100*e:o}function Pr(t,e){if((t.name==="linearGradient"||t.name==="radialGradient")&&t.attrs.id){let n=t.children.find(r=>r.name==="stop"),o=n&&(j(n,"stop-color")??"#000000");o&&e.set(t.attrs.id,o);}for(let n of t.children)Pr(n,e);return e}function vr(t,e){if(t.name==="image"){let n=t.attrs.href??t.attrs["xlink:href"];n&&e.add(n);}for(let n of t.children)vr(n,e);return e}function Go(t){return /^data:image\/png[;,]/i.test(t)?"PNG":/^data:image\/jpe?g[;,]/i.test(t)?"JPEG":null}async function Qo(t){return typeof document>"u"||typeof Image>"u"?null:await new Promise(e=>{let n=new Image;n.crossOrigin="anonymous",n.onload=()=>{let o=document.createElement("canvas"),r=Math.max(n.naturalWidth||512,n.naturalHeight||512),a=Math.min(1024/r,4);o.width=Math.round((n.naturalWidth||512)*a),o.height=Math.round((n.naturalHeight||512)*a);let i=o.getContext("2d");if(!i){e(null);return}i.drawImage(n,0,0,o.width,o.height);try{e(o.toDataURL("image/png"));}catch{e(null);}},n.onerror=()=>e(null),n.src=t;})}function em(t,e,n){let o={x:X(t.attrs.x,e[0]),y:X(t.attrs.y,e[1]),width:X(t.attrs.width,e[0]),height:X(t.attrs.height,e[1])};if(o.width<=0||o.height<=0)return null;let r=(t.attrs.preserveAspectRatio??"").trim();if(!r||r.startsWith("none")||!n||!(n.width>0&&n.height>0))return {draw:o,clip:null};let[a="xMidYMid",i="meet"]=r.split(/\s+/),l=i==="slice",s=(l?Math.max:Math.min)(o.width/n.width,o.height/n.height),c=n.width*s,u=n.height*s,m=f=>{let d=f==="x"?a.slice(0,4):a.slice(4);return d.endsWith("Min")?0:d.endsWith("Max")?1:.5};return {draw:{x:o.x+(o.width-c)*m("x"),y:o.y+(o.height-u)*m("y"),width:c,height:u},clip:l?o:null}}function nm(t,e){t.name==="clipPath"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)nm(n,e);return e}function rm(t,e){t.name==="pattern"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)rm(n,e);return e}function pg(t,e){let[n,o]=e,r=(a,i)=>X(t.attrs[a],i);switch(t.name){case "path":return se(t.attrs.d??"");case "rect":{let a=t.attrs.rx??t.attrs.ry,i=t.attrs.ry??t.attrs.rx;return ee(r("x",n),r("y",o),r("width",n),r("height",o),X(a,n),X(i,o))}case "circle":{let a=r("r",Math.hypot(n,o)/Math.SQRT2);return te(r("cx",n),r("cy",o),a,a)}case "ellipse":return te(r("cx",n),r("cy",o),r("rx",n),r("ry",o));default:return []}}var zn=class{gradients;shadings;clipPaths=new Map;patterns=new Map;backdrop=tm;paper=tm;background=null;onPaper=false;inConic=false;constructor(e,n=null){this.gradients=e,this.shadings=n;}resolveColor(e){if(!e||e==="none")return null;let n=Do.exec(e);if(n)return this.resolveColor(this.gradients.get(n[1]));let o=lt(e==="currentColor"?"#000000":e);return o&&o.a>0?o:null}shadedGradient(e){let n=e?Do.exec(e)?.[1]:void 0;return n?this.shadings?.get(n):void 0}resolveFill(e,n,o,r=1){if(r<=0)return null;let a=this.patternOf(e);if(a)return {pattern:a,alpha:r};let i=this.shadedGradient(e);if(i){let c=J0(i,n,o);if(!c)return null;if("coords"in c)return {gradient:c,alpha:r};let u={...c,a:c.a*r};return u.a>0?{color:u}:null}let l=this.resolveColor(e);if(!l)return null;let s={...l,a:l.a*r};return s.a>0?{color:s}:null}patternOf(e){let n=e?Do.exec(e)?.[1]:void 0,o=n?this.patterns.get(n):void 0;if(!(o?.attrs.patternUnits!=="userSpaceOnUse"||(o.attrs.patternContentUnits??"userSpaceOnUse")!=="userSpaceOnUse"||o.attrs.viewBox))return o}flatten(e){if(e.a>=1)return e;let n=this.background,o=n!==null&&Math.abs(n.r-e.r)<.5&&Math.abs(n.g-e.g)<.5&&Math.abs(n.b-e.b)<.5&&Math.abs(n.a-e.a)<.002;return $o(e,this.onPaper||o?this.paper:this.backdrop)}paintPattern(e,n,o,r){let a=_s(e);if(!a||a.width<=0||a.height<=0)return true;let[i,l]=n.viewport,s=X(o.attrs.x,i),c=X(o.attrs.y,l),u=X(o.attrs.width,i),m=X(o.attrs.height,l);if(!(u>0&&m>0))return true;let f=Ut(o.attrs.patternTransform),d=Pe(f);if(!d)return true;if(!this.beginClip(e,n.matrix,n.fillRule==="evenodd"))return false;let g=this.inConic;this.inConic=o.attrs["data-qrdx-conic"]!==void 0;try{let h=[V(d,a.x,a.y),V(d,a.x+a.width,a.y),V(d,a.x,a.y+a.height),V(d,a.x+a.width,a.y+a.height)],p=h.map(([L])=>L),b=h.map(([,L])=>L),y=Math.min(...p),_=Math.max(...p),w=Math.min(...b),C=Math.max(...b),S=Math.floor((y-s)/u),x=Math.ceil((_-s)/u)-1,M=Math.floor((w-c)/m),R=Math.ceil((C-c)/m)-1,E=(x-S+1)*(R-M+1);if(E>4096)return !0;let v=(o.attrs["data-qrdx-conic"]??"").trim().split(/\s+/).map(Number),I=ct(n.matrix,f);for(let L=M;L<=R;L++)for(let T=S;T<=x;T++){let F=s+T*u,k=c+L*m,q=ct(I,[1,0,0,1,F,k]),H={x:y-F,y:w-k,width:_-y,height:C-w},G=v.length===2&&v.every(Number.isFinite)?u0(v[0],v[1],H):null,U=E>1&&this.beginClip([{op:"M",x:0,y:0},{op:"L",x:u,y:0},{op:"L",x:u,y:m},{op:"L",x:0,y:m},{op:"Z"}],q,!1);try{let Z={matrix:q,viewport:n.viewport,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start",fillOpacity:1,opacity:r},rt=(W,O)=>{for(let N of W){if(N.name==="g"&&!N.attrs.transform){let _t=Number.parseFloat(N.attrs.opacity??"1");rt(N.children,{...O,opacity:(O.opacity??1)*(Number.isFinite(_t)?_t:1)});continue}if(G&&N.attrs["data-arc"]){let[_t,At]=N.attrs["data-arc"].split(/\s+/).map(Number);if(!m0([_t,_t+At],G))continue}this.walk(N,O);}};rt(o.children,Z);}finally{U&&this.endClip();}}}finally{this.inConic=g,this.endClip();}return true}paintBleed(e,n,o,r){if(!this.shadedGradient(o))return false;let[a,i]=this.viewportMatrix({...e,attrs:{...e.attrs,x:"0",y:"0"}},{...n,matrix:ct(n.matrix,Ut(e.attrs.transform))}),l=Pe(a);if(!l)return false;let[s,c,u,m]=r,d=[[s,c],[u,c],[u,m],[s,m]].map(([g,h])=>V(l,g,h)).map(([g,h],p)=>({op:p===0?"M":"L",x:g,y:h}));return d.push({op:"Z"}),this.paint(d,{name:"rect",attrs:{},children:[],text:""},{...n,matrix:a,viewport:i,fill:o,fillRule:"nonzero",stroke:"none"}),true}beginClip(e,n,o){return false}endClip(){}clipOf(e,n){let o=j(e,"clip-path"),r=o?Do.exec(o)?.[1]:void 0,a=r?this.clipPaths.get(r):void 0;if(!a)return null;let i=[],l=false;for(let s of a.children){let c=pg(s,n.viewport);if(c.length===0)continue;let u=Ut(s.attrs.transform),m=u[0]===1&&u[1]===0&&u[2]===0&&u[3]===1&&u[4]===0&&u[5]===0;i.push(...m?c:c.map(f=>dg(f,u))),l||=j(s,"clip-rule")==="evenodd";}return i.length>0?{segments:i,matrix:n.matrix,evenOdd:l}:null}viewportMatrix(e,n){let o=X(e.attrs.x,n.viewport[0]),r=X(e.attrs.y,n.viewport[1]),a=X(e.attrs.width,n.viewport[0],n.viewport[0]),i=X(e.attrs.height,n.viewport[1],n.viewport[1]),l=Jt(e.attrs.viewBox);if(l.length!==4||!(l[2]&&l[3]))return [ct(n.matrix,[1,0,0,1,o,r]),[a,i]];let[s,c,u,m]=l,f=a/u,d=i/m,g=o,h=r;if((e.attrs.preserveAspectRatio??"").trim()!=="none"){let p=e.attrs.preserveAspectRatio?.includes("slice")?Math.max(f,d):Math.min(f,d);g+=(a-u*p)/2,h+=(i-m*p)/2,f=p,d=p;}return [ct(n.matrix,[f,0,0,d,g-s*f,h-c*d]),[u,m]]}walk(e,n,o=false){if(o&&(this.clipPaths=nm(e,new Map),this.patterns=rm(e,new Map)),hg.has(e.name)||j(e,"display")==="none"||j(e,"visibility")==="hidden")return;let r=ct(n.matrix,Ut(e.attrs.transform)),a=n.viewport;if(e.name==="svg"){let[f,d]=this.viewportMatrix(o?{...e,attrs:{...e.attrs,x:"0",y:"0"}}:e,{...n,matrix:r});r=f,a=d;}let i=j(e,"font-size"),l=Number.parseFloat(j(e,"opacity")??"1"),s=j(e,"fill-opacity"),c=s===void 0?n.fillOpacity??1:Number.parseFloat(s),u={fillOpacity:Number.isFinite(c)?Math.min(Math.max(c,0),1):1,opacity:(n.opacity??1)*(Number.isFinite(l)?Math.min(Math.max(l,0),1):1),matrix:r,viewport:a,fill:j(e,"fill")??n.fill,fillRule:j(e,"fill-rule")??n.fillRule,stroke:j(e,"stroke")??n.stroke,strokeWidth:j(e,"stroke-width")===void 0?n.strokeWidth:X(j(e,"stroke-width"),a[0],1),strokeLinejoin:j(e,"stroke-linejoin")??n.strokeLinejoin,strokeLinecap:j(e,"stroke-linecap")??n.strokeLinecap,fontSize:i===void 0?n.fontSize:X(i,16,16),fontWeight:j(e,"font-weight")??n.fontWeight,textAnchor:j(e,"text-anchor")??n.textAnchor},m=this.onPaper;(e.name==="rect"||e.name==="circle"||e.name==="path")&&fg.test(j(e,"fill")??"")&&(this.onPaper=true);try{let f=e.attrs["clip-path"]?this.clipOf(e,u):null;if(f&&this.beginClip(f.segments,f.matrix,f.evenOdd)){try{this.paintNode(e,u);}finally{this.endClip();}return}this.paintNode(e,u);}finally{this.onPaper=m;}}paintNode(e,n){let[o,r]=n.viewport,a=(i,l)=>X(e.attrs[i],l);switch(e.name){case "path":this.paint(se(e.attrs.d??""),e,n);return;case "rect":{let i=e.attrs.rx??e.attrs.ry,l=e.attrs.ry??e.attrs.rx;this.paint(ee(a("x",o),a("y",r),a("width",o),a("height",r),X(i,o),X(l,r)),e,n);return}case "circle":{let i=a("r",Math.hypot(o,r)/Math.SQRT2);this.paint(te(a("cx",o),a("cy",r),i,i),e,n);return}case "ellipse":this.paint(te(a("cx",o),a("cy",r),a("rx",o),a("ry",r)),e,n);return;case "line":this.paint([{op:"M",x:a("x1",o),y:a("y1",r)},{op:"L",x:a("x2",o),y:a("y2",r)}],e,{...n,fill:"none"});return;case "polygon":case "polyline":{let i=Jt(e.attrs.points),l=[];for(let s=0;s+1<i.length;s+=2)l.push({op:s===0?"M":"L",x:i[s],y:i[s+1]});e.name==="polygon"&&l.length>0&&l.push({op:"Z"}),this.paint(l,e,n);return}case "text":this.text(e,n);return;case "image":this.image(e,n);return;default:for(let i of e.children)this.walk(i,n);}}};var Uo=1e3;async function Ir(t){let e=await jt(ve({...t,size:t.size??it},Uo));return decodeURIComponent(e.replace("data:image/svg+xml,",""))}function xs(t){if(Tt(t.frame)){let e=We(Uo,t.frame);return e.squareEdges?e.color:null}if(t.backdrop&&t.bgRadius){let e=ut.QrCode.encodeText(t.value,$t[Et(t)]).size,n=Rt(e,t.margin??ft,t.shape);if(Nn(t.bgRadius,e,n,t.shape)>0)return bt(t.backdrop,mt)}return bt(t.bgColor,mt)}function Ho(t,e){let n=xs(t);if(!(n&&je(t.bgColor))||Tt(t.frame)||t.templateId||t.customTemplate)return n;let o=xe(e)?.children.find(a=>a.name==="rect"),r=o&&j(o,"fill");return r?.startsWith("url(")?r:n}function zo(t,e){let n={r:255,g:255,b:255,a:1},o=lt(bt(e.bgColor,mt));t.paper=n,t.background=o&&!je(e.bgColor)?o:null,t.backdrop=o?$o(o,n):n;}var qo=25.4,om=5,am=2e3,ge=Uo,$s=5,im=2,bg=.25*(qo/72);function yg(t,e="mm"){return e==="in"?t*qo:t}function _g(t){let e=Et(t),n=ut.QrCode.encodeText(t.value,$t[e]).size;return n+Rt(n,t.margin??ft,t.shape)*2}function Wo(t,e){let n=yg(e.size,e.unit);if(!Number.isFinite(n)||n<om||n>am)throw new Error(`Print size must be between ${om} mm and ${am/1e3} m`);let o=Math.min(Math.max(e.bleed??0,0),20),r=n/ge,a=Tt(t.frame)?We(ge,t.frame):null,i=(a?.width??ge)*r,l=(a?.height??ge)*r,s=e.cropMarks?o+im+$s+1:o,c=_g(t);return {codeWidth:n,trimWidth:i,trimHeight:l,bleed:o,pageWidth:i+2*s,pageHeight:l+2*s,trimX:s,trimY:s,moduleSize:n/c,moduleCount:c,maxScanDistance:n*10}}var Ss=class t{pdf;internals;names=new Map;constructor(e,n){this.pdf=e,this.internals=n;}static attach(e){let n=e.internal;return typeof e.advancedAPI!="function"||typeof e.addShadingPattern!="function"||typeof n.write!="function"||typeof n.events?.subscribe!="function"?null:new t(e,n)}name(e){let n=this.names.get(e);return n||(this.names.size===0&&this.install(),n=`Sh${this.names.size}`,this.names.set(e,n)),n}install(){this.pdf.advancedAPI(e=>{e.addShadingPattern("qrdx-shadings",{});}),this.internals.events.subscribe("putShadingPatternDict",()=>{for(let[e,n]of this.names)this.internals.write(`/${n} ${e}`);});}},ws=class extends zn{pdf;cmyk;images;shadingResources;constructor(e,n,o,r,a){super(o,r?.gradients??null),this.pdf=e,this.cmyk=n,this.images=a,this.shadingResources=r?.resources??null;}setColor(e,n){let o=e==="fill"?this.pdf.setFillColor.bind(this.pdf):e==="draw"?this.pdf.setDrawColor.bind(this.pdf):this.pdf.setTextColor.bind(this.pdf);if(this.cmyk){let[r,a,i,l]=we(n.r,n.g,n.b);o(r,a,i,l);}else o(Math.round(n.r),Math.round(n.g),Math.round(n.b));}setRegistrationColor(){this.cmyk?this.pdf.setDrawColor(1,1,1,1):this.pdf.setDrawColor(0,0,0);}tracePath(e,n){let o=false;for(let r of e)if(r.op==="M"){let[a,i]=V(n,r.x,r.y);this.pdf.moveTo(a,i),o=true;}else if(r.op==="L"){let[a,i]=V(n,r.x,r.y);o?this.pdf.lineTo(a,i):(this.pdf.moveTo(a,i),o=true);}else if(r.op==="C"){let[a,i]=V(n,r.x1,r.y1),[l,s]=V(n,r.x2,r.y2),[c,u]=V(n,r.x,r.y);this.pdf.curveTo(a,i,l,s,c,u);}else o&&this.pdf.close();}shade(e,n,o){let r=this.pdf.internal,a=r.scaleFactor,i=[a,0,0,-a,0,r.pageSize.getHeight()*a],l=ct(i,ct(n.matrix,o.matrix));if(!(this.shadingResources&&Pe(l)))return;let s=this.shadingResources.name(Oo(o,this.cmyk?"cmyk":"rgb"));this.pdf.saveGraphicsState(),this.tracePath(e,n.matrix),this.pdf.clip(n.fillRule==="evenodd"?"evenodd":void 0),this.pdf.discardPath(),r.write(`${No(l)} cm /${s} sh`),this.pdf.restoreGraphicsState();}beginClip(e,n,o){return this.pdf.saveGraphicsState(),this.tracePath(e,n),this.pdf.clip(o?"evenodd":void 0),this.pdf.discardPath(),true}endClip(){this.pdf.restoreGraphicsState();}withAlpha(e,n,o){if(e>=1&&n>=1){o();return}this.pdf.saveGraphicsState();let r=this.pdf.GState;this.pdf.setGState(new r({opacity:e,"stroke-opacity":n}));try{o();}finally{this.pdf.restoreGraphicsState();}}opaqueGradient(e,n){let o=e.stops[0]?.color.a??1;return e.stops.every(a=>Math.abs(a.color.a-o)<.002)?{gradient:{...e,stops:e.stops.map(a=>({...a,color:{...a.color,a:1}}))},alpha:o*n}:{gradient:{...e,stops:e.stops.map(a=>({...a,color:this.flatten({...a.color,a:a.color.a*n})}))},alpha:1}}paint(e,n,o){if(e.length===0)return;let r=o.opacity??1;if(r<=0)return;let a=this.resolveFill(o.fill,e,o.viewport,(o.fillOpacity??1)*r);if(a&&"pattern"in a)this.paintPattern(e,o,a.pattern,a.alpha);else if(a&&"gradient"in a){let{gradient:m,alpha:f}=this.opaqueGradient(a.gradient,a.alpha);this.withAlpha(f,1,()=>this.shade(e,o,m));}let i=a&&"color"in a?a.color:null,l=i&&this.inConic?this.flatten(i):i,s=o.strokeWidth>0?this.resolveColor(o.stroke):null,c=s&&{...s,a:s.a*r};if(!(l||c))return;let u=o.fillRule==="evenodd";this.withAlpha(l?.a??1,c?.a??1,()=>{l&&this.setColor("fill",l);let m=c?Bo(o):{join:0,cap:0};c&&(this.setColor("draw",c),this.pdf.setLineWidth(o.strokeWidth*wn(o.matrix)),(m.join||m.cap)&&(this.pdf.setLineJoin(m.join),this.pdf.setLineCap(m.cap))),this.tracePath(e,o.matrix),l&&c?u?this.pdf.fillStrokeEvenOdd():this.pdf.fillStroke():l?u?this.pdf.fillEvenOdd():this.pdf.fill():this.pdf.stroke(),(m.join||m.cap)&&(this.pdf.setLineJoin(0),this.pdf.setLineCap(0));});}text(e,n){let o=e.text.replace(/\s+/g," ").trim(),r=this.resolveColor(n.fill);if(!(o&&r))return;let a=wn(n.matrix),[i,l]=V(n.matrix,X(e.attrs.x,n.viewport[0]),X(e.attrs.y,n.viewport[1])),s=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600;this.pdf.setFont("helvetica",s?"bold":"normal");let c=n.fontSize*a*(72/qo);this.pdf.setFontSize(c);let u=Number.parseFloat(e.attrs["data-max-width"]??"");if(u>0){let d=u*a,g=this.pdf.getTextWidth(o);g>d&&(c*=d/g,this.pdf.setFontSize(c));}this.setColor("text",r);let m=Math.atan2(n.matrix[1],n.matrix[0]);if(Math.abs(m)>2e-4){let d=n.textAnchor==="middle"?this.pdf.getTextWidth(o)/2:n.textAnchor==="end"?this.pdf.getTextWidth(o):0;this.pdf.text(o,i-d*Math.cos(m),l-d*Math.sin(m),{angle:-m*180/Math.PI,baseline:"alphabetic"});return}let f=n.textAnchor==="middle"?"center":n.textAnchor==="end"?"right":"left";this.pdf.text(o,i,l,{align:f,baseline:"alphabetic"});}aliases=new Map;image(e,n){let o=e.attrs.href??e.attrs["xlink:href"],r=o&&(Go(o)?o:this.images.get(o)),a=r&&Go(r);if(!(r&&a))return;let i=this.aliases.get(r);i||(i=`qrdx-image-${this.aliases.size}`,this.aliases.set(r,i));let l=null;if(e.attrs.preserveAspectRatio)try{let p=this.pdf.getImageProperties(r);l={width:p.width,height:p.height};}catch{l=null;}let s=em(e,n.viewport,l);if(!s)return;let{draw:c,clip:u}=s,[m,f]=V(n.matrix,c.x,c.y),[d,g]=V(n.matrix,c.x+c.width,c.y+c.height),h=u!==null&&this.beginClip([{op:"M",x:u.x,y:u.y},{op:"L",x:u.x+u.width,y:u.y},{op:"L",x:u.x+u.width,y:u.y+u.height},{op:"L",x:u.x,y:u.y+u.height},{op:"Z"}],n.matrix,false);try{this.withAlpha(n.opacity??1,1,()=>{this.pdf.addImage(r,a,Math.min(m,d),Math.min(f,g),Math.abs(d-m),Math.abs(g-f),i);});}finally{h&&this.endClip();}}};function xg(t,e,n){let{trimX:o,trimY:r,trimWidth:a,trimHeight:i,bleed:l}=n,s=l+im,c=o,u=o+a,m=r,f=r+i;e.setRegistrationColor(),t.setLineWidth(bg);for(let d of [c,u]){let g=d===c?-1:1;for(let h of [m,f]){let p=h===m?-1:1;t.line(d+g*s,h,d+g*(s+$s),h),t.line(d,h+p*s,d,h+p*(s+$s));}}}async function $g(t,e){return (await sm(t,e)).output("dataurlstring")}async function Wx(t,e){return (await sm(t,e)).output("arraybuffer")}async function sm(t,e){let n=Wo(t,e),o;try{({jsPDF:o}=await import('jspdf'));}catch(b){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${b})`)}let r=await Ir(t),a=xe(r);if(!a)throw new Error("Failed to render the QR code for printing");let i=new Map;for(let b of vr(a,new Set))if(!Go(b)){let y=await Qo(b);y&&i.set(b,y);}let l=new o({orientation:n.pageWidth>n.pageHeight?"landscape":"portrait",unit:"mm",format:[n.pageWidth,n.pageHeight],compress:true,floatPrecision:3});l.setProperties({title:"QR code",creator:"qrdx"});let s=To(a),c=s.size>0?Ss.attach(l):null,u=new ws(l,e.colorMode==="cmyk",Pr(a,new Map),c?{gradients:s,resources:c}:null,i);zo(u,t);let m=n.codeWidth/ge,f=X(a.attrs.width,ge,ge),d=X(a.attrs.height,ge,ge),g={matrix:ct([1,0,0,1,n.trimX,n.trimY],[m,0,0,m,0,0]),viewport:[f,d],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},h=n.bleed>0?Ho(t,r):null,p=[n.trimX-n.bleed,n.trimY-n.bleed,n.trimX+n.trimWidth+n.bleed,n.trimY+n.trimHeight+n.bleed];if(!(h&&u.paintBleed(a,g,h,p))){let b=h?u.resolveColor(h):null;b&&(u.setColor("fill",b),l.rect(n.trimX-n.bleed,n.trimY-n.bleed,n.trimWidth+2*n.bleed,n.trimHeight+2*n.bleed,"F"));}return u.walk(a,g,true),e.cropMarks&&xg(l,u,n),l}async function Sg(t,e){let n=Wo(t,{size:e.size,unit:e.unit}),o=await Ir(t),r=e.unit??"mm",a=s=>`${$(r==="in"?s/qo:s)}${r}`,i=/^<svg\b[^>]*>/.exec(o)?.[0];if(!i)throw new Error("Failed to render the QR code for printing");return `<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
${i.replace(/\swidth="[^"]*"/,` width="${a(n.trimWidth)}"`).replace(/\sheight="[^"]*"/,` height="${a(n.trimHeight)}"`)}${o.slice(i.length)}`}async function Vx(t,e){let n=await $g(t,e);Bt(n,e.filename??"qr-code-print.pdf");}async function Xx(t,e){let n=await Sg(t,e);Bt(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`,e.filename??"qr-code-print.svg");}var wg=[137,80,78,71,13,10,26,10];async function cm(t,e){let n=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(n).arrayBuffer())}async function um(t){return typeof CompressionStream>"u"?null:await cm(t,new CompressionStream("deflate"))}async function Cg(t){if(typeof DecompressionStream>"u")return null;try{return await cm(t,new DecompressionStream("deflate"))}catch{return null}}var Cs=(t,e)=>t[e]*2**24+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3]>>>0,lm={0:1,2:3,3:1,4:2,6:4};function Mg(t,e,n){let o=t+e-n,r=Math.abs(o-t),a=Math.abs(o-e),i=Math.abs(o-n);return r<=a&&r<=i?t:a<=i?e:n}async function Ms(t){if(wg.some((h,p)=>t[p]!==h))return null;let e=8,n=0,o=0,r=-1,a=null,i=null,l=[];for(;e+8<=t.length;){let h=Cs(t,e),p=String.fromCharCode(...t.subarray(e+4,e+8)),b=t.subarray(e+8,e+8+h);if(e+=12+h,p==="IHDR"){n=Cs(b,0),o=Cs(b,4);let y=b[8];r=b[9];let _=b[12];if(y!==8||_!==0||!(r in lm))return null}else if(p==="PLTE")a=b;else if(p==="tRNS")i=b;else if(p==="IDAT")l.push(b);else if(p==="IEND")break}if(!(n&&o)||n*o>4096*4096)return null;let s=new Uint8Array(l.reduce((h,p)=>h+p.length,0)),c=0;for(let h of l)s.set(h,c),c+=h.length;let u=await Cg(s),m=lm[r],f=n*m;if(!u||u.length<o*(f+1))return null;let d=new Uint8Array(o*f);for(let h=0;h<o;h++){let p=u[h*(f+1)],b=u.subarray(h*(f+1)+1,(h+1)*(f+1)),y=h*f;for(let _=0;_<f;_++){let w=_>=m?d[y+_-m]:0,C=h>0?d[y-f+_]:0,S=h>0&&_>=m?d[y-f+_-m]:0,x=b[_],M=0;p===1?M=w:p===2?M=C:p===3?M=w+C>>1:p===4&&(M=Mg(w,C,S)),d[y+_]=x+M&255;}}let g=new Uint8Array(n*o*4);for(let h=0;h<n*o;h++){let p=h*4,b=h*m;if(r===3){let y=d[b];g[p]=a?.[y*3]??0,g[p+1]=a?.[y*3+1]??0,g[p+2]=a?.[y*3+2]??0,g[p+3]=i?.[y]??255;}else if(r===0||r===4){let y=d[b];g[p]=y,g[p+1]=y,g[p+2]=y,g[p+3]=r===4?d[b+1]:255;}else g[p]=d[b],g[p+1]=d[b+1],g[p+2]=d[b+2],g[p+3]=r===6?d[b+3]:255;}return {width:n,height:o,data:g}}var Rg=25.4,mm=72/Rg,Eg=50;function Ag(t){let e=/^data:[^,]*?(;base64)?,(.*)$/s.exec(t);if(!e)return null;try{let n=e[1]?atob(e[2]):decodeURIComponent(e[2]),o=new Uint8Array(n.length);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r)&255;return o}catch{return null}}function Pg(t){if(t[0]!==255||t[1]!==216)return null;let e=2;for(;e+9<t.length;){if(t[e]!==255)return null;let n=t[e+1];if(n===216||n>=208&&n<=215){e+=2;continue}let o=t[e+2]<<8|t[e+3];if(n===192||n===193||n===194){let r=t[e+5]<<8|t[e+6],a=t[e+7]<<8|t[e+8],i=t[e+9];return {width:a,height:r,components:i,progressive:n===194}}e+=2+o;}return null}async function vg(t,e){let{width:n,height:o,data:r}=t,a=e?4:3,i=new Uint8Array(n*o*a);for(let s=0;s<n*o;s++){let c=r[s*4+3]/255,u=r[s*4]*c+255*(1-c),m=r[s*4+1]*c+255*(1-c),f=r[s*4+2]*c+255*(1-c);if(e){let[d,g,h,p]=we(u,m,f);i.set([d*255,g*255,h*255,p*255].map(Math.round),s*a);}else i.set([Math.round(u),Math.round(m),Math.round(f)],s*a);}let l=await um(i);return {kind:"raw",width:n,height:o,components:a,bytes:l??i,compressed:!!l}}async function Ig(t,e){let n=t;if(!/^data:image\/(png|jpe?g)[;,]/i.test(n)){let i=await Qo(n);if(!i)return null;n=i;}let o=Ag(n);if(!o)return null;let r=Pg(o);if(r)return r.components===1||r.components===3?{kind:"jpeg",width:r.width,height:r.height,components:r.components,bytes:o,progressive:r.progressive}:null;let a=await Ms(o);return a?await vg(a,e):null}function Lg(t){let e="",n=0,o=r=>{e+=r,n+=r.length,n>=76&&(e+=`
|
|
3
|
+
`,n=0);};for(let r=0;r<t.length;r+=4){let a=Math.min(4,t.length-r),i=0;for(let s=0;s<4;s++)i=i*256+(s<a?t[r+s]:0);if(i===0&&a===4){o("z");continue}let l=[];for(let s=0;s<5;s++)l.unshift(String.fromCharCode(i%85+33)),i=Math.floor(i/85);o(l.slice(0,a+1).join(""));}return `${e}~>`}var kg=`/qrdxdict 40 dict def
|
|
4
4
|
qrdxdict begin
|
|
5
5
|
/m {moveto} bind def
|
|
6
6
|
/l {lineto} bind def
|
|
@@ -21,11 +21,11 @@ qrdxdict begin
|
|
|
21
21
|
} bind def
|
|
22
22
|
/QRDX-Regular /Helvetica latin1
|
|
23
23
|
/QRDX-Bold /Helvetica-Bold latin1
|
|
24
|
-
end`;function Rs(t){let e="(";for(let n of t){let o=n.codePointAt(0)??63;n==="("||n===")"||n==="\\"?e+=`\\${n}`:n==="\u2026"?e+="...":o>=32&&o<127?e+=n:o>=160&&o<=255?e+=`\\${o.toString(8).padStart(3,"0")}`:e+="?";}return `${e})`}var Es=class extends zn{out=[];shadingNames=new Map;cmyk;images;usesLevel3=false;constructor(e,n,o,r){super(n,o),this.cmyk=e,this.images=r;}color(e){if(this.cmyk){let[n,o,r,a]=we(e.r,e.g,e.b);return `${$(n)} ${$(o)} ${$(r)} ${$(a)} cmyk`}return `${$(e.r/255)} ${$(e.g/255)} ${$(e.b/255)} rg`}tracePath(e,n){let o=["n"],r=false;for(let a of e)if(a.op==="M"||a.op==="L"&&!r){let[i,l]=V(n,a.x,a.y);o.push(`${$(i)} ${$(l)} m`),r=true;}else if(a.op==="L"){let[i,l]=V(n,a.x,a.y);o.push(`${$(i)} ${$(l)} l`);}else if(a.op==="C"){if(!r)continue;let[i,l]=V(n,a.x1,a.y1),[s,c]=V(n,a.x2,a.y2),[u,m]=V(n,a.x,a.y);o.push(`${$(i)} ${$(l)} ${$(s)} ${$(c)} ${$(u)} ${$(m)} c`);}else r&&o.push("h");return o.join(" ")}beginClip(e,n,o){return this.out.push(`gsave ${this.tracePath(e,n)} ${o?"eoclip":"clip"} n`),true}endClip(){this.out.push("grestore");}rect(e,n,o,r,a){this.out.push(`${this.color(e)} n ${$(n)} ${$(o)} m ${$(n+r)} ${$(o)} l ${$(n+r)} ${$(o+a)} l ${$(n)} ${$(o+a)} l h f`);}shade(e,n,o){let r=
|
|
25
|
-
`));}};async function
|
|
26
|
-
`)}var dm="EPS can't carry image fills: PostScript has no transparency and would repeat the picture for every dot. Download PDF, SVG or PNG instead.";function fm(t){return [t.bgColor,t.fgColor,t.eyeColor,t.dotColor,...Object.values(t.eyeColors??{}).flatMap(n=>[n?.outer,n?.inner])].some(n=>typeof n=="object"&&n?.type==="image")}async function Vo(t,e={}){if(fm(t))throw new Error(dm);let n=Wo(t,{size:e.sizeMm??Rg,unit:"mm",bleed:e.bleedMm}),o=await Ir(t);return await mm(o,{width:n.trimWidth*um,bleed:n.bleed*um,bleedColor:n.bleed>0?Ho(t,o):xs(t),colorMode:e.colorMode,background:bt(t.bgColor,dt)})}function Xo(t){return `data:application/postscript;base64,${btoa(t)}`}async function kg(t,e={}){let n=await Vo(t,e);Bt(Xo(n),e.filename??"qr-code-print.eps");}var As={png:{mimeType:"image/png",extension:"png",vector:false},jpg:{mimeType:"image/jpeg",extension:"jpg",vector:false},webp:{mimeType:"image/webp",extension:"webp",vector:false},bmp:{mimeType:"image/bmp",extension:"bmp",vector:false},gif:{mimeType:Mr,extension:"gif",vector:false},ico:{mimeType:en,extension:"ico",vector:false,sizes:Io},svg:{mimeType:"image/svg+xml",extension:"svg",vector:true},pdf:{mimeType:"application/pdf",extension:"pdf",vector:false},eps:{mimeType:"application/postscript",extension:"eps",vector:true}},b4={small:{width:200,height:200},medium:{width:400,height:400},large:{width:800,height:800},xlarge:{width:1200,height:1200},"2xl":{width:1600,height:1600},"3xl":{width:2e3,height:2e3}};function Ps(t,e){return t<50||e<50?{isValid:false,error:"Size must be at least 50x50 pixels"}:t>5e3||e>5e3?{isValid:false,error:"Size must not exceed 5000x5000 pixels"}:t!==e?{isValid:false,error:"Width and height must be equal for QR codes"}:{isValid:true}}function ve(t,e){let{imageSettings:n,size:o}=t;if(!(n&&o)||o===e)return {...t,size:e};let r=e/o;return {...t,size:e,imageSettings:{...n,width:n.width*r,height:n.height*r,...n.x!=null&&{x:n.x*r},...n.y!=null&&{y:n.y*r},...n.padding!=null&&{padding:n.padding*r}}}}function Bt(t,e){let n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n);}var hm=t=>(As[t]??As.png).mimeType;function Fg(t,e,n){let{extension:o,vector:r,sizes:a}=As[t];if(r||a)return `qr-code.${o}`;let{width:i,height:l}=ue(e.width,n);return `qr-code-${Math.round(i)}x${Math.round(l)}.${o}`}async function pm(t,e={}){let n=await pe(t,"image/webp",true);try{return await Fo(n,e)}finally{n.remove();}}async function gm(t){let e=await pe(t,"image/png",true);try{return Ro(e)}finally{e.remove();}}async function bm(t){let e=await pe(t,"image/png",true);try{return await vo(e,t.value)}finally{e.remove();}}async function ym(t,e=Io){let n=[];try{for(let o of e)n.push(await pe(ve({...t,frame:void 0},o),"image/png",!0));return cs(n)}finally{for(let o of n)o.remove();}}var Tg=25.4/72;async function _m(t){let e=await Vo(t,{sizeMm:(t.size??it)*Tg});return Xo(e)}async function xm(t){let e;try{({jsPDF:e}=await import('jspdf'));}catch(f){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${f})`)}let n=await jt(t),o=decodeURIComponent(n.replace("data:image/svg+xml,","")),r;try{let f=new TextEncoder().encode(o),d=Array.from(f,h=>String.fromCharCode(h)).join("");r=`data:image/svg+xml;base64,${btoa(d)}`;}catch(f){throw new Error(`Failed to encode SVG for PDF conversion: ${f}`)}let{width:a,height:i}=ue(t.size||it,t.frame),l=await new Promise((f,d)=>{let g=new Image,h=document.createElement("canvas");h.width=Math.round(a),h.height=Math.round(i);let p=h.getContext("2d");if(!p){d(new Error("Could not get canvas context"));return}let b=setTimeout(()=>{h.remove(),d(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);g.onload=()=>{clearTimeout(b);try{p.drawImage(g,0,0,h.width,h.height),f(h);}catch(y){clearTimeout(b),h.remove(),d(new Error(`Failed to draw image to canvas: ${y}`));}},g.onerror=()=>{clearTimeout(b),h.remove(),d(new Error("Could not load SVG for PDF conversion"));},g.src=r;}),s=l.toDataURL("image/png",1),c=a*.264583,u=i*.264583,m=new e({orientation:c>u?"landscape":"portrait",unit:"mm",format:[c,u]});return m.addImage(s,"PNG",0,0,c,u),l.remove(),m.output("dataurlstring")}async function y4(t,e){let{format:n,size:o,filename:r,quality:a}=e,i=Ps(o.width,o.height);if(!i.isValid)throw new Error(i.error);let l=ve(t,o.width),s=r||Fg(n,o,t.frame);try{if(n==="svg"){let c=await jt(l);Bt(c,s);}else if(n==="pdf"){let c=await xm(l);Bt(c,s);}else if(n==="eps")Bt(await _m(l),s);else if(n==="webp"){let c=await pm(l,{quality:a});Bt(await Nt(c),s);}else if(n==="bmp"){let c=await gm(l);Bt(await Nt(c),s);}else if(n==="gif"){let c=await bm(l);Bt(await Nt(c),s);}else if(n==="ico"){let c=await ym(l);Bt(await Nt(c),s);}else {let c=hm(n),u=await pe(l,c);if(typeof u=="string")Bt(u,s);else throw new Error("Failed to generate image data URL")}}catch(c){throw console.error(`Error downloading ${n.toUpperCase()}:`,c),c}}async function _4(t,e,n,o={}){let r=Ps(n.width,n.height);if(!r.isValid)throw new Error(r.error);let a=ve(t,n.width);if(e==="svg")return await jt(a);if(e==="pdf")return await xm(a);if(e==="eps")return await _m(a);if(e==="webp")return await Nt(await pm(a,o));if(e==="bmp")return await Nt(await gm(a));if(e==="gif")return await Nt(await bm(a));if(e==="ico")return await Nt(await ym(a));let i=hm(e),l=await pe(a,i);if(typeof l=="string")return l;throw new Error("Failed to generate QR code data URL")}async function x4(t,e={width:it,height:it}){try{let n=Ps(e.width,e.height);if(!n.isValid)throw new Error(n.error);let o=ve(t,e.width),r=pe(o,"image/png",!0).then(a=>new Promise((i,l)=>{let s=a;s.toBlob(c=>{s.remove(),c?i(c):l(new Error("Failed to create blob from canvas"));},"image/png");}));await navigator.clipboard.write([new ClipboardItem({"image/png":r})]);}catch(n){throw console.error("Error copying to clipboard:",n),n}}async function $4(t){let e=await jt(t);return decodeURIComponent(e.replace("data:image/svg+xml,",""))}var Ot={maxBytes:2e5,maxElements:500,maxDepth:16,maxInputSegments:4e3,maxColors:8,artboardSide:1e3,decimals:1,padding:.06},ot=class extends Error{},Ng={script:t=>`Removed ${yt(t,"script")}`,style:t=>`Removed ${yt(t,"style sheet")}: colors set with CSS classes are lost. Export with presentation attributes (Illustrator: Styling \u2192 Presentation Attributes)`,"foreign-object":t=>`Removed ${yt(t,"foreignObject element")}`,image:t=>`Removed ${yt(t,"image")}: frames are vector shapes only`,use:t=>`Removed ${yt(t,"<use> reference")}: ungroup or detach symbols before exporting`,text:t=>`Removed ${yt(t,"text element")}: add text as labels in the frame editor`,effects:t=>`Removed ${yt(t,"filter, mask, clip path or pattern")}`,animation:t=>`Removed ${yt(t,"animation")}`,unknown:t=>`Removed ${yt(t,"unsupported element")}`,"nested-svg":t=>`Removed ${yt(t,"nested <svg>")}: flatten it first`,handlers:t=>`Removed ${yt(t,"event handler attribute")}`,links:t=>`Removed ${yt(t,"link")} (href)`,"external-paint":t=>`Removed ${yt(t,"fill or stroke")} that referenced something outside the file`,gradient:t=>`Flattened ${yt(t,"gradient")} to its first color: add gradients in the frame editor`,opacity:t=>`Made ${yt(t,"semi-transparent shape")} opaque (print files have no transparency)`,"invalid-paint":t=>`${yt(t,"color")} couldn't be read and fell back to the parent color`,stroke:t=>`Removed ${yt(t,"stroke")} on paths, polygons or polylines: outline strokes before exporting (Figma: Outline stroke)`,dash:t=>`Drew ${yt(t,"dashed stroke")} as solid`,clipped:t=>`Cut ${yt(t,"shape")} at the edge of the artboard`,outside:t=>`Removed ${yt(t,"shape")} outside the artboard`,colors:t=>`Merged ${yt(t,"color")} with similar ones (${Ot.maxColors} at most)`,"qr-placed":()=>'No QR placeholder found (a rect with id "qr"): the code was centered; place it in the frame editor'};function yt(t,e){return `${t} ${e}${t===1?"":"s"}`}var ks=class{counts=new Map;add(e,n=1){this.counts.set(e,(this.counts.get(e)??0)+n);}list(){return [...this.counts].map(([e,n])=>({code:e,count:n,message:Ng[e](n)}))}},Og=/^\s*<\?xml\s[^?>]*\?>/,vs=/[A-Za-z_][\w:.-]*/y,Is=/<\/([A-Za-z_][\w:.-]*)\s*>/y,jo=/\s*/y,Dg=/[A-Za-z_:][\w:.-]*/y,Bg=/[^"<]*/y,Gg=/[^'<]*/y;function qn(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function $m(t,e){let n=qn(jo,t,e),o=qn(Dg,t,n);if(n===e||o===n)return -1;let r=qn(jo,t,o);if(t[r]!=="=")return -1;let a=qn(jo,t,r+1),i=t[a];if(i!=='"'&&i!=="'")return -1;let s=qn(i==='"'?Bg:Gg,t,a+1);return t[s]===i?s+1:-1}function Qg(t,e){let n=qn(jo,t,e);return t[n]===">"?{end:n+1,selfClosing:false}:t.startsWith("/>",n)?{end:n+2,selfClosing:true}:null}function Ug(t){let e=[],n=0,o="",r=0;for(;r<t.length;){let a=t.indexOf("<",r);if(a<0)break;if(r=a,t.startsWith("<!--",r)){let c=t.indexOf("-->",r+4);if(c<0)throw new ot("The SVG has an unclosed comment");r=c+3;continue}if(t.startsWith("<![CDATA[",r)){let c=t.indexOf("]]>",r+9);if(c<0)throw new ot("The SVG has an unclosed CDATA section");r=c+3;continue}if(t.startsWith("<?",r)){let c=t.indexOf("?>",r+2);if(c<0)throw new ot("The SVG has an unclosed declaration");r=c+2;continue}if(t.startsWith("<!",r))throw new ot("DOCTYPE and other declarations are not allowed");if(t[r+1]==="/"){Is.lastIndex=r;let c=Is.exec(t);if(!c)throw new ot("The SVG has a malformed closing tag");if(e.pop()!==c[1])throw new ot(`The SVG closes <${c[1]}> out of order`);r=Is.lastIndex;continue}vs.lastIndex=r+1;let i=vs.exec(t);if(!i)throw new ot("The SVG has a malformed tag");let l=vs.lastIndex;for(let c=$m(t,l);c>=0;c=$m(t,l))l=c;let s=Qg(t,l);if(!s)throw new ot(`The SVG has a malformed <${i[0]}> tag (attributes must be quoted and may not contain "<")`);if(n++,n>Ot.maxElements)throw new ot(`The SVG has more than ${Ot.maxElements} elements`);if(o||(o=i[0]),!s.selfClosing&&(e.push(i[0]),e.length>Ot.maxDepth))throw new ot(`The SVG nests elements more than ${Ot.maxDepth} deep`);r=s.end;}if(e.length>0)throw new ot(`The SVG doesn't close <${e.at(-1)}>`);return o}function Hg(t){if(typeof t!="string")throw new ot("Expected SVG markup as a string");let e=new TextEncoder().encode(t).length;if(e>Ot.maxBytes)throw new ot(`The SVG is ${Math.ceil(e/1e3)} KB; the limit is ${Ot.maxBytes/1e3} KB`);if(/<!(?:DOCTYPE|ENTITY|ATTLIST|ELEMENT|NOTATION)/i.test(t))throw new ot("DOCTYPE and entity declarations are not allowed");let n=t.replace(Og,"");if(n.includes("<?"))throw new ot("Processing instructions (such as xml-stylesheet) are not allowed");if(Ug(n)!=="svg")throw new ot("The file must start with an <svg> element");return n}var Ls=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function Zt(t){let e=t?.replace(/!important/i,"").trim();return e===""||e==="inherit"?void 0:e}function Fs(t,e,n,o){let r=t.trim();if(r==="none"||r==="transparent")return null;if(/^url\(/i.test(r)){let i=/^url\(\s*['"]?#([^)'"\s]+)['"]?\s*\)/i.exec(r)?.[1],l=i?n.get(i):void 0;return l?(o.add("gradient"),Fs(l,e,n,o)):(o.add("external-paint"),null)}let a=lt(r==="currentColor"?e.color:r);return a?a.a<=0?null:`#${Ls(a.r)}${Ls(a.g)}${Ls(a.b)}`:(o.add("invalid-paint"),null)}function zg(t){let e=new Map,n=r=>{(r.name==="linearGradient"||r.name==="radialGradient")&&r.attrs.id&&e.set(r.attrs.id,r);for(let a of r.children)n(a);};n(t);let o=new Map;for(let[r,a]of e){let i=a.children.find(s=>s.name==="stop");if(!i){let s=(a.attrs.href??a.attrs["xlink:href"])?.match(/^#(.+)$/)?.[1];i=s?e.get(s)?.children.find(c=>c.name==="stop"):void 0;}let l=i&&Zt(j(i,"stop-color"));l&&o.set(r,l);}return o}function Sm(t,e){return t.map(n=>{if(n.op==="Z")return n;if(n.op==="C"){let[a,i]=V(e,n.x1,n.y1),[l,s]=V(e,n.x2,n.y2),[c,u]=V(e,n.x,n.y);return {op:"C",x1:a,y1:i,x2:l,y2:s,x:c,y:u}}let[o,r]=V(e,n.x,n.y);return {op:n.op,x:o,y:r}})}function qg(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),e/2}function Ns(t){return t.length<3?[]:[...t.map(([e,n],o)=>({op:o===0?"M":"L",x:e,y:n})),{op:"Z"}]}var Ie=t=>Number.isFinite(t);function ft(t,e,n=0){let o=Number.parseFloat(t.attrs[e]??"");return Ie(o)?o:n}function wm(t){switch(t.name){case "path":return se(t.attrs.d??"");case "rect":{let e=t.attrs.rx??t.attrs.ry,n=t.attrs.ry??t.attrs.rx;return ee(ft(t,"x"),ft(t,"y"),ft(t,"width"),ft(t,"height"),Number.parseFloat(e??"0")||0,Number.parseFloat(n??"0")||0)}case "circle":{let e=ft(t,"r");return te(ft(t,"cx"),ft(t,"cy"),e,e)}case "ellipse":return te(ft(t,"cx"),ft(t,"cy"),ft(t,"rx"),ft(t,"ry"));case "polygon":case "polyline":{let e=Jt(t.attrs.points),n=[];for(let o=0;o+1<e.length;o+=2)n.push([e[o],e[o+1]]);return Ns(n)}default:return []}}function Wg(t,e){let n=e/2;switch(t.name){case "rect":{let o=ft(t,"x"),r=ft(t,"y"),a=ft(t,"width"),i=ft(t,"height"),l=Number.parseFloat(t.attrs.rx??t.attrs.ry??"0")||0,s=ee(o-n,r-n,a+e,i+e,l>0?l+n:0,l>0?l+n:0);if(a<=e||i<=e)return s;let c=Math.max(l-n,0);return [...s,...ee(o+n,r+n,a-e,i-e,c,c)]}case "circle":case "ellipse":{let o=ft(t,"cx"),r=ft(t,"cy"),a=t.name==="circle"?ft(t,"r"):ft(t,"rx"),i=t.name==="circle"?ft(t,"r"):ft(t,"ry"),l=te(o,r,a+n,i+n);return a<=n||i<=n?l:[...l,...te(o,r,a-n,i-n)]}case "line":{let[o,r,a,i]=["x1","y1","x2","y2"].map(m=>ft(t,m)),l=Math.hypot(a-o,i-r);if(l===0)return [];let s=-(i-r)/l*n,c=(a-o)/l*n,u=[[o+s,r+c],[a+s,i+c],[a-s,i-c],[o-s,r-c]];return Ns(qg(u)<0?u.reverse():u)}default:return null}}var Vg=new Set(["path","rect","circle","ellipse","polygon","polyline","line"]),Xg=new Set(["defs","linearGradient","radialGradient","stop","title","desc","metadata"]),jg={script:"script",style:"style",foreignObject:"foreign-object",image:"image",feImage:"image",use:"use",text:"text",tspan:"text",textPath:"text",filter:"effects",mask:"effects",clipPath:"effects",pattern:"effects",marker:"effects",symbol:"effects",animate:"animation",animateMotion:"animation",animateTransform:"animation",set:"animation"},Zg=/^(?:qrdx[-_ ]?)?qr(?:[-_ ]?code)?$/i;function Mm(t,e){for(let n of Object.keys(t.attrs)){let o=n.toLowerCase();o.startsWith("on")?e.add("handlers"):o==="href"||o==="xlink:href"?t.name!=="linearGradient"&&t.name!=="radialGradient"&&e.add("links"):(o==="filter"||o==="mask"||o==="clip-path")&&e.add("effects");}}function Rm(t,e,n,o,r){if(Mm(t,o),Zt(j(t,"display"))==="none"||Zt(j(t,"visibility"))==="hidden")return;let a=Number.parseFloat(j(t,"opacity")??"1"),i=Zt(j(t,"fill-rule")),l=Number.parseFloat(Zt(j(t,"stroke-width"))??""),s={matrix:ut(e.matrix,Ut(t.attrs.transform)),fill:Zt(j(t,"fill"))??e.fill,fillRule:i==="evenodd"||i==="nonzero"?i:e.fillRule,stroke:Zt(j(t,"stroke"))??e.stroke,strokeWidth:Ie(l)&&l>=0?l:e.strokeWidth,color:Zt(j(t,"color"))??e.color,opacity:e.opacity*(Ie(a)?a:1)};for(let c of t.children){if(Xg.has(c.name))continue;let u=jg[c.name];if(u){o.add(u);continue}if(c.name==="svg"){o.add("nested-svg");continue}if(c.name==="g"||c.name==="a"){Rm(c,s,n,o,r);continue}if(!Vg.has(c.name)){o.add("unknown");continue}Yg(c,s,n,o,r);}}function Yg(t,e,n,o,r){if(Mm(t,o),Zt(j(t,"display"))==="none"||Zt(j(t,"visibility"))==="hidden")return;let a=ut(e.matrix,Ut(t.attrs.transform));if(t.name==="rect"&&Zg.test(t.attrs.id??"")&&!r.qrBox){r.qrBox=Ge(Sm(wm(t),a));return}let i=p=>Zt(j(t,p)),l=e.opacity*Number.parseFloat(i("opacity")??"1"),s=Number.parseFloat(i("fill-opacity")??"1"),c=Number.parseFloat(i("stroke-opacity")??"1"),u=i("fill-rule"),m={...e,fill:i("fill")??e.fill,fillRule:u==="evenodd"||u==="nonzero"?u:e.fillRule,stroke:i("stroke")??e.stroke,color:i("color")??e.color},f=Number.parseFloat(i("stroke-width")??""),d=Ie(f)&&f>=0?f:e.strokeWidth,g=(p,b,y)=>{if(p.length!==0){if(r.segments+=p.length,r.segments>Ot.maxInputSegments)throw new ot(`The SVG has more than ${Ot.maxInputSegments} path segments; simplify it`);r.shapes.push({segments:Sm(p,a),fill:b,fillRule:y});}},h=p=>{let b=(Ie(l)?l:1)*(Ie(p)?p:1);return b<=0?false:(b<1&&o.add("opacity"),true)};if(t.name!=="line"){let p=Fs(m.fill,m,n,o);p&&h(s)&&g(wm(t),p,m.fillRule);}if(d>0&&m.stroke!=="none"){let p=Fs(m.stroke,m,n,o);if(p&&h(c)){let b=Wg(t,d);b?((i("stroke-dasharray")??"none")!=="none"&&o.add("dash"),g(b,p,t.name==="line"?"nonzero":"evenodd")):o.add("stroke");}}}function Kg(t,e){let n=c=>{let u=10**e;return Math.round(c*u)/u+0},o=c=>$(c,e),r="",a=0,i=0,l=0,s=0;for(let c of t){if(c.op==="Z"){r+="z",a=l,i=s;continue}let u=n(c.x),m=n(c.y);if(c.op==="M")r+=`m${o(u-a)} ${o(m-i)}`,l=u,s=m;else if(c.op==="L"){if(u===a&&m===i)continue;r+=m===i?`h${o(u-a)}`:u===a?`v${o(m-i)}`:`l${o(u-a)} ${o(m-i)}`;}else r+=`c${o(n(c.x1)-a)} ${o(n(c.y1)-i)} ${o(n(c.x2)-a)} ${o(n(c.y2)-i)} ${o(u-a)} ${o(m-i)}`;a=u,i=m;}return r}var Jg=(t,e)=>t.x0<e.x1&&e.x0<t.x1&&t.y0<e.y1&&e.y0<t.y1;function t2(t){let e=[];for(let n of t){let o=Ge(n.segments);if(!o)continue;let r=e.at(-1);r&&r.shape.fill===n.fill&&r.shape.fillRule===n.fillRule&&!r.boxes.some(a=>Jg(a,o))?(r.shape={...r.shape,segments:[...r.shape.segments,...n.segments]},r.boxes.push(o)):e.push({shape:n,boxes:[o]});}return e.map(n=>n.shape)}var Ts=t=>[Number.parseInt(t.slice(1,3),16),Number.parseInt(t.slice(3,5),16),Number.parseInt(t.slice(5,7),16)];function e2(t,e,n){let o=new Map;for(let i of t)o.set(i.fill,(o.get(i.fill)??0)+1);let r=new Map([...o.keys()].map(i=>[i,i])),a=0;for(;o.size>e;){let i=[...o.keys()],l=[i[0],i[1]],s=Number.POSITIVE_INFINITY;for(let d=0;d<i.length;d++)for(let g=d+1;g<i.length;g++){let h=Ts(i[d]),p=Ts(i[g]),b=Math.hypot(h[0]-p[0],h[1]-p[1],h[2]-p[2]);b<s&&(s=b,l=[i[d],i[g]]);}let[c,u]=l,[m,f]=(o.get(c)??0)>=(o.get(u)??0)?[c,u]:[u,c];o.set(m,(o.get(m)??0)+(o.get(f)??0)),o.delete(f);for(let[d,g]of r)g===f&&r.set(d,m);a++;}return a>0&&n.add("colors",a),r}var Cm=t=>{let[e,n,o]=Ts(t);return .2126*e+.7152*n+.0722*o>235};function n2(t,e={}){let n=new ks;try{let o=Hg(t),r=xe(o);if(!r)throw new ot("No <svg> element found");let a=Jt(r.attrs.viewBox),[i,l,s,c]=[0,0,0,0];if(a.length===4&&a[2]>0&&a[3]>0?[i,l,s,c]=a:(s=ft(r,"width"),c=ft(r,"height")),!(Ie(s)&&Ie(c)&&s>0&&c>0))throw new ot("The SVG needs a viewBox (or a width and height)");let m=Ot.artboardSide/Math.max(s,c),f=Math.round(s*m*10)/10,d=Math.round(c*m*10)/10;if(Math.min(f,d)<at.minArtboard)throw new ot("The artboard is too narrow: its sides may differ by 20 times at most");let g=[m,0,0,m,-i*m,-l*m],h={shapes:[],qrBox:null,segments:0};Rm(r,{matrix:g,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,color:"#000000",opacity:1},zg(r),n,h);let p={x0:0,y0:0,x1:f,y1:d},b=Math.max(f,d)*.004,y=[],_=0,w=0;for(let O of h.shapes){let N=Ge(O.segments);if(!N||N.x1<=0||N.y1<=0||N.x0>=f||N.y0>=d){_++;continue}if(N.x0<-b||N.y0<-b||N.x1>f+b||N.y1>d+b){let _t=qr(O.segments,.25).map(At=>xn(At,p)).filter(At=>At.length>2);if(_t.length===0){_++;continue}w++,y.push({...O,segments:_t.flatMap(At=>Ns(At))});}else y.push(O);}if(_>0&&n.add("outside",_),w>0&&n.add("clipped",w),y.length===0)throw new ot("The SVG has no filled shapes to use");let C=e2(y,Ot.maxColors,n);for(let O of y)O.fill=C.get(O.fill)??O.fill;let S=new Map,x=new Map;for(let O of y){let N=Ge(O.segments);S.set(O.fill,(S.get(O.fill)??0)+(N.x1-N.x0)*(N.y1-N.y0)),x.set(O.fill,(x.get(O.fill)??0)+1);}let M=[...S.keys()].sort((O,N)=>Number(Cm(O))-Number(Cm(N))||S.get(N)-S.get(O)),R=M[0],E=M[1],v=O=>O===R?"frame":O===E?"accent":O,I=h.qrBox;if(!I&&e.qr){let[O,N]=V(g,e.qr.x,e.qr.y);I={x0:O,y0:N,x1:O+e.qr.size*m,y1:N+e.qr.size*m};}let L,T,F;I?(L=Math.min(I.x1-I.x0,I.y1-I.y0),T=(I.x0+I.x1-L)/2,F=(I.y0+I.y1-L)/2):(n.add("qr-placed"),L=Math.min(f,d)*.6,T=(f-L)/2,F=(d-L)/2);let k=O=>Math.round(O*10)/10+0;if(L=Math.floor(L*10)/10,T=k(T),F=k(F),L<Math.min(f,d)*at.minQrShare)throw new ot("The QR area must be at least half the frame's shorter side");let q=Math.min(T,F,f-T-L,d-F-L);if(q<L*at.minPadding-1e-9)throw new ot("Leave room around the QR area: at least 4% of its size on every side, inside the artboard");let H=Math.min(Math.max(e.padding??Ot.padding,at.minPadding),.2),G=Math.floor(Math.min(L*H,q)*10)/10,U=t2(y);if(U.length>at.maxShapes)throw new ot(`The artwork has ${U.length} separate shapes; the limit is ${at.maxShapes}. Combine shapes of the same color first`);let Z={kind:Kn,version:Jn,artboard:{width:f,height:d},qr:{x:T,y:F,size:L,padding:G},colors:{frame:R,...E&&{accent:E}},shapes:U.map(O=>({type:"path",d:Kg(O.segments,Ot.decimals),fill:v(O.fill),...O.fillRule==="evenodd"&&{fillRule:"evenodd"}})),labels:[]},rt=Kr(Z);if(!rt.success){let O=rt.issues[0];throw new ot(`The converted frame doesn't fit the frame format: ${O?.message??"invalid"}`)}let W=M.map(O=>({color:O,ref:O===R?"frame":O===E?"accent":"fixed",shapes:x.get(O)??0}));return {ok:!0,spec:rt.data,warnings:n.list(),palette:W}}catch(o){return {ok:false,error:o instanceof ot?o.message:`Could not read the SVG (${o instanceof Error?o.name:"error"})`,warnings:n.list()}}}var r2=1114,o2={"call-to-action":134,holidays:283,seasons:60,"food-drink":71,shopping:64,"beauty-wellness":26,events:77,places:71,"real-estate":35,automotive:27,"health-learning":48,"sports-fitness":36,business:82,nonprofit:28,objects:28,playful:44};var a2=[{id:"call-to-action",label:"Call to action"},{id:"holidays",label:"Holidays"},{id:"seasons",label:"Seasons"},{id:"food-drink",label:"Food & drink"},{id:"shopping",label:"Shops & packaging"},{id:"beauty-wellness",label:"Beauty & wellness"},{id:"events",label:"Events & weddings"},{id:"places",label:"Places & Wi-Fi"},{id:"real-estate",label:"Real estate"},{id:"automotive",label:"Cars & parking"},{id:"health-learning",label:"Health & learning"},{id:"sports-fitness",label:"Sports & fitness"},{id:"business",label:"Business & social"},{id:"nonprofit",label:"Nonprofits & community"},{id:"objects",label:"Everyday objects"},{id:"playful",label:"Playful & surprising"}];function Os(t){return Array.isArray(t)?`[${t.map(Os).join(",")}]`:t&&typeof t=="object"?`{${Object.keys(t).filter(n=>t[n]!==void 0).sort().map(n=>`${JSON.stringify(n)}:${Os(t[n])}`).join(",")}}`:JSON.stringify(t)}function i2(t){let e=Os(t),n=2166136261;for(let o=0;o<e.length;o++)n^=e.charCodeAt(o),n=Math.imul(n,16777619)>>>0;return n.toString(16).padStart(8,"0")}function s2(t,e){return mt.QrCode.encodeText(t,$t[e??Kt]).size}function Em(t,e,n,o=n.size*(e?.size??wa)){let r={src:t,width:o,height:o,excavate:true,...e?.shape&&e.shape!=="square"&&{shape:e.shape},...e?.plate&&{plate:e.plate}},a=e?.x!==void 0||e?.y!==void 0;if(!(e?.padding||a))return r;let i=s2(n.value,n.level),l=Rt(i,n.margin,n.shape),s=n.size/(i+2*l);if(e.padding&&(r.padding=e.padding*s),a){let c=i*s,u=m=>Math.min(Math.max((m??.5)*c-o/2,0),c-o);r.x=u(e.x),r.y=u(e.y);}return r}function Am(t,e,n,o){let r=n.level??Kt,a=r;o&&(a=Et({...n,imageSettings:Em(t,e,n),autoLevel:o}));let i=s=>{let c=m=>Em(t,e,{...n,level:s},m),u=Zi(n,[s],c().width,c);return u>0?c(u):void 0};if(a===r)return i(r);let l=i(a);return l&&Et({...n,imageSettings:l,autoLevel:o})===a?l:i(r)}function l2({value:t,level:e,margin:n,shape:o,autoLevel:r,logoOptions:a}){let l=Am("data:,",{...a,size:Sa},{value:`${t}`,size:1024,margin:n??ct,level:e,shape:o},r);return l?l.width/1024:0}function Ds({value:t,size:e=1024,fgColor:n,bgColor:o,eyeColor:r,dotColor:a,bodyPattern:i,hideLogo:l,logo:s,logoOptions:c,margin:u,cornerEyePattern:m,cornerEyeDotPattern:f,level:d,templateId:g,frame:h,eyeColors:p,moduleScale:b,autoLevel:y,shape:_,eyeShapes:w,eyeGradient:C,bgRadius:S,backdrop:x,halo:M,shadow:R}){let E={value:`${t}`,size:e,margin:u??ct,level:d,shape:_},v=!l&&s?Am(s,c,E,y):void 0;return {value:E.value,bgColor:o,fgColor:n,eyeColor:r,dotColor:a,bodyPattern:i,cornerEyePattern:m,cornerEyeDotPattern:f,level:d,templateId:g,size:e,margin:u,...h&&{frame:h},...p&&{eyeColors:p},...b!==void 0&&{moduleScale:b},...y&&{autoLevel:y},..._&&_!=="square"&&{shape:_},...w&&{eyeShapes:w},...C&&C!=="corner"&&{eyeGradient:C},...S&&{bgRadius:S},...x&&{backdrop:x},...M&&{halo:M},...R&&{shadow:R},...v&&{imageSettings:v}}}var Pm=.06,vm=.16,Im=512;function Lm(t){let{width:e,height:n}=t;if(!(e>0&&n>0)||t.data.length<e*n*4)return null;let o=Uint8Array.from(t.data),r=gi({width:e,height:n,data:o});if(!r)return null;let a=d=>{let g=d*4;return Math.hypot(o[g]/255-r[0],o[g+1]/255-r[1],o[g+2]/255-r[2])},i=new Uint8Array(e*n),l=new Int32Array(e*n),s=0,c=0,u=d=>{i[d]||o[d*4+3]===0||a(d)>=vm||(i[d]=1,l[c++]=d);};for(let d=0;d<e;d++)u(d),u((n-1)*e+d);for(let d=0;d<n;d++)u(d*e),u(d*e+e-1);for(;s<c;){let d=l[s++],g=d%e;g>0&&u(d-1),g<e-1&&u(d+1),d>=e&&u(d-e),d<(n-1)*e&&u(d+e);}let m=new Uint8ClampedArray(o),f=r;for(let d=0;d<e*n;d++){if(!i[d])continue;let g=Math.min(1,Math.max(0,(a(d)-Pm)/(vm-Pm))),h=d*4;if(m[h+3]=Math.round(o[h+3]*g),g>0&&g<1)for(let p=0;p<3;p++){let y=(o[h+p]/255-(1-g)*f[p])/g;m[h+p]=Math.round(Math.min(1,Math.max(0,y))*255);}}return {width:e,height:n,data:m}}async function c2(t){if(typeof document>"u"||typeof Image>"u")throw new Error("removeLogoBackground needs a browser (canvas)");let e=await new Promise(l=>{let s=new Image;s.crossOrigin="anonymous",s.onload=()=>l(s),s.onerror=()=>l(null),s.src=t;});if(!e)return null;let n=e.naturalWidth||512,o=e.naturalHeight||512,r=Math.min(1,Im/Math.max(n,o)),a=document.createElement("canvas");a.width=Math.max(1,Math.round(n*r)),a.height=Math.max(1,Math.round(o*r));let i=a.getContext("2d",{willReadFrequently:true});if(!i)return null;try{i.drawImage(e,0,0,a.width,a.height);let l=i.getImageData(0,0,a.width,a.height),s=Lm(l);return s?(l.data.set(s.data),i.putImageData(l,0,0),a.toDataURL("image/png")):null}catch{return null}finally{a.remove();}}var u2={value:true,size:true,level:true,bgColor:true,fgColor:true,eyeColor:true,dotColor:true,bodyPattern:true,cornerEyePattern:true,cornerEyeDotPattern:true,margin:true,style:true,imageSettings:true,isOGContext:true,templateId:true,customTemplate:true,customProps:true,frame:true,art:true,eyeColors:true,moduleScale:true,autoLevel:true,shape:true,eyeShapes:true,eyeGradient:true,bgRadius:true,backdrop:true,halo:true,shadow:true,frameLabelMarkers:true,partMarkers:true,hideLogo:true,logo:true,logoOptions:true,scale:true};function m2(t){let e={};for(let n of Object.keys(t))Object.hasOwn(u2,n)||(e[n]=t[n]);return e}function Zo(t){return Ds({value:t.value,fgColor:t.fgColor,hideLogo:t.hideLogo,bgColor:t.bgColor,eyeColor:t.eyeColor,dotColor:t.dotColor,bodyPattern:t.bodyPattern,cornerEyePattern:t.cornerEyePattern,cornerEyeDotPattern:t.cornerEyeDotPattern,level:t.level,templateId:t.templateId,logo:t.logo,logoOptions:t.logoOptions,margin:t.margin??ct,autoLevel:t.autoLevel,shape:t.shape,eyeShapes:t.eyeShapes,eyeGradient:t.eyeGradient,bgRadius:t.bgRadius,backdrop:t.backdrop,halo:t.halo,shadow:t.shadow})}function Yo(t,e){let{size:n=it,scale:o=1,level:r,style:a,customTemplate:i,customProps:l,frame:s,art:c,eyeColors:u,moduleScale:m,autoLevel:f,shape:d,frameLabelMarkers:g,partMarkers:h}=t,p={...e.eyeShapes&&{eyeShapes:e.eyeShapes},...e.eyeGradient&&{eyeGradient:e.eyeGradient},...e.bgRadius&&{bgRadius:e.bgRadius},...e.backdrop&&{backdrop:e.backdrop},...e.halo&&{halo:e.halo},...e.shadow&&{shadow:e.shadow}},b=n*o,y=b/e.size,_=e.imageSettings&&{...e.imageSettings,height:e.imageSettings.height*y,width:e.imageSettings.width*y,...e.imageSettings.x!=null&&{x:e.imageSettings.x*y},...e.imageSettings.y!=null&&{y:e.imageSettings.y*y},...e.imageSettings.padding!=null&&{padding:e.imageSettings.padding*y}};return {art:c,bgColor:e.bgColor,bodyPattern:e.bodyPattern,cornerEyeDotPattern:e.cornerEyeDotPattern,cornerEyePattern:e.cornerEyePattern,customProps:l,customTemplate:i,dotColor:e.dotColor,eyeColor:e.eyeColor,fgColor:e.fgColor,frame:s,level:r||e.level,margin:e.margin,...u&&{eyeColors:u},...m!==void 0&&{moduleScale:m},...f&&{autoLevel:f},...d&&d!=="square"&&{shape:d},...p,...g&&{frameLabelMarkers:g},...h&&{partMarkers:h},size:b,style:a,templateId:e.templateId,value:e.value,..._&&{imageSettings:_},...m2(t)}}function d2(t){return Yo(t,Zo(t))}function km(t,e){let n=[],o=r=>{if(r==null||typeof r=="boolean")return;if(typeof r=="string"||typeof r=="number"||typeof r=="bigint"){n.push(`${r}`);return}if(Array.isArray(r)){for(let c of r)o(c);return}if(!Oe(r))throw new TypeError("qrdx: can't render this value");let{type:a,props:i,key:l}=r;if(bn(a)){o(i.children);return}if(typeof a=="function"){o(a(i));return}let s={};for(let c of Object.keys(i)){let u=Hn(c,i[c]);u&&(s[u.name]=u.value);}n.push(e(a,s,km(i.children,e),l));};return o(t),n}var Wn=300,Lr=t=>{let e=typeof t=="number"?t:Number.parseFloat(String(t));return Number.isFinite(e)?e:void 0};function f2(t){let e=Lr(t.x)??0,n=Lr(t.y)??0,o=Jt(typeof t.viewBox=="string"?t.viewBox:void 0),r=Lr(t.width),a=Lr(t.height);if(o.length!==4||!(o[2]&&o[3]&&r&&a))return [1,0,0,1,e,n];let[i,l,s,c]=o,u=Math.min(r/s,a/c);return [u,0,0,u,e+(r-s*u)/2-i*u,n+(a-c*u)/2-l*u]}function Bs(t,e,n,o){if(t===e)return n;if(Array.isArray(t)){for(let l of t){let s=Bs(l,e,n,false);if(s)return s}return null}let r=t;if(!r||typeof r!="object"||!r.props)return null;let{props:a}=r,i=ut(n,Ut(typeof a.transform=="string"?a.transform:void 0));return r.type==="svg"&&!o&&(i=ut(i,f2(a))),Bs(a.children,e,i,false)}function Gs(t){let e=t.customTemplate||(t.templateId?xo(t.templateId):void 0);if(!e)return 1;let n={type:"svg",props:{height:Wn,viewBox:`0 0 ${Wn} ${Wn}`,width:Wn},key:null},o;try{o=e.wrapper(n,{fgColor:typeof t.fgColor=="string"?t.fgColor:void 0,bgColor:typeof t.bgColor=="string"?t.bgColor:void 0,...t.customProps??{}},{pixelSize:10,url:t.value});}catch{return 1}let r=o?.props;if(!r)return 1;let a=Jt(typeof r.viewBox=="string"?r.viewBox:void 0),i=a.length===4?a[2]:Lr(r.width),l=Bs(o,n,Sn,true);if(!(l&&i))return 1;let[s,c]=V(l,0,0),[u,m]=V(l,Wn,Wn),d=Math.min(Math.abs(u-s),Math.abs(m-c))/i;return d>0&&d<=1?d:1}var Gm=[96,160,320],Us=640;function zs(){if(typeof document>"u")throw new Error("Scan scoring needs a browser (canvas + image decoding)")}function ke(t){if(t?.aborted)throw new DOMException("Scan scoring was aborted","AbortError")}var Qm=()=>new Promise(t=>setTimeout(t,0));async function qs(){let{default:t}=await import('jsqr');return t}function Hs(t,e){if(!t)return false;if(t.data===e)return true;try{return new TextDecoder().decode(Uint8Array.from(t.binaryData))===e}catch{return false}}function h2(t,e,n=.7){let{data:o,width:r,height:a}=t;for(let u=0;u<o.length;u+=4)for(let m=0;m<3;m++)o[u+m]=128+(o[u+m]-128)*n;let i=Math.max(1,Math.round(e*.25)),l=2*i+1,s=new Float32Array(r*a*3),c=u=>{let m=u?a:r,f=u?r:a,d=u?r:1,g=u?1:r;for(let h=0;h<m;h++){let p=h*d,b=0,y=0,_=0;for(let w=-i;w<=i;w++){let C=(p+Math.min(Math.max(w,0),f-1)*g)*4;b+=o[C],y+=o[C+1],_+=o[C+2];}for(let w=0;w<f;w++){let C=(p+w*g)*3;s[C]=b/l,s[C+1]=y/l,s[C+2]=_/l;let S=(p+Math.max(w-i,0)*g)*4,x=(p+Math.min(w+i+1,f-1)*g)*4;b=b-o[S]+o[x],y=y-o[S+1]+o[x+1],_=_-o[S+2]+o[x+2];}}for(let h=0,p=0;h<r*a*3;h+=3,p+=4)o[p]=s[h],o[p+1]=s[h+1],o[p+2]=s[h+2];};for(let u=0;u<2;u++)c(true),c(false);}function Vn(t,e){let n=document.createElement("canvas");n.width=Math.max(1,Math.round(t)),n.height=Math.max(1,Math.round(e));let o=n.getContext("2d",{willReadFrequently:true});if(!o)throw new Error("Could not get canvas context");return o.imageSmoothingEnabled=true,o.imageSmoothingQuality="high",{canvas:n,ctx:o}}var p2=[.9,1,1.1];function Ws(t,e,n,o,r){let a=0;for(let i of p2){let l=n*i,s=e(l);h2(s,l/o),r(t(s.data,s.width,s.height))&&a++;}return a>=2?"pass":a===1?"fragile":"fail"}var Qs={small:"small print or far away",medium:"typical phone distance",large:"close up"};function g2(t,e){return t===e[0]&&e.length>1?Qs.small:t===e.at(-1)?Qs.large:Qs.medium}function Um(t,e,n){if(n==="pass")return 0;let o=e===1?[45]:e===2?[20,45]:[15,20,45],r=o[Math.round(t*(o.length-1)/Math.max(e-1,1))]??20;return n==="fragile"?Math.round(r/2):r}function Hm(t,e,n){let o=`${t} px (${g2(t,e)})`;return n==="pass"?{id:`decode-${t}`,passed:true,message:`Reads at ${o}, with camera blur`}:{id:`decode-${t}`,passed:false,message:n==="fragile"?`Reads at ${o} only some of the time`:`Doesn't read at ${o}`,fix:t===e[0]?"Print it bigger, shorten the content (fewer modules) or use solid square dots":"Raise the contrast, use bigger dots or a simpler eye shape"}}function zm(t,e){return e?"fails":t>=85?"great":t>=65?"ok":"risky"}function b2(t,e,n){let o=Lt(t,e);if(o.type==="solid")return [o.color];if(o.type!=="image")return o.stops.map(l=>l.color);let r=o.underlay?Jo(o.underlay):null,a=n?.[o.src];if(!a)return o.underlay?[o.underlay]:[];let i=o.opacity??1;return [a.light,a.dark].flatMap(l=>{let s=Jo(l);if(!s)return [];let c={...s,a:s.a*i};if(!r)return [Fm(c)];let u=c.a+r.a*(1-c.a),m=(f,d)=>u>0?(f*c.a+d*r.a*(1-c.a))/u:0;return [Fm({r:m(c.r,r.r),g:m(c.g,r.g),b:m(c.b,r.b),a:u})]})}var Fm=({r:t,g:e,b:n,a:o})=>`rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(n)}, ${Math.round(o*1e3)/1e3})`;function y2(t){let e=[],n=t.width*t.height;for(let a=0;a<n;a++){let i=t.data[a*4],l=t.data[a*4+1],s=t.data[a*4+2];t.data[a*4+3]<128||e.push({lum:Qn(i,l,s),r:i,g:l,b:s});}if(e.length===0)return null;e.sort((a,i)=>a.lum-i.lum);let o=Math.max(1,Math.round(e.length/10)),r=a=>{let i=a.reduce((s,c)=>({r:s.r+c.r,g:s.g+c.g,b:s.b+c.b}),{r:0,g:0,b:0}),l=s=>Math.round(s/a.length).toString(16).padStart(2,"0");return `#${l(i.r)}${l(i.g)}${l(i.b)}`};return {dark:r(e.slice(0,o)),light:r(e.slice(-o))}}async function _2(t){zs();let e=await Tr(t),{canvas:n,ctx:o}=Vn(64,64);o.drawImage(e,0,0,64,64);let r=y2(o.getImageData(0,0,64,64));return n.remove(),r}function qm(t){let e=[t.bgColor,t.fgColor,t.eyeColor,t.dotColor,...Be.flatMap(o=>[t.eyeColors?.[o]?.outer,t.eyeColors?.[o]?.inner])],n=new Set;for(let o of e)typeof o=="object"&&o?.type==="image"&&n.add(o.src);return [...n]}var kr=null;function Jo(t){let e=lt(t);if(e||typeof document>"u")return e;if(kr??=document.createElement("canvas").getContext("2d"),!kr)return null;kr.fillStyle="#010203",kr.fillStyle=t;let n=String(kr.fillStyle);return n==="#010203"?null:lt(n)}var Tm=t=>Qn(t.r,t.g,t.b),Wm=(t,e)=>(Math.max(t,e)+.05)/(Math.min(t,e)+.05),Fr=4.5,x2=3,Nm=1.5,Om={code:7,background:12},Dm={r:255,g:255,b:255,a:1},Bm=(t,e)=>({r:t.r*t.a+e.r*(1-t.a),g:t.g*t.a+e.g*(1-t.a),b:t.b*t.a+e.b*(1-t.a),a:1});function $2(t,e={}){let n=e.imageTones,o=(g,h)=>{let p=typeof g=="object"&&g?.type==="image";return b2(g,h,n).map(b=>({color:b,picture:p}))},r=t.fgColor??Mt,a=Be.flatMap(g=>{let h=t.eyeColors?.[g];return [...h?.outer?o(h.outer,Mt):[],...h?.inner?o(h.inner,Mt):[]]}),i=[...o(r,Mt),...o(t.eyeColor??r,Mt),...o(t.dotColor??r,Mt),...a],l=o(t.bgColor,dt),s=yr(t.halo,t)?.color;s&&l.push({color:s,picture:false});let c=(l.length>0?l:[{color:"#ffffff",picture:false}]).map(g=>{let h=Jo(g.color);return {color:h?Bm(h,Dm):Dm,picture:g.picture}}),u=i.flatMap(g=>{let h=Jo(g.color);return h?[{color:h,picture:g.picture}]:[]}),m=Number.POSITIVE_INFINITY,f=Fr,d=false;for(let g of u)for(let h of c){let p=Tm(Bm(g.color,h.color)),b=Tm(h.color),y=Wm(p,b),_=h.picture?Om.background:g.picture?Om.code:Fr;y/_<m/f&&(m=y,f=_),p>b&&(d=true);}return {ratio:Number.isFinite(m)?m:Number.POSITIVE_INFINITY,required:f,inverted:d}}function S2(t,e){let{ratio:n,inverted:o,required:r}=$2(t,{imageTones:e});if(!Number.isFinite(n))return {checks:[],penalty:0,fails:false};let a=r/Fr,i=r!==Fr,l=Math.round(n*10)/10,s=[],c=0;return n>=r?s.push({id:"contrast",passed:true,message:`Contrast ${l}:1 between code and background`}):(c=n<Nm*a?60:n<x2*a?30:10,s.push({id:"contrast",passed:false,message:i?`Low contrast for a picture (${l}:1); ${r}:1 or more scans reliably`:`Low contrast (${l}:1); 4.5:1 or more scans reliably`,fix:i?"Lower the picture's opacity over a darker underlay (dots) or a lighter one (background)":"Use a darker code color or a lighter background"})),o?(c+=10,s.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):s.push({id:"polarity",passed:true,message:"Dark code on a light background"}),{checks:s,penalty:c,fails:n<Nm*(r/Fr)}}function Vs(t){return mt.QrCode.encodeText(t.value,$t[Et(t)]).getModules()}function w2(t){let{imageSettings:e}=t;if(!e)return {check:null,penalty:0};let n=Vs(t),o=Ae(n,t.size??it,Rt(n.length,t.margin??ct,t.shape),e);if(!o)return {check:null,penalty:0};let r=o.excavation??o,a=n.length,l=[[0,0],[a-8,0],[0,a-8]].some(([g,h])=>r.x<g+9&&r.x+r.w>g&&r.y<h+9&&r.y+r.h>h),s=a>21?a-9:null,c=s!==null&&r.x<s+5&&r.x+r.w>s&&r.y<s+5&&r.y+r.h>s;if(l||c)return {check:{id:"logo",passed:false,message:l?"The logo covers a corner eye":"The logo covers the small square near the bottom-right corner",fix:"Move the logo toward the center or make it smaller"},penalty:40};let u=r.w*r.h/(a*a),m=Et(t),f=Math.round(u*100),d=Mo({value:t.value,size:t.size??it,margin:t.margin??ct,level:m,shape:t.shape},e);return !d||d.worst<=d.budget?{check:{id:"logo",passed:true,message:`Logo covers ${f}% of the code; error correction repairs it with room to spare`},penalty:0}:{check:{id:"logo",passed:false,message:`Logo covers ${f}% of the code and spoils ${d.worst} codewords in one block, which repairs ${d.correctable}`,fix:d.level==="H"?"Use a smaller logo":"Switch error correction to H or use a smaller logo"},penalty:d.worst>d.correctable?25:10}}function C2(t){let e=pr(t.shape)?Xe(t.margin??ct):t.margin??ct,n=Vs(t).length+2*e,o=e+(Tt(t.frame)?ui(t.frame)*n:0),r=Math.round(o*10)/10;return o>=4?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${r} modules`},penalty:0}:o>=1.5?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${r} modules (4 is ideal)`},penalty:0}:{check:{id:"quiet-zone",passed:false,message:"No quiet zone around the code",fix:"Leave clear space (about 10% of the code width) around it wherever you place it, or add a frame"},penalty:5}}function M2(t){let e=_o(t);return e?{check:{id:"halo",passed:false,message:e.message,fix:e.fix},penalty:15}:{check:null,penalty:0}}function R2(t){let e=Fi(t);return e==="curly"?{check:{id:"eye-shape",passed:false,message:"Curly eyes fail strict decoders such as ZXing-based apps",fix:"Pick square, rounded or gear eyes"},penalty:40}:e==="circle"?{check:{id:"eye-shape",passed:false,message:"Circle eyes only read in lenient decoders; many apps miss them",fix:"Pick square, rounded or gear eyes"},penalty:20}:{check:{id:"eye-shape",passed:true,message:`No known decoder issues with ${e} eyes`},penalty:0}}function Tr(t){return new Promise((e,n)=>{let o=new Image;o.crossOrigin="anonymous",o.onload=()=>e(o),o.onerror=()=>n(new Error("Could not load image")),o.src=t;})}var E2=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><rect width="10" height="10" rx="2" fill="#808080"/></svg>')}`;async function A2(t){let{imageSettings:e}=t;if(!e||e.src.startsWith("data:"))return t;let n=E2;try{let o=await Tr(e.src),{canvas:r,ctx:a}=Vn(o.naturalWidth||256,o.naturalHeight||256);a.drawImage(o,0,0,r.width,r.height),n=r.toDataURL("image/png");}catch{}return {...t,imageSettings:{...e,src:n}}}async function P2(t){let e=new Map;for(let r of qm(t))if(!r.startsWith("data:"))try{let a=await Tr(r),{canvas:i,ctx:l}=Vn(a.naturalWidth||256,a.naturalHeight||256);l.drawImage(a,0,0,i.width,i.height),e.set(r,i.toDataURL("image/png")),i.remove();}catch{e.set(r,null);}if(e.size===0)return t;let n=r=>{if(typeof r!="object"||r?.type!=="image")return r;let a=e.get(r.src);return a===void 0?r:a?{...r,src:a}:r.underlay??Mt},o=t.eyeColors?Object.fromEntries(Object.entries(t.eyeColors).map(([r,a])=>[r,a&&{outer:n(a.outer),inner:n(a.inner)}])):void 0;return {...t,bgColor:n(t.bgColor),fgColor:n(t.fgColor),eyeColor:n(t.eyeColor),dotColor:n(t.dotColor),...o&&{eyeColors:o}}}async function Vm(t,e,n,o,r){let a=[],i=0,l=S2(t,r);i+=l.penalty;let s=w2(t);i+=s.penalty;let c=C2(t);i+=c.penalty;let u=R2(t);i+=u.penalty;let m=M2(t);i+=m.penalty;let f=Ti(t),d=f?.kind==="eye"?null:f;d&&d.kind!=="sharp-dot-eye"&&(i+=10);let g=await qs();ke(o);let h=Vs(t).length,p=h+2*Rt(h,t.margin??ct,t.shape),b=[],y=false;for(let[C,S]of n.entries()){await Qm(),ke(o);let x=Ws(g,e,S,p,M=>Hs(M,t.value));i+=Um(C,n.length,x),b.push(Hm(S,n,x)),C===n.length-1&&x==="fail"&&(y=true);}a.push(...b,...l.checks),s.check&&a.push(s.check),a.push(u.check,c.check),m.check&&a.push(m.check),d&&a.push({id:"style-pair",passed:false,message:d.message,fix:d.fix});let _=y||l.fails,w=Math.max(0,Math.min(100,100-i));return _&&(w=Math.min(w,30)),{score:w,grade:zm(w,_),checks:a}}function Xm(t){return [...t.sizes??Gm].filter(e=>e>0).sort((e,n)=>e-n)}async function d6(t,e={}){zs();let{signal:n}=e,o=Xm(e),r=Us/Gs(t),a=await P2(await A2(ve({...t,size:t.size??it},r)));ke(n);let i={};for(let m of qm(t))try{let f=await _2(m);f&&(i[m]=f);}catch{}ke(n);let l=await jt(a),s=await Tr(l);ke(n);let c=ue(r,t.frame);return await Vm(t,m=>{let f=m/Us,d=c.width*f,g=c.height*f,h=Math.max(8,Math.round(m*.12)),{canvas:p,ctx:b}=Vn(d+2*h,g+2*h);b.fillStyle="#ffffff",b.fillRect(0,0,p.width,p.height),b.drawImage(s,h,h,d,g);let y=b.getImageData(0,0,p.width,p.height);return p.remove(),y},o,n,i)}var f6=Us;async function h6(t,e,n={}){let{width:o,height:r}=e;if(!(o>0&&r>0)||e.data.length<o*r*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=Xm(n),i=t.size??it,l=ue(i,t.frame),s=o*i*Gs(t)/l.width,c={data:v2(e),width:o,height:r};return await Vm(t,m=>{let f=jm(c,m/s),d=Math.max(8,Math.round(m*.12));return I2(f,d)},a,n.signal)}function v2(t){let{data:e,width:n,height:o}=t,r=new Uint8ClampedArray(n*o*4);for(let a=0;a<n*o*4;a+=4){let i=e[a+3]/255;for(let l=0;l<3;l++)r[a+l]=e[a+l]*i+255*(1-i);r[a+3]=255;}return r}function I2(t,e){let n=t.width+2*e,o=t.height+2*e,r=new Uint8ClampedArray(n*o*4).fill(255);for(let a=0;a<t.height;a++)r.set(t.data.subarray(a*t.width*4,(a+1)*t.width*4),((a+e)*n+e)*4);return {data:r,width:n,height:o,colorSpace:"srgb"}}var Le=(t,e)=>Math.hypot(t.x-e.x,t.y-e.y);function Ko(t,e){return .299*t[e]+.587*t[e+1]+.114*t[e+2]}function L2(t,e){let n=0;for(let l=0;l<256;l++)n+=l*t[l];let o=0,r=0,a=0,i=128;for(let l=0;l<256;l++){if(r+=t[l],r===0)continue;let s=e-r;if(s===0)break;o+=l*t[l];let c=o/r,u=(n-o)/s,m=r*s*(c-u)**2;m>a&&(a=m,i=l);}return i}async function k2(t){if(!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=URL.createObjectURL(t);try{let n=await Tr(e);return await n.decode?.().catch(()=>{}),n}finally{setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function p6(t,e={}){zs();let{signal:n}=e,o=[...e.sizes??Gm].filter(Q=>Q>0).sort((Q,B)=>Q-B),r=await qs(),a=await k2(t);ke(n);let i=a.naturalWidth||a.width,l=a.naturalHeight||a.height;if(!(i&&l))throw new Error("Could not read this image");let s=Math.min(1,1600/Math.max(i,l)),{canvas:c,ctx:u}=Vn(i*s,l*s);u.fillStyle="#ffffff",u.fillRect(0,0,c.width,c.height),u.drawImage(a,0,0,c.width,c.height);let m=u.getImageData(0,0,c.width,c.height),f=r(m.data,m.width,m.height);if(ke(n),!f){let Q=await S0(a,0,false);return c.remove(),typeof Q!="string"||Q==="NO_QR"?{data:null,version:null,score:0,grade:"fails",checks:[{id:"decode",passed:false,message:"No QR code found in this image",fix:"Try a sharper, well-lit, straight-on photo or a screenshot"}]}:{data:Q,version:null,score:55,grade:"risky",checks:[{id:"decode",passed:false,message:"Decoded only after cropping; the code is small or hard to find in this image",fix:"Make the code bigger relative to its surroundings"}]}}let{location:d,version:g}=f,h=17+4*g,p=(Le(d.topLeftCorner,d.topRightCorner)+Le(d.bottomLeftCorner,d.bottomRightCorner)+Le(d.topLeftCorner,d.bottomLeftCorner)+Le(d.topRightCorner,d.bottomRightCorner))/4,b=p/h,y=[d.topLeftCorner,d.topRightCorner,d.bottomRightCorner,d.bottomLeftCorner],_=Math.max(0,Math.floor(Math.min(...y.map(Q=>Q.x)))),w=Math.min(m.width,Math.ceil(Math.max(...y.map(Q=>Q.x)))),C=Math.max(0,Math.floor(Math.min(...y.map(Q=>Q.y)))),S=Math.min(m.height,Math.ceil(Math.max(...y.map(Q=>Q.y)))),x=[],M=0,R=new Array(256).fill(0),E=0;for(let Q=C;Q<S;Q++)for(let B=_;B<w;B++){let Y=Math.round(Ko(m.data,(Q*m.width+B)*4));R[Y]=R[Y]+1,E++;}let v=L2(R,E),I={dark:[0,0,0,0],light:[0,0,0,0]};for(let Q=C;Q<S;Q++)for(let B=_;B<w;B++){let Y=(Q*m.width+B)*4,pt=Ko(m.data,Y)<=v?I.dark:I.light;pt[0]=pt[0]+m.data[Y],pt[1]=pt[1]+m.data[Y+1],pt[2]=pt[2]+m.data[Y+2],pt[3]=pt[3]+1;}let L=Q=>{let B=Math.max(Q[3],1);return Qn(Q[0]/B,Q[1]/B,Q[2]/B)},T=L(I.dark),F=L(I.light),k=Wm(T,F),q=Math.round(k*10)/10;k>=4.5?x.push({id:"contrast",passed:true,message:`Contrast ${q}:1 in the image`}):(M+=k<2?30:10,x.push({id:"contrast",passed:false,message:`Low contrast in the image (${q}:1)`,fix:"Use a darker code on a lighter background, or better lighting for photos"}));let G=[d.topLeftFinderPattern,d.topRightFinderPattern,d.bottomLeftFinderPattern].map(Q=>{let B=Math.min(m.width-1,Math.max(0,Math.round(Q.x))),Y=Math.min(m.height-1,Math.max(0,Math.round(Q.y)));return Ko(m.data,(Y*m.width+B)*4)}).filter(Q=>Q>v).length>=2;G?(M+=10,x.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):x.push({id:"polarity",passed:true,message:"Dark code on a light background"});let U=Math.max(2,Math.round(b*2)),Z={minX:_-U,maxX:w+U,minY:C-U,maxY:S+U};if(Z.minX<0||Z.minY<0||Z.maxX>m.width||Z.maxY>m.height)x.push({id:"quiet-zone",passed:true,skipped:true,message:"The image is cropped too tight to check the quiet zone"});else {let Q=0,B=0;for(let Y=Z.minY;Y<Z.maxY;Y++)for(let pt=Z.minX;pt<Z.maxX;pt++){if(pt>=_&&pt<w&&Y>=C&&Y<S)continue;let oe=Ko(m.data,(Y*m.width+pt)*4);(G?oe>v:oe<=v)&&Q++,B++;}Q/Math.max(B,1)>.12?(M+=10,x.push({id:"quiet-zone",passed:false,message:"Something dark touches the code; the quiet zone isn't clear",fix:"Leave clear space (about 4 modules) around the code"})):x.push({id:"quiet-zone",passed:true,message:"Clear space around the code"});}b<2?x.push({id:"resolution",passed:false,message:`Low resolution: about ${Math.round(b*10)/10} px per module`,fix:"Use a larger image, or export the code at a bigger size"}):x.push({id:"resolution",passed:true,message:`About ${Math.round(b)} px per module`});let W=Math.round(b*4),O=Math.max(0,_-W),N=Math.max(0,C-W),_t=Math.min(m.width,w+W)-O,At=Math.min(m.height,S+W)-N,Fe=Q=>{let B=Q/p,Y=Vn(_t*B,At*B);Y.ctx.drawImage(c,O,N,_t,At,0,0,Y.canvas.width,Y.canvas.height);let pt=Y.ctx.getImageData(0,0,Y.canvas.width,Y.canvas.height);return Y.canvas.remove(),pt},Gt=[],Dt=false;for(let[Q,B]of o.entries()){await Qm(),ke(n);let Y=Ws(r,Fe,B,h,pt=>pt?.data===f.data);M+=Um(Q,o.length,Y),Gt.push(Hm(B,o,Y)),Q===o.length-1&&Y==="fail"&&(Dt=true);}c.remove();let ht=Math.max(0,Math.min(100,100-M));return Dt&&(ht=Math.min(ht,30)),{data:f.data,version:g,score:ht,grade:zm(ht,Dt),checks:[...Gt,...x]}}var F2=[320];function jm(t,e){let n=Math.min(1,e),o=Math.max(1,Math.round(t.width*n)),r=Math.max(1,Math.round(t.height*n)),a=new Uint8ClampedArray(o*r*4),i=t.width/o,l=t.height/r;for(let s=0;s<r;s++){let c=Math.floor(s*l),u=Math.max(c+1,Math.min(t.height,Math.floor((s+1)*l)));for(let m=0;m<o;m++){let f=Math.floor(m*i),d=Math.max(f+1,Math.min(t.width,Math.floor((m+1)*i))),g=0,h=0,p=0,b=0;for(let w=c;w<u;w++)for(let C=f;C<d;C++){let S=(w*t.width+C)*4;g+=t.data[S],h+=t.data[S+1],p+=t.data[S+2],b+=t.data[S+3];}let y=(u-c)*(d-f),_=(s*o+m)*4;a[_]=g/y,a[_+1]=h/y,a[_+2]=p/y,a[_+3]=b/y;}}return {data:a,width:o,height:r,colorSpace:"srgb"}}function T2(t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(Uint8Array.from(t.binaryData))}catch{return t.data}}async function g6(t,e,n={}){let{width:o,height:r}=t;if(!(o>0&&r>0)||t.data.length<o*r*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=await qs(),i={data:t.data instanceof Uint8ClampedArray?t.data:Uint8ClampedArray.from(t.data),width:o,height:r},l=a(i.data,o,r,{inversionAttempts:"dontInvert"});if(!l)return {data:null,version:null,passed:false};let s=T2(l),{version:c,location:u}=l;if(!Hs(l,e))return {data:s,version:c,passed:false};let m=17+4*c,f=(Le(u.topLeftCorner,u.topRightCorner)+Le(u.bottomLeftCorner,u.bottomRightCorner)+Le(u.topLeftCorner,u.bottomLeftCorner)+Le(u.topRightCorner,u.bottomRightCorner))/4;for(let d of n.sizes??F2)if(Ws(a,h=>jm(i,h/f),d,m,h=>Hs(h,e))!=="pass")return {data:s,version:c,passed:false};return {data:s,version:c,passed:true}}var N2=16,Zm=.01;function O2(t){let e=new Float64Array(256);for(let s of t)e[Math.min(255,Math.max(0,Math.round(s*255)))]++;let n=t.length,o=0;for(let s=0;s<256;s++)o+=s*e[s];let r=0,a=0,i=0,l=128;for(let s=0;s<256;s++){if(a+=e[s],a===0)continue;let c=n-a;if(c===0)break;r+=s*e[s];let u=r/a,m=(o-r)/c,f=a*c*(u-m)**2;f>i&&(i=f,l=s);}return (l+.5)/255}function D2(t,e){let{width:n,height:o,data:r}=t,a=n*o,i=new Uint8Array(a),l=0;for(let d=0;d<a;d++)r[d*4+3]<128&&l++;if(e==="alpha"||e==="auto"&&l>a*.02&&l<a*.98){for(let d=0;d<a;d++)i[d]=r[d*4+3]>=128?1:0;return i}let c=new Float32Array(a);for(let d=0;d<a;d++){let g=r[d*4+3]/255,h=.2126*r[d*4]+.7152*r[d*4+1]+.0722*r[d*4+2];c[d]=1-(h*g+255*(1-g))/255;}let u=O2(c);for(let d=0;d<a;d++)i[d]=c[d]>u?1:0;let m=0,f=0;for(let d=0;d<n;d++)for(let g of [0,o-1])m++,f+=i[g*n+d];for(let d=1;d<o-1;d++)for(let g of [0,n-1])m++,f+=i[d*n+g];if(f>m/2)for(let d=0;d<a;d++)i[d]=i[d]?0:1;return i}function Ym(t,e,n,o){for(let r of [1,0]){let a=new Uint8Array(t.length);for(let i=0;i<t.length;i++){if(a[i]||t[i]!==r)continue;let l=[i];a[i]=1;let s=false;for(let u of l){let m=u%e,f=(u-m)/e;(m===0||f===0||m===e-1||f===n-1)&&(s=true);for(let[d,g]of [[m-1,f],[m+1,f],[m,f-1],[m,f+1]]){if(d<0||g<0||d>=e||g>=n)continue;let h=g*e+d;!a[h]&&t[h]===r&&(a[h]=1,l.push(h));}}if((r===1||!s)&&l.length<o)for(let u of l)t[u]=r?0:1;}}}function Km(t,e={}){let{width:n,height:o,data:r}=t;if(!(n>0&&o>0)||r.length<n*o*4)throw new Error("Silhouette pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=D2(t,e.mode??"auto"),i=a.reduce((x,M)=>x+M,0);Ym(a,n,o,Math.max(16,i*Zm));let l=n,s=o,c=-1,u=-1;for(let x=0;x<o;x++)for(let M=0;M<n;M++)a[x*n+M]&&(l=Math.min(l,M),s=Math.min(s,x),c=Math.max(c,M),u=Math.max(u,x));if(c<0)throw new Error("No shape found: use a picture with a dark or opaque shape on a light or clear background");let m=c-l+1,f=u-s+1;if(Math.max(m,f)<N2)throw new Error("The shape is too small to trace; use a bigger picture");let g=Math.min(Math.max(Math.round(e.cells??De),ye),De)/Math.max(m,f),h=Math.max(ye,Math.round(m*g)),p=Math.max(ye,Math.round(f*g)),b=Math.max(1,Math.round(m*g)),y=Math.max(1,Math.round(f*g)),_=Math.floor((h-b)/2),w=Math.floor((p-y)/2),C=new Uint8Array(h*p);for(let x=0;x<y;x++){let M=s+Math.floor(x*f/y),R=Math.max(M+1,s+Math.floor((x+1)*f/y));for(let E=0;E<b;E++){let v=l+Math.floor(E*m/b),I=Math.max(v+1,l+Math.floor((E+1)*m/b)),L=0;for(let T=M;T<R;T++)for(let F=v;F<I;F++)L+=a[T*n+F];C[(x+w)*h+E+_]=L*2>=(R-M)*(I-v)?1:0;}}let S=C.reduce((x,M)=>x+M,0);if(Ym(C,h,p,Math.max(4,S*Zm)),!C.includes(1))throw new Error("The shape is too small to trace; use a bigger picture");return {type:"silhouette",width:h,height:p,cells:Array.from(C,x=>x?"1":"0").join("")}}var Xs=512;async function B2(t){if(typeof t!="string"&&!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=typeof t=="string"?t:URL.createObjectURL(t);try{return await new Promise((n,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>n(r),r.onerror=()=>o(new Error("Could not load the picture")),r.src=e;})}finally{typeof t!="string"&&setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function G2(t,e={}){if(typeof document>"u")throw new Error("loadQRSilhouette needs a browser; pass decoded pixels to createQRSilhouette instead");let n=await B2(t),o=n.naturalWidth||n.width||Xs,r=n.naturalHeight||n.height||Xs,a=Xs/Math.max(o,r),i=Math.max(1,Math.round(o*a)),l=Math.max(1,Math.round(r*a)),s=document.createElement("canvas");s.width=i,s.height=l;let c=s.getContext("2d",{willReadFrequently:true});if(!c)throw new Error("Could not get a canvas context");c.drawImage(n,0,0,i,l);let u;try{u=c.getImageData(0,0,i,l);}catch{throw new Error("Could not read the picture (cross-origin images need CORS); upload it instead")}finally{s.remove();}return Km(u,e)}function js(t){return gn(Un,()=>Cr(t))}var H2=react.memo(t=>{let{value:e,fgColor:n,hideLogo:o,logo:r,logoOptions:a,bgColor:i,eyeColor:l,dotColor:s,bodyPattern:c,cornerEyePattern:u,cornerEyeDotPattern:m,level:f,margin:d=ct,templateId:g,autoLevel:h,shape:p}=t,b=react.useMemo(()=>Zo(t),[e,n,o,r,a,d,h,p,i,l,s,c,u,m,f,g]);return jsxRuntime.jsx(js,{...Yo(t,b)})});H2.displayName="QRCode";function q2({frame:t,size:e,bgColor:n,slot:o,...r}){let a=o;return gn(Un,()=>mi({frame:t,size:e,bgColor:n,slot:a,svgProps:r}))}/**
|
|
24
|
+
end`;function Rs(t){let e="(";for(let n of t){let o=n.codePointAt(0)??63;n==="("||n===")"||n==="\\"?e+=`\\${n}`:n==="\u2026"?e+="...":o>=32&&o<127?e+=n:o>=160&&o<=255?e+=`\\${o.toString(8).padStart(3,"0")}`:e+="?";}return `${e})`}var Es=class extends zn{out=[];shadingNames=new Map;cmyk;images;usesLevel3=false;constructor(e,n,o,r){super(n,o),this.cmyk=e,this.images=r;}color(e){if(this.cmyk){let[n,o,r,a]=we(e.r,e.g,e.b);return `${$(n)} ${$(o)} ${$(r)} ${$(a)} cmyk`}return `${$(e.r/255)} ${$(e.g/255)} ${$(e.b/255)} rg`}tracePath(e,n){let o=["n"],r=false;for(let a of e)if(a.op==="M"||a.op==="L"&&!r){let[i,l]=V(n,a.x,a.y);o.push(`${$(i)} ${$(l)} m`),r=true;}else if(a.op==="L"){let[i,l]=V(n,a.x,a.y);o.push(`${$(i)} ${$(l)} l`);}else if(a.op==="C"){if(!r)continue;let[i,l]=V(n,a.x1,a.y1),[s,c]=V(n,a.x2,a.y2),[u,m]=V(n,a.x,a.y);o.push(`${$(i)} ${$(l)} ${$(s)} ${$(c)} ${$(u)} ${$(m)} c`);}else r&&o.push("h");return o.join(" ")}beginClip(e,n,o){return this.out.push(`gsave ${this.tracePath(e,n)} ${o?"eoclip":"clip"} n`),true}endClip(){this.out.push("grestore");}rect(e,n,o,r,a){this.out.push(`${this.color(e)} n ${$(n)} ${$(o)} m ${$(n+r)} ${$(o)} l ${$(n+r)} ${$(o+a)} l ${$(n)} ${$(o+a)} l h f`);}shade(e,n,o){let r=ct(n.matrix,o.matrix);if(!Pe(r))return;let a=Oo(o,this.cmyk?"cmyk":"rgb"),i=this.shadingNames.get(a);i||(i=`Sh${this.shadingNames.size}`,this.shadingNames.set(a,i)),this.usesLevel3=true;let l=n.fillRule==="evenodd"?"eoclip":"clip";this.out.push(`gsave ${this.tracePath(e,n.matrix)} ${l} n [${No(r)}] concat ${i} shfill grestore`);}paint(e,n,o){if(e.length===0)return;let r=o.opacity??1;if(r<=0)return;let a=this.resolveFill(o.fill,e,o.viewport,(o.fillOpacity??1)*r);a&&"pattern"in a?this.paintPattern(e,o,a.pattern,a.alpha):a&&"gradient"in a&&this.shade(e,o,{...a.gradient,stops:a.gradient.stops.map(m=>({...m,color:this.flatten({...m.color,a:m.color.a*a.alpha})}))});let i=a&&"color"in a?this.flatten(a.color):null,l=o.strokeWidth>0?this.resolveColor(o.stroke):null,s=l&&this.flatten({...l,a:l.a*r});if(!(i||s))return;let c=this.tracePath(e,o.matrix),u=o.fillRule==="evenodd"?"ef":"f";if(i&&s?this.out.push(`gsave ${this.color(i)} ${c} ${u} grestore`):i&&this.out.push(`${this.color(i)} ${c} ${u}`),s){let m=`${this.color(s)} ${$(o.strokeWidth*wn(o.matrix))} w ${c} s`,{join:f,cap:d}=Bo(o);this.out.push(f||d?`gsave ${f} setlinejoin ${d} setlinecap ${m} grestore`:m);}}text(e,n){let o=e.text.replace(/\s+/g," ").trim(),r=this.resolveColor(n.fill);if(!(o&&r))return;let a=wn(n.matrix),[i,l]=V(n.matrix,X(e.attrs.x,n.viewport[0]),X(e.attrs.y,n.viewport[1])),c=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600?"/QRDX-Bold":"/QRDX-Regular",u=$(n.fontSize*a),m=Number.parseFloat(e.attrs["data-max-width"]??""),f=m>0?` dup stringwidth pop dup ${$(m*a)} gt {${$(m*a)} exch div ${u} mul ${c} findfont exch scalefont setfont} {pop} ifelse`:"",d=n.textAnchor==="middle"?" dup stringwidth pop 2 div neg 0 rmoveto":n.textAnchor==="end"?" dup stringwidth pop neg 0 rmoveto":"",g=Math.atan2(n.matrix[1],n.matrix[0])*180/Math.PI;if(Math.abs(g)>.01){this.out.push(`gsave ${this.color(r)} ${c} findfont ${u} scalefont setfont ${$(i)} ${$(l)} translate ${$(g)} rotate ${Rs(o)}${f} 0 0 moveto${d} show grestore`);return}this.out.push(`gsave ${this.color(r)} ${c} findfont ${u} scalefont setfont ${Rs(o)}${f} ${$(i)} ${$(l)} moveto${d} show grestore`);}image(e,n){let o=e.attrs.href??e.attrs["xlink:href"],r=o?this.images.get(o):void 0;if(!r)return;let a=X(e.attrs.x,n.viewport[0]),i=X(e.attrs.y,n.viewport[1]),l=X(e.attrs.width,n.viewport[0]),s=X(e.attrs.height,n.viewport[1]);if(l<=0||s<=0)return;let[c,u]=V(n.matrix,a,i),[m,f]=V(n.matrix,a+l,i+s),{components:d}=r,g=d===1?"/DeviceGray":d===4?"/DeviceCMYK":"/DeviceRGB",h=Array.from({length:d},()=>"0 1").join(" "),p="/ASCII85Decode filter";r.kind==="jpeg"?(p+=" /DCTDecode filter",r.progressive&&(this.usesLevel3=true)):r.compressed&&(p+=" /FlateDecode filter",this.usesLevel3=true),this.out.push(["gsave",`${$(Math.min(c,m))} ${$(Math.min(u,f))} translate ${$(Math.abs(m-c))} ${$(Math.abs(f-u))} scale`,`${g} setcolorspace`,`<< /ImageType 1 /Width ${r.width} /Height ${r.height} /BitsPerComponent 8 /Decode [${h}] /ImageMatrix [${r.width} 0 0 -${r.height} 0 ${r.height}] /DataSource currentfile ${p} >> image`,Lg(r.bytes),"grestore"].join(`
|
|
25
|
+
`));}};async function dm(t,e={}){let n=xe(t);if(!n)throw new Error("Could not read the SVG to convert to EPS");let o=X(n.attrs.width,0,0)||512,r=X(n.attrs.height,0,0)||o,a=e.width??o;if(!(Number.isFinite(a)&&a>0))throw new Error("EPS width must be a positive number of points");let i=a/o,l=r*i,s=Math.max(0,e.bleed??0),c=a+2*s,u=l+2*s,m=e.colorMode==="cmyk",f=new Map;for(let y of vr(n,new Set)){let _=await Ig(y,m);_&&f.set(y,_);}let d=new Es(m,Pr(n,new Map),To(n),f);zo(d,{bgColor:e.background??"#ffffff"});let h={matrix:ct([1,0,0,-1,s,u-s],[i,0,0,i,0,0]),viewport:[o,r],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},p=s>0?e.bleedColor??void 0:void 0;if(!(p&&d.paintBleed(n,h,p,[0,0,c,u]))){let y=p?d.resolveColor(p):null;y&&d.rect(y,0,0,c,u);}d.walk(n,h,true);let b=(e.title??"QR code").replace(/[^\x20-\x7e]/g,"?");return ["%!PS-Adobe-3.0 EPSF-3.0",`%%BoundingBox: 0 0 ${Math.ceil(c)} ${Math.ceil(u)}`,`%%HiResBoundingBox: 0 0 ${$(c)} ${$(u)}`,`%%Title: ${Rs(b)}`,"%%Creator: qrdx",`%%LanguageLevel: ${d.usesLevel3?3:2}`,"%%DocumentData: Clean7Bit","%%EndComments","%%BeginProlog",kg,"%%EndProlog","qrdxdict begin",...Array.from(d.shadingNames,([y,_])=>`/${_} ${y} def`),"gsave",...d.out,"grestore","end","showpage","%%Trailer","%%EOF",""].join(`
|
|
26
|
+
`)}var fm="EPS can't carry image fills: PostScript has no transparency and would repeat the picture for every dot. Download PDF, SVG or PNG instead.";function hm(t){return [t.bgColor,t.fgColor,t.eyeColor,t.dotColor,...Object.values(t.eyeColors??{}).flatMap(n=>[n?.outer,n?.inner])].some(n=>typeof n=="object"&&n?.type==="image")}async function Vo(t,e={}){if(hm(t))throw new Error(fm);let n=Wo(t,{size:e.sizeMm??Eg,unit:"mm",bleed:e.bleedMm}),o=await Ir(t);return await dm(o,{width:n.trimWidth*mm,bleed:n.bleed*mm,bleedColor:n.bleed>0?Ho(t,o):xs(t),colorMode:e.colorMode,background:bt(t.bgColor,mt)})}function Xo(t){return `data:application/postscript;base64,${btoa(t)}`}async function Fg(t,e={}){let n=await Vo(t,e);Bt(Xo(n),e.filename??"qr-code-print.eps");}var As={png:{mimeType:"image/png",extension:"png",vector:false},jpg:{mimeType:"image/jpeg",extension:"jpg",vector:false},webp:{mimeType:"image/webp",extension:"webp",vector:false},bmp:{mimeType:"image/bmp",extension:"bmp",vector:false},gif:{mimeType:Mr,extension:"gif",vector:false},ico:{mimeType:en,extension:"ico",vector:false,sizes:Io},svg:{mimeType:"image/svg+xml",extension:"svg",vector:true},pdf:{mimeType:"application/pdf",extension:"pdf",vector:false},eps:{mimeType:"application/postscript",extension:"eps",vector:true}},y4={small:{width:200,height:200},medium:{width:400,height:400},large:{width:800,height:800},xlarge:{width:1200,height:1200},"2xl":{width:1600,height:1600},"3xl":{width:2e3,height:2e3}};function Ps(t,e){return t<50||e<50?{isValid:false,error:"Size must be at least 50x50 pixels"}:t>5e3||e>5e3?{isValid:false,error:"Size must not exceed 5000x5000 pixels"}:t!==e?{isValid:false,error:"Width and height must be equal for QR codes"}:{isValid:true}}function ve(t,e){let{imageSettings:n,size:o}=t;if(!(n&&o)||o===e)return {...t,size:e};let r=e/o;return {...t,size:e,imageSettings:{...n,width:n.width*r,height:n.height*r,...n.x!=null&&{x:n.x*r},...n.y!=null&&{y:n.y*r},...n.padding!=null&&{padding:n.padding*r}}}}function Bt(t,e){let n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n);}var pm=t=>(As[t]??As.png).mimeType;function Tg(t,e,n){let{extension:o,vector:r,sizes:a}=As[t];if(r||a)return `qr-code.${o}`;let{width:i,height:l}=ue(e.width,n);return `qr-code-${Math.round(i)}x${Math.round(l)}.${o}`}async function gm(t,e={}){let n=await pe(t,"image/webp",true);try{return await Fo(n,e)}finally{n.remove();}}async function bm(t){let e=await pe(t,"image/png",true);try{return Ro(e)}finally{e.remove();}}async function ym(t){let e=await pe(t,"image/png",true);try{return await vo(e,t.value)}finally{e.remove();}}async function _m(t,e=Io){let n=[];try{for(let o of e)n.push(await pe(ve({...t,frame:void 0},o),"image/png",!0));return cs(n)}finally{for(let o of n)o.remove();}}var Ng=25.4/72;async function xm(t){let e=await Vo(t,{sizeMm:(t.size??it)*Ng});return Xo(e)}async function $m(t){let e;try{({jsPDF:e}=await import('jspdf'));}catch(f){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${f})`)}let n=await jt(t),o=decodeURIComponent(n.replace("data:image/svg+xml,","")),r;try{let f=new TextEncoder().encode(o),d=Array.from(f,h=>String.fromCharCode(h)).join("");r=`data:image/svg+xml;base64,${btoa(d)}`;}catch(f){throw new Error(`Failed to encode SVG for PDF conversion: ${f}`)}let{width:a,height:i}=ue(t.size||it,t.frame),l=await new Promise((f,d)=>{let g=new Image,h=document.createElement("canvas");h.width=Math.round(a),h.height=Math.round(i);let p=h.getContext("2d");if(!p){d(new Error("Could not get canvas context"));return}let b=setTimeout(()=>{h.remove(),d(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);g.onload=()=>{clearTimeout(b);try{p.drawImage(g,0,0,h.width,h.height),f(h);}catch(y){clearTimeout(b),h.remove(),d(new Error(`Failed to draw image to canvas: ${y}`));}},g.onerror=()=>{clearTimeout(b),h.remove(),d(new Error("Could not load SVG for PDF conversion"));},g.src=r;}),s=l.toDataURL("image/png",1),c=a*.264583,u=i*.264583,m=new e({orientation:c>u?"landscape":"portrait",unit:"mm",format:[c,u]});return m.addImage(s,"PNG",0,0,c,u),l.remove(),m.output("dataurlstring")}async function _4(t,e){let{format:n,size:o,filename:r,quality:a}=e,i=Ps(o.width,o.height);if(!i.isValid)throw new Error(i.error);let l=ve(t,o.width),s=r||Tg(n,o,t.frame);try{if(n==="svg"){let c=await jt(l);Bt(c,s);}else if(n==="pdf"){let c=await $m(l);Bt(c,s);}else if(n==="eps")Bt(await xm(l),s);else if(n==="webp"){let c=await gm(l,{quality:a});Bt(await Nt(c),s);}else if(n==="bmp"){let c=await bm(l);Bt(await Nt(c),s);}else if(n==="gif"){let c=await ym(l);Bt(await Nt(c),s);}else if(n==="ico"){let c=await _m(l);Bt(await Nt(c),s);}else {let c=pm(n),u=await pe(l,c);if(typeof u=="string")Bt(u,s);else throw new Error("Failed to generate image data URL")}}catch(c){throw console.error(`Error downloading ${n.toUpperCase()}:`,c),c}}async function x4(t,e,n,o={}){let r=Ps(n.width,n.height);if(!r.isValid)throw new Error(r.error);let a=ve(t,n.width);if(e==="svg")return await jt(a);if(e==="pdf")return await $m(a);if(e==="eps")return await xm(a);if(e==="webp")return await Nt(await gm(a,o));if(e==="bmp")return await Nt(await bm(a));if(e==="gif")return await Nt(await ym(a));if(e==="ico")return await Nt(await _m(a));let i=pm(e),l=await pe(a,i);if(typeof l=="string")return l;throw new Error("Failed to generate QR code data URL")}async function $4(t,e={width:it,height:it}){try{let n=Ps(e.width,e.height);if(!n.isValid)throw new Error(n.error);let o=ve(t,e.width),r=pe(o,"image/png",!0).then(a=>new Promise((i,l)=>{let s=a;s.toBlob(c=>{s.remove(),c?i(c):l(new Error("Failed to create blob from canvas"));},"image/png");}));await navigator.clipboard.write([new ClipboardItem({"image/png":r})]);}catch(n){throw console.error("Error copying to clipboard:",n),n}}async function S4(t){let e=await jt(t);return decodeURIComponent(e.replace("data:image/svg+xml,",""))}var Ot={maxBytes:2e5,maxElements:500,maxDepth:16,maxInputSegments:4e3,maxColors:8,artboardSide:1e3,decimals:1,padding:.06},ot=class extends Error{},Og={script:t=>`Removed ${yt(t,"script")}`,style:t=>`Removed ${yt(t,"style sheet")}: colors set with CSS classes are lost. Export with presentation attributes (Illustrator: Styling \u2192 Presentation Attributes)`,"foreign-object":t=>`Removed ${yt(t,"foreignObject element")}`,image:t=>`Removed ${yt(t,"image")}: frames are vector shapes only`,use:t=>`Removed ${yt(t,"<use> reference")}: ungroup or detach symbols before exporting`,text:t=>`Removed ${yt(t,"text element")}: add text as labels in the frame editor`,effects:t=>`Removed ${yt(t,"filter, mask, clip path or pattern")}`,animation:t=>`Removed ${yt(t,"animation")}`,unknown:t=>`Removed ${yt(t,"unsupported element")}`,"nested-svg":t=>`Removed ${yt(t,"nested <svg>")}: flatten it first`,handlers:t=>`Removed ${yt(t,"event handler attribute")}`,links:t=>`Removed ${yt(t,"link")} (href)`,"external-paint":t=>`Removed ${yt(t,"fill or stroke")} that referenced something outside the file`,gradient:t=>`Flattened ${yt(t,"gradient")} to its first color: add gradients in the frame editor`,opacity:t=>`Made ${yt(t,"semi-transparent shape")} opaque (print files have no transparency)`,"invalid-paint":t=>`${yt(t,"color")} couldn't be read and fell back to the parent color`,stroke:t=>`Removed ${yt(t,"stroke")} on paths, polygons or polylines: outline strokes before exporting (Figma: Outline stroke)`,dash:t=>`Drew ${yt(t,"dashed stroke")} as solid`,clipped:t=>`Cut ${yt(t,"shape")} at the edge of the artboard`,outside:t=>`Removed ${yt(t,"shape")} outside the artboard`,colors:t=>`Merged ${yt(t,"color")} with similar ones (${Ot.maxColors} at most)`,"qr-placed":()=>'No QR placeholder found (a rect with id "qr"): the code was centered; place it in the frame editor'};function yt(t,e){return `${t} ${e}${t===1?"":"s"}`}var ks=class{counts=new Map;add(e,n=1){this.counts.set(e,(this.counts.get(e)??0)+n);}list(){return [...this.counts].map(([e,n])=>({code:e,count:n,message:Og[e](n)}))}},Dg=/^\s*<\?xml\s[^?>]*\?>/,vs=/[A-Za-z_][\w:.-]*/y,Is=/<\/([A-Za-z_][\w:.-]*)\s*>/y,jo=/\s*/y,Bg=/[A-Za-z_:][\w:.-]*/y,Gg=/[^"<]*/y,Qg=/[^'<]*/y;function qn(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function Sm(t,e){let n=qn(jo,t,e),o=qn(Bg,t,n);if(n===e||o===n)return -1;let r=qn(jo,t,o);if(t[r]!=="=")return -1;let a=qn(jo,t,r+1),i=t[a];if(i!=='"'&&i!=="'")return -1;let s=qn(i==='"'?Gg:Qg,t,a+1);return t[s]===i?s+1:-1}function Ug(t,e){let n=qn(jo,t,e);return t[n]===">"?{end:n+1,selfClosing:false}:t.startsWith("/>",n)?{end:n+2,selfClosing:true}:null}function Hg(t){let e=[],n=0,o="",r=0;for(;r<t.length;){let a=t.indexOf("<",r);if(a<0)break;if(r=a,t.startsWith("<!--",r)){let c=t.indexOf("-->",r+4);if(c<0)throw new ot("The SVG has an unclosed comment");r=c+3;continue}if(t.startsWith("<![CDATA[",r)){let c=t.indexOf("]]>",r+9);if(c<0)throw new ot("The SVG has an unclosed CDATA section");r=c+3;continue}if(t.startsWith("<?",r)){let c=t.indexOf("?>",r+2);if(c<0)throw new ot("The SVG has an unclosed declaration");r=c+2;continue}if(t.startsWith("<!",r))throw new ot("DOCTYPE and other declarations are not allowed");if(t[r+1]==="/"){Is.lastIndex=r;let c=Is.exec(t);if(!c)throw new ot("The SVG has a malformed closing tag");if(e.pop()!==c[1])throw new ot(`The SVG closes <${c[1]}> out of order`);r=Is.lastIndex;continue}vs.lastIndex=r+1;let i=vs.exec(t);if(!i)throw new ot("The SVG has a malformed tag");let l=vs.lastIndex;for(let c=Sm(t,l);c>=0;c=Sm(t,l))l=c;let s=Ug(t,l);if(!s)throw new ot(`The SVG has a malformed <${i[0]}> tag (attributes must be quoted and may not contain "<")`);if(n++,n>Ot.maxElements)throw new ot(`The SVG has more than ${Ot.maxElements} elements`);if(o||(o=i[0]),!s.selfClosing&&(e.push(i[0]),e.length>Ot.maxDepth))throw new ot(`The SVG nests elements more than ${Ot.maxDepth} deep`);r=s.end;}if(e.length>0)throw new ot(`The SVG doesn't close <${e.at(-1)}>`);return o}function zg(t){if(typeof t!="string")throw new ot("Expected SVG markup as a string");let e=new TextEncoder().encode(t).length;if(e>Ot.maxBytes)throw new ot(`The SVG is ${Math.ceil(e/1e3)} KB; the limit is ${Ot.maxBytes/1e3} KB`);if(/<!(?:DOCTYPE|ENTITY|ATTLIST|ELEMENT|NOTATION)/i.test(t))throw new ot("DOCTYPE and entity declarations are not allowed");let n=t.replace(Dg,"");if(n.includes("<?"))throw new ot("Processing instructions (such as xml-stylesheet) are not allowed");if(Hg(n)!=="svg")throw new ot("The file must start with an <svg> element");return n}var Ls=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function Zt(t){let e=t?.replace(/!important/i,"").trim();return e===""||e==="inherit"?void 0:e}function Fs(t,e,n,o){let r=t.trim();if(r==="none"||r==="transparent")return null;if(/^url\(/i.test(r)){let i=/^url\(\s*['"]?#([^)'"\s]+)['"]?\s*\)/i.exec(r)?.[1],l=i?n.get(i):void 0;return l?(o.add("gradient"),Fs(l,e,n,o)):(o.add("external-paint"),null)}let a=lt(r==="currentColor"?e.color:r);return a?a.a<=0?null:`#${Ls(a.r)}${Ls(a.g)}${Ls(a.b)}`:(o.add("invalid-paint"),null)}function qg(t){let e=new Map,n=r=>{(r.name==="linearGradient"||r.name==="radialGradient")&&r.attrs.id&&e.set(r.attrs.id,r);for(let a of r.children)n(a);};n(t);let o=new Map;for(let[r,a]of e){let i=a.children.find(s=>s.name==="stop");if(!i){let s=(a.attrs.href??a.attrs["xlink:href"])?.match(/^#(.+)$/)?.[1];i=s?e.get(s)?.children.find(c=>c.name==="stop"):void 0;}let l=i&&Zt(j(i,"stop-color"));l&&o.set(r,l);}return o}function wm(t,e){return t.map(n=>{if(n.op==="Z")return n;if(n.op==="C"){let[a,i]=V(e,n.x1,n.y1),[l,s]=V(e,n.x2,n.y2),[c,u]=V(e,n.x,n.y);return {op:"C",x1:a,y1:i,x2:l,y2:s,x:c,y:u}}let[o,r]=V(e,n.x,n.y);return {op:n.op,x:o,y:r}})}function Wg(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),e/2}function Ns(t){return t.length<3?[]:[...t.map(([e,n],o)=>({op:o===0?"M":"L",x:e,y:n})),{op:"Z"}]}var Ie=t=>Number.isFinite(t);function dt(t,e,n=0){let o=Number.parseFloat(t.attrs[e]??"");return Ie(o)?o:n}function Cm(t){switch(t.name){case "path":return se(t.attrs.d??"");case "rect":{let e=t.attrs.rx??t.attrs.ry,n=t.attrs.ry??t.attrs.rx;return ee(dt(t,"x"),dt(t,"y"),dt(t,"width"),dt(t,"height"),Number.parseFloat(e??"0")||0,Number.parseFloat(n??"0")||0)}case "circle":{let e=dt(t,"r");return te(dt(t,"cx"),dt(t,"cy"),e,e)}case "ellipse":return te(dt(t,"cx"),dt(t,"cy"),dt(t,"rx"),dt(t,"ry"));case "polygon":case "polyline":{let e=Jt(t.attrs.points),n=[];for(let o=0;o+1<e.length;o+=2)n.push([e[o],e[o+1]]);return Ns(n)}default:return []}}function Vg(t,e){let n=e/2;switch(t.name){case "rect":{let o=dt(t,"x"),r=dt(t,"y"),a=dt(t,"width"),i=dt(t,"height"),l=Number.parseFloat(t.attrs.rx??t.attrs.ry??"0")||0,s=ee(o-n,r-n,a+e,i+e,l>0?l+n:0,l>0?l+n:0);if(a<=e||i<=e)return s;let c=Math.max(l-n,0);return [...s,...ee(o+n,r+n,a-e,i-e,c,c)]}case "circle":case "ellipse":{let o=dt(t,"cx"),r=dt(t,"cy"),a=t.name==="circle"?dt(t,"r"):dt(t,"rx"),i=t.name==="circle"?dt(t,"r"):dt(t,"ry"),l=te(o,r,a+n,i+n);return a<=n||i<=n?l:[...l,...te(o,r,a-n,i-n)]}case "line":{let[o,r,a,i]=["x1","y1","x2","y2"].map(m=>dt(t,m)),l=Math.hypot(a-o,i-r);if(l===0)return [];let s=-(i-r)/l*n,c=(a-o)/l*n,u=[[o+s,r+c],[a+s,i+c],[a-s,i-c],[o-s,r-c]];return Ns(Wg(u)<0?u.reverse():u)}default:return null}}var Xg=new Set(["path","rect","circle","ellipse","polygon","polyline","line"]),jg=new Set(["defs","linearGradient","radialGradient","stop","title","desc","metadata"]),Zg={script:"script",style:"style",foreignObject:"foreign-object",image:"image",feImage:"image",use:"use",text:"text",tspan:"text",textPath:"text",filter:"effects",mask:"effects",clipPath:"effects",pattern:"effects",marker:"effects",symbol:"effects",animate:"animation",animateMotion:"animation",animateTransform:"animation",set:"animation"},Yg=/^(?:qrdx[-_ ]?)?qr(?:[-_ ]?code)?$/i;function Rm(t,e){for(let n of Object.keys(t.attrs)){let o=n.toLowerCase();o.startsWith("on")?e.add("handlers"):o==="href"||o==="xlink:href"?t.name!=="linearGradient"&&t.name!=="radialGradient"&&e.add("links"):(o==="filter"||o==="mask"||o==="clip-path")&&e.add("effects");}}function Em(t,e,n,o,r){if(Rm(t,o),Zt(j(t,"display"))==="none"||Zt(j(t,"visibility"))==="hidden")return;let a=Number.parseFloat(j(t,"opacity")??"1"),i=Zt(j(t,"fill-rule")),l=Number.parseFloat(Zt(j(t,"stroke-width"))??""),s={matrix:ct(e.matrix,Ut(t.attrs.transform)),fill:Zt(j(t,"fill"))??e.fill,fillRule:i==="evenodd"||i==="nonzero"?i:e.fillRule,stroke:Zt(j(t,"stroke"))??e.stroke,strokeWidth:Ie(l)&&l>=0?l:e.strokeWidth,color:Zt(j(t,"color"))??e.color,opacity:e.opacity*(Ie(a)?a:1)};for(let c of t.children){if(jg.has(c.name))continue;let u=Zg[c.name];if(u){o.add(u);continue}if(c.name==="svg"){o.add("nested-svg");continue}if(c.name==="g"||c.name==="a"){Em(c,s,n,o,r);continue}if(!Xg.has(c.name)){o.add("unknown");continue}Kg(c,s,n,o,r);}}function Kg(t,e,n,o,r){if(Rm(t,o),Zt(j(t,"display"))==="none"||Zt(j(t,"visibility"))==="hidden")return;let a=ct(e.matrix,Ut(t.attrs.transform));if(t.name==="rect"&&Yg.test(t.attrs.id??"")&&!r.qrBox){r.qrBox=Ge(wm(Cm(t),a));return}let i=p=>Zt(j(t,p)),l=e.opacity*Number.parseFloat(i("opacity")??"1"),s=Number.parseFloat(i("fill-opacity")??"1"),c=Number.parseFloat(i("stroke-opacity")??"1"),u=i("fill-rule"),m={...e,fill:i("fill")??e.fill,fillRule:u==="evenodd"||u==="nonzero"?u:e.fillRule,stroke:i("stroke")??e.stroke,color:i("color")??e.color},f=Number.parseFloat(i("stroke-width")??""),d=Ie(f)&&f>=0?f:e.strokeWidth,g=(p,b,y)=>{if(p.length!==0){if(r.segments+=p.length,r.segments>Ot.maxInputSegments)throw new ot(`The SVG has more than ${Ot.maxInputSegments} path segments; simplify it`);r.shapes.push({segments:wm(p,a),fill:b,fillRule:y});}},h=p=>{let b=(Ie(l)?l:1)*(Ie(p)?p:1);return b<=0?false:(b<1&&o.add("opacity"),true)};if(t.name!=="line"){let p=Fs(m.fill,m,n,o);p&&h(s)&&g(Cm(t),p,m.fillRule);}if(d>0&&m.stroke!=="none"){let p=Fs(m.stroke,m,n,o);if(p&&h(c)){let b=Vg(t,d);b?((i("stroke-dasharray")??"none")!=="none"&&o.add("dash"),g(b,p,t.name==="line"?"nonzero":"evenodd")):o.add("stroke");}}}function Jg(t,e){let n=c=>{let u=10**e;return Math.round(c*u)/u+0},o=c=>$(c,e),r="",a=0,i=0,l=0,s=0;for(let c of t){if(c.op==="Z"){r+="z",a=l,i=s;continue}let u=n(c.x),m=n(c.y);if(c.op==="M")r+=`m${o(u-a)} ${o(m-i)}`,l=u,s=m;else if(c.op==="L"){if(u===a&&m===i)continue;r+=m===i?`h${o(u-a)}`:u===a?`v${o(m-i)}`:`l${o(u-a)} ${o(m-i)}`;}else r+=`c${o(n(c.x1)-a)} ${o(n(c.y1)-i)} ${o(n(c.x2)-a)} ${o(n(c.y2)-i)} ${o(u-a)} ${o(m-i)}`;a=u,i=m;}return r}var t2=(t,e)=>t.x0<e.x1&&e.x0<t.x1&&t.y0<e.y1&&e.y0<t.y1;function e2(t){let e=[];for(let n of t){let o=Ge(n.segments);if(!o)continue;let r=e.at(-1);r&&r.shape.fill===n.fill&&r.shape.fillRule===n.fillRule&&!r.boxes.some(a=>t2(a,o))?(r.shape={...r.shape,segments:[...r.shape.segments,...n.segments]},r.boxes.push(o)):e.push({shape:n,boxes:[o]});}return e.map(n=>n.shape)}var Ts=t=>[Number.parseInt(t.slice(1,3),16),Number.parseInt(t.slice(3,5),16),Number.parseInt(t.slice(5,7),16)];function n2(t,e,n){let o=new Map;for(let i of t)o.set(i.fill,(o.get(i.fill)??0)+1);let r=new Map([...o.keys()].map(i=>[i,i])),a=0;for(;o.size>e;){let i=[...o.keys()],l=[i[0],i[1]],s=Number.POSITIVE_INFINITY;for(let d=0;d<i.length;d++)for(let g=d+1;g<i.length;g++){let h=Ts(i[d]),p=Ts(i[g]),b=Math.hypot(h[0]-p[0],h[1]-p[1],h[2]-p[2]);b<s&&(s=b,l=[i[d],i[g]]);}let[c,u]=l,[m,f]=(o.get(c)??0)>=(o.get(u)??0)?[c,u]:[u,c];o.set(m,(o.get(m)??0)+(o.get(f)??0)),o.delete(f);for(let[d,g]of r)g===f&&r.set(d,m);a++;}return a>0&&n.add("colors",a),r}var Mm=t=>{let[e,n,o]=Ts(t);return .2126*e+.7152*n+.0722*o>235};function r2(t,e={}){let n=new ks;try{let o=zg(t),r=xe(o);if(!r)throw new ot("No <svg> element found");let a=Jt(r.attrs.viewBox),[i,l,s,c]=[0,0,0,0];if(a.length===4&&a[2]>0&&a[3]>0?[i,l,s,c]=a:(s=dt(r,"width"),c=dt(r,"height")),!(Ie(s)&&Ie(c)&&s>0&&c>0))throw new ot("The SVG needs a viewBox (or a width and height)");let m=Ot.artboardSide/Math.max(s,c),f=Math.round(s*m*10)/10,d=Math.round(c*m*10)/10;if(Math.min(f,d)<at.minArtboard)throw new ot("The artboard is too narrow: its sides may differ by 20 times at most");let g=[m,0,0,m,-i*m,-l*m],h={shapes:[],qrBox:null,segments:0};Em(r,{matrix:g,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,color:"#000000",opacity:1},qg(r),n,h);let p={x0:0,y0:0,x1:f,y1:d},b=Math.max(f,d)*.004,y=[],_=0,w=0;for(let O of h.shapes){let N=Ge(O.segments);if(!N||N.x1<=0||N.y1<=0||N.x0>=f||N.y0>=d){_++;continue}if(N.x0<-b||N.y0<-b||N.x1>f+b||N.y1>d+b){let _t=qr(O.segments,.25).map(At=>xn(At,p)).filter(At=>At.length>2);if(_t.length===0){_++;continue}w++,y.push({...O,segments:_t.flatMap(At=>Ns(At))});}else y.push(O);}if(_>0&&n.add("outside",_),w>0&&n.add("clipped",w),y.length===0)throw new ot("The SVG has no filled shapes to use");let C=n2(y,Ot.maxColors,n);for(let O of y)O.fill=C.get(O.fill)??O.fill;let S=new Map,x=new Map;for(let O of y){let N=Ge(O.segments);S.set(O.fill,(S.get(O.fill)??0)+(N.x1-N.x0)*(N.y1-N.y0)),x.set(O.fill,(x.get(O.fill)??0)+1);}let M=[...S.keys()].sort((O,N)=>Number(Mm(O))-Number(Mm(N))||S.get(N)-S.get(O)),R=M[0],E=M[1],v=O=>O===R?"frame":O===E?"accent":O,I=h.qrBox;if(!I&&e.qr){let[O,N]=V(g,e.qr.x,e.qr.y);I={x0:O,y0:N,x1:O+e.qr.size*m,y1:N+e.qr.size*m};}let L,T,F;I?(L=Math.min(I.x1-I.x0,I.y1-I.y0),T=(I.x0+I.x1-L)/2,F=(I.y0+I.y1-L)/2):(n.add("qr-placed"),L=Math.min(f,d)*.6,T=(f-L)/2,F=(d-L)/2);let k=O=>Math.round(O*10)/10+0;if(L=Math.floor(L*10)/10,T=k(T),F=k(F),L<Math.min(f,d)*at.minQrShare)throw new ot("The QR area must be at least half the frame's shorter side");let q=Math.min(T,F,f-T-L,d-F-L);if(q<L*at.minPadding-1e-9)throw new ot("Leave room around the QR area: at least 4% of its size on every side, inside the artboard");let H=Math.min(Math.max(e.padding??Ot.padding,at.minPadding),.2),G=Math.floor(Math.min(L*H,q)*10)/10,U=e2(y);if(U.length>at.maxShapes)throw new ot(`The artwork has ${U.length} separate shapes; the limit is ${at.maxShapes}. Combine shapes of the same color first`);let Z={kind:Kn,version:Jn,artboard:{width:f,height:d},qr:{x:T,y:F,size:L,padding:G},colors:{frame:R,...E&&{accent:E}},shapes:U.map(O=>({type:"path",d:Jg(O.segments,Ot.decimals),fill:v(O.fill),...O.fillRule==="evenodd"&&{fillRule:"evenodd"}})),labels:[]},rt=Kr(Z);if(!rt.success){let O=rt.issues[0];throw new ot(`The converted frame doesn't fit the frame format: ${O?.message??"invalid"}`)}let W=M.map(O=>({color:O,ref:O===R?"frame":O===E?"accent":"fixed",shapes:x.get(O)??0}));return {ok:!0,spec:rt.data,warnings:n.list(),palette:W}}catch(o){return {ok:false,error:o instanceof ot?o.message:`Could not read the SVG (${o instanceof Error?o.name:"error"})`,warnings:n.list()}}}var o2=1114,a2={"call-to-action":134,holidays:283,seasons:60,"food-drink":71,shopping:64,"beauty-wellness":26,events:77,places:71,"real-estate":35,automotive:27,"health-learning":48,"sports-fitness":36,business:82,nonprofit:28,objects:28,playful:44};var i2=[{id:"call-to-action",label:"Call to action"},{id:"holidays",label:"Holidays"},{id:"seasons",label:"Seasons"},{id:"food-drink",label:"Food & drink"},{id:"shopping",label:"Shops & packaging"},{id:"beauty-wellness",label:"Beauty & wellness"},{id:"events",label:"Events & weddings"},{id:"places",label:"Places & Wi-Fi"},{id:"real-estate",label:"Real estate"},{id:"automotive",label:"Cars & parking"},{id:"health-learning",label:"Health & learning"},{id:"sports-fitness",label:"Sports & fitness"},{id:"business",label:"Business & social"},{id:"nonprofit",label:"Nonprofits & community"},{id:"objects",label:"Everyday objects"},{id:"playful",label:"Playful & surprising"}];function Os(t){return Array.isArray(t)?`[${t.map(Os).join(",")}]`:t&&typeof t=="object"?`{${Object.keys(t).filter(n=>t[n]!==void 0).sort().map(n=>`${JSON.stringify(n)}:${Os(t[n])}`).join(",")}}`:JSON.stringify(t)}function s2(t){let e=Os(t),n=2166136261;for(let o=0;o<e.length;o++)n^=e.charCodeAt(o),n=Math.imul(n,16777619)>>>0;return n.toString(16).padStart(8,"0")}function l2(t,e){return ut.QrCode.encodeText(t,$t[e??Kt]).size}function Am(t,e,n,o=n.size*(e?.size??wa)){let r={src:t,width:o,height:o,excavate:true,...e?.shape&&e.shape!=="square"&&{shape:e.shape},...e?.plate&&{plate:e.plate}},a=e?.x!==void 0||e?.y!==void 0;if(!(e?.padding||a))return r;let i=l2(n.value,n.level),l=Rt(i,n.margin,n.shape),s=n.size/(i+2*l);if(e.padding&&(r.padding=e.padding*s),a){let c=i*s,u=m=>Math.min(Math.max((m??.5)*c-o/2,0),c-o);r.x=u(e.x),r.y=u(e.y);}return r}function Pm(t,e,n,o){let r=n.level??Kt,a=r;o&&(a=Et({...n,imageSettings:Am(t,e,n),autoLevel:o}));let i=s=>{let c=m=>Am(t,e,{...n,level:s},m),u=Zi(n,[s],c().width,c);return u>0?c(u):void 0};if(a===r)return i(r);let l=i(a);return l&&Et({...n,imageSettings:l,autoLevel:o})===a?l:i(r)}function c2({value:t,level:e,margin:n,shape:o,autoLevel:r,logoOptions:a}){let l=Pm("data:,",{...a,size:Sa},{value:`${t}`,size:1024,margin:n??ft,level:e,shape:o},r);return l?l.width/1024:0}function Ds({value:t,size:e=1024,fgColor:n,bgColor:o,eyeColor:r,dotColor:a,bodyPattern:i,hideLogo:l,logo:s,logoOptions:c,margin:u,cornerEyePattern:m,cornerEyeDotPattern:f,level:d,templateId:g,frame:h,eyeColors:p,moduleScale:b,autoLevel:y,shape:_,eyeShapes:w,eyeGradient:C,bgRadius:S,backdrop:x,halo:M,shadow:R}){let E={value:`${t}`,size:e,margin:u??ft,level:d,shape:_},v=!l&&s?Pm(s,c,E,y):void 0;return {value:E.value,bgColor:o,fgColor:n,eyeColor:r,dotColor:a,bodyPattern:i,cornerEyePattern:m,cornerEyeDotPattern:f,level:d,templateId:g,size:e,margin:u,...h&&{frame:h},...p&&{eyeColors:p},...b!==void 0&&{moduleScale:b},...y&&{autoLevel:y},..._&&_!=="square"&&{shape:_},...w&&{eyeShapes:w},...C&&C!=="corner"&&{eyeGradient:C},...S&&{bgRadius:S},...x&&{backdrop:x},...M&&{halo:M},...R&&{shadow:R},...v&&{imageSettings:v}}}var vm=.06,Im=.16,Lm=512;function km(t){let{width:e,height:n}=t;if(!(e>0&&n>0)||t.data.length<e*n*4)return null;let o=Uint8Array.from(t.data),r=gi({width:e,height:n,data:o});if(!r)return null;let a=d=>{let g=d*4;return Math.hypot(o[g]/255-r[0],o[g+1]/255-r[1],o[g+2]/255-r[2])},i=new Uint8Array(e*n),l=new Int32Array(e*n),s=0,c=0,u=d=>{i[d]||o[d*4+3]===0||a(d)>=Im||(i[d]=1,l[c++]=d);};for(let d=0;d<e;d++)u(d),u((n-1)*e+d);for(let d=0;d<n;d++)u(d*e),u(d*e+e-1);for(;s<c;){let d=l[s++],g=d%e;g>0&&u(d-1),g<e-1&&u(d+1),d>=e&&u(d-e),d<(n-1)*e&&u(d+e);}let m=new Uint8ClampedArray(o),f=r;for(let d=0;d<e*n;d++){if(!i[d])continue;let g=Math.min(1,Math.max(0,(a(d)-vm)/(Im-vm))),h=d*4;if(m[h+3]=Math.round(o[h+3]*g),g>0&&g<1)for(let p=0;p<3;p++){let y=(o[h+p]/255-(1-g)*f[p])/g;m[h+p]=Math.round(Math.min(1,Math.max(0,y))*255);}}return {width:e,height:n,data:m}}async function u2(t){if(typeof document>"u"||typeof Image>"u")throw new Error("removeLogoBackground needs a browser (canvas)");let e=await new Promise(l=>{let s=new Image;s.crossOrigin="anonymous",s.onload=()=>l(s),s.onerror=()=>l(null),s.src=t;});if(!e)return null;let n=e.naturalWidth||512,o=e.naturalHeight||512,r=Math.min(1,Lm/Math.max(n,o)),a=document.createElement("canvas");a.width=Math.max(1,Math.round(n*r)),a.height=Math.max(1,Math.round(o*r));let i=a.getContext("2d",{willReadFrequently:true});if(!i)return null;try{i.drawImage(e,0,0,a.width,a.height);let l=i.getImageData(0,0,a.width,a.height),s=km(l);return s?(l.data.set(s.data),i.putImageData(l,0,0),a.toDataURL("image/png")):null}catch{return null}finally{a.remove();}}var m2={value:true,size:true,level:true,bgColor:true,fgColor:true,eyeColor:true,dotColor:true,bodyPattern:true,cornerEyePattern:true,cornerEyeDotPattern:true,margin:true,style:true,imageSettings:true,isOGContext:true,templateId:true,customTemplate:true,customProps:true,frame:true,art:true,eyeColors:true,moduleScale:true,autoLevel:true,shape:true,eyeShapes:true,eyeGradient:true,bgRadius:true,backdrop:true,halo:true,shadow:true,frameLabelMarkers:true,partMarkers:true,hideLogo:true,logo:true,logoOptions:true,scale:true};function d2(t){let e={};for(let n of Object.keys(t))Object.hasOwn(m2,n)||(e[n]=t[n]);return e}var Bs=["value","fgColor","hideLogo","bgColor","eyeColor","dotColor","bodyPattern","cornerEyePattern","cornerEyeDotPattern","level","templateId","logo","logoOptions","margin","autoLevel","shape","eyeShapes","eyeGradient","bgRadius","backdrop","halo","shadow"];function Zo(t){let e=Object.fromEntries(Bs.map(n=>[n,t[n]]));return Ds({...e,margin:t.margin??ft})}function Yo(t,e){let{size:n=it,scale:o=1,level:r,style:a,customTemplate:i,customProps:l,frame:s,art:c,eyeColors:u,moduleScale:m,autoLevel:f,shape:d,frameLabelMarkers:g,partMarkers:h}=t,p={...e.eyeShapes&&{eyeShapes:e.eyeShapes},...e.eyeGradient&&{eyeGradient:e.eyeGradient},...e.bgRadius&&{bgRadius:e.bgRadius},...e.backdrop&&{backdrop:e.backdrop},...e.halo&&{halo:e.halo},...e.shadow&&{shadow:e.shadow}},b=n*o,y=b/e.size,_=e.imageSettings&&{...e.imageSettings,height:e.imageSettings.height*y,width:e.imageSettings.width*y,...e.imageSettings.x!=null&&{x:e.imageSettings.x*y},...e.imageSettings.y!=null&&{y:e.imageSettings.y*y},...e.imageSettings.padding!=null&&{padding:e.imageSettings.padding*y}};return {art:c,bgColor:e.bgColor,bodyPattern:e.bodyPattern,cornerEyeDotPattern:e.cornerEyeDotPattern,cornerEyePattern:e.cornerEyePattern,customProps:l,customTemplate:i,dotColor:e.dotColor,eyeColor:e.eyeColor,fgColor:e.fgColor,frame:s,level:r||e.level,margin:e.margin,...u&&{eyeColors:u},...m!==void 0&&{moduleScale:m},...f&&{autoLevel:f},...d&&d!=="square"&&{shape:d},...p,...g&&{frameLabelMarkers:g},...h&&{partMarkers:h},size:b,style:a,templateId:e.templateId,value:e.value,..._&&{imageSettings:_},...d2(t)}}function f2(t){return Yo(t,Zo(t))}function Fm(t,e){let n=[],o=r=>{if(r==null||typeof r=="boolean")return;if(typeof r=="string"||typeof r=="number"||typeof r=="bigint"){n.push(`${r}`);return}if(Array.isArray(r)){for(let c of r)o(c);return}if(!Oe(r))throw new TypeError("qrdx: can't render this value");let{type:a,props:i,key:l}=r;if(bn(a)){o(i.children);return}if(typeof a=="function"){o(a(i));return}let s={};for(let c of Object.keys(i)){let u=Hn(c,i[c]);u&&(s[u.name]=u.value);}n.push(e(a,s,Fm(i.children,e),l));};return o(t),n}var Wn=300,Lr=t=>{let e=typeof t=="number"?t:Number.parseFloat(String(t));return Number.isFinite(e)?e:void 0};function h2(t){let e=Lr(t.x)??0,n=Lr(t.y)??0,o=Jt(typeof t.viewBox=="string"?t.viewBox:void 0),r=Lr(t.width),a=Lr(t.height);if(o.length!==4||!(o[2]&&o[3]&&r&&a))return [1,0,0,1,e,n];let[i,l,s,c]=o,u=Math.min(r/s,a/c);return [u,0,0,u,e+(r-s*u)/2-i*u,n+(a-c*u)/2-l*u]}function Gs(t,e,n,o){if(t===e)return n;if(Array.isArray(t)){for(let l of t){let s=Gs(l,e,n,false);if(s)return s}return null}let r=t;if(!r||typeof r!="object"||!r.props)return null;let{props:a}=r,i=ct(n,Ut(typeof a.transform=="string"?a.transform:void 0));return r.type==="svg"&&!o&&(i=ct(i,h2(a))),Gs(a.children,e,i,false)}function Qs(t){let e=t.customTemplate||(t.templateId?xo(t.templateId):void 0);if(!e)return 1;let n={type:"svg",props:{height:Wn,viewBox:`0 0 ${Wn} ${Wn}`,width:Wn},key:null},o;try{o=e.wrapper(n,{fgColor:typeof t.fgColor=="string"?t.fgColor:void 0,bgColor:typeof t.bgColor=="string"?t.bgColor:void 0,...t.customProps??{}},{pixelSize:10,url:t.value});}catch{return 1}let r=o?.props;if(!r)return 1;let a=Jt(typeof r.viewBox=="string"?r.viewBox:void 0),i=a.length===4?a[2]:Lr(r.width),l=Gs(o,n,Sn,true);if(!(l&&i))return 1;let[s,c]=V(l,0,0),[u,m]=V(l,Wn,Wn),d=Math.min(Math.abs(u-s),Math.abs(m-c))/i;return d>0&&d<=1?d:1}var Qm=[96,160,320],Hs=640;function qs(){if(typeof document>"u")throw new Error("Scan scoring needs a browser (canvas + image decoding)")}function ke(t){if(t?.aborted)throw new DOMException("Scan scoring was aborted","AbortError")}var Um=()=>new Promise(t=>setTimeout(t,0));async function Ws(){let{default:t}=await import('jsqr');return t}function zs(t,e){if(!t)return false;if(t.data===e)return true;try{return new TextDecoder().decode(Uint8Array.from(t.binaryData))===e}catch{return false}}function p2(t,e,n=.7){let{data:o,width:r,height:a}=t;for(let u=0;u<o.length;u+=4)for(let m=0;m<3;m++)o[u+m]=128+(o[u+m]-128)*n;let i=Math.max(1,Math.round(e*.25)),l=2*i+1,s=new Float32Array(r*a*3),c=u=>{let m=u?a:r,f=u?r:a,d=u?r:1,g=u?1:r;for(let h=0;h<m;h++){let p=h*d,b=0,y=0,_=0;for(let w=-i;w<=i;w++){let C=(p+Math.min(Math.max(w,0),f-1)*g)*4;b+=o[C],y+=o[C+1],_+=o[C+2];}for(let w=0;w<f;w++){let C=(p+w*g)*3;s[C]=b/l,s[C+1]=y/l,s[C+2]=_/l;let S=(p+Math.max(w-i,0)*g)*4,x=(p+Math.min(w+i+1,f-1)*g)*4;b=b-o[S]+o[x],y=y-o[S+1]+o[x+1],_=_-o[S+2]+o[x+2];}}for(let h=0,p=0;h<r*a*3;h+=3,p+=4)o[p]=s[h],o[p+1]=s[h+1],o[p+2]=s[h+2];};for(let u=0;u<2;u++)c(true),c(false);}function Vn(t,e){let n=document.createElement("canvas");n.width=Math.max(1,Math.round(t)),n.height=Math.max(1,Math.round(e));let o=n.getContext("2d",{willReadFrequently:true});if(!o)throw new Error("Could not get canvas context");return o.imageSmoothingEnabled=true,o.imageSmoothingQuality="high",{canvas:n,ctx:o}}var g2=[.9,1,1.1];function Vs(t,e,n,o,r){let a=0;for(let i of g2){let l=n*i,s=e(l);p2(s,l/o),r(t(s.data,s.width,s.height))&&a++;}return a>=2?"pass":a===1?"fragile":"fail"}var Us={small:"small print or far away",medium:"typical phone distance",large:"close up"};function b2(t,e){return t===e[0]&&e.length>1?Us.small:t===e.at(-1)?Us.large:Us.medium}function Hm(t,e,n){if(n==="pass")return 0;let o=e===1?[45]:e===2?[20,45]:[15,20,45],r=o[Math.round(t*(o.length-1)/Math.max(e-1,1))]??20;return n==="fragile"?Math.round(r/2):r}function zm(t,e,n){let o=`${t} px (${b2(t,e)})`;return n==="pass"?{id:`decode-${t}`,passed:true,message:`Reads at ${o}, with camera blur`}:{id:`decode-${t}`,passed:false,message:n==="fragile"?`Reads at ${o} only some of the time`:`Doesn't read at ${o}`,fix:t===e[0]?"Print it bigger, shorten the content (fewer modules) or use solid square dots":"Raise the contrast, use bigger dots or a simpler eye shape"}}function qm(t,e){return e?"fails":t>=85?"great":t>=65?"ok":"risky"}function y2(t,e,n){let o=Lt(t,e);if(o.type==="solid")return [o.color];if(o.type!=="image")return o.stops.map(l=>l.color);let r=o.underlay?Jo(o.underlay):null,a=n?.[o.src];if(!a)return o.underlay?[o.underlay]:[];let i=o.opacity??1;return [a.light,a.dark].flatMap(l=>{let s=Jo(l);if(!s)return [];let c={...s,a:s.a*i};if(!r)return [Tm(c)];let u=c.a+r.a*(1-c.a),m=(f,d)=>u>0?(f*c.a+d*r.a*(1-c.a))/u:0;return [Tm({r:m(c.r,r.r),g:m(c.g,r.g),b:m(c.b,r.b),a:u})]})}var Tm=({r:t,g:e,b:n,a:o})=>`rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(n)}, ${Math.round(o*1e3)/1e3})`;function _2(t){let e=[],n=t.width*t.height;for(let a=0;a<n;a++){let i=t.data[a*4],l=t.data[a*4+1],s=t.data[a*4+2];t.data[a*4+3]<128||e.push({lum:Qn(i,l,s),r:i,g:l,b:s});}if(e.length===0)return null;e.sort((a,i)=>a.lum-i.lum);let o=Math.max(1,Math.round(e.length/10)),r=a=>{let i=a.reduce((s,c)=>({r:s.r+c.r,g:s.g+c.g,b:s.b+c.b}),{r:0,g:0,b:0}),l=s=>Math.round(s/a.length).toString(16).padStart(2,"0");return `#${l(i.r)}${l(i.g)}${l(i.b)}`};return {dark:r(e.slice(0,o)),light:r(e.slice(-o))}}async function x2(t){qs();let e=await Tr(t),{canvas:n,ctx:o}=Vn(64,64);o.drawImage(e,0,0,64,64);let r=_2(o.getImageData(0,0,64,64));return n.remove(),r}function Wm(t){let e=[t.bgColor,t.fgColor,t.eyeColor,t.dotColor,...Be.flatMap(o=>[t.eyeColors?.[o]?.outer,t.eyeColors?.[o]?.inner])],n=new Set;for(let o of e)typeof o=="object"&&o?.type==="image"&&n.add(o.src);return [...n]}var kr=null;function Jo(t){let e=lt(t);if(e||typeof document>"u")return e;if(kr??=document.createElement("canvas").getContext("2d"),!kr)return null;kr.fillStyle="#010203",kr.fillStyle=t;let n=String(kr.fillStyle);return n==="#010203"?null:lt(n)}var Nm=t=>Qn(t.r,t.g,t.b),Vm=(t,e)=>(Math.max(t,e)+.05)/(Math.min(t,e)+.05),Fr=4.5,$2=3,Om=1.5,Dm={code:7,background:12},Bm={r:255,g:255,b:255,a:1},Gm=(t,e)=>({r:t.r*t.a+e.r*(1-t.a),g:t.g*t.a+e.g*(1-t.a),b:t.b*t.a+e.b*(1-t.a),a:1});function S2(t,e={}){let n=e.imageTones,o=(g,h)=>{let p=typeof g=="object"&&g?.type==="image";return y2(g,h,n).map(b=>({color:b,picture:p}))},r=t.fgColor??Mt,a=Be.flatMap(g=>{let h=t.eyeColors?.[g];return [...h?.outer?o(h.outer,Mt):[],...h?.inner?o(h.inner,Mt):[]]}),i=[...o(r,Mt),...o(t.eyeColor??r,Mt),...o(t.dotColor??r,Mt),...a],l=o(t.bgColor,mt),s=yr(t.halo,t)?.color;s&&l.push({color:s,picture:false});let c=(l.length>0?l:[{color:"#ffffff",picture:false}]).map(g=>{let h=Jo(g.color);return {color:h?Gm(h,Bm):Bm,picture:g.picture}}),u=i.flatMap(g=>{let h=Jo(g.color);return h?[{color:h,picture:g.picture}]:[]}),m=Number.POSITIVE_INFINITY,f=Fr,d=false;for(let g of u)for(let h of c){let p=Nm(Gm(g.color,h.color)),b=Nm(h.color),y=Vm(p,b),_=h.picture?Dm.background:g.picture?Dm.code:Fr;y/_<m/f&&(m=y,f=_),p>b&&(d=true);}return {ratio:Number.isFinite(m)?m:Number.POSITIVE_INFINITY,required:f,inverted:d}}function w2(t,e){let{ratio:n,inverted:o,required:r}=S2(t,{imageTones:e});if(!Number.isFinite(n))return {checks:[],penalty:0,fails:false};let a=r/Fr,i=r!==Fr,l=Math.round(n*10)/10,s=[],c=0;return n>=r?s.push({id:"contrast",passed:true,message:`Contrast ${l}:1 between code and background`}):(c=n<Om*a?60:n<$2*a?30:10,s.push({id:"contrast",passed:false,message:i?`Low contrast for a picture (${l}:1); ${r}:1 or more scans reliably`:`Low contrast (${l}:1); 4.5:1 or more scans reliably`,fix:i?"Lower the picture's opacity over a darker underlay (dots) or a lighter one (background)":"Use a darker code color or a lighter background"})),o?(c+=10,s.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):s.push({id:"polarity",passed:true,message:"Dark code on a light background"}),{checks:s,penalty:c,fails:n<Om*(r/Fr)}}function Xs(t){return ut.QrCode.encodeText(t.value,$t[Et(t)]).getModules()}function C2(t){let{imageSettings:e}=t;if(!e)return {check:null,penalty:0};let n=Xs(t),o=Ae(n,t.size??it,Rt(n.length,t.margin??ft,t.shape),e);if(!o)return {check:null,penalty:0};let r=o.excavation??o,a=n.length,l=[[0,0],[a-8,0],[0,a-8]].some(([g,h])=>r.x<g+9&&r.x+r.w>g&&r.y<h+9&&r.y+r.h>h),s=a>21?a-9:null,c=s!==null&&r.x<s+5&&r.x+r.w>s&&r.y<s+5&&r.y+r.h>s;if(l||c)return {check:{id:"logo",passed:false,message:l?"The logo covers a corner eye":"The logo covers the small square near the bottom-right corner",fix:"Move the logo toward the center or make it smaller"},penalty:40};let u=r.w*r.h/(a*a),m=Et(t),f=Math.round(u*100),d=Mo({value:t.value,size:t.size??it,margin:t.margin??ft,level:m,shape:t.shape},e);return !d||d.worst<=d.budget?{check:{id:"logo",passed:true,message:`Logo covers ${f}% of the code; error correction repairs it with room to spare`},penalty:0}:{check:{id:"logo",passed:false,message:`Logo covers ${f}% of the code and spoils ${d.worst} codewords in one block, which repairs ${d.correctable}`,fix:d.level==="H"?"Use a smaller logo":"Switch error correction to H or use a smaller logo"},penalty:d.worst>d.correctable?25:10}}function M2(t){let e=pr(t.shape)?Xe(t.margin??ft):t.margin??ft,n=Xs(t).length+2*e,o=e+(Tt(t.frame)?ui(t.frame)*n:0),r=Math.round(o*10)/10;return o>=4?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${r} modules`},penalty:0}:o>=1.5?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${r} modules (4 is ideal)`},penalty:0}:{check:{id:"quiet-zone",passed:false,message:"No quiet zone around the code",fix:"Leave clear space (about 10% of the code width) around it wherever you place it, or add a frame"},penalty:5}}function R2(t){let e=_o(t);return e?{check:{id:"halo",passed:false,message:e.message,fix:e.fix},penalty:15}:{check:null,penalty:0}}function E2(t){let e=Fi(t);return e==="curly"?{check:{id:"eye-shape",passed:false,message:"Curly eyes fail strict decoders such as ZXing-based apps",fix:"Pick square, rounded or gear eyes"},penalty:40}:e==="circle"?{check:{id:"eye-shape",passed:false,message:"Circle eyes only read in lenient decoders; many apps miss them",fix:"Pick square, rounded or gear eyes"},penalty:20}:{check:{id:"eye-shape",passed:true,message:`No known decoder issues with ${e} eyes`},penalty:0}}function Tr(t){return new Promise((e,n)=>{let o=new Image;o.crossOrigin="anonymous",o.onload=()=>e(o),o.onerror=()=>n(new Error("Could not load image")),o.src=t;})}var A2=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><rect width="10" height="10" rx="2" fill="#808080"/></svg>')}`;async function P2(t){let{imageSettings:e}=t;if(!e||e.src.startsWith("data:"))return t;let n=A2;try{let o=await Tr(e.src),{canvas:r,ctx:a}=Vn(o.naturalWidth||256,o.naturalHeight||256);a.drawImage(o,0,0,r.width,r.height),n=r.toDataURL("image/png");}catch{}return {...t,imageSettings:{...e,src:n}}}async function v2(t){let e=new Map;for(let r of Wm(t))if(!r.startsWith("data:"))try{let a=await Tr(r),{canvas:i,ctx:l}=Vn(a.naturalWidth||256,a.naturalHeight||256);l.drawImage(a,0,0,i.width,i.height),e.set(r,i.toDataURL("image/png")),i.remove();}catch{e.set(r,null);}if(e.size===0)return t;let n=r=>{if(typeof r!="object"||r?.type!=="image")return r;let a=e.get(r.src);return a===void 0?r:a?{...r,src:a}:r.underlay??Mt},o=t.eyeColors?Object.fromEntries(Object.entries(t.eyeColors).map(([r,a])=>[r,a&&{outer:n(a.outer),inner:n(a.inner)}])):void 0;return {...t,bgColor:n(t.bgColor),fgColor:n(t.fgColor),eyeColor:n(t.eyeColor),dotColor:n(t.dotColor),...o&&{eyeColors:o}}}async function Xm(t,e,n,o,r){let a=[],i=0,l=w2(t,r);i+=l.penalty;let s=C2(t);i+=s.penalty;let c=M2(t);i+=c.penalty;let u=E2(t);i+=u.penalty;let m=R2(t);i+=m.penalty;let f=Ti(t),d=f?.kind==="eye"?null:f;d&&d.kind!=="sharp-dot-eye"&&(i+=10);let g=await Ws();ke(o);let h=Xs(t).length,p=h+2*Rt(h,t.margin??ft,t.shape),b=[],y=false;for(let[C,S]of n.entries()){await Um(),ke(o);let x=Vs(g,e,S,p,M=>zs(M,t.value));i+=Hm(C,n.length,x),b.push(zm(S,n,x)),C===n.length-1&&x==="fail"&&(y=true);}a.push(...b,...l.checks),s.check&&a.push(s.check),a.push(u.check,c.check),m.check&&a.push(m.check),d&&a.push({id:"style-pair",passed:false,message:d.message,fix:d.fix});let _=y||l.fails,w=Math.max(0,Math.min(100,100-i));return _&&(w=Math.min(w,30)),{score:w,grade:qm(w,_),checks:a}}function jm(t){return [...t.sizes??Qm].filter(e=>e>0).sort((e,n)=>e-n)}async function f6(t,e={}){qs();let{signal:n}=e,o=jm(e),r=Hs/Qs(t),a=await v2(await P2(ve({...t,size:t.size??it},r)));ke(n);let i={};for(let m of Wm(t))try{let f=await x2(m);f&&(i[m]=f);}catch{}ke(n);let l=await jt(a),s=await Tr(l);ke(n);let c=ue(r,t.frame);return await Xm(t,m=>{let f=m/Hs,d=c.width*f,g=c.height*f,h=Math.max(8,Math.round(m*.12)),{canvas:p,ctx:b}=Vn(d+2*h,g+2*h);b.fillStyle="#ffffff",b.fillRect(0,0,p.width,p.height),b.drawImage(s,h,h,d,g);let y=b.getImageData(0,0,p.width,p.height);return p.remove(),y},o,n,i)}var h6=Hs;async function p6(t,e,n={}){let{width:o,height:r}=e;if(!(o>0&&r>0)||e.data.length<o*r*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=jm(n),i=t.size??it,l=ue(i,t.frame),s=o*i*Qs(t)/l.width,c={data:I2(e),width:o,height:r};return await Xm(t,m=>{let f=Zm(c,m/s),d=Math.max(8,Math.round(m*.12));return L2(f,d)},a,n.signal)}function I2(t){let{data:e,width:n,height:o}=t,r=new Uint8ClampedArray(n*o*4);for(let a=0;a<n*o*4;a+=4){let i=e[a+3]/255;for(let l=0;l<3;l++)r[a+l]=e[a+l]*i+255*(1-i);r[a+3]=255;}return r}function L2(t,e){let n=t.width+2*e,o=t.height+2*e,r=new Uint8ClampedArray(n*o*4).fill(255);for(let a=0;a<t.height;a++)r.set(t.data.subarray(a*t.width*4,(a+1)*t.width*4),((a+e)*n+e)*4);return {data:r,width:n,height:o,colorSpace:"srgb"}}var Le=(t,e)=>Math.hypot(t.x-e.x,t.y-e.y);function Ko(t,e){return .299*t[e]+.587*t[e+1]+.114*t[e+2]}function k2(t,e){let n=0;for(let l=0;l<256;l++)n+=l*t[l];let o=0,r=0,a=0,i=128;for(let l=0;l<256;l++){if(r+=t[l],r===0)continue;let s=e-r;if(s===0)break;o+=l*t[l];let c=o/r,u=(n-o)/s,m=r*s*(c-u)**2;m>a&&(a=m,i=l);}return i}async function F2(t){if(!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=URL.createObjectURL(t);try{let n=await Tr(e);return await n.decode?.().catch(()=>{}),n}finally{setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function g6(t,e={}){qs();let{signal:n}=e,o=[...e.sizes??Qm].filter(Q=>Q>0).sort((Q,B)=>Q-B),r=await Ws(),a=await F2(t);ke(n);let i=a.naturalWidth||a.width,l=a.naturalHeight||a.height;if(!(i&&l))throw new Error("Could not read this image");let s=Math.min(1,1600/Math.max(i,l)),{canvas:c,ctx:u}=Vn(i*s,l*s);u.fillStyle="#ffffff",u.fillRect(0,0,c.width,c.height),u.drawImage(a,0,0,c.width,c.height);let m=u.getImageData(0,0,c.width,c.height),f=r(m.data,m.width,m.height);if(ke(n),!f){let Q=await w0(a,0,false);return c.remove(),typeof Q!="string"||Q==="NO_QR"?{data:null,version:null,score:0,grade:"fails",checks:[{id:"decode",passed:false,message:"No QR code found in this image",fix:"Try a sharper, well-lit, straight-on photo or a screenshot"}]}:{data:Q,version:null,score:55,grade:"risky",checks:[{id:"decode",passed:false,message:"Decoded only after cropping; the code is small or hard to find in this image",fix:"Make the code bigger relative to its surroundings"}]}}let{location:d,version:g}=f,h=17+4*g,p=(Le(d.topLeftCorner,d.topRightCorner)+Le(d.bottomLeftCorner,d.bottomRightCorner)+Le(d.topLeftCorner,d.bottomLeftCorner)+Le(d.topRightCorner,d.bottomRightCorner))/4,b=p/h,y=[d.topLeftCorner,d.topRightCorner,d.bottomRightCorner,d.bottomLeftCorner],_=Math.max(0,Math.floor(Math.min(...y.map(Q=>Q.x)))),w=Math.min(m.width,Math.ceil(Math.max(...y.map(Q=>Q.x)))),C=Math.max(0,Math.floor(Math.min(...y.map(Q=>Q.y)))),S=Math.min(m.height,Math.ceil(Math.max(...y.map(Q=>Q.y)))),x=[],M=0,R=new Array(256).fill(0),E=0;for(let Q=C;Q<S;Q++)for(let B=_;B<w;B++){let Y=Math.round(Ko(m.data,(Q*m.width+B)*4));R[Y]=R[Y]+1,E++;}let v=k2(R,E),I={dark:[0,0,0,0],light:[0,0,0,0]};for(let Q=C;Q<S;Q++)for(let B=_;B<w;B++){let Y=(Q*m.width+B)*4,pt=Ko(m.data,Y)<=v?I.dark:I.light;pt[0]=pt[0]+m.data[Y],pt[1]=pt[1]+m.data[Y+1],pt[2]=pt[2]+m.data[Y+2],pt[3]=pt[3]+1;}let L=Q=>{let B=Math.max(Q[3],1);return Qn(Q[0]/B,Q[1]/B,Q[2]/B)},T=L(I.dark),F=L(I.light),k=Vm(T,F),q=Math.round(k*10)/10;k>=4.5?x.push({id:"contrast",passed:true,message:`Contrast ${q}:1 in the image`}):(M+=k<2?30:10,x.push({id:"contrast",passed:false,message:`Low contrast in the image (${q}:1)`,fix:"Use a darker code on a lighter background, or better lighting for photos"}));let G=[d.topLeftFinderPattern,d.topRightFinderPattern,d.bottomLeftFinderPattern].map(Q=>{let B=Math.min(m.width-1,Math.max(0,Math.round(Q.x))),Y=Math.min(m.height-1,Math.max(0,Math.round(Q.y)));return Ko(m.data,(Y*m.width+B)*4)}).filter(Q=>Q>v).length>=2;G?(M+=10,x.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):x.push({id:"polarity",passed:true,message:"Dark code on a light background"});let U=Math.max(2,Math.round(b*2)),Z={minX:_-U,maxX:w+U,minY:C-U,maxY:S+U};if(Z.minX<0||Z.minY<0||Z.maxX>m.width||Z.maxY>m.height)x.push({id:"quiet-zone",passed:true,skipped:true,message:"The image is cropped too tight to check the quiet zone"});else {let Q=0,B=0;for(let Y=Z.minY;Y<Z.maxY;Y++)for(let pt=Z.minX;pt<Z.maxX;pt++){if(pt>=_&&pt<w&&Y>=C&&Y<S)continue;let oe=Ko(m.data,(Y*m.width+pt)*4);(G?oe>v:oe<=v)&&Q++,B++;}Q/Math.max(B,1)>.12?(M+=10,x.push({id:"quiet-zone",passed:false,message:"Something dark touches the code; the quiet zone isn't clear",fix:"Leave clear space (about 4 modules) around the code"})):x.push({id:"quiet-zone",passed:true,message:"Clear space around the code"});}b<2?x.push({id:"resolution",passed:false,message:`Low resolution: about ${Math.round(b*10)/10} px per module`,fix:"Use a larger image, or export the code at a bigger size"}):x.push({id:"resolution",passed:true,message:`About ${Math.round(b)} px per module`});let W=Math.round(b*4),O=Math.max(0,_-W),N=Math.max(0,C-W),_t=Math.min(m.width,w+W)-O,At=Math.min(m.height,S+W)-N,Fe=Q=>{let B=Q/p,Y=Vn(_t*B,At*B);Y.ctx.drawImage(c,O,N,_t,At,0,0,Y.canvas.width,Y.canvas.height);let pt=Y.ctx.getImageData(0,0,Y.canvas.width,Y.canvas.height);return Y.canvas.remove(),pt},Gt=[],Dt=false;for(let[Q,B]of o.entries()){await Um(),ke(n);let Y=Vs(r,Fe,B,h,pt=>pt?.data===f.data);M+=Hm(Q,o.length,Y),Gt.push(zm(B,o,Y)),Q===o.length-1&&Y==="fail"&&(Dt=true);}c.remove();let ht=Math.max(0,Math.min(100,100-M));return Dt&&(ht=Math.min(ht,30)),{data:f.data,version:g,score:ht,grade:qm(ht,Dt),checks:[...Gt,...x]}}var T2=[320];function Zm(t,e){let n=Math.min(1,e),o=Math.max(1,Math.round(t.width*n)),r=Math.max(1,Math.round(t.height*n)),a=new Uint8ClampedArray(o*r*4),i=t.width/o,l=t.height/r;for(let s=0;s<r;s++){let c=Math.floor(s*l),u=Math.max(c+1,Math.min(t.height,Math.floor((s+1)*l)));for(let m=0;m<o;m++){let f=Math.floor(m*i),d=Math.max(f+1,Math.min(t.width,Math.floor((m+1)*i))),g=0,h=0,p=0,b=0;for(let w=c;w<u;w++)for(let C=f;C<d;C++){let S=(w*t.width+C)*4;g+=t.data[S],h+=t.data[S+1],p+=t.data[S+2],b+=t.data[S+3];}let y=(u-c)*(d-f),_=(s*o+m)*4;a[_]=g/y,a[_+1]=h/y,a[_+2]=p/y,a[_+3]=b/y;}}return {data:a,width:o,height:r,colorSpace:"srgb"}}function N2(t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(Uint8Array.from(t.binaryData))}catch{return t.data}}async function b6(t,e,n={}){let{width:o,height:r}=t;if(!(o>0&&r>0)||t.data.length<o*r*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=await Ws(),i={data:t.data instanceof Uint8ClampedArray?t.data:Uint8ClampedArray.from(t.data),width:o,height:r},l=a(i.data,o,r,{inversionAttempts:"dontInvert"});if(!l)return {data:null,version:null,passed:false};let s=N2(l),{version:c,location:u}=l;if(!zs(l,e))return {data:s,version:c,passed:false};let m=17+4*c,f=(Le(u.topLeftCorner,u.topRightCorner)+Le(u.bottomLeftCorner,u.bottomRightCorner)+Le(u.topLeftCorner,u.bottomLeftCorner)+Le(u.topRightCorner,u.bottomRightCorner))/4;for(let d of n.sizes??T2)if(Vs(a,h=>Zm(i,h/f),d,m,h=>zs(h,e))!=="pass")return {data:s,version:c,passed:false};return {data:s,version:c,passed:true}}var O2=16,Ym=.01;function D2(t){let e=new Float64Array(256);for(let s of t)e[Math.min(255,Math.max(0,Math.round(s*255)))]++;let n=t.length,o=0;for(let s=0;s<256;s++)o+=s*e[s];let r=0,a=0,i=0,l=128;for(let s=0;s<256;s++){if(a+=e[s],a===0)continue;let c=n-a;if(c===0)break;r+=s*e[s];let u=r/a,m=(o-r)/c,f=a*c*(u-m)**2;f>i&&(i=f,l=s);}return (l+.5)/255}function B2(t,e){let{width:n,height:o,data:r}=t,a=n*o,i=new Uint8Array(a),l=0;for(let d=0;d<a;d++)r[d*4+3]<128&&l++;if(e==="alpha"||e==="auto"&&l>a*.02&&l<a*.98){for(let d=0;d<a;d++)i[d]=r[d*4+3]>=128?1:0;return i}let c=new Float32Array(a);for(let d=0;d<a;d++){let g=r[d*4+3]/255,h=.2126*r[d*4]+.7152*r[d*4+1]+.0722*r[d*4+2];c[d]=1-(h*g+255*(1-g))/255;}let u=D2(c);for(let d=0;d<a;d++)i[d]=c[d]>u?1:0;let m=0,f=0;for(let d=0;d<n;d++)for(let g of [0,o-1])m++,f+=i[g*n+d];for(let d=1;d<o-1;d++)for(let g of [0,n-1])m++,f+=i[d*n+g];if(f>m/2)for(let d=0;d<a;d++)i[d]=i[d]?0:1;return i}function Km(t,e,n,o){for(let r of [1,0]){let a=new Uint8Array(t.length);for(let i=0;i<t.length;i++){if(a[i]||t[i]!==r)continue;let l=[i];a[i]=1;let s=false;for(let u of l){let m=u%e,f=(u-m)/e;(m===0||f===0||m===e-1||f===n-1)&&(s=true);for(let[d,g]of [[m-1,f],[m+1,f],[m,f-1],[m,f+1]]){if(d<0||g<0||d>=e||g>=n)continue;let h=g*e+d;!a[h]&&t[h]===r&&(a[h]=1,l.push(h));}}if((r===1||!s)&&l.length<o)for(let u of l)t[u]=r?0:1;}}}function Jm(t,e={}){let{width:n,height:o,data:r}=t;if(!(n>0&&o>0)||r.length<n*o*4)throw new Error("Silhouette pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=B2(t,e.mode??"auto"),i=a.reduce((x,M)=>x+M,0);Km(a,n,o,Math.max(16,i*Ym));let l=n,s=o,c=-1,u=-1;for(let x=0;x<o;x++)for(let M=0;M<n;M++)a[x*n+M]&&(l=Math.min(l,M),s=Math.min(s,x),c=Math.max(c,M),u=Math.max(u,x));if(c<0)throw new Error("No shape found: use a picture with a dark or opaque shape on a light or clear background");let m=c-l+1,f=u-s+1;if(Math.max(m,f)<O2)throw new Error("The shape is too small to trace; use a bigger picture");let g=Math.min(Math.max(Math.round(e.cells??De),ye),De)/Math.max(m,f),h=Math.max(ye,Math.round(m*g)),p=Math.max(ye,Math.round(f*g)),b=Math.max(1,Math.round(m*g)),y=Math.max(1,Math.round(f*g)),_=Math.floor((h-b)/2),w=Math.floor((p-y)/2),C=new Uint8Array(h*p);for(let x=0;x<y;x++){let M=s+Math.floor(x*f/y),R=Math.max(M+1,s+Math.floor((x+1)*f/y));for(let E=0;E<b;E++){let v=l+Math.floor(E*m/b),I=Math.max(v+1,l+Math.floor((E+1)*m/b)),L=0;for(let T=M;T<R;T++)for(let F=v;F<I;F++)L+=a[T*n+F];C[(x+w)*h+E+_]=L*2>=(R-M)*(I-v)?1:0;}}let S=C.reduce((x,M)=>x+M,0);if(Km(C,h,p,Math.max(4,S*Ym)),!C.includes(1))throw new Error("The shape is too small to trace; use a bigger picture");return {type:"silhouette",width:h,height:p,cells:Array.from(C,x=>x?"1":"0").join("")}}var js=512;async function G2(t){if(typeof t!="string"&&!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=typeof t=="string"?t:URL.createObjectURL(t);try{return await new Promise((n,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>n(r),r.onerror=()=>o(new Error("Could not load the picture")),r.src=e;})}finally{typeof t!="string"&&setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function Q2(t,e={}){if(typeof document>"u")throw new Error("loadQRSilhouette needs a browser; pass decoded pixels to createQRSilhouette instead");let n=await G2(t),o=n.naturalWidth||n.width||js,r=n.naturalHeight||n.height||js,a=js/Math.max(o,r),i=Math.max(1,Math.round(o*a)),l=Math.max(1,Math.round(r*a)),s=document.createElement("canvas");s.width=i,s.height=l;let c=s.getContext("2d",{willReadFrequently:true});if(!c)throw new Error("Could not get a canvas context");c.drawImage(n,0,0,i,l);let u;try{u=c.getImageData(0,0,i,l);}catch{throw new Error("Could not read the picture (cross-origin images need CORS); upload it instead")}finally{s.remove();}return Jm(u,e)}function Zs(t){return gn(Un,()=>Cr(t))}var z2=react.memo(t=>{let e=react.useMemo(()=>Zo(t),Bs.map(n=>t[n]));return jsxRuntime.jsx(Zs,{...Yo(t,e)})});z2.displayName="QRCode";function W2({frame:t,size:e,bgColor:n,slot:o,...r}){let a=o;return gn(Un,()=>mi({frame:t,size:e,bgColor:n,slot:a,svgProps:r}))}/**
|
|
27
27
|
* @license QR Code generator library (TypeScript)
|
|
28
28
|
* Copyright (c) Project Nayuki.
|
|
29
29
|
* SPDX-License-Identifier: MIT
|
|
30
|
-
*/Object.defineProperty(exports,"angularGradientSchema",{enumerable:true,get:function(){return schemas_js.angularGradientSchema}});Object.defineProperty(exports,"anyFrameSchema",{enumerable:true,get:function(){return schemas_js.anyFrameSchema}});Object.defineProperty(exports,"baseTemplatePropsSchema",{enumerable:true,get:function(){return schemas_js.baseTemplatePropsSchema}});Object.defineProperty(exports,"bodyPatternSchema",{enumerable:true,get:function(){return schemas_js.bodyPatternSchema}});Object.defineProperty(exports,"colorConfigSchema",{enumerable:true,get:function(){return schemas_js.colorConfigSchema}});Object.defineProperty(exports,"colorTypeSchema",{enumerable:true,get:function(){return schemas_js.colorTypeSchema}});Object.defineProperty(exports,"cornerEyeDotPatternSchema",{enumerable:true,get:function(){return schemas_js.cornerEyeDotPatternSchema}});Object.defineProperty(exports,"cornerEyePatternSchema",{enumerable:true,get:function(){return schemas_js.cornerEyePatternSchema}});Object.defineProperty(exports,"customFrameSchema",{enumerable:true,get:function(){return schemas_js.customFrameSchema}});Object.defineProperty(exports,"errorLevelSchema",{enumerable:true,get:function(){return schemas_js.errorLevelSchema}});Object.defineProperty(exports,"excavationSchema",{enumerable:true,get:function(){return schemas_js.excavationSchema}});Object.defineProperty(exports,"eyeColorOverrideSchema",{enumerable:true,get:function(){return schemas_js.eyeColorOverrideSchema}});Object.defineProperty(exports,"eyeColorsSchema",{enumerable:true,get:function(){return schemas_js.eyeColorsSchema}});Object.defineProperty(exports,"eyeGradientSpanSchema",{enumerable:true,get:function(){return schemas_js.eyeGradientSpanSchema}});Object.defineProperty(exports,"eyeShapeOverrideSchema",{enumerable:true,get:function(){return schemas_js.eyeShapeOverrideSchema}});Object.defineProperty(exports,"eyeShapesSchema",{enumerable:true,get:function(){return schemas_js.eyeShapesSchema}});Object.defineProperty(exports,"frameSchema",{enumerable:true,get:function(){return schemas_js.frameSchema}});Object.defineProperty(exports,"frameSpecColorSchema",{enumerable:true,get:function(){return schemas_js.frameSpecColorSchema}});Object.defineProperty(exports,"frameSpecLabelSchema",{enumerable:true,get:function(){return schemas_js.frameSpecLabelSchema}});Object.defineProperty(exports,"frameSpecPaintSchema",{enumerable:true,get:function(){return schemas_js.frameSpecPaintSchema}});Object.defineProperty(exports,"frameSpecSchema",{enumerable:true,get:function(){return schemas_js.frameSpecSchema}});Object.defineProperty(exports,"frameSpecShapeSchema",{enumerable:true,get:function(){return schemas_js.frameSpecShapeSchema}});Object.defineProperty(exports,"frameStyleSchema",{enumerable:true,get:function(){return schemas_js.frameStyleSchema}});Object.defineProperty(exports,"getFrameSpecIssues",{enumerable:true,get:function(){return schemas_js.getFrameSpecIssues}});Object.defineProperty(exports,"gradientStopSchema",{enumerable:true,get:function(){return schemas_js.gradientStopSchema}});Object.defineProperty(exports,"haloSchema",{enumerable:true,get:function(){return schemas_js.haloSchema}});Object.defineProperty(exports,"imageFitSchema",{enumerable:true,get:function(){return schemas_js.imageFitSchema}});Object.defineProperty(exports,"imagePaintSchema",{enumerable:true,get:function(){return schemas_js.imagePaintSchema}});Object.defineProperty(exports,"imagePositionSchema",{enumerable:true,get:function(){return schemas_js.imagePositionSchema}});Object.defineProperty(exports,"imageSettingsSchema",{enumerable:true,get:function(){return schemas_js.imageSettingsSchema}});Object.defineProperty(exports,"linearGradientSchema",{enumerable:true,get:function(){return schemas_js.linearGradientSchema}});Object.defineProperty(exports,"logoOptionsSchema",{enumerable:true,get:function(){return schemas_js.logoOptionsSchema}});Object.defineProperty(exports,"logoShapeSchema",{enumerable:true,get:function(){return schemas_js.logoShapeSchema}});Object.defineProperty(exports,"pickableCornerEyeDotPatternSchema",{enumerable:true,get:function(){return schemas_js.pickableCornerEyeDotPatternSchema}});Object.defineProperty(exports,"pickableCornerEyePatternSchema",{enumerable:true,get:function(){return schemas_js.pickableCornerEyePatternSchema}});Object.defineProperty(exports,"qrArtImageSchema",{enumerable:true,get:function(){return schemas_js.qrArtImageSchema}});Object.defineProperty(exports,"qrArtModeSchema",{enumerable:true,get:function(){return schemas_js.qrArtModeSchema}});Object.defineProperty(exports,"qrArtSchema",{enumerable:true,get:function(){return schemas_js.qrArtSchema}});Object.defineProperty(exports,"qrArtVariantSchema",{enumerable:true,get:function(){return schemas_js.qrArtVariantSchema}});Object.defineProperty(exports,"qrCodeShapeSchema",{enumerable:true,get:function(){return schemas_js.qrCodeShapeSchema}});Object.defineProperty(exports,"qrPropsSchema",{enumerable:true,get:function(){return schemas_js.qrPropsSchema}});Object.defineProperty(exports,"qrShapeSchema",{enumerable:true,get:function(){return schemas_js.qrShapeSchema}});Object.defineProperty(exports,"qrSilhouetteSchema",{enumerable:true,get:function(){return schemas_js.qrSilhouetteSchema}});Object.defineProperty(exports,"radialGradientSchema",{enumerable:true,get:function(){return schemas_js.radialGradientSchema}});Object.defineProperty(exports,"shadowSchema",{enumerable:true,get:function(){return schemas_js.shadowSchema}});Object.defineProperty(exports,"solidColorSchema",{enumerable:true,get:function(){return schemas_js.solidColorSchema}});Object.defineProperty(exports,"templateConfigSchema",{enumerable:true,get:function(){return schemas_js.templateConfigSchema}});Object.defineProperty(exports,"templateDefinitionBaseSchema",{enumerable:true,get:function(){return schemas_js.templateDefinitionBaseSchema}});Object.defineProperty(exports,"OFFICIAL_FRAME_INDEX",{enumerable:true,get:function(){return framesIndex_js.OFFICIAL_FRAME_INDEX}});Object.defineProperty(exports,"OFFICIAL_FRAMES",{enumerable:true,get:function(){return framesOfficial_js.OFFICIAL_FRAMES}});Object.defineProperty(exports,"getOfficialFrame",{enumerable:true,get:function(){return framesOfficial_js.getOfficialFrame}});Object.defineProperty(exports,"QRCodeCanvas",{enumerable:true,get:function(){return qrCodeCanvas_js.QRCodeCanvas}});exports.AUTO_LEVEL_LOGO_COVERAGE=Ma;exports.Arrow=Ru;exports.BG_RADIUS_MAX=Ur;exports.BG_RADIUS_QUIET_RATIO=Aa;exports.BMP_MAX_DIMENSION=yp;exports.BODY_PATTERN=md;exports.BUILT_IN_FRAMES=li;exports.BUILT_IN_FRAME_SPECS=Df;exports.CORNER_EYE_DOT_PATTERNS=sd;exports.CORNER_EYE_PATTERNS=cd;exports.CUSTOM_FRAME_STYLE=tr;exports.DEFAULT_ART_INTENSITY=Lc;exports.DEFAULT_FRAME_TEXT=$a;exports.DEFAULT_MARGIN=ct;exports.DEFAULT_SIZE=it;exports.DOWNLOAD_FORMATS=As;exports.DotRing=Vu;exports.EPS_IMAGE_FILL_REASON=dm;exports.EYE_GRADIENT_SPANS=bd;exports.EYE_POSITIONS=Be;exports.FRAME_COLOR_TOKENS=qa;exports.FRAME_FONT_FAMILY=io;exports.FRAME_FONT_SCALE_MAX=_n;exports.FRAME_FONT_SCALE_MIN=Zn;exports.FRAME_GAP_RATIO=ac;exports.FRAME_ICONS=za;exports.FRAME_ICON_BOX=ei;exports.FRAME_ICON_MAX_SEGMENTS=_l;exports.FRAME_IMPORT_LIMITS=Ot;exports.FRAME_LABEL_ATTRIBUTE=ic;exports.FRAME_SPEC_KIND=Kn;exports.FRAME_SPEC_LABEL_MAX_FONT=er;exports.FRAME_SPEC_LIMITS=at;exports.FRAME_SPEC_VERSION=Jn;exports.FRAME_STYLES=dd;exports.FRAME_TEXT_MAX_LENGTH=ie;exports.Fragment=Qt;exports.FrameSpecError=cr;exports.GIFScanError=Po;exports.GIF_ALPHA_THRESHOLD=Sp;exports.GIF_MAX_COLORS=xp;exports.GIF_MAX_DIMENSION=$p;exports.GIF_MIME=Mr;exports.GRADIENT_FRAME_DEFAULTS=Bf;exports.HALO_COLOR_DEFAULT=Hr;exports.HALO_LIGHT_MIN=_e;exports.HALO_WIDTH_DEFAULT=Ia;exports.HALO_WIDTH_MAX=va;exports.HALO_WIDTH_MIN=Pa;exports.Halloween=ju;exports.ICO_MAX_DIMENSION=tn;exports.ICO_MIME=en;exports.ICO_SIZES=Io;exports.LOGO_CLEANUP_MAX_SIDE=Im;exports.LOGO_EC_SAFETY=b0;exports.LOGO_PADDING_MAX=pd;exports.LOGO_PLATE_INSET=lo;exports.LOGO_ROUNDED_RADIUS=so;exports.LOGO_SHAPES=fd;exports.LOGO_SIZE_DEFAULT=wa;exports.LOGO_SIZE_MAX=Sa;exports.LOGO_SIZE_MIN=hd;exports.MODULE_SCALE_FLOOR=ru;exports.MODULE_SCALE_MAX=Ca;exports.MODULE_SCALE_MIN=Qr;exports.OFFICIAL_FRAME_COLLECTIONS=a2;exports.OFFICIAL_FRAME_COUNT=r2;exports.OFFICIAL_FRAME_COUNTS=o2;exports.PIXEL_SCAN_SIZES=F2;exports.PIXEL_SCORE_MIN_CODE_WIDTH=f6;exports.PRESET_SIZES=b4;exports.QRCode=H2;exports.QRCodeSVG=js;exports.QRFrameSVG=q2;exports.QR_ART_MAX_SAMPLE_SIZE=jn;exports.QR_ART_MIN_LUMA_GAP=fo;exports.QR_ART_MODES=Gr;exports.QR_ART_SAMPLE_SIZES=_i;exports.QR_ART_VARIANTS=xa;exports.QR_CIRCLE_QUIET_MIN=Ra;exports.QR_EYE_ATTRIBUTE=Cu;exports.QR_PARTS=Fh;exports.QR_PART_ATTRIBUTE=Di;exports.QR_SHAPES=gd;exports.QR_SILHOUETTE_MAX_CELLS=De;exports.QR_SILHOUETTE_MIN_CELLS=ye;exports.QR_SILHOUETTE_MIN_SHARE=Ea;exports.RETIRED_CORNER_EYE_DOT_PATTERNS=ld;exports.RETIRED_CORNER_EYE_PATTERNS=ud;exports.SCAN_CONTRAST_FAIL=Nm;exports.SCAN_CONTRAST_LOW=x2;exports.SCAN_CONTRAST_MIN=Fr;exports.SCAN_IMAGE_CONTRAST_MIN=Om;exports.SCAN_TEST_SIZES=Gm;exports.SHADOW_COLOR_DEFAULT=Na;exports.SHADOW_OFFSET_DEFAULT=La;exports.SHADOW_OFFSET_MAX=zr;exports.SHADOW_OPACITY_DEFAULT=Ta;exports.SHADOW_OPACITY_MAX=Fa;exports.SHADOW_OPACITY_MIN=ka;exports.SHARP_DOT_EYE_SAFE_BODIES=pu;exports.SUPPORTS_PATH2D=z5;exports.SquareBorder=Yu;exports.StandardBox=Ju;exports.StrikedBox=e0;exports.TEMPLATES=wr;exports.WEAK_BODY_EYES=mu;exports.WEAK_DOTS=fu;exports.WEAK_DOT_EYES=uu;exports.WEAK_EYES=du;exports.WEAK_SHARP_DOT_EYES=hu;exports.WEBP_MAX_DIMENSION=Kp;exports.assertGIFStillScans=Rp;exports.blobToDataUrl=Nt;exports.canvasToBMP=Ro;exports.canvasToGIF=vo;exports.canvasToICO=F0;exports.canvasToPNGBytes=Ip;exports.canvasToWebP=Fo;exports.canvasesToICO=cs;exports.circleQuietZone=Xe;exports.clampBgRadius=Nn;exports.clampModuleScale=po;exports.colorAlpha=yo;exports.convertImageSettingsToPixels=cp;exports.copyQRCodeToClipboard=x4;exports.createFrameTree=mi;exports.createQRArtImage=kc;exports.createQRCodeTree=Cr;exports.createQRSilhouette=Km;exports.damagedCodewords=fr;exports.decodePNGPixels=Ms;exports.defaultTemplate=Eu;exports.downloadFile=Bt;exports.downloadImageData=P3;exports.downloadImageWithBoundingBox=v3;exports.downloadPrintEPS=kg;exports.downloadPrintPDF=Wx;exports.downloadPrintSVG=Vx;exports.downloadQRCode=y4;exports.encodeBMP=ts;exports.encodeGIF=E0;exports.encodeGIFFromRGBA=rs;exports.encodeICO=ss;exports.encodeWebPLossless=gs;exports.epsToDataUrl=Xo;exports.excavateModules=Xi;exports.eyeShapeOf=ne;exports.frameLabels=cc;exports.frameSpecHash=i2;exports.frameSpecOf=oo;exports.frameSpecPadding=Mn;exports.frameSpecQrZone=Xr;exports.generatePath=f0;exports.getAllTemplates=g5;exports.getBgRadiusLimit=Ph;exports.getBuiltInFrame=ci;exports.getCodewordMap=dr;exports.getColorString=f1;exports.getContrastLevel=V5;exports.getContrastRatio=W5;exports.getCustomFrameLayout=ii;exports.getDownloadFilename=Fg;exports.getEyeStyleRisk=Ti;exports.getFrameColors=Gf;exports.getFrameDimensions=ue;exports.getFrameGapRatio=ui;exports.getFrameIconPath=ni;exports.getFrameLayout=We;exports.getFrameSecondaryText=Hf;exports.getFrameSpecColors=no;exports.getFrameSpecGapRatio=ai;exports.getFrameText=Uf;exports.getHaloRisk=_o;exports.getImageScanScore=p6;exports.getImageSettings=Ae;exports.getImageTones=_2;exports.getImageTonesFromPixels=y2;exports.getLayoutMargin=Rt;exports.getLogoBlockDamage=Mo;exports.getLogoSizeLimit=l2;exports.getLuminance=Qn;exports.getNormalizedColor=h1;exports.getPrintLayout=Wo;exports.getQRArtColorIssue=z1;exports.getQRArtEyeColors=Ai;exports.getQRArtVariant=ho;exports.getQRAsBMP=gm;exports.getQRAsCanvas=pe;exports.getQRAsEPS=Vo;exports.getQRAsGIF=bm;exports.getQRAsICO=ym;exports.getQRAsPrintPDF=xg;exports.getQRAsPrintPDFBuffer=qx;exports.getQRAsPrintSVG=$g;exports.getQRAsSVG=b3;exports.getQRAsSVGDataUri=jt;exports.getQRAsSVGNode=dp;exports.getQRAsWebP=pm;exports.getQRCodeData=Zo;exports.getQRCodeDataUrl=_4;exports.getQRCodeSVGProps=Yo;exports.getQRData=Ds;exports.getQRFunctionModules=L1;exports.getQRModuleCount=yg;exports.getQRShapePath=d1;exports.getQRSilhouetteFit=c1;exports.getSVGString=$4;exports.getScanContrast=$2;exports.getScanScore=d6;exports.getScanScoreFromPixels=h6;exports.getSolidColor=bt;exports.getStylePairRisk=Ii;exports.getTemplate=xo;exports.getTemplateIds=b5;exports.getWebPCompression=bs;exports.h=Dr;exports.handleImageLoad=S0;exports.hasImageFill=fm;exports.hexToRgb=q5;exports.imagePositionCss=wc;exports.importFrameSvg=n2;exports.indexedToRGBA=os;exports.isBMPFile=es;exports.isFrameActive=Tt;exports.isGIFFile=as;exports.isGradient=je;exports.isICOFile=ls;exports.isImagePaint=pi;exports.isLatin1Text=Id;exports.isQRArtActive=$i;exports.isQRNode=Oe;exports.isSeeThroughBackground=$u;exports.isShapedCode=pr;exports.isWeakSharpPair=gu;exports.isWebPFile=V0;exports.loadQRArtImage=P1;exports.loadQRSilhouette=G2;exports.logoFitsBudget=mp;exports.mixFrameColors=lr;exports.normalizeColorConfig=Lt;exports.partMarker=Bi;exports.pixelsToGIF=Ep;exports.quantizeRGBA=M0;exports.removeLogoBackdrop=Lm;exports.removeLogoBackground=c2;exports.renderQRArt=Mi;exports.renderToDOM=ms;exports.renderToString=nn;exports.resolveErrorLevel=Et;exports.resolveFrameSpec=qe;exports.resolveHalo=yr;exports.resolveQRCodeProps=d2;exports.resolveShadow=Oi;exports.rgbToCmyk=we;exports.sanitizeFrameText=Cn;exports.scanQRPixels=g6;exports.svgToEPS=mm;exports.toHyperscript=km;exports.toSVGElement=Yp;exports.toSVGString=ds;exports.validateSize=Ps;exports.weakestEyePattern=Fi;exports.withQRSize=ve;//# sourceMappingURL=index.js.map
|
|
30
|
+
*/Object.defineProperty(exports,"angularGradientSchema",{enumerable:true,get:function(){return schemas_js.angularGradientSchema}});Object.defineProperty(exports,"anyFrameSchema",{enumerable:true,get:function(){return schemas_js.anyFrameSchema}});Object.defineProperty(exports,"baseTemplatePropsSchema",{enumerable:true,get:function(){return schemas_js.baseTemplatePropsSchema}});Object.defineProperty(exports,"bodyPatternSchema",{enumerable:true,get:function(){return schemas_js.bodyPatternSchema}});Object.defineProperty(exports,"colorConfigSchema",{enumerable:true,get:function(){return schemas_js.colorConfigSchema}});Object.defineProperty(exports,"colorTypeSchema",{enumerable:true,get:function(){return schemas_js.colorTypeSchema}});Object.defineProperty(exports,"cornerEyeDotPatternSchema",{enumerable:true,get:function(){return schemas_js.cornerEyeDotPatternSchema}});Object.defineProperty(exports,"cornerEyePatternSchema",{enumerable:true,get:function(){return schemas_js.cornerEyePatternSchema}});Object.defineProperty(exports,"customFrameSchema",{enumerable:true,get:function(){return schemas_js.customFrameSchema}});Object.defineProperty(exports,"errorLevelSchema",{enumerable:true,get:function(){return schemas_js.errorLevelSchema}});Object.defineProperty(exports,"excavationSchema",{enumerable:true,get:function(){return schemas_js.excavationSchema}});Object.defineProperty(exports,"eyeColorOverrideSchema",{enumerable:true,get:function(){return schemas_js.eyeColorOverrideSchema}});Object.defineProperty(exports,"eyeColorsSchema",{enumerable:true,get:function(){return schemas_js.eyeColorsSchema}});Object.defineProperty(exports,"eyeGradientSpanSchema",{enumerable:true,get:function(){return schemas_js.eyeGradientSpanSchema}});Object.defineProperty(exports,"eyeShapeOverrideSchema",{enumerable:true,get:function(){return schemas_js.eyeShapeOverrideSchema}});Object.defineProperty(exports,"eyeShapesSchema",{enumerable:true,get:function(){return schemas_js.eyeShapesSchema}});Object.defineProperty(exports,"frameSchema",{enumerable:true,get:function(){return schemas_js.frameSchema}});Object.defineProperty(exports,"frameSpecColorSchema",{enumerable:true,get:function(){return schemas_js.frameSpecColorSchema}});Object.defineProperty(exports,"frameSpecLabelSchema",{enumerable:true,get:function(){return schemas_js.frameSpecLabelSchema}});Object.defineProperty(exports,"frameSpecPaintSchema",{enumerable:true,get:function(){return schemas_js.frameSpecPaintSchema}});Object.defineProperty(exports,"frameSpecSchema",{enumerable:true,get:function(){return schemas_js.frameSpecSchema}});Object.defineProperty(exports,"frameSpecShapeSchema",{enumerable:true,get:function(){return schemas_js.frameSpecShapeSchema}});Object.defineProperty(exports,"frameStyleSchema",{enumerable:true,get:function(){return schemas_js.frameStyleSchema}});Object.defineProperty(exports,"getFrameSpecIssues",{enumerable:true,get:function(){return schemas_js.getFrameSpecIssues}});Object.defineProperty(exports,"gradientStopSchema",{enumerable:true,get:function(){return schemas_js.gradientStopSchema}});Object.defineProperty(exports,"haloSchema",{enumerable:true,get:function(){return schemas_js.haloSchema}});Object.defineProperty(exports,"imageFitSchema",{enumerable:true,get:function(){return schemas_js.imageFitSchema}});Object.defineProperty(exports,"imagePaintSchema",{enumerable:true,get:function(){return schemas_js.imagePaintSchema}});Object.defineProperty(exports,"imagePositionSchema",{enumerable:true,get:function(){return schemas_js.imagePositionSchema}});Object.defineProperty(exports,"imageSettingsSchema",{enumerable:true,get:function(){return schemas_js.imageSettingsSchema}});Object.defineProperty(exports,"linearGradientSchema",{enumerable:true,get:function(){return schemas_js.linearGradientSchema}});Object.defineProperty(exports,"logoOptionsSchema",{enumerable:true,get:function(){return schemas_js.logoOptionsSchema}});Object.defineProperty(exports,"logoShapeSchema",{enumerable:true,get:function(){return schemas_js.logoShapeSchema}});Object.defineProperty(exports,"pickableCornerEyeDotPatternSchema",{enumerable:true,get:function(){return schemas_js.pickableCornerEyeDotPatternSchema}});Object.defineProperty(exports,"pickableCornerEyePatternSchema",{enumerable:true,get:function(){return schemas_js.pickableCornerEyePatternSchema}});Object.defineProperty(exports,"qrArtImageSchema",{enumerable:true,get:function(){return schemas_js.qrArtImageSchema}});Object.defineProperty(exports,"qrArtModeSchema",{enumerable:true,get:function(){return schemas_js.qrArtModeSchema}});Object.defineProperty(exports,"qrArtSchema",{enumerable:true,get:function(){return schemas_js.qrArtSchema}});Object.defineProperty(exports,"qrArtVariantSchema",{enumerable:true,get:function(){return schemas_js.qrArtVariantSchema}});Object.defineProperty(exports,"qrCodeShapeSchema",{enumerable:true,get:function(){return schemas_js.qrCodeShapeSchema}});Object.defineProperty(exports,"qrPropsSchema",{enumerable:true,get:function(){return schemas_js.qrPropsSchema}});Object.defineProperty(exports,"qrShapeSchema",{enumerable:true,get:function(){return schemas_js.qrShapeSchema}});Object.defineProperty(exports,"qrSilhouetteSchema",{enumerable:true,get:function(){return schemas_js.qrSilhouetteSchema}});Object.defineProperty(exports,"radialGradientSchema",{enumerable:true,get:function(){return schemas_js.radialGradientSchema}});Object.defineProperty(exports,"shadowSchema",{enumerable:true,get:function(){return schemas_js.shadowSchema}});Object.defineProperty(exports,"solidColorSchema",{enumerable:true,get:function(){return schemas_js.solidColorSchema}});Object.defineProperty(exports,"templateConfigSchema",{enumerable:true,get:function(){return schemas_js.templateConfigSchema}});Object.defineProperty(exports,"templateDefinitionBaseSchema",{enumerable:true,get:function(){return schemas_js.templateDefinitionBaseSchema}});Object.defineProperty(exports,"OFFICIAL_FRAME_INDEX",{enumerable:true,get:function(){return framesIndex_js.OFFICIAL_FRAME_INDEX}});Object.defineProperty(exports,"OFFICIAL_FRAMES",{enumerable:true,get:function(){return framesOfficial_js.OFFICIAL_FRAMES}});Object.defineProperty(exports,"getOfficialFrame",{enumerable:true,get:function(){return framesOfficial_js.getOfficialFrame}});Object.defineProperty(exports,"QRCodeCanvas",{enumerable:true,get:function(){return qrCodeCanvas_js.QRCodeCanvas}});exports.AUTO_LEVEL_LOGO_COVERAGE=Ma;exports.Arrow=Eu;exports.BG_RADIUS_MAX=Ur;exports.BG_RADIUS_QUIET_RATIO=Aa;exports.BMP_MAX_DIMENSION=_p;exports.BODY_PATTERN=dd;exports.BUILT_IN_FRAMES=li;exports.BUILT_IN_FRAME_SPECS=Bf;exports.CORNER_EYE_DOT_PATTERNS=ld;exports.CORNER_EYE_PATTERNS=ud;exports.CUSTOM_FRAME_STYLE=tr;exports.DEFAULT_ART_INTENSITY=kc;exports.DEFAULT_FRAME_TEXT=$a;exports.DEFAULT_MARGIN=ft;exports.DEFAULT_SIZE=it;exports.DOWNLOAD_FORMATS=As;exports.DotRing=Xu;exports.EPS_IMAGE_FILL_REASON=fm;exports.EYE_GRADIENT_SPANS=yd;exports.EYE_POSITIONS=Be;exports.FRAME_COLOR_TOKENS=qa;exports.FRAME_FONT_FAMILY=io;exports.FRAME_FONT_SCALE_MAX=_n;exports.FRAME_FONT_SCALE_MIN=Zn;exports.FRAME_GAP_RATIO=ic;exports.FRAME_ICONS=za;exports.FRAME_ICON_BOX=ei;exports.FRAME_ICON_MAX_SEGMENTS=xl;exports.FRAME_IMPORT_LIMITS=Ot;exports.FRAME_LABEL_ATTRIBUTE=sc;exports.FRAME_SPEC_KIND=Kn;exports.FRAME_SPEC_LABEL_MAX_FONT=er;exports.FRAME_SPEC_LIMITS=at;exports.FRAME_SPEC_VERSION=Jn;exports.FRAME_STYLES=fd;exports.FRAME_TEXT_MAX_LENGTH=ie;exports.Fragment=Qt;exports.FrameSpecError=cr;exports.GIFScanError=Po;exports.GIF_ALPHA_THRESHOLD=wp;exports.GIF_MAX_COLORS=$p;exports.GIF_MAX_DIMENSION=Sp;exports.GIF_MIME=Mr;exports.GRADIENT_FRAME_DEFAULTS=Gf;exports.HALO_COLOR_DEFAULT=Hr;exports.HALO_LIGHT_MIN=_e;exports.HALO_WIDTH_DEFAULT=Ia;exports.HALO_WIDTH_MAX=va;exports.HALO_WIDTH_MIN=Pa;exports.Halloween=Zu;exports.ICO_MAX_DIMENSION=tn;exports.ICO_MIME=en;exports.ICO_SIZES=Io;exports.LOGO_CLEANUP_MAX_SIDE=Lm;exports.LOGO_EC_SAFETY=y0;exports.LOGO_PADDING_MAX=gd;exports.LOGO_PLATE_INSET=lo;exports.LOGO_ROUNDED_RADIUS=so;exports.LOGO_SHAPES=hd;exports.LOGO_SIZE_DEFAULT=wa;exports.LOGO_SIZE_MAX=Sa;exports.LOGO_SIZE_MIN=pd;exports.MODULE_SCALE_FLOOR=ou;exports.MODULE_SCALE_MAX=Ca;exports.MODULE_SCALE_MIN=Qr;exports.OFFICIAL_FRAME_COLLECTIONS=i2;exports.OFFICIAL_FRAME_COUNT=o2;exports.OFFICIAL_FRAME_COUNTS=a2;exports.PIXEL_SCAN_SIZES=T2;exports.PIXEL_SCORE_MIN_CODE_WIDTH=h6;exports.PRESET_SIZES=y4;exports.QRCode=z2;exports.QRCodeSVG=Zs;exports.QRFrameSVG=W2;exports.QR_ART_MAX_SAMPLE_SIZE=jn;exports.QR_ART_MIN_LUMA_GAP=fo;exports.QR_ART_MODES=Gr;exports.QR_ART_SAMPLE_SIZES=_i;exports.QR_ART_VARIANTS=xa;exports.QR_CIRCLE_QUIET_MIN=Ra;exports.QR_EYE_ATTRIBUTE=Mu;exports.QR_PARTS=Th;exports.QR_PART_ATTRIBUTE=Di;exports.QR_SHAPES=bd;exports.QR_SILHOUETTE_MAX_CELLS=De;exports.QR_SILHOUETTE_MIN_CELLS=ye;exports.QR_SILHOUETTE_MIN_SHARE=Ea;exports.RETIRED_CORNER_EYE_DOT_PATTERNS=cd;exports.RETIRED_CORNER_EYE_PATTERNS=md;exports.SCAN_CONTRAST_FAIL=Om;exports.SCAN_CONTRAST_LOW=$2;exports.SCAN_CONTRAST_MIN=Fr;exports.SCAN_IMAGE_CONTRAST_MIN=Dm;exports.SCAN_TEST_SIZES=Qm;exports.SHADOW_COLOR_DEFAULT=Na;exports.SHADOW_OFFSET_DEFAULT=La;exports.SHADOW_OFFSET_MAX=zr;exports.SHADOW_OPACITY_DEFAULT=Ta;exports.SHADOW_OPACITY_MAX=Fa;exports.SHADOW_OPACITY_MIN=ka;exports.SHARP_DOT_EYE_SAFE_BODIES=gu;exports.SUPPORTS_PATH2D=q5;exports.SquareBorder=Ku;exports.StandardBox=t0;exports.StrikedBox=n0;exports.TEMPLATES=wr;exports.WEAK_BODY_EYES=du;exports.WEAK_DOTS=hu;exports.WEAK_DOT_EYES=mu;exports.WEAK_EYES=fu;exports.WEAK_SHARP_DOT_EYES=pu;exports.WEBP_MAX_DIMENSION=Jp;exports.assertGIFStillScans=Ep;exports.blobToDataUrl=Nt;exports.canvasToBMP=Ro;exports.canvasToGIF=vo;exports.canvasToICO=T0;exports.canvasToPNGBytes=Lp;exports.canvasToWebP=Fo;exports.canvasesToICO=cs;exports.circleQuietZone=Xe;exports.clampBgRadius=Nn;exports.clampModuleScale=po;exports.colorAlpha=yo;exports.convertImageSettingsToPixels=up;exports.copyQRCodeToClipboard=$4;exports.createFrameTree=mi;exports.createQRArtImage=Fc;exports.createQRCodeTree=Cr;exports.createQRSilhouette=Jm;exports.damagedCodewords=fr;exports.decodePNGPixels=Ms;exports.defaultTemplate=Au;exports.downloadFile=Bt;exports.downloadImageData=v3;exports.downloadImageWithBoundingBox=I3;exports.downloadPrintEPS=Fg;exports.downloadPrintPDF=Vx;exports.downloadPrintSVG=Xx;exports.downloadQRCode=_4;exports.encodeBMP=ts;exports.encodeGIF=A0;exports.encodeGIFFromRGBA=rs;exports.encodeICO=ss;exports.encodeWebPLossless=gs;exports.epsToDataUrl=Xo;exports.excavateModules=Xi;exports.eyeShapeOf=ne;exports.frameLabels=uc;exports.frameSpecHash=s2;exports.frameSpecOf=oo;exports.frameSpecPadding=Mn;exports.frameSpecQrZone=Xr;exports.generatePath=h0;exports.getAllTemplates=b5;exports.getBgRadiusLimit=vh;exports.getBuiltInFrame=ci;exports.getCodewordMap=dr;exports.getColorString=h1;exports.getContrastLevel=X5;exports.getContrastRatio=V5;exports.getCustomFrameLayout=ii;exports.getDownloadFilename=Tg;exports.getEyeStyleRisk=Ti;exports.getFrameColors=Qf;exports.getFrameDimensions=ue;exports.getFrameGapRatio=ui;exports.getFrameIconPath=ni;exports.getFrameLayout=We;exports.getFrameSecondaryText=zf;exports.getFrameSpecColors=no;exports.getFrameSpecGapRatio=ai;exports.getFrameText=Hf;exports.getHaloRisk=_o;exports.getImageScanScore=g6;exports.getImageSettings=Ae;exports.getImageTones=x2;exports.getImageTonesFromPixels=_2;exports.getLayoutMargin=Rt;exports.getLogoBlockDamage=Mo;exports.getLogoSizeLimit=c2;exports.getLuminance=Qn;exports.getNormalizedColor=p1;exports.getPrintLayout=Wo;exports.getQRArtColorIssue=q1;exports.getQRArtEyeColors=Ai;exports.getQRArtVariant=ho;exports.getQRAsBMP=bm;exports.getQRAsCanvas=pe;exports.getQRAsEPS=Vo;exports.getQRAsGIF=ym;exports.getQRAsICO=_m;exports.getQRAsPrintPDF=$g;exports.getQRAsPrintPDFBuffer=Wx;exports.getQRAsPrintSVG=Sg;exports.getQRAsSVG=y3;exports.getQRAsSVGDataUri=jt;exports.getQRAsSVGNode=fp;exports.getQRAsWebP=gm;exports.getQRCodeData=Zo;exports.getQRCodeDataUrl=x4;exports.getQRCodeSVGProps=Yo;exports.getQRData=Ds;exports.getQRFunctionModules=k1;exports.getQRModuleCount=_g;exports.getQRShapePath=f1;exports.getQRSilhouetteFit=u1;exports.getSVGString=S4;exports.getScanContrast=S2;exports.getScanScore=f6;exports.getScanScoreFromPixels=p6;exports.getSolidColor=bt;exports.getStylePairRisk=Ii;exports.getTemplate=xo;exports.getTemplateIds=y5;exports.getWebPCompression=bs;exports.h=Dr;exports.handleImageLoad=w0;exports.hasImageFill=hm;exports.hexToRgb=W5;exports.imagePositionCss=Cc;exports.importFrameSvg=r2;exports.indexedToRGBA=os;exports.isBMPFile=es;exports.isFrameActive=Tt;exports.isGIFFile=as;exports.isGradient=je;exports.isICOFile=ls;exports.isImagePaint=pi;exports.isLatin1Text=Ld;exports.isQRArtActive=$i;exports.isQRNode=Oe;exports.isSeeThroughBackground=Su;exports.isShapedCode=pr;exports.isWeakSharpPair=bu;exports.isWebPFile=X0;exports.loadQRArtImage=v1;exports.loadQRSilhouette=Q2;exports.logoFitsBudget=dp;exports.mixFrameColors=lr;exports.normalizeColorConfig=Lt;exports.partMarker=Bi;exports.pixelsToGIF=Ap;exports.quantizeRGBA=R0;exports.removeLogoBackdrop=km;exports.removeLogoBackground=u2;exports.renderQRArt=Mi;exports.renderToDOM=ms;exports.renderToString=nn;exports.resolveErrorLevel=Et;exports.resolveFrameSpec=qe;exports.resolveHalo=yr;exports.resolveQRCodeProps=f2;exports.resolveShadow=Oi;exports.rgbToCmyk=we;exports.sanitizeFrameText=Cn;exports.scanQRPixels=b6;exports.svgToEPS=dm;exports.toHyperscript=Fm;exports.toSVGElement=Kp;exports.toSVGString=ds;exports.validateSize=Ps;exports.weakestEyePattern=Fi;exports.withQRSize=ve;//# sourceMappingURL=index.js.map
|
|
31
31
|
//# sourceMappingURL=index.js.map
|