qrdx 0.0.57 → 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/README.md +22 -6
- package/dist/angular.js +33 -3
- package/dist/angular.js.map +1 -1
- package/dist/angular.mjs +33 -3
- package/dist/angular.mjs.map +1 -1
- package/dist/core.js +7 -7
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +7 -7
- package/dist/core.mjs.map +1 -1
- package/dist/element.browser.mjs +6 -6
- package/dist/element.browser.mjs.map +1 -1
- package/dist/element.js +1 -1
- package/dist/element.js.map +1 -1
- package/dist/element.mjs +1 -1
- package/dist/element.mjs.map +1 -1
- package/dist/frames-index.js +1 -1
- package/dist/frames-index.js.map +1 -1
- package/dist/frames-index.mjs +1 -1
- package/dist/frames-index.mjs.map +1 -1
- package/dist/frames-official.js +1 -1
- package/dist/frames-official.js.map +1 -1
- package/dist/frames-official.mjs +1 -1
- package/dist/frames-official.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/qr-code-canvas.js +1 -1
- package/dist/qr-code-canvas.js.map +1 -1
- package/dist/qr-code-canvas.mjs +1 -1
- package/dist/qr-code-canvas.mjs.map +1 -1
- package/dist/schemas.js +1 -1
- package/dist/schemas.js.map +1 -1
- package/dist/schemas.mjs +1 -1
- package/dist/schemas.mjs.map +1 -1
- package/dist/src/angular.d.ts +9 -3
- package/dist/src/download.d.ts +32 -6
- package/dist/src/download.d.ts.map +1 -1
- package/dist/src/element.d.ts +10 -1
- package/dist/src/element.d.ts.map +1 -1
- package/dist/src/engine.d.ts +5 -2
- package/dist/src/engine.d.ts.map +1 -1
- package/dist/src/eps.d.ts.map +1 -1
- package/dist/src/export.d.ts.map +1 -1
- package/dist/src/frame.d.ts +24 -0
- package/dist/src/frame.d.ts.map +1 -1
- package/dist/src/frames/catalogue/all.d.ts.map +1 -1
- package/dist/src/frames/catalogue/batches.d.ts +6 -0
- package/dist/src/frames/catalogue/batches.d.ts.map +1 -0
- package/dist/src/frames/catalogue/call-to-action.d.ts.map +1 -1
- package/dist/src/frames/catalogue/counts.d.ts +4 -2
- package/dist/src/frames/catalogue/counts.d.ts.map +1 -1
- package/dist/src/frames/catalogue/index.d.ts.map +1 -1
- package/dist/src/frames/catalogue/objects.d.ts +5 -0
- package/dist/src/frames/catalogue/objects.d.ts.map +1 -0
- package/dist/src/frames/catalogue/playful.d.ts +5 -0
- package/dist/src/frames/catalogue/playful.d.ts.map +1 -0
- package/dist/src/frames/catalogue/tags.d.ts.map +1 -1
- package/dist/src/frames/collections.d.ts.map +1 -1
- package/dist/src/frames/official-types.d.ts +1 -1
- package/dist/src/frames/official-types.d.ts.map +1 -1
- package/dist/src/frames/official.d.ts.map +1 -1
- package/dist/src/gif.d.ts +40 -0
- package/dist/src/gif.d.ts.map +1 -0
- package/dist/src/helpers.d.ts +1 -1
- package/dist/src/helpers.d.ts.map +1 -1
- package/dist/src/ico.d.ts +11 -0
- package/dist/src/ico.d.ts.map +1 -0
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/looks.d.ts +101 -0
- package/dist/src/looks.d.ts.map +1 -0
- package/dist/src/plain.d.ts.map +1 -1
- package/dist/src/print.d.ts.map +1 -1
- package/dist/src/qr-code-canvas.d.ts.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/src/qr-frame-svg.d.ts +10 -0
- package/dist/src/qr-frame-svg.d.ts.map +1 -0
- package/dist/src/scan-score.d.ts.map +1 -1
- package/dist/src/utils/gif.d.ts +61 -0
- package/dist/src/utils/gif.d.ts.map +1 -0
- package/dist/src/utils/ico.d.ts +30 -0
- package/dist/src/utils/ico.d.ts.map +1 -0
- package/dist/src/utils/parse-color.d.ts +1 -1
- package/dist/src/utils/parse-color.d.ts.map +1 -1
- package/dist/src/utils/print-shared.d.ts.map +1 -1
- package/dist/src/utils/svg-painter.d.ts +13 -0
- package/dist/src/utils/svg-painter.d.ts.map +1 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/vanilla-api.d.ts +2 -2
- package/dist/src/vanilla-api.d.ts.map +1 -1
- package/dist/src/vue.d.ts +1 -1
- package/dist/src/vue.d.ts.map +1 -1
- package/dist/types/constants.d.ts +41 -0
- package/dist/types/constants.d.ts.map +1 -1
- package/dist/types/index.js +2 -2
- package/dist/types/index.js.map +1 -1
- package/dist/types/index.mjs +2 -2
- package/dist/types/index.mjs.map +1 -1
- package/dist/types/plain.d.ts +2 -2
- package/dist/types/plain.d.ts.map +1 -1
- package/dist/types/qr.d.ts +399 -1
- package/dist/types/qr.d.ts.map +1 -1
- package/dist/types/react.d.ts +10 -1
- package/dist/types/react.d.ts.map +1 -1
- package/dist/types/schemas.d.ts +1 -1
- package/dist/types/schemas.d.ts.map +1 -1
- package/dist/vanilla.browser.mjs +34 -34
- package/dist/vanilla.browser.mjs.map +1 -1
- package/dist/vue.js +1 -1
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +1 -1
- package/dist/vue.mjs.map +1 -1
- package/package.json +6 -2
- package/src/angular.ts +14 -2
- package/src/download.tsx +92 -7
- package/src/element.ts +16 -1
- package/src/engine.ts +22 -0
- package/src/eps.ts +8 -1
- package/src/export.ts +16 -0
- package/src/frame.tsx +51 -0
- package/src/frames/catalogue/all.ts +202 -0
- package/src/frames/catalogue/batches.ts +114 -0
- package/src/frames/catalogue/call-to-action.ts +58 -0
- package/src/frames/catalogue/counts.ts +4 -2
- package/src/frames/catalogue/index.ts +808 -0
- package/src/frames/catalogue/objects.ts +65 -0
- package/src/frames/catalogue/playful.ts +97 -0
- package/src/frames/catalogue/tags.ts +137 -0
- package/src/frames/collections.ts +2 -0
- package/src/frames/official/badge-bottom-light.json +91 -0
- package/src/frames/official/badge-bottom.json +79 -0
- package/src/frames/official/billboard-campaign.json +274 -0
- package/src/frames/official/billboard-light.json +287 -0
- package/src/frames/official/bookmark-light.json +88 -0
- package/src/frames/official/bookmark-strip.json +83 -0
- package/src/frames/official/border-medium.json +71 -0
- package/src/frames/official/border-thick.json +71 -0
- package/src/frames/official/border-thin.json +71 -0
- package/src/frames/official/bottle-label.json +136 -0
- package/src/frames/official/bottle-light.json +133 -0
- package/src/frames/official/camera-viewfinder.json +174 -0
- package/src/frames/official/cassette-tape.json +236 -0
- package/src/frames/official/cat-with-card-light.json +246 -0
- package/src/frames/official/cat-with-card.json +234 -0
- package/src/frames/official/cinema-marquee.json +537 -0
- package/src/frames/official/circle-viewfinder.json +87 -0
- package/src/frames/official/clapperboard-light.json +163 -0
- package/src/frames/official/clapperboard-scene.json +151 -0
- package/src/frames/official/comic-panel.json +386 -0
- package/src/frames/official/corner-tab-light.json +101 -0
- package/src/frames/official/corner-tab.json +89 -0
- package/src/frames/official/crystal-ball.json +105 -0
- package/src/frames/official/delivery-box-light.json +132 -0
- package/src/frames/official/delivery-box-track.json +132 -0
- package/src/frames/official/fish-tank.json +276 -0
- package/src/frames/official/flag-light.json +136 -0
- package/src/frames/official/flag-team.json +127 -0
- package/src/frames/official/floppy-disk.json +106 -0
- package/src/frames/official/flying-saucer.json +128 -0
- package/src/frames/official/gallery-frame.json +195 -0
- package/src/frames/official/globe-stand.json +136 -0
- package/src/frames/official/gumball-machine.json +451 -0
- package/src/frames/official/heart-light.json +59 -0
- package/src/frames/official/heart-scan.json +51 -0
- package/src/frames/official/hexagon-light.json +87 -0
- package/src/frames/official/hexagon-scan.json +72 -0
- package/src/frames/official/hot-air-balloon.json +132 -0
- package/src/frames/official/jigsaw-piece-light.json +68 -0
- package/src/frames/official/jigsaw-piece.json +60 -0
- package/src/frames/official/laptop-screen.json +137 -0
- package/src/frames/official/lighthouse-tower.json +132 -0
- package/src/frames/official/magnifying-glass.json +85 -0
- package/src/frames/official/mailbox-flag.json +112 -0
- package/src/frames/official/mailbox-light.json +120 -0
- package/src/frames/official/map-pin-light.json +76 -0
- package/src/frames/official/map-pin.json +58 -0
- package/src/frames/official/matchbox-drawer.json +170 -0
- package/src/frames/official/microwave-door.json +220 -0
- package/src/frames/official/milk-carton.json +129 -0
- package/src/frames/official/monitor-screen.json +111 -0
- package/src/frames/official/monster-mouth.json +180 -0
- package/src/frames/official/mug-light.json +138 -0
- package/src/frames/official/mug-refill.json +125 -0
- package/src/frames/official/museum-plaque-light.json +187 -0
- package/src/frames/official/museum-plaque.json +187 -0
- package/src/frames/official/music-player-light.json +151 -0
- package/src/frames/official/music-player.json +136 -0
- package/src/frames/official/octagon-light.json +126 -0
- package/src/frames/official/octagon-sign.json +120 -0
- package/src/frames/official/open-book.json +156 -0
- package/src/frames/official/parking-meter.json +107 -0
- package/src/frames/official/passport-stamp.json +132 -0
- package/src/frames/official/pizza-box.json +122 -0
- package/src/frames/official/polka-dot-border.json +502 -0
- package/src/frames/official/popcorn-bucket.json +305 -0
- package/src/frames/official/porthole.json +264 -0
- package/src/frames/official/raised-card-thin.json +111 -0
- package/src/frames/official/raised-card.json +99 -0
- package/src/frames/official/retro-radio.json +180 -0
- package/src/frames/official/ribbon-top-light.json +125 -0
- package/src/frames/official/ribbon-top.json +113 -0
- package/src/frames/official/robot-chest.json +197 -0
- package/src/frames/official/roll-up-banner-light.json +137 -0
- package/src/frames/official/roll-up-banner.json +125 -0
- package/src/frames/official/round-tag-light.json +86 -0
- package/src/frames/official/round-tag.json +79 -0
- package/src/frames/official/sailboat-sail.json +99 -0
- package/src/frames/official/scroll-story.json +184 -0
- package/src/frames/official/sketch-border.json +92 -0
- package/src/frames/official/sketch-circle.json +57 -0
- package/src/frames/official/snow-globe.json +170 -0
- package/src/frames/official/soda-can.json +160 -0
- package/src/frames/official/spin-rays.json +126 -0
- package/src/frames/official/spiral-notebook.json +476 -0
- package/src/frames/official/stage-curtains.json +303 -0
- package/src/frames/official/starburst-light.json +128 -0
- package/src/frames/official/starburst.json +118 -0
- package/src/frames/official/swirl-border.json +122 -0
- package/src/frames/official/tablet-screen.json +130 -0
- package/src/frames/official/text-frame.json +79 -0
- package/src/frames/official/toaster-toast.json +114 -0
- package/src/frames/official/train-window.json +176 -0
- package/src/frames/official/treasure-map.json +207 -0
- package/src/frames/official/tv-set.json +256 -0
- package/src/frames/official/vending-machine.json +218 -0
- package/src/frames/official/video-player.json +118 -0
- package/src/frames/official/video-tape.json +137 -0
- package/src/frames/official/vinyl-sleeve-light.json +139 -0
- package/src/frames/official/vinyl-sleeve.json +127 -0
- package/src/frames/official/washing-machine.json +146 -0
- package/src/frames/official-types.ts +3 -1
- package/src/frames/official.ts +4 -3
- package/src/gif.ts +188 -0
- package/src/helpers.ts +12 -0
- package/src/ico.ts +55 -0
- package/src/index.tsx +2 -0
- package/src/looks.ts +467 -0
- package/src/plain.tsx +6 -0
- package/src/print.ts +12 -0
- package/src/qr-code-canvas.tsx +23 -2
- package/src/qr-code-props.ts +54 -19
- package/src/qr-code.tsx +7 -39
- package/src/qr-frame-svg.tsx +26 -0
- package/src/scan-score.ts +38 -6
- package/src/utils/gif.ts +632 -0
- package/src/utils/ico.ts +150 -0
- package/src/utils/parse-color.ts +163 -23
- package/src/utils/print-shared.ts +25 -1
- package/src/utils/svg-painter.ts +18 -0
- package/src/utils.tsx +136 -17
- package/src/vanilla-api.ts +2 -2
- package/src/vue.ts +7 -1
- package/types/constants.ts +47 -0
- package/types/plain.ts +19 -0
- package/types/qr.ts +98 -0
- package/types/react.ts +11 -1
- package/types/schemas.ts +5 -0
package/dist/qr-code-canvas.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";"use client";var fe=Object.defineProperty;var Fr=Object.getOwnPropertyDescriptor;var Ar=Object.getOwnPropertyNames;var wr=Object.prototype.hasOwnProperty;var Rr=(t,e)=>{for(var n in e)fe(t,n,{get:e[n],enumerable:!0})},Pr=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ar(e))!wr.call(t,r)&&r!==n&&fe(t,r,{get:()=>e[r],enumerable:!(o=Fr(e,r))||o.enumerable});return t};var Cr=t=>Pr(fe({},"__esModule",{value:!0}),t);var Mi={};Rr(Mi,{QRCodeCanvas:()=>xi});module.exports=Cr(Mi);var dt=require("react");var xt;(c=>{class t{constructor(i,s,l,u){this.version=i;this.errorCorrectionLevel=s;if(i<t.MIN_VERSION||i>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=i*4+17;let m=[];for(let h=0;h<this.size;h++)m.push(!1);for(let h=0;h<this.size;h++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();let d=this.addEccAndInterleave(l);if(this.drawCodewords(d),u==-1){let h=1e9;for(let b=0;b<8;b++){this.applyMask(b),this.drawFormatBits(b);let p=this.getPenaltyScore();p<h&&(u=b,h=p),this.applyMask(b)}}o(0<=u&&u<=7),this.mask=u,this.applyMask(u),this.drawFormatBits(u),this.isFunction=[]}version;errorCorrectionLevel;static encodeText(i,s){let l=c.QrSegment.makeSegments(i);return t.encodeSegments(l,s)}static encodeBinary(i,s){let l=c.QrSegment.makeBytes(i);return t.encodeSegments([l],s)}static encodeSegments(i,s,l=1,u=40,m=-1,d=!0){if(!(t.MIN_VERSION<=l&&l<=u&&u<=t.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let h,b;for(h=l;;h++){let x=t.getNumDataCodewords(h,s)*8,M=r.getTotalBits(i,h);if(M<=x){b=M;break}if(h>=u)throw new RangeError("Data too long")}for(let x of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])d&&b<=t.getNumDataCodewords(h,x)*8&&(s=x);let p=[];for(let x of i){e(x.mode.modeBits,4,p),e(x.numChars,x.mode.numCharCountBits(h),p);for(let M of x.getData())p.push(M)}o(p.length==b);let g=t.getNumDataCodewords(h,s)*8;o(p.length<=g),e(0,Math.min(4,g-p.length),p),e(0,(8-p.length%8)%8,p),o(p.length%8==0);for(let x=236;p.length<g;x^=253)e(x,8,p);let f=[];for(;f.length*8<p.length;)f.push(0);return p.forEach((x,M)=>f[M>>>3]|=x<<7-(M&7)),new t(h,s,f,m)}size;mask;modules=[];isFunction=[];getModule(i,s){return 0<=i&&i<this.size&&0<=s&&s<this.size&&this.modules[s][i]}getModules(){return this.modules}drawFunctionPatterns(){for(let l=0;l<this.size;l++)this.setFunctionModule(6,l,l%2==0),this.setFunctionModule(l,6,l%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let i=this.getAlignmentPatternPositions(),s=i.length;for(let l=0;l<s;l++)for(let u=0;u<s;u++)l==0&&u==0||l==0&&u==s-1||l==s-1&&u==0||this.drawAlignmentPattern(i[l],i[u]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(i){let s=this.errorCorrectionLevel.formatBits<<3|i,l=s;for(let m=0;m<10;m++)l=l<<1^(l>>>9)*1335;let u=(s<<10|l)^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,!0)}drawVersion(){if(this.version<7)return;let i=this.version;for(let l=0;l<12;l++)i=i<<1^(i>>>11)*7973;let s=this.version<<12|i;o(s>>>18==0);for(let l=0;l<18;l++){let u=n(s,l),m=this.size-11+l%3,d=Math.floor(l/3);this.setFunctionModule(m,d,u),this.setFunctionModule(d,m,u)}}drawFinderPattern(i,s){for(let l=-4;l<=4;l++)for(let u=-4;u<=4;u++){let m=Math.max(Math.abs(u),Math.abs(l)),d=i+u,h=s+l;0<=d&&d<this.size&&0<=h&&h<this.size&&this.setFunctionModule(d,h,m!=2&&m!=4)}}drawAlignmentPattern(i,s){for(let l=-2;l<=2;l++)for(let u=-2;u<=2;u++)this.setFunctionModule(i+u,s+l,Math.max(Math.abs(u),Math.abs(l))!=1)}setFunctionModule(i,s,l){this.modules[s][i]=l,this.isFunction[s][i]=!0}addEccAndInterleave(i){let s=this.version,l=this.errorCorrectionLevel;if(i.length!=t.getNumDataCodewords(s,l))throw new RangeError("Invalid argument");let u=t.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][s],m=t.ECC_CODEWORDS_PER_BLOCK[l.ordinal][s],d=Math.floor(t.getNumRawDataModules(s)/8),h=u-d%u,b=Math.floor(d/u),p=[],g=t.reedSolomonComputeDivisor(m);for(let x=0,M=0;x<u;x++){let F=i.slice(M,M+b-m+(x<h?0:1));M+=F.length;let E=t.reedSolomonComputeRemainder(F,g);x<h&&F.push(0),p.push(F.concat(E))}let f=[];for(let x=0;x<p[0].length;x++)p.forEach((M,F)=>{(x!=b-m||F>=h)&&f.push(M[x])});return o(f.length==d),f}drawCodewords(i){if(i.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let s=0;for(let l=this.size-1;l>=1;l-=2){l==6&&(l=5);for(let u=0;u<this.size;u++)for(let m=0;m<2;m++){let d=l-m,b=(l+1&2)==0?this.size-1-u:u;!this.isFunction[b][d]&&s<i.length*8&&(this.modules[b][d]=n(i[s>>>3],7-(s&7)),s++)}}o(s==i.length*8)}applyMask(i){if(i<0||i>7)throw new RangeError("Mask value out of range");for(let s=0;s<this.size;s++)for(let l=0;l<this.size;l++){let u;switch(i){case 0:u=(l+s)%2==0;break;case 1:u=s%2==0;break;case 2:u=l%3==0;break;case 3:u=(l+s)%3==0;break;case 4:u=(Math.floor(l/3)+Math.floor(s/2))%2==0;break;case 5:u=l*s%2+l*s%3==0;break;case 6:u=(l*s%2+l*s%3)%2==0;break;case 7:u=((l+s)%2+l*s%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[s][l]&&u&&(this.modules[s][l]=!this.modules[s][l])}}getPenaltyScore(){let i=0;for(let m=0;m<this.size;m++){let d=!1,h=0,b=[0,0,0,0,0,0,0];for(let p=0;p<this.size;p++)this.modules[m][p]==d?(h++,h==5?i+=t.PENALTY_N1:h>5&&i++):(this.finderPenaltyAddHistory(h,b),d||(i+=this.finderPenaltyCountPatterns(b)*t.PENALTY_N3),d=this.modules[m][p],h=1);i+=this.finderPenaltyTerminateAndCount(d,h,b)*t.PENALTY_N3}for(let m=0;m<this.size;m++){let d=!1,h=0,b=[0,0,0,0,0,0,0];for(let p=0;p<this.size;p++)this.modules[p][m]==d?(h++,h==5?i+=t.PENALTY_N1:h>5&&i++):(this.finderPenaltyAddHistory(h,b),d||(i+=this.finderPenaltyCountPatterns(b)*t.PENALTY_N3),d=this.modules[p][m],h=1);i+=this.finderPenaltyTerminateAndCount(d,h,b)*t.PENALTY_N3}for(let m=0;m<this.size-1;m++)for(let d=0;d<this.size-1;d++){let h=this.modules[m][d];h==this.modules[m][d+1]&&h==this.modules[m+1][d]&&h==this.modules[m+1][d+1]&&(i+=t.PENALTY_N2)}let s=0;for(let m of this.modules)s=m.reduce((d,h)=>d+(h?1:0),s);let l=this.size*this.size,u=Math.ceil(Math.abs(s*20-l*10)/l)-1;return o(0<=u&&u<=9),i+=u*t.PENALTY_N4,o(0<=i&&i<=2568888),i}getAlignmentPatternPositions(){if(this.version==1)return[];{let i=Math.floor(this.version/7)+2,s=this.version==32?26:Math.ceil((this.version*4+4)/(i*2-2))*2,l=[6];for(let u=this.size-7;l.length<i;u-=s)l.splice(1,0,u);return l}}static getNumRawDataModules(i){if(i<t.MIN_VERSION||i>t.MAX_VERSION)throw new RangeError("Version number out of range");let s=(16*i+128)*i+64;if(i>=2){let l=Math.floor(i/7)+2;s-=(25*l-10)*l-55,i>=7&&(s-=36)}return o(208<=s&&s<=29648),s}static getNumDataCodewords(i,s){return Math.floor(t.getNumRawDataModules(i)/8)-t.ECC_CODEWORDS_PER_BLOCK[s.ordinal][i]*t.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][i]}static reedSolomonComputeDivisor(i){if(i<1||i>255)throw new RangeError("Degree out of range");let s=[];for(let u=0;u<i-1;u++)s.push(0);s.push(1);let l=1;for(let u=0;u<i;u++){for(let m=0;m<s.length;m++)s[m]=t.reedSolomonMultiply(s[m],l),m+1<s.length&&(s[m]^=s[m+1]);l=t.reedSolomonMultiply(l,2)}return s}static reedSolomonComputeRemainder(i,s){let l=s.map(u=>0);for(let u of i){let m=u^l.shift();l.push(0),s.forEach((d,h)=>l[h]^=t.reedSolomonMultiply(d,m))}return l}static reedSolomonMultiply(i,s){if(i>>>8||s>>>8)throw new RangeError("Byte out of range");let l=0;for(let u=7;u>=0;u--)l=l<<1^(l>>>7)*285,l^=(s>>>u&1)*i;return o(l>>>8==0),l}finderPenaltyCountPatterns(i){let s=i[1];o(s<=this.size*3);let l=s>0&&i[2]==s&&i[3]==s*3&&i[4]==s&&i[5]==s;return(l&&i[0]>=s*4&&i[6]>=s?1:0)+(l&&i[6]>=s*4&&i[0]>=s?1:0)}finderPenaltyTerminateAndCount(i,s,l){return i&&(this.finderPenaltyAddHistory(s,l),s=0),s+=this.size,this.finderPenaltyAddHistory(s,l),this.finderPenaltyCountPatterns(l)}finderPenaltyAddHistory(i,s){s[0]==0&&(i+=this.size),s.pop(),s.unshift(i)}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]]}c.QrCode=t;function e(a,i,s){if(i<0||i>31||a>>>i)throw new RangeError("Value out of range");for(let l=i-1;l>=0;l--)s.push(a>>>l&1)}function n(a,i){return(a>>>i&1)!=0}function o(a){if(!a)throw new Error("Assertion error")}class r{constructor(i,s,l){this.mode=i;this.numChars=s;this.bitData=l;if(s<0)throw new RangeError("Invalid argument");this.bitData=l.slice()}mode;numChars;bitData;static makeBytes(i){let s=[];for(let l of i)e(l,8,s);return new r(r.Mode.BYTE,i.length,s)}static makeNumeric(i){if(!r.isNumeric(i))throw new RangeError("String contains non-numeric characters");let s=[];for(let l=0;l<i.length;){let u=Math.min(i.length-l,3);e(parseInt(i.substr(l,u),10),u*3+1,s),l+=u}return new r(r.Mode.NUMERIC,i.length,s)}static makeAlphanumeric(i){if(!r.isAlphanumeric(i))throw new RangeError("String contains unencodable characters in alphanumeric mode");let s=[],l;for(l=0;l+2<=i.length;l+=2){let u=r.ALPHANUMERIC_CHARSET.indexOf(i.charAt(l))*45;u+=r.ALPHANUMERIC_CHARSET.indexOf(i.charAt(l+1)),e(u,11,s)}return l<i.length&&e(r.ALPHANUMERIC_CHARSET.indexOf(i.charAt(l)),6,s),new r(r.Mode.ALPHANUMERIC,i.length,s)}static makeSegments(i){return i==""?[]:r.isNumeric(i)?[r.makeNumeric(i)]:r.isAlphanumeric(i)?[r.makeAlphanumeric(i)]:[r.makeBytes(r.toUtf8ByteArray(i))]}static makeEci(i){let s=[];if(i<0)throw new RangeError("ECI assignment value out of range");if(i<128)e(i,8,s);else if(i<16384)e(2,2,s),e(i,14,s);else if(i<1e6)e(6,3,s),e(i,21,s);else throw new RangeError("ECI assignment value out of range");return new r(r.Mode.ECI,0,s)}static isNumeric(i){return r.NUMERIC_REGEX.test(i)}static isAlphanumeric(i){return r.ALPHANUMERIC_REGEX.test(i)}getData(){return this.bitData.slice()}static getTotalBits(i,s){let l=0;for(let u of i){let m=u.mode.numCharCountBits(s);if(u.numChars>=1<<m)return 1/0;l+=4+m+u.bitData.length}return l}static toUtf8ByteArray(i){i=encodeURI(i);let s=[];for(let l=0;l<i.length;l++)i.charAt(l)!="%"?s.push(i.charCodeAt(l)):(s.push(parseInt(i.substr(l+1,2),16)),l+=2);return s}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}c.QrSegment=r})(xt||={});(e=>{let t;(o=>{class n{constructor(c,a){this.ordinal=c;this.formatBits=a}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})(t=e.QrCode||={})})(xt||={});(e=>{let t;(o=>{class n{constructor(c,a){this.modeBits=c;this.numBitsCharCount=a}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(c){return this.numBitsCharCount[Math.floor((c+7)/17)]}}o.Mode=n})(t=e.QrSegment||={})})(xt||={});var U=xt;var et={L:U.QrCode.Ecc.LOW,M:U.QrCode.Ecc.MEDIUM,Q:U.QrCode.Ecc.QUARTILE,H:U.QrCode.Ecc.HIGH},Qt=128,Mt="Q",nt="#FFFFFF",Ht="#000000";var Vt=0;var Yt=.1;var Ct=24;var Ve=.5,Lt=1.5;var Ye=.07;var Xe=3,de=64,he=8,Ze=.42;function Lr(t,e=3){let n=10**e;return Math.round(t*n)/n+0}function y(t,e=3){return String(Lr(t,e))}function Xt(t,...e){let n=t[0]??"";for(let o=0;o<e.length;o++){let r=e[o];n+=(typeof r=="number"?y(r):r)+(t[o+1]??"")}return n}var Ir={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},vr=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,pe=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function It(t,e=Number.POSITIVE_INFINITY){if(!vr.test(t))return null;let n=[],o=0,r=()=>{for(;o<t.length&&/[\s,]/.test(t[o]);)o++},c=()=>{r(),pe.lastIndex=o;let s=pe.exec(t);if(!s)return null;let l=s[0],u=l.indexOf(".");if(u>=0&&l.length-u-1>e)return null;o=pe.lastIndex;let m=Number(l);return Number.isFinite(m)?m:null},a=()=>{r();let s=t[o];return s==="0"||s==="1"?(o++,s==="1"?1:0):null},i=()=>(r(),o<t.length&&/[0-9.+-]/.test(t[o]));for(r();o<t.length;){let s=t[o],l=s.toUpperCase(),u=Ir[l];if(u===void 0||n.length===0&&l!=="M")return null;if(o++,u===0){n.push({command:s,values:[]}),r();continue}let m=s,d=!0;for(;d||i();){let h=[];for(let b=0;b<u;b++){let p=l==="A"&&(b===3||b===4)?a():c();if(p===null)return null;h.push(p)}n.push({command:m,values:h}),l==="M"&&(m=s==="M"?"L":"l"),d=!1}r()}return n}function We(t){let e=0;for(let{command:n}of t)e+=n.toUpperCase()==="A"?4:1;return e}function ge(t,e=1,n=0,o=0){let r="";for(let{command:c,values:a}of t){let i=c.toUpperCase(),s=c===i,l=s?n:0,u=s?o:0,m;switch(i){case"Z":m=[];break;case"H":m=[y(a[0]*e+l)];break;case"V":m=[y(a[0]*e+u)];break;case"A":m=[y(Math.abs(a[0])*e),y(Math.abs(a[1])*e),y(a[2]),String(a[3]),String(a[4]),y(a[5]*e+l),y(a[6]*e+u)];break;default:m=a.map((d,h)=>y(d*e+(h%2===0?l:u)))}r+=c+m.join(" ")}return r}function Ke(t,e=.25){let n=[],o=[],r=[0,0],c=[0,0],a=()=>{o.length>2&&n.push(o),o=[]};for(let i of t)if(i.op==="M")a(),r=[i.x,i.y],c=r,o.push(r);else if(i.op==="L")c=[i.x,i.y],o.push(c);else if(i.op==="C"){let s=c,l=[i.x1,i.y1],u=[i.x2,i.y2],m=[i.x,i.y],d=Math.hypot(l[0]-s[0],l[1]-s[1])+Math.hypot(u[0]-l[0],u[1]-l[1])+Math.hypot(m[0]-u[0],m[1]-u[1]),h=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(d/(4*e)))));for(let b=1;b<=h;b++){let p=b/h,g=1-p;o.push([g*g*g*s[0]+3*g*g*p*l[0]+3*g*p*p*u[0]+p*p*p*m[0],g*g*g*s[1]+3*g*g*p*l[1]+3*g*p*p*u[1]+p*p*p*m[1]])}c=m}else a(),c=r;return a(),n}function Zt(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 c=o;o=[];for(let a=0;a<c.length;a++){let i=c[a],s=c[(a+c.length-1)%c.length],l=r(i),u=r(s);l>=0?(u<0&&o.push(je(s,i,u,l)),o.push(i)):u>=0&&o.push(je(s,i,u,l))}}return o.length>2?o:[]}function je(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 Je(t){return t.filter(e=>e.length>2).map(e=>`M${e.map(([n,o])=>`${y(n)} ${y(o)}`).join("L")}Z`).join("")}function tn(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,c=(a,i)=>{e=Math.min(e,a),n=Math.min(n,i),o=Math.max(o,a),r=Math.max(r,i)};for(let a of t)a.op==="C"?(c(a.x1,a.y1),c(a.x2,a.y2),c(a.x,a.y)):a.op!=="Z"&&c(a.x,a.y);return Number.isFinite(e)?{x0:e,y0:n,x1:o,y1:r}:null}var be=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function _r(t,e,n,o,r,c,a,i,s){if(t===i&&e===s)return[];let l=Math.abs(n),u=Math.abs(o);if(l===0||u===0)return[{op:"L",x:i,y:s}];let m=r*Math.PI/180,d=Math.cos(m),h=Math.sin(m),b=(t-i)/2,p=(e-s)/2,g=d*b+h*p,f=-h*b+d*p,x=g*g/(l*l)+f*f/(u*u);x>1&&(l*=Math.sqrt(x),u*=Math.sqrt(x));let M=l*l*u*u-l*l*f*f-u*u*g*g,F=l*l*f*f+u*u*g*g,E=(c===a?-1:1)*Math.sqrt(Math.max(0,M/F)),S=E*l*f/u,A=-E*u*g/l,R=d*S-h*A+(t+i)/2,L=h*S+d*A+(e+s)/2,B=(z,G,V,gt)=>Math.atan2(z*gt-G*V,z*V+G*gt),q=B(1,0,(g-S)/l,(f-A)/u),Y=B((g-S)/l,(f-A)/u,(-g-S)/l,(-f-A)/u);!a&&Y>0?Y-=2*Math.PI:a&&Y<0&&(Y+=2*Math.PI);let X=Math.max(1,Math.ceil(Math.abs(Y)/(Math.PI/2)-1e-9)),D=Y/X,J=4/3*Math.tan(D/4),st=(z,G)=>[R+l*d*z-u*h*G,L+l*h*z+u*d*G],pt=[];for(let z=0;z<X;z++){let G=q+z*D,V=G+D,[gt,Dt]=st(Math.cos(G)-J*Math.sin(G),Math.sin(G)+J*Math.cos(G)),[wt,C]=st(Math.cos(V)+J*Math.sin(V),Math.sin(V)-J*Math.cos(V)),[Z,tt]=z===X-1?[i,s]:st(Math.cos(V),Math.sin(V));pt.push({op:"C",x1:gt,y1:Dt,x2:wt,y2:C,x:Z,y:tt})}return pt}function Wt(t){let e=[],n=0,o=0,r=0,c=0,a=0,i="",s=null,l=null,u=()=>{for(;n<t.length&&/[\s,]/.test(t[n]);)n++},m=()=>{u(),be.lastIndex=n;let b=be.exec(t);return b?(n=be.lastIndex,Number(b[0])):null},d=()=>{u();let b=t[n];return b==="0"||b==="1"?(n++,b==="1"):null},h=b=>{let p=[];for(let g=0;g<b;g++){let f=m();if(f===null)return null;p.push(f)}return p};for(;u(),!(n>=t.length);){let b=t[n];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(b))i=b,n++;else if(!i||i==="Z"||i==="z")break;let p=i===i.toLowerCase(),g=p?o:0,f=p?r:0,x=i.toUpperCase();if(x==="Z"){e.push({op:"Z"}),o=c,r=a,s=null,l=null;continue}if(x==="A"){let S=h(3),A=d(),R=d(),L=h(2);if(!(S&&L)||A===null||R===null)break;let[B,q,Y]=S,X=L[0]+g,D=L[1]+f;e.push(..._r(o,r,B,q,Y,A,R,X,D)),o=X,r=D,s=null,l=null;continue}let M={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[x]??0,F=h(M);if(!F)break;let E=F;switch(x){case"M":o=E[0]+g,r=E[1]+f,c=o,a=r,e.push({op:"M",x:o,y:r}),i=p?"l":"L",s=null,l=null;break;case"L":case"H":case"V":x!=="V"&&(o=E[0]+g),x==="V"?r=E[0]+f:x==="L"&&(r=E[1]+f),e.push({op:"L",x:o,y:r}),s=null,l=null;break;case"C":case"S":{let S,A;x==="C"?(S=[E[0]+g,E[1]+f],A=E.slice(2)):(S=s?[2*o-s[0],2*r-s[1]]:[o,r],A=E);let R=[A[0]+g,A[1]+f],L=[A[2]+g,A[3]+f];e.push({op:"C",x1:S[0],y1:S[1],x2:R[0],y2:R[1],x:L[0],y:L[1]}),[o,r]=L,s=R,l=null;break}case"Q":case"T":{let S,A;x==="Q"?(S=[E[0]+g,E[1]+f],A=[E[2]+g,E[3]+f]):(S=l?[2*o-l[0],2*r-l[1]]:[o,r],A=[E[0]+g,E[1]+f]),e.push({op:"C",x1:o+2/3*(S[0]-o),y1:r+2/3*(S[1]-r),x2:A[0]+2/3*(S[0]-A[0]),y2:A[1]+2/3*(S[1]-A[1]),x:A[0],y:A[1]}),[o,r]=A,l=S,s=null;break}default:break}}return e}var en=.5522847498;function ye(t,e,n,o,r=0,c=0){if(n<=0||o<=0)return[];let a=Math.min(Math.max(r,0),n/2),i=Math.min(Math.max(c,0),o/2);if(a===0||i===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=a*en,l=i*en,u=t+n,m=e+o;return[{op:"M",x:t+a,y:e},{op:"L",x:u-a,y:e},{op:"C",x1:u-a+s,y1:e,x2:u,y2:e+i-l,x:u,y:e+i},{op:"L",x:u,y:m-i},{op:"C",x1:u,y1:m-i+l,x2:u-a+s,y2:m,x:u-a,y:m},{op:"L",x:t+a,y:m},{op:"C",x1:t+a-s,y1:m,x2:t,y2:m-i+l,x:t,y:m-i},{op:"L",x:t,y:e+i},{op:"C",x1:t,y1:e+i-l,x2:t+a-s,y2:e,x:t+a,y:e},{op:"Z"}]}var rn="qrdx.frame",on=1,sn="custom",_={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:Ct},an=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],jt=.95,$r=200,cn=["frame","text","accent","background"],Tr=/[\t\n\v\f\r\u0085\u2028\u2029]/g,Nr=/[\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 Me(t,e=Ct){let n=t.slice(0,1e3).normalize("NFC").replace(Tr," ").replace(Nr,"").replace(/\s+/g," ").trim();return Array.from(n).slice(0,Math.max(0,e)).join("").trim()}var Kt=t=>Math.abs(t*1e3-Math.round(t*1e3))<1e-6;function Se(t){let e=Jt(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 kr(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 Jt(t){return t.qr.padding??t.qr.size*_.defaultPadding}var Ee=.52,Or=.35;function Br(t){let e=t.fontSize??t.box.height*Ee;return Math.min(e*Lt,t.box.height*jt)}var xe=(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 nn(t){let e=Se(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[c,a,i]of o)for(let s=0;s<=8;s++){let l=i+Math.PI/2*(s/8);r.push([c+n*Math.cos(l),a+n*Math.sin(l)])}return r}function qr([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!1;let c=Math.min(o,n.width/2,n.height/2),a=Math.min(Math.max(t,n.x+c),n.x+n.width-c),i=Math.min(Math.max(e,n.y+c),n.y+n.height-c);return Math.hypot(t-a,e-i)<=c+.01}function Dr(t){let e=0;return t.forEach(([n,o],r)=>{let[c,a]=t[(r+1)%t.length];e+=n*a-c*o}),Math.abs(e)/2}function zr(t,e,n){let o=Se(e);if(!xe(n,o))return!1;if("stroke"in t&&t.stroke)return!0;if(t.fill==="background")return!1;if(t.type==="rect"&&t.hole){let{hole:r}=t;return!nn(e).every(c=>qr(c,r,r.radius??0))}if(t.type==="circle"&&t.hole){let r=t.hole;return!nn(e).every(([c,a])=>Math.hypot(c-t.cx,a-t.cy)<=r+.01)}if(t.type==="polygon"){let r=Zt(t.points,o);return r.length>2&&Dr(r)>1e-6}return!0}function Fe(t){let e=Ur(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:c,x1:a,y1:i}=e.bounds;return{bounds:{x0:r-o,y0:c-o,x1:a+o,y1:i+o},segments:e.segments*2}}function Ur(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=It(t.d,_.maxDecimals);return e?{bounds:tn(Wt(t.d)),segments:We(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:$r}}}function ln(t,e){let n=_,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:c}=t.artboard,a=Math.max(r,c)*.005,i={x0:-a,y0:-a,x1:r+a,y1:c+a},s=f=>f.x0>=i.x0&&f.y0>=i.y0&&f.x1<=i.x1&&f.y1<=i.y1,{qr:l}=t,u=Jt(t);l.plate!=="none"&&u<l.size*n.minPadding-1e-9&&e(`qr.padding must be at least ${n.minPadding*100}% of qr.size`,["qr","padding"]),l.size<Math.min(r,c)*n.minQrShare-1e-9&&e(`qr.size must be at least ${n.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let m=Se(t);(m.x0<-1e-9||m.y0<-1e-9||m.x1>r+1e-9||m.y1>c+1e-9)&&e("The code and its padding must sit inside the artboard",["qr"]),(l.radius??0)>(l.size+2*u)/2&&e("qr.radius is larger than half the plate",["qr","radius"]);let d=0,h=0;t.shapes.forEach((f,x)=>{let M=["shapes",x],{bounds:F,segments:E}=Fe(f);if(!F){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",[...M,"d"]);return}if(s(F)||e("The shape extends outside the artboard",M),f.type==="rect"&&f.hole){let{hole:S}=f;(S.x<f.x||S.y<f.y||S.x+S.width>f.x+f.width+1e-9||S.y+S.height>f.y+f.height+1e-9)&&e("The hole must sit inside its rect",[...M,"hole"])}f.type==="circle"&&f.hole&&f.hole>=f.r&&e("The hole must be smaller than the circle",[...M,"hole"]),"stroke"in f&&f.stroke&&f.stroke.width>Math.min(r,c)*.1+1e-9&&e("A stroke may be at most 10% of the artboard's shorter side",[...M,"stroke","width"]),l.plate==="background"&&zr(f,t,F)&&e('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',M),d+=E,typeof f.fill=="object"&&"gradient"in f.fill&&(h+=(f.fill.gradient.steps??32)*E)}),d>n.maxSegments&&e(`The shapes have ${d} segments; the limit is ${n.maxSegments}`,["shapes"]),h>n.maxGradientWork&&e("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let b=[],p=new Set,g=new Set;t.labels.forEach((f,x)=>{let M=["labels",x];p.has(f.id)&&e(`Label id "${f.id}" is used twice`,[...M,"id"]),p.add(f.id),f.slot!=="fixed"&&(g.has(f.slot)&&e(`Only one label may use the ${f.slot} slot`,[...M,"slot"]),g.add(f.slot));let F=f.maxLength??n.maxTextLength;f.text!==Me(f.text,F)&&e(`Label text must be at most ${F} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...M,"text"]);let E;if(f.type==="text"){E={x0:f.box.x,y0:f.box.y,x1:f.box.x+f.box.width,y1:f.box.y+f.box.height},f.fontSize!==void 0&&f.fontSize>f.box.height*jt+1e-9&&e("fontSize may be at most 95% of the label's row height",[...M,"fontSize"]);let S=f.box.y+f.box.height/2,A=Br(f)*Or,R={x0:E.x0,x1:E.x1,y0:S-A,y1:S+A};(xe(E,kr(t))||xe(R,m))&&e("The label overlaps the code or its padding",[...M,"box"])}else{let{cx:S,cy:A,radius:R}=f.curve,L=f.fontSize*Lt*.6;E={x0:S-R-L,y0:A-R-L,x1:S+R+L,y1:A+R+L};let B=Math.hypot(Math.max(m.x0-S,0,S-m.x1),Math.max(m.y0-A,0,A-m.y1));Math.hypot(Math.max(Math.abs(m.x0-S),Math.abs(m.x1-S)),Math.max(Math.abs(m.y0-A),Math.abs(m.y1-A)))<=R-L||B>=R+L||e("The curved label crosses the code or its padding",[...M,"curve"])}if(s(E)||e("The label extends outside the artboard",M),f.collapse){let S=f.collapse,A=S.y+S.height;(S.y<-1e-9||A>c+1e-9)&&e("The collapse band must sit inside the artboard",[...M,"collapse"]),A>m.y0+1e-6&&S.y<m.y1-1e-6&&e("The collapse band crosses the code or its padding",[...M,"collapse"]);for(let R of b)A>R.y+1e-6&&S.y<R.y+R.height-1e-6&&e("Collapse bands may not overlap",[...M,"collapse"]);b.push(S)}})}var Ae=(t,e=0)=>{for(let n=e;n<t.length;n++)if(t[n]?.continue!==!0)return!0;return!1};function rt(t,e=[],n={}){return{...n,run(o){let r=t({value:o,issues:[]}),c=Ae(r.issues);for(let a of e){if(a.hasLength){let s=r.value;if(r.issues.some(l=>l.continue===!1)||s===null||s===void 0||s.length===void 0)continue}else if(c)continue;let i=r.issues.length;a.run(r),!c&&r.issues.length>i&&(c=Ae(r.issues,i))}return r}}}function Gr(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 ut=(t,e)=>({path:[],message:`Invalid input: expected ${t}, received ${Gr(e)}`}),Qr={string:"characters",array:"items"};function W(t,e,n,o){let r=Qr[e],c=t?"Too big":"Too small",a=`${t?"<=":">="}${n}`;return{path:[],message:r?`${c}: expected ${e} to have ${a} ${r}`:`${c}: expected ${e} to be ${a}`,continue:o}}var we=t=>typeof t=="string"?`"${t}"`:`${t}`,dn=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function Le(t,e,n){for(let o of n)o.path.unshift(e),t.push(o)}var Hr=t=>t>=55296&&t<=56319,Vr=t=>t>=56320&&t<=57343;function Yr(t){let e=t.length;for(let n=0;n<t.length-1;n++)Hr(t.charCodeAt(n))&&Vr(t.charCodeAt(n+1))&&(e--,n++);return e}var hn=t=>Array.isArray(t)?"array":typeof t=="string"?"string":"unknown",$t=t=>({run(e){e.value<t&&e.issues.push(W(!1,"number",t,!0))}}),Tt=t=>({run(e){e.value>t&&e.issues.push(W(!0,"number",t,!0))}}),Ft=(t,e="Invalid input")=>({run(n){t(n.value)||n.issues.push({path:[],message:e,continue:!0})}}),pn=t=>typeof t=="string"?Yr(t):t.length,gn=t=>({hasLength:!0,run(e){let n=e.value;pn(n)<t&&e.issues.push(W(!1,hn(n),t,!0))}}),Ie=t=>({hasLength:!0,run(e){let n=e.value;pn(n)>t&&e.issues.push(W(!0,hn(n),t,!0))}}),bn=(t,e)=>({run(n){t.lastIndex=0,t.test(n.value)||n.issues.push({path:[],message:e??`Invalid string: must match pattern ${t}`,continue:!0})}}),Xr={run(t){let e=t.value;Number.isInteger(e)?Number.isSafeInteger(e)||t.issues.push(e>0?W(!0,"int",Number.MAX_SAFE_INTEGER,!0):W(!1,"int",Number.MIN_SAFE_INTEGER,!0)):t.issues.push({...ut("int",e),continue:!1})}},mt=(...t)=>rt(e=>{let n=e.value;return typeof n=="number"&&Number.isFinite(n)||e.issues.push(ut("number",n)),e},t),yn=(...t)=>mt(Xr,...t),te=(...t)=>rt(e=>(typeof e.value!="string"&&e.issues.push(ut("string",e.value)),e),t);function H(t){let e=t.length===1?`Invalid input: expected ${we(t[0])}`:`Invalid option: expected one of ${t.map(we).join("|")}`;return rt(n=>(t.includes(n.value)||n.issues.push({path:[],message:e}),n),[],{values:t})}var Q=t=>H([t]),P=t=>({optional:!0,run:e=>e===void 0?{value:e,issues:[]}:t.run(e)});function I(t,e=[]){let n=Object.keys(t),o=new Set(n);return rt(r=>{let c=r.value;if(!dn(c))return r.issues.push(ut("object",c)),r;let a={};for(let s of n){let l=t[s],u=l.run(c[s]),m=s in c;Le(r.issues,s,u.issues),m||l.optional||u.issues.length>0||r.issues.push({path:[s],message:"Invalid input: expected nonoptional, received undefined"}),m&&(a[s]=u.value)}r.value=a;let i=[];for(let s in c)o.has(s)||i.push(s);return i.length>0&&r.issues.push({path:[],message:`Unrecognized key${i.length>1?"s":""}: ${i.map(we).join(", ")}`,continue:!0}),r},e,{shape:t})}function Re(t,e,n){let o=[];return e!==void 0&&o.push(gn(e)),n!==void 0&&o.push(Ie(n)),rt(r=>{let c=r.value;if(Array.isArray(c)&&n!==void 0&&c.length>n)return r.issues.push(W(!0,"array",n,!1)),r;if(!Array.isArray(c))return r.issues.push(ut("array",c)),r;let a=new Array(c.length);for(let i=0;i<c.length;i++){let s=t.run(c[i]);Le(r.issues,i,s.issues),a[i]=s.value}return r.value=a,r},o)}function Pe(t){return rt(e=>{let n=e.value;if(!Array.isArray(n))return e.issues.push(ut("tuple",n)),e;if(n.length<t.length)return e.issues.push(W(!1,"array",t.length,void 0)),e;n.length>t.length&&e.issues.push(W(!0,"array",t.length,void 0));let o=[];return t.forEach((r,c)=>{let a=r.run(n[c]);Le(e.issues,c,a.issues),o[c]=a.value}),e.value=o,e})}function Et(t){return rt(e=>{let n=[];for(let r of t){let c=r.run(e.value);if(c.issues.length===0)return c;n.push(c)}let o=n.filter(r=>!Ae(r.issues));return o.length===1?o[0]:(e.issues.push({path:[],message:"Invalid input"}),e)})}function xn(t,e){let n=new Map;for(let r of e)for(let c of r.shape?.[t]?.values??[])n.set(c,r);let o=`Invalid discriminator value. Expected ${[...n.keys()].map(r=>`'${r}'`).join(" | ")}`;return rt(r=>{let c=r.value;if(!dn(c))return r.issues.push(ut("object",c)),r;let a=n.get(c[t]);return a?a.run(c):(r.issues.push({path:[t],message:o}),r)})}var Zr=Ft(Kt,`Numbers may have at most ${_.maxDecimals} decimals`),ne=[$t(-_.maxCoordinate),Tt(_.maxCoordinate),Zr],$=mt(...ne),N=mt(...ne,Ft(t=>t>0,"Must be greater than 0")),ee=mt(...ne,Ft(t=>t>=0,"Must not be negative")),_t=te(bn(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color")),un=Et([H(cn),_t]),Mn=t=>I({mix:Pe([t,t]),amount:mt($t(0),Tt(1),Ft(Kt))}),St=Et([un,Mn(un)]),Wr=Et([_t,Mn(Et([H(["frame","accent","background"]),_t]))]),lt=Et([St,I({gradient:I({from:St,to:St,direction:P(H(["horizontal","vertical"])),steps:P(yn($t(2),Tt(_.maxGradientSteps)))})})]),Ce=()=>({x:$,y:$,width:N,height:N}),vt=I({color:St,width:N}),jr=xn("type",[I({type:Q("rect"),...Ce(),radius:P(ee),fill:lt,hole:P(I({...Ce(),radius:P(ee)})),stroke:P(vt)}),I({type:Q("circle"),cx:$,cy:$,r:N,hole:P(N),fill:lt,stroke:P(vt)}),I({type:Q("ellipse"),cx:$,cy:$,rx:N,ry:N,fill:lt,stroke:P(vt)}),I({type:Q("polygon"),points:Re(Pe([$,$]),3,_.maxPolygonPoints),fill:lt,stroke:P(vt)}),I({type:Q("path"),d:te(gn(2),Ie(_.maxPathLength)),fill:lt,fillRule:P(H(["nonzero","evenodd"])),stroke:P(vt)}),I({type:Q("line"),x1:$,y1:$,x2:$,y2:$,width:N,cap:P(H(["butt","round"])),dash:P(Pe([N,N])),fill:lt}),I({type:Q("icon"),icon:H(an),x:$,y:$,size:N,fill:lt})]),mn=()=>({id:te(bn(/^[a-z][a-z0-9-]{0,31}$/)),slot:H(["primary","secondary","fixed"]),text:te(Ie(200)),maxLength:P(yn($t(1),Tt(Ct))),color:St,weight:P(H(["bold","regular"])),collapse:P(I({y:$,height:N}))}),Kr=xn("type",[I({type:Q("text"),...mn(),box:I(Ce()),align:P(H(["start","middle","end"])),fontSize:P(N)}),I({type:Q("curved"),...mn(),curve:I({cx:$,cy:$,radius:N,side:H(["top","bottom"]),spread:P(mt($t(20),Tt(300),Ft(Kt)))}),fontSize:N})]),fn=mt(...ne,Ft(t=>t>=_.minArtboard&&t<=_.maxArtboard,`Artboard sides must be ${_.minArtboard} to ${_.maxArtboard} units`)),Jr=I({kind:Q(rn),version:Q(on),artboard:I({width:fn,height:fn}),qr:I({x:$,y:$,size:N,padding:P(ee),radius:P(ee),plate:P(H(["opaque","background","none"]))}),colors:I({frame:_t,text:P(Wr),accent:P(_t)}),shapes:Re(jr,void 0,_.maxShapes),labels:Re(Kr,void 0,_.maxLabels),bleed:P(Et([Q("none"),St]))},[{run(t){ln(t.value,(e,n=[])=>{t.issues.push({path:[...n],message:e,continue:!0})})}}]);function Sn(t){let e=Jr.run(t);return e.issues.length===0?{success:!0,data:e.value}:{success:!1,issues:e.issues.map(({path:n,message:o})=>({path:n,message:o}))}}var En=({path:t,message:e})=>t.length>0?`${t.join(".")}: ${e}`:e;function O(t){if(t.length===0)return"";let[e,...n]=t;return`M${y(e[0])} ${y(e[1])}${n.map(([o,r])=>`L${y(o)} ${y(r)}`).join("")}Z`}function v(t,e,n){return`M${y(t-n)} ${y(e)}A${y(n)} ${y(n)} 0 1 1 ${y(t+n)} ${y(e)}A${y(n)} ${y(n)} 0 1 1 ${y(t-n)} ${y(e)}Z`}function w(t,e,n,o,r=0){let c=Math.min(n,o)/2,[a,i,s,l]=(typeof r=="number"?[r,r,r,r]:r).map(m=>Math.max(0,Math.min(m,c))),u=(m,d,h)=>m>0?`A${y(m)} ${y(m)} 0 0 1 ${y(d)} ${y(h)}`:"";return`M${y(t+a)} ${y(e)}H${y(t+n-i)}${u(i,t+n,e+i)}V${y(e+o-s)}${u(s,t+n-s,e+o)}H${y(t+l)}${u(l,t,e+o-l)}V${y(e+a)}${u(a,t+a,e)}Z`}function re(t,e,n,o,r=5){return Array.from({length:r*2},(c,a)=>{let i=a%2===0?n:o,s=-Math.PI/2+Math.PI/r*a;return[t+i*Math.cos(s),e+i*Math.sin(s)]})}function Fn(t,e,n){let o=n/2,r=(c,a)=>`${y(t+c*o)} ${y(e+a*o)}`;return`M${r(0,-.52)}C${r(.18,-.92)} ${r(.98,-.94)} ${r(1,-.34)}C${r(1,.12)} ${r(.5,.48)} ${r(0,.92)}C${r(-.5,.48)} ${r(-1,.12)} ${r(-1,-.34)}C${r(-.98,-.94)} ${r(-.18,-.92)} ${r(0,-.52)}Z`}function ve(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 An=24,ot=(t,e,n,o)=>{let r=o*Math.PI/180;return[t+n*Math.cos(r),e+n*Math.sin(r)]},oe=([t,e])=>`${y(t)} ${y(e)}`;function At(t,e,n,o,r,c){let a=c-r>180?1:0;return`M${oe(ot(t,e,o,r))}A${y(o)} ${y(o)} 0 ${a} 1 ${oe(ot(t,e,o,c))}L${oe(ot(t,e,n,c))}A${y(n)} ${y(n)} 0 ${a} 0 ${oe(ot(t,e,n,r))}Z`}function Nt(t,e,n,o){return`M${y(t-n)} ${y(e)}A${y(n)} ${y(o)} 0 1 1 ${y(t+n)} ${y(e)}A${y(n)} ${y(o)} 0 1 1 ${y(t-n)} ${y(e)}Z`}function to(t){let e=0;return t.forEach(([n,o],r)=>{let[c,a]=t[(r+1)%t.length];e+=n*a-c*o}),e/2}function wn(t){return O(to(t)<0?[...t].reverse():t)}function ie(t,e,n,o,r){let c=Math.hypot(n-t,o-e)||1,a=-(o-e)/c*(r/2),i=(n-t)/c*(r/2);return wn([[t+a,e+i],[n+a,o+i],[n-a,o-i],[t-a,e-i]])}var k=(...t)=>({d:t.join(""),fillRule:"nonzero"}),j=(...t)=>({d:t.join(""),fillRule:"evenodd"});function eo(){let t=[];for(let e of[0,60,120]){let[n,o]=ot(12,12,10.5,e+180),[r,c]=ot(12,12,10.5,e);t.push(ie(n,o,r,c,2))}for(let e=0;e<6;e++){let n=e*60,[o,r]=ot(12,12,6.2,n);for(let c of[-45,45]){let[a,i]=ot(o,r,3.6,n+c);t.push(ie(o,r,a,i,1.7))}}return k(...t)}var no={wifi:()=>k(At(12,20,4.6,7.2,-135,-45),At(12,20,9.2,11.8,-135,-45),At(12,20,13.8,16.4,-135,-45),v(12,20,2.2)),star:()=>k(O(re(12,12.8,11.6,4.8))),heart:()=>k(Fn(12,12.4,22)),phone:()=>j(w(6,1.5,12,21,2.6),w(7.8,4.2,8.4,13.4,.6),v(12,19.8,1.1)),headphones:()=>k(At(12,13,7.6,9.8,-180,0),w(2,12,5,9.5,2),w(17,12,5,9.5,2)),calendar:()=>j(w(2.5,4,19,17.5,2.5),w(4.6,9,14.8,10.6,.8),w(7,11.4,2.6,2.6,.4),w(10.7,11.4,2.6,2.6,.4),w(14.4,11.4,2.6,2.6,.4),w(7,15.1,2.6,2.6,.4),w(10.7,15.1,2.6,2.6,.4),w(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),w(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>k(v(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:()=>j(w(2,3,20,14,4),O([[6.5,17],[11.5,17],[5.8,21.8]]),v(7.5,10,1.5),v(12,10,1.5),v(16.5,10,1.5)),bag:()=>k(w(3.5,7.5,17,14.5,2),At(12,7.5,3.1,4.8,-180,0)),bell:()=>k("M3.5 17.2A8.5 8.5 0 0 1 20.5 17.2Z",w(1.5,18.2,21,2.6,1.3),w(11.2,6.6,1.6,2.6,0),w(9.8,4.6,4.4,2.4,1.2)),cup:()=>k("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",At(17,10.2,1.7,3.6,-90,90),w(2,20.6,17,2,1),w(7,1.6,1.6,3.4,.8),w(11.6,1.6,1.6,3.4,.8)),card:()=>j(w(1.5,4.5,21,15,2.5),w(1.5,8,21,3,0),w(4.5,13.6,4.6,3.2,.6)),check:()=>j(v(12,12,10.5),O([[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:()=>j(v(12,12,10.5),v(12,7.2,1.6),w(10.6,10,2.8,8,.8)),home:()=>j(O([[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]]),w(10,14.5,4,7,[.6,.6,0,0])),pin:()=>j("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",v(12,9.5,3)),share:()=>k(ie(6,12,18,5,1.8),ie(6,12,18,19,1.8),v(18,5,3.2),v(6,12,3.2),v(18,19,3.2)),download:()=>k(w(10.6,2,2.8,9.5,0),O([[6,10],[18,10],[12,16.5]]),O([[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:()=>j(v(12,12,10.5),v(12,12,8.4),O([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:eo,pumpkin:()=>k(Nt(7.8,14.6,5.8,6.9),Nt(16.2,14.6,5.8,6.9),Nt(12,14.6,4.8,7.4),w(10.9,3.4,2.2,4.6,.8),wn([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>k(O([[12,1.5],[16.8,8.2],[7.2,8.2]]),O([[12,5.2],[19,13.6],[5,13.6]]),O([[12,9.4],[21.2,19.2],[2.8,19.2]]),w(10.4,18.6,3.2,3.9,.4)),sparkle:()=>k(O(re(9.5,13.5,9,2.4,4)),O(re(19,5,4,1.1,4))),gift:()=>k(w(3,11.2,7.8,10.6,1),w(13.2,11.2,7.8,10.6,1),w(2,7.4,8.8,3.2,1),w(13.2,7.4,8.8,3.2,1),Nt(8.8,4.8,2.9,1.9),Nt(15.2,4.8,2.9,1.9))};function Rn(t){return no[t]()}var ro={black:[0,0,0],white:[255,255,255],red:[255,0,0],green:[0,128,0],lime:[0,255,0],blue:[0,0,255],navy:[0,0,128],yellow:[255,255,0],orange:[255,165,0],purple:[128,0,128],pink:[255,192,203],gray:[128,128,128],grey:[128,128,128],silver:[192,192,192],maroon:[128,0,0],olive:[128,128,0],teal:[0,128,128],aqua:[0,255,255],cyan:[0,255,255],fuchsia:[255,0,255],magenta:[255,0,255]};function Pn(t,e){let n=t.trim(),o=Number.parseFloat(n);return Number.isNaN(o)?Number.NaN:n.endsWith("%")?o/100*e:o}function kt(t){if(!t)return null;let e=t.trim().toLowerCase();if(e==="transparent")return{r:0,g:0,b:0,a:0};let n=ro[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(c=>c+c).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,c]=o[1].split("/"),a=r.split(/[\s,]+/).filter(Boolean);if(a.length!==(c===void 0&&a.length===4?4:3))return null;let i=c??a[3],[s,l,u]=a.slice(0,3).map(h=>Pn(h,255)),m=i===void 0?1:Pn(i,1);if([s,l,u,m].some(h=>Number.isNaN(h)))return null;let d=(h,b)=>Math.min(Math.max(h,0),b);return{r:d(s,255),g:d(l,255),b:d(u,255),a:d(m,1)}}return null}function Cn(t){return t===" "?.3:/[MWmw@%]/.test(t)?.92:/[A-Z0-9#&]/.test(t)?.72:/[il.,:;!'|1]/.test(t)?.32:.6}function $e(t){let e=0;for(let n of t)e+=Cn(n);return Math.max(e,1)}var _e=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function se(t,e,n){let o=kt(t)??{r:0,g:0,b:0,a:1},r=kt(e)??{r:255,g:255,b:255,a:1},c=Math.min(1,Math.max(0,n));return`#${_e(o.r+(r.r-o.r)*c)}${_e(o.g+(r.g-o.g)*c)}${_e(o.b+(r.b-o.b)*c)}`}function Ln(t,e,n,o,r,c,a,i){let s=[...t],l=r*.08,u=s.map(p=>Cn(p)*r),m=u.reduce((p,g)=>p+g,0)+l*Math.max(0,s.length-1),d=c==="top"?o-r*.35:o+r*.35,h=[],b=0;return s.forEach((p,g)=>{let f=u[g],x=(b+f/2)/d;if(b+=f+l,p.trim()==="")return;let M=c==="top"?-Math.PI/2-m/2/d+x:Math.PI/2+m/2/d-x;h.push({text:p,x:e+d*Math.cos(M),y:n+d*Math.sin(M),fontSize:r,maxWidth:r*2,color:a,rotate:M*180/Math.PI+(c==="top"?90:-90),field:i})}),h}function Ot(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 ae=class extends Error{issues;constructor(e){super(`Invalid frame spec: ${e.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=e}},In=new WeakMap;function Te(t){if(t&&typeof t=="object"){let n=In.get(t);if(n)return n}if(t==null)throw new ae(['A "custom" frame needs a spec']);let e=Sn(t);if(!e.success)throw new ae(e.issues.map(En));return typeof t=="object"&&In.set(t,e.data),e.data}var oo=t=>{let e=kt(t);return!!(e&&e.a>=1)};function io(t,e){let n=Ot(e,nt);return t.qr.plate==="none"?{color:n,plate:!1}:oo(n)?{color:n,plate:!0}:t.qr.plate==="background"?{color:n,plate:!1}:{color:nt,plate:!0}}function _n(t,e,n=nt){let o=e.color||t.colors.frame,r=e.secondaryColor||t.colors.accent||o,c=s=>s==="frame"?o:s==="accent"?r:s==="background"?n:s,a=t.colors.text,i=e.textColor||(a===void 0?o:typeof a=="string"?a:se(c(a.mix[0]),c(a.mix[1]),a.amount));return{frame:o,text:i,accent:r}}function so(t,e,n){let o=_n(e,t,n),r=c=>{switch(c){case"frame":return o.frame;case"text":return o.text;case"accent":return o.accent;case"background":return n;default:return c}};return c=>typeof c=="string"?r(c):se(r(c.mix[0]),r(c.mix[1]),c.amount)}function vn(t,e,n=0,o=0){let r=It(t);return r?ge(r,e,n,o):""}function ao(t,e,n,o){return`M${y(t-n)} ${y(e)}A${y(n)} ${y(o)} 0 1 1 ${y(t+n)} ${y(e)}A${y(n)} ${y(o)} 0 1 1 ${y(t-n)} ${y(e)}Z`}function co(t,e){let[n,o,r,c]=[t.x1*e,t.y1*e,t.x2*e,t.y2*e],a=Math.hypot(r-n,c-o),i=t.width*e/2,s=a>0?(r-n)/a:1,l=a>0?(c-o)/a:0,u=-l*i,m=s*i,d=(g,f)=>{let x=[n+s*g,o+l*g],M=[n+s*f,o+l*f];if(t.cap==="round"&&f-g>2*i){let F=[x[0]+s*i,x[1]+l*i],E=[M[0]-s*i,M[1]-l*i];return`M${y(F[0]-u)} ${y(F[1]-m)}L${y(E[0]-u)} ${y(E[1]-m)}A${y(i)} ${y(i)} 0 0 1 ${y(E[0]+u)} ${y(E[1]+m)}L${y(F[0]+u)} ${y(F[1]+m)}A${y(i)} ${y(i)} 0 0 1 ${y(F[0]-u)} ${y(F[1]-m)}Z`}return`M${y(x[0]-u)} ${y(x[1]-m)}L${y(M[0]-u)} ${y(M[1]-m)}L${y(M[0]+u)} ${y(M[1]+m)}L${y(x[0]+u)} ${y(x[1]+m)}Z`};if(!t.dash)return{type:"path",d:d(0,a),fillRule:"nonzero"};let h=t.dash[0]*e,b=h+t.dash[1]*e,p=[];for(let g=0;g+h<=a+1e-6;g+=b)p.push(d(g,g+h));return{type:"path",d:p.join(""),fillRule:"nonzero"}}function lo(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:v(t.cx*e,t.cy*e,t.r*e)+(t.hole?v(t.cx*e,t.cy*e,t.hole*e):""),fillRule:t.hole?"evenodd":"nonzero"};case"ellipse":return{type:"path",d:ao(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:vn(t.d,e),fillRule:t.fillRule??"nonzero"};case"line":return co(t,e);default:{let n=Rn(t.icon);return{type:"path",d:vn(n.d,t.size*e/An,t.x*e,t.y*e),fillRule:n.fillRule}}}}function uo(t){if(t.type==="rect"){let{x:e,y:n,width:o,height:r,radius:c,hole:a}=t;return[...ye(e,n,o,r,c,c),...a?ye(a.x,a.y,a.width,a.height,a.radius,a.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"}]:Wt(t.d)}function mo(t,e,n){let o=uo(t),r=Ke(o,.2),c=t.type==="rect"?t.hole?"evenodd":"nonzero":t.type==="path"?t.fillRule??"nonzero":"nonzero",a=e.direction==="vertical",i=g=>a?g[1]:g[0],s=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let g of r)for(let f of g)s=Math.min(s,i(f)),l=Math.max(l,i(f));if(!(l>s))return[];let u=e.steps??32,m=n(e.from),d=n(e.to),h=l-s,b=h*.002,p=[];for(let g=0;g<u;g++){let f=s+h*g/u,x=Math.min(l,s+h*(g+1)/u+(g+1<u?b:0)),M=a?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:f,y1:x}:{x0:f,x1:x,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},F=r.map(E=>Zt(E,M)).filter(E=>E.length>2);F.length!==0&&p.push({type:"path",d:Je(F),fill:se(m,d,(g+.5)/u),fillRule:c})}return p}function fo(t,e,n){let o=lo(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 c=mo(o,t.fill.gradient,n);return r?[...c,{...o,fill:"none",...r}]:c}return[{...o,fill:n(t.fill),...r}]}function ho(t,e){let n=Math.min(t.maxLength??_.maxTextLength,_.maxTextLength),o=t.slot==="primary"?e.text??t.text:t.slot==="secondary"?e.secondaryText??t.text:t.text;return Me(o,n)}function po(t){return t===void 0||!Number.isFinite(t)?1:Math.min(Lt,Math.max(Ve,t))}function go(t,e,n,o,r,c){let a=r(t.color),i=t.weight==="regular"?{fontWeight:400}:{};if(t.type==="curved"){let{cx:p,cy:g,radius:f,side:x,spread:M=140}=t.curve,F=f*o*(M*Math.PI/180),E=Math.min(t.fontSize*o*n,F/($e(e)+.08*e.length));return Ln(e,p*o,g*o,f*o,E,x,a,c).map(S=>({...S,...i}))}let s=t.box.x*o,l=t.box.y*o,u=t.box.width*o,m=t.box.height*o;if(!(m>0))return[];let d=(t.fontSize??t.box.height*Ee)*o,h=Math.min(d*n,m*jt,u/$e(e)),b=t.align??"middle";return[{text:e,x:b==="start"?s:b==="end"?s+u:s+u/2,y:l+m/2+h*.35,fontSize:h,maxWidth:u,color:a,...b!=="middle"&&{align:b},...i,field:c}]}function bo(t){let e=0,n=0,o=0,r=0;return t.map(({command:c,values:a})=>{let i=c.toUpperCase(),s=c!==i;switch(i){case"Z":return e=o,n=r,{command:"Z",values:[]};case"H":return e=(s?e:0)+a[0],{command:"H",values:[e]};case"V":return n=(s?n:0)+a[0],{command:"V",values:[n]};case"A":return e=(s?e:0)+a[5],n=(s?n:0)+a[6],{command:"A",values:[...a.slice(0,5),e,n]};default:{let l=a.map((u,m)=>s?u+(m%2===0?e:n):u);return e=l.at(-2),n=l.at(-1),i==="M"&&(o=e,r=n),{command:i,values:l}}}})}function yo(t,e){let n=It(t);return n?ge(bo(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((c,a)=>a%2===1?e(c):c)})):t}function xo(t,e){let n=(o,r)=>{let c=e(o);return{y:c,height:e(o+r)-c}};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:yo(t.d,e)};case"line":return{...t,y1:e(t.y1),y2:e(t.y2)};default:return{...t,y:e(t.y)}}}function Mo(t,e){if(e.length===0)return t;let n=r=>{let c=r;for(let a of e)c-=Math.min(Math.max(r-a.y,0),a.height);return c},o=(r,c)=>e.some(a=>r>=a.y-1e-6&&c<=a.y+a.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:c}=Fe(r);return!(c&&o(c.y0,c.y1))}).map(r=>xo(r,n)),labels:t.labels.map(r=>{if(r.type==="curved")return{...r,curve:{...r.curve,cy:n(r.curve.cy)}};let c=n(r.box.y);return{...r,box:{...r.box,y:c,height:n(r.box.y+r.box.height)-c}}})}}function Ne(t,e,n,o,r={}){let c=new Map(e.labels.map(g=>[g.id,ho(g,n)])),a=Mo(e,e.labels.flatMap(g=>g.collapse&&!c.get(g.id)?[g.collapse]:[])),i=t/a.qr.size,s=io(a,o),l=so(n,a,s.color),u=a.shapes.flatMap(g=>fo(g,i,l));if(s.plate){let g=Jt(a)*i;u.push({type:"rect",x:a.qr.x*i-g,y:a.qr.y*i-g,width:t+2*g,height:t+2*g,radius:(a.qr.radius??0)*i,fill:s.color})}let m=po(n.fontScale),d=a.labels.flatMap(g=>{let f=c.get(g.id);if(!f)return[];let x=(g.slot==="fixed"?void 0:r[g.slot])??g.id;return go(g,f,m,i,l,x)}),h=d[0],b=h&&h.rotate===void 0?h:null,p=a.bleed??"none";return{width:a.artboard.width*i,height:a.artboard.height*i,qrX:a.qr.x*i,qrY:a.qr.y*i,qrSize:t,shapes:u,label:b,extraLabels:b?d.slice(1):d,squareEdges:p!=="none",color:l(p==="none"?"frame":p)}}function $n(t,e,n){return Ne(t,Te(e.spec),e,n)}var Tn={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 ke={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 Nn={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 kn={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 On={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 Bn={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 qn={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 Dn={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 zn={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 ce={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 Un={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 Gn={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 Qn={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 Hn={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 Vn={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 Yn={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 Xn={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 Zn={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 Wn={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 T=(t,e,n,o,r)=>({style:t,name:e,tags:r,labelOn:o,spec:n}),jn=[T("banner-bottom","Banner",ke,"frame",["bottom","band"]),T("banner-top","Top banner",Nn,"frame",["top","band"]),T("banner-top-bottom","Two banners",kn,"frame",["top","bottom","band"]),T("border","Border",On,"background",["square","outline"]),T("rounded-border","Rounded",Hn,"background",["border","outline"]),T("gradient-border","Gradient",ce,"background",["border","colorful"]),T("focus","Focus",zn,"background",["corners","brackets"]),T("speech-bubble","Bubble",Vn,"frame",["speech"]),T("speech-bubble-top","Bubble top",Yn,"frame",["speech"]),T("chat-bubble","Chat",Bn,"frame",["message","bubble"]),T("circle","Circle",qn,"frame",["round","ring","curved"]),T("badge","Ribbon",Tn,"frame",["badge","banner"]),T("sticker","Sticker",Xn,"frame",["label"]),T("polaroid","Polaroid",Qn,"frame",["photo","picture"]),T("phone","Phone",Gn,"background",["mobile","screen"]),T("ticket","Ticket",Wn,"frame",["event","pass"]),T("tag","Tag",Zn,"frame",["price","label"]),T("envelope","Envelope",Dn,"frame",["mail","letter"]),T("menu-card","Menu card",Un,"background",["menu","restaurant"])],Do=new Map(jn.map(t=>[t.style,t]));function zo(t){return Do.get(t)}var Xs=Object.fromEntries(jn.map(t=>[t.style,t.spec])),Zs={from:ce.colors.frame,to:ce.colors.accent};var Uo={primary:"text",secondary:"secondaryText"};function Kn(t,e,n){let o=zo(e.style)?.spec??ke;return Ne(t,Te(o),e,n,Uo)}var Go="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif";function er(t){return!!(t?.style&&t.style!=="none")}function nr(t,e,n){return e.style===sn?$n(t,e,n):Kn(t,e,n)}function Qo(t){return[...t.label?[t.label]:[],...t.extraLabels??[]]}function rr(t,e){let n=({x:r,y:c,width:a,height:i,radius:s})=>{let l=Math.min(s,a/2,i/2);t.moveTo(r+l,c),t.arcTo(r+a,c,r+a,c+i,l),t.arcTo(r+a,c+i,r,c+i,l),t.arcTo(r,c+i,r,c,l),t.arcTo(r,c,r+a,c,l),t.closePath()},o=(r,c)=>{r.stroke&&r.strokeWidth&&(t.strokeStyle=r.stroke,t.lineWidth=r.strokeWidth,t.lineJoin="miter",t.miterLimit=4,c?t.stroke(c):t.stroke())};for(let r of e.shapes){let c=!(r.fill==="transparent"||r.fill==="none");if(c||r.stroke){if(t.fillStyle=r.fill,r.type==="path"){if(typeof Path2D<"u"){let a=new Path2D(r.d);c&&t.fill(a,r.fillRule??"nonzero"),o(r,a)}continue}t.beginPath(),r.type==="polygon"?(r.points.forEach(([a,i],s)=>{s===0?t.moveTo(a,i):t.lineTo(a,i)}),t.closePath(),c&&t.fill()):(n(r),r.hole&&n(r.hole),c&&t.fill("evenodd")),o(r)}}for(let r of Qo(e))t.fillStyle=r.color,t.font=`${r.fontWeight??700} ${r.fontSize}px ${Go}`,t.textAlign=r.align==="start"?"left":r.align==="end"?"right":"center",t.textBaseline="alphabetic",r.rotate?(t.save(),t.translate(r.x,r.y),t.rotate(r.rotate*Math.PI/180),t.fillText(r.text,0,0,r.maxWidth),t.restore()):t.fillText(r.text,r.x,r.y,r.maxWidth)}var Ho=.22,Vo=.14;function Yo(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 Oe(t,e,n){if(t.beginPath(),e==="circle"){t.arc(n.x+n.w/2,n.y+n.h/2,Math.min(n.w,n.h)/2,0,Math.PI*2);return}let o=e==="rounded"?Math.min(n.w,n.h)*Ho:0;o>0&&typeof t.roundRect=="function"?t.roundRect(n.x,n.y,n.w,n.h,o):t.rect(n.x,n.y,n.w,n.h)}function or(t,e){return e?Yo(t,Vo):t}var{QrCode:Be}=U,Xo={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function Zo(t){let e=t*4+17,n=new Uint8Array(e*e),o=(a,i)=>{a>=0&&i>=0&&a<e&&i<e&&(n[i*e+a]=1)};for(let a=0;a<e;a++)o(6,a),o(a,6);for(let[a,i]of[[3,3],[e-4,3],[3,e-4]])for(let s=-4;s<=4;s++)for(let l=-4;l<=4;l++)o(a+l,i+s);let r=[];if(t>1){let a=Math.floor(t/7)+2,i=t===32?26:Math.ceil((t*4+4)/(a*2-2))*2;r.push(6);for(let s=e-7;r.length<a;s-=i)r.splice(1,0,s)}let c=r.length-1;for(let[a,i]of r.entries())for(let[s,l]of r.entries())if(!(a===0&&s===0||a===0&&s===c||a===c&&s===0))for(let u=-2;u<=2;u++)for(let m=-2;m<=2;m++)o(i+m,l+u);for(let a=0;a<=8;a++)o(8,a),o(a,8);for(let a=0;a<8;a++)o(e-1-a,8),o(8,e-1-a);if(t>=7)for(let a=0;a<18;a++){let i=e-11+a%3,s=Math.floor(a/3);o(i,s),o(s,i)}return n}function Wo(t,e){let n=t*4+17,o=et[e].ordinal,r=Be.NUM_ERROR_CORRECTION_BLOCKS[o]?.[t]??0,c=Be.ECC_CODEWORDS_PER_BLOCK[o]?.[t]??0,a=Math.floor(Be.getNumRawDataModules(t)/8),i=r-a%r,s=Math.floor(a/r),l=Array.from({length:r},(F,E)=>s+(E<i?0:1)),u=[],m=[],d=s-c;for(let F=0;F<=s;F++)for(let E=0;E<r;E++)if(E<i){if(F===d)continue;u.push(E),m.push(F<d?F:F-1)}else u.push(E),m.push(F);if(u.length!==a)throw new Error(`Codeword map: interleave mismatch at version ${t}`);let h=Zo(t),b=new Int16Array(n*n).fill(-1),p=new Int16Array(n*n).fill(-1),g=new Int8Array(n*n).fill(-1),f=a*8,x=0;for(let F=n-1;F>=1;F-=2){F===6&&(F=5);let E=(F+1&2)===0;for(let S=0;S<n;S++)for(let A=0;A<2;A++){let R=F-A,B=(E?n-1-S:S)*n+R;if(!h[B]&&x<f){let q=x>>>3;b[B]=u[q],p[B]=m[q],g[B]=7-(x&7),x++}}}if(x!==f)throw new Error(`Codeword map: placement mismatch at version ${t}`);let M=Xo[`${t}${e}`]??0;return{version:t,level:e,size:n,blocks:r,eccPerBlock:c,blockLengths:l,correctable:Math.floor((c-M)/2),block:b,codeword:p,bit:g}}var jo=8,ft=new Map;function ir(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=ft.get(n);if(o)return ft.delete(n),ft.set(n,o),o;let r=Wo(t,e);if(ft.size>=jo){let c=ft.keys().next().value;c!==void 0&&ft.delete(c)}return ft.set(n,r),r}function sr(t,e){let n=new Array(t.blocks).fill(0),o=new Set;for(let r of e){let c=t.block[r]??-1;if(c<0)continue;let a=c*4096+t.codeword[r];o.has(a)||(o.add(a),n[c]=n[c]+1)}return n}var Ko={2:6,3:12};function ar(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 c=Ko[o.length];for(let a=1;a<=c;a++){let i=a/c,s=1-i;if(o.length===2){let[l]=o;e.push([s*s*n[0]+2*s*i*l[0]+i*i*r[0],s*s*n[1]+2*s*i*l[1]+i*i*r[1]])}else{let[l,u]=o;e.push([s*s*s*n[0]+3*s*s*i*l[0]+3*s*i*i*u[0]+i*i*i*r[0],s*s*s*n[1]+3*s*s*i*l[1]+3*s*i*i*u[1]+i*i*i*r[1]])}}}n=r}return e}function lr(t,e){let n=[];for(let o of t)for(let r=0;r<o.length;r++){let[c,a]=o[r],[i,s]=o[(r+1)%o.length];a<=e!=s<=e&&n.push(c+(e-a)/(s-a)*(i-c))}return n.sort((o,r)=>o-r)}function ur(t,e){let n=0;for(let o of t)if(o<e)n++;else break;return n%2===1}function Jo(t,e,n){return ur(lr(t,n),e)}function mr(t){let e=new Map;return(n,o)=>{let r=e.get(o);return r||(r=lr(t,o),e.set(o,r)),ur(r,n)}}function ti(t,e,n,o){let r=n[0]-t,c=n[1]-e,a=o[0]-n[0],i=o[1]-n[1],s=u=>Math.max(Math.abs(r+u*a),Math.abs(c+u*i)),l=Math.min(s(0),s(1));for(let[u,m]of[[c-r,a-i],[-(r+c),a+i]])if(m!==0){let d=u/m;d>0&&d<1&&(l=Math.min(l,s(d)))}return l}function ei(t,e,n){if(!Jo(t,e,n))return 0;let o=Number.POSITIVE_INFINITY;for(let r of t)for(let c=0;c<r.length;c++)o=Math.min(o,ti(e,n,r[c],r[(c+1)%r.length]));return Number.isFinite(o)?o:0}function ni(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let c of t)for(let[a,i]of c)e=Math.min(e,a),n=Math.min(n,i),o=Math.max(o,a),r=Math.max(r,i);return{x0:e,y0:n,x1:o,y1:r}}function fr(t){let e=t.map(ar),n=ni(e),o=n.x1-n.x0,r=n.y1-n.y0;if(!(o>0&&r>0))return null;let c=(b,p)=>{let g=Math.max(b-n.x0,n.x1-b,p-n.y0,n.y1-p);return g>0?ei(e,b,p)/(2*g):0},a={cx:n.x0+o/2,cy:n.y0+r/2,value:0};a.value=c(a.cx,a.cy);let i=32;for(let b=1;b<i;b++)for(let p=1;p<i;p++){let g=n.x0+o*p/i,f=n.y0+r*b/i,x=c(g,f);x>a.value&&(a={cx:g,cy:f,value:x})}let s=o/i,l=r/i;for(let b=0;b<6;b++){let p=a;for(let g=-2;g<=2;g++)for(let f=-2;f<=2;f++){let x=p.cx+s*f/2,M=p.cy+l*g/2,F=c(x,M);F>a.value&&(a={cx:x,cy:M,value:F})}s/=2,l/=2}if(a.value<=0)return null;let m=.5/Math.max(a.cx-n.x0,n.x1-a.cx,a.cy-n.y0,n.y1-a.cy),d=([b,p])=>[.5+(b-a.cx)*m,.5+(p-a.cy)*m],h=t.map(b=>({start:d(b.start),segments:b.segments.map(p=>p.map(d))}));return{rings:h,polygons:h.map(ar),half:a.value}}function dr(t,e){let n=([r,c])=>`${y(r*e)} ${y(c*e)}`,o="";for(let r of t.rings){o+=`M${n(r.start)}`;for(let c of r.segments){let a=c.length===1?"L":c.length===2?"Q":"C";o+=a+c.map(n).join(" ")}o+="Z"}return o}var ri={start:[0,-.58],segments:[[[.2,-.92],[1,-.97],[1,-.3]],[[1,.3],[.62,.6],[0,.92]],[[-.62,.6],[-1,.3],[-1,-.3]],[[-1,-.97],[-.2,-.92],[0,-.58]]]},cr;function hr(){return cr??=fr([ri]),cr}function oi(t){let{width:e,height:n,cells:o}=t;return Number.isInteger(e)&&Number.isInteger(n)&&e>=he&&n>=he&&e<=de&&n<=de&&typeof o=="string"&&o.length===e*n&&/^[01]*$/.test(o)?(r,c)=>r>=0&&c>=0&&r<e&&c<n&&o[c*e+r]==="1":null}var K=([t,e])=>`${t},${e}`;function ii(t,e,n){let o=(s,l)=>t(s-1,l-1),r=new Map,c=(s,l)=>{for(let[u,m]of[[s,l],[l,s]]){let d=r.get(K(u))??[];d.push(m),r.set(K(u),d)}};for(let s=0;s<=n;s++)for(let l=0;l<=e;l++){let u=o(l,s),m=o(l+1,s),d=o(l+1,s+1),h=o(l,s+1),b=[l,s-.5],p=[l+.5,s],g=[l,s+.5],f=[l-.5,s];switch((u?8:0)+(m?4:0)+(d?2:0)+(h?1:0)){case 1:case 14:c(f,g);break;case 2:case 13:c(g,p);break;case 3:case 12:c(f,p);break;case 4:case 11:c(b,p);break;case 6:case 9:c(b,g);break;case 7:case 8:c(f,b);break;case 5:c(b,p),c(f,g);break;case 10:c(f,b),c(g,p);break;default:break}}let a=[],i=new Set;for(let[s,l]of r){if(i.has(s)||l.length===0)continue;let[u,m]=s.split(",").map(Number),d=[[u,m]];i.add(s);let h=[u,m],b=l[0];for(;!i.has(K(b));){i.add(K(b)),d.push(b);let p=si(r.get(K(b))??[],h,i);if(!p)break;h=b,b=p}d.length>=3&&a.push(ai(d))}return a}function si(t,e,n){let o=K(e);return t.find(r=>K(r)!==o&&!n.has(K(r)))??t.find(r=>K(r)!==o)}function ai(t){let e=[];for(let n=0;n<t.length;n++){let o=t[(n-1+t.length)%t.length],r=t[n],c=t[(n+1)%t.length],a=(r[0]-o[0])*(c[1]-r[1])-(r[1]-o[1])*(c[0]-r[0]);Math.abs(a)>1e-9&&e.push(r)}return e.length>=3?e:t}function ci(t){let e=(c,a)=>[(c[0]+a[0])/2,(c[1]+a[1])/2],n=t.length,o=e(t[n-1],t[0]),r=t.map((c,a)=>[c,e(c,t[(a+1)%n])]);return{start:o,segments:r}}var Bt=new Map;function pr(t){let e=`${t.width}x${t.height}:${t.cells}`,n=Bt.get(e);if(n)return n;let o=oi(t),r;if(!o)r={outline:null,problem:"invalid"};else if(t.cells.includes("1")){let c=ii(o,t.width,t.height),a=c.length>0?fr(c.map(ci)):null;r=a&&2*a.half>=Ze?{outline:a,problem:null}:{outline:null,problem:a?"thin":"empty"}}else r={outline:null,problem:"empty"};return Bt.size>16&&Bt.delete(Bt.keys().next().value),Bt.set(e,r),r}var li=1,gr=.5,br=.5,ui=.5;function le(t){return Math.max(t,Xe)}function qe(t){return t==="heart"?hr():typeof t=="object"&&t?.type==="silhouette"?pr(t).outline:null}function it(t,e,n){if(n==="circle"){let a=le(e),i=(t/2+a)*Math.SQRT2+li;return Math.ceil(i-t/2)}let o=qe(n);if(!o)return e;let r=le(e),c=(t+2*(r+ui))/(2*o.half);return Math.ceil((c-t)/2-1e-9)}function yr(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 mi(t,e,n){let o=it(e,n,"circle"),r=le(n),c=e+2*o,a=c/2,i=a-gr-.5,s=yr(Number.parseInt(ve(t),36)||1),l=o-r,u=o+e+r;return Array.from({length:c},(m,d)=>Array.from({length:c},(h,b)=>{let p=s()<br;return b>=l&&b<u&&d>=l&&d<u?!1:p&&Math.hypot(b+.5-a,d+.5-a)<=i}))}var fi=Array.from({length:8},(t,e)=>{let n=e*Math.PI/4;return[Math.cos(n),Math.sin(n)]});function De(t,e,n,o){if(o==="circle")return mi(t,e,n);let r=qe(o);if(!r)return null;let c=it(e,n,o),a=le(n),i=e+2*c,s=mr(r.polygons),l=.5+gr,u=(b,p)=>{let g=b+.5,f=p+.5;return s(g/i,f/i)?fi.every(([x,M])=>s((g+x*l)/i,(f+M*l)/i)):!1},m=yr(Number.parseInt(ve(t),36)||1),d=c-a,h=c+e+a;return Array.from({length:i},(b,p)=>Array.from({length:i},(g,f)=>{let x=m()<br;return f>=d&&f<h&&p>=d&&p<h?!1:x&&u(f,p)}))}function ze(t,e){if(t==="circle")return{circle:e/2};let n=qe(t);return n?{path:dr(n,e)}:null}function xr(t,e){return t.slice().map((n,o)=>o<e.y||o>=e.y+e.h?n:n.map((r,c)=>c<e.x||c>=e.x+e.w?r:!1))}function Ue(t,e=0){let n=[];return t.forEach((o,r)=>{let c=null;o.forEach((a,i)=>{if(!a&&c!==null){n.push(Xt`M${c+e} ${r+e}h${i-c}v1H${c+e}z`),c=null;return}if(i===o.length-1){if(!a)return;c===null?n.push(Xt`M${i+e},${r+e} h1v1H${i+e}z`):n.push(Xt`M${c+e},${r+e} h${i+1-c}v1H${c+e}z`);return}a&&c===null&&(c=i)})}),n.join("")}function qt(t,e,n,o){if(o==null)return null;let r=t.length,c=Math.floor(e*Yt),a=(r+2*n)/e,i=(o.width||c)*a,s=(o.height||c)*a,l=o.x==null?r/2-i/2:o.x*a,u=o.y==null?r/2-s/2:o.y*a,m=null;if(o.excavate){let d=Math.max(0,o.padding??0)*a,h=Math.floor(l-d),b=Math.floor(u-d),p=Math.ceil(i+l+d-h),g=Math.ceil(s+u+d-b);m={x:h,y:b,w:p,h:g}}return{x:l,y:u,h:s,w:i,excavation:m}}function ue(t){let e=t.level??Mt,{imageSettings:n}=t,o=t.isOGContext&&n?.excavate&&(e==="L"||e==="M")?"Q":e;if(t.autoLevel&&n&&o!=="H"){let r=U.QrCode.encodeText(t.value,et[o]).getModules(),c=qt(r,t.size??Qt,it(r.length,t.margin??Vt,t.shape),n);c&&(c.excavation?c.excavation.w*c.excavation.h:c.w*c.h)/(r.length*r.length)>Ye&&(o="H")}return o}var Ge=(()=>{try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})();var di=.6,hi=["L","M","Q","H"];function pi(t){let e=U.QrCode.encodeText(t.value,et[t.level]),n=hi[e.errorCorrectionLevel.ordinal]??t.level;return{code:t,cells:e.getModules(),layoutMargin:it(e.size,t.margin,t.shape),map:ir(e.version,n),level:n,version:e.version}}function gi(t,e){let{cells:n,map:o}=t,r=n.length,c=qt(n,t.code.size,t.layoutMargin,e);if(!c)return null;let a=c.excavation??{x:Math.floor(c.x),y:Math.floor(c.y),w:Math.ceil(c.x+c.w)-Math.floor(c.x),h:Math.ceil(c.y+c.h)-Math.floor(c.y)},i=[];for(let l=Math.max(0,a.y);l<Math.min(r,a.y+a.h);l++)for(let u=Math.max(0,a.x);u<Math.min(r,a.x+a.w);u++)i.push(l*r+u);let s=sr(o,i);return{worst:Math.max(0,...s),correctable:o.correctable,budget:Math.floor(o.correctable*di),level:t.level,version:t.version}}var bi=t=>!t||t.worst<=t.budget;function yi(t,e,n,o){let r=e.map(i=>pi({...t,level:i})),c=i=>{let s=o(i);return r.every(l=>bi(gi(l,s)))};if(c(n))return n;let a=t.size*.005;for(let i=n-a;i>0;i-=a)if(c(i))return i;return 0}function Mr(t,e){if(!e)return;let n=Math.floor(t.size*Yt),o=e.width||n,r=e.height||n,c=d=>{if(d===o)return e;let h=r*d/o;return{...e,width:d,height:h,...e.x!=null&&{x:e.x+(o-d)/2},...e.y!=null&&{y:e.y+(r-h)/2}}},a=t.level??Mt,i={value:t.value,size:t.size,margin:t.margin,shape:t.shape},s=d=>ue({...t,level:a,imageSettings:d}),l=d=>{let h=yi(i,[d],o,c);return h>0?c(h):void 0},u=s(e);if(u===a)return l(a);let m=l(u);return m&&s(m)===u?m:l(a)}var ht=require("react/jsx-runtime");function xi(t){let{value:e,size:n=Qt,level:o=Mt,bgColor:r=nt,fgColor:c=Ht,margin:a=Vt,style:i,imageSettings:s,eyeColor:l,dotColor:u,bodyPattern:m,cornerEyePattern:d,cornerEyeDotPattern:h,isOGContext:b,templateId:p,customTemplate:g,customProps:f,frame:x,art:M,eyeColors:F,moduleScale:E,frameLabelMarkers:S,partMarkers:A,autoLevel:R,shape:L,...B}=t,q=Mr({value:e,size:n,margin:a,level:o,shape:L,autoLevel:R},s),Y=ue({value:e,size:n,level:o,margin:a,imageSettings:q,autoLevel:R,shape:L}),X=q?.src,D=er(x)?nr(n,x,r):null,J=D?.width??n,st=D?.height??n,pt=(0,dt.useRef)(null),z=(0,dt.useRef)(null),[G,V]=(0,dt.useState)(!1);(0,dt.useEffect)(()=>{if(pt.current!=null){let wt=pt.current,C=wt.getContext("2d");if(!C)return;let Z=U.QrCode.encodeText(e,et[Y]).getModules(),tt=it(Z.length,a,L),me=De(e,Z.length,a,L),bt=Z.length+tt*2,at=qt(Z,n,tt,q),zt=z.current,Qe=at!=null&&zt?.complete&&zt.naturalHeight!==0&&zt.naturalWidth!==0;Qe&&at.excavation!=null&&(Z=xr(Z,at.excavation));let Ut=window.devicePixelRatio||1;wt.width=J*Ut,wt.height=st*Ut,C.scale(Ut,Ut),D&&(rr(C,D),C.translate(D.qrX,D.qrY));let He=n/bt;C.scale(He,He),C.fillStyle=Ot(r,nt);let Rt=ze(L,bt);if(Rt&&"circle"in Rt?(C.beginPath(),C.arc(bt/2,bt/2,Rt.circle,0,2*Math.PI),C.fill()):Rt&&Ge?C.fill(new Path2D(Rt.path),"evenodd"):C.fillRect(0,0,bt,bt),C.fillStyle=Ot(c,Ht),Ge)C.fill(new Path2D(Ue(Z,tt))),me&&C.fill(new Path2D(Ue(me,0)));else for(let[Gt,yt]of[[Z,tt],[me??[],0]])Gt.forEach((Pt,ct)=>{Pt.forEach((Sr,Er)=>{Sr&&C.fillRect(Er+yt,ct+yt,1,1)})});if(Qe){let Gt={x:at.x+tt,y:at.y+tt,w:at.w,h:at.h},yt=q?.shape??"square",Pt=q?.plate,ct=or(Gt,Pt);C.save(),Pt&&(Oe(C,yt,Gt),C.fillStyle=Pt,C.fill()),yt!=="square"&&(Oe(C,yt,ct),C.clip()),C.drawImage(zt,ct.x,ct.y,ct.w,ct.h),C.restore()}}});let gt={height:st,width:J,...i},Dt=null;return X!=null&&(Dt=(0,ht.jsx)("img",{alt:"QR code",onLoad:()=>{V(!0)},ref:z,src:X,style:{display:"none"}},X)),(0,ht.jsxs)(ht.Fragment,{children:[(0,ht.jsx)("canvas",{height:st,ref:pt,style:gt,width:J,...B}),Dt]})}0&&(module.exports={QRCodeCanvas});
|
|
1
|
+
"use strict";"use client";var gt=Object.defineProperty;var $r=Object.getOwnPropertyDescriptor;var Nr=Object.getOwnPropertyNames;var Or=Object.prototype.hasOwnProperty;var Dr=(e,t)=>{for(var n in t)gt(e,n,{get:t[n],enumerable:!0})},Br=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Nr(t))!Or.call(e,r)&&r!==n&>(e,r,{get:()=>t[r],enumerable:!(o=$r(t,r))||o.enumerable});return e};var qr=e=>Br(gt({},"__esModule",{value:!0}),e);var Ti={};Dr(Ti,{QRCodeCanvas:()=>ki});module.exports=qr(Ti);var pe=require("react");var ye;(l=>{class e{constructor(i,s,c,u){this.version=i;this.errorCorrectionLevel=s;if(i<e.MIN_VERSION||i>e.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=i*4+17;let m=[];for(let h=0;h<this.size;h++)m.push(!1);for(let h=0;h<this.size;h++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();let d=this.addEccAndInterleave(c);if(this.drawCodewords(d),u==-1){let h=1e9;for(let b=0;b<8;b++){this.applyMask(b),this.drawFormatBits(b);let p=this.getPenaltyScore();p<h&&(u=b,h=p),this.applyMask(b)}}o(0<=u&&u<=7),this.mask=u,this.applyMask(u),this.drawFormatBits(u),this.isFunction=[]}version;errorCorrectionLevel;static encodeText(i,s){let c=l.QrSegment.makeSegments(i);return e.encodeSegments(c,s)}static encodeBinary(i,s){let c=l.QrSegment.makeBytes(i);return e.encodeSegments([c],s)}static encodeSegments(i,s,c=1,u=40,m=-1,d=!0){if(!(e.MIN_VERSION<=c&&c<=u&&u<=e.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let h,b;for(h=c;;h++){let x=e.getNumDataCodewords(h,s)*8,S=r.getTotalBits(i,h);if(S<=x){b=S;break}if(h>=u)throw new RangeError("Data too long")}for(let x of[e.Ecc.MEDIUM,e.Ecc.QUARTILE,e.Ecc.HIGH])d&&b<=e.getNumDataCodewords(h,x)*8&&(s=x);let p=[];for(let x of i){t(x.mode.modeBits,4,p),t(x.numChars,x.mode.numCharCountBits(h),p);for(let S of x.getData())p.push(S)}o(p.length==b);let g=e.getNumDataCodewords(h,s)*8;o(p.length<=g),t(0,Math.min(4,g-p.length),p),t(0,(8-p.length%8)%8,p),o(p.length%8==0);for(let x=236;p.length<g;x^=253)t(x,8,p);let f=[];for(;f.length*8<p.length;)f.push(0);return p.forEach((x,S)=>f[S>>>3]|=x<<7-(S&7)),new e(h,s,f,m)}size;mask;modules=[];isFunction=[];getModule(i,s){return 0<=i&&i<this.size&&0<=s&&s<this.size&&this.modules[s][i]}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 i=this.getAlignmentPatternPositions(),s=i.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(i[c],i[u]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(i){let s=this.errorCorrectionLevel.formatBits<<3|i,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,!0)}drawVersion(){if(this.version<7)return;let i=this.version;for(let c=0;c<12;c++)i=i<<1^(i>>>11)*7973;let s=this.version<<12|i;o(s>>>18==0);for(let c=0;c<18;c++){let u=n(s,c),m=this.size-11+c%3,d=Math.floor(c/3);this.setFunctionModule(m,d,u),this.setFunctionModule(d,m,u)}}drawFinderPattern(i,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)),d=i+u,h=s+c;0<=d&&d<this.size&&0<=h&&h<this.size&&this.setFunctionModule(d,h,m!=2&&m!=4)}}drawAlignmentPattern(i,s){for(let c=-2;c<=2;c++)for(let u=-2;u<=2;u++)this.setFunctionModule(i+u,s+c,Math.max(Math.abs(u),Math.abs(c))!=1)}setFunctionModule(i,s,c){this.modules[s][i]=c,this.isFunction[s][i]=!0}addEccAndInterleave(i){let s=this.version,c=this.errorCorrectionLevel;if(i.length!=e.getNumDataCodewords(s,c))throw new RangeError("Invalid argument");let u=e.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][s],m=e.ECC_CODEWORDS_PER_BLOCK[c.ordinal][s],d=Math.floor(e.getNumRawDataModules(s)/8),h=u-d%u,b=Math.floor(d/u),p=[],g=e.reedSolomonComputeDivisor(m);for(let x=0,S=0;x<u;x++){let A=i.slice(S,S+b-m+(x<h?0:1));S+=A.length;let M=e.reedSolomonComputeRemainder(A,g);x<h&&A.push(0),p.push(A.concat(M))}let f=[];for(let x=0;x<p[0].length;x++)p.forEach((S,A)=>{(x!=b-m||A>=h)&&f.push(S[x])});return o(f.length==d),f}drawCodewords(i){if(i.length!=Math.floor(e.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 d=c-m,b=(c+1&2)==0?this.size-1-u:u;!this.isFunction[b][d]&&s<i.length*8&&(this.modules[b][d]=n(i[s>>>3],7-(s&7)),s++)}}o(s==i.length*8)}applyMask(i){if(i<0||i>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(i){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 i=0;for(let m=0;m<this.size;m++){let d=!1,h=0,b=[0,0,0,0,0,0,0];for(let p=0;p<this.size;p++)this.modules[m][p]==d?(h++,h==5?i+=e.PENALTY_N1:h>5&&i++):(this.finderPenaltyAddHistory(h,b),d||(i+=this.finderPenaltyCountPatterns(b)*e.PENALTY_N3),d=this.modules[m][p],h=1);i+=this.finderPenaltyTerminateAndCount(d,h,b)*e.PENALTY_N3}for(let m=0;m<this.size;m++){let d=!1,h=0,b=[0,0,0,0,0,0,0];for(let p=0;p<this.size;p++)this.modules[p][m]==d?(h++,h==5?i+=e.PENALTY_N1:h>5&&i++):(this.finderPenaltyAddHistory(h,b),d||(i+=this.finderPenaltyCountPatterns(b)*e.PENALTY_N3),d=this.modules[p][m],h=1);i+=this.finderPenaltyTerminateAndCount(d,h,b)*e.PENALTY_N3}for(let m=0;m<this.size-1;m++)for(let d=0;d<this.size-1;d++){let h=this.modules[m][d];h==this.modules[m][d+1]&&h==this.modules[m+1][d]&&h==this.modules[m+1][d+1]&&(i+=e.PENALTY_N2)}let s=0;for(let m of this.modules)s=m.reduce((d,h)=>d+(h?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),i+=u*e.PENALTY_N4,o(0<=i&&i<=2568888),i}getAlignmentPatternPositions(){if(this.version==1)return[];{let i=Math.floor(this.version/7)+2,s=this.version==32?26:Math.ceil((this.version*4+4)/(i*2-2))*2,c=[6];for(let u=this.size-7;c.length<i;u-=s)c.splice(1,0,u);return c}}static getNumRawDataModules(i){if(i<e.MIN_VERSION||i>e.MAX_VERSION)throw new RangeError("Version number out of range");let s=(16*i+128)*i+64;if(i>=2){let c=Math.floor(i/7)+2;s-=(25*c-10)*c-55,i>=7&&(s-=36)}return o(208<=s&&s<=29648),s}static getNumDataCodewords(i,s){return Math.floor(e.getNumRawDataModules(i)/8)-e.ECC_CODEWORDS_PER_BLOCK[s.ordinal][i]*e.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][i]}static reedSolomonComputeDivisor(i){if(i<1||i>255)throw new RangeError("Degree out of range");let s=[];for(let u=0;u<i-1;u++)s.push(0);s.push(1);let c=1;for(let u=0;u<i;u++){for(let m=0;m<s.length;m++)s[m]=e.reedSolomonMultiply(s[m],c),m+1<s.length&&(s[m]^=s[m+1]);c=e.reedSolomonMultiply(c,2)}return s}static reedSolomonComputeRemainder(i,s){let c=s.map(u=>0);for(let u of i){let m=u^c.shift();c.push(0),s.forEach((d,h)=>c[h]^=e.reedSolomonMultiply(d,m))}return c}static reedSolomonMultiply(i,s){if(i>>>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)*i;return o(c>>>8==0),c}finderPenaltyCountPatterns(i){let s=i[1];o(s<=this.size*3);let c=s>0&&i[2]==s&&i[3]==s*3&&i[4]==s&&i[5]==s;return(c&&i[0]>=s*4&&i[6]>=s?1:0)+(c&&i[6]>=s*4&&i[0]>=s?1:0)}finderPenaltyTerminateAndCount(i,s,c){return i&&(this.finderPenaltyAddHistory(s,c),s=0),s+=this.size,this.finderPenaltyAddHistory(s,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(i,s){s[0]==0&&(i+=this.size),s.pop(),s.unshift(i)}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]]}l.QrCode=e;function t(a,i,s){if(i<0||i>31||a>>>i)throw new RangeError("Value out of range");for(let c=i-1;c>=0;c--)s.push(a>>>c&1)}function n(a,i){return(a>>>i&1)!=0}function o(a){if(!a)throw new Error("Assertion error")}class r{constructor(i,s,c){this.mode=i;this.numChars=s;this.bitData=c;if(s<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}mode;numChars;bitData;static makeBytes(i){let s=[];for(let c of i)t(c,8,s);return new r(r.Mode.BYTE,i.length,s)}static makeNumeric(i){if(!r.isNumeric(i))throw new RangeError("String contains non-numeric characters");let s=[];for(let c=0;c<i.length;){let u=Math.min(i.length-c,3);t(parseInt(i.substr(c,u),10),u*3+1,s),c+=u}return new r(r.Mode.NUMERIC,i.length,s)}static makeAlphanumeric(i){if(!r.isAlphanumeric(i))throw new RangeError("String contains unencodable characters in alphanumeric mode");let s=[],c;for(c=0;c+2<=i.length;c+=2){let u=r.ALPHANUMERIC_CHARSET.indexOf(i.charAt(c))*45;u+=r.ALPHANUMERIC_CHARSET.indexOf(i.charAt(c+1)),t(u,11,s)}return c<i.length&&t(r.ALPHANUMERIC_CHARSET.indexOf(i.charAt(c)),6,s),new r(r.Mode.ALPHANUMERIC,i.length,s)}static makeSegments(i){return i==""?[]:r.isNumeric(i)?[r.makeNumeric(i)]:r.isAlphanumeric(i)?[r.makeAlphanumeric(i)]:[r.makeBytes(r.toUtf8ByteArray(i))]}static makeEci(i){let s=[];if(i<0)throw new RangeError("ECI assignment value out of range");if(i<128)t(i,8,s);else if(i<16384)t(2,2,s),t(i,14,s);else if(i<1e6)t(6,3,s),t(i,21,s);else throw new RangeError("ECI assignment value out of range");return new r(r.Mode.ECI,0,s)}static isNumeric(i){return r.NUMERIC_REGEX.test(i)}static isAlphanumeric(i){return r.ALPHANUMERIC_REGEX.test(i)}getData(){return this.bitData.slice()}static getTotalBits(i,s){let c=0;for(let u of i){let m=u.mode.numCharCountBits(s);if(u.numChars>=1<<m)return 1/0;c+=4+m+u.bitData.length}return c}static toUtf8ByteArray(i){i=encodeURI(i);let s=[];for(let c=0;c<i.length;c++)i.charAt(c)!="%"?s.push(i.charCodeAt(c)):(s.push(parseInt(i.substr(c+1,2),16)),c+=2);return s}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}l.QrSegment=r})(ye||={});(t=>{let e;(o=>{class n{constructor(l,a){this.ordinal=l;this.formatBits=a}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=t.QrCode||={})})(ye||={});(t=>{let e;(o=>{class n{constructor(l,a){this.modeBits=l;this.numBitsCharCount=a}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(l){return this.numBitsCharCount[Math.floor((l+7)/17)]}}o.Mode=n})(e=t.QrSegment||={})})(ye||={});var U=ye;var te={L:U.QrCode.Ecc.LOW,M:U.QrCode.Ecc.MEDIUM,Q:U.QrCode.Ecc.QUARTILE,H:U.QrCode.Ecc.HIGH},Qe=128,xe="Q",ne="#FFFFFF",Ve="#000000";var Ye=0;var We=.1;var Ie=24;var Kt=.5,ve=1.5;var Jt=.07;var en=3,bt=64,yt=8,tn=.42;var nn=.5,rn=2;var on="#d1d5db";function zr(e,t=3){let n=10**t;return Math.round(e*n)/n+0}function y(e,t=3){return String(zr(e,t))}function Xe(e,...t){let n=e[0]??"";for(let o=0;o<t.length;o++){let r=t[o];n+=(typeof r=="number"?y(r):r)+(e[o+1]??"")}return n}var Ur={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Gr=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,xt=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function _e(e,t=Number.POSITIVE_INFINITY){if(!Gr.test(e))return null;let n=[],o=0,r=()=>{for(;o<e.length&&/[\s,]/.test(e[o]);)o++},l=()=>{r(),xt.lastIndex=o;let s=xt.exec(e);if(!s)return null;let c=s[0],u=c.indexOf(".");if(u>=0&&c.length-u-1>t)return null;o=xt.lastIndex;let m=Number(c);return Number.isFinite(m)?m:null},a=()=>{r();let s=e[o];return s==="0"||s==="1"?(o++,s==="1"?1:0):null},i=()=>(r(),o<e.length&&/[0-9.+-]/.test(e[o]));for(r();o<e.length;){let s=e[o],c=s.toUpperCase(),u=Ur[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,d=!0;for(;d||i();){let h=[];for(let b=0;b<u;b++){let p=c==="A"&&(b===3||b===4)?a():l();if(p===null)return null;h.push(p)}n.push({command:m,values:h}),c==="M"&&(m=s==="M"?"L":"l"),d=!1}r()}return n}function sn(e){let t=0;for(let{command:n}of e)t+=n.toUpperCase()==="A"?4:1;return t}function St(e,t=1,n=0,o=0){let r="";for(let{command:l,values:a}of e){let i=l.toUpperCase(),s=l===i,c=s?n:0,u=s?o:0,m;switch(i){case"Z":m=[];break;case"H":m=[y(a[0]*t+c)];break;case"V":m=[y(a[0]*t+u)];break;case"A":m=[y(Math.abs(a[0])*t),y(Math.abs(a[1])*t),y(a[2]),String(a[3]),String(a[4]),y(a[5]*t+c),y(a[6]*t+u)];break;default:m=a.map((d,h)=>y(d*t+(h%2===0?c:u)))}r+=l+m.join(" ")}return r}function ln(e,t=.25){let n=[],o=[],r=[0,0],l=[0,0],a=()=>{o.length>2&&n.push(o),o=[]};for(let i of e)if(i.op==="M")a(),r=[i.x,i.y],l=r,o.push(r);else if(i.op==="L")l=[i.x,i.y],o.push(l);else if(i.op==="C"){let s=l,c=[i.x1,i.y1],u=[i.x2,i.y2],m=[i.x,i.y],d=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]),h=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(d/(4*t)))));for(let b=1;b<=h;b++){let p=b/h,g=1-p;o.push([g*g*g*s[0]+3*g*g*p*c[0]+3*g*p*p*u[0]+p*p*p*m[0],g*g*g*s[1]+3*g*g*p*c[1]+3*g*p*p*u[1]+p*p*p*m[1]])}l=m}else a(),l=r;return a(),n}function Ze(e,t){let n=[r=>r[0]-t.x0,r=>t.x1-r[0],r=>r[1]-t.y0,r=>t.y1-r[1]],o=e;for(let r of n){if(o.length===0)break;let l=o;o=[];for(let a=0;a<l.length;a++){let i=l[a],s=l[(a+l.length-1)%l.length],c=r(i),u=r(s);c>=0?(u<0&&o.push(an(s,i,u,c)),o.push(i)):u>=0&&o.push(an(s,i,u,c))}}return o.length>2?o:[]}function an(e,t,n,o){let r=n/(n-o);return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function cn(e){return e.filter(t=>t.length>2).map(t=>`M${t.map(([n,o])=>`${y(n)} ${y(o)}`).join("L")}Z`).join("")}function un(e){let t=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,l=(a,i)=>{t=Math.min(t,a),n=Math.min(n,i),o=Math.max(o,a),r=Math.max(r,i)};for(let a of e)a.op==="C"?(l(a.x1,a.y1),l(a.x2,a.y2),l(a.x,a.y)):a.op!=="Z"&&l(a.x,a.y);return Number.isFinite(t)?{x0:t,y0:n,x1:o,y1:r}:null}var Et=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function Hr(e,t,n,o,r,l,a,i,s){if(e===i&&t===s)return[];let c=Math.abs(n),u=Math.abs(o);if(c===0||u===0)return[{op:"L",x:i,y:s}];let m=r*Math.PI/180,d=Math.cos(m),h=Math.sin(m),b=(e-i)/2,p=(t-s)/2,g=d*b+h*p,f=-h*b+d*p,x=g*g/(c*c)+f*f/(u*u);x>1&&(c*=Math.sqrt(x),u*=Math.sqrt(x));let S=c*c*u*u-c*c*f*f-u*u*g*g,A=c*c*f*f+u*u*g*g,M=(l===a?-1:1)*Math.sqrt(Math.max(0,S/A)),E=M*c*f/u,F=-M*u*g/c,L=d*E-h*F+(e+i)/2,T=h*E+d*F+(t+s)/2,B=(G,O,$,ee)=>Math.atan2(G*ee-O*$,G*$+O*ee),q=B(1,0,(g-E)/c,(f-F)/u),Y=B((g-E)/c,(f-F)/u,(-g-E)/c,(-f-F)/u);!a&&Y>0?Y-=2*Math.PI:a&&Y<0&&(Y+=2*Math.PI);let W=Math.max(1,Math.ceil(Math.abs(Y)/(Math.PI/2)-1e-9)),se=Y/W,Fe=4/3*Math.tan(se/4),Re=(G,O)=>[L+c*d*G-u*h*O,T+c*h*G+u*d*O],J=[];for(let G=0;G<W;G++){let O=q+G*se,$=O+se,[ee,we]=Re(Math.cos(O)-Fe*Math.sin(O),Math.sin(O)+Fe*Math.cos(O)),[Pe,ze]=Re(Math.cos($)+Fe*Math.sin($),Math.sin($)-Fe*Math.cos($)),[Yt,dt]=G===W-1?[i,s]:Re(Math.cos($),Math.sin($));J.push({op:"C",x1:ee,y1:we,x2:Pe,y2:ze,x:Yt,y:dt})}return J}function je(e){let t=[],n=0,o=0,r=0,l=0,a=0,i="",s=null,c=null,u=()=>{for(;n<e.length&&/[\s,]/.test(e[n]);)n++},m=()=>{u(),Et.lastIndex=n;let b=Et.exec(e);return b?(n=Et.lastIndex,Number(b[0])):null},d=()=>{u();let b=e[n];return b==="0"||b==="1"?(n++,b==="1"):null},h=b=>{let p=[];for(let g=0;g<b;g++){let f=m();if(f===null)return null;p.push(f)}return p};for(;u(),!(n>=e.length);){let b=e[n];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(b))i=b,n++;else if(!i||i==="Z"||i==="z")break;let p=i===i.toLowerCase(),g=p?o:0,f=p?r:0,x=i.toUpperCase();if(x==="Z"){t.push({op:"Z"}),o=l,r=a,s=null,c=null;continue}if(x==="A"){let E=h(3),F=d(),L=d(),T=h(2);if(!(E&&T)||F===null||L===null)break;let[B,q,Y]=E,W=T[0]+g,se=T[1]+f;t.push(...Hr(o,r,B,q,Y,F,L,W,se)),o=W,r=se,s=null,c=null;continue}let S={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[x]??0,A=h(S);if(!A)break;let M=A;switch(x){case"M":o=M[0]+g,r=M[1]+f,l=o,a=r,t.push({op:"M",x:o,y:r}),i=p?"l":"L",s=null,c=null;break;case"L":case"H":case"V":x!=="V"&&(o=M[0]+g),x==="V"?r=M[0]+f:x==="L"&&(r=M[1]+f),t.push({op:"L",x:o,y:r}),s=null,c=null;break;case"C":case"S":{let E,F;x==="C"?(E=[M[0]+g,M[1]+f],F=M.slice(2)):(E=s?[2*o-s[0],2*r-s[1]]:[o,r],F=M);let L=[F[0]+g,F[1]+f],T=[F[2]+g,F[3]+f];t.push({op:"C",x1:E[0],y1:E[1],x2:L[0],y2:L[1],x:T[0],y:T[1]}),[o,r]=T,s=L,c=null;break}case"Q":case"T":{let E,F;x==="Q"?(E=[M[0]+g,M[1]+f],F=[M[2]+g,M[3]+f]):(E=c?[2*o-c[0],2*r-c[1]]:[o,r],F=[M[0]+g,M[1]+f]),t.push({op:"C",x1:o+2/3*(E[0]-o),y1:r+2/3*(E[1]-r),x2:F[0]+2/3*(E[0]-F[0]),y2:F[1]+2/3*(E[1]-F[1]),x:F[0],y:F[1]}),[o,r]=F,c=E,s=null;break}default:break}}return t}var mn=.5522847498;function Mt(e,t,n,o,r=0,l=0){if(n<=0||o<=0)return[];let a=Math.min(Math.max(r,0),n/2),i=Math.min(Math.max(l,0),o/2);if(a===0||i===0)return[{op:"M",x:e,y:t},{op:"L",x:e+n,y:t},{op:"L",x:e+n,y:t+o},{op:"L",x:e,y:t+o},{op:"Z"}];let s=a*mn,c=i*mn,u=e+n,m=t+o;return[{op:"M",x:e+a,y:t},{op:"L",x:u-a,y:t},{op:"C",x1:u-a+s,y1:t,x2:u,y2:t+i-c,x:u,y:t+i},{op:"L",x:u,y:m-i},{op:"C",x1:u,y1:m-i+c,x2:u-a+s,y2:m,x:u-a,y:m},{op:"L",x:e+a,y:m},{op:"C",x1:e+a-s,y1:m,x2:e,y2:m-i+c,x:e,y:m-i},{op:"L",x:e,y:t+i},{op:"C",x1:e,y1:t+i-c,x2:e+a-s,y2:t,x:e+a,y:t},{op:"Z"}]}var dn="qrdx.frame",hn=1,pn="custom",v={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},gn=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],Ke=.95,Qr=200,bn=["frame","text","accent","background"],Vr=/[\t\n\v\f\r\u0085\u2028\u2029]/g,Yr=/[\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 Ft(e,t=Ie){let n=e.slice(0,1e3).normalize("NFC").replace(Vr," ").replace(Yr,"").replace(/\s+/g," ").trim();return Array.from(n).slice(0,Math.max(0,t)).join("").trim()}var Je=e=>Math.abs(e*1e3-Math.round(e*1e3))<1e-6;function Rt(e){let t=et(e);return{x0:e.qr.x-t,y0:e.qr.y-t,x1:e.qr.x+e.qr.size+t,y1:e.qr.y+e.qr.size+t}}function Wr(e){return{x0:e.qr.x,y0:e.qr.y,x1:e.qr.x+e.qr.size,y1:e.qr.y+e.qr.size}}function et(e){return e.qr.padding??e.qr.size*v.defaultPadding}var wt=.52,Xr=.35;function Zr(e){let t=e.fontSize??e.box.height*wt;return Math.min(t*ve,e.box.height*Ke)}var At=(e,t)=>Math.min(e.x1,t.x1)-Math.max(e.x0,t.x0)>1e-6&&Math.min(e.y1,t.y1)-Math.max(e.y0,t.y0)>1e-6;function fn(e){let t=Rt(e),n=Math.min(e.qr.radius??0,(t.x1-t.x0)/2,(t.y1-t.y0)/2),o=[[t.x0+n,t.y0+n,Math.PI],[t.x1-n,t.y0+n,-Math.PI/2],[t.x1-n,t.y1-n,0],[t.x0+n,t.y1-n,Math.PI/2]],r=[];for(let[l,a,i]of o)for(let s=0;s<=8;s++){let c=i+Math.PI/2*(s/8);r.push([l+n*Math.cos(c),a+n*Math.sin(c)])}return r}function jr([e,t],n,o){if(e<n.x-.01||t<n.y-.01||e>n.x+n.width+.01||t>n.y+n.height+.01)return!1;let l=Math.min(o,n.width/2,n.height/2),a=Math.min(Math.max(e,n.x+l),n.x+n.width-l),i=Math.min(Math.max(t,n.y+l),n.y+n.height-l);return Math.hypot(e-a,t-i)<=l+.01}function Kr(e){let t=0;return e.forEach(([n,o],r)=>{let[l,a]=e[(r+1)%e.length];t+=n*a-l*o}),Math.abs(t)/2}function Jr(e,t,n){let o=Rt(t);if(!At(n,o))return!1;if("stroke"in e&&e.stroke)return!0;if(e.fill==="background")return!1;if(e.type==="rect"&&e.hole){let{hole:r}=e;return!fn(t).every(l=>jr(l,r,r.radius??0))}if(e.type==="circle"&&e.hole){let r=e.hole;return!fn(t).every(([l,a])=>Math.hypot(l-e.cx,a-e.cy)<=r+.01)}if(e.type==="polygon"){let r=Ze(e.points,o);return r.length>2&&Kr(r)>1e-6}return!0}function Pt(e){let t=eo(e),n="stroke"in e?e.stroke:void 0;if(!(n&&t.bounds))return t;let o=e.type==="circle"||e.type==="ellipse"?n.width/2:e.type==="rect"?n.width*Math.SQRT2/2:n.width*2,{x0:r,y0:l,x1:a,y1:i}=t.bounds;return{bounds:{x0:r-o,y0:l-o,x1:a+o,y1:i+o},segments:t.segments*2}}function eo(e){switch(e.type){case"rect":return{bounds:{x0:e.x,y0:e.y,x1:e.x+e.width,y1:e.y+e.height},segments:e.hole?18:9};case"circle":return{bounds:{x0:e.cx-e.r,y0:e.cy-e.r,x1:e.cx+e.r,y1:e.cy+e.r},segments:e.hole?10:5};case"ellipse":return{bounds:{x0:e.cx-e.rx,y0:e.cy-e.ry,x1:e.cx+e.rx,y1:e.cy+e.ry},segments:5};case"polygon":{let t=e.points.map(([o])=>o),n=e.points.map(([,o])=>o);return{bounds:{x0:Math.min(...t),y0:Math.min(...n),x1:Math.max(...t),y1:Math.max(...n)},segments:e.points.length}}case"path":{let t=_e(e.d,v.maxDecimals);return t?{bounds:un(je(e.d)),segments:sn(t)}:{bounds:null,segments:0}}case"line":{let t=e.width/2,n=Math.hypot(e.x2-e.x1,e.y2-e.y1),o=e.dash?Math.ceil(n/(e.dash[0]+e.dash[1])):1;return{bounds:{x0:Math.min(e.x1,e.x2)-t,y0:Math.min(e.y1,e.y2)-t,x1:Math.max(e.x1,e.x2)+t,y1:Math.max(e.y1,e.y2)+t},segments:o*(e.cap==="round"?4:5)}}default:return{bounds:{x0:e.x,y0:e.y,x1:e.x+e.size,y1:e.y+e.size},segments:Qr}}}function yn(e,t){let n=v,o=new TextEncoder().encode(JSON.stringify(e)).length;if(o>n.maxBytes){t(`The spec is ${o} bytes; the limit is ${n.maxBytes}`);return}let{width:r,height:l}=e.artboard,a=Math.max(r,l)*.005,i={x0:-a,y0:-a,x1:r+a,y1:l+a},s=f=>f.x0>=i.x0&&f.y0>=i.y0&&f.x1<=i.x1&&f.y1<=i.y1,{qr:c}=e,u=et(e);c.plate!=="none"&&u<c.size*n.minPadding-1e-9&&t(`qr.padding must be at least ${n.minPadding*100}% of qr.size`,["qr","padding"]),c.size<Math.min(r,l)*n.minQrShare-1e-9&&t(`qr.size must be at least ${n.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let m=Rt(e);(m.x0<-1e-9||m.y0<-1e-9||m.x1>r+1e-9||m.y1>l+1e-9)&&t("The code and its padding must sit inside the artboard",["qr"]),(c.radius??0)>(c.size+2*u)/2&&t("qr.radius is larger than half the plate",["qr","radius"]);let d=0,h=0;e.shapes.forEach((f,x)=>{let S=["shapes",x],{bounds:A,segments:M}=Pt(f);if(!A){t("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",[...S,"d"]);return}if(s(A)||t("The shape extends outside the artboard",S),f.type==="rect"&&f.hole){let{hole:E}=f;(E.x<f.x||E.y<f.y||E.x+E.width>f.x+f.width+1e-9||E.y+E.height>f.y+f.height+1e-9)&&t("The hole must sit inside its rect",[...S,"hole"])}f.type==="circle"&&f.hole&&f.hole>=f.r&&t("The hole must be smaller than the circle",[...S,"hole"]),"stroke"in f&&f.stroke&&f.stroke.width>Math.min(r,l)*.1+1e-9&&t("A stroke may be at most 10% of the artboard's shorter side",[...S,"stroke","width"]),c.plate==="background"&&Jr(f,e,A)&&t('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',S),d+=M,typeof f.fill=="object"&&"gradient"in f.fill&&(h+=(f.fill.gradient.steps??32)*M)}),d>n.maxSegments&&t(`The shapes have ${d} segments; the limit is ${n.maxSegments}`,["shapes"]),h>n.maxGradientWork&&t("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let b=[],p=new Set,g=new Set;e.labels.forEach((f,x)=>{let S=["labels",x];p.has(f.id)&&t(`Label id "${f.id}" is used twice`,[...S,"id"]),p.add(f.id),f.slot!=="fixed"&&(g.has(f.slot)&&t(`Only one label may use the ${f.slot} slot`,[...S,"slot"]),g.add(f.slot));let A=f.maxLength??n.maxTextLength;f.text!==Ft(f.text,A)&&t(`Label text must be at most ${A} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...S,"text"]);let M;if(f.type==="text"){M={x0:f.box.x,y0:f.box.y,x1:f.box.x+f.box.width,y1:f.box.y+f.box.height},f.fontSize!==void 0&&f.fontSize>f.box.height*Ke+1e-9&&t("fontSize may be at most 95% of the label's row height",[...S,"fontSize"]);let E=f.box.y+f.box.height/2,F=Zr(f)*Xr,L={x0:M.x0,x1:M.x1,y0:E-F,y1:E+F};(At(M,Wr(e))||At(L,m))&&t("The label overlaps the code or its padding",[...S,"box"])}else{let{cx:E,cy:F,radius:L}=f.curve,T=f.fontSize*ve*.6;M={x0:E-L-T,y0:F-L-T,x1:E+L+T,y1:F+L+T};let B=Math.hypot(Math.max(m.x0-E,0,E-m.x1),Math.max(m.y0-F,0,F-m.y1));Math.hypot(Math.max(Math.abs(m.x0-E),Math.abs(m.x1-E)),Math.max(Math.abs(m.y0-F),Math.abs(m.y1-F)))<=L-T||B>=L+T||t("The curved label crosses the code or its padding",[...S,"curve"])}if(s(M)||t("The label extends outside the artboard",S),f.collapse){let E=f.collapse,F=E.y+E.height;(E.y<-1e-9||F>l+1e-9)&&t("The collapse band must sit inside the artboard",[...S,"collapse"]),F>m.y0+1e-6&&E.y<m.y1-1e-6&&t("The collapse band crosses the code or its padding",[...S,"collapse"]);for(let L of b)F>L.y+1e-6&&E.y<L.y+L.height-1e-6&&t("Collapse bands may not overlap",[...S,"collapse"]);b.push(E)}})}var Lt=(e,t=0)=>{for(let n=t;n<e.length;n++)if(e[n]?.continue!==!0)return!0;return!1};function re(e,t=[],n={}){return{...n,run(o){let r=e({value:o,issues:[]}),l=Lt(r.issues);for(let a of t){if(a.hasLength){let s=r.value;if(r.issues.some(c=>c.continue===!1)||s===null||s===void 0||s.length===void 0)continue}else if(l)continue;let i=r.issues.length;a.run(r),!l&&r.issues.length>i&&(l=Lt(r.issues,i))}return r}}}function to(e){if(typeof e=="number")return Number.isNaN(e)?"NaN":Number.isFinite(e)?"number":String(e);if(e===null)return"null";if(Array.isArray(e))return"array";if(typeof e=="object"){let t=e.constructor;if(Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&t)return t.name}return typeof e}var me=(e,t)=>({path:[],message:`Invalid input: expected ${e}, received ${to(t)}`}),no={string:"characters",array:"items"};function Z(e,t,n,o){let r=no[t],l=e?"Too big":"Too small",a=`${e?"<=":">="}${n}`;return{path:[],message:r?`${l}: expected ${t} to have ${a} ${r}`:`${l}: expected ${t} to be ${a}`,continue:o}}var Ct=e=>typeof e=="string"?`"${e}"`:`${e}`,Mn=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function kt(e,t,n){for(let o of n)o.path.unshift(t),e.push(o)}var ro=e=>e>=55296&&e<=56319,oo=e=>e>=56320&&e<=57343;function io(e){let t=e.length;for(let n=0;n<e.length-1;n++)ro(e.charCodeAt(n))&&oo(e.charCodeAt(n+1))&&(t--,n++);return t}var An=e=>Array.isArray(e)?"array":typeof e=="string"?"string":"unknown",$e=e=>({run(t){t.value<e&&t.issues.push(Z(!1,"number",e,!0))}}),Ne=e=>({run(t){t.value>e&&t.issues.push(Z(!0,"number",e,!0))}}),Me=(e,t="Invalid input")=>({run(n){e(n.value)||n.issues.push({path:[],message:t,continue:!0})}}),Fn=e=>typeof e=="string"?io(e):e.length,Rn=e=>({hasLength:!0,run(t){let n=t.value;Fn(n)<e&&t.issues.push(Z(!1,An(n),e,!0))}}),Tt=e=>({hasLength:!0,run(t){let n=t.value;Fn(n)>e&&t.issues.push(Z(!0,An(n),e,!0))}}),wn=(e,t)=>({run(n){e.lastIndex=0,e.test(n.value)||n.issues.push({path:[],message:t??`Invalid string: must match pattern ${e}`,continue:!0})}}),so={run(e){let t=e.value;Number.isInteger(t)?Number.isSafeInteger(t)||e.issues.push(t>0?Z(!0,"int",Number.MAX_SAFE_INTEGER,!0):Z(!1,"int",Number.MIN_SAFE_INTEGER,!0)):e.issues.push({...me("int",t),continue:!1})}},fe=(...e)=>re(t=>{let n=t.value;return typeof n=="number"&&Number.isFinite(n)||t.issues.push(me("number",n)),t},e),Pn=(...e)=>fe(so,...e),tt=(...e)=>re(t=>(typeof t.value!="string"&&t.issues.push(me("string",t.value)),t),e);function Q(e){let t=e.length===1?`Invalid input: expected ${Ct(e[0])}`:`Invalid option: expected one of ${e.map(Ct).join("|")}`;return re(n=>(e.includes(n.value)||n.issues.push({path:[],message:t}),n),[],{values:e})}var H=e=>Q([e]),P=e=>({optional:!0,run:t=>t===void 0?{value:t,issues:[]}:e.run(t)});function C(e,t=[]){let n=Object.keys(e),o=new Set(n);return re(r=>{let l=r.value;if(!Mn(l))return r.issues.push(me("object",l)),r;let a={};for(let s of n){let c=e[s],u=c.run(l[s]),m=s in l;kt(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&&(a[s]=u.value)}r.value=a;let i=[];for(let s in l)o.has(s)||i.push(s);return i.length>0&&r.issues.push({path:[],message:`Unrecognized key${i.length>1?"s":""}: ${i.map(Ct).join(", ")}`,continue:!0}),r},t,{shape:e})}function It(e,t,n){let o=[];return t!==void 0&&o.push(Rn(t)),n!==void 0&&o.push(Tt(n)),re(r=>{let l=r.value;if(Array.isArray(l)&&n!==void 0&&l.length>n)return r.issues.push(Z(!0,"array",n,!1)),r;if(!Array.isArray(l))return r.issues.push(me("array",l)),r;let a=new Array(l.length);for(let i=0;i<l.length;i++){let s=e.run(l[i]);kt(r.issues,i,s.issues),a[i]=s.value}return r.value=a,r},o)}function vt(e){return re(t=>{let n=t.value;if(!Array.isArray(n))return t.issues.push(me("tuple",n)),t;if(n.length<e.length)return t.issues.push(Z(!1,"array",e.length,void 0)),t;n.length>e.length&&t.issues.push(Z(!0,"array",e.length,void 0));let o=[];return e.forEach((r,l)=>{let a=r.run(n[l]);kt(t.issues,l,a.issues),o[l]=a.value}),t.value=o,t})}function Ee(e){return re(t=>{let n=[];for(let r of e){let l=r.run(t.value);if(l.issues.length===0)return l;n.push(l)}let o=n.filter(r=>!Lt(r.issues));return o.length===1?o[0]:(t.issues.push({path:[],message:"Invalid input"}),t)})}function Ln(e,t){let n=new Map;for(let r of t)for(let l of r.shape?.[e]?.values??[])n.set(l,r);let o=`Invalid discriminator value. Expected ${[...n.keys()].map(r=>`'${r}'`).join(" | ")}`;return re(r=>{let l=r.value;if(!Mn(l))return r.issues.push(me("object",l)),r;let a=n.get(l[e]);return a?a.run(l):(r.issues.push({path:[e],message:o}),r)})}var ao=Me(Je,`Numbers may have at most ${v.maxDecimals} decimals`),rt=[$e(-v.maxCoordinate),Ne(v.maxCoordinate),ao],_=fe(...rt),N=fe(...rt,Me(e=>e>0,"Must be greater than 0")),nt=fe(...rt,Me(e=>e>=0,"Must not be negative")),Te=tt(wn(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color")),xn=Ee([Q(bn),Te]),Cn=e=>C({mix:vt([e,e]),amount:fe($e(0),Ne(1),Me(Je))}),Se=Ee([xn,Cn(xn)]),lo=Ee([Te,Cn(Ee([Q(["frame","accent","background"]),Te]))]),ue=Ee([Se,C({gradient:C({from:Se,to:Se,direction:P(Q(["horizontal","vertical"])),steps:P(Pn($e(2),Ne(v.maxGradientSteps)))})})]),_t=()=>({x:_,y:_,width:N,height:N}),ke=C({color:Se,width:N}),co=Ln("type",[C({type:H("rect"),..._t(),radius:P(nt),fill:ue,hole:P(C({..._t(),radius:P(nt)})),stroke:P(ke)}),C({type:H("circle"),cx:_,cy:_,r:N,hole:P(N),fill:ue,stroke:P(ke)}),C({type:H("ellipse"),cx:_,cy:_,rx:N,ry:N,fill:ue,stroke:P(ke)}),C({type:H("polygon"),points:It(vt([_,_]),3,v.maxPolygonPoints),fill:ue,stroke:P(ke)}),C({type:H("path"),d:tt(Rn(2),Tt(v.maxPathLength)),fill:ue,fillRule:P(Q(["nonzero","evenodd"])),stroke:P(ke)}),C({type:H("line"),x1:_,y1:_,x2:_,y2:_,width:N,cap:P(Q(["butt","round"])),dash:P(vt([N,N])),fill:ue}),C({type:H("icon"),icon:Q(gn),x:_,y:_,size:N,fill:ue})]),Sn=()=>({id:tt(wn(/^[a-z][a-z0-9-]{0,31}$/)),slot:Q(["primary","secondary","fixed"]),text:tt(Tt(200)),maxLength:P(Pn($e(1),Ne(Ie))),color:Se,weight:P(Q(["bold","regular"])),collapse:P(C({y:_,height:N}))}),uo=Ln("type",[C({type:H("text"),...Sn(),box:C(_t()),align:P(Q(["start","middle","end"])),fontSize:P(N)}),C({type:H("curved"),...Sn(),curve:C({cx:_,cy:_,radius:N,side:Q(["top","bottom"]),spread:P(fe($e(20),Ne(300),Me(Je)))}),fontSize:N})]),En=fe(...rt,Me(e=>e>=v.minArtboard&&e<=v.maxArtboard,`Artboard sides must be ${v.minArtboard} to ${v.maxArtboard} units`)),mo=C({kind:H(dn),version:H(hn),artboard:C({width:En,height:En}),qr:C({x:_,y:_,size:N,padding:P(nt),radius:P(nt),plate:P(Q(["opaque","background","none"]))}),colors:C({frame:Te,text:P(lo),accent:P(Te)}),shapes:It(co,void 0,v.maxShapes),labels:It(uo,void 0,v.maxLabels),bleed:P(Ee([H("none"),Se]))},[{run(e){yn(e.value,(t,n=[])=>{e.issues.push({path:[...n],message:t,continue:!0})})}}]);function In(e){let t=mo.run(e);return t.issues.length===0?{success:!0,data:t.value}:{success:!1,issues:t.issues.map(({path:n,message:o})=>({path:n,message:o}))}}var vn=({path:e,message:t})=>e.length>0?`${e.join(".")}: ${t}`:t;function z(e){if(e.length===0)return"";let[t,...n]=e;return`M${y(t[0])} ${y(t[1])}${n.map(([o,r])=>`L${y(o)} ${y(r)}`).join("")}Z`}function I(e,t,n){return`M${y(e-n)} ${y(t)}A${y(n)} ${y(n)} 0 1 1 ${y(e+n)} ${y(t)}A${y(n)} ${y(n)} 0 1 1 ${y(e-n)} ${y(t)}Z`}function R(e,t,n,o,r=0){let l=Math.min(n,o)/2,[a,i,s,c]=(typeof r=="number"?[r,r,r,r]:r).map(m=>Math.max(0,Math.min(m,l))),u=(m,d,h)=>m>0?`A${y(m)} ${y(m)} 0 0 1 ${y(d)} ${y(h)}`:"";return`M${y(e+a)} ${y(t)}H${y(e+n-i)}${u(i,e+n,t+i)}V${y(t+o-s)}${u(s,e+n-s,t+o)}H${y(e+c)}${u(c,e,t+o-c)}V${y(t+a)}${u(a,e+a,t)}Z`}function ot(e,t,n,o,r=5){return Array.from({length:r*2},(l,a)=>{let i=a%2===0?n:o,s=-Math.PI/2+Math.PI/r*a;return[e+i*Math.cos(s),t+i*Math.sin(s)]})}function _n(e,t,n){let o=n/2,r=(l,a)=>`${y(e+l*o)} ${y(t+a*o)}`;return`M${r(0,-.52)}C${r(.18,-.92)} ${r(.98,-.94)} ${r(1,-.34)}C${r(1,.12)} ${r(.5,.48)} ${r(0,.92)}C${r(-.5,.48)} ${r(-1,.12)} ${r(-1,-.34)}C${r(-.98,-.94)} ${r(-.18,-.92)} ${r(0,-.52)}Z`}function $t(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}var kn=24,oe=(e,t,n,o)=>{let r=o*Math.PI/180;return[e+n*Math.cos(r),t+n*Math.sin(r)]},it=([e,t])=>`${y(e)} ${y(t)}`;function Ae(e,t,n,o,r,l){let a=l-r>180?1:0;return`M${it(oe(e,t,o,r))}A${y(o)} ${y(o)} 0 ${a} 1 ${it(oe(e,t,o,l))}L${it(oe(e,t,n,l))}A${y(n)} ${y(n)} 0 ${a} 0 ${it(oe(e,t,n,r))}Z`}function Oe(e,t,n,o){return`M${y(e-n)} ${y(t)}A${y(n)} ${y(o)} 0 1 1 ${y(e+n)} ${y(t)}A${y(n)} ${y(o)} 0 1 1 ${y(e-n)} ${y(t)}Z`}function fo(e){let t=0;return e.forEach(([n,o],r)=>{let[l,a]=e[(r+1)%e.length];t+=n*a-l*o}),t/2}function Tn(e){return z(fo(e)<0?[...e].reverse():e)}function st(e,t,n,o,r){let l=Math.hypot(n-e,o-t)||1,a=-(o-t)/l*(r/2),i=(n-e)/l*(r/2);return Tn([[e+a,t+i],[n+a,o+i],[n-a,o-i],[e-a,t-i]])}var D=(...e)=>({d:e.join(""),fillRule:"nonzero"}),j=(...e)=>({d:e.join(""),fillRule:"evenodd"});function ho(){let e=[];for(let t of[0,60,120]){let[n,o]=oe(12,12,10.5,t+180),[r,l]=oe(12,12,10.5,t);e.push(st(n,o,r,l,2))}for(let t=0;t<6;t++){let n=t*60,[o,r]=oe(12,12,6.2,n);for(let l of[-45,45]){let[a,i]=oe(o,r,3.6,n+l);e.push(st(o,r,a,i,1.7))}}return D(...e)}var po={wifi:()=>D(Ae(12,20,4.6,7.2,-135,-45),Ae(12,20,9.2,11.8,-135,-45),Ae(12,20,13.8,16.4,-135,-45),I(12,20,2.2)),star:()=>D(z(ot(12,12.8,11.6,4.8))),heart:()=>D(_n(12,12.4,22)),phone:()=>j(R(6,1.5,12,21,2.6),R(7.8,4.2,8.4,13.4,.6),I(12,19.8,1.1)),headphones:()=>D(Ae(12,13,7.6,9.8,-180,0),R(2,12,5,9.5,2),R(17,12,5,9.5,2)),calendar:()=>j(R(2.5,4,19,17.5,2.5),R(4.6,9,14.8,10.6,.8),R(7,11.4,2.6,2.6,.4),R(10.7,11.4,2.6,2.6,.4),R(14.4,11.4,2.6,2.6,.4),R(7,15.1,2.6,2.6,.4),R(10.7,15.1,2.6,2.6,.4),R(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),R(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>D(I(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:()=>j(R(2,3,20,14,4),z([[6.5,17],[11.5,17],[5.8,21.8]]),I(7.5,10,1.5),I(12,10,1.5),I(16.5,10,1.5)),bag:()=>D(R(3.5,7.5,17,14.5,2),Ae(12,7.5,3.1,4.8,-180,0)),bell:()=>D("M3.5 17.2A8.5 8.5 0 0 1 20.5 17.2Z",R(1.5,18.2,21,2.6,1.3),R(11.2,6.6,1.6,2.6,0),R(9.8,4.6,4.4,2.4,1.2)),cup:()=>D("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",Ae(17,10.2,1.7,3.6,-90,90),R(2,20.6,17,2,1),R(7,1.6,1.6,3.4,.8),R(11.6,1.6,1.6,3.4,.8)),card:()=>j(R(1.5,4.5,21,15,2.5),R(1.5,8,21,3,0),R(4.5,13.6,4.6,3.2,.6)),check:()=>j(I(12,12,10.5),z([[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:()=>j(I(12,12,10.5),I(12,7.2,1.6),R(10.6,10,2.8,8,.8)),home:()=>j(z([[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]]),R(10,14.5,4,7,[.6,.6,0,0])),pin:()=>j("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",I(12,9.5,3)),share:()=>D(st(6,12,18,5,1.8),st(6,12,18,19,1.8),I(18,5,3.2),I(6,12,3.2),I(18,19,3.2)),download:()=>D(R(10.6,2,2.8,9.5,0),z([[6,10],[18,10],[12,16.5]]),z([[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:()=>j(I(12,12,10.5),I(12,12,8.4),z([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:ho,pumpkin:()=>D(Oe(7.8,14.6,5.8,6.9),Oe(16.2,14.6,5.8,6.9),Oe(12,14.6,4.8,7.4),R(10.9,3.4,2.2,4.6,.8),Tn([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>D(z([[12,1.5],[16.8,8.2],[7.2,8.2]]),z([[12,5.2],[19,13.6],[5,13.6]]),z([[12,9.4],[21.2,19.2],[2.8,19.2]]),R(10.4,18.6,3.2,3.9,.4)),sparkle:()=>D(z(ot(9.5,13.5,9,2.4,4)),z(ot(19,5,4,1.1,4))),gift:()=>D(R(3,11.2,7.8,10.6,1),R(13.2,11.2,7.8,10.6,1),R(2,7.4,8.8,3.2,1),R(13.2,7.4,8.8,3.2,1),Oe(8.8,4.8,2.9,1.9),Oe(15.2,4.8,2.9,1.9))};function $n(e){return po[e]()}var go={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"},bo=Object.fromEntries(Object.entries(go).map(([e,t])=>[e,[Number.parseInt(t.slice(0,2),16),Number.parseInt(t.slice(2,4),16),Number.parseInt(t.slice(4,6),16)]]));function Nn(e,t){let n=e.trim(),o=Number.parseFloat(n);return Number.isNaN(o)?Number.NaN:n.endsWith("%")?o/100*t:o}function de(e){if(!e)return null;let t=e.trim().toLowerCase();if(t==="transparent")return{r:0,g:0,b:0,a:0};let n=bo[t];if(n)return{r:n[0],g:n[1],b:n[2],a:1};if(t.startsWith("#")){let r=t.slice(1);return(r.length===3||r.length===4)&&(r=r.split("").map(l=>l+l).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(t);if(o){let[r,l]=o[1].split("/"),a=r.split(/[\s,]+/).filter(Boolean);if(a.length!==(l===void 0&&a.length===4?4:3))return null;let i=l??a[3],[s,c,u]=a.slice(0,3).map(h=>Nn(h,255)),m=i===void 0?1:Nn(i,1);if([s,c,u,m].some(h=>Number.isNaN(h)))return null;let d=(h,b)=>Math.min(Math.max(h,0),b);return{r:d(s,255),g:d(c,255),b:d(u,255),a:d(m,1)}}return null}function On(e){return e===" "?.3:/[MWmw@%]/.test(e)?.92:/[A-Z0-9#&]/.test(e)?.72:/[il.,:;!'|1]/.test(e)?.32:.6}function Ot(e){let t=0;for(let n of e)t+=On(n);return Math.max(t,1)}var Nt=e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,"0");function at(e,t,n){let o=de(e)??{r:0,g:0,b:0,a:1},r=de(t)??{r:255,g:255,b:255,a:1},l=Math.min(1,Math.max(0,n));return`#${Nt(o.r+(r.r-o.r)*l)}${Nt(o.g+(r.g-o.g)*l)}${Nt(o.b+(r.b-o.b)*l)}`}function Dn(e,t,n,o,r,l,a,i){let s=[...e],c=r*.08,u=s.map(p=>On(p)*r),m=u.reduce((p,g)=>p+g,0)+c*Math.max(0,s.length-1),d=l==="top"?o-r*.35:o+r*.35,h=[],b=0;return s.forEach((p,g)=>{let f=u[g],x=(b+f/2)/d;if(b+=f+c,p.trim()==="")return;let S=l==="top"?-Math.PI/2-m/2/d+x:Math.PI/2+m/2/d-x;h.push({text:p,x:t+d*Math.cos(S),y:n+d*Math.sin(S),fontSize:r,maxWidth:r*2,color:a,rotate:S*180/Math.PI+(l==="top"?90:-90),field:i})}),h}function De(e,t="#000000"){return e?typeof e=="string"?e:e.type==="solid"?e.color:e.type==="image"?e.underlay||t:(e.type==="linear"||e.type==="radial"||e.type==="angular")&&e.stops[0]?.color||t:t}var lt=class extends Error{issues;constructor(t){super(`Invalid frame spec: ${t.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=t}},Bn=new WeakMap;function Dt(e){if(e&&typeof e=="object"){let n=Bn.get(e);if(n)return n}if(e==null)throw new lt(['A "custom" frame needs a spec']);let t=In(e);if(!t.success)throw new lt(t.issues.map(vn));return typeof e=="object"&&Bn.set(e,t.data),t.data}var yo=e=>{let t=de(e);return!!(t&&t.a>=1)};function xo(e,t){let n=De(t,ne);return e.qr.plate==="none"?{color:n,plate:!1}:yo(n)?{color:n,plate:!0}:e.qr.plate==="background"?{color:n,plate:!1}:{color:ne,plate:!0}}function zn(e,t,n=ne){let o=t.color||e.colors.frame,r=t.secondaryColor||e.colors.accent||o,l=s=>s==="frame"?o:s==="accent"?r:s==="background"?n:s,a=e.colors.text,i=t.textColor||(a===void 0?o:typeof a=="string"?a:at(l(a.mix[0]),l(a.mix[1]),a.amount));return{frame:o,text:i,accent:r}}function So(e,t,n){let o=zn(t,e,n),r=l=>{switch(l){case"frame":return o.frame;case"text":return o.text;case"accent":return o.accent;case"background":return n;default:return l}};return l=>typeof l=="string"?r(l):at(r(l.mix[0]),r(l.mix[1]),l.amount)}function qn(e,t,n=0,o=0){let r=_e(e);return r?St(r,t,n,o):""}function Eo(e,t,n,o){return`M${y(e-n)} ${y(t)}A${y(n)} ${y(o)} 0 1 1 ${y(e+n)} ${y(t)}A${y(n)} ${y(o)} 0 1 1 ${y(e-n)} ${y(t)}Z`}function Mo(e,t){let[n,o,r,l]=[e.x1*t,e.y1*t,e.x2*t,e.y2*t],a=Math.hypot(r-n,l-o),i=e.width*t/2,s=a>0?(r-n)/a:1,c=a>0?(l-o)/a:0,u=-c*i,m=s*i,d=(g,f)=>{let x=[n+s*g,o+c*g],S=[n+s*f,o+c*f];if(e.cap==="round"&&f-g>2*i){let A=[x[0]+s*i,x[1]+c*i],M=[S[0]-s*i,S[1]-c*i];return`M${y(A[0]-u)} ${y(A[1]-m)}L${y(M[0]-u)} ${y(M[1]-m)}A${y(i)} ${y(i)} 0 0 1 ${y(M[0]+u)} ${y(M[1]+m)}L${y(A[0]+u)} ${y(A[1]+m)}A${y(i)} ${y(i)} 0 0 1 ${y(A[0]-u)} ${y(A[1]-m)}Z`}return`M${y(x[0]-u)} ${y(x[1]-m)}L${y(S[0]-u)} ${y(S[1]-m)}L${y(S[0]+u)} ${y(S[1]+m)}L${y(x[0]+u)} ${y(x[1]+m)}Z`};if(!e.dash)return{type:"path",d:d(0,a),fillRule:"nonzero"};let h=e.dash[0]*t,b=h+e.dash[1]*t,p=[];for(let g=0;g+h<=a+1e-6;g+=b)p.push(d(g,g+h));return{type:"path",d:p.join(""),fillRule:"nonzero"}}function Ao(e,t){switch(e.type){case"rect":return{type:"rect",x:e.x*t,y:e.y*t,width:e.width*t,height:e.height*t,radius:(e.radius??0)*t,...e.hole&&{hole:{x:e.hole.x*t,y:e.hole.y*t,width:e.hole.width*t,height:e.hole.height*t,radius:(e.hole.radius??0)*t}}};case"circle":return{type:"path",d:I(e.cx*t,e.cy*t,e.r*t)+(e.hole?I(e.cx*t,e.cy*t,e.hole*t):""),fillRule:e.hole?"evenodd":"nonzero"};case"ellipse":return{type:"path",d:Eo(e.cx*t,e.cy*t,e.rx*t,e.ry*t),fillRule:"nonzero"};case"polygon":return{type:"polygon",points:e.points.map(([n,o])=>[n*t,o*t])};case"path":return{type:"path",d:qn(e.d,t),fillRule:e.fillRule??"nonzero"};case"line":return Mo(e,t);default:{let n=$n(e.icon);return{type:"path",d:qn(n.d,e.size*t/kn,e.x*t,e.y*t),fillRule:n.fillRule}}}}function Fo(e){if(e.type==="rect"){let{x:t,y:n,width:o,height:r,radius:l,hole:a}=e;return[...Mt(t,n,o,r,l,l),...a?Mt(a.x,a.y,a.width,a.height,a.radius,a.radius):[]]}return e.type==="polygon"?[...e.points.map(([t,n],o)=>o===0?{op:"M",x:t,y:n}:{op:"L",x:t,y:n}),{op:"Z"}]:je(e.d)}function Ro(e,t,n){let o=Fo(e),r=ln(o,.2),l=e.type==="rect"?e.hole?"evenodd":"nonzero":e.type==="path"?e.fillRule??"nonzero":"nonzero",a=t.direction==="vertical",i=g=>a?g[1]:g[0],s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;for(let g of r)for(let f of g)s=Math.min(s,i(f)),c=Math.max(c,i(f));if(!(c>s))return[];let u=t.steps??32,m=n(t.from),d=n(t.to),h=c-s,b=h*.002,p=[];for(let g=0;g<u;g++){let f=s+h*g/u,x=Math.min(c,s+h*(g+1)/u+(g+1<u?b:0)),S=a?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:f,y1:x}:{x0:f,x1:x,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},A=r.map(M=>Ze(M,S)).filter(M=>M.length>2);A.length!==0&&p.push({type:"path",d:cn(A),fill:at(m,d,(g+.5)/u),fillRule:l})}return p}function wo(e,t,n){let o=Ao(e,t),r="stroke"in e&&e.stroke?{stroke:n(e.stroke.color),strokeWidth:e.stroke.width*t}:void 0;if(typeof e.fill=="object"&&"gradient"in e.fill){let l=Ro(o,e.fill.gradient,n);return r?[...l,{...o,fill:"none",...r}]:l}return[{...o,fill:n(e.fill),...r}]}function Po(e,t){let n=Math.min(e.maxLength??v.maxTextLength,v.maxTextLength),o=e.slot==="primary"?t.text??e.text:e.slot==="secondary"?t.secondaryText??e.text:e.text;return Ft(o,n)}function Lo(e){return e===void 0||!Number.isFinite(e)?1:Math.min(ve,Math.max(Kt,e))}function Co(e,t,n,o,r,l){let a=r(e.color),i=e.weight==="regular"?{fontWeight:400}:{};if(e.type==="curved"){let{cx:p,cy:g,radius:f,side:x,spread:S=140}=e.curve,A=f*o*(S*Math.PI/180),M=Math.min(e.fontSize*o*n,A/(Ot(t)+.08*t.length));return Dn(t,p*o,g*o,f*o,M,x,a,l).map(E=>({...E,...i}))}let s=e.box.x*o,c=e.box.y*o,u=e.box.width*o,m=e.box.height*o;if(!(m>0))return[];let d=(e.fontSize??e.box.height*wt)*o,h=Math.min(d*n,m*Ke,u/Ot(t)),b=e.align??"middle";return[{text:t,x:b==="start"?s:b==="end"?s+u:s+u/2,y:c+m/2+h*.35,fontSize:h,maxWidth:u,color:a,...b!=="middle"&&{align:b},...i,field:l}]}function Io(e){let t=0,n=0,o=0,r=0;return e.map(({command:l,values:a})=>{let i=l.toUpperCase(),s=l!==i;switch(i){case"Z":return t=o,n=r,{command:"Z",values:[]};case"H":return t=(s?t:0)+a[0],{command:"H",values:[t]};case"V":return n=(s?n:0)+a[0],{command:"V",values:[n]};case"A":return t=(s?t:0)+a[5],n=(s?n:0)+a[6],{command:"A",values:[...a.slice(0,5),t,n]};default:{let c=a.map((u,m)=>s?u+(m%2===0?t:n):u);return t=c.at(-2),n=c.at(-1),i==="M"&&(o=t,r=n),{command:i,values:c}}}})}function vo(e,t){let n=_e(e);return n?St(Io(n).map(({command:o,values:r})=>o==="V"?{command:o,values:[t(r[0])]}:o==="H"||o==="Z"?{command:o,values:r}:o==="A"?{command:o,values:[...r.slice(0,6),t(r[6])]}:{command:o,values:r.map((l,a)=>a%2===1?t(l):l)})):e}function _o(e,t){let n=(o,r)=>{let l=t(o);return{y:l,height:t(o+r)-l}};switch(e.type){case"rect":return{...e,...n(e.y,e.height),...e.hole&&{hole:{...e.hole,...n(e.hole.y,e.hole.height)}}};case"circle":case"ellipse":return{...e,cy:t(e.cy)};case"polygon":return{...e,points:e.points.map(([o,r])=>[o,t(r)])};case"path":return{...e,d:vo(e.d,t)};case"line":return{...e,y1:t(e.y1),y2:t(e.y2)};default:return{...e,y:t(e.y)}}}function ko(e,t){if(t.length===0)return e;let n=r=>{let l=r;for(let a of t)l-=Math.min(Math.max(r-a.y,0),a.height);return l},o=(r,l)=>t.some(a=>r>=a.y-1e-6&&l<=a.y+a.height+1e-6);return{...e,artboard:{...e.artboard,height:n(e.artboard.height)},qr:{...e.qr,y:n(e.qr.y)},shapes:e.shapes.filter(r=>{let{bounds:l}=Pt(r);return!(l&&o(l.y0,l.y1))}).map(r=>_o(r,n)),labels:e.labels.map(r=>{if(r.type==="curved")return{...r,curve:{...r.curve,cy:n(r.curve.cy)}};let l=n(r.box.y);return{...r,box:{...r.box,y:l,height:n(r.box.y+r.box.height)-l}}})}}function Bt(e,t,n,o,r={}){let l=new Map(t.labels.map(g=>[g.id,Po(g,n)])),a=ko(t,t.labels.flatMap(g=>g.collapse&&!l.get(g.id)?[g.collapse]:[])),i=e/a.qr.size,s=xo(a,o),c=So(n,a,s.color),u=a.shapes.flatMap(g=>wo(g,i,c));if(s.plate){let g=et(a)*i;u.push({type:"rect",x:a.qr.x*i-g,y:a.qr.y*i-g,width:e+2*g,height:e+2*g,radius:(a.qr.radius??0)*i,fill:s.color})}let m=Lo(n.fontScale),d=a.labels.flatMap(g=>{let f=l.get(g.id);if(!f)return[];let x=(g.slot==="fixed"?void 0:r[g.slot])??g.id;return Co(g,f,m,i,c,x)}),h=d[0],b=h&&h.rotate===void 0?h:null,p=a.bleed??"none";return{width:a.artboard.width*i,height:a.artboard.height*i,qrX:a.qr.x*i,qrY:a.qr.y*i,qrSize:e,shapes:u,label:b,extraLabels:b?d.slice(1):d,squareEdges:p!=="none",color:c(p==="none"?"frame":p)}}function Un(e,t,n){return Bt(e,Dt(t.spec),t,n)}var Gn={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 qt={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 Hn={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 Qn={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 Vn={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 Yn={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 Wn={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 Xn={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 Zn={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 ct={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 jn={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 Kn={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 Jn={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 er={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 tr={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 nr={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 rr={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 or={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 ir={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 k=(e,t,n,o,r)=>({style:e,name:t,tags:r,labelOn:o,spec:n}),sr=[k("banner-bottom","Banner",qt,"frame",["bottom","band"]),k("banner-top","Top banner",Hn,"frame",["top","band"]),k("banner-top-bottom","Two banners",Qn,"frame",["top","bottom","band"]),k("border","Border",Vn,"background",["square","outline"]),k("rounded-border","Rounded",er,"background",["border","outline"]),k("gradient-border","Gradient",ct,"background",["border","colorful"]),k("focus","Focus",Zn,"background",["corners","brackets"]),k("speech-bubble","Bubble",tr,"frame",["speech"]),k("speech-bubble-top","Bubble top",nr,"frame",["speech"]),k("chat-bubble","Chat",Yn,"frame",["message","bubble"]),k("circle","Circle",Wn,"frame",["round","ring","curved"]),k("badge","Ribbon",Gn,"frame",["badge","banner"]),k("sticker","Sticker",rr,"frame",["label"]),k("polaroid","Polaroid",Jn,"frame",["photo","picture"]),k("phone","Phone",Kn,"background",["mobile","screen"]),k("ticket","Ticket",ir,"frame",["event","pass"]),k("tag","Tag",or,"frame",["price","label"]),k("envelope","Envelope",Xn,"frame",["mail","letter"]),k("menu-card","Menu card",jn,"background",["menu","restaurant"])],Jo=new Map(sr.map(e=>[e.style,e]));function ei(e){return Jo.get(e)}var la=Object.fromEntries(sr.map(e=>[e.style,e.spec])),ca={from:ct.colors.frame,to:ct.colors.accent};var ti={primary:"text",secondary:"secondaryText"};function ar(e,t,n){let o=ei(t.style)?.spec??qt;return Bt(e,Dt(o),t,n,ti)}var ni="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif";function ur(e){return!!(e?.style&&e.style!=="none")}function mr(e,t,n){return t.style===pn?Un(e,t,n):ar(e,t,n)}function ri(e){return[...e.label?[e.label]:[],...e.extraLabels??[]]}function fr(e,t){let n=({x:r,y:l,width:a,height:i,radius:s})=>{let c=Math.min(s,a/2,i/2);e.moveTo(r+c,l),e.arcTo(r+a,l,r+a,l+i,c),e.arcTo(r+a,l+i,r,l+i,c),e.arcTo(r,l+i,r,l,c),e.arcTo(r,l,r+a,l,c),e.closePath()},o=(r,l)=>{r.stroke&&r.strokeWidth&&(e.strokeStyle=r.stroke,e.lineWidth=r.strokeWidth,e.lineJoin="miter",e.miterLimit=4,l?e.stroke(l):e.stroke())};for(let r of t.shapes){let l=!(r.fill==="transparent"||r.fill==="none");if(l||r.stroke){if(e.fillStyle=r.fill,r.type==="path"){if(typeof Path2D<"u"){let a=new Path2D(r.d);l&&e.fill(a,r.fillRule??"nonzero"),o(r,a)}continue}e.beginPath(),r.type==="polygon"?(r.points.forEach(([a,i],s)=>{s===0?e.moveTo(a,i):e.lineTo(a,i)}),e.closePath(),l&&e.fill()):(n(r),r.hole&&n(r.hole),l&&e.fill("evenodd")),o(r)}}for(let r of ri(t))e.fillStyle=r.color,e.font=`${r.fontWeight??700} ${r.fontSize}px ${ni}`,e.textAlign=r.align==="start"?"left":r.align==="end"?"right":"center",e.textBaseline="alphabetic",r.rotate?(e.save(),e.translate(r.x,r.y),e.rotate(r.rotate*Math.PI/180),e.fillText(r.text,0,0,r.maxWidth),e.restore()):e.fillText(r.text,r.x,r.y,r.maxWidth)}var oi=.22,ii=.14;function si(e,t){let n=e.w*t,o=e.h*t;return{x:e.x+n,y:e.y+o,w:e.w-2*n,h:e.h-2*o}}function zt(e,t,n){if(e.beginPath(),t==="circle"){e.arc(n.x+n.w/2,n.y+n.h/2,Math.min(n.w,n.h)/2,0,Math.PI*2);return}let o=t==="rounded"?Math.min(n.w,n.h)*oi:0;o>0&&typeof e.roundRect=="function"?e.roundRect(n.x,n.y,n.w,n.h,o):e.rect(n.x,n.y,n.w,n.h)}function dr(e,t){return t?si(e,ii):e}var{QrCode:Ut}=U,ai={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function li(e){let t=e*4+17,n=new Uint8Array(t*t),o=(a,i)=>{a>=0&&i>=0&&a<t&&i<t&&(n[i*t+a]=1)};for(let a=0;a<t;a++)o(6,a),o(a,6);for(let[a,i]of[[3,3],[t-4,3],[3,t-4]])for(let s=-4;s<=4;s++)for(let c=-4;c<=4;c++)o(a+c,i+s);let r=[];if(e>1){let a=Math.floor(e/7)+2,i=e===32?26:Math.ceil((e*4+4)/(a*2-2))*2;r.push(6);for(let s=t-7;r.length<a;s-=i)r.splice(1,0,s)}let l=r.length-1;for(let[a,i]of r.entries())for(let[s,c]of r.entries())if(!(a===0&&s===0||a===0&&s===l||a===l&&s===0))for(let u=-2;u<=2;u++)for(let m=-2;m<=2;m++)o(i+m,c+u);for(let a=0;a<=8;a++)o(8,a),o(a,8);for(let a=0;a<8;a++)o(t-1-a,8),o(8,t-1-a);if(e>=7)for(let a=0;a<18;a++){let i=t-11+a%3,s=Math.floor(a/3);o(i,s),o(s,i)}return n}function ci(e,t){let n=e*4+17,o=te[t].ordinal,r=Ut.NUM_ERROR_CORRECTION_BLOCKS[o]?.[e]??0,l=Ut.ECC_CODEWORDS_PER_BLOCK[o]?.[e]??0,a=Math.floor(Ut.getNumRawDataModules(e)/8),i=r-a%r,s=Math.floor(a/r),c=Array.from({length:r},(A,M)=>s+(M<i?0:1)),u=[],m=[],d=s-l;for(let A=0;A<=s;A++)for(let M=0;M<r;M++)if(M<i){if(A===d)continue;u.push(M),m.push(A<d?A:A-1)}else u.push(M),m.push(A);if(u.length!==a)throw new Error(`Codeword map: interleave mismatch at version ${e}`);let h=li(e),b=new Int16Array(n*n).fill(-1),p=new Int16Array(n*n).fill(-1),g=new Int8Array(n*n).fill(-1),f=a*8,x=0;for(let A=n-1;A>=1;A-=2){A===6&&(A=5);let M=(A+1&2)===0;for(let E=0;E<n;E++)for(let F=0;F<2;F++){let L=A-F,B=(M?n-1-E:E)*n+L;if(!h[B]&&x<f){let q=x>>>3;b[B]=u[q],p[B]=m[q],g[B]=7-(x&7),x++}}}if(x!==f)throw new Error(`Codeword map: placement mismatch at version ${e}`);let S=ai[`${e}${t}`]??0;return{version:e,level:t,size:n,blocks:r,eccPerBlock:l,blockLengths:c,correctable:Math.floor((l-S)/2),block:b,codeword:p,bit:g}}var ui=8,he=new Map;function hr(e,t){if(!(Number.isInteger(e)&&e>=1&&e<=40))throw new RangeError(`QR version must be 1\u201340, got ${e}`);let n=`${e}${t}`,o=he.get(n);if(o)return he.delete(n),he.set(n,o),o;let r=ci(e,t);if(he.size>=ui){let l=he.keys().next().value;l!==void 0&&he.delete(l)}return he.set(n,r),r}function pr(e,t){let n=new Array(e.blocks).fill(0),o=new Set;for(let r of t){let l=e.block[r]??-1;if(l<0)continue;let a=l*4096+e.codeword[r];o.has(a)||(o.add(a),n[l]=n[l]+1)}return n}var mi={2:6,3:12};function gr(e){let t=[e.start],n=e.start;for(let o of e.segments){let r=o.at(-1);if(o.length===1)t.push(r);else{let l=mi[o.length];for(let a=1;a<=l;a++){let i=a/l,s=1-i;if(o.length===2){let[c]=o;t.push([s*s*n[0]+2*s*i*c[0]+i*i*r[0],s*s*n[1]+2*s*i*c[1]+i*i*r[1]])}else{let[c,u]=o;t.push([s*s*s*n[0]+3*s*s*i*c[0]+3*s*i*i*u[0]+i*i*i*r[0],s*s*s*n[1]+3*s*s*i*c[1]+3*s*i*i*u[1]+i*i*i*r[1]])}}}n=r}return t}function yr(e,t){let n=[];for(let o of e)for(let r=0;r<o.length;r++){let[l,a]=o[r],[i,s]=o[(r+1)%o.length];a<=t!=s<=t&&n.push(l+(t-a)/(s-a)*(i-l))}return n.sort((o,r)=>o-r)}function xr(e,t){let n=0;for(let o of e)if(o<t)n++;else break;return n%2===1}function fi(e,t,n){return xr(yr(e,n),t)}function Sr(e){let t=new Map;return(n,o)=>{let r=t.get(o);return r||(r=yr(e,o),t.set(o,r)),xr(r,n)}}function di(e,t,n,o){let r=n[0]-e,l=n[1]-t,a=o[0]-n[0],i=o[1]-n[1],s=u=>Math.max(Math.abs(r+u*a),Math.abs(l+u*i)),c=Math.min(s(0),s(1));for(let[u,m]of[[l-r,a-i],[-(r+l),a+i]])if(m!==0){let d=u/m;d>0&&d<1&&(c=Math.min(c,s(d)))}return c}function hi(e,t,n){if(!fi(e,t,n))return 0;let o=Number.POSITIVE_INFINITY;for(let r of e)for(let l=0;l<r.length;l++)o=Math.min(o,di(t,n,r[l],r[(l+1)%r.length]));return Number.isFinite(o)?o:0}function pi(e){let t=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let l of e)for(let[a,i]of l)t=Math.min(t,a),n=Math.min(n,i),o=Math.max(o,a),r=Math.max(r,i);return{x0:t,y0:n,x1:o,y1:r}}function Er(e){let t=e.map(gr),n=pi(t),o=n.x1-n.x0,r=n.y1-n.y0;if(!(o>0&&r>0))return null;let l=(b,p)=>{let g=Math.max(b-n.x0,n.x1-b,p-n.y0,n.y1-p);return g>0?hi(t,b,p)/(2*g):0},a={cx:n.x0+o/2,cy:n.y0+r/2,value:0};a.value=l(a.cx,a.cy);let i=32;for(let b=1;b<i;b++)for(let p=1;p<i;p++){let g=n.x0+o*p/i,f=n.y0+r*b/i,x=l(g,f);x>a.value&&(a={cx:g,cy:f,value:x})}let s=o/i,c=r/i;for(let b=0;b<6;b++){let p=a;for(let g=-2;g<=2;g++)for(let f=-2;f<=2;f++){let x=p.cx+s*f/2,S=p.cy+c*g/2,A=l(x,S);A>a.value&&(a={cx:x,cy:S,value:A})}s/=2,c/=2}if(a.value<=0)return null;let m=.5/Math.max(a.cx-n.x0,n.x1-a.cx,a.cy-n.y0,n.y1-a.cy),d=([b,p])=>[.5+(b-a.cx)*m,.5+(p-a.cy)*m],h=e.map(b=>({start:d(b.start),segments:b.segments.map(p=>p.map(d))}));return{rings:h,polygons:h.map(gr),half:a.value}}function Mr(e,t){let n=([r,l])=>`${y(r*t)} ${y(l*t)}`,o="";for(let r of e.rings){o+=`M${n(r.start)}`;for(let l of r.segments){let a=l.length===1?"L":l.length===2?"Q":"C";o+=a+l.map(n).join(" ")}o+="Z"}return o}var gi={start:[0,-.58],segments:[[[.2,-.92],[1,-.97],[1,-.3]],[[1,.3],[.62,.6],[0,.92]],[[-.62,.6],[-1,.3],[-1,-.3]],[[-1,-.97],[-.2,-.92],[0,-.58]]]},br;function Ar(){return br??=Er([gi]),br}function bi(e){let{width:t,height:n,cells:o}=e;return Number.isInteger(t)&&Number.isInteger(n)&&t>=yt&&n>=yt&&t<=bt&&n<=bt&&typeof o=="string"&&o.length===t*n&&/^[01]*$/.test(o)?(r,l)=>r>=0&&l>=0&&r<t&&l<n&&o[l*t+r]==="1":null}var K=([e,t])=>`${e},${t}`;function yi(e,t,n){let o=(s,c)=>e(s-1,c-1),r=new Map,l=(s,c)=>{for(let[u,m]of[[s,c],[c,s]]){let d=r.get(K(u))??[];d.push(m),r.set(K(u),d)}};for(let s=0;s<=n;s++)for(let c=0;c<=t;c++){let u=o(c,s),m=o(c+1,s),d=o(c+1,s+1),h=o(c,s+1),b=[c,s-.5],p=[c+.5,s],g=[c,s+.5],f=[c-.5,s];switch((u?8:0)+(m?4:0)+(d?2:0)+(h?1:0)){case 1:case 14:l(f,g);break;case 2:case 13:l(g,p);break;case 3:case 12:l(f,p);break;case 4:case 11:l(b,p);break;case 6:case 9:l(b,g);break;case 7:case 8:l(f,b);break;case 5:l(b,p),l(f,g);break;case 10:l(f,b),l(g,p);break;default:break}}let a=[],i=new Set;for(let[s,c]of r){if(i.has(s)||c.length===0)continue;let[u,m]=s.split(",").map(Number),d=[[u,m]];i.add(s);let h=[u,m],b=c[0];for(;!i.has(K(b));){i.add(K(b)),d.push(b);let p=xi(r.get(K(b))??[],h,i);if(!p)break;h=b,b=p}d.length>=3&&a.push(Si(d))}return a}function xi(e,t,n){let o=K(t);return e.find(r=>K(r)!==o&&!n.has(K(r)))??e.find(r=>K(r)!==o)}function Si(e){let t=[];for(let n=0;n<e.length;n++){let o=e[(n-1+e.length)%e.length],r=e[n],l=e[(n+1)%e.length],a=(r[0]-o[0])*(l[1]-r[1])-(r[1]-o[1])*(l[0]-r[0]);Math.abs(a)>1e-9&&t.push(r)}return t.length>=3?t:e}function Ei(e){let t=(l,a)=>[(l[0]+a[0])/2,(l[1]+a[1])/2],n=e.length,o=t(e[n-1],e[0]),r=e.map((l,a)=>[l,t(l,e[(a+1)%n])]);return{start:o,segments:r}}var Be=new Map;function Fr(e){let t=`${e.width}x${e.height}:${e.cells}`,n=Be.get(t);if(n)return n;let o=bi(e),r;if(!o)r={outline:null,problem:"invalid"};else if(e.cells.includes("1")){let l=yi(o,e.width,e.height),a=l.length>0?Er(l.map(Ei)):null;r=a&&2*a.half>=tn?{outline:a,problem:null}:{outline:null,problem:a?"thin":"empty"}}else r={outline:null,problem:"empty"};return Be.size>16&&Be.delete(Be.keys().next().value),Be.set(t,r),r}var Mi=1,Rr=.5,wr=.5,Ai=.5;function ut(e){return Math.max(e,en)}function mt(e){return e==="heart"?Ar():typeof e=="object"&&e?.type==="silhouette"?Fr(e).outline:null}function Pr(e){return e==="circle"||mt(e)!==null}function ie(e,t,n){if(n==="circle"){let a=ut(t),i=(e/2+a)*Math.SQRT2+Mi;return Math.ceil(i-e/2)}let o=mt(n);if(!o)return t;let r=ut(t),l=(e+2*(r+Ai))/(2*o.half);return Math.ceil((l-e)/2-1e-9)}function Lr(e){let t=e>>>0;return()=>{t=t+1831565813>>>0;let n=t;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function Fi(e,t,n){let o=ie(t,n,"circle"),r=ut(n),l=t+2*o,a=l/2,i=a-Rr-.5,s=Lr(Number.parseInt($t(e),36)||1),c=o-r,u=o+t+r;return Array.from({length:l},(m,d)=>Array.from({length:l},(h,b)=>{let p=s()<wr;return b>=c&&b<u&&d>=c&&d<u?!1:p&&Math.hypot(b+.5-a,d+.5-a)<=i}))}var Ri=Array.from({length:8},(e,t)=>{let n=t*Math.PI/4;return[Math.cos(n),Math.sin(n)]});function Gt(e,t,n,o){if(o==="circle")return Fi(e,t,n);let r=mt(o);if(!r)return null;let l=ie(t,n,o),a=ut(n),i=t+2*l,s=Sr(r.polygons),c=.5+Rr,u=(b,p)=>{let g=b+.5,f=p+.5;return s(g/i,f/i)?Ri.every(([x,S])=>s((g+x*c)/i,(f+S*c)/i)):!1},m=Lr(Number.parseInt($t(e),36)||1),d=l-a,h=l+t+a;return Array.from({length:i},(b,p)=>Array.from({length:i},(g,f)=>{let x=m()<wr;return f>=d&&f<h&&p>=d&&p<h?!1:x&&u(f,p)}))}function Ht(e,t){if(e==="circle")return{circle:t/2};let n=mt(e);return n?{path:Mr(n,t)}:null}function Cr(e,t,n,o){if(!(e&&Number.isFinite(e))||e<=0||Pr(o)||n<=0)return 0;let r=Math.min(nn,rn*n/(t+2*n));return Math.min(e,r)}var wi=({r:e,g:t,b:n})=>Math.min(.2126*e+.7152*t+.0722*n,.299*e+.587*t+.114*n),Va=wi(de(on));function Ir(e,t){return e.slice().map((n,o)=>o<t.y||o>=t.y+t.h?n:n.map((r,l)=>l<t.x||l>=t.x+t.w?r:!1))}function Qt(e,t=0){let n=[];return e.forEach((o,r)=>{let l=null;o.forEach((a,i)=>{if(!a&&l!==null){n.push(Xe`M${l+t} ${r+t}h${i-l}v1H${l+t}z`),l=null;return}if(i===o.length-1){if(!a)return;l===null?n.push(Xe`M${i+t},${r+t} h1v1H${i+t}z`):n.push(Xe`M${l+t},${r+t} h${i+1-l}v1H${l+t}z`);return}a&&l===null&&(l=i)})}),n.join("")}function qe(e,t,n,o){if(o==null)return null;let r=e.length,l=Math.floor(t*We),a=(r+2*n)/t,i=(o.width||l)*a,s=(o.height||l)*a,c=o.x==null?r/2-i/2:o.x*a,u=o.y==null?r/2-s/2:o.y*a,m=null;if(o.excavate){let d=Math.max(0,o.padding??0)*a,h=Math.floor(c-d),b=Math.floor(u-d),p=Math.ceil(i+c+d-h),g=Math.ceil(s+u+d-b);m={x:h,y:b,w:p,h:g}}return{x:c,y:u,h:s,w:i,excavation:m}}function ft(e){let t=e.level??xe,{imageSettings:n}=e,o=e.isOGContext&&n?.excavate&&(t==="L"||t==="M")?"Q":t;if(e.autoLevel&&n&&o!=="H"){let r=U.QrCode.encodeText(e.value,te[o]).getModules(),l=qe(r,e.size??Qe,ie(r.length,e.margin??Ye,e.shape),n);l&&(l.excavation?l.excavation.w*l.excavation.h:l.w*l.h)/(r.length*r.length)>Jt&&(o="H")}return o}var Vt=(()=>{try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})();var Pi=.6,Li=["L","M","Q","H"];function Ci(e){let t=U.QrCode.encodeText(e.value,te[e.level]),n=Li[t.errorCorrectionLevel.ordinal]??e.level;return{code:e,cells:t.getModules(),layoutMargin:ie(t.size,e.margin,e.shape),map:hr(t.version,n),level:n,version:t.version}}function Ii(e,t){let{cells:n,map:o}=e,r=n.length,l=qe(n,e.code.size,e.layoutMargin,t);if(!l)return null;let a=l.excavation??{x:Math.floor(l.x),y:Math.floor(l.y),w:Math.ceil(l.x+l.w)-Math.floor(l.x),h:Math.ceil(l.y+l.h)-Math.floor(l.y)},i=[];for(let c=Math.max(0,a.y);c<Math.min(r,a.y+a.h);c++)for(let u=Math.max(0,a.x);u<Math.min(r,a.x+a.w);u++)i.push(c*r+u);let s=pr(o,i);return{worst:Math.max(0,...s),correctable:o.correctable,budget:Math.floor(o.correctable*Pi),level:e.level,version:e.version}}var vi=e=>!e||e.worst<=e.budget;function _i(e,t,n,o){let r=t.map(i=>Ci({...e,level:i})),l=i=>{let s=o(i);return r.every(c=>vi(Ii(c,s)))};if(l(n))return n;let a=e.size*.005;for(let i=n-a;i>0;i-=a)if(l(i))return i;return 0}function vr(e,t){if(!t)return;let n=Math.floor(e.size*We),o=t.width||n,r=t.height||n,l=d=>{if(d===o)return t;let h=r*d/o;return{...t,width:d,height:h,...t.x!=null&&{x:t.x+(o-d)/2},...t.y!=null&&{y:t.y+(r-h)/2}}},a=e.level??xe,i={value:e.value,size:e.size,margin:e.margin,shape:e.shape},s=d=>ft({...e,level:a,imageSettings:d}),c=d=>{let h=_i(i,[d],o,l);return h>0?l(h):void 0},u=s(t);if(u===a)return c(a);let m=c(u);return m&&s(m)===u?m:c(a)}var ge=require("react/jsx-runtime");function ki(e){let{value:t,size:n=Qe,level:o=xe,bgColor:r=ne,fgColor:l=Ve,margin:a=Ye,style:i,imageSettings:s,eyeColor:c,dotColor:u,bodyPattern:m,cornerEyePattern:d,cornerEyeDotPattern:h,isOGContext:b,templateId:p,customTemplate:g,customProps:f,frame:x,art:S,eyeColors:A,moduleScale:M,eyeShapes:E,eyeGradient:F,halo:L,shadow:T,autoLevel:B,shape:q,bgRadius:Y,backdrop:W,frameLabelMarkers:se,partMarkers:Fe,...Re}=e,J=vr({value:t,size:n,margin:a,level:o,shape:q,autoLevel:B},s),G=ft({value:t,size:n,level:o,margin:a,imageSettings:J,autoLevel:B,shape:q}),O=J?.src,$=ur(x)?mr(n,x,r):null,ee=$?.width??n,we=$?.height??n,Pe=(0,pe.useRef)(null),ze=(0,pe.useRef)(null),[Yt,dt]=(0,pe.useState)(!1);(0,pe.useEffect)(()=>{if(Pe.current!=null){let ht=Pe.current,w=ht.getContext("2d");if(!w)return;let X=U.QrCode.encodeText(t,te[G]).getModules(),ae=ie(X.length,a,q),pt=Gt(t,X.length,a,q),V=X.length+ae*2,le=qe(X,n,ae,J),Ue=ze.current,Xt=le!=null&&Ue?.complete&&Ue.naturalHeight!==0&&Ue.naturalWidth!==0;Xt&&le.excavation!=null&&(X=Ir(X,le.excavation));let Ge=window.devicePixelRatio||1;ht.width=ee*Ge,ht.height=we*Ge,w.scale(Ge,Ge),$&&(fr(w,$),w.translate($.qrX,$.qrY));let Zt=n/V;w.scale(Zt,Zt),w.fillStyle=De(r,ne);let Le=Ht(q,V),jt=Cr(Y,X.length,ae,q)*V;if(Le&&"circle"in Le?(w.beginPath(),w.arc(V/2,V/2,Le.circle,0,2*Math.PI),w.fill()):Le&&Vt?w.fill(new Path2D(Le.path),"evenodd"):jt>0&&typeof w.roundRect=="function"?(W&&(w.save(),w.fillStyle=W,w.fillRect(0,0,V,V),w.restore()),w.beginPath(),w.roundRect(0,0,V,V,jt),w.fill()):w.fillRect(0,0,V,V),w.fillStyle=De(l,Ve),Vt)w.fill(new Path2D(Qt(X,ae))),pt&&w.fill(new Path2D(Qt(pt,0)));else for(let[He,be]of[[X,ae],[pt??[],0]])He.forEach((Ce,ce)=>{Ce.forEach((kr,Tr)=>{kr&&w.fillRect(Tr+be,ce+be,1,1)})});if(Xt){let He={x:le.x+ae,y:le.y+ae,w:le.w,h:le.h},be=J?.shape??"square",Ce=J?.plate,ce=dr(He,Ce);w.save(),Ce&&(zt(w,be,He),w.fillStyle=Ce,w.fill()),be!=="square"&&(zt(w,be,ce),w.clip()),w.drawImage(Ue,ce.x,ce.y,ce.w,ce.h),w.restore()}}});let _r={height:we,width:ee,...i},Wt=null;return O!=null&&(Wt=(0,ge.jsx)("img",{alt:"QR code",onLoad:()=>{dt(!0)},ref:ze,src:O,style:{display:"none"}},O)),(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)("canvas",{height:we,ref:Pe,style:_r,width:ee,...Re}),Wt]})}0&&(module.exports={QRCodeCanvas});
|
|
2
2
|
/**
|
|
3
3
|
* @license QR Code generator library (TypeScript)
|
|
4
4
|
* Copyright (c) Project Nayuki.
|