import{r as c,R as W,a as St,v as mr,b as Tn}from"./vendor-react-DyQHbT3J.js";import{j as b}from"./vendor-motion-C-mcyKmB.js";function N(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function Qt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Rn(...e){return t=>{let n=!1;const o=e.map(r=>{const i=Qt(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r{const{scope:v,children:h,...w}=d,p=v?.[e]?.[f]||a,m=c.useMemo(()=>w,Object.values(w));return b.jsx(p.Provider,{value:m,children:h})};l.displayName=i+"Provider";function u(d,v){const h=v?.[e]?.[f]||a,w=c.useContext(h);if(w)return w;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[l,u]}const r=()=>{const i=n.map(s=>c.createContext(s));return function(a){const f=a?.[e]||i;return c.useMemo(()=>({[`__scope${e}`]:{...a,[e]:f}}),[a,f])}};return r.scopeName=e,[o,vr(r,...t)]}function vr(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((a,{useScope:f,scopeName:l})=>{const d=f(i)[`__scope${l}`];return{...a,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function We(e){const t=hr(e),n=c.forwardRef((o,r)=>{const{children:i,...s}=o,a=c.Children.toArray(i),f=a.find(yr);if(f){const l=f.props.children,u=a.map(d=>d===f?c.Children.count(l)>1?c.Children.only(null):c.isValidElement(l)?l.props.children:null:d);return b.jsx(t,{...s,ref:r,children:c.isValidElement(l)?c.cloneElement(l,void 0,u):null})}return b.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}var hc=We("Slot");function hr(e){const t=c.forwardRef((n,o)=>{const{children:r,...i}=n;if(c.isValidElement(r)){const s=xr(r),a=wr(i,r.props);return r.type!==c.Fragment&&(a.ref=o?Rn(o,s):s),c.cloneElement(r,a)}return c.Children.count(r)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var An=Symbol("radix.slottable");function gr(e){const t=({children:n})=>b.jsx(b.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=An,t}function yr(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===An}function wr(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const f=i(...a);return r(...a),f}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function xr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Pt(e){const t=e+"CollectionProvider",[n,o]=se(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:m,children:y}=p,g=W.useRef(null),x=W.useRef(new Map).current;return b.jsx(r,{scope:m,itemMap:x,collectionRef:g,children:y})};s.displayName=t;const a=e+"CollectionSlot",f=We(a),l=W.forwardRef((p,m)=>{const{scope:y,children:g}=p,x=i(a,y),E=V(m,x.collectionRef);return b.jsx(f,{ref:E,children:g})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",v=We(u),h=W.forwardRef((p,m)=>{const{scope:y,children:g,...x}=p,E=W.useRef(null),C=V(m,E),R=i(u,y);return W.useEffect(()=>(R.itemMap.set(E,{ref:E,...x}),()=>void R.itemMap.delete(E))),b.jsx(v,{[d]:"",ref:C,children:g})});h.displayName=u;function w(p){const m=i(e+"CollectionConsumer",p);return W.useCallback(()=>{const g=m.collectionRef.current;if(!g)return[];const x=Array.from(g.querySelectorAll(`[${d}]`));return Array.from(m.itemMap.values()).sort((R,T)=>x.indexOf(R.ref.current)-x.indexOf(T.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:s,Slot:l,ItemSlot:h},w,o]}var br=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],M=br.reduce((e,t)=>{const n=We(`Primitive.${t}`),o=c.forwardRef((r,i)=>{const{asChild:s,...a}=r,f=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(f,{...a,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function Sn(e,t){e&&St.flushSync(()=>e.dispatchEvent(t))}function U(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>t.current?.(...n),[])}function Er(e,t=globalThis?.document){const n=U(e);c.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var Cr="DismissableLayer",ht="dismissableLayer.update",Tr="dismissableLayer.pointerDownOutside",Rr="dismissableLayer.focusOutside",Jt,Pn=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ot=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...f}=e,l=c.useContext(Pn),[u,d]=c.useState(null),v=u?.ownerDocument??globalThis?.document,[,h]=c.useState({}),w=V(t,T=>d(T)),p=Array.from(l.layers),[m]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(m),g=u?p.indexOf(u):-1,x=l.layersWithOutsidePointerEventsDisabled.size>0,E=g>=y,C=Sr(T=>{const S=T.target,_=[...l.branches].some(I=>I.contains(S));!E||_||(r?.(T),s?.(T),T.defaultPrevented||a?.())},v),R=Pr(T=>{const S=T.target;[...l.branches].some(I=>I.contains(S))||(i?.(T),s?.(T),T.defaultPrevented||a?.())},v);return Er(T=>{g===l.layers.size-1&&(o?.(T),!T.defaultPrevented&&a&&(T.preventDefault(),a()))},v),c.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Jt=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),en(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=Jt)}},[u,v,n,l]),c.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),en())},[u,l]),c.useEffect(()=>{const T=()=>h({});return document.addEventListener(ht,T),()=>document.removeEventListener(ht,T)},[]),b.jsx(M.div,{...f,ref:w,style:{pointerEvents:x?E?"auto":"none":void 0,...e.style},onFocusCapture:N(e.onFocusCapture,R.onFocusCapture),onBlurCapture:N(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:N(e.onPointerDownCapture,C.onPointerDownCapture)})});Ot.displayName=Cr;var Ar="DismissableLayerBranch",On=c.forwardRef((e,t)=>{const n=c.useContext(Pn),o=c.useRef(null),r=V(t,o);return c.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),b.jsx(M.div,{...e,ref:r})});On.displayName=Ar;function Sr(e,t=globalThis?.document){const n=U(e),o=c.useRef(!1),r=c.useRef(()=>{});return c.useEffect(()=>{const i=a=>{if(a.target&&!o.current){let f=function(){In(Tr,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=f,t.addEventListener("click",r.current,{once:!0})):f()}else t.removeEventListener("click",r.current);o.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function Pr(e,t=globalThis?.document){const n=U(e),o=c.useRef(!1);return c.useEffect(()=>{const r=i=>{i.target&&!o.current&&In(Rr,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function en(){const e=new CustomEvent(ht);document.dispatchEvent(e)}function In(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?Sn(r,i):r.dispatchEvent(i)}var Or=Ot,Ir=On,Q=globalThis?.document?c.useLayoutEffect:()=>{},Nr="Portal",Nn=c.forwardRef((e,t)=>{const{container:n,...o}=e,[r,i]=c.useState(!1);Q(()=>i(!0),[]);const s=n||r&&globalThis?.document?.body;return s?mr.createPortal(b.jsx(M.div,{...o,ref:t}),s):null});Nn.displayName=Nr;function _r(e,t){return c.useReducer((n,o)=>t[n][o]??n,e)}var Ce=e=>{const{present:t,children:n}=e,o=Dr(t),r=typeof n=="function"?n({present:o.isPresent}):c.Children.only(n),i=V(o.ref,Mr(r));return typeof n=="function"||o.isPresent?c.cloneElement(r,{ref:i}):null};Ce.displayName="Presence";function Dr(e){const[t,n]=c.useState(),o=c.useRef(null),r=c.useRef(e),i=c.useRef("none"),s=e?"mounted":"unmounted",[a,f]=_r(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const l=Ie(o.current);i.current=a==="mounted"?l:"none"},[a]),Q(()=>{const l=o.current,u=r.current;if(u!==e){const v=i.current,h=Ie(l);e?f("MOUNT"):h==="none"||l?.display==="none"?f("UNMOUNT"):f(u&&v!==h?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,f]),Q(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=h=>{const p=Ie(o.current).includes(h.animationName);if(h.target===t&&p&&(f("ANIMATION_END"),!r.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},v=h=>{h.target===t&&(i.current=Ie(o.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:c.useCallback(l=>{o.current=l?getComputedStyle(l):null,n(l)},[])}}function Ie(e){return e?.animationName||"none"}function Mr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Lr=Tn[" useInsertionEffect ".trim().toString()]||Q;function he({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,i,s]=Fr({defaultProp:t,onChange:n}),a=e!==void 0,f=a?e:r;{const u=c.useRef(e!==void 0);c.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${o} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,o])}const l=c.useCallback(u=>{if(a){const d=kr(u)?u(e):u;d!==e&&s.current?.(d)}else i(u)},[a,e,i,s]);return[f,l]}function Fr({defaultProp:e,onChange:t}){const[n,o]=c.useState(e),r=c.useRef(n),i=c.useRef(t);return Lr(()=>{i.current=t},[t]),c.useEffect(()=>{r.current!==n&&(i.current?.(n),r.current=n)},[n,r]),[n,o,i]}function kr(e){return typeof e=="function"}var jr=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"}),$r="VisuallyHidden",ze=c.forwardRef((e,t)=>b.jsx(M.span,{...e,ref:t,style:{...jr,...e.style}}));ze.displayName=$r;var Wr=ze,It="ToastProvider",[Nt,Vr,Br]=Pt("Toast"),[_n,gc]=se("Toast",[Br]),[Hr,Ye]=_n(It),Dn=e=>{const{__scopeToast:t,label:n="Notification",duration:o=5e3,swipeDirection:r="right",swipeThreshold:i=50,children:s}=e,[a,f]=c.useState(null),[l,u]=c.useState(0),d=c.useRef(!1),v=c.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${It}\`. Expected non-empty \`string\`.`),b.jsx(Nt.Provider,{scope:t,children:b.jsx(Hr,{scope:t,label:n,duration:o,swipeDirection:r,swipeThreshold:i,toastCount:l,viewport:a,onViewportChange:f,onToastAdd:c.useCallback(()=>u(h=>h+1),[]),onToastRemove:c.useCallback(()=>u(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:v,children:s})})};Dn.displayName=It;var Mn="ToastViewport",Kr=["F8"],gt="toast.viewportPause",yt="toast.viewportResume",Ln=c.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:o=Kr,label:r="Notifications ({hotkey})",...i}=e,s=Ye(Mn,n),a=Vr(n),f=c.useRef(null),l=c.useRef(null),u=c.useRef(null),d=c.useRef(null),v=V(t,d,s.onViewportChange),h=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),w=s.toastCount>0;c.useEffect(()=>{const m=y=>{o.length!==0&&o.every(x=>y[x]||y.code===x)&&d.current?.focus()};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[o]),c.useEffect(()=>{const m=f.current,y=d.current;if(w&&m&&y){const g=()=>{if(!s.isClosePausedRef.current){const R=new CustomEvent(gt);y.dispatchEvent(R),s.isClosePausedRef.current=!0}},x=()=>{if(s.isClosePausedRef.current){const R=new CustomEvent(yt);y.dispatchEvent(R),s.isClosePausedRef.current=!1}},E=R=>{!m.contains(R.relatedTarget)&&x()},C=()=>{m.contains(document.activeElement)||x()};return m.addEventListener("focusin",g),m.addEventListener("focusout",E),m.addEventListener("pointermove",g),m.addEventListener("pointerleave",C),window.addEventListener("blur",g),window.addEventListener("focus",x),()=>{m.removeEventListener("focusin",g),m.removeEventListener("focusout",E),m.removeEventListener("pointermove",g),m.removeEventListener("pointerleave",C),window.removeEventListener("blur",g),window.removeEventListener("focus",x)}}},[w,s.isClosePausedRef]);const p=c.useCallback(({tabbingDirection:m})=>{const g=a().map(x=>{const E=x.ref.current,C=[E,...oi(E)];return m==="forwards"?C:C.reverse()});return(m==="forwards"?g.reverse():g).flat()},[a]);return c.useEffect(()=>{const m=d.current;if(m){const y=g=>{const x=g.altKey||g.ctrlKey||g.metaKey;if(g.key==="Tab"&&!x){const C=document.activeElement,R=g.shiftKey;if(g.target===m&&R){l.current?.focus();return}const _=p({tabbingDirection:R?"backwards":"forwards"}),I=_.findIndex(D=>D===C);it(_.slice(I+1))?g.preventDefault():R?l.current?.focus():u.current?.focus()}};return m.addEventListener("keydown",y),()=>m.removeEventListener("keydown",y)}},[a,p]),b.jsxs(Ir,{ref:f,role:"region","aria-label":r.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:w?void 0:"none"},children:[w&&b.jsx(wt,{ref:l,onFocusFromOutsideViewport:()=>{const m=p({tabbingDirection:"forwards"});it(m)}}),b.jsx(Nt.Slot,{scope:n,children:b.jsx(M.ol,{tabIndex:-1,...i,ref:v})}),w&&b.jsx(wt,{ref:u,onFocusFromOutsideViewport:()=>{const m=p({tabbingDirection:"backwards"});it(m)}})]})});Ln.displayName=Mn;var Fn="ToastFocusProxy",wt=c.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:o,...r}=e,i=Ye(Fn,n);return b.jsx(ze,{"aria-hidden":!0,tabIndex:0,...r,ref:t,style:{position:"fixed"},onFocus:s=>{const a=s.relatedTarget;!i.viewport?.contains(a)&&o()}})});wt.displayName=Fn;var Te="Toast",Ur="toast.swipeStart",zr="toast.swipeMove",Yr="toast.swipeCancel",Gr="toast.swipeEnd",kn=c.forwardRef((e,t)=>{const{forceMount:n,open:o,defaultOpen:r,onOpenChange:i,...s}=e,[a,f]=he({prop:o,defaultProp:r??!0,onChange:i,caller:Te});return b.jsx(Ce,{present:n||a,children:b.jsx(Zr,{open:a,...s,ref:t,onClose:()=>f(!1),onPause:U(e.onPause),onResume:U(e.onResume),onSwipeStart:N(e.onSwipeStart,l=>{l.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:N(e.onSwipeMove,l=>{const{x:u,y:d}=l.detail.delta;l.currentTarget.setAttribute("data-swipe","move"),l.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),l.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:N(e.onSwipeCancel,l=>{l.currentTarget.setAttribute("data-swipe","cancel"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),l.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:N(e.onSwipeEnd,l=>{const{x:u,y:d}=l.detail.delta;l.currentTarget.setAttribute("data-swipe","end"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),l.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),l.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),f(!1)})})})});kn.displayName=Te;var[Xr,qr]=_n(Te,{onClose(){}}),Zr=c.forwardRef((e,t)=>{const{__scopeToast:n,type:o="foreground",duration:r,open:i,onClose:s,onEscapeKeyDown:a,onPause:f,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:v,onSwipeEnd:h,...w}=e,p=Ye(Te,n),[m,y]=c.useState(null),g=V(t,A=>y(A)),x=c.useRef(null),E=c.useRef(null),C=r||p.duration,R=c.useRef(0),T=c.useRef(C),S=c.useRef(0),{onToastAdd:_,onToastRemove:I}=p,D=U(()=>{m?.contains(document.activeElement)&&p.viewport?.focus(),s()}),j=c.useCallback(A=>{!A||A===1/0||(window.clearTimeout(S.current),R.current=new Date().getTime(),S.current=window.setTimeout(D,A))},[D]);c.useEffect(()=>{const A=p.viewport;if(A){const L=()=>{j(T.current),l?.()},O=()=>{const F=new Date().getTime()-R.current;T.current=T.current-F,window.clearTimeout(S.current),f?.()};return A.addEventListener(gt,O),A.addEventListener(yt,L),()=>{A.removeEventListener(gt,O),A.removeEventListener(yt,L)}}},[p.viewport,C,f,l,j]),c.useEffect(()=>{i&&!p.isClosePausedRef.current&&j(C)},[i,C,p.isClosePausedRef,j]),c.useEffect(()=>(_(),()=>I()),[_,I]);const k=c.useMemo(()=>m?Kn(m):null,[m]);return p.viewport?b.jsxs(b.Fragment,{children:[k&&b.jsx(Qr,{__scopeToast:n,role:"status","aria-live":o==="foreground"?"assertive":"polite","aria-atomic":!0,children:k}),b.jsx(Xr,{scope:n,onClose:D,children:St.createPortal(b.jsx(Nt.ItemSlot,{scope:n,children:b.jsx(Or,{asChild:!0,onEscapeKeyDown:N(a,()=>{p.isFocusedToastEscapeKeyDownRef.current||D(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:b.jsx(M.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":p.swipeDirection,...w,ref:g,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:N(e.onKeyDown,A=>{A.key==="Escape"&&(a?.(A.nativeEvent),A.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,D()))}),onPointerDown:N(e.onPointerDown,A=>{A.button===0&&(x.current={x:A.clientX,y:A.clientY})}),onPointerMove:N(e.onPointerMove,A=>{if(!x.current)return;const L=A.clientX-x.current.x,O=A.clientY-x.current.y,F=!!E.current,P=["left","right"].includes(p.swipeDirection),$=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,K=P?$(0,L):0,Se=P?0:$(0,O),we=A.pointerType==="touch"?10:2,ce={x:K,y:Se},Pe={originalEvent:A,delta:ce};F?(E.current=ce,Ne(zr,d,Pe,{discrete:!1})):tn(ce,p.swipeDirection,we)?(E.current=ce,Ne(Ur,u,Pe,{discrete:!1}),A.target.setPointerCapture(A.pointerId)):(Math.abs(L)>we||Math.abs(O)>we)&&(x.current=null)}),onPointerUp:N(e.onPointerUp,A=>{const L=E.current,O=A.target;if(O.hasPointerCapture(A.pointerId)&&O.releasePointerCapture(A.pointerId),E.current=null,x.current=null,L){const F=A.currentTarget,P={originalEvent:A,delta:L};tn(L,p.swipeDirection,p.swipeThreshold)?Ne(Gr,h,P,{discrete:!0}):Ne(Yr,v,P,{discrete:!0}),F.addEventListener("click",$=>$.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),Qr=e=>{const{__scopeToast:t,children:n,...o}=e,r=Ye(Te,t),[i,s]=c.useState(!1),[a,f]=c.useState(!1);return ti(()=>s(!0)),c.useEffect(()=>{const l=window.setTimeout(()=>f(!0),1e3);return()=>window.clearTimeout(l)},[]),a?null:b.jsx(Nn,{asChild:!0,children:b.jsx(ze,{...o,children:i&&b.jsxs(b.Fragment,{children:[r.label," ",n]})})})},Jr="ToastTitle",jn=c.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e;return b.jsx(M.div,{...o,ref:t})});jn.displayName=Jr;var ei="ToastDescription",$n=c.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e;return b.jsx(M.div,{...o,ref:t})});$n.displayName=ei;var Wn="ToastAction",Vn=c.forwardRef((e,t)=>{const{altText:n,...o}=e;return n.trim()?b.jsx(Hn,{altText:n,asChild:!0,children:b.jsx(_t,{...o,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Wn}\`. Expected non-empty \`string\`.`),null)});Vn.displayName=Wn;var Bn="ToastClose",_t=c.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e,r=qr(Bn,n);return b.jsx(Hn,{asChild:!0,children:b.jsx(M.button,{type:"button",...o,ref:t,onClick:N(e.onClick,r.onClose)})})});_t.displayName=Bn;var Hn=c.forwardRef((e,t)=>{const{__scopeToast:n,altText:o,...r}=e;return b.jsx(M.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...r,ref:t})});function Kn(e){const t=[];return Array.from(e.childNodes).forEach(o=>{if(o.nodeType===o.TEXT_NODE&&o.textContent&&t.push(o.textContent),ni(o)){const r=o.ariaHidden||o.hidden||o.style.display==="none",i=o.dataset.radixToastAnnounceExclude==="";if(!r)if(i){const s=o.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...Kn(o))}}),t}function Ne(e,t,n,{discrete:o}){const r=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?Sn(r,i):r.dispatchEvent(i)}var tn=(e,t,n=0)=>{const o=Math.abs(e.x),r=Math.abs(e.y),i=o>r;return t==="left"||t==="right"?i&&o>n:!i&&r>n};function ti(e=()=>{}){const t=U(e);Q(()=>{let n=0,o=0;return n=window.requestAnimationFrame(()=>o=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(o)}},[t])}function ni(e){return e.nodeType===e.ELEMENT_NODE}function oi(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function it(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var yc=Dn,wc=Ln,xc=kn,bc=jn,Ec=$n,Cc=Vn,Tc=_t,ri=Tn[" useId ".trim().toString()]||(()=>{}),ii=0;function Ge(e){const[t,n]=c.useState(ri());return Q(()=>{n(o=>o??String(ii++))},[e]),t?`radix-${t}`:""}const si=["top","right","bottom","left"],re=Math.min,B=Math.max,Ve=Math.round,_e=Math.floor,Z=e=>({x:e,y:e}),ai={left:"right",right:"left",bottom:"top",top:"bottom"},ci={start:"end",end:"start"};function xt(e,t,n){return B(e,re(t,n))}function te(e,t){return typeof e=="function"?e(t):e}function ne(e){return e.split("-")[0]}function ge(e){return e.split("-")[1]}function Dt(e){return e==="x"?"y":"x"}function Mt(e){return e==="y"?"height":"width"}const li=new Set(["top","bottom"]);function q(e){return li.has(ne(e))?"y":"x"}function Lt(e){return Dt(q(e))}function ui(e,t,n){n===void 0&&(n=!1);const o=ge(e),r=Lt(e),i=Mt(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Be(s)),[s,Be(s)]}function fi(e){const t=Be(e);return[bt(e),t,bt(t)]}function bt(e){return e.replace(/start|end/g,t=>ci[t])}const nn=["left","right"],on=["right","left"],di=["top","bottom"],pi=["bottom","top"];function mi(e,t,n){switch(e){case"top":case"bottom":return n?t?on:nn:t?nn:on;case"left":case"right":return t?di:pi;default:return[]}}function vi(e,t,n,o){const r=ge(e);let i=mi(ne(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(bt)))),i}function Be(e){return e.replace(/left|right|bottom|top/g,t=>ai[t])}function hi(e){return{top:0,right:0,bottom:0,left:0,...e}}function Un(e){return typeof e!="number"?hi(e):{top:e,right:e,bottom:e,left:e}}function He(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function rn(e,t,n){let{reference:o,floating:r}=e;const i=q(t),s=Lt(t),a=Mt(s),f=ne(t),l=i==="y",u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,v=o[a]/2-r[a]/2;let h;switch(f){case"top":h={x:u,y:o.y-r.height};break;case"bottom":h={x:u,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:d};break;case"left":h={x:o.x-r.width,y:d};break;default:h={x:o.x,y:o.y}}switch(ge(t)){case"start":h[s]-=v*(n&&l?-1:1);break;case"end":h[s]+=v*(n&&l?-1:1);break}return h}const gi=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),f=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:d}=rn(l,o,f),v=o,h={},w=0;for(let p=0;p({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:a,middlewareData:f}=t,{element:l,padding:u=0}=te(e,t)||{};if(l==null)return{};const d=Un(u),v={x:n,y:o},h=Lt(r),w=Mt(h),p=await s.getDimensions(l),m=h==="y",y=m?"top":"left",g=m?"bottom":"right",x=m?"clientHeight":"clientWidth",E=i.reference[w]+i.reference[h]-v[h]-i.floating[w],C=v[h]-i.reference[h],R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let T=R?R[x]:0;(!T||!await(s.isElement==null?void 0:s.isElement(R)))&&(T=a.floating[x]||i.floating[w]);const S=E/2-C/2,_=T/2-p[w]/2-1,I=re(d[y],_),D=re(d[g],_),j=I,k=T-p[w]-D,A=T/2-p[w]/2+S,L=xt(j,A,k),O=!f.arrow&&ge(r)!=null&&A!==L&&i.reference[w]/2-(AA<=0)){var D,j;const A=(((D=i.flip)==null?void 0:D.index)||0)+1,L=T[A];if(L&&(!(d==="alignment"?g!==q(L):!1)||I.every(P=>P.overflows[0]>0&&q(P.placement)===g)))return{data:{index:A,overflows:I},reset:{placement:L}};let O=(j=I.filter(F=>F.overflows[0]<=0).sort((F,P)=>F.overflows[1]-P.overflows[1])[0])==null?void 0:j.placement;if(!O)switch(h){case"bestFit":{var k;const F=(k=I.filter(P=>{if(R){const $=q(P.placement);return $===g||$==="y"}return!0}).map(P=>[P.placement,P.overflows.filter($=>$>0).reduce(($,K)=>$+K,0)]).sort((P,$)=>P[1]-$[1])[0])==null?void 0:k[0];F&&(O=F);break}case"initialPlacement":O=a;break}if(r!==O)return{reset:{placement:O}}}return{}}}};function sn(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function an(e){return si.some(t=>e[t]>=0)}const xi=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=te(e,t);switch(o){case"referenceHidden":{const i=await be(t,{...r,elementContext:"reference"}),s=sn(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:an(s)}}}case"escaped":{const i=await be(t,{...r,altBoundary:!0}),s=sn(i,n.floating);return{data:{escapedOffsets:s,escaped:an(s)}}}default:return{}}}}},zn=new Set(["left","top"]);async function bi(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=ne(n),a=ge(n),f=q(n)==="y",l=zn.has(s)?-1:1,u=i&&f?-1:1,d=te(t,e);let{mainAxis:v,crossAxis:h,alignmentAxis:w}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof w=="number"&&(h=a==="end"?w*-1:w),f?{x:h*u,y:v*l}:{x:v*l,y:h*u}}const Ei=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:a}=t,f=await bi(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+f.x,y:i+f.y,data:{...f,placement:s}}}}},Ci=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x:y,y:g}=m;return{x:y,y:g}}},...f}=te(e,t),l={x:n,y:o},u=await be(t,f),d=q(ne(r)),v=Dt(d);let h=l[v],w=l[d];if(i){const m=v==="y"?"top":"left",y=v==="y"?"bottom":"right",g=h+u[m],x=h-u[y];h=xt(g,h,x)}if(s){const m=d==="y"?"top":"left",y=d==="y"?"bottom":"right",g=w+u[m],x=w-u[y];w=xt(g,w,x)}const p=a.fn({...t,[v]:h,[d]:w});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[v]:i,[d]:s}}}}}},Ti=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:f=!0,crossAxis:l=!0}=te(e,t),u={x:n,y:o},d=q(r),v=Dt(d);let h=u[v],w=u[d];const p=te(a,t),m=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(f){const x=v==="y"?"height":"width",E=i.reference[v]-i.floating[x]+m.mainAxis,C=i.reference[v]+i.reference[x]-m.mainAxis;hC&&(h=C)}if(l){var y,g;const x=v==="y"?"width":"height",E=zn.has(ne(r)),C=i.reference[d]-i.floating[x]+(E&&((y=s.offset)==null?void 0:y[d])||0)+(E?0:m.crossAxis),R=i.reference[d]+i.reference[x]+(E?0:((g=s.offset)==null?void 0:g[d])||0)-(E?m.crossAxis:0);wR&&(w=R)}return{[v]:h,[d]:w}}}},Ri=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:s,elements:a}=t,{apply:f=()=>{},...l}=te(e,t),u=await be(t,l),d=ne(r),v=ge(r),h=q(r)==="y",{width:w,height:p}=i.floating;let m,y;d==="top"||d==="bottom"?(m=d,y=v===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,m=v==="end"?"top":"bottom");const g=p-u.top-u.bottom,x=w-u.left-u.right,E=re(p-u[m],g),C=re(w-u[y],x),R=!t.middlewareData.shift;let T=E,S=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=x),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(T=g),R&&!v){const I=B(u.left,0),D=B(u.right,0),j=B(u.top,0),k=B(u.bottom,0);h?S=w-2*(I!==0||D!==0?I+D:B(u.left,u.right)):T=p-2*(j!==0||k!==0?j+k:B(u.top,u.bottom))}await f({...t,availableWidth:S,availableHeight:T});const _=await s.getDimensions(a.floating);return w!==_.width||p!==_.height?{reset:{rects:!0}}:{}}}};function Xe(){return typeof window<"u"}function ye(e){return Yn(e)?(e.nodeName||"").toLowerCase():"#document"}function H(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ee(e){var t;return(t=(Yn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Yn(e){return Xe()?e instanceof Node||e instanceof H(e).Node:!1}function z(e){return Xe()?e instanceof Element||e instanceof H(e).Element:!1}function J(e){return Xe()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function cn(e){return!Xe()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}const Ai=new Set(["inline","contents"]);function Re(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Y(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Ai.has(r)}const Si=new Set(["table","td","th"]);function Pi(e){return Si.has(ye(e))}const Oi=[":popover-open",":modal"];function qe(e){return Oi.some(t=>{try{return e.matches(t)}catch{return!1}})}const Ii=["transform","translate","scale","rotate","perspective"],Ni=["transform","translate","scale","rotate","perspective","filter"],_i=["paint","layout","strict","content"];function Ft(e){const t=kt(),n=z(e)?Y(e):e;return Ii.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Ni.some(o=>(n.willChange||"").includes(o))||_i.some(o=>(n.contain||"").includes(o))}function Di(e){let t=ie(e);for(;J(t)&&!me(t);){if(Ft(t))return t;if(qe(t))return null;t=ie(t)}return null}function kt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Mi=new Set(["html","body","#document"]);function me(e){return Mi.has(ye(e))}function Y(e){return H(e).getComputedStyle(e)}function Ze(e){return z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ie(e){if(ye(e)==="html")return e;const t=e.assignedSlot||e.parentNode||cn(e)&&e.host||ee(e);return cn(t)?t.host:t}function Gn(e){const t=ie(e);return me(t)?e.ownerDocument?e.ownerDocument.body:e.body:J(t)&&Re(t)?t:Gn(t)}function Ee(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Gn(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=H(r);if(i){const a=Et(s);return t.concat(s,s.visualViewport||[],Re(r)?r:[],a&&n?Ee(a):[])}return t.concat(r,Ee(r,[],n))}function Et(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xn(e){const t=Y(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=J(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,a=Ve(n)!==i||Ve(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function jt(e){return z(e)?e:e.contextElement}function de(e){const t=jt(e);if(!J(t))return Z(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Xn(t);let s=(i?Ve(n.width):n.width)/o,a=(i?Ve(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Li=Z(0);function qn(e){const t=H(e);return!kt()||!t.visualViewport?Li:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Fi(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==H(e)?!1:t}function ae(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=jt(e);let s=Z(1);t&&(o?z(o)&&(s=de(o)):s=de(e));const a=Fi(i,n,o)?qn(i):Z(0);let f=(r.left+a.x)/s.x,l=(r.top+a.y)/s.y,u=r.width/s.x,d=r.height/s.y;if(i){const v=H(i),h=o&&z(o)?H(o):o;let w=v,p=Et(w);for(;p&&o&&h!==w;){const m=de(p),y=p.getBoundingClientRect(),g=Y(p),x=y.left+(p.clientLeft+parseFloat(g.paddingLeft))*m.x,E=y.top+(p.clientTop+parseFloat(g.paddingTop))*m.y;f*=m.x,l*=m.y,u*=m.x,d*=m.y,f+=x,l+=E,w=H(p),p=Et(w)}}return He({width:u,height:d,x:f,y:l})}function $t(e,t){const n=Ze(e).scrollLeft;return t?t.left+n:ae(ee(e)).left+n}function Zn(e,t,n){n===void 0&&(n=!1);const o=e.getBoundingClientRect(),r=o.left+t.scrollLeft-(n?0:$t(e,o)),i=o.top+t.scrollTop;return{x:r,y:i}}function ki(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=ee(o),a=t?qe(t.floating):!1;if(o===s||a&&i)return n;let f={scrollLeft:0,scrollTop:0},l=Z(1);const u=Z(0),d=J(o);if((d||!d&&!i)&&((ye(o)!=="body"||Re(s))&&(f=Ze(o)),J(o))){const h=ae(o);l=de(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}const v=s&&!d&&!i?Zn(s,f,!0):Z(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-f.scrollLeft*l.x+u.x+v.x,y:n.y*l.y-f.scrollTop*l.y+u.y+v.y}}function ji(e){return Array.from(e.getClientRects())}function $i(e){const t=ee(e),n=Ze(e),o=e.ownerDocument.body,r=B(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=B(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+$t(e);const a=-n.scrollTop;return Y(o).direction==="rtl"&&(s+=B(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}function Wi(e,t){const n=H(e),o=ee(e),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,f=0;if(r){i=r.width,s=r.height;const l=kt();(!l||l&&t==="fixed")&&(a=r.offsetLeft,f=r.offsetTop)}return{width:i,height:s,x:a,y:f}}const Vi=new Set(["absolute","fixed"]);function Bi(e,t){const n=ae(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=J(e)?de(e):Z(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,f=r*i.x,l=o*i.y;return{width:s,height:a,x:f,y:l}}function ln(e,t,n){let o;if(t==="viewport")o=Wi(e,n);else if(t==="document")o=$i(ee(e));else if(z(t))o=Bi(t,n);else{const r=qn(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return He(o)}function Qn(e,t){const n=ie(e);return n===t||!z(n)||me(n)?!1:Y(n).position==="fixed"||Qn(n,t)}function Hi(e,t){const n=t.get(e);if(n)return n;let o=Ee(e,[],!1).filter(a=>z(a)&&ye(a)!=="body"),r=null;const i=Y(e).position==="fixed";let s=i?ie(e):e;for(;z(s)&&!me(s);){const a=Y(s),f=Ft(s);!f&&a.position==="fixed"&&(r=null),(i?!f&&!r:!f&&a.position==="static"&&!!r&&Vi.has(r.position)||Re(s)&&!f&&Qn(e,s))?o=o.filter(u=>u!==s):r=a,s=ie(s)}return t.set(e,o),o}function Ki(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?qe(t)?[]:Hi(t,this._c):[].concat(n),o],a=s[0],f=s.reduce((l,u)=>{const d=ln(t,u,r);return l.top=B(d.top,l.top),l.right=re(d.right,l.right),l.bottom=re(d.bottom,l.bottom),l.left=B(d.left,l.left),l},ln(t,a,r));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function Ui(e){const{width:t,height:n}=Xn(e);return{width:t,height:n}}function zi(e,t,n){const o=J(t),r=ee(t),i=n==="fixed",s=ae(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const f=Z(0);function l(){f.x=$t(r)}if(o||!o&&!i)if((ye(t)!=="body"||Re(r))&&(a=Ze(t)),o){const h=ae(t,!0,i,t);f.x=h.x+t.clientLeft,f.y=h.y+t.clientTop}else r&&l();i&&!o&&r&&l();const u=r&&!o&&!i?Zn(r,a):Z(0),d=s.left+a.scrollLeft-f.x-u.x,v=s.top+a.scrollTop-f.y-u.y;return{x:d,y:v,width:s.width,height:s.height}}function st(e){return Y(e).position==="static"}function un(e,t){if(!J(e)||Y(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ee(e)===n&&(n=n.ownerDocument.body),n}function Jn(e,t){const n=H(e);if(qe(e))return n;if(!J(e)){let r=ie(e);for(;r&&!me(r);){if(z(r)&&!st(r))return r;r=ie(r)}return n}let o=un(e,t);for(;o&&Pi(o)&&st(o);)o=un(o,t);return o&&me(o)&&st(o)&&!Ft(o)?n:o||Di(e)||n}const Yi=async function(e){const t=this.getOffsetParent||Jn,n=this.getDimensions,o=await n(e.floating);return{reference:zi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Gi(e){return Y(e).direction==="rtl"}const Xi={convertOffsetParentRelativeRectToViewportRelativeRect:ki,getDocumentElement:ee,getClippingRect:Ki,getOffsetParent:Jn,getElementRects:Yi,getClientRects:ji,getDimensions:Ui,getScale:de,isElement:z,isRTL:Gi};function eo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qi(e,t){let n=null,o;const r=ee(e);function i(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function s(a,f){a===void 0&&(a=!1),f===void 0&&(f=1),i();const l=e.getBoundingClientRect(),{left:u,top:d,width:v,height:h}=l;if(a||t(),!v||!h)return;const w=_e(d),p=_e(r.clientWidth-(u+v)),m=_e(r.clientHeight-(d+h)),y=_e(u),x={rootMargin:-w+"px "+-p+"px "+-m+"px "+-y+"px",threshold:B(0,re(1,f))||1};let E=!0;function C(R){const T=R[0].intersectionRatio;if(T!==f){if(!E)return s();T?s(!1,T):o=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!eo(l,e.getBoundingClientRect())&&s(),E=!1}try{n=new IntersectionObserver(C,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return s(!0),i}function Zi(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:f=!1}=o,l=jt(e),u=r||i?[...l?Ee(l):[],...Ee(t)]:[];u.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=l&&a?qi(l,n):null;let v=-1,h=null;s&&(h=new ResizeObserver(y=>{let[g]=y;g&&g.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),l&&!f&&h.observe(l),h.observe(t));let w,p=f?ae(e):null;f&&m();function m(){const y=ae(e);p&&!eo(p,y)&&n(),p=y,w=requestAnimationFrame(m)}return n(),()=>{var y;u.forEach(g=>{r&&g.removeEventListener("scroll",n),i&&g.removeEventListener("resize",n)}),d?.(),(y=h)==null||y.disconnect(),h=null,f&&cancelAnimationFrame(w)}}const Qi=Ei,Ji=Ci,es=wi,ts=Ri,ns=xi,fn=yi,os=Ti,rs=(e,t,n)=>{const o=new Map,r={platform:Xi,...n},i={...r.platform,_c:o};return gi(e,t,{...r,platform:i})};var is=typeof document<"u",ss=function(){},ke=is?c.useLayoutEffect:ss;function Ke(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Ke(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!Ke(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function to(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dn(e,t){const n=to(e);return Math.round(t*n)/n}function at(e){const t=c.useRef(e);return ke(()=>{t.current=e}),t}function as(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:f,open:l}=e,[u,d]=c.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,h]=c.useState(o);Ke(v,o)||h(o);const[w,p]=c.useState(null),[m,y]=c.useState(null),g=c.useCallback(P=>{P!==R.current&&(R.current=P,p(P))},[]),x=c.useCallback(P=>{P!==T.current&&(T.current=P,y(P))},[]),E=i||w,C=s||m,R=c.useRef(null),T=c.useRef(null),S=c.useRef(u),_=f!=null,I=at(f),D=at(r),j=at(l),k=c.useCallback(()=>{if(!R.current||!T.current)return;const P={placement:t,strategy:n,middleware:v};D.current&&(P.platform=D.current),rs(R.current,T.current,P).then($=>{const K={...$,isPositioned:j.current!==!1};A.current&&!Ke(S.current,K)&&(S.current=K,St.flushSync(()=>{d(K)}))})},[v,t,n,D,j]);ke(()=>{l===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,d(P=>({...P,isPositioned:!1})))},[l]);const A=c.useRef(!1);ke(()=>(A.current=!0,()=>{A.current=!1}),[]),ke(()=>{if(E&&(R.current=E),C&&(T.current=C),E&&C){if(I.current)return I.current(E,C,k);k()}},[E,C,k,I,_]);const L=c.useMemo(()=>({reference:R,floating:T,setReference:g,setFloating:x}),[g,x]),O=c.useMemo(()=>({reference:E,floating:C}),[E,C]),F=c.useMemo(()=>{const P={position:n,left:0,top:0};if(!O.floating)return P;const $=dn(O.floating,u.x),K=dn(O.floating,u.y);return a?{...P,transform:"translate("+$+"px, "+K+"px)",...to(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:$,top:K}},[n,a,O.floating,u.x,u.y]);return c.useMemo(()=>({...u,update:k,refs:L,elements:O,floatingStyles:F}),[u,k,L,O,F])}const cs=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?fn({element:o.current,padding:r}).fn(n):{}:o?fn({element:o,padding:r}).fn(n):{}}}},ls=(e,t)=>({...Qi(e),options:[e,t]}),us=(e,t)=>({...Ji(e),options:[e,t]}),fs=(e,t)=>({...os(e),options:[e,t]}),ds=(e,t)=>({...es(e),options:[e,t]}),ps=(e,t)=>({...ts(e),options:[e,t]}),ms=(e,t)=>({...ns(e),options:[e,t]}),vs=(e,t)=>({...cs(e),options:[e,t]});var hs="Arrow",no=c.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...i}=e;return b.jsx(M.svg,{...i,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:b.jsx("polygon",{points:"0,0 30,0 15,10"})})});no.displayName=hs;var gs=no;function ys(e){const[t,n]=c.useState(void 0);return Q(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let s,a;if("borderBoxSize"in i){const f=i.borderBoxSize,l=Array.isArray(f)?f[0]:f;s=l.inlineSize,a=l.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var Wt="Popper",[oo,ro]=se(Wt),[ws,io]=oo(Wt),so=e=>{const{__scopePopper:t,children:n}=e,[o,r]=c.useState(null);return b.jsx(ws,{scope:t,anchor:o,onAnchorChange:r,children:n})};so.displayName=Wt;var ao="PopperAnchor",co=c.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,i=io(ao,n),s=c.useRef(null),a=V(t,s);return c.useEffect(()=>{i.onAnchorChange(o?.current||s.current)}),o?null:b.jsx(M.div,{...r,ref:a})});co.displayName=ao;var Vt="PopperContent",[xs,bs]=oo(Vt),lo=c.forwardRef((e,t)=>{const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:f=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:v=!1,updatePositionStrategy:h="optimized",onPlaced:w,...p}=e,m=io(Vt,n),[y,g]=c.useState(null),x=V(t,xe=>g(xe)),[E,C]=c.useState(null),R=ys(E),T=R?.width??0,S=R?.height??0,_=o+(i!=="center"?"-"+i:""),I=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],j=D.length>0,k={padding:I,boundary:D.filter(Cs),altBoundary:j},{refs:A,floatingStyles:L,placement:O,isPositioned:F,middlewareData:P}=as({strategy:"fixed",placement:_,whileElementsMounted:(...xe)=>Zi(...xe,{animationFrame:h==="always"}),elements:{reference:m.anchor},middleware:[ls({mainAxis:r+S,alignmentAxis:s}),f&&us({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?fs():void 0,...k}),f&&ds({...k}),ps({...k,apply:({elements:xe,rects:Zt,availableWidth:ur,availableHeight:fr})=>{const{width:dr,height:pr}=Zt.reference,Oe=xe.floating.style;Oe.setProperty("--radix-popper-available-width",`${ur}px`),Oe.setProperty("--radix-popper-available-height",`${fr}px`),Oe.setProperty("--radix-popper-anchor-width",`${dr}px`),Oe.setProperty("--radix-popper-anchor-height",`${pr}px`)}}),E&&vs({element:E,padding:a}),Ts({arrowWidth:T,arrowHeight:S}),v&&ms({strategy:"referenceHidden",...k})]}),[$,K]=po(O),Se=U(w);Q(()=>{F&&Se?.()},[F,Se]);const we=P.arrow?.x,ce=P.arrow?.y,Pe=P.arrow?.centerOffset!==0,[cr,lr]=c.useState();return Q(()=>{y&&lr(window.getComputedStyle(y).zIndex)},[y]),b.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:F?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:cr,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:b.jsx(xs,{scope:n,placedSide:$,onArrowChange:C,arrowX:we,arrowY:ce,shouldHideArrow:Pe,children:b.jsx(M.div,{"data-side":$,"data-align":K,...p,ref:x,style:{...p.style,animation:F?void 0:"none"}})})})});lo.displayName=Vt;var uo="PopperArrow",Es={top:"bottom",right:"left",bottom:"top",left:"right"},fo=c.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,i=bs(uo,o),s=Es[i.placedSide];return b.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:b.jsx(gs,{...r,ref:n,style:{...r.style,display:"block"}})})});fo.displayName=uo;function Cs(e){return e!==null}var Ts=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,s=r.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,f=s?0:e.arrowHeight,[l,u]=po(n),d={start:"0%",center:"50%",end:"100%"}[u],v=(r.arrow?.x??0)+a/2,h=(r.arrow?.y??0)+f/2;let w="",p="";return l==="bottom"?(w=s?d:`${v}px`,p=`${-f}px`):l==="top"?(w=s?d:`${v}px`,p=`${o.floating.height+f}px`):l==="right"?(w=`${-f}px`,p=s?d:`${h}px`):l==="left"&&(w=`${o.floating.width+f}px`,p=s?d:`${h}px`),{data:{x:w,y:p}}}});function po(e){const[t,n="center"]=e.split("-");return[t,n]}var Rc=so,Rs=co,As=lo,Ss=fo,[Qe,Ac]=se("Tooltip",[ro]),Bt=ro(),mo="TooltipProvider",Ps=700,pn="tooltip.open",[Os,vo]=Qe(mo),ho=e=>{const{__scopeTooltip:t,delayDuration:n=Ps,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:i}=e,s=c.useRef(!0),a=c.useRef(!1),f=c.useRef(0);return c.useEffect(()=>{const l=f.current;return()=>window.clearTimeout(l)},[]),b.jsx(Os,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:c.useCallback(()=>{window.clearTimeout(f.current),s.current=!1},[]),onClose:c.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>s.current=!0,o)},[o]),isPointerInTransitRef:a,onPointerInTransitChange:c.useCallback(l=>{a.current=l},[]),disableHoverableContent:r,children:i})};ho.displayName=mo;var go="Tooltip",[Sc,Je]=Qe(go),Ct="TooltipTrigger",Is=c.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Je(Ct,n),i=vo(Ct,n),s=Bt(n),a=c.useRef(null),f=V(t,a,r.onTriggerChange),l=c.useRef(!1),u=c.useRef(!1),d=c.useCallback(()=>l.current=!1,[]);return c.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),b.jsx(Rs,{asChild:!0,...s,children:b.jsx(M.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:f,onPointerMove:N(e.onPointerMove,v=>{v.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(r.onTriggerEnter(),u.current=!0)}),onPointerLeave:N(e.onPointerLeave,()=>{r.onTriggerLeave(),u.current=!1}),onPointerDown:N(e.onPointerDown,()=>{r.open&&r.onClose(),l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:N(e.onFocus,()=>{l.current||r.onOpen()}),onBlur:N(e.onBlur,r.onClose),onClick:N(e.onClick,r.onClose)})})});Is.displayName=Ct;var Ns="TooltipPortal",[Pc,_s]=Qe(Ns,{forceMount:void 0}),ve="TooltipContent",yo=c.forwardRef((e,t)=>{const n=_s(ve,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...i}=e,s=Je(ve,e.__scopeTooltip);return b.jsx(Ce,{present:o||s.open,children:s.disableHoverableContent?b.jsx(wo,{side:r,...i,ref:t}):b.jsx(Ds,{side:r,...i,ref:t})})}),Ds=c.forwardRef((e,t)=>{const n=Je(ve,e.__scopeTooltip),o=vo(ve,e.__scopeTooltip),r=c.useRef(null),i=V(t,r),[s,a]=c.useState(null),{trigger:f,onClose:l}=n,u=r.current,{onPointerInTransitChange:d}=o,v=c.useCallback(()=>{a(null),d(!1)},[d]),h=c.useCallback((w,p)=>{const m=w.currentTarget,y={x:w.clientX,y:w.clientY},g=js(y,m.getBoundingClientRect()),x=$s(y,g),E=Ws(p.getBoundingClientRect()),C=Bs([...x,...E]);a(C),d(!0)},[d]);return c.useEffect(()=>()=>v(),[v]),c.useEffect(()=>{if(f&&u){const w=m=>h(m,u),p=m=>h(m,f);return f.addEventListener("pointerleave",w),u.addEventListener("pointerleave",p),()=>{f.removeEventListener("pointerleave",w),u.removeEventListener("pointerleave",p)}}},[f,u,h,v]),c.useEffect(()=>{if(s){const w=p=>{const m=p.target,y={x:p.clientX,y:p.clientY},g=f?.contains(m)||u?.contains(m),x=!Vs(y,s);g?v():x&&(v(),l())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[f,u,s,l,v]),b.jsx(wo,{...e,ref:i})}),[Ms,Ls]=Qe(go,{isInside:!1}),Fs=gr("TooltipContent"),wo=c.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,f=Je(ve,n),l=Bt(n),{onClose:u}=f;return c.useEffect(()=>(document.addEventListener(pn,u),()=>document.removeEventListener(pn,u)),[u]),c.useEffect(()=>{if(f.trigger){const d=v=>{v.target?.contains(f.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[f.trigger,u]),b.jsx(Ot,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:b.jsxs(As,{"data-state":f.stateAttribute,...l,...a,ref:t,style:{...a.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:[b.jsx(Fs,{children:o}),b.jsx(Ms,{scope:n,isInside:!0,children:b.jsx(Wr,{id:f.contentId,role:"tooltip",children:r||o})})]})})});yo.displayName=ve;var xo="TooltipArrow",ks=c.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Bt(n);return Ls(xo,n).isInside?null:b.jsx(Ss,{...r,...o,ref:t})});ks.displayName=xo;function js(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function $s(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function Ws(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function Vs(e,t){const{x:n,y:o}=e;let r=!1;for(let i=0,s=t.length-1;io!=v>o&&n<(d-l)*(o-u)/(v-u)+l&&(r=!r)}return r}function Bs(e){const t=e.slice();return t.sort((n,o)=>n.xo.x?1:n.yo.y?1:0),Hs(t)}function Hs(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Oc=ho,Ic=yo,X=function(){return X=Object.assign||function(t){for(var n,o=1,r=arguments.length;o{const{__scopeCollapsible:n,open:o,defaultOpen:r,disabled:i,onOpenChange:s,...a}=e,[f,l]=he({prop:o,defaultProp:r??!1,onChange:s,caller:et});return b.jsx(zs,{scope:n,disabled:i,contentId:Ge(),open:f,onOpenToggle:c.useCallback(()=>l(u=>!u),[l]),children:b.jsx(M.div,{"data-state":Ut(f),"data-disabled":i?"":void 0,...a,ref:t})})});Co.displayName=et;var To="CollapsibleTrigger",Ro=c.forwardRef((e,t)=>{const{__scopeCollapsible:n,...o}=e,r=Ht(To,n);return b.jsx(M.button,{type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":Ut(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...o,ref:t,onClick:N(e.onClick,r.onOpenToggle)})});Ro.displayName=To;var Kt="CollapsibleContent",Ao=c.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=Ht(Kt,e.__scopeCollapsible);return b.jsx(Ce,{present:n||r.open,children:({present:i})=>b.jsx(Ys,{...o,ref:t,present:i})})});Ao.displayName=Kt;var Ys=c.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:o,children:r,...i}=e,s=Ht(Kt,n),[a,f]=c.useState(o),l=c.useRef(null),u=V(t,l),d=c.useRef(0),v=d.current,h=c.useRef(0),w=h.current,p=s.open||a,m=c.useRef(p),y=c.useRef(void 0);return c.useEffect(()=>{const g=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(g)},[]),Q(()=>{const g=l.current;if(g){y.current=y.current||{transitionDuration:g.style.transitionDuration,animationName:g.style.animationName},g.style.transitionDuration="0s",g.style.animationName="none";const x=g.getBoundingClientRect();d.current=x.height,h.current=x.width,m.current||(g.style.transitionDuration=y.current.transitionDuration,g.style.animationName=y.current.animationName),f(o)}},[s.open,o]),b.jsx(M.div,{"data-state":Ut(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!p,...i,ref:u,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style},children:p&&r})});function Ut(e){return e?"open":"closed"}var Gs=Co,Xs=Ro,qs=Ao,Zs=c.createContext(void 0);function zt(e){const t=c.useContext(Zs);return e||t||"ltr"}var G="Accordion",Qs=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Yt,Js,ea]=Pt(G),[tt,_c]=se(G,[ea,Eo]),Gt=Eo(),So=W.forwardRef((e,t)=>{const{type:n,...o}=e,r=o,i=o;return b.jsx(Yt.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?b.jsx(ra,{...i,ref:t}):b.jsx(oa,{...r,ref:t})})});So.displayName=G;var[Po,ta]=tt(G),[Oo,na]=tt(G,{collapsible:!1}),oa=W.forwardRef((e,t)=>{const{value:n,defaultValue:o,onValueChange:r=()=>{},collapsible:i=!1,...s}=e,[a,f]=he({prop:n,defaultProp:o??"",onChange:r,caller:G});return b.jsx(Po,{scope:e.__scopeAccordion,value:W.useMemo(()=>a?[a]:[],[a]),onItemOpen:f,onItemClose:W.useCallback(()=>i&&f(""),[i,f]),children:b.jsx(Oo,{scope:e.__scopeAccordion,collapsible:i,children:b.jsx(Io,{...s,ref:t})})})}),ra=W.forwardRef((e,t)=>{const{value:n,defaultValue:o,onValueChange:r=()=>{},...i}=e,[s,a]=he({prop:n,defaultProp:o??[],onChange:r,caller:G}),f=W.useCallback(u=>a((d=[])=>[...d,u]),[a]),l=W.useCallback(u=>a((d=[])=>d.filter(v=>v!==u)),[a]);return b.jsx(Po,{scope:e.__scopeAccordion,value:s,onItemOpen:f,onItemClose:l,children:b.jsx(Oo,{scope:e.__scopeAccordion,collapsible:!0,children:b.jsx(Io,{...i,ref:t})})})}),[ia,nt]=tt(G),Io=W.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:o,dir:r,orientation:i="vertical",...s}=e,a=W.useRef(null),f=V(a,t),l=Js(n),d=zt(r)==="ltr",v=N(e.onKeyDown,h=>{if(!Qs.includes(h.key))return;const w=h.target,p=l().filter(S=>!S.ref.current?.disabled),m=p.findIndex(S=>S.ref.current===w),y=p.length;if(m===-1)return;h.preventDefault();let g=m;const x=0,E=y-1,C=()=>{g=m+1,g>E&&(g=x)},R=()=>{g=m-1,g{const{__scopeAccordion:n,value:o,...r}=e,i=nt(Ue,n),s=ta(Ue,n),a=Gt(n),f=Ge(),l=o&&s.value.includes(o)||!1,u=i.disabled||e.disabled;return b.jsx(sa,{scope:n,open:l,disabled:u,triggerId:f,children:b.jsx(Gs,{"data-orientation":i.orientation,"data-state":ko(l),...a,...r,ref:t,disabled:u,open:l,onOpenChange:d=>{d?s.onItemOpen(o):s.onItemClose(o)}})})});No.displayName=Ue;var _o="AccordionHeader",Do=W.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,r=nt(G,n),i=Xt(_o,n);return b.jsx(M.h3,{"data-orientation":r.orientation,"data-state":ko(i.open),"data-disabled":i.disabled?"":void 0,...o,ref:t})});Do.displayName=_o;var Tt="AccordionTrigger",Mo=W.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,r=nt(G,n),i=Xt(Tt,n),s=na(Tt,n),a=Gt(n);return b.jsx(Yt.ItemSlot,{scope:n,children:b.jsx(Xs,{"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":r.orientation,id:i.triggerId,...a,...o,ref:t})})});Mo.displayName=Tt;var Lo="AccordionContent",Fo=W.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,r=nt(G,n),i=Xt(Lo,n),s=Gt(n);return b.jsx(qs,{role:"region","aria-labelledby":i.triggerId,"data-orientation":r.orientation,...s,...o,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});Fo.displayName=Lo;function ko(e){return e?"open":"closed"}var Dc=So,Mc=No,Lc=Do,Fc=Mo,kc=Fo,ct=0;function jc(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??mn()),document.body.insertAdjacentElement("beforeend",e[1]??mn()),ct++,()=>{ct===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ct--}},[])}function mn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var lt="focusScope.autoFocusOnMount",ut="focusScope.autoFocusOnUnmount",vn={bubbles:!1,cancelable:!0},aa="FocusScope",ca=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:i,...s}=e,[a,f]=c.useState(null),l=U(r),u=U(i),d=c.useRef(null),v=V(t,p=>f(p)),h=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(o){let p=function(x){if(h.paused||!a)return;const E=x.target;a.contains(E)?d.current=E:oe(d.current,{select:!0})},m=function(x){if(h.paused||!a)return;const E=x.relatedTarget;E!==null&&(a.contains(E)||oe(d.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const C of x)C.removedNodes.length>0&&oe(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",m);const g=new MutationObserver(y);return a&&g.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",m),g.disconnect()}}},[o,a,h.paused]),c.useEffect(()=>{if(a){gn.add(h);const p=document.activeElement;if(!a.contains(p)){const y=new CustomEvent(lt,vn);a.addEventListener(lt,l),a.dispatchEvent(y),y.defaultPrevented||(la(ma(jo(a)),{select:!0}),document.activeElement===p&&oe(a))}return()=>{a.removeEventListener(lt,l),setTimeout(()=>{const y=new CustomEvent(ut,vn);a.addEventListener(ut,u),a.dispatchEvent(y),y.defaultPrevented||oe(p??document.body,{select:!0}),a.removeEventListener(ut,u),gn.remove(h)},0)}}},[a,l,u,h]);const w=c.useCallback(p=>{if(!n&&!o||h.paused)return;const m=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(m&&y){const g=p.currentTarget,[x,E]=ua(g);x&&E?!p.shiftKey&&y===E?(p.preventDefault(),n&&oe(x,{select:!0})):p.shiftKey&&y===x&&(p.preventDefault(),n&&oe(E,{select:!0})):y===g&&p.preventDefault()}},[n,o,h.paused]);return b.jsx(M.div,{tabIndex:-1,...s,ref:v,onKeyDown:w})});ca.displayName=aa;function la(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(oe(o,{select:t}),document.activeElement!==n)return}function ua(e){const t=jo(e),n=hn(t,e),o=hn(t.reverse(),e);return[n,o]}function jo(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function hn(e,t){for(const n of e)if(!fa(n,{upTo:t}))return n}function fa(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function da(e){return e instanceof HTMLInputElement&&"select"in e}function oe(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&da(e)&&t&&e.select()}}var gn=pa();function pa(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=yn(e,t),e.unshift(t)},remove(t){e=yn(e,t),e[0]?.resume()}}}function yn(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function ma(e){return e.filter(t=>t.tagName!=="A")}var va=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},le=new WeakMap,De=new WeakMap,Me={},ft=0,$o=function(e){return e&&(e.host||$o(e.parentNode))},ha=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=$o(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ga=function(e,t,n,o){var r=ha(t,Array.isArray(e)?e:[e]);Me[n]||(Me[n]=new WeakMap);var i=Me[n],s=[],a=new Set,f=new Set(r),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};r.forEach(l);var u=function(d){!d||f.has(d)||Array.prototype.forEach.call(d.children,function(v){if(a.has(v))u(v);else try{var h=v.getAttribute(o),w=h!==null&&h!=="false",p=(le.get(v)||0)+1,m=(i.get(v)||0)+1;le.set(v,p),i.set(v,m),s.push(v),p===1&&w&&De.set(v,!0),m===1&&v.setAttribute(n,"true"),w||v.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",v,y)}})};return u(t),a.clear(),ft++,function(){s.forEach(function(d){var v=le.get(d)-1,h=i.get(d)-1;le.set(d,v),i.set(d,h),v||(De.has(d)||d.removeAttribute(o),De.delete(d)),h||d.removeAttribute(n)}),ft--,ft||(le=new WeakMap,le=new WeakMap,De=new WeakMap,Me={})}},$c=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=va(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live]"))),ga(o,r,n,"aria-hidden")):function(){return null}},je="right-scroll-bar-position",$e="width-before-scroll-bar",ya="with-scroll-bars-hidden",wa="--removed-body-scroll-bar-size";function dt(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function xa(e,t){var n=c.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var r=n.value;r!==o&&(n.value=o,n.callback(o,r))}}}})[0];return n.callback=t,n.facade}var ba=typeof window<"u"?c.useLayoutEffect:c.useEffect,wn=new WeakMap;function Ea(e,t){var n=xa(null,function(o){return e.forEach(function(r){return dt(r,o)})});return ba(function(){var o=wn.get(n);if(o){var r=new Set(o),i=new Set(e),s=n.current;r.forEach(function(a){i.has(a)||dt(a,null)}),i.forEach(function(a){r.has(a)||dt(a,s)})}wn.set(n,e)},[e]),n}function Ca(e){return e}function Ta(e,t){t===void 0&&(t=Ca);var n=[],o=!1,r={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,o);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(o=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){o=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var f=function(){var u=s;s=[],u.forEach(i)},l=function(){return Promise.resolve().then(f)};l(),n={push:function(u){s.push(u),l()},filter:function(u){return s=s.filter(u),n}}}};return r}function Ra(e){e===void 0&&(e={});var t=Ta(null);return t.options=X({async:!0,ssr:!1},e),t}var Wo=function(e){var t=e.sideCar,n=bo(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return c.createElement(o,X({},n))};Wo.isSideCarExport=!0;function Aa(e,t){return e.useMedium(t),Wo}var Vo=Ra(),pt=function(){},ot=c.forwardRef(function(e,t){var n=c.useRef(null),o=c.useState({onScrollCapture:pt,onWheelCapture:pt,onTouchMoveCapture:pt}),r=o[0],i=o[1],s=e.forwardProps,a=e.children,f=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,v=e.sideCar,h=e.noRelative,w=e.noIsolation,p=e.inert,m=e.allowPinchZoom,y=e.as,g=y===void 0?"div":y,x=e.gapMode,E=bo(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=v,R=Ea([n,t]),T=X(X({},E),r);return c.createElement(c.Fragment,null,u&&c.createElement(C,{sideCar:Vo,removeScrollBar:l,shards:d,noRelative:h,noIsolation:w,inert:p,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:x}),s?c.cloneElement(c.Children.only(a),X(X({},T),{ref:R})):c.createElement(g,X({},T,{className:f,ref:R}),a))});ot.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ot.classNames={fullWidth:$e,zeroRight:je};var Sa=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Pa(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Sa();return t&&e.setAttribute("nonce",t),e}function Oa(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ia(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Na=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Pa())&&(Oa(t,n),Ia(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},_a=function(){var e=Na();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Bo=function(){var e=_a(),t=function(n){var o=n.styles,r=n.dynamic;return e(o,r),null};return t},Da={left:0,top:0,right:0,gap:0},mt=function(e){return parseInt(e||"",10)||0},Ma=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[mt(n),mt(o),mt(r)]},La=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Da;var t=Ma(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},Fa=Bo(),pe="data-scroll-locked",ka=function(e,t,n,o){var r=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),` .`.concat(ya,` { overflow: hidden `).concat(o,`; padding-right: `).concat(a,"px ").concat(o,`; } body[`).concat(pe,`] { overflow: hidden `).concat(o,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&` padding-left: `.concat(r,`px; padding-top: `).concat(i,`px; padding-right: `).concat(s,`px; margin-left:0; margin-top:0; margin-right: `).concat(a,"px ").concat(o,`; `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(o,";")].filter(Boolean).join(""),` } .`).concat(je,` { right: `).concat(a,"px ").concat(o,`; } .`).concat($e,` { margin-right: `).concat(a,"px ").concat(o,`; } .`).concat(je," .").concat(je,` { right: 0 `).concat(o,`; } .`).concat($e," .").concat($e,` { margin-right: 0 `).concat(o,`; } body[`).concat(pe,`] { `).concat(wa,": ").concat(a,`px; } `)},xn=function(){var e=parseInt(document.body.getAttribute(pe)||"0",10);return isFinite(e)?e:0},ja=function(){c.useEffect(function(){return document.body.setAttribute(pe,(xn()+1).toString()),function(){var e=xn()-1;e<=0?document.body.removeAttribute(pe):document.body.setAttribute(pe,e.toString())}},[])},$a=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;ja();var i=c.useMemo(function(){return La(r)},[r]);return c.createElement(Fa,{styles:ka(i,!t,r,n?"":"!important")})},Rt=!1;if(typeof window<"u")try{var Le=Object.defineProperty({},"passive",{get:function(){return Rt=!0,!0}});window.addEventListener("test",Le,Le),window.removeEventListener("test",Le,Le)}catch{Rt=!1}var ue=Rt?{passive:!1}:!1,Wa=function(e){return e.tagName==="TEXTAREA"},Ho=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Wa(e)&&n[t]==="visible")},Va=function(e){return Ho(e,"overflowY")},Ba=function(e){return Ho(e,"overflowX")},bn=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=Ko(e,o);if(r){var i=Uo(e,o),s=i[1],a=i[2];if(s>a)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},Ha=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},Ka=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},Ko=function(e,t){return e==="v"?Va(t):Ba(t)},Uo=function(e,t){return e==="v"?Ha(t):Ka(t)},Ua=function(e,t){return e==="h"&&t==="rtl"?-1:1},za=function(e,t,n,o,r){var i=Ua(e,window.getComputedStyle(t).direction),s=i*o,a=n.target,f=t.contains(a),l=!1,u=s>0,d=0,v=0;do{if(!a)break;var h=Uo(e,a),w=h[0],p=h[1],m=h[2],y=p-m-i*w;(w||y)&&Ko(e,a)&&(d+=y,v+=w);var g=a.parentNode;a=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!f&&a!==document.body||f&&(t.contains(a)||t===a));return(u&&(Math.abs(d)<1||!r)||!u&&(Math.abs(v)<1||!r))&&(l=!0),l},Fe=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},En=function(e){return[e.deltaX,e.deltaY]},Cn=function(e){return e&&"current"in e?e.current:e},Ya=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ga=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},Xa=0,fe=[];function qa(e){var t=c.useRef([]),n=c.useRef([0,0]),o=c.useRef(),r=c.useState(Xa++)[0],i=c.useState(Bo)[0],s=c.useRef(e);c.useEffect(function(){s.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var p=Ks([e.lockRef.current],(e.shards||[]).map(Cn),!0).filter(Boolean);return p.forEach(function(m){return m.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),p.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var a=c.useCallback(function(p,m){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!s.current.allowPinchZoom;var y=Fe(p),g=n.current,x="deltaX"in p?p.deltaX:g[0]-y[0],E="deltaY"in p?p.deltaY:g[1]-y[1],C,R=p.target,T=Math.abs(x)>Math.abs(E)?"h":"v";if("touches"in p&&T==="h"&&R.type==="range")return!1;var S=bn(T,R);if(!S)return!0;if(S?C=T:(C=T==="v"?"h":"v",S=bn(T,R)),!S)return!1;if(!o.current&&"changedTouches"in p&&(x||E)&&(o.current=C),!C)return!0;var _=o.current||C;return za(_,m,p,_==="h"?x:E,!0)},[]),f=c.useCallback(function(p){var m=p;if(!(!fe.length||fe[fe.length-1]!==i)){var y="deltaY"in m?En(m):Fe(m),g=t.current.filter(function(C){return C.name===m.type&&(C.target===m.target||m.target===C.shadowParent)&&Ya(C.delta,y)})[0];if(g&&g.should){m.cancelable&&m.preventDefault();return}if(!g){var x=(s.current.shards||[]).map(Cn).filter(Boolean).filter(function(C){return C.contains(m.target)}),E=x.length>0?a(m,x[0]):!s.current.noIsolation;E&&m.cancelable&&m.preventDefault()}}},[]),l=c.useCallback(function(p,m,y,g){var x={name:p,delta:m,target:y,should:g,shadowParent:Za(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(E){return E!==x})},1)},[]),u=c.useCallback(function(p){n.current=Fe(p),o.current=void 0},[]),d=c.useCallback(function(p){l(p.type,En(p),p.target,a(p,e.lockRef.current))},[]),v=c.useCallback(function(p){l(p.type,Fe(p),p.target,a(p,e.lockRef.current))},[]);c.useEffect(function(){return fe.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:v}),document.addEventListener("wheel",f,ue),document.addEventListener("touchmove",f,ue),document.addEventListener("touchstart",u,ue),function(){fe=fe.filter(function(p){return p!==i}),document.removeEventListener("wheel",f,ue),document.removeEventListener("touchmove",f,ue),document.removeEventListener("touchstart",u,ue)}},[]);var h=e.removeScrollBar,w=e.inert;return c.createElement(c.Fragment,null,w?c.createElement(i,{styles:Ga(r)}):null,h?c.createElement($a,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Za(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Qa=Aa(Vo,qa);var Ja=c.forwardRef(function(e,t){return c.createElement(ot,X({},e,{ref:t,sideCar:Qa}))});Ja.classNames=ot.classNames;var vt="rovingFocusGroup.onEntryFocus",ec={bubbles:!1,cancelable:!0},Ae="RovingFocusGroup",[At,zo,tc]=Pt(Ae),[nc,Yo]=se(Ae,[tc]),[oc,rc]=nc(Ae),Go=c.forwardRef((e,t)=>b.jsx(At.Provider,{scope:e.__scopeRovingFocusGroup,children:b.jsx(At.Slot,{scope:e.__scopeRovingFocusGroup,children:b.jsx(ic,{...e,ref:t})})}));Go.displayName=Ae;var ic=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:f,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,v=c.useRef(null),h=V(t,v),w=zt(i),[p,m]=he({prop:s,defaultProp:a??null,onChange:f,caller:Ae}),[y,g]=c.useState(!1),x=U(l),E=zo(n),C=c.useRef(!1),[R,T]=c.useState(0);return c.useEffect(()=>{const S=v.current;if(S)return S.addEventListener(vt,x),()=>S.removeEventListener(vt,x)},[x]),b.jsx(oc,{scope:n,orientation:o,dir:w,loop:r,currentTabStopId:p,onItemFocus:c.useCallback(S=>m(S),[m]),onItemShiftTab:c.useCallback(()=>g(!0),[]),onFocusableItemAdd:c.useCallback(()=>T(S=>S+1),[]),onFocusableItemRemove:c.useCallback(()=>T(S=>S-1),[]),children:b.jsx(M.div,{tabIndex:y||R===0?-1:0,"data-orientation":o,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:N(e.onMouseDown,()=>{C.current=!0}),onFocus:N(e.onFocus,S=>{const _=!C.current;if(S.target===S.currentTarget&&_&&!y){const I=new CustomEvent(vt,ec);if(S.currentTarget.dispatchEvent(I),!I.defaultPrevented){const D=E().filter(O=>O.focusable),j=D.find(O=>O.active),k=D.find(O=>O.id===p),L=[j,k,...D].filter(Boolean).map(O=>O.ref.current);Zo(L,u)}}C.current=!1}),onBlur:N(e.onBlur,()=>g(!1))})})}),Xo="RovingFocusGroupItem",qo=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:i,children:s,...a}=e,f=Ge(),l=i||f,u=rc(Xo,n),d=u.currentTabStopId===l,v=zo(n),{onFocusableItemAdd:h,onFocusableItemRemove:w,currentTabStopId:p}=u;return c.useEffect(()=>{if(o)return h(),()=>w()},[o,h,w]),b.jsx(At.ItemSlot,{scope:n,id:l,focusable:o,active:r,children:b.jsx(M.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:N(e.onMouseDown,m=>{o?u.onItemFocus(l):m.preventDefault()}),onFocus:N(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:N(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){u.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const y=cc(m,u.orientation,u.dir);if(y!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let x=v().filter(E=>E.focusable).map(E=>E.ref.current);if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const E=x.indexOf(m.currentTarget);x=u.loop?lc(x,E+1):x.slice(E+1)}setTimeout(()=>Zo(x))}}),children:typeof s=="function"?s({isCurrentTabStop:d,hasTabStop:p!=null}):s})})});qo.displayName=Xo;var sc={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ac(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function cc(e,t,n){const o=ac(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return sc[o]}function Zo(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function lc(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var uc=Go,fc=qo,rt="Tabs",[dc,Wc]=se(rt,[Yo]),Qo=Yo(),[pc,qt]=dc(rt),Jo=c.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:f="automatic",...l}=e,u=zt(a),[d,v]=he({prop:o,onChange:r,defaultProp:i??"",caller:rt});return b.jsx(pc,{scope:n,baseId:Ge(),value:d,onValueChange:v,orientation:s,dir:u,activationMode:f,children:b.jsx(M.div,{dir:u,"data-orientation":s,...l,ref:t})})});Jo.displayName=rt;var er="TabsList",tr=c.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,i=qt(er,n),s=Qo(n);return b.jsx(uc,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:o,children:b.jsx(M.div,{role:"tablist","aria-orientation":i.orientation,...r,ref:t})})});tr.displayName=er;var nr="TabsTrigger",or=c.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...i}=e,s=qt(nr,n),a=Qo(n),f=sr(s.baseId,o),l=ar(s.baseId,o),u=o===s.value;return b.jsx(fc,{asChild:!0,...a,focusable:!r,active:u,children:b.jsx(M.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":l,"data-state":u?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:f,...i,ref:t,onMouseDown:N(e.onMouseDown,d=>{!r&&d.button===0&&d.ctrlKey===!1?s.onValueChange(o):d.preventDefault()}),onKeyDown:N(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(o)}),onFocus:N(e.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!r&&d&&s.onValueChange(o)})})})});or.displayName=nr;var rr="TabsContent",ir=c.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:r,children:i,...s}=e,a=qt(rr,n),f=sr(a.baseId,o),l=ar(a.baseId,o),u=o===a.value,d=c.useRef(u);return c.useEffect(()=>{const v=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(v)},[]),b.jsx(Ce,{present:r||u,children:({present:v})=>b.jsx(M.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":f,hidden:!v,id:l,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:v&&i})})});ir.displayName=rr;function sr(e,t){return`${e}-trigger-${t}`}function ar(e,t){return`${e}-content-${t}`}var Vc=Jo,Bc=tr,Hc=or,Kc=ir;export{Cc as A,Nn as B,Tc as C,Ec as D,We as E,ca as F,zt as G,Lc as H,Mc as I,Rc as J,Hc as K,Bc as L,Kc as M,Vc as N,yc as P,xc as R,hc as S,bc as T,wc as V,Nc as _,bo as a,Ic as b,Oc as c,M as d,Fc as e,kc as f,Dc as g,se as h,N as i,Ce as j,ys as k,he as l,Pt as m,ro as n,Rs as o,Q as p,$c as q,jc as r,Ja as s,Ot as t,V as u,As as v,Ge as w,Ss as x,jr as y,U as z};