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