@nqlib/nqui 0.4.4 → 0.4.6

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.
@@ -1,4 +1,4 @@
1
- "use strict";const o=require("react/jsx-runtime"),fe=require("react"),H=require("@hugeicons/react"),F=require("@hugeicons/core-free-icons"),Ye=require("./keyboard-BapbM2wb.cjs"),J=require("./utils-IjLH3w2e.cjs"),li=require("react-dom"),st=require("@radix-ui/react-slot"),ct=require("class-variance-authority"),C=require("./index-CI756mSv.cjs"),ne=require("./button-R304rhsj.cjs");function cr(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 l=cr(fe),co=cr(li);var dr=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ci="VisuallyHidden",ur=l.forwardRef((e,t)=>o.jsx(C.Primitive.span,{...e,ref:t,style:{...dr,...e.style}}));ur.displayName=ci;var fr=ur;function nn(e){const t=e+"CollectionProvider",[n,r]=C.createContextScope(t),[s,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:h,children:w}=p,v=fe.useRef(null),b=fe.useRef(new Map).current;return o.jsx(s,{scope:h,itemMap:b,collectionRef:v,children:w})};i.displayName=t;const c=e+"CollectionSlot",d=st.createSlot(c),m=fe.forwardRef((p,h)=>{const{scope:w,children:v}=p,b=a(c,w),S=C.useComposedRefs(h,b.collectionRef);return o.jsx(d,{ref:S,children:v})});m.displayName=c;const f=e+"CollectionItemSlot",u="data-radix-collection-item",x=st.createSlot(f),g=fe.forwardRef((p,h)=>{const{scope:w,children:v,...b}=p,S=fe.useRef(null),N=C.useComposedRefs(h,S),I=a(f,w);return fe.useEffect(()=>(I.itemMap.set(S,{ref:S,...b}),()=>{I.itemMap.delete(S)})),o.jsx(x,{[u]:"",ref:N,children:v})});g.displayName=f;function y(p){const h=a(e+"CollectionConsumer",p);return fe.useCallback(()=>{const v=h.collectionRef.current;if(!v)return[];const b=Array.from(v.querySelectorAll(`[${u}]`));return Array.from(h.itemMap.values()).sort((I,P)=>b.indexOf(I.ref.current)-b.indexOf(P.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:i,Slot:m,ItemSlot:g},y,r]}var on="Collapsible",[di,ui]=C.createContextScope(on),[fi,uo]=di(on),mr=l.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:a,onOpenChange:i,...c}=e,[d,m]=C.useControllableState({prop:r,defaultProp:s??!1,onChange:i,caller:on});return o.jsx(fi,{scope:n,disabled:a,contentId:C.useId(),open:d,onOpenToggle:l.useCallback(()=>m(f=>!f),[m]),children:o.jsx(C.Primitive.div,{"data-state":ho(d),"data-disabled":a?"":void 0,...c,ref:t})})});mr.displayName=on;var pr="CollapsibleTrigger",fo=l.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=uo(pr,n);return o.jsx(C.Primitive.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":ho(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:C.composeEventHandlers(e.onClick,s.onOpenToggle)})});fo.displayName=pr;var mo="CollapsibleContent",po=l.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=uo(mo,e.__scopeCollapsible);return o.jsx(C.Presence,{present:n||s.open,children:({present:a})=>o.jsx(mi,{...r,ref:t,present:a})})});po.displayName=mo;var mi=l.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...a}=e,i=uo(mo,n),[c,d]=l.useState(r),m=l.useRef(null),f=C.useComposedRefs(t,m),u=l.useRef(0),x=u.current,g=l.useRef(0),y=g.current,p=i.open||c,h=l.useRef(p),w=l.useRef(void 0);return l.useEffect(()=>{const v=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(v)},[]),C.useLayoutEffect2(()=>{const v=m.current;if(v){w.current=w.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const b=v.getBoundingClientRect();u.current=b.height,g.current=b.width,h.current||(v.style.transitionDuration=w.current.transitionDuration,v.style.animationName=w.current.animationName),d(r)}},[i.open,r]),o.jsx(C.Primitive.div,{"data-state":ho(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!p,...a,ref:f,style:{"--radix-collapsible-content-height":x?`${x}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:p&&s})});function ho(e){return e?"open":"closed"}var hr=mr,pi=fo,hi=po,xi=l.createContext(void 0);function Et(e){const t=l.useContext(xi);return e||t||"ltr"}function rn(e){const t=l.useRef({value:e,previous:e});return l.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function sn(e){const[t,n]=l.useState(void 0);return C.useLayoutEffect2(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let i,c;if("borderBoxSize"in a){const d=a.borderBoxSize,m=Array.isArray(d)?d[0]:d;i=m.inlineSize,c=m.blockSize}else i=e.offsetWidth,c=e.offsetHeight;n({width:i,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const gi=["top","right","bottom","left"],De=Math.min,be=Math.max,Yt=Math.round,$t=Math.floor,Pe=e=>({x:e,y:e}),vi={left:"right",right:"left",bottom:"top",top:"bottom"},bi={start:"end",end:"start"};function zn(e,t,n){return be(e,De(t,n))}function Ae(e,t){return typeof e=="function"?e(t):e}function $e(e){return e.split("-")[0]}function dt(e){return e.split("-")[1]}function xo(e){return e==="x"?"y":"x"}function go(e){return e==="y"?"height":"width"}const wi=new Set(["top","bottom"]);function Re(e){return wi.has($e(e))?"y":"x"}function vo(e){return xo(Re(e))}function yi(e,t,n){n===void 0&&(n=!1);const r=dt(e),s=vo(e),a=go(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Xt(i)),[i,Xt(i)]}function Ci(e){const t=Xt(e);return[Vn(e),t,Vn(t)]}function Vn(e){return e.replace(/start|end/g,t=>bi[t])}const Wo=["left","right"],Uo=["right","left"],Si=["top","bottom"],Ni=["bottom","top"];function ji(e,t,n){switch(e){case"top":case"bottom":return n?t?Uo:Wo:t?Wo:Uo;case"left":case"right":return t?Si:Ni;default:return[]}}function Ei(e,t,n,r){const s=dt(e);let a=ji($e(e),n==="start",r);return s&&(a=a.map(i=>i+"-"+s),t&&(a=a.concat(a.map(Vn)))),a}function Xt(e){return e.replace(/left|right|bottom|top/g,t=>vi[t])}function Ri(e){return{top:0,right:0,bottom:0,left:0,...e}}function xr(e){return typeof e!="number"?Ri(e):{top:e,right:e,bottom:e,left:e}}function Kt(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Yo(e,t,n){let{reference:r,floating:s}=e;const a=Re(t),i=vo(t),c=go(i),d=$e(t),m=a==="y",f=r.x+r.width/2-s.width/2,u=r.y+r.height/2-s.height/2,x=r[c]/2-s[c]/2;let g;switch(d){case"top":g={x:f,y:r.y-s.height};break;case"bottom":g={x:f,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:u};break;case"left":g={x:r.x-s.width,y:u};break;default:g={x:r.x,y:r.y}}switch(dt(t)){case"start":g[i]-=x*(n&&m?-1:1);break;case"end":g[i]+=x*(n&&m?-1:1);break}return g}const Pi=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:i}=n,c=a.filter(Boolean),d=await(i.isRTL==null?void 0:i.isRTL(t));let m=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:f,y:u}=Yo(m,r,d),x=r,g={},y=0;for(let p=0;p<c.length;p++){const{name:h,fn:w}=c[p],{x:v,y:b,data:S,reset:N}=await w({x:f,y:u,initialPlacement:r,placement:x,strategy:s,middlewareData:g,rects:m,platform:i,elements:{reference:e,floating:t}});f=v??f,u=b??u,g={...g,[h]:{...g[h],...S}},N&&y<=50&&(y++,typeof N=="object"&&(N.placement&&(x=N.placement),N.rects&&(m=N.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):N.rects),{x:f,y:u}=Yo(m,x,d)),p=-1)}return{x:f,y:u,placement:x,strategy:s,middlewareData:g}};async function Ct(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:i,elements:c,strategy:d}=e,{boundary:m="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:x=!1,padding:g=0}=Ae(t,e),y=xr(g),h=c[x?u==="floating"?"reference":"floating":u],w=Kt(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(h)))==null||n?h:h.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:m,rootBoundary:f,strategy:d})),v=u==="floating"?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating)),S=await(a.isElement==null?void 0:a.isElement(b))?await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1}:{x:1,y:1},N=Kt(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:v,offsetParent:b,strategy:d}):v);return{top:(w.top-N.top+y.top)/S.y,bottom:(N.bottom-w.bottom+y.bottom)/S.y,left:(w.left-N.left+y.left)/S.x,right:(N.right-w.right+y.right)/S.x}}const Ti=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:i,elements:c,middlewareData:d}=t,{element:m,padding:f=0}=Ae(e,t)||{};if(m==null)return{};const u=xr(f),x={x:n,y:r},g=vo(s),y=go(g),p=await i.getDimensions(m),h=g==="y",w=h?"top":"left",v=h?"bottom":"right",b=h?"clientHeight":"clientWidth",S=a.reference[y]+a.reference[g]-x[g]-a.floating[y],N=x[g]-a.reference[g],I=await(i.getOffsetParent==null?void 0:i.getOffsetParent(m));let P=I?I[b]:0;(!P||!await(i.isElement==null?void 0:i.isElement(I)))&&(P=c.floating[b]||a.floating[y]);const E=S/2-N/2,_=P/2-p[y]/2-1,A=De(u[w],_),M=De(u[v],_),z=A,V=P-p[y]-M,B=P/2-p[y]/2+E,U=zn(z,B,V),O=!d.arrow&&dt(s)!=null&&B!==U&&a.reference[y]/2-(B<z?A:M)-p[y]/2<0,X=O?B<z?B-z:B-V:0;return{[g]:x[g]+X,data:{[g]:U,centerOffset:B-U-X,...O&&{alignmentOffset:X}},reset:O}}}),Ii=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:a,rects:i,initialPlacement:c,platform:d,elements:m}=t,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:x,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:p=!0,...h}=Ae(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const w=$e(s),v=Re(c),b=$e(c)===c,S=await(d.isRTL==null?void 0:d.isRTL(m.floating)),N=x||(b||!p?[Xt(c)]:Ci(c)),I=y!=="none";!x&&I&&N.push(...Ei(c,p,y,S));const P=[c,...N],E=await Ct(t,h),_=[];let A=((r=a.flip)==null?void 0:r.overflows)||[];if(f&&_.push(E[w]),u){const B=yi(s,i,S);_.push(E[B[0]],E[B[1]])}if(A=[...A,{placement:s,overflows:_}],!_.every(B=>B<=0)){var M,z;const B=(((M=a.flip)==null?void 0:M.index)||0)+1,U=P[B];if(U&&(!(u==="alignment"?v!==Re(U):!1)||A.every(D=>Re(D.placement)===v?D.overflows[0]>0:!0)))return{data:{index:B,overflows:A},reset:{placement:U}};let O=(z=A.filter(X=>X.overflows[0]<=0).sort((X,D)=>X.overflows[1]-D.overflows[1])[0])==null?void 0:z.placement;if(!O)switch(g){case"bestFit":{var V;const X=(V=A.filter(D=>{if(I){const G=Re(D.placement);return G===v||G==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(G=>G>0).reduce((G,Q)=>G+Q,0)]).sort((D,G)=>D[1]-G[1])[0])==null?void 0:V[0];X&&(O=X);break}case"initialPlacement":O=c;break}if(s!==O)return{reset:{placement:O}}}return{}}}};function Xo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ko(e){return gi.some(t=>e[t]>=0)}const ki=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Ae(e,t);switch(r){case"referenceHidden":{const a=await Ct(t,{...s,elementContext:"reference"}),i=Xo(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Ko(i)}}}case"escaped":{const a=await Ct(t,{...s,altBoundary:!0}),i=Xo(a,n.floating);return{data:{escapedOffsets:i,escaped:Ko(i)}}}default:return{}}}}},gr=new Set(["left","top"]);async function Mi(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=$e(n),c=dt(n),d=Re(n)==="y",m=gr.has(i)?-1:1,f=a&&d?-1:1,u=Ae(t,e);let{mainAxis:x,crossAxis:g,alignmentAxis:y}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof y=="number"&&(g=c==="end"?y*-1:y),d?{x:g*f,y:x*m}:{x:x*m,y:g*f}}const _i=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:a,placement:i,middlewareData:c}=t,d=await Mi(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+d.x,y:a+d.y,data:{...d,placement:i}}}}},Ai=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:c={fn:h=>{let{x:w,y:v}=h;return{x:w,y:v}}},...d}=Ae(e,t),m={x:n,y:r},f=await Ct(t,d),u=Re($e(s)),x=xo(u);let g=m[x],y=m[u];if(a){const h=x==="y"?"top":"left",w=x==="y"?"bottom":"right",v=g+f[h],b=g-f[w];g=zn(v,g,b)}if(i){const h=u==="y"?"top":"left",w=u==="y"?"bottom":"right",v=y+f[h],b=y-f[w];y=zn(v,y,b)}const p=c.fn({...t,[x]:g,[u]:y});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[x]:a,[u]:i}}}}}},$i=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:a,middlewareData:i}=t,{offset:c=0,mainAxis:d=!0,crossAxis:m=!0}=Ae(e,t),f={x:n,y:r},u=Re(s),x=xo(u);let g=f[x],y=f[u];const p=Ae(c,t),h=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(d){const b=x==="y"?"height":"width",S=a.reference[x]-a.floating[b]+h.mainAxis,N=a.reference[x]+a.reference[b]-h.mainAxis;g<S?g=S:g>N&&(g=N)}if(m){var w,v;const b=x==="y"?"width":"height",S=gr.has($e(s)),N=a.reference[u]-a.floating[b]+(S&&((w=i.offset)==null?void 0:w[u])||0)+(S?0:h.crossAxis),I=a.reference[u]+a.reference[b]+(S?0:((v=i.offset)==null?void 0:v[u])||0)-(S?h.crossAxis:0);y<N?y=N:y>I&&(y=I)}return{[x]:g,[u]:y}}}},Li=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:a,platform:i,elements:c}=t,{apply:d=()=>{},...m}=Ae(e,t),f=await Ct(t,m),u=$e(s),x=dt(s),g=Re(s)==="y",{width:y,height:p}=a.floating;let h,w;u==="top"||u==="bottom"?(h=u,w=x===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(w=u,h=x==="end"?"top":"bottom");const v=p-f.top-f.bottom,b=y-f.left-f.right,S=De(p-f[h],v),N=De(y-f[w],b),I=!t.middlewareData.shift;let P=S,E=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=v),I&&!x){const A=be(f.left,0),M=be(f.right,0),z=be(f.top,0),V=be(f.bottom,0);g?E=y-2*(A!==0||M!==0?A+M:be(f.left,f.right)):P=p-2*(z!==0||V!==0?z+V:be(f.top,f.bottom))}await d({...t,availableWidth:E,availableHeight:P});const _=await i.getDimensions(c.floating);return y!==_.width||p!==_.height?{reset:{rects:!0}}:{}}}};function an(){return typeof window<"u"}function ut(e){return vr(e)?(e.nodeName||"").toLowerCase():"#document"}function we(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ke(e){var t;return(t=(vr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vr(e){return an()?e instanceof Node||e instanceof we(e).Node:!1}function Ne(e){return an()?e instanceof Element||e instanceof we(e).Element:!1}function Te(e){return an()?e instanceof HTMLElement||e instanceof we(e).HTMLElement:!1}function qo(e){return!an()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof we(e).ShadowRoot}const Oi=new Set(["inline","contents"]);function Rt(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=je(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Oi.has(s)}const Di=new Set(["table","td","th"]);function Hi(e){return Di.has(ut(e))}const Fi=[":popover-open",":modal"];function ln(e){return Fi.some(t=>{try{return e.matches(t)}catch{return!1}})}const Bi=["transform","translate","scale","rotate","perspective"],zi=["transform","translate","scale","rotate","perspective","filter"],Vi=["paint","layout","strict","content"];function bo(e){const t=wo(),n=Ne(e)?je(e):e;return Bi.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||zi.some(r=>(n.willChange||"").includes(r))||Vi.some(r=>(n.contain||"").includes(r))}function Wi(e){let t=He(e);for(;Te(t)&&!at(t);){if(bo(t))return t;if(ln(t))return null;t=He(t)}return null}function wo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ui=new Set(["html","body","#document"]);function at(e){return Ui.has(ut(e))}function je(e){return we(e).getComputedStyle(e)}function cn(e){return Ne(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function He(e){if(ut(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qo(e)&&e.host||ke(e);return qo(t)?t.host:t}function br(e){const t=He(e);return at(t)?e.ownerDocument?e.ownerDocument.body:e.body:Te(t)&&Rt(t)?t:br(t)}function St(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=br(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),i=we(s);if(a){const c=Wn(i);return t.concat(i,i.visualViewport||[],Rt(s)?s:[],c&&n?St(c):[])}return t.concat(s,St(s,[],n))}function Wn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wr(e){const t=je(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Te(e),a=s?e.offsetWidth:n,i=s?e.offsetHeight:r,c=Yt(n)!==a||Yt(r)!==i;return c&&(n=a,r=i),{width:n,height:r,$:c}}function yo(e){return Ne(e)?e:e.contextElement}function rt(e){const t=yo(e);if(!Te(t))return Pe(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=wr(t);let i=(a?Yt(n.width):n.width)/r,c=(a?Yt(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Yi=Pe(0);function yr(e){const t=we(e);return!wo()||!t.visualViewport?Yi:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xi(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==we(e)?!1:t}function Ke(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=yo(e);let i=Pe(1);t&&(r?Ne(r)&&(i=rt(r)):i=rt(e));const c=Xi(a,n,r)?yr(a):Pe(0);let d=(s.left+c.x)/i.x,m=(s.top+c.y)/i.y,f=s.width/i.x,u=s.height/i.y;if(a){const x=we(a),g=r&&Ne(r)?we(r):r;let y=x,p=Wn(y);for(;p&&r&&g!==y;){const h=rt(p),w=p.getBoundingClientRect(),v=je(p),b=w.left+(p.clientLeft+parseFloat(v.paddingLeft))*h.x,S=w.top+(p.clientTop+parseFloat(v.paddingTop))*h.y;d*=h.x,m*=h.y,f*=h.x,u*=h.y,d+=b,m+=S,y=we(p),p=Wn(y)}}return Kt({width:f,height:u,x:d,y:m})}function dn(e,t){const n=cn(e).scrollLeft;return t?t.left+n:Ke(ke(e)).left+n}function Cr(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-dn(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function Ki(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",i=ke(r),c=t?ln(t.floating):!1;if(r===i||c&&a)return n;let d={scrollLeft:0,scrollTop:0},m=Pe(1);const f=Pe(0),u=Te(r);if((u||!u&&!a)&&((ut(r)!=="body"||Rt(i))&&(d=cn(r)),Te(r))){const g=Ke(r);m=rt(r),f.x=g.x+r.clientLeft,f.y=g.y+r.clientTop}const x=i&&!u&&!a?Cr(i,d):Pe(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-d.scrollLeft*m.x+f.x+x.x,y:n.y*m.y-d.scrollTop*m.y+f.y+x.y}}function qi(e){return Array.from(e.getClientRects())}function Gi(e){const t=ke(e),n=cn(e),r=e.ownerDocument.body,s=be(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=be(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+dn(e);const c=-n.scrollTop;return je(r).direction==="rtl"&&(i+=be(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:i,y:c}}const Go=25;function Ji(e,t){const n=we(e),r=ke(e),s=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,c=0,d=0;if(s){a=s.width,i=s.height;const f=wo();(!f||f&&t==="fixed")&&(c=s.offsetLeft,d=s.offsetTop)}const m=dn(r);if(m<=0){const f=r.ownerDocument,u=f.body,x=getComputedStyle(u),g=f.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,y=Math.abs(r.clientWidth-u.clientWidth-g);y<=Go&&(a-=y)}else m<=Go&&(a+=m);return{width:a,height:i,x:c,y:d}}const Zi=new Set(["absolute","fixed"]);function Qi(e,t){const n=Ke(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=Te(e)?rt(e):Pe(1),i=e.clientWidth*a.x,c=e.clientHeight*a.y,d=s*a.x,m=r*a.y;return{width:i,height:c,x:d,y:m}}function Jo(e,t,n){let r;if(t==="viewport")r=Ji(e,n);else if(t==="document")r=Gi(ke(e));else if(Ne(t))r=Qi(t,n);else{const s=yr(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Kt(r)}function Sr(e,t){const n=He(e);return n===t||!Ne(n)||at(n)?!1:je(n).position==="fixed"||Sr(n,t)}function el(e,t){const n=t.get(e);if(n)return n;let r=St(e,[],!1).filter(c=>Ne(c)&&ut(c)!=="body"),s=null;const a=je(e).position==="fixed";let i=a?He(e):e;for(;Ne(i)&&!at(i);){const c=je(i),d=bo(i);!d&&c.position==="fixed"&&(s=null),(a?!d&&!s:!d&&c.position==="static"&&!!s&&Zi.has(s.position)||Rt(i)&&!d&&Sr(e,i))?r=r.filter(f=>f!==i):s=c,i=He(i)}return t.set(e,r),r}function tl(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?ln(t)?[]:el(t,this._c):[].concat(n),r],c=i[0],d=i.reduce((m,f)=>{const u=Jo(t,f,s);return m.top=be(u.top,m.top),m.right=De(u.right,m.right),m.bottom=De(u.bottom,m.bottom),m.left=be(u.left,m.left),m},Jo(t,c,s));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function nl(e){const{width:t,height:n}=wr(e);return{width:t,height:n}}function ol(e,t,n){const r=Te(t),s=ke(t),a=n==="fixed",i=Ke(e,!0,a,t);let c={scrollLeft:0,scrollTop:0};const d=Pe(0);function m(){d.x=dn(s)}if(r||!r&&!a)if((ut(t)!=="body"||Rt(s))&&(c=cn(t)),r){const g=Ke(t,!0,a,t);d.x=g.x+t.clientLeft,d.y=g.y+t.clientTop}else s&&m();a&&!r&&s&&m();const f=s&&!r&&!a?Cr(s,c):Pe(0),u=i.left+c.scrollLeft-d.x-f.x,x=i.top+c.scrollTop-d.y-f.y;return{x:u,y:x,width:i.width,height:i.height}}function $n(e){return je(e).position==="static"}function Zo(e,t){if(!Te(e)||je(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ke(e)===n&&(n=n.ownerDocument.body),n}function Nr(e,t){const n=we(e);if(ln(e))return n;if(!Te(e)){let s=He(e);for(;s&&!at(s);){if(Ne(s)&&!$n(s))return s;s=He(s)}return n}let r=Zo(e,t);for(;r&&Hi(r)&&$n(r);)r=Zo(r,t);return r&&at(r)&&$n(r)&&!bo(r)?n:r||Wi(e)||n}const rl=async function(e){const t=this.getOffsetParent||Nr,n=this.getDimensions,r=await n(e.floating);return{reference:ol(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sl(e){return je(e).direction==="rtl"}const al={convertOffsetParentRelativeRectToViewportRelativeRect:Ki,getDocumentElement:ke,getClippingRect:tl,getOffsetParent:Nr,getElementRects:rl,getClientRects:qi,getDimensions:nl,getScale:rt,isElement:Ne,isRTL:sl};function jr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function il(e,t){let n=null,r;const s=ke(e);function a(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function i(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),a();const m=e.getBoundingClientRect(),{left:f,top:u,width:x,height:g}=m;if(c||t(),!x||!g)return;const y=$t(u),p=$t(s.clientWidth-(f+x)),h=$t(s.clientHeight-(u+g)),w=$t(f),b={rootMargin:-y+"px "+-p+"px "+-h+"px "+-w+"px",threshold:be(0,De(1,d))||1};let S=!0;function N(I){const P=I[0].intersectionRatio;if(P!==d){if(!S)return i();P?i(!1,P):r=setTimeout(()=>{i(!1,1e-7)},1e3)}P===1&&!jr(m,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(N,{...b,root:s.ownerDocument})}catch{n=new IntersectionObserver(N,b)}n.observe(e)}return i(!0),a}function ll(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,m=yo(e),f=s||a?[...m?St(m):[],...St(t)]:[];f.forEach(w=>{s&&w.addEventListener("scroll",n,{passive:!0}),a&&w.addEventListener("resize",n)});const u=m&&c?il(m,n):null;let x=-1,g=null;i&&(g=new ResizeObserver(w=>{let[v]=w;v&&v.target===m&&g&&(g.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var b;(b=g)==null||b.observe(t)})),n()}),m&&!d&&g.observe(m),g.observe(t));let y,p=d?Ke(e):null;d&&h();function h(){const w=Ke(e);p&&!jr(p,w)&&n(),p=w,y=requestAnimationFrame(h)}return n(),()=>{var w;f.forEach(v=>{s&&v.removeEventListener("scroll",n),a&&v.removeEventListener("resize",n)}),u?.(),(w=g)==null||w.disconnect(),g=null,d&&cancelAnimationFrame(y)}}const cl=_i,dl=Ai,ul=Ii,fl=Li,ml=ki,Qo=Ti,pl=$i,hl=(e,t,n)=>{const r=new Map,s={platform:al,...n},a={...s.platform,_c:r};return Pi(e,t,{...s,platform:a})};var xl=typeof document<"u",gl=function(){},Ht=xl?fe.useLayoutEffect:gl;function qt(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,s;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(!qt(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!qt(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Er(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function er(e,t){const n=Er(e);return Math.round(t*n)/n}function Ln(e){const t=l.useRef(e);return Ht(()=>{t.current=e}),t}function vl(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:i}={},transform:c=!0,whileElementsMounted:d,open:m}=e,[f,u]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,g]=l.useState(r);qt(x,r)||g(r);const[y,p]=l.useState(null),[h,w]=l.useState(null),v=l.useCallback(D=>{D!==I.current&&(I.current=D,p(D))},[]),b=l.useCallback(D=>{D!==P.current&&(P.current=D,w(D))},[]),S=a||y,N=i||h,I=l.useRef(null),P=l.useRef(null),E=l.useRef(f),_=d!=null,A=Ln(d),M=Ln(s),z=Ln(m),V=l.useCallback(()=>{if(!I.current||!P.current)return;const D={placement:t,strategy:n,middleware:x};M.current&&(D.platform=M.current),hl(I.current,P.current,D).then(G=>{const Q={...G,isPositioned:z.current!==!1};B.current&&!qt(E.current,Q)&&(E.current=Q,co.flushSync(()=>{u(Q)}))})},[x,t,n,M,z]);Ht(()=>{m===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,u(D=>({...D,isPositioned:!1})))},[m]);const B=l.useRef(!1);Ht(()=>(B.current=!0,()=>{B.current=!1}),[]),Ht(()=>{if(S&&(I.current=S),N&&(P.current=N),S&&N){if(A.current)return A.current(S,N,V);V()}},[S,N,V,A,_]);const U=l.useMemo(()=>({reference:I,floating:P,setReference:v,setFloating:b}),[v,b]),O=l.useMemo(()=>({reference:S,floating:N}),[S,N]),X=l.useMemo(()=>{const D={position:n,left:0,top:0};if(!O.floating)return D;const G=er(O.floating,f.x),Q=er(O.floating,f.y);return c?{...D,transform:"translate("+G+"px, "+Q+"px)",...Er(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:Q}},[n,c,O.floating,f.x,f.y]);return l.useMemo(()=>({...f,update:V,refs:U,elements:O,floatingStyles:X}),[f,V,U,O,X])}const bl=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Qo({element:r.current,padding:s}).fn(n):{}:r?Qo({element:r,padding:s}).fn(n):{}}}},wl=(e,t)=>({...cl(e),options:[e,t]}),yl=(e,t)=>({...dl(e),options:[e,t]}),Cl=(e,t)=>({...pl(e),options:[e,t]}),Sl=(e,t)=>({...ul(e),options:[e,t]}),Nl=(e,t)=>({...fl(e),options:[e,t]}),jl=(e,t)=>({...ml(e),options:[e,t]}),El=(e,t)=>({...bl(e),options:[e,t]});var Rl="Arrow",Rr=l.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...a}=e;return o.jsx(C.Primitive.svg,{...a,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});Rr.displayName=Rl;var Pl=Rr,Co="Popper",[Pr,Je]=C.createContextScope(Co),[Tl,Tr]=Pr(Co),Ir=e=>{const{__scopePopper:t,children:n}=e,[r,s]=l.useState(null);return o.jsx(Tl,{scope:t,anchor:r,onAnchorChange:s,children:n})};Ir.displayName=Co;var kr="PopperAnchor",Mr=l.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,a=Tr(kr,n),i=l.useRef(null),c=C.useComposedRefs(t,i),d=l.useRef(null);return l.useEffect(()=>{const m=d.current;d.current=r?.current||i.current,m!==d.current&&a.onAnchorChange(d.current)}),r?null:o.jsx(C.Primitive.div,{...s,ref:c})});Mr.displayName=kr;var So="PopperContent",[Il,kl]=Pr(So),_r=l.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:m=[],collisionPadding:f=0,sticky:u="partial",hideWhenDetached:x=!1,updatePositionStrategy:g="optimized",onPlaced:y,...p}=e,h=Tr(So,n),[w,v]=l.useState(null),b=C.useComposedRefs(t,Y=>v(Y)),[S,N]=l.useState(null),I=sn(S),P=I?.width??0,E=I?.height??0,_=r+(a!=="center"?"-"+a:""),A=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},M=Array.isArray(m)?m:[m],z=M.length>0,V={padding:A,boundary:M.filter(_l),altBoundary:z},{refs:B,floatingStyles:U,placement:O,isPositioned:X,middlewareData:D}=vl({strategy:"fixed",placement:_,whileElementsMounted:(...Y)=>ll(...Y,{animationFrame:g==="always"}),elements:{reference:h.anchor},middleware:[wl({mainAxis:s+E,alignmentAxis:i}),d&&yl({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Cl():void 0,...V}),d&&Sl({...V}),Nl({...V,apply:({elements:Y,rects:te,availableWidth:K,availableHeight:oe})=>{const{width:W,height:j}=te.reference,R=Y.floating.style;R.setProperty("--radix-popper-available-width",`${K}px`),R.setProperty("--radix-popper-available-height",`${oe}px`),R.setProperty("--radix-popper-anchor-width",`${W}px`),R.setProperty("--radix-popper-anchor-height",`${j}px`)}}),S&&El({element:S,padding:c}),Al({arrowWidth:P,arrowHeight:E}),x&&jl({strategy:"referenceHidden",...V})]}),[G,Q]=Lr(O),pe=C.useCallbackRef(y);C.useLayoutEffect2(()=>{X&&pe?.()},[X,pe]);const de=D.arrow?.x,ce=D.arrow?.y,he=D.arrow?.centerOffset!==0,[xe,ee]=l.useState();return C.useLayoutEffect2(()=>{w&&ee(window.getComputedStyle(w).zIndex)},[w]),o.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:X?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:xe,"--radix-popper-transform-origin":[D.transformOrigin?.x,D.transformOrigin?.y].join(" "),...D.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(Il,{scope:n,placedSide:G,onArrowChange:N,arrowX:de,arrowY:ce,shouldHideArrow:he,children:o.jsx(C.Primitive.div,{"data-side":G,"data-align":Q,...p,ref:b,style:{...p.style,animation:X?void 0:"none"}})})})});_r.displayName=So;var Ar="PopperArrow",Ml={top:"bottom",right:"left",bottom:"top",left:"right"},$r=l.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,a=kl(Ar,r),i=Ml[a.placedSide];return o.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:o.jsx(Pl,{...s,ref:n,style:{...s.style,display:"block"}})})});$r.displayName=Ar;function _l(e){return e!==null}var Al=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:s}=t,i=s.arrow?.centerOffset!==0,c=i?0:e.arrowWidth,d=i?0:e.arrowHeight,[m,f]=Lr(n),u={start:"0%",center:"50%",end:"100%"}[f],x=(s.arrow?.x??0)+c/2,g=(s.arrow?.y??0)+d/2;let y="",p="";return m==="bottom"?(y=i?u:`${x}px`,p=`${-d}px`):m==="top"?(y=i?u:`${x}px`,p=`${r.floating.height+d}px`):m==="right"?(y=`${-d}px`,p=i?u:`${g}px`):m==="left"&&(y=`${r.floating.width+d}px`,p=i?u:`${g}px`),{data:{x:y,y:p}}}});function Lr(e){const[t,n="center"]=e.split("-");return[t,n]}var un=Ir,Pt=Mr,fn=_r,mn=$r,On="rovingFocusGroup.onEntryFocus",$l={bubbles:!1,cancelable:!0},Tt="RovingFocusGroup",[Un,Or,Ll]=nn(Tt),[Ol,No]=C.createContextScope(Tt,[Ll]),[Dl,Hl]=Ol(Tt),Dr=l.forwardRef((e,t)=>o.jsx(Un.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(Un.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(Fl,{...e,ref:t})})}));Dr.displayName=Tt;var Fl=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:m,preventScrollOnEntryFocus:f=!1,...u}=e,x=l.useRef(null),g=C.useComposedRefs(t,x),y=Et(a),[p,h]=C.useControllableState({prop:i,defaultProp:c??null,onChange:d,caller:Tt}),[w,v]=l.useState(!1),b=C.useCallbackRef(m),S=Or(n),N=l.useRef(!1),[I,P]=l.useState(0);return l.useEffect(()=>{const E=x.current;if(E)return E.addEventListener(On,b),()=>E.removeEventListener(On,b)},[b]),o.jsx(Dl,{scope:n,orientation:r,dir:y,loop:s,currentTabStopId:p,onItemFocus:l.useCallback(E=>h(E),[h]),onItemShiftTab:l.useCallback(()=>v(!0),[]),onFocusableItemAdd:l.useCallback(()=>P(E=>E+1),[]),onFocusableItemRemove:l.useCallback(()=>P(E=>E-1),[]),children:o.jsx(C.Primitive.div,{tabIndex:w||I===0?-1:0,"data-orientation":r,...u,ref:g,style:{outline:"none",...e.style},onMouseDown:C.composeEventHandlers(e.onMouseDown,()=>{N.current=!0}),onFocus:C.composeEventHandlers(e.onFocus,E=>{const _=!N.current;if(E.target===E.currentTarget&&_&&!w){const A=new CustomEvent(On,$l);if(E.currentTarget.dispatchEvent(A),!A.defaultPrevented){const M=S().filter(O=>O.focusable),z=M.find(O=>O.active),V=M.find(O=>O.id===p),U=[z,V,...M].filter(Boolean).map(O=>O.ref.current);Br(U,f)}}N.current=!1}),onBlur:C.composeEventHandlers(e.onBlur,()=>v(!1))})})}),Hr="RovingFocusGroupItem",Fr=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:a,children:i,...c}=e,d=C.useId(),m=a||d,f=Hl(Hr,n),u=f.currentTabStopId===m,x=Or(n),{onFocusableItemAdd:g,onFocusableItemRemove:y,currentTabStopId:p}=f;return l.useEffect(()=>{if(r)return g(),()=>y()},[r,g,y]),o.jsx(Un.ItemSlot,{scope:n,id:m,focusable:r,active:s,children:o.jsx(C.Primitive.span,{tabIndex:u?0:-1,"data-orientation":f.orientation,...c,ref:t,onMouseDown:C.composeEventHandlers(e.onMouseDown,h=>{r?f.onItemFocus(m):h.preventDefault()}),onFocus:C.composeEventHandlers(e.onFocus,()=>f.onItemFocus(m)),onKeyDown:C.composeEventHandlers(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){f.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const w=Vl(h,f.orientation,f.dir);if(w!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let b=x().filter(S=>S.focusable).map(S=>S.ref.current);if(w==="last")b.reverse();else if(w==="prev"||w==="next"){w==="prev"&&b.reverse();const S=b.indexOf(h.currentTarget);b=f.loop?Wl(b,S+1):b.slice(S+1)}setTimeout(()=>Br(b))}}),children:typeof i=="function"?i({isCurrentTabStop:u,hasTabStop:p!=null}):i})})});Fr.displayName=Hr;var Bl={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function zl(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Vl(e,t,n){const r=zl(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Bl[r]}function Br(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Wl(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var zr=Dr,Vr=Fr;function Nt(e,[t,n]){return Math.min(n,Math.max(t,e))}var pn="Popover",[Wr]=C.createContextScope(pn,[Je]),It=Je(),[Ul,Be]=Wr(pn),Ur=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:i=!1}=e,c=It(t),d=l.useRef(null),[m,f]=l.useState(!1),[u,x]=C.useControllableState({prop:r,defaultProp:s??!1,onChange:a,caller:pn});return o.jsx(un,{...c,children:o.jsx(Ul,{scope:t,contentId:C.useId(),triggerRef:d,open:u,onOpenChange:x,onOpenToggle:l.useCallback(()=>x(g=>!g),[x]),hasCustomAnchor:m,onCustomAnchorAdd:l.useCallback(()=>f(!0),[]),onCustomAnchorRemove:l.useCallback(()=>f(!1),[]),modal:i,children:n})})};Ur.displayName=pn;var Yr="PopoverAnchor",Xr=l.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Be(Yr,n),a=It(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:c}=s;return l.useEffect(()=>(i(),()=>c()),[i,c]),o.jsx(Pt,{...a,...r,ref:t})});Xr.displayName=Yr;var Kr="PopoverTrigger",qr=l.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Be(Kr,n),a=It(n),i=C.useComposedRefs(t,s.triggerRef),c=o.jsx(C.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":es(s.open),...r,ref:i,onClick:C.composeEventHandlers(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:o.jsx(Pt,{asChild:!0,...a,children:c})});qr.displayName=Kr;var jo="PopoverPortal",[Yl,Xl]=Wr(jo,{forceMount:void 0}),Gr=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,a=Be(jo,t);return o.jsx(Yl,{scope:t,forceMount:n,children:o.jsx(C.Presence,{present:n||a.open,children:o.jsx(C.Portal,{asChild:!0,container:s,children:r})})})};Gr.displayName=jo;var it="PopoverContent",Jr=l.forwardRef((e,t)=>{const n=Xl(it,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,a=Be(it,e.__scopePopover);return o.jsx(C.Presence,{present:r||a.open,children:a.modal?o.jsx(ql,{...s,ref:t}):o.jsx(Gl,{...s,ref:t})})});Jr.displayName=it;var Kl=st.createSlot("PopoverContent.RemoveScroll"),ql=l.forwardRef((e,t)=>{const n=Be(it,e.__scopePopover),r=l.useRef(null),s=C.useComposedRefs(t,r),a=l.useRef(!1);return l.useEffect(()=>{const i=r.current;if(i)return C.hideOthers(i)},[]),o.jsx(C.ReactRemoveScroll,{as:Kl,allowPinchZoom:!0,children:o.jsx(Zr,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:C.composeEventHandlers(e.onCloseAutoFocus,i=>{i.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:C.composeEventHandlers(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,m=c.button===2||d;a.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:C.composeEventHandlers(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Gl=l.forwardRef((e,t)=>{const n=Be(it,e.__scopePopover),r=l.useRef(!1),s=l.useRef(!1);return o.jsx(Zr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||n.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=a.target;n.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),Zr=l.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:m,onInteractOutside:f,...u}=e,x=Be(it,n),g=It(n);return C.useFocusGuards(),o.jsx(C.FocusScope,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:o.jsx(C.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:m,onDismiss:()=>x.onOpenChange(!1),children:o.jsx(fn,{"data-state":es(x.open),role:"dialog",id:x.contentId,...g,...u,ref:t,style:{...u.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)"}})})})}),Qr="PopoverClose",Jl=l.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Be(Qr,n);return o.jsx(C.Primitive.button,{type:"button",...r,ref:t,onClick:C.composeEventHandlers(e.onClick,()=>s.onOpenChange(!1))})});Jl.displayName=Qr;var Zl="PopoverArrow",Ql=l.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=It(n);return o.jsx(mn,{...s,...r,ref:t})});Ql.displayName=Zl;function es(e){return e?"open":"closed"}var ec=Ur,tc=Xr,nc=qr,oc=Gr,rc=Jr,sc=[" ","Enter","ArrowUp","ArrowDown"],ac=[" ","Enter"],qe="Select",[hn,xn,ic]=nn(qe),[ft]=C.createContextScope(qe,[ic,Je]),gn=Je(),[lc,ze]=ft(qe),[cc,dc]=ft(qe),ts=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:a,value:i,defaultValue:c,onValueChange:d,dir:m,name:f,autoComplete:u,disabled:x,required:g,form:y}=e,p=gn(t),[h,w]=l.useState(null),[v,b]=l.useState(null),[S,N]=l.useState(!1),I=Et(m),[P,E]=C.useControllableState({prop:r,defaultProp:s??!1,onChange:a,caller:qe}),[_,A]=C.useControllableState({prop:i,defaultProp:c,onChange:d,caller:qe}),M=l.useRef(null),z=h?y||!!h.closest("form"):!0,[V,B]=l.useState(new Set),U=Array.from(V).map(O=>O.props.value).join(";");return o.jsx(un,{...p,children:o.jsxs(lc,{required:g,scope:t,trigger:h,onTriggerChange:w,valueNode:v,onValueNodeChange:b,valueNodeHasChildren:S,onValueNodeHasChildrenChange:N,contentId:C.useId(),value:_,onValueChange:A,open:P,onOpenChange:E,dir:I,triggerPointerDownPosRef:M,disabled:x,children:[o.jsx(hn.Provider,{scope:t,children:o.jsx(cc,{scope:e.__scopeSelect,onNativeOptionAdd:l.useCallback(O=>{B(X=>new Set(X).add(O))},[]),onNativeOptionRemove:l.useCallback(O=>{B(X=>{const D=new Set(X);return D.delete(O),D})},[]),children:n})}),z?o.jsxs(Es,{"aria-hidden":!0,required:g,tabIndex:-1,name:f,autoComplete:u,value:_,onChange:O=>A(O.target.value),disabled:x,form:y,children:[_===void 0?o.jsx("option",{value:""}):null,Array.from(V)]},U):null]})})};ts.displayName=qe;var ns="SelectTrigger",os=l.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,a=gn(n),i=ze(ns,n),c=i.disabled||r,d=C.useComposedRefs(t,i.onTriggerChange),m=xn(n),f=l.useRef("touch"),[u,x,g]=Ps(p=>{const h=m().filter(b=>!b.disabled),w=h.find(b=>b.value===i.value),v=Ts(h,p,w);v!==void 0&&i.onValueChange(v.value)}),y=p=>{c||(i.onOpenChange(!0),g()),p&&(i.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return o.jsx(Pt,{asChild:!0,...a,children:o.jsx(C.Primitive.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Rs(i.value)?"":void 0,...s,ref:d,onClick:C.composeEventHandlers(s.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&y(p)}),onPointerDown:C.composeEventHandlers(s.onPointerDown,p=>{f.current=p.pointerType;const h=p.target;h.hasPointerCapture(p.pointerId)&&h.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(y(p),p.preventDefault())}),onKeyDown:C.composeEventHandlers(s.onKeyDown,p=>{const h=u.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&x(p.key),!(h&&p.key===" ")&&sc.includes(p.key)&&(y(),p.preventDefault())})})})});os.displayName=ns;var rs="SelectValue",ss=l.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:a,placeholder:i="",...c}=e,d=ze(rs,n),{onValueNodeHasChildrenChange:m}=d,f=a!==void 0,u=C.useComposedRefs(t,d.onValueNodeChange);return C.useLayoutEffect2(()=>{m(f)},[m,f]),o.jsx(C.Primitive.span,{...c,ref:u,style:{pointerEvents:"none"},children:Rs(d.value)?o.jsx(o.Fragment,{children:i}):a})});ss.displayName=rs;var uc="SelectIcon",as=l.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return o.jsx(C.Primitive.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});as.displayName=uc;var fc="SelectPortal",is=e=>o.jsx(C.Portal,{asChild:!0,...e});is.displayName=fc;var Ge="SelectContent",ls=l.forwardRef((e,t)=>{const n=ze(Ge,e.__scopeSelect),[r,s]=l.useState();if(C.useLayoutEffect2(()=>{s(new DocumentFragment)},[]),!n.open){const a=r;return a?co.createPortal(o.jsx(cs,{scope:e.__scopeSelect,children:o.jsx(hn.Slot,{scope:e.__scopeSelect,children:o.jsx("div",{children:e.children})})}),a):null}return o.jsx(ds,{...e,ref:t})});ls.displayName=Ge;var Se=10,[cs,Ve]=ft(Ge),mc="SelectContentImpl",pc=st.createSlot("SelectContent.RemoveScroll"),ds=l.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:i,side:c,sideOffset:d,align:m,alignOffset:f,arrowPadding:u,collisionBoundary:x,collisionPadding:g,sticky:y,hideWhenDetached:p,avoidCollisions:h,...w}=e,v=ze(Ge,n),[b,S]=l.useState(null),[N,I]=l.useState(null),P=C.useComposedRefs(t,Y=>S(Y)),[E,_]=l.useState(null),[A,M]=l.useState(null),z=xn(n),[V,B]=l.useState(!1),U=l.useRef(!1);l.useEffect(()=>{if(b)return C.hideOthers(b)},[b]),C.useFocusGuards();const O=l.useCallback(Y=>{const[te,...K]=z().map(j=>j.ref.current),[oe]=K.slice(-1),W=document.activeElement;for(const j of Y)if(j===W||(j?.scrollIntoView({block:"nearest"}),j===te&&N&&(N.scrollTop=0),j===oe&&N&&(N.scrollTop=N.scrollHeight),j?.focus(),document.activeElement!==W))return},[z,N]),X=l.useCallback(()=>O([E,b]),[O,E,b]);l.useEffect(()=>{V&&X()},[V,X]);const{onOpenChange:D,triggerPointerDownPosRef:G}=v;l.useEffect(()=>{if(b){let Y={x:0,y:0};const te=oe=>{Y={x:Math.abs(Math.round(oe.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(oe.pageY)-(G.current?.y??0))}},K=oe=>{Y.x<=10&&Y.y<=10?oe.preventDefault():b.contains(oe.target)||D(!1),document.removeEventListener("pointermove",te),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",te),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",K,{capture:!0})}}},[b,D,G]),l.useEffect(()=>{const Y=()=>D(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[D]);const[Q,pe]=Ps(Y=>{const te=z().filter(W=>!W.disabled),K=te.find(W=>W.ref.current===document.activeElement),oe=Ts(te,Y,K);oe&&setTimeout(()=>oe.ref.current.focus())}),de=l.useCallback((Y,te,K)=>{const oe=!U.current&&!K;(v.value!==void 0&&v.value===te||oe)&&(_(Y),oe&&(U.current=!0))},[v.value]),ce=l.useCallback(()=>b?.focus(),[b]),he=l.useCallback((Y,te,K)=>{const oe=!U.current&&!K;(v.value!==void 0&&v.value===te||oe)&&M(Y)},[v.value]),xe=r==="popper"?Yn:us,ee=xe===Yn?{side:c,sideOffset:d,align:m,alignOffset:f,arrowPadding:u,collisionBoundary:x,collisionPadding:g,sticky:y,hideWhenDetached:p,avoidCollisions:h}:{};return o.jsx(cs,{scope:n,content:b,viewport:N,onViewportChange:I,itemRefCallback:de,selectedItem:E,onItemLeave:ce,itemTextRefCallback:he,focusSelectedItem:X,selectedItemText:A,position:r,isPositioned:V,searchRef:Q,children:o.jsx(C.ReactRemoveScroll,{as:pc,allowPinchZoom:!0,children:o.jsx(C.FocusScope,{asChild:!0,trapped:v.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:C.composeEventHandlers(s,Y=>{v.trigger?.focus({preventScroll:!0}),Y.preventDefault()}),children:o.jsx(C.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:o.jsx(xe,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:Y=>Y.preventDefault(),...w,...ee,onPlaced:()=>B(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:C.composeEventHandlers(w.onKeyDown,Y=>{const te=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!te&&Y.key.length===1&&pe(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let oe=z().filter(W=>!W.disabled).map(W=>W.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(oe=oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const W=Y.target,j=oe.indexOf(W);oe=oe.slice(j+1)}setTimeout(()=>O(oe)),Y.preventDefault()}})})})})})})});ds.displayName=mc;var hc="SelectItemAlignedPosition",us=l.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,a=ze(Ge,n),i=Ve(Ge,n),[c,d]=l.useState(null),[m,f]=l.useState(null),u=C.useComposedRefs(t,P=>f(P)),x=xn(n),g=l.useRef(!1),y=l.useRef(!0),{viewport:p,selectedItem:h,selectedItemText:w,focusSelectedItem:v}=i,b=l.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&m&&p&&h&&w){const P=a.trigger.getBoundingClientRect(),E=m.getBoundingClientRect(),_=a.valueNode.getBoundingClientRect(),A=w.getBoundingClientRect();if(a.dir!=="rtl"){const W=A.left-E.left,j=_.left-W,R=P.left-j,T=P.width+R,se=Math.max(T,E.width),ae=window.innerWidth-Se,re=Nt(j,[Se,Math.max(Se,ae-se)]);c.style.minWidth=T+"px",c.style.left=re+"px"}else{const W=E.right-A.right,j=window.innerWidth-_.right-W,R=window.innerWidth-P.right-j,T=P.width+R,se=Math.max(T,E.width),ae=window.innerWidth-Se,re=Nt(j,[Se,Math.max(Se,ae-se)]);c.style.minWidth=T+"px",c.style.right=re+"px"}const M=x(),z=window.innerHeight-Se*2,V=p.scrollHeight,B=window.getComputedStyle(m),U=parseInt(B.borderTopWidth,10),O=parseInt(B.paddingTop,10),X=parseInt(B.borderBottomWidth,10),D=parseInt(B.paddingBottom,10),G=U+O+V+D+X,Q=Math.min(h.offsetHeight*5,G),pe=window.getComputedStyle(p),de=parseInt(pe.paddingTop,10),ce=parseInt(pe.paddingBottom,10),he=P.top+P.height/2-Se,xe=z-he,ee=h.offsetHeight/2,Y=h.offsetTop+ee,te=U+O+Y,K=G-te;if(te<=he){const W=M.length>0&&h===M[M.length-1].ref.current;c.style.bottom="0px";const j=m.clientHeight-p.offsetTop-p.offsetHeight,R=Math.max(xe,ee+(W?ce:0)+j+X),T=te+R;c.style.height=T+"px"}else{const W=M.length>0&&h===M[0].ref.current;c.style.top="0px";const R=Math.max(he,U+p.offsetTop+(W?de:0)+ee)+K;c.style.height=R+"px",p.scrollTop=te-he+p.offsetTop}c.style.margin=`${Se}px 0`,c.style.minHeight=Q+"px",c.style.maxHeight=z+"px",r?.(),requestAnimationFrame(()=>g.current=!0)}},[x,a.trigger,a.valueNode,c,m,p,h,w,a.dir,r]);C.useLayoutEffect2(()=>b(),[b]);const[S,N]=l.useState();C.useLayoutEffect2(()=>{m&&N(window.getComputedStyle(m).zIndex)},[m]);const I=l.useCallback(P=>{P&&y.current===!0&&(b(),v?.(),y.current=!1)},[b,v]);return o.jsx(gc,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:I,children:o.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:o.jsx(C.Primitive.div,{...s,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});us.displayName=hc;var xc="SelectPopperPosition",Yn=l.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Se,...a}=e,i=gn(n);return o.jsx(fn,{...i,...a,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Yn.displayName=xc;var[gc,Eo]=ft(Ge,{}),Xn="SelectViewport",fs=l.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,a=Ve(Xn,n),i=Eo(Xn,n),c=C.useComposedRefs(t,a.onViewportChange),d=l.useRef(0);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),o.jsx(hn.Slot,{scope:n,children:o.jsx(C.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:C.composeEventHandlers(s.onScroll,m=>{const f=m.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:x}=i;if(x?.current&&u){const g=Math.abs(d.current-f.scrollTop);if(g>0){const y=window.innerHeight-Se*2,p=parseFloat(u.style.minHeight),h=parseFloat(u.style.height),w=Math.max(p,h);if(w<y){const v=w+g,b=Math.min(y,v),S=v-b;u.style.height=b+"px",u.style.bottom==="0px"&&(f.scrollTop=S>0?S:0,u.style.justifyContent="flex-end")}}}d.current=f.scrollTop})})})]})});fs.displayName=Xn;var ms="SelectGroup",[vc,bc]=ft(ms),ps=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=C.useId();return o.jsx(vc,{scope:n,id:s,children:o.jsx(C.Primitive.div,{role:"group","aria-labelledby":s,...r,ref:t})})});ps.displayName=ms;var hs="SelectLabel",xs=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=bc(hs,n);return o.jsx(C.Primitive.div,{id:s.id,...r,ref:t})});xs.displayName=hs;var Gt="SelectItem",[wc,gs]=ft(Gt),vs=l.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:a,...i}=e,c=ze(Gt,n),d=Ve(Gt,n),m=c.value===r,[f,u]=l.useState(a??""),[x,g]=l.useState(!1),y=C.useComposedRefs(t,v=>d.itemRefCallback?.(v,r,s)),p=C.useId(),h=l.useRef("touch"),w=()=>{s||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return o.jsx(wc,{scope:n,value:r,disabled:s,textId:p,isSelected:m,onItemTextChange:l.useCallback(v=>{u(b=>b||(v?.textContent??"").trim())},[]),children:o.jsx(hn.ItemSlot,{scope:n,value:r,disabled:s,textValue:f,children:o.jsx(C.Primitive.div,{role:"option","aria-labelledby":p,"data-highlighted":x?"":void 0,"aria-selected":m&&x,"data-state":m?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:y,onFocus:C.composeEventHandlers(i.onFocus,()=>g(!0)),onBlur:C.composeEventHandlers(i.onBlur,()=>g(!1)),onClick:C.composeEventHandlers(i.onClick,()=>{h.current!=="mouse"&&w()}),onPointerUp:C.composeEventHandlers(i.onPointerUp,()=>{h.current==="mouse"&&w()}),onPointerDown:C.composeEventHandlers(i.onPointerDown,v=>{h.current=v.pointerType}),onPointerMove:C.composeEventHandlers(i.onPointerMove,v=>{h.current=v.pointerType,s?d.onItemLeave?.():h.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:C.composeEventHandlers(i.onPointerLeave,v=>{v.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:C.composeEventHandlers(i.onKeyDown,v=>{d.searchRef?.current!==""&&v.key===" "||(ac.includes(v.key)&&w(),v.key===" "&&v.preventDefault())})})})})});vs.displayName=Gt;var bt="SelectItemText",bs=l.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...a}=e,i=ze(bt,n),c=Ve(bt,n),d=gs(bt,n),m=dc(bt,n),[f,u]=l.useState(null),x=C.useComposedRefs(t,w=>u(w),d.onItemTextChange,w=>c.itemTextRefCallback?.(w,d.value,d.disabled)),g=f?.textContent,y=l.useMemo(()=>o.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:p,onNativeOptionRemove:h}=m;return C.useLayoutEffect2(()=>(p(y),()=>h(y)),[p,h,y]),o.jsxs(o.Fragment,{children:[o.jsx(C.Primitive.span,{id:d.textId,...a,ref:x}),d.isSelected&&i.valueNode&&!i.valueNodeHasChildren?co.createPortal(a.children,i.valueNode):null]})});bs.displayName=bt;var ws="SelectItemIndicator",ys=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return gs(ws,n).isSelected?o.jsx(C.Primitive.span,{"aria-hidden":!0,...r,ref:t}):null});ys.displayName=ws;var Kn="SelectScrollUpButton",Cs=l.forwardRef((e,t)=>{const n=Ve(Kn,e.__scopeSelect),r=Eo(Kn,e.__scopeSelect),[s,a]=l.useState(!1),i=C.useComposedRefs(t,r.onScrollButtonChange);return C.useLayoutEffect2(()=>{if(n.viewport&&n.isPositioned){let c=function(){const m=d.scrollTop>0;a(m)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),s?o.jsx(Ns,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});Cs.displayName=Kn;var qn="SelectScrollDownButton",Ss=l.forwardRef((e,t)=>{const n=Ve(qn,e.__scopeSelect),r=Eo(qn,e.__scopeSelect),[s,a]=l.useState(!1),i=C.useComposedRefs(t,r.onScrollButtonChange);return C.useLayoutEffect2(()=>{if(n.viewport&&n.isPositioned){let c=function(){const m=d.scrollHeight-d.clientHeight,f=Math.ceil(d.scrollTop)<m;a(f)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),s?o.jsx(Ns,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});Ss.displayName=qn;var Ns=l.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,a=Ve("SelectScrollButton",n),i=l.useRef(null),c=xn(n),d=l.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return l.useEffect(()=>()=>d(),[d]),C.useLayoutEffect2(()=>{c().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),o.jsx(C.Primitive.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:C.composeEventHandlers(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:C.composeEventHandlers(s.onPointerMove,()=>{a.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:C.composeEventHandlers(s.onPointerLeave,()=>{d()})})}),yc="SelectSeparator",js=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return o.jsx(C.Primitive.div,{"aria-hidden":!0,...r,ref:t})});js.displayName=yc;var Gn="SelectArrow",Cc=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=gn(n),a=ze(Gn,n),i=Ve(Gn,n);return a.open&&i.position==="popper"?o.jsx(mn,{...s,...r,ref:t}):null});Cc.displayName=Gn;var Sc="SelectBubbleInput",Es=l.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=l.useRef(null),a=C.useComposedRefs(r,s),i=rn(t);return l.useEffect(()=>{const c=s.current;if(!c)return;const d=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(d,"value").set;if(i!==t&&f){const u=new Event("change",{bubbles:!0});f.call(c,t),c.dispatchEvent(u)}},[i,t]),o.jsx(C.Primitive.select,{...n,style:{...dr,...n.style},ref:a,defaultValue:t})});Es.displayName=Sc;function Rs(e){return e===""||e===void 0}function Ps(e){const t=C.useCallbackRef(e),n=l.useRef(""),r=l.useRef(0),s=l.useCallback(i=>{const c=n.current+i;t(c),(function d(m){n.current=m,window.clearTimeout(r.current),m!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(c)},[t]),a=l.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return l.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,a]}function Ts(e,t,n){const s=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let i=Nc(e,Math.max(a,0));s.length===1&&(i=i.filter(m=>m!==n));const d=i.find(m=>m.textValue.toLowerCase().startsWith(s.toLowerCase()));return d!==n?d:void 0}function Nc(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var jc=ts,Ec=os,Rc=ss,Pc=as,Tc=is,Ic=ls,kc=fs,Mc=ps,_c=xs,Ac=vs,$c=bs,Lc=ys,Oc=Cs,Dc=Ss,Hc=js,Is=["PageUp","PageDown"],ks=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ms={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},mt="Slider",[Jn,Fc,Bc]=nn(mt),[_s]=C.createContextScope(mt,[Bc]),[zc,vn]=_s(mt),As=l.forwardRef((e,t)=>{const{name:n,min:r=0,max:s=100,step:a=1,orientation:i="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:m=[r],value:f,onValueChange:u=()=>{},onValueCommit:x=()=>{},inverted:g=!1,form:y,...p}=e,h=l.useRef(new Set),w=l.useRef(0),b=i==="horizontal"?Vc:Wc,[S=[],N]=C.useControllableState({prop:f,defaultProp:m,onChange:M=>{[...h.current][w.current]?.focus(),u(M)}}),I=l.useRef(S);function P(M){const z=qc(S,M);A(M,z)}function E(M){A(M,w.current)}function _(){const M=I.current[w.current];S[w.current]!==M&&x(S)}function A(M,z,{commit:V}={commit:!1}){const B=Qc(a),U=ed(Math.round((M-r)/a)*a+r,B),O=Nt(U,[r,s]);N((X=[])=>{const D=Xc(X,O,z);if(Zc(D,d*a)){w.current=D.indexOf(O);const G=String(D)!==String(X);return G&&V&&x(D),G?D:X}else return X})}return o.jsx(zc,{scope:e.__scopeSlider,name:n,disabled:c,min:r,max:s,valueIndexToChangeRef:w,thumbs:h.current,values:S,orientation:i,form:y,children:o.jsx(Jn.Provider,{scope:e.__scopeSlider,children:o.jsx(Jn.Slot,{scope:e.__scopeSlider,children:o.jsx(b,{"aria-disabled":c,"data-disabled":c?"":void 0,...p,ref:t,onPointerDown:C.composeEventHandlers(p.onPointerDown,()=>{c||(I.current=S)}),min:r,max:s,inverted:g,onSlideStart:c?void 0:P,onSlideMove:c?void 0:E,onSlideEnd:c?void 0:_,onHomeKeyDown:()=>!c&&A(r,0,{commit:!0}),onEndKeyDown:()=>!c&&A(s,S.length-1,{commit:!0}),onStepKeyDown:({event:M,direction:z})=>{if(!c){const U=Is.includes(M.key)||M.shiftKey&&ks.includes(M.key)?10:1,O=w.current,X=S[O],D=a*U*z;A(X+D,O,{commit:!0})}}})})})})});As.displayName=mt;var[$s,Ls]=_s(mt,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Vc=l.forwardRef((e,t)=>{const{min:n,max:r,dir:s,inverted:a,onSlideStart:i,onSlideMove:c,onSlideEnd:d,onStepKeyDown:m,...f}=e,[u,x]=l.useState(null),g=C.useComposedRefs(t,b=>x(b)),y=l.useRef(void 0),p=Et(s),h=p==="ltr",w=h&&!a||!h&&a;function v(b){const S=y.current||u.getBoundingClientRect(),N=[0,S.width],P=Ro(N,w?[n,r]:[r,n]);return y.current=S,P(b-S.left)}return o.jsx($s,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:o.jsx(Os,{dir:p,"data-orientation":"horizontal",...f,ref:g,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:b=>{const S=v(b.clientX);i?.(S)},onSlideMove:b=>{const S=v(b.clientX);c?.(S)},onSlideEnd:()=>{y.current=void 0,d?.()},onStepKeyDown:b=>{const N=Ms[w?"from-left":"from-right"].includes(b.key);m?.({event:b,direction:N?-1:1})}})})}),Wc=l.forwardRef((e,t)=>{const{min:n,max:r,inverted:s,onSlideStart:a,onSlideMove:i,onSlideEnd:c,onStepKeyDown:d,...m}=e,f=l.useRef(null),u=C.useComposedRefs(t,f),x=l.useRef(void 0),g=!s;function y(p){const h=x.current||f.current.getBoundingClientRect(),w=[0,h.height],b=Ro(w,g?[r,n]:[n,r]);return x.current=h,b(p-h.top)}return o.jsx($s,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:o.jsx(Os,{"data-orientation":"vertical",...m,ref:u,style:{...m.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:p=>{const h=y(p.clientY);a?.(h)},onSlideMove:p=>{const h=y(p.clientY);i?.(h)},onSlideEnd:()=>{x.current=void 0,c?.()},onStepKeyDown:p=>{const w=Ms[g?"from-bottom":"from-top"].includes(p.key);d?.({event:p,direction:w?-1:1})}})})}),Os=l.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:a,onHomeKeyDown:i,onEndKeyDown:c,onStepKeyDown:d,...m}=e,f=vn(mt,n);return o.jsx(C.Primitive.span,{...m,ref:t,onKeyDown:C.composeEventHandlers(e.onKeyDown,u=>{u.key==="Home"?(i(u),u.preventDefault()):u.key==="End"?(c(u),u.preventDefault()):Is.concat(ks).includes(u.key)&&(d(u),u.preventDefault())}),onPointerDown:C.composeEventHandlers(e.onPointerDown,u=>{const x=u.target;x.setPointerCapture(u.pointerId),u.preventDefault(),f.thumbs.has(x)?x.focus():r(u)}),onPointerMove:C.composeEventHandlers(e.onPointerMove,u=>{u.target.hasPointerCapture(u.pointerId)&&s(u)}),onPointerUp:C.composeEventHandlers(e.onPointerUp,u=>{const x=u.target;x.hasPointerCapture(u.pointerId)&&(x.releasePointerCapture(u.pointerId),a(u))})})}),Ds="SliderTrack",Hs=l.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=vn(Ds,n);return o.jsx(C.Primitive.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:t})});Hs.displayName=Ds;var Zn="SliderRange",Fs=l.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=vn(Zn,n),a=Ls(Zn,n),i=l.useRef(null),c=C.useComposedRefs(t,i),d=s.values.length,m=s.values.map(x=>Vs(x,s.min,s.max)),f=d>1?Math.min(...m):0,u=100-Math.max(...m);return o.jsx(C.Primitive.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:c,style:{...e.style,[a.startEdge]:f+"%",[a.endEdge]:u+"%"}})});Fs.displayName=Zn;var Qn="SliderThumb",Bs=l.forwardRef((e,t)=>{const n=Fc(e.__scopeSlider),[r,s]=l.useState(null),a=C.useComposedRefs(t,c=>s(c)),i=l.useMemo(()=>r?n().findIndex(c=>c.ref.current===r):-1,[n,r]);return o.jsx(Uc,{...e,ref:a,index:i})}),Uc=l.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:s,...a}=e,i=vn(Qn,n),c=Ls(Qn,n),[d,m]=l.useState(null),f=C.useComposedRefs(t,v=>m(v)),u=d?i.form||!!d.closest("form"):!0,x=sn(d),g=i.values[r],y=g===void 0?0:Vs(g,i.min,i.max),p=Kc(r,i.values.length),h=x?.[c.size],w=h?Gc(h,y,c.direction):0;return l.useEffect(()=>{if(d)return i.thumbs.add(d),()=>{i.thumbs.delete(d)}},[d,i.thumbs]),o.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${y}% + ${w}px)`},children:[o.jsx(Jn.ItemSlot,{scope:e.__scopeSlider,children:o.jsx(C.Primitive.span,{role:"slider","aria-label":e["aria-label"]||p,"aria-valuemin":i.min,"aria-valuenow":g,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...a,ref:f,style:g===void 0?{display:"none"}:e.style,onFocus:C.composeEventHandlers(e.onFocus,()=>{i.valueIndexToChangeRef.current=r})})}),u&&o.jsx(zs,{name:s??(i.name?i.name+(i.values.length>1?"[]":""):void 0),form:i.form,value:g},r)]})});Bs.displayName=Qn;var Yc="RadioBubbleInput",zs=l.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const s=l.useRef(null),a=C.useComposedRefs(s,r),i=rn(t);return l.useEffect(()=>{const c=s.current;if(!c)return;const d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"value").set;if(i!==t&&f){const u=new Event("input",{bubbles:!0});f.call(c,t),c.dispatchEvent(u)}},[i,t]),o.jsx(C.Primitive.input,{style:{display:"none"},...n,ref:a,defaultValue:t})});zs.displayName=Yc;function Xc(e=[],t,n){const r=[...e];return r[n]=t,r.sort((s,a)=>s-a)}function Vs(e,t,n){const a=100/(n-t)*(e-t);return Nt(a,[0,100])}function Kc(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function qc(e,t){if(e.length===1)return 0;const n=e.map(s=>Math.abs(s-t)),r=Math.min(...n);return n.indexOf(r)}function Gc(e,t,n){const r=e/2,a=Ro([0,50],[0,r]);return(r-a(t)*n)*n}function Jc(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Zc(e,t){if(t>0){const n=Jc(e);return Math.min(...n)>=t}return!0}function Ro(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Qc(e){return(String(e).split(".")[1]||"").length}function ed(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var td=As,nd=Hs,od=Fs,rd=Bs,bn="Switch",[sd]=C.createContextScope(bn),[ad,id]=sd(bn),Ws=l.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:a,required:i,disabled:c,value:d="on",onCheckedChange:m,form:f,...u}=e,[x,g]=l.useState(null),y=C.useComposedRefs(t,b=>g(b)),p=l.useRef(!1),h=x?f||!!x.closest("form"):!0,[w,v]=C.useControllableState({prop:s,defaultProp:a??!1,onChange:m,caller:bn});return o.jsxs(ad,{scope:n,checked:w,disabled:c,children:[o.jsx(C.Primitive.button,{type:"button",role:"switch","aria-checked":w,"aria-required":i,"data-state":Ks(w),"data-disabled":c?"":void 0,disabled:c,value:d,...u,ref:y,onClick:C.composeEventHandlers(e.onClick,b=>{v(S=>!S),h&&(p.current=b.isPropagationStopped(),p.current||b.stopPropagation())})}),h&&o.jsx(Xs,{control:x,bubbles:!p.current,name:r,value:d,checked:w,required:i,disabled:c,form:f,style:{transform:"translateX(-100%)"}})]})});Ws.displayName=bn;var Us="SwitchThumb",Ys=l.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=id(Us,n);return o.jsx(C.Primitive.span,{"data-state":Ks(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});Ys.displayName=Us;var ld="SwitchBubbleInput",Xs=l.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},a)=>{const i=l.useRef(null),c=C.useComposedRefs(i,a),d=rn(n),m=sn(t);return l.useEffect(()=>{const f=i.current;if(!f)return;const u=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(u,"checked").set;if(d!==n&&g){const y=new Event("click",{bubbles:r});g.call(f,n),f.dispatchEvent(y)}},[d,n,r]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:c,style:{...s.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Xs.displayName=ld;function Ks(e){return e?"checked":"unchecked"}var qs=Ws,cd=Ys,wn="Tabs",[dd]=C.createContextScope(wn,[No]),Gs=No(),[ud,Po]=dd(wn),Js=l.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:a,orientation:i="horizontal",dir:c,activationMode:d="automatic",...m}=e,f=Et(c),[u,x]=C.useControllableState({prop:r,onChange:s,defaultProp:a??"",caller:wn});return o.jsx(ud,{scope:n,baseId:C.useId(),value:u,onValueChange:x,orientation:i,dir:f,activationMode:d,children:o.jsx(C.Primitive.div,{dir:f,"data-orientation":i,...m,ref:t})})});Js.displayName=wn;var Zs="TabsList",Qs=l.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,a=Po(Zs,n),i=Gs(n);return o.jsx(zr,{asChild:!0,...i,orientation:a.orientation,dir:a.dir,loop:r,children:o.jsx(C.Primitive.div,{role:"tablist","aria-orientation":a.orientation,...s,ref:t})})});Qs.displayName=Zs;var ea="TabsTrigger",ta=l.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...a}=e,i=Po(ea,n),c=Gs(n),d=ra(i.baseId,r),m=sa(i.baseId,r),f=r===i.value;return o.jsx(Vr,{asChild:!0,...c,focusable:!s,active:f,children:o.jsx(C.Primitive.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":m,"data-state":f?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:d,...a,ref:t,onMouseDown:C.composeEventHandlers(e.onMouseDown,u=>{!s&&u.button===0&&u.ctrlKey===!1?i.onValueChange(r):u.preventDefault()}),onKeyDown:C.composeEventHandlers(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&i.onValueChange(r)}),onFocus:C.composeEventHandlers(e.onFocus,()=>{const u=i.activationMode!=="manual";!f&&!s&&u&&i.onValueChange(r)})})})});ta.displayName=ea;var na="TabsContent",oa=l.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:a,...i}=e,c=Po(na,n),d=ra(c.baseId,r),m=sa(c.baseId,r),f=r===c.value,u=l.useRef(f);return l.useEffect(()=>{const x=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(x)},[]),o.jsx(C.Presence,{present:s||f,children:({present:x})=>o.jsx(C.Primitive.div,{"data-state":f?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!x,id:m,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:u.current?"0s":void 0},children:x&&a})})});oa.displayName=na;function ra(e,t){return`${e}-trigger-${t}`}function sa(e,t){return`${e}-content-${t}`}var fd=Js,md=Qs,pd=ta,hd=oa,[yn]=C.createContextScope("Tooltip",[Je]),Cn=Je(),aa="TooltipProvider",xd=700,eo="tooltip.open",[gd,To]=yn(aa),ia=e=>{const{__scopeTooltip:t,delayDuration:n=xd,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:a}=e,i=l.useRef(!0),c=l.useRef(!1),d=l.useRef(0);return l.useEffect(()=>{const m=d.current;return()=>window.clearTimeout(m)},[]),o.jsx(gd,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:l.useCallback(()=>{window.clearTimeout(d.current),i.current=!1},[]),onClose:l.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:l.useCallback(m=>{c.current=m},[]),disableHoverableContent:s,children:a})};ia.displayName=aa;var jt="Tooltip",[vd,kt]=yn(jt),la=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:a,disableHoverableContent:i,delayDuration:c}=e,d=To(jt,e.__scopeTooltip),m=Cn(t),[f,u]=l.useState(null),x=C.useId(),g=l.useRef(0),y=i??d.disableHoverableContent,p=c??d.delayDuration,h=l.useRef(!1),[w,v]=C.useControllableState({prop:r,defaultProp:s??!1,onChange:P=>{P?(d.onOpen(),document.dispatchEvent(new CustomEvent(eo))):d.onClose(),a?.(P)},caller:jt}),b=l.useMemo(()=>w?h.current?"delayed-open":"instant-open":"closed",[w]),S=l.useCallback(()=>{window.clearTimeout(g.current),g.current=0,h.current=!1,v(!0)},[v]),N=l.useCallback(()=>{window.clearTimeout(g.current),g.current=0,v(!1)},[v]),I=l.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{h.current=!0,v(!0),g.current=0},p)},[p,v]);return l.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),o.jsx(un,{...m,children:o.jsx(vd,{scope:t,contentId:x,open:w,stateAttribute:b,trigger:f,onTriggerChange:u,onTriggerEnter:l.useCallback(()=>{d.isOpenDelayedRef.current?I():S()},[d.isOpenDelayedRef,I,S]),onTriggerLeave:l.useCallback(()=>{y?N():(window.clearTimeout(g.current),g.current=0)},[N,y]),onOpen:S,onClose:N,disableHoverableContent:y,children:n})})};la.displayName=jt;var to="TooltipTrigger",ca=l.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=kt(to,n),a=To(to,n),i=Cn(n),c=l.useRef(null),d=C.useComposedRefs(t,c,s.onTriggerChange),m=l.useRef(!1),f=l.useRef(!1),u=l.useCallback(()=>m.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),o.jsx(Pt,{asChild:!0,...i,children:o.jsx(C.Primitive.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:d,onPointerMove:C.composeEventHandlers(e.onPointerMove,x=>{x.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:C.composeEventHandlers(e.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:C.composeEventHandlers(e.onPointerDown,()=>{s.open&&s.onClose(),m.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:C.composeEventHandlers(e.onFocus,()=>{m.current||s.onOpen()}),onBlur:C.composeEventHandlers(e.onBlur,s.onClose),onClick:C.composeEventHandlers(e.onClick,s.onClose)})})});ca.displayName=to;var Io="TooltipPortal",[bd,wd]=yn(Io,{forceMount:void 0}),da=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,a=kt(Io,t);return o.jsx(bd,{scope:t,forceMount:n,children:o.jsx(C.Presence,{present:n||a.open,children:o.jsx(C.Portal,{asChild:!0,container:s,children:r})})})};da.displayName=Io;var lt="TooltipContent",ua=l.forwardRef((e,t)=>{const n=wd(lt,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...a}=e,i=kt(lt,e.__scopeTooltip);return o.jsx(C.Presence,{present:r||i.open,children:i.disableHoverableContent?o.jsx(fa,{side:s,...a,ref:t}):o.jsx(yd,{side:s,...a,ref:t})})}),yd=l.forwardRef((e,t)=>{const n=kt(lt,e.__scopeTooltip),r=To(lt,e.__scopeTooltip),s=l.useRef(null),a=C.useComposedRefs(t,s),[i,c]=l.useState(null),{trigger:d,onClose:m}=n,f=s.current,{onPointerInTransitChange:u}=r,x=l.useCallback(()=>{c(null),u(!1)},[u]),g=l.useCallback((y,p)=>{const h=y.currentTarget,w={x:y.clientX,y:y.clientY},v=Ed(w,h.getBoundingClientRect()),b=Rd(w,v),S=Pd(p.getBoundingClientRect()),N=Id([...b,...S]);c(N),u(!0)},[u]);return l.useEffect(()=>()=>x(),[x]),l.useEffect(()=>{if(d&&f){const y=h=>g(h,f),p=h=>g(h,d);return d.addEventListener("pointerleave",y),f.addEventListener("pointerleave",p),()=>{d.removeEventListener("pointerleave",y),f.removeEventListener("pointerleave",p)}}},[d,f,g,x]),l.useEffect(()=>{if(i){const y=p=>{const h=p.target,w={x:p.clientX,y:p.clientY},v=d?.contains(h)||f?.contains(h),b=!Td(w,i);v?x():b&&(x(),m())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[d,f,i,m,x]),o.jsx(fa,{...e,ref:a})}),[Cd,Sd]=yn(jt,{isInside:!1}),Nd=st.createSlottable("TooltipContent"),fa=l.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:i,...c}=e,d=kt(lt,n),m=Cn(n),{onClose:f}=d;return l.useEffect(()=>(document.addEventListener(eo,f),()=>document.removeEventListener(eo,f)),[f]),l.useEffect(()=>{if(d.trigger){const u=x=>{x.target?.contains(d.trigger)&&f()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[d.trigger,f]),o.jsx(C.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:u=>u.preventDefault(),onDismiss:f,children:o.jsxs(fn,{"data-state":d.stateAttribute,...m,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(Nd,{children:r}),o.jsx(Cd,{scope:n,isInside:!0,children:o.jsx(fr,{id:d.contentId,role:"tooltip",children:s||r})})]})})});ua.displayName=lt;var ma="TooltipArrow",jd=l.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Cn(n);return Sd(ma,n).isInside?null:o.jsx(mn,{...s,...r,ref:t})});jd.displayName=ma;function Ed(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,s,a)){case a:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Rd(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Pd(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function Td(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const c=t[a],d=t[i],m=c.x,f=c.y,u=d.x,x=d.y;f>r!=x>r&&n<(u-m)*(r-f)/(x-f)+m&&(s=!s)}return s}function Id(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),kd(t)}function kd(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(s.y-i.y)>=(a.y-i.y)*(s.x-i.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const a=n[n.length-1],i=n[n.length-2];if((a.x-i.x)*(s.y-i.y)>=(a.y-i.y)*(s.x-i.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Md=ia,_d=la,Ad=ca,$d=da,pa=ua;const ha=Md,no=_d,oo=Ad,Jt=l.forwardRef(({className:e,sideOffset:t=4,...n},r)=>o.jsx($d,{children:o.jsx(pa,{ref:r,sideOffset:t,className:J.cn("z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...n})}));Jt.displayName=pa.displayName;const xa=ct.cva("bg-muted rounded-full relative grow overflow-hidden data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full",{variants:{size:{sm:"data-[orientation=horizontal]:h-2 data-[orientation=vertical]:w-2",default:"data-[orientation=horizontal]:h-[10px] data-[orientation=vertical]:w-[10px]",lg:"data-[orientation=horizontal]:h-3 data-[orientation=vertical]:w-3"}},defaultVariants:{size:"default"}}),ga=ct.cva("border-primary ring-ring/30 block shrink-0 rounded-full border bg-white shadow-[0_2px_6px_rgba(0,0,0,0.22),0_0_1px_rgba(0,0,0,0.12)] transition-colors hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden select-none disabled:pointer-events-none disabled:opacity-50",{variants:{size:{sm:"data-[orientation=horizontal]:h-3 data-[orientation=horizontal]:w-4 data-[orientation=vertical]:h-4 data-[orientation=vertical]:w-3",default:"data-[orientation=horizontal]:h-4 data-[orientation=horizontal]:w-5 data-[orientation=vertical]:h-5 data-[orientation=vertical]:w-4",lg:"data-[orientation=horizontal]:h-5 data-[orientation=horizontal]:w-6 data-[orientation=vertical]:h-6 data-[orientation=vertical]:w-5"}},defaultVariants:{size:"default"}});function ye({className:e,defaultValue:t,value:n,min:r=0,max:s=100,size:a,...i}){const c=l.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,s],[n,t,r,s]);return o.jsxs(td,{"data-slot":"slider",defaultValue:t,value:n,min:r,max:s,className:J.cn("data-[orientation=vertical]:min-h-40 relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...i,children:[o.jsx(nd,{"data-slot":"slider-track",className:xa({size:a}),children:o.jsx(od,{"data-slot":"slider-range",className:"bg-primary absolute select-none data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"})}),Array.from({length:c.length},(d,m)=>o.jsx(rd,{"data-slot":"slider-thumb",className:ga({size:a})},m))]})}const wt=l.forwardRef(({className:e,trackColor:t,rangeColor:n,thumbColor:r,thumbFillColor:s,thumbOutlineColor:a,gradientBackground:i,sliderType:c="custom",currentHue:d,currentChroma:m,...f},u)=>{const g=c!=="custom"?(()=>{if(i)return i;switch(c){case"hue":return"linear-gradient(to right, hsl(0,100%,50%), hsl(60,100%,50%), hsl(120,100%,50%), hsl(180,100%,50%), hsl(240,100%,50%), hsl(300,100%,50%), hsl(360,100%,50%))";case"saturation":{const p=d!==void 0?d:f.value?.[0]??f.defaultValue?.[0]??0;return`linear-gradient(to right, hsl(${p}, 0%, 50%), hsl(${p}, 100%, 50%))`}case"lightness":{const p=d!==void 0?d:f.value?.[0]??f.defaultValue?.[0]??0;return`linear-gradient(to right, hsl(${p}, 100%, 0%), hsl(${p}, 100%, 100%))`}default:return n||"oklch(var(--primary))"}})():void 0,y={...f.style||{},"--color-slider-track":g??t??"oklch(var(--secondary))","--color-slider-range":c==="custom"?n||"oklch(var(--primary))":"transparent","--color-slider-thumb-outline":a||r||"oklch(var(--primary))","--color-slider-thumb-fill":s||"white"};return o.jsx(ye,{ref:u,className:J.cn("[&_[data-slot='slider-track']]:[background:var(--color-slider-track)]","[&_[data-slot='slider-range']]:bg-[var(--color-slider-range)]","[&_[data-slot='slider-thumb']]:bg-[var(--color-slider-thumb-fill)]","[&_[data-slot='slider-thumb']]:border-[var(--color-slider-thumb-outline)]","[&_[data-slot='slider-thumb']]:shadow-[0_2px_6px_rgba(0,0,0,0.22),0_0_1px_rgba(0,0,0,0.12)]","[&_[data-slot='slider-thumb']]:ring-offset-background","[&_[data-slot='slider-thumb']]:hover:ring-[var(--color-slider-thumb-outline)]","[&_[data-slot='slider-thumb']]:focus-visible:ring-[var(--color-slider-thumb-outline)]",e),style:y,...f})});wt.displayName="ColorSlider";function Ld(e,t,n){if(!isFinite(e)||e<0||e>1)return"#000000";if(t<.001){const h=Math.max(0,Math.min(1,e)),w=v=>{const b=Math.round(v*255).toString(16);return b.length===1?"0"+b:b};return`#${w(h)}${w(h)}${w(h)}`}const r=n/360*2*Math.PI,s=t*Math.cos(r),a=t*Math.sin(r),i=e+.3963377774*s+.2158037573*a,c=e-.1055613458*s-.0638541728*a,d=e-.0894841775*s-1.291485548*a,m=Math.max(0,Math.min(1,Math.sign(i)*Math.pow(Math.abs(i)*.999999998*2-1,1/3))),f=Math.max(0,Math.min(1,Math.sign(c)*Math.pow(Math.abs(c)*.999999998*2-1,1/3))),u=Math.max(0,Math.min(1,Math.sign(d)*Math.pow(Math.abs(d)*.999999998*2-1,1/3))),x=h=>{const w=Math.round(h*255).toString(16);return w.length===1?"0"+w:w},g=x(m),y=x(f),p=x(u);return g==="NaN"||y==="NaN"||p==="NaN"?"#000000":`#${g}${y}${p}`}function Dn(e){const t=e.match(/oklch\(([0-9.]+)\s+([0-9.]+)\s+([0-9.]+)\)/);return t?{L:parseFloat(t[1]),C:parseFloat(t[2]),H:parseFloat(t[3])}:{L:.5,C:.15,H:240}}function Od(e,t,n){e=e/255,t=t/255,n=n/255,e=e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4),t=t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4),n=n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);const r=.4122214708*e+.5363325363*t+.0514459929*n,s=.2119034982*e+.6806995451*t+.1073969566*n,a=.0883024619*e+.2817188376*t+.6299787005*n,i=Math.pow(Math.abs(r)*.999999998,1/3)*Math.sign(r)*.5+.5,c=r-s,d=(r+s-2*a)/2,m=Math.sqrt(c*c+d*d);let f=Math.atan2(d,c)*(180/Math.PI);return f<0&&(f+=360),{L:i,C:m,H:f}}function Qe({value:e="oklch(0.5 0.15 240)",onChange:t,className:n,disabled:r,variant:s="popover"}){const[a,i]=l.useState(!1),[c,d]=l.useState(()=>Dn(e)),[m,f]=l.useState(null);l.useEffect(()=>{d(Dn(e))},[e]);const u=(S,N,I)=>{if(N<.001||!isFinite(N))return{h:0,s:0,l:Math.max(0,Math.min(100,S*100))};const P=I/360*2*Math.PI,E=N*Math.cos(P),_=N*Math.sin(P),A=S+.3963377774*E+.2158037573*_,M=S-.1055613458*E-.0638541728*_,z=S-.0894841775*E-1.291485548*_,V=Math.max(0,Math.min(1,Math.sign(A)*Math.pow(Math.abs(A)*.999999998*2-1,1/3))),B=Math.max(0,Math.min(1,Math.sign(M)*Math.pow(Math.abs(M)*.999999998*2-1,1/3))),U=Math.max(0,Math.min(1,Math.sign(z)*Math.pow(Math.abs(z)*.999999998*2-1,1/3))),O=ee=>isFinite(ee)?ee<=.0031308?12.92*ee:1.055*Math.pow(ee,1/2.4)-.055:0,X=Math.max(0,Math.min(1,O(V))),D=Math.max(0,Math.min(1,O(B))),G=Math.max(0,Math.min(1,O(U))),Q=Math.max(X,D,G),pe=Math.min(X,D,G),de=Q-pe;let ce=0;de!==0&&(Q===X?ce=(D-G)/de%6:Q===D?ce=(G-X)/de+2:ce=(X-D)/de+4,ce=Math.round(ce*60),ce<0&&(ce+=360));const he=(Q+pe)/2,xe=Q===0||pe===1?0:(Q-pe)/(1-Math.abs(2*he-1));return{h:ce,s:Math.max(0,Math.min(100,xe*100)),l:Math.max(0,Math.min(100,he*100))}},x=async(S,N)=>{try{await navigator.clipboard.writeText(S),f(N),setTimeout(()=>f(null),2e3)}catch(I){console.error("Failed to copy:",I)}},g=(S,N)=>{const I={...c,[S]:N};d(I),t?.(`oklch(${I.L} ${I.C} ${I.H})`)},y=S=>{const N=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(S);if(N){const I=parseInt(N[1],16),P=parseInt(N[2],16),E=parseInt(N[3],16),_=Od(I,P,E);d(_),t?.(`oklch(${_.L} ${_.C} ${_.H})`)}},p=Ld(c.L,c.C,c.H),h=`oklch(${c.L.toFixed(2)} ${c.C.toFixed(2)} ${c.H})`,w=u(c.L,c.C,c.H),v=`hsl(${Math.round(w.h)} ${Math.round(w.s)}% ${Math.round(w.l)}%)`,b=o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"h-16 w-16 rounded border border-border flex-shrink-0",style:{backgroundColor:`oklch(${c.L} ${c.C} ${c.H})`}}),o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-xs font-semibold mb-1",children:"OKLCH"}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("input",{type:"text",value:h,readOnly:!0,className:"text-[10px] font-mono w-full px-2 py-1 border border-border rounded bg-muted"}),o.jsx(ne.EnhancedButton,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>x(h,"oklch"),children:m==="oklch"?o.jsx(H.HugeiconsIcon,{icon:F.Tick02Icon,size:12,className:"w-3 h-3 text-success-foreground"}):o.jsx(H.HugeiconsIcon,{icon:F.Copy01Icon,size:12,className:"w-3 h-3"})})]})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs font-semibold mb-1",children:"HEX"}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("input",{type:"text",value:p,onChange:S=>y(S.target.value),className:"text-[10px] font-mono w-full px-2 py-1 border border-border rounded bg-background"}),o.jsx(ne.EnhancedButton,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>x(p,"hex"),children:m==="hex"?o.jsx(H.HugeiconsIcon,{icon:F.Tick02Icon,size:12,className:"w-3 h-3 text-success-foreground"}):o.jsx(H.HugeiconsIcon,{icon:F.Copy01Icon,size:12,className:"w-3 h-3"})})]})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs font-semibold mb-1",children:"HSL"}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("input",{type:"text",value:v,readOnly:!0,className:"text-[10px] font-mono w-full px-2 py-1 border border-border rounded bg-muted"}),o.jsx(ne.EnhancedButton,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>x(v,"hsl"),children:m==="hsl"?o.jsx(H.HugeiconsIcon,{icon:F.Tick02Icon,size:12,className:"w-3 h-3 text-success-foreground"}):o.jsx(H.HugeiconsIcon,{icon:F.Copy01Icon,size:12,className:"w-3 h-3"})})]})]})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("label",{className:"text-xs font-medium",children:"Hue"}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[Math.round(c.H),"°"]})]}),o.jsx(wt,{value:[c.H],onValueChange:S=>g("H",S[0]??0),min:0,max:360,step:1,sliderType:"hue",thumbColor:`oklch(${c.L} ${c.C} ${c.H})`})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("label",{className:"text-xs font-medium",children:"Chroma"}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[(c.C*100).toFixed(0),"%"]})]}),o.jsx(wt,{value:[c.C*100],onValueChange:S=>g("C",(S[0]??0)/100),min:0,max:50,step:1,sliderType:"saturation",currentHue:c.H,thumbColor:`oklch(${c.L} ${c.C} ${c.H})`})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("label",{className:"text-xs font-medium",children:"Lightness"}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[(c.L*100).toFixed(0),"%"]})]}),o.jsx(wt,{value:[c.L*100],onValueChange:S=>g("L",(S[0]??0)/100),min:0,max:100,step:1,sliderType:"lightness",currentHue:c.H,thumbColor:`oklch(${c.L} ${c.C} ${c.H})`})]})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs font-medium mb-2",children:"Quick Colors"}),o.jsx("div",{className:"grid grid-cols-8 gap-1",children:[{name:"Red",oklch:"oklch(0.55 0.22 25)"},{name:"Orange",oklch:"oklch(0.65 0.20 60)"},{name:"Yellow",oklch:"oklch(0.75 0.15 100)"},{name:"Lime",oklch:"oklch(0.70 0.18 140)"},{name:"Green",oklch:"oklch(0.60 0.20 160)"},{name:"Cyan",oklch:"oklch(0.65 0.15 200)"},{name:"Blue",oklch:"oklch(0.60 0.25 240)"},{name:"Purple",oklch:"oklch(0.55 0.22 280)"}].map(S=>{const N=Dn(S.oklch);return o.jsx("button",{onClick:()=>{d(N),t?.(S.oklch)},className:"h-8 w-full rounded border border-border transition-all hover:scale-110",style:{backgroundColor:S.oklch},title:S.name},S.name)})})]})]});return s==="inline"?o.jsx("div",{className:J.cn("w-full",n),children:b}):o.jsxs(Pa,{open:a,onOpenChange:i,children:[o.jsx(Ta,{asChild:!0,children:o.jsx(ne.EnhancedButton,{variant:"outline",disabled:r,className:J.cn("h-8 w-8 p-0 border-2",n),style:{backgroundColor:`oklch(${c.L} ${c.C} ${c.H})`},children:o.jsx("span",{className:"sr-only",children:"Pick a color"})})}),o.jsx(Ia,{className:"w-80 p-4 border-border shadow-lg z-[var(--z-popover)]",children:b})]})}function va({blur:e=16,borderRadius:t=0,className:n}){const s=`frostyGlassMask-${l.useId().replace(/:/g,"-")}`;l.useEffect(()=>{fetch("http://127.0.0.1:7242/ingest/4df26b36-056f-4f25-87e5-cdd927efe4db",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({location:"frosted-glass.tsx:39",message:"FrostedGlass rendered",data:{blur:e,borderRadius:t,useSvgMask:t>0},timestamp:Date.now(),sessionId:"debug-session",runId:"run1",hypothesisId:"A"})}).catch(()=>{})},[e,t]);const a=t>0;return o.jsxs(o.Fragment,{children:[a&&o.jsx("svg",{className:"absolute inset-0 pointer-events-none",width:"100%",height:"100%",preserveAspectRatio:"none","aria-hidden":"true",children:o.jsx("mask",{id:s,children:o.jsx("rect",{width:"100%",height:"100%",fill:"white",rx:t,ry:t})})}),o.jsx("div",{className:J.cn("absolute inset-0 pointer-events-none","h-[200%]","bg-background/3",n),style:{"--blur":`${e}px`,backdropFilter:`blur(${e}px)`,WebkitBackdropFilter:`blur(${e}px)`,maskImage:a?`url(#${s})`:"linear-gradient(to bottom, black 0% 50%, transparent 50% 100%)",WebkitMaskImage:a?`url(#${s})`:"linear-gradient(to bottom, black 0% 50%, transparent 50% 100%)"}})]})}function Ft({...e}){return o.jsx(jc,{"data-slot":"select",...e})}function Dd({className:e,...t}){return o.jsx(Mc,{"data-slot":"select-group",className:J.cn("scroll-my-1 p-1",e),...t})}function Bt({...e}){return o.jsx(Rc,{"data-slot":"select-value",...e})}function zt({className:e,size:t="default",children:n,minWidth:r="120px",style:s,...a}){return o.jsxs(Ec,{"data-slot":"select-trigger","data-size":t,className:J.cn("border-input/50 data-[placeholder]:text-muted-foreground bg-input/20 dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-md border px-2 py-1.5 text-sm transition-[color,background-color,border-color,box-shadow] duration-150 ease-in-out focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-7 data-[size=sm]:h-6 shadow-[0_1px_0_0_color-mix(in_oklch,var(--input)_40%,transparent),0_1px_2px_0_oklch(0.15_0_0_/_0.05),0_2px_4px_-1px_oklch(0.15_0_0_/_0.03)] hover:shadow-[0_1px_0_0_color-mix(in_oklch,var(--input)_40%,transparent),0_1px_3px_0_oklch(0.15_0_0_/_0.08),0_2px_6px_-1px_oklch(0.15_0_0_/_0.04)] dark:shadow-[0_1px_0_0_color-mix(in_oklch,var(--input)_40%,transparent),0_1px_2px_0_oklch(0_0_0_/_0.3),0_2px_4px_-1px_oklch(0_0_0_/_0.2)] dark:hover:shadow-[0_1px_0_0_color-mix(in_oklch,var(--input)_40%,transparent),0_1px_3px_0_oklch(0_0_0_/_0.4),0_2px_6px_-1px_oklch(0_0_0_/_0.3)] *:data-[slot=select-value]:flex *:data-[slot=select-value]:min-w-0 *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-3.5 flex min-w-0 max-w-full w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",r==="120px"&&"min-w-[120px]",e),style:r!=="fit"&&r!=="120px"?{...s,minWidth:r}:s,...a,children:[n,o.jsx(Pc,{asChild:!0,children:o.jsx(H.HugeiconsIcon,{icon:F.UnfoldMoreIcon,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})})]})}function Vt({className:e,children:t,position:n="item-aligned",align:r="center",...s}){return o.jsx(Tc,{children:o.jsxs(Ic,{"data-slot":"select-content",className:J.cn("text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-32 rounded-lg shadow-md ring-1 duration-100 relative z-[var(--z-popover)] max-h-(--radix-select-content-available-height) origin-(--radix-select-content-transform-origin) overflow-hidden",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...s,children:[o.jsx(va,{blur:16,borderRadius:8,className:"z-[var(--z-background)]"}),o.jsxs("div",{className:"relative z-[var(--z-content)] bg-popover/10 rounded-lg overflow-y-auto overflow-x-hidden max-h-[var(--radix-select-content-available-height)]",children:[o.jsx(ba,{}),o.jsx(kc,{"data-position":n,className:J.cn("data-[position=popper]:h-[var(--radix-select-trigger-height)] data-[position=popper]:w-full data-[position=popper]:min-w-[var(--radix-select-trigger-width)]"),children:t}),o.jsx(wa,{})]})]})})}function Hd({className:e,...t}){return o.jsx(_c,{"data-slot":"select-label",className:J.cn("text-muted-foreground px-2 py-1.5 text-xs",e),...t})}function Me({className:e,children:t,...n}){return o.jsxs(Ac,{"data-slot":"select-item",className:J.cn("focus:bg-accent focus:text-accent-foreground hover:bg-accent/60 not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-8 my-0.5 mx-1 gap-2 rounded-md px-2.5 py-1.5 text-sm [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-auto cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[o.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center",children:o.jsx(Lc,{children:o.jsx(H.HugeiconsIcon,{icon:F.Tick02Icon,strokeWidth:2,className:"pointer-events-none"})})}),o.jsx($c,{children:t})]})}function Fd({className:e,...t}){return o.jsx(Hc,{"data-slot":"select-separator",className:J.cn("bg-border/50 -mx-1 my-1 h-px pointer-events-none",e),...t})}function ba({className:e,...t}){return o.jsx(Oc,{"data-slot":"select-scroll-up-button",className:J.cn("bg-popover z-[var(--z-popover)] flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5",e),...t,children:o.jsx(H.HugeiconsIcon,{icon:F.ArrowUp01Icon,strokeWidth:2})})}function wa({className:e,...t}){return o.jsx(Dc,{"data-slot":"select-scroll-down-button",className:J.cn("bg-popover z-[var(--z-popover)] flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5",e),...t,children:o.jsx(H.HugeiconsIcon,{icon:F.ArrowDown01Icon,strokeWidth:2})})}function ya({className:e,orientation:t="horizontal",...n}){return o.jsx(fd,{"data-slot":"tabs","data-orientation":t,className:J.cn("gap-2 group/tabs flex data-[orientation=horizontal]:flex-col",e),...n})}const Bd=ct.cva("rounded-lg p-[3px] group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Ca({className:e,variant:t="default",...n}){return o.jsx(md,{"data-slot":"tabs-list","data-variant":t,className:J.cn(Bd({variant:t}),e),...n})}function Sa({className:e,children:t,...n}){return o.jsx(pd,{"data-slot":"tabs-trigger",className:J.cn("gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-xs font-medium group-data-vertical/tabs:py-[calc(--spacing(1.25))] [&_svg:not([class*='size-'])]:size-3.5 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] min-w-0 max-w-full flex-1 items-center justify-center whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...n,children:ne.wrapInlineLabelTextNodes(t)})}function Na({className:e,...t}){return o.jsx(hd,{"data-slot":"tabs-content",className:J.cn("text-xs flex-1 outline-none",e),...t})}const ko=fe.createContext(void 0),Mo=l.forwardRef(({className:e,value:t,defaultValue:n,onValueChange:r,orientation:s="horizontal",...a},i)=>{typeof fetch=="function"&&fetch("http://127.0.0.1:7253/ingest/dd1618ba-f7a7-49bb-8fc3-5befed63a2f3",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"fde4d0"},body:JSON.stringify({sessionId:"fde4d0",location:"enhanced-tabs.tsx:24",message:"EnhancedTabs orientation prop",data:{orientation:s,fromProps:s!=="horizontal"},timestamp:Date.now(),hypothesisId:"H1"})}).catch(()=>{});const[c,d]=fe.useState(n||""),m=t!==void 0,f=m?t:c,u=x=>{m||d(x),r?.(x)};return o.jsx(ko.Provider,{value:{value:f,onValueChange:u,orientation:s},children:o.jsx(ya,{ref:i,className:e,value:f,defaultValue:n,onValueChange:u,orientation:s,...a})})});Mo.displayName="EnhancedTabs";const _o=l.forwardRef(({className:e,orientation:t,children:n,...r},s)=>{const a=fe.useContext(ko),i=t||a?.orientation||"horizontal",c=J.cn(i==="vertical"&&"flex-col",e);typeof fetch=="function"&&fetch("http://127.0.0.1:7253/ingest/dd1618ba-f7a7-49bb-8fc3-5befed63a2f3",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"fde4d0"},body:JSON.stringify({sessionId:"fde4d0",location:"enhanced-tabs.tsx:EnhancedTabsList",message:"Applied orientation and list className",data:{appliedOrientation:i,contextOrientation:a?.orientation,addsFlexCol:i==="vertical",listClassNameSlice:c.slice(0,100)},timestamp:Date.now(),hypothesisId:"H6"})}).catch(()=>{});const d=fe.useRef(null),[m,f]=fe.useState({}),[u,x]=fe.useState(!1),g=l.useCallback(()=>{if(!d.current||!a?.value){x(!1);return}const p=d.current.querySelector('button[data-state="active"]');if(!p){x(!1);return}const h=d.current.getBoundingClientRect(),w=p.getBoundingClientRect(),v={left:`${w.left-h.left}px`,top:`${w.top-h.top}px`,width:`${w.width}px`,height:`${w.height}px`};f(v),x(!0)},[a?.value,i]);fe.useEffect(()=>{g();const p=requestAnimationFrame(()=>{requestAnimationFrame(g)}),h=new ResizeObserver(()=>{requestAnimationFrame(()=>{requestAnimationFrame(g)})}),w=new MutationObserver(()=>{requestAnimationFrame(()=>{requestAnimationFrame(g)})});return d.current&&(h.observe(d.current),w.observe(d.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-state","class"]})),()=>{cancelAnimationFrame(p),h.disconnect(),w.disconnect()}},[g]);const y=l.useCallback(p=>{d.current=p,typeof s=="function"?s(p):s&&(s.current=p)},[s]);return o.jsxs("div",{ref:y,className:"sliding-indicator-container relative",children:[u&&o.jsx("div",{className:J.cn("sliding-indicator rounded-md","bg-background dark:bg-input/30","border border-input","shadow-sm dark:shadow-sm","text-foreground"),style:m,"aria-hidden":"true"}),o.jsx(Ca,{variant:"default",className:c,...r,children:l.Children.map(n,p=>{if(l.isValidElement(p)){const h=p.props;return l.cloneElement(p,{...h,className:J.cn(h.className,"sliding-indicator-target")})}return p})})]})});_o.displayName="EnhancedTabsList";const Zt=l.forwardRef(({className:e,...t},n)=>{const r=fe.useContext(ko);if(!r)throw new Error("EnhancedTabsTrigger must be used within EnhancedTabs");const s=r?.orientation||"horizontal";return o.jsx(Sa,{ref:n,"data-orientation":s,className:J.cn(e),...t})});Zt.displayName="EnhancedTabsTrigger";const Qt=l.forwardRef(({className:e,...t},n)=>o.jsx(Na,{ref:n,className:J.cn("transition-all duration-200 ease-in-out",e),...t}));Qt.displayName="EnhancedTabsContent";var zd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ja=zd.reduce((e,t)=>{const n=st.createSlot(`Primitive.${t}`),r=l.forwardRef((s,a)=>{const{asChild:i,...c}=s,d=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(d,{...c,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});const et=hr,tt=fo,nt=po;var Vd="Label",Ea=l.forwardRef((e,t)=>o.jsx(ja.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Ea.displayName=Vd;var Ra=Ea;const Wd=ct.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Z=l.forwardRef(({className:e,...t},n)=>o.jsx(Ra,{ref:n,className:J.cn(Wd(),e),...t}));Z.displayName=Ra.displayName;const Xe=l.forwardRef(({className:e,type:t,...n},r)=>o.jsx("input",{type:t,className:J.cn("flex h-7 w-full rounded-md border border-input bg-background px-3 py-1.5 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));Xe.displayName="Input";function Pa({...e}){return o.jsx(ec,{"data-slot":"popover",...e})}function Ta({...e}){return o.jsx(nc,{"data-slot":"popover-trigger",...e})}function Ia({className:e,align:t="center",sideOffset:n=4,...r}){return o.jsx(oc,{children:o.jsx(rc,{"data-slot":"popover-content",align:t,sideOffset:n,className:J.cn("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 flex flex-col gap-4 rounded-lg p-2.5 text-xs shadow-md ring-1 duration-100 z-[var(--z-popover)] w-72 origin-(--radix-popover-content-transform-origin) outline-hidden",e),...r})})}function Ud({...e}){return o.jsx(tc,{"data-slot":"popover-anchor",...e})}const ka=ct.cva("peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",{variants:{size:{sm:"h-5 w-9",default:"h-6 w-11",lg:"h-7 w-[52px]"}},defaultVariants:{size:"default"}}),Ma=ct.cva("pointer-events-none block shrink-0 rounded-full bg-white shadow-[0_2px_6px_rgba(0,0,0,0.22),0_0_1px_rgba(0,0,0,0.12)] ring-0 transition-transform duration-200 ease-out dark:bg-white",{variants:{size:{sm:"h-3 min-w-4 data-[state=unchecked]:translate-x-0.5 data-[state=checked]:translate-x-[14px]",default:"h-4 min-w-5 data-[state=unchecked]:translate-x-0.5 data-[state=checked]:translate-x-[18px]",lg:"h-5 min-w-6 data-[state=unchecked]:translate-x-0.5 data-[state=checked]:translate-x-[22px]"}},defaultVariants:{size:"default"}}),Ce=l.forwardRef(({className:e,size:t,...n},r)=>o.jsx(qs,{className:J.cn(ka({size:t}),e),...n,ref:r,children:o.jsx(cd,{className:Ma({size:t})})}));Ce.displayName=qs.displayName;function ro({className:e,...t}){return o.jsx("textarea",{"data-slot":"textarea",className:J.cn("border-input bg-input/20 dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 resize-none rounded-md border px-2 py-2 text-sm transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})}function me(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ie(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function so({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Ao(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function _a(e,t,n="/"){return Yd(e,t,n,!1)}function Yd(e,t,n,r){let s=typeof t=="string"?Ao(t):t,a=Fe(s.pathname||"/",n);if(a==null)return null;let i=Aa(e);Xd(i);let c=null;for(let d=0;c==null&&d<i.length;++d){let m=ru(a);c=nu(i[d],m,r)}return c}function Aa(e,t=[],n=[],r="",s=!1){let a=(i,c,d=s,m)=>{let f={relativePath:m===void 0?i.path||"":m,caseSensitive:i.caseSensitive===!0,childrenIndex:c,route:i};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(r)&&d)return;me(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length)}let u=_e([r,f.relativePath]),x=n.concat(f);i.children&&i.children.length>0&&(me(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),Aa(i.children,t,x,u,d)),!(i.path==null&&!i.index)&&t.push({path:u,score:eu(u,i.index),routesMeta:x})};return e.forEach((i,c)=>{if(i.path===""||!i.path?.includes("?"))a(i,c);else for(let d of $a(i.path))a(i,c,!0,d)}),t}function $a(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return s?[a,""]:[a];let i=$a(r.join("/")),c=[];return c.push(...i.map(d=>d===""?a:[a,d].join("/"))),s&&c.push(...i),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function Xd(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:tu(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Kd=/^:[\w-]+$/,qd=3,Gd=2,Jd=1,Zd=10,Qd=-2,tr=e=>e==="*";function eu(e,t){let n=e.split("/"),r=n.length;return n.some(tr)&&(r+=Qd),t&&(r+=Gd),n.filter(s=>!tr(s)).reduce((s,a)=>s+(Kd.test(a)?qd:a===""?Jd:Zd),r)}function tu(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function nu(e,t,n=!1){let{routesMeta:r}=e,s={},a="/",i=[];for(let c=0;c<r.length;++c){let d=r[c],m=c===r.length-1,f=a==="/"?t:t.slice(a.length)||"/",u=en({path:d.relativePath,caseSensitive:d.caseSensitive,end:m},f),x=d.route;if(!u&&m&&n&&!r[r.length-1].route.index&&(u=en({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},f)),!u)return null;Object.assign(s,u.params),i.push({params:s,pathname:_e([a,u.pathname]),pathnameBase:lu(_e([a,u.pathnameBase])),route:x}),u.pathnameBase!=="/"&&(a=_e([a,u.pathnameBase]))}return i}function en(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ou(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let a=s[0],i=a.replace(/(.)\/+$/,"$1"),c=s.slice(1);return{params:r.reduce((m,{paramName:f,isOptional:u},x)=>{if(f==="*"){let y=c[x]||"";i=a.slice(0,a.length-y.length).replace(/(.)\/+$/,"$1")}const g=c[x];return u&&!g?m[f]=void 0:m[f]=(g||"").replace(/%2F/g,"/"),m},{}),pathname:a,pathnameBase:i,pattern:e}}function ou(e,t=!1,n=!0){Ie(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,c,d)=>(r.push({paramName:c,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function ru(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ie(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Fe(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var La=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,su=e=>La.test(e);function au(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Ao(e):e,a;if(n)if(su(n))a=n;else{if(n.includes("//")){let i=n;n=n.replace(/\/\/+/g,"/"),Ie(!1,`Pathnames cannot have embedded double slashes - normalizing ${i} -> ${n}`)}n.startsWith("/")?a=nr(n.substring(1),"/"):a=nr(n,t)}else a=t;return{pathname:a,search:cu(r),hash:du(s)}}function nr(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Hn(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function iu(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Oa(e){let t=iu(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Da(e,t,n,r=!1){let s;typeof e=="string"?s=Ao(e):(s={...e},me(!s.pathname||!s.pathname.includes("?"),Hn("?","pathname","search",s)),me(!s.pathname||!s.pathname.includes("#"),Hn("#","pathname","hash",s)),me(!s.search||!s.search.includes("#"),Hn("#","search","hash",s)));let a=e===""||s.pathname==="",i=a?"/":s.pathname,c;if(i==null)c=n;else{let u=t.length-1;if(!r&&i.startsWith("..")){let x=i.split("/");for(;x[0]==="..";)x.shift(),u-=1;s.pathname=x.join("/")}c=u>=0?t[u]:"/"}let d=au(s,c),m=i&&i!=="/"&&i.endsWith("/"),f=(a||i===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(m||f)&&(d.pathname+="/"),d}var _e=e=>e.join("/").replace(/\/\/+/g,"/"),lu=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),cu=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,du=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,uu=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function fu(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function mu(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Ha=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Fa(e,t){let n=e;if(typeof n!="string"||!La.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(Ha)try{let a=new URL(window.location.href),i=n.startsWith("//")?new URL(a.protocol+n):new URL(n),c=Fe(i.pathname,t);i.origin===a.origin&&c!=null?n=c+i.search+i.hash:s=!0}catch{Ie(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ba=["POST","PUT","PATCH","DELETE"];new Set(Ba);var pu=["GET",...Ba];new Set(pu);var pt=l.createContext(null);pt.displayName="DataRouter";var Sn=l.createContext(null);Sn.displayName="DataRouterState";var hu=l.createContext(!1),za=l.createContext({isTransitioning:!1});za.displayName="ViewTransition";var xu=l.createContext(new Map);xu.displayName="Fetchers";var gu=l.createContext(null);gu.displayName="Await";var Ee=l.createContext(null);Ee.displayName="Navigation";var $o=l.createContext(null);$o.displayName="Location";var Le=l.createContext({outlet:null,matches:[],isDataRoute:!1});Le.displayName="Route";var Lo=l.createContext(null);Lo.displayName="RouteError";var Va="REACT_ROUTER_ERROR",vu="REDIRECT",bu="ROUTE_ERROR_RESPONSE";function wu(e){if(e.startsWith(`${Va}:${vu}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function yu(e){if(e.startsWith(`${Va}:${bu}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new uu(t.status,t.statusText,t.data)}catch{}}function Cu(e,{relative:t}={}){me(Nn(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=l.useContext(Ee),{hash:s,pathname:a,search:i}=Mt(e,{relative:t}),c=a;return n!=="/"&&(c=a==="/"?n:_e([n,a])),r.createHref({pathname:c,search:i,hash:s})}function Nn(){return l.useContext($o)!=null}function We(){return me(Nn(),"useLocation() may be used only in the context of a <Router> component."),l.useContext($o).location}var Wa="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ua(e){l.useContext(Ee).static||l.useLayoutEffect(e)}function Su(){let{isDataRoute:e}=l.useContext(Le);return e?Lu():Nu()}function Nu(){me(Nn(),"useNavigate() may be used only in the context of a <Router> component.");let e=l.useContext(pt),{basename:t,navigator:n}=l.useContext(Ee),{matches:r}=l.useContext(Le),{pathname:s}=We(),a=JSON.stringify(Oa(r)),i=l.useRef(!1);return Ua(()=>{i.current=!0}),l.useCallback((d,m={})=>{if(Ie(i.current,Wa),!i.current)return;if(typeof d=="number"){n.go(d);return}let f=Da(d,JSON.parse(a),s,m.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:_e([t,f.pathname])),(m.replace?n.replace:n.push)(f,m.state,m)},[t,n,a,s,e])}l.createContext(null);function Mt(e,{relative:t}={}){let{matches:n}=l.useContext(Le),{pathname:r}=We(),s=JSON.stringify(Oa(n));return l.useMemo(()=>Da(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function ju(e,t,n,r,s){me(Nn(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=l.useContext(Ee),{matches:i}=l.useContext(Le),c=i[i.length-1],d=c?c.params:{},m=c?c.pathname:"/",f=c?c.pathnameBase:"/",u=c&&c.route;{let v=u&&u.path||"";Xa(m,!u||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${v}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
1
+ "use strict";const o=require("react/jsx-runtime"),fe=require("react"),H=require("@hugeicons/react"),F=require("@hugeicons/core-free-icons"),Ye=require("./keyboard-BapbM2wb.cjs"),J=require("./utils-IjLH3w2e.cjs"),li=require("react-dom"),st=require("@radix-ui/react-slot"),ct=require("class-variance-authority"),C=require("./index-CI756mSv.cjs"),ne=require("./button-R304rhsj.cjs");function cr(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 l=cr(fe),co=cr(li);var dr=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ci="VisuallyHidden",ur=l.forwardRef((e,t)=>o.jsx(C.Primitive.span,{...e,ref:t,style:{...dr,...e.style}}));ur.displayName=ci;var fr=ur;function nn(e){const t=e+"CollectionProvider",[n,r]=C.createContextScope(t),[s,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:h,children:w}=p,v=fe.useRef(null),b=fe.useRef(new Map).current;return o.jsx(s,{scope:h,itemMap:b,collectionRef:v,children:w})};i.displayName=t;const c=e+"CollectionSlot",d=st.createSlot(c),m=fe.forwardRef((p,h)=>{const{scope:w,children:v}=p,b=a(c,w),S=C.useComposedRefs(h,b.collectionRef);return o.jsx(d,{ref:S,children:v})});m.displayName=c;const f=e+"CollectionItemSlot",u="data-radix-collection-item",x=st.createSlot(f),g=fe.forwardRef((p,h)=>{const{scope:w,children:v,...b}=p,S=fe.useRef(null),N=C.useComposedRefs(h,S),I=a(f,w);return fe.useEffect(()=>(I.itemMap.set(S,{ref:S,...b}),()=>{I.itemMap.delete(S)})),o.jsx(x,{[u]:"",ref:N,children:v})});g.displayName=f;function y(p){const h=a(e+"CollectionConsumer",p);return fe.useCallback(()=>{const v=h.collectionRef.current;if(!v)return[];const b=Array.from(v.querySelectorAll(`[${u}]`));return Array.from(h.itemMap.values()).sort((I,P)=>b.indexOf(I.ref.current)-b.indexOf(P.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:i,Slot:m,ItemSlot:g},y,r]}var on="Collapsible",[di,ui]=C.createContextScope(on),[fi,uo]=di(on),mr=l.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:a,onOpenChange:i,...c}=e,[d,m]=C.useControllableState({prop:r,defaultProp:s??!1,onChange:i,caller:on});return o.jsx(fi,{scope:n,disabled:a,contentId:C.useId(),open:d,onOpenToggle:l.useCallback(()=>m(f=>!f),[m]),children:o.jsx(C.Primitive.div,{"data-state":ho(d),"data-disabled":a?"":void 0,...c,ref:t})})});mr.displayName=on;var pr="CollapsibleTrigger",fo=l.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=uo(pr,n);return o.jsx(C.Primitive.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":ho(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:C.composeEventHandlers(e.onClick,s.onOpenToggle)})});fo.displayName=pr;var mo="CollapsibleContent",po=l.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=uo(mo,e.__scopeCollapsible);return o.jsx(C.Presence,{present:n||s.open,children:({present:a})=>o.jsx(mi,{...r,ref:t,present:a})})});po.displayName=mo;var mi=l.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...a}=e,i=uo(mo,n),[c,d]=l.useState(r),m=l.useRef(null),f=C.useComposedRefs(t,m),u=l.useRef(0),x=u.current,g=l.useRef(0),y=g.current,p=i.open||c,h=l.useRef(p),w=l.useRef(void 0);return l.useEffect(()=>{const v=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(v)},[]),C.useLayoutEffect2(()=>{const v=m.current;if(v){w.current=w.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const b=v.getBoundingClientRect();u.current=b.height,g.current=b.width,h.current||(v.style.transitionDuration=w.current.transitionDuration,v.style.animationName=w.current.animationName),d(r)}},[i.open,r]),o.jsx(C.Primitive.div,{"data-state":ho(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!p,...a,ref:f,style:{"--radix-collapsible-content-height":x?`${x}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:p&&s})});function ho(e){return e?"open":"closed"}var hr=mr,pi=fo,hi=po,xi=l.createContext(void 0);function Et(e){const t=l.useContext(xi);return e||t||"ltr"}function rn(e){const t=l.useRef({value:e,previous:e});return l.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function sn(e){const[t,n]=l.useState(void 0);return C.useLayoutEffect2(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let i,c;if("borderBoxSize"in a){const d=a.borderBoxSize,m=Array.isArray(d)?d[0]:d;i=m.inlineSize,c=m.blockSize}else i=e.offsetWidth,c=e.offsetHeight;n({width:i,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const gi=["top","right","bottom","left"],De=Math.min,be=Math.max,Yt=Math.round,$t=Math.floor,Pe=e=>({x:e,y:e}),vi={left:"right",right:"left",bottom:"top",top:"bottom"},bi={start:"end",end:"start"};function zn(e,t,n){return be(e,De(t,n))}function Ae(e,t){return typeof e=="function"?e(t):e}function $e(e){return e.split("-")[0]}function dt(e){return e.split("-")[1]}function xo(e){return e==="x"?"y":"x"}function go(e){return e==="y"?"height":"width"}const wi=new Set(["top","bottom"]);function Re(e){return wi.has($e(e))?"y":"x"}function vo(e){return xo(Re(e))}function yi(e,t,n){n===void 0&&(n=!1);const r=dt(e),s=vo(e),a=go(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Xt(i)),[i,Xt(i)]}function Ci(e){const t=Xt(e);return[Vn(e),t,Vn(t)]}function Vn(e){return e.replace(/start|end/g,t=>bi[t])}const Wo=["left","right"],Uo=["right","left"],Si=["top","bottom"],Ni=["bottom","top"];function ji(e,t,n){switch(e){case"top":case"bottom":return n?t?Uo:Wo:t?Wo:Uo;case"left":case"right":return t?Si:Ni;default:return[]}}function Ei(e,t,n,r){const s=dt(e);let a=ji($e(e),n==="start",r);return s&&(a=a.map(i=>i+"-"+s),t&&(a=a.concat(a.map(Vn)))),a}function Xt(e){return e.replace(/left|right|bottom|top/g,t=>vi[t])}function Ri(e){return{top:0,right:0,bottom:0,left:0,...e}}function xr(e){return typeof e!="number"?Ri(e):{top:e,right:e,bottom:e,left:e}}function Kt(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Yo(e,t,n){let{reference:r,floating:s}=e;const a=Re(t),i=vo(t),c=go(i),d=$e(t),m=a==="y",f=r.x+r.width/2-s.width/2,u=r.y+r.height/2-s.height/2,x=r[c]/2-s[c]/2;let g;switch(d){case"top":g={x:f,y:r.y-s.height};break;case"bottom":g={x:f,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:u};break;case"left":g={x:r.x-s.width,y:u};break;default:g={x:r.x,y:r.y}}switch(dt(t)){case"start":g[i]-=x*(n&&m?-1:1);break;case"end":g[i]+=x*(n&&m?-1:1);break}return g}const Pi=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:i}=n,c=a.filter(Boolean),d=await(i.isRTL==null?void 0:i.isRTL(t));let m=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:f,y:u}=Yo(m,r,d),x=r,g={},y=0;for(let p=0;p<c.length;p++){const{name:h,fn:w}=c[p],{x:v,y:b,data:S,reset:N}=await w({x:f,y:u,initialPlacement:r,placement:x,strategy:s,middlewareData:g,rects:m,platform:i,elements:{reference:e,floating:t}});f=v??f,u=b??u,g={...g,[h]:{...g[h],...S}},N&&y<=50&&(y++,typeof N=="object"&&(N.placement&&(x=N.placement),N.rects&&(m=N.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):N.rects),{x:f,y:u}=Yo(m,x,d)),p=-1)}return{x:f,y:u,placement:x,strategy:s,middlewareData:g}};async function Ct(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:i,elements:c,strategy:d}=e,{boundary:m="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:x=!1,padding:g=0}=Ae(t,e),y=xr(g),h=c[x?u==="floating"?"reference":"floating":u],w=Kt(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(h)))==null||n?h:h.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:m,rootBoundary:f,strategy:d})),v=u==="floating"?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating)),S=await(a.isElement==null?void 0:a.isElement(b))?await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1}:{x:1,y:1},N=Kt(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:v,offsetParent:b,strategy:d}):v);return{top:(w.top-N.top+y.top)/S.y,bottom:(N.bottom-w.bottom+y.bottom)/S.y,left:(w.left-N.left+y.left)/S.x,right:(N.right-w.right+y.right)/S.x}}const Ti=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:i,elements:c,middlewareData:d}=t,{element:m,padding:f=0}=Ae(e,t)||{};if(m==null)return{};const u=xr(f),x={x:n,y:r},g=vo(s),y=go(g),p=await i.getDimensions(m),h=g==="y",w=h?"top":"left",v=h?"bottom":"right",b=h?"clientHeight":"clientWidth",S=a.reference[y]+a.reference[g]-x[g]-a.floating[y],N=x[g]-a.reference[g],I=await(i.getOffsetParent==null?void 0:i.getOffsetParent(m));let P=I?I[b]:0;(!P||!await(i.isElement==null?void 0:i.isElement(I)))&&(P=c.floating[b]||a.floating[y]);const E=S/2-N/2,_=P/2-p[y]/2-1,A=De(u[w],_),M=De(u[v],_),z=A,V=P-p[y]-M,B=P/2-p[y]/2+E,U=zn(z,B,V),O=!d.arrow&&dt(s)!=null&&B!==U&&a.reference[y]/2-(B<z?A:M)-p[y]/2<0,X=O?B<z?B-z:B-V:0;return{[g]:x[g]+X,data:{[g]:U,centerOffset:B-U-X,...O&&{alignmentOffset:X}},reset:O}}}),Ii=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:a,rects:i,initialPlacement:c,platform:d,elements:m}=t,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:x,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:p=!0,...h}=Ae(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const w=$e(s),v=Re(c),b=$e(c)===c,S=await(d.isRTL==null?void 0:d.isRTL(m.floating)),N=x||(b||!p?[Xt(c)]:Ci(c)),I=y!=="none";!x&&I&&N.push(...Ei(c,p,y,S));const P=[c,...N],E=await Ct(t,h),_=[];let A=((r=a.flip)==null?void 0:r.overflows)||[];if(f&&_.push(E[w]),u){const B=yi(s,i,S);_.push(E[B[0]],E[B[1]])}if(A=[...A,{placement:s,overflows:_}],!_.every(B=>B<=0)){var M,z;const B=(((M=a.flip)==null?void 0:M.index)||0)+1,U=P[B];if(U&&(!(u==="alignment"?v!==Re(U):!1)||A.every(D=>Re(D.placement)===v?D.overflows[0]>0:!0)))return{data:{index:B,overflows:A},reset:{placement:U}};let O=(z=A.filter(X=>X.overflows[0]<=0).sort((X,D)=>X.overflows[1]-D.overflows[1])[0])==null?void 0:z.placement;if(!O)switch(g){case"bestFit":{var V;const X=(V=A.filter(D=>{if(I){const G=Re(D.placement);return G===v||G==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(G=>G>0).reduce((G,Q)=>G+Q,0)]).sort((D,G)=>D[1]-G[1])[0])==null?void 0:V[0];X&&(O=X);break}case"initialPlacement":O=c;break}if(s!==O)return{reset:{placement:O}}}return{}}}};function Xo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ko(e){return gi.some(t=>e[t]>=0)}const ki=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Ae(e,t);switch(r){case"referenceHidden":{const a=await Ct(t,{...s,elementContext:"reference"}),i=Xo(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Ko(i)}}}case"escaped":{const a=await Ct(t,{...s,altBoundary:!0}),i=Xo(a,n.floating);return{data:{escapedOffsets:i,escaped:Ko(i)}}}default:return{}}}}},gr=new Set(["left","top"]);async function Mi(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=$e(n),c=dt(n),d=Re(n)==="y",m=gr.has(i)?-1:1,f=a&&d?-1:1,u=Ae(t,e);let{mainAxis:x,crossAxis:g,alignmentAxis:y}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof y=="number"&&(g=c==="end"?y*-1:y),d?{x:g*f,y:x*m}:{x:x*m,y:g*f}}const _i=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:a,placement:i,middlewareData:c}=t,d=await Mi(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+d.x,y:a+d.y,data:{...d,placement:i}}}}},Ai=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:c={fn:h=>{let{x:w,y:v}=h;return{x:w,y:v}}},...d}=Ae(e,t),m={x:n,y:r},f=await Ct(t,d),u=Re($e(s)),x=xo(u);let g=m[x],y=m[u];if(a){const h=x==="y"?"top":"left",w=x==="y"?"bottom":"right",v=g+f[h],b=g-f[w];g=zn(v,g,b)}if(i){const h=u==="y"?"top":"left",w=u==="y"?"bottom":"right",v=y+f[h],b=y-f[w];y=zn(v,y,b)}const p=c.fn({...t,[x]:g,[u]:y});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[x]:a,[u]:i}}}}}},$i=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:a,middlewareData:i}=t,{offset:c=0,mainAxis:d=!0,crossAxis:m=!0}=Ae(e,t),f={x:n,y:r},u=Re(s),x=xo(u);let g=f[x],y=f[u];const p=Ae(c,t),h=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(d){const b=x==="y"?"height":"width",S=a.reference[x]-a.floating[b]+h.mainAxis,N=a.reference[x]+a.reference[b]-h.mainAxis;g<S?g=S:g>N&&(g=N)}if(m){var w,v;const b=x==="y"?"width":"height",S=gr.has($e(s)),N=a.reference[u]-a.floating[b]+(S&&((w=i.offset)==null?void 0:w[u])||0)+(S?0:h.crossAxis),I=a.reference[u]+a.reference[b]+(S?0:((v=i.offset)==null?void 0:v[u])||0)-(S?h.crossAxis:0);y<N?y=N:y>I&&(y=I)}return{[x]:g,[u]:y}}}},Li=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:a,platform:i,elements:c}=t,{apply:d=()=>{},...m}=Ae(e,t),f=await Ct(t,m),u=$e(s),x=dt(s),g=Re(s)==="y",{width:y,height:p}=a.floating;let h,w;u==="top"||u==="bottom"?(h=u,w=x===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(w=u,h=x==="end"?"top":"bottom");const v=p-f.top-f.bottom,b=y-f.left-f.right,S=De(p-f[h],v),N=De(y-f[w],b),I=!t.middlewareData.shift;let P=S,E=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=v),I&&!x){const A=be(f.left,0),M=be(f.right,0),z=be(f.top,0),V=be(f.bottom,0);g?E=y-2*(A!==0||M!==0?A+M:be(f.left,f.right)):P=p-2*(z!==0||V!==0?z+V:be(f.top,f.bottom))}await d({...t,availableWidth:E,availableHeight:P});const _=await i.getDimensions(c.floating);return y!==_.width||p!==_.height?{reset:{rects:!0}}:{}}}};function an(){return typeof window<"u"}function ut(e){return vr(e)?(e.nodeName||"").toLowerCase():"#document"}function we(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ke(e){var t;return(t=(vr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vr(e){return an()?e instanceof Node||e instanceof we(e).Node:!1}function Ne(e){return an()?e instanceof Element||e instanceof we(e).Element:!1}function Te(e){return an()?e instanceof HTMLElement||e instanceof we(e).HTMLElement:!1}function qo(e){return!an()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof we(e).ShadowRoot}const Oi=new Set(["inline","contents"]);function Rt(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=je(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Oi.has(s)}const Di=new Set(["table","td","th"]);function Hi(e){return Di.has(ut(e))}const Fi=[":popover-open",":modal"];function ln(e){return Fi.some(t=>{try{return e.matches(t)}catch{return!1}})}const Bi=["transform","translate","scale","rotate","perspective"],zi=["transform","translate","scale","rotate","perspective","filter"],Vi=["paint","layout","strict","content"];function bo(e){const t=wo(),n=Ne(e)?je(e):e;return Bi.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||zi.some(r=>(n.willChange||"").includes(r))||Vi.some(r=>(n.contain||"").includes(r))}function Wi(e){let t=He(e);for(;Te(t)&&!at(t);){if(bo(t))return t;if(ln(t))return null;t=He(t)}return null}function wo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ui=new Set(["html","body","#document"]);function at(e){return Ui.has(ut(e))}function je(e){return we(e).getComputedStyle(e)}function cn(e){return Ne(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function He(e){if(ut(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qo(e)&&e.host||ke(e);return qo(t)?t.host:t}function br(e){const t=He(e);return at(t)?e.ownerDocument?e.ownerDocument.body:e.body:Te(t)&&Rt(t)?t:br(t)}function St(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=br(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),i=we(s);if(a){const c=Wn(i);return t.concat(i,i.visualViewport||[],Rt(s)?s:[],c&&n?St(c):[])}return t.concat(s,St(s,[],n))}function Wn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wr(e){const t=je(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Te(e),a=s?e.offsetWidth:n,i=s?e.offsetHeight:r,c=Yt(n)!==a||Yt(r)!==i;return c&&(n=a,r=i),{width:n,height:r,$:c}}function yo(e){return Ne(e)?e:e.contextElement}function rt(e){const t=yo(e);if(!Te(t))return Pe(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=wr(t);let i=(a?Yt(n.width):n.width)/r,c=(a?Yt(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Yi=Pe(0);function yr(e){const t=we(e);return!wo()||!t.visualViewport?Yi:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xi(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==we(e)?!1:t}function Ke(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=yo(e);let i=Pe(1);t&&(r?Ne(r)&&(i=rt(r)):i=rt(e));const c=Xi(a,n,r)?yr(a):Pe(0);let d=(s.left+c.x)/i.x,m=(s.top+c.y)/i.y,f=s.width/i.x,u=s.height/i.y;if(a){const x=we(a),g=r&&Ne(r)?we(r):r;let y=x,p=Wn(y);for(;p&&r&&g!==y;){const h=rt(p),w=p.getBoundingClientRect(),v=je(p),b=w.left+(p.clientLeft+parseFloat(v.paddingLeft))*h.x,S=w.top+(p.clientTop+parseFloat(v.paddingTop))*h.y;d*=h.x,m*=h.y,f*=h.x,u*=h.y,d+=b,m+=S,y=we(p),p=Wn(y)}}return Kt({width:f,height:u,x:d,y:m})}function dn(e,t){const n=cn(e).scrollLeft;return t?t.left+n:Ke(ke(e)).left+n}function Cr(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-dn(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function Ki(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",i=ke(r),c=t?ln(t.floating):!1;if(r===i||c&&a)return n;let d={scrollLeft:0,scrollTop:0},m=Pe(1);const f=Pe(0),u=Te(r);if((u||!u&&!a)&&((ut(r)!=="body"||Rt(i))&&(d=cn(r)),Te(r))){const g=Ke(r);m=rt(r),f.x=g.x+r.clientLeft,f.y=g.y+r.clientTop}const x=i&&!u&&!a?Cr(i,d):Pe(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-d.scrollLeft*m.x+f.x+x.x,y:n.y*m.y-d.scrollTop*m.y+f.y+x.y}}function qi(e){return Array.from(e.getClientRects())}function Gi(e){const t=ke(e),n=cn(e),r=e.ownerDocument.body,s=be(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=be(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+dn(e);const c=-n.scrollTop;return je(r).direction==="rtl"&&(i+=be(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:i,y:c}}const Go=25;function Ji(e,t){const n=we(e),r=ke(e),s=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,c=0,d=0;if(s){a=s.width,i=s.height;const f=wo();(!f||f&&t==="fixed")&&(c=s.offsetLeft,d=s.offsetTop)}const m=dn(r);if(m<=0){const f=r.ownerDocument,u=f.body,x=getComputedStyle(u),g=f.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,y=Math.abs(r.clientWidth-u.clientWidth-g);y<=Go&&(a-=y)}else m<=Go&&(a+=m);return{width:a,height:i,x:c,y:d}}const Zi=new Set(["absolute","fixed"]);function Qi(e,t){const n=Ke(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=Te(e)?rt(e):Pe(1),i=e.clientWidth*a.x,c=e.clientHeight*a.y,d=s*a.x,m=r*a.y;return{width:i,height:c,x:d,y:m}}function Jo(e,t,n){let r;if(t==="viewport")r=Ji(e,n);else if(t==="document")r=Gi(ke(e));else if(Ne(t))r=Qi(t,n);else{const s=yr(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Kt(r)}function Sr(e,t){const n=He(e);return n===t||!Ne(n)||at(n)?!1:je(n).position==="fixed"||Sr(n,t)}function el(e,t){const n=t.get(e);if(n)return n;let r=St(e,[],!1).filter(c=>Ne(c)&&ut(c)!=="body"),s=null;const a=je(e).position==="fixed";let i=a?He(e):e;for(;Ne(i)&&!at(i);){const c=je(i),d=bo(i);!d&&c.position==="fixed"&&(s=null),(a?!d&&!s:!d&&c.position==="static"&&!!s&&Zi.has(s.position)||Rt(i)&&!d&&Sr(e,i))?r=r.filter(f=>f!==i):s=c,i=He(i)}return t.set(e,r),r}function tl(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?ln(t)?[]:el(t,this._c):[].concat(n),r],c=i[0],d=i.reduce((m,f)=>{const u=Jo(t,f,s);return m.top=be(u.top,m.top),m.right=De(u.right,m.right),m.bottom=De(u.bottom,m.bottom),m.left=be(u.left,m.left),m},Jo(t,c,s));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function nl(e){const{width:t,height:n}=wr(e);return{width:t,height:n}}function ol(e,t,n){const r=Te(t),s=ke(t),a=n==="fixed",i=Ke(e,!0,a,t);let c={scrollLeft:0,scrollTop:0};const d=Pe(0);function m(){d.x=dn(s)}if(r||!r&&!a)if((ut(t)!=="body"||Rt(s))&&(c=cn(t)),r){const g=Ke(t,!0,a,t);d.x=g.x+t.clientLeft,d.y=g.y+t.clientTop}else s&&m();a&&!r&&s&&m();const f=s&&!r&&!a?Cr(s,c):Pe(0),u=i.left+c.scrollLeft-d.x-f.x,x=i.top+c.scrollTop-d.y-f.y;return{x:u,y:x,width:i.width,height:i.height}}function $n(e){return je(e).position==="static"}function Zo(e,t){if(!Te(e)||je(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ke(e)===n&&(n=n.ownerDocument.body),n}function Nr(e,t){const n=we(e);if(ln(e))return n;if(!Te(e)){let s=He(e);for(;s&&!at(s);){if(Ne(s)&&!$n(s))return s;s=He(s)}return n}let r=Zo(e,t);for(;r&&Hi(r)&&$n(r);)r=Zo(r,t);return r&&at(r)&&$n(r)&&!bo(r)?n:r||Wi(e)||n}const rl=async function(e){const t=this.getOffsetParent||Nr,n=this.getDimensions,r=await n(e.floating);return{reference:ol(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sl(e){return je(e).direction==="rtl"}const al={convertOffsetParentRelativeRectToViewportRelativeRect:Ki,getDocumentElement:ke,getClippingRect:tl,getOffsetParent:Nr,getElementRects:rl,getClientRects:qi,getDimensions:nl,getScale:rt,isElement:Ne,isRTL:sl};function jr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function il(e,t){let n=null,r;const s=ke(e);function a(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function i(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),a();const m=e.getBoundingClientRect(),{left:f,top:u,width:x,height:g}=m;if(c||t(),!x||!g)return;const y=$t(u),p=$t(s.clientWidth-(f+x)),h=$t(s.clientHeight-(u+g)),w=$t(f),b={rootMargin:-y+"px "+-p+"px "+-h+"px "+-w+"px",threshold:be(0,De(1,d))||1};let S=!0;function N(I){const P=I[0].intersectionRatio;if(P!==d){if(!S)return i();P?i(!1,P):r=setTimeout(()=>{i(!1,1e-7)},1e3)}P===1&&!jr(m,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(N,{...b,root:s.ownerDocument})}catch{n=new IntersectionObserver(N,b)}n.observe(e)}return i(!0),a}function ll(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,m=yo(e),f=s||a?[...m?St(m):[],...St(t)]:[];f.forEach(w=>{s&&w.addEventListener("scroll",n,{passive:!0}),a&&w.addEventListener("resize",n)});const u=m&&c?il(m,n):null;let x=-1,g=null;i&&(g=new ResizeObserver(w=>{let[v]=w;v&&v.target===m&&g&&(g.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var b;(b=g)==null||b.observe(t)})),n()}),m&&!d&&g.observe(m),g.observe(t));let y,p=d?Ke(e):null;d&&h();function h(){const w=Ke(e);p&&!jr(p,w)&&n(),p=w,y=requestAnimationFrame(h)}return n(),()=>{var w;f.forEach(v=>{s&&v.removeEventListener("scroll",n),a&&v.removeEventListener("resize",n)}),u?.(),(w=g)==null||w.disconnect(),g=null,d&&cancelAnimationFrame(y)}}const cl=_i,dl=Ai,ul=Ii,fl=Li,ml=ki,Qo=Ti,pl=$i,hl=(e,t,n)=>{const r=new Map,s={platform:al,...n},a={...s.platform,_c:r};return Pi(e,t,{...s,platform:a})};var xl=typeof document<"u",gl=function(){},Ht=xl?fe.useLayoutEffect:gl;function qt(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,s;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(!qt(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!qt(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Er(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function er(e,t){const n=Er(e);return Math.round(t*n)/n}function Ln(e){const t=l.useRef(e);return Ht(()=>{t.current=e}),t}function vl(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:i}={},transform:c=!0,whileElementsMounted:d,open:m}=e,[f,u]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,g]=l.useState(r);qt(x,r)||g(r);const[y,p]=l.useState(null),[h,w]=l.useState(null),v=l.useCallback(D=>{D!==I.current&&(I.current=D,p(D))},[]),b=l.useCallback(D=>{D!==P.current&&(P.current=D,w(D))},[]),S=a||y,N=i||h,I=l.useRef(null),P=l.useRef(null),E=l.useRef(f),_=d!=null,A=Ln(d),M=Ln(s),z=Ln(m),V=l.useCallback(()=>{if(!I.current||!P.current)return;const D={placement:t,strategy:n,middleware:x};M.current&&(D.platform=M.current),hl(I.current,P.current,D).then(G=>{const Q={...G,isPositioned:z.current!==!1};B.current&&!qt(E.current,Q)&&(E.current=Q,co.flushSync(()=>{u(Q)}))})},[x,t,n,M,z]);Ht(()=>{m===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,u(D=>({...D,isPositioned:!1})))},[m]);const B=l.useRef(!1);Ht(()=>(B.current=!0,()=>{B.current=!1}),[]),Ht(()=>{if(S&&(I.current=S),N&&(P.current=N),S&&N){if(A.current)return A.current(S,N,V);V()}},[S,N,V,A,_]);const U=l.useMemo(()=>({reference:I,floating:P,setReference:v,setFloating:b}),[v,b]),O=l.useMemo(()=>({reference:S,floating:N}),[S,N]),X=l.useMemo(()=>{const D={position:n,left:0,top:0};if(!O.floating)return D;const G=er(O.floating,f.x),Q=er(O.floating,f.y);return c?{...D,transform:"translate("+G+"px, "+Q+"px)",...Er(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:Q}},[n,c,O.floating,f.x,f.y]);return l.useMemo(()=>({...f,update:V,refs:U,elements:O,floatingStyles:X}),[f,V,U,O,X])}const bl=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Qo({element:r.current,padding:s}).fn(n):{}:r?Qo({element:r,padding:s}).fn(n):{}}}},wl=(e,t)=>({...cl(e),options:[e,t]}),yl=(e,t)=>({...dl(e),options:[e,t]}),Cl=(e,t)=>({...pl(e),options:[e,t]}),Sl=(e,t)=>({...ul(e),options:[e,t]}),Nl=(e,t)=>({...fl(e),options:[e,t]}),jl=(e,t)=>({...ml(e),options:[e,t]}),El=(e,t)=>({...bl(e),options:[e,t]});var Rl="Arrow",Rr=l.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...a}=e;return o.jsx(C.Primitive.svg,{...a,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});Rr.displayName=Rl;var Pl=Rr,Co="Popper",[Pr,Je]=C.createContextScope(Co),[Tl,Tr]=Pr(Co),Ir=e=>{const{__scopePopper:t,children:n}=e,[r,s]=l.useState(null);return o.jsx(Tl,{scope:t,anchor:r,onAnchorChange:s,children:n})};Ir.displayName=Co;var kr="PopperAnchor",Mr=l.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,a=Tr(kr,n),i=l.useRef(null),c=C.useComposedRefs(t,i),d=l.useRef(null);return l.useEffect(()=>{const m=d.current;d.current=r?.current||i.current,m!==d.current&&a.onAnchorChange(d.current)}),r?null:o.jsx(C.Primitive.div,{...s,ref:c})});Mr.displayName=kr;var So="PopperContent",[Il,kl]=Pr(So),_r=l.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:m=[],collisionPadding:f=0,sticky:u="partial",hideWhenDetached:x=!1,updatePositionStrategy:g="optimized",onPlaced:y,...p}=e,h=Tr(So,n),[w,v]=l.useState(null),b=C.useComposedRefs(t,Y=>v(Y)),[S,N]=l.useState(null),I=sn(S),P=I?.width??0,E=I?.height??0,_=r+(a!=="center"?"-"+a:""),A=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},M=Array.isArray(m)?m:[m],z=M.length>0,V={padding:A,boundary:M.filter(_l),altBoundary:z},{refs:B,floatingStyles:U,placement:O,isPositioned:X,middlewareData:D}=vl({strategy:"fixed",placement:_,whileElementsMounted:(...Y)=>ll(...Y,{animationFrame:g==="always"}),elements:{reference:h.anchor},middleware:[wl({mainAxis:s+E,alignmentAxis:i}),d&&yl({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Cl():void 0,...V}),d&&Sl({...V}),Nl({...V,apply:({elements:Y,rects:te,availableWidth:K,availableHeight:oe})=>{const{width:W,height:j}=te.reference,R=Y.floating.style;R.setProperty("--radix-popper-available-width",`${K}px`),R.setProperty("--radix-popper-available-height",`${oe}px`),R.setProperty("--radix-popper-anchor-width",`${W}px`),R.setProperty("--radix-popper-anchor-height",`${j}px`)}}),S&&El({element:S,padding:c}),Al({arrowWidth:P,arrowHeight:E}),x&&jl({strategy:"referenceHidden",...V})]}),[G,Q]=Lr(O),pe=C.useCallbackRef(y);C.useLayoutEffect2(()=>{X&&pe?.()},[X,pe]);const de=D.arrow?.x,ce=D.arrow?.y,he=D.arrow?.centerOffset!==0,[xe,ee]=l.useState();return C.useLayoutEffect2(()=>{w&&ee(window.getComputedStyle(w).zIndex)},[w]),o.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:X?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:xe,"--radix-popper-transform-origin":[D.transformOrigin?.x,D.transformOrigin?.y].join(" "),...D.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(Il,{scope:n,placedSide:G,onArrowChange:N,arrowX:de,arrowY:ce,shouldHideArrow:he,children:o.jsx(C.Primitive.div,{"data-side":G,"data-align":Q,...p,ref:b,style:{...p.style,animation:X?void 0:"none"}})})})});_r.displayName=So;var Ar="PopperArrow",Ml={top:"bottom",right:"left",bottom:"top",left:"right"},$r=l.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,a=kl(Ar,r),i=Ml[a.placedSide];return o.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:o.jsx(Pl,{...s,ref:n,style:{...s.style,display:"block"}})})});$r.displayName=Ar;function _l(e){return e!==null}var Al=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:s}=t,i=s.arrow?.centerOffset!==0,c=i?0:e.arrowWidth,d=i?0:e.arrowHeight,[m,f]=Lr(n),u={start:"0%",center:"50%",end:"100%"}[f],x=(s.arrow?.x??0)+c/2,g=(s.arrow?.y??0)+d/2;let y="",p="";return m==="bottom"?(y=i?u:`${x}px`,p=`${-d}px`):m==="top"?(y=i?u:`${x}px`,p=`${r.floating.height+d}px`):m==="right"?(y=`${-d}px`,p=i?u:`${g}px`):m==="left"&&(y=`${r.floating.width+d}px`,p=i?u:`${g}px`),{data:{x:y,y:p}}}});function Lr(e){const[t,n="center"]=e.split("-");return[t,n]}var un=Ir,Pt=Mr,fn=_r,mn=$r,On="rovingFocusGroup.onEntryFocus",$l={bubbles:!1,cancelable:!0},Tt="RovingFocusGroup",[Un,Or,Ll]=nn(Tt),[Ol,No]=C.createContextScope(Tt,[Ll]),[Dl,Hl]=Ol(Tt),Dr=l.forwardRef((e,t)=>o.jsx(Un.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(Un.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(Fl,{...e,ref:t})})}));Dr.displayName=Tt;var Fl=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:m,preventScrollOnEntryFocus:f=!1,...u}=e,x=l.useRef(null),g=C.useComposedRefs(t,x),y=Et(a),[p,h]=C.useControllableState({prop:i,defaultProp:c??null,onChange:d,caller:Tt}),[w,v]=l.useState(!1),b=C.useCallbackRef(m),S=Or(n),N=l.useRef(!1),[I,P]=l.useState(0);return l.useEffect(()=>{const E=x.current;if(E)return E.addEventListener(On,b),()=>E.removeEventListener(On,b)},[b]),o.jsx(Dl,{scope:n,orientation:r,dir:y,loop:s,currentTabStopId:p,onItemFocus:l.useCallback(E=>h(E),[h]),onItemShiftTab:l.useCallback(()=>v(!0),[]),onFocusableItemAdd:l.useCallback(()=>P(E=>E+1),[]),onFocusableItemRemove:l.useCallback(()=>P(E=>E-1),[]),children:o.jsx(C.Primitive.div,{tabIndex:w||I===0?-1:0,"data-orientation":r,...u,ref:g,style:{outline:"none",...e.style},onMouseDown:C.composeEventHandlers(e.onMouseDown,()=>{N.current=!0}),onFocus:C.composeEventHandlers(e.onFocus,E=>{const _=!N.current;if(E.target===E.currentTarget&&_&&!w){const A=new CustomEvent(On,$l);if(E.currentTarget.dispatchEvent(A),!A.defaultPrevented){const M=S().filter(O=>O.focusable),z=M.find(O=>O.active),V=M.find(O=>O.id===p),U=[z,V,...M].filter(Boolean).map(O=>O.ref.current);Br(U,f)}}N.current=!1}),onBlur:C.composeEventHandlers(e.onBlur,()=>v(!1))})})}),Hr="RovingFocusGroupItem",Fr=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:a,children:i,...c}=e,d=C.useId(),m=a||d,f=Hl(Hr,n),u=f.currentTabStopId===m,x=Or(n),{onFocusableItemAdd:g,onFocusableItemRemove:y,currentTabStopId:p}=f;return l.useEffect(()=>{if(r)return g(),()=>y()},[r,g,y]),o.jsx(Un.ItemSlot,{scope:n,id:m,focusable:r,active:s,children:o.jsx(C.Primitive.span,{tabIndex:u?0:-1,"data-orientation":f.orientation,...c,ref:t,onMouseDown:C.composeEventHandlers(e.onMouseDown,h=>{r?f.onItemFocus(m):h.preventDefault()}),onFocus:C.composeEventHandlers(e.onFocus,()=>f.onItemFocus(m)),onKeyDown:C.composeEventHandlers(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){f.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const w=Vl(h,f.orientation,f.dir);if(w!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let b=x().filter(S=>S.focusable).map(S=>S.ref.current);if(w==="last")b.reverse();else if(w==="prev"||w==="next"){w==="prev"&&b.reverse();const S=b.indexOf(h.currentTarget);b=f.loop?Wl(b,S+1):b.slice(S+1)}setTimeout(()=>Br(b))}}),children:typeof i=="function"?i({isCurrentTabStop:u,hasTabStop:p!=null}):i})})});Fr.displayName=Hr;var Bl={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function zl(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Vl(e,t,n){const r=zl(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Bl[r]}function Br(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Wl(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var zr=Dr,Vr=Fr;function Nt(e,[t,n]){return Math.min(n,Math.max(t,e))}var pn="Popover",[Wr]=C.createContextScope(pn,[Je]),It=Je(),[Ul,Be]=Wr(pn),Ur=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:i=!1}=e,c=It(t),d=l.useRef(null),[m,f]=l.useState(!1),[u,x]=C.useControllableState({prop:r,defaultProp:s??!1,onChange:a,caller:pn});return o.jsx(un,{...c,children:o.jsx(Ul,{scope:t,contentId:C.useId(),triggerRef:d,open:u,onOpenChange:x,onOpenToggle:l.useCallback(()=>x(g=>!g),[x]),hasCustomAnchor:m,onCustomAnchorAdd:l.useCallback(()=>f(!0),[]),onCustomAnchorRemove:l.useCallback(()=>f(!1),[]),modal:i,children:n})})};Ur.displayName=pn;var Yr="PopoverAnchor",Xr=l.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Be(Yr,n),a=It(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:c}=s;return l.useEffect(()=>(i(),()=>c()),[i,c]),o.jsx(Pt,{...a,...r,ref:t})});Xr.displayName=Yr;var Kr="PopoverTrigger",qr=l.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Be(Kr,n),a=It(n),i=C.useComposedRefs(t,s.triggerRef),c=o.jsx(C.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":es(s.open),...r,ref:i,onClick:C.composeEventHandlers(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:o.jsx(Pt,{asChild:!0,...a,children:c})});qr.displayName=Kr;var jo="PopoverPortal",[Yl,Xl]=Wr(jo,{forceMount:void 0}),Gr=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,a=Be(jo,t);return o.jsx(Yl,{scope:t,forceMount:n,children:o.jsx(C.Presence,{present:n||a.open,children:o.jsx(C.Portal,{asChild:!0,container:s,children:r})})})};Gr.displayName=jo;var it="PopoverContent",Jr=l.forwardRef((e,t)=>{const n=Xl(it,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,a=Be(it,e.__scopePopover);return o.jsx(C.Presence,{present:r||a.open,children:a.modal?o.jsx(ql,{...s,ref:t}):o.jsx(Gl,{...s,ref:t})})});Jr.displayName=it;var Kl=st.createSlot("PopoverContent.RemoveScroll"),ql=l.forwardRef((e,t)=>{const n=Be(it,e.__scopePopover),r=l.useRef(null),s=C.useComposedRefs(t,r),a=l.useRef(!1);return l.useEffect(()=>{const i=r.current;if(i)return C.hideOthers(i)},[]),o.jsx(C.ReactRemoveScroll,{as:Kl,allowPinchZoom:!0,children:o.jsx(Zr,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:C.composeEventHandlers(e.onCloseAutoFocus,i=>{i.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:C.composeEventHandlers(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,m=c.button===2||d;a.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:C.composeEventHandlers(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Gl=l.forwardRef((e,t)=>{const n=Be(it,e.__scopePopover),r=l.useRef(!1),s=l.useRef(!1);return o.jsx(Zr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||n.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=a.target;n.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),Zr=l.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:m,onInteractOutside:f,...u}=e,x=Be(it,n),g=It(n);return C.useFocusGuards(),o.jsx(C.FocusScope,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:o.jsx(C.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:m,onDismiss:()=>x.onOpenChange(!1),children:o.jsx(fn,{"data-state":es(x.open),role:"dialog",id:x.contentId,...g,...u,ref:t,style:{...u.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)"}})})})}),Qr="PopoverClose",Jl=l.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Be(Qr,n);return o.jsx(C.Primitive.button,{type:"button",...r,ref:t,onClick:C.composeEventHandlers(e.onClick,()=>s.onOpenChange(!1))})});Jl.displayName=Qr;var Zl="PopoverArrow",Ql=l.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=It(n);return o.jsx(mn,{...s,...r,ref:t})});Ql.displayName=Zl;function es(e){return e?"open":"closed"}var ec=Ur,tc=Xr,nc=qr,oc=Gr,rc=Jr,sc=[" ","Enter","ArrowUp","ArrowDown"],ac=[" ","Enter"],qe="Select",[hn,xn,ic]=nn(qe),[ft]=C.createContextScope(qe,[ic,Je]),gn=Je(),[lc,ze]=ft(qe),[cc,dc]=ft(qe),ts=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:a,value:i,defaultValue:c,onValueChange:d,dir:m,name:f,autoComplete:u,disabled:x,required:g,form:y}=e,p=gn(t),[h,w]=l.useState(null),[v,b]=l.useState(null),[S,N]=l.useState(!1),I=Et(m),[P,E]=C.useControllableState({prop:r,defaultProp:s??!1,onChange:a,caller:qe}),[_,A]=C.useControllableState({prop:i,defaultProp:c,onChange:d,caller:qe}),M=l.useRef(null),z=h?y||!!h.closest("form"):!0,[V,B]=l.useState(new Set),U=Array.from(V).map(O=>O.props.value).join(";");return o.jsx(un,{...p,children:o.jsxs(lc,{required:g,scope:t,trigger:h,onTriggerChange:w,valueNode:v,onValueNodeChange:b,valueNodeHasChildren:S,onValueNodeHasChildrenChange:N,contentId:C.useId(),value:_,onValueChange:A,open:P,onOpenChange:E,dir:I,triggerPointerDownPosRef:M,disabled:x,children:[o.jsx(hn.Provider,{scope:t,children:o.jsx(cc,{scope:e.__scopeSelect,onNativeOptionAdd:l.useCallback(O=>{B(X=>new Set(X).add(O))},[]),onNativeOptionRemove:l.useCallback(O=>{B(X=>{const D=new Set(X);return D.delete(O),D})},[]),children:n})}),z?o.jsxs(Es,{"aria-hidden":!0,required:g,tabIndex:-1,name:f,autoComplete:u,value:_,onChange:O=>A(O.target.value),disabled:x,form:y,children:[_===void 0?o.jsx("option",{value:""}):null,Array.from(V)]},U):null]})})};ts.displayName=qe;var ns="SelectTrigger",os=l.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,a=gn(n),i=ze(ns,n),c=i.disabled||r,d=C.useComposedRefs(t,i.onTriggerChange),m=xn(n),f=l.useRef("touch"),[u,x,g]=Ps(p=>{const h=m().filter(b=>!b.disabled),w=h.find(b=>b.value===i.value),v=Ts(h,p,w);v!==void 0&&i.onValueChange(v.value)}),y=p=>{c||(i.onOpenChange(!0),g()),p&&(i.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return o.jsx(Pt,{asChild:!0,...a,children:o.jsx(C.Primitive.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Rs(i.value)?"":void 0,...s,ref:d,onClick:C.composeEventHandlers(s.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&y(p)}),onPointerDown:C.composeEventHandlers(s.onPointerDown,p=>{f.current=p.pointerType;const h=p.target;h.hasPointerCapture(p.pointerId)&&h.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(y(p),p.preventDefault())}),onKeyDown:C.composeEventHandlers(s.onKeyDown,p=>{const h=u.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&x(p.key),!(h&&p.key===" ")&&sc.includes(p.key)&&(y(),p.preventDefault())})})})});os.displayName=ns;var rs="SelectValue",ss=l.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:a,placeholder:i="",...c}=e,d=ze(rs,n),{onValueNodeHasChildrenChange:m}=d,f=a!==void 0,u=C.useComposedRefs(t,d.onValueNodeChange);return C.useLayoutEffect2(()=>{m(f)},[m,f]),o.jsx(C.Primitive.span,{...c,ref:u,style:{pointerEvents:"none"},children:Rs(d.value)?o.jsx(o.Fragment,{children:i}):a})});ss.displayName=rs;var uc="SelectIcon",as=l.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return o.jsx(C.Primitive.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});as.displayName=uc;var fc="SelectPortal",is=e=>o.jsx(C.Portal,{asChild:!0,...e});is.displayName=fc;var Ge="SelectContent",ls=l.forwardRef((e,t)=>{const n=ze(Ge,e.__scopeSelect),[r,s]=l.useState();if(C.useLayoutEffect2(()=>{s(new DocumentFragment)},[]),!n.open){const a=r;return a?co.createPortal(o.jsx(cs,{scope:e.__scopeSelect,children:o.jsx(hn.Slot,{scope:e.__scopeSelect,children:o.jsx("div",{children:e.children})})}),a):null}return o.jsx(ds,{...e,ref:t})});ls.displayName=Ge;var Se=10,[cs,Ve]=ft(Ge),mc="SelectContentImpl",pc=st.createSlot("SelectContent.RemoveScroll"),ds=l.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:i,side:c,sideOffset:d,align:m,alignOffset:f,arrowPadding:u,collisionBoundary:x,collisionPadding:g,sticky:y,hideWhenDetached:p,avoidCollisions:h,...w}=e,v=ze(Ge,n),[b,S]=l.useState(null),[N,I]=l.useState(null),P=C.useComposedRefs(t,Y=>S(Y)),[E,_]=l.useState(null),[A,M]=l.useState(null),z=xn(n),[V,B]=l.useState(!1),U=l.useRef(!1);l.useEffect(()=>{if(b)return C.hideOthers(b)},[b]),C.useFocusGuards();const O=l.useCallback(Y=>{const[te,...K]=z().map(j=>j.ref.current),[oe]=K.slice(-1),W=document.activeElement;for(const j of Y)if(j===W||(j?.scrollIntoView({block:"nearest"}),j===te&&N&&(N.scrollTop=0),j===oe&&N&&(N.scrollTop=N.scrollHeight),j?.focus(),document.activeElement!==W))return},[z,N]),X=l.useCallback(()=>O([E,b]),[O,E,b]);l.useEffect(()=>{V&&X()},[V,X]);const{onOpenChange:D,triggerPointerDownPosRef:G}=v;l.useEffect(()=>{if(b){let Y={x:0,y:0};const te=oe=>{Y={x:Math.abs(Math.round(oe.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(oe.pageY)-(G.current?.y??0))}},K=oe=>{Y.x<=10&&Y.y<=10?oe.preventDefault():b.contains(oe.target)||D(!1),document.removeEventListener("pointermove",te),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",te),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",K,{capture:!0})}}},[b,D,G]),l.useEffect(()=>{const Y=()=>D(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[D]);const[Q,pe]=Ps(Y=>{const te=z().filter(W=>!W.disabled),K=te.find(W=>W.ref.current===document.activeElement),oe=Ts(te,Y,K);oe&&setTimeout(()=>oe.ref.current.focus())}),de=l.useCallback((Y,te,K)=>{const oe=!U.current&&!K;(v.value!==void 0&&v.value===te||oe)&&(_(Y),oe&&(U.current=!0))},[v.value]),ce=l.useCallback(()=>b?.focus(),[b]),he=l.useCallback((Y,te,K)=>{const oe=!U.current&&!K;(v.value!==void 0&&v.value===te||oe)&&M(Y)},[v.value]),xe=r==="popper"?Yn:us,ee=xe===Yn?{side:c,sideOffset:d,align:m,alignOffset:f,arrowPadding:u,collisionBoundary:x,collisionPadding:g,sticky:y,hideWhenDetached:p,avoidCollisions:h}:{};return o.jsx(cs,{scope:n,content:b,viewport:N,onViewportChange:I,itemRefCallback:de,selectedItem:E,onItemLeave:ce,itemTextRefCallback:he,focusSelectedItem:X,selectedItemText:A,position:r,isPositioned:V,searchRef:Q,children:o.jsx(C.ReactRemoveScroll,{as:pc,allowPinchZoom:!0,children:o.jsx(C.FocusScope,{asChild:!0,trapped:v.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:C.composeEventHandlers(s,Y=>{v.trigger?.focus({preventScroll:!0}),Y.preventDefault()}),children:o.jsx(C.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:o.jsx(xe,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:Y=>Y.preventDefault(),...w,...ee,onPlaced:()=>B(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:C.composeEventHandlers(w.onKeyDown,Y=>{const te=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!te&&Y.key.length===1&&pe(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let oe=z().filter(W=>!W.disabled).map(W=>W.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(oe=oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const W=Y.target,j=oe.indexOf(W);oe=oe.slice(j+1)}setTimeout(()=>O(oe)),Y.preventDefault()}})})})})})})});ds.displayName=mc;var hc="SelectItemAlignedPosition",us=l.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,a=ze(Ge,n),i=Ve(Ge,n),[c,d]=l.useState(null),[m,f]=l.useState(null),u=C.useComposedRefs(t,P=>f(P)),x=xn(n),g=l.useRef(!1),y=l.useRef(!0),{viewport:p,selectedItem:h,selectedItemText:w,focusSelectedItem:v}=i,b=l.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&m&&p&&h&&w){const P=a.trigger.getBoundingClientRect(),E=m.getBoundingClientRect(),_=a.valueNode.getBoundingClientRect(),A=w.getBoundingClientRect();if(a.dir!=="rtl"){const W=A.left-E.left,j=_.left-W,R=P.left-j,T=P.width+R,se=Math.max(T,E.width),ae=window.innerWidth-Se,re=Nt(j,[Se,Math.max(Se,ae-se)]);c.style.minWidth=T+"px",c.style.left=re+"px"}else{const W=E.right-A.right,j=window.innerWidth-_.right-W,R=window.innerWidth-P.right-j,T=P.width+R,se=Math.max(T,E.width),ae=window.innerWidth-Se,re=Nt(j,[Se,Math.max(Se,ae-se)]);c.style.minWidth=T+"px",c.style.right=re+"px"}const M=x(),z=window.innerHeight-Se*2,V=p.scrollHeight,B=window.getComputedStyle(m),U=parseInt(B.borderTopWidth,10),O=parseInt(B.paddingTop,10),X=parseInt(B.borderBottomWidth,10),D=parseInt(B.paddingBottom,10),G=U+O+V+D+X,Q=Math.min(h.offsetHeight*5,G),pe=window.getComputedStyle(p),de=parseInt(pe.paddingTop,10),ce=parseInt(pe.paddingBottom,10),he=P.top+P.height/2-Se,xe=z-he,ee=h.offsetHeight/2,Y=h.offsetTop+ee,te=U+O+Y,K=G-te;if(te<=he){const W=M.length>0&&h===M[M.length-1].ref.current;c.style.bottom="0px";const j=m.clientHeight-p.offsetTop-p.offsetHeight,R=Math.max(xe,ee+(W?ce:0)+j+X),T=te+R;c.style.height=T+"px"}else{const W=M.length>0&&h===M[0].ref.current;c.style.top="0px";const R=Math.max(he,U+p.offsetTop+(W?de:0)+ee)+K;c.style.height=R+"px",p.scrollTop=te-he+p.offsetTop}c.style.margin=`${Se}px 0`,c.style.minHeight=Q+"px",c.style.maxHeight=z+"px",r?.(),requestAnimationFrame(()=>g.current=!0)}},[x,a.trigger,a.valueNode,c,m,p,h,w,a.dir,r]);C.useLayoutEffect2(()=>b(),[b]);const[S,N]=l.useState();C.useLayoutEffect2(()=>{m&&N(window.getComputedStyle(m).zIndex)},[m]);const I=l.useCallback(P=>{P&&y.current===!0&&(b(),v?.(),y.current=!1)},[b,v]);return o.jsx(gc,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:I,children:o.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:o.jsx(C.Primitive.div,{...s,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});us.displayName=hc;var xc="SelectPopperPosition",Yn=l.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Se,...a}=e,i=gn(n);return o.jsx(fn,{...i,...a,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Yn.displayName=xc;var[gc,Eo]=ft(Ge,{}),Xn="SelectViewport",fs=l.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,a=Ve(Xn,n),i=Eo(Xn,n),c=C.useComposedRefs(t,a.onViewportChange),d=l.useRef(0);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),o.jsx(hn.Slot,{scope:n,children:o.jsx(C.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:C.composeEventHandlers(s.onScroll,m=>{const f=m.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:x}=i;if(x?.current&&u){const g=Math.abs(d.current-f.scrollTop);if(g>0){const y=window.innerHeight-Se*2,p=parseFloat(u.style.minHeight),h=parseFloat(u.style.height),w=Math.max(p,h);if(w<y){const v=w+g,b=Math.min(y,v),S=v-b;u.style.height=b+"px",u.style.bottom==="0px"&&(f.scrollTop=S>0?S:0,u.style.justifyContent="flex-end")}}}d.current=f.scrollTop})})})]})});fs.displayName=Xn;var ms="SelectGroup",[vc,bc]=ft(ms),ps=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=C.useId();return o.jsx(vc,{scope:n,id:s,children:o.jsx(C.Primitive.div,{role:"group","aria-labelledby":s,...r,ref:t})})});ps.displayName=ms;var hs="SelectLabel",xs=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=bc(hs,n);return o.jsx(C.Primitive.div,{id:s.id,...r,ref:t})});xs.displayName=hs;var Gt="SelectItem",[wc,gs]=ft(Gt),vs=l.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:a,...i}=e,c=ze(Gt,n),d=Ve(Gt,n),m=c.value===r,[f,u]=l.useState(a??""),[x,g]=l.useState(!1),y=C.useComposedRefs(t,v=>d.itemRefCallback?.(v,r,s)),p=C.useId(),h=l.useRef("touch"),w=()=>{s||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return o.jsx(wc,{scope:n,value:r,disabled:s,textId:p,isSelected:m,onItemTextChange:l.useCallback(v=>{u(b=>b||(v?.textContent??"").trim())},[]),children:o.jsx(hn.ItemSlot,{scope:n,value:r,disabled:s,textValue:f,children:o.jsx(C.Primitive.div,{role:"option","aria-labelledby":p,"data-highlighted":x?"":void 0,"aria-selected":m&&x,"data-state":m?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:y,onFocus:C.composeEventHandlers(i.onFocus,()=>g(!0)),onBlur:C.composeEventHandlers(i.onBlur,()=>g(!1)),onClick:C.composeEventHandlers(i.onClick,()=>{h.current!=="mouse"&&w()}),onPointerUp:C.composeEventHandlers(i.onPointerUp,()=>{h.current==="mouse"&&w()}),onPointerDown:C.composeEventHandlers(i.onPointerDown,v=>{h.current=v.pointerType}),onPointerMove:C.composeEventHandlers(i.onPointerMove,v=>{h.current=v.pointerType,s?d.onItemLeave?.():h.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:C.composeEventHandlers(i.onPointerLeave,v=>{v.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:C.composeEventHandlers(i.onKeyDown,v=>{d.searchRef?.current!==""&&v.key===" "||(ac.includes(v.key)&&w(),v.key===" "&&v.preventDefault())})})})})});vs.displayName=Gt;var bt="SelectItemText",bs=l.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...a}=e,i=ze(bt,n),c=Ve(bt,n),d=gs(bt,n),m=dc(bt,n),[f,u]=l.useState(null),x=C.useComposedRefs(t,w=>u(w),d.onItemTextChange,w=>c.itemTextRefCallback?.(w,d.value,d.disabled)),g=f?.textContent,y=l.useMemo(()=>o.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:p,onNativeOptionRemove:h}=m;return C.useLayoutEffect2(()=>(p(y),()=>h(y)),[p,h,y]),o.jsxs(o.Fragment,{children:[o.jsx(C.Primitive.span,{id:d.textId,...a,ref:x}),d.isSelected&&i.valueNode&&!i.valueNodeHasChildren?co.createPortal(a.children,i.valueNode):null]})});bs.displayName=bt;var ws="SelectItemIndicator",ys=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return gs(ws,n).isSelected?o.jsx(C.Primitive.span,{"aria-hidden":!0,...r,ref:t}):null});ys.displayName=ws;var Kn="SelectScrollUpButton",Cs=l.forwardRef((e,t)=>{const n=Ve(Kn,e.__scopeSelect),r=Eo(Kn,e.__scopeSelect),[s,a]=l.useState(!1),i=C.useComposedRefs(t,r.onScrollButtonChange);return C.useLayoutEffect2(()=>{if(n.viewport&&n.isPositioned){let c=function(){const m=d.scrollTop>0;a(m)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),s?o.jsx(Ns,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});Cs.displayName=Kn;var qn="SelectScrollDownButton",Ss=l.forwardRef((e,t)=>{const n=Ve(qn,e.__scopeSelect),r=Eo(qn,e.__scopeSelect),[s,a]=l.useState(!1),i=C.useComposedRefs(t,r.onScrollButtonChange);return C.useLayoutEffect2(()=>{if(n.viewport&&n.isPositioned){let c=function(){const m=d.scrollHeight-d.clientHeight,f=Math.ceil(d.scrollTop)<m;a(f)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),s?o.jsx(Ns,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});Ss.displayName=qn;var Ns=l.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,a=Ve("SelectScrollButton",n),i=l.useRef(null),c=xn(n),d=l.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return l.useEffect(()=>()=>d(),[d]),C.useLayoutEffect2(()=>{c().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),o.jsx(C.Primitive.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:C.composeEventHandlers(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:C.composeEventHandlers(s.onPointerMove,()=>{a.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:C.composeEventHandlers(s.onPointerLeave,()=>{d()})})}),yc="SelectSeparator",js=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return o.jsx(C.Primitive.div,{"aria-hidden":!0,...r,ref:t})});js.displayName=yc;var Gn="SelectArrow",Cc=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=gn(n),a=ze(Gn,n),i=Ve(Gn,n);return a.open&&i.position==="popper"?o.jsx(mn,{...s,...r,ref:t}):null});Cc.displayName=Gn;var Sc="SelectBubbleInput",Es=l.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=l.useRef(null),a=C.useComposedRefs(r,s),i=rn(t);return l.useEffect(()=>{const c=s.current;if(!c)return;const d=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(d,"value").set;if(i!==t&&f){const u=new Event("change",{bubbles:!0});f.call(c,t),c.dispatchEvent(u)}},[i,t]),o.jsx(C.Primitive.select,{...n,style:{...dr,...n.style},ref:a,defaultValue:t})});Es.displayName=Sc;function Rs(e){return e===""||e===void 0}function Ps(e){const t=C.useCallbackRef(e),n=l.useRef(""),r=l.useRef(0),s=l.useCallback(i=>{const c=n.current+i;t(c),(function d(m){n.current=m,window.clearTimeout(r.current),m!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(c)},[t]),a=l.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return l.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,a]}function Ts(e,t,n){const s=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let i=Nc(e,Math.max(a,0));s.length===1&&(i=i.filter(m=>m!==n));const d=i.find(m=>m.textValue.toLowerCase().startsWith(s.toLowerCase()));return d!==n?d:void 0}function Nc(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var jc=ts,Ec=os,Rc=ss,Pc=as,Tc=is,Ic=ls,kc=fs,Mc=ps,_c=xs,Ac=vs,$c=bs,Lc=ys,Oc=Cs,Dc=Ss,Hc=js,Is=["PageUp","PageDown"],ks=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ms={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},mt="Slider",[Jn,Fc,Bc]=nn(mt),[_s]=C.createContextScope(mt,[Bc]),[zc,vn]=_s(mt),As=l.forwardRef((e,t)=>{const{name:n,min:r=0,max:s=100,step:a=1,orientation:i="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:m=[r],value:f,onValueChange:u=()=>{},onValueCommit:x=()=>{},inverted:g=!1,form:y,...p}=e,h=l.useRef(new Set),w=l.useRef(0),b=i==="horizontal"?Vc:Wc,[S=[],N]=C.useControllableState({prop:f,defaultProp:m,onChange:M=>{[...h.current][w.current]?.focus(),u(M)}}),I=l.useRef(S);function P(M){const z=qc(S,M);A(M,z)}function E(M){A(M,w.current)}function _(){const M=I.current[w.current];S[w.current]!==M&&x(S)}function A(M,z,{commit:V}={commit:!1}){const B=Qc(a),U=ed(Math.round((M-r)/a)*a+r,B),O=Nt(U,[r,s]);N((X=[])=>{const D=Xc(X,O,z);if(Zc(D,d*a)){w.current=D.indexOf(O);const G=String(D)!==String(X);return G&&V&&x(D),G?D:X}else return X})}return o.jsx(zc,{scope:e.__scopeSlider,name:n,disabled:c,min:r,max:s,valueIndexToChangeRef:w,thumbs:h.current,values:S,orientation:i,form:y,children:o.jsx(Jn.Provider,{scope:e.__scopeSlider,children:o.jsx(Jn.Slot,{scope:e.__scopeSlider,children:o.jsx(b,{"aria-disabled":c,"data-disabled":c?"":void 0,...p,ref:t,onPointerDown:C.composeEventHandlers(p.onPointerDown,()=>{c||(I.current=S)}),min:r,max:s,inverted:g,onSlideStart:c?void 0:P,onSlideMove:c?void 0:E,onSlideEnd:c?void 0:_,onHomeKeyDown:()=>!c&&A(r,0,{commit:!0}),onEndKeyDown:()=>!c&&A(s,S.length-1,{commit:!0}),onStepKeyDown:({event:M,direction:z})=>{if(!c){const U=Is.includes(M.key)||M.shiftKey&&ks.includes(M.key)?10:1,O=w.current,X=S[O],D=a*U*z;A(X+D,O,{commit:!0})}}})})})})});As.displayName=mt;var[$s,Ls]=_s(mt,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Vc=l.forwardRef((e,t)=>{const{min:n,max:r,dir:s,inverted:a,onSlideStart:i,onSlideMove:c,onSlideEnd:d,onStepKeyDown:m,...f}=e,[u,x]=l.useState(null),g=C.useComposedRefs(t,b=>x(b)),y=l.useRef(void 0),p=Et(s),h=p==="ltr",w=h&&!a||!h&&a;function v(b){const S=y.current||u.getBoundingClientRect(),N=[0,S.width],P=Ro(N,w?[n,r]:[r,n]);return y.current=S,P(b-S.left)}return o.jsx($s,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:o.jsx(Os,{dir:p,"data-orientation":"horizontal",...f,ref:g,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:b=>{const S=v(b.clientX);i?.(S)},onSlideMove:b=>{const S=v(b.clientX);c?.(S)},onSlideEnd:()=>{y.current=void 0,d?.()},onStepKeyDown:b=>{const N=Ms[w?"from-left":"from-right"].includes(b.key);m?.({event:b,direction:N?-1:1})}})})}),Wc=l.forwardRef((e,t)=>{const{min:n,max:r,inverted:s,onSlideStart:a,onSlideMove:i,onSlideEnd:c,onStepKeyDown:d,...m}=e,f=l.useRef(null),u=C.useComposedRefs(t,f),x=l.useRef(void 0),g=!s;function y(p){const h=x.current||f.current.getBoundingClientRect(),w=[0,h.height],b=Ro(w,g?[r,n]:[n,r]);return x.current=h,b(p-h.top)}return o.jsx($s,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:o.jsx(Os,{"data-orientation":"vertical",...m,ref:u,style:{...m.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:p=>{const h=y(p.clientY);a?.(h)},onSlideMove:p=>{const h=y(p.clientY);i?.(h)},onSlideEnd:()=>{x.current=void 0,c?.()},onStepKeyDown:p=>{const w=Ms[g?"from-bottom":"from-top"].includes(p.key);d?.({event:p,direction:w?-1:1})}})})}),Os=l.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:a,onHomeKeyDown:i,onEndKeyDown:c,onStepKeyDown:d,...m}=e,f=vn(mt,n);return o.jsx(C.Primitive.span,{...m,ref:t,onKeyDown:C.composeEventHandlers(e.onKeyDown,u=>{u.key==="Home"?(i(u),u.preventDefault()):u.key==="End"?(c(u),u.preventDefault()):Is.concat(ks).includes(u.key)&&(d(u),u.preventDefault())}),onPointerDown:C.composeEventHandlers(e.onPointerDown,u=>{const x=u.target;x.setPointerCapture(u.pointerId),u.preventDefault(),f.thumbs.has(x)?x.focus():r(u)}),onPointerMove:C.composeEventHandlers(e.onPointerMove,u=>{u.target.hasPointerCapture(u.pointerId)&&s(u)}),onPointerUp:C.composeEventHandlers(e.onPointerUp,u=>{const x=u.target;x.hasPointerCapture(u.pointerId)&&(x.releasePointerCapture(u.pointerId),a(u))})})}),Ds="SliderTrack",Hs=l.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=vn(Ds,n);return o.jsx(C.Primitive.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:t})});Hs.displayName=Ds;var Zn="SliderRange",Fs=l.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=vn(Zn,n),a=Ls(Zn,n),i=l.useRef(null),c=C.useComposedRefs(t,i),d=s.values.length,m=s.values.map(x=>Vs(x,s.min,s.max)),f=d>1?Math.min(...m):0,u=100-Math.max(...m);return o.jsx(C.Primitive.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:c,style:{...e.style,[a.startEdge]:f+"%",[a.endEdge]:u+"%"}})});Fs.displayName=Zn;var Qn="SliderThumb",Bs=l.forwardRef((e,t)=>{const n=Fc(e.__scopeSlider),[r,s]=l.useState(null),a=C.useComposedRefs(t,c=>s(c)),i=l.useMemo(()=>r?n().findIndex(c=>c.ref.current===r):-1,[n,r]);return o.jsx(Uc,{...e,ref:a,index:i})}),Uc=l.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:s,...a}=e,i=vn(Qn,n),c=Ls(Qn,n),[d,m]=l.useState(null),f=C.useComposedRefs(t,v=>m(v)),u=d?i.form||!!d.closest("form"):!0,x=sn(d),g=i.values[r],y=g===void 0?0:Vs(g,i.min,i.max),p=Kc(r,i.values.length),h=x?.[c.size],w=h?Gc(h,y,c.direction):0;return l.useEffect(()=>{if(d)return i.thumbs.add(d),()=>{i.thumbs.delete(d)}},[d,i.thumbs]),o.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${y}% + ${w}px)`},children:[o.jsx(Jn.ItemSlot,{scope:e.__scopeSlider,children:o.jsx(C.Primitive.span,{role:"slider","aria-label":e["aria-label"]||p,"aria-valuemin":i.min,"aria-valuenow":g,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...a,ref:f,style:g===void 0?{display:"none"}:e.style,onFocus:C.composeEventHandlers(e.onFocus,()=>{i.valueIndexToChangeRef.current=r})})}),u&&o.jsx(zs,{name:s??(i.name?i.name+(i.values.length>1?"[]":""):void 0),form:i.form,value:g},r)]})});Bs.displayName=Qn;var Yc="RadioBubbleInput",zs=l.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const s=l.useRef(null),a=C.useComposedRefs(s,r),i=rn(t);return l.useEffect(()=>{const c=s.current;if(!c)return;const d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"value").set;if(i!==t&&f){const u=new Event("input",{bubbles:!0});f.call(c,t),c.dispatchEvent(u)}},[i,t]),o.jsx(C.Primitive.input,{style:{display:"none"},...n,ref:a,defaultValue:t})});zs.displayName=Yc;function Xc(e=[],t,n){const r=[...e];return r[n]=t,r.sort((s,a)=>s-a)}function Vs(e,t,n){const a=100/(n-t)*(e-t);return Nt(a,[0,100])}function Kc(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function qc(e,t){if(e.length===1)return 0;const n=e.map(s=>Math.abs(s-t)),r=Math.min(...n);return n.indexOf(r)}function Gc(e,t,n){const r=e/2,a=Ro([0,50],[0,r]);return(r-a(t)*n)*n}function Jc(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Zc(e,t){if(t>0){const n=Jc(e);return Math.min(...n)>=t}return!0}function Ro(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Qc(e){return(String(e).split(".")[1]||"").length}function ed(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var td=As,nd=Hs,od=Fs,rd=Bs,bn="Switch",[sd]=C.createContextScope(bn),[ad,id]=sd(bn),Ws=l.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:a,required:i,disabled:c,value:d="on",onCheckedChange:m,form:f,...u}=e,[x,g]=l.useState(null),y=C.useComposedRefs(t,b=>g(b)),p=l.useRef(!1),h=x?f||!!x.closest("form"):!0,[w,v]=C.useControllableState({prop:s,defaultProp:a??!1,onChange:m,caller:bn});return o.jsxs(ad,{scope:n,checked:w,disabled:c,children:[o.jsx(C.Primitive.button,{type:"button",role:"switch","aria-checked":w,"aria-required":i,"data-state":Ks(w),"data-disabled":c?"":void 0,disabled:c,value:d,...u,ref:y,onClick:C.composeEventHandlers(e.onClick,b=>{v(S=>!S),h&&(p.current=b.isPropagationStopped(),p.current||b.stopPropagation())})}),h&&o.jsx(Xs,{control:x,bubbles:!p.current,name:r,value:d,checked:w,required:i,disabled:c,form:f,style:{transform:"translateX(-100%)"}})]})});Ws.displayName=bn;var Us="SwitchThumb",Ys=l.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=id(Us,n);return o.jsx(C.Primitive.span,{"data-state":Ks(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});Ys.displayName=Us;var ld="SwitchBubbleInput",Xs=l.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},a)=>{const i=l.useRef(null),c=C.useComposedRefs(i,a),d=rn(n),m=sn(t);return l.useEffect(()=>{const f=i.current;if(!f)return;const u=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(u,"checked").set;if(d!==n&&g){const y=new Event("click",{bubbles:r});g.call(f,n),f.dispatchEvent(y)}},[d,n,r]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:c,style:{...s.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Xs.displayName=ld;function Ks(e){return e?"checked":"unchecked"}var qs=Ws,cd=Ys,wn="Tabs",[dd]=C.createContextScope(wn,[No]),Gs=No(),[ud,Po]=dd(wn),Js=l.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:a,orientation:i="horizontal",dir:c,activationMode:d="automatic",...m}=e,f=Et(c),[u,x]=C.useControllableState({prop:r,onChange:s,defaultProp:a??"",caller:wn});return o.jsx(ud,{scope:n,baseId:C.useId(),value:u,onValueChange:x,orientation:i,dir:f,activationMode:d,children:o.jsx(C.Primitive.div,{dir:f,"data-orientation":i,...m,ref:t})})});Js.displayName=wn;var Zs="TabsList",Qs=l.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,a=Po(Zs,n),i=Gs(n);return o.jsx(zr,{asChild:!0,...i,orientation:a.orientation,dir:a.dir,loop:r,children:o.jsx(C.Primitive.div,{role:"tablist","aria-orientation":a.orientation,...s,ref:t})})});Qs.displayName=Zs;var ea="TabsTrigger",ta=l.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...a}=e,i=Po(ea,n),c=Gs(n),d=ra(i.baseId,r),m=sa(i.baseId,r),f=r===i.value;return o.jsx(Vr,{asChild:!0,...c,focusable:!s,active:f,children:o.jsx(C.Primitive.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":m,"data-state":f?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:d,...a,ref:t,onMouseDown:C.composeEventHandlers(e.onMouseDown,u=>{!s&&u.button===0&&u.ctrlKey===!1?i.onValueChange(r):u.preventDefault()}),onKeyDown:C.composeEventHandlers(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&i.onValueChange(r)}),onFocus:C.composeEventHandlers(e.onFocus,()=>{const u=i.activationMode!=="manual";!f&&!s&&u&&i.onValueChange(r)})})})});ta.displayName=ea;var na="TabsContent",oa=l.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:a,...i}=e,c=Po(na,n),d=ra(c.baseId,r),m=sa(c.baseId,r),f=r===c.value,u=l.useRef(f);return l.useEffect(()=>{const x=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(x)},[]),o.jsx(C.Presence,{present:s||f,children:({present:x})=>o.jsx(C.Primitive.div,{"data-state":f?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!x,id:m,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:u.current?"0s":void 0},children:x&&a})})});oa.displayName=na;function ra(e,t){return`${e}-trigger-${t}`}function sa(e,t){return`${e}-content-${t}`}var fd=Js,md=Qs,pd=ta,hd=oa,[yn]=C.createContextScope("Tooltip",[Je]),Cn=Je(),aa="TooltipProvider",xd=700,eo="tooltip.open",[gd,To]=yn(aa),ia=e=>{const{__scopeTooltip:t,delayDuration:n=xd,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:a}=e,i=l.useRef(!0),c=l.useRef(!1),d=l.useRef(0);return l.useEffect(()=>{const m=d.current;return()=>window.clearTimeout(m)},[]),o.jsx(gd,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:l.useCallback(()=>{window.clearTimeout(d.current),i.current=!1},[]),onClose:l.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:l.useCallback(m=>{c.current=m},[]),disableHoverableContent:s,children:a})};ia.displayName=aa;var jt="Tooltip",[vd,kt]=yn(jt),la=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:a,disableHoverableContent:i,delayDuration:c}=e,d=To(jt,e.__scopeTooltip),m=Cn(t),[f,u]=l.useState(null),x=C.useId(),g=l.useRef(0),y=i??d.disableHoverableContent,p=c??d.delayDuration,h=l.useRef(!1),[w,v]=C.useControllableState({prop:r,defaultProp:s??!1,onChange:P=>{P?(d.onOpen(),document.dispatchEvent(new CustomEvent(eo))):d.onClose(),a?.(P)},caller:jt}),b=l.useMemo(()=>w?h.current?"delayed-open":"instant-open":"closed",[w]),S=l.useCallback(()=>{window.clearTimeout(g.current),g.current=0,h.current=!1,v(!0)},[v]),N=l.useCallback(()=>{window.clearTimeout(g.current),g.current=0,v(!1)},[v]),I=l.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{h.current=!0,v(!0),g.current=0},p)},[p,v]);return l.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),o.jsx(un,{...m,children:o.jsx(vd,{scope:t,contentId:x,open:w,stateAttribute:b,trigger:f,onTriggerChange:u,onTriggerEnter:l.useCallback(()=>{d.isOpenDelayedRef.current?I():S()},[d.isOpenDelayedRef,I,S]),onTriggerLeave:l.useCallback(()=>{y?N():(window.clearTimeout(g.current),g.current=0)},[N,y]),onOpen:S,onClose:N,disableHoverableContent:y,children:n})})};la.displayName=jt;var to="TooltipTrigger",ca=l.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=kt(to,n),a=To(to,n),i=Cn(n),c=l.useRef(null),d=C.useComposedRefs(t,c,s.onTriggerChange),m=l.useRef(!1),f=l.useRef(!1),u=l.useCallback(()=>m.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),o.jsx(Pt,{asChild:!0,...i,children:o.jsx(C.Primitive.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:d,onPointerMove:C.composeEventHandlers(e.onPointerMove,x=>{x.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:C.composeEventHandlers(e.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:C.composeEventHandlers(e.onPointerDown,()=>{s.open&&s.onClose(),m.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:C.composeEventHandlers(e.onFocus,()=>{m.current||s.onOpen()}),onBlur:C.composeEventHandlers(e.onBlur,s.onClose),onClick:C.composeEventHandlers(e.onClick,s.onClose)})})});ca.displayName=to;var Io="TooltipPortal",[bd,wd]=yn(Io,{forceMount:void 0}),da=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,a=kt(Io,t);return o.jsx(bd,{scope:t,forceMount:n,children:o.jsx(C.Presence,{present:n||a.open,children:o.jsx(C.Portal,{asChild:!0,container:s,children:r})})})};da.displayName=Io;var lt="TooltipContent",ua=l.forwardRef((e,t)=>{const n=wd(lt,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...a}=e,i=kt(lt,e.__scopeTooltip);return o.jsx(C.Presence,{present:r||i.open,children:i.disableHoverableContent?o.jsx(fa,{side:s,...a,ref:t}):o.jsx(yd,{side:s,...a,ref:t})})}),yd=l.forwardRef((e,t)=>{const n=kt(lt,e.__scopeTooltip),r=To(lt,e.__scopeTooltip),s=l.useRef(null),a=C.useComposedRefs(t,s),[i,c]=l.useState(null),{trigger:d,onClose:m}=n,f=s.current,{onPointerInTransitChange:u}=r,x=l.useCallback(()=>{c(null),u(!1)},[u]),g=l.useCallback((y,p)=>{const h=y.currentTarget,w={x:y.clientX,y:y.clientY},v=Ed(w,h.getBoundingClientRect()),b=Rd(w,v),S=Pd(p.getBoundingClientRect()),N=Id([...b,...S]);c(N),u(!0)},[u]);return l.useEffect(()=>()=>x(),[x]),l.useEffect(()=>{if(d&&f){const y=h=>g(h,f),p=h=>g(h,d);return d.addEventListener("pointerleave",y),f.addEventListener("pointerleave",p),()=>{d.removeEventListener("pointerleave",y),f.removeEventListener("pointerleave",p)}}},[d,f,g,x]),l.useEffect(()=>{if(i){const y=p=>{const h=p.target,w={x:p.clientX,y:p.clientY},v=d?.contains(h)||f?.contains(h),b=!Td(w,i);v?x():b&&(x(),m())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[d,f,i,m,x]),o.jsx(fa,{...e,ref:a})}),[Cd,Sd]=yn(jt,{isInside:!1}),Nd=st.createSlottable("TooltipContent"),fa=l.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:i,...c}=e,d=kt(lt,n),m=Cn(n),{onClose:f}=d;return l.useEffect(()=>(document.addEventListener(eo,f),()=>document.removeEventListener(eo,f)),[f]),l.useEffect(()=>{if(d.trigger){const u=x=>{x.target?.contains(d.trigger)&&f()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[d.trigger,f]),o.jsx(C.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:u=>u.preventDefault(),onDismiss:f,children:o.jsxs(fn,{"data-state":d.stateAttribute,...m,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(Nd,{children:r}),o.jsx(Cd,{scope:n,isInside:!0,children:o.jsx(fr,{id:d.contentId,role:"tooltip",children:s||r})})]})})});ua.displayName=lt;var ma="TooltipArrow",jd=l.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Cn(n);return Sd(ma,n).isInside?null:o.jsx(mn,{...s,...r,ref:t})});jd.displayName=ma;function Ed(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,s,a)){case a:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Rd(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Pd(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function Td(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const c=t[a],d=t[i],m=c.x,f=c.y,u=d.x,x=d.y;f>r!=x>r&&n<(u-m)*(r-f)/(x-f)+m&&(s=!s)}return s}function Id(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),kd(t)}function kd(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(s.y-i.y)>=(a.y-i.y)*(s.x-i.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const a=n[n.length-1],i=n[n.length-2];if((a.x-i.x)*(s.y-i.y)>=(a.y-i.y)*(s.x-i.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Md=ia,_d=la,Ad=ca,$d=da,pa=ua;const ha=Md,no=_d,oo=Ad,Jt=l.forwardRef(({className:e,sideOffset:t=4,...n},r)=>o.jsx($d,{children:o.jsx(pa,{ref:r,sideOffset:t,className:J.cn("z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...n})}));Jt.displayName=pa.displayName;const xa=ct.cva("bg-muted rounded-full relative grow overflow-hidden data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full",{variants:{size:{sm:"data-[orientation=horizontal]:h-2 data-[orientation=vertical]:w-2",default:"data-[orientation=horizontal]:h-[10px] data-[orientation=vertical]:w-[10px]",lg:"data-[orientation=horizontal]:h-3 data-[orientation=vertical]:w-3"}},defaultVariants:{size:"default"}}),ga=ct.cva("border-primary ring-ring/30 block shrink-0 rounded-full border bg-white shadow-[0_2px_6px_rgba(0,0,0,0.22),0_0_1px_rgba(0,0,0,0.12)] transition-colors hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden select-none disabled:pointer-events-none disabled:opacity-50",{variants:{size:{sm:"data-[orientation=horizontal]:h-3 data-[orientation=horizontal]:w-4 data-[orientation=vertical]:h-4 data-[orientation=vertical]:w-3",default:"data-[orientation=horizontal]:h-4 data-[orientation=horizontal]:w-5 data-[orientation=vertical]:h-5 data-[orientation=vertical]:w-4",lg:"data-[orientation=horizontal]:h-5 data-[orientation=horizontal]:w-6 data-[orientation=vertical]:h-6 data-[orientation=vertical]:w-5"}},defaultVariants:{size:"default"}});function ye({className:e,defaultValue:t,value:n,min:r=0,max:s=100,size:a,...i}){const c=l.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,s],[n,t,r,s]);return o.jsxs(td,{"data-slot":"slider",defaultValue:t,value:n,min:r,max:s,className:J.cn("data-[orientation=vertical]:min-h-40 relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...i,children:[o.jsx(nd,{"data-slot":"slider-track",className:xa({size:a}),children:o.jsx(od,{"data-slot":"slider-range",className:"bg-primary absolute select-none data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"})}),Array.from({length:c.length},(d,m)=>o.jsx(rd,{"data-slot":"slider-thumb",className:ga({size:a})},m))]})}const wt=l.forwardRef(({className:e,trackColor:t,rangeColor:n,thumbColor:r,thumbFillColor:s,thumbOutlineColor:a,gradientBackground:i,sliderType:c="custom",currentHue:d,currentChroma:m,...f},u)=>{const g=c!=="custom"?(()=>{if(i)return i;switch(c){case"hue":return"linear-gradient(to right, hsl(0,100%,50%), hsl(60,100%,50%), hsl(120,100%,50%), hsl(180,100%,50%), hsl(240,100%,50%), hsl(300,100%,50%), hsl(360,100%,50%))";case"saturation":{const p=d!==void 0?d:f.value?.[0]??f.defaultValue?.[0]??0;return`linear-gradient(to right, hsl(${p}, 0%, 50%), hsl(${p}, 100%, 50%))`}case"lightness":{const p=d!==void 0?d:f.value?.[0]??f.defaultValue?.[0]??0;return`linear-gradient(to right, hsl(${p}, 100%, 0%), hsl(${p}, 100%, 100%))`}default:return n||"oklch(var(--primary))"}})():void 0,y={...f.style||{},"--color-slider-track":g??t??"oklch(var(--secondary))","--color-slider-range":c==="custom"?n||"oklch(var(--primary))":"transparent","--color-slider-thumb-outline":a||r||"oklch(var(--primary))","--color-slider-thumb-fill":s||"white"};return o.jsx(ye,{ref:u,className:J.cn("[&_[data-slot='slider-track']]:[background:var(--color-slider-track)]","[&_[data-slot='slider-range']]:bg-[var(--color-slider-range)]","[&_[data-slot='slider-thumb']]:bg-[var(--color-slider-thumb-fill)]","[&_[data-slot='slider-thumb']]:border-[var(--color-slider-thumb-outline)]","[&_[data-slot='slider-thumb']]:shadow-[0_2px_6px_rgba(0,0,0,0.22),0_0_1px_rgba(0,0,0,0.12)]","[&_[data-slot='slider-thumb']]:ring-offset-background","[&_[data-slot='slider-thumb']]:hover:ring-[var(--color-slider-thumb-outline)]","[&_[data-slot='slider-thumb']]:focus-visible:ring-[var(--color-slider-thumb-outline)]",e),style:y,...f})});wt.displayName="ColorSlider";function Ld(e,t,n){if(!isFinite(e)||e<0||e>1)return"#000000";if(t<.001){const h=Math.max(0,Math.min(1,e)),w=v=>{const b=Math.round(v*255).toString(16);return b.length===1?"0"+b:b};return`#${w(h)}${w(h)}${w(h)}`}const r=n/360*2*Math.PI,s=t*Math.cos(r),a=t*Math.sin(r),i=e+.3963377774*s+.2158037573*a,c=e-.1055613458*s-.0638541728*a,d=e-.0894841775*s-1.291485548*a,m=Math.max(0,Math.min(1,Math.sign(i)*Math.pow(Math.abs(i)*.999999998*2-1,1/3))),f=Math.max(0,Math.min(1,Math.sign(c)*Math.pow(Math.abs(c)*.999999998*2-1,1/3))),u=Math.max(0,Math.min(1,Math.sign(d)*Math.pow(Math.abs(d)*.999999998*2-1,1/3))),x=h=>{const w=Math.round(h*255).toString(16);return w.length===1?"0"+w:w},g=x(m),y=x(f),p=x(u);return g==="NaN"||y==="NaN"||p==="NaN"?"#000000":`#${g}${y}${p}`}function Dn(e){const t=e.match(/oklch\(([0-9.]+)\s+([0-9.]+)\s+([0-9.]+)\)/);return t?{L:parseFloat(t[1]),C:parseFloat(t[2]),H:parseFloat(t[3])}:{L:.5,C:.15,H:240}}function Od(e,t,n){e=e/255,t=t/255,n=n/255,e=e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4),t=t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4),n=n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);const r=.4122214708*e+.5363325363*t+.0514459929*n,s=.2119034982*e+.6806995451*t+.1073969566*n,a=.0883024619*e+.2817188376*t+.6299787005*n,i=Math.pow(Math.abs(r)*.999999998,1/3)*Math.sign(r)*.5+.5,c=r-s,d=(r+s-2*a)/2,m=Math.sqrt(c*c+d*d);let f=Math.atan2(d,c)*(180/Math.PI);return f<0&&(f+=360),{L:i,C:m,H:f}}function Qe({value:e="oklch(0.5 0.15 240)",onChange:t,className:n,disabled:r,variant:s="popover"}){const[a,i]=l.useState(!1),[c,d]=l.useState(()=>Dn(e)),[m,f]=l.useState(null);l.useEffect(()=>{d(Dn(e))},[e]);const u=(S,N,I)=>{if(N<.001||!isFinite(N))return{h:0,s:0,l:Math.max(0,Math.min(100,S*100))};const P=I/360*2*Math.PI,E=N*Math.cos(P),_=N*Math.sin(P),A=S+.3963377774*E+.2158037573*_,M=S-.1055613458*E-.0638541728*_,z=S-.0894841775*E-1.291485548*_,V=Math.max(0,Math.min(1,Math.sign(A)*Math.pow(Math.abs(A)*.999999998*2-1,1/3))),B=Math.max(0,Math.min(1,Math.sign(M)*Math.pow(Math.abs(M)*.999999998*2-1,1/3))),U=Math.max(0,Math.min(1,Math.sign(z)*Math.pow(Math.abs(z)*.999999998*2-1,1/3))),O=ee=>isFinite(ee)?ee<=.0031308?12.92*ee:1.055*Math.pow(ee,1/2.4)-.055:0,X=Math.max(0,Math.min(1,O(V))),D=Math.max(0,Math.min(1,O(B))),G=Math.max(0,Math.min(1,O(U))),Q=Math.max(X,D,G),pe=Math.min(X,D,G),de=Q-pe;let ce=0;de!==0&&(Q===X?ce=(D-G)/de%6:Q===D?ce=(G-X)/de+2:ce=(X-D)/de+4,ce=Math.round(ce*60),ce<0&&(ce+=360));const he=(Q+pe)/2,xe=Q===0||pe===1?0:(Q-pe)/(1-Math.abs(2*he-1));return{h:ce,s:Math.max(0,Math.min(100,xe*100)),l:Math.max(0,Math.min(100,he*100))}},x=async(S,N)=>{try{await navigator.clipboard.writeText(S),f(N),setTimeout(()=>f(null),2e3)}catch(I){console.error("Failed to copy:",I)}},g=(S,N)=>{const I={...c,[S]:N};d(I),t?.(`oklch(${I.L} ${I.C} ${I.H})`)},y=S=>{const N=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(S);if(N){const I=parseInt(N[1],16),P=parseInt(N[2],16),E=parseInt(N[3],16),_=Od(I,P,E);d(_),t?.(`oklch(${_.L} ${_.C} ${_.H})`)}},p=Ld(c.L,c.C,c.H),h=`oklch(${c.L.toFixed(2)} ${c.C.toFixed(2)} ${c.H})`,w=u(c.L,c.C,c.H),v=`hsl(${Math.round(w.h)} ${Math.round(w.s)}% ${Math.round(w.l)}%)`,b=o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"h-16 w-16 rounded border border-border flex-shrink-0",style:{backgroundColor:`oklch(${c.L} ${c.C} ${c.H})`}}),o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-xs font-semibold mb-1",children:"OKLCH"}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("input",{type:"text",value:h,readOnly:!0,className:"text-[10px] font-mono w-full px-2 py-1 border border-border rounded bg-muted"}),o.jsx(ne.EnhancedButton,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>x(h,"oklch"),children:m==="oklch"?o.jsx(H.HugeiconsIcon,{icon:F.Tick02Icon,size:12,className:"w-3 h-3 text-success-foreground"}):o.jsx(H.HugeiconsIcon,{icon:F.Copy01Icon,size:12,className:"w-3 h-3"})})]})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs font-semibold mb-1",children:"HEX"}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("input",{type:"text",value:p,onChange:S=>y(S.target.value),className:"text-[10px] font-mono w-full px-2 py-1 border border-border rounded bg-background"}),o.jsx(ne.EnhancedButton,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>x(p,"hex"),children:m==="hex"?o.jsx(H.HugeiconsIcon,{icon:F.Tick02Icon,size:12,className:"w-3 h-3 text-success-foreground"}):o.jsx(H.HugeiconsIcon,{icon:F.Copy01Icon,size:12,className:"w-3 h-3"})})]})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs font-semibold mb-1",children:"HSL"}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("input",{type:"text",value:v,readOnly:!0,className:"text-[10px] font-mono w-full px-2 py-1 border border-border rounded bg-muted"}),o.jsx(ne.EnhancedButton,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>x(v,"hsl"),children:m==="hsl"?o.jsx(H.HugeiconsIcon,{icon:F.Tick02Icon,size:12,className:"w-3 h-3 text-success-foreground"}):o.jsx(H.HugeiconsIcon,{icon:F.Copy01Icon,size:12,className:"w-3 h-3"})})]})]})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("label",{className:"text-xs font-medium",children:"Hue"}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[Math.round(c.H),"°"]})]}),o.jsx(wt,{value:[c.H],onValueChange:S=>g("H",S[0]??0),min:0,max:360,step:1,sliderType:"hue",thumbColor:`oklch(${c.L} ${c.C} ${c.H})`})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("label",{className:"text-xs font-medium",children:"Chroma"}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[(c.C*100).toFixed(0),"%"]})]}),o.jsx(wt,{value:[c.C*100],onValueChange:S=>g("C",(S[0]??0)/100),min:0,max:50,step:1,sliderType:"saturation",currentHue:c.H,thumbColor:`oklch(${c.L} ${c.C} ${c.H})`})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("label",{className:"text-xs font-medium",children:"Lightness"}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[(c.L*100).toFixed(0),"%"]})]}),o.jsx(wt,{value:[c.L*100],onValueChange:S=>g("L",(S[0]??0)/100),min:0,max:100,step:1,sliderType:"lightness",currentHue:c.H,thumbColor:`oklch(${c.L} ${c.C} ${c.H})`})]})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs font-medium mb-2",children:"Quick Colors"}),o.jsx("div",{className:"grid grid-cols-8 gap-1",children:[{name:"Red",oklch:"oklch(0.55 0.22 25)"},{name:"Orange",oklch:"oklch(0.65 0.20 60)"},{name:"Yellow",oklch:"oklch(0.75 0.15 100)"},{name:"Lime",oklch:"oklch(0.70 0.18 140)"},{name:"Green",oklch:"oklch(0.60 0.20 160)"},{name:"Cyan",oklch:"oklch(0.65 0.15 200)"},{name:"Blue",oklch:"oklch(0.60 0.25 240)"},{name:"Purple",oklch:"oklch(0.55 0.22 280)"}].map(S=>{const N=Dn(S.oklch);return o.jsx("button",{onClick:()=>{d(N),t?.(S.oklch)},className:"h-8 w-full rounded border border-border transition-all hover:scale-110",style:{backgroundColor:S.oklch},title:S.name},S.name)})})]})]});return s==="inline"?o.jsx("div",{className:J.cn("w-full",n),children:b}):o.jsxs(Pa,{open:a,onOpenChange:i,children:[o.jsx(Ta,{asChild:!0,children:o.jsx(ne.EnhancedButton,{variant:"outline",disabled:r,className:J.cn("h-8 w-8 p-0 border-2",n),style:{backgroundColor:`oklch(${c.L} ${c.C} ${c.H})`},children:o.jsx("span",{className:"sr-only",children:"Pick a color"})})}),o.jsx(Ia,{className:"w-80 p-4 border-border shadow-lg z-[var(--z-popover)]",children:b})]})}function va({blur:e=16,borderRadius:t=0,className:n}){const s=`frostyGlassMask-${l.useId().replace(/:/g,"-")}`,a=t>0;return o.jsxs(o.Fragment,{children:[a&&o.jsx("svg",{className:"absolute inset-0 pointer-events-none",width:"100%",height:"100%",preserveAspectRatio:"none","aria-hidden":"true",children:o.jsx("mask",{id:s,children:o.jsx("rect",{width:"100%",height:"100%",fill:"white",rx:t,ry:t})})}),o.jsx("div",{className:J.cn("absolute inset-0 pointer-events-none","h-[200%]","bg-background/3",n),style:{"--blur":`${e}px`,backdropFilter:`blur(${e}px)`,WebkitBackdropFilter:`blur(${e}px)`,maskImage:a?`url(#${s})`:"linear-gradient(to bottom, black 0% 50%, transparent 50% 100%)",WebkitMaskImage:a?`url(#${s})`:"linear-gradient(to bottom, black 0% 50%, transparent 50% 100%)"}})]})}function Ft({...e}){return o.jsx(jc,{"data-slot":"select",...e})}function Dd({className:e,...t}){return o.jsx(Mc,{"data-slot":"select-group",className:J.cn("scroll-my-1 p-1",e),...t})}function Bt({...e}){return o.jsx(Rc,{"data-slot":"select-value",...e})}function zt({className:e,size:t="default",children:n,minWidth:r="120px",style:s,...a}){return o.jsxs(Ec,{"data-slot":"select-trigger","data-size":t,className:J.cn("border-input/50 data-[placeholder]:text-muted-foreground bg-input/20 dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-md border px-2 py-1.5 text-sm transition-[color,background-color,border-color,box-shadow] duration-150 ease-in-out focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-7 data-[size=sm]:h-6 shadow-[0_1px_0_0_color-mix(in_oklch,var(--input)_40%,transparent),0_1px_2px_0_oklch(0.15_0_0_/_0.05),0_2px_4px_-1px_oklch(0.15_0_0_/_0.03)] hover:shadow-[0_1px_0_0_color-mix(in_oklch,var(--input)_40%,transparent),0_1px_3px_0_oklch(0.15_0_0_/_0.08),0_2px_6px_-1px_oklch(0.15_0_0_/_0.04)] dark:shadow-[0_1px_0_0_color-mix(in_oklch,var(--input)_40%,transparent),0_1px_2px_0_oklch(0_0_0_/_0.3),0_2px_4px_-1px_oklch(0_0_0_/_0.2)] dark:hover:shadow-[0_1px_0_0_color-mix(in_oklch,var(--input)_40%,transparent),0_1px_3px_0_oklch(0_0_0_/_0.4),0_2px_6px_-1px_oklch(0_0_0_/_0.3)] *:data-[slot=select-value]:flex *:data-[slot=select-value]:min-w-0 *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-3.5 flex min-w-0 max-w-full w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",r==="120px"&&"min-w-[120px]",e),style:r!=="fit"&&r!=="120px"?{...s,minWidth:r}:s,...a,children:[n,o.jsx(Pc,{asChild:!0,children:o.jsx(H.HugeiconsIcon,{icon:F.UnfoldMoreIcon,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})})]})}function Vt({className:e,children:t,position:n="item-aligned",align:r="center",...s}){return o.jsx(Tc,{children:o.jsxs(Ic,{"data-slot":"select-content",className:J.cn("text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-32 rounded-lg shadow-md ring-1 duration-100 relative z-[var(--z-popover)] max-h-(--radix-select-content-available-height) origin-(--radix-select-content-transform-origin) overflow-hidden",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...s,children:[o.jsx(va,{blur:16,borderRadius:8,className:"z-[var(--z-background)]"}),o.jsxs("div",{className:"relative z-[var(--z-content)] bg-popover/10 rounded-lg overflow-y-auto overflow-x-hidden max-h-[var(--radix-select-content-available-height)]",children:[o.jsx(ba,{}),o.jsx(kc,{"data-position":n,className:J.cn("data-[position=popper]:h-[var(--radix-select-trigger-height)] data-[position=popper]:w-full data-[position=popper]:min-w-[var(--radix-select-trigger-width)]"),children:t}),o.jsx(wa,{})]})]})})}function Hd({className:e,...t}){return o.jsx(_c,{"data-slot":"select-label",className:J.cn("text-muted-foreground px-2 py-1.5 text-xs",e),...t})}function Me({className:e,children:t,...n}){return o.jsxs(Ac,{"data-slot":"select-item",className:J.cn("focus:bg-accent focus:text-accent-foreground hover:bg-accent/60 not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-8 my-0.5 mx-1 gap-2 rounded-md px-2.5 py-1.5 text-sm [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-auto cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[o.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center",children:o.jsx(Lc,{children:o.jsx(H.HugeiconsIcon,{icon:F.Tick02Icon,strokeWidth:2,className:"pointer-events-none"})})}),o.jsx($c,{children:t})]})}function Fd({className:e,...t}){return o.jsx(Hc,{"data-slot":"select-separator",className:J.cn("bg-border/50 -mx-1 my-1 h-px pointer-events-none",e),...t})}function ba({className:e,...t}){return o.jsx(Oc,{"data-slot":"select-scroll-up-button",className:J.cn("bg-popover z-[var(--z-popover)] flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5",e),...t,children:o.jsx(H.HugeiconsIcon,{icon:F.ArrowUp01Icon,strokeWidth:2})})}function wa({className:e,...t}){return o.jsx(Dc,{"data-slot":"select-scroll-down-button",className:J.cn("bg-popover z-[var(--z-popover)] flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5",e),...t,children:o.jsx(H.HugeiconsIcon,{icon:F.ArrowDown01Icon,strokeWidth:2})})}function ya({className:e,orientation:t="horizontal",...n}){return o.jsx(fd,{"data-slot":"tabs","data-orientation":t,className:J.cn("gap-2 group/tabs flex data-[orientation=horizontal]:flex-col",e),...n})}const Bd=ct.cva("rounded-lg p-[3px] group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Ca({className:e,variant:t="default",...n}){return o.jsx(md,{"data-slot":"tabs-list","data-variant":t,className:J.cn(Bd({variant:t}),e),...n})}function Sa({className:e,children:t,...n}){return o.jsx(pd,{"data-slot":"tabs-trigger",className:J.cn("gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-xs font-medium group-data-vertical/tabs:py-[calc(--spacing(1.25))] [&_svg:not([class*='size-'])]:size-3.5 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] min-w-0 max-w-full flex-1 items-center justify-center whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...n,children:ne.wrapInlineLabelTextNodes(t)})}function Na({className:e,...t}){return o.jsx(hd,{"data-slot":"tabs-content",className:J.cn("text-xs flex-1 outline-none",e),...t})}const ko=fe.createContext(void 0),Mo=l.forwardRef(({className:e,value:t,defaultValue:n,onValueChange:r,orientation:s="horizontal",...a},i)=>{typeof fetch=="function"&&fetch("http://127.0.0.1:7253/ingest/dd1618ba-f7a7-49bb-8fc3-5befed63a2f3",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"fde4d0"},body:JSON.stringify({sessionId:"fde4d0",location:"enhanced-tabs.tsx:24",message:"EnhancedTabs orientation prop",data:{orientation:s,fromProps:s!=="horizontal"},timestamp:Date.now(),hypothesisId:"H1"})}).catch(()=>{});const[c,d]=fe.useState(n||""),m=t!==void 0,f=m?t:c,u=x=>{m||d(x),r?.(x)};return o.jsx(ko.Provider,{value:{value:f,onValueChange:u,orientation:s},children:o.jsx(ya,{ref:i,className:e,value:f,defaultValue:n,onValueChange:u,orientation:s,...a})})});Mo.displayName="EnhancedTabs";const _o=l.forwardRef(({className:e,orientation:t,children:n,...r},s)=>{const a=fe.useContext(ko),i=t||a?.orientation||"horizontal",c=J.cn(i==="vertical"&&"flex-col",e);typeof fetch=="function"&&fetch("http://127.0.0.1:7253/ingest/dd1618ba-f7a7-49bb-8fc3-5befed63a2f3",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"fde4d0"},body:JSON.stringify({sessionId:"fde4d0",location:"enhanced-tabs.tsx:EnhancedTabsList",message:"Applied orientation and list className",data:{appliedOrientation:i,contextOrientation:a?.orientation,addsFlexCol:i==="vertical",listClassNameSlice:c.slice(0,100)},timestamp:Date.now(),hypothesisId:"H6"})}).catch(()=>{});const d=fe.useRef(null),[m,f]=fe.useState({}),[u,x]=fe.useState(!1),g=l.useCallback(()=>{if(!d.current||!a?.value){x(!1);return}const p=d.current.querySelector('button[data-state="active"]');if(!p){x(!1);return}const h=d.current.getBoundingClientRect(),w=p.getBoundingClientRect(),v={left:`${w.left-h.left}px`,top:`${w.top-h.top}px`,width:`${w.width}px`,height:`${w.height}px`};f(v),x(!0)},[a?.value,i]);fe.useEffect(()=>{g();const p=requestAnimationFrame(()=>{requestAnimationFrame(g)}),h=new ResizeObserver(()=>{requestAnimationFrame(()=>{requestAnimationFrame(g)})}),w=new MutationObserver(()=>{requestAnimationFrame(()=>{requestAnimationFrame(g)})});return d.current&&(h.observe(d.current),w.observe(d.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-state","class"]})),()=>{cancelAnimationFrame(p),h.disconnect(),w.disconnect()}},[g]);const y=l.useCallback(p=>{d.current=p,typeof s=="function"?s(p):s&&(s.current=p)},[s]);return o.jsxs("div",{ref:y,className:"sliding-indicator-container relative",children:[u&&o.jsx("div",{className:J.cn("sliding-indicator rounded-md","bg-background dark:bg-input/30","border border-input","shadow-sm dark:shadow-sm","text-foreground"),style:m,"aria-hidden":"true"}),o.jsx(Ca,{variant:"default",className:c,...r,children:l.Children.map(n,p=>{if(l.isValidElement(p)){const h=p.props;return l.cloneElement(p,{...h,className:J.cn(h.className,"sliding-indicator-target")})}return p})})]})});_o.displayName="EnhancedTabsList";const Zt=l.forwardRef(({className:e,...t},n)=>{const r=fe.useContext(ko);if(!r)throw new Error("EnhancedTabsTrigger must be used within EnhancedTabs");const s=r?.orientation||"horizontal";return o.jsx(Sa,{ref:n,"data-orientation":s,className:J.cn(e),...t})});Zt.displayName="EnhancedTabsTrigger";const Qt=l.forwardRef(({className:e,...t},n)=>o.jsx(Na,{ref:n,className:J.cn("transition-all duration-200 ease-in-out",e),...t}));Qt.displayName="EnhancedTabsContent";var zd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ja=zd.reduce((e,t)=>{const n=st.createSlot(`Primitive.${t}`),r=l.forwardRef((s,a)=>{const{asChild:i,...c}=s,d=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(d,{...c,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});const et=hr,tt=fo,nt=po;var Vd="Label",Ea=l.forwardRef((e,t)=>o.jsx(ja.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Ea.displayName=Vd;var Ra=Ea;const Wd=ct.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Z=l.forwardRef(({className:e,...t},n)=>o.jsx(Ra,{ref:n,className:J.cn(Wd(),e),...t}));Z.displayName=Ra.displayName;const Xe=l.forwardRef(({className:e,type:t,...n},r)=>o.jsx("input",{type:t,className:J.cn("flex h-7 w-full rounded-md border border-input bg-background px-3 py-1.5 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));Xe.displayName="Input";function Pa({...e}){return o.jsx(ec,{"data-slot":"popover",...e})}function Ta({...e}){return o.jsx(nc,{"data-slot":"popover-trigger",...e})}function Ia({className:e,align:t="center",sideOffset:n=4,...r}){return o.jsx(oc,{children:o.jsx(rc,{"data-slot":"popover-content",align:t,sideOffset:n,className:J.cn("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 flex flex-col gap-4 rounded-lg p-2.5 text-xs shadow-md ring-1 duration-100 z-[var(--z-popover)] w-72 origin-(--radix-popover-content-transform-origin) outline-hidden",e),...r})})}function Ud({...e}){return o.jsx(tc,{"data-slot":"popover-anchor",...e})}const ka=ct.cva("peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",{variants:{size:{sm:"h-5 w-9",default:"h-6 w-11",lg:"h-7 w-[52px]"}},defaultVariants:{size:"default"}}),Ma=ct.cva("pointer-events-none block shrink-0 rounded-full bg-white shadow-[0_2px_6px_rgba(0,0,0,0.22),0_0_1px_rgba(0,0,0,0.12)] ring-0 transition-transform duration-200 ease-out dark:bg-white",{variants:{size:{sm:"h-3 min-w-4 data-[state=unchecked]:translate-x-0.5 data-[state=checked]:translate-x-[14px]",default:"h-4 min-w-5 data-[state=unchecked]:translate-x-0.5 data-[state=checked]:translate-x-[18px]",lg:"h-5 min-w-6 data-[state=unchecked]:translate-x-0.5 data-[state=checked]:translate-x-[22px]"}},defaultVariants:{size:"default"}}),Ce=l.forwardRef(({className:e,size:t,...n},r)=>o.jsx(qs,{className:J.cn(ka({size:t}),e),...n,ref:r,children:o.jsx(cd,{className:Ma({size:t})})}));Ce.displayName=qs.displayName;function ro({className:e,...t}){return o.jsx("textarea",{"data-slot":"textarea",className:J.cn("border-input bg-input/20 dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 resize-none rounded-md border px-2 py-2 text-sm transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})}function me(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ie(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function so({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Ao(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function _a(e,t,n="/"){return Yd(e,t,n,!1)}function Yd(e,t,n,r){let s=typeof t=="string"?Ao(t):t,a=Fe(s.pathname||"/",n);if(a==null)return null;let i=Aa(e);Xd(i);let c=null;for(let d=0;c==null&&d<i.length;++d){let m=ru(a);c=nu(i[d],m,r)}return c}function Aa(e,t=[],n=[],r="",s=!1){let a=(i,c,d=s,m)=>{let f={relativePath:m===void 0?i.path||"":m,caseSensitive:i.caseSensitive===!0,childrenIndex:c,route:i};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(r)&&d)return;me(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length)}let u=_e([r,f.relativePath]),x=n.concat(f);i.children&&i.children.length>0&&(me(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),Aa(i.children,t,x,u,d)),!(i.path==null&&!i.index)&&t.push({path:u,score:eu(u,i.index),routesMeta:x})};return e.forEach((i,c)=>{if(i.path===""||!i.path?.includes("?"))a(i,c);else for(let d of $a(i.path))a(i,c,!0,d)}),t}function $a(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return s?[a,""]:[a];let i=$a(r.join("/")),c=[];return c.push(...i.map(d=>d===""?a:[a,d].join("/"))),s&&c.push(...i),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function Xd(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:tu(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Kd=/^:[\w-]+$/,qd=3,Gd=2,Jd=1,Zd=10,Qd=-2,tr=e=>e==="*";function eu(e,t){let n=e.split("/"),r=n.length;return n.some(tr)&&(r+=Qd),t&&(r+=Gd),n.filter(s=>!tr(s)).reduce((s,a)=>s+(Kd.test(a)?qd:a===""?Jd:Zd),r)}function tu(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function nu(e,t,n=!1){let{routesMeta:r}=e,s={},a="/",i=[];for(let c=0;c<r.length;++c){let d=r[c],m=c===r.length-1,f=a==="/"?t:t.slice(a.length)||"/",u=en({path:d.relativePath,caseSensitive:d.caseSensitive,end:m},f),x=d.route;if(!u&&m&&n&&!r[r.length-1].route.index&&(u=en({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},f)),!u)return null;Object.assign(s,u.params),i.push({params:s,pathname:_e([a,u.pathname]),pathnameBase:lu(_e([a,u.pathnameBase])),route:x}),u.pathnameBase!=="/"&&(a=_e([a,u.pathnameBase]))}return i}function en(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ou(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let a=s[0],i=a.replace(/(.)\/+$/,"$1"),c=s.slice(1);return{params:r.reduce((m,{paramName:f,isOptional:u},x)=>{if(f==="*"){let y=c[x]||"";i=a.slice(0,a.length-y.length).replace(/(.)\/+$/,"$1")}const g=c[x];return u&&!g?m[f]=void 0:m[f]=(g||"").replace(/%2F/g,"/"),m},{}),pathname:a,pathnameBase:i,pattern:e}}function ou(e,t=!1,n=!0){Ie(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,c,d)=>(r.push({paramName:c,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function ru(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ie(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Fe(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var La=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,su=e=>La.test(e);function au(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Ao(e):e,a;if(n)if(su(n))a=n;else{if(n.includes("//")){let i=n;n=n.replace(/\/\/+/g,"/"),Ie(!1,`Pathnames cannot have embedded double slashes - normalizing ${i} -> ${n}`)}n.startsWith("/")?a=nr(n.substring(1),"/"):a=nr(n,t)}else a=t;return{pathname:a,search:cu(r),hash:du(s)}}function nr(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Hn(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function iu(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Oa(e){let t=iu(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Da(e,t,n,r=!1){let s;typeof e=="string"?s=Ao(e):(s={...e},me(!s.pathname||!s.pathname.includes("?"),Hn("?","pathname","search",s)),me(!s.pathname||!s.pathname.includes("#"),Hn("#","pathname","hash",s)),me(!s.search||!s.search.includes("#"),Hn("#","search","hash",s)));let a=e===""||s.pathname==="",i=a?"/":s.pathname,c;if(i==null)c=n;else{let u=t.length-1;if(!r&&i.startsWith("..")){let x=i.split("/");for(;x[0]==="..";)x.shift(),u-=1;s.pathname=x.join("/")}c=u>=0?t[u]:"/"}let d=au(s,c),m=i&&i!=="/"&&i.endsWith("/"),f=(a||i===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(m||f)&&(d.pathname+="/"),d}var _e=e=>e.join("/").replace(/\/\/+/g,"/"),lu=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),cu=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,du=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,uu=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function fu(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function mu(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Ha=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Fa(e,t){let n=e;if(typeof n!="string"||!La.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(Ha)try{let a=new URL(window.location.href),i=n.startsWith("//")?new URL(a.protocol+n):new URL(n),c=Fe(i.pathname,t);i.origin===a.origin&&c!=null?n=c+i.search+i.hash:s=!0}catch{Ie(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ba=["POST","PUT","PATCH","DELETE"];new Set(Ba);var pu=["GET",...Ba];new Set(pu);var pt=l.createContext(null);pt.displayName="DataRouter";var Sn=l.createContext(null);Sn.displayName="DataRouterState";var hu=l.createContext(!1),za=l.createContext({isTransitioning:!1});za.displayName="ViewTransition";var xu=l.createContext(new Map);xu.displayName="Fetchers";var gu=l.createContext(null);gu.displayName="Await";var Ee=l.createContext(null);Ee.displayName="Navigation";var $o=l.createContext(null);$o.displayName="Location";var Le=l.createContext({outlet:null,matches:[],isDataRoute:!1});Le.displayName="Route";var Lo=l.createContext(null);Lo.displayName="RouteError";var Va="REACT_ROUTER_ERROR",vu="REDIRECT",bu="ROUTE_ERROR_RESPONSE";function wu(e){if(e.startsWith(`${Va}:${vu}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function yu(e){if(e.startsWith(`${Va}:${bu}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new uu(t.status,t.statusText,t.data)}catch{}}function Cu(e,{relative:t}={}){me(Nn(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=l.useContext(Ee),{hash:s,pathname:a,search:i}=Mt(e,{relative:t}),c=a;return n!=="/"&&(c=a==="/"?n:_e([n,a])),r.createHref({pathname:c,search:i,hash:s})}function Nn(){return l.useContext($o)!=null}function We(){return me(Nn(),"useLocation() may be used only in the context of a <Router> component."),l.useContext($o).location}var Wa="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ua(e){l.useContext(Ee).static||l.useLayoutEffect(e)}function Su(){let{isDataRoute:e}=l.useContext(Le);return e?Lu():Nu()}function Nu(){me(Nn(),"useNavigate() may be used only in the context of a <Router> component.");let e=l.useContext(pt),{basename:t,navigator:n}=l.useContext(Ee),{matches:r}=l.useContext(Le),{pathname:s}=We(),a=JSON.stringify(Oa(r)),i=l.useRef(!1);return Ua(()=>{i.current=!0}),l.useCallback((d,m={})=>{if(Ie(i.current,Wa),!i.current)return;if(typeof d=="number"){n.go(d);return}let f=Da(d,JSON.parse(a),s,m.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:_e([t,f.pathname])),(m.replace?n.replace:n.push)(f,m.state,m)},[t,n,a,s,e])}l.createContext(null);function Mt(e,{relative:t}={}){let{matches:n}=l.useContext(Le),{pathname:r}=We(),s=JSON.stringify(Oa(n));return l.useMemo(()=>Da(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function ju(e,t,n,r,s){me(Nn(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=l.useContext(Ee),{matches:i}=l.useContext(Le),c=i[i.length-1],d=c?c.params:{},m=c?c.pathname:"/",f=c?c.pathnameBase:"/",u=c&&c.route;{let v=u&&u.path||"";Xa(m,!u||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${v}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
2
2
 
3
3
  Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}/*`}">.`)}let x=We(),g;g=x;let y=g.pathname||"/",p=y;if(f!=="/"){let v=f.replace(/^\//,"").split("/");p="/"+y.replace(/^\//,"").split("/").slice(v.length).join("/")}let h=_a(e,{pathname:p});return Ie(u||h!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Ie(h==null||h[h.length-1].route.element!==void 0||h[h.length-1].route.Component!==void 0||h[h.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),Iu(h&&h.map(v=>Object.assign({},v,{params:Object.assign({},d,v.params),pathname:_e([f,a.encodeLocation?a.encodeLocation(v.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?f:_e([f,a.encodeLocation?a.encodeLocation(v.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathnameBase])})),i,n,r,s)}function Eu(){let e=$u(),t=fu(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=l.createElement(l.Fragment,null,l.createElement("p",null,"💿 Hey developer 👋"),l.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",l.createElement("code",{style:a},"ErrorBoundary")," or"," ",l.createElement("code",{style:a},"errorElement")," prop on your route.")),l.createElement(l.Fragment,null,l.createElement("h2",null,"Unexpected Application Error!"),l.createElement("h3",{style:{fontStyle:"italic"}},t),n?l.createElement("pre",{style:s},n):null,i)}var Ru=l.createElement(Eu,null),Ya=class extends l.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=yu(e.digest);n&&(e=n)}let t=e!==void 0?l.createElement(Le.Provider,{value:this.props.routeContext},l.createElement(Lo.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?l.createElement(Pu,{error:e},t):t}};Ya.contextType=hu;var Fn=new WeakMap;function Pu({children:e,error:t}){let{basename:n}=l.useContext(Ee);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=wu(t.digest);if(r){let s=Fn.get(t);if(s)throw s;let a=Fa(r.location,n);if(Ha&&!Fn.get(t))if(a.isExternal||r.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const i=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:r.replace}));throw Fn.set(t,i),i}return l.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function Tu({routeContext:e,match:t,children:n}){let r=l.useContext(pt);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),l.createElement(Le.Provider,{value:e},n)}function Iu(e,t=[],n=null,r=null,s=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,i=n?.errors;if(i!=null){let f=a.findIndex(u=>u.route.id&&i?.[u.route.id]!==void 0);me(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,f+1))}let c=!1,d=-1;if(n)for(let f=0;f<a.length;f++){let u=a[f];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(d=f),u.route.id){let{loaderData:x,errors:g}=n,y=u.route.loader&&!x.hasOwnProperty(u.route.id)&&(!g||g[u.route.id]===void 0);if(u.route.lazy||y){c=!0,d>=0?a=a.slice(0,d+1):a=[a[0]];break}}}let m=n&&r?(f,u)=>{r(f,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:mu(n.matches),errorInfo:u})}:void 0;return a.reduceRight((f,u,x)=>{let g,y=!1,p=null,h=null;n&&(g=i&&u.route.id?i[u.route.id]:void 0,p=u.route.errorElement||Ru,c&&(d<0&&x===0?(Xa("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,h=null):d===x&&(y=!0,h=u.route.hydrateFallbackElement||null)));let w=t.concat(a.slice(0,x+1)),v=()=>{let b;return g?b=p:y?b=h:u.route.Component?b=l.createElement(u.route.Component,null):u.route.element?b=u.route.element:b=f,l.createElement(Tu,{match:u,routeContext:{outlet:f,matches:w,isDataRoute:n!=null},children:b})};return n&&(u.route.ErrorBoundary||u.route.errorElement||x===0)?l.createElement(Ya,{location:n.location,revalidation:n.revalidation,component:p,error:g,children:v(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:m}):v()},null)}function Oo(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ku(e){let t=l.useContext(pt);return me(t,Oo(e)),t}function Mu(e){let t=l.useContext(Sn);return me(t,Oo(e)),t}function _u(e){let t=l.useContext(Le);return me(t,Oo(e)),t}function Do(e){let t=_u(e),n=t.matches[t.matches.length-1];return me(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Au(){return Do("useRouteId")}function $u(){let e=l.useContext(Lo),t=Mu("useRouteError"),n=Do("useRouteError");return e!==void 0?e:t.errors?.[n]}function Lu(){let{router:e}=ku("useNavigate"),t=Do("useNavigate"),n=l.useRef(!1);return Ua(()=>{n.current=!0}),l.useCallback(async(s,a={})=>{Ie(n.current,Wa),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...a}))},[e,t])}var or={};function Xa(e,t,n){!t&&!or[e]&&(or[e]=!0,Ie(!1,n))}l.memo(Ou);function Ou({routes:e,future:t,state:n,onError:r}){return ju(e,void 0,n,r,t)}var Wt="get",Ut="application/x-www-form-urlencoded";function jn(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Du(e){return jn(e)&&e.tagName.toLowerCase()==="button"}function Hu(e){return jn(e)&&e.tagName.toLowerCase()==="form"}function Fu(e){return jn(e)&&e.tagName.toLowerCase()==="input"}function Bu(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function zu(e,t){return e.button===0&&(!t||t==="_self")&&!Bu(e)}var Lt=null;function Vu(){if(Lt===null)try{new FormData(document.createElement("form"),0),Lt=!1}catch{Lt=!0}return Lt}var Wu=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Bn(e){return e!=null&&!Wu.has(e)?(Ie(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ut}"`),null):e}function Uu(e,t){let n,r,s,a,i;if(Hu(e)){let c=e.getAttribute("action");r=c?Fe(c,t):null,n=e.getAttribute("method")||Wt,s=Bn(e.getAttribute("enctype"))||Ut,a=new FormData(e)}else if(Du(e)||Fu(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||c.getAttribute("action");if(r=d?Fe(d,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||Wt,s=Bn(e.getAttribute("formenctype"))||Bn(c.getAttribute("enctype"))||Ut,a=new FormData(c,e),!Vu()){let{name:m,type:f,value:u}=e;if(f==="image"){let x=m?`${m}.`:"";a.append(`${x}x`,"0"),a.append(`${x}y`,"0")}else m&&a.append(m,u)}}else{if(jn(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Wt,r=null,s=Ut,i=e}return a&&s==="text/plain"&&(i=a,a=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:a,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ho(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Yu(e,t,n,r){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${r}`:s.pathname=`${s.pathname}.${r}`:s.pathname==="/"?s.pathname=`_root.${r}`:t&&Fe(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${r}`,s}async function Xu(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ku(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function qu(e,t,n){let r=await Promise.all(e.map(async s=>{let a=t.routes[s.route.id];if(a){let i=await Xu(a,n);return i.links?i.links():[]}return[]}));return Qu(r.flat(1).filter(Ku).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function rr(e,t,n,r,s,a){let i=(d,m)=>n[m]?d.route.id!==n[m].route.id:!0,c=(d,m)=>n[m].pathname!==d.pathname||n[m].route.path?.endsWith("*")&&n[m].params["*"]!==d.params["*"];return a==="assets"?t.filter((d,m)=>i(d,m)||c(d,m)):a==="data"?t.filter((d,m)=>{let f=r.routes[d.route.id];if(!f||!f.hasLoader)return!1;if(i(d,m)||c(d,m))return!0;if(d.route.shouldRevalidate){let u=d.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof u=="boolean")return u}return!0}):[]}function Gu(e,t,{includeHydrateFallback:n}={}){return Ju(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let a=[s.module];return s.clientActionModule&&(a=a.concat(s.clientActionModule)),s.clientLoaderModule&&(a=a.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(a=a.concat(s.hydrateFallbackModule)),s.imports&&(a=a.concat(s.imports)),a}).flat(1))}function Ju(e){return[...new Set(e)]}function Zu(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Qu(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let a=JSON.stringify(Zu(s));return n.has(a)||(n.add(a),r.push({key:a,link:s})),r},[])}function Ka(){let e=l.useContext(pt);return Ho(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function ef(){let e=l.useContext(Sn);return Ho(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Fo=l.createContext(void 0);Fo.displayName="FrameworkContext";function qa(){let e=l.useContext(Fo);return Ho(e,"You must render this element inside a <HydratedRouter> element"),e}function tf(e,t){let n=l.useContext(Fo),[r,s]=l.useState(!1),[a,i]=l.useState(!1),{onFocus:c,onBlur:d,onMouseEnter:m,onMouseLeave:f,onTouchStart:u}=t,x=l.useRef(null);l.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let p=w=>{w.forEach(v=>{i(v.isIntersecting)})},h=new IntersectionObserver(p,{threshold:.5});return x.current&&h.observe(x.current),()=>{h.disconnect()}}},[e]),l.useEffect(()=>{if(r){let p=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(p)}}},[r]);let g=()=>{s(!0)},y=()=>{s(!1),i(!1)};return n?e!=="intent"?[a,x,{}]:[a,x,{onFocus:gt(c,g),onBlur:gt(d,y),onMouseEnter:gt(m,g),onMouseLeave:gt(f,y),onTouchStart:gt(u,g)}]:[!1,x,{}]}function gt(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function nf({page:e,...t}){let{router:n}=Ka(),r=l.useMemo(()=>_a(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?l.createElement(rf,{page:e,matches:r,...t}):null}function of(e){let{manifest:t,routeModules:n}=qa(),[r,s]=l.useState([]);return l.useEffect(()=>{let a=!1;return qu(e,t,n).then(i=>{a||s(i)}),()=>{a=!0}},[e,t,n]),r}function rf({page:e,matches:t,...n}){let r=We(),{future:s,manifest:a,routeModules:i}=qa(),{basename:c}=Ka(),{loaderData:d,matches:m}=ef(),f=l.useMemo(()=>rr(e,t,m,a,r,"data"),[e,t,m,a,r]),u=l.useMemo(()=>rr(e,t,m,a,r,"assets"),[e,t,m,a,r]),x=l.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let p=new Set,h=!1;if(t.forEach(v=>{let b=a.routes[v.route.id];!b||!b.hasLoader||(!f.some(S=>S.route.id===v.route.id)&&v.route.id in d&&i[v.route.id]?.shouldRevalidate||b.hasClientLoader?h=!0:p.add(v.route.id))}),p.size===0)return[];let w=Yu(e,c,s.unstable_trailingSlashAwareDataRequests,"data");return h&&p.size>0&&w.searchParams.set("_routes",t.filter(v=>p.has(v.route.id)).map(v=>v.route.id).join(",")),[w.pathname+w.search]},[c,s.unstable_trailingSlashAwareDataRequests,d,r,a,f,t,e,i]),g=l.useMemo(()=>Gu(u,a),[u,a]),y=of(u);return l.createElement(l.Fragment,null,x.map(p=>l.createElement("link",{key:p,rel:"prefetch",as:"fetch",href:p,...n})),g.map(p=>l.createElement("link",{key:p,rel:"modulepreload",href:p,...n})),y.map(({key:p,link:h})=>l.createElement("link",{key:p,nonce:n.nonce,...h})))}function sf(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var af=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{af&&(window.__reactRouterVersion="7.12.0")}catch{}var Ga=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ja=l.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:a,replace:i,state:c,target:d,to:m,preventScrollReset:f,viewTransition:u,unstable_defaultShouldRevalidate:x,...g},y){let{basename:p,unstable_useTransitions:h}=l.useContext(Ee),w=typeof m=="string"&&Ga.test(m),v=Fa(m,p);m=v.to;let b=Cu(m,{relative:s}),[S,N,I]=tf(r,g),P=uf(m,{replace:i,state:c,target:d,preventScrollReset:f,relative:s,viewTransition:u,unstable_defaultShouldRevalidate:x,unstable_useTransitions:h});function E(A){t&&t(A),A.defaultPrevented||P(A)}let _=l.createElement("a",{...g,...I,href:v.absoluteURL||b,onClick:v.isExternal||a?t:E,ref:sf(y,N),target:d,"data-discover":!w&&n==="render"?"true":void 0});return S&&!w?l.createElement(l.Fragment,null,_,l.createElement(nf,{page:b})):_});Ja.displayName="Link";var lf=l.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:a,to:i,viewTransition:c,children:d,...m},f){let u=Mt(i,{relative:m.relative}),x=We(),g=l.useContext(Sn),{navigator:y,basename:p}=l.useContext(Ee),h=g!=null&&xf(u)&&c===!0,w=y.encodeLocation?y.encodeLocation(u).pathname:u.pathname,v=x.pathname,b=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;n||(v=v.toLowerCase(),b=b?b.toLowerCase():null,w=w.toLowerCase()),b&&p&&(b=Fe(b,p)||b);const S=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let N=v===w||!s&&v.startsWith(w)&&v.charAt(S)==="/",I=b!=null&&(b===w||!s&&b.startsWith(w)&&b.charAt(w.length)==="/"),P={isActive:N,isPending:I,isTransitioning:h},E=N?t:void 0,_;typeof r=="function"?_=r(P):_=[r,N?"active":null,I?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let A=typeof a=="function"?a(P):a;return l.createElement(Ja,{...m,"aria-current":E,className:_,ref:f,style:A,to:i,viewTransition:c},typeof d=="function"?d(P):d)});lf.displayName="NavLink";var cf=l.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:a,method:i=Wt,action:c,onSubmit:d,relative:m,preventScrollReset:f,viewTransition:u,unstable_defaultShouldRevalidate:x,...g},y)=>{let{unstable_useTransitions:p}=l.useContext(Ee),h=pf(),w=hf(c,{relative:m}),v=i.toLowerCase()==="get"?"get":"post",b=typeof c=="string"&&Ga.test(c),S=N=>{if(d&&d(N),N.defaultPrevented)return;N.preventDefault();let I=N.nativeEvent.submitter,P=I?.getAttribute("formmethod")||i,E=()=>h(I||N.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:s,state:a,relative:m,preventScrollReset:f,viewTransition:u,unstable_defaultShouldRevalidate:x});p&&n!==!1?l.startTransition(()=>E()):E()};return l.createElement("form",{ref:y,method:v,action:w,onSubmit:r?d:S,...g,"data-discover":!b&&e==="render"?"true":void 0})});cf.displayName="Form";function df(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Za(e){let t=l.useContext(pt);return me(t,df(e)),t}function uf(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:a,viewTransition:i,unstable_defaultShouldRevalidate:c,unstable_useTransitions:d}={}){let m=Su(),f=We(),u=Mt(e,{relative:a});return l.useCallback(x=>{if(zu(x,t)){x.preventDefault();let g=n!==void 0?n:so(f)===so(u),y=()=>m(e,{replace:g,state:r,preventScrollReset:s,relative:a,viewTransition:i,unstable_defaultShouldRevalidate:c});d?l.startTransition(()=>y()):y()}},[f,m,u,n,r,t,e,s,a,i,c,d])}var ff=0,mf=()=>`__${String(++ff)}__`;function pf(){let{router:e}=Za("useSubmit"),{basename:t}=l.useContext(Ee),n=Au(),r=e.fetch,s=e.navigate;return l.useCallback(async(a,i={})=>{let{action:c,method:d,encType:m,formData:f,body:u}=Uu(a,t);if(i.navigate===!1){let x=i.fetcherKey||mf();await r(x,n,i.action||c,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:f,body:u,formMethod:i.method||d,formEncType:i.encType||m,flushSync:i.flushSync})}else await s(i.action||c,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:f,body:u,formMethod:i.method||d,formEncType:i.encType||m,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[r,s,t,n])}function hf(e,{relative:t}={}){let{basename:n}=l.useContext(Ee),r=l.useContext(Le);me(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),a={...Mt(e||".",{relative:t})},i=We();if(e==null){a.search=i.search;let c=new URLSearchParams(a.search),d=c.getAll("index");if(d.some(f=>f==="")){c.delete("index"),d.filter(u=>u).forEach(u=>c.append("index",u));let f=c.toString();a.search=f?`?${f}`:""}}return(!e||e===".")&&s.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:_e([n,a.pathname])),so(a)}function xf(e,{relative:t}={}){let n=l.useContext(za);me(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Za("useViewTransitionState"),s=Mt(e,{relative:t});if(!n.isTransitioning)return!1;let a=Fe(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=Fe(n.nextLocation.pathname,r)||n.nextLocation.pathname;return en(s.pathname,i)!=null||en(s.pathname,a)!=null}function Qa({enabled:e,zoom:t=3,size:n=200,lockedElement:r,onElementChange:s}){const a=We(),[i,c]=l.useState({x:0,y:0}),[d,m]=l.useState(!1),[f,u]=l.useState(null),[x,g]=l.useState(!1),y=l.useRef(null),p=l.useRef(null),h=l.useRef(null);l.useEffect(()=>{if(!e||!d||!p.current){h.current&&h.current.parentNode&&(h.current.parentNode.removeChild(h.current),h.current=null);return}return h.current&&h.current.parentNode&&(h.current.parentNode.removeChild(h.current),h.current=null),requestAnimationFrame(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{setTimeout(()=>{if(!p.current||typeof document>"u")return;const N=document.body,I=N.cloneNode(!0),P=I.querySelector('[data-magnifier-container="true"]');P&&P.remove();const E=I.querySelector('[data-magnifier-viewport="true"]');E&&E.remove(),I.style.position="absolute",I.style.left="0",I.style.top="0",I.style.width=`${document.documentElement.scrollWidth}px`,I.style.height=`${document.documentElement.scrollHeight}px`,I.style.pointerEvents="none",I.style.background="transparent",I.style.transformOrigin="0 0",I.style.willChange="transform",p.current.appendChild(I);const _=M=>M.hasAttribute?.("data-magnifier-container")||M.hasAttribute?.("data-magnifier-viewport"),A=(M,z)=>{M instanceof HTMLElement&&z instanceof HTMLElement&&(M.scrollHeight>M.clientHeight||M.scrollWidth>M.clientWidth)&&(z.scrollLeft=M.scrollLeft,z.scrollTop=M.scrollTop);const V=Array.from(M.children).filter(U=>!_(U)),B=Array.from(z.children);for(let U=0;U<V.length&&U<B.length;U++)A(V[U],B[U])};A(N,I),h.current=I},10)})})}),()=>{h.current&&h.current.parentNode&&(h.current.parentNode.removeChild(h.current),h.current=null)}},[e,d,f,x,a.pathname]),l.useEffect(()=>{if(!e){m(!1);return}const N=P=>{const E=document.querySelector("[data-debug-panel]")!==null;E!==x&&g(E);const _=document.elementFromPoint(P.clientX,P.clientY),A=_?.closest("[data-debug-panel]")!==null,M=_?.closest('button[title="Debug Tools"]')!==null||_?.getAttribute("title")==="Debug Tools",z=A||M;requestAnimationFrame(()=>{c({x:P.clientX,y:P.clientY}),m(!z)}),r||s?.(_||null)},I=P=>{document.elementFromPoint(P.clientX,P.clientY)?.tagName!=="IFRAME"&&(m(!1),s?.(null))};return document.addEventListener("mousemove",N),document.addEventListener("mouseleave",I),()=>{document.removeEventListener("mousemove",N),document.removeEventListener("mouseleave",I)}},[e,s,x,r]),l.useEffect(()=>{if(!e)return;const N=new MutationObserver(P=>{P.forEach(E=>{if(E.type==="attributes"&&E.attributeName==="data-state"){const A=E.target.getAttribute("data-state");f!==A&&u(A)}})}),I=document.querySelector("[data-state]");if(I){const P=I.getAttribute("data-state");f!==P&&u(P),N.observe(I,{attributes:!0,attributeFilter:["data-state"]})}return()=>N.disconnect()},[e,f]),l.useEffect(()=>{if(!e)return;const N=()=>{const E=document.querySelector("[data-debug-panel]")!==null;E!==x&&g(E)},I=new MutationObserver(E=>{let _=!1;E.forEach(A=>{if(A.type==="childList"){const M=Array.from(A.addedNodes),z=Array.from(A.removedNodes),V=B=>{if(B.nodeType===Node.ELEMENT_NODE){const U=B;return U.hasAttribute?.("data-debug-panel")||U.querySelector?.("[data-debug-panel]")!==null||U.closest?.("[data-debug-panel]")!==null}return!1};(M.some(V)||z.some(V))&&(_=!0)}}),_&&setTimeout(N,0)});I.observe(document.body,{childList:!0,subtree:!0}),N();const P=setInterval(N,100);return()=>{I.disconnect(),clearInterval(P)}},[e,x]);const[w,v]=l.useState(0),b=l.useCallback(()=>{if(!h.current)return;const N=P=>P.hasAttribute?.("data-magnifier-container")||P.hasAttribute?.("data-magnifier-viewport"),I=(P,E)=>{P instanceof HTMLElement&&E instanceof HTMLElement&&(P.scrollHeight>P.clientHeight||P.scrollWidth>P.clientWidth)&&(E.scrollLeft=P.scrollLeft,E.scrollTop=P.scrollTop);const _=Array.from(P.children).filter(M=>!N(M)),A=Array.from(E.children);for(let M=0;M<_.length&&M<A.length;M++)I(_[M],A[M])};I(document.body,h.current)},[]);if(l.useEffect(()=>{if(!e||!d)return;const N=()=>v(_=>_+1),I=document.querySelectorAll('[data-main-scroll="true"], [class*="overflow-y-auto"], [class*="overflow-auto"], [class*="overflow-x-auto"]');I.forEach(_=>_.addEventListener("scroll",N,{passive:!0})),window.addEventListener("scroll",N,{passive:!0}),document.addEventListener("wheel",N,{passive:!0});let P;const E=()=>{v(_=>_+1),P=requestAnimationFrame(E)};return P=requestAnimationFrame(E),()=>{cancelAnimationFrame(P),I.forEach(_=>_.removeEventListener("scroll",N)),window.removeEventListener("scroll",N),document.removeEventListener("wheel",N)}},[e,d]),l.useEffect(()=>{if(!e||!d||!p.current||!h.current)return;b();const N=window.scrollX||window.pageXOffset||0,I=window.scrollY||window.pageYOffset||0,P=document.querySelector('[data-main-scroll="true"]'),E=P?i.x:i.x+N,_=P?i.y:i.y+I,A=i.x-E*t,M=i.y-_*t;if(p.current){const z=`circle(${n/2}px at ${i.x}px ${i.y}px)`;p.current.style.clipPath=z,p.current.style.transform="none";const V=`translate(${A}px, ${M}px) scale(${t})`;h.current.style.transform=V,h.current.style.transformOrigin="0 0"}},[i,e,d,t,n,w,b]),!e||!d)return null;const S=n;return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:p,className:"magnifier-viewport",style:{position:"fixed",left:0,top:0,width:"100vw",height:"100vh",pointerEvents:"none",zIndex:9998,willChange:"transform",overflow:"hidden"},"data-magnifier-viewport":"true"}),o.jsx("div",{ref:y,className:"fixed pointer-events-none z-[var(--z-debug)]",style:{left:`${i.x}px`,top:`${i.y}px`,transform:"translate(-50%, -50%)",width:`${S}px`,height:`${S}px`},"data-magnifier-container":"true",children:o.jsx("div",{className:"rounded-full border-2 border-border shadow-2xl",style:{width:"100%",height:"100%",background:"transparent",pointerEvents:"none"}})}),o.jsx("style",{children:`
4
4
  /* Hide the magnifier container from being visible in the viewport */