@mcp-use/inspector 0.2.1 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -309,7 +309,7 @@ Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}
309
309
 
310
310
  If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
311
311
 
312
- For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return _.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},WW="DialogDescriptionWarning",KW=({contentRef:t,descriptionId:e})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${NF(WW).contentName}}.`;return _.useEffect(()=>{const n=t.current?.getAttribute("aria-describedby");e&&n&&(document.getElementById(e)||console.warn(a))},[a,t,e]),null},IF=gF,ZW=bF,kF=EF,OF=SF,DF=_F,XW=wF,QW=AF;function Pf({...t}){return v.jsx(IF,{"data-slot":"dialog",...t})}function Dv({...t}){return v.jsx(ZW,{"data-slot":"dialog-trigger",...t})}function JW({...t}){return v.jsx(kF,{"data-slot":"dialog-portal",...t})}function e7({className:t,...e}){return v.jsx(OF,{"data-slot":"dialog-overlay",className:Ye("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e})}function Uf({className:t,children:e,showCloseButton:r=!0,...a}){return v.jsxs(JW,{"data-slot":"dialog-portal",children:[v.jsx(e7,{}),v.jsxs(DF,{"data-slot":"dialog-content",className:Ye("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...a,children:[e,r&&v.jsxs(QW,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[v.jsx(f8,{}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Lv({className:t,...e}){return v.jsx("div",{"data-slot":"dialog-header",className:Ye("flex flex-col gap-2 text-center sm:text-left",t),...e})}function Mv({className:t,...e}){return v.jsx(XW,{"data-slot":"dialog-title",className:Ye("text-lg leading-none font-semibold",t),...e})}function KT(t){const e=t+"CollectionProvider",[r,a]=lo(e),[n,s]=r(e,{collectionRef:{current:null},itemMap:new Map}),u=x=>{const{scope:w,children:T}=x,R=Se.useRef(null),A=Se.useRef(new Map).current;return v.jsx(n,{scope:w,itemMap:A,collectionRef:R,children:T})};u.displayName=e;const c=t+"CollectionSlot",f=Ko(c),p=Se.forwardRef((x,w)=>{const{scope:T,children:R}=x,A=s(c,T),I=jt(w,A.collectionRef);return v.jsx(f,{ref:I,children:R})});p.displayName=c;const m=t+"CollectionItemSlot",h="data-radix-collection-item",g=Ko(m),y=Se.forwardRef((x,w)=>{const{scope:T,children:R,...A}=x,I=Se.useRef(null),O=jt(w,I),C=s(m,T);return Se.useEffect(()=>(C.itemMap.set(I,{ref:I,...A}),()=>void C.itemMap.delete(I))),v.jsx(g,{[h]:"",ref:O,children:R})});y.displayName=m;function E(x){const w=s(t+"CollectionConsumer",x);return Se.useCallback(()=>{const R=w.collectionRef.current;if(!R)return[];const A=Array.from(R.querySelectorAll(`[${h}]`));return Array.from(w.itemMap.values()).sort((C,N)=>A.indexOf(C.ref.current)-A.indexOf(N.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:u,Slot:p,ItemSlot:y},E,a]}var t7=_.createContext(void 0);function ZT(t){const e=_.useContext(t7);return t||e||"ltr"}const r7=["top","right","bottom","left"],to=Math.min,Tn=Math.max,fp=Math.round,bf=Math.floor,wa=t=>({x:t,y:t}),n7={left:"right",right:"left",bottom:"top",top:"bottom"},a7={start:"end",end:"start"};function xw(t,e,r){return Tn(t,to(e,r))}function pi(t,e){return typeof t=="function"?t(e):t}function mi(t){return t.split("-")[0]}function Ul(t){return t.split("-")[1]}function XT(t){return t==="x"?"y":"x"}function QT(t){return t==="y"?"height":"width"}const i7=new Set(["top","bottom"]);function Ea(t){return i7.has(mi(t))?"y":"x"}function JT(t){return XT(Ea(t))}function o7(t,e,r){r===void 0&&(r=!1);const a=Ul(t),n=JT(t),s=QT(n);let u=n==="x"?a===(r?"end":"start")?"right":"left":a==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(u=pp(u)),[u,pp(u)]}function s7(t){const e=pp(t);return[ww(t),e,ww(e)]}function ww(t){return t.replace(/start|end/g,e=>a7[e])}const ek=["left","right"],tk=["right","left"],l7=["top","bottom"],u7=["bottom","top"];function c7(t,e,r){switch(t){case"top":case"bottom":return r?e?tk:ek:e?ek:tk;case"left":case"right":return e?l7:u7;default:return[]}}function d7(t,e,r,a){const n=Ul(t);let s=c7(mi(t),r==="start",a);return n&&(s=s.map(u=>u+"-"+n),e&&(s=s.concat(s.map(ww)))),s}function pp(t){return t.replace(/left|right|bottom|top/g,e=>n7[e])}function f7(t){return{top:0,right:0,bottom:0,left:0,...t}}function LF(t){return typeof t!="number"?f7(t):{top:t,right:t,bottom:t,left:t}}function mp(t){const{x:e,y:r,width:a,height:n}=t;return{width:a,height:n,top:r,left:e,right:e+a,bottom:r+n,x:e,y:r}}function rk(t,e,r){let{reference:a,floating:n}=t;const s=Ea(e),u=JT(e),c=QT(u),f=mi(e),p=s==="y",m=a.x+a.width/2-n.width/2,h=a.y+a.height/2-n.height/2,g=a[c]/2-n[c]/2;let y;switch(f){case"top":y={x:m,y:a.y-n.height};break;case"bottom":y={x:m,y:a.y+a.height};break;case"right":y={x:a.x+a.width,y:h};break;case"left":y={x:a.x-n.width,y:h};break;default:y={x:a.x,y:a.y}}switch(Ul(e)){case"start":y[u]-=g*(r&&p?-1:1);break;case"end":y[u]+=g*(r&&p?-1:1);break}return y}const p7=async(t,e,r)=>{const{placement:a="bottom",strategy:n="absolute",middleware:s=[],platform:u}=r,c=s.filter(Boolean),f=await(u.isRTL==null?void 0:u.isRTL(e));let p=await u.getElementRects({reference:t,floating:e,strategy:n}),{x:m,y:h}=rk(p,a,f),g=a,y={},E=0;for(let x=0;x<c.length;x++){const{name:w,fn:T}=c[x],{x:R,y:A,data:I,reset:O}=await T({x:m,y:h,initialPlacement:a,placement:g,strategy:n,middlewareData:y,rects:p,platform:u,elements:{reference:t,floating:e}});m=R??m,h=A??h,y={...y,[w]:{...y[w],...I}},O&&E<=50&&(E++,typeof O=="object"&&(O.placement&&(g=O.placement),O.rects&&(p=O.rects===!0?await u.getElementRects({reference:t,floating:e,strategy:n}):O.rects),{x:m,y:h}=rk(p,g,f)),x=-1)}return{x:m,y:h,placement:g,strategy:n,middlewareData:y}};async function pc(t,e){var r;e===void 0&&(e={});const{x:a,y:n,platform:s,rects:u,elements:c,strategy:f}=t,{boundary:p="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:g=!1,padding:y=0}=pi(e,t),E=LF(y),w=c[g?h==="floating"?"reference":"floating":h],T=mp(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(w)))==null||r?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:p,rootBoundary:m,strategy:f})),R=h==="floating"?{x:a,y:n,width:u.floating.width,height:u.floating.height}:u.reference,A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),I=await(s.isElement==null?void 0:s.isElement(A))?await(s.getScale==null?void 0:s.getScale(A))||{x:1,y:1}:{x:1,y:1},O=mp(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:R,offsetParent:A,strategy:f}):R);return{top:(T.top-O.top+E.top)/I.y,bottom:(O.bottom-T.bottom+E.bottom)/I.y,left:(T.left-O.left+E.left)/I.x,right:(O.right-T.right+E.right)/I.x}}const m7=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:a,placement:n,rects:s,platform:u,elements:c,middlewareData:f}=e,{element:p,padding:m=0}=pi(t,e)||{};if(p==null)return{};const h=LF(m),g={x:r,y:a},y=JT(n),E=QT(y),x=await u.getDimensions(p),w=y==="y",T=w?"top":"left",R=w?"bottom":"right",A=w?"clientHeight":"clientWidth",I=s.reference[E]+s.reference[y]-g[y]-s.floating[E],O=g[y]-s.reference[y],C=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p));let N=C?C[A]:0;(!N||!await(u.isElement==null?void 0:u.isElement(C)))&&(N=c.floating[A]||s.floating[E]);const D=I/2-O/2,L=N/2-x[E]/2-1,P=to(h[T],L),$=to(h[R],L),W=P,ee=N-x[E]-$,te=N/2-x[E]/2+D,ie=xw(W,te,ee),H=!f.arrow&&Ul(n)!=null&&te!==ie&&s.reference[E]/2-(te<W?P:$)-x[E]/2<0,K=H?te<W?te-W:te-ee:0;return{[y]:g[y]+K,data:{[y]:ie,centerOffset:te-ie-K,...H&&{alignmentOffset:K}},reset:H}}}),h7=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,a;const{placement:n,middlewareData:s,rects:u,initialPlacement:c,platform:f,elements:p}=e,{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:x=!0,...w}=pi(t,e);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const T=mi(n),R=Ea(c),A=mi(c)===c,I=await(f.isRTL==null?void 0:f.isRTL(p.floating)),O=g||(A||!x?[pp(c)]:s7(c)),C=E!=="none";!g&&C&&O.push(...d7(c,x,E,I));const N=[c,...O],D=await pc(e,w),L=[];let P=((a=s.flip)==null?void 0:a.overflows)||[];if(m&&L.push(D[T]),h){const te=o7(n,u,I);L.push(D[te[0]],D[te[1]])}if(P=[...P,{placement:n,overflows:L}],!L.every(te=>te<=0)){var $,W;const te=((($=s.flip)==null?void 0:$.index)||0)+1,ie=N[te];if(ie&&(!(h==="alignment"?R!==Ea(ie):!1)||P.every(V=>Ea(V.placement)===R?V.overflows[0]>0:!0)))return{data:{index:te,overflows:P},reset:{placement:ie}};let H=(W=P.filter(K=>K.overflows[0]<=0).sort((K,V)=>K.overflows[1]-V.overflows[1])[0])==null?void 0:W.placement;if(!H)switch(y){case"bestFit":{var ee;const K=(ee=P.filter(V=>{if(C){const X=Ea(V.placement);return X===R||X==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(X=>X>0).reduce((X,le)=>X+le,0)]).sort((V,X)=>V[1]-X[1])[0])==null?void 0:ee[0];K&&(H=K);break}case"initialPlacement":H=c;break}if(n!==H)return{reset:{placement:H}}}return{}}}};function nk(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function ak(t){return r7.some(e=>t[e]>=0)}const g7=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:a="referenceHidden",...n}=pi(t,e);switch(a){case"referenceHidden":{const s=await pc(e,{...n,elementContext:"reference"}),u=nk(s,r.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:ak(u)}}}case"escaped":{const s=await pc(e,{...n,altBoundary:!0}),u=nk(s,r.floating);return{data:{escapedOffsets:u,escaped:ak(u)}}}default:return{}}}}},MF=new Set(["left","top"]);async function v7(t,e){const{placement:r,platform:a,elements:n}=t,s=await(a.isRTL==null?void 0:a.isRTL(n.floating)),u=mi(r),c=Ul(r),f=Ea(r)==="y",p=MF.has(u)?-1:1,m=s&&f?-1:1,h=pi(e,t);let{mainAxis:g,crossAxis:y,alignmentAxis:E}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof E=="number"&&(y=c==="end"?E*-1:E),f?{x:y*m,y:g*p}:{x:g*p,y:y*m}}const b7=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,a;const{x:n,y:s,placement:u,middlewareData:c}=e,f=await v7(e,t);return u===((r=c.offset)==null?void 0:r.placement)&&(a=c.arrow)!=null&&a.alignmentOffset?{}:{x:n+f.x,y:s+f.y,data:{...f,placement:u}}}}},y7=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:a,placement:n}=e,{mainAxis:s=!0,crossAxis:u=!1,limiter:c={fn:w=>{let{x:T,y:R}=w;return{x:T,y:R}}},...f}=pi(t,e),p={x:r,y:a},m=await pc(e,f),h=Ea(mi(n)),g=XT(h);let y=p[g],E=p[h];if(s){const w=g==="y"?"top":"left",T=g==="y"?"bottom":"right",R=y+m[w],A=y-m[T];y=xw(R,y,A)}if(u){const w=h==="y"?"top":"left",T=h==="y"?"bottom":"right",R=E+m[w],A=E-m[T];E=xw(R,E,A)}const x=c.fn({...e,[g]:y,[h]:E});return{...x,data:{x:x.x-r,y:x.y-a,enabled:{[g]:s,[h]:u}}}}}},E7=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:a,placement:n,rects:s,middlewareData:u}=e,{offset:c=0,mainAxis:f=!0,crossAxis:p=!0}=pi(t,e),m={x:r,y:a},h=Ea(n),g=XT(h);let y=m[g],E=m[h];const x=pi(c,e),w=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(f){const A=g==="y"?"height":"width",I=s.reference[g]-s.floating[A]+w.mainAxis,O=s.reference[g]+s.reference[A]-w.mainAxis;y<I?y=I:y>O&&(y=O)}if(p){var T,R;const A=g==="y"?"width":"height",I=MF.has(mi(n)),O=s.reference[h]-s.floating[A]+(I&&((T=u.offset)==null?void 0:T[h])||0)+(I?0:w.crossAxis),C=s.reference[h]+s.reference[A]+(I?0:((R=u.offset)==null?void 0:R[h])||0)-(I?w.crossAxis:0);E<O?E=O:E>C&&(E=C)}return{[g]:y,[h]:E}}}},S7=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,a;const{placement:n,rects:s,platform:u,elements:c}=e,{apply:f=()=>{},...p}=pi(t,e),m=await pc(e,p),h=mi(n),g=Ul(n),y=Ea(n)==="y",{width:E,height:x}=s.floating;let w,T;h==="top"||h==="bottom"?(w=h,T=g===(await(u.isRTL==null?void 0:u.isRTL(c.floating))?"start":"end")?"left":"right"):(T=h,w=g==="end"?"top":"bottom");const R=x-m.top-m.bottom,A=E-m.left-m.right,I=to(x-m[w],R),O=to(E-m[T],A),C=!e.middlewareData.shift;let N=I,D=O;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(D=A),(a=e.middlewareData.shift)!=null&&a.enabled.y&&(N=R),C&&!g){const P=Tn(m.left,0),$=Tn(m.right,0),W=Tn(m.top,0),ee=Tn(m.bottom,0);y?D=E-2*(P!==0||$!==0?P+$:Tn(m.left,m.right)):N=x-2*(W!==0||ee!==0?W+ee:Tn(m.top,m.bottom))}await f({...e,availableWidth:D,availableHeight:N});const L=await u.getDimensions(c.floating);return E!==L.width||x!==L.height?{reset:{rects:!0}}:{}}}};function Hp(){return typeof window<"u"}function jl(t){return PF(t)?(t.nodeName||"").toLowerCase():"#document"}function Rn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ma(t){var e;return(e=(PF(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function PF(t){return Hp()?t instanceof Node||t instanceof Rn(t).Node:!1}function aa(t){return Hp()?t instanceof Element||t instanceof Rn(t).Element:!1}function Ia(t){return Hp()?t instanceof HTMLElement||t instanceof Rn(t).HTMLElement:!1}function ik(t){return!Hp()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Rn(t).ShadowRoot}const _7=new Set(["inline","contents"]);function jc(t){const{overflow:e,overflowX:r,overflowY:a,display:n}=ia(t);return/auto|scroll|overlay|hidden|clip/.test(e+a+r)&&!_7.has(n)}const x7=new Set(["table","td","th"]);function w7(t){return x7.has(jl(t))}const T7=[":popover-open",":modal"];function Gp(t){return T7.some(e=>{try{return t.matches(e)}catch{return!1}})}const R7=["transform","translate","scale","rotate","perspective"],A7=["transform","translate","scale","rotate","perspective","filter"],C7=["paint","layout","strict","content"];function e0(t){const e=t0(),r=aa(t)?ia(t):t;return R7.some(a=>r[a]?r[a]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||A7.some(a=>(r.willChange||"").includes(a))||C7.some(a=>(r.contain||"").includes(a))}function N7(t){let e=ro(t);for(;Ia(e)&&!Al(e);){if(e0(e))return e;if(Gp(e))return null;e=ro(e)}return null}function t0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const I7=new Set(["html","body","#document"]);function Al(t){return I7.has(jl(t))}function ia(t){return Rn(t).getComputedStyle(t)}function Vp(t){return aa(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ro(t){if(jl(t)==="html")return t;const e=t.assignedSlot||t.parentNode||ik(t)&&t.host||Ma(t);return ik(e)?e.host:e}function UF(t){const e=ro(t);return Al(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ia(e)&&jc(e)?e:UF(e)}function mc(t,e,r){var a;e===void 0&&(e=[]),r===void 0&&(r=!0);const n=UF(t),s=n===((a=t.ownerDocument)==null?void 0:a.body),u=Rn(n);if(s){const c=Tw(u);return e.concat(u,u.visualViewport||[],jc(n)?n:[],c&&r?mc(c):[])}return e.concat(n,mc(n,[],r))}function Tw(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function jF(t){const e=ia(t);let r=parseFloat(e.width)||0,a=parseFloat(e.height)||0;const n=Ia(t),s=n?t.offsetWidth:r,u=n?t.offsetHeight:a,c=fp(r)!==s||fp(a)!==u;return c&&(r=s,a=u),{width:r,height:a,$:c}}function r0(t){return aa(t)?t:t.contextElement}function vl(t){const e=r0(t);if(!Ia(e))return wa(1);const r=e.getBoundingClientRect(),{width:a,height:n,$:s}=jF(e);let u=(s?fp(r.width):r.width)/a,c=(s?fp(r.height):r.height)/n;return(!u||!Number.isFinite(u))&&(u=1),(!c||!Number.isFinite(c))&&(c=1),{x:u,y:c}}const k7=wa(0);function FF(t){const e=Rn(t);return!t0()||!e.visualViewport?k7:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function O7(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Rn(t)?!1:e}function Xo(t,e,r,a){e===void 0&&(e=!1),r===void 0&&(r=!1);const n=t.getBoundingClientRect(),s=r0(t);let u=wa(1);e&&(a?aa(a)&&(u=vl(a)):u=vl(t));const c=O7(s,r,a)?FF(s):wa(0);let f=(n.left+c.x)/u.x,p=(n.top+c.y)/u.y,m=n.width/u.x,h=n.height/u.y;if(s){const g=Rn(s),y=a&&aa(a)?Rn(a):a;let E=g,x=Tw(E);for(;x&&a&&y!==E;){const w=vl(x),T=x.getBoundingClientRect(),R=ia(x),A=T.left+(x.clientLeft+parseFloat(R.paddingLeft))*w.x,I=T.top+(x.clientTop+parseFloat(R.paddingTop))*w.y;f*=w.x,p*=w.y,m*=w.x,h*=w.y,f+=A,p+=I,E=Rn(x),x=Tw(E)}}return mp({width:m,height:h,x:f,y:p})}function Yp(t,e){const r=Vp(t).scrollLeft;return e?e.left+r:Xo(Ma(t)).left+r}function zF(t,e){const r=t.getBoundingClientRect(),a=r.left+e.scrollLeft-Yp(t,r),n=r.top+e.scrollTop;return{x:a,y:n}}function D7(t){let{elements:e,rect:r,offsetParent:a,strategy:n}=t;const s=n==="fixed",u=Ma(a),c=e?Gp(e.floating):!1;if(a===u||c&&s)return r;let f={scrollLeft:0,scrollTop:0},p=wa(1);const m=wa(0),h=Ia(a);if((h||!h&&!s)&&((jl(a)!=="body"||jc(u))&&(f=Vp(a)),Ia(a))){const y=Xo(a);p=vl(a),m.x=y.x+a.clientLeft,m.y=y.y+a.clientTop}const g=u&&!h&&!s?zF(u,f):wa(0);return{width:r.width*p.x,height:r.height*p.y,x:r.x*p.x-f.scrollLeft*p.x+m.x+g.x,y:r.y*p.y-f.scrollTop*p.y+m.y+g.y}}function L7(t){return Array.from(t.getClientRects())}function M7(t){const e=Ma(t),r=Vp(t),a=t.ownerDocument.body,n=Tn(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),s=Tn(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight);let u=-r.scrollLeft+Yp(t);const c=-r.scrollTop;return ia(a).direction==="rtl"&&(u+=Tn(e.clientWidth,a.clientWidth)-n),{width:n,height:s,x:u,y:c}}const ok=25;function P7(t,e){const r=Rn(t),a=Ma(t),n=r.visualViewport;let s=a.clientWidth,u=a.clientHeight,c=0,f=0;if(n){s=n.width,u=n.height;const m=t0();(!m||m&&e==="fixed")&&(c=n.offsetLeft,f=n.offsetTop)}const p=Yp(a);if(p<=0){const m=a.ownerDocument,h=m.body,g=getComputedStyle(h),y=m.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,E=Math.abs(a.clientWidth-h.clientWidth-y);E<=ok&&(s-=E)}else p<=ok&&(s+=p);return{width:s,height:u,x:c,y:f}}const U7=new Set(["absolute","fixed"]);function j7(t,e){const r=Xo(t,!0,e==="fixed"),a=r.top+t.clientTop,n=r.left+t.clientLeft,s=Ia(t)?vl(t):wa(1),u=t.clientWidth*s.x,c=t.clientHeight*s.y,f=n*s.x,p=a*s.y;return{width:u,height:c,x:f,y:p}}function sk(t,e,r){let a;if(e==="viewport")a=P7(t,r);else if(e==="document")a=M7(Ma(t));else if(aa(e))a=j7(e,r);else{const n=FF(t);a={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return mp(a)}function BF(t,e){const r=ro(t);return r===e||!aa(r)||Al(r)?!1:ia(r).position==="fixed"||BF(r,e)}function F7(t,e){const r=e.get(t);if(r)return r;let a=mc(t,[],!1).filter(c=>aa(c)&&jl(c)!=="body"),n=null;const s=ia(t).position==="fixed";let u=s?ro(t):t;for(;aa(u)&&!Al(u);){const c=ia(u),f=e0(u);!f&&c.position==="fixed"&&(n=null),(s?!f&&!n:!f&&c.position==="static"&&!!n&&U7.has(n.position)||jc(u)&&!f&&BF(t,u))?a=a.filter(m=>m!==u):n=c,u=ro(u)}return e.set(t,a),a}function z7(t){let{element:e,boundary:r,rootBoundary:a,strategy:n}=t;const u=[...r==="clippingAncestors"?Gp(e)?[]:F7(e,this._c):[].concat(r),a],c=u[0],f=u.reduce((p,m)=>{const h=sk(e,m,n);return p.top=Tn(h.top,p.top),p.right=to(h.right,p.right),p.bottom=to(h.bottom,p.bottom),p.left=Tn(h.left,p.left),p},sk(e,c,n));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function B7(t){const{width:e,height:r}=jF(t);return{width:e,height:r}}function $7(t,e,r){const a=Ia(e),n=Ma(e),s=r==="fixed",u=Xo(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const f=wa(0);function p(){f.x=Yp(n)}if(a||!a&&!s)if((jl(e)!=="body"||jc(n))&&(c=Vp(e)),a){const y=Xo(e,!0,s,e);f.x=y.x+e.clientLeft,f.y=y.y+e.clientTop}else n&&p();s&&!a&&n&&p();const m=n&&!a&&!s?zF(n,c):wa(0),h=u.left+c.scrollLeft-f.x-m.x,g=u.top+c.scrollTop-f.y-m.y;return{x:h,y:g,width:u.width,height:u.height}}function Pv(t){return ia(t).position==="static"}function lk(t,e){if(!Ia(t)||ia(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return Ma(t)===r&&(r=r.ownerDocument.body),r}function $F(t,e){const r=Rn(t);if(Gp(t))return r;if(!Ia(t)){let n=ro(t);for(;n&&!Al(n);){if(aa(n)&&!Pv(n))return n;n=ro(n)}return r}let a=lk(t,e);for(;a&&w7(a)&&Pv(a);)a=lk(a,e);return a&&Al(a)&&Pv(a)&&!e0(a)?r:a||N7(t)||r}const q7=async function(t){const e=this.getOffsetParent||$F,r=this.getDimensions,a=await r(t.floating);return{reference:$7(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function H7(t){return ia(t).direction==="rtl"}const G7={convertOffsetParentRelativeRectToViewportRelativeRect:D7,getDocumentElement:Ma,getClippingRect:z7,getOffsetParent:$F,getElementRects:q7,getClientRects:L7,getDimensions:B7,getScale:vl,isElement:aa,isRTL:H7};function qF(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function V7(t,e){let r=null,a;const n=Ma(t);function s(){var c;clearTimeout(a),(c=r)==null||c.disconnect(),r=null}function u(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),s();const p=t.getBoundingClientRect(),{left:m,top:h,width:g,height:y}=p;if(c||e(),!g||!y)return;const E=bf(h),x=bf(n.clientWidth-(m+g)),w=bf(n.clientHeight-(h+y)),T=bf(m),A={rootMargin:-E+"px "+-x+"px "+-w+"px "+-T+"px",threshold:Tn(0,to(1,f))||1};let I=!0;function O(C){const N=C[0].intersectionRatio;if(N!==f){if(!I)return u();N?u(!1,N):a=setTimeout(()=>{u(!1,1e-7)},1e3)}N===1&&!qF(p,t.getBoundingClientRect())&&u(),I=!1}try{r=new IntersectionObserver(O,{...A,root:n.ownerDocument})}catch{r=new IntersectionObserver(O,A)}r.observe(t)}return u(!0),s}function Y7(t,e,r,a){a===void 0&&(a={});const{ancestorScroll:n=!0,ancestorResize:s=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=a,p=r0(t),m=n||s?[...p?mc(p):[],...mc(e)]:[];m.forEach(T=>{n&&T.addEventListener("scroll",r,{passive:!0}),s&&T.addEventListener("resize",r)});const h=p&&c?V7(p,r):null;let g=-1,y=null;u&&(y=new ResizeObserver(T=>{let[R]=T;R&&R.target===p&&y&&(y.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var A;(A=y)==null||A.observe(e)})),r()}),p&&!f&&y.observe(p),y.observe(e));let E,x=f?Xo(t):null;f&&w();function w(){const T=Xo(t);x&&!qF(x,T)&&r(),x=T,E=requestAnimationFrame(w)}return r(),()=>{var T;m.forEach(R=>{n&&R.removeEventListener("scroll",r),s&&R.removeEventListener("resize",r)}),h?.(),(T=y)==null||T.disconnect(),y=null,f&&cancelAnimationFrame(E)}}const W7=b7,K7=y7,Z7=h7,X7=S7,Q7=g7,uk=m7,J7=E7,eK=(t,e,r)=>{const a=new Map,n={platform:G7,...r},s={...n.platform,_c:a};return p7(t,e,{...n,platform:s})};var tK=typeof document<"u",rK=function(){},jf=tK?_.useLayoutEffect:rK;function hp(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,a,n;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(a=r;a--!==0;)if(!hp(t[a],e[a]))return!1;return!0}if(n=Object.keys(t),r=n.length,r!==Object.keys(e).length)return!1;for(a=r;a--!==0;)if(!{}.hasOwnProperty.call(e,n[a]))return!1;for(a=r;a--!==0;){const s=n[a];if(!(s==="_owner"&&t.$$typeof)&&!hp(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function HF(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function ck(t,e){const r=HF(t);return Math.round(e*r)/r}function Uv(t){const e=_.useRef(t);return jf(()=>{e.current=t}),e}function nK(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:a=[],platform:n,elements:{reference:s,floating:u}={},transform:c=!0,whileElementsMounted:f,open:p}=t,[m,h]=_.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[g,y]=_.useState(a);hp(g,a)||y(a);const[E,x]=_.useState(null),[w,T]=_.useState(null),R=_.useCallback(V=>{V!==C.current&&(C.current=V,x(V))},[]),A=_.useCallback(V=>{V!==N.current&&(N.current=V,T(V))},[]),I=s||E,O=u||w,C=_.useRef(null),N=_.useRef(null),D=_.useRef(m),L=f!=null,P=Uv(f),$=Uv(n),W=Uv(p),ee=_.useCallback(()=>{if(!C.current||!N.current)return;const V={placement:e,strategy:r,middleware:g};$.current&&(V.platform=$.current),eK(C.current,N.current,V).then(X=>{const le={...X,isPositioned:W.current!==!1};te.current&&!hp(D.current,le)&&(D.current=le,Ll.flushSync(()=>{h(le)}))})},[g,e,r,$,W]);jf(()=>{p===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,h(V=>({...V,isPositioned:!1})))},[p]);const te=_.useRef(!1);jf(()=>(te.current=!0,()=>{te.current=!1}),[]),jf(()=>{if(I&&(C.current=I),O&&(N.current=O),I&&O){if(P.current)return P.current(I,O,ee);ee()}},[I,O,ee,P,L]);const ie=_.useMemo(()=>({reference:C,floating:N,setReference:R,setFloating:A}),[R,A]),H=_.useMemo(()=>({reference:I,floating:O}),[I,O]),K=_.useMemo(()=>{const V={position:r,left:0,top:0};if(!H.floating)return V;const X=ck(H.floating,m.x),le=ck(H.floating,m.y);return c?{...V,transform:"translate("+X+"px, "+le+"px)",...HF(H.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:X,top:le}},[r,c,H.floating,m.x,m.y]);return _.useMemo(()=>({...m,update:ee,refs:ie,elements:H,floatingStyles:K}),[m,ee,ie,H,K])}const aK=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:a,padding:n}=typeof t=="function"?t(r):t;return a&&e(a)?a.current!=null?uk({element:a.current,padding:n}).fn(r):{}:a?uk({element:a,padding:n}).fn(r):{}}}},iK=(t,e)=>({...W7(t),options:[t,e]}),oK=(t,e)=>({...K7(t),options:[t,e]}),sK=(t,e)=>({...J7(t),options:[t,e]}),lK=(t,e)=>({...Z7(t),options:[t,e]}),uK=(t,e)=>({...X7(t),options:[t,e]}),cK=(t,e)=>({...Q7(t),options:[t,e]}),dK=(t,e)=>({...aK(t),options:[t,e]});var fK="Arrow",GF=_.forwardRef((t,e)=>{const{children:r,width:a=10,height:n=5,...s}=t;return v.jsx(nt.svg,{...s,ref:e,width:a,height:n,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});GF.displayName=fK;var pK=GF;function mK(t){const[e,r]=_.useState(void 0);return Vr(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const a=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;const s=n[0];let u,c;if("borderBoxSize"in s){const f=s.borderBoxSize,p=Array.isArray(f)?f[0]:f;u=p.inlineSize,c=p.blockSize}else u=t.offsetWidth,c=t.offsetHeight;r({width:u,height:c})});return a.observe(t,{box:"border-box"}),()=>a.unobserve(t)}else r(void 0)},[t]),e}var n0="Popper",[VF,Fl]=lo(n0),[hK,YF]=VF(n0),WF=t=>{const{__scopePopper:e,children:r}=t,[a,n]=_.useState(null);return v.jsx(hK,{scope:e,anchor:a,onAnchorChange:n,children:r})};WF.displayName=n0;var KF="PopperAnchor",ZF=_.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:a,...n}=t,s=YF(KF,r),u=_.useRef(null),c=jt(e,u),f=_.useRef(null);return _.useEffect(()=>{const p=f.current;f.current=a?.current||u.current,p!==f.current&&s.onAnchorChange(f.current)}),a?null:v.jsx(nt.div,{...n,ref:c})});ZF.displayName=KF;var a0="PopperContent",[gK,vK]=VF(a0),XF=_.forwardRef((t,e)=>{const{__scopePopper:r,side:a="bottom",sideOffset:n=0,align:s="center",alignOffset:u=0,arrowPadding:c=0,avoidCollisions:f=!0,collisionBoundary:p=[],collisionPadding:m=0,sticky:h="partial",hideWhenDetached:g=!1,updatePositionStrategy:y="optimized",onPlaced:E,...x}=t,w=YF(a0,r),[T,R]=_.useState(null),A=jt(e,j=>R(j)),[I,O]=_.useState(null),C=mK(I),N=C?.width??0,D=C?.height??0,L=a+(s!=="center"?"-"+s:""),P=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},$=Array.isArray(p)?p:[p],W=$.length>0,ee={padding:P,boundary:$.filter(yK),altBoundary:W},{refs:te,floatingStyles:ie,placement:H,isPositioned:K,middlewareData:V}=nK({strategy:"fixed",placement:L,whileElementsMounted:(...j)=>Y7(...j,{animationFrame:y==="always"}),elements:{reference:w.anchor},middleware:[iK({mainAxis:n+D,alignmentAxis:u}),f&&oK({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?sK():void 0,...ee}),f&&lK({...ee}),uK({...ee,apply:({elements:j,rects:Q,availableWidth:fe,availableHeight:ae})=>{const{width:pe,height:_e}=Q.reference,we=j.floating.style;we.setProperty("--radix-popper-available-width",`${fe}px`),we.setProperty("--radix-popper-available-height",`${ae}px`),we.setProperty("--radix-popper-anchor-width",`${pe}px`),we.setProperty("--radix-popper-anchor-height",`${_e}px`)}}),I&&dK({element:I,padding:c}),EK({arrowWidth:N,arrowHeight:D}),g&&cK({strategy:"referenceHidden",...ee})]}),[X,le]=ez(H),M=Na(E);Vr(()=>{K&&M?.()},[K,M]);const z=V.arrow?.x,q=V.arrow?.y,Y=V.arrow?.centerOffset!==0,[B,U]=_.useState();return Vr(()=>{T&&U(window.getComputedStyle(T).zIndex)},[T]),v.jsx("div",{ref:te.setFloating,"data-radix-popper-content-wrapper":"",style:{...ie,transform:K?ie.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:v.jsx(gK,{scope:r,placedSide:X,onArrowChange:O,arrowX:z,arrowY:q,shouldHideArrow:Y,children:v.jsx(nt.div,{"data-side":X,"data-align":le,...x,ref:A,style:{...x.style,animation:K?void 0:"none"}})})})});XF.displayName=a0;var QF="PopperArrow",bK={top:"bottom",right:"left",bottom:"top",left:"right"},JF=_.forwardRef(function(e,r){const{__scopePopper:a,...n}=e,s=vK(QF,a),u=bK[s.placedSide];return v.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:v.jsx(pK,{...n,ref:r,style:{...n.style,display:"block"}})})});JF.displayName=QF;function yK(t){return t!==null}var EK=t=>({name:"transformOrigin",options:t,fn(e){const{placement:r,rects:a,middlewareData:n}=e,u=n.arrow?.centerOffset!==0,c=u?0:t.arrowWidth,f=u?0:t.arrowHeight,[p,m]=ez(r),h={start:"0%",center:"50%",end:"100%"}[m],g=(n.arrow?.x??0)+c/2,y=(n.arrow?.y??0)+f/2;let E="",x="";return p==="bottom"?(E=u?h:`${g}px`,x=`${-f}px`):p==="top"?(E=u?h:`${g}px`,x=`${a.floating.height+f}px`):p==="right"?(E=`${-f}px`,x=u?h:`${y}px`):p==="left"&&(E=`${a.floating.width+f}px`,x=u?h:`${y}px`),{data:{x:E,y:x}}}});function ez(t){const[e,r="center"]=t.split("-");return[e,r]}var i0=WF,o0=ZF,s0=XF,l0=JF,jv="rovingFocusGroup.onEntryFocus",SK={bubbles:!1,cancelable:!0},Fc="RovingFocusGroup",[Rw,tz,_K]=KT(Fc),[xK,rz]=lo(Fc,[_K]),[wK,TK]=xK(Fc),nz=_.forwardRef((t,e)=>v.jsx(Rw.Provider,{scope:t.__scopeRovingFocusGroup,children:v.jsx(Rw.Slot,{scope:t.__scopeRovingFocusGroup,children:v.jsx(RK,{...t,ref:e})})}));nz.displayName=Fc;var RK=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:a,loop:n=!1,dir:s,currentTabStopId:u,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:f,onEntryFocus:p,preventScrollOnEntryFocus:m=!1,...h}=t,g=_.useRef(null),y=jt(e,g),E=ZT(s),[x,w]=Rl({prop:u,defaultProp:c??null,onChange:f,caller:Fc}),[T,R]=_.useState(!1),A=Na(p),I=tz(r),O=_.useRef(!1),[C,N]=_.useState(0);return _.useEffect(()=>{const D=g.current;if(D)return D.addEventListener(jv,A),()=>D.removeEventListener(jv,A)},[A]),v.jsx(wK,{scope:r,orientation:a,dir:E,loop:n,currentTabStopId:x,onItemFocus:_.useCallback(D=>w(D),[w]),onItemShiftTab:_.useCallback(()=>R(!0),[]),onFocusableItemAdd:_.useCallback(()=>N(D=>D+1),[]),onFocusableItemRemove:_.useCallback(()=>N(D=>D-1),[]),children:v.jsx(nt.div,{tabIndex:T||C===0?-1:0,"data-orientation":a,...h,ref:y,style:{outline:"none",...t.style},onMouseDown:Ue(t.onMouseDown,()=>{O.current=!0}),onFocus:Ue(t.onFocus,D=>{const L=!O.current;if(D.target===D.currentTarget&&L&&!T){const P=new CustomEvent(jv,SK);if(D.currentTarget.dispatchEvent(P),!P.defaultPrevented){const $=I().filter(H=>H.focusable),W=$.find(H=>H.active),ee=$.find(H=>H.id===x),ie=[W,ee,...$].filter(Boolean).map(H=>H.ref.current);oz(ie,m)}}O.current=!1}),onBlur:Ue(t.onBlur,()=>R(!1))})})}),az="RovingFocusGroupItem",iz=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:a=!0,active:n=!1,tabStopId:s,children:u,...c}=t,f=Gr(),p=s||f,m=TK(az,r),h=m.currentTabStopId===p,g=tz(r),{onFocusableItemAdd:y,onFocusableItemRemove:E,currentTabStopId:x}=m;return _.useEffect(()=>{if(a)return y(),()=>E()},[a,y,E]),v.jsx(Rw.ItemSlot,{scope:r,id:p,focusable:a,active:n,children:v.jsx(nt.span,{tabIndex:h?0:-1,"data-orientation":m.orientation,...c,ref:e,onMouseDown:Ue(t.onMouseDown,w=>{a?m.onItemFocus(p):w.preventDefault()}),onFocus:Ue(t.onFocus,()=>m.onItemFocus(p)),onKeyDown:Ue(t.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){m.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const T=NK(w,m.orientation,m.dir);if(T!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let A=g().filter(I=>I.focusable).map(I=>I.ref.current);if(T==="last")A.reverse();else if(T==="prev"||T==="next"){T==="prev"&&A.reverse();const I=A.indexOf(w.currentTarget);A=m.loop?IK(A,I+1):A.slice(I+1)}setTimeout(()=>oz(A))}}),children:typeof u=="function"?u({isCurrentTabStop:h,hasTabStop:x!=null}):u})})});iz.displayName=az;var AK={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function CK(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function NK(t,e,r){const a=CK(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return AK[a]}function oz(t,e=!1){const r=document.activeElement;for(const a of t)if(a===r||(a.focus({preventScroll:e}),document.activeElement!==r))return}function IK(t,e){return t.map((r,a)=>t[(e+a)%t.length])}var kK=nz,OK=iz,Aw=["Enter"," "],DK=["ArrowDown","PageUp","Home"],sz=["ArrowUp","PageDown","End"],LK=[...DK,...sz],MK={ltr:[...Aw,"ArrowRight"],rtl:[...Aw,"ArrowLeft"]},PK={ltr:["ArrowLeft"],rtl:["ArrowRight"]},zc="Menu",[hc,UK,jK]=KT(zc),[rs,lz]=lo(zc,[jK,Fl,rz]),Wp=Fl(),uz=rz(),[FK,ns]=rs(zc),[zK,Bc]=rs(zc),cz=t=>{const{__scopeMenu:e,open:r=!1,children:a,dir:n,onOpenChange:s,modal:u=!0}=t,c=Wp(e),[f,p]=_.useState(null),m=_.useRef(!1),h=Na(s),g=ZT(n);return _.useEffect(()=>{const y=()=>{m.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},E=()=>m.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{capture:!0})}},[]),v.jsx(i0,{...c,children:v.jsx(FK,{scope:e,open:r,onOpenChange:h,content:f,onContentChange:p,children:v.jsx(zK,{scope:e,onClose:_.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:m,dir:g,modal:u,children:a})})})};cz.displayName=zc;var BK="MenuAnchor",u0=_.forwardRef((t,e)=>{const{__scopeMenu:r,...a}=t,n=Wp(r);return v.jsx(o0,{...n,...a,ref:e})});u0.displayName=BK;var c0="MenuPortal",[$K,dz]=rs(c0,{forceMount:void 0}),fz=t=>{const{__scopeMenu:e,forceMount:r,children:a,container:n}=t,s=ns(c0,e);return v.jsx($K,{scope:e,forceMount:r,children:v.jsx(La,{present:r||s.open,children:v.jsx(Uc,{asChild:!0,container:n,children:a})})})};fz.displayName=c0;var Vn="MenuContent",[qK,d0]=rs(Vn),pz=_.forwardRef((t,e)=>{const r=dz(Vn,t.__scopeMenu),{forceMount:a=r.forceMount,...n}=t,s=ns(Vn,t.__scopeMenu),u=Bc(Vn,t.__scopeMenu);return v.jsx(hc.Provider,{scope:t.__scopeMenu,children:v.jsx(La,{present:a||s.open,children:v.jsx(hc.Slot,{scope:t.__scopeMenu,children:u.modal?v.jsx(HK,{...n,ref:e}):v.jsx(GK,{...n,ref:e})})})})}),HK=_.forwardRef((t,e)=>{const r=ns(Vn,t.__scopeMenu),a=_.useRef(null),n=jt(e,a);return _.useEffect(()=>{const s=a.current;if(s)return GT(s)},[]),v.jsx(f0,{...t,ref:n,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Ue(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),GK=_.forwardRef((t,e)=>{const r=ns(Vn,t.__scopeMenu);return v.jsx(f0,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),VK=Ko("MenuContent.ScrollLock"),f0=_.forwardRef((t,e)=>{const{__scopeMenu:r,loop:a=!1,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:u,disableOutsidePointerEvents:c,onEntryFocus:f,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:g,onDismiss:y,disableOutsideScroll:E,...x}=t,w=ns(Vn,r),T=Bc(Vn,r),R=Wp(r),A=uz(r),I=UK(r),[O,C]=_.useState(null),N=_.useRef(null),D=jt(e,N,w.onContentChange),L=_.useRef(0),P=_.useRef(""),$=_.useRef(0),W=_.useRef(null),ee=_.useRef("right"),te=_.useRef(0),ie=E?$p:_.Fragment,H=E?{as:VK,allowPinchZoom:!0}:void 0,K=X=>{const le=P.current+X,M=I().filter(j=>!j.disabled),z=document.activeElement,q=M.find(j=>j.ref.current===z)?.textValue,Y=M.map(j=>j.textValue),B=aZ(Y,le,q),U=M.find(j=>j.textValue===B)?.ref.current;(function j(Q){P.current=Q,window.clearTimeout(L.current),Q!==""&&(L.current=window.setTimeout(()=>j(""),1e3))})(le),U&&setTimeout(()=>U.focus())};_.useEffect(()=>()=>window.clearTimeout(L.current),[]),HT();const V=_.useCallback(X=>ee.current===W.current?.side&&oZ(X,W.current?.area),[]);return v.jsx(qK,{scope:r,searchRef:P,onItemEnter:_.useCallback(X=>{V(X)&&X.preventDefault()},[V]),onItemLeave:_.useCallback(X=>{V(X)||(N.current?.focus(),C(null))},[V]),onTriggerLeave:_.useCallback(X=>{V(X)&&X.preventDefault()},[V]),pointerGraceTimerRef:$,onPointerGraceIntentChange:_.useCallback(X=>{W.current=X},[]),children:v.jsx(ie,{...H,children:v.jsx(zp,{asChild:!0,trapped:n,onMountAutoFocus:Ue(s,X=>{X.preventDefault(),N.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:v.jsx(Pc,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:g,onDismiss:y,children:v.jsx(kK,{asChild:!0,...A,dir:T.dir,orientation:"vertical",loop:a,currentTabStopId:O,onCurrentTabStopIdChange:C,onEntryFocus:Ue(f,X=>{T.isUsingKeyboardRef.current||X.preventDefault()}),preventScrollOnEntryFocus:!0,children:v.jsx(s0,{role:"menu","aria-orientation":"vertical","data-state":Nz(w.open),"data-radix-menu-content":"",dir:T.dir,...R,...x,ref:D,style:{outline:"none",...x.style},onKeyDown:Ue(x.onKeyDown,X=>{const M=X.target.closest("[data-radix-menu-content]")===X.currentTarget,z=X.ctrlKey||X.altKey||X.metaKey,q=X.key.length===1;M&&(X.key==="Tab"&&X.preventDefault(),!z&&q&&K(X.key));const Y=N.current;if(X.target!==Y||!LK.includes(X.key))return;X.preventDefault();const U=I().filter(j=>!j.disabled).map(j=>j.ref.current);sz.includes(X.key)&&U.reverse(),rZ(U)}),onBlur:Ue(t.onBlur,X=>{X.currentTarget.contains(X.target)||(window.clearTimeout(L.current),P.current="")}),onPointerMove:Ue(t.onPointerMove,gc(X=>{const le=X.target,M=te.current!==X.clientX;if(X.currentTarget.contains(le)&&M){const z=X.clientX>te.current?"right":"left";ee.current=z,te.current=X.clientX}}))})})})})})})});pz.displayName=Vn;var YK="MenuGroup",p0=_.forwardRef((t,e)=>{const{__scopeMenu:r,...a}=t;return v.jsx(nt.div,{role:"group",...a,ref:e})});p0.displayName=YK;var WK="MenuLabel",mz=_.forwardRef((t,e)=>{const{__scopeMenu:r,...a}=t;return v.jsx(nt.div,{...a,ref:e})});mz.displayName=WK;var gp="MenuItem",dk="menu.itemSelect",Kp=_.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:a,...n}=t,s=_.useRef(null),u=Bc(gp,t.__scopeMenu),c=d0(gp,t.__scopeMenu),f=jt(e,s),p=_.useRef(!1),m=()=>{const h=s.current;if(!r&&h){const g=new CustomEvent(dk,{bubbles:!0,cancelable:!0});h.addEventListener(dk,y=>a?.(y),{once:!0}),nF(h,g),g.defaultPrevented?p.current=!1:u.onClose()}};return v.jsx(hz,{...n,ref:f,disabled:r,onClick:Ue(t.onClick,m),onPointerDown:h=>{t.onPointerDown?.(h),p.current=!0},onPointerUp:Ue(t.onPointerUp,h=>{p.current||h.currentTarget?.click()}),onKeyDown:Ue(t.onKeyDown,h=>{const g=c.searchRef.current!=="";r||g&&h.key===" "||Aw.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});Kp.displayName=gp;var hz=_.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:a=!1,textValue:n,...s}=t,u=d0(gp,r),c=uz(r),f=_.useRef(null),p=jt(e,f),[m,h]=_.useState(!1),[g,y]=_.useState("");return _.useEffect(()=>{const E=f.current;E&&y((E.textContent??"").trim())},[s.children]),v.jsx(hc.ItemSlot,{scope:r,disabled:a,textValue:n??g,children:v.jsx(OK,{asChild:!0,...c,focusable:!a,children:v.jsx(nt.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...s,ref:p,onPointerMove:Ue(t.onPointerMove,gc(E=>{a?u.onItemLeave(E):(u.onItemEnter(E),E.defaultPrevented||E.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ue(t.onPointerLeave,gc(E=>u.onItemLeave(E))),onFocus:Ue(t.onFocus,()=>h(!0)),onBlur:Ue(t.onBlur,()=>h(!1))})})})}),KK="MenuCheckboxItem",gz=_.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:a,...n}=t;return v.jsx(Sz,{scope:t.__scopeMenu,checked:r,children:v.jsx(Kp,{role:"menuitemcheckbox","aria-checked":vp(r)?"mixed":r,...n,ref:e,"data-state":h0(r),onSelect:Ue(n.onSelect,()=>a?.(vp(r)?!0:!r),{checkForDefaultPrevented:!1})})})});gz.displayName=KK;var vz="MenuRadioGroup",[ZK,XK]=rs(vz,{value:void 0,onValueChange:()=>{}}),bz=_.forwardRef((t,e)=>{const{value:r,onValueChange:a,...n}=t,s=Na(a);return v.jsx(ZK,{scope:t.__scopeMenu,value:r,onValueChange:s,children:v.jsx(p0,{...n,ref:e})})});bz.displayName=vz;var yz="MenuRadioItem",Ez=_.forwardRef((t,e)=>{const{value:r,...a}=t,n=XK(yz,t.__scopeMenu),s=r===n.value;return v.jsx(Sz,{scope:t.__scopeMenu,checked:s,children:v.jsx(Kp,{role:"menuitemradio","aria-checked":s,...a,ref:e,"data-state":h0(s),onSelect:Ue(a.onSelect,()=>n.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});Ez.displayName=yz;var m0="MenuItemIndicator",[Sz,QK]=rs(m0,{checked:!1}),_z=_.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:a,...n}=t,s=QK(m0,r);return v.jsx(La,{present:a||vp(s.checked)||s.checked===!0,children:v.jsx(nt.span,{...n,ref:e,"data-state":h0(s.checked)})})});_z.displayName=m0;var JK="MenuSeparator",xz=_.forwardRef((t,e)=>{const{__scopeMenu:r,...a}=t;return v.jsx(nt.div,{role:"separator","aria-orientation":"horizontal",...a,ref:e})});xz.displayName=JK;var eZ="MenuArrow",wz=_.forwardRef((t,e)=>{const{__scopeMenu:r,...a}=t,n=Wp(r);return v.jsx(l0,{...n,...a,ref:e})});wz.displayName=eZ;var tZ="MenuSub",[Dfe,Tz]=rs(tZ),$u="MenuSubTrigger",Rz=_.forwardRef((t,e)=>{const r=ns($u,t.__scopeMenu),a=Bc($u,t.__scopeMenu),n=Tz($u,t.__scopeMenu),s=d0($u,t.__scopeMenu),u=_.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:f}=s,p={__scopeMenu:t.__scopeMenu},m=_.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return _.useEffect(()=>m,[m]),_.useEffect(()=>{const h=c.current;return()=>{window.clearTimeout(h),f(null)}},[c,f]),v.jsx(u0,{asChild:!0,...p,children:v.jsx(hz,{id:n.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":n.contentId,"data-state":Nz(r.open),...t,ref:fi(e,n.onTriggerChange),onClick:h=>{t.onClick?.(h),!(t.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Ue(t.onPointerMove,gc(h=>{s.onItemEnter(h),!h.defaultPrevented&&!t.disabled&&!r.open&&!u.current&&(s.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{r.onOpenChange(!0),m()},100))})),onPointerLeave:Ue(t.onPointerLeave,gc(h=>{m();const g=r.content?.getBoundingClientRect();if(g){const y=r.content?.dataset.side,E=y==="right",x=E?-5:5,w=g[E?"left":"right"],T=g[E?"right":"left"];s.onPointerGraceIntentChange({area:[{x:h.clientX+x,y:h.clientY},{x:w,y:g.top},{x:T,y:g.top},{x:T,y:g.bottom},{x:w,y:g.bottom}],side:y}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(h),h.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Ue(t.onKeyDown,h=>{const g=s.searchRef.current!=="";t.disabled||g&&h.key===" "||MK[a.dir].includes(h.key)&&(r.onOpenChange(!0),r.content?.focus(),h.preventDefault())})})})});Rz.displayName=$u;var Az="MenuSubContent",Cz=_.forwardRef((t,e)=>{const r=dz(Vn,t.__scopeMenu),{forceMount:a=r.forceMount,...n}=t,s=ns(Vn,t.__scopeMenu),u=Bc(Vn,t.__scopeMenu),c=Tz(Az,t.__scopeMenu),f=_.useRef(null),p=jt(e,f);return v.jsx(hc.Provider,{scope:t.__scopeMenu,children:v.jsx(La,{present:a||s.open,children:v.jsx(hc.Slot,{scope:t.__scopeMenu,children:v.jsx(f0,{id:c.contentId,"aria-labelledby":c.triggerId,...n,ref:p,align:"start",side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{u.isUsingKeyboardRef.current&&f.current?.focus(),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Ue(t.onFocusOutside,m=>{m.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:Ue(t.onEscapeKeyDown,m=>{u.onClose(),m.preventDefault()}),onKeyDown:Ue(t.onKeyDown,m=>{const h=m.currentTarget.contains(m.target),g=PK[u.dir].includes(m.key);h&&g&&(s.onOpenChange(!1),c.trigger?.focus(),m.preventDefault())})})})})})});Cz.displayName=Az;function Nz(t){return t?"open":"closed"}function vp(t){return t==="indeterminate"}function h0(t){return vp(t)?"indeterminate":t?"checked":"unchecked"}function rZ(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function nZ(t,e){return t.map((r,a)=>t[(e+a)%t.length])}function aZ(t,e,r){const n=e.length>1&&Array.from(e).every(p=>p===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let u=nZ(t,Math.max(s,0));n.length===1&&(u=u.filter(p=>p!==r));const f=u.find(p=>p.toLowerCase().startsWith(n.toLowerCase()));return f!==r?f:void 0}function iZ(t,e){const{x:r,y:a}=t;let n=!1;for(let s=0,u=e.length-1;s<e.length;u=s++){const c=e[s],f=e[u],p=c.x,m=c.y,h=f.x,g=f.y;m>a!=g>a&&r<(h-p)*(a-m)/(g-m)+p&&(n=!n)}return n}function oZ(t,e){if(!e)return!1;const r={x:t.clientX,y:t.clientY};return iZ(r,e)}function gc(t){return e=>e.pointerType==="mouse"?t(e):void 0}var sZ=cz,lZ=u0,uZ=fz,cZ=pz,dZ=p0,fZ=mz,pZ=Kp,mZ=gz,hZ=bz,gZ=Ez,vZ=_z,bZ=xz,yZ=wz,EZ=Rz,SZ=Cz,Zp="DropdownMenu",[_Z]=lo(Zp,[lz]),en=lz(),[xZ,Iz]=_Z(Zp),kz=t=>{const{__scopeDropdownMenu:e,children:r,dir:a,open:n,defaultOpen:s,onOpenChange:u,modal:c=!0}=t,f=en(e),p=_.useRef(null),[m,h]=Rl({prop:n,defaultProp:s??!1,onChange:u,caller:Zp});return v.jsx(xZ,{scope:e,triggerId:Gr(),triggerRef:p,contentId:Gr(),open:m,onOpenChange:h,onOpenToggle:_.useCallback(()=>h(g=>!g),[h]),modal:c,children:v.jsx(sZ,{...f,open:m,onOpenChange:h,dir:a,modal:c,children:r})})};kz.displayName=Zp;var Oz="DropdownMenuTrigger",Dz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,disabled:a=!1,...n}=t,s=Iz(Oz,r),u=en(r);return v.jsx(lZ,{asChild:!0,...u,children:v.jsx(nt.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...n,ref:fi(e,s.triggerRef),onPointerDown:Ue(t.onPointerDown,c=>{!a&&c.button===0&&c.ctrlKey===!1&&(s.onOpenToggle(),s.open||c.preventDefault())}),onKeyDown:Ue(t.onKeyDown,c=>{a||(["Enter"," "].includes(c.key)&&s.onOpenToggle(),c.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});Dz.displayName=Oz;var wZ="DropdownMenuPortal",Lz=t=>{const{__scopeDropdownMenu:e,...r}=t,a=en(e);return v.jsx(uZ,{...a,...r})};Lz.displayName=wZ;var Mz="DropdownMenuContent",Pz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=Iz(Mz,r),s=en(r),u=_.useRef(!1);return v.jsx(cZ,{id:n.contentId,"aria-labelledby":n.triggerId,...s,...a,ref:e,onCloseAutoFocus:Ue(t.onCloseAutoFocus,c=>{u.current||n.triggerRef.current?.focus(),u.current=!1,c.preventDefault()}),onInteractOutside:Ue(t.onInteractOutside,c=>{const f=c.detail.originalEvent,p=f.button===0&&f.ctrlKey===!0,m=f.button===2||p;(!n.modal||m)&&(u.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Pz.displayName=Mz;var TZ="DropdownMenuGroup",RZ=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=en(r);return v.jsx(dZ,{...n,...a,ref:e})});RZ.displayName=TZ;var AZ="DropdownMenuLabel",Uz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=en(r);return v.jsx(fZ,{...n,...a,ref:e})});Uz.displayName=AZ;var CZ="DropdownMenuItem",jz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=en(r);return v.jsx(pZ,{...n,...a,ref:e})});jz.displayName=CZ;var NZ="DropdownMenuCheckboxItem",Fz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=en(r);return v.jsx(mZ,{...n,...a,ref:e})});Fz.displayName=NZ;var IZ="DropdownMenuRadioGroup",kZ=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=en(r);return v.jsx(hZ,{...n,...a,ref:e})});kZ.displayName=IZ;var OZ="DropdownMenuRadioItem",zz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=en(r);return v.jsx(gZ,{...n,...a,ref:e})});zz.displayName=OZ;var DZ="DropdownMenuItemIndicator",LZ=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=en(r);return v.jsx(vZ,{...n,...a,ref:e})});LZ.displayName=DZ;var MZ="DropdownMenuSeparator",Bz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=en(r);return v.jsx(bZ,{...n,...a,ref:e})});Bz.displayName=MZ;var PZ="DropdownMenuArrow",UZ=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=en(r);return v.jsx(yZ,{...n,...a,ref:e})});UZ.displayName=PZ;var jZ="DropdownMenuSubTrigger",$z=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=en(r);return v.jsx(EZ,{...n,...a,ref:e})});$z.displayName=jZ;var FZ="DropdownMenuSubContent",qz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=en(r);return v.jsx(SZ,{...n,...a,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});qz.displayName=FZ;var zZ=kz,BZ=Dz,$Z=Lz,Hz=Pz,Gz=Uz,Vz=jz,Yz=Fz,Wz=zz,Kz=Bz,Zz=$z,Xz=qz;const Qz=zZ,Jz=BZ,qZ=_.forwardRef(({className:t,inset:e,children:r,...a},n)=>v.jsx(Zz,{ref:n,className:Ye("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",e&&"pl-8",t),...a,children:r}));qZ.displayName=Zz.displayName;const HZ=_.forwardRef(({className:t,...e},r)=>v.jsx(Xz,{ref:r,className:Ye("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));HZ.displayName=Xz.displayName;const g0=_.forwardRef(({className:t,sideOffset:e=4,...r},a)=>v.jsx($Z,{children:v.jsx(Hz,{ref:a,sideOffset:e,className:Ye("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));g0.displayName=Hz.displayName;const vc=_.forwardRef(({className:t,inset:e,...r},a)=>v.jsx(Vz,{ref:a,className:Ye("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...r}));vc.displayName=Vz.displayName;const GZ=_.forwardRef(({className:t,children:e,checked:r,...a},n)=>v.jsx(Yz,{ref:n,className:Ye("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:r,...a,children:e}));GZ.displayName=Yz.displayName;const VZ=_.forwardRef(({className:t,children:e,...r},a)=>v.jsx(Wz,{ref:a,className:Ye("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:e}));VZ.displayName=Wz.displayName;const eB=_.forwardRef(({className:t,inset:e,...r},a)=>v.jsx(Gz,{ref:a,className:Ye("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...r}));eB.displayName=Gz.displayName;const Cw=_.forwardRef(({className:t,...e},r)=>v.jsx(Kz,{ref:r,className:Ye("-mx-1 my-1 h-px bg-muted",t),...e}));Cw.displayName=Kz.displayName;function Ir({className:t,type:e,...r}){return v.jsx("input",{type:e,"data-slot":"input",className:Ye("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...r})}var YZ="Label",tB=_.forwardRef((t,e)=>v.jsx(nt.label,{...t,ref:e,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(t.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));tB.displayName=YZ;var WZ=tB;function Sr({className:t,...e}){return v.jsx(WZ,{"data-slot":"label",className:Ye("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...e})}function rB({className:t,color:e,children:r,grayscaled:a=!1}){const n=_.useMemo(()=>{if(e){const h=e.split("(")[1].split(")")[0].trim().split(/\s+/);return Number.parseFloat(h[1]||"0")}return a?0:.2},[e,a]),s=_.useMemo(()=>{if(e){const h=e.split("(")[1].split(")")[0].trim().split(/\s+/);return Number.parseFloat(h[0]||"0.5")}return a?.3:.4},[e,a]),u=_.useMemo(()=>{if(e){const h=e.split("(")[1].split(")")[0].trim().split(/\s+/);return Number.parseFloat(h[2]||"0")}return Math.floor(Math.random()*360)},[e]),c=_.useMemo(()=>e||`oklch(${Math.min(s,1)} ${n} ${u})`,[u,n,s]),f=_.useMemo(()=>`oklch(${Math.min(s*2,1)} ${n} ${u})`,[u,n,s,e]),p=_.useMemo(()=>Math.floor(Math.random()*360),[u]),m=_.useMemo(()=>"1000%",[]);return v.jsx("section",{className:Ye("relative w-full h-full overflow-hidden",t),style:{background:`${f}`},children:v.jsxs("div",{className:"isolate relative w-full h-full",children:[v.jsx("div",{className:"noise w-full h-full",style:{background:`linear-gradient(${p}deg, ${c}, transparent), url(https://grainy-gradients.vercel.app/noise.svg)`,filter:`contrast(120%) brightness(${m})`}}),r&&v.jsx("div",{className:"relative z-10 w-full h-full",children:r})]})})}function fk(t,[e,r]){return Math.min(r,Math.max(e,t))}function KZ(t){const e=_.useRef({value:t,previous:t});return _.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var nB=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ZZ="VisuallyHidden",aB=_.forwardRef((t,e)=>v.jsx(nt.span,{...t,ref:e,style:{...nB,...t.style}}));aB.displayName=ZZ;var XZ=aB,QZ=[" ","Enter","ArrowUp","ArrowDown"],JZ=[" ","Enter"],Qo="Select",[Xp,Qp,eX]=KT(Qo),[zl]=lo(Qo,[eX,Fl]),Jp=Fl(),[tX,uo]=zl(Qo),[rX,nX]=zl(Qo),iB=t=>{const{__scopeSelect:e,children:r,open:a,defaultOpen:n,onOpenChange:s,value:u,defaultValue:c,onValueChange:f,dir:p,name:m,autoComplete:h,disabled:g,required:y,form:E}=t,x=Jp(e),[w,T]=_.useState(null),[R,A]=_.useState(null),[I,O]=_.useState(!1),C=ZT(p),[N,D]=Rl({prop:a,defaultProp:n??!1,onChange:s,caller:Qo}),[L,P]=Rl({prop:u,defaultProp:c,onChange:f,caller:Qo}),$=_.useRef(null),W=w?E||!!w.closest("form"):!0,[ee,te]=_.useState(new Set),ie=Array.from(ee).map(H=>H.props.value).join(";");return v.jsx(i0,{...x,children:v.jsxs(tX,{required:y,scope:e,trigger:w,onTriggerChange:T,valueNode:R,onValueNodeChange:A,valueNodeHasChildren:I,onValueNodeHasChildrenChange:O,contentId:Gr(),value:L,onValueChange:P,open:N,onOpenChange:D,dir:C,triggerPointerDownPosRef:$,disabled:g,children:[v.jsx(Xp.Provider,{scope:e,children:v.jsx(rX,{scope:t.__scopeSelect,onNativeOptionAdd:_.useCallback(H=>{te(K=>new Set(K).add(H))},[]),onNativeOptionRemove:_.useCallback(H=>{te(K=>{const V=new Set(K);return V.delete(H),V})},[]),children:r})}),W?v.jsxs(AB,{"aria-hidden":!0,required:y,tabIndex:-1,name:m,autoComplete:h,value:L,onChange:H=>P(H.target.value),disabled:g,form:E,children:[L===void 0?v.jsx("option",{value:""}):null,Array.from(ee)]},ie):null]})})};iB.displayName=Qo;var oB="SelectTrigger",sB=_.forwardRef((t,e)=>{const{__scopeSelect:r,disabled:a=!1,...n}=t,s=Jp(r),u=uo(oB,r),c=u.disabled||a,f=jt(e,u.onTriggerChange),p=Qp(r),m=_.useRef("touch"),[h,g,y]=NB(x=>{const w=p().filter(A=>!A.disabled),T=w.find(A=>A.value===u.value),R=IB(w,x,T);R!==void 0&&u.onValueChange(R.value)}),E=x=>{c||(u.onOpenChange(!0),y()),x&&(u.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return v.jsx(o0,{asChild:!0,...s,children:v.jsx(nt.button,{type:"button",role:"combobox","aria-controls":u.contentId,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":CB(u.value)?"":void 0,...n,ref:f,onClick:Ue(n.onClick,x=>{x.currentTarget.focus(),m.current!=="mouse"&&E(x)}),onPointerDown:Ue(n.onPointerDown,x=>{m.current=x.pointerType;const w=x.target;w.hasPointerCapture(x.pointerId)&&w.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(E(x),x.preventDefault())}),onKeyDown:Ue(n.onKeyDown,x=>{const w=h.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&g(x.key),!(w&&x.key===" ")&&QZ.includes(x.key)&&(E(),x.preventDefault())})})})});sB.displayName=oB;var lB="SelectValue",uB=_.forwardRef((t,e)=>{const{__scopeSelect:r,className:a,style:n,children:s,placeholder:u="",...c}=t,f=uo(lB,r),{onValueNodeHasChildrenChange:p}=f,m=s!==void 0,h=jt(e,f.onValueNodeChange);return Vr(()=>{p(m)},[p,m]),v.jsx(nt.span,{...c,ref:h,style:{pointerEvents:"none"},children:CB(f.value)?v.jsx(v.Fragment,{children:u}):s})});uB.displayName=lB;var aX="SelectIcon",cB=_.forwardRef((t,e)=>{const{__scopeSelect:r,children:a,...n}=t;return v.jsx(nt.span,{"aria-hidden":!0,...n,ref:e,children:a||"▼"})});cB.displayName=aX;var iX="SelectPortal",dB=t=>v.jsx(Uc,{asChild:!0,...t});dB.displayName=iX;var Jo="SelectContent",fB=_.forwardRef((t,e)=>{const r=uo(Jo,t.__scopeSelect),[a,n]=_.useState();if(Vr(()=>{n(new DocumentFragment)},[]),!r.open){const s=a;return s?Ll.createPortal(v.jsx(pB,{scope:t.__scopeSelect,children:v.jsx(Xp.Slot,{scope:t.__scopeSelect,children:v.jsx("div",{children:t.children})})}),s):null}return v.jsx(mB,{...t,ref:e})});fB.displayName=Jo;var ea=10,[pB,co]=zl(Jo),oX="SelectContentImpl",sX=Ko("SelectContent.RemoveScroll"),mB=_.forwardRef((t,e)=>{const{__scopeSelect:r,position:a="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:s,onPointerDownOutside:u,side:c,sideOffset:f,align:p,alignOffset:m,arrowPadding:h,collisionBoundary:g,collisionPadding:y,sticky:E,hideWhenDetached:x,avoidCollisions:w,...T}=t,R=uo(Jo,r),[A,I]=_.useState(null),[O,C]=_.useState(null),N=jt(e,j=>I(j)),[D,L]=_.useState(null),[P,$]=_.useState(null),W=Qp(r),[ee,te]=_.useState(!1),ie=_.useRef(!1);_.useEffect(()=>{if(A)return GT(A)},[A]),HT();const H=_.useCallback(j=>{const[Q,...fe]=W().map(_e=>_e.ref.current),[ae]=fe.slice(-1),pe=document.activeElement;for(const _e of j)if(_e===pe||(_e?.scrollIntoView({block:"nearest"}),_e===Q&&O&&(O.scrollTop=0),_e===ae&&O&&(O.scrollTop=O.scrollHeight),_e?.focus(),document.activeElement!==pe))return},[W,O]),K=_.useCallback(()=>H([D,A]),[H,D,A]);_.useEffect(()=>{ee&&K()},[ee,K]);const{onOpenChange:V,triggerPointerDownPosRef:X}=R;_.useEffect(()=>{if(A){let j={x:0,y:0};const Q=ae=>{j={x:Math.abs(Math.round(ae.pageX)-(X.current?.x??0)),y:Math.abs(Math.round(ae.pageY)-(X.current?.y??0))}},fe=ae=>{j.x<=10&&j.y<=10?ae.preventDefault():A.contains(ae.target)||V(!1),document.removeEventListener("pointermove",Q),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",Q),document.addEventListener("pointerup",fe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",fe,{capture:!0})}}},[A,V,X]),_.useEffect(()=>{const j=()=>V(!1);return window.addEventListener("blur",j),window.addEventListener("resize",j),()=>{window.removeEventListener("blur",j),window.removeEventListener("resize",j)}},[V]);const[le,M]=NB(j=>{const Q=W().filter(pe=>!pe.disabled),fe=Q.find(pe=>pe.ref.current===document.activeElement),ae=IB(Q,j,fe);ae&&setTimeout(()=>ae.ref.current.focus())}),z=_.useCallback((j,Q,fe)=>{const ae=!ie.current&&!fe;(R.value!==void 0&&R.value===Q||ae)&&(L(j),ae&&(ie.current=!0))},[R.value]),q=_.useCallback(()=>A?.focus(),[A]),Y=_.useCallback((j,Q,fe)=>{const ae=!ie.current&&!fe;(R.value!==void 0&&R.value===Q||ae)&&$(j)},[R.value]),B=a==="popper"?Nw:hB,U=B===Nw?{side:c,sideOffset:f,align:p,alignOffset:m,arrowPadding:h,collisionBoundary:g,collisionPadding:y,sticky:E,hideWhenDetached:x,avoidCollisions:w}:{};return v.jsx(pB,{scope:r,content:A,viewport:O,onViewportChange:C,itemRefCallback:z,selectedItem:D,onItemLeave:q,itemTextRefCallback:Y,focusSelectedItem:K,selectedItemText:P,position:a,isPositioned:ee,searchRef:le,children:v.jsx($p,{as:sX,allowPinchZoom:!0,children:v.jsx(zp,{asChild:!0,trapped:R.open,onMountAutoFocus:j=>{j.preventDefault()},onUnmountAutoFocus:Ue(n,j=>{R.trigger?.focus({preventScroll:!0}),j.preventDefault()}),children:v.jsx(Pc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:j=>j.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:v.jsx(B,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:j=>j.preventDefault(),...T,...U,onPlaced:()=>te(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...T.style},onKeyDown:Ue(T.onKeyDown,j=>{const Q=j.ctrlKey||j.altKey||j.metaKey;if(j.key==="Tab"&&j.preventDefault(),!Q&&j.key.length===1&&M(j.key),["ArrowUp","ArrowDown","Home","End"].includes(j.key)){let ae=W().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(j.key)&&(ae=ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(j.key)){const pe=j.target,_e=ae.indexOf(pe);ae=ae.slice(_e+1)}setTimeout(()=>H(ae)),j.preventDefault()}})})})})})})});mB.displayName=oX;var lX="SelectItemAlignedPosition",hB=_.forwardRef((t,e)=>{const{__scopeSelect:r,onPlaced:a,...n}=t,s=uo(Jo,r),u=co(Jo,r),[c,f]=_.useState(null),[p,m]=_.useState(null),h=jt(e,N=>m(N)),g=Qp(r),y=_.useRef(!1),E=_.useRef(!0),{viewport:x,selectedItem:w,selectedItemText:T,focusSelectedItem:R}=u,A=_.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&p&&x&&w&&T){const N=s.trigger.getBoundingClientRect(),D=p.getBoundingClientRect(),L=s.valueNode.getBoundingClientRect(),P=T.getBoundingClientRect();if(s.dir!=="rtl"){const pe=P.left-D.left,_e=L.left-pe,we=N.left-_e,Ce=N.width+we,et=Math.max(Ce,D.width),$e=window.innerWidth-ea,Ge=fk(_e,[ea,Math.max(ea,$e-et)]);c.style.minWidth=Ce+"px",c.style.left=Ge+"px"}else{const pe=D.right-P.right,_e=window.innerWidth-L.right-pe,we=window.innerWidth-N.right-_e,Ce=N.width+we,et=Math.max(Ce,D.width),$e=window.innerWidth-ea,Ge=fk(_e,[ea,Math.max(ea,$e-et)]);c.style.minWidth=Ce+"px",c.style.right=Ge+"px"}const $=g(),W=window.innerHeight-ea*2,ee=x.scrollHeight,te=window.getComputedStyle(p),ie=parseInt(te.borderTopWidth,10),H=parseInt(te.paddingTop,10),K=parseInt(te.borderBottomWidth,10),V=parseInt(te.paddingBottom,10),X=ie+H+ee+V+K,le=Math.min(w.offsetHeight*5,X),M=window.getComputedStyle(x),z=parseInt(M.paddingTop,10),q=parseInt(M.paddingBottom,10),Y=N.top+N.height/2-ea,B=W-Y,U=w.offsetHeight/2,j=w.offsetTop+U,Q=ie+H+j,fe=X-Q;if(Q<=Y){const pe=$.length>0&&w===$[$.length-1].ref.current;c.style.bottom="0px";const _e=p.clientHeight-x.offsetTop-x.offsetHeight,we=Math.max(B,U+(pe?q:0)+_e+K),Ce=Q+we;c.style.height=Ce+"px"}else{const pe=$.length>0&&w===$[0].ref.current;c.style.top="0px";const we=Math.max(Y,ie+x.offsetTop+(pe?z:0)+U)+fe;c.style.height=we+"px",x.scrollTop=Q-Y+x.offsetTop}c.style.margin=`${ea}px 0`,c.style.minHeight=le+"px",c.style.maxHeight=W+"px",a?.(),requestAnimationFrame(()=>y.current=!0)}},[g,s.trigger,s.valueNode,c,p,x,w,T,s.dir,a]);Vr(()=>A(),[A]);const[I,O]=_.useState();Vr(()=>{p&&O(window.getComputedStyle(p).zIndex)},[p]);const C=_.useCallback(N=>{N&&E.current===!0&&(A(),R?.(),E.current=!1)},[A,R]);return v.jsx(cX,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:y,onScrollButtonChange:C,children:v.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:I},children:v.jsx(nt.div,{...n,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});hB.displayName=lX;var uX="SelectPopperPosition",Nw=_.forwardRef((t,e)=>{const{__scopeSelect:r,align:a="start",collisionPadding:n=ea,...s}=t,u=Jp(r);return v.jsx(s0,{...u,...s,ref:e,align:a,collisionPadding:n,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Nw.displayName=uX;var[cX,v0]=zl(Jo,{}),Iw="SelectViewport",gB=_.forwardRef((t,e)=>{const{__scopeSelect:r,nonce:a,...n}=t,s=co(Iw,r),u=v0(Iw,r),c=jt(e,s.onViewportChange),f=_.useRef(0);return v.jsxs(v.Fragment,{children:[v.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),v.jsx(Xp.Slot,{scope:r,children:v.jsx(nt.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:Ue(n.onScroll,p=>{const m=p.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:g}=u;if(g?.current&&h){const y=Math.abs(f.current-m.scrollTop);if(y>0){const E=window.innerHeight-ea*2,x=parseFloat(h.style.minHeight),w=parseFloat(h.style.height),T=Math.max(x,w);if(T<E){const R=T+y,A=Math.min(E,R),I=R-A;h.style.height=A+"px",h.style.bottom==="0px"&&(m.scrollTop=I>0?I:0,h.style.justifyContent="flex-end")}}}f.current=m.scrollTop})})})]})});gB.displayName=Iw;var vB="SelectGroup",[dX,fX]=zl(vB),pX=_.forwardRef((t,e)=>{const{__scopeSelect:r,...a}=t,n=Gr();return v.jsx(dX,{scope:r,id:n,children:v.jsx(nt.div,{role:"group","aria-labelledby":n,...a,ref:e})})});pX.displayName=vB;var bB="SelectLabel",mX=_.forwardRef((t,e)=>{const{__scopeSelect:r,...a}=t,n=fX(bB,r);return v.jsx(nt.div,{id:n.id,...a,ref:e})});mX.displayName=bB;var bp="SelectItem",[hX,yB]=zl(bp),EB=_.forwardRef((t,e)=>{const{__scopeSelect:r,value:a,disabled:n=!1,textValue:s,...u}=t,c=uo(bp,r),f=co(bp,r),p=c.value===a,[m,h]=_.useState(s??""),[g,y]=_.useState(!1),E=jt(e,R=>f.itemRefCallback?.(R,a,n)),x=Gr(),w=_.useRef("touch"),T=()=>{n||(c.onValueChange(a),c.onOpenChange(!1))};if(a==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return v.jsx(hX,{scope:r,value:a,disabled:n,textId:x,isSelected:p,onItemTextChange:_.useCallback(R=>{h(A=>A||(R?.textContent??"").trim())},[]),children:v.jsx(Xp.ItemSlot,{scope:r,value:a,disabled:n,textValue:m,children:v.jsx(nt.div,{role:"option","aria-labelledby":x,"data-highlighted":g?"":void 0,"aria-selected":p&&g,"data-state":p?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...u,ref:E,onFocus:Ue(u.onFocus,()=>y(!0)),onBlur:Ue(u.onBlur,()=>y(!1)),onClick:Ue(u.onClick,()=>{w.current!=="mouse"&&T()}),onPointerUp:Ue(u.onPointerUp,()=>{w.current==="mouse"&&T()}),onPointerDown:Ue(u.onPointerDown,R=>{w.current=R.pointerType}),onPointerMove:Ue(u.onPointerMove,R=>{w.current=R.pointerType,n?f.onItemLeave?.():w.current==="mouse"&&R.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ue(u.onPointerLeave,R=>{R.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:Ue(u.onKeyDown,R=>{f.searchRef?.current!==""&&R.key===" "||(JZ.includes(R.key)&&T(),R.key===" "&&R.preventDefault())})})})})});EB.displayName=bp;var qu="SelectItemText",SB=_.forwardRef((t,e)=>{const{__scopeSelect:r,className:a,style:n,...s}=t,u=uo(qu,r),c=co(qu,r),f=yB(qu,r),p=nX(qu,r),[m,h]=_.useState(null),g=jt(e,T=>h(T),f.onItemTextChange,T=>c.itemTextRefCallback?.(T,f.value,f.disabled)),y=m?.textContent,E=_.useMemo(()=>v.jsx("option",{value:f.value,disabled:f.disabled,children:y},f.value),[f.disabled,f.value,y]),{onNativeOptionAdd:x,onNativeOptionRemove:w}=p;return Vr(()=>(x(E),()=>w(E)),[x,w,E]),v.jsxs(v.Fragment,{children:[v.jsx(nt.span,{id:f.textId,...s,ref:g}),f.isSelected&&u.valueNode&&!u.valueNodeHasChildren?Ll.createPortal(s.children,u.valueNode):null]})});SB.displayName=qu;var _B="SelectItemIndicator",xB=_.forwardRef((t,e)=>{const{__scopeSelect:r,...a}=t;return yB(_B,r).isSelected?v.jsx(nt.span,{"aria-hidden":!0,...a,ref:e}):null});xB.displayName=_B;var kw="SelectScrollUpButton",wB=_.forwardRef((t,e)=>{const r=co(kw,t.__scopeSelect),a=v0(kw,t.__scopeSelect),[n,s]=_.useState(!1),u=jt(e,a.onScrollButtonChange);return Vr(()=>{if(r.viewport&&r.isPositioned){let c=function(){const p=f.scrollTop>0;s(p)};const f=r.viewport;return c(),f.addEventListener("scroll",c),()=>f.removeEventListener("scroll",c)}},[r.viewport,r.isPositioned]),n?v.jsx(RB,{...t,ref:u,onAutoScroll:()=>{const{viewport:c,selectedItem:f}=r;c&&f&&(c.scrollTop=c.scrollTop-f.offsetHeight)}}):null});wB.displayName=kw;var Ow="SelectScrollDownButton",TB=_.forwardRef((t,e)=>{const r=co(Ow,t.__scopeSelect),a=v0(Ow,t.__scopeSelect),[n,s]=_.useState(!1),u=jt(e,a.onScrollButtonChange);return Vr(()=>{if(r.viewport&&r.isPositioned){let c=function(){const p=f.scrollHeight-f.clientHeight,m=Math.ceil(f.scrollTop)<p;s(m)};const f=r.viewport;return c(),f.addEventListener("scroll",c),()=>f.removeEventListener("scroll",c)}},[r.viewport,r.isPositioned]),n?v.jsx(RB,{...t,ref:u,onAutoScroll:()=>{const{viewport:c,selectedItem:f}=r;c&&f&&(c.scrollTop=c.scrollTop+f.offsetHeight)}}):null});TB.displayName=Ow;var RB=_.forwardRef((t,e)=>{const{__scopeSelect:r,onAutoScroll:a,...n}=t,s=co("SelectScrollButton",r),u=_.useRef(null),c=Qp(r),f=_.useCallback(()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},[]);return _.useEffect(()=>()=>f(),[f]),Vr(()=>{c().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),v.jsx(nt.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:Ue(n.onPointerDown,()=>{u.current===null&&(u.current=window.setInterval(a,50))}),onPointerMove:Ue(n.onPointerMove,()=>{s.onItemLeave?.(),u.current===null&&(u.current=window.setInterval(a,50))}),onPointerLeave:Ue(n.onPointerLeave,()=>{f()})})}),gX="SelectSeparator",vX=_.forwardRef((t,e)=>{const{__scopeSelect:r,...a}=t;return v.jsx(nt.div,{"aria-hidden":!0,...a,ref:e})});vX.displayName=gX;var Dw="SelectArrow",bX=_.forwardRef((t,e)=>{const{__scopeSelect:r,...a}=t,n=Jp(r),s=uo(Dw,r),u=co(Dw,r);return s.open&&u.position==="popper"?v.jsx(l0,{...n,...a,ref:e}):null});bX.displayName=Dw;var yX="SelectBubbleInput",AB=_.forwardRef(({__scopeSelect:t,value:e,...r},a)=>{const n=_.useRef(null),s=jt(a,n),u=KZ(e);return _.useEffect(()=>{const c=n.current;if(!c)return;const f=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(f,"value").set;if(u!==e&&m){const h=new Event("change",{bubbles:!0});m.call(c,e),c.dispatchEvent(h)}},[u,e]),v.jsx(nt.select,{...r,style:{...nB,...r.style},ref:s,defaultValue:e})});AB.displayName=yX;function CB(t){return t===""||t===void 0}function NB(t){const e=Na(t),r=_.useRef(""),a=_.useRef(0),n=_.useCallback(u=>{const c=r.current+u;e(c),(function f(p){r.current=p,window.clearTimeout(a.current),p!==""&&(a.current=window.setTimeout(()=>f(""),1e3))})(c)},[e]),s=_.useCallback(()=>{r.current="",window.clearTimeout(a.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(a.current),[]),[r,n,s]}function IB(t,e,r){const n=e.length>1&&Array.from(e).every(p=>p===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let u=EX(t,Math.max(s,0));n.length===1&&(u=u.filter(p=>p!==r));const f=u.find(p=>p.textValue.toLowerCase().startsWith(n.toLowerCase()));return f!==r?f:void 0}function EX(t,e){return t.map((r,a)=>t[(e+a)%t.length])}var SX=iB,_X=sB,xX=uB,wX=cB,TX=dB,RX=fB,AX=gB,CX=EB,NX=SB,IX=xB,kX=wB,OX=TB;function Fv({...t}){return v.jsx(SX,{"data-slot":"select",...t})}function zv({...t}){return v.jsx(xX,{"data-slot":"select-value",...t})}function Bv({className:t,size:e="default",children:r,...a}){return v.jsxs(_X,{"data-slot":"select-trigger","data-size":e,className:Ye("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...a,children:[r,v.jsx(wX,{asChild:!0,children:v.jsx(jj,{className:"size-4 opacity-50"})})]})}function $v({className:t,children:e,position:r="popper",align:a="center",...n}){return v.jsx(TX,{children:v.jsxs(RX,{"data-slot":"select-content",className:Ye("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,align:a,...n,children:[v.jsx(DX,{}),v.jsx(AX,{className:Ye("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:e}),v.jsx(LX,{})]})})}function qs({className:t,children:e,...r}){return v.jsxs(CX,{"data-slot":"select-item",className:Ye("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...r,children:[v.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:v.jsx(IX,{children:v.jsx(jT,{className:"size-4"})})}),v.jsx(NX,{children:e})]})}function DX({className:t,...e}){return v.jsx(kX,{"data-slot":"select-scroll-up-button",className:Ye("flex cursor-default items-center justify-center py-1",t),...e,children:v.jsx(S6,{className:"size-4"})})}function LX({className:t,...e}){return v.jsx(OX,{"data-slot":"select-scroll-down-button",className:Ye("flex cursor-default items-center justify-center py-1",t),...e,children:v.jsx(jj,{className:"size-4"})})}var[em]=lo("Tooltip",[Fl]),tm=Fl(),kB="TooltipProvider",MX=700,Lw="tooltip.open",[PX,b0]=em(kB),OB=t=>{const{__scopeTooltip:e,delayDuration:r=MX,skipDelayDuration:a=300,disableHoverableContent:n=!1,children:s}=t,u=_.useRef(!0),c=_.useRef(!1),f=_.useRef(0);return _.useEffect(()=>{const p=f.current;return()=>window.clearTimeout(p)},[]),v.jsx(PX,{scope:e,isOpenDelayedRef:u,delayDuration:r,onOpen:_.useCallback(()=>{window.clearTimeout(f.current),u.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>u.current=!0,a)},[a]),isPointerInTransitRef:c,onPointerInTransitChange:_.useCallback(p=>{c.current=p},[]),disableHoverableContent:n,children:s})};OB.displayName=kB;var bc="Tooltip",[UX,$c]=em(bc),DB=t=>{const{__scopeTooltip:e,children:r,open:a,defaultOpen:n,onOpenChange:s,disableHoverableContent:u,delayDuration:c}=t,f=b0(bc,t.__scopeTooltip),p=tm(e),[m,h]=_.useState(null),g=Gr(),y=_.useRef(0),E=u??f.disableHoverableContent,x=c??f.delayDuration,w=_.useRef(!1),[T,R]=Rl({prop:a,defaultProp:n??!1,onChange:N=>{N?(f.onOpen(),document.dispatchEvent(new CustomEvent(Lw))):f.onClose(),s?.(N)},caller:bc}),A=_.useMemo(()=>T?w.current?"delayed-open":"instant-open":"closed",[T]),I=_.useCallback(()=>{window.clearTimeout(y.current),y.current=0,w.current=!1,R(!0)},[R]),O=_.useCallback(()=>{window.clearTimeout(y.current),y.current=0,R(!1)},[R]),C=_.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{w.current=!0,R(!0),y.current=0},x)},[x,R]);return _.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),v.jsx(i0,{...p,children:v.jsx(UX,{scope:e,contentId:g,open:T,stateAttribute:A,trigger:m,onTriggerChange:h,onTriggerEnter:_.useCallback(()=>{f.isOpenDelayedRef.current?C():I()},[f.isOpenDelayedRef,C,I]),onTriggerLeave:_.useCallback(()=>{E?O():(window.clearTimeout(y.current),y.current=0)},[O,E]),onOpen:I,onClose:O,disableHoverableContent:E,children:r})})};DB.displayName=bc;var Mw="TooltipTrigger",LB=_.forwardRef((t,e)=>{const{__scopeTooltip:r,...a}=t,n=$c(Mw,r),s=b0(Mw,r),u=tm(r),c=_.useRef(null),f=jt(e,c,n.onTriggerChange),p=_.useRef(!1),m=_.useRef(!1),h=_.useCallback(()=>p.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),v.jsx(o0,{asChild:!0,...u,children:v.jsx(nt.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...a,ref:f,onPointerMove:Ue(t.onPointerMove,g=>{g.pointerType!=="touch"&&!m.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),m.current=!0)}),onPointerLeave:Ue(t.onPointerLeave,()=>{n.onTriggerLeave(),m.current=!1}),onPointerDown:Ue(t.onPointerDown,()=>{n.open&&n.onClose(),p.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Ue(t.onFocus,()=>{p.current||n.onOpen()}),onBlur:Ue(t.onBlur,n.onClose),onClick:Ue(t.onClick,n.onClose)})})});LB.displayName=Mw;var y0="TooltipPortal",[jX,FX]=em(y0,{forceMount:void 0}),MB=t=>{const{__scopeTooltip:e,forceMount:r,children:a,container:n}=t,s=$c(y0,e);return v.jsx(jX,{scope:e,forceMount:r,children:v.jsx(La,{present:r||s.open,children:v.jsx(Uc,{asChild:!0,container:n,children:a})})})};MB.displayName=y0;var Cl="TooltipContent",PB=_.forwardRef((t,e)=>{const r=FX(Cl,t.__scopeTooltip),{forceMount:a=r.forceMount,side:n="top",...s}=t,u=$c(Cl,t.__scopeTooltip);return v.jsx(La,{present:a||u.open,children:u.disableHoverableContent?v.jsx(UB,{side:n,...s,ref:e}):v.jsx(zX,{side:n,...s,ref:e})})}),zX=_.forwardRef((t,e)=>{const r=$c(Cl,t.__scopeTooltip),a=b0(Cl,t.__scopeTooltip),n=_.useRef(null),s=jt(e,n),[u,c]=_.useState(null),{trigger:f,onClose:p}=r,m=n.current,{onPointerInTransitChange:h}=a,g=_.useCallback(()=>{c(null),h(!1)},[h]),y=_.useCallback((E,x)=>{const w=E.currentTarget,T={x:E.clientX,y:E.clientY},R=HX(T,w.getBoundingClientRect()),A=GX(T,R),I=VX(x.getBoundingClientRect()),O=WX([...A,...I]);c(O),h(!0)},[h]);return _.useEffect(()=>()=>g(),[g]),_.useEffect(()=>{if(f&&m){const E=w=>y(w,m),x=w=>y(w,f);return f.addEventListener("pointerleave",E),m.addEventListener("pointerleave",x),()=>{f.removeEventListener("pointerleave",E),m.removeEventListener("pointerleave",x)}}},[f,m,y,g]),_.useEffect(()=>{if(u){const E=x=>{const w=x.target,T={x:x.clientX,y:x.clientY},R=f?.contains(w)||m?.contains(w),A=!YX(T,u);R?g():A&&(g(),p())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[f,m,u,p,g]),v.jsx(UB,{...t,ref:s})}),[BX,$X]=em(bc,{isInside:!1}),qX=$8("TooltipContent"),UB=_.forwardRef((t,e)=>{const{__scopeTooltip:r,children:a,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:u,...c}=t,f=$c(Cl,r),p=tm(r),{onClose:m}=f;return _.useEffect(()=>(document.addEventListener(Lw,m),()=>document.removeEventListener(Lw,m)),[m]),_.useEffect(()=>{if(f.trigger){const h=g=>{g.target?.contains(f.trigger)&&m()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[f.trigger,m]),v.jsx(Pc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:h=>h.preventDefault(),onDismiss:m,children:v.jsxs(s0,{"data-state":f.stateAttribute,...p,...c,ref:e,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v.jsx(qX,{children:a}),v.jsx(BX,{scope:r,isInside:!0,children:v.jsx(XZ,{id:f.contentId,role:"tooltip",children:n||a})})]})})});PB.displayName=Cl;var jB="TooltipArrow",FB=_.forwardRef((t,e)=>{const{__scopeTooltip:r,...a}=t,n=tm(r);return $X(jB,r).isInside?null:v.jsx(l0,{...n,...a,ref:e})});FB.displayName=jB;function HX(t,e){const r=Math.abs(e.top-t.y),a=Math.abs(e.bottom-t.y),n=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(r,a,n,s)){case s:return"left";case n:return"right";case r:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function GX(t,e,r=5){const a=[];switch(e){case"top":a.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":a.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":a.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":a.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return a}function VX(t){const{top:e,right:r,bottom:a,left:n}=t;return[{x:n,y:e},{x:r,y:e},{x:r,y:a},{x:n,y:a}]}function YX(t,e){const{x:r,y:a}=t;let n=!1;for(let s=0,u=e.length-1;s<e.length;u=s++){const c=e[s],f=e[u],p=c.x,m=c.y,h=f.x,g=f.y;m>a!=g>a&&r<(h-p)*(a-m)/(g-m)+p&&(n=!n)}return n}function WX(t){const e=t.slice();return e.sort((r,a)=>r.x<a.x?-1:r.x>a.x?1:r.y<a.y?-1:r.y>a.y?1:0),KX(e)}function KX(t){if(t.length<=1)return t.slice();const e=[];for(let a=0;a<t.length;a++){const n=t[a];for(;e.length>=2;){const s=e[e.length-1],u=e[e.length-2];if((s.x-u.x)*(n.y-u.y)>=(s.y-u.y)*(n.x-u.x))e.pop();else break}e.push(n)}e.pop();const r=[];for(let a=t.length-1;a>=0;a--){const n=t[a];for(;r.length>=2;){const s=r[r.length-1],u=r[r.length-2];if((s.x-u.x)*(n.y-u.y)>=(s.y-u.y)*(n.x-u.x))r.pop();else break}r.push(n)}return r.pop(),e.length===1&&r.length===1&&e[0].x===r[0].x&&e[0].y===r[0].y?e:e.concat(r)}var ZX=OB,XX=DB,QX=LB,JX=MB,eQ=PB,tQ=FB;function zB({delayDuration:t=0,...e}){return v.jsx(ZX,{"data-slot":"tooltip-provider",delayDuration:t,...e})}function il({...t}){return v.jsx(zB,{children:v.jsx(XX,{"data-slot":"tooltip",...t})})}function ol({...t}){return v.jsx(QX,{"data-slot":"tooltip-trigger",...t})}function sl({className:t,sideOffset:e=0,children:r,...a}){return v.jsx(JX,{children:v.jsxs(eQ,{"data-slot":"tooltip-content",sideOffset:e,className:Ye("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...a,children:[r,v.jsx(tQ,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const BB=_.createContext(void 0);function rQ({url:t,name:e,onUpdate:r,onRemove:a}){const n=typeof window<"u"?new URL("/oauth/callback",window.location.origin).toString():"/oauth/callback",s=bj({url:t,callbackUrl:n}),u=_.useRef(r),c=_.useRef(null);return _.useEffect(()=>{u.current=r},[r]),_.useEffect(()=>{const f={id:t,url:t,name:e,state:s.state,tools:s.tools,resources:s.resources,prompts:s.prompts,error:s.error??null,authUrl:s.authUrl??null,callTool:s.callTool,readResource:s.readResource,authenticate:s.authenticate,retry:s.retry,clearStorage:s.clearStorage},p=c.current;(!p||p.state!==f.state||p.error!==f.error||p.authUrl!==f.authUrl||p.tools.length!==f.tools.length||p.resources.length!==f.resources.length||p.prompts.length!==f.prompts.length)&&(c.current=f,u.current(f))},[t,e,s.state,s.tools,s.resources,s.prompts,s.error,s.authUrl]),null}function nQ({children:t}){const[e,r]=_.useState([]),[a,n]=_.useState(new Map);_.useEffect(()=>{const m=localStorage.getItem("mcp-inspector-connections");if(m)try{const h=JSON.parse(m),g=Array.isArray(h)?h.filter(y=>y&&typeof y=="object"&&typeof y.id=="string"&&typeof y.url=="string"&&typeof y.name=="string"):[];g.length!==h.length&&(console.warn("Cleaned up invalid connections from localStorage"),localStorage.setItem("mcp-inspector-connections",JSON.stringify(g))),r(g)}catch(h){console.error("Failed to parse saved connections:",h),localStorage.removeItem("mcp-inspector-connections")}},[]);const s=_.useCallback(m=>{n(h=>new Map(h).set(m.id,m))},[]),u=_.useCallback((m,h)=>{const y={id:m,url:m,name:h||m};r(E=>{if(E.some(w=>w.id===m))return E;const x=[...E,y];return localStorage.setItem("mcp-inspector-connections",JSON.stringify(x)),x})},[]),c=_.useCallback(m=>{r(h=>{const g=h.filter(y=>y.id!==m);return localStorage.setItem("mcp-inspector-connections",JSON.stringify(g)),g}),n(h=>{const g=new Map(h),y=g.get(m);if(y){try{y.clearStorage()}catch(E){console.error("Failed to clear storage:",E)}g.delete(m)}return g})},[]),f=_.useCallback(m=>a.get(m),[a]),p=Array.from(a.values());return v.jsxs(BB.Provider,{value:{connections:p,addConnection:u,removeConnection:c,getConnection:f},children:[e.map(m=>v.jsx(rQ,{url:m.url,name:m.name,onUpdate:s,onRemove:()=>c(m.id)},m.id)),t]})}function rm(){const t=_.useContext(BB);if(!t)throw new Error("useMcpContext must be used within McpProvider");return t}function aQ({headers:t,onChange:e,onSave:r,className:a,title:n="Custom Headers",description:s="Headers with both name and value will be sent",maxHeaders:u=50}){const[c,f]=_.useState({}),p=()=>Math.random().toString(36).substr(2,9),m=()=>{if(t.length>=u)return;const E={id:p(),name:"",value:""};e([...t,E])},h=E=>{e(t.filter(x=>x.id!==E))},g=(E,x,w)=>{e(t.map(T=>T.id===E?{...T,[x]:w}:T))},y=E=>{f(x=>({...x,[E]:!x[E]}))};return v.jsxs("div",{className:Ye("space-y-3",a),children:[v.jsxs("div",{className:"space-y-2",children:[v.jsx(Sr,{className:"text-base font-medium",children:n}),v.jsx("p",{className:"text-sm text-muted-foreground",children:s})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"grid grid-cols-[1fr_1fr] gap-4 text-sm font-medium text-muted-foreground",children:[v.jsx("div",{children:"Name"}),v.jsx("div",{children:"Value"})]}),t.length===0?v.jsxs("div",{className:"grid grid-cols-[1fr_1fr] gap-4 items-center",children:[v.jsx(Ir,{placeholder:"Authorization",value:"",onChange:()=>{},className:"text-sm",autoComplete:"off"}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Ir,{placeholder:"",value:"",onChange:()=>{},type:"password",className:"font-mono text-sm",autoComplete:"off"}),v.jsx(gt,{type:"button",variant:"ghost",size:"icon-sm",className:"h-8 w-8 p-0",disabled:!0,children:v.jsx(II,{className:"h-4 w-4"})}),v.jsx(gt,{type:"button",variant:"ghost",size:"icon-sm",className:"h-8 w-8 p-0",disabled:!0,children:v.jsx(cp,{className:"h-4 w-4"})})]})]}):t.map(E=>v.jsxs("div",{className:"grid grid-cols-[1fr_1fr] gap-4 items-center",children:[v.jsx(Ir,{placeholder:"Authorization",value:E.name,onChange:x=>g(E.id,"name",x.target.value),className:"text-sm",autoComplete:"off"}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Ir,{placeholder:"",value:E.value,onChange:x=>g(E.id,"value",x.target.value),type:c[E.id]?"text":"password",className:"font-mono text-sm",autoComplete:"off"}),v.jsx(gt,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>y(E.id),className:"h-8 w-8 p-0",children:c[E.id]?v.jsx(U6,{className:"h-4 w-4"}):v.jsx(II,{className:"h-4 w-4"})}),v.jsx(gt,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>h(E.id),className:"h-8 w-8 p-0",children:v.jsx(cp,{className:"h-4 w-4"})})]})]},E.id)),v.jsx("div",{className:"flex justify-start mt-4",children:v.jsxs(gt,{type:"button",variant:"outline",size:"sm",onClick:m,disabled:t.length>=u,className:"flex items-center gap-2",children:[v.jsx(X6,{className:"h-4 w-4"}),"Add"]})})]}),r&&v.jsx("div",{className:"flex justify-end",children:v.jsx(gt,{type:"button",onClick:r,className:"bg-black text-white hover:bg-gray-800",children:"Save"})})]})}function iQ(){const{connections:t,addConnection:e,removeConnection:r}=rm(),a=DT(),[n,s]=_.useState("SSE"),[u,c]=_.useState(""),[f,p]=_.useState("Direct"),[m,h]=_.useState([]),[g,y]=_.useState("10000"),[E,x]=_.useState("True"),[w,T]=_.useState("60000"),[R,A]=_.useState(""),[I,O]=_.useState("c96aeb0c195aa9c7d3846b90aec9bc5fcdd5df97b3049aaede8f5dd1a15d2d87"),[C,N]=_.useState(""),[D,L]=_.useState(typeof window<"u"?new URL("/oauth/callback",window.location.origin).toString():"http://localhost:3000/oauth/callback"),[P,$]=_.useState(""),[W,ee]=_.useState(!1),[te,ie]=_.useState(!1),[H,K]=_.useState(!1),V=()=>{u.trim()&&(e(u,u),c(""),h([]),N(""),$(""))},X=()=>{t.forEach(U=>{r(U.id)})},le=async U=>{try{await navigator.clipboard.writeText(U),ga.success("Error message copied to clipboard")}catch{ga.error("Failed to copy error message")}},M=(U,j)=>{U.stopPropagation(),j()},z=U=>{if(U.state!=="ready"){ga.error("Server is not connected and cannot be inspected");return}a(`/servers/${encodeURIComponent(U.id)}`)},q=async()=>{if(!u.trim()){ga.error("Please enter a URL first");return}const U={type:"streamable-http",url:u,note:"For Streamable HTTP connections, add this URL directly in your MCP Client"};try{await navigator.clipboard.writeText(JSON.stringify(U,null,2)),ga.success("Streamable HTTP URL has been copied. Use this URL directly in your MCP Client.")}catch{ga.error("Failed to copy server entry to clipboard")}},Y=async()=>{if(!u.trim()){ga.error("Please enter a URL first");return}const U={mcpServers:{"default-server":{type:"streamable-http",url:u,note:"For Streamable HTTP connections, add this URL directly in your MCP Client"}}};try{await navigator.clipboard.writeText(JSON.stringify(U,null,2)),ga.success("Servers configuration has been copied to clipboard. Add this to your mcp.json file. Current testing server will be added as 'default-server'")}catch{ga.error("Failed to copy servers file to clipboard")}},B=m.filter(U=>U.name&&U.value).length;return v.jsxs("div",{className:"flex items-start justify-start gap-4 h-full relative",children:[v.jsxs("div",{className:"w-full px-6 pt-6 overflow-auto",children:[v.jsxs("div",{className:"flex items-center gap-3 relative z-10",children:[v.jsx("h2",{className:"text-2xl font-medium tracking-tight",children:"MCP Inspector"}),v.jsxs(il,{children:[v.jsx(ol,{asChild:!0,children:v.jsx("a",{href:"https://github.com/mcp-use/mcp-use-ts",target:"_blank",rel:"noopener noreferrer",className:"inline-block",children:v.jsxs(xa,{variant:"secondary",className:"text-xs cursor-pointer hover:bg-secondary/80 transition-colors",children:["v","0.2.1"]})})}),v.jsx(sl,{children:v.jsx("p",{children:"Visit GitHub"})})]})]}),v.jsx("p",{className:"text-muted-foreground relative z-10",children:"Inspect and debug MCP (Model Context Protocol) servers"}),v.jsxs("div",{className:"space-y-4 mt-8",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("h3",{className:"text-base font-medium",children:"Connected Servers"}),v.jsx("div",{className:"flex gap-2",children:t.length>0&&v.jsx(gt,{variant:"ghost",size:"sm",onClick:X,children:"Clear All"})})]}),t.length===0?v.jsx(ba,{children:v.jsxs(Wi,{className:"flex flex-col items-center justify-center py-8",children:[v.jsx(zT,{className:"h-12 w-12 text-muted-foreground mb-4"}),v.jsx("p",{className:"text-muted-foreground",children:"No servers connected yet"}),v.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a server above to get started"})]})}):v.jsx("div",{className:"grid gap-3",children:t.map(U=>v.jsxs("div",{onClick:()=>z(U),className:"rounded-lg bg-zinc-100 dark:bg-white/10 hover:bg-zinc-200 dark:hover:bg-white/15 p-4 transition-colors cursor-pointer",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"flex-1",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("h4",{className:"font-semibold text-sm",children:U.name}),v.jsx("div",{className:"flex items-center gap-2",children:U.error?v.jsxs(il,{children:[v.jsx(ol,{asChild:!0,children:v.jsx("button",{onClick:j=>{j.stopPropagation(),le(U.error)},className:"w-2 h-2 rounded-full bg-rose-500 animate-status-pulse-red hover:bg-rose-600 transition-colors",title:"Click to copy error message","aria-label":"Copy error message to clipboard"})}),v.jsx(sl,{children:v.jsx("p",{className:"max-w-xs",children:U.error})})]}):v.jsx("div",{className:`w-2 h-2 rounded-full ${U.state==="ready"?"bg-emerald-600 animate-status-pulse":U.state==="failed"?"bg-rose-600 animate-status-pulse-red":"bg-yellow-500 animate-status-pulse-yellow"}`})})]}),v.jsx("p",{className:"text-xs text-muted-foreground dark:text-zinc-400 font-mono mt-1",children:U.url})]}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsxs(il,{children:[v.jsx(ol,{asChild:!0,children:v.jsx(gt,{variant:"secondary",size:"sm",onClick:j=>M(j,()=>r(U.id)),className:"h-8 w-8 p-0",children:v.jsx(w6,{className:"w-4 h-4"})})}),v.jsx(sl,{children:v.jsx("p",{children:"Remove connection"})})]}),v.jsxs(il,{children:[v.jsx(ol,{asChild:!0,children:v.jsx(gt,{variant:"secondary",size:"sm",onClick:j=>M(j,U.retry),className:"h-8 w-8 p-0",children:v.jsx(J6,{className:"w-4 h-4"})})}),v.jsx(sl,{children:v.jsx("p",{children:"Resync connection"})})]})]})]}),U.state==="pending_auth"&&U.authUrl&&v.jsxs("div",{className:"text-sm text-yellow-600 dark:text-yellow-400 mt-2",children:[v.jsx(gt,{size:"sm",variant:"outline",onClick:U.authenticate,children:"Authenticate"})," ","or"," ",v.jsx("a",{href:U.authUrl,target:"_blank",rel:"noopener noreferrer",className:"underline",children:"open auth page"})]})]},U.id))})]})]}),v.jsxs("div",{className:"w-full relative overflow-hidden h-full p-10 items-center justify-center flex",children:[v.jsxs("div",{className:"relative w-full max-w-xl mx-auto z-10 flex flex-col gap-3 rounded-3xl p-6 bg-black/70 dark:bg-zinc-900/90 shadow-2xl shadow-black/50 backdrop-blur-md",children:[v.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"Connect"}),v.jsxs("div",{className:"space-y-2",children:[v.jsx(Sr,{className:"text-white/90",children:"Transport Type"}),v.jsxs(Fv,{value:n,onValueChange:s,children:[v.jsx(Bv,{className:"w-full bg-white/10 border-white/20 text-white",children:v.jsx(zv,{})}),v.jsxs($v,{children:[v.jsx(qs,{value:"SSE",children:"Streamable HTTP"}),v.jsx(qs,{value:"WebSocket",children:"WebSocket"})]})]})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx(Sr,{className:"text-white/90",children:"URL"}),v.jsx(Ir,{placeholder:"http://localhost:3001/sse",value:u,onChange:U=>c(U.target.value),className:"bg-white/10 border-white/20 text-white placeholder:text-white/50"})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx(Sr,{className:"text-white/90",children:"Connection Type"}),v.jsxs(Fv,{value:f,onValueChange:p,children:[v.jsx(Bv,{className:"w-full bg-white/10 border-white/20 text-white",children:v.jsx(zv,{})}),v.jsxs($v,{children:[v.jsx(qs,{value:"Direct",children:"Direct"}),v.jsx(qs,{value:"Via Proxy",children:"Via Proxy"})]})]})]}),v.jsxs(Qz,{children:[v.jsx(Jz,{asChild:!0,children:v.jsxs(gt,{variant:"ghost",className:"absolute top-2 right-2 text-white hover:bg-white/20 z-10 dark:hover:bg-white/20",children:[v.jsx(Mc,{className:"w-4 h-4 mr-2"}),"Export"]})}),v.jsxs(g0,{align:"end",className:"w-56",children:[v.jsxs(vc,{onClick:q,children:[v.jsx("svg",{className:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),"Server Entry"]}),v.jsxs(vc,{onClick:Y,children:[v.jsx("svg",{className:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),"Servers File"]})]})]}),v.jsxs("div",{className:"flex gap-3",children:[v.jsxs(Pf,{open:te,onOpenChange:ie,children:[v.jsx(Dv,{asChild:!0,children:v.jsxs(gt,{variant:"outline",className:"flex-1 justify-center bg-white/10 border-white/20 text-white hover:bg-white/20",children:[v.jsx(a8,{className:"w-4 h-4 mr-2"}),"Authentication",(C||P)&&v.jsx(xa,{variant:"secondary",className:"ml-2",children:"OAuth 2.0"})]})}),v.jsxs(Uf,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[v.jsx(Lv,{children:v.jsx(Mv,{children:"Authentication"})}),v.jsxs("div",{className:"space-y-4",children:[v.jsx("h4",{className:"text-sm font-medium",children:"OAuth 2.0 Flow"}),v.jsxs("div",{className:"space-y-2",children:[v.jsx(Sr,{className:"text-sm",children:"Client ID"}),v.jsx(Ir,{placeholder:"Client ID",value:C,onChange:U=>N(U.target.value)})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx(Sr,{className:"text-sm",children:"Redirect URL"}),v.jsx(Ir,{value:D,onChange:U=>L(U.target.value)})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx(Sr,{className:"text-sm",children:"Scope"}),v.jsx(Ir,{placeholder:"Scope (space-separated)",value:P,onChange:U=>$(U.target.value)})]}),v.jsx("div",{className:"flex justify-end",children:v.jsx(gt,{onClick:()=>ie(!1),children:"Save"})})]})]})]}),v.jsxs(Pf,{open:W,onOpenChange:ee,children:[v.jsx(Dv,{asChild:!0,children:v.jsxs(gt,{variant:"outline",className:"flex-1 justify-center bg-white/10 border-white/20 text-white hover:bg-white/20",children:[v.jsx(jo,{className:"w-4 h-4 mr-2"}),"Custom Headers",B>0&&v.jsx(xa,{variant:"secondary",className:"ml-2",children:B})]})}),v.jsxs(Uf,{className:"w-full max-w-2xl max-h-[80vh] overflow-y-auto",children:[v.jsx(Lv,{children:v.jsx(Mv,{children:"Custom Headers"})}),v.jsx(aQ,{headers:m,onChange:h,onSave:()=>ee(!1)})]})]}),v.jsxs(Pf,{open:H,onOpenChange:K,children:[v.jsx(Dv,{asChild:!0,children:v.jsxs(gt,{variant:"outline",className:"flex-1 justify-center bg-white/10 border-white/20 text-white hover:bg-white/20",children:[v.jsx(I6,{className:"w-4 h-4 mr-2"}),"Configuration"]})}),v.jsxs(Uf,{className:"w-full max-w-2xl max-h-[80vh] overflow-y-auto",children:[v.jsx(Lv,{children:v.jsx(Mv,{children:"Configuration"})}),v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"space-y-2",children:[v.jsxs(Sr,{className:"text-sm flex items-center gap-1",children:["Request Timeout",v.jsx("span",{className:"text-muted-foreground text-xs",children:"(?)"})]}),v.jsx(Ir,{type:"number",value:g,onChange:U=>y(U.target.value)})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs(Sr,{className:"text-sm flex items-center gap-1",children:["Reset Timeout on Progress",v.jsx("span",{className:"text-muted-foreground text-xs",children:"(?)"})]}),v.jsxs(Fv,{value:E,onValueChange:x,children:[v.jsx(Bv,{className:"w-full",children:v.jsx(zv,{})}),v.jsxs($v,{children:[v.jsx(qs,{value:"True",children:"True"}),v.jsx(qs,{value:"False",children:"False"})]})]})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs(Sr,{className:"text-sm flex items-center gap-1",children:["Maximum Total Timeout",v.jsx("span",{className:"text-muted-foreground text-xs",children:"(?)"})]}),v.jsx(Ir,{type:"number",value:w,onChange:U=>T(U.target.value)})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs(Sr,{className:"text-sm flex items-center gap-1",children:["Inspector Proxy Address",v.jsx("span",{className:"text-muted-foreground text-xs",children:"(?)"})]}),v.jsx(Ir,{value:R,onChange:U=>A(U.target.value),placeholder:""})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs(Sr,{className:"text-sm flex items-center gap-1",children:["Proxy Session Token",v.jsx("span",{className:"text-muted-foreground text-xs",children:"(?)"})]}),v.jsx(Ir,{value:I,onChange:U=>O(U.target.value),className:"font-mono text-xs"})]}),v.jsx("div",{className:"flex justify-end",children:v.jsx(gt,{onClick:()=>K(!1),children:"Save"})})]})]})]})]}),v.jsxs(gt,{onClick:V,disabled:!u.trim(),className:"w-full bg-white text-black hover:bg-white/90 font-semibold mt-4",children:[v.jsx("svg",{className:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Connect"]}),v.jsxs("div",{className:"flex items-center justify-center gap-2 text-white/60 text-sm",children:[v.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500 animate-status-pulse-red"}),"Disconnected"]})]}),v.jsx(rB,{className:"absolute inset-0"})]})]})}const E0=_.createContext({});function S0(t){const e=_.useRef(null);return e.current===null&&(e.current=t()),e.current}const _0=typeof window<"u",$B=_0?_.useLayoutEffect:_.useEffect,nm=_.createContext(null);function x0(t,e){t.indexOf(e)===-1&&t.push(e)}function w0(t,e){const r=t.indexOf(e);r>-1&&t.splice(r,1)}const hi=(t,e,r)=>r>e?e:r<t?t:r;let T0=()=>{};const gi={},qB=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function HB(t){return typeof t=="object"&&t!==null}const GB=t=>/^0[^.\s]+$/u.test(t);function R0(t){let e;return()=>(e===void 0&&(e=t()),e)}const Yn=t=>t,oQ=(t,e)=>r=>e(t(r)),qc=(...t)=>t.reduce(oQ),yc=(t,e,r)=>{const a=e-t;return a===0?1:(r-t)/a};class A0{constructor(){this.subscriptions=[]}add(e){return x0(this.subscriptions,e),()=>w0(this.subscriptions,e)}notify(e,r,a){const n=this.subscriptions.length;if(n)if(n===1)this.subscriptions[0](e,r,a);else for(let s=0;s<n;s++){const u=this.subscriptions[s];u&&u(e,r,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ta=t=>t*1e3,Gn=t=>t/1e3;function VB(t,e){return e?t*(1e3/e):0}const YB=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,sQ=1e-7,lQ=12;function uQ(t,e,r,a,n){let s,u,c=0;do u=e+(r-e)/2,s=YB(u,a,n)-t,s>0?r=u:e=u;while(Math.abs(s)>sQ&&++c<lQ);return u}function Hc(t,e,r,a){if(t===e&&r===a)return Yn;const n=s=>uQ(s,0,1,t,r);return s=>s===0||s===1?s:YB(n(s),e,a)}const WB=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,KB=t=>e=>1-t(1-e),ZB=Hc(.33,1.53,.69,.99),C0=KB(ZB),XB=WB(C0),QB=t=>(t*=2)<1?.5*C0(t):.5*(2-Math.pow(2,-10*(t-1))),N0=t=>1-Math.sin(Math.acos(t)),JB=KB(N0),e$=WB(N0),cQ=Hc(.42,0,1,1),dQ=Hc(0,0,.58,1),t$=Hc(.42,0,.58,1),fQ=t=>Array.isArray(t)&&typeof t[0]!="number",r$=t=>Array.isArray(t)&&typeof t[0]=="number",pQ={linear:Yn,easeIn:cQ,easeInOut:t$,easeOut:dQ,circIn:N0,circInOut:e$,circOut:JB,backIn:C0,backInOut:XB,backOut:ZB,anticipate:QB},mQ=t=>typeof t=="string",pk=t=>{if(r$(t)){T0(t.length===4);const[e,r,a,n]=t;return Hc(e,r,a,n)}else if(mQ(t))return pQ[t];return t},yf=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function hQ(t,e){let r=new Set,a=new Set,n=!1,s=!1;const u=new WeakSet;let c={delta:0,timestamp:0,isProcessing:!1};function f(m){u.has(m)&&(p.schedule(m),t()),m(c)}const p={schedule:(m,h=!1,g=!1)=>{const E=g&&n?r:a;return h&&u.add(m),E.has(m)||E.add(m),m},cancel:m=>{a.delete(m),u.delete(m)},process:m=>{if(c=m,n){s=!0;return}n=!0,[r,a]=[a,r],r.forEach(f),r.clear(),n=!1,s&&(s=!1,p.process(m))}};return p}const gQ=40;function n$(t,e){let r=!1,a=!0;const n={delta:0,timestamp:0,isProcessing:!1},s=()=>r=!0,u=yf.reduce((A,I)=>(A[I]=hQ(s),A),{}),{setup:c,read:f,resolveKeyframes:p,preUpdate:m,update:h,preRender:g,render:y,postRender:E}=u,x=()=>{const A=gi.useManualTiming?n.timestamp:performance.now();r=!1,gi.useManualTiming||(n.delta=a?1e3/60:Math.max(Math.min(A-n.timestamp,gQ),1)),n.timestamp=A,n.isProcessing=!0,c.process(n),f.process(n),p.process(n),m.process(n),h.process(n),g.process(n),y.process(n),E.process(n),n.isProcessing=!1,r&&e&&(a=!1,t(x))},w=()=>{r=!0,a=!0,n.isProcessing||t(x)};return{schedule:yf.reduce((A,I)=>{const O=u[I];return A[I]=(C,N=!1,D=!1)=>(r||w(),O.schedule(C,N,D)),A},{}),cancel:A=>{for(let I=0;I<yf.length;I++)u[yf[I]].cancel(A)},state:n,steps:u}}const{schedule:er,cancel:no,state:Fr,steps:qv}=n$(typeof requestAnimationFrame<"u"?requestAnimationFrame:Yn,!0);let Ff;function vQ(){Ff=void 0}const pn={now:()=>(Ff===void 0&&pn.set(Fr.isProcessing||gi.useManualTiming?Fr.timestamp:performance.now()),Ff),set:t=>{Ff=t,queueMicrotask(vQ)}},a$=t=>e=>typeof e=="string"&&e.startsWith(t),I0=a$("--"),bQ=a$("var(--"),k0=t=>bQ(t)?yQ.test(t.split("/*")[0].trim()):!1,yQ=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Bl={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ec={...Bl,transform:t=>hi(0,1,t)},Ef={...Bl,default:1},ec=t=>Math.round(t*1e5)/1e5,O0=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function EQ(t){return t==null}const SQ=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,D0=(t,e)=>r=>!!(typeof r=="string"&&SQ.test(r)&&r.startsWith(t)||e&&!EQ(r)&&Object.prototype.hasOwnProperty.call(r,e)),i$=(t,e,r)=>a=>{if(typeof a!="string")return a;const[n,s,u,c]=a.match(O0);return{[t]:parseFloat(n),[e]:parseFloat(s),[r]:parseFloat(u),alpha:c!==void 0?parseFloat(c):1}},_Q=t=>hi(0,255,t),Hv={...Bl,transform:t=>Math.round(_Q(t))},Fo={test:D0("rgb","red"),parse:i$("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:a=1})=>"rgba("+Hv.transform(t)+", "+Hv.transform(e)+", "+Hv.transform(r)+", "+ec(Ec.transform(a))+")"};function xQ(t){let e="",r="",a="",n="";return t.length>5?(e=t.substring(1,3),r=t.substring(3,5),a=t.substring(5,7),n=t.substring(7,9)):(e=t.substring(1,2),r=t.substring(2,3),a=t.substring(3,4),n=t.substring(4,5),e+=e,r+=r,a+=a,n+=n),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(a,16),alpha:n?parseInt(n,16)/255:1}}const Pw={test:D0("#"),parse:xQ,transform:Fo.transform},Gc=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),qi=Gc("deg"),Ra=Gc("%"),Xe=Gc("px"),wQ=Gc("vh"),TQ=Gc("vw"),mk={...Ra,parse:t=>Ra.parse(t)/100,transform:t=>Ra.transform(t*100)},ll={test:D0("hsl","hue"),parse:i$("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:a=1})=>"hsla("+Math.round(t)+", "+Ra.transform(ec(e))+", "+Ra.transform(ec(r))+", "+ec(Ec.transform(a))+")"},xr={test:t=>Fo.test(t)||Pw.test(t)||ll.test(t),parse:t=>Fo.test(t)?Fo.parse(t):ll.test(t)?ll.parse(t):Pw.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Fo.transform(t):ll.transform(t),getAnimatableNone:t=>{const e=xr.parse(t);return e.alpha=0,xr.transform(e)}},RQ=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function AQ(t){return isNaN(t)&&typeof t=="string"&&(t.match(O0)?.length||0)+(t.match(RQ)?.length||0)>0}const o$="number",s$="color",CQ="var",NQ="var(",hk="${}",IQ=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Sc(t){const e=t.toString(),r=[],a={color:[],number:[],var:[]},n=[];let s=0;const c=e.replace(IQ,f=>(xr.test(f)?(a.color.push(s),n.push(s$),r.push(xr.parse(f))):f.startsWith(NQ)?(a.var.push(s),n.push(CQ),r.push(f)):(a.number.push(s),n.push(o$),r.push(parseFloat(f))),++s,hk)).split(hk);return{values:r,split:c,indexes:a,types:n}}function l$(t){return Sc(t).values}function u$(t){const{split:e,types:r}=Sc(t),a=e.length;return n=>{let s="";for(let u=0;u<a;u++)if(s+=e[u],n[u]!==void 0){const c=r[u];c===o$?s+=ec(n[u]):c===s$?s+=xr.transform(n[u]):s+=n[u]}return s}}const kQ=t=>typeof t=="number"?0:xr.test(t)?xr.getAnimatableNone(t):t;function OQ(t){const e=l$(t);return u$(t)(e.map(kQ))}const ao={test:AQ,parse:l$,createTransformer:u$,getAnimatableNone:OQ};function Gv(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function DQ({hue:t,saturation:e,lightness:r,alpha:a}){t/=360,e/=100,r/=100;let n=0,s=0,u=0;if(!e)n=s=u=r;else{const c=r<.5?r*(1+e):r+e-r*e,f=2*r-c;n=Gv(f,c,t+1/3),s=Gv(f,c,t),u=Gv(f,c,t-1/3)}return{red:Math.round(n*255),green:Math.round(s*255),blue:Math.round(u*255),alpha:a}}function yp(t,e){return r=>r>0?e:t}const ar=(t,e,r)=>t+(e-t)*r,Vv=(t,e,r)=>{const a=t*t,n=r*(e*e-a)+a;return n<0?0:Math.sqrt(n)},LQ=[Pw,Fo,ll],MQ=t=>LQ.find(e=>e.test(t));function gk(t){const e=MQ(t);if(!e)return!1;let r=e.parse(t);return e===ll&&(r=DQ(r)),r}const vk=(t,e)=>{const r=gk(t),a=gk(e);if(!r||!a)return yp(t,e);const n={...r};return s=>(n.red=Vv(r.red,a.red,s),n.green=Vv(r.green,a.green,s),n.blue=Vv(r.blue,a.blue,s),n.alpha=ar(r.alpha,a.alpha,s),Fo.transform(n))},Uw=new Set(["none","hidden"]);function PQ(t,e){return Uw.has(t)?r=>r<=0?t:e:r=>r>=1?e:t}function UQ(t,e){return r=>ar(t,e,r)}function L0(t){return typeof t=="number"?UQ:typeof t=="string"?k0(t)?yp:xr.test(t)?vk:zQ:Array.isArray(t)?c$:typeof t=="object"?xr.test(t)?vk:jQ:yp}function c$(t,e){const r=[...t],a=r.length,n=t.map((s,u)=>L0(s)(s,e[u]));return s=>{for(let u=0;u<a;u++)r[u]=n[u](s);return r}}function jQ(t,e){const r={...t,...e},a={};for(const n in r)t[n]!==void 0&&e[n]!==void 0&&(a[n]=L0(t[n])(t[n],e[n]));return n=>{for(const s in a)r[s]=a[s](n);return r}}function FQ(t,e){const r=[],a={color:0,var:0,number:0};for(let n=0;n<e.values.length;n++){const s=e.types[n],u=t.indexes[s][a[s]],c=t.values[u]??0;r[n]=c,a[s]++}return r}const zQ=(t,e)=>{const r=ao.createTransformer(e),a=Sc(t),n=Sc(e);return a.indexes.var.length===n.indexes.var.length&&a.indexes.color.length===n.indexes.color.length&&a.indexes.number.length>=n.indexes.number.length?Uw.has(t)&&!n.values.length||Uw.has(e)&&!a.values.length?PQ(t,e):qc(c$(FQ(a,n),n.values),r):yp(t,e)};function d$(t,e,r){return typeof t=="number"&&typeof e=="number"&&typeof r=="number"?ar(t,e,r):L0(t)(t,e)}const BQ=t=>{const e=({timestamp:r})=>t(r);return{start:(r=!0)=>er.update(e,r),stop:()=>no(e),now:()=>Fr.isProcessing?Fr.timestamp:pn.now()}},f$=(t,e,r=10)=>{let a="";const n=Math.max(Math.round(e/r),2);for(let s=0;s<n;s++)a+=Math.round(t(s/(n-1))*1e4)/1e4+", ";return`linear(${a.substring(0,a.length-2)})`},Ep=2e4;function M0(t){let e=0;const r=50;let a=t.next(e);for(;!a.done&&e<Ep;)e+=r,a=t.next(e);return e>=Ep?1/0:e}function $Q(t,e=100,r){const a=r({...t,keyframes:[0,e]}),n=Math.min(M0(a),Ep);return{type:"keyframes",ease:s=>a.next(n*s).value/e,duration:Gn(n)}}const qQ=5;function p$(t,e,r){const a=Math.max(e-qQ,0);return VB(r-t(a),e-a)}const cr={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Yv=.001;function HQ({duration:t=cr.duration,bounce:e=cr.bounce,velocity:r=cr.velocity,mass:a=cr.mass}){let n,s,u=1-e;u=hi(cr.minDamping,cr.maxDamping,u),t=hi(cr.minDuration,cr.maxDuration,Gn(t)),u<1?(n=p=>{const m=p*u,h=m*t,g=m-r,y=jw(p,u),E=Math.exp(-h);return Yv-g/y*E},s=p=>{const h=p*u*t,g=h*r+r,y=Math.pow(u,2)*Math.pow(p,2)*t,E=Math.exp(-h),x=jw(Math.pow(p,2),u);return(-n(p)+Yv>0?-1:1)*((g-y)*E)/x}):(n=p=>{const m=Math.exp(-p*t),h=(p-r)*t+1;return-Yv+m*h},s=p=>{const m=Math.exp(-p*t),h=(r-p)*(t*t);return m*h});const c=5/t,f=VQ(n,s,c);if(t=Ta(t),isNaN(f))return{stiffness:cr.stiffness,damping:cr.damping,duration:t};{const p=Math.pow(f,2)*a;return{stiffness:p,damping:u*2*Math.sqrt(a*p),duration:t}}}const GQ=12;function VQ(t,e,r){let a=r;for(let n=1;n<GQ;n++)a=a-t(a)/e(a);return a}function jw(t,e){return t*Math.sqrt(1-e*e)}const YQ=["duration","bounce"],WQ=["stiffness","damping","mass"];function bk(t,e){return e.some(r=>t[r]!==void 0)}function KQ(t){let e={velocity:cr.velocity,stiffness:cr.stiffness,damping:cr.damping,mass:cr.mass,isResolvedFromDuration:!1,...t};if(!bk(t,WQ)&&bk(t,YQ))if(t.visualDuration){const r=t.visualDuration,a=2*Math.PI/(r*1.2),n=a*a,s=2*hi(.05,1,1-(t.bounce||0))*Math.sqrt(n);e={...e,mass:cr.mass,stiffness:n,damping:s}}else{const r=HQ(t);e={...e,...r,mass:cr.mass},e.isResolvedFromDuration=!0}return e}function Sp(t=cr.visualDuration,e=cr.bounce){const r=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:a,restDelta:n}=r;const s=r.keyframes[0],u=r.keyframes[r.keyframes.length-1],c={done:!1,value:s},{stiffness:f,damping:p,mass:m,duration:h,velocity:g,isResolvedFromDuration:y}=KQ({...r,velocity:-Gn(r.velocity||0)}),E=g||0,x=p/(2*Math.sqrt(f*m)),w=u-s,T=Gn(Math.sqrt(f/m)),R=Math.abs(w)<5;a||(a=R?cr.restSpeed.granular:cr.restSpeed.default),n||(n=R?cr.restDelta.granular:cr.restDelta.default);let A;if(x<1){const O=jw(T,x);A=C=>{const N=Math.exp(-x*T*C);return u-N*((E+x*T*w)/O*Math.sin(O*C)+w*Math.cos(O*C))}}else if(x===1)A=O=>u-Math.exp(-T*O)*(w+(E+T*w)*O);else{const O=T*Math.sqrt(x*x-1);A=C=>{const N=Math.exp(-x*T*C),D=Math.min(O*C,300);return u-N*((E+x*T*w)*Math.sinh(D)+O*w*Math.cosh(D))/O}}const I={calculatedDuration:y&&h||null,next:O=>{const C=A(O);if(y)c.done=O>=h;else{let N=O===0?E:0;x<1&&(N=O===0?Ta(E):p$(A,O,C));const D=Math.abs(N)<=a,L=Math.abs(u-C)<=n;c.done=D&&L}return c.value=c.done?u:C,c},toString:()=>{const O=Math.min(M0(I),Ep),C=f$(N=>I.next(O*N).value,O,30);return O+"ms "+C},toTransition:()=>{}};return I}Sp.applyToOptions=t=>{const e=$Q(t,100,Sp);return t.ease=e.ease,t.duration=Ta(e.duration),t.type="keyframes",t};function Fw({keyframes:t,velocity:e=0,power:r=.8,timeConstant:a=325,bounceDamping:n=10,bounceStiffness:s=500,modifyTarget:u,min:c,max:f,restDelta:p=.5,restSpeed:m}){const h=t[0],g={done:!1,value:h},y=D=>c!==void 0&&D<c||f!==void 0&&D>f,E=D=>c===void 0?f:f===void 0||Math.abs(c-D)<Math.abs(f-D)?c:f;let x=r*e;const w=h+x,T=u===void 0?w:u(w);T!==w&&(x=T-h);const R=D=>-x*Math.exp(-D/a),A=D=>T+R(D),I=D=>{const L=R(D),P=A(D);g.done=Math.abs(L)<=p,g.value=g.done?T:P};let O,C;const N=D=>{y(g.value)&&(O=D,C=Sp({keyframes:[g.value,E(g.value)],velocity:p$(A,D,g.value),damping:n,stiffness:s,restDelta:p,restSpeed:m}))};return N(0),{calculatedDuration:null,next:D=>{let L=!1;return!C&&O===void 0&&(L=!0,I(D),N(D)),O!==void 0&&D>=O?C.next(D-O):(!L&&I(D),g)}}}function ZQ(t,e,r){const a=[],n=r||gi.mix||d$,s=t.length-1;for(let u=0;u<s;u++){let c=n(t[u],t[u+1]);if(e){const f=Array.isArray(e)?e[u]||Yn:e;c=qc(f,c)}a.push(c)}return a}function XQ(t,e,{clamp:r=!0,ease:a,mixer:n}={}){const s=t.length;if(T0(s===e.length),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const u=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const c=ZQ(e,a,n),f=c.length,p=m=>{if(u&&m<t[0])return e[0];let h=0;if(f>1)for(;h<t.length-2&&!(m<t[h+1]);h++);const g=yc(t[h],t[h+1],m);return c[h](g)};return r?m=>p(hi(t[0],t[s-1],m)):p}function QQ(t,e){const r=t[t.length-1];for(let a=1;a<=e;a++){const n=yc(0,e,a);t.push(ar(r,1,n))}}function JQ(t){const e=[0];return QQ(e,t.length-1),e}function eJ(t,e){return t.map(r=>r*e)}function tJ(t,e){return t.map(()=>e||t$).splice(0,t.length-1)}function tc({duration:t=300,keyframes:e,times:r,ease:a="easeInOut"}){const n=fQ(a)?a.map(pk):pk(a),s={done:!1,value:e[0]},u=eJ(r&&r.length===e.length?r:JQ(e),t),c=XQ(u,e,{ease:Array.isArray(n)?n:tJ(e,n)});return{calculatedDuration:t,next:f=>(s.value=c(f),s.done=f>=t,s)}}const rJ=t=>t!==null;function P0(t,{repeat:e,repeatType:r="loop"},a,n=1){const s=t.filter(rJ),c=n<0||e&&r!=="loop"&&e%2===1?0:s.length-1;return!c||a===void 0?s[c]:a}const nJ={decay:Fw,inertia:Fw,tween:tc,keyframes:tc,spring:Sp};function m$(t){typeof t.type=="string"&&(t.type=nJ[t.type])}class U0{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,r){return this.finished.then(e,r)}}const aJ=t=>t/100;class j0 extends U0{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:r}=this.options;r&&r.updatedAt!==pn.now()&&this.tick(pn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;m$(e);const{type:r=tc,repeat:a=0,repeatDelay:n=0,repeatType:s,velocity:u=0}=e;let{keyframes:c}=e;const f=r||tc;f!==tc&&typeof c[0]!="number"&&(this.mixKeyframes=qc(aJ,d$(c[0],c[1])),c=[0,100]);const p=f({...e,keyframes:c});s==="mirror"&&(this.mirroredGenerator=f({...e,keyframes:[...c].reverse(),velocity:-u})),p.calculatedDuration===null&&(p.calculatedDuration=M0(p));const{calculatedDuration:m}=p;this.calculatedDuration=m,this.resolvedDuration=m+n,this.totalDuration=this.resolvedDuration*(a+1)-n,this.generator=p}updateTime(e){const r=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(e,r=!1){const{generator:a,totalDuration:n,mixKeyframes:s,mirroredGenerator:u,resolvedDuration:c,calculatedDuration:f}=this;if(this.startTime===null)return a.next(0);const{delay:p=0,keyframes:m,repeat:h,repeatType:g,repeatDelay:y,type:E,onUpdate:x,finalKeyframe:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-n/this.speed,this.startTime)),r?this.currentTime=e:this.updateTime(e);const T=this.currentTime-p*(this.playbackSpeed>=0?1:-1),R=this.playbackSpeed>=0?T<0:T>n;this.currentTime=Math.max(T,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=n);let A=this.currentTime,I=a;if(h){const D=Math.min(this.currentTime,n)/c;let L=Math.floor(D),P=D%1;!P&&D>=1&&(P=1),P===1&&L--,L=Math.min(L,h+1),!!(L%2)&&(g==="reverse"?(P=1-P,y&&(P-=y/c)):g==="mirror"&&(I=u)),A=hi(0,1,P)*c}const O=R?{done:!1,value:m[0]}:I.next(A);s&&(O.value=s(O.value));let{done:C}=O;!R&&f!==null&&(C=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);const N=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return N&&E!==Fw&&(O.value=P0(m,this.options,w,this.speed)),x&&x(O.value),N&&this.finish(),O}then(e,r){return this.finished.then(e,r)}get duration(){return Gn(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Gn(e)}get time(){return Gn(this.currentTime)}set time(e){e=Ta(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(pn.now());const r=this.playbackSpeed!==e;this.playbackSpeed=e,r&&(this.time=Gn(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=BQ,startTime:r}=this.options;this.driver||(this.driver=e(n=>this.tick(n))),this.options.onPlay?.();const a=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=a):this.holdTime!==null?this.startTime=a-this.holdTime:this.startTime||(this.startTime=r??a),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(pn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function iJ(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const zo=t=>t*180/Math.PI,zw=t=>{const e=zo(Math.atan2(t[1],t[0]));return Bw(e)},oJ={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:zw,rotateZ:zw,skewX:t=>zo(Math.atan(t[1])),skewY:t=>zo(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Bw=t=>(t=t%360,t<0&&(t+=360),t),yk=zw,Ek=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Sk=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),sJ={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ek,scaleY:Sk,scale:t=>(Ek(t)+Sk(t))/2,rotateX:t=>Bw(zo(Math.atan2(t[6],t[5]))),rotateY:t=>Bw(zo(Math.atan2(-t[2],t[0]))),rotateZ:yk,rotate:yk,skewX:t=>zo(Math.atan(t[4])),skewY:t=>zo(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function $w(t){return t.includes("scale")?1:0}function qw(t,e){if(!t||t==="none")return $w(e);const r=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,n;if(r)a=sJ,n=r;else{const c=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=oJ,n=c}if(!n)return $w(e);const s=a[e],u=n[1].split(",").map(uJ);return typeof s=="function"?s(u):u[s]}const lJ=(t,e)=>{const{transform:r="none"}=getComputedStyle(t);return qw(r,e)};function uJ(t){return parseFloat(t.trim())}const $l=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ql=new Set($l),_k=t=>t===Bl||t===Xe,cJ=new Set(["x","y","z"]),dJ=$l.filter(t=>!cJ.has(t));function fJ(t){const e=[];return dJ.forEach(r=>{const a=t.getValue(r);a!==void 0&&(e.push([r,a.get()]),a.set(r.startsWith("scale")?1:0))}),e}const $o={width:({x:t},{paddingLeft:e="0",paddingRight:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),height:({y:t},{paddingTop:e="0",paddingBottom:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>qw(e,"x"),y:(t,{transform:e})=>qw(e,"y")};$o.translateX=$o.x;$o.translateY=$o.y;const qo=new Set;let Hw=!1,Gw=!1,Vw=!1;function h$(){if(Gw){const t=Array.from(qo).filter(a=>a.needsMeasurement),e=new Set(t.map(a=>a.element)),r=new Map;e.forEach(a=>{const n=fJ(a);n.length&&(r.set(a,n),a.render())}),t.forEach(a=>a.measureInitialState()),e.forEach(a=>{a.render();const n=r.get(a);n&&n.forEach(([s,u])=>{a.getValue(s)?.set(u)})}),t.forEach(a=>a.measureEndState()),t.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}Gw=!1,Hw=!1,qo.forEach(t=>t.complete(Vw)),qo.clear()}function g$(){qo.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Gw=!0)})}function pJ(){Vw=!0,g$(),h$(),Vw=!1}class F0{constructor(e,r,a,n,s,u=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=r,this.name=a,this.motionValue=n,this.element=s,this.isAsync=u}scheduleResolve(){this.state="scheduled",this.isAsync?(qo.add(this),Hw||(Hw=!0,er.read(g$),er.resolveKeyframes(h$))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:r,element:a,motionValue:n}=this;if(e[0]===null){const s=n?.get(),u=e[e.length-1];if(s!==void 0)e[0]=s;else if(a&&r){const c=a.readValue(r,u);c!=null&&(e[0]=c)}e[0]===void 0&&(e[0]=u),n&&s===void 0&&n.set(e[0])}iJ(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),qo.delete(this)}cancel(){this.state==="scheduled"&&(qo.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const mJ=t=>t.startsWith("--");function hJ(t,e,r){mJ(e)?t.style.setProperty(e,r):t.style[e]=r}const gJ=R0(()=>window.ScrollTimeline!==void 0),vJ={};function bJ(t,e){const r=R0(t);return()=>vJ[e]??r()}const v$=bJ(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Hu=([t,e,r,a])=>`cubic-bezier(${t}, ${e}, ${r}, ${a})`,xk={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Hu([0,.65,.55,1]),circOut:Hu([.55,0,1,.45]),backIn:Hu([.31,.01,.66,-.59]),backOut:Hu([.33,1.53,.69,.99])};function b$(t,e){if(t)return typeof t=="function"?v$()?f$(t,e):"ease-out":r$(t)?Hu(t):Array.isArray(t)?t.map(r=>b$(r,e)||xk.easeOut):xk[t]}function yJ(t,e,r,{delay:a=0,duration:n=300,repeat:s=0,repeatType:u="loop",ease:c="easeOut",times:f}={},p=void 0){const m={[e]:r};f&&(m.offset=f);const h=b$(c,n);Array.isArray(h)&&(m.easing=h);const g={delay:a,duration:n,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:s+1,direction:u==="reverse"?"alternate":"normal"};return p&&(g.pseudoElement=p),t.animate(m,g)}function y$(t){return typeof t=="function"&&"applyToOptions"in t}function EJ({type:t,...e}){return y$(t)&&v$()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class SJ extends U0{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:r,name:a,keyframes:n,pseudoElement:s,allowFlatten:u=!1,finalKeyframe:c,onComplete:f}=e;this.isPseudoElement=!!s,this.allowFlatten=u,this.options=e,T0(typeof e.type!="string");const p=EJ(e);this.animation=yJ(r,a,n,p,s),p.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const m=P0(n,this.options,c,this.speed);this.updateMotionValue?this.updateMotionValue(m):hJ(r,a,m),this.animation.cancel()}f?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return Gn(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Gn(e)}get time(){return Gn(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=Ta(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&gJ()?(this.animation.timeline=e,Yn):r(this)}}const E$={anticipate:QB,backInOut:XB,circInOut:e$};function _J(t){return t in E$}function xJ(t){typeof t.ease=="string"&&_J(t.ease)&&(t.ease=E$[t.ease])}const wk=10;class wJ extends SJ{constructor(e){xJ(e),m$(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:r,onUpdate:a,onComplete:n,element:s,...u}=this.options;if(!r)return;if(e!==void 0){r.set(e);return}const c=new j0({...u,autoplay:!1}),f=Ta(this.finishedTime??this.time);r.setWithVelocity(c.sample(f-wk).value,c.sample(f).value,wk),c.stop()}}const Tk=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(ao.test(t)||t==="0")&&!t.startsWith("url("));function TJ(t){const e=t[0];if(t.length===1)return!0;for(let r=0;r<t.length;r++)if(t[r]!==e)return!0}function RJ(t,e,r,a){const n=t[0];if(n===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],u=Tk(n,e),c=Tk(s,e);return!u||!c?!1:TJ(t)||(r==="spring"||y$(r))&&a}function Yw(t){t.duration=0,t.type="keyframes"}const AJ=new Set(["opacity","clipPath","filter","transform"]),CJ=R0(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function NJ(t){const{motionValue:e,name:r,repeatDelay:a,repeatType:n,damping:s,type:u}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:p}=e.owner.getProps();return CJ()&&r&&AJ.has(r)&&(r!=="transform"||!p)&&!f&&!a&&n!=="mirror"&&s!==0&&u!=="inertia"}const IJ=40;class kJ extends U0{constructor({autoplay:e=!0,delay:r=0,type:a="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:u="loop",keyframes:c,name:f,motionValue:p,element:m,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=pn.now();const g={autoplay:e,delay:r,type:a,repeat:n,repeatDelay:s,repeatType:u,name:f,motionValue:p,element:m,...h},y=m?.KeyframeResolver||F0;this.keyframeResolver=new y(c,(E,x,w)=>this.onKeyframesResolved(E,x,g,!w),f,p,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,r,a,n){this.keyframeResolver=void 0;const{name:s,type:u,velocity:c,delay:f,isHandoff:p,onUpdate:m}=a;this.resolvedAt=pn.now(),RJ(e,s,u,c)||((gi.instantAnimations||!f)&&m?.(P0(e,a,r)),e[0]=e[e.length-1],Yw(a),a.repeat=0);const g={startTime:n?this.resolvedAt?this.resolvedAt-this.createdAt>IJ?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...a,keyframes:e},y=!p&&NJ(g)?new wJ({...g,element:g.motionValue.owner.current}):new j0(g);y.finished.then(()=>this.notifyFinished()).catch(Yn),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(e,r){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),pJ()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const OJ=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function DJ(t){const e=OJ.exec(t);if(!e)return[,];const[,r,a,n]=e;return[`--${r??a}`,n]}function S$(t,e,r=1){const[a,n]=DJ(t);if(!a)return;const s=window.getComputedStyle(e).getPropertyValue(a);if(s){const u=s.trim();return qB(u)?parseFloat(u):u}return k0(n)?S$(n,e,r+1):n}function z0(t,e){return t?.[e]??t?.default??t}const _$=new Set(["width","height","top","left","right","bottom",...$l]),LJ={test:t=>t==="auto",parse:t=>t},x$=t=>e=>e.test(t),w$=[Bl,Xe,Ra,qi,TQ,wQ,LJ],Rk=t=>w$.find(x$(t));function MJ(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||GB(t):!0}const PJ=new Set(["brightness","contrast","saturate","opacity"]);function UJ(t){const[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[a]=r.match(O0)||[];if(!a)return t;const n=r.replace(a,"");let s=PJ.has(e)?1:0;return a!==r&&(s*=100),e+"("+s+n+")"}const jJ=/\b([a-z-]*)\(.*?\)/gu,Ww={...ao,getAnimatableNone:t=>{const e=t.match(jJ);return e?e.map(UJ).join(" "):t}},Ak={...Bl,transform:Math.round},FJ={rotate:qi,rotateX:qi,rotateY:qi,rotateZ:qi,scale:Ef,scaleX:Ef,scaleY:Ef,scaleZ:Ef,skew:qi,skewX:qi,skewY:qi,distance:Xe,translateX:Xe,translateY:Xe,translateZ:Xe,x:Xe,y:Xe,z:Xe,perspective:Xe,transformPerspective:Xe,opacity:Ec,originX:mk,originY:mk,originZ:Xe},B0={borderWidth:Xe,borderTopWidth:Xe,borderRightWidth:Xe,borderBottomWidth:Xe,borderLeftWidth:Xe,borderRadius:Xe,radius:Xe,borderTopLeftRadius:Xe,borderTopRightRadius:Xe,borderBottomRightRadius:Xe,borderBottomLeftRadius:Xe,width:Xe,maxWidth:Xe,height:Xe,maxHeight:Xe,top:Xe,right:Xe,bottom:Xe,left:Xe,padding:Xe,paddingTop:Xe,paddingRight:Xe,paddingBottom:Xe,paddingLeft:Xe,margin:Xe,marginTop:Xe,marginRight:Xe,marginBottom:Xe,marginLeft:Xe,backgroundPositionX:Xe,backgroundPositionY:Xe,...FJ,zIndex:Ak,fillOpacity:Ec,strokeOpacity:Ec,numOctaves:Ak},zJ={...B0,color:xr,backgroundColor:xr,outlineColor:xr,fill:xr,stroke:xr,borderColor:xr,borderTopColor:xr,borderRightColor:xr,borderBottomColor:xr,borderLeftColor:xr,filter:Ww,WebkitFilter:Ww},T$=t=>zJ[t];function R$(t,e){let r=T$(t);return r!==Ww&&(r=ao),r.getAnimatableNone?r.getAnimatableNone(e):void 0}const BJ=new Set(["auto","none","0"]);function $J(t,e,r){let a=0,n;for(;a<t.length&&!n;){const s=t[a];typeof s=="string"&&!BJ.has(s)&&Sc(s).values.length&&(n=t[a]),a++}if(n&&r)for(const s of e)t[s]=R$(r,n)}class qJ extends F0{constructor(e,r,a,n,s){super(e,r,a,n,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:r,name:a}=this;if(!r||!r.current)return;super.readKeyframes();for(let f=0;f<e.length;f++){let p=e[f];if(typeof p=="string"&&(p=p.trim(),k0(p))){const m=S$(p,r.current);m!==void 0&&(e[f]=m),f===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!_$.has(a)||e.length!==2)return;const[n,s]=e,u=Rk(n),c=Rk(s);if(u!==c)if(_k(u)&&_k(c))for(let f=0;f<e.length;f++){const p=e[f];typeof p=="string"&&(e[f]=parseFloat(p))}else $o[a]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:r}=this,a=[];for(let n=0;n<e.length;n++)(e[n]===null||MJ(e[n]))&&a.push(n);a.length&&$J(e,a,r)}measureInitialState(){const{element:e,unresolvedKeyframes:r,name:a}=this;if(!e||!e.current)return;a==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=$o[a](e.measureViewportBox(),window.getComputedStyle(e.current)),r[0]=this.measuredOrigin;const n=r[r.length-1];n!==void 0&&e.getValue(a,n).jump(n,!1)}measureEndState(){const{element:e,name:r,unresolvedKeyframes:a}=this;if(!e||!e.current)return;const n=e.getValue(r);n&&n.jump(this.measuredOrigin,!1);const s=a.length-1,u=a[s];a[s]=$o[r](e.measureViewportBox(),window.getComputedStyle(e.current)),u!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=u),this.removedTransforms?.length&&this.removedTransforms.forEach(([c,f])=>{e.getValue(c).set(f)}),this.resolveNoneKeyframes()}}function A$(t,e,r){if(t instanceof EventTarget)return[t];if(typeof t=="string"){const n=document.querySelectorAll(t);return n?Array.from(n):[]}return Array.from(t)}const C$=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function N$(t){return HB(t)&&"offsetHeight"in t}const Ck=30,HJ=t=>!isNaN(parseFloat(t));class GJ{constructor(e,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const n=pn.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const s of this.dependents)s.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=r.owner}setCurrent(e){this.current=e,this.updatedAt=pn.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=HJ(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,r){this.events[e]||(this.events[e]=new A0);const a=this.events[e].add(r);return e==="change"?()=>{a(),er.read(()=>{this.events.change.getSize()||this.stop()})}:a}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,r){this.passiveEffect=e,this.stopPassiveEffect=r}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,r,a){this.set(r),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-a}jump(e,r=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=pn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Ck)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,Ck);return VB(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(e){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=e(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Nl(t,e){return new GJ(t,e)}const{schedule:$0}=n$(queueMicrotask,!1),ta={x:!1,y:!1};function I$(){return ta.x||ta.y}function VJ(t){return t==="x"||t==="y"?ta[t]?null:(ta[t]=!0,()=>{ta[t]=!1}):ta.x||ta.y?null:(ta.x=ta.y=!0,()=>{ta.x=ta.y=!1})}function k$(t,e){const r=A$(t),a=new AbortController,n={passive:!0,...e,signal:a.signal};return[r,n,()=>a.abort()]}function Nk(t){return!(t.pointerType==="touch"||I$())}function YJ(t,e,r={}){const[a,n,s]=k$(t,r),u=c=>{if(!Nk(c))return;const{target:f}=c,p=e(f,c);if(typeof p!="function"||!f)return;const m=h=>{Nk(h)&&(p(h),f.removeEventListener("pointerleave",m))};f.addEventListener("pointerleave",m,n)};return a.forEach(c=>{c.addEventListener("pointerenter",u,n)}),s}const O$=(t,e)=>e?t===e?!0:O$(t,e.parentElement):!1,q0=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,WJ=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function KJ(t){return WJ.has(t.tagName)||t.tabIndex!==-1}const zf=new WeakSet;function Ik(t){return e=>{e.key==="Enter"&&t(e)}}function Wv(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const ZJ=(t,e)=>{const r=t.currentTarget;if(!r)return;const a=Ik(()=>{if(zf.has(r))return;Wv(r,"down");const n=Ik(()=>{Wv(r,"up")}),s=()=>Wv(r,"cancel");r.addEventListener("keyup",n,e),r.addEventListener("blur",s,e)});r.addEventListener("keydown",a,e),r.addEventListener("blur",()=>r.removeEventListener("keydown",a),e)};function kk(t){return q0(t)&&!I$()}function XJ(t,e,r={}){const[a,n,s]=k$(t,r),u=c=>{const f=c.currentTarget;if(!kk(c))return;zf.add(f);const p=e(f,c),m=(y,E)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",g),zf.has(f)&&zf.delete(f),kk(y)&&typeof p=="function"&&p(y,{success:E})},h=y=>{m(y,f===window||f===document||r.useGlobalTarget||O$(f,y.target))},g=y=>{m(y,!1)};window.addEventListener("pointerup",h,n),window.addEventListener("pointercancel",g,n)};return a.forEach(c=>{(r.useGlobalTarget?window:c).addEventListener("pointerdown",u,n),N$(c)&&(c.addEventListener("focus",p=>ZJ(p,n)),!KJ(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),s}function D$(t){return HB(t)&&"ownerSVGElement"in t}function QJ(t){return D$(t)&&t.tagName==="svg"}const Hr=t=>!!(t&&t.getVelocity),JJ=[...w$,xr,ao],eee=t=>JJ.find(x$(t)),H0=_.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Ok(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function tee(...t){return e=>{let r=!1;const a=t.map(n=>{const s=Ok(n,e);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let n=0;n<a.length;n++){const s=a[n];typeof s=="function"?s():Ok(t[n],null)}}}}function ree(...t){return _.useCallback(tee(...t),t)}class nee extends _.Component{getSnapshotBeforeUpdate(e){const r=this.props.childRef.current;if(r&&e.isPresent&&!this.props.isPresent){const a=r.offsetParent,n=N$(a)&&a.offsetWidth||0,s=this.props.sizeRef.current;s.height=r.offsetHeight||0,s.width=r.offsetWidth||0,s.top=r.offsetTop,s.left=r.offsetLeft,s.right=n-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function aee({children:t,isPresent:e,anchorX:r,root:a}){const n=_.useId(),s=_.useRef(null),u=_.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:c}=_.useContext(H0),f=ree(s,t?.ref);return _.useInsertionEffect(()=>{const{width:p,height:m,top:h,left:g,right:y}=u.current;if(e||!s.current||!p||!m)return;const E=r==="left"?`left: ${g}`:`right: ${y}`;s.current.dataset.motionPopId=n;const x=document.createElement("style");c&&(x.nonce=c);const w=a??document.head;return w.appendChild(x),x.sheet&&x.sheet.insertRule(`
312
+ For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return _.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},WW="DialogDescriptionWarning",KW=({contentRef:t,descriptionId:e})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${NF(WW).contentName}}.`;return _.useEffect(()=>{const n=t.current?.getAttribute("aria-describedby");e&&n&&(document.getElementById(e)||console.warn(a))},[a,t,e]),null},IF=gF,ZW=bF,kF=EF,OF=SF,DF=_F,XW=wF,QW=AF;function Pf({...t}){return v.jsx(IF,{"data-slot":"dialog",...t})}function Dv({...t}){return v.jsx(ZW,{"data-slot":"dialog-trigger",...t})}function JW({...t}){return v.jsx(kF,{"data-slot":"dialog-portal",...t})}function e7({className:t,...e}){return v.jsx(OF,{"data-slot":"dialog-overlay",className:Ye("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e})}function Uf({className:t,children:e,showCloseButton:r=!0,...a}){return v.jsxs(JW,{"data-slot":"dialog-portal",children:[v.jsx(e7,{}),v.jsxs(DF,{"data-slot":"dialog-content",className:Ye("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...a,children:[e,r&&v.jsxs(QW,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[v.jsx(f8,{}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Lv({className:t,...e}){return v.jsx("div",{"data-slot":"dialog-header",className:Ye("flex flex-col gap-2 text-center sm:text-left",t),...e})}function Mv({className:t,...e}){return v.jsx(XW,{"data-slot":"dialog-title",className:Ye("text-lg leading-none font-semibold",t),...e})}function KT(t){const e=t+"CollectionProvider",[r,a]=lo(e),[n,s]=r(e,{collectionRef:{current:null},itemMap:new Map}),u=x=>{const{scope:w,children:T}=x,R=Se.useRef(null),A=Se.useRef(new Map).current;return v.jsx(n,{scope:w,itemMap:A,collectionRef:R,children:T})};u.displayName=e;const c=t+"CollectionSlot",f=Ko(c),p=Se.forwardRef((x,w)=>{const{scope:T,children:R}=x,A=s(c,T),I=jt(w,A.collectionRef);return v.jsx(f,{ref:I,children:R})});p.displayName=c;const m=t+"CollectionItemSlot",h="data-radix-collection-item",g=Ko(m),y=Se.forwardRef((x,w)=>{const{scope:T,children:R,...A}=x,I=Se.useRef(null),O=jt(w,I),C=s(m,T);return Se.useEffect(()=>(C.itemMap.set(I,{ref:I,...A}),()=>void C.itemMap.delete(I))),v.jsx(g,{[h]:"",ref:O,children:R})});y.displayName=m;function E(x){const w=s(t+"CollectionConsumer",x);return Se.useCallback(()=>{const R=w.collectionRef.current;if(!R)return[];const A=Array.from(R.querySelectorAll(`[${h}]`));return Array.from(w.itemMap.values()).sort((C,N)=>A.indexOf(C.ref.current)-A.indexOf(N.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:u,Slot:p,ItemSlot:y},E,a]}var t7=_.createContext(void 0);function ZT(t){const e=_.useContext(t7);return t||e||"ltr"}const r7=["top","right","bottom","left"],to=Math.min,Tn=Math.max,fp=Math.round,bf=Math.floor,wa=t=>({x:t,y:t}),n7={left:"right",right:"left",bottom:"top",top:"bottom"},a7={start:"end",end:"start"};function xw(t,e,r){return Tn(t,to(e,r))}function pi(t,e){return typeof t=="function"?t(e):t}function mi(t){return t.split("-")[0]}function Ul(t){return t.split("-")[1]}function XT(t){return t==="x"?"y":"x"}function QT(t){return t==="y"?"height":"width"}const i7=new Set(["top","bottom"]);function Ea(t){return i7.has(mi(t))?"y":"x"}function JT(t){return XT(Ea(t))}function o7(t,e,r){r===void 0&&(r=!1);const a=Ul(t),n=JT(t),s=QT(n);let u=n==="x"?a===(r?"end":"start")?"right":"left":a==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(u=pp(u)),[u,pp(u)]}function s7(t){const e=pp(t);return[ww(t),e,ww(e)]}function ww(t){return t.replace(/start|end/g,e=>a7[e])}const ek=["left","right"],tk=["right","left"],l7=["top","bottom"],u7=["bottom","top"];function c7(t,e,r){switch(t){case"top":case"bottom":return r?e?tk:ek:e?ek:tk;case"left":case"right":return e?l7:u7;default:return[]}}function d7(t,e,r,a){const n=Ul(t);let s=c7(mi(t),r==="start",a);return n&&(s=s.map(u=>u+"-"+n),e&&(s=s.concat(s.map(ww)))),s}function pp(t){return t.replace(/left|right|bottom|top/g,e=>n7[e])}function f7(t){return{top:0,right:0,bottom:0,left:0,...t}}function LF(t){return typeof t!="number"?f7(t):{top:t,right:t,bottom:t,left:t}}function mp(t){const{x:e,y:r,width:a,height:n}=t;return{width:a,height:n,top:r,left:e,right:e+a,bottom:r+n,x:e,y:r}}function rk(t,e,r){let{reference:a,floating:n}=t;const s=Ea(e),u=JT(e),c=QT(u),f=mi(e),p=s==="y",m=a.x+a.width/2-n.width/2,h=a.y+a.height/2-n.height/2,g=a[c]/2-n[c]/2;let y;switch(f){case"top":y={x:m,y:a.y-n.height};break;case"bottom":y={x:m,y:a.y+a.height};break;case"right":y={x:a.x+a.width,y:h};break;case"left":y={x:a.x-n.width,y:h};break;default:y={x:a.x,y:a.y}}switch(Ul(e)){case"start":y[u]-=g*(r&&p?-1:1);break;case"end":y[u]+=g*(r&&p?-1:1);break}return y}const p7=async(t,e,r)=>{const{placement:a="bottom",strategy:n="absolute",middleware:s=[],platform:u}=r,c=s.filter(Boolean),f=await(u.isRTL==null?void 0:u.isRTL(e));let p=await u.getElementRects({reference:t,floating:e,strategy:n}),{x:m,y:h}=rk(p,a,f),g=a,y={},E=0;for(let x=0;x<c.length;x++){const{name:w,fn:T}=c[x],{x:R,y:A,data:I,reset:O}=await T({x:m,y:h,initialPlacement:a,placement:g,strategy:n,middlewareData:y,rects:p,platform:u,elements:{reference:t,floating:e}});m=R??m,h=A??h,y={...y,[w]:{...y[w],...I}},O&&E<=50&&(E++,typeof O=="object"&&(O.placement&&(g=O.placement),O.rects&&(p=O.rects===!0?await u.getElementRects({reference:t,floating:e,strategy:n}):O.rects),{x:m,y:h}=rk(p,g,f)),x=-1)}return{x:m,y:h,placement:g,strategy:n,middlewareData:y}};async function pc(t,e){var r;e===void 0&&(e={});const{x:a,y:n,platform:s,rects:u,elements:c,strategy:f}=t,{boundary:p="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:g=!1,padding:y=0}=pi(e,t),E=LF(y),w=c[g?h==="floating"?"reference":"floating":h],T=mp(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(w)))==null||r?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:p,rootBoundary:m,strategy:f})),R=h==="floating"?{x:a,y:n,width:u.floating.width,height:u.floating.height}:u.reference,A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),I=await(s.isElement==null?void 0:s.isElement(A))?await(s.getScale==null?void 0:s.getScale(A))||{x:1,y:1}:{x:1,y:1},O=mp(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:R,offsetParent:A,strategy:f}):R);return{top:(T.top-O.top+E.top)/I.y,bottom:(O.bottom-T.bottom+E.bottom)/I.y,left:(T.left-O.left+E.left)/I.x,right:(O.right-T.right+E.right)/I.x}}const m7=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:a,placement:n,rects:s,platform:u,elements:c,middlewareData:f}=e,{element:p,padding:m=0}=pi(t,e)||{};if(p==null)return{};const h=LF(m),g={x:r,y:a},y=JT(n),E=QT(y),x=await u.getDimensions(p),w=y==="y",T=w?"top":"left",R=w?"bottom":"right",A=w?"clientHeight":"clientWidth",I=s.reference[E]+s.reference[y]-g[y]-s.floating[E],O=g[y]-s.reference[y],C=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p));let N=C?C[A]:0;(!N||!await(u.isElement==null?void 0:u.isElement(C)))&&(N=c.floating[A]||s.floating[E]);const D=I/2-O/2,L=N/2-x[E]/2-1,P=to(h[T],L),$=to(h[R],L),W=P,ee=N-x[E]-$,te=N/2-x[E]/2+D,ie=xw(W,te,ee),H=!f.arrow&&Ul(n)!=null&&te!==ie&&s.reference[E]/2-(te<W?P:$)-x[E]/2<0,K=H?te<W?te-W:te-ee:0;return{[y]:g[y]+K,data:{[y]:ie,centerOffset:te-ie-K,...H&&{alignmentOffset:K}},reset:H}}}),h7=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,a;const{placement:n,middlewareData:s,rects:u,initialPlacement:c,platform:f,elements:p}=e,{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:x=!0,...w}=pi(t,e);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const T=mi(n),R=Ea(c),A=mi(c)===c,I=await(f.isRTL==null?void 0:f.isRTL(p.floating)),O=g||(A||!x?[pp(c)]:s7(c)),C=E!=="none";!g&&C&&O.push(...d7(c,x,E,I));const N=[c,...O],D=await pc(e,w),L=[];let P=((a=s.flip)==null?void 0:a.overflows)||[];if(m&&L.push(D[T]),h){const te=o7(n,u,I);L.push(D[te[0]],D[te[1]])}if(P=[...P,{placement:n,overflows:L}],!L.every(te=>te<=0)){var $,W;const te=((($=s.flip)==null?void 0:$.index)||0)+1,ie=N[te];if(ie&&(!(h==="alignment"?R!==Ea(ie):!1)||P.every(V=>Ea(V.placement)===R?V.overflows[0]>0:!0)))return{data:{index:te,overflows:P},reset:{placement:ie}};let H=(W=P.filter(K=>K.overflows[0]<=0).sort((K,V)=>K.overflows[1]-V.overflows[1])[0])==null?void 0:W.placement;if(!H)switch(y){case"bestFit":{var ee;const K=(ee=P.filter(V=>{if(C){const X=Ea(V.placement);return X===R||X==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(X=>X>0).reduce((X,le)=>X+le,0)]).sort((V,X)=>V[1]-X[1])[0])==null?void 0:ee[0];K&&(H=K);break}case"initialPlacement":H=c;break}if(n!==H)return{reset:{placement:H}}}return{}}}};function nk(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function ak(t){return r7.some(e=>t[e]>=0)}const g7=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:a="referenceHidden",...n}=pi(t,e);switch(a){case"referenceHidden":{const s=await pc(e,{...n,elementContext:"reference"}),u=nk(s,r.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:ak(u)}}}case"escaped":{const s=await pc(e,{...n,altBoundary:!0}),u=nk(s,r.floating);return{data:{escapedOffsets:u,escaped:ak(u)}}}default:return{}}}}},MF=new Set(["left","top"]);async function v7(t,e){const{placement:r,platform:a,elements:n}=t,s=await(a.isRTL==null?void 0:a.isRTL(n.floating)),u=mi(r),c=Ul(r),f=Ea(r)==="y",p=MF.has(u)?-1:1,m=s&&f?-1:1,h=pi(e,t);let{mainAxis:g,crossAxis:y,alignmentAxis:E}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof E=="number"&&(y=c==="end"?E*-1:E),f?{x:y*m,y:g*p}:{x:g*p,y:y*m}}const b7=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,a;const{x:n,y:s,placement:u,middlewareData:c}=e,f=await v7(e,t);return u===((r=c.offset)==null?void 0:r.placement)&&(a=c.arrow)!=null&&a.alignmentOffset?{}:{x:n+f.x,y:s+f.y,data:{...f,placement:u}}}}},y7=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:a,placement:n}=e,{mainAxis:s=!0,crossAxis:u=!1,limiter:c={fn:w=>{let{x:T,y:R}=w;return{x:T,y:R}}},...f}=pi(t,e),p={x:r,y:a},m=await pc(e,f),h=Ea(mi(n)),g=XT(h);let y=p[g],E=p[h];if(s){const w=g==="y"?"top":"left",T=g==="y"?"bottom":"right",R=y+m[w],A=y-m[T];y=xw(R,y,A)}if(u){const w=h==="y"?"top":"left",T=h==="y"?"bottom":"right",R=E+m[w],A=E-m[T];E=xw(R,E,A)}const x=c.fn({...e,[g]:y,[h]:E});return{...x,data:{x:x.x-r,y:x.y-a,enabled:{[g]:s,[h]:u}}}}}},E7=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:a,placement:n,rects:s,middlewareData:u}=e,{offset:c=0,mainAxis:f=!0,crossAxis:p=!0}=pi(t,e),m={x:r,y:a},h=Ea(n),g=XT(h);let y=m[g],E=m[h];const x=pi(c,e),w=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(f){const A=g==="y"?"height":"width",I=s.reference[g]-s.floating[A]+w.mainAxis,O=s.reference[g]+s.reference[A]-w.mainAxis;y<I?y=I:y>O&&(y=O)}if(p){var T,R;const A=g==="y"?"width":"height",I=MF.has(mi(n)),O=s.reference[h]-s.floating[A]+(I&&((T=u.offset)==null?void 0:T[h])||0)+(I?0:w.crossAxis),C=s.reference[h]+s.reference[A]+(I?0:((R=u.offset)==null?void 0:R[h])||0)-(I?w.crossAxis:0);E<O?E=O:E>C&&(E=C)}return{[g]:y,[h]:E}}}},S7=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,a;const{placement:n,rects:s,platform:u,elements:c}=e,{apply:f=()=>{},...p}=pi(t,e),m=await pc(e,p),h=mi(n),g=Ul(n),y=Ea(n)==="y",{width:E,height:x}=s.floating;let w,T;h==="top"||h==="bottom"?(w=h,T=g===(await(u.isRTL==null?void 0:u.isRTL(c.floating))?"start":"end")?"left":"right"):(T=h,w=g==="end"?"top":"bottom");const R=x-m.top-m.bottom,A=E-m.left-m.right,I=to(x-m[w],R),O=to(E-m[T],A),C=!e.middlewareData.shift;let N=I,D=O;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(D=A),(a=e.middlewareData.shift)!=null&&a.enabled.y&&(N=R),C&&!g){const P=Tn(m.left,0),$=Tn(m.right,0),W=Tn(m.top,0),ee=Tn(m.bottom,0);y?D=E-2*(P!==0||$!==0?P+$:Tn(m.left,m.right)):N=x-2*(W!==0||ee!==0?W+ee:Tn(m.top,m.bottom))}await f({...e,availableWidth:D,availableHeight:N});const L=await u.getDimensions(c.floating);return E!==L.width||x!==L.height?{reset:{rects:!0}}:{}}}};function Hp(){return typeof window<"u"}function jl(t){return PF(t)?(t.nodeName||"").toLowerCase():"#document"}function Rn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ma(t){var e;return(e=(PF(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function PF(t){return Hp()?t instanceof Node||t instanceof Rn(t).Node:!1}function aa(t){return Hp()?t instanceof Element||t instanceof Rn(t).Element:!1}function Ia(t){return Hp()?t instanceof HTMLElement||t instanceof Rn(t).HTMLElement:!1}function ik(t){return!Hp()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Rn(t).ShadowRoot}const _7=new Set(["inline","contents"]);function jc(t){const{overflow:e,overflowX:r,overflowY:a,display:n}=ia(t);return/auto|scroll|overlay|hidden|clip/.test(e+a+r)&&!_7.has(n)}const x7=new Set(["table","td","th"]);function w7(t){return x7.has(jl(t))}const T7=[":popover-open",":modal"];function Gp(t){return T7.some(e=>{try{return t.matches(e)}catch{return!1}})}const R7=["transform","translate","scale","rotate","perspective"],A7=["transform","translate","scale","rotate","perspective","filter"],C7=["paint","layout","strict","content"];function e0(t){const e=t0(),r=aa(t)?ia(t):t;return R7.some(a=>r[a]?r[a]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||A7.some(a=>(r.willChange||"").includes(a))||C7.some(a=>(r.contain||"").includes(a))}function N7(t){let e=ro(t);for(;Ia(e)&&!Al(e);){if(e0(e))return e;if(Gp(e))return null;e=ro(e)}return null}function t0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const I7=new Set(["html","body","#document"]);function Al(t){return I7.has(jl(t))}function ia(t){return Rn(t).getComputedStyle(t)}function Vp(t){return aa(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ro(t){if(jl(t)==="html")return t;const e=t.assignedSlot||t.parentNode||ik(t)&&t.host||Ma(t);return ik(e)?e.host:e}function UF(t){const e=ro(t);return Al(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ia(e)&&jc(e)?e:UF(e)}function mc(t,e,r){var a;e===void 0&&(e=[]),r===void 0&&(r=!0);const n=UF(t),s=n===((a=t.ownerDocument)==null?void 0:a.body),u=Rn(n);if(s){const c=Tw(u);return e.concat(u,u.visualViewport||[],jc(n)?n:[],c&&r?mc(c):[])}return e.concat(n,mc(n,[],r))}function Tw(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function jF(t){const e=ia(t);let r=parseFloat(e.width)||0,a=parseFloat(e.height)||0;const n=Ia(t),s=n?t.offsetWidth:r,u=n?t.offsetHeight:a,c=fp(r)!==s||fp(a)!==u;return c&&(r=s,a=u),{width:r,height:a,$:c}}function r0(t){return aa(t)?t:t.contextElement}function vl(t){const e=r0(t);if(!Ia(e))return wa(1);const r=e.getBoundingClientRect(),{width:a,height:n,$:s}=jF(e);let u=(s?fp(r.width):r.width)/a,c=(s?fp(r.height):r.height)/n;return(!u||!Number.isFinite(u))&&(u=1),(!c||!Number.isFinite(c))&&(c=1),{x:u,y:c}}const k7=wa(0);function FF(t){const e=Rn(t);return!t0()||!e.visualViewport?k7:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function O7(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Rn(t)?!1:e}function Xo(t,e,r,a){e===void 0&&(e=!1),r===void 0&&(r=!1);const n=t.getBoundingClientRect(),s=r0(t);let u=wa(1);e&&(a?aa(a)&&(u=vl(a)):u=vl(t));const c=O7(s,r,a)?FF(s):wa(0);let f=(n.left+c.x)/u.x,p=(n.top+c.y)/u.y,m=n.width/u.x,h=n.height/u.y;if(s){const g=Rn(s),y=a&&aa(a)?Rn(a):a;let E=g,x=Tw(E);for(;x&&a&&y!==E;){const w=vl(x),T=x.getBoundingClientRect(),R=ia(x),A=T.left+(x.clientLeft+parseFloat(R.paddingLeft))*w.x,I=T.top+(x.clientTop+parseFloat(R.paddingTop))*w.y;f*=w.x,p*=w.y,m*=w.x,h*=w.y,f+=A,p+=I,E=Rn(x),x=Tw(E)}}return mp({width:m,height:h,x:f,y:p})}function Yp(t,e){const r=Vp(t).scrollLeft;return e?e.left+r:Xo(Ma(t)).left+r}function zF(t,e){const r=t.getBoundingClientRect(),a=r.left+e.scrollLeft-Yp(t,r),n=r.top+e.scrollTop;return{x:a,y:n}}function D7(t){let{elements:e,rect:r,offsetParent:a,strategy:n}=t;const s=n==="fixed",u=Ma(a),c=e?Gp(e.floating):!1;if(a===u||c&&s)return r;let f={scrollLeft:0,scrollTop:0},p=wa(1);const m=wa(0),h=Ia(a);if((h||!h&&!s)&&((jl(a)!=="body"||jc(u))&&(f=Vp(a)),Ia(a))){const y=Xo(a);p=vl(a),m.x=y.x+a.clientLeft,m.y=y.y+a.clientTop}const g=u&&!h&&!s?zF(u,f):wa(0);return{width:r.width*p.x,height:r.height*p.y,x:r.x*p.x-f.scrollLeft*p.x+m.x+g.x,y:r.y*p.y-f.scrollTop*p.y+m.y+g.y}}function L7(t){return Array.from(t.getClientRects())}function M7(t){const e=Ma(t),r=Vp(t),a=t.ownerDocument.body,n=Tn(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),s=Tn(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight);let u=-r.scrollLeft+Yp(t);const c=-r.scrollTop;return ia(a).direction==="rtl"&&(u+=Tn(e.clientWidth,a.clientWidth)-n),{width:n,height:s,x:u,y:c}}const ok=25;function P7(t,e){const r=Rn(t),a=Ma(t),n=r.visualViewport;let s=a.clientWidth,u=a.clientHeight,c=0,f=0;if(n){s=n.width,u=n.height;const m=t0();(!m||m&&e==="fixed")&&(c=n.offsetLeft,f=n.offsetTop)}const p=Yp(a);if(p<=0){const m=a.ownerDocument,h=m.body,g=getComputedStyle(h),y=m.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,E=Math.abs(a.clientWidth-h.clientWidth-y);E<=ok&&(s-=E)}else p<=ok&&(s+=p);return{width:s,height:u,x:c,y:f}}const U7=new Set(["absolute","fixed"]);function j7(t,e){const r=Xo(t,!0,e==="fixed"),a=r.top+t.clientTop,n=r.left+t.clientLeft,s=Ia(t)?vl(t):wa(1),u=t.clientWidth*s.x,c=t.clientHeight*s.y,f=n*s.x,p=a*s.y;return{width:u,height:c,x:f,y:p}}function sk(t,e,r){let a;if(e==="viewport")a=P7(t,r);else if(e==="document")a=M7(Ma(t));else if(aa(e))a=j7(e,r);else{const n=FF(t);a={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return mp(a)}function BF(t,e){const r=ro(t);return r===e||!aa(r)||Al(r)?!1:ia(r).position==="fixed"||BF(r,e)}function F7(t,e){const r=e.get(t);if(r)return r;let a=mc(t,[],!1).filter(c=>aa(c)&&jl(c)!=="body"),n=null;const s=ia(t).position==="fixed";let u=s?ro(t):t;for(;aa(u)&&!Al(u);){const c=ia(u),f=e0(u);!f&&c.position==="fixed"&&(n=null),(s?!f&&!n:!f&&c.position==="static"&&!!n&&U7.has(n.position)||jc(u)&&!f&&BF(t,u))?a=a.filter(m=>m!==u):n=c,u=ro(u)}return e.set(t,a),a}function z7(t){let{element:e,boundary:r,rootBoundary:a,strategy:n}=t;const u=[...r==="clippingAncestors"?Gp(e)?[]:F7(e,this._c):[].concat(r),a],c=u[0],f=u.reduce((p,m)=>{const h=sk(e,m,n);return p.top=Tn(h.top,p.top),p.right=to(h.right,p.right),p.bottom=to(h.bottom,p.bottom),p.left=Tn(h.left,p.left),p},sk(e,c,n));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function B7(t){const{width:e,height:r}=jF(t);return{width:e,height:r}}function $7(t,e,r){const a=Ia(e),n=Ma(e),s=r==="fixed",u=Xo(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const f=wa(0);function p(){f.x=Yp(n)}if(a||!a&&!s)if((jl(e)!=="body"||jc(n))&&(c=Vp(e)),a){const y=Xo(e,!0,s,e);f.x=y.x+e.clientLeft,f.y=y.y+e.clientTop}else n&&p();s&&!a&&n&&p();const m=n&&!a&&!s?zF(n,c):wa(0),h=u.left+c.scrollLeft-f.x-m.x,g=u.top+c.scrollTop-f.y-m.y;return{x:h,y:g,width:u.width,height:u.height}}function Pv(t){return ia(t).position==="static"}function lk(t,e){if(!Ia(t)||ia(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return Ma(t)===r&&(r=r.ownerDocument.body),r}function $F(t,e){const r=Rn(t);if(Gp(t))return r;if(!Ia(t)){let n=ro(t);for(;n&&!Al(n);){if(aa(n)&&!Pv(n))return n;n=ro(n)}return r}let a=lk(t,e);for(;a&&w7(a)&&Pv(a);)a=lk(a,e);return a&&Al(a)&&Pv(a)&&!e0(a)?r:a||N7(t)||r}const q7=async function(t){const e=this.getOffsetParent||$F,r=this.getDimensions,a=await r(t.floating);return{reference:$7(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function H7(t){return ia(t).direction==="rtl"}const G7={convertOffsetParentRelativeRectToViewportRelativeRect:D7,getDocumentElement:Ma,getClippingRect:z7,getOffsetParent:$F,getElementRects:q7,getClientRects:L7,getDimensions:B7,getScale:vl,isElement:aa,isRTL:H7};function qF(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function V7(t,e){let r=null,a;const n=Ma(t);function s(){var c;clearTimeout(a),(c=r)==null||c.disconnect(),r=null}function u(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),s();const p=t.getBoundingClientRect(),{left:m,top:h,width:g,height:y}=p;if(c||e(),!g||!y)return;const E=bf(h),x=bf(n.clientWidth-(m+g)),w=bf(n.clientHeight-(h+y)),T=bf(m),A={rootMargin:-E+"px "+-x+"px "+-w+"px "+-T+"px",threshold:Tn(0,to(1,f))||1};let I=!0;function O(C){const N=C[0].intersectionRatio;if(N!==f){if(!I)return u();N?u(!1,N):a=setTimeout(()=>{u(!1,1e-7)},1e3)}N===1&&!qF(p,t.getBoundingClientRect())&&u(),I=!1}try{r=new IntersectionObserver(O,{...A,root:n.ownerDocument})}catch{r=new IntersectionObserver(O,A)}r.observe(t)}return u(!0),s}function Y7(t,e,r,a){a===void 0&&(a={});const{ancestorScroll:n=!0,ancestorResize:s=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=a,p=r0(t),m=n||s?[...p?mc(p):[],...mc(e)]:[];m.forEach(T=>{n&&T.addEventListener("scroll",r,{passive:!0}),s&&T.addEventListener("resize",r)});const h=p&&c?V7(p,r):null;let g=-1,y=null;u&&(y=new ResizeObserver(T=>{let[R]=T;R&&R.target===p&&y&&(y.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var A;(A=y)==null||A.observe(e)})),r()}),p&&!f&&y.observe(p),y.observe(e));let E,x=f?Xo(t):null;f&&w();function w(){const T=Xo(t);x&&!qF(x,T)&&r(),x=T,E=requestAnimationFrame(w)}return r(),()=>{var T;m.forEach(R=>{n&&R.removeEventListener("scroll",r),s&&R.removeEventListener("resize",r)}),h?.(),(T=y)==null||T.disconnect(),y=null,f&&cancelAnimationFrame(E)}}const W7=b7,K7=y7,Z7=h7,X7=S7,Q7=g7,uk=m7,J7=E7,eK=(t,e,r)=>{const a=new Map,n={platform:G7,...r},s={...n.platform,_c:a};return p7(t,e,{...n,platform:s})};var tK=typeof document<"u",rK=function(){},jf=tK?_.useLayoutEffect:rK;function hp(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,a,n;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(a=r;a--!==0;)if(!hp(t[a],e[a]))return!1;return!0}if(n=Object.keys(t),r=n.length,r!==Object.keys(e).length)return!1;for(a=r;a--!==0;)if(!{}.hasOwnProperty.call(e,n[a]))return!1;for(a=r;a--!==0;){const s=n[a];if(!(s==="_owner"&&t.$$typeof)&&!hp(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function HF(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function ck(t,e){const r=HF(t);return Math.round(e*r)/r}function Uv(t){const e=_.useRef(t);return jf(()=>{e.current=t}),e}function nK(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:a=[],platform:n,elements:{reference:s,floating:u}={},transform:c=!0,whileElementsMounted:f,open:p}=t,[m,h]=_.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[g,y]=_.useState(a);hp(g,a)||y(a);const[E,x]=_.useState(null),[w,T]=_.useState(null),R=_.useCallback(V=>{V!==C.current&&(C.current=V,x(V))},[]),A=_.useCallback(V=>{V!==N.current&&(N.current=V,T(V))},[]),I=s||E,O=u||w,C=_.useRef(null),N=_.useRef(null),D=_.useRef(m),L=f!=null,P=Uv(f),$=Uv(n),W=Uv(p),ee=_.useCallback(()=>{if(!C.current||!N.current)return;const V={placement:e,strategy:r,middleware:g};$.current&&(V.platform=$.current),eK(C.current,N.current,V).then(X=>{const le={...X,isPositioned:W.current!==!1};te.current&&!hp(D.current,le)&&(D.current=le,Ll.flushSync(()=>{h(le)}))})},[g,e,r,$,W]);jf(()=>{p===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,h(V=>({...V,isPositioned:!1})))},[p]);const te=_.useRef(!1);jf(()=>(te.current=!0,()=>{te.current=!1}),[]),jf(()=>{if(I&&(C.current=I),O&&(N.current=O),I&&O){if(P.current)return P.current(I,O,ee);ee()}},[I,O,ee,P,L]);const ie=_.useMemo(()=>({reference:C,floating:N,setReference:R,setFloating:A}),[R,A]),H=_.useMemo(()=>({reference:I,floating:O}),[I,O]),K=_.useMemo(()=>{const V={position:r,left:0,top:0};if(!H.floating)return V;const X=ck(H.floating,m.x),le=ck(H.floating,m.y);return c?{...V,transform:"translate("+X+"px, "+le+"px)",...HF(H.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:X,top:le}},[r,c,H.floating,m.x,m.y]);return _.useMemo(()=>({...m,update:ee,refs:ie,elements:H,floatingStyles:K}),[m,ee,ie,H,K])}const aK=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:a,padding:n}=typeof t=="function"?t(r):t;return a&&e(a)?a.current!=null?uk({element:a.current,padding:n}).fn(r):{}:a?uk({element:a,padding:n}).fn(r):{}}}},iK=(t,e)=>({...W7(t),options:[t,e]}),oK=(t,e)=>({...K7(t),options:[t,e]}),sK=(t,e)=>({...J7(t),options:[t,e]}),lK=(t,e)=>({...Z7(t),options:[t,e]}),uK=(t,e)=>({...X7(t),options:[t,e]}),cK=(t,e)=>({...Q7(t),options:[t,e]}),dK=(t,e)=>({...aK(t),options:[t,e]});var fK="Arrow",GF=_.forwardRef((t,e)=>{const{children:r,width:a=10,height:n=5,...s}=t;return v.jsx(nt.svg,{...s,ref:e,width:a,height:n,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});GF.displayName=fK;var pK=GF;function mK(t){const[e,r]=_.useState(void 0);return Vr(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const a=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;const s=n[0];let u,c;if("borderBoxSize"in s){const f=s.borderBoxSize,p=Array.isArray(f)?f[0]:f;u=p.inlineSize,c=p.blockSize}else u=t.offsetWidth,c=t.offsetHeight;r({width:u,height:c})});return a.observe(t,{box:"border-box"}),()=>a.unobserve(t)}else r(void 0)},[t]),e}var n0="Popper",[VF,Fl]=lo(n0),[hK,YF]=VF(n0),WF=t=>{const{__scopePopper:e,children:r}=t,[a,n]=_.useState(null);return v.jsx(hK,{scope:e,anchor:a,onAnchorChange:n,children:r})};WF.displayName=n0;var KF="PopperAnchor",ZF=_.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:a,...n}=t,s=YF(KF,r),u=_.useRef(null),c=jt(e,u),f=_.useRef(null);return _.useEffect(()=>{const p=f.current;f.current=a?.current||u.current,p!==f.current&&s.onAnchorChange(f.current)}),a?null:v.jsx(nt.div,{...n,ref:c})});ZF.displayName=KF;var a0="PopperContent",[gK,vK]=VF(a0),XF=_.forwardRef((t,e)=>{const{__scopePopper:r,side:a="bottom",sideOffset:n=0,align:s="center",alignOffset:u=0,arrowPadding:c=0,avoidCollisions:f=!0,collisionBoundary:p=[],collisionPadding:m=0,sticky:h="partial",hideWhenDetached:g=!1,updatePositionStrategy:y="optimized",onPlaced:E,...x}=t,w=YF(a0,r),[T,R]=_.useState(null),A=jt(e,j=>R(j)),[I,O]=_.useState(null),C=mK(I),N=C?.width??0,D=C?.height??0,L=a+(s!=="center"?"-"+s:""),P=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},$=Array.isArray(p)?p:[p],W=$.length>0,ee={padding:P,boundary:$.filter(yK),altBoundary:W},{refs:te,floatingStyles:ie,placement:H,isPositioned:K,middlewareData:V}=nK({strategy:"fixed",placement:L,whileElementsMounted:(...j)=>Y7(...j,{animationFrame:y==="always"}),elements:{reference:w.anchor},middleware:[iK({mainAxis:n+D,alignmentAxis:u}),f&&oK({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?sK():void 0,...ee}),f&&lK({...ee}),uK({...ee,apply:({elements:j,rects:Q,availableWidth:fe,availableHeight:ae})=>{const{width:pe,height:_e}=Q.reference,we=j.floating.style;we.setProperty("--radix-popper-available-width",`${fe}px`),we.setProperty("--radix-popper-available-height",`${ae}px`),we.setProperty("--radix-popper-anchor-width",`${pe}px`),we.setProperty("--radix-popper-anchor-height",`${_e}px`)}}),I&&dK({element:I,padding:c}),EK({arrowWidth:N,arrowHeight:D}),g&&cK({strategy:"referenceHidden",...ee})]}),[X,le]=ez(H),M=Na(E);Vr(()=>{K&&M?.()},[K,M]);const z=V.arrow?.x,q=V.arrow?.y,Y=V.arrow?.centerOffset!==0,[B,U]=_.useState();return Vr(()=>{T&&U(window.getComputedStyle(T).zIndex)},[T]),v.jsx("div",{ref:te.setFloating,"data-radix-popper-content-wrapper":"",style:{...ie,transform:K?ie.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:v.jsx(gK,{scope:r,placedSide:X,onArrowChange:O,arrowX:z,arrowY:q,shouldHideArrow:Y,children:v.jsx(nt.div,{"data-side":X,"data-align":le,...x,ref:A,style:{...x.style,animation:K?void 0:"none"}})})})});XF.displayName=a0;var QF="PopperArrow",bK={top:"bottom",right:"left",bottom:"top",left:"right"},JF=_.forwardRef(function(e,r){const{__scopePopper:a,...n}=e,s=vK(QF,a),u=bK[s.placedSide];return v.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:v.jsx(pK,{...n,ref:r,style:{...n.style,display:"block"}})})});JF.displayName=QF;function yK(t){return t!==null}var EK=t=>({name:"transformOrigin",options:t,fn(e){const{placement:r,rects:a,middlewareData:n}=e,u=n.arrow?.centerOffset!==0,c=u?0:t.arrowWidth,f=u?0:t.arrowHeight,[p,m]=ez(r),h={start:"0%",center:"50%",end:"100%"}[m],g=(n.arrow?.x??0)+c/2,y=(n.arrow?.y??0)+f/2;let E="",x="";return p==="bottom"?(E=u?h:`${g}px`,x=`${-f}px`):p==="top"?(E=u?h:`${g}px`,x=`${a.floating.height+f}px`):p==="right"?(E=`${-f}px`,x=u?h:`${y}px`):p==="left"&&(E=`${a.floating.width+f}px`,x=u?h:`${y}px`),{data:{x:E,y:x}}}});function ez(t){const[e,r="center"]=t.split("-");return[e,r]}var i0=WF,o0=ZF,s0=XF,l0=JF,jv="rovingFocusGroup.onEntryFocus",SK={bubbles:!1,cancelable:!0},Fc="RovingFocusGroup",[Rw,tz,_K]=KT(Fc),[xK,rz]=lo(Fc,[_K]),[wK,TK]=xK(Fc),nz=_.forwardRef((t,e)=>v.jsx(Rw.Provider,{scope:t.__scopeRovingFocusGroup,children:v.jsx(Rw.Slot,{scope:t.__scopeRovingFocusGroup,children:v.jsx(RK,{...t,ref:e})})}));nz.displayName=Fc;var RK=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:a,loop:n=!1,dir:s,currentTabStopId:u,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:f,onEntryFocus:p,preventScrollOnEntryFocus:m=!1,...h}=t,g=_.useRef(null),y=jt(e,g),E=ZT(s),[x,w]=Rl({prop:u,defaultProp:c??null,onChange:f,caller:Fc}),[T,R]=_.useState(!1),A=Na(p),I=tz(r),O=_.useRef(!1),[C,N]=_.useState(0);return _.useEffect(()=>{const D=g.current;if(D)return D.addEventListener(jv,A),()=>D.removeEventListener(jv,A)},[A]),v.jsx(wK,{scope:r,orientation:a,dir:E,loop:n,currentTabStopId:x,onItemFocus:_.useCallback(D=>w(D),[w]),onItemShiftTab:_.useCallback(()=>R(!0),[]),onFocusableItemAdd:_.useCallback(()=>N(D=>D+1),[]),onFocusableItemRemove:_.useCallback(()=>N(D=>D-1),[]),children:v.jsx(nt.div,{tabIndex:T||C===0?-1:0,"data-orientation":a,...h,ref:y,style:{outline:"none",...t.style},onMouseDown:Ue(t.onMouseDown,()=>{O.current=!0}),onFocus:Ue(t.onFocus,D=>{const L=!O.current;if(D.target===D.currentTarget&&L&&!T){const P=new CustomEvent(jv,SK);if(D.currentTarget.dispatchEvent(P),!P.defaultPrevented){const $=I().filter(H=>H.focusable),W=$.find(H=>H.active),ee=$.find(H=>H.id===x),ie=[W,ee,...$].filter(Boolean).map(H=>H.ref.current);oz(ie,m)}}O.current=!1}),onBlur:Ue(t.onBlur,()=>R(!1))})})}),az="RovingFocusGroupItem",iz=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:a=!0,active:n=!1,tabStopId:s,children:u,...c}=t,f=Gr(),p=s||f,m=TK(az,r),h=m.currentTabStopId===p,g=tz(r),{onFocusableItemAdd:y,onFocusableItemRemove:E,currentTabStopId:x}=m;return _.useEffect(()=>{if(a)return y(),()=>E()},[a,y,E]),v.jsx(Rw.ItemSlot,{scope:r,id:p,focusable:a,active:n,children:v.jsx(nt.span,{tabIndex:h?0:-1,"data-orientation":m.orientation,...c,ref:e,onMouseDown:Ue(t.onMouseDown,w=>{a?m.onItemFocus(p):w.preventDefault()}),onFocus:Ue(t.onFocus,()=>m.onItemFocus(p)),onKeyDown:Ue(t.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){m.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const T=NK(w,m.orientation,m.dir);if(T!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let A=g().filter(I=>I.focusable).map(I=>I.ref.current);if(T==="last")A.reverse();else if(T==="prev"||T==="next"){T==="prev"&&A.reverse();const I=A.indexOf(w.currentTarget);A=m.loop?IK(A,I+1):A.slice(I+1)}setTimeout(()=>oz(A))}}),children:typeof u=="function"?u({isCurrentTabStop:h,hasTabStop:x!=null}):u})})});iz.displayName=az;var AK={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function CK(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function NK(t,e,r){const a=CK(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return AK[a]}function oz(t,e=!1){const r=document.activeElement;for(const a of t)if(a===r||(a.focus({preventScroll:e}),document.activeElement!==r))return}function IK(t,e){return t.map((r,a)=>t[(e+a)%t.length])}var kK=nz,OK=iz,Aw=["Enter"," "],DK=["ArrowDown","PageUp","Home"],sz=["ArrowUp","PageDown","End"],LK=[...DK,...sz],MK={ltr:[...Aw,"ArrowRight"],rtl:[...Aw,"ArrowLeft"]},PK={ltr:["ArrowLeft"],rtl:["ArrowRight"]},zc="Menu",[hc,UK,jK]=KT(zc),[rs,lz]=lo(zc,[jK,Fl,rz]),Wp=Fl(),uz=rz(),[FK,ns]=rs(zc),[zK,Bc]=rs(zc),cz=t=>{const{__scopeMenu:e,open:r=!1,children:a,dir:n,onOpenChange:s,modal:u=!0}=t,c=Wp(e),[f,p]=_.useState(null),m=_.useRef(!1),h=Na(s),g=ZT(n);return _.useEffect(()=>{const y=()=>{m.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},E=()=>m.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{capture:!0})}},[]),v.jsx(i0,{...c,children:v.jsx(FK,{scope:e,open:r,onOpenChange:h,content:f,onContentChange:p,children:v.jsx(zK,{scope:e,onClose:_.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:m,dir:g,modal:u,children:a})})})};cz.displayName=zc;var BK="MenuAnchor",u0=_.forwardRef((t,e)=>{const{__scopeMenu:r,...a}=t,n=Wp(r);return v.jsx(o0,{...n,...a,ref:e})});u0.displayName=BK;var c0="MenuPortal",[$K,dz]=rs(c0,{forceMount:void 0}),fz=t=>{const{__scopeMenu:e,forceMount:r,children:a,container:n}=t,s=ns(c0,e);return v.jsx($K,{scope:e,forceMount:r,children:v.jsx(La,{present:r||s.open,children:v.jsx(Uc,{asChild:!0,container:n,children:a})})})};fz.displayName=c0;var Vn="MenuContent",[qK,d0]=rs(Vn),pz=_.forwardRef((t,e)=>{const r=dz(Vn,t.__scopeMenu),{forceMount:a=r.forceMount,...n}=t,s=ns(Vn,t.__scopeMenu),u=Bc(Vn,t.__scopeMenu);return v.jsx(hc.Provider,{scope:t.__scopeMenu,children:v.jsx(La,{present:a||s.open,children:v.jsx(hc.Slot,{scope:t.__scopeMenu,children:u.modal?v.jsx(HK,{...n,ref:e}):v.jsx(GK,{...n,ref:e})})})})}),HK=_.forwardRef((t,e)=>{const r=ns(Vn,t.__scopeMenu),a=_.useRef(null),n=jt(e,a);return _.useEffect(()=>{const s=a.current;if(s)return GT(s)},[]),v.jsx(f0,{...t,ref:n,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Ue(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),GK=_.forwardRef((t,e)=>{const r=ns(Vn,t.__scopeMenu);return v.jsx(f0,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),VK=Ko("MenuContent.ScrollLock"),f0=_.forwardRef((t,e)=>{const{__scopeMenu:r,loop:a=!1,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:u,disableOutsidePointerEvents:c,onEntryFocus:f,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:g,onDismiss:y,disableOutsideScroll:E,...x}=t,w=ns(Vn,r),T=Bc(Vn,r),R=Wp(r),A=uz(r),I=UK(r),[O,C]=_.useState(null),N=_.useRef(null),D=jt(e,N,w.onContentChange),L=_.useRef(0),P=_.useRef(""),$=_.useRef(0),W=_.useRef(null),ee=_.useRef("right"),te=_.useRef(0),ie=E?$p:_.Fragment,H=E?{as:VK,allowPinchZoom:!0}:void 0,K=X=>{const le=P.current+X,M=I().filter(j=>!j.disabled),z=document.activeElement,q=M.find(j=>j.ref.current===z)?.textValue,Y=M.map(j=>j.textValue),B=aZ(Y,le,q),U=M.find(j=>j.textValue===B)?.ref.current;(function j(Q){P.current=Q,window.clearTimeout(L.current),Q!==""&&(L.current=window.setTimeout(()=>j(""),1e3))})(le),U&&setTimeout(()=>U.focus())};_.useEffect(()=>()=>window.clearTimeout(L.current),[]),HT();const V=_.useCallback(X=>ee.current===W.current?.side&&oZ(X,W.current?.area),[]);return v.jsx(qK,{scope:r,searchRef:P,onItemEnter:_.useCallback(X=>{V(X)&&X.preventDefault()},[V]),onItemLeave:_.useCallback(X=>{V(X)||(N.current?.focus(),C(null))},[V]),onTriggerLeave:_.useCallback(X=>{V(X)&&X.preventDefault()},[V]),pointerGraceTimerRef:$,onPointerGraceIntentChange:_.useCallback(X=>{W.current=X},[]),children:v.jsx(ie,{...H,children:v.jsx(zp,{asChild:!0,trapped:n,onMountAutoFocus:Ue(s,X=>{X.preventDefault(),N.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:v.jsx(Pc,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:g,onDismiss:y,children:v.jsx(kK,{asChild:!0,...A,dir:T.dir,orientation:"vertical",loop:a,currentTabStopId:O,onCurrentTabStopIdChange:C,onEntryFocus:Ue(f,X=>{T.isUsingKeyboardRef.current||X.preventDefault()}),preventScrollOnEntryFocus:!0,children:v.jsx(s0,{role:"menu","aria-orientation":"vertical","data-state":Nz(w.open),"data-radix-menu-content":"",dir:T.dir,...R,...x,ref:D,style:{outline:"none",...x.style},onKeyDown:Ue(x.onKeyDown,X=>{const M=X.target.closest("[data-radix-menu-content]")===X.currentTarget,z=X.ctrlKey||X.altKey||X.metaKey,q=X.key.length===1;M&&(X.key==="Tab"&&X.preventDefault(),!z&&q&&K(X.key));const Y=N.current;if(X.target!==Y||!LK.includes(X.key))return;X.preventDefault();const U=I().filter(j=>!j.disabled).map(j=>j.ref.current);sz.includes(X.key)&&U.reverse(),rZ(U)}),onBlur:Ue(t.onBlur,X=>{X.currentTarget.contains(X.target)||(window.clearTimeout(L.current),P.current="")}),onPointerMove:Ue(t.onPointerMove,gc(X=>{const le=X.target,M=te.current!==X.clientX;if(X.currentTarget.contains(le)&&M){const z=X.clientX>te.current?"right":"left";ee.current=z,te.current=X.clientX}}))})})})})})})});pz.displayName=Vn;var YK="MenuGroup",p0=_.forwardRef((t,e)=>{const{__scopeMenu:r,...a}=t;return v.jsx(nt.div,{role:"group",...a,ref:e})});p0.displayName=YK;var WK="MenuLabel",mz=_.forwardRef((t,e)=>{const{__scopeMenu:r,...a}=t;return v.jsx(nt.div,{...a,ref:e})});mz.displayName=WK;var gp="MenuItem",dk="menu.itemSelect",Kp=_.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:a,...n}=t,s=_.useRef(null),u=Bc(gp,t.__scopeMenu),c=d0(gp,t.__scopeMenu),f=jt(e,s),p=_.useRef(!1),m=()=>{const h=s.current;if(!r&&h){const g=new CustomEvent(dk,{bubbles:!0,cancelable:!0});h.addEventListener(dk,y=>a?.(y),{once:!0}),nF(h,g),g.defaultPrevented?p.current=!1:u.onClose()}};return v.jsx(hz,{...n,ref:f,disabled:r,onClick:Ue(t.onClick,m),onPointerDown:h=>{t.onPointerDown?.(h),p.current=!0},onPointerUp:Ue(t.onPointerUp,h=>{p.current||h.currentTarget?.click()}),onKeyDown:Ue(t.onKeyDown,h=>{const g=c.searchRef.current!=="";r||g&&h.key===" "||Aw.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});Kp.displayName=gp;var hz=_.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:a=!1,textValue:n,...s}=t,u=d0(gp,r),c=uz(r),f=_.useRef(null),p=jt(e,f),[m,h]=_.useState(!1),[g,y]=_.useState("");return _.useEffect(()=>{const E=f.current;E&&y((E.textContent??"").trim())},[s.children]),v.jsx(hc.ItemSlot,{scope:r,disabled:a,textValue:n??g,children:v.jsx(OK,{asChild:!0,...c,focusable:!a,children:v.jsx(nt.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...s,ref:p,onPointerMove:Ue(t.onPointerMove,gc(E=>{a?u.onItemLeave(E):(u.onItemEnter(E),E.defaultPrevented||E.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ue(t.onPointerLeave,gc(E=>u.onItemLeave(E))),onFocus:Ue(t.onFocus,()=>h(!0)),onBlur:Ue(t.onBlur,()=>h(!1))})})})}),KK="MenuCheckboxItem",gz=_.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:a,...n}=t;return v.jsx(Sz,{scope:t.__scopeMenu,checked:r,children:v.jsx(Kp,{role:"menuitemcheckbox","aria-checked":vp(r)?"mixed":r,...n,ref:e,"data-state":h0(r),onSelect:Ue(n.onSelect,()=>a?.(vp(r)?!0:!r),{checkForDefaultPrevented:!1})})})});gz.displayName=KK;var vz="MenuRadioGroup",[ZK,XK]=rs(vz,{value:void 0,onValueChange:()=>{}}),bz=_.forwardRef((t,e)=>{const{value:r,onValueChange:a,...n}=t,s=Na(a);return v.jsx(ZK,{scope:t.__scopeMenu,value:r,onValueChange:s,children:v.jsx(p0,{...n,ref:e})})});bz.displayName=vz;var yz="MenuRadioItem",Ez=_.forwardRef((t,e)=>{const{value:r,...a}=t,n=XK(yz,t.__scopeMenu),s=r===n.value;return v.jsx(Sz,{scope:t.__scopeMenu,checked:s,children:v.jsx(Kp,{role:"menuitemradio","aria-checked":s,...a,ref:e,"data-state":h0(s),onSelect:Ue(a.onSelect,()=>n.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});Ez.displayName=yz;var m0="MenuItemIndicator",[Sz,QK]=rs(m0,{checked:!1}),_z=_.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:a,...n}=t,s=QK(m0,r);return v.jsx(La,{present:a||vp(s.checked)||s.checked===!0,children:v.jsx(nt.span,{...n,ref:e,"data-state":h0(s.checked)})})});_z.displayName=m0;var JK="MenuSeparator",xz=_.forwardRef((t,e)=>{const{__scopeMenu:r,...a}=t;return v.jsx(nt.div,{role:"separator","aria-orientation":"horizontal",...a,ref:e})});xz.displayName=JK;var eZ="MenuArrow",wz=_.forwardRef((t,e)=>{const{__scopeMenu:r,...a}=t,n=Wp(r);return v.jsx(l0,{...n,...a,ref:e})});wz.displayName=eZ;var tZ="MenuSub",[Dfe,Tz]=rs(tZ),$u="MenuSubTrigger",Rz=_.forwardRef((t,e)=>{const r=ns($u,t.__scopeMenu),a=Bc($u,t.__scopeMenu),n=Tz($u,t.__scopeMenu),s=d0($u,t.__scopeMenu),u=_.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:f}=s,p={__scopeMenu:t.__scopeMenu},m=_.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return _.useEffect(()=>m,[m]),_.useEffect(()=>{const h=c.current;return()=>{window.clearTimeout(h),f(null)}},[c,f]),v.jsx(u0,{asChild:!0,...p,children:v.jsx(hz,{id:n.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":n.contentId,"data-state":Nz(r.open),...t,ref:fi(e,n.onTriggerChange),onClick:h=>{t.onClick?.(h),!(t.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Ue(t.onPointerMove,gc(h=>{s.onItemEnter(h),!h.defaultPrevented&&!t.disabled&&!r.open&&!u.current&&(s.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{r.onOpenChange(!0),m()},100))})),onPointerLeave:Ue(t.onPointerLeave,gc(h=>{m();const g=r.content?.getBoundingClientRect();if(g){const y=r.content?.dataset.side,E=y==="right",x=E?-5:5,w=g[E?"left":"right"],T=g[E?"right":"left"];s.onPointerGraceIntentChange({area:[{x:h.clientX+x,y:h.clientY},{x:w,y:g.top},{x:T,y:g.top},{x:T,y:g.bottom},{x:w,y:g.bottom}],side:y}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(h),h.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Ue(t.onKeyDown,h=>{const g=s.searchRef.current!=="";t.disabled||g&&h.key===" "||MK[a.dir].includes(h.key)&&(r.onOpenChange(!0),r.content?.focus(),h.preventDefault())})})})});Rz.displayName=$u;var Az="MenuSubContent",Cz=_.forwardRef((t,e)=>{const r=dz(Vn,t.__scopeMenu),{forceMount:a=r.forceMount,...n}=t,s=ns(Vn,t.__scopeMenu),u=Bc(Vn,t.__scopeMenu),c=Tz(Az,t.__scopeMenu),f=_.useRef(null),p=jt(e,f);return v.jsx(hc.Provider,{scope:t.__scopeMenu,children:v.jsx(La,{present:a||s.open,children:v.jsx(hc.Slot,{scope:t.__scopeMenu,children:v.jsx(f0,{id:c.contentId,"aria-labelledby":c.triggerId,...n,ref:p,align:"start",side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{u.isUsingKeyboardRef.current&&f.current?.focus(),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Ue(t.onFocusOutside,m=>{m.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:Ue(t.onEscapeKeyDown,m=>{u.onClose(),m.preventDefault()}),onKeyDown:Ue(t.onKeyDown,m=>{const h=m.currentTarget.contains(m.target),g=PK[u.dir].includes(m.key);h&&g&&(s.onOpenChange(!1),c.trigger?.focus(),m.preventDefault())})})})})})});Cz.displayName=Az;function Nz(t){return t?"open":"closed"}function vp(t){return t==="indeterminate"}function h0(t){return vp(t)?"indeterminate":t?"checked":"unchecked"}function rZ(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function nZ(t,e){return t.map((r,a)=>t[(e+a)%t.length])}function aZ(t,e,r){const n=e.length>1&&Array.from(e).every(p=>p===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let u=nZ(t,Math.max(s,0));n.length===1&&(u=u.filter(p=>p!==r));const f=u.find(p=>p.toLowerCase().startsWith(n.toLowerCase()));return f!==r?f:void 0}function iZ(t,e){const{x:r,y:a}=t;let n=!1;for(let s=0,u=e.length-1;s<e.length;u=s++){const c=e[s],f=e[u],p=c.x,m=c.y,h=f.x,g=f.y;m>a!=g>a&&r<(h-p)*(a-m)/(g-m)+p&&(n=!n)}return n}function oZ(t,e){if(!e)return!1;const r={x:t.clientX,y:t.clientY};return iZ(r,e)}function gc(t){return e=>e.pointerType==="mouse"?t(e):void 0}var sZ=cz,lZ=u0,uZ=fz,cZ=pz,dZ=p0,fZ=mz,pZ=Kp,mZ=gz,hZ=bz,gZ=Ez,vZ=_z,bZ=xz,yZ=wz,EZ=Rz,SZ=Cz,Zp="DropdownMenu",[_Z]=lo(Zp,[lz]),en=lz(),[xZ,Iz]=_Z(Zp),kz=t=>{const{__scopeDropdownMenu:e,children:r,dir:a,open:n,defaultOpen:s,onOpenChange:u,modal:c=!0}=t,f=en(e),p=_.useRef(null),[m,h]=Rl({prop:n,defaultProp:s??!1,onChange:u,caller:Zp});return v.jsx(xZ,{scope:e,triggerId:Gr(),triggerRef:p,contentId:Gr(),open:m,onOpenChange:h,onOpenToggle:_.useCallback(()=>h(g=>!g),[h]),modal:c,children:v.jsx(sZ,{...f,open:m,onOpenChange:h,dir:a,modal:c,children:r})})};kz.displayName=Zp;var Oz="DropdownMenuTrigger",Dz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,disabled:a=!1,...n}=t,s=Iz(Oz,r),u=en(r);return v.jsx(lZ,{asChild:!0,...u,children:v.jsx(nt.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...n,ref:fi(e,s.triggerRef),onPointerDown:Ue(t.onPointerDown,c=>{!a&&c.button===0&&c.ctrlKey===!1&&(s.onOpenToggle(),s.open||c.preventDefault())}),onKeyDown:Ue(t.onKeyDown,c=>{a||(["Enter"," "].includes(c.key)&&s.onOpenToggle(),c.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});Dz.displayName=Oz;var wZ="DropdownMenuPortal",Lz=t=>{const{__scopeDropdownMenu:e,...r}=t,a=en(e);return v.jsx(uZ,{...a,...r})};Lz.displayName=wZ;var Mz="DropdownMenuContent",Pz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=Iz(Mz,r),s=en(r),u=_.useRef(!1);return v.jsx(cZ,{id:n.contentId,"aria-labelledby":n.triggerId,...s,...a,ref:e,onCloseAutoFocus:Ue(t.onCloseAutoFocus,c=>{u.current||n.triggerRef.current?.focus(),u.current=!1,c.preventDefault()}),onInteractOutside:Ue(t.onInteractOutside,c=>{const f=c.detail.originalEvent,p=f.button===0&&f.ctrlKey===!0,m=f.button===2||p;(!n.modal||m)&&(u.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Pz.displayName=Mz;var TZ="DropdownMenuGroup",RZ=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=en(r);return v.jsx(dZ,{...n,...a,ref:e})});RZ.displayName=TZ;var AZ="DropdownMenuLabel",Uz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=en(r);return v.jsx(fZ,{...n,...a,ref:e})});Uz.displayName=AZ;var CZ="DropdownMenuItem",jz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=en(r);return v.jsx(pZ,{...n,...a,ref:e})});jz.displayName=CZ;var NZ="DropdownMenuCheckboxItem",Fz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=en(r);return v.jsx(mZ,{...n,...a,ref:e})});Fz.displayName=NZ;var IZ="DropdownMenuRadioGroup",kZ=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=en(r);return v.jsx(hZ,{...n,...a,ref:e})});kZ.displayName=IZ;var OZ="DropdownMenuRadioItem",zz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=en(r);return v.jsx(gZ,{...n,...a,ref:e})});zz.displayName=OZ;var DZ="DropdownMenuItemIndicator",LZ=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=en(r);return v.jsx(vZ,{...n,...a,ref:e})});LZ.displayName=DZ;var MZ="DropdownMenuSeparator",Bz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=en(r);return v.jsx(bZ,{...n,...a,ref:e})});Bz.displayName=MZ;var PZ="DropdownMenuArrow",UZ=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=en(r);return v.jsx(yZ,{...n,...a,ref:e})});UZ.displayName=PZ;var jZ="DropdownMenuSubTrigger",$z=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=en(r);return v.jsx(EZ,{...n,...a,ref:e})});$z.displayName=jZ;var FZ="DropdownMenuSubContent",qz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...a}=t,n=en(r);return v.jsx(SZ,{...n,...a,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});qz.displayName=FZ;var zZ=kz,BZ=Dz,$Z=Lz,Hz=Pz,Gz=Uz,Vz=jz,Yz=Fz,Wz=zz,Kz=Bz,Zz=$z,Xz=qz;const Qz=zZ,Jz=BZ,qZ=_.forwardRef(({className:t,inset:e,children:r,...a},n)=>v.jsx(Zz,{ref:n,className:Ye("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",e&&"pl-8",t),...a,children:r}));qZ.displayName=Zz.displayName;const HZ=_.forwardRef(({className:t,...e},r)=>v.jsx(Xz,{ref:r,className:Ye("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));HZ.displayName=Xz.displayName;const g0=_.forwardRef(({className:t,sideOffset:e=4,...r},a)=>v.jsx($Z,{children:v.jsx(Hz,{ref:a,sideOffset:e,className:Ye("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));g0.displayName=Hz.displayName;const vc=_.forwardRef(({className:t,inset:e,...r},a)=>v.jsx(Vz,{ref:a,className:Ye("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...r}));vc.displayName=Vz.displayName;const GZ=_.forwardRef(({className:t,children:e,checked:r,...a},n)=>v.jsx(Yz,{ref:n,className:Ye("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:r,...a,children:e}));GZ.displayName=Yz.displayName;const VZ=_.forwardRef(({className:t,children:e,...r},a)=>v.jsx(Wz,{ref:a,className:Ye("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:e}));VZ.displayName=Wz.displayName;const eB=_.forwardRef(({className:t,inset:e,...r},a)=>v.jsx(Gz,{ref:a,className:Ye("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...r}));eB.displayName=Gz.displayName;const Cw=_.forwardRef(({className:t,...e},r)=>v.jsx(Kz,{ref:r,className:Ye("-mx-1 my-1 h-px bg-muted",t),...e}));Cw.displayName=Kz.displayName;function Ir({className:t,type:e,...r}){return v.jsx("input",{type:e,"data-slot":"input",className:Ye("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...r})}var YZ="Label",tB=_.forwardRef((t,e)=>v.jsx(nt.label,{...t,ref:e,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(t.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));tB.displayName=YZ;var WZ=tB;function Sr({className:t,...e}){return v.jsx(WZ,{"data-slot":"label",className:Ye("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...e})}function rB({className:t,color:e,children:r,grayscaled:a=!1}){const n=_.useMemo(()=>{if(e){const h=e.split("(")[1].split(")")[0].trim().split(/\s+/);return Number.parseFloat(h[1]||"0")}return a?0:.2},[e,a]),s=_.useMemo(()=>{if(e){const h=e.split("(")[1].split(")")[0].trim().split(/\s+/);return Number.parseFloat(h[0]||"0.5")}return a?.3:.4},[e,a]),u=_.useMemo(()=>{if(e){const h=e.split("(")[1].split(")")[0].trim().split(/\s+/);return Number.parseFloat(h[2]||"0")}return Math.floor(Math.random()*360)},[e]),c=_.useMemo(()=>e||`oklch(${Math.min(s,1)} ${n} ${u})`,[u,n,s]),f=_.useMemo(()=>`oklch(${Math.min(s*2,1)} ${n} ${u})`,[u,n,s,e]),p=_.useMemo(()=>Math.floor(Math.random()*360),[u]),m=_.useMemo(()=>"1000%",[]);return v.jsx("section",{className:Ye("relative w-full h-full overflow-hidden",t),style:{background:`${f}`},children:v.jsxs("div",{className:"isolate relative w-full h-full",children:[v.jsx("div",{className:"noise w-full h-full",style:{background:`linear-gradient(${p}deg, ${c}, transparent), url(https://grainy-gradients.vercel.app/noise.svg)`,filter:`contrast(120%) brightness(${m})`}}),r&&v.jsx("div",{className:"relative z-10 w-full h-full",children:r})]})})}function fk(t,[e,r]){return Math.min(r,Math.max(e,t))}function KZ(t){const e=_.useRef({value:t,previous:t});return _.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var nB=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ZZ="VisuallyHidden",aB=_.forwardRef((t,e)=>v.jsx(nt.span,{...t,ref:e,style:{...nB,...t.style}}));aB.displayName=ZZ;var XZ=aB,QZ=[" ","Enter","ArrowUp","ArrowDown"],JZ=[" ","Enter"],Qo="Select",[Xp,Qp,eX]=KT(Qo),[zl]=lo(Qo,[eX,Fl]),Jp=Fl(),[tX,uo]=zl(Qo),[rX,nX]=zl(Qo),iB=t=>{const{__scopeSelect:e,children:r,open:a,defaultOpen:n,onOpenChange:s,value:u,defaultValue:c,onValueChange:f,dir:p,name:m,autoComplete:h,disabled:g,required:y,form:E}=t,x=Jp(e),[w,T]=_.useState(null),[R,A]=_.useState(null),[I,O]=_.useState(!1),C=ZT(p),[N,D]=Rl({prop:a,defaultProp:n??!1,onChange:s,caller:Qo}),[L,P]=Rl({prop:u,defaultProp:c,onChange:f,caller:Qo}),$=_.useRef(null),W=w?E||!!w.closest("form"):!0,[ee,te]=_.useState(new Set),ie=Array.from(ee).map(H=>H.props.value).join(";");return v.jsx(i0,{...x,children:v.jsxs(tX,{required:y,scope:e,trigger:w,onTriggerChange:T,valueNode:R,onValueNodeChange:A,valueNodeHasChildren:I,onValueNodeHasChildrenChange:O,contentId:Gr(),value:L,onValueChange:P,open:N,onOpenChange:D,dir:C,triggerPointerDownPosRef:$,disabled:g,children:[v.jsx(Xp.Provider,{scope:e,children:v.jsx(rX,{scope:t.__scopeSelect,onNativeOptionAdd:_.useCallback(H=>{te(K=>new Set(K).add(H))},[]),onNativeOptionRemove:_.useCallback(H=>{te(K=>{const V=new Set(K);return V.delete(H),V})},[]),children:r})}),W?v.jsxs(AB,{"aria-hidden":!0,required:y,tabIndex:-1,name:m,autoComplete:h,value:L,onChange:H=>P(H.target.value),disabled:g,form:E,children:[L===void 0?v.jsx("option",{value:""}):null,Array.from(ee)]},ie):null]})})};iB.displayName=Qo;var oB="SelectTrigger",sB=_.forwardRef((t,e)=>{const{__scopeSelect:r,disabled:a=!1,...n}=t,s=Jp(r),u=uo(oB,r),c=u.disabled||a,f=jt(e,u.onTriggerChange),p=Qp(r),m=_.useRef("touch"),[h,g,y]=NB(x=>{const w=p().filter(A=>!A.disabled),T=w.find(A=>A.value===u.value),R=IB(w,x,T);R!==void 0&&u.onValueChange(R.value)}),E=x=>{c||(u.onOpenChange(!0),y()),x&&(u.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return v.jsx(o0,{asChild:!0,...s,children:v.jsx(nt.button,{type:"button",role:"combobox","aria-controls":u.contentId,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":CB(u.value)?"":void 0,...n,ref:f,onClick:Ue(n.onClick,x=>{x.currentTarget.focus(),m.current!=="mouse"&&E(x)}),onPointerDown:Ue(n.onPointerDown,x=>{m.current=x.pointerType;const w=x.target;w.hasPointerCapture(x.pointerId)&&w.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(E(x),x.preventDefault())}),onKeyDown:Ue(n.onKeyDown,x=>{const w=h.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&g(x.key),!(w&&x.key===" ")&&QZ.includes(x.key)&&(E(),x.preventDefault())})})})});sB.displayName=oB;var lB="SelectValue",uB=_.forwardRef((t,e)=>{const{__scopeSelect:r,className:a,style:n,children:s,placeholder:u="",...c}=t,f=uo(lB,r),{onValueNodeHasChildrenChange:p}=f,m=s!==void 0,h=jt(e,f.onValueNodeChange);return Vr(()=>{p(m)},[p,m]),v.jsx(nt.span,{...c,ref:h,style:{pointerEvents:"none"},children:CB(f.value)?v.jsx(v.Fragment,{children:u}):s})});uB.displayName=lB;var aX="SelectIcon",cB=_.forwardRef((t,e)=>{const{__scopeSelect:r,children:a,...n}=t;return v.jsx(nt.span,{"aria-hidden":!0,...n,ref:e,children:a||"▼"})});cB.displayName=aX;var iX="SelectPortal",dB=t=>v.jsx(Uc,{asChild:!0,...t});dB.displayName=iX;var Jo="SelectContent",fB=_.forwardRef((t,e)=>{const r=uo(Jo,t.__scopeSelect),[a,n]=_.useState();if(Vr(()=>{n(new DocumentFragment)},[]),!r.open){const s=a;return s?Ll.createPortal(v.jsx(pB,{scope:t.__scopeSelect,children:v.jsx(Xp.Slot,{scope:t.__scopeSelect,children:v.jsx("div",{children:t.children})})}),s):null}return v.jsx(mB,{...t,ref:e})});fB.displayName=Jo;var ea=10,[pB,co]=zl(Jo),oX="SelectContentImpl",sX=Ko("SelectContent.RemoveScroll"),mB=_.forwardRef((t,e)=>{const{__scopeSelect:r,position:a="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:s,onPointerDownOutside:u,side:c,sideOffset:f,align:p,alignOffset:m,arrowPadding:h,collisionBoundary:g,collisionPadding:y,sticky:E,hideWhenDetached:x,avoidCollisions:w,...T}=t,R=uo(Jo,r),[A,I]=_.useState(null),[O,C]=_.useState(null),N=jt(e,j=>I(j)),[D,L]=_.useState(null),[P,$]=_.useState(null),W=Qp(r),[ee,te]=_.useState(!1),ie=_.useRef(!1);_.useEffect(()=>{if(A)return GT(A)},[A]),HT();const H=_.useCallback(j=>{const[Q,...fe]=W().map(_e=>_e.ref.current),[ae]=fe.slice(-1),pe=document.activeElement;for(const _e of j)if(_e===pe||(_e?.scrollIntoView({block:"nearest"}),_e===Q&&O&&(O.scrollTop=0),_e===ae&&O&&(O.scrollTop=O.scrollHeight),_e?.focus(),document.activeElement!==pe))return},[W,O]),K=_.useCallback(()=>H([D,A]),[H,D,A]);_.useEffect(()=>{ee&&K()},[ee,K]);const{onOpenChange:V,triggerPointerDownPosRef:X}=R;_.useEffect(()=>{if(A){let j={x:0,y:0};const Q=ae=>{j={x:Math.abs(Math.round(ae.pageX)-(X.current?.x??0)),y:Math.abs(Math.round(ae.pageY)-(X.current?.y??0))}},fe=ae=>{j.x<=10&&j.y<=10?ae.preventDefault():A.contains(ae.target)||V(!1),document.removeEventListener("pointermove",Q),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",Q),document.addEventListener("pointerup",fe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",fe,{capture:!0})}}},[A,V,X]),_.useEffect(()=>{const j=()=>V(!1);return window.addEventListener("blur",j),window.addEventListener("resize",j),()=>{window.removeEventListener("blur",j),window.removeEventListener("resize",j)}},[V]);const[le,M]=NB(j=>{const Q=W().filter(pe=>!pe.disabled),fe=Q.find(pe=>pe.ref.current===document.activeElement),ae=IB(Q,j,fe);ae&&setTimeout(()=>ae.ref.current.focus())}),z=_.useCallback((j,Q,fe)=>{const ae=!ie.current&&!fe;(R.value!==void 0&&R.value===Q||ae)&&(L(j),ae&&(ie.current=!0))},[R.value]),q=_.useCallback(()=>A?.focus(),[A]),Y=_.useCallback((j,Q,fe)=>{const ae=!ie.current&&!fe;(R.value!==void 0&&R.value===Q||ae)&&$(j)},[R.value]),B=a==="popper"?Nw:hB,U=B===Nw?{side:c,sideOffset:f,align:p,alignOffset:m,arrowPadding:h,collisionBoundary:g,collisionPadding:y,sticky:E,hideWhenDetached:x,avoidCollisions:w}:{};return v.jsx(pB,{scope:r,content:A,viewport:O,onViewportChange:C,itemRefCallback:z,selectedItem:D,onItemLeave:q,itemTextRefCallback:Y,focusSelectedItem:K,selectedItemText:P,position:a,isPositioned:ee,searchRef:le,children:v.jsx($p,{as:sX,allowPinchZoom:!0,children:v.jsx(zp,{asChild:!0,trapped:R.open,onMountAutoFocus:j=>{j.preventDefault()},onUnmountAutoFocus:Ue(n,j=>{R.trigger?.focus({preventScroll:!0}),j.preventDefault()}),children:v.jsx(Pc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:j=>j.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:v.jsx(B,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:j=>j.preventDefault(),...T,...U,onPlaced:()=>te(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...T.style},onKeyDown:Ue(T.onKeyDown,j=>{const Q=j.ctrlKey||j.altKey||j.metaKey;if(j.key==="Tab"&&j.preventDefault(),!Q&&j.key.length===1&&M(j.key),["ArrowUp","ArrowDown","Home","End"].includes(j.key)){let ae=W().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(j.key)&&(ae=ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(j.key)){const pe=j.target,_e=ae.indexOf(pe);ae=ae.slice(_e+1)}setTimeout(()=>H(ae)),j.preventDefault()}})})})})})})});mB.displayName=oX;var lX="SelectItemAlignedPosition",hB=_.forwardRef((t,e)=>{const{__scopeSelect:r,onPlaced:a,...n}=t,s=uo(Jo,r),u=co(Jo,r),[c,f]=_.useState(null),[p,m]=_.useState(null),h=jt(e,N=>m(N)),g=Qp(r),y=_.useRef(!1),E=_.useRef(!0),{viewport:x,selectedItem:w,selectedItemText:T,focusSelectedItem:R}=u,A=_.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&p&&x&&w&&T){const N=s.trigger.getBoundingClientRect(),D=p.getBoundingClientRect(),L=s.valueNode.getBoundingClientRect(),P=T.getBoundingClientRect();if(s.dir!=="rtl"){const pe=P.left-D.left,_e=L.left-pe,we=N.left-_e,Ce=N.width+we,et=Math.max(Ce,D.width),$e=window.innerWidth-ea,Ge=fk(_e,[ea,Math.max(ea,$e-et)]);c.style.minWidth=Ce+"px",c.style.left=Ge+"px"}else{const pe=D.right-P.right,_e=window.innerWidth-L.right-pe,we=window.innerWidth-N.right-_e,Ce=N.width+we,et=Math.max(Ce,D.width),$e=window.innerWidth-ea,Ge=fk(_e,[ea,Math.max(ea,$e-et)]);c.style.minWidth=Ce+"px",c.style.right=Ge+"px"}const $=g(),W=window.innerHeight-ea*2,ee=x.scrollHeight,te=window.getComputedStyle(p),ie=parseInt(te.borderTopWidth,10),H=parseInt(te.paddingTop,10),K=parseInt(te.borderBottomWidth,10),V=parseInt(te.paddingBottom,10),X=ie+H+ee+V+K,le=Math.min(w.offsetHeight*5,X),M=window.getComputedStyle(x),z=parseInt(M.paddingTop,10),q=parseInt(M.paddingBottom,10),Y=N.top+N.height/2-ea,B=W-Y,U=w.offsetHeight/2,j=w.offsetTop+U,Q=ie+H+j,fe=X-Q;if(Q<=Y){const pe=$.length>0&&w===$[$.length-1].ref.current;c.style.bottom="0px";const _e=p.clientHeight-x.offsetTop-x.offsetHeight,we=Math.max(B,U+(pe?q:0)+_e+K),Ce=Q+we;c.style.height=Ce+"px"}else{const pe=$.length>0&&w===$[0].ref.current;c.style.top="0px";const we=Math.max(Y,ie+x.offsetTop+(pe?z:0)+U)+fe;c.style.height=we+"px",x.scrollTop=Q-Y+x.offsetTop}c.style.margin=`${ea}px 0`,c.style.minHeight=le+"px",c.style.maxHeight=W+"px",a?.(),requestAnimationFrame(()=>y.current=!0)}},[g,s.trigger,s.valueNode,c,p,x,w,T,s.dir,a]);Vr(()=>A(),[A]);const[I,O]=_.useState();Vr(()=>{p&&O(window.getComputedStyle(p).zIndex)},[p]);const C=_.useCallback(N=>{N&&E.current===!0&&(A(),R?.(),E.current=!1)},[A,R]);return v.jsx(cX,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:y,onScrollButtonChange:C,children:v.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:I},children:v.jsx(nt.div,{...n,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});hB.displayName=lX;var uX="SelectPopperPosition",Nw=_.forwardRef((t,e)=>{const{__scopeSelect:r,align:a="start",collisionPadding:n=ea,...s}=t,u=Jp(r);return v.jsx(s0,{...u,...s,ref:e,align:a,collisionPadding:n,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Nw.displayName=uX;var[cX,v0]=zl(Jo,{}),Iw="SelectViewport",gB=_.forwardRef((t,e)=>{const{__scopeSelect:r,nonce:a,...n}=t,s=co(Iw,r),u=v0(Iw,r),c=jt(e,s.onViewportChange),f=_.useRef(0);return v.jsxs(v.Fragment,{children:[v.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),v.jsx(Xp.Slot,{scope:r,children:v.jsx(nt.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:Ue(n.onScroll,p=>{const m=p.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:g}=u;if(g?.current&&h){const y=Math.abs(f.current-m.scrollTop);if(y>0){const E=window.innerHeight-ea*2,x=parseFloat(h.style.minHeight),w=parseFloat(h.style.height),T=Math.max(x,w);if(T<E){const R=T+y,A=Math.min(E,R),I=R-A;h.style.height=A+"px",h.style.bottom==="0px"&&(m.scrollTop=I>0?I:0,h.style.justifyContent="flex-end")}}}f.current=m.scrollTop})})})]})});gB.displayName=Iw;var vB="SelectGroup",[dX,fX]=zl(vB),pX=_.forwardRef((t,e)=>{const{__scopeSelect:r,...a}=t,n=Gr();return v.jsx(dX,{scope:r,id:n,children:v.jsx(nt.div,{role:"group","aria-labelledby":n,...a,ref:e})})});pX.displayName=vB;var bB="SelectLabel",mX=_.forwardRef((t,e)=>{const{__scopeSelect:r,...a}=t,n=fX(bB,r);return v.jsx(nt.div,{id:n.id,...a,ref:e})});mX.displayName=bB;var bp="SelectItem",[hX,yB]=zl(bp),EB=_.forwardRef((t,e)=>{const{__scopeSelect:r,value:a,disabled:n=!1,textValue:s,...u}=t,c=uo(bp,r),f=co(bp,r),p=c.value===a,[m,h]=_.useState(s??""),[g,y]=_.useState(!1),E=jt(e,R=>f.itemRefCallback?.(R,a,n)),x=Gr(),w=_.useRef("touch"),T=()=>{n||(c.onValueChange(a),c.onOpenChange(!1))};if(a==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return v.jsx(hX,{scope:r,value:a,disabled:n,textId:x,isSelected:p,onItemTextChange:_.useCallback(R=>{h(A=>A||(R?.textContent??"").trim())},[]),children:v.jsx(Xp.ItemSlot,{scope:r,value:a,disabled:n,textValue:m,children:v.jsx(nt.div,{role:"option","aria-labelledby":x,"data-highlighted":g?"":void 0,"aria-selected":p&&g,"data-state":p?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...u,ref:E,onFocus:Ue(u.onFocus,()=>y(!0)),onBlur:Ue(u.onBlur,()=>y(!1)),onClick:Ue(u.onClick,()=>{w.current!=="mouse"&&T()}),onPointerUp:Ue(u.onPointerUp,()=>{w.current==="mouse"&&T()}),onPointerDown:Ue(u.onPointerDown,R=>{w.current=R.pointerType}),onPointerMove:Ue(u.onPointerMove,R=>{w.current=R.pointerType,n?f.onItemLeave?.():w.current==="mouse"&&R.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ue(u.onPointerLeave,R=>{R.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:Ue(u.onKeyDown,R=>{f.searchRef?.current!==""&&R.key===" "||(JZ.includes(R.key)&&T(),R.key===" "&&R.preventDefault())})})})})});EB.displayName=bp;var qu="SelectItemText",SB=_.forwardRef((t,e)=>{const{__scopeSelect:r,className:a,style:n,...s}=t,u=uo(qu,r),c=co(qu,r),f=yB(qu,r),p=nX(qu,r),[m,h]=_.useState(null),g=jt(e,T=>h(T),f.onItemTextChange,T=>c.itemTextRefCallback?.(T,f.value,f.disabled)),y=m?.textContent,E=_.useMemo(()=>v.jsx("option",{value:f.value,disabled:f.disabled,children:y},f.value),[f.disabled,f.value,y]),{onNativeOptionAdd:x,onNativeOptionRemove:w}=p;return Vr(()=>(x(E),()=>w(E)),[x,w,E]),v.jsxs(v.Fragment,{children:[v.jsx(nt.span,{id:f.textId,...s,ref:g}),f.isSelected&&u.valueNode&&!u.valueNodeHasChildren?Ll.createPortal(s.children,u.valueNode):null]})});SB.displayName=qu;var _B="SelectItemIndicator",xB=_.forwardRef((t,e)=>{const{__scopeSelect:r,...a}=t;return yB(_B,r).isSelected?v.jsx(nt.span,{"aria-hidden":!0,...a,ref:e}):null});xB.displayName=_B;var kw="SelectScrollUpButton",wB=_.forwardRef((t,e)=>{const r=co(kw,t.__scopeSelect),a=v0(kw,t.__scopeSelect),[n,s]=_.useState(!1),u=jt(e,a.onScrollButtonChange);return Vr(()=>{if(r.viewport&&r.isPositioned){let c=function(){const p=f.scrollTop>0;s(p)};const f=r.viewport;return c(),f.addEventListener("scroll",c),()=>f.removeEventListener("scroll",c)}},[r.viewport,r.isPositioned]),n?v.jsx(RB,{...t,ref:u,onAutoScroll:()=>{const{viewport:c,selectedItem:f}=r;c&&f&&(c.scrollTop=c.scrollTop-f.offsetHeight)}}):null});wB.displayName=kw;var Ow="SelectScrollDownButton",TB=_.forwardRef((t,e)=>{const r=co(Ow,t.__scopeSelect),a=v0(Ow,t.__scopeSelect),[n,s]=_.useState(!1),u=jt(e,a.onScrollButtonChange);return Vr(()=>{if(r.viewport&&r.isPositioned){let c=function(){const p=f.scrollHeight-f.clientHeight,m=Math.ceil(f.scrollTop)<p;s(m)};const f=r.viewport;return c(),f.addEventListener("scroll",c),()=>f.removeEventListener("scroll",c)}},[r.viewport,r.isPositioned]),n?v.jsx(RB,{...t,ref:u,onAutoScroll:()=>{const{viewport:c,selectedItem:f}=r;c&&f&&(c.scrollTop=c.scrollTop+f.offsetHeight)}}):null});TB.displayName=Ow;var RB=_.forwardRef((t,e)=>{const{__scopeSelect:r,onAutoScroll:a,...n}=t,s=co("SelectScrollButton",r),u=_.useRef(null),c=Qp(r),f=_.useCallback(()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},[]);return _.useEffect(()=>()=>f(),[f]),Vr(()=>{c().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),v.jsx(nt.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:Ue(n.onPointerDown,()=>{u.current===null&&(u.current=window.setInterval(a,50))}),onPointerMove:Ue(n.onPointerMove,()=>{s.onItemLeave?.(),u.current===null&&(u.current=window.setInterval(a,50))}),onPointerLeave:Ue(n.onPointerLeave,()=>{f()})})}),gX="SelectSeparator",vX=_.forwardRef((t,e)=>{const{__scopeSelect:r,...a}=t;return v.jsx(nt.div,{"aria-hidden":!0,...a,ref:e})});vX.displayName=gX;var Dw="SelectArrow",bX=_.forwardRef((t,e)=>{const{__scopeSelect:r,...a}=t,n=Jp(r),s=uo(Dw,r),u=co(Dw,r);return s.open&&u.position==="popper"?v.jsx(l0,{...n,...a,ref:e}):null});bX.displayName=Dw;var yX="SelectBubbleInput",AB=_.forwardRef(({__scopeSelect:t,value:e,...r},a)=>{const n=_.useRef(null),s=jt(a,n),u=KZ(e);return _.useEffect(()=>{const c=n.current;if(!c)return;const f=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(f,"value").set;if(u!==e&&m){const h=new Event("change",{bubbles:!0});m.call(c,e),c.dispatchEvent(h)}},[u,e]),v.jsx(nt.select,{...r,style:{...nB,...r.style},ref:s,defaultValue:e})});AB.displayName=yX;function CB(t){return t===""||t===void 0}function NB(t){const e=Na(t),r=_.useRef(""),a=_.useRef(0),n=_.useCallback(u=>{const c=r.current+u;e(c),(function f(p){r.current=p,window.clearTimeout(a.current),p!==""&&(a.current=window.setTimeout(()=>f(""),1e3))})(c)},[e]),s=_.useCallback(()=>{r.current="",window.clearTimeout(a.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(a.current),[]),[r,n,s]}function IB(t,e,r){const n=e.length>1&&Array.from(e).every(p=>p===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let u=EX(t,Math.max(s,0));n.length===1&&(u=u.filter(p=>p!==r));const f=u.find(p=>p.textValue.toLowerCase().startsWith(n.toLowerCase()));return f!==r?f:void 0}function EX(t,e){return t.map((r,a)=>t[(e+a)%t.length])}var SX=iB,_X=sB,xX=uB,wX=cB,TX=dB,RX=fB,AX=gB,CX=EB,NX=SB,IX=xB,kX=wB,OX=TB;function Fv({...t}){return v.jsx(SX,{"data-slot":"select",...t})}function zv({...t}){return v.jsx(xX,{"data-slot":"select-value",...t})}function Bv({className:t,size:e="default",children:r,...a}){return v.jsxs(_X,{"data-slot":"select-trigger","data-size":e,className:Ye("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...a,children:[r,v.jsx(wX,{asChild:!0,children:v.jsx(jj,{className:"size-4 opacity-50"})})]})}function $v({className:t,children:e,position:r="popper",align:a="center",...n}){return v.jsx(TX,{children:v.jsxs(RX,{"data-slot":"select-content",className:Ye("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,align:a,...n,children:[v.jsx(DX,{}),v.jsx(AX,{className:Ye("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:e}),v.jsx(LX,{})]})})}function qs({className:t,children:e,...r}){return v.jsxs(CX,{"data-slot":"select-item",className:Ye("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...r,children:[v.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:v.jsx(IX,{children:v.jsx(jT,{className:"size-4"})})}),v.jsx(NX,{children:e})]})}function DX({className:t,...e}){return v.jsx(kX,{"data-slot":"select-scroll-up-button",className:Ye("flex cursor-default items-center justify-center py-1",t),...e,children:v.jsx(S6,{className:"size-4"})})}function LX({className:t,...e}){return v.jsx(OX,{"data-slot":"select-scroll-down-button",className:Ye("flex cursor-default items-center justify-center py-1",t),...e,children:v.jsx(jj,{className:"size-4"})})}var[em]=lo("Tooltip",[Fl]),tm=Fl(),kB="TooltipProvider",MX=700,Lw="tooltip.open",[PX,b0]=em(kB),OB=t=>{const{__scopeTooltip:e,delayDuration:r=MX,skipDelayDuration:a=300,disableHoverableContent:n=!1,children:s}=t,u=_.useRef(!0),c=_.useRef(!1),f=_.useRef(0);return _.useEffect(()=>{const p=f.current;return()=>window.clearTimeout(p)},[]),v.jsx(PX,{scope:e,isOpenDelayedRef:u,delayDuration:r,onOpen:_.useCallback(()=>{window.clearTimeout(f.current),u.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>u.current=!0,a)},[a]),isPointerInTransitRef:c,onPointerInTransitChange:_.useCallback(p=>{c.current=p},[]),disableHoverableContent:n,children:s})};OB.displayName=kB;var bc="Tooltip",[UX,$c]=em(bc),DB=t=>{const{__scopeTooltip:e,children:r,open:a,defaultOpen:n,onOpenChange:s,disableHoverableContent:u,delayDuration:c}=t,f=b0(bc,t.__scopeTooltip),p=tm(e),[m,h]=_.useState(null),g=Gr(),y=_.useRef(0),E=u??f.disableHoverableContent,x=c??f.delayDuration,w=_.useRef(!1),[T,R]=Rl({prop:a,defaultProp:n??!1,onChange:N=>{N?(f.onOpen(),document.dispatchEvent(new CustomEvent(Lw))):f.onClose(),s?.(N)},caller:bc}),A=_.useMemo(()=>T?w.current?"delayed-open":"instant-open":"closed",[T]),I=_.useCallback(()=>{window.clearTimeout(y.current),y.current=0,w.current=!1,R(!0)},[R]),O=_.useCallback(()=>{window.clearTimeout(y.current),y.current=0,R(!1)},[R]),C=_.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{w.current=!0,R(!0),y.current=0},x)},[x,R]);return _.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),v.jsx(i0,{...p,children:v.jsx(UX,{scope:e,contentId:g,open:T,stateAttribute:A,trigger:m,onTriggerChange:h,onTriggerEnter:_.useCallback(()=>{f.isOpenDelayedRef.current?C():I()},[f.isOpenDelayedRef,C,I]),onTriggerLeave:_.useCallback(()=>{E?O():(window.clearTimeout(y.current),y.current=0)},[O,E]),onOpen:I,onClose:O,disableHoverableContent:E,children:r})})};DB.displayName=bc;var Mw="TooltipTrigger",LB=_.forwardRef((t,e)=>{const{__scopeTooltip:r,...a}=t,n=$c(Mw,r),s=b0(Mw,r),u=tm(r),c=_.useRef(null),f=jt(e,c,n.onTriggerChange),p=_.useRef(!1),m=_.useRef(!1),h=_.useCallback(()=>p.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),v.jsx(o0,{asChild:!0,...u,children:v.jsx(nt.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...a,ref:f,onPointerMove:Ue(t.onPointerMove,g=>{g.pointerType!=="touch"&&!m.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),m.current=!0)}),onPointerLeave:Ue(t.onPointerLeave,()=>{n.onTriggerLeave(),m.current=!1}),onPointerDown:Ue(t.onPointerDown,()=>{n.open&&n.onClose(),p.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Ue(t.onFocus,()=>{p.current||n.onOpen()}),onBlur:Ue(t.onBlur,n.onClose),onClick:Ue(t.onClick,n.onClose)})})});LB.displayName=Mw;var y0="TooltipPortal",[jX,FX]=em(y0,{forceMount:void 0}),MB=t=>{const{__scopeTooltip:e,forceMount:r,children:a,container:n}=t,s=$c(y0,e);return v.jsx(jX,{scope:e,forceMount:r,children:v.jsx(La,{present:r||s.open,children:v.jsx(Uc,{asChild:!0,container:n,children:a})})})};MB.displayName=y0;var Cl="TooltipContent",PB=_.forwardRef((t,e)=>{const r=FX(Cl,t.__scopeTooltip),{forceMount:a=r.forceMount,side:n="top",...s}=t,u=$c(Cl,t.__scopeTooltip);return v.jsx(La,{present:a||u.open,children:u.disableHoverableContent?v.jsx(UB,{side:n,...s,ref:e}):v.jsx(zX,{side:n,...s,ref:e})})}),zX=_.forwardRef((t,e)=>{const r=$c(Cl,t.__scopeTooltip),a=b0(Cl,t.__scopeTooltip),n=_.useRef(null),s=jt(e,n),[u,c]=_.useState(null),{trigger:f,onClose:p}=r,m=n.current,{onPointerInTransitChange:h}=a,g=_.useCallback(()=>{c(null),h(!1)},[h]),y=_.useCallback((E,x)=>{const w=E.currentTarget,T={x:E.clientX,y:E.clientY},R=HX(T,w.getBoundingClientRect()),A=GX(T,R),I=VX(x.getBoundingClientRect()),O=WX([...A,...I]);c(O),h(!0)},[h]);return _.useEffect(()=>()=>g(),[g]),_.useEffect(()=>{if(f&&m){const E=w=>y(w,m),x=w=>y(w,f);return f.addEventListener("pointerleave",E),m.addEventListener("pointerleave",x),()=>{f.removeEventListener("pointerleave",E),m.removeEventListener("pointerleave",x)}}},[f,m,y,g]),_.useEffect(()=>{if(u){const E=x=>{const w=x.target,T={x:x.clientX,y:x.clientY},R=f?.contains(w)||m?.contains(w),A=!YX(T,u);R?g():A&&(g(),p())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[f,m,u,p,g]),v.jsx(UB,{...t,ref:s})}),[BX,$X]=em(bc,{isInside:!1}),qX=$8("TooltipContent"),UB=_.forwardRef((t,e)=>{const{__scopeTooltip:r,children:a,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:u,...c}=t,f=$c(Cl,r),p=tm(r),{onClose:m}=f;return _.useEffect(()=>(document.addEventListener(Lw,m),()=>document.removeEventListener(Lw,m)),[m]),_.useEffect(()=>{if(f.trigger){const h=g=>{g.target?.contains(f.trigger)&&m()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[f.trigger,m]),v.jsx(Pc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:h=>h.preventDefault(),onDismiss:m,children:v.jsxs(s0,{"data-state":f.stateAttribute,...p,...c,ref:e,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v.jsx(qX,{children:a}),v.jsx(BX,{scope:r,isInside:!0,children:v.jsx(XZ,{id:f.contentId,role:"tooltip",children:n||a})})]})})});PB.displayName=Cl;var jB="TooltipArrow",FB=_.forwardRef((t,e)=>{const{__scopeTooltip:r,...a}=t,n=tm(r);return $X(jB,r).isInside?null:v.jsx(l0,{...n,...a,ref:e})});FB.displayName=jB;function HX(t,e){const r=Math.abs(e.top-t.y),a=Math.abs(e.bottom-t.y),n=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(r,a,n,s)){case s:return"left";case n:return"right";case r:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function GX(t,e,r=5){const a=[];switch(e){case"top":a.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":a.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":a.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":a.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return a}function VX(t){const{top:e,right:r,bottom:a,left:n}=t;return[{x:n,y:e},{x:r,y:e},{x:r,y:a},{x:n,y:a}]}function YX(t,e){const{x:r,y:a}=t;let n=!1;for(let s=0,u=e.length-1;s<e.length;u=s++){const c=e[s],f=e[u],p=c.x,m=c.y,h=f.x,g=f.y;m>a!=g>a&&r<(h-p)*(a-m)/(g-m)+p&&(n=!n)}return n}function WX(t){const e=t.slice();return e.sort((r,a)=>r.x<a.x?-1:r.x>a.x?1:r.y<a.y?-1:r.y>a.y?1:0),KX(e)}function KX(t){if(t.length<=1)return t.slice();const e=[];for(let a=0;a<t.length;a++){const n=t[a];for(;e.length>=2;){const s=e[e.length-1],u=e[e.length-2];if((s.x-u.x)*(n.y-u.y)>=(s.y-u.y)*(n.x-u.x))e.pop();else break}e.push(n)}e.pop();const r=[];for(let a=t.length-1;a>=0;a--){const n=t[a];for(;r.length>=2;){const s=r[r.length-1],u=r[r.length-2];if((s.x-u.x)*(n.y-u.y)>=(s.y-u.y)*(n.x-u.x))r.pop();else break}r.push(n)}return r.pop(),e.length===1&&r.length===1&&e[0].x===r[0].x&&e[0].y===r[0].y?e:e.concat(r)}var ZX=OB,XX=DB,QX=LB,JX=MB,eQ=PB,tQ=FB;function zB({delayDuration:t=0,...e}){return v.jsx(ZX,{"data-slot":"tooltip-provider",delayDuration:t,...e})}function il({...t}){return v.jsx(zB,{children:v.jsx(XX,{"data-slot":"tooltip",...t})})}function ol({...t}){return v.jsx(QX,{"data-slot":"tooltip-trigger",...t})}function sl({className:t,sideOffset:e=0,children:r,...a}){return v.jsx(JX,{children:v.jsxs(eQ,{"data-slot":"tooltip-content",sideOffset:e,className:Ye("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...a,children:[r,v.jsx(tQ,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const BB=_.createContext(void 0);function rQ({url:t,name:e,onUpdate:r,onRemove:a}){const n=typeof window<"u"?new URL("/oauth/callback",window.location.origin).toString():"/oauth/callback",s=bj({url:t,callbackUrl:n}),u=_.useRef(r),c=_.useRef(null);return _.useEffect(()=>{u.current=r},[r]),_.useEffect(()=>{const f={id:t,url:t,name:e,state:s.state,tools:s.tools,resources:s.resources,prompts:s.prompts,error:s.error??null,authUrl:s.authUrl??null,callTool:s.callTool,readResource:s.readResource,authenticate:s.authenticate,retry:s.retry,clearStorage:s.clearStorage},p=c.current;(!p||p.state!==f.state||p.error!==f.error||p.authUrl!==f.authUrl||p.tools.length!==f.tools.length||p.resources.length!==f.resources.length||p.prompts.length!==f.prompts.length)&&(c.current=f,u.current(f))},[t,e,s.state,s.tools,s.resources,s.prompts,s.error,s.authUrl]),null}function nQ({children:t}){const[e,r]=_.useState([]),[a,n]=_.useState(new Map);_.useEffect(()=>{const m=localStorage.getItem("mcp-inspector-connections");if(m)try{const h=JSON.parse(m),g=Array.isArray(h)?h.filter(y=>y&&typeof y=="object"&&typeof y.id=="string"&&typeof y.url=="string"&&typeof y.name=="string"):[];g.length!==h.length&&(console.warn("Cleaned up invalid connections from localStorage"),localStorage.setItem("mcp-inspector-connections",JSON.stringify(g))),r(g)}catch(h){console.error("Failed to parse saved connections:",h),localStorage.removeItem("mcp-inspector-connections")}},[]);const s=_.useCallback(m=>{n(h=>new Map(h).set(m.id,m))},[]),u=_.useCallback((m,h)=>{const y={id:m,url:m,name:h||m};r(E=>{if(E.some(w=>w.id===m))return E;const x=[...E,y];return localStorage.setItem("mcp-inspector-connections",JSON.stringify(x)),x})},[]),c=_.useCallback(m=>{r(h=>{const g=h.filter(y=>y.id!==m);return localStorage.setItem("mcp-inspector-connections",JSON.stringify(g)),g}),n(h=>{const g=new Map(h),y=g.get(m);if(y){try{y.clearStorage()}catch(E){console.error("Failed to clear storage:",E)}g.delete(m)}return g})},[]),f=_.useCallback(m=>a.get(m),[a]),p=Array.from(a.values());return v.jsxs(BB.Provider,{value:{connections:p,addConnection:u,removeConnection:c,getConnection:f},children:[e.map(m=>v.jsx(rQ,{url:m.url,name:m.name,onUpdate:s,onRemove:()=>c(m.id)},m.id)),t]})}function rm(){const t=_.useContext(BB);if(!t)throw new Error("useMcpContext must be used within McpProvider");return t}function aQ({headers:t,onChange:e,onSave:r,className:a,title:n="Custom Headers",description:s="Headers with both name and value will be sent",maxHeaders:u=50}){const[c,f]=_.useState({}),p=()=>Math.random().toString(36).substr(2,9),m=()=>{if(t.length>=u)return;const E={id:p(),name:"",value:""};e([...t,E])},h=E=>{e(t.filter(x=>x.id!==E))},g=(E,x,w)=>{e(t.map(T=>T.id===E?{...T,[x]:w}:T))},y=E=>{f(x=>({...x,[E]:!x[E]}))};return v.jsxs("div",{className:Ye("space-y-3",a),children:[v.jsxs("div",{className:"space-y-2",children:[v.jsx(Sr,{className:"text-base font-medium",children:n}),v.jsx("p",{className:"text-sm text-muted-foreground",children:s})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"grid grid-cols-[1fr_1fr] gap-4 text-sm font-medium text-muted-foreground",children:[v.jsx("div",{children:"Name"}),v.jsx("div",{children:"Value"})]}),t.length===0?v.jsxs("div",{className:"grid grid-cols-[1fr_1fr] gap-4 items-center",children:[v.jsx(Ir,{placeholder:"Authorization",value:"",onChange:()=>{},className:"text-sm",autoComplete:"off"}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Ir,{placeholder:"",value:"",onChange:()=>{},type:"password",className:"font-mono text-sm",autoComplete:"off"}),v.jsx(gt,{type:"button",variant:"ghost",size:"icon-sm",className:"h-8 w-8 p-0",disabled:!0,children:v.jsx(II,{className:"h-4 w-4"})}),v.jsx(gt,{type:"button",variant:"ghost",size:"icon-sm",className:"h-8 w-8 p-0",disabled:!0,children:v.jsx(cp,{className:"h-4 w-4"})})]})]}):t.map(E=>v.jsxs("div",{className:"grid grid-cols-[1fr_1fr] gap-4 items-center",children:[v.jsx(Ir,{placeholder:"Authorization",value:E.name,onChange:x=>g(E.id,"name",x.target.value),className:"text-sm",autoComplete:"off"}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Ir,{placeholder:"",value:E.value,onChange:x=>g(E.id,"value",x.target.value),type:c[E.id]?"text":"password",className:"font-mono text-sm",autoComplete:"off"}),v.jsx(gt,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>y(E.id),className:"h-8 w-8 p-0",children:c[E.id]?v.jsx(U6,{className:"h-4 w-4"}):v.jsx(II,{className:"h-4 w-4"})}),v.jsx(gt,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>h(E.id),className:"h-8 w-8 p-0",children:v.jsx(cp,{className:"h-4 w-4"})})]})]},E.id)),v.jsx("div",{className:"flex justify-start mt-4",children:v.jsxs(gt,{type:"button",variant:"outline",size:"sm",onClick:m,disabled:t.length>=u,className:"flex items-center gap-2",children:[v.jsx(X6,{className:"h-4 w-4"}),"Add"]})})]}),r&&v.jsx("div",{className:"flex justify-end",children:v.jsx(gt,{type:"button",onClick:r,className:"bg-black text-white hover:bg-gray-800",children:"Save"})})]})}function iQ(){const{connections:t,addConnection:e,removeConnection:r}=rm(),a=DT(),[n,s]=_.useState("SSE"),[u,c]=_.useState(""),[f,p]=_.useState("Direct"),[m,h]=_.useState([]),[g,y]=_.useState("10000"),[E,x]=_.useState("True"),[w,T]=_.useState("60000"),[R,A]=_.useState(""),[I,O]=_.useState("c96aeb0c195aa9c7d3846b90aec9bc5fcdd5df97b3049aaede8f5dd1a15d2d87"),[C,N]=_.useState(""),[D,L]=_.useState(typeof window<"u"?new URL("/oauth/callback",window.location.origin).toString():"http://localhost:3000/oauth/callback"),[P,$]=_.useState(""),[W,ee]=_.useState(!1),[te,ie]=_.useState(!1),[H,K]=_.useState(!1),V=()=>{u.trim()&&(e(u,u),c(""),h([]),N(""),$(""))},X=()=>{t.forEach(U=>{r(U.id)})},le=async U=>{try{await navigator.clipboard.writeText(U),ga.success("Error message copied to clipboard")}catch{ga.error("Failed to copy error message")}},M=(U,j)=>{U.stopPropagation(),j()},z=U=>{if(U.state!=="ready"){ga.error("Server is not connected and cannot be inspected");return}a(`/servers/${encodeURIComponent(U.id)}`)},q=async()=>{if(!u.trim()){ga.error("Please enter a URL first");return}const U={type:"streamable-http",url:u,note:"For Streamable HTTP connections, add this URL directly in your MCP Client"};try{await navigator.clipboard.writeText(JSON.stringify(U,null,2)),ga.success("Streamable HTTP URL has been copied. Use this URL directly in your MCP Client.")}catch{ga.error("Failed to copy server entry to clipboard")}},Y=async()=>{if(!u.trim()){ga.error("Please enter a URL first");return}const U={mcpServers:{"default-server":{type:"streamable-http",url:u,note:"For Streamable HTTP connections, add this URL directly in your MCP Client"}}};try{await navigator.clipboard.writeText(JSON.stringify(U,null,2)),ga.success("Servers configuration has been copied to clipboard. Add this to your mcp.json file. Current testing server will be added as 'default-server'")}catch{ga.error("Failed to copy servers file to clipboard")}},B=m.filter(U=>U.name&&U.value).length;return v.jsxs("div",{className:"flex items-start justify-start gap-4 h-full relative",children:[v.jsxs("div",{className:"w-full px-6 pt-6 overflow-auto",children:[v.jsxs("div",{className:"flex items-center gap-3 relative z-10",children:[v.jsx("h2",{className:"text-2xl font-medium tracking-tight",children:"MCP Inspector"}),v.jsxs(il,{children:[v.jsx(ol,{asChild:!0,children:v.jsx("a",{href:"https://github.com/mcp-use/mcp-use-ts",target:"_blank",rel:"noopener noreferrer",className:"inline-block",children:v.jsxs(xa,{variant:"secondary",className:"text-xs cursor-pointer hover:bg-secondary/80 transition-colors",children:["v","0.3.1"]})})}),v.jsx(sl,{children:v.jsx("p",{children:"Visit GitHub"})})]})]}),v.jsx("p",{className:"text-muted-foreground relative z-10",children:"Inspect and debug MCP (Model Context Protocol) servers"}),v.jsxs("div",{className:"space-y-4 mt-8",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("h3",{className:"text-base font-medium",children:"Connected Servers"}),v.jsx("div",{className:"flex gap-2",children:t.length>0&&v.jsx(gt,{variant:"ghost",size:"sm",onClick:X,children:"Clear All"})})]}),t.length===0?v.jsx(ba,{children:v.jsxs(Wi,{className:"flex flex-col items-center justify-center py-8",children:[v.jsx(zT,{className:"h-12 w-12 text-muted-foreground mb-4"}),v.jsx("p",{className:"text-muted-foreground",children:"No servers connected yet"}),v.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a server above to get started"})]})}):v.jsx("div",{className:"grid gap-3",children:t.map(U=>v.jsxs("div",{onClick:()=>z(U),className:"rounded-lg bg-zinc-100 dark:bg-white/10 hover:bg-zinc-200 dark:hover:bg-white/15 p-4 transition-colors cursor-pointer",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"flex-1",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("h4",{className:"font-semibold text-sm",children:U.name}),v.jsx("div",{className:"flex items-center gap-2",children:U.error?v.jsxs(il,{children:[v.jsx(ol,{asChild:!0,children:v.jsx("button",{onClick:j=>{j.stopPropagation(),le(U.error)},className:"w-2 h-2 rounded-full bg-rose-500 animate-status-pulse-red hover:bg-rose-600 transition-colors",title:"Click to copy error message","aria-label":"Copy error message to clipboard"})}),v.jsx(sl,{children:v.jsx("p",{className:"max-w-xs",children:U.error})})]}):v.jsx("div",{className:`w-2 h-2 rounded-full ${U.state==="ready"?"bg-emerald-600 animate-status-pulse":U.state==="failed"?"bg-rose-600 animate-status-pulse-red":"bg-yellow-500 animate-status-pulse-yellow"}`})})]}),v.jsx("p",{className:"text-xs text-muted-foreground dark:text-zinc-400 font-mono mt-1",children:U.url})]}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsxs(il,{children:[v.jsx(ol,{asChild:!0,children:v.jsx(gt,{variant:"secondary",size:"sm",onClick:j=>M(j,()=>r(U.id)),className:"h-8 w-8 p-0",children:v.jsx(w6,{className:"w-4 h-4"})})}),v.jsx(sl,{children:v.jsx("p",{children:"Remove connection"})})]}),v.jsxs(il,{children:[v.jsx(ol,{asChild:!0,children:v.jsx(gt,{variant:"secondary",size:"sm",onClick:j=>M(j,U.retry),className:"h-8 w-8 p-0",children:v.jsx(J6,{className:"w-4 h-4"})})}),v.jsx(sl,{children:v.jsx("p",{children:"Resync connection"})})]})]})]}),U.state==="pending_auth"&&U.authUrl&&v.jsxs("div",{className:"text-sm text-yellow-600 dark:text-yellow-400 mt-2",children:[v.jsx(gt,{size:"sm",variant:"outline",onClick:U.authenticate,children:"Authenticate"})," ","or"," ",v.jsx("a",{href:U.authUrl,target:"_blank",rel:"noopener noreferrer",className:"underline",children:"open auth page"})]})]},U.id))})]})]}),v.jsxs("div",{className:"w-full relative overflow-hidden h-full p-10 items-center justify-center flex",children:[v.jsxs("div",{className:"relative w-full max-w-xl mx-auto z-10 flex flex-col gap-3 rounded-3xl p-6 bg-black/70 dark:bg-zinc-900/90 shadow-2xl shadow-black/50 backdrop-blur-md",children:[v.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"Connect"}),v.jsxs("div",{className:"space-y-2",children:[v.jsx(Sr,{className:"text-white/90",children:"Transport Type"}),v.jsxs(Fv,{value:n,onValueChange:s,children:[v.jsx(Bv,{className:"w-full bg-white/10 border-white/20 text-white",children:v.jsx(zv,{})}),v.jsxs($v,{children:[v.jsx(qs,{value:"SSE",children:"Streamable HTTP"}),v.jsx(qs,{value:"WebSocket",children:"WebSocket"})]})]})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx(Sr,{className:"text-white/90",children:"URL"}),v.jsx(Ir,{placeholder:"http://localhost:3001/sse",value:u,onChange:U=>c(U.target.value),className:"bg-white/10 border-white/20 text-white placeholder:text-white/50"})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx(Sr,{className:"text-white/90",children:"Connection Type"}),v.jsxs(Fv,{value:f,onValueChange:p,children:[v.jsx(Bv,{className:"w-full bg-white/10 border-white/20 text-white",children:v.jsx(zv,{})}),v.jsxs($v,{children:[v.jsx(qs,{value:"Direct",children:"Direct"}),v.jsx(qs,{value:"Via Proxy",children:"Via Proxy"})]})]})]}),v.jsxs(Qz,{children:[v.jsx(Jz,{asChild:!0,children:v.jsxs(gt,{variant:"ghost",className:"absolute top-2 right-2 text-white hover:bg-white/20 z-10 dark:hover:bg-white/20",children:[v.jsx(Mc,{className:"w-4 h-4 mr-2"}),"Export"]})}),v.jsxs(g0,{align:"end",className:"w-56",children:[v.jsxs(vc,{onClick:q,children:[v.jsx("svg",{className:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),"Server Entry"]}),v.jsxs(vc,{onClick:Y,children:[v.jsx("svg",{className:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),"Servers File"]})]})]}),v.jsxs("div",{className:"flex gap-3",children:[v.jsxs(Pf,{open:te,onOpenChange:ie,children:[v.jsx(Dv,{asChild:!0,children:v.jsxs(gt,{variant:"outline",className:"flex-1 justify-center bg-white/10 border-white/20 text-white hover:bg-white/20",children:[v.jsx(a8,{className:"w-4 h-4 mr-2"}),"Authentication",(C||P)&&v.jsx(xa,{variant:"secondary",className:"ml-2",children:"OAuth 2.0"})]})}),v.jsxs(Uf,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[v.jsx(Lv,{children:v.jsx(Mv,{children:"Authentication"})}),v.jsxs("div",{className:"space-y-4",children:[v.jsx("h4",{className:"text-sm font-medium",children:"OAuth 2.0 Flow"}),v.jsxs("div",{className:"space-y-2",children:[v.jsx(Sr,{className:"text-sm",children:"Client ID"}),v.jsx(Ir,{placeholder:"Client ID",value:C,onChange:U=>N(U.target.value)})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx(Sr,{className:"text-sm",children:"Redirect URL"}),v.jsx(Ir,{value:D,onChange:U=>L(U.target.value)})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx(Sr,{className:"text-sm",children:"Scope"}),v.jsx(Ir,{placeholder:"Scope (space-separated)",value:P,onChange:U=>$(U.target.value)})]}),v.jsx("div",{className:"flex justify-end",children:v.jsx(gt,{onClick:()=>ie(!1),children:"Save"})})]})]})]}),v.jsxs(Pf,{open:W,onOpenChange:ee,children:[v.jsx(Dv,{asChild:!0,children:v.jsxs(gt,{variant:"outline",className:"flex-1 justify-center bg-white/10 border-white/20 text-white hover:bg-white/20",children:[v.jsx(jo,{className:"w-4 h-4 mr-2"}),"Custom Headers",B>0&&v.jsx(xa,{variant:"secondary",className:"ml-2",children:B})]})}),v.jsxs(Uf,{className:"w-full max-w-2xl max-h-[80vh] overflow-y-auto",children:[v.jsx(Lv,{children:v.jsx(Mv,{children:"Custom Headers"})}),v.jsx(aQ,{headers:m,onChange:h,onSave:()=>ee(!1)})]})]}),v.jsxs(Pf,{open:H,onOpenChange:K,children:[v.jsx(Dv,{asChild:!0,children:v.jsxs(gt,{variant:"outline",className:"flex-1 justify-center bg-white/10 border-white/20 text-white hover:bg-white/20",children:[v.jsx(I6,{className:"w-4 h-4 mr-2"}),"Configuration"]})}),v.jsxs(Uf,{className:"w-full max-w-2xl max-h-[80vh] overflow-y-auto",children:[v.jsx(Lv,{children:v.jsx(Mv,{children:"Configuration"})}),v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"space-y-2",children:[v.jsxs(Sr,{className:"text-sm flex items-center gap-1",children:["Request Timeout",v.jsx("span",{className:"text-muted-foreground text-xs",children:"(?)"})]}),v.jsx(Ir,{type:"number",value:g,onChange:U=>y(U.target.value)})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs(Sr,{className:"text-sm flex items-center gap-1",children:["Reset Timeout on Progress",v.jsx("span",{className:"text-muted-foreground text-xs",children:"(?)"})]}),v.jsxs(Fv,{value:E,onValueChange:x,children:[v.jsx(Bv,{className:"w-full",children:v.jsx(zv,{})}),v.jsxs($v,{children:[v.jsx(qs,{value:"True",children:"True"}),v.jsx(qs,{value:"False",children:"False"})]})]})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs(Sr,{className:"text-sm flex items-center gap-1",children:["Maximum Total Timeout",v.jsx("span",{className:"text-muted-foreground text-xs",children:"(?)"})]}),v.jsx(Ir,{type:"number",value:w,onChange:U=>T(U.target.value)})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs(Sr,{className:"text-sm flex items-center gap-1",children:["Inspector Proxy Address",v.jsx("span",{className:"text-muted-foreground text-xs",children:"(?)"})]}),v.jsx(Ir,{value:R,onChange:U=>A(U.target.value),placeholder:""})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs(Sr,{className:"text-sm flex items-center gap-1",children:["Proxy Session Token",v.jsx("span",{className:"text-muted-foreground text-xs",children:"(?)"})]}),v.jsx(Ir,{value:I,onChange:U=>O(U.target.value),className:"font-mono text-xs"})]}),v.jsx("div",{className:"flex justify-end",children:v.jsx(gt,{onClick:()=>K(!1),children:"Save"})})]})]})]})]}),v.jsxs(gt,{onClick:V,disabled:!u.trim(),className:"w-full bg-white text-black hover:bg-white/90 font-semibold mt-4",children:[v.jsx("svg",{className:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Connect"]}),v.jsxs("div",{className:"flex items-center justify-center gap-2 text-white/60 text-sm",children:[v.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500 animate-status-pulse-red"}),"Disconnected"]})]}),v.jsx(rB,{className:"absolute inset-0"})]})]})}const E0=_.createContext({});function S0(t){const e=_.useRef(null);return e.current===null&&(e.current=t()),e.current}const _0=typeof window<"u",$B=_0?_.useLayoutEffect:_.useEffect,nm=_.createContext(null);function x0(t,e){t.indexOf(e)===-1&&t.push(e)}function w0(t,e){const r=t.indexOf(e);r>-1&&t.splice(r,1)}const hi=(t,e,r)=>r>e?e:r<t?t:r;let T0=()=>{};const gi={},qB=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function HB(t){return typeof t=="object"&&t!==null}const GB=t=>/^0[^.\s]+$/u.test(t);function R0(t){let e;return()=>(e===void 0&&(e=t()),e)}const Yn=t=>t,oQ=(t,e)=>r=>e(t(r)),qc=(...t)=>t.reduce(oQ),yc=(t,e,r)=>{const a=e-t;return a===0?1:(r-t)/a};class A0{constructor(){this.subscriptions=[]}add(e){return x0(this.subscriptions,e),()=>w0(this.subscriptions,e)}notify(e,r,a){const n=this.subscriptions.length;if(n)if(n===1)this.subscriptions[0](e,r,a);else for(let s=0;s<n;s++){const u=this.subscriptions[s];u&&u(e,r,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ta=t=>t*1e3,Gn=t=>t/1e3;function VB(t,e){return e?t*(1e3/e):0}const YB=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,sQ=1e-7,lQ=12;function uQ(t,e,r,a,n){let s,u,c=0;do u=e+(r-e)/2,s=YB(u,a,n)-t,s>0?r=u:e=u;while(Math.abs(s)>sQ&&++c<lQ);return u}function Hc(t,e,r,a){if(t===e&&r===a)return Yn;const n=s=>uQ(s,0,1,t,r);return s=>s===0||s===1?s:YB(n(s),e,a)}const WB=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,KB=t=>e=>1-t(1-e),ZB=Hc(.33,1.53,.69,.99),C0=KB(ZB),XB=WB(C0),QB=t=>(t*=2)<1?.5*C0(t):.5*(2-Math.pow(2,-10*(t-1))),N0=t=>1-Math.sin(Math.acos(t)),JB=KB(N0),e$=WB(N0),cQ=Hc(.42,0,1,1),dQ=Hc(0,0,.58,1),t$=Hc(.42,0,.58,1),fQ=t=>Array.isArray(t)&&typeof t[0]!="number",r$=t=>Array.isArray(t)&&typeof t[0]=="number",pQ={linear:Yn,easeIn:cQ,easeInOut:t$,easeOut:dQ,circIn:N0,circInOut:e$,circOut:JB,backIn:C0,backInOut:XB,backOut:ZB,anticipate:QB},mQ=t=>typeof t=="string",pk=t=>{if(r$(t)){T0(t.length===4);const[e,r,a,n]=t;return Hc(e,r,a,n)}else if(mQ(t))return pQ[t];return t},yf=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function hQ(t,e){let r=new Set,a=new Set,n=!1,s=!1;const u=new WeakSet;let c={delta:0,timestamp:0,isProcessing:!1};function f(m){u.has(m)&&(p.schedule(m),t()),m(c)}const p={schedule:(m,h=!1,g=!1)=>{const E=g&&n?r:a;return h&&u.add(m),E.has(m)||E.add(m),m},cancel:m=>{a.delete(m),u.delete(m)},process:m=>{if(c=m,n){s=!0;return}n=!0,[r,a]=[a,r],r.forEach(f),r.clear(),n=!1,s&&(s=!1,p.process(m))}};return p}const gQ=40;function n$(t,e){let r=!1,a=!0;const n={delta:0,timestamp:0,isProcessing:!1},s=()=>r=!0,u=yf.reduce((A,I)=>(A[I]=hQ(s),A),{}),{setup:c,read:f,resolveKeyframes:p,preUpdate:m,update:h,preRender:g,render:y,postRender:E}=u,x=()=>{const A=gi.useManualTiming?n.timestamp:performance.now();r=!1,gi.useManualTiming||(n.delta=a?1e3/60:Math.max(Math.min(A-n.timestamp,gQ),1)),n.timestamp=A,n.isProcessing=!0,c.process(n),f.process(n),p.process(n),m.process(n),h.process(n),g.process(n),y.process(n),E.process(n),n.isProcessing=!1,r&&e&&(a=!1,t(x))},w=()=>{r=!0,a=!0,n.isProcessing||t(x)};return{schedule:yf.reduce((A,I)=>{const O=u[I];return A[I]=(C,N=!1,D=!1)=>(r||w(),O.schedule(C,N,D)),A},{}),cancel:A=>{for(let I=0;I<yf.length;I++)u[yf[I]].cancel(A)},state:n,steps:u}}const{schedule:er,cancel:no,state:Fr,steps:qv}=n$(typeof requestAnimationFrame<"u"?requestAnimationFrame:Yn,!0);let Ff;function vQ(){Ff=void 0}const pn={now:()=>(Ff===void 0&&pn.set(Fr.isProcessing||gi.useManualTiming?Fr.timestamp:performance.now()),Ff),set:t=>{Ff=t,queueMicrotask(vQ)}},a$=t=>e=>typeof e=="string"&&e.startsWith(t),I0=a$("--"),bQ=a$("var(--"),k0=t=>bQ(t)?yQ.test(t.split("/*")[0].trim()):!1,yQ=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Bl={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ec={...Bl,transform:t=>hi(0,1,t)},Ef={...Bl,default:1},ec=t=>Math.round(t*1e5)/1e5,O0=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function EQ(t){return t==null}const SQ=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,D0=(t,e)=>r=>!!(typeof r=="string"&&SQ.test(r)&&r.startsWith(t)||e&&!EQ(r)&&Object.prototype.hasOwnProperty.call(r,e)),i$=(t,e,r)=>a=>{if(typeof a!="string")return a;const[n,s,u,c]=a.match(O0);return{[t]:parseFloat(n),[e]:parseFloat(s),[r]:parseFloat(u),alpha:c!==void 0?parseFloat(c):1}},_Q=t=>hi(0,255,t),Hv={...Bl,transform:t=>Math.round(_Q(t))},Fo={test:D0("rgb","red"),parse:i$("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:a=1})=>"rgba("+Hv.transform(t)+", "+Hv.transform(e)+", "+Hv.transform(r)+", "+ec(Ec.transform(a))+")"};function xQ(t){let e="",r="",a="",n="";return t.length>5?(e=t.substring(1,3),r=t.substring(3,5),a=t.substring(5,7),n=t.substring(7,9)):(e=t.substring(1,2),r=t.substring(2,3),a=t.substring(3,4),n=t.substring(4,5),e+=e,r+=r,a+=a,n+=n),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(a,16),alpha:n?parseInt(n,16)/255:1}}const Pw={test:D0("#"),parse:xQ,transform:Fo.transform},Gc=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),qi=Gc("deg"),Ra=Gc("%"),Xe=Gc("px"),wQ=Gc("vh"),TQ=Gc("vw"),mk={...Ra,parse:t=>Ra.parse(t)/100,transform:t=>Ra.transform(t*100)},ll={test:D0("hsl","hue"),parse:i$("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:a=1})=>"hsla("+Math.round(t)+", "+Ra.transform(ec(e))+", "+Ra.transform(ec(r))+", "+ec(Ec.transform(a))+")"},xr={test:t=>Fo.test(t)||Pw.test(t)||ll.test(t),parse:t=>Fo.test(t)?Fo.parse(t):ll.test(t)?ll.parse(t):Pw.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Fo.transform(t):ll.transform(t),getAnimatableNone:t=>{const e=xr.parse(t);return e.alpha=0,xr.transform(e)}},RQ=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function AQ(t){return isNaN(t)&&typeof t=="string"&&(t.match(O0)?.length||0)+(t.match(RQ)?.length||0)>0}const o$="number",s$="color",CQ="var",NQ="var(",hk="${}",IQ=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Sc(t){const e=t.toString(),r=[],a={color:[],number:[],var:[]},n=[];let s=0;const c=e.replace(IQ,f=>(xr.test(f)?(a.color.push(s),n.push(s$),r.push(xr.parse(f))):f.startsWith(NQ)?(a.var.push(s),n.push(CQ),r.push(f)):(a.number.push(s),n.push(o$),r.push(parseFloat(f))),++s,hk)).split(hk);return{values:r,split:c,indexes:a,types:n}}function l$(t){return Sc(t).values}function u$(t){const{split:e,types:r}=Sc(t),a=e.length;return n=>{let s="";for(let u=0;u<a;u++)if(s+=e[u],n[u]!==void 0){const c=r[u];c===o$?s+=ec(n[u]):c===s$?s+=xr.transform(n[u]):s+=n[u]}return s}}const kQ=t=>typeof t=="number"?0:xr.test(t)?xr.getAnimatableNone(t):t;function OQ(t){const e=l$(t);return u$(t)(e.map(kQ))}const ao={test:AQ,parse:l$,createTransformer:u$,getAnimatableNone:OQ};function Gv(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function DQ({hue:t,saturation:e,lightness:r,alpha:a}){t/=360,e/=100,r/=100;let n=0,s=0,u=0;if(!e)n=s=u=r;else{const c=r<.5?r*(1+e):r+e-r*e,f=2*r-c;n=Gv(f,c,t+1/3),s=Gv(f,c,t),u=Gv(f,c,t-1/3)}return{red:Math.round(n*255),green:Math.round(s*255),blue:Math.round(u*255),alpha:a}}function yp(t,e){return r=>r>0?e:t}const ar=(t,e,r)=>t+(e-t)*r,Vv=(t,e,r)=>{const a=t*t,n=r*(e*e-a)+a;return n<0?0:Math.sqrt(n)},LQ=[Pw,Fo,ll],MQ=t=>LQ.find(e=>e.test(t));function gk(t){const e=MQ(t);if(!e)return!1;let r=e.parse(t);return e===ll&&(r=DQ(r)),r}const vk=(t,e)=>{const r=gk(t),a=gk(e);if(!r||!a)return yp(t,e);const n={...r};return s=>(n.red=Vv(r.red,a.red,s),n.green=Vv(r.green,a.green,s),n.blue=Vv(r.blue,a.blue,s),n.alpha=ar(r.alpha,a.alpha,s),Fo.transform(n))},Uw=new Set(["none","hidden"]);function PQ(t,e){return Uw.has(t)?r=>r<=0?t:e:r=>r>=1?e:t}function UQ(t,e){return r=>ar(t,e,r)}function L0(t){return typeof t=="number"?UQ:typeof t=="string"?k0(t)?yp:xr.test(t)?vk:zQ:Array.isArray(t)?c$:typeof t=="object"?xr.test(t)?vk:jQ:yp}function c$(t,e){const r=[...t],a=r.length,n=t.map((s,u)=>L0(s)(s,e[u]));return s=>{for(let u=0;u<a;u++)r[u]=n[u](s);return r}}function jQ(t,e){const r={...t,...e},a={};for(const n in r)t[n]!==void 0&&e[n]!==void 0&&(a[n]=L0(t[n])(t[n],e[n]));return n=>{for(const s in a)r[s]=a[s](n);return r}}function FQ(t,e){const r=[],a={color:0,var:0,number:0};for(let n=0;n<e.values.length;n++){const s=e.types[n],u=t.indexes[s][a[s]],c=t.values[u]??0;r[n]=c,a[s]++}return r}const zQ=(t,e)=>{const r=ao.createTransformer(e),a=Sc(t),n=Sc(e);return a.indexes.var.length===n.indexes.var.length&&a.indexes.color.length===n.indexes.color.length&&a.indexes.number.length>=n.indexes.number.length?Uw.has(t)&&!n.values.length||Uw.has(e)&&!a.values.length?PQ(t,e):qc(c$(FQ(a,n),n.values),r):yp(t,e)};function d$(t,e,r){return typeof t=="number"&&typeof e=="number"&&typeof r=="number"?ar(t,e,r):L0(t)(t,e)}const BQ=t=>{const e=({timestamp:r})=>t(r);return{start:(r=!0)=>er.update(e,r),stop:()=>no(e),now:()=>Fr.isProcessing?Fr.timestamp:pn.now()}},f$=(t,e,r=10)=>{let a="";const n=Math.max(Math.round(e/r),2);for(let s=0;s<n;s++)a+=Math.round(t(s/(n-1))*1e4)/1e4+", ";return`linear(${a.substring(0,a.length-2)})`},Ep=2e4;function M0(t){let e=0;const r=50;let a=t.next(e);for(;!a.done&&e<Ep;)e+=r,a=t.next(e);return e>=Ep?1/0:e}function $Q(t,e=100,r){const a=r({...t,keyframes:[0,e]}),n=Math.min(M0(a),Ep);return{type:"keyframes",ease:s=>a.next(n*s).value/e,duration:Gn(n)}}const qQ=5;function p$(t,e,r){const a=Math.max(e-qQ,0);return VB(r-t(a),e-a)}const cr={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Yv=.001;function HQ({duration:t=cr.duration,bounce:e=cr.bounce,velocity:r=cr.velocity,mass:a=cr.mass}){let n,s,u=1-e;u=hi(cr.minDamping,cr.maxDamping,u),t=hi(cr.minDuration,cr.maxDuration,Gn(t)),u<1?(n=p=>{const m=p*u,h=m*t,g=m-r,y=jw(p,u),E=Math.exp(-h);return Yv-g/y*E},s=p=>{const h=p*u*t,g=h*r+r,y=Math.pow(u,2)*Math.pow(p,2)*t,E=Math.exp(-h),x=jw(Math.pow(p,2),u);return(-n(p)+Yv>0?-1:1)*((g-y)*E)/x}):(n=p=>{const m=Math.exp(-p*t),h=(p-r)*t+1;return-Yv+m*h},s=p=>{const m=Math.exp(-p*t),h=(r-p)*(t*t);return m*h});const c=5/t,f=VQ(n,s,c);if(t=Ta(t),isNaN(f))return{stiffness:cr.stiffness,damping:cr.damping,duration:t};{const p=Math.pow(f,2)*a;return{stiffness:p,damping:u*2*Math.sqrt(a*p),duration:t}}}const GQ=12;function VQ(t,e,r){let a=r;for(let n=1;n<GQ;n++)a=a-t(a)/e(a);return a}function jw(t,e){return t*Math.sqrt(1-e*e)}const YQ=["duration","bounce"],WQ=["stiffness","damping","mass"];function bk(t,e){return e.some(r=>t[r]!==void 0)}function KQ(t){let e={velocity:cr.velocity,stiffness:cr.stiffness,damping:cr.damping,mass:cr.mass,isResolvedFromDuration:!1,...t};if(!bk(t,WQ)&&bk(t,YQ))if(t.visualDuration){const r=t.visualDuration,a=2*Math.PI/(r*1.2),n=a*a,s=2*hi(.05,1,1-(t.bounce||0))*Math.sqrt(n);e={...e,mass:cr.mass,stiffness:n,damping:s}}else{const r=HQ(t);e={...e,...r,mass:cr.mass},e.isResolvedFromDuration=!0}return e}function Sp(t=cr.visualDuration,e=cr.bounce){const r=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:a,restDelta:n}=r;const s=r.keyframes[0],u=r.keyframes[r.keyframes.length-1],c={done:!1,value:s},{stiffness:f,damping:p,mass:m,duration:h,velocity:g,isResolvedFromDuration:y}=KQ({...r,velocity:-Gn(r.velocity||0)}),E=g||0,x=p/(2*Math.sqrt(f*m)),w=u-s,T=Gn(Math.sqrt(f/m)),R=Math.abs(w)<5;a||(a=R?cr.restSpeed.granular:cr.restSpeed.default),n||(n=R?cr.restDelta.granular:cr.restDelta.default);let A;if(x<1){const O=jw(T,x);A=C=>{const N=Math.exp(-x*T*C);return u-N*((E+x*T*w)/O*Math.sin(O*C)+w*Math.cos(O*C))}}else if(x===1)A=O=>u-Math.exp(-T*O)*(w+(E+T*w)*O);else{const O=T*Math.sqrt(x*x-1);A=C=>{const N=Math.exp(-x*T*C),D=Math.min(O*C,300);return u-N*((E+x*T*w)*Math.sinh(D)+O*w*Math.cosh(D))/O}}const I={calculatedDuration:y&&h||null,next:O=>{const C=A(O);if(y)c.done=O>=h;else{let N=O===0?E:0;x<1&&(N=O===0?Ta(E):p$(A,O,C));const D=Math.abs(N)<=a,L=Math.abs(u-C)<=n;c.done=D&&L}return c.value=c.done?u:C,c},toString:()=>{const O=Math.min(M0(I),Ep),C=f$(N=>I.next(O*N).value,O,30);return O+"ms "+C},toTransition:()=>{}};return I}Sp.applyToOptions=t=>{const e=$Q(t,100,Sp);return t.ease=e.ease,t.duration=Ta(e.duration),t.type="keyframes",t};function Fw({keyframes:t,velocity:e=0,power:r=.8,timeConstant:a=325,bounceDamping:n=10,bounceStiffness:s=500,modifyTarget:u,min:c,max:f,restDelta:p=.5,restSpeed:m}){const h=t[0],g={done:!1,value:h},y=D=>c!==void 0&&D<c||f!==void 0&&D>f,E=D=>c===void 0?f:f===void 0||Math.abs(c-D)<Math.abs(f-D)?c:f;let x=r*e;const w=h+x,T=u===void 0?w:u(w);T!==w&&(x=T-h);const R=D=>-x*Math.exp(-D/a),A=D=>T+R(D),I=D=>{const L=R(D),P=A(D);g.done=Math.abs(L)<=p,g.value=g.done?T:P};let O,C;const N=D=>{y(g.value)&&(O=D,C=Sp({keyframes:[g.value,E(g.value)],velocity:p$(A,D,g.value),damping:n,stiffness:s,restDelta:p,restSpeed:m}))};return N(0),{calculatedDuration:null,next:D=>{let L=!1;return!C&&O===void 0&&(L=!0,I(D),N(D)),O!==void 0&&D>=O?C.next(D-O):(!L&&I(D),g)}}}function ZQ(t,e,r){const a=[],n=r||gi.mix||d$,s=t.length-1;for(let u=0;u<s;u++){let c=n(t[u],t[u+1]);if(e){const f=Array.isArray(e)?e[u]||Yn:e;c=qc(f,c)}a.push(c)}return a}function XQ(t,e,{clamp:r=!0,ease:a,mixer:n}={}){const s=t.length;if(T0(s===e.length),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const u=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const c=ZQ(e,a,n),f=c.length,p=m=>{if(u&&m<t[0])return e[0];let h=0;if(f>1)for(;h<t.length-2&&!(m<t[h+1]);h++);const g=yc(t[h],t[h+1],m);return c[h](g)};return r?m=>p(hi(t[0],t[s-1],m)):p}function QQ(t,e){const r=t[t.length-1];for(let a=1;a<=e;a++){const n=yc(0,e,a);t.push(ar(r,1,n))}}function JQ(t){const e=[0];return QQ(e,t.length-1),e}function eJ(t,e){return t.map(r=>r*e)}function tJ(t,e){return t.map(()=>e||t$).splice(0,t.length-1)}function tc({duration:t=300,keyframes:e,times:r,ease:a="easeInOut"}){const n=fQ(a)?a.map(pk):pk(a),s={done:!1,value:e[0]},u=eJ(r&&r.length===e.length?r:JQ(e),t),c=XQ(u,e,{ease:Array.isArray(n)?n:tJ(e,n)});return{calculatedDuration:t,next:f=>(s.value=c(f),s.done=f>=t,s)}}const rJ=t=>t!==null;function P0(t,{repeat:e,repeatType:r="loop"},a,n=1){const s=t.filter(rJ),c=n<0||e&&r!=="loop"&&e%2===1?0:s.length-1;return!c||a===void 0?s[c]:a}const nJ={decay:Fw,inertia:Fw,tween:tc,keyframes:tc,spring:Sp};function m$(t){typeof t.type=="string"&&(t.type=nJ[t.type])}class U0{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,r){return this.finished.then(e,r)}}const aJ=t=>t/100;class j0 extends U0{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:r}=this.options;r&&r.updatedAt!==pn.now()&&this.tick(pn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;m$(e);const{type:r=tc,repeat:a=0,repeatDelay:n=0,repeatType:s,velocity:u=0}=e;let{keyframes:c}=e;const f=r||tc;f!==tc&&typeof c[0]!="number"&&(this.mixKeyframes=qc(aJ,d$(c[0],c[1])),c=[0,100]);const p=f({...e,keyframes:c});s==="mirror"&&(this.mirroredGenerator=f({...e,keyframes:[...c].reverse(),velocity:-u})),p.calculatedDuration===null&&(p.calculatedDuration=M0(p));const{calculatedDuration:m}=p;this.calculatedDuration=m,this.resolvedDuration=m+n,this.totalDuration=this.resolvedDuration*(a+1)-n,this.generator=p}updateTime(e){const r=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(e,r=!1){const{generator:a,totalDuration:n,mixKeyframes:s,mirroredGenerator:u,resolvedDuration:c,calculatedDuration:f}=this;if(this.startTime===null)return a.next(0);const{delay:p=0,keyframes:m,repeat:h,repeatType:g,repeatDelay:y,type:E,onUpdate:x,finalKeyframe:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-n/this.speed,this.startTime)),r?this.currentTime=e:this.updateTime(e);const T=this.currentTime-p*(this.playbackSpeed>=0?1:-1),R=this.playbackSpeed>=0?T<0:T>n;this.currentTime=Math.max(T,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=n);let A=this.currentTime,I=a;if(h){const D=Math.min(this.currentTime,n)/c;let L=Math.floor(D),P=D%1;!P&&D>=1&&(P=1),P===1&&L--,L=Math.min(L,h+1),!!(L%2)&&(g==="reverse"?(P=1-P,y&&(P-=y/c)):g==="mirror"&&(I=u)),A=hi(0,1,P)*c}const O=R?{done:!1,value:m[0]}:I.next(A);s&&(O.value=s(O.value));let{done:C}=O;!R&&f!==null&&(C=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);const N=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return N&&E!==Fw&&(O.value=P0(m,this.options,w,this.speed)),x&&x(O.value),N&&this.finish(),O}then(e,r){return this.finished.then(e,r)}get duration(){return Gn(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Gn(e)}get time(){return Gn(this.currentTime)}set time(e){e=Ta(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(pn.now());const r=this.playbackSpeed!==e;this.playbackSpeed=e,r&&(this.time=Gn(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=BQ,startTime:r}=this.options;this.driver||(this.driver=e(n=>this.tick(n))),this.options.onPlay?.();const a=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=a):this.holdTime!==null?this.startTime=a-this.holdTime:this.startTime||(this.startTime=r??a),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(pn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function iJ(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const zo=t=>t*180/Math.PI,zw=t=>{const e=zo(Math.atan2(t[1],t[0]));return Bw(e)},oJ={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:zw,rotateZ:zw,skewX:t=>zo(Math.atan(t[1])),skewY:t=>zo(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Bw=t=>(t=t%360,t<0&&(t+=360),t),yk=zw,Ek=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Sk=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),sJ={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ek,scaleY:Sk,scale:t=>(Ek(t)+Sk(t))/2,rotateX:t=>Bw(zo(Math.atan2(t[6],t[5]))),rotateY:t=>Bw(zo(Math.atan2(-t[2],t[0]))),rotateZ:yk,rotate:yk,skewX:t=>zo(Math.atan(t[4])),skewY:t=>zo(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function $w(t){return t.includes("scale")?1:0}function qw(t,e){if(!t||t==="none")return $w(e);const r=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,n;if(r)a=sJ,n=r;else{const c=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=oJ,n=c}if(!n)return $w(e);const s=a[e],u=n[1].split(",").map(uJ);return typeof s=="function"?s(u):u[s]}const lJ=(t,e)=>{const{transform:r="none"}=getComputedStyle(t);return qw(r,e)};function uJ(t){return parseFloat(t.trim())}const $l=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ql=new Set($l),_k=t=>t===Bl||t===Xe,cJ=new Set(["x","y","z"]),dJ=$l.filter(t=>!cJ.has(t));function fJ(t){const e=[];return dJ.forEach(r=>{const a=t.getValue(r);a!==void 0&&(e.push([r,a.get()]),a.set(r.startsWith("scale")?1:0))}),e}const $o={width:({x:t},{paddingLeft:e="0",paddingRight:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),height:({y:t},{paddingTop:e="0",paddingBottom:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>qw(e,"x"),y:(t,{transform:e})=>qw(e,"y")};$o.translateX=$o.x;$o.translateY=$o.y;const qo=new Set;let Hw=!1,Gw=!1,Vw=!1;function h$(){if(Gw){const t=Array.from(qo).filter(a=>a.needsMeasurement),e=new Set(t.map(a=>a.element)),r=new Map;e.forEach(a=>{const n=fJ(a);n.length&&(r.set(a,n),a.render())}),t.forEach(a=>a.measureInitialState()),e.forEach(a=>{a.render();const n=r.get(a);n&&n.forEach(([s,u])=>{a.getValue(s)?.set(u)})}),t.forEach(a=>a.measureEndState()),t.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}Gw=!1,Hw=!1,qo.forEach(t=>t.complete(Vw)),qo.clear()}function g$(){qo.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Gw=!0)})}function pJ(){Vw=!0,g$(),h$(),Vw=!1}class F0{constructor(e,r,a,n,s,u=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=r,this.name=a,this.motionValue=n,this.element=s,this.isAsync=u}scheduleResolve(){this.state="scheduled",this.isAsync?(qo.add(this),Hw||(Hw=!0,er.read(g$),er.resolveKeyframes(h$))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:r,element:a,motionValue:n}=this;if(e[0]===null){const s=n?.get(),u=e[e.length-1];if(s!==void 0)e[0]=s;else if(a&&r){const c=a.readValue(r,u);c!=null&&(e[0]=c)}e[0]===void 0&&(e[0]=u),n&&s===void 0&&n.set(e[0])}iJ(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),qo.delete(this)}cancel(){this.state==="scheduled"&&(qo.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const mJ=t=>t.startsWith("--");function hJ(t,e,r){mJ(e)?t.style.setProperty(e,r):t.style[e]=r}const gJ=R0(()=>window.ScrollTimeline!==void 0),vJ={};function bJ(t,e){const r=R0(t);return()=>vJ[e]??r()}const v$=bJ(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Hu=([t,e,r,a])=>`cubic-bezier(${t}, ${e}, ${r}, ${a})`,xk={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Hu([0,.65,.55,1]),circOut:Hu([.55,0,1,.45]),backIn:Hu([.31,.01,.66,-.59]),backOut:Hu([.33,1.53,.69,.99])};function b$(t,e){if(t)return typeof t=="function"?v$()?f$(t,e):"ease-out":r$(t)?Hu(t):Array.isArray(t)?t.map(r=>b$(r,e)||xk.easeOut):xk[t]}function yJ(t,e,r,{delay:a=0,duration:n=300,repeat:s=0,repeatType:u="loop",ease:c="easeOut",times:f}={},p=void 0){const m={[e]:r};f&&(m.offset=f);const h=b$(c,n);Array.isArray(h)&&(m.easing=h);const g={delay:a,duration:n,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:s+1,direction:u==="reverse"?"alternate":"normal"};return p&&(g.pseudoElement=p),t.animate(m,g)}function y$(t){return typeof t=="function"&&"applyToOptions"in t}function EJ({type:t,...e}){return y$(t)&&v$()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class SJ extends U0{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:r,name:a,keyframes:n,pseudoElement:s,allowFlatten:u=!1,finalKeyframe:c,onComplete:f}=e;this.isPseudoElement=!!s,this.allowFlatten=u,this.options=e,T0(typeof e.type!="string");const p=EJ(e);this.animation=yJ(r,a,n,p,s),p.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const m=P0(n,this.options,c,this.speed);this.updateMotionValue?this.updateMotionValue(m):hJ(r,a,m),this.animation.cancel()}f?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return Gn(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Gn(e)}get time(){return Gn(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=Ta(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&gJ()?(this.animation.timeline=e,Yn):r(this)}}const E$={anticipate:QB,backInOut:XB,circInOut:e$};function _J(t){return t in E$}function xJ(t){typeof t.ease=="string"&&_J(t.ease)&&(t.ease=E$[t.ease])}const wk=10;class wJ extends SJ{constructor(e){xJ(e),m$(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:r,onUpdate:a,onComplete:n,element:s,...u}=this.options;if(!r)return;if(e!==void 0){r.set(e);return}const c=new j0({...u,autoplay:!1}),f=Ta(this.finishedTime??this.time);r.setWithVelocity(c.sample(f-wk).value,c.sample(f).value,wk),c.stop()}}const Tk=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(ao.test(t)||t==="0")&&!t.startsWith("url("));function TJ(t){const e=t[0];if(t.length===1)return!0;for(let r=0;r<t.length;r++)if(t[r]!==e)return!0}function RJ(t,e,r,a){const n=t[0];if(n===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],u=Tk(n,e),c=Tk(s,e);return!u||!c?!1:TJ(t)||(r==="spring"||y$(r))&&a}function Yw(t){t.duration=0,t.type="keyframes"}const AJ=new Set(["opacity","clipPath","filter","transform"]),CJ=R0(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function NJ(t){const{motionValue:e,name:r,repeatDelay:a,repeatType:n,damping:s,type:u}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:p}=e.owner.getProps();return CJ()&&r&&AJ.has(r)&&(r!=="transform"||!p)&&!f&&!a&&n!=="mirror"&&s!==0&&u!=="inertia"}const IJ=40;class kJ extends U0{constructor({autoplay:e=!0,delay:r=0,type:a="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:u="loop",keyframes:c,name:f,motionValue:p,element:m,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=pn.now();const g={autoplay:e,delay:r,type:a,repeat:n,repeatDelay:s,repeatType:u,name:f,motionValue:p,element:m,...h},y=m?.KeyframeResolver||F0;this.keyframeResolver=new y(c,(E,x,w)=>this.onKeyframesResolved(E,x,g,!w),f,p,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,r,a,n){this.keyframeResolver=void 0;const{name:s,type:u,velocity:c,delay:f,isHandoff:p,onUpdate:m}=a;this.resolvedAt=pn.now(),RJ(e,s,u,c)||((gi.instantAnimations||!f)&&m?.(P0(e,a,r)),e[0]=e[e.length-1],Yw(a),a.repeat=0);const g={startTime:n?this.resolvedAt?this.resolvedAt-this.createdAt>IJ?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...a,keyframes:e},y=!p&&NJ(g)?new wJ({...g,element:g.motionValue.owner.current}):new j0(g);y.finished.then(()=>this.notifyFinished()).catch(Yn),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(e,r){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),pJ()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const OJ=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function DJ(t){const e=OJ.exec(t);if(!e)return[,];const[,r,a,n]=e;return[`--${r??a}`,n]}function S$(t,e,r=1){const[a,n]=DJ(t);if(!a)return;const s=window.getComputedStyle(e).getPropertyValue(a);if(s){const u=s.trim();return qB(u)?parseFloat(u):u}return k0(n)?S$(n,e,r+1):n}function z0(t,e){return t?.[e]??t?.default??t}const _$=new Set(["width","height","top","left","right","bottom",...$l]),LJ={test:t=>t==="auto",parse:t=>t},x$=t=>e=>e.test(t),w$=[Bl,Xe,Ra,qi,TQ,wQ,LJ],Rk=t=>w$.find(x$(t));function MJ(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||GB(t):!0}const PJ=new Set(["brightness","contrast","saturate","opacity"]);function UJ(t){const[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[a]=r.match(O0)||[];if(!a)return t;const n=r.replace(a,"");let s=PJ.has(e)?1:0;return a!==r&&(s*=100),e+"("+s+n+")"}const jJ=/\b([a-z-]*)\(.*?\)/gu,Ww={...ao,getAnimatableNone:t=>{const e=t.match(jJ);return e?e.map(UJ).join(" "):t}},Ak={...Bl,transform:Math.round},FJ={rotate:qi,rotateX:qi,rotateY:qi,rotateZ:qi,scale:Ef,scaleX:Ef,scaleY:Ef,scaleZ:Ef,skew:qi,skewX:qi,skewY:qi,distance:Xe,translateX:Xe,translateY:Xe,translateZ:Xe,x:Xe,y:Xe,z:Xe,perspective:Xe,transformPerspective:Xe,opacity:Ec,originX:mk,originY:mk,originZ:Xe},B0={borderWidth:Xe,borderTopWidth:Xe,borderRightWidth:Xe,borderBottomWidth:Xe,borderLeftWidth:Xe,borderRadius:Xe,radius:Xe,borderTopLeftRadius:Xe,borderTopRightRadius:Xe,borderBottomRightRadius:Xe,borderBottomLeftRadius:Xe,width:Xe,maxWidth:Xe,height:Xe,maxHeight:Xe,top:Xe,right:Xe,bottom:Xe,left:Xe,padding:Xe,paddingTop:Xe,paddingRight:Xe,paddingBottom:Xe,paddingLeft:Xe,margin:Xe,marginTop:Xe,marginRight:Xe,marginBottom:Xe,marginLeft:Xe,backgroundPositionX:Xe,backgroundPositionY:Xe,...FJ,zIndex:Ak,fillOpacity:Ec,strokeOpacity:Ec,numOctaves:Ak},zJ={...B0,color:xr,backgroundColor:xr,outlineColor:xr,fill:xr,stroke:xr,borderColor:xr,borderTopColor:xr,borderRightColor:xr,borderBottomColor:xr,borderLeftColor:xr,filter:Ww,WebkitFilter:Ww},T$=t=>zJ[t];function R$(t,e){let r=T$(t);return r!==Ww&&(r=ao),r.getAnimatableNone?r.getAnimatableNone(e):void 0}const BJ=new Set(["auto","none","0"]);function $J(t,e,r){let a=0,n;for(;a<t.length&&!n;){const s=t[a];typeof s=="string"&&!BJ.has(s)&&Sc(s).values.length&&(n=t[a]),a++}if(n&&r)for(const s of e)t[s]=R$(r,n)}class qJ extends F0{constructor(e,r,a,n,s){super(e,r,a,n,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:r,name:a}=this;if(!r||!r.current)return;super.readKeyframes();for(let f=0;f<e.length;f++){let p=e[f];if(typeof p=="string"&&(p=p.trim(),k0(p))){const m=S$(p,r.current);m!==void 0&&(e[f]=m),f===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!_$.has(a)||e.length!==2)return;const[n,s]=e,u=Rk(n),c=Rk(s);if(u!==c)if(_k(u)&&_k(c))for(let f=0;f<e.length;f++){const p=e[f];typeof p=="string"&&(e[f]=parseFloat(p))}else $o[a]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:r}=this,a=[];for(let n=0;n<e.length;n++)(e[n]===null||MJ(e[n]))&&a.push(n);a.length&&$J(e,a,r)}measureInitialState(){const{element:e,unresolvedKeyframes:r,name:a}=this;if(!e||!e.current)return;a==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=$o[a](e.measureViewportBox(),window.getComputedStyle(e.current)),r[0]=this.measuredOrigin;const n=r[r.length-1];n!==void 0&&e.getValue(a,n).jump(n,!1)}measureEndState(){const{element:e,name:r,unresolvedKeyframes:a}=this;if(!e||!e.current)return;const n=e.getValue(r);n&&n.jump(this.measuredOrigin,!1);const s=a.length-1,u=a[s];a[s]=$o[r](e.measureViewportBox(),window.getComputedStyle(e.current)),u!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=u),this.removedTransforms?.length&&this.removedTransforms.forEach(([c,f])=>{e.getValue(c).set(f)}),this.resolveNoneKeyframes()}}function A$(t,e,r){if(t instanceof EventTarget)return[t];if(typeof t=="string"){const n=document.querySelectorAll(t);return n?Array.from(n):[]}return Array.from(t)}const C$=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function N$(t){return HB(t)&&"offsetHeight"in t}const Ck=30,HJ=t=>!isNaN(parseFloat(t));class GJ{constructor(e,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const n=pn.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const s of this.dependents)s.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=r.owner}setCurrent(e){this.current=e,this.updatedAt=pn.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=HJ(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,r){this.events[e]||(this.events[e]=new A0);const a=this.events[e].add(r);return e==="change"?()=>{a(),er.read(()=>{this.events.change.getSize()||this.stop()})}:a}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,r){this.passiveEffect=e,this.stopPassiveEffect=r}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,r,a){this.set(r),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-a}jump(e,r=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=pn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Ck)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,Ck);return VB(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(e){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=e(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Nl(t,e){return new GJ(t,e)}const{schedule:$0}=n$(queueMicrotask,!1),ta={x:!1,y:!1};function I$(){return ta.x||ta.y}function VJ(t){return t==="x"||t==="y"?ta[t]?null:(ta[t]=!0,()=>{ta[t]=!1}):ta.x||ta.y?null:(ta.x=ta.y=!0,()=>{ta.x=ta.y=!1})}function k$(t,e){const r=A$(t),a=new AbortController,n={passive:!0,...e,signal:a.signal};return[r,n,()=>a.abort()]}function Nk(t){return!(t.pointerType==="touch"||I$())}function YJ(t,e,r={}){const[a,n,s]=k$(t,r),u=c=>{if(!Nk(c))return;const{target:f}=c,p=e(f,c);if(typeof p!="function"||!f)return;const m=h=>{Nk(h)&&(p(h),f.removeEventListener("pointerleave",m))};f.addEventListener("pointerleave",m,n)};return a.forEach(c=>{c.addEventListener("pointerenter",u,n)}),s}const O$=(t,e)=>e?t===e?!0:O$(t,e.parentElement):!1,q0=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,WJ=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function KJ(t){return WJ.has(t.tagName)||t.tabIndex!==-1}const zf=new WeakSet;function Ik(t){return e=>{e.key==="Enter"&&t(e)}}function Wv(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const ZJ=(t,e)=>{const r=t.currentTarget;if(!r)return;const a=Ik(()=>{if(zf.has(r))return;Wv(r,"down");const n=Ik(()=>{Wv(r,"up")}),s=()=>Wv(r,"cancel");r.addEventListener("keyup",n,e),r.addEventListener("blur",s,e)});r.addEventListener("keydown",a,e),r.addEventListener("blur",()=>r.removeEventListener("keydown",a),e)};function kk(t){return q0(t)&&!I$()}function XJ(t,e,r={}){const[a,n,s]=k$(t,r),u=c=>{const f=c.currentTarget;if(!kk(c))return;zf.add(f);const p=e(f,c),m=(y,E)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",g),zf.has(f)&&zf.delete(f),kk(y)&&typeof p=="function"&&p(y,{success:E})},h=y=>{m(y,f===window||f===document||r.useGlobalTarget||O$(f,y.target))},g=y=>{m(y,!1)};window.addEventListener("pointerup",h,n),window.addEventListener("pointercancel",g,n)};return a.forEach(c=>{(r.useGlobalTarget?window:c).addEventListener("pointerdown",u,n),N$(c)&&(c.addEventListener("focus",p=>ZJ(p,n)),!KJ(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),s}function D$(t){return HB(t)&&"ownerSVGElement"in t}function QJ(t){return D$(t)&&t.tagName==="svg"}const Hr=t=>!!(t&&t.getVelocity),JJ=[...w$,xr,ao],eee=t=>JJ.find(x$(t)),H0=_.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Ok(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function tee(...t){return e=>{let r=!1;const a=t.map(n=>{const s=Ok(n,e);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let n=0;n<a.length;n++){const s=a[n];typeof s=="function"?s():Ok(t[n],null)}}}}function ree(...t){return _.useCallback(tee(...t),t)}class nee extends _.Component{getSnapshotBeforeUpdate(e){const r=this.props.childRef.current;if(r&&e.isPresent&&!this.props.isPresent){const a=r.offsetParent,n=N$(a)&&a.offsetWidth||0,s=this.props.sizeRef.current;s.height=r.offsetHeight||0,s.width=r.offsetWidth||0,s.top=r.offsetTop,s.left=r.offsetLeft,s.right=n-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function aee({children:t,isPresent:e,anchorX:r,root:a}){const n=_.useId(),s=_.useRef(null),u=_.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:c}=_.useContext(H0),f=ree(s,t?.ref);return _.useInsertionEffect(()=>{const{width:p,height:m,top:h,left:g,right:y}=u.current;if(e||!s.current||!p||!m)return;const E=r==="left"?`left: ${g}`:`right: ${y}`;s.current.dataset.motionPopId=n;const x=document.createElement("style");c&&(x.nonce=c);const w=a??document.head;return w.appendChild(x),x.sheet&&x.sheet.insertRule(`
313
313
  [data-motion-pop-id="${n}"] {
314
314
  position: absolute !important;
315
315
  width: ${p}px !important;
@@ -8,7 +8,7 @@
8
8
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
9
  <link href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;700&display=swap" rel="stylesheet">
10
10
  <title>MCP Inspector</title>
11
- <script type="module" crossorigin src="/inspector/assets/index-Risbd_Le.js"></script>
11
+ <script type="module" crossorigin src="/inspector/assets/index-sdbH0tuu.js"></script>
12
12
  <link rel="stylesheet" crossorigin href="/inspector/assets/index-BOon65c9.css">
13
13
  </head>
14
14
  <body>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mcp-use/inspector",
3
3
  "type": "module",
4
- "version": "0.2.1",
4
+ "version": "0.3.1",
5
5
  "description": "MCP Inspector - A tool for inspecting and debugging MCP servers",
6
6
  "author": "",
7
7
  "license": "MIT",
@@ -58,7 +58,7 @@
58
58
  "sonner": "^2.0.7",
59
59
  "tailwind-merge": "^3.3.1",
60
60
  "vite-express": "^0.21.1",
61
- "mcp-use": "0.3.0"
61
+ "mcp-use": "1.0.0"
62
62
  },
63
63
  "publishConfig": {
64
64
  "access": "public"