import{p as s,H as e,c as t,h as i,a}from"./index.js";import{a as o}from"./p-Nvj7WFs_.js";import{c}from"./p-DrPpH_9c.js";import{g as r}from"./p-DKo9A5gq.js";import{t as l}from"./p-Cjg0wpDG.js";import{d as n}from"./p-CWqMiVYH.js";import{d as h}from"./p-BJnSrRNH.js";const b={root:"gov-breadcrumbs"};const d=s(class s extends e{constructor(){super();this.__registerHost();this.govChange=t(this,"gov-change");this.inited=false;this.collapsible=false;this.isExpanded=false;this.accessibleToggleLabel="Zobrazit či skrýt navigaci";this.expanded=false;this.toggleOption=false;this.h=r(this.host)}async componentDidRender(){this.scheduleContentVerification();if(c()){l((()=>this.validateAccessibility()))}}scheduleContentVerification(){if(this.inited)return;this.inited=true;l((()=>{this.calculateWidthOfItems();this.inited=false}))}calculateWidthOfItems(){const s=this.host.getBoundingClientRect().width;let e=0;this.host.querySelectorAll("li").forEach((s=>{e+=s.getBoundingClientRect().width}));this.toggleOption=e>s}render(){return i(a,{key:"5a2d10c3705a0d19458ea76e65ab6e0449eb620d",class:this.h.classes(b.root),expanded:this.expanded},i("nav",{key:"41b98c6ee95ea397f9802f5ac120d2674859cb4d","aria-label":this.accessibleLabel,"aria-labelledby":this.accessibleLabelledBy},i("slot",{key:"10fed9d58caa49017c34665e4b711252854040b7"})),this.toggleOption?i("gov-button",{size:"xs",color:"primary",type:"base","aria-label":this.accessibleToggleLabel,"aria-pressed":this.expanded,"aria-expanded":this.expanded,"on-gov-click":()=>this.expanded=!this.expanded},i("gov-icon",{name:this.expanded?"chevron-up":"chevron-down",type:"components"})):null)}async validateAccessibility(){o(this.accessibleLabel,this.accessibleLabelledBy,b.root,this.host);o(this.accessibleToggleLabel,undefined,b.root,this.host)}get host(){return this}},[4,"gov-breadcrumbs",{collapsible:[4],isExpanded:[4,"is-expanded"],accessibleLabel:[1,"accessible-label"],accessibleLabelledBy:[1,"accessible-labelledby"],accessibleToggleLabel:[1,"accessible-toggle-label"],expanded:[32],toggleOption:[32],validateAccessibility:[64]}]);function m(){if(typeof customElements==="undefined"){return}const s=["gov-breadcrumbs","gov-button","gov-icon"];s.forEach((s=>{switch(s){case"gov-breadcrumbs":if(!customElements.get(s)){customElements.define(s,d)}break;case"gov-button":if(!customElements.get(s)){n()}break;case"gov-icon":if(!customElements.get(s)){h()}break}}))}m();const p=d;const f=m;export{p as GovBreadcrumbs,f as defineCustomElement};
//# sourceMappingURL=gov-breadcrumbs.js.map