UNPKG

progresspulse-pwa

Version:

A modern PWA for tracking progress and achieving goals with iPhone-style design

54 lines 83.9 kB
import{r as a,a as On,b as de,R as Ro,c as Mo}from"./vendor-BtIrUdbE.js";var Dn={exports:{}},it={};/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Po=a,Ao=Symbol.for("react.element"),_o=Symbol.for("react.fragment"),Oo=Object.prototype.hasOwnProperty,Do=Po.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,To={key:!0,ref:!0,__self:!0,__source:!0};function Tn(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)Oo.call(t,r)&&!To.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:Ao,type:e,key:i,ref:s,props:o,_owner:Do.current}}it.Fragment=_o;it.jsx=Tn;it.jsxs=Tn;Dn.exports=it;var g=Dn.exports;function Io(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function st(...e){return t=>e.forEach(n=>Io(n,t))}function W(...e){return a.useCallback(st(...e),e)}var Se=a.forwardRef((e,t)=>{const{children:n,...r}=e,o=a.Children.toArray(n),i=o.find(Lo);if(i){const s=i.props.children,c=o.map(l=>l===i?a.Children.count(s)>1?a.Children.only(null):a.isValidElement(s)?s.props.children:null:l);return g.jsx(St,{...r,ref:t,children:a.isValidElement(s)?a.cloneElement(s,void 0,c):null})}return g.jsx(St,{...r,ref:t,children:n})});Se.displayName="Slot";var St=a.forwardRef((e,t)=>{const{children:n,...r}=e;if(a.isValidElement(n)){const o=ko(n);return a.cloneElement(n,{...Fo(r,n.props),ref:t?st(t,o):o})}return a.Children.count(n)>1?a.Children.only(null):null});St.displayName="SlotClone";var No=({children:e})=>g.jsx(g.Fragment,{children:e});function Lo(e){return a.isValidElement(e)&&e.type===No}function Fo(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)=>{i(...c),o(...c)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function ko(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 jo(e,t){const n=a.createContext(t),r=i=>{const{children:s,...c}=i,l=a.useMemo(()=>c,Object.values(c));return g.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=a.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function It(e,t=[]){let n=[];function r(i,s){const c=a.createContext(s),l=n.length;n=[...n,s];const u=f=>{var x;const{scope:p,children:h,...v}=f,m=((x=p==null?void 0:p[e])==null?void 0:x[l])||c,w=a.useMemo(()=>v,Object.values(v));return g.jsx(m.Provider,{value:w,children:h})};u.displayName=i+"Provider";function d(f,p){var m;const h=((m=p==null?void 0:p[e])==null?void 0:m[l])||c,v=a.useContext(h);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(s=>a.createContext(s));return function(c){const l=(c==null?void 0:c[e])||i;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,$o(o,...t)]}function $o(...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 s=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Y(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var pe=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{},Wo=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],$=Wo.reduce((e,t)=>{const n=a.forwardRef((r,o)=>{const{asChild:i,...s}=r,c=i?Se:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function In(e,t){e&&On.flushSync(()=>e.dispatchEvent(t))}function A(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 Nt({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Bo({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,c=Y(n),l=a.useCallback(u=>{if(i){const f=typeof u=="function"?u(e):u;f!==e&&c(f)}else o(u)},[i,e,o,c]);return[s,l]}function Bo({defaultProp:e,onChange:t}){const n=a.useState(e),[r]=n,o=a.useRef(r),i=Y(t);return a.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function Uo(e,t=[]){let n=[];function r(i,s){const c=a.createContext(s),l=n.length;n=[...n,s];function u(f){const{scope:p,children:h,...v}=f,m=(p==null?void 0:p[e][l])||c,w=a.useMemo(()=>v,Object.values(v));return g.jsx(m.Provider,{value:w,children:h})}function d(f,p){const h=(p==null?void 0:p[e][l])||c,v=a.useContext(h);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=n.map(s=>a.createContext(s));return function(c){const l=(c==null?void 0:c[e])||i;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,Go(o,...t)]}function Go(...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 s=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Nn(e){const t=e+"CollectionProvider",[n,r]=Uo(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:v,children:m}=h,w=de.useRef(null),x=de.useRef(new Map).current;return g.jsx(o,{scope:v,itemMap:x,collectionRef:w,children:m})};s.displayName=t;const c=e+"CollectionSlot",l=de.forwardRef((h,v)=>{const{scope:m,children:w}=h,x=i(c,m),y=W(v,x.collectionRef);return g.jsx(Se,{ref:y,children:w})});l.displayName=c;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=de.forwardRef((h,v)=>{const{scope:m,children:w,...x}=h,y=de.useRef(null),b=W(v,y),C=i(u,m);return de.useEffect(()=>(C.itemMap.set(y,{ref:y,...x}),()=>void C.itemMap.delete(y))),g.jsx(Se,{[d]:"",ref:b,children:w})});f.displayName=u;function p(h){const v=i(e+"CollectionConsumer",h);return de.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const x=Array.from(w.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((C,E)=>x.indexOf(C.ref.current)-x.indexOf(E.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},p,r]}var Ko=a.createContext(void 0);function Ln(e){const t=a.useContext(Ko);return e||t||"ltr"}function Ho(e,t=globalThis==null?void 0:globalThis.document){const n=Y(e);a.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 Vo="DismissableLayer",Rt="dismissableLayer.update",zo="dismissableLayer.pointerDownOutside",Yo="dismissableLayer.focusOutside",un,Fn=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Lt=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:c,...l}=e,u=a.useContext(Fn),[d,f]=a.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=a.useState({}),v=W(t,R=>f(R)),m=Array.from(u.layers),[w]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=m.indexOf(w),y=d?m.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,C=y>=x,E=Zo(R=>{const P=R.target,T=[...u.branches].some(O=>O.contains(P));!C||T||(o==null||o(R),s==null||s(R),R.defaultPrevented||c==null||c())},p),M=Qo(R=>{const P=R.target;[...u.branches].some(O=>O.contains(P))||(i==null||i(R),s==null||s(R),R.defaultPrevented||c==null||c())},p);return Ho(R=>{y===u.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&c&&(R.preventDefault(),c()))},p),a.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(un=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),ln(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=un)}},[d,p,n,u]),a.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),ln())},[d,u]),a.useEffect(()=>{const R=()=>h({});return document.addEventListener(Rt,R),()=>document.removeEventListener(Rt,R)},[]),g.jsx($.div,{...l,ref:v,style:{pointerEvents:b?C?"auto":"none":void 0,...e.style},onFocusCapture:A(e.onFocusCapture,M.onFocusCapture),onBlurCapture:A(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:A(e.onPointerDownCapture,E.onPointerDownCapture)})});Lt.displayName=Vo;var Xo="DismissableLayerBranch",qo=a.forwardRef((e,t)=>{const n=a.useContext(Fn),r=a.useRef(null),o=W(t,r);return a.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),g.jsx($.div,{...e,ref:o})});qo.displayName=Xo;function Zo(e,t=globalThis==null?void 0:globalThis.document){const n=Y(e),r=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let l=function(){kn(zo,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},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Qo(e,t=globalThis==null?void 0:globalThis.document){const n=Y(e),r=a.useRef(!1);return a.useEffect(()=>{const o=i=>{i.target&&!r.current&&kn(Yo,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 ln(){const e=new CustomEvent(Rt);document.dispatchEvent(e)}function kn(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?In(o,i):o.dispatchEvent(i)}var mt=0;function jn(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??fn()),document.body.insertAdjacentElement("beforeend",e[1]??fn()),mt++,()=>{mt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),mt--}},[])}function fn(){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 ht="focusScope.autoFocusOnMount",vt="focusScope.autoFocusOnUnmount",dn={bubbles:!1,cancelable:!0},Jo="FocusScope",Ft=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[c,l]=a.useState(null),u=Y(o),d=Y(i),f=a.useRef(null),p=W(t,m=>l(m)),h=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(r){let m=function(b){if(h.paused||!c)return;const C=b.target;c.contains(C)?f.current=C:ie(f.current,{select:!0})},w=function(b){if(h.paused||!c)return;const C=b.relatedTarget;C!==null&&(c.contains(C)||ie(f.current,{select:!0}))},x=function(b){if(document.activeElement===document.body)for(const E of b)E.removedNodes.length>0&&ie(c)};document.addEventListener("focusin",m),document.addEventListener("focusout",w);const y=new MutationObserver(x);return c&&y.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",w),y.disconnect()}}},[r,c,h.paused]),a.useEffect(()=>{if(c){mn.add(h);const m=document.activeElement;if(!c.contains(m)){const x=new CustomEvent(ht,dn);c.addEventListener(ht,u),c.dispatchEvent(x),x.defaultPrevented||(ei(ii($n(c)),{select:!0}),document.activeElement===m&&ie(c))}return()=>{c.removeEventListener(ht,u),setTimeout(()=>{const x=new CustomEvent(vt,dn);c.addEventListener(vt,d),c.dispatchEvent(x),x.defaultPrevented||ie(m??document.body,{select:!0}),c.removeEventListener(vt,d),mn.remove(h)},0)}}},[c,u,d,h]);const v=a.useCallback(m=>{if(!n&&!r||h.paused)return;const w=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,x=document.activeElement;if(w&&x){const y=m.currentTarget,[b,C]=ti(y);b&&C?!m.shiftKey&&x===C?(m.preventDefault(),n&&ie(b,{select:!0})):m.shiftKey&&x===b&&(m.preventDefault(),n&&ie(C,{select:!0})):x===y&&m.preventDefault()}},[n,r,h.paused]);return g.jsx($.div,{tabIndex:-1,...s,ref:p,onKeyDown:v})});Ft.displayName=Jo;function ei(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ie(r,{select:t}),document.activeElement!==n)return}function ti(e){const t=$n(e),n=pn(t,e),r=pn(t.reverse(),e);return[n,r]}function $n(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 pn(e,t){for(const n of e)if(!ni(n,{upTo:t}))return n}function ni(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 ri(e){return e instanceof HTMLInputElement&&"select"in e}function ie(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ri(e)&&t&&e.select()}}var mn=oi();function oi(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=hn(e,t),e.unshift(t)},remove(t){var n;e=hn(e,t),(n=e[0])==null||n.resume()}}}function hn(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ii(e){return e.filter(t=>t.tagName!=="A")}var si=Ro.useId||(()=>{}),ci=0;function be(e){const[t,n]=a.useState(si());return pe(()=>{n(r=>r??String(ci++))},[e]),t?`radix-${t}`:""}const ai=["top","right","bottom","left"],se=Math.min,K=Math.max,Qe=Math.round,Ge=Math.floor,ce=e=>({x:e,y:e}),ui={left:"right",right:"left",bottom:"top",top:"bottom"},li={start:"end",end:"start"};function Mt(e,t,n){return K(e,se(t,n))}function re(e,t){return typeof e=="function"?e(t):e}function oe(e){return e.split("-")[0]}function Me(e){return e.split("-")[1]}function kt(e){return e==="x"?"y":"x"}function jt(e){return e==="y"?"height":"width"}function ae(e){return["top","bottom"].includes(oe(e))?"y":"x"}function $t(e){return kt(ae(e))}function fi(e,t,n){n===void 0&&(n=!1);const r=Me(e),o=$t(e),i=jt(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Je(s)),[s,Je(s)]}function di(e){const t=Je(e);return[Pt(e),t,Pt(t)]}function Pt(e){return e.replace(/start|end/g,t=>li[t])}function pi(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function mi(e,t,n,r){const o=Me(e);let i=pi(oe(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Pt)))),i}function Je(e){return e.replace(/left|right|bottom|top/g,t=>ui[t])}function hi(e){return{top:0,right:0,bottom:0,left:0,...e}}function Wn(e){return typeof e!="number"?hi(e):{top:e,right:e,bottom:e,left:e}}function et(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 vn(e,t,n){let{reference:r,floating:o}=e;const i=ae(t),s=$t(t),c=jt(s),l=oe(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(Me(t)){case"start":h[s]-=p*(n&&u?-1:1);break;case"end":h[s]+=p*(n&&u?-1:1);break}return h}const vi=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,c=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=vn(u,r,l),p=r,h={},v=0;for(let m=0;m<c.length;m++){const{name:w,fn:x}=c[m],{x:y,y:b,data:C,reset:E}=await x({x:d,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:u,platform:s,elements:{reference:e,floating:t}});d=y??d,f=b??f,h={...h,[w]:{...h[w],...C}},E&&v<=50&&(v++,typeof E=="object"&&(E.placement&&(p=E.placement),E.rects&&(u=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:d,y:f}=vn(u,p,l)),m=-1)}return{x:d,y:f,placement:p,strategy:o,middlewareData:h}};async function Ne(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:c,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=re(t,e),v=Wn(h),w=c[p?f==="floating"?"reference":"floating":f],x=et(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:u,rootBoundary:d,strategy:l})),y=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),C=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},E=et(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:b,strategy:l}):y);return{top:(x.top-E.top+v.top)/C.y,bottom:(E.bottom-x.bottom+v.bottom)/C.y,left:(x.left-E.left+v.left)/C.x,right:(E.right-x.right+v.right)/C.x}}const gi=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:c,middlewareData:l}=t,{element:u,padding:d=0}=re(e,t)||{};if(u==null)return{};const f=Wn(d),p={x:n,y:r},h=$t(o),v=jt(h),m=await s.getDimensions(u),w=h==="y",x=w?"top":"left",y=w?"bottom":"right",b=w?"clientHeight":"clientWidth",C=i.reference[v]+i.reference[h]-p[h]-i.floating[v],E=p[h]-i.reference[h],M=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let R=M?M[b]:0;(!R||!await(s.isElement==null?void 0:s.isElement(M)))&&(R=c.floating[b]||i.floating[v]);const P=C/2-E/2,T=R/2-m[v]/2-1,O=se(f[x],T),F=se(f[y],T),k=O,N=R-m[v]-F,I=R/2-m[v]/2+P,B=Mt(k,I,N),D=!l.arrow&&Me(o)!=null&&I!==B&&i.reference[v]/2-(I<k?O:F)-m[v]/2<0,j=D?I<k?I-k:I-N:0;return{[h]:p[h]+j,data:{[h]:B,centerOffset:I-B-j,...D&&{alignmentOffset:j}},reset:D}}}),wi=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:c,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...w}=re(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=oe(o),y=ae(c),b=oe(c)===c,C=await(l.isRTL==null?void 0:l.isRTL(u.floating)),E=p||(b||!m?[Je(c)]:di(c)),M=v!=="none";!p&&M&&E.push(...mi(c,m,v,C));const R=[c,...E],P=await Ne(t,w),T=[];let O=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&T.push(P[x]),f){const I=fi(o,s,C);T.push(P[I[0]],P[I[1]])}if(O=[...O,{placement:o,overflows:T}],!T.every(I=>I<=0)){var F,k;const I=(((F=i.flip)==null?void 0:F.index)||0)+1,B=R[I];if(B)return{data:{index:I,overflows:O},reset:{placement:B}};let D=(k=O.filter(j=>j.overflows[0]<=0).sort((j,_)=>j.overflows[1]-_.overflows[1])[0])==null?void 0:k.placement;if(!D)switch(h){case"bestFit":{var N;const j=(N=O.filter(_=>{if(M){const S=ae(_.placement);return S===y||S==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(S=>S>0).reduce((S,L)=>S+L,0)]).sort((_,S)=>_[1]-S[1])[0])==null?void 0:N[0];j&&(D=j);break}case"initialPlacement":D=c;break}if(o!==D)return{reset:{placement:D}}}return{}}}};function gn(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wn(e){return ai.some(t=>e[t]>=0)}const xi=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=re(e,t);switch(r){case"referenceHidden":{const i=await Ne(t,{...o,elementContext:"reference"}),s=gn(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:wn(s)}}}case"escaped":{const i=await Ne(t,{...o,altBoundary:!0}),s=gn(i,n.floating);return{data:{escapedOffsets:s,escaped:wn(s)}}}default:return{}}}}};async function yi(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=oe(n),c=Me(n),l=ae(n)==="y",u=["left","top"].includes(s)?-1:1,d=i&&l?-1:1,f=re(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof v=="number"&&(h=c==="end"?v*-1:v),l?{x:h*d,y:p*u}:{x:p*u,y:h*d}}const bi=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:c}=t,l=await yi(t,e);return s===((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:s}}}}},Ci=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:c={fn:w=>{let{x,y}=w;return{x,y}}},...l}=re(e,t),u={x:n,y:r},d=await Ne(t,l),f=ae(oe(o)),p=kt(f);let h=u[p],v=u[f];if(i){const w=p==="y"?"top":"left",x=p==="y"?"bottom":"right",y=h+d[w],b=h-d[x];h=Mt(y,h,b)}if(s){const w=f==="y"?"top":"left",x=f==="y"?"bottom":"right",y=v+d[w],b=v-d[x];v=Mt(y,v,b)}const m=c.fn({...t,[p]:h,[f]:v});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:i,[f]:s}}}}}},Ei=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:c=0,mainAxis:l=!0,crossAxis:u=!0}=re(e,t),d={x:n,y:r},f=ae(o),p=kt(f);let h=d[p],v=d[f];const m=re(c,t),w=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const b=p==="y"?"height":"width",C=i.reference[p]-i.floating[b]+w.mainAxis,E=i.reference[p]+i.reference[b]-w.mainAxis;h<C?h=C:h>E&&(h=E)}if(u){var x,y;const b=p==="y"?"width":"height",C=["top","left"].includes(oe(o)),E=i.reference[f]-i.floating[b]+(C&&((x=s.offset)==null?void 0:x[f])||0)+(C?0:w.crossAxis),M=i.reference[f]+i.reference[b]+(C?0:((y=s.offset)==null?void 0:y[f])||0)-(C?w.crossAxis:0);v<E?v=E:v>M&&(v=M)}return{[p]:h,[f]:v}}}},Si=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:c}=t,{apply:l=()=>{},...u}=re(e,t),d=await Ne(t,u),f=oe(o),p=Me(o),h=ae(o)==="y",{width:v,height:m}=i.floating;let w,x;f==="top"||f==="bottom"?(w=f,x=p===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(x=f,w=p==="end"?"top":"bottom");const y=m-d.top-d.bottom,b=v-d.left-d.right,C=se(m-d[w],y),E=se(v-d[x],b),M=!t.middlewareData.shift;let R=C,P=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=y),M&&!p){const O=K(d.left,0),F=K(d.right,0),k=K(d.top,0),N=K(d.bottom,0);h?P=v-2*(O!==0||F!==0?O+F:K(d.left,d.right)):R=m-2*(k!==0||N!==0?k+N:K(d.top,d.bottom))}await l({...t,availableWidth:P,availableHeight:R});const T=await s.getDimensions(c.floating);return v!==T.width||m!==T.height?{reset:{rects:!0}}:{}}}};function ct(){return typeof window<"u"}function Pe(e){return Bn(e)?(e.nodeName||"").toLowerCase():"#document"}function H(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function te(e){var t;return(t=(Bn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Bn(e){return ct()?e instanceof Node||e instanceof H(e).Node:!1}function X(e){return ct()?e instanceof Element||e instanceof H(e).Element:!1}function ee(e){return ct()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function xn(e){return!ct()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}function je(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Ri(e){return["table","td","th"].includes(Pe(e))}function at(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Wt(e){const t=Bt(),n=X(e)?q(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Mi(e){let t=ue(e);for(;ee(t)&&!Re(t);){if(Wt(t))return t;if(at(t))return null;t=ue(t)}return null}function Bt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Re(e){return["html","body","#document"].includes(Pe(e))}function q(e){return H(e).getComputedStyle(e)}function ut(e){return X(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ue(e){if(Pe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||xn(e)&&e.host||te(e);return xn(t)?t.host:t}function Un(e){const t=ue(e);return Re(t)?e.ownerDocument?e.ownerDocument.body:e.body:ee(t)&&je(t)?t:Un(t)}function Le(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Un(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=H(o);if(i){const c=At(s);return t.concat(s,s.visualViewport||[],je(o)?o:[],c&&n?Le(c):[])}return t.concat(o,Le(o,[],n))}function At(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Gn(e){const t=q(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ee(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,c=Qe(n)!==i||Qe(r)!==s;return c&&(n=i,r=s),{width:n,height:r,$:c}}function Ut(e){return X(e)?e:e.contextElement}function Ce(e){const t=Ut(e);if(!ee(t))return ce(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Gn(t);let s=(i?Qe(n.width):n.width)/r,c=(i?Qe(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const Pi=ce(0);function Kn(e){const t=H(e);return!Bt()||!t.visualViewport?Pi:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ai(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==H(e)?!1:t}function me(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ut(e);let s=ce(1);t&&(r?X(r)&&(s=Ce(r)):s=Ce(e));const c=Ai(i,n,r)?Kn(i):ce(0);let l=(o.left+c.x)/s.x,u=(o.top+c.y)/s.y,d=o.width/s.x,f=o.height/s.y;if(i){const p=H(i),h=r&&X(r)?H(r):r;let v=p,m=At(v);for(;m&&r&&h!==v;){const w=Ce(m),x=m.getBoundingClientRect(),y=q(m),b=x.left+(m.clientLeft+parseFloat(y.paddingLeft))*w.x,C=x.top+(m.clientTop+parseFloat(y.paddingTop))*w.y;l*=w.x,u*=w.y,d*=w.x,f*=w.y,l+=b,u+=C,v=H(m),m=At(v)}}return et({width:d,height:f,x:l,y:u})}function _i(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=te(r),c=t?at(t.floating):!1;if(r===s||c&&i)return n;let l={scrollLeft:0,scrollTop:0},u=ce(1);const d=ce(0),f=ee(r);if((f||!f&&!i)&&((Pe(r)!=="body"||je(s))&&(l=ut(r)),ee(r))){const p=me(r);u=Ce(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x,y:n.y*u.y-l.scrollTop*u.y+d.y}}function Oi(e){return Array.from(e.getClientRects())}function _t(e,t){const n=ut(e).scrollLeft;return t?t.left+n:me(te(e)).left+n}function Di(e){const t=te(e),n=ut(e),r=e.ownerDocument.body,o=K(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=K(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+_t(e);const c=-n.scrollTop;return q(r).direction==="rtl"&&(s+=K(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:c}}function Ti(e,t){const n=H(e),r=te(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,c=0,l=0;if(o){i=o.width,s=o.height;const u=Bt();(!u||u&&t==="fixed")&&(c=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:c,y:l}}function Ii(e,t){const n=me(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ee(e)?Ce(e):ce(1),s=e.clientWidth*i.x,c=e.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:s,height:c,x:l,y:u}}function yn(e,t,n){let r;if(t==="viewport")r=Ti(e,n);else if(t==="document")r=Di(te(e));else if(X(t))r=Ii(t,n);else{const o=Kn(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return et(r)}function Hn(e,t){const n=ue(e);return n===t||!X(n)||Re(n)?!1:q(n).position==="fixed"||Hn(n,t)}function Ni(e,t){const n=t.get(e);if(n)return n;let r=Le(e,[],!1).filter(c=>X(c)&&Pe(c)!=="body"),o=null;const i=q(e).position==="fixed";let s=i?ue(e):e;for(;X(s)&&!Re(s);){const c=q(s),l=Wt(s);!l&&c.position==="fixed"&&(o=null),(i?!l&&!o:!l&&c.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||je(s)&&!l&&Hn(e,s))?r=r.filter(d=>d!==s):o=c,s=ue(s)}return t.set(e,r),r}function Li(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?at(t)?[]:Ni(t,this._c):[].concat(n),r],c=s[0],l=s.reduce((u,d)=>{const f=yn(t,d,o);return u.top=K(f.top,u.top),u.right=se(f.right,u.right),u.bottom=se(f.bottom,u.bottom),u.left=K(f.left,u.left),u},yn(t,c,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Fi(e){const{width:t,height:n}=Gn(e);return{width:t,height:n}}function ki(e,t,n){const r=ee(t),o=te(t),i=n==="fixed",s=me(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const l=ce(0);if(r||!r&&!i)if((Pe(t)!=="body"||je(o))&&(c=ut(t)),r){const h=me(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&(l.x=_t(o));let u=0,d=0;if(o&&!r&&!i){const h=o.getBoundingClientRect();d=h.top+c.scrollTop,u=h.left+c.scrollLeft-_t(o,h)}const f=s.left+c.scrollLeft-l.x-u,p=s.top+c.scrollTop-l.y-d;return{x:f,y:p,width:s.width,height:s.height}}function gt(e){return q(e).position==="static"}function bn(e,t){if(!ee(e)||q(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return te(e)===n&&(n=n.ownerDocument.body),n}function Vn(e,t){const n=H(e);if(at(e))return n;if(!ee(e)){let o=ue(e);for(;o&&!Re(o);){if(X(o)&&!gt(o))return o;o=ue(o)}return n}let r=bn(e,t);for(;r&&Ri(r)&&gt(r);)r=bn(r,t);return r&&Re(r)&&gt(r)&&!Wt(r)?n:r||Mi(e)||n}const ji=async function(e){const t=this.getOffsetParent||Vn,n=this.getDimensions,r=await n(e.floating);return{reference:ki(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $i(e){return q(e).direction==="rtl"}const Wi={convertOffsetParentRelativeRectToViewportRelativeRect:_i,getDocumentElement:te,getClippingRect:Li,getOffsetParent:Vn,getElementRects:ji,getClientRects:Oi,getDimensions:Fi,getScale:Ce,isElement:X,isRTL:$i};function Bi(e,t){let n=null,r;const o=te(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function s(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),i();const{left:u,top:d,width:f,height:p}=e.getBoundingClientRect();if(c||t(),!f||!p)return;const h=Ge(d),v=Ge(o.clientWidth-(u+f)),m=Ge(o.clientHeight-(d+p)),w=Ge(u),y={rootMargin:-h+"px "+-v+"px "+-m+"px "+-w+"px",threshold:K(0,se(1,l))||1};let b=!0;function C(E){const M=E[0].intersectionRatio;if(M!==l){if(!b)return s();M?s(!1,M):r=setTimeout(()=>{s(!1,1e-7)},1e3)}b=!1}try{n=new IntersectionObserver(C,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,y)}n.observe(e)}return s(!0),i}function Ui(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Ut(e),d=o||i?[...u?Le(u):[],...Le(t)]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const f=u&&c?Bi(u,n):null;let p=-1,h=null;s&&(h=new ResizeObserver(x=>{let[y]=x;y&&y.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let v,m=l?me(e):null;l&&w();function w(){const x=me(e);m&&(x.x!==m.x||x.y!==m.y||x.width!==m.width||x.height!==m.height)&&n(),m=x,v=requestAnimationFrame(w)}return n(),()=>{var x;d.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),f==null||f(),(x=h)==null||x.disconnect(),h=null,l&&cancelAnimationFrame(v)}}const Gi=bi,Ki=Ci,Hi=wi,Vi=Si,zi=xi,Cn=gi,Yi=Ei,Xi=(e,t,n)=>{const r=new Map,o={platform:Wi,...n},i={...o.platform,_c:r};return vi(e,t,{...o,platform:i})};var Xe=typeof document<"u"?a.useLayoutEffect:a.useEffect;function tt(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(!tt(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)&&!tt(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function zn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function En(e,t){const n=zn(e);return Math.round(t*n)/n}function wt(e){const t=a.useRef(e);return Xe(()=>{t.current=e}),t}function qi(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=a.useState(r);tt(p,r)||h(r);const[v,m]=a.useState(null),[w,x]=a.useState(null),y=a.useCallback(_=>{_!==M.current&&(M.current=_,m(_))},[]),b=a.useCallback(_=>{_!==R.current&&(R.current=_,x(_))},[]),C=i||v,E=s||w,M=a.useRef(null),R=a.useRef(null),P=a.useRef(d),T=l!=null,O=wt(l),F=wt(o),k=wt(u),N=a.useCallback(()=>{if(!M.current||!R.current)return;const _={placement:t,strategy:n,middleware:p};F.current&&(_.platform=F.current),Xi(M.current,R.current,_).then(S=>{const L={...S,isPositioned:k.current!==!1};I.current&&!tt(P.current,L)&&(P.current=L,On.flushSync(()=>{f(L)}))})},[p,t,n,F,k]);Xe(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(_=>({..._,isPositioned:!1})))},[u]);const I=a.useRef(!1);Xe(()=>(I.current=!0,()=>{I.current=!1}),[]),Xe(()=>{if(C&&(M.current=C),E&&(R.current=E),C&&E){if(O.current)return O.current(C,E,N);N()}},[C,E,N,O,T]);const B=a.useMemo(()=>({reference:M,floating:R,setReference:y,setFloating:b}),[y,b]),D=a.useMemo(()=>({reference:C,floating:E}),[C,E]),j=a.useMemo(()=>{const _={position:n,left:0,top:0};if(!D.floating)return _;const S=En(D.floating,d.x),L=En(D.floating,d.y);return c?{..._,transform:"translate("+S+"px, "+L+"px)",...zn(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:S,top:L}},[n,c,D.floating,d.x,d.y]);return a.useMemo(()=>({...d,update:N,refs:B,elements:D,floatingStyles:j}),[d,N,B,D,j])}const Zi=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?Cn({element:r.current,padding:o}).fn(n):{}:r?Cn({element:r,padding:o}).fn(n):{}}}},Qi=(e,t)=>({...Gi(e),options:[e,t]}),Ji=(e,t)=>({...Ki(e),options:[e,t]}),es=(e,t)=>({...Yi(e),options:[e,t]}),ts=(e,t)=>({...Hi(e),options:[e,t]}),ns=(e,t)=>({...Vi(e),options:[e,t]}),rs=(e,t)=>({...zi(e),options:[e,t]}),os=(e,t)=>({...Zi(e),options:[e,t]});var is="Arrow",Yn=a.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return g.jsx($.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});Yn.displayName=is;var ss=Yn;function cs(e,t=[]){let n=[];function r(i,s){const c=a.createContext(s),l=n.length;n=[...n,s];function u(f){const{scope:p,children:h,...v}=f,m=(p==null?void 0:p[e][l])||c,w=a.useMemo(()=>v,Object.values(v));return g.jsx(m.Provider,{value:w,children:h})}function d(f,p){const h=(p==null?void 0:p[e][l])||c,v=a.useContext(h);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=n.map(s=>a.createContext(s));return function(c){const l=(c==null?void 0:c[e])||i;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,as(o,...t)]}function as(...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 s=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function us(e){const[t,n]=a.useState(void 0);return pe(()=>{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 s,c;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,c=u.blockSize}else s=e.offsetWidth,c=e.offsetHeight;n({width:s,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Gt="Popper",[Xn,qn]=cs(Gt),[ls,Zn]=Xn(Gt),Qn=e=>{const{__scopePopper:t,children:n}=e,[r,o]=a.useState(null);return g.jsx(ls,{scope:t,anchor:r,onAnchorChange:o,children:n})};Qn.displayName=Gt;var Jn="PopperAnchor",er=a.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Zn(Jn,n),s=a.useRef(null),c=W(t,s);return a.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:g.jsx($.div,{...o,ref:c})});er.displayName=Jn;var Kt="PopperContent",[fs,ds]=Xn(Kt),tr=a.forwardRef((e,t)=>{var ne,Oe,V,De,sn,cn;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:v,...m}=e,w=Zn(Kt,n),[x,y]=a.useState(null),b=W(t,Te=>y(Te)),[C,E]=a.useState(null),M=us(C),R=(M==null?void 0:M.width)??0,P=(M==null?void 0:M.height)??0,T=r+(i!=="center"?"-"+i:""),O=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},F=Array.isArray(u)?u:[u],k=F.length>0,N={padding:O,boundary:F.filter(ms),altBoundary:k},{refs:I,floatingStyles:B,placement:D,isPositioned:j,middlewareData:_}=qi({strategy:"fixed",placement:T,whileElementsMounted:(...Te)=>Ui(...Te,{animationFrame:h==="always"}),elements:{reference:w.anchor},middleware:[Qi({mainAxis:o+P,alignmentAxis:s}),l&&Ji({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?es():void 0,...N}),l&&ts({...N}),ns({...N,apply:({elements:Te,rects:an,availableWidth:bo,availableHeight:Co})=>{const{width:Eo,height:So}=an.reference,Ue=Te.floating.style;Ue.setProperty("--radix-popper-available-width",`${bo}px`),Ue.setProperty("--radix-popper-available-height",`${Co}px`),Ue.setProperty("--radix-popper-anchor-width",`${Eo}px`),Ue.setProperty("--radix-popper-anchor-height",`${So}px`)}}),C&&os({element:C,padding:c}),hs({arrowWidth:R,arrowHeight:P}),p&&rs({strategy:"referenceHidden",...N})]}),[S,L]=or(D),U=Y(v);pe(()=>{j&&(U==null||U())},[j,U]);const Q=(ne=_.arrow)==null?void 0:ne.x,Ae=(Oe=_.arrow)==null?void 0:Oe.y,_e=((V=_.arrow)==null?void 0:V.centerOffset)!==0,[Be,fe]=a.useState();return pe(()=>{x&&fe(window.getComputedStyle(x).zIndex)},[x]),g.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:j?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Be,"--radix-popper-transform-origin":[(De=_.transformOrigin)==null?void 0:De.x,(sn=_.transformOrigin)==null?void 0:sn.y].join(" "),...((cn=_.hide)==null?void 0:cn.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(fs,{scope:n,placedSide:S,onArrowChange:E,arrowX:Q,arrowY:Ae,shouldHideArrow:_e,children:g.jsx($.div,{"data-side":S,"data-align":L,...m,ref:b,style:{...m.style,animation:j?void 0:"none"}})})})});tr.displayName=Kt;var nr="PopperArrow",ps={top:"bottom",right:"left",bottom:"top",left:"right"},rr=a.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=ds(nr,r),s=ps[i.placedSide];return g.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:g.jsx(ss,{...o,ref:n,style:{...o.style,display:"block"}})})});rr.displayName=nr;function ms(e){return e!==null}var hs=e=>({name:"transformOrigin",options:e,fn(t){var w,x,y;const{placement:n,rects:r,middlewareData:o}=t,s=((w=o.arrow)==null?void 0:w.centerOffset)!==0,c=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[u,d]=or(n),f={start:"0%",center:"50%",end:"100%"}[d],p=(((x=o.arrow)==null?void 0:x.x)??0)+c/2,h=(((y=o.arrow)==null?void 0:y.y)??0)+l/2;let v="",m="";return u==="bottom"?(v=s?f:`${p}px`,m=`${-l}px`):u==="top"?(v=s?f:`${p}px`,m=`${r.floating.height+l}px`):u==="right"?(v=`${-l}px`,m=s?f:`${h}px`):u==="left"&&(v=`${r.floating.width+l}px`,m=s?f:`${h}px`),{data:{x:v,y:m}}}});function or(e){const[t,n="center"]=e.split("-");return[t,n]}var vs=Qn,gs=er,ws=tr,xs=rr,ys="Portal",Ht=a.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[o,i]=a.useState(!1);pe(()=>i(!0),[]);const s=n||o&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return s?Mo.createPortal(g.jsx($.div,{...r,ref:t}),s):null});Ht.displayName=ys;function bs(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}var le=e=>{const{present:t,children:n}=e,r=Cs(t),o=typeof n=="function"?n({present:r.isPresent}):a.Children.only(n),i=W(r.ref,Es(o));return typeof n=="function"||r.isPresent?a.cloneElement(o,{ref:i}):null};le.displayName="Presence";function Cs(e){const[t,n]=a.useState(),r=a.useRef({}),o=a.useRef(e),i=a.useRef("none"),s=e?"mounted":"unmounted",[c,l]=bs(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const u=Ke(r.current);i.current=c==="mounted"?u:"none"},[c]),pe(()=>{const u=r.current,d=o.current;if(d!==e){const p=i.current,h=Ke(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]),pe(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=h=>{const m=Ke(r.current).includes(h.animationName);if(h.target===t&&m&&(l("ANIMATION_END"),!o.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},p=h=>{h.target===t&&(i.current=Ke(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:a.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Ke(e){return(e==null?void 0:e.animationName)||"none"}function Es(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 Ss(e,t=[]){let n=[];function r(i,s){const c=a.createContext(s),l=n.length;n=[...n,s];function u(f){const{scope:p,children:h,...v}=f,m=(p==null?void 0:p[e][l])||c,w=a.useMemo(()=>v,Object.values(v));return g.jsx(m.Provider,{value:w,children:h})}function d(f,p){const h=(p==null?void 0:p[e][l])||c,v=a.useContext(h);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=n.map(s=>a.createContext(s));return function(c){const l=(c==null?void 0:c[e])||i;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return o.scopeName=e,[r,Rs(o,...t)]}function Rs(...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 s=r.reduce((c,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...c,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var xt="rovingFocusGroup.onEntryFocus",Ms={bubbles:!1,cancelable:!0},lt="RovingFocusGroup",[Ot,ir,Ps]=Nn(lt),[As,sr]=Ss(lt,[Ps]),[_s,Os]=As(lt),cr=a.forwardRef((e,t)=>g.jsx(Ot.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(Ot.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(Ds,{...e,ref:t})})}));cr.displayName=lt;var Ds=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,p=a.useRef(null),h=W(t,p),v=Ln(i),[m=null,w]=Nt({prop:s,defaultProp:c,onChange:l}),[x,y]=a.useState(!1),b=Y(u),C=ir(n),E=a.useRef(!1),[M,R]=a.useState(0);return a.useEffect(()=>{const P=p.current;if(P)return P.addEventListener(xt,b),()=>P.removeEventListener(xt,b)},[b]),g.jsx(_s,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:m,onItemFocus:a.useCallback(P=>w(P),[w]),onItemShiftTab:a.useCallback(()=>y(!0),[]),onFocusableItemAdd:a.useCallback(()=>R(P=>P+1),[]),onFocusableItemRemove:a.useCallback(()=>R(P=>P-1),[]),children:g.jsx($.div,{tabIndex:x||M===0?-1:0,"data-orientation":r,...f,ref:h,style:{outline:"none",...e.style},onMouseDown:A(e.onMouseDown,()=>{E.current=!0}),onFocus:A(e.onFocus,P=>{const T=!E.current;if(P.target===P.currentTarget&&T&&!x){const O=new CustomEvent(xt,Ms);if(P.currentTarget.dispatchEvent(O),!O.defaultPrevented){const F=C().filter(D=>D.focusable),k=F.find(D=>D.active),N=F.find(D=>D.id===m),B=[k,N,...F].filter(Boolean).map(D=>D.ref.current);lr(B,d)}}E.current=!1}),onBlur:A(e.onBlur,()=>y(!1))})})}),ar="RovingFocusGroupItem",ur=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,c=be(),l=i||c,u=Os(ar,n),d=u.currentTabStopId===l,f=ir(n),{onFocusableItemAdd:p,onFocusableItemRemove:h}=u;return a.useEffect(()=>{if(r)return p(),()=>h()},[r,p,h]),g.jsx(Ot.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:g.jsx($.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:A(e.onMouseDown,v=>{r?u.onItemFocus(l):v.preventDefault()}),onFocus:A(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:A(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){u.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const m=Ns(v,u.orientation,u.dir);if(m!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let x=f().filter(y=>y.focusable).map(y=>y.ref.current);if(m==="last")x.reverse();else if(m==="prev"||m==="next"){m==="prev"&&x.reverse();const y=x.indexOf(v.currentTarget);x=u.loop?Ls(x,y+1):x.slice(y+1)}setTimeout(()=>lr(x))}})})})});ur.displayName=ar;var Ts={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Is(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ns(e,t,n){const r=Is(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Ts[r]}function lr(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Ls(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Fs=cr,ks=ur,js=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},we=new WeakMap,He=new WeakMap,Ve={},yt=0,fr=function(e){return e&&(e.host||fr(e.parentNode))},$s=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=fr(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Ws=function(e,t,n,r){var o=$s(t,Array.isArray(e)?e:[e]);Ve[n]||(Ve[n]=new WeakMap);var i=Ve[n],s=[],c=new Set,l=new Set(o),u=function(f){!f||c.has(f)||(c.add(f),u(f.parentNode))};o.forEach(u);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(p){if(c.has(p))d(p);else try{var h=p.getAttribute(r),v=h!==null&&h!=="false",m=(we.get(p)||0)+1,w=(i.get(p)||0)+1;we.set(p,m),i.set(p,w),s.push(p),m===1&&v&&He.set(p,!0),w===1&&p.setAttribute(n,"true"),v||p.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",p,x)}})};return d(t),c.clear(),yt++,function(){s.forEach(function(f){var p=we.get(f)-1,h=i.get(f)-1;we.set(f,p),i.set(f,h),p||(He.has(f)||f.removeAttribute(r),He.delete(f)),h||f.removeAttribute(n)}),yt--,yt||(we=new WeakMap,we=new WeakMap,He=new WeakMap,Ve={})}},dr=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=js(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Ws(r,o,n,"aria-hidden")):function(){return null}},J=function(){return J=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},J.apply(this,arguments)};function pr(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 Bs(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 qe="right-scroll-bar-position",Ze="width-before-scroll-bar",Us="with-scroll-bars-hidden",Gs="--removed-body-scroll-bar-size";function bt(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Ks(e,t){var n=a.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 Hs=typeof window<"u"?a.useLayoutEffect:a.useEffect,Sn=new WeakMap;function Vs(e,t){var n=Ks(null,function(r){return e.forEach(function(o){return bt(o,r)})});return Hs(function(){var r=Sn.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(c){i.has(c)||bt(c,null)}),i.forEach(function(c){o.has(c)||bt(c,s)})}Sn.set(n,e)},[e]),n}function zs(e){return e}function Ys(e,t){t===void 0&&(t=zs);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 s=t(i,r);return n.push(s),function(){n=n.filter(function(c){return c!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var c=n;n=[],c.forEach(i),s=n}var l=function(){var d=s;s=[],d.forEach(i)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){s.push(d),u()},filter:function(d){return s=s.filter(d),n}}}};return o}function Xs(e){e===void 0&&(e={});var t=Ys(null);return t.options=J({async:!0,ssr:!1},e),t}var mr=function(e){var t=e.sideCar,n=pr(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 a.createElement(r,J({},n))};mr.isSideCarExport=!0;function qs(e,t){return e.useMedium(t),mr}var hr=Xs(),Ct=function(){},ft=a.forwardRef(function(e,t){var n=a.useRef(null),r=a.useState({onScrollCapture:Ct,onWheelCapture:Ct,onTouchMoveCapture:Ct}),o=r[0],i=r[1],s=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noIsolation,v=e.inert,m=e.allowPinchZoom,w=e.as,x=w===void 0?"div":w,y=e.gapMode,b=pr(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=p,E=Vs([n,t]),M=J(J({},b),o);return a.createElement(a.Fragment,null,d&&a.createElement(C,{sideCar:hr,removeScrollBar:u,shards:f,noIsolation:h,inert:v,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:y}),s?a.cloneElement(a.Children.only(c),J(J({},M),{ref:E})):a.createElement(x,J({},M,{className:l,ref:E}),c))});ft.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ft.classNames={fullWidth:Ze,zeroRight:qe};var Zs=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Qs(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Zs();return t&&e.setAttribute("nonce",t),e}function Js(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ec(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var tc=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Qs())&&(Js(t,n),ec(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},nc=function(){var e=tc();return function(t,n){a.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},vr=function(){var e=nc(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},rc={left:0,top:0,right:0,gap:0},Et=function(e){return parseInt(e||"",10)||0},oc=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[Et(n),Et(r),Et(o)]},ic=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return rc;var t=oc(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])}},sc=vr(),Ee="data-scroll-locked",cc=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,c=e.gap;return n===void 0&&(n="margin"),`
  .`.concat(Us,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(c,"px ").concat(r,`;
  }
  body[`).concat(Ee,`] {
    overflow: hidden `).concat(r,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
    padding-left: `.concat(o,`px;
    padding-top: `).concat(i,`px;
    padding-right: `).concat(s,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(c,"px ").concat(r,`;
    `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(qe,` {
    right: `).concat(c,"px ").concat(r,`;
  }
  
  .`).concat(Ze,` {
    margin-right: `).concat(c,"px ").concat(r,`;
  }
  
  .`).concat(qe," .").concat(qe,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(Ze," .").concat(Ze,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(Ee,`] {
    `).concat(Gs,": ").concat(c,`px;
  }
`)},Rn=function(){var e=parseInt(document.body.getAttribute(Ee)||"0",10);return isFinite(e)?e:0},ac=function(){a.useEffect(function(){return document.body.setAttribute(Ee,(Rn()+1).toString()),function(){var e=Rn()-1;e<=0?document.body.removeAttribute(Ee):document.body.setAttribute(Ee,e.toString())}},[])},uc=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;ac();var i=a.useMemo(function(){return ic(o)},[o]);return a.createElement(sc,{styles:cc(i,!t,o,n?"":"!important")})},Dt=!1;if(typeof window<"u")try{var ze=Object.defineProperty({},"passive",{get:function(){return Dt=!0,!0}});window.addEventListener("test",ze,ze),window.removeEventListener("test",ze,ze)}catch{Dt=!1}var xe=Dt?{passive:!1}:!1,lc=function(e){return e.tagName==="TEXTAREA"},gr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!lc(e)&&n[t]==="visible")},fc=function(e){return gr(e,"overflowY")},dc=function(e){return gr(e,"overflowX")},Mn=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=wr(e,r);if(o){var i=xr(e,r),s=i[1],c=i[2];if(s>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},pc=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},mc=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},wr=function(e,t){return e==="v"?fc(t):dc(t)},xr=function(e,t){return e==="v"?pc(t):mc(t)},hc=function(e,t){return e==="h"&&t==="rtl"?-1:1},vc=function(e,t,n,r,o){var i=hc(e,window.getComputedStyle(t).direction),s=i*r,c=n.target,l=t.contains(c),u=!1,d=s>0,f=0,p=0;do{var h=xr(e,c),v=h[0],m=h[1],w=h[2],x=m-w-i*v;(v||x)&&wr(e,c)&&(f+=x,p+=v),c instanceof ShadowRoot?c=c.host:c=c.parentNode}while(!l&&c!==document.body||l&&(t.contains(c)||t===c));return(d&&(Math.abs(f)<1||!o)||!d&&(Math.abs(p)<1||!o))&&(u=!0),u},Ye=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Pn=function(e){return[e.deltaX,e.deltaY]},An=function(e){return e&&"current"in e?e.current:e},gc=function(e,t){return e[0]===t[0]&&e[1]===t[1]},wc=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},xc=0,ye=[];function yc(e){var t=a.useRef([]),n=a.useRef([0,0]),r=a.useRef(),o=a.useState(xc++)[0],i=a.useState(vr)[0],s=a.useRef(e);a.useEffect(function(){s.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=Bs([e.lockRef.current],(e.shards||[]).map(An),!0).filter(Boolean);return m.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=a.useCallback(function(m,w){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var x=Ye(m),y=n.current,b="deltaX"in m?m.deltaX:y[0]-x[0],C="deltaY"in m?m.deltaY:y[1]-x[1],E,M=m.target,R=Math.abs(b)>Math.abs(C)?"h":"v";if("touches"in m&&R==="h"&&M.type==="range")return!1;var P=Mn(R,M);if(!P)return!0;if(P?E=R:(E=R==="v"?"h":"v",P=Mn(R,M)),!P)return!1;if(!r.current&&"changedTouches"in m&&(b||C)&&(r.current=E),!E)return!0;var T=r.current||E;return vc(T,w,m,T==="h"?b:C,!0)},[]),l=a.useCallback(function(m){var w=m;if(!(!ye.length||ye[ye.length-1]!==i)){var x="deltaY"in w?Pn(w):Ye(w),y=t.current.filter(function(E){return E.name===w.type&&(E.target===w.target||w.target===E.shadowParent)&&gc(E.delta,x)})[0];if(y&&y.should){w.cancelable&&w.preventDefault();return}if(!y){var b=(s.current.shards||[]).map(An).filter(Boolean).filter(function(E){return E.contains(w.target)}),C=b.length>0?c(w,b[0]):!s.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),u=a.useCallback(function(m,w,x,y){var b={name:m,delta:w,target:x,should:y,shadowParent:bc(x)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(C){return C!==b})},1)},[]),d=a.useCallback(function(m){n.current=Ye(m),r.current=void 0},[]),f=a.useCallback(function(m){u(m.type,Pn(m),m.target,c(m,e.lockRef.current))},[]),p=a.useCallback(function(m){u(m.type,Ye(m),m.target,c(m,e.lockRef.current))},[]);a.useEffect(function(){return ye.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,xe),document.addEventListener("touchmove",l,xe),document.addEventListener("touchstart",d,xe),function(){ye=ye.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,xe),document.removeEventListener("touchmove",l,xe),document.removeEventListener("touchstart",d,xe)}},[]);var h=e.removeScrollBar,v=e.inert;return a.createElement(a.Fragment,null,v?a.createElement(i,{styles:wc(o)}):null,h?a.createElement(uc,{gapMode:e.gapMode}):null)}function bc(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Cc=qs(hr,yc);var Vt=a.forwardRef(function(e,t){return a.createElement(ft,J({},e,{ref:t,sideCar:Cc}))});Vt.classNames=ft.classNames;var Tt=["Enter"," "],Ec=["ArrowDown","PageUp","Home"],yr=["ArrowUp","PageDown","End"],Sc=[...Ec,...yr],Rc={ltr:[...Tt,"ArrowRight"],rtl:[...Tt,"ArrowLeft"]},Mc={ltr:["ArrowLeft"],rtl:["ArrowRight"]},$e="Menu",[Fe,Pc,Ac]=Nn($e),[ve,br]=It($e,[Ac,qn,sr]),dt=qn(),Cr=sr(),[_c,ge]=ve($e),[Oc,We]=ve($e),Er=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,c=dt(t),[l,u]=a.useState(null),d=a.useRef(!1),f=Y(i),p=Ln(o);return a.useEffect(()=>{const h=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),g.jsx(vs,{...c,children:g.jsx(_c,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:g.jsx(Oc,{scope:t,onClose:a.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:s,children:r})})})};Er.displayName=$e;var Dc="MenuAnchor",zt=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=dt(n);return g.jsx(gs,{...o,...r,ref:t})});zt.displayName=Dc;var Yt="MenuPortal",[Tc,Sr]=ve(Yt,{forceMount:void 0}),Rr=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=ge(Yt,t);return g.jsx(Tc,{scope:t,forceMount:n,children:g.jsx(le,{present:n||i.open,children:g.jsx(Ht,{asChild:!0,container:o,children:r})})})};Rr.displayName=Yt;var z="MenuContent",[Ic,Xt]=ve(z),Mr=a.forwardRef((e,t)=>{const n=Sr(z,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=ge(z,e.__scopeMenu),s=We(z,e.__scopeMenu);return g.jsx(Fe.Provider,{scope:e.__scopeMenu,children:g.jsx(le,{present:r||i.open,children:g.jsx(Fe.Slot,{scope:e.__scopeMenu,children:s.modal?g.jsx(Nc,{...o,ref:t}):g.jsx(Lc,{...o,ref:t})})})})}),Nc=a.forwardRef((e,t)=>{const n=ge(z,e.__scopeMenu),r=a.useRef(null),o=W(t,r);return a.useEffect(()=>{const i=r.current;if(i)return dr(i)},[]),g.jsx(qt,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:A(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Lc=a.forwardRef((e,t)=>{const n=ge(z,e.__scopeMenu);return g.jsx(qt,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),qt=a.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:h,disableOutsideScroll:v,...m}=e,w=ge(z,n),x=We(z,n),y=dt(n),b=Cr(n),C=Pc(n),[E,M]=a.useState(null),R=a.useRef(null),P=W(t,R,w.onContentChange),T=a.useRef(0),O=a.useRef(""),F=a.useRef(0),k=a.useRef(null),N=a.useRef("right"),I=a.useRef(0),B=v?Vt:a.Fragment,D=v?{as:Se,allowPinchZoom:!0}:void 0,j=S=>{var ne,Oe;const L=O.current+S,U=C().filter(V=>!V.disabled),Q=document.activeElement,Ae=(ne=U.find(V=>V.ref.current===Q))==null?void 0:ne.textValue,_e=U.map(V=>V.textValue),Be=zc(_e,L,Ae),fe=(Oe=U.find(V=>V.textValue===Be))==null?void 0:Oe.ref.current;(function V(De){O.current=De,window.clearTimeout(T.current),De!==""&&(T.current=window.setTimeout(()=>V(""),1e3))})(L),fe&&setTimeout(()=>fe.focus())};a.useEffect(()=>()=>window.clearTimeout(T.current),[]),jn();const _=a.useCallback(S=>{var U,Q;return N.current===((U=k.current)==null?void 0:U.side)&&Xc(S,(Q=k.current)==null?void 0:Q.area)},[]);return g.jsx(Ic,{scope:n,searchRef:O,onItemEnter:a.useCallback(S=>{_(S)&&S.preventDefault()},[_]),onItemLeave:a.useCallback(S=>{var L;_(S)||((L=R.current)==null||L.focus(),M(null))},[_]),onTriggerLeave:a.useCallback(S=>{_(S)&&S.preventDefault()},[_]),pointerGraceTimerRef:F,onPointerGraceIntentChange:a.useCallback(S=>{k.current=S},[]),children:g.jsx(B,{...D,children:g.jsx(Ft,{asChild:!0,trapped:o,onMountAutoFocus:A(i,S=>{var L;S.preventDefault(),(L=R.current)==null||L.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:g.jsx(Lt,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:h,children:g.jsx(Fs,{asChild:!0,...b,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:M,onEntryFocus:A(l,S=>{x.isUsingKeyboardRef.current||S.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(ws,{role:"menu","aria-orientation":"vertical","data-state":Ur(w.open),"data-radix-menu-content":"",dir:x.dir,...y,...m,ref:P,style:{outline:"none",...m.style},onKeyDown:A(m.onKeyDown,S=>{const U=S.target.closest("[data-radix-menu-content]")===S.currentTarget,Q=S.ctrlKey||S.altKey||S.metaKey,Ae=S.key.length===1;U&&(S.key==="Tab"&&S.preventDefault(),!Q&&Ae&&j(S.key));const _e=R.current;if(S.target!==_e||!Sc.includes(S.key))return;S.preventDefault();const fe=C().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);yr.includes(S.key)&&fe.reverse(),Hc(fe)}),onBlur:A(e.onBlur,S=>{S.currentTarget.contains(S.target)||(window.clearTimeout(T.current),O.current="")}),onPointerMove:A(e.onPointerMove,ke(S=>{const L=S.target,U=I.current!==S.clientX;if(S.currentTarget.contains(L)&&U){const Q=S.clientX>I.current?"right":"left";N.current=Q,I.current=S.clientX}}))})})})})})})});Mr.displayName=z;var Fc="MenuGroup",Zt=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx($.div,{role:"group",...r,ref:t})});Zt.displayName=Fc;var kc="MenuLabel",Pr=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx($.div,{...r,ref:t})});Pr.displayName=kc;var nt="MenuItem",_n="menu.itemSelect",pt=a.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=a.useRef(null),s=We(nt,e.__scopeMenu),c=Xt(nt,e.__scopeMenu),l=W(t,i),u=a.useRef(!1),d=()=>{const f=i.current;if(!n&&f){const p=new CustomEvent(_n,{bubbles:!0,cancelable:!0});f.addEventListener(_n,h=>r==null?void 0:r(h),{once:!0}),In(f,p),p.defaultPrevented?u.current=!1:s.onClose()}};return g.jsx(Ar,{...o,ref:l,disabled:n,onClick:A(e.onClick,d),onPointerDown:f=>{var p;(p=e.onPointerDown)==null||p.call(e,f),u.current=!0},onPointerUp:A(e.onPointerUp,f=>{var p;u.current||(p=f.currentTarget)==null||p.click()}),onKeyDown:A(e.onKeyDown,f=>{const p=c.searchRef.current!=="";n||p&&f.key===" "||Tt.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});pt.displayName=nt;var Ar=a.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=Xt(nt,n),c=Cr(n),l=a.useRef(null),u=W(t,l),[d,f]=a.useState(!1),[p,h]=a.useState("");return a.useEffect(()=>{const v=l.current;v&&h((v.textContent??"").trim())},[i.children]),g.jsx(Fe.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:g.jsx(ks,{asChild:!0,...c,focusable:!r,children:g.jsx($.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:u,onPointerMove:A(e.onPointerMove,ke(v=>{r?s.onItemLeave(v):(s.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:A(e.onPointerLeave,ke(v=>s.onItemLeave(v))),onFocus:A(e.onFocus,()=>f(!0)),onBlur:A(e.onBlur,()=>f(!1))})})})}),jc="MenuCheckboxItem",_r=a.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return g.jsx(Nr,{scope:e.__scopeMenu,checked:n,children:g.jsx(pt,{role:"menuitemcheckbox","aria-checked":rt(n)?"mixed":n,...o,ref:t,"data-state":Jt(n),onSelect:A(o.onSelect,()=>r==null?void 0:r(rt(n)?!0:!n),{checkForDefaultPrevented:!1})})})});_r.displayName=jc;var Or="MenuRadioGroup",[$c,Wc]=ve(Or,{value:void 0,onValueChange:()=>{}}),Dr=a.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Y(r);return g.jsx($c,{scope:e.__scopeMenu,value:n,onValueChange:i,children:g.jsx(Zt,{...o,ref:t})})});Dr.displayName=Or;var Tr="MenuRadioItem",Ir=a.forwardRef((e,t)=>{const{value:n,...r}=e,o=Wc(Tr,e.__scopeMenu),i=n===o.value;return g.jsx(Nr,{scope:e.__scopeMenu,checked:i,children:g.jsx(pt,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":Jt(i),onSelect:A(r.onSelect,()=>{var s;return(s=o.onValueChange)==null?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})})});Ir.displayName=Tr;var Qt="MenuItemIndicator",[Nr,Bc]=ve(Qt,{checked:!1}),Lr=a.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=Bc(Qt,n);return g.jsx(le,{present:r||rt(i.checked)||i.checked===!0,children:g.jsx($.span,{...o,ref:t,"data-state":Jt(i.checked)})})});Lr.displayName=Qt;var Uc="MenuSeparator",Fr=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx($.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Fr.displayName=Uc;var Gc="MenuArrow",kr=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=dt(n);return g.jsx(xs,{...o,...r,ref:t})});kr.displayName=Gc;var Kc="MenuSub",[ka,jr]=ve(Kc),Ie="MenuSubTrigger",$r=a.forwardRef((e,t)=>{const n=ge(Ie,e.__scopeMenu),r=We(Ie,e.__scopeMenu),o=jr(Ie,e.__scopeMenu),i=Xt(Ie,e.__scopeMenu),s=a.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=i,u={__scopeMenu:e.__scopeMenu},d=a.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return a.useEffect(()=>d,[d]),a.useEffect(()=>{const f=c.current;return()=>{window.clearTimeout(f),l(null)}},[c,l]),g.jsx(zt,{asChild:!0,...u,children:g.jsx(Ar,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Ur(n.open),...e,ref:st(t,o.onTriggerChange),onClick:f=>{var p;(p=e.onClick)==null||p.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:A(e.onPointerMove,ke(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:A(e.onPointerLeave,ke(f=>{var h,v;d();const p=(h=n.content)==null?void 0:h.getBoundingClientRect();if(p){const m=(v=n.content)==null?void 0:v.dataset.side,w=m==="right",x=w?-5:5,y=p[w?"left":"right"],b=p[w?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+x,y:f.clientY},{x:y,y:p.top},{x:b,y:p.top},{x:b,y:p.bottom},{x:y,y:p.bottom}],side:m}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:A(e.onKeyDown,f=>{var h;const p=i.searchRef.current!=="";e.disabled||p&&f.key===" "||Rc[r.dir].includes(f.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),f.preventDefault())})})})});$r.displayName=Ie;var Wr="MenuSubContent",Br=a.forwardRef((e,t)=>{const n=Sr(z,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=ge(z,e.__scopeMenu),s=We(z,e.__scopeMenu),c=jr(Wr,e.__scopeMenu),l=a.useRef(null),u=W(t,l);return g.jsx(Fe.Provider,{scope:e.__scopeMenu,children:g.jsx(le,{present:r||i.open,children:g.jsx(Fe.Slot,{scope:e.__scopeMenu,children:g.jsx(qt,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:u,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;s.isUsingKeyboardRef.current&&((f=l.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:A(e.onFocusOutside,d=>{d.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:A(e.onEscapeKeyDown,d=>{s.onClose(),d.preventDefault()}),onKeyDown:A(e.onKeyDown,d=>{var h;const f=d.currentTarget.contains(d.target),p=Mc[s.dir].includes(d.key);f&&p&&(i.onOpenChange(!1),(h=c.trigger)==null||h.focus(),d.preventDefault())})})})})})});Br.displayName=Wr;function Ur(e){return e?"open":"closed"}function rt(e){return e==="indeterminate"}function Jt(e){return rt(e)?"indeterminate":e?"checked":"unchecked"}function Hc(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Vc(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function zc(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=Vc(e,Math.max(i,0));o.length===1&&(s=s.filter(u=>u!==n));const l=s.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Yc(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const c=t[i].x,l=t[i].y,u=t[s].x,d=t[s].y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(o=!o)}return o}function Xc(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Yc(n,t)}function ke(e){return t=>t.pointerType==="mouse"?e(t):void 0}var qc=Er,Zc=zt,Qc=Rr,Jc=Mr,ea=Zt,ta=Pr,na=pt,ra=_r,oa=Dr,ia=Ir,sa=Lr,ca=Fr,aa=kr,ua=$r,la=Br,en="DropdownMenu",[fa,ja]=It(en,[br]),G=br(),[da,Gr]=fa(en),Kr=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:c=!0}=e,l=G(t),u=a.useRef(null),[d=!1,f]=Nt({prop:o,defaultProp:i,onChange:s});return g.jsx(da,{scope:t,triggerId:be(),triggerRef:u,contentId:be(),open:d,onOpenChange:f,onOpenToggle:a.useCallback(()=>f(p=>!p),[f]),modal:c,children:g.jsx(qc,{...l,open:d,onOpenChange:f,dir:r,modal:c,children:n})})};Kr.displayName=en;var Hr="DropdownMenuTrigger",Vr=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=Gr(Hr,n),s=G(n);return g.jsx(Zc,{asChild:!0,...s,children:g.jsx($.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:st(t,i.triggerRef),onPointerDown:A(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:A(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});Vr.displayName=Hr;var pa="DropdownMenuPortal",zr=e=>{const{__scopeDropdownMenu:t,...n}=e,r=G(t);return g.jsx(Qc,{...r,...n})};zr.displayName=pa;var Yr="DropdownMenuContent",Xr=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Gr(Yr,n),i=G(n),s=a.useRef(!1);return g.jsx(Jc,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:A(e.onCloseAutoFocus,c=>{var l;s.current||(l=o.triggerRef.current)==null||l.focus(),s.current=!1,c.preventDefault()}),onInteractOutside:A(e.onInteractOutside,c=>{const l=c.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,d=l.button===2||u;(!o.modal||d)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Xr.displayName=Yr;var ma="DropdownMenuGroup",ha=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return g.jsx(ea,{...o,...r,ref:t})});ha.displayName=ma;var va="DropdownMenuLabel",qr=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return g.jsx(ta,{...o,...r,ref:t})});qr.displayName=va;var ga="DropdownMenuItem",Zr=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return g.jsx(na,{...o,...r,ref:t})});Zr.displayName=ga;var wa="DropdownMenuCheckboxItem",Qr=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return g.jsx(ra,{...o,...r,ref:t})});Qr.displayName=wa;var xa="DropdownMenuRadioGroup",ya=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return g.jsx(oa,{...o,...r,ref:t})});ya.displayName=xa;var ba="DropdownMenuRadioItem",Jr=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return g.jsx(ia,{...o,...r,ref:t})});Jr.displayName=ba;var Ca="DropdownMenuItemIndicator",eo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return g.jsx(sa,{...o,...r,ref:t})});eo.displayName=Ca;var Ea="DropdownMenuSeparator",to=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return g.jsx(ca,{...o,...r,ref:t})});to.displayName=Ea;var Sa="DropdownMenuArrow",Ra=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return g.jsx(aa,{...o,...r,ref:t})});Ra.displayName=Sa;var Ma="DropdownMenuSubTrigger",no=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return g.jsx(ua,{...o,...r,ref:t})});no.displayName=Ma;var Pa="DropdownMenuSubContent",ro=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return g.jsx(la,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ro.displayName=Pa;var $a=Kr,Wa=Vr,Ba=zr,Ua=Xr,Ga=qr,Ka=Zr,Ha=Qr,Va=Jr,za=eo,Ya=to,Xa=no,qa=ro,tn="Dialog",[oo,Za]=It(tn),[Aa,Z]=oo(tn),io=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,c=a.useRef(null),l=a.useRef(null),[u=!1,d]=Nt({prop:r,defaultProp:o,onChange:i});return g.jsx(Aa,{scope:t,triggerRef:c,contentRef:l,contentId:be(),titleId:be(),descriptionId:be(),open:u,onOpenChange:d,onOpenToggle:a.useCallback(()=>d(f=>!f),[d]),modal:s,children:n})};io.displayName=tn;var so="DialogTrigger",co=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Z(so,n),i=W(t,o.triggerRef);return g.jsx($.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":on(o.open),...r,ref:i,onClick:A(e.onClick,o.onOpenToggle)})});co.displayName=so;var nn="DialogPortal",[_a,ao]=oo(nn,{forceMount:void 0}),uo=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Z(nn,t);return g.jsx(_a,{scope:t,forceMount:n,children:a.Children.map(r,s=>g.jsx(le,{present:n||i.open,children:g.jsx(Ht,{asChild:!0,container:o,children:s})}))})};uo.displayName=nn;var ot="DialogOverlay",lo=a.forwardRef((e,t)=>{const n=ao(ot,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Z(ot,e.__scopeDialog);return i.modal?g.jsx(le,{present:r||i.open,children:g.jsx(Oa,{...o,ref:t})}):null});lo.displayName=ot;var Oa=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Z(ot,n);return g.jsx(Vt,{as:Se,allowPinchZoom:!0,shards:[o.contentRef],children:g.jsx($.div,{"data-state":on(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),he="DialogContent",fo=a.forwardRef((e,t)=>{const n=ao(he,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Z(he,e.__scopeDialog);return g.jsx(le,{present:r||i.open,children:i.modal?g.jsx(Da,{...o,ref:t}):g.jsx(Ta,{...o,ref:t})})});fo.displayName=he;var Da=a.forwardRef((e,t)=>{const n=Z(he,e.__scopeDialog),r=a.useRef(null),o=W(t,n.contentRef,r);return a.useEffect(()=>{const i=r.current;if(i)return dr(i)},[]),g.jsx(po,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:A(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:A(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,c=s.button===0&&s.ctrlKey===!0;(s.button===2||c)&&i.preventDefault()}),onFocusOutside:A(e.onFocusOutside,i=>i.preventDefault())})}),Ta=a.forwardRef((e,t)=>{const n=Z(he,e.__scopeDialog),r=a.useRef(!1),o=a.useRef(!1);return g.jsx(po,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,c;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),po=a.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,c=Z(he,n),l=a.useRef(null),u=W(t,l);return jn(),g.jsxs(g.Fragment,{children:[g.jsx(Ft,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:g.jsx(Lt,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":on(c.open),...s,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(Ia,{titleId:c.titleId}),g.jsx(La,{contentRef:l,descriptionId:c.descriptionId})]})]})}),rn="DialogTitle",mo=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Z(rn,n);return g.jsx($.h2,{id:o.titleId,...r,ref:t})});mo.displayName=rn;var ho="DialogDescription",vo=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Z(ho,n);return g.jsx($.p,{id:o.descriptionId,...r,ref:t})});vo.displayName=ho;var go="DialogClose",wo=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Z(go,n);return g.jsx($.button,{type:"button",...r,ref:t,onClick:A(e.onClick,()=>o.onOpenChange(!1))})});wo.displayName=go;function on(e){return e?"open":"closed"}var xo="DialogTitleWarning",[Qa,yo]=jo(xo,{contentName:he,titleName:rn,docsSlug:"dialog"}),Ia=({titleId:e})=>{const t=yo(xo),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return a.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Na="DialogDescriptionWarning",La=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${yo(Na).contentName}}.`;return a.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Ja=io,eu=co,tu=uo,nu=lo,ru=fo,ou=mo,iu=vo,su=wo;export{gs as A,su as B,Ua as C,Lt as D,ou as E,Ft as F,iu as G,tu as H,Ka as I,Ja as J,eu as K,Ga as L,le as M,Za as N,nu as O,$ as P,No as Q,Va as R,Se as S,Wa as T,us as U,Qa as W,pe as a,Xa as b,It as c,qa as d,Ba as e,Ha as f,za as g,Ya as h,$a as i,g as j,Nn as k,qn as l,W as m,A as n,dr as o,jn as p,Vt as q,ws as r,be as s,xs as t,Y as u,Ht as v,Ln as w,Nt as x,vs as y,ru as z};