import{r as E,D as U,aO as G,I as X,H as D,s as H,x as P,J,z as W,y as j,c as o,G as B,a5 as q,e as a,F as r,T as K,A as Q,ap as Y}from"./index-BrhME0Dw.js";import{i as Z,n as p,u as h,e as ee,m as ae,l as te,G as le}from"./index-W86lZ1ks.js";import{u as re,a as oe,m as se}from"./dimensions-g-Hg75km.js";function ne(e,s){const t=E(),l=U(!1);if(G){const c=new IntersectionObserver(n=>{l.value=!!n.find(i=>i.isIntersecting)},s);X(()=>{c.disconnect()}),D(t,(n,i)=>{i&&(c.unobserve(i),l.value=!1),n&&c.observe(n)},{flush:"post"})}return{intersectionRef:t,isIntersecting:l}}const ie=P({absolute:Boolean,active:{type:Boolean,default:!0},bgColor:String,bgOpacity:[Number,String],bufferValue:{type:[Number,String],default:0},bufferColor:String,bufferOpacity:[Number,String],clickable:Boolean,color:String,height:{type:[Number,String],default:4},indeterminate:Boolean,max:{type:[Number,String],default:100},modelValue:{type:[Number,String],default:0},opacity:[Number,String],reverse:Boolean,stream:Boolean,striped:Boolean,roundedBar:Boolean,...se(),...te({location:"top"}),...ae(),...oe(),...Q()},"VProgressLinear"),ue=H()({name:"VProgressLinear",props:ie(),emits:{"update:modelValue":e=>!0},setup(e,s){var _;let{slots:t}=s;const l=J(e,"modelValue"),{isRtl:c,rtlClasses:n}=W(),{themeClasses:i}=j(e),{locationStyles:R}=Z(e),{textColorClasses:x,textColorStyles:F}=p(e,"color"),{backgroundColorClasses:N,backgroundColorStyles:V}=h(o(()=>e.bgColor||e.color)),{backgroundColorClasses:O,backgroundColorStyles:T}=h(o(()=>e.bufferColor||e.bgColor||e.color)),{backgroundColorClasses:y,backgroundColorStyles:S}=h(e,"color"),{roundedClasses:w}=ee(e),{intersectionRef:f,isIntersecting:I}=ne(),v=o(()=>parseFloat(e.max)),u=o(()=>parseFloat(e.height)),b=o(()=>B(parseFloat(e.bufferValue)/v.value*100,0,100)),k=o(()=>B(parseFloat(l.value)/v.value*100,0,100)),m=o(()=>c.value!==e.reverse),L=o(()=>e.indeterminate?"fade-transition":"slide-x-transition"),g=q&&((_=window.matchMedia)==null?void 0:_.call(window,"(forced-colors: active)").matches);function M(d){if(!f.value)return;const{left:$,right:z,width:C}=f.value.getBoundingClientRect(),A=m.value?C-d.clientX+(z-C):d.clientX-$;l.value=Math.round(A/C*v.value)}return re(()=>a(e.tag,{ref:f,class:["v-progress-linear",{"v-progress-linear--absolute":e.absolute,"v-progress-linear--active":e.active&&I.value,"v-progress-linear--reverse":m.value,"v-progress-linear--rounded":e.rounded,"v-progress-linear--rounded-bar":e.roundedBar,"v-progress-linear--striped":e.striped},w.value,i.value,n.value,e.class],style:[{bottom:e.location==="bottom"?0:void 0,top:e.location==="top"?0:void 0,height:e.active?r(u.value):0,"--v-progress-linear-height":r(u.value),...e.absolute?R.value:{}},e.style],role:"progressbar","aria-hidden":e.active?"false":"true","aria-valuemin":"0","aria-valuemax":e.max,"aria-valuenow":e.indeterminate?void 0:Math.min(parseFloat(l.value),v.value),onClick:e.clickable&&M},{default:()=>[e.stream&&a("div",{key:"stream",class:["v-progress-linear__stream",x.value],style:{...F.value,[m.value?"left":"right"]:r(-u.value),borderTop:`${r(u.value/2)} dotted`,opacity:parseFloat(e.bufferOpacity),top:`calc(50% - ${r(u.value/4)})`,width:r(100-b.value,"%"),"--v-progress-linear-stream-to":r(u.value*(m.value?1:-1))}},null),a("div",{class:["v-progress-linear__background",g?void 0:N.value],style:[V.value,{opacity:parseFloat(e.bgOpacity),width:e.stream?0:void 0}]},null),a("div",{class:["v-progress-linear__buffer",g?void 0:O.value],style:[T.value,{opacity:parseFloat(e.bufferOpacity),width:r(b.value,"%")}]},null),a(K,{name:L.value},{default:()=>[e.indeterminate?a("div",{class:"v-progress-linear__indeterminate"},[["long","short"].map(d=>a("div",{key:d,class:["v-progress-linear__indeterminate",d,g?void 0:y.value],style:S.value},null))]):a("div",{class:["v-progress-linear__determinate",g?void 0:y.value],style:[S.value,{width:r(k.value,"%")}]},null)]}),t.default&&a("div",{class:"v-progress-linear__content"},[t.default({value:k.value,buffer:b.value})])]})),{}}}),me=P({loading:[Boolean,String]},"loader");function ge(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Y();return{loaderClasses:o(()=>({[`${s}--loading`]:e.loading}))}}function fe(e,s){var l;let{slots:t}=s;return a("div",{class:`${e.name}__loader`},[((l=t.default)==null?void 0:l.call(t,{color:e.color,isActive:e.active}))||a(ue,{absolute:e.absolute,active:e.active,color:e.color,height:"2",indeterminate:!0},null)])}const be=le("v-spacer","div","VSpacer");export{fe as L,be as V,ne as a,me as m,ge as u};
