@mantir/headless-view 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
|
|
43
43
|
If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
44
44
|
|
|
45
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return y__namespace.useEffect(()=>{e&&(document.getElementById(e)||console.error(t));},[t,e]),null},zn="DialogDescriptionWarning",_n=({contentRef:e,descriptionId:a})=>{let o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Yl(zn).contentName}}.`;return y__namespace.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");a&&r&&(document.getElementById(a)||console.warn(o));},[o,e,a]),null};var eu=Vl,Oo=zl,qo=_l,Eo=Kl,Uo=Zl,au=Ql;var tu=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Kn=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,t,o)=>o?o.toUpperCase():t.toLowerCase()),Ho=e=>{let a=Kn(e);return a.charAt(0).toUpperCase()+a.slice(1)},Bt=(...e)=>e.filter((a,t,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===t).join(" ").trim(),ou=e=>{for(let a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return true};var ru={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var uu=y.forwardRef(({color:e="currentColor",size:a=24,strokeWidth:t=2,absoluteStrokeWidth:o,className:r="",children:l,iconNode:u,...s},d)=>y.createElement("svg",{ref:d,...ru,width:a,height:a,stroke:e,strokeWidth:o?Number(t)*24/Number(a):t,className:Bt("lucide",r),...!l&&!ou(s)&&{"aria-hidden":"true"},...s},[...u.map(([f,n])=>y.createElement(f,n)),...Array.isArray(l)?l:[l]]));var Ye=(e,a)=>{let t=y.forwardRef(({className:o,...r},l)=>y.createElement(uu,{ref:l,iconNode:a,className:Bt(`lucide-${tu(Ho(e))}`,`lucide-${e}`,o),...r}));return t.displayName=Ho(e),t};var Qn=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Za=Ye("check",Qn);var Jn=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ba=Ye("chevron-down",Jn);var Yn=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],$a=Ye("chevron-up",Yn);var ei=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Qa=Ye("x",ei);var ai=eu;var su=y__namespace.forwardRef(({className:e,...a},t)=>jsxRuntime.jsx(Oo,{ref:t,className:q("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...a}));su.displayName=Oo.displayName;var ti=y__namespace.forwardRef(({className:e,children:a,...t},o)=>jsxRuntime.jsxs(ai,{children:[jsxRuntime.jsx(su,{}),jsxRuntime.jsxs(qo,{ref:o,className:q("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...t,children:[a,jsxRuntime.jsxs(au,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[jsxRuntime.jsx(Qa,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ti.displayName=qo.displayName;var li=y__namespace.forwardRef(({className:e,...a},t)=>jsxRuntime.jsx(Eo,{ref:t,className:q("text-lg font-semibold leading-none tracking-tight",e),...a}));li.displayName=Eo.displayName;var ui=y__namespace.forwardRef(({className:e,...a},t)=>jsxRuntime.jsx(Uo,{ref:t,className:q("text-sm text-muted-foreground",e),...a}));ui.displayName=Uo.displayName;function du(e){let a=e+"CollectionProvider",[t,o]=$e(a),[r,l]=t(a,{collectionRef:{current:null},itemMap:new Map}),u=i=>{let{scope:m,children:h}=i,I=y__namespace.default.useRef(null),g=y__namespace.default.useRef(new Map).current;return jsxRuntime.jsx(r,{scope:m,itemMap:g,collectionRef:I,children:h})};u.displayName=a;let s=e+"CollectionSlot",d=Ve(s),f=y__namespace.default.forwardRef((i,m)=>{let{scope:h,children:I}=i,g=l(s,h),P=X(m,g.collectionRef);return jsxRuntime.jsx(d,{ref:P,children:I})});f.displayName=s;let n=e+"CollectionItemSlot",p="data-radix-collection-item",c=Ve(n),L=y__namespace.default.forwardRef((i,m)=>{let{scope:h,children:I,...g}=i,P=y__namespace.default.useRef(null),S=X(m,P),R=l(n,h);return y__namespace.default.useEffect(()=>(R.itemMap.set(P,{ref:P,...g}),()=>{R.itemMap.delete(P);})),jsxRuntime.jsx(c,{[p]:"",ref:S,children:I})});L.displayName=n;function x(i){let m=l(e+"CollectionConsumer",i);return y__namespace.default.useCallback(()=>{let I=m.collectionRef.current;if(!I)return [];let g=Array.from(I.querySelectorAll(`[${p}]`));return Array.from(m.itemMap.values()).sort((R,w)=>g.indexOf(R.ref.current)-g.indexOf(w.ref.current))},[m.collectionRef,m.itemMap])}return [{Provider:u,Slot:f,ItemSlot:L},x,o]}var iu=["top","right","bottom","left"];var Ue=Math.min,pe=Math.max,et=Math.round,at=Math.floor,De=e=>({x:e,y:e}),si={left:"right",right:"left",bottom:"top",top:"bottom"},di={start:"end",end:"start"};function Tt(e,a,t){return pe(e,Ue(a,t))}function He(e,a){return typeof e=="function"?e(a):e}function Ne(e){return e.split("-")[0]}function ia(e){return e.split("-")[1]}function Ot(e){return e==="x"?"y":"x"}function qt(e){return e==="y"?"height":"width"}var fi=new Set(["top","bottom"]);function Me(e){return fi.has(Ne(e))?"y":"x"}function Et(e){return Ot(Me(e))}function cu(e,a,t){t===void 0&&(t=false);let o=ia(e),r=Et(e),l=qt(r),u=r==="x"?o===(t?"end":"start")?"right":"left":o==="start"?"bottom":"top";return a.reference[l]>a.floating[l]&&(u=Ya(u)),[u,Ya(u)]}function pu(e){let a=Ya(e);return [Ft(e),a,Ft(a)]}function Ft(e){return e.replace(/start|end/g,a=>di[a])}var fu=["left","right"],nu=["right","left"],ni=["top","bottom"],ii=["bottom","top"];function ci(e,a,t){switch(e){case "top":case "bottom":return t?a?nu:fu:a?fu:nu;case "left":case "right":return a?ni:ii;default:return []}}function mu(e,a,t,o){let r=ia(e),l=ci(Ne(e),t==="start",o);return r&&(l=l.map(u=>u+"-"+r),a&&(l=l.concat(l.map(Ft)))),l}function Ya(e){return e.replace(/left|right|bottom|top/g,a=>si[a])}function pi(e){return {top:0,right:0,bottom:0,left:0,...e}}function Go(e){return typeof e!="number"?pi(e):{top:e,right:e,bottom:e,left:e}}function ca(e){let{x:a,y:t,width:o,height:r}=e;return {width:o,height:r,top:t,left:a,right:a+o,bottom:t+r,x:a,y:t}}function Lu(e,a,t){let{reference:o,floating:r}=e,l=Me(a),u=Et(a),s=qt(u),d=Ne(a),f=l==="y",n=o.x+o.width/2-r.width/2,p=o.y+o.height/2-r.height/2,c=o[s]/2-r[s]/2,L;switch(d){case "top":L={x:n,y:o.y-r.height};break;case "bottom":L={x:n,y:o.y+o.height};break;case "right":L={x:o.x+o.width,y:p};break;case "left":L={x:o.x-r.width,y:p};break;default:L={x:o.x,y:o.y};}switch(ia(a)){case "start":L[u]-=c*(t&&f?-1:1);break;case "end":L[u]+=c*(t&&f?-1:1);break}return L}var hu=async(e,a,t)=>{let{placement:o="bottom",strategy:r="absolute",middleware:l=[],platform:u}=t,s=l.filter(Boolean),d=await(u.isRTL==null?void 0:u.isRTL(a)),f=await u.getElementRects({reference:e,floating:a,strategy:r}),{x:n,y:p}=Lu(f,o,d),c=o,L={},x=0;for(let i=0;i<s.length;i++){let{name:m,fn:h}=s[i],{x:I,y:g,data:P,reset:S}=await h({x:n,y:p,initialPlacement:o,placement:c,strategy:r,middlewareData:L,rects:f,platform:u,elements:{reference:e,floating:a}});n=I??n,p=g??p,L={...L,[m]:{...L[m],...P}},S&&x<=50&&(x++,typeof S=="object"&&(S.placement&&(c=S.placement),S.rects&&(f=S.rects===true?await u.getElementRects({reference:e,floating:a,strategy:r}):S.rects),{x:n,y:p}=Lu(f,c,d)),i=-1);}return {x:n,y:p,placement:c,strategy:r,middlewareData:L}};async function Aa(e,a){var t;a===void 0&&(a={});let{x:o,y:r,platform:l,rects:u,elements:s,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:n="viewport",elementContext:p="floating",altBoundary:c=false,padding:L=0}=He(a,e),x=Go(L),m=s[c?p==="floating"?"reference":"floating":p],h=ca(await l.getClippingRect({element:(t=await(l.isElement==null?void 0:l.isElement(m)))==null||t?m:m.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(s.floating)),boundary:f,rootBoundary:n,strategy:d})),I=p==="floating"?{x:o,y:r,width:u.floating.width,height:u.floating.height}:u.reference,g=await(l.getOffsetParent==null?void 0:l.getOffsetParent(s.floating)),P=await(l.isElement==null?void 0:l.isElement(g))?await(l.getScale==null?void 0:l.getScale(g))||{x:1,y:1}:{x:1,y:1},S=ca(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:I,offsetParent:g,strategy:d}):I);return {top:(h.top-S.top+x.top)/P.y,bottom:(S.bottom-h.bottom+x.bottom)/P.y,left:(h.left-S.left+x.left)/P.x,right:(S.right-h.right+x.right)/P.x}}var gu=e=>({name:"arrow",options:e,async fn(a){let{x:t,y:o,placement:r,rects:l,platform:u,elements:s,middlewareData:d}=a,{element:f,padding:n=0}=He(e,a)||{};if(f==null)return {};let p=Go(n),c={x:t,y:o},L=Et(r),x=qt(L),i=await u.getDimensions(f),m=L==="y",h=m?"top":"left",I=m?"bottom":"right",g=m?"clientHeight":"clientWidth",P=l.reference[x]+l.reference[L]-c[L]-l.floating[x],S=c[L]-l.reference[L],R=await(u.getOffsetParent==null?void 0:u.getOffsetParent(f)),w=R?R[g]:0;(!w||!await(u.isElement==null?void 0:u.isElement(R)))&&(w=s.floating[g]||l.floating[x]);let v=P/2-S/2,B=w/2-i[x]/2-1,E=Ue(p[h],B),H=Ue(p[I],B),U=E,W=w-i[x]-H,D=w/2-i[x]/2+v,G=Tt(U,D,W),M=!d.arrow&&ia(r)!=null&&D!==G&&l.reference[x]/2-(D<U?E:H)-i[x]/2<0,O=M?D<U?D-U:D-W:0;return {[L]:c[L]+O,data:{[L]:G,centerOffset:D-G-O,...M&&{alignmentOffset:O}},reset:M}}});var Cu=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(a){var t,o;let{placement:r,middlewareData:l,rects:u,initialPlacement:s,platform:d,elements:f}=a,{mainAxis:n=true,crossAxis:p=true,fallbackPlacements:c,fallbackStrategy:L="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:i=true,...m}=He(e,a);if((t=l.arrow)!=null&&t.alignmentOffset)return {};let h=Ne(r),I=Me(s),g=Ne(s)===s,P=await(d.isRTL==null?void 0:d.isRTL(f.floating)),S=c||(g||!i?[Ya(s)]:pu(s)),R=x!=="none";!c&&R&&S.push(...mu(s,i,x,P));let w=[s,...S],v=await Aa(a,m),B=[],E=((o=l.flip)==null?void 0:o.overflows)||[];if(n&&B.push(v[h]),p){let D=cu(r,u,P);B.push(v[D[0]],v[D[1]]);}if(E=[...E,{placement:r,overflows:B}],!B.every(D=>D<=0)){var H,U;let D=(((H=l.flip)==null?void 0:H.index)||0)+1,G=w[D];if(G&&(!(p==="alignment"?I!==Me(G):false)||E.every(C=>Me(C.placement)===I?C.overflows[0]>0:true)))return {data:{index:D,overflows:E},reset:{placement:G}};let M=(U=E.filter(O=>O.overflows[0]<=0).sort((O,C)=>O.overflows[1]-C.overflows[1])[0])==null?void 0:U.placement;if(!M)switch(L){case "bestFit":{var W;let O=(W=E.filter(C=>{if(R){let z=Me(C.placement);return z===I||z==="y"}return true}).map(C=>[C.placement,C.overflows.filter(z=>z>0).reduce((z,fe)=>z+fe,0)]).sort((C,z)=>C[1]-z[1])[0])==null?void 0:W[0];O&&(M=O);break}case "initialPlacement":M=s;break}if(r!==M)return {reset:{placement:M}}}return {}}}};function xu(e,a){return {top:e.top-a.height,right:e.right-a.width,bottom:e.bottom-a.height,left:e.left-a.width}}function Iu(e){return iu.some(a=>e[a]>=0)}var Su=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(a){let{rects:t}=a,{strategy:o="referenceHidden",...r}=He(e,a);switch(o){case "referenceHidden":{let l=await Aa(a,{...r,elementContext:"reference"}),u=xu(l,t.reference);return {data:{referenceHiddenOffsets:u,referenceHidden:Iu(u)}}}case "escaped":{let l=await Aa(a,{...r,altBoundary:true}),u=xu(l,t.floating);return {data:{escapedOffsets:u,escaped:Iu(u)}}}default:return {}}}}};var wu=new Set(["left","top"]);async function mi(e,a){let{placement:t,platform:o,elements:r}=e,l=await(o.isRTL==null?void 0:o.isRTL(r.floating)),u=Ne(t),s=ia(t),d=Me(t)==="y",f=wu.has(u)?-1:1,n=l&&d?-1:1,p=He(a,e),{mainAxis:c,crossAxis:L,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return s&&typeof x=="number"&&(L=s==="end"?x*-1:x),d?{x:L*n,y:c*f}:{x:c*f,y:L*n}}var Pu=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(a){var t,o;let{x:r,y:l,placement:u,middlewareData:s}=a,d=await mi(a,e);return u===((t=s.offset)==null?void 0:t.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:r+d.x,y:l+d.y,data:{...d,placement:u}}}}},vu=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(a){let{x:t,y:o,placement:r}=a,{mainAxis:l=true,crossAxis:u=false,limiter:s={fn:m=>{let{x:h,y:I}=m;return {x:h,y:I}}},...d}=He(e,a),f={x:t,y:o},n=await Aa(a,d),p=Me(Ne(r)),c=Ot(p),L=f[c],x=f[p];if(l){let m=c==="y"?"top":"left",h=c==="y"?"bottom":"right",I=L+n[m],g=L-n[h];L=Tt(I,L,g);}if(u){let m=p==="y"?"top":"left",h=p==="y"?"bottom":"right",I=x+n[m],g=x-n[h];x=Tt(I,x,g);}let i=s.fn({...a,[c]:L,[p]:x});return {...i,data:{x:i.x-t,y:i.y-o,enabled:{[c]:l,[p]:u}}}}}},yu=function(e){return e===void 0&&(e={}),{options:e,fn(a){let{x:t,y:o,placement:r,rects:l,middlewareData:u}=a,{offset:s=0,mainAxis:d=true,crossAxis:f=true}=He(e,a),n={x:t,y:o},p=Me(r),c=Ot(p),L=n[c],x=n[p],i=He(s,a),m=typeof i=="number"?{mainAxis:i,crossAxis:0}:{mainAxis:0,crossAxis:0,...i};if(d){let g=c==="y"?"height":"width",P=l.reference[c]-l.floating[g]+m.mainAxis,S=l.reference[c]+l.reference[g]-m.mainAxis;L<P?L=P:L>S&&(L=S);}if(f){var h,I;let g=c==="y"?"width":"height",P=wu.has(Ne(r)),S=l.reference[p]-l.floating[g]+(P&&((h=u.offset)==null?void 0:h[p])||0)+(P?0:m.crossAxis),R=l.reference[p]+l.reference[g]+(P?0:((I=u.offset)==null?void 0:I[p])||0)-(P?m.crossAxis:0);x<S?x=S:x>R&&(x=R);}return {[c]:L,[p]:x}}}},Ru=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(a){var t,o;let{placement:r,rects:l,platform:u,elements:s}=a,{apply:d=()=>{},...f}=He(e,a),n=await Aa(a,f),p=Ne(r),c=ia(r),L=Me(r)==="y",{width:x,height:i}=l.floating,m,h;p==="top"||p==="bottom"?(m=p,h=c===(await(u.isRTL==null?void 0:u.isRTL(s.floating))?"start":"end")?"left":"right"):(h=p,m=c==="end"?"top":"bottom");let I=i-n.top-n.bottom,g=x-n.left-n.right,P=Ue(i-n[m],I),S=Ue(x-n[h],g),R=!a.middlewareData.shift,w=P,v=S;if((t=a.middlewareData.shift)!=null&&t.enabled.x&&(v=g),(o=a.middlewareData.shift)!=null&&o.enabled.y&&(w=I),R&&!c){let E=pe(n.left,0),H=pe(n.right,0),U=pe(n.top,0),W=pe(n.bottom,0);L?v=x-2*(E!==0||H!==0?E+H:pe(n.left,n.right)):w=i-2*(U!==0||W!==0?U+W:pe(n.top,n.bottom));}await d({...a,availableWidth:v,availableHeight:w});let B=await u.getDimensions(s.floating);return x!==B.width||i!==B.height?{reset:{rects:true}}:{}}}};function Ut(){return typeof window<"u"}function ma(e){return bu(e)?(e.nodeName||"").toLowerCase():"#document"}function xe(e){var a;return (e==null||(a=e.ownerDocument)==null?void 0:a.defaultView)||window}function Be(e){var a;return (a=(bu(e)?e.ownerDocument:e.document)||window.document)==null?void 0:a.documentElement}function bu(e){return Ut()?e instanceof Node||e instanceof xe(e).Node:false}function ye(e){return Ut()?e instanceof Element||e instanceof xe(e).Element:false}function Fe(e){return Ut()?e instanceof HTMLElement||e instanceof xe(e).HTMLElement:false}function ku(e){return !Ut()||typeof ShadowRoot>"u"?false:e instanceof ShadowRoot||e instanceof xe(e).ShadowRoot}var Li=new Set(["inline","contents"]);function Da(e){let{overflow:a,overflowX:t,overflowY:o,display:r}=Re(e);return /auto|scroll|overlay|hidden|clip/.test(a+o+t)&&!Li.has(r)}var xi=new Set(["table","td","th"]);function Au(e){return xi.has(ma(e))}var Ii=[":popover-open",":modal"];function tt(e){return Ii.some(a=>{try{return e.matches(a)}catch{return false}})}var hi=["transform","translate","scale","rotate","perspective"],gi=["transform","translate","scale","rotate","perspective","filter"],Ci=["paint","layout","strict","content"];function Ht(e){let a=Nt(),t=ye(e)?Re(e):e;return hi.some(o=>t[o]?t[o]!=="none":false)||(t.containerType?t.containerType!=="normal":false)||!a&&(t.backdropFilter?t.backdropFilter!=="none":false)||!a&&(t.filter?t.filter!=="none":false)||gi.some(o=>(t.willChange||"").includes(o))||Ci.some(o=>(t.contain||"").includes(o))}function Du(e){let a=ze(e);for(;Fe(a)&&!La(a);){if(Ht(a))return a;if(tt(a))return null;a=ze(a);}return null}function Nt(){return typeof CSS>"u"||!CSS.supports?false:CSS.supports("-webkit-backdrop-filter","none")}var Si=new Set(["html","body","#document"]);function La(e){return Si.has(ma(e))}function Re(e){return xe(e).getComputedStyle(e)}function ot(e){return ye(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ze(e){if(ma(e)==="html")return e;let a=e.assignedSlot||e.parentNode||ku(e)&&e.host||Be(e);return ku(a)?a.host:a}function Mu(e){let a=ze(e);return La(a)?e.ownerDocument?e.ownerDocument.body:e.body:Fe(a)&&Da(a)?a:Mu(a)}function pa(e,a,t){var o;a===void 0&&(a=[]),t===void 0&&(t=true);let r=Mu(e),l=r===((o=e.ownerDocument)==null?void 0:o.body),u=xe(r);if(l){let s=Wt(u);return a.concat(u,u.visualViewport||[],Da(r)?r:[],s&&t?pa(s):[])}return a.concat(r,pa(r,[],t))}function Wt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ou(e){let a=Re(e),t=parseFloat(a.width)||0,o=parseFloat(a.height)||0,r=Fe(e),l=r?e.offsetWidth:t,u=r?e.offsetHeight:o,s=et(t)!==l||et(o)!==u;return s&&(t=l,o=u),{width:t,height:o,$:s}}function zo(e){return ye(e)?e:e.contextElement}function Ma(e){let a=zo(e);if(!Fe(a))return De(1);let t=a.getBoundingClientRect(),{width:o,height:r,$:l}=Ou(a),u=(l?et(t.width):t.width)/o,s=(l?et(t.height):t.height)/r;return (!u||!Number.isFinite(u))&&(u=1),(!s||!Number.isFinite(s))&&(s=1),{x:u,y:s}}var wi=De(0);function qu(e){let a=xe(e);return !Nt()||!a.visualViewport?wi:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function Pi(e,a,t){return a===void 0&&(a=false),!t||a&&t!==xe(e)?false:a}function xa(e,a,t,o){a===void 0&&(a=false),t===void 0&&(t=false);let r=e.getBoundingClientRect(),l=zo(e),u=De(1);a&&(o?ye(o)&&(u=Ma(o)):u=Ma(e));let s=Pi(l,t,o)?qu(l):De(0),d=(r.left+s.x)/u.x,f=(r.top+s.y)/u.y,n=r.width/u.x,p=r.height/u.y;if(l){let c=xe(l),L=o&&ye(o)?xe(o):o,x=c,i=Wt(x);for(;i&&o&&L!==x;){let m=Ma(i),h=i.getBoundingClientRect(),I=Re(i),g=h.left+(i.clientLeft+parseFloat(I.paddingLeft))*m.x,P=h.top+(i.clientTop+parseFloat(I.paddingTop))*m.y;d*=m.x,f*=m.y,n*=m.x,p*=m.y,d+=g,f+=P,x=xe(i),i=Wt(x);}}return ca({width:n,height:p,x:d,y:f})}function Gt(e,a){let t=ot(e).scrollLeft;return a?a.left+t:xa(Be(e)).left+t}function Eu(e,a){let t=e.getBoundingClientRect(),o=t.left+a.scrollLeft-Gt(e,t),r=t.top+a.scrollTop;return {x:o,y:r}}function vi(e){let{elements:a,rect:t,offsetParent:o,strategy:r}=e,l=r==="fixed",u=Be(o),s=a?tt(a.floating):false;if(o===u||s&&l)return t;let d={scrollLeft:0,scrollTop:0},f=De(1),n=De(0),p=Fe(o);if((p||!p&&!l)&&((ma(o)!=="body"||Da(u))&&(d=ot(o)),Fe(o))){let L=xa(o);f=Ma(o),n.x=L.x+o.clientLeft,n.y=L.y+o.clientTop;}let c=u&&!p&&!l?Eu(u,d):De(0);return {width:t.width*f.x,height:t.height*f.y,x:t.x*f.x-d.scrollLeft*f.x+n.x+c.x,y:t.y*f.y-d.scrollTop*f.y+n.y+c.y}}function yi(e){return Array.from(e.getClientRects())}function Ri(e){let a=Be(e),t=ot(e),o=e.ownerDocument.body,r=pe(a.scrollWidth,a.clientWidth,o.scrollWidth,o.clientWidth),l=pe(a.scrollHeight,a.clientHeight,o.scrollHeight,o.clientHeight),u=-t.scrollLeft+Gt(e),s=-t.scrollTop;return Re(o).direction==="rtl"&&(u+=pe(a.clientWidth,o.clientWidth)-r),{width:r,height:l,x:u,y:s}}var Bu=25;function ki(e,a){let t=xe(e),o=Be(e),r=t.visualViewport,l=o.clientWidth,u=o.clientHeight,s=0,d=0;if(r){l=r.width,u=r.height;let n=Nt();(!n||n&&a==="fixed")&&(s=r.offsetLeft,d=r.offsetTop);}let f=Gt(o);if(f<=0){let n=o.ownerDocument,p=n.body,c=getComputedStyle(p),L=n.compatMode==="CSS1Compat"&&parseFloat(c.marginLeft)+parseFloat(c.marginRight)||0,x=Math.abs(o.clientWidth-p.clientWidth-L);x<=Bu&&(l-=x);}else f<=Bu&&(l+=f);return {width:l,height:u,x:s,y:d}}var bi=new Set(["absolute","fixed"]);function Ai(e,a){let t=xa(e,true,a==="fixed"),o=t.top+e.clientTop,r=t.left+e.clientLeft,l=Fe(e)?Ma(e):De(1),u=e.clientWidth*l.x,s=e.clientHeight*l.y,d=r*l.x,f=o*l.y;return {width:u,height:s,x:d,y:f}}function Fu(e,a,t){let o;if(a==="viewport")o=ki(e,t);else if(a==="document")o=Ri(Be(e));else if(ye(a))o=Ai(a,t);else {let r=qu(e);o={x:a.x-r.x,y:a.y-r.y,width:a.width,height:a.height};}return ca(o)}function Uu(e,a){let t=ze(e);return t===a||!ye(t)||La(t)?false:Re(t).position==="fixed"||Uu(t,a)}function Di(e,a){let t=a.get(e);if(t)return t;let o=pa(e,[],false).filter(s=>ye(s)&&ma(s)!=="body"),r=null,l=Re(e).position==="fixed",u=l?ze(e):e;for(;ye(u)&&!La(u);){let s=Re(u),d=Ht(u);!d&&s.position==="fixed"&&(r=null),(l?!d&&!r:!d&&s.position==="static"&&!!r&&bi.has(r.position)||Da(u)&&!d&&Uu(e,u))?o=o.filter(n=>n!==u):r=s,u=ze(u);}return a.set(e,o),o}function Mi(e){let{element:a,boundary:t,rootBoundary:o,strategy:r}=e,u=[...t==="clippingAncestors"?tt(a)?[]:Di(a,this._c):[].concat(t),o],s=u[0],d=u.reduce((f,n)=>{let p=Fu(a,n,r);return f.top=pe(p.top,f.top),f.right=Ue(p.right,f.right),f.bottom=Ue(p.bottom,f.bottom),f.left=pe(p.left,f.left),f},Fu(a,s,r));return {width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Bi(e){let{width:a,height:t}=Ou(e);return {width:a,height:t}}function Fi(e,a,t){let o=Fe(a),r=Be(a),l=t==="fixed",u=xa(e,true,l,a),s={scrollLeft:0,scrollTop:0},d=De(0);function f(){d.x=Gt(r);}if(o||!o&&!l)if((ma(a)!=="body"||Da(r))&&(s=ot(a)),o){let L=xa(a,true,l,a);d.x=L.x+a.clientLeft,d.y=L.y+a.clientTop;}else r&&f();l&&!o&&r&&f();let n=r&&!o&&!l?Eu(r,s):De(0),p=u.left+s.scrollLeft-d.x-n.x,c=u.top+s.scrollTop-d.y-n.y;return {x:p,y:c,width:u.width,height:u.height}}function Vo(e){return Re(e).position==="static"}function Tu(e,a){if(!Fe(e)||Re(e).position==="fixed")return null;if(a)return a(e);let t=e.offsetParent;return Be(e)===t&&(t=t.ownerDocument.body),t}function Hu(e,a){let t=xe(e);if(tt(e))return t;if(!Fe(e)){let r=ze(e);for(;r&&!La(r);){if(ye(r)&&!Vo(r))return r;r=ze(r);}return t}let o=Tu(e,a);for(;o&&Au(o)&&Vo(o);)o=Tu(o,a);return o&&La(o)&&Vo(o)&&!Ht(o)?t:o||Du(e)||t}var Ti=async function(e){let a=this.getOffsetParent||Hu,t=this.getDimensions,o=await t(e.floating);return {reference:Fi(e.reference,await a(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Oi(e){return Re(e).direction==="rtl"}var Nu={convertOffsetParentRelativeRectToViewportRelativeRect:vi,getDocumentElement:Be,getClippingRect:Mi,getOffsetParent:Hu,getElementRects:Ti,getClientRects:yi,getDimensions:Bi,getScale:Ma,isElement:ye,isRTL:Oi};function Wu(e,a){return e.x===a.x&&e.y===a.y&&e.width===a.width&&e.height===a.height}function qi(e,a){let t=null,o,r=Be(e);function l(){var s;clearTimeout(o),(s=t)==null||s.disconnect(),t=null;}function u(s,d){s===void 0&&(s=false),d===void 0&&(d=1),l();let f=e.getBoundingClientRect(),{left:n,top:p,width:c,height:L}=f;if(s||a(),!c||!L)return;let x=at(p),i=at(r.clientWidth-(n+c)),m=at(r.clientHeight-(p+L)),h=at(n),g={rootMargin:-x+"px "+-i+"px "+-m+"px "+-h+"px",threshold:pe(0,Ue(1,d))||1},P=true;function S(R){let w=R[0].intersectionRatio;if(w!==d){if(!P)return u();w?u(false,w):o=setTimeout(()=>{u(false,1e-7);},1e3);}w===1&&!Wu(f,e.getBoundingClientRect())&&u(),P=false;}try{t=new IntersectionObserver(S,{...g,root:r.ownerDocument});}catch{t=new IntersectionObserver(S,g);}t.observe(e);}return u(true),l}function _o(e,a,t,o){o===void 0&&(o={});let{ancestorScroll:r=true,ancestorResize:l=true,elementResize:u=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:d=false}=o,f=zo(e),n=r||l?[...f?pa(f):[],...pa(a)]:[];n.forEach(h=>{r&&h.addEventListener("scroll",t,{passive:true}),l&&h.addEventListener("resize",t);});let p=f&&s?qi(f,t):null,c=-1,L=null;u&&(L=new ResizeObserver(h=>{let[I]=h;I&&I.target===f&&L&&(L.unobserve(a),cancelAnimationFrame(c),c=requestAnimationFrame(()=>{var g;(g=L)==null||g.observe(a);})),t();}),f&&!d&&L.observe(f),L.observe(a));let x,i=d?xa(e):null;d&&m();function m(){let h=xa(e);i&&!Wu(i,h)&&t(),i=h,x=requestAnimationFrame(m);}return t(),()=>{var h;n.forEach(I=>{r&&I.removeEventListener("scroll",t),l&&I.removeEventListener("resize",t);}),p?.(),(h=L)==null||h.disconnect(),L=null,d&&cancelAnimationFrame(x);}}var Gu=Pu;var Vu=vu,zu=Cu,_u=Ru,Xu=Su,Xo=gu;var Ku=yu,Ko=(e,a,t)=>{let o=new Map,r={platform:Nu,...t},l={...r.platform,_c:o};return hu(e,a,{...r,platform:l})};var Ui=typeof document<"u",Hi=function(){},Vt=Ui?y.useLayoutEffect:Hi;function zt(e,a){if(e===a)return true;if(typeof e!=typeof a)return false;if(typeof e=="function"&&e.toString()===a.toString())return true;let t,o,r;if(e&&a&&typeof e=="object"){if(Array.isArray(e)){if(t=e.length,t!==a.length)return false;for(o=t;o--!==0;)if(!zt(e[o],a[o]))return false;return true}if(r=Object.keys(e),t=r.length,t!==Object.keys(a).length)return false;for(o=t;o--!==0;)if(!{}.hasOwnProperty.call(a,r[o]))return false;for(o=t;o--!==0;){let l=r[o];if(!(l==="_owner"&&e.$$typeof)&&!zt(e[l],a[l]))return false}return true}return e!==e&&a!==a}function $u(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ju(e,a){let t=$u(e);return Math.round(a*t)/t}function jo(e){let a=y__namespace.useRef(e);return Vt(()=>{a.current=e;}),a}function Qu(e){e===void 0&&(e={});let{placement:a="bottom",strategy:t="absolute",middleware:o=[],platform:r,elements:{reference:l,floating:u}={},transform:s=true,whileElementsMounted:d,open:f}=e,[n,p]=y__namespace.useState({x:0,y:0,strategy:t,placement:a,middlewareData:{},isPositioned:false}),[c,L]=y__namespace.useState(o);zt(c,o)||L(o);let[x,i]=y__namespace.useState(null),[m,h]=y__namespace.useState(null),I=y__namespace.useCallback(C=>{C!==R.current&&(R.current=C,i(C));},[]),g=y__namespace.useCallback(C=>{C!==w.current&&(w.current=C,h(C));},[]),P=l||x,S=u||m,R=y__namespace.useRef(null),w=y__namespace.useRef(null),v=y__namespace.useRef(n),B=d!=null,E=jo(d),H=jo(r),U=jo(f),W=y__namespace.useCallback(()=>{if(!R.current||!w.current)return;let C={placement:a,strategy:t,middleware:c};H.current&&(C.platform=H.current),Ko(R.current,w.current,C).then(z=>{let fe={...z,isPositioned:U.current!==false};D.current&&!zt(v.current,fe)&&(v.current=fe,rr__namespace.flushSync(()=>{p(fe);}));});},[c,a,t,H,U]);Vt(()=>{f===false&&v.current.isPositioned&&(v.current.isPositioned=false,p(C=>({...C,isPositioned:false})));},[f]);let D=y__namespace.useRef(false);Vt(()=>(D.current=true,()=>{D.current=false;}),[]),Vt(()=>{if(P&&(R.current=P),S&&(w.current=S),P&&S){if(E.current)return E.current(P,S,W);W();}},[P,S,W,E,B]);let G=y__namespace.useMemo(()=>({reference:R,floating:w,setReference:I,setFloating:g}),[I,g]),M=y__namespace.useMemo(()=>({reference:P,floating:S}),[P,S]),O=y__namespace.useMemo(()=>{let C={position:t,left:0,top:0};if(!M.floating)return C;let z=ju(M.floating,n.x),fe=ju(M.floating,n.y);return s?{...C,transform:"translate("+z+"px, "+fe+"px)",...$u(M.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:z,top:fe}},[t,s,M.floating,n.x,n.y]);return y__namespace.useMemo(()=>({...n,update:W,refs:G,elements:M,floatingStyles:O}),[n,W,G,M,O])}var Ni=e=>{function a(t){return {}.hasOwnProperty.call(t,"current")}return {name:"arrow",options:e,fn(t){let{element:o,padding:r}=typeof e=="function"?e(t):e;return o&&a(o)?o.current!=null?Xo({element:o.current,padding:r}).fn(t):{}:o?Xo({element:o,padding:r}).fn(t):{}}}},Ju=(e,a)=>({...Gu(e),options:[e,a]}),Yu=(e,a)=>({...Vu(e),options:[e,a]}),es=(e,a)=>({...Ku(e),options:[e,a]}),as=(e,a)=>({...zu(e),options:[e,a]}),ts=(e,a)=>({..._u(e),options:[e,a]});var os=(e,a)=>({...Xu(e),options:[e,a]});var rs=(e,a)=>({...Ni(e),options:[e,a]});var Wi="Arrow",ss=y__namespace.forwardRef((e,a)=>{let{children:t,width:o=10,height:r=5,...l}=e;return jsxRuntime.jsx(N.svg,{...l,ref:a,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?t:jsxRuntime.jsx("polygon",{points:"0,0 30,0 15,10"})})});ss.displayName=Wi;var ds=ss;function ns(e){let[a,t]=y__namespace.useState(void 0);return Y(()=>{if(e){t({width:e.offsetWidth,height:e.offsetHeight});let o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let l=r[0],u,s;if("borderBoxSize"in l){let d=l.borderBoxSize,f=Array.isArray(d)?d[0]:d;u=f.inlineSize,s=f.blockSize;}else u=e.offsetWidth,s=e.offsetHeight;t({width:u,height:s});});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else t(void 0);},[e]),a}var Zo="Popper",[is,$o]=$e(Zo),[Vi,cs]=is(Zo),ps=e=>{let{__scopePopper:a,children:t}=e,[o,r]=y__namespace.useState(null);return jsxRuntime.jsx(Vi,{scope:a,anchor:o,onAnchorChange:r,children:t})};ps.displayName=Zo;var ms="PopperAnchor",Ls=y__namespace.forwardRef((e,a)=>{let{__scopePopper:t,virtualRef:o,...r}=e,l=cs(ms,t),u=y__namespace.useRef(null),s=X(a,u),d=y__namespace.useRef(null);return y__namespace.useEffect(()=>{let f=d.current;d.current=o?.current||u.current,f!==d.current&&l.onAnchorChange(d.current);}),o?null:jsxRuntime.jsx(N.div,{...r,ref:s})});Ls.displayName=ms;var Qo="PopperContent",[zi,_i]=is(Qo),xs=y__namespace.forwardRef((e,a)=>{let{__scopePopper:t,side:o="bottom",sideOffset:r=0,align:l="center",alignOffset:u=0,arrowPadding:s=0,avoidCollisions:d=true,collisionBoundary:f=[],collisionPadding:n=0,sticky:p="partial",hideWhenDetached:c=false,updatePositionStrategy:L="optimized",onPlaced:x,...i}=e,m=cs(Qo,t),[h,I]=y__namespace.useState(null),g=X(a,k=>I(k)),[P,S]=y__namespace.useState(null),R=ns(P),w=R?.width??0,v=R?.height??0,B=o+(l!=="center"?"-"+l:""),E=typeof n=="number"?n:{top:0,right:0,bottom:0,left:0,...n},H=Array.isArray(f)?f:[f],U=H.length>0,W={padding:E,boundary:H.filter(Ki),altBoundary:U},{refs:D,floatingStyles:G,placement:M,isPositioned:O,middlewareData:C}=Qu({strategy:"fixed",placement:B,whileElementsMounted:(...k)=>_o(...k,{animationFrame:L==="always"}),elements:{reference:m.anchor},middleware:[Ju({mainAxis:r+v,alignmentAxis:u}),d&&Yu({mainAxis:true,crossAxis:false,limiter:p==="partial"?es():void 0,...W}),d&&as({...W}),ts({...W,apply:({elements:k,rects:Z,availableWidth:re,availableHeight:V})=>{let{width:_,height:$}=Z.reference,Ce=k.floating.style;Ce.setProperty("--radix-popper-available-width",`${re}px`),Ce.setProperty("--radix-popper-available-height",`${V}px`),Ce.setProperty("--radix-popper-anchor-width",`${_}px`),Ce.setProperty("--radix-popper-anchor-height",`${$}px`);}}),P&&rs({element:P,padding:s}),ji({arrowWidth:w,arrowHeight:v}),c&&os({strategy:"referenceHidden",...W})]}),[z,fe]=gs(M),qe=we(x);Y(()=>{O&&qe?.();},[O,qe]);let We=C.arrow?.x,te=C.arrow?.y,ae=C.arrow?.centerOffset!==0,[be,Ee]=y__namespace.useState();return Y(()=>{h&&Ee(window.getComputedStyle(h).zIndex);},[h]),jsxRuntime.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:O?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[C.transformOrigin?.x,C.transformOrigin?.y].join(" "),...C.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:jsxRuntime.jsx(zi,{scope:t,placedSide:z,onArrowChange:S,arrowX:We,arrowY:te,shouldHideArrow:ae,children:jsxRuntime.jsx(N.div,{"data-side":z,"data-align":fe,...i,ref:g,style:{...i.style,animation:O?void 0:"none"}})})})});xs.displayName=Qo;var Is="PopperArrow",Xi={top:"bottom",right:"left",bottom:"top",left:"right"},hs=y__namespace.forwardRef(function(a,t){let{__scopePopper:o,...r}=a,l=_i(Is,o),u=Xi[l.placedSide];return jsxRuntime.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:jsxRuntime.jsx(ds,{...r,ref:t,style:{...r.style,display:"block"}})})});hs.displayName=Is;function Ki(e){return e!==null}var ji=e=>({name:"transformOrigin",options:e,fn(a){let{placement:t,rects:o,middlewareData:r}=a,u=r.arrow?.centerOffset!==0,s=u?0:e.arrowWidth,d=u?0:e.arrowHeight,[f,n]=gs(t),p={start:"0%",center:"50%",end:"100%"}[n],c=(r.arrow?.x??0)+s/2,L=(r.arrow?.y??0)+d/2,x="",i="";return f==="bottom"?(x=u?p:`${c}px`,i=`${-d}px`):f==="top"?(x=u?p:`${c}px`,i=`${o.floating.height+d}px`):f==="right"?(x=`${-d}px`,i=u?p:`${L}px`):f==="left"&&(x=`${o.floating.width+d}px`,i=u?p:`${L}px`),{data:{x,y:i}}}});function gs(e){let[a,t="center"]=e.split("-");return [a,t]}var Cs=ps,Ss=Ls,ws=xs,Ps=hs;function vs(e){let a=y__namespace.useRef({value:e,previous:e});return y__namespace.useMemo(()=>(a.current.value!==e&&(a.current.previous=a.current.value,a.current.value=e),a.current.previous),[e])}var Jo=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"}),Qi="VisuallyHidden",Ji=y__namespace.forwardRef((e,a)=>jsxRuntime.jsx(N.span,{...e,ref:a,style:{...Jo,...e.style}}));Ji.displayName=Qi;var Yi=[" ","Enter","ArrowUp","ArrowDown"],ec=[" ","Enter"],ha="Select",[jt,Zt,ac]=du(ha),[Ba]=$e(ha,[ac,$o]),$t=$o(),[tc,aa]=Ba(ha),[oc,rc]=Ba(ha),Rs=e=>{let{__scopeSelect:a,children:t,open:o,defaultOpen:r,onOpenChange:l,value:u,defaultValue:s,onValueChange:d,dir:f,name:n,autoComplete:p,disabled:c,required:L,form:x}=e,i=$t(a),[m,h]=y__namespace.useState(null),[I,g]=y__namespace.useState(null),[P,S]=y__namespace.useState(false),R=Yr(f),[w,v]=Wa({prop:o,defaultProp:r??false,onChange:l,caller:ha}),[B,E]=Wa({prop:u,defaultProp:s,onChange:d,caller:ha}),H=y__namespace.useRef(null),U=m?x||!!m.closest("form"):true,[W,D]=y__namespace.useState(new Set),G=Array.from(W).map(M=>M.props.value).join(";");return jsxRuntime.jsx(Cs,{...i,children:jsxRuntime.jsxs(tc,{required:L,scope:a,trigger:m,onTriggerChange:h,valueNode:I,onValueNodeChange:g,valueNodeHasChildren:P,onValueNodeHasChildrenChange:S,contentId:Qe(),value:B,onValueChange:E,open:w,onOpenChange:v,dir:R,triggerPointerDownPosRef:H,disabled:c,children:[jsxRuntime.jsx(jt.Provider,{scope:a,children:jsxRuntime.jsx(oc,{scope:e.__scopeSelect,onNativeOptionAdd:y__namespace.useCallback(M=>{D(O=>new Set(O).add(M));},[]),onNativeOptionRemove:y__namespace.useCallback(M=>{D(O=>{let C=new Set(O);return C.delete(M),C});},[]),children:t})}),U?jsxRuntime.jsxs($s,{"aria-hidden":true,required:L,tabIndex:-1,name:n,autoComplete:p,value:B,onChange:M=>E(M.target.value),disabled:c,form:x,children:[B===void 0?jsxRuntime.jsx("option",{value:""}):null,Array.from(W)]},G):null]})})};Rs.displayName=ha;var ks="SelectTrigger",bs=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,disabled:o=false,...r}=e,l=$t(t),u=aa(ks,t),s=u.disabled||o,d=X(a,u.onTriggerChange),f=Zt(t),n=y__namespace.useRef("touch"),[p,c,L]=Js(i=>{let m=f().filter(g=>!g.disabled),h=m.find(g=>g.value===u.value),I=Ys(m,i,h);I!==void 0&&u.onValueChange(I.value);}),x=i=>{s||(u.onOpenChange(true),L()),i&&(u.triggerPointerDownPosRef.current={x:Math.round(i.pageX),y:Math.round(i.pageY)});};return jsxRuntime.jsx(Ss,{asChild:true,...l,children:jsxRuntime.jsx(N.button,{type:"button",role:"combobox","aria-controls":u.contentId,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":Qs(u.value)?"":void 0,...r,ref:d,onClick:K(r.onClick,i=>{i.currentTarget.focus(),n.current!=="mouse"&&x(i);}),onPointerDown:K(r.onPointerDown,i=>{n.current=i.pointerType;let m=i.target;m.hasPointerCapture(i.pointerId)&&m.releasePointerCapture(i.pointerId),i.button===0&&i.ctrlKey===false&&i.pointerType==="mouse"&&(x(i),i.preventDefault());}),onKeyDown:K(r.onKeyDown,i=>{let m=p.current!=="";!(i.ctrlKey||i.altKey||i.metaKey)&&i.key.length===1&&c(i.key),!(m&&i.key===" ")&&Yi.includes(i.key)&&(x(),i.preventDefault());})})})});bs.displayName=ks;var As="SelectValue",Ds=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,className:o,style:r,children:l,placeholder:u="",...s}=e,d=aa(As,t),{onValueNodeHasChildrenChange:f}=d,n=l!==void 0,p=X(a,d.onValueNodeChange);return Y(()=>{f(n);},[f,n]),jsxRuntime.jsx(N.span,{...s,ref:p,style:{pointerEvents:"none"},children:Qs(d.value)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:u}):l})});Ds.displayName=As;var lc="SelectIcon",Ms=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,children:o,...r}=e;return jsxRuntime.jsx(N.span,{"aria-hidden":true,...r,ref:a,children:o||"\u25BC"})});Ms.displayName=lc;var uc="SelectPortal",Bs=e=>jsxRuntime.jsx(za,{asChild:true,...e});Bs.displayName=uc;var ga="SelectContent",Fs=y__namespace.forwardRef((e,a)=>{let t=aa(ga,e.__scopeSelect),[o,r]=y__namespace.useState();if(Y(()=>{r(new DocumentFragment);},[]),!t.open){let l=o;return l?rr__namespace.createPortal(jsxRuntime.jsx(Ts,{scope:e.__scopeSelect,children:jsxRuntime.jsx(jt.Slot,{scope:e.__scopeSelect,children:jsxRuntime.jsx("div",{children:e.children})})}),l):null}return jsxRuntime.jsx(Os,{...e,ref:a})});Fs.displayName=ga;var Te=10,[Ts,ta]=Ba(ga),sc="SelectContentImpl",dc=Ve("SelectContent.RemoveScroll"),Os=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:l,onPointerDownOutside:u,side:s,sideOffset:d,align:f,alignOffset:n,arrowPadding:p,collisionBoundary:c,collisionPadding:L,sticky:x,hideWhenDetached:i,avoidCollisions:m,...h}=e,I=aa(ga,t),[g,P]=y__namespace.useState(null),[S,R]=y__namespace.useState(null),w=X(a,k=>P(k)),[v,B]=y__namespace.useState(null),[E,H]=y__namespace.useState(null),U=Zt(t),[W,D]=y__namespace.useState(false),G=y__namespace.useRef(false);y__namespace.useEffect(()=>{if(g)return At(g)},[g]),Ct();let M=y__namespace.useCallback(k=>{let[Z,...re]=U().map($=>$.ref.current),[V]=re.slice(-1),_=document.activeElement;for(let $ of k)if($===_||($?.scrollIntoView({block:"nearest"}),$===Z&&S&&(S.scrollTop=0),$===V&&S&&(S.scrollTop=S.scrollHeight),$?.focus(),document.activeElement!==_))return},[U,S]),O=y__namespace.useCallback(()=>M([v,g]),[M,v,g]);y__namespace.useEffect(()=>{W&&O();},[W,O]);let{onOpenChange:C,triggerPointerDownPosRef:z}=I;y__namespace.useEffect(()=>{if(g){let k={x:0,y:0},Z=V=>{k={x:Math.abs(Math.round(V.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(V.pageY)-(z.current?.y??0))};},re=V=>{k.x<=10&&k.y<=10?V.preventDefault():g.contains(V.target)||C(false),document.removeEventListener("pointermove",Z),z.current=null;};return z.current!==null&&(document.addEventListener("pointermove",Z),document.addEventListener("pointerup",re,{capture:true,once:true})),()=>{document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",re,{capture:true});}}},[g,C,z]),y__namespace.useEffect(()=>{let k=()=>C(false);return window.addEventListener("blur",k),window.addEventListener("resize",k),()=>{window.removeEventListener("blur",k),window.removeEventListener("resize",k);}},[C]);let[fe,qe]=Js(k=>{let Z=U().filter(_=>!_.disabled),re=Z.find(_=>_.ref.current===document.activeElement),V=Ys(Z,k,re);V&&setTimeout(()=>V.ref.current.focus());}),We=y__namespace.useCallback((k,Z,re)=>{let V=!G.current&&!re;(I.value!==void 0&&I.value===Z||V)&&(B(k),V&&(G.current=true));},[I.value]),te=y__namespace.useCallback(()=>g?.focus(),[g]),ae=y__namespace.useCallback((k,Z,re)=>{let V=!G.current&&!re;(I.value!==void 0&&I.value===Z||V)&&H(k);},[I.value]),be=o==="popper"?Yo:qs,Ee=be===Yo?{side:s,sideOffset:d,align:f,alignOffset:n,arrowPadding:p,collisionBoundary:c,collisionPadding:L,sticky:x,hideWhenDetached:i,avoidCollisions:m}:{};return jsxRuntime.jsx(Ts,{scope:t,content:g,viewport:S,onViewportChange:R,itemRefCallback:We,selectedItem:v,onItemLeave:te,itemTextRefCallback:ae,focusSelectedItem:O,selectedItemText:E,position:o,isPositioned:W,searchRef:fe,children:jsxRuntime.jsx(ja,{as:dc,allowPinchZoom:true,children:jsxRuntime.jsx(Va,{asChild:true,trapped:I.open,onMountAutoFocus:k=>{k.preventDefault();},onUnmountAutoFocus:K(r,k=>{I.trigger?.focus({preventScroll:true}),k.preventDefault();}),children:jsxRuntime.jsx(Ga,{asChild:true,disableOutsidePointerEvents:true,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:k=>k.preventDefault(),onDismiss:()=>I.onOpenChange(false),children:jsxRuntime.jsx(be,{role:"listbox",id:I.contentId,"data-state":I.open?"open":"closed",dir:I.dir,onContextMenu:k=>k.preventDefault(),...h,...Ee,onPlaced:()=>D(true),ref:w,style:{display:"flex",flexDirection:"column",outline:"none",...h.style},onKeyDown:K(h.onKeyDown,k=>{let Z=k.ctrlKey||k.altKey||k.metaKey;if(k.key==="Tab"&&k.preventDefault(),!Z&&k.key.length===1&&qe(k.key),["ArrowUp","ArrowDown","Home","End"].includes(k.key)){let V=U().filter(_=>!_.disabled).map(_=>_.ref.current);if(["ArrowUp","End"].includes(k.key)&&(V=V.slice().reverse()),["ArrowUp","ArrowDown"].includes(k.key)){let _=k.target,$=V.indexOf(_);V=V.slice($+1);}setTimeout(()=>M(V)),k.preventDefault();}})})})})})})});Os.displayName=sc;var fc="SelectItemAlignedPosition",qs=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,onPlaced:o,...r}=e,l=aa(ga,t),u=ta(ga,t),[s,d]=y__namespace.useState(null),[f,n]=y__namespace.useState(null),p=X(a,w=>n(w)),c=Zt(t),L=y__namespace.useRef(false),x=y__namespace.useRef(true),{viewport:i,selectedItem:m,selectedItemText:h,focusSelectedItem:I}=u,g=y__namespace.useCallback(()=>{if(l.trigger&&l.valueNode&&s&&f&&i&&m&&h){let w=l.trigger.getBoundingClientRect(),v=f.getBoundingClientRect(),B=l.valueNode.getBoundingClientRect(),E=h.getBoundingClientRect();if(l.dir!=="rtl"){let _=E.left-v.left,$=B.left-_,Ce=w.left-$,ra=w.width+Ce,ao=Math.max(ra,v.width),to=window.innerWidth-Te,oo=io($,[Te,Math.max(Te,to-ao)]);s.style.minWidth=ra+"px",s.style.left=oo+"px";}else {let _=v.right-E.right,$=window.innerWidth-B.right-_,Ce=window.innerWidth-w.right-$,ra=w.width+Ce,ao=Math.max(ra,v.width),to=window.innerWidth-Te,oo=io($,[Te,Math.max(Te,to-ao)]);s.style.minWidth=ra+"px",s.style.right=oo+"px";}let H=c(),U=window.innerHeight-Te*2,W=i.scrollHeight,D=window.getComputedStyle(f),G=parseInt(D.borderTopWidth,10),M=parseInt(D.paddingTop,10),O=parseInt(D.borderBottomWidth,10),C=parseInt(D.paddingBottom,10),z=G+M+W+C+O,fe=Math.min(m.offsetHeight*5,z),qe=window.getComputedStyle(i),We=parseInt(qe.paddingTop,10),te=parseInt(qe.paddingBottom,10),ae=w.top+w.height/2-Te,be=U-ae,Ee=m.offsetHeight/2,k=m.offsetTop+Ee,Z=G+M+k,re=z-Z;if(Z<=ae){let _=H.length>0&&m===H[H.length-1].ref.current;s.style.bottom="0px";let $=f.clientHeight-i.offsetTop-i.offsetHeight,Ce=Math.max(be,Ee+(_?te:0)+$+O),ra=Z+Ce;s.style.height=ra+"px";}else {let _=H.length>0&&m===H[0].ref.current;s.style.top="0px";let Ce=Math.max(ae,G+i.offsetTop+(_?We:0)+Ee)+re;s.style.height=Ce+"px",i.scrollTop=Z-ae+i.offsetTop;}s.style.margin=`${Te}px 0`,s.style.minHeight=fe+"px",s.style.maxHeight=U+"px",o?.(),requestAnimationFrame(()=>L.current=true);}},[c,l.trigger,l.valueNode,s,f,i,m,h,l.dir,o]);Y(()=>g(),[g]);let[P,S]=y__namespace.useState();Y(()=>{f&&S(window.getComputedStyle(f).zIndex);},[f]);let R=y__namespace.useCallback(w=>{w&&x.current===true&&(g(),I?.(),x.current=false);},[g,I]);return jsxRuntime.jsx(ic,{scope:t,contentWrapper:s,shouldExpandOnScrollRef:L,onScrollButtonChange:R,children:jsxRuntime.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:jsxRuntime.jsx(N.div,{...r,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});qs.displayName=fc;var nc="SelectPopperPosition",Yo=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,align:o="start",collisionPadding:r=Te,...l}=e,u=$t(t);return jsxRuntime.jsx(ws,{...u,...l,ref:a,align:o,collisionPadding:r,style:{boxSizing:"border-box",...l.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)"}})});Yo.displayName=nc;var[ic,ur]=Ba(ga,{}),er="SelectViewport",Es=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,nonce:o,...r}=e,l=ta(er,t),u=ur(er,t),s=X(a,l.onViewportChange),d=y__namespace.useRef(0);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),jsxRuntime.jsx(jt.Slot,{scope:t,children:jsxRuntime.jsx(N.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:K(r.onScroll,f=>{let n=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:c}=u;if(c?.current&&p){let L=Math.abs(d.current-n.scrollTop);if(L>0){let x=window.innerHeight-Te*2,i=parseFloat(p.style.minHeight),m=parseFloat(p.style.height),h=Math.max(i,m);if(h<x){let I=h+L,g=Math.min(x,I),P=I-g;p.style.height=g+"px",p.style.bottom==="0px"&&(n.scrollTop=P>0?P:0,p.style.justifyContent="flex-end");}}}d.current=n.scrollTop;})})})]})});Es.displayName=er;var Us="SelectGroup",[cc,pc]=Ba(Us),mc=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,...o}=e,r=Qe();return jsxRuntime.jsx(cc,{scope:t,id:r,children:jsxRuntime.jsx(N.div,{role:"group","aria-labelledby":r,...o,ref:a})})});mc.displayName=Us;var Hs="SelectLabel",Ns=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,...o}=e,r=pc(Hs,t);return jsxRuntime.jsx(N.div,{id:r.id,...o,ref:a})});Ns.displayName=Hs;var Kt="SelectItem",[Lc,Ws]=Ba(Kt),Gs=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,value:o,disabled:r=false,textValue:l,...u}=e,s=aa(Kt,t),d=ta(Kt,t),f=s.value===o,[n,p]=y__namespace.useState(l??""),[c,L]=y__namespace.useState(false),x=X(a,I=>d.itemRefCallback?.(I,o,r)),i=Qe(),m=y__namespace.useRef("touch"),h=()=>{r||(s.onValueChange(o),s.onOpenChange(false));};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return jsxRuntime.jsx(Lc,{scope:t,value:o,disabled:r,textId:i,isSelected:f,onItemTextChange:y__namespace.useCallback(I=>{p(g=>g||(I?.textContent??"").trim());},[]),children:jsxRuntime.jsx(jt.ItemSlot,{scope:t,value:o,disabled:r,textValue:n,children:jsxRuntime.jsx(N.div,{role:"option","aria-labelledby":i,"data-highlighted":c?"":void 0,"aria-selected":f&&c,"data-state":f?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...u,ref:x,onFocus:K(u.onFocus,()=>L(true)),onBlur:K(u.onBlur,()=>L(false)),onClick:K(u.onClick,()=>{m.current!=="mouse"&&h();}),onPointerUp:K(u.onPointerUp,()=>{m.current==="mouse"&&h();}),onPointerDown:K(u.onPointerDown,I=>{m.current=I.pointerType;}),onPointerMove:K(u.onPointerMove,I=>{m.current=I.pointerType,r?d.onItemLeave?.():m.current==="mouse"&&I.currentTarget.focus({preventScroll:true});}),onPointerLeave:K(u.onPointerLeave,I=>{I.currentTarget===document.activeElement&&d.onItemLeave?.();}),onKeyDown:K(u.onKeyDown,I=>{d.searchRef?.current!==""&&I.key===" "||(ec.includes(I.key)&&h(),I.key===" "&&I.preventDefault());})})})})});Gs.displayName=Kt;var rt="SelectItemText",Vs=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,className:o,style:r,...l}=e,u=aa(rt,t),s=ta(rt,t),d=Ws(rt,t),f=rc(rt,t),[n,p]=y__namespace.useState(null),c=X(a,h=>p(h),d.onItemTextChange,h=>s.itemTextRefCallback?.(h,d.value,d.disabled)),L=n?.textContent,x=y__namespace.useMemo(()=>jsxRuntime.jsx("option",{value:d.value,disabled:d.disabled,children:L},d.value),[d.disabled,d.value,L]),{onNativeOptionAdd:i,onNativeOptionRemove:m}=f;return Y(()=>(i(x),()=>m(x)),[i,m,x]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(N.span,{id:d.textId,...l,ref:c}),d.isSelected&&u.valueNode&&!u.valueNodeHasChildren?rr__namespace.createPortal(l.children,u.valueNode):null]})});Vs.displayName=rt;var zs="SelectItemIndicator",_s=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,...o}=e;return Ws(zs,t).isSelected?jsxRuntime.jsx(N.span,{"aria-hidden":true,...o,ref:a}):null});_s.displayName=zs;var ar="SelectScrollUpButton",Xs=y__namespace.forwardRef((e,a)=>{let t=ta(ar,e.__scopeSelect),o=ur(ar,e.__scopeSelect),[r,l]=y__namespace.useState(false),u=X(a,o.onScrollButtonChange);return Y(()=>{if(t.viewport&&t.isPositioned){let d=function(){let n=f.scrollTop>0;l(n);};let f=t.viewport;return d(),f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[t.viewport,t.isPositioned]),r?jsxRuntime.jsx(js,{...e,ref:u,onAutoScroll:()=>{let{viewport:s,selectedItem:d}=t;s&&d&&(s.scrollTop=s.scrollTop-d.offsetHeight);}}):null});Xs.displayName=ar;var tr="SelectScrollDownButton",Ks=y__namespace.forwardRef((e,a)=>{let t=ta(tr,e.__scopeSelect),o=ur(tr,e.__scopeSelect),[r,l]=y__namespace.useState(false),u=X(a,o.onScrollButtonChange);return Y(()=>{if(t.viewport&&t.isPositioned){let d=function(){let n=f.scrollHeight-f.clientHeight,p=Math.ceil(f.scrollTop)<n;l(p);};let f=t.viewport;return d(),f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[t.viewport,t.isPositioned]),r?jsxRuntime.jsx(js,{...e,ref:u,onAutoScroll:()=>{let{viewport:s,selectedItem:d}=t;s&&d&&(s.scrollTop=s.scrollTop+d.offsetHeight);}}):null});Ks.displayName=tr;var js=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,onAutoScroll:o,...r}=e,l=ta("SelectScrollButton",t),u=y__namespace.useRef(null),s=Zt(t),d=y__namespace.useCallback(()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null);},[]);return y__namespace.useEffect(()=>()=>d(),[d]),Y(()=>{s().find(n=>n.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"});},[s]),jsxRuntime.jsx(N.div,{"aria-hidden":true,...r,ref:a,style:{flexShrink:0,...r.style},onPointerDown:K(r.onPointerDown,()=>{u.current===null&&(u.current=window.setInterval(o,50));}),onPointerMove:K(r.onPointerMove,()=>{l.onItemLeave?.(),u.current===null&&(u.current=window.setInterval(o,50));}),onPointerLeave:K(r.onPointerLeave,()=>{d();})})}),xc="SelectSeparator",Zs=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,...o}=e;return jsxRuntime.jsx(N.div,{"aria-hidden":true,...o,ref:a})});Zs.displayName=xc;var or="SelectArrow",Ic=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,...o}=e,r=$t(t),l=aa(or,t),u=ta(or,t);return l.open&&u.position==="popper"?jsxRuntime.jsx(Ps,{...r,...o,ref:a}):null});Ic.displayName=or;var hc="SelectBubbleInput",$s=y__namespace.forwardRef(({__scopeSelect:e,value:a,...t},o)=>{let r=y__namespace.useRef(null),l=X(o,r),u=vs(a);return y__namespace.useEffect(()=>{let s=r.current;if(!s)return;let d=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(d,"value").set;if(u!==a&&n){let p=new Event("change",{bubbles:true});n.call(s,a),s.dispatchEvent(p);}},[u,a]),jsxRuntime.jsx(N.select,{...t,style:{...Jo,...t.style},ref:l,defaultValue:a})});$s.displayName=hc;function Qs(e){return e===""||e===void 0}function Js(e){let a=we(e),t=y__namespace.useRef(""),o=y__namespace.useRef(0),r=y__namespace.useCallback(u=>{let s=t.current+u;a(s),(function d(f){t.current=f,window.clearTimeout(o.current),f!==""&&(o.current=window.setTimeout(()=>d(""),1e3));})(s);},[a]),l=y__namespace.useCallback(()=>{t.current="",window.clearTimeout(o.current);},[]);return y__namespace.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,r,l]}function Ys(e,a,t){let r=a.length>1&&Array.from(a).every(f=>f===a[0])?a[0]:a,l=t?e.indexOf(t):-1,u=gc(e,Math.max(l,0));r.length===1&&(u=u.filter(f=>f!==t));let d=u.find(f=>f.textValue.toLowerCase().startsWith(r.toLowerCase()));return d!==t?d:void 0}function gc(e,a){return e.map((t,o)=>e[(a+o)%e.length])}var ed=Rs,sr=bs,ad=Ds,td=Ms,od=Bs,dr=Fs,rd=Es;var fr=Ns,nr=Gs,ld=Vs,ud=_s,ir=Xs,cr=Ks,pr=Zs;var sd=ed;var dd=ad,mr=y__namespace.forwardRef(({className:e,children:a,...t},o)=>jsxRuntime.jsxs(sr,{ref:o,className:q("flex h-9 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...t,children:[a,jsxRuntime.jsx(td,{asChild:true,children:jsxRuntime.jsx(ba,{className:"h-4 w-4 opacity-50"})})]}));mr.displayName=sr.displayName;var fd=y__namespace.forwardRef(({className:e,...a},t)=>jsxRuntime.jsx(ir,{ref:t,className:q("flex cursor-default items-center justify-center py-1",e),...a,children:jsxRuntime.jsx($a,{className:"h-4 w-4"})}));fd.displayName=ir.displayName;var nd=y__namespace.forwardRef(({className:e,...a},t)=>jsxRuntime.jsx(cr,{ref:t,className:q("flex cursor-default items-center justify-center py-1",e),...a,children:jsxRuntime.jsx(ba,{className:"h-4 w-4"})}));nd.displayName=cr.displayName;var Lr=y__namespace.forwardRef(({className:e,children:a,position:t="popper",...o},r)=>jsxRuntime.jsx(od,{children:jsxRuntime.jsxs(dr,{ref:r,className:q("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t==="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:t,...o,children:[jsxRuntime.jsx(fd,{}),jsxRuntime.jsx(rd,{className:q("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),jsxRuntime.jsx(nd,{})]})}));Lr.displayName=dr.displayName;var Sc=y__namespace.forwardRef(({className:e,...a},t)=>jsxRuntime.jsx(fr,{ref:t,className:q("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...a}));Sc.displayName=fr.displayName;var Qt=y__namespace.forwardRef(({className:e,children:a,...t},o)=>jsxRuntime.jsxs(nr,{ref:o,className:q("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(ud,{children:jsxRuntime.jsx(Za,{className:"h-4 w-4"})})}),jsxRuntime.jsx(ld,{children:a})]}));Qt.displayName=nr.displayName;var wc=y__namespace.forwardRef(({className:e,...a},t)=>jsxRuntime.jsx(pr,{ref:t,className:q("-mx-1 my-1 h-px bg-muted",e),...a}));wc.displayName=pr.displayName;var Ir=y__namespace.createContext(null),Pc=y__namespace.forwardRef(({className:e,defaultValue:a,value:t,onValueChange:o,children:r,...l},u)=>{let[s,d]=y__namespace.useState(t||a||"");y__namespace.useEffect(()=>{t!==void 0&&d(t);},[t]);let f=y__namespace.useCallback(n=>{d(n),o?.(n);},[o]);return jsxRuntime.jsx(Ir.Provider,{value:{value:s,onValueChange:f},children:jsxRuntime.jsx("div",{ref:u,className:q("",e),...l,children:r})})});Pc.displayName="Tabs";var vc=y__namespace.forwardRef(({className:e,...a},t)=>jsxRuntime.jsx("div",{ref:t,className:q("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...a}));vc.displayName="TabsList";var yc=y__namespace.forwardRef(({className:e,value:a,...t},o)=>{let r=y__namespace.useContext(Ir),l=r?.value===a;return jsxRuntime.jsx("button",{ref:o,type:"button",role:"tab","aria-selected":l,"data-state":l?"active":"inactive",className:q("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),onClick:()=>r?.onValueChange(a),...t})});yc.displayName="TabsTrigger";var Rc=y__namespace.forwardRef(({className:e,value:a,...t},o)=>{let l=y__namespace.useContext(Ir)?.value===a;return l?jsxRuntime.jsx("div",{ref:o,role:"tabpanel","data-state":l?"active":"inactive",className:q("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}):null});Rc.displayName="TabsContent";var cd=({schema:e,onSubmit:a,initialData:t={},submitLabel:o="Submit"})=>{let[r,l]=y.useState(t),[u,s]=y.useState({}),d=(c,L)=>{l(x=>({...x,[c]:L})),u[c]&&s(x=>{let i={...x};return delete i[c],i});},f=()=>{let c={},L=true;return e.forEach(x=>{x.required&&(r[x.name]===void 0||r[x.name]==="")&&(c[x.name]="This field is required",L=false);}),s(c),L},n=c=>{c.preventDefault(),f()&&a(r);},p=c=>{switch(c.type){case "string":return jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs(Na,{htmlFor:c.name,children:[c.name," ",c.required&&jsxRuntime.jsx("span",{className:"text-destructive",children:"*"})]}),jsxRuntime.jsx(Ua,{id:c.name,value:r[c.name]||"",onChange:L=>d(c.name,L.target.value),placeholder:c.description,className:u[c.name]?"border-destructive":""}),u[c.name]&&jsxRuntime.jsx("p",{className:"text-[10px] text-destructive",children:u[c.name]}),c.description&&!u[c.name]&&jsxRuntime.jsx("p",{className:"text-[10px] text-muted-foreground",children:c.description})]},c.name);case "number":return jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs(Na,{htmlFor:c.name,children:[c.name," ",c.required&&jsxRuntime.jsx("span",{className:"text-destructive",children:"*"})]}),jsxRuntime.jsx(Ua,{id:c.name,type:"number",value:r[c.name]||"",onChange:L=>d(c.name,parseFloat(L.target.value)),placeholder:c.description,className:u[c.name]?"border-destructive":""}),u[c.name]&&jsxRuntime.jsx("p",{className:"text-[10px] text-destructive",children:u[c.name]})]},c.name);case "boolean":return jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs(Na,{htmlFor:c.name,children:[c.name," ",c.required&&jsxRuntime.jsx("span",{className:"text-destructive",children:"*"})]}),jsxRuntime.jsxs(sd,{value:r[c.name]===void 0?"":String(r[c.name]),onValueChange:L=>d(c.name,L==="true"),children:[jsxRuntime.jsx(mr,{id:c.name,className:u[c.name]?"border-destructive":"",children:jsxRuntime.jsx(dd,{placeholder:"Select..."})}),jsxRuntime.jsxs(Lr,{children:[jsxRuntime.jsx(Qt,{value:"true",children:"Yes"}),jsxRuntime.jsx(Qt,{value:"false",children:"No"})]})]}),u[c.name]&&jsxRuntime.jsx("p",{className:"text-[10px] text-destructive",children:u[c.name]})]},c.name);default:return null}};return jsxRuntime.jsxs("form",{onSubmit:n,className:"space-y-4 w-full",children:[e.map(p),jsxRuntime.jsx(Ze,{type:"submit",className:"w-full mt-4",children:o})]})};var pd=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),kc=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,t,o)=>o?o.toUpperCase():t.toLowerCase()),hr=e=>{let a=kc(e);return a.charAt(0).toUpperCase()+a.slice(1)},Jt=(...e)=>e.filter((a,t,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===t).join(" ").trim(),md=e=>{for(let a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return true};var Ld={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var Id=y.forwardRef(({color:e="currentColor",size:a=24,strokeWidth:t=2,absoluteStrokeWidth:o,className:r="",children:l,iconNode:u,...s},d)=>y.createElement("svg",{ref:d,...Ld,width:a,height:a,stroke:e,strokeWidth:o?Number(t)*24/Number(a):t,className:Jt("lucide",r),...!l&&!md(s)&&{"aria-hidden":"true"},...s},[...u.map(([f,n])=>y.createElement(f,n)),...Array.isArray(l)?l:[l]]));var ke=(e,a)=>{let t=y.forwardRef(({className:o,...r},l)=>y.createElement(Id,{ref:l,iconNode:a,className:Jt(`lucide-${pd(hr(e))}`,`lucide-${e}`,o),...r}));return t.displayName=hr(e),t};var Mc=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Fa=ke("activity",Mc);var Bc=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],ut=ke("brain",Bc);var Fc=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],st=ke("file-text",Fc);var Tc=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Xe=ke("loader-circle",Tc);var Oc=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],dt=ke("search",Oc);var qc=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],ft=ke("shield-alert",qc);var hd=({currentStatus:e,currentNodeId:a,iteration:t=0,messages:o})=>{let r=[{id:"parse-intent",label:"Analyzing Intent",icon:jsxRuntime.jsx(Fa,{className:"w-4 h-4"}),status:"pending"},{id:"create-plan",label:"Planning Research",icon:jsxRuntime.jsx(ut,{className:"w-4 h-4"}),status:"pending"},{id:"search-agent",label:"Gathering Evidence",icon:jsxRuntime.jsx(dt,{className:"w-4 h-4"}),status:"pending"},{id:"adversarial-review",label:"Critical Review",icon:jsxRuntime.jsx(ft,{className:"w-4 h-4"}),status:"pending"},{id:"final-report",label:"Final Report",icon:jsxRuntime.jsx(st,{className:"w-4 h-4"}),status:"pending"}],l=r.findIndex(u=>u.id===a);return r.forEach((u,s)=>{s<l?u.status="completed":s===l&&(u.status="active");}),jsxRuntime.jsxs("div",{className:"w-full space-y-6 animate-in fade-in slide-in-from-bottom-4 duration-500",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-5 gap-4",children:r.map(u=>jsxRuntime.jsx(qa,{className:`border-2 transition-all duration-300 ${u.status==="active"?"border-primary shadow-md scale-105 bg-primary/5":u.status==="completed"?"border-green-500/20 bg-green-50/50":"opacity-50 grayscale"}`,children:jsxRuntime.jsxs(Ea,{className:"p-4 flex flex-col items-center justify-center text-center gap-2",children:[jsxRuntime.jsx("div",{className:`p-2 rounded-full ${u.status==="active"?"bg-primary text-primary-foreground animate-pulse":u.status==="completed"?"bg-green-500 text-white":"bg-muted text-muted-foreground"}`,children:u.status==="active"?jsxRuntime.jsx(Xe,{className:"w-5 h-5 animate-spin"}):u.icon}),jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider",children:u.label})]})},u.id))}),jsxRuntime.jsxs("div",{className:"bg-muted/30 rounded-xl p-6 border border-border/50 backdrop-blur-sm",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[jsxRuntime.jsx(Fa,{className:"w-4 h-4 text-primary"}),"Live Research Feed",t>0&&jsxRuntime.jsxs("span",{className:"ml-2 px-2 py-0.5 bg-blue-100 text-blue-700 text-[10px] rounded-full font-bold uppercase",children:["Iteration ",t]})]}),jsxRuntime.jsxs("span",{className:"text-[10px] tabular-nums text-muted-foreground uppercase font-medium",children:["Session Active \u2022 ",new Date().toLocaleTimeString()]})]}),jsxRuntime.jsxs("div",{className:"space-y-3 max-h-[300px] overflow-y-auto pr-2 custom-scrollbar",children:[o.filter(u=>u.role==="trace"||u.role==="system").slice(-8).map((u,s)=>jsxRuntime.jsxs("div",{className:"flex gap-3 text-sm animate-in slide-in-from-left-2 duration-300",children:[jsxRuntime.jsxs("span",{className:"text-muted-foreground/40 font-mono text-xs pt-0.5 shrink-0",children:["[",new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),"]"]}),jsxRuntime.jsx("p",{className:`${u.role==="system"?"font-semibold text-primary":"text-muted-foreground"}`,children:u.content})]},s)),e&&jsxRuntime.jsxs("div",{className:"flex gap-3 text-sm font-medium text-foreground bg-primary/5 p-2 rounded border border-primary/10",children:[jsxRuntime.jsx(Xe,{className:"w-4 h-4 animate-spin text-primary shrink-0 mt-0.5"}),jsxRuntime.jsx("p",{children:e})]})]})]})]})};function gd({apiEndpoint:e,onMessage:a,onInterrupt:t,onError:o,onDone:r}){let[l,u]=y.useState([]),[s,d]=y.useState(false),[f,n]=y.useState(void 0),[p,c]=y.useState(null),L=y.useCallback(h=>{let I={...h,id:crypto.randomUUID()};u(g=>[...g,I]),a?.(I);},[a]),x=y.useCallback(async(h,I,g,P)=>{d(true);try{let S=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workflow:h,input:I,history:l,threadId:g,resumeValue:P})});if(!S.ok)throw new Error(`HTTP error! status: ${S.status}`);let R=S.body?.getReader(),w=new TextDecoder;if(!R)throw new Error("Response body is not readable");for(;;){let{done:v,value:B}=await R.read();if(v)break;let H=w.decode(B,{stream:!0}).split(`
|
|
46
|
-
`);for(let U of H)if(U.startsWith("data: ")){let W=U.slice(6);try{let D=JSON.parse(W);if(D.type==="event"||D.type==="final"||D.type==="error")L(D.message);else if(D.type==="interrupt")n(D.payload.threadId),D.payload.interruptDetails?.reason==="timeout_prevention"||D.payload.interruptDetails?.reason==="recursion_limit"?setTimeout(()=>{x(h,"",D.payload.threadId,"proceed");},100):(c(D.payload.interruptDetails),t?.(D.payload.interruptDetails));else if(D.type==="done"){r?.();break}}catch(D){console.error("Failed to parse SSE data:",D);}}}}catch(S){let R={role:"system",content:`Error: ${S?.message??"Unknown error"}`};L(R),o?.(S);}finally{d(false);}},[e,l,L,t,o,r]),i=y.useCallback(async(h,I)=>{u([{role:"user",content:I,id:crypto.randomUUID()}]),c(null),n(void 0),await x(h,I);},[x]),m=y.useCallback(async(h,I)=>{c(null),f&&await x(h,"",f,I);},[f,x]);return {messages:l,isRunning:s,currentThreadId:f,pendingInterrupt:p,runExecution:x,restart:i,resume:m}}var _h=({workflow:e,apiEndpoint:a="/api/execute",className:t})=>{let{messages:o,isRunning:r,pendingInterrupt:l,restart:u,resume:s}=gd({apiEndpoint:a}),[d,f]=y.useState(""),[n,p]=y.useState(""),L=e.nodes.find(m=>m.type==="input")?.config,x=m=>{m.preventDefault();let h=L?.triggerType==="manual"?"Start":d;h.trim()&&(u(e,h),f(""));},i=(m,h)=>{m.preventDefault();let I=h??n;typeof I=="string"&&!I.trim()&&l?.uiType!=="confirmation"||(s(e,I),p(""));};return jsxRuntime.jsx("div",{className:q("flex-1 flex flex-col items-center justify-center p-4 md:p-8 bg-muted/5 min-h-[400px]",t),children:l?jsxRuntime.jsx("div",{className:"w-full max-w-2xl animate-in fade-in zoom-in duration-300",children:jsxRuntime.jsxs(qa,{className:"shadow-lg border-2 border-primary/10",children:[jsxRuntime.jsx(fo,{className:"text-center",children:jsxRuntime.jsx(no,{className:"text-xl",children:l.prompt})}),jsxRuntime.jsx(Ea,{children:l.uiType==="form"&&l.schema?jsxRuntime.jsx(cd,{schema:l.schema,onSubmit:m=>i({preventDefault:()=>{}},m),submitLabel:"Continue"}):l.uiType==="confirmation"?jsxRuntime.jsxs("div",{className:"flex justify-center gap-4",children:[jsxRuntime.jsx(Ze,{size:"lg",className:"w-32",onClick:m=>i(m,"yes"),children:"Yes, Proceed"}),jsxRuntime.jsx(Ze,{size:"lg",variant:"outline",className:"w-32",onClick:m=>i(m,"no"),children:"Cancel"})]}):jsxRuntime.jsxs("div",{className:"flex gap-2 max-w-md mx-auto",children:[jsxRuntime.jsx(Ua,{value:n,onChange:m=>p(m.target.value),placeholder:"Type your answer...",className:"text-lg h-12",autoFocus:true}),jsxRuntime.jsx(Ze,{size:"lg",onClick:m=>i(m),children:"Submit"})]})})]})}):r?jsxRuntime.jsx("div",{className:"w-full max-w-4xl",children:e.id.includes("research")?jsxRuntime.jsx(hd,{currentStatus:o.slice(-1)[0]?.content||"Processing...",currentNodeId:o.filter(m=>m.role==="trace").slice(-1)[0]?.meta?.nodeId,iteration:o.filter(m=>m.role==="trace"&&m.content.includes("Iteration")).length>0?parseInt(o.filter(m=>m.role==="trace"&&m.content.includes("Iteration")).slice(-1)[0].content.match(/Iteration (\d+)/)?.[1]||"0"):0,messages:o}):jsxRuntime.jsxs("div",{className:"text-center space-y-4 animate-pulse",children:[jsxRuntime.jsx("div",{className:"w-16 h-16 bg-primary/20 rounded-full mx-auto flex items-center justify-center",children:jsxRuntime.jsx("div",{className:"w-8 h-8 bg-primary rounded-full animate-ping"})}),jsxRuntime.jsx("p",{className:"text-lg font-medium text-muted-foreground",children:"Processing Workflow..."})]})}):jsxRuntime.jsxs("div",{className:"w-full max-w-2xl space-y-6",children:[o.length>1&&jsxRuntime.jsxs(qa,{className:"border-primary/20 bg-primary/5 animate-in slide-in-from-top-4 duration-500 shadow-sm",children:[jsxRuntime.jsx(fo,{className:"pb-2",children:jsxRuntime.jsx(no,{className:"text-lg font-bold",children:"Execution Result"})}),jsxRuntime.jsx(Ea,{children:jsxRuntime.jsx("div",{className:"text-sm leading-relaxed whitespace-pre-wrap text-foreground/90",children:o.filter(m=>m.role==="assistant").slice(-1)[0]?.content||o.filter(m=>m.role==="system"&&m.content.startsWith("Final Output")).slice(-1)[0]?.content||"Workflow completed."})})]}),jsxRuntime.jsxs("div",{className:"text-center space-y-6 w-full max-w-xl py-12",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:o.length>1?"Run Again":"Ready to Start"}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:L?.triggerType==="manual"?"Click below to begin the workflow process.":"Enter your request details to begin the workflow."})]}),L?.triggerType==="manual"?jsxRuntime.jsx(Ze,{size:"lg",className:"w-full h-12 text-base font-semibold",onClick:m=>x(m),children:"Start Process"}):jsxRuntime.jsxs("form",{onSubmit:m=>x(m),className:"space-y-4",children:[jsxRuntime.jsx(zr,{value:d,onChange:m=>f(m.target.value),placeholder:"e.g., 'Research the latest trends in AI agents'...",className:"min-h-[120px] text-base p-4 shadow-sm resize-none"}),jsxRuntime.jsx(Ze,{size:"lg",className:"w-full h-12 text-base font-semibold",type:"submit",disabled:!d.trim(),children:"Start Workflow"})]})]})]})})};/*! Bundled license information:
|
|
45
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return y__namespace.useEffect(()=>{e&&(document.getElementById(e)||console.error(t));},[t,e]),null},zn="DialogDescriptionWarning",_n=({contentRef:e,descriptionId:a})=>{let o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Yl(zn).contentName}}.`;return y__namespace.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");a&&r&&(document.getElementById(a)||console.warn(o));},[o,e,a]),null};var eu=Vl,Oo=zl,qo=_l,Eo=Kl,Uo=Zl,au=Ql;var tu=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Kn=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,t,o)=>o?o.toUpperCase():t.toLowerCase()),Ho=e=>{let a=Kn(e);return a.charAt(0).toUpperCase()+a.slice(1)},Bt=(...e)=>e.filter((a,t,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===t).join(" ").trim(),ou=e=>{for(let a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return true};var ru={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var uu=y.forwardRef(({color:e="currentColor",size:a=24,strokeWidth:t=2,absoluteStrokeWidth:o,className:r="",children:l,iconNode:u,...s},d)=>y.createElement("svg",{ref:d,...ru,width:a,height:a,stroke:e,strokeWidth:o?Number(t)*24/Number(a):t,className:Bt("lucide",r),...!l&&!ou(s)&&{"aria-hidden":"true"},...s},[...u.map(([f,n])=>y.createElement(f,n)),...Array.isArray(l)?l:[l]]));var Ye=(e,a)=>{let t=y.forwardRef(({className:o,...r},l)=>y.createElement(uu,{ref:l,iconNode:a,className:Bt(`lucide-${tu(Ho(e))}`,`lucide-${e}`,o),...r}));return t.displayName=Ho(e),t};var Qn=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Za=Ye("check",Qn);var Jn=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ba=Ye("chevron-down",Jn);var Yn=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],$a=Ye("chevron-up",Yn);var ei=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Qa=Ye("x",ei);var ai=eu;var su=y__namespace.forwardRef(({className:e,...a},t)=>jsxRuntime.jsx(Oo,{ref:t,className:q("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...a}));su.displayName=Oo.displayName;var ti=y__namespace.forwardRef(({className:e,children:a,...t},o)=>jsxRuntime.jsxs(ai,{children:[jsxRuntime.jsx(su,{}),jsxRuntime.jsxs(qo,{ref:o,className:q("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...t,children:[a,jsxRuntime.jsxs(au,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[jsxRuntime.jsx(Qa,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ti.displayName=qo.displayName;var li=y__namespace.forwardRef(({className:e,...a},t)=>jsxRuntime.jsx(Eo,{ref:t,className:q("text-lg font-semibold leading-none tracking-tight",e),...a}));li.displayName=Eo.displayName;var ui=y__namespace.forwardRef(({className:e,...a},t)=>jsxRuntime.jsx(Uo,{ref:t,className:q("text-sm text-muted-foreground",e),...a}));ui.displayName=Uo.displayName;function du(e){let a=e+"CollectionProvider",[t,o]=$e(a),[r,l]=t(a,{collectionRef:{current:null},itemMap:new Map}),u=i=>{let{scope:m,children:h}=i,I=y__namespace.default.useRef(null),g=y__namespace.default.useRef(new Map).current;return jsxRuntime.jsx(r,{scope:m,itemMap:g,collectionRef:I,children:h})};u.displayName=a;let s=e+"CollectionSlot",d=Ve(s),f=y__namespace.default.forwardRef((i,m)=>{let{scope:h,children:I}=i,g=l(s,h),P=X(m,g.collectionRef);return jsxRuntime.jsx(d,{ref:P,children:I})});f.displayName=s;let n=e+"CollectionItemSlot",p="data-radix-collection-item",c=Ve(n),L=y__namespace.default.forwardRef((i,m)=>{let{scope:h,children:I,...g}=i,P=y__namespace.default.useRef(null),S=X(m,P),R=l(n,h);return y__namespace.default.useEffect(()=>(R.itemMap.set(P,{ref:P,...g}),()=>{R.itemMap.delete(P);})),jsxRuntime.jsx(c,{[p]:"",ref:S,children:I})});L.displayName=n;function x(i){let m=l(e+"CollectionConsumer",i);return y__namespace.default.useCallback(()=>{let I=m.collectionRef.current;if(!I)return [];let g=Array.from(I.querySelectorAll(`[${p}]`));return Array.from(m.itemMap.values()).sort((R,w)=>g.indexOf(R.ref.current)-g.indexOf(w.ref.current))},[m.collectionRef,m.itemMap])}return [{Provider:u,Slot:f,ItemSlot:L},x,o]}var iu=["top","right","bottom","left"];var Ue=Math.min,pe=Math.max,et=Math.round,at=Math.floor,De=e=>({x:e,y:e}),si={left:"right",right:"left",bottom:"top",top:"bottom"},di={start:"end",end:"start"};function Tt(e,a,t){return pe(e,Ue(a,t))}function He(e,a){return typeof e=="function"?e(a):e}function Ne(e){return e.split("-")[0]}function ia(e){return e.split("-")[1]}function Ot(e){return e==="x"?"y":"x"}function qt(e){return e==="y"?"height":"width"}var fi=new Set(["top","bottom"]);function Me(e){return fi.has(Ne(e))?"y":"x"}function Et(e){return Ot(Me(e))}function cu(e,a,t){t===void 0&&(t=false);let o=ia(e),r=Et(e),l=qt(r),u=r==="x"?o===(t?"end":"start")?"right":"left":o==="start"?"bottom":"top";return a.reference[l]>a.floating[l]&&(u=Ya(u)),[u,Ya(u)]}function pu(e){let a=Ya(e);return [Ft(e),a,Ft(a)]}function Ft(e){return e.replace(/start|end/g,a=>di[a])}var fu=["left","right"],nu=["right","left"],ni=["top","bottom"],ii=["bottom","top"];function ci(e,a,t){switch(e){case "top":case "bottom":return t?a?nu:fu:a?fu:nu;case "left":case "right":return a?ni:ii;default:return []}}function mu(e,a,t,o){let r=ia(e),l=ci(Ne(e),t==="start",o);return r&&(l=l.map(u=>u+"-"+r),a&&(l=l.concat(l.map(Ft)))),l}function Ya(e){return e.replace(/left|right|bottom|top/g,a=>si[a])}function pi(e){return {top:0,right:0,bottom:0,left:0,...e}}function Go(e){return typeof e!="number"?pi(e):{top:e,right:e,bottom:e,left:e}}function ca(e){let{x:a,y:t,width:o,height:r}=e;return {width:o,height:r,top:t,left:a,right:a+o,bottom:t+r,x:a,y:t}}function Lu(e,a,t){let{reference:o,floating:r}=e,l=Me(a),u=Et(a),s=qt(u),d=Ne(a),f=l==="y",n=o.x+o.width/2-r.width/2,p=o.y+o.height/2-r.height/2,c=o[s]/2-r[s]/2,L;switch(d){case "top":L={x:n,y:o.y-r.height};break;case "bottom":L={x:n,y:o.y+o.height};break;case "right":L={x:o.x+o.width,y:p};break;case "left":L={x:o.x-r.width,y:p};break;default:L={x:o.x,y:o.y};}switch(ia(a)){case "start":L[u]-=c*(t&&f?-1:1);break;case "end":L[u]+=c*(t&&f?-1:1);break}return L}var hu=async(e,a,t)=>{let{placement:o="bottom",strategy:r="absolute",middleware:l=[],platform:u}=t,s=l.filter(Boolean),d=await(u.isRTL==null?void 0:u.isRTL(a)),f=await u.getElementRects({reference:e,floating:a,strategy:r}),{x:n,y:p}=Lu(f,o,d),c=o,L={},x=0;for(let i=0;i<s.length;i++){let{name:m,fn:h}=s[i],{x:I,y:g,data:P,reset:S}=await h({x:n,y:p,initialPlacement:o,placement:c,strategy:r,middlewareData:L,rects:f,platform:u,elements:{reference:e,floating:a}});n=I??n,p=g??p,L={...L,[m]:{...L[m],...P}},S&&x<=50&&(x++,typeof S=="object"&&(S.placement&&(c=S.placement),S.rects&&(f=S.rects===true?await u.getElementRects({reference:e,floating:a,strategy:r}):S.rects),{x:n,y:p}=Lu(f,c,d)),i=-1);}return {x:n,y:p,placement:c,strategy:r,middlewareData:L}};async function Aa(e,a){var t;a===void 0&&(a={});let{x:o,y:r,platform:l,rects:u,elements:s,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:n="viewport",elementContext:p="floating",altBoundary:c=false,padding:L=0}=He(a,e),x=Go(L),m=s[c?p==="floating"?"reference":"floating":p],h=ca(await l.getClippingRect({element:(t=await(l.isElement==null?void 0:l.isElement(m)))==null||t?m:m.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(s.floating)),boundary:f,rootBoundary:n,strategy:d})),I=p==="floating"?{x:o,y:r,width:u.floating.width,height:u.floating.height}:u.reference,g=await(l.getOffsetParent==null?void 0:l.getOffsetParent(s.floating)),P=await(l.isElement==null?void 0:l.isElement(g))?await(l.getScale==null?void 0:l.getScale(g))||{x:1,y:1}:{x:1,y:1},S=ca(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:I,offsetParent:g,strategy:d}):I);return {top:(h.top-S.top+x.top)/P.y,bottom:(S.bottom-h.bottom+x.bottom)/P.y,left:(h.left-S.left+x.left)/P.x,right:(S.right-h.right+x.right)/P.x}}var gu=e=>({name:"arrow",options:e,async fn(a){let{x:t,y:o,placement:r,rects:l,platform:u,elements:s,middlewareData:d}=a,{element:f,padding:n=0}=He(e,a)||{};if(f==null)return {};let p=Go(n),c={x:t,y:o},L=Et(r),x=qt(L),i=await u.getDimensions(f),m=L==="y",h=m?"top":"left",I=m?"bottom":"right",g=m?"clientHeight":"clientWidth",P=l.reference[x]+l.reference[L]-c[L]-l.floating[x],S=c[L]-l.reference[L],R=await(u.getOffsetParent==null?void 0:u.getOffsetParent(f)),w=R?R[g]:0;(!w||!await(u.isElement==null?void 0:u.isElement(R)))&&(w=s.floating[g]||l.floating[x]);let v=P/2-S/2,B=w/2-i[x]/2-1,E=Ue(p[h],B),H=Ue(p[I],B),U=E,W=w-i[x]-H,D=w/2-i[x]/2+v,G=Tt(U,D,W),M=!d.arrow&&ia(r)!=null&&D!==G&&l.reference[x]/2-(D<U?E:H)-i[x]/2<0,O=M?D<U?D-U:D-W:0;return {[L]:c[L]+O,data:{[L]:G,centerOffset:D-G-O,...M&&{alignmentOffset:O}},reset:M}}});var Cu=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(a){var t,o;let{placement:r,middlewareData:l,rects:u,initialPlacement:s,platform:d,elements:f}=a,{mainAxis:n=true,crossAxis:p=true,fallbackPlacements:c,fallbackStrategy:L="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:i=true,...m}=He(e,a);if((t=l.arrow)!=null&&t.alignmentOffset)return {};let h=Ne(r),I=Me(s),g=Ne(s)===s,P=await(d.isRTL==null?void 0:d.isRTL(f.floating)),S=c||(g||!i?[Ya(s)]:pu(s)),R=x!=="none";!c&&R&&S.push(...mu(s,i,x,P));let w=[s,...S],v=await Aa(a,m),B=[],E=((o=l.flip)==null?void 0:o.overflows)||[];if(n&&B.push(v[h]),p){let D=cu(r,u,P);B.push(v[D[0]],v[D[1]]);}if(E=[...E,{placement:r,overflows:B}],!B.every(D=>D<=0)){var H,U;let D=(((H=l.flip)==null?void 0:H.index)||0)+1,G=w[D];if(G&&(!(p==="alignment"?I!==Me(G):false)||E.every(C=>Me(C.placement)===I?C.overflows[0]>0:true)))return {data:{index:D,overflows:E},reset:{placement:G}};let M=(U=E.filter(O=>O.overflows[0]<=0).sort((O,C)=>O.overflows[1]-C.overflows[1])[0])==null?void 0:U.placement;if(!M)switch(L){case "bestFit":{var W;let O=(W=E.filter(C=>{if(R){let z=Me(C.placement);return z===I||z==="y"}return true}).map(C=>[C.placement,C.overflows.filter(z=>z>0).reduce((z,fe)=>z+fe,0)]).sort((C,z)=>C[1]-z[1])[0])==null?void 0:W[0];O&&(M=O);break}case "initialPlacement":M=s;break}if(r!==M)return {reset:{placement:M}}}return {}}}};function xu(e,a){return {top:e.top-a.height,right:e.right-a.width,bottom:e.bottom-a.height,left:e.left-a.width}}function Iu(e){return iu.some(a=>e[a]>=0)}var Su=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(a){let{rects:t}=a,{strategy:o="referenceHidden",...r}=He(e,a);switch(o){case "referenceHidden":{let l=await Aa(a,{...r,elementContext:"reference"}),u=xu(l,t.reference);return {data:{referenceHiddenOffsets:u,referenceHidden:Iu(u)}}}case "escaped":{let l=await Aa(a,{...r,altBoundary:true}),u=xu(l,t.floating);return {data:{escapedOffsets:u,escaped:Iu(u)}}}default:return {}}}}};var wu=new Set(["left","top"]);async function mi(e,a){let{placement:t,platform:o,elements:r}=e,l=await(o.isRTL==null?void 0:o.isRTL(r.floating)),u=Ne(t),s=ia(t),d=Me(t)==="y",f=wu.has(u)?-1:1,n=l&&d?-1:1,p=He(a,e),{mainAxis:c,crossAxis:L,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return s&&typeof x=="number"&&(L=s==="end"?x*-1:x),d?{x:L*n,y:c*f}:{x:c*f,y:L*n}}var Pu=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(a){var t,o;let{x:r,y:l,placement:u,middlewareData:s}=a,d=await mi(a,e);return u===((t=s.offset)==null?void 0:t.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:r+d.x,y:l+d.y,data:{...d,placement:u}}}}},vu=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(a){let{x:t,y:o,placement:r}=a,{mainAxis:l=true,crossAxis:u=false,limiter:s={fn:m=>{let{x:h,y:I}=m;return {x:h,y:I}}},...d}=He(e,a),f={x:t,y:o},n=await Aa(a,d),p=Me(Ne(r)),c=Ot(p),L=f[c],x=f[p];if(l){let m=c==="y"?"top":"left",h=c==="y"?"bottom":"right",I=L+n[m],g=L-n[h];L=Tt(I,L,g);}if(u){let m=p==="y"?"top":"left",h=p==="y"?"bottom":"right",I=x+n[m],g=x-n[h];x=Tt(I,x,g);}let i=s.fn({...a,[c]:L,[p]:x});return {...i,data:{x:i.x-t,y:i.y-o,enabled:{[c]:l,[p]:u}}}}}},yu=function(e){return e===void 0&&(e={}),{options:e,fn(a){let{x:t,y:o,placement:r,rects:l,middlewareData:u}=a,{offset:s=0,mainAxis:d=true,crossAxis:f=true}=He(e,a),n={x:t,y:o},p=Me(r),c=Ot(p),L=n[c],x=n[p],i=He(s,a),m=typeof i=="number"?{mainAxis:i,crossAxis:0}:{mainAxis:0,crossAxis:0,...i};if(d){let g=c==="y"?"height":"width",P=l.reference[c]-l.floating[g]+m.mainAxis,S=l.reference[c]+l.reference[g]-m.mainAxis;L<P?L=P:L>S&&(L=S);}if(f){var h,I;let g=c==="y"?"width":"height",P=wu.has(Ne(r)),S=l.reference[p]-l.floating[g]+(P&&((h=u.offset)==null?void 0:h[p])||0)+(P?0:m.crossAxis),R=l.reference[p]+l.reference[g]+(P?0:((I=u.offset)==null?void 0:I[p])||0)-(P?m.crossAxis:0);x<S?x=S:x>R&&(x=R);}return {[c]:L,[p]:x}}}},Ru=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(a){var t,o;let{placement:r,rects:l,platform:u,elements:s}=a,{apply:d=()=>{},...f}=He(e,a),n=await Aa(a,f),p=Ne(r),c=ia(r),L=Me(r)==="y",{width:x,height:i}=l.floating,m,h;p==="top"||p==="bottom"?(m=p,h=c===(await(u.isRTL==null?void 0:u.isRTL(s.floating))?"start":"end")?"left":"right"):(h=p,m=c==="end"?"top":"bottom");let I=i-n.top-n.bottom,g=x-n.left-n.right,P=Ue(i-n[m],I),S=Ue(x-n[h],g),R=!a.middlewareData.shift,w=P,v=S;if((t=a.middlewareData.shift)!=null&&t.enabled.x&&(v=g),(o=a.middlewareData.shift)!=null&&o.enabled.y&&(w=I),R&&!c){let E=pe(n.left,0),H=pe(n.right,0),U=pe(n.top,0),W=pe(n.bottom,0);L?v=x-2*(E!==0||H!==0?E+H:pe(n.left,n.right)):w=i-2*(U!==0||W!==0?U+W:pe(n.top,n.bottom));}await d({...a,availableWidth:v,availableHeight:w});let B=await u.getDimensions(s.floating);return x!==B.width||i!==B.height?{reset:{rects:true}}:{}}}};function Ut(){return typeof window<"u"}function ma(e){return bu(e)?(e.nodeName||"").toLowerCase():"#document"}function xe(e){var a;return (e==null||(a=e.ownerDocument)==null?void 0:a.defaultView)||window}function Be(e){var a;return (a=(bu(e)?e.ownerDocument:e.document)||window.document)==null?void 0:a.documentElement}function bu(e){return Ut()?e instanceof Node||e instanceof xe(e).Node:false}function ye(e){return Ut()?e instanceof Element||e instanceof xe(e).Element:false}function Fe(e){return Ut()?e instanceof HTMLElement||e instanceof xe(e).HTMLElement:false}function ku(e){return !Ut()||typeof ShadowRoot>"u"?false:e instanceof ShadowRoot||e instanceof xe(e).ShadowRoot}var Li=new Set(["inline","contents"]);function Da(e){let{overflow:a,overflowX:t,overflowY:o,display:r}=Re(e);return /auto|scroll|overlay|hidden|clip/.test(a+o+t)&&!Li.has(r)}var xi=new Set(["table","td","th"]);function Au(e){return xi.has(ma(e))}var Ii=[":popover-open",":modal"];function tt(e){return Ii.some(a=>{try{return e.matches(a)}catch{return false}})}var hi=["transform","translate","scale","rotate","perspective"],gi=["transform","translate","scale","rotate","perspective","filter"],Ci=["paint","layout","strict","content"];function Ht(e){let a=Nt(),t=ye(e)?Re(e):e;return hi.some(o=>t[o]?t[o]!=="none":false)||(t.containerType?t.containerType!=="normal":false)||!a&&(t.backdropFilter?t.backdropFilter!=="none":false)||!a&&(t.filter?t.filter!=="none":false)||gi.some(o=>(t.willChange||"").includes(o))||Ci.some(o=>(t.contain||"").includes(o))}function Du(e){let a=ze(e);for(;Fe(a)&&!La(a);){if(Ht(a))return a;if(tt(a))return null;a=ze(a);}return null}function Nt(){return typeof CSS>"u"||!CSS.supports?false:CSS.supports("-webkit-backdrop-filter","none")}var Si=new Set(["html","body","#document"]);function La(e){return Si.has(ma(e))}function Re(e){return xe(e).getComputedStyle(e)}function ot(e){return ye(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ze(e){if(ma(e)==="html")return e;let a=e.assignedSlot||e.parentNode||ku(e)&&e.host||Be(e);return ku(a)?a.host:a}function Mu(e){let a=ze(e);return La(a)?e.ownerDocument?e.ownerDocument.body:e.body:Fe(a)&&Da(a)?a:Mu(a)}function pa(e,a,t){var o;a===void 0&&(a=[]),t===void 0&&(t=true);let r=Mu(e),l=r===((o=e.ownerDocument)==null?void 0:o.body),u=xe(r);if(l){let s=Wt(u);return a.concat(u,u.visualViewport||[],Da(r)?r:[],s&&t?pa(s):[])}return a.concat(r,pa(r,[],t))}function Wt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ou(e){let a=Re(e),t=parseFloat(a.width)||0,o=parseFloat(a.height)||0,r=Fe(e),l=r?e.offsetWidth:t,u=r?e.offsetHeight:o,s=et(t)!==l||et(o)!==u;return s&&(t=l,o=u),{width:t,height:o,$:s}}function zo(e){return ye(e)?e:e.contextElement}function Ma(e){let a=zo(e);if(!Fe(a))return De(1);let t=a.getBoundingClientRect(),{width:o,height:r,$:l}=Ou(a),u=(l?et(t.width):t.width)/o,s=(l?et(t.height):t.height)/r;return (!u||!Number.isFinite(u))&&(u=1),(!s||!Number.isFinite(s))&&(s=1),{x:u,y:s}}var wi=De(0);function qu(e){let a=xe(e);return !Nt()||!a.visualViewport?wi:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function Pi(e,a,t){return a===void 0&&(a=false),!t||a&&t!==xe(e)?false:a}function xa(e,a,t,o){a===void 0&&(a=false),t===void 0&&(t=false);let r=e.getBoundingClientRect(),l=zo(e),u=De(1);a&&(o?ye(o)&&(u=Ma(o)):u=Ma(e));let s=Pi(l,t,o)?qu(l):De(0),d=(r.left+s.x)/u.x,f=(r.top+s.y)/u.y,n=r.width/u.x,p=r.height/u.y;if(l){let c=xe(l),L=o&&ye(o)?xe(o):o,x=c,i=Wt(x);for(;i&&o&&L!==x;){let m=Ma(i),h=i.getBoundingClientRect(),I=Re(i),g=h.left+(i.clientLeft+parseFloat(I.paddingLeft))*m.x,P=h.top+(i.clientTop+parseFloat(I.paddingTop))*m.y;d*=m.x,f*=m.y,n*=m.x,p*=m.y,d+=g,f+=P,x=xe(i),i=Wt(x);}}return ca({width:n,height:p,x:d,y:f})}function Gt(e,a){let t=ot(e).scrollLeft;return a?a.left+t:xa(Be(e)).left+t}function Eu(e,a){let t=e.getBoundingClientRect(),o=t.left+a.scrollLeft-Gt(e,t),r=t.top+a.scrollTop;return {x:o,y:r}}function vi(e){let{elements:a,rect:t,offsetParent:o,strategy:r}=e,l=r==="fixed",u=Be(o),s=a?tt(a.floating):false;if(o===u||s&&l)return t;let d={scrollLeft:0,scrollTop:0},f=De(1),n=De(0),p=Fe(o);if((p||!p&&!l)&&((ma(o)!=="body"||Da(u))&&(d=ot(o)),Fe(o))){let L=xa(o);f=Ma(o),n.x=L.x+o.clientLeft,n.y=L.y+o.clientTop;}let c=u&&!p&&!l?Eu(u,d):De(0);return {width:t.width*f.x,height:t.height*f.y,x:t.x*f.x-d.scrollLeft*f.x+n.x+c.x,y:t.y*f.y-d.scrollTop*f.y+n.y+c.y}}function yi(e){return Array.from(e.getClientRects())}function Ri(e){let a=Be(e),t=ot(e),o=e.ownerDocument.body,r=pe(a.scrollWidth,a.clientWidth,o.scrollWidth,o.clientWidth),l=pe(a.scrollHeight,a.clientHeight,o.scrollHeight,o.clientHeight),u=-t.scrollLeft+Gt(e),s=-t.scrollTop;return Re(o).direction==="rtl"&&(u+=pe(a.clientWidth,o.clientWidth)-r),{width:r,height:l,x:u,y:s}}var Bu=25;function ki(e,a){let t=xe(e),o=Be(e),r=t.visualViewport,l=o.clientWidth,u=o.clientHeight,s=0,d=0;if(r){l=r.width,u=r.height;let n=Nt();(!n||n&&a==="fixed")&&(s=r.offsetLeft,d=r.offsetTop);}let f=Gt(o);if(f<=0){let n=o.ownerDocument,p=n.body,c=getComputedStyle(p),L=n.compatMode==="CSS1Compat"&&parseFloat(c.marginLeft)+parseFloat(c.marginRight)||0,x=Math.abs(o.clientWidth-p.clientWidth-L);x<=Bu&&(l-=x);}else f<=Bu&&(l+=f);return {width:l,height:u,x:s,y:d}}var bi=new Set(["absolute","fixed"]);function Ai(e,a){let t=xa(e,true,a==="fixed"),o=t.top+e.clientTop,r=t.left+e.clientLeft,l=Fe(e)?Ma(e):De(1),u=e.clientWidth*l.x,s=e.clientHeight*l.y,d=r*l.x,f=o*l.y;return {width:u,height:s,x:d,y:f}}function Fu(e,a,t){let o;if(a==="viewport")o=ki(e,t);else if(a==="document")o=Ri(Be(e));else if(ye(a))o=Ai(a,t);else {let r=qu(e);o={x:a.x-r.x,y:a.y-r.y,width:a.width,height:a.height};}return ca(o)}function Uu(e,a){let t=ze(e);return t===a||!ye(t)||La(t)?false:Re(t).position==="fixed"||Uu(t,a)}function Di(e,a){let t=a.get(e);if(t)return t;let o=pa(e,[],false).filter(s=>ye(s)&&ma(s)!=="body"),r=null,l=Re(e).position==="fixed",u=l?ze(e):e;for(;ye(u)&&!La(u);){let s=Re(u),d=Ht(u);!d&&s.position==="fixed"&&(r=null),(l?!d&&!r:!d&&s.position==="static"&&!!r&&bi.has(r.position)||Da(u)&&!d&&Uu(e,u))?o=o.filter(n=>n!==u):r=s,u=ze(u);}return a.set(e,o),o}function Mi(e){let{element:a,boundary:t,rootBoundary:o,strategy:r}=e,u=[...t==="clippingAncestors"?tt(a)?[]:Di(a,this._c):[].concat(t),o],s=u[0],d=u.reduce((f,n)=>{let p=Fu(a,n,r);return f.top=pe(p.top,f.top),f.right=Ue(p.right,f.right),f.bottom=Ue(p.bottom,f.bottom),f.left=pe(p.left,f.left),f},Fu(a,s,r));return {width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Bi(e){let{width:a,height:t}=Ou(e);return {width:a,height:t}}function Fi(e,a,t){let o=Fe(a),r=Be(a),l=t==="fixed",u=xa(e,true,l,a),s={scrollLeft:0,scrollTop:0},d=De(0);function f(){d.x=Gt(r);}if(o||!o&&!l)if((ma(a)!=="body"||Da(r))&&(s=ot(a)),o){let L=xa(a,true,l,a);d.x=L.x+a.clientLeft,d.y=L.y+a.clientTop;}else r&&f();l&&!o&&r&&f();let n=r&&!o&&!l?Eu(r,s):De(0),p=u.left+s.scrollLeft-d.x-n.x,c=u.top+s.scrollTop-d.y-n.y;return {x:p,y:c,width:u.width,height:u.height}}function Vo(e){return Re(e).position==="static"}function Tu(e,a){if(!Fe(e)||Re(e).position==="fixed")return null;if(a)return a(e);let t=e.offsetParent;return Be(e)===t&&(t=t.ownerDocument.body),t}function Hu(e,a){let t=xe(e);if(tt(e))return t;if(!Fe(e)){let r=ze(e);for(;r&&!La(r);){if(ye(r)&&!Vo(r))return r;r=ze(r);}return t}let o=Tu(e,a);for(;o&&Au(o)&&Vo(o);)o=Tu(o,a);return o&&La(o)&&Vo(o)&&!Ht(o)?t:o||Du(e)||t}var Ti=async function(e){let a=this.getOffsetParent||Hu,t=this.getDimensions,o=await t(e.floating);return {reference:Fi(e.reference,await a(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Oi(e){return Re(e).direction==="rtl"}var Nu={convertOffsetParentRelativeRectToViewportRelativeRect:vi,getDocumentElement:Be,getClippingRect:Mi,getOffsetParent:Hu,getElementRects:Ti,getClientRects:yi,getDimensions:Bi,getScale:Ma,isElement:ye,isRTL:Oi};function Wu(e,a){return e.x===a.x&&e.y===a.y&&e.width===a.width&&e.height===a.height}function qi(e,a){let t=null,o,r=Be(e);function l(){var s;clearTimeout(o),(s=t)==null||s.disconnect(),t=null;}function u(s,d){s===void 0&&(s=false),d===void 0&&(d=1),l();let f=e.getBoundingClientRect(),{left:n,top:p,width:c,height:L}=f;if(s||a(),!c||!L)return;let x=at(p),i=at(r.clientWidth-(n+c)),m=at(r.clientHeight-(p+L)),h=at(n),g={rootMargin:-x+"px "+-i+"px "+-m+"px "+-h+"px",threshold:pe(0,Ue(1,d))||1},P=true;function S(R){let w=R[0].intersectionRatio;if(w!==d){if(!P)return u();w?u(false,w):o=setTimeout(()=>{u(false,1e-7);},1e3);}w===1&&!Wu(f,e.getBoundingClientRect())&&u(),P=false;}try{t=new IntersectionObserver(S,{...g,root:r.ownerDocument});}catch{t=new IntersectionObserver(S,g);}t.observe(e);}return u(true),l}function _o(e,a,t,o){o===void 0&&(o={});let{ancestorScroll:r=true,ancestorResize:l=true,elementResize:u=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:d=false}=o,f=zo(e),n=r||l?[...f?pa(f):[],...pa(a)]:[];n.forEach(h=>{r&&h.addEventListener("scroll",t,{passive:true}),l&&h.addEventListener("resize",t);});let p=f&&s?qi(f,t):null,c=-1,L=null;u&&(L=new ResizeObserver(h=>{let[I]=h;I&&I.target===f&&L&&(L.unobserve(a),cancelAnimationFrame(c),c=requestAnimationFrame(()=>{var g;(g=L)==null||g.observe(a);})),t();}),f&&!d&&L.observe(f),L.observe(a));let x,i=d?xa(e):null;d&&m();function m(){let h=xa(e);i&&!Wu(i,h)&&t(),i=h,x=requestAnimationFrame(m);}return t(),()=>{var h;n.forEach(I=>{r&&I.removeEventListener("scroll",t),l&&I.removeEventListener("resize",t);}),p?.(),(h=L)==null||h.disconnect(),L=null,d&&cancelAnimationFrame(x);}}var Gu=Pu;var Vu=vu,zu=Cu,_u=Ru,Xu=Su,Xo=gu;var Ku=yu,Ko=(e,a,t)=>{let o=new Map,r={platform:Nu,...t},l={...r.platform,_c:o};return hu(e,a,{...r,platform:l})};var Ui=typeof document<"u",Hi=function(){},Vt=Ui?y.useLayoutEffect:Hi;function zt(e,a){if(e===a)return true;if(typeof e!=typeof a)return false;if(typeof e=="function"&&e.toString()===a.toString())return true;let t,o,r;if(e&&a&&typeof e=="object"){if(Array.isArray(e)){if(t=e.length,t!==a.length)return false;for(o=t;o--!==0;)if(!zt(e[o],a[o]))return false;return true}if(r=Object.keys(e),t=r.length,t!==Object.keys(a).length)return false;for(o=t;o--!==0;)if(!{}.hasOwnProperty.call(a,r[o]))return false;for(o=t;o--!==0;){let l=r[o];if(!(l==="_owner"&&e.$$typeof)&&!zt(e[l],a[l]))return false}return true}return e!==e&&a!==a}function $u(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ju(e,a){let t=$u(e);return Math.round(a*t)/t}function jo(e){let a=y__namespace.useRef(e);return Vt(()=>{a.current=e;}),a}function Qu(e){e===void 0&&(e={});let{placement:a="bottom",strategy:t="absolute",middleware:o=[],platform:r,elements:{reference:l,floating:u}={},transform:s=true,whileElementsMounted:d,open:f}=e,[n,p]=y__namespace.useState({x:0,y:0,strategy:t,placement:a,middlewareData:{},isPositioned:false}),[c,L]=y__namespace.useState(o);zt(c,o)||L(o);let[x,i]=y__namespace.useState(null),[m,h]=y__namespace.useState(null),I=y__namespace.useCallback(C=>{C!==R.current&&(R.current=C,i(C));},[]),g=y__namespace.useCallback(C=>{C!==w.current&&(w.current=C,h(C));},[]),P=l||x,S=u||m,R=y__namespace.useRef(null),w=y__namespace.useRef(null),v=y__namespace.useRef(n),B=d!=null,E=jo(d),H=jo(r),U=jo(f),W=y__namespace.useCallback(()=>{if(!R.current||!w.current)return;let C={placement:a,strategy:t,middleware:c};H.current&&(C.platform=H.current),Ko(R.current,w.current,C).then(z=>{let fe={...z,isPositioned:U.current!==false};D.current&&!zt(v.current,fe)&&(v.current=fe,rr__namespace.flushSync(()=>{p(fe);}));});},[c,a,t,H,U]);Vt(()=>{f===false&&v.current.isPositioned&&(v.current.isPositioned=false,p(C=>({...C,isPositioned:false})));},[f]);let D=y__namespace.useRef(false);Vt(()=>(D.current=true,()=>{D.current=false;}),[]),Vt(()=>{if(P&&(R.current=P),S&&(w.current=S),P&&S){if(E.current)return E.current(P,S,W);W();}},[P,S,W,E,B]);let G=y__namespace.useMemo(()=>({reference:R,floating:w,setReference:I,setFloating:g}),[I,g]),M=y__namespace.useMemo(()=>({reference:P,floating:S}),[P,S]),O=y__namespace.useMemo(()=>{let C={position:t,left:0,top:0};if(!M.floating)return C;let z=ju(M.floating,n.x),fe=ju(M.floating,n.y);return s?{...C,transform:"translate("+z+"px, "+fe+"px)",...$u(M.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:z,top:fe}},[t,s,M.floating,n.x,n.y]);return y__namespace.useMemo(()=>({...n,update:W,refs:G,elements:M,floatingStyles:O}),[n,W,G,M,O])}var Ni=e=>{function a(t){return {}.hasOwnProperty.call(t,"current")}return {name:"arrow",options:e,fn(t){let{element:o,padding:r}=typeof e=="function"?e(t):e;return o&&a(o)?o.current!=null?Xo({element:o.current,padding:r}).fn(t):{}:o?Xo({element:o,padding:r}).fn(t):{}}}},Ju=(e,a)=>({...Gu(e),options:[e,a]}),Yu=(e,a)=>({...Vu(e),options:[e,a]}),es=(e,a)=>({...Ku(e),options:[e,a]}),as=(e,a)=>({...zu(e),options:[e,a]}),ts=(e,a)=>({..._u(e),options:[e,a]});var os=(e,a)=>({...Xu(e),options:[e,a]});var rs=(e,a)=>({...Ni(e),options:[e,a]});var Wi="Arrow",ss=y__namespace.forwardRef((e,a)=>{let{children:t,width:o=10,height:r=5,...l}=e;return jsxRuntime.jsx(N.svg,{...l,ref:a,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?t:jsxRuntime.jsx("polygon",{points:"0,0 30,0 15,10"})})});ss.displayName=Wi;var ds=ss;function ns(e){let[a,t]=y__namespace.useState(void 0);return Y(()=>{if(e){t({width:e.offsetWidth,height:e.offsetHeight});let o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let l=r[0],u,s;if("borderBoxSize"in l){let d=l.borderBoxSize,f=Array.isArray(d)?d[0]:d;u=f.inlineSize,s=f.blockSize;}else u=e.offsetWidth,s=e.offsetHeight;t({width:u,height:s});});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else t(void 0);},[e]),a}var Zo="Popper",[is,$o]=$e(Zo),[Vi,cs]=is(Zo),ps=e=>{let{__scopePopper:a,children:t}=e,[o,r]=y__namespace.useState(null);return jsxRuntime.jsx(Vi,{scope:a,anchor:o,onAnchorChange:r,children:t})};ps.displayName=Zo;var ms="PopperAnchor",Ls=y__namespace.forwardRef((e,a)=>{let{__scopePopper:t,virtualRef:o,...r}=e,l=cs(ms,t),u=y__namespace.useRef(null),s=X(a,u),d=y__namespace.useRef(null);return y__namespace.useEffect(()=>{let f=d.current;d.current=o?.current||u.current,f!==d.current&&l.onAnchorChange(d.current);}),o?null:jsxRuntime.jsx(N.div,{...r,ref:s})});Ls.displayName=ms;var Qo="PopperContent",[zi,_i]=is(Qo),xs=y__namespace.forwardRef((e,a)=>{let{__scopePopper:t,side:o="bottom",sideOffset:r=0,align:l="center",alignOffset:u=0,arrowPadding:s=0,avoidCollisions:d=true,collisionBoundary:f=[],collisionPadding:n=0,sticky:p="partial",hideWhenDetached:c=false,updatePositionStrategy:L="optimized",onPlaced:x,...i}=e,m=cs(Qo,t),[h,I]=y__namespace.useState(null),g=X(a,k=>I(k)),[P,S]=y__namespace.useState(null),R=ns(P),w=R?.width??0,v=R?.height??0,B=o+(l!=="center"?"-"+l:""),E=typeof n=="number"?n:{top:0,right:0,bottom:0,left:0,...n},H=Array.isArray(f)?f:[f],U=H.length>0,W={padding:E,boundary:H.filter(Ki),altBoundary:U},{refs:D,floatingStyles:G,placement:M,isPositioned:O,middlewareData:C}=Qu({strategy:"fixed",placement:B,whileElementsMounted:(...k)=>_o(...k,{animationFrame:L==="always"}),elements:{reference:m.anchor},middleware:[Ju({mainAxis:r+v,alignmentAxis:u}),d&&Yu({mainAxis:true,crossAxis:false,limiter:p==="partial"?es():void 0,...W}),d&&as({...W}),ts({...W,apply:({elements:k,rects:Z,availableWidth:re,availableHeight:V})=>{let{width:_,height:$}=Z.reference,Ce=k.floating.style;Ce.setProperty("--radix-popper-available-width",`${re}px`),Ce.setProperty("--radix-popper-available-height",`${V}px`),Ce.setProperty("--radix-popper-anchor-width",`${_}px`),Ce.setProperty("--radix-popper-anchor-height",`${$}px`);}}),P&&rs({element:P,padding:s}),ji({arrowWidth:w,arrowHeight:v}),c&&os({strategy:"referenceHidden",...W})]}),[z,fe]=gs(M),qe=we(x);Y(()=>{O&&qe?.();},[O,qe]);let We=C.arrow?.x,te=C.arrow?.y,ae=C.arrow?.centerOffset!==0,[be,Ee]=y__namespace.useState();return Y(()=>{h&&Ee(window.getComputedStyle(h).zIndex);},[h]),jsxRuntime.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:O?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[C.transformOrigin?.x,C.transformOrigin?.y].join(" "),...C.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:jsxRuntime.jsx(zi,{scope:t,placedSide:z,onArrowChange:S,arrowX:We,arrowY:te,shouldHideArrow:ae,children:jsxRuntime.jsx(N.div,{"data-side":z,"data-align":fe,...i,ref:g,style:{...i.style,animation:O?void 0:"none"}})})})});xs.displayName=Qo;var Is="PopperArrow",Xi={top:"bottom",right:"left",bottom:"top",left:"right"},hs=y__namespace.forwardRef(function(a,t){let{__scopePopper:o,...r}=a,l=_i(Is,o),u=Xi[l.placedSide];return jsxRuntime.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:jsxRuntime.jsx(ds,{...r,ref:t,style:{...r.style,display:"block"}})})});hs.displayName=Is;function Ki(e){return e!==null}var ji=e=>({name:"transformOrigin",options:e,fn(a){let{placement:t,rects:o,middlewareData:r}=a,u=r.arrow?.centerOffset!==0,s=u?0:e.arrowWidth,d=u?0:e.arrowHeight,[f,n]=gs(t),p={start:"0%",center:"50%",end:"100%"}[n],c=(r.arrow?.x??0)+s/2,L=(r.arrow?.y??0)+d/2,x="",i="";return f==="bottom"?(x=u?p:`${c}px`,i=`${-d}px`):f==="top"?(x=u?p:`${c}px`,i=`${o.floating.height+d}px`):f==="right"?(x=`${-d}px`,i=u?p:`${L}px`):f==="left"&&(x=`${o.floating.width+d}px`,i=u?p:`${L}px`),{data:{x,y:i}}}});function gs(e){let[a,t="center"]=e.split("-");return [a,t]}var Cs=ps,Ss=Ls,ws=xs,Ps=hs;function vs(e){let a=y__namespace.useRef({value:e,previous:e});return y__namespace.useMemo(()=>(a.current.value!==e&&(a.current.previous=a.current.value,a.current.value=e),a.current.previous),[e])}var Jo=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"}),Qi="VisuallyHidden",Ji=y__namespace.forwardRef((e,a)=>jsxRuntime.jsx(N.span,{...e,ref:a,style:{...Jo,...e.style}}));Ji.displayName=Qi;var Yi=[" ","Enter","ArrowUp","ArrowDown"],ec=[" ","Enter"],ha="Select",[jt,Zt,ac]=du(ha),[Ba]=$e(ha,[ac,$o]),$t=$o(),[tc,aa]=Ba(ha),[oc,rc]=Ba(ha),Rs=e=>{let{__scopeSelect:a,children:t,open:o,defaultOpen:r,onOpenChange:l,value:u,defaultValue:s,onValueChange:d,dir:f,name:n,autoComplete:p,disabled:c,required:L,form:x}=e,i=$t(a),[m,h]=y__namespace.useState(null),[I,g]=y__namespace.useState(null),[P,S]=y__namespace.useState(false),R=Yr(f),[w,v]=Wa({prop:o,defaultProp:r??false,onChange:l,caller:ha}),[B,E]=Wa({prop:u,defaultProp:s,onChange:d,caller:ha}),H=y__namespace.useRef(null),U=m?x||!!m.closest("form"):true,[W,D]=y__namespace.useState(new Set),G=Array.from(W).map(M=>M.props.value).join(";");return jsxRuntime.jsx(Cs,{...i,children:jsxRuntime.jsxs(tc,{required:L,scope:a,trigger:m,onTriggerChange:h,valueNode:I,onValueNodeChange:g,valueNodeHasChildren:P,onValueNodeHasChildrenChange:S,contentId:Qe(),value:B,onValueChange:E,open:w,onOpenChange:v,dir:R,triggerPointerDownPosRef:H,disabled:c,children:[jsxRuntime.jsx(jt.Provider,{scope:a,children:jsxRuntime.jsx(oc,{scope:e.__scopeSelect,onNativeOptionAdd:y__namespace.useCallback(M=>{D(O=>new Set(O).add(M));},[]),onNativeOptionRemove:y__namespace.useCallback(M=>{D(O=>{let C=new Set(O);return C.delete(M),C});},[]),children:t})}),U?jsxRuntime.jsxs($s,{"aria-hidden":true,required:L,tabIndex:-1,name:n,autoComplete:p,value:B,onChange:M=>E(M.target.value),disabled:c,form:x,children:[B===void 0?jsxRuntime.jsx("option",{value:""}):null,Array.from(W)]},G):null]})})};Rs.displayName=ha;var ks="SelectTrigger",bs=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,disabled:o=false,...r}=e,l=$t(t),u=aa(ks,t),s=u.disabled||o,d=X(a,u.onTriggerChange),f=Zt(t),n=y__namespace.useRef("touch"),[p,c,L]=Js(i=>{let m=f().filter(g=>!g.disabled),h=m.find(g=>g.value===u.value),I=Ys(m,i,h);I!==void 0&&u.onValueChange(I.value);}),x=i=>{s||(u.onOpenChange(true),L()),i&&(u.triggerPointerDownPosRef.current={x:Math.round(i.pageX),y:Math.round(i.pageY)});};return jsxRuntime.jsx(Ss,{asChild:true,...l,children:jsxRuntime.jsx(N.button,{type:"button",role:"combobox","aria-controls":u.contentId,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":Qs(u.value)?"":void 0,...r,ref:d,onClick:K(r.onClick,i=>{i.currentTarget.focus(),n.current!=="mouse"&&x(i);}),onPointerDown:K(r.onPointerDown,i=>{n.current=i.pointerType;let m=i.target;m.hasPointerCapture(i.pointerId)&&m.releasePointerCapture(i.pointerId),i.button===0&&i.ctrlKey===false&&i.pointerType==="mouse"&&(x(i),i.preventDefault());}),onKeyDown:K(r.onKeyDown,i=>{let m=p.current!=="";!(i.ctrlKey||i.altKey||i.metaKey)&&i.key.length===1&&c(i.key),!(m&&i.key===" ")&&Yi.includes(i.key)&&(x(),i.preventDefault());})})})});bs.displayName=ks;var As="SelectValue",Ds=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,className:o,style:r,children:l,placeholder:u="",...s}=e,d=aa(As,t),{onValueNodeHasChildrenChange:f}=d,n=l!==void 0,p=X(a,d.onValueNodeChange);return Y(()=>{f(n);},[f,n]),jsxRuntime.jsx(N.span,{...s,ref:p,style:{pointerEvents:"none"},children:Qs(d.value)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:u}):l})});Ds.displayName=As;var lc="SelectIcon",Ms=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,children:o,...r}=e;return jsxRuntime.jsx(N.span,{"aria-hidden":true,...r,ref:a,children:o||"\u25BC"})});Ms.displayName=lc;var uc="SelectPortal",Bs=e=>jsxRuntime.jsx(za,{asChild:true,...e});Bs.displayName=uc;var ga="SelectContent",Fs=y__namespace.forwardRef((e,a)=>{let t=aa(ga,e.__scopeSelect),[o,r]=y__namespace.useState();if(Y(()=>{r(new DocumentFragment);},[]),!t.open){let l=o;return l?rr__namespace.createPortal(jsxRuntime.jsx(Ts,{scope:e.__scopeSelect,children:jsxRuntime.jsx(jt.Slot,{scope:e.__scopeSelect,children:jsxRuntime.jsx("div",{children:e.children})})}),l):null}return jsxRuntime.jsx(Os,{...e,ref:a})});Fs.displayName=ga;var Te=10,[Ts,ta]=Ba(ga),sc="SelectContentImpl",dc=Ve("SelectContent.RemoveScroll"),Os=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:l,onPointerDownOutside:u,side:s,sideOffset:d,align:f,alignOffset:n,arrowPadding:p,collisionBoundary:c,collisionPadding:L,sticky:x,hideWhenDetached:i,avoidCollisions:m,...h}=e,I=aa(ga,t),[g,P]=y__namespace.useState(null),[S,R]=y__namespace.useState(null),w=X(a,k=>P(k)),[v,B]=y__namespace.useState(null),[E,H]=y__namespace.useState(null),U=Zt(t),[W,D]=y__namespace.useState(false),G=y__namespace.useRef(false);y__namespace.useEffect(()=>{if(g)return At(g)},[g]),Ct();let M=y__namespace.useCallback(k=>{let[Z,...re]=U().map($=>$.ref.current),[V]=re.slice(-1),_=document.activeElement;for(let $ of k)if($===_||($?.scrollIntoView({block:"nearest"}),$===Z&&S&&(S.scrollTop=0),$===V&&S&&(S.scrollTop=S.scrollHeight),$?.focus(),document.activeElement!==_))return},[U,S]),O=y__namespace.useCallback(()=>M([v,g]),[M,v,g]);y__namespace.useEffect(()=>{W&&O();},[W,O]);let{onOpenChange:C,triggerPointerDownPosRef:z}=I;y__namespace.useEffect(()=>{if(g){let k={x:0,y:0},Z=V=>{k={x:Math.abs(Math.round(V.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(V.pageY)-(z.current?.y??0))};},re=V=>{k.x<=10&&k.y<=10?V.preventDefault():g.contains(V.target)||C(false),document.removeEventListener("pointermove",Z),z.current=null;};return z.current!==null&&(document.addEventListener("pointermove",Z),document.addEventListener("pointerup",re,{capture:true,once:true})),()=>{document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",re,{capture:true});}}},[g,C,z]),y__namespace.useEffect(()=>{let k=()=>C(false);return window.addEventListener("blur",k),window.addEventListener("resize",k),()=>{window.removeEventListener("blur",k),window.removeEventListener("resize",k);}},[C]);let[fe,qe]=Js(k=>{let Z=U().filter(_=>!_.disabled),re=Z.find(_=>_.ref.current===document.activeElement),V=Ys(Z,k,re);V&&setTimeout(()=>V.ref.current.focus());}),We=y__namespace.useCallback((k,Z,re)=>{let V=!G.current&&!re;(I.value!==void 0&&I.value===Z||V)&&(B(k),V&&(G.current=true));},[I.value]),te=y__namespace.useCallback(()=>g?.focus(),[g]),ae=y__namespace.useCallback((k,Z,re)=>{let V=!G.current&&!re;(I.value!==void 0&&I.value===Z||V)&&H(k);},[I.value]),be=o==="popper"?Yo:qs,Ee=be===Yo?{side:s,sideOffset:d,align:f,alignOffset:n,arrowPadding:p,collisionBoundary:c,collisionPadding:L,sticky:x,hideWhenDetached:i,avoidCollisions:m}:{};return jsxRuntime.jsx(Ts,{scope:t,content:g,viewport:S,onViewportChange:R,itemRefCallback:We,selectedItem:v,onItemLeave:te,itemTextRefCallback:ae,focusSelectedItem:O,selectedItemText:E,position:o,isPositioned:W,searchRef:fe,children:jsxRuntime.jsx(ja,{as:dc,allowPinchZoom:true,children:jsxRuntime.jsx(Va,{asChild:true,trapped:I.open,onMountAutoFocus:k=>{k.preventDefault();},onUnmountAutoFocus:K(r,k=>{I.trigger?.focus({preventScroll:true}),k.preventDefault();}),children:jsxRuntime.jsx(Ga,{asChild:true,disableOutsidePointerEvents:true,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:k=>k.preventDefault(),onDismiss:()=>I.onOpenChange(false),children:jsxRuntime.jsx(be,{role:"listbox",id:I.contentId,"data-state":I.open?"open":"closed",dir:I.dir,onContextMenu:k=>k.preventDefault(),...h,...Ee,onPlaced:()=>D(true),ref:w,style:{display:"flex",flexDirection:"column",outline:"none",...h.style},onKeyDown:K(h.onKeyDown,k=>{let Z=k.ctrlKey||k.altKey||k.metaKey;if(k.key==="Tab"&&k.preventDefault(),!Z&&k.key.length===1&&qe(k.key),["ArrowUp","ArrowDown","Home","End"].includes(k.key)){let V=U().filter(_=>!_.disabled).map(_=>_.ref.current);if(["ArrowUp","End"].includes(k.key)&&(V=V.slice().reverse()),["ArrowUp","ArrowDown"].includes(k.key)){let _=k.target,$=V.indexOf(_);V=V.slice($+1);}setTimeout(()=>M(V)),k.preventDefault();}})})})})})})});Os.displayName=sc;var fc="SelectItemAlignedPosition",qs=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,onPlaced:o,...r}=e,l=aa(ga,t),u=ta(ga,t),[s,d]=y__namespace.useState(null),[f,n]=y__namespace.useState(null),p=X(a,w=>n(w)),c=Zt(t),L=y__namespace.useRef(false),x=y__namespace.useRef(true),{viewport:i,selectedItem:m,selectedItemText:h,focusSelectedItem:I}=u,g=y__namespace.useCallback(()=>{if(l.trigger&&l.valueNode&&s&&f&&i&&m&&h){let w=l.trigger.getBoundingClientRect(),v=f.getBoundingClientRect(),B=l.valueNode.getBoundingClientRect(),E=h.getBoundingClientRect();if(l.dir!=="rtl"){let _=E.left-v.left,$=B.left-_,Ce=w.left-$,ra=w.width+Ce,ao=Math.max(ra,v.width),to=window.innerWidth-Te,oo=io($,[Te,Math.max(Te,to-ao)]);s.style.minWidth=ra+"px",s.style.left=oo+"px";}else {let _=v.right-E.right,$=window.innerWidth-B.right-_,Ce=window.innerWidth-w.right-$,ra=w.width+Ce,ao=Math.max(ra,v.width),to=window.innerWidth-Te,oo=io($,[Te,Math.max(Te,to-ao)]);s.style.minWidth=ra+"px",s.style.right=oo+"px";}let H=c(),U=window.innerHeight-Te*2,W=i.scrollHeight,D=window.getComputedStyle(f),G=parseInt(D.borderTopWidth,10),M=parseInt(D.paddingTop,10),O=parseInt(D.borderBottomWidth,10),C=parseInt(D.paddingBottom,10),z=G+M+W+C+O,fe=Math.min(m.offsetHeight*5,z),qe=window.getComputedStyle(i),We=parseInt(qe.paddingTop,10),te=parseInt(qe.paddingBottom,10),ae=w.top+w.height/2-Te,be=U-ae,Ee=m.offsetHeight/2,k=m.offsetTop+Ee,Z=G+M+k,re=z-Z;if(Z<=ae){let _=H.length>0&&m===H[H.length-1].ref.current;s.style.bottom="0px";let $=f.clientHeight-i.offsetTop-i.offsetHeight,Ce=Math.max(be,Ee+(_?te:0)+$+O),ra=Z+Ce;s.style.height=ra+"px";}else {let _=H.length>0&&m===H[0].ref.current;s.style.top="0px";let Ce=Math.max(ae,G+i.offsetTop+(_?We:0)+Ee)+re;s.style.height=Ce+"px",i.scrollTop=Z-ae+i.offsetTop;}s.style.margin=`${Te}px 0`,s.style.minHeight=fe+"px",s.style.maxHeight=U+"px",o?.(),requestAnimationFrame(()=>L.current=true);}},[c,l.trigger,l.valueNode,s,f,i,m,h,l.dir,o]);Y(()=>g(),[g]);let[P,S]=y__namespace.useState();Y(()=>{f&&S(window.getComputedStyle(f).zIndex);},[f]);let R=y__namespace.useCallback(w=>{w&&x.current===true&&(g(),I?.(),x.current=false);},[g,I]);return jsxRuntime.jsx(ic,{scope:t,contentWrapper:s,shouldExpandOnScrollRef:L,onScrollButtonChange:R,children:jsxRuntime.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:jsxRuntime.jsx(N.div,{...r,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});qs.displayName=fc;var nc="SelectPopperPosition",Yo=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,align:o="start",collisionPadding:r=Te,...l}=e,u=$t(t);return jsxRuntime.jsx(ws,{...u,...l,ref:a,align:o,collisionPadding:r,style:{boxSizing:"border-box",...l.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)"}})});Yo.displayName=nc;var[ic,ur]=Ba(ga,{}),er="SelectViewport",Es=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,nonce:o,...r}=e,l=ta(er,t),u=ur(er,t),s=X(a,l.onViewportChange),d=y__namespace.useRef(0);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),jsxRuntime.jsx(jt.Slot,{scope:t,children:jsxRuntime.jsx(N.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:K(r.onScroll,f=>{let n=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:c}=u;if(c?.current&&p){let L=Math.abs(d.current-n.scrollTop);if(L>0){let x=window.innerHeight-Te*2,i=parseFloat(p.style.minHeight),m=parseFloat(p.style.height),h=Math.max(i,m);if(h<x){let I=h+L,g=Math.min(x,I),P=I-g;p.style.height=g+"px",p.style.bottom==="0px"&&(n.scrollTop=P>0?P:0,p.style.justifyContent="flex-end");}}}d.current=n.scrollTop;})})})]})});Es.displayName=er;var Us="SelectGroup",[cc,pc]=Ba(Us),mc=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,...o}=e,r=Qe();return jsxRuntime.jsx(cc,{scope:t,id:r,children:jsxRuntime.jsx(N.div,{role:"group","aria-labelledby":r,...o,ref:a})})});mc.displayName=Us;var Hs="SelectLabel",Ns=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,...o}=e,r=pc(Hs,t);return jsxRuntime.jsx(N.div,{id:r.id,...o,ref:a})});Ns.displayName=Hs;var Kt="SelectItem",[Lc,Ws]=Ba(Kt),Gs=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,value:o,disabled:r=false,textValue:l,...u}=e,s=aa(Kt,t),d=ta(Kt,t),f=s.value===o,[n,p]=y__namespace.useState(l??""),[c,L]=y__namespace.useState(false),x=X(a,I=>d.itemRefCallback?.(I,o,r)),i=Qe(),m=y__namespace.useRef("touch"),h=()=>{r||(s.onValueChange(o),s.onOpenChange(false));};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return jsxRuntime.jsx(Lc,{scope:t,value:o,disabled:r,textId:i,isSelected:f,onItemTextChange:y__namespace.useCallback(I=>{p(g=>g||(I?.textContent??"").trim());},[]),children:jsxRuntime.jsx(jt.ItemSlot,{scope:t,value:o,disabled:r,textValue:n,children:jsxRuntime.jsx(N.div,{role:"option","aria-labelledby":i,"data-highlighted":c?"":void 0,"aria-selected":f&&c,"data-state":f?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...u,ref:x,onFocus:K(u.onFocus,()=>L(true)),onBlur:K(u.onBlur,()=>L(false)),onClick:K(u.onClick,()=>{m.current!=="mouse"&&h();}),onPointerUp:K(u.onPointerUp,()=>{m.current==="mouse"&&h();}),onPointerDown:K(u.onPointerDown,I=>{m.current=I.pointerType;}),onPointerMove:K(u.onPointerMove,I=>{m.current=I.pointerType,r?d.onItemLeave?.():m.current==="mouse"&&I.currentTarget.focus({preventScroll:true});}),onPointerLeave:K(u.onPointerLeave,I=>{I.currentTarget===document.activeElement&&d.onItemLeave?.();}),onKeyDown:K(u.onKeyDown,I=>{d.searchRef?.current!==""&&I.key===" "||(ec.includes(I.key)&&h(),I.key===" "&&I.preventDefault());})})})})});Gs.displayName=Kt;var rt="SelectItemText",Vs=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,className:o,style:r,...l}=e,u=aa(rt,t),s=ta(rt,t),d=Ws(rt,t),f=rc(rt,t),[n,p]=y__namespace.useState(null),c=X(a,h=>p(h),d.onItemTextChange,h=>s.itemTextRefCallback?.(h,d.value,d.disabled)),L=n?.textContent,x=y__namespace.useMemo(()=>jsxRuntime.jsx("option",{value:d.value,disabled:d.disabled,children:L},d.value),[d.disabled,d.value,L]),{onNativeOptionAdd:i,onNativeOptionRemove:m}=f;return Y(()=>(i(x),()=>m(x)),[i,m,x]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(N.span,{id:d.textId,...l,ref:c}),d.isSelected&&u.valueNode&&!u.valueNodeHasChildren?rr__namespace.createPortal(l.children,u.valueNode):null]})});Vs.displayName=rt;var zs="SelectItemIndicator",_s=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,...o}=e;return Ws(zs,t).isSelected?jsxRuntime.jsx(N.span,{"aria-hidden":true,...o,ref:a}):null});_s.displayName=zs;var ar="SelectScrollUpButton",Xs=y__namespace.forwardRef((e,a)=>{let t=ta(ar,e.__scopeSelect),o=ur(ar,e.__scopeSelect),[r,l]=y__namespace.useState(false),u=X(a,o.onScrollButtonChange);return Y(()=>{if(t.viewport&&t.isPositioned){let d=function(){let n=f.scrollTop>0;l(n);};let f=t.viewport;return d(),f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[t.viewport,t.isPositioned]),r?jsxRuntime.jsx(js,{...e,ref:u,onAutoScroll:()=>{let{viewport:s,selectedItem:d}=t;s&&d&&(s.scrollTop=s.scrollTop-d.offsetHeight);}}):null});Xs.displayName=ar;var tr="SelectScrollDownButton",Ks=y__namespace.forwardRef((e,a)=>{let t=ta(tr,e.__scopeSelect),o=ur(tr,e.__scopeSelect),[r,l]=y__namespace.useState(false),u=X(a,o.onScrollButtonChange);return Y(()=>{if(t.viewport&&t.isPositioned){let d=function(){let n=f.scrollHeight-f.clientHeight,p=Math.ceil(f.scrollTop)<n;l(p);};let f=t.viewport;return d(),f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[t.viewport,t.isPositioned]),r?jsxRuntime.jsx(js,{...e,ref:u,onAutoScroll:()=>{let{viewport:s,selectedItem:d}=t;s&&d&&(s.scrollTop=s.scrollTop+d.offsetHeight);}}):null});Ks.displayName=tr;var js=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,onAutoScroll:o,...r}=e,l=ta("SelectScrollButton",t),u=y__namespace.useRef(null),s=Zt(t),d=y__namespace.useCallback(()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null);},[]);return y__namespace.useEffect(()=>()=>d(),[d]),Y(()=>{s().find(n=>n.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"});},[s]),jsxRuntime.jsx(N.div,{"aria-hidden":true,...r,ref:a,style:{flexShrink:0,...r.style},onPointerDown:K(r.onPointerDown,()=>{u.current===null&&(u.current=window.setInterval(o,50));}),onPointerMove:K(r.onPointerMove,()=>{l.onItemLeave?.(),u.current===null&&(u.current=window.setInterval(o,50));}),onPointerLeave:K(r.onPointerLeave,()=>{d();})})}),xc="SelectSeparator",Zs=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,...o}=e;return jsxRuntime.jsx(N.div,{"aria-hidden":true,...o,ref:a})});Zs.displayName=xc;var or="SelectArrow",Ic=y__namespace.forwardRef((e,a)=>{let{__scopeSelect:t,...o}=e,r=$t(t),l=aa(or,t),u=ta(or,t);return l.open&&u.position==="popper"?jsxRuntime.jsx(Ps,{...r,...o,ref:a}):null});Ic.displayName=or;var hc="SelectBubbleInput",$s=y__namespace.forwardRef(({__scopeSelect:e,value:a,...t},o)=>{let r=y__namespace.useRef(null),l=X(o,r),u=vs(a);return y__namespace.useEffect(()=>{let s=r.current;if(!s)return;let d=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(d,"value").set;if(u!==a&&n){let p=new Event("change",{bubbles:true});n.call(s,a),s.dispatchEvent(p);}},[u,a]),jsxRuntime.jsx(N.select,{...t,style:{...Jo,...t.style},ref:l,defaultValue:a})});$s.displayName=hc;function Qs(e){return e===""||e===void 0}function Js(e){let a=we(e),t=y__namespace.useRef(""),o=y__namespace.useRef(0),r=y__namespace.useCallback(u=>{let s=t.current+u;a(s),(function d(f){t.current=f,window.clearTimeout(o.current),f!==""&&(o.current=window.setTimeout(()=>d(""),1e3));})(s);},[a]),l=y__namespace.useCallback(()=>{t.current="",window.clearTimeout(o.current);},[]);return y__namespace.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,r,l]}function Ys(e,a,t){let r=a.length>1&&Array.from(a).every(f=>f===a[0])?a[0]:a,l=t?e.indexOf(t):-1,u=gc(e,Math.max(l,0));r.length===1&&(u=u.filter(f=>f!==t));let d=u.find(f=>f.textValue.toLowerCase().startsWith(r.toLowerCase()));return d!==t?d:void 0}function gc(e,a){return e.map((t,o)=>e[(a+o)%e.length])}var ed=Rs,sr=bs,ad=Ds,td=Ms,od=Bs,dr=Fs,rd=Es;var fr=Ns,nr=Gs,ld=Vs,ud=_s,ir=Xs,cr=Ks,pr=Zs;var sd=ed;var dd=ad,mr=y__namespace.forwardRef(({className:e,children:a,...t},o)=>jsxRuntime.jsxs(sr,{ref:o,className:q("flex h-9 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...t,children:[a,jsxRuntime.jsx(td,{asChild:true,children:jsxRuntime.jsx(ba,{className:"h-4 w-4 opacity-50"})})]}));mr.displayName=sr.displayName;var fd=y__namespace.forwardRef(({className:e,...a},t)=>jsxRuntime.jsx(ir,{ref:t,className:q("flex cursor-default items-center justify-center py-1",e),...a,children:jsxRuntime.jsx($a,{className:"h-4 w-4"})}));fd.displayName=ir.displayName;var nd=y__namespace.forwardRef(({className:e,...a},t)=>jsxRuntime.jsx(cr,{ref:t,className:q("flex cursor-default items-center justify-center py-1",e),...a,children:jsxRuntime.jsx(ba,{className:"h-4 w-4"})}));nd.displayName=cr.displayName;var Lr=y__namespace.forwardRef(({className:e,children:a,position:t="popper",...o},r)=>jsxRuntime.jsx(od,{children:jsxRuntime.jsxs(dr,{ref:r,className:q("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t==="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:t,...o,children:[jsxRuntime.jsx(fd,{}),jsxRuntime.jsx(rd,{className:q("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),jsxRuntime.jsx(nd,{})]})}));Lr.displayName=dr.displayName;var Sc=y__namespace.forwardRef(({className:e,...a},t)=>jsxRuntime.jsx(fr,{ref:t,className:q("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...a}));Sc.displayName=fr.displayName;var Qt=y__namespace.forwardRef(({className:e,children:a,...t},o)=>jsxRuntime.jsxs(nr,{ref:o,className:q("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(ud,{children:jsxRuntime.jsx(Za,{className:"h-4 w-4"})})}),jsxRuntime.jsx(ld,{children:a})]}));Qt.displayName=nr.displayName;var wc=y__namespace.forwardRef(({className:e,...a},t)=>jsxRuntime.jsx(pr,{ref:t,className:q("-mx-1 my-1 h-px bg-muted",e),...a}));wc.displayName=pr.displayName;var Ir=y__namespace.createContext(null),Pc=y__namespace.forwardRef(({className:e,defaultValue:a,value:t,onValueChange:o,children:r,...l},u)=>{let[s,d]=y__namespace.useState(t||a||"");y__namespace.useEffect(()=>{t!==void 0&&d(t);},[t]);let f=y__namespace.useCallback(n=>{d(n),o?.(n);},[o]);return jsxRuntime.jsx(Ir.Provider,{value:{value:s,onValueChange:f},children:jsxRuntime.jsx("div",{ref:u,className:q("",e),...l,children:r})})});Pc.displayName="Tabs";var vc=y__namespace.forwardRef(({className:e,...a},t)=>jsxRuntime.jsx("div",{ref:t,className:q("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...a}));vc.displayName="TabsList";var yc=y__namespace.forwardRef(({className:e,value:a,...t},o)=>{let r=y__namespace.useContext(Ir),l=r?.value===a;return jsxRuntime.jsx("button",{ref:o,type:"button",role:"tab","aria-selected":l,"data-state":l?"active":"inactive",className:q("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),onClick:()=>r?.onValueChange(a),...t})});yc.displayName="TabsTrigger";var Rc=y__namespace.forwardRef(({className:e,value:a,...t},o)=>{let l=y__namespace.useContext(Ir)?.value===a;return l?jsxRuntime.jsx("div",{ref:o,role:"tabpanel","data-state":l?"active":"inactive",className:q("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}):null});Rc.displayName="TabsContent";var cd=({schema:e,onSubmit:a,initialData:t={},submitLabel:o="Submit"})=>{let[r,l]=y.useState(t),[u,s]=y.useState({}),d=(c,L)=>{l(x=>({...x,[c]:L})),u[c]&&s(x=>{let i={...x};return delete i[c],i});},f=()=>{let c={},L=true;return e.forEach(x=>{x.required&&(r[x.name]===void 0||r[x.name]==="")&&(c[x.name]="This field is required",L=false);}),s(c),L},n=c=>{c.preventDefault(),f()&&a(r);},p=c=>{switch(c.type){case "string":return jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs(Na,{htmlFor:c.name,children:[c.name," ",c.required&&jsxRuntime.jsx("span",{className:"text-destructive",children:"*"})]}),jsxRuntime.jsx(Ua,{id:c.name,value:r[c.name]||"",onChange:L=>d(c.name,L.target.value),placeholder:c.description,className:u[c.name]?"border-destructive":""}),u[c.name]&&jsxRuntime.jsx("p",{className:"text-[10px] text-destructive",children:u[c.name]}),c.description&&!u[c.name]&&jsxRuntime.jsx("p",{className:"text-[10px] text-muted-foreground",children:c.description})]},c.name);case "number":return jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs(Na,{htmlFor:c.name,children:[c.name," ",c.required&&jsxRuntime.jsx("span",{className:"text-destructive",children:"*"})]}),jsxRuntime.jsx(Ua,{id:c.name,type:"number",value:r[c.name]||"",onChange:L=>d(c.name,parseFloat(L.target.value)),placeholder:c.description,className:u[c.name]?"border-destructive":""}),u[c.name]&&jsxRuntime.jsx("p",{className:"text-[10px] text-destructive",children:u[c.name]})]},c.name);case "boolean":return jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs(Na,{htmlFor:c.name,children:[c.name," ",c.required&&jsxRuntime.jsx("span",{className:"text-destructive",children:"*"})]}),jsxRuntime.jsxs(sd,{value:r[c.name]===void 0?"":String(r[c.name]),onValueChange:L=>d(c.name,L==="true"),children:[jsxRuntime.jsx(mr,{id:c.name,className:u[c.name]?"border-destructive":"",children:jsxRuntime.jsx(dd,{placeholder:"Select..."})}),jsxRuntime.jsxs(Lr,{children:[jsxRuntime.jsx(Qt,{value:"true",children:"Yes"}),jsxRuntime.jsx(Qt,{value:"false",children:"No"})]})]}),u[c.name]&&jsxRuntime.jsx("p",{className:"text-[10px] text-destructive",children:u[c.name]})]},c.name);default:return null}};return jsxRuntime.jsxs("form",{onSubmit:n,className:"space-y-4 w-full",children:[e.map(p),jsxRuntime.jsx(Ze,{id:"dynamic-form-submit",type:"submit",className:"w-full mt-4",children:o})]})};var pd=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),kc=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,t,o)=>o?o.toUpperCase():t.toLowerCase()),hr=e=>{let a=kc(e);return a.charAt(0).toUpperCase()+a.slice(1)},Jt=(...e)=>e.filter((a,t,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===t).join(" ").trim(),md=e=>{for(let a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return true};var Ld={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var Id=y.forwardRef(({color:e="currentColor",size:a=24,strokeWidth:t=2,absoluteStrokeWidth:o,className:r="",children:l,iconNode:u,...s},d)=>y.createElement("svg",{ref:d,...Ld,width:a,height:a,stroke:e,strokeWidth:o?Number(t)*24/Number(a):t,className:Jt("lucide",r),...!l&&!md(s)&&{"aria-hidden":"true"},...s},[...u.map(([f,n])=>y.createElement(f,n)),...Array.isArray(l)?l:[l]]));var ke=(e,a)=>{let t=y.forwardRef(({className:o,...r},l)=>y.createElement(Id,{ref:l,iconNode:a,className:Jt(`lucide-${pd(hr(e))}`,`lucide-${e}`,o),...r}));return t.displayName=hr(e),t};var Mc=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Fa=ke("activity",Mc);var Bc=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],ut=ke("brain",Bc);var Fc=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],st=ke("file-text",Fc);var Tc=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Xe=ke("loader-circle",Tc);var Oc=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],dt=ke("search",Oc);var qc=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],ft=ke("shield-alert",qc);var hd=({currentStatus:e,currentNodeId:a,iteration:t=0,messages:o})=>{let r=[{id:"parse-intent",label:"Analyzing Intent",icon:jsxRuntime.jsx(Fa,{className:"w-4 h-4"}),status:"pending"},{id:"create-plan",label:"Planning Research",icon:jsxRuntime.jsx(ut,{className:"w-4 h-4"}),status:"pending"},{id:"search-agent",label:"Gathering Evidence",icon:jsxRuntime.jsx(dt,{className:"w-4 h-4"}),status:"pending"},{id:"adversarial-review",label:"Critical Review",icon:jsxRuntime.jsx(ft,{className:"w-4 h-4"}),status:"pending"},{id:"final-report",label:"Final Report",icon:jsxRuntime.jsx(st,{className:"w-4 h-4"}),status:"pending"}],l=r.findIndex(u=>u.id===a);return r.forEach((u,s)=>{s<l?u.status="completed":s===l&&(u.status="active");}),jsxRuntime.jsxs("div",{className:"w-full space-y-6 animate-in fade-in slide-in-from-bottom-4 duration-500",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-5 gap-4",children:r.map(u=>jsxRuntime.jsx(qa,{className:`border-2 transition-all duration-300 ${u.status==="active"?"border-primary shadow-md scale-105 bg-primary/5":u.status==="completed"?"border-green-500/20 bg-green-50/50":"opacity-50 grayscale"}`,children:jsxRuntime.jsxs(Ea,{className:"p-4 flex flex-col items-center justify-center text-center gap-2",children:[jsxRuntime.jsx("div",{className:`p-2 rounded-full ${u.status==="active"?"bg-primary text-primary-foreground animate-pulse":u.status==="completed"?"bg-green-500 text-white":"bg-muted text-muted-foreground"}`,children:u.status==="active"?jsxRuntime.jsx(Xe,{className:"w-5 h-5 animate-spin"}):u.icon}),jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider",children:u.label})]})},u.id))}),jsxRuntime.jsxs("div",{className:"bg-muted/30 rounded-xl p-6 border border-border/50 backdrop-blur-sm",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[jsxRuntime.jsx(Fa,{className:"w-4 h-4 text-primary"}),"Live Research Feed",t>0&&jsxRuntime.jsxs("span",{className:"ml-2 px-2 py-0.5 bg-blue-100 text-blue-700 text-[10px] rounded-full font-bold uppercase",children:["Iteration ",t]})]}),jsxRuntime.jsxs("span",{className:"text-[10px] tabular-nums text-muted-foreground uppercase font-medium",children:["Session Active \u2022 ",new Date().toLocaleTimeString()]})]}),jsxRuntime.jsxs("div",{className:"space-y-3 max-h-[300px] overflow-y-auto pr-2 custom-scrollbar",children:[o.filter(u=>u.role==="trace"||u.role==="system").slice(-8).map((u,s)=>jsxRuntime.jsxs("div",{className:"flex gap-3 text-sm animate-in slide-in-from-left-2 duration-300",children:[jsxRuntime.jsxs("span",{className:"text-muted-foreground/40 font-mono text-xs pt-0.5 shrink-0",children:["[",new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),"]"]}),jsxRuntime.jsx("p",{className:`${u.role==="system"?"font-semibold text-primary":"text-muted-foreground"}`,children:u.content})]},s)),e&&jsxRuntime.jsxs("div",{className:"flex gap-3 text-sm font-medium text-foreground bg-primary/5 p-2 rounded border border-primary/10",children:[jsxRuntime.jsx(Xe,{className:"w-4 h-4 animate-spin text-primary shrink-0 mt-0.5"}),jsxRuntime.jsx("p",{children:e})]})]})]})]})};function gd({apiEndpoint:e,onMessage:a,onInterrupt:t,onError:o,onDone:r}){let[l,u]=y.useState([]),[s,d]=y.useState(false),[f,n]=y.useState(void 0),[p,c]=y.useState(null),L=y.useCallback(h=>{let I={...h,id:crypto.randomUUID()};u(g=>[...g,I]),a?.(I);},[a]),x=y.useCallback(async(h,I,g,P)=>{d(true);try{let S=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workflow:h,input:I,history:l,threadId:g,resumeValue:P})});if(!S.ok)throw new Error(`HTTP error! status: ${S.status}`);let R=S.body?.getReader(),w=new TextDecoder;if(!R)throw new Error("Response body is not readable");for(;;){let{done:v,value:B}=await R.read();if(v)break;let H=w.decode(B,{stream:!0}).split(`
|
|
46
|
+
`);for(let U of H)if(U.startsWith("data: ")){let W=U.slice(6);try{let D=JSON.parse(W);if(D.type==="event"||D.type==="final"||D.type==="error")L(D.message);else if(D.type==="interrupt")n(D.payload.threadId),D.payload.interruptDetails?.reason==="timeout_prevention"||D.payload.interruptDetails?.reason==="recursion_limit"?setTimeout(()=>{x(h,"",D.payload.threadId,"proceed");},100):(c(D.payload.interruptDetails),t?.(D.payload.interruptDetails));else if(D.type==="done"){r?.();break}}catch(D){console.error("Failed to parse SSE data:",D);}}}}catch(S){let R={role:"system",content:`Error: ${S?.message??"Unknown error"}`};L(R),o?.(S);}finally{d(false);}},[e,l,L,t,o,r]),i=y.useCallback(async(h,I)=>{u([{role:"user",content:I,id:crypto.randomUUID()}]),c(null),n(void 0),await x(h,I);},[x]),m=y.useCallback(async(h,I)=>{c(null),f&&await x(h,"",f,I);},[f,x]);return {messages:l,isRunning:s,currentThreadId:f,pendingInterrupt:p,runExecution:x,restart:i,resume:m}}var _h=({workflow:e,apiEndpoint:a="/api/execute",className:t})=>{let{messages:o,isRunning:r,pendingInterrupt:l,restart:u,resume:s}=gd({apiEndpoint:a}),[d,f]=y.useState(""),[n,p]=y.useState(""),L=e.nodes.find(m=>m.type==="input")?.config,x=m=>{m.preventDefault();let h=L?.triggerType==="manual"?"Start":d;h.trim()&&(u(e,h),f(""));},i=(m,h)=>{m.preventDefault();let I=h??n;typeof I=="string"&&!I.trim()&&l?.uiType!=="confirmation"||(s(e,I),p(""));};return jsxRuntime.jsx("div",{className:q("flex-1 flex flex-col items-center justify-center p-4 md:p-8 bg-muted/5 min-h-[400px]",t),children:l?jsxRuntime.jsx("div",{className:"w-full max-w-2xl animate-in fade-in zoom-in duration-300",children:jsxRuntime.jsxs(qa,{className:"shadow-lg border-2 border-primary/10",children:[jsxRuntime.jsx(fo,{className:"text-center",children:jsxRuntime.jsx(no,{className:"text-xl",children:l.prompt})}),jsxRuntime.jsx(Ea,{children:l.uiType==="form"&&l.schema?jsxRuntime.jsx(cd,{schema:l.schema,onSubmit:m=>i({preventDefault:()=>{}},m),submitLabel:"Continue"}):l.uiType==="confirmation"?jsxRuntime.jsxs("div",{className:"flex justify-center gap-4",children:[jsxRuntime.jsx(Ze,{size:"lg",className:"w-32",onClick:m=>i(m,"yes"),children:"Yes, Proceed"}),jsxRuntime.jsx(Ze,{size:"lg",variant:"outline",className:"w-32",onClick:m=>i(m,"no"),children:"Cancel"})]}):jsxRuntime.jsxs("div",{className:"flex gap-2 max-w-md mx-auto",children:[jsxRuntime.jsx(Ua,{id:"resume-input",value:n,onChange:m=>p(m.target.value),placeholder:"Type your answer...",className:"text-lg h-12",autoFocus:true}),jsxRuntime.jsx(Ze,{id:"resume-submit",size:"lg",onClick:m=>i(m),children:"Submit"})]})})]})}):r?jsxRuntime.jsx("div",{className:"w-full max-w-4xl",children:e.id.includes("research")?jsxRuntime.jsx(hd,{currentStatus:o.slice(-1)[0]?.content||"Processing...",currentNodeId:o.filter(m=>m.role==="trace").slice(-1)[0]?.meta?.nodeId,iteration:o.filter(m=>m.role==="trace"&&m.content.includes("Iteration")).length>0?parseInt(o.filter(m=>m.role==="trace"&&m.content.includes("Iteration")).slice(-1)[0].content.match(/Iteration (\d+)/)?.[1]||"0"):0,messages:o}):jsxRuntime.jsxs("div",{className:"text-center space-y-4 animate-pulse",children:[jsxRuntime.jsx("div",{className:"w-16 h-16 bg-primary/20 rounded-full mx-auto flex items-center justify-center",children:jsxRuntime.jsx("div",{className:"w-8 h-8 bg-primary rounded-full animate-ping"})}),jsxRuntime.jsx("p",{className:"text-lg font-medium text-muted-foreground",children:"Processing Workflow..."})]})}):jsxRuntime.jsxs("div",{className:"w-full max-w-2xl space-y-6",children:[o.length>1&&jsxRuntime.jsxs(qa,{className:"border-primary/20 bg-primary/5 animate-in slide-in-from-top-4 duration-500 shadow-sm",children:[jsxRuntime.jsx(fo,{className:"pb-2",children:jsxRuntime.jsx(no,{className:"text-lg font-bold",children:"Execution Result"})}),jsxRuntime.jsx(Ea,{children:jsxRuntime.jsx("div",{className:"text-sm leading-relaxed whitespace-pre-wrap text-foreground/90",children:o.filter(m=>m.role==="assistant").slice(-1)[0]?.content||o.filter(m=>m.role==="system"&&m.content.startsWith("Final Output")).slice(-1)[0]?.content||"Workflow completed."})})]}),jsxRuntime.jsxs("div",{className:"text-center space-y-6 w-full max-w-xl py-12",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:o.length>1?"Run Again":"Ready to Start"}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:L?.triggerType==="manual"?"Click below to begin the workflow process.":"Enter your request details to begin the workflow."})]}),L?.triggerType==="manual"?jsxRuntime.jsx(Ze,{size:"lg",className:"w-full h-12 text-base font-semibold",onClick:m=>x(m),children:"Start Process"}):jsxRuntime.jsxs("form",{onSubmit:m=>x(m),className:"space-y-4",children:[jsxRuntime.jsx(zr,{id:"start-input",value:d,onChange:m=>f(m.target.value),placeholder:"e.g., 'Research the latest trends in AI agents'...",className:"min-h-[120px] text-base p-4 shadow-sm resize-none"}),jsxRuntime.jsx(Ze,{id:"start-submit",size:"lg",className:"w-full h-12 text-base font-semibold",type:"submit",disabled:!d.trim(),children:"Start Workflow"})]})]})]})})};/*! Bundled license information:
|
|
47
47
|
|
|
48
48
|
lucide-react/dist/esm/shared/src/utils.js:
|
|
49
49
|
lucide-react/dist/esm/defaultAttributes.js:
|