UNPKG

@accounter/client

Version:
41 lines 102 kB
import{s as e}from"./dist-ypP48_Ax.js";import{i as t,o as n,t as r}from"./utils-CbS-oR5I.js";import{xs as i}from"./error-handling-C2WP9OW-.js";import{i as a,s as o}from"./button-DUNsVBiu.js";var s=e(n(),1),c=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),l=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),u=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),d=e=>{let t=u(e);return t.charAt(0).toUpperCase()+t.slice(1)},f={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},p=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},m=(0,s.createContext)({}),h=()=>(0,s.useContext)(m),g=(0,s.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...l},u)=>{let{size:d=24,strokeWidth:m=2,absoluteStrokeWidth:g=!1,color:_=`currentColor`,className:v=``}=h()??{},y=r??g?Number(n??m)*24/Number(t??d):n??m;return(0,s.createElement)(`svg`,{ref:u,...f,width:t??d??f.width,height:t??d??f.height,stroke:e??_,strokeWidth:y,className:c(`lucide`,v,i),...!a&&!p(l)&&{"aria-hidden":`true`},...l},[...o.map(([e,t])=>(0,s.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),_=(e,t)=>{let n=(0,s.forwardRef)(({className:n,...r},i)=>(0,s.createElement)(g,{ref:i,iconNode:t,className:c(`lucide-${l(d(e))}`,`lucide-${e}`,n),...r}));return n.displayName=d(e),n},v=_(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),y=_(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),b=_(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),x=_(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),S=_(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),C=_(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),w=_(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),T=e(i(),1),E=t(),D=Object.defineProperty,O=(e,t)=>D(e,`name`,{value:t,configurable:!0}),k=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=a(`Primitive.${t}`),r=s.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,E.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function A(e,t){e&&T.flushSync(()=>e.dispatchEvent(t))}O(A,`dispatchDiscreteCustomEvent`);var j=Object.defineProperty,M=(e,t)=>j(e,`name`,{value:t,configurable:!0}),N=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),P=s.forwardRef(M(function(e,t){return(0,E.jsx)(k.span,{...e,ref:t,style:{...N,...e.style}})},`VisuallyHidden`)),ee=Object.defineProperty,F=(e,t)=>ee(e,`name`,{value:t,configurable:!0});function I(e,t){let n=s.createContext(t);n.displayName=e+`Context`;let r=F(e=>{let{children:t,...r}=e,i=s.useMemo(()=>r,Object.values(r));return(0,E.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=s.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return F(i,`useContext`),[r,i]}F(I,`createContext`);function L(e,t=[]){let n=[];function r(t,r){let i=s.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=F(t=>{let{scope:n,children:r,...o}=t,c=n?.[e]?.[a]||i,l=s.useMemo(()=>o,Object.values(o));return(0,E.jsx)(c.Provider,{value:l,children:r})},`Provider`);o.displayName=t+`Provider`;function c(n,o,c={}){let{optional:l=!1}=c,u=o?.[e]?.[a]||i,d=s.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return F(c,`useContext`),[o,c]}F(r,`createContext`);let i=F(()=>{let t=n.map(e=>s.createContext(e));return F(function(n){let r=n?.[e]||t;return s.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,te(i,...t)]}F(L,`createContextScope`);function te(...e){let t=e[0];if(e.length===1)return t;let n=F(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return F(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}F(te,`composeContextScopes`);var ne=Object.defineProperty,R=(e,t)=>ne(e,`name`,{value:t,configurable:!0});function re(e){let t=e+`CollectionProvider`,[n,r]=L(t),[i,c]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=R(e=>{let{scope:t,children:n}=e,r=s.useRef(null),a=s.useRef(new Map).current;return(0,E.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);l.displayName=t;let u=e+`CollectionSlot`,d=a(u),f=s.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=c(u,n),a=o(t,i.collectionRef);return(0,E.jsx)(d,{ref:a,children:r})});f.displayName=u;let p=e+`CollectionItemSlot`,m=`data-radix-collection-item`,h=a(p),g=s.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,a=s.useRef(null),l=o(t,a),u=c(p,n);return s.useEffect(()=>(u.itemMap.set(a,{ref:a,...i}),()=>void u.itemMap.delete(a))),(0,E.jsx)(h,{[m]:``,ref:l,children:r})});g.displayName=p;function _(t){let n=c(e+`CollectionConsumer`,t);return s.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${m}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return R(_,`useCollection`),[{Provider:l,Slot:f,ItemSlot:g},_,r]}R(re,`createCollection`);var ie=new WeakMap,ae=class e extends Map{static{R(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],ie.set(this,!0)}set(e,t){return ie.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=ce(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=oe(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=oe(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return oe(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function oe(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=se(e,t);return n===-1?void 0:e[n]}R(oe,`at`);function se(e,t){let n=e.length,r=ce(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}R(se,`toSafeIndex`);function ce(e){return e!==e||e===0?0:Math.trunc(e)}R(ce,`toSafeInteger`);function le(e){let t=e+`CollectionProvider`,[n,r]=L(t),[i,c]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new ae,setItemMap:R(()=>void 0,`setItemMap`)}),l=R(({state:e,...t})=>e?(0,E.jsx)(d,{...t,state:e}):(0,E.jsx)(u,{...t}),`CollectionProvider`);l.displayName=t;let u=R(e=>{let t=v();return(0,E.jsx)(d,{...e,state:t})},`CollectionInit`);u.displayName=t+`Init`;let d=R(e=>{let{scope:t,children:n,state:r}=e,a=s.useRef(null),[c,l]=s.useState(null),u=o(a,l),[d,f]=r;return s.useEffect(()=>{if(!c)return;let e=pe(()=>{});return e.observe(c,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[c]),(0,E.jsx)(i,{scope:t,itemMap:d,setItemMap:f,collectionRef:u,collectionRefObject:a,collectionElement:c,children:n})},`CollectionProviderImpl`);d.displayName=t+`Impl`;let f=e+`CollectionSlot`,p=a(f),m=s.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=c(f,n),a=o(t,i.collectionRef);return(0,E.jsx)(p,{ref:a,children:r})});m.displayName=f;let h=e+`CollectionItemSlot`,g=a(h),_=s.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,a=s.useRef(null),[l,u]=s.useState(null),d=o(t,a,u),{setItemMap:f}=c(h,n),p=s.useRef(i);ue(p.current,i)||(p.current=i);let m=p.current;return s.useEffect(()=>{let e=m;return f(t=>l?t.has(l)?t.set(l,{...e,element:l}).toSorted(fe):(t.set(l,{...e,element:l}),t.toSorted(fe)):t),()=>{f(e=>!l||!e.has(l)?e:(e.delete(l),new ae(e)))}},[l,m,f]),(0,E.jsx)(g,{"data-radix-collection-item":``,ref:d,children:r})});_.displayName=h;function v(){return s.useState(new ae)}R(v,`useInitCollection`);function y(t){let{itemMap:n}=c(e+`CollectionConsumer`,t);return n}return R(y,`useCollection`),[{Provider:l,Slot:m,ItemSlot:_},{createCollectionScope:r,useCollection:y,useInitCollection:v}]}R(le,`createCollection`);function ue(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}R(ue,`shallowEqual`);function de(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}R(de,`isElementPreceding`);function fe(e,t){return!e[1].element||!t[1].element?0:de(e[1].element,t[1].element)?-1:1}R(fe,`sortByDocumentPosition`);function pe(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}R(pe,`getChildListObserver`);var me=Object.defineProperty,he=(e,t)=>me(e,`name`,{value:t,configurable:!0}),ge=!!(typeof window<`u`&&window.document&&window.document.createElement);function z(e,t,{checkForDefaultPrevented:n=!0}={}){return he(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}he(z,`composeEventHandlers`);function _e(e){if(!ge)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}he(_e,`getOwnerWindow`);function ve(e){if(!ge)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}he(ve,`getOwnerDocument`);function ye(e,t=!1){let{activeElement:n}=ve(e);if(!n?.nodeName)return null;if(be(n)&&n.contentDocument)return ye(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=ve(n).getElementById(e);if(t)return t}}return n}he(ye,`getActiveElement`);function be(e){return e.tagName===`IFRAME`}he(be,`isFrame`);var B=globalThis?.document?s.useLayoutEffect:()=>{},xe=Object.defineProperty,Se=(e,t)=>xe(e,`name`,{value:t,configurable:!0}),Ce=s.useEffectEvent,we=s.useInsertionEffect;function Te(e){if(typeof Ce==`function`)return Ce(e);let t=s.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof we==`function`?we(()=>{t.current=e}):B(()=>{t.current=e}),s.useMemo(()=>((...e)=>t.current?.(...e)),[])}Se(Te,`useEffectEvent`);var Ee=Object.defineProperty,De=(e,t)=>Ee(e,`name`,{value:t,configurable:!0}),Oe=s.useInsertionEffect||B;function ke({prop:e,defaultProp:t,onChange:n=De(()=>{},`onChange`),caller:r}){let[i,a,o]=Ae({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,s.useCallback(t=>{if(c){let n=je(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[c,e,a,o])]}De(ke,`useControllableState`);function Ae({defaultProp:e,onChange:t}){let[n,r]=s.useState(e),i=s.useRef(n),a=s.useRef(t);return Oe(()=>{a.current=t},[t]),s.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}De(Ae,`useUncontrolledState`);function je(e){return typeof e==`function`}De(je,`isFunction`);var Me=Symbol(`RADIX:SYNC_STATE`);function Ne(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:c}=t,l=i!==void 0,u=Te(o),d=[{...n,state:a}];r&&d.push(r);let[f,p]=s.useReducer((t,n)=>{if(n.type===Me)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=s.useRef(m);s.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=s.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return s.useEffect(()=>{l&&!Object.is(i,f.state)&&p({type:Me,state:i})},[i,f.state,l]),[g,p]}De(Ne,`useControllableStateReducer`);var Pe=Object.defineProperty,Fe=(e,t)=>Pe(e,`name`,{value:t,configurable:!0});function Ie(e,t){return s.useReducer((e,n)=>t[e][n]??e,e)}Fe(Ie,`useStateMachine`);var Le=Fe(e=>{let{present:t,children:n}=e,r=Re(t),i=typeof n==`function`?n({present:r.isPresent}):s.Children.only(n),a=Be(r.ref,He(i));return typeof n==`function`||r.isPresent?s.cloneElement(i,{ref:a}):null},`Presence`);function Re(e){let[t,n]=s.useState(),r=s.useRef(null),i=s.useRef(e),a=s.useRef(`none`),o=s.useRef(void 0),[c,l]=Ie(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return s.useEffect(()=>{c===`mounted`?(a.current=o.current??Ve(r.current),o.current=void 0):a.current=`none`},[c]),B(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Ve(t);e?(o.current=s,l(`MOUNT`)):s===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),B(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Fe(a=>{let o=Ve(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Fe(e=>{e.target===t&&(a.current=Ve(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:s.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Ve(t)}else r.current=null;n(e)},[])}}Fe(Re,`usePresence`);function ze(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Fe(ze,`setRef`);function Be(...e){let t=s.useRef(e);return t.current=e,s.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=ze(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():ze(n[e],null)}}},[])}Fe(Be,`useStableComposedRefs`);function Ve(e){return e?.animationName||`none`}Fe(Ve,`getAnimationName`);function He(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Fe(He,`getElementRef`);var Ue=Object.defineProperty,We=(e,t)=>Ue(e,`name`,{value:t,configurable:!0}),Ge=s.useId||(()=>void 0),Ke=0;function qe(e){let[t,n]=s.useState(Ge());return B(()=>{e||n(e=>e??String(Ke++))},[e]),e||(t?`radix-${t}`:``)}We(qe,`useId`);var Je=Object.defineProperty,Ye=(e,t)=>Je(e,`name`,{value:t,configurable:!0}),Xe=s.createContext(void 0);function Ze(e){let t=s.useContext(Xe);return e||t||`ltr`}Ye(Ze,`useDirection`);var Qe=Object.defineProperty,$e=(e,t)=>Qe(e,`name`,{value:t,configurable:!0});function V(e){let t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>((...e)=>t.current?.(...e)),[])}$e(V,`useCallbackRef`);var et=Object.defineProperty,H=(e,t)=>et(e,`name`,{value:t,configurable:!0}),tt=`dismissableLayer.update`,nt=`dismissableLayer.pointerDownOutside`,rt=`dismissableLayer.focusOutside`,it,at=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ot=s.forwardRef(H(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:l,onDismiss:u,...d}=e,f=s.useContext(at),[p,m]=s.useState(null),h=p?.ownerDocument??globalThis?.document,[,g]=s.useState({}),_=o(t,m),v=Array.from(f.layers),[y]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),b=y?v.indexOf(y):-1,x=p?v.indexOf(p):-1,S=f.layersWithOutsidePointerEventsDisabled.size>0,C=x>=b,w=s.useRef(!1),T=lt(e=>{a?.(e),l?.(e),e.defaultPrevented||u?.()},{ownerDocument:h,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:w,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:s.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...f.branches].some(t=>t.contains(e));return C&&!t},[f.branches,C])}),D=ut(e=>{if(r&&w.current)return;let t=e.target;[...f.branches].some(e=>e.contains(t))||(c?.(e),l?.(e),e.defaultPrevented||u?.())},h),O=p?x===v.length-1:!1,A=V(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&u&&(e.preventDefault(),u()))});return s.useEffect(()=>{if(O)return h.addEventListener(`keydown`,A,{capture:!0}),()=>h.removeEventListener(`keydown`,A,{capture:!0})},[h,O,A]),s.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(it=h.body.style.pointerEvents,h.body.style.pointerEvents=`none`),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),dt(),()=>{n&&(f.layersWithOutsidePointerEventsDisabled.delete(p),f.layersWithOutsidePointerEventsDisabled.size===0&&(h.body.style.pointerEvents=it))}},[p,h,n,f]),s.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),dt())},[p,f]),s.useEffect(()=>{let e=H(()=>g({}),`handleUpdate`);return document.addEventListener(tt,e),()=>document.removeEventListener(tt,e)},[]),(0,E.jsx)(k.div,{...d,ref:_,style:{pointerEvents:S?C?`auto`:`none`:void 0,...e.style},onFocusCapture:z(e.onFocusCapture,D.onFocusCapture),onBlurCapture:z(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:z(e.onPointerDownCapture,T.onPointerDownCapture)})},`DismissableLayer`));function st(){let e=s.useContext(at),[t,n]=s.useState(null);return s.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}H(st,`useDismissableLayerSurface`);var ct=H(()=>!0,`IS_TRUE`);function lt(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=ct}=t,c=V(e),l=s.useRef(!1),u=s.useRef(!1),d=s.useRef(new Map),f=s.useRef(()=>{});return s.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}H(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}H(t,`isOutsideInteractionIntercepted`);function s(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}H(s,`handleInteractionCapture`);function p(e){u.current&&d.current.set(e.type,!1)}H(p,`handleInteractionBubble`);let m=H(a=>{if(a.target&&!l.current){let s=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||ft(nt,c,p,{discrete:!0})};if(H(s,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?s():(n.removeEventListener(`click`,f.current),f.current=s,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,s,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,s,!0),n.removeEventListener(e,p)}},[n,c,r,i,a,o]),{onPointerDownCapture:H(()=>l.current=!0,`onPointerDownCapture`)}}H(lt,`usePointerDownOutside`);function ut(e,t=globalThis?.document){let n=V(e),r=s.useRef(!1);return s.useEffect(()=>{let e=H(e=>{e.target&&!r.current&&ft(rt,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:H(()=>r.current=!0,`onFocusCapture`),onBlurCapture:H(()=>r.current=!1,`onBlurCapture`)}}H(ut,`useFocusOutside`);function dt(){let e=new CustomEvent(tt);document.dispatchEvent(e)}H(dt,`dispatchUpdate`);function ft(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?A(i,a):i.dispatchEvent(a)}H(ft,`handleAndDispatchCustomEvent`);var pt=Object.defineProperty,U=(e,t)=>pt(e,`name`,{value:t,configurable:!0}),mt=`focusScope.autoFocusOnMount`,ht=`focusScope.autoFocusOnUnmount`,gt={bubbles:!1,cancelable:!0},_t=s.forwardRef(U(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...c}=e,[l,u]=s.useState(null),d=V(i),f=V(a),p=s.useRef(null),m=o(t,u),h=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(r){let e=function(e){if(h.paused||!l)return;let t=e.target;l.contains(t)?p.current=t:wt(p.current,{select:!0})},t=function(e){if(h.paused||!l)return;let t=e.relatedTarget;t!==null&&(l.contains(t)||wt(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&wt(l)};U(e,`handleFocusIn`),U(t,`handleFocusOut`),U(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,l,h.paused]),s.useEffect(()=>{if(l){Tt.add(h);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(mt,gt);l.addEventListener(mt,d),l.dispatchEvent(t),t.defaultPrevented||(vt(Ot(bt(l)),{select:!0}),document.activeElement===e&&wt(l))}return()=>{l.removeEventListener(mt,d),setTimeout(()=>{let t=new CustomEvent(ht,gt);l.addEventListener(ht,f),l.dispatchEvent(t),t.defaultPrevented||wt(e??document.body,{select:!0}),l.removeEventListener(ht,f),Tt.remove(h)},0)}}},[l,d,f,h]);let g=s.useCallback(e=>{if(!n&&!r||h.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=yt(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&wt(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&wt(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,h.paused]);return(0,E.jsx)(k.div,{tabIndex:-1,...c,ref:m,onKeyDown:g})},`FocusScope`));function vt(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(wt(r,{select:t}),document.activeElement!==n)return}U(vt,`focusFirst`);function yt(e){let t=bt(e);return[xt(t,e),xt(t.reverse(),e)]}U(yt,`getTabbableEdges`);function bt(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:U(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}U(bt,`getTabbableCandidates`);function xt(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):St(r,{upTo:t})))return r}U(xt,`findVisible`);function St(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}U(St,`isHidden`);function Ct(e){return e instanceof HTMLInputElement&&`select`in e}U(Ct,`isSelectableInput`);function wt(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ct(e)&&t&&e.select()}}U(wt,`focus`);var Tt=Et();function Et(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Dt(e,t),e.unshift(t)},remove(t){e=Dt(e,t),e[0]?.resume()}}}U(Et,`createFocusScopesStack`);function Dt(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}U(Dt,`arrayRemove`);function Ot(e){return e.filter(e=>e.tagName!==`A`)}U(Ot,`removeLinks`);var kt=Object.defineProperty,At=s.forwardRef(((e,t)=>kt(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=s.useState(!1);B(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?T.createPortal((0,E.jsx)(k.div,{...r,ref:t}),o):null},`Portal`)),jt=Object.defineProperty,Mt=(e,t)=>jt(e,`name`,{value:t,configurable:!0}),Nt=0,Pt=null;function Ft(e){return It(),e.children}Mt(Ft,`FocusGuards`);function It(){s.useEffect(()=>{Pt||={start:Lt(),end:Lt()};let{start:e,end:t}=Pt;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Nt++,()=>{Nt===1&&(Pt?.start.remove(),Pt?.end.remove(),Pt=null),Nt=Math.max(0,Nt-1)}},[])}Mt(It,`useFocusGuards`);function Lt(){let 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}Mt(Lt,`createFocusGuard`);var W=function(){return W=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},W.apply(this,arguments)};function Rt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function zt(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function Bt(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function Vt(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function Ht(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Ut=`right-scroll-bar-position`,Wt=`width-before-scroll-bar`,Gt=`with-scroll-bars-hidden`,Kt=`--removed-body-scroll-bar-size`;function qt(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Jt(e,t){var n=(0,s.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Yt=typeof window<`u`?s.useLayoutEffect:s.useEffect,Xt=new WeakMap;function Zt(e,t){var n=Jt(t||null,function(t){return e.forEach(function(e){return qt(e,t)})});return Yt(function(){var t=Xt.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||qt(e,null)}),i.forEach(function(e){r.has(e)||qt(e,a)})}Xt.set(n,e)},[e]),n}function Qt(e){return e}function $t(e,t){t===void 0&&(t=Qt);var n=[],r=!1;return{read:function(){if(r)throw 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 i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},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 i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function en(e){e===void 0&&(e={});var t=$t(null);return t.options=W({async:!0,ssr:!1},e),t}var tn=function(e){var t=e.sideCar,n=Rt(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return s.createElement(r,W({},n))};tn.isSideCarExport=!0;function nn(e,t){return e.useMedium(t),tn}var rn=en(),an=function(){},on=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:an,onWheelCapture:an,onTouchMoveCapture:an}),i=r[0],a=r[1],o=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Rt(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Zt([n,t]),w=W(W({},x),i);return s.createElement(s.Fragment,null,d&&s.createElement(S,{sideCar:rn,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?s.cloneElement(s.Children.only(c),W(W({},w),{ref:C})):s.createElement(y,W({},w,{className:l,ref:C}),c))});on.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},on.classNames={fullWidth:Wt,zeroRight:Ut};var sn,cn=function(){if(sn)return sn;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ln(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=cn();return t&&e.setAttribute(`nonce`,t),e}function un(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function dn(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var fn=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ln())&&(un(t,n),dn(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},pn=function(){var e=fn();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},mn=function(){var e=pn();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},hn={left:0,top:0,right:0,gap:0},gn=function(e){return parseInt(e||``,10)||0},_n=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[gn(n),gn(r),gn(i)]},vn=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return hn;var t=_n(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])}},yn=mn(),bn=`data-scroll-locked`,xn=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
  .${Gt} {
   overflow: hidden ${r};
   padding-right: ${s}px ${r};
  }
  body[${bn}] {
    overflow: hidden ${r};
    overscroll-behavior: contain;
    ${[t&&`position: relative ${r};`,n===`margin`&&`
    padding-left: ${i}px;
    padding-top: ${a}px;
    padding-right: ${o}px;
    margin-left:0;
    margin-top:0;
    margin-right: ${s}px ${r};
    `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
  }
  
  .${Ut} {
    right: ${s}px ${r};
  }
  
  .${Wt} {
    margin-right: ${s}px ${r};
  }
  
  .${Ut} .${Ut} {
    right: 0 ${r};
  }
  
  .${Wt} .${Wt} {
    margin-right: 0 ${r};
  }
  
  body[${bn}] {
    ${Kt}: ${s}px;
  }
`},Sn=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Cn=function(){s.useEffect(function(){return document.body.setAttribute(bn,(Sn()+1).toString()),function(){var e=Sn()-1;e<=0?document.body.removeAttribute(bn):document.body.setAttribute(bn,e.toString())}},[])},wn=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Cn();var a=s.useMemo(function(){return vn(i)},[i]);return s.createElement(yn,{styles:xn(a,!t,i,n?``:`!important`)})},Tn=!1;if(typeof window<`u`)try{var En=Object.defineProperty({},"passive",{get:function(){return Tn=!0,!0}});window.addEventListener(`test`,En,En),window.removeEventListener(`test`,En,En)}catch{Tn=!1}var Dn=Tn?{passive:!1}:!1,On=function(e){return e.tagName===`TEXTAREA`},kn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!On(e)&&n[t]===`visible`)},An=function(e){return kn(e,`overflowY`)},jn=function(e){return kn(e,`overflowX`)},Mn=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Fn(e,r)){var i=In(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Nn=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Pn=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Fn=function(e,t){return e===`v`?An(t):jn(t)},In=function(e,t){return e===`v`?Nn(t):Pn(t)},Ln=function(e,t){return e===`h`&&t===`rtl`?-1:1},Rn=function(e,t,n,r,i){var a=Ln(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=In(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Fn(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},zn=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Bn=function(e){return[e.deltaX,e.deltaY]},Vn=function(e){return e&&`current`in e?e.current:e},Hn=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Un=function(e){return`
  .block-interactivity-${e} {pointer-events: none;}
  .allow-interactivity-${e} {pointer-events: all;}
`},Wn=0,Gn=[];function Kn(e){var t=s.useRef([]),n=s.useRef([0,0]),r=s.useRef(),i=s.useState(Wn++)[0],a=s.useState(mn)[0],o=s.useRef(e);s.useEffect(function(){o.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Ht([e.lockRef.current],(e.shards||[]).map(Vn),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var c=s.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=zn(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Mn(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Mn(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Rn(h,t,e,h===`h`?s:c,!0)},[]),l=s.useCallback(function(e){var n=e;if(!(!Gn.length||Gn[Gn.length-1]!==a)){var r=`deltaY`in n?Bn(n):zn(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Hn(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var s=(o.current.shards||[]).map(Vn).filter(Boolean).filter(function(e){return e.contains(n.target)});(s.length>0?c(n,s[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=s.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:qn(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=s.useCallback(function(e){n.current=zn(e),r.current=void 0},[]),f=s.useCallback(function(t){u(t.type,Bn(t),t.target,c(t,e.lockRef.current))},[]),p=s.useCallback(function(t){u(t.type,zn(t),t.target,c(t,e.lockRef.current))},[]);s.useEffect(function(){return Gn.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,Dn),document.addEventListener(`touchmove`,l,Dn),document.addEventListener(`touchstart`,d,Dn),function(){Gn=Gn.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,l,Dn),document.removeEventListener(`touchmove`,l,Dn),document.removeEventListener(`touchstart`,d,Dn)}},[]);var m=e.removeScrollBar,h=e.inert;return s.createElement(s.Fragment,null,h?s.createElement(a,{styles:Un(i)}):null,m?s.createElement(wn,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function qn(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Jn=nn(rn,Kn),Yn=s.forwardRef(function(e,t){return s.createElement(on,W({},e,{ref:t,sideCar:Jn}))});Yn.classNames=on.classNames;var Xn=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Zn=new WeakMap,Qn=new WeakMap,$n={},er=0,tr=function(e){return e&&(e.host||tr(e.parentNode))},nr=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=tr(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},rr=function(e,t,n,r){var i=nr(t,Array.isArray(e)?e:[e]);$n[n]||($n[n]=new WeakMap);var a=$n[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Zn.get(e)||0)+1,l=(a.get(e)||0)+1;Zn.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Qn.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),er++,function(){o.forEach(function(e){var t=Zn.get(e)-1,i=a.get(e)-1;Zn.set(e,t),a.set(e,i),t||(Qn.has(e)||e.removeAttribute(r),Qn.delete(e)),i||e.removeAttribute(n)}),er--,er||(Zn=new WeakMap,Zn=new WeakMap,Qn=new WeakMap,$n={})}},ir=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Xn(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),rr(r,i,n,`aria-hidden`)):function(){return null}},ar=Object.defineProperty,G=(e,t)=>ar(e,`name`,{value:t,configurable:!0}),or=`Dialog`,[sr,cr]=L(or),[lr,K]=sr(or),ur=G(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,c=s.useRef(null),l=s.useRef(null),[u,d]=ke({prop:r,defaultProp:i??!1,onChange:a,caller:or}),[f,p]=s.useState(0),[m,h]=s.useState(0);return(0,E.jsx)(lr,{scope:t,triggerRef:c,contentRef:l,contentId:qe(),titleId:qe(),descriptionId:qe(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:p,setDescriptionCount:h,open:u,onOpenChange:d,onOpenToggle:s.useCallback(()=>d(e=>!e),[d]),modal:o,children:n})},`Dialog`),dr=`DialogTrigger`,fr=s.forwardRef(G(function(e,t){let{__scopeDialog:n,...r}=e,i=K(dr,n),a=o(t,i.triggerRef);return(0,E.jsx)(k.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Mr(i.open),...r,ref:a,onClick:z(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),pr=`DialogPortal`,[mr,hr]=sr(pr,{forceMount:void 0}),gr=G(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=K(pr,t);return(0,E.jsx)(mr,{scope:t,forceMount:n,children:s.Children.map(r,e=>(0,E.jsx)(Le,{present:n||a.open,children:(0,E.jsx)(At,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),_r=`DialogOverlay`,vr=s.forwardRef(G(function(e,t){let n=hr(_r,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=K(_r,e.__scopeDialog);return a.modal?(0,E.jsx)(Le,{present:r||a.open,children:(0,E.jsx)(br,{...i,ref:t})}):null},`DialogOverlay`)),yr=a(`DialogOverlay.RemoveScroll`),br=s.forwardRef(G(function(e,t){let{__scopeDialog:n,...r}=e,i=K(_r,n),a=st(),s=o(t,a);return(0,E.jsx)(Yn,{as:yr,allowPinchZoom:!0,shards:[i.contentRef],children:(0,E.jsx)(k.div,{"data-state":Mr(i.open),...r,ref:s,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),xr=`DialogContent`,Sr=s.forwardRef(G(function(e,t){let n=hr(xr,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=K(xr,e.__scopeDialog);return(0,E.jsx)(Le,{present:r||a.open,children:a.modal?(0,E.jsx)(Cr,{...i,ref:t}):(0,E.jsx)(wr,{...i,ref:t})})},`DialogContent`)),Cr=s.forwardRef(G(function(e,t){let n=K(xr,e.__scopeDialog),r=s.useRef(null),i=o(t,n.contentRef,r);return s.useEffect(()=>{let e=r.current;if(e)return ir(e)},[]),(0,E.jsx)(Tr,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:z(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:z(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:z(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),wr=s.forwardRef(G(function(e,t){let n=K(xr,e.__scopeDialog),r=s.useRef(!1),i=s.useRef(!1);return(0,E.jsx)(Tr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Tr=s.forwardRef(G(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=K(xr,n);return It(),(0,E.jsx)(E.Fragment,{children:(0,E.jsx)(_t,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,E.jsx)(ot,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Mr(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),Er=`DialogTitle`,Dr=s.forwardRef(G(function(e,t){let{__scopeDialog:n,...r}=e,i=K(Er,n),{setTitleCount:a}=i;return B(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,E.jsx)(k.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Or=`DialogDescription`,kr=s.forwardRef(G(function(e,t){let{__scopeDialog:n,...r}=e,i=K(Or,n),{setDescriptionCount:a}=i;return B(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,E.jsx)(k.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Ar=`DialogClose`,jr=s.forwardRef(G(function(e,t){let{__scopeDialog:n,...r}=e,i=K(Ar,n);return(0,E.jsx)(k.button,{type:`button`,...r,ref:t,onClick:z(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Mr(e){return e?`open`:`closed`}G(Mr,`getState`);var Nr=Object.defineProperty,Pr=(e,t)=>Nr(e,`name`,{value:t,configurable:!0});function Fr(e){let[t,n]=s.useState(void 0);return B(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}Pr(Fr,`useSize`);var Ir=[`top`,`right`,`bottom`,`left`],q=Math.min,J=Math.max,Lr=Math.round,Rr=Math.floor,zr=e=>({x:e,y:e}),Br={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Vr(e,t,n){return J(e,q(t,n))}function Y(e,t){return typeof e==`function`?e(t):e}function Hr(e){return e.split(`-`)[0]}function Ur(e){return e.split(`-`)[1]}function Wr(e){return e===`x`?`y`:`x`}function Gr(e){return e===`y`?`height`:`width`}function X(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Kr(e){return Wr(X(e))}function qr(e,t,n){n===void 0&&(n=!1);let r=Ur(e),i=Kr(e),a=Gr(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ni(o)),[o,ni(o)]}function Jr(e){let t=ni(e);return[Yr(e),t,Yr(t)]}function Yr(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Xr=[`left`,`right`],Zr=[`right`,`left`],Qr=[`top`,`bottom`],$r=[`bottom`,`top`];function ei(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Zr:Xr:t?Xr:Zr;case`left`:case`right`:return t?Qr:$r;default:return[]}}function ti(e,t,n,r){let i=Ur(e),a=ei(Hr(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Yr)))),a}function ni(e){let t=Hr(e);return Br[t]+e.slice(t.length)}function ri(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ii(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ri(e)}function ai(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function oi(e,t,n){let{reference:r,floating:i}=e,a=X(t),o=Kr(t),s=Gr(o),c=Hr(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.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-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Ur(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function si(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Y(t,e),p=ii(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ai(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ai(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ci=50,li=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:si},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=oi(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ci&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=oi(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ui=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Y(e,t)||{};if(l==null)return{};let d=ii(u),f={x:n,y:r},p=Kr(i),m=Gr(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=q(d[_],T),D=q(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Vr(E,k,O),j=!c.arrow&&Ur(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),di=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Y(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Hr(r),_=X(o),v=Hr(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ni(o)]:Jr(o)),x=p!==`none`;!d&&x&&b.push(...ti(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=qr(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===X(t)||T.every(e=>X(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=X(e.placement);return t===_||t===`y`}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]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function fi(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function pi(e){return Ir.some(t=>e[t]>=0)}var mi=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Y(e,t);switch(i){case`referenceHidden`:{let e=fi(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:pi(e)}}}case`escaped`:{let e=fi(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:pi(e)}}}default:return{}}}}};function hi(e){let t=q(...e.map(e=>e.left)),n=q(...e.map(e=>e.top)),r=J(...e.map(e=>e.right)),i=J(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function gi(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>ai(hi(e)))}var _i=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=Y(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]);if(!u.length)return{};let d=gi(u),f=ai(hi(u)),p=ii(s);function m(){if(d.length===2&&(d[0].left>d[1].right||d[1].left>d[0].right)&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if(X(n)===`y`){let e=d[0],t=d[d.length-1],r=Hr(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left;return ai({x:o,y:i,width:(r?e.right:t.right)-o,height:a-i})}let e=Hr(n)===`left`,t=J(...d.map(e=>e.right)),r=q(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom;return ai({x:r,y:a,width:t-r,height:o-a})}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},vi=new Set([`left`,`top`]);async function yi(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Hr(n),s=Ur(n),c=X(n)===`y`,l=vi.has(o)?-1:1,u=a&&c?-1:1,d=Y(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var bi=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await yi(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},xi=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Y(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=X(i),p=Wr(f),m=u[p],h=u[f],g=(e,t)=>Vr(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Si=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Y(e,t),u={x:n,y:r},d=X(i),f=Wr(d),p=u[f],m=u[d],h=Y(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=vi.has(Hr(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Ci=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Y(e,t),c=await i.detectOverflow(t,s),l=Hr(n),u=Ur(n),d=X(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=q(p-c[m],g),y=q(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*J(c.left,c.right):S=p-2*J(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function wi(){return typeof window<`u`}function Ti(e){return Di(e)?(e.nodeName||``).toLowerCase():`#document`}function Z(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ei(e){return((Di(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Di(e){return wi()?e instanceof Node||e instanceof Z(e).Node:!1}function Oi(e){return wi()?e instanceof Element||e instanceof Z(e).Element:!1}function ki(e){return wi()?e instanceof HTMLElement||e instanceof Z(e).HTMLElement:!1}function Ai(e){return!wi()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Z(e).ShadowRoot}function ji(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Hi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Mi(e){return/^(table|td|th)$/.test(Ti(e))}function Ni(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Pi=/transform|translate|scale|rotate|perspective|filter/,Fi=/paint|layout|strict|content/,Ii=e=>!!e&&e!==`none`,Li;function Ri(e){let t=Oi(e)?Hi(e):e;return Ii(t.transform)||Ii(t.translate)||Ii(t.scale)||Ii(t.rotate)||Ii(t.perspective)||!Bi()&&(Ii(t.backdropFilter)||Ii(t.filter))||Pi.test(t.willChange||``)||Fi.test(t.contain||``)}function zi(e){let t=Wi(e);for(;ki(t)&&!Vi(t);){if(Ri(t))return t;if(Ni(t))return null;t=Wi(t)}return null}function Bi(){return Li??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Li}function Vi(e){return/^(html|body|#document)$/.test(Ti(e))}function Hi(e){return Z(e).getComputedStyle(e)}function Ui(e){return Oi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Wi(e){if(Ti(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ai(e)&&e.host||Ei(e);return Ai(t)?t.host:t}function Gi(e){let t=Wi(e);return Vi(t)?(e.ownerDocument||e).body:ki(t)&&ji(t)?t:Gi(t)}function Ki(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Gi(e),i=r===e.ownerDocument?.body,a=Z(r);if(i){let e=qi(a);return t.concat(a,a.visualViewport||[],ji(r)?r:[],e&&n?Ki(e):[])}return t.concat(r,Ki(r,[],n))}function qi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ji(e){let t=Hi(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ki(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Lr(n)!==a||Lr(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Yi(e){return Oi(e)?e:e.contextElement}function Xi(e){let t=Yi(e);if(!ki(t))return zr(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ji(t),o=(a?Lr(n.width):n.width)/r,s=(a?Lr(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Zi=zr(0);function Qi(e){let t=Z(e);return!Bi()||!t.visualViewport?Zi:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $i(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Z(e)}function ea(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Yi(e),o=zr(1);t&&(r?Oi(r)&&(o=Xi(r)):o=Xi(e));let s=$i(a,n,r)?Qi(a):zr(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Z(a),t=Oi(r)?Z(r):r,n=e,i=qi(n);for(;i&&t!==n;){let e=Xi(i),t=i.getBoundingClientRect(),r=Hi(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Z(i),i=qi(n)}}return ai({width:u,height:d,x:c,y:l})}function ta(e,t){let n=Ui(e).scrollLeft;return t?t.left+n:ea(Ei(e)).left+n}function na(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ta(e,n),y:n.top+t.scrollTop}}function ra(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ei(r),s=t?Ni(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=zr(1),u=zr(0),d=ki(r);if((d||!a)&&((Ti(r)!==`body`||ji(o))&&(c=Ui(r)),d)){let e=ea(r);l=Xi(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?na(o,c):zr(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ia(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function aa(e){let t=Ui(e),n=e.ownerDocument.body,r=J(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=J(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+ta(e),o=-t.scrollTop;return Hi(n).direction===`rtl`&&(a+=J(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var oa=25;function sa(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Z(e),a=Ei(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Bi()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(ta(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=oa&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ca(e,t){let n=ea(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Xi(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function la(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=sa(e,n,t);else if(t===`document`)r=aa(Ei(e));else if(Oi(t))r=ca(t,n);else{let n=Qi(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ai(r)}function ua(e,t){let n=t.get(e);if(n)return n;let r=Ki(e,[],!1).filter(e=>Oi(e)&&Ti(e)!==`body`),i=null,a=Hi(e).position===`fixed`,o=a?Wi(e):e;for(;Oi(o)&&!Vi(o);){let e=Hi(o),t=Ri(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Wi(o)}return t.set(e,r),r}function da(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ni(t)?[]:ua(t,this._c):[].concat(n),r],o=la(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=la(t,a[e],i);s=J(n.top,s),c=q(n.right,c),l=q(n.bottom,l),u=J(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function fa(e){let{width:t,height:n}=Ji(e);return{width:t,height:n}}function pa(e,t,n){let r=ki(t),i=Ei(t),a=n===`fixed`,o=ea(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=zr(0);if((r||!a)&&((Ti(t)!==`body`||ji(i))&&(s=Ui(t)),r)){let e=ea(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=ta(i));let l=i&&!r&&!a?na(i,s):zr(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function ma(e){return Hi(e).position===`static`}function ha(e,t){if(!ki(e)||Hi(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Ei(e)===n&&(n=n.ownerDocument.body),n}function ga(e,t){let n=Z(e);if(Ni(e))return n;if(!ki(e)){let t=Wi(e);for(;t&&!Vi(t);){if(Oi(t)&&!ma(t))return t;t=Wi(t)}return n}let r=ha(e,t);for(;r&&Mi(r)&&ma(r);)r=ha(r,t);return r&&Vi(r)&&ma(r)&&!Ri(r)?n:r||zi(e)||n}var _a=async function(e){let t=this.getOffsetParent||ga,n=this.getDimensions,r=await n(e.floating);return{reference:pa(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function va(e){return Hi(e).direction===`rtl`}var ya={convertOffsetParentRelativeRectToViewportRelativeRect:ra,getDocumentElement:Ei,getClippingRect:da,getOffsetParent:ga,getElementRects:_a,getClientRects:ia,getDimensions:fa,getScale:Xi,isElement:Oi,isRTL:va};function ba(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xa(e,t,n){let r=null,i,a=Ei(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Rr(d),h=Rr(a.clientWidth-(u+f)),g=Rr(a.clientHeight-(d+p)),_=Rr(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:J(0,q(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!ba(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Z(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Sa(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Yi(e),u=i||a?[...l?Ki(l):[],...t?Ki(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?xa(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?ea(e):null;c&&g();function g(){let t=ea(e);h&&!ba(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Ca=bi,wa=xi,Ta=di,Ea=Ci,Da=mi,Oa=ui,ka=_i,Aa=Si,ja=(e,t,n)=>{let r=new Map,i=n??{},a={...ya,...i.platform,_c:r};return li(e,t,{...i,platform:a})},Ma=typeof document<`u`?s.useLayoutEffect:function(){};function Na(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Na(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Na(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Pa(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Fa(e,t){let n=Pa(e);return Math.round(t*n)/n}function Ia(e){let t=s.useRef(e);return Ma(()=>{t.current=e}),t}function La(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=s.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=s.useState(r);Na(p,r)||m(r);let[h,g]=s.useState(null),[_,v]=s.useState(null),y=s.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=s.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=s.useRef(null),w=s.useRef(null),E=s.useRef(d),D=l!=null,O=Ia(l),k=Ia(i),A=Ia(u),j=s.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),ja(C.current,w.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Na(E.current,t)&&(E.current=t,T.flushSync(()=>{f(t)}))})},[p,t,n,k,A]);Ma(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let M=s.useRef(!1);Ma(()=>(M.current=!0,()=>{M.current=!1}),[]),Ma(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(O.current)return O.current(x,S,j);j()}},[x,S,j,O,D]);let N=s.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),P=s.useMemo(()=>({reference:x,floating:S}),[x,S]),ee=s.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Fa(P.floating,d.x),r=Fa(P.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Pa(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,c,P.floating,d.x,d.y]);return s.useMemo(()=>({...d,update:j,refs:N,elements:P,floatingStyles:ee}),[d,j,N,P,ee])}var Ra=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Oa({element:r.current,padding:i}).fn(n):r?Oa({element:r,padding:i}).fn(n):{}}}},za=(e,t)=>{let n=Ca(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ba=(e,t)=>{let n=wa(e);return{name:n.name,fn:n.fn,options:[e,t]}},Va=(e,t)=>({fn:Aa(e).fn,options:[e,t]}),Ha=(e,t)=>{let n=Ta(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ua=(e,t)=>{let n=Ea(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wa=(e,t)=>{let n=Da(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ga=(e,t)=>{let n=Ra(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ka=Object.defineProperty,qa=s.forwardRef(((e,t)=>Ka(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,E.jsx)(k.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,E.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),Ja=Object.defineProperty,Ya=(e,t)=>Ja(e,`name`,{value:t,configurable:!0}),Xa=`Popper`,[Za,Qa]=L(Xa),[$a,eo]=Za(Xa),to=Ya(e=>{let{__scopePopper:t,children:n}=e,[r,i]=s.useState(null),[a,o]=s.useState(void 0);return(0,E.jsx)($a,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),no=`PopperAnchor`,ro=s.forwardRef(Ya(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=eo(no,n),c=s.useRef(null),l=a.onAnchorChange,u=s.useCallback(e=>{c.current=e,e&&l(e)},[l]),d=o(t,u),f=s.useRef(null);s.useEffect(()=>{if(!r)return;let e=f.current;f.current=r.current,e!==f.current&&l(f.current)});let p=a.placementState&&mo(a.placementState),m=p?.[0],h=p?.[1];return r?null:(0,E.jsx)(k.div,{"data-radix-popper-side":m,"data-radix-popper-align":h,...i,ref:d})},`PopperAnchor`)),io=`PopperContent`,[ao,oo]=Za(io),so=s.forwardRef(Ya(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p=`partial`,hideWhenDetached:m=!1,updatePositionStrategy:h=`optimized`,onPlaced:g,..._}=e,v=eo(io,n),[y,b]=s.useState(null),x=o(t,b),[S,C]=s.useState(null),w=Fr(S),T=w?.width??0,D=w?.height??0,O=r+(a===`center`?``:`-`+a),A=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},j=Array.isArray(d)?d:[d],M=j.length>0,N={padding:A,boundary:j.filter(fo),altBoundary:M},{refs:P,floatingStyles:ee,placement:F,isPositioned:I,middlewareData:L}=La({strategy:`fixed`,placement:O,whileElementsMounted:Ya((...e)=>Sa(...e,{animationFrame:h===`always`}),`whileElementsMounted`),elements:{reference:v.anchor},middleware:[za({mainAxis:i+D,alignmentAxis:c}),u&&Ba({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?Va():void 0,...N}),u&&Ha({...N}),Ua({...N,apply:Ya(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),S&&Ga({element:S,padding:l}),po({arrowWidth:T,arrowHeight:D}),m&&Wa({strategy:`referenceHidden`,...N,boundary:M?N.boundary:void 0})]}),te=v.setPlacementState;B(()=>(te(F),()=>{te(void 0)}),[F,te]);let[ne,R]=mo(F),re=V(g);B(()=>{I&&re?.()},[I,re]);let ie=L.arrow?.x,ae=L.arrow?.y,oe=L.arrow?.centerOffset!==0,[se,ce]=s.useState();return B(()=>{y&&ce(window.getComputedStyle(y).zIndex)},[y]),(0,E.jsx)(`div`,{ref:P.setFloating,"data-radix-popper-content-wrapper":``,style:{...ee,transform:I?ee.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(` `),...L.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,E.jsx)(ao,{scope:n,placedSide:ne,placedAlign:R,onArrowChange:C,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,E.jsx)(k.div,{"data-side":ne,"data-align":R,..._,ref:x,style:{..._.style,animation:I?_.style?.animation:`none`}})})})},`PopperContent`)),co=`PopperArrow`,lo={top:`bottom`,right:`left`,bottom:`top`,left:`right`},uo=s.forwardRef(Ya(function(e,t){let{__scopePopper:n,...r}=e,i=oo(co,n),a=lo[i.placedSide];return(0,E.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:(0,E.jsx)(qa,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function fo(e){return e!==null}Ya(fo,`isNotNull`);var po=Ya(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=mo(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function mo(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Ya(mo,`getSideAndAlignFromPlacement`);var ho=to,go=ro,_o=so,vo=uo,yo=Object.defineProperty,bo=s.forwardRef(((e,t)=>yo(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,E.jsx)(k.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),xo=Object.defineProperty,So=(e,t)=>xo(e,`name`,{value:t,configurable:!0});function Co(e){let t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}So(Co,`usePrevious`);var wo=Object.defineProperty,To=(e,t)=>wo(e,`name`,{value:t,configurable:!0});function Eo(e,[t,n]){return Math.min(n,Math.max(t,e))}To(Eo,`clamp`);var Do=Object.defineProperty,Q=(e,t)=>Do(e,`name`,{value:t,configurable:!0}),Oo=[` `,`Enter`,`ArrowUp`,`ArrowDown`],ko=[` `,`Enter`],Ao=`Select`,[jo,Mo,No]=re(Ao),[Po,Fo]=L(Ao,[No,Qa]),Io=Qa(),[Lo,Ro]=Po(Ao),[zo,Bo]=Po(Ao);function Vo(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:c,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:p,required:m,form:h,internal_do_not_use_render:g}=e,_=Io(t),[v,y]=s.useState(null),[b,x]=s.useState(null),[S,C]=s.useState(!1),w=Ze(u),[T,D]=ke({prop:r,defaultProp:i??!1,onChange:a,caller:Ao}),[O,k]=ke({prop:o,defaultProp:c,onChange:l,caller:Ao}),A=s.useRef(null),j=s.useRef(O);s.useEffect(()=>{let e=h?v?.ownerDocument.getElementById(h):v?.form;if(e instanceof HTMLFormElement){let t=Q(()=>k(j.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[h,v,k]);let M=!v||!!h||!!v.closest(`form`),[N,P]=s.useState(new Set),ee=qe(),F=Array.from(N).map(e=>e.props.value).join(`;`),I=s.useCallback(e=>{P(t=>new Set(t).add(e))},[]),L=s.useCallback(e=>{P(t=>{let n=new Set(t);return n.delete(e),n})},[]),te={required:m,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:ee,value:O,onValueChange:k,open:T,onOpenChange:D,dir:w,triggerPointerDownPosRef:A,disabled:p,name:d,autoComplete:f,form:h,nativeOptions:N,nativeSelectKey:F,isFormControl:M};return(0,E.jsx)(ho,{..._,children:(0,E.jsx)(Lo,{scope:t,...te,children:(0,E.jsx)(jo.Provider,{scope:t,children:(0,E.jsx)(zo,{scope:t,onNativeOptionAdd:I,onNativeOptionRemove:L,children:Ds(g)?g(te):n})})})})}Q(Vo,`SelectProvider`);var Ho=Q(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,E.jsx)(Vo,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,E.jsxs)(E.Fragment,{children:[n,e?(0,E.jsx)(Es,{__scopeSelect:t}):null]})})},`Select`),Uo=`SelectTrigger`,Wo=s.forwardRef(Q(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Io(n),c=Ro(Uo,n),l=c.disabled||r,u=o(t,c.onTriggerChange),d=Mo(n),f=s.useRef(`touch`),[p,m,h]=ks(e=>{let t=d().filter(e=>!e.disabled),n=As(t,e,t.find(e=>e.value===c.value));n!==void 0&&c.onValueChange(n.value)}),g=Q(e=>{l||(c.onOpenChange(!0),h()),e&&(c.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,E.jsx)(go,{asChild:!0,...a,children:(0,E.jsx)(k.button,{type:`button`,role:`combobox`,"aria-controls":c.open?c.contentId:void 0,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":`none`,dir:c.dir,"data-state":c.open?`open`:`closed`,disabled:l,"data-disabled":l?``:void 0,"data-placeholder":Os(c.value)?``:void 0,...i,ref:u,onClick:z(i.onClick,e=>{e.currentTarget.focus(),f.current!==`mouse`&&g(e)}),onPointerDown:z(i.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:z(i.onKeyDown,e=>{let t=p.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&m(e.key),!(t&&e.key===` `)&&Oo.includes(e.key)&&(g(),e.preventDefault())})})})},`SelectTrigger`)),Go=`SelectValue`,Ko=s.forwardRef(Q(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:c=``,...l}=e,u=Ro(Go,n),{onValueNodeHasChildrenChange:d}=u,f=a!==void 0,p=o(t,u.onValueNodeChange);B(()=>{d(f)},[d,f]);let m=Os(u.value);return(0,E.jsx)(k.span,{...l,asChild:!m&&l.asChild,ref:p,style:{pointerEvents:`none`},children:(0,E.jsx)(s.Fragment,{children:m?c:a},m?`placeholder`:`value`)})},`SelectValue`)),qo=s.forwardRef(Q(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,E.jsx)(k.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[Jo,Yo]=Po(`SelectPortal`,{forceMount:void 0}),Xo=Q(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,E.jsx)(Jo,{scope:e.__scopeSelect,forceMount:n,children:(0,E.jsx)(At,{asChild:!0,...r})})},`SelectPortal`),Zo=`SelectContent`,Qo=s.forwardRef(Q(function(e,t){let n=Yo(Zo,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=Ro(Zo,e.__scopeSelect),[o,c]=s.useState();return B(()=>{c(new DocumentFragment)},[]),(0,E.jsx)(Le,{present:r||a.open,children:({present:e})=>e?(0,E.jsx)(rs,{...i,ref:t}):(0,E.jsx)($o,{...i,fragment:o})})},`SelectContent`)),$o=s.forwardRef(Q(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?T.createPortal((0,E.jsx)(es,{scope:n,children:(0,E.jsx)(jo.Slot,{scope:n,children:(0,E.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),$=10,[es,ts]=Po(Zo),ns=a(`SelectContent.RemoveScroll`),rs=s.forwardRef(Q(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:c,side:l,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:v,...y}=e,b=Ro(Zo,n),[x,S]=s.useState(null),[C,w]=s.useState(null),T=o(t,S),[D,O]=s.useState(null),[k,A]=s.useState(null),j=Mo(n),[M,N]=s.useState(!1),P=s.useRef(!1);s.useEffect(()=>{if(x)return ir(x)},[x]),It();let ee=s.useCallback(e=>{let[t,...n]=j().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&C&&(C.scrollTop=0),n===r&&C&&(C.scrollTop=C.scrollHeight),n?.focus(),document.activeElement!==i))return},[j,C]),F=s.useCallback(()=>ee([D,x]),[ee,D,x]);s.useEffect(()=>{M&&F()},[M,F]);let{onOpenChange:I,triggerPointerDownPosRef:L}=b;s.useEffect(()=>{if(x){let e={x:0,y:0},t=Q(t=>{e={x:Math.abs(Math.round(t.pageX)-(L.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(L.current?.y??0))}},`handlePointerMove`),n=Q(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(x)||I(!1),document.removeEventListener(`pointermove`,t),L.current=null},`handlePointerUp`);return L.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[x,I,L]),s.useEffect(()=>{let e=Q(()=>I(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[I]);let[te,ne]=ks(e=>{let t=j().filter(e=>!e.disabled),n=As(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),R=s.useCallback((e,t,n)=>{let r=!P.current&&!n;(b.value!==void 0&&b.value===t||r)&&(O(e),r&&(P.current=!0))},[b.value]),re=s.useCallback(()=>x?.focus(),[x]),ie=s.useCallback((e,t,n)=>{let r=!P.current&&!n;(b.value!==void 0&&b.value===t||r)&&A(e)},[b.value]),ae=r===`popper`?as:is,oe=ae===as?{side:l,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:v}:{};return(0,E.jsx)(es,{scope:n,content:x,viewport:C,onViewportChange:w,itemRefCallback:R,selectedItem:D,onItemLeave:re,itemTextRefCallback:ie,focusSelectedItem:F,selectedItemText:k,position:r,isPositioned:M,searchRef:te,children:(0,E.jsx)(Yn,{as:ns,allowPinchZoom:!0,children:(0,E.jsx)(_t,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:z(i,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,E.jsx)(ot,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,E.jsx)(ae,{role:`listbox`,id:b.contentId,"data-state":b.open?`open`:`closed`,dir:b.dir,onContextMenu:e=>e.preventDefault(),...y,...oe,onPlaced:()=>N(!0),ref:T,style:{display:`flex`,flexDirection:`column`,outline:`none`,...y.style},onKeyDown:z(y.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ne(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=j().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>ee(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),is=s.forwardRef(Q(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=Ro(Zo,n),c=ts(Zo,n),[l,u]=s.useState(null),[d,f]=s.useState(null),p=o(t,f),m=Mo(n),h=s.useRef(!1),g=s.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=c,x=s.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&d&&_&&v&&y){let e=a.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=y.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,c=Math.max(s,t.width),u=window.innerWidth-$,d=Eo(a,[$,Math.max($,u-c)]);l.style.minWidth=s+`px`,l.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,c=Math.max(s,t.width),u=window.innerWidth-$,d=Eo(a,[$,Math.max($,u-c)]);l.style.minWidth=s+`px`,l.style.right=d+`px`}let o=m(),s=window.innerHeight-$*2,c=_.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),b=parseInt(u.paddingBottom,10),x=f+p+c+b+g,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-$,D=s-E,O=v.offsetHeight/2,k=v.offsetTop+O,A=f+p+k,j=x-A;if(A<=E){let e=o.length>0&&v===o[o.length-1].ref.current;l.style.bottom=`0px`;let t=d.clientHeight-_.offsetTop-_.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+g);l.style.height=n+`px`}else{let e=o.length>0&&v===o[0].ref.current;l.style.top=`0px`;let t=Math.max(E,f+_.offsetTop+(e?w:0)+O)+j;l.style.height=t+`px`,_.scrollTop=A-E+_.offsetTop}l.style.margin=`${$}px 0`,l.style.minHeight=S+`px`,l.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>h.current=!0)}},[m,a.trigger,a.valueNode,l,d,_,v,y,a.dir,r]);B(()=>x(),[x]);let[S,C]=s.useState();B(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);let w=s.useCallback(e=>{e&&g.current===!0&&(x(),b?.(),g.current=!1)},[x,b]);return(0,E.jsx)(os,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:h,onScrollButtonChange:w,children:(0,E.jsx)(`div`,{ref:u,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:(0,E.jsx)(k.div,{...i,ref:p,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),as=s.forwardRef(Q(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=$,...a}=e,o=Io(n);return(0,E.jsx)(_o,{...o,...a,ref:t,align:r,collisionPadding:i,style:{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)`}})},`SelectPopperPosition`)),[os,ss]=Po(Zo,{}),cs=`SelectViewport`,ls=s.forwardRef(Q(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=ts(cs,n),c=ss(cs,n),l=o(t,a.onViewportChange),u=s.useRef(0);return(0,E.jsxs)(E.Fragment,{children:[(0,E.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:r}),(0,E.jsx)(jo.Slot,{scope:n,children:(0,E.jsx)(k.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:l,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:z(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=c;if(r?.current&&n){let e=Math.abs(u.current-t.scrollTop);if(e>0){let r=window.innerHeight-$*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}u.current=t.scrollTop})})})]})},`SelectViewport`)),[us,ds]=Po(`SelectGroup`),fs=`SelectItem`,[ps,ms]=Po(fs),hs=s.forwardRef(Q(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...c}=e,l=Ro(fs,n),u=ts(fs,n),d=l.value===r,[f,p]=s.useState(a??``),[m,h]=s.useState(!1),g=V(e=>u.itemRefCallback?.(e,r,i)),_=o(t,g),v=qe(),y=s.useRef(`touch`),b=Q(()=>{i||(l.onValueChange(r),l.onOpenChange(!1))},`handleSelect`);return(0,E.jsx)(ps,{scope:n,value:r,disabled:i,textId:v,isSelected:d,onItemTextChange:s.useCallback(e=>{p(t=>t||(e?.textContent??``).trim())},[]),children:(0,E.jsx)(jo.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:(0,E.jsx)(k.div,{role:`option`,"aria-labelledby":v,"data-highlighted":m?``:void 0,"aria-selected":d&&m,"data-state":d?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...c,ref:_,onFocus:z(c.onFocus,()=>h(!0)),onBlur:z(c.onBlur,()=>h(!1)),onClick:z(c.onClick,()=>{y.current!==`mouse`&&b()}),onPointerUp:z(c.onPointerUp,()=>{y.current===`mouse`&&b()}),onPointerDown:z(c.onPointerDown,e=>{y.current=e.pointerType}),onPointerMove:z(c.onPointerMove,e=>{y.current=e.pointerType,i?u.onItemLeave?.():y.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:z(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:z(c.onKeyDown,e=>{i||e.target!==e.currentTarget||(u.searchRef?.current===``||e.key!==` `)&&(ko.includes(e.key)&&b(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),gs=`SelectItemText`,_s=s.forwardRef(Q(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,c=Ro(gs,n),l=ts(gs,n),u=ms(gs,n),d=Bo(gs,n),[f,p]=s.useState(null),m=V(e=>l.itemTextRefCallback?.(e,u.value,u.disabled)),h=o(t,p,u.onItemTextChange,m),g=f?.textContent,_=s.useMemo(()=>(0,E.jsx)(`option`,{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=d;return B(()=>(v(_),()=>y(_)),[v,y,_]),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(k.span,{id:u.textId,...a,ref:h}),u.isSelected&&c.valueNode&&!c.valueNodeHasChildren&&!Os(c.value)?T.createPortal(a.children,c.valueNode):null]})},`SelectItemText`)),vs=`SelectItemIndicator`,ys=s.forwardRef(Q(function(e,t){let{__scopeSelect:n,...r}=e;return ms(vs,n).isSelected?(0,E.jsx)(k.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),bs=`SelectScrollUpButton`,xs=s.forwardRef(Q(function(e,t){let n=ts(bs,e.__scopeSelect),r=ss(bs,e.__scopeSelect),[i,a]=s.useState(!1),c=o(t,r.onScrollButtonChange);return B(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};Q(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,E.jsx)(ws,{...e,ref:c,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),Ss=`SelectScrollDownButton`,Cs=s.forwardRef(Q(function(e,t){let n=ts(Ss,e.__scopeSelect),r=ss(Ss,e.__scopeSelect),[i,a]=s.useState(!1),c=o(t,r.onScrollButtonChange);return B(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};Q(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,E.jsx)(ws,{...e,ref:c,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),ws=s.forwardRef(Q(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=ts(`SelectScrollButton`,n),o=s.useRef(null),c=Mo(n),l=s.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return s.useEffect(()=>()=>l(),[l]),B(()=>{c().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[c]),(0,E.jsx)(k.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:z(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:z(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:z(i.onPointerLeave,()=>{l()})})},`SelectScrollButtonImpl`)),Ts=`SelectBubbleInput`,Es=s.forwardRef(Q(function({__scopeSelect:e,...t},n){let r=Ro(Ts,e),{value:i,onValueChange:a,required:c,disabled:l,name:u,autoComplete:d,form:f}=r,{nativeOptions:p,nativeSelectKey:m}=r,h=s.useRef(null),g=o(n,h),_=i??``,v=Co(_),y=Array.from(p).some(e=>(e.props.value??``)===``);return s.useEffect(()=>{let e=h.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(v!==_&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,_),e.dispatchEvent(t)}},[v,_]),(0,E.jsxs)(k.select,{"aria-hidden":!0,required:c,tabIndex:-1,name:u,autoComplete:d,disabled:l,form:f,onChange:e=>a(e.target.value),...t,style:{...N,...t.style},ref:g,defaultValue:_,children:[Os(i)&&!y?(0,E.jsx)(`option`,{value:``}):null,Array.from(p)]},m)},`SelectBubbleInput`));function Ds(e){return typeof e==`function`}Q(Ds,`isFunction`);function Os(e){return e===``||e===void 0}Q(Os,`shouldShowPlaceholder`);function ks(e){let t=V(e),n=s.useRef(``),r=s.useRef(0),i=s.useCallback(e=>{let i=n.current+e;t(i),Q((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=s.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return s.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}Q(ks,`useTypeaheadSearch`);function As(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=js(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Q(As,`findNextItem`);function js(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Q(js,`wrapArray`);function Ms({...e}){return(0,E.jsx)(ur,{"data-slot":`dialog`,...e})}function Ns({...e}){return(0,E.jsx)(fr,{"data-slot":`dialog-trigger`,...e})}function Ps({...e}){return(0,E.jsx)(gr,{"data-slot":`dialog-portal`,...e})}function Fs({className:e,...t}){return(0,E.jsx)(vr,{"data-slot":`dialog-overlay`,className:r(`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-1001 bg-black/50`,e),...t})}function Is({className:e,children:t,showCloseButton:n=!0,...i}){return(0,E.jsxs)(Ps,{"data-slot":`dialog-portal`,children:[(0,E.jsx)(Fs,{}),(0,E.jsxs)(Sr,{"data-slot":`dialog-content`,className:r(`bg-white data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-1001 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-gray-200 p-6 shadow-lg duration-200 sm:max-w-lg dark:bg-gray-950 dark:border-gray-800`,e),...i,children:[t,n&&(0,E.jsxs)(jr,{"data-slot":`dialog-close`,className:`ring-offset-white focus:ring-gray-950 data-[state=open]:bg-gray-100 data-[state=open]:text-gray-500 absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 dark:ring-offset-gray-950 dark:focus:ring-gray-300 dark:data-[state=open]:bg-gray-800 dark:data-[state=open]:text-gray-400`,children:[(0,E.jsx)(w,{}),(0,E.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Ls({className:e,...t}){return(0,E.jsx)(`div`,{"data-slot":`dialog-header`,className:r(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function Rs({className:e,...t}){return(0,E.jsx)(`div`,{"data-slot":`dialog-footer`,className:r(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function zs({className:e,...t}){return(0,E.jsx)(Dr,{"data-slot":`dialog-title`,className:r(`text-lg leading-none font-semibold`,e),...t})}function Bs({className:e,...t}){return(0,E.jsx)(kr,{"data-slot":`dialog-description`,className:r(`text-gray-500 text-sm dark:text-gray-400`,e),...t})}function Vs({className:e,type:t,...n}){return(0,E.jsx)(`input`,{type:t,"data-slot":`input`,className:r(`file:text-gray-950 placeholder:text-gray-500 selection:bg-gray-900 selection:text-gray-50 dark:bg-gray-200/30 border-gray-200 flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:file:text-gray-50 dark:placeholder:text-gray-400 dark:selection:bg-gray-50 dark:selection:text-gray-900 dark:dark:bg-gray-800/30 dark:border-gray-800`,`focus-visible:border-gray-950 focus-visible:ring-gray-950/50 focus-visible:ring-[3px] dark:focus-visible:border-gray-300 dark:focus-visible:ring-gray-300/50`,`aria-invalid:ring-red-500/20 dark:aria-invalid:ring-red-500/40 aria-invalid:border-red-500 dark:aria-invalid:ring-red-900/20 dark:dark:aria-invalid:ring-red-900/40 dark:aria-invalid:border-red-900`,e),...n})}function Hs({className:e,...t}){return(0,E.jsx)(bo,{"data-slot":`label`,className:r(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function Us({...e}){return(0,E.jsx)(Ho,{"data-slot":`select`,...e})}function Ws({...e}){return(0,E.jsx)(Ko,{"data-slot":`select-value`,...e})}function Gs({className:e,size:t=`default`,children:n,...i}){return(0,E.jsxs)(Wo,{"data-slot":`select-trigger`,"data-size":t,className:r(`border-gray-200 data-[placeholder]:text-gray-500 [&_svg:not([class*='text-'])]:text-gray-500 focus-visible:border-gray-950 focus-visible:ring-gray-950/50 aria-invalid:ring-red-500/20 dark:aria-invalid:ring-red-500/40 aria-invalid:border-red-500 dark:bg-gray-200/30 dark:hover:bg-gray-200/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 dark:border-gray-800 dark:data-[placeholder]:text-gray-400 dark:[&_svg:not([class*='text-'])]:text-gray-400 dark:focus-visible:border-gray-300 dark:focus-visible:ring-gray-300/50 dark:aria-invalid:ring-red-900/20 dark:dark:aria-invalid:ring-red-900/40 dark:aria-invalid:border-red-900 dark:dark:bg-gray-800/30 dark:dark:hover:bg-gray-800/50`,e),...i,children:[n,(0,E.jsx)(qo,{asChild:!0,children:(0,E.jsx)(y,{className:`size-4 opacity-50`})})]})}function Ks({className:e,children:t,position:n=`popper`,container:i,...a}){return(0,E.jsx)(Xo,{container:i,children:(0,E.jsxs)(Qo,{"data-slot":`select-content`,className:r(`bg-white text-gray-950 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-1001 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-gray-200 shadow-md dark:bg-gray-950 dark:text-gray-50 dark:border-gray-800`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,...a,children:[(0,E.jsx)(Js,{}),(0,E.jsx)(ls,{className:r(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,E.jsx)(Ys,{})]})})}function qs({className:e,children:t,...n}){return(0,E.jsxs)(hs,{"data-slot":`select-item`,className:r(`focus:bg-gray-100 focus:text-gray-900 [&_svg:not([class*='text-'])]:text-gray-500 relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 dark:focus:bg-gray-800 dark:focus:text-gray-50 dark:[&_svg:not([class*='text-'])]:text-gray-400`,e),...n,children:[(0,E.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,E.jsx)(ys,{children:(0,E.jsx)(v,{className:`size-4`})})}),(0,E.jsx)(_s,{children:t})]})}function Js({className:e,...t}){return(0,E.jsx)(xs,{"data-slot":`select-scroll-up-button`,className:r(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,E.jsx)(x,{className:`size-4`})})}function Ys({className:e,...t}){return(0,E.jsx)(Cs,{"data-slot":`select-scroll-down-button`,className:r(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,E.jsx)(y,{className:`size-4`})})}export{qe as $,Ki as A,cr as B,ja as C,Ca as D,Aa as E,kr as F,Vt as G,Yn as H,vr as I,At as J,Ht as K,gr as L,ur as M,jr as N,wa as O,Sr as P,Ze as Q,Dr as R,Sa as S,ka as T,zt as U,ir as V,Bt as W,ot as X,_t as Y,V as Z,vo as _,Ws as a,L as at,Qa as b,Ms as c,A as ct,Rs as d,S as dt,Le as et,Ls as f,x as ft,go as g,_ as gt,Eo as h,v as ht,Gs as i,re as it,Fr as j,Ea as k,Is as l,w as lt,Ns as m,y as mt,Ks as n,B as nt,Hs as o,P as ot,zs as p,b as pt,It as q,qs as r,z as rt,Vs as s,k as st,Us as t,ke as tt,Bs as u,C as ut,_o as v,Ta as w,Oa as x,ho as y,fr as z};