import{ad as I,bi as N,ae as k,i as l,aC as L,l as R,af as m,aR as O,aS as M,bS as U,z as o,S as X,b0 as q,b1 as J,ab as K,G as Y,bT as Z,aQ as v,av as ee,al as te,Q as E,D as _,aw as ae,b$ as le,R as Q,c0 as ne,bQ as re,bG as ie,ca as se,bd as j,bh as oe,F as ue,X as ce,be as de,bP as pe,bV as ve}from"./index-N7CMQwFv.js";import{V as z,m as me}from"./VSheet-BUpJdv3I.js";const D=Symbol.for("vuetify:v-stepper"),H=m({color:String,disabled:{type:[Boolean,String],default:!1},prevText:{type:String,default:"$vuetify.stepper.prev"},nextText:{type:String,default:"$vuetify.stepper.next"}},"VStepperActions"),be=I()({name:"VStepperActions",props:H(),emits:{"click:prev":()=>!0,"click:next":()=>!0},setup(e,d){let{emit:t,slots:a}=d;const{t:n}=N();function r(){t("click:prev")}function i(){t("click:next")}return k(()=>{const u={onClick:r},p={onClick:i};return l("div",{class:"v-stepper-actions"},[l(L,{defaults:{VBtn:{disabled:["prev",!0].includes(e.disabled),text:n(e.prevText),variant:"text"}}},{default:()=>{var s;return[((s=a.prev)==null?void 0:s.call(a,{props:u}))??l(R,u,null)]}}),l(L,{defaults:{VBtn:{color:e.color,disabled:["next",!0].includes(e.disabled),text:n(e.nextText),variant:"tonal"}}},{default:()=>{var s;return[((s=a.next)==null?void 0:s.call(a,{props:p}))??l(R,p,null)]}})])}),{}}}),fe=O("v-stepper-header"),Se=m({color:String,title:String,subtitle:String,complete:Boolean,completeIcon:{type:v,default:"$complete"},editable:Boolean,editIcon:{type:v,default:"$edit"},error:Boolean,errorIcon:{type:v,default:"$error"},icon:v,ripple:{type:[Boolean,Object],default:!0},rules:{type:Array,default:()=>[]}},"StepperItem"),Ve=m({...Se(),...Z()},"VStepperItem"),ye=I()({name:"VStepperItem",directives:{Ripple:M},props:Ve(),emits:{"group:selected":e=>!0},setup(e,d){let{slots:t}=d;const a=U(e,D,!0),n=o(()=>(a==null?void 0:a.value.value)??e.value),r=o(()=>e.rules.every(S=>S()===!0)),i=o(()=>!e.disabled&&e.editable),u=o(()=>!e.disabled&&e.editable),p=o(()=>e.error||!r.value),s=o(()=>e.complete||e.rules.length>0&&r.value),w=o(()=>p.value?e.errorIcon:s.value?e.completeIcon:a.isSelected.value&&e.editable?e.editIcon:e.icon),b=o(()=>({canEdit:u.value,hasError:p.value,hasCompleted:s.value,title:e.title,subtitle:e.subtitle,step:n.value,value:e.value}));return k(()=>{var V,y,P;const S=(!a||a.isSelected.value||s.value||u.value)&&!p.value&&!e.disabled,W=!!(e.title!=null||t.title),x=!!(e.subtitle!=null||t.subtitle);function h(){a==null||a.toggle()}return X(l("button",{class:["v-stepper-item",{"v-stepper-item--complete":s.value,"v-stepper-item--disabled":e.disabled,"v-stepper-item--error":p.value},a==null?void 0:a.selectedClass.value],disabled:!e.editable,type:"button",onClick:h},[i.value&&J(!0,"v-stepper-item"),l(K,{key:"stepper-avatar",class:"v-stepper-item__avatar",color:S?e.color:void 0,size:24},{default:()=>{var c;return[((c=t.icon)==null?void 0:c.call(t,b.value))??(w.value?l(Y,{icon:w.value},null):n.value)]}}),l("div",{class:"v-stepper-item__content"},[W&&l("div",{key:"title",class:"v-stepper-item__title"},[((V=t.title)==null?void 0:V.call(t,b.value))??e.title]),x&&l("div",{key:"subtitle",class:"v-stepper-item__subtitle"},[((y=t.subtitle)==null?void 0:y.call(t,b.value))??e.subtitle]),(P=t.default)==null?void 0:P.call(t,b.value)])]),[[q("ripple"),e.ripple&&e.editable,null]])}),{}}}),Ie=m({...ae(le(),["continuous","nextIcon","prevIcon","showArrows","touch","mandatory"])},"VStepperWindow"),ke=I()({name:"VStepperWindow",props:Ie(),emits:{"update:modelValue":e=>!0},setup(e,d){let{slots:t}=d;const a=ee(D,null),n=te(e,"modelValue"),r=o({get(){var i;return n.value!=null||!a?n.value:(i=a.items.value.find(u=>a.selected.value.includes(u.id)))==null?void 0:i.value},set(i){n.value=i}});return k(()=>{const i=E.filterProps(e);return l(E,_({_as:"VStepperWindow"},i,{modelValue:r.value,"onUpdate:modelValue":u=>r.value=u,class:["v-stepper-window",e.class],style:e.style,mandatory:!1,touch:!1}),t)}),{}}}),we=m({...ne()},"VStepperWindowItem"),xe=I()({name:"VStepperWindowItem",props:we(),setup(e,d){let{slots:t}=d;return k(()=>{const a=Q.filterProps(e);return l(Q,_({_as:"VStepperWindowItem"},a,{class:["v-stepper-window-item",e.class],style:e.style}),t)}),{}}}),he=m({altLabels:Boolean,bgColor:String,completeIcon:v,editIcon:v,editable:Boolean,errorIcon:v,hideActions:Boolean,items:{type:Array,default:()=>[]},itemTitle:{type:String,default:"title"},itemValue:{type:String,default:"value"},nonLinear:Boolean,flat:Boolean,...ve()},"Stepper"),Pe=m({...he(),...pe({mandatory:"force",selectedClass:"v-stepper-item--selected"}),...me(),...de(H(),["prevText","nextText"])},"VStepper"),We=I()({name:"VStepper",props:Pe(),emits:{"update:modelValue":e=>!0},setup(e,d){let{slots:t}=d;const{items:a,next:n,prev:r,selected:i}=re(e,D),{displayClasses:u,mobile:p}=ie(e),{completeIcon:s,editIcon:w,errorIcon:b,color:S,editable:W,prevText:x,nextText:h}=se(e),V=o(()=>e.items.map((c,B)=>{const g=j(c,e.itemTitle,c),A=j(c,e.itemValue,B+1);return{title:g,value:A,raw:c}})),y=o(()=>a.value.findIndex(c=>i.value.includes(c.id))),P=o(()=>e.disabled?e.disabled:y.value===0?"prev":y.value===a.value.length-1?"next":!1);return oe({VStepperItem:{editable:W,errorIcon:b,completeIcon:s,editIcon:w,prevText:x,nextText:h},VStepperActions:{color:S,disabled:P,prevText:x,nextText:h}}),k(()=>{const c=z.filterProps(e),B=!!(t.header||e.items.length),g=e.items.length>0,A=!e.hideActions&&!!(g||t.actions);return l(z,_(c,{color:e.bgColor,class:["v-stepper",{"v-stepper--alt-labels":e.altLabels,"v-stepper--flat":e.flat,"v-stepper--non-linear":e.nonLinear,"v-stepper--mobile":p.value},u.value,e.class],style:e.style}),{default:()=>{var $,G;return[B&&l(fe,{key:"stepper-header"},{default:()=>[V.value.map((f,C)=>{let{raw:T,...F}=f;return l(ue,null,[!!C&&l(ce,null,null),l(ye,F,{default:t[`header-item.${F.value}`]??t.header,icon:t.icon,title:t.title,subtitle:t.subtitle})])})]}),g&&l(ke,{key:"stepper-window"},{default:()=>[V.value.map(f=>l(xe,{value:f.value},{default:()=>{var C,T;return((C=t[`item.${f.value}`])==null?void 0:C.call(t,f))??((T=t.item)==null?void 0:T.call(t,f))}}))]}),($=t.default)==null?void 0:$.call(t,{prev:r,next:n}),A&&(((G=t.actions)==null?void 0:G.call(t,{next:n,prev:r}))??l(be,{key:"stepper-actions","onClick:prev":r,"onClick:next":n},t))]}})}),{prev:r,next:n}}});export{We as V,fe as a,ye as b,ke as c,xe as d};