import{a as v}from"./chunk.UFTAQNZB.js";import{a as n}from"./chunk.NYKJXI3Q.js";import{a as f,b as a,d as m,h as l}from"./chunk.XJAJO727.js";import{b as o,e as c,i as h}from"./chunk.OBAEIKIV.js";import{e as s}from"./chunk.6EV4YU6C.js";var e=class extends l{constructor(){super(...arguments);this.steps=[];this.size="lg";this.orientation="horizontal";this.activeStep=0;this.notInteractive=!1;this.label=""}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.steps=this.getAllSteps(),this.steps[this.steps.length-1].noTail=!0;let t;this.steps.forEach((i,r)=>{i.index=r+1,i.size=this.size,i.orientation=this.orientation,this.notInteractive?(i.current=!1,i.disabled=!1,i.notInteractive=!0):i.current&&(t=r)}),this.activeStep!==-1&&this.setActiveStep(t||this.activeStep)})}handleActiveStepChange(){let t=Number(this.activeStep);Number.isNaN(t)||this.setActiveStep(t)}updateSize(){this.steps.forEach(t=>{t.size=this.size})}updateOrientation(){this.steps.forEach(t=>{t.orientation=this.orientation})}getAllSteps(){return[...this.body.assignedElements()].filter(t=>t.tagName.toLowerCase()==="sd-6-22-0-step")}setActiveStep(t){t>=0&&t<this.steps.length&&!this.notInteractive&&(this.activeStep=t,this.steps.forEach((i,r)=>{r===t?i.current=!0:r>t?(i.waiting=!0,i.current=!1):(i.current=!1,i.waiting=!1)}))}handleInteractivityChange(){this.notInteractive&&this.steps.forEach(t=>{t.current=!1,t.disabled=!1,t.notInteractive=!0})}render(){return this.size==="xs"&&this.orientation!=="vertical"?(console.warn('Size "xs" is only supported when orientation is "vertical". The element will not be rendered.'),h):c`<div role="${this.notInteractive?"group":"navigation"}" class="h-full" aria-label="${this.label}"><div role="list" part="base" class="${v("flex",this.orientation==="vertical"&&"flex-col h-full")}"><slot part="body"></slot></div></div>`}};e.styles=[...l.styles,o`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
:host{width:-moz-max-content;width:max-content}`],s([m("[part=body]")],e.prototype,"body",2),s([a({type:String,reflect:!0})],e.prototype,"size",2),s([a({type:String,reflect:!0})],e.prototype,"orientation",2),s([a({type:Number,reflect:!0,attribute:"active-step"})],e.prototype,"activeStep",2),s([a({type:Boolean,reflect:!0,attribute:"not-interactive"})],e.prototype,"notInteractive",2),s([a({type:String,reflect:!0})],e.prototype,"label",2),s([n("activeStep",{waitUntilFirstUpdate:!0})],e.prototype,"handleActiveStepChange",1),s([n("size",{waitUntilFirstUpdate:!0})],e.prototype,"updateSize",1),s([n("orientation",{waitUntilFirstUpdate:!0})],e.prototype,"updateOrientation",1),s([n("notInteractive")],e.prototype,"handleInteractivityChange",1),e=s([f("sd-6-22-0-step-group")],e);export{e as a};
