PageSourceSearch

https://depot.dev/assets/Tabs-ODwxpYNe.js

js depot.dev collected 2026-09-24 19:20:13 UTC 12,137 bytes, 6 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="518a57a3-f638-5e47-88f5-39354e8c66a4")}catch(e){}}();
3!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0d3ec-ed02-7863-8b89-8a709a05f841")}catch(e){}}();(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`a8094e049e03f829f1c2e300bc93708abe9374a5`}}catch{}})();import{a as e}from"./chunk-DUZrb5sI.js";import{n as t}from"./preload-helper-BwnrSaRm.js";import{t as n}from"./jsx-runtime-BJ_8nwS3.js";import{t as r}from"./compiler-runtime-BjzEAB2a.js";import{t as i}from"./shim-BZFjJAG4.js";import{$ as a,C as o,S as s,X as c,Y as l,Z as u,c as d,d as f,l as p,m,n as h,t as g,v as _}from"./useBaseUiId-BQ3lzqs8.js";import{a as v,n as y,r as b}from"./stateAttributesMapping-C5x3BKq5.js";import{D as x,O as S,t as C}from"./inertValue-BB8nXyGZ.js";import{t as w}from"./getCssDimensions-BlHSblHd.js";import{t as T}from"./cn-M0Kz48di.js";import{t as E}from"./useControlled-D2fGLzfm.js";import{i as D,t as O}from"./useButton-DdymfiDl.js";import{n as k,t as A}from"./useCompositeListItem-C4b6lrT0.js";import{t as j}from"./CSPContext-DnN9kaeK.js";import{t as M}from"./useCompositeItem-CmNIWWRI.js";import{n as ee,t as N}from"./CompositeRoot-C-lDuoiT.js";var P=n(),F=e(t(),1);function I(){let[,e]=F.useState({});return F.useCallback(()=>{e({})},[])}var L=F.createContext(void 0);function R(){let e=F.useContext(L);if(e===void 0)throw Error(l(64));return e}var z={tabActivationDirection:e=>({"data-activation-direction":e})},B=F.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:l,style:u,...d}=e,g=e.defaultValue!==void 0,v=F.useRef([]),[y,b]=F.useState(()=>new Map),[x,S]=E({controlled:l,default:r,name:`Tabs`,state:`value`}),C=l!==void 0,[w,T]=F.useState(()=>new Map),D=F.useRef(void 0),O=F.useCallback(e=>V(w,e),[w]),[A,j]=F.useState(()=>({previousValue:x,tabActivationDirection:`none`})),{previousValue:M,tabActivationDirection:ee}=A,N=ee,I=!1;M!==x&&(N=H(M,x,a,w),I=M!=null&&x!=null&&O(x)==null);let R=I?M:x,B=M!==R||ee!==N;c(()=>{B&&j({previousValue:R,tabActivationDirection:N})},[R,B,N]);let U=p((e,t)=>{t.activationDirection=H(x,e,a,w),i?.(e,t),!t.isCanceled&&S(e)}),W=p((e,t)=>{i?.(e,f(t,void 0,void 0,{activationDirection:`none`}))}),G=p((e,t)=>(b(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{b(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),K=F.useCallback(e=>y.get(e),[y]),q=F.useCallback(e=>{for(let t of w.values())if(e===t.value)return t.id},[w]),J=F.useMemo(()=>({getTabElementBySelectedValue:O,getTabIdByPanelValue:q,getTabPanelIdByValue:K,onValueChange:U,orientation:a,registerMountedTabPanel:G,setTabMap:T,tabActivationDirection:N,value:x}),[O,q,K,U,a,G,T,N,x]),Y=F.useMemo(()=>{for(let e of w.values())if(e.value===x)return e},[w,x]),X=F.useMemo(()=>{for(let e of w.values())if(!e.disabled)return e.value},[w]),Z=F.useRef(!g),Q=F.useRef(r),te=F.useRef(g),ne=F.useRef(!1);c(()=>{if(C)return;function e(e,t){S(e),j({previousValue:e,tabActivationDirection:`none`}),W(e,t),Z.current=!1}if(w.size===0){ne.current&&x!==null&&!D.current?.isConnected&&e(null,s);return}ne.current=!0,D.current=w.keys().next().value;let t=Y?.disabled,n=Y==null&&x!==null;if(!t&&x===Q.current&&(te.current=!1),te.current&&t&&x===Q.current)return;let r=Z.current;if(t||n){let n=X??null;if(x===n){Z.current=!1;return}let i=s;r?i=_:t&&(i=m),e(n,i);return}r&&Y!=null&&(W(x,_),Z.current=!1)},[X,C,W,Y,S,w,x]);let re=h(`div`,e,{state:{orientation:a,tabActivationDirection:N},ref:t,props:d,stateAttributesMapping:z});return(0,P.jsx)(L.Provider,{value:J,children:(0,P.jsx)(k,{elementsRef:v,children:re})})});function V(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function H(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=V(r,e),c=V(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}var U=F.createContext(void 0);function W(){let e=F.useContext(U);if(e===void 0)throw Error(l(65));return e}var G=F.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:s,nativeButton:l=!0,style:u,...m}=e,{value:_,getTabPanelIdByValue:v,onValueChange:y,orientation:b,tabActivationDirection:C}=R(),{activateOnFocus:w,registerTabResizeObserverElement:T,tabsListElement:E}=W(),{highlightedIndex:k,onHighlightedIndexChange:A}=D(),j=g(s),{compositeProps:N,compositeRef:P,index:I}=M({metadata:F.useMemo(()=>({disabled:r,id:j,value:a}),[r,j,a])}),L=a===_,B=F.useRef(!1),V=F.useRef(null),H=p(e=>{V.current?.(),V.current=e?T(e):null});c(()=>
3{if(B.current){B.current=!1;return}if(!(L&&I>-1&&k!==I))return;let e=E;if(e!=null){let t=x(d(e));if(t&&S(e,t))return}r||A(I)},[L,I,k,A,r,E]);let{getButtonProps:U,buttonRef:G}=O({disabled:r,native:l,focusableWhenDisabled:!0}),K=v(a),q=F.useRef(!1),J=F.useRef(!1);function Y(e){y(a,f(o,e.nativeEvent,void 0,{activationDirection:`none`}))}function X(e){L||r||Y(e)}function Z(e){L||r||w&&(!q.current||J.current)&&Y(e)}function Q(e){if(L||r)return;q.current=!0,J.current=e.button===0;let t=d(e.currentTarget);function n(){q.current=!1,J.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return h(`button`,e,{state:{disabled:r,active:L,orientation:b,tabActivationDirection:C},ref:[t,G,P,H],props:[N,{role:`tab`,"aria-controls":K,"aria-selected":L,id:j,onClick:X,onFocus:Z,onPointerDown:Q,[ee]:L?``:void 0,onKeyDownCapture(){B.current=!0}},m,U],stateAttributesMapping:z})}),K=i();function q(){return a}function J(){return!1}function Y(){return!0}function X(){return(0,K.useSyncExternalStore)(q,J,Y)}function Z(e){let{script:t}=e,{nonce:n}=j();return X()?(0,P.jsx)(`script`,{nonce:n,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0}):null}var Q,te={...z,activeTabPosition:()=>null,activeTabSize:()=>null},ne=F.forwardRef(function(e,t){let{className:n,render:r,renderBeforeHydration:i=!1,style:a,...o}=e,{getTabElementBySelectedValue:s,orientation:c,tabActivationDirection:l,value:u}=R(),{tabsListElement:d,registerIndicatorUpdateListener:f}=W(),p=I();F.useEffect(()=>f(p),[f,p]);let m=0,g=0,_=0,v=0,y=0,b=0,x=!1;if(u!=null&&d!=null){let e=s(u);if(e!=null){x=!0;let{width:t,height:n}=w(e),{width:r,height:i}=w(d),a=e.getBoundingClientRect(),o=d.getBoundingClientRect(),s=r>0?o.width/r:1,c=i>0?o.height/i:1;if(s>2**-52&&c>2**-52){let e=a.left-o.left,t=a.top-o.top;m=e/s+d.scrollLeft-d.clientLeft,_=t/c+d.scrollTop-d.clientTop}else m=e.offsetLeft,_=e.offsetTop;y=t,b=n,g=d.scrollWidth-m-y,v=d.scrollHeight-_-b}}let S=x?{left:m,right:g,top:_,bottom:v}:null,C=x?{width:y,height:b}:null,T=x?{"--active-tab-left":`${m}px`,"--active-tab-right":`${g}px`,"--active-tab-top":`${_}px`,"--active-tab-bottom":`${v}px`,"--active-tab-width":`${y}px`,"--active-tab-height":`${b}px`}:void 0,E=h(`span`,e,{state:{orientation:c,activeTabPosition:S,activeTabSize:C,tabActivationDirection:l},ref:t,props:[{role:`presentation`,style:T,hidden:!(x&&y>0&&b>0)},o,{suppressHydrationWarning:!0}],stateAttributesMapping:te});return u==null?null:(0,P.jsxs)(F.Fragment,{children:[E,i&&(Q||=(0,P.jsx)(Z,{script:``}))]})}),re={...z,...y},ie=F.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...s}=e,{value:l,getTabIdByPanelValue:u,orientation:d,tabActivationDirection:f,registerMountedTabPanel:p}=R(),m=g(),{ref:_,index:y}=A(),x=r===l,{mounted:S,transitionStatus:w,setMounted:T}=v(x),E=!S,D=u(r),O={hidden:E,orientation:d,tabActivationDirection:f,transitionStatus:w},k=F.useRef(null),j=h(`div`,e,{state:O,ref:[t,_,k],props:[{"aria-labelledby":D,hidden:E,id:m,role:`tabpanel`,tabIndex:x?0:-1,inert:C(!x),"data-index":y},s],stateAttributesMapping:re});return b({open:x,ref:k,onComplete(){x||T(!1)}}),c(()=>{if(!(m==null||E&&!a))return p(r,m)},[E,a,r,m,p]),a||S?j:null}),ae=F.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:l,setTabMap:d,tabActivationDirection:f}=R(),[m,h]=F.useState(0),[g,_]=F.useState(null),v=F.useRef(new Set),y=F.useRef(new Set),b=F.useRef(null);c(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{v.current.forEach(e=>{e()})});return b.current=e,g&&e.observe(g),y.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),b.current=null}},[g]);let x=p(e=>(v.current.add(e),()=>{v.current.delete(e)})),S=p(e=>(y.current.add(e),b.current?.observe(e),()=>{y.current.delete(e),b.current?.unobserve(e)})),C={orientation:l,tabActivationDirection:f},w={"aria-orientation":l===`vertical`?`vertical`:void 0,role:`tablist`},T=F.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:x,registerTabResizeObserverElement:S,tabsListElement:g}),[n,x,S,g]);return(0,P.jsx)(U.Provider,{value:T,children:(0,P.jsx)(N,{render:a,className:r,style:o,state:C,refs:[t,_],props:[w,s],stateAttributesMapping:z,highlightedIndex:m,enableHomeAndEndKeys:!0,loopFocus:i,orientation:l,onHighlightedIndexChange:h,onMapChange:d,disabledIndices:u})})}),$=r();function oe(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=T(`flex flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(B,{"data-slot":`tabs`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function se(e){let t=(0,$.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,className:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=T(`relative scrollbar-none flex w-full gap-3 overflow-x-auto border-b border-depot-neutral-800 lg:gap-6`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,P.jsx)(ne,{"data-slot":`tabs-indicator`,renderBeforeHydration:!0,className:T(`absolute bottom-0 left-0 h-0.5 w-(--active-tab-width) translate-x-(--active-tab-left)`,`bg-depot-purple-to-light-blue`,`transition-[translate,width] duration-250 ease-[
3cubic-bezier(0.165,0.84,0.44,1)]`,`motion-reduce:transition-none`)}),t[6]=o):o=t[6];let s;return t[7]!==n||t[8]!==i||t[9]!==a?(s=(0,P.jsxs)(ae,{"data-slot":`tabs-list`,className:a,...i,children:[n,o]}),t[7]=n,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function ce(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=T(`flex flex-1 cursor-pointer items-end justify-start p-3 text-left lg:whitespace-nowrap`,`text-depot-neutral-50 hover:text-depot-theme-primary data-active:text-depot-theme-primary`,`transition-[color,opacity] duration-150 ease-out motion-reduce:transition-none`,`active:opacity-80`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(G,{"data-slot":`tabs-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function le(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=T(`w-full min-w-0 focus:outline-hidden`,`transition-opacity delay-150 duration-200 ease-out motion-reduce:transition-none motion-reduce:delay-0`,`data-ending-style:opacity-0 data-starting-style:opacity-0`,`data-ending-style:delay-0 data-ending-style:duration-150`,`data-ending-style:absolute data-ending-style:inset-x-0 data-ending-style:top-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,P.jsx)(ie,{"data-slot":`tabs-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}export{ce as i,le as n,se as r,oe as t};
4//# sourceMappingURL=Tabs-ODwxpYNe.js.map
5//# chunkId=01a0d3ec-ed02-7863-8b89-8a709a05f841
6//# debugId=518a57a3-f638-5e47-88f5-39354e8c66a4

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.