monobill-mintui 0.6.618 → 0.6.620
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/alert/browser.js +3 -3
- package/dist/components/alert/index.cjs +1 -1
- package/dist/components/alert/index.js +3 -3
- package/dist/components/back-button/browser.js +2 -2
- package/dist/components/back-button/index.cjs +1 -1
- package/dist/components/back-button/index.js +2 -2
- package/dist/components/bottom-navigation/browser.js +2 -2
- package/dist/components/bottom-navigation/index.cjs +1 -1
- package/dist/components/bottom-navigation/index.js +2 -2
- package/dist/components/button/browser.js +1 -1
- package/dist/components/button/index.cjs +1 -1
- package/dist/components/button/index.js +1 -1
- package/dist/components/chart/browser.js +110 -99
- package/dist/components/chart/index.cjs +3 -3
- package/dist/components/chart/index.js +110 -99
- package/dist/components/checkbox/browser.js +2 -2
- package/dist/components/checkbox/index.cjs +1 -1
- package/dist/components/checkbox/index.js +2 -2
- package/dist/components/chip/browser.js +1 -1
- package/dist/components/chip/index.cjs +1 -1
- package/dist/components/chip/index.js +1 -1
- package/dist/components/chunks/{button-BZ25puI2.js → button-BYQbRAwl.js} +2 -2
- package/dist/components/chunks/{button-CgYC1lB7.js → button-DbxqmBWQ.js} +1 -1
- package/dist/components/chunks/caret-down-CeADWana.js +1 -0
- package/dist/components/chunks/{caret-down-CDGP3GB2.js → caret-down-DD9Ie5js.js} +1 -1
- package/dist/components/chunks/caret-right-3V_JDnOP.js +1 -0
- package/dist/components/chunks/{caret-right-CQ5hBjsy.js → caret-right-fnCcTJKp.js} +1 -1
- package/dist/components/chunks/{caret-up-1paz-pnI.js → caret-up-CK7JOG6X.js} +1 -1
- package/dist/components/chunks/caret-up-hwsMK8n3.js +1 -0
- package/dist/components/chunks/{chip-p6RXdzHa.js → chip-08aR26vc.js} +3 -3
- package/dist/components/chunks/{chip-Bb1Epj5C.js → chip-8BYSJ7yI.js} +1 -1
- package/dist/components/chunks/close-BdZJfr6m.js +1 -0
- package/dist/components/chunks/{close-y8q0rMSE.js → close-CFxX3WCG.js} +1 -1
- package/dist/components/chunks/icon-B8p3Co0-.js +1 -0
- package/dist/components/chunks/{icon-B01tq_aJ.js → icon-BWUYe89V.js} +4 -3
- package/dist/components/chunks/{icon-BcsWL4kZ.js → icon-B_7c8b8e.js} +1 -1
- package/dist/components/chunks/icon-CSqBgTae.js +1 -0
- package/dist/components/chunks/{input-BzrCXBg4.js → input-Dwrs8tJH.js} +4 -4
- package/dist/components/chunks/{input-DnVgj6QV.js → input-lLl8cB6r.js} +1 -1
- package/dist/components/chunks/{modal-9S-FF3_o.js → modal-CNBmdA63.js} +1 -1
- package/dist/components/chunks/{modal-D7KKb4f9.js → modal-CPcIPIO7.js} +2 -2
- package/dist/components/chunks/search-Bsaoxa30.js +1 -0
- package/dist/components/chunks/{search-Dd28O4mG.js → search-xHKqAXph.js} +1 -1
- package/dist/components/confirm-action/browser.js +2 -2
- package/dist/components/confirm-action/index.cjs +1 -1
- package/dist/components/confirm-action/index.js +2 -2
- package/dist/components/date-picker/browser.js +4 -4
- package/dist/components/date-picker/index.cjs +1 -1
- package/dist/components/date-picker/index.js +4 -4
- package/dist/components/dropzone/browser.js +3 -3
- package/dist/components/dropzone/index.cjs +1 -1
- package/dist/components/dropzone/index.js +3 -3
- package/dist/components/icon/browser.js +1 -1
- package/dist/components/icon/index.cjs +1 -1
- package/dist/components/icon/index.js +1 -1
- package/dist/components/input/browser.js +1 -1
- package/dist/components/input/index.cjs +1 -1
- package/dist/components/input/index.js +1 -1
- package/dist/components/modal/browser.js +1 -1
- package/dist/components/modal/index.cjs +1 -1
- package/dist/components/modal/index.js +1 -1
- package/dist/components/navigation/browser.js +2 -2
- package/dist/components/navigation/index.cjs +1 -1
- package/dist/components/navigation/index.js +2 -2
- package/dist/components/off-canvas/browser.js +2 -2
- package/dist/components/off-canvas/index.cjs +1 -1
- package/dist/components/off-canvas/index.js +2 -2
- package/dist/components/resource-table/browser.js +7 -7
- package/dist/components/resource-table/index.cjs +1 -1
- package/dist/components/resource-table/index.js +7 -7
- package/dist/components/search/browser.js +7 -7
- package/dist/components/search/index.cjs +1 -1
- package/dist/components/search/index.js +7 -7
- package/dist/components/select/browser.js +4 -4
- package/dist/components/select/index.cjs +1 -1
- package/dist/components/select/index.js +4 -4
- package/dist/components/side-navigation/browser.js +4 -4
- package/dist/components/side-navigation/index.cjs +1 -1
- package/dist/components/side-navigation/index.js +4 -4
- package/dist/components/switch/browser.js +2 -2
- package/dist/components/switch/index.cjs +1 -1
- package/dist/components/switch/index.js +2 -2
- package/dist/components/tags/browser.js +3 -3
- package/dist/components/tags/index.cjs +1 -1
- package/dist/components/tags/index.js +3 -3
- package/dist/components/time-picker/browser.js +2 -2
- package/dist/components/time-picker/index.cjs +1 -1
- package/dist/components/time-picker/index.js +2 -2
- package/dist/icons/pin.svg +1 -3
- package/dist/index.cjs +4 -4
- package/dist/index.css +1 -1
- package/dist/index.js +115 -103
- package/dist/input.css +1 -1
- package/package.json +1 -1
- package/dist/components/chunks/caret-down-C5a1fGvt.js +0 -1
- package/dist/components/chunks/caret-right-BMyWflHN.js +0 -1
- package/dist/components/chunks/caret-up-BJAyfrty.js +0 -1
- package/dist/components/chunks/close-Bg0kqvrY.js +0 -1
- package/dist/components/chunks/icon-DNWs0suS.js +0 -1
- package/dist/components/chunks/icon-uMo_iGkX.js +0 -1
- package/dist/components/chunks/search-C5jD2OC-.js +0 -1
package/dist/index.cjs
CHANGED
|
@@ -18,7 +18,7 @@ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{val
|
|
|
18
18
|
</svg>`};s(me);var he={name:`globe`,viewBox:`0 0 24 24`,path:`M12 2a10 10 0 100 20 10 10 0 000-20zm0 0c2.5 2.4 4 6.2 4 10s-1.5 7.6-4 10m0-20c-2.5 2.4-4 6.2-4 10s1.5 7.6 4 10M2 12h20M4.5 7h15M4.5 17h15`,strokeLinecap:`round`,strokeLinejoin:`round`};s(he);var ge={name:`grid`,viewBox:`0 0 24 24`,path:`M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(ge);var _e={name:`grip-lines`,viewBox:`0 0 24 24`,path:`M12 12`,customSvg:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
19
19
|
<rect x="2" y="8" width="18" height="2" rx="1" />
|
|
20
20
|
<rect x="2" y="14" width="18" height="2" rx="1" />
|
|
21
|
-
</svg>`};s(_e);var ve={name:`help`,viewBox:`0 0 24 24`,path:`M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(ve);var ye={name:`home`,viewBox:`0 0 24 24`,path:`M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6`,strokeLinecap:`round`,strokeLinejoin:`round`};s(ye);var be={name:`image`,viewBox:`0 0 24 24`,path:`M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(be);var xe={name:`info`,viewBox:`0 0 24 24`,path:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(xe);var Se={name:`language`,viewBox:`0 0 24 24`,path:`M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Se);var Ce={name:`line-chart`,viewBox:`0 0 24 24`,path:`M3 20h18M4 18V4m2 11l4-4 3 3 5-6m0 0h-4m4 0v4`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Ce);var we={name:`link`,viewBox:`0 0 24 24`,path:`M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1`,strokeLinecap:`round`,strokeLinejoin:`round`};s(we);var Te={name:`list`,viewBox:`0 0 24 24`,path:`M8 6h13M5 6h.01M8 12h13M5 12h.01M8 18h13M5 18h.01`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Te);var Ee={name:`location`,viewBox:`0 0 24 24`,path:`M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z M15 11a3 3 0 11-6 0 3 3 0 016 0z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Ee);var De={name:`lock`,viewBox:`0 0 24 24`,path:`M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(De);var Oe={name:`login`,viewBox:`0 0 24 24`,path:`M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Oe);var ke={name:`logout`,viewBox:`0 0 24 24`,path:`M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1`,strokeLinecap:`round`,strokeLinejoin:`round`};s(ke);var Ae={name:`mail`,viewBox:`0 0 24 24`,path:`M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Ae);var je={name:`map`,viewBox:`0 0 24 24`,path:`M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7`,strokeLinecap:`round`,strokeLinejoin:`round`};s(je);var Me={name:`menu`,viewBox:`0 0 24 24`,path:`M4 6h16M4 12h16M4 18h16`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Me);var Ne={name:`mobile`,viewBox:`0 0 24 24`,path:`M8 2h8a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1Zm3 16h2`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Ne);var Pe={name:`moon`,viewBox:`0 0 24 24`,path:`M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Pe);var Fe={name:`notifications`,viewBox:`0 0 24 24`,path:`M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Fe);var Ie={name:`paste`,viewBox:`0 0 24 24`,path:`M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Ie);var Le={name:`pin`,viewBox:`0 0 24 24`,path:`M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Le);var Re={name:`plus`,viewBox:`0 0 24 24`,path:`M12 4v16m8-8H4`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Re);var ze={name:`print`,viewBox:`0 0 24 24`,path:`M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(ze);var Be={name:`qr-code`,viewBox:`0 0 24 24`,path:`M4 3H9C10.1 3 11 3.9 11 5V10C11 11.1 10.1 12 9 12H4C2.9 12 2 11.1 2 10V5C2 3.9 2.9 3 4 3ZM4.75 4.5C4.34 4.5 4 4.84 4 5.25V9.75C4 10.16 4.34 10.5 4.75 10.5H8.25C8.66 10.5 9 10.16 9 9.75V5.25C9 4.84 8.66 4.5 8.25 4.5H4.75ZM15 3H20C21.1 3 22 3.9 22 5V10C22 11.1 21.1 12 20 12H15C13.9 12 13 11.1 13 10V5C13 3.9 13.9 3 15 3ZM15.75 4.5C15.34 4.5 15 4.84 15 5.25V9.75C15 10.16 15.34 10.5 15.75 10.5H19.25C19.66 10.5 20 10.16 20 9.75V5.25C20 4.84 19.66 4.5 19.25 4.5H15.75ZM4 13H9C10.1 13 11 13.9 11 15V20C11 21.1 10.1 22 9 22H4C2.9 22 2 21.1 2 20V15C2 13.9 2.9 13 4 13ZM4.75 14.5C4.34 14.5 4 14.84 4 15.25V19.75C4 20.16 4.34 20.5 4.75 20.5H8.25C8.66 20.5 9 20.16 9 19.75V15.25C9 14.84 8.66 14.5 8.25 14.5H4.75ZM13 13H16V16H19V19H16V22H13V19H16V16H13V13Z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Be);var Ve={name:`refresh`,viewBox:`0 0 24 24`,path:`M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Ve);var He={name:`remove`,viewBox:`0 0 24 24`,path:`M20 12H4`,strokeLinecap:`round`,strokeLinejoin:`round`};s(He);var Ue={name:`save`,viewBox:`0 0 24 24`,path:`M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Ue);var We={name:`search`,viewBox:`0 0 24 24`,path:`M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(We);var Ge={name:`settings`,viewBox:`0 0 24 24`,path:`M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Ge);var Ke={name:`share`,viewBox:`0 0 24 24`,path:`M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Ke);var qe={name:`sort`,viewBox:`0 0 24 24`,path:`M3 6h18M7 12h10m-7 6h4`,strokeLinecap:`round`,strokeLinejoin:`round`};s(qe);var Je={name:`sort-arrows`,viewBox:`0 0 24 24`,path:`M1 5l5-4m0 0l5 4m-5-4v22 M13 19l5 4m0 0l5-4m-5 4V1`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Je);var Ye={name:`star`,viewBox:`0 0 24 24`,path:`M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Ye);var Xe={name:`success`,viewBox:`0 0 24 24`,path:`M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Xe);var Ze={name:`sun`,viewBox:`0 0 24 24`,path:`M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Ze);var Qe={name:`table`,viewBox:`0 0 24 24`,path:`M3 10h18M3 14h18m-9-4v8m-7 0h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Qe);var $e={name:`tablet`,viewBox:`0 0 24 24`,path:`M6 3h12a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm5 15h2`,strokeLinecap:`round`,strokeLinejoin:`round`};s($e);var et={name:`tag`,viewBox:`0 0 24 24`,path:`M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(et);var tt={name:`trash`,viewBox:`0 0 24 24`,path:`M3 6h18m-2 0v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2`,strokeLinecap:`round`,strokeLinejoin:`round`};s(tt);var nt={name:`unlock`,viewBox:`0 0 24 24`,path:`M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(nt);var rt={name:`upload`,viewBox:`0 0 24 24`,path:`M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12`,strokeLinecap:`round`,strokeLinejoin:`round`};s(rt);var it={name:`user`,viewBox:`0 0 24 24`,path:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(it);var at={name:`user-add`,viewBox:`0 0 24 24`,path:`M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(at);var ot={name:`users`,viewBox:`0 0 24 24`,path:`M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(ot);var st={name:`video`,viewBox:`0 0 24 24`,path:`M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(st);var ct={name:`warning`,viewBox:`0 0 24 24`,path:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(ct);var lt={name:`shopping-cart`,viewBox:`0 0 24 24`,path:`M3 4h2l2.2 11h10.9l2-7H6m3.2 7-.9 3h10.2M9 21h.01M17 21h.01`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(lt);var ut={name:`package`,viewBox:`0 0 24 24`,path:`M3 7l9-4 9 4-9 4-9-4zm0 0v10l9 4 9-4V7M12 11v10M7.5 5l9 4`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(ut);var dt={name:`storefront`,viewBox:`0 0 24 24`,path:`M3 10l2-6h14l2 6M4 10v10h16V10M3 10a3 3 0 006 0 3 3 0 006 0 3 3 0 006 0M10 15v5m4-5v5`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(dt);var ft={name:`receipt`,viewBox:`0 0 24 24`,path:`M6 3l2 1.5L10 3l2 1.5L14 3l2 1.5L18 3v18l-2-1.5-2 1.5-2-1.5-2 1.5-2-1.5L6 21V3zm3 6h6m-6 4h6m-6 4h3`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(ft);var pt={name:`coupon`,viewBox:`0 0 24 24`,path:`M4 5h16v4a3 3 0 000 6v4H4v-4a3 3 0 000-6V5zm8 1v2m0 2v2m0 2v2`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(pt);var mt={name:`heart`,viewBox:`0 0 24 24`,path:`M20.8 8.8c0 5.2-8.8 11-8.8 11s-8.8-5.8-8.8-11a4.8 4.8 0 018.8-2.6 4.8 4.8 0 018.8 2.6z`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(mt);var ht={name:`return`,viewBox:`0 0 24 24`,path:`M9 14l-5-5 5-5M4 9h10a6 6 0 010 12h-3`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(ht);var gt={name:`wallet`,viewBox:`0 0 24 24`,path:`M4 6.5A2.5 2.5 0 016.5 4H20v16H6a3 3 0 01-3-3V6.5A2.5 2.5 0 016 9h14m-4 4h.01`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(gt);var _t={name:`gift`,viewBox:`0 0 24 24`,path:`M3 9h18v12H3V9zm-1-3h20v3H2V6zm10 0v15m0-15C11 4.6 9.8 3 8 3a1.5 1.5 0 000 3m4 0c1-1.4 2.2-3 4-3a1.5 1.5 0 010 3`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(_t);var vt={name:`support`,viewBox:`0 0 24 24`,path:`M4 13v-2a8 8 0 0116 0v2m-16 0h3v6H6a2 2 0 01-2-2v-2a2 2 0 012-2zm16 0h-3v6h1a2 2 0 002-2v-2a2 2 0 00-2-2zm-3 8h-4`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(vt);var yt={name:`shopping-bag`,viewBox:`0 0 24 24`,path:`M5 8h14l1 13H4L5 8zm4 0V6a3 3 0 016 0v2`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(yt);var bt={name:`warehouse`,viewBox:`0 0 24 24`,path:`M3 10l9-6 9 6v10H3V10zm4 10v-7h10v7m-7-7v7m4-7v7`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(bt);var xt={name:`delivery-location`,viewBox:`0 0 24 24`,path:`M12 21s7-6.2 7-12a7 7 0 10-14 0c0 5.8 7 12 7 12zm0-9a3 3 0 110-6 3 3 0 010 6zm-9 9h18`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(xt);var St={name:`order-tracking`,viewBox:`0 0 24 24`,path:`M2.5 6.5H14v11H2.5v-11zm11.5 2.5h4l3.5 4v4.5H14V9zm-7 9a2 2 0 100 4 2 2 0 000-4zm9 0a2 2 0 100 4 2 2 0 000-4zM5 10h7m-7 3h5`,customSvg:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
21
|
+
</svg>`};s(_e);var ve={name:`help`,viewBox:`0 0 24 24`,path:`M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(ve);var ye={name:`home`,viewBox:`0 0 24 24`,path:`M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6`,strokeLinecap:`round`,strokeLinejoin:`round`};s(ye);var be={name:`image`,viewBox:`0 0 24 24`,path:`M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(be);var xe={name:`info`,viewBox:`0 0 24 24`,path:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(xe);var Se={name:`language`,viewBox:`0 0 24 24`,path:`M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Se);var Ce={name:`line-chart`,viewBox:`0 0 24 24`,path:`M3 20h18M4 18V4m2 11l4-4 3 3 5-6m0 0h-4m4 0v4`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Ce);var we={name:`link`,viewBox:`0 0 24 24`,path:`M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1`,strokeLinecap:`round`,strokeLinejoin:`round`};s(we);var Te={name:`list`,viewBox:`0 0 24 24`,path:`M8 6h13M5 6h.01M8 12h13M5 12h.01M8 18h13M5 18h.01`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Te);var Ee={name:`location`,viewBox:`0 0 24 24`,path:`M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z M15 11a3 3 0 11-6 0 3 3 0 016 0z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Ee);var De={name:`lock`,viewBox:`0 0 24 24`,path:`M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(De);var Oe={name:`login`,viewBox:`0 0 24 24`,path:`M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Oe);var ke={name:`logout`,viewBox:`0 0 24 24`,path:`M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1`,strokeLinecap:`round`,strokeLinejoin:`round`};s(ke);var Ae={name:`mail`,viewBox:`0 0 24 24`,path:`M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Ae);var je={name:`map`,viewBox:`0 0 24 24`,path:`M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7`,strokeLinecap:`round`,strokeLinejoin:`round`};s(je);var Me={name:`menu`,viewBox:`0 0 24 24`,path:`M4 6h16M4 12h16M4 18h16`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Me);var Ne={name:`mobile`,viewBox:`0 0 24 24`,path:`M8 2h8a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1Zm3 16h2`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Ne);var Pe={name:`moon`,viewBox:`0 0 24 24`,path:`M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Pe);var Fe={name:`notifications`,viewBox:`0 0 24 24`,path:`M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Fe);var Ie={name:`paste`,viewBox:`0 0 24 24`,path:`M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Ie);var Le={name:`pin`,viewBox:`0 0 16 16`,path:`M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146z`,strokeLinecap:`round`,strokeLinejoin:`round`,customSvg:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"><path d="M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146z" /></svg>`};s(Le);var Re={name:`plus`,viewBox:`0 0 24 24`,path:`M12 4v16m8-8H4`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Re);var ze={name:`print`,viewBox:`0 0 24 24`,path:`M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(ze);var Be={name:`qr-code`,viewBox:`0 0 24 24`,path:`M4 3H9C10.1 3 11 3.9 11 5V10C11 11.1 10.1 12 9 12H4C2.9 12 2 11.1 2 10V5C2 3.9 2.9 3 4 3ZM4.75 4.5C4.34 4.5 4 4.84 4 5.25V9.75C4 10.16 4.34 10.5 4.75 10.5H8.25C8.66 10.5 9 10.16 9 9.75V5.25C9 4.84 8.66 4.5 8.25 4.5H4.75ZM15 3H20C21.1 3 22 3.9 22 5V10C22 11.1 21.1 12 20 12H15C13.9 12 13 11.1 13 10V5C13 3.9 13.9 3 15 3ZM15.75 4.5C15.34 4.5 15 4.84 15 5.25V9.75C15 10.16 15.34 10.5 15.75 10.5H19.25C19.66 10.5 20 10.16 20 9.75V5.25C20 4.84 19.66 4.5 19.25 4.5H15.75ZM4 13H9C10.1 13 11 13.9 11 15V20C11 21.1 10.1 22 9 22H4C2.9 22 2 21.1 2 20V15C2 13.9 2.9 13 4 13ZM4.75 14.5C4.34 14.5 4 14.84 4 15.25V19.75C4 20.16 4.34 20.5 4.75 20.5H8.25C8.66 20.5 9 20.16 9 19.75V15.25C9 14.84 8.66 14.5 8.25 14.5H4.75ZM13 13H16V16H19V19H16V22H13V19H16V16H13V13Z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Be);var Ve={name:`refresh`,viewBox:`0 0 24 24`,path:`M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Ve);var He={name:`remove`,viewBox:`0 0 24 24`,path:`M20 12H4`,strokeLinecap:`round`,strokeLinejoin:`round`};s(He);var Ue={name:`save`,viewBox:`0 0 24 24`,path:`M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Ue);var We={name:`search`,viewBox:`0 0 24 24`,path:`M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(We);var Ge={name:`settings`,viewBox:`0 0 24 24`,path:`M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Ge);var Ke={name:`share`,viewBox:`0 0 24 24`,path:`M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Ke);var qe={name:`sort`,viewBox:`0 0 24 24`,path:`M3 6h18M7 12h10m-7 6h4`,strokeLinecap:`round`,strokeLinejoin:`round`};s(qe);var Je={name:`sort-arrows`,viewBox:`0 0 24 24`,path:`M1 5l5-4m0 0l5 4m-5-4v22 M13 19l5 4m0 0l5-4m-5 4V1`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Je);var Ye={name:`star`,viewBox:`0 0 24 24`,path:`M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Ye);var Xe={name:`success`,viewBox:`0 0 24 24`,path:`M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Xe);var Ze={name:`sun`,viewBox:`0 0 24 24`,path:`M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Ze);var Qe={name:`table`,viewBox:`0 0 24 24`,path:`M3 10h18M3 14h18m-9-4v8m-7 0h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(Qe);var $e={name:`tablet`,viewBox:`0 0 24 24`,path:`M6 3h12a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm5 15h2`,strokeLinecap:`round`,strokeLinejoin:`round`};s($e);var et={name:`tag`,viewBox:`0 0 24 24`,path:`M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(et);var tt={name:`trash`,viewBox:`0 0 24 24`,path:`M3 6h18m-2 0v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2`,strokeLinecap:`round`,strokeLinejoin:`round`};s(tt);var nt={name:`unlock`,viewBox:`0 0 24 24`,path:`M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(nt);var rt={name:`upload`,viewBox:`0 0 24 24`,path:`M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12`,strokeLinecap:`round`,strokeLinejoin:`round`};s(rt);var it={name:`user`,viewBox:`0 0 24 24`,path:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(it);var at={name:`user-add`,viewBox:`0 0 24 24`,path:`M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(at);var ot={name:`users`,viewBox:`0 0 24 24`,path:`M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(ot);var st={name:`video`,viewBox:`0 0 24 24`,path:`M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(st);var ct={name:`warning`,viewBox:`0 0 24 24`,path:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z`,strokeLinecap:`round`,strokeLinejoin:`round`};s(ct);var lt={name:`shopping-cart`,viewBox:`0 0 24 24`,path:`M3 4h2l2.2 11h10.9l2-7H6m3.2 7-.9 3h10.2M9 21h.01M17 21h.01`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(lt);var ut={name:`package`,viewBox:`0 0 24 24`,path:`M3 7l9-4 9 4-9 4-9-4zm0 0v10l9 4 9-4V7M12 11v10M7.5 5l9 4`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(ut);var dt={name:`storefront`,viewBox:`0 0 24 24`,path:`M3 10l2-6h14l2 6M4 10v10h16V10M3 10a3 3 0 006 0 3 3 0 006 0 3 3 0 006 0M10 15v5m4-5v5`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(dt);var ft={name:`receipt`,viewBox:`0 0 24 24`,path:`M6 3l2 1.5L10 3l2 1.5L14 3l2 1.5L18 3v18l-2-1.5-2 1.5-2-1.5-2 1.5-2-1.5L6 21V3zm3 6h6m-6 4h6m-6 4h3`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(ft);var pt={name:`coupon`,viewBox:`0 0 24 24`,path:`M4 5h16v4a3 3 0 000 6v4H4v-4a3 3 0 000-6V5zm8 1v2m0 2v2m0 2v2`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(pt);var mt={name:`heart`,viewBox:`0 0 24 24`,path:`M20.8 8.8c0 5.2-8.8 11-8.8 11s-8.8-5.8-8.8-11a4.8 4.8 0 018.8-2.6 4.8 4.8 0 018.8 2.6z`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(mt);var ht={name:`return`,viewBox:`0 0 24 24`,path:`M9 14l-5-5 5-5M4 9h10a6 6 0 010 12h-3`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(ht);var gt={name:`wallet`,viewBox:`0 0 24 24`,path:`M4 6.5A2.5 2.5 0 016.5 4H20v16H6a3 3 0 01-3-3V6.5A2.5 2.5 0 016 9h14m-4 4h.01`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(gt);var _t={name:`gift`,viewBox:`0 0 24 24`,path:`M3 9h18v12H3V9zm-1-3h20v3H2V6zm10 0v15m0-15C11 4.6 9.8 3 8 3a1.5 1.5 0 000 3m4 0c1-1.4 2.2-3 4-3a1.5 1.5 0 010 3`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(_t);var vt={name:`support`,viewBox:`0 0 24 24`,path:`M4 13v-2a8 8 0 0116 0v2m-16 0h3v6H6a2 2 0 01-2-2v-2a2 2 0 012-2zm16 0h-3v6h1a2 2 0 002-2v-2a2 2 0 00-2-2zm-3 8h-4`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(vt);var yt={name:`shopping-bag`,viewBox:`0 0 24 24`,path:`M5 8h14l1 13H4L5 8zm4 0V6a3 3 0 016 0v2`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(yt);var bt={name:`warehouse`,viewBox:`0 0 24 24`,path:`M3 10l9-6 9 6v10H3V10zm4 10v-7h10v7m-7-7v7m4-7v7`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(bt);var xt={name:`delivery-location`,viewBox:`0 0 24 24`,path:`M12 21s7-6.2 7-12a7 7 0 10-14 0c0 5.8 7 12 7 12zm0-9a3 3 0 110-6 3 3 0 010 6zm-9 9h18`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.8`};s(xt);var St={name:`order-tracking`,viewBox:`0 0 24 24`,path:`M2.5 6.5H14v11H2.5v-11zm11.5 2.5h4l3.5 4v4.5H14V9zm-7 9a2 2 0 100 4 2 2 0 000-4zm9 0a2 2 0 100 4 2 2 0 000-4zM5 10h7m-7 3h5`,customSvg:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
22
22
|
<path d="M2.5 6.5H14v11H2.5v-11z" />
|
|
23
23
|
<path d="M14 9h3.7l3.8 4v4.5H14" />
|
|
24
24
|
<path d="M15.5 10.5h1.7l2.5 2.5h-4.2z" stroke-width="1.5" />
|
|
@@ -101,7 +101,7 @@ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{val
|
|
|
101
101
|
</header>
|
|
102
102
|
<main part="body" class="mint-page-body"><slot></slot></main>
|
|
103
103
|
</div>
|
|
104
|
-
`,this._headingElement=this._root.querySelector(`.mint-page-heading`),this._backButton=this._root.querySelector(`.mint-page-back`),this._backButton.addEventListener(`click`,e=>this._handleBack(e))}connectedCallback(){this.render()}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this.render()}getHeading(){return this.getAttribute(`heading`)||``}getFallbackHref(){return this.getAttribute(`fallback-href`)||`/`}shouldShowBackButton(){return this.getAttribute(`show-back-button`)===`true`}isContainered(){return this.hasAttribute(`containered`)&&this.getAttribute(`containered`)!==`false`}render(){this._headingElement.textContent=this.getHeading(),this._backButton.hidden=!this.shouldShowBackButton()}_handleBack(e){e.preventDefault();let t=document.referrer,n=!!(t&&(()=>{try{return new URL(t).origin===window.location.origin}catch{return!1}})()),r={url:n?t:this.getFallbackHref(),isFromReferrer:n,referrer:t||null,fallbackHref:this.getFallbackHref()},i=new CustomEvent(`back`,{detail:r,bubbles:!0,cancelable:!0,composed:!0});this.dispatchEvent(i)&&(n&&window.history.length>1?window.history.back():window.location.href=this.getFallbackHref())}};typeof customElements<`u`&&!customElements.get(`mint-page`)&&a(`mint-page`,Ut);var Wt=class extends HTMLElement{constructor(){super()}};typeof customElements<`u`&&!customElements.get(`mint-grid`)&&a(`mint-grid`,Wt);var Gt=class extends HTMLElement{static get observedAttributes(){return[`id`,`heading`,`open`]}constructor(){super(),this._overlay=null,this._modal=null,this._header=null,this._headingSlot=null,this._bodySlot=null,this._actionsSlot=null,this._closeButton=null,this._triggerElement=null,this._triggerPoint=null,this._renderedOpen=!1,this._lastPointerPoint=null,this._pointerDownHandler=null,this._darkModeObserver=null,this._exitTimer=null,this._backdropTimer=null}connectedCallback(){this.isOpen()||this.classList.add(`mint-hidden`),this.render(),this._observeDarkMode(),this._pointerDownHandler=e=>{this._lastPointerPoint={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()}},document.addEventListener(`pointerdown`,this._pointerDownHandler,!0)}disconnectedCallback(){this._pointerDownHandler&&=(document.removeEventListener(`pointerdown`,this._pointerDownHandler,!0),null),this._exitTimer&&=(clearTimeout(this._exitTimer),null),this._backdropTimer&&=(clearTimeout(this._backdropTimer),null),this._darkModeObserver&&=(this._darkModeObserver.disconnect(),null)}attributeChangedCallback(e,t,n){t!==n&&(e===`open`&&n!==null&&!this._triggerElement&&(this._triggerElement=this._findTriggerElement(),this._triggerPoint=this._findTriggerPoint(this._triggerElement)),this.render())}getId(){return this.getAttribute(`id`)||``}getHeading(){return this.getAttribute(`heading`)||``}isOpen(){return this.hasAttribute(`open`)}open(e){this._triggerElement=this._findTriggerElement(e),this._triggerPoint=this._findTriggerPoint(this._triggerElement),this.setAttribute(`open`,``)}close(){this.removeAttribute(`open`)}render(){let e=this.getId(),t=this.getHeading(),n=this.isOpen();if(e&&(this.id=e),this._overlay||(this._overlay=document.createElement(`div`),this._overlay.className=`mint-modal-overlay`,this._overlay.addEventListener(`click`,()=>this.close()),this.appendChild(this._overlay)),this._modal||(this._modal=document.createElement(`div`),this._modal.className=`mint-modal-shell`,this.appendChild(this._modal)),n){let e=this._modal.querySelector(`.modal-content`);e||(e=document.createElement(`div`),e.className=`modal-content`,this._modal.appendChild(e)),this._renderedOpen||(this._renderedOpen=!0,this._animateEnter())}else this._renderedOpen&&(this._renderedOpen=!1,this._animateExit());let r=this._modal.querySelector(`.modal-content`);r||(r=document.createElement(`div`),r.className=`modal-content`,this._modal.appendChild(r)),this._header||(this._header=document.createElement(`div`),this._header.className=`mint-modal-header`,r.appendChild(this._header)),this._headingSlot||(this._headingSlot=document.createElement(`div`),this._headingSlot.className=`mint-modal-heading`,this._headingSlot.setAttribute(`slot`,`heading`),this._header.appendChild(this._headingSlot));let i=this._headingSlot.querySelector(`mint-text`);t?(i||(i=document.createElement(`mint-text`),i.setAttribute(`size`,`sub-heading`),i.setAttribute(`bold`,``),this._headingSlot.appendChild(i)),i.textContent=t):i&&i.remove(),Array.from(this.children).filter(e=>e!==this._overlay&&e!==this._modal&&e!==this._headingSlot&&e.getAttribute(`slot`)===`heading`).forEach(e=>{e.parentElement!==this._headingSlot&&this._headingSlot.appendChild(e)}),this._closeButton||(this._closeButton=document.createElement(`mint-button`),this._closeButton.setAttribute(`variant`,`ghost`),this._closeButton.setAttribute(`icon`,`close`),this._closeButton.addEventListener(`click`,()=>this.close()),this._header.appendChild(this._closeButton)),this._bodySlot||(this._bodySlot=document.createElement(`div`),this._bodySlot.className=`mint-modal-body`,this._bodySlot.setAttribute(`slot`,`body`),r.appendChild(this._bodySlot)),Array.from(this.children).filter(e=>e!==this._overlay&&e!==this._modal&&e!==this._bodySlot&&e.getAttribute(`slot`)===`body`).forEach(e=>{e.parentElement!==this._bodySlot&&this._bodySlot.appendChild(e)}),this._actionsSlot||(this._actionsSlot=document.createElement(`div`),this._actionsSlot.className=`mint-modal-actions`,this._actionsSlot.setAttribute(`slot`,`actions`),r.appendChild(this._actionsSlot));let a=this._actionsSlot.querySelector(`mint-stack`);a||(a=document.createElement(`mint-stack`),a.setAttribute(`direction`,`horizontal`),a.className=`mint-actions-stack`,this._actionsSlot.appendChild(a)),Array.from(this.children).filter(e=>e!==this._overlay&&e!==this._modal&&e!==this._actionsSlot&&e.getAttribute(`slot`)===`actions`).forEach(e=>{Array.from(e.children).forEach(e=>{e.parentElement!==a&&a.appendChild(e)}),e.parentElement&&e.remove()}),Array.from(this.children).forEach(e=>{e!==this._overlay&&e!==this._modal&&e.getAttribute(`slot`)!==`heading`&&e.getAttribute(`slot`)!==`body`&&e.getAttribute(`slot`)!==`actions`&&e!==this._headingSlot&&e!==this._bodySlot&&e!==this._actionsSlot&&e.parentElement!==this._bodySlot&&this._bodySlot.appendChild(e)}),this._updateBackgroundColor()}_updateBackgroundColor(){if(!this._modal)return;document.documentElement?.classList.contains(`dark`)||document.documentElement?.dataset.mintTheme;let e=this._modal.querySelector(`.modal-content`);e&&(e.style.background=`var(--mint-color-surface-raised)`)}_observeDarkMode(){if(!this._darkModeObserver){if(this._darkModeObserver=new MutationObserver(()=>{this._updateBackgroundColor()}),!document.documentElement)return;this._darkModeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`,`data-mint-theme`]})}}_animateEnter(){let e=this._modal?.querySelector(`.modal-content`);e&&(this._exitTimer&&=(clearTimeout(this._exitTimer),null),this._backdropTimer&&=(clearTimeout(this._backdropTimer),null),this.classList.remove(`mint-modal-closing`),this.classList.remove(`mint-modal-open`),this.classList.add(`mint-modal-open`),this.classList.remove(`mint-hidden`),e.style.transform=`none`,e.style.opacity=`0`,e.style.transition=`none`,requestAnimationFrame(()=>{if(!this.isOpen())return;let t=window.getComputedStyle(e).borderRadius;this._setTransformOrigin(e),e.style.borderRadius=`50%`,e.style.transform=`scale(0.1, 0.2)`,e.style.opacity=`0.9`,e.getBoundingClientRect(),e.style.transition=`opacity 320ms ease-out, transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1), border-radius 360ms cubic-bezier(0.2, 0.8, 0.2, 1)`,requestAnimationFrame(()=>{this.isOpen()&&(e.style.transform=`scale(1)`,e.style.opacity=`1`,e.style.borderRadius=t)})}))}_findTriggerElement(e){if(typeof e==`string`){let t=document.getElementById(e);return t&&!this.contains(t)?t:null}if(e instanceof HTMLElement)return e.isConnected&&!this.contains(e)?e:null;let t=this.getAttribute(`trigger-id`);if(t){let e=document.getElementById(t);if(e&&!this.contains(e))return e}let n=document.activeElement;return n instanceof HTMLElement&&n.isConnected&&n!==document.body&&!this.contains(n)?n:null}_findTriggerPoint(e){if(!e)return null;let t=this._lastPointerPoint;if(!t||Date.now()-t.time>1e3)return null;let n=t.target instanceof Node?t.target:null;return n===e||n&&e.contains(n)?{x:t.x,y:t.y}:null}_setTransformOrigin(e){let t=this._findTriggerElement(this._triggerElement);this._triggerElement=t;let n=this._findTriggerPoint(t);if(n){let t=e.getBoundingClientRect();e.style.transformOrigin=`${n.x-t.left}px ${n.y-t.top}px`,this._triggerPoint=n;return}this._triggerPoint={x:window.innerWidth/2,y:0};let r=e.getBoundingClientRect();e.style.transformOrigin=`${this._triggerPoint.x-r.left}px ${this._triggerPoint.y-r.top}px`}_animateExit(){this.classList.remove(`mint-modal-open`),this._backdropTimer&&=(clearTimeout(this._backdropTimer),null);let e=this._modal?.querySelector(`.modal-content`);if(!e){this.classList.add(`mint-hidden`),this.classList.remove(`mint-modal-closing`);return}this._exitTimer&&clearTimeout(this._exitTimer),this.classList.add(`mint-modal-closing`),e.style.transition=`opacity 220ms ease-in, transform 260ms cubic-bezier(0.4, 0, 1, 1), border-radius 260ms cubic-bezier(0.4, 0, 1, 1)`,e.style.borderRadius=`50%`,e.style.transform=`scale(0.1, 0.2)`,e.style.opacity=`0.9`,this._exitTimer=setTimeout(()=>{this._exitTimer=null,!this.isOpen()&&(this.classList.add(`mint-hidden`),this.classList.remove(`mint-modal-closing`),e.style.transform=``,e.style.opacity=``,e.style.borderRadius=``,e.style.transition=``)},280)}};typeof customElements<`u`&&!customElements.get(`mint-modal`)&&a(`mint-modal`,Gt);var Kt=new Set([`up`,`down`,`left`,`right`]),qt=class extends HTMLElement{static get observedAttributes(){return[`direction`,`open`,`trigger-id`,`trigger-toggle`,`trigger-align`,`padding`,`hover`,`distance`]}constructor(){super(),this._trigger=null,this._triggerLookupTimer=null,this._clickHandler=null,this._hoverEnterHandler=null,this._hoverLeaveHandler=null,this._outsideHandler=null,this._escapeHandler=null,this._positionHandler=null,this._scrollHandler=null,this._resizeObserver=null,this._hoverCloseTimer=null,this._closeAnimationTimer=null,this._blobAnimation=null}connectedCallback(){this.render(),this._setupTrigger()}disconnectedCallback(){this._removeTrigger(),this._removeOpenListeners(),clearTimeout(this._hoverCloseTimer),clearTimeout(this._closeAnimationTimer),this._blobAnimation?.cancel()}attributeChangedCallback(e,t,n){t===n||!this.isConnected||((e===`trigger-id`||e===`trigger-toggle`||e===`hover`)&&this._setupTrigger(),this.render())}getDirection(){let e=this.getAttribute(`direction`)||`down`;return Kt.has(e)?e:`down`}getTriggerId(){return this.getAttribute(`trigger-id`)||``}isOpen(){return this.hasAttribute(`open`)&&this.getAttribute(`open`)!==`false`}isHoverEnabled(){return this.hasAttribute(`hover`)&&this.getAttribute(`hover`)!==`false`}isTriggerToggleEnabled(){return this.getAttribute(`trigger-toggle`)!==`false`}open(){this.setAttribute(`open`,`true`)}close(){this.removeAttribute(`open`)}_removeTrigger(){clearTimeout(this._triggerLookupTimer),this._triggerLookupTimer=null,this._trigger&&(this._clickHandler&&this._trigger.removeEventListener(`click`,this._clickHandler),this._hoverEnterHandler&&this._trigger.removeEventListener(`mouseenter`,this._hoverEnterHandler),this._hoverLeaveHandler&&this._trigger.removeEventListener(`mouseleave`,this._hoverLeaveHandler),this._hoverEnterHandler&&this.removeEventListener(`mouseenter`,this._hoverEnterHandler),this._hoverLeaveHandler&&this.removeEventListener(`mouseleave`,this._hoverLeaveHandler),this._trigger.removeAttribute(`aria-haspopup`),this._trigger.removeAttribute(`aria-expanded`),this._trigger=null,this._clickHandler=this._hoverEnterHandler=this._hoverLeaveHandler=null)}_setupTrigger(){this._removeTrigger();let e=this.getTriggerId();if(e){if(this._trigger=document.getElementById(e),!this._trigger){this._triggerLookupTimer=setTimeout(()=>{this.isConnected&&this.getTriggerId()===e&&!this._trigger&&this._setupTrigger()},40);return}this._trigger.setAttribute(`aria-haspopup`,`true`),this._trigger.setAttribute(`aria-expanded`,String(this.isOpen())),this.isTriggerToggleEnabled()&&(this._clickHandler=e=>{this._trigger?.tagName===`A`&&e.preventDefault(),this.isOpen()?this.close():this.open()},this._trigger.addEventListener(`click`,this._clickHandler)),this.isHoverEnabled()&&(this._hoverEnterHandler=()=>{clearTimeout(this._hoverCloseTimer),this.open()},this._hoverLeaveHandler=()=>this._scheduleHoverClose(),this._trigger.addEventListener(`mouseenter`,this._hoverEnterHandler),this._trigger.addEventListener(`mouseleave`,this._hoverLeaveHandler),this.addEventListener(`mouseenter`,this._hoverEnterHandler),this.addEventListener(`mouseleave`,this._hoverLeaveHandler))}}_scheduleHoverClose(){clearTimeout(this._hoverCloseTimer),this._hoverCloseTimer=setTimeout(()=>{!this._trigger?.matches(`:hover`)&&!this.matches(`:hover`)&&this.close()},140)}_removeOpenListeners(){this._outsideHandler&&document.removeEventListener(`click`,this._outsideHandler),this._escapeHandler&&document.removeEventListener(`keydown`,this._escapeHandler),this._positionHandler&&window.removeEventListener(`resize`,this._positionHandler),this._scrollHandler&&window.removeEventListener(`scroll`,this._scrollHandler,!0),this._resizeObserver?.disconnect(),this._resizeObserver=null,this._outsideHandler=this._escapeHandler=this._positionHandler=this._scrollHandler=null}_setOpenListeners(){if(!this._outsideHandler){if(this._outsideHandler=e=>{let t=e.composedPath();t.includes(this)||t.includes(this._trigger)||(e.target instanceof Element?e.target:null)?.closest(`[data-keep-popover-open]`)||this.close()},this._escapeHandler=e=>{e.key===`Escape`&&(this.close(),this._trigger?.focus?.())},this._positionHandler=()=>{this.isOpen()&&this._position()},this._scrollHandler=()=>{this.isOpen()&&this._position({allowViewportFlip:!1,clampToViewport:!1})},typeof ResizeObserver<`u`&&this._trigger){this._resizeObserver=new ResizeObserver(()=>{this.isOpen()&&this._position()}),this._resizeObserver.observe(this);let e=this._trigger,t=0;for(;e&&e!==document.documentElement&&t<8;)this._resizeObserver.observe(e),e=e.parentElement,t+=1}setTimeout(()=>{this.isOpen()&&this._outsideHandler&&document.addEventListener(`click`,this._outsideHandler)},0),document.addEventListener(`keydown`,this._escapeHandler),window.addEventListener(`resize`,this._positionHandler),window.addEventListener(`scroll`,this._scrollHandler,!0)}}_position({allowViewportFlip:e=!0,clampToViewport:t=!0}={}){let n=document.getElementById(this.getTriggerId());n&&n!==this._trigger&&this._setupTrigger();let r=n||this._trigger;if(!r)return;let i=r.getBoundingClientRect(),a={width:this.offsetWidth,height:this.offsetHeight},o=this._distancePx(),s=e?this.getDirection():this.dataset.direction||this.getDirection(),c=0,l=0,u=this.getAttribute(`trigger-align`)||`center`;if(s===`down`||s===`up`){let t=i.bottom+o,n=i.top-a.height-o;e&&s===`down`&&t+a.height>innerHeight-12&&n>=12?s=`up`:e&&s===`up`&&n<12&&t+a.height<=innerHeight-12&&(s=`down`),c=s===`down`?t:n,l=u===`start`?i.left:u===`end`?i.right-a.width:i.left+(i.width-a.width)/2}else{let t=i.right+o,n=i.left-a.width-o;e&&s===`right`&&t+a.width>innerWidth-12&&n>=12?s=`left`:e&&s===`left`&&n<12&&t+a.width<=innerWidth-12&&(s=`right`),l=s===`right`?t:n,c=u===`start`?i.top:u===`end`?i.bottom-a.height:i.top+(i.height-a.height)/2}let d=t?Math.max(12,Math.min(c,innerHeight-a.height-12)):c,f=t?Math.max(12,Math.min(l,innerWidth-a.width-12)):l;this.style.top=`${d}px`,this.style.left=`${f}px`,this.dataset.direction=s,this.style.setProperty(`--mint-popover-origin-x`,`${i.left+i.width/2-f}px`),this.style.setProperty(`--mint-popover-origin-y`,`${i.top+i.height/2-d}px`)}_distancePx(){let e=(this.getAttribute(`distance`)||`8px`).trim(),t=Number.parseFloat(e);return Number.isFinite(t)?e.endsWith(`rem`)?t*(parseFloat(getComputedStyle(document.documentElement).fontSize)||16):Math.max(0,t):8}_animateBlob(e){if(this._blobAnimation?.cancel(),this._blobAnimation=null,typeof this.animate!=`function`)return 0;let t=getComputedStyle(this).borderRadius||`.75rem`;if(matchMedia(`(prefers-reduced-motion: reduce)`).matches)return 0;let n=e?380:280,r=[{transform:`scale(.035, .035)`,borderRadius:`50%`,opacity:.94,offset:0},{transform:`scale(.3, .42)`,borderRadius:`50%`,opacity:1,offset:.58},{transform:`scale(1.035, .96)`,borderRadius:`1rem`,offset:.9},{transform:`scale(1)`,borderRadius:t,offset:1}],i=e?r:[...r].reverse().map(({offset:e,...t})=>({...t,offset:1-e}));return this._blobAnimation=this.animate(i,{duration:n,easing:e?`cubic-bezier(.2, .8, .2, 1)`:`cubic-bezier(.4, 0, .8, .2)`,fill:`both`}),n}render(){let e=this.isOpen(),t=this.hasAttribute(`data-open`)||this.dataset.state===`closing`,n=this.hasAttribute(`data-open`);if(this.toggleAttribute(`data-open`,e),this.setAttribute(`aria-hidden`,String(!e)),this._trigger&&this._trigger.setAttribute(`aria-expanded`,String(e)),e){clearTimeout(this._closeAnimationTimer);let e=!n||this.dataset.state===`closing`;e&&(this._blobAnimation?.cancel(),this._blobAnimation=null),this.dataset.state=`open`,this._setOpenListeners(),this._position(),e&&this._animateBlob(!0),requestAnimationFrame(()=>requestAnimationFrame(()=>{this.isOpen()&&this._position()}))}else if(this._removeOpenListeners(),t){this.dataset.state=`closing`;let e=this._animateBlob(!1);e?this._closeAnimationTimer=setTimeout(()=>{this.dataset.state===`closing`&&(this._blobAnimation?.cancel(),this._blobAnimation=null,this.dataset.state=`closed`)},e):this.dataset.state=`closed`}else this.dataset.state=`closed`}};typeof customElements<`u`&&!customElements.get(`mint-popover`)&&a(`mint-popover`,qt),s({name:`check`,viewBox:`0 0 24 24`,path:`M5 13l4 4L19 7`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3.2`});var Jt=class extends HTMLElement{static get observedAttributes(){return[`checked`,`disabled`,`label`,`info`,`id`,`name`,`value`]}constructor(){super(),this._checkbox=null,this._checked=!1,this._clickHandler=null}connectedCallback(){let e=this.getAttribute(`checked`);this._checked=e!==null&&e!==`false`,this.render()}disconnectedCallback(){this.removeEventListeners()}attributeChangedCallback(e,t,n){e===`checked`&&(this._checked=n!==null&&n!==`false`,this._checkbox&&(this._checkbox.checked=this._checked)),t!==n&&(this.render(),e===`checked`&&this._checkbox&&this.updateVisualState())}get checked(){return this._checked}set checked(e){e?this.setAttribute(`checked`,``):this.removeAttribute(`checked`),this._checked=!!e,this._checkbox&&(this._checkbox.checked=this._checked),this.updateVisualState()}isDisabled(){return this.hasAttribute(`disabled`)}getLabel(){return this.getAttribute(`label`)||``}getInfo(){return this.getAttribute(`info`)||``}getId(){return this.getAttribute(`id`)||``}getName(){return this.getAttribute(`name`)||``}getValue(){return this.getAttribute(`value`)||``}getCheckboxClasses(){return`mint-checkbox-control`}render(){let e=this.getLabel(),t=this.getInfo(),n=this.isDisabled(),r=this.querySelector(`.mint-checkbox-wrapper`);r||(r=document.createElement(`div`),r.className=`mint-checkbox-wrapper`,this.insertBefore(r,this.firstChild)),this._checkbox?this._checkbox.parentElement!==r&&r.appendChild(this._checkbox):(this._checkbox=document.createElement(`input`),this._checkbox.type=`checkbox`,r.appendChild(this._checkbox),this.setupEventListeners()),this._checkbox.className=`mint-input-overlay`,this._checkbox.style.cssText=`position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; pointer-events: auto; margin: 0; padding: 0;`,this._checkbox.checked=this._checked,this._checkbox.disabled=n,this._changeHandler||this.setupEventListeners();let i=this.getId();i?this._checkbox.id=i:this._checkbox.removeAttribute(`id`);let a=this.getName();a?this._checkbox.name=a:this._checkbox.removeAttribute(`name`);let o=this.getValue();o?this._checkbox.value=o:this._checkbox.removeAttribute(`value`),e?this._checkbox.setAttribute(`aria-label`,e):this._checkbox.removeAttribute(`aria-label`),r.className=`mint-checkbox-wrapper ${this.getCheckboxClasses()}`,r.style.pointerEvents=`none`,this._checkbox.style.pointerEvents=`auto`;let s=r.querySelector(`mint-icon`);s||(s=document.createElement(`mint-icon`),s.setAttribute(`name`,`check`),s.className=`mint-checkbox-check`,s.style.transition=`opacity 200ms ease-out, transform 200ms ease-out`,s.style.zIndex=`1`,r.appendChild(s)),this.updateVisualState();let c=this.querySelector(`.mint-checkbox-label-container`);if(e||t){c||(c=document.createElement(`div`),c.className=`mint-checkbox-label-container`,this.appendChild(c));let r=c.querySelector(`.mint-checkbox-label`);e?(r||(r=document.createElement(`span`),r.className=`mint-checkbox-label`,c.insertBefore(r,c.firstChild)),r.textContent=e,n?r.style.opacity=`0.5`:r.style.opacity=``):r&&r.remove();let i=c.querySelector(`.mint-checkbox-info`);if(t?(i||(i=document.createElement(`span`),i.className=`mint-checkbox-info`,c.appendChild(i)),i.textContent=t,n?i.style.opacity=`0.5`:i.style.opacity=``):i&&i.remove(),n)c.style.cursor=`default`,c._clickHandler&&(c.removeEventListener(`click`,c._clickHandler),c._clickHandler=null);else{c.style.cursor=`pointer`;let e=c._clickHandler;e&&c.removeEventListener(`click`,e),c._clickHandler=e=>{this._checkbox&&(e.target===this._checkbox||this._checkbox.contains(e.target)||e.composedPath().includes(this._checkbox))||this.toggle()},c.addEventListener(`click`,c._clickHandler)}}else c&&c.remove()}setupEventListeners(){this.removeEventListeners(),this._checkbox&&(this._changeHandler=e=>{e.stopPropagation(),this._checked=this._checkbox.checked,this._checked?this.hasAttribute(`checked`)||this.setAttribute(`checked`,``):this.hasAttribute(`checked`)&&this.removeAttribute(`checked`),this.updateVisualState();let t=new CustomEvent(`change`,{detail:{checked:this._checked,value:this.getValue()},bubbles:!0,cancelable:!0});this.dispatchEvent(t)},this._checkbox.addEventListener(`change`,this._changeHandler),this._mousedownHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&!this.isDisabled()&&(t.classList.add(`mint-checkbox-active`),this._checked?(t.style.backgroundColor=`var(--mint-color-primary)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.3)`):(t.style.backgroundColor=`var(--mint-color-surface-hover)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.1)`))},this._mouseupHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&(t.classList.remove(`mint-checkbox-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._mouseleaveHandler=e=>{let t=this.querySelector(`.mint-checkbox-wrapper`);t&&(t.classList.remove(`mint-checkbox-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._checkbox.addEventListener(`mousedown`,this._mousedownHandler),this._checkbox.addEventListener(`mouseup`,this._mouseupHandler),this._checkbox.addEventListener(`mouseleave`,this._mouseleaveHandler),this._touchstartHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&!this.isDisabled()&&(t.classList.add(`mint-checkbox-active`),this._checked?(t.style.backgroundColor=`var(--mint-color-primary)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.3)`):(t.style.backgroundColor=`var(--mint-color-surface-hover)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.1)`))},this._touchendHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&(t.classList.remove(`mint-checkbox-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._checkbox.addEventListener(`touchstart`,this._touchstartHandler),this._checkbox.addEventListener(`touchend`,this._touchendHandler))}removeEventListeners(){this._checkbox&&(this._changeHandler&&=(this._checkbox.removeEventListener(`change`,this._changeHandler),null),this._mousedownHandler&&=(this._checkbox.removeEventListener(`mousedown`,this._mousedownHandler),null),this._mouseupHandler&&=(this._checkbox.removeEventListener(`mouseup`,this._mouseupHandler),null),this._mouseleaveHandler&&=(this._checkbox.removeEventListener(`mouseleave`,this._mouseleaveHandler),null),this._touchstartHandler&&=(this._checkbox.removeEventListener(`touchstart`,this._touchstartHandler),null),this._touchendHandler&&=(this._checkbox.removeEventListener(`touchend`,this._touchendHandler),null))}updateVisualState(){let e=this.querySelector(`.mint-checkbox-wrapper`),t=e?.querySelector(`mint-icon`);t&&(t.style.opacity=this._checked?`1`:`0`,t.style.transform=this._checked?`scale(1)`:`scale(0.8)`),e&&(e.className=`mint-checkbox-wrapper ${this.getCheckboxClasses()}`,e.classList.contains(`mint-checkbox-active`)||(e.style.backgroundColor=``,e.style.boxShadow=``))}toggle(){if(this._checkbox&&!this.isDisabled()){this._checkbox.checked=!this._checked,this._checked=this._checkbox.checked,this._checked?this.hasAttribute(`checked`)||this.setAttribute(`checked`,``):this.hasAttribute(`checked`)&&this.removeAttribute(`checked`),this.updateVisualState();let e=new CustomEvent(`change`,{detail:{checked:this._checked},bubbles:!0,cancelable:!0});this.dispatchEvent(e)}}};typeof customElements<`u`&&!customElements.get(`mint-checkbox`)&&a(`mint-checkbox`,Jt);var Yt=class extends HTMLElement{static get observedAttributes(){return[`checked`,`disabled`,`label`,`info`,`id`,`name`,`value`,`required`]}constructor(){super(),this._radio=null,this._checked=!1,this._groupMode=!1,this._groupChangeHandler=null,this._groupObserver=null}connectedCallback(){if(this._activateGroupModeIfNeeded(),this._groupObserver=new MutationObserver(()=>this._activateGroupModeIfNeeded()),this._groupObserver.observe(this,{childList:!0,subtree:!0}),this._groupMode)return;let e=this.getAttribute(`checked`);this._checked=e!==null&&e!==`false`,this.render()}disconnectedCallback(){this.removeEventListeners(),this._groupChangeHandler&&=(this.removeEventListener(`choice-option-change`,this._groupChangeHandler),null),this._groupObserver?.disconnect(),this._groupObserver=null}attributeChangedCallback(e,t,n){if(this._groupMode){t!==n&&this.renderGroup();return}e===`checked`&&(this._checked=n!==null&&n!==`false`,this._radio&&(this._radio.checked=this._checked)),t!==n&&(this.render(),e===`checked`&&this._radio&&this.updateVisualState())}get checked(){return this._checked}set checked(e){e?this.setAttribute(`checked`,``):this.removeAttribute(`checked`),this._checked=!!e,this._radio&&(this._radio.checked=this._checked),this.updateVisualState()}isDisabled(){return this.hasAttribute(`disabled`)}getLabel(){return this.getAttribute(`label`)||``}getInfo(){return this.getAttribute(`info`)||``}getId(){return this.getAttribute(`id`)||``}getName(){return this.getAttribute(`name`)||``}getValue(){return this._groupMode?this.querySelector(`mint-choice-option input[type="radio"]:checked`)?.value||this.getAttribute(`value`)||``:this.getAttribute(`value`)||``}set value(e){this.setValue(e)}get value(){return this.getValue()}setValue(e){if(!this._groupMode){e?this.setAttribute(`value`,e):this.removeAttribute(`value`);return}let t=e==null?``:String(e);this.querySelectorAll(`mint-choice-option`).forEach(e=>{let n=e.getAttribute(`value`)===t,r=e.querySelector(`input[type="radio"]`);r&&(r.checked=n),e.toggleAttribute(`checked`,n)}),t?this.setAttribute(`value`,t):this.removeAttribute(`value`)}renderGroup(){this.classList.add(`mint-choice-group`),this.setAttribute(`role`,`radiogroup`);let e=this.getAttribute(`label`)||``,t=this.querySelector(`:scope > .mint-choice-group-label`);e&&!t&&(t=document.createElement(`div`),t.className=`mint-choice-group-label`,this.insertBefore(t,this.firstChild)),t&&(e?t.textContent=e:t.remove());let n=this.querySelector(`:scope > .mint-choice-options`);n||(n=document.createElement(`div`),n.className=`mint-choice-options`,t?.parentElement===this?this.insertBefore(n,t.nextSibling):this.insertBefore(n,this.firstChild)),Array.from(this.children).filter(e=>e.tagName===`MINT-CHOICE-OPTION`&&e.parentElement!==n).forEach(e=>n.appendChild(e)),this.querySelectorAll(`mint-choice-option`).forEach(e=>e.render());let r=this.getAttribute(`value`);r&&this.setValue(r)}_activateGroupModeIfNeeded(){this._groupMode||!this.querySelector(`mint-choice-option`)||(this._groupMode=!0,this.removeEventListeners(),this.querySelector(`.mint-choice-wrapper`)?.remove(),this.querySelector(`.mint-choice-label-container`)?.remove(),this._radio=null,this._groupChangeHandler=e=>{let t=e.target.closest?.(`mint-choice-option`);if(!t||!this.contains(t))return;let n=t.getAttribute(`value`)||``;n?this.setAttribute(`value`,n):this.removeAttribute(`value`),this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0})),this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0}))},this.addEventListener(`choice-option-change`,this._groupChangeHandler),this.renderGroup())}getChoiceClasses(){return`mint-choice-control`}render(){if(this._groupMode){this.renderGroup();return}let e=this.getLabel(),t=this.getInfo(),n=this.isDisabled(),r=this.querySelector(`.mint-choice-wrapper`);r||(r=document.createElement(`div`),r.className=`mint-choice-wrapper`,this.insertBefore(r,this.firstChild)),this._radio?this._radio.parentElement!==r&&r.appendChild(this._radio):(this._radio=document.createElement(`input`),this._radio.type=`radio`,r.appendChild(this._radio),this.setupEventListeners()),this._radio.className=`mint-input-overlay`,this._radio.style.cssText=`position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; pointer-events: auto; margin: 0; padding: 0;`,this._radio.checked=this._checked,this._radio.disabled=n,this._changeHandler||this.setupEventListeners();let i=this.getId();i?this._radio.id=i:this._radio.removeAttribute(`id`);let a=this.getName();a?this._radio.name=a:this._radio.removeAttribute(`name`);let o=this.getValue();o?this._radio.value=o:this._radio.removeAttribute(`value`),e?this._radio.setAttribute(`aria-label`,e):this._radio.removeAttribute(`aria-label`),r.className=`mint-choice-wrapper ${this.getChoiceClasses()}`,r.style.pointerEvents=`none`,this._radio.style.pointerEvents=`auto`;let s=r.querySelector(`.mint-choice-indicator`);s||(s=document.createElement(`div`),s.className=`mint-choice-indicator`,s.style.transition=`opacity 200ms ease-out, transform 200ms ease-out`,s.style.zIndex=`1`,r.appendChild(s)),s.style.opacity=this._checked?`1`:`0`,s.style.transform=this._checked?`scale(1)`:`scale(0.8)`,this.updateVisualState();let c=this.querySelector(`.mint-choice-label-container`);if(e||t){c||(c=document.createElement(`div`),c.className=`mint-choice-label-container`,this.appendChild(c));let r=c.querySelector(`.mint-choice-label`);e?(r||(r=document.createElement(`span`),r.className=`mint-choice-label`,c.insertBefore(r,c.firstChild)),r.textContent=e,n?r.style.opacity=`0.5`:r.style.opacity=``):r&&r.remove();let i=c.querySelector(`.mint-choice-info`);if(t?(i||(i=document.createElement(`span`),i.className=`mint-choice-info`,c.appendChild(i)),i.textContent=t,n?i.style.opacity=`0.5`:i.style.opacity=``):i&&i.remove(),n)c.style.cursor=`default`,c._clickHandler&&(c.removeEventListener(`click`,c._clickHandler),c._clickHandler=null);else{c.style.cursor=`pointer`;let e=c._clickHandler;e&&c.removeEventListener(`click`,e),c._clickHandler=e=>{this._radio&&(e.target===this._radio||this._radio.contains(e.target)||e.composedPath().includes(this._radio))||this.select()},c.addEventListener(`click`,c._clickHandler)}}else c&&c.remove()}setupEventListeners(){this.removeEventListeners(),this._radio&&(this._changeHandler=e=>{e.stopPropagation();let t=this._checked;if(this._checked=this._radio.checked,this._checked?this.hasAttribute(`checked`)||this.setAttribute(`checked`,``):this.hasAttribute(`checked`)&&this.removeAttribute(`checked`),this.updateVisualState(),this._checked){let e=this._radio.name;e&&document.querySelectorAll(`input[type="radio"][name="${e}"]`).forEach(e=>{if(e!==this._radio){let t=e.closest(`mint-choice`);t&&t.updateVisualState&&(t._checked=e.checked,e.checked?t.hasAttribute(`checked`)||t.setAttribute(`checked`,``):t.hasAttribute(`checked`)&&t.removeAttribute(`checked`),t.updateVisualState())}})}if(t!==this._checked){let e=new CustomEvent(`change`,{detail:{checked:this._checked,value:this.getValue()},bubbles:!0,cancelable:!0});this.dispatchEvent(e)}},this._radio.addEventListener(`change`,this._changeHandler),this._groupChangeHandler=e=>{e.target!==this._radio&&e.target.type===`radio`&&e.target.name===this._radio.name&&e.target.checked&&setTimeout(()=>{this._radio&&this._radio.checked!==this._checked&&(this._checked=this._radio.checked,this._checked?this.hasAttribute(`checked`)||this.setAttribute(`checked`,``):this.hasAttribute(`checked`)&&this.removeAttribute(`checked`),this.updateVisualState())},0)},document.addEventListener(`change`,this._groupChangeHandler,!0),this._clickHandler=e=>{let t=this._radio.name;t&&document.querySelectorAll(`input[type="radio"][name="${t}"]`).forEach(e=>{if(e!==this._radio){let t=e.closest(`mint-choice`);t&&t.updateVisualState&&(t._checked=e.checked,e.checked?t.hasAttribute(`checked`)||t.setAttribute(`checked`,``):t.hasAttribute(`checked`)&&t.removeAttribute(`checked`),t.updateVisualState())}}),requestAnimationFrame(()=>{this._checked=this._radio.checked,this.updateVisualState()})},this._radio.addEventListener(`click`,this._clickHandler),this._mousedownHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-choice-wrapper`);t&&!this.isDisabled()&&(t.classList.add(`mint-choice-active`),this._checked?(t.style.backgroundColor=`var(--mint-color-primary)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.3)`):(t.style.backgroundColor=`var(--mint-color-surface-hover)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.1)`))},this._mouseupHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-choice-wrapper`);t&&(t.classList.remove(`mint-choice-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._mouseleaveHandler=e=>{let t=this.querySelector(`.mint-choice-wrapper`);t&&(t.classList.remove(`mint-choice-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._radio.addEventListener(`mousedown`,this._mousedownHandler),this._radio.addEventListener(`mouseup`,this._mouseupHandler),this._radio.addEventListener(`mouseleave`,this._mouseleaveHandler),this._touchstartHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-choice-wrapper`);t&&!this.isDisabled()&&(t.classList.add(`mint-choice-active`),this._checked?(t.style.backgroundColor=`var(--mint-color-primary)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.3)`):(t.style.backgroundColor=`var(--mint-color-surface-hover)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.1)`))},this._touchendHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-choice-wrapper`);t&&(t.classList.remove(`mint-choice-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._radio.addEventListener(`touchstart`,this._touchstartHandler),this._radio.addEventListener(`touchend`,this._touchendHandler))}removeEventListeners(){this._radio&&(this._changeHandler&&=(this._radio.removeEventListener(`change`,this._changeHandler),null),this._groupChangeHandler&&=(document.removeEventListener(`change`,this._groupChangeHandler),null),this._clickHandler&&=(this._radio.removeEventListener(`click`,this._clickHandler),null),this._mousedownHandler&&=(this._radio.removeEventListener(`mousedown`,this._mousedownHandler),null),this._mouseupHandler&&=(this._radio.removeEventListener(`mouseup`,this._mouseupHandler),null),this._mouseleaveHandler&&=(this._radio.removeEventListener(`mouseleave`,this._mouseleaveHandler),null),this._touchstartHandler&&=(this._radio.removeEventListener(`touchstart`,this._touchstartHandler),null),this._touchendHandler&&=(this._radio.removeEventListener(`touchend`,this._touchendHandler),null))}updateVisualState(){let e=this.querySelector(`.mint-choice-wrapper`),t=e?.querySelector(`.mint-choice-indicator`);t&&(t.style.opacity=this._checked?`1`:`0`,t.style.transform=this._checked?`scale(1)`:`scale(0.8)`),e&&(e.className=`mint-choice-wrapper ${this.getChoiceClasses()}`,e.classList.contains(`mint-choice-active`)||(e.style.backgroundColor=``,e.style.boxShadow=``))}select(){if(this._radio&&!this.isDisabled()){this._radio.checked=!0,this._radio.dispatchEvent(new Event(`change`,{bubbles:!0})),this._checked=!0,this.hasAttribute(`checked`)||this.setAttribute(`checked`,``);let e=this._radio.name;e&&document.querySelectorAll(`input[type="radio"][name="${e}"]`).forEach(e=>{if(e!==this._radio){let t=e.closest(`mint-choice`);t&&t.updateVisualState&&(t._checked=e.checked,e.checked?t.hasAttribute(`checked`)||t.setAttribute(`checked`,``):t.hasAttribute(`checked`)&&t.removeAttribute(`checked`),t.updateVisualState())}}),this.updateVisualState();let t=new CustomEvent(`change`,{detail:{checked:this._checked,value:this.getValue()},bubbles:!0,cancelable:!0});this.dispatchEvent(t)}}},Xt=class extends HTMLElement{static get observedAttributes(){return[`value`,`checked`,`disabled`]}constructor(){super(),this._labelText=``,this._radio=null,this._changeHandler=null}connectedCallback(){this.render()}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this.render()}render(){let e=this.closest(`mint-choice`),t=this.querySelector(`.mint-choice-option-label`);this._labelText||=t?.textContent?.trim()||this.textContent.trim();let n=this.querySelector(`:scope > .mint-choice-option-control`);n||(n=document.createElement(`label`),n.className=`mint-choice-option-control`,this.replaceChildren(n)),this._radio||(this._radio=document.createElement(`input`),this._radio.type=`radio`,this._radio.className=`mint-choice-option-input`,n.appendChild(this._radio),this._changeHandler=()=>{this._radio?.checked&&e&&(e.setValue(this.getAttribute(`value`)||``),e.dispatchEvent(new CustomEvent(`choice-option-change`,{detail:{value:this.getAttribute(`value`)||``,option:this},bubbles:!1})))},this._radio.addEventListener(`change`,this._changeHandler)),this._radio.name=e?.getAttribute(`name`)||``,this._radio.value=this.getAttribute(`value`)||``,this._radio.disabled=this.hasAttribute(`disabled`)||e?.hasAttribute(`disabled`)||!1,this._radio.required=e?.hasAttribute(`required`)||!1,this._radio.checked=this.hasAttribute(`checked`)||e?.getAttribute(`value`)===this._radio.value;let r=n.querySelector(`.mint-choice-option-label`);r||(r=document.createElement(`span`),r.className=`mint-choice-option-label`,n.appendChild(r)),r.textContent=this._labelText}};typeof customElements<`u`&&!customElements.get(`mint-choice`)&&a(`mint-choice`,Yt),typeof customElements<`u`&&!customElements.get(`mint-choice-option`)&&a(`mint-choice-option`,Xt),s({name:`arrow-left`,viewBox:`0 0 24 24`,path:`M19 12H5m7-7l-7 7 7 7`,strokeLinecap:`round`,strokeLinejoin:`round`});var Zt=class extends HTMLElement{static get observedAttributes(){return[`variant`,`tone`,`disabled`,`loading`,`button-type`,`type`,`full-width`,`icon-position`,`icon`]}constructor(){super(),this._button=null,this._clickHandler=null,this._isHandlingClick=!1}connectedCallback(){this.render(),this._button&&this.setupEventListeners()}disconnectedCallback(){this.removeEventListeners()}attributeChangedCallback(e,t,n){t!==n&&this.render()}getVariant(){return this.getAttribute(`variant`)||`solid`}getTone(){return this.getAttribute(`tone`)||`neutral`}isDisabled(){return this.hasAttribute(`disabled`)}isLoading(){return this.hasAttribute(`loading`)}getType(){return(this.getAttribute(`type`)||this.getAttribute(`button-type`)||`default`)===`submit`?`submit`:`button`}isFullWidth(){return this.hasAttribute(`full-width`)}getIconPosition(){return this.getAttribute(`icon-position`)||`left`}getIcon(){return this.getAttribute(`icon`)||``}isIconOnly(){if(!(this.getIcon()||this._button?.querySelector(`[slot="icon"], .mint-button-icon, mint-icon`)))return!1;let e=this._button?.querySelector(`.mint-button-content`);if(e&&e.textContent.trim())return!1;if(this._button){for(let e=this._button.firstChild;e;e=e.nextSibling)if(e.nodeType===Node.TEXT_NODE&&e.textContent.trim()||e.nodeType===Node.ELEMENT_NODE&&e.tagName!==`MINT-ICON`&&e.tagName!==`MINT-SPINNER`&&!e.querySelector?.(`mint-spinner`)&&!e.hasAttribute?.(`slot`)&&e.className!==`mint-button-icon`&&!(e.className===`mr-2`&&e.querySelector(`mint-spinner`))&&e.textContent.trim())return!1}return!0}getButtonClasses(){return[`mint-button-core`,`mint-button-`+this.getVariant(),`mint-button-tone-`+this.getTone(),this.isIconOnly()?`mint-button-icon-only`:``,this.isFullWidth()?`mint-button-full-width`:``].filter(Boolean).join(` `)}render(){let e=this.isDisabled()||this.isLoading(),t=this.getType();if(!this._button){for(this._button=document.createElement(`button`);this.firstChild;)this._button.appendChild(this.firstChild);this.appendChild(this._button),this.setupEventListeners()}this._button.type=t,this._button.disabled=e;let n=this._button.querySelector(`mint-spinner`);if(this.isLoading())if(n)n.setAttribute(`data-button-variant`,this.getVariant()),n.setAttribute(`data-button-tone`,this.getTone()),n.render();else{let e=document.createElement(`span`);e.className=`mint-spinner-wrap`;let t=document.createElement(`mint-spinner`);t.setAttribute(`size`,`default`),t.setAttribute(`data-button-variant`,this.getVariant()),t.setAttribute(`data-button-tone`,this.getTone()),t.style.width=`0.875rem`,t.style.height=`0.875rem`,e.appendChild(t),this._button.insertBefore(e,this._button.firstChild)}else n&&n.parentElement?.remove();for(;this.firstChild&&this.firstChild!==this._button;)this._button.appendChild(this.firstChild);let r=this.getIcon(),i=this._button.querySelector(`[slot="icon"], .mint-button-icon, mint-icon`);r?(i&&i.tagName!==`MINT-ICON`&&(i.remove(),i=null),!i||i.tagName!==`MINT-ICON`?(i=document.createElement(`mint-icon`),i.setAttribute(`name`,r),i.className=`mint-button-icon`):i.setAttribute(`name`,r)):i&&i.tagName===`MINT-ICON`&&(i.remove(),i=null),i||=this._button.querySelector(`[slot="icon"], .mint-button-icon`);let a=this.getIconPosition(),o=this._button.querySelector(`.mint-button-content`);if(o){let e=i&&i.tagName===`MINT-ICON`;if(i&&!i.parentElement){let t=this._button.querySelector(`mint-spinner`)?.parentElement;e||a===`left`?t?t.insertAdjacentElement(`afterend`,i):this._button.insertBefore(i,o):o.insertAdjacentElement(`afterend`,i)}else if(i&&(e||a===`left`)&&i.nextSibling!==o){i.remove();let e=this._button.querySelector(`mint-spinner`)?.parentElement;e?e.insertAdjacentElement(`afterend`,i):this._button.insertBefore(i,o)}else i&&!e&&a===`right`&&i.previousSibling!==o&&(i.remove(),o.insertAdjacentElement(`afterend`,i))}else{let e=[];for(let t=this._button.firstChild;t;t=t.nextSibling)t.tagName!==`MINT-SPINNER`&&!t.querySelector?.(`mint-spinner`)&&t!==i&&!t.hasAttribute?.(`slot`)&&!(t.className===`mr-2`&&t.querySelector(`mint-spinner`))&&e.push(t);if(e.length>0){o=document.createElement(`span`),o.className=`mint-button-content`,e.forEach(e=>{o.appendChild(e)});let t=this._button.querySelector(`mint-spinner`)?.parentElement;i&&a===`left`?t?(t.insertAdjacentElement(`afterend`,i),i.insertAdjacentElement(`afterend`,o)):(this._button.insertBefore(i,this._button.firstChild),i.insertAdjacentElement(`afterend`,o)):i&&a===`right`?t?(t.insertAdjacentElement(`afterend`,o),o.insertAdjacentElement(`afterend`,i)):(this._button.insertBefore(o,this._button.firstChild),o.insertAdjacentElement(`afterend`,i)):t?t.insertAdjacentElement(`afterend`,o):this._button.insertBefore(o,this._button.firstChild)}else if(i&&i.tagName===`MINT-ICON`&&!i.parentElement){let e=this._button.querySelector(`mint-spinner`)?.parentElement;e?e.insertAdjacentElement(`afterend`,i):this._button.insertBefore(i,this._button.firstChild)}}let s=this.isIconOnly();i&&(i.classList.contains(`mint-button-icon`)||i.classList.add(`mint-button-icon`),i.classList.remove(`mint-icon-leading`,`mint-icon-trailing`),s?i.tagName===`MINT-ICON`?(i.style.width=`1rem`,i.style.height=`1rem`,i.style.maxWidth=`1rem`,i.style.maxHeight=`1rem`,i.style.flexShrink=`0`):(i.style.maxWidth=`1rem`,i.style.maxHeight=`1rem`,i.style.flexShrink=`0`,i.tagName===`svg`&&(i.style.width=`1rem`,i.style.height=`1rem`)):a===`left`?i.classList.add(`mint-icon-leading`):i.classList.add(`mint-icon-trailing`));let c=this.getButtonClasses();this._button.className=c}setupEventListeners(){this._button&&!this._clickHandler&&(this._clickHandler=this.handleClick.bind(this),this._button.addEventListener(`click`,this._clickHandler,!0),this._button.addEventListener(`mousedown`,this._handleMouseDown),this._button.addEventListener(`mouseup`,this._handleMouseUp),this._button.addEventListener(`mouseleave`,this._handleMouseLeave),this._button.addEventListener(`touchstart`,this._handleTouchStart),this._button.addEventListener(`touchend`,this._handleTouchEnd),this._button.addEventListener(`touchcancel`,this._handleTouchCancel))}removeEventListeners(){this._button&&(this._clickHandler&&=(this._button.removeEventListener(`click`,this._clickHandler,!0),null),this._button.removeEventListener(`mousedown`,this._handleMouseDown),this._button.removeEventListener(`mouseup`,this._handleMouseUp),this._button.removeEventListener(`mouseleave`,this._handleMouseLeave),this._button.removeEventListener(`touchstart`,this._handleTouchStart),this._button.removeEventListener(`touchend`,this._handleTouchEnd),this._button.removeEventListener(`touchcancel`,this._handleTouchCancel))}_handleMouseDown=()=>{this._button&&!this.isDisabled()&&!this.isLoading()&&this._button.classList.add(`mint-button-active`)};_handleMouseUp=()=>{this._button&&this._button.classList.remove(`mint-button-active`)};_handleMouseLeave=()=>{this._button&&this._button.classList.remove(`mint-button-active`)};_handleTouchStart=()=>{this._button&&!this.isDisabled()&&!this.isLoading()&&this._button.classList.add(`mint-button-active`)};_handleTouchEnd=()=>{this._button&&this._button.classList.remove(`mint-button-active`)};_handleTouchCancel=()=>{this._button&&this._button.classList.remove(`mint-button-active`)};handleClick(e){if(this.isDisabled()||this.isLoading()){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();return}if(e.stopPropagation(),e.stopImmediatePropagation(),this._isHandlingClick){e.preventDefault();return}this._isHandlingClick=!0,e.preventDefault(),this.dispatchEvent(new CustomEvent(`click`,{detail:{originalEvent:e},bubbles:!0,cancelable:!0,composed:!0})),requestAnimationFrame(()=>{this._isHandlingClick=!1})}};typeof customElements<`u`&&!customElements.get(`mint-button`)&&a(`mint-button`,Zt);var Qt=class extends HTMLElement{static get observedAttributes(){return[`href`,`fallback-href`]}constructor(){super(),this._historyDepth=0,this._maxBackAttempts=10,this._backAttempts=0}connectedCallback(){this.render(),this._setupHistoryTracking()}attributeChangedCallback(e,t,n){t!==n&&this.render()}_setupHistoryTracking(){window.addEventListener(`popstate`,()=>{this._backAttempts=0}),this._historyDepth=window.history.length}getFallbackHref(){return this.getAttribute(`fallback-href`)||this.getAttribute(`href`)||`/`}handleClick(e){if(e.preventDefault(),e.stopPropagation(),window.history.length>1&&this._backAttempts<this._maxBackAttempts&&this._backAttempts===0){this._backAttempts++;let e=window.location.href,t=Date.now();window.history.back(),setTimeout(()=>{Date.now()-t,window.location.href===e?this._navigateToFallback():setTimeout(()=>{this._backAttempts=0},500)},200)}else this._navigateToFallback()}_navigateToFallback(){let e=this.getFallbackHref();if(this._backAttempts=0,e.startsWith(`/`)&&!e.startsWith(`//`))try{window.history.pushState({},``,e),window.dispatchEvent(new PopStateEvent(`popstate`));return}catch{}window.location.href=e}render(){this._button||(this._button=document.createElement(`mint-button`),this._button.setAttribute(`variant`,`neutral`),this._button.setAttribute(`icon`,`arrow-left`),this._button.addEventListener(`click`,e=>this.handleClick(e)),this.appendChild(this._button))}};typeof customElements<`u`&&!customElements.get(`mint-back-button`)&&a(`mint-back-button`,Qt);var $t=0,en=class extends HTMLElement{static get observedAttributes(){return[`brand`,`brand-href`,`direction`,`label`,`open`,`fixed`]}constructor(){super(),this._built=!1,this._brand=null,this._brandLink=null,this._leadingActions=null,this._items=null,this._toggle=null,this._toggleLabel=null,this._mobileActions=null,this._mobileActionNodes=[],this._instanceId=++$t,this._dropdowns=[],this._content=null,this._actions=null,this._activeDropdown=null,this._layoutObserver=null}connectedCallback(){this._built||this._build(),this._observeDropdowns(),this._syncResponsiveDropdowns(),this._syncMobileActions(),typeof ResizeObserver<`u`&&(this._layoutObserver=new ResizeObserver(()=>{this._syncResponsiveDropdowns(),this._syncMobileActions()}),this._layoutObserver.observe(this)),this._syncAttributes()}disconnectedCallback(){for(let e of this._dropdowns)e.observer?.disconnect();this._layoutObserver?.disconnect(),this._layoutObserver=null}attributeChangedCallback(e,t,n){t===n||!this._built||(e===`open`?this._syncOpenState():this._syncAttributes())}getDirection(){return this.getAttribute(`direction`)===`vertical`?`vertical`:`horizontal`}getBrand(){return this.getAttribute(`brand`)||``}getBrandHref(){return this.getAttribute(`brand-href`)||`/`}getLabel(){return this.getAttribute(`label`)||`Primary navigation`}_build(){let e=Array.from(this.childNodes),t=e.find(e=>e.nodeType===Node.ELEMENT_NODE&&e.getAttribute(`slot`)===`brand`),n=e.filter(e=>e.nodeType===Node.ELEMENT_NODE&&e.getAttribute(`slot`)===`leading-actions`),r=e.filter(e=>e.nodeType===Node.ELEMENT_NODE&&[`actions`,`mobile-actions`].includes(e.getAttribute(`slot`)));this._mobileActionNodes=r.filter(e=>e.getAttribute(`slot`)===`mobile-actions`);let i=e.filter(e=>e!==t&&!n.includes(e)&&!r.includes(e));this.replaceChildren();let a=document.createElement(`div`);a.className=`mint-navigation-shell`;let o=document.createElement(`div`);o.className=`mint-navigation-bar`,this._leadingActions=document.createElement(`div`),this._leadingActions.className=`mint-navigation-leading-actions`;for(let e of n)e.removeAttribute(`slot`),this._leadingActions.appendChild(e);this._brand=document.createElement(`div`),this._brand.className=`mint-navigation-brand`,t?(t.removeAttribute(`slot`),this._brand.appendChild(t)):this.getBrand()&&(this._brandLink=document.createElement(`mint-link`),this._brandLink.className=`mint-navigation-brand-link`,this._brandLink.textContent=this.getBrand(),this._brandLink.setAttribute(`href`,this.getBrandHref()),this._brand.appendChild(this._brandLink)),this._toggle=document.createElement(`mint-button`),this._toggle.className=`mint-navigation-toggle`,this._toggle.setAttribute(`aria-expanded`,`false`),this._toggle.addEventListener(`click`,()=>this.toggleMenu()),this._toggleLabel=document.createElement(`span`),this._toggleLabel.className=`mint-navigation-visually-hidden`,this._toggleLabel.textContent=`Open navigation menu`,this._toggle.append(this._toggleLabel),this._toggle.setAttribute(`variant`,`ghost`),this._toggle.setAttribute(`tone`,`action`),this._toggle.setAttribute(`button-type`,`button`),this._toggle.setAttribute(`icon`,`menu`),this._mobileActions=document.createElement(`div`),this._mobileActions.className=`mint-navigation-mobile-actions`,o.append(this._leadingActions,this._brand,this._mobileActions,this._toggle);let s=document.createElement(`div`);this._content=s,s.className=`mint-navigation-content`,this._items=document.createElement(`nav`),this._items.className=`mint-navigation-items`,this._items.setAttribute(`aria-label`,this.getLabel()),this._items.addEventListener(`click`,e=>{e.target.closest(`a, mint-link`)&&this.closeMenu()});let c=0;for(let e of i)if(e.nodeType!==Node.ELEMENT_NODE)this._items.appendChild(e);else if(e.tagName===`DETAILS`){let t=this._createDropdown(e,c++);this._items.append(t.trigger,t.popover),this._registerDropdown(t.trigger,t.popover)}else{let t=this._toMintLink(e);if(this._items.appendChild(t),t.nodeType===Node.ELEMENT_NODE&&t.tagName===`MINT-POPOVER`){let e=t.getAttribute(`trigger-id`),n=Array.from(this._items.querySelectorAll(`mint-button`)).find(t=>t.id===e);this._registerDropdown(n,t)}}let l=document.createElement(`div`);this._actions=l,l.className=`mint-navigation-actions`;for(let e of r)e.removeAttribute(`slot`),l.appendChild(e);let u=document.createElement(`section`);u.className=`mint-navigation-submenu`,u.setAttribute(`aria-label`,`Navigation submenu`);let d=document.createElement(`div`);d.className=`mint-navigation-submenu-header`;let f=document.createElement(`mint-button`);f.className=`mint-navigation-submenu-back`,f.setAttribute(`variant`,`ghost`),f.setAttribute(`tone`,`action`),f.setAttribute(`button-type`,`button`),f.setAttribute(`icon`,`arrow-left`),f.setAttribute(`aria-label`,`Back to main navigation`),f.addEventListener(`click`,()=>this._closeSubmenu());let p=document.createElement(`h3`);p.className=`mint-navigation-submenu-title`,d.append(f,p);let m=document.createElement(`nav`);m.className=`mint-navigation-submenu-items`,m.addEventListener(`click`,e=>{e.target.closest(`a, mint-link`)&&this.closeMenu()}),u.append(d,m),this._submenu=u,this._submenuTitle=p,this._submenuItems=m;for(let e of this._dropdowns)m.append(...e.submenuItems);s.append(this._items,l,u),a.append(o,s),this.appendChild(a),this._built=!0,this._syncMobileActions()}_syncMobileActions(){if(!this._mobileActions||!this._actions)return;let e=this._isMobileLayout()?this._mobileActions:this._actions;for(let t of this._mobileActionNodes)e.appendChild(t)}_toMintLink(e){if(e.nodeType!==Node.ELEMENT_NODE||e.tagName!==`A`)return e;let t=document.createElement(`mint-link`);for(;e.firstChild;)t.appendChild(e.firstChild);for(let n of Array.from(e.attributes))n.name!==`slot`&&t.setAttribute(n.name,n.value);return t}_createDropdown(e,t){let n=e.querySelector(`:scope > summary`),r=document.createElement(`mint-button`),i=`mint-navigation-${this._instanceId}-dropdown-${t}`,a=`${i}-popover`;if(r.id=i,r.className=`mint-navigation-dropdown-trigger`,r.setAttribute(`aria-haspopup`,`dialog`),r.setAttribute(`aria-expanded`,`false`),r.setAttribute(`aria-controls`,a),n){for(;n.firstChild;)r.appendChild(n.firstChild);n.remove()}else r.textContent=e.getAttribute(`label`)||`More`;r.setAttribute(`variant`,`ghost`),r.setAttribute(`tone`,`action`),r.setAttribute(`button-type`,`button`),r.setAttribute(`icon-position`,`right`);let o=document.createElement(`mint-popover`);o.id=a,o.className=`mint-navigation-dropdown`,o.setAttribute(`trigger-id`,i),o.setAttribute(`direction`,`down`),o.setAttribute(`aria-label`,`${r.textContent.trim()} links`);for(let t of Array.from(e.childNodes))o.appendChild(this._toMintLink(t));return{trigger:r,popover:o,observer:null}}_registerDropdown(e,t){if(!e||!t)return;t.id||=`mint-navigation-${this._instanceId}-popover-${this._dropdowns.length}`,e.classList.add(`mint-navigation-dropdown-trigger`),e.setAttribute(`aria-haspopup`,`dialog`),e.setAttribute(`aria-expanded`,String(t.hasAttribute(`open`))),e.setAttribute(`aria-controls`,t.id),t.classList.add(`mint-navigation-dropdown`),t.hasAttribute(`role`)||t.setAttribute(`role`,`group`),t.hasAttribute(`aria-label`)||t.setAttribute(`aria-label`,`${e.textContent.trim()} links`);let n=Array.from(t.querySelectorAll(`mint-link`)).map(e=>e.cloneNode(!0)),r={trigger:e,popover:t,observer:null,triggerId:t.getAttribute(`trigger-id`)||e.id,submenuItems:n};e.addEventListener(`click`,()=>{this._isMobileLayout()&&this._openSubmenu(r)}),this._dropdowns.push(r)}_observeDropdowns(){for(let e of this._dropdowns)e.observer||(e.observer=new MutationObserver(()=>{e.trigger.setAttribute(`aria-expanded`,String(e.popover.hasAttribute(`open`)))}),e.observer.observe(e.popover,{attributes:!0,attributeFilter:[`open`]}))}_isMobileLayout(){return this.getBoundingClientRect().width<=640}_syncResponsiveDropdowns(){let e=this._isMobileLayout();for(let t of this._dropdowns)e?(t.popover.hasAttribute(`open`)&&t.popover.close(),t.popover.getAttribute(`trigger-id`)&&t.popover.setAttribute(`trigger-id`,``)):t.triggerId&&t.popover.getAttribute(`trigger-id`)!==t.triggerId&&t.popover.setAttribute(`trigger-id`,t.triggerId);!e&&this._activeDropdown&&this._closeSubmenu()}_openSubmenu(e){this._isMobileLayout()&&(this._activeDropdown&&this._activeDropdown!==e&&this._activeDropdown.trigger.setAttribute(`aria-expanded`,`false`),this._activeDropdown=e,e.trigger.setAttribute(`aria-expanded`,`true`),this._submenuTitle.textContent=e.trigger.textContent.trim(),this._submenuItems.replaceChildren(...e.submenuItems),this._content.setAttribute(`data-submenu-open`,``))}_closeSubmenu(){this._activeDropdown?.trigger.setAttribute(`aria-expanded`,`false`),this._activeDropdown=null,this._content?.removeAttribute(`data-submenu-open`)}_syncAttributes(){if(this._brandLink){this._brandLink.setAttribute(`href`,this.getBrandHref());let e=this._brandLink.querySelector(`a`);e?e.textContent=this.getBrand():this._brandLink.textContent=this.getBrand()}this._items&&this._items.setAttribute(`aria-label`,this.getLabel()),this._syncOpenState()}_syncOpenState(){if(!this._toggle)return;let e=this.hasAttribute(`open`);this._toggle.setAttribute(`aria-expanded`,String(e));let t=e?`Close navigation menu`:`Open navigation menu`;this._toggle.setAttribute(`aria-label`,t),this._toggleLabel&&(this._toggleLabel.textContent=t),this._toggle.setAttribute(`icon`,e?`close`:`menu`)}openMenu(){this.setAttribute(`open`,``)}closeMenu(){this._closeSubmenu(),this.removeAttribute(`open`)}toggleMenu(){this.hasAttribute(`open`)?this.closeMenu():this.openMenu()}};typeof customElements<`u`&&!customElements.get(`mint-navigation`)&&a(`mint-navigation`,en),s({name:`info`,viewBox:`0 0 24 24`,path:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`}),s({name:`success`,viewBox:`0 0 24 24`,path:`M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`}),s({name:`warning`,viewBox:`0 0 24 24`,path:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z`,strokeLinecap:`round`,strokeLinejoin:`round`}),s({name:`error`,viewBox:`0 0 24 24`,path:`M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`}),s({name:`close`,viewBox:`0 0 24 24`,path:`M6 18L18 6M6 6l12 12`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3.2`});var tn=class extends HTMLElement{static get observedAttributes(){return[`heading`,`dismissable`,`tone`]}constructor(){super(),this._headingElement=null,this._iconElement=null,this._dismissButton=null,this._headerWrapper=null,this._bodyWrapper=null,this._dismissHandler=null,this._rendering=!1,this._childObserver=null,this._normalizingChildren=!1}connectedCallback(){this.render()}disconnectedCallback(){this._childObserver?.disconnect(),this._dismissButton?.removeEventListener(`click`,this._dismissHandler),this._dismissHandler=null}get heading(){return this.getAttribute(`heading`)??``}set heading(e){this.setAttribute(`heading`,String(e??``))}get tone(){return this.getTone()}set tone(e){this.setAttribute(`tone`,e)}get dismissable(){return this.isDismissable()}set dismissable(e){this.setAttribute(`dismissable`,String(!!e))}get dismissible(){return this.dismissable}set dismissible(e){this.dismissable=e}cleanupDismissListener(){this._dismissButton&&this._dismissHandler&&this._dismissButton.removeEventListener(`click`,this._dismissHandler),this._dismissHandler=null}attributeChangedCallback(e,t,n){t!==n&&this.render()}getHeading(){return this.getAttribute(`heading`)||``}getTone(){let e=this.getAttribute(`tone`);return e===`info`||e===`success`||e===`warning`||e===`danger`?e:`info`}isDismissable(){return this.getAttribute(`dismissable`)===`true`}getIconName(){switch(this.getTone()){case`info`:return`info`;case`success`:return`success`;case`warning`:return`warning`;case`danger`:return`error`;default:return`info`}}getAriaLive(){return this.getTone()===`danger`?`assertive`:`polite`}render(){if(!(this._rendering||!this.isConnected)){this._rendering=!0;try{this.renderContent()}finally{this._rendering=!1}}}renderContent(){this._childObserver?.disconnect();let e=this.getTone(),t=this.getHeading(),n=this.isDismissable(),r=this.getAriaLive();this.setAttribute(`role`,e===`danger`?`alert`:`status`),this.setAttribute(`aria-live`,r),e===`danger`?this.setAttribute(`aria-atomic`,`true`):this.removeAttribute(`aria-atomic`);let i=[];for(this._bodyWrapper?Array.from(this._bodyWrapper.childNodes).forEach(e=>{i.push(e)}):Array.from(this.childNodes).forEach(e=>{e!==this._headerWrapper&&e!==this._bodyWrapper&&e!==this._iconElement&&e!==this._headingElement&&e!==this._dismissButton&&i.push(e)}),this.cleanupDismissListener();this.firstChild;)this.removeChild(this.firstChild);if(this._headerWrapper=null,this._bodyWrapper=null,this._iconElement=null,this._headingElement=null,this._dismissButton=null,this._headerWrapper=document.createElement(`div`),this._headerWrapper.className=`mint-alert-header`,this._iconElement=document.createElement(`mint-icon`),this._iconElement.setAttribute(`name`,this.getIconName()),this._iconElement.className=`mint-alert-icon`,this._headerWrapper.appendChild(this._iconElement),this._headingElement=document.createElement(`mint-text`),this._headingElement.className=`mint-alert-heading`,this._headingElement.textContent=t||``,this._headerWrapper.appendChild(this._headingElement),n){this._dismissButton=document.createElement(`button`),this._dismissButton.className=`mint-alert-dismiss`,this._dismissButton.setAttribute(`aria-label`,`Dismiss alert`),this._dismissButton.setAttribute(`type`,`button`);let e=document.createElement(`mint-icon`);e.setAttribute(`name`,`close`),e.className=`mint-alert-close-icon`,this._dismissButton.appendChild(e),this._dismissHandler=e=>{e.preventDefault(),e.stopPropagation(),this.dispatchEvent(new CustomEvent(`dismissed`,{bubbles:!0,composed:!0})),this.remove()},this._dismissButton.addEventListener(`click`,this._dismissHandler),this._headerWrapper.appendChild(this._dismissButton)}this._bodyWrapper=document.createElement(`div`),this._bodyWrapper.className=`mint-alert-body`,i.forEach(e=>{this._bodyWrapper.appendChild(e)}),this.appendChild(this._headerWrapper),this.appendChild(this._bodyWrapper),this._childObserver||=new MutationObserver(()=>this.normalizeConsumerChildren()),this._childObserver.observe(this,{childList:!0})}normalizeConsumerChildren(){if(!(this._normalizingChildren||!this._bodyWrapper)){this._normalizingChildren=!0;try{Array.from(this.childNodes).forEach(e=>{e!==this._headerWrapper&&e!==this._bodyWrapper&&this._bodyWrapper.appendChild(e)})}finally{this._normalizingChildren=!1}}}};customElements.get(`mint-alert`)||a(`mint-alert`,tn);var H=class extends HTMLElement{constructor(...e){super(...e),this._lastScrollY=0,this._scrollHandler=null}connectedCallback(){this.classList.add(`mint-bottom-navigation`),this.setAttribute(`role`,`navigation`),this.hasAttribute(`aria-label`)||this.setAttribute(`aria-label`,`Primary`),this._lastScrollY=window.scrollY,this.hasAttribute(`data-preview`)||this._attachScrollListener()}disconnectedCallback(){this._detachScrollListener()}_attachScrollListener(){this._scrollHandler||(this._scrollHandler=()=>{let e=window.scrollY;if(e<=8){this.classList.remove(`is-hidden`),this._lastScrollY=e;return}let t=e-this._lastScrollY;Math.abs(t)<4||(t>0?this.classList.add(`is-hidden`):this.classList.remove(`is-hidden`),this._lastScrollY=e)},window.addEventListener(`scroll`,this._scrollHandler,{passive:!0}))}_detachScrollListener(){this._scrollHandler&&=(window.removeEventListener(`scroll`,this._scrollHandler),null)}};customElements.get(`mint-bottom-navigation`)||a(`mint-bottom-navigation`,H);var nn=class extends HTMLElement{constructor(...e){super(...e),this._root=null}static get observedAttributes(){return[`icon`,`label`,`href`,`active`]}connectedCallback(){this.classList.add(`mint-bottom-nav-item`),this.render()}attributeChangedCallback(e,t,n){t!==n&&this.render()}_isActive(){return this.hasAttribute(`active`)&&this.getAttribute(`active`)!==`false`}_getLabel(){return this.getAttribute(`label`)||``}_getIcon(){return this.getAttribute(`icon`)||``}_getHref(){return this.getAttribute(`href`)}render(){let e=this._getHref(),t=this._getLabel(),n=this._getIcon(),r=this._isActive(),i;e?(i=document.createElement(`a`),i.href=e):(i=document.createElement(`button`),i.type=`button`),i.className=`mint-bottom-nav-link`,i.setAttribute(`aria-current`,r?`page`:`false`);let a=n.split(`-`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `);i.setAttribute(`aria-label`,t||a||`Navigation item`);let o=document.createElement(`span`);if(o.className=`mint-bottom-nav-icon`,n){let e=document.createElement(`mint-icon`);e.setAttribute(`name`,n),e.className=`mint-bottom-nav-icon-glyph`,o.appendChild(e)}let s=document.createElement(`span`);s.className=`mint-bottom-nav-label`,s.textContent=t,i.appendChild(o),i.appendChild(s),this.replaceChildren(i),this._root=i}};customElements.get(`mint-bottom-nav-item`)||a(`mint-bottom-nav-item`,nn);var rn=H,an=class e extends HTMLElement{static get observedAttributes(){return[`type`,`data`,`width`,`height`,`show-legend`,`show-grid`,`show-tooltip`,`curve-tension`]}static{this.MAX_CACHE_SIZE=100}constructor(){super(),this._chartContainer=null,this._svg=null,this._tooltip=null,this._chartType=`line`,this._chartData=null,this._width=800,this._height=400,this._padding={top:20,right:20,bottom:60,left:60},this._showLegend=!0,this._showGrid=!0,this._showTooltip=!0,this._curveTension=.5,this._dataObserver=null,this._darkModeObserver=null,this._tooltipHideTimeout=null,this._lastTooltipContent=``,this._activeXValue=null,this._pinnedXValue=null,this._tooltipAnimationFrame=null,this._cachedTooltipContent=new Map,this._cachedXPositions=new Map,this._verticalLine=null,this._plotPoints=new Map,this._resizeObserver=null,this._windowResizeHandler=null,this._pieChartTimeouts=new Set,this._pieChartTooltipShown=!1,this._pieChartClickOutsideHandler=null,this._pieChartGroup=null,this._chartClickOutsideHandler=null,this._chartTooltipScrollHandler=null,this._cachedBounds={bounds:null,dataHash:``},this._cachedYRange={range:null,dataHash:``},this._cachedXValues={values:null,dataHash:``},this._renderScheduled=!1,this._animateNextRender=!1,this._observedDataReference=null,this._observedDataFingerprint=``,this._datasetVisibility=new Map,this._widthValue=`100%`,this._heightValue=400,this._defaultColors=[`#2563eb`,`#3b82f6`,`#0d9488`,`#7c3aed`,`#d97706`,`#059669`,`#dc2626`,`#c026d3`],this._legendHeight=0,this._rotatedLabelHeight=0}connectedCallback(){this.classList.add(`box-border`,`m-0`,`p-0`,`border-0`,`align-baseline`,`block`,`w-full`),this._setupDataObserver(),this._setupDarkModeObserver(),this._setupResizeObserver(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.render()})})}_setupDataObserver(){let e=()=>{if(!this.isConnected)return;let e=this.data,t=null;e&&typeof e==`object`&&!Array.isArray(e)&&`datasets`in e&&(t=e);let n=``;if(t)try{n=JSON.stringify(t)}catch{n=``}t&&(t!==this._observedDataReference||n&&n!==this._observedDataFingerprint)&&(this._observedDataReference=t,this._observedDataFingerprint=n,this._chartData=t,this._animateNextRender=!0,this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this.render())};requestAnimationFrame(()=>{e(),requestAnimationFrame(()=>{e()})});let t=setInterval(()=>{if(!this.isConnected){clearInterval(t);return}e()},250);this._dataCheckInterval=t}_setupDarkModeObserver(){this._darkModeObserver=new MutationObserver(()=>{this.isConnected&&this.render()}),this._darkModeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]})}disconnectedCallback(){if(this._tooltip&&this._tooltip.parentNode&&(this._tooltip.parentNode.removeChild(this._tooltip),this._tooltip=null),this._tooltipHideTimeout!==null&&(clearTimeout(this._tooltipHideTimeout),this._tooltipHideTimeout=null),this._pieChartTimeouts.forEach(e=>clearTimeout(e)),this._pieChartTimeouts.clear(),this._pieChartClickOutsideHandler&&=(document.removeEventListener(`click`,this._pieChartClickOutsideHandler,!0),null),this._chartClickOutsideHandler&&=(document.removeEventListener(`click`,this._chartClickOutsideHandler,!0),null),this._pieChartTooltipShown=!1,this._pieChartGroup=null,this._pinnedXValue=null,this._tooltipAnimationFrame!==null&&(cancelAnimationFrame(this._tooltipAnimationFrame),this._tooltipAnimationFrame=null),this._dataObserver&&=(this._dataObserver.disconnect(),null),this._darkModeObserver&&=(this._darkModeObserver.disconnect(),null),this._dataCheckInterval&&=(clearInterval(this._dataCheckInterval),null),this._svg&&(this._chartTooltipMouseMove&&=(this._svg.removeEventListener(`mousemove`,this._chartTooltipMouseMove),null),this._chartTooltipMouseLeave&&=(this._svg.removeEventListener(`mouseleave`,this._chartTooltipMouseLeave),null),this._chartTooltipTouchStart&&=(this._svg.removeEventListener(`touchstart`,this._chartTooltipTouchStart),null),this._chartTooltipTouchMove&&=(this._svg.removeEventListener(`touchmove`,this._chartTooltipTouchMove),null),this._chartTooltipTouchEnd&&=(this._svg.removeEventListener(`touchend`,this._chartTooltipTouchEnd),null)),this._chartTooltipScrollHandler){window.removeEventListener(`scroll`,this._chartTooltipScrollHandler,!0),this._chartContainer&&this._chartContainer.removeEventListener(`scroll`,this._chartTooltipScrollHandler,!0);let e=this.parentElement;for(;e;)e.removeEventListener(`scroll`,this._chartTooltipScrollHandler,!0),e=e.parentElement;this._chartTooltipScrollHandler=null}this._resizeObserver&&=(this._resizeObserver.disconnect(),null),this._windowResizeHandler&&=(window.removeEventListener(`resize`,this._windowResizeHandler),null),this._cachedTooltipContent.clear(),this._cachedXPositions.clear(),this._plotPoints.clear(),this._cachedBounds={bounds:null,dataHash:``},this._cachedYRange={range:null,dataHash:``},this._cachedXValues={values:null,dataHash:``}}_handleResize(){if(!this.isConnected)return;let e=this.getBoundingClientRect(),t=e.width||this.parentElement?.clientWidth||800,n=e.height||this.parentElement?.clientHeight||400,r=this._calculateDimension(this._widthValue,t,t),i=this._calculateDimension(this._heightValue,n,400);(r!==this._width||i!==this._height)&&(this._width=r,this._height=i,this.render())}_setupResizeObserver(){this._resizeObserver&&=(this._resizeObserver.disconnect(),null),this._windowResizeHandler&&=(window.removeEventListener(`resize`,this._windowResizeHandler),null);let e=null,t=()=>{e&&clearTimeout(e),e=window.setTimeout(()=>{this._handleResize()},100)};this._windowResizeHandler=t,this._resizeObserver=new ResizeObserver(()=>{t()}),this._resizeObserver.observe(this),window.addEventListener(`resize`,t)}attributeChangedCallback(e,t,n){if(t!==n){if(e===`data`){if(n)try{this._chartData=JSON.parse(n)}catch(e){console.error(`mint-chart: Invalid data JSON`,e),this._chartData=null}else this._chartData=null;this._invalidateDataCaches(),this._animateNextRender=!0}(e===`width`||e===`height`)&&this.isConnected&&(t&&t.endsWith(`%`))!==(n&&n.endsWith(`%`))&&this._setupResizeObserver(),this.isConnected&&requestAnimationFrame(()=>{this.render()})}}get type(){let e=this.getAttribute(`type`)||`line`;return e===`line`||e===`bar`||e===`area`||e===`pie`?e:`line`}set type(e){this.setAttribute(`type`,e)}get data(){return this._chartData}set data(e){if(typeof e==`string`)try{this._chartData=JSON.parse(e)}catch(e){console.error(`mint-chart: Invalid data JSON`,e),this._chartData=null}else this._chartData=e;this._invalidateDataCaches(),this._animateNextRender=!0,this.isConnected&&requestAnimationFrame(()=>{this.render()})}get width(){let e=this.getAttribute(`width`);if(!e)return this._widthValue;if(e.endsWith(`%`))return e;let t=parseInt(e,10);return isNaN(t)?this._widthValue:t}set width(e){this.setAttribute(`width`,e.toString())}get height(){let e=this.getAttribute(`height`);if(!e)return this._heightValue;if(e.endsWith(`%`))return e;let t=parseInt(e,10);return isNaN(t)?this._heightValue:t}set height(e){this.setAttribute(`height`,e.toString())}_calculateDimension(e,t,n){if(typeof e==`number`)return e;if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!isNaN(n))return t*n/100}return n}_scheduleRender(){this._animateNextRender=!0,this._syncObservedData(),!this._renderScheduled&&(this._renderScheduled=!0,requestAnimationFrame(()=>{this._renderScheduled=!1,this.render()}))}_invalidateDataCaches(){this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent?.clear()}_syncObservedData(){this._observedDataReference=this._chartData;try{this._observedDataFingerprint=this._chartData?JSON.stringify(this._chartData):``}catch{this._observedDataFingerprint=``}}_isDatasetVisible(e,t){if(e.id){let t=this._datasetVisibility.get(e.id);if(t!==void 0)return t}return e.visible!==!1}_initializeDatasetVisibility(){this._chartData&&this._chartData.datasets.forEach((e,t)=>{e.id&&(this._datasetVisibility.has(e.id)||this._datasetVisibility.set(e.id,e.visible!==!1))})}render(){if(!this.isConnected)return;let e=this._animateNextRender&&!window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches&&this._svg?this._svg.cloneNode(!0):null;this._animateNextRender=!1,this._plotPoints.clear(),this._activeXValue=null,this._cachedTooltipContent?.clear(),this._cachedXPositions?.clear(),this._chartType=this.type;let t=this.data;if(t&&typeof t==`object`&&!Array.isArray(t)&&`datasets`in t&&(this._chartData=t),!this._chartData){let e=this.getAttribute(`data`);if(e)try{this._chartData=JSON.parse(e)}catch(e){console.error(`mint-chart: Invalid data JSON`,e),this._chartData=null}}this._widthValue=this.width,this._heightValue=this.height;let n=this.getBoundingClientRect(),r=n.width||this.parentElement?.clientWidth||800,i=n.height||this.parentElement?.clientHeight||400;this._width=this._calculateDimension(this._widthValue,r,r),this._height=this._calculateDimension(this._heightValue,i,400),this._showLegend=this.getAttribute(`show-legend`)!==`false`,this._showGrid=this.getAttribute(`show-grid`)!==`false`,this._showTooltip=this.getAttribute(`show-tooltip`)!==`false`;let a=this.getAttribute(`curve-tension`);if(a!==null){let e=parseFloat(a);this._curveTension=isNaN(e)?.5:Math.max(0,Math.min(1,e))}else this._curveTension=.5;if(!this._chartData||!this._chartData.datasets||this._chartData.datasets.length===0){this.innerHTML=`<div class="p-4 text-gray-500">No chart data provided</div>`;return}this.innerHTML=``,this._chartContainer=document.createElement(`div`),this._chartContainer.className=`relative w-full`,this._chartContainer.style.position=`relative`,typeof this._widthValue==`string`&&this._widthValue.endsWith(`%`)?this._chartContainer.style.width=this._widthValue:this._chartContainer.style.width=`${this._width}px`,typeof this._heightValue==`string`&&this._heightValue.endsWith(`%`)?this._chartContainer.style.height=this._heightValue:this._chartContainer.style.height=`${this._height}px`,this.appendChild(this._chartContainer),this._svg=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`),this._svg.setAttribute(`width`,this._width.toString()),this._svg.setAttribute(`height`,this._height.toString()),this._svg.setAttribute(`viewBox`,`0 0 ${this._width} ${this._height}`),this._svg.setAttribute(`class`,`w-full h-full`),this._svg.setAttribute(`role`,`img`);let o=this._chartData.datasets.map(e=>e.name).filter(Boolean),s=this.getAttribute(`aria-label`)?.trim()||`${this.type} chart${o.length?` showing ${o.join(`, `)}`:``}. ${Math.max(0,...this._chartData.datasets.map(e=>e.data.length))} data points.`,c=`${this.id||`mint-chart-${Math.random().toString(36).slice(2,10)}`}-data`;this._svg.setAttribute(`aria-label`,s),this._svg.setAttribute(`aria-describedby`,c),this._chartContainer&&this._svg&&(e&&(e.style.position=`absolute`,e.style.inset=`0`,e.style.width=`100%`,e.style.height=`100%`,e.style.pointerEvents=`none`,e.style.zIndex=`1`,e.style.opacity=`1`,e.style.transition=`opacity 260ms ease`,this._chartContainer.appendChild(e),this._svg.style.position=`relative`,this._svg.style.zIndex=`0`,this._svg.style.opacity=`0`,this._svg.style.transition=`opacity 260ms ease`),this._chartContainer.appendChild(this._svg));let l=document.createElement(`table`);l.id=c,Object.assign(l.style,{position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,top:`0`,left:`0`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:`0`});let u=document.createElement(`caption`);u.textContent=`Data for ${s}`,l.appendChild(u);let d=document.createElement(`thead`),f=document.createElement(`tr`),p=document.createElement(`th`);p.scope=`col`,p.textContent=`Category`,f.appendChild(p),this._chartData.datasets.forEach(e=>{let t=document.createElement(`th`);t.scope=`col`,t.textContent=e.name||`Series`,f.appendChild(t)}),d.appendChild(f),l.appendChild(d);let m=document.createElement(`tbody`),h=Math.max(0,...this._chartData.datasets.map(e=>e.data.length));for(let e=0;e<h;e+=1){let t=document.createElement(`tr`),n=document.createElement(`th`);n.scope=`row`,n.textContent=String(this._chartData.datasets.find(t=>t.data[e])?.data[e]?.x??e+1),t.appendChild(n),this._chartData.datasets.forEach(n=>{let r=document.createElement(`td`),i=n.data[e];r.textContent=i?this._formatValue(i.y,n):``,t.appendChild(r)}),m.appendChild(t)}switch(l.appendChild(m),this.appendChild(l),this._showTooltip&&this._createTooltip(),this._initializeDatasetVisibility(),this._calculateRotatedLabelHeight(),this._showLegend?this._legendHeight=this._calculateLegendHeight():this._legendHeight=0,this._showLegend&&this._renderLegend(),this._chartType!==`pie`&&this._pieChartClickOutsideHandler&&(document.removeEventListener(`click`,this._pieChartClickOutsideHandler,!0),this._pieChartClickOutsideHandler=null,this._pieChartTooltipShown=!1,this._pieChartGroup=null),this._pinnedXValue=null,this._chartType){case`line`:this._renderLineChart();break;case`bar`:this._renderBarChart();break;case`area`:this._renderAreaChart();break;case`pie`:this._renderPieChart();break}if(this._showTooltip&&this._chartType!==`pie`&&(this._setupChartTooltip(),this._setupTooltipScrollHandler()),this._createVerticalLine(),e&&this._svg){let t=this._svg;requestAnimationFrame(()=>requestAnimationFrame(()=>{t.isConnected&&(e.style.opacity=`0`,t.style.opacity=`1`,window.setTimeout(()=>e.remove(),280))}))}}_createTooltip(){this._tooltip&&this._tooltip.parentNode&&this._tooltip.parentNode.removeChild(this._tooltip),this._tooltip=document.createElement(`div`),this._tooltip.className=`fixed pointer-events-none z-50 bg-gray-900 dark:bg-mint-elevated text-white text-xs rounded px-2 py-1 shadow-lg opacity-0`,this._tooltip.style.display=`none`,document.body.appendChild(this._tooltip)}_showTooltipAt(e,t,n){if(!this._tooltip)return;this._tooltipHideTimeout!==null&&(clearTimeout(this._tooltipHideTimeout),this._tooltipHideTimeout=null),this._lastTooltipContent!==n&&(this._tooltip.innerHTML=n,this._lastTooltipContent=n),(this._tooltip.style.display===`none`||this._tooltip.style.opacity===`0`)&&(this._tooltip.style.display=`block`,this._tooltip.style.opacity=`1`,this._tooltip.style.padding=`8px 12px`);let r=this._tooltip.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight,o=e+10,s=t-r.height-8;o+r.width>i&&(o=e-r.width-10),o<0&&(o=10),s<0&&(s=t+20),s+r.height>a&&(s=t-r.height-8,s<0&&(s=10));let c=`${o}px`,l=`${s}px`;this._tooltip.style.left!==c&&(this._tooltip.style.left=c),this._tooltip.style.top!==l&&(this._tooltip.style.top=l)}_hideTooltip(){this._tooltip&&(this._tooltipHideTimeout!==null&&(clearTimeout(this._tooltipHideTimeout),this._tooltipHideTimeout=null),this._tooltip.style.opacity=`0`,this._tooltipHideTimeout=window.setTimeout(()=>{this._tooltip&&(this._tooltip.style.display=`none`),this._tooltipHideTimeout=null},200))}_createVerticalLine(){if(!this._svg)return;this._verticalLine&&this._verticalLine.parentNode&&this._verticalLine.parentNode.removeChild(this._verticalLine),this._verticalLine=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);let e=document.documentElement.classList.contains(`dark`);this._verticalLine.setAttribute(`stroke`,e?`#9ca3af`:`#6b7280`),this._verticalLine.setAttribute(`stroke-width`,`1`),this._verticalLine.setAttribute(`stroke-dasharray`,`4,2`),this._verticalLine.style.opacity=`0`,this._verticalLine.style.pointerEvents=`none`;let t=this._svg.querySelector(`.chart-legend`);t&&t.parentNode?t.parentNode.insertBefore(this._verticalLine,t):this._svg.appendChild(this._verticalLine)}_showVerticalLineAtX(e,t){if(!this._verticalLine)return;let n=this._chartType===`bar`?this._scaleXForBarChart(e,t):this._scaleX(e,t);this._verticalLine.setAttribute(`x1`,n.toString()),this._verticalLine.setAttribute(`y1`,t.y.toString()),this._verticalLine.setAttribute(`x2`,n.toString()),this._verticalLine.setAttribute(`y2`,(t.y+t.height).toString()),this._verticalLine.style.opacity=`1`}_hideVerticalLine(){this._verticalLine&&(this._verticalLine.style.opacity=`0`)}_showPlotPointsForX(e){this._plotPoints.forEach(e=>{e.forEach(e=>{e.style.opacity=`0`})});let t=String(e),n=this._plotPoints.get(t);n&&n.forEach(e=>{e.style.opacity=`1`})}_hidePlotPoints(){this._plotPoints.forEach(e=>{e.forEach(e=>{e.style.opacity=`0`})})}_calculateMaxYAxisLabelWidth(){if(!this._showGrid||!this._chartData)return 0;let e=document.createElement(`canvas`).getContext(`2d`);if(!e)return 60;e.font=`12px system-ui, -apple-system, sans-serif`;let t=this._showLegend?Math.max(this._legendHeight,60):0,n=this._height-t,r=Math.floor(n/35),i=Math.min(5,r),a=0;for(let t=0;t<=i;t++){let n=this._getYRange(),r=n.max-(n.max-n.min)/i*t,o=this._formatYAxisValue(r),s=e.measureText(o);a=Math.max(a,s.width)}return Math.ceil(a)+20}_getChartBounds(){let e=this._calculateMaxYAxisLabelWidth(),t=`${this._width}-${this._height}-${this._showGrid}-${this._showLegend}-${this._legendHeight}-${e}-${this._rotatedLabelHeight}`;if(this._cachedBounds.bounds&&this._cachedBounds.dataHash===t)return this._cachedBounds.bounds;let n=0,r=0;this._showGrid&&(n=e+10);let i=(this._rotatedLabelHeight>0?30:20)+this._rotatedLabelHeight+12,a=i;this._showLegend&&(a=i+20+Math.max(this._legendHeight,60));let o=this._height-0-n-0,s=o-a,c=1;if(s<100&&a>0){let e=o-100;e>0?(c=Math.min(1,e/a),c=Math.max(.5,c)):c=.5}r=a*c;let l=this._width*.3,u=n,d=1;n>l&&(d=l/n,u=l);let f={width:(this._width-u-0)*d,height:this._height-0-r,x:u,y:0};return this._cachedBounds={bounds:f,dataHash:t},f}_getAllDataPoints(){if(!this._chartData)return[];let e=[];return this._chartData.datasets.forEach((t,n)=>{this._isDatasetVisible(t,n)&&e.push(...t.data)}),e}_getXValues(){if(!this._chartData)return[];let e=JSON.stringify(this._chartData.labels)+JSON.stringify(this._chartData.datasets.map(e=>e.data.map(e=>e.x)));if(this._cachedXValues.values&&this._cachedXValues.dataHash===e)return this._cachedXValues.values;if(this._chartData.labels&&this._chartData.labels.length>0)return this._cachedXValues={values:this._chartData.labels,dataHash:e},this._chartData.labels;let t=new Set;this._chartData.datasets.forEach((e,n)=>{this._isDatasetVisible(e,n)&&e.data.forEach(e=>{t.add(e.x)})});let n=Array.from(t).sort((e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e-t;let n=String(e),r=String(t),i=/^([A-Za-z]{3})\s+(\d{4})$/,a=n.match(i),o=r.match(i);if(a&&o){let e=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],t=e.indexOf(a[1]),n=e.indexOf(o[1]),r=parseInt(a[2]),i=parseInt(o[2]);return r===i?t-n:r-i}return n.localeCompare(r)});return this._cachedXValues={values:n,dataHash:e},n}_getYRange(){if(!this._chartData)return{min:0,max:100};let e=JSON.stringify(this._chartData.datasets.map(e=>e.data.map(e=>e.y)));if(this._cachedYRange.range&&this._cachedYRange.dataHash===e)return this._cachedYRange.range;let t=this._getAllDataPoints();if(t.length===0){let t={min:0,max:100};return this._cachedYRange={range:t,dataHash:e},t}let n=t.map(e=>e.y),r=Math.min(...n),i=Math.max(...n),a=(i-r)*.1,o={min:Math.max(0,r-a),max:i+a};return this._cachedYRange={range:o,dataHash:e},o}_hasDecimalValues(){return this._getAllDataPoints().some(e=>e.y%1!=0)}_formatValueByString(e,t){switch(t.toLowerCase()){case`currency`:case`currency-usd`:return new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`}).format(e);case`currency-eur`:return new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`EUR`}).format(e);case`currency-gbp`:return new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`GBP`}).format(e);case`number`:case`number-with-commas`:return new Intl.NumberFormat(`en-US`).format(e);case`percent`:return new Intl.NumberFormat(`en-US`,{style:`percent`,minimumFractionDigits:1}).format(e/100);default:return this._hasDecimalValues()&&e%1!=0?e.toFixed(1):Math.round(e).toString()}}_formatXAxisValue(e){if(this._chartData?.formatXAxis){if(typeof this._chartData.formatXAxis==`function`)return this._chartData.formatXAxis(e);if(typeof this._chartData.formatXAxis==`string`)return String(e)}return String(e)}_escapeHtmlForTooltip(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}_tooltipXHeadingHtml(e){return`<strong>${this._escapeHtmlForTooltip(this._formatXAxisValue(e))}</strong><br/>`}_formatYAxisValue(e){if(this._chartData?.formatYAxis){if(typeof this._chartData.formatYAxis==`function`)return this._chartData.formatYAxis(e);if(typeof this._chartData.formatYAxis==`string`)return this._formatValueByString(e,this._chartData.formatYAxis)}if(this._chartData?.datasets?.[0]?.formatValue){if(typeof this._chartData.datasets[0].formatValue==`function`)return this._chartData.datasets[0].formatValue(e);if(typeof this._chartData.datasets[0].formatValue==`string`)return this._formatValueByString(e,this._chartData.datasets[0].formatValue)}return this._hasDecimalValues()&&e%1!=0?e.toFixed(1):Math.round(e).toString()}_formatValue(e,t){if(t.formatValue){if(typeof t.formatValue==`function`)return t.formatValue(e);if(typeof t.formatValue==`string`)return this._formatValueByString(e,t.formatValue)}return String(e)}_getAllDatasetsAtX(e){if(!this._chartData)return[];let t=[];return this._chartData.datasets.forEach((n,r)=>{if(!this._isDatasetVisible(n,r))return;let i=n.data.find(t=>String(t.x)===String(e));if(i){let e=this._getDatasetColor(n,r),a=this._formatValue(i.y,n);t.push({name:n.name,value:i.y,color:e,formattedValue:a})}}),t}_findNearestXValue(e){if(!this._chartData)return null;let t=this._getChartBounds(),n=this._getXValues();if(n.length===0)return null;let r=this._chartType===`bar`,i=null,a=1/0;return n.forEach(n=>{let o=r?this._scaleXForBarChart(n,t):this._scaleX(n,t),s=Math.abs(e-o);s<a&&(a=s,i=n)}),i}_setupTooltipScrollHandler(){if(this._chartTooltipScrollHandler){window.removeEventListener(`scroll`,this._chartTooltipScrollHandler,!0),this._chartContainer&&this._chartContainer.removeEventListener(`scroll`,this._chartTooltipScrollHandler,!0);let e=this.parentElement;for(;e;)e.removeEventListener(`scroll`,this._chartTooltipScrollHandler,!0),e=e.parentElement}this._chartTooltipScrollHandler=()=>{this._hideTooltip(),this._pinnedXValue=null},window.addEventListener(`scroll`,this._chartTooltipScrollHandler,!0),this._chartContainer&&this._chartContainer.addEventListener(`scroll`,this._chartTooltipScrollHandler,!0);let e=this.parentElement;for(;e;){let t=window.getComputedStyle(e),n=t.overflow,r=t.overflowY;(n===`auto`||n===`scroll`||r===`auto`||r===`scroll`)&&e.addEventListener(`scroll`,this._chartTooltipScrollHandler,!0),e=e.parentElement}}_setupChartTooltip(){if(!this._svg||!this._showTooltip)return;this._chartTooltipMouseMove&&this._svg.removeEventListener(`mousemove`,this._chartTooltipMouseMove),this._chartTooltipMouseLeave&&this._svg.removeEventListener(`mouseleave`,this._chartTooltipMouseLeave),this._chartTooltipClick&&this._svg.removeEventListener(`click`,this._chartTooltipClick),this._chartTooltipTouchStart&&this._svg.removeEventListener(`touchstart`,this._chartTooltipTouchStart),this._chartTooltipTouchMove&&this._svg.removeEventListener(`touchmove`,this._chartTooltipTouchMove),this._chartTooltipTouchEnd&&this._svg.removeEventListener(`touchend`,this._chartTooltipTouchEnd),this._cachedTooltipContent.clear(),this._cachedXPositions.clear();let t=this._getChartBounds(),n=0,r=0,i=i=>{!this._chartContainer||!this._svg||(n=i.clientX,r=i.clientY,this._tooltipAnimationFrame!==null&&cancelAnimationFrame(this._tooltipAnimationFrame),this._tooltipAnimationFrame=requestAnimationFrame(()=>{if(this._tooltipAnimationFrame=null,!this._svg)return;let i=this._svg.getBoundingClientRect(),a=n-i.left,o=r-i.top;if(a<t.x||a>t.x+t.width||o<t.y||o>t.y+t.height){this._hideTooltip(),this._hidePlotPoints(),this._hideVerticalLine(),this._activeXValue=null;return}let s=this._findNearestXValue(a);if(!s){this._hideTooltip(),this._hidePlotPoints(),this._hideVerticalLine(),this._activeXValue=null;return}if(this._pinnedXValue!==null&&this._pinnedXValue===s){let e=this._pinnedXValue,i=this._getAllDatasetsAtX(e);if(i.length>0){this._activeXValue=e,this._showPlotPointsForX(e),this._showVerticalLineAtX(e,t);let a=this._cachedTooltipContent.get(e);a||(a=this._tooltipXHeadingHtml(e),i.forEach(e=>{a+=`<div style="display: flex; align-items: center; gap: 6px; margin-top: 4px;">
|
|
104
|
+
`,this._headingElement=this._root.querySelector(`.mint-page-heading`),this._backButton=this._root.querySelector(`.mint-page-back`),this._backButton.addEventListener(`click`,e=>this._handleBack(e))}connectedCallback(){this.render()}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this.render()}getHeading(){return this.getAttribute(`heading`)||``}getFallbackHref(){return this.getAttribute(`fallback-href`)||`/`}shouldShowBackButton(){return this.getAttribute(`show-back-button`)===`true`}isContainered(){return this.hasAttribute(`containered`)&&this.getAttribute(`containered`)!==`false`}render(){this._headingElement.textContent=this.getHeading(),this._backButton.hidden=!this.shouldShowBackButton()}_handleBack(e){e.preventDefault();let t=document.referrer,n=!!(t&&(()=>{try{return new URL(t).origin===window.location.origin}catch{return!1}})()),r={url:n?t:this.getFallbackHref(),isFromReferrer:n,referrer:t||null,fallbackHref:this.getFallbackHref()},i=new CustomEvent(`back`,{detail:r,bubbles:!0,cancelable:!0,composed:!0});this.dispatchEvent(i)&&(n&&window.history.length>1?window.history.back():window.location.href=this.getFallbackHref())}};typeof customElements<`u`&&!customElements.get(`mint-page`)&&a(`mint-page`,Ut);var Wt=class extends HTMLElement{constructor(){super()}};typeof customElements<`u`&&!customElements.get(`mint-grid`)&&a(`mint-grid`,Wt);var Gt=class extends HTMLElement{static get observedAttributes(){return[`id`,`heading`,`open`]}constructor(){super(),this._overlay=null,this._modal=null,this._header=null,this._headingSlot=null,this._bodySlot=null,this._actionsSlot=null,this._closeButton=null,this._triggerElement=null,this._triggerPoint=null,this._renderedOpen=!1,this._lastPointerPoint=null,this._pointerDownHandler=null,this._darkModeObserver=null,this._exitTimer=null,this._backdropTimer=null}connectedCallback(){this.isOpen()||this.classList.add(`mint-hidden`),this.render(),this._observeDarkMode(),this._pointerDownHandler=e=>{this._lastPointerPoint={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()}},document.addEventListener(`pointerdown`,this._pointerDownHandler,!0)}disconnectedCallback(){this._pointerDownHandler&&=(document.removeEventListener(`pointerdown`,this._pointerDownHandler,!0),null),this._exitTimer&&=(clearTimeout(this._exitTimer),null),this._backdropTimer&&=(clearTimeout(this._backdropTimer),null),this._darkModeObserver&&=(this._darkModeObserver.disconnect(),null)}attributeChangedCallback(e,t,n){t!==n&&(e===`open`&&n!==null&&!this._triggerElement&&(this._triggerElement=this._findTriggerElement(),this._triggerPoint=this._findTriggerPoint(this._triggerElement)),this.render())}getId(){return this.getAttribute(`id`)||``}getHeading(){return this.getAttribute(`heading`)||``}isOpen(){return this.hasAttribute(`open`)}open(e){this._triggerElement=this._findTriggerElement(e),this._triggerPoint=this._findTriggerPoint(this._triggerElement),this.setAttribute(`open`,``)}close(){this.removeAttribute(`open`)}render(){let e=this.getId(),t=this.getHeading(),n=this.isOpen();if(e&&(this.id=e),this._overlay||(this._overlay=document.createElement(`div`),this._overlay.className=`mint-modal-overlay`,this._overlay.addEventListener(`click`,()=>this.close()),this.appendChild(this._overlay)),this._modal||(this._modal=document.createElement(`div`),this._modal.className=`mint-modal-shell`,this.appendChild(this._modal)),n){let e=this._modal.querySelector(`.modal-content`);e||(e=document.createElement(`div`),e.className=`modal-content`,this._modal.appendChild(e)),this._renderedOpen||(this._renderedOpen=!0,this._animateEnter())}else this._renderedOpen&&(this._renderedOpen=!1,this._animateExit());let r=this._modal.querySelector(`.modal-content`);r||(r=document.createElement(`div`),r.className=`modal-content`,this._modal.appendChild(r)),this._header||(this._header=document.createElement(`div`),this._header.className=`mint-modal-header`,r.appendChild(this._header)),this._headingSlot||(this._headingSlot=document.createElement(`div`),this._headingSlot.className=`mint-modal-heading`,this._headingSlot.setAttribute(`slot`,`heading`),this._header.appendChild(this._headingSlot));let i=this._headingSlot.querySelector(`mint-text`);t?(i||(i=document.createElement(`mint-text`),i.setAttribute(`size`,`sub-heading`),i.setAttribute(`bold`,``),this._headingSlot.appendChild(i)),i.textContent=t):i&&i.remove(),Array.from(this.children).filter(e=>e!==this._overlay&&e!==this._modal&&e!==this._headingSlot&&e.getAttribute(`slot`)===`heading`).forEach(e=>{e.parentElement!==this._headingSlot&&this._headingSlot.appendChild(e)}),this._closeButton||(this._closeButton=document.createElement(`mint-button`),this._closeButton.setAttribute(`variant`,`ghost`),this._closeButton.setAttribute(`icon`,`close`),this._closeButton.addEventListener(`click`,()=>this.close()),this._header.appendChild(this._closeButton)),this._bodySlot||(this._bodySlot=document.createElement(`div`),this._bodySlot.className=`mint-modal-body`,this._bodySlot.setAttribute(`slot`,`body`),r.appendChild(this._bodySlot)),Array.from(this.children).filter(e=>e!==this._overlay&&e!==this._modal&&e!==this._bodySlot&&e.getAttribute(`slot`)===`body`).forEach(e=>{e.parentElement!==this._bodySlot&&this._bodySlot.appendChild(e)}),this._actionsSlot||(this._actionsSlot=document.createElement(`div`),this._actionsSlot.className=`mint-modal-actions`,this._actionsSlot.setAttribute(`slot`,`actions`),r.appendChild(this._actionsSlot));let a=this._actionsSlot.querySelector(`mint-stack`);a||(a=document.createElement(`mint-stack`),a.setAttribute(`direction`,`horizontal`),a.className=`mint-actions-stack`,this._actionsSlot.appendChild(a)),Array.from(this.children).filter(e=>e!==this._overlay&&e!==this._modal&&e!==this._actionsSlot&&e.getAttribute(`slot`)===`actions`).forEach(e=>{Array.from(e.children).forEach(e=>{e.parentElement!==a&&a.appendChild(e)}),e.parentElement&&e.remove()}),Array.from(this.children).forEach(e=>{e!==this._overlay&&e!==this._modal&&e.getAttribute(`slot`)!==`heading`&&e.getAttribute(`slot`)!==`body`&&e.getAttribute(`slot`)!==`actions`&&e!==this._headingSlot&&e!==this._bodySlot&&e!==this._actionsSlot&&e.parentElement!==this._bodySlot&&this._bodySlot.appendChild(e)}),this._updateBackgroundColor()}_updateBackgroundColor(){if(!this._modal)return;document.documentElement?.classList.contains(`dark`)||document.documentElement?.dataset.mintTheme;let e=this._modal.querySelector(`.modal-content`);e&&(e.style.background=`var(--mint-color-surface-raised)`)}_observeDarkMode(){if(!this._darkModeObserver){if(this._darkModeObserver=new MutationObserver(()=>{this._updateBackgroundColor()}),!document.documentElement)return;this._darkModeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`,`data-mint-theme`]})}}_animateEnter(){let e=this._modal?.querySelector(`.modal-content`);e&&(this._exitTimer&&=(clearTimeout(this._exitTimer),null),this._backdropTimer&&=(clearTimeout(this._backdropTimer),null),this.classList.remove(`mint-modal-closing`),this.classList.remove(`mint-modal-open`),this.classList.add(`mint-modal-open`),this.classList.remove(`mint-hidden`),e.style.transform=`none`,e.style.opacity=`0`,e.style.transition=`none`,requestAnimationFrame(()=>{if(!this.isOpen())return;let t=window.getComputedStyle(e).borderRadius;this._setTransformOrigin(e),e.style.borderRadius=`50%`,e.style.transform=`scale(0.1, 0.2)`,e.style.opacity=`0.9`,e.getBoundingClientRect(),e.style.transition=`opacity 320ms ease-out, transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1), border-radius 360ms cubic-bezier(0.2, 0.8, 0.2, 1)`,requestAnimationFrame(()=>{this.isOpen()&&(e.style.transform=`scale(1)`,e.style.opacity=`1`,e.style.borderRadius=t)})}))}_findTriggerElement(e){if(typeof e==`string`){let t=document.getElementById(e);return t&&!this.contains(t)?t:null}if(e instanceof HTMLElement)return e.isConnected&&!this.contains(e)?e:null;let t=this.getAttribute(`trigger-id`);if(t){let e=document.getElementById(t);if(e&&!this.contains(e))return e}let n=document.activeElement;return n instanceof HTMLElement&&n.isConnected&&n!==document.body&&!this.contains(n)?n:null}_findTriggerPoint(e){if(!e)return null;let t=this._lastPointerPoint;if(!t||Date.now()-t.time>1e3)return null;let n=t.target instanceof Node?t.target:null;return n===e||n&&e.contains(n)?{x:t.x,y:t.y}:null}_setTransformOrigin(e){let t=this._findTriggerElement(this._triggerElement);this._triggerElement=t;let n=this._findTriggerPoint(t);if(n){let t=e.getBoundingClientRect();e.style.transformOrigin=`${n.x-t.left}px ${n.y-t.top}px`,this._triggerPoint=n;return}this._triggerPoint={x:window.innerWidth/2,y:0};let r=e.getBoundingClientRect();e.style.transformOrigin=`${this._triggerPoint.x-r.left}px ${this._triggerPoint.y-r.top}px`}_animateExit(){this.classList.remove(`mint-modal-open`),this._backdropTimer&&=(clearTimeout(this._backdropTimer),null);let e=this._modal?.querySelector(`.modal-content`);if(!e){this.classList.add(`mint-hidden`),this.classList.remove(`mint-modal-closing`);return}this._exitTimer&&clearTimeout(this._exitTimer),this.classList.add(`mint-modal-closing`),e.style.transition=`opacity 220ms ease-in, transform 260ms cubic-bezier(0.4, 0, 1, 1), border-radius 260ms cubic-bezier(0.4, 0, 1, 1)`,e.style.borderRadius=`50%`,e.style.transform=`scale(0.1, 0.2)`,e.style.opacity=`0.9`,this._exitTimer=setTimeout(()=>{this._exitTimer=null,!this.isOpen()&&(this.classList.add(`mint-hidden`),this.classList.remove(`mint-modal-closing`),e.style.transform=``,e.style.opacity=``,e.style.borderRadius=``,e.style.transition=``)},280)}};typeof customElements<`u`&&!customElements.get(`mint-modal`)&&a(`mint-modal`,Gt);var Kt=new Set([`up`,`down`,`left`,`right`]),qt=class extends HTMLElement{static get observedAttributes(){return[`direction`,`open`,`trigger-id`,`trigger-toggle`,`trigger-align`,`padding`,`hover`,`distance`]}constructor(){super(),this._trigger=null,this._triggerLookupTimer=null,this._clickHandler=null,this._hoverEnterHandler=null,this._hoverLeaveHandler=null,this._outsideHandler=null,this._escapeHandler=null,this._positionHandler=null,this._scrollHandler=null,this._resizeObserver=null,this._hoverCloseTimer=null,this._closeAnimationTimer=null,this._blobAnimation=null}connectedCallback(){this.render(),this._setupTrigger()}disconnectedCallback(){this._removeTrigger(),this._removeOpenListeners(),clearTimeout(this._hoverCloseTimer),clearTimeout(this._closeAnimationTimer),this._blobAnimation?.cancel()}attributeChangedCallback(e,t,n){t===n||!this.isConnected||((e===`trigger-id`||e===`trigger-toggle`||e===`hover`)&&this._setupTrigger(),this.render())}getDirection(){let e=this.getAttribute(`direction`)||`down`;return Kt.has(e)?e:`down`}getTriggerId(){return this.getAttribute(`trigger-id`)||``}isOpen(){return this.hasAttribute(`open`)&&this.getAttribute(`open`)!==`false`}isHoverEnabled(){return this.hasAttribute(`hover`)&&this.getAttribute(`hover`)!==`false`}isTriggerToggleEnabled(){return this.getAttribute(`trigger-toggle`)!==`false`}open(){this.setAttribute(`open`,`true`)}close(){this.removeAttribute(`open`)}_removeTrigger(){clearTimeout(this._triggerLookupTimer),this._triggerLookupTimer=null,this._trigger&&(this._clickHandler&&this._trigger.removeEventListener(`click`,this._clickHandler),this._hoverEnterHandler&&this._trigger.removeEventListener(`mouseenter`,this._hoverEnterHandler),this._hoverLeaveHandler&&this._trigger.removeEventListener(`mouseleave`,this._hoverLeaveHandler),this._hoverEnterHandler&&this.removeEventListener(`mouseenter`,this._hoverEnterHandler),this._hoverLeaveHandler&&this.removeEventListener(`mouseleave`,this._hoverLeaveHandler),this._trigger.removeAttribute(`aria-haspopup`),this._trigger.removeAttribute(`aria-expanded`),this._trigger=null,this._clickHandler=this._hoverEnterHandler=this._hoverLeaveHandler=null)}_setupTrigger(){this._removeTrigger();let e=this.getTriggerId();if(e){if(this._trigger=document.getElementById(e),!this._trigger){this._triggerLookupTimer=setTimeout(()=>{this.isConnected&&this.getTriggerId()===e&&!this._trigger&&this._setupTrigger()},40);return}this._trigger.setAttribute(`aria-haspopup`,`true`),this._trigger.setAttribute(`aria-expanded`,String(this.isOpen())),this.isTriggerToggleEnabled()&&(this._clickHandler=e=>{this._trigger?.tagName===`A`&&e.preventDefault(),this.isOpen()?this.close():this.open()},this._trigger.addEventListener(`click`,this._clickHandler)),this.isHoverEnabled()&&(this._hoverEnterHandler=()=>{clearTimeout(this._hoverCloseTimer),this.open()},this._hoverLeaveHandler=()=>this._scheduleHoverClose(),this._trigger.addEventListener(`mouseenter`,this._hoverEnterHandler),this._trigger.addEventListener(`mouseleave`,this._hoverLeaveHandler),this.addEventListener(`mouseenter`,this._hoverEnterHandler),this.addEventListener(`mouseleave`,this._hoverLeaveHandler))}}_scheduleHoverClose(){clearTimeout(this._hoverCloseTimer),this._hoverCloseTimer=setTimeout(()=>{!this._trigger?.matches(`:hover`)&&!this.matches(`:hover`)&&this.close()},140)}_removeOpenListeners(){this._outsideHandler&&document.removeEventListener(`click`,this._outsideHandler),this._escapeHandler&&document.removeEventListener(`keydown`,this._escapeHandler),this._positionHandler&&window.removeEventListener(`resize`,this._positionHandler),this._scrollHandler&&window.removeEventListener(`scroll`,this._scrollHandler,!0),this._resizeObserver?.disconnect(),this._resizeObserver=null,this._outsideHandler=this._escapeHandler=this._positionHandler=this._scrollHandler=null}_setOpenListeners(){if(!this._outsideHandler){if(this._outsideHandler=e=>{let t=e.composedPath();t.includes(this)||t.includes(this._trigger)||(e.target instanceof Element?e.target:null)?.closest(`[data-keep-popover-open]`)||this.close()},this._escapeHandler=e=>{e.key===`Escape`&&(this.close(),this._trigger?.focus?.())},this._positionHandler=()=>{this.isOpen()&&this._position()},this._scrollHandler=()=>{this.isOpen()&&this._position({allowViewportFlip:!1,clampToViewport:!1})},typeof ResizeObserver<`u`&&this._trigger){this._resizeObserver=new ResizeObserver(()=>{this.isOpen()&&this._position()}),this._resizeObserver.observe(this);let e=this._trigger,t=0;for(;e&&e!==document.documentElement&&t<8;)this._resizeObserver.observe(e),e=e.parentElement,t+=1}setTimeout(()=>{this.isOpen()&&this._outsideHandler&&document.addEventListener(`click`,this._outsideHandler)},0),document.addEventListener(`keydown`,this._escapeHandler),window.addEventListener(`resize`,this._positionHandler),window.addEventListener(`scroll`,this._scrollHandler,!0)}}_position({allowViewportFlip:e=!0,clampToViewport:t=!0}={}){let n=document.getElementById(this.getTriggerId());n&&n!==this._trigger&&this._setupTrigger();let r=n||this._trigger;if(!r)return;let i=r.getBoundingClientRect(),a={width:this.offsetWidth,height:this.offsetHeight},o=this._distancePx(),s=e?this.getDirection():this.dataset.direction||this.getDirection(),c=0,l=0,u=this.getAttribute(`trigger-align`)||`center`;if(s===`down`||s===`up`){let t=i.bottom+o,n=i.top-a.height-o;e&&s===`down`&&t+a.height>innerHeight-12&&n>=12?s=`up`:e&&s===`up`&&n<12&&t+a.height<=innerHeight-12&&(s=`down`),c=s===`down`?t:n,l=u===`start`?i.left:u===`end`?i.right-a.width:i.left+(i.width-a.width)/2}else{let t=i.right+o,n=i.left-a.width-o;e&&s===`right`&&t+a.width>innerWidth-12&&n>=12?s=`left`:e&&s===`left`&&n<12&&t+a.width<=innerWidth-12&&(s=`right`),l=s===`right`?t:n,c=u===`start`?i.top:u===`end`?i.bottom-a.height:i.top+(i.height-a.height)/2}let d=t?Math.max(12,Math.min(c,innerHeight-a.height-12)):c,f=t?Math.max(12,Math.min(l,innerWidth-a.width-12)):l;this.style.top=`${d}px`,this.style.left=`${f}px`,this.dataset.direction=s,this.style.setProperty(`--mint-popover-origin-x`,`${i.left+i.width/2-f}px`),this.style.setProperty(`--mint-popover-origin-y`,`${i.top+i.height/2-d}px`)}_distancePx(){let e=(this.getAttribute(`distance`)||`8px`).trim(),t=Number.parseFloat(e);return Number.isFinite(t)?e.endsWith(`rem`)?t*(parseFloat(getComputedStyle(document.documentElement).fontSize)||16):Math.max(0,t):8}_animateBlob(e){if(this._blobAnimation?.cancel(),this._blobAnimation=null,typeof this.animate!=`function`)return 0;let t=getComputedStyle(this).borderRadius||`.75rem`;if(matchMedia(`(prefers-reduced-motion: reduce)`).matches)return 0;let n=e?380:280,r=[{transform:`scale(.035, .035)`,borderRadius:`50%`,opacity:.94,offset:0},{transform:`scale(.3, .42)`,borderRadius:`50%`,opacity:1,offset:.58},{transform:`scale(1.035, .96)`,borderRadius:`1rem`,offset:.9},{transform:`scale(1)`,borderRadius:t,offset:1}],i=e?r:[...r].reverse().map(({offset:e,...t})=>({...t,offset:1-e}));return this._blobAnimation=this.animate(i,{duration:n,easing:e?`cubic-bezier(.2, .8, .2, 1)`:`cubic-bezier(.4, 0, .8, .2)`,fill:`both`}),n}render(){let e=this.isOpen(),t=this.hasAttribute(`data-open`)||this.dataset.state===`closing`,n=this.hasAttribute(`data-open`);if(this.toggleAttribute(`data-open`,e),this.setAttribute(`aria-hidden`,String(!e)),this._trigger&&this._trigger.setAttribute(`aria-expanded`,String(e)),e){clearTimeout(this._closeAnimationTimer);let e=!n||this.dataset.state===`closing`;e&&(this._blobAnimation?.cancel(),this._blobAnimation=null),this.dataset.state=`open`,this._setOpenListeners(),this._position(),e&&this._animateBlob(!0),requestAnimationFrame(()=>requestAnimationFrame(()=>{this.isOpen()&&this._position()}))}else if(this._removeOpenListeners(),t){this.dataset.state=`closing`;let e=this._animateBlob(!1);e?this._closeAnimationTimer=setTimeout(()=>{this.dataset.state===`closing`&&(this._blobAnimation?.cancel(),this._blobAnimation=null,this.dataset.state=`closed`)},e):this.dataset.state=`closed`}else this.dataset.state=`closed`}};typeof customElements<`u`&&!customElements.get(`mint-popover`)&&a(`mint-popover`,qt),s({name:`check`,viewBox:`0 0 24 24`,path:`M5 13l4 4L19 7`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3.2`});var Jt=class extends HTMLElement{static get observedAttributes(){return[`checked`,`disabled`,`label`,`info`,`id`,`name`,`value`]}constructor(){super(),this._checkbox=null,this._checked=!1,this._clickHandler=null}connectedCallback(){let e=this.getAttribute(`checked`);this._checked=e!==null&&e!==`false`,this.render()}disconnectedCallback(){this.removeEventListeners()}attributeChangedCallback(e,t,n){e===`checked`&&(this._checked=n!==null&&n!==`false`,this._checkbox&&(this._checkbox.checked=this._checked)),t!==n&&(this.render(),e===`checked`&&this._checkbox&&this.updateVisualState())}get checked(){return this._checked}set checked(e){e?this.setAttribute(`checked`,``):this.removeAttribute(`checked`),this._checked=!!e,this._checkbox&&(this._checkbox.checked=this._checked),this.updateVisualState()}isDisabled(){return this.hasAttribute(`disabled`)}getLabel(){return this.getAttribute(`label`)||``}getInfo(){return this.getAttribute(`info`)||``}getId(){return this.getAttribute(`id`)||``}getName(){return this.getAttribute(`name`)||``}getValue(){return this.getAttribute(`value`)||``}getCheckboxClasses(){return`mint-checkbox-control`}render(){let e=this.getLabel(),t=this.getInfo(),n=this.isDisabled(),r=this.querySelector(`.mint-checkbox-wrapper`);r||(r=document.createElement(`div`),r.className=`mint-checkbox-wrapper`,this.insertBefore(r,this.firstChild)),this._checkbox?this._checkbox.parentElement!==r&&r.appendChild(this._checkbox):(this._checkbox=document.createElement(`input`),this._checkbox.type=`checkbox`,r.appendChild(this._checkbox),this.setupEventListeners()),this._checkbox.className=`mint-input-overlay`,this._checkbox.style.cssText=`position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; pointer-events: auto; margin: 0; padding: 0;`,this._checkbox.checked=this._checked,this._checkbox.disabled=n,this._changeHandler||this.setupEventListeners();let i=this.getId();i?this._checkbox.id=i:this._checkbox.removeAttribute(`id`);let a=this.getName();a?this._checkbox.name=a:this._checkbox.removeAttribute(`name`);let o=this.getValue();o?this._checkbox.value=o:this._checkbox.removeAttribute(`value`),e?this._checkbox.setAttribute(`aria-label`,e):this._checkbox.removeAttribute(`aria-label`),r.className=`mint-checkbox-wrapper ${this.getCheckboxClasses()}`,r.style.pointerEvents=`none`,this._checkbox.style.pointerEvents=`auto`;let s=r.querySelector(`mint-icon`);s||(s=document.createElement(`mint-icon`),s.setAttribute(`name`,`check`),s.className=`mint-checkbox-check`,s.style.transition=`opacity 200ms ease-out, transform 200ms ease-out`,s.style.zIndex=`1`,r.appendChild(s)),this.updateVisualState();let c=this.querySelector(`.mint-checkbox-label-container`);if(e||t){c||(c=document.createElement(`div`),c.className=`mint-checkbox-label-container`,this.appendChild(c));let r=c.querySelector(`.mint-checkbox-label`);e?(r||(r=document.createElement(`span`),r.className=`mint-checkbox-label`,c.insertBefore(r,c.firstChild)),r.textContent=e,n?r.style.opacity=`0.5`:r.style.opacity=``):r&&r.remove();let i=c.querySelector(`.mint-checkbox-info`);if(t?(i||(i=document.createElement(`span`),i.className=`mint-checkbox-info`,c.appendChild(i)),i.textContent=t,n?i.style.opacity=`0.5`:i.style.opacity=``):i&&i.remove(),n)c.style.cursor=`default`,c._clickHandler&&(c.removeEventListener(`click`,c._clickHandler),c._clickHandler=null);else{c.style.cursor=`pointer`;let e=c._clickHandler;e&&c.removeEventListener(`click`,e),c._clickHandler=e=>{this._checkbox&&(e.target===this._checkbox||this._checkbox.contains(e.target)||e.composedPath().includes(this._checkbox))||this.toggle()},c.addEventListener(`click`,c._clickHandler)}}else c&&c.remove()}setupEventListeners(){this.removeEventListeners(),this._checkbox&&(this._changeHandler=e=>{e.stopPropagation(),this._checked=this._checkbox.checked,this._checked?this.hasAttribute(`checked`)||this.setAttribute(`checked`,``):this.hasAttribute(`checked`)&&this.removeAttribute(`checked`),this.updateVisualState();let t=new CustomEvent(`change`,{detail:{checked:this._checked,value:this.getValue()},bubbles:!0,cancelable:!0});this.dispatchEvent(t)},this._checkbox.addEventListener(`change`,this._changeHandler),this._mousedownHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&!this.isDisabled()&&(t.classList.add(`mint-checkbox-active`),this._checked?(t.style.backgroundColor=`var(--mint-color-primary)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.3)`):(t.style.backgroundColor=`var(--mint-color-surface-hover)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.1)`))},this._mouseupHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&(t.classList.remove(`mint-checkbox-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._mouseleaveHandler=e=>{let t=this.querySelector(`.mint-checkbox-wrapper`);t&&(t.classList.remove(`mint-checkbox-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._checkbox.addEventListener(`mousedown`,this._mousedownHandler),this._checkbox.addEventListener(`mouseup`,this._mouseupHandler),this._checkbox.addEventListener(`mouseleave`,this._mouseleaveHandler),this._touchstartHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&!this.isDisabled()&&(t.classList.add(`mint-checkbox-active`),this._checked?(t.style.backgroundColor=`var(--mint-color-primary)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.3)`):(t.style.backgroundColor=`var(--mint-color-surface-hover)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.1)`))},this._touchendHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&(t.classList.remove(`mint-checkbox-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._checkbox.addEventListener(`touchstart`,this._touchstartHandler),this._checkbox.addEventListener(`touchend`,this._touchendHandler))}removeEventListeners(){this._checkbox&&(this._changeHandler&&=(this._checkbox.removeEventListener(`change`,this._changeHandler),null),this._mousedownHandler&&=(this._checkbox.removeEventListener(`mousedown`,this._mousedownHandler),null),this._mouseupHandler&&=(this._checkbox.removeEventListener(`mouseup`,this._mouseupHandler),null),this._mouseleaveHandler&&=(this._checkbox.removeEventListener(`mouseleave`,this._mouseleaveHandler),null),this._touchstartHandler&&=(this._checkbox.removeEventListener(`touchstart`,this._touchstartHandler),null),this._touchendHandler&&=(this._checkbox.removeEventListener(`touchend`,this._touchendHandler),null))}updateVisualState(){let e=this.querySelector(`.mint-checkbox-wrapper`),t=e?.querySelector(`mint-icon`);t&&(t.style.opacity=this._checked?`1`:`0`,t.style.transform=this._checked?`scale(1)`:`scale(0.8)`),e&&(e.className=`mint-checkbox-wrapper ${this.getCheckboxClasses()}`,e.classList.contains(`mint-checkbox-active`)||(e.style.backgroundColor=``,e.style.boxShadow=``))}toggle(){if(this._checkbox&&!this.isDisabled()){this._checkbox.checked=!this._checked,this._checked=this._checkbox.checked,this._checked?this.hasAttribute(`checked`)||this.setAttribute(`checked`,``):this.hasAttribute(`checked`)&&this.removeAttribute(`checked`),this.updateVisualState();let e=new CustomEvent(`change`,{detail:{checked:this._checked},bubbles:!0,cancelable:!0});this.dispatchEvent(e)}}};typeof customElements<`u`&&!customElements.get(`mint-checkbox`)&&a(`mint-checkbox`,Jt);var Yt=class extends HTMLElement{static get observedAttributes(){return[`checked`,`disabled`,`label`,`info`,`id`,`name`,`value`,`required`]}constructor(){super(),this._radio=null,this._checked=!1,this._groupMode=!1,this._groupChangeHandler=null,this._groupObserver=null}connectedCallback(){if(this._activateGroupModeIfNeeded(),this._groupObserver=new MutationObserver(()=>this._activateGroupModeIfNeeded()),this._groupObserver.observe(this,{childList:!0,subtree:!0}),this._groupMode)return;let e=this.getAttribute(`checked`);this._checked=e!==null&&e!==`false`,this.render()}disconnectedCallback(){this.removeEventListeners(),this._groupChangeHandler&&=(this.removeEventListener(`choice-option-change`,this._groupChangeHandler),null),this._groupObserver?.disconnect(),this._groupObserver=null}attributeChangedCallback(e,t,n){if(this._groupMode){t!==n&&this.renderGroup();return}e===`checked`&&(this._checked=n!==null&&n!==`false`,this._radio&&(this._radio.checked=this._checked)),t!==n&&(this.render(),e===`checked`&&this._radio&&this.updateVisualState())}get checked(){return this._checked}set checked(e){e?this.setAttribute(`checked`,``):this.removeAttribute(`checked`),this._checked=!!e,this._radio&&(this._radio.checked=this._checked),this.updateVisualState()}isDisabled(){return this.hasAttribute(`disabled`)}getLabel(){return this.getAttribute(`label`)||``}getInfo(){return this.getAttribute(`info`)||``}getId(){return this.getAttribute(`id`)||``}getName(){return this.getAttribute(`name`)||``}getValue(){return this._groupMode?this.querySelector(`mint-choice-option input[type="radio"]:checked`)?.value||this.getAttribute(`value`)||``:this.getAttribute(`value`)||``}set value(e){this.setValue(e)}get value(){return this.getValue()}setValue(e){if(!this._groupMode){e?this.setAttribute(`value`,e):this.removeAttribute(`value`);return}let t=e==null?``:String(e);this.querySelectorAll(`mint-choice-option`).forEach(e=>{let n=e.getAttribute(`value`)===t,r=e.querySelector(`input[type="radio"]`);r&&(r.checked=n),e.toggleAttribute(`checked`,n)}),t?this.setAttribute(`value`,t):this.removeAttribute(`value`)}renderGroup(){this.classList.add(`mint-choice-group`),this.setAttribute(`role`,`radiogroup`);let e=this.getAttribute(`label`)||``,t=this.querySelector(`:scope > .mint-choice-group-label`);e&&!t&&(t=document.createElement(`div`),t.className=`mint-choice-group-label`,this.insertBefore(t,this.firstChild)),t&&(e?t.textContent=e:t.remove());let n=this.querySelector(`:scope > .mint-choice-options`);n||(n=document.createElement(`div`),n.className=`mint-choice-options`,t?.parentElement===this?this.insertBefore(n,t.nextSibling):this.insertBefore(n,this.firstChild)),Array.from(this.children).filter(e=>e.tagName===`MINT-CHOICE-OPTION`&&e.parentElement!==n).forEach(e=>n.appendChild(e)),this.querySelectorAll(`mint-choice-option`).forEach(e=>e.render());let r=this.getAttribute(`value`);r&&this.setValue(r)}_activateGroupModeIfNeeded(){this._groupMode||!this.querySelector(`mint-choice-option`)||(this._groupMode=!0,this.removeEventListeners(),this.querySelector(`.mint-choice-wrapper`)?.remove(),this.querySelector(`.mint-choice-label-container`)?.remove(),this._radio=null,this._groupChangeHandler=e=>{let t=e.target.closest?.(`mint-choice-option`);if(!t||!this.contains(t))return;let n=t.getAttribute(`value`)||``;n?this.setAttribute(`value`,n):this.removeAttribute(`value`),this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0})),this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0}))},this.addEventListener(`choice-option-change`,this._groupChangeHandler),this.renderGroup())}getChoiceClasses(){return`mint-choice-control`}render(){if(this._groupMode){this.renderGroup();return}let e=this.getLabel(),t=this.getInfo(),n=this.isDisabled(),r=this.querySelector(`.mint-choice-wrapper`);r||(r=document.createElement(`div`),r.className=`mint-choice-wrapper`,this.insertBefore(r,this.firstChild)),this._radio?this._radio.parentElement!==r&&r.appendChild(this._radio):(this._radio=document.createElement(`input`),this._radio.type=`radio`,r.appendChild(this._radio),this.setupEventListeners()),this._radio.className=`mint-input-overlay`,this._radio.style.cssText=`position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; pointer-events: auto; margin: 0; padding: 0;`,this._radio.checked=this._checked,this._radio.disabled=n,this._changeHandler||this.setupEventListeners();let i=this.getId();i?this._radio.id=i:this._radio.removeAttribute(`id`);let a=this.getName();a?this._radio.name=a:this._radio.removeAttribute(`name`);let o=this.getValue();o?this._radio.value=o:this._radio.removeAttribute(`value`),e?this._radio.setAttribute(`aria-label`,e):this._radio.removeAttribute(`aria-label`),r.className=`mint-choice-wrapper ${this.getChoiceClasses()}`,r.style.pointerEvents=`none`,this._radio.style.pointerEvents=`auto`;let s=r.querySelector(`.mint-choice-indicator`);s||(s=document.createElement(`div`),s.className=`mint-choice-indicator`,s.style.transition=`opacity 200ms ease-out, transform 200ms ease-out`,s.style.zIndex=`1`,r.appendChild(s)),s.style.opacity=this._checked?`1`:`0`,s.style.transform=this._checked?`scale(1)`:`scale(0.8)`,this.updateVisualState();let c=this.querySelector(`.mint-choice-label-container`);if(e||t){c||(c=document.createElement(`div`),c.className=`mint-choice-label-container`,this.appendChild(c));let r=c.querySelector(`.mint-choice-label`);e?(r||(r=document.createElement(`span`),r.className=`mint-choice-label`,c.insertBefore(r,c.firstChild)),r.textContent=e,n?r.style.opacity=`0.5`:r.style.opacity=``):r&&r.remove();let i=c.querySelector(`.mint-choice-info`);if(t?(i||(i=document.createElement(`span`),i.className=`mint-choice-info`,c.appendChild(i)),i.textContent=t,n?i.style.opacity=`0.5`:i.style.opacity=``):i&&i.remove(),n)c.style.cursor=`default`,c._clickHandler&&(c.removeEventListener(`click`,c._clickHandler),c._clickHandler=null);else{c.style.cursor=`pointer`;let e=c._clickHandler;e&&c.removeEventListener(`click`,e),c._clickHandler=e=>{this._radio&&(e.target===this._radio||this._radio.contains(e.target)||e.composedPath().includes(this._radio))||this.select()},c.addEventListener(`click`,c._clickHandler)}}else c&&c.remove()}setupEventListeners(){this.removeEventListeners(),this._radio&&(this._changeHandler=e=>{e.stopPropagation();let t=this._checked;if(this._checked=this._radio.checked,this._checked?this.hasAttribute(`checked`)||this.setAttribute(`checked`,``):this.hasAttribute(`checked`)&&this.removeAttribute(`checked`),this.updateVisualState(),this._checked){let e=this._radio.name;e&&document.querySelectorAll(`input[type="radio"][name="${e}"]`).forEach(e=>{if(e!==this._radio){let t=e.closest(`mint-choice`);t&&t.updateVisualState&&(t._checked=e.checked,e.checked?t.hasAttribute(`checked`)||t.setAttribute(`checked`,``):t.hasAttribute(`checked`)&&t.removeAttribute(`checked`),t.updateVisualState())}})}if(t!==this._checked){let e=new CustomEvent(`change`,{detail:{checked:this._checked,value:this.getValue()},bubbles:!0,cancelable:!0});this.dispatchEvent(e)}},this._radio.addEventListener(`change`,this._changeHandler),this._groupChangeHandler=e=>{e.target!==this._radio&&e.target.type===`radio`&&e.target.name===this._radio.name&&e.target.checked&&setTimeout(()=>{this._radio&&this._radio.checked!==this._checked&&(this._checked=this._radio.checked,this._checked?this.hasAttribute(`checked`)||this.setAttribute(`checked`,``):this.hasAttribute(`checked`)&&this.removeAttribute(`checked`),this.updateVisualState())},0)},document.addEventListener(`change`,this._groupChangeHandler,!0),this._clickHandler=e=>{let t=this._radio.name;t&&document.querySelectorAll(`input[type="radio"][name="${t}"]`).forEach(e=>{if(e!==this._radio){let t=e.closest(`mint-choice`);t&&t.updateVisualState&&(t._checked=e.checked,e.checked?t.hasAttribute(`checked`)||t.setAttribute(`checked`,``):t.hasAttribute(`checked`)&&t.removeAttribute(`checked`),t.updateVisualState())}}),requestAnimationFrame(()=>{this._checked=this._radio.checked,this.updateVisualState()})},this._radio.addEventListener(`click`,this._clickHandler),this._mousedownHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-choice-wrapper`);t&&!this.isDisabled()&&(t.classList.add(`mint-choice-active`),this._checked?(t.style.backgroundColor=`var(--mint-color-primary)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.3)`):(t.style.backgroundColor=`var(--mint-color-surface-hover)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.1)`))},this._mouseupHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-choice-wrapper`);t&&(t.classList.remove(`mint-choice-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._mouseleaveHandler=e=>{let t=this.querySelector(`.mint-choice-wrapper`);t&&(t.classList.remove(`mint-choice-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._radio.addEventListener(`mousedown`,this._mousedownHandler),this._radio.addEventListener(`mouseup`,this._mouseupHandler),this._radio.addEventListener(`mouseleave`,this._mouseleaveHandler),this._touchstartHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-choice-wrapper`);t&&!this.isDisabled()&&(t.classList.add(`mint-choice-active`),this._checked?(t.style.backgroundColor=`var(--mint-color-primary)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.3)`):(t.style.backgroundColor=`var(--mint-color-surface-hover)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.1)`))},this._touchendHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-choice-wrapper`);t&&(t.classList.remove(`mint-choice-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._radio.addEventListener(`touchstart`,this._touchstartHandler),this._radio.addEventListener(`touchend`,this._touchendHandler))}removeEventListeners(){this._radio&&(this._changeHandler&&=(this._radio.removeEventListener(`change`,this._changeHandler),null),this._groupChangeHandler&&=(document.removeEventListener(`change`,this._groupChangeHandler),null),this._clickHandler&&=(this._radio.removeEventListener(`click`,this._clickHandler),null),this._mousedownHandler&&=(this._radio.removeEventListener(`mousedown`,this._mousedownHandler),null),this._mouseupHandler&&=(this._radio.removeEventListener(`mouseup`,this._mouseupHandler),null),this._mouseleaveHandler&&=(this._radio.removeEventListener(`mouseleave`,this._mouseleaveHandler),null),this._touchstartHandler&&=(this._radio.removeEventListener(`touchstart`,this._touchstartHandler),null),this._touchendHandler&&=(this._radio.removeEventListener(`touchend`,this._touchendHandler),null))}updateVisualState(){let e=this.querySelector(`.mint-choice-wrapper`),t=e?.querySelector(`.mint-choice-indicator`);t&&(t.style.opacity=this._checked?`1`:`0`,t.style.transform=this._checked?`scale(1)`:`scale(0.8)`),e&&(e.className=`mint-choice-wrapper ${this.getChoiceClasses()}`,e.classList.contains(`mint-choice-active`)||(e.style.backgroundColor=``,e.style.boxShadow=``))}select(){if(this._radio&&!this.isDisabled()){this._radio.checked=!0,this._radio.dispatchEvent(new Event(`change`,{bubbles:!0})),this._checked=!0,this.hasAttribute(`checked`)||this.setAttribute(`checked`,``);let e=this._radio.name;e&&document.querySelectorAll(`input[type="radio"][name="${e}"]`).forEach(e=>{if(e!==this._radio){let t=e.closest(`mint-choice`);t&&t.updateVisualState&&(t._checked=e.checked,e.checked?t.hasAttribute(`checked`)||t.setAttribute(`checked`,``):t.hasAttribute(`checked`)&&t.removeAttribute(`checked`),t.updateVisualState())}}),this.updateVisualState();let t=new CustomEvent(`change`,{detail:{checked:this._checked,value:this.getValue()},bubbles:!0,cancelable:!0});this.dispatchEvent(t)}}},Xt=class extends HTMLElement{static get observedAttributes(){return[`value`,`checked`,`disabled`]}constructor(){super(),this._labelText=``,this._radio=null,this._changeHandler=null}connectedCallback(){this.render()}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this.render()}render(){let e=this.closest(`mint-choice`),t=this.querySelector(`.mint-choice-option-label`);this._labelText||=t?.textContent?.trim()||this.textContent.trim();let n=this.querySelector(`:scope > .mint-choice-option-control`);n||(n=document.createElement(`label`),n.className=`mint-choice-option-control`,this.replaceChildren(n)),this._radio||(this._radio=document.createElement(`input`),this._radio.type=`radio`,this._radio.className=`mint-choice-option-input`,n.appendChild(this._radio),this._changeHandler=()=>{this._radio?.checked&&e&&(e.setValue(this.getAttribute(`value`)||``),e.dispatchEvent(new CustomEvent(`choice-option-change`,{detail:{value:this.getAttribute(`value`)||``,option:this},bubbles:!1})))},this._radio.addEventListener(`change`,this._changeHandler)),this._radio.name=e?.getAttribute(`name`)||``,this._radio.value=this.getAttribute(`value`)||``,this._radio.disabled=this.hasAttribute(`disabled`)||e?.hasAttribute(`disabled`)||!1,this._radio.required=e?.hasAttribute(`required`)||!1,this._radio.checked=this.hasAttribute(`checked`)||e?.getAttribute(`value`)===this._radio.value;let r=n.querySelector(`.mint-choice-option-label`);r||(r=document.createElement(`span`),r.className=`mint-choice-option-label`,n.appendChild(r)),r.textContent=this._labelText}};typeof customElements<`u`&&!customElements.get(`mint-choice`)&&a(`mint-choice`,Yt),typeof customElements<`u`&&!customElements.get(`mint-choice-option`)&&a(`mint-choice-option`,Xt),s({name:`arrow-left`,viewBox:`0 0 24 24`,path:`M19 12H5m7-7l-7 7 7 7`,strokeLinecap:`round`,strokeLinejoin:`round`});var Zt=class extends HTMLElement{static get observedAttributes(){return[`variant`,`tone`,`disabled`,`loading`,`button-type`,`type`,`full-width`,`icon-position`,`icon`]}constructor(){super(),this._button=null,this._clickHandler=null,this._isHandlingClick=!1}connectedCallback(){this.render(),this._button&&this.setupEventListeners()}disconnectedCallback(){this.removeEventListeners()}attributeChangedCallback(e,t,n){t!==n&&this.render()}getVariant(){return this.getAttribute(`variant`)||`solid`}getTone(){return this.getAttribute(`tone`)||`neutral`}isDisabled(){return this.hasAttribute(`disabled`)}isLoading(){return this.hasAttribute(`loading`)}getType(){return(this.getAttribute(`type`)||this.getAttribute(`button-type`)||`default`)===`submit`?`submit`:`button`}isFullWidth(){return this.hasAttribute(`full-width`)}getIconPosition(){return this.getAttribute(`icon-position`)||`left`}getIcon(){return this.getAttribute(`icon`)||``}isIconOnly(){if(!(this.getIcon()||this._button?.querySelector(`[slot="icon"], .mint-button-icon, mint-icon`)))return!1;let e=this._button?.querySelector(`.mint-button-content`);if(e&&e.textContent.trim())return!1;if(this._button){for(let e=this._button.firstChild;e;e=e.nextSibling)if(e.nodeType===Node.TEXT_NODE&&e.textContent.trim()||e.nodeType===Node.ELEMENT_NODE&&e.tagName!==`MINT-ICON`&&e.tagName!==`MINT-SPINNER`&&!e.querySelector?.(`mint-spinner`)&&!e.hasAttribute?.(`slot`)&&e.className!==`mint-button-icon`&&!(e.className===`mr-2`&&e.querySelector(`mint-spinner`))&&e.textContent.trim())return!1}return!0}getButtonClasses(){return[`mint-button-core`,`mint-button-`+this.getVariant(),`mint-button-tone-`+this.getTone(),this.isIconOnly()?`mint-button-icon-only`:``,this.isFullWidth()?`mint-button-full-width`:``].filter(Boolean).join(` `)}render(){let e=this.isDisabled()||this.isLoading(),t=this.getType();if(!this._button){for(this._button=document.createElement(`button`);this.firstChild;)this._button.appendChild(this.firstChild);this.appendChild(this._button),this.setupEventListeners()}this._button.type=t,this._button.disabled=e;let n=this._button.querySelector(`mint-spinner`);if(this.isLoading())if(n)n.setAttribute(`data-button-variant`,this.getVariant()),n.setAttribute(`data-button-tone`,this.getTone()),n.render();else{let e=document.createElement(`span`);e.className=`mint-spinner-wrap`;let t=document.createElement(`mint-spinner`);t.setAttribute(`size`,`default`),t.setAttribute(`data-button-variant`,this.getVariant()),t.setAttribute(`data-button-tone`,this.getTone()),t.style.width=`0.875rem`,t.style.height=`0.875rem`,e.appendChild(t),this._button.insertBefore(e,this._button.firstChild)}else n&&n.parentElement?.remove();for(;this.firstChild&&this.firstChild!==this._button;)this._button.appendChild(this.firstChild);let r=this.getIcon(),i=this._button.querySelector(`[slot="icon"], .mint-button-icon, mint-icon`);r?(i&&i.tagName!==`MINT-ICON`&&(i.remove(),i=null),!i||i.tagName!==`MINT-ICON`?(i=document.createElement(`mint-icon`),i.setAttribute(`name`,r),i.className=`mint-button-icon`):i.setAttribute(`name`,r)):i&&i.tagName===`MINT-ICON`&&(i.remove(),i=null),i||=this._button.querySelector(`[slot="icon"], .mint-button-icon`);let a=this.getIconPosition(),o=this._button.querySelector(`.mint-button-content`);if(o){let e=i&&i.tagName===`MINT-ICON`;if(i&&!i.parentElement){let t=this._button.querySelector(`mint-spinner`)?.parentElement;e||a===`left`?t?t.insertAdjacentElement(`afterend`,i):this._button.insertBefore(i,o):o.insertAdjacentElement(`afterend`,i)}else if(i&&(e||a===`left`)&&i.nextSibling!==o){i.remove();let e=this._button.querySelector(`mint-spinner`)?.parentElement;e?e.insertAdjacentElement(`afterend`,i):this._button.insertBefore(i,o)}else i&&!e&&a===`right`&&i.previousSibling!==o&&(i.remove(),o.insertAdjacentElement(`afterend`,i))}else{let e=[];for(let t=this._button.firstChild;t;t=t.nextSibling)t.tagName!==`MINT-SPINNER`&&!t.querySelector?.(`mint-spinner`)&&t!==i&&!t.hasAttribute?.(`slot`)&&!(t.className===`mr-2`&&t.querySelector(`mint-spinner`))&&e.push(t);if(e.length>0){o=document.createElement(`span`),o.className=`mint-button-content`,e.forEach(e=>{o.appendChild(e)});let t=this._button.querySelector(`mint-spinner`)?.parentElement;i&&a===`left`?t?(t.insertAdjacentElement(`afterend`,i),i.insertAdjacentElement(`afterend`,o)):(this._button.insertBefore(i,this._button.firstChild),i.insertAdjacentElement(`afterend`,o)):i&&a===`right`?t?(t.insertAdjacentElement(`afterend`,o),o.insertAdjacentElement(`afterend`,i)):(this._button.insertBefore(o,this._button.firstChild),o.insertAdjacentElement(`afterend`,i)):t?t.insertAdjacentElement(`afterend`,o):this._button.insertBefore(o,this._button.firstChild)}else if(i&&i.tagName===`MINT-ICON`&&!i.parentElement){let e=this._button.querySelector(`mint-spinner`)?.parentElement;e?e.insertAdjacentElement(`afterend`,i):this._button.insertBefore(i,this._button.firstChild)}}let s=this.isIconOnly();i&&(i.classList.contains(`mint-button-icon`)||i.classList.add(`mint-button-icon`),i.classList.remove(`mint-icon-leading`,`mint-icon-trailing`),s?i.tagName===`MINT-ICON`?(i.style.width=`1rem`,i.style.height=`1rem`,i.style.maxWidth=`1rem`,i.style.maxHeight=`1rem`,i.style.flexShrink=`0`):(i.style.maxWidth=`1rem`,i.style.maxHeight=`1rem`,i.style.flexShrink=`0`,i.tagName===`svg`&&(i.style.width=`1rem`,i.style.height=`1rem`)):a===`left`?i.classList.add(`mint-icon-leading`):i.classList.add(`mint-icon-trailing`));let c=this.getButtonClasses();this._button.className=c}setupEventListeners(){this._button&&!this._clickHandler&&(this._clickHandler=this.handleClick.bind(this),this._button.addEventListener(`click`,this._clickHandler,!0),this._button.addEventListener(`mousedown`,this._handleMouseDown),this._button.addEventListener(`mouseup`,this._handleMouseUp),this._button.addEventListener(`mouseleave`,this._handleMouseLeave),this._button.addEventListener(`touchstart`,this._handleTouchStart),this._button.addEventListener(`touchend`,this._handleTouchEnd),this._button.addEventListener(`touchcancel`,this._handleTouchCancel))}removeEventListeners(){this._button&&(this._clickHandler&&=(this._button.removeEventListener(`click`,this._clickHandler,!0),null),this._button.removeEventListener(`mousedown`,this._handleMouseDown),this._button.removeEventListener(`mouseup`,this._handleMouseUp),this._button.removeEventListener(`mouseleave`,this._handleMouseLeave),this._button.removeEventListener(`touchstart`,this._handleTouchStart),this._button.removeEventListener(`touchend`,this._handleTouchEnd),this._button.removeEventListener(`touchcancel`,this._handleTouchCancel))}_handleMouseDown=()=>{this._button&&!this.isDisabled()&&!this.isLoading()&&this._button.classList.add(`mint-button-active`)};_handleMouseUp=()=>{this._button&&this._button.classList.remove(`mint-button-active`)};_handleMouseLeave=()=>{this._button&&this._button.classList.remove(`mint-button-active`)};_handleTouchStart=()=>{this._button&&!this.isDisabled()&&!this.isLoading()&&this._button.classList.add(`mint-button-active`)};_handleTouchEnd=()=>{this._button&&this._button.classList.remove(`mint-button-active`)};_handleTouchCancel=()=>{this._button&&this._button.classList.remove(`mint-button-active`)};handleClick(e){if(this.isDisabled()||this.isLoading()){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();return}if(e.stopPropagation(),e.stopImmediatePropagation(),this._isHandlingClick){e.preventDefault();return}this._isHandlingClick=!0,e.preventDefault(),this.dispatchEvent(new CustomEvent(`click`,{detail:{originalEvent:e},bubbles:!0,cancelable:!0,composed:!0})),requestAnimationFrame(()=>{this._isHandlingClick=!1})}};typeof customElements<`u`&&!customElements.get(`mint-button`)&&a(`mint-button`,Zt);var Qt=class extends HTMLElement{static get observedAttributes(){return[`href`,`fallback-href`]}constructor(){super(),this._historyDepth=0,this._maxBackAttempts=10,this._backAttempts=0}connectedCallback(){this.render(),this._setupHistoryTracking()}attributeChangedCallback(e,t,n){t!==n&&this.render()}_setupHistoryTracking(){window.addEventListener(`popstate`,()=>{this._backAttempts=0}),this._historyDepth=window.history.length}getFallbackHref(){return this.getAttribute(`fallback-href`)||this.getAttribute(`href`)||`/`}handleClick(e){if(e.preventDefault(),e.stopPropagation(),window.history.length>1&&this._backAttempts<this._maxBackAttempts&&this._backAttempts===0){this._backAttempts++;let e=window.location.href,t=Date.now();window.history.back(),setTimeout(()=>{Date.now()-t,window.location.href===e?this._navigateToFallback():setTimeout(()=>{this._backAttempts=0},500)},200)}else this._navigateToFallback()}_navigateToFallback(){let e=this.getFallbackHref();if(this._backAttempts=0,e.startsWith(`/`)&&!e.startsWith(`//`))try{window.history.pushState({},``,e),window.dispatchEvent(new PopStateEvent(`popstate`));return}catch{}window.location.href=e}render(){this._button||(this._button=document.createElement(`mint-button`),this._button.setAttribute(`variant`,`neutral`),this._button.setAttribute(`icon`,`arrow-left`),this._button.addEventListener(`click`,e=>this.handleClick(e)),this.appendChild(this._button))}};typeof customElements<`u`&&!customElements.get(`mint-back-button`)&&a(`mint-back-button`,Qt);var $t=0,en=class extends HTMLElement{static get observedAttributes(){return[`brand`,`brand-href`,`direction`,`label`,`open`,`fixed`]}constructor(){super(),this._built=!1,this._brand=null,this._brandLink=null,this._leadingActions=null,this._items=null,this._toggle=null,this._toggleLabel=null,this._mobileActions=null,this._mobileActionNodes=[],this._instanceId=++$t,this._dropdowns=[],this._content=null,this._actions=null,this._activeDropdown=null,this._layoutObserver=null}connectedCallback(){this._built||this._build(),this._observeDropdowns(),this._syncResponsiveDropdowns(),this._syncMobileActions(),typeof ResizeObserver<`u`&&(this._layoutObserver=new ResizeObserver(()=>{this._syncResponsiveDropdowns(),this._syncMobileActions()}),this._layoutObserver.observe(this)),this._syncAttributes()}disconnectedCallback(){for(let e of this._dropdowns)e.observer?.disconnect();this._layoutObserver?.disconnect(),this._layoutObserver=null}attributeChangedCallback(e,t,n){t===n||!this._built||(e===`open`?this._syncOpenState():this._syncAttributes())}getDirection(){return this.getAttribute(`direction`)===`vertical`?`vertical`:`horizontal`}getBrand(){return this.getAttribute(`brand`)||``}getBrandHref(){return this.getAttribute(`brand-href`)||`/`}getLabel(){return this.getAttribute(`label`)||`Primary navigation`}_build(){let e=Array.from(this.childNodes),t=e.find(e=>e.nodeType===Node.ELEMENT_NODE&&e.getAttribute(`slot`)===`brand`),n=e.filter(e=>e.nodeType===Node.ELEMENT_NODE&&e.getAttribute(`slot`)===`leading-actions`),r=e.filter(e=>e.nodeType===Node.ELEMENT_NODE&&[`actions`,`mobile-actions`].includes(e.getAttribute(`slot`)));this._mobileActionNodes=r.filter(e=>e.getAttribute(`slot`)===`mobile-actions`);let i=e.filter(e=>e!==t&&!n.includes(e)&&!r.includes(e));this.replaceChildren();let a=document.createElement(`div`);a.className=`mint-navigation-shell`;let o=document.createElement(`div`);o.className=`mint-navigation-bar`,this._leadingActions=document.createElement(`div`),this._leadingActions.className=`mint-navigation-leading-actions`;for(let e of n)e.removeAttribute(`slot`),this._leadingActions.appendChild(e);this._brand=document.createElement(`div`),this._brand.className=`mint-navigation-brand`,t?(t.removeAttribute(`slot`),this._brand.appendChild(t)):this.getBrand()&&(this._brandLink=document.createElement(`mint-link`),this._brandLink.className=`mint-navigation-brand-link`,this._brandLink.textContent=this.getBrand(),this._brandLink.setAttribute(`href`,this.getBrandHref()),this._brand.appendChild(this._brandLink)),this._toggle=document.createElement(`mint-button`),this._toggle.className=`mint-navigation-toggle`,this._toggle.setAttribute(`aria-expanded`,`false`),this._toggle.addEventListener(`click`,()=>this.toggleMenu()),this._toggleLabel=document.createElement(`span`),this._toggleLabel.className=`mint-navigation-visually-hidden`,this._toggleLabel.textContent=`Open navigation menu`,this._toggle.append(this._toggleLabel),this._toggle.setAttribute(`variant`,`ghost`),this._toggle.setAttribute(`tone`,`action`),this._toggle.setAttribute(`button-type`,`button`),this._toggle.setAttribute(`icon`,`menu`),this._mobileActions=document.createElement(`div`),this._mobileActions.className=`mint-navigation-mobile-actions`,o.append(this._leadingActions,this._brand,this._mobileActions,this._toggle);let s=document.createElement(`div`);this._content=s,s.className=`mint-navigation-content`,this._items=document.createElement(`nav`),this._items.className=`mint-navigation-items`,this._items.setAttribute(`aria-label`,this.getLabel()),this._items.addEventListener(`click`,e=>{e.target.closest(`a, mint-link`)&&this.closeMenu()});let c=0;for(let e of i)if(e.nodeType!==Node.ELEMENT_NODE)this._items.appendChild(e);else if(e.tagName===`DETAILS`){let t=this._createDropdown(e,c++);this._items.append(t.trigger,t.popover),this._registerDropdown(t.trigger,t.popover)}else{let t=this._toMintLink(e);if(this._items.appendChild(t),t.nodeType===Node.ELEMENT_NODE&&t.tagName===`MINT-POPOVER`){let e=t.getAttribute(`trigger-id`),n=Array.from(this._items.querySelectorAll(`mint-button`)).find(t=>t.id===e);this._registerDropdown(n,t)}}let l=document.createElement(`div`);this._actions=l,l.className=`mint-navigation-actions`;for(let e of r)e.removeAttribute(`slot`),l.appendChild(e);let u=document.createElement(`section`);u.className=`mint-navigation-submenu`,u.setAttribute(`aria-label`,`Navigation submenu`);let d=document.createElement(`div`);d.className=`mint-navigation-submenu-header`;let f=document.createElement(`mint-button`);f.className=`mint-navigation-submenu-back`,f.setAttribute(`variant`,`ghost`),f.setAttribute(`tone`,`action`),f.setAttribute(`button-type`,`button`),f.setAttribute(`icon`,`arrow-left`),f.setAttribute(`aria-label`,`Back to main navigation`),f.addEventListener(`click`,()=>this._closeSubmenu());let p=document.createElement(`h3`);p.className=`mint-navigation-submenu-title`,d.append(f,p);let m=document.createElement(`nav`);m.className=`mint-navigation-submenu-items`,m.addEventListener(`click`,e=>{e.target.closest(`a, mint-link`)&&this.closeMenu()}),u.append(d,m),this._submenu=u,this._submenuTitle=p,this._submenuItems=m;for(let e of this._dropdowns)m.append(...e.submenuItems);s.append(this._items,l,u),a.append(o,s),this.appendChild(a),this._built=!0,this._syncMobileActions()}_syncMobileActions(){if(!this._mobileActions||!this._actions)return;let e=this._isMobileLayout()?this._mobileActions:this._actions;for(let t of this._mobileActionNodes)e.appendChild(t)}_toMintLink(e){if(e.nodeType!==Node.ELEMENT_NODE||e.tagName!==`A`)return e;let t=document.createElement(`mint-link`);for(;e.firstChild;)t.appendChild(e.firstChild);for(let n of Array.from(e.attributes))n.name!==`slot`&&t.setAttribute(n.name,n.value);return t}_createDropdown(e,t){let n=e.querySelector(`:scope > summary`),r=document.createElement(`mint-button`),i=`mint-navigation-${this._instanceId}-dropdown-${t}`,a=`${i}-popover`;if(r.id=i,r.className=`mint-navigation-dropdown-trigger`,r.setAttribute(`aria-haspopup`,`dialog`),r.setAttribute(`aria-expanded`,`false`),r.setAttribute(`aria-controls`,a),n){for(;n.firstChild;)r.appendChild(n.firstChild);n.remove()}else r.textContent=e.getAttribute(`label`)||`More`;r.setAttribute(`variant`,`ghost`),r.setAttribute(`tone`,`action`),r.setAttribute(`button-type`,`button`),r.setAttribute(`icon-position`,`right`);let o=document.createElement(`mint-popover`);o.id=a,o.className=`mint-navigation-dropdown`,o.setAttribute(`trigger-id`,i),o.setAttribute(`direction`,`down`),o.setAttribute(`aria-label`,`${r.textContent.trim()} links`);for(let t of Array.from(e.childNodes))o.appendChild(this._toMintLink(t));return{trigger:r,popover:o,observer:null}}_registerDropdown(e,t){if(!e||!t)return;t.id||=`mint-navigation-${this._instanceId}-popover-${this._dropdowns.length}`,e.classList.add(`mint-navigation-dropdown-trigger`),e.setAttribute(`aria-haspopup`,`dialog`),e.setAttribute(`aria-expanded`,String(t.hasAttribute(`open`))),e.setAttribute(`aria-controls`,t.id),t.classList.add(`mint-navigation-dropdown`),t.hasAttribute(`role`)||t.setAttribute(`role`,`group`),t.hasAttribute(`aria-label`)||t.setAttribute(`aria-label`,`${e.textContent.trim()} links`);let n=Array.from(t.querySelectorAll(`mint-link`)).map(e=>e.cloneNode(!0)),r={trigger:e,popover:t,observer:null,triggerId:t.getAttribute(`trigger-id`)||e.id,submenuItems:n};e.addEventListener(`click`,()=>{this._isMobileLayout()&&this._openSubmenu(r)}),this._dropdowns.push(r)}_observeDropdowns(){for(let e of this._dropdowns)e.observer||(e.observer=new MutationObserver(()=>{e.trigger.setAttribute(`aria-expanded`,String(e.popover.hasAttribute(`open`)))}),e.observer.observe(e.popover,{attributes:!0,attributeFilter:[`open`]}))}_isMobileLayout(){return this.getBoundingClientRect().width<=640}_syncResponsiveDropdowns(){let e=this._isMobileLayout();for(let t of this._dropdowns)e?(t.popover.hasAttribute(`open`)&&t.popover.close(),t.popover.getAttribute(`trigger-id`)&&t.popover.setAttribute(`trigger-id`,``)):t.triggerId&&t.popover.getAttribute(`trigger-id`)!==t.triggerId&&t.popover.setAttribute(`trigger-id`,t.triggerId);!e&&this._activeDropdown&&this._closeSubmenu()}_openSubmenu(e){this._isMobileLayout()&&(this._activeDropdown&&this._activeDropdown!==e&&this._activeDropdown.trigger.setAttribute(`aria-expanded`,`false`),this._activeDropdown=e,e.trigger.setAttribute(`aria-expanded`,`true`),this._submenuTitle.textContent=e.trigger.textContent.trim(),this._submenuItems.replaceChildren(...e.submenuItems),this._content.setAttribute(`data-submenu-open`,``))}_closeSubmenu(){this._activeDropdown?.trigger.setAttribute(`aria-expanded`,`false`),this._activeDropdown=null,this._content?.removeAttribute(`data-submenu-open`)}_syncAttributes(){if(this._brandLink){this._brandLink.setAttribute(`href`,this.getBrandHref());let e=this._brandLink.querySelector(`a`);e?e.textContent=this.getBrand():this._brandLink.textContent=this.getBrand()}this._items&&this._items.setAttribute(`aria-label`,this.getLabel()),this._syncOpenState()}_syncOpenState(){if(!this._toggle)return;let e=this.hasAttribute(`open`);this._toggle.setAttribute(`aria-expanded`,String(e));let t=e?`Close navigation menu`:`Open navigation menu`;this._toggle.setAttribute(`aria-label`,t),this._toggleLabel&&(this._toggleLabel.textContent=t),this._toggle.setAttribute(`icon`,e?`close`:`menu`)}openMenu(){this.setAttribute(`open`,``)}closeMenu(){this._closeSubmenu(),this.removeAttribute(`open`)}toggleMenu(){this.hasAttribute(`open`)?this.closeMenu():this.openMenu()}};typeof customElements<`u`&&!customElements.get(`mint-navigation`)&&a(`mint-navigation`,en),s({name:`info`,viewBox:`0 0 24 24`,path:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`}),s({name:`success`,viewBox:`0 0 24 24`,path:`M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`}),s({name:`warning`,viewBox:`0 0 24 24`,path:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z`,strokeLinecap:`round`,strokeLinejoin:`round`}),s({name:`error`,viewBox:`0 0 24 24`,path:`M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`}),s({name:`close`,viewBox:`0 0 24 24`,path:`M6 18L18 6M6 6l12 12`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3.2`});var tn=class extends HTMLElement{static get observedAttributes(){return[`heading`,`dismissable`,`tone`]}constructor(){super(),this._headingElement=null,this._iconElement=null,this._dismissButton=null,this._headerWrapper=null,this._bodyWrapper=null,this._dismissHandler=null,this._rendering=!1,this._childObserver=null,this._normalizingChildren=!1}connectedCallback(){this.render()}disconnectedCallback(){this._childObserver?.disconnect(),this._dismissButton?.removeEventListener(`click`,this._dismissHandler),this._dismissHandler=null}get heading(){return this.getAttribute(`heading`)??``}set heading(e){this.setAttribute(`heading`,String(e??``))}get tone(){return this.getTone()}set tone(e){this.setAttribute(`tone`,e)}get dismissable(){return this.isDismissable()}set dismissable(e){this.setAttribute(`dismissable`,String(!!e))}get dismissible(){return this.dismissable}set dismissible(e){this.dismissable=e}cleanupDismissListener(){this._dismissButton&&this._dismissHandler&&this._dismissButton.removeEventListener(`click`,this._dismissHandler),this._dismissHandler=null}attributeChangedCallback(e,t,n){t!==n&&this.render()}getHeading(){return this.getAttribute(`heading`)||``}getTone(){let e=this.getAttribute(`tone`);return e===`info`||e===`success`||e===`warning`||e===`danger`?e:`info`}isDismissable(){return this.getAttribute(`dismissable`)===`true`}getIconName(){switch(this.getTone()){case`info`:return`info`;case`success`:return`success`;case`warning`:return`warning`;case`danger`:return`error`;default:return`info`}}getAriaLive(){return this.getTone()===`danger`?`assertive`:`polite`}render(){if(!(this._rendering||!this.isConnected)){this._rendering=!0;try{this.renderContent()}finally{this._rendering=!1}}}renderContent(){this._childObserver?.disconnect();let e=this.getTone(),t=this.getHeading(),n=this.isDismissable(),r=this.getAriaLive();this.setAttribute(`role`,e===`danger`?`alert`:`status`),this.setAttribute(`aria-live`,r),e===`danger`?this.setAttribute(`aria-atomic`,`true`):this.removeAttribute(`aria-atomic`);let i=[];for(this._bodyWrapper?Array.from(this._bodyWrapper.childNodes).forEach(e=>{i.push(e)}):Array.from(this.childNodes).forEach(e=>{e!==this._headerWrapper&&e!==this._bodyWrapper&&e!==this._iconElement&&e!==this._headingElement&&e!==this._dismissButton&&i.push(e)}),this.cleanupDismissListener();this.firstChild;)this.removeChild(this.firstChild);if(this._headerWrapper=null,this._bodyWrapper=null,this._iconElement=null,this._headingElement=null,this._dismissButton=null,this._headerWrapper=document.createElement(`div`),this._headerWrapper.className=`mint-alert-header`,this._iconElement=document.createElement(`mint-icon`),this._iconElement.setAttribute(`name`,this.getIconName()),this._iconElement.className=`mint-alert-icon`,this._headerWrapper.appendChild(this._iconElement),this._headingElement=document.createElement(`mint-text`),this._headingElement.className=`mint-alert-heading`,this._headingElement.textContent=t||``,this._headerWrapper.appendChild(this._headingElement),n){this._dismissButton=document.createElement(`button`),this._dismissButton.className=`mint-alert-dismiss`,this._dismissButton.setAttribute(`aria-label`,`Dismiss alert`),this._dismissButton.setAttribute(`type`,`button`);let e=document.createElement(`mint-icon`);e.setAttribute(`name`,`close`),e.className=`mint-alert-close-icon`,this._dismissButton.appendChild(e),this._dismissHandler=e=>{e.preventDefault(),e.stopPropagation(),this.dispatchEvent(new CustomEvent(`dismissed`,{bubbles:!0,composed:!0})),this.remove()},this._dismissButton.addEventListener(`click`,this._dismissHandler),this._headerWrapper.appendChild(this._dismissButton)}this._bodyWrapper=document.createElement(`div`),this._bodyWrapper.className=`mint-alert-body`,i.forEach(e=>{this._bodyWrapper.appendChild(e)}),this.appendChild(this._headerWrapper),this.appendChild(this._bodyWrapper),this._childObserver||=new MutationObserver(()=>this.normalizeConsumerChildren()),this._childObserver.observe(this,{childList:!0})}normalizeConsumerChildren(){if(!(this._normalizingChildren||!this._bodyWrapper)){this._normalizingChildren=!0;try{Array.from(this.childNodes).forEach(e=>{e!==this._headerWrapper&&e!==this._bodyWrapper&&this._bodyWrapper.appendChild(e)})}finally{this._normalizingChildren=!1}}}};customElements.get(`mint-alert`)||a(`mint-alert`,tn);var H=class extends HTMLElement{constructor(...e){super(...e),this._lastScrollY=0,this._scrollHandler=null}connectedCallback(){this.classList.add(`mint-bottom-navigation`),this.setAttribute(`role`,`navigation`),this.hasAttribute(`aria-label`)||this.setAttribute(`aria-label`,`Primary`),this._lastScrollY=window.scrollY,this.hasAttribute(`data-preview`)||this._attachScrollListener()}disconnectedCallback(){this._detachScrollListener()}_attachScrollListener(){this._scrollHandler||(this._scrollHandler=()=>{let e=window.scrollY;if(e<=8){this.classList.remove(`is-hidden`),this._lastScrollY=e;return}let t=e-this._lastScrollY;Math.abs(t)<4||(t>0?this.classList.add(`is-hidden`):this.classList.remove(`is-hidden`),this._lastScrollY=e)},window.addEventListener(`scroll`,this._scrollHandler,{passive:!0}))}_detachScrollListener(){this._scrollHandler&&=(window.removeEventListener(`scroll`,this._scrollHandler),null)}};customElements.get(`mint-bottom-navigation`)||a(`mint-bottom-navigation`,H);var nn=class extends HTMLElement{constructor(...e){super(...e),this._root=null}static get observedAttributes(){return[`icon`,`label`,`href`,`active`]}connectedCallback(){this.classList.add(`mint-bottom-nav-item`),this.render()}attributeChangedCallback(e,t,n){t!==n&&this.render()}_isActive(){return this.hasAttribute(`active`)&&this.getAttribute(`active`)!==`false`}_getLabel(){return this.getAttribute(`label`)||``}_getIcon(){return this.getAttribute(`icon`)||``}_getHref(){return this.getAttribute(`href`)}render(){let e=this._getHref(),t=this._getLabel(),n=this._getIcon(),r=this._isActive(),i;e?(i=document.createElement(`a`),i.href=e):(i=document.createElement(`button`),i.type=`button`),i.className=`mint-bottom-nav-link`,i.setAttribute(`aria-current`,r?`page`:`false`);let a=n.split(`-`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `);i.setAttribute(`aria-label`,t||a||`Navigation item`);let o=document.createElement(`span`);if(o.className=`mint-bottom-nav-icon`,n){let e=document.createElement(`mint-icon`);e.setAttribute(`name`,n),e.className=`mint-bottom-nav-icon-glyph`,o.appendChild(e)}let s=document.createElement(`span`);s.className=`mint-bottom-nav-label`,s.textContent=t,i.appendChild(o),i.appendChild(s),this.replaceChildren(i),this._root=i}};customElements.get(`mint-bottom-nav-item`)||a(`mint-bottom-nav-item`,nn);var rn=H,an=class e extends HTMLElement{static get observedAttributes(){return[`type`,`data`,`width`,`height`,`show-legend`,`show-grid`,`show-tooltip`,`curve-tension`]}static{this.MAX_CACHE_SIZE=100}constructor(){super(),this._chartContainer=null,this._svg=null,this._tooltip=null,this._chartType=`line`,this._chartData=null,this._width=800,this._height=400,this._padding={top:20,right:20,bottom:60,left:60},this._showLegend=!0,this._showGrid=!0,this._showTooltip=!0,this._curveTension=.5,this._dataObserver=null,this._darkModeObserver=null,this._tooltipHideTimeout=null,this._lastTooltipContent=``,this._activeXValue=null,this._pinnedXValue=null,this._tooltipAnimationFrame=null,this._cachedTooltipContent=new Map,this._cachedXPositions=new Map,this._verticalLine=null,this._plotPoints=new Map,this._resizeObserver=null,this._windowResizeHandler=null,this._pieChartTimeouts=new Set,this._pieChartTooltipShown=!1,this._pieChartClickOutsideHandler=null,this._pieChartGroup=null,this._chartClickOutsideHandler=null,this._chartTooltipScrollHandler=null,this._cachedBounds={bounds:null,dataHash:``},this._cachedYRange={range:null,dataHash:``},this._cachedXValues={values:null,dataHash:``},this._renderScheduled=!1,this._animateNextRender=!1,this._observedDataReference=null,this._observedDataFingerprint=``,this._datasetVisibility=new Map,this._widthValue=`100%`,this._heightValue=400,this._defaultColors=[`#2563eb`,`#3b82f6`,`#0d9488`,`#7c3aed`,`#d97706`,`#059669`,`#dc2626`,`#c026d3`],this._legendHeight=0,this._rotatedLabelHeight=0}connectedCallback(){this.classList.add(`box-border`,`m-0`,`p-0`,`border-0`,`align-baseline`,`block`,`w-full`),this._setupDataObserver(),this._setupDarkModeObserver(),this._setupResizeObserver(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.render()})})}_setupDataObserver(){let e=()=>{if(!this.isConnected)return;let e=this.data,t=null;e&&typeof e==`object`&&!Array.isArray(e)&&`datasets`in e&&(t=e);let n=``;if(t)try{n=JSON.stringify(t)}catch{n=``}t&&(t!==this._observedDataReference||n&&n!==this._observedDataFingerprint)&&(this._observedDataReference=t,this._observedDataFingerprint=n,this._chartData=t,this._animateNextRender=!0,this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this.render())};requestAnimationFrame(()=>{e(),requestAnimationFrame(()=>{e()})});let t=setInterval(()=>{if(!this.isConnected){clearInterval(t);return}e()},250);this._dataCheckInterval=t}_setupDarkModeObserver(){this._darkModeObserver=new MutationObserver(()=>{this.isConnected&&this.render()}),this._darkModeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]})}disconnectedCallback(){if(this._tooltip&&this._tooltip.parentNode&&(this._tooltip.parentNode.removeChild(this._tooltip),this._tooltip=null),this._tooltipHideTimeout!==null&&(clearTimeout(this._tooltipHideTimeout),this._tooltipHideTimeout=null),this._pieChartTimeouts.forEach(e=>clearTimeout(e)),this._pieChartTimeouts.clear(),this._pieChartClickOutsideHandler&&=(document.removeEventListener(`click`,this._pieChartClickOutsideHandler,!0),null),this._chartClickOutsideHandler&&=(document.removeEventListener(`click`,this._chartClickOutsideHandler,!0),null),this._pieChartTooltipShown=!1,this._pieChartGroup=null,this._pinnedXValue=null,this._tooltipAnimationFrame!==null&&(cancelAnimationFrame(this._tooltipAnimationFrame),this._tooltipAnimationFrame=null),this._dataObserver&&=(this._dataObserver.disconnect(),null),this._darkModeObserver&&=(this._darkModeObserver.disconnect(),null),this._dataCheckInterval&&=(clearInterval(this._dataCheckInterval),null),this._svg&&(this._chartTooltipMouseMove&&=(this._svg.removeEventListener(`mousemove`,this._chartTooltipMouseMove),null),this._chartTooltipMouseLeave&&=(this._svg.removeEventListener(`mouseleave`,this._chartTooltipMouseLeave),null),this._chartTooltipTouchStart&&=(this._svg.removeEventListener(`touchstart`,this._chartTooltipTouchStart),null),this._chartTooltipTouchMove&&=(this._svg.removeEventListener(`touchmove`,this._chartTooltipTouchMove),null),this._chartTooltipTouchEnd&&=(this._svg.removeEventListener(`touchend`,this._chartTooltipTouchEnd),null)),this._chartTooltipScrollHandler){window.removeEventListener(`scroll`,this._chartTooltipScrollHandler,!0),this._chartContainer&&this._chartContainer.removeEventListener(`scroll`,this._chartTooltipScrollHandler,!0);let e=this.parentElement;for(;e;)e.removeEventListener(`scroll`,this._chartTooltipScrollHandler,!0),e=e.parentElement;this._chartTooltipScrollHandler=null}this._resizeObserver&&=(this._resizeObserver.disconnect(),null),this._windowResizeHandler&&=(window.removeEventListener(`resize`,this._windowResizeHandler),null),this._cachedTooltipContent.clear(),this._cachedXPositions.clear(),this._plotPoints.clear(),this._cachedBounds={bounds:null,dataHash:``},this._cachedYRange={range:null,dataHash:``},this._cachedXValues={values:null,dataHash:``}}_handleResize(){if(!this.isConnected)return;let e=this.getBoundingClientRect(),t=e.width||this.parentElement?.clientWidth||800,n=e.height||this.parentElement?.clientHeight||400,r=this._calculateDimension(this._widthValue,t,t),i=this._calculateDimension(this._heightValue,n,400);(r!==this._width||i!==this._height)&&(this._width=r,this._height=i,this.render())}_setupResizeObserver(){this._resizeObserver&&=(this._resizeObserver.disconnect(),null),this._windowResizeHandler&&=(window.removeEventListener(`resize`,this._windowResizeHandler),null);let e=null,t=()=>{e&&clearTimeout(e),e=window.setTimeout(()=>{this._handleResize()},100)};this._windowResizeHandler=t,this._resizeObserver=new ResizeObserver(()=>{t()}),this._resizeObserver.observe(this),window.addEventListener(`resize`,t)}attributeChangedCallback(e,t,n){if(t!==n){if(e===`data`){if(n)try{this._chartData=JSON.parse(n)}catch(e){console.error(`mint-chart: Invalid data JSON`,e),this._chartData=null}else this._chartData=null;this._invalidateDataCaches(),this._animateNextRender=!0}(e===`width`||e===`height`)&&this.isConnected&&(t&&t.endsWith(`%`))!==(n&&n.endsWith(`%`))&&this._setupResizeObserver(),this.isConnected&&requestAnimationFrame(()=>{this.render()})}}get type(){let e=this.getAttribute(`type`)||`line`;return e===`line`||e===`bar`||e===`area`||e===`pie`?e:`line`}set type(e){this.setAttribute(`type`,e)}get data(){return this._chartData}set data(e){if(typeof e==`string`)try{this._chartData=JSON.parse(e)}catch(e){console.error(`mint-chart: Invalid data JSON`,e),this._chartData=null}else this._chartData=e;this._invalidateDataCaches(),this._animateNextRender=!0,this.isConnected&&requestAnimationFrame(()=>{this.render()})}get width(){let e=this.getAttribute(`width`);if(!e)return this._widthValue;if(e.endsWith(`%`))return e;let t=parseInt(e,10);return isNaN(t)?this._widthValue:t}set width(e){this.setAttribute(`width`,e.toString())}get height(){let e=this.getAttribute(`height`);if(!e)return this._heightValue;if(e.endsWith(`%`))return e;let t=parseInt(e,10);return isNaN(t)?this._heightValue:t}set height(e){this.setAttribute(`height`,e.toString())}_calculateDimension(e,t,n){if(typeof e==`number`)return e;if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!isNaN(n))return t*n/100}return n}_scheduleRender(){this._animateNextRender=!0,this._syncObservedData(),!this._renderScheduled&&(this._renderScheduled=!0,requestAnimationFrame(()=>{this._renderScheduled=!1,this.render()}))}_invalidateDataCaches(){this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent?.clear()}_syncObservedData(){this._observedDataReference=this._chartData;try{this._observedDataFingerprint=this._chartData?JSON.stringify(this._chartData):``}catch{this._observedDataFingerprint=``}}_isDatasetVisible(e,t){if(e.id){let t=this._datasetVisibility.get(e.id);if(t!==void 0)return t}return e.visible!==!1}_initializeDatasetVisibility(){this._chartData&&this._chartData.datasets.forEach((e,t)=>{e.id&&(this._datasetVisibility.has(e.id)||this._datasetVisibility.set(e.id,e.visible!==!1))})}render(){if(!this.isConnected)return;let e=this._animateNextRender&&!window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches&&this._svg?this._svg.cloneNode(!0):null;this._animateNextRender=!1,this._plotPoints.clear(),this._activeXValue=null,this._cachedTooltipContent?.clear(),this._cachedXPositions?.clear(),this._chartType=this.type;let t=this.data;if(t&&typeof t==`object`&&!Array.isArray(t)&&`datasets`in t&&(this._chartData=t),!this._chartData){let e=this.getAttribute(`data`);if(e)try{this._chartData=JSON.parse(e)}catch(e){console.error(`mint-chart: Invalid data JSON`,e),this._chartData=null}}this._widthValue=this.width,this._heightValue=this.height;let n=this.getBoundingClientRect(),r=n.width||this.parentElement?.clientWidth||800,i=n.height||this.parentElement?.clientHeight||400;this._width=this._calculateDimension(this._widthValue,r,r),this._height=this._calculateDimension(this._heightValue,i,400),this._showLegend=this.getAttribute(`show-legend`)!==`false`,this._showGrid=this.getAttribute(`show-grid`)!==`false`,this._showTooltip=this.getAttribute(`show-tooltip`)!==`false`;let a=this.getAttribute(`curve-tension`);if(a!==null){let e=parseFloat(a);this._curveTension=isNaN(e)?.5:Math.max(0,Math.min(1,e))}else this._curveTension=.5;if(!this._chartData||!this._chartData.datasets||this._chartData.datasets.length===0){this.innerHTML=`<div class="p-4 text-gray-500">No chart data provided</div>`;return}this.innerHTML=``,this._chartContainer=document.createElement(`div`),this._chartContainer.className=`relative w-full`,this._chartContainer.style.position=`relative`,typeof this._widthValue==`string`&&this._widthValue.endsWith(`%`)?this._chartContainer.style.width=this._widthValue:this._chartContainer.style.width=`${this._width}px`,typeof this._heightValue==`string`&&this._heightValue.endsWith(`%`)?this._chartContainer.style.height=this._heightValue:this._chartContainer.style.height=`${this._height}px`,this.appendChild(this._chartContainer),this._svg=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`),this._svg.setAttribute(`width`,this._width.toString()),this._svg.setAttribute(`height`,this._height.toString()),this._svg.setAttribute(`viewBox`,`0 0 ${this._width} ${this._height}`),this._svg.setAttribute(`class`,`w-full h-full`),this._svg.setAttribute(`role`,`img`);let o=this._chartData.datasets.map(e=>e.name).filter(Boolean),s=this.getAttribute(`aria-label`)?.trim()||`${this.type} chart${o.length?` showing ${o.join(`, `)}`:``}. ${Math.max(0,...this._chartData.datasets.map(e=>e.data.length))} data points.`,c=`${this.id||`mint-chart-${Math.random().toString(36).slice(2,10)}`}-data`;this._svg.setAttribute(`aria-label`,s),this._svg.setAttribute(`aria-describedby`,c),this._chartContainer&&this._svg&&(e&&(e.style.position=`absolute`,e.style.inset=`0`,e.style.width=`100%`,e.style.height=`100%`,e.style.pointerEvents=`none`,e.style.zIndex=`1`,e.style.opacity=`1`,e.style.transition=`opacity 260ms ease`,this._chartContainer.appendChild(e),this._svg.style.position=`relative`,this._svg.style.zIndex=`0`,this._svg.style.opacity=`0`,this._svg.style.transition=`opacity 260ms ease`),this._chartContainer.appendChild(this._svg));let l=document.createElement(`table`);l.id=c,Object.assign(l.style,{position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,top:`0`,left:`0`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:`0`});let u=document.createElement(`caption`);u.textContent=`Data for ${s}`,l.appendChild(u);let d=document.createElement(`thead`),f=document.createElement(`tr`),p=document.createElement(`th`);p.scope=`col`,p.textContent=`Category`,f.appendChild(p),this._chartData.datasets.forEach(e=>{let t=document.createElement(`th`);t.scope=`col`,t.textContent=e.name||`Series`,f.appendChild(t)}),d.appendChild(f),l.appendChild(d);let m=document.createElement(`tbody`),h=Math.max(0,...this._chartData.datasets.map(e=>e.data.length));for(let e=0;e<h;e+=1){let t=document.createElement(`tr`),n=document.createElement(`th`);n.scope=`row`,n.textContent=String(this._chartData.datasets.find(t=>t.data[e])?.data[e]?.x??e+1),t.appendChild(n),this._chartData.datasets.forEach(n=>{let r=document.createElement(`td`),i=n.data[e];r.textContent=i?this._formatValue(i.y,n):``,t.appendChild(r)}),m.appendChild(t)}switch(l.appendChild(m),this.appendChild(l),this._showTooltip&&this._createTooltip(),this._initializeDatasetVisibility(),this._calculateRotatedLabelHeight(),this._showLegend?this._legendHeight=this._calculateLegendHeight():this._legendHeight=0,this._showLegend&&this._renderLegend(),this._chartType!==`pie`&&this._pieChartClickOutsideHandler&&(document.removeEventListener(`click`,this._pieChartClickOutsideHandler,!0),this._pieChartClickOutsideHandler=null,this._pieChartTooltipShown=!1,this._pieChartGroup=null),this._pinnedXValue=null,this._chartType){case`line`:this._renderLineChart();break;case`bar`:this._renderBarChart();break;case`area`:this._renderAreaChart();break;case`pie`:this._renderPieChart();break}if(this._showTooltip&&this._chartType!==`pie`&&(this._setupChartTooltip(),this._setupTooltipScrollHandler()),this._createVerticalLine(),e&&this._svg){let t=this._svg;requestAnimationFrame(()=>requestAnimationFrame(()=>{t.isConnected&&(e.style.opacity=`0`,t.style.opacity=`1`,window.setTimeout(()=>e.remove(),280))}))}}_createTooltip(){this._tooltip&&this._tooltip.parentNode&&this._tooltip.parentNode.removeChild(this._tooltip),this._tooltip=document.createElement(`div`),this._tooltip.className=`fixed pointer-events-none z-50 bg-gray-900 dark:bg-mint-elevated text-white text-xs rounded px-2 py-1 shadow-lg opacity-0`,this._tooltip.style.display=`none`,document.body.appendChild(this._tooltip)}_showTooltipAt(e,t,n){if(!this._tooltip)return;this._tooltipHideTimeout!==null&&(clearTimeout(this._tooltipHideTimeout),this._tooltipHideTimeout=null),this._lastTooltipContent!==n&&(this._tooltip.innerHTML=n,this._lastTooltipContent=n),(this._tooltip.style.display===`none`||this._tooltip.style.opacity===`0`)&&(this._tooltip.style.display=`block`,this._tooltip.style.opacity=`1`,this._tooltip.style.padding=`8px 12px`);let r=this._tooltip.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight,o=e+10,s=t-r.height-8;o+r.width>i&&(o=e-r.width-10),o<0&&(o=10),s<0&&(s=t+20),s+r.height>a&&(s=t-r.height-8,s<0&&(s=10));let c=`${o}px`,l=`${s}px`;this._tooltip.style.left!==c&&(this._tooltip.style.left=c),this._tooltip.style.top!==l&&(this._tooltip.style.top=l)}_hideTooltip(){this._tooltip&&(this._tooltipHideTimeout!==null&&(clearTimeout(this._tooltipHideTimeout),this._tooltipHideTimeout=null),this._tooltip.style.opacity=`0`,this._tooltipHideTimeout=window.setTimeout(()=>{this._tooltip&&(this._tooltip.style.display=`none`),this._tooltipHideTimeout=null},200))}_createVerticalLine(){if(!this._svg)return;this._verticalLine&&this._verticalLine.parentNode&&this._verticalLine.parentNode.removeChild(this._verticalLine),this._verticalLine=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);let e=document.documentElement.classList.contains(`dark`);this._verticalLine.setAttribute(`stroke`,e?`#9ca3af`:`#6b7280`),this._verticalLine.setAttribute(`stroke-width`,`1`),this._verticalLine.setAttribute(`stroke-dasharray`,`4,2`),this._verticalLine.style.opacity=`0`,this._verticalLine.style.pointerEvents=`none`;let t=this._svg.querySelector(`.chart-legend`);t&&t.parentNode?t.parentNode.insertBefore(this._verticalLine,t):this._svg.appendChild(this._verticalLine)}_showVerticalLineAtX(e,t){if(!this._verticalLine)return;let n=this._chartType===`bar`?this._scaleXForBarChart(e,t):this._scaleX(e,t);this._verticalLine.setAttribute(`x1`,n.toString()),this._verticalLine.setAttribute(`y1`,t.y.toString()),this._verticalLine.setAttribute(`x2`,n.toString()),this._verticalLine.setAttribute(`y2`,(t.y+t.height).toString()),this._verticalLine.style.opacity=`1`}_hideVerticalLine(){this._verticalLine&&(this._verticalLine.style.opacity=`0`)}_showPlotPointsForX(e){this._plotPoints.forEach(e=>{e.forEach(e=>{e.style.opacity=`0`})});let t=String(e),n=this._plotPoints.get(t);n&&n.forEach(e=>{e.style.opacity=`1`})}_hidePlotPoints(){this._plotPoints.forEach(e=>{e.forEach(e=>{e.style.opacity=`0`})})}_calculateMaxYAxisLabelWidth(){if(!this._showGrid||!this._chartData)return 0;let e=document.createElement(`canvas`).getContext(`2d`);if(!e)return 60;e.font=`12px system-ui, -apple-system, sans-serif`;let t=this._showLegend?Math.max(this._legendHeight,60):0,n=this._height-t,r=Math.floor(n/35),i=Math.max(1,Math.min(5,r)),a=this._getYRange();if(this._hasOnlyZeroValues())return Math.ceil(e.measureText(this._formatYAxisValue(0)).width)+20;let o=0;for(let t=0;t<=i;t++){let n=a.max-(a.max-a.min)/i*t,r=this._formatYAxisValue(n),s=e.measureText(r);o=Math.max(o,s.width)}return Math.ceil(o)+20}_getChartBounds(){let e=this._calculateMaxYAxisLabelWidth(),t=`${this._width}-${this._height}-${this._showGrid}-${this._showLegend}-${this._legendHeight}-${e}-${this._rotatedLabelHeight}`;if(this._cachedBounds.bounds&&this._cachedBounds.dataHash===t)return this._cachedBounds.bounds;let n=0,r=0;this._showGrid&&(n=e+10);let i=(this._rotatedLabelHeight>0?30:20)+this._rotatedLabelHeight+12,a=i;this._showLegend&&(a=i+20+Math.max(this._legendHeight,60));let o=this._height-0-n-0,s=o-a,c=1;if(s<100&&a>0){let e=o-100;e>0?(c=Math.min(1,e/a),c=Math.max(.5,c)):c=.5}r=a*c;let l=this._width*.3,u=n,d=1;n>l&&(d=l/n,u=l);let f={width:(this._width-u-0)*d,height:this._height-0-r,x:u,y:0};return this._cachedBounds={bounds:f,dataHash:t},f}_getAllDataPoints(){if(!this._chartData)return[];let e=[];return this._chartData.datasets.forEach((t,n)=>{this._isDatasetVisible(t,n)&&e.push(...t.data)}),e}_hasOnlyZeroValues(){let e=this._getAllDataPoints();return e.length>0&&e.every(e=>e.y===0)}_getXValues(){if(!this._chartData)return[];let e=JSON.stringify(this._chartData.labels)+JSON.stringify(this._chartData.datasets.map(e=>e.data.map(e=>e.x)));if(this._cachedXValues.values&&this._cachedXValues.dataHash===e)return this._cachedXValues.values;if(this._chartData.labels&&this._chartData.labels.length>0)return this._cachedXValues={values:this._chartData.labels,dataHash:e},this._chartData.labels;let t=new Set;this._chartData.datasets.forEach((e,n)=>{this._isDatasetVisible(e,n)&&e.data.forEach(e=>{t.add(e.x)})});let n=Array.from(t).sort((e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e-t;let n=String(e),r=String(t),i=/^([A-Za-z]{3})\s+(\d{4})$/,a=n.match(i),o=r.match(i);if(a&&o){let e=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],t=e.indexOf(a[1]),n=e.indexOf(o[1]),r=parseInt(a[2]),i=parseInt(o[2]);return r===i?t-n:r-i}return n.localeCompare(r)});return this._cachedXValues={values:n,dataHash:e},n}_getYRange(){if(!this._chartData)return{min:0,max:100};let e=JSON.stringify(this._chartData.datasets.map(e=>e.data.map(e=>e.y)));if(this._cachedYRange.range&&this._cachedYRange.dataHash===e)return this._cachedYRange.range;let t=this._getAllDataPoints();if(t.length===0){let t={min:0,max:100};return this._cachedYRange={range:t,dataHash:e},t}let n=t.map(e=>e.y),r=Math.min(...n),i=Math.max(...n),a=(i-r)*.1,o={min:Math.max(0,r-a),max:i+a};return this._cachedYRange={range:o,dataHash:e},o}_hasDecimalValues(){return this._getAllDataPoints().some(e=>e.y%1!=0)}_formatValueByString(e,t){switch(t.toLowerCase()){case`currency`:case`currency-usd`:return new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`}).format(e);case`currency-eur`:return new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`EUR`}).format(e);case`currency-gbp`:return new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`GBP`}).format(e);case`number`:case`number-with-commas`:return new Intl.NumberFormat(`en-US`).format(e);case`percent`:return new Intl.NumberFormat(`en-US`,{style:`percent`,minimumFractionDigits:1}).format(e/100);default:return this._hasDecimalValues()&&e%1!=0?e.toFixed(1):Math.round(e).toString()}}_formatXAxisValue(e){if(this._chartData?.formatXAxis){if(typeof this._chartData.formatXAxis==`function`)return this._chartData.formatXAxis(e);if(typeof this._chartData.formatXAxis==`string`)return String(e)}return String(e)}_escapeHtmlForTooltip(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}_tooltipXHeadingHtml(e){return`<strong>${this._escapeHtmlForTooltip(this._formatXAxisValue(e))}</strong><br/>`}_formatYAxisValue(e){if(this._chartData?.formatYAxis){if(typeof this._chartData.formatYAxis==`function`)return this._chartData.formatYAxis(e);if(typeof this._chartData.formatYAxis==`string`)return this._formatValueByString(e,this._chartData.formatYAxis)}if(this._chartData?.datasets?.[0]?.formatValue){if(typeof this._chartData.datasets[0].formatValue==`function`)return this._chartData.datasets[0].formatValue(e);if(typeof this._chartData.datasets[0].formatValue==`string`)return this._formatValueByString(e,this._chartData.datasets[0].formatValue)}return this._hasDecimalValues()&&e%1!=0?e.toFixed(1):Math.round(e).toString()}_formatValue(e,t){if(t.formatValue){if(typeof t.formatValue==`function`)return t.formatValue(e);if(typeof t.formatValue==`string`)return this._formatValueByString(e,t.formatValue)}return String(e)}_getAllDatasetsAtX(e){if(!this._chartData)return[];let t=[];return this._chartData.datasets.forEach((n,r)=>{if(!this._isDatasetVisible(n,r))return;let i=n.data.find(t=>String(t.x)===String(e));if(i){let e=this._getDatasetColor(n,r),a=this._formatValue(i.y,n);t.push({name:n.name,value:i.y,color:e,formattedValue:a})}}),t}_findNearestXValue(e){if(!this._chartData)return null;let t=this._getChartBounds(),n=this._getXValues();if(n.length===0)return null;let r=this._chartType===`bar`,i=null,a=1/0;return n.forEach(n=>{let o=r?this._scaleXForBarChart(n,t):this._scaleX(n,t),s=Math.abs(e-o);s<a&&(a=s,i=n)}),i}_setupTooltipScrollHandler(){if(this._chartTooltipScrollHandler){window.removeEventListener(`scroll`,this._chartTooltipScrollHandler,!0),this._chartContainer&&this._chartContainer.removeEventListener(`scroll`,this._chartTooltipScrollHandler,!0);let e=this.parentElement;for(;e;)e.removeEventListener(`scroll`,this._chartTooltipScrollHandler,!0),e=e.parentElement}this._chartTooltipScrollHandler=()=>{this._hideTooltip(),this._pinnedXValue=null},window.addEventListener(`scroll`,this._chartTooltipScrollHandler,!0),this._chartContainer&&this._chartContainer.addEventListener(`scroll`,this._chartTooltipScrollHandler,!0);let e=this.parentElement;for(;e;){let t=window.getComputedStyle(e),n=t.overflow,r=t.overflowY;(n===`auto`||n===`scroll`||r===`auto`||r===`scroll`)&&e.addEventListener(`scroll`,this._chartTooltipScrollHandler,!0),e=e.parentElement}}_setupChartTooltip(){if(!this._svg||!this._showTooltip)return;this._chartTooltipMouseMove&&this._svg.removeEventListener(`mousemove`,this._chartTooltipMouseMove),this._chartTooltipMouseLeave&&this._svg.removeEventListener(`mouseleave`,this._chartTooltipMouseLeave),this._chartTooltipClick&&this._svg.removeEventListener(`click`,this._chartTooltipClick),this._chartTooltipTouchStart&&this._svg.removeEventListener(`touchstart`,this._chartTooltipTouchStart),this._chartTooltipTouchMove&&this._svg.removeEventListener(`touchmove`,this._chartTooltipTouchMove),this._chartTooltipTouchEnd&&this._svg.removeEventListener(`touchend`,this._chartTooltipTouchEnd),this._cachedTooltipContent.clear(),this._cachedXPositions.clear();let t=this._getChartBounds(),n=0,r=0,i=i=>{!this._chartContainer||!this._svg||(n=i.clientX,r=i.clientY,this._tooltipAnimationFrame!==null&&cancelAnimationFrame(this._tooltipAnimationFrame),this._tooltipAnimationFrame=requestAnimationFrame(()=>{if(this._tooltipAnimationFrame=null,!this._svg)return;let i=this._svg.getBoundingClientRect(),a=n-i.left,o=r-i.top;if(a<t.x||a>t.x+t.width||o<t.y||o>t.y+t.height){this._hideTooltip(),this._hidePlotPoints(),this._hideVerticalLine(),this._activeXValue=null;return}let s=this._findNearestXValue(a);if(!s){this._hideTooltip(),this._hidePlotPoints(),this._hideVerticalLine(),this._activeXValue=null;return}if(this._pinnedXValue!==null&&this._pinnedXValue===s){let e=this._pinnedXValue,i=this._getAllDatasetsAtX(e);if(i.length>0){this._activeXValue=e,this._showPlotPointsForX(e),this._showVerticalLineAtX(e,t);let a=this._cachedTooltipContent.get(e);a||(a=this._tooltipXHeadingHtml(e),i.forEach(e=>{a+=`<div style="display: flex; align-items: center; gap: 6px; margin-top: 4px;">
|
|
105
105
|
<span style="display: inline-block; width: 12px; height: 12px; background-color: ${e.color}; border-radius: 2px;"></span>
|
|
106
106
|
<span>${e.name}: ${e.formattedValue}</span>
|
|
107
107
|
</div>`}),this._cachedTooltipContent.set(e,a)),this._updateTooltipPosition(n,r),this._lastTooltipContent!==a&&this._showTooltipAt(n,r,a);return}}if(this._activeXValue===s){this._updateTooltipPosition(n,r);return}let c=this._getAllDatasetsAtX(s);if(c.length===0){this._hideTooltip(),this._hidePlotPoints(),this._hideVerticalLine();return}this._activeXValue=s,this._showPlotPointsForX(s),this._showVerticalLineAtX(s,t);let l=this._cachedTooltipContent.get(s);if(!l){if(l=this._tooltipXHeadingHtml(s),c.forEach(e=>{l+=`<div style="display: flex; align-items: center; gap: 6px; margin-top: 4px;">
|
|
@@ -122,10 +122,10 @@ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{val
|
|
|
122
122
|
</div>`}),this._cachedTooltipContent.set(e,i)),this._updateTooltipPosition(r.clientX,r.clientY),this._lastTooltipContent!==i&&this._showTooltipAt(r.clientX,r.clientY,i);return}}let o=this._findNearestXValue(i);if(!o){this._pinnedXValue===null&&(this._hideTooltip(),this._hidePlotPoints(),this._hideVerticalLine(),this._activeXValue=null);return}if(this._activeXValue===o){this._updateTooltipPosition(r.clientX,r.clientY);return}let s=this._getAllDatasetsAtX(o);if(s.length===0){this._hideTooltip(),this._hidePlotPoints(),this._hideVerticalLine();return}this._activeXValue=o,this._showPlotPointsForX(o),this._showVerticalLineAtX(o,t);let c=this._cachedTooltipContent.get(o);if(!c){if(c=this._tooltipXHeadingHtml(o),s.forEach(e=>{c+=`<div style="display: flex; align-items: center; gap: 6px; margin-top: 4px;">
|
|
123
123
|
<span style="display: inline-block; width: 12px; height: 12px; background-color: ${e.color}; border-radius: 2px;"></span>
|
|
124
124
|
<span>${e.name}: ${e.formattedValue}</span>
|
|
125
|
-
</div>`}),this._cachedTooltipContent.size>=e.MAX_CACHE_SIZE){let e=this._cachedTooltipContent.keys().next().value;e!==void 0&&this._cachedTooltipContent.delete(e)}this._cachedTooltipContent.set(o,c)}this._showTooltipAt(r.clientX,r.clientY,c)}))},l=()=>{this._tooltipAnimationFrame!==null&&(cancelAnimationFrame(this._tooltipAnimationFrame),this._tooltipAnimationFrame=null),this._pinnedXValue===null&&setTimeout(()=>{this._hideTooltip(),this._hidePlotPoints(),this._hideVerticalLine(),this._activeXValue=null},500)};this._chartClickOutsideHandler||(this._chartClickOutsideHandler=e=>{if(this._pinnedXValue===null)return;let t=e.target;this._svg&&!this._svg.contains(t)&&(this._pinnedXValue=null,this._hideTooltip(),this._hidePlotPoints(),this._hideVerticalLine(),this._activeXValue=null)},document.addEventListener(`click`,this._chartClickOutsideHandler,!0)),this._svg.addEventListener(`mousemove`,i),this._svg.addEventListener(`mouseleave`,a),this._svg.addEventListener(`click`,o),this._svg.addEventListener(`touchstart`,s,{passive:!0}),this._svg.addEventListener(`touchmove`,c,{passive:!0}),this._svg.addEventListener(`touchend`,l),this._chartTooltipMouseMove=i,this._chartTooltipMouseLeave=a,this._chartTooltipClick=o,this._chartTooltipTouchStart=s,this._chartTooltipTouchMove=c,this._chartTooltipTouchEnd=l}_updateTooltipPosition(e,t){if(!this._tooltip||this._tooltip.style.display===`none`||this._tooltip.style.opacity===`0`)return;let n=this._tooltip.getBoundingClientRect(),r=window.innerWidth,i=window.innerHeight,a=e+10,o=t-n.height-8;a+n.width>r&&(a=e-n.width-10),a<0&&(a=10),o<0&&(o=t+20),o+n.height>i&&(o=t-n.height-8,o<0&&(o=10));let s=`${a}px`,c=`${o}px`;this._tooltip.style.left!==s&&(this._tooltip.style.left=s),this._tooltip.style.top!==c&&(this._tooltip.style.top=c)}_scaleX(e,t){let n=this._getXValues();if(n.length===0)return t.x;let r=n.indexOf(e);if(r===-1)return t.x;let i=t.width/Math.max(1,n.length-1);return t.x+r*i}_scaleY(e,t){let n=this._getYRange();if(n.max===n.min)return t.y+t.height/2;let r=(e-n.min)/(n.max-n.min);return t.y+t.height-r*t.height}_getDatasetColor(e,t,n){return n===void 0?e.color||this._defaultColors[t%this._defaultColors.length]:e.color||this._defaultColors[n%this._defaultColors.length]}_getContrastColor(e){let t=e.replace(`#`,``),n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16);return(.299*n+.587*r+.114*i)/255>.5?`#000000`:`#ffffff`}_calculateRotatedLabelHeight(){if(this._rotatedLabelHeight=0,!this._chartData||!this._showGrid)return;let e=this._getXValues();if(e.length<=1)return;let t={width:this._width-(this._showGrid?60:0)-0,height:this._height-(this._showLegend?Math.max(this._legendHeight,60):0)-0,x:this._showGrid?60:0,y:0},n=this._chartType===`bar`,r=[];e.forEach(e=>{let i=n?this._scaleXForBarChart(e,t):this._scaleX(e,t);r.push(i)});let i=document.createElement(`canvas`).getContext(`2d`);if(!i)return;i.font=`12px system-ui, -apple-system, sans-serif`;let a=[];e.forEach(e=>{let t=this._formatXAxisValue(e),n=i.measureText(t);a.push(n.width)});let o=!0;for(let t=1;t<e.length;t++){let e=r[t]-r[t-1],n=a[t-1]/2+a[t]/2+10;if(e<Math.max(n,80)){o=!1;break}}if(!o){let e=(Math.max(...a)+12*1.2)*.707;this._rotatedLabelHeight=Math.ceil(e)+10}}_renderGrid(e){if(!this._svg||!this._showGrid)return;let t=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);t.setAttribute(`class`,`chart-grid`);let n=this._getYRange(),r=Math.floor(e.height/35),i=Math.min(5,r);for(let r=0;r<=i;r++){let a=e.y+e.height/i*r,o=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);o.setAttribute(`x1`,e.x.toString()),o.setAttribute(`y1`,a.toString()),o.setAttribute(`x2`,(e.x+e.width).toString()),o.setAttribute(`y2`,a.toString()),o.setAttribute(`stroke`,`#e5e7eb`),o.setAttribute(`stroke-width`,`1`),o.setAttribute(`stroke-dasharray`,`2,2`),document.documentElement.classList.contains(`dark`)&&o.setAttribute(`stroke`,`#374151`),t.appendChild(o);let s=n.max-(n.max-n.min)/i*r,c=document.createElementNS(`http://www.w3.org/2000/svg`,`text`),l=a+4;r===0&&(l=a+12),c.setAttribute(`x`,`5`),c.setAttribute(`y`,l.toString()),c.setAttribute(`text-anchor`,`start`),c.setAttribute(`fill`,`#6b7280`),c.setAttribute(`font-size`,`12`),c.textContent=this._formatYAxisValue(s),document.documentElement.classList.contains(`dark`)&&c.setAttribute(`fill`,`#9ca3af`),t.appendChild(c)}let a=this._getXValues();if(a.length===0){this._svg.appendChild(t);return}let o=this._chartType===`bar`,s=[];a.forEach(t=>{let n=o?this._scaleXForBarChart(t,e):this._scaleX(t,e);s.push(n)});let c=document.createElement(`canvas`).getContext(`2d`),l=!1,u=Array(a.length).fill(!0);if(c&&a.length>1){c.font=`12px system-ui, -apple-system, sans-serif`;let e=[];a.forEach(t=>{let n=this._formatXAxisValue(t),r=c.measureText(n);e.push(r.width)});let t=!0;for(let n=1;n<a.length;n++){let r=s[n]-s[n-1],i=e[n-1]/2+e[n]/2+10;if(r<Math.max(i,80)){t=!1;break}}if(!t){l=!0;let t=12*1.2;if(this._rotatedLabelHeight===0){let n=(Math.max(...e)+t)*.707;this._rotatedLabelHeight=Math.ceil(n)+10}let n=t*1.5,r=!0;for(let e=1;e<a.length;e++)if(s[e]-s[e-1]<n){r=!1;break}if(!r){let e=n;u=Array(a.length).fill(!1);let t=-1/0;a.length>0&&(u[0]=!0,t=s[0]);for(let n=1;n<a.length-1;n++){let r=s[n];r-t>=e&&(u[n]=!0,t=r)}if(a.length>1){let n=s[a.length-1];if(n-t>=e)u[a.length-1]=!0;else{for(;n-t<e;){let e=!1;for(let n=a.length-2;n>=0;n--)if(u[n]){if(u[n]=!1,n>0){for(let r=n-1;r>=0;r--)if(u[r]){t=s[r],e=!0;break}e||(t=s[0])}else t=s[0];e=!0;break}if(!e)break}n-t>=e&&(u[a.length-1]=!0)}}}}}else u=Array(a.length).fill(!1),a.length>0&&(u[0]=!0),a.length>1&&(u[a.length-1]=!0),this._rotatedLabelHeight=0;l||(this._rotatedLabelHeight=0),a.forEach((n,r)=>{if(u[r]){let i=s[r],o=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);o.setAttribute(`x1`,i.toString()),o.setAttribute(`y1`,e.y.toString()),o.setAttribute(`x2`,i.toString()),o.setAttribute(`y2`,(e.y+e.height).toString()),o.setAttribute(`stroke`,`#e5e7eb`),o.setAttribute(`stroke-width`,`1`),o.setAttribute(`stroke-dasharray`,`2,2`),document.documentElement.classList.contains(`dark`)&&o.setAttribute(`stroke`,`#374151`),t.appendChild(o);let c=document.createElementNS(`http://www.w3.org/2000/svg`,`text`),u=i,d=`middle`;if(!l){if(r===0){let t=e.x;u=Math.max(i,t),d=`start`}else if(r===a.length-1){let t=e.x+e.width;u=Math.min(i,t),d=`end`}}else if(d=`end`,r===a.length-1){let t=document.createElement(`canvas`).getContext(`2d`);if(t){t.font=`12px system-ui, -apple-system, sans-serif`;let r=this._formatXAxisValue(n),a=t.measureText(r).width*.707,o=e.x+e.width+100;u=Math.min(i,o-a)}}c.setAttribute(`x`,u.toString());let f=(this._rotatedLabelHeight>0?30:20)+this._rotatedLabelHeight+12,p=f;this._showLegend&&(p=f+20+Math.max(this._legendHeight,60));let m=(this._height-e.y-e.height)/p,h=(l?30:20)*m,g=e.y+e.height+h;c.setAttribute(`y`,g.toString()),c.setAttribute(`text-anchor`,d),c.setAttribute(`fill`,`#6b7280`),c.setAttribute(`font-size`,`12`),l&&c.setAttribute(`transform`,`rotate(-45 ${u} ${g})`),c.textContent=this._formatXAxisValue(n),document.documentElement.classList.contains(`dark`)&&c.setAttribute(`fill`,`#9ca3af`),t.appendChild(c)}}),this._svg.appendChild(t)}_buildMonotoneXLinePathD(e){let t=e=>e<0?-1:1,n=(e,n,r,i,a,o)=>{let s=r-e,c=a-r,l=(i-n)/(s||c<0&&-0),u=(o-i)/(c||s<0&&-0),d=(l*c+u*s)/(s+c||1e-12);return(t(l)+t(u))*Math.min(Math.abs(l),Math.abs(u),.5*Math.abs(d))||0},r=(e,t,n,r,i)=>{let a=n-e;return a?(3*((r-t)/a)-i)/2:i},i=(e,t,n,r,i,a,o)=>{let s=(r-t)/3;e.push(`C ${t+s} ${n+s*a} ${r-s} ${i-s*o} ${r} ${i}`)},a=[];for(let t of e){let e=a[a.length-1];(!e||e.x!==t.x||e.y!==t.y)&&a.push(t)}if(a.length===0)return``;if(a.length===1)return`M ${a[0].x} ${a[0].y}`;let o=[],s=NaN,c=NaN,l=NaN,u=NaN,d=NaN,f=0;for(let e of a){let t=e.x,a=e.y;if(!(t===l&&a===u))switch(f){case 0:o.push(`M ${t} ${a}`),s=t,c=a,l=t,u=a,f=1;break;case 1:l=t,u=a,f=2;break;case 2:{let e=n(s,c,l,u,t,a);i(o,s,c,l,u,r(s,c,l,u,e),e),s=l,c=u,l=t,u=a,d=e,f=3;break}default:{let e=n(s,c,l,u,t,a);i(o,s,c,l,u,d,e),s=l,c=u,l=t,u=a,d=e}}}return f===2?o.push(`L ${l} ${u}`):f===3&&i(o,s,c,l,u,d,r(s,c,l,u,d)),o.join(` `)}_stripLeadingMoveTo(e){return e.replace(/^M\s+[\d.-]+\s+[\d.-]+\s*/i,``).trim()}_buildAreaFillPathD(e,t){if(e.length===0)return``;let n=e[e.length-1];if(e.length===1)return`M ${e[0].x} ${t} L ${e[0].x} ${e[0].y} L ${e[0].x} ${t} Z`;if(this._curveTension<=0){let r=[`M ${e[0].x} ${t}`,`L ${e[0].x} ${e[0].y}`];for(let t=1;t<e.length;t++)r.push(`L ${e[t].x} ${e[t].y}`);return r.push(`L ${n.x} ${t}`,`Z`),r.join(` `)}let r=this._buildMonotoneXLinePathD(e),i=this._stripLeadingMoveTo(r);return`M ${e[0].x} ${t} L ${e[0].x} ${e[0].y} ${i} L ${n.x} ${t} Z`}_buildSmoothLinePathD(e){if(e.length===0)return``;if(e.length===1)return`M ${e[0].x} ${e[0].y}`;if(this._curveTension<=0){let t=[`M ${e[0].x} ${e[0].y}`];for(let n=1;n<e.length;n++)t.push(`L ${e[n].x} ${e[n].y}`);return t.join(` `)}return this._buildMonotoneXLinePathD(e)}_renderLineChart(){if(!this._svg||!this._chartData)return;let e=this._getChartBounds();this._renderGrid(e);let t=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);t.setAttribute(`class`,`chart-data`);let n=document.createDocumentFragment();this._chartData.datasets.forEach((t,r)=>{if(!this._isDatasetVisible(t,r))return;let i=this._getDatasetColor(t,r),a=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),o=t.data.map(t=>({x:this._scaleX(t.x,e),y:this._scaleY(t.y,e)}));o.length!==0&&(a.setAttribute(`d`,this._buildSmoothLinePathD(o)),a.setAttribute(`fill`,`none`),a.setAttribute(`stroke`,i),a.setAttribute(`stroke-width`,`2`),a.setAttribute(`stroke-linecap`,`round`),a.setAttribute(`stroke-linejoin`,`round`),n.appendChild(a),t.data.forEach(a=>{let o=document.createElementNS(`http://www.w3.org/2000/svg`,`circle`),s=this._scaleX(a.x,e),c=this._scaleY(a.y,e);o.setAttribute(`cx`,s.toString()),o.setAttribute(`cy`,c.toString()),o.setAttribute(`r`,`4`),o.setAttribute(`fill`,i);let l=document.documentElement.classList.contains(`dark`);o.setAttribute(`stroke`,l?`#1f2937`:`#fff`),o.setAttribute(`stroke-width`,`2`),o.setAttribute(`class`,`chart-point`),o.setAttribute(`data-dataset`,r.toString()),o.setAttribute(`data-x`,String(a.x)),o.setAttribute(`data-y`,a.y.toString()),o.setAttribute(`data-name`,t.name),o.style.opacity=`0`,o.style.pointerEvents=`none`;let u=String(a.x);this._plotPoints.has(u)||this._plotPoints.set(u,[]),this._plotPoints.get(u).push(o),n.appendChild(o)}))}),t.appendChild(n),this._svg.appendChild(t)}_scaleXForBarChart(e,t){let n=this._getXValues();if(n.length===0)return t.x;let r=n.indexOf(e);if(r===-1)return t.x;let i=n.length+1,a=t.width/i;return t.x+(r+1)*a}_renderBarChart(){if(!this._svg||!this._chartData)return;let e=this._getChartBounds();this._renderGrid(e);let t=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);t.setAttribute(`class`,`chart-data`);let n=document.createDocumentFragment(),r=this._getXValues(),i=this._chartData.datasets.filter((e,t)=>this._isDatasetVisible(e,t)).length,a=r.length;if(a===0)return;let o=[];r.forEach(t=>{o.push(this._scaleXForBarChart(t,e))}),o.sort((e,t)=>e-t);let s=e.width;if(a>1)for(let e=0;e<o.length-1;e++){let t=o[e+1]-o[e];t>0&&t<s&&(s=t)}else s=e.width*.5;let c=s*.7,l=.2,u=c/((1+l)*i-l),d=u*l,f=(u+d)*i-d;if(f>c){let e=c/f;u*=e,d=u*l,f=(u+d)*i-d}let p=0;this._chartData.datasets.forEach((t,r)=>{if(!this._isDatasetVisible(t,r))return;let i=this._getDatasetColor(t,r),a=-f/2+(u+d)*p;p++,t.data.forEach(o=>{let s=this._scaleXForBarChart(o.x,e),c=this._scaleY(o.y,e),l=e.y+e.height-c,d=s+a,f=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`);f.setAttribute(`x`,d.toString()),f.setAttribute(`y`,c.toString()),f.setAttribute(`width`,u.toString()),f.setAttribute(`height`,l.toString()),f.setAttribute(`fill`,i),f.setAttribute(`rx`,`2`),f.setAttribute(`class`,`chart-bar`),f.setAttribute(`data-dataset`,r.toString()),f.setAttribute(`data-x`,String(o.x)),f.setAttribute(`data-y`,o.y.toString()),f.setAttribute(`data-name`,t.name),f.style.cursor=`pointer`,this._showTooltip&&f.addEventListener(`mouseenter`,e=>{let t=this._getAllDatasetsAtX(o.x),n=this._tooltipXHeadingHtml(o.x);t.forEach(e=>{n+=`<div style="display: flex; align-items: center; gap: 6px; margin-top: 4px;">
|
|
125
|
+
</div>`}),this._cachedTooltipContent.size>=e.MAX_CACHE_SIZE){let e=this._cachedTooltipContent.keys().next().value;e!==void 0&&this._cachedTooltipContent.delete(e)}this._cachedTooltipContent.set(o,c)}this._showTooltipAt(r.clientX,r.clientY,c)}))},l=()=>{this._tooltipAnimationFrame!==null&&(cancelAnimationFrame(this._tooltipAnimationFrame),this._tooltipAnimationFrame=null),this._pinnedXValue===null&&setTimeout(()=>{this._hideTooltip(),this._hidePlotPoints(),this._hideVerticalLine(),this._activeXValue=null},500)};this._chartClickOutsideHandler||(this._chartClickOutsideHandler=e=>{if(this._pinnedXValue===null)return;let t=e.target;this._svg&&!this._svg.contains(t)&&(this._pinnedXValue=null,this._hideTooltip(),this._hidePlotPoints(),this._hideVerticalLine(),this._activeXValue=null)},document.addEventListener(`click`,this._chartClickOutsideHandler,!0)),this._svg.addEventListener(`mousemove`,i),this._svg.addEventListener(`mouseleave`,a),this._svg.addEventListener(`click`,o),this._svg.addEventListener(`touchstart`,s,{passive:!0}),this._svg.addEventListener(`touchmove`,c,{passive:!0}),this._svg.addEventListener(`touchend`,l),this._chartTooltipMouseMove=i,this._chartTooltipMouseLeave=a,this._chartTooltipClick=o,this._chartTooltipTouchStart=s,this._chartTooltipTouchMove=c,this._chartTooltipTouchEnd=l}_updateTooltipPosition(e,t){if(!this._tooltip||this._tooltip.style.display===`none`||this._tooltip.style.opacity===`0`)return;let n=this._tooltip.getBoundingClientRect(),r=window.innerWidth,i=window.innerHeight,a=e+10,o=t-n.height-8;a+n.width>r&&(a=e-n.width-10),a<0&&(a=10),o<0&&(o=t+20),o+n.height>i&&(o=t-n.height-8,o<0&&(o=10));let s=`${a}px`,c=`${o}px`;this._tooltip.style.left!==s&&(this._tooltip.style.left=s),this._tooltip.style.top!==c&&(this._tooltip.style.top=c)}_scaleX(e,t){let n=this._getXValues();if(n.length===0)return t.x;let r=n.indexOf(e);if(r===-1)return t.x;let i=t.width/Math.max(1,n.length-1);return t.x+r*i}_scaleY(e,t){let n=this._getYRange();if(n.max===n.min)return n.min===0?t.y+t.height:t.y+t.height/2;let r=(e-n.min)/(n.max-n.min);return t.y+t.height-r*t.height}_getDatasetColor(e,t,n){return n===void 0?e.color||this._defaultColors[t%this._defaultColors.length]:e.color||this._defaultColors[n%this._defaultColors.length]}_getContrastColor(e){let t=e.replace(`#`,``),n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16);return(.299*n+.587*r+.114*i)/255>.5?`#000000`:`#ffffff`}_calculateRotatedLabelHeight(){if(this._rotatedLabelHeight=0,!this._chartData||!this._showGrid)return;let e=this._getXValues();if(e.length<=1)return;let t={width:this._width-(this._showGrid?60:0)-0,height:this._height-(this._showLegend?Math.max(this._legendHeight,60):0)-0,x:this._showGrid?60:0,y:0},n=this._chartType===`bar`,r=[];e.forEach(e=>{let i=n?this._scaleXForBarChart(e,t):this._scaleX(e,t);r.push(i)});let i=document.createElement(`canvas`).getContext(`2d`);if(!i)return;i.font=`12px system-ui, -apple-system, sans-serif`;let a=[];e.forEach(e=>{let t=this._formatXAxisValue(e),n=i.measureText(t);a.push(n.width)});let o=!0;for(let t=1;t<e.length;t++){let e=r[t]-r[t-1],n=a[t-1]/2+a[t]/2+10;if(e<Math.max(n,80)){o=!1;break}}if(!o){let e=(Math.max(...a)+12*1.2)*.707;this._rotatedLabelHeight=Math.ceil(e)+10}}_renderGrid(e){let t=this._chartType!==`pie`&&this._hasOnlyZeroValues();if(!this._svg||!this._showGrid&&!t)return;let n=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);n.setAttribute(`class`,`chart-grid`);let r=this._getYRange(),i=Math.floor(e.height/35),a=t?0:Math.max(1,Math.min(5,i));for(let i=0;i<=a;i++){let o=t?e.y+e.height:e.y+e.height/a*i,s=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);if(s.setAttribute(`x1`,e.x.toString()),s.setAttribute(`y1`,o.toString()),s.setAttribute(`x2`,(e.x+e.width).toString()),s.setAttribute(`y2`,o.toString()),s.setAttribute(`stroke`,t?`#9ca3af`:`#e5e7eb`),s.setAttribute(`stroke-width`,`1`),t||s.setAttribute(`stroke-dasharray`,`2,2`),document.documentElement.classList.contains(`dark`)&&s.setAttribute(`stroke`,`#374151`),n.appendChild(s),t&&!this._showGrid)continue;let c=t?0:r.max-(r.max-r.min)/a*i,l=document.createElementNS(`http://www.w3.org/2000/svg`,`text`),u=o+4;i===0&&(u=o+12),l.setAttribute(`x`,`5`),l.setAttribute(`y`,u.toString()),l.setAttribute(`text-anchor`,`start`),l.setAttribute(`fill`,`#6b7280`),l.setAttribute(`font-size`,`12`),l.textContent=this._formatYAxisValue(c),document.documentElement.classList.contains(`dark`)&&l.setAttribute(`fill`,`#9ca3af`),n.appendChild(l)}let o=this._getXValues();if(o.length===0){this._svg.appendChild(n);return}let s=this._chartType===`bar`,c=[];o.forEach(t=>{let n=s?this._scaleXForBarChart(t,e):this._scaleX(t,e);c.push(n)});let l=document.createElement(`canvas`).getContext(`2d`),u=!1,d=Array(o.length).fill(!0);if(l&&o.length>1){l.font=`12px system-ui, -apple-system, sans-serif`;let e=[];o.forEach(t=>{let n=this._formatXAxisValue(t),r=l.measureText(n);e.push(r.width)});let t=!0;for(let n=1;n<o.length;n++){let r=c[n]-c[n-1],i=e[n-1]/2+e[n]/2+10;if(r<Math.max(i,80)){t=!1;break}}if(!t){u=!0;let t=12*1.2;if(this._rotatedLabelHeight===0){let n=(Math.max(...e)+t)*.707;this._rotatedLabelHeight=Math.ceil(n)+10}let n=t*1.5,r=!0;for(let e=1;e<o.length;e++)if(c[e]-c[e-1]<n){r=!1;break}if(!r){let e=n;d=Array(o.length).fill(!1);let t=-1/0;o.length>0&&(d[0]=!0,t=c[0]);for(let n=1;n<o.length-1;n++){let r=c[n];r-t>=e&&(d[n]=!0,t=r)}if(o.length>1){let n=c[o.length-1];if(n-t>=e)d[o.length-1]=!0;else{for(;n-t<e;){let e=!1;for(let n=o.length-2;n>=0;n--)if(d[n]){if(d[n]=!1,n>0){for(let r=n-1;r>=0;r--)if(d[r]){t=c[r],e=!0;break}e||(t=c[0])}else t=c[0];e=!0;break}if(!e)break}n-t>=e&&(d[o.length-1]=!0)}}}}}else d=Array(o.length).fill(!1),o.length>0&&(d[0]=!0),o.length>1&&(d[o.length-1]=!0),this._rotatedLabelHeight=0;u||(this._rotatedLabelHeight=0),o.forEach((t,r)=>{if(d[r]){let i=c[r],a=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);a.setAttribute(`x1`,i.toString()),a.setAttribute(`y1`,e.y.toString()),a.setAttribute(`x2`,i.toString()),a.setAttribute(`y2`,(e.y+e.height).toString()),a.setAttribute(`stroke`,`#e5e7eb`),a.setAttribute(`stroke-width`,`1`),a.setAttribute(`stroke-dasharray`,`2,2`),document.documentElement.classList.contains(`dark`)&&a.setAttribute(`stroke`,`#374151`),n.appendChild(a);let s=document.createElementNS(`http://www.w3.org/2000/svg`,`text`),l=i,d=`middle`;if(!u){if(r===0){let t=e.x;l=Math.max(i,t),d=`start`}else if(r===o.length-1){let t=e.x+e.width;l=Math.min(i,t),d=`end`}}else if(d=`end`,r===o.length-1){let n=document.createElement(`canvas`).getContext(`2d`);if(n){n.font=`12px system-ui, -apple-system, sans-serif`;let r=this._formatXAxisValue(t),a=n.measureText(r).width*.707,o=e.x+e.width+100;l=Math.min(i,o-a)}}s.setAttribute(`x`,l.toString());let f=(this._rotatedLabelHeight>0?30:20)+this._rotatedLabelHeight+12,p=f;this._showLegend&&(p=f+20+Math.max(this._legendHeight,60));let m=(this._height-e.y-e.height)/p,h=(u?30:20)*m,g=e.y+e.height+h;s.setAttribute(`y`,g.toString()),s.setAttribute(`text-anchor`,d),s.setAttribute(`fill`,`#6b7280`),s.setAttribute(`font-size`,`12`),u&&s.setAttribute(`transform`,`rotate(-45 ${l} ${g})`),s.textContent=this._formatXAxisValue(t),document.documentElement.classList.contains(`dark`)&&s.setAttribute(`fill`,`#9ca3af`),n.appendChild(s)}}),this._svg.appendChild(n)}_buildMonotoneXLinePathD(e){let t=e=>e<0?-1:1,n=(e,n,r,i,a,o)=>{let s=r-e,c=a-r,l=(i-n)/(s||c<0&&-0),u=(o-i)/(c||s<0&&-0),d=(l*c+u*s)/(s+c||1e-12);return(t(l)+t(u))*Math.min(Math.abs(l),Math.abs(u),.5*Math.abs(d))||0},r=(e,t,n,r,i)=>{let a=n-e;return a?(3*((r-t)/a)-i)/2:i},i=(e,t,n,r,i,a,o)=>{let s=(r-t)/3;e.push(`C ${t+s} ${n+s*a} ${r-s} ${i-s*o} ${r} ${i}`)},a=[];for(let t of e){let e=a[a.length-1];(!e||e.x!==t.x||e.y!==t.y)&&a.push(t)}if(a.length===0)return``;if(a.length===1)return`M ${a[0].x} ${a[0].y}`;let o=[],s=NaN,c=NaN,l=NaN,u=NaN,d=NaN,f=0;for(let e of a){let t=e.x,a=e.y;if(!(t===l&&a===u))switch(f){case 0:o.push(`M ${t} ${a}`),s=t,c=a,l=t,u=a,f=1;break;case 1:l=t,u=a,f=2;break;case 2:{let e=n(s,c,l,u,t,a);i(o,s,c,l,u,r(s,c,l,u,e),e),s=l,c=u,l=t,u=a,d=e,f=3;break}default:{let e=n(s,c,l,u,t,a);i(o,s,c,l,u,d,e),s=l,c=u,l=t,u=a,d=e}}}return f===2?o.push(`L ${l} ${u}`):f===3&&i(o,s,c,l,u,d,r(s,c,l,u,d)),o.join(` `)}_stripLeadingMoveTo(e){return e.replace(/^M\s+[\d.-]+\s+[\d.-]+\s*/i,``).trim()}_buildAreaFillPathD(e,t){if(e.length===0)return``;let n=e[e.length-1];if(e.length===1)return`M ${e[0].x} ${t} L ${e[0].x} ${e[0].y} L ${e[0].x} ${t} Z`;if(this._curveTension<=0){let r=[`M ${e[0].x} ${t}`,`L ${e[0].x} ${e[0].y}`];for(let t=1;t<e.length;t++)r.push(`L ${e[t].x} ${e[t].y}`);return r.push(`L ${n.x} ${t}`,`Z`),r.join(` `)}let r=this._buildMonotoneXLinePathD(e),i=this._stripLeadingMoveTo(r);return`M ${e[0].x} ${t} L ${e[0].x} ${e[0].y} ${i} L ${n.x} ${t} Z`}_buildSmoothLinePathD(e){if(e.length===0)return``;if(e.length===1)return`M ${e[0].x} ${e[0].y}`;if(this._curveTension<=0){let t=[`M ${e[0].x} ${e[0].y}`];for(let n=1;n<e.length;n++)t.push(`L ${e[n].x} ${e[n].y}`);return t.join(` `)}return this._buildMonotoneXLinePathD(e)}_renderLineChart(){if(!this._svg||!this._chartData)return;let e=this._getChartBounds(),t=this._hasOnlyZeroValues();this._renderGrid(e);let n=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);n.setAttribute(`class`,`chart-data`);let r=document.createDocumentFragment();this._chartData.datasets.forEach((n,i)=>{if(!this._isDatasetVisible(n,i))return;let a=this._getDatasetColor(n,i),o=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),s=n.data.map(t=>({x:this._scaleX(t.x,e),y:this._scaleY(t.y,e)}));s.length!==0&&(t||(o.setAttribute(`d`,this._buildSmoothLinePathD(s)),o.setAttribute(`fill`,`none`),o.setAttribute(`stroke`,a),o.setAttribute(`stroke-width`,`2`),o.setAttribute(`stroke-linecap`,`round`),o.setAttribute(`stroke-linejoin`,`round`),r.appendChild(o)),n.data.forEach(t=>{let o=document.createElementNS(`http://www.w3.org/2000/svg`,`circle`),s=this._scaleX(t.x,e),c=this._scaleY(t.y,e);o.setAttribute(`cx`,s.toString()),o.setAttribute(`cy`,c.toString()),o.setAttribute(`r`,`4`),o.setAttribute(`fill`,a);let l=document.documentElement.classList.contains(`dark`);o.setAttribute(`stroke`,l?`#1f2937`:`#fff`),o.setAttribute(`stroke-width`,`2`),o.setAttribute(`class`,`chart-point`),o.setAttribute(`data-dataset`,i.toString()),o.setAttribute(`data-x`,String(t.x)),o.setAttribute(`data-y`,t.y.toString()),o.setAttribute(`data-name`,n.name),o.style.opacity=`0`,o.style.pointerEvents=`none`;let u=String(t.x);this._plotPoints.has(u)||this._plotPoints.set(u,[]),this._plotPoints.get(u).push(o),r.appendChild(o)}))}),n.appendChild(r),this._svg.appendChild(n)}_scaleXForBarChart(e,t){let n=this._getXValues();if(n.length===0)return t.x;let r=n.indexOf(e);if(r===-1)return t.x;let i=n.length+1,a=t.width/i;return t.x+(r+1)*a}_renderBarChart(){if(!this._svg||!this._chartData)return;let e=this._getChartBounds();this._renderGrid(e);let t=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);t.setAttribute(`class`,`chart-data`);let n=document.createDocumentFragment(),r=this._getXValues(),i=this._chartData.datasets.filter((e,t)=>this._isDatasetVisible(e,t)).length,a=r.length;if(a===0)return;let o=[];r.forEach(t=>{o.push(this._scaleXForBarChart(t,e))}),o.sort((e,t)=>e-t);let s=e.width;if(a>1)for(let e=0;e<o.length-1;e++){let t=o[e+1]-o[e];t>0&&t<s&&(s=t)}else s=e.width*.5;let c=s*.7,l=.2,u=c/((1+l)*i-l),d=u*l,f=(u+d)*i-d;if(f>c){let e=c/f;u*=e,d=u*l,f=(u+d)*i-d}let p=0;this._chartData.datasets.forEach((t,r)=>{if(!this._isDatasetVisible(t,r))return;let i=this._getDatasetColor(t,r),a=-f/2+(u+d)*p;p++,t.data.forEach(o=>{let s=this._scaleXForBarChart(o.x,e),c=this._scaleY(o.y,e),l=e.y+e.height-c,d=s+a,f=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`);f.setAttribute(`x`,d.toString()),f.setAttribute(`y`,c.toString()),f.setAttribute(`width`,u.toString()),f.setAttribute(`height`,l.toString()),f.setAttribute(`fill`,i),f.setAttribute(`rx`,`2`),f.setAttribute(`class`,`chart-bar`),f.setAttribute(`data-dataset`,r.toString()),f.setAttribute(`data-x`,String(o.x)),f.setAttribute(`data-y`,o.y.toString()),f.setAttribute(`data-name`,t.name),f.style.cursor=`pointer`,this._showTooltip&&f.addEventListener(`mouseenter`,e=>{let t=this._getAllDatasetsAtX(o.x),n=this._tooltipXHeadingHtml(o.x);t.forEach(e=>{n+=`<div style="display: flex; align-items: center; gap: 6px; margin-top: 4px;">
|
|
126
126
|
<span style="display: inline-block; width: 12px; height: 12px; background-color: ${e.color}; border-radius: 2px;"></span>
|
|
127
127
|
<span>${e.name}: ${e.formattedValue}</span>
|
|
128
|
-
</div>`}),this._showTooltipAt(e.clientX,e.clientY,n)}),n.appendChild(f)})}),t.appendChild(n),this._svg.appendChild(t)}_renderAreaChart(){if(!this._svg||!this._chartData)return;let e=this._getChartBounds();this._renderGrid(e);let
|
|
128
|
+
</div>`}),this._showTooltipAt(e.clientX,e.clientY,n)}),n.appendChild(f)})}),t.appendChild(n),this._svg.appendChild(t)}_renderAreaChart(){if(!this._svg||!this._chartData)return;let e=this._getChartBounds(),t=this._hasOnlyZeroValues();this._renderGrid(e);let n=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);n.setAttribute(`class`,`chart-data`);let r=document.createDocumentFragment();this._chartData.datasets.forEach((n,i)=>{if(!this._isDatasetVisible(n,i))return;let a=this._getDatasetColor(n,i),o=n.data.map(t=>({x:this._scaleX(t.x,e),y:this._scaleY(t.y,e)}));if(o.length!==0){if(!t){let t=e.y+e.height,n=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);n.setAttribute(`d`,this._buildAreaFillPathD(o,t)),n.setAttribute(`fill`,a),n.setAttribute(`fill-opacity`,`0.3`),r.appendChild(n);let i=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);i.setAttribute(`d`,this._buildSmoothLinePathD(o)),i.setAttribute(`fill`,`none`),i.setAttribute(`stroke`,a),i.setAttribute(`stroke-width`,`2`),i.setAttribute(`stroke-linecap`,`round`),i.setAttribute(`stroke-linejoin`,`round`),r.appendChild(i)}n.data.forEach(t=>{let o=document.createElementNS(`http://www.w3.org/2000/svg`,`circle`),s=this._scaleX(t.x,e),c=this._scaleY(t.y,e);o.setAttribute(`cx`,s.toString()),o.setAttribute(`cy`,c.toString()),o.setAttribute(`r`,`4`),o.setAttribute(`fill`,a);let l=document.documentElement.classList.contains(`dark`);o.setAttribute(`stroke`,l?`#1f2937`:`#fff`),o.setAttribute(`stroke-width`,`2`),o.setAttribute(`class`,`chart-point`),o.setAttribute(`data-dataset`,i.toString()),o.setAttribute(`data-x`,String(t.x)),o.setAttribute(`data-y`,t.y.toString()),o.setAttribute(`data-name`,n.name),o.style.opacity=`0`,o.style.pointerEvents=`none`;let u=String(t.x);this._plotPoints.has(u)||this._plotPoints.set(u,[]),this._plotPoints.get(u).push(o),r.appendChild(o)})}}),n.appendChild(r),this._svg.appendChild(n)}_renderPieChart(){if(!this._svg||!this._chartData)return;let e=this._getChartBounds(),t=e.x+e.width/2,n=e.y+e.height/2,r=Math.min(e.width,e.height)/2-20,i=this._chartData.datasets[0];if(!i||!i.data||i.data.length===0)return;let a=i.data.reduce((e,t)=>e+t.y,0);if(a===0)return;let o=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);o.setAttribute(`class`,`chart-data`),this._pieChartGroup=o,this._pieChartClickOutsideHandler||(this._pieChartClickOutsideHandler=e=>{if(!this._pieChartTooltipShown)return;let t=e.target;this._pieChartGroup&&!this._pieChartGroup.contains(t)&&(this._pieChartTooltipShown=!1,this._hideTooltip())},document.addEventListener(`click`,this._pieChartClickOutsideHandler,!0));let s=document.createElementNS(`http://www.w3.org/2000/svg`,`circle`);s.setAttribute(`cx`,t.toString()),s.setAttribute(`cy`,n.toString()),s.setAttribute(`r`,r.toString()),s.setAttribute(`fill`,`transparent`),s.setAttribute(`pointer-events`,`none`),o.appendChild(s);let c=-Math.PI/2;i.data.forEach((e,s)=>{let l=e.y,u=l/a*100,d=l/a*2*Math.PI,f=e.color||this._getDatasetColor(i,0,s),p=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);p.setAttribute(`class`,`chart-pie-slice-group`),p.setAttribute(`data-index`,s.toString()),p.style.cursor=`pointer`,p.style.transition=`transform 0.2s ease-out`;let m=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),h=r+2,g=t+h*Math.cos(c),_=n+h*Math.sin(c),v=t+h*Math.cos(c+d),y=n+h*Math.sin(c+d),b=d>Math.PI?1:0,x=[`M ${t} ${n}`,`L ${g} ${_}`,`A ${h} ${h} 0 ${b} 1 ${v} ${y}`,`Z`].join(` `);m.setAttribute(`d`,x),m.setAttribute(`fill`,f),m.setAttribute(`class`,`chart-pie-slice`),m.setAttribute(`data-index`,s.toString()),m.setAttribute(`data-x`,String(e.x)),m.setAttribute(`data-y`,e.y.toString()),m.setAttribute(`data-name`,i.name),m.setAttribute(`data-percentage`,u.toFixed(1)),p.appendChild(m);let S=c+d/2,C=Math.cos(S)*10,w=Math.sin(S)*10,T=null,E=null,D=!1;if(p.__chartInstance=this,p.addEventListener(`mouseenter`,function(){if(E!==null&&(clearTimeout(E),E=null),!D){T!==null&&clearTimeout(T);let e=window.setTimeout(()=>{D=!0,this.setAttribute(`transform`,`translate(${C}, ${w})`),T=null,this.__chartInstance&&this.__chartInstance._pieChartTimeouts.delete(e)},150);T=e,this.__chartInstance&&this.__chartInstance._pieChartTimeouts.add(e)}}),p.addEventListener(`mouseleave`,function(){if(T!==null&&(clearTimeout(T),T=null),D){E!==null&&clearTimeout(E);let e=window.setTimeout(()=>{D=!1,this.setAttribute(`transform`,`translate(0, 0)`),E=null,this.__chartInstance&&this.__chartInstance._pieChartTimeouts.delete(e)},200);E=e,this.__chartInstance&&this.__chartInstance._pieChartTimeouts.add(e)}}),p.addEventListener(`click`,function(){T!==null&&(clearTimeout(T),T=null),E!==null&&(clearTimeout(E),E=null),D=!0,this.setAttribute(`transform`,`translate(${C}, ${w})`)}),this._showTooltip){let t=this._formatValue(l,i),n=`${this._tooltipXHeadingHtml(e.x)}${i.name}: ${t}<br/>${u.toFixed(1)}%`,r=e=>{this._pieChartTooltipShown=!0,this._showTooltipAt(e.clientX,e.clientY,n)};p.addEventListener(`mouseenter`,r),p.addEventListener(`mousemove`,r),p.addEventListener(`click`,e=>{e.stopPropagation(),r(e)}),p.addEventListener(`mouseleave`,()=>{this._tooltipHideTimeout=window.setTimeout(()=>{this._pieChartTooltipShown=!1,this._hideTooltip()},90)})}if(u>5){let e=c+d/2,i=r*.7,a=t+i*Math.cos(e),o=n+i*Math.sin(e),s=this._getContrastColor(f),l=document.createElementNS(`http://www.w3.org/2000/svg`,`text`);l.setAttribute(`x`,a.toString()),l.setAttribute(`y`,o.toString()),l.setAttribute(`text-anchor`,`middle`),l.setAttribute(`dominant-baseline`,`middle`),l.setAttribute(`fill`,s),l.setAttribute(`font-size`,`12`),l.setAttribute(`font-weight`,`500`),l.textContent=`${u.toFixed(1)}%`,p.appendChild(l)}o.appendChild(p),c+=d}),this._svg.appendChild(o),this._showTooltip&&(this._svg.addEventListener(`mousemove`,e=>{this._pieChartTooltipShown&&this._lastTooltipContent&&this._showTooltipAt(e.clientX,e.clientY,this._lastTooltipContent)}),this._svg.addEventListener(`mouseleave`,()=>{this._pieChartTooltipShown=!1,this._hideTooltip()}))}_calculateLegendHeight(){if(!this._chartData)return 0;let e=this._width-40,t=[];this._chartType===`pie`&&this._chartData.datasets.length>0?this._chartData.datasets[0].data.forEach(e=>{t.push({name:String(e.x),row:0})}):this._chartData.datasets.forEach(e=>{t.push({name:e.name,row:0})});let n=0,r=[];return t.forEach(t=>{let i=20+Math.min(t.name.length*7.5,150);r[n]||(r[n]=[]),r[n].reduce((e,t)=>e+(20+Math.min(t.name.length*7.5,150))+32,0)+i>e&&r[n].length>0&&(n++,r[n]=[]),t.row=n,r[n].push(t)}),r.length*36}_renderLegend(){if(!this._chartData||!this._svg)return{height:0};let e=this._svg.querySelector(`.chart-legend`);e&&e.remove();let t=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);if(t.setAttribute(`class`,`chart-legend`),!this._chartData)return{height:0};let n=this._chartData,r=this._width-40,i=[];if(this._chartType===`pie`&&n.datasets.length>0){let e=n.datasets[0];e.data.forEach((t,n)=>{let r=t.color||this._getDatasetColor(e,0,n),a=String(t.x);i.push({name:a,color:r,x:0,textX:0,row:0})})}else n.datasets.forEach((e,t)=>{if(!this._isDatasetVisible(e,t))return;let n=this._getDatasetColor(e,t);i.push({name:e.name,color:n,x:0,textX:0,row:0})});let a=0,o=[];i.forEach(e=>{let t=20+Math.min(e.name.length*7.5,150);o[a]||(o[a]=[]),o[a].reduce((e,t)=>e+(20+Math.min(t.name.length*7.5,150))+32,0)+t>r&&o[a].length>0&&(a++,o[a]=[]),e.row=a,o[a].push(e)}),o.forEach(e=>{let t=e.reduce((e,t)=>e+(20+Math.min(t.name.length*7.5,150)),0)+(e.length-1)*32,n=(this._width-t)/2;e.forEach(e=>{let t=Math.min(e.name.length*7.5,150);e.x=n,e.textX=n+6+8,n+=20+t+32})}),o.length*36;let s=this._getChartBounds(),c=(this._rotatedLabelHeight>0?30:20)+this._rotatedLabelHeight+12,l=c;this._showLegend&&(l=c+20+Math.max(this._legendHeight,60));let u=this._height-s.y-s.height,d=l>0?u/l:1,f=(this._rotatedLabelHeight>0?30:20)*d,p=12*d,m=this._rotatedLabelHeight*d,h=s.y+s.height+f+(this._rotatedLabelHeight>0?m:p)+20*d;return i.forEach(e=>{let n=h+e.row*36+16/2,r=document.createElementNS(`http://www.w3.org/2000/svg`,`circle`);r.setAttribute(`cx`,e.x.toString()),r.setAttribute(`cy`,n.toString()),r.setAttribute(`r`,`6`),r.setAttribute(`fill`,e.color),t.appendChild(r);let i=document.createElementNS(`http://www.w3.org/2000/svg`,`foreignObject`);i.setAttribute(`x`,e.textX.toString()),i.setAttribute(`y`,(n-12).toString()),i.setAttribute(`width`,`150`),i.setAttribute(`height`,`24`);let a=document.createElement(`div`);a.style.cssText=`
|
|
129
129
|
font-size: 12px;
|
|
130
130
|
font-family: system-ui, -apple-system, sans-serif;
|
|
131
131
|
color: ${document.documentElement.classList.contains(`dark`)?`#d1d5db`:`#374151`};
|