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