import{aa as f,ab as S,ac as b,bA as r,bo as s,ak as o,a as $,o as l,B as p,aB as C,b as u,a2 as h,w as y,e as d,E as k,t as D,aD as P,G as V}from"./dVzHJMF1.js";var g={root:function(t){var i=t.instance;return["p-step",{"p-step-active":i.active,"p-disabled":i.isStepDisabled}]},header:"p-step-header",number:"p-step-number",title:"p-step-title"},B=f.extend({name:"step",classes:g}),v={name:"StepperSeparator",hostName:"Stepper",extends:S,inject:{$pcStepper:{default:null}}};function I(e,t,i,n,c,a){return l(),$("span",p({class:e.cx("separator")},e.ptmo(a.$pcStepper.pt,"separator")),null,16)}v.render=I;var x={name:"BaseStep",extends:S,props:{value:{type:[String,Number],default:void 0},disabled:{type:Boolean,default:!1},asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"DIV"}},style:B,provide:function(){return{$pcStep:this,$parentInstance:this}}},A={name:"Step",extends:x,inheritAttrs:!1,inject:{$pcStepper:{default:null},$pcStepList:{default:null},$pcStepItem:{default:null}},data:function(){return{isSeparatorVisible:!1,isCompleted:!1}},mounted:function(){if(this.$el&&this.$pcStepList){var t=r(this.$el,s(this.$pcStepper.$el,'[data-pc-name="step"]')),i=r(o(this.$pcStepper.$el,'[data-pc-name="step"][data-p-active="true"]'),s(this.$pcStepper.$el,'[data-pc-name="step"]')),n=s(this.$pcStepper.$el,'[data-pc-name="step"]').length;this.isSeparatorVisible=t!==n-1,this.isCompleted=t<i}},updated:function(){var t=r(this.$el,s(this.$pcStepper.$el,'[data-pc-name="step"]')),i=r(o(this.$pcStepper.$el,'[data-pc-name="step"][data-p-active="true"]'),s(this.$pcStepper.$el,'[data-pc-name="step"]'));this.isCompleted=t<i},methods:{getPTOptions:function(t){var i=t==="root"?this.ptmi:this.ptm;return i(t,{context:{active:this.active,disabled:this.isStepDisabled}})},onStepClick:function(){this.$pcStepper.updateValue(this.activeValue)}},computed:{active:function(){return this.$pcStepper.isStepActive(this.activeValue)},activeValue:function(){var t;return this.$pcStepItem?(t=this.$pcStepItem)===null||t===void 0?void 0:t.value:this.value},isStepDisabled:function(){return!this.active&&(this.$pcStepper.isStepDisabled()||this.disabled)},id:function(){var t;return"".concat((t=this.$pcStepper)===null||t===void 0?void 0:t.id,"_step_").concat(this.activeValue)},ariaControls:function(){var t;return"".concat((t=this.$pcStepper)===null||t===void 0?void 0:t.id,"_steppanel_").concat(this.activeValue)},a11yAttrs:function(){return{root:{role:"presentation","aria-current":this.active?"step":void 0,"data-pc-name":"step","data-pc-section":"root","data-p-disabled":this.isStepDisabled,"data-p-active":this.active},header:{id:this.id,role:"tab",taindex:this.disabled?-1:void 0,"aria-controls":this.ariaControls,"data-pc-section":"header",disabled:this.isStepDisabled,onClick:this.onStepClick}}},dataP:function(){return b({disabled:this.isStepDisabled,readonly:this.$pcStepper.linear,active:this.active,completed:this.isCompleted,vertical:this.$pcStepItem!=null})}},components:{StepperSeparator:v}},O=["id","tabindex","aria-controls","disabled","data-p"],_=["data-p"],T=["data-p"];function N(e,t,i,n,c,a){var m=C("StepperSeparator");return e.asChild?h(e.$slots,"default",{key:1,class:V(e.cx("root")),active:a.active,value:e.value,a11yAttrs:a.a11yAttrs,activateCallback:a.onStepClick}):(l(),u(P(e.as),p({key:0,class:e.cx("root"),"aria-current":a.active?"step":void 0,role:"presentation","data-p-active":a.active,"data-p-disabled":a.isStepDisabled,"data-p":a.dataP},a.getPTOptions("root")),{default:y(function(){return[d("button",p({id:a.id,class:e.cx("header"),role:"tab",type:"button",tabindex:a.isStepDisabled?-1:void 0,"aria-controls":a.ariaControls,disabled:a.isStepDisabled,onClick:t[0]||(t[0]=function(){return a.onStepClick&&a.onStepClick.apply(a,arguments)}),"data-p":a.dataP},a.getPTOptions("header")),[d("span",p({class:e.cx("number"),"data-p":a.dataP},a.getPTOptions("number")),D(a.activeValue),17,_),d("span",p({class:e.cx("title"),"data-p":a.dataP},a.getPTOptions("title")),[h(e.$slots,"default")],16,T)],16,O),c.isSeparatorVisible?(l(),u(m,{key:0,"data-p":a.dataP},null,8,["data-p"])):k("",!0)]}),_:3},16,["class","aria-current","data-p-active","data-p-disabled","data-p"]))}A.render=N;export{A as default};
