import{bO as J,cw as fe,cV as he,q as l,eg as H,d5 as le,bd as S,b5 as Q,aS as ee,e0 as ke,aM as ye,dV as se,cc as re,bS as ne,dj as pe,af as oe,cZ as Se,bW as ge,b$ as ie,dd as M,I as v,bJ as te,aY as we,ds as Ce,bz as Ve,e1 as _e,cE as Te,de as ae}from"./index-UvaAT40e.js";const Z=Symbol.for("vuetify:v-slider");function xe(e,t,o){const i=o==="vertical",u=t.getBoundingClientRect(),m="touches"in e?e.touches[0]:e;return i?m.clientY-(u.top+u.height/2):m.clientX-(u.left+u.width/2)}function Fe(e,t){return"touches"in e&&e.touches.length?e.touches[0][t]:"changedTouches"in e&&e.changedTouches.length?e.changedTouches[0][t]:e[t]}const Le=J({disabled:{type:Boolean,default:null},error:Boolean,readonly:{type:Boolean,default:null},max:{type:[Number,String],default:100},min:{type:[Number,String],default:0},step:{type:[Number,String],default:0},thumbColor:String,thumbLabel:{type:[Boolean,String],default:void 0,validator:e=>typeof e=="boolean"||e==="always"},thumbSize:{type:[Number,String],default:20},showTicks:{type:[Boolean,String],default:!1,validator:e=>typeof e=="boolean"||e==="always"},ticks:{type:[Array,Object]},tickSize:{type:[Number,String],default:2},color:String,trackColor:String,trackFillColor:String,trackSize:{type:[Number,String],default:4},direction:{type:String,default:"horizontal",validator:e=>["vertical","horizontal"].includes(e)},reverse:Boolean,...fe(),...he({elevation:2}),ripple:{type:Boolean,default:!0}},"Slider"),Me=e=>{const t=l(()=>parseFloat(e.min)),o=l(()=>parseFloat(e.max)),i=l(()=>+e.step>0?parseFloat(e.step):0),u=l(()=>Math.max(H(i.value),H(t.value)));function m(h){if(h=parseFloat(h),i.value<=0)return h;const g=se(h,t.value,o.value),f=t.value%i.value,w=Math.round((g-f)/i.value)*i.value+f;return parseFloat(Math.min(w,o.value).toFixed(u.value))}return{min:t,max:o,step:i,decimals:u,roundValue:m}},Ne=e=>{let{props:t,steps:o,onSliderStart:i,onSliderMove:u,onSliderEnd:m,getActiveThumb:h}=e;const{isRtl:g}=le(),f=S(t,"reverse"),w=l(()=>t.direction==="vertical"),V=l(()=>w.value!==f.value),{min:b,max:k,step:_,decimals:N,roundValue:F}=o,O=l(()=>parseInt(t.thumbSize,10)),q=l(()=>parseInt(t.tickSize,10)),K=l(()=>parseInt(t.trackSize,10)),T=l(()=>(k.value-b.value)/_.value),j=S(t,"disabled"),z=l(()=>t.error||t.disabled?void 0:t.thumbColor??t.color),E=l(()=>t.error||t.disabled?void 0:t.trackColor??t.color),P=l(()=>t.error||t.disabled?void 0:t.trackFillColor??t.color),R=Q(!1),y=Q(0),L=ee(),p=ee();function s(a){var G;const n=t.direction==="vertical",ue=n?"top":"left",ce=n?"height":"width",de=n?"clientY":"clientX",{[ue]:ve,[ce]:me}=(G=L.value)==null?void 0:G.$el.getBoundingClientRect(),be=Fe(a,de);let X=Math.min(Math.max((be-ve-y.value)/me,0),1)||0;return(n?V.value:V.value!==g.value)&&(X=1-X),F(b.value+X*(k.value-b.value))}const C=a=>{m({value:s(a)}),R.value=!1,y.value=0},x=a=>{p.value=h(a),p.value&&(p.value.focus(),R.value=!0,p.value.contains(a.target)?y.value=xe(a,p.value,t.direction):(y.value=0,u({value:s(a)})),i({value:s(a)}))},d={passive:!0,capture:!0};function B(a){u({value:s(a)})}function A(a){a.stopPropagation(),a.preventDefault(),C(a),window.removeEventListener("mousemove",B,d),window.removeEventListener("mouseup",A)}function $(a){var n;C(a),window.removeEventListener("touchmove",B,d),(n=a.target)==null||n.removeEventListener("touchend",$)}function W(a){var n;x(a),window.addEventListener("touchmove",B,d),(n=a.target)==null||n.addEventListener("touchend",$,{passive:!1})}function c(a){a.preventDefault(),x(a),window.addEventListener("mousemove",B,d),window.addEventListener("mouseup",A,{passive:!1})}const r=a=>{const n=(a-b.value)/(k.value-b.value)*100;return se(isNaN(n)?0:n,0,100)},D=S(t,"showTicks"),I=l(()=>D.value?t.ticks?Array.isArray(t.ticks)?t.ticks.map(a=>({value:a,position:r(a),label:a.toString()})):Object.keys(t.ticks).map(a=>({value:parseFloat(a),position:r(parseFloat(a)),label:t.ticks[a]})):T.value!==1/0?ke(T.value+1).map(a=>{const n=b.value+a*_.value;return{value:n,position:r(n)}}):[]:[]),Y=l(()=>I.value.some(a=>{let{label:n}=a;return!!n})),U={activeThumbRef:p,color:S(t,"color"),decimals:N,disabled:j,direction:S(t,"direction"),elevation:S(t,"elevation"),hasLabels:Y,isReversed:f,indexFromEnd:V,min:b,max:k,mousePressed:R,numTicks:T,onSliderMousedown:c,onSliderTouchstart:W,parsedTicks:I,parseMouseMove:s,position:r,readonly:S(t,"readonly"),rounded:S(t,"rounded"),roundValue:F,showTicks:D,startOffset:y,step:_,thumbSize:O,thumbColor:z,thumbLabel:S(t,"thumbLabel"),ticks:S(t,"ticks"),tickSize:q,trackColor:E,trackContainerRef:L,trackFillColor:P,trackSize:K,vertical:w};return ye(Z,U),U},ze=J({focused:Boolean,max:{type:Number,required:!0},min:{type:Number,required:!0},modelValue:{type:Number,required:!0},position:{type:Number,required:!0},ripple:{type:[Boolean,Object],default:!0},name:String,...re()},"VSliderThumb"),Pe=ne()({name:"VSliderThumb",directives:{Ripple:pe},props:ze(),emits:{"update:modelValue":e=>!0},setup(e,t){let{slots:o,emit:i}=t;const u=oe(Z),{isRtl:m,rtlClasses:h}=le();if(!u)throw new Error("[Vuetify] v-slider-thumb must be used inside v-slider or v-range-slider");const{thumbColor:g,step:f,disabled:w,thumbSize:V,thumbLabel:b,direction:k,isReversed:_,vertical:N,readonly:F,elevation:O,mousePressed:q,decimals:K,indexFromEnd:T}=u,j=l(()=>w.value?void 0:O.value),{elevationClasses:z}=Se(j),{textColorClasses:E,textColorStyles:P}=ge(g),{pageup:R,pagedown:y,end:L,home:p,left:s,right:C,down:x,up:d}=_e,B=[R,y,L,p,s,C,x,d],A=l(()=>f.value?[1,2,3]:[1,5,10]);function $(c,r){if(!B.includes(c.key))return;c.preventDefault();const D=f.value||.1,I=(e.max-e.min)/D;if([s,C,x,d].includes(c.key)){const U=(N.value?[m.value?s:C,_.value?x:d]:T.value!==m.value?[s,d]:[C,d]).includes(c.key)?1:-1,a=c.shiftKey?2:c.ctrlKey?1:0;r=r+U*D*A.value[a]}else if(c.key===p)r=e.min;else if(c.key===L)r=e.max;else{const Y=c.key===y?1:-1;r=r-Y*D*(I>100?I/10:10)}return Math.max(e.min,Math.min(e.max,r))}function W(c){const r=$(c,e.modelValue);r!=null&&i("update:modelValue",r)}return ie(()=>{const c=M(T.value?100-e.position:e.position,"%");return v("div",{class:["v-slider-thumb",{"v-slider-thumb--focused":e.focused,"v-slider-thumb--pressed":e.focused&&q.value},e.class,h.value],style:[{"--v-slider-thumb-position":c,"--v-slider-thumb-size":M(V.value)},e.style],role:"slider",tabindex:w.value?-1:0,"aria-label":e.name,"aria-valuemin":e.min,"aria-valuemax":e.max,"aria-valuenow":e.modelValue,"aria-readonly":!!F.value,"aria-orientation":k.value,onKeydown:F.value?void 0:W},[v("div",{class:["v-slider-thumb__surface",E.value,z.value],style:{...P.value}},null),te(v("div",{class:["v-slider-thumb__ripple",E.value],style:P.value},null),[[we("ripple"),e.ripple,null,{circle:!0,center:!0}]]),v(Ce,{origin:"bottom center"},{default:()=>{var r;return[te(v("div",{class:"v-slider-thumb__label-container"},[v("div",{class:["v-slider-thumb__label"]},[v("div",null,[((r=o["thumb-label"])==null?void 0:r.call(o,{modelValue:e.modelValue}))??e.modelValue.toFixed(f.value?K.value:1)])])]),[[Ve,b.value&&e.focused||b.value==="always"]])]}})])}),{}}}),Ee=J({start:{type:Number,required:!0},stop:{type:Number,required:!0},...re()},"VSliderTrack"),Be=ne()({name:"VSliderTrack",props:Ee(),emits:{},setup(e,t){let{slots:o}=t;const i=oe(Z);if(!i)throw new Error("[Vuetify] v-slider-track must be inside v-slider or v-range-slider");const{color:u,parsedTicks:m,rounded:h,showTicks:g,tickSize:f,trackColor:w,trackFillColor:V,trackSize:b,vertical:k,min:_,max:N,indexFromEnd:F}=i,{roundedClasses:O}=Te(h),{backgroundColorClasses:q,backgroundColorStyles:K}=ae(V),{backgroundColorClasses:T,backgroundColorStyles:j}=ae(w),z=l(()=>`inset-${k.value?"block":"inline"}-${F.value?"end":"start"}`),E=l(()=>k.value?"height":"width"),P=l(()=>({[z.value]:"0%",[E.value]:"100%"})),R=l(()=>e.stop-e.start),y=l(()=>({[z.value]:M(e.start,"%"),[E.value]:M(R.value,"%")})),L=l(()=>g.value?(k.value?m.value.slice().reverse():m.value).map((s,C)=>{var d;const x=s.value!==_.value&&s.value!==N.value?M(s.position,"%"):void 0;return v("div",{key:s.value,class:["v-slider-track__tick",{"v-slider-track__tick--filled":s.position>=e.start&&s.position<=e.stop,"v-slider-track__tick--first":s.value===_.value,"v-slider-track__tick--last":s.value===N.value}],style:{[z.value]:x}},[(s.label||o["tick-label"])&&v("div",{class:"v-slider-track__tick-label"},[((d=o["tick-label"])==null?void 0:d.call(o,{tick:s,index:C}))??s.label])])}):[]);return ie(()=>v("div",{class:["v-slider-track",O.value,e.class],style:[{"--v-slider-track-size":M(b.value),"--v-slider-tick-size":M(f.value)},e.style]},[v("div",{class:["v-slider-track__background",T.value,{"v-slider-track__background--opacity":!!u.value||!V.value}],style:{...P.value,...j.value}},null),v("div",{class:["v-slider-track__fill",q.value],style:{...y.value,...K.value}},null),g.value&&v("div",{class:["v-slider-track__ticks",{"v-slider-track__ticks--always-show":g.value==="always"}]},[L.value])])),{}}});export{Be as V,Ne as a,Pe as b,xe as g,Le as m,Me as u};