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