1import{n as R,z as S,v as x,o as z,p as I,a4 as k,B as q,a9 as h,a7 as B,L as M,ad as O,an as W,ak as $,a8 as C,u as y,ab as F,k as b,q as A}from"./DFsHQQM9.js";function E(t){return t<.5?4*t*t*t:1-(-2*t+2)**3/2}function K(t,m={}){const{duration:u=500}=m;function d(i){if(!t.value)return;const o=t.value,v=o.getBoundingClientRect(),T=i.getBoundingClientRect(),g=window.getComputedStyle(o),l=Number.parseFloat(g.paddingLeft)||0,c=o.scrollLeft,s=T.left-v.left,w=c+s-l;if(Math.abs(c-w)<1)return;const p=performance.now(),e=w-c;function n(f){const r=f-p,a=Math.min(r/u,1),L=E(a);o.scrollLeft=c+e*L,a<1&&requestAnimationFrame(n)}requestAnimationFrame(n)}return{scrollToItem:d}}const N=["onClick","onKeydown"],j=R({__name:"TabToggle",props:{tabs:{},equalWidth:{type:Boolean,default:!1},variant:{default:"pill"}},emits:["changed"],setup(t){const m=t,u=b(0),d=b(null),i=b([]),o=b({}),v=b(null),{scrollToItem:T}=K(v);function g(e,n){u.value=e,l(),n&&n.currentTarget instanceof HTMLElement&&x(()=>{T(n.currentTarget)})}function l(){const e=i.value[u.value];e&&(o.value={width:`${e.offsetWidth}px`,transform:`translateX(${e.offsetLeft}px)`})}function c(e,n){e&&(i.value[n]=e)}let s=null;function w(){s?.disconnect(),s=new ResizeObserver(()=>{l()}),d.value&&s.observe(d.value),i.value.forEach(e=>{e&&s.observe(e)})}S(()=>{x(()=>{l(),w()})}),z(()=>{s?.disconnect()}),I(()=>m.tabs,()=>{x(()=>{w(),l()})});const p=A(()=>{if(m.equalWidth)return Math.max(...i.value.map(e=>e?.scrollWidth??0))});return(e,n)=>(k(),q("div",{ref_key:"tabItems",ref:v,class:h(["tw-w-full tw-overflow-x-auto overscroll-x remove-scrollbar",{"tw-p-px":t.variant==="pill","tw-border-b-1/2 tw-border-b-default":t.variant==="underline"}])},[B("div",{ref_key:"containerRef",ref:d,class:h(["switch--holder switch--buttons tw-relative tw-flex-nowrap",{"tw-inline-flex tw-items-center tw-ring-1/2 tw-ring-default tw-border-4 tw-border-transparent tw-bg-container-strong tw-rounded-24 corner-squircle":t.variant==="pill","tw-flex tw-items-bottom":t.variant==="underline"}])},[(k(!0),q(M,null,O(t.tabs,(f,r)=>(k(),q("div",{key:r,ref_for:!0,ref:a=>c(a,r),class:h(["grouped-content--toggle-activator tw-relative type-body-md tw-text-center tw-whitespace-nowrap tw-cursor-pointer tw-select-none tw-z-2",{"tw-py-2 sm:tw-py-3 tw-px-4 sm:tw-px-6 tw-text-default tw-rounded-24 corner-squircle":t.variant==="pill","tw-py-2 sm:tw-py-3 tw-px-5 tw-text-subtle tw-border-b tw-border-b-transparent tw-duration-200 no-focus-ring focus-visible:tw-border-b-brand tw-outline-none focus-visible:tw-outline-none":t.variant==="underline","hover:tw-border-b-strong":t.variant==="underline"&&y(u)!==r}]),style:C(y(p)?{minWidth:`${y(p)}px`}:void 0),tabindex:"0",onClick:$(a=>[e.$emit("changed",{tab:f,index:r}),g(r,a)],["prevent"]),onKeydown:W(a=>[e.$emit("changed",{tab:f,index:r}),g(r,a)],["enter"])},F(f.label),47,N))),128)),B("div",{class:h(["active-tab tw-absolute tw-z-1 tw-transition-transform tw-duration-300 tw-ease-in-out",{"tw-h-full tw-top-0 tw-left-0 tw-border-1/2 tw-border-default tw-bg-container-default tw-rounded-20 corner-squircle":t.variant==="pill","tw-left-0 tw-right-0 tw-bottom-0 tw-border-b tw-border-b-brand":t.variant==="underline"}]),style:C(y(o))},null,6)],2)],2))}}),H=Object.assign(j,{__name:"TabToggle"});export{H as _,K as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.