import{m as R,u as _,a as w,V as L,b as N}from"./VSliderTrack-BSvqM6gM.js";import{d as U,a as $,b as q,V}from"./VInput-tBjZAjEz.js";import{bO as A,bS as B,aS as E,d5 as O,bU as j,q as z,b$ as D,I as s,F as G,du as H,ar as J}from"./index-UvaAT40e.js";const K=A({...U(),...R(),...$(),modelValue:{type:[Number,String],default:0}},"VSlider"),Y=B()({name:"VSlider",props:K(),emits:{"update:focused":e=>!0,"update:modelValue":e=>!0,start:e=>!0,end:e=>!0},setup(e,S){let{slots:a,emit:v}=S;const m=E(),{rtlClasses:h}=O(),i=_(e),d=j(e,"modelValue",void 0,l=>i.roundValue(l??i.min.value)),{min:k,max:p,mousePressed:P,roundValue:c,onSliderMousedown:y,onSliderTouchstart:F,trackContainerRef:g,position:x,hasLabels:T,readonly:b}=w({props:e,steps:i,onSliderStart:()=>{v("start",d.value)},onSliderEnd:l=>{let{value:n}=l;const u=c(n);d.value=u,v("end",u)},onSliderMove:l=>{let{value:n}=l;return d.value=c(n)},getActiveThumb:()=>{var l;return(l=m.value)==null?void 0:l.$el}}),{isFocused:o,focus:C,blur:I}=q(e),f=z(()=>x(d.value));return D(()=>{const l=V.filterProps(e),n=!!(e.label||a.label||a.prepend);return s(V,J({class:["v-slider",{"v-slider--has-labels":!!a["tick-label"]||T.value,"v-slider--focused":o.value,"v-slider--pressed":P.value,"v-slider--disabled":e.disabled},h.value,e.class],style:e.style},l,{focused:o.value}),{...a,prepend:n?u=>{var t,r;return s(G,null,[((t=a.label)==null?void 0:t.call(a,u))??(e.label?s(H,{id:u.id.value,class:"v-slider__label",text:e.label},null):void 0),(r=a.prepend)==null?void 0:r.call(a,u)])}:void 0,default:u=>{let{id:t,messagesId:r}=u;return s("div",{class:"v-slider__container",onMousedown:b.value?void 0:y,onTouchstartPassive:b.value?void 0:F},[s("input",{id:t.value,name:e.name||t.value,disabled:!!e.disabled,readonly:!!e.readonly,tabindex:"-1",value:d.value},null),s(L,{ref:g,start:0,stop:f.value},{"tick-label":a["tick-label"]}),s(N,{ref:m,"aria-describedby":r.value,focused:o.value,min:k.value,max:p.value,modelValue:d.value,"onUpdate:modelValue":M=>d.value=M,position:f.value,elevation:e.elevation,onFocus:C,onBlur:I,ripple:e.ripple,name:e.name},{"thumb-label":a["thumb-label"]})])}})}),{}}});export{Y as V};