monobill-mintui 0.6.739 → 0.6.740
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/page/Page.d.ts +1 -0
- package/dist/components/page/Page.d.ts.map +1 -1
- package/dist/components/page/browser.js +4 -2
- package/dist/components/page/index.cjs +2 -2
- package/dist/components/page/index.js +4 -2
- package/dist/index.cjs +2 -2
- package/dist/index.js +4 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../src/components/page/Page.ts"],"names":[],"mappings":"AACA,OAAO,iBAAiB,CAAA;AACxB,OAAO,eAAe,CAAA;AACtB,OAAO,wBAAwB,CAAA;AAC/B,OAAO,kBAAkB,CAAA;AAEzB,cAAM,QAAS,SAAQ,WAAW;IAChC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,KAAK,CAAY;IACzB,OAAO,CAAC,eAAe,CAAoB;IAC3C,OAAO,CAAC,uBAAuB,CAAa;IAC5C,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,YAAY,CAAiB;IACrC,OAAO,CAAC,oBAAoB,CAAiB;IAC7C,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,sBAAsB,CAA8B;IAC5D,OAAO,CAAC,wBAAwB,CAAgC;IAChE,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,gBAAgB,CAAQ;IAChC,OAAO,CAAC,wBAAwB,CAA4C;IAC5E,OAAO,CAAC,mBAAmB,CAA6B;IACxD,OAAO,CAAC,wBAAwB,CAA6B;;IAoI7D,iBAAiB,IAAI,IAAI;IAczB,oBAAoB,IAAI,IAAI;IAO5B,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAI/F,UAAU,IAAI,MAAM;IAIpB,eAAe,IAAI,MAAM;IAIzB,oBAAoB,IAAI,OAAO;IAI/B,aAAa,IAAI,OAAO;IAIxB,MAAM,IAAI,IAAI;IAMd,OAAO,CAAC,uBAAuB;IAQ/B,OAAO,CAAC,aAAa;IAqFrB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,yBAAyB;
|
|
1
|
+
{"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../src/components/page/Page.ts"],"names":[],"mappings":"AACA,OAAO,iBAAiB,CAAA;AACxB,OAAO,eAAe,CAAA;AACtB,OAAO,wBAAwB,CAAA;AAC/B,OAAO,kBAAkB,CAAA;AAEzB,cAAM,QAAS,SAAQ,WAAW;IAChC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,KAAK,CAAY;IACzB,OAAO,CAAC,eAAe,CAAoB;IAC3C,OAAO,CAAC,uBAAuB,CAAa;IAC5C,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,YAAY,CAAiB;IACrC,OAAO,CAAC,oBAAoB,CAAiB;IAC7C,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,sBAAsB,CAA8B;IAC5D,OAAO,CAAC,wBAAwB,CAAgC;IAChE,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,gBAAgB,CAAQ;IAChC,OAAO,CAAC,wBAAwB,CAA4C;IAC5E,OAAO,CAAC,wBAAwB,CAA4C;IAC5E,OAAO,CAAC,mBAAmB,CAA6B;IACxD,OAAO,CAAC,wBAAwB,CAA6B;;IAoI7D,iBAAiB,IAAI,IAAI;IAczB,oBAAoB,IAAI,IAAI;IAO5B,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAI/F,UAAU,IAAI,MAAM;IAIpB,eAAe,IAAI,MAAM;IAIzB,oBAAoB,IAAI,OAAO;IAI/B,aAAa,IAAI,OAAO;IAIxB,MAAM,IAAI,IAAI;IAMd,OAAO,CAAC,uBAAuB;IAQ/B,OAAO,CAAC,aAAa;IAqFrB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,yBAAyB;IA6BjC,OAAO,CAAC,WAAW;CAyBpB;AAMD,eAAe,QAAQ,CAAA"}
|
|
@@ -34,7 +34,7 @@ var t = class extends HTMLElement {
|
|
|
34
34
|
];
|
|
35
35
|
}
|
|
36
36
|
constructor() {
|
|
37
|
-
super(), this._actionsResizeObserver = null, this._actionsMutationObserver = null, this._actionsFrame = null, this._groupingActions = !1, this._actionFullWidthOriginal = /* @__PURE__ */ new WeakMap(), this._autoGroupedActions = /* @__PURE__ */ new WeakSet(), this._explicitOverflowActions = /* @__PURE__ */ new WeakSet(), this._root = this.attachShadow({ mode: "open" }), this._root.innerHTML = "\n <style>\n /* The built-in back button lives inside this component's shadow root,\n so document-level button.css cannot reach its light-DOM button. */\n /* Avoid an inline baseline line box below the native button core. */\n .mint-page-back mint-button {\n box-sizing: border-box;\n display: flex !important;\n align-items: center;\n justify-content: center;\n width: 2.25rem;\n height: 2.25rem;\n line-height: 0;\n vertical-align: middle;\n }\n .mint-page-back mint-button .mint-button-core {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n min-width: 2.25rem;\n min-height: 2.25rem;\n padding: .375rem;\n border: 2px solid var(--mint-color-border, #dfe6e0);\n border-top-color: #e5e7eb;\n border-left-color: #e5e7eb;\n border-right-color: #d1d5db;\n border-bottom-color: #d1d5db;\n border-radius: .5rem;\n background: var(--mint-color-surface, #fff);\n color: var(--mint-color-text, #28372d);\n font: inherit;\n box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n cursor: pointer;\n transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease, filter .12s ease;\n }\n .mint-page-back mint-button .mint-button-core:hover:not(:disabled) { filter: brightness(.98); }\n .mint-page-back mint-button .mint-button-core:active:not(:disabled) {\n border-top-color: #9ca3af;\n border-left-color: #9ca3af;\n border-right-color: #e5e7eb;\n border-bottom-color: #e5e7eb;\n background: #f3f4f6;\n box-shadow: inset 0 2px 4px rgb(16 32 21 / 26%), inset 0 1px 2px rgb(6 25 15 / 14%);\n filter: brightness(.97);\n }\n .mint-page-back mint-button .mint-button-core:focus-visible {\n outline: 3px solid var(--mint-color-focus, #6eaa86);\n outline-offset: 2px;\n }\n .mint-page-actions-menu { box-sizing: border-box; display: flex; min-width: 14rem; flex-direction: column; gap: .25rem; padding: .375rem; }\n .mint-page-actions-primary { display: flex; align-items: center; gap: .5rem; min-width: 0; }\n .mint-page-actions-menu ::slotted(*) { box-sizing: border-box; display: block; width: 100%; }\n .mint-page-actions-menu ::slotted(div) { display: flex; flex-direction: column !important; align-items: stretch !important; gap: .25rem !important; }\n .mint-page-actions-trigger { display: inline-flex; vertical-align: middle; }\n .mint-page-actions-trigger[hidden] { display: none !important; }\n .mint-page-actions-trigger .mint-button-core {\n box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;\n width: 2.5rem; height: 2.5rem; min-width: 2.5rem; min-height: 2.5rem; padding: .5rem;\n border: 2px solid var(--mint-color-border, #dfe6e0); border-radius: .625rem;\n background: var(--mint-color-surface, #fff); color: var(--mint-color-text, #28372d);\n font: inherit; cursor: pointer; box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n }\n .mint-page-actions-trigger .mint-button-icon { display: inline-flex; width: 1.125rem; height: 1.125rem; }\n .mint-page-actions-trigger .mint-button-icon mint-icon { width: 100% !important; height: 100% !important; }\n .mint-page-actions-popover { position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none; }\n .mint-page-actions-popover:not([data-open]):not([data-state=\"closing\"]),\n .mint-page-actions-popover.hidden { display: none !important; }\n .mint-page-actions-popover[data-open],\n .mint-page-actions-popover[data-state=\"closing\"] {\n display: block; box-sizing: border-box; width: max-content; height: max-content;\n min-height: 0; max-width: calc(100vw - 24px); max-height: min(500px, calc(100vh - 24px));\n max-height: min(500px, calc(100svh - 24px)); overflow: auto; padding: 0;\n border: 1px solid var(--mint-color-border, #dfe6e0); border-radius: .75rem;\n background: var(--mint-color-surface-raised, #fff); color: var(--mint-color-text, #28372d);\n box-shadow: 0 12px 36px rgb(16 32 21 / 13%); pointer-events: auto;\n transform-origin: var(--mint-popover-origin-x, 50%) var(--mint-popover-origin-y, 0%);\n }\n .mint-page-actions-popover[data-state=\"closing\"] { pointer-events: none; }\n .mint-page-actions-popover > .pointer-events-none { position: fixed; inset: 0; z-index: 55; pointer-events: none; }\n .mint-page-actions-popover > .pointer-events-auto {\n position: fixed; z-index: 60; min-width: 14rem; border-radius: .75rem;\n background: var(--mint-color-surface, #fff); pointer-events: auto;\n }\n .mint-page-actions-popover .popover-content {\n min-height: 0; overflow: visible; border: 1px solid var(--mint-color-border, #dfe6e0);\n border-radius: .75rem; background: var(--mint-color-surface, #fff);\n box-shadow: 0 12px 30px rgb(15 23 42 / 16%); padding: 0;\n }\n .mint-page-actions[hidden] { display: none !important; }\n </style>\n <div part=\"container\" class=\"mint-page-container\">\n <header part=\"header\" class=\"mint-page-header\">\n <div part=\"title\" class=\"mint-page-title\">\n <mint-back-button part=\"back-button\" class=\"mint-page-back\" aria-label=\"Go back\" hidden></mint-back-button>\n <h1 part=\"heading\" class=\"mint-page-heading\"><slot name=\"heading\"><span class=\"mint-page-heading-fallback\"></span></slot></h1>\n </div>\n <div part=\"actions\" class=\"mint-page-actions\" hidden>\n <div class=\"mint-page-actions-primary\"><slot name=\"actions\"></slot></div>\n <mint-button id=\"mint-page-actions-trigger\" class=\"mint-page-actions-trigger\" variant=\"outline\" icon=\"ellipsis\" aria-label=\"Page actions\"></mint-button>\n <mint-popover id=\"mint-page-actions-popover\" class=\"mint-page-actions-popover\" trigger-id=\"mint-page-actions-trigger\" direction=\"down\" trigger-align=\"end\" padding=\"0\">\n <div class=\"mint-page-actions-menu\"><slot name=\"overflow-actions\"></slot></div>\n </mint-popover>\n </div>\n </header>\n <main part=\"body\" class=\"mint-page-body\"><slot></slot></main>\n </div>\n ", this._headingElement = this._root.querySelector(".mint-page-heading"), this._headingFallbackElement = this._root.querySelector(".mint-page-heading-fallback"), this._backButton = this._root.querySelector(".mint-page-back"), this._actionsSlot = this._root.querySelector("slot[name=\"actions\"]"), this._overflowActionsSlot = this._root.querySelector("slot[name=\"overflow-actions\"]"), this._actionsWrapper = this._root.querySelector(".mint-page-actions"), this._actionsTrigger = this._root.querySelector("#mint-page-actions-trigger"), this._actionsPopover = this._root.querySelector("#mint-page-actions-popover"), this._actionsSlot.addEventListener("slotchange", () => this._scheduleActionGrouping()), this._overflowActionsSlot.addEventListener("slotchange", () => this._scheduleActionGrouping()), this._backButton.addEventListener("click", (e) => this._handleBack(e), !0);
|
|
37
|
+
super(), this._actionsResizeObserver = null, this._actionsMutationObserver = null, this._actionsFrame = null, this._groupingActions = !1, this._actionFullWidthOriginal = /* @__PURE__ */ new WeakMap(), this._actionAlignmentOriginal = /* @__PURE__ */ new WeakMap(), this._autoGroupedActions = /* @__PURE__ */ new WeakSet(), this._explicitOverflowActions = /* @__PURE__ */ new WeakSet(), this._root = this.attachShadow({ mode: "open" }), this._root.innerHTML = "\n <style>\n /* The built-in back button lives inside this component's shadow root,\n so document-level button.css cannot reach its light-DOM button. */\n /* Avoid an inline baseline line box below the native button core. */\n .mint-page-back mint-button {\n box-sizing: border-box;\n display: flex !important;\n align-items: center;\n justify-content: center;\n width: 2.25rem;\n height: 2.25rem;\n line-height: 0;\n vertical-align: middle;\n }\n .mint-page-back mint-button .mint-button-core {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n min-width: 2.25rem;\n min-height: 2.25rem;\n padding: .375rem;\n border: 2px solid var(--mint-color-border, #dfe6e0);\n border-top-color: #e5e7eb;\n border-left-color: #e5e7eb;\n border-right-color: #d1d5db;\n border-bottom-color: #d1d5db;\n border-radius: .5rem;\n background: var(--mint-color-surface, #fff);\n color: var(--mint-color-text, #28372d);\n font: inherit;\n box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n cursor: pointer;\n transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease, filter .12s ease;\n }\n .mint-page-back mint-button .mint-button-core:hover:not(:disabled) { filter: brightness(.98); }\n .mint-page-back mint-button .mint-button-core:active:not(:disabled) {\n border-top-color: #9ca3af;\n border-left-color: #9ca3af;\n border-right-color: #e5e7eb;\n border-bottom-color: #e5e7eb;\n background: #f3f4f6;\n box-shadow: inset 0 2px 4px rgb(16 32 21 / 26%), inset 0 1px 2px rgb(6 25 15 / 14%);\n filter: brightness(.97);\n }\n .mint-page-back mint-button .mint-button-core:focus-visible {\n outline: 3px solid var(--mint-color-focus, #6eaa86);\n outline-offset: 2px;\n }\n .mint-page-actions-menu { box-sizing: border-box; display: flex; min-width: 14rem; flex-direction: column; gap: .25rem; padding: .375rem; }\n .mint-page-actions-primary { display: flex; align-items: center; gap: .5rem; min-width: 0; }\n .mint-page-actions-menu ::slotted(*) { box-sizing: border-box; display: block; width: 100%; }\n .mint-page-actions-menu ::slotted(div) { display: flex; flex-direction: column !important; align-items: stretch !important; gap: .25rem !important; }\n .mint-page-actions-trigger { display: inline-flex; vertical-align: middle; }\n .mint-page-actions-trigger[hidden] { display: none !important; }\n .mint-page-actions-trigger .mint-button-core {\n box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;\n width: 2.5rem; height: 2.5rem; min-width: 2.5rem; min-height: 2.5rem; padding: .5rem;\n border: 2px solid var(--mint-color-border, #dfe6e0); border-radius: .625rem;\n background: var(--mint-color-surface, #fff); color: var(--mint-color-text, #28372d);\n font: inherit; cursor: pointer; box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n }\n .mint-page-actions-trigger .mint-button-icon { display: inline-flex; width: 1.125rem; height: 1.125rem; }\n .mint-page-actions-trigger .mint-button-icon mint-icon { width: 100% !important; height: 100% !important; }\n .mint-page-actions-popover { position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none; }\n .mint-page-actions-popover:not([data-open]):not([data-state=\"closing\"]),\n .mint-page-actions-popover.hidden { display: none !important; }\n .mint-page-actions-popover[data-open],\n .mint-page-actions-popover[data-state=\"closing\"] {\n display: block; box-sizing: border-box; width: max-content; height: max-content;\n min-height: 0; max-width: calc(100vw - 24px); max-height: min(500px, calc(100vh - 24px));\n max-height: min(500px, calc(100svh - 24px)); overflow: auto; padding: 0;\n border: 1px solid var(--mint-color-border, #dfe6e0); border-radius: .75rem;\n background: var(--mint-color-surface-raised, #fff); color: var(--mint-color-text, #28372d);\n box-shadow: 0 12px 36px rgb(16 32 21 / 13%); pointer-events: auto;\n transform-origin: var(--mint-popover-origin-x, 50%) var(--mint-popover-origin-y, 0%);\n }\n .mint-page-actions-popover[data-state=\"closing\"] { pointer-events: none; }\n .mint-page-actions-popover > .pointer-events-none { position: fixed; inset: 0; z-index: 55; pointer-events: none; }\n .mint-page-actions-popover > .pointer-events-auto {\n position: fixed; z-index: 60; min-width: 14rem; border-radius: .75rem;\n background: var(--mint-color-surface, #fff); pointer-events: auto;\n }\n .mint-page-actions-popover .popover-content {\n min-height: 0; overflow: visible; border: 1px solid var(--mint-color-border, #dfe6e0);\n border-radius: .75rem; background: var(--mint-color-surface, #fff);\n box-shadow: 0 12px 30px rgb(15 23 42 / 16%); padding: 0;\n }\n .mint-page-actions[hidden] { display: none !important; }\n </style>\n <div part=\"container\" class=\"mint-page-container\">\n <header part=\"header\" class=\"mint-page-header\">\n <div part=\"title\" class=\"mint-page-title\">\n <mint-back-button part=\"back-button\" class=\"mint-page-back\" aria-label=\"Go back\" hidden></mint-back-button>\n <h1 part=\"heading\" class=\"mint-page-heading\"><slot name=\"heading\"><span class=\"mint-page-heading-fallback\"></span></slot></h1>\n </div>\n <div part=\"actions\" class=\"mint-page-actions\" hidden>\n <div class=\"mint-page-actions-primary\"><slot name=\"actions\"></slot></div>\n <mint-button id=\"mint-page-actions-trigger\" class=\"mint-page-actions-trigger\" variant=\"outline\" icon=\"ellipsis\" aria-label=\"Page actions\"></mint-button>\n <mint-popover id=\"mint-page-actions-popover\" class=\"mint-page-actions-popover\" trigger-id=\"mint-page-actions-trigger\" direction=\"down\" trigger-align=\"end\" padding=\"0\">\n <div class=\"mint-page-actions-menu\"><slot name=\"overflow-actions\"></slot></div>\n </mint-popover>\n </div>\n </header>\n <main part=\"body\" class=\"mint-page-body\"><slot></slot></main>\n </div>\n ", this._headingElement = this._root.querySelector(".mint-page-heading"), this._headingFallbackElement = this._root.querySelector(".mint-page-heading-fallback"), this._backButton = this._root.querySelector(".mint-page-back"), this._actionsSlot = this._root.querySelector("slot[name=\"actions\"]"), this._overflowActionsSlot = this._root.querySelector("slot[name=\"overflow-actions\"]"), this._actionsWrapper = this._root.querySelector(".mint-page-actions"), this._actionsTrigger = this._root.querySelector("#mint-page-actions-trigger"), this._actionsPopover = this._root.querySelector("#mint-page-actions-popover"), this._actionsSlot.addEventListener("slotchange", () => this._scheduleActionGrouping()), this._overflowActionsSlot.addEventListener("slotchange", () => this._scheduleActionGrouping()), this._backButton.addEventListener("click", (e) => this._handleBack(e), !0);
|
|
38
38
|
}
|
|
39
39
|
connectedCallback() {
|
|
40
40
|
this.render(), this._actionsResizeObserver = new ResizeObserver(() => this._scheduleActionGrouping()), this._actionsResizeObserver.observe(this._root.querySelector(".mint-page-header")), this._actionsMutationObserver = new MutationObserver((e) => {
|
|
@@ -119,10 +119,12 @@ var t = class extends HTMLElement {
|
|
|
119
119
|
e.forEach((e) => {
|
|
120
120
|
e.matches("mint-button") && t.add(e), e.querySelectorAll("mint-button").forEach((e) => t.add(e));
|
|
121
121
|
}), Array.from(this.querySelectorAll("mint-button[slot=\"actions\"], mint-button[slot=\"overflow-actions\"], [slot=\"actions\"] mint-button, [slot=\"overflow-actions\"] mint-button")).forEach((e) => {
|
|
122
|
-
if (t.has(e)) this._actionFullWidthOriginal.has(e) || this._actionFullWidthOriginal.set(e, e.getAttribute("full-width")), e.setAttribute("full-width", "true");
|
|
122
|
+
if (t.has(e)) this._actionFullWidthOriginal.has(e) || this._actionFullWidthOriginal.set(e, e.getAttribute("full-width")), this._actionAlignmentOriginal.has(e) || this._actionAlignmentOriginal.set(e, e.getAttribute("align")), e.setAttribute("full-width", "true"), e.setAttribute("align", "left"), e.querySelector(".mint-button-core")?.setAttribute("data-align", "left");
|
|
123
123
|
else if (this._actionFullWidthOriginal.has(e)) {
|
|
124
124
|
let t = this._actionFullWidthOriginal.get(e);
|
|
125
125
|
t === null ? e.removeAttribute("full-width") : t !== void 0 && e.setAttribute("full-width", t), this._actionFullWidthOriginal.delete(e);
|
|
126
|
+
let n = this._actionAlignmentOriginal.get(e);
|
|
127
|
+
n === null ? e.removeAttribute("align") : n !== void 0 && e.setAttribute("align", n), e.querySelector(".mint-button-core")?.setAttribute("data-align", n || "center"), this._actionAlignmentOriginal.delete(e);
|
|
126
128
|
}
|
|
127
129
|
});
|
|
128
130
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require(`../chunks/icon-pgeP1zxb.js`);const e=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/back-button-CQ3ZKGa1.js`),require(`../chunks/button-CgymemwA.js`),require(`../chunks/popover-N3cKN8iW.js`);var t=class extends HTMLElement{static get observedAttributes(){return[`heading`,`fallback-href`,`show-back-button`,`containered`]}constructor(){super(),this._actionsResizeObserver=null,this._actionsMutationObserver=null,this._actionsFrame=null,this._groupingActions=!1,this._actionFullWidthOriginal=new WeakMap,this._autoGroupedActions=new WeakSet,this._explicitOverflowActions=new WeakSet,this._root=this.attachShadow({mode:`open`}),this._root.innerHTML=`
|
|
1
|
+
require(`../chunks/icon-pgeP1zxb.js`);const e=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/back-button-CQ3ZKGa1.js`),require(`../chunks/button-CgymemwA.js`),require(`../chunks/popover-N3cKN8iW.js`);var t=class extends HTMLElement{static get observedAttributes(){return[`heading`,`fallback-href`,`show-back-button`,`containered`]}constructor(){super(),this._actionsResizeObserver=null,this._actionsMutationObserver=null,this._actionsFrame=null,this._groupingActions=!1,this._actionFullWidthOriginal=new WeakMap,this._actionAlignmentOriginal=new WeakMap,this._autoGroupedActions=new WeakSet,this._explicitOverflowActions=new WeakSet,this._root=this.attachShadow({mode:`open`}),this._root.innerHTML=`
|
|
2
2
|
<style>
|
|
3
3
|
/* The built-in back button lives inside this component's shadow root,
|
|
4
4
|
so document-level button.css cannot reach its light-DOM button. */
|
|
@@ -107,4 +107,4 @@ require(`../chunks/icon-pgeP1zxb.js`);const e=require(`../chunks/register-elemen
|
|
|
107
107
|
</header>
|
|
108
108
|
<main part="body" class="mint-page-body"><slot></slot></main>
|
|
109
109
|
</div>
|
|
110
|
-
`,this._headingElement=this._root.querySelector(`.mint-page-heading`),this._headingFallbackElement=this._root.querySelector(`.mint-page-heading-fallback`),this._backButton=this._root.querySelector(`.mint-page-back`),this._actionsSlot=this._root.querySelector(`slot[name="actions"]`),this._overflowActionsSlot=this._root.querySelector(`slot[name="overflow-actions"]`),this._actionsWrapper=this._root.querySelector(`.mint-page-actions`),this._actionsTrigger=this._root.querySelector(`#mint-page-actions-trigger`),this._actionsPopover=this._root.querySelector(`#mint-page-actions-popover`),this._actionsSlot.addEventListener(`slotchange`,()=>this._scheduleActionGrouping()),this._overflowActionsSlot.addEventListener(`slotchange`,()=>this._scheduleActionGrouping()),this._backButton.addEventListener(`click`,e=>this._handleBack(e),!0)}connectedCallback(){this.render(),this._actionsResizeObserver=new ResizeObserver(()=>this._scheduleActionGrouping()),this._actionsResizeObserver.observe(this._root.querySelector(`.mint-page-header`)),this._actionsMutationObserver=new MutationObserver(e=>{e.some(e=>e.type===`childList`||e.attributeName===`importance`||e.attributeName===`always-grouped`||e.attributeName===`always-visible`||e.attributeName===`slot`&&![`actions`,`overflow-actions`].includes(e.target.getAttribute(`slot`)||``))&&this._scheduleActionGrouping()}),this._actionsMutationObserver.observe(this,{childList:!0,attributes:!0,attributeFilter:[`slot`,`importance`,`always-grouped`,`always-visible`]}),this._scheduleActionGrouping()}disconnectedCallback(){this._actionsResizeObserver?.disconnect(),this._actionsMutationObserver?.disconnect(),this._actionsFrame!==null&&cancelAnimationFrame(this._actionsFrame),this._actionsFrame=null}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._headingFallbackElement.textContent=this.getHeading(),this._backButton.setAttribute(`fallback-href`,this.getFallbackHref()),this._backButton.hidden=!this.shouldShowBackButton()}_scheduleActionGrouping(){this._actionsFrame!==null||!this.isConnected||(this._actionsFrame=requestAnimationFrame(()=>{this._actionsFrame=null,this._groupActions()}))}_groupActions(){if(this._groupingActions)return;this._groupingActions=!0;let e=Array.from(this.children).filter(e=>e instanceof HTMLElement&&(e.getAttribute(`slot`)===`actions`||e.getAttribute(`slot`)===`overflow-actions`));if(this._actionsWrapper.hidden=e.length===0,!e.length){this._actionsTrigger.hidden=!0,this._actionsPopover.style.display=`none`,this._actionsWrapper.hidden=!0,this._groupingActions=!1;return}e.forEach(e=>{e.getAttribute(`slot`)===`overflow-actions`&&!this._autoGroupedActions.has(e)&&this._explicitOverflowActions.add(e)});let t=e.filter(e=>e.hasAttribute(`always-visible`)),n=e.filter(e=>!t.includes(e)&&(e.hasAttribute(`always-grouped`)||this._explicitOverflowActions.has(e))),r=e.filter(e=>!n.includes(e)&&!t.includes(e));if(e.length===1&&n.length===0){this._setActionSlot(e[0],`actions`),this._syncOverflowButtonWidths([]),this._actionsTrigger.hidden=!0,this._actionsPopover.style.display=`none`,this._groupingActions=!1;return}r.forEach(e=>this._setActionSlot(e,`actions`)),n.forEach(e=>this._setActionSlot(e,`overflow-actions`)),this._syncOverflowButtonWidths([]),this._actionsPopover.style.display=``,this._actionsTrigger.hidden=!0;let i=this._root.querySelector(`.mint-page-actions-primary`),a=this._root.querySelector(`.mint-page-header`),o=this._root.querySelector(`.mint-page-heading`);this._actionsResizeObserver?.observe(i),e.forEach(e=>this._actionsResizeObserver?.observe(e));let s=a.clientWidth<=767,c=e.filter(e=>!n.includes(e)).reduce((e,t,n)=>e+t.getBoundingClientRect().width+(n?8:0),0),l=this._backButton.hidden?0:this._backButton.getBoundingClientRect().width+16,u=Math.min(a.clientWidth,o.scrollWidth+l),d=Math.max(0,a.clientWidth-u-16),f=[...n],p=e=>{let t=e.getAttribute(`importance`),n=e.querySelector(`[importance]`)?.getAttribute(`importance`),r=Number(t??n??1);return Number.isFinite(r)&&r>0?r:1};!s&&c>d&&(d=Math.max(0,d-48));let m=c;for(;s?r.length>f.length-n.length:m>d&&f.length<e.length;){let t=r.filter(e=>!f.includes(e));t.sort((t,n)=>p(n)-p(t)||e.indexOf(n)-e.indexOf(t));let n=t[0];if(!n)break;f.push(n),m-=n.getBoundingClientRect().width+(f.length<e.length?8:0)}let h=new Set(f);e.forEach(e=>this._setActionSlot(e,h.has(e)?`overflow-actions`:`actions`)),this._actionsTrigger.hidden=f.length===0,this._actionsPopover.style.display=f.length===0?`none`:``,this._syncOverflowButtonWidths(f),this._actionsResizeObserver?.observe(this._actionsTrigger),this._groupingActions=!1}_setActionSlot(e,t){t===`overflow-actions`?this._autoGroupedActions.add(e):this._autoGroupedActions.delete(e),e.getAttribute(`slot`)!==t&&e.setAttribute(`slot`,t)}_syncOverflowButtonWidths(e){let t=new Set;e.forEach(e=>{e.matches(`mint-button`)&&t.add(e),e.querySelectorAll(`mint-button`).forEach(e=>t.add(e))}),Array.from(this.querySelectorAll(`mint-button[slot="actions"], mint-button[slot="overflow-actions"], [slot="actions"] mint-button, [slot="overflow-actions"] mint-button`)).forEach(e=>{if(t.has(e))this._actionFullWidthOriginal.has(e)||this._actionFullWidthOriginal.set(e,e.getAttribute(`full-width`)),e.setAttribute(`full-width`,`true`);else if(this._actionFullWidthOriginal.has(e)){let t=this._actionFullWidthOriginal.get(e);t===null?e.removeAttribute(`full-width`):t!==void 0&&e.setAttribute(`full-width`,t),this._actionFullWidthOriginal.delete(e)}})}_handleBack(e){e.preventDefault(),e.stopPropagation();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`)&&e.t(`mint-page`,t),module.exports=t;
|
|
110
|
+
`,this._headingElement=this._root.querySelector(`.mint-page-heading`),this._headingFallbackElement=this._root.querySelector(`.mint-page-heading-fallback`),this._backButton=this._root.querySelector(`.mint-page-back`),this._actionsSlot=this._root.querySelector(`slot[name="actions"]`),this._overflowActionsSlot=this._root.querySelector(`slot[name="overflow-actions"]`),this._actionsWrapper=this._root.querySelector(`.mint-page-actions`),this._actionsTrigger=this._root.querySelector(`#mint-page-actions-trigger`),this._actionsPopover=this._root.querySelector(`#mint-page-actions-popover`),this._actionsSlot.addEventListener(`slotchange`,()=>this._scheduleActionGrouping()),this._overflowActionsSlot.addEventListener(`slotchange`,()=>this._scheduleActionGrouping()),this._backButton.addEventListener(`click`,e=>this._handleBack(e),!0)}connectedCallback(){this.render(),this._actionsResizeObserver=new ResizeObserver(()=>this._scheduleActionGrouping()),this._actionsResizeObserver.observe(this._root.querySelector(`.mint-page-header`)),this._actionsMutationObserver=new MutationObserver(e=>{e.some(e=>e.type===`childList`||e.attributeName===`importance`||e.attributeName===`always-grouped`||e.attributeName===`always-visible`||e.attributeName===`slot`&&![`actions`,`overflow-actions`].includes(e.target.getAttribute(`slot`)||``))&&this._scheduleActionGrouping()}),this._actionsMutationObserver.observe(this,{childList:!0,attributes:!0,attributeFilter:[`slot`,`importance`,`always-grouped`,`always-visible`]}),this._scheduleActionGrouping()}disconnectedCallback(){this._actionsResizeObserver?.disconnect(),this._actionsMutationObserver?.disconnect(),this._actionsFrame!==null&&cancelAnimationFrame(this._actionsFrame),this._actionsFrame=null}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._headingFallbackElement.textContent=this.getHeading(),this._backButton.setAttribute(`fallback-href`,this.getFallbackHref()),this._backButton.hidden=!this.shouldShowBackButton()}_scheduleActionGrouping(){this._actionsFrame!==null||!this.isConnected||(this._actionsFrame=requestAnimationFrame(()=>{this._actionsFrame=null,this._groupActions()}))}_groupActions(){if(this._groupingActions)return;this._groupingActions=!0;let e=Array.from(this.children).filter(e=>e instanceof HTMLElement&&(e.getAttribute(`slot`)===`actions`||e.getAttribute(`slot`)===`overflow-actions`));if(this._actionsWrapper.hidden=e.length===0,!e.length){this._actionsTrigger.hidden=!0,this._actionsPopover.style.display=`none`,this._actionsWrapper.hidden=!0,this._groupingActions=!1;return}e.forEach(e=>{e.getAttribute(`slot`)===`overflow-actions`&&!this._autoGroupedActions.has(e)&&this._explicitOverflowActions.add(e)});let t=e.filter(e=>e.hasAttribute(`always-visible`)),n=e.filter(e=>!t.includes(e)&&(e.hasAttribute(`always-grouped`)||this._explicitOverflowActions.has(e))),r=e.filter(e=>!n.includes(e)&&!t.includes(e));if(e.length===1&&n.length===0){this._setActionSlot(e[0],`actions`),this._syncOverflowButtonWidths([]),this._actionsTrigger.hidden=!0,this._actionsPopover.style.display=`none`,this._groupingActions=!1;return}r.forEach(e=>this._setActionSlot(e,`actions`)),n.forEach(e=>this._setActionSlot(e,`overflow-actions`)),this._syncOverflowButtonWidths([]),this._actionsPopover.style.display=``,this._actionsTrigger.hidden=!0;let i=this._root.querySelector(`.mint-page-actions-primary`),a=this._root.querySelector(`.mint-page-header`),o=this._root.querySelector(`.mint-page-heading`);this._actionsResizeObserver?.observe(i),e.forEach(e=>this._actionsResizeObserver?.observe(e));let s=a.clientWidth<=767,c=e.filter(e=>!n.includes(e)).reduce((e,t,n)=>e+t.getBoundingClientRect().width+(n?8:0),0),l=this._backButton.hidden?0:this._backButton.getBoundingClientRect().width+16,u=Math.min(a.clientWidth,o.scrollWidth+l),d=Math.max(0,a.clientWidth-u-16),f=[...n],p=e=>{let t=e.getAttribute(`importance`),n=e.querySelector(`[importance]`)?.getAttribute(`importance`),r=Number(t??n??1);return Number.isFinite(r)&&r>0?r:1};!s&&c>d&&(d=Math.max(0,d-48));let m=c;for(;s?r.length>f.length-n.length:m>d&&f.length<e.length;){let t=r.filter(e=>!f.includes(e));t.sort((t,n)=>p(n)-p(t)||e.indexOf(n)-e.indexOf(t));let n=t[0];if(!n)break;f.push(n),m-=n.getBoundingClientRect().width+(f.length<e.length?8:0)}let h=new Set(f);e.forEach(e=>this._setActionSlot(e,h.has(e)?`overflow-actions`:`actions`)),this._actionsTrigger.hidden=f.length===0,this._actionsPopover.style.display=f.length===0?`none`:``,this._syncOverflowButtonWidths(f),this._actionsResizeObserver?.observe(this._actionsTrigger),this._groupingActions=!1}_setActionSlot(e,t){t===`overflow-actions`?this._autoGroupedActions.add(e):this._autoGroupedActions.delete(e),e.getAttribute(`slot`)!==t&&e.setAttribute(`slot`,t)}_syncOverflowButtonWidths(e){let t=new Set;e.forEach(e=>{e.matches(`mint-button`)&&t.add(e),e.querySelectorAll(`mint-button`).forEach(e=>t.add(e))}),Array.from(this.querySelectorAll(`mint-button[slot="actions"], mint-button[slot="overflow-actions"], [slot="actions"] mint-button, [slot="overflow-actions"] mint-button`)).forEach(e=>{if(t.has(e))this._actionFullWidthOriginal.has(e)||this._actionFullWidthOriginal.set(e,e.getAttribute(`full-width`)),this._actionAlignmentOriginal.has(e)||this._actionAlignmentOriginal.set(e,e.getAttribute(`align`)),e.setAttribute(`full-width`,`true`),e.setAttribute(`align`,`left`),e.querySelector(`.mint-button-core`)?.setAttribute(`data-align`,`left`);else if(this._actionFullWidthOriginal.has(e)){let t=this._actionFullWidthOriginal.get(e);t===null?e.removeAttribute(`full-width`):t!==void 0&&e.setAttribute(`full-width`,t),this._actionFullWidthOriginal.delete(e);let n=this._actionAlignmentOriginal.get(e);n===null?e.removeAttribute(`align`):n!==void 0&&e.setAttribute(`align`,n),e.querySelector(`.mint-button-core`)?.setAttribute(`data-align`,n||`center`),this._actionAlignmentOriginal.delete(e)}})}_handleBack(e){e.preventDefault(),e.stopPropagation();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`)&&e.t(`mint-page`,t),module.exports=t;
|
|
@@ -22,7 +22,7 @@ var t = class extends HTMLElement {
|
|
|
22
22
|
];
|
|
23
23
|
}
|
|
24
24
|
constructor() {
|
|
25
|
-
super(), this._actionsResizeObserver = null, this._actionsMutationObserver = null, this._actionsFrame = null, this._groupingActions = !1, this._actionFullWidthOriginal = /* @__PURE__ */ new WeakMap(), this._autoGroupedActions = /* @__PURE__ */ new WeakSet(), this._explicitOverflowActions = /* @__PURE__ */ new WeakSet(), this._root = this.attachShadow({ mode: "open" }), this._root.innerHTML = "\n <style>\n /* The built-in back button lives inside this component's shadow root,\n so document-level button.css cannot reach its light-DOM button. */\n /* Avoid an inline baseline line box below the native button core. */\n .mint-page-back mint-button {\n box-sizing: border-box;\n display: flex !important;\n align-items: center;\n justify-content: center;\n width: 2.25rem;\n height: 2.25rem;\n line-height: 0;\n vertical-align: middle;\n }\n .mint-page-back mint-button .mint-button-core {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n min-width: 2.25rem;\n min-height: 2.25rem;\n padding: .375rem;\n border: 2px solid var(--mint-color-border, #dfe6e0);\n border-top-color: #e5e7eb;\n border-left-color: #e5e7eb;\n border-right-color: #d1d5db;\n border-bottom-color: #d1d5db;\n border-radius: .5rem;\n background: var(--mint-color-surface, #fff);\n color: var(--mint-color-text, #28372d);\n font: inherit;\n box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n cursor: pointer;\n transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease, filter .12s ease;\n }\n .mint-page-back mint-button .mint-button-core:hover:not(:disabled) { filter: brightness(.98); }\n .mint-page-back mint-button .mint-button-core:active:not(:disabled) {\n border-top-color: #9ca3af;\n border-left-color: #9ca3af;\n border-right-color: #e5e7eb;\n border-bottom-color: #e5e7eb;\n background: #f3f4f6;\n box-shadow: inset 0 2px 4px rgb(16 32 21 / 26%), inset 0 1px 2px rgb(6 25 15 / 14%);\n filter: brightness(.97);\n }\n .mint-page-back mint-button .mint-button-core:focus-visible {\n outline: 3px solid var(--mint-color-focus, #6eaa86);\n outline-offset: 2px;\n }\n .mint-page-actions-menu { box-sizing: border-box; display: flex; min-width: 14rem; flex-direction: column; gap: .25rem; padding: .375rem; }\n .mint-page-actions-primary { display: flex; align-items: center; gap: .5rem; min-width: 0; }\n .mint-page-actions-menu ::slotted(*) { box-sizing: border-box; display: block; width: 100%; }\n .mint-page-actions-menu ::slotted(div) { display: flex; flex-direction: column !important; align-items: stretch !important; gap: .25rem !important; }\n .mint-page-actions-trigger { display: inline-flex; vertical-align: middle; }\n .mint-page-actions-trigger[hidden] { display: none !important; }\n .mint-page-actions-trigger .mint-button-core {\n box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;\n width: 2.5rem; height: 2.5rem; min-width: 2.5rem; min-height: 2.5rem; padding: .5rem;\n border: 2px solid var(--mint-color-border, #dfe6e0); border-radius: .625rem;\n background: var(--mint-color-surface, #fff); color: var(--mint-color-text, #28372d);\n font: inherit; cursor: pointer; box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n }\n .mint-page-actions-trigger .mint-button-icon { display: inline-flex; width: 1.125rem; height: 1.125rem; }\n .mint-page-actions-trigger .mint-button-icon mint-icon { width: 100% !important; height: 100% !important; }\n .mint-page-actions-popover { position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none; }\n .mint-page-actions-popover:not([data-open]):not([data-state=\"closing\"]),\n .mint-page-actions-popover.hidden { display: none !important; }\n .mint-page-actions-popover[data-open],\n .mint-page-actions-popover[data-state=\"closing\"] {\n display: block; box-sizing: border-box; width: max-content; height: max-content;\n min-height: 0; max-width: calc(100vw - 24px); max-height: min(500px, calc(100vh - 24px));\n max-height: min(500px, calc(100svh - 24px)); overflow: auto; padding: 0;\n border: 1px solid var(--mint-color-border, #dfe6e0); border-radius: .75rem;\n background: var(--mint-color-surface-raised, #fff); color: var(--mint-color-text, #28372d);\n box-shadow: 0 12px 36px rgb(16 32 21 / 13%); pointer-events: auto;\n transform-origin: var(--mint-popover-origin-x, 50%) var(--mint-popover-origin-y, 0%);\n }\n .mint-page-actions-popover[data-state=\"closing\"] { pointer-events: none; }\n .mint-page-actions-popover > .pointer-events-none { position: fixed; inset: 0; z-index: 55; pointer-events: none; }\n .mint-page-actions-popover > .pointer-events-auto {\n position: fixed; z-index: 60; min-width: 14rem; border-radius: .75rem;\n background: var(--mint-color-surface, #fff); pointer-events: auto;\n }\n .mint-page-actions-popover .popover-content {\n min-height: 0; overflow: visible; border: 1px solid var(--mint-color-border, #dfe6e0);\n border-radius: .75rem; background: var(--mint-color-surface, #fff);\n box-shadow: 0 12px 30px rgb(15 23 42 / 16%); padding: 0;\n }\n .mint-page-actions[hidden] { display: none !important; }\n </style>\n <div part=\"container\" class=\"mint-page-container\">\n <header part=\"header\" class=\"mint-page-header\">\n <div part=\"title\" class=\"mint-page-title\">\n <mint-back-button part=\"back-button\" class=\"mint-page-back\" aria-label=\"Go back\" hidden></mint-back-button>\n <h1 part=\"heading\" class=\"mint-page-heading\"><slot name=\"heading\"><span class=\"mint-page-heading-fallback\"></span></slot></h1>\n </div>\n <div part=\"actions\" class=\"mint-page-actions\" hidden>\n <div class=\"mint-page-actions-primary\"><slot name=\"actions\"></slot></div>\n <mint-button id=\"mint-page-actions-trigger\" class=\"mint-page-actions-trigger\" variant=\"outline\" icon=\"ellipsis\" aria-label=\"Page actions\"></mint-button>\n <mint-popover id=\"mint-page-actions-popover\" class=\"mint-page-actions-popover\" trigger-id=\"mint-page-actions-trigger\" direction=\"down\" trigger-align=\"end\" padding=\"0\">\n <div class=\"mint-page-actions-menu\"><slot name=\"overflow-actions\"></slot></div>\n </mint-popover>\n </div>\n </header>\n <main part=\"body\" class=\"mint-page-body\"><slot></slot></main>\n </div>\n ", this._headingElement = this._root.querySelector(".mint-page-heading"), this._headingFallbackElement = this._root.querySelector(".mint-page-heading-fallback"), this._backButton = this._root.querySelector(".mint-page-back"), this._actionsSlot = this._root.querySelector("slot[name=\"actions\"]"), this._overflowActionsSlot = this._root.querySelector("slot[name=\"overflow-actions\"]"), this._actionsWrapper = this._root.querySelector(".mint-page-actions"), this._actionsTrigger = this._root.querySelector("#mint-page-actions-trigger"), this._actionsPopover = this._root.querySelector("#mint-page-actions-popover"), this._actionsSlot.addEventListener("slotchange", () => this._scheduleActionGrouping()), this._overflowActionsSlot.addEventListener("slotchange", () => this._scheduleActionGrouping()), this._backButton.addEventListener("click", (e) => this._handleBack(e), !0);
|
|
25
|
+
super(), this._actionsResizeObserver = null, this._actionsMutationObserver = null, this._actionsFrame = null, this._groupingActions = !1, this._actionFullWidthOriginal = /* @__PURE__ */ new WeakMap(), this._actionAlignmentOriginal = /* @__PURE__ */ new WeakMap(), this._autoGroupedActions = /* @__PURE__ */ new WeakSet(), this._explicitOverflowActions = /* @__PURE__ */ new WeakSet(), this._root = this.attachShadow({ mode: "open" }), this._root.innerHTML = "\n <style>\n /* The built-in back button lives inside this component's shadow root,\n so document-level button.css cannot reach its light-DOM button. */\n /* Avoid an inline baseline line box below the native button core. */\n .mint-page-back mint-button {\n box-sizing: border-box;\n display: flex !important;\n align-items: center;\n justify-content: center;\n width: 2.25rem;\n height: 2.25rem;\n line-height: 0;\n vertical-align: middle;\n }\n .mint-page-back mint-button .mint-button-core {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n min-width: 2.25rem;\n min-height: 2.25rem;\n padding: .375rem;\n border: 2px solid var(--mint-color-border, #dfe6e0);\n border-top-color: #e5e7eb;\n border-left-color: #e5e7eb;\n border-right-color: #d1d5db;\n border-bottom-color: #d1d5db;\n border-radius: .5rem;\n background: var(--mint-color-surface, #fff);\n color: var(--mint-color-text, #28372d);\n font: inherit;\n box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n cursor: pointer;\n transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease, filter .12s ease;\n }\n .mint-page-back mint-button .mint-button-core:hover:not(:disabled) { filter: brightness(.98); }\n .mint-page-back mint-button .mint-button-core:active:not(:disabled) {\n border-top-color: #9ca3af;\n border-left-color: #9ca3af;\n border-right-color: #e5e7eb;\n border-bottom-color: #e5e7eb;\n background: #f3f4f6;\n box-shadow: inset 0 2px 4px rgb(16 32 21 / 26%), inset 0 1px 2px rgb(6 25 15 / 14%);\n filter: brightness(.97);\n }\n .mint-page-back mint-button .mint-button-core:focus-visible {\n outline: 3px solid var(--mint-color-focus, #6eaa86);\n outline-offset: 2px;\n }\n .mint-page-actions-menu { box-sizing: border-box; display: flex; min-width: 14rem; flex-direction: column; gap: .25rem; padding: .375rem; }\n .mint-page-actions-primary { display: flex; align-items: center; gap: .5rem; min-width: 0; }\n .mint-page-actions-menu ::slotted(*) { box-sizing: border-box; display: block; width: 100%; }\n .mint-page-actions-menu ::slotted(div) { display: flex; flex-direction: column !important; align-items: stretch !important; gap: .25rem !important; }\n .mint-page-actions-trigger { display: inline-flex; vertical-align: middle; }\n .mint-page-actions-trigger[hidden] { display: none !important; }\n .mint-page-actions-trigger .mint-button-core {\n box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;\n width: 2.5rem; height: 2.5rem; min-width: 2.5rem; min-height: 2.5rem; padding: .5rem;\n border: 2px solid var(--mint-color-border, #dfe6e0); border-radius: .625rem;\n background: var(--mint-color-surface, #fff); color: var(--mint-color-text, #28372d);\n font: inherit; cursor: pointer; box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n }\n .mint-page-actions-trigger .mint-button-icon { display: inline-flex; width: 1.125rem; height: 1.125rem; }\n .mint-page-actions-trigger .mint-button-icon mint-icon { width: 100% !important; height: 100% !important; }\n .mint-page-actions-popover { position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none; }\n .mint-page-actions-popover:not([data-open]):not([data-state=\"closing\"]),\n .mint-page-actions-popover.hidden { display: none !important; }\n .mint-page-actions-popover[data-open],\n .mint-page-actions-popover[data-state=\"closing\"] {\n display: block; box-sizing: border-box; width: max-content; height: max-content;\n min-height: 0; max-width: calc(100vw - 24px); max-height: min(500px, calc(100vh - 24px));\n max-height: min(500px, calc(100svh - 24px)); overflow: auto; padding: 0;\n border: 1px solid var(--mint-color-border, #dfe6e0); border-radius: .75rem;\n background: var(--mint-color-surface-raised, #fff); color: var(--mint-color-text, #28372d);\n box-shadow: 0 12px 36px rgb(16 32 21 / 13%); pointer-events: auto;\n transform-origin: var(--mint-popover-origin-x, 50%) var(--mint-popover-origin-y, 0%);\n }\n .mint-page-actions-popover[data-state=\"closing\"] { pointer-events: none; }\n .mint-page-actions-popover > .pointer-events-none { position: fixed; inset: 0; z-index: 55; pointer-events: none; }\n .mint-page-actions-popover > .pointer-events-auto {\n position: fixed; z-index: 60; min-width: 14rem; border-radius: .75rem;\n background: var(--mint-color-surface, #fff); pointer-events: auto;\n }\n .mint-page-actions-popover .popover-content {\n min-height: 0; overflow: visible; border: 1px solid var(--mint-color-border, #dfe6e0);\n border-radius: .75rem; background: var(--mint-color-surface, #fff);\n box-shadow: 0 12px 30px rgb(15 23 42 / 16%); padding: 0;\n }\n .mint-page-actions[hidden] { display: none !important; }\n </style>\n <div part=\"container\" class=\"mint-page-container\">\n <header part=\"header\" class=\"mint-page-header\">\n <div part=\"title\" class=\"mint-page-title\">\n <mint-back-button part=\"back-button\" class=\"mint-page-back\" aria-label=\"Go back\" hidden></mint-back-button>\n <h1 part=\"heading\" class=\"mint-page-heading\"><slot name=\"heading\"><span class=\"mint-page-heading-fallback\"></span></slot></h1>\n </div>\n <div part=\"actions\" class=\"mint-page-actions\" hidden>\n <div class=\"mint-page-actions-primary\"><slot name=\"actions\"></slot></div>\n <mint-button id=\"mint-page-actions-trigger\" class=\"mint-page-actions-trigger\" variant=\"outline\" icon=\"ellipsis\" aria-label=\"Page actions\"></mint-button>\n <mint-popover id=\"mint-page-actions-popover\" class=\"mint-page-actions-popover\" trigger-id=\"mint-page-actions-trigger\" direction=\"down\" trigger-align=\"end\" padding=\"0\">\n <div class=\"mint-page-actions-menu\"><slot name=\"overflow-actions\"></slot></div>\n </mint-popover>\n </div>\n </header>\n <main part=\"body\" class=\"mint-page-body\"><slot></slot></main>\n </div>\n ", this._headingElement = this._root.querySelector(".mint-page-heading"), this._headingFallbackElement = this._root.querySelector(".mint-page-heading-fallback"), this._backButton = this._root.querySelector(".mint-page-back"), this._actionsSlot = this._root.querySelector("slot[name=\"actions\"]"), this._overflowActionsSlot = this._root.querySelector("slot[name=\"overflow-actions\"]"), this._actionsWrapper = this._root.querySelector(".mint-page-actions"), this._actionsTrigger = this._root.querySelector("#mint-page-actions-trigger"), this._actionsPopover = this._root.querySelector("#mint-page-actions-popover"), this._actionsSlot.addEventListener("slotchange", () => this._scheduleActionGrouping()), this._overflowActionsSlot.addEventListener("slotchange", () => this._scheduleActionGrouping()), this._backButton.addEventListener("click", (e) => this._handleBack(e), !0);
|
|
26
26
|
}
|
|
27
27
|
connectedCallback() {
|
|
28
28
|
this.render(), this._actionsResizeObserver = new ResizeObserver(() => this._scheduleActionGrouping()), this._actionsResizeObserver.observe(this._root.querySelector(".mint-page-header")), this._actionsMutationObserver = new MutationObserver((e) => {
|
|
@@ -107,10 +107,12 @@ var t = class extends HTMLElement {
|
|
|
107
107
|
e.forEach((e) => {
|
|
108
108
|
e.matches("mint-button") && t.add(e), e.querySelectorAll("mint-button").forEach((e) => t.add(e));
|
|
109
109
|
}), Array.from(this.querySelectorAll("mint-button[slot=\"actions\"], mint-button[slot=\"overflow-actions\"], [slot=\"actions\"] mint-button, [slot=\"overflow-actions\"] mint-button")).forEach((e) => {
|
|
110
|
-
if (t.has(e)) this._actionFullWidthOriginal.has(e) || this._actionFullWidthOriginal.set(e, e.getAttribute("full-width")), e.setAttribute("full-width", "true");
|
|
110
|
+
if (t.has(e)) this._actionFullWidthOriginal.has(e) || this._actionFullWidthOriginal.set(e, e.getAttribute("full-width")), this._actionAlignmentOriginal.has(e) || this._actionAlignmentOriginal.set(e, e.getAttribute("align")), e.setAttribute("full-width", "true"), e.setAttribute("align", "left"), e.querySelector(".mint-button-core")?.setAttribute("data-align", "left");
|
|
111
111
|
else if (this._actionFullWidthOriginal.has(e)) {
|
|
112
112
|
let t = this._actionFullWidthOriginal.get(e);
|
|
113
113
|
t === null ? e.removeAttribute("full-width") : t !== void 0 && e.setAttribute("full-width", t), this._actionFullWidthOriginal.delete(e);
|
|
114
|
+
let n = this._actionAlignmentOriginal.get(e);
|
|
115
|
+
n === null ? e.removeAttribute("align") : n !== void 0 && e.setAttribute("align", n), e.querySelector(".mint-button-core")?.setAttribute("data-align", n || "center"), this._actionAlignmentOriginal.delete(e);
|
|
114
116
|
}
|
|
115
117
|
});
|
|
116
118
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -110,7 +110,7 @@ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{val
|
|
|
110
110
|
class="mint-spinner-progress"
|
|
111
111
|
/>
|
|
112
112
|
</svg>
|
|
113
|
-
`.trim()}};typeof customElements<`u`&&!customElements.get(`mint-spinner`)&&a(`mint-spinner`,gn);var _n=class extends HTMLElement{static get observedAttributes(){return[`variant`,`tone`,`disabled`,`loading`,`button-type`,`type`,`full-width`,`icon-position`,`icon`,`active`,`align`,`aria-label`]}constructor(){super(),this._button=null,this._clickHandler=null,this._isHandlingClick=!1,this._mousePressed=!1,this._hostChildObserver=null,this._hostRenderFromObserverRaf=null,this._handleMouseDown=()=>{this._button&&!this.isDisabled()&&!this.isLoading()&&(this._button.classList.add(`mint-button-active`),this._mousePressed||(this._mousePressed=!0,document.addEventListener(`mouseup`,this._handleMouseUp),window.addEventListener(`blur`,this._handleMouseCancel)))},this._handleMouseUp=()=>{this._clearMousePressedState()},this._handleMouseCancel=()=>{this._clearMousePressedState()},this._handleTouchStart=()=>{this._button&&!this.isDisabled()&&!this.isLoading()&&this._button.classList.add(`mint-button-active`)},this._handleTouchEnd=()=>{this._button&&(this.isActive()||this._button.classList.remove(`mint-button-active`))},this._handleTouchCancel=()=>{this._button&&(this.isActive()||this._button.classList.remove(`mint-button-active`))}}_getGeneratedIcon(){return this._button?this._button.querySelector(`:scope > [data-generated-icon="true"]`):null}_getContentWrapperClass(e){return`mint-button-content`}connectedCallback(){this.render(),this._button&&this.setupEventListeners()}disconnectedCallback(){this._disconnectHostChildObserver(),this._hostRenderFromObserverRaf!==null&&(cancelAnimationFrame(this._hostRenderFromObserverRaf),this._hostRenderFromObserverRaf=null),this.removeEventListeners(),this._clearMousePressedState()}attributeChangedCallback(e,t,n){t!==n&&this.render()}getVariant(){let e=this.getAttribute(`variant`);return e===`ghost`||e===`outline`?e:`solid`}getTone(){return this.getAttribute(`tone`)||`neutral`}isDisabled(){return this.getAttribute(`disabled`)===`true`}isLoading(){return this.getAttribute(`loading`)===`true`}getType(){let e=this.getAttribute(`type`),t=this.getAttribute(`button-type`);return(e||t||`default`)===`submit`?`submit`:`button`}isFullWidth(){return this.getAttribute(`full-width`)===`true`}isActive(){return this.getAttribute(`active`)===`true`}get active(){return this.isActive()}set active(e){e?this.setAttribute(`active`,`true`):this.removeAttribute(`active`)}getIconPosition(){return this.getAttribute(`icon-position`)||`left`}getIcon(){return this.getAttribute(`icon`)||``}getAlignment(){let e=this.getAttribute(`align`);return e===`left`||e===`center`||e===`right`?e:`center`}isIconOnly(){if(!(this.getIcon()||this._getGeneratedIcon()||this._button?.querySelector(`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())return!1;if(e.nodeType===Node.ELEMENT_NODE){let t=e;if(t.tagName!==`MINT-ICON`&&t.tagName!==`MINT-SPINNER`&&!t.querySelector(`mint-spinner`)&&!t.hasAttribute(`slot`)&&t.className!==`mint-button-icon`&&!(t.classList.contains(`mint-button-spinner-wrap`)&&t.querySelector(`mint-spinner`))&&t.textContent?.trim())return!1}}return!0}getActiveStateClasses(){let e=`${this.getVariant()}-${this.getTone()}`;return{"solid-action":[`!bg-neutral-900`,`dark:!bg-neutral-700`,`hover:!bg-neutral-900`,`dark:hover:!bg-neutral-700`,`!border-t-neutral-900`,`!border-l-neutral-900`,`!border-r-neutral-600`,`!border-b-neutral-600`,`dark:!border-t-neutral-700`,`dark:!border-l-neutral-700`,`dark:!border-r-neutral-500`,`dark:!border-b-neutral-500`],"solid-neutral":[`!bg-gray-100`,`dark:!bg-mint-hover`,`hover:!bg-gray-100`,`dark:hover:!bg-mint-hover`,`!border-t-gray-400`,`!border-l-gray-400`,`!border-r-gray-200`,`!border-b-gray-200`,`dark:!border-t-gray-950`,`dark:!border-l-gray-950`,`dark:!border-r-mint-divider`,`dark:!border-b-mint-divider`],"solid-info":[`!bg-blue-900`,`dark:!bg-blue-700`,`hover:!bg-blue-900`,`dark:hover:!bg-blue-700`,`!border-t-blue-900`,`!border-l-blue-900`,`!border-r-blue-600`,`!border-b-blue-600`,`dark:!border-t-blue-700`,`dark:!border-l-blue-700`,`dark:!border-r-blue-500`,`dark:!border-b-blue-500`],"solid-warning":[`!bg-amber-900`,`dark:!bg-amber-700`,`hover:!bg-amber-900`,`dark:hover:!bg-amber-700`,`!border-t-amber-900`,`!border-l-amber-900`,`!border-r-amber-600`,`!border-b-amber-600`,`dark:!border-t-amber-700`,`dark:!border-l-amber-700`,`dark:!border-r-amber-500`,`dark:!border-b-amber-500`],"solid-danger":[`!bg-red-900`,`dark:!bg-red-700`,`hover:!bg-red-900`,`dark:hover:!bg-red-700`,`!border-t-red-900`,`!border-l-red-900`,`!border-r-red-600`,`!border-b-red-600`,`dark:!border-t-red-700`,`dark:!border-l-red-700`,`dark:!border-r-red-500`,`dark:!border-b-red-500`],"ghost-action":[`!bg-gray-100`,`!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`dark:!bg-mint-hover`,`hover:!bg-gray-100`,`dark:hover:!bg-mint-hover`,`hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`],"ghost-neutral":[`!bg-gray-50`,`!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`dark:!bg-mint-hover`,`!text-gray-900`,`dark:!text-white`,`hover:!bg-gray-50`,`dark:hover:!bg-mint-hover`,`hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`hover:!text-gray-900`,`dark:hover:!text-white`],"ghost-info":[`!bg-gray-100`,`!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`dark:!bg-mint-hover`,`hover:!bg-gray-100`,`dark:hover:!bg-mint-hover`,`hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`],"ghost-warning":[`!bg-gray-100`,`!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`dark:!bg-mint-hover`,`hover:!bg-gray-100`,`dark:hover:!bg-mint-hover`,`hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`],"ghost-danger":[`!bg-gray-100`,`!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`dark:!bg-mint-hover`,`hover:!bg-gray-100`,`dark:hover:!bg-mint-hover`,`hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`]}[e]||[]}_disconnectHostChildObserver(){this._hostChildObserver?.disconnect()}_connectHostChildObserver(){this.isConnected&&(this._hostChildObserver||=new MutationObserver(e=>{this._onLightDomMutation(e)}),this._hostChildObserver.disconnect(),this._hostChildObserver.observe(this,{childList:!0,subtree:!0,characterData:!0}))}_onLightDomMutation(e){if(this.isConnected){if(this._button&&!this._button.isConnected){this._button=null,this._scheduleRenderFromHostObserver();return}for(let t of e){let e=t.target;if(!(this._button&&(e===this._button||this._button.contains(e)))){this._scheduleRenderFromHostObserver();return}}}}_scheduleRenderFromHostObserver(){this._hostRenderFromObserverRaf===null&&(this._hostRenderFromObserverRaf=requestAnimationFrame(()=>{this._hostRenderFromObserverRaf=null,this.isConnected&&this.render()}))}getButtonClasses(){let e=[`mint-button-core`,`mint-button-${this.getVariant()}`,`mint-button-tone-${this.getTone()}`];return this.isIconOnly()&&e.push(`mint-button-icon-only`),this.isFullWidth()&&e.push(`mint-button-full-width`),e.join(` `)}render(){this._disconnectHostChildObserver(),this._button&&!this._button.isConnected&&(this._button=null);try{let e=this.isLoading(),t=this.isDisabled()||e,n=this.getType();if(!this._button){let e=this.firstElementChild;if(e instanceof HTMLButtonElement)this._button=e;else{for(this._button=document.createElement(`button`);this.firstChild;)this._button.appendChild(this.firstChild);this.appendChild(this._button)}this.setupEventListeners()}this._button.type=n,this._button.disabled=t,this._button.setAttribute(`aria-busy`,String(e));let r=this._button.querySelector(`mint-spinner`);if(e)if(r)r.setAttribute(`data-button-variant`,this.getVariant()),r.setAttribute(`data-button-tone`,this.getTone()),`render`in r&&typeof r.render==`function`&&r.render();else{let e=document.createElement(`span`);e.className=`mint-button-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=`1em`,t.style.height=`1em`,e.appendChild(t),this._button.insertBefore(e,this._button.firstChild)}else r&&r.parentElement?.remove();for(let e of Array.from(this.childNodes))e!==this._button&&this._button.appendChild(e);let i=this.getIcon(),a=this._getGeneratedIcon();i?(a||(a=document.createElement(`mint-icon`),a.setAttribute(`data-generated-icon`,`true`),a.className=`mint-button-icon`),a.setAttribute(`name`,i)):a&&a.tagName===`MINT-ICON`&&(a.remove(),a=null);let o=this.getIconPosition(),s=this._button.querySelector(`.mint-button-content`);if(s){s.className=this._getContentWrapperClass(s);let e=a&&a.tagName===`MINT-ICON`;if(a&&!a.parentElement){let t=this._button.querySelector(`mint-spinner`)?.parentElement;e||o===`left`?t?t.insertAdjacentElement(`afterend`,a):this._button.insertBefore(a,s):s.insertAdjacentElement(`afterend`,a)}else if(a&&(e||o===`left`)&&a.nextSibling!==s){a.remove();let e=this._button.querySelector(`mint-spinner`)?.parentElement;e?e.insertAdjacentElement(`afterend`,a):this._button.insertBefore(a,s)}else a&&!e&&o===`right`&&a.previousSibling!==s&&(a.remove(),s.insertAdjacentElement(`afterend`,a))}else{let e=[];for(let t=this._button.firstChild;t;t=t.nextSibling){if(t.nodeType!==Node.ELEMENT_NODE){e.push(t);continue}let n=t;n.tagName!==`MINT-SPINNER`&&!n.querySelector(`mint-spinner`)&&t!==a&&!n.hasAttribute(`slot`)&&!(n.classList.contains(`mint-button-spinner-wrap`)&&n.querySelector(`mint-spinner`))&&e.push(t)}if(e.length>0){s=document.createElement(`span`),s.className=this._getContentWrapperClass(s),e.forEach(e=>{s.appendChild(e)}),s.className=this._getContentWrapperClass(s);let t=this._button.querySelector(`mint-spinner`)?.parentElement;a&&o===`left`?t?(t.insertAdjacentElement(`afterend`,a),a.insertAdjacentElement(`afterend`,s)):(this._button.insertBefore(a,this._button.firstChild),a.insertAdjacentElement(`afterend`,s)):a&&o===`right`?t?(t.insertAdjacentElement(`afterend`,s),s.insertAdjacentElement(`afterend`,a)):(this._button.insertBefore(s,this._button.firstChild),s.insertAdjacentElement(`afterend`,a)):t?t.insertAdjacentElement(`afterend`,s):this._button.insertBefore(s,this._button.firstChild)}else if(a&&a.tagName===`MINT-ICON`&&!a.parentElement){let e=this._button.querySelector(`mint-spinner`)?.parentElement;e?e.insertAdjacentElement(`afterend`,a):this._button.insertBefore(a,this._button.firstChild)}}let c=this.isIconOnly();a&&(a.classList.contains(`mint-button-icon`)||a.classList.add(`mint-button-icon`),e?a.style.display=`none`:a.style.display=``,a.setAttribute(`data-position`,o),a.toggleAttribute(`data-icon-only`,c),c&&(a.tagName===`MINT-ICON`?(a.style.width=`1em`,a.style.height=`1em`,a.style.maxWidth=`1em`,a.style.maxHeight=`1em`,a.style.flexShrink=`0`):(a.style.maxWidth=`1em`,a.style.maxHeight=`1em`,a.style.flexShrink=`0`,a.tagName===`svg`&&(a.style.width=`1em`,a.style.height=`1em`))));let l=this._button.querySelector(`.mint-button-spinner-wrap`),u=a??this._button.querySelector(`:scope > .mint-button-icon, :scope > [slot="icon"]`);if(e&&l&&u){l.setAttribute(`data-position`,o);let e=window.getComputedStyle(u),t=e.width,n=e.height;if(t!==`auto`&&t!==`0px`){l.style.width=t,l.style.flexBasis=t;let e=l.querySelector(`mint-spinner`);e&&(e.style.width=t)}if(n!==`auto`&&n!==`0px`){l.style.height=n;let e=l.querySelector(`mint-spinner`);e&&(e.style.height=n)}u.parentElement===this._button&&u.insertAdjacentElement(`beforebegin`,l)}if(e){let e=this._button.querySelector(`mint-spinner`)?.parentElement;e&&(e.setAttribute(`data-position`,o),c?e.setAttribute(`data-icon-only`,`true`):e.removeAttribute(`data-icon-only`))}let d=this.getButtonClasses();this._button.className=d;let f=this.getAttribute(`aria-label`)?.trim();if(f)this._button.setAttribute(`aria-label`,f);else if(this.isIconOnly()){let e=this.getIcon().split(`-`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `);this._button.setAttribute(`aria-label`,e||`Action`)}else this._button.removeAttribute(`aria-label`);this.hasAttribute(`active`)?this._button.setAttribute(`aria-pressed`,String(this.isActive())):this._button.removeAttribute(`aria-pressed`),this.setAttribute(`data-variant`,this.getVariant()),this.setAttribute(`data-tone`,this.getTone()),this._button.setAttribute(`data-variant`,this.getVariant()),this._button.setAttribute(`data-align`,this.getAlignment()),this._button.toggleAttribute(`data-icon-only`,c),e?this._button.setAttribute(`data-loading`,`true`):this._button.removeAttribute(`data-loading`),this.isActive()?this._button.classList.add(`mint-button-active`):this._button.classList.remove(`mint-button-active`)}finally{this._connectHostChildObserver()}}setupEventListeners(){this._button&&!this._clickHandler&&(this._clickHandler=this.handleClick.bind(this),this._clickHandler&&this._button.addEventListener(`click`,this._clickHandler,!0),this._button.addEventListener(`mousedown`,this._handleMouseDown),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(`touchstart`,this._handleTouchStart),this._button.removeEventListener(`touchend`,this._handleTouchEnd),this._button.removeEventListener(`touchcancel`,this._handleTouchCancel))}_clearMousePressedState(){this._mousePressed&&(this._mousePressed=!1,document.removeEventListener(`mouseup`,this._handleMouseUp),window.removeEventListener(`blur`,this._handleMouseCancel)),this._button&&(this.isActive()||this._button.classList.remove(`mint-button-active`))}handleClick(e){if(this.isDisabled()||this.isLoading()){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();return}if(this.getType()===`submit`){this.dispatchEvent(new CustomEvent(`click`,{detail:{originalEvent:e},bubbles:!0,cancelable:!0,composed:!0}));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})}};customElements.get(`mint-button`)||a(`mint-button`,_n);var vn=class extends HTMLElement{static get observedAttributes(){return[`checked`,`disabled`,`label`,`icon`,`info`,`error`,`error-message`,`loading`]}_button=null;_checked=!1;_hasUserToggled=!1;constructor(){super()}connectedCallback(){this.classList.add(`mint-switch`),this._checked=this.getAttribute(`checked`)===`true`,this.render()}_getSwitchContainer(){let e=this.querySelector(`.mint-switch-container`);return e||(e=document.createElement(`div`),e.className=`mint-switch-container`,this.insertBefore(e,this.firstChild)),e}disconnectedCallback(){this.removeEventListeners()}isLoading(){return this.getAttribute(`loading`)===`true`}attributeChangedCallback(e,t,n){if(e===`checked`&&(this._checked=n===`true`),t!==n){if(e===`error`||e===`error-message`){this._renderErrorState(),this._syncSwitchAccessibility();return}if(e===`loading`){this.render();return}this.render()}}get checked(){try{return this._checked||!1}catch{return!1}}set checked(e){try{e?this.setAttribute(`checked`,`true`):this.setAttribute(`checked`,`false`),this._checked=!!e,this.render()}catch{}}isDisabled(){return this.getAttribute(`disabled`)===`true`}getLabel(){return this.getAttribute(`label`)||``}getInfo(){return this.getAttribute(`info`)||``}getIcon(){return this.getAttribute(`icon`)||``}hasIcon(){return!!this.getIcon()}hasError(){return this.getAttribute(`error`)===`true`}getErrorMessage(){return this.getAttribute(`error-message`)||``}getSwitchClasses(){return`mint-switch-control`}getThumbClasses(){return[`mint-switch-thumb`,this._checked?`mint-switch-thumb-checked`:``,this._hasUserToggled?`mint-switch-thumb-animated`:``].filter(Boolean).join(` `)}getIconClasses(){return`mint-switch-icon`}render(){let e=this.isLoading();this.setAttribute(`aria-busy`,String(e));let t=this.getSwitchClasses(),n=this.getThumbClasses(),r=this.getLabel(),i=this.getInfo(),a=this.getIcon(),o=this.getAttribute(`id`)||`mint-switch-${Math.random().toString(36).substr(2,9)}`;this.getAttribute(`id`)||this.setAttribute(`id`,o);let s=this._getSwitchContainer();this._button?this._button.parentElement!==s&&s.appendChild(this._button):(this._button=document.createElement(`button`),s.appendChild(this._button),this.setupEventListeners());let c=s.querySelector(`.mint-switch-label`);r?(c||(c=document.createElement(`label`),c.className=`mint-switch-label`,this._button&&this._button.parentElement===s?s.insertBefore(c,this._button.nextSibling):s.appendChild(c)),c.textContent=r,c.setAttribute(`for`,`${o}-control`),this.isDisabled()?c.classList.add(`mint-switch-disabled`):c.classList.remove(`mint-switch-disabled`)):c&&c.remove(),this._button.className=t,this._button.disabled=this.isDisabled(),this._button.id=`${o}-control`,this._button.setAttribute(`aria-checked`,String(this._checked)),this._button.setAttribute(`aria-label`,r||`Toggle switch`),this._button.setAttribute(`role`,`switch`),this._button.type=`button`;let l=this._button.querySelector(`span`);l||(l=document.createElement(`span`),this._button.appendChild(l)),l.className=n;let u=l.querySelector(`span`);if(a){let e=u;e||(e=document.createElement(`span`),e.className=this.getIconClasses(),l.appendChild(e));let t=e.querySelector(`mint-icon`);t||(t=document.createElement(`mint-icon`),e.appendChild(t)),t.setAttribute(`name`,a)}else u&&u.remove();let d=this.querySelector(`.mint-switch-info`);i?(d||(d=document.createElement(`span`),d.className=`mint-switch-info`,s&&s.parentElement===this?this.insertBefore(d,s.nextSibling):this.appendChild(d)),d.textContent=i,this.isDisabled()?d.classList.add(`mint-switch-disabled`):d.classList.remove(`mint-switch-disabled`)):d&&d.remove(),this._renderErrorState(),this._syncSwitchAccessibility(),this._renderSkeleton(e)}setupEventListeners(){this._button&&this._button.addEventListener(`click`,this.handleToggle.bind(this))}removeEventListeners(){this._button&&this._button.removeEventListener(`click`,this.handleToggle.bind(this))}handleToggle(e){if(!this.isDisabled()){this._hasUserToggled=!0,this.checked=!this._checked;let e=new Event(`input`,{bubbles:!0,cancelable:!0,composed:!0});this.dispatchEvent(e),this.dispatchEvent(new CustomEvent(`input`,{detail:{checked:this._checked},bubbles:!0,cancelable:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`change`,{detail:{checked:this._checked},bubbles:!0,cancelable:!0})),this.dispatchEvent(new CustomEvent(`toggle`,{detail:{checked:this._checked},bubbles:!0,cancelable:!0}))}}_renderSkeleton(e){let t=this._getSwitchContainer(),n=this.getLabel(),r=this.getInfo(),i=t.querySelector(`.mint-switch-skeleton-container`),a=this.querySelector(`.mint-switch-info-skeleton`);if(e){t.classList.add(`mint-switch-container-loading`),i||(i=document.createElement(`div`),i.className=`mint-switch-skeleton-container`,t.appendChild(i));let e=i.querySelector(`.mint-switch-skeleton-box`);if(e||(e=document.createElement(`div`),e.className=`mint-switch-skeleton-box`,i.appendChild(e)),n){let e=i.querySelector(`.mint-switch-skeleton-label`);e||(e=document.createElement(`div`),e.className=`mint-switch-skeleton-label`,i.appendChild(e))}else{let e=i.querySelector(`.mint-switch-skeleton-label`);e&&e.remove()}i.style.display=`flex`,this._button&&(this._button.style.visibility=`hidden`,this._button.style.pointerEvents=`none`);let o=t.querySelector(`.mint-switch-label`);if(o&&(o.style.visibility=`hidden`,o.style.pointerEvents=`none`),r){a||(a=document.createElement(`div`),a.className=`mint-switch-info-skeleton`,t&&t.parentElement===this?this.insertBefore(a,t.nextSibling):this.appendChild(a)),a.style.display=`block`;let e=this.querySelector(`.mint-switch-info`);e&&(e.style.display=`none`)}else a&&(a.style.display=`none`)}else{i&&(i.style.display=`none`),t.classList.remove(`mint-switch-container-loading`),a&&(a.style.display=`none`),this._button&&(this._button.style.visibility=`visible`,this._button.style.pointerEvents=`auto`);let e=t.querySelector(`.mint-switch-label`);e&&(e.style.visibility=`visible`,e.style.pointerEvents=`auto`);let n=this.querySelector(`.mint-switch-info`);n&&(n.style.display=``)}}_renderErrorState(){let e=this.hasError(),t=this.getErrorMessage(),n=this.querySelector(`.mint-switch-error`);e&&t?(n||(n=document.createElement(`div`),n.className=`mint-switch-error`,this.appendChild(n)),n.textContent=t):n&&n.remove(),this._button&&(this._button.className=this.getSwitchClasses()),this._syncSwitchAccessibility()}_syncSwitchAccessibility(){if(!this._button)return;let e=this.getAttribute(`id`)||`mint-switch-${Math.random().toString(36).slice(2,10)}`;this.getAttribute(`id`)||this.setAttribute(`id`,e),this._button.id=`${e}-control`,this._button.setAttribute(`aria-invalid`,String(this.hasError()));let t=(this.getAttribute(`aria-describedby`)||``).split(/\s+/).filter(Boolean),n=this.querySelector(`.mint-switch-info`),r=this.querySelector(`.mint-switch-error`);n&&(n.id=`${e}-info`,t.push(n.id)),r&&(r.id=`${e}-error`,t.push(r.id)),t.length?this._button.setAttribute(`aria-describedby`,Array.from(new Set(t)).join(` `)):this._button.removeAttribute(`aria-describedby`)}};customElements.get(`mint-switch`)||a(`mint-switch`,vn);var yn=class extends HTMLElement{static get observedAttributes(){return[`variant`,`size`,`bold`,`underline`,`strike`,`italic`,`display`,`inline`]}constructor(){super(),this._darkModeObserver=null}connectedCallback(){this.render()}attributeChangedCallback(e,t,n){t!==n&&this.render()}disconnectedCallback(){this._darkModeObserver&&=(this._darkModeObserver.disconnect(),null)}_observeDarkMode(){if(!this._darkModeObserver){if(this._darkModeObserver=new MutationObserver(()=>{this.render()}),!document.documentElement)return;this._darkModeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`,`data-mint-theme`]})}}getVariant(){return this.getAttribute(`variant`)||`default`}getSize(){return this.getAttribute(`size`)||`regular`}isBold(){return this.hasAttribute(`bold`)}isUnderline(){return this.hasAttribute(`underline`)}isStrike(){return this.hasAttribute(`strike`)}isItalic(){return this.hasAttribute(`italic`)}getDisplay(){return this.hasAttribute(`display`)?this.getAttribute(`display`):this.hasAttribute(`inline`)?`inline-block`:`block`}getTextClasses(){return this.className}render(){}};typeof customElements<`u`&&!customElements.get(`mint-text`)&&a(`mint-text`,yn);var bn=class extends HTMLElement{static get observedAttributes(){return[`direction`,`text-align`,`gap`,`align-content`]}connectedCallback(){this.classList.add(`mint-stack`),this.render()}attributeChangedCallback(e,t,n){t!==n&&this.render()}getDirection(){return this.getAttribute(`direction`)===`horizontal`?`horizontal`:`vertical`}getGap(){let e=Number.parseFloat(this.getAttribute(`gap`)||`3`);return Number.isFinite(e)?Math.min(12,Math.max(1,Math.round(e))):3}getTextAlign(){let e=this.getAttribute(`text-align`)||``;return[`left`,`center`,`right`,`justify`].includes(e)?e:``}getAlignContent(){let e=(this.getAttribute(`align-content`)||``).trim().toLowerCase();return e===`left`||e===`start`?`left`:e===`right`||e===`end`?`right`:e===`center`||e===`middle`?`center`:``}render(){let e=this.getDirection(),t=this.getAlignContent(),n=this.getTextAlign();this.classList.add(`mint-stack`),this.style.setProperty(`--mint-stack-direction`,e===`horizontal`?`row`:`column`),this.style.setProperty(`--mint-stack-gap`,`${this.getGap()*.25}rem`),this.style.setProperty(`--mint-stack-align-items`,e===`vertical`&&t?{left:`flex-start`,right:`flex-end`,center:`center`}[t]:`stretch`),this.style.setProperty(`--mint-stack-justify-content`,e===`horizontal`&&t?{left:`flex-start`,right:`flex-end`,center:`center`}[t]:`flex-start`),this.style.setProperty(`--mint-stack-text-align`,n||`initial`)}};typeof customElements<`u`&&!customElements.get(`mint-stack`)&&a(`mint-stack`,bn);var xn=class extends HTMLElement{static get observedAttributes(){return[`heading`,`flush`]}_headingElement=null;_contentObserver=null;constructor(){super()}connectedCallback(){this.render(),this._updateTableContentPadding(),this._contentObserver=new MutationObserver(()=>this._updateTableContentPadding()),this._contentObserver.observe(this,{childList:!0})}disconnectedCallback(){this._contentObserver?.disconnect(),this._contentObserver=null}attributeChangedCallback(e,t,n){t!==n&&this.render()}getHeading(){return this.getAttribute(`heading`)||``}_updateTableContentPadding(){let e=Array.from(this.children),t=e.some(e=>e.tagName===`MINT-RESOURCE-TABLE`),n=t||e.some(e=>e.tagName===`MINT-TABLE`);this.classList.toggle(`mint-card--resource-table`,t),this.toggleAttribute(`data-mint-card-table-content`,n)}render(){let e=this.getHeading();e?(this._headingElement||(this._headingElement=document.createElement(`mint-text`),this._headingElement.setAttribute(`size`,`sub-heading`),this._headingElement.setAttribute(`role`,`heading`),this._headingElement.setAttribute(`aria-level`,`2`),this.insertBefore(this._headingElement,this.firstChild)),this._headingElement.textContent=e):this._headingElement?.parentNode&&(this._headingElement.remove(),this._headingElement=null)}};typeof customElements<`u`&&!customElements.get(`mint-card`)&&a(`mint-card`,xn);var Sn=class extends HTMLElement{static get observedAttributes(){return[`href`,`target`]}constructor(){super(),this._link=null}connectedCallback(){this.render()}attributeChangedCallback(e,t,n){t!==n&&this.render()}getHref(){return this.getAttribute(`href`)||`#`}getTarget(){return this.getAttribute(`target`)||``}hasIcon(){return!!this.querySelector(`mint-icon`)||!!this._link?.querySelector(`mint-icon`)}render(){let e=this.getHref(),t=this.getTarget();if(!this._link){for(this._link=document.createElement(`a`);this.firstChild;)this._link.appendChild(this.firstChild);this.appendChild(this._link)}this._link.href=e,t?(this._link.target=t,t===`_blank`&&(this._link.rel=`noopener noreferrer`)):(this._link.removeAttribute(`target`),this._link.removeAttribute(`rel`));let n=[`mint-link-anchor`,this.hasIcon()?`mint-link-with-icon`:``];this._link.className=n.filter(Boolean).join(` `)}};typeof customElements<`u`&&!customElements.get(`mint-link`)&&a(`mint-link`,Sn),s({name:`arrow-left`,viewBox:`0 0 24 24`,path:`M19 12H5m7-7l-7 7 7 7`,strokeLinecap:`round`,strokeLinejoin:`round`});var Cn=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-button-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=`1em`,t.style.height=`1em`,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._button.querySelector(`.mint-button-spinner-wrap`);if(i&&(i.style.display=this.isLoading()?`none`:``,this.isLoading()&&s)){s.setAttribute(`data-position`,a);let e=window.getComputedStyle(i),t=e.width,n=e.height;if(t!==`auto`&&t!==`0px`){s.style.width=t,s.style.flexBasis=t;let e=s.querySelector(`mint-spinner`);e&&(e.style.width=t)}if(n!==`auto`&&n!==`0px`){s.style.height=n;let e=s.querySelector(`mint-spinner`);e&&(e.style.height=n)}i.parentElement===this._button&&i.insertAdjacentElement(`beforebegin`,s)}let c=this.isIconOnly();this.isLoading()&&s&&(s.setAttribute(`data-position`,a),c?s.setAttribute(`data-icon-only`,`true`):s.removeAttribute(`data-icon-only`)),i&&(i.classList.contains(`mint-button-icon`)||i.classList.add(`mint-button-icon`),i.classList.remove(`mint-icon-leading`,`mint-icon-trailing`),c?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 l=this.getButtonClasses();this._button.className=l}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`,Cn);var wn=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`,`solid`),this._button.setAttribute(`tone`,`neutral`),this._button.setAttribute(`icon`,`arrow-left`),this._button.setAttribute(`aria-label`,this.getAttribute(`aria-label`)||`Go back`),this._button.addEventListener(`click`,e=>this.handleClick(e)),this.appendChild(this._button))}};typeof customElements<`u`&&!customElements.get(`mint-back-button`)&&a(`mint-back-button`,wn);function B(e,t=`vertical`,n=`1.5rem`,r=`mask`){let i=null,a=null,o=0,s=0,c=null,l=null,u=null,d=0,f=0,p=0,m=t=>t===`top`?e.scrollTop>1:t===`bottom`?e.scrollTop+e.clientHeight<e.scrollHeight-1:t===`left`?e.scrollLeft>1:e.scrollLeft+e.clientWidth<e.scrollWidth-1,h=(t,n)=>{let r=Number.parseFloat(t);if(!Number.isFinite(r)||r<=0)return Math.min(24,n/2);let i=t.trim().replace(String(r),``).toLowerCase(),a=Number.parseFloat(getComputedStyle(document.documentElement).fontSize)||16,o=Number.parseFloat(getComputedStyle(e).fontSize)||a,s=i===`rem`?r*a:i===`em`?r*o:i===`vw`?r*window.innerWidth/100:i===`vh`?r*window.innerHeight/100:i===`%`?r*n/100:r;return Math.max(1,Math.min(s,n/2))},g=(t,r)=>{let i=e.getBoundingClientRect();if(!i.width||!i.height)return null;let a=getComputedStyle(e).getPropertyValue(`--mint-scroll-fade-size`).trim()||n,o=h(a,i.height),s=h(a,i.width),c=[];return r>=i.top&&r<=i.top+o&&m(`top`)&&c.push({edge:`top`,distance:r-i.top}),r<=i.bottom&&r>=i.bottom-o&&m(`bottom`)&&c.push({edge:`bottom`,distance:i.bottom-r}),t>=i.left&&t<=i.left+s&&m(`left`)&&c.push({edge:`left`,distance:t-i.left}),t<=i.right&&t>=i.right-s&&m(`right`)&&c.push({edge:`right`,distance:i.right-t}),c.sort((e,t)=>e.distance-t.distance),c[0]?.edge??null},_=t=>{if(!c)return;let r=e.getBoundingClientRect(),i=Math.min(10,Math.max(4,h(n,Math.min(r.width,r.height))/2)),a=t===`left`?r.left+i:t===`right`?r.right-i:r.left+r.width/2,o=t===`top`?r.top+i:t===`bottom`?r.bottom-i:r.top+r.height/2;c.style.left=`${a}px`,c.style.top=`${o}px`},v=()=>{s&&cancelAnimationFrame(s),s=0,u=null,delete e.dataset.mintScrollFadeHover,c&&(c.hidden=!0)},y=t=>{if(s=0,!l){v();return}let n=g(l.x,l.y);if(n!==u){b(n);return}if(!n)return;_(n);let r=Math.max(0,t-d),i=Math.min(50,Math.max(0,t-f));f=t;let a=Math.min(500,32+r*.14)*i/1e3+p,o=n===`top`||n===`bottom`?e.scrollTop:e.scrollLeft;n===`top`?e.scrollTop-=a:n===`bottom`?e.scrollTop+=a:n===`left`?e.scrollLeft-=a:e.scrollLeft+=a;let c=n===`top`||n===`bottom`?e.scrollTop:e.scrollLeft;if(p=(n===`top`||n===`left`?o-a:o+a)-c,o===c&&!m(n)){v();return}C(),s=requestAnimationFrame(y)};function b(t){if(s&&cancelAnimationFrame(s),s=0,u=t,p=0,!t){delete e.dataset.mintScrollFadeHover,c&&(c.hidden=!0);return}e.dataset.mintScrollFadeHover=t,c||(c=document.createElement(`span`),c.className=`mint-scroll-fade-hover-caret`,c.setAttribute(`aria-hidden`,`true`),document.body.append(c)),c.dataset.edge=t,c.textContent=``,c.hidden=!1,d=performance.now(),f=d,_(t),s=requestAnimationFrame(y)}let x=t=>{if(t.pointerType&&t.pointerType!==`mouse`)return;if(t.target instanceof Node&&!e.contains(t.target)){l=null,v();return}l={x:t.clientX,y:t.clientY};let n=g(t.clientX,t.clientY);n===u?n&&_(n):b(n)},S=()=>{l=null,v()},C=()=>{cancelAnimationFrame(o),o=requestAnimationFrame(()=>{let i=t===`vertical`||t===`both`,a=t===`horizontal`||t===`both`,o=i&&e.scrollTop>1,s=i&&e.scrollTop+e.clientHeight<e.scrollHeight-1,c=a&&e.scrollLeft>1,l=a&&e.scrollLeft+e.clientWidth<e.scrollWidth-1,u=getComputedStyle(e),d=Number.parseFloat(u.borderTopWidth)||0,f=Number.parseFloat(u.borderRightWidth)||0,p=Number.parseFloat(u.borderBottomWidth)||0,m=Number.parseFloat(u.borderLeftWidth)||0;e.dataset.mintScrollFadeTop=String(o),e.dataset.mintScrollFadeBottom=String(s),e.dataset.mintScrollFadeLeft=String(c),e.dataset.mintScrollFadeRight=String(l),e.style.setProperty(`--mint-scroll-fade-size`,n),e.style.setProperty(`--mint-scroll-fade-top-size`,o?n:`0px`),e.style.setProperty(`--mint-scroll-fade-bottom-size`,s?n:`0px`),e.style.setProperty(`--mint-scroll-fade-left-size`,c?n:`0px`),e.style.setProperty(`--mint-scroll-fade-right-size`,l?n:`0px`);let h=[];if(i){let e=[`#000 0`];o&&e.push(`transparent ${d}px`,`#000 calc(var(--mint-scroll-fade-top-size) + ${d}px)`),s?e.push(`#000 calc(100% - var(--mint-scroll-fade-bottom-size) - ${p}px)`,`transparent calc(100% - ${p}px)`,`#000 100%`):e.push(`#000 100%`),h.push(`linear-gradient(to bottom, ${e.join(`, `)})`)}if(a){let e=[`#000 0`];c&&e.push(`transparent ${m}px`,`#000 calc(var(--mint-scroll-fade-left-size) + ${m}px)`),l?e.push(`#000 calc(100% - var(--mint-scroll-fade-right-size) - ${f}px)`,`transparent calc(100% - ${f}px)`,`#000 100%`):e.push(`#000 100%`),h.push(`linear-gradient(to right, ${e.join(`, `)})`)}if(r===`overlay`)e.dataset.mintScrollFadeMode=`overlay`,e.style.maskImage=``,e.style.webkitMaskImage=``,e.style.maskClip=``,e.style.webkitMaskClip=``,e.style.removeProperty(`mask-composite`),e.style.removeProperty(`-webkit-mask-composite`);else{let t=o||s||c||l?h.join(`, `):`none`;e.style.maskImage=t,e.style.webkitMaskImage=t,e.style.maskClip=`border-box`,e.style.webkitMaskClip=`border`,e.dataset.mintScrollFadeMode=`mask`,h.length>1?(e.style.maskComposite=`intersect`,e.style.webkitMaskComposite=`source-in`):(e.style.removeProperty(`mask-composite`),e.style.removeProperty(`-webkit-mask-composite`))}})};return e.addEventListener(`scroll`,C,{passive:!0}),document.addEventListener(`pointermove`,x,{passive:!0,capture:!0}),document.addEventListener(`pointerleave`,S),window.addEventListener(`blur`,S),typeof ResizeObserver<`u`&&(i=new ResizeObserver(C),i.observe(e),e.firstElementChild&&i.observe(e.firstElementChild)),typeof MutationObserver<`u`&&(a=new MutationObserver(C),a.observe(e,{childList:!0,subtree:!0,characterData:!0})),C(),()=>{e.removeEventListener(`scroll`,C),document.removeEventListener(`pointermove`,x,!0),document.removeEventListener(`pointerleave`,S),window.removeEventListener(`blur`,S),i?.disconnect(),a?.disconnect(),cancelAnimationFrame(o);for(let t of[`mintScrollFadeTop`,`mintScrollFadeBottom`,`mintScrollFadeLeft`,`mintScrollFadeRight`])delete e.dataset[t];delete e.dataset.mintScrollFadeMode,delete e.dataset.mintScrollFadeHover,l=null,v(),c?.remove(),c=null,e.style.maskImage=``,e.style.webkitMaskImage=``,e.style.maskClip=``,e.style.webkitMaskClip=``,e.style.removeProperty(`--mint-scroll-fade-size`),e.style.removeProperty(`--mint-scroll-fade-top-size`),e.style.removeProperty(`--mint-scroll-fade-bottom-size`),e.style.removeProperty(`--mint-scroll-fade-left-size`),e.style.removeProperty(`--mint-scroll-fade-right-size`),e.style.removeProperty(`mask-composite`),e.style.removeProperty(`-webkit-mask-composite`)}}var Tn=class extends HTMLElement{constructor(...e){super(...e),this._disposeFade=null,this._target=null,this._contentObserver=null}static get observedAttributes(){return[`axis`,`fade-size`,`target`]}connectedCallback(){this._attachFade(),this._contentObserver=new MutationObserver(()=>this._attachFade()),this._contentObserver.observe(this,{childList:!0,subtree:!0})}disconnectedCallback(){this._contentObserver?.disconnect(),this._contentObserver=null,this._disposeFade?.(),this._disposeFade=null,this._target=null,this.removeAttribute(`data-wraps-scrollport`)}attributeChangedCallback(){this.isConnected&&this._attachFade()}_attachFade(){let e=this.getAttribute(`target`),t=null;if(e)try{t=this.querySelector(e)}catch{t=null}let n=t||Array.from(this.querySelectorAll(`*`)).find(e=>{let t=getComputedStyle(e);return/(auto|scroll)/.test(`${t.overflowY} ${t.overflowX}`)})||this;if(n===this._target)return;this._disposeFade?.(),this._target=n,this.toggleAttribute(`data-wraps-scrollport`,n!==this);let r=this.getAttribute(`axis`)||`vertical`;this._disposeFade=B(n,[`vertical`,`horizontal`,`both`].includes(r)?r:`vertical`,this.getAttribute(`fade-size`)||`1.5rem`)}};customElements.get(`mint-scroll-fade`)||a(`mint-scroll-fade`,Tn);var En=new Set([`up`,`down`,`left`,`right`]);function Dn(e){let t=e.getBoundingClientRect(),n=Math.max(0,t.top),r=Math.min(window.innerWidth,t.right),i=Math.min(window.innerHeight,t.bottom),a=Math.max(0,t.left);for(let t=e.parentElement;t&&t!==document.body;t=t.parentElement){let e=getComputedStyle(t),o=t.getBoundingClientRect();/(auto|scroll|hidden|clip)/.test(e.overflowY)&&(n=Math.max(n,o.top),i=Math.min(i,o.bottom)),/(auto|scroll|hidden|clip)/.test(e.overflowX)&&(a=Math.max(a,o.left),r=Math.min(r,o.right))}return i>n&&r>a}var On=class extends HTMLElement{static get observedAttributes(){return[`direction`,`open`,`trigger-id`,`trigger-toggle`,`trigger-align`,`align-selected`,`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,this._disposeScrollFade=null,this._selectPopoverPlaceholder=null}connectedCallback(){this.render(),this._disposeScrollFade?.();let e=this.classList.contains(`mint-select-popover`),t=this.classList.contains(`mint-editor-overflow-popover`),n=e?this.querySelector(`.mint-select-options`):null;this._disposeScrollFade=B(n||this,`vertical`,t?`1.5rem`:`3rem`,n?`mask`:`overlay`),this._setupTrigger()}disconnectedCallback(){this._removeTrigger(),this._removeOpenListeners(),this._disposeScrollFade?.(),this._disposeScrollFade=null,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 En.has(e)?e:`down`}getTriggerId(){return this.getAttribute(`trigger-id`)||``}_findTrigger(e){let t=this.getRootNode();return t instanceof ShadowRoot?t.querySelector(`#${CSS.escape(e)}`):document.getElementById(e)}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=this._findTrigger(e),!this._trigger){this._triggerLookupTimer=setTimeout(()=>{this.isConnected&&this.getTriggerId()===e&&!this._trigger&&this._setupTrigger()},40);return}this._syncLayerZIndex(),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))}}_getLayerZIndex(){let e=900,t=this._trigger||this.parentElement;for(;t&&t!==document.documentElement;){let n=Number.parseInt(getComputedStyle(t).zIndex,10);Number.isFinite(n)&&(e=Math.max(e,n)),t=t.parentElement}return Math.max(901,e+1)}_syncLayerZIndex(){this.style.zIndex=String(this._getLayerZIndex())}_portalSelectPopover(){if(!this.classList.contains(`mint-select-popover`)||this.parentElement===document.body)return;let e=this.parentNode;if(!e)return;let t=document.createComment(`mint-select-popover`);e.insertBefore(t,this),this._selectPopoverPlaceholder=t,document.body.appendChild(this),this._syncLayerZIndex()}_restoreSelectPopover(){if(!this._selectPopoverPlaceholder)return;let e=this._selectPopoverPlaceholder;this._selectPopoverPlaceholder=null,e.parentNode?e.parentNode.replaceChild(this,e):this.parentElement===document.body&&this.remove()}_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._alignSelectedOptionToTrigger())},this._scrollHandler=e=>{if(!this.isOpen())return;let t=e.target;if(!(t instanceof Node&&(t===this||this.contains(t)))){if(this.classList.contains(`mint-select-popover`)){!this._trigger||!Dn(this._trigger)?this.close():(this._position({allowViewportFlip:!1,clampToViewport:!1}),this._alignSelectedOptionToTrigger());return}this._position({allowViewportFlip:!1,clampToViewport:!1}),this._alignSelectedOptionToTrigger()}},typeof ResizeObserver<`u`&&this._trigger){this._resizeObserver=new ResizeObserver(()=>{this.isOpen()&&(this._position(),this._alignSelectedOptionToTrigger())}),this.classList.contains(`mint-select-popover`)||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)}}_getFixedPositionContext(){for(let e=this.parentElement;e&&e!==document.documentElement;e=e.parentElement){let t=getComputedStyle(e),n=`${t.contain} ${t.willChange}`;if(!(t.transform!==`none`||t.perspective!==`none`||t.filter!==`none`||t.backdropFilter!==`none`||[`layout`,`paint`,`strict`,`content`,`transform`,`perspective`,`filter`].some(e=>n.includes(e))))continue;let r=e.getBoundingClientRect(),i=r.width/(e.offsetWidth||r.width)||1,a=r.height/(e.offsetHeight||r.height)||1;return{scaleX:i,scaleY:a,originLeft:r.left+(parseFloat(t.borderLeftWidth)||0)*i,originTop:r.top+(parseFloat(t.borderTopWidth)||0)*a}}return{scaleX:1,scaleY:1,originLeft:0,originTop:0}}_position({allowViewportFlip:e=!0,clampToViewport:t=!0}={}){let n=this._findTrigger(this.getTriggerId());n&&n!==this._trigger&&this._setupTrigger();let r=n||this._trigger;if(!r)return;let i=r.getBoundingClientRect(),a=this._getFixedPositionContext(),o={width:this.offsetWidth*a.scaleX,height:this.offsetHeight*a.scaleY},s=this._distancePx(),c=s*a.scaleX,l=s*a.scaleY,u=e?this.getDirection():this.dataset.direction||this.getDirection(),d=0,f=0,p=this.getAttribute(`trigger-align`)||`center`;if(u===`down`||u===`up`){let t=i.bottom+l,n=i.top-o.height-l;e&&u===`down`&&t+o.height>innerHeight-12&&n>=12?u=`up`:e&&u===`up`&&n<12&&t+o.height<=innerHeight-12&&(u=`down`);let r=this.hasAttribute(`align-selected`)?this.querySelector(`[role="option"][aria-selected="true"]`):null;if(r){let e=r.closest(`[role="listbox"]`);if(e&&e.scrollHeight>e.clientHeight+1){let t=Math.max(0,e.scrollHeight-e.clientHeight),n=r.offsetTop-Math.max(0,(e.clientHeight-r.offsetHeight)/2);e.scrollTop=Math.max(0,Math.min(t,n))}}if(d=u===`down`?t:n,r&&this.classList.contains(`mint-select-popover`)){let e=this.getBoundingClientRect(),t=r.getBoundingClientRect().top-e.top;d=i.top-t}f=p===`start`?i.left:p===`end`?i.right-o.width:i.left+(i.width-o.width)/2}else{let t=i.right+c,n=i.left-o.width-c;e&&u===`right`&&t+o.width>innerWidth-12&&n>=12?u=`left`:e&&u===`left`&&n<12&&t+o.width<=innerWidth-12&&(u=`right`),f=u===`right`?t:n,d=p===`start`?i.top:p===`end`?i.bottom-o.height:i.top+(i.height-o.height)/2}let m=t&&!this.classList.contains(`mint-select-popover`)?Math.max(12,Math.min(d,innerHeight-o.height-12)):d,h=t?Math.max(12,Math.min(f,innerWidth-o.width-12)):f,g=(m-a.originTop)/a.scaleY,_=(h-a.originLeft)/a.scaleX;this.style.top=`${g}px`,this.style.left=`${_}px`,this.dataset.direction=u,this.style.setProperty(`--mint-popover-origin-x`,`${(i.left+i.width/2-h)/a.scaleX}px`),this.style.setProperty(`--mint-popover-origin-y`,`${(i.top+i.height/2-m)/a.scaleY}px`)}_alignSelectedOptionToTrigger(){if(!this.classList.contains(`mint-select-popover`)||!this._trigger)return;let e=this.querySelector(`[role="option"][aria-selected="true"]`);if(!e)return;let t=this._trigger.getBoundingClientRect(),n=e.closest(`[role="listbox"]`),r=window.visualViewport,i=r?.offsetTop??0,a=r?.height??window.innerHeight,o=Math.max(0,a-24);this.style.maxHeight=`${o}px`,this.style.overflowY=`auto`;let s=this.getBoundingClientRect(),c=e.getBoundingClientRect(),l=i+12,u=Math.max(l,i+a-12-s.height),d=Math.max(l,Math.min(t.top-(c.top-s.top),u));if(n){let r=t.top-d,o=c.top-s.top;n.scrollTop+=o-r,s=this.getBoundingClientRect(),c=e.getBoundingClientRect();let u=t.top-(c.top-s.top),f=Math.max(l,i+a-12-s.height);d=Math.max(l,Math.min(u,f))}this.style.top=`${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();e?this._portalSelectPopover():this._restoreSelectPopover(),this._syncLayerZIndex();let 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(),this._alignSelectedOptionToTrigger(),e&&!this.classList.contains(`mint-select-popover`)&&this._animateBlob(!0),requestAnimationFrame(()=>requestAnimationFrame(()=>{this.isOpen()&&(this._position(),this._alignSelectedOptionToTrigger())}))}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`,On);var kn=class extends HTMLElement{static get observedAttributes(){return[`heading`,`fallback-href`,`show-back-button`,`containered`]}constructor(){super(),this._actionsResizeObserver=null,this._actionsMutationObserver=null,this._actionsFrame=null,this._groupingActions=!1,this._actionFullWidthOriginal=new WeakMap,this._autoGroupedActions=new WeakSet,this._explicitOverflowActions=new WeakSet,this._root=this.attachShadow({mode:`open`}),this._root.innerHTML=`
|
|
113
|
+
`.trim()}};typeof customElements<`u`&&!customElements.get(`mint-spinner`)&&a(`mint-spinner`,gn);var _n=class extends HTMLElement{static get observedAttributes(){return[`variant`,`tone`,`disabled`,`loading`,`button-type`,`type`,`full-width`,`icon-position`,`icon`,`active`,`align`,`aria-label`]}constructor(){super(),this._button=null,this._clickHandler=null,this._isHandlingClick=!1,this._mousePressed=!1,this._hostChildObserver=null,this._hostRenderFromObserverRaf=null,this._handleMouseDown=()=>{this._button&&!this.isDisabled()&&!this.isLoading()&&(this._button.classList.add(`mint-button-active`),this._mousePressed||(this._mousePressed=!0,document.addEventListener(`mouseup`,this._handleMouseUp),window.addEventListener(`blur`,this._handleMouseCancel)))},this._handleMouseUp=()=>{this._clearMousePressedState()},this._handleMouseCancel=()=>{this._clearMousePressedState()},this._handleTouchStart=()=>{this._button&&!this.isDisabled()&&!this.isLoading()&&this._button.classList.add(`mint-button-active`)},this._handleTouchEnd=()=>{this._button&&(this.isActive()||this._button.classList.remove(`mint-button-active`))},this._handleTouchCancel=()=>{this._button&&(this.isActive()||this._button.classList.remove(`mint-button-active`))}}_getGeneratedIcon(){return this._button?this._button.querySelector(`:scope > [data-generated-icon="true"]`):null}_getContentWrapperClass(e){return`mint-button-content`}connectedCallback(){this.render(),this._button&&this.setupEventListeners()}disconnectedCallback(){this._disconnectHostChildObserver(),this._hostRenderFromObserverRaf!==null&&(cancelAnimationFrame(this._hostRenderFromObserverRaf),this._hostRenderFromObserverRaf=null),this.removeEventListeners(),this._clearMousePressedState()}attributeChangedCallback(e,t,n){t!==n&&this.render()}getVariant(){let e=this.getAttribute(`variant`);return e===`ghost`||e===`outline`?e:`solid`}getTone(){return this.getAttribute(`tone`)||`neutral`}isDisabled(){return this.getAttribute(`disabled`)===`true`}isLoading(){return this.getAttribute(`loading`)===`true`}getType(){let e=this.getAttribute(`type`),t=this.getAttribute(`button-type`);return(e||t||`default`)===`submit`?`submit`:`button`}isFullWidth(){return this.getAttribute(`full-width`)===`true`}isActive(){return this.getAttribute(`active`)===`true`}get active(){return this.isActive()}set active(e){e?this.setAttribute(`active`,`true`):this.removeAttribute(`active`)}getIconPosition(){return this.getAttribute(`icon-position`)||`left`}getIcon(){return this.getAttribute(`icon`)||``}getAlignment(){let e=this.getAttribute(`align`);return e===`left`||e===`center`||e===`right`?e:`center`}isIconOnly(){if(!(this.getIcon()||this._getGeneratedIcon()||this._button?.querySelector(`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())return!1;if(e.nodeType===Node.ELEMENT_NODE){let t=e;if(t.tagName!==`MINT-ICON`&&t.tagName!==`MINT-SPINNER`&&!t.querySelector(`mint-spinner`)&&!t.hasAttribute(`slot`)&&t.className!==`mint-button-icon`&&!(t.classList.contains(`mint-button-spinner-wrap`)&&t.querySelector(`mint-spinner`))&&t.textContent?.trim())return!1}}return!0}getActiveStateClasses(){let e=`${this.getVariant()}-${this.getTone()}`;return{"solid-action":[`!bg-neutral-900`,`dark:!bg-neutral-700`,`hover:!bg-neutral-900`,`dark:hover:!bg-neutral-700`,`!border-t-neutral-900`,`!border-l-neutral-900`,`!border-r-neutral-600`,`!border-b-neutral-600`,`dark:!border-t-neutral-700`,`dark:!border-l-neutral-700`,`dark:!border-r-neutral-500`,`dark:!border-b-neutral-500`],"solid-neutral":[`!bg-gray-100`,`dark:!bg-mint-hover`,`hover:!bg-gray-100`,`dark:hover:!bg-mint-hover`,`!border-t-gray-400`,`!border-l-gray-400`,`!border-r-gray-200`,`!border-b-gray-200`,`dark:!border-t-gray-950`,`dark:!border-l-gray-950`,`dark:!border-r-mint-divider`,`dark:!border-b-mint-divider`],"solid-info":[`!bg-blue-900`,`dark:!bg-blue-700`,`hover:!bg-blue-900`,`dark:hover:!bg-blue-700`,`!border-t-blue-900`,`!border-l-blue-900`,`!border-r-blue-600`,`!border-b-blue-600`,`dark:!border-t-blue-700`,`dark:!border-l-blue-700`,`dark:!border-r-blue-500`,`dark:!border-b-blue-500`],"solid-warning":[`!bg-amber-900`,`dark:!bg-amber-700`,`hover:!bg-amber-900`,`dark:hover:!bg-amber-700`,`!border-t-amber-900`,`!border-l-amber-900`,`!border-r-amber-600`,`!border-b-amber-600`,`dark:!border-t-amber-700`,`dark:!border-l-amber-700`,`dark:!border-r-amber-500`,`dark:!border-b-amber-500`],"solid-danger":[`!bg-red-900`,`dark:!bg-red-700`,`hover:!bg-red-900`,`dark:hover:!bg-red-700`,`!border-t-red-900`,`!border-l-red-900`,`!border-r-red-600`,`!border-b-red-600`,`dark:!border-t-red-700`,`dark:!border-l-red-700`,`dark:!border-r-red-500`,`dark:!border-b-red-500`],"ghost-action":[`!bg-gray-100`,`!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`dark:!bg-mint-hover`,`hover:!bg-gray-100`,`dark:hover:!bg-mint-hover`,`hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`],"ghost-neutral":[`!bg-gray-50`,`!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`dark:!bg-mint-hover`,`!text-gray-900`,`dark:!text-white`,`hover:!bg-gray-50`,`dark:hover:!bg-mint-hover`,`hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`hover:!text-gray-900`,`dark:hover:!text-white`],"ghost-info":[`!bg-gray-100`,`!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`dark:!bg-mint-hover`,`hover:!bg-gray-100`,`dark:hover:!bg-mint-hover`,`hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`],"ghost-warning":[`!bg-gray-100`,`!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`dark:!bg-mint-hover`,`hover:!bg-gray-100`,`dark:hover:!bg-mint-hover`,`hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`],"ghost-danger":[`!bg-gray-100`,`!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`dark:!bg-mint-hover`,`hover:!bg-gray-100`,`dark:hover:!bg-mint-hover`,`hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`]}[e]||[]}_disconnectHostChildObserver(){this._hostChildObserver?.disconnect()}_connectHostChildObserver(){this.isConnected&&(this._hostChildObserver||=new MutationObserver(e=>{this._onLightDomMutation(e)}),this._hostChildObserver.disconnect(),this._hostChildObserver.observe(this,{childList:!0,subtree:!0,characterData:!0}))}_onLightDomMutation(e){if(this.isConnected){if(this._button&&!this._button.isConnected){this._button=null,this._scheduleRenderFromHostObserver();return}for(let t of e){let e=t.target;if(!(this._button&&(e===this._button||this._button.contains(e)))){this._scheduleRenderFromHostObserver();return}}}}_scheduleRenderFromHostObserver(){this._hostRenderFromObserverRaf===null&&(this._hostRenderFromObserverRaf=requestAnimationFrame(()=>{this._hostRenderFromObserverRaf=null,this.isConnected&&this.render()}))}getButtonClasses(){let e=[`mint-button-core`,`mint-button-${this.getVariant()}`,`mint-button-tone-${this.getTone()}`];return this.isIconOnly()&&e.push(`mint-button-icon-only`),this.isFullWidth()&&e.push(`mint-button-full-width`),e.join(` `)}render(){this._disconnectHostChildObserver(),this._button&&!this._button.isConnected&&(this._button=null);try{let e=this.isLoading(),t=this.isDisabled()||e,n=this.getType();if(!this._button){let e=this.firstElementChild;if(e instanceof HTMLButtonElement)this._button=e;else{for(this._button=document.createElement(`button`);this.firstChild;)this._button.appendChild(this.firstChild);this.appendChild(this._button)}this.setupEventListeners()}this._button.type=n,this._button.disabled=t,this._button.setAttribute(`aria-busy`,String(e));let r=this._button.querySelector(`mint-spinner`);if(e)if(r)r.setAttribute(`data-button-variant`,this.getVariant()),r.setAttribute(`data-button-tone`,this.getTone()),`render`in r&&typeof r.render==`function`&&r.render();else{let e=document.createElement(`span`);e.className=`mint-button-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=`1em`,t.style.height=`1em`,e.appendChild(t),this._button.insertBefore(e,this._button.firstChild)}else r&&r.parentElement?.remove();for(let e of Array.from(this.childNodes))e!==this._button&&this._button.appendChild(e);let i=this.getIcon(),a=this._getGeneratedIcon();i?(a||(a=document.createElement(`mint-icon`),a.setAttribute(`data-generated-icon`,`true`),a.className=`mint-button-icon`),a.setAttribute(`name`,i)):a&&a.tagName===`MINT-ICON`&&(a.remove(),a=null);let o=this.getIconPosition(),s=this._button.querySelector(`.mint-button-content`);if(s){s.className=this._getContentWrapperClass(s);let e=a&&a.tagName===`MINT-ICON`;if(a&&!a.parentElement){let t=this._button.querySelector(`mint-spinner`)?.parentElement;e||o===`left`?t?t.insertAdjacentElement(`afterend`,a):this._button.insertBefore(a,s):s.insertAdjacentElement(`afterend`,a)}else if(a&&(e||o===`left`)&&a.nextSibling!==s){a.remove();let e=this._button.querySelector(`mint-spinner`)?.parentElement;e?e.insertAdjacentElement(`afterend`,a):this._button.insertBefore(a,s)}else a&&!e&&o===`right`&&a.previousSibling!==s&&(a.remove(),s.insertAdjacentElement(`afterend`,a))}else{let e=[];for(let t=this._button.firstChild;t;t=t.nextSibling){if(t.nodeType!==Node.ELEMENT_NODE){e.push(t);continue}let n=t;n.tagName!==`MINT-SPINNER`&&!n.querySelector(`mint-spinner`)&&t!==a&&!n.hasAttribute(`slot`)&&!(n.classList.contains(`mint-button-spinner-wrap`)&&n.querySelector(`mint-spinner`))&&e.push(t)}if(e.length>0){s=document.createElement(`span`),s.className=this._getContentWrapperClass(s),e.forEach(e=>{s.appendChild(e)}),s.className=this._getContentWrapperClass(s);let t=this._button.querySelector(`mint-spinner`)?.parentElement;a&&o===`left`?t?(t.insertAdjacentElement(`afterend`,a),a.insertAdjacentElement(`afterend`,s)):(this._button.insertBefore(a,this._button.firstChild),a.insertAdjacentElement(`afterend`,s)):a&&o===`right`?t?(t.insertAdjacentElement(`afterend`,s),s.insertAdjacentElement(`afterend`,a)):(this._button.insertBefore(s,this._button.firstChild),s.insertAdjacentElement(`afterend`,a)):t?t.insertAdjacentElement(`afterend`,s):this._button.insertBefore(s,this._button.firstChild)}else if(a&&a.tagName===`MINT-ICON`&&!a.parentElement){let e=this._button.querySelector(`mint-spinner`)?.parentElement;e?e.insertAdjacentElement(`afterend`,a):this._button.insertBefore(a,this._button.firstChild)}}let c=this.isIconOnly();a&&(a.classList.contains(`mint-button-icon`)||a.classList.add(`mint-button-icon`),e?a.style.display=`none`:a.style.display=``,a.setAttribute(`data-position`,o),a.toggleAttribute(`data-icon-only`,c),c&&(a.tagName===`MINT-ICON`?(a.style.width=`1em`,a.style.height=`1em`,a.style.maxWidth=`1em`,a.style.maxHeight=`1em`,a.style.flexShrink=`0`):(a.style.maxWidth=`1em`,a.style.maxHeight=`1em`,a.style.flexShrink=`0`,a.tagName===`svg`&&(a.style.width=`1em`,a.style.height=`1em`))));let l=this._button.querySelector(`.mint-button-spinner-wrap`),u=a??this._button.querySelector(`:scope > .mint-button-icon, :scope > [slot="icon"]`);if(e&&l&&u){l.setAttribute(`data-position`,o);let e=window.getComputedStyle(u),t=e.width,n=e.height;if(t!==`auto`&&t!==`0px`){l.style.width=t,l.style.flexBasis=t;let e=l.querySelector(`mint-spinner`);e&&(e.style.width=t)}if(n!==`auto`&&n!==`0px`){l.style.height=n;let e=l.querySelector(`mint-spinner`);e&&(e.style.height=n)}u.parentElement===this._button&&u.insertAdjacentElement(`beforebegin`,l)}if(e){let e=this._button.querySelector(`mint-spinner`)?.parentElement;e&&(e.setAttribute(`data-position`,o),c?e.setAttribute(`data-icon-only`,`true`):e.removeAttribute(`data-icon-only`))}let d=this.getButtonClasses();this._button.className=d;let f=this.getAttribute(`aria-label`)?.trim();if(f)this._button.setAttribute(`aria-label`,f);else if(this.isIconOnly()){let e=this.getIcon().split(`-`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `);this._button.setAttribute(`aria-label`,e||`Action`)}else this._button.removeAttribute(`aria-label`);this.hasAttribute(`active`)?this._button.setAttribute(`aria-pressed`,String(this.isActive())):this._button.removeAttribute(`aria-pressed`),this.setAttribute(`data-variant`,this.getVariant()),this.setAttribute(`data-tone`,this.getTone()),this._button.setAttribute(`data-variant`,this.getVariant()),this._button.setAttribute(`data-align`,this.getAlignment()),this._button.toggleAttribute(`data-icon-only`,c),e?this._button.setAttribute(`data-loading`,`true`):this._button.removeAttribute(`data-loading`),this.isActive()?this._button.classList.add(`mint-button-active`):this._button.classList.remove(`mint-button-active`)}finally{this._connectHostChildObserver()}}setupEventListeners(){this._button&&!this._clickHandler&&(this._clickHandler=this.handleClick.bind(this),this._clickHandler&&this._button.addEventListener(`click`,this._clickHandler,!0),this._button.addEventListener(`mousedown`,this._handleMouseDown),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(`touchstart`,this._handleTouchStart),this._button.removeEventListener(`touchend`,this._handleTouchEnd),this._button.removeEventListener(`touchcancel`,this._handleTouchCancel))}_clearMousePressedState(){this._mousePressed&&(this._mousePressed=!1,document.removeEventListener(`mouseup`,this._handleMouseUp),window.removeEventListener(`blur`,this._handleMouseCancel)),this._button&&(this.isActive()||this._button.classList.remove(`mint-button-active`))}handleClick(e){if(this.isDisabled()||this.isLoading()){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();return}if(this.getType()===`submit`){this.dispatchEvent(new CustomEvent(`click`,{detail:{originalEvent:e},bubbles:!0,cancelable:!0,composed:!0}));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})}};customElements.get(`mint-button`)||a(`mint-button`,_n);var vn=class extends HTMLElement{static get observedAttributes(){return[`checked`,`disabled`,`label`,`icon`,`info`,`error`,`error-message`,`loading`]}_button=null;_checked=!1;_hasUserToggled=!1;constructor(){super()}connectedCallback(){this.classList.add(`mint-switch`),this._checked=this.getAttribute(`checked`)===`true`,this.render()}_getSwitchContainer(){let e=this.querySelector(`.mint-switch-container`);return e||(e=document.createElement(`div`),e.className=`mint-switch-container`,this.insertBefore(e,this.firstChild)),e}disconnectedCallback(){this.removeEventListeners()}isLoading(){return this.getAttribute(`loading`)===`true`}attributeChangedCallback(e,t,n){if(e===`checked`&&(this._checked=n===`true`),t!==n){if(e===`error`||e===`error-message`){this._renderErrorState(),this._syncSwitchAccessibility();return}if(e===`loading`){this.render();return}this.render()}}get checked(){try{return this._checked||!1}catch{return!1}}set checked(e){try{e?this.setAttribute(`checked`,`true`):this.setAttribute(`checked`,`false`),this._checked=!!e,this.render()}catch{}}isDisabled(){return this.getAttribute(`disabled`)===`true`}getLabel(){return this.getAttribute(`label`)||``}getInfo(){return this.getAttribute(`info`)||``}getIcon(){return this.getAttribute(`icon`)||``}hasIcon(){return!!this.getIcon()}hasError(){return this.getAttribute(`error`)===`true`}getErrorMessage(){return this.getAttribute(`error-message`)||``}getSwitchClasses(){return`mint-switch-control`}getThumbClasses(){return[`mint-switch-thumb`,this._checked?`mint-switch-thumb-checked`:``,this._hasUserToggled?`mint-switch-thumb-animated`:``].filter(Boolean).join(` `)}getIconClasses(){return`mint-switch-icon`}render(){let e=this.isLoading();this.setAttribute(`aria-busy`,String(e));let t=this.getSwitchClasses(),n=this.getThumbClasses(),r=this.getLabel(),i=this.getInfo(),a=this.getIcon(),o=this.getAttribute(`id`)||`mint-switch-${Math.random().toString(36).substr(2,9)}`;this.getAttribute(`id`)||this.setAttribute(`id`,o);let s=this._getSwitchContainer();this._button?this._button.parentElement!==s&&s.appendChild(this._button):(this._button=document.createElement(`button`),s.appendChild(this._button),this.setupEventListeners());let c=s.querySelector(`.mint-switch-label`);r?(c||(c=document.createElement(`label`),c.className=`mint-switch-label`,this._button&&this._button.parentElement===s?s.insertBefore(c,this._button.nextSibling):s.appendChild(c)),c.textContent=r,c.setAttribute(`for`,`${o}-control`),this.isDisabled()?c.classList.add(`mint-switch-disabled`):c.classList.remove(`mint-switch-disabled`)):c&&c.remove(),this._button.className=t,this._button.disabled=this.isDisabled(),this._button.id=`${o}-control`,this._button.setAttribute(`aria-checked`,String(this._checked)),this._button.setAttribute(`aria-label`,r||`Toggle switch`),this._button.setAttribute(`role`,`switch`),this._button.type=`button`;let l=this._button.querySelector(`span`);l||(l=document.createElement(`span`),this._button.appendChild(l)),l.className=n;let u=l.querySelector(`span`);if(a){let e=u;e||(e=document.createElement(`span`),e.className=this.getIconClasses(),l.appendChild(e));let t=e.querySelector(`mint-icon`);t||(t=document.createElement(`mint-icon`),e.appendChild(t)),t.setAttribute(`name`,a)}else u&&u.remove();let d=this.querySelector(`.mint-switch-info`);i?(d||(d=document.createElement(`span`),d.className=`mint-switch-info`,s&&s.parentElement===this?this.insertBefore(d,s.nextSibling):this.appendChild(d)),d.textContent=i,this.isDisabled()?d.classList.add(`mint-switch-disabled`):d.classList.remove(`mint-switch-disabled`)):d&&d.remove(),this._renderErrorState(),this._syncSwitchAccessibility(),this._renderSkeleton(e)}setupEventListeners(){this._button&&this._button.addEventListener(`click`,this.handleToggle.bind(this))}removeEventListeners(){this._button&&this._button.removeEventListener(`click`,this.handleToggle.bind(this))}handleToggle(e){if(!this.isDisabled()){this._hasUserToggled=!0,this.checked=!this._checked;let e=new Event(`input`,{bubbles:!0,cancelable:!0,composed:!0});this.dispatchEvent(e),this.dispatchEvent(new CustomEvent(`input`,{detail:{checked:this._checked},bubbles:!0,cancelable:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`change`,{detail:{checked:this._checked},bubbles:!0,cancelable:!0})),this.dispatchEvent(new CustomEvent(`toggle`,{detail:{checked:this._checked},bubbles:!0,cancelable:!0}))}}_renderSkeleton(e){let t=this._getSwitchContainer(),n=this.getLabel(),r=this.getInfo(),i=t.querySelector(`.mint-switch-skeleton-container`),a=this.querySelector(`.mint-switch-info-skeleton`);if(e){t.classList.add(`mint-switch-container-loading`),i||(i=document.createElement(`div`),i.className=`mint-switch-skeleton-container`,t.appendChild(i));let e=i.querySelector(`.mint-switch-skeleton-box`);if(e||(e=document.createElement(`div`),e.className=`mint-switch-skeleton-box`,i.appendChild(e)),n){let e=i.querySelector(`.mint-switch-skeleton-label`);e||(e=document.createElement(`div`),e.className=`mint-switch-skeleton-label`,i.appendChild(e))}else{let e=i.querySelector(`.mint-switch-skeleton-label`);e&&e.remove()}i.style.display=`flex`,this._button&&(this._button.style.visibility=`hidden`,this._button.style.pointerEvents=`none`);let o=t.querySelector(`.mint-switch-label`);if(o&&(o.style.visibility=`hidden`,o.style.pointerEvents=`none`),r){a||(a=document.createElement(`div`),a.className=`mint-switch-info-skeleton`,t&&t.parentElement===this?this.insertBefore(a,t.nextSibling):this.appendChild(a)),a.style.display=`block`;let e=this.querySelector(`.mint-switch-info`);e&&(e.style.display=`none`)}else a&&(a.style.display=`none`)}else{i&&(i.style.display=`none`),t.classList.remove(`mint-switch-container-loading`),a&&(a.style.display=`none`),this._button&&(this._button.style.visibility=`visible`,this._button.style.pointerEvents=`auto`);let e=t.querySelector(`.mint-switch-label`);e&&(e.style.visibility=`visible`,e.style.pointerEvents=`auto`);let n=this.querySelector(`.mint-switch-info`);n&&(n.style.display=``)}}_renderErrorState(){let e=this.hasError(),t=this.getErrorMessage(),n=this.querySelector(`.mint-switch-error`);e&&t?(n||(n=document.createElement(`div`),n.className=`mint-switch-error`,this.appendChild(n)),n.textContent=t):n&&n.remove(),this._button&&(this._button.className=this.getSwitchClasses()),this._syncSwitchAccessibility()}_syncSwitchAccessibility(){if(!this._button)return;let e=this.getAttribute(`id`)||`mint-switch-${Math.random().toString(36).slice(2,10)}`;this.getAttribute(`id`)||this.setAttribute(`id`,e),this._button.id=`${e}-control`,this._button.setAttribute(`aria-invalid`,String(this.hasError()));let t=(this.getAttribute(`aria-describedby`)||``).split(/\s+/).filter(Boolean),n=this.querySelector(`.mint-switch-info`),r=this.querySelector(`.mint-switch-error`);n&&(n.id=`${e}-info`,t.push(n.id)),r&&(r.id=`${e}-error`,t.push(r.id)),t.length?this._button.setAttribute(`aria-describedby`,Array.from(new Set(t)).join(` `)):this._button.removeAttribute(`aria-describedby`)}};customElements.get(`mint-switch`)||a(`mint-switch`,vn);var yn=class extends HTMLElement{static get observedAttributes(){return[`variant`,`size`,`bold`,`underline`,`strike`,`italic`,`display`,`inline`]}constructor(){super(),this._darkModeObserver=null}connectedCallback(){this.render()}attributeChangedCallback(e,t,n){t!==n&&this.render()}disconnectedCallback(){this._darkModeObserver&&=(this._darkModeObserver.disconnect(),null)}_observeDarkMode(){if(!this._darkModeObserver){if(this._darkModeObserver=new MutationObserver(()=>{this.render()}),!document.documentElement)return;this._darkModeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`,`data-mint-theme`]})}}getVariant(){return this.getAttribute(`variant`)||`default`}getSize(){return this.getAttribute(`size`)||`regular`}isBold(){return this.hasAttribute(`bold`)}isUnderline(){return this.hasAttribute(`underline`)}isStrike(){return this.hasAttribute(`strike`)}isItalic(){return this.hasAttribute(`italic`)}getDisplay(){return this.hasAttribute(`display`)?this.getAttribute(`display`):this.hasAttribute(`inline`)?`inline-block`:`block`}getTextClasses(){return this.className}render(){}};typeof customElements<`u`&&!customElements.get(`mint-text`)&&a(`mint-text`,yn);var bn=class extends HTMLElement{static get observedAttributes(){return[`direction`,`text-align`,`gap`,`align-content`]}connectedCallback(){this.classList.add(`mint-stack`),this.render()}attributeChangedCallback(e,t,n){t!==n&&this.render()}getDirection(){return this.getAttribute(`direction`)===`horizontal`?`horizontal`:`vertical`}getGap(){let e=Number.parseFloat(this.getAttribute(`gap`)||`3`);return Number.isFinite(e)?Math.min(12,Math.max(1,Math.round(e))):3}getTextAlign(){let e=this.getAttribute(`text-align`)||``;return[`left`,`center`,`right`,`justify`].includes(e)?e:``}getAlignContent(){let e=(this.getAttribute(`align-content`)||``).trim().toLowerCase();return e===`left`||e===`start`?`left`:e===`right`||e===`end`?`right`:e===`center`||e===`middle`?`center`:``}render(){let e=this.getDirection(),t=this.getAlignContent(),n=this.getTextAlign();this.classList.add(`mint-stack`),this.style.setProperty(`--mint-stack-direction`,e===`horizontal`?`row`:`column`),this.style.setProperty(`--mint-stack-gap`,`${this.getGap()*.25}rem`),this.style.setProperty(`--mint-stack-align-items`,e===`vertical`&&t?{left:`flex-start`,right:`flex-end`,center:`center`}[t]:`stretch`),this.style.setProperty(`--mint-stack-justify-content`,e===`horizontal`&&t?{left:`flex-start`,right:`flex-end`,center:`center`}[t]:`flex-start`),this.style.setProperty(`--mint-stack-text-align`,n||`initial`)}};typeof customElements<`u`&&!customElements.get(`mint-stack`)&&a(`mint-stack`,bn);var xn=class extends HTMLElement{static get observedAttributes(){return[`heading`,`flush`]}_headingElement=null;_contentObserver=null;constructor(){super()}connectedCallback(){this.render(),this._updateTableContentPadding(),this._contentObserver=new MutationObserver(()=>this._updateTableContentPadding()),this._contentObserver.observe(this,{childList:!0})}disconnectedCallback(){this._contentObserver?.disconnect(),this._contentObserver=null}attributeChangedCallback(e,t,n){t!==n&&this.render()}getHeading(){return this.getAttribute(`heading`)||``}_updateTableContentPadding(){let e=Array.from(this.children),t=e.some(e=>e.tagName===`MINT-RESOURCE-TABLE`),n=t||e.some(e=>e.tagName===`MINT-TABLE`);this.classList.toggle(`mint-card--resource-table`,t),this.toggleAttribute(`data-mint-card-table-content`,n)}render(){let e=this.getHeading();e?(this._headingElement||(this._headingElement=document.createElement(`mint-text`),this._headingElement.setAttribute(`size`,`sub-heading`),this._headingElement.setAttribute(`role`,`heading`),this._headingElement.setAttribute(`aria-level`,`2`),this.insertBefore(this._headingElement,this.firstChild)),this._headingElement.textContent=e):this._headingElement?.parentNode&&(this._headingElement.remove(),this._headingElement=null)}};typeof customElements<`u`&&!customElements.get(`mint-card`)&&a(`mint-card`,xn);var Sn=class extends HTMLElement{static get observedAttributes(){return[`href`,`target`]}constructor(){super(),this._link=null}connectedCallback(){this.render()}attributeChangedCallback(e,t,n){t!==n&&this.render()}getHref(){return this.getAttribute(`href`)||`#`}getTarget(){return this.getAttribute(`target`)||``}hasIcon(){return!!this.querySelector(`mint-icon`)||!!this._link?.querySelector(`mint-icon`)}render(){let e=this.getHref(),t=this.getTarget();if(!this._link){for(this._link=document.createElement(`a`);this.firstChild;)this._link.appendChild(this.firstChild);this.appendChild(this._link)}this._link.href=e,t?(this._link.target=t,t===`_blank`&&(this._link.rel=`noopener noreferrer`)):(this._link.removeAttribute(`target`),this._link.removeAttribute(`rel`));let n=[`mint-link-anchor`,this.hasIcon()?`mint-link-with-icon`:``];this._link.className=n.filter(Boolean).join(` `)}};typeof customElements<`u`&&!customElements.get(`mint-link`)&&a(`mint-link`,Sn),s({name:`arrow-left`,viewBox:`0 0 24 24`,path:`M19 12H5m7-7l-7 7 7 7`,strokeLinecap:`round`,strokeLinejoin:`round`});var Cn=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-button-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=`1em`,t.style.height=`1em`,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._button.querySelector(`.mint-button-spinner-wrap`);if(i&&(i.style.display=this.isLoading()?`none`:``,this.isLoading()&&s)){s.setAttribute(`data-position`,a);let e=window.getComputedStyle(i),t=e.width,n=e.height;if(t!==`auto`&&t!==`0px`){s.style.width=t,s.style.flexBasis=t;let e=s.querySelector(`mint-spinner`);e&&(e.style.width=t)}if(n!==`auto`&&n!==`0px`){s.style.height=n;let e=s.querySelector(`mint-spinner`);e&&(e.style.height=n)}i.parentElement===this._button&&i.insertAdjacentElement(`beforebegin`,s)}let c=this.isIconOnly();this.isLoading()&&s&&(s.setAttribute(`data-position`,a),c?s.setAttribute(`data-icon-only`,`true`):s.removeAttribute(`data-icon-only`)),i&&(i.classList.contains(`mint-button-icon`)||i.classList.add(`mint-button-icon`),i.classList.remove(`mint-icon-leading`,`mint-icon-trailing`),c?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 l=this.getButtonClasses();this._button.className=l}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`,Cn);var wn=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`,`solid`),this._button.setAttribute(`tone`,`neutral`),this._button.setAttribute(`icon`,`arrow-left`),this._button.setAttribute(`aria-label`,this.getAttribute(`aria-label`)||`Go back`),this._button.addEventListener(`click`,e=>this.handleClick(e)),this.appendChild(this._button))}};typeof customElements<`u`&&!customElements.get(`mint-back-button`)&&a(`mint-back-button`,wn);function B(e,t=`vertical`,n=`1.5rem`,r=`mask`){let i=null,a=null,o=0,s=0,c=null,l=null,u=null,d=0,f=0,p=0,m=t=>t===`top`?e.scrollTop>1:t===`bottom`?e.scrollTop+e.clientHeight<e.scrollHeight-1:t===`left`?e.scrollLeft>1:e.scrollLeft+e.clientWidth<e.scrollWidth-1,h=(t,n)=>{let r=Number.parseFloat(t);if(!Number.isFinite(r)||r<=0)return Math.min(24,n/2);let i=t.trim().replace(String(r),``).toLowerCase(),a=Number.parseFloat(getComputedStyle(document.documentElement).fontSize)||16,o=Number.parseFloat(getComputedStyle(e).fontSize)||a,s=i===`rem`?r*a:i===`em`?r*o:i===`vw`?r*window.innerWidth/100:i===`vh`?r*window.innerHeight/100:i===`%`?r*n/100:r;return Math.max(1,Math.min(s,n/2))},g=(t,r)=>{let i=e.getBoundingClientRect();if(!i.width||!i.height)return null;let a=getComputedStyle(e).getPropertyValue(`--mint-scroll-fade-size`).trim()||n,o=h(a,i.height),s=h(a,i.width),c=[];return r>=i.top&&r<=i.top+o&&m(`top`)&&c.push({edge:`top`,distance:r-i.top}),r<=i.bottom&&r>=i.bottom-o&&m(`bottom`)&&c.push({edge:`bottom`,distance:i.bottom-r}),t>=i.left&&t<=i.left+s&&m(`left`)&&c.push({edge:`left`,distance:t-i.left}),t<=i.right&&t>=i.right-s&&m(`right`)&&c.push({edge:`right`,distance:i.right-t}),c.sort((e,t)=>e.distance-t.distance),c[0]?.edge??null},_=t=>{if(!c)return;let r=e.getBoundingClientRect(),i=Math.min(10,Math.max(4,h(n,Math.min(r.width,r.height))/2)),a=t===`left`?r.left+i:t===`right`?r.right-i:r.left+r.width/2,o=t===`top`?r.top+i:t===`bottom`?r.bottom-i:r.top+r.height/2;c.style.left=`${a}px`,c.style.top=`${o}px`},v=()=>{s&&cancelAnimationFrame(s),s=0,u=null,delete e.dataset.mintScrollFadeHover,c&&(c.hidden=!0)},y=t=>{if(s=0,!l){v();return}let n=g(l.x,l.y);if(n!==u){b(n);return}if(!n)return;_(n);let r=Math.max(0,t-d),i=Math.min(50,Math.max(0,t-f));f=t;let a=Math.min(500,32+r*.14)*i/1e3+p,o=n===`top`||n===`bottom`?e.scrollTop:e.scrollLeft;n===`top`?e.scrollTop-=a:n===`bottom`?e.scrollTop+=a:n===`left`?e.scrollLeft-=a:e.scrollLeft+=a;let c=n===`top`||n===`bottom`?e.scrollTop:e.scrollLeft;if(p=(n===`top`||n===`left`?o-a:o+a)-c,o===c&&!m(n)){v();return}C(),s=requestAnimationFrame(y)};function b(t){if(s&&cancelAnimationFrame(s),s=0,u=t,p=0,!t){delete e.dataset.mintScrollFadeHover,c&&(c.hidden=!0);return}e.dataset.mintScrollFadeHover=t,c||(c=document.createElement(`span`),c.className=`mint-scroll-fade-hover-caret`,c.setAttribute(`aria-hidden`,`true`),document.body.append(c)),c.dataset.edge=t,c.textContent=``,c.hidden=!1,d=performance.now(),f=d,_(t),s=requestAnimationFrame(y)}let x=t=>{if(t.pointerType&&t.pointerType!==`mouse`)return;if(t.target instanceof Node&&!e.contains(t.target)){l=null,v();return}l={x:t.clientX,y:t.clientY};let n=g(t.clientX,t.clientY);n===u?n&&_(n):b(n)},S=()=>{l=null,v()},C=()=>{cancelAnimationFrame(o),o=requestAnimationFrame(()=>{let i=t===`vertical`||t===`both`,a=t===`horizontal`||t===`both`,o=i&&e.scrollTop>1,s=i&&e.scrollTop+e.clientHeight<e.scrollHeight-1,c=a&&e.scrollLeft>1,l=a&&e.scrollLeft+e.clientWidth<e.scrollWidth-1,u=getComputedStyle(e),d=Number.parseFloat(u.borderTopWidth)||0,f=Number.parseFloat(u.borderRightWidth)||0,p=Number.parseFloat(u.borderBottomWidth)||0,m=Number.parseFloat(u.borderLeftWidth)||0;e.dataset.mintScrollFadeTop=String(o),e.dataset.mintScrollFadeBottom=String(s),e.dataset.mintScrollFadeLeft=String(c),e.dataset.mintScrollFadeRight=String(l),e.style.setProperty(`--mint-scroll-fade-size`,n),e.style.setProperty(`--mint-scroll-fade-top-size`,o?n:`0px`),e.style.setProperty(`--mint-scroll-fade-bottom-size`,s?n:`0px`),e.style.setProperty(`--mint-scroll-fade-left-size`,c?n:`0px`),e.style.setProperty(`--mint-scroll-fade-right-size`,l?n:`0px`);let h=[];if(i){let e=[`#000 0`];o&&e.push(`transparent ${d}px`,`#000 calc(var(--mint-scroll-fade-top-size) + ${d}px)`),s?e.push(`#000 calc(100% - var(--mint-scroll-fade-bottom-size) - ${p}px)`,`transparent calc(100% - ${p}px)`,`#000 100%`):e.push(`#000 100%`),h.push(`linear-gradient(to bottom, ${e.join(`, `)})`)}if(a){let e=[`#000 0`];c&&e.push(`transparent ${m}px`,`#000 calc(var(--mint-scroll-fade-left-size) + ${m}px)`),l?e.push(`#000 calc(100% - var(--mint-scroll-fade-right-size) - ${f}px)`,`transparent calc(100% - ${f}px)`,`#000 100%`):e.push(`#000 100%`),h.push(`linear-gradient(to right, ${e.join(`, `)})`)}if(r===`overlay`)e.dataset.mintScrollFadeMode=`overlay`,e.style.maskImage=``,e.style.webkitMaskImage=``,e.style.maskClip=``,e.style.webkitMaskClip=``,e.style.removeProperty(`mask-composite`),e.style.removeProperty(`-webkit-mask-composite`);else{let t=o||s||c||l?h.join(`, `):`none`;e.style.maskImage=t,e.style.webkitMaskImage=t,e.style.maskClip=`border-box`,e.style.webkitMaskClip=`border`,e.dataset.mintScrollFadeMode=`mask`,h.length>1?(e.style.maskComposite=`intersect`,e.style.webkitMaskComposite=`source-in`):(e.style.removeProperty(`mask-composite`),e.style.removeProperty(`-webkit-mask-composite`))}})};return e.addEventListener(`scroll`,C,{passive:!0}),document.addEventListener(`pointermove`,x,{passive:!0,capture:!0}),document.addEventListener(`pointerleave`,S),window.addEventListener(`blur`,S),typeof ResizeObserver<`u`&&(i=new ResizeObserver(C),i.observe(e),e.firstElementChild&&i.observe(e.firstElementChild)),typeof MutationObserver<`u`&&(a=new MutationObserver(C),a.observe(e,{childList:!0,subtree:!0,characterData:!0})),C(),()=>{e.removeEventListener(`scroll`,C),document.removeEventListener(`pointermove`,x,!0),document.removeEventListener(`pointerleave`,S),window.removeEventListener(`blur`,S),i?.disconnect(),a?.disconnect(),cancelAnimationFrame(o);for(let t of[`mintScrollFadeTop`,`mintScrollFadeBottom`,`mintScrollFadeLeft`,`mintScrollFadeRight`])delete e.dataset[t];delete e.dataset.mintScrollFadeMode,delete e.dataset.mintScrollFadeHover,l=null,v(),c?.remove(),c=null,e.style.maskImage=``,e.style.webkitMaskImage=``,e.style.maskClip=``,e.style.webkitMaskClip=``,e.style.removeProperty(`--mint-scroll-fade-size`),e.style.removeProperty(`--mint-scroll-fade-top-size`),e.style.removeProperty(`--mint-scroll-fade-bottom-size`),e.style.removeProperty(`--mint-scroll-fade-left-size`),e.style.removeProperty(`--mint-scroll-fade-right-size`),e.style.removeProperty(`mask-composite`),e.style.removeProperty(`-webkit-mask-composite`)}}var Tn=class extends HTMLElement{constructor(...e){super(...e),this._disposeFade=null,this._target=null,this._contentObserver=null}static get observedAttributes(){return[`axis`,`fade-size`,`target`]}connectedCallback(){this._attachFade(),this._contentObserver=new MutationObserver(()=>this._attachFade()),this._contentObserver.observe(this,{childList:!0,subtree:!0})}disconnectedCallback(){this._contentObserver?.disconnect(),this._contentObserver=null,this._disposeFade?.(),this._disposeFade=null,this._target=null,this.removeAttribute(`data-wraps-scrollport`)}attributeChangedCallback(){this.isConnected&&this._attachFade()}_attachFade(){let e=this.getAttribute(`target`),t=null;if(e)try{t=this.querySelector(e)}catch{t=null}let n=t||Array.from(this.querySelectorAll(`*`)).find(e=>{let t=getComputedStyle(e);return/(auto|scroll)/.test(`${t.overflowY} ${t.overflowX}`)})||this;if(n===this._target)return;this._disposeFade?.(),this._target=n,this.toggleAttribute(`data-wraps-scrollport`,n!==this);let r=this.getAttribute(`axis`)||`vertical`;this._disposeFade=B(n,[`vertical`,`horizontal`,`both`].includes(r)?r:`vertical`,this.getAttribute(`fade-size`)||`1.5rem`)}};customElements.get(`mint-scroll-fade`)||a(`mint-scroll-fade`,Tn);var En=new Set([`up`,`down`,`left`,`right`]);function Dn(e){let t=e.getBoundingClientRect(),n=Math.max(0,t.top),r=Math.min(window.innerWidth,t.right),i=Math.min(window.innerHeight,t.bottom),a=Math.max(0,t.left);for(let t=e.parentElement;t&&t!==document.body;t=t.parentElement){let e=getComputedStyle(t),o=t.getBoundingClientRect();/(auto|scroll|hidden|clip)/.test(e.overflowY)&&(n=Math.max(n,o.top),i=Math.min(i,o.bottom)),/(auto|scroll|hidden|clip)/.test(e.overflowX)&&(a=Math.max(a,o.left),r=Math.min(r,o.right))}return i>n&&r>a}var On=class extends HTMLElement{static get observedAttributes(){return[`direction`,`open`,`trigger-id`,`trigger-toggle`,`trigger-align`,`align-selected`,`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,this._disposeScrollFade=null,this._selectPopoverPlaceholder=null}connectedCallback(){this.render(),this._disposeScrollFade?.();let e=this.classList.contains(`mint-select-popover`),t=this.classList.contains(`mint-editor-overflow-popover`),n=e?this.querySelector(`.mint-select-options`):null;this._disposeScrollFade=B(n||this,`vertical`,t?`1.5rem`:`3rem`,n?`mask`:`overlay`),this._setupTrigger()}disconnectedCallback(){this._removeTrigger(),this._removeOpenListeners(),this._disposeScrollFade?.(),this._disposeScrollFade=null,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 En.has(e)?e:`down`}getTriggerId(){return this.getAttribute(`trigger-id`)||``}_findTrigger(e){let t=this.getRootNode();return t instanceof ShadowRoot?t.querySelector(`#${CSS.escape(e)}`):document.getElementById(e)}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=this._findTrigger(e),!this._trigger){this._triggerLookupTimer=setTimeout(()=>{this.isConnected&&this.getTriggerId()===e&&!this._trigger&&this._setupTrigger()},40);return}this._syncLayerZIndex(),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))}}_getLayerZIndex(){let e=900,t=this._trigger||this.parentElement;for(;t&&t!==document.documentElement;){let n=Number.parseInt(getComputedStyle(t).zIndex,10);Number.isFinite(n)&&(e=Math.max(e,n)),t=t.parentElement}return Math.max(901,e+1)}_syncLayerZIndex(){this.style.zIndex=String(this._getLayerZIndex())}_portalSelectPopover(){if(!this.classList.contains(`mint-select-popover`)||this.parentElement===document.body)return;let e=this.parentNode;if(!e)return;let t=document.createComment(`mint-select-popover`);e.insertBefore(t,this),this._selectPopoverPlaceholder=t,document.body.appendChild(this),this._syncLayerZIndex()}_restoreSelectPopover(){if(!this._selectPopoverPlaceholder)return;let e=this._selectPopoverPlaceholder;this._selectPopoverPlaceholder=null,e.parentNode?e.parentNode.replaceChild(this,e):this.parentElement===document.body&&this.remove()}_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._alignSelectedOptionToTrigger())},this._scrollHandler=e=>{if(!this.isOpen())return;let t=e.target;if(!(t instanceof Node&&(t===this||this.contains(t)))){if(this.classList.contains(`mint-select-popover`)){!this._trigger||!Dn(this._trigger)?this.close():(this._position({allowViewportFlip:!1,clampToViewport:!1}),this._alignSelectedOptionToTrigger());return}this._position({allowViewportFlip:!1,clampToViewport:!1}),this._alignSelectedOptionToTrigger()}},typeof ResizeObserver<`u`&&this._trigger){this._resizeObserver=new ResizeObserver(()=>{this.isOpen()&&(this._position(),this._alignSelectedOptionToTrigger())}),this.classList.contains(`mint-select-popover`)||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)}}_getFixedPositionContext(){for(let e=this.parentElement;e&&e!==document.documentElement;e=e.parentElement){let t=getComputedStyle(e),n=`${t.contain} ${t.willChange}`;if(!(t.transform!==`none`||t.perspective!==`none`||t.filter!==`none`||t.backdropFilter!==`none`||[`layout`,`paint`,`strict`,`content`,`transform`,`perspective`,`filter`].some(e=>n.includes(e))))continue;let r=e.getBoundingClientRect(),i=r.width/(e.offsetWidth||r.width)||1,a=r.height/(e.offsetHeight||r.height)||1;return{scaleX:i,scaleY:a,originLeft:r.left+(parseFloat(t.borderLeftWidth)||0)*i,originTop:r.top+(parseFloat(t.borderTopWidth)||0)*a}}return{scaleX:1,scaleY:1,originLeft:0,originTop:0}}_position({allowViewportFlip:e=!0,clampToViewport:t=!0}={}){let n=this._findTrigger(this.getTriggerId());n&&n!==this._trigger&&this._setupTrigger();let r=n||this._trigger;if(!r)return;let i=r.getBoundingClientRect(),a=this._getFixedPositionContext(),o={width:this.offsetWidth*a.scaleX,height:this.offsetHeight*a.scaleY},s=this._distancePx(),c=s*a.scaleX,l=s*a.scaleY,u=e?this.getDirection():this.dataset.direction||this.getDirection(),d=0,f=0,p=this.getAttribute(`trigger-align`)||`center`;if(u===`down`||u===`up`){let t=i.bottom+l,n=i.top-o.height-l;e&&u===`down`&&t+o.height>innerHeight-12&&n>=12?u=`up`:e&&u===`up`&&n<12&&t+o.height<=innerHeight-12&&(u=`down`);let r=this.hasAttribute(`align-selected`)?this.querySelector(`[role="option"][aria-selected="true"]`):null;if(r){let e=r.closest(`[role="listbox"]`);if(e&&e.scrollHeight>e.clientHeight+1){let t=Math.max(0,e.scrollHeight-e.clientHeight),n=r.offsetTop-Math.max(0,(e.clientHeight-r.offsetHeight)/2);e.scrollTop=Math.max(0,Math.min(t,n))}}if(d=u===`down`?t:n,r&&this.classList.contains(`mint-select-popover`)){let e=this.getBoundingClientRect(),t=r.getBoundingClientRect().top-e.top;d=i.top-t}f=p===`start`?i.left:p===`end`?i.right-o.width:i.left+(i.width-o.width)/2}else{let t=i.right+c,n=i.left-o.width-c;e&&u===`right`&&t+o.width>innerWidth-12&&n>=12?u=`left`:e&&u===`left`&&n<12&&t+o.width<=innerWidth-12&&(u=`right`),f=u===`right`?t:n,d=p===`start`?i.top:p===`end`?i.bottom-o.height:i.top+(i.height-o.height)/2}let m=t&&!this.classList.contains(`mint-select-popover`)?Math.max(12,Math.min(d,innerHeight-o.height-12)):d,h=t?Math.max(12,Math.min(f,innerWidth-o.width-12)):f,g=(m-a.originTop)/a.scaleY,_=(h-a.originLeft)/a.scaleX;this.style.top=`${g}px`,this.style.left=`${_}px`,this.dataset.direction=u,this.style.setProperty(`--mint-popover-origin-x`,`${(i.left+i.width/2-h)/a.scaleX}px`),this.style.setProperty(`--mint-popover-origin-y`,`${(i.top+i.height/2-m)/a.scaleY}px`)}_alignSelectedOptionToTrigger(){if(!this.classList.contains(`mint-select-popover`)||!this._trigger)return;let e=this.querySelector(`[role="option"][aria-selected="true"]`);if(!e)return;let t=this._trigger.getBoundingClientRect(),n=e.closest(`[role="listbox"]`),r=window.visualViewport,i=r?.offsetTop??0,a=r?.height??window.innerHeight,o=Math.max(0,a-24);this.style.maxHeight=`${o}px`,this.style.overflowY=`auto`;let s=this.getBoundingClientRect(),c=e.getBoundingClientRect(),l=i+12,u=Math.max(l,i+a-12-s.height),d=Math.max(l,Math.min(t.top-(c.top-s.top),u));if(n){let r=t.top-d,o=c.top-s.top;n.scrollTop+=o-r,s=this.getBoundingClientRect(),c=e.getBoundingClientRect();let u=t.top-(c.top-s.top),f=Math.max(l,i+a-12-s.height);d=Math.max(l,Math.min(u,f))}this.style.top=`${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();e?this._portalSelectPopover():this._restoreSelectPopover(),this._syncLayerZIndex();let 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(),this._alignSelectedOptionToTrigger(),e&&!this.classList.contains(`mint-select-popover`)&&this._animateBlob(!0),requestAnimationFrame(()=>requestAnimationFrame(()=>{this.isOpen()&&(this._position(),this._alignSelectedOptionToTrigger())}))}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`,On);var kn=class extends HTMLElement{static get observedAttributes(){return[`heading`,`fallback-href`,`show-back-button`,`containered`]}constructor(){super(),this._actionsResizeObserver=null,this._actionsMutationObserver=null,this._actionsFrame=null,this._groupingActions=!1,this._actionFullWidthOriginal=new WeakMap,this._actionAlignmentOriginal=new WeakMap,this._autoGroupedActions=new WeakSet,this._explicitOverflowActions=new WeakSet,this._root=this.attachShadow({mode:`open`}),this._root.innerHTML=`
|
|
114
114
|
<style>
|
|
115
115
|
/* The built-in back button lives inside this component's shadow root,
|
|
116
116
|
so document-level button.css cannot reach its light-DOM button. */
|
|
@@ -219,7 +219,7 @@ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{val
|
|
|
219
219
|
</header>
|
|
220
220
|
<main part="body" class="mint-page-body"><slot></slot></main>
|
|
221
221
|
</div>
|
|
222
|
-
`,this._headingElement=this._root.querySelector(`.mint-page-heading`),this._headingFallbackElement=this._root.querySelector(`.mint-page-heading-fallback`),this._backButton=this._root.querySelector(`.mint-page-back`),this._actionsSlot=this._root.querySelector(`slot[name="actions"]`),this._overflowActionsSlot=this._root.querySelector(`slot[name="overflow-actions"]`),this._actionsWrapper=this._root.querySelector(`.mint-page-actions`),this._actionsTrigger=this._root.querySelector(`#mint-page-actions-trigger`),this._actionsPopover=this._root.querySelector(`#mint-page-actions-popover`),this._actionsSlot.addEventListener(`slotchange`,()=>this._scheduleActionGrouping()),this._overflowActionsSlot.addEventListener(`slotchange`,()=>this._scheduleActionGrouping()),this._backButton.addEventListener(`click`,e=>this._handleBack(e),!0)}connectedCallback(){this.render(),this._actionsResizeObserver=new ResizeObserver(()=>this._scheduleActionGrouping()),this._actionsResizeObserver.observe(this._root.querySelector(`.mint-page-header`)),this._actionsMutationObserver=new MutationObserver(e=>{e.some(e=>e.type===`childList`||e.attributeName===`importance`||e.attributeName===`always-grouped`||e.attributeName===`always-visible`||e.attributeName===`slot`&&![`actions`,`overflow-actions`].includes(e.target.getAttribute(`slot`)||``))&&this._scheduleActionGrouping()}),this._actionsMutationObserver.observe(this,{childList:!0,attributes:!0,attributeFilter:[`slot`,`importance`,`always-grouped`,`always-visible`]}),this._scheduleActionGrouping()}disconnectedCallback(){this._actionsResizeObserver?.disconnect(),this._actionsMutationObserver?.disconnect(),this._actionsFrame!==null&&cancelAnimationFrame(this._actionsFrame),this._actionsFrame=null}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._headingFallbackElement.textContent=this.getHeading(),this._backButton.setAttribute(`fallback-href`,this.getFallbackHref()),this._backButton.hidden=!this.shouldShowBackButton()}_scheduleActionGrouping(){this._actionsFrame!==null||!this.isConnected||(this._actionsFrame=requestAnimationFrame(()=>{this._actionsFrame=null,this._groupActions()}))}_groupActions(){if(this._groupingActions)return;this._groupingActions=!0;let e=Array.from(this.children).filter(e=>e instanceof HTMLElement&&(e.getAttribute(`slot`)===`actions`||e.getAttribute(`slot`)===`overflow-actions`));if(this._actionsWrapper.hidden=e.length===0,!e.length){this._actionsTrigger.hidden=!0,this._actionsPopover.style.display=`none`,this._actionsWrapper.hidden=!0,this._groupingActions=!1;return}e.forEach(e=>{e.getAttribute(`slot`)===`overflow-actions`&&!this._autoGroupedActions.has(e)&&this._explicitOverflowActions.add(e)});let t=e.filter(e=>e.hasAttribute(`always-visible`)),n=e.filter(e=>!t.includes(e)&&(e.hasAttribute(`always-grouped`)||this._explicitOverflowActions.has(e))),r=e.filter(e=>!n.includes(e)&&!t.includes(e));if(e.length===1&&n.length===0){this._setActionSlot(e[0],`actions`),this._syncOverflowButtonWidths([]),this._actionsTrigger.hidden=!0,this._actionsPopover.style.display=`none`,this._groupingActions=!1;return}r.forEach(e=>this._setActionSlot(e,`actions`)),n.forEach(e=>this._setActionSlot(e,`overflow-actions`)),this._syncOverflowButtonWidths([]),this._actionsPopover.style.display=``,this._actionsTrigger.hidden=!0;let i=this._root.querySelector(`.mint-page-actions-primary`),a=this._root.querySelector(`.mint-page-header`),o=this._root.querySelector(`.mint-page-heading`);this._actionsResizeObserver?.observe(i),e.forEach(e=>this._actionsResizeObserver?.observe(e));let s=a.clientWidth<=767,c=e.filter(e=>!n.includes(e)).reduce((e,t,n)=>e+t.getBoundingClientRect().width+(n?8:0),0),l=this._backButton.hidden?0:this._backButton.getBoundingClientRect().width+16,u=Math.min(a.clientWidth,o.scrollWidth+l),d=Math.max(0,a.clientWidth-u-16),f=[...n],p=e=>{let t=e.getAttribute(`importance`),n=e.querySelector(`[importance]`)?.getAttribute(`importance`),r=Number(t??n??1);return Number.isFinite(r)&&r>0?r:1};!s&&c>d&&(d=Math.max(0,d-48));let m=c;for(;s?r.length>f.length-n.length:m>d&&f.length<e.length;){let t=r.filter(e=>!f.includes(e));t.sort((t,n)=>p(n)-p(t)||e.indexOf(n)-e.indexOf(t));let n=t[0];if(!n)break;f.push(n),m-=n.getBoundingClientRect().width+(f.length<e.length?8:0)}let h=new Set(f);e.forEach(e=>this._setActionSlot(e,h.has(e)?`overflow-actions`:`actions`)),this._actionsTrigger.hidden=f.length===0,this._actionsPopover.style.display=f.length===0?`none`:``,this._syncOverflowButtonWidths(f),this._actionsResizeObserver?.observe(this._actionsTrigger),this._groupingActions=!1}_setActionSlot(e,t){t===`overflow-actions`?this._autoGroupedActions.add(e):this._autoGroupedActions.delete(e),e.getAttribute(`slot`)!==t&&e.setAttribute(`slot`,t)}_syncOverflowButtonWidths(e){let t=new Set;e.forEach(e=>{e.matches(`mint-button`)&&t.add(e),e.querySelectorAll(`mint-button`).forEach(e=>t.add(e))}),Array.from(this.querySelectorAll(`mint-button[slot="actions"], mint-button[slot="overflow-actions"], [slot="actions"] mint-button, [slot="overflow-actions"] mint-button`)).forEach(e=>{if(t.has(e))this._actionFullWidthOriginal.has(e)||this._actionFullWidthOriginal.set(e,e.getAttribute(`full-width`)),e.setAttribute(`full-width`,`true`);else if(this._actionFullWidthOriginal.has(e)){let t=this._actionFullWidthOriginal.get(e);t===null?e.removeAttribute(`full-width`):t!==void 0&&e.setAttribute(`full-width`,t),this._actionFullWidthOriginal.delete(e)}})}_handleBack(e){e.preventDefault(),e.stopPropagation();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`,kn);var An=class extends HTMLElement{constructor(){super()}};typeof customElements<`u`&&!customElements.get(`mint-grid`)&&a(`mint-grid`,An);var V=new Set,H=null;function jn(e){if(!V.has(e)){if(V.size===0){let e=document.documentElement;H={scrollY:window.scrollY||window.pageYOffset||0,rootOverflow:e.style.overflow,rootOverscrollBehavior:e.style.overscrollBehavior},e.style.overflow=`hidden`,e.style.overscrollBehavior=`none`}V.add(e)}}function Mn(e){if(!V.delete(e)||V.size>0||!H)return;let t=H;H=null;let n=document.documentElement;n.style.overflow=t.rootOverflow,n.style.overscrollBehavior=t.rootOverscrollBehavior,window.scrollTo({left:0,top:t.scrollY,behavior:`instant`})}var Nn=class extends HTMLElement{static get observedAttributes(){return[`id`,`heading`,`open`,`size`]}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(){Mn(this),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`)||``}getSize(){let e=this.getAttribute(`size`);return e===`small`||e===`large`?e:`default`}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(),r=this.getSize();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,jn(this),this._animateEnter())}else this._renderedOpen&&(this._renderedOpen=!1,this._animateExit());let i=this._modal.querySelector(`.modal-content`);i||(i=document.createElement(`div`),i.className=`modal-content`,this._modal.appendChild(i)),i.classList.remove(`modal-content--small`,`modal-content--large`),r!==`default`&&i.classList.add(`modal-content--${r}`),this._header||(this._header=document.createElement(`div`),this._header.className=`mint-modal-header`,i.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 a=this._headingSlot.querySelector(`mint-text`);t?(a||(a=document.createElement(`mint-text`),a.setAttribute(`size`,`sub-heading`),a.setAttribute(`bold`,``),this._headingSlot.appendChild(a)),a.textContent=t):a&&a.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.classList.add(`mint-modal-close-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`),i.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)});let o=Array.from(this.children).filter(e=>e!==this._overlay&&e!==this._modal&&e!==this._actionsSlot&&e.getAttribute(`slot`)===`actions`),s=this._actionsSlot?.querySelector(`mint-stack`),c=!!s&&s.children.length>0;if(o.length||c){this._actionsSlot||(this._actionsSlot=document.createElement(`div`),this._actionsSlot.className=`p-4 border-t border-gray-200 dark:border-mint-divider`,this._actionsSlot.setAttribute(`slot`,`actions`),i.appendChild(this._actionsSlot));let e=this._actionsSlot.querySelector(`mint-stack`);e||(e=document.createElement(`mint-stack`),e.setAttribute(`direction`,`horizontal`),e.setAttribute(`align-content`,`right`),e.className=`mint-actions-stack`,this._actionsSlot.appendChild(e)),o.forEach(t=>{Array.from(t.children).forEach(t=>e.appendChild(t)),t.remove()})}else this._actionsSlot&&=(this._actionsSlot.remove(),null);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`,e.getBoundingClientRect(),requestAnimationFrame(()=>{this.isOpen()&&(e.style.transition=`opacity 200ms ease-out`,e.style.opacity=`1`,this._backdropTimer=window.setTimeout(()=>{e.style.transition=``,e.style.opacity=``,e.style.transform=``,this._backdropTimer=null},220))}))}_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}_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`),Mn(this);return}this._exitTimer&&clearTimeout(this._exitTimer),this.classList.add(`mint-modal-closing`),e.style.transition=`opacity 200ms ease-in`,e.style.opacity=`0`,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.transition=``,Mn(this))},200)}};typeof customElements<`u`&&!customElements.get(`mint-modal`)&&a(`mint-modal`,Nn),s({name:`check`,viewBox:`0 0 24 24`,path:`M5 13l4 4L19 7`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3.2`});var Pn=class extends HTMLElement{static get observedAttributes(){return[`checked`,`indeterminate`,`disabled`,`label`,`info`,`id`,`name`,`value`,`loading`]}constructor(){super(),this._checkbox=null,this._checked=!1,this._indeterminate=!1,this._clickHandler=null}connectedCallback(){let e=this.getAttribute(`checked`);this._checked=e!==null&&e!==`false`,this._indeterminate=this.hasAttribute(`indeterminate`)&&this.getAttribute(`indeterminate`)!==`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)),e===`indeterminate`&&(this._indeterminate=n!==null&&n!==`false`,this._checkbox&&(this._checkbox.indeterminate=this._indeterminate)),t!==n&&(this.render(),e===`checked`&&this._checkbox&&this.updateVisualState(),e===`indeterminate`&&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()}get indeterminate(){return this._indeterminate}set indeterminate(e){this._indeterminate=!!e,this._indeterminate?this.setAttribute(`indeterminate`,`true`):this.removeAttribute(`indeterminate`),this._checkbox&&(this._checkbox.indeterminate=this._indeterminate),this.updateVisualState()}isDisabled(){return this.hasAttribute(`disabled`)||this.getAttribute(`loading`)===`true`}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.getAttribute(`loading`)===`true`;this.toggleAttribute(`aria-busy`,e);let t=this.getLabel(),n=this.getInfo(),r=this.isDisabled(),i=this.querySelector(`.mint-checkbox-wrapper`);i||(i=document.createElement(`div`),i.className=`mint-checkbox-wrapper`,this.insertBefore(i,this.firstChild)),this._checkbox?this._checkbox.parentElement!==i&&i.appendChild(this._checkbox):(this._checkbox=document.createElement(`input`),this._checkbox.type=`checkbox`,i.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.indeterminate=this._indeterminate,this._checkbox.disabled=r,this._changeHandler||this.setupEventListeners();let a=this.getId();a?this._checkbox.id=a:this._checkbox.removeAttribute(`id`);let o=this.getName();o?this._checkbox.name=o:this._checkbox.removeAttribute(`name`);let s=this.getValue();s?this._checkbox.value=s:this._checkbox.removeAttribute(`value`),t?this._checkbox.setAttribute(`aria-label`,t):this._checkbox.removeAttribute(`aria-label`),i.className=`mint-checkbox-wrapper ${this.getCheckboxClasses()}`,i.style.pointerEvents=`none`,this._checkbox.style.pointerEvents=`auto`;let c=i.querySelector(`mint-icon`);c||(c=document.createElement(`mint-icon`),c.setAttribute(`name`,`check`),c.className=`mint-checkbox-check`,c.style.position=`absolute`,c.style.inset=`auto`,c.style.top=`50%`,c.style.left=`50%`,c.style.width=`0.875rem`,c.style.height=`0.875rem`,c.style.margin=`0`,c.style.transition=`opacity 200ms ease-out, transform 200ms ease-out`,c.style.zIndex=`1`,i.appendChild(c)),this.updateVisualState();let l=this.querySelector(`.mint-checkbox-label-container`);if(t||n){l||(l=document.createElement(`div`),l.className=`mint-checkbox-label-container`,this.appendChild(l));let e=l.querySelector(`.mint-checkbox-label`);t?(e||(e=document.createElement(`span`),e.className=`mint-checkbox-label`,l.insertBefore(e,l.firstChild)),e.textContent=t,r?e.style.opacity=`0.5`:e.style.opacity=``):e&&e.remove();let i=l.querySelector(`.mint-checkbox-info`);if(n?(i||(i=document.createElement(`span`),i.className=`mint-checkbox-info`,l.appendChild(i)),i.textContent=n,r?i.style.opacity=`0.5`:i.style.opacity=``):i&&i.remove(),r)l.style.cursor=`default`,l._clickHandler&&(l.removeEventListener(`click`,l._clickHandler),l._clickHandler=null);else{l.style.cursor=`pointer`;let e=l._clickHandler;e&&l.removeEventListener(`click`,e),l._clickHandler=e=>{this._checkbox&&(e.target===this._checkbox||this._checkbox.contains(e.target)||e.composedPath().includes(this._checkbox))||this.toggle()},l.addEventListener(`click`,l._clickHandler)}}else l&&l.remove();let u=this.querySelector(`:scope > .mint-checkbox-loading-skeleton`);if(e){if(!u){u=document.createElement(`div`),u.className=`mint-checkbox-loading-skeleton`,u.setAttribute(`aria-hidden`,`true`),Object.assign(u.style,{position:`absolute`,inset:`0`,display:`flex`,alignItems:`center`,gap:`0.5rem`,pointerEvents:`none`,zIndex:`20`});let e=document.createElement(`span`);if(Object.assign(e.style,{display:`block`,width:`1.25rem`,height:`1.25rem`,flex:`none`,borderRadius:`0.25rem`,background:`var(--mint-color-surface-control, #e8eee9)`,animation:`mint-checkbox-skeleton-pulse 1.4s ease-in-out infinite`}),u.appendChild(e),t){let e=document.createElement(`span`);Object.assign(e.style,{display:`block`,width:`6rem`,height:`1rem`,borderRadius:`0.35rem`,background:`var(--mint-color-surface-control, #e8eee9)`,animation:`mint-checkbox-skeleton-pulse 1.4s ease-in-out infinite`}),u.appendChild(e)}this.appendChild(u)}this.style.position=`relative`,u.style.display=`flex`,i.style.visibility=`hidden`,l&&(l.style.visibility=`hidden`)}else u&&(u.style.display=`none`),i.style.visibility=``,l&&(l.style.visibility=``)}setupEventListeners(){this.removeEventListeners(),this._checkbox&&(this._changeHandler=e=>{e.stopPropagation(),this._checked=this._checkbox.checked,this._indeterminate=!1,this._checkbox.indeterminate=!1,this.removeAttribute(`indeterminate`),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&&!this._indeterminate?`1`:`0`,t.style.transform=this._checked&&!this._indeterminate?`translate(-50%, -50%)`:`translate(-50%, -50%) scale(0.8)`),e&&(e.className=`mint-checkbox-wrapper ${this.getCheckboxClasses()}`,e.toggleAttribute(`data-indeterminate`,this._indeterminate),e.classList.contains(`mint-checkbox-active`)||(e.style.backgroundColor=``,e.style.boxShadow=``))}toggle(){if(this._checkbox&&!this.isDisabled()){this._checkbox.checked=!this._checked,this._indeterminate=!1,this._checkbox.indeterminate=!1,this.removeAttribute(`indeterminate`),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`,Pn);var Fn=class extends HTMLElement{static get observedAttributes(){return[`checked`,`disabled`,`label`,`info`,`id`,`name`,`value`,`required`,`loading`]}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`)||this.getAttribute(`loading`)===`true`}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(){let e=this.getAttribute(`loading`)===`true`;this.toggleAttribute(`aria-busy`,e),this.classList.add(`mint-choice-group`),this.setAttribute(`role`,`radiogroup`);let t=this.getAttribute(`label`)||``,n=this.querySelector(`:scope > .mint-choice-group-label`);t&&!n&&(n=document.createElement(`div`),n.className=`mint-choice-group-label`,this.insertBefore(n,this.firstChild)),n&&(t?n.textContent=t:n.remove());let r=this.querySelector(`:scope > .mint-choice-options`);r||(r=document.createElement(`div`),r.className=`mint-choice-options`,n?.parentElement===this?this.insertBefore(r,n.nextSibling):this.insertBefore(r,this.firstChild)),Array.from(this.children).filter(e=>e.tagName===`MINT-CHOICE-OPTION`&&e.parentElement!==r).forEach(e=>r.appendChild(e)),this.querySelectorAll(`mint-choice-option`).forEach(t=>{t.toggleAttribute(`loading`,e),t.render()});let i=this.getAttribute(`value`);i&&this.setValue(i);let a=r.querySelector(`:scope > .mint-choice-loading-skeleton`);if(e){r.style.position=`relative`,a||(a=document.createElement(`div`),a.className=`mint-choice-loading-skeleton`,a.setAttribute(`aria-hidden`,`true`),Object.assign(a.style,{position:`absolute`,inset:`0`,display:`flex`,flexDirection:`column`,pointerEvents:`none`,zIndex:`20`}),r.appendChild(a)),a.style.gap=r.querySelector(`:scope > mint-choice-option[info]`)?`0.75rem`:`0.55rem`;let e=r.querySelectorAll(`:scope > mint-choice-option`).length,t=Array.from(a.children);for(;t.length>e;)t.pop()?.remove();for(;t.length<e;){let e=t.length,n=document.createElement(`div`);Object.assign(n.style,{display:`flex`,alignItems:`center`,gap:`0.55rem`,minHeight:`1.25rem`,flex:`none`});let r=document.createElement(`span`);Object.assign(r.style,{display:`block`,width:`1.1rem`,height:`1.1rem`,flex:`none`,borderRadius:`50%`,background:`var(--mint-color-surface-control, #e8eee9)`,animation:`mint-choice-skeleton-pulse 1.4s ease-in-out infinite`});let i=document.createElement(`span`);Object.assign(i.style,{display:`block`,width:`${e%2?`5rem`:`6rem`}`,height:`1rem`,borderRadius:`0.35rem`,background:`var(--mint-color-surface-control, #e8eee9)`,animation:`mint-choice-skeleton-pulse 1.4s ease-in-out infinite`}),n.append(r,i),a.appendChild(n),t.push(n)}a.style.display=`flex`,r.querySelectorAll(`:scope > mint-choice-option`).forEach(e=>{e.style.visibility=`hidden`})}else a&&(a.style.display=`none`),r.style.position=``,r.querySelectorAll(`:scope > mint-choice-option`).forEach(e=>{e.style.visibility=``})}_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)}}},In=class extends HTMLElement{static get observedAttributes(){return[`value`,`checked`,`disabled`,`loading`]}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`)||this.hasAttribute(`loading`)||e?.hasAttribute(`disabled`)||e?.hasAttribute(`loading`)||!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`,Fn),typeof customElements<`u`&&!customElements.get(`mint-choice-option`)&&a(`mint-choice-option`,In);var Ln=0,Rn=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=++Ln,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`,Rn),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 zn=class extends HTMLElement{static get observedAttributes(){return[`heading`,`dismissible`,`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 dismissible(){return this.isDismissible()}set dismissible(e){this.setAttribute(`dismissible`,String(!!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`}isDismissible(){return this.getAttribute(`dismissible`)===`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.isDismissible(),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`,zn);var Bn=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`,Bn);var Vn=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`,Vn);var Hn=Bn,Un=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;">
|
|
222
|
+
`,this._headingElement=this._root.querySelector(`.mint-page-heading`),this._headingFallbackElement=this._root.querySelector(`.mint-page-heading-fallback`),this._backButton=this._root.querySelector(`.mint-page-back`),this._actionsSlot=this._root.querySelector(`slot[name="actions"]`),this._overflowActionsSlot=this._root.querySelector(`slot[name="overflow-actions"]`),this._actionsWrapper=this._root.querySelector(`.mint-page-actions`),this._actionsTrigger=this._root.querySelector(`#mint-page-actions-trigger`),this._actionsPopover=this._root.querySelector(`#mint-page-actions-popover`),this._actionsSlot.addEventListener(`slotchange`,()=>this._scheduleActionGrouping()),this._overflowActionsSlot.addEventListener(`slotchange`,()=>this._scheduleActionGrouping()),this._backButton.addEventListener(`click`,e=>this._handleBack(e),!0)}connectedCallback(){this.render(),this._actionsResizeObserver=new ResizeObserver(()=>this._scheduleActionGrouping()),this._actionsResizeObserver.observe(this._root.querySelector(`.mint-page-header`)),this._actionsMutationObserver=new MutationObserver(e=>{e.some(e=>e.type===`childList`||e.attributeName===`importance`||e.attributeName===`always-grouped`||e.attributeName===`always-visible`||e.attributeName===`slot`&&![`actions`,`overflow-actions`].includes(e.target.getAttribute(`slot`)||``))&&this._scheduleActionGrouping()}),this._actionsMutationObserver.observe(this,{childList:!0,attributes:!0,attributeFilter:[`slot`,`importance`,`always-grouped`,`always-visible`]}),this._scheduleActionGrouping()}disconnectedCallback(){this._actionsResizeObserver?.disconnect(),this._actionsMutationObserver?.disconnect(),this._actionsFrame!==null&&cancelAnimationFrame(this._actionsFrame),this._actionsFrame=null}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._headingFallbackElement.textContent=this.getHeading(),this._backButton.setAttribute(`fallback-href`,this.getFallbackHref()),this._backButton.hidden=!this.shouldShowBackButton()}_scheduleActionGrouping(){this._actionsFrame!==null||!this.isConnected||(this._actionsFrame=requestAnimationFrame(()=>{this._actionsFrame=null,this._groupActions()}))}_groupActions(){if(this._groupingActions)return;this._groupingActions=!0;let e=Array.from(this.children).filter(e=>e instanceof HTMLElement&&(e.getAttribute(`slot`)===`actions`||e.getAttribute(`slot`)===`overflow-actions`));if(this._actionsWrapper.hidden=e.length===0,!e.length){this._actionsTrigger.hidden=!0,this._actionsPopover.style.display=`none`,this._actionsWrapper.hidden=!0,this._groupingActions=!1;return}e.forEach(e=>{e.getAttribute(`slot`)===`overflow-actions`&&!this._autoGroupedActions.has(e)&&this._explicitOverflowActions.add(e)});let t=e.filter(e=>e.hasAttribute(`always-visible`)),n=e.filter(e=>!t.includes(e)&&(e.hasAttribute(`always-grouped`)||this._explicitOverflowActions.has(e))),r=e.filter(e=>!n.includes(e)&&!t.includes(e));if(e.length===1&&n.length===0){this._setActionSlot(e[0],`actions`),this._syncOverflowButtonWidths([]),this._actionsTrigger.hidden=!0,this._actionsPopover.style.display=`none`,this._groupingActions=!1;return}r.forEach(e=>this._setActionSlot(e,`actions`)),n.forEach(e=>this._setActionSlot(e,`overflow-actions`)),this._syncOverflowButtonWidths([]),this._actionsPopover.style.display=``,this._actionsTrigger.hidden=!0;let i=this._root.querySelector(`.mint-page-actions-primary`),a=this._root.querySelector(`.mint-page-header`),o=this._root.querySelector(`.mint-page-heading`);this._actionsResizeObserver?.observe(i),e.forEach(e=>this._actionsResizeObserver?.observe(e));let s=a.clientWidth<=767,c=e.filter(e=>!n.includes(e)).reduce((e,t,n)=>e+t.getBoundingClientRect().width+(n?8:0),0),l=this._backButton.hidden?0:this._backButton.getBoundingClientRect().width+16,u=Math.min(a.clientWidth,o.scrollWidth+l),d=Math.max(0,a.clientWidth-u-16),f=[...n],p=e=>{let t=e.getAttribute(`importance`),n=e.querySelector(`[importance]`)?.getAttribute(`importance`),r=Number(t??n??1);return Number.isFinite(r)&&r>0?r:1};!s&&c>d&&(d=Math.max(0,d-48));let m=c;for(;s?r.length>f.length-n.length:m>d&&f.length<e.length;){let t=r.filter(e=>!f.includes(e));t.sort((t,n)=>p(n)-p(t)||e.indexOf(n)-e.indexOf(t));let n=t[0];if(!n)break;f.push(n),m-=n.getBoundingClientRect().width+(f.length<e.length?8:0)}let h=new Set(f);e.forEach(e=>this._setActionSlot(e,h.has(e)?`overflow-actions`:`actions`)),this._actionsTrigger.hidden=f.length===0,this._actionsPopover.style.display=f.length===0?`none`:``,this._syncOverflowButtonWidths(f),this._actionsResizeObserver?.observe(this._actionsTrigger),this._groupingActions=!1}_setActionSlot(e,t){t===`overflow-actions`?this._autoGroupedActions.add(e):this._autoGroupedActions.delete(e),e.getAttribute(`slot`)!==t&&e.setAttribute(`slot`,t)}_syncOverflowButtonWidths(e){let t=new Set;e.forEach(e=>{e.matches(`mint-button`)&&t.add(e),e.querySelectorAll(`mint-button`).forEach(e=>t.add(e))}),Array.from(this.querySelectorAll(`mint-button[slot="actions"], mint-button[slot="overflow-actions"], [slot="actions"] mint-button, [slot="overflow-actions"] mint-button`)).forEach(e=>{if(t.has(e))this._actionFullWidthOriginal.has(e)||this._actionFullWidthOriginal.set(e,e.getAttribute(`full-width`)),this._actionAlignmentOriginal.has(e)||this._actionAlignmentOriginal.set(e,e.getAttribute(`align`)),e.setAttribute(`full-width`,`true`),e.setAttribute(`align`,`left`),e.querySelector(`.mint-button-core`)?.setAttribute(`data-align`,`left`);else if(this._actionFullWidthOriginal.has(e)){let t=this._actionFullWidthOriginal.get(e);t===null?e.removeAttribute(`full-width`):t!==void 0&&e.setAttribute(`full-width`,t),this._actionFullWidthOriginal.delete(e);let n=this._actionAlignmentOriginal.get(e);n===null?e.removeAttribute(`align`):n!==void 0&&e.setAttribute(`align`,n),e.querySelector(`.mint-button-core`)?.setAttribute(`data-align`,n||`center`),this._actionAlignmentOriginal.delete(e)}})}_handleBack(e){e.preventDefault(),e.stopPropagation();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`,kn);var An=class extends HTMLElement{constructor(){super()}};typeof customElements<`u`&&!customElements.get(`mint-grid`)&&a(`mint-grid`,An);var V=new Set,H=null;function jn(e){if(!V.has(e)){if(V.size===0){let e=document.documentElement;H={scrollY:window.scrollY||window.pageYOffset||0,rootOverflow:e.style.overflow,rootOverscrollBehavior:e.style.overscrollBehavior},e.style.overflow=`hidden`,e.style.overscrollBehavior=`none`}V.add(e)}}function Mn(e){if(!V.delete(e)||V.size>0||!H)return;let t=H;H=null;let n=document.documentElement;n.style.overflow=t.rootOverflow,n.style.overscrollBehavior=t.rootOverscrollBehavior,window.scrollTo({left:0,top:t.scrollY,behavior:`instant`})}var Nn=class extends HTMLElement{static get observedAttributes(){return[`id`,`heading`,`open`,`size`]}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(){Mn(this),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`)||``}getSize(){let e=this.getAttribute(`size`);return e===`small`||e===`large`?e:`default`}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(),r=this.getSize();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,jn(this),this._animateEnter())}else this._renderedOpen&&(this._renderedOpen=!1,this._animateExit());let i=this._modal.querySelector(`.modal-content`);i||(i=document.createElement(`div`),i.className=`modal-content`,this._modal.appendChild(i)),i.classList.remove(`modal-content--small`,`modal-content--large`),r!==`default`&&i.classList.add(`modal-content--${r}`),this._header||(this._header=document.createElement(`div`),this._header.className=`mint-modal-header`,i.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 a=this._headingSlot.querySelector(`mint-text`);t?(a||(a=document.createElement(`mint-text`),a.setAttribute(`size`,`sub-heading`),a.setAttribute(`bold`,``),this._headingSlot.appendChild(a)),a.textContent=t):a&&a.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.classList.add(`mint-modal-close-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`),i.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)});let o=Array.from(this.children).filter(e=>e!==this._overlay&&e!==this._modal&&e!==this._actionsSlot&&e.getAttribute(`slot`)===`actions`),s=this._actionsSlot?.querySelector(`mint-stack`),c=!!s&&s.children.length>0;if(o.length||c){this._actionsSlot||(this._actionsSlot=document.createElement(`div`),this._actionsSlot.className=`p-4 border-t border-gray-200 dark:border-mint-divider`,this._actionsSlot.setAttribute(`slot`,`actions`),i.appendChild(this._actionsSlot));let e=this._actionsSlot.querySelector(`mint-stack`);e||(e=document.createElement(`mint-stack`),e.setAttribute(`direction`,`horizontal`),e.setAttribute(`align-content`,`right`),e.className=`mint-actions-stack`,this._actionsSlot.appendChild(e)),o.forEach(t=>{Array.from(t.children).forEach(t=>e.appendChild(t)),t.remove()})}else this._actionsSlot&&=(this._actionsSlot.remove(),null);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`,e.getBoundingClientRect(),requestAnimationFrame(()=>{this.isOpen()&&(e.style.transition=`opacity 200ms ease-out`,e.style.opacity=`1`,this._backdropTimer=window.setTimeout(()=>{e.style.transition=``,e.style.opacity=``,e.style.transform=``,this._backdropTimer=null},220))}))}_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}_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`),Mn(this);return}this._exitTimer&&clearTimeout(this._exitTimer),this.classList.add(`mint-modal-closing`),e.style.transition=`opacity 200ms ease-in`,e.style.opacity=`0`,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.transition=``,Mn(this))},200)}};typeof customElements<`u`&&!customElements.get(`mint-modal`)&&a(`mint-modal`,Nn),s({name:`check`,viewBox:`0 0 24 24`,path:`M5 13l4 4L19 7`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3.2`});var Pn=class extends HTMLElement{static get observedAttributes(){return[`checked`,`indeterminate`,`disabled`,`label`,`info`,`id`,`name`,`value`,`loading`]}constructor(){super(),this._checkbox=null,this._checked=!1,this._indeterminate=!1,this._clickHandler=null}connectedCallback(){let e=this.getAttribute(`checked`);this._checked=e!==null&&e!==`false`,this._indeterminate=this.hasAttribute(`indeterminate`)&&this.getAttribute(`indeterminate`)!==`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)),e===`indeterminate`&&(this._indeterminate=n!==null&&n!==`false`,this._checkbox&&(this._checkbox.indeterminate=this._indeterminate)),t!==n&&(this.render(),e===`checked`&&this._checkbox&&this.updateVisualState(),e===`indeterminate`&&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()}get indeterminate(){return this._indeterminate}set indeterminate(e){this._indeterminate=!!e,this._indeterminate?this.setAttribute(`indeterminate`,`true`):this.removeAttribute(`indeterminate`),this._checkbox&&(this._checkbox.indeterminate=this._indeterminate),this.updateVisualState()}isDisabled(){return this.hasAttribute(`disabled`)||this.getAttribute(`loading`)===`true`}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.getAttribute(`loading`)===`true`;this.toggleAttribute(`aria-busy`,e);let t=this.getLabel(),n=this.getInfo(),r=this.isDisabled(),i=this.querySelector(`.mint-checkbox-wrapper`);i||(i=document.createElement(`div`),i.className=`mint-checkbox-wrapper`,this.insertBefore(i,this.firstChild)),this._checkbox?this._checkbox.parentElement!==i&&i.appendChild(this._checkbox):(this._checkbox=document.createElement(`input`),this._checkbox.type=`checkbox`,i.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.indeterminate=this._indeterminate,this._checkbox.disabled=r,this._changeHandler||this.setupEventListeners();let a=this.getId();a?this._checkbox.id=a:this._checkbox.removeAttribute(`id`);let o=this.getName();o?this._checkbox.name=o:this._checkbox.removeAttribute(`name`);let s=this.getValue();s?this._checkbox.value=s:this._checkbox.removeAttribute(`value`),t?this._checkbox.setAttribute(`aria-label`,t):this._checkbox.removeAttribute(`aria-label`),i.className=`mint-checkbox-wrapper ${this.getCheckboxClasses()}`,i.style.pointerEvents=`none`,this._checkbox.style.pointerEvents=`auto`;let c=i.querySelector(`mint-icon`);c||(c=document.createElement(`mint-icon`),c.setAttribute(`name`,`check`),c.className=`mint-checkbox-check`,c.style.position=`absolute`,c.style.inset=`auto`,c.style.top=`50%`,c.style.left=`50%`,c.style.width=`0.875rem`,c.style.height=`0.875rem`,c.style.margin=`0`,c.style.transition=`opacity 200ms ease-out, transform 200ms ease-out`,c.style.zIndex=`1`,i.appendChild(c)),this.updateVisualState();let l=this.querySelector(`.mint-checkbox-label-container`);if(t||n){l||(l=document.createElement(`div`),l.className=`mint-checkbox-label-container`,this.appendChild(l));let e=l.querySelector(`.mint-checkbox-label`);t?(e||(e=document.createElement(`span`),e.className=`mint-checkbox-label`,l.insertBefore(e,l.firstChild)),e.textContent=t,r?e.style.opacity=`0.5`:e.style.opacity=``):e&&e.remove();let i=l.querySelector(`.mint-checkbox-info`);if(n?(i||(i=document.createElement(`span`),i.className=`mint-checkbox-info`,l.appendChild(i)),i.textContent=n,r?i.style.opacity=`0.5`:i.style.opacity=``):i&&i.remove(),r)l.style.cursor=`default`,l._clickHandler&&(l.removeEventListener(`click`,l._clickHandler),l._clickHandler=null);else{l.style.cursor=`pointer`;let e=l._clickHandler;e&&l.removeEventListener(`click`,e),l._clickHandler=e=>{this._checkbox&&(e.target===this._checkbox||this._checkbox.contains(e.target)||e.composedPath().includes(this._checkbox))||this.toggle()},l.addEventListener(`click`,l._clickHandler)}}else l&&l.remove();let u=this.querySelector(`:scope > .mint-checkbox-loading-skeleton`);if(e){if(!u){u=document.createElement(`div`),u.className=`mint-checkbox-loading-skeleton`,u.setAttribute(`aria-hidden`,`true`),Object.assign(u.style,{position:`absolute`,inset:`0`,display:`flex`,alignItems:`center`,gap:`0.5rem`,pointerEvents:`none`,zIndex:`20`});let e=document.createElement(`span`);if(Object.assign(e.style,{display:`block`,width:`1.25rem`,height:`1.25rem`,flex:`none`,borderRadius:`0.25rem`,background:`var(--mint-color-surface-control, #e8eee9)`,animation:`mint-checkbox-skeleton-pulse 1.4s ease-in-out infinite`}),u.appendChild(e),t){let e=document.createElement(`span`);Object.assign(e.style,{display:`block`,width:`6rem`,height:`1rem`,borderRadius:`0.35rem`,background:`var(--mint-color-surface-control, #e8eee9)`,animation:`mint-checkbox-skeleton-pulse 1.4s ease-in-out infinite`}),u.appendChild(e)}this.appendChild(u)}this.style.position=`relative`,u.style.display=`flex`,i.style.visibility=`hidden`,l&&(l.style.visibility=`hidden`)}else u&&(u.style.display=`none`),i.style.visibility=``,l&&(l.style.visibility=``)}setupEventListeners(){this.removeEventListeners(),this._checkbox&&(this._changeHandler=e=>{e.stopPropagation(),this._checked=this._checkbox.checked,this._indeterminate=!1,this._checkbox.indeterminate=!1,this.removeAttribute(`indeterminate`),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&&!this._indeterminate?`1`:`0`,t.style.transform=this._checked&&!this._indeterminate?`translate(-50%, -50%)`:`translate(-50%, -50%) scale(0.8)`),e&&(e.className=`mint-checkbox-wrapper ${this.getCheckboxClasses()}`,e.toggleAttribute(`data-indeterminate`,this._indeterminate),e.classList.contains(`mint-checkbox-active`)||(e.style.backgroundColor=``,e.style.boxShadow=``))}toggle(){if(this._checkbox&&!this.isDisabled()){this._checkbox.checked=!this._checked,this._indeterminate=!1,this._checkbox.indeterminate=!1,this.removeAttribute(`indeterminate`),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`,Pn);var Fn=class extends HTMLElement{static get observedAttributes(){return[`checked`,`disabled`,`label`,`info`,`id`,`name`,`value`,`required`,`loading`]}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`)||this.getAttribute(`loading`)===`true`}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(){let e=this.getAttribute(`loading`)===`true`;this.toggleAttribute(`aria-busy`,e),this.classList.add(`mint-choice-group`),this.setAttribute(`role`,`radiogroup`);let t=this.getAttribute(`label`)||``,n=this.querySelector(`:scope > .mint-choice-group-label`);t&&!n&&(n=document.createElement(`div`),n.className=`mint-choice-group-label`,this.insertBefore(n,this.firstChild)),n&&(t?n.textContent=t:n.remove());let r=this.querySelector(`:scope > .mint-choice-options`);r||(r=document.createElement(`div`),r.className=`mint-choice-options`,n?.parentElement===this?this.insertBefore(r,n.nextSibling):this.insertBefore(r,this.firstChild)),Array.from(this.children).filter(e=>e.tagName===`MINT-CHOICE-OPTION`&&e.parentElement!==r).forEach(e=>r.appendChild(e)),this.querySelectorAll(`mint-choice-option`).forEach(t=>{t.toggleAttribute(`loading`,e),t.render()});let i=this.getAttribute(`value`);i&&this.setValue(i);let a=r.querySelector(`:scope > .mint-choice-loading-skeleton`);if(e){r.style.position=`relative`,a||(a=document.createElement(`div`),a.className=`mint-choice-loading-skeleton`,a.setAttribute(`aria-hidden`,`true`),Object.assign(a.style,{position:`absolute`,inset:`0`,display:`flex`,flexDirection:`column`,pointerEvents:`none`,zIndex:`20`}),r.appendChild(a)),a.style.gap=r.querySelector(`:scope > mint-choice-option[info]`)?`0.75rem`:`0.55rem`;let e=r.querySelectorAll(`:scope > mint-choice-option`).length,t=Array.from(a.children);for(;t.length>e;)t.pop()?.remove();for(;t.length<e;){let e=t.length,n=document.createElement(`div`);Object.assign(n.style,{display:`flex`,alignItems:`center`,gap:`0.55rem`,minHeight:`1.25rem`,flex:`none`});let r=document.createElement(`span`);Object.assign(r.style,{display:`block`,width:`1.1rem`,height:`1.1rem`,flex:`none`,borderRadius:`50%`,background:`var(--mint-color-surface-control, #e8eee9)`,animation:`mint-choice-skeleton-pulse 1.4s ease-in-out infinite`});let i=document.createElement(`span`);Object.assign(i.style,{display:`block`,width:`${e%2?`5rem`:`6rem`}`,height:`1rem`,borderRadius:`0.35rem`,background:`var(--mint-color-surface-control, #e8eee9)`,animation:`mint-choice-skeleton-pulse 1.4s ease-in-out infinite`}),n.append(r,i),a.appendChild(n),t.push(n)}a.style.display=`flex`,r.querySelectorAll(`:scope > mint-choice-option`).forEach(e=>{e.style.visibility=`hidden`})}else a&&(a.style.display=`none`),r.style.position=``,r.querySelectorAll(`:scope > mint-choice-option`).forEach(e=>{e.style.visibility=``})}_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)}}},In=class extends HTMLElement{static get observedAttributes(){return[`value`,`checked`,`disabled`,`loading`]}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`)||this.hasAttribute(`loading`)||e?.hasAttribute(`disabled`)||e?.hasAttribute(`loading`)||!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`,Fn),typeof customElements<`u`&&!customElements.get(`mint-choice-option`)&&a(`mint-choice-option`,In);var Ln=0,Rn=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=++Ln,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`,Rn),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 zn=class extends HTMLElement{static get observedAttributes(){return[`heading`,`dismissible`,`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 dismissible(){return this.isDismissible()}set dismissible(e){this.setAttribute(`dismissible`,String(!!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`}isDismissible(){return this.getAttribute(`dismissible`)===`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.isDismissible(),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`,zn);var Bn=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`,Bn);var Vn=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`,Vn);var Hn=Bn,Un=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;">
|
|
223
223
|
<span style="display: inline-block; width: 12px; height: 12px; background-color: ${e.color}; border-radius: 2px;"></span>
|
|
224
224
|
<span>${e.name}: ${e.formattedValue}</span>
|
|
225
225
|
</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;">
|
package/dist/index.js
CHANGED
|
@@ -3337,7 +3337,7 @@ var kn = class extends HTMLElement {
|
|
|
3337
3337
|
];
|
|
3338
3338
|
}
|
|
3339
3339
|
constructor() {
|
|
3340
|
-
super(), this._actionsResizeObserver = null, this._actionsMutationObserver = null, this._actionsFrame = null, this._groupingActions = !1, this._actionFullWidthOriginal = /* @__PURE__ */ new WeakMap(), this._autoGroupedActions = /* @__PURE__ */ new WeakSet(), this._explicitOverflowActions = /* @__PURE__ */ new WeakSet(), this._root = this.attachShadow({ mode: "open" }), this._root.innerHTML = "\n <style>\n /* The built-in back button lives inside this component's shadow root,\n so document-level button.css cannot reach its light-DOM button. */\n /* Avoid an inline baseline line box below the native button core. */\n .mint-page-back mint-button {\n box-sizing: border-box;\n display: flex !important;\n align-items: center;\n justify-content: center;\n width: 2.25rem;\n height: 2.25rem;\n line-height: 0;\n vertical-align: middle;\n }\n .mint-page-back mint-button .mint-button-core {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n min-width: 2.25rem;\n min-height: 2.25rem;\n padding: .375rem;\n border: 2px solid var(--mint-color-border, #dfe6e0);\n border-top-color: #e5e7eb;\n border-left-color: #e5e7eb;\n border-right-color: #d1d5db;\n border-bottom-color: #d1d5db;\n border-radius: .5rem;\n background: var(--mint-color-surface, #fff);\n color: var(--mint-color-text, #28372d);\n font: inherit;\n box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n cursor: pointer;\n transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease, filter .12s ease;\n }\n .mint-page-back mint-button .mint-button-core:hover:not(:disabled) { filter: brightness(.98); }\n .mint-page-back mint-button .mint-button-core:active:not(:disabled) {\n border-top-color: #9ca3af;\n border-left-color: #9ca3af;\n border-right-color: #e5e7eb;\n border-bottom-color: #e5e7eb;\n background: #f3f4f6;\n box-shadow: inset 0 2px 4px rgb(16 32 21 / 26%), inset 0 1px 2px rgb(6 25 15 / 14%);\n filter: brightness(.97);\n }\n .mint-page-back mint-button .mint-button-core:focus-visible {\n outline: 3px solid var(--mint-color-focus, #6eaa86);\n outline-offset: 2px;\n }\n .mint-page-actions-menu { box-sizing: border-box; display: flex; min-width: 14rem; flex-direction: column; gap: .25rem; padding: .375rem; }\n .mint-page-actions-primary { display: flex; align-items: center; gap: .5rem; min-width: 0; }\n .mint-page-actions-menu ::slotted(*) { box-sizing: border-box; display: block; width: 100%; }\n .mint-page-actions-menu ::slotted(div) { display: flex; flex-direction: column !important; align-items: stretch !important; gap: .25rem !important; }\n .mint-page-actions-trigger { display: inline-flex; vertical-align: middle; }\n .mint-page-actions-trigger[hidden] { display: none !important; }\n .mint-page-actions-trigger .mint-button-core {\n box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;\n width: 2.5rem; height: 2.5rem; min-width: 2.5rem; min-height: 2.5rem; padding: .5rem;\n border: 2px solid var(--mint-color-border, #dfe6e0); border-radius: .625rem;\n background: var(--mint-color-surface, #fff); color: var(--mint-color-text, #28372d);\n font: inherit; cursor: pointer; box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n }\n .mint-page-actions-trigger .mint-button-icon { display: inline-flex; width: 1.125rem; height: 1.125rem; }\n .mint-page-actions-trigger .mint-button-icon mint-icon { width: 100% !important; height: 100% !important; }\n .mint-page-actions-popover { position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none; }\n .mint-page-actions-popover:not([data-open]):not([data-state=\"closing\"]),\n .mint-page-actions-popover.hidden { display: none !important; }\n .mint-page-actions-popover[data-open],\n .mint-page-actions-popover[data-state=\"closing\"] {\n display: block; box-sizing: border-box; width: max-content; height: max-content;\n min-height: 0; max-width: calc(100vw - 24px); max-height: min(500px, calc(100vh - 24px));\n max-height: min(500px, calc(100svh - 24px)); overflow: auto; padding: 0;\n border: 1px solid var(--mint-color-border, #dfe6e0); border-radius: .75rem;\n background: var(--mint-color-surface-raised, #fff); color: var(--mint-color-text, #28372d);\n box-shadow: 0 12px 36px rgb(16 32 21 / 13%); pointer-events: auto;\n transform-origin: var(--mint-popover-origin-x, 50%) var(--mint-popover-origin-y, 0%);\n }\n .mint-page-actions-popover[data-state=\"closing\"] { pointer-events: none; }\n .mint-page-actions-popover > .pointer-events-none { position: fixed; inset: 0; z-index: 55; pointer-events: none; }\n .mint-page-actions-popover > .pointer-events-auto {\n position: fixed; z-index: 60; min-width: 14rem; border-radius: .75rem;\n background: var(--mint-color-surface, #fff); pointer-events: auto;\n }\n .mint-page-actions-popover .popover-content {\n min-height: 0; overflow: visible; border: 1px solid var(--mint-color-border, #dfe6e0);\n border-radius: .75rem; background: var(--mint-color-surface, #fff);\n box-shadow: 0 12px 30px rgb(15 23 42 / 16%); padding: 0;\n }\n .mint-page-actions[hidden] { display: none !important; }\n </style>\n <div part=\"container\" class=\"mint-page-container\">\n <header part=\"header\" class=\"mint-page-header\">\n <div part=\"title\" class=\"mint-page-title\">\n <mint-back-button part=\"back-button\" class=\"mint-page-back\" aria-label=\"Go back\" hidden></mint-back-button>\n <h1 part=\"heading\" class=\"mint-page-heading\"><slot name=\"heading\"><span class=\"mint-page-heading-fallback\"></span></slot></h1>\n </div>\n <div part=\"actions\" class=\"mint-page-actions\" hidden>\n <div class=\"mint-page-actions-primary\"><slot name=\"actions\"></slot></div>\n <mint-button id=\"mint-page-actions-trigger\" class=\"mint-page-actions-trigger\" variant=\"outline\" icon=\"ellipsis\" aria-label=\"Page actions\"></mint-button>\n <mint-popover id=\"mint-page-actions-popover\" class=\"mint-page-actions-popover\" trigger-id=\"mint-page-actions-trigger\" direction=\"down\" trigger-align=\"end\" padding=\"0\">\n <div class=\"mint-page-actions-menu\"><slot name=\"overflow-actions\"></slot></div>\n </mint-popover>\n </div>\n </header>\n <main part=\"body\" class=\"mint-page-body\"><slot></slot></main>\n </div>\n ", this._headingElement = this._root.querySelector(".mint-page-heading"), this._headingFallbackElement = this._root.querySelector(".mint-page-heading-fallback"), this._backButton = this._root.querySelector(".mint-page-back"), this._actionsSlot = this._root.querySelector("slot[name=\"actions\"]"), this._overflowActionsSlot = this._root.querySelector("slot[name=\"overflow-actions\"]"), this._actionsWrapper = this._root.querySelector(".mint-page-actions"), this._actionsTrigger = this._root.querySelector("#mint-page-actions-trigger"), this._actionsPopover = this._root.querySelector("#mint-page-actions-popover"), this._actionsSlot.addEventListener("slotchange", () => this._scheduleActionGrouping()), this._overflowActionsSlot.addEventListener("slotchange", () => this._scheduleActionGrouping()), this._backButton.addEventListener("click", (e) => this._handleBack(e), !0);
|
|
3340
|
+
super(), this._actionsResizeObserver = null, this._actionsMutationObserver = null, this._actionsFrame = null, this._groupingActions = !1, this._actionFullWidthOriginal = /* @__PURE__ */ new WeakMap(), this._actionAlignmentOriginal = /* @__PURE__ */ new WeakMap(), this._autoGroupedActions = /* @__PURE__ */ new WeakSet(), this._explicitOverflowActions = /* @__PURE__ */ new WeakSet(), this._root = this.attachShadow({ mode: "open" }), this._root.innerHTML = "\n <style>\n /* The built-in back button lives inside this component's shadow root,\n so document-level button.css cannot reach its light-DOM button. */\n /* Avoid an inline baseline line box below the native button core. */\n .mint-page-back mint-button {\n box-sizing: border-box;\n display: flex !important;\n align-items: center;\n justify-content: center;\n width: 2.25rem;\n height: 2.25rem;\n line-height: 0;\n vertical-align: middle;\n }\n .mint-page-back mint-button .mint-button-core {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n min-width: 2.25rem;\n min-height: 2.25rem;\n padding: .375rem;\n border: 2px solid var(--mint-color-border, #dfe6e0);\n border-top-color: #e5e7eb;\n border-left-color: #e5e7eb;\n border-right-color: #d1d5db;\n border-bottom-color: #d1d5db;\n border-radius: .5rem;\n background: var(--mint-color-surface, #fff);\n color: var(--mint-color-text, #28372d);\n font: inherit;\n box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n cursor: pointer;\n transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease, filter .12s ease;\n }\n .mint-page-back mint-button .mint-button-core:hover:not(:disabled) { filter: brightness(.98); }\n .mint-page-back mint-button .mint-button-core:active:not(:disabled) {\n border-top-color: #9ca3af;\n border-left-color: #9ca3af;\n border-right-color: #e5e7eb;\n border-bottom-color: #e5e7eb;\n background: #f3f4f6;\n box-shadow: inset 0 2px 4px rgb(16 32 21 / 26%), inset 0 1px 2px rgb(6 25 15 / 14%);\n filter: brightness(.97);\n }\n .mint-page-back mint-button .mint-button-core:focus-visible {\n outline: 3px solid var(--mint-color-focus, #6eaa86);\n outline-offset: 2px;\n }\n .mint-page-actions-menu { box-sizing: border-box; display: flex; min-width: 14rem; flex-direction: column; gap: .25rem; padding: .375rem; }\n .mint-page-actions-primary { display: flex; align-items: center; gap: .5rem; min-width: 0; }\n .mint-page-actions-menu ::slotted(*) { box-sizing: border-box; display: block; width: 100%; }\n .mint-page-actions-menu ::slotted(div) { display: flex; flex-direction: column !important; align-items: stretch !important; gap: .25rem !important; }\n .mint-page-actions-trigger { display: inline-flex; vertical-align: middle; }\n .mint-page-actions-trigger[hidden] { display: none !important; }\n .mint-page-actions-trigger .mint-button-core {\n box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;\n width: 2.5rem; height: 2.5rem; min-width: 2.5rem; min-height: 2.5rem; padding: .5rem;\n border: 2px solid var(--mint-color-border, #dfe6e0); border-radius: .625rem;\n background: var(--mint-color-surface, #fff); color: var(--mint-color-text, #28372d);\n font: inherit; cursor: pointer; box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n }\n .mint-page-actions-trigger .mint-button-icon { display: inline-flex; width: 1.125rem; height: 1.125rem; }\n .mint-page-actions-trigger .mint-button-icon mint-icon { width: 100% !important; height: 100% !important; }\n .mint-page-actions-popover { position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none; }\n .mint-page-actions-popover:not([data-open]):not([data-state=\"closing\"]),\n .mint-page-actions-popover.hidden { display: none !important; }\n .mint-page-actions-popover[data-open],\n .mint-page-actions-popover[data-state=\"closing\"] {\n display: block; box-sizing: border-box; width: max-content; height: max-content;\n min-height: 0; max-width: calc(100vw - 24px); max-height: min(500px, calc(100vh - 24px));\n max-height: min(500px, calc(100svh - 24px)); overflow: auto; padding: 0;\n border: 1px solid var(--mint-color-border, #dfe6e0); border-radius: .75rem;\n background: var(--mint-color-surface-raised, #fff); color: var(--mint-color-text, #28372d);\n box-shadow: 0 12px 36px rgb(16 32 21 / 13%); pointer-events: auto;\n transform-origin: var(--mint-popover-origin-x, 50%) var(--mint-popover-origin-y, 0%);\n }\n .mint-page-actions-popover[data-state=\"closing\"] { pointer-events: none; }\n .mint-page-actions-popover > .pointer-events-none { position: fixed; inset: 0; z-index: 55; pointer-events: none; }\n .mint-page-actions-popover > .pointer-events-auto {\n position: fixed; z-index: 60; min-width: 14rem; border-radius: .75rem;\n background: var(--mint-color-surface, #fff); pointer-events: auto;\n }\n .mint-page-actions-popover .popover-content {\n min-height: 0; overflow: visible; border: 1px solid var(--mint-color-border, #dfe6e0);\n border-radius: .75rem; background: var(--mint-color-surface, #fff);\n box-shadow: 0 12px 30px rgb(15 23 42 / 16%); padding: 0;\n }\n .mint-page-actions[hidden] { display: none !important; }\n </style>\n <div part=\"container\" class=\"mint-page-container\">\n <header part=\"header\" class=\"mint-page-header\">\n <div part=\"title\" class=\"mint-page-title\">\n <mint-back-button part=\"back-button\" class=\"mint-page-back\" aria-label=\"Go back\" hidden></mint-back-button>\n <h1 part=\"heading\" class=\"mint-page-heading\"><slot name=\"heading\"><span class=\"mint-page-heading-fallback\"></span></slot></h1>\n </div>\n <div part=\"actions\" class=\"mint-page-actions\" hidden>\n <div class=\"mint-page-actions-primary\"><slot name=\"actions\"></slot></div>\n <mint-button id=\"mint-page-actions-trigger\" class=\"mint-page-actions-trigger\" variant=\"outline\" icon=\"ellipsis\" aria-label=\"Page actions\"></mint-button>\n <mint-popover id=\"mint-page-actions-popover\" class=\"mint-page-actions-popover\" trigger-id=\"mint-page-actions-trigger\" direction=\"down\" trigger-align=\"end\" padding=\"0\">\n <div class=\"mint-page-actions-menu\"><slot name=\"overflow-actions\"></slot></div>\n </mint-popover>\n </div>\n </header>\n <main part=\"body\" class=\"mint-page-body\"><slot></slot></main>\n </div>\n ", this._headingElement = this._root.querySelector(".mint-page-heading"), this._headingFallbackElement = this._root.querySelector(".mint-page-heading-fallback"), this._backButton = this._root.querySelector(".mint-page-back"), this._actionsSlot = this._root.querySelector("slot[name=\"actions\"]"), this._overflowActionsSlot = this._root.querySelector("slot[name=\"overflow-actions\"]"), this._actionsWrapper = this._root.querySelector(".mint-page-actions"), this._actionsTrigger = this._root.querySelector("#mint-page-actions-trigger"), this._actionsPopover = this._root.querySelector("#mint-page-actions-popover"), this._actionsSlot.addEventListener("slotchange", () => this._scheduleActionGrouping()), this._overflowActionsSlot.addEventListener("slotchange", () => this._scheduleActionGrouping()), this._backButton.addEventListener("click", (e) => this._handleBack(e), !0);
|
|
3341
3341
|
}
|
|
3342
3342
|
connectedCallback() {
|
|
3343
3343
|
this.render(), this._actionsResizeObserver = new ResizeObserver(() => this._scheduleActionGrouping()), this._actionsResizeObserver.observe(this._root.querySelector(".mint-page-header")), this._actionsMutationObserver = new MutationObserver((e) => {
|
|
@@ -3422,10 +3422,12 @@ var kn = class extends HTMLElement {
|
|
|
3422
3422
|
e.forEach((e) => {
|
|
3423
3423
|
e.matches("mint-button") && t.add(e), e.querySelectorAll("mint-button").forEach((e) => t.add(e));
|
|
3424
3424
|
}), Array.from(this.querySelectorAll("mint-button[slot=\"actions\"], mint-button[slot=\"overflow-actions\"], [slot=\"actions\"] mint-button, [slot=\"overflow-actions\"] mint-button")).forEach((e) => {
|
|
3425
|
-
if (t.has(e)) this._actionFullWidthOriginal.has(e) || this._actionFullWidthOriginal.set(e, e.getAttribute("full-width")), e.setAttribute("full-width", "true");
|
|
3425
|
+
if (t.has(e)) this._actionFullWidthOriginal.has(e) || this._actionFullWidthOriginal.set(e, e.getAttribute("full-width")), this._actionAlignmentOriginal.has(e) || this._actionAlignmentOriginal.set(e, e.getAttribute("align")), e.setAttribute("full-width", "true"), e.setAttribute("align", "left"), e.querySelector(".mint-button-core")?.setAttribute("data-align", "left");
|
|
3426
3426
|
else if (this._actionFullWidthOriginal.has(e)) {
|
|
3427
3427
|
let t = this._actionFullWidthOriginal.get(e);
|
|
3428
3428
|
t === null ? e.removeAttribute("full-width") : t !== void 0 && e.setAttribute("full-width", t), this._actionFullWidthOriginal.delete(e);
|
|
3429
|
+
let n = this._actionAlignmentOriginal.get(e);
|
|
3430
|
+
n === null ? e.removeAttribute("align") : n !== void 0 && e.setAttribute("align", n), e.querySelector(".mint-button-core")?.setAttribute("data-align", n || "center"), this._actionAlignmentOriginal.delete(e);
|
|
3429
3431
|
}
|
|
3430
3432
|
});
|
|
3431
3433
|
}
|