monobill-mintui 0.5.2 → 0.5.3
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideNavigationLinks.d.ts","sourceRoot":"","sources":["../../../src/components/side-navigation/SideNavigationLinks.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,CAAA;AACtB,OAAO,eAAe,CAAA;AACtB,OAAO,2BAA2B,CAAA;AAClC,OAAO,sBAAsB,CAAA;AAE7B,cAAM,gBAAiB,SAAQ,WAAW;IACxC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,MAAM,CAAiC;IAC/C,OAAO,CAAC,WAAW,CAA2B;IAC9C,OAAO,CAAC,WAAW,CAA2B;IAC9C,OAAO,CAAC,KAAK,CAA2B;IACxC,OAAO,CAAC,kBAAkB,CAA6D;IACvF,OAAO,CAAC,gBAAgB,CAAC,CAA2F;IACpH,OAAO,CAAC,eAAe,CAA4B;IAEnD,2DAA2D;IAC3D,IAAI,eAAe,IACf,CAAC,CAAC,KAAK,EAAE,WAAW,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,UAAU,GAAG,aAAa,CAAA;KAAE,CAAC,KAAK,IAAI,CAAC,GAC3F,SAAS,CAEZ;IAED,IAAI,eAAe,CACjB,QAAQ,EACJ,CAAC,CAAC,KAAK,EAAE,WAAW,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,UAAU,GAAG,aAAa,CAAA;KAAE,CAAC,KAAK,IAAI,CAAC,GAC3F,SAAS,EAId;IAED,gBAAgB,CAAC,CAAC,SAAS,MAAM,mBAAmB,EAClD,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,OAAO,EACpE,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC1C,IAAI;IACP,gBAAgB,CACd,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,kCAAkC,EAC5C,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC1C,IAAI;IAUP,mBAAmB,CAAC,CAAC,SAAS,MAAM,mBAAmB,EACrD,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,OAAO,EACpE,OAAO,CAAC,EAAE,OAAO,GAAG,oBAAoB,GACvC,IAAI;IACP,mBAAmB,CACjB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,kCAAkC,EAC5C,OAAO,CAAC,EAAE,OAAO,GAAG,oBAAoB,GACvC,IAAI;IAUP,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB,IAAI,IAAI;IAO5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAM9F,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,kBAAkB;IAK1B,OAAO,CAAC,cAAc;IAiBtB,MAAM,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"SideNavigationLinks.d.ts","sourceRoot":"","sources":["../../../src/components/side-navigation/SideNavigationLinks.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,CAAA;AACtB,OAAO,eAAe,CAAA;AACtB,OAAO,2BAA2B,CAAA;AAClC,OAAO,sBAAsB,CAAA;AAE7B,cAAM,gBAAiB,SAAQ,WAAW;IACxC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,MAAM,CAAiC;IAC/C,OAAO,CAAC,WAAW,CAA2B;IAC9C,OAAO,CAAC,WAAW,CAA2B;IAC9C,OAAO,CAAC,KAAK,CAA2B;IACxC,OAAO,CAAC,kBAAkB,CAA6D;IACvF,OAAO,CAAC,gBAAgB,CAAC,CAA2F;IACpH,OAAO,CAAC,eAAe,CAA4B;IAEnD,2DAA2D;IAC3D,IAAI,eAAe,IACf,CAAC,CAAC,KAAK,EAAE,WAAW,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,UAAU,GAAG,aAAa,CAAA;KAAE,CAAC,KAAK,IAAI,CAAC,GAC3F,SAAS,CAEZ;IAED,IAAI,eAAe,CACjB,QAAQ,EACJ,CAAC,CAAC,KAAK,EAAE,WAAW,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,UAAU,GAAG,aAAa,CAAA;KAAE,CAAC,KAAK,IAAI,CAAC,GAC3F,SAAS,EAId;IAED,gBAAgB,CAAC,CAAC,SAAS,MAAM,mBAAmB,EAClD,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,OAAO,EACpE,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC1C,IAAI;IACP,gBAAgB,CACd,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,kCAAkC,EAC5C,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC1C,IAAI;IAUP,mBAAmB,CAAC,CAAC,SAAS,MAAM,mBAAmB,EACrD,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,OAAO,EACpE,OAAO,CAAC,EAAE,OAAO,GAAG,oBAAoB,GACvC,IAAI;IACP,mBAAmB,CACjB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,kCAAkC,EAC5C,OAAO,CAAC,EAAE,OAAO,GAAG,oBAAoB,GACvC,IAAI;IAUP,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB,IAAI,IAAI;IAO5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAM9F,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,kBAAkB;IAK1B,OAAO,CAAC,cAAc;IAiBtB,MAAM,IAAI,IAAI;CA4Gf;AAMD,eAAe,gBAAgB,CAAA"}
|
package/dist/index.cjs
CHANGED
|
@@ -193,4 +193,4 @@ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{val
|
|
|
193
193
|
display: flex;
|
|
194
194
|
align-items: center;
|
|
195
195
|
height: 100%;
|
|
196
|
-
`,a.textContent=e.name,i.appendChild(a),t.appendChild(i)}),this._svg.appendChild(t),{height:this._legendHeight+50}}async addDataPoint(e,t){return!this._chartData||!this._chartData.datasets[e]?(console.error(`Dataset at index ${e} does not exist`),Promise.reject(Error(`Dataset at index ${e} does not exist`))):(this._chartData.datasets[e].data.push(t),this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender(),new Promise(e=>requestAnimationFrame(()=>e())))}async batchAddDataPoints(e){if(!this._chartData)return Promise.resolve();let t=!1;for(let{datasetIndex:n,point:r}of e)this._chartData.datasets[n]&&(this._chartData.datasets[n].data.push(r),t=!0);return t&&(this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender()),new Promise(e=>requestAnimationFrame(()=>e()))}async updateDatasetData(e,t){return!this._chartData||!this._chartData.datasets[e]?(console.error(`Dataset at index ${e} does not exist`),Promise.reject(Error(`Dataset at index ${e} does not exist`))):(this._chartData.datasets[e].data=t,this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender(),new Promise(e=>requestAnimationFrame(()=>e())))}async addDataset(e){return this._chartData?(this._chartData.datasets.push(e),e.id&&this._datasetVisibility.set(e.id,e.visible!==!1),this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender(),new Promise(e=>requestAnimationFrame(()=>e()))):(console.error(`Chart data not initialized`),Promise.reject(Error(`Chart data not initialized`)))}async removeDataset(e){return!this._chartData||!this._chartData.datasets[e]?(console.error(`Dataset at index ${e} does not exist`),Promise.reject(Error(`Dataset at index ${e} does not exist`))):(this._chartData.datasets.splice(e,1),this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender(),new Promise(e=>requestAnimationFrame(()=>e())))}async updateDataPoint(e,t,n){return!this._chartData||!this._chartData.datasets[e]?(console.error(`Dataset at index ${e} does not exist`),Promise.reject(Error(`Dataset at index ${e} does not exist`))):this._chartData.datasets[e].data[t]?(this._chartData.datasets[e].data[t]=n,this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender(),new Promise(e=>requestAnimationFrame(()=>e()))):(console.error(`Data point at index ${t} does not exist`),Promise.reject(Error(`Data point at index ${t} does not exist`)))}async batchUpdateDataPoints(e){if(!this._chartData)return Promise.resolve();let t=!1;for(let{datasetIndex:n,pointIndex:r,point:i}of e)this._chartData.datasets[n]?.data[r]&&(this._chartData.datasets[n].data[r]=i,t=!0);return t&&(this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender()),new Promise(e=>requestAnimationFrame(()=>e()))}async removeDataPoint(e,t){return!this._chartData||!this._chartData.datasets[e]?(console.error(`Dataset at index ${e} does not exist`),Promise.reject(Error(`Dataset at index ${e} does not exist`))):(this._chartData.datasets[e].data.splice(t,1),this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender(),new Promise(e=>requestAnimationFrame(()=>e())))}async batchRemoveDataPoints(e){if(!this._chartData)return Promise.resolve();let t=!1;for(let{datasetIndex:n,pointIndex:r}of e)this._chartData.datasets[n]?.data[r]&&(this._chartData.datasets[n].data.splice(r,1),t=!0);return t&&(this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender()),new Promise(e=>requestAnimationFrame(()=>e()))}async showDataset(e){return this._datasetVisibility.set(e,!0),this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender(),new Promise(e=>requestAnimationFrame(()=>e()))}async hideDataset(e){return this._datasetVisibility.set(e,!1),this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender(),new Promise(e=>requestAnimationFrame(()=>e()))}async toggleDataset(e){let t=!(this._datasetVisibility.get(e)??!0);return this._datasetVisibility.set(e,t),this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender(),await new Promise(e=>requestAnimationFrame(()=>e())),t}isDatasetVisible(e){return this._datasetVisibility.get(e)}async downloadAsPNG(e=`chart.png`){if(!this._svg)return console.error(`Chart SVG not found`),Promise.reject(Error(`Chart SVG not found`));let t=this._svg.cloneNode(!0),n=this._width,r=this._height;t.querySelectorAll(`text`).forEach(e=>{let t=e.getAttribute(`font-family`);(!t||t.includes(`system-ui`)||t.includes(`apple-system`))&&e.setAttribute(`font-family`,`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif`)}),t.setAttribute(`width`,n.toString()),t.setAttribute(`height`,r.toString()),t.setAttribute(`xmlns`,`http://www.w3.org/2000/svg`),t.querySelectorAll(`foreignObject`).forEach(e=>{let t=e.querySelector(`div`);if(t){let n=document.createElementNS(`http://www.w3.org/2000/svg`,`text`),r=e.getAttribute(`x`)||`0`,i=e.getAttribute(`y`)||`0`;n.setAttribute(`x`,r),n.setAttribute(`y`,(parseFloat(i)+12).toString()),n.setAttribute(`fill`,t.style.color||`#374151`),n.setAttribute(`font-size`,`12`),n.setAttribute(`font-family`,t.style.fontFamily||`system-ui, -apple-system, sans-serif`),n.textContent=t.textContent||``,e.parentNode&&e.parentNode.replaceChild(n,e)}});let i=new XMLSerializer().serializeToString(t),a=`data:image/svg+xml;charset=utf-8,`+encodeURIComponent(i),o=new Image;return o.crossOrigin=`anonymous`,new Promise((t,i)=>{o.onload=()=>{setTimeout(()=>{let a=document.createElement(`canvas`);a.width=n+60,a.height=r+60;let s=a.getContext(`2d`);if(!s){console.error(`Could not get canvas context`),i(Error(`Could not get canvas context`));return}s.fillStyle=document.documentElement.classList.contains(`dark`)?`#111827`:`#ffffff`,s.fillRect(0,0,a.width,a.height),s.drawImage(o,30,30),a.toBlob(n=>{if(!n){console.error(`Could not create blob from canvas`),i(Error(`Could not create blob from canvas`));return}let r=URL.createObjectURL(n),a=document.createElement(`a`);a.href=r,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(r),t()},`image/png`)},0)},o.onerror=()=>{console.error(`Error loading SVG image`),i(Error(`Error loading SVG image`))},o.src=a})}};customElements.get(`mint-chart`)||customElements.define(`mint-chart`,N);var P=class extends HTMLElement{constructor(...e){super(...e),this._trigger=null,this._submenuContainer=null}static get observedAttributes(){return[`label`,`icon`,`href`,`active`,`expanded`,`submenu-item`]}connectedCallback(){this.classList.add(`block`),this.render()}attributeChangedCallback(e,t,n){t!==n&&(this.render(),e===`active`&&this._isSubmenuItem()&&this._refreshDropdownAncestor())}_refreshDropdownAncestor(){let e=this.parentElement;for(;e;){if(e.tagName===`MINT-SIDENAV-LINK`&&e!==this){e.render();break}e=e.parentElement}}_isActive(){return this.getAttribute(`active`)===`true`}_isExpanded(){return this.getAttribute(`expanded`)===`true`}_isSubmenuItem(){return this.getAttribute(`submenu-item`)===`true`}_getLabel(){return this.getAttribute(`label`)||``}_getIcon(){return this.getAttribute(`icon`)||``}_getHref(){return this.getAttribute(`href`)}_getBaseClasses(){let e=this._isActive()?`border-black/20 bg-black/5 text-black dark:border-white/20 dark:bg-white/10 dark:text-white`:`border-transparent text-gray-700 hover:bg-black/5 dark:text-gray-200 dark:hover:bg-white/10`;return[`w-full`,`cursor-pointer`,`rounded-lg`,`border`,`block`,this._isSubmenuItem()?`px-2 py-1.5`:`px-3 py-2`,`text-left`,`text-sm`,e].join(` `)}_hasSubmenu(){return this.querySelectorAll(`:scope > [slot="submenu"]`).length>0?!0:!!this._submenuContainer&&this._submenuContainer.children.length>0}_createRow(e,t){let n=document.createElement(`span`);if(this._isSubmenuItem(),n.className=`inline-flex w-full items-center justify-start gap-2`,t){let e=document.createElement(`mint-icon`);e.setAttribute(`name`,t),e.className=`h-4 w-4 shrink-0`,n.appendChild(e)}let r=document.createElement(`span`);return r.className=`inline truncate`,r.textContent=e,n.appendChild(r),n}_buildSimpleLink(){let e=this._getHref(),t=this._getLabel(),n=this._getIcon(),r=e?document.createElement(`a`):document.createElement(`button`);e?(r.setAttribute(`href`,e),r.setAttribute(`role`,`link`)):r.setAttribute(`type`,`button`),r.className=this._getBaseClasses(),r.setAttribute(`aria-label`,t||`Side navigation link`),r.appendChild(this._createRow(t,n)),this.replaceChildren(r),this._trigger=r}_buildDropdownLink(){let e=this._getLabel(),t=this._getIcon(),n=Array.from(this.querySelectorAll(`:scope > [slot="submenu"]`)),r=n.length>0?n:this._submenuContainer?Array.from(this._submenuContainer.children):[],i=document.createElement(`div`);i.className=`w-full`;let a=document.createElement(`button`);a.type=`button`,a.className=`${this._getBaseClasses()} block w-full`,a.setAttribute(`aria-expanded`,String(this._isExpanded())),a.appendChild(this._createRow(e,t)),a.onclick=()=>{this.setAttribute(`expanded`,this._isExpanded()?`false`:`true`)},this._submenuContainer=document.createElement(`div`),this._submenuContainer.className=[`mt-1`,`ml-5`,`border-l`,`border-gray-200`,`pl-2`,`space-y-1`,`dark:border-mint-divider`,this._isExpanded()?`block`:`hidden`].join(` `),r.forEach(e=>{e.setAttribute(`submenu-item`,`true`),e.setAttribute(`slot`,`submenu`),this._submenuContainer?.appendChild(e)}),i.appendChild(a),i.appendChild(this._submenuContainer),this.replaceChildren(i),this._trigger=a}render(){this._hasSubmenu()&&!this._isSubmenuItem()?this._buildDropdownLink():this._buildSimpleLink()}};customElements.get(`mint-sidenav-link`)||customElements.define(`mint-sidenav-link`,P);var F=class extends HTMLElement{constructor(...e){super(...e),this._container=null,this._title=null,this._titleLabel=null,this._titleCaret=null,this._list=null,this._titleClickHandler=null,this._listenerCounts=new Map}static get observedAttributes(){return[`name`]}get onMintNameClick(){return this._onMintNameClick}set onMintNameClick(e){this._onMintNameClick=e,this.render()}addEventListener(e,t,n){super.addEventListener(e,t,n),this._trackListener(e,1)}removeEventListener(e,t,n){super.removeEventListener(e,t,n),this._trackListener(e,-1)}connectedCallback(){this.classList.add(`block`),this.render()}disconnectedCallback(){this._title&&this._titleClickHandler&&(this._title.removeEventListener(`click`,this._titleClickHandler),this._title.removeEventListener(`keydown`,this._titleClickHandler))}attributeChangedCallback(e,t,n){t!==n&&this.render()}_getName(){return this.getAttribute(`name`)||``}_trackListener(e,t){if(e!==`mint-name-click`)return;let n=this._listenerCounts.get(e)||0,r=Math.max(0,n+t);this._listenerCounts.set(e,r),this.render()}_isNameInteractive(){return(this._listenerCounts.get(`mint-name-click`)||0)>0||typeof this._onMintNameClick==`function`}_emitNameClick(e){let t=new CustomEvent(`mint-name-click`,{detail:{name:this._getName(),originalEvent:e},bubbles:!0,composed:!0});this.dispatchEvent(t),typeof this._onMintNameClick==`function`&&this._onMintNameClick(t)}render(){this._container||(this._container=document.createElement(`section`),this._container.className=`mb-4`,this.appendChild(this._container)),this._title||(this._title=document.createElement(`button`),this._title.setAttribute(`type`,`button`),this._title.className=`mb-2 w-full`,this._titleLabel=document.createElement(`mint-text`),this._titleLabel.setAttribute(`size`,`small`),this._titleLabel.setAttribute(`bold`,`true`),this._titleCaret=document.createElement(`mint-icon`),this._titleCaret.setAttribute(`name`,`caret-right`),this._titleCaret.className=`ml-auto inline-flex h-4 w-4 shrink-0 text-gray-500 dark:text-gray-400`,this._title.appendChild(this._titleLabel),this._title.appendChild(this._titleCaret),this._titleClickHandler=e=>{this._isNameInteractive()&&(e instanceof KeyboardEvent&&e.key!==`Enter`&&e.key!==` `||(e instanceof KeyboardEvent&&e.key===` `&&e.preventDefault(),this._emitNameClick(e)))},this._title.addEventListener(`click`,this._titleClickHandler),this._title.addEventListener(`keydown`,this._titleClickHandler),this._container.appendChild(this._title));let e=this._getName(),t=this._isNameInteractive();this._titleLabel&&(this._titleLabel.textContent=e,this._titleLabel.className=`uppercase tracking-wide text-gray-500 dark:text-gray-400`),this._title&&(this._title.className=t?[`mb-2`,`w-full`,`inline-flex`,`items-center`,`gap-2`,`rounded-lg`,`border`,`border-transparent`,`px-3`,`py-2`,`text-left`,`hover:bg-black/5`,`dark:hover:bg-white/10`,`cursor-pointer`,`focus-visible:outline-none`,`focus-visible:ring-2`,`focus-visible:ring-black/20`,`dark:focus-visible:ring-white/20`].join(` `):`mb-2 w-full inline-flex items-center gap-2 rounded-lg border border-transparent px-3 py-2 text-left cursor-default`,this._title.tabIndex=t?0:-1,this._title.disabled=!t,this._title.setAttribute(`aria-disabled`,String(!t))),this._titleCaret&&(this._titleCaret.style.display=t?``:`none`,this._titleCaret.setAttribute(`aria-hidden`,String(!t))),e.trim().length===0?(this._title.classList.add(`hidden`),this._title.classList.remove(`block`,`mb-2`)):(this._title.classList.remove(`hidden`),this._title.classList.add(`block`,`mb-2`)),this._list||(this._list=document.createElement(`div`),this._list.className=`space-y-1`,this._container.appendChild(this._list)),Array.from(this.children).filter(e=>e!==this._container&&e.tagName===`MINT-SIDENAV-LINK`).forEach(e=>{this._list&&e.parentElement!==this._list&&this._list.appendChild(e)})}};customElements.get(`mint-sidenav-links`)||customElements.define(`mint-sidenav-links`,F);var I=class extends HTMLElement{static get observedAttributes(){return[`separated`]}connectedCallback(){this.render()}attributeChangedCallback(e,t,n){t!==n&&this.render()}_isSeparated(){return this.getAttribute(`separated`)===`true`}render(){this.className=this._isSeparated()?`block w-full mt-2 border-t border-gray-200 pt-2 px-2 pb-2 dark:border-mint-divider`:`block w-full p-2`}};customElements.get(`mint-sidenav-action-links`)||customElements.define(`mint-sidenav-action-links`,I);var L=class extends HTMLElement{constructor(...e){super(...e),this._wrapper=null,this._trigger=null,this._popover=null,this._triggerId=``}static get observedAttributes(){return[`title`,`subtitle`]}connectedCallback(){this.classList.add(`block`),this._triggerId=this.id?`${this.id}-trigger`:`mint-sidenav-action-menu-${Math.random().toString(36).slice(2,9)}`,this.render()}attributeChangedCallback(e,t,n){t!==n&&this.render()}_getTitle(){return this.getAttribute(`title`)||``}_getSubtitle(){return this.getAttribute(`subtitle`)||``}_createDefaultGroup(){let e=document.createElement(`mint-sidenav-action-links`),t=document.createElement(`div`);return t.appendChild(e),t}render(){let e=Array.from(this.children).filter(e=>e!==this._wrapper&&e.getAttribute(`slot`)===`action-links`);this._wrapper||(this._wrapper=document.createElement(`div`),this._wrapper.className=`relative`,this.appendChild(this._wrapper)),this._wrapper.innerHTML=``,this._trigger=document.createElement(`button`),this._trigger.type=`button`,this._trigger.id=this._triggerId,this._trigger.className=`flex w-full cursor-pointer items-center gap-3 rounded-xl border border-gray-200 bg-gray-50 px-3 py-2 text-left hover:bg-gray-100 dark:border-mint-divider dark:bg-white/5 dark:hover:bg-white/10`;let t=document.createElement(`div`);t.className=`inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-gray-700 text-xs font-semibold text-white dark:bg-mint-nav`,t.textContent=this._getTitle().split(` `).map(e=>e[0]).join(``).slice(0,2).toUpperCase();let n=document.createElement(`div`);n.className=`min-w-0 flex-1`;let r=document.createElement(`mint-text`);r.setAttribute(`size`,`body`),r.setAttribute(`bold`,`true`),r.className=`truncate text-gray-900 dark:text-gray-100`,r.textContent=this._getTitle();let i=document.createElement(`mint-text`);i.setAttribute(`size`,`small`),i.setAttribute(`variant`,`muted`),i.className=`truncate`,i.textContent=this._getSubtitle(),n.appendChild(r),n.appendChild(i),this._trigger.appendChild(t),this._trigger.appendChild(n),this._popover=document.createElement(`mint-popover`),this._popover.setAttribute(`trigger-id`,this._triggerId),this._popover.setAttribute(`direction`,`right`),this._popover.setAttribute(`padding`,`0`);let a=document.createElement(`div`);a.className=`w-64`,e.length>0?e.forEach(e=>{e.setAttribute(`hidden`,`true`);let t=e.cloneNode(!0);t.removeAttribute(`hidden`),t.removeAttribute(`slot`),a.appendChild(t)}):a.appendChild(this._createDefaultGroup()),this._popover.appendChild(a),this._wrapper.appendChild(this._trigger),this._wrapper.appendChild(this._popover)}};customElements.get(`mint-sidenav-action-menu`)||customElements.define(`mint-sidenav-action-menu`,L);var R=class extends HTMLElement{constructor(...e){super(...e),this._backdrop=null,this._container=null,this._header=null,this._content=null,this._footer=null,this._escapeHandler=null,this._mediaQuery=null,this._mediaListener=null}static get observedAttributes(){return[`user-name`,`user-status`,`open`,`drawer-top-class`]}connectedCallback(){this.classList.add(`relative`,`block`,`shrink-0`,`w-0`,`overflow-visible`,`min-[1100px]:w-[17rem]`,`min-[1100px]:shrink-0`),this._attachEscapeListener(),this._attachMediaListener(),this.render()}disconnectedCallback(){this._detachEscapeListener(),this._detachMediaListener()}attributeChangedCallback(e,t,n){t!==n&&this.render()}_attachEscapeListener(){this._escapeHandler||(this._escapeHandler=e=>{e.key===`Escape`&&this.getAttribute(`open`)===`true`&&this.removeAttribute(`open`)},document.addEventListener(`keydown`,this._escapeHandler))}_detachEscapeListener(){this._escapeHandler&&=(document.removeEventListener(`keydown`,this._escapeHandler),null)}_attachMediaListener(){this._mediaListener||(this._mediaQuery=window.matchMedia(`(min-width: 1100px)`),this._mediaListener=()=>{this._mediaQuery?.matches&&this.removeAttribute(`open`)},this._mediaQuery.addEventListener(`change`,this._mediaListener))}_detachMediaListener(){this._mediaQuery&&this._mediaListener&&this._mediaQuery.removeEventListener(`change`,this._mediaListener),this._mediaQuery=null,this._mediaListener=null}getUserName(){return this.getAttribute(`user-name`)||`Acme Inc`}getUserStatus(){return this.getAttribute(`user-status`)||`Enterprise`}_isOpen(){return this.getAttribute(`open`)===`true`}_ensureBackdrop(){this._backdrop||(this._backdrop=document.createElement(`div`),this._backdrop.setAttribute(`aria-hidden`,`true`),this._backdrop.addEventListener(`click`,()=>this.removeAttribute(`open`)),this.insertBefore(this._backdrop,this.firstChild))}_ensureContainer(){this._container||(this._container=document.createElement(`aside`),this.appendChild(this._container))}_syncShell(){let e=`max-[1099.98px]:top-14`,t=this._isOpen();if(this._backdrop&&(this._backdrop.className=[`fixed`,e,`left-0`,`right-0`,`bottom-0`,`z-40`,`bg-black/50`,`transition-opacity`,`duration-200`,`min-[1100px]:hidden`,t?`pointer-events-auto opacity-100`:`pointer-events-none opacity-0`].join(` `)),this._container){let n=t?`max-[1099.98px]:translate-x-0`:`max-[1099.98px]:-translate-x-full`;this._container.className=[`flex`,`min-h-0`,`flex-col`,`border-r`,`border-gray-200`,`bg-white`,`p-2`,`dark:border-mint-divider`,`dark:bg-mint-nav`,`w-[4.75rem]`,`max-[1099.98px]:fixed`,e,`max-[1099.98px]:bottom-0`,`max-[1099.98px]:left-0`,`max-[1099.98px]:z-50`,`max-[1099.98px]:h-auto`,`max-[1099.98px]:w-[17rem]`,`max-[1099.98px]:max-w-[85vw]`,`max-[1099.98px]:shadow-xl`,`max-[1099.98px]:transition-transform`,`max-[1099.98px]:duration-200`,`max-[1099.98px]:ease-out`,n,`min-[1100px]:fixed`,`min-[1100px]:left-0`,`min-[1100px]:top-14`,`min-[1100px]:bottom-0`,`min-[1100px]:z-[60]`,`min-[1100px]:w-[17rem]`,`min-[1100px]:p-3`,`min-[1100px]:shadow-none`].join(` `)}}_buildUserHeader(){if(!this._container)return;this._header||(this._header=document.createElement(`div`),this._header.className=`mb-4`,this._container.appendChild(this._header));let e=Array.from(this.querySelectorAll(`[slot="action-header"]`)).find(e=>e!==this._backdrop&&e!==this._container);if(e){this._header.replaceChildren(e);return}let t=document.createElement(`mint-sidenav-action-menu`);t.setAttribute(`title`,this.getUserName()),t.setAttribute(`subtitle`,this.getUserStatus()),this._header.replaceChildren(t)}_replaceSlottedChildren(e,t){let n=Array.from(this.querySelectorAll(`[slot="${t}"]`)).filter(e=>e!==this._container&&e!==this._backdrop);e.replaceChildren(...n)}_buildContent(){this._container&&(this._content||(this._content=document.createElement(`div`),this._content.className=`min-h-0 grow overflow-y-auto`,this._container.appendChild(this._content)),this._replaceSlottedChildren(this._content,`links`))}_buildFooter(){if(!this._container)return;this._footer||(this._footer=document.createElement(`div`),this._footer.className=`mt-auto border-t border-gray-200 py-3 dark:border-mint-divider`,this._container.appendChild(this._footer));let e=document.createElement(`div`);e.className=`space-y-1`,this._replaceSlottedChildren(e,`bottom-links`),this._footer.innerHTML=``,this._footer.appendChild(e)}render(){this._ensureBackdrop(),this._ensureContainer(),this._syncShell(),this._buildUserHeader(),this._buildContent(),this._buildFooter()}};customElements.get(`mint-side-navigation`)||customElements.define(`mint-side-navigation`,R);var z=class extends HTMLElement{constructor(...e){super(...e),this._bar=null,this._menuButton=null,this._logoLink=null,this._menuClickHandler=null,this._darkModeObserver=null,this._resizeHandler=null,this._desktopSearchInput=null,this._desktopSearchShell=null,this._mobileSearchButton=null,this._searchPanel=null,this._searchPanelInput=null,this._searchResultsWrap=null,this._searchStateWrap=null,this._searchDebounceId=null,this._searchAbortController=null,this._searchOpen=!1,this._searchQuery=``,this._globalKeydownHandler=null,this._docClickHandler=null}static get observedAttributes(){return[`logo-src`,`logo-src-light`,`logo-src-dark`,`logo-src-mobile`,`logo-src-mobile-light`,`logo-src-mobile-dark`,`logo-href`,`logo-alt`,`menu-target`,`search-endpoint`,`search-param`,`search-placeholder`]}connectedCallback(){this.classList.add(`relative`,`block`,`h-14`,`w-full`,`shrink-0`),this._observeDarkMode(),this._attachResizeListener(),this._attachGlobalHandlers(),this.render()}disconnectedCallback(){this._menuButton&&this._menuClickHandler&&(this._menuButton.removeEventListener(`click`,this._menuClickHandler),this._menuClickHandler=null),this._disconnectDarkModeObserver(),this._detachResizeListener(),this._detachGlobalHandlers(),this._cancelSearchDebounce(),this._abortSearch()}attributeChangedCallback(e,t,n){t!==n&&this.render()}_isDarkMode(){return document.documentElement.classList.contains(`dark`)}_isMobileViewport(){return window.matchMedia(`(max-width: 1099.98px)`).matches}_getLogoSrc(){let e=this.getAttribute(`logo-src`)||``,t=this.getAttribute(`logo-src-light`)||``,n=this.getAttribute(`logo-src-dark`)||``,r=this.getAttribute(`logo-src-mobile`)||``,i=this.getAttribute(`logo-src-mobile-light`)||``,a=this.getAttribute(`logo-src-mobile-dark`)||``,o=this._isDarkMode(),s=this._isMobileViewport();return s&&o?a||r||n||t||e:s&&!o?i||r||t||n||e:o?n||t||e:t||n||e}_getLogoHref(){return this.getAttribute(`logo-href`)||`/`}_getLogoAlt(){return this.getAttribute(`logo-alt`)||`Home`}_getMenuTargetId(){return(this.getAttribute(`menu-target`)||``).replace(/^#/,``)}_getSearchEndpoint(){return(this.getAttribute(`search-endpoint`)||``).trim()}_getSearchParam(){return(this.getAttribute(`search-param`)||`q`).trim()||`q`}_getSearchPlaceholder(){return this.getAttribute(`search-placeholder`)||`Search`}_isSearchEnabled(){return!!this._getSearchEndpoint()}_attachGlobalHandlers(){this._globalKeydownHandler||(this._globalKeydownHandler=e=>{let t=e.key.toLowerCase();if((e.metaKey||e.ctrlKey)&&t===`k`){e.preventDefault(),this._openSearch(!0);return}t===`escape`&&this._searchOpen&&this._closeSearch()},document.addEventListener(`keydown`,this._globalKeydownHandler)),this._docClickHandler||(this._docClickHandler=e=>{if(!this._searchOpen)return;let t=e.target;t&&(this.contains(t)||this._closeSearch())},document.addEventListener(`click`,this._docClickHandler))}_detachGlobalHandlers(){this._globalKeydownHandler&&=(document.removeEventListener(`keydown`,this._globalKeydownHandler),null),this._docClickHandler&&=(document.removeEventListener(`click`,this._docClickHandler),null)}_cancelSearchDebounce(){this._searchDebounceId!==null&&(window.clearTimeout(this._searchDebounceId),this._searchDebounceId=null)}_abortSearch(){this._searchAbortController&&=(this._searchAbortController.abort(),null)}_openSearch(e=!1){if(this._isSearchEnabled()&&(this._searchOpen=!0,this._syncSearchPanelVisibility(),e)){let e=this._isMobileViewport()?this._searchPanelInput:this._desktopSearchInput;e?.focus(),e?.select()}}_closeSearch(){this._searchOpen=!1,this._syncSearchPanelVisibility()}_syncSearchPanelVisibility(){this._searchPanel&&(this._searchPanel.classList.toggle(`hidden`,!this._searchOpen),this._syncDesktopSearchOpenState(),this._positionSearchPanel())}_syncDesktopSearchOpenState(){this._desktopSearchShell&&(this._desktopSearchShell.classList.toggle(`rounded-b-none`,this._searchOpen),this._desktopSearchShell.classList.toggle(`border-b-transparent`,this._searchOpen))}_positionSearchPanel(){if(!this._searchPanel)return;if(this._isMobileViewport()||!this._desktopSearchShell){this._searchPanel.style.left=``,this._searchPanel.style.right=``,this._searchPanel.style.top=``,this._searchPanel.style.width=``,this._searchPanel.style.maxWidth=``,this._searchPanel.style.transform=``;return}let e=this._desktopSearchShell.getBoundingClientRect();this._searchPanel.style.left=`${e.left}px`,this._searchPanel.style.right=`auto`,this._searchPanel.style.top=`${e.bottom-1}px`,this._searchPanel.style.width=`${e.width}px`,this._searchPanel.style.maxWidth=`${e.width}px`,this._searchPanel.style.transform=`none`}_setSearchQuery(e){this._searchQuery=e,this._desktopSearchInput&&this._desktopSearchInput.value!==e&&(this._desktopSearchInput.value=e),this._searchPanelInput&&this._searchPanelInput.value!==e&&(this._searchPanelInput.value=e)}_normalizeResults(e){return(e=>{if(Array.isArray(e))return e;if(!e||typeof e!=`object`)return[];let t=e;for(let e of[`results`,`items`,`data`,`products`]){let n=t[e];if(Array.isArray(n))return n}return[]})(e).map(e=>{let t=e||{};return{title:String(t.title||t.name||t.label||t.email||t.id||``).trim()||`Untitled`,subtitle:String(t.description||t.category||t.username||``).trim()}}).slice(0,8)}_renderSearchState(e){this._searchStateWrap&&(this._searchStateWrap.textContent=e,this._searchStateWrap.classList.remove(`hidden`),this._searchResultsWrap&&(this._searchResultsWrap.innerHTML=``))}_renderSearchResults(e){if(!(!this._searchResultsWrap||!this._searchStateWrap)){if(this._searchResultsWrap.innerHTML=``,e.length===0){this._renderSearchState(`No results found`);return}this._searchStateWrap.classList.add(`hidden`);for(let t of e){let e=document.createElement(`button`);e.type=`button`,e.className=`flex w-full cursor-pointer items-start gap-3 rounded-lg px-3 py-2 text-left hover:bg-gray-100 dark:hover:bg-white/10`;let n=document.createElement(`mint-icon`);n.setAttribute(`name`,`search`),n.className=`mt-0.5 h-4 w-4 text-gray-500 dark:text-gray-400`;let r=document.createElement(`div`);r.className=`min-w-0`;let i=document.createElement(`div`);if(i.className=`truncate text-sm font-semibold text-gray-900 dark:text-gray-100`,i.textContent=t.title,r.appendChild(i),t.subtitle){let e=document.createElement(`div`);e.className=`truncate text-xs text-gray-500 dark:text-gray-400`,e.textContent=t.subtitle,r.appendChild(e)}e.appendChild(n),e.appendChild(r),e.addEventListener(`click`,()=>{this.dispatchEvent(new CustomEvent(`search-select`,{detail:{query:this._searchQuery,result:t},bubbles:!0,composed:!0})),this._closeSearch()}),this._searchResultsWrap.appendChild(e)}}}_fetchSearchResults(e){let t=this._getSearchEndpoint();if(!t)return;let n=e.trim();if(!n){this._renderSearchState(`Start typing to search`);return}this._abortSearch(),this._searchAbortController=new AbortController,this._renderSearchState(`Searching...`);let r=t.includes(`{query}`)?t.replace(`{query}`,encodeURIComponent(n)):`${t}${t.includes(`?`)?`&`:`?`}${encodeURIComponent(this._getSearchParam())}=${encodeURIComponent(n)}`;fetch(r,{signal:this._searchAbortController.signal}).then(e=>{if(!e.ok)throw Error(`Request failed: ${e.status}`);return e.json()}).then(e=>{let t=this._normalizeResults(e);this._renderSearchResults(t)}).catch(e=>{e?.name!==`AbortError`&&this._renderSearchState(`Unable to load results`)})}_scheduleSearch(e){this._setSearchQuery(e),this._cancelSearchDebounce(),this._searchDebounceId=window.setTimeout(()=>this._fetchSearchResults(e),220)}_observeDarkMode(){this._darkModeObserver||(this._darkModeObserver=new MutationObserver(()=>this.render()),this._darkModeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}))}_disconnectDarkModeObserver(){this._darkModeObserver&&=(this._darkModeObserver.disconnect(),null)}_attachResizeListener(){this._resizeHandler||(this._resizeHandler=()=>{this.render(),this._positionSearchPanel()},window.addEventListener(`resize`,this._resizeHandler,{passive:!0}))}_detachResizeListener(){this._resizeHandler&&=(window.removeEventListener(`resize`,this._resizeHandler),null)}_toggleMenuTarget(){let e=this._getMenuTargetId();if(!e)return;let t=document.getElementById(e);!t||t.tagName!==`MINT-SIDE-NAVIGATION`||(t.getAttribute(`open`)===`true`?t.removeAttribute(`open`):t.setAttribute(`open`,`true`))}render(){if(this._bar||(this._bar=document.createElement(`div`),this._bar.className=`fixed inset-x-0 top-0 z-50 flex h-14 w-full items-center gap-2 border-b border-gray-200 bg-white px-3 dark:border-mint-divider dark:bg-mint-nav`,this.appendChild(this._bar)),!this._menuButton){this._menuButton=document.createElement(`button`),this._menuButton.type=`button`,this._menuButton.className=`inline-flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-transparent text-gray-700 hover:bg-black/5 min-[1100px]:hidden dark:text-gray-200 dark:hover:bg-white/10`,this._menuButton.setAttribute(`aria-label`,`Open navigation menu`);let e=document.createElement(`mint-icon`);e.setAttribute(`name`,`menu`),e.className=`h-5 w-5`,this._menuButton.appendChild(e),this._menuClickHandler=()=>this._toggleMenuTarget(),this._menuButton.addEventListener(`click`,this._menuClickHandler),this._bar.appendChild(this._menuButton)}let e=!!this._getMenuTargetId();this._menuButton.classList.toggle(`hidden`,!e),this._logoLink||(this._logoLink=document.createElement(`a`),this._logoLink.className=`flex h-8 w-40 shrink-0 items-center`,this._bar.appendChild(this._logoLink)),this._logoLink.href=this._getLogoHref(),this._logoLink.setAttribute(`aria-label`,this._getLogoAlt());let t=this._getLogoSrc();if(t){let e=document.createElement(`img`);e.className=`h-full w-full object-contain [aspect-ratio:5/1]`,e.decoding=`async`,e.src=t,e.alt=this._getLogoAlt(),this._logoLink.replaceChildren(e),this._logoLink.classList.remove(`pointer-events-none`,`opacity-40`)}else{this._logoLink.replaceChildren(),this._logoLink.classList.add(`pointer-events-none`,`opacity-40`);let e=document.createElement(`span`);e.className=`text-sm font-semibold text-gray-400 dark:text-gray-500`,e.textContent=`Logo`,this._logoLink.appendChild(e)}let n=this._isSearchEnabled(),r=this._bar.querySelector(`[data-mint-topnav-center]`);if(r||(r=document.createElement(`div`),r.setAttribute(`data-mint-topnav-center`,`true`),r.className=`max-[1099.98px]:hidden min-[1100px]:flex min-[1100px]:min-w-0 min-[1100px]:flex-1 min-[1100px]:justify-center min-[1100px]:px-4`,this._bar.appendChild(r)),r.classList.toggle(`min-[1100px]:hidden`,!n),n&&!this._desktopSearchInput){let e=document.createElement(`div`);e.className=`relative w-full max-w-xl rounded-xl border border-gray-300 bg-gray-50 px-3 py-2 dark:border-mint-divider dark:bg-mint-hover`,this._desktopSearchShell=e;let t=document.createElement(`mint-icon`);t.setAttribute(`name`,`search`),t.className=`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-500 dark:text-gray-400`,this._desktopSearchInput=document.createElement(`input`),this._desktopSearchInput.type=`search`,this._desktopSearchInput.className=`w-full bg-transparent pl-6 pr-20 text-sm text-gray-900 outline-none placeholder:text-gray-500 dark:text-gray-100 dark:placeholder:text-gray-400`,this._desktopSearchInput.placeholder=this._getSearchPlaceholder(),this._desktopSearchInput.addEventListener(`focus`,()=>this._openSearch(!1)),this._desktopSearchInput.addEventListener(`input`,e=>this._scheduleSearch(e.target.value));let n=document.createElement(`span`);n.className=`absolute right-3 top-1/2 -translate-y-1/2 text-xs text-gray-500 dark:text-gray-400`,n.textContent=`⌘K`,e.appendChild(t),e.appendChild(this._desktopSearchInput),e.appendChild(n),r.appendChild(e)}this._desktopSearchInput&&(this._desktopSearchInput.placeholder=this._getSearchPlaceholder(),this._desktopSearchShell=this._desktopSearchInput.closest(`div`),this._syncDesktopSearchOpenState());let i=this._bar.querySelector(`[data-mint-topnav-mobile-spacer]`);i||(i=document.createElement(`div`),i.setAttribute(`data-mint-topnav-mobile-spacer`,`true`),i.className=`min-w-0 flex-1 min-[1100px]:hidden`,this._bar.appendChild(i));let a=Array.from(this.querySelectorAll(`[slot="actions"]`)),o=this._bar.querySelector(`[data-mint-topnav-actions]`);if(o||(o=document.createElement(`div`),o.setAttribute(`data-mint-topnav-actions`,`true`),o.className=`flex shrink-0 items-center gap-2`,this._bar.appendChild(o)),n&&!this._mobileSearchButton){this._mobileSearchButton=document.createElement(`button`),this._mobileSearchButton.type=`button`,this._mobileSearchButton.className=`inline-flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-transparent text-gray-700 hover:bg-black/5 min-[1100px]:hidden dark:text-gray-200 dark:hover:bg-white/10`,this._mobileSearchButton.setAttribute(`aria-label`,`Open search`);let e=document.createElement(`mint-icon`);e.setAttribute(`name`,`search`),e.className=`h-5 w-5`,this._mobileSearchButton.appendChild(e),this._mobileSearchButton.addEventListener(`click`,()=>this._openSearch(!0)),o.insertBefore(this._mobileSearchButton,o.firstChild)}if(this._mobileSearchButton&&this._mobileSearchButton.classList.toggle(`hidden`,!n),o.replaceChildren(...a),n&&this._mobileSearchButton&&!a.includes(this._mobileSearchButton)&&o.insertBefore(this._mobileSearchButton,o.firstChild),n&&!this._searchPanel){this._searchPanel=document.createElement(`div`),this._searchPanel.className=`fixed left-0 right-0 top-14 z-[90] hidden p-3 min-[1100px]:p-0`;let e=document.createElement(`div`);e.className=`mx-auto w-full rounded-2xl border border-gray-200 bg-white shadow-xl dark:border-mint-divider dark:bg-mint-elevated min-[1100px]:rounded-t-none`;let t=document.createElement(`div`);t.className=`relative border-b border-gray-200 p-3 dark:border-mint-divider min-[1100px]:hidden`;let n=document.createElement(`mint-icon`);n.setAttribute(`name`,`search`),n.className=`absolute left-6 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-500 dark:text-gray-400`,this._searchPanelInput=document.createElement(`input`),this._searchPanelInput.type=`search`,this._searchPanelInput.className=`w-full rounded-lg border border-gray-300 bg-gray-50 py-2 pl-10 pr-3 text-sm text-gray-900 outline-none dark:border-mint-divider dark:bg-mint-hover dark:text-gray-100`,this._searchPanelInput.placeholder=this._getSearchPlaceholder(),this._searchPanelInput.addEventListener(`input`,e=>this._scheduleSearch(e.target.value)),t.appendChild(n),t.appendChild(this._searchPanelInput);let r=document.createElement(`div`);r.className=`flex flex-wrap gap-2 px-3 py-3`,[`Apps`,`Customers`,`Orders`,`Products`,`Sales channels`].forEach(e=>{let t=document.createElement(`span`);t.className=`rounded-full bg-gray-100 px-3 py-1 text-xs font-semibold text-gray-600 dark:bg-mint-hover dark:text-gray-300`,t.textContent=e,r.appendChild(t)}),this._searchStateWrap=document.createElement(`div`),this._searchStateWrap.className=`px-4 pb-4 text-sm text-gray-500 dark:text-gray-400`,this._searchStateWrap.textContent=`Start typing to search`,this._searchResultsWrap=document.createElement(`div`),this._searchResultsWrap.className=`max-h-[52vh] overflow-y-auto px-2 pb-2`,e.appendChild(t),e.appendChild(r),e.appendChild(this._searchStateWrap),e.appendChild(this._searchResultsWrap),this._searchPanel.appendChild(e),this.appendChild(this._searchPanel)}this._searchPanelInput&&(this._searchPanelInput.placeholder=this._getSearchPlaceholder()),this._syncSearchPanelVisibility(),this._positionSearchPanel()}};customElements.get(`mint-top-navigation`)||customElements.define(`mint-top-navigation`,z);var B=class extends HTMLElement{constructor(...e){super(...e),this._lastScrollY=0,this._scrollHandler=null}connectedCallback(){this.classList.add(`fixed`,`bottom-0`,`left-0`,`right-0`,`z-30`,`flex`,`w-full`,`items-stretch`,`justify-around`,`gap-1`,`border-t`,`border-gray-200`,`bg-white`,`px-1`,`pt-1`,`pb-[env(safe-area-inset-bottom,0px)]`,`min-[1100px]:hidden`,`transition-transform`,`duration-200`,`ease-out`,`translate-y-0`,`dark:border-mint-divider`,`dark:bg-mint-nav`),this.setAttribute(`role`,`navigation`),this.setAttribute(`aria-label`,`Primary`),this._lastScrollY=window.scrollY,this._attachScrollListener()}disconnectedCallback(){this._detachScrollListener()}_attachScrollListener(){this._scrollHandler||(this._scrollHandler=()=>{let e=window.scrollY;if(e<=8){this.classList.remove(`translate-y-full`),this.classList.add(`translate-y-0`),this._lastScrollY=e;return}let t=e-this._lastScrollY;Math.abs(t)<4||(t>0?(this.classList.remove(`translate-y-0`),this.classList.add(`translate-y-full`)):(this.classList.remove(`translate-y-full`),this.classList.add(`translate-y-0`)),this._lastScrollY=e)},window.addEventListener(`scroll`,this._scrollHandler,{passive:!0}))}_detachScrollListener(){this._scrollHandler&&=(window.removeEventListener(`scroll`,this._scrollHandler),null)}};customElements.get(`mint-bottom-navigation`)||customElements.define(`mint-bottom-navigation`,B);var V=class extends HTMLElement{constructor(...e){super(...e),this._root=null}static get observedAttributes(){return[`icon`,`label`,`href`,`active`]}connectedCallback(){this.classList.add(`contents`),this.render()}attributeChangedCallback(e,t,n){t!==n&&this.render()}_isActive(){return this.getAttribute(`active`)===`true`}_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=r?`text-gray-900 dark:text-gray-100`:`text-gray-600 hover:bg-black/5 dark:text-gray-300 dark:hover:bg-white/10`,a;e?(a=document.createElement(`a`),a.href=e):(a=document.createElement(`button`),a.type=`button`),a.className=`flex min-w-0 flex-1 flex-col items-center justify-center gap-1 rounded-lg px-1 py-2 text-center text-[11px] font-medium leading-tight ${i}`,a.setAttribute(`aria-current`,r?`page`:`false`),a.setAttribute(`aria-label`,t||`Navigation item`);let o=document.createElement(`span`);if(o.className=`inline-flex h-6 w-6 items-center justify-center`,n){let e=document.createElement(`mint-icon`);e.setAttribute(`name`,n),e.className=r?`h-6 w-6`:`h-6 w-6 opacity-90`,o.appendChild(e)}let s=document.createElement(`span`);s.className=`block w-full truncate`,s.textContent=t,a.appendChild(o),a.appendChild(s),this.replaceChildren(a),this._root=a}};customElements.get(`mint-bottom-nav-item`)||customElements.define(`mint-bottom-nav-item`,V),exports.Alert=E,exports.BackButton=l,exports.BottomNavItem=V,exports.BottomNavigation=B,exports.Button=r,exports.default=r,exports.Card=s,exports.Chart=N,exports.Checkbox=m,exports.Chip=C,exports.Choice=g,exports.Clickable=T,exports.DatePicker=v,exports.Dropzone=b,exports.Form=x,exports.Grid=d,exports.Icon=n,exports.Input=_,exports.Link=c,exports.Modal=f,exports.OffCanvas=O,exports.Page=u,exports.Popover=p,exports.ResourceTable=D,exports.Select=y,exports.SideNavigation=R,exports.SideNavigationActionLinks=I,exports.SideNavigationActionMenu=L,exports.SideNavigationLink=P,exports.SideNavigationLinks=F,exports.Spinner=t,exports.Stack=o,exports.Switch=i,exports.Tab=k,exports.TabContent=j,exports.TabList=A,exports.Table=S,exports.Tabs=M,exports.Tags=w,exports.Text=a,exports.TopNavigation=z;
|
|
196
|
+
`,a.textContent=e.name,i.appendChild(a),t.appendChild(i)}),this._svg.appendChild(t),{height:this._legendHeight+50}}async addDataPoint(e,t){return!this._chartData||!this._chartData.datasets[e]?(console.error(`Dataset at index ${e} does not exist`),Promise.reject(Error(`Dataset at index ${e} does not exist`))):(this._chartData.datasets[e].data.push(t),this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender(),new Promise(e=>requestAnimationFrame(()=>e())))}async batchAddDataPoints(e){if(!this._chartData)return Promise.resolve();let t=!1;for(let{datasetIndex:n,point:r}of e)this._chartData.datasets[n]&&(this._chartData.datasets[n].data.push(r),t=!0);return t&&(this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender()),new Promise(e=>requestAnimationFrame(()=>e()))}async updateDatasetData(e,t){return!this._chartData||!this._chartData.datasets[e]?(console.error(`Dataset at index ${e} does not exist`),Promise.reject(Error(`Dataset at index ${e} does not exist`))):(this._chartData.datasets[e].data=t,this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender(),new Promise(e=>requestAnimationFrame(()=>e())))}async addDataset(e){return this._chartData?(this._chartData.datasets.push(e),e.id&&this._datasetVisibility.set(e.id,e.visible!==!1),this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender(),new Promise(e=>requestAnimationFrame(()=>e()))):(console.error(`Chart data not initialized`),Promise.reject(Error(`Chart data not initialized`)))}async removeDataset(e){return!this._chartData||!this._chartData.datasets[e]?(console.error(`Dataset at index ${e} does not exist`),Promise.reject(Error(`Dataset at index ${e} does not exist`))):(this._chartData.datasets.splice(e,1),this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender(),new Promise(e=>requestAnimationFrame(()=>e())))}async updateDataPoint(e,t,n){return!this._chartData||!this._chartData.datasets[e]?(console.error(`Dataset at index ${e} does not exist`),Promise.reject(Error(`Dataset at index ${e} does not exist`))):this._chartData.datasets[e].data[t]?(this._chartData.datasets[e].data[t]=n,this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender(),new Promise(e=>requestAnimationFrame(()=>e()))):(console.error(`Data point at index ${t} does not exist`),Promise.reject(Error(`Data point at index ${t} does not exist`)))}async batchUpdateDataPoints(e){if(!this._chartData)return Promise.resolve();let t=!1;for(let{datasetIndex:n,pointIndex:r,point:i}of e)this._chartData.datasets[n]?.data[r]&&(this._chartData.datasets[n].data[r]=i,t=!0);return t&&(this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender()),new Promise(e=>requestAnimationFrame(()=>e()))}async removeDataPoint(e,t){return!this._chartData||!this._chartData.datasets[e]?(console.error(`Dataset at index ${e} does not exist`),Promise.reject(Error(`Dataset at index ${e} does not exist`))):(this._chartData.datasets[e].data.splice(t,1),this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender(),new Promise(e=>requestAnimationFrame(()=>e())))}async batchRemoveDataPoints(e){if(!this._chartData)return Promise.resolve();let t=!1;for(let{datasetIndex:n,pointIndex:r}of e)this._chartData.datasets[n]?.data[r]&&(this._chartData.datasets[n].data.splice(r,1),t=!0);return t&&(this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender()),new Promise(e=>requestAnimationFrame(()=>e()))}async showDataset(e){return this._datasetVisibility.set(e,!0),this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender(),new Promise(e=>requestAnimationFrame(()=>e()))}async hideDataset(e){return this._datasetVisibility.set(e,!1),this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender(),new Promise(e=>requestAnimationFrame(()=>e()))}async toggleDataset(e){let t=!(this._datasetVisibility.get(e)??!0);return this._datasetVisibility.set(e,t),this._cachedBounds.dataHash=``,this._cachedYRange.dataHash=``,this._cachedXValues.dataHash=``,this._cachedTooltipContent.clear(),this._scheduleRender(),await new Promise(e=>requestAnimationFrame(()=>e())),t}isDatasetVisible(e){return this._datasetVisibility.get(e)}async downloadAsPNG(e=`chart.png`){if(!this._svg)return console.error(`Chart SVG not found`),Promise.reject(Error(`Chart SVG not found`));let t=this._svg.cloneNode(!0),n=this._width,r=this._height;t.querySelectorAll(`text`).forEach(e=>{let t=e.getAttribute(`font-family`);(!t||t.includes(`system-ui`)||t.includes(`apple-system`))&&e.setAttribute(`font-family`,`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif`)}),t.setAttribute(`width`,n.toString()),t.setAttribute(`height`,r.toString()),t.setAttribute(`xmlns`,`http://www.w3.org/2000/svg`),t.querySelectorAll(`foreignObject`).forEach(e=>{let t=e.querySelector(`div`);if(t){let n=document.createElementNS(`http://www.w3.org/2000/svg`,`text`),r=e.getAttribute(`x`)||`0`,i=e.getAttribute(`y`)||`0`;n.setAttribute(`x`,r),n.setAttribute(`y`,(parseFloat(i)+12).toString()),n.setAttribute(`fill`,t.style.color||`#374151`),n.setAttribute(`font-size`,`12`),n.setAttribute(`font-family`,t.style.fontFamily||`system-ui, -apple-system, sans-serif`),n.textContent=t.textContent||``,e.parentNode&&e.parentNode.replaceChild(n,e)}});let i=new XMLSerializer().serializeToString(t),a=`data:image/svg+xml;charset=utf-8,`+encodeURIComponent(i),o=new Image;return o.crossOrigin=`anonymous`,new Promise((t,i)=>{o.onload=()=>{setTimeout(()=>{let a=document.createElement(`canvas`);a.width=n+60,a.height=r+60;let s=a.getContext(`2d`);if(!s){console.error(`Could not get canvas context`),i(Error(`Could not get canvas context`));return}s.fillStyle=document.documentElement.classList.contains(`dark`)?`#111827`:`#ffffff`,s.fillRect(0,0,a.width,a.height),s.drawImage(o,30,30),a.toBlob(n=>{if(!n){console.error(`Could not create blob from canvas`),i(Error(`Could not create blob from canvas`));return}let r=URL.createObjectURL(n),a=document.createElement(`a`);a.href=r,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(r),t()},`image/png`)},0)},o.onerror=()=>{console.error(`Error loading SVG image`),i(Error(`Error loading SVG image`))},o.src=a})}};customElements.get(`mint-chart`)||customElements.define(`mint-chart`,N);var P=class extends HTMLElement{constructor(...e){super(...e),this._trigger=null,this._submenuContainer=null}static get observedAttributes(){return[`label`,`icon`,`href`,`active`,`expanded`,`submenu-item`]}connectedCallback(){this.classList.add(`block`),this.render()}attributeChangedCallback(e,t,n){t!==n&&(this.render(),e===`active`&&this._isSubmenuItem()&&this._refreshDropdownAncestor())}_refreshDropdownAncestor(){let e=this.parentElement;for(;e;){if(e.tagName===`MINT-SIDENAV-LINK`&&e!==this){e.render();break}e=e.parentElement}}_isActive(){return this.getAttribute(`active`)===`true`}_isExpanded(){return this.getAttribute(`expanded`)===`true`}_isSubmenuItem(){return this.getAttribute(`submenu-item`)===`true`}_getLabel(){return this.getAttribute(`label`)||``}_getIcon(){return this.getAttribute(`icon`)||``}_getHref(){return this.getAttribute(`href`)}_getBaseClasses(){let e=this._isActive()?`border-black/20 bg-black/5 text-black dark:border-white/20 dark:bg-white/10 dark:text-white`:`border-transparent text-gray-700 hover:bg-black/5 dark:text-gray-200 dark:hover:bg-white/10`;return[`w-full`,`cursor-pointer`,`rounded-lg`,`border`,`block`,this._isSubmenuItem()?`px-2 py-1.5`:`px-3 py-2`,`text-left`,`text-sm`,e].join(` `)}_hasSubmenu(){return this.querySelectorAll(`:scope > [slot="submenu"]`).length>0?!0:!!this._submenuContainer&&this._submenuContainer.children.length>0}_createRow(e,t){let n=document.createElement(`span`);if(this._isSubmenuItem(),n.className=`inline-flex w-full items-center justify-start gap-2`,t){let e=document.createElement(`mint-icon`);e.setAttribute(`name`,t),e.className=`h-4 w-4 shrink-0`,n.appendChild(e)}let r=document.createElement(`span`);return r.className=`inline truncate`,r.textContent=e,n.appendChild(r),n}_buildSimpleLink(){let e=this._getHref(),t=this._getLabel(),n=this._getIcon(),r=e?document.createElement(`a`):document.createElement(`button`);e?(r.setAttribute(`href`,e),r.setAttribute(`role`,`link`)):r.setAttribute(`type`,`button`),r.className=this._getBaseClasses(),r.setAttribute(`aria-label`,t||`Side navigation link`),r.appendChild(this._createRow(t,n)),this.replaceChildren(r),this._trigger=r}_buildDropdownLink(){let e=this._getLabel(),t=this._getIcon(),n=Array.from(this.querySelectorAll(`:scope > [slot="submenu"]`)),r=n.length>0?n:this._submenuContainer?Array.from(this._submenuContainer.children):[],i=document.createElement(`div`);i.className=`w-full`;let a=document.createElement(`button`);a.type=`button`,a.className=`${this._getBaseClasses()} block w-full`,a.setAttribute(`aria-expanded`,String(this._isExpanded())),a.appendChild(this._createRow(e,t)),a.onclick=()=>{this.setAttribute(`expanded`,this._isExpanded()?`false`:`true`)},this._submenuContainer=document.createElement(`div`),this._submenuContainer.className=[`mt-1`,`ml-5`,`border-l`,`border-gray-200`,`pl-2`,`space-y-1`,`dark:border-mint-divider`,this._isExpanded()?`block`:`hidden`].join(` `),r.forEach(e=>{e.setAttribute(`submenu-item`,`true`),e.setAttribute(`slot`,`submenu`),this._submenuContainer?.appendChild(e)}),i.appendChild(a),i.appendChild(this._submenuContainer),this.replaceChildren(i),this._trigger=a}render(){this._hasSubmenu()&&!this._isSubmenuItem()?this._buildDropdownLink():this._buildSimpleLink()}};customElements.get(`mint-sidenav-link`)||customElements.define(`mint-sidenav-link`,P);var F=class extends HTMLElement{constructor(...e){super(...e),this._container=null,this._title=null,this._titleLabel=null,this._titleCaret=null,this._list=null,this._titleClickHandler=null,this._listenerCounts=new Map}static get observedAttributes(){return[`name`]}get onMintNameClick(){return this._onMintNameClick}set onMintNameClick(e){this._onMintNameClick=e,this.render()}addEventListener(e,t,n){super.addEventListener(e,t,n),this._trackListener(e,1)}removeEventListener(e,t,n){super.removeEventListener(e,t,n),this._trackListener(e,-1)}connectedCallback(){this.classList.add(`block`),this.render()}disconnectedCallback(){this._title&&this._titleClickHandler&&(this._title.removeEventListener(`click`,this._titleClickHandler),this._title.removeEventListener(`keydown`,this._titleClickHandler))}attributeChangedCallback(e,t,n){t!==n&&this.render()}_getName(){return this.getAttribute(`name`)||``}_trackListener(e,t){if(e!==`mint-name-click`)return;let n=this._listenerCounts.get(e)||0,r=Math.max(0,n+t);this._listenerCounts.set(e,r),this.render()}_isNameInteractive(){return(this._listenerCounts.get(`mint-name-click`)||0)>0||typeof this._onMintNameClick==`function`}_emitNameClick(e){let t=new CustomEvent(`mint-name-click`,{detail:{name:this._getName(),originalEvent:e},bubbles:!0,composed:!0});this.dispatchEvent(t),typeof this._onMintNameClick==`function`&&this._onMintNameClick(t)}render(){this._container||(this._container=document.createElement(`section`),this._container.className=`mb-4`,this.appendChild(this._container)),this._title||(this._title=document.createElement(`button`),this._title.setAttribute(`type`,`button`),this._title.className=`mb-2 w-full`,this._titleLabel=document.createElement(`mint-text`),this._titleLabel.setAttribute(`size`,`small`),this._titleLabel.setAttribute(`bold`,`true`),this._titleCaret=document.createElement(`mint-icon`),this._titleCaret.setAttribute(`name`,`caret-right`),this._titleCaret.className=`ml-auto inline-flex h-4 w-4 shrink-0 text-gray-500 dark:text-gray-400`,this._title.appendChild(this._titleLabel),this._title.appendChild(this._titleCaret),this._titleClickHandler=e=>{this._isNameInteractive()&&(e instanceof KeyboardEvent&&e.key!==`Enter`&&e.key!==` `||(e instanceof KeyboardEvent&&e.key===` `&&e.preventDefault(),this._emitNameClick(e)))},this._title.addEventListener(`click`,this._titleClickHandler),this._title.addEventListener(`keydown`,this._titleClickHandler),this._container.appendChild(this._title));let e=this._getName(),t=e.trim().length>0,n=this._isNameInteractive();this._titleLabel&&(this._titleLabel.textContent=e,this._titleLabel.className=`uppercase tracking-wide text-gray-500 dark:text-gray-400`),this._title&&(this._title.className=n?[`mb-2`,`w-full`,`inline-flex`,`items-center`,`gap-2`,`rounded-lg`,`border`,`border-transparent`,`px-3`,`py-2`,`text-left`,`hover:bg-black/5`,`dark:hover:bg-white/10`,`cursor-pointer`,`focus-visible:outline-none`,`focus-visible:ring-2`,`focus-visible:ring-black/20`,`dark:focus-visible:ring-white/20`].join(` `):`mb-2 w-full inline-flex items-center gap-2 rounded-lg border border-transparent px-3 py-2 text-left cursor-default`,this._title.tabIndex=n?0:-1,this._title.disabled=!n,this._title.setAttribute(`aria-disabled`,String(!n))),this._titleCaret&&(this._titleCaret.style.display=n?``:`none`,this._titleCaret.setAttribute(`aria-hidden`,String(!n))),t?this._title.parentElement!==this._container&&this._container?.insertBefore(this._title,this._list):this._title.parentElement===this._container&&this._container?.removeChild(this._title),this._list||(this._list=document.createElement(`div`),this._list.className=`space-y-1`,this._container.appendChild(this._list)),Array.from(this.children).filter(e=>e!==this._container&&e.tagName===`MINT-SIDENAV-LINK`).forEach(e=>{this._list&&e.parentElement!==this._list&&this._list.appendChild(e)})}};customElements.get(`mint-sidenav-links`)||customElements.define(`mint-sidenav-links`,F);var I=class extends HTMLElement{static get observedAttributes(){return[`separated`]}connectedCallback(){this.render()}attributeChangedCallback(e,t,n){t!==n&&this.render()}_isSeparated(){return this.getAttribute(`separated`)===`true`}render(){this.className=this._isSeparated()?`block w-full mt-2 border-t border-gray-200 pt-2 px-2 pb-2 dark:border-mint-divider`:`block w-full p-2`}};customElements.get(`mint-sidenav-action-links`)||customElements.define(`mint-sidenav-action-links`,I);var L=class extends HTMLElement{constructor(...e){super(...e),this._wrapper=null,this._trigger=null,this._popover=null,this._triggerId=``}static get observedAttributes(){return[`title`,`subtitle`]}connectedCallback(){this.classList.add(`block`),this._triggerId=this.id?`${this.id}-trigger`:`mint-sidenav-action-menu-${Math.random().toString(36).slice(2,9)}`,this.render()}attributeChangedCallback(e,t,n){t!==n&&this.render()}_getTitle(){return this.getAttribute(`title`)||``}_getSubtitle(){return this.getAttribute(`subtitle`)||``}_createDefaultGroup(){let e=document.createElement(`mint-sidenav-action-links`),t=document.createElement(`div`);return t.appendChild(e),t}render(){let e=Array.from(this.children).filter(e=>e!==this._wrapper&&e.getAttribute(`slot`)===`action-links`);this._wrapper||(this._wrapper=document.createElement(`div`),this._wrapper.className=`relative`,this.appendChild(this._wrapper)),this._wrapper.innerHTML=``,this._trigger=document.createElement(`button`),this._trigger.type=`button`,this._trigger.id=this._triggerId,this._trigger.className=`flex w-full cursor-pointer items-center gap-3 rounded-xl border border-gray-200 bg-gray-50 px-3 py-2 text-left hover:bg-gray-100 dark:border-mint-divider dark:bg-white/5 dark:hover:bg-white/10`;let t=document.createElement(`div`);t.className=`inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-gray-700 text-xs font-semibold text-white dark:bg-mint-nav`,t.textContent=this._getTitle().split(` `).map(e=>e[0]).join(``).slice(0,2).toUpperCase();let n=document.createElement(`div`);n.className=`min-w-0 flex-1`;let r=document.createElement(`mint-text`);r.setAttribute(`size`,`body`),r.setAttribute(`bold`,`true`),r.className=`truncate text-gray-900 dark:text-gray-100`,r.textContent=this._getTitle();let i=document.createElement(`mint-text`);i.setAttribute(`size`,`small`),i.setAttribute(`variant`,`muted`),i.className=`truncate`,i.textContent=this._getSubtitle(),n.appendChild(r),n.appendChild(i),this._trigger.appendChild(t),this._trigger.appendChild(n),this._popover=document.createElement(`mint-popover`),this._popover.setAttribute(`trigger-id`,this._triggerId),this._popover.setAttribute(`direction`,`right`),this._popover.setAttribute(`padding`,`0`);let a=document.createElement(`div`);a.className=`w-64`,e.length>0?e.forEach(e=>{e.setAttribute(`hidden`,`true`);let t=e.cloneNode(!0);t.removeAttribute(`hidden`),t.removeAttribute(`slot`),a.appendChild(t)}):a.appendChild(this._createDefaultGroup()),this._popover.appendChild(a),this._wrapper.appendChild(this._trigger),this._wrapper.appendChild(this._popover)}};customElements.get(`mint-sidenav-action-menu`)||customElements.define(`mint-sidenav-action-menu`,L);var R=class extends HTMLElement{constructor(...e){super(...e),this._backdrop=null,this._container=null,this._header=null,this._content=null,this._footer=null,this._escapeHandler=null,this._mediaQuery=null,this._mediaListener=null}static get observedAttributes(){return[`user-name`,`user-status`,`open`,`drawer-top-class`]}connectedCallback(){this.classList.add(`relative`,`block`,`shrink-0`,`w-0`,`overflow-visible`,`min-[1100px]:w-[17rem]`,`min-[1100px]:shrink-0`),this._attachEscapeListener(),this._attachMediaListener(),this.render()}disconnectedCallback(){this._detachEscapeListener(),this._detachMediaListener()}attributeChangedCallback(e,t,n){t!==n&&this.render()}_attachEscapeListener(){this._escapeHandler||(this._escapeHandler=e=>{e.key===`Escape`&&this.getAttribute(`open`)===`true`&&this.removeAttribute(`open`)},document.addEventListener(`keydown`,this._escapeHandler))}_detachEscapeListener(){this._escapeHandler&&=(document.removeEventListener(`keydown`,this._escapeHandler),null)}_attachMediaListener(){this._mediaListener||(this._mediaQuery=window.matchMedia(`(min-width: 1100px)`),this._mediaListener=()=>{this._mediaQuery?.matches&&this.removeAttribute(`open`)},this._mediaQuery.addEventListener(`change`,this._mediaListener))}_detachMediaListener(){this._mediaQuery&&this._mediaListener&&this._mediaQuery.removeEventListener(`change`,this._mediaListener),this._mediaQuery=null,this._mediaListener=null}getUserName(){return this.getAttribute(`user-name`)||`Acme Inc`}getUserStatus(){return this.getAttribute(`user-status`)||`Enterprise`}_isOpen(){return this.getAttribute(`open`)===`true`}_ensureBackdrop(){this._backdrop||(this._backdrop=document.createElement(`div`),this._backdrop.setAttribute(`aria-hidden`,`true`),this._backdrop.addEventListener(`click`,()=>this.removeAttribute(`open`)),this.insertBefore(this._backdrop,this.firstChild))}_ensureContainer(){this._container||(this._container=document.createElement(`aside`),this.appendChild(this._container))}_syncShell(){let e=`max-[1099.98px]:top-14`,t=this._isOpen();if(this._backdrop&&(this._backdrop.className=[`fixed`,e,`left-0`,`right-0`,`bottom-0`,`z-40`,`bg-black/50`,`transition-opacity`,`duration-200`,`min-[1100px]:hidden`,t?`pointer-events-auto opacity-100`:`pointer-events-none opacity-0`].join(` `)),this._container){let n=t?`max-[1099.98px]:translate-x-0`:`max-[1099.98px]:-translate-x-full`;this._container.className=[`flex`,`min-h-0`,`flex-col`,`border-r`,`border-gray-200`,`bg-white`,`p-2`,`dark:border-mint-divider`,`dark:bg-mint-nav`,`w-[4.75rem]`,`max-[1099.98px]:fixed`,e,`max-[1099.98px]:bottom-0`,`max-[1099.98px]:left-0`,`max-[1099.98px]:z-50`,`max-[1099.98px]:h-auto`,`max-[1099.98px]:w-[17rem]`,`max-[1099.98px]:max-w-[85vw]`,`max-[1099.98px]:shadow-xl`,`max-[1099.98px]:transition-transform`,`max-[1099.98px]:duration-200`,`max-[1099.98px]:ease-out`,n,`min-[1100px]:fixed`,`min-[1100px]:left-0`,`min-[1100px]:top-14`,`min-[1100px]:bottom-0`,`min-[1100px]:z-[60]`,`min-[1100px]:w-[17rem]`,`min-[1100px]:p-3`,`min-[1100px]:shadow-none`].join(` `)}}_buildUserHeader(){if(!this._container)return;this._header||(this._header=document.createElement(`div`),this._header.className=`mb-4`,this._container.appendChild(this._header));let e=Array.from(this.querySelectorAll(`[slot="action-header"]`)).find(e=>e!==this._backdrop&&e!==this._container);if(e){this._header.replaceChildren(e);return}let t=document.createElement(`mint-sidenav-action-menu`);t.setAttribute(`title`,this.getUserName()),t.setAttribute(`subtitle`,this.getUserStatus()),this._header.replaceChildren(t)}_replaceSlottedChildren(e,t){let n=Array.from(this.querySelectorAll(`[slot="${t}"]`)).filter(e=>e!==this._container&&e!==this._backdrop);e.replaceChildren(...n)}_buildContent(){this._container&&(this._content||(this._content=document.createElement(`div`),this._content.className=`min-h-0 grow overflow-y-auto`,this._container.appendChild(this._content)),this._replaceSlottedChildren(this._content,`links`))}_buildFooter(){if(!this._container)return;this._footer||(this._footer=document.createElement(`div`),this._footer.className=`mt-auto border-t border-gray-200 py-3 dark:border-mint-divider`,this._container.appendChild(this._footer));let e=document.createElement(`div`);e.className=`space-y-1`,this._replaceSlottedChildren(e,`bottom-links`),this._footer.innerHTML=``,this._footer.appendChild(e)}render(){this._ensureBackdrop(),this._ensureContainer(),this._syncShell(),this._buildUserHeader(),this._buildContent(),this._buildFooter()}};customElements.get(`mint-side-navigation`)||customElements.define(`mint-side-navigation`,R);var z=class extends HTMLElement{constructor(...e){super(...e),this._bar=null,this._menuButton=null,this._logoLink=null,this._menuClickHandler=null,this._darkModeObserver=null,this._resizeHandler=null,this._desktopSearchInput=null,this._desktopSearchShell=null,this._mobileSearchButton=null,this._searchPanel=null,this._searchPanelInput=null,this._searchResultsWrap=null,this._searchStateWrap=null,this._searchDebounceId=null,this._searchAbortController=null,this._searchOpen=!1,this._searchQuery=``,this._globalKeydownHandler=null,this._docClickHandler=null}static get observedAttributes(){return[`logo-src`,`logo-src-light`,`logo-src-dark`,`logo-src-mobile`,`logo-src-mobile-light`,`logo-src-mobile-dark`,`logo-href`,`logo-alt`,`menu-target`,`search-endpoint`,`search-param`,`search-placeholder`]}connectedCallback(){this.classList.add(`relative`,`block`,`h-14`,`w-full`,`shrink-0`),this._observeDarkMode(),this._attachResizeListener(),this._attachGlobalHandlers(),this.render()}disconnectedCallback(){this._menuButton&&this._menuClickHandler&&(this._menuButton.removeEventListener(`click`,this._menuClickHandler),this._menuClickHandler=null),this._disconnectDarkModeObserver(),this._detachResizeListener(),this._detachGlobalHandlers(),this._cancelSearchDebounce(),this._abortSearch()}attributeChangedCallback(e,t,n){t!==n&&this.render()}_isDarkMode(){return document.documentElement.classList.contains(`dark`)}_isMobileViewport(){return window.matchMedia(`(max-width: 1099.98px)`).matches}_getLogoSrc(){let e=this.getAttribute(`logo-src`)||``,t=this.getAttribute(`logo-src-light`)||``,n=this.getAttribute(`logo-src-dark`)||``,r=this.getAttribute(`logo-src-mobile`)||``,i=this.getAttribute(`logo-src-mobile-light`)||``,a=this.getAttribute(`logo-src-mobile-dark`)||``,o=this._isDarkMode(),s=this._isMobileViewport();return s&&o?a||r||n||t||e:s&&!o?i||r||t||n||e:o?n||t||e:t||n||e}_getLogoHref(){return this.getAttribute(`logo-href`)||`/`}_getLogoAlt(){return this.getAttribute(`logo-alt`)||`Home`}_getMenuTargetId(){return(this.getAttribute(`menu-target`)||``).replace(/^#/,``)}_getSearchEndpoint(){return(this.getAttribute(`search-endpoint`)||``).trim()}_getSearchParam(){return(this.getAttribute(`search-param`)||`q`).trim()||`q`}_getSearchPlaceholder(){return this.getAttribute(`search-placeholder`)||`Search`}_isSearchEnabled(){return!!this._getSearchEndpoint()}_attachGlobalHandlers(){this._globalKeydownHandler||(this._globalKeydownHandler=e=>{let t=e.key.toLowerCase();if((e.metaKey||e.ctrlKey)&&t===`k`){e.preventDefault(),this._openSearch(!0);return}t===`escape`&&this._searchOpen&&this._closeSearch()},document.addEventListener(`keydown`,this._globalKeydownHandler)),this._docClickHandler||(this._docClickHandler=e=>{if(!this._searchOpen)return;let t=e.target;t&&(this.contains(t)||this._closeSearch())},document.addEventListener(`click`,this._docClickHandler))}_detachGlobalHandlers(){this._globalKeydownHandler&&=(document.removeEventListener(`keydown`,this._globalKeydownHandler),null),this._docClickHandler&&=(document.removeEventListener(`click`,this._docClickHandler),null)}_cancelSearchDebounce(){this._searchDebounceId!==null&&(window.clearTimeout(this._searchDebounceId),this._searchDebounceId=null)}_abortSearch(){this._searchAbortController&&=(this._searchAbortController.abort(),null)}_openSearch(e=!1){if(this._isSearchEnabled()&&(this._searchOpen=!0,this._syncSearchPanelVisibility(),e)){let e=this._isMobileViewport()?this._searchPanelInput:this._desktopSearchInput;e?.focus(),e?.select()}}_closeSearch(){this._searchOpen=!1,this._syncSearchPanelVisibility()}_syncSearchPanelVisibility(){this._searchPanel&&(this._searchPanel.classList.toggle(`hidden`,!this._searchOpen),this._syncDesktopSearchOpenState(),this._positionSearchPanel())}_syncDesktopSearchOpenState(){this._desktopSearchShell&&(this._desktopSearchShell.classList.toggle(`rounded-b-none`,this._searchOpen),this._desktopSearchShell.classList.toggle(`border-b-transparent`,this._searchOpen))}_positionSearchPanel(){if(!this._searchPanel)return;if(this._isMobileViewport()||!this._desktopSearchShell){this._searchPanel.style.left=``,this._searchPanel.style.right=``,this._searchPanel.style.top=``,this._searchPanel.style.width=``,this._searchPanel.style.maxWidth=``,this._searchPanel.style.transform=``;return}let e=this._desktopSearchShell.getBoundingClientRect();this._searchPanel.style.left=`${e.left}px`,this._searchPanel.style.right=`auto`,this._searchPanel.style.top=`${e.bottom-1}px`,this._searchPanel.style.width=`${e.width}px`,this._searchPanel.style.maxWidth=`${e.width}px`,this._searchPanel.style.transform=`none`}_setSearchQuery(e){this._searchQuery=e,this._desktopSearchInput&&this._desktopSearchInput.value!==e&&(this._desktopSearchInput.value=e),this._searchPanelInput&&this._searchPanelInput.value!==e&&(this._searchPanelInput.value=e)}_normalizeResults(e){return(e=>{if(Array.isArray(e))return e;if(!e||typeof e!=`object`)return[];let t=e;for(let e of[`results`,`items`,`data`,`products`]){let n=t[e];if(Array.isArray(n))return n}return[]})(e).map(e=>{let t=e||{};return{title:String(t.title||t.name||t.label||t.email||t.id||``).trim()||`Untitled`,subtitle:String(t.description||t.category||t.username||``).trim()}}).slice(0,8)}_renderSearchState(e){this._searchStateWrap&&(this._searchStateWrap.textContent=e,this._searchStateWrap.classList.remove(`hidden`),this._searchResultsWrap&&(this._searchResultsWrap.innerHTML=``))}_renderSearchResults(e){if(!(!this._searchResultsWrap||!this._searchStateWrap)){if(this._searchResultsWrap.innerHTML=``,e.length===0){this._renderSearchState(`No results found`);return}this._searchStateWrap.classList.add(`hidden`);for(let t of e){let e=document.createElement(`button`);e.type=`button`,e.className=`flex w-full cursor-pointer items-start gap-3 rounded-lg px-3 py-2 text-left hover:bg-gray-100 dark:hover:bg-white/10`;let n=document.createElement(`mint-icon`);n.setAttribute(`name`,`search`),n.className=`mt-0.5 h-4 w-4 text-gray-500 dark:text-gray-400`;let r=document.createElement(`div`);r.className=`min-w-0`;let i=document.createElement(`div`);if(i.className=`truncate text-sm font-semibold text-gray-900 dark:text-gray-100`,i.textContent=t.title,r.appendChild(i),t.subtitle){let e=document.createElement(`div`);e.className=`truncate text-xs text-gray-500 dark:text-gray-400`,e.textContent=t.subtitle,r.appendChild(e)}e.appendChild(n),e.appendChild(r),e.addEventListener(`click`,()=>{this.dispatchEvent(new CustomEvent(`search-select`,{detail:{query:this._searchQuery,result:t},bubbles:!0,composed:!0})),this._closeSearch()}),this._searchResultsWrap.appendChild(e)}}}_fetchSearchResults(e){let t=this._getSearchEndpoint();if(!t)return;let n=e.trim();if(!n){this._renderSearchState(`Start typing to search`);return}this._abortSearch(),this._searchAbortController=new AbortController,this._renderSearchState(`Searching...`);let r=t.includes(`{query}`)?t.replace(`{query}`,encodeURIComponent(n)):`${t}${t.includes(`?`)?`&`:`?`}${encodeURIComponent(this._getSearchParam())}=${encodeURIComponent(n)}`;fetch(r,{signal:this._searchAbortController.signal}).then(e=>{if(!e.ok)throw Error(`Request failed: ${e.status}`);return e.json()}).then(e=>{let t=this._normalizeResults(e);this._renderSearchResults(t)}).catch(e=>{e?.name!==`AbortError`&&this._renderSearchState(`Unable to load results`)})}_scheduleSearch(e){this._setSearchQuery(e),this._cancelSearchDebounce(),this._searchDebounceId=window.setTimeout(()=>this._fetchSearchResults(e),220)}_observeDarkMode(){this._darkModeObserver||(this._darkModeObserver=new MutationObserver(()=>this.render()),this._darkModeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}))}_disconnectDarkModeObserver(){this._darkModeObserver&&=(this._darkModeObserver.disconnect(),null)}_attachResizeListener(){this._resizeHandler||(this._resizeHandler=()=>{this.render(),this._positionSearchPanel()},window.addEventListener(`resize`,this._resizeHandler,{passive:!0}))}_detachResizeListener(){this._resizeHandler&&=(window.removeEventListener(`resize`,this._resizeHandler),null)}_toggleMenuTarget(){let e=this._getMenuTargetId();if(!e)return;let t=document.getElementById(e);!t||t.tagName!==`MINT-SIDE-NAVIGATION`||(t.getAttribute(`open`)===`true`?t.removeAttribute(`open`):t.setAttribute(`open`,`true`))}render(){if(this._bar||(this._bar=document.createElement(`div`),this._bar.className=`fixed inset-x-0 top-0 z-50 flex h-14 w-full items-center gap-2 border-b border-gray-200 bg-white px-3 dark:border-mint-divider dark:bg-mint-nav`,this.appendChild(this._bar)),!this._menuButton){this._menuButton=document.createElement(`button`),this._menuButton.type=`button`,this._menuButton.className=`inline-flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-transparent text-gray-700 hover:bg-black/5 min-[1100px]:hidden dark:text-gray-200 dark:hover:bg-white/10`,this._menuButton.setAttribute(`aria-label`,`Open navigation menu`);let e=document.createElement(`mint-icon`);e.setAttribute(`name`,`menu`),e.className=`h-5 w-5`,this._menuButton.appendChild(e),this._menuClickHandler=()=>this._toggleMenuTarget(),this._menuButton.addEventListener(`click`,this._menuClickHandler),this._bar.appendChild(this._menuButton)}let e=!!this._getMenuTargetId();this._menuButton.classList.toggle(`hidden`,!e),this._logoLink||(this._logoLink=document.createElement(`a`),this._logoLink.className=`flex h-8 w-40 shrink-0 items-center`,this._bar.appendChild(this._logoLink)),this._logoLink.href=this._getLogoHref(),this._logoLink.setAttribute(`aria-label`,this._getLogoAlt());let t=this._getLogoSrc();if(t){let e=document.createElement(`img`);e.className=`h-full w-full object-contain [aspect-ratio:5/1]`,e.decoding=`async`,e.src=t,e.alt=this._getLogoAlt(),this._logoLink.replaceChildren(e),this._logoLink.classList.remove(`pointer-events-none`,`opacity-40`)}else{this._logoLink.replaceChildren(),this._logoLink.classList.add(`pointer-events-none`,`opacity-40`);let e=document.createElement(`span`);e.className=`text-sm font-semibold text-gray-400 dark:text-gray-500`,e.textContent=`Logo`,this._logoLink.appendChild(e)}let n=this._isSearchEnabled(),r=this._bar.querySelector(`[data-mint-topnav-center]`);if(r||(r=document.createElement(`div`),r.setAttribute(`data-mint-topnav-center`,`true`),r.className=`max-[1099.98px]:hidden min-[1100px]:flex min-[1100px]:min-w-0 min-[1100px]:flex-1 min-[1100px]:justify-center min-[1100px]:px-4`,this._bar.appendChild(r)),r.classList.toggle(`min-[1100px]:hidden`,!n),n&&!this._desktopSearchInput){let e=document.createElement(`div`);e.className=`relative w-full max-w-xl rounded-xl border border-gray-300 bg-gray-50 px-3 py-2 dark:border-mint-divider dark:bg-mint-hover`,this._desktopSearchShell=e;let t=document.createElement(`mint-icon`);t.setAttribute(`name`,`search`),t.className=`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-500 dark:text-gray-400`,this._desktopSearchInput=document.createElement(`input`),this._desktopSearchInput.type=`search`,this._desktopSearchInput.className=`w-full bg-transparent pl-6 pr-20 text-sm text-gray-900 outline-none placeholder:text-gray-500 dark:text-gray-100 dark:placeholder:text-gray-400`,this._desktopSearchInput.placeholder=this._getSearchPlaceholder(),this._desktopSearchInput.addEventListener(`focus`,()=>this._openSearch(!1)),this._desktopSearchInput.addEventListener(`input`,e=>this._scheduleSearch(e.target.value));let n=document.createElement(`span`);n.className=`absolute right-3 top-1/2 -translate-y-1/2 text-xs text-gray-500 dark:text-gray-400`,n.textContent=`⌘K`,e.appendChild(t),e.appendChild(this._desktopSearchInput),e.appendChild(n),r.appendChild(e)}this._desktopSearchInput&&(this._desktopSearchInput.placeholder=this._getSearchPlaceholder(),this._desktopSearchShell=this._desktopSearchInput.closest(`div`),this._syncDesktopSearchOpenState());let i=this._bar.querySelector(`[data-mint-topnav-mobile-spacer]`);i||(i=document.createElement(`div`),i.setAttribute(`data-mint-topnav-mobile-spacer`,`true`),i.className=`min-w-0 flex-1 min-[1100px]:hidden`,this._bar.appendChild(i));let a=Array.from(this.querySelectorAll(`[slot="actions"]`)),o=this._bar.querySelector(`[data-mint-topnav-actions]`);if(o||(o=document.createElement(`div`),o.setAttribute(`data-mint-topnav-actions`,`true`),o.className=`flex shrink-0 items-center gap-2`,this._bar.appendChild(o)),n&&!this._mobileSearchButton){this._mobileSearchButton=document.createElement(`button`),this._mobileSearchButton.type=`button`,this._mobileSearchButton.className=`inline-flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-transparent text-gray-700 hover:bg-black/5 min-[1100px]:hidden dark:text-gray-200 dark:hover:bg-white/10`,this._mobileSearchButton.setAttribute(`aria-label`,`Open search`);let e=document.createElement(`mint-icon`);e.setAttribute(`name`,`search`),e.className=`h-5 w-5`,this._mobileSearchButton.appendChild(e),this._mobileSearchButton.addEventListener(`click`,()=>this._openSearch(!0)),o.insertBefore(this._mobileSearchButton,o.firstChild)}if(this._mobileSearchButton&&this._mobileSearchButton.classList.toggle(`hidden`,!n),o.replaceChildren(...a),n&&this._mobileSearchButton&&!a.includes(this._mobileSearchButton)&&o.insertBefore(this._mobileSearchButton,o.firstChild),n&&!this._searchPanel){this._searchPanel=document.createElement(`div`),this._searchPanel.className=`fixed left-0 right-0 top-14 z-[90] hidden p-3 min-[1100px]:p-0`;let e=document.createElement(`div`);e.className=`mx-auto w-full rounded-2xl border border-gray-200 bg-white shadow-xl dark:border-mint-divider dark:bg-mint-elevated min-[1100px]:rounded-t-none`;let t=document.createElement(`div`);t.className=`relative border-b border-gray-200 p-3 dark:border-mint-divider min-[1100px]:hidden`;let n=document.createElement(`mint-icon`);n.setAttribute(`name`,`search`),n.className=`absolute left-6 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-500 dark:text-gray-400`,this._searchPanelInput=document.createElement(`input`),this._searchPanelInput.type=`search`,this._searchPanelInput.className=`w-full rounded-lg border border-gray-300 bg-gray-50 py-2 pl-10 pr-3 text-sm text-gray-900 outline-none dark:border-mint-divider dark:bg-mint-hover dark:text-gray-100`,this._searchPanelInput.placeholder=this._getSearchPlaceholder(),this._searchPanelInput.addEventListener(`input`,e=>this._scheduleSearch(e.target.value)),t.appendChild(n),t.appendChild(this._searchPanelInput);let r=document.createElement(`div`);r.className=`flex flex-wrap gap-2 px-3 py-3`,[`Apps`,`Customers`,`Orders`,`Products`,`Sales channels`].forEach(e=>{let t=document.createElement(`span`);t.className=`rounded-full bg-gray-100 px-3 py-1 text-xs font-semibold text-gray-600 dark:bg-mint-hover dark:text-gray-300`,t.textContent=e,r.appendChild(t)}),this._searchStateWrap=document.createElement(`div`),this._searchStateWrap.className=`px-4 pb-4 text-sm text-gray-500 dark:text-gray-400`,this._searchStateWrap.textContent=`Start typing to search`,this._searchResultsWrap=document.createElement(`div`),this._searchResultsWrap.className=`max-h-[52vh] overflow-y-auto px-2 pb-2`,e.appendChild(t),e.appendChild(r),e.appendChild(this._searchStateWrap),e.appendChild(this._searchResultsWrap),this._searchPanel.appendChild(e),this.appendChild(this._searchPanel)}this._searchPanelInput&&(this._searchPanelInput.placeholder=this._getSearchPlaceholder()),this._syncSearchPanelVisibility(),this._positionSearchPanel()}};customElements.get(`mint-top-navigation`)||customElements.define(`mint-top-navigation`,z);var B=class extends HTMLElement{constructor(...e){super(...e),this._lastScrollY=0,this._scrollHandler=null}connectedCallback(){this.classList.add(`fixed`,`bottom-0`,`left-0`,`right-0`,`z-30`,`flex`,`w-full`,`items-stretch`,`justify-around`,`gap-1`,`border-t`,`border-gray-200`,`bg-white`,`px-1`,`pt-1`,`pb-[env(safe-area-inset-bottom,0px)]`,`min-[1100px]:hidden`,`transition-transform`,`duration-200`,`ease-out`,`translate-y-0`,`dark:border-mint-divider`,`dark:bg-mint-nav`),this.setAttribute(`role`,`navigation`),this.setAttribute(`aria-label`,`Primary`),this._lastScrollY=window.scrollY,this._attachScrollListener()}disconnectedCallback(){this._detachScrollListener()}_attachScrollListener(){this._scrollHandler||(this._scrollHandler=()=>{let e=window.scrollY;if(e<=8){this.classList.remove(`translate-y-full`),this.classList.add(`translate-y-0`),this._lastScrollY=e;return}let t=e-this._lastScrollY;Math.abs(t)<4||(t>0?(this.classList.remove(`translate-y-0`),this.classList.add(`translate-y-full`)):(this.classList.remove(`translate-y-full`),this.classList.add(`translate-y-0`)),this._lastScrollY=e)},window.addEventListener(`scroll`,this._scrollHandler,{passive:!0}))}_detachScrollListener(){this._scrollHandler&&=(window.removeEventListener(`scroll`,this._scrollHandler),null)}};customElements.get(`mint-bottom-navigation`)||customElements.define(`mint-bottom-navigation`,B);var V=class extends HTMLElement{constructor(...e){super(...e),this._root=null}static get observedAttributes(){return[`icon`,`label`,`href`,`active`]}connectedCallback(){this.classList.add(`contents`),this.render()}attributeChangedCallback(e,t,n){t!==n&&this.render()}_isActive(){return this.getAttribute(`active`)===`true`}_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=r?`text-gray-900 dark:text-gray-100`:`text-gray-600 hover:bg-black/5 dark:text-gray-300 dark:hover:bg-white/10`,a;e?(a=document.createElement(`a`),a.href=e):(a=document.createElement(`button`),a.type=`button`),a.className=`flex min-w-0 flex-1 flex-col items-center justify-center gap-1 rounded-lg px-1 py-2 text-center text-[11px] font-medium leading-tight ${i}`,a.setAttribute(`aria-current`,r?`page`:`false`),a.setAttribute(`aria-label`,t||`Navigation item`);let o=document.createElement(`span`);if(o.className=`inline-flex h-6 w-6 items-center justify-center`,n){let e=document.createElement(`mint-icon`);e.setAttribute(`name`,n),e.className=r?`h-6 w-6`:`h-6 w-6 opacity-90`,o.appendChild(e)}let s=document.createElement(`span`);s.className=`block w-full truncate`,s.textContent=t,a.appendChild(o),a.appendChild(s),this.replaceChildren(a),this._root=a}};customElements.get(`mint-bottom-nav-item`)||customElements.define(`mint-bottom-nav-item`,V),exports.Alert=E,exports.BackButton=l,exports.BottomNavItem=V,exports.BottomNavigation=B,exports.Button=r,exports.default=r,exports.Card=s,exports.Chart=N,exports.Checkbox=m,exports.Chip=C,exports.Choice=g,exports.Clickable=T,exports.DatePicker=v,exports.Dropzone=b,exports.Form=x,exports.Grid=d,exports.Icon=n,exports.Input=_,exports.Link=c,exports.Modal=f,exports.OffCanvas=O,exports.Page=u,exports.Popover=p,exports.ResourceTable=D,exports.Select=y,exports.SideNavigation=R,exports.SideNavigationActionLinks=I,exports.SideNavigationActionMenu=L,exports.SideNavigationLink=P,exports.SideNavigationLinks=F,exports.Spinner=t,exports.Stack=o,exports.Switch=i,exports.Tab=k,exports.TabContent=j,exports.TabList=A,exports.Table=S,exports.Tabs=M,exports.Tags=w,exports.Text=a,exports.TopNavigation=z;
|
package/dist/index.js
CHANGED
|
@@ -8583,8 +8583,8 @@ var F = class extends HTMLElement {
|
|
|
8583
8583
|
this._container || (this._container = document.createElement("section"), this._container.className = "mb-4", this.appendChild(this._container)), this._title || (this._title = document.createElement("button"), this._title.setAttribute("type", "button"), this._title.className = "mb-2 w-full", this._titleLabel = document.createElement("mint-text"), this._titleLabel.setAttribute("size", "small"), this._titleLabel.setAttribute("bold", "true"), this._titleCaret = document.createElement("mint-icon"), this._titleCaret.setAttribute("name", "caret-right"), this._titleCaret.className = "ml-auto inline-flex h-4 w-4 shrink-0 text-gray-500 dark:text-gray-400", this._title.appendChild(this._titleLabel), this._title.appendChild(this._titleCaret), this._titleClickHandler = (e) => {
|
|
8584
8584
|
this._isNameInteractive() && (e instanceof KeyboardEvent && e.key !== "Enter" && e.key !== " " || (e instanceof KeyboardEvent && e.key === " " && e.preventDefault(), this._emitNameClick(e)));
|
|
8585
8585
|
}, this._title.addEventListener("click", this._titleClickHandler), this._title.addEventListener("keydown", this._titleClickHandler), this._container.appendChild(this._title));
|
|
8586
|
-
let e = this._getName(), t = this._isNameInteractive();
|
|
8587
|
-
this._titleLabel && (this._titleLabel.textContent = e, this._titleLabel.className = "uppercase tracking-wide text-gray-500 dark:text-gray-400"), this._title && (this._title.className =
|
|
8586
|
+
let e = this._getName(), t = e.trim().length > 0, n = this._isNameInteractive();
|
|
8587
|
+
this._titleLabel && (this._titleLabel.textContent = e, this._titleLabel.className = "uppercase tracking-wide text-gray-500 dark:text-gray-400"), this._title && (this._title.className = n ? [
|
|
8588
8588
|
"mb-2",
|
|
8589
8589
|
"w-full",
|
|
8590
8590
|
"inline-flex",
|
|
@@ -8603,7 +8603,7 @@ var F = class extends HTMLElement {
|
|
|
8603
8603
|
"focus-visible:ring-2",
|
|
8604
8604
|
"focus-visible:ring-black/20",
|
|
8605
8605
|
"dark:focus-visible:ring-white/20"
|
|
8606
|
-
].join(" ") : "mb-2 w-full inline-flex items-center gap-2 rounded-lg border border-transparent px-3 py-2 text-left cursor-default", this._title.tabIndex =
|
|
8606
|
+
].join(" ") : "mb-2 w-full inline-flex items-center gap-2 rounded-lg border border-transparent px-3 py-2 text-left cursor-default", this._title.tabIndex = n ? 0 : -1, this._title.disabled = !n, this._title.setAttribute("aria-disabled", String(!n))), this._titleCaret && (this._titleCaret.style.display = n ? "" : "none", this._titleCaret.setAttribute("aria-hidden", String(!n))), t ? this._title.parentElement !== this._container && this._container?.insertBefore(this._title, this._list) : this._title.parentElement === this._container && this._container?.removeChild(this._title), this._list || (this._list = document.createElement("div"), this._list.className = "space-y-1", this._container.appendChild(this._list)), Array.from(this.children).filter((e) => e !== this._container && e.tagName === "MINT-SIDENAV-LINK").forEach((e) => {
|
|
8607
8607
|
this._list && e.parentElement !== this._list && this._list.appendChild(e);
|
|
8608
8608
|
});
|
|
8609
8609
|
}
|