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