react-multiselect-ui 2.0.3 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +8 -8
- package/dist/index.mjs +1466 -1383
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),$t=require("react"),_n=require("react-dom");function Fn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const c=Fn($t),Wn=Fn(_n);function J(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function ln(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ee(...e){return t=>{let n=!1;const r=e.map(o=>{const i=ln(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():ln(e[o],null)}}}}function re(...e){return c.useCallback(Ee(...e),e)}function ho(e,t){const n=c.createContext(t),r=i=>{const{children:a,...s}=i,u=c.useMemo(()=>s,Object.values(s));return b.jsx(n.Provider,{value:u,children:a})};r.displayName=e+"Provider";function o(i){const a=c.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Bt(e,t=[]){let n=[];function r(i,a){const s=c.createContext(a),u=n.length;n=[...n,a];const l=f=>{const{scope:h,children:m,...v}=f,p=h?.[e]?.[u]||s,g=c.useMemo(()=>v,Object.values(v));return b.jsx(p.Provider,{value:g,children:m})};l.displayName=i+"Provider";function d(f,h){const m=h?.[e]?.[u]||s,v=c.useContext(m);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[l,d]}const o=()=>{const i=n.map(a=>c.createContext(a));return function(s){const u=s?.[e]||i;return c.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return o.scopeName=e,[r,go(o,...t)]}function go(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((s,{useScope:u,scopeName:l})=>{const f=u(i)[`__scope${l}`];return{...s,...f}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Ht(e){const t=vo(e),n=c.forwardRef((r,o)=>{const{children:i,...a}=r,s=c.Children.toArray(i),u=s.find(yo);if(u){const l=u.props.children,d=s.map(f=>f===u?c.Children.count(l)>1?c.Children.only(null):c.isValidElement(l)?l.props.children:null:f);return b.jsx(t,{...a,ref:o,children:c.isValidElement(l)?c.cloneElement(l,void 0,d):null})}return b.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function vo(e){const t=c.forwardRef((n,r)=>{const{children:o,...i}=n;if(c.isValidElement(o)){const a=wo(o),s=xo(i,o.props);return o.type!==c.Fragment&&(s.ref=r?Ee(r,a):a),c.cloneElement(o,s)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bo=Symbol("radix.slottable");function yo(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bo}function xo(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const u=i(...s);return o(...s),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function wo(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 Co=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],G=Co.reduce((e,t)=>{const n=Ht(`Primitive.${t}`),r=c.forwardRef((o,i)=>{const{asChild:a,...s}=o,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(u,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Eo(e,t){e&&Wn.flushSync(()=>e.dispatchEvent(t))}function Le(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>t.current?.(...n),[])}function So(e,t=globalThis?.document){const n=Le(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Ro="DismissableLayer",Tt="dismissableLayer.update",Ao="dismissableLayer.pointerDownOutside",Po="dismissableLayer.focusOutside",un,$n=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Vt=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...u}=e,l=c.useContext($n),[d,f]=c.useState(null),h=d?.ownerDocument??globalThis?.document,[,m]=c.useState({}),v=re(t,S=>f(S)),p=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(g),E=d?p.indexOf(d):-1,x=l.layersWithOutsidePointerEventsDisabled.size>0,C=E>=y,A=No(S=>{const I=S.target,_=[...l.branches].some(j=>j.contains(I));!C||_||(o?.(S),a?.(S),S.defaultPrevented||s?.())},h),R=Mo(S=>{const I=S.target;[...l.branches].some(j=>j.contains(I))||(i?.(S),a?.(S),S.defaultPrevented||s?.())},h);return So(S=>{E===l.layers.size-1&&(r?.(S),!S.defaultPrevented&&s&&(S.preventDefault(),s()))},h),c.useEffect(()=>{if(d)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(un=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(d)),l.layers.add(d),dn(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=un)}},[d,h,n,l]),c.useEffect(()=>()=>{d&&(l.layers.delete(d),l.layersWithOutsidePointerEventsDisabled.delete(d),dn())},[d,l]),c.useEffect(()=>{const S=()=>m({});return document.addEventListener(Tt,S),()=>document.removeEventListener(Tt,S)},[]),b.jsx(G.div,{...u,ref:v,style:{pointerEvents:x?C?"auto":"none":void 0,...e.style},onFocusCapture:J(e.onFocusCapture,R.onFocusCapture),onBlurCapture:J(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:J(e.onPointerDownCapture,A.onPointerDownCapture)})});Vt.displayName=Ro;var Oo="DismissableLayerBranch",ko=c.forwardRef((e,t)=>{const n=c.useContext($n),r=c.useRef(null),o=re(t,r);return c.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),b.jsx(G.div,{...e,ref:o})});ko.displayName=Oo;function No(e,t=globalThis?.document){const n=Le(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let u=function(){Bn(Ao,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Mo(e,t=globalThis?.document){const n=Le(e),r=c.useRef(!1);return c.useEffect(()=>{const o=i=>{i.target&&!r.current&&Bn(Po,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function dn(){const e=new CustomEvent(Tt);document.dispatchEvent(e)}function Bn(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Eo(o,i):o.dispatchEvent(i)}var yt=0;function Hn(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??fn()),document.body.insertAdjacentElement("beforeend",e[1]??fn()),yt++,()=>{yt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),yt--}},[])}function fn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var xt="focusScope.autoFocusOnMount",wt="focusScope.autoFocusOnUnmount",pn={bubbles:!1,cancelable:!0},Do="FocusScope",Ut=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,u]=c.useState(null),l=Le(o),d=Le(i),f=c.useRef(null),h=re(t,p=>u(p)),m=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let p=function(x){if(m.paused||!s)return;const C=x.target;s.contains(C)?f.current=C:ge(f.current,{select:!0})},g=function(x){if(m.paused||!s)return;const C=x.relatedTarget;C!==null&&(s.contains(C)||ge(f.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const A of x)A.removedNodes.length>0&&ge(s)};document.addEventListener("focusin",p),document.addEventListener("focusout",g);const E=new MutationObserver(y);return s&&E.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",g),E.disconnect()}}},[r,s,m.paused]),c.useEffect(()=>{if(s){hn.add(m);const p=document.activeElement;if(!s.contains(p)){const y=new CustomEvent(xt,pn);s.addEventListener(xt,l),s.dispatchEvent(y),y.defaultPrevented||(To(_o(Vn(s)),{select:!0}),document.activeElement===p&&ge(s))}return()=>{s.removeEventListener(xt,l),setTimeout(()=>{const y=new CustomEvent(wt,pn);s.addEventListener(wt,d),s.dispatchEvent(y),y.defaultPrevented||ge(p??document.body,{select:!0}),s.removeEventListener(wt,d),hn.remove(m)},0)}}},[s,l,d,m]);const v=c.useCallback(p=>{if(!n&&!r||m.paused)return;const g=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(g&&y){const E=p.currentTarget,[x,C]=Io(E);x&&C?!p.shiftKey&&y===C?(p.preventDefault(),n&&ge(x,{select:!0})):p.shiftKey&&y===x&&(p.preventDefault(),n&&ge(C,{select:!0})):y===E&&p.preventDefault()}},[n,r,m.paused]);return b.jsx(G.div,{tabIndex:-1,...a,ref:h,onKeyDown:v})});Ut.displayName=Do;function To(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ge(r,{select:t}),document.activeElement!==n)return}function Io(e){const t=Vn(e),n=mn(t,e),r=mn(t.reverse(),e);return[n,r]}function Vn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function mn(e,t){for(const n of e)if(!jo(n,{upTo:t}))return n}function jo(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 Lo(e){return e instanceof HTMLInputElement&&"select"in e}function ge(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Lo(e)&&t&&e.select()}}var hn=zo();function zo(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=gn(e,t),e.unshift(t)},remove(t){e=gn(e,t),e[0]?.resume()}}}function gn(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function _o(e){return e.filter(t=>t.tagName!=="A")}var ve=globalThis?.document?c.useLayoutEffect:()=>{},Fo=c[" useId ".trim().toString()]||(()=>{}),Wo=0;function ae(e){const[t,n]=c.useState(Fo());return ve(()=>{n(r=>r??String(Wo++))},[e]),e||(t?`radix-${t}`:"")}const $o=["top","right","bottom","left"],be=Math.min,Q=Math.max,st=Math.round,Ze=Math.floor,ce=e=>({x:e,y:e}),Bo={left:"right",right:"left",bottom:"top",top:"bottom"};function It(e,t,n){return Q(e,be(t,n))}function de(e,t){return typeof e=="function"?e(t):e}function fe(e){return e.split("-")[0]}function Fe(e){return e.split("-")[1]}function Gt(e){return e==="x"?"y":"x"}function Kt(e){return e==="y"?"height":"width"}function se(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Xt(e){return Gt(se(e))}function Ho(e,t,n){n===void 0&&(n=!1);const r=Fe(e),o=Xt(e),i=Kt(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=at(a)),[a,at(a)]}function Vo(e){const t=at(e);return[jt(e),t,jt(t)]}function jt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const vn=["left","right"],bn=["right","left"],Uo=["top","bottom"],Go=["bottom","top"];function Ko(e,t,n){switch(e){case"top":case"bottom":return n?t?bn:vn:t?vn:bn;case"left":case"right":return t?Uo:Go;default:return[]}}function Xo(e,t,n,r){const o=Fe(e);let i=Ko(fe(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(jt)))),i}function at(e){const t=fe(e);return Bo[t]+e.slice(t.length)}function Yo(e){return{top:0,right:0,bottom:0,left:0,...e}}function Un(e){return typeof e!="number"?Yo(e):{top:e,right:e,bottom:e,left:e}}function ct(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function yn(e,t,n){let{reference:r,floating:o}=e;const i=se(t),a=Xt(t),s=Kt(a),u=fe(t),l=i==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[s]/2-o[s]/2;let m;switch(u){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(Fe(t)){case"start":m[a]-=h*(n&&l?-1:1);break;case"end":m[a]+=h*(n&&l?-1:1);break}return m}async function qo(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=de(t,e),v=Un(m),g=s[h?f==="floating"?"reference":"floating":f],y=ct(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:l,rootBoundary:d,strategy:u})),E=f==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),C=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},A=ct(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:E,offsetParent:x,strategy:u}):E);return{top:(y.top-A.top+v.top)/C.y,bottom:(A.bottom-y.bottom+v.bottom)/C.y,left:(y.left-A.left+v.left)/C.x,right:(A.right-y.right+v.right)/C.x}}const Zo=50,Qo=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=a.detectOverflow?a:{...a,detectOverflow:qo},u=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=yn(l,r,u),h=r,m=0;const v={};for(let p=0;p<i.length;p++){const g=i[p];if(!g)continue;const{name:y,fn:E}=g,{x,y:C,data:A,reset:R}=await E({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:v,rects:l,platform:s,elements:{reference:e,floating:t}});d=x??d,f=C??f,v[y]={...v[y],...A},R&&m<Zo&&(m++,typeof R=="object"&&(R.placement&&(h=R.placement),R.rects&&(l=R.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):R.rects),{x:d,y:f}=yn(l,h,u)),p=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:v}},Jo=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:u}=t,{element:l,padding:d=0}=de(e,t)||{};if(l==null)return{};const f=Un(d),h={x:n,y:r},m=Xt(o),v=Kt(m),p=await a.getDimensions(l),g=m==="y",y=g?"top":"left",E=g?"bottom":"right",x=g?"clientHeight":"clientWidth",C=i.reference[v]+i.reference[m]-h[m]-i.floating[v],A=h[m]-i.reference[m],R=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let S=R?R[x]:0;(!S||!await(a.isElement==null?void 0:a.isElement(R)))&&(S=s.floating[x]||i.floating[v]);const I=C/2-A/2,_=S/2-p[v]/2-1,j=be(f[y],_),F=be(f[E],_),O=j,B=S-p[v]-F,T=S/2-p[v]/2+I,U=It(O,T,B),W=!u.arrow&&Fe(o)!=null&&T!==U&&i.reference[v]/2-(T<O?j:F)-p[v]/2<0,$=W?T<O?T-O:T-B:0;return{[m]:h[m]+$,data:{[m]:U,centerOffset:T-U-$,...W&&{alignmentOffset:$}},reset:W}}}),ei=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:u,elements:l}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:p=!0,...g}=de(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=fe(o),E=se(s),x=fe(s)===s,C=await(u.isRTL==null?void 0:u.isRTL(l.floating)),A=h||(x||!p?[at(s)]:Vo(s)),R=v!=="none";!h&&R&&A.push(...Xo(s,p,v,C));const S=[s,...A],I=await u.detectOverflow(t,g),_=[];let j=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&_.push(I[y]),f){const T=Ho(o,a,C);_.push(I[T[0]],I[T[1]])}if(j=[...j,{placement:o,overflows:_}],!_.every(T=>T<=0)){var F,O;const T=(((F=i.flip)==null?void 0:F.index)||0)+1,U=S[T];if(U&&(!(f==="alignment"?E!==se(U):!1)||j.every(N=>se(N.placement)===E?N.overflows[0]>0:!0)))return{data:{index:T,overflows:j},reset:{placement:U}};let W=(O=j.filter($=>$.overflows[0]<=0).sort(($,N)=>$.overflows[1]-N.overflows[1])[0])==null?void 0:O.placement;if(!W)switch(m){case"bestFit":{var B;const $=(B=j.filter(N=>{if(R){const H=se(N.placement);return H===E||H==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(H=>H>0).reduce((H,X)=>H+X,0)]).sort((N,H)=>N[1]-H[1])[0])==null?void 0:B[0];$&&(W=$);break}case"initialPlacement":W=s;break}if(o!==W)return{reset:{placement:W}}}return{}}}};function xn(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wn(e){return $o.some(t=>e[t]>=0)}const ti=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=de(e,t);switch(o){case"referenceHidden":{const a=await r.detectOverflow(t,{...i,elementContext:"reference"}),s=xn(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:wn(s)}}}case"escaped":{const a=await r.detectOverflow(t,{...i,altBoundary:!0}),s=xn(a,n.floating);return{data:{escapedOffsets:s,escaped:wn(s)}}}default:return{}}}}},Gn=new Set(["left","top"]);async function ni(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=fe(n),s=Fe(n),u=se(n)==="y",l=Gn.has(a)?-1:1,d=i&&u?-1:1,f=de(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof v=="number"&&(m=s==="end"?v*-1:v),u?{x:m*d,y:h*l}:{x:h*l,y:m*d}}const ri=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,u=await ni(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:a}}}}},oi=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:u={fn:y=>{let{x:E,y:x}=y;return{x:E,y:x}}},...l}=de(e,t),d={x:n,y:r},f=await i.detectOverflow(t,l),h=se(fe(o)),m=Gt(h);let v=d[m],p=d[h];if(a){const y=m==="y"?"top":"left",E=m==="y"?"bottom":"right",x=v+f[y],C=v-f[E];v=It(x,v,C)}if(s){const y=h==="y"?"top":"left",E=h==="y"?"bottom":"right",x=p+f[y],C=p-f[E];p=It(x,p,C)}const g=u.fn({...t,[m]:v,[h]:p});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[m]:a,[h]:s}}}}}},ii=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:u=!0,crossAxis:l=!0}=de(e,t),d={x:n,y:r},f=se(o),h=Gt(f);let m=d[h],v=d[f];const p=de(s,t),g=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(u){const x=h==="y"?"height":"width",C=i.reference[h]-i.floating[x]+g.mainAxis,A=i.reference[h]+i.reference[x]-g.mainAxis;m<C?m=C:m>A&&(m=A)}if(l){var y,E;const x=h==="y"?"width":"height",C=Gn.has(fe(o)),A=i.reference[f]-i.floating[x]+(C&&((y=a.offset)==null?void 0:y[f])||0)+(C?0:g.crossAxis),R=i.reference[f]+i.reference[x]+(C?0:((E=a.offset)==null?void 0:E[f])||0)-(C?g.crossAxis:0);v<A?v=A:v>R&&(v=R)}return{[h]:m,[f]:v}}}},si=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:u=()=>{},...l}=de(e,t),d=await a.detectOverflow(t,l),f=fe(o),h=Fe(o),m=se(o)==="y",{width:v,height:p}=i.floating;let g,y;f==="top"||f==="bottom"?(g=f,y=h===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(y=f,g=h==="end"?"top":"bottom");const E=p-d.top-d.bottom,x=v-d.left-d.right,C=be(p-d[g],E),A=be(v-d[y],x),R=!t.middlewareData.shift;let S=C,I=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(S=E),R&&!h){const j=Q(d.left,0),F=Q(d.right,0),O=Q(d.top,0),B=Q(d.bottom,0);m?I=v-2*(j!==0||F!==0?j+F:Q(d.left,d.right)):S=p-2*(O!==0||B!==0?O+B:Q(d.top,d.bottom))}await u({...t,availableWidth:I,availableHeight:S});const _=await a.getDimensions(s.floating);return v!==_.width||p!==_.height?{reset:{rects:!0}}:{}}}};function dt(){return typeof window<"u"}function We(e){return Kn(e)?(e.nodeName||"").toLowerCase():"#document"}function ee(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function le(e){var t;return(t=(Kn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Kn(e){return dt()?e instanceof Node||e instanceof ee(e).Node:!1}function te(e){return dt()?e instanceof Element||e instanceof ee(e).Element:!1}function pe(e){return dt()?e instanceof HTMLElement||e instanceof ee(e).HTMLElement:!1}function Cn(e){return!dt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ee(e).ShadowRoot}function Ke(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ne(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function ai(e){return/^(table|td|th)$/.test(We(e))}function ft(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const ci=/transform|translate|scale|rotate|perspective|filter/,li=/paint|layout|strict|content/,Ce=e=>!!e&&e!=="none";let Ct;function Yt(e){const t=te(e)?ne(e):e;return Ce(t.transform)||Ce(t.translate)||Ce(t.scale)||Ce(t.rotate)||Ce(t.perspective)||!qt()&&(Ce(t.backdropFilter)||Ce(t.filter))||ci.test(t.willChange||"")||li.test(t.contain||"")}function ui(e){let t=ye(e);for(;pe(t)&&!ze(t);){if(Yt(t))return t;if(ft(t))return null;t=ye(t)}return null}function qt(){return Ct==null&&(Ct=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ct}function ze(e){return/^(html|body|#document)$/.test(We(e))}function ne(e){return ee(e).getComputedStyle(e)}function pt(e){return te(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ye(e){if(We(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Cn(e)&&e.host||le(e);return Cn(t)?t.host:t}function Xn(e){const t=ye(e);return ze(t)?e.ownerDocument?e.ownerDocument.body:e.body:pe(t)&&Ke(t)?t:Xn(t)}function Ge(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Xn(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=ee(o);if(i){const s=Lt(a);return t.concat(a,a.visualViewport||[],Ke(o)?o:[],s&&n?Ge(s):[])}else return t.concat(o,Ge(o,[],n))}function Lt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Yn(e){const t=ne(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=pe(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=st(n)!==i||st(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Zt(e){return te(e)?e:e.contextElement}function Te(e){const t=Zt(e);if(!pe(t))return ce(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Yn(t);let a=(i?st(n.width):n.width)/r,s=(i?st(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const di=ce(0);function qn(e){const t=ee(e);return!qt()||!t.visualViewport?di:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fi(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ee(e)?!1:t}function Se(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Zt(e);let a=ce(1);t&&(r?te(r)&&(a=Te(r)):a=Te(e));const s=fi(i,n,r)?qn(i):ce(0);let u=(o.left+s.x)/a.x,l=(o.top+s.y)/a.y,d=o.width/a.x,f=o.height/a.y;if(i){const h=ee(i),m=r&&te(r)?ee(r):r;let v=h,p=Lt(v);for(;p&&r&&m!==v;){const g=Te(p),y=p.getBoundingClientRect(),E=ne(p),x=y.left+(p.clientLeft+parseFloat(E.paddingLeft))*g.x,C=y.top+(p.clientTop+parseFloat(E.paddingTop))*g.y;u*=g.x,l*=g.y,d*=g.x,f*=g.y,u+=x,l+=C,v=ee(p),p=Lt(v)}}return ct({width:d,height:f,x:u,y:l})}function mt(e,t){const n=pt(e).scrollLeft;return t?t.left+n:Se(le(e)).left+n}function Zn(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-mt(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function pi(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=le(r),s=t?ft(t.floating):!1;if(r===a||s&&i)return n;let u={scrollLeft:0,scrollTop:0},l=ce(1);const d=ce(0),f=pe(r);if((f||!f&&!i)&&((We(r)!=="body"||Ke(a))&&(u=pt(r)),f)){const m=Se(r);l=Te(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const h=a&&!f&&!i?Zn(a,u):ce(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-u.scrollLeft*l.x+d.x+h.x,y:n.y*l.y-u.scrollTop*l.y+d.y+h.y}}function mi(e){return Array.from(e.getClientRects())}function hi(e){const t=le(e),n=pt(e),r=e.ownerDocument.body,o=Q(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Q(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+mt(e);const s=-n.scrollTop;return ne(r).direction==="rtl"&&(a+=Q(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}const En=25;function gi(e,t){const n=ee(e),r=le(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,u=0;if(o){i=o.width,a=o.height;const d=qt();(!d||d&&t==="fixed")&&(s=o.offsetLeft,u=o.offsetTop)}const l=mt(r);if(l<=0){const d=r.ownerDocument,f=d.body,h=getComputedStyle(f),m=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,v=Math.abs(r.clientWidth-f.clientWidth-m);v<=En&&(i-=v)}else l<=En&&(i+=l);return{width:i,height:a,x:s,y:u}}function vi(e,t){const n=Se(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=pe(e)?Te(e):ce(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,u=o*i.x,l=r*i.y;return{width:a,height:s,x:u,y:l}}function Sn(e,t,n){let r;if(t==="viewport")r=gi(e,n);else if(t==="document")r=hi(le(e));else if(te(t))r=vi(t,n);else{const o=qn(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ct(r)}function Qn(e,t){const n=ye(e);return n===t||!te(n)||ze(n)?!1:ne(n).position==="fixed"||Qn(n,t)}function bi(e,t){const n=t.get(e);if(n)return n;let r=Ge(e,[],!1).filter(s=>te(s)&&We(s)!=="body"),o=null;const i=ne(e).position==="fixed";let a=i?ye(e):e;for(;te(a)&&!ze(a);){const s=ne(a),u=Yt(a);!u&&s.position==="fixed"&&(o=null),(i?!u&&!o:!u&&s.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Ke(a)&&!u&&Qn(e,a))?r=r.filter(d=>d!==a):o=s,a=ye(a)}return t.set(e,r),r}function yi(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?ft(t)?[]:bi(t,this._c):[].concat(n),r],s=Sn(t,a[0],o);let u=s.top,l=s.right,d=s.bottom,f=s.left;for(let h=1;h<a.length;h++){const m=Sn(t,a[h],o);u=Q(m.top,u),l=be(m.right,l),d=be(m.bottom,d),f=Q(m.left,f)}return{width:l-f,height:d-u,x:f,y:u}}function xi(e){const{width:t,height:n}=Yn(e);return{width:t,height:n}}function wi(e,t,n){const r=pe(t),o=le(t),i=n==="fixed",a=Se(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const u=ce(0);function l(){u.x=mt(o)}if(r||!r&&!i)if((We(t)!=="body"||Ke(o))&&(s=pt(t)),r){const m=Se(t,!0,i,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else o&&l();i&&!r&&o&&l();const d=o&&!r&&!i?Zn(o,s):ce(0),f=a.left+s.scrollLeft-u.x-d.x,h=a.top+s.scrollTop-u.y-d.y;return{x:f,y:h,width:a.width,height:a.height}}function Et(e){return ne(e).position==="static"}function Rn(e,t){if(!pe(e)||ne(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return le(e)===n&&(n=n.ownerDocument.body),n}function Jn(e,t){const n=ee(e);if(ft(e))return n;if(!pe(e)){let o=ye(e);for(;o&&!ze(o);){if(te(o)&&!Et(o))return o;o=ye(o)}return n}let r=Rn(e,t);for(;r&&ai(r)&&Et(r);)r=Rn(r,t);return r&&ze(r)&&Et(r)&&!Yt(r)?n:r||ui(e)||n}const Ci=async function(e){const t=this.getOffsetParent||Jn,n=this.getDimensions,r=await n(e.floating);return{reference:wi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ei(e){return ne(e).direction==="rtl"}const Si={convertOffsetParentRelativeRectToViewportRelativeRect:pi,getDocumentElement:le,getClippingRect:yi,getOffsetParent:Jn,getElementRects:Ci,getClientRects:mi,getDimensions:xi,getScale:Te,isElement:te,isRTL:Ei};function er(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ri(e,t){let n=null,r;const o=le(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),i();const l=e.getBoundingClientRect(),{left:d,top:f,width:h,height:m}=l;if(s||t(),!h||!m)return;const v=Ze(f),p=Ze(o.clientWidth-(d+h)),g=Ze(o.clientHeight-(f+m)),y=Ze(d),x={rootMargin:-v+"px "+-p+"px "+-g+"px "+-y+"px",threshold:Q(0,be(1,u))||1};let C=!0;function A(R){const S=R[0].intersectionRatio;if(S!==u){if(!C)return a();S?a(!1,S):r=setTimeout(()=>{a(!1,1e-7)},1e3)}S===1&&!er(l,e.getBoundingClientRect())&&a(),C=!1}try{n=new IntersectionObserver(A,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(A,x)}n.observe(e)}return a(!0),i}function Ai(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,l=Zt(e),d=o||i?[...l?Ge(l):[],...t?Ge(t):[]]:[];d.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const f=l&&s?Ri(l,n):null;let h=-1,m=null;a&&(m=new ResizeObserver(y=>{let[E]=y;E&&E.target===l&&m&&t&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),l&&!u&&m.observe(l),t&&m.observe(t));let v,p=u?Se(e):null;u&&g();function g(){const y=Se(e);p&&!er(p,y)&&n(),p=y,v=requestAnimationFrame(g)}return n(),()=>{var y;d.forEach(E=>{o&&E.removeEventListener("scroll",n),i&&E.removeEventListener("resize",n)}),f?.(),(y=m)==null||y.disconnect(),m=null,u&&cancelAnimationFrame(v)}}const Pi=ri,Oi=oi,ki=ei,Ni=si,Mi=ti,An=Jo,Di=ii,Ti=(e,t,n)=>{const r=new Map,o={platform:Si,...n},i={...o.platform,_c:r};return Qo(e,t,{...o,platform:i})};var Ii=typeof document<"u",ji=function(){},rt=Ii?$t.useLayoutEffect:ji;function lt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!lt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!lt(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function tr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Pn(e,t){const n=tr(e);return Math.round(t*n)/n}function St(e){const t=c.useRef(e);return rt(()=>{t.current=e}),t}function Li(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:u,open:l}=e,[d,f]=c.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=c.useState(r);lt(h,r)||m(r);const[v,p]=c.useState(null),[g,y]=c.useState(null),E=c.useCallback(N=>{N!==R.current&&(R.current=N,p(N))},[]),x=c.useCallback(N=>{N!==S.current&&(S.current=N,y(N))},[]),C=i||v,A=a||g,R=c.useRef(null),S=c.useRef(null),I=c.useRef(d),_=u!=null,j=St(u),F=St(o),O=St(l),B=c.useCallback(()=>{if(!R.current||!S.current)return;const N={placement:t,strategy:n,middleware:h};F.current&&(N.platform=F.current),Ti(R.current,S.current,N).then(H=>{const X={...H,isPositioned:O.current!==!1};T.current&&!lt(I.current,X)&&(I.current=X,Wn.flushSync(()=>{f(X)}))})},[h,t,n,F,O]);rt(()=>{l===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(N=>({...N,isPositioned:!1})))},[l]);const T=c.useRef(!1);rt(()=>(T.current=!0,()=>{T.current=!1}),[]),rt(()=>{if(C&&(R.current=C),A&&(S.current=A),C&&A){if(j.current)return j.current(C,A,B);B()}},[C,A,B,j,_]);const U=c.useMemo(()=>({reference:R,floating:S,setReference:E,setFloating:x}),[E,x]),W=c.useMemo(()=>({reference:C,floating:A}),[C,A]),$=c.useMemo(()=>{const N={position:n,left:0,top:0};if(!W.floating)return N;const H=Pn(W.floating,d.x),X=Pn(W.floating,d.y);return s?{...N,transform:"translate("+H+"px, "+X+"px)",...tr(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:X}},[n,s,W.floating,d.x,d.y]);return c.useMemo(()=>({...d,update:B,refs:U,elements:W,floatingStyles:$}),[d,B,U,W,$])}const zi=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?An({element:r.current,padding:o}).fn(n):{}:r?An({element:r,padding:o}).fn(n):{}}}},_i=(e,t)=>{const n=Pi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fi=(e,t)=>{const n=Oi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wi=(e,t)=>({fn:Di(e).fn,options:[e,t]}),$i=(e,t)=>{const n=ki(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bi=(e,t)=>{const n=Ni(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hi=(e,t)=>{const n=Mi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vi=(e,t)=>{const n=zi(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Ui="Arrow",nr=c.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return b.jsx(G.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:b.jsx("polygon",{points:"0,0 30,0 15,10"})})});nr.displayName=Ui;var Gi=nr;function Ki(e){const[t,n]=c.useState(void 0);return ve(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,s;if("borderBoxSize"in i){const u=i.borderBoxSize,l=Array.isArray(u)?u[0]:u;a=l.inlineSize,s=l.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Qt="Popper",[rr,or]=Bt(Qt),[Xi,ir]=rr(Qt),sr=e=>{const{__scopePopper:t,children:n}=e,[r,o]=c.useState(null);return b.jsx(Xi,{scope:t,anchor:r,onAnchorChange:o,children:n})};sr.displayName=Qt;var ar="PopperAnchor",cr=c.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=ir(ar,n),a=c.useRef(null),s=re(t,a),u=c.useRef(null);return c.useEffect(()=>{const l=u.current;u.current=r?.current||a.current,l!==u.current&&i.onAnchorChange(u.current)}),r?null:b.jsx(G.div,{...o,ref:s})});cr.displayName=ar;var Jt="PopperContent",[Yi,qi]=rr(Jt),lr=c.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:v,...p}=e,g=ir(Jt,n),[y,E]=c.useState(null),x=re(t,z=>E(z)),[C,A]=c.useState(null),R=Ki(C),S=R?.width??0,I=R?.height??0,_=r+(i!=="center"?"-"+i:""),j=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},F=Array.isArray(l)?l:[l],O=F.length>0,B={padding:j,boundary:F.filter(Qi),altBoundary:O},{refs:T,floatingStyles:U,placement:W,isPositioned:$,middlewareData:N}=Li({strategy:"fixed",placement:_,whileElementsMounted:(...z)=>Ai(...z,{animationFrame:m==="always"}),elements:{reference:g.anchor},middleware:[_i({mainAxis:o+I,alignmentAxis:a}),u&&Fi({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Wi():void 0,...B}),u&&$i({...B}),Bi({...B,apply:({elements:z,rects:Y,availableWidth:K,availableHeight:Pe})=>{const{width:po,height:mo}=Y.reference,qe=z.floating.style;qe.setProperty("--radix-popper-available-width",`${K}px`),qe.setProperty("--radix-popper-available-height",`${Pe}px`),qe.setProperty("--radix-popper-anchor-width",`${po}px`),qe.setProperty("--radix-popper-anchor-height",`${mo}px`)}}),C&&Vi({element:C,padding:s}),Ji({arrowWidth:S,arrowHeight:I}),h&&Hi({strategy:"referenceHidden",...B})]}),[H,X]=fr(W),q=Le(v);ve(()=>{$&&q?.()},[$,q]);const w=N.arrow?.x,k=N.arrow?.y,D=N.arrow?.centerOffset!==0,[P,L]=c.useState();return ve(()=>{y&&L(window.getComputedStyle(y).zIndex)},[y]),b.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:$?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:P,"--radix-popper-transform-origin":[N.transformOrigin?.x,N.transformOrigin?.y].join(" "),...N.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:b.jsx(Yi,{scope:n,placedSide:H,onArrowChange:A,arrowX:w,arrowY:k,shouldHideArrow:D,children:b.jsx(G.div,{"data-side":H,"data-align":X,...p,ref:x,style:{...p.style,animation:$?void 0:"none"}})})})});lr.displayName=Jt;var ur="PopperArrow",Zi={top:"bottom",right:"left",bottom:"top",left:"right"},dr=c.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=qi(ur,r),a=Zi[i.placedSide];return b.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:b.jsx(Gi,{...o,ref:n,style:{...o.style,display:"block"}})})});dr.displayName=ur;function Qi(e){return e!==null}var Ji=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=o.arrow?.centerOffset!==0,s=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[l,d]=fr(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(o.arrow?.x??0)+s/2,m=(o.arrow?.y??0)+u/2;let v="",p="";return l==="bottom"?(v=a?f:`${h}px`,p=`${-u}px`):l==="top"?(v=a?f:`${h}px`,p=`${r.floating.height+u}px`):l==="right"?(v=`${-u}px`,p=a?f:`${m}px`):l==="left"&&(v=`${r.floating.width+u}px`,p=a?f:`${m}px`),{data:{x:v,y:p}}}});function fr(e){const[t,n="center"]=e.split("-");return[t,n]}var es=sr,pr=cr,ts=lr,ns=dr,rs="Portal",en=c.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=c.useState(!1);ve(()=>i(!0),[]);const a=n||o&&globalThis?.document?.body;return a?_n.createPortal(b.jsx(G.div,{...r,ref:t}),a):null});en.displayName=rs;function os(e,t){return c.useReducer((n,r)=>t[n][r]??n,e)}var $e=e=>{const{present:t,children:n}=e,r=is(t),o=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),i=re(r.ref,ss(o));return typeof n=="function"||r.isPresent?c.cloneElement(o,{ref:i}):null};$e.displayName="Presence";function is(e){const[t,n]=c.useState(),r=c.useRef(null),o=c.useRef(e),i=c.useRef("none"),a=e?"mounted":"unmounted",[s,u]=os(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const l=Qe(r.current);i.current=s==="mounted"?l:"none"},[s]),ve(()=>{const l=r.current,d=o.current;if(d!==e){const h=i.current,m=Qe(l);e?u("MOUNT"):m==="none"||l?.display==="none"?u("UNMOUNT"):u(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),ve(()=>{if(t){let l;const d=t.ownerDocument.defaultView??window,f=m=>{const p=Qe(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&p&&(u("ANIMATION_END"),!o.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",l=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=m=>{m.target===t&&(i.current=Qe(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:c.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Qe(e){return e?.animationName||"none"}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 as=c[" useInsertionEffect ".trim().toString()]||ve;function mr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,a]=cs({defaultProp:t,onChange:n}),s=e!==void 0,u=s?e:o;{const d=c.useRef(e!==void 0);c.useEffect(()=>{const f=d.current;f!==s&&console.warn(`${r} is changing from ${f?"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,r])}const l=c.useCallback(d=>{if(s){const f=ls(d)?d(e):d;f!==e&&a.current?.(f)}else i(d)},[s,e,i,a]);return[u,l]}function cs({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),i=c.useRef(t);return as(()=>{i.current=t},[t]),c.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function ls(e){return typeof e=="function"}var us=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Oe=new WeakMap,Je=new WeakMap,et={},Rt=0,hr=function(e){return e&&(e.host||hr(e.parentNode))},ds=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=hr(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},fs=function(e,t,n,r){var o=ds(t,Array.isArray(e)?e:[e]);et[n]||(et[n]=new WeakMap);var i=et[n],a=[],s=new Set,u=new Set(o),l=function(f){!f||s.has(f)||(s.add(f),l(f.parentNode))};o.forEach(l);var d=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(h){if(s.has(h))d(h);else try{var m=h.getAttribute(r),v=m!==null&&m!=="false",p=(Oe.get(h)||0)+1,g=(i.get(h)||0)+1;Oe.set(h,p),i.set(h,g),a.push(h),p===1&&v&&Je.set(h,!0),g===1&&h.setAttribute(n,"true"),v||h.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return d(t),s.clear(),Rt++,function(){a.forEach(function(f){var h=Oe.get(f)-1,m=i.get(f)-1;Oe.set(f,h),i.set(f,m),h||(Je.has(f)||f.removeAttribute(r),Je.delete(f)),m||f.removeAttribute(n)}),Rt--,Rt||(Oe=new WeakMap,Oe=new WeakMap,Je=new WeakMap,et={})}},gr=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=us(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),fs(r,o,n,"aria-hidden")):function(){return null}},ie=function(){return ie=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ie.apply(this,arguments)};function vr(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function ps(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var ot="right-scroll-bar-position",it="width-before-scroll-bar",ms="with-scroll-bars-hidden",hs="--removed-body-scroll-bar-size";function At(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function gs(e,t){var n=$t.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var vs=typeof window<"u"?c.useLayoutEffect:c.useEffect,On=new WeakMap;function bs(e,t){var n=gs(null,function(r){return e.forEach(function(o){return At(o,r)})});return vs(function(){var r=On.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(s){i.has(s)||At(s,null)}),i.forEach(function(s){o.has(s)||At(s,a)})}On.set(n,e)},[e]),n}function ys(e){return e}function xs(e,t){t===void 0&&(t=ys);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var a=t(i,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(s){return i(s)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(i),a=n}var u=function(){var d=a;a=[],d.forEach(i)},l=function(){return Promise.resolve().then(u)};l(),n={push:function(d){a.push(d),l()},filter:function(d){return a=a.filter(d),n}}}};return o}function ws(e){e===void 0&&(e={});var t=xs(null);return t.options=ie({async:!0,ssr:!1},e),t}var br=function(e){var t=e.sideCar,n=vr(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return c.createElement(r,ie({},n))};br.isSideCarExport=!0;function Cs(e,t){return e.useMedium(t),br}var yr=ws(),Pt=function(){},ht=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:Pt,onWheelCapture:Pt,onTouchMoveCapture:Pt}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,u=e.className,l=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,m=e.noRelative,v=e.noIsolation,p=e.inert,g=e.allowPinchZoom,y=e.as,E=y===void 0?"div":y,x=e.gapMode,C=vr(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=h,R=bs([n,t]),S=ie(ie({},C),o);return c.createElement(c.Fragment,null,d&&c.createElement(A,{sideCar:yr,removeScrollBar:l,shards:f,noRelative:m,noIsolation:v,inert:p,setCallbacks:i,allowPinchZoom:!!g,lockRef:n,gapMode:x}),a?c.cloneElement(c.Children.only(s),ie(ie({},S),{ref:R})):c.createElement(E,ie({},S,{className:u,ref:R}),s))});ht.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ht.classNames={fullWidth:it,zeroRight:ot};var Es=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ss(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Es();return t&&e.setAttribute("nonce",t),e}function Rs(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function As(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ps=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ss())&&(Rs(t,n),As(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Os=function(){var e=Ps();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},xr=function(){var e=Os(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},ks={left:0,top:0,right:0,gap:0},Ot=function(e){return parseInt(e||"",10)||0},Ns=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ot(n),Ot(r),Ot(o)]},Ms=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ks;var t=Ns(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])}},Ds=xr(),Ie="data-scroll-locked",Ts=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
2
|
-
.`.concat(
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime"),Bt=require("react"),Fn=require("react-dom");function Wn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const c=Wn(Bt),$n=Wn(Fn);function J(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function un(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ee(...e){return t=>{let n=!1;const r=e.map(o=>{const i=un(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():un(e[o],null)}}}}function re(...e){return c.useCallback(Ee(...e),e)}function go(e,t){const n=c.createContext(t),r=i=>{const{children:a,...s}=i,u=c.useMemo(()=>s,Object.values(s));return g.jsx(n.Provider,{value:u,children:a})};r.displayName=e+"Provider";function o(i){const a=c.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Ht(e,t=[]){let n=[];function r(i,a){const s=c.createContext(a),u=n.length;n=[...n,a];const l=f=>{const{scope:p,children:h,...b}=f,m=p?.[e]?.[u]||s,v=c.useMemo(()=>b,Object.values(b));return g.jsx(m.Provider,{value:v,children:h})};l.displayName=i+"Provider";function d(f,p){const h=p?.[e]?.[u]||s,b=c.useContext(h);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[l,d]}const o=()=>{const i=n.map(a=>c.createContext(a));return function(s){const u=s?.[e]||i;return c.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return o.scopeName=e,[r,vo(o,...t)]}function vo(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((s,{useScope:u,scopeName:l})=>{const f=u(i)[`__scope${l}`];return{...s,...f}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Ut(e){const t=bo(e),n=c.forwardRef((r,o)=>{const{children:i,...a}=r,s=c.Children.toArray(i),u=s.find(yo);if(u){const l=u.props.children,d=s.map(f=>f===u?c.Children.count(l)>1?c.Children.only(null):c.isValidElement(l)?l.props.children:null:f);return g.jsx(t,{...a,ref:o,children:c.isValidElement(l)?c.cloneElement(l,void 0,d):null})}return g.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function bo(e){const t=c.forwardRef((n,r)=>{const{children:o,...i}=n;if(c.isValidElement(o)){const a=Co(o),s=wo(i,o.props);return o.type!==c.Fragment&&(s.ref=r?Ee(r,a):a),c.cloneElement(o,s)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xo=Symbol("radix.slottable");function yo(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xo}function wo(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const u=i(...s);return o(...s),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Co(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 Eo=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],V=Eo.reduce((e,t)=>{const n=Ut(`Primitive.${t}`),r=c.forwardRef((o,i)=>{const{asChild:a,...s}=o,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(u,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function So(e,t){e&&$n.flushSync(()=>e.dispatchEvent(t))}function Ie(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>t.current?.(...n),[])}function Ro(e,t=globalThis?.document){const n=Ie(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Ao="DismissableLayer",Tt="dismissableLayer.update",Po="dismissableLayer.pointerDownOutside",ko="dismissableLayer.focusOutside",dn,Bn=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gt=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...u}=e,l=c.useContext(Bn),[d,f]=c.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=c.useState({}),b=re(t,E=>f(E)),m=Array.from(l.layers),[v]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),x=m.indexOf(v),w=d?m.indexOf(d):-1,S=l.layersWithOutsidePointerEventsDisabled.size>0,C=w>=x,R=Mo(E=>{const j=E.target,L=[...l.branches].some(z=>z.contains(j));!C||L||(o?.(E),a?.(E),E.defaultPrevented||s?.())},p),A=Do(E=>{const j=E.target;[...l.branches].some(z=>z.contains(j))||(i?.(E),a?.(E),E.defaultPrevented||s?.())},p);return Ro(E=>{w===l.layers.size-1&&(r?.(E),!E.defaultPrevented&&s&&(E.preventDefault(),s()))},p),c.useEffect(()=>{if(d)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(dn=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(d)),l.layers.add(d),fn(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=dn)}},[d,p,n,l]),c.useEffect(()=>()=>{d&&(l.layers.delete(d),l.layersWithOutsidePointerEventsDisabled.delete(d),fn())},[d,l]),c.useEffect(()=>{const E=()=>h({});return document.addEventListener(Tt,E),()=>document.removeEventListener(Tt,E)},[]),g.jsx(V.div,{...u,ref:b,style:{pointerEvents:S?C?"auto":"none":void 0,...e.style},onFocusCapture:J(e.onFocusCapture,A.onFocusCapture),onBlurCapture:J(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:J(e.onPointerDownCapture,R.onPointerDownCapture)})});Gt.displayName=Ao;var Oo="DismissableLayerBranch",No=c.forwardRef((e,t)=>{const n=c.useContext(Bn),r=c.useRef(null),o=re(t,r);return c.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),g.jsx(V.div,{...e,ref:o})});No.displayName=Oo;function Mo(e,t=globalThis?.document){const n=Ie(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let u=function(){Hn(Po,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Do(e,t=globalThis?.document){const n=Ie(e),r=c.useRef(!1);return c.useEffect(()=>{const o=i=>{i.target&&!r.current&&Hn(ko,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function fn(){const e=new CustomEvent(Tt);document.dispatchEvent(e)}function Hn(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?So(o,i):o.dispatchEvent(i)}var xt=0;function Un(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??pn()),document.body.insertAdjacentElement("beforeend",e[1]??pn()),xt++,()=>{xt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),xt--}},[])}function pn(){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 yt="focusScope.autoFocusOnMount",wt="focusScope.autoFocusOnUnmount",mn={bubbles:!1,cancelable:!0},jo="FocusScope",Vt=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,u]=c.useState(null),l=Ie(o),d=Ie(i),f=c.useRef(null),p=re(t,m=>u(m)),h=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let m=function(S){if(h.paused||!s)return;const C=S.target;s.contains(C)?f.current=C:ge(f.current,{select:!0})},v=function(S){if(h.paused||!s)return;const C=S.relatedTarget;C!==null&&(s.contains(C)||ge(f.current,{select:!0}))},x=function(S){if(document.activeElement===document.body)for(const R of S)R.removedNodes.length>0&&ge(s)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const w=new MutationObserver(x);return s&&w.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),w.disconnect()}}},[r,s,h.paused]),c.useEffect(()=>{if(s){gn.add(h);const m=document.activeElement;if(!s.contains(m)){const x=new CustomEvent(yt,mn);s.addEventListener(yt,l),s.dispatchEvent(x),x.defaultPrevented||(To(Fo(Gn(s)),{select:!0}),document.activeElement===m&&ge(s))}return()=>{s.removeEventListener(yt,l),setTimeout(()=>{const x=new CustomEvent(wt,mn);s.addEventListener(wt,d),s.dispatchEvent(x),x.defaultPrevented||ge(m??document.body,{select:!0}),s.removeEventListener(wt,d),gn.remove(h)},0)}}},[s,l,d,h]);const b=c.useCallback(m=>{if(!n&&!r||h.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,x=document.activeElement;if(v&&x){const w=m.currentTarget,[S,C]=zo(w);S&&C?!m.shiftKey&&x===C?(m.preventDefault(),n&&ge(S,{select:!0})):m.shiftKey&&x===S&&(m.preventDefault(),n&&ge(C,{select:!0})):x===w&&m.preventDefault()}},[n,r,h.paused]);return g.jsx(V.div,{tabIndex:-1,...a,ref:p,onKeyDown:b})});Vt.displayName=jo;function To(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ge(r,{select:t}),document.activeElement!==n)return}function zo(e){const t=Gn(e),n=hn(t,e),r=hn(t.reverse(),e);return[n,r]}function Gn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function hn(e,t){for(const n of e)if(!Io(n,{upTo:t}))return n}function Io(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 Lo(e){return e instanceof HTMLInputElement&&"select"in e}function ge(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Lo(e)&&t&&e.select()}}var gn=_o();function _o(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=vn(e,t),e.unshift(t)},remove(t){e=vn(e,t),e[0]?.resume()}}}function vn(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Fo(e){return e.filter(t=>t.tagName!=="A")}var ve=globalThis?.document?c.useLayoutEffect:()=>{},Wo=c[" useId ".trim().toString()]||(()=>{}),$o=0;function ae(e){const[t,n]=c.useState(Wo());return ve(()=>{n(r=>r??String($o++))},[e]),e||(t?`radix-${t}`:"")}const Bo=["top","right","bottom","left"],be=Math.min,Q=Math.max,st=Math.round,Ze=Math.floor,ce=e=>({x:e,y:e}),Ho={left:"right",right:"left",bottom:"top",top:"bottom"};function zt(e,t,n){return Q(e,be(t,n))}function de(e,t){return typeof e=="function"?e(t):e}function fe(e){return e.split("-")[0]}function Fe(e){return e.split("-")[1]}function Kt(e){return e==="x"?"y":"x"}function Xt(e){return e==="y"?"height":"width"}function se(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Yt(e){return Kt(se(e))}function Uo(e,t,n){n===void 0&&(n=!1);const r=Fe(e),o=Yt(e),i=Xt(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=at(a)),[a,at(a)]}function Go(e){const t=at(e);return[It(e),t,It(t)]}function It(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const bn=["left","right"],xn=["right","left"],Vo=["top","bottom"],Ko=["bottom","top"];function Xo(e,t,n){switch(e){case"top":case"bottom":return n?t?xn:bn:t?bn:xn;case"left":case"right":return t?Vo:Ko;default:return[]}}function Yo(e,t,n,r){const o=Fe(e);let i=Xo(fe(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(It)))),i}function at(e){const t=fe(e);return Ho[t]+e.slice(t.length)}function qo(e){return{top:0,right:0,bottom:0,left:0,...e}}function Vn(e){return typeof e!="number"?qo(e):{top:e,right:e,bottom:e,left:e}}function ct(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function yn(e,t,n){let{reference:r,floating:o}=e;const i=se(t),a=Yt(t),s=Xt(a),u=fe(t),l=i==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let h;switch(u){case"top":h={x:d,y:r.y-o.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Fe(t)){case"start":h[a]-=p*(n&&l?-1:1);break;case"end":h[a]+=p*(n&&l?-1:1);break}return h}async function Zo(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=de(t,e),b=Vn(h),v=s[p?f==="floating"?"reference":"floating":f],x=ct(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:l,rootBoundary:d,strategy:u})),w=f==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),C=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},R=ct(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:S,strategy:u}):w);return{top:(x.top-R.top+b.top)/C.y,bottom:(R.bottom-x.bottom+b.bottom)/C.y,left:(x.left-R.left+b.left)/C.x,right:(R.right-x.right+b.right)/C.x}}const Qo=50,Jo=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=a.detectOverflow?a:{...a,detectOverflow:Zo},u=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=yn(l,r,u),p=r,h=0;const b={};for(let m=0;m<i.length;m++){const v=i[m];if(!v)continue;const{name:x,fn:w}=v,{x:S,y:C,data:R,reset:A}=await w({x:d,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:b,rects:l,platform:s,elements:{reference:e,floating:t}});d=S??d,f=C??f,b[x]={...b[x],...R},A&&h<Qo&&(h++,typeof A=="object"&&(A.placement&&(p=A.placement),A.rects&&(l=A.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):A.rects),{x:d,y:f}=yn(l,p,u)),m=-1)}return{x:d,y:f,placement:p,strategy:o,middlewareData:b}},ei=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:u}=t,{element:l,padding:d=0}=de(e,t)||{};if(l==null)return{};const f=Vn(d),p={x:n,y:r},h=Yt(o),b=Xt(h),m=await a.getDimensions(l),v=h==="y",x=v?"top":"left",w=v?"bottom":"right",S=v?"clientHeight":"clientWidth",C=i.reference[b]+i.reference[h]-p[h]-i.floating[b],R=p[h]-i.reference[h],A=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let E=A?A[S]:0;(!E||!await(a.isElement==null?void 0:a.isElement(A)))&&(E=s.floating[S]||i.floating[b]);const j=C/2-R/2,L=E/2-m[b]/2-1,z=be(f[x],L),P=be(f[w],L),k=z,$=E-m[b]-P,T=E/2-m[b]/2+j,G=zt(k,T,$),W=!u.arrow&&Fe(o)!=null&&T!==G&&i.reference[b]/2-(T<k?z:P)-m[b]/2<0,B=W?T<k?T-k:T-$:0;return{[h]:p[h]+B,data:{[h]:G,centerOffset:T-G-B,...W&&{alignmentOffset:B}},reset:W}}}),ti=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:u,elements:l}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:m=!0,...v}=de(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=fe(o),w=se(s),S=fe(s)===s,C=await(u.isRTL==null?void 0:u.isRTL(l.floating)),R=p||(S||!m?[at(s)]:Go(s)),A=b!=="none";!p&&A&&R.push(...Yo(s,m,b,C));const E=[s,...R],j=await u.detectOverflow(t,v),L=[];let z=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&L.push(j[x]),f){const T=Uo(o,a,C);L.push(j[T[0]],j[T[1]])}if(z=[...z,{placement:o,overflows:L}],!L.every(T=>T<=0)){var P,k;const T=(((P=i.flip)==null?void 0:P.index)||0)+1,G=E[T];if(G&&(!(f==="alignment"?w!==se(G):!1)||z.every(M=>se(M.placement)===w?M.overflows[0]>0:!0)))return{data:{index:T,overflows:z},reset:{placement:G}};let W=(k=z.filter(B=>B.overflows[0]<=0).sort((B,M)=>B.overflows[1]-M.overflows[1])[0])==null?void 0:k.placement;if(!W)switch(h){case"bestFit":{var $;const B=($=z.filter(M=>{if(A){const H=se(M.placement);return H===w||H==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(H=>H>0).reduce((H,X)=>H+X,0)]).sort((M,H)=>M[1]-H[1])[0])==null?void 0:$[0];B&&(W=B);break}case"initialPlacement":W=s;break}if(o!==W)return{reset:{placement:W}}}return{}}}};function wn(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Cn(e){return Bo.some(t=>e[t]>=0)}const ni=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=de(e,t);switch(o){case"referenceHidden":{const a=await r.detectOverflow(t,{...i,elementContext:"reference"}),s=wn(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Cn(s)}}}case"escaped":{const a=await r.detectOverflow(t,{...i,altBoundary:!0}),s=wn(a,n.floating);return{data:{escapedOffsets:s,escaped:Cn(s)}}}default:return{}}}}},Kn=new Set(["left","top"]);async function ri(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=fe(n),s=Fe(n),u=se(n)==="y",l=Kn.has(a)?-1:1,d=i&&u?-1:1,f=de(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:b}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof b=="number"&&(h=s==="end"?b*-1:b),u?{x:h*d,y:p*l}:{x:p*l,y:h*d}}const oi=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,u=await ri(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:a}}}}},ii=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:u={fn:x=>{let{x:w,y:S}=x;return{x:w,y:S}}},...l}=de(e,t),d={x:n,y:r},f=await i.detectOverflow(t,l),p=se(fe(o)),h=Kt(p);let b=d[h],m=d[p];if(a){const x=h==="y"?"top":"left",w=h==="y"?"bottom":"right",S=b+f[x],C=b-f[w];b=zt(S,b,C)}if(s){const x=p==="y"?"top":"left",w=p==="y"?"bottom":"right",S=m+f[x],C=m-f[w];m=zt(S,m,C)}const v=u.fn({...t,[h]:b,[p]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[h]:a,[p]:s}}}}}},si=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:u=!0,crossAxis:l=!0}=de(e,t),d={x:n,y:r},f=se(o),p=Kt(f);let h=d[p],b=d[f];const m=de(s,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const S=p==="y"?"height":"width",C=i.reference[p]-i.floating[S]+v.mainAxis,R=i.reference[p]+i.reference[S]-v.mainAxis;h<C?h=C:h>R&&(h=R)}if(l){var x,w;const S=p==="y"?"width":"height",C=Kn.has(fe(o)),R=i.reference[f]-i.floating[S]+(C&&((x=a.offset)==null?void 0:x[f])||0)+(C?0:v.crossAxis),A=i.reference[f]+i.reference[S]+(C?0:((w=a.offset)==null?void 0:w[f])||0)-(C?v.crossAxis:0);b<R?b=R:b>A&&(b=A)}return{[p]:h,[f]:b}}}},ai=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:u=()=>{},...l}=de(e,t),d=await a.detectOverflow(t,l),f=fe(o),p=Fe(o),h=se(o)==="y",{width:b,height:m}=i.floating;let v,x;f==="top"||f==="bottom"?(v=f,x=p===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(x=f,v=p==="end"?"top":"bottom");const w=m-d.top-d.bottom,S=b-d.left-d.right,C=be(m-d[v],w),R=be(b-d[x],S),A=!t.middlewareData.shift;let E=C,j=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(j=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=w),A&&!p){const z=Q(d.left,0),P=Q(d.right,0),k=Q(d.top,0),$=Q(d.bottom,0);h?j=b-2*(z!==0||P!==0?z+P:Q(d.left,d.right)):E=m-2*(k!==0||$!==0?k+$:Q(d.top,d.bottom))}await u({...t,availableWidth:j,availableHeight:E});const L=await a.getDimensions(s.floating);return b!==L.width||m!==L.height?{reset:{rects:!0}}:{}}}};function dt(){return typeof window<"u"}function We(e){return Xn(e)?(e.nodeName||"").toLowerCase():"#document"}function ee(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function le(e){var t;return(t=(Xn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Xn(e){return dt()?e instanceof Node||e instanceof ee(e).Node:!1}function te(e){return dt()?e instanceof Element||e instanceof ee(e).Element:!1}function pe(e){return dt()?e instanceof HTMLElement||e instanceof ee(e).HTMLElement:!1}function En(e){return!dt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ee(e).ShadowRoot}function Ke(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ne(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function ci(e){return/^(table|td|th)$/.test(We(e))}function ft(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const li=/transform|translate|scale|rotate|perspective|filter/,ui=/paint|layout|strict|content/,Ce=e=>!!e&&e!=="none";let Ct;function qt(e){const t=te(e)?ne(e):e;return Ce(t.transform)||Ce(t.translate)||Ce(t.scale)||Ce(t.rotate)||Ce(t.perspective)||!Zt()&&(Ce(t.backdropFilter)||Ce(t.filter))||li.test(t.willChange||"")||ui.test(t.contain||"")}function di(e){let t=xe(e);for(;pe(t)&&!Le(t);){if(qt(t))return t;if(ft(t))return null;t=xe(t)}return null}function Zt(){return Ct==null&&(Ct=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ct}function Le(e){return/^(html|body|#document)$/.test(We(e))}function ne(e){return ee(e).getComputedStyle(e)}function pt(e){return te(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xe(e){if(We(e)==="html")return e;const t=e.assignedSlot||e.parentNode||En(e)&&e.host||le(e);return En(t)?t.host:t}function Yn(e){const t=xe(e);return Le(t)?e.ownerDocument?e.ownerDocument.body:e.body:pe(t)&&Ke(t)?t:Yn(t)}function Ve(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Yn(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=ee(o);if(i){const s=Lt(a);return t.concat(a,a.visualViewport||[],Ke(o)?o:[],s&&n?Ve(s):[])}else return t.concat(o,Ve(o,[],n))}function Lt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qn(e){const t=ne(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=pe(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=st(n)!==i||st(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Qt(e){return te(e)?e:e.contextElement}function je(e){const t=Qt(e);if(!pe(t))return ce(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=qn(t);let a=(i?st(n.width):n.width)/r,s=(i?st(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const fi=ce(0);function Zn(e){const t=ee(e);return!Zt()||!t.visualViewport?fi:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function pi(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ee(e)?!1:t}function Se(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Qt(e);let a=ce(1);t&&(r?te(r)&&(a=je(r)):a=je(e));const s=pi(i,n,r)?Zn(i):ce(0);let u=(o.left+s.x)/a.x,l=(o.top+s.y)/a.y,d=o.width/a.x,f=o.height/a.y;if(i){const p=ee(i),h=r&&te(r)?ee(r):r;let b=p,m=Lt(b);for(;m&&r&&h!==b;){const v=je(m),x=m.getBoundingClientRect(),w=ne(m),S=x.left+(m.clientLeft+parseFloat(w.paddingLeft))*v.x,C=x.top+(m.clientTop+parseFloat(w.paddingTop))*v.y;u*=v.x,l*=v.y,d*=v.x,f*=v.y,u+=S,l+=C,b=ee(m),m=Lt(b)}}return ct({width:d,height:f,x:u,y:l})}function mt(e,t){const n=pt(e).scrollLeft;return t?t.left+n:Se(le(e)).left+n}function Qn(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-mt(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function mi(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=le(r),s=t?ft(t.floating):!1;if(r===a||s&&i)return n;let u={scrollLeft:0,scrollTop:0},l=ce(1);const d=ce(0),f=pe(r);if((f||!f&&!i)&&((We(r)!=="body"||Ke(a))&&(u=pt(r)),f)){const h=Se(r);l=je(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const p=a&&!f&&!i?Qn(a,u):ce(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-u.scrollLeft*l.x+d.x+p.x,y:n.y*l.y-u.scrollTop*l.y+d.y+p.y}}function hi(e){return Array.from(e.getClientRects())}function gi(e){const t=le(e),n=pt(e),r=e.ownerDocument.body,o=Q(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Q(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+mt(e);const s=-n.scrollTop;return ne(r).direction==="rtl"&&(a+=Q(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}const Sn=25;function vi(e,t){const n=ee(e),r=le(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,u=0;if(o){i=o.width,a=o.height;const d=Zt();(!d||d&&t==="fixed")&&(s=o.offsetLeft,u=o.offsetTop)}const l=mt(r);if(l<=0){const d=r.ownerDocument,f=d.body,p=getComputedStyle(f),h=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,b=Math.abs(r.clientWidth-f.clientWidth-h);b<=Sn&&(i-=b)}else l<=Sn&&(i+=l);return{width:i,height:a,x:s,y:u}}function bi(e,t){const n=Se(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=pe(e)?je(e):ce(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,u=o*i.x,l=r*i.y;return{width:a,height:s,x:u,y:l}}function Rn(e,t,n){let r;if(t==="viewport")r=vi(e,n);else if(t==="document")r=gi(le(e));else if(te(t))r=bi(t,n);else{const o=Zn(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ct(r)}function Jn(e,t){const n=xe(e);return n===t||!te(n)||Le(n)?!1:ne(n).position==="fixed"||Jn(n,t)}function xi(e,t){const n=t.get(e);if(n)return n;let r=Ve(e,[],!1).filter(s=>te(s)&&We(s)!=="body"),o=null;const i=ne(e).position==="fixed";let a=i?xe(e):e;for(;te(a)&&!Le(a);){const s=ne(a),u=qt(a);!u&&s.position==="fixed"&&(o=null),(i?!u&&!o:!u&&s.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Ke(a)&&!u&&Jn(e,a))?r=r.filter(d=>d!==a):o=s,a=xe(a)}return t.set(e,r),r}function yi(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?ft(t)?[]:xi(t,this._c):[].concat(n),r],s=Rn(t,a[0],o);let u=s.top,l=s.right,d=s.bottom,f=s.left;for(let p=1;p<a.length;p++){const h=Rn(t,a[p],o);u=Q(h.top,u),l=be(h.right,l),d=be(h.bottom,d),f=Q(h.left,f)}return{width:l-f,height:d-u,x:f,y:u}}function wi(e){const{width:t,height:n}=qn(e);return{width:t,height:n}}function Ci(e,t,n){const r=pe(t),o=le(t),i=n==="fixed",a=Se(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const u=ce(0);function l(){u.x=mt(o)}if(r||!r&&!i)if((We(t)!=="body"||Ke(o))&&(s=pt(t)),r){const h=Se(t,!0,i,t);u.x=h.x+t.clientLeft,u.y=h.y+t.clientTop}else o&&l();i&&!r&&o&&l();const d=o&&!r&&!i?Qn(o,s):ce(0),f=a.left+s.scrollLeft-u.x-d.x,p=a.top+s.scrollTop-u.y-d.y;return{x:f,y:p,width:a.width,height:a.height}}function Et(e){return ne(e).position==="static"}function An(e,t){if(!pe(e)||ne(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return le(e)===n&&(n=n.ownerDocument.body),n}function er(e,t){const n=ee(e);if(ft(e))return n;if(!pe(e)){let o=xe(e);for(;o&&!Le(o);){if(te(o)&&!Et(o))return o;o=xe(o)}return n}let r=An(e,t);for(;r&&ci(r)&&Et(r);)r=An(r,t);return r&&Le(r)&&Et(r)&&!qt(r)?n:r||di(e)||n}const Ei=async function(e){const t=this.getOffsetParent||er,n=this.getDimensions,r=await n(e.floating);return{reference:Ci(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Si(e){return ne(e).direction==="rtl"}const Ri={convertOffsetParentRelativeRectToViewportRelativeRect:mi,getDocumentElement:le,getClippingRect:yi,getOffsetParent:er,getElementRects:Ei,getClientRects:hi,getDimensions:wi,getScale:je,isElement:te,isRTL:Si};function tr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ai(e,t){let n=null,r;const o=le(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),i();const l=e.getBoundingClientRect(),{left:d,top:f,width:p,height:h}=l;if(s||t(),!p||!h)return;const b=Ze(f),m=Ze(o.clientWidth-(d+p)),v=Ze(o.clientHeight-(f+h)),x=Ze(d),S={rootMargin:-b+"px "+-m+"px "+-v+"px "+-x+"px",threshold:Q(0,be(1,u))||1};let C=!0;function R(A){const E=A[0].intersectionRatio;if(E!==u){if(!C)return a();E?a(!1,E):r=setTimeout(()=>{a(!1,1e-7)},1e3)}E===1&&!tr(l,e.getBoundingClientRect())&&a(),C=!1}try{n=new IntersectionObserver(R,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,S)}n.observe(e)}return a(!0),i}function Pi(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,l=Qt(e),d=o||i?[...l?Ve(l):[],...t?Ve(t):[]]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const f=l&&s?Ai(l,n):null;let p=-1,h=null;a&&(h=new ResizeObserver(x=>{let[w]=x;w&&w.target===l&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(t)})),n()}),l&&!u&&h.observe(l),t&&h.observe(t));let b,m=u?Se(e):null;u&&v();function v(){const x=Se(e);m&&!tr(m,x)&&n(),m=x,b=requestAnimationFrame(v)}return n(),()=>{var x;d.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),f?.(),(x=h)==null||x.disconnect(),h=null,u&&cancelAnimationFrame(b)}}const ki=oi,Oi=ii,Ni=ti,Mi=ai,Di=ni,Pn=ei,ji=si,Ti=(e,t,n)=>{const r=new Map,o={platform:Ri,...n},i={...o.platform,_c:r};return Jo(e,t,{...o,platform:i})};var zi=typeof document<"u",Ii=function(){},rt=zi?Bt.useLayoutEffect:Ii;function lt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!lt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!lt(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function nr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function kn(e,t){const n=nr(e);return Math.round(t*n)/n}function St(e){const t=c.useRef(e);return rt(()=>{t.current=e}),t}function Li(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:u,open:l}=e,[d,f]=c.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=c.useState(r);lt(p,r)||h(r);const[b,m]=c.useState(null),[v,x]=c.useState(null),w=c.useCallback(M=>{M!==A.current&&(A.current=M,m(M))},[]),S=c.useCallback(M=>{M!==E.current&&(E.current=M,x(M))},[]),C=i||b,R=a||v,A=c.useRef(null),E=c.useRef(null),j=c.useRef(d),L=u!=null,z=St(u),P=St(o),k=St(l),$=c.useCallback(()=>{if(!A.current||!E.current)return;const M={placement:t,strategy:n,middleware:p};P.current&&(M.platform=P.current),Ti(A.current,E.current,M).then(H=>{const X={...H,isPositioned:k.current!==!1};T.current&&!lt(j.current,X)&&(j.current=X,$n.flushSync(()=>{f(X)}))})},[p,t,n,P,k]);rt(()=>{l===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,f(M=>({...M,isPositioned:!1})))},[l]);const T=c.useRef(!1);rt(()=>(T.current=!0,()=>{T.current=!1}),[]),rt(()=>{if(C&&(A.current=C),R&&(E.current=R),C&&R){if(z.current)return z.current(C,R,$);$()}},[C,R,$,z,L]);const G=c.useMemo(()=>({reference:A,floating:E,setReference:w,setFloating:S}),[w,S]),W=c.useMemo(()=>({reference:C,floating:R}),[C,R]),B=c.useMemo(()=>{const M={position:n,left:0,top:0};if(!W.floating)return M;const H=kn(W.floating,d.x),X=kn(W.floating,d.y);return s?{...M,transform:"translate("+H+"px, "+X+"px)",...nr(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:X}},[n,s,W.floating,d.x,d.y]);return c.useMemo(()=>({...d,update:$,refs:G,elements:W,floatingStyles:B}),[d,$,G,W,B])}const _i=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Pn({element:r.current,padding:o}).fn(n):{}:r?Pn({element:r,padding:o}).fn(n):{}}}},Fi=(e,t)=>{const n=ki(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wi=(e,t)=>{const n=Oi(e);return{name:n.name,fn:n.fn,options:[e,t]}},$i=(e,t)=>({fn:ji(e).fn,options:[e,t]}),Bi=(e,t)=>{const n=Ni(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hi=(e,t)=>{const n=Mi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ui=(e,t)=>{const n=Di(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gi=(e,t)=>{const n=_i(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Vi="Arrow",rr=c.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return g.jsx(V.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});rr.displayName=Vi;var Ki=rr;function Xi(e){const[t,n]=c.useState(void 0);return ve(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,s;if("borderBoxSize"in i){const u=i.borderBoxSize,l=Array.isArray(u)?u[0]:u;a=l.inlineSize,s=l.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Jt="Popper",[or,ir]=Ht(Jt),[Yi,sr]=or(Jt),ar=e=>{const{__scopePopper:t,children:n}=e,[r,o]=c.useState(null);return g.jsx(Yi,{scope:t,anchor:r,onAnchorChange:o,children:n})};ar.displayName=Jt;var cr="PopperAnchor",lr=c.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=sr(cr,n),a=c.useRef(null),s=re(t,a),u=c.useRef(null);return c.useEffect(()=>{const l=u.current;u.current=r?.current||a.current,l!==u.current&&i.onAnchorChange(u.current)}),r?null:g.jsx(V.div,{...o,ref:s})});lr.displayName=cr;var en="PopperContent",[qi,Zi]=or(en),ur=c.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:b,...m}=e,v=sr(en,n),[x,w]=c.useState(null),S=re(t,F=>w(F)),[C,R]=c.useState(null),A=Xi(C),E=A?.width??0,j=A?.height??0,L=r+(i!=="center"?"-"+i:""),z=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},P=Array.isArray(l)?l:[l],k=P.length>0,$={padding:z,boundary:P.filter(Ji),altBoundary:k},{refs:T,floatingStyles:G,placement:W,isPositioned:B,middlewareData:M}=Li({strategy:"fixed",placement:L,whileElementsMounted:(...F)=>Pi(...F,{animationFrame:h==="always"}),elements:{reference:v.anchor},middleware:[Fi({mainAxis:o+j,alignmentAxis:a}),u&&Wi({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?$i():void 0,...$}),u&&Bi({...$}),Hi({...$,apply:({elements:F,rects:Y,availableWidth:K,availableHeight:Pe})=>{const{width:mo,height:ho}=Y.reference,qe=F.floating.style;qe.setProperty("--radix-popper-available-width",`${K}px`),qe.setProperty("--radix-popper-available-height",`${Pe}px`),qe.setProperty("--radix-popper-anchor-width",`${mo}px`),qe.setProperty("--radix-popper-anchor-height",`${ho}px`)}}),C&&Gi({element:C,padding:s}),es({arrowWidth:E,arrowHeight:j}),p&&Ui({strategy:"referenceHidden",...$})]}),[H,X]=pr(W),q=Ie(b);ve(()=>{B&&q?.()},[B,q]);const y=M.arrow?.x,N=M.arrow?.y,I=M.arrow?.centerOffset!==0,[O,_]=c.useState();return ve(()=>{x&&_(window.getComputedStyle(x).zIndex)},[x]),g.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:B?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:O,"--radix-popper-transform-origin":[M.transformOrigin?.x,M.transformOrigin?.y].join(" "),...M.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(qi,{scope:n,placedSide:H,onArrowChange:R,arrowX:y,arrowY:N,shouldHideArrow:I,children:g.jsx(V.div,{"data-side":H,"data-align":X,...m,ref:S,style:{...m.style,animation:B?void 0:"none"}})})})});ur.displayName=en;var dr="PopperArrow",Qi={top:"bottom",right:"left",bottom:"top",left:"right"},fr=c.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=Zi(dr,r),a=Qi[i.placedSide];return g.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:g.jsx(Ki,{...o,ref:n,style:{...o.style,display:"block"}})})});fr.displayName=dr;function Ji(e){return e!==null}var es=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=o.arrow?.centerOffset!==0,s=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[l,d]=pr(n),f={start:"0%",center:"50%",end:"100%"}[d],p=(o.arrow?.x??0)+s/2,h=(o.arrow?.y??0)+u/2;let b="",m="";return l==="bottom"?(b=a?f:`${p}px`,m=`${-u}px`):l==="top"?(b=a?f:`${p}px`,m=`${r.floating.height+u}px`):l==="right"?(b=`${-u}px`,m=a?f:`${h}px`):l==="left"&&(b=`${r.floating.width+u}px`,m=a?f:`${h}px`),{data:{x:b,y:m}}}});function pr(e){const[t,n="center"]=e.split("-");return[t,n]}var ts=ar,mr=lr,ns=ur,rs=fr,os="Portal",tn=c.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=c.useState(!1);ve(()=>i(!0),[]);const a=n||o&&globalThis?.document?.body;return a?Fn.createPortal(g.jsx(V.div,{...r,ref:t}),a):null});tn.displayName=os;function is(e,t){return c.useReducer((n,r)=>t[n][r]??n,e)}var $e=e=>{const{present:t,children:n}=e,r=ss(t),o=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),i=re(r.ref,as(o));return typeof n=="function"||r.isPresent?c.cloneElement(o,{ref:i}):null};$e.displayName="Presence";function ss(e){const[t,n]=c.useState(),r=c.useRef(null),o=c.useRef(e),i=c.useRef("none"),a=e?"mounted":"unmounted",[s,u]=is(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const l=Qe(r.current);i.current=s==="mounted"?l:"none"},[s]),ve(()=>{const l=r.current,d=o.current;if(d!==e){const p=i.current,h=Qe(l);e?u("MOUNT"):h==="none"||l?.display==="none"?u("UNMOUNT"):u(d&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),ve(()=>{if(t){let l;const d=t.ownerDocument.defaultView??window,f=h=>{const m=Qe(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&m&&(u("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",l=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},p=h=>{h.target===t&&(i.current=Qe(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(l),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:c.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Qe(e){return e?.animationName||"none"}function as(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 cs=c[" useInsertionEffect ".trim().toString()]||ve;function hr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,a]=ls({defaultProp:t,onChange:n}),s=e!==void 0,u=s?e:o;{const d=c.useRef(e!==void 0);c.useEffect(()=>{const f=d.current;f!==s&&console.warn(`${r} is changing from ${f?"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,r])}const l=c.useCallback(d=>{if(s){const f=us(d)?d(e):d;f!==e&&a.current?.(f)}else i(d)},[s,e,i,a]);return[u,l]}function ls({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),i=c.useRef(t);return cs(()=>{i.current=t},[t]),c.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function us(e){return typeof e=="function"}var ds=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ke=new WeakMap,Je=new WeakMap,et={},Rt=0,gr=function(e){return e&&(e.host||gr(e.parentNode))},fs=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=gr(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ps=function(e,t,n,r){var o=fs(t,Array.isArray(e)?e:[e]);et[n]||(et[n]=new WeakMap);var i=et[n],a=[],s=new Set,u=new Set(o),l=function(f){!f||s.has(f)||(s.add(f),l(f.parentNode))};o.forEach(l);var d=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(p){if(s.has(p))d(p);else try{var h=p.getAttribute(r),b=h!==null&&h!=="false",m=(ke.get(p)||0)+1,v=(i.get(p)||0)+1;ke.set(p,m),i.set(p,v),a.push(p),m===1&&b&&Je.set(p,!0),v===1&&p.setAttribute(n,"true"),b||p.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",p,x)}})};return d(t),s.clear(),Rt++,function(){a.forEach(function(f){var p=ke.get(f)-1,h=i.get(f)-1;ke.set(f,p),i.set(f,h),p||(Je.has(f)||f.removeAttribute(r),Je.delete(f)),h||f.removeAttribute(n)}),Rt--,Rt||(ke=new WeakMap,ke=new WeakMap,Je=new WeakMap,et={})}},vr=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=ds(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),ps(r,o,n,"aria-hidden")):function(){return null}},ie=function(){return ie=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ie.apply(this,arguments)};function br(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function ms(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var ot="right-scroll-bar-position",it="width-before-scroll-bar",hs="with-scroll-bars-hidden",gs="--removed-body-scroll-bar-size";function At(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function vs(e,t){var n=Bt.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var bs=typeof window<"u"?c.useLayoutEffect:c.useEffect,On=new WeakMap;function xs(e,t){var n=vs(null,function(r){return e.forEach(function(o){return At(o,r)})});return bs(function(){var r=On.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(s){i.has(s)||At(s,null)}),i.forEach(function(s){o.has(s)||At(s,a)})}On.set(n,e)},[e]),n}function ys(e){return e}function ws(e,t){t===void 0&&(t=ys);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var a=t(i,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(s){return i(s)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(i),a=n}var u=function(){var d=a;a=[],d.forEach(i)},l=function(){return Promise.resolve().then(u)};l(),n={push:function(d){a.push(d),l()},filter:function(d){return a=a.filter(d),n}}}};return o}function Cs(e){e===void 0&&(e={});var t=ws(null);return t.options=ie({async:!0,ssr:!1},e),t}var xr=function(e){var t=e.sideCar,n=br(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return c.createElement(r,ie({},n))};xr.isSideCarExport=!0;function Es(e,t){return e.useMedium(t),xr}var yr=Cs(),Pt=function(){},ht=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:Pt,onWheelCapture:Pt,onTouchMoveCapture:Pt}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,u=e.className,l=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noRelative,b=e.noIsolation,m=e.inert,v=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,S=e.gapMode,C=br(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=p,A=xs([n,t]),E=ie(ie({},C),o);return c.createElement(c.Fragment,null,d&&c.createElement(R,{sideCar:yr,removeScrollBar:l,shards:f,noRelative:h,noIsolation:b,inert:m,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:S}),a?c.cloneElement(c.Children.only(s),ie(ie({},E),{ref:A})):c.createElement(w,ie({},E,{className:u,ref:A}),s))});ht.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ht.classNames={fullWidth:it,zeroRight:ot};var Ss=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Rs(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Ss();return t&&e.setAttribute("nonce",t),e}function As(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ps(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ks=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Rs())&&(As(t,n),Ps(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Os=function(){var e=ks();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},wr=function(){var e=Os(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Ns={left:0,top:0,right:0,gap:0},kt=function(e){return parseInt(e||"",10)||0},Ms=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[kt(n),kt(r),kt(o)]},Ds=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Ns;var t=Ms(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])}},js=wr(),Te="data-scroll-locked",Ts=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
2
|
+
.`.concat(hs,` {
|
|
3
3
|
overflow: hidden `).concat(r,`;
|
|
4
4
|
padding-right: `).concat(s,"px ").concat(r,`;
|
|
5
5
|
}
|
|
6
|
-
body[`).concat(
|
|
6
|
+
body[`).concat(Te,`] {
|
|
7
7
|
overflow: hidden `).concat(r,`;
|
|
8
8
|
overscroll-behavior: contain;
|
|
9
9
|
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
margin-right: 0 `).concat(r,`;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
body[`).concat(
|
|
36
|
-
`).concat(
|
|
35
|
+
body[`).concat(Te,`] {
|
|
36
|
+
`).concat(gs,": ").concat(s,`px;
|
|
37
37
|
}
|
|
38
|
-
`)},
|
|
38
|
+
`)},Nn=function(){var e=parseInt(document.body.getAttribute(Te)||"0",10);return isFinite(e)?e:0},zs=function(){c.useEffect(function(){return document.body.setAttribute(Te,(Nn()+1).toString()),function(){var e=Nn()-1;e<=0?document.body.removeAttribute(Te):document.body.setAttribute(Te,e.toString())}},[])},Is=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;zs();var i=c.useMemo(function(){return Ds(o)},[o]);return c.createElement(js,{styles:Ts(i,!t,o,n?"":"!important")})},_t=!1;if(typeof window<"u")try{var tt=Object.defineProperty({},"passive",{get:function(){return _t=!0,!0}});window.addEventListener("test",tt,tt),window.removeEventListener("test",tt,tt)}catch{_t=!1}var Oe=_t?{passive:!1}:!1,Ls=function(e){return e.tagName==="TEXTAREA"},Cr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Ls(e)&&n[t]==="visible")},_s=function(e){return Cr(e,"overflowY")},Fs=function(e){return Cr(e,"overflowX")},Mn=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Er(e,r);if(o){var i=Sr(e,r),a=i[1],s=i[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ws=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},$s=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Er=function(e,t){return e==="v"?_s(t):Fs(t)},Sr=function(e,t){return e==="v"?Ws(t):$s(t)},Bs=function(e,t){return e==="h"&&t==="rtl"?-1:1},Hs=function(e,t,n,r,o){var i=Bs(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,u=t.contains(s),l=!1,d=a>0,f=0,p=0;do{if(!s)break;var h=Sr(e,s),b=h[0],m=h[1],v=h[2],x=m-v-i*b;(b||x)&&Er(e,s)&&(f+=x,p+=b);var w=s.parentNode;s=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!u&&s!==document.body||u&&(t.contains(s)||t===s));return(d&&Math.abs(f)<1||!d&&Math.abs(p)<1)&&(l=!0),l},nt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Dn=function(e){return[e.deltaX,e.deltaY]},jn=function(e){return e&&"current"in e?e.current:e},Us=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Gs=function(e){return`
|
|
39
39
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
40
40
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
41
|
-
`)},Us=0,Ne=[];function Gs(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(Us++)[0],i=c.useState(xr)[0],a=c.useRef(e);c.useEffect(function(){a.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=ps([e.lockRef.current],(e.shards||[]).map(Dn),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=c.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!a.current.allowPinchZoom;var y=nt(p),E=n.current,x="deltaX"in p?p.deltaX:E[0]-y[0],C="deltaY"in p?p.deltaY:E[1]-y[1],A,R=p.target,S=Math.abs(x)>Math.abs(C)?"h":"v";if("touches"in p&&S==="h"&&R.type==="range")return!1;var I=window.getSelection(),_=I&&I.anchorNode,j=_?_===R||_.contains(R):!1;if(j)return!1;var F=Nn(S,R);if(!F)return!0;if(F?A=S:(A=S==="v"?"h":"v",F=Nn(S,R)),!F)return!1;if(!r.current&&"changedTouches"in p&&(x||C)&&(r.current=A),!A)return!0;var O=r.current||A;return Bs(O,g,p,O==="h"?x:C)},[]),u=c.useCallback(function(p){var g=p;if(!(!Ne.length||Ne[Ne.length-1]!==i)){var y="deltaY"in g?Mn(g):nt(g),E=t.current.filter(function(A){return A.name===g.type&&(A.target===g.target||g.target===A.shadowParent)&&Hs(A.delta,y)})[0];if(E&&E.should){g.cancelable&&g.preventDefault();return}if(!E){var x=(a.current.shards||[]).map(Dn).filter(Boolean).filter(function(A){return A.contains(g.target)}),C=x.length>0?s(g,x[0]):!a.current.noIsolation;C&&g.cancelable&&g.preventDefault()}}},[]),l=c.useCallback(function(p,g,y,E){var x={name:p,delta:g,target:y,should:E,shadowParent:Ks(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(C){return C!==x})},1)},[]),d=c.useCallback(function(p){n.current=nt(p),r.current=void 0},[]),f=c.useCallback(function(p){l(p.type,Mn(p),p.target,s(p,e.lockRef.current))},[]),h=c.useCallback(function(p){l(p.type,nt(p),p.target,s(p,e.lockRef.current))},[]);c.useEffect(function(){return Ne.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",u,ke),document.addEventListener("touchmove",u,ke),document.addEventListener("touchstart",d,ke),function(){Ne=Ne.filter(function(p){return p!==i}),document.removeEventListener("wheel",u,ke),document.removeEventListener("touchmove",u,ke),document.removeEventListener("touchstart",d,ke)}},[]);var m=e.removeScrollBar,v=e.inert;return c.createElement(c.Fragment,null,v?c.createElement(i,{styles:Vs(o)}):null,m?c.createElement(js,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ks(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Xs=Cs(yr,Gs);var tn=c.forwardRef(function(e,t){return c.createElement(ht,ie({},e,{ref:t,sideCar:Xs}))});tn.classNames=ht.classNames;var gt="Popover",[Sr]=Bt(gt,[or]),Xe=or(),[Ys,we]=Sr(gt),Rr=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,s=Xe(t),u=c.useRef(null),[l,d]=c.useState(!1),[f,h]=mr({prop:r,defaultProp:o??!1,onChange:i,caller:gt});return b.jsx(es,{...s,children:b.jsx(Ys,{scope:t,contentId:ae(),triggerRef:u,open:f,onOpenChange:h,onOpenToggle:c.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:l,onCustomAnchorAdd:c.useCallback(()=>d(!0),[]),onCustomAnchorRemove:c.useCallback(()=>d(!1),[]),modal:a,children:n})})};Rr.displayName=gt;var Ar="PopoverAnchor",qs=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=we(Ar,n),i=Xe(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=o;return c.useEffect(()=>(a(),()=>s()),[a,s]),b.jsx(pr,{...i,...r,ref:t})});qs.displayName=Ar;var Pr="PopoverTrigger",Or=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=we(Pr,n),i=Xe(n),a=re(t,o.triggerRef),s=b.jsx(G.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Tr(o.open),...r,ref:a,onClick:J(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:b.jsx(pr,{asChild:!0,...i,children:s})});Or.displayName=Pr;var nn="PopoverPortal",[Zs,Qs]=Sr(nn,{forceMount:void 0}),kr=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=we(nn,t);return b.jsx(Zs,{scope:t,forceMount:n,children:b.jsx($e,{present:n||i.open,children:b.jsx(en,{asChild:!0,container:o,children:r})})})};kr.displayName=nn;var _e="PopoverContent",Nr=c.forwardRef((e,t)=>{const n=Qs(_e,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=we(_e,e.__scopePopover);return b.jsx($e,{present:r||i.open,children:i.modal?b.jsx(ea,{...o,ref:t}):b.jsx(ta,{...o,ref:t})})});Nr.displayName=_e;var Js=Ht("PopoverContent.RemoveScroll"),ea=c.forwardRef((e,t)=>{const n=we(_e,e.__scopePopover),r=c.useRef(null),o=re(t,r),i=c.useRef(!1);return c.useEffect(()=>{const a=r.current;if(a)return gr(a)},[]),b.jsx(tn,{as:Js,allowPinchZoom:!0,children:b.jsx(Mr,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:J(e.onCloseAutoFocus,a=>{a.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,u=s.button===0&&s.ctrlKey===!0,l=s.button===2||u;i.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:J(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),ta=c.forwardRef((e,t)=>{const n=we(_e,e.__scopePopover),r=c.useRef(!1),o=c.useRef(!1);return b.jsx(Mr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;n.triggerRef.current?.contains(a)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Mr=c.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:l,onInteractOutside:d,...f}=e,h=we(_e,n),m=Xe(n);return Hn(),b.jsx(Ut,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:b.jsx(Vt,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),children:b.jsx(ts,{"data-state":Tr(h.open),role:"dialog",id:h.contentId,...m,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Dr="PopoverClose",na=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=we(Dr,n);return b.jsx(G.button,{type:"button",...r,ref:t,onClick:J(e.onClick,()=>o.onOpenChange(!1))})});na.displayName=Dr;var ra="PopoverArrow",oa=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Xe(n);return b.jsx(ns,{...o,...r,ref:t})});oa.displayName=ra;function Tr(e){return e?"open":"closed"}var ia=Rr,sa=Or,aa=kr,ca=Nr,Tn=1,la=.9,ua=.8,da=.17,kt=.1,Nt=.999,fa=.9999,pa=.99,ma=/[\\\/_+.#"@\[\(\{&]/,ha=/[\\\/_+.#"@\[\(\{&]/g,ga=/[\s-]/,Ir=/[\s-]/g;function _t(e,t,n,r,o,i,a){if(i===t.length)return o===e.length?Tn:pa;var s=`${o},${i}`;if(a[s]!==void 0)return a[s];for(var u=r.charAt(i),l=n.indexOf(u,o),d=0,f,h,m,v;l>=0;)f=_t(e,t,n,r,l+1,i+1,a),f>d&&(l===o?f*=Tn:ma.test(e.charAt(l-1))?(f*=ua,m=e.slice(o,l-1).match(ha),m&&o>0&&(f*=Math.pow(Nt,m.length))):ga.test(e.charAt(l-1))?(f*=la,v=e.slice(o,l-1).match(Ir),v&&o>0&&(f*=Math.pow(Nt,v.length))):(f*=da,o>0&&(f*=Math.pow(Nt,l-o))),e.charAt(l)!==t.charAt(i)&&(f*=fa)),(f<kt&&n.charAt(l-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(l-1)!==r.charAt(i))&&(h=_t(e,t,n,r,l+1,i+2,a),h*kt>f&&(f=h*kt)),f>d&&(d=f),l=n.indexOf(u,l+1);return a[s]=d,d}function In(e){return e.toLowerCase().replace(Ir," ")}function va(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,_t(e,t,In(e),In(t),0,0,{})}var vt="Dialog",[jr]=Bt(vt),[ba,oe]=jr(vt),Lr=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,s=c.useRef(null),u=c.useRef(null),[l,d]=mr({prop:r,defaultProp:o??!1,onChange:i,caller:vt});return b.jsx(ba,{scope:t,triggerRef:s,contentRef:u,contentId:ae(),titleId:ae(),descriptionId:ae(),open:l,onOpenChange:d,onOpenToggle:c.useCallback(()=>d(f=>!f),[d]),modal:a,children:n})};Lr.displayName=vt;var zr="DialogTrigger",ya=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=oe(zr,n),i=re(t,o.triggerRef);return b.jsx(G.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":sn(o.open),...r,ref:i,onClick:J(e.onClick,o.onOpenToggle)})});ya.displayName=zr;var rn="DialogPortal",[xa,_r]=jr(rn,{forceMount:void 0}),Fr=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=oe(rn,t);return b.jsx(xa,{scope:t,forceMount:n,children:c.Children.map(r,a=>b.jsx($e,{present:n||i.open,children:b.jsx(en,{asChild:!0,container:o,children:a})}))})};Fr.displayName=rn;var ut="DialogOverlay",Wr=c.forwardRef((e,t)=>{const n=_r(ut,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=oe(ut,e.__scopeDialog);return i.modal?b.jsx($e,{present:r||i.open,children:b.jsx(Ca,{...o,ref:t})}):null});Wr.displayName=ut;var wa=Ht("DialogOverlay.RemoveScroll"),Ca=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=oe(ut,n);return b.jsx(tn,{as:wa,allowPinchZoom:!0,shards:[o.contentRef],children:b.jsx(G.div,{"data-state":sn(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Re="DialogContent",$r=c.forwardRef((e,t)=>{const n=_r(Re,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=oe(Re,e.__scopeDialog);return b.jsx($e,{present:r||i.open,children:i.modal?b.jsx(Ea,{...o,ref:t}):b.jsx(Sa,{...o,ref:t})})});$r.displayName=Re;var Ea=c.forwardRef((e,t)=>{const n=oe(Re,e.__scopeDialog),r=c.useRef(null),o=re(t,n.contentRef,r);return c.useEffect(()=>{const i=r.current;if(i)return gr(i)},[]),b.jsx(Br,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:J(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&i.preventDefault()}),onFocusOutside:J(e.onFocusOutside,i=>i.preventDefault())})}),Sa=c.forwardRef((e,t)=>{const n=oe(Re,e.__scopeDialog),r=c.useRef(!1),o=c.useRef(!1);return b.jsx(Br,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;n.triggerRef.current?.contains(a)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Br=c.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,s=oe(Re,n),u=c.useRef(null),l=re(t,u);return Hn(),b.jsxs(b.Fragment,{children:[b.jsx(Ut,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:b.jsx(Vt,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":sn(s.open),...a,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),b.jsxs(b.Fragment,{children:[b.jsx(Oa,{titleId:s.titleId}),b.jsx(Na,{contentRef:u,descriptionId:s.descriptionId})]})]})}),on="DialogTitle",Ra=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=oe(on,n);return b.jsx(G.h2,{id:o.titleId,...r,ref:t})});Ra.displayName=on;var Hr="DialogDescription",Aa=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=oe(Hr,n);return b.jsx(G.p,{id:o.descriptionId,...r,ref:t})});Aa.displayName=Hr;var Vr="DialogClose",Pa=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=oe(Vr,n);return b.jsx(G.button,{type:"button",...r,ref:t,onClick:J(e.onClick,()=>o.onOpenChange(!1))})});Pa.displayName=Vr;function sn(e){return e?"open":"closed"}var Ur="DialogTitleWarning",[Nc,Gr]=ho(Ur,{contentName:Re,titleName:on,docsSlug:"dialog"}),Oa=({titleId:e})=>{const t=Gr(Ur),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
41
|
+
`)},Vs=0,Ne=[];function Ks(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(Vs++)[0],i=c.useState(wr)[0],a=c.useRef(e);c.useEffect(function(){a.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=ms([e.lockRef.current],(e.shards||[]).map(jn),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=c.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!a.current.allowPinchZoom;var x=nt(m),w=n.current,S="deltaX"in m?m.deltaX:w[0]-x[0],C="deltaY"in m?m.deltaY:w[1]-x[1],R,A=m.target,E=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in m&&E==="h"&&A.type==="range")return!1;var j=window.getSelection(),L=j&&j.anchorNode,z=L?L===A||L.contains(A):!1;if(z)return!1;var P=Mn(E,A);if(!P)return!0;if(P?R=E:(R=E==="v"?"h":"v",P=Mn(E,A)),!P)return!1;if(!r.current&&"changedTouches"in m&&(S||C)&&(r.current=R),!R)return!0;var k=r.current||R;return Hs(k,v,m,k==="h"?S:C)},[]),u=c.useCallback(function(m){var v=m;if(!(!Ne.length||Ne[Ne.length-1]!==i)){var x="deltaY"in v?Dn(v):nt(v),w=t.current.filter(function(R){return R.name===v.type&&(R.target===v.target||v.target===R.shadowParent)&&Us(R.delta,x)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var S=(a.current.shards||[]).map(jn).filter(Boolean).filter(function(R){return R.contains(v.target)}),C=S.length>0?s(v,S[0]):!a.current.noIsolation;C&&v.cancelable&&v.preventDefault()}}},[]),l=c.useCallback(function(m,v,x,w){var S={name:m,delta:v,target:x,should:w,shadowParent:Xs(x)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),d=c.useCallback(function(m){n.current=nt(m),r.current=void 0},[]),f=c.useCallback(function(m){l(m.type,Dn(m),m.target,s(m,e.lockRef.current))},[]),p=c.useCallback(function(m){l(m.type,nt(m),m.target,s(m,e.lockRef.current))},[]);c.useEffect(function(){return Ne.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",u,Oe),document.addEventListener("touchmove",u,Oe),document.addEventListener("touchstart",d,Oe),function(){Ne=Ne.filter(function(m){return m!==i}),document.removeEventListener("wheel",u,Oe),document.removeEventListener("touchmove",u,Oe),document.removeEventListener("touchstart",d,Oe)}},[]);var h=e.removeScrollBar,b=e.inert;return c.createElement(c.Fragment,null,b?c.createElement(i,{styles:Gs(o)}):null,h?c.createElement(Is,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Xs(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ys=Es(yr,Ks);var nn=c.forwardRef(function(e,t){return c.createElement(ht,ie({},e,{ref:t,sideCar:Ys}))});nn.classNames=ht.classNames;var gt="Popover",[Rr]=Ht(gt,[ir]),Xe=ir(),[qs,we]=Rr(gt),Ar=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,s=Xe(t),u=c.useRef(null),[l,d]=c.useState(!1),[f,p]=hr({prop:r,defaultProp:o??!1,onChange:i,caller:gt});return g.jsx(ts,{...s,children:g.jsx(qs,{scope:t,contentId:ae(),triggerRef:u,open:f,onOpenChange:p,onOpenToggle:c.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:l,onCustomAnchorAdd:c.useCallback(()=>d(!0),[]),onCustomAnchorRemove:c.useCallback(()=>d(!1),[]),modal:a,children:n})})};Ar.displayName=gt;var Pr="PopoverAnchor",Zs=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=we(Pr,n),i=Xe(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=o;return c.useEffect(()=>(a(),()=>s()),[a,s]),g.jsx(mr,{...i,...r,ref:t})});Zs.displayName=Pr;var kr="PopoverTrigger",Or=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=we(kr,n),i=Xe(n),a=re(t,o.triggerRef),s=g.jsx(V.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Tr(o.open),...r,ref:a,onClick:J(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:g.jsx(mr,{asChild:!0,...i,children:s})});Or.displayName=kr;var rn="PopoverPortal",[Qs,Js]=Rr(rn,{forceMount:void 0}),Nr=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=we(rn,t);return g.jsx(Qs,{scope:t,forceMount:n,children:g.jsx($e,{present:n||i.open,children:g.jsx(tn,{asChild:!0,container:o,children:r})})})};Nr.displayName=rn;var _e="PopoverContent",Mr=c.forwardRef((e,t)=>{const n=Js(_e,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=we(_e,e.__scopePopover);return g.jsx($e,{present:r||i.open,children:i.modal?g.jsx(ta,{...o,ref:t}):g.jsx(na,{...o,ref:t})})});Mr.displayName=_e;var ea=Ut("PopoverContent.RemoveScroll"),ta=c.forwardRef((e,t)=>{const n=we(_e,e.__scopePopover),r=c.useRef(null),o=re(t,r),i=c.useRef(!1);return c.useEffect(()=>{const a=r.current;if(a)return vr(a)},[]),g.jsx(nn,{as:ea,allowPinchZoom:!0,children:g.jsx(Dr,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:J(e.onCloseAutoFocus,a=>{a.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,u=s.button===0&&s.ctrlKey===!0,l=s.button===2||u;i.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:J(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),na=c.forwardRef((e,t)=>{const n=we(_e,e.__scopePopover),r=c.useRef(!1),o=c.useRef(!1);return g.jsx(Dr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;n.triggerRef.current?.contains(a)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Dr=c.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:l,onInteractOutside:d,...f}=e,p=we(_e,n),h=Xe(n);return Un(),g.jsx(Vt,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:g.jsx(Gt,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:l,onDismiss:()=>p.onOpenChange(!1),children:g.jsx(ns,{"data-state":Tr(p.open),role:"dialog",id:p.contentId,...h,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),jr="PopoverClose",ra=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=we(jr,n);return g.jsx(V.button,{type:"button",...r,ref:t,onClick:J(e.onClick,()=>o.onOpenChange(!1))})});ra.displayName=jr;var oa="PopoverArrow",ia=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Xe(n);return g.jsx(rs,{...o,...r,ref:t})});ia.displayName=oa;function Tr(e){return e?"open":"closed"}var sa=Ar,aa=Or,ca=Nr,la=Mr,Tn=1,ua=.9,da=.8,fa=.17,Ot=.1,Nt=.999,pa=.9999,ma=.99,ha=/[\\\/_+.#"@\[\(\{&]/,ga=/[\\\/_+.#"@\[\(\{&]/g,va=/[\s-]/,zr=/[\s-]/g;function Ft(e,t,n,r,o,i,a){if(i===t.length)return o===e.length?Tn:ma;var s=`${o},${i}`;if(a[s]!==void 0)return a[s];for(var u=r.charAt(i),l=n.indexOf(u,o),d=0,f,p,h,b;l>=0;)f=Ft(e,t,n,r,l+1,i+1,a),f>d&&(l===o?f*=Tn:ha.test(e.charAt(l-1))?(f*=da,h=e.slice(o,l-1).match(ga),h&&o>0&&(f*=Math.pow(Nt,h.length))):va.test(e.charAt(l-1))?(f*=ua,b=e.slice(o,l-1).match(zr),b&&o>0&&(f*=Math.pow(Nt,b.length))):(f*=fa,o>0&&(f*=Math.pow(Nt,l-o))),e.charAt(l)!==t.charAt(i)&&(f*=pa)),(f<Ot&&n.charAt(l-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(l-1)!==r.charAt(i))&&(p=Ft(e,t,n,r,l+1,i+2,a),p*Ot>f&&(f=p*Ot)),f>d&&(d=f),l=n.indexOf(u,l+1);return a[s]=d,d}function zn(e){return e.toLowerCase().replace(zr," ")}function ba(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Ft(e,t,zn(e),zn(t),0,0,{})}var vt="Dialog",[Ir]=Ht(vt),[xa,oe]=Ir(vt),Lr=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,s=c.useRef(null),u=c.useRef(null),[l,d]=hr({prop:r,defaultProp:o??!1,onChange:i,caller:vt});return g.jsx(xa,{scope:t,triggerRef:s,contentRef:u,contentId:ae(),titleId:ae(),descriptionId:ae(),open:l,onOpenChange:d,onOpenToggle:c.useCallback(()=>d(f=>!f),[d]),modal:a,children:n})};Lr.displayName=vt;var _r="DialogTrigger",ya=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=oe(_r,n),i=re(t,o.triggerRef);return g.jsx(V.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":an(o.open),...r,ref:i,onClick:J(e.onClick,o.onOpenToggle)})});ya.displayName=_r;var on="DialogPortal",[wa,Fr]=Ir(on,{forceMount:void 0}),Wr=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=oe(on,t);return g.jsx(wa,{scope:t,forceMount:n,children:c.Children.map(r,a=>g.jsx($e,{present:n||i.open,children:g.jsx(tn,{asChild:!0,container:o,children:a})}))})};Wr.displayName=on;var ut="DialogOverlay",$r=c.forwardRef((e,t)=>{const n=Fr(ut,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=oe(ut,e.__scopeDialog);return i.modal?g.jsx($e,{present:r||i.open,children:g.jsx(Ea,{...o,ref:t})}):null});$r.displayName=ut;var Ca=Ut("DialogOverlay.RemoveScroll"),Ea=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=oe(ut,n);return g.jsx(nn,{as:Ca,allowPinchZoom:!0,shards:[o.contentRef],children:g.jsx(V.div,{"data-state":an(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Re="DialogContent",Br=c.forwardRef((e,t)=>{const n=Fr(Re,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=oe(Re,e.__scopeDialog);return g.jsx($e,{present:r||i.open,children:i.modal?g.jsx(Sa,{...o,ref:t}):g.jsx(Ra,{...o,ref:t})})});Br.displayName=Re;var Sa=c.forwardRef((e,t)=>{const n=oe(Re,e.__scopeDialog),r=c.useRef(null),o=re(t,n.contentRef,r);return c.useEffect(()=>{const i=r.current;if(i)return vr(i)},[]),g.jsx(Hr,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:J(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&i.preventDefault()}),onFocusOutside:J(e.onFocusOutside,i=>i.preventDefault())})}),Ra=c.forwardRef((e,t)=>{const n=oe(Re,e.__scopeDialog),r=c.useRef(!1),o=c.useRef(!1);return g.jsx(Hr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;n.triggerRef.current?.contains(a)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Hr=c.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,s=oe(Re,n),u=c.useRef(null),l=re(t,u);return Un(),g.jsxs(g.Fragment,{children:[g.jsx(Vt,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:g.jsx(Gt,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":an(s.open),...a,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(Oa,{titleId:s.titleId}),g.jsx(Ma,{contentRef:u,descriptionId:s.descriptionId})]})]})}),sn="DialogTitle",Aa=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=oe(sn,n);return g.jsx(V.h2,{id:o.titleId,...r,ref:t})});Aa.displayName=sn;var Ur="DialogDescription",Pa=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=oe(Ur,n);return g.jsx(V.p,{id:o.descriptionId,...r,ref:t})});Pa.displayName=Ur;var Gr="DialogClose",ka=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=oe(Gr,n);return g.jsx(V.button,{type:"button",...r,ref:t,onClick:J(e.onClick,()=>o.onOpenChange(!1))})});ka.displayName=Gr;function an(e){return e?"open":"closed"}var Vr="DialogTitleWarning",[Mc,Kr]=go(Vr,{contentName:Re,titleName:sn,docsSlug:"dialog"}),Oa=({titleId:e})=>{const t=Kr(Vr),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
42
42
|
|
|
43
43
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
44
44
|
|
|
45
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return c.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},ka="DialogDescriptionWarning",Na=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Gr(ka).contentName}}.`;return c.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Ma=Lr,Da=Fr,Ta=Wr,Ia=$r,He='[cmdk-group=""]',Mt='[cmdk-group-items=""]',ja='[cmdk-group-heading=""]',Kr='[cmdk-item=""]',jn=`${Kr}:not([aria-disabled="true"])`,Ft="cmdk-item-select",Me="data-value",La=(e,t,n)=>va(e,t,n),Xr=c.createContext(void 0),Ye=()=>c.useContext(Xr),Yr=c.createContext(void 0),an=()=>c.useContext(Yr),qr=c.createContext(void 0),Zr=c.forwardRef((e,t)=>{let n=De(()=>{var w,k;return{search:"",value:(k=(w=e.value)!=null?w:e.defaultValue)!=null?k:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=De(()=>new Set),o=De(()=>new Map),i=De(()=>new Map),a=De(()=>new Set),s=ro(e),{label:u,children:l,value:d,onValueChange:f,filter:h,shouldFilter:m,loop:v,disablePointerSelection:p=!1,vimBindings:g=!0,...y}=e,E=ae(),x=ae(),C=ae(),A=c.useRef(null),R=Ha();Ae(()=>{if(d!==void 0){let w=d.trim();n.current.value=w,S.emit()}},[d]),Ae(()=>{R(6,B)},[]);let S=c.useMemo(()=>({subscribe:w=>(a.current.add(w),()=>a.current.delete(w)),snapshot:()=>n.current,setState:(w,k,D)=>{var P,L,z,Y;if(!Object.is(n.current[w],k)){if(n.current[w]=k,w==="search")O(),j(),R(1,F);else if(w==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let K=document.getElementById(C);K?K.focus():(P=document.getElementById(E))==null||P.focus()}if(R(7,()=>{var K;n.current.selectedItemId=(K=T())==null?void 0:K.id,S.emit()}),D||R(5,B),((L=s.current)==null?void 0:L.value)!==void 0){let K=k??"";(Y=(z=s.current).onValueChange)==null||Y.call(z,K);return}}S.emit()}},emit:()=>{a.current.forEach(w=>w())}}),[]),I=c.useMemo(()=>({value:(w,k,D)=>{var P;k!==((P=i.current.get(w))==null?void 0:P.value)&&(i.current.set(w,{value:k,keywords:D}),n.current.filtered.items.set(w,_(k,D)),R(2,()=>{j(),S.emit()}))},item:(w,k)=>(r.current.add(w),k&&(o.current.has(k)?o.current.get(k).add(w):o.current.set(k,new Set([w]))),R(3,()=>{O(),j(),n.current.value||F(),S.emit()}),()=>{i.current.delete(w),r.current.delete(w),n.current.filtered.items.delete(w);let D=T();R(4,()=>{O(),D?.getAttribute("id")===w&&F(),S.emit()})}),group:w=>(o.current.has(w)||o.current.set(w,new Set),()=>{i.current.delete(w),o.current.delete(w)}),filter:()=>s.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:E,inputId:C,labelId:x,listInnerRef:A}),[]);function _(w,k){var D,P;let L=(P=(D=s.current)==null?void 0:D.filter)!=null?P:La;return w?L(w,n.current.search,k):0}function j(){if(!n.current.search||s.current.shouldFilter===!1)return;let w=n.current.filtered.items,k=[];n.current.filtered.groups.forEach(P=>{let L=o.current.get(P),z=0;L.forEach(Y=>{let K=w.get(Y);z=Math.max(K,z)}),k.push([P,z])});let D=A.current;U().sort((P,L)=>{var z,Y;let K=P.getAttribute("id"),Pe=L.getAttribute("id");return((z=w.get(Pe))!=null?z:0)-((Y=w.get(K))!=null?Y:0)}).forEach(P=>{let L=P.closest(Mt);L?L.appendChild(P.parentElement===L?P:P.closest(`${Mt} > *`)):D.appendChild(P.parentElement===D?P:P.closest(`${Mt} > *`))}),k.sort((P,L)=>L[1]-P[1]).forEach(P=>{var L;let z=(L=A.current)==null?void 0:L.querySelector(`${He}[${Me}="${encodeURIComponent(P[0])}"]`);z?.parentElement.appendChild(z)})}function F(){let w=U().find(D=>D.getAttribute("aria-disabled")!=="true"),k=w?.getAttribute(Me);S.setState("value",k||void 0)}function O(){var w,k,D,P;if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let L=0;for(let z of r.current){let Y=(k=(w=i.current.get(z))==null?void 0:w.value)!=null?k:"",K=(P=(D=i.current.get(z))==null?void 0:D.keywords)!=null?P:[],Pe=_(Y,K);n.current.filtered.items.set(z,Pe),Pe>0&&L++}for(let[z,Y]of o.current)for(let K of Y)if(n.current.filtered.items.get(K)>0){n.current.filtered.groups.add(z);break}n.current.filtered.count=L}function B(){var w,k,D;let P=T();P&&(((w=P.parentElement)==null?void 0:w.firstChild)===P&&((D=(k=P.closest(He))==null?void 0:k.querySelector(ja))==null||D.scrollIntoView({block:"nearest"})),P.scrollIntoView({block:"nearest"}))}function T(){var w;return(w=A.current)==null?void 0:w.querySelector(`${Kr}[aria-selected="true"]`)}function U(){var w;return Array.from(((w=A.current)==null?void 0:w.querySelectorAll(jn))||[])}function W(w){let k=U()[w];k&&S.setState("value",k.getAttribute(Me))}function $(w){var k;let D=T(),P=U(),L=P.findIndex(Y=>Y===D),z=P[L+w];(k=s.current)!=null&&k.loop&&(z=L+w<0?P[P.length-1]:L+w===P.length?P[0]:P[L+w]),z&&S.setState("value",z.getAttribute(Me))}function N(w){let k=T(),D=k?.closest(He),P;for(;D&&!P;)D=w>0?$a(D,He):Ba(D,He),P=D?.querySelector(jn);P?S.setState("value",P.getAttribute(Me)):$(w)}let H=()=>W(U().length-1),X=w=>{w.preventDefault(),w.metaKey?H():w.altKey?N(1):$(1)},q=w=>{w.preventDefault(),w.metaKey?W(0):w.altKey?N(-1):$(-1)};return c.createElement(G.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:w=>{var k;(k=y.onKeyDown)==null||k.call(y,w);let D=w.nativeEvent.isComposing||w.keyCode===229;if(!(w.defaultPrevented||D))switch(w.key){case"n":case"j":{g&&w.ctrlKey&&X(w);break}case"ArrowDown":{X(w);break}case"p":case"k":{g&&w.ctrlKey&&q(w);break}case"ArrowUp":{q(w);break}case"Home":{w.preventDefault(),W(0);break}case"End":{w.preventDefault(),H();break}case"Enter":{w.preventDefault();let P=T();if(P){let L=new Event(Ft);P.dispatchEvent(L)}}}}},c.createElement("label",{"cmdk-label":"",htmlFor:I.inputId,id:I.labelId,style:Ua},u),bt(e,w=>c.createElement(Yr.Provider,{value:S},c.createElement(Xr.Provider,{value:I},w))))}),Qr=c.forwardRef((e,t)=>{var n,r;let o=ae(),i=c.useRef(null),a=c.useContext(qr),s=Ye(),u=ro(e),l=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:a?.forceMount;Ae(()=>{if(!l)return s.item(o,a?.id)},[l]);let d=oo(o,i,[e.value,e.children,i],e.keywords),f=an(),h=xe(R=>R.value&&R.value===d.current),m=xe(R=>l||s.filter()===!1?!0:R.search?R.filtered.items.get(o)>0:!0);c.useEffect(()=>{let R=i.current;if(!(!R||e.disabled))return R.addEventListener(Ft,v),()=>R.removeEventListener(Ft,v)},[m,e.onSelect,e.disabled]);function v(){var R,S;p(),(S=(R=u.current).onSelect)==null||S.call(R,d.current)}function p(){f.setState("value",d.current,!0)}if(!m)return null;let{disabled:g,value:y,onSelect:E,forceMount:x,keywords:C,...A}=e;return c.createElement(G.div,{ref:Ee(i,t),...A,id:o,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!h,"data-disabled":!!g,"data-selected":!!h,onPointerMove:g||s.getDisablePointerSelection()?void 0:p,onClick:g?void 0:v},e.children)}),Jr=c.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...i}=e,a=ae(),s=c.useRef(null),u=c.useRef(null),l=ae(),d=Ye(),f=xe(m=>o||d.filter()===!1?!0:m.search?m.filtered.groups.has(a):!0);Ae(()=>d.group(a),[]),oo(a,s,[e.value,e.heading,u]);let h=c.useMemo(()=>({id:a,forceMount:o}),[o]);return c.createElement(G.div,{ref:Ee(s,t),...i,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&c.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:l},n),bt(e,m=>c.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?l:void 0},c.createElement(qr.Provider,{value:h},m))))}),za=c.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=c.useRef(null),i=xe(a=>!a.search);return!n&&!i?null:c.createElement(G.div,{ref:Ee(o,t),...r,"cmdk-separator":"",role:"separator"})}),eo=c.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=an(),a=xe(l=>l.search),s=xe(l=>l.selectedItemId),u=Ye();return c.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),c.createElement(G.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":s,id:u.inputId,type:"text",value:o?e.value:a,onChange:l=>{o||i.setState("search",l.target.value),n?.(l.target.value)}})}),to=c.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,i=c.useRef(null),a=c.useRef(null),s=xe(l=>l.selectedItemId),u=Ye();return c.useEffect(()=>{if(a.current&&i.current){let l=a.current,d=i.current,f,h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let m=l.offsetHeight;d.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return h.observe(l),()=>{cancelAnimationFrame(f),h.unobserve(l)}}},[]),c.createElement(G.div,{ref:Ee(i,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:u.listId},bt(e,l=>c.createElement("div",{ref:Ee(a,u.listInnerRef),"cmdk-list-sizer":""},l)))}),_a=c.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:a,...s}=e;return c.createElement(Ma,{open:n,onOpenChange:r},c.createElement(Da,{container:a},c.createElement(Ta,{"cmdk-overlay":"",className:o}),c.createElement(Ia,{"aria-label":e.label,"cmdk-dialog":"",className:i},c.createElement(Zr,{ref:t,...s}))))}),no=c.forwardRef((e,t)=>xe(n=>n.filtered.count===0)?c.createElement(G.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Fa=c.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...i}=e;return c.createElement(G.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},bt(e,a=>c.createElement("div",{"aria-hidden":!0},a)))}),Wa=Object.assign(Zr,{List:to,Item:Qr,Input:eo,Group:Jr,Separator:za,Dialog:_a,Empty:no,Loading:Fa});function $a(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Ba(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function ro(e){let t=c.useRef(e);return Ae(()=>{t.current=e}),t}var Ae=typeof window>"u"?c.useEffect:c.useLayoutEffect;function De(e){let t=c.useRef();return t.current===void 0&&(t.current=e()),t}function xe(e){let t=an(),n=()=>e(t.snapshot());return c.useSyncExternalStore(t.subscribe,n,n)}function oo(e,t,n,r=[]){let o=c.useRef(),i=Ye();return Ae(()=>{var a;let s=(()=>{var l;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(l=d.current.textContent)==null?void 0:l.trim():o.current}})(),u=r.map(l=>l.trim());i.value(e,s,u),(a=t.current)==null||a.setAttribute(Me,s),o.current=s}),o}var Ha=()=>{let[e,t]=c.useState(),n=De(()=>new Map);return Ae(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function Va(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function bt({asChild:e,children:t},n){return e&&c.isValidElement(t)?c.cloneElement(Va(t),{ref:t.ref},n(t.props.children)):n(t)}var Ua={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function io(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=io(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ga(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=io(e))&&(r&&(r+=" "),r+=t);return r}const cn="-",Ka=e=>{const t=Ya(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const s=a.split(cn);return s[0]===""&&s.length!==1&&s.shift(),so(s,t)||Xa(a)},getConflictingClassGroupIds:(a,s)=>{const u=n[a]||[];return s&&r[a]?[...u,...r[a]]:u}}},so=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?so(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(cn);return t.validators.find(({validator:a})=>a(i))?.classGroupId},Ln=/^\[(.+)\]$/,Xa=e=>{if(Ln.test(e)){const t=Ln.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Ya=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Za(Object.entries(e.classGroups),n).forEach(([i,a])=>{Wt(a,r,i,t)}),r},Wt=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:zn(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(qa(o)){Wt(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,a])=>{Wt(a,zn(t,i),n,r)})})},zn=(e,t)=>{let n=e;return t.split(cn).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},qa=e=>e.isThemeGetter,Za=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,s])=>[t+a,s])):i);return[n,o]}):e,Qa=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=r.get(i))!==void 0)return o(i,a),a},set(i,a){n.has(i)?n.set(i,a):o(i,a)}}},ao="!",Ja=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,a=s=>{const u=[];let l=0,d=0,f;for(let g=0;g<s.length;g++){let y=s[g];if(l===0){if(y===o&&(r||s.slice(g,g+i)===t)){u.push(s.slice(d,g)),d=g+i;continue}if(y==="/"){f=g;continue}}y==="["?l++:y==="]"&&l--}const h=u.length===0?s:s.substring(d),m=h.startsWith(ao),v=m?h.substring(1):h,p=f&&f>d?f-d:void 0;return{modifiers:u,hasImportantModifier:m,baseClassName:v,maybePostfixModifierPosition:p}};return n?s=>n({className:s,parseClassName:a}):a},ec=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},tc=e=>({cache:Qa(e.cacheSize),parseClassName:Ja(e),...Ka(e)}),nc=/\s+/,rc=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],a=e.trim().split(nc);let s="";for(let u=a.length-1;u>=0;u-=1){const l=a[u],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:m}=n(l);let v=!!m,p=r(v?h.substring(0,m):h);if(!p){if(!v){s=l+(s.length>0?" "+s:s);continue}if(p=r(h),!p){s=l+(s.length>0?" "+s:s);continue}v=!1}const g=ec(d).join(":"),y=f?g+ao:g,E=y+p;if(i.includes(E))continue;i.push(E);const x=o(p,v);for(let C=0;C<x.length;++C){const A=x[C];i.push(y+A)}s=l+(s.length>0?" "+s:s)}return s};function oc(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=co(t))&&(r&&(r+=" "),r+=n);return r}const co=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=co(e[r]))&&(n&&(n+=" "),n+=t);return n};function ic(e,...t){let n,r,o,i=a;function a(u){const l=t.reduce((d,f)=>f(d),e());return n=tc(l),r=n.cache.get,o=n.cache.set,i=s,s(u)}function s(u){const l=r(u);if(l)return l;const d=rc(u,n);return o(u,d),d}return function(){return i(oc.apply(null,arguments))}}const V=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},lo=/^\[(?:([a-z-]+):)?(.+)\]$/i,sc=/^\d+\/\d+$/,ac=new Set(["px","full","screen"]),cc=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lc=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,uc=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,dc=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fc=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ue=e=>je(e)||ac.has(e)||sc.test(e),me=e=>Be(e,"length",xc),je=e=>!!e&&!Number.isNaN(Number(e)),Dt=e=>Be(e,"number",je),Ve=e=>!!e&&Number.isInteger(Number(e)),pc=e=>e.endsWith("%")&&je(e.slice(0,-1)),M=e=>lo.test(e),he=e=>cc.test(e),mc=new Set(["length","size","percentage"]),hc=e=>Be(e,mc,uo),gc=e=>Be(e,"position",uo),vc=new Set(["image","url"]),bc=e=>Be(e,vc,Cc),yc=e=>Be(e,"",wc),Ue=()=>!0,Be=(e,t,n)=>{const r=lo.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},xc=e=>lc.test(e)&&!uc.test(e),uo=()=>!1,wc=e=>dc.test(e),Cc=e=>fc.test(e),Ec=()=>{const e=V("colors"),t=V("spacing"),n=V("blur"),r=V("brightness"),o=V("borderColor"),i=V("borderRadius"),a=V("borderSpacing"),s=V("borderWidth"),u=V("contrast"),l=V("grayscale"),d=V("hueRotate"),f=V("invert"),h=V("gap"),m=V("gradientColorStops"),v=V("gradientColorStopPositions"),p=V("inset"),g=V("margin"),y=V("opacity"),E=V("padding"),x=V("saturate"),C=V("scale"),A=V("sepia"),R=V("skew"),S=V("space"),I=V("translate"),_=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",M,t],O=()=>[M,t],B=()=>["",ue,me],T=()=>["auto",je,M],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],N=()=>["start","end","center","between","around","evenly","stretch"],H=()=>["","0",M],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[je,M];return{cacheSize:500,separator:":",theme:{colors:[Ue],spacing:[ue,me],blur:["none","",he,M],brightness:q(),borderColor:[e],borderRadius:["none","","full",he,M],borderSpacing:O(),borderWidth:B(),contrast:q(),grayscale:H(),hueRotate:q(),invert:H(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[pc,me],inset:F(),margin:F(),opacity:q(),padding:O(),saturate:q(),scale:q(),sepia:H(),skew:q(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",M]}],container:["container"],columns:[{columns:[he]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...U(),M]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ve,M]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",M]}],grow:[{grow:H()}],shrink:[{shrink:H()}],order:[{order:["first","last","none",Ve,M]}],"grid-cols":[{"grid-cols":[Ue]}],"col-start-end":[{col:["auto",{span:["full",Ve,M]},M]}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":[Ue]}],"row-start-end":[{row:["auto",{span:[Ve,M]},M]}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",M]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",M]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...N()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...N(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...N(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",M,t]}],"min-w":[{"min-w":[M,t,"min","max","fit"]}],"max-w":[{"max-w":[M,t,"none","full","min","max","fit","prose",{screen:[he]},he]}],h:[{h:[M,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[M,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[M,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[M,t,"auto","min","max","fit"]}],"font-size":[{text:["base",he,me]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Dt]}],"font-family":[{font:[Ue]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",M]}],"line-clamp":[{"line-clamp":["none",je,Dt]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ue,M]}],"list-image":[{"list-image":["none",M]}],"list-style-type":[{list:["none","disc","decimal",M]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ue,me]}],"underline-offset":[{"underline-offset":["auto",ue,M]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",M]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",M]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),gc]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",hc]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},bc]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...W(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:W()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...W()]}],"outline-offset":[{"outline-offset":[ue,M]}],"outline-w":[{outline:[ue,me]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[ue,me]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",he,yc]}],"shadow-color":[{shadow:[Ue]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...$(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",he,M]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[x]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",M]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",M]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",M]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Ve,M]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",M]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",M]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",M]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ue,me,Dt]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Sc=ic(Ec);function Z(...e){return Sc(Ga(e))}const fo=({size:e=12})=>b.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[b.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),b.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),Rc=({size:e=12})=>b.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:b.jsx("polyline",{points:"20 6 9 17 4 12"})}),Ac=({size:e=14})=>b.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[b.jsx("polyline",{points:"7 15 12 20 17 15"}),b.jsx("polyline",{points:"7 9 12 4 17 9"})]}),Pc=({size:e=14})=>b.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[b.jsx("circle",{cx:"11",cy:"11",r:"8"}),b.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),Oc=({label:e,onRemove:t,disabled:n})=>b.jsxs("span",{className:Z("inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5","text-xs font-medium transition-colors","border-zinc-200 bg-zinc-100 text-zinc-800","dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-200",n&&"opacity-60"),children:[e,!n&&b.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:r=>{r.stopPropagation(),t()},className:Z("ml-0.5 flex items-center justify-center rounded-sm","text-zinc-500 transition-colors","hover:bg-zinc-200 hover:text-zinc-900","dark:text-zinc-400 dark:hover:bg-zinc-700 dark:hover:text-zinc-100","focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-400"),children:b.jsx(fo,{size:10})})]}),kc=c.forwardRef(({options:e,value:t=[],onValueChange:n,placeholder:r="Select options...",searchPlaceholder:o="Search...",emptyText:i="No options found.",disabled:a=!1,maxCount:s,clearable:u=!0,className:l,contentClassName:d,"aria-label":f},h)=>{const[m,v]=c.useState(!1),p=c.useMemo(()=>new Set(t),[t]),g=c.useCallback(x=>{if(n)if(p.has(x))n(t.filter(C=>C!==x));else{if(s!==void 0&&t.length>=s)return;n([...t,x])}},[t,p,n,s]),y=c.useMemo(()=>e.filter(x=>p.has(x.value)),[e,p]),E=t.length>0;return b.jsxs(ia,{open:m,onOpenChange:v,children:[b.jsx(sa,{asChild:!0,children:b.jsxs("button",{ref:h,type:"button",role:"combobox","aria-expanded":m,"aria-haspopup":"listbox","aria-label":f??r,disabled:a,className:Z("flex min-h-9 w-full flex-wrap items-center gap-1.5","rounded-md border px-3 py-1.5 text-sm shadow-sm","transition-colors duration-150","border-zinc-200 bg-white","hover:border-zinc-300","focus:outline-none focus-visible:ring-2 focus-visible:ring-zinc-950","disabled:cursor-not-allowed disabled:opacity-50","dark:border-zinc-800 dark:bg-zinc-950","dark:hover:border-zinc-700","dark:focus-visible:ring-zinc-300",l),children:[E?y.map(x=>b.jsx(Oc,{label:x.label,onRemove:()=>g(x.value),disabled:a},x.value)):b.jsx("span",{className:"select-none text-zinc-400 dark:text-zinc-500",children:r}),b.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-1 pl-1",children:[E&&u&&!a&&b.jsx("span",{role:"button","aria-label":"Clear all selections",onClick:x=>{x.stopPropagation(),n?.([])},className:Z("flex items-center justify-center rounded-sm p-0.5","text-zinc-400 transition-colors","hover:bg-zinc-100 hover:text-zinc-700","dark:text-zinc-500 dark:hover:bg-zinc-800 dark:hover:text-zinc-300"),children:b.jsx(fo,{size:13})}),b.jsx("span",{className:Z("text-zinc-400 transition-transform duration-200 dark:text-zinc-500",m&&"rotate-180"),children:b.jsx(Ac,{size:14})})]})]})}),b.jsx(aa,{children:b.jsx(ca,{align:"start",sideOffset:6,className:Z("z-50 w-[var(--radix-popover-trigger-width)] min-w-48","overflow-hidden rounded-md border shadow-md","border-zinc-200 bg-white","dark:border-zinc-800 dark:bg-zinc-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=top]:slide-in-from-bottom-2",d),children:b.jsxs(Wa,{shouldFilter:!0,children:[b.jsxs("div",{className:Z("flex items-center gap-2 border-b px-3","border-zinc-100 dark:border-zinc-800"),children:[b.jsx("span",{className:"text-zinc-400 dark:text-zinc-500",children:b.jsx(Pc,{size:14})}),b.jsx(eo,{placeholder:o,className:Z("flex h-9 w-full bg-transparent py-2 text-sm outline-none","text-zinc-900 placeholder:text-zinc-400","dark:text-zinc-100 dark:placeholder:text-zinc-500")})]}),b.jsxs(to,{className:"max-h-56 overflow-y-auto overflow-x-hidden py-1",children:[b.jsx(no,{className:Z("py-6 text-center text-sm","text-zinc-500 dark:text-zinc-400"),children:i}),b.jsx(Jr,{children:e.map(x=>{const C=p.has(x.value),A=s!==void 0&&t.length>=s,R=x.disabled||!C&&A;return b.jsxs(Qr,{value:x.value,disabled:R,onSelect:()=>g(x.value),className:Z("relative flex cursor-pointer select-none items-center gap-2","rounded-sm px-2 py-1.5 text-sm outline-none","transition-colors duration-100","text-zinc-700 dark:text-zinc-300","data-[selected=true]:bg-zinc-100 data-[selected=true]:text-zinc-900","dark:data-[selected=true]:bg-zinc-800 dark:data-[selected=true]:text-zinc-100","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-40"),children:[b.jsx("span",{className:Z("flex h-4 w-4 shrink-0 items-center justify-center","rounded border transition-colors",C?"border-zinc-900 bg-zinc-900 text-white dark:border-zinc-100 dark:bg-zinc-100 dark:text-zinc-900":"border-zinc-300 dark:border-zinc-600"),children:C&&b.jsx(Rc,{size:10})}),b.jsx("span",{className:"flex-1 truncate",children:x.label})]},x.value)})})]}),(E||s!==void 0)&&b.jsxs("div",{className:Z("flex items-center justify-between","border-t px-3 py-1.5","border-zinc-100 dark:border-zinc-800"),children:[b.jsxs("span",{className:"text-xs text-zinc-400 dark:text-zinc-500",children:[t.length," selected",s!==void 0&&` / ${s} max`]}),E&&u&&b.jsx("button",{type:"button",onClick:()=>n?.([]),className:Z("text-xs underline-offset-2 transition-colors","text-zinc-400 hover:text-zinc-700 hover:underline","dark:text-zinc-500 dark:hover:text-zinc-300"),children:"Clear all"})]})]})})})]})});exports.MultiSelect=kc;
|
|
45
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return c.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Na="DialogDescriptionWarning",Ma=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Kr(Na).contentName}}.`;return c.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Da=Lr,ja=Wr,Ta=$r,za=Br,He='[cmdk-group=""]',Mt='[cmdk-group-items=""]',Ia='[cmdk-group-heading=""]',Xr='[cmdk-item=""]',In=`${Xr}:not([aria-disabled="true"])`,Wt="cmdk-item-select",Me="data-value",La=(e,t,n)=>ba(e,t,n),Yr=c.createContext(void 0),Ye=()=>c.useContext(Yr),qr=c.createContext(void 0),cn=()=>c.useContext(qr),Zr=c.createContext(void 0),Qr=c.forwardRef((e,t)=>{let n=De(()=>{var y,N;return{search:"",value:(N=(y=e.value)!=null?y:e.defaultValue)!=null?N:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=De(()=>new Set),o=De(()=>new Map),i=De(()=>new Map),a=De(()=>new Set),s=oo(e),{label:u,children:l,value:d,onValueChange:f,filter:p,shouldFilter:h,loop:b,disablePointerSelection:m=!1,vimBindings:v=!0,...x}=e,w=ae(),S=ae(),C=ae(),R=c.useRef(null),A=Ua();Ae(()=>{if(d!==void 0){let y=d.trim();n.current.value=y,E.emit()}},[d]),Ae(()=>{A(6,$)},[]);let E=c.useMemo(()=>({subscribe:y=>(a.current.add(y),()=>a.current.delete(y)),snapshot:()=>n.current,setState:(y,N,I)=>{var O,_,F,Y;if(!Object.is(n.current[y],N)){if(n.current[y]=N,y==="search")k(),z(),A(1,P);else if(y==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let K=document.getElementById(C);K?K.focus():(O=document.getElementById(w))==null||O.focus()}if(A(7,()=>{var K;n.current.selectedItemId=(K=T())==null?void 0:K.id,E.emit()}),I||A(5,$),((_=s.current)==null?void 0:_.value)!==void 0){let K=N??"";(Y=(F=s.current).onValueChange)==null||Y.call(F,K);return}}E.emit()}},emit:()=>{a.current.forEach(y=>y())}}),[]),j=c.useMemo(()=>({value:(y,N,I)=>{var O;N!==((O=i.current.get(y))==null?void 0:O.value)&&(i.current.set(y,{value:N,keywords:I}),n.current.filtered.items.set(y,L(N,I)),A(2,()=>{z(),E.emit()}))},item:(y,N)=>(r.current.add(y),N&&(o.current.has(N)?o.current.get(N).add(y):o.current.set(N,new Set([y]))),A(3,()=>{k(),z(),n.current.value||P(),E.emit()}),()=>{i.current.delete(y),r.current.delete(y),n.current.filtered.items.delete(y);let I=T();A(4,()=>{k(),I?.getAttribute("id")===y&&P(),E.emit()})}),group:y=>(o.current.has(y)||o.current.set(y,new Set),()=>{i.current.delete(y),o.current.delete(y)}),filter:()=>s.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:w,inputId:C,labelId:S,listInnerRef:R}),[]);function L(y,N){var I,O;let _=(O=(I=s.current)==null?void 0:I.filter)!=null?O:La;return y?_(y,n.current.search,N):0}function z(){if(!n.current.search||s.current.shouldFilter===!1)return;let y=n.current.filtered.items,N=[];n.current.filtered.groups.forEach(O=>{let _=o.current.get(O),F=0;_.forEach(Y=>{let K=y.get(Y);F=Math.max(K,F)}),N.push([O,F])});let I=R.current;G().sort((O,_)=>{var F,Y;let K=O.getAttribute("id"),Pe=_.getAttribute("id");return((F=y.get(Pe))!=null?F:0)-((Y=y.get(K))!=null?Y:0)}).forEach(O=>{let _=O.closest(Mt);_?_.appendChild(O.parentElement===_?O:O.closest(`${Mt} > *`)):I.appendChild(O.parentElement===I?O:O.closest(`${Mt} > *`))}),N.sort((O,_)=>_[1]-O[1]).forEach(O=>{var _;let F=(_=R.current)==null?void 0:_.querySelector(`${He}[${Me}="${encodeURIComponent(O[0])}"]`);F?.parentElement.appendChild(F)})}function P(){let y=G().find(I=>I.getAttribute("aria-disabled")!=="true"),N=y?.getAttribute(Me);E.setState("value",N||void 0)}function k(){var y,N,I,O;if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let _=0;for(let F of r.current){let Y=(N=(y=i.current.get(F))==null?void 0:y.value)!=null?N:"",K=(O=(I=i.current.get(F))==null?void 0:I.keywords)!=null?O:[],Pe=L(Y,K);n.current.filtered.items.set(F,Pe),Pe>0&&_++}for(let[F,Y]of o.current)for(let K of Y)if(n.current.filtered.items.get(K)>0){n.current.filtered.groups.add(F);break}n.current.filtered.count=_}function $(){var y,N,I;let O=T();O&&(((y=O.parentElement)==null?void 0:y.firstChild)===O&&((I=(N=O.closest(He))==null?void 0:N.querySelector(Ia))==null||I.scrollIntoView({block:"nearest"})),O.scrollIntoView({block:"nearest"}))}function T(){var y;return(y=R.current)==null?void 0:y.querySelector(`${Xr}[aria-selected="true"]`)}function G(){var y;return Array.from(((y=R.current)==null?void 0:y.querySelectorAll(In))||[])}function W(y){let N=G()[y];N&&E.setState("value",N.getAttribute(Me))}function B(y){var N;let I=T(),O=G(),_=O.findIndex(Y=>Y===I),F=O[_+y];(N=s.current)!=null&&N.loop&&(F=_+y<0?O[O.length-1]:_+y===O.length?O[0]:O[_+y]),F&&E.setState("value",F.getAttribute(Me))}function M(y){let N=T(),I=N?.closest(He),O;for(;I&&!O;)I=y>0?Ba(I,He):Ha(I,He),O=I?.querySelector(In);O?E.setState("value",O.getAttribute(Me)):B(y)}let H=()=>W(G().length-1),X=y=>{y.preventDefault(),y.metaKey?H():y.altKey?M(1):B(1)},q=y=>{y.preventDefault(),y.metaKey?W(0):y.altKey?M(-1):B(-1)};return c.createElement(V.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:y=>{var N;(N=x.onKeyDown)==null||N.call(x,y);let I=y.nativeEvent.isComposing||y.keyCode===229;if(!(y.defaultPrevented||I))switch(y.key){case"n":case"j":{v&&y.ctrlKey&&X(y);break}case"ArrowDown":{X(y);break}case"p":case"k":{v&&y.ctrlKey&&q(y);break}case"ArrowUp":{q(y);break}case"Home":{y.preventDefault(),W(0);break}case"End":{y.preventDefault(),H();break}case"Enter":{y.preventDefault();let O=T();if(O){let _=new Event(Wt);O.dispatchEvent(_)}}}}},c.createElement("label",{"cmdk-label":"",htmlFor:j.inputId,id:j.labelId,style:Va},u),bt(e,y=>c.createElement(qr.Provider,{value:E},c.createElement(Yr.Provider,{value:j},y))))}),Jr=c.forwardRef((e,t)=>{var n,r;let o=ae(),i=c.useRef(null),a=c.useContext(Zr),s=Ye(),u=oo(e),l=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:a?.forceMount;Ae(()=>{if(!l)return s.item(o,a?.id)},[l]);let d=io(o,i,[e.value,e.children,i],e.keywords),f=cn(),p=ye(A=>A.value&&A.value===d.current),h=ye(A=>l||s.filter()===!1?!0:A.search?A.filtered.items.get(o)>0:!0);c.useEffect(()=>{let A=i.current;if(!(!A||e.disabled))return A.addEventListener(Wt,b),()=>A.removeEventListener(Wt,b)},[h,e.onSelect,e.disabled]);function b(){var A,E;m(),(E=(A=u.current).onSelect)==null||E.call(A,d.current)}function m(){f.setState("value",d.current,!0)}if(!h)return null;let{disabled:v,value:x,onSelect:w,forceMount:S,keywords:C,...R}=e;return c.createElement(V.div,{ref:Ee(i,t),...R,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!p,"data-disabled":!!v,"data-selected":!!p,onPointerMove:v||s.getDisablePointerSelection()?void 0:m,onClick:v?void 0:b},e.children)}),eo=c.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...i}=e,a=ae(),s=c.useRef(null),u=c.useRef(null),l=ae(),d=Ye(),f=ye(h=>o||d.filter()===!1?!0:h.search?h.filtered.groups.has(a):!0);Ae(()=>d.group(a),[]),io(a,s,[e.value,e.heading,u]);let p=c.useMemo(()=>({id:a,forceMount:o}),[o]);return c.createElement(V.div,{ref:Ee(s,t),...i,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&c.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:l},n),bt(e,h=>c.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?l:void 0},c.createElement(Zr.Provider,{value:p},h))))}),_a=c.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=c.useRef(null),i=ye(a=>!a.search);return!n&&!i?null:c.createElement(V.div,{ref:Ee(o,t),...r,"cmdk-separator":"",role:"separator"})}),to=c.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=cn(),a=ye(l=>l.search),s=ye(l=>l.selectedItemId),u=Ye();return c.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),c.createElement(V.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":s,id:u.inputId,type:"text",value:o?e.value:a,onChange:l=>{o||i.setState("search",l.target.value),n?.(l.target.value)}})}),no=c.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,i=c.useRef(null),a=c.useRef(null),s=ye(l=>l.selectedItemId),u=Ye();return c.useEffect(()=>{if(a.current&&i.current){let l=a.current,d=i.current,f,p=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let h=l.offsetHeight;d.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return p.observe(l),()=>{cancelAnimationFrame(f),p.unobserve(l)}}},[]),c.createElement(V.div,{ref:Ee(i,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:u.listId},bt(e,l=>c.createElement("div",{ref:Ee(a,u.listInnerRef),"cmdk-list-sizer":""},l)))}),Fa=c.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:a,...s}=e;return c.createElement(Da,{open:n,onOpenChange:r},c.createElement(ja,{container:a},c.createElement(Ta,{"cmdk-overlay":"",className:o}),c.createElement(za,{"aria-label":e.label,"cmdk-dialog":"",className:i},c.createElement(Qr,{ref:t,...s}))))}),ro=c.forwardRef((e,t)=>ye(n=>n.filtered.count===0)?c.createElement(V.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Wa=c.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...i}=e;return c.createElement(V.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},bt(e,a=>c.createElement("div",{"aria-hidden":!0},a)))}),$a=Object.assign(Qr,{List:no,Item:Jr,Input:to,Group:eo,Separator:_a,Dialog:Fa,Empty:ro,Loading:Wa});function Ba(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Ha(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function oo(e){let t=c.useRef(e);return Ae(()=>{t.current=e}),t}var Ae=typeof window>"u"?c.useEffect:c.useLayoutEffect;function De(e){let t=c.useRef();return t.current===void 0&&(t.current=e()),t}function ye(e){let t=cn(),n=()=>e(t.snapshot());return c.useSyncExternalStore(t.subscribe,n,n)}function io(e,t,n,r=[]){let o=c.useRef(),i=Ye();return Ae(()=>{var a;let s=(()=>{var l;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(l=d.current.textContent)==null?void 0:l.trim():o.current}})(),u=r.map(l=>l.trim());i.value(e,s,u),(a=t.current)==null||a.setAttribute(Me,s),o.current=s}),o}var Ua=()=>{let[e,t]=c.useState(),n=De(()=>new Map);return Ae(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function Ga(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function bt({asChild:e,children:t},n){return e&&c.isValidElement(t)?c.cloneElement(Ga(t),{ref:t.ref},n(t.props.children)):n(t)}var Va={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function so(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=so(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ka(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=so(e))&&(r&&(r+=" "),r+=t);return r}const ln="-",Xa=e=>{const t=qa(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const s=a.split(ln);return s[0]===""&&s.length!==1&&s.shift(),ao(s,t)||Ya(a)},getConflictingClassGroupIds:(a,s)=>{const u=n[a]||[];return s&&r[a]?[...u,...r[a]]:u}}},ao=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?ao(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(ln);return t.validators.find(({validator:a})=>a(i))?.classGroupId},Ln=/^\[(.+)\]$/,Ya=e=>{if(Ln.test(e)){const t=Ln.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},qa=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Qa(Object.entries(e.classGroups),n).forEach(([i,a])=>{$t(a,r,i,t)}),r},$t=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:_n(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(Za(o)){$t(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,a])=>{$t(a,_n(t,i),n,r)})})},_n=(e,t)=>{let n=e;return t.split(ln).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Za=e=>e.isThemeGetter,Qa=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,s])=>[t+a,s])):i);return[n,o]}):e,Ja=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=r.get(i))!==void 0)return o(i,a),a},set(i,a){n.has(i)?n.set(i,a):o(i,a)}}},co="!",ec=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,a=s=>{const u=[];let l=0,d=0,f;for(let v=0;v<s.length;v++){let x=s[v];if(l===0){if(x===o&&(r||s.slice(v,v+i)===t)){u.push(s.slice(d,v)),d=v+i;continue}if(x==="/"){f=v;continue}}x==="["?l++:x==="]"&&l--}const p=u.length===0?s:s.substring(d),h=p.startsWith(co),b=h?p.substring(1):p,m=f&&f>d?f-d:void 0;return{modifiers:u,hasImportantModifier:h,baseClassName:b,maybePostfixModifierPosition:m}};return n?s=>n({className:s,parseClassName:a}):a},tc=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},nc=e=>({cache:Ja(e.cacheSize),parseClassName:ec(e),...Xa(e)}),rc=/\s+/,oc=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],a=e.trim().split(rc);let s="";for(let u=a.length-1;u>=0;u-=1){const l=a[u],{modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}=n(l);let b=!!h,m=r(b?p.substring(0,h):p);if(!m){if(!b){s=l+(s.length>0?" "+s:s);continue}if(m=r(p),!m){s=l+(s.length>0?" "+s:s);continue}b=!1}const v=tc(d).join(":"),x=f?v+co:v,w=x+m;if(i.includes(w))continue;i.push(w);const S=o(m,b);for(let C=0;C<S.length;++C){const R=S[C];i.push(x+R)}s=l+(s.length>0?" "+s:s)}return s};function ic(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=lo(t))&&(r&&(r+=" "),r+=n);return r}const lo=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=lo(e[r]))&&(n&&(n+=" "),n+=t);return n};function sc(e,...t){let n,r,o,i=a;function a(u){const l=t.reduce((d,f)=>f(d),e());return n=nc(l),r=n.cache.get,o=n.cache.set,i=s,s(u)}function s(u){const l=r(u);if(l)return l;const d=oc(u,n);return o(u,d),d}return function(){return i(ic.apply(null,arguments))}}const U=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},uo=/^\[(?:([a-z-]+):)?(.+)\]$/i,ac=/^\d+\/\d+$/,cc=new Set(["px","full","screen"]),lc=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,uc=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,dc=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fc=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pc=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ue=e=>ze(e)||cc.has(e)||ac.test(e),me=e=>Be(e,"length",wc),ze=e=>!!e&&!Number.isNaN(Number(e)),Dt=e=>Be(e,"number",ze),Ue=e=>!!e&&Number.isInteger(Number(e)),mc=e=>e.endsWith("%")&&ze(e.slice(0,-1)),D=e=>uo.test(e),he=e=>lc.test(e),hc=new Set(["length","size","percentage"]),gc=e=>Be(e,hc,fo),vc=e=>Be(e,"position",fo),bc=new Set(["image","url"]),xc=e=>Be(e,bc,Ec),yc=e=>Be(e,"",Cc),Ge=()=>!0,Be=(e,t,n)=>{const r=uo.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},wc=e=>uc.test(e)&&!dc.test(e),fo=()=>!1,Cc=e=>fc.test(e),Ec=e=>pc.test(e),Sc=()=>{const e=U("colors"),t=U("spacing"),n=U("blur"),r=U("brightness"),o=U("borderColor"),i=U("borderRadius"),a=U("borderSpacing"),s=U("borderWidth"),u=U("contrast"),l=U("grayscale"),d=U("hueRotate"),f=U("invert"),p=U("gap"),h=U("gradientColorStops"),b=U("gradientColorStopPositions"),m=U("inset"),v=U("margin"),x=U("opacity"),w=U("padding"),S=U("saturate"),C=U("scale"),R=U("sepia"),A=U("skew"),E=U("space"),j=U("translate"),L=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",D,t],k=()=>[D,t],$=()=>["",ue,me],T=()=>["auto",ze,D],G=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],H=()=>["","0",D],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[ze,D];return{cacheSize:500,separator:":",theme:{colors:[Ge],spacing:[ue,me],blur:["none","",he,D],brightness:q(),borderColor:[e],borderRadius:["none","","full",he,D],borderSpacing:k(),borderWidth:$(),contrast:q(),grayscale:H(),hueRotate:q(),invert:H(),gap:k(),gradientColorStops:[e],gradientColorStopPositions:[mc,me],inset:P(),margin:P(),opacity:q(),padding:k(),saturate:q(),scale:q(),sepia:H(),skew:q(),space:k(),translate:k()},classGroups:{aspect:[{aspect:["auto","square","video",D]}],container:["container"],columns:[{columns:[he]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...G(),D]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ue,D]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",D]}],grow:[{grow:H()}],shrink:[{shrink:H()}],order:[{order:["first","last","none",Ue,D]}],"grid-cols":[{"grid-cols":[Ge]}],"col-start-end":[{col:["auto",{span:["full",Ue,D]},D]}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":[Ge]}],"row-start-end":[{row:["auto",{span:[Ue,D]},D]}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",D]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",D]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",D,t]}],"min-w":[{"min-w":[D,t,"min","max","fit"]}],"max-w":[{"max-w":[D,t,"none","full","min","max","fit","prose",{screen:[he]},he]}],h:[{h:[D,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[D,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[D,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[D,t,"auto","min","max","fit"]}],"font-size":[{text:["base",he,me]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Dt]}],"font-family":[{font:[Ge]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",D]}],"line-clamp":[{"line-clamp":["none",ze,Dt]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ue,D]}],"list-image":[{"list-image":["none",D]}],"list-style-type":[{list:["none","disc","decimal",D]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ue,me]}],"underline-offset":[{"underline-offset":["auto",ue,D]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",D]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",D]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...G(),vc]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",gc]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},xc]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...W(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:W()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...W()]}],"outline-offset":[{"outline-offset":[ue,D]}],"outline-w":[{outline:[ue,me]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[ue,me]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",he,yc]}],"shadow-color":[{shadow:[Ge]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",he,D]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[S]}],sepia:[{sepia:[R]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[R]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",D]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",D]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",D]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Ue,D]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",D]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",D]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",D]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ue,me,Dt]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Rc=sc(Sc);function Z(...e){return Rc(Ka(e))}const jt=({size:e=12})=>g.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:g.jsx("polyline",{points:"20 6 9 17 4 12"})}),Ac=({size:e=14})=>g.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[g.jsx("polyline",{points:"7 15 12 20 17 15"}),g.jsx("polyline",{points:"7 9 12 4 17 9"})]}),Pc=({size:e=14})=>g.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[g.jsx("circle",{cx:"11",cy:"11",r:"8"}),g.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),kc=({size:e=14})=>g.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{animation:"spin 0.75s linear infinite"},children:[g.jsx("style",{children:"@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }"}),g.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})]}),po=({size:e=12})=>g.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[g.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),g.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),Oc=({label:e,onRemove:t,disabled:n})=>g.jsxs("span",{className:Z("inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5","text-xs font-medium transition-colors","border-zinc-200 bg-zinc-100 text-zinc-800","dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-200",n&&"opacity-60"),children:[e,!n&&g.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:r=>{r.stopPropagation(),t()},className:Z("ml-0.5 flex items-center justify-center rounded-sm","text-zinc-500 transition-colors","hover:bg-zinc-200 hover:text-zinc-900","dark:text-zinc-400 dark:hover:bg-zinc-700 dark:hover:text-zinc-100","focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-400"),children:g.jsx(po,{size:10})})]}),Nc=c.forwardRef(({options:e,value:t=[],onValueChange:n,placeholder:r="Select options...",searchPlaceholder:o="Search...",emptyText:i="No options found.",disabled:a=!1,maxCount:s,clearable:u=!0,className:l,contentClassName:d,"aria-label":f,mode:p="multi",showSelectAll:h=!1,loading:b=!1},m)=>{const[v,x]=c.useState(!1),w=c.useMemo(()=>new Set(t),[t]),S=c.useCallback(P=>{if(n){if(p==="single"){w.has(P)?n([]):n([P]),x(!1);return}if(w.has(P))n(t.filter(k=>k!==P));else{if(s!==void 0&&t.length>=s)return;n([...t,P])}}},[t,w,n,s,p]),C=c.useMemo(()=>e.filter(P=>w.has(P.value)),[e,w]),R=t.length>0,A=p==="multi"&&(R||s!==void 0),E=c.useMemo(()=>e.filter(P=>!P.disabled).map(P=>P.value),[e]),j=E.length>0&&E.every(P=>w.has(P)),L=!j&&E.some(P=>w.has(P)),z=c.useCallback(()=>{if(n)if(j)n([]);else{const P=s!==void 0?E.slice(0,s):E;n(P)}},[j,E,n,s]);return g.jsxs(sa,{open:v,onOpenChange:x,children:[g.jsx(aa,{asChild:!0,children:g.jsxs("button",{ref:m,type:"button",role:"combobox","aria-expanded":v,"aria-haspopup":"listbox","aria-label":f??r,disabled:a,className:Z("flex min-h-9 w-full flex-wrap items-center gap-1.5","rounded-md border px-3 py-1.5 text-sm shadow-sm","transition-colors duration-150","border-zinc-200 bg-white","hover:border-zinc-300","focus:outline-none focus-visible:ring-2 focus-visible:ring-zinc-950","disabled:cursor-not-allowed disabled:opacity-50","dark:border-zinc-800 dark:bg-zinc-950","dark:hover:border-zinc-700","dark:focus-visible:ring-zinc-300",l),children:[R?p==="single"?g.jsx("span",{className:"truncate text-zinc-900 dark:text-zinc-100",children:C[0]?.label}):C.map(P=>g.jsx(Oc,{label:P.label,onRemove:()=>S(P.value),disabled:a},P.value)):g.jsx("span",{className:"select-none text-zinc-400 dark:text-zinc-500",children:r}),g.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-1 pl-1",children:[R&&u&&!a&&g.jsx("span",{role:"button","aria-label":"Clear selection",onClick:P=>{P.stopPropagation(),n?.([])},className:Z("flex items-center justify-center rounded-sm p-0.5","text-zinc-400 transition-colors","hover:bg-zinc-100 hover:text-zinc-700","dark:text-zinc-500 dark:hover:bg-zinc-800 dark:hover:text-zinc-300"),children:g.jsx(po,{size:13})}),g.jsx("span",{className:Z("text-zinc-400 transition-transform duration-200 dark:text-zinc-500",v&&"rotate-180"),children:g.jsx(Ac,{size:14})})]})]})}),g.jsx(ca,{children:g.jsx(la,{align:"start",sideOffset:6,className:Z("z-50 w-(--radix-popover-trigger-width) min-w-48","overflow-hidden rounded-md border shadow-md","border-zinc-200 bg-white","dark:border-zinc-800 dark:bg-zinc-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=top]:slide-in-from-bottom-2",d),children:g.jsxs($a,{shouldFilter:!0,children:[g.jsxs("div",{className:Z("flex items-center gap-2 border-b px-3","border-zinc-100 dark:border-zinc-800"),children:[g.jsx("span",{className:"text-zinc-400 dark:text-zinc-500",children:g.jsx(Pc,{size:14})}),g.jsx(to,{placeholder:o,disabled:b,className:Z("flex h-9 w-full bg-transparent py-2 text-sm outline-none","text-zinc-900 placeholder:text-zinc-400","dark:text-zinc-100 dark:placeholder:text-zinc-500")}),b&&g.jsx("span",{className:"text-zinc-400 dark:text-zinc-500",children:g.jsx(kc,{size:14})})]}),g.jsxs(no,{className:"max-h-56 overflow-y-auto overflow-x-hidden py-1",children:[b?g.jsx("div",{className:"py-6 text-center text-sm text-zinc-500 dark:text-zinc-400",children:"Loading options..."}):g.jsx(ro,{className:Z("py-6 text-center text-sm","text-zinc-500 dark:text-zinc-400"),children:i}),g.jsxs(eo,{children:[p==="multi"&&h&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{role:"button",onClick:z,className:Z("relative flex cursor-pointer select-none items-center gap-2","rounded-md mx-1 px-3 py-2 text-sm outline-none","transition-colors duration-100","text-zinc-700 dark:text-zinc-300","hover:bg-zinc-100 hover:text-zinc-900","dark:hover:bg-zinc-800 dark:hover:text-zinc-100"),children:[g.jsxs("span",{className:Z("flex h-4 w-4 shrink-0 items-center justify-center rounded border transition-colors",j||L?"border-zinc-900 bg-zinc-900 text-white dark:border-zinc-100 dark:bg-zinc-100 dark:text-zinc-900":"border-zinc-300 dark:border-zinc-600"),children:[j&&g.jsx(jt,{size:10}),L&&g.jsx("span",{className:"h-0.5 w-2 rounded-full bg-white dark:bg-zinc-900"})]}),g.jsx("span",{className:"flex-1 truncate font-medium",children:"Select All"}),g.jsx("span",{className:"text-xs text-zinc-400 dark:text-zinc-500",children:j?"All selected":`${E.length} options`})]}),g.jsx("div",{className:"mx-2 my-1 border-t border-zinc-100 dark:border-zinc-800"})]}),e.map(P=>{const k=w.has(P.value),$=s!==void 0&&t.length>=s,T=P.disabled||!k&&$;return g.jsx(Jr,{value:P.value,disabled:T,onSelect:()=>S(P.value),className:Z("relative flex cursor-pointer select-none items-center gap-2","rounded-md mx-1 px-3 py-2 text-sm outline-none","transition-colors duration-100","text-zinc-700 dark:text-zinc-300","data-[selected=true]:bg-zinc-100 data-[selected=true]:text-zinc-900","dark:data-[selected=true]:bg-zinc-800 dark:data-[selected=true]:text-zinc-100","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-40"),children:p==="single"?g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center text-zinc-900 dark:text-zinc-100",children:k&&g.jsx(jt,{size:14})}),g.jsx("span",{className:"flex-1 truncate",children:P.label})]}):g.jsxs(g.Fragment,{children:[g.jsx("span",{className:Z("flex h-4 w-4 shrink-0 items-center justify-center rounded border transition-colors",k?"border-zinc-900 bg-zinc-900 text-white dark:border-zinc-100 dark:bg-zinc-100 dark:text-zinc-900":"border-zinc-300 dark:border-zinc-600"),children:k&&g.jsx(jt,{size:10})}),g.jsx("span",{className:"flex-1 truncate",children:P.label})]})},P.value)})]})]}),A&&g.jsxs("div",{className:Z("flex items-center justify-between","border-t px-3 py-1.5","border-zinc-100 dark:border-zinc-800"),children:[g.jsxs("span",{className:"text-xs text-zinc-400 dark:text-zinc-500",children:[t.length," selected",s!==void 0&&` / ${s} max`]}),R&&u&&g.jsx("button",{type:"button",onClick:()=>n?.([]),className:Z("text-xs underline-offset-2 transition-colors","text-zinc-400 hover:text-zinc-700 hover:underline","dark:text-zinc-500 dark:hover:text-zinc-300"),children:"Clear all"})]})]})})})]})});exports.MultiSelect=Nc;
|