import{e as p,ab as B,a9 as h,aa as _,a7 as R,r as $,ae as M,m as f,o as m,w as u,X as v,n as e,ac as y,b as T,x as g,ad as I,p as P,af as k,ag as F,ah as L,ai as V,a6 as w,W as C,aj as S,a as j}from"./BoB2h2qv.js";import{R as O}from"./iebCrZCv.js";import{R as D}from"./DitP6xhH.js";import{u as E}from"./CJyYPLmM.js";const[q,H]=B("TabsRoot");var K=p({__name:"TabsRoot",props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:"automatic"},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(o,{emit:a}){const r=o,t=a,{orientation:i,unmountOnHide:l,dir:n}=h(r),s=E(n);_();const d=R(r,"modelValue",t,{defaultValue:r.defaultValue,passive:r.modelValue===void 0}),c=$();return H({modelValue:d,changeModelValue:b=>{d.value=b},orientation:i,dir:s,unmountOnHide:l,activationMode:r.activationMode,baseId:M(void 0,"reka-tabs"),tabsList:c}),(b,Q)=>(m(),f(e(y),{dir:e(s),"data-orientation":e(i),"as-child":b.asChild,as:b.as},{default:u(()=>[v(b.$slots,"default",{modelValue:e(d)})]),_:3},8,["dir","data-orientation","as-child","as"]))}}),N=K;function z(o,a){return`${o}-trigger-${a}`}function A(o,a){return`${o}-content-${a}`}var G=p({__name:"TabsList",props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(o){const a=o,{loop:r}=h(a),{forwardRef:t,currentElement:i}=_(),l=q();return l.tabsList=i,(n,s)=>(m(),f(e(O),{"as-child":"",orientation:e(l).orientation.value,dir:e(l).dir.value,loop:e(r)},{default:u(()=>[T(e(y),{ref:e(t),role:"tablist","as-child":n.asChild,as:n.as,"aria-orientation":e(l).orientation.value},{default:u(()=>[v(n.$slots,"default")]),_:3},8,["as-child","as","aria-orientation"])]),_:3},8,["orientation","dir","loop"]))}}),W=G,X=p({__name:"TabsTrigger",props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(o){const a=o,{forwardRef:r}=_(),t=q(),i=g(()=>z(t.baseId,a.value)),l=g(()=>A(t.baseId,a.value)),n=g(()=>a.value===t.modelValue.value);return(s,d)=>(m(),f(e(D),{"as-child":"",focusable:!s.disabled,active:n.value},{default:u(()=>[T(e(y),{id:i.value,ref:e(r),role:"tab",type:s.as==="button"?"button":void 0,as:s.as,"as-child":s.asChild,"aria-selected":n.value?"true":"false","aria-controls":l.value,"data-state":n.value?"active":"inactive",disabled:s.disabled,"data-disabled":s.disabled?"":void 0,"data-orientation":e(t).orientation.value,onMousedown:d[0]||(d[0]=P(c=>{!s.disabled&&c.ctrlKey===!1?e(t).changeModelValue(s.value):c.preventDefault()},["left"])),onKeydown:d[1]||(d[1]=I(c=>e(t).changeModelValue(s.value),["enter","space"])),onFocus:d[2]||(d[2]=()=>{const c=e(t).activationMode!=="manual";!n.value&&!s.disabled&&c&&e(t).changeModelValue(s.value)})},{default:u(()=>[v(s.$slots,"default")]),_:3},8,["id","type","as","as-child","aria-selected","aria-controls","data-state","disabled","data-disabled","data-orientation"])]),_:3},8,["focusable","active"]))}}),x=X;const ae=p({__name:"Tabs",props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["update:modelValue"],setup(o,{emit:a}){const i=k(o,a);return(l,n)=>(m(),f(e(N),F(L(e(i))),{default:u(()=>[v(l.$slots,"default")]),_:3},16))}}),te=p({__name:"TabsList",props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(o){const a=o,r=V(a,"class");return(t,i)=>(m(),f(e(W),w(e(r),{class:e(C)("inline-flex items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",a.class)}),{default:u(()=>[v(t.$slots,"default")]),_:3},16,["class"]))}}),J={class:"truncate"},se=p({__name:"TabsTrigger",props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(o){const a=o,r=V(a,"class"),t=S(r);return(i,l)=>(m(),f(e(x),w(e(t),{class:e(C)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",a.class)}),{default:u(()=>[j("span",J,[v(i.$slots,"default")])]),_:3},16,["class"]))}});export{te as _,se as a,ae as b,A as c,q as i,z as m};
