import{r,h as a,F as t,g as e}from"./p-b891c2f1.js";const s=class{constructor(a){r(this,a),this.label="Breadcrumb"}getSeparator(){const r=this.el.shadowRoot.querySelector("slot[name=separator]").assignedElements({flatten:!0})[0].cloneNode(!0);return[r,...r.querySelectorAll("[id]")].forEach((r=>r.removeAttribute("id"))),r.slot="separator",r}handleSlotChange(){const r=this.el.shadowRoot.querySelector(".breadcrumb slot").assignedElements().filter((r=>"CE-BREADCRUMB"===r.nodeName));r.forEach(((a,t)=>{null===a.querySelector('[slot="separator"]')&&a.append(this.getSeparator()),t===r.length-1?a.setAttribute("aria-current","page"):a.removeAttribute("aria-current")}))}render(){return a(t,null,a("nav",{part:"base",class:"breadcrumb","aria-label":this.label},a("slot",{onSlotchange:()=>this.handleSlotChange()})),a("div",{hidden:!0,"aria-hidden":"true"},a("slot",{name:"separator"},a("sc-icon",{name:"chevron-right"}))))}get el(){return e(this)}};s.style=":host{display:block}.breadcrumb{display:flex;align-items:center;flex-wrap:wrap}";export{s as sc_breadcrumbs}