@meridianjs/admin-dashboard 0.1.8 → 0.1.10

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.
@@ -1,4 +1,4 @@
1
- import{r as s,a as at,R as Wn,b as Js,c as Ne}from"./vendor-react-ChOmrACb.js";import{j as m}from"./vendor-query-DOje7EXl.js";function P(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function pr(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function X(...e){return t=>{let n=!1;const r=e.map(o=>{const i=pr(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():pr(e[o],null)}}}}function $(...e){return s.useCallback(X(...e),e)}function ec(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,tc(o,...t)]}function tc(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function nc(e){const t=rc(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(ic);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function rc(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=cc(o),c=sc(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var oc=Symbol("radix.slottable");function ic(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===oc}function sc(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function cc(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ac=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Br=ac.reduce((e,t)=>{const n=nc(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function lc(e,t){e&&at.flushSync(()=>e.dispatchEvent(t))}function Z(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function uc(e,t=globalThis==null?void 0:globalThis.document){const n=Z(e);s.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var fc="DismissableLayer",Pn="dismissableLayer.update",dc="dismissableLayer.pointerDownOutside",pc="dismissableLayer.focusOutside",mr,Hr=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xe=s.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:c,...l}=e,u=s.useContext(Hr),[d,f]=s.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=s.useState({}),g=$(t,b=>f(b)),v=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=v.indexOf(y),w=d?v.indexOf(d):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,C=w>=x,E=hc(b=>{const A=b.target,T=[...u.branches].some(O=>O.contains(A));!C||T||(o==null||o(b),a==null||a(b),b.defaultPrevented||c==null||c())},p),R=gc(b=>{const A=b.target;[...u.branches].some(O=>O.contains(A))||(i==null||i(b),a==null||a(b),b.defaultPrevented||c==null||c())},p);return uc(b=>{w===u.layers.size-1&&(r==null||r(b),!b.defaultPrevented&&c&&(b.preventDefault(),c()))},p),s.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(mr=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),vr(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=mr)}},[d,p,n,u]),s.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),vr())},[d,u]),s.useEffect(()=>{const b=()=>h({});return document.addEventListener(Pn,b),()=>document.removeEventListener(Pn,b)},[]),m.jsx(Br.div,{...l,ref:g,style:{pointerEvents:S?C?"auto":"none":void 0,...e.style},onFocusCapture:P(e.onFocusCapture,R.onFocusCapture),onBlurCapture:P(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:P(e.onPointerDownCapture,E.onPointerDownCapture)})});Xe.displayName=fc;var mc="DismissableLayerBranch",vc=s.forwardRef((e,t)=>{const n=s.useContext(Hr),r=s.useRef(null),o=$(t,r);return s.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),m.jsx(Br.div,{...e,ref:o})});vc.displayName=mc;function hc(e,t=globalThis==null?void 0:globalThis.document){const n=Z(e),r=s.useRef(!1),o=s.useRef(()=>{});return s.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let l=function(){Ur(dc,n,u,{discrete:!0})};const u={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function gc(e,t=globalThis==null?void 0:globalThis.document){const n=Z(e),r=s.useRef(!1);return s.useEffect(()=>{const o=i=>{i.target&&!r.current&&Ur(pc,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function vr(){const e=new CustomEvent(Pn);document.dispatchEvent(e)}function Ur(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?lc(o,i):o.dispatchEvent(i)}var Y=globalThis!=null&&globalThis.document?s.useLayoutEffect:()=>{},yc=Wn[" useId ".trim().toString()]||(()=>{}),xc=0;function le(e){const[t,n]=s.useState(yc());return Y(()=>{n(r=>r??String(xc++))},[e]),t?`radix-${t}`:""}const wc=["top","right","bottom","left"],Pe=Math.min,ne=Math.max,It=Math.round,bt=Math.floor,he=e=>({x:e,y:e}),Sc={left:"right",right:"left",bottom:"top",top:"bottom"},Cc={start:"end",end:"start"};function Rn(e,t,n){return ne(e,Pe(t,n))}function Ce(e,t){return typeof e=="function"?e(t):e}function be(e){return e.split("-")[0]}function Ze(e){return e.split("-")[1]}function Vn(e){return e==="x"?"y":"x"}function Bn(e){return e==="y"?"height":"width"}const bc=new Set(["top","bottom"]);function ve(e){return bc.has(be(e))?"y":"x"}function Hn(e){return Vn(ve(e))}function Ec(e,t,n){n===void 0&&(n=!1);const r=Ze(e),o=Hn(e),i=Bn(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Mt(a)),[a,Mt(a)]}function Pc(e){const t=Mt(e);return[_n(e),t,_n(t)]}function _n(e){return e.replace(/start|end/g,t=>Cc[t])}const hr=["left","right"],gr=["right","left"],Rc=["top","bottom"],_c=["bottom","top"];function Ac(e,t,n){switch(e){case"top":case"bottom":return n?t?gr:hr:t?hr:gr;case"left":case"right":return t?Rc:_c;default:return[]}}function Tc(e,t,n,r){const o=Ze(e);let i=Ac(be(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(_n)))),i}function Mt(e){return e.replace(/left|right|bottom|top/g,t=>Sc[t])}function Oc(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kr(e){return typeof e!="number"?Oc(e):{top:e,right:e,bottom:e,left:e}}function Dt(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function yr(e,t,n){let{reference:r,floating:o}=e;const i=ve(t),a=Hn(t),c=Bn(a),l=be(t),u=i==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[c]/2-o[c]/2;let h;switch(l){case"top":h={x:d,y:r.y-o.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Ze(t)){case"start":h[a]-=p*(n&&u?-1:1);break;case"end":h[a]+=p*(n&&u?-1:1);break}return h}async function Nc(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:c,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=Ce(t,e),g=Kr(h),y=c[p?f==="floating"?"reference":"floating":f],x=Dt(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:u,rootBoundary:d,strategy:l})),w=f==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),C=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},E=Dt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:S,strategy:l}):w);return{top:(x.top-E.top+g.top)/C.y,bottom:(E.bottom-x.bottom+g.bottom)/C.y,left:(x.left-E.left+g.left)/C.x,right:(E.right-x.right+g.right)/C.x}}const Ic=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,c=i.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=yr(u,r,l),p=r,h={},g=0;for(let y=0;y<c.length;y++){var v;const{name:x,fn:w}=c[y],{x:S,y:C,data:E,reset:R}=await w({x:d,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:u,platform:{...a,detectOverflow:(v=a.detectOverflow)!=null?v:Nc},elements:{reference:e,floating:t}});d=S??d,f=C??f,h={...h,[x]:{...h[x],...E}},R&&g<=50&&(g++,typeof R=="object"&&(R.placement&&(p=R.placement),R.rects&&(u=R.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):R.rects),{x:d,y:f}=yr(u,p,l)),y=-1)}return{x:d,y:f,placement:p,strategy:o,middlewareData:h}},Mc=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:c,middlewareData:l}=t,{element:u,padding:d=0}=Ce(e,t)||{};if(u==null)return{};const f=Kr(d),p={x:n,y:r},h=Hn(o),g=Bn(h),v=await a.getDimensions(u),y=h==="y",x=y?"top":"left",w=y?"bottom":"right",S=y?"clientHeight":"clientWidth",C=i.reference[g]+i.reference[h]-p[h]-i.floating[g],E=p[h]-i.reference[h],R=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let b=R?R[S]:0;(!b||!await(a.isElement==null?void 0:a.isElement(R)))&&(b=c.floating[S]||i.floating[g]);const A=C/2-E/2,T=b/2-v[g]/2-1,O=Pe(f[x],T),D=Pe(f[w],T),L=O,F=b-v[g]-D,j=b/2-v[g]/2+A,U=Rn(L,j,F),M=!l.arrow&&Ze(o)!=null&&j!==U&&i.reference[g]/2-(j<L?O:D)-v[g]/2<0,k=M?j<L?j-L:j-F:0;return{[h]:p[h]+k,data:{[h]:U,centerOffset:j-U-k,...M&&{alignmentOffset:k}},reset:M}}}),Dc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:c,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...y}=Ce(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=be(o),w=ve(c),S=be(c)===c,C=await(l.isRTL==null?void 0:l.isRTL(u.floating)),E=p||(S||!v?[Mt(c)]:Pc(c)),R=g!=="none";!p&&R&&E.push(...Tc(c,v,g,C));const b=[c,...E],A=await l.detectOverflow(t,y),T=[];let O=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&T.push(A[x]),f){const j=Ec(o,a,C);T.push(A[j[0]],A[j[1]])}if(O=[...O,{placement:o,overflows:T}],!T.every(j=>j<=0)){var D,L;const j=(((D=i.flip)==null?void 0:D.index)||0)+1,U=b[j];if(U&&(!(f==="alignment"?w!==ve(U):!1)||O.every(N=>ve(N.placement)===w?N.overflows[0]>0:!0)))return{data:{index:j,overflows:O},reset:{placement:U}};let M=(L=O.filter(k=>k.overflows[0]<=0).sort((k,N)=>k.overflows[1]-N.overflows[1])[0])==null?void 0:L.placement;if(!M)switch(h){case"bestFit":{var F;const k=(F=O.filter(N=>{if(R){const _=ve(N.placement);return _===w||_==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(_=>_>0).reduce((_,K)=>_+K,0)]).sort((N,_)=>N[1]-_[1])[0])==null?void 0:F[0];k&&(M=k);break}case"initialPlacement":M=c;break}if(o!==M)return{reset:{placement:M}}}return{}}}};function xr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wr(e){return wc.some(t=>e[t]>=0)}const $c=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=Ce(e,t);switch(o){case"referenceHidden":{const a=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=xr(a,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:wr(c)}}}case"escaped":{const a=await r.detectOverflow(t,{...i,altBoundary:!0}),c=xr(a,n.floating);return{data:{escapedOffsets:c,escaped:wr(c)}}}default:return{}}}}},Gr=new Set(["left","top"]);async function jc(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=be(n),c=Ze(n),l=ve(n)==="y",u=Gr.has(a)?-1:1,d=i&&l?-1:1,f=Ce(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof g=="number"&&(h=c==="end"?g*-1:g),l?{x:h*d,y:p*u}:{x:p*u,y:h*d}}const Lc=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:c}=t,l=await jc(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},Fc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:a=!0,crossAxis:c=!1,limiter:l={fn:x=>{let{x:w,y:S}=x;return{x:w,y:S}}},...u}=Ce(e,t),d={x:n,y:r},f=await i.detectOverflow(t,u),p=ve(be(o)),h=Vn(p);let g=d[h],v=d[p];if(a){const x=h==="y"?"top":"left",w=h==="y"?"bottom":"right",S=g+f[x],C=g-f[w];g=Rn(S,g,C)}if(c){const x=p==="y"?"top":"left",w=p==="y"?"bottom":"right",S=v+f[x],C=v-f[w];v=Rn(S,v,C)}const y=l.fn({...t,[h]:g,[p]:v});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[h]:a,[p]:c}}}}}},kc=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:c=0,mainAxis:l=!0,crossAxis:u=!0}=Ce(e,t),d={x:n,y:r},f=ve(o),p=Vn(f);let h=d[p],g=d[f];const v=Ce(c,t),y=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const S=p==="y"?"height":"width",C=i.reference[p]-i.floating[S]+y.mainAxis,E=i.reference[p]+i.reference[S]-y.mainAxis;h<C?h=C:h>E&&(h=E)}if(u){var x,w;const S=p==="y"?"width":"height",C=Gr.has(be(o)),E=i.reference[f]-i.floating[S]+(C&&((x=a.offset)==null?void 0:x[f])||0)+(C?0:y.crossAxis),R=i.reference[f]+i.reference[S]+(C?0:((w=a.offset)==null?void 0:w[f])||0)-(C?y.crossAxis:0);g<E?g=E:g>R&&(g=R)}return{[p]:h,[f]:g}}}},Wc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:c}=t,{apply:l=()=>{},...u}=Ce(e,t),d=await a.detectOverflow(t,u),f=be(o),p=Ze(o),h=ve(o)==="y",{width:g,height:v}=i.floating;let y,x;f==="top"||f==="bottom"?(y=f,x=p===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(x=f,y=p==="end"?"top":"bottom");const w=v-d.top-d.bottom,S=g-d.left-d.right,C=Pe(v-d[y],w),E=Pe(g-d[x],S),R=!t.middlewareData.shift;let b=C,A=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(b=w),R&&!p){const O=ne(d.left,0),D=ne(d.right,0),L=ne(d.top,0),F=ne(d.bottom,0);h?A=g-2*(O!==0||D!==0?O+D:ne(d.left,d.right)):b=v-2*(L!==0||F!==0?L+F:ne(d.top,d.bottom))}await l({...t,availableWidth:A,availableHeight:b});const T=await a.getDimensions(c.floating);return g!==T.width||v!==T.height?{reset:{rects:!0}}:{}}}};function Ht(){return typeof window<"u"}function qe(e){return zr(e)?(e.nodeName||"").toLowerCase():"#document"}function re(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ye(e){var t;return(t=(zr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function zr(e){return Ht()?e instanceof Node||e instanceof re(e).Node:!1}function ue(e){return Ht()?e instanceof Element||e instanceof re(e).Element:!1}function ge(e){return Ht()?e instanceof HTMLElement||e instanceof re(e).HTMLElement:!1}function Sr(e){return!Ht()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof re(e).ShadowRoot}const Vc=new Set(["inline","contents"]);function lt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=fe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Vc.has(o)}const Bc=new Set(["table","td","th"]);function Hc(e){return Bc.has(qe(e))}const Uc=[":popover-open",":modal"];function Ut(e){return Uc.some(t=>{try{return e.matches(t)}catch{return!1}})}const Kc=["transform","translate","scale","rotate","perspective"],Gc=["transform","translate","scale","rotate","perspective","filter"],zc=["paint","layout","strict","content"];function Un(e){const t=Kn(),n=ue(e)?fe(e):e;return Kc.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Gc.some(r=>(n.willChange||"").includes(r))||zc.some(r=>(n.contain||"").includes(r))}function Yc(e){let t=Re(e);for(;ge(t)&&!Ue(t);){if(Un(t))return t;if(Ut(t))return null;t=Re(t)}return null}function Kn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Xc=new Set(["html","body","#document"]);function Ue(e){return Xc.has(qe(e))}function fe(e){return re(e).getComputedStyle(e)}function Kt(e){return ue(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Re(e){if(qe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Sr(e)&&e.host||ye(e);return Sr(t)?t.host:t}function Yr(e){const t=Re(e);return Ue(t)?e.ownerDocument?e.ownerDocument.body:e.body:ge(t)&&lt(t)?t:Yr(t)}function ot(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Yr(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=re(o);if(i){const c=An(a);return t.concat(a,a.visualViewport||[],lt(o)?o:[],c&&n?ot(c):[])}return t.concat(o,ot(o,[],n))}function An(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xr(e){const t=fe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ge(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,c=It(n)!==i||It(r)!==a;return c&&(n=i,r=a),{width:n,height:r,$:c}}function Gn(e){return ue(e)?e:e.contextElement}function Be(e){const t=Gn(e);if(!ge(t))return he(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Xr(t);let a=(i?It(n.width):n.width)/r,c=(i?It(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const Zc=he(0);function Zr(e){const t=re(e);return!Kn()||!t.visualViewport?Zc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==re(e)?!1:t}function Ie(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Gn(e);let a=he(1);t&&(r?ue(r)&&(a=Be(r)):a=Be(e));const c=qc(i,n,r)?Zr(i):he(0);let l=(o.left+c.x)/a.x,u=(o.top+c.y)/a.y,d=o.width/a.x,f=o.height/a.y;if(i){const p=re(i),h=r&&ue(r)?re(r):r;let g=p,v=An(g);for(;v&&r&&h!==g;){const y=Be(v),x=v.getBoundingClientRect(),w=fe(v),S=x.left+(v.clientLeft+parseFloat(w.paddingLeft))*y.x,C=x.top+(v.clientTop+parseFloat(w.paddingTop))*y.y;l*=y.x,u*=y.y,d*=y.x,f*=y.y,l+=S,u+=C,g=re(v),v=An(g)}}return Dt({width:d,height:f,x:l,y:u})}function Gt(e,t){const n=Kt(e).scrollLeft;return t?t.left+n:Ie(ye(e)).left+n}function qr(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Gt(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Qc(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=ye(r),c=t?Ut(t.floating):!1;if(r===a||c&&i)return n;let l={scrollLeft:0,scrollTop:0},u=he(1);const d=he(0),f=ge(r);if((f||!f&&!i)&&((qe(r)!=="body"||lt(a))&&(l=Kt(r)),ge(r))){const h=Ie(r);u=Be(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const p=a&&!f&&!i?qr(a,l):he(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function Jc(e){return Array.from(e.getClientRects())}function ea(e){const t=ye(e),n=Kt(e),r=e.ownerDocument.body,o=ne(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ne(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Gt(e);const c=-n.scrollTop;return fe(r).direction==="rtl"&&(a+=ne(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:c}}const Cr=25;function ta(e,t){const n=re(e),r=ye(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,c=0,l=0;if(o){i=o.width,a=o.height;const d=Kn();(!d||d&&t==="fixed")&&(c=o.offsetLeft,l=o.offsetTop)}const u=Gt(r);if(u<=0){const d=r.ownerDocument,f=d.body,p=getComputedStyle(f),h=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-h);g<=Cr&&(i-=g)}else u<=Cr&&(i+=u);return{width:i,height:a,x:c,y:l}}const na=new Set(["absolute","fixed"]);function ra(e,t){const n=Ie(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ge(e)?Be(e):he(1),a=e.clientWidth*i.x,c=e.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:a,height:c,x:l,y:u}}function br(e,t,n){let r;if(t==="viewport")r=ta(e,n);else if(t==="document")r=ea(ye(e));else if(ue(t))r=ra(t,n);else{const o=Zr(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Dt(r)}function Qr(e,t){const n=Re(e);return n===t||!ue(n)||Ue(n)?!1:fe(n).position==="fixed"||Qr(n,t)}function oa(e,t){const n=t.get(e);if(n)return n;let r=ot(e,[],!1).filter(c=>ue(c)&&qe(c)!=="body"),o=null;const i=fe(e).position==="fixed";let a=i?Re(e):e;for(;ue(a)&&!Ue(a);){const c=fe(a),l=Un(a);!l&&c.position==="fixed"&&(o=null),(i?!l&&!o:!l&&c.position==="static"&&!!o&&na.has(o.position)||lt(a)&&!l&&Qr(e,a))?r=r.filter(d=>d!==a):o=c,a=Re(a)}return t.set(e,r),r}function ia(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?Ut(t)?[]:oa(t,this._c):[].concat(n),r],c=a[0],l=a.reduce((u,d)=>{const f=br(t,d,o);return u.top=ne(f.top,u.top),u.right=Pe(f.right,u.right),u.bottom=Pe(f.bottom,u.bottom),u.left=ne(f.left,u.left),u},br(t,c,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function sa(e){const{width:t,height:n}=Xr(e);return{width:t,height:n}}function ca(e,t,n){const r=ge(t),o=ye(t),i=n==="fixed",a=Ie(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const l=he(0);function u(){l.x=Gt(o)}if(r||!r&&!i)if((qe(t)!=="body"||lt(o))&&(c=Kt(t)),r){const h=Ie(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&u();i&&!r&&o&&u();const d=o&&!r&&!i?qr(o,c):he(0),f=a.left+c.scrollLeft-l.x-d.x,p=a.top+c.scrollTop-l.y-d.y;return{x:f,y:p,width:a.width,height:a.height}}function mn(e){return fe(e).position==="static"}function Er(e,t){if(!ge(e)||fe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ye(e)===n&&(n=n.ownerDocument.body),n}function Jr(e,t){const n=re(e);if(Ut(e))return n;if(!ge(e)){let o=Re(e);for(;o&&!Ue(o);){if(ue(o)&&!mn(o))return o;o=Re(o)}return n}let r=Er(e,t);for(;r&&Hc(r)&&mn(r);)r=Er(r,t);return r&&Ue(r)&&mn(r)&&!Un(r)?n:r||Yc(e)||n}const aa=async function(e){const t=this.getOffsetParent||Jr,n=this.getDimensions,r=await n(e.floating);return{reference:ca(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function la(e){return fe(e).direction==="rtl"}const ua={convertOffsetParentRelativeRectToViewportRelativeRect:Qc,getDocumentElement:ye,getClippingRect:ia,getOffsetParent:Jr,getElementRects:aa,getClientRects:Jc,getDimensions:sa,getScale:Be,isElement:ue,isRTL:la};function eo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fa(e,t){let n=null,r;const o=ye(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),i();const u=e.getBoundingClientRect(),{left:d,top:f,width:p,height:h}=u;if(c||t(),!p||!h)return;const g=bt(f),v=bt(o.clientWidth-(d+p)),y=bt(o.clientHeight-(f+h)),x=bt(d),S={rootMargin:-g+"px "+-v+"px "+-y+"px "+-x+"px",threshold:ne(0,Pe(1,l))||1};let C=!0;function E(R){const b=R[0].intersectionRatio;if(b!==l){if(!C)return a();b?a(!1,b):r=setTimeout(()=>{a(!1,1e-7)},1e3)}b===1&&!eo(u,e.getBoundingClientRect())&&a(),C=!1}try{n=new IntersectionObserver(E,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,S)}n.observe(e)}return a(!0),i}function da(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Gn(e),d=o||i?[...u?ot(u):[],...ot(t)]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const f=u&&c?fa(u,n):null;let p=-1,h=null;a&&(h=new ResizeObserver(x=>{let[w]=x;w&&w.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let g,v=l?Ie(e):null;l&&y();function y(){const x=Ie(e);v&&!eo(v,x)&&n(),v=x,g=requestAnimationFrame(y)}return n(),()=>{var x;d.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),f==null||f(),(x=h)==null||x.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const pa=Lc,ma=Fc,va=Dc,ha=Wc,ga=$c,Pr=Mc,ya=kc,xa=(e,t,n)=>{const r=new Map,o={platform:ua,...n},i={...o.platform,_c:r};return Ic(e,t,{...o,platform:i})};var wa=typeof document<"u",Sa=function(){},Tt=wa?s.useLayoutEffect:Sa;function $t(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,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!$t(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!$t(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 Rr(e,t){const n=to(e);return Math.round(t*n)/n}function vn(e){const t=s.useRef(e);return Tt(()=>{t.current=e}),t}function Ca(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=s.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=s.useState(r);$t(p,r)||h(r);const[g,v]=s.useState(null),[y,x]=s.useState(null),w=s.useCallback(N=>{N!==R.current&&(R.current=N,v(N))},[]),S=s.useCallback(N=>{N!==b.current&&(b.current=N,x(N))},[]),C=i||g,E=a||y,R=s.useRef(null),b=s.useRef(null),A=s.useRef(d),T=l!=null,O=vn(l),D=vn(o),L=vn(u),F=s.useCallback(()=>{if(!R.current||!b.current)return;const N={placement:t,strategy:n,middleware:p};D.current&&(N.platform=D.current),xa(R.current,b.current,N).then(_=>{const K={..._,isPositioned:L.current!==!1};j.current&&!$t(A.current,K)&&(A.current=K,at.flushSync(()=>{f(K)}))})},[p,t,n,D,L]);Tt(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,f(N=>({...N,isPositioned:!1})))},[u]);const j=s.useRef(!1);Tt(()=>(j.current=!0,()=>{j.current=!1}),[]),Tt(()=>{if(C&&(R.current=C),E&&(b.current=E),C&&E){if(O.current)return O.current(C,E,F);F()}},[C,E,F,O,T]);const U=s.useMemo(()=>({reference:R,floating:b,setReference:w,setFloating:S}),[w,S]),M=s.useMemo(()=>({reference:C,floating:E}),[C,E]),k=s.useMemo(()=>{const N={position:n,left:0,top:0};if(!M.floating)return N;const _=Rr(M.floating,d.x),K=Rr(M.floating,d.y);return c?{...N,transform:"translate("+_+"px, "+K+"px)",...to(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:K}},[n,c,M.floating,d.x,d.y]);return s.useMemo(()=>({...d,update:F,refs:U,elements:M,floatingStyles:k}),[d,F,U,M,k])}const ba=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Pr({element:r.current,padding:o}).fn(n):{}:r?Pr({element:r,padding:o}).fn(n):{}}}},Ea=(e,t)=>({...pa(e),options:[e,t]}),Pa=(e,t)=>({...ma(e),options:[e,t]}),Ra=(e,t)=>({...ya(e),options:[e,t]}),_a=(e,t)=>({...va(e),options:[e,t]}),Aa=(e,t)=>({...ha(e),options:[e,t]}),Ta=(e,t)=>({...ga(e),options:[e,t]}),Oa=(e,t)=>({...ba(e),options:[e,t]});function Na(e){const t=Ia(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Da);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Ia(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=ja(o),c=$a(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ma=Symbol("radix.slottable");function Da(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ma}function $a(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function ja(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var La=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Fa=La.reduce((e,t)=>{const n=Na(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),ka="Arrow",no=s.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return m.jsx(Fa.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});no.displayName=ka;var Wa=no;function Va(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,Ba(o,...t)]}function Ba(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Ha(e){const t=Ua(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Ga);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Ua(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=Ya(o),c=za(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ka=Symbol("radix.slottable");function Ga(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ka}function za(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Ya(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xa=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ro=Xa.reduce((e,t)=>{const n=Ha(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Za(e){const[t,n]=s.useState(void 0);return Y(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,c;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,c=u.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var zn="Popper",[oo,_e]=Va(zn),[qa,io]=oo(zn),so=e=>{const{__scopePopper:t,children:n}=e,[r,o]=s.useState(null);return m.jsx(qa,{scope:t,anchor:r,onAnchorChange:o,children:n})};so.displayName=zn;var co="PopperAnchor",ao=s.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=io(co,n),a=s.useRef(null),c=$(t,a),l=s.useRef(null);return s.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||a.current,u!==l.current&&i.onAnchorChange(l.current)}),r?null:m.jsx(ro.div,{...o,ref:c})});ao.displayName=co;var Yn="PopperContent",[Qa,Ja]=oo(Yn),lo=s.forwardRef((e,t)=>{var I,V,G,W,B,H;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:g,...v}=e,y=io(Yn,n),[x,w]=s.useState(null),S=$(t,te=>w(te)),[C,E]=s.useState(null),R=Za(C),b=(R==null?void 0:R.width)??0,A=(R==null?void 0:R.height)??0,T=r+(i!=="center"?"-"+i:""),O=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},D=Array.isArray(u)?u:[u],L=D.length>0,F={padding:O,boundary:D.filter(tl),altBoundary:L},{refs:j,floatingStyles:U,placement:M,isPositioned:k,middlewareData:N}=Ca({strategy:"fixed",placement:T,whileElementsMounted:(...te)=>da(...te,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[Ea({mainAxis:o+A,alignmentAxis:a}),l&&Pa({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Ra():void 0,...F}),l&&_a({...F}),Aa({...F,apply:({elements:te,rects:pe,availableWidth:Je,availableHeight:et})=>{const{width:tt,height:Qs}=pe.reference,Ct=te.floating.style;Ct.setProperty("--radix-popper-available-width",`${Je}px`),Ct.setProperty("--radix-popper-available-height",`${et}px`),Ct.setProperty("--radix-popper-anchor-width",`${tt}px`),Ct.setProperty("--radix-popper-anchor-height",`${Qs}px`)}}),C&&Oa({element:C,padding:c}),nl({arrowWidth:b,arrowHeight:A}),p&&Ta({strategy:"referenceHidden",...F})]}),[_,K]=po(M),z=Z(g);Y(()=>{k&&(z==null||z())},[k,z]);const J=(I=N.arrow)==null?void 0:I.x,we=(V=N.arrow)==null?void 0:V.y,ie=((G=N.arrow)==null?void 0:G.centerOffset)!==0,[Se,ee]=s.useState();return Y(()=>{x&&ee(window.getComputedStyle(x).zIndex)},[x]),m.jsx("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:k?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Se,"--radix-popper-transform-origin":[(W=N.transformOrigin)==null?void 0:W.x,(B=N.transformOrigin)==null?void 0:B.y].join(" "),...((H=N.hide)==null?void 0:H.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:m.jsx(Qa,{scope:n,placedSide:_,onArrowChange:E,arrowX:J,arrowY:we,shouldHideArrow:ie,children:m.jsx(ro.div,{"data-side":_,"data-align":K,...v,ref:S,style:{...v.style,animation:k?void 0:"none"}})})})});lo.displayName=Yn;var uo="PopperArrow",el={top:"bottom",right:"left",bottom:"top",left:"right"},fo=s.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=Ja(uo,r),a=el[i.placedSide];return m.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]: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:m.jsx(Wa,{...o,ref:n,style:{...o.style,display:"block"}})})});fo.displayName=uo;function tl(e){return e!==null}var nl=e=>({name:"transformOrigin",options:e,fn(t){var y,x,w;const{placement:n,rects:r,middlewareData:o}=t,a=((y=o.arrow)==null?void 0:y.centerOffset)!==0,c=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[u,d]=po(n),f={start:"0%",center:"50%",end:"100%"}[d],p=(((x=o.arrow)==null?void 0:x.x)??0)+c/2,h=(((w=o.arrow)==null?void 0:w.y)??0)+l/2;let g="",v="";return u==="bottom"?(g=a?f:`${p}px`,v=`${-l}px`):u==="top"?(g=a?f:`${p}px`,v=`${r.floating.height+l}px`):u==="right"?(g=`${-l}px`,v=a?f:`${h}px`):u==="left"&&(g=`${r.floating.width+l}px`,v=a?f:`${h}px`),{data:{x:g,y:v}}}});function po(e){const[t,n="center"]=e.split("-");return[t,n]}var zt=so,ut=ao,Yt=lo,Xt=fo;function rl(e){const t=ol(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(sl);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function ol(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=al(o),c=cl(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var il=Symbol("radix.slottable");function sl(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===il}function cl(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function al(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ll=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ul=ll.reduce((e,t)=>{const n=rl(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),fl="Portal",ft=s.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[o,i]=s.useState(!1);Y(()=>i(!0),[]);const a=n||o&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?Js.createPortal(m.jsx(ul.div,{...r,ref:t}),a):null});ft.displayName=fl;function dl(e,t){return s.useReducer((n,r)=>t[n][r]??n,e)}var q=e=>{const{present:t,children:n}=e,r=pl(t),o=typeof n=="function"?n({present:r.isPresent}):s.Children.only(n),i=$(r.ref,ml(o));return typeof n=="function"||r.isPresent?s.cloneElement(o,{ref:i}):null};q.displayName="Presence";function pl(e){const[t,n]=s.useState(),r=s.useRef(null),o=s.useRef(e),i=s.useRef("none"),a=e?"mounted":"unmounted",[c,l]=dl(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const u=Et(r.current);i.current=c==="mounted"?u:"none"},[c]),Y(()=>{const u=r.current,d=o.current;if(d!==e){const p=i.current,h=Et(u);e?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Y(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=h=>{const v=Et(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&v&&(l("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=h=>{h.target===t&&(i.current=Et(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:s.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Et(e){return(e==null?void 0:e.animationName)||"none"}function ml(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function vl(e){const t=hl(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(yl);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function hl(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=wl(o),c=xl(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var mo=Symbol("radix.slottable");function gl(e){const t=({children:n})=>m.jsx(m.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=mo,t}function yl(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mo}function xl(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function wl(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Sl=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Cl=Sl.reduce((e,t)=>{const n=vl(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),bl=Wn[" useInsertionEffect ".trim().toString()]||Y;function Me({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,a]=El({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:o;{const d=s.useRef(e!==void 0);s.useEffect(()=>{const f=d.current;f!==c&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${c?"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.`),d.current=c},[c,r])}const u=s.useCallback(d=>{var f;if(c){const p=Pl(d)?d(e):d;p!==e&&((f=a.current)==null||f.call(a,p))}else i(d)},[c,e,i,a]);return[l,u]}function El({defaultProp:e,onChange:t}){const[n,r]=s.useState(e),o=s.useRef(n),i=s.useRef(t);return bl(()=>{i.current=t},[t]),s.useEffect(()=>{var a;o.current!==n&&((a=i.current)==null||a.call(i,n),o.current=n)},[n,o]),[n,r,i]}function Pl(e){return typeof e=="function"}function Rl(e){const t=_l(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Tl);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function _l(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=Nl(o),c=Ol(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Al=Symbol("radix.slottable");function Tl(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Al}function Ol(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Nl(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Il=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ml=Il.reduce((e,t)=>{const n=Rl(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),vo=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"}),Dl="VisuallyHidden",ho=s.forwardRef((e,t)=>m.jsx(Ml.span,{...e,ref:t,style:{...vo,...e.style}}));ho.displayName=Dl;var $l=ho,[Zt]=ec("Tooltip",[_e]),qt=_e(),go="TooltipProvider",jl=700,Tn="tooltip.open",[Ll,Xn]=Zt(go),yo=e=>{const{__scopeTooltip:t,delayDuration:n=jl,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,a=s.useRef(!0),c=s.useRef(!1),l=s.useRef(0);return s.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),m.jsx(Ll,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:s.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:s.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:s.useCallback(u=>{c.current=u},[]),disableHoverableContent:o,children:i})};yo.displayName=go;var it="Tooltip",[Fl,Qt]=Zt(it),xo=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:a,delayDuration:c}=e,l=Xn(it,e.__scopeTooltip),u=qt(t),[d,f]=s.useState(null),p=le(),h=s.useRef(0),g=a??l.disableHoverableContent,v=c??l.delayDuration,y=s.useRef(!1),[x,w]=Me({prop:r,defaultProp:o??!1,onChange:b=>{b?(l.onOpen(),document.dispatchEvent(new CustomEvent(Tn))):l.onClose(),i==null||i(b)},caller:it}),S=s.useMemo(()=>x?y.current?"delayed-open":"instant-open":"closed",[x]),C=s.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,w(!0)},[w]),E=s.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w(!1)},[w]),R=s.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,w(!0),h.current=0},v)},[v,w]);return s.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),m.jsx(zt,{...u,children:m.jsx(Fl,{scope:t,contentId:p,open:x,stateAttribute:S,trigger:d,onTriggerChange:f,onTriggerEnter:s.useCallback(()=>{l.isOpenDelayedRef.current?R():C()},[l.isOpenDelayedRef,R,C]),onTriggerLeave:s.useCallback(()=>{g?E():(window.clearTimeout(h.current),h.current=0)},[E,g]),onOpen:C,onClose:E,disableHoverableContent:g,children:n})})};xo.displayName=it;var On="TooltipTrigger",wo=s.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Qt(On,n),i=Xn(On,n),a=qt(n),c=s.useRef(null),l=$(t,c,o.onTriggerChange),u=s.useRef(!1),d=s.useRef(!1),f=s.useCallback(()=>u.current=!1,[]);return s.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),m.jsx(ut,{asChild:!0,...a,children:m.jsx(Cl.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:P(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:P(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:P(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:P(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:P(e.onBlur,o.onClose),onClick:P(e.onClick,o.onClose)})})});wo.displayName=On;var kl="TooltipPortal",[uv,Wl]=Zt(kl,{forceMount:void 0}),Ke="TooltipContent",So=s.forwardRef((e,t)=>{const n=Wl(Ke,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=Qt(Ke,e.__scopeTooltip);return m.jsx(q,{present:r||a.open,children:a.disableHoverableContent?m.jsx(Co,{side:o,...i,ref:t}):m.jsx(Vl,{side:o,...i,ref:t})})}),Vl=s.forwardRef((e,t)=>{const n=Qt(Ke,e.__scopeTooltip),r=Xn(Ke,e.__scopeTooltip),o=s.useRef(null),i=$(t,o),[a,c]=s.useState(null),{trigger:l,onClose:u}=n,d=o.current,{onPointerInTransitChange:f}=r,p=s.useCallback(()=>{c(null),f(!1)},[f]),h=s.useCallback((g,v)=>{const y=g.currentTarget,x={x:g.clientX,y:g.clientY},w=Gl(x,y.getBoundingClientRect()),S=zl(x,w),C=Yl(v.getBoundingClientRect()),E=Zl([...S,...C]);c(E),f(!0)},[f]);return s.useEffect(()=>()=>p(),[p]),s.useEffect(()=>{if(l&&d){const g=y=>h(y,d),v=y=>h(y,l);return l.addEventListener("pointerleave",g),d.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",v)}}},[l,d,h,p]),s.useEffect(()=>{if(a){const g=v=>{const y=v.target,x={x:v.clientX,y:v.clientY},w=(l==null?void 0:l.contains(y))||(d==null?void 0:d.contains(y)),S=!Xl(x,a);w?p():S&&(p(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,d,a,u,p]),m.jsx(Co,{...e,ref:i})}),[Bl,Hl]=Zt(it,{isInside:!1}),Ul=gl("TooltipContent"),Co=s.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...c}=e,l=Qt(Ke,n),u=qt(n),{onClose:d}=l;return s.useEffect(()=>(document.addEventListener(Tn,d),()=>document.removeEventListener(Tn,d)),[d]),s.useEffect(()=>{if(l.trigger){const f=p=>{const h=p.target;h!=null&&h.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),m.jsx(Xe,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:m.jsxs(Yt,{"data-state":l.stateAttribute,...u,...c,ref:t,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:[m.jsx(Ul,{children:r}),m.jsx(Bl,{scope:n,isInside:!0,children:m.jsx($l,{id:l.contentId,role:"tooltip",children:o||r})})]})})});So.displayName=Ke;var bo="TooltipArrow",Kl=s.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=qt(n);return Hl(bo,n).isInside?null:m.jsx(Xt,{...o,...r,ref:t})});Kl.displayName=bo;function Gl(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function zl(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Yl(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Xl(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const c=t[i],l=t[a],u=c.x,d=c.y,f=l.x,p=l.y;d>r!=p>r&&n<(f-u)*(r-d)/(p-d)+u&&(o=!o)}return o}function Zl(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),ql(t)}function ql(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}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 fv=yo,dv=xo,pv=wo,mv=So,Ql=Symbol.for("react.lazy"),jt=Wn[" use ".trim().toString()];function Jl(e){return typeof e=="object"&&e!==null&&"then"in e}function Eo(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Ql&&"_payload"in e&&Jl(e._payload)}function Po(e){const t=eu(e),n=s.forwardRef((r,o)=>{let{children:i,...a}=r;Eo(i)&&typeof jt=="function"&&(i=jt(i._payload));const c=s.Children.toArray(i),l=c.find(nu);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var vv=Po("Slot");function eu(e){const t=s.forwardRef((n,r)=>{let{children:o,...i}=n;if(Eo(o)&&typeof jt=="function"&&(o=jt(o._payload)),s.isValidElement(o)){const a=ou(o),c=ru(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tu=Symbol("radix.slottable");function nu(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tu}function ru(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function ou(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var iu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],dt=iu.reduce((e,t)=>{const n=Po(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),su="Separator",_r="horizontal",cu=["horizontal","vertical"],Ro=s.forwardRef((e,t)=>{const{decorative:n,orientation:r=_r,...o}=e,i=au(r)?r:_r,c=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return m.jsx(dt.div,{"data-orientation":i,...c,...o,ref:t})});Ro.displayName=su;function au(e){return cu.includes(e)}var hv=Ro;function lu(e,t){const n=s.createContext(t),r=i=>{const{children:a,...c}=i,l=s.useMemo(()=>c,Object.values(c));return m.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function o(i){const a=s.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function uu(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,fu(o,...t)]}function fu(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function du(e){const t=pu(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(vu);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function pu(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=gu(o),c=hu(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var mu=Symbol("radix.slottable");function vu(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mu}function hu(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function gu(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var yu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xu=yu.reduce((e,t)=>{const n=du(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),hn="focusScope.autoFocusOnMount",gn="focusScope.autoFocusOnUnmount",Ar={bubbles:!1,cancelable:!0},wu="FocusScope",pt=s.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[c,l]=s.useState(null),u=Z(o),d=Z(i),f=s.useRef(null),p=$(t,v=>l(v)),h=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(r){let v=function(S){if(h.paused||!c)return;const C=S.target;c.contains(C)?f.current=C:Ee(f.current,{select:!0})},y=function(S){if(h.paused||!c)return;const C=S.relatedTarget;C!==null&&(c.contains(C)||Ee(f.current,{select:!0}))},x=function(S){if(document.activeElement===document.body)for(const E of S)E.removedNodes.length>0&&Ee(c)};document.addEventListener("focusin",v),document.addEventListener("focusout",y);const w=new MutationObserver(x);return c&&w.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),w.disconnect()}}},[r,c,h.paused]),s.useEffect(()=>{if(c){Or.add(h);const v=document.activeElement;if(!c.contains(v)){const x=new CustomEvent(hn,Ar);c.addEventListener(hn,u),c.dispatchEvent(x),x.defaultPrevented||(Su(Ru(_o(c)),{select:!0}),document.activeElement===v&&Ee(c))}return()=>{c.removeEventListener(hn,u),setTimeout(()=>{const x=new CustomEvent(gn,Ar);c.addEventListener(gn,d),c.dispatchEvent(x),x.defaultPrevented||Ee(v??document.body,{select:!0}),c.removeEventListener(gn,d),Or.remove(h)},0)}}},[c,u,d,h]);const g=s.useCallback(v=>{if(!n&&!r||h.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,x=document.activeElement;if(y&&x){const w=v.currentTarget,[S,C]=Cu(w);S&&C?!v.shiftKey&&x===C?(v.preventDefault(),n&&Ee(S,{select:!0})):v.shiftKey&&x===S&&(v.preventDefault(),n&&Ee(C,{select:!0})):x===w&&v.preventDefault()}},[n,r,h.paused]);return m.jsx(xu.div,{tabIndex:-1,...a,ref:p,onKeyDown:g})});pt.displayName=wu;function Su(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ee(r,{select:t}),document.activeElement!==n)return}function Cu(e){const t=_o(e),n=Tr(t,e),r=Tr(t.reverse(),e);return[n,r]}function _o(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Tr(e,t){for(const n of e)if(!bu(n,{upTo:t}))return n}function bu(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 Eu(e){return e instanceof HTMLInputElement&&"select"in e}function Ee(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Eu(e)&&t&&e.select()}}var Or=Pu();function Pu(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Nr(e,t),e.unshift(t)},remove(t){var n;e=Nr(e,t),(n=e[0])==null||n.resume()}}}function Nr(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ru(e){return e.filter(t=>t.tagName!=="A")}function Ao(e){const t=_u(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Tu);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function _u(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=Nu(o),c=Ou(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Au=Symbol("radix.slottable");function Tu(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Au}function Ou(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Nu(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Iu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],mt=Iu.reduce((e,t)=>{const n=Ao(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),yn=0;function Jt(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ir()),document.body.insertAdjacentElement("beforeend",e[1]??Ir()),yn++,()=>{yn===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),yn--}},[])}function Ir(){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 me=function(){return me=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},me.apply(this,arguments)};function To(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Mu(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Ot="right-scroll-bar-position",Nt="width-before-scroll-bar",Du="with-scroll-bars-hidden",$u="--removed-body-scroll-bar-size";function xn(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ju(e,t){var n=s.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Lu=typeof window<"u"?s.useLayoutEffect:s.useEffect,Mr=new WeakMap;function Fu(e,t){var n=ju(null,function(r){return e.forEach(function(o){return xn(o,r)})});return Lu(function(){var r=Mr.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(c){i.has(c)||xn(c,null)}),i.forEach(function(c){o.has(c)||xn(c,a)})}Mr.set(n,e)},[e]),n}function ku(e){return e}function Wu(e,t){t===void 0&&(t=ku);var n=[],r=!1,o={read:function(){if(r)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 a=t(i,r);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(i),a=n}var l=function(){var d=a;a=[],d.forEach(i)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return o}function Vu(e){e===void 0&&(e={});var t=Wu(null);return t.options=me({async:!0,ssr:!1},e),t}var Oo=function(e){var t=e.sideCar,n=To(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return s.createElement(r,me({},n))};Oo.isSideCarExport=!0;function Bu(e,t){return e.useMedium(t),Oo}var No=Vu(),wn=function(){},en=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:wn,onWheelCapture:wn,onTouchMoveCapture:wn}),o=r[0],i=r[1],a=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noRelative,g=e.noIsolation,v=e.inert,y=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,S=e.gapMode,C=To(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,R=Fu([n,t]),b=me(me({},C),o);return s.createElement(s.Fragment,null,d&&s.createElement(E,{sideCar:No,removeScrollBar:u,shards:f,noRelative:h,noIsolation:g,inert:v,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:S}),a?s.cloneElement(s.Children.only(c),me(me({},b),{ref:R})):s.createElement(w,me({},b,{className:l,ref:R}),c))});en.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};en.classNames={fullWidth:Nt,zeroRight:Ot};var Hu=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Uu(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Hu();return t&&e.setAttribute("nonce",t),e}function Ku(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Gu(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var zu=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Uu())&&(Ku(t,n),Gu(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Yu=function(){var e=zu();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Io=function(){var e=Yu(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Xu={left:0,top:0,right:0,gap:0},Sn=function(e){return parseInt(e||"",10)||0},Zu=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Sn(n),Sn(r),Sn(o)]},qu=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Xu;var t=Zu(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Qu=Io(),He="data-scroll-locked",Ju=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
1
+ import{r as s,a as at,R as Wn,b as Js,c as Ne}from"./vendor-react-GAVzOgi0.js";import{j as m}from"./vendor-query-B9zjiv_I.js";function P(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function pr(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function X(...e){return t=>{let n=!1;const r=e.map(o=>{const i=pr(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():pr(e[o],null)}}}}function $(...e){return s.useCallback(X(...e),e)}function ec(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,tc(o,...t)]}function tc(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function nc(e){const t=rc(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(ic);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function rc(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=cc(o),c=sc(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var oc=Symbol("radix.slottable");function ic(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===oc}function sc(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function cc(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ac=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Br=ac.reduce((e,t)=>{const n=nc(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function lc(e,t){e&&at.flushSync(()=>e.dispatchEvent(t))}function Z(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function uc(e,t=globalThis==null?void 0:globalThis.document){const n=Z(e);s.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var fc="DismissableLayer",Pn="dismissableLayer.update",dc="dismissableLayer.pointerDownOutside",pc="dismissableLayer.focusOutside",mr,Hr=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xe=s.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:c,...l}=e,u=s.useContext(Hr),[d,f]=s.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=s.useState({}),g=$(t,b=>f(b)),v=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=v.indexOf(y),w=d?v.indexOf(d):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,C=w>=x,E=hc(b=>{const A=b.target,T=[...u.branches].some(O=>O.contains(A));!C||T||(o==null||o(b),a==null||a(b),b.defaultPrevented||c==null||c())},p),R=gc(b=>{const A=b.target;[...u.branches].some(O=>O.contains(A))||(i==null||i(b),a==null||a(b),b.defaultPrevented||c==null||c())},p);return uc(b=>{w===u.layers.size-1&&(r==null||r(b),!b.defaultPrevented&&c&&(b.preventDefault(),c()))},p),s.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(mr=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),vr(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=mr)}},[d,p,n,u]),s.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),vr())},[d,u]),s.useEffect(()=>{const b=()=>h({});return document.addEventListener(Pn,b),()=>document.removeEventListener(Pn,b)},[]),m.jsx(Br.div,{...l,ref:g,style:{pointerEvents:S?C?"auto":"none":void 0,...e.style},onFocusCapture:P(e.onFocusCapture,R.onFocusCapture),onBlurCapture:P(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:P(e.onPointerDownCapture,E.onPointerDownCapture)})});Xe.displayName=fc;var mc="DismissableLayerBranch",vc=s.forwardRef((e,t)=>{const n=s.useContext(Hr),r=s.useRef(null),o=$(t,r);return s.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),m.jsx(Br.div,{...e,ref:o})});vc.displayName=mc;function hc(e,t=globalThis==null?void 0:globalThis.document){const n=Z(e),r=s.useRef(!1),o=s.useRef(()=>{});return s.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let l=function(){Ur(dc,n,u,{discrete:!0})};const u={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function gc(e,t=globalThis==null?void 0:globalThis.document){const n=Z(e),r=s.useRef(!1);return s.useEffect(()=>{const o=i=>{i.target&&!r.current&&Ur(pc,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function vr(){const e=new CustomEvent(Pn);document.dispatchEvent(e)}function Ur(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?lc(o,i):o.dispatchEvent(i)}var Y=globalThis!=null&&globalThis.document?s.useLayoutEffect:()=>{},yc=Wn[" useId ".trim().toString()]||(()=>{}),xc=0;function le(e){const[t,n]=s.useState(yc());return Y(()=>{n(r=>r??String(xc++))},[e]),t?`radix-${t}`:""}const wc=["top","right","bottom","left"],Pe=Math.min,ne=Math.max,It=Math.round,bt=Math.floor,he=e=>({x:e,y:e}),Sc={left:"right",right:"left",bottom:"top",top:"bottom"},Cc={start:"end",end:"start"};function Rn(e,t,n){return ne(e,Pe(t,n))}function Ce(e,t){return typeof e=="function"?e(t):e}function be(e){return e.split("-")[0]}function Ze(e){return e.split("-")[1]}function Vn(e){return e==="x"?"y":"x"}function Bn(e){return e==="y"?"height":"width"}const bc=new Set(["top","bottom"]);function ve(e){return bc.has(be(e))?"y":"x"}function Hn(e){return Vn(ve(e))}function Ec(e,t,n){n===void 0&&(n=!1);const r=Ze(e),o=Hn(e),i=Bn(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Mt(a)),[a,Mt(a)]}function Pc(e){const t=Mt(e);return[_n(e),t,_n(t)]}function _n(e){return e.replace(/start|end/g,t=>Cc[t])}const hr=["left","right"],gr=["right","left"],Rc=["top","bottom"],_c=["bottom","top"];function Ac(e,t,n){switch(e){case"top":case"bottom":return n?t?gr:hr:t?hr:gr;case"left":case"right":return t?Rc:_c;default:return[]}}function Tc(e,t,n,r){const o=Ze(e);let i=Ac(be(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(_n)))),i}function Mt(e){return e.replace(/left|right|bottom|top/g,t=>Sc[t])}function Oc(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kr(e){return typeof e!="number"?Oc(e):{top:e,right:e,bottom:e,left:e}}function Dt(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function yr(e,t,n){let{reference:r,floating:o}=e;const i=ve(t),a=Hn(t),c=Bn(a),l=be(t),u=i==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[c]/2-o[c]/2;let h;switch(l){case"top":h={x:d,y:r.y-o.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Ze(t)){case"start":h[a]-=p*(n&&u?-1:1);break;case"end":h[a]+=p*(n&&u?-1:1);break}return h}async function Nc(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:c,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=Ce(t,e),g=Kr(h),y=c[p?f==="floating"?"reference":"floating":f],x=Dt(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:u,rootBoundary:d,strategy:l})),w=f==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),C=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},E=Dt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:S,strategy:l}):w);return{top:(x.top-E.top+g.top)/C.y,bottom:(E.bottom-x.bottom+g.bottom)/C.y,left:(x.left-E.left+g.left)/C.x,right:(E.right-x.right+g.right)/C.x}}const Ic=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,c=i.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=yr(u,r,l),p=r,h={},g=0;for(let y=0;y<c.length;y++){var v;const{name:x,fn:w}=c[y],{x:S,y:C,data:E,reset:R}=await w({x:d,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:u,platform:{...a,detectOverflow:(v=a.detectOverflow)!=null?v:Nc},elements:{reference:e,floating:t}});d=S??d,f=C??f,h={...h,[x]:{...h[x],...E}},R&&g<=50&&(g++,typeof R=="object"&&(R.placement&&(p=R.placement),R.rects&&(u=R.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):R.rects),{x:d,y:f}=yr(u,p,l)),y=-1)}return{x:d,y:f,placement:p,strategy:o,middlewareData:h}},Mc=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:c,middlewareData:l}=t,{element:u,padding:d=0}=Ce(e,t)||{};if(u==null)return{};const f=Kr(d),p={x:n,y:r},h=Hn(o),g=Bn(h),v=await a.getDimensions(u),y=h==="y",x=y?"top":"left",w=y?"bottom":"right",S=y?"clientHeight":"clientWidth",C=i.reference[g]+i.reference[h]-p[h]-i.floating[g],E=p[h]-i.reference[h],R=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let b=R?R[S]:0;(!b||!await(a.isElement==null?void 0:a.isElement(R)))&&(b=c.floating[S]||i.floating[g]);const A=C/2-E/2,T=b/2-v[g]/2-1,O=Pe(f[x],T),D=Pe(f[w],T),L=O,F=b-v[g]-D,j=b/2-v[g]/2+A,U=Rn(L,j,F),M=!l.arrow&&Ze(o)!=null&&j!==U&&i.reference[g]/2-(j<L?O:D)-v[g]/2<0,k=M?j<L?j-L:j-F:0;return{[h]:p[h]+k,data:{[h]:U,centerOffset:j-U-k,...M&&{alignmentOffset:k}},reset:M}}}),Dc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:c,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...y}=Ce(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=be(o),w=ve(c),S=be(c)===c,C=await(l.isRTL==null?void 0:l.isRTL(u.floating)),E=p||(S||!v?[Mt(c)]:Pc(c)),R=g!=="none";!p&&R&&E.push(...Tc(c,v,g,C));const b=[c,...E],A=await l.detectOverflow(t,y),T=[];let O=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&T.push(A[x]),f){const j=Ec(o,a,C);T.push(A[j[0]],A[j[1]])}if(O=[...O,{placement:o,overflows:T}],!T.every(j=>j<=0)){var D,L;const j=(((D=i.flip)==null?void 0:D.index)||0)+1,U=b[j];if(U&&(!(f==="alignment"?w!==ve(U):!1)||O.every(N=>ve(N.placement)===w?N.overflows[0]>0:!0)))return{data:{index:j,overflows:O},reset:{placement:U}};let M=(L=O.filter(k=>k.overflows[0]<=0).sort((k,N)=>k.overflows[1]-N.overflows[1])[0])==null?void 0:L.placement;if(!M)switch(h){case"bestFit":{var F;const k=(F=O.filter(N=>{if(R){const _=ve(N.placement);return _===w||_==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(_=>_>0).reduce((_,K)=>_+K,0)]).sort((N,_)=>N[1]-_[1])[0])==null?void 0:F[0];k&&(M=k);break}case"initialPlacement":M=c;break}if(o!==M)return{reset:{placement:M}}}return{}}}};function xr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wr(e){return wc.some(t=>e[t]>=0)}const $c=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=Ce(e,t);switch(o){case"referenceHidden":{const a=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=xr(a,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:wr(c)}}}case"escaped":{const a=await r.detectOverflow(t,{...i,altBoundary:!0}),c=xr(a,n.floating);return{data:{escapedOffsets:c,escaped:wr(c)}}}default:return{}}}}},Gr=new Set(["left","top"]);async function jc(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=be(n),c=Ze(n),l=ve(n)==="y",u=Gr.has(a)?-1:1,d=i&&l?-1:1,f=Ce(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof g=="number"&&(h=c==="end"?g*-1:g),l?{x:h*d,y:p*u}:{x:p*u,y:h*d}}const Lc=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:c}=t,l=await jc(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},Fc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:a=!0,crossAxis:c=!1,limiter:l={fn:x=>{let{x:w,y:S}=x;return{x:w,y:S}}},...u}=Ce(e,t),d={x:n,y:r},f=await i.detectOverflow(t,u),p=ve(be(o)),h=Vn(p);let g=d[h],v=d[p];if(a){const x=h==="y"?"top":"left",w=h==="y"?"bottom":"right",S=g+f[x],C=g-f[w];g=Rn(S,g,C)}if(c){const x=p==="y"?"top":"left",w=p==="y"?"bottom":"right",S=v+f[x],C=v-f[w];v=Rn(S,v,C)}const y=l.fn({...t,[h]:g,[p]:v});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[h]:a,[p]:c}}}}}},kc=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:c=0,mainAxis:l=!0,crossAxis:u=!0}=Ce(e,t),d={x:n,y:r},f=ve(o),p=Vn(f);let h=d[p],g=d[f];const v=Ce(c,t),y=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const S=p==="y"?"height":"width",C=i.reference[p]-i.floating[S]+y.mainAxis,E=i.reference[p]+i.reference[S]-y.mainAxis;h<C?h=C:h>E&&(h=E)}if(u){var x,w;const S=p==="y"?"width":"height",C=Gr.has(be(o)),E=i.reference[f]-i.floating[S]+(C&&((x=a.offset)==null?void 0:x[f])||0)+(C?0:y.crossAxis),R=i.reference[f]+i.reference[S]+(C?0:((w=a.offset)==null?void 0:w[f])||0)-(C?y.crossAxis:0);g<E?g=E:g>R&&(g=R)}return{[p]:h,[f]:g}}}},Wc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:c}=t,{apply:l=()=>{},...u}=Ce(e,t),d=await a.detectOverflow(t,u),f=be(o),p=Ze(o),h=ve(o)==="y",{width:g,height:v}=i.floating;let y,x;f==="top"||f==="bottom"?(y=f,x=p===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(x=f,y=p==="end"?"top":"bottom");const w=v-d.top-d.bottom,S=g-d.left-d.right,C=Pe(v-d[y],w),E=Pe(g-d[x],S),R=!t.middlewareData.shift;let b=C,A=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(b=w),R&&!p){const O=ne(d.left,0),D=ne(d.right,0),L=ne(d.top,0),F=ne(d.bottom,0);h?A=g-2*(O!==0||D!==0?O+D:ne(d.left,d.right)):b=v-2*(L!==0||F!==0?L+F:ne(d.top,d.bottom))}await l({...t,availableWidth:A,availableHeight:b});const T=await a.getDimensions(c.floating);return g!==T.width||v!==T.height?{reset:{rects:!0}}:{}}}};function Ht(){return typeof window<"u"}function qe(e){return zr(e)?(e.nodeName||"").toLowerCase():"#document"}function re(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ye(e){var t;return(t=(zr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function zr(e){return Ht()?e instanceof Node||e instanceof re(e).Node:!1}function ue(e){return Ht()?e instanceof Element||e instanceof re(e).Element:!1}function ge(e){return Ht()?e instanceof HTMLElement||e instanceof re(e).HTMLElement:!1}function Sr(e){return!Ht()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof re(e).ShadowRoot}const Vc=new Set(["inline","contents"]);function lt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=fe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Vc.has(o)}const Bc=new Set(["table","td","th"]);function Hc(e){return Bc.has(qe(e))}const Uc=[":popover-open",":modal"];function Ut(e){return Uc.some(t=>{try{return e.matches(t)}catch{return!1}})}const Kc=["transform","translate","scale","rotate","perspective"],Gc=["transform","translate","scale","rotate","perspective","filter"],zc=["paint","layout","strict","content"];function Un(e){const t=Kn(),n=ue(e)?fe(e):e;return Kc.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Gc.some(r=>(n.willChange||"").includes(r))||zc.some(r=>(n.contain||"").includes(r))}function Yc(e){let t=Re(e);for(;ge(t)&&!Ue(t);){if(Un(t))return t;if(Ut(t))return null;t=Re(t)}return null}function Kn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Xc=new Set(["html","body","#document"]);function Ue(e){return Xc.has(qe(e))}function fe(e){return re(e).getComputedStyle(e)}function Kt(e){return ue(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Re(e){if(qe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Sr(e)&&e.host||ye(e);return Sr(t)?t.host:t}function Yr(e){const t=Re(e);return Ue(t)?e.ownerDocument?e.ownerDocument.body:e.body:ge(t)&&lt(t)?t:Yr(t)}function ot(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Yr(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=re(o);if(i){const c=An(a);return t.concat(a,a.visualViewport||[],lt(o)?o:[],c&&n?ot(c):[])}return t.concat(o,ot(o,[],n))}function An(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xr(e){const t=fe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ge(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,c=It(n)!==i||It(r)!==a;return c&&(n=i,r=a),{width:n,height:r,$:c}}function Gn(e){return ue(e)?e:e.contextElement}function Be(e){const t=Gn(e);if(!ge(t))return he(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Xr(t);let a=(i?It(n.width):n.width)/r,c=(i?It(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const Zc=he(0);function Zr(e){const t=re(e);return!Kn()||!t.visualViewport?Zc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==re(e)?!1:t}function Ie(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Gn(e);let a=he(1);t&&(r?ue(r)&&(a=Be(r)):a=Be(e));const c=qc(i,n,r)?Zr(i):he(0);let l=(o.left+c.x)/a.x,u=(o.top+c.y)/a.y,d=o.width/a.x,f=o.height/a.y;if(i){const p=re(i),h=r&&ue(r)?re(r):r;let g=p,v=An(g);for(;v&&r&&h!==g;){const y=Be(v),x=v.getBoundingClientRect(),w=fe(v),S=x.left+(v.clientLeft+parseFloat(w.paddingLeft))*y.x,C=x.top+(v.clientTop+parseFloat(w.paddingTop))*y.y;l*=y.x,u*=y.y,d*=y.x,f*=y.y,l+=S,u+=C,g=re(v),v=An(g)}}return Dt({width:d,height:f,x:l,y:u})}function Gt(e,t){const n=Kt(e).scrollLeft;return t?t.left+n:Ie(ye(e)).left+n}function qr(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Gt(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Qc(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=ye(r),c=t?Ut(t.floating):!1;if(r===a||c&&i)return n;let l={scrollLeft:0,scrollTop:0},u=he(1);const d=he(0),f=ge(r);if((f||!f&&!i)&&((qe(r)!=="body"||lt(a))&&(l=Kt(r)),ge(r))){const h=Ie(r);u=Be(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const p=a&&!f&&!i?qr(a,l):he(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function Jc(e){return Array.from(e.getClientRects())}function ea(e){const t=ye(e),n=Kt(e),r=e.ownerDocument.body,o=ne(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ne(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Gt(e);const c=-n.scrollTop;return fe(r).direction==="rtl"&&(a+=ne(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:c}}const Cr=25;function ta(e,t){const n=re(e),r=ye(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,c=0,l=0;if(o){i=o.width,a=o.height;const d=Kn();(!d||d&&t==="fixed")&&(c=o.offsetLeft,l=o.offsetTop)}const u=Gt(r);if(u<=0){const d=r.ownerDocument,f=d.body,p=getComputedStyle(f),h=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-h);g<=Cr&&(i-=g)}else u<=Cr&&(i+=u);return{width:i,height:a,x:c,y:l}}const na=new Set(["absolute","fixed"]);function ra(e,t){const n=Ie(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ge(e)?Be(e):he(1),a=e.clientWidth*i.x,c=e.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:a,height:c,x:l,y:u}}function br(e,t,n){let r;if(t==="viewport")r=ta(e,n);else if(t==="document")r=ea(ye(e));else if(ue(t))r=ra(t,n);else{const o=Zr(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Dt(r)}function Qr(e,t){const n=Re(e);return n===t||!ue(n)||Ue(n)?!1:fe(n).position==="fixed"||Qr(n,t)}function oa(e,t){const n=t.get(e);if(n)return n;let r=ot(e,[],!1).filter(c=>ue(c)&&qe(c)!=="body"),o=null;const i=fe(e).position==="fixed";let a=i?Re(e):e;for(;ue(a)&&!Ue(a);){const c=fe(a),l=Un(a);!l&&c.position==="fixed"&&(o=null),(i?!l&&!o:!l&&c.position==="static"&&!!o&&na.has(o.position)||lt(a)&&!l&&Qr(e,a))?r=r.filter(d=>d!==a):o=c,a=Re(a)}return t.set(e,r),r}function ia(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?Ut(t)?[]:oa(t,this._c):[].concat(n),r],c=a[0],l=a.reduce((u,d)=>{const f=br(t,d,o);return u.top=ne(f.top,u.top),u.right=Pe(f.right,u.right),u.bottom=Pe(f.bottom,u.bottom),u.left=ne(f.left,u.left),u},br(t,c,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function sa(e){const{width:t,height:n}=Xr(e);return{width:t,height:n}}function ca(e,t,n){const r=ge(t),o=ye(t),i=n==="fixed",a=Ie(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const l=he(0);function u(){l.x=Gt(o)}if(r||!r&&!i)if((qe(t)!=="body"||lt(o))&&(c=Kt(t)),r){const h=Ie(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&u();i&&!r&&o&&u();const d=o&&!r&&!i?qr(o,c):he(0),f=a.left+c.scrollLeft-l.x-d.x,p=a.top+c.scrollTop-l.y-d.y;return{x:f,y:p,width:a.width,height:a.height}}function mn(e){return fe(e).position==="static"}function Er(e,t){if(!ge(e)||fe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ye(e)===n&&(n=n.ownerDocument.body),n}function Jr(e,t){const n=re(e);if(Ut(e))return n;if(!ge(e)){let o=Re(e);for(;o&&!Ue(o);){if(ue(o)&&!mn(o))return o;o=Re(o)}return n}let r=Er(e,t);for(;r&&Hc(r)&&mn(r);)r=Er(r,t);return r&&Ue(r)&&mn(r)&&!Un(r)?n:r||Yc(e)||n}const aa=async function(e){const t=this.getOffsetParent||Jr,n=this.getDimensions,r=await n(e.floating);return{reference:ca(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function la(e){return fe(e).direction==="rtl"}const ua={convertOffsetParentRelativeRectToViewportRelativeRect:Qc,getDocumentElement:ye,getClippingRect:ia,getOffsetParent:Jr,getElementRects:aa,getClientRects:Jc,getDimensions:sa,getScale:Be,isElement:ue,isRTL:la};function eo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fa(e,t){let n=null,r;const o=ye(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),i();const u=e.getBoundingClientRect(),{left:d,top:f,width:p,height:h}=u;if(c||t(),!p||!h)return;const g=bt(f),v=bt(o.clientWidth-(d+p)),y=bt(o.clientHeight-(f+h)),x=bt(d),S={rootMargin:-g+"px "+-v+"px "+-y+"px "+-x+"px",threshold:ne(0,Pe(1,l))||1};let C=!0;function E(R){const b=R[0].intersectionRatio;if(b!==l){if(!C)return a();b?a(!1,b):r=setTimeout(()=>{a(!1,1e-7)},1e3)}b===1&&!eo(u,e.getBoundingClientRect())&&a(),C=!1}try{n=new IntersectionObserver(E,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,S)}n.observe(e)}return a(!0),i}function da(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Gn(e),d=o||i?[...u?ot(u):[],...ot(t)]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const f=u&&c?fa(u,n):null;let p=-1,h=null;a&&(h=new ResizeObserver(x=>{let[w]=x;w&&w.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let g,v=l?Ie(e):null;l&&y();function y(){const x=Ie(e);v&&!eo(v,x)&&n(),v=x,g=requestAnimationFrame(y)}return n(),()=>{var x;d.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),f==null||f(),(x=h)==null||x.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const pa=Lc,ma=Fc,va=Dc,ha=Wc,ga=$c,Pr=Mc,ya=kc,xa=(e,t,n)=>{const r=new Map,o={platform:ua,...n},i={...o.platform,_c:r};return Ic(e,t,{...o,platform:i})};var wa=typeof document<"u",Sa=function(){},Tt=wa?s.useLayoutEffect:Sa;function $t(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,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!$t(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!$t(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 Rr(e,t){const n=to(e);return Math.round(t*n)/n}function vn(e){const t=s.useRef(e);return Tt(()=>{t.current=e}),t}function Ca(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=s.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=s.useState(r);$t(p,r)||h(r);const[g,v]=s.useState(null),[y,x]=s.useState(null),w=s.useCallback(N=>{N!==R.current&&(R.current=N,v(N))},[]),S=s.useCallback(N=>{N!==b.current&&(b.current=N,x(N))},[]),C=i||g,E=a||y,R=s.useRef(null),b=s.useRef(null),A=s.useRef(d),T=l!=null,O=vn(l),D=vn(o),L=vn(u),F=s.useCallback(()=>{if(!R.current||!b.current)return;const N={placement:t,strategy:n,middleware:p};D.current&&(N.platform=D.current),xa(R.current,b.current,N).then(_=>{const K={..._,isPositioned:L.current!==!1};j.current&&!$t(A.current,K)&&(A.current=K,at.flushSync(()=>{f(K)}))})},[p,t,n,D,L]);Tt(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,f(N=>({...N,isPositioned:!1})))},[u]);const j=s.useRef(!1);Tt(()=>(j.current=!0,()=>{j.current=!1}),[]),Tt(()=>{if(C&&(R.current=C),E&&(b.current=E),C&&E){if(O.current)return O.current(C,E,F);F()}},[C,E,F,O,T]);const U=s.useMemo(()=>({reference:R,floating:b,setReference:w,setFloating:S}),[w,S]),M=s.useMemo(()=>({reference:C,floating:E}),[C,E]),k=s.useMemo(()=>{const N={position:n,left:0,top:0};if(!M.floating)return N;const _=Rr(M.floating,d.x),K=Rr(M.floating,d.y);return c?{...N,transform:"translate("+_+"px, "+K+"px)",...to(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:K}},[n,c,M.floating,d.x,d.y]);return s.useMemo(()=>({...d,update:F,refs:U,elements:M,floatingStyles:k}),[d,F,U,M,k])}const ba=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Pr({element:r.current,padding:o}).fn(n):{}:r?Pr({element:r,padding:o}).fn(n):{}}}},Ea=(e,t)=>({...pa(e),options:[e,t]}),Pa=(e,t)=>({...ma(e),options:[e,t]}),Ra=(e,t)=>({...ya(e),options:[e,t]}),_a=(e,t)=>({...va(e),options:[e,t]}),Aa=(e,t)=>({...ha(e),options:[e,t]}),Ta=(e,t)=>({...ga(e),options:[e,t]}),Oa=(e,t)=>({...ba(e),options:[e,t]});function Na(e){const t=Ia(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Da);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Ia(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=ja(o),c=$a(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ma=Symbol("radix.slottable");function Da(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ma}function $a(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function ja(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var La=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Fa=La.reduce((e,t)=>{const n=Na(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),ka="Arrow",no=s.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return m.jsx(Fa.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});no.displayName=ka;var Wa=no;function Va(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,Ba(o,...t)]}function Ba(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Ha(e){const t=Ua(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Ga);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Ua(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=Ya(o),c=za(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ka=Symbol("radix.slottable");function Ga(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ka}function za(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Ya(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xa=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ro=Xa.reduce((e,t)=>{const n=Ha(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Za(e){const[t,n]=s.useState(void 0);return Y(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,c;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,c=u.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var zn="Popper",[oo,_e]=Va(zn),[qa,io]=oo(zn),so=e=>{const{__scopePopper:t,children:n}=e,[r,o]=s.useState(null);return m.jsx(qa,{scope:t,anchor:r,onAnchorChange:o,children:n})};so.displayName=zn;var co="PopperAnchor",ao=s.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=io(co,n),a=s.useRef(null),c=$(t,a),l=s.useRef(null);return s.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||a.current,u!==l.current&&i.onAnchorChange(l.current)}),r?null:m.jsx(ro.div,{...o,ref:c})});ao.displayName=co;var Yn="PopperContent",[Qa,Ja]=oo(Yn),lo=s.forwardRef((e,t)=>{var I,V,G,W,B,H;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:g,...v}=e,y=io(Yn,n),[x,w]=s.useState(null),S=$(t,te=>w(te)),[C,E]=s.useState(null),R=Za(C),b=(R==null?void 0:R.width)??0,A=(R==null?void 0:R.height)??0,T=r+(i!=="center"?"-"+i:""),O=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},D=Array.isArray(u)?u:[u],L=D.length>0,F={padding:O,boundary:D.filter(tl),altBoundary:L},{refs:j,floatingStyles:U,placement:M,isPositioned:k,middlewareData:N}=Ca({strategy:"fixed",placement:T,whileElementsMounted:(...te)=>da(...te,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[Ea({mainAxis:o+A,alignmentAxis:a}),l&&Pa({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Ra():void 0,...F}),l&&_a({...F}),Aa({...F,apply:({elements:te,rects:pe,availableWidth:Je,availableHeight:et})=>{const{width:tt,height:Qs}=pe.reference,Ct=te.floating.style;Ct.setProperty("--radix-popper-available-width",`${Je}px`),Ct.setProperty("--radix-popper-available-height",`${et}px`),Ct.setProperty("--radix-popper-anchor-width",`${tt}px`),Ct.setProperty("--radix-popper-anchor-height",`${Qs}px`)}}),C&&Oa({element:C,padding:c}),nl({arrowWidth:b,arrowHeight:A}),p&&Ta({strategy:"referenceHidden",...F})]}),[_,K]=po(M),z=Z(g);Y(()=>{k&&(z==null||z())},[k,z]);const J=(I=N.arrow)==null?void 0:I.x,we=(V=N.arrow)==null?void 0:V.y,ie=((G=N.arrow)==null?void 0:G.centerOffset)!==0,[Se,ee]=s.useState();return Y(()=>{x&&ee(window.getComputedStyle(x).zIndex)},[x]),m.jsx("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:k?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Se,"--radix-popper-transform-origin":[(W=N.transformOrigin)==null?void 0:W.x,(B=N.transformOrigin)==null?void 0:B.y].join(" "),...((H=N.hide)==null?void 0:H.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:m.jsx(Qa,{scope:n,placedSide:_,onArrowChange:E,arrowX:J,arrowY:we,shouldHideArrow:ie,children:m.jsx(ro.div,{"data-side":_,"data-align":K,...v,ref:S,style:{...v.style,animation:k?void 0:"none"}})})})});lo.displayName=Yn;var uo="PopperArrow",el={top:"bottom",right:"left",bottom:"top",left:"right"},fo=s.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=Ja(uo,r),a=el[i.placedSide];return m.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]: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:m.jsx(Wa,{...o,ref:n,style:{...o.style,display:"block"}})})});fo.displayName=uo;function tl(e){return e!==null}var nl=e=>({name:"transformOrigin",options:e,fn(t){var y,x,w;const{placement:n,rects:r,middlewareData:o}=t,a=((y=o.arrow)==null?void 0:y.centerOffset)!==0,c=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[u,d]=po(n),f={start:"0%",center:"50%",end:"100%"}[d],p=(((x=o.arrow)==null?void 0:x.x)??0)+c/2,h=(((w=o.arrow)==null?void 0:w.y)??0)+l/2;let g="",v="";return u==="bottom"?(g=a?f:`${p}px`,v=`${-l}px`):u==="top"?(g=a?f:`${p}px`,v=`${r.floating.height+l}px`):u==="right"?(g=`${-l}px`,v=a?f:`${h}px`):u==="left"&&(g=`${r.floating.width+l}px`,v=a?f:`${h}px`),{data:{x:g,y:v}}}});function po(e){const[t,n="center"]=e.split("-");return[t,n]}var zt=so,ut=ao,Yt=lo,Xt=fo;function rl(e){const t=ol(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(sl);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function ol(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=al(o),c=cl(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var il=Symbol("radix.slottable");function sl(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===il}function cl(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function al(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ll=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ul=ll.reduce((e,t)=>{const n=rl(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),fl="Portal",ft=s.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[o,i]=s.useState(!1);Y(()=>i(!0),[]);const a=n||o&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?Js.createPortal(m.jsx(ul.div,{...r,ref:t}),a):null});ft.displayName=fl;function dl(e,t){return s.useReducer((n,r)=>t[n][r]??n,e)}var q=e=>{const{present:t,children:n}=e,r=pl(t),o=typeof n=="function"?n({present:r.isPresent}):s.Children.only(n),i=$(r.ref,ml(o));return typeof n=="function"||r.isPresent?s.cloneElement(o,{ref:i}):null};q.displayName="Presence";function pl(e){const[t,n]=s.useState(),r=s.useRef(null),o=s.useRef(e),i=s.useRef("none"),a=e?"mounted":"unmounted",[c,l]=dl(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const u=Et(r.current);i.current=c==="mounted"?u:"none"},[c]),Y(()=>{const u=r.current,d=o.current;if(d!==e){const p=i.current,h=Et(u);e?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Y(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=h=>{const v=Et(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&v&&(l("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=h=>{h.target===t&&(i.current=Et(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:s.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Et(e){return(e==null?void 0:e.animationName)||"none"}function ml(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function vl(e){const t=hl(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(yl);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function hl(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=wl(o),c=xl(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var mo=Symbol("radix.slottable");function gl(e){const t=({children:n})=>m.jsx(m.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=mo,t}function yl(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mo}function xl(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function wl(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Sl=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Cl=Sl.reduce((e,t)=>{const n=vl(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),bl=Wn[" useInsertionEffect ".trim().toString()]||Y;function Me({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,a]=El({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:o;{const d=s.useRef(e!==void 0);s.useEffect(()=>{const f=d.current;f!==c&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${c?"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.`),d.current=c},[c,r])}const u=s.useCallback(d=>{var f;if(c){const p=Pl(d)?d(e):d;p!==e&&((f=a.current)==null||f.call(a,p))}else i(d)},[c,e,i,a]);return[l,u]}function El({defaultProp:e,onChange:t}){const[n,r]=s.useState(e),o=s.useRef(n),i=s.useRef(t);return bl(()=>{i.current=t},[t]),s.useEffect(()=>{var a;o.current!==n&&((a=i.current)==null||a.call(i,n),o.current=n)},[n,o]),[n,r,i]}function Pl(e){return typeof e=="function"}function Rl(e){const t=_l(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Tl);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function _l(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=Nl(o),c=Ol(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Al=Symbol("radix.slottable");function Tl(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Al}function Ol(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Nl(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Il=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ml=Il.reduce((e,t)=>{const n=Rl(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),vo=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"}),Dl="VisuallyHidden",ho=s.forwardRef((e,t)=>m.jsx(Ml.span,{...e,ref:t,style:{...vo,...e.style}}));ho.displayName=Dl;var $l=ho,[Zt]=ec("Tooltip",[_e]),qt=_e(),go="TooltipProvider",jl=700,Tn="tooltip.open",[Ll,Xn]=Zt(go),yo=e=>{const{__scopeTooltip:t,delayDuration:n=jl,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,a=s.useRef(!0),c=s.useRef(!1),l=s.useRef(0);return s.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),m.jsx(Ll,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:s.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:s.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:s.useCallback(u=>{c.current=u},[]),disableHoverableContent:o,children:i})};yo.displayName=go;var it="Tooltip",[Fl,Qt]=Zt(it),xo=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:a,delayDuration:c}=e,l=Xn(it,e.__scopeTooltip),u=qt(t),[d,f]=s.useState(null),p=le(),h=s.useRef(0),g=a??l.disableHoverableContent,v=c??l.delayDuration,y=s.useRef(!1),[x,w]=Me({prop:r,defaultProp:o??!1,onChange:b=>{b?(l.onOpen(),document.dispatchEvent(new CustomEvent(Tn))):l.onClose(),i==null||i(b)},caller:it}),S=s.useMemo(()=>x?y.current?"delayed-open":"instant-open":"closed",[x]),C=s.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,w(!0)},[w]),E=s.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w(!1)},[w]),R=s.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,w(!0),h.current=0},v)},[v,w]);return s.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),m.jsx(zt,{...u,children:m.jsx(Fl,{scope:t,contentId:p,open:x,stateAttribute:S,trigger:d,onTriggerChange:f,onTriggerEnter:s.useCallback(()=>{l.isOpenDelayedRef.current?R():C()},[l.isOpenDelayedRef,R,C]),onTriggerLeave:s.useCallback(()=>{g?E():(window.clearTimeout(h.current),h.current=0)},[E,g]),onOpen:C,onClose:E,disableHoverableContent:g,children:n})})};xo.displayName=it;var On="TooltipTrigger",wo=s.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Qt(On,n),i=Xn(On,n),a=qt(n),c=s.useRef(null),l=$(t,c,o.onTriggerChange),u=s.useRef(!1),d=s.useRef(!1),f=s.useCallback(()=>u.current=!1,[]);return s.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),m.jsx(ut,{asChild:!0,...a,children:m.jsx(Cl.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:P(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:P(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:P(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:P(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:P(e.onBlur,o.onClose),onClick:P(e.onClick,o.onClose)})})});wo.displayName=On;var kl="TooltipPortal",[uv,Wl]=Zt(kl,{forceMount:void 0}),Ke="TooltipContent",So=s.forwardRef((e,t)=>{const n=Wl(Ke,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=Qt(Ke,e.__scopeTooltip);return m.jsx(q,{present:r||a.open,children:a.disableHoverableContent?m.jsx(Co,{side:o,...i,ref:t}):m.jsx(Vl,{side:o,...i,ref:t})})}),Vl=s.forwardRef((e,t)=>{const n=Qt(Ke,e.__scopeTooltip),r=Xn(Ke,e.__scopeTooltip),o=s.useRef(null),i=$(t,o),[a,c]=s.useState(null),{trigger:l,onClose:u}=n,d=o.current,{onPointerInTransitChange:f}=r,p=s.useCallback(()=>{c(null),f(!1)},[f]),h=s.useCallback((g,v)=>{const y=g.currentTarget,x={x:g.clientX,y:g.clientY},w=Gl(x,y.getBoundingClientRect()),S=zl(x,w),C=Yl(v.getBoundingClientRect()),E=Zl([...S,...C]);c(E),f(!0)},[f]);return s.useEffect(()=>()=>p(),[p]),s.useEffect(()=>{if(l&&d){const g=y=>h(y,d),v=y=>h(y,l);return l.addEventListener("pointerleave",g),d.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",v)}}},[l,d,h,p]),s.useEffect(()=>{if(a){const g=v=>{const y=v.target,x={x:v.clientX,y:v.clientY},w=(l==null?void 0:l.contains(y))||(d==null?void 0:d.contains(y)),S=!Xl(x,a);w?p():S&&(p(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,d,a,u,p]),m.jsx(Co,{...e,ref:i})}),[Bl,Hl]=Zt(it,{isInside:!1}),Ul=gl("TooltipContent"),Co=s.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...c}=e,l=Qt(Ke,n),u=qt(n),{onClose:d}=l;return s.useEffect(()=>(document.addEventListener(Tn,d),()=>document.removeEventListener(Tn,d)),[d]),s.useEffect(()=>{if(l.trigger){const f=p=>{const h=p.target;h!=null&&h.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),m.jsx(Xe,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:m.jsxs(Yt,{"data-state":l.stateAttribute,...u,...c,ref:t,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:[m.jsx(Ul,{children:r}),m.jsx(Bl,{scope:n,isInside:!0,children:m.jsx($l,{id:l.contentId,role:"tooltip",children:o||r})})]})})});So.displayName=Ke;var bo="TooltipArrow",Kl=s.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=qt(n);return Hl(bo,n).isInside?null:m.jsx(Xt,{...o,...r,ref:t})});Kl.displayName=bo;function Gl(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function zl(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Yl(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Xl(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const c=t[i],l=t[a],u=c.x,d=c.y,f=l.x,p=l.y;d>r!=p>r&&n<(f-u)*(r-d)/(p-d)+u&&(o=!o)}return o}function Zl(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),ql(t)}function ql(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}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 fv=yo,dv=xo,pv=wo,mv=So,Ql=Symbol.for("react.lazy"),jt=Wn[" use ".trim().toString()];function Jl(e){return typeof e=="object"&&e!==null&&"then"in e}function Eo(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Ql&&"_payload"in e&&Jl(e._payload)}function Po(e){const t=eu(e),n=s.forwardRef((r,o)=>{let{children:i,...a}=r;Eo(i)&&typeof jt=="function"&&(i=jt(i._payload));const c=s.Children.toArray(i),l=c.find(nu);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var vv=Po("Slot");function eu(e){const t=s.forwardRef((n,r)=>{let{children:o,...i}=n;if(Eo(o)&&typeof jt=="function"&&(o=jt(o._payload)),s.isValidElement(o)){const a=ou(o),c=ru(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tu=Symbol("radix.slottable");function nu(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tu}function ru(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function ou(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var iu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],dt=iu.reduce((e,t)=>{const n=Po(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),su="Separator",_r="horizontal",cu=["horizontal","vertical"],Ro=s.forwardRef((e,t)=>{const{decorative:n,orientation:r=_r,...o}=e,i=au(r)?r:_r,c=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return m.jsx(dt.div,{"data-orientation":i,...c,...o,ref:t})});Ro.displayName=su;function au(e){return cu.includes(e)}var hv=Ro;function lu(e,t){const n=s.createContext(t),r=i=>{const{children:a,...c}=i,l=s.useMemo(()=>c,Object.values(c));return m.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function o(i){const a=s.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function uu(e,t=[]){let n=[];function r(i,a){const c=s.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:h,...g}=f,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,y=s.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};u.displayName=i+"Provider";function d(f,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||c,g=s.useContext(h);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>s.createContext(a));return function(c){const l=(c==null?void 0:c[e])||i;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,fu(o,...t)]}function fu(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function du(e){const t=pu(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(vu);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function pu(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=gu(o),c=hu(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var mu=Symbol("radix.slottable");function vu(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mu}function hu(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function gu(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var yu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xu=yu.reduce((e,t)=>{const n=du(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),hn="focusScope.autoFocusOnMount",gn="focusScope.autoFocusOnUnmount",Ar={bubbles:!1,cancelable:!0},wu="FocusScope",pt=s.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[c,l]=s.useState(null),u=Z(o),d=Z(i),f=s.useRef(null),p=$(t,v=>l(v)),h=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(r){let v=function(S){if(h.paused||!c)return;const C=S.target;c.contains(C)?f.current=C:Ee(f.current,{select:!0})},y=function(S){if(h.paused||!c)return;const C=S.relatedTarget;C!==null&&(c.contains(C)||Ee(f.current,{select:!0}))},x=function(S){if(document.activeElement===document.body)for(const E of S)E.removedNodes.length>0&&Ee(c)};document.addEventListener("focusin",v),document.addEventListener("focusout",y);const w=new MutationObserver(x);return c&&w.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),w.disconnect()}}},[r,c,h.paused]),s.useEffect(()=>{if(c){Or.add(h);const v=document.activeElement;if(!c.contains(v)){const x=new CustomEvent(hn,Ar);c.addEventListener(hn,u),c.dispatchEvent(x),x.defaultPrevented||(Su(Ru(_o(c)),{select:!0}),document.activeElement===v&&Ee(c))}return()=>{c.removeEventListener(hn,u),setTimeout(()=>{const x=new CustomEvent(gn,Ar);c.addEventListener(gn,d),c.dispatchEvent(x),x.defaultPrevented||Ee(v??document.body,{select:!0}),c.removeEventListener(gn,d),Or.remove(h)},0)}}},[c,u,d,h]);const g=s.useCallback(v=>{if(!n&&!r||h.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,x=document.activeElement;if(y&&x){const w=v.currentTarget,[S,C]=Cu(w);S&&C?!v.shiftKey&&x===C?(v.preventDefault(),n&&Ee(S,{select:!0})):v.shiftKey&&x===S&&(v.preventDefault(),n&&Ee(C,{select:!0})):x===w&&v.preventDefault()}},[n,r,h.paused]);return m.jsx(xu.div,{tabIndex:-1,...a,ref:p,onKeyDown:g})});pt.displayName=wu;function Su(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ee(r,{select:t}),document.activeElement!==n)return}function Cu(e){const t=_o(e),n=Tr(t,e),r=Tr(t.reverse(),e);return[n,r]}function _o(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Tr(e,t){for(const n of e)if(!bu(n,{upTo:t}))return n}function bu(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 Eu(e){return e instanceof HTMLInputElement&&"select"in e}function Ee(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Eu(e)&&t&&e.select()}}var Or=Pu();function Pu(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Nr(e,t),e.unshift(t)},remove(t){var n;e=Nr(e,t),(n=e[0])==null||n.resume()}}}function Nr(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ru(e){return e.filter(t=>t.tagName!=="A")}function Ao(e){const t=_u(e),n=s.forwardRef((r,o)=>{const{children:i,...a}=r,c=s.Children.toArray(i),l=c.find(Tu);if(l){const u=l.props.children,d=c.map(f=>f===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return m.jsx(t,{...a,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,d):null})}return m.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function _u(e){const t=s.forwardRef((n,r)=>{const{children:o,...i}=n;if(s.isValidElement(o)){const a=Nu(o),c=Ou(i,o.props);return o.type!==s.Fragment&&(c.ref=r?X(r,a):a),s.cloneElement(o,c)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Au=Symbol("radix.slottable");function Tu(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Au}function Ou(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const l=i(...c);return o(...c),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Nu(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Iu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],mt=Iu.reduce((e,t)=>{const n=Ao(`Primitive.${t}`),r=s.forwardRef((o,i)=>{const{asChild:a,...c}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),yn=0;function Jt(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ir()),document.body.insertAdjacentElement("beforeend",e[1]??Ir()),yn++,()=>{yn===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),yn--}},[])}function Ir(){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 me=function(){return me=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},me.apply(this,arguments)};function To(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Mu(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Ot="right-scroll-bar-position",Nt="width-before-scroll-bar",Du="with-scroll-bars-hidden",$u="--removed-body-scroll-bar-size";function xn(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ju(e,t){var n=s.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Lu=typeof window<"u"?s.useLayoutEffect:s.useEffect,Mr=new WeakMap;function Fu(e,t){var n=ju(null,function(r){return e.forEach(function(o){return xn(o,r)})});return Lu(function(){var r=Mr.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(c){i.has(c)||xn(c,null)}),i.forEach(function(c){o.has(c)||xn(c,a)})}Mr.set(n,e)},[e]),n}function ku(e){return e}function Wu(e,t){t===void 0&&(t=ku);var n=[],r=!1,o={read:function(){if(r)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 a=t(i,r);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(i),a=n}var l=function(){var d=a;a=[],d.forEach(i)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return o}function Vu(e){e===void 0&&(e={});var t=Wu(null);return t.options=me({async:!0,ssr:!1},e),t}var Oo=function(e){var t=e.sideCar,n=To(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return s.createElement(r,me({},n))};Oo.isSideCarExport=!0;function Bu(e,t){return e.useMedium(t),Oo}var No=Vu(),wn=function(){},en=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:wn,onWheelCapture:wn,onTouchMoveCapture:wn}),o=r[0],i=r[1],a=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noRelative,g=e.noIsolation,v=e.inert,y=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,S=e.gapMode,C=To(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,R=Fu([n,t]),b=me(me({},C),o);return s.createElement(s.Fragment,null,d&&s.createElement(E,{sideCar:No,removeScrollBar:u,shards:f,noRelative:h,noIsolation:g,inert:v,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:S}),a?s.cloneElement(s.Children.only(c),me(me({},b),{ref:R})):s.createElement(w,me({},b,{className:l,ref:R}),c))});en.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};en.classNames={fullWidth:Nt,zeroRight:Ot};var Hu=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Uu(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Hu();return t&&e.setAttribute("nonce",t),e}function Ku(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Gu(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var zu=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Uu())&&(Ku(t,n),Gu(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Yu=function(){var e=zu();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Io=function(){var e=Yu(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Xu={left:0,top:0,right:0,gap:0},Sn=function(e){return parseInt(e||"",10)||0},Zu=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Sn(n),Sn(r),Sn(o)]},qu=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Xu;var t=Zu(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Qu=Io(),He="data-scroll-locked",Ju=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
2
2
  .`.concat(Du,` {
3
3
  overflow: hidden `).concat(r,`;
4
4
  padding-right: `).concat(c,"px ").concat(r,`;
@@ -56,4 +56,4 @@ Error generating stack: `+i.message+`
56
56
  * LICENSE.md file in the root directory of this source tree.
57
57
  *
58
58
  * @license MIT
59
- */function fl(){return fl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fl.apply(this,arguments)}function Bc(e,t){if(e==null)return{};var n={},r=Object.keys(e),l,i;for(i=0;i<r.length;i++)l=r[i],!(t.indexOf(l)>=0)&&(n[l]=e[l]);return n}function rh(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function lh(e,t){return e.button===0&&(!t||t==="_self")&&!rh(e)}function to(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(l=>[n,l]):[[n,r]])},[]))}function ih(e,t){let n=to(e);return t&&t.forEach((r,l)=>{n.has(l)||t.getAll(l).forEach(i=>{n.append(l,i)})}),n}const oh=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],uh=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],ah="6";try{window.__reactRouterVersion=ah}catch{}const sh=k.createContext({isTransitioning:!1}),ch="startTransition",ya=lf[ch];function Ch(e){let{basename:t,children:n,future:r,window:l}=e,i=k.useRef();i.current==null&&(i.current=fp({window:l,v5Compat:!0}));let o=i.current,[u,a]=k.useState({action:o.action,location:o.location}),{v7_startTransition:s}=r||{},h=k.useCallback(p=>{s&&ya?ya(()=>a(p)):a(p)},[a,s]);return k.useLayoutEffect(()=>o.listen(h),[o,h]),k.useEffect(()=>eh(r),[r]),k.createElement(nh,{basename:t,children:n,location:u.location,navigationType:u.action,navigator:o,future:r})}const fh=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",dh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ph=k.forwardRef(function(t,n){let{onClick:r,relative:l,reloadDocument:i,replace:o,state:u,target:a,to:s,preventScrollReset:h,viewTransition:p}=t,m=Bc(t,oh),{basename:g}=k.useContext(Je),y,w=!1;if(typeof s=="string"&&dh.test(s)&&(y=s,fh))try{let d=new URL(window.location.href),v=s.startsWith("//")?new URL(d.protocol+s):new URL(s),E=cn(v.pathname,g);v.origin===d.origin&&E!=null?s=E+v.search+v.hash:w=!0}catch{}let C=jp(s,{relative:l}),f=mh(s,{replace:o,state:u,target:a,preventScrollReset:h,relative:l,viewTransition:p});function c(d){r&&r(d),d.defaultPrevented||f(d)}return k.createElement("a",fl({},m,{href:y||C,onClick:w||i?r:c,ref:n,target:a}))}),xh=k.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:l=!1,className:i="",end:o=!1,style:u,to:a,viewTransition:s,children:h}=t,p=Bc(t,uh),m=zl(a,{relative:p.relative}),g=Ft(),y=k.useContext(Mc),{navigator:w,basename:C}=k.useContext(Je),f=y!=null&&vh(m)&&s===!0,c=w.encodeLocation?w.encodeLocation(m).pathname:m.pathname,d=g.pathname,v=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;l||(d=d.toLowerCase(),v=v?v.toLowerCase():null,c=c.toLowerCase()),v&&C&&(v=cn(v,C)||v);const E=c!=="/"&&c.endsWith("/")?c.length-1:c.length;let _=d===c||!o&&d.startsWith(c)&&d.charAt(E)==="/",N=v!=null&&(v===c||!o&&v.startsWith(c)&&v.charAt(c.length)==="/"),L={isActive:_,isPending:N,isTransitioning:f},B=_?r:void 0,T;typeof i=="function"?T=i(L):T=[i,_?"active":null,N?"pending":null,f?"transitioning":null].filter(Boolean).join(" ");let me=typeof u=="function"?u(L):u;return k.createElement(ph,fl({},p,{"aria-current":B,className:T,ref:n,style:me,to:a,viewTransition:s}),typeof h=="function"?h(L):h)});var no;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(no||(no={}));var ga;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(ga||(ga={}));function hh(e){let t=k.useContext(Nl);return t||$(!1),t}function mh(e,t){let{target:n,replace:r,state:l,preventScrollReset:i,relative:o,viewTransition:u}=t===void 0?{}:t,a=tu(),s=Ft(),h=zl(e,{relative:o});return k.useCallback(p=>{if(lh(p,n)){p.preventDefault();let m=r!==void 0?r:cl(s)===cl(h);a(e,{replace:m,state:l,preventScrollReset:i,relative:o,viewTransition:u})}},[s,a,h,r,l,n,e,i,o,u])}function Ph(e){let t=k.useRef(to(e)),n=k.useRef(!1),r=Ft(),l=k.useMemo(()=>ih(r.search,n.current?null:t.current),[r.search]),i=tu(),o=k.useCallback((u,a)=>{const s=to(typeof u=="function"?u(l):u);n.current=!0,i("?"+s,a)},[i,l]);return[l,o]}function vh(e,t){t===void 0&&(t={});let n=k.useContext(sh);n==null&&$(!1);let{basename:r}=hh(no.useViewTransitionState),l=zl(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=cn(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=cn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return bi(l.pathname,o)!=null||bi(l.pathname,i)!=null}export{Ch as B,ph as L,xh as N,kh as O,lf as R,cp as a,gh as b,rf as c,Ft as d,tu as e,Ph as f,Eh as g,th as h,Sh as i,wa as j,yh as k,k as r,wh as u};
59
+ */function fl(){return fl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fl.apply(this,arguments)}function Bc(e,t){if(e==null)return{};var n={},r=Object.keys(e),l,i;for(i=0;i<r.length;i++)l=r[i],!(t.indexOf(l)>=0)&&(n[l]=e[l]);return n}function rh(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function lh(e,t){return e.button===0&&(!t||t==="_self")&&!rh(e)}function to(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(l=>[n,l]):[[n,r]])},[]))}function ih(e,t){let n=to(e);return t&&t.forEach((r,l)=>{n.has(l)||t.getAll(l).forEach(i=>{n.append(l,i)})}),n}const oh=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],uh=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],ah="6";try{window.__reactRouterVersion=ah}catch{}const sh=k.createContext({isTransitioning:!1}),ch="startTransition",ya=lf[ch];function Ch(e){let{basename:t,children:n,future:r,window:l}=e,i=k.useRef();i.current==null&&(i.current=fp({window:l,v5Compat:!0}));let o=i.current,[u,a]=k.useState({action:o.action,location:o.location}),{v7_startTransition:s}=r||{},h=k.useCallback(p=>{s&&ya?ya(()=>a(p)):a(p)},[a,s]);return k.useLayoutEffect(()=>o.listen(h),[o,h]),k.useEffect(()=>eh(r),[r]),k.createElement(nh,{basename:t,children:n,location:u.location,navigationType:u.action,navigator:o,future:r})}const fh=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",dh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ph=k.forwardRef(function(t,n){let{onClick:r,relative:l,reloadDocument:i,replace:o,state:u,target:a,to:s,preventScrollReset:h,viewTransition:p}=t,m=Bc(t,oh),{basename:g}=k.useContext(Je),y,w=!1;if(typeof s=="string"&&dh.test(s)&&(y=s,fh))try{let d=new URL(window.location.href),v=s.startsWith("//")?new URL(d.protocol+s):new URL(s),E=cn(v.pathname,g);v.origin===d.origin&&E!=null?s=E+v.search+v.hash:w=!0}catch{}let C=jp(s,{relative:l}),f=mh(s,{replace:o,state:u,target:a,preventScrollReset:h,relative:l,viewTransition:p});function c(d){r&&r(d),d.defaultPrevented||f(d)}return k.createElement("a",fl({},m,{href:y||C,onClick:w||i?r:c,ref:n,target:a}))}),xh=k.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:l=!1,className:i="",end:o=!1,style:u,to:a,viewTransition:s,children:h}=t,p=Bc(t,uh),m=zl(a,{relative:p.relative}),g=Ft(),y=k.useContext(Mc),{navigator:w,basename:C}=k.useContext(Je),f=y!=null&&vh(m)&&s===!0,c=w.encodeLocation?w.encodeLocation(m).pathname:m.pathname,d=g.pathname,v=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;l||(d=d.toLowerCase(),v=v?v.toLowerCase():null,c=c.toLowerCase()),v&&C&&(v=cn(v,C)||v);const E=c!=="/"&&c.endsWith("/")?c.length-1:c.length;let _=d===c||!o&&d.startsWith(c)&&d.charAt(E)==="/",N=v!=null&&(v===c||!o&&v.startsWith(c)&&v.charAt(c.length)==="/"),L={isActive:_,isPending:N,isTransitioning:f},B=_?r:void 0,T;typeof i=="function"?T=i(L):T=[i,_?"active":null,N?"pending":null,f?"transitioning":null].filter(Boolean).join(" ");let me=typeof u=="function"?u(L):u;return k.createElement(ph,fl({},p,{"aria-current":B,className:T,ref:n,style:me,to:a,viewTransition:s}),typeof h=="function"?h(L):h)});var no;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(no||(no={}));var ga;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(ga||(ga={}));function hh(e){let t=k.useContext(Nl);return t||$(!1),t}function mh(e,t){let{target:n,replace:r,state:l,preventScrollReset:i,relative:o,viewTransition:u}=t===void 0?{}:t,a=tu(),s=Ft(),h=zl(e,{relative:o});return k.useCallback(p=>{if(lh(p,n)){p.preventDefault();let m=r!==void 0?r:cl(s)===cl(h);a(e,{replace:m,state:l,preventScrollReset:i,relative:o,viewTransition:u})}},[s,a,h,r,l,n,e,i,o,u])}function Ph(e){let t=k.useRef(to(e)),n=k.useRef(!1),r=Ft(),l=k.useMemo(()=>ih(r.search,n.current?null:t.current),[r.search]),i=tu(),o=k.useCallback((u,a)=>{const s=to(typeof u=="function"?u(l):u);n.current=!0,i("?"+s,a)},[i,l]);return[l,o]}function vh(e,t){t===void 0&&(t={});let n=k.useContext(sh);n==null&&$(!1);let{basename:r}=hh(no.useViewTransitionState),l=zl(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=cn(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=cn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return bi(l.pathname,o)!=null||bi(l.pathname,i)!=null}export{Ch as B,ph as L,xh as N,kh as O,lf as R,cp as a,gh as b,rf as c,Ft as d,tu as e,Ph as f,wa as g,Eh as h,th as i,Sh as j,yh as k,k as r,wh as u};
package/dist/index.html CHANGED
@@ -11,13 +11,13 @@
11
11
  href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap"
12
12
  rel="stylesheet"
13
13
  />
14
- <script type="module" crossorigin src="/assets/index-BezQbQuU.js"></script>
15
- <link rel="modulepreload" crossorigin href="/assets/vendor-react-ChOmrACb.js">
16
- <link rel="modulepreload" crossorigin href="/assets/vendor-query-DOje7EXl.js">
17
- <link rel="modulepreload" crossorigin href="/assets/vendor-radix-DganjVC1.js">
18
- <link rel="modulepreload" crossorigin href="/assets/vendor-dnd-DmX4J2r6.js">
19
- <link rel="modulepreload" crossorigin href="/assets/vendor-editor-D6k4FPZ2.js">
20
- <link rel="stylesheet" crossorigin href="/assets/index-Rp0DT-rw.css">
14
+ <script type="module" crossorigin src="/assets/index-Cmix-MPs.js"></script>
15
+ <link rel="modulepreload" crossorigin href="/assets/vendor-react-GAVzOgi0.js">
16
+ <link rel="modulepreload" crossorigin href="/assets/vendor-query-B9zjiv_I.js">
17
+ <link rel="modulepreload" crossorigin href="/assets/vendor-radix-CvpS4Cp5.js">
18
+ <link rel="modulepreload" crossorigin href="/assets/vendor-dnd-DY2LDzZ0.js">
19
+ <link rel="modulepreload" crossorigin href="/assets/vendor-editor-Bc-lI3f8.js">
20
+ <link rel="stylesheet" crossorigin href="/assets/index-C3HXSg1T.css">
21
21
  </head>
22
22
  <body>
23
23
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meridianjs/admin-dashboard",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -1,6 +0,0 @@
1
- import{j as i,u as It,a as kt}from"./vendor-query-DOje7EXl.js";import{r as l,c as Oe,j as At,k as K,u as Et}from"./vendor-react-ChOmrACb.js";import{c as Rt,t as G,n as ne,d as Ot,m as Pt,e as Pe,a as Tt,g as Ce,b as Lt,f as Se,h as V,i as Bt,j as S,C as Wt,k as $t,l as Gt,o as H,p as de,q as $,r as W,s as Ht,P as Te,u as Ft,v as zt,w as Ut,x as Xt,y as Yt,z as Kt,B as Vt,I as qt,A as Jt,D as Qt,E as Zt,F as en}from"./index-BezQbQuU.js";import{a as tn,D as oe,M as nn,g as Le}from"./vendor-dnd-DmX4J2r6.js";import{a6 as on,a7 as sn,a8 as rn,a9 as an,a3 as F,aa as Be,ab as cn,ac as ln,ad as dn,ae as un,af as fn,ag as mn,ah as hn,ai as pn,aj as gn,ak as xn,al as vn,am as yn,an as bn}from"./vendor-radix-DganjVC1.js";import"./vendor-editor-D6k4FPZ2.js";/**
2
- * @license lucide-react v0.468.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const wn=Rt("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);function Q(e,t){const n=+G(e)-+G(t);return n<0?-1:n>0?1:n}function We(e,t,n){const[o,s]=ne(n==null?void 0:n.in,e,t),r=je(o,s),c=Math.abs(Ot(o,s));o.setDate(o.getDate()-r*c);const a=+(je(o,s)===-r),d=r*(c-a);return d===0?0:d}function je(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function $e(e){return t=>{const o=(e?Math[e]:Math.trunc)(t);return o===0?0:o}}function Mn(e,t,n){const[o,s]=ne(n==null?void 0:n.in,e,t),r=(+o-+s)/Pt;return $e(n==null?void 0:n.roundingMethod)(r)}function Cn(e,t){return+G(e)-+G(t)}function Ge(e,t){const n=G(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function Sn(e,t){const n=G(e,t==null?void 0:t.in);return+Ge(n,t)==+Pe(n,t)}function He(e,t,n){const[o,s,r]=ne(n==null?void 0:n.in,e,e,t),c=Q(s,r),a=Math.abs(Tt(s,r));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-c*a);let d=Q(s,r)===-c;Sn(o)&&a===1&&Q(o,r)===1&&(d=!1);const u=c*(a-+d);return u===0?0:u}function jn(e,t,n){const o=Cn(e,t)/1e3;return $e(n==null?void 0:n.roundingMethod)(o)}function _e(e,t,n){const s=Bt().locale??Lt,r=2520,c=Q(e,t);if(isNaN(c))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:c}),[d,u]=ne(n==null?void 0:n.in,...c>0?[t,e]:[e,t]),p=jn(u,d),h=(Ce(u)-Ce(d))/1e3,f=Math.round((p-h)/60);let g;if(f<2)return f===0?s.formatDistance("lessThanXMinutes",1,a):s.formatDistance("xMinutes",f,a);if(f<45)return s.formatDistance("xMinutes",f,a);if(f<90)return s.formatDistance("aboutXHours",1,a);if(f<Se){const v=Math.round(f/60);return s.formatDistance("aboutXHours",v,a)}else{if(f<r)return s.formatDistance("xDays",1,a);if(f<V){const v=Math.round(f/Se);return s.formatDistance("xDays",v,a)}else if(f<V*2)return g=Math.round(f/V),s.formatDistance("aboutXMonths",g,a)}if(g=He(u,d),g<12){const v=Math.round(f/V);return s.formatDistance("xMonths",v,a)}else{const v=g%12,M=Math.trunc(g/12);return v<3?s.formatDistance("aboutXYears",M,a):v<9?s.formatDistance("overXYears",M,a):s.formatDistance("almostXYears",M+1,a)}}function De(e,t){return G(e,t==null?void 0:t.in).getDate()}const se=e=>{let{transform:t}=e;return{...t,y:0}};function pe(){const[e,t]=l.useState({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0}),n=l.useRef(null);return l.useLayoutEffect(()=>{const o=s=>{var c;let r={x:s.pageX,y:s.pageY};if(((c=n.current)==null?void 0:c.nodeType)===Node.ELEMENT_NODE){const{left:a,top:d}=n.current.getBoundingClientRect(),u=a+window.scrollX,p=d+window.scrollY,h=s.pageX-u,f=s.pageY-p;r.elementX=h,r.elementY=f,r.elementPositionX=u,r.elementPositionY=p}t(a=>({...a,...r}))};return document.addEventListener("mousemove",o),()=>{document.removeEventListener("mousemove",o)}},[]),[e,n]}function _n(e,t=500){const[n,o]=l.useState(e),s=l.useRef(null);return l.useEffect(()=>{const r=Date.now();if(s.current&&r>=s.current+t)s.current=r,o(e);else{const c=window.setTimeout(()=>{s.current=r,o(e)},t);return()=>window.clearTimeout(c)}},[e,t]),n}function Dn(){const[e,t]=l.useState({x:null,y:null}),n=l.useCallback((...o)=>{if(typeof o[0]=="object")window.scrollTo(o[0]);else if(typeof o[0]=="number"&&typeof o[1]=="number")window.scrollTo(o[0],o[1]);else throw new Error("Invalid arguments passed to scrollTo. See here for more info. https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo")},[]);return l.useLayoutEffect(()=>{const o=()=>{t({x:window.scrollX,y:window.scrollY})};return o(),window.addEventListener("scroll",o),()=>{window.removeEventListener("scroll",o)}},[]),[e,n]}const B={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function Fe(e){return"init"in e}function ue(e){return!!e.write}function Ne(e){return"v"in e||"e"in e}function Z(e){if("e"in e)throw e.e;if((B?"production":void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v}function ee(e){return typeof(e==null?void 0:e.then)=="function"}function ze(e,t,n){if(!n.p.has(e)){n.p.add(e);const o=()=>n.p.delete(e);t.then(o,o)}}function Ue(e,t,n){var o;const s=new Set;for(const r of((o=n.get(e))==null?void 0:o.t)||[])s.add(r);for(const r of t.p)s.add(r);return s}const Nn=(e,t,...n)=>t.read(...n),In=(e,t,...n)=>t.write(...n),kn=(e,t)=>{var n;return(n=t.INTERNAL_onInit)==null?void 0:n.call(t,e)},An=(e,t,n)=>{var o;return(o=t.onMount)==null?void 0:o.call(t,n)},En=(e,t)=>{var n;const o=k(e),s=o[0],r=o[6],c=o[9];if((B?"production":void 0)!=="production"&&!t)throw new Error("Atom is undefined or null");let a=s.get(t);return a||(a={d:new Map,p:new Set,n:0},s.set(t,a),(n=r.i)==null||n.call(r,t),c==null||c(e,t)),a},Rn=e=>{const t=k(e),n=t[1],o=t[3],s=t[4],r=t[5],c=t[6],a=t[13],d=[],u=p=>{try{p()}catch(h){d.push(h)}};do{c.f&&u(c.f);const p=new Set,h=p.add.bind(p);o.forEach(f=>{var g;return(g=n.get(f))==null?void 0:g.l.forEach(h)}),o.clear(),r.forEach(h),r.clear(),s.forEach(h),s.clear(),p.forEach(u),o.size&&a(e)}while(o.size||r.size||s.size);if(d.length)throw new AggregateError(d)},On=e=>{const t=k(e),n=t[1],o=t[2],s=t[3],r=t[11],c=t[14],a=t[17],d=[],u=new WeakSet,p=new WeakSet,h=Array.from(s);for(;h.length;){const f=h[h.length-1],g=r(e,f);if(p.has(f)){h.pop();continue}if(u.has(f)){if(o.get(f)===g.n)d.push([f,g]);else if((B?"production":void 0)!=="production"&&o.has(f))throw new Error("[Bug] invalidated atom exists");p.add(f),h.pop();continue}u.add(f);for(const v of Ue(f,g,n))u.has(v)||h.push(v)}for(let f=d.length-1;f>=0;--f){const[g,v]=d[f];let M=!1;for(const D of v.d.keys())if(D!==g&&s.has(D)){M=!0;break}M&&(c(e,g),a(e,g)),o.delete(g)}},fe=new WeakSet,Pn=(e,t)=>{var n,o;const s=k(e),r=s[1],c=s[2],a=s[3],d=s[6],u=s[7],p=s[11],h=s[12],f=s[13],g=s[14],v=s[16],M=s[17],D=s[20],y=s[26],x=p(e,t);if(Ne(x)){if(r.has(t)&&c.get(t)!==x.n)return x;let w=!1;for(const[I,E]of x.d)if(g(e,I).n!==E){w=!0;break}if(!w)return x}let j=!0;const A=new Set(x.d.keys()),_=new Map,m=()=>{for(const w of A)_.has(w)||x.d.delete(w)},C=()=>{if(r.has(t)){const w=!a.size;M(e,t),w&&(f(e),h(e))}},b=w=>{var I;if(w===t){const Y=p(e,w);if(!Ne(Y))if(Fe(w))D(e,w,w.init);else throw new Error("no atom init");return Z(Y)}const E=g(e,w);try{return Z(E)}finally{_.set(w,E.n),x.d.set(w,E.n),ee(x.v)&&ze(t,x.v,E),r.has(t)&&((I=r.get(w))==null||I.t.add(t)),j||C()}};let R,T;const N={get signal(){return R||(R=new AbortController),R.signal},get setSelf(){return(B?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(B?"production":void 0)!=="production"&&!ue(t)&&console.warn("setSelf function cannot be used with read-only atom"),!T&&ue(t)&&(T=(...w)=>{if((B?"production":void 0)!=="production"&&j&&console.warn("setSelf function cannot be called in sync"),!j)try{return v(e,t,...w)}finally{f(e),h(e)}}),T}},O=x.n;try{(B?"production":void 0)!=="production"&&fe.delete(e);const w=u(e,t,b,N);if((B?"production":void 0)!=="production"&&fe.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),D(e,t,w),ee(w)){y(e,w,()=>R==null?void 0:R.abort());const I=()=>{m(),C()};w.then(I,I)}else m();return(n=d.r)==null||n.call(d,t),x}catch(w){return delete x.v,x.e=w,++x.n,x}finally{j=!1,O!==x.n&&c.get(t)===O&&(c.set(t,x.n),a.add(t),(o=d.c)==null||o.call(d,t))}},Tn=(e,t)=>{const n=k(e),o=n[1],s=n[2],r=n[11],c=[t];for(;c.length;){const a=c.pop(),d=r(e,a);for(const u of Ue(a,d,o)){const p=r(e,u);s.get(u)!==p.n&&(s.set(u,p.n),c.push(u))}}},Ln=(e,t,...n)=>{const o=k(e),s=o[3],r=o[6],c=o[8],a=o[11],d=o[12],u=o[13],p=o[14],h=o[15],f=o[16],g=o[17],v=o[20];let M=!0;const D=x=>Z(p(e,x)),y=(x,...j)=>{var A;const _=a(e,x);try{if(x===t){if(!Fe(x))throw new Error("atom not writable");(B?"production":void 0)!=="production"&&fe.add(e);const m=_.n,C=j[0];v(e,x,C),g(e,x),m!==_.n&&(s.add(x),h(e,x),(A=r.c)==null||A.call(r,x));return}else return f(e,x,...j)}finally{M||(u(e),d(e))}};try{return c(e,t,D,y,...n)}finally{M=!1}},Bn=(e,t)=>{var n;const o=k(e),s=o[1],r=o[3],c=o[6],a=o[11],d=o[15],u=o[18],p=o[19],h=a(e,t),f=s.get(t);if(f){for(const[g,v]of h.d)if(!f.d.has(g)){const M=a(e,g);u(e,g).t.add(t),f.d.add(g),v!==M.n&&(r.add(g),d(e,g),(n=c.c)==null||n.call(c,g))}for(const g of f.d)if(!h.d.has(g)){f.d.delete(g);const v=p(e,g);v==null||v.t.delete(t)}}},Wn=(e,t)=>{var n;const o=k(e),s=o[1],r=o[4],c=o[6],a=o[10],d=o[11],u=o[12],p=o[13],h=o[14],f=o[16],g=o[18],v=d(e,t);let M=s.get(t);if(!M){h(e,t);for(const D of v.d.keys())g(e,D).t.add(t);if(M={l:new Set,d:new Set(v.d.keys()),t:new Set},s.set(t,M),ue(t)){const D=()=>{let y=!0;const x=(...j)=>{try{return f(e,t,...j)}finally{y||(p(e),u(e))}};try{const j=a(e,t,x);j&&(M.u=()=>{y=!0;try{j()}finally{y=!1}})}finally{y=!1}};r.add(D)}(n=c.m)==null||n.call(c,t)}return M},$n=(e,t)=>{var n,o;const s=k(e),r=s[1],c=s[5],a=s[6],d=s[11],u=s[19],p=d(e,t);let h=r.get(t);if(!h||h.l.size)return h;let f=!1;for(const g of h.t)if((n=r.get(g))!=null&&n.d.has(t)){f=!0;break}if(!f){h.u&&c.add(h.u),h=void 0,r.delete(t);for(const g of p.d.keys()){const v=u(e,g);v==null||v.t.delete(t)}(o=a.u)==null||o.call(a,t);return}return h},Gn=(e,t,n)=>{const o=k(e),s=o[11],r=o[27],c=s(e,t),a="v"in c,d=c.v;if(ee(n))for(const u of c.d.keys())ze(t,n,s(e,u));c.v=n,delete c.e,(!a||!Object.is(d,c.v))&&(++c.n,ee(d)&&r(e,d))},Hn=(e,t)=>{const n=k(e)[14];return Z(n(e,t))},Fn=(e,t,...n)=>{const o=k(e),s=o[12],r=o[13],c=o[16];try{return c(e,t,...n)}finally{r(e),s(e)}},zn=(e,t,n)=>{const o=k(e),s=o[12],r=o[18],c=o[19],d=r(e,t).l;return d.add(n),s(e),()=>{d.delete(n),c(e,t),s(e)}},Un=(e,t,n)=>{const s=k(e)[25];let r=s.get(t);if(!r){r=new Set,s.set(t,r);const c=()=>s.delete(t);t.then(c,c)}r.add(n)},Xn=(e,t)=>{const s=k(e)[25].get(t);s==null||s.forEach(r=>r())},Xe=new WeakMap,k=e=>{const t=Xe.get(e);if((B?"production":void 0)!=="production"&&!t)throw new Error("Store must be created by buildStore to read its building blocks");return t};function Yn(e){const t=k(e),n=t[24];return n?n(t):t}function Kn(...e){const t={get(o){const s=k(t)[21];return s(t,o)},set(o,...s){const r=k(t)[22];return r(t,o,...s)},sub(o,s){const r=k(t)[23];return r(t,o,s)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},Nn,In,kn,An,En,Rn,On,Pn,Tn,Ln,Bn,Wn,$n,Gn,Hn,Fn,zn,void 0,new WeakMap,Un,Xn].map((o,s)=>e[s]||o);return Xe.set(t,Object.freeze(n)),t}const Ye={};let Vn=0;function Ke(e,t){const n=`atom${++Vn}`,o={toString(){return(Ye?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof e=="function"?o.read=e:(o.init=e,o.read=qn,o.write=Jn),o}function qn(e){return e(this)}function Jn(e,t,n){return t(this,typeof n=="function"?n(e(this)):n)}function Qn(){return Kn()}let z;function Zn(){return z||(z=Qn(),(Ye?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=z),globalThis.__JOTAI_DEFAULT_STORE__!==z&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),z}const eo={},to=l.createContext(void 0);function Ve(e){return l.useContext(to)||Zn()}const me=e=>typeof(e==null?void 0:e.then)=="function",he=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},no=Oe.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(he(e),e)}),re=new WeakMap,Ie=(e,t,n)=>{const s=Yn(e)[26];let r=re.get(t);return r||(r=new Promise((c,a)=>{let d=t;const u=f=>g=>{d===f&&c(g)},p=f=>g=>{d===f&&a(g)},h=()=>{try{const f=n();me(f)?(re.set(f,r),d=f,f.then(u(f),p(f)),s(e,f,h)):c(f)}catch(f){a(f)}};t.then(u(t),p(t)),s(e,t,h)}),re.set(t,r)),r};function oo(e,t){const{delay:n,unstable_promiseStatus:o=!Oe.use}={},s=Ve(),[[r,c,a],d]=l.useReducer(p=>{const h=s.get(e);return Object.is(p[0],h)&&p[1]===s&&p[2]===e?p:[h,s,e]},void 0,()=>[s.get(e),s,e]);let u=r;if((c!==s||a!==e)&&(d(),u=s.get(e)),l.useEffect(()=>{const p=s.sub(e,()=>{if(o)try{const h=s.get(e);me(h)&&he(Ie(s,h,()=>s.get(e)))}catch{}if(typeof n=="number"){setTimeout(d,n);return}d()});return d(),p},[s,e,n,o]),l.useDebugValue(u),me(u)){const p=Ie(s,u,()=>s.get(e));return o&&he(p),no(p)}return u}function so(e,t){const n=Ve();return l.useCallback((...s)=>{if((eo?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return n.set(e,...s)},[n,e])}function qe(e,t){return[oo(e),so(e)]}var Je="Expected a function",ke=NaN,ro="[object Symbol]",ao=/^\s+|\s+$/g,io=/^[-+]0x[0-9a-f]+$/i,co=/^0b[01]+$/i,lo=/^0o[0-7]+$/i,uo=parseInt,fo=typeof K=="object"&&K&&K.Object===Object&&K,mo=typeof self=="object"&&self&&self.Object===Object&&self,ho=fo||mo||Function("return this")(),po=Object.prototype,go=po.toString,xo=Math.max,vo=Math.min,ae=function(){return ho.Date.now()};function yo(e,t,n){var o,s,r,c,a,d,u=0,p=!1,h=!1,f=!0;if(typeof e!="function")throw new TypeError(Je);t=Ae(t)||0,te(n)&&(p=!!n.leading,h="maxWait"in n,r=h?xo(Ae(n.maxWait)||0,t):r,f="trailing"in n?!!n.trailing:f);function g(m){var C=o,b=s;return o=s=void 0,u=m,c=e.apply(b,C),c}function v(m){return u=m,a=setTimeout(y,t),p?g(m):c}function M(m){var C=m-d,b=m-u,R=t-C;return h?vo(R,r-b):R}function D(m){var C=m-d,b=m-u;return d===void 0||C>=t||C<0||h&&b>=r}function y(){var m=ae();if(D(m))return x(m);a=setTimeout(y,M(m))}function x(m){return a=void 0,f&&o?g(m):(o=s=void 0,c)}function j(){a!==void 0&&clearTimeout(a),u=0,o=d=s=a=void 0}function A(){return a===void 0?c:x(ae())}function _(){var m=ae(),C=D(m);if(o=arguments,s=this,d=m,C){if(a===void 0)return v(d);if(h)return a=setTimeout(y,t),g(d)}return a===void 0&&(a=setTimeout(y,t)),c}return _.cancel=j,_.flush=A,_}function bo(e,t,n){var o=!0,s=!0;if(typeof e!="function")throw new TypeError(Je);return te(n)&&(o="leading"in n?!!n.leading:o,s="trailing"in n?!!n.trailing:s),yo(e,t,{leading:o,maxWait:t,trailing:s})}function te(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function wo(e){return!!e&&typeof e=="object"}function Mo(e){return typeof e=="symbol"||wo(e)&&go.call(e)==ro}function Ae(e){if(typeof e=="number")return e;if(Mo(e))return ke;if(te(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=te(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(ao,"");var n=co.test(e);return n||lo.test(e)?uo(e.slice(2),n?2:8):io.test(e)?ke:+e}var Co=bo;const So=At(Co),Qe=l.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:S("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Qe.displayName="Card";const jo=l.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:S("flex flex-col space-y-1.5 p-6",e),...t}));jo.displayName="CardHeader";const _o=l.forwardRef(({className:e,...t},n)=>i.jsx("h3",{ref:n,className:S("text-2xl font-semibold leading-none tracking-tight",e),...t}));_o.displayName="CardTitle";const Do=l.forwardRef(({className:e,...t},n)=>i.jsx("p",{ref:n,className:S("text-sm text-muted-foreground",e),...t}));Do.displayName="CardDescription";const No=l.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:S("p-6 pt-0",e),...t}));No.displayName="CardContent";const Io=l.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:S("flex items-center p-6 pt-0",e),...t}));Io.displayName="CardFooter";function ko(e,t=[]){let n=[];function o(r,c){const a=l.createContext(c),d=n.length;n=[...n,c];const u=h=>{var y;const{scope:f,children:g,...v}=h,M=((y=f==null?void 0:f[e])==null?void 0:y[d])||a,D=l.useMemo(()=>v,Object.values(v));return i.jsx(M.Provider,{value:D,children:g})};u.displayName=r+"Provider";function p(h,f){var M;const g=((M=f==null?void 0:f[e])==null?void 0:M[d])||a,v=l.useContext(g);if(v)return v;if(c!==void 0)return c;throw new Error(`\`${h}\` must be used within \`${r}\``)}return[u,p]}const s=()=>{const r=n.map(c=>l.createContext(c));return function(a){const d=(a==null?void 0:a[e])||r;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:d}}),[a,d])}};return s.scopeName=e,[o,Ao(s,...t)]}function Ao(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(r){const c=o.reduce((a,{useScope:d,scopeName:u})=>{const h=d(r)[`__scope${u}`];return{...a,...h}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function Eo(e){const t=Ro(e),n=l.forwardRef((o,s)=>{const{children:r,...c}=o,a=l.Children.toArray(r),d=a.find(Po);if(d){const u=d.props.children,p=a.map(h=>h===d?l.Children.count(u)>1?l.Children.only(null):l.isValidElement(u)?u.props.children:null:h);return i.jsx(t,{...c,ref:s,children:l.isValidElement(u)?l.cloneElement(u,void 0,p):null})}return i.jsx(t,{...c,ref:s,children:r})});return n.displayName=`${e}.Slot`,n}function Ro(e){const t=l.forwardRef((n,o)=>{const{children:s,...r}=n;if(l.isValidElement(s)){const c=Lo(s),a=To(r,s.props);return s.type!==l.Fragment&&(a.ref=o?on(o,c):c),l.cloneElement(s,a)}return l.Children.count(s)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Oo=Symbol("radix.slottable");function Po(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Oo}function To(e,t){const n={...t};for(const o in t){const s=e[o],r=t[o];/^on[A-Z]/.test(o)?s&&r?n[o]=(...a)=>{const d=r(...a);return s(...a),d}:s&&(n[o]=s):o==="style"?n[o]={...s,...r}:o==="className"&&(n[o]=[s,r].filter(Boolean).join(" "))}return{...e,...n}}function Lo(e){var o,s;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Bo=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wo=Bo.reduce((e,t)=>{const n=Eo(`Primitive.${t}`),o=l.forwardRef((s,r)=>{const{asChild:c,...a}=s,d=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(d,{...a,ref:r})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),ge="ContextMenu",[$o]=ko(ge,[Be]),P=Be(),[Go,Ze]=$o(ge),et=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:o,dir:s,modal:r=!0}=e,[c,a]=l.useState(!1),d=P(t),u=sn(o),p=l.useCallback(h=>{a(h),u(h)},[u]);return i.jsx(Go,{scope:t,open:c,onOpenChange:p,modal:r,children:i.jsx(rn,{...d,dir:s,open:c,onOpenChange:p,modal:r,children:n})})};et.displayName=ge;var tt="ContextMenuTrigger",nt=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:o=!1,...s}=e,r=Ze(tt,n),c=P(n),a=l.useRef({x:0,y:0}),d=l.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),u=l.useRef(0),p=l.useCallback(()=>window.clearTimeout(u.current),[]),h=f=>{a.current={x:f.clientX,y:f.clientY},r.onOpenChange(!0)};return l.useEffect(()=>p,[p]),l.useEffect(()=>void(o&&p()),[o,p]),i.jsxs(i.Fragment,{children:[i.jsx(an,{...c,virtualRef:d}),i.jsx(Wo.span,{"data-state":r.open?"open":"closed","data-disabled":o?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:o?e.onContextMenu:F(e.onContextMenu,f=>{p(),h(f),f.preventDefault()}),onPointerDown:o?e.onPointerDown:F(e.onPointerDown,q(f=>{p(),u.current=window.setTimeout(()=>h(f),700)})),onPointerMove:o?e.onPointerMove:F(e.onPointerMove,q(p)),onPointerCancel:o?e.onPointerCancel:F(e.onPointerCancel,q(p)),onPointerUp:o?e.onPointerUp:F(e.onPointerUp,q(p))})]})});nt.displayName=tt;var Ho="ContextMenuPortal",ot=e=>{const{__scopeContextMenu:t,...n}=e,o=P(t);return i.jsx(cn,{...o,...n})};ot.displayName=Ho;var st="ContextMenuContent",rt=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=Ze(st,n),r=P(n),c=l.useRef(!1);return i.jsx(ln,{...r,...o,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{var d;(d=e.onCloseAutoFocus)==null||d.call(e,a),!a.defaultPrevented&&c.current&&a.preventDefault(),c.current=!1},onInteractOutside:a=>{var d;(d=e.onInteractOutside)==null||d.call(e,a),!a.defaultPrevented&&!s.modal&&(c.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});rt.displayName=st;var Fo="ContextMenuGroup",zo=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=P(n);return i.jsx(un,{...s,...o,ref:t})});zo.displayName=Fo;var Uo="ContextMenuLabel",at=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=P(n);return i.jsx(fn,{...s,...o,ref:t})});at.displayName=Uo;var Xo="ContextMenuItem",it=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=P(n);return i.jsx(dn,{...s,...o,ref:t})});it.displayName=Xo;var Yo="ContextMenuCheckboxItem",ct=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=P(n);return i.jsx(mn,{...s,...o,ref:t})});ct.displayName=Yo;var Ko="ContextMenuRadioGroup",Vo=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=P(n);return i.jsx(hn,{...s,...o,ref:t})});Vo.displayName=Ko;var qo="ContextMenuRadioItem",lt=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=P(n);return i.jsx(pn,{...s,...o,ref:t})});lt.displayName=qo;var Jo="ContextMenuItemIndicator",dt=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=P(n);return i.jsx(gn,{...s,...o,ref:t})});dt.displayName=Jo;var Qo="ContextMenuSeparator",ut=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=P(n);return i.jsx(xn,{...s,...o,ref:t})});ut.displayName=Qo;var Zo="ContextMenuArrow",es=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=P(n);return i.jsx(vn,{...s,...o,ref:t})});es.displayName=Zo;var ts="ContextMenuSubTrigger",ft=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=P(n);return i.jsx(yn,{...s,...o,ref:t})});ft.displayName=ts;var ns="ContextMenuSubContent",mt=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=P(n);return i.jsx(bn,{...s,...o,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});mt.displayName=ns;function q(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var os=et,ss=nt,rs=ot,ht=rt,pt=at,gt=it,xt=ct,vt=lt,yt=dt,bt=ut,wt=ft,Mt=mt;const as=os,is=ss,cs=l.forwardRef(({className:e,inset:t,children:n,...o},s)=>i.jsxs(wt,{ref:s,className:S("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...o,children:[n,i.jsx(Wt,{className:"ml-auto h-4 w-4"})]}));cs.displayName=wt.displayName;const ls=l.forwardRef(({className:e,...t},n)=>i.jsx(Mt,{ref:n,className:S("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",e),...t}));ls.displayName=Mt.displayName;const Ct=l.forwardRef(({className:e,...t},n)=>i.jsx(rs,{children:i.jsx(ht,{ref:n,className:S("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 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",e),...t})}));Ct.displayName=ht.displayName;const St=l.forwardRef(({className:e,inset:t,...n},o)=>i.jsx(gt,{ref:o,className:S("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));St.displayName=gt.displayName;const ds=l.forwardRef(({className:e,children:t,checked:n,...o},s)=>i.jsxs(xt,{ref:s,className:S("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...o,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(yt,{children:i.jsx($t,{className:"h-4 w-4"})})}),t]}));ds.displayName=xt.displayName;const us=l.forwardRef(({className:e,children:t,...n},o)=>i.jsxs(vt,{ref:o,className:S("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(yt,{children:i.jsx(Gt,{className:"h-2 w-2 fill-current"})})}),t]}));us.displayName=vt.displayName;const fs=l.forwardRef(({className:e,inset:t,...n},o)=>i.jsx(pt,{ref:o,className:S("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...n}));fs.displayName=pt.displayName;const ms=l.forwardRef(({className:e,...t},n)=>i.jsx(bt,{ref:n,className:S("-mx-1 my-1 h-px bg-border",e),...t}));ms.displayName=bt.displayName;const hs=Ke(!1),ps=Ke(0),xe=()=>qe(hs),ve=()=>qe(ps),gs=e=>{let t=n=>1;return(e==="monthly"||e==="quarterly")&&(t=H),t},X=e=>{let t=We;return(e==="monthly"||e==="quarterly")&&(t=He),t},ye=e=>{let t=Mn;return(e==="monthly"||e==="quarterly")&&(t=We),t},be=e=>{let t=Ht;return(e==="monthly"||e==="quarterly")&&(t=Ft),t},xs=e=>{let t=Ge;return(e==="monthly"||e==="quarterly")&&(t=Pe),t},jt=e=>{let t=$;return(e==="monthly"||e==="quarterly")&&(t=zt),t},U=(e,t)=>{const n=new Date(e.timelineData[0].year,0,1),o=e.columnWidth*e.zoom/100,s=Math.floor(t/o),r=gs(e.range),a=jt(e.range)(n,s),d=r(a),u=Math.round(o/d),p=Math.floor(t%o/u);return $(a,p)},vs=e=>{const t=[];t.push({year:e.getFullYear()-1,quarters:new Array(4).fill(null)},{year:e.getFullYear(),quarters:new Array(4).fill(null)},{year:e.getFullYear()+1,quarters:new Array(4).fill(null)});for(const n of t)n.quarters=new Array(4).fill(null).map((o,s)=>({months:new Array(3).fill(null).map((r,c)=>{const a=s*3+c;return{days:H(new Date(n.year,a,1))}})}));return t},_t=(e,t,n)=>{const o=n.columnWidth*n.zoom/100,s=X(n.range),r=be(n.range),c=s(r(e),t);if(n.range==="daily")return o*c;const a=e.getDate(),d=H(e),u=o/d;return c*o+a*u},ys=(e,t,n)=>{const o=n.columnWidth*n.zoom/100;if(!t)return o*2;const s=X(n.range);if(n.range==="daily"){const v=s(t,e);return o*(v||1)}const r=H(e),c=o/r;if(de(e,t))return c;const a=ye(n.range),d=be(n.range);if(de(d(e),d(t)))return a(t,e)*c;const u=r-De(e),p=De(t),h=s(d(t),d(e)),f=H(t),g=o/f;return(h-1)*o+u*c+p*g},Dt=(e,t,n)=>{const o=be(t),s=xs(t),r=ye(t),c=o(e),a=s(e),d=r(a,c);return e.getDate()/d*n},L=l.createContext({zoom:100,range:"monthly",columnWidth:50,headerHeight:60,sidebarWidth:300,rowHeight:36,onAddItem:void 0,placeholderLength:2,timelineData:[],ref:null,scrollToFeature:void 0}),we=({title:e,columns:t,renderHeaderItem:n})=>{const o=l.useId();return i.jsxs("div",{className:"sticky top-0 z-20 grid w-full shrink-0 bg-backdrop/90 backdrop-blur-sm",style:{height:"var(--gantt-header-height)"},children:[i.jsx("div",{children:i.jsx("div",{className:"sticky inline-flex whitespace-nowrap px-3 py-2 text-muted-foreground text-xs",style:{left:"var(--gantt-sidebar-width)"},children:i.jsx("p",{children:e})})}),i.jsx("div",{className:"grid w-full",style:{gridTemplateColumns:`repeat(${t}, var(--gantt-column-width))`},children:Array.from({length:t}).map((s,r)=>i.jsx("div",{className:"shrink-0 border-border/50 border-b py-1 text-center text-xs",children:n(r)},`${o}-${r}`))})]})},bs=()=>l.useContext(L).timelineData.map(t=>t.quarters.flatMap(n=>n.months).map((n,o)=>i.jsxs("div",{className:"relative flex flex-col",children:[i.jsx(we,{columns:n.days,renderHeaderItem:s=>i.jsxs("div",{className:"flex items-center justify-center gap-1",children:[i.jsx("p",{children:W($(new Date(t.year,o,1),s),"d")}),i.jsx("p",{className:"text-muted-foreground",children:W($(new Date(t.year,o,1),s),"EEEEE")})]}),title:W(new Date(t.year,o,1),"MMMM yyyy")}),i.jsx(Me,{columns:n.days,isColumnSecondary:s=>[0,6].includes($(new Date(t.year,o,1),s).getDay())})]},`${t.year}-${o}`))),ws=()=>l.useContext(L).timelineData.map(t=>i.jsxs("div",{className:"relative flex flex-col",children:[i.jsx(we,{columns:t.quarters.flatMap(n=>n.months).length,renderHeaderItem:n=>i.jsx("p",{children:W(new Date(t.year,n,1),"MMM")}),title:`${t.year}`}),i.jsx(Me,{columns:t.quarters.flatMap(n=>n.months).length})]},t.year)),Ms=()=>l.useContext(L).timelineData.map(t=>t.quarters.map((n,o)=>i.jsxs("div",{className:"relative flex flex-col",children:[i.jsx(we,{columns:n.months.length,renderHeaderItem:s=>i.jsx("p",{children:W(new Date(t.year,o*3+s,1),"MMM")}),title:`Q${o+1} ${t.year}`}),i.jsx(Me,{columns:n.months.length})]},`${t.year}-${o}`))),Cs={daily:bs,monthly:ws,quarterly:Ms},Ss=({className:e})=>{const t=l.useContext(L),n=Cs[t.range];return i.jsx("div",{className:S("-space-x-px flex h-full w-max divide-x divide-border/50",e),children:i.jsx(n,{})})},ie=({feature:e,onSelectItem:t,className:n})=>{const o=l.useContext(L),s=e.endAt&&de(e.startAt,e.endAt)?$(e.endAt,1):e.endAt,r=s?_e(e.startAt,s):`${_e(e.startAt,new Date)} so far`,c=d=>{var u;d.target===d.currentTarget&&((u=o.scrollToFeature)==null||u.call(o,e),t==null||t(e.id))},a=d=>{var u;d.key==="Enter"&&((u=o.scrollToFeature)==null||u.call(o,e),t==null||t(e.id))};return i.jsxs("div",{className:S("relative flex items-center gap-2.5 p-2.5 text-xs hover:bg-secondary",n),onClick:c,onKeyDown:a,role:"button",style:{height:"var(--gantt-row-height)"},tabIndex:0,children:[i.jsx("div",{className:"pointer-events-none h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:e.status.color}}),i.jsx("p",{className:"pointer-events-none flex-1 truncate text-left font-medium",children:e.name}),i.jsx("p",{className:"pointer-events-none text-muted-foreground",children:r})]},e.id)},js=()=>i.jsxs("div",{className:"sticky top-0 z-10 flex shrink-0 items-end justify-between gap-2.5 border-border/50 border-b bg-backdrop/90 p-2.5 font-medium text-muted-foreground text-xs backdrop-blur-sm",style:{height:"var(--gantt-header-height)"},children:[i.jsx("p",{className:"flex-1 truncate text-left",children:"Issues"}),i.jsx("p",{className:"shrink-0",children:"Duration"})]}),ce=({children:e,name:t,className:n})=>i.jsxs("div",{className:n,children:[i.jsx("p",{className:"w-full truncate p-2.5 text-left font-medium text-muted-foreground text-xs",style:{height:"var(--gantt-row-height)"},children:t}),i.jsx("div",{className:"divide-y divide-border/50",children:e})]}),_s=({children:e,className:t})=>i.jsxs("div",{className:S("sticky left-0 z-30 h-max min-h-full overflow-clip border-border/50 border-r bg-white dark:bg-zinc-950 backdrop-blur-md",t),"data-roadmap-ui":"gantt-sidebar",children:[i.jsx(js,{}),i.jsx("div",{className:"space-y-4",children:e})]}),Ds=({top:e,className:t})=>{const[n]=ve(),o=l.useContext(L),[s,r]=pe(),c=()=>{var p,h,f;const a=(h=(p=o.ref)==null?void 0:p.current)==null?void 0:h.getBoundingClientRect(),d=s.x-((a==null?void 0:a.left)??0)+n-o.sidebarWidth,u=U(o,d);(f=o.onAddItem)==null||f.call(o,u)};return i.jsx("div",{className:S("absolute top-0 w-full px-0.5",t),ref:r,style:{marginTop:-o.rowHeight/2,transform:`translateY(${e}px)`},children:i.jsx("button",{className:"flex h-full w-full items-center justify-center rounded-md border border-dashed p-2",onClick:c,type:"button",children:i.jsx(Te,{className:"pointer-events-none select-none text-muted-foreground",size:16})})})},Ns=({index:e,isColumnSecondary:t})=>{var f;const n=l.useContext(L),[o]=xe(),[s,r]=pe(),[c,a]=l.useState(!1),[d]=Dn(),u=()=>a(!0),p=()=>a(!1),h=_n(s.y-(((f=r.current)==null?void 0:f.getBoundingClientRect().y)??0)-(d.y??0),10);return i.jsx("div",{className:S("group relative h-full overflow-hidden",t!=null&&t(e)?"bg-[#f59e0b]/5 dark:bg-[#f59e0b]/5":""),onMouseEnter:u,onMouseLeave:p,ref:r,children:!o&&c&&n.onAddItem?i.jsx(Ds,{top:h}):null})},Me=({columns:e,isColumnSecondary:t})=>{const n=l.useId();return i.jsx("div",{className:"divide grid h-full w-full divide-x divide-border/50",style:{gridTemplateColumns:`repeat(${e}, var(--gantt-column-width))`},children:Array.from({length:e}).map((o,s)=>i.jsx(Ns,{index:s,isColumnSecondary:t},`${n}-${s}`))})},Ee=({direction:e,featureId:t,date:n})=>{const[,o]=xe(),{attributes:s,listeners:r,setNodeRef:c}=Le({id:`feature-drag-helper-${t}`}),a=!!s["aria-pressed"];return l.useEffect(()=>o(a),[a,o]),i.jsxs("div",{className:S("group -translate-y-1/2 !cursor-col-resize absolute top-1/2 z-[3] h-full w-6 rounded-md outline-none",e==="left"?"-left-2.5":"-right-2.5"),ref:c,...s,...r,children:[i.jsx("div",{className:S("-translate-y-1/2 absolute top-1/2 h-[80%] w-1 rounded-sm bg-muted-foreground opacity-0 transition-all",e==="left"?"left-2.5":"right-2.5",e==="left"?"group-hover:left-0":"group-hover:right-0",a&&(e==="left"?"left-0":"right-0"),"group-hover:opacity-100",a&&"opacity-100")}),n&&i.jsx("div",{className:S("-translate-x-1/2 absolute top-10 hidden whitespace-nowrap rounded-lg border border-border/50 bg-background/90 px-2 py-1 text-foreground text-xs backdrop-blur-lg group-hover:block",a&&"block"),children:W(n,"MMM dd, yyyy")})]})},Is=({id:e,children:t})=>{const[,n]=xe(),{attributes:o,listeners:s,setNodeRef:r}=Le({id:e}),c=!!o["aria-pressed"];return l.useEffect(()=>n(c),[c,n]),i.jsx(Qe,{className:"h-full w-full rounded-md bg-background p-2 text-xs shadow-sm",children:i.jsx("div",{className:S("flex h-full w-full items-center justify-between gap-2 text-left",c&&"cursor-grabbing"),...o,...s,ref:r,children:t})})},Re=({onMove:e,children:t,className:n,...o})=>{const[s]=ve(),r=l.useContext(L),c=l.useMemo(()=>{var N;return new Date(((N=r.timelineData.at(0))==null?void 0:N.year)??0,0,1)},[r.timelineData]),[a,d]=l.useState(o.startAt),[u,p]=l.useState(o.endAt),h=l.useMemo(()=>ys(a,u,r),[a,u,r]),f=l.useMemo(()=>_t(a,c,r),[a,c,r]),g=l.useMemo(()=>jt(r.range),[r.range]),[v]=pe(),[M,D]=l.useState(0),[y,x]=l.useState(a),[j,A]=l.useState(u),_=tn(nn,{activationConstraint:{distance:10}}),m=l.useCallback(()=>{D(v.x),x(a),A(u)},[v.x,a,u]),C=l.useCallback(()=>{const N=U(r,v.x),O=U(r,M),w=r.range==="daily"?X(r.range)(N,O):ye(r.range)(N,O),I=$(y,w),E=j?$(j,w):null;d(I),p(E)},[r,v.x,M,y,j]),b=l.useCallback(()=>e==null?void 0:e(o.id,a,u),[e,o.id,a,u]),R=l.useCallback(()=>{var I,E;const N=(E=(I=r.ref)==null?void 0:I.current)==null?void 0:E.getBoundingClientRect(),O=v.x-((N==null?void 0:N.left)??0)+s-r.sidebarWidth,w=U(r,O);d(w)},[r,v.x,s]),T=l.useCallback(()=>{var I,E;const N=(E=(I=r.ref)==null?void 0:I.current)==null?void 0:E.getBoundingClientRect(),O=v.x-((N==null?void 0:N.left)??0)+s-r.sidebarWidth,w=U(r,O);p(w)},[r,v.x,s]);return i.jsx("div",{className:S("relative flex w-max min-w-full py-0.5",n),style:{height:"var(--gantt-row-height)"},children:i.jsxs("div",{className:"pointer-events-auto absolute top-0.5",style:{height:"calc(var(--gantt-row-height) - 4px)",width:Math.round(h),left:Math.round(f)},children:[e&&i.jsx(oe,{modifiers:[se],onDragEnd:b,onDragMove:R,sensors:[_],children:i.jsx(Ee,{date:a,direction:"left",featureId:o.id})}),i.jsx(oe,{modifiers:[se],onDragEnd:b,onDragMove:C,onDragStart:m,sensors:[_],children:i.jsx(Is,{id:o.id,children:t??i.jsx("p",{className:"flex-1 truncate text-xs",children:o.name})})}),e&&i.jsx(oe,{modifiers:[se],onDragEnd:b,onDragMove:T,sensors:[_],children:i.jsx(Ee,{date:u??g(a,2),direction:"right",featureId:o.id})})]})})},le=({children:e,className:t})=>i.jsx("div",{className:t,style:{paddingTop:"var(--gantt-row-height)"},children:e}),ks=({className:e,children:t})=>i.jsx("div",{className:S("absolute top-0 left-0 h-full w-max space-y-4",e),style:{marginTop:"var(--gantt-header-height)"},children:t}),Nt=l.memo(({label:e,date:t,id:n,onRemove:o,className:s})=>{const r=l.useContext(L),c=l.useMemo(()=>X(r.range),[r.range]),a=l.useMemo(()=>{var h;return new Date(((h=r.timelineData.at(0))==null?void 0:h.year)??0,0,1)},[r.timelineData]),d=l.useMemo(()=>c(t,a),[c,t,a]),u=l.useMemo(()=>Dt(t,r.range,r.columnWidth*r.zoom/100),[t,r.range,r.columnWidth,r.zoom]),p=l.useCallback(()=>o==null?void 0:o(n),[o,n]);return i.jsxs("div",{className:"pointer-events-none absolute top-0 left-0 z-20 flex h-full select-none flex-col items-center justify-center overflow-visible",style:{width:0,transform:`translateX(calc(var(--gantt-column-width) * ${d} + ${u}px))`},children:[i.jsxs(as,{children:[i.jsx(is,{asChild:!0,children:i.jsxs("div",{className:S("group pointer-events-auto sticky top-0 flex select-auto flex-col flex-nowrap items-center justify-center whitespace-nowrap rounded-b-md bg-card px-2 py-1 text-foreground text-xs",s),children:[e,i.jsx("span",{className:"max-h-[0] overflow-hidden opacity-80 transition-all group-hover:max-h-[2rem]",children:W(t,"MMM dd, yyyy")})]})}),i.jsx(Ct,{children:o?i.jsxs(St,{className:"flex items-center gap-2 text-destructive",onClick:p,children:[i.jsx(wn,{size:16}),"Remove marker"]}):null})]}),i.jsx("div",{className:S("h-full w-px bg-card",s)})]})});Nt.displayName="GanttMarker";const As=({zoom:e=100,range:t="monthly",onAddItem:n,children:o,className:s})=>{const r=l.useRef(null),[c,a]=l.useState(vs(new Date)),[,d]=ve(),[u,p]=l.useState(0),h=60,f=36;let g=50;t==="monthly"?g=150:t==="quarterly"&&(g=100);const v=l.useMemo(()=>({"--gantt-zoom":`${e}`,"--gantt-column-width":`${e/100*g}px`,"--gantt-header-height":`${h}px`,"--gantt-row-height":`${f}px`,"--gantt-sidebar-width":`${u}px`}),[e,g,u]);l.useEffect(()=>{r.current&&(r.current.scrollLeft=r.current.scrollWidth/2-r.current.clientWidth/2,d(r.current.scrollLeft))},[d]),l.useEffect(()=>{const y=()=>{var _;const A=((_=r.current)==null?void 0:_.querySelector('[data-roadmap-ui="gantt-sidebar"]'))?300:0;p(A)};y();const x=new MutationObserver(y);return r.current&&x.observe(r.current,{childList:!0,subtree:!0}),()=>{x.disconnect()}},[]);const M=l.useCallback(So(()=>{var _,m;const y=r.current;if(!y)return;const{scrollLeft:x,scrollWidth:j,clientWidth:A}=y;if(d(x),x===0){const C=(_=c[0])==null?void 0:_.year;if(!C)return;const b=[...c];b.unshift({year:C-1,quarters:new Array(4).fill(null).map((R,T)=>({months:new Array(3).fill(null).map((N,O)=>{const w=T*3+O;return{days:H(new Date(C,w,1))}})}))}),a(b),y.scrollLeft=y.clientWidth,d(y.scrollLeft)}else if(x+A>=j){const C=(m=c.at(-1))==null?void 0:m.year;if(!C)return;const b=[...c];b.push({year:C+1,quarters:new Array(4).fill(null).map((R,T)=>({months:new Array(3).fill(null).map((N,O)=>{const w=T*3+O;return{days:H(new Date(C,w,1))}})}))}),a(b),y.scrollLeft=y.scrollWidth-y.clientWidth,d(y.scrollLeft)}},100),[]);l.useEffect(()=>{const y=r.current;return y&&y.addEventListener("scroll",M),()=>{y&&y.removeEventListener("scroll",M)}},[M]);const D=l.useCallback(y=>{const x=r.current;if(!x)return;const j=new Date(c[0].year,0,1),A=_t(y.startAt,j,{zoom:e,range:t,columnWidth:g}),_=Math.max(0,A);x.scrollTo({left:_,behavior:"smooth"})},[c,e,t,g,u,n]);return i.jsx(L.Provider,{value:{zoom:e,range:t,headerHeight:h,columnWidth:g,sidebarWidth:u,rowHeight:f,onAddItem:n,timelineData:c,placeholderLength:2,ref:r,scrollToFeature:D},children:i.jsx("div",{className:S("gantt relative isolate grid h-full w-full flex-none select-none overflow-auto rounded-sm bg-secondary",t,s),ref:r,style:{...v,gridTemplateColumns:"var(--gantt-sidebar-width) 1fr"},children:o})})},Es=({children:e,className:t})=>i.jsx("div",{className:S("relative flex h-full w-max flex-none overflow-clip",t),children:e}),Rs=({className:e})=>{const t="Today",n=l.useMemo(()=>new Date,[]),o=l.useContext(L),s=l.useMemo(()=>X(o.range),[o.range]),r=l.useMemo(()=>{var d;return new Date(((d=o.timelineData.at(0))==null?void 0:d.year)??0,0,1)},[o.timelineData]),c=l.useMemo(()=>s(n,r),[s,n,r]),a=l.useMemo(()=>Dt(n,o.range,o.columnWidth*o.zoom/100),[n,o.range,o.columnWidth,o.zoom]);return i.jsxs("div",{className:"pointer-events-none absolute top-0 left-0 z-20 flex h-full select-none flex-col items-center justify-center overflow-visible",style:{width:0,transform:`translateX(calc(var(--gantt-column-width) * ${c} + ${a}px))`},children:[i.jsxs("div",{className:S("group pointer-events-auto sticky top-0 flex select-auto flex-col flex-nowrap items-center justify-center whitespace-nowrap rounded-b-md bg-card px-2 py-1 text-foreground text-xs",e),children:[t,i.jsx("span",{className:"max-h-[0] overflow-hidden opacity-80 transition-all group-hover:max-h-[2rem]",children:W(n,"MMM dd, yyyy")})]}),i.jsx("div",{className:S("h-full w-px bg-card",e)})]})};function J(e,t){const n=e.start_date?new Date(e.start_date):new Date(e.due_date),o=e.due_date?new Date(e.due_date):n;return{id:e.id,name:`${e.identifier} ${e.title}`,startAt:n,endAt:o,status:{id:e.status,name:e.status,color:t}}}function $s(){const{projectKey:e}=Et(),t=It(),[n,o]=l.useState("monthly"),[s,r]=l.useState(null),[c,a]=l.useState(!1),d=l.useRef(null);l.useEffect(()=>{const m=requestAnimationFrame(()=>{var w;const C=(w=d.current)==null?void 0:w.querySelector(".gantt");if(!C)return;const b=new Date,R=b.getFullYear()-1,T=300;let N;if(n==="daily"){const I=new Date(R,0,1);N=Math.floor((b.getTime()-I.getTime())/864e5)*50}else{const I=n==="monthly"?150:100,E=(b.getFullYear()-R)*12+b.getMonth(),Y=new Date(b.getFullYear(),b.getMonth()+1,0).getDate();N=E*I+(b.getDate()-1)/Y*I}const O=C.clientWidth-T;C.scrollLeft=Math.max(0,N-O/2)});return()=>cancelAnimationFrame(m)},[n]);const{data:u}=Ut(e??""),p=(u==null?void 0:u.id)??"",{data:h=[]}=Xt(p||void 0),{data:f=[]}=Yt(p||void 0),{data:g=[]}=Kt(p||void 0),v=kt({mutationFn:({id:m,start_date:C,due_date:b})=>en.put(`/admin/issues/${m}`,{start_date:C,due_date:b}),onSuccess:()=>{t.invalidateQueries({queryKey:Zt.byProject(p)})},onError:()=>Qt.error("Failed to update issue dates")}),M=Object.fromEntries(f.map(m=>[m.key,m.color])),D=h.filter(m=>m.due_date),y=h.filter(m=>!m.due_date),x={},j=[];for(const m of D)m.sprint_id?(x[m.sprint_id]||(x[m.sprint_id]=[]),x[m.sprint_id].push(m)):j.push(m);const A=(m,C,b)=>{v.mutate({id:m,start_date:W(C,"yyyy-MM-dd"),due_date:b?W(b,"yyyy-MM-dd"):null})},_=m=>{const C=h.find(b=>b.id===m)??null;r(C)};return e?i.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[i.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border shrink-0 bg-white dark:bg-zinc-950",children:[i.jsx("div",{className:"flex items-center gap-1 bg-muted rounded-md p-0.5",children:["daily","monthly","quarterly"].map(m=>i.jsx("button",{onClick:()=>o(m),className:`px-3 py-1 rounded text-xs font-medium transition-colors capitalize ${n===m?"bg-white dark:bg-zinc-900 text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:m},m))}),i.jsxs(Vt,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:()=>a(!0),children:[i.jsx(Te,{className:"h-3.5 w-3.5"}),"Issue"]})]}),i.jsx("div",{ref:d,className:"flex-1 min-h-0 overflow-hidden",children:i.jsxs(As,{range:n,zoom:100,className:"h-full bg-white dark:bg-zinc-950",children:[i.jsxs(_s,{children:[g.map(m=>{const C=x[m.id]??[];return i.jsx(ce,{name:m.name,children:C.map(b=>i.jsx(ie,{feature:J(b,M[b.status]??"#94a3b8"),onSelectItem:_},b.id))},m.id)}),j.length>0&&i.jsx(ce,{name:"No Sprint",children:j.map(m=>i.jsx(ie,{feature:J(m,M[m.status]??"#94a3b8"),onSelectItem:_},m.id))}),y.length>0&&i.jsx(ce,{name:"Unscheduled",children:y.map(m=>i.jsx(ie,{feature:{id:m.id,name:`${m.identifier} ${m.title}`,startAt:new Date,endAt:new Date,status:{id:m.status,name:m.status,color:M[m.status]??"#94a3b8"}},onSelectItem:_},m.id))})]}),i.jsxs(Es,{children:[i.jsx(Ss,{}),i.jsxs(ks,{children:[g.map(m=>{const C=x[m.id]??[];return i.jsx(le,{children:C.map(b=>i.jsx("div",{className:"flex",children:i.jsx(Re,{onMove:A,...J(b,M[b.status]??"#94a3b8")})},b.id))},m.id)}),j.length>0&&i.jsx(le,{children:j.map(m=>i.jsx("div",{className:"flex",children:i.jsx(Re,{onMove:A,...J(m,M[m.status]??"#94a3b8")})},m.id))}),y.length>0&&i.jsx(le,{children:y.map(m=>i.jsx("div",{style:{height:"var(--gantt-row-height)"}},m.id))})]}),g.filter(m=>m.end_date).map(m=>i.jsx(Nt,{id:m.id,date:new Date(m.end_date),label:`${m.name} end`},m.id)),i.jsx(Rs,{})]})]})}),i.jsx(qt,{issue:s,projectId:p,open:!!s,onClose:()=>r(null)}),i.jsx(Jt,{open:c,onClose:()=>a(!1),projectId:p})]}):null}export{$s as ProjectTimelinePage};