PageSourceSearch

https://perps-widget.vercel.app/assets/tabs-B-zLeiEH.js

js perps-widget.vercel.app collected 2026-10-03 07:30:50 UTC 8,531 bytes, 1 lines download raw bytes

vendor: 8,531 bytes, line 1
1import{cT as n,fK as Z,fL as z,fM as N,fN as _,cR as A,fO as $,fP as J,fQ as Y,fR as tt,fS as et,fT as W,fU as Q,fV as nt,fW as at,fX as ot,fY as it,fZ as st,cP as O,dc as rt}from"./index-CYQNBxGl.js";import{u as lt,a as ut,C as ct,b as dt,A as ft,c as bt,d as vt}from"./CompositeRoot-Bv2fNlRI.js";const q=n.createContext(void 0);function F(){const t=n.useContext(q);if(t===void 0)throw new Error(Z(64));return t}let pt=(function(t){return t.activationDirection="data-activation-direction",t.orientation="data-orientation",t})({});const K={tabActivationDirection:t=>({[pt.activationDirection]:t})},gt=n.forwardRef(function(a,l){const{className:T,defaultValue:e=0,onValueChange:u,orientation:i="horizontal",render:g,value:b,...x}=a,C=lt(),M=Object.hasOwn(a,"defaultValue"),y=n.useRef([]),[E,c]=n.useState(()=>new Map),[d,h]=ut({controlled:b,default:e,name:"Tabs",state:"value"}),I=b!==void 0,[r,P]=n.useState(()=>new Map),[w,D]=n.useState("none"),v=z((o,p)=>{u?.(o,p),!p.isCanceled&&(h(o),D(p.activationDirection))}),f=z((o,p)=>{c(s=>{if(s.get(o)===p)return s;const m=new Map(s);return m.set(o,p),m})}),R=z((o,p)=>{c(s=>{if(!s.has(o)||s.get(o)!==p)return s;const m=new Map(s);return m.delete(o),m})}),S=n.useCallback(o=>E.get(o),[E]),j=n.useCallback(o=>{for(const p of r.values())if(o===p?.value)return p?.id},[r]),L=n.useCallback(o=>{if(o===void 0)return null;for(const[p,s]of r.entries())if(s!=null&&o===(s.value??s.index))return p;return null},[r]),k=n.useMemo(()=>({direction:C,getTabElementBySelectedValue:L,getTabIdByPanelValue:j,getTabPanelIdByValue:S,onValueChange:v,orientation:i,registerMountedTabPanel:f,setTabMap:P,unregisterMountedTabPanel:R,tabActivationDirection:w,value:d}),[C,L,j,S,v,i,f,P,R,w,d]),B=n.useMemo(()=>{for(const o of r.values())if(o!=null&&o.value===d)return o},[r,d]),V=n.useMemo(()=>{for(const o of r.values())if(o!=null&&!o.disabled)return o.value},[r]);N(()=>{if(I||r.size===0)return;const o=B?.disabled,p=B==null&&d!==null;if(M&&o&&d===e||!o&&!p)return;const m=V??null;d!==m&&(h(m),D("none"))},[e,V,M,I,B,D,h,r,d]);const H=_("div",a,{state:{orientation:i,tabActivationDirection:w},ref:l,props:x,stateAttributesMapping:K});return A.jsx(q.Provider,{value:k,children:A.jsx(ct,{elementsRef:y,children:H})})}),G=n.createContext(void 0);function xt(){const t=n.useContext(G);if(t===void 0)throw new Error(Z(65));return t}const ht=n.forwardRef(function(a,l){const{className:T,disabled:e=!1,render:u,value:i,id:g,nativeButton:b=!0,...x}=a,{value:C,getTabPanelIdByValue:M,orientation:y}=F(),{activateOnFocus:E,highlightedTabIndex:c,onTabActivation:d,setHighlightedTabIndex:h,tabsListElement:I}=xt(),r=$(g),P=n.useMemo(()=>({disabled:e,id:r,value:i}),[e,r,i]),{compositeProps:w,compositeRef:D,index:v}=dt({metadata:P}),f=i===C,R=n.useRef(!1);N(()=>{if(R.current){R.current=!1;return}if(!(f&&v>-1&&c!==v))return;const s=I;if(s!=null){const m=J(Y(s));if(m&&tt(s,m))return}e||h(v)},[f,v,c,h,e,I]);const{getButtonProps:S,buttonRef:j}=et({disabled:e,native:b,focusableWhenDisabled:!0}),L=M(i),k=n.useRef(!1),B=n.useRef(!1);function V(s){f||e||d(i,W(Q,s.nativeEvent,void 0,{activationDirection:"none"}))}function U(s){f||(v>-1&&!e&&h(v),!e&&E&&(!k.current||k.current&&B.current)&&d(i,W(Q,s.nativeEvent,void 0,{activationDirection:"none"})))}function H(s){if(f||e)return;k.current=!0;function m(){k.current=!1,B.current=!1}(!s.button||s.button===0)&&(B.current=!0,Y(s.currentTarget).addEventListener("pointerup",m,{once:!0}))}return _("button",a,{state:{disabled:e,active:f,orientation:y},ref:[l,j,D],props:[w,{role:"tab","aria-controls":L,"aria-selected":f,id:r,onClick:V,onFocus:U,onPointerDown:H,[ft]:f?"":void 0,onKeyDownCapture(){R.current=!0}},x,S]})});let mt=(function(t){return t.index="data-index",t.activationDirection="data-activation-direction",t.orientation="data-orientation",t.hidden="data-hidden",t})({});const Tt={...K,...it},Ct=n.forwardRef(function(a,l){const{className:T,value:e,render:u,keepMounted:i=!1,...g}=a,{value:b,getTabIdByPanelValue:x,orientation:C,tabActivationDirection:M,registerMountedTabPanel:y,unregisterMountedTabPanel:E}=F(),c=$(),d=n.useMemo(()=>({id:c,value:e}),[c,e]),{ref:h,index:I}=bt({metadata:d}),r=e===b,{mounted:P,transitionStatus:w,setMounted:D}=nt(r),v=!P,f=x(e),R={hidden:v,orientation:C,tabActivationDirection:M,transitionStatus:w},S=n.useRef(null),j=_("div",a,{state:R,ref:[l,h,S],props:[{"aria-labelledby":f,hidden:v,id:c,role:"tabpanel",tabIndex:r?0:-1,inert:at(!r),[mt.index]:I},g],stateAttributesMapping:Tt});return ot({open:r,ref:S,onComplete(){r||D(!1)}}),N(()=>{if(!(v&&!i)&&c!=null)return y(e,c),()=>{E(e,c)}},[v,i,e,c,y,E]),i||P?j:null}),Mt=n.forwardRef(function(a,l){const{activateOnFocus:T=!1,className:e,loopFocus:u=!0,render:i,...g}=a,{getTabElementBySelectedValue:b,onValueChange:x,orientation:C,value:M,setTabMap:y,tabActivationDirection:E}=F(),[c,d]=n.useState(0),[h,I]=n.useState(null),r=Rt(M,C,h,b),P=z((f,R)=>{if(f!==M){const S=r(f);R.activationDirection=S,x(f,R)}}),w={orientation:C,tabActivationDirection:E},D={"aria-orientation":C==="vertical"?"vertical":void 0,role:"tablist"},v=n.useMemo(()=>({activateOnFocus:T,highlightedTabIndex:c,onTabActivation:P,setHighlightedTabIndex:d,tabsListElement:h,value:M}),[T,c,P,d,h,M]);return A.jsx(G.Provider,{value:v,children:A.jsx(vt,{render:i,className:e,state:w,refs:[l,I],props:[D,g],stateAttributesMapping:K,highlightedIndex:c,enableHomeAndEndKeys:!0,loopFocus:u,orientation:C,onHighlightedIndexChange:d,onMapChange:y,disabledIndices:st})})});function X(t,a){const{left:l,top:T}=t.getBoundingClientRect(),{left:e,top:u}=a.getBoundingClientRect(),i=l-e,g=T-u;return{left:i,top:g}}function Rt(t,a,l,T){const[e,u]=n.useState(null);return N(()=>{if(t==null||l==null){u(null);return}const i=T(t);if(i==null){u(null);return}const{left:g,top:b}=X(i,l);u(a==="horizontal"?g:b)},[a,T,l,t]),n.useCallback(i=>{if(i===t)return"none";if(i==null)return u(null),"none";if(i!=null&&l!=null){const g=T(i);if(g!=null){const{left:b,top:x}=X(g,l);if(e==null)return u(a==="horizontal"?b:x),"none";if(a==="horizontal"){if(b<e)return u(b),"left";if(b>e)return u(b),"right"}else{if(x<e)return u(x),"up";if(x>e)return u(x),"down"}}}return"none"},[T,a,e,l,t])}function Dt({className:t,orientation:a="horizontal",...l}){return A.jsx(gt,{"data-slot":"tabs","data-orientation":a,className:O("gap-2 group/tabs flex data-[orientation=horizontal]:flex-col",t),...l})}const Pt=rt("rounded-lg p-0 group-data-horizontal/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-2.5 bg-transparent",pill:"gap-1 bg-transparent p-0 h-auto",contained:"bg-surface-2 h-12 p-[5px] rounded-[10px] gap-[5px] w-full overflow-hidden"}},defaultVariants:{variant:"default"}});function St({className:t,variant:a="default",...l}){return A.jsx(Mt,{"data-slot":"tabs-list","data-variant":a,className:O(Pt({variant:a}),t),...l})}function yt({className:t,...a}){return A.jsx(ht,{"data-slot":"tabs-trigger",className:O("relative inline-flex h-9 flex-1 items-center justify-center whitespace-nowrap rounded-xl px-4 py-2 text-sm font-semibold transition-all","bg-surface-2 text-muted-foreground","data-active:bg-white data-active:text-black data-active:border data-active:border-white","group-data-[variant=pill]/tabs-list:bg-gray-5 group-data-[variant=pill]/tabs-list:rounded-full","group-data-[variant=pill]/tabs-list:data-active:bg-foreground group-data-[variant=pill]/tabs-list:data-active:text-background","group-data-[variant=contained]/tabs-list:bg-transparent group-data-[variant=contained]/tabs-list:text-gray-2 group-data-[variant=contained]/tabs-list:rounded-[12px] group-data-[variant=contained]/tabs-list:h-9 group-data-[variant=contained]/tabs-list:border group-data-[variant=contained]/tabs-list:border-transparent","group-data-[variant=contained]/tabs-list:data-active:bg-white group-data-[variant=contained]/tabs-list:data-active:text-black group-data-[variant=contained]/tabs-list:data-active:border-white","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","[&_svg:not([class*='size-'])]:size-3.5 [&_svg]:pointer-events-none [&_svg]:shrink-0",t),...a})}function At({className:t,...a}){return A.jsx(Ct,{"data-slot":"tabs-content",className:O("text-sm flex-1 outline-none",t),...a})}export{St as T,At as a,yt as b,Dt as c};

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.