qrdx 0.0.47 → 0.0.49
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 +9 -7
- package/dist/frames-index.js +2 -0
- package/dist/frames-index.js.map +1 -0
- package/dist/frames-index.mjs +2 -0
- package/dist/frames-index.mjs.map +1 -0
- package/dist/frames-official.js +2 -0
- package/dist/frames-official.js.map +1 -0
- package/dist/frames-official.mjs +2 -0
- package/dist/frames-official.mjs.map +1 -0
- 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/src/download.d.ts +32 -5
- package/dist/src/download.d.ts.map +1 -1
- package/dist/src/frames/catalogue/all.d.ts +4 -0
- package/dist/src/frames/catalogue/all.d.ts.map +1 -0
- package/dist/src/frames/catalogue/business.d.ts +5 -0
- package/dist/src/frames/catalogue/business.d.ts.map +1 -0
- package/dist/src/frames/catalogue/call-to-action.d.ts +5 -0
- package/dist/src/frames/catalogue/call-to-action.d.ts.map +1 -0
- package/dist/src/frames/catalogue/counts.d.ts +15 -0
- package/dist/src/frames/catalogue/counts.d.ts.map +1 -0
- package/dist/src/frames/catalogue/events.d.ts +5 -0
- package/dist/src/frames/catalogue/events.d.ts.map +1 -0
- package/dist/src/frames/catalogue/food-drink.d.ts +5 -0
- package/dist/src/frames/catalogue/food-drink.d.ts.map +1 -0
- package/dist/src/frames/catalogue/health-learning.d.ts +5 -0
- package/dist/src/frames/catalogue/health-learning.d.ts.map +1 -0
- package/dist/src/frames/catalogue/holidays.d.ts +5 -0
- package/dist/src/frames/catalogue/holidays.d.ts.map +1 -0
- package/dist/src/frames/catalogue/index.d.ts +4 -0
- package/dist/src/frames/catalogue/index.d.ts.map +1 -0
- package/dist/src/frames/catalogue/places.d.ts +5 -0
- package/dist/src/frames/catalogue/places.d.ts.map +1 -0
- package/dist/src/frames/catalogue/seasons.d.ts +5 -0
- package/dist/src/frames/catalogue/seasons.d.ts.map +1 -0
- package/dist/src/frames/catalogue/shopping.d.ts +5 -0
- package/dist/src/frames/catalogue/shopping.d.ts.map +1 -0
- package/dist/src/frames/catalogue/tags.d.ts +3 -0
- package/dist/src/frames/catalogue/tags.d.ts.map +1 -0
- package/dist/src/frames/collections.d.ts +6 -0
- package/dist/src/frames/collections.d.ts.map +1 -0
- package/dist/src/frames/official-types.d.ts +35 -0
- package/dist/src/frames/official-types.d.ts.map +1 -0
- package/dist/src/frames/official.d.ts +7 -16
- package/dist/src/frames/official.d.ts.map +1 -1
- package/dist/src/frames/spec-hash.d.ts +9 -0
- package/dist/src/frames/spec-hash.d.ts.map +1 -0
- package/dist/src/index.d.ts +7 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/utils/webp.d.ts +25 -0
- package/dist/src/utils/webp.d.ts.map +1 -0
- package/dist/src/webp.d.ts +19 -0
- package/dist/src/webp.d.ts.map +1 -0
- package/package.json +17 -14
- package/src/download.tsx +70 -37
- package/src/frames/catalogue/all.ts +844 -0
- package/src/frames/catalogue/business.ts +105 -0
- package/src/frames/catalogue/call-to-action.ts +159 -0
- package/src/frames/catalogue/counts.ts +18 -0
- package/src/frames/catalogue/events.ts +73 -0
- package/src/frames/catalogue/food-drink.ts +73 -0
- package/src/frames/catalogue/health-learning.ts +57 -0
- package/src/frames/catalogue/holidays.ts +239 -0
- package/src/frames/catalogue/index.ts +3512 -0
- package/src/frames/catalogue/places.ts +77 -0
- package/src/frames/catalogue/seasons.ts +65 -0
- package/src/frames/catalogue/shopping.ts +69 -0
- package/src/frames/catalogue/tags.ts +412 -0
- package/src/frames/collections.ts +18 -0
- package/src/frames/official/allergen-info.json +77 -0
- package/src/frames/official/app-arrow.json +89 -0
- package/src/frames/official/app-download.json +93 -0
- package/src/frames/official/app-install.json +83 -0
- package/src/frames/official/app-phone-dark.json +87 -0
- package/src/frames/official/app-phone.json +105 -0
- package/src/frames/official/arrow-tag.json +89 -0
- package/src/frames/official/attendance.json +1 -0
- package/src/frames/official/audio-guide.json +1 -0
- package/src/frames/official/autumn-acorn.json +83 -0
- package/src/frames/official/autumn-hills.json +93 -0
- package/src/frames/official/autumn-maple.json +76 -0
- package/src/frames/official/autumn-oak.json +114 -0
- package/src/frames/official/autumn-wheat.json +117 -0
- package/src/frames/official/bakery-cake.json +70 -0
- package/src/frames/official/bar-beer.json +80 -0
- package/src/frames/official/bar-bottle.json +94 -0
- package/src/frames/official/bar-cocktail.json +82 -0
- package/src/frames/official/bar-happy-hour.json +130 -0
- package/src/frames/official/bar-tab.json +78 -0
- package/src/frames/official/bar-wine.json +121 -0
- package/src/frames/official/biz-booking.json +100 -0
- package/src/frames/official/biz-hiring.json +130 -0
- package/src/frames/official/biz-launch.json +123 -0
- package/src/frames/official/biz-repair.json +74 -0
- package/src/frames/official/biz-salon.json +65 -0
- package/src/frames/official/biz-support.json +115 -0
- package/src/frames/official/bizcard-badge.json +89 -0
- package/src/frames/official/bizcard-dark.json +81 -0
- package/src/frames/official/bizcard-edge.json +125 -0
- package/src/frames/official/bizcard-hello.json +108 -0
- package/src/frames/official/bizcard-light.json +100 -0
- package/src/frames/official/bizcard-portrait.json +105 -0
- package/src/frames/official/black-friday-bands.json +120 -0
- package/src/frames/official/black-friday-bolt.json +76 -0
- package/src/frames/official/black-friday-burst.json +131 -0
- package/src/frames/official/black-friday-tab.json +95 -0
- package/src/frames/official/black-friday-tag.json +65 -0
- package/src/frames/official/book-now.json +1 -0
- package/src/frames/official/browser-window.json +120 -0
- package/src/frames/official/bubble-outline.json +88 -0
- package/src/frames/official/bubble-tail-left.json +60 -0
- package/src/frames/official/bubble-tail-right.json +82 -0
- package/src/frames/official/cafe-bean.json +94 -0
- package/src/frames/official/cafe-cup.json +81 -0
- package/src/frames/official/cafe-loyalty.json +89 -0
- package/src/frames/official/cafe-menu-board.json +66 -0
- package/src/frames/official/cafe-steam.json +113 -0
- package/src/frames/official/cafe-wifi.json +105 -0
- package/src/frames/official/chat-pair.json +107 -0
- package/src/frames/official/check-in.json +1 -0
- package/src/frames/official/christmas-bauble.json +71 -0
- package/src/frames/official/christmas-bells.json +127 -0
- package/src/frames/official/christmas-candle.json +122 -0
- package/src/frames/official/christmas-gift-box.json +99 -0
- package/src/frames/official/christmas-holly.json +114 -0
- package/src/frames/official/christmas-market-ticket.json +85 -0
- package/src/frames/official/christmas-postcard.json +95 -0
- package/src/frames/official/christmas-snow-tab.json +80 -0
- package/src/frames/official/christmas-star-seal.json +178 -0
- package/src/frames/official/christmas-tree.json +81 -0
- package/src/frames/official/christmas-wreath.json +96 -0
- package/src/frames/official/christmas.json +2 -0
- package/src/frames/official/circle-badge-top.json +88 -0
- package/src/frames/official/curl-arrow-tinted.json +85 -0
- package/src/frames/official/curl-arrow.json +101 -0
- package/src/frames/official/cyber-monday-browser.json +122 -0
- package/src/frames/official/cyber-monday-neon.json +78 -0
- package/src/frames/official/cyber-monday-ticket.json +86 -0
- package/src/frames/official/cyber-monday-wide.json +78 -0
- package/src/frames/official/diwali-diya.json +82 -0
- package/src/frames/official/diwali-lantern.json +120 -0
- package/src/frames/official/diwali-lotus.json +122 -0
- package/src/frames/official/diwali-marigold.json +71 -0
- package/src/frames/official/diwali-rangoli-card.json +95 -0
- package/src/frames/official/diwali-rangoli.json +175 -0
- package/src/frames/official/diwali-toran.json +110 -0
- package/src/frames/official/donate.json +1 -0
- package/src/frames/official/double-border.json +110 -0
- package/src/frames/official/easter-bunting.json +110 -0
- package/src/frames/official/easter-butterfly.json +83 -0
- package/src/frames/official/easter-corners.json +99 -0
- package/src/frames/official/easter-egg-hunt.json +93 -0
- package/src/frames/official/easter-egg.json +71 -0
- package/src/frames/official/easter-tulip.json +114 -0
- package/src/frames/official/edu-assignment.json +127 -0
- package/src/frames/official/edu-attendance.json +117 -0
- package/src/frames/official/edu-course.json +99 -0
- package/src/frames/official/edu-exam.json +83 -0
- package/src/frames/official/edu-graduation.json +182 -0
- package/src/frames/official/edu-idea.json +94 -0
- package/src/frames/official/edu-lab.json +74 -0
- package/src/frames/official/edu-library.json +70 -0
- package/src/frames/official/edu-open-day.json +109 -0
- package/src/frames/official/eid-adha-envelope.json +75 -0
- package/src/frames/official/eid-adha-lantern.json +80 -0
- package/src/frames/official/eid-adha-night.json +76 -0
- package/src/frames/official/eid-adha-seal.json +99 -0
- package/src/frames/official/eid-fitr-arch.json +71 -0
- package/src/frames/official/eid-fitr-border.json +117 -0
- package/src/frames/official/eid-fitr-gift.json +99 -0
- package/src/frames/official/eid-fitr-lantern.json +120 -0
- package/src/frames/official/eid-fitr-seal.json +181 -0
- package/src/frames/official/event-agenda.json +96 -0
- package/src/frames/official/event-announcement.json +79 -0
- package/src/frames/official/event-badge.json +89 -0
- package/src/frames/official/event-birthday.json +70 -0
- package/src/frames/official/event-check-in.json +117 -0
- package/src/frames/official/event-cinema.json +66 -0
- package/src/frames/official/event-comedy.json +89 -0
- package/src/frames/official/event-concert.json +91 -0
- package/src/frames/official/event-exhibit.json +102 -0
- package/src/frames/official/event-festival.json +109 -0
- package/src/frames/official/event-livestream.json +111 -0
- package/src/frames/official/event-party.json +113 -0
- package/src/frames/official/event-photos.json +104 -0
- package/src/frames/official/event-race.json +80 -0
- package/src/frames/official/event-raffle.json +89 -0
- package/src/frames/official/event-save-the-date.json +113 -0
- package/src/frames/official/event-sports.json +71 -0
- package/src/frames/official/event-theatre.json +115 -0
- package/src/frames/official/event-ticket.json +1 -0
- package/src/frames/official/event-wristband.json +91 -0
- package/src/frames/official/fathers-day-bow-tie.json +114 -0
- package/src/frames/official/fathers-day-photo.json +106 -0
- package/src/frames/official/fathers-day-tie.json +81 -0
- package/src/frames/official/fathers-day-trophy.json +72 -0
- package/src/frames/official/feedback-bubble.json +1 -0
- package/src/frames/official/feedback-survey.json +115 -0
- package/src/frames/official/fitness-challenge.json +72 -0
- package/src/frames/official/fitness-equipment.json +93 -0
- package/src/frames/official/fitness-kettlebell.json +74 -0
- package/src/frames/official/fitness-schedule.json +93 -0
- package/src/frames/official/fitness-timer.json +88 -0
- package/src/frames/official/fitness-trial.json +130 -0
- package/src/frames/official/fitness-yoga.json +70 -0
- package/src/frames/official/folder-tab-arrow.json +78 -0
- package/src/frames/official/folder-tab.json +87 -0
- package/src/frames/official/follow-us.json +1 -0
- package/src/frames/official/food-truck.json +108 -0
- package/src/frames/official/geo-corners.json +98 -0
- package/src/frames/official/get-the-app.json +1 -0
- package/src/frames/official/half-circle.json +66 -0
- package/src/frames/official/halloween-bat.json +76 -0
- package/src/frames/official/halloween-candle.json +71 -0
- package/src/frames/official/halloween-hat.json +90 -0
- package/src/frames/official/halloween-moon.json +90 -0
- package/src/frames/official/halloween-pumpkin.json +100 -0
- package/src/frames/official/halloween-seal.json +170 -0
- package/src/frames/official/halloween-web.json +76 -0
- package/src/frames/official/halloween.json +2 -0
- package/src/frames/official/hang-tag-light.json +60 -0
- package/src/frames/official/hang-tag.json +58 -0
- package/src/frames/official/hanging-tab-two-lines.json +78 -0
- package/src/frames/official/hanging-tab.json +64 -0
- package/src/frames/official/hanukkah-border.json +117 -0
- package/src/frames/official/hanukkah-candles.json +81 -0
- package/src/frames/official/hanukkah-gift.json +99 -0
- package/src/frames/official/hanukkah-menorah.json +114 -0
- package/src/frames/official/hanukkah-star.json +178 -0
- package/src/frames/official/health-appointment.json +113 -0
- package/src/frames/official/health-check-in.json +93 -0
- package/src/frames/official/health-dental.json +102 -0
- package/src/frames/official/health-medication.json +58 -0
- package/src/frames/official/health-pet.json +81 -0
- package/src/frames/official/health-pharmacy.json +94 -0
- package/src/frames/official/health-portal.json +74 -0
- package/src/frames/official/health-waiting-room.json +117 -0
- package/src/frames/official/holi-bands.json +120 -0
- package/src/frames/official/holi-bunting.json +110 -0
- package/src/frames/official/holi-corners.json +99 -0
- package/src/frames/official/holi-splash.json +109 -0
- package/src/frames/official/holi-sticker.json +83 -0
- package/src/frames/official/hotel-bed.json +99 -0
- package/src/frames/official/hotel-breakfast.json +121 -0
- package/src/frames/official/hotel-check-out.json +109 -0
- package/src/frames/official/hotel-concierge.json +115 -0
- package/src/frames/official/hotel-hanger-light.json +69 -0
- package/src/frames/official/hotel-key.json +77 -0
- package/src/frames/official/hotel-room-service.json +66 -0
- package/src/frames/official/ice-cream-shop.json +111 -0
- package/src/frames/official/independence-brazil.json +112 -0
- package/src/frames/official/independence-canada.json +112 -0
- package/src/frames/official/independence-fireworks.json +183 -0
- package/src/frames/official/independence-france.json +100 -0
- package/src/frames/official/independence-india.json +105 -0
- package/src/frames/official/independence-mexico.json +100 -0
- package/src/frames/official/independence-us-fireworks.json +81 -0
- package/src/frames/official/independence-us.json +128 -0
- package/src/frames/official/landscape-light.json +92 -0
- package/src/frames/official/landscape-panel.json +71 -0
- package/src/frames/official/learn-more-card.json +63 -0
- package/src/frames/official/lunar-banner.json +123 -0
- package/src/frames/official/lunar-blossom.json +71 -0
- package/src/frames/official/lunar-coin.json +190 -0
- package/src/frames/official/lunar-knot.json +87 -0
- package/src/frames/official/lunar-lantern.json +120 -0
- package/src/frames/official/lunar-red-envelope.json +82 -0
- package/src/frames/official/menu-arch.json +64 -0
- package/src/frames/official/menu-chalkboard.json +66 -0
- package/src/frames/official/menu-chef.json +80 -0
- package/src/frames/official/menu-cloche.json +121 -0
- package/src/frames/official/menu-cutlery.json +93 -0
- package/src/frames/official/menu-noodles.json +94 -0
- package/src/frames/official/menu-pizza.json +86 -0
- package/src/frames/official/mothers-day-brunch.json +122 -0
- package/src/frames/official/mothers-day-daisy.json +109 -0
- package/src/frames/official/mothers-day-photo.json +106 -0
- package/src/frames/official/mothers-day-tulip.json +71 -0
- package/src/frames/official/neon-tube.json +72 -0
- package/src/frames/official/new-year-calendar.json +115 -0
- package/src/frames/official/new-year-countdown.json +120 -0
- package/src/frames/official/new-year-firework.json +81 -0
- package/src/frames/official/new-year-seal.json +173 -0
- package/src/frames/official/new-year-skyline.json +102 -0
- package/src/frames/official/new-year-sparkle.json +86 -0
- package/src/frames/official/new-year-toast.json +71 -0
- package/src/frames/official/new-year.json +2 -0
- package/src/frames/official/order-at-table.json +1 -0
- package/src/frames/official/order-here-tab.json +98 -0
- package/src/frames/official/order-pickup.json +70 -0
- package/src/frames/official/pack-authentic.json +179 -0
- package/src/frames/official/pack-care.json +60 -0
- package/src/frames/official/pack-eco.json +79 -0
- package/src/frames/official/pack-instructions.json +99 -0
- package/src/frames/official/pack-label.json +91 -0
- package/src/frames/official/pack-parcel.json +96 -0
- package/src/frames/official/pack-recycle.json +121 -0
- package/src/frames/official/pack-reorder.json +92 -0
- package/src/frames/official/pack-unboxing.json +98 -0
- package/src/frames/official/pack-video-guide.json +88 -0
- package/src/frames/official/pack-warranty.json +91 -0
- package/src/frames/official/passover-arch.json +66 -0
- package/src/frames/official/passover-border.json +122 -0
- package/src/frames/official/passover-cup.json +81 -0
- package/src/frames/official/passover-matzah.json +109 -0
- package/src/frames/official/pay-at-table.json +103 -0
- package/src/frames/official/pay-card.json +99 -0
- package/src/frames/official/pay-coins.json +117 -0
- package/src/frames/official/pay-donate-heart.json +77 -0
- package/src/frames/official/pay-invoice.json +115 -0
- package/src/frames/official/pay-receipt.json +131 -0
- package/src/frames/official/pay-tap.json +78 -0
- package/src/frames/official/pay-tips.json +81 -0
- package/src/frames/official/pay-wallet.json +83 -0
- package/src/frames/official/phone-button.json +105 -0
- package/src/frames/official/phone-outline.json +94 -0
- package/src/frames/official/phone-screen.json +96 -0
- package/src/frames/official/polaroid-caption.json +108 -0
- package/src/frames/official/polaroid-photo.json +104 -0
- package/src/frames/official/postage-stamp-light.json +90 -0
- package/src/frames/official/postage-stamp.json +88 -0
- package/src/frames/official/product-info.json +1 -0
- package/src/frames/official/property-floor-plan.json +99 -0
- package/src/frames/official/property-for-sale.json +107 -0
- package/src/frames/official/property-house-light.json +89 -0
- package/src/frames/official/property-house.json +71 -0
- package/src/frames/official/property-key.json +89 -0
- package/src/frames/official/property-open-house.json +79 -0
- package/src/frames/official/property-rent.json +119 -0
- package/src/frames/official/property-virtual-tour.json +77 -0
- package/src/frames/official/ramadan-crescent.json +81 -0
- package/src/frames/official/ramadan-hanging.json +109 -0
- package/src/frames/official/ramadan-iftar-menu.json +95 -0
- package/src/frames/official/ramadan-lantern.json +77 -0
- package/src/frames/official/ramadan-seal.json +183 -0
- package/src/frames/official/rate-your-meal.json +93 -0
- package/src/frames/official/register-product.json +1 -0
- package/src/frames/official/restaurant-booking.json +113 -0
- package/src/frames/official/restaurant-delivery.json +82 -0
- package/src/frames/official/review-bubble.json +82 -0
- package/src/frames/official/review-laurel.json +93 -0
- package/src/frames/official/review-quote.json +74 -0
- package/src/frames/official/review-ribbon.json +136 -0
- package/src/frames/official/review-star.json +88 -0
- package/src/frames/official/review-thumb.json +81 -0
- package/src/frames/official/review-us.json +1 -0
- package/src/frames/official/ribbon-banner-solid.json +115 -0
- package/src/frames/official/ribbon-banner.json +117 -0
- package/src/frames/official/ribbon-sparkle.json +139 -0
- package/src/frames/official/rosette-badge.json +176 -0
- package/src/frames/official/round-badge-light.json +101 -0
- package/src/frames/official/round-badge.json +104 -0
- package/src/frames/official/rsvp-card.json +1 -0
- package/src/frames/official/save-contact.json +1 -0
- package/src/frames/official/scalloped-badge.json +172 -0
- package/src/frames/official/scan-button-tinted.json +72 -0
- package/src/frames/official/scan-button.json +97 -0
- package/src/frames/official/scan-for-directions.json +105 -0
- package/src/frames/official/scan-for-link.json +120 -0
- package/src/frames/official/scan-for-schedule.json +96 -0
- package/src/frames/official/scan-me-band-top.json +102 -0
- package/src/frames/official/scan-me-band.json +88 -0
- package/src/frames/official/scan-me-card.json +69 -0
- package/src/frames/official/scan-me-tile.json +55 -0
- package/src/frames/official/scan-to-call.json +95 -0
- package/src/frames/official/scan-to-download-file.json +74 -0
- package/src/frames/official/scan-to-email.json +91 -0
- package/src/frames/official/scan-to-listen.json +107 -0
- package/src/frames/official/scan-to-pay.json +1 -0
- package/src/frames/official/scan-to-share.json +96 -0
- package/src/frames/official/scan-to-sign-up.json +89 -0
- package/src/frames/official/scan-to-subscribe.json +91 -0
- package/src/frames/official/scan-to-vote.json +86 -0
- package/src/frames/official/scan-to-watch.json +75 -0
- package/src/frames/official/school-book.json +71 -0
- package/src/frames/official/school-calendar.json +115 -0
- package/src/frames/official/school-notebook.json +128 -0
- package/src/frames/official/school-palette.json +84 -0
- package/src/frames/official/school-pencil.json +81 -0
- package/src/frames/official/school-ruler.json +114 -0
- package/src/frames/official/shop-awning.json +108 -0
- package/src/frames/official/shop-bag.json +70 -0
- package/src/frames/official/shop-cart.json +76 -0
- package/src/frames/official/shop-coupon.json +129 -0
- package/src/frames/official/shop-fashion.json +58 -0
- package/src/frames/official/shop-gift-card.json +98 -0
- package/src/frames/official/shop-hanger.json +88 -0
- package/src/frames/official/shop-jewelry.json +121 -0
- package/src/frames/official/shop-loyalty.json +92 -0
- package/src/frames/official/shop-new-arrivals.json +139 -0
- package/src/frames/official/shop-percent.json +75 -0
- package/src/frames/official/shop-price-check.json +106 -0
- package/src/frames/official/shop-sale-burst.json +130 -0
- package/src/frames/official/shop-sale-tag.json +63 -0
- package/src/frames/official/shop-tshirt.json +81 -0
- package/src/frames/official/shop-window-sticker.json +104 -0
- package/src/frames/official/shop-window.json +1 -0
- package/src/frames/official/side-bar-arrow.json +104 -0
- package/src/frames/official/side-bar.json +96 -0
- package/src/frames/official/side-rules-border.json +109 -0
- package/src/frames/official/side-rules.json +73 -0
- package/src/frames/official/sign-rider.json +1 -0
- package/src/frames/official/social-camera.json +104 -0
- package/src/frames/official/social-follow-bubble.json +86 -0
- package/src/frames/official/social-hashtag.json +74 -0
- package/src/frames/official/social-like.json +171 -0
- package/src/frames/official/social-links.json +120 -0
- package/src/frames/official/social-music.json +93 -0
- package/src/frames/official/social-newsletter.json +69 -0
- package/src/frames/official/social-video.json +102 -0
- package/src/frames/official/speech-bubble-over.json +72 -0
- package/src/frames/official/speech-bubble-round.json +86 -0
- package/src/frames/official/spring-blossom.json +114 -0
- package/src/frames/official/spring-butterfly.json +109 -0
- package/src/frames/official/spring-daisy.json +175 -0
- package/src/frames/official/spring-sprout.json +123 -0
- package/src/frames/official/spring-tulip.json +71 -0
- package/src/frames/official/st-patricks-clover.json +175 -0
- package/src/frames/official/st-patricks-horseshoe.json +86 -0
- package/src/frames/official/st-patricks-pub.json +114 -0
- package/src/frames/official/st-patricks-shamrock.json +76 -0
- package/src/frames/official/sticker-grey.json +94 -0
- package/src/frames/official/sticker-outline.json +90 -0
- package/src/frames/official/sticker-peel.json +97 -0
- package/src/frames/official/stitched-card.json +125 -0
- package/src/frames/official/stitched-light.json +107 -0
- package/src/frames/official/summer-ice-pop.json +83 -0
- package/src/frames/official/summer-palm.json +71 -0
- package/src/frames/official/summer-parasol.json +114 -0
- package/src/frames/official/summer-shell.json +122 -0
- package/src/frames/official/summer-sun-scene.json +93 -0
- package/src/frames/official/summer-waves.json +89 -0
- package/src/frames/official/table-number.json +119 -0
- package/src/frames/official/table-tent.json +1 -0
- package/src/frames/official/tap-or-scan-band.json +107 -0
- package/src/frames/official/thanksgiving-acorn.json +71 -0
- package/src/frames/official/thanksgiving-leaf.json +109 -0
- package/src/frames/official/thanksgiving-pumpkin.json +81 -0
- package/src/frames/official/thanksgiving-table.json +95 -0
- package/src/frames/official/thanksgiving-wheat.json +117 -0
- package/src/frames/official/ticket-light.json +67 -0
- package/src/frames/official/ticket-stub.json +78 -0
- package/src/frames/official/ticket-wide.json +97 -0
- package/src/frames/official/travel-boarding-pass.json +118 -0
- package/src/frames/official/travel-city-guide.json +103 -0
- package/src/frames/official/travel-compass.json +100 -0
- package/src/frames/official/travel-directions.json +96 -0
- package/src/frames/official/travel-excursions.json +70 -0
- package/src/frames/official/travel-luggage.json +58 -0
- package/src/frames/official/travel-tour.json +77 -0
- package/src/frames/official/travel-trail.json +97 -0
- package/src/frames/official/two-bands.json +119 -0
- package/src/frames/official/underline-bold.json +79 -0
- package/src/frames/official/underline-left.json +85 -0
- package/src/frames/official/valentine-arrow.json +71 -0
- package/src/frames/official/valentine-bands.json +123 -0
- package/src/frames/official/valentine-dinner.json +122 -0
- package/src/frames/official/valentine-heart.json +76 -0
- package/src/frames/official/valentine-hearts.json +83 -0
- package/src/frames/official/valentine-letter.json +76 -0
- package/src/frames/official/viewfinder-note.json +120 -0
- package/src/frames/official/viewfinder.json +103 -0
- package/src/frames/official/wave-band.json +77 -0
- package/src/frames/official/wedding-invitation.json +122 -0
- package/src/frames/official/wedding-letter.json +78 -0
- package/src/frames/official/wedding-photos.json +105 -0
- package/src/frames/official/wedding-registry.json +98 -0
- package/src/frames/official/wedding-rings.json +71 -0
- package/src/frames/official/wedding-seal.json +179 -0
- package/src/frames/official/wedding-seating.json +102 -0
- package/src/frames/official/wedding-toast.json +121 -0
- package/src/frames/official/wedding-welcome.json +70 -0
- package/src/frames/official/wifi-bubble.json +86 -0
- package/src/frames/official/wifi-card.json +1 -0
- package/src/frames/official/wifi-circle-top.json +91 -0
- package/src/frames/official/wifi-corners.json +117 -0
- package/src/frames/official/wifi-seal.json +104 -0
- package/src/frames/official/wifi-sticker.json +84 -0
- package/src/frames/official/wifi-tab.json +78 -0
- package/src/frames/official/wifi-tile.json +55 -0
- package/src/frames/official/wifi-wide.json +79 -0
- package/src/frames/official/winter-cocoa.json +82 -0
- package/src/frames/official/winter-crystal.json +76 -0
- package/src/frames/official/winter-mitten.json +114 -0
- package/src/frames/official/winter-peaks.json +95 -0
- package/src/frames/official/winter-snow-seal.json +174 -0
- package/src/frames/official/winter.json +2 -0
- package/src/frames/official-types.ts +48 -0
- package/src/frames/official.ts +26 -70
- package/src/frames/spec-hash.ts +34 -0
- package/src/helpers.ts +4 -4
- package/src/index.tsx +23 -4
- package/src/logo-budget.ts +4 -4
- package/src/utils/webp.ts +556 -0
- package/src/webp.ts +84 -0
package/dist/qr-code-canvas.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";"use client";var tr=Object.create;var Vt=Object.defineProperty;var er=Object.getOwnPropertyDescriptor;var nr=Object.getOwnPropertyNames;var rr=Object.getPrototypeOf,or=Object.prototype.hasOwnProperty;var ir=(t,e)=>{for(var n in e)Vt(t,n,{get:e[n],enumerable:!0})},Ge=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of nr(e))!or.call(t,i)&&i!==n&&Vt(t,i,{get:()=>e[i],enumerable:!(r=er(e,i))||r.enumerable});return t};var Ue=(t,e,n)=>(n=t!=null?tr(rr(t)):{},Ge(e||!t||!t.__esModule?Vt(n,"default",{value:t,enumerable:!0}):n,t)),ar=t=>Ge(Vt({},"__esModule",{value:!0}),t);var Ai={};ir(Ai,{QRCodeCanvas:()=>Ri});module.exports=ar(Ai);var Ct=require("react");var At;(u=>{class t{constructor(o,a,s,c){this.version=o;this.errorCorrectionLevel=a;if(o<t.MIN_VERSION||o>t.MAX_VERSION)throw new RangeError("Version value out of range");if(c<-1||c>7)throw new RangeError("Mask value out of range");this.size=o*4+17;let m=[];for(let f=0;f<this.size;f++)m.push(!1);for(let f=0;f<this.size;f++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();let p=this.addEccAndInterleave(s);if(this.drawCodewords(p),c==-1){let f=1e9;for(let d=0;d<8;d++){this.applyMask(d),this.drawFormatBits(d);let h=this.getPenaltyScore();h<f&&(c=d,f=h),this.applyMask(d)}}r(0<=c&&c<=7),this.mask=c,this.applyMask(c),this.drawFormatBits(c),this.isFunction=[]}version;errorCorrectionLevel;static encodeText(o,a){let s=u.QrSegment.makeSegments(o);return t.encodeSegments(s,a)}static encodeBinary(o,a){let s=u.QrSegment.makeBytes(o);return t.encodeSegments([s],a)}static encodeSegments(o,a,s=1,c=40,m=-1,p=!0){if(!(t.MIN_VERSION<=s&&s<=c&&c<=t.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let f,d;for(f=s;;f++){let y=t.getNumDataCodewords(f,a)*8,S=i.getTotalBits(o,f);if(S<=y){d=S;break}if(f>=c)throw new RangeError("Data too long")}for(let y of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])p&&d<=t.getNumDataCodewords(f,y)*8&&(a=y);let h=[];for(let y of o){e(y.mode.modeBits,4,h),e(y.numChars,y.mode.numCharCountBits(f),h);for(let S of y.getData())h.push(S)}r(h.length==d);let b=t.getNumDataCodewords(f,a)*8;r(h.length<=b),e(0,Math.min(4,b-h.length),h),e(0,(8-h.length%8)%8,h),r(h.length%8==0);for(let y=236;h.length<b;y^=253)e(y,8,h);let g=[];for(;g.length*8<h.length;)g.push(0);return h.forEach((y,S)=>g[S>>>3]|=y<<7-(S&7)),new t(f,a,g,m)}size;mask;modules=[];isFunction=[];getModule(o,a){return 0<=o&&o<this.size&&0<=a&&a<this.size&&this.modules[a][o]}getModules(){return this.modules}drawFunctionPatterns(){for(let s=0;s<this.size;s++)this.setFunctionModule(6,s,s%2==0),this.setFunctionModule(s,6,s%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let o=this.getAlignmentPatternPositions(),a=o.length;for(let s=0;s<a;s++)for(let c=0;c<a;c++)s==0&&c==0||s==0&&c==a-1||s==a-1&&c==0||this.drawAlignmentPattern(o[s],o[c]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(o){let a=this.errorCorrectionLevel.formatBits<<3|o,s=a;for(let m=0;m<10;m++)s=s<<1^(s>>>9)*1335;let c=(a<<10|s)^21522;r(c>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,n(c,m));this.setFunctionModule(8,7,n(c,6)),this.setFunctionModule(8,8,n(c,7)),this.setFunctionModule(7,8,n(c,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,n(c,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,n(c,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,n(c,m));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let o=this.version;for(let s=0;s<12;s++)o=o<<1^(o>>>11)*7973;let a=this.version<<12|o;r(a>>>18==0);for(let s=0;s<18;s++){let c=n(a,s),m=this.size-11+s%3,p=Math.floor(s/3);this.setFunctionModule(m,p,c),this.setFunctionModule(p,m,c)}}drawFinderPattern(o,a){for(let s=-4;s<=4;s++)for(let c=-4;c<=4;c++){let m=Math.max(Math.abs(c),Math.abs(s)),p=o+c,f=a+s;0<=p&&p<this.size&&0<=f&&f<this.size&&this.setFunctionModule(p,f,m!=2&&m!=4)}}drawAlignmentPattern(o,a){for(let s=-2;s<=2;s++)for(let c=-2;c<=2;c++)this.setFunctionModule(o+c,a+s,Math.max(Math.abs(c),Math.abs(s))!=1)}setFunctionModule(o,a,s){this.modules[a][o]=s,this.isFunction[a][o]=!0}addEccAndInterleave(o){let a=this.version,s=this.errorCorrectionLevel;if(o.length!=t.getNumDataCodewords(a,s))throw new RangeError("Invalid argument");let c=t.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][a],m=t.ECC_CODEWORDS_PER_BLOCK[s.ordinal][a],p=Math.floor(t.getNumRawDataModules(a)/8),f=c-p%c,d=Math.floor(p/c),h=[],b=t.reedSolomonComputeDivisor(m);for(let y=0,S=0;y<c;y++){let E=o.slice(S,S+d-m+(y<f?0:1));S+=E.length;let P=t.reedSolomonComputeRemainder(E,b);y<f&&E.push(0),h.push(E.concat(P))}let g=[];for(let y=0;y<h[0].length;y++)h.forEach((S,E)=>{(y!=d-m||E>=f)&&g.push(S[y])});return r(g.length==p),g}drawCodewords(o){if(o.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let a=0;for(let s=this.size-1;s>=1;s-=2){s==6&&(s=5);for(let c=0;c<this.size;c++)for(let m=0;m<2;m++){let p=s-m,d=(s+1&2)==0?this.size-1-c:c;!this.isFunction[d][p]&&a<o.length*8&&(this.modules[d][p]=n(o[a>>>3],7-(a&7)),a++)}}r(a==o.length*8)}applyMask(o){if(o<0||o>7)throw new RangeError("Mask value out of range");for(let a=0;a<this.size;a++)for(let s=0;s<this.size;s++){let c;switch(o){case 0:c=(s+a)%2==0;break;case 1:c=a%2==0;break;case 2:c=s%3==0;break;case 3:c=(s+a)%3==0;break;case 4:c=(Math.floor(s/3)+Math.floor(a/2))%2==0;break;case 5:c=s*a%2+s*a%3==0;break;case 6:c=(s*a%2+s*a%3)%2==0;break;case 7:c=((s+a)%2+s*a%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[a][s]&&c&&(this.modules[a][s]=!this.modules[a][s])}}getPenaltyScore(){let o=0;for(let m=0;m<this.size;m++){let p=!1,f=0,d=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[m][h]==p?(f++,f==5?o+=t.PENALTY_N1:f>5&&o++):(this.finderPenaltyAddHistory(f,d),p||(o+=this.finderPenaltyCountPatterns(d)*t.PENALTY_N3),p=this.modules[m][h],f=1);o+=this.finderPenaltyTerminateAndCount(p,f,d)*t.PENALTY_N3}for(let m=0;m<this.size;m++){let p=!1,f=0,d=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][m]==p?(f++,f==5?o+=t.PENALTY_N1:f>5&&o++):(this.finderPenaltyAddHistory(f,d),p||(o+=this.finderPenaltyCountPatterns(d)*t.PENALTY_N3),p=this.modules[h][m],f=1);o+=this.finderPenaltyTerminateAndCount(p,f,d)*t.PENALTY_N3}for(let m=0;m<this.size-1;m++)for(let p=0;p<this.size-1;p++){let f=this.modules[m][p];f==this.modules[m][p+1]&&f==this.modules[m+1][p]&&f==this.modules[m+1][p+1]&&(o+=t.PENALTY_N2)}let a=0;for(let m of this.modules)a=m.reduce((p,f)=>p+(f?1:0),a);let s=this.size*this.size,c=Math.ceil(Math.abs(a*20-s*10)/s)-1;return r(0<=c&&c<=9),o+=c*t.PENALTY_N4,r(0<=o&&o<=2568888),o}getAlignmentPatternPositions(){if(this.version==1)return[];{let o=Math.floor(this.version/7)+2,a=this.version==32?26:Math.ceil((this.version*4+4)/(o*2-2))*2,s=[6];for(let c=this.size-7;s.length<o;c-=a)s.splice(1,0,c);return s}}static getNumRawDataModules(o){if(o<t.MIN_VERSION||o>t.MAX_VERSION)throw new RangeError("Version number out of range");let a=(16*o+128)*o+64;if(o>=2){let s=Math.floor(o/7)+2;a-=(25*s-10)*s-55,o>=7&&(a-=36)}return r(208<=a&&a<=29648),a}static getNumDataCodewords(o,a){return Math.floor(t.getNumRawDataModules(o)/8)-t.ECC_CODEWORDS_PER_BLOCK[a.ordinal][o]*t.NUM_ERROR_CORRECTION_BLOCKS[a.ordinal][o]}static reedSolomonComputeDivisor(o){if(o<1||o>255)throw new RangeError("Degree out of range");let a=[];for(let c=0;c<o-1;c++)a.push(0);a.push(1);let s=1;for(let c=0;c<o;c++){for(let m=0;m<a.length;m++)a[m]=t.reedSolomonMultiply(a[m],s),m+1<a.length&&(a[m]^=a[m+1]);s=t.reedSolomonMultiply(s,2)}return a}static reedSolomonComputeRemainder(o,a){let s=a.map(c=>0);for(let c of o){let m=c^s.shift();s.push(0),a.forEach((p,f)=>s[f]^=t.reedSolomonMultiply(p,m))}return s}static reedSolomonMultiply(o,a){if(o>>>8||a>>>8)throw new RangeError("Byte out of range");let s=0;for(let c=7;c>=0;c--)s=s<<1^(s>>>7)*285,s^=(a>>>c&1)*o;return r(s>>>8==0),s}finderPenaltyCountPatterns(o){let a=o[1];r(a<=this.size*3);let s=a>0&&o[2]==a&&o[3]==a*3&&o[4]==a&&o[5]==a;return(s&&o[0]>=a*4&&o[6]>=a?1:0)+(s&&o[6]>=a*4&&o[0]>=a?1:0)}finderPenaltyTerminateAndCount(o,a,s){return o&&(this.finderPenaltyAddHistory(a,s),a=0),a+=this.size,this.finderPenaltyAddHistory(a,s),this.finderPenaltyCountPatterns(s)}finderPenaltyAddHistory(o,a){a[0]==0&&(o+=this.size),a.pop(),a.unshift(o)}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]]}u.QrCode=t;function e(l,o,a){if(o<0||o>31||l>>>o)throw new RangeError("Value out of range");for(let s=o-1;s>=0;s--)a.push(l>>>s&1)}function n(l,o){return(l>>>o&1)!=0}function r(l){if(!l)throw new Error("Assertion error")}class i{constructor(o,a,s){this.mode=o;this.numChars=a;this.bitData=s;if(a<0)throw new RangeError("Invalid argument");this.bitData=s.slice()}mode;numChars;bitData;static makeBytes(o){let a=[];for(let s of o)e(s,8,a);return new i(i.Mode.BYTE,o.length,a)}static makeNumeric(o){if(!i.isNumeric(o))throw new RangeError("String contains non-numeric characters");let a=[];for(let s=0;s<o.length;){let c=Math.min(o.length-s,3);e(parseInt(o.substr(s,c),10),c*3+1,a),s+=c}return new i(i.Mode.NUMERIC,o.length,a)}static makeAlphanumeric(o){if(!i.isAlphanumeric(o))throw new RangeError("String contains unencodable characters in alphanumeric mode");let a=[],s;for(s=0;s+2<=o.length;s+=2){let c=i.ALPHANUMERIC_CHARSET.indexOf(o.charAt(s))*45;c+=i.ALPHANUMERIC_CHARSET.indexOf(o.charAt(s+1)),e(c,11,a)}return s<o.length&&e(i.ALPHANUMERIC_CHARSET.indexOf(o.charAt(s)),6,a),new i(i.Mode.ALPHANUMERIC,o.length,a)}static makeSegments(o){return o==""?[]:i.isNumeric(o)?[i.makeNumeric(o)]:i.isAlphanumeric(o)?[i.makeAlphanumeric(o)]:[i.makeBytes(i.toUtf8ByteArray(o))]}static makeEci(o){let a=[];if(o<0)throw new RangeError("ECI assignment value out of range");if(o<128)e(o,8,a);else if(o<16384)e(2,2,a),e(o,14,a);else if(o<1e6)e(6,3,a),e(o,21,a);else throw new RangeError("ECI assignment value out of range");return new i(i.Mode.ECI,0,a)}static isNumeric(o){return i.NUMERIC_REGEX.test(o)}static isAlphanumeric(o){return i.ALPHANUMERIC_REGEX.test(o)}getData(){return this.bitData.slice()}static getTotalBits(o,a){let s=0;for(let c of o){let m=c.mode.numCharCountBits(a);if(c.numChars>=1<<m)return 1/0;s+=4+m+c.bitData.length}return s}static toUtf8ByteArray(o){o=encodeURI(o);let a=[];for(let s=0;s<o.length;s++)o.charAt(s)!="%"?a.push(o.charCodeAt(s)):(a.push(parseInt(o.substr(s+1,2),16)),s+=2);return a}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}u.QrSegment=i})(At||={});(e=>{let t;(r=>{class n{constructor(u,l){this.ordinal=u;this.formatBits=l}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)}r.Ecc=n})(t=e.QrCode||={})})(At||={});(e=>{let t;(r=>{class n{constructor(u,l){this.modeBits=u;this.numBitsCharCount=l}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(u){return this.numBitsCharCount[Math.floor((u+7)/17)]}}r.Mode=n})(t=e.QrSegment||={})})(At||={});var H=At;var lt={L:H.QrCode.Ecc.LOW,M:H.QrCode.Ecc.MEDIUM,Q:H.QrCode.Ecc.QUARTILE,H:H.QrCode.Ecc.HIGH},jt=128,$t="Q",et="#FFFFFF",Wt="#000000";var Zt=0;var Jt=.1;var ho=Ue(require("react"));var nt=require("zod"),sr=["none","banner-bottom","banner-top","border","rounded-border","speech-bubble","banner-top-bottom","speech-bubble-top","chat-bubble","circle","polaroid","phone","ticket","badge","envelope","tag","menu-card","sticker","gradient-border","focus"],rt=24,Ye="Scan me",qt=.5,bt=1.5,cr=nt.z.enum(sr),de=nt.z.object({style:cr,text:nt.z.string().max(rt).optional(),color:nt.z.string().optional(),textColor:nt.z.string().optional(),secondaryText:nt.z.string().max(rt).optional(),secondaryColor:nt.z.string().optional(),fontScale:nt.z.number().min(qt).max(bt).optional()});var M=require("zod");function Kt(t,e=3){let n=10**e;return Math.round(t*n)/n+0}function x(t,e=3){return String(Kt(t,e))}function q(t,...e){let n=t[0]??"";for(let r=0;r<e.length;r++){let i=e[r];n+=(typeof i=="number"?x(i):i)+(t[r+1]??"")}return n}var lr={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},ur=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,he=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function te(t,e=Number.POSITIVE_INFINITY){if(!ur.test(t))return null;let n=[],r=0,i=()=>{for(;r<t.length&&/[\s,]/.test(t[r]);)r++},u=()=>{i(),he.lastIndex=r;let a=he.exec(t);if(!a)return null;let s=a[0],c=s.indexOf(".");if(c>=0&&s.length-c-1>e)return null;r=he.lastIndex;let m=Number(s);return Number.isFinite(m)?m:null},l=()=>{i();let a=t[r];return a==="0"||a==="1"?(r++,a==="1"?1:0):null},o=()=>(i(),r<t.length&&/[0-9.+-]/.test(t[r]));for(i();r<t.length;){let a=t[r],s=a.toUpperCase(),c=lr[s];if(c===void 0||n.length===0&&s!=="M")return null;if(r++,c===0){n.push({command:a,values:[]}),i();continue}let m=a,p=!0;for(;p||o();){let f=[];for(let d=0;d<c;d++){let h=s==="A"&&(d===3||d===4)?l():u();if(h===null)return null;f.push(h)}n.push({command:m,values:f}),s==="M"&&(m=a==="M"?"L":"l"),p=!1}i()}return n}function He(t){let e=0;for(let{command:n}of t)e+=n.toUpperCase()==="A"?4:1;return e}function Qe(t,e=1,n=0,r=0){let i="";for(let{command:u,values:l}of t){let o=u.toUpperCase(),a=u===o,s=a?n:0,c=a?r:0,m;switch(o){case"Z":m=[];break;case"H":m=[x(l[0]*e+s)];break;case"V":m=[x(l[0]*e+c)];break;case"A":m=[x(Math.abs(l[0])*e),x(Math.abs(l[1])*e),x(l[2]),String(l[3]),String(l[4]),x(l[5]*e+s),x(l[6]*e+c)];break;default:m=l.map((p,f)=>x(p*e+(f%2===0?s:c)))}i+=u+m.join(" ")}return i}function Ve(t,e=.25){let n=[],r=[],i=[0,0],u=[0,0],l=()=>{r.length>2&&n.push(r),r=[]};for(let o of t)if(o.op==="M")l(),i=[o.x,o.y],u=i,r.push(i);else if(o.op==="L")u=[o.x,o.y],r.push(u);else if(o.op==="C"){let a=u,s=[o.x1,o.y1],c=[o.x2,o.y2],m=[o.x,o.y],p=Math.hypot(s[0]-a[0],s[1]-a[1])+Math.hypot(c[0]-s[0],c[1]-s[1])+Math.hypot(m[0]-c[0],m[1]-c[1]),f=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(p/(4*e)))));for(let d=1;d<=f;d++){let h=d/f,b=1-h;r.push([b*b*b*a[0]+3*b*b*h*s[0]+3*b*h*h*c[0]+h*h*h*m[0],b*b*b*a[1]+3*b*b*h*s[1]+3*b*h*h*c[1]+h*h*h*m[1]])}u=m}else l(),u=i;return l(),n}function je(t,e){let n=[i=>i[0]-e.x0,i=>e.x1-i[0],i=>i[1]-e.y0,i=>e.y1-i[1]],r=t;for(let i of n){if(r.length===0)break;let u=r;r=[];for(let l=0;l<u.length;l++){let o=u[l],a=u[(l+u.length-1)%u.length],s=i(o),c=i(a);s>=0?(c<0&&r.push(Xe(a,o,c,s)),r.push(o)):c>=0&&r.push(Xe(a,o,c,s))}}return r.length>2?r:[]}function Xe(t,e,n,r){let i=n/(n-r);return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]}function We(t){return t.filter(e=>e.length>2).map(e=>`M${e.map(([n,r])=>`${x(n)} ${x(r)}`).join("L")}Z`).join("")}function Ze(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY,u=(l,o)=>{e=Math.min(e,l),n=Math.min(n,o),r=Math.max(r,l),i=Math.max(i,o)};for(let l of t)l.op==="C"?(u(l.x1,l.y1),u(l.x2,l.y2),u(l.x,l.y)):l.op!=="Z"&&u(l.x,l.y);return Number.isFinite(e)?{x0:e,y0:n,x1:r,y1:i}:null}var ge=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function mr(t,e,n,r,i,u,l,o,a){if(t===o&&e===a)return[];let s=Math.abs(n),c=Math.abs(r);if(s===0||c===0)return[{op:"L",x:o,y:a}];let m=i*Math.PI/180,p=Math.cos(m),f=Math.sin(m),d=(t-o)/2,h=(e-a)/2,b=p*d+f*h,g=-f*d+p*h,y=b*b/(s*s)+g*g/(c*c);y>1&&(s*=Math.sqrt(y),c*=Math.sqrt(y));let S=s*s*c*c-s*s*g*g-c*c*b*b,E=s*s*g*g+c*c*b*b,P=(u===l?-1:1)*Math.sqrt(Math.max(0,S/E)),C=P*s*g/c,L=-P*c*b/s,w=p*C-f*L+(t+o)/2,_=f*C+p*L+(e+a)/2,O=(j,Y,W,dt)=>Math.atan2(j*dt-Y*W,j*W+Y*dt),tt=O(1,0,(b-C)/s,(g-L)/c),X=O((b-C)/s,(g-L)/c,(-b-C)/s,(-g-L)/c);!l&&X>0?X-=2*Math.PI:l&&X<0&&(X+=2*Math.PI);let U=Math.max(1,Math.ceil(Math.abs(X)/(Math.PI/2)-1e-9)),Z=X/U,st=4/3*Math.tan(Z/4),ft=(j,Y)=>[w+s*p*j-c*f*Y,_+s*f*j+c*p*Y],vt=[];for(let j=0;j<U;j++){let Y=tt+j*Z,W=Y+Z,[dt,_t]=ft(Math.cos(Y)-st*Math.sin(Y),Math.sin(Y)+st*Math.cos(Y)),[v,J]=ft(Math.cos(W)+st*Math.sin(W),Math.sin(W)-st*Math.cos(W)),[ct,Tt]=j===U-1?[o,a]:ft(Math.cos(W),Math.sin(W));vt.push({op:"C",x1:dt,y1:_t,x2:v,y2:J,x:ct,y:Tt})}return vt}function ee(t){let e=[],n=0,r=0,i=0,u=0,l=0,o="",a=null,s=null,c=()=>{for(;n<t.length&&/[\s,]/.test(t[n]);)n++},m=()=>{c(),ge.lastIndex=n;let d=ge.exec(t);return d?(n=ge.lastIndex,Number(d[0])):null},p=()=>{c();let d=t[n];return d==="0"||d==="1"?(n++,d==="1"):null},f=d=>{let h=[];for(let b=0;b<d;b++){let g=m();if(g===null)return null;h.push(g)}return h};for(;c(),!(n>=t.length);){let d=t[n];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(d))o=d,n++;else if(!o||o==="Z"||o==="z")break;let h=o===o.toLowerCase(),b=h?r:0,g=h?i:0,y=o.toUpperCase();if(y==="Z"){e.push({op:"Z"}),r=u,i=l,a=null,s=null;continue}if(y==="A"){let C=f(3),L=p(),w=p(),_=f(2);if(!(C&&_)||L===null||w===null)break;let[O,tt,X]=C,U=_[0]+b,Z=_[1]+g;e.push(...mr(r,i,O,tt,X,L,w,U,Z)),r=U,i=Z,a=null,s=null;continue}let S={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[y]??0,E=f(S);if(!E)break;let P=E;switch(y){case"M":r=P[0]+b,i=P[1]+g,u=r,l=i,e.push({op:"M",x:r,y:i}),o=h?"l":"L",a=null,s=null;break;case"L":case"H":case"V":y!=="V"&&(r=P[0]+b),y==="V"?i=P[0]+g:y==="L"&&(i=P[1]+g),e.push({op:"L",x:r,y:i}),a=null,s=null;break;case"C":case"S":{let C,L;y==="C"?(C=[P[0]+b,P[1]+g],L=P.slice(2)):(C=a?[2*r-a[0],2*i-a[1]]:[r,i],L=P);let w=[L[0]+b,L[1]+g],_=[L[2]+b,L[3]+g];e.push({op:"C",x1:C[0],y1:C[1],x2:w[0],y2:w[1],x:_[0],y:_[1]}),[r,i]=_,a=w,s=null;break}case"Q":case"T":{let C,L;y==="Q"?(C=[P[0]+b,P[1]+g],L=[P[2]+b,P[3]+g]):(C=s?[2*r-s[0],2*i-s[1]]:[r,i],L=[P[0]+b,P[1]+g]),e.push({op:"C",x1:r+2/3*(C[0]-r),y1:i+2/3*(C[1]-i),x2:L[0]+2/3*(C[0]-L[0]),y2:L[1]+2/3*(C[1]-L[1]),x:L[0],y:L[1]}),[r,i]=L,s=C,a=null;break}default:break}}return e}var Je=.5522847498;function be(t,e,n,r,i=0,u=0){if(n<=0||r<=0)return[];let l=Math.min(Math.max(i,0),n/2),o=Math.min(Math.max(u,0),r/2);if(l===0||o===0)return[{op:"M",x:t,y:e},{op:"L",x:t+n,y:e},{op:"L",x:t+n,y:e+r},{op:"L",x:t,y:e+r},{op:"Z"}];let a=l*Je,s=o*Je,c=t+n,m=e+r;return[{op:"M",x:t+l,y:e},{op:"L",x:c-l,y:e},{op:"C",x1:c-l+a,y1:e,x2:c,y2:e+o-s,x:c,y:e+o},{op:"L",x:c,y:m-o},{op:"C",x1:c,y1:m-o+s,x2:c-l+a,y2:m,x:c-l,y:m},{op:"L",x:t+l,y:m},{op:"C",x1:t+l-a,y1:m,x2:t,y2:m-o+s,x:t,y:m-o},{op:"L",x:t,y:e+o},{op:"C",x1:t,y1:e+o-s,x2:t+l-a,y2:e,x:t+l,y:e},{op:"Z"}]}var pr="qrdx.frame",fr=1,Se="custom",N={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:rt},dr=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],Ee=.95,hr=200,gr=["frame","text","accent","background"],br=/[\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 Me(t,e=rt){let n=t.slice(0,1e3).normalize("NFC").replace(br," ").replace(yr,"").replace(/\s+/g," ").trim();return Array.from(n).slice(0,Math.max(0,e)).join("").trim()}var Ce=t=>Math.abs(t*1e3-Math.round(t*1e3))<1e-6,T=M.z.number().min(-N.maxCoordinate).max(N.maxCoordinate).refine(Ce,{message:`Numbers may have at most ${N.maxDecimals} decimals`}),B=T.refine(t=>t>0,{message:"Must be greater than 0"}),re=T.refine(t=>t>=0,{message:"Must not be negative"}),ne=M.z.string().regex(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color"),ye=M.z.union([M.z.enum(gr),ne]),zt=M.z.union([ye,M.z.object({mix:M.z.tuple([ye,ye]),amount:M.z.number().min(0).max(1).refine(Ce)}).strict()]),yt=M.z.union([zt,M.z.object({gradient:M.z.object({from:zt,to:zt,direction:M.z.enum(["horizontal","vertical"]).optional(),steps:M.z.int().min(2).max(N.maxGradientSteps).optional()}).strict()}).strict()]),xe={x:T,y:T,width:B,height:B},xr=M.z.object({type:M.z.literal("rect"),...xe,radius:re.optional(),fill:yt,hole:M.z.object({...xe,radius:re.optional()}).strict().optional()}).strict(),Sr=M.z.object({type:M.z.literal("circle"),cx:T,cy:T,r:B,hole:B.optional(),fill:yt}).strict(),Er=M.z.object({type:M.z.literal("ellipse"),cx:T,cy:T,rx:B,ry:B,fill:yt}).strict(),Mr=M.z.object({type:M.z.literal("polygon"),points:M.z.array(M.z.tuple([T,T])).min(3).max(N.maxPolygonPoints),fill:yt}).strict(),Cr=M.z.object({type:M.z.literal("path"),d:M.z.string().min(2).max(N.maxPathLength),fill:yt,fillRule:M.z.enum(["nonzero","evenodd"]).optional()}).strict(),Pr=M.z.object({type:M.z.literal("line"),x1:T,y1:T,x2:T,y2:T,width:B,cap:M.z.enum(["butt","round"]).optional(),dash:M.z.tuple([B,B]).optional(),fill:yt}).strict(),Lr=M.z.object({type:M.z.literal("icon"),icon:M.z.enum(dr),x:T,y:T,size:B,fill:yt}).strict(),Rr=M.z.discriminatedUnion("type",[xr,Sr,Er,Mr,Cr,Pr,Lr]),tn={id:M.z.string().regex(/^[a-z][a-z0-9-]{0,31}$/),slot:M.z.enum(["primary","secondary","fixed"]),text:M.z.string().max(200),maxLength:M.z.int().min(1).max(rt).optional(),color:zt,weight:M.z.enum(["bold","regular"]).optional()},Ar=M.z.object({type:M.z.literal("text"),...tn,box:M.z.object(xe).strict(),align:M.z.enum(["start","middle","end"]).optional(),fontSize:B.optional()}).strict(),$r=M.z.object({type:M.z.literal("curved"),...tn,curve:M.z.object({cx:T,cy:T,radius:B,side:M.z.enum(["top","bottom"]),spread:M.z.number().min(20).max(300).refine(Ce).optional()}).strict(),fontSize:B}).strict(),Fr=M.z.discriminatedUnion("type",[Ar,$r]),Ke=T.refine(t=>t>=N.minArtboard&&t<=N.maxArtboard,{message:`Artboard sides must be ${N.minArtboard} to ${N.maxArtboard} units`}),Ir=M.z.object({kind:M.z.literal(pr),version:M.z.literal(fr),artboard:M.z.object({width:Ke,height:Ke}).strict(),qr:M.z.object({x:T,y:T,size:B,padding:re.optional(),radius:re.optional()}).strict(),colors:M.z.object({frame:ne,text:ne.optional(),accent:ne.optional()}).strict(),shapes:M.z.array(Rr).max(N.maxShapes),labels:M.z.array(Fr).max(N.maxLabels),bleed:M.z.union([M.z.literal("none"),zt]).optional()}).strict();function wr(t){let e=oe(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 oe(t){return t.qr.padding??t.qr.size*N.defaultPadding}var vr=(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 _r(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(([r])=>r),n=t.points.map(([,r])=>r);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=te(t.d,N.maxDecimals);return e?{bounds:Ze(ee(t.d)),segments:He(e)}:{bounds:null,segments:0}}case"line":{let e=t.width/2,n=Math.hypot(t.x2-t.x1,t.y2-t.y1),r=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:r*(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:hr}}}function Tr(t,e){let n=(g,y=[])=>e.addIssue({code:"custom",message:g,path:y}),r=N,i=new TextEncoder().encode(JSON.stringify(t)).length;if(i>r.maxBytes){n(`The spec is ${i} bytes; the limit is ${r.maxBytes}`);return}let{width:u,height:l}=t.artboard,o=Math.max(u,l)*.005,a={x0:-o,y0:-o,x1:u+o,y1:l+o},s=g=>g.x0>=a.x0&&g.y0>=a.y0&&g.x1<=a.x1&&g.y1<=a.y1,{qr:c}=t,m=oe(t);m<c.size*r.minPadding-1e-9&&n(`qr.padding must be at least ${r.minPadding*100}% of qr.size`,["qr","padding"]),c.size<Math.min(u,l)*r.minQrShare-1e-9&&n(`qr.size must be at least ${r.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let p=wr(t);(p.x0<-1e-9||p.y0<-1e-9||p.x1>u+1e-9||p.y1>l+1e-9)&&n("The code and its padding must sit inside the artboard",["qr"]),(c.radius??0)>(c.size+2*m)/2&&n("qr.radius is larger than half the plate",["qr","radius"]);let f=0,d=0;t.shapes.forEach((g,y)=>{let S=["shapes",y],{bounds:E,segments:P}=_r(g);if(!E){n("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(E)||n("The shape extends outside the artboard",S),g.type==="rect"&&g.hole){let{hole:C}=g;(C.x<g.x||C.y<g.y||C.x+C.width>g.x+g.width+1e-9||C.y+C.height>g.y+g.height+1e-9)&&n("The hole must sit inside its rect",[...S,"hole"])}g.type==="circle"&&g.hole&&g.hole>=g.r&&n("The hole must be smaller than the circle",[...S,"hole"]),f+=P,typeof g.fill=="object"&&"gradient"in g.fill&&(d+=(g.fill.gradient.steps??32)*P)}),f>r.maxSegments&&n(`The shapes have ${f} segments; the limit is ${r.maxSegments}`,["shapes"]),d>r.maxGradientWork&&n("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let h=new Set,b=new Set;t.labels.forEach((g,y)=>{let S=["labels",y];h.has(g.id)&&n(`Label id "${g.id}" is used twice`,[...S,"id"]),h.add(g.id),g.slot!=="fixed"&&(b.has(g.slot)&&n(`Only one label may use the ${g.slot} slot`,[...S,"slot"]),b.add(g.slot));let E=g.maxLength??r.maxTextLength;g.text!==Me(g.text,E)&&n(`Label text must be at most ${E} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...S,"text"]);let P;if(g.type==="text")P={x0:g.box.x,y0:g.box.y,x1:g.box.x+g.box.width,y1:g.box.y+g.box.height},g.fontSize!==void 0&&g.fontSize>g.box.height*Ee+1e-9&&n("fontSize may be at most 95% of the label's row height",[...S,"fontSize"]),vr(P,p)&&n("The label overlaps the code or its padding",[...S,"box"]);else{let{cx:C,cy:L,radius:w}=g.curve,_=g.fontSize*bt*.6;P={x0:C-w-_,y0:L-w-_,x1:C+w+_,y1:L+w+_};let O=Math.hypot(Math.max(p.x0-C,0,C-p.x1),Math.max(p.y0-L,0,L-p.y1));Math.hypot(Math.max(Math.abs(p.x0-C),Math.abs(p.x1-C)),Math.max(Math.abs(p.y0-L),Math.abs(p.y1-L)))<=w-_||O>=w+_||n("The curved label crosses the code or its padding",[...S,"curve"])}s(P)||n("The label extends outside the artboard",S)})}var Pe=Ir.superRefine(Tr);var Nr=de.extend({style:M.z.literal(Se),spec:Pe}),en=M.z.discriminatedUnion("style",[de,Nr]);function G(t){if(t.length===0)return"";let[e,...n]=t;return`M${x(e[0])} ${x(e[1])}${n.map(([r,i])=>`L${x(r)} ${x(i)}`).join("")}Z`}function $(t,e,n){return`M${x(t-n)} ${x(e)}A${x(n)} ${x(n)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(n)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function A(t,e,n,r,i=0){let u=Math.min(n,r)/2,[l,o,a,s]=(typeof i=="number"?[i,i,i,i]:i).map(m=>Math.max(0,Math.min(m,u))),c=(m,p,f)=>m>0?`A${x(m)} ${x(m)} 0 0 1 ${x(p)} ${x(f)}`:"";return`M${x(t+l)} ${x(e)}H${x(t+n-o)}${c(o,t+n,e+o)}V${x(e+r-a)}${c(a,t+n-a,e+r)}H${x(t+s)}${c(s,t,e+r-s)}V${x(e+l)}${c(l,t+l,e)}Z`}function ie(t,e,n,r,i=5){return Array.from({length:i*2},(u,l)=>{let o=l%2===0?n:r,a=-Math.PI/2+Math.PI/i*l;return[t+o*Math.cos(a),e+o*Math.sin(a)]})}function nn(t,e,n){let r=n/2,i=(u,l)=>`${x(t+u*r)} ${x(e+l*r)}`;return`M${i(0,-.52)}C${i(.18,-.92)} ${i(.98,-.94)} ${i(1,-.34)}C${i(1,.12)} ${i(.5,.48)} ${i(0,.92)}C${i(-.5,.48)} ${i(-1,.12)} ${i(-1,-.34)}C${i(-.98,-.94)} ${i(-.18,-.92)} ${i(0,-.52)}Z`}function Le(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 rn=24,ut=(t,e,n,r)=>{let i=r*Math.PI/180;return[t+n*Math.cos(i),e+n*Math.sin(i)]},ae=([t,e])=>`${x(t)} ${x(e)}`;function Ft(t,e,n,r,i,u){let l=u-i>180?1:0;return`M${ae(ut(t,e,r,i))}A${x(r)} ${x(r)} 0 ${l} 1 ${ae(ut(t,e,r,u))}L${ae(ut(t,e,n,u))}A${x(n)} ${x(n)} 0 ${l} 0 ${ae(ut(t,e,n,i))}Z`}function Dt(t,e,n,r){return`M${x(t-n)} ${x(e)}A${x(n)} ${x(r)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(r)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function Or(t){let e=0;return t.forEach(([n,r],i)=>{let[u,l]=t[(i+1)%t.length];e+=n*l-u*r}),e/2}function on(t){return G(Or(t)<0?[...t].reverse():t)}function se(t,e,n,r,i){let u=Math.hypot(n-t,r-e)||1,l=-(r-e)/u*(i/2),o=(n-t)/u*(i/2);return on([[t+l,e+o],[n+l,r+o],[n-l,r-o],[t-l,e-o]])}var D=(...t)=>({d:t.join(""),fillRule:"nonzero"}),ot=(...t)=>({d:t.join(""),fillRule:"evenodd"});function qr(){let t=[];for(let e of[0,60,120]){let[n,r]=ut(12,12,10.5,e+180),[i,u]=ut(12,12,10.5,e);t.push(se(n,r,i,u,2))}for(let e=0;e<6;e++){let n=e*60,[r,i]=ut(12,12,6.2,n);for(let u of[-45,45]){let[l,o]=ut(r,i,3.6,n+u);t.push(se(r,i,l,o,1.7))}}return D(...t)}var zr={wifi:()=>D(Ft(12,20,4.6,7.2,-135,-45),Ft(12,20,9.2,11.8,-135,-45),Ft(12,20,13.8,16.4,-135,-45),$(12,20,2.2)),star:()=>D(G(ie(12,12.8,11.6,4.8))),heart:()=>D(nn(12,12.4,22)),phone:()=>ot(A(6,1.5,12,21,2.6),A(7.8,4.2,8.4,13.4,.6),$(12,19.8,1.1)),headphones:()=>D(Ft(12,13,7.6,9.8,-180,0),A(2,12,5,9.5,2),A(17,12,5,9.5,2)),calendar:()=>ot(A(2.5,4,19,17.5,2.5),A(4.6,9,14.8,10.6,.8),A(7,11.4,2.6,2.6,.4),A(10.7,11.4,2.6,2.6,.4),A(14.4,11.4,2.6,2.6,.4),A(7,15.1,2.6,2.6,.4),A(10.7,15.1,2.6,2.6,.4),A(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),A(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>D($(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:()=>ot(A(2,3,20,14,4),G([[6.5,17],[11.5,17],[5.8,21.8]]),$(7.5,10,1.5),$(12,10,1.5),$(16.5,10,1.5)),bag:()=>D(A(3.5,7.5,17,14.5,2),Ft(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",A(1.5,18.2,21,2.6,1.3),A(11.2,6.6,1.6,2.6,0),A(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",Ft(17,10.2,1.7,3.6,-90,90),A(2,20.6,17,2,1),A(7,1.6,1.6,3.4,.8),A(11.6,1.6,1.6,3.4,.8)),card:()=>ot(A(1.5,4.5,21,15,2.5),A(1.5,8,21,3,0),A(4.5,13.6,4.6,3.2,.6)),check:()=>ot($(12,12,10.5),G([[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:()=>ot($(12,12,10.5),$(12,7.2,1.6),A(10.6,10,2.8,8,.8)),home:()=>ot(G([[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]]),A(10,14.5,4,7,[.6,.6,0,0])),pin:()=>ot("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",$(12,9.5,3)),share:()=>D(se(6,12,18,5,1.8),se(6,12,18,19,1.8),$(18,5,3.2),$(6,12,3.2),$(18,19,3.2)),download:()=>D(A(10.6,2,2.8,9.5,0),G([[6,10],[18,10],[12,16.5]]),G([[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:()=>ot($(12,12,10.5),$(12,12,8.4),G([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:qr,pumpkin:()=>D(Dt(7.8,14.6,5.8,6.9),Dt(16.2,14.6,5.8,6.9),Dt(12,14.6,4.8,7.4),A(10.9,3.4,2.2,4.6,.8),on([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>D(G([[12,1.5],[16.8,8.2],[7.2,8.2]]),G([[12,5.2],[19,13.6],[5,13.6]]),G([[12,9.4],[21.2,19.2],[2.8,19.2]]),A(10.4,18.6,3.2,3.9,.4)),sparkle:()=>D(G(ie(9.5,13.5,9,2.4,4)),G(ie(19,5,4,1.1,4))),gift:()=>D(A(3,11.2,7.8,10.6,1),A(13.2,11.2,7.8,10.6,1),A(2,7.4,8.8,3.2,1),A(13.2,7.4,8.8,3.2,1),Dt(8.8,4.8,2.9,1.9),Dt(15.2,4.8,2.9,1.9))};function an(t){return zr[t]()}var Dr={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 sn(t,e){let n=t.trim(),r=Number.parseFloat(n);return Number.isNaN(r)?Number.NaN:n.endsWith("%")?r/100*e:r}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=Dr[e];if(n)return{r:n[0],g:n[1],b:n[2],a:1};if(e.startsWith("#")){let i=e.slice(1);return(i.length===3||i.length===4)&&(i=i.split("").map(u=>u+u).join("")),/^[0-9a-f]{6}([0-9a-f]{2})?$/.test(i)?{r:Number.parseInt(i.slice(0,2),16),g:Number.parseInt(i.slice(2,4),16),b:Number.parseInt(i.slice(4,6),16),a:i.length===8?Number.parseInt(i.slice(6,8),16)/255:1}:null}let r=/^rgba?\(([^)]*)\)$/.exec(e);if(r){let[i,u]=r[1].split("/"),l=i.split(/[\s,]+/).filter(Boolean);if(l.length!==(u===void 0&&l.length===4?4:3))return null;let o=u??l[3],[a,s,c]=l.slice(0,3).map(f=>sn(f,255)),m=o===void 0?1:sn(o,1);if([a,s,c,m].some(f=>Number.isNaN(f)))return null;let p=(f,d)=>Math.min(Math.max(f,0),d);return{r:p(a,255),g:p(s,255),b:p(c,255),a:p(m,1)}}return null}var kr=["banner-top-bottom","speech-bubble-top","chat-bubble","circle","polaroid","phone","ticket","badge","envelope","tag","menu-card","sticker","gradient-border","focus"];function un(t){return kr.includes(t)}var cn={from:"#7c3aed",to:"#db2777"},z="#FFFFFF";function mn(t){return t===" "?.3:/[MWmw@%]/.test(t)?.92:/[A-Z0-9#&]/.test(t)?.72:/[il.,:;!'|1]/.test(t)?.32:.6}function wt(t){let e=0;for(let n of t)e+=mn(n);return Math.max(e,1)}var Re=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function V(t,e,n){let r=kt(t)??{r:0,g:0,b:0,a:1},i=kt(e)??{r:255,g:255,b:255,a:1},u=Math.min(1,Math.max(0,n));return`#${Re(r.r+(i.r-r.r)*u)}${Re(r.g+(i.g-r.g)*u)}${Re(r.b+(i.b-r.b)*u)}`}var Q=(t,e,n,r,i=0)=>({x:t,y:e,width:n,height:r,radius:i}),I=(t,e,n,r,i,u)=>({type:"rect",...Q(t,e,n,r,i),fill:u}),It=(t,e,n)=>({type:"rect",...t,fill:n,hole:e}),k=(t,e)=>({type:"polygon",points:t,fill:e}),mt=(t,e,n="nonzero")=>({type:"path",d:t,fill:e,fillRule:n}),pn=(...t)=>t.filter(e=>e!==null),Br=t=>{let{size:e,gap:n,border:r,band:i,color:u,background:l,frame:o,fitLabel:a}=t,s=e+2*(r+n),c=s-2*r,m=e+2*n,p=i+m+i,f=c-2*n,d=o.textColor||z;return{width:s,height:p,qrX:r+n,qrY:i+n,qrSize:e,shapes:[I(r,i,c,m,0,l),It(Q(0,0,s,p),Q(r,i,c,m),u)],label:a(t.text,s/2,i/2,i,f,d),extraLabels:pn(a(t.secondaryText,s/2,i+m+i/2,i,f,d,"secondaryText")),squareEdges:!0,color:u}},Gr=t=>{let{size:e,gap:n,border:r,band:i,color:u,background:l,frame:o,fitLabel:a}=t,s=e+2*(r+n),c=s-2*r,m=e*.07,p=Math.max(m-r,0),f=e*.025,d=e*.08,h=i+d+f;return{width:s,height:h+s,qrX:r+n,qrY:h+r+n,qrSize:e,shapes:[I(0,0,s,i,i/2,u),k([[s/2-d,i-d/2],[s/2+d,i-d/2],[s/2,i+d]],u),I(r,h+r,c,c,p,l),It(Q(0,h,s,s,m),Q(r,h+r,c,c,p),u)],label:a(t.text,s/2,i/2,i,c-2*n,o.textColor||z),squareEdges:!1,color:u}},Ur=t=>{let{size:e,gap:n,border:r,color:i,background:u,frame:l,fitLabel:o}=t,a=e+2*(r+n),s=a-2*r,c=e*.12,m=e+2*n,p=t.text?e*.2:r,f=r+m+p,d=e*.13,h=f-e*.02;return{width:a,height:f+d,qrX:r+n,qrY:r+n,qrSize:e,shapes:[I(0,0,a,f,c,i),mt(q`M${a*.13} ${h}L${a*.05} ${f+d}`+q`Q${a*.16} ${f+d*.45} ${a*.32} ${h}Z`,i),I(r,r,s,m,Math.max(c-r,0),u)],label:o(t.text,a/2,r+m+p/2,p,s-2*n,l.textColor||z),squareEdges:!1,color:i}};function ce(t,e,n,r,i,u,l,o){let a=[...t],s=i*.08,c=a.map(h=>mn(h)*i),m=c.reduce((h,b)=>h+b,0)+s*Math.max(0,a.length-1),p=u==="top"?r-i*.35:r+i*.35,f=[],d=0;return a.forEach((h,b)=>{let g=c[b],y=(d+g/2)/p;if(d+=g+s,h.trim()==="")return;let S=u==="top"?-Math.PI/2-m/2/p+y:Math.PI/2+m/2/p-y;f.push({text:h,x:e+p*Math.cos(S),y:n+p*Math.sin(S),fontSize:i,maxWidth:i*2,color:l,rotate:S*180/Math.PI+(u==="top"?90:-90),field:o})}),f}var Yr=t=>{let{size:e,gap:n,color:r,background:i,frame:u,fontScale:l}=t,o=e*Math.SQRT1_2+n*.9,a=e*.21,s=o+a,c=o+a/2,m=s,p=u.textColor||z,f=c*(140*Math.PI/180),d=y=>Math.min(a*.5*l,f/(wt(y)+.08*y.length)),h=t.text?ce(t.text,m,m,c,d(t.text),"top",p,"text"):[],b=t.secondaryText?ce(t.secondaryText,m,m,c,d(t.secondaryText),"bottom",p,"secondaryText"):[],g=a*.07;return{width:2*s,height:2*s,qrX:m-e/2,qrY:m-e/2,qrSize:e,shapes:[mt($(m,m,o),i),mt($(m,m,s)+$(m,m,o),r,"evenodd"),mt($(m-c,m,g)+$(m+c,m,g),p)],label:null,extraLabels:[...h,...b],squareEdges:!1,color:r}},Hr=t=>{let{size:e,gap:n,color:r,background:i,frame:u,fitLabel:l}=t,o=e*.07,a=e+2*n,s=e*.3,c=e*.025,m=a+2*o,p=o+a+s,f=e*.015;return{width:m+c,height:p+c,qrX:o+n,qrY:o+n,qrSize:e,shapes:[I(c,c,m,p,f,V(r,z,.72)),I(0,0,m,p,f,r),I(o,o,a,a,0,i)],label:l(t.text,m/2,o+a+s/2,s*.8,a-2*n,u.textColor||z),squareEdges:!1,color:r}},Qr=t=>{let{size:e,gap:n,color:r,background:i,frame:u,fitLabel:l}=t,o=e*.05,a=e*.17,s=e*.15,c=t.text?e*.17:0,m=e+2*n,p=n+e+(t.text?n*.5+c:n),f=m+2*o,d=a+p+s,h=e*.036,b=e*.03;return{width:f,height:d,qrX:o+n,qrY:a+n,qrSize:e,shapes:[I(0,0,f,d,e*.17,r),I(o,a,m,p,e*.06,i),I(f/2-e*.11,a/2-h/2,e*.22,h,h/2,i),I(f/2-e*.15,a+p+s/2-b/2,e*.3,b,b/2,i)],label:l(t.text,f/2,a+n+e+n*.5+c/2,c,m-2*n,u.textColor||r),squareEdges:!1,color:r}},Xr=t=>{let{size:e,gap:n,band:r,color:i,background:u,frame:l,fitLabel:o}=t,a=e*.05,s=e+2*n,c=s+2*a,m=Kt(a+s+a*1.2),p=m+r,f=Kt(e*.055),d=e*.04,h=q`M${d} 0H${c-d}A${d} ${d} 0 0 1 ${c} ${d}`+q`V${m-f}A${f} ${f} 0 0 0 ${c} ${m+f}`+q`V${p-d}A${d} ${d} 0 0 1 ${c-d} ${p}`+q`H${d}A${d} ${d} 0 0 1 0 ${p-d}`+q`V${m+f}A${f} ${f} 0 0 0 0 ${m-f}`+q`V${d}A${d} ${d} 0 0 1 ${d} 0Z`,b=[],g=e*.03,y=e*.022,S=e*.012;for(let E=f+y;E+g<=c-f-y/2;E+=g+y)b.push(A(E,m-S/2,g,S));return{width:c,height:p,qrX:a+n,qrY:a+n,qrSize:e,shapes:[mt(h,i),I(a,a,s,s,e*.02,u),mt(b.join(""),u)],label:o(t.text,c/2,m+r/2,r,s-2*n,l.textColor||z),squareEdges:!1,color:i}},Vr=t=>{let{size:e,gap:n,border:r,band:i,color:u,background:l,frame:o,fitLabel:a}=t,s=e*.18,c=e*.05,m=e+2*(r+n),p=e*.06,f=Math.max(p-r,0),d=m+2*s,h=m-r,b=s*.5,g=h+c,y=b+c*2,S=s*.28,E=V(u,"#000000",.28),P=V(u,"#000000",.5);return{width:d,height:g+i,qrX:s+r+n,qrY:r+n,qrSize:e,shapes:[k([[0,g],[y,g],[y,g+i],[0,g+i],[S,g+i/2]],E),k([[d,g],[d-S,g+i/2],[d,g+i],[d-y,g+i],[d-y,g]],E),k([[b,h+i],[b+c*1.6,h+i+c],[b,h+i+c]],P),k([[d-b,h+i],[d-b,h+i+c],[d-b-c*1.6,h+i+c]],P),I(s+r,r,m-2*r,m-2*r,f,l),It(Q(s,0,m,m,p),Q(s+r,r,m-2*r,m-2*r,f),u),I(b,h,d-2*b,i,0,u)],label:a(t.text,d/2,h+i/2,i,d-2*b-2*n,o.textColor||z),squareEdges:!1,color:u}},jr=t=>{let{size:e,gap:n,band:r,color:i,background:u,frame:l,fitLabel:o}=t,a=e*.08,s=e+2*n,c=s+2*a,m=e*.05,p=m+n+e+n*.6,f=e*.14,d=p+f+r+e*.02,h=m+e*.32,b=e*.012,g=p+f-m;return{width:c,height:d,qrX:a+n,qrY:m+n,qrSize:e,shapes:[I(0,h,c,d-h,0,V(i,z,.45)),k([[0,h],[c/2,0],[c,h]],V(i,z,.25)),I(a,m,s,g,0,u),It(Q(a-b,m-b,s+2*b,g+b),Q(a,m,s,g),i),k([[0,p],[c/2,p+f],[c,p],[c,d],[0,d]],i)],label:o(t.text,c/2,p+f+r/2,r,s-2*n,l.textColor||z),squareEdges:!1,color:i}},Wr=t=>{let{size:e,gap:n,band:r,color:i,background:u,frame:l,fitLabel:o}=t,a=e*.06,s=e+2*n,c=s+2*a,m=e*.24,p=e*.04,f=m*.48,d=e*.14,h=t.text?r:a,b=m+s+h,g=e*.04,y=q`M${d} 0H${c-d}L${c} ${d}`+q`V${b-g}A${g} ${g} 0 0 1 ${c-g} ${b}`+q`H${g}A${g} ${g} 0 0 1 0 ${b-g}V${d}Z`+$(c/2,f,p);return{width:c,height:b,qrX:a+n,qrY:m+n,qrSize:e,shapes:[mt(y,i,"evenodd"),mt($(c/2,f,p*1.7)+$(c/2,f,p),V(i,z,.35),"evenodd"),I(a,m,s,s,e*.02,u)],label:o(t.text,c/2,m+s+h/2,h,s-2*n,l.textColor||z),squareEdges:!1,color:i}},Zr=t=>{let{size:e,color:n,background:r,frame:i,fitLabel:u}=t,l=e*.13,o=t.text?e*.26:l,a=t.secondaryText?e*.2:l,s=e+2*l,c=o+e+a,m=e*.03,p=e*.022,f=e*.045,d=e*.008,h=i.textColor||n,b=[I(0,0,s,c,m,r),It(Q(0,0,s,c,m),Q(p,p,s-2*p,c-2*p,Math.max(m-p,0)),n),It(Q(f,f,s-2*f,c-2*f),Q(f+d,f+d,s-2*(f+d),c-2*(f+d)),n)];if(t.text){let g=o-e*.075,y=e*.022;b.push(I(s*.3,g-d/2,s*.4,d,0,n),k([[s/2,g-y],[s/2+y,g],[s/2,g+y],[s/2-y,g]],n))}return{width:s,height:c,qrX:l,qrY:o,qrSize:e,shapes:b,label:u(t.text,s/2,e*.115,e*.17,s-2*l,h),extraLabels:pn(u(t.secondaryText,s/2,o+e+a*.45,a*.8,s-2*l,h,"secondaryText")),squareEdges:!1,color:n}},Jr=t=>{let{size:e,gap:n,color:r,background:i,frame:u,fitLabel:l}=t,o=e*.025,a=e*.07,s=e*.03,c=e*.13,m=t.text?e*.17:0,p=n*1.25,f=e+2*p,d=f+2*a,h=f+2*a+m,b=d+2*o,g=h+2*o;return{width:b+s,height:g+s,qrX:o+a+p,qrY:o+a+p,qrSize:e,shapes:[I(s,s,b,g,c+o,V(r,z,.7)),I(0,0,b,g,c+o,z),I(o,o,d,h,c,r),I(o+a,o+a,f,f,e*.04,i)],label:l(t.text,o+d/2,o+a+f+(a+m)/2,a+m,f-2*n,u.textColor||z),squareEdges:!1,color:r}};function ln(t,e,n,r){let i=t<e+r?e+r-t:t>e+n-r?t-(e+n-r):0;return r-Math.sqrt(Math.max(0,r*r-Math.min(i,r)**2))}function Kr(t,e,n,r,i,u,l=48){let o=Math.max(n-r,0),a=t-2*r,s=new Set([r,t-r]);for(let b=0;b<=l;b++)s.add(t*b/l);let c=[...s].sort((b,g)=>b-g),m=t*.002,p=5,f=b=>ln(b,0,t,n),d=b=>r+ln(b,r,a,o),h=[];for(let b=0;b+1<c.length;b++){let g=c[b],y=Math.min(t,c[b+1]+(b+2<c.length?m:0)),S=V(i,u,(g+y)/2/t),E=C=>Array.from({length:p},(L,w)=>{let _=w/(p-1);return C?y+(g-y)*_:g+(y-g)*_});g>=r-1e-9&&c[b+1]<=t-r+1e-9?h.push(k([...E(!1).map(C=>[C,f(C)]),...E(!0).map(C=>[C,d(C)])],S),k([...E(!1).map(C=>[C,e-d(C)]),...E(!0).map(C=>[C,e-f(C)])],S)):h.push(k([...E(!1).map(C=>[C,f(C)]),...E(!0).map(C=>[C,e-f(C)])],S))}return h}var to=t=>{let{size:e,gap:n,background:r,frame:i,fitLabel:u}=t,l=i.color||cn.from,o=i.secondaryColor||cn.to,a=e*.05,s=e+2*(a+n),c=t.text?e*.18:0,m=e+(t.text?n+c:2*n),p=m+2*a,f=e*.1;return{width:s,height:p,qrX:a+n,qrY:a+n,qrSize:e,shapes:[I(a,a,s-2*a,m,f-a,r),...Kr(s,p,f,a,l,o)],label:u(t.text,s/2,a+n+e+c/2,c,s-2*a-2*n,i.textColor||V(l,o,.5)),squareEdges:!1,color:l}},eo=t=>{let{size:e,gap:n,color:r,background:i,frame:u,fitLabel:l}=t,o=e*.035,a=e*.2,s=e+2*(n+o),c=t.text?e*.2:0,m=s,p=m+c,f=(d,h,b,g)=>[[d,h],[d+b*a,h],[d+b*a,h+g*o],[d+b*o,h+g*o],[d+b*o,h+g*a],[d,h+g*a]];return{width:s,height:p,qrX:o+n,qrY:o+n,qrSize:e,shapes:[I(0,0,s,p,0,i),k(f(0,0,1,1),r),k(f(m,0,-1,1),r),k(f(m,m,-1,-1),r),k(f(0,m,1,-1),r)],label:l(t.text,s/2,m+c*.4,c,s-2*n,u.textColor||r),squareEdges:!1,color:r}},fn={"banner-top-bottom":Br,"speech-bubble-top":Gr,"chat-bubble":Ur,circle:Yr,polaroid:Hr,phone:Qr,ticket:Xr,badge:Vr,envelope:jr,tag:Wr,"menu-card":Zr,sticker:Jr,"gradient-border":to,focus:eo};function xt(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 le=class extends Error{issues;constructor(e){super(`Invalid frame spec: ${e.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=e}},dn=new WeakMap;function no(t){if(t&&typeof t=="object"){let n=dn.get(t);if(n)return n}if(t==null)throw new le(['A "custom" frame needs a spec']);let e=Pe.safeParse(t);if(!e.success)throw new le(e.error.issues.map(n=>n.path.length>0?`${n.path.join(".")}: ${n.message}`:n.message));return typeof t=="object"&&dn.set(t,e.data),e.data}function ro(t){let e=xt(t,et),n=kt(e);return n&&n.a>=1?e:et}function oo(t,e,n){let r=t.color||e.colors.frame,i=t.textColor||e.colors.text||r,u=t.secondaryColor||e.colors.accent||r,l=o=>{switch(o){case"frame":return r;case"text":return i;case"accent":return u;case"background":return n;default:return o}};return o=>typeof o=="string"?l(o):V(l(o.mix[0]),l(o.mix[1]),o.amount)}function hn(t,e,n=0,r=0){let i=te(t);return i?Qe(i,e,n,r):""}function io(t,e,n,r){return`M${x(t-n)} ${x(e)}A${x(n)} ${x(r)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(r)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function ao(t,e){let[n,r,i,u]=[t.x1*e,t.y1*e,t.x2*e,t.y2*e],l=Math.hypot(i-n,u-r),o=t.width*e/2,a=l>0?(i-n)/l:1,s=l>0?(u-r)/l:0,c=-s*o,m=a*o,p=(b,g)=>{let y=[n+a*b,r+s*b],S=[n+a*g,r+s*g];if(t.cap==="round"&&g-b>2*o){let E=[y[0]+a*o,y[1]+s*o],P=[S[0]-a*o,S[1]-s*o];return`M${x(E[0]-c)} ${x(E[1]-m)}L${x(P[0]-c)} ${x(P[1]-m)}A${x(o)} ${x(o)} 0 0 1 ${x(P[0]+c)} ${x(P[1]+m)}L${x(E[0]+c)} ${x(E[1]+m)}A${x(o)} ${x(o)} 0 0 1 ${x(E[0]-c)} ${x(E[1]-m)}Z`}return`M${x(y[0]-c)} ${x(y[1]-m)}L${x(S[0]-c)} ${x(S[1]-m)}L${x(S[0]+c)} ${x(S[1]+m)}L${x(y[0]+c)} ${x(y[1]+m)}Z`};if(!t.dash)return{type:"path",d:p(0,l),fillRule:"nonzero"};let f=t.dash[0]*e,d=f+t.dash[1]*e,h=[];for(let b=0;b+f<=l+1e-6;b+=d)h.push(p(b,b+f));return{type:"path",d:h.join(""),fillRule:"nonzero"}}function so(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:$(t.cx*e,t.cy*e,t.r*e)+(t.hole?$(t.cx*e,t.cy*e,t.hole*e):""),fillRule:t.hole?"evenodd":"nonzero"};case"ellipse":return{type:"path",d:io(t.cx*e,t.cy*e,t.rx*e,t.ry*e),fillRule:"nonzero"};case"polygon":return{type:"polygon",points:t.points.map(([n,r])=>[n*e,r*e])};case"path":return{type:"path",d:hn(t.d,e),fillRule:t.fillRule??"nonzero"};case"line":return ao(t,e);default:{let n=an(t.icon);return{type:"path",d:hn(n.d,t.size*e/rn,t.x*e,t.y*e),fillRule:n.fillRule}}}}function co(t){if(t.type==="rect"){let{x:e,y:n,width:r,height:i,radius:u,hole:l}=t;return[...be(e,n,r,i,u,u),...l?be(l.x,l.y,l.width,l.height,l.radius,l.radius):[]]}return t.type==="polygon"?[...t.points.map(([e,n],r)=>r===0?{op:"M",x:e,y:n}:{op:"L",x:e,y:n}),{op:"Z"}]:ee(t.d)}function lo(t,e,n){let r=co(t),i=Ve(r,.2),u=t.type==="rect"?t.hole?"evenodd":"nonzero":t.type==="path"?t.fillRule??"nonzero":"nonzero",l=e.direction==="vertical",o=b=>l?b[1]:b[0],a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(let b of i)for(let g of b)a=Math.min(a,o(g)),s=Math.max(s,o(g));if(!(s>a))return[];let c=e.steps??32,m=n(e.from),p=n(e.to),f=s-a,d=f*.002,h=[];for(let b=0;b<c;b++){let g=a+f*b/c,y=Math.min(s,a+f*(b+1)/c+(b+1<c?d:0)),S=l?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:g,y1:y}:{x0:g,x1:y,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},E=i.map(P=>je(P,S)).filter(P=>P.length>2);E.length!==0&&h.push({type:"path",d:We(E),fill:V(m,p,(b+.5)/c),fillRule:u})}return h}function uo(t,e,n){let r=so(t,e);return typeof t.fill=="object"&&"gradient"in t.fill?lo(r,t.fill.gradient,n):[{...r,fill:n(t.fill)}]}function mo(t,e){let n=Math.min(t.maxLength??N.maxTextLength,N.maxTextLength),r=t.slot==="primary"?e.text??t.text:t.slot==="secondary"?e.secondaryText??t.text:t.text;return Me(r,n)}function po(t){return t===void 0||!Number.isFinite(t)?1:Math.min(bt,Math.max(qt,t))}function fo(t,e,n,r){let i=mo(t,e);if(!i)return[];let u=po(e.fontScale),l=r(t.color),o=t.weight==="regular"?{fontWeight:400}:{};if(t.type==="curved"){let{cx:h,cy:b,radius:g,side:y,spread:S=140}=t.curve,E=g*n*(S*Math.PI/180),P=Math.min(t.fontSize*n*u,E/(wt(i)+.08*i.length));return ce(i,h*n,b*n,g*n,P,y,l,t.id).map(C=>({...C,...o}))}let a=t.box.x*n,s=t.box.y*n,c=t.box.width*n,m=t.box.height*n,p=(t.fontSize??t.box.height*.52)*n,f=Math.min(p*u,m*Ee,c/wt(i)),d=t.align??"middle";return[{text:i,x:d==="start"?a:d==="end"?a+c:a+c/2,y:s+m/2+f*.35,fontSize:f,maxWidth:c,color:l,...d!=="middle"&&{align:d},...o,field:t.id}]}function gn(t,e,n){let r=no(e.spec),i=t/r.qr.size,u=ro(n),l=oo(e,r,u),o=r.shapes.flatMap(f=>uo(f,i,l)),a=oe(r)*i;o.push({type:"rect",x:r.qr.x*i-a,y:r.qr.y*i-a,width:t+2*a,height:t+2*a,radius:(r.qr.radius??0)*i,fill:u});let s=r.labels.flatMap(f=>fo(f,e,i,l)),c=s[0],m=c&&c.rotate===void 0?c:null,p=r.bleed??"none";return{width:r.artboard.width*i,height:r.artboard.height*i,qrX:r.qr.x*i,qrY:r.qr.y*i,qrSize:t,shapes:o,label:m,extraLabels:m?s.slice(1):s,squareEdges:p!=="none",color:l(p==="none"?"frame":p)}}var Sn=require("react/jsx-runtime"),go="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",bo=.08,yo="#000000",Ae="#FFFFFF";function bn(t){return!!(t?.style&&t.style!=="none")}function xo(t){return(t.text??Ye).trim().slice(0,rt)}function So(t){return(t.secondaryText??"").trim().slice(0,rt)}function Eo(t){return t===void 0||!Number.isFinite(t)?1:Math.min(bt,Math.max(qt,t))}function Mo(t,e,n,r,i,u,l,o){if(!t)return null;let a=Math.min(r*.52*l,i/wt(t));return{text:t,x:e,y:n+a*.35,fontSize:a,maxWidth:i,color:u,field:o}}function yn(t,e,n){if(e.style===Se)return gn(t,e,n);let r=e.color||yo,i=xt(n,et),u=xo(e),l=t*bo,o=t*.04,a=t*.22,s=t+2*(o+l),c=s-2*o,m=c-2*l,p=o+l,f=Eo(e.fontScale),d=(h,b,g,y,S,E,P="text")=>Mo(h,b,g,y,S,E,f,P);if(un(e.style))return fn[e.style]({size:t,frame:e,color:r,background:i,text:u,secondaryText:So(e),gap:l,border:o,band:a,fontScale:f,fitLabel:d});switch(e.style){case"banner-top":{let h=t+2*l;return{width:s,height:a+h+o,qrX:p,qrY:a+l,qrSize:t,shapes:[Bt(o,a,c,h,0,i),ue(it(0,0,s,a+h+o,0),it(o,a,c,h,0),r)],label:d(u,s/2,a/2,a,m,e.textColor||Ae),squareEdges:!0,color:r}}case"border":case"rounded-border":{let h=u?t*.18:0,b=t+(u?l+h:2*l),g=b+2*o,y=e.style==="rounded-border"?t*.1:0,S=Math.max(y-o,0);return{width:s,height:g,qrX:p,qrY:o+l,qrSize:t,shapes:[Bt(o,o,c,b,S,i),ue(it(0,0,s,g,y),it(o,o,c,b,S),r)],label:d(u,s/2,o+l+t+h/2,h,m,e.textColor||r),squareEdges:y===0,color:r}}case"speech-bubble":{let h=t*.07,b=Math.max(h-o,0),g=t*.025,y=t*.08,S=s+g+y;return{width:s,height:S+a,qrX:p,qrY:o+l,qrSize:t,shapes:[Bt(o,o,c,c,b,i),ue(it(0,0,s,s,h),it(o,o,c,c,b),r),{type:"polygon",points:[[s/2-y,S+y/2],[s/2,s+g],[s/2+y,S+y/2]],fill:r},Bt(0,S,s,a,a/2,r)],label:d(u,s/2,S+a/2,a,m,e.textColor||Ae),squareEdges:!1,color:r}}default:{let h=t+2*l;return{width:s,height:o+h+a,qrX:p,qrY:o+l,qrSize:t,shapes:[Bt(o,o,c,h,0,i),ue(it(0,0,s,o+h+a,0),it(o,o,c,h,0),r)],label:d(u,s/2,o+h+a/2,a,m,e.textColor||Ae),squareEdges:!0,color:r}}}}function it(t,e,n,r,i){return{x:t,y:e,width:n,height:r,radius:i}}function Bt(t,e,n,r,i,u){return{type:"rect",...it(t,e,n,r,i),fill:u}}function ue(t,e,n){return{type:"rect",...t,fill:n,hole:e}}function Co(t){return[...t.label?[t.label]:[],...t.extraLabels??[]]}function xn(t,e){let n=({x:r,y:i,width:u,height:l,radius:o})=>{let a=Math.min(o,u/2,l/2);t.moveTo(r+a,i),t.arcTo(r+u,i,r+u,i+l,a),t.arcTo(r+u,i+l,r,i+l,a),t.arcTo(r,i+l,r,i,a),t.arcTo(r,i,r+u,i,a),t.closePath()};for(let r of e.shapes)if(!(r.fill==="transparent"||r.fill==="none")){if(t.fillStyle=r.fill,r.type==="path"){typeof Path2D<"u"&&t.fill(new Path2D(r.d),r.fillRule??"nonzero");continue}t.beginPath(),r.type==="polygon"?(r.points.forEach(([i,u],l)=>{l===0?t.moveTo(i,u):t.lineTo(i,u)}),t.closePath(),t.fill()):(n(r),r.hole&&n(r.hole),t.fill("evenodd"))}for(let r of Co(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 Mn=require("react/jsx-runtime"),Po=.22,Lo=.14;function Ro(t,e){let n=t.w*e,r=t.h*e;return{x:t.x+n,y:t.y+r,w:t.w-2*n,h:t.h-2*r}}function $e(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 r=e==="rounded"?Math.min(n.w,n.h)*Po:0;r>0&&typeof t.roundRect=="function"?t.roundRect(n.x,n.y,n.w,n.h,r):t.rect(n.x,n.y,n.w,n.h)}function En(t,e){return e?Ro(t,Lo):t}var{QrCode:Fe}=H,Ao={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function $o(t){let e=t*4+17,n=new Uint8Array(e*e),r=(l,o)=>{l>=0&&o>=0&&l<e&&o<e&&(n[o*e+l]=1)};for(let l=0;l<e;l++)r(6,l),r(l,6);for(let[l,o]of[[3,3],[e-4,3],[3,e-4]])for(let a=-4;a<=4;a++)for(let s=-4;s<=4;s++)r(l+s,o+a);let i=[];if(t>1){let l=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(l*2-2))*2;i.push(6);for(let a=e-7;i.length<l;a-=o)i.splice(1,0,a)}let u=i.length-1;for(let[l,o]of i.entries())for(let[a,s]of i.entries())if(!(l===0&&a===0||l===0&&a===u||l===u&&a===0))for(let c=-2;c<=2;c++)for(let m=-2;m<=2;m++)r(o+m,s+c);for(let l=0;l<=8;l++)r(8,l),r(l,8);for(let l=0;l<8;l++)r(e-1-l,8),r(8,e-1-l);if(t>=7)for(let l=0;l<18;l++){let o=e-11+l%3,a=Math.floor(l/3);r(o,a),r(a,o)}return n}function Fo(t,e){let n=t*4+17,r=lt[e].ordinal,i=Fe.NUM_ERROR_CORRECTION_BLOCKS[r]?.[t]??0,u=Fe.ECC_CODEWORDS_PER_BLOCK[r]?.[t]??0,l=Math.floor(Fe.getNumRawDataModules(t)/8),o=i-l%i,a=Math.floor(l/i),s=Array.from({length:i},(E,P)=>a+(P<o?0:1)),c=[],m=[],p=a-u;for(let E=0;E<=a;E++)for(let P=0;P<i;P++)if(P<o){if(E===p)continue;c.push(P),m.push(E<p?E:E-1)}else c.push(P),m.push(E);if(c.length!==l)throw new Error(`Codeword map: interleave mismatch at version ${t}`);let f=$o(t),d=new Int16Array(n*n).fill(-1),h=new Int16Array(n*n).fill(-1),b=new Int8Array(n*n).fill(-1),g=l*8,y=0;for(let E=n-1;E>=1;E-=2){E===6&&(E=5);let P=(E+1&2)===0;for(let C=0;C<n;C++)for(let L=0;L<2;L++){let w=E-L,O=(P?n-1-C:C)*n+w;if(!f[O]&&y<g){let tt=y>>>3;d[O]=c[tt],h[O]=m[tt],b[O]=7-(y&7),y++}}}if(y!==g)throw new Error(`Codeword map: placement mismatch at version ${t}`);let S=Ao[`${t}${e}`]??0;return{version:t,level:e,size:n,blocks:i,eccPerBlock:u,blockLengths:s,correctable:Math.floor((u-S)/2),block:d,codeword:h,bit:b}}var Io=8,St=new Map;function Cn(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}`,r=St.get(n);if(r)return St.delete(n),St.set(n,r),r;let i=Fo(t,e);if(St.size>=Io){let u=St.keys().next().value;u!==void 0&&St.delete(u)}return St.set(n,i),i}function Pn(t,e){let n=new Array(t.blocks).fill(0),r=new Set;for(let i of e){let u=t.block[i]??-1;if(u<0)continue;let l=u*4096+t.codeword[i];r.has(l)||(r.add(l),n[u]=n[u]+1)}return n}var R=require("zod");var K=require("zod"),wo=["logo","halftone"],vo=K.z.enum(wo),Ln={logo:["blend","badge"],halftone:["color","mono"]},_o=K.z.enum([...Ln.logo,...Ln.halftone]),me=192,Rn=t=>Math.ceil(t/3)*4,To=K.z.object({width:K.z.number().int().min(1).max(me),height:K.z.number().int().min(1).max(me),data:K.z.string().max(Rn(me*me*4))}).refine(t=>t.data.length===Rn(t.width*t.height*4),{message:"Art image data does not match its width and height"}),An=K.z.object({mode:vo,image:To,intensity:K.z.number().min(0).max(1).optional(),variant:_o.optional(),matchEyes:K.z.boolean().optional()});var F=require("zod"),Aa=F.z.enum(["solid","linear","radial","angular","image"]),No=F.z.object({type:F.z.literal("solid"),color:F.z.string()}),Ie=F.z.object({color:F.z.string(),offset:F.z.number().min(0).max(100)}),Oo=F.z.object({type:F.z.literal("linear"),stops:F.z.array(Ie).min(2),angle:F.z.number().optional().default(0)}),qo=F.z.object({type:F.z.literal("radial"),stops:F.z.array(Ie).min(2)}),zo=F.z.object({type:F.z.literal("angular"),stops:F.z.array(Ie).min(2),angle:F.z.number().optional().default(0)}),Do=F.z.enum(["cover","contain","tile"]),ko=F.z.enum(["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]),Bo=F.z.object({type:F.z.literal("image"),src:F.z.string().min(1),fit:Do.optional().default("cover"),scale:F.z.number().min(.1).max(4).optional().default(1),position:ko.optional().default("center"),opacity:F.z.number().min(0).max(1).optional().default(1),underlay:F.z.string().optional()}),Et=F.z.union([F.z.string(),No,Oo,qo,zo,Bo]);var we=require("zod"),$n=["square","rounded","circle","message","message-reverse","diya","diya-reverse","rounded-triangle","leaf","drop","plus","cross-rounded","hexagon","octagon","flower","heart","squircle","dots","extra-rounded","leaf-reverse","drop-reverse"],Go=["diamond","star","banner"],Fn=we.z.enum([...$n,...Go]),Fa=we.z.enum($n);var ve=require("zod"),In=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse"],Uo=["curly"],wn=ve.z.enum([...In,...Uo]),wa=ve.z.enum(In);var vn=require("zod"),Yo=["circle","circle-large","square","diamond","circle-mixed","pacman","rounded","small-square","vertical-line","horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"],_n=vn.z.enum(Yo);var Ho=["square","rounded","circle"],Tn=R.z.enum(Ho),Qo=R.z.object({src:R.z.string(),height:R.z.number(),width:R.z.number(),excavate:R.z.boolean(),x:R.z.number().optional(),y:R.z.number().optional(),padding:R.z.number().min(0).optional(),shape:Tn.optional(),plate:R.z.string().optional()}),Xo=.1,Vo=.3;var jo=2,ka=R.z.object({size:R.z.number().min(Xo).max(Vo).optional(),padding:R.z.number().min(0).max(jo).optional(),x:R.z.number().min(0).max(1).optional(),y:R.z.number().min(0).max(1).optional(),shape:Tn.optional(),plate:R.z.string().optional()}),Wo=R.z.enum(["L","M","Q","H"]),Zo=.5,Jo=1,Nn=.07,Ko=["square","circle","heart"],ti=R.z.enum(Ko),On=3,Mt=64,Gt=8,qn=.42,ei=R.z.object({type:R.z.literal("silhouette"),width:R.z.number().int().min(Gt).max(Mt),height:R.z.number().int().min(Gt).max(Mt),cells:R.z.string().max(Mt*Mt).regex(/^[01]*$/).describe('Row by row, "1" inside the shape and "0" outside: width \xD7 height characters')}).refine(t=>t.cells.length===t.width*t.height,{message:"Silhouette cells do not match its width and height"}),ni=R.z.union([ti,ei]);var _e=R.z.object({outer:Et.optional(),inner:Et.optional()}),ri=R.z.object({topLeft:_e.optional(),topRight:_e.optional(),bottomLeft:_e.optional()}),Ba=R.z.object({value:R.z.string(),size:R.z.number().optional(),level:Wo.optional(),bgColor:Et.optional(),fgColor:Et.optional(),eyeColor:Et.optional(),dotColor:Et.optional(),bodyPattern:_n.optional(),cornerEyePattern:wn.optional(),cornerEyeDotPattern:Fn.optional(),margin:R.z.number().optional(),imageSettings:Qo.optional(),isOGContext:R.z.boolean().optional(),templateId:R.z.string().optional(),customProps:R.z.record(R.z.string(),R.z.any()).optional(),frame:en.optional(),art:An.optional(),eyeColors:ri.optional(),moduleScale:R.z.number().min(Zo).max(Jo).optional(),autoLevel:R.z.boolean().optional(),shape:ni.optional()});var oi={2:6,3:12};function zn(t){let e=[t.start],n=t.start;for(let r of t.segments){let i=r.at(-1);if(r.length===1)e.push(i);else{let u=oi[r.length];for(let l=1;l<=u;l++){let o=l/u,a=1-o;if(r.length===2){let[s]=r;e.push([a*a*n[0]+2*a*o*s[0]+o*o*i[0],a*a*n[1]+2*a*o*s[1]+o*o*i[1]])}else{let[s,c]=r;e.push([a*a*a*n[0]+3*a*a*o*s[0]+3*a*o*o*c[0]+o*o*o*i[0],a*a*a*n[1]+3*a*a*o*s[1]+3*a*o*o*c[1]+o*o*o*i[1]])}}}n=i}return e}function kn(t,e){let n=[];for(let r of t)for(let i=0;i<r.length;i++){let[u,l]=r[i],[o,a]=r[(i+1)%r.length];l<=e!=a<=e&&n.push(u+(e-l)/(a-l)*(o-u))}return n.sort((r,i)=>r-i)}function Bn(t,e){let n=0;for(let r of t)if(r<e)n++;else break;return n%2===1}function ii(t,e,n){return Bn(kn(t,n),e)}function Gn(t){let e=new Map;return(n,r)=>{let i=e.get(r);return i||(i=kn(t,r),e.set(r,i)),Bn(i,n)}}function ai(t,e,n,r){let i=n[0]-t,u=n[1]-e,l=r[0]-n[0],o=r[1]-n[1],a=c=>Math.max(Math.abs(i+c*l),Math.abs(u+c*o)),s=Math.min(a(0),a(1));for(let[c,m]of[[u-i,l-o],[-(i+u),l+o]])if(m!==0){let p=c/m;p>0&&p<1&&(s=Math.min(s,a(p)))}return s}function si(t,e,n){if(!ii(t,e,n))return 0;let r=Number.POSITIVE_INFINITY;for(let i of t)for(let u=0;u<i.length;u++)r=Math.min(r,ai(e,n,i[u],i[(u+1)%i.length]));return Number.isFinite(r)?r:0}function ci(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(let u of t)for(let[l,o]of u)e=Math.min(e,l),n=Math.min(n,o),r=Math.max(r,l),i=Math.max(i,o);return{x0:e,y0:n,x1:r,y1:i}}function Un(t){let e=t.map(zn),n=ci(e),r=n.x1-n.x0,i=n.y1-n.y0;if(!(r>0&&i>0))return null;let u=(d,h)=>{let b=Math.max(d-n.x0,n.x1-d,h-n.y0,n.y1-h);return b>0?si(e,d,h)/(2*b):0},l={cx:n.x0+r/2,cy:n.y0+i/2,value:0};l.value=u(l.cx,l.cy);let o=32;for(let d=1;d<o;d++)for(let h=1;h<o;h++){let b=n.x0+r*h/o,g=n.y0+i*d/o,y=u(b,g);y>l.value&&(l={cx:b,cy:g,value:y})}let a=r/o,s=i/o;for(let d=0;d<6;d++){let h=l;for(let b=-2;b<=2;b++)for(let g=-2;g<=2;g++){let y=h.cx+a*g/2,S=h.cy+s*b/2,E=u(y,S);E>l.value&&(l={cx:y,cy:S,value:E})}a/=2,s/=2}if(l.value<=0)return null;let m=.5/Math.max(l.cx-n.x0,n.x1-l.cx,l.cy-n.y0,n.y1-l.cy),p=([d,h])=>[.5+(d-l.cx)*m,.5+(h-l.cy)*m],f=t.map(d=>({start:p(d.start),segments:d.segments.map(h=>h.map(p))}));return{rings:f,polygons:f.map(zn),half:l.value}}function Yn(t,e){let n=([i,u])=>`${x(i*e)} ${x(u*e)}`,r="";for(let i of t.rings){r+=`M${n(i.start)}`;for(let u of i.segments){let l=u.length===1?"L":u.length===2?"Q":"C";r+=l+u.map(n).join(" ")}r+="Z"}return r}var li={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]]]},Dn;function Hn(){return Dn??=Un([li]),Dn}function ui(t){let{width:e,height:n,cells:r}=t;return Number.isInteger(e)&&Number.isInteger(n)&&e>=Gt&&n>=Gt&&e<=Mt&&n<=Mt&&typeof r=="string"&&r.length===e*n&&/^[01]*$/.test(r)?(i,u)=>i>=0&&u>=0&&i<e&&u<n&&r[u*e+i]==="1":null}var at=([t,e])=>`${t},${e}`;function mi(t,e,n){let r=(a,s)=>t(a-1,s-1),i=new Map,u=(a,s)=>{for(let[c,m]of[[a,s],[s,a]]){let p=i.get(at(c))??[];p.push(m),i.set(at(c),p)}};for(let a=0;a<=n;a++)for(let s=0;s<=e;s++){let c=r(s,a),m=r(s+1,a),p=r(s+1,a+1),f=r(s,a+1),d=[s,a-.5],h=[s+.5,a],b=[s,a+.5],g=[s-.5,a];switch((c?8:0)+(m?4:0)+(p?2:0)+(f?1:0)){case 1:case 14:u(g,b);break;case 2:case 13:u(b,h);break;case 3:case 12:u(g,h);break;case 4:case 11:u(d,h);break;case 6:case 9:u(d,b);break;case 7:case 8:u(g,d);break;case 5:u(d,h),u(g,b);break;case 10:u(g,d),u(b,h);break;default:break}}let l=[],o=new Set;for(let[a,s]of i){if(o.has(a)||s.length===0)continue;let[c,m]=a.split(",").map(Number),p=[[c,m]];o.add(a);let f=[c,m],d=s[0];for(;!o.has(at(d));){o.add(at(d)),p.push(d);let h=pi(i.get(at(d))??[],f,o);if(!h)break;f=d,d=h}p.length>=3&&l.push(fi(p))}return l}function pi(t,e,n){let r=at(e);return t.find(i=>at(i)!==r&&!n.has(at(i)))??t.find(i=>at(i)!==r)}function fi(t){let e=[];for(let n=0;n<t.length;n++){let r=t[(n-1+t.length)%t.length],i=t[n],u=t[(n+1)%t.length],l=(i[0]-r[0])*(u[1]-i[1])-(i[1]-r[1])*(u[0]-i[0]);Math.abs(l)>1e-9&&e.push(i)}return e.length>=3?e:t}function di(t){let e=(u,l)=>[(u[0]+l[0])/2,(u[1]+l[1])/2],n=t.length,r=e(t[n-1],t[0]),i=t.map((u,l)=>[u,e(u,t[(l+1)%n])]);return{start:r,segments:i}}var Ut=new Map;function Qn(t){let e=`${t.width}x${t.height}:${t.cells}`,n=Ut.get(e);if(n)return n;let r=ui(t),i;if(!r)i={outline:null,problem:"invalid"};else if(t.cells.includes("1")){let u=mi(r,t.width,t.height),l=u.length>0?Un(u.map(di)):null;i=l&&2*l.half>=qn?{outline:l,problem:null}:{outline:null,problem:l?"thin":"empty"}}else i={outline:null,problem:"empty"};return Ut.size>16&&Ut.delete(Ut.keys().next().value),Ut.set(e,i),i}var hi=1,Xn=.5,Vn=.5,gi=.5;function pe(t){return Math.max(t,On)}function Te(t){return t==="heart"?Hn():typeof t=="object"&&t?.type==="silhouette"?Qn(t).outline:null}function pt(t,e,n){if(n==="circle"){let l=pe(e),o=(t/2+l)*Math.SQRT2+hi;return Math.ceil(o-t/2)}let r=Te(n);if(!r)return e;let i=pe(e),u=(t+2*(i+gi))/(2*r.half);return Math.ceil((u-t)/2-1e-9)}function jn(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 bi(t,e,n){let r=pt(e,n,"circle"),i=pe(n),u=e+2*r,l=u/2,o=l-Xn-.5,a=jn(Number.parseInt(Le(t),36)||1),s=r-i,c=r+e+i;return Array.from({length:u},(m,p)=>Array.from({length:u},(f,d)=>{let h=a()<Vn;return d>=s&&d<c&&p>=s&&p<c?!1:h&&Math.hypot(d+.5-l,p+.5-l)<=o}))}var yi=Array.from({length:8},(t,e)=>{let n=e*Math.PI/4;return[Math.cos(n),Math.sin(n)]});function Ne(t,e,n,r){if(r==="circle")return bi(t,e,n);let i=Te(r);if(!i)return null;let u=pt(e,n,r),l=pe(n),o=e+2*u,a=Gn(i.polygons),s=.5+Xn,c=(d,h)=>{let b=d+.5,g=h+.5;return a(b/o,g/o)?yi.every(([y,S])=>a((b+y*s)/o,(g+S*s)/o)):!1},m=jn(Number.parseInt(Le(t),36)||1),p=u-l,f=u+e+l;return Array.from({length:o},(d,h)=>Array.from({length:o},(b,g)=>{let y=m()<Vn;return g>=p&&g<f&&h>=p&&h<f?!1:y&&c(g,h)}))}function Oe(t,e){if(t==="circle")return{circle:e/2};let n=Te(t);return n?{path:Yn(n,e)}:null}var xi=Ue(require("react"));var De=require("react/jsx-runtime");function Wn(t,e){return t.slice().map((n,r)=>r<e.y||r>=e.y+e.h?n:n.map((i,u)=>u<e.x||u>=e.x+e.w?i:!1))}function qe(t,e=0){let n=[];return t.forEach((r,i)=>{let u=null;r.forEach((l,o)=>{if(!l&&u!==null){n.push(q`M${u+e} ${i+e}h${o-u}v1H${u+e}z`),u=null;return}if(o===r.length-1){if(!l)return;u===null?n.push(q`M${o+e},${i+e} h1v1H${o+e}z`):n.push(q`M${u+e},${i+e} h${o+1-u}v1H${u+e}z`);return}l&&u===null&&(u=o)})}),n.join("")}function Yt(t,e,n,r){if(r==null)return null;let i=t.length,u=Math.floor(e*Jt),l=(i+2*n)/e,o=(r.width||u)*l,a=(r.height||u)*l,s=r.x==null?i/2-o/2:r.x*l,c=r.y==null?i/2-a/2:r.y*l,m=null;if(r.excavate){let p=Math.max(0,r.padding??0)*l,f=Math.floor(s-p),d=Math.floor(c-p),h=Math.ceil(o+s+p-f),b=Math.ceil(a+c+p-d);m={x:f,y:d,w:h,h:b}}return{x:s,y:c,h:a,w:o,excavation:m}}function fe(t){let e=t.level??$t,{imageSettings:n}=t,r=t.isOGContext&&n?.excavate&&(e==="L"||e==="M")?"Q":e;if(t.autoLevel&&n&&r!=="H"){let i=H.QrCode.encodeText(t.value,lt[r]).getModules(),u=Yt(i,t.size??jt,pt(i.length,t.margin??Zt,t.shape),n);u&&(u.excavation?u.excavation.w*u.excavation.h:u.w*u.h)/(i.length*i.length)>Nn&&(r="H")}return r}var ze=(()=>{try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})();var Si=.6,Ei=["L","M","Q","H"];function Mi(t){let e=H.QrCode.encodeText(t.value,lt[t.level]),n=Ei[e.errorCorrectionLevel.ordinal]??t.level;return{code:t,cells:e.getModules(),layoutMargin:pt(e.size,t.margin,t.shape),map:Cn(e.version,n),level:n,version:e.version}}function Ci(t,e){let{cells:n,map:r}=t,i=n.length,u=Yt(n,t.code.size,t.layoutMargin,e);if(!u)return null;let l=u.excavation??{x:Math.floor(u.x),y:Math.floor(u.y),w:Math.ceil(u.x+u.w)-Math.floor(u.x),h:Math.ceil(u.y+u.h)-Math.floor(u.y)},o=[];for(let s=Math.max(0,l.y);s<Math.min(i,l.y+l.h);s++)for(let c=Math.max(0,l.x);c<Math.min(i,l.x+l.w);c++)o.push(s*i+c);let a=Pn(r,o);return{worst:Math.max(0,...a),correctable:r.correctable,budget:Math.floor(r.correctable*Si),level:t.level,version:t.version}}var Pi=t=>!t||t.worst<=t.budget;function Li(t,e,n,r){let i=e.map(o=>Mi({...t,level:o})),u=o=>{let a=r(o);return i.every(s=>Pi(Ci(s,a)))};if(u(n))return n;let l=t.size*.005;for(let o=n-l;o>0;o-=l)if(u(o))return o;return 0}function Zn(t,e){if(!e)return;let n=Math.floor(t.size*Jt),r=e.width||n,i=e.height||n,u=p=>{if(p===r)return e;let f=i*p/r;return{...e,width:p,height:f,...e.x!=null&&{x:e.x+(r-p)/2},...e.y!=null&&{y:e.y+(i-f)/2}}},l=t.level??$t,o={value:t.value,size:t.size,margin:t.margin,shape:t.shape},a=p=>fe({...t,level:l,imageSettings:p}),s=p=>{let f=Li(o,[p],r,u);return f>0?u(f):void 0},c=a(e);if(c===l)return s(l);let m=s(c);return m&&a(m)===c?m:s(l)}var Pt=require("react/jsx-runtime");function Ri(t){let{value:e,size:n=jt,level:r=$t,bgColor:i=et,fgColor:u=Wt,margin:l=Zt,style:o,imageSettings:a,eyeColor:s,dotColor:c,bodyPattern:m,cornerEyePattern:p,cornerEyeDotPattern:f,isOGContext:d,templateId:h,customTemplate:b,customProps:g,frame:y,art:S,eyeColors:E,moduleScale:P,frameLabelMarkers:C,autoLevel:L,shape:w,..._}=t,O=Zn({value:e,size:n,margin:l,level:r,shape:w,autoLevel:L},a),tt=fe({value:e,size:n,level:r,margin:l,imageSettings:O,autoLevel:L,shape:w}),X=O?.src,U=bn(y)?yn(n,y,i):null,Z=U?.width??n,st=U?.height??n,ft=(0,Ct.useRef)(null),vt=(0,Ct.useRef)(null),[j,Y]=(0,Ct.useState)(!1);(0,Ct.useEffect)(()=>{if(ft.current!=null){let _t=ft.current,v=_t.getContext("2d");if(!v)return;let J=H.QrCode.encodeText(e,lt[tt]).getModules(),ct=pt(J.length,l,w),Tt=Ne(e,J.length,l,w),Lt=J.length+ct*2,ht=Yt(J,n,ct,O),Ht=vt.current,ke=ht!=null&&Ht?.complete&&Ht.naturalHeight!==0&&Ht.naturalWidth!==0;ke&&ht.excavation!=null&&(J=Wn(J,ht.excavation));let Qt=window.devicePixelRatio||1;_t.width=Z*Qt,_t.height=st*Qt,v.scale(Qt,Qt),U&&(xn(v,U),v.translate(U.qrX,U.qrY));let Be=n/Lt;v.scale(Be,Be),v.fillStyle=xt(i,et);let Nt=Oe(w,Lt);if(Nt&&"circle"in Nt?(v.beginPath(),v.arc(Lt/2,Lt/2,Nt.circle,0,2*Math.PI),v.fill()):Nt&&ze?v.fill(new Path2D(Nt.path),"evenodd"):v.fillRect(0,0,Lt,Lt),v.fillStyle=xt(u,Wt),ze)v.fill(new Path2D(qe(J,ct))),Tt&&v.fill(new Path2D(qe(Tt,0)));else for(let[Xt,Rt]of[[J,ct],[Tt??[],0]])Xt.forEach((Ot,gt)=>{Ot.forEach((Jn,Kn)=>{Jn&&v.fillRect(Kn+Rt,gt+Rt,1,1)})});if(ke){let Xt={x:ht.x+ct,y:ht.y+ct,w:ht.w,h:ht.h},Rt=O?.shape??"square",Ot=O?.plate,gt=En(Xt,Ot);v.save(),Ot&&($e(v,Rt,Xt),v.fillStyle=Ot,v.fill()),Rt!=="square"&&($e(v,Rt,gt),v.clip()),v.drawImage(Ht,gt.x,gt.y,gt.w,gt.h),v.restore()}}});let W={height:st,width:Z,...o},dt=null;return X!=null&&(dt=(0,Pt.jsx)("img",{alt:"QR code",onLoad:()=>{Y(!0)},ref:vt,src:X,style:{display:"none"}},X)),(0,Pt.jsxs)(Pt.Fragment,{children:[(0,Pt.jsx)("canvas",{height:st,ref:ft,style:W,width:Z,..._}),dt]})}0&&(module.exports={QRCodeCanvas});
|
|
1
|
+
"use strict";"use client";var tr=Object.create;var Vt=Object.defineProperty;var er=Object.getOwnPropertyDescriptor;var nr=Object.getOwnPropertyNames;var rr=Object.getPrototypeOf,or=Object.prototype.hasOwnProperty;var ir=(t,e)=>{for(var n in e)Vt(t,n,{get:e[n],enumerable:!0})},Ge=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of nr(e))!or.call(t,i)&&i!==n&&Vt(t,i,{get:()=>e[i],enumerable:!(r=er(e,i))||r.enumerable});return t};var Ue=(t,e,n)=>(n=t!=null?tr(rr(t)):{},Ge(e||!t||!t.__esModule?Vt(n,"default",{value:t,enumerable:!0}):n,t)),ar=t=>Ge(Vt({},"__esModule",{value:!0}),t);var Ri={};ir(Ri,{QRCodeCanvas:()=>Ai});module.exports=ar(Ri);var Ct=require("react");var Rt;(u=>{class t{constructor(o,a,s,c){this.version=o;this.errorCorrectionLevel=a;if(o<t.MIN_VERSION||o>t.MAX_VERSION)throw new RangeError("Version value out of range");if(c<-1||c>7)throw new RangeError("Mask value out of range");this.size=o*4+17;let m=[];for(let f=0;f<this.size;f++)m.push(!1);for(let f=0;f<this.size;f++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();let p=this.addEccAndInterleave(s);if(this.drawCodewords(p),c==-1){let f=1e9;for(let d=0;d<8;d++){this.applyMask(d),this.drawFormatBits(d);let h=this.getPenaltyScore();h<f&&(c=d,f=h),this.applyMask(d)}}r(0<=c&&c<=7),this.mask=c,this.applyMask(c),this.drawFormatBits(c),this.isFunction=[]}version;errorCorrectionLevel;static encodeText(o,a){let s=u.QrSegment.makeSegments(o);return t.encodeSegments(s,a)}static encodeBinary(o,a){let s=u.QrSegment.makeBytes(o);return t.encodeSegments([s],a)}static encodeSegments(o,a,s=1,c=40,m=-1,p=!0){if(!(t.MIN_VERSION<=s&&s<=c&&c<=t.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let f,d;for(f=s;;f++){let y=t.getNumDataCodewords(f,a)*8,S=i.getTotalBits(o,f);if(S<=y){d=S;break}if(f>=c)throw new RangeError("Data too long")}for(let y of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])p&&d<=t.getNumDataCodewords(f,y)*8&&(a=y);let h=[];for(let y of o){e(y.mode.modeBits,4,h),e(y.numChars,y.mode.numCharCountBits(f),h);for(let S of y.getData())h.push(S)}r(h.length==d);let b=t.getNumDataCodewords(f,a)*8;r(h.length<=b),e(0,Math.min(4,b-h.length),h),e(0,(8-h.length%8)%8,h),r(h.length%8==0);for(let y=236;h.length<b;y^=253)e(y,8,h);let g=[];for(;g.length*8<h.length;)g.push(0);return h.forEach((y,S)=>g[S>>>3]|=y<<7-(S&7)),new t(f,a,g,m)}size;mask;modules=[];isFunction=[];getModule(o,a){return 0<=o&&o<this.size&&0<=a&&a<this.size&&this.modules[a][o]}getModules(){return this.modules}drawFunctionPatterns(){for(let s=0;s<this.size;s++)this.setFunctionModule(6,s,s%2==0),this.setFunctionModule(s,6,s%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let o=this.getAlignmentPatternPositions(),a=o.length;for(let s=0;s<a;s++)for(let c=0;c<a;c++)s==0&&c==0||s==0&&c==a-1||s==a-1&&c==0||this.drawAlignmentPattern(o[s],o[c]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(o){let a=this.errorCorrectionLevel.formatBits<<3|o,s=a;for(let m=0;m<10;m++)s=s<<1^(s>>>9)*1335;let c=(a<<10|s)^21522;r(c>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,n(c,m));this.setFunctionModule(8,7,n(c,6)),this.setFunctionModule(8,8,n(c,7)),this.setFunctionModule(7,8,n(c,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,n(c,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,n(c,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,n(c,m));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let o=this.version;for(let s=0;s<12;s++)o=o<<1^(o>>>11)*7973;let a=this.version<<12|o;r(a>>>18==0);for(let s=0;s<18;s++){let c=n(a,s),m=this.size-11+s%3,p=Math.floor(s/3);this.setFunctionModule(m,p,c),this.setFunctionModule(p,m,c)}}drawFinderPattern(o,a){for(let s=-4;s<=4;s++)for(let c=-4;c<=4;c++){let m=Math.max(Math.abs(c),Math.abs(s)),p=o+c,f=a+s;0<=p&&p<this.size&&0<=f&&f<this.size&&this.setFunctionModule(p,f,m!=2&&m!=4)}}drawAlignmentPattern(o,a){for(let s=-2;s<=2;s++)for(let c=-2;c<=2;c++)this.setFunctionModule(o+c,a+s,Math.max(Math.abs(c),Math.abs(s))!=1)}setFunctionModule(o,a,s){this.modules[a][o]=s,this.isFunction[a][o]=!0}addEccAndInterleave(o){let a=this.version,s=this.errorCorrectionLevel;if(o.length!=t.getNumDataCodewords(a,s))throw new RangeError("Invalid argument");let c=t.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][a],m=t.ECC_CODEWORDS_PER_BLOCK[s.ordinal][a],p=Math.floor(t.getNumRawDataModules(a)/8),f=c-p%c,d=Math.floor(p/c),h=[],b=t.reedSolomonComputeDivisor(m);for(let y=0,S=0;y<c;y++){let E=o.slice(S,S+d-m+(y<f?0:1));S+=E.length;let P=t.reedSolomonComputeRemainder(E,b);y<f&&E.push(0),h.push(E.concat(P))}let g=[];for(let y=0;y<h[0].length;y++)h.forEach((S,E)=>{(y!=d-m||E>=f)&&g.push(S[y])});return r(g.length==p),g}drawCodewords(o){if(o.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let a=0;for(let s=this.size-1;s>=1;s-=2){s==6&&(s=5);for(let c=0;c<this.size;c++)for(let m=0;m<2;m++){let p=s-m,d=(s+1&2)==0?this.size-1-c:c;!this.isFunction[d][p]&&a<o.length*8&&(this.modules[d][p]=n(o[a>>>3],7-(a&7)),a++)}}r(a==o.length*8)}applyMask(o){if(o<0||o>7)throw new RangeError("Mask value out of range");for(let a=0;a<this.size;a++)for(let s=0;s<this.size;s++){let c;switch(o){case 0:c=(s+a)%2==0;break;case 1:c=a%2==0;break;case 2:c=s%3==0;break;case 3:c=(s+a)%3==0;break;case 4:c=(Math.floor(s/3)+Math.floor(a/2))%2==0;break;case 5:c=s*a%2+s*a%3==0;break;case 6:c=(s*a%2+s*a%3)%2==0;break;case 7:c=((s+a)%2+s*a%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[a][s]&&c&&(this.modules[a][s]=!this.modules[a][s])}}getPenaltyScore(){let o=0;for(let m=0;m<this.size;m++){let p=!1,f=0,d=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[m][h]==p?(f++,f==5?o+=t.PENALTY_N1:f>5&&o++):(this.finderPenaltyAddHistory(f,d),p||(o+=this.finderPenaltyCountPatterns(d)*t.PENALTY_N3),p=this.modules[m][h],f=1);o+=this.finderPenaltyTerminateAndCount(p,f,d)*t.PENALTY_N3}for(let m=0;m<this.size;m++){let p=!1,f=0,d=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][m]==p?(f++,f==5?o+=t.PENALTY_N1:f>5&&o++):(this.finderPenaltyAddHistory(f,d),p||(o+=this.finderPenaltyCountPatterns(d)*t.PENALTY_N3),p=this.modules[h][m],f=1);o+=this.finderPenaltyTerminateAndCount(p,f,d)*t.PENALTY_N3}for(let m=0;m<this.size-1;m++)for(let p=0;p<this.size-1;p++){let f=this.modules[m][p];f==this.modules[m][p+1]&&f==this.modules[m+1][p]&&f==this.modules[m+1][p+1]&&(o+=t.PENALTY_N2)}let a=0;for(let m of this.modules)a=m.reduce((p,f)=>p+(f?1:0),a);let s=this.size*this.size,c=Math.ceil(Math.abs(a*20-s*10)/s)-1;return r(0<=c&&c<=9),o+=c*t.PENALTY_N4,r(0<=o&&o<=2568888),o}getAlignmentPatternPositions(){if(this.version==1)return[];{let o=Math.floor(this.version/7)+2,a=this.version==32?26:Math.ceil((this.version*4+4)/(o*2-2))*2,s=[6];for(let c=this.size-7;s.length<o;c-=a)s.splice(1,0,c);return s}}static getNumRawDataModules(o){if(o<t.MIN_VERSION||o>t.MAX_VERSION)throw new RangeError("Version number out of range");let a=(16*o+128)*o+64;if(o>=2){let s=Math.floor(o/7)+2;a-=(25*s-10)*s-55,o>=7&&(a-=36)}return r(208<=a&&a<=29648),a}static getNumDataCodewords(o,a){return Math.floor(t.getNumRawDataModules(o)/8)-t.ECC_CODEWORDS_PER_BLOCK[a.ordinal][o]*t.NUM_ERROR_CORRECTION_BLOCKS[a.ordinal][o]}static reedSolomonComputeDivisor(o){if(o<1||o>255)throw new RangeError("Degree out of range");let a=[];for(let c=0;c<o-1;c++)a.push(0);a.push(1);let s=1;for(let c=0;c<o;c++){for(let m=0;m<a.length;m++)a[m]=t.reedSolomonMultiply(a[m],s),m+1<a.length&&(a[m]^=a[m+1]);s=t.reedSolomonMultiply(s,2)}return a}static reedSolomonComputeRemainder(o,a){let s=a.map(c=>0);for(let c of o){let m=c^s.shift();s.push(0),a.forEach((p,f)=>s[f]^=t.reedSolomonMultiply(p,m))}return s}static reedSolomonMultiply(o,a){if(o>>>8||a>>>8)throw new RangeError("Byte out of range");let s=0;for(let c=7;c>=0;c--)s=s<<1^(s>>>7)*285,s^=(a>>>c&1)*o;return r(s>>>8==0),s}finderPenaltyCountPatterns(o){let a=o[1];r(a<=this.size*3);let s=a>0&&o[2]==a&&o[3]==a*3&&o[4]==a&&o[5]==a;return(s&&o[0]>=a*4&&o[6]>=a?1:0)+(s&&o[6]>=a*4&&o[0]>=a?1:0)}finderPenaltyTerminateAndCount(o,a,s){return o&&(this.finderPenaltyAddHistory(a,s),a=0),a+=this.size,this.finderPenaltyAddHistory(a,s),this.finderPenaltyCountPatterns(s)}finderPenaltyAddHistory(o,a){a[0]==0&&(o+=this.size),a.pop(),a.unshift(o)}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]]}u.QrCode=t;function e(l,o,a){if(o<0||o>31||l>>>o)throw new RangeError("Value out of range");for(let s=o-1;s>=0;s--)a.push(l>>>s&1)}function n(l,o){return(l>>>o&1)!=0}function r(l){if(!l)throw new Error("Assertion error")}class i{constructor(o,a,s){this.mode=o;this.numChars=a;this.bitData=s;if(a<0)throw new RangeError("Invalid argument");this.bitData=s.slice()}mode;numChars;bitData;static makeBytes(o){let a=[];for(let s of o)e(s,8,a);return new i(i.Mode.BYTE,o.length,a)}static makeNumeric(o){if(!i.isNumeric(o))throw new RangeError("String contains non-numeric characters");let a=[];for(let s=0;s<o.length;){let c=Math.min(o.length-s,3);e(parseInt(o.substr(s,c),10),c*3+1,a),s+=c}return new i(i.Mode.NUMERIC,o.length,a)}static makeAlphanumeric(o){if(!i.isAlphanumeric(o))throw new RangeError("String contains unencodable characters in alphanumeric mode");let a=[],s;for(s=0;s+2<=o.length;s+=2){let c=i.ALPHANUMERIC_CHARSET.indexOf(o.charAt(s))*45;c+=i.ALPHANUMERIC_CHARSET.indexOf(o.charAt(s+1)),e(c,11,a)}return s<o.length&&e(i.ALPHANUMERIC_CHARSET.indexOf(o.charAt(s)),6,a),new i(i.Mode.ALPHANUMERIC,o.length,a)}static makeSegments(o){return o==""?[]:i.isNumeric(o)?[i.makeNumeric(o)]:i.isAlphanumeric(o)?[i.makeAlphanumeric(o)]:[i.makeBytes(i.toUtf8ByteArray(o))]}static makeEci(o){let a=[];if(o<0)throw new RangeError("ECI assignment value out of range");if(o<128)e(o,8,a);else if(o<16384)e(2,2,a),e(o,14,a);else if(o<1e6)e(6,3,a),e(o,21,a);else throw new RangeError("ECI assignment value out of range");return new i(i.Mode.ECI,0,a)}static isNumeric(o){return i.NUMERIC_REGEX.test(o)}static isAlphanumeric(o){return i.ALPHANUMERIC_REGEX.test(o)}getData(){return this.bitData.slice()}static getTotalBits(o,a){let s=0;for(let c of o){let m=c.mode.numCharCountBits(a);if(c.numChars>=1<<m)return 1/0;s+=4+m+c.bitData.length}return s}static toUtf8ByteArray(o){o=encodeURI(o);let a=[];for(let s=0;s<o.length;s++)o.charAt(s)!="%"?a.push(o.charCodeAt(s)):(a.push(parseInt(o.substr(s+1,2),16)),s+=2);return a}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}u.QrSegment=i})(Rt||={});(e=>{let t;(r=>{class n{constructor(u,l){this.ordinal=u;this.formatBits=l}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)}r.Ecc=n})(t=e.QrCode||={})})(Rt||={});(e=>{let t;(r=>{class n{constructor(u,l){this.modeBits=u;this.numBitsCharCount=l}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(u){return this.numBitsCharCount[Math.floor((u+7)/17)]}}r.Mode=n})(t=e.QrSegment||={})})(Rt||={});var H=Rt;var lt={L:H.QrCode.Ecc.LOW,M:H.QrCode.Ecc.MEDIUM,Q:H.QrCode.Ecc.QUARTILE,H:H.QrCode.Ecc.HIGH},jt=128,$t="Q",et="#FFFFFF",Wt="#000000";var Zt=0;var Jt=.1;var ho=Ue(require("react"));var nt=require("zod"),sr=["none","banner-bottom","banner-top","border","rounded-border","speech-bubble","banner-top-bottom","speech-bubble-top","chat-bubble","circle","polaroid","phone","ticket","badge","envelope","tag","menu-card","sticker","gradient-border","focus"],rt=24,Ye="Scan me",qt=.5,bt=1.5,cr=nt.z.enum(sr),de=nt.z.object({style:cr,text:nt.z.string().max(rt).optional(),color:nt.z.string().optional(),textColor:nt.z.string().optional(),secondaryText:nt.z.string().max(rt).optional(),secondaryColor:nt.z.string().optional(),fontScale:nt.z.number().min(qt).max(bt).optional()});var M=require("zod");function Kt(t,e=3){let n=10**e;return Math.round(t*n)/n+0}function x(t,e=3){return String(Kt(t,e))}function q(t,...e){let n=t[0]??"";for(let r=0;r<e.length;r++){let i=e[r];n+=(typeof i=="number"?x(i):i)+(t[r+1]??"")}return n}var lr={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},ur=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,he=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function te(t,e=Number.POSITIVE_INFINITY){if(!ur.test(t))return null;let n=[],r=0,i=()=>{for(;r<t.length&&/[\s,]/.test(t[r]);)r++},u=()=>{i(),he.lastIndex=r;let a=he.exec(t);if(!a)return null;let s=a[0],c=s.indexOf(".");if(c>=0&&s.length-c-1>e)return null;r=he.lastIndex;let m=Number(s);return Number.isFinite(m)?m:null},l=()=>{i();let a=t[r];return a==="0"||a==="1"?(r++,a==="1"?1:0):null},o=()=>(i(),r<t.length&&/[0-9.+-]/.test(t[r]));for(i();r<t.length;){let a=t[r],s=a.toUpperCase(),c=lr[s];if(c===void 0||n.length===0&&s!=="M")return null;if(r++,c===0){n.push({command:a,values:[]}),i();continue}let m=a,p=!0;for(;p||o();){let f=[];for(let d=0;d<c;d++){let h=s==="A"&&(d===3||d===4)?l():u();if(h===null)return null;f.push(h)}n.push({command:m,values:f}),s==="M"&&(m=a==="M"?"L":"l"),p=!1}i()}return n}function He(t){let e=0;for(let{command:n}of t)e+=n.toUpperCase()==="A"?4:1;return e}function Qe(t,e=1,n=0,r=0){let i="";for(let{command:u,values:l}of t){let o=u.toUpperCase(),a=u===o,s=a?n:0,c=a?r:0,m;switch(o){case"Z":m=[];break;case"H":m=[x(l[0]*e+s)];break;case"V":m=[x(l[0]*e+c)];break;case"A":m=[x(Math.abs(l[0])*e),x(Math.abs(l[1])*e),x(l[2]),String(l[3]),String(l[4]),x(l[5]*e+s),x(l[6]*e+c)];break;default:m=l.map((p,f)=>x(p*e+(f%2===0?s:c)))}i+=u+m.join(" ")}return i}function Ve(t,e=.25){let n=[],r=[],i=[0,0],u=[0,0],l=()=>{r.length>2&&n.push(r),r=[]};for(let o of t)if(o.op==="M")l(),i=[o.x,o.y],u=i,r.push(i);else if(o.op==="L")u=[o.x,o.y],r.push(u);else if(o.op==="C"){let a=u,s=[o.x1,o.y1],c=[o.x2,o.y2],m=[o.x,o.y],p=Math.hypot(s[0]-a[0],s[1]-a[1])+Math.hypot(c[0]-s[0],c[1]-s[1])+Math.hypot(m[0]-c[0],m[1]-c[1]),f=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(p/(4*e)))));for(let d=1;d<=f;d++){let h=d/f,b=1-h;r.push([b*b*b*a[0]+3*b*b*h*s[0]+3*b*h*h*c[0]+h*h*h*m[0],b*b*b*a[1]+3*b*b*h*s[1]+3*b*h*h*c[1]+h*h*h*m[1]])}u=m}else l(),u=i;return l(),n}function je(t,e){let n=[i=>i[0]-e.x0,i=>e.x1-i[0],i=>i[1]-e.y0,i=>e.y1-i[1]],r=t;for(let i of n){if(r.length===0)break;let u=r;r=[];for(let l=0;l<u.length;l++){let o=u[l],a=u[(l+u.length-1)%u.length],s=i(o),c=i(a);s>=0?(c<0&&r.push(Xe(a,o,c,s)),r.push(o)):c>=0&&r.push(Xe(a,o,c,s))}}return r.length>2?r:[]}function Xe(t,e,n,r){let i=n/(n-r);return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]}function We(t){return t.filter(e=>e.length>2).map(e=>`M${e.map(([n,r])=>`${x(n)} ${x(r)}`).join("L")}Z`).join("")}function Ze(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY,u=(l,o)=>{e=Math.min(e,l),n=Math.min(n,o),r=Math.max(r,l),i=Math.max(i,o)};for(let l of t)l.op==="C"?(u(l.x1,l.y1),u(l.x2,l.y2),u(l.x,l.y)):l.op!=="Z"&&u(l.x,l.y);return Number.isFinite(e)?{x0:e,y0:n,x1:r,y1:i}:null}var ge=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function mr(t,e,n,r,i,u,l,o,a){if(t===o&&e===a)return[];let s=Math.abs(n),c=Math.abs(r);if(s===0||c===0)return[{op:"L",x:o,y:a}];let m=i*Math.PI/180,p=Math.cos(m),f=Math.sin(m),d=(t-o)/2,h=(e-a)/2,b=p*d+f*h,g=-f*d+p*h,y=b*b/(s*s)+g*g/(c*c);y>1&&(s*=Math.sqrt(y),c*=Math.sqrt(y));let S=s*s*c*c-s*s*g*g-c*c*b*b,E=s*s*g*g+c*c*b*b,P=(u===l?-1:1)*Math.sqrt(Math.max(0,S/E)),C=P*s*g/c,L=-P*c*b/s,w=p*C-f*L+(t+o)/2,_=f*C+p*L+(e+a)/2,O=(j,Y,W,dt)=>Math.atan2(j*dt-Y*W,j*W+Y*dt),tt=O(1,0,(b-C)/s,(g-L)/c),X=O((b-C)/s,(g-L)/c,(-b-C)/s,(-g-L)/c);!l&&X>0?X-=2*Math.PI:l&&X<0&&(X+=2*Math.PI);let U=Math.max(1,Math.ceil(Math.abs(X)/(Math.PI/2)-1e-9)),Z=X/U,st=4/3*Math.tan(Z/4),ft=(j,Y)=>[w+s*p*j-c*f*Y,_+s*f*j+c*p*Y],vt=[];for(let j=0;j<U;j++){let Y=tt+j*Z,W=Y+Z,[dt,_t]=ft(Math.cos(Y)-st*Math.sin(Y),Math.sin(Y)+st*Math.cos(Y)),[v,J]=ft(Math.cos(W)+st*Math.sin(W),Math.sin(W)-st*Math.cos(W)),[ct,Tt]=j===U-1?[o,a]:ft(Math.cos(W),Math.sin(W));vt.push({op:"C",x1:dt,y1:_t,x2:v,y2:J,x:ct,y:Tt})}return vt}function ee(t){let e=[],n=0,r=0,i=0,u=0,l=0,o="",a=null,s=null,c=()=>{for(;n<t.length&&/[\s,]/.test(t[n]);)n++},m=()=>{c(),ge.lastIndex=n;let d=ge.exec(t);return d?(n=ge.lastIndex,Number(d[0])):null},p=()=>{c();let d=t[n];return d==="0"||d==="1"?(n++,d==="1"):null},f=d=>{let h=[];for(let b=0;b<d;b++){let g=m();if(g===null)return null;h.push(g)}return h};for(;c(),!(n>=t.length);){let d=t[n];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(d))o=d,n++;else if(!o||o==="Z"||o==="z")break;let h=o===o.toLowerCase(),b=h?r:0,g=h?i:0,y=o.toUpperCase();if(y==="Z"){e.push({op:"Z"}),r=u,i=l,a=null,s=null;continue}if(y==="A"){let C=f(3),L=p(),w=p(),_=f(2);if(!(C&&_)||L===null||w===null)break;let[O,tt,X]=C,U=_[0]+b,Z=_[1]+g;e.push(...mr(r,i,O,tt,X,L,w,U,Z)),r=U,i=Z,a=null,s=null;continue}let S={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[y]??0,E=f(S);if(!E)break;let P=E;switch(y){case"M":r=P[0]+b,i=P[1]+g,u=r,l=i,e.push({op:"M",x:r,y:i}),o=h?"l":"L",a=null,s=null;break;case"L":case"H":case"V":y!=="V"&&(r=P[0]+b),y==="V"?i=P[0]+g:y==="L"&&(i=P[1]+g),e.push({op:"L",x:r,y:i}),a=null,s=null;break;case"C":case"S":{let C,L;y==="C"?(C=[P[0]+b,P[1]+g],L=P.slice(2)):(C=a?[2*r-a[0],2*i-a[1]]:[r,i],L=P);let w=[L[0]+b,L[1]+g],_=[L[2]+b,L[3]+g];e.push({op:"C",x1:C[0],y1:C[1],x2:w[0],y2:w[1],x:_[0],y:_[1]}),[r,i]=_,a=w,s=null;break}case"Q":case"T":{let C,L;y==="Q"?(C=[P[0]+b,P[1]+g],L=[P[2]+b,P[3]+g]):(C=s?[2*r-s[0],2*i-s[1]]:[r,i],L=[P[0]+b,P[1]+g]),e.push({op:"C",x1:r+2/3*(C[0]-r),y1:i+2/3*(C[1]-i),x2:L[0]+2/3*(C[0]-L[0]),y2:L[1]+2/3*(C[1]-L[1]),x:L[0],y:L[1]}),[r,i]=L,s=C,a=null;break}default:break}}return e}var Je=.5522847498;function be(t,e,n,r,i=0,u=0){if(n<=0||r<=0)return[];let l=Math.min(Math.max(i,0),n/2),o=Math.min(Math.max(u,0),r/2);if(l===0||o===0)return[{op:"M",x:t,y:e},{op:"L",x:t+n,y:e},{op:"L",x:t+n,y:e+r},{op:"L",x:t,y:e+r},{op:"Z"}];let a=l*Je,s=o*Je,c=t+n,m=e+r;return[{op:"M",x:t+l,y:e},{op:"L",x:c-l,y:e},{op:"C",x1:c-l+a,y1:e,x2:c,y2:e+o-s,x:c,y:e+o},{op:"L",x:c,y:m-o},{op:"C",x1:c,y1:m-o+s,x2:c-l+a,y2:m,x:c-l,y:m},{op:"L",x:t+l,y:m},{op:"C",x1:t+l-a,y1:m,x2:t,y2:m-o+s,x:t,y:m-o},{op:"L",x:t,y:e+o},{op:"C",x1:t,y1:e+o-s,x2:t+l-a,y2:e,x:t+l,y:e},{op:"Z"}]}var pr="qrdx.frame",fr=1,Se="custom",N={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:rt},dr=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],Ee=.95,hr=200,gr=["frame","text","accent","background"],br=/[\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 Me(t,e=rt){let n=t.slice(0,1e3).normalize("NFC").replace(br," ").replace(yr,"").replace(/\s+/g," ").trim();return Array.from(n).slice(0,Math.max(0,e)).join("").trim()}var Ce=t=>Math.abs(t*1e3-Math.round(t*1e3))<1e-6,T=M.z.number().min(-N.maxCoordinate).max(N.maxCoordinate).refine(Ce,{message:`Numbers may have at most ${N.maxDecimals} decimals`}),B=T.refine(t=>t>0,{message:"Must be greater than 0"}),re=T.refine(t=>t>=0,{message:"Must not be negative"}),ne=M.z.string().regex(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color"),ye=M.z.union([M.z.enum(gr),ne]),zt=M.z.union([ye,M.z.object({mix:M.z.tuple([ye,ye]),amount:M.z.number().min(0).max(1).refine(Ce)}).strict()]),yt=M.z.union([zt,M.z.object({gradient:M.z.object({from:zt,to:zt,direction:M.z.enum(["horizontal","vertical"]).optional(),steps:M.z.int().min(2).max(N.maxGradientSteps).optional()}).strict()}).strict()]),xe={x:T,y:T,width:B,height:B},xr=M.z.object({type:M.z.literal("rect"),...xe,radius:re.optional(),fill:yt,hole:M.z.object({...xe,radius:re.optional()}).strict().optional()}).strict(),Sr=M.z.object({type:M.z.literal("circle"),cx:T,cy:T,r:B,hole:B.optional(),fill:yt}).strict(),Er=M.z.object({type:M.z.literal("ellipse"),cx:T,cy:T,rx:B,ry:B,fill:yt}).strict(),Mr=M.z.object({type:M.z.literal("polygon"),points:M.z.array(M.z.tuple([T,T])).min(3).max(N.maxPolygonPoints),fill:yt}).strict(),Cr=M.z.object({type:M.z.literal("path"),d:M.z.string().min(2).max(N.maxPathLength),fill:yt,fillRule:M.z.enum(["nonzero","evenodd"]).optional()}).strict(),Pr=M.z.object({type:M.z.literal("line"),x1:T,y1:T,x2:T,y2:T,width:B,cap:M.z.enum(["butt","round"]).optional(),dash:M.z.tuple([B,B]).optional(),fill:yt}).strict(),Lr=M.z.object({type:M.z.literal("icon"),icon:M.z.enum(dr),x:T,y:T,size:B,fill:yt}).strict(),Ar=M.z.discriminatedUnion("type",[xr,Sr,Er,Mr,Cr,Pr,Lr]),tn={id:M.z.string().regex(/^[a-z][a-z0-9-]{0,31}$/),slot:M.z.enum(["primary","secondary","fixed"]),text:M.z.string().max(200),maxLength:M.z.int().min(1).max(rt).optional(),color:zt,weight:M.z.enum(["bold","regular"]).optional()},Rr=M.z.object({type:M.z.literal("text"),...tn,box:M.z.object(xe).strict(),align:M.z.enum(["start","middle","end"]).optional(),fontSize:B.optional()}).strict(),$r=M.z.object({type:M.z.literal("curved"),...tn,curve:M.z.object({cx:T,cy:T,radius:B,side:M.z.enum(["top","bottom"]),spread:M.z.number().min(20).max(300).refine(Ce).optional()}).strict(),fontSize:B}).strict(),Fr=M.z.discriminatedUnion("type",[Rr,$r]),Ke=T.refine(t=>t>=N.minArtboard&&t<=N.maxArtboard,{message:`Artboard sides must be ${N.minArtboard} to ${N.maxArtboard} units`}),Ir=M.z.object({kind:M.z.literal(pr),version:M.z.literal(fr),artboard:M.z.object({width:Ke,height:Ke}).strict(),qr:M.z.object({x:T,y:T,size:B,padding:re.optional(),radius:re.optional()}).strict(),colors:M.z.object({frame:ne,text:ne.optional(),accent:ne.optional()}).strict(),shapes:M.z.array(Ar).max(N.maxShapes),labels:M.z.array(Fr).max(N.maxLabels),bleed:M.z.union([M.z.literal("none"),zt]).optional()}).strict();function wr(t){let e=oe(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 oe(t){return t.qr.padding??t.qr.size*N.defaultPadding}var vr=(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 _r(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(([r])=>r),n=t.points.map(([,r])=>r);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=te(t.d,N.maxDecimals);return e?{bounds:Ze(ee(t.d)),segments:He(e)}:{bounds:null,segments:0}}case"line":{let e=t.width/2,n=Math.hypot(t.x2-t.x1,t.y2-t.y1),r=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:r*(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:hr}}}function Tr(t,e){let n=(g,y=[])=>e.addIssue({code:"custom",message:g,path:y}),r=N,i=new TextEncoder().encode(JSON.stringify(t)).length;if(i>r.maxBytes){n(`The spec is ${i} bytes; the limit is ${r.maxBytes}`);return}let{width:u,height:l}=t.artboard,o=Math.max(u,l)*.005,a={x0:-o,y0:-o,x1:u+o,y1:l+o},s=g=>g.x0>=a.x0&&g.y0>=a.y0&&g.x1<=a.x1&&g.y1<=a.y1,{qr:c}=t,m=oe(t);m<c.size*r.minPadding-1e-9&&n(`qr.padding must be at least ${r.minPadding*100}% of qr.size`,["qr","padding"]),c.size<Math.min(u,l)*r.minQrShare-1e-9&&n(`qr.size must be at least ${r.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let p=wr(t);(p.x0<-1e-9||p.y0<-1e-9||p.x1>u+1e-9||p.y1>l+1e-9)&&n("The code and its padding must sit inside the artboard",["qr"]),(c.radius??0)>(c.size+2*m)/2&&n("qr.radius is larger than half the plate",["qr","radius"]);let f=0,d=0;t.shapes.forEach((g,y)=>{let S=["shapes",y],{bounds:E,segments:P}=_r(g);if(!E){n("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(E)||n("The shape extends outside the artboard",S),g.type==="rect"&&g.hole){let{hole:C}=g;(C.x<g.x||C.y<g.y||C.x+C.width>g.x+g.width+1e-9||C.y+C.height>g.y+g.height+1e-9)&&n("The hole must sit inside its rect",[...S,"hole"])}g.type==="circle"&&g.hole&&g.hole>=g.r&&n("The hole must be smaller than the circle",[...S,"hole"]),f+=P,typeof g.fill=="object"&&"gradient"in g.fill&&(d+=(g.fill.gradient.steps??32)*P)}),f>r.maxSegments&&n(`The shapes have ${f} segments; the limit is ${r.maxSegments}`,["shapes"]),d>r.maxGradientWork&&n("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let h=new Set,b=new Set;t.labels.forEach((g,y)=>{let S=["labels",y];h.has(g.id)&&n(`Label id "${g.id}" is used twice`,[...S,"id"]),h.add(g.id),g.slot!=="fixed"&&(b.has(g.slot)&&n(`Only one label may use the ${g.slot} slot`,[...S,"slot"]),b.add(g.slot));let E=g.maxLength??r.maxTextLength;g.text!==Me(g.text,E)&&n(`Label text must be at most ${E} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...S,"text"]);let P;if(g.type==="text")P={x0:g.box.x,y0:g.box.y,x1:g.box.x+g.box.width,y1:g.box.y+g.box.height},g.fontSize!==void 0&&g.fontSize>g.box.height*Ee+1e-9&&n("fontSize may be at most 95% of the label's row height",[...S,"fontSize"]),vr(P,p)&&n("The label overlaps the code or its padding",[...S,"box"]);else{let{cx:C,cy:L,radius:w}=g.curve,_=g.fontSize*bt*.6;P={x0:C-w-_,y0:L-w-_,x1:C+w+_,y1:L+w+_};let O=Math.hypot(Math.max(p.x0-C,0,C-p.x1),Math.max(p.y0-L,0,L-p.y1));Math.hypot(Math.max(Math.abs(p.x0-C),Math.abs(p.x1-C)),Math.max(Math.abs(p.y0-L),Math.abs(p.y1-L)))<=w-_||O>=w+_||n("The curved label crosses the code or its padding",[...S,"curve"])}s(P)||n("The label extends outside the artboard",S)})}var Pe=Ir.superRefine(Tr);var Nr=de.extend({style:M.z.literal(Se),spec:Pe}),en=M.z.discriminatedUnion("style",[de,Nr]);function G(t){if(t.length===0)return"";let[e,...n]=t;return`M${x(e[0])} ${x(e[1])}${n.map(([r,i])=>`L${x(r)} ${x(i)}`).join("")}Z`}function $(t,e,n){return`M${x(t-n)} ${x(e)}A${x(n)} ${x(n)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(n)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function R(t,e,n,r,i=0){let u=Math.min(n,r)/2,[l,o,a,s]=(typeof i=="number"?[i,i,i,i]:i).map(m=>Math.max(0,Math.min(m,u))),c=(m,p,f)=>m>0?`A${x(m)} ${x(m)} 0 0 1 ${x(p)} ${x(f)}`:"";return`M${x(t+l)} ${x(e)}H${x(t+n-o)}${c(o,t+n,e+o)}V${x(e+r-a)}${c(a,t+n-a,e+r)}H${x(t+s)}${c(s,t,e+r-s)}V${x(e+l)}${c(l,t+l,e)}Z`}function ie(t,e,n,r,i=5){return Array.from({length:i*2},(u,l)=>{let o=l%2===0?n:r,a=-Math.PI/2+Math.PI/i*l;return[t+o*Math.cos(a),e+o*Math.sin(a)]})}function nn(t,e,n){let r=n/2,i=(u,l)=>`${x(t+u*r)} ${x(e+l*r)}`;return`M${i(0,-.52)}C${i(.18,-.92)} ${i(.98,-.94)} ${i(1,-.34)}C${i(1,.12)} ${i(.5,.48)} ${i(0,.92)}C${i(-.5,.48)} ${i(-1,.12)} ${i(-1,-.34)}C${i(-.98,-.94)} ${i(-.18,-.92)} ${i(0,-.52)}Z`}function Le(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 rn=24,ut=(t,e,n,r)=>{let i=r*Math.PI/180;return[t+n*Math.cos(i),e+n*Math.sin(i)]},ae=([t,e])=>`${x(t)} ${x(e)}`;function Ft(t,e,n,r,i,u){let l=u-i>180?1:0;return`M${ae(ut(t,e,r,i))}A${x(r)} ${x(r)} 0 ${l} 1 ${ae(ut(t,e,r,u))}L${ae(ut(t,e,n,u))}A${x(n)} ${x(n)} 0 ${l} 0 ${ae(ut(t,e,n,i))}Z`}function Dt(t,e,n,r){return`M${x(t-n)} ${x(e)}A${x(n)} ${x(r)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(r)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function Or(t){let e=0;return t.forEach(([n,r],i)=>{let[u,l]=t[(i+1)%t.length];e+=n*l-u*r}),e/2}function on(t){return G(Or(t)<0?[...t].reverse():t)}function se(t,e,n,r,i){let u=Math.hypot(n-t,r-e)||1,l=-(r-e)/u*(i/2),o=(n-t)/u*(i/2);return on([[t+l,e+o],[n+l,r+o],[n-l,r-o],[t-l,e-o]])}var D=(...t)=>({d:t.join(""),fillRule:"nonzero"}),ot=(...t)=>({d:t.join(""),fillRule:"evenodd"});function qr(){let t=[];for(let e of[0,60,120]){let[n,r]=ut(12,12,10.5,e+180),[i,u]=ut(12,12,10.5,e);t.push(se(n,r,i,u,2))}for(let e=0;e<6;e++){let n=e*60,[r,i]=ut(12,12,6.2,n);for(let u of[-45,45]){let[l,o]=ut(r,i,3.6,n+u);t.push(se(r,i,l,o,1.7))}}return D(...t)}var zr={wifi:()=>D(Ft(12,20,4.6,7.2,-135,-45),Ft(12,20,9.2,11.8,-135,-45),Ft(12,20,13.8,16.4,-135,-45),$(12,20,2.2)),star:()=>D(G(ie(12,12.8,11.6,4.8))),heart:()=>D(nn(12,12.4,22)),phone:()=>ot(R(6,1.5,12,21,2.6),R(7.8,4.2,8.4,13.4,.6),$(12,19.8,1.1)),headphones:()=>D(Ft(12,13,7.6,9.8,-180,0),R(2,12,5,9.5,2),R(17,12,5,9.5,2)),calendar:()=>ot(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($(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:()=>ot(R(2,3,20,14,4),G([[6.5,17],[11.5,17],[5.8,21.8]]),$(7.5,10,1.5),$(12,10,1.5),$(16.5,10,1.5)),bag:()=>D(R(3.5,7.5,17,14.5,2),Ft(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",Ft(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:()=>ot(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:()=>ot($(12,12,10.5),G([[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:()=>ot($(12,12,10.5),$(12,7.2,1.6),R(10.6,10,2.8,8,.8)),home:()=>ot(G([[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:()=>ot("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",$(12,9.5,3)),share:()=>D(se(6,12,18,5,1.8),se(6,12,18,19,1.8),$(18,5,3.2),$(6,12,3.2),$(18,19,3.2)),download:()=>D(R(10.6,2,2.8,9.5,0),G([[6,10],[18,10],[12,16.5]]),G([[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:()=>ot($(12,12,10.5),$(12,12,8.4),G([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:qr,pumpkin:()=>D(Dt(7.8,14.6,5.8,6.9),Dt(16.2,14.6,5.8,6.9),Dt(12,14.6,4.8,7.4),R(10.9,3.4,2.2,4.6,.8),on([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>D(G([[12,1.5],[16.8,8.2],[7.2,8.2]]),G([[12,5.2],[19,13.6],[5,13.6]]),G([[12,9.4],[21.2,19.2],[2.8,19.2]]),R(10.4,18.6,3.2,3.9,.4)),sparkle:()=>D(G(ie(9.5,13.5,9,2.4,4)),G(ie(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),Dt(8.8,4.8,2.9,1.9),Dt(15.2,4.8,2.9,1.9))};function an(t){return zr[t]()}var Dr={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 sn(t,e){let n=t.trim(),r=Number.parseFloat(n);return Number.isNaN(r)?Number.NaN:n.endsWith("%")?r/100*e:r}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=Dr[e];if(n)return{r:n[0],g:n[1],b:n[2],a:1};if(e.startsWith("#")){let i=e.slice(1);return(i.length===3||i.length===4)&&(i=i.split("").map(u=>u+u).join("")),/^[0-9a-f]{6}([0-9a-f]{2})?$/.test(i)?{r:Number.parseInt(i.slice(0,2),16),g:Number.parseInt(i.slice(2,4),16),b:Number.parseInt(i.slice(4,6),16),a:i.length===8?Number.parseInt(i.slice(6,8),16)/255:1}:null}let r=/^rgba?\(([^)]*)\)$/.exec(e);if(r){let[i,u]=r[1].split("/"),l=i.split(/[\s,]+/).filter(Boolean);if(l.length!==(u===void 0&&l.length===4?4:3))return null;let o=u??l[3],[a,s,c]=l.slice(0,3).map(f=>sn(f,255)),m=o===void 0?1:sn(o,1);if([a,s,c,m].some(f=>Number.isNaN(f)))return null;let p=(f,d)=>Math.min(Math.max(f,0),d);return{r:p(a,255),g:p(s,255),b:p(c,255),a:p(m,1)}}return null}var kr=["banner-top-bottom","speech-bubble-top","chat-bubble","circle","polaroid","phone","ticket","badge","envelope","tag","menu-card","sticker","gradient-border","focus"];function un(t){return kr.includes(t)}var cn={from:"#7c3aed",to:"#db2777"},z="#FFFFFF";function mn(t){return t===" "?.3:/[MWmw@%]/.test(t)?.92:/[A-Z0-9#&]/.test(t)?.72:/[il.,:;!'|1]/.test(t)?.32:.6}function wt(t){let e=0;for(let n of t)e+=mn(n);return Math.max(e,1)}var Ae=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function V(t,e,n){let r=kt(t)??{r:0,g:0,b:0,a:1},i=kt(e)??{r:255,g:255,b:255,a:1},u=Math.min(1,Math.max(0,n));return`#${Ae(r.r+(i.r-r.r)*u)}${Ae(r.g+(i.g-r.g)*u)}${Ae(r.b+(i.b-r.b)*u)}`}var Q=(t,e,n,r,i=0)=>({x:t,y:e,width:n,height:r,radius:i}),I=(t,e,n,r,i,u)=>({type:"rect",...Q(t,e,n,r,i),fill:u}),It=(t,e,n)=>({type:"rect",...t,fill:n,hole:e}),k=(t,e)=>({type:"polygon",points:t,fill:e}),mt=(t,e,n="nonzero")=>({type:"path",d:t,fill:e,fillRule:n}),pn=(...t)=>t.filter(e=>e!==null),Br=t=>{let{size:e,gap:n,border:r,band:i,color:u,background:l,frame:o,fitLabel:a}=t,s=e+2*(r+n),c=s-2*r,m=e+2*n,p=i+m+i,f=c-2*n,d=o.textColor||z;return{width:s,height:p,qrX:r+n,qrY:i+n,qrSize:e,shapes:[I(r,i,c,m,0,l),It(Q(0,0,s,p),Q(r,i,c,m),u)],label:a(t.text,s/2,i/2,i,f,d),extraLabels:pn(a(t.secondaryText,s/2,i+m+i/2,i,f,d,"secondaryText")),squareEdges:!0,color:u}},Gr=t=>{let{size:e,gap:n,border:r,band:i,color:u,background:l,frame:o,fitLabel:a}=t,s=e+2*(r+n),c=s-2*r,m=e*.07,p=Math.max(m-r,0),f=e*.025,d=e*.08,h=i+d+f;return{width:s,height:h+s,qrX:r+n,qrY:h+r+n,qrSize:e,shapes:[I(0,0,s,i,i/2,u),k([[s/2-d,i-d/2],[s/2+d,i-d/2],[s/2,i+d]],u),I(r,h+r,c,c,p,l),It(Q(0,h,s,s,m),Q(r,h+r,c,c,p),u)],label:a(t.text,s/2,i/2,i,c-2*n,o.textColor||z),squareEdges:!1,color:u}},Ur=t=>{let{size:e,gap:n,border:r,color:i,background:u,frame:l,fitLabel:o}=t,a=e+2*(r+n),s=a-2*r,c=e*.12,m=e+2*n,p=t.text?e*.2:r,f=r+m+p,d=e*.13,h=f-e*.02;return{width:a,height:f+d,qrX:r+n,qrY:r+n,qrSize:e,shapes:[I(0,0,a,f,c,i),mt(q`M${a*.13} ${h}L${a*.05} ${f+d}`+q`Q${a*.16} ${f+d*.45} ${a*.32} ${h}Z`,i),I(r,r,s,m,Math.max(c-r,0),u)],label:o(t.text,a/2,r+m+p/2,p,s-2*n,l.textColor||z),squareEdges:!1,color:i}};function ce(t,e,n,r,i,u,l,o){let a=[...t],s=i*.08,c=a.map(h=>mn(h)*i),m=c.reduce((h,b)=>h+b,0)+s*Math.max(0,a.length-1),p=u==="top"?r-i*.35:r+i*.35,f=[],d=0;return a.forEach((h,b)=>{let g=c[b],y=(d+g/2)/p;if(d+=g+s,h.trim()==="")return;let S=u==="top"?-Math.PI/2-m/2/p+y:Math.PI/2+m/2/p-y;f.push({text:h,x:e+p*Math.cos(S),y:n+p*Math.sin(S),fontSize:i,maxWidth:i*2,color:l,rotate:S*180/Math.PI+(u==="top"?90:-90),field:o})}),f}var Yr=t=>{let{size:e,gap:n,color:r,background:i,frame:u,fontScale:l}=t,o=e*Math.SQRT1_2+n*.9,a=e*.21,s=o+a,c=o+a/2,m=s,p=u.textColor||z,f=c*(140*Math.PI/180),d=y=>Math.min(a*.5*l,f/(wt(y)+.08*y.length)),h=t.text?ce(t.text,m,m,c,d(t.text),"top",p,"text"):[],b=t.secondaryText?ce(t.secondaryText,m,m,c,d(t.secondaryText),"bottom",p,"secondaryText"):[],g=a*.07;return{width:2*s,height:2*s,qrX:m-e/2,qrY:m-e/2,qrSize:e,shapes:[mt($(m,m,o),i),mt($(m,m,s)+$(m,m,o),r,"evenodd"),mt($(m-c,m,g)+$(m+c,m,g),p)],label:null,extraLabels:[...h,...b],squareEdges:!1,color:r}},Hr=t=>{let{size:e,gap:n,color:r,background:i,frame:u,fitLabel:l}=t,o=e*.07,a=e+2*n,s=e*.3,c=e*.025,m=a+2*o,p=o+a+s,f=e*.015;return{width:m+c,height:p+c,qrX:o+n,qrY:o+n,qrSize:e,shapes:[I(c,c,m,p,f,V(r,z,.72)),I(0,0,m,p,f,r),I(o,o,a,a,0,i)],label:l(t.text,m/2,o+a+s/2,s*.8,a-2*n,u.textColor||z),squareEdges:!1,color:r}},Qr=t=>{let{size:e,gap:n,color:r,background:i,frame:u,fitLabel:l}=t,o=e*.05,a=e*.17,s=e*.15,c=t.text?e*.17:0,m=e+2*n,p=n+e+(t.text?n*.5+c:n),f=m+2*o,d=a+p+s,h=e*.036,b=e*.03;return{width:f,height:d,qrX:o+n,qrY:a+n,qrSize:e,shapes:[I(0,0,f,d,e*.17,r),I(o,a,m,p,e*.06,i),I(f/2-e*.11,a/2-h/2,e*.22,h,h/2,i),I(f/2-e*.15,a+p+s/2-b/2,e*.3,b,b/2,i)],label:l(t.text,f/2,a+n+e+n*.5+c/2,c,m-2*n,u.textColor||r),squareEdges:!1,color:r}},Xr=t=>{let{size:e,gap:n,band:r,color:i,background:u,frame:l,fitLabel:o}=t,a=e*.05,s=e+2*n,c=s+2*a,m=Kt(a+s+a*1.2),p=m+r,f=Kt(e*.055),d=e*.04,h=q`M${d} 0H${c-d}A${d} ${d} 0 0 1 ${c} ${d}`+q`V${m-f}A${f} ${f} 0 0 0 ${c} ${m+f}`+q`V${p-d}A${d} ${d} 0 0 1 ${c-d} ${p}`+q`H${d}A${d} ${d} 0 0 1 0 ${p-d}`+q`V${m+f}A${f} ${f} 0 0 0 0 ${m-f}`+q`V${d}A${d} ${d} 0 0 1 ${d} 0Z`,b=[],g=e*.03,y=e*.022,S=e*.012;for(let E=f+y;E+g<=c-f-y/2;E+=g+y)b.push(R(E,m-S/2,g,S));return{width:c,height:p,qrX:a+n,qrY:a+n,qrSize:e,shapes:[mt(h,i),I(a,a,s,s,e*.02,u),mt(b.join(""),u)],label:o(t.text,c/2,m+r/2,r,s-2*n,l.textColor||z),squareEdges:!1,color:i}},Vr=t=>{let{size:e,gap:n,border:r,band:i,color:u,background:l,frame:o,fitLabel:a}=t,s=e*.18,c=e*.05,m=e+2*(r+n),p=e*.06,f=Math.max(p-r,0),d=m+2*s,h=m-r,b=s*.5,g=h+c,y=b+c*2,S=s*.28,E=V(u,"#000000",.28),P=V(u,"#000000",.5);return{width:d,height:g+i,qrX:s+r+n,qrY:r+n,qrSize:e,shapes:[k([[0,g],[y,g],[y,g+i],[0,g+i],[S,g+i/2]],E),k([[d,g],[d-S,g+i/2],[d,g+i],[d-y,g+i],[d-y,g]],E),k([[b,h+i],[b+c*1.6,h+i+c],[b,h+i+c]],P),k([[d-b,h+i],[d-b,h+i+c],[d-b-c*1.6,h+i+c]],P),I(s+r,r,m-2*r,m-2*r,f,l),It(Q(s,0,m,m,p),Q(s+r,r,m-2*r,m-2*r,f),u),I(b,h,d-2*b,i,0,u)],label:a(t.text,d/2,h+i/2,i,d-2*b-2*n,o.textColor||z),squareEdges:!1,color:u}},jr=t=>{let{size:e,gap:n,band:r,color:i,background:u,frame:l,fitLabel:o}=t,a=e*.08,s=e+2*n,c=s+2*a,m=e*.05,p=m+n+e+n*.6,f=e*.14,d=p+f+r+e*.02,h=m+e*.32,b=e*.012,g=p+f-m;return{width:c,height:d,qrX:a+n,qrY:m+n,qrSize:e,shapes:[I(0,h,c,d-h,0,V(i,z,.45)),k([[0,h],[c/2,0],[c,h]],V(i,z,.25)),I(a,m,s,g,0,u),It(Q(a-b,m-b,s+2*b,g+b),Q(a,m,s,g),i),k([[0,p],[c/2,p+f],[c,p],[c,d],[0,d]],i)],label:o(t.text,c/2,p+f+r/2,r,s-2*n,l.textColor||z),squareEdges:!1,color:i}},Wr=t=>{let{size:e,gap:n,band:r,color:i,background:u,frame:l,fitLabel:o}=t,a=e*.06,s=e+2*n,c=s+2*a,m=e*.24,p=e*.04,f=m*.48,d=e*.14,h=t.text?r:a,b=m+s+h,g=e*.04,y=q`M${d} 0H${c-d}L${c} ${d}`+q`V${b-g}A${g} ${g} 0 0 1 ${c-g} ${b}`+q`H${g}A${g} ${g} 0 0 1 0 ${b-g}V${d}Z`+$(c/2,f,p);return{width:c,height:b,qrX:a+n,qrY:m+n,qrSize:e,shapes:[mt(y,i,"evenodd"),mt($(c/2,f,p*1.7)+$(c/2,f,p),V(i,z,.35),"evenodd"),I(a,m,s,s,e*.02,u)],label:o(t.text,c/2,m+s+h/2,h,s-2*n,l.textColor||z),squareEdges:!1,color:i}},Zr=t=>{let{size:e,color:n,background:r,frame:i,fitLabel:u}=t,l=e*.13,o=t.text?e*.26:l,a=t.secondaryText?e*.2:l,s=e+2*l,c=o+e+a,m=e*.03,p=e*.022,f=e*.045,d=e*.008,h=i.textColor||n,b=[I(0,0,s,c,m,r),It(Q(0,0,s,c,m),Q(p,p,s-2*p,c-2*p,Math.max(m-p,0)),n),It(Q(f,f,s-2*f,c-2*f),Q(f+d,f+d,s-2*(f+d),c-2*(f+d)),n)];if(t.text){let g=o-e*.075,y=e*.022;b.push(I(s*.3,g-d/2,s*.4,d,0,n),k([[s/2,g-y],[s/2+y,g],[s/2,g+y],[s/2-y,g]],n))}return{width:s,height:c,qrX:l,qrY:o,qrSize:e,shapes:b,label:u(t.text,s/2,e*.115,e*.17,s-2*l,h),extraLabels:pn(u(t.secondaryText,s/2,o+e+a*.45,a*.8,s-2*l,h,"secondaryText")),squareEdges:!1,color:n}},Jr=t=>{let{size:e,gap:n,color:r,background:i,frame:u,fitLabel:l}=t,o=e*.025,a=e*.07,s=e*.03,c=e*.13,m=t.text?e*.17:0,p=n*1.25,f=e+2*p,d=f+2*a,h=f+2*a+m,b=d+2*o,g=h+2*o;return{width:b+s,height:g+s,qrX:o+a+p,qrY:o+a+p,qrSize:e,shapes:[I(s,s,b,g,c+o,V(r,z,.7)),I(0,0,b,g,c+o,z),I(o,o,d,h,c,r),I(o+a,o+a,f,f,e*.04,i)],label:l(t.text,o+d/2,o+a+f+(a+m)/2,a+m,f-2*n,u.textColor||z),squareEdges:!1,color:r}};function ln(t,e,n,r){let i=t<e+r?e+r-t:t>e+n-r?t-(e+n-r):0;return r-Math.sqrt(Math.max(0,r*r-Math.min(i,r)**2))}function Kr(t,e,n,r,i,u,l=48){let o=Math.max(n-r,0),a=t-2*r,s=new Set([r,t-r]);for(let b=0;b<=l;b++)s.add(t*b/l);let c=[...s].sort((b,g)=>b-g),m=t*.002,p=5,f=b=>ln(b,0,t,n),d=b=>r+ln(b,r,a,o),h=[];for(let b=0;b+1<c.length;b++){let g=c[b],y=Math.min(t,c[b+1]+(b+2<c.length?m:0)),S=V(i,u,(g+y)/2/t),E=C=>Array.from({length:p},(L,w)=>{let _=w/(p-1);return C?y+(g-y)*_:g+(y-g)*_});g>=r-1e-9&&c[b+1]<=t-r+1e-9?h.push(k([...E(!1).map(C=>[C,f(C)]),...E(!0).map(C=>[C,d(C)])],S),k([...E(!1).map(C=>[C,e-d(C)]),...E(!0).map(C=>[C,e-f(C)])],S)):h.push(k([...E(!1).map(C=>[C,f(C)]),...E(!0).map(C=>[C,e-f(C)])],S))}return h}var to=t=>{let{size:e,gap:n,background:r,frame:i,fitLabel:u}=t,l=i.color||cn.from,o=i.secondaryColor||cn.to,a=e*.05,s=e+2*(a+n),c=t.text?e*.18:0,m=e+(t.text?n+c:2*n),p=m+2*a,f=e*.1;return{width:s,height:p,qrX:a+n,qrY:a+n,qrSize:e,shapes:[I(a,a,s-2*a,m,f-a,r),...Kr(s,p,f,a,l,o)],label:u(t.text,s/2,a+n+e+c/2,c,s-2*a-2*n,i.textColor||V(l,o,.5)),squareEdges:!1,color:l}},eo=t=>{let{size:e,gap:n,color:r,background:i,frame:u,fitLabel:l}=t,o=e*.035,a=e*.2,s=e+2*(n+o),c=t.text?e*.2:0,m=s,p=m+c,f=(d,h,b,g)=>[[d,h],[d+b*a,h],[d+b*a,h+g*o],[d+b*o,h+g*o],[d+b*o,h+g*a],[d,h+g*a]];return{width:s,height:p,qrX:o+n,qrY:o+n,qrSize:e,shapes:[I(0,0,s,p,0,i),k(f(0,0,1,1),r),k(f(m,0,-1,1),r),k(f(m,m,-1,-1),r),k(f(0,m,1,-1),r)],label:l(t.text,s/2,m+c*.4,c,s-2*n,u.textColor||r),squareEdges:!1,color:r}},fn={"banner-top-bottom":Br,"speech-bubble-top":Gr,"chat-bubble":Ur,circle:Yr,polaroid:Hr,phone:Qr,ticket:Xr,badge:Vr,envelope:jr,tag:Wr,"menu-card":Zr,sticker:Jr,"gradient-border":to,focus:eo};function xt(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 le=class extends Error{issues;constructor(e){super(`Invalid frame spec: ${e.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=e}},dn=new WeakMap;function no(t){if(t&&typeof t=="object"){let n=dn.get(t);if(n)return n}if(t==null)throw new le(['A "custom" frame needs a spec']);let e=Pe.safeParse(t);if(!e.success)throw new le(e.error.issues.map(n=>n.path.length>0?`${n.path.join(".")}: ${n.message}`:n.message));return typeof t=="object"&&dn.set(t,e.data),e.data}function ro(t){let e=xt(t,et),n=kt(e);return n&&n.a>=1?e:et}function oo(t,e,n){let r=t.color||e.colors.frame,i=t.textColor||e.colors.text||r,u=t.secondaryColor||e.colors.accent||r,l=o=>{switch(o){case"frame":return r;case"text":return i;case"accent":return u;case"background":return n;default:return o}};return o=>typeof o=="string"?l(o):V(l(o.mix[0]),l(o.mix[1]),o.amount)}function hn(t,e,n=0,r=0){let i=te(t);return i?Qe(i,e,n,r):""}function io(t,e,n,r){return`M${x(t-n)} ${x(e)}A${x(n)} ${x(r)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(r)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function ao(t,e){let[n,r,i,u]=[t.x1*e,t.y1*e,t.x2*e,t.y2*e],l=Math.hypot(i-n,u-r),o=t.width*e/2,a=l>0?(i-n)/l:1,s=l>0?(u-r)/l:0,c=-s*o,m=a*o,p=(b,g)=>{let y=[n+a*b,r+s*b],S=[n+a*g,r+s*g];if(t.cap==="round"&&g-b>2*o){let E=[y[0]+a*o,y[1]+s*o],P=[S[0]-a*o,S[1]-s*o];return`M${x(E[0]-c)} ${x(E[1]-m)}L${x(P[0]-c)} ${x(P[1]-m)}A${x(o)} ${x(o)} 0 0 1 ${x(P[0]+c)} ${x(P[1]+m)}L${x(E[0]+c)} ${x(E[1]+m)}A${x(o)} ${x(o)} 0 0 1 ${x(E[0]-c)} ${x(E[1]-m)}Z`}return`M${x(y[0]-c)} ${x(y[1]-m)}L${x(S[0]-c)} ${x(S[1]-m)}L${x(S[0]+c)} ${x(S[1]+m)}L${x(y[0]+c)} ${x(y[1]+m)}Z`};if(!t.dash)return{type:"path",d:p(0,l),fillRule:"nonzero"};let f=t.dash[0]*e,d=f+t.dash[1]*e,h=[];for(let b=0;b+f<=l+1e-6;b+=d)h.push(p(b,b+f));return{type:"path",d:h.join(""),fillRule:"nonzero"}}function so(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:$(t.cx*e,t.cy*e,t.r*e)+(t.hole?$(t.cx*e,t.cy*e,t.hole*e):""),fillRule:t.hole?"evenodd":"nonzero"};case"ellipse":return{type:"path",d:io(t.cx*e,t.cy*e,t.rx*e,t.ry*e),fillRule:"nonzero"};case"polygon":return{type:"polygon",points:t.points.map(([n,r])=>[n*e,r*e])};case"path":return{type:"path",d:hn(t.d,e),fillRule:t.fillRule??"nonzero"};case"line":return ao(t,e);default:{let n=an(t.icon);return{type:"path",d:hn(n.d,t.size*e/rn,t.x*e,t.y*e),fillRule:n.fillRule}}}}function co(t){if(t.type==="rect"){let{x:e,y:n,width:r,height:i,radius:u,hole:l}=t;return[...be(e,n,r,i,u,u),...l?be(l.x,l.y,l.width,l.height,l.radius,l.radius):[]]}return t.type==="polygon"?[...t.points.map(([e,n],r)=>r===0?{op:"M",x:e,y:n}:{op:"L",x:e,y:n}),{op:"Z"}]:ee(t.d)}function lo(t,e,n){let r=co(t),i=Ve(r,.2),u=t.type==="rect"?t.hole?"evenodd":"nonzero":t.type==="path"?t.fillRule??"nonzero":"nonzero",l=e.direction==="vertical",o=b=>l?b[1]:b[0],a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(let b of i)for(let g of b)a=Math.min(a,o(g)),s=Math.max(s,o(g));if(!(s>a))return[];let c=e.steps??32,m=n(e.from),p=n(e.to),f=s-a,d=f*.002,h=[];for(let b=0;b<c;b++){let g=a+f*b/c,y=Math.min(s,a+f*(b+1)/c+(b+1<c?d:0)),S=l?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:g,y1:y}:{x0:g,x1:y,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},E=i.map(P=>je(P,S)).filter(P=>P.length>2);E.length!==0&&h.push({type:"path",d:We(E),fill:V(m,p,(b+.5)/c),fillRule:u})}return h}function uo(t,e,n){let r=so(t,e);return typeof t.fill=="object"&&"gradient"in t.fill?lo(r,t.fill.gradient,n):[{...r,fill:n(t.fill)}]}function mo(t,e){let n=Math.min(t.maxLength??N.maxTextLength,N.maxTextLength),r=t.slot==="primary"?e.text??t.text:t.slot==="secondary"?e.secondaryText??t.text:t.text;return Me(r,n)}function po(t){return t===void 0||!Number.isFinite(t)?1:Math.min(bt,Math.max(qt,t))}function fo(t,e,n,r){let i=mo(t,e);if(!i)return[];let u=po(e.fontScale),l=r(t.color),o=t.weight==="regular"?{fontWeight:400}:{};if(t.type==="curved"){let{cx:h,cy:b,radius:g,side:y,spread:S=140}=t.curve,E=g*n*(S*Math.PI/180),P=Math.min(t.fontSize*n*u,E/(wt(i)+.08*i.length));return ce(i,h*n,b*n,g*n,P,y,l,t.id).map(C=>({...C,...o}))}let a=t.box.x*n,s=t.box.y*n,c=t.box.width*n,m=t.box.height*n,p=(t.fontSize??t.box.height*.52)*n,f=Math.min(p*u,m*Ee,c/wt(i)),d=t.align??"middle";return[{text:i,x:d==="start"?a:d==="end"?a+c:a+c/2,y:s+m/2+f*.35,fontSize:f,maxWidth:c,color:l,...d!=="middle"&&{align:d},...o,field:t.id}]}function gn(t,e,n){let r=no(e.spec),i=t/r.qr.size,u=ro(n),l=oo(e,r,u),o=r.shapes.flatMap(f=>uo(f,i,l)),a=oe(r)*i;o.push({type:"rect",x:r.qr.x*i-a,y:r.qr.y*i-a,width:t+2*a,height:t+2*a,radius:(r.qr.radius??0)*i,fill:u});let s=r.labels.flatMap(f=>fo(f,e,i,l)),c=s[0],m=c&&c.rotate===void 0?c:null,p=r.bleed??"none";return{width:r.artboard.width*i,height:r.artboard.height*i,qrX:r.qr.x*i,qrY:r.qr.y*i,qrSize:t,shapes:o,label:m,extraLabels:m?s.slice(1):s,squareEdges:p!=="none",color:l(p==="none"?"frame":p)}}var Sn=require("react/jsx-runtime"),go="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",bo=.08,yo="#000000",Re="#FFFFFF";function bn(t){return!!(t?.style&&t.style!=="none")}function xo(t){return(t.text??Ye).trim().slice(0,rt)}function So(t){return(t.secondaryText??"").trim().slice(0,rt)}function Eo(t){return t===void 0||!Number.isFinite(t)?1:Math.min(bt,Math.max(qt,t))}function Mo(t,e,n,r,i,u,l,o){if(!t)return null;let a=Math.min(r*.52*l,i/wt(t));return{text:t,x:e,y:n+a*.35,fontSize:a,maxWidth:i,color:u,field:o}}function yn(t,e,n){if(e.style===Se)return gn(t,e,n);let r=e.color||yo,i=xt(n,et),u=xo(e),l=t*bo,o=t*.04,a=t*.22,s=t+2*(o+l),c=s-2*o,m=c-2*l,p=o+l,f=Eo(e.fontScale),d=(h,b,g,y,S,E,P="text")=>Mo(h,b,g,y,S,E,f,P);if(un(e.style))return fn[e.style]({size:t,frame:e,color:r,background:i,text:u,secondaryText:So(e),gap:l,border:o,band:a,fontScale:f,fitLabel:d});switch(e.style){case"banner-top":{let h=t+2*l;return{width:s,height:a+h+o,qrX:p,qrY:a+l,qrSize:t,shapes:[Bt(o,a,c,h,0,i),ue(it(0,0,s,a+h+o,0),it(o,a,c,h,0),r)],label:d(u,s/2,a/2,a,m,e.textColor||Re),squareEdges:!0,color:r}}case"border":case"rounded-border":{let h=u?t*.18:0,b=t+(u?l+h:2*l),g=b+2*o,y=e.style==="rounded-border"?t*.1:0,S=Math.max(y-o,0);return{width:s,height:g,qrX:p,qrY:o+l,qrSize:t,shapes:[Bt(o,o,c,b,S,i),ue(it(0,0,s,g,y),it(o,o,c,b,S),r)],label:d(u,s/2,o+l+t+h/2,h,m,e.textColor||r),squareEdges:y===0,color:r}}case"speech-bubble":{let h=t*.07,b=Math.max(h-o,0),g=t*.025,y=t*.08,S=s+g+y;return{width:s,height:S+a,qrX:p,qrY:o+l,qrSize:t,shapes:[Bt(o,o,c,c,b,i),ue(it(0,0,s,s,h),it(o,o,c,c,b),r),{type:"polygon",points:[[s/2-y,S+y/2],[s/2,s+g],[s/2+y,S+y/2]],fill:r},Bt(0,S,s,a,a/2,r)],label:d(u,s/2,S+a/2,a,m,e.textColor||Re),squareEdges:!1,color:r}}default:{let h=t+2*l;return{width:s,height:o+h+a,qrX:p,qrY:o+l,qrSize:t,shapes:[Bt(o,o,c,h,0,i),ue(it(0,0,s,o+h+a,0),it(o,o,c,h,0),r)],label:d(u,s/2,o+h+a/2,a,m,e.textColor||Re),squareEdges:!0,color:r}}}}function it(t,e,n,r,i){return{x:t,y:e,width:n,height:r,radius:i}}function Bt(t,e,n,r,i,u){return{type:"rect",...it(t,e,n,r,i),fill:u}}function ue(t,e,n){return{type:"rect",...t,fill:n,hole:e}}function Co(t){return[...t.label?[t.label]:[],...t.extraLabels??[]]}function xn(t,e){let n=({x:r,y:i,width:u,height:l,radius:o})=>{let a=Math.min(o,u/2,l/2);t.moveTo(r+a,i),t.arcTo(r+u,i,r+u,i+l,a),t.arcTo(r+u,i+l,r,i+l,a),t.arcTo(r,i+l,r,i,a),t.arcTo(r,i,r+u,i,a),t.closePath()};for(let r of e.shapes)if(!(r.fill==="transparent"||r.fill==="none")){if(t.fillStyle=r.fill,r.type==="path"){typeof Path2D<"u"&&t.fill(new Path2D(r.d),r.fillRule??"nonzero");continue}t.beginPath(),r.type==="polygon"?(r.points.forEach(([i,u],l)=>{l===0?t.moveTo(i,u):t.lineTo(i,u)}),t.closePath(),t.fill()):(n(r),r.hole&&n(r.hole),t.fill("evenodd"))}for(let r of Co(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 Mn=require("react/jsx-runtime"),Po=.22,Lo=.14;function Ao(t,e){let n=t.w*e,r=t.h*e;return{x:t.x+n,y:t.y+r,w:t.w-2*n,h:t.h-2*r}}function $e(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 r=e==="rounded"?Math.min(n.w,n.h)*Po:0;r>0&&typeof t.roundRect=="function"?t.roundRect(n.x,n.y,n.w,n.h,r):t.rect(n.x,n.y,n.w,n.h)}function En(t,e){return e?Ao(t,Lo):t}var{QrCode:Fe}=H,Ro={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function $o(t){let e=t*4+17,n=new Uint8Array(e*e),r=(l,o)=>{l>=0&&o>=0&&l<e&&o<e&&(n[o*e+l]=1)};for(let l=0;l<e;l++)r(6,l),r(l,6);for(let[l,o]of[[3,3],[e-4,3],[3,e-4]])for(let a=-4;a<=4;a++)for(let s=-4;s<=4;s++)r(l+s,o+a);let i=[];if(t>1){let l=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(l*2-2))*2;i.push(6);for(let a=e-7;i.length<l;a-=o)i.splice(1,0,a)}let u=i.length-1;for(let[l,o]of i.entries())for(let[a,s]of i.entries())if(!(l===0&&a===0||l===0&&a===u||l===u&&a===0))for(let c=-2;c<=2;c++)for(let m=-2;m<=2;m++)r(o+m,s+c);for(let l=0;l<=8;l++)r(8,l),r(l,8);for(let l=0;l<8;l++)r(e-1-l,8),r(8,e-1-l);if(t>=7)for(let l=0;l<18;l++){let o=e-11+l%3,a=Math.floor(l/3);r(o,a),r(a,o)}return n}function Fo(t,e){let n=t*4+17,r=lt[e].ordinal,i=Fe.NUM_ERROR_CORRECTION_BLOCKS[r]?.[t]??0,u=Fe.ECC_CODEWORDS_PER_BLOCK[r]?.[t]??0,l=Math.floor(Fe.getNumRawDataModules(t)/8),o=i-l%i,a=Math.floor(l/i),s=Array.from({length:i},(E,P)=>a+(P<o?0:1)),c=[],m=[],p=a-u;for(let E=0;E<=a;E++)for(let P=0;P<i;P++)if(P<o){if(E===p)continue;c.push(P),m.push(E<p?E:E-1)}else c.push(P),m.push(E);if(c.length!==l)throw new Error(`Codeword map: interleave mismatch at version ${t}`);let f=$o(t),d=new Int16Array(n*n).fill(-1),h=new Int16Array(n*n).fill(-1),b=new Int8Array(n*n).fill(-1),g=l*8,y=0;for(let E=n-1;E>=1;E-=2){E===6&&(E=5);let P=(E+1&2)===0;for(let C=0;C<n;C++)for(let L=0;L<2;L++){let w=E-L,O=(P?n-1-C:C)*n+w;if(!f[O]&&y<g){let tt=y>>>3;d[O]=c[tt],h[O]=m[tt],b[O]=7-(y&7),y++}}}if(y!==g)throw new Error(`Codeword map: placement mismatch at version ${t}`);let S=Ro[`${t}${e}`]??0;return{version:t,level:e,size:n,blocks:i,eccPerBlock:u,blockLengths:s,correctable:Math.floor((u-S)/2),block:d,codeword:h,bit:b}}var Io=8,St=new Map;function Cn(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}`,r=St.get(n);if(r)return St.delete(n),St.set(n,r),r;let i=Fo(t,e);if(St.size>=Io){let u=St.keys().next().value;u!==void 0&&St.delete(u)}return St.set(n,i),i}function Pn(t,e){let n=new Array(t.blocks).fill(0),r=new Set;for(let i of e){let u=t.block[i]??-1;if(u<0)continue;let l=u*4096+t.codeword[i];r.has(l)||(r.add(l),n[u]=n[u]+1)}return n}var A=require("zod");var K=require("zod"),wo=["logo","halftone"],vo=K.z.enum(wo),Ln={logo:["blend","badge"],halftone:["color","mono"]},_o=K.z.enum([...Ln.logo,...Ln.halftone]),me=192,An=t=>Math.ceil(t/3)*4,To=K.z.object({width:K.z.number().int().min(1).max(me),height:K.z.number().int().min(1).max(me),data:K.z.string().max(An(me*me*4))}).refine(t=>t.data.length===An(t.width*t.height*4),{message:"Art image data does not match its width and height"}),Rn=K.z.object({mode:vo,image:To,intensity:K.z.number().min(0).max(1).optional(),variant:_o.optional(),matchEyes:K.z.boolean().optional()});var F=require("zod"),Ra=F.z.enum(["solid","linear","radial","angular","image"]),No=F.z.object({type:F.z.literal("solid"),color:F.z.string()}),Ie=F.z.object({color:F.z.string(),offset:F.z.number().min(0).max(100)}),Oo=F.z.object({type:F.z.literal("linear"),stops:F.z.array(Ie).min(2),angle:F.z.number().optional().default(0)}),qo=F.z.object({type:F.z.literal("radial"),stops:F.z.array(Ie).min(2)}),zo=F.z.object({type:F.z.literal("angular"),stops:F.z.array(Ie).min(2),angle:F.z.number().optional().default(0)}),Do=F.z.enum(["cover","contain","tile"]),ko=F.z.enum(["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]),Bo=F.z.object({type:F.z.literal("image"),src:F.z.string().min(1),fit:Do.optional().default("cover"),scale:F.z.number().min(.1).max(4).optional().default(1),position:ko.optional().default("center"),opacity:F.z.number().min(0).max(1).optional().default(1),underlay:F.z.string().optional()}),Et=F.z.union([F.z.string(),No,Oo,qo,zo,Bo]);var we=require("zod"),$n=["square","rounded","circle","message","message-reverse","diya","diya-reverse","rounded-triangle","leaf","drop","plus","cross-rounded","hexagon","octagon","flower","heart","squircle","dots","extra-rounded","leaf-reverse","drop-reverse"],Go=["diamond","star","banner"],Fn=we.z.enum([...$n,...Go]),Fa=we.z.enum($n);var ve=require("zod"),In=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse"],Uo=["curly"],wn=ve.z.enum([...In,...Uo]),wa=ve.z.enum(In);var vn=require("zod"),Yo=["circle","circle-large","square","diamond","circle-mixed","pacman","rounded","small-square","vertical-line","horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"],_n=vn.z.enum(Yo);var Ho=["square","rounded","circle"],Tn=A.z.enum(Ho),Qo=A.z.object({src:A.z.string(),height:A.z.number(),width:A.z.number(),excavate:A.z.boolean(),x:A.z.number().optional(),y:A.z.number().optional(),padding:A.z.number().min(0).optional(),shape:Tn.optional(),plate:A.z.string().optional()}),Xo=.1,Vo=.3;var jo=2,ka=A.z.object({size:A.z.number().min(Xo).max(Vo).optional(),padding:A.z.number().min(0).max(jo).optional(),x:A.z.number().min(0).max(1).optional(),y:A.z.number().min(0).max(1).optional(),shape:Tn.optional(),plate:A.z.string().optional()}),Wo=A.z.enum(["L","M","Q","H"]),Zo=.5,Jo=1,Nn=.07,Ko=["square","circle","heart"],ti=A.z.enum(Ko),On=3,Mt=64,Gt=8,qn=.42,ei=A.z.object({type:A.z.literal("silhouette"),width:A.z.number().int().min(Gt).max(Mt),height:A.z.number().int().min(Gt).max(Mt),cells:A.z.string().max(Mt*Mt).regex(/^[01]*$/).describe('Row by row, "1" inside the shape and "0" outside: width \xD7 height characters')}).refine(t=>t.cells.length===t.width*t.height,{message:"Silhouette cells do not match its width and height"}),ni=A.z.union([ti,ei]);var _e=A.z.object({outer:Et.optional(),inner:Et.optional()}),ri=A.z.object({topLeft:_e.optional(),topRight:_e.optional(),bottomLeft:_e.optional()}),Ba=A.z.object({value:A.z.string(),size:A.z.number().optional(),level:Wo.optional(),bgColor:Et.optional(),fgColor:Et.optional(),eyeColor:Et.optional(),dotColor:Et.optional(),bodyPattern:_n.optional(),cornerEyePattern:wn.optional(),cornerEyeDotPattern:Fn.optional(),margin:A.z.number().optional(),imageSettings:Qo.optional(),isOGContext:A.z.boolean().optional(),templateId:A.z.string().optional(),customProps:A.z.record(A.z.string(),A.z.any()).optional(),frame:en.optional(),art:Rn.optional(),eyeColors:ri.optional(),moduleScale:A.z.number().min(Zo).max(Jo).optional(),autoLevel:A.z.boolean().optional(),shape:ni.optional()});var oi={2:6,3:12};function zn(t){let e=[t.start],n=t.start;for(let r of t.segments){let i=r.at(-1);if(r.length===1)e.push(i);else{let u=oi[r.length];for(let l=1;l<=u;l++){let o=l/u,a=1-o;if(r.length===2){let[s]=r;e.push([a*a*n[0]+2*a*o*s[0]+o*o*i[0],a*a*n[1]+2*a*o*s[1]+o*o*i[1]])}else{let[s,c]=r;e.push([a*a*a*n[0]+3*a*a*o*s[0]+3*a*o*o*c[0]+o*o*o*i[0],a*a*a*n[1]+3*a*a*o*s[1]+3*a*o*o*c[1]+o*o*o*i[1]])}}}n=i}return e}function kn(t,e){let n=[];for(let r of t)for(let i=0;i<r.length;i++){let[u,l]=r[i],[o,a]=r[(i+1)%r.length];l<=e!=a<=e&&n.push(u+(e-l)/(a-l)*(o-u))}return n.sort((r,i)=>r-i)}function Bn(t,e){let n=0;for(let r of t)if(r<e)n++;else break;return n%2===1}function ii(t,e,n){return Bn(kn(t,n),e)}function Gn(t){let e=new Map;return(n,r)=>{let i=e.get(r);return i||(i=kn(t,r),e.set(r,i)),Bn(i,n)}}function ai(t,e,n,r){let i=n[0]-t,u=n[1]-e,l=r[0]-n[0],o=r[1]-n[1],a=c=>Math.max(Math.abs(i+c*l),Math.abs(u+c*o)),s=Math.min(a(0),a(1));for(let[c,m]of[[u-i,l-o],[-(i+u),l+o]])if(m!==0){let p=c/m;p>0&&p<1&&(s=Math.min(s,a(p)))}return s}function si(t,e,n){if(!ii(t,e,n))return 0;let r=Number.POSITIVE_INFINITY;for(let i of t)for(let u=0;u<i.length;u++)r=Math.min(r,ai(e,n,i[u],i[(u+1)%i.length]));return Number.isFinite(r)?r:0}function ci(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(let u of t)for(let[l,o]of u)e=Math.min(e,l),n=Math.min(n,o),r=Math.max(r,l),i=Math.max(i,o);return{x0:e,y0:n,x1:r,y1:i}}function Un(t){let e=t.map(zn),n=ci(e),r=n.x1-n.x0,i=n.y1-n.y0;if(!(r>0&&i>0))return null;let u=(d,h)=>{let b=Math.max(d-n.x0,n.x1-d,h-n.y0,n.y1-h);return b>0?si(e,d,h)/(2*b):0},l={cx:n.x0+r/2,cy:n.y0+i/2,value:0};l.value=u(l.cx,l.cy);let o=32;for(let d=1;d<o;d++)for(let h=1;h<o;h++){let b=n.x0+r*h/o,g=n.y0+i*d/o,y=u(b,g);y>l.value&&(l={cx:b,cy:g,value:y})}let a=r/o,s=i/o;for(let d=0;d<6;d++){let h=l;for(let b=-2;b<=2;b++)for(let g=-2;g<=2;g++){let y=h.cx+a*g/2,S=h.cy+s*b/2,E=u(y,S);E>l.value&&(l={cx:y,cy:S,value:E})}a/=2,s/=2}if(l.value<=0)return null;let m=.5/Math.max(l.cx-n.x0,n.x1-l.cx,l.cy-n.y0,n.y1-l.cy),p=([d,h])=>[.5+(d-l.cx)*m,.5+(h-l.cy)*m],f=t.map(d=>({start:p(d.start),segments:d.segments.map(h=>h.map(p))}));return{rings:f,polygons:f.map(zn),half:l.value}}function Yn(t,e){let n=([i,u])=>`${x(i*e)} ${x(u*e)}`,r="";for(let i of t.rings){r+=`M${n(i.start)}`;for(let u of i.segments){let l=u.length===1?"L":u.length===2?"Q":"C";r+=l+u.map(n).join(" ")}r+="Z"}return r}var li={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]]]},Dn;function Hn(){return Dn??=Un([li]),Dn}function ui(t){let{width:e,height:n,cells:r}=t;return Number.isInteger(e)&&Number.isInteger(n)&&e>=Gt&&n>=Gt&&e<=Mt&&n<=Mt&&typeof r=="string"&&r.length===e*n&&/^[01]*$/.test(r)?(i,u)=>i>=0&&u>=0&&i<e&&u<n&&r[u*e+i]==="1":null}var at=([t,e])=>`${t},${e}`;function mi(t,e,n){let r=(a,s)=>t(a-1,s-1),i=new Map,u=(a,s)=>{for(let[c,m]of[[a,s],[s,a]]){let p=i.get(at(c))??[];p.push(m),i.set(at(c),p)}};for(let a=0;a<=n;a++)for(let s=0;s<=e;s++){let c=r(s,a),m=r(s+1,a),p=r(s+1,a+1),f=r(s,a+1),d=[s,a-.5],h=[s+.5,a],b=[s,a+.5],g=[s-.5,a];switch((c?8:0)+(m?4:0)+(p?2:0)+(f?1:0)){case 1:case 14:u(g,b);break;case 2:case 13:u(b,h);break;case 3:case 12:u(g,h);break;case 4:case 11:u(d,h);break;case 6:case 9:u(d,b);break;case 7:case 8:u(g,d);break;case 5:u(d,h),u(g,b);break;case 10:u(g,d),u(b,h);break;default:break}}let l=[],o=new Set;for(let[a,s]of i){if(o.has(a)||s.length===0)continue;let[c,m]=a.split(",").map(Number),p=[[c,m]];o.add(a);let f=[c,m],d=s[0];for(;!o.has(at(d));){o.add(at(d)),p.push(d);let h=pi(i.get(at(d))??[],f,o);if(!h)break;f=d,d=h}p.length>=3&&l.push(fi(p))}return l}function pi(t,e,n){let r=at(e);return t.find(i=>at(i)!==r&&!n.has(at(i)))??t.find(i=>at(i)!==r)}function fi(t){let e=[];for(let n=0;n<t.length;n++){let r=t[(n-1+t.length)%t.length],i=t[n],u=t[(n+1)%t.length],l=(i[0]-r[0])*(u[1]-i[1])-(i[1]-r[1])*(u[0]-i[0]);Math.abs(l)>1e-9&&e.push(i)}return e.length>=3?e:t}function di(t){let e=(u,l)=>[(u[0]+l[0])/2,(u[1]+l[1])/2],n=t.length,r=e(t[n-1],t[0]),i=t.map((u,l)=>[u,e(u,t[(l+1)%n])]);return{start:r,segments:i}}var Ut=new Map;function Qn(t){let e=`${t.width}x${t.height}:${t.cells}`,n=Ut.get(e);if(n)return n;let r=ui(t),i;if(!r)i={outline:null,problem:"invalid"};else if(t.cells.includes("1")){let u=mi(r,t.width,t.height),l=u.length>0?Un(u.map(di)):null;i=l&&2*l.half>=qn?{outline:l,problem:null}:{outline:null,problem:l?"thin":"empty"}}else i={outline:null,problem:"empty"};return Ut.size>16&&Ut.delete(Ut.keys().next().value),Ut.set(e,i),i}var hi=1,Xn=.5,Vn=.5,gi=.5;function pe(t){return Math.max(t,On)}function Te(t){return t==="heart"?Hn():typeof t=="object"&&t?.type==="silhouette"?Qn(t).outline:null}function pt(t,e,n){if(n==="circle"){let l=pe(e),o=(t/2+l)*Math.SQRT2+hi;return Math.ceil(o-t/2)}let r=Te(n);if(!r)return e;let i=pe(e),u=(t+2*(i+gi))/(2*r.half);return Math.ceil((u-t)/2-1e-9)}function jn(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 bi(t,e,n){let r=pt(e,n,"circle"),i=pe(n),u=e+2*r,l=u/2,o=l-Xn-.5,a=jn(Number.parseInt(Le(t),36)||1),s=r-i,c=r+e+i;return Array.from({length:u},(m,p)=>Array.from({length:u},(f,d)=>{let h=a()<Vn;return d>=s&&d<c&&p>=s&&p<c?!1:h&&Math.hypot(d+.5-l,p+.5-l)<=o}))}var yi=Array.from({length:8},(t,e)=>{let n=e*Math.PI/4;return[Math.cos(n),Math.sin(n)]});function Ne(t,e,n,r){if(r==="circle")return bi(t,e,n);let i=Te(r);if(!i)return null;let u=pt(e,n,r),l=pe(n),o=e+2*u,a=Gn(i.polygons),s=.5+Xn,c=(d,h)=>{let b=d+.5,g=h+.5;return a(b/o,g/o)?yi.every(([y,S])=>a((b+y*s)/o,(g+S*s)/o)):!1},m=jn(Number.parseInt(Le(t),36)||1),p=u-l,f=u+e+l;return Array.from({length:o},(d,h)=>Array.from({length:o},(b,g)=>{let y=m()<Vn;return g>=p&&g<f&&h>=p&&h<f?!1:y&&c(g,h)}))}function Oe(t,e){if(t==="circle")return{circle:e/2};let n=Te(t);return n?{path:Yn(n,e)}:null}var xi=Ue(require("react"));var De=require("react/jsx-runtime");function Wn(t,e){return t.slice().map((n,r)=>r<e.y||r>=e.y+e.h?n:n.map((i,u)=>u<e.x||u>=e.x+e.w?i:!1))}function qe(t,e=0){let n=[];return t.forEach((r,i)=>{let u=null;r.forEach((l,o)=>{if(!l&&u!==null){n.push(q`M${u+e} ${i+e}h${o-u}v1H${u+e}z`),u=null;return}if(o===r.length-1){if(!l)return;u===null?n.push(q`M${o+e},${i+e} h1v1H${o+e}z`):n.push(q`M${u+e},${i+e} h${o+1-u}v1H${u+e}z`);return}l&&u===null&&(u=o)})}),n.join("")}function Yt(t,e,n,r){if(r==null)return null;let i=t.length,u=Math.floor(e*Jt),l=(i+2*n)/e,o=(r.width||u)*l,a=(r.height||u)*l,s=r.x==null?i/2-o/2:r.x*l,c=r.y==null?i/2-a/2:r.y*l,m=null;if(r.excavate){let p=Math.max(0,r.padding??0)*l,f=Math.floor(s-p),d=Math.floor(c-p),h=Math.ceil(o+s+p-f),b=Math.ceil(a+c+p-d);m={x:f,y:d,w:h,h:b}}return{x:s,y:c,h:a,w:o,excavation:m}}function fe(t){let e=t.level??$t,{imageSettings:n}=t,r=t.isOGContext&&n?.excavate&&(e==="L"||e==="M")?"Q":e;if(t.autoLevel&&n&&r!=="H"){let i=H.QrCode.encodeText(t.value,lt[r]).getModules(),u=Yt(i,t.size??jt,pt(i.length,t.margin??Zt,t.shape),n);u&&(u.excavation?u.excavation.w*u.excavation.h:u.w*u.h)/(i.length*i.length)>Nn&&(r="H")}return r}var ze=(()=>{try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})();var Si=.6,Ei=["L","M","Q","H"];function Mi(t){let e=H.QrCode.encodeText(t.value,lt[t.level]),n=Ei[e.errorCorrectionLevel.ordinal]??t.level;return{code:t,cells:e.getModules(),layoutMargin:pt(e.size,t.margin,t.shape),map:Cn(e.version,n),level:n,version:e.version}}function Ci(t,e){let{cells:n,map:r}=t,i=n.length,u=Yt(n,t.code.size,t.layoutMargin,e);if(!u)return null;let l=u.excavation??{x:Math.floor(u.x),y:Math.floor(u.y),w:Math.ceil(u.x+u.w)-Math.floor(u.x),h:Math.ceil(u.y+u.h)-Math.floor(u.y)},o=[];for(let s=Math.max(0,l.y);s<Math.min(i,l.y+l.h);s++)for(let c=Math.max(0,l.x);c<Math.min(i,l.x+l.w);c++)o.push(s*i+c);let a=Pn(r,o);return{worst:Math.max(0,...a),correctable:r.correctable,budget:Math.floor(r.correctable*Si),level:t.level,version:t.version}}var Pi=t=>!t||t.worst<=t.budget;function Li(t,e,n,r){let i=e.map(o=>Mi({...t,level:o})),u=o=>{let a=r(o);return i.every(s=>Pi(Ci(s,a)))};if(u(n))return n;let l=t.size*.005;for(let o=n-l;o>0;o-=l)if(u(o))return o;return 0}function Zn(t,e){if(!e)return;let n=Math.floor(t.size*Jt),r=e.width||n,i=e.height||n,u=p=>{if(p===r)return e;let f=i*p/r;return{...e,width:p,height:f,...e.x!=null&&{x:e.x+(r-p)/2},...e.y!=null&&{y:e.y+(i-f)/2}}},l=t.level??$t,o={value:t.value,size:t.size,margin:t.margin,shape:t.shape},a=p=>fe({...t,level:l,imageSettings:p}),s=p=>{let f=Li(o,[p],r,u);return f>0?u(f):void 0},c=a(e);if(c===l)return s(l);let m=s(c);return m&&a(m)===c?m:s(l)}var Pt=require("react/jsx-runtime");function Ai(t){let{value:e,size:n=jt,level:r=$t,bgColor:i=et,fgColor:u=Wt,margin:l=Zt,style:o,imageSettings:a,eyeColor:s,dotColor:c,bodyPattern:m,cornerEyePattern:p,cornerEyeDotPattern:f,isOGContext:d,templateId:h,customTemplate:b,customProps:g,frame:y,art:S,eyeColors:E,moduleScale:P,frameLabelMarkers:C,autoLevel:L,shape:w,..._}=t,O=Zn({value:e,size:n,margin:l,level:r,shape:w,autoLevel:L},a),tt=fe({value:e,size:n,level:r,margin:l,imageSettings:O,autoLevel:L,shape:w}),X=O?.src,U=bn(y)?yn(n,y,i):null,Z=U?.width??n,st=U?.height??n,ft=(0,Ct.useRef)(null),vt=(0,Ct.useRef)(null),[j,Y]=(0,Ct.useState)(!1);(0,Ct.useEffect)(()=>{if(ft.current!=null){let _t=ft.current,v=_t.getContext("2d");if(!v)return;let J=H.QrCode.encodeText(e,lt[tt]).getModules(),ct=pt(J.length,l,w),Tt=Ne(e,J.length,l,w),Lt=J.length+ct*2,ht=Yt(J,n,ct,O),Ht=vt.current,ke=ht!=null&&Ht?.complete&&Ht.naturalHeight!==0&&Ht.naturalWidth!==0;ke&&ht.excavation!=null&&(J=Wn(J,ht.excavation));let Qt=window.devicePixelRatio||1;_t.width=Z*Qt,_t.height=st*Qt,v.scale(Qt,Qt),U&&(xn(v,U),v.translate(U.qrX,U.qrY));let Be=n/Lt;v.scale(Be,Be),v.fillStyle=xt(i,et);let Nt=Oe(w,Lt);if(Nt&&"circle"in Nt?(v.beginPath(),v.arc(Lt/2,Lt/2,Nt.circle,0,2*Math.PI),v.fill()):Nt&&ze?v.fill(new Path2D(Nt.path),"evenodd"):v.fillRect(0,0,Lt,Lt),v.fillStyle=xt(u,Wt),ze)v.fill(new Path2D(qe(J,ct))),Tt&&v.fill(new Path2D(qe(Tt,0)));else for(let[Xt,At]of[[J,ct],[Tt??[],0]])Xt.forEach((Ot,gt)=>{Ot.forEach((Jn,Kn)=>{Jn&&v.fillRect(Kn+At,gt+At,1,1)})});if(ke){let Xt={x:ht.x+ct,y:ht.y+ct,w:ht.w,h:ht.h},At=O?.shape??"square",Ot=O?.plate,gt=En(Xt,Ot);v.save(),Ot&&($e(v,At,Xt),v.fillStyle=Ot,v.fill()),At!=="square"&&($e(v,At,gt),v.clip()),v.drawImage(Ht,gt.x,gt.y,gt.w,gt.h),v.restore()}}});let W={height:st,width:Z,...o},dt=null;return X!=null&&(dt=(0,Pt.jsx)("img",{alt:"QR code",onLoad:()=>{Y(!0)},ref:vt,src:X,style:{display:"none"}},X)),(0,Pt.jsxs)(Pt.Fragment,{children:[(0,Pt.jsx)("canvas",{height:st,ref:ft,style:W,width:Z,..._}),dt]})}0&&(module.exports={QRCodeCanvas});
|
|
2
2
|
/**
|
|
3
3
|
* @license QR Code generator library (TypeScript)
|
|
4
4
|
* Copyright (c) Project Nayuki.
|