import{J as X,I as Y,i as M,j as $,K as q,L as F,l as J,d as K,o as L,e as O}from"./VImg-7a057c50.js";import{p as z,ax as W,g as R,c as G,s as p,r as w,j as m,k as V,f as Q,t as o,i as Z,a as ee}from"./index-e5db0b73.js";import{m as te,a as E}from"./VSlideGroup-3a4ba80a.js";const _=Symbol.for("vuetify:v-tabs"),ae=z({fixed:Boolean,sliderColor:String,hideSlider:Boolean,direction:{type:String,default:"horizontal"},...W(X({selectedClass:"v-tab--selected",variant:"text"}),["active","block","flat","location","position","symbol"])},"VTab"),se=R()({name:"VTab",props:ae(),setup(e,t){let{slots:l,attrs:b}=t;const{textColorClasses:y,textColorStyles:h}=Y(e,"sliderColor"),a=G(()=>e.direction==="horizontal"),c=p(!1),f=w(),s=w();function D(x){var T,k;let{value:u}=x;if(c.value=u,u){const C=(k=(T=f.value)==null?void 0:T.$el.parentElement)==null?void 0:k.querySelector(".v-tab--selected .v-tab__slider"),S=s.value;if(!C||!S)return;const I=getComputedStyle(C).color,n=C.getBoundingClientRect(),r=S.getBoundingClientRect(),g=a.value?"x":"y",v=a.value?"X":"Y",B=a.value?"right":"bottom",i=a.value?"width":"height",j=n[g],A=r[g],d=j>A?n[B]-r[B]:n[g]-r[g],H=Math.sign(d)>0?a.value?"right":"bottom":Math.sign(d)<0?a.value?"left":"top":"center",N=(Math.abs(d)+(Math.sign(d)<0?n[i]:r[i]))/Math.max(n[i],r[i]),U=n[i]/r[i],P=1.5;q(S,{backgroundColor:[I,"currentcolor"],transform:[`translate${v}(${d}px) scale${v}(${U})`,`translate${v}(${d/P}px) scale${v}(${(N-1)/P+1})`,"none"],transformOrigin:Array(3).fill(H)},{duration:225,easing:F})}}return M(()=>{const[x]=$.filterProps(e);return m($,V({symbol:_,ref:f,class:["v-tab",e.class],style:e.style,tabindex:c.value?0:-1,role:"tab","aria-selected":String(c.value),active:!1,block:e.fixed,maxWidth:e.fixed?300:void 0,rounded:0},x,b,{"onGroup:selected":D}),{default:()=>{var u;return[((u=l.default)==null?void 0:u.call(l))??e.text,!e.hideSlider&&m("div",{ref:s,class:["v-tab__slider",y.value],style:h.value},null)]}})}),{}}});function oe(e){return e?e.map(t=>typeof t=="string"?{title:t,value:t}:t):[]}const le=z({alignTabs:{type:String,default:"start"},color:String,fixedTabs:Boolean,items:{type:Array,default:()=>[]},stacked:Boolean,bgColor:String,grow:Boolean,height:{type:[Number,String],default:void 0},hideSlider:Boolean,sliderColor:String,...te({mandatory:"force"}),...J(),...K()},"VTabs"),ce=R()({name:"VTabs",props:le(),emits:{"update:modelValue":e=>!0},setup(e,t){let{slots:l}=t;const b=Q(e,"modelValue"),y=G(()=>oe(e.items)),{densityClasses:h}=L(e),{backgroundColorClasses:a,backgroundColorStyles:c}=O(o(e,"bgColor"));return Z({VTab:{color:o(e,"color"),direction:o(e,"direction"),stacked:o(e,"stacked"),fixed:o(e,"fixedTabs"),sliderColor:o(e,"sliderColor"),hideSlider:o(e,"hideSlider")}}),M(()=>{const[f]=E.filterProps(e);return m(E,V(f,{modelValue:b.value,"onUpdate:modelValue":s=>b.value=s,class:["v-tabs",`v-tabs--${e.direction}`,`v-tabs--align-tabs-${e.alignTabs}`,{"v-tabs--fixed-tabs":e.fixedTabs,"v-tabs--grow":e.grow,"v-tabs--stacked":e.stacked},h.value,a.value,e.class],style:[{"--v-tabs-height":ee(e.height)},c.value,e.style],role:"tablist",symbol:_}),{default:()=>[l.default?l.default():y.value.map(s=>m(se,V(s,{key:s.title}),null))]})}),{}}});export{ce as V,se as a};
