@launchsecure/launch-kit 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chart-client/assets/index-BN_N_I08.js +379 -0
- package/dist/chart-client/assets/index-DJRXEWQm.css +1 -0
- package/dist/chart-client/index.html +2 -2
- package/dist/client/assets/index-CCpAvTkG.css +32 -0
- package/dist/client/assets/{index-D9e81rsq.js → index-DldfczJ1.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/chart-serve.js +1388 -377
- package/dist/server/cli.js +1522 -406
- package/dist/server/graph-mcp-entry.js +1741 -415
- package/package.json +1 -1
- package/dist/chart-client/assets/index-BPR5akxH.js +0 -323
- package/dist/chart-client/assets/index-DhNl1aFF.css +0 -1
- package/dist/client/assets/index-nR-HgoHH.css +0 -32
|
@@ -266,7 +266,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
266
266
|
- less than the value passed to \`max\` (or ${Sd} if no \`max\` prop is set)
|
|
267
267
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
268
268
|
|
|
269
|
-
Defaulting to \`null\`.`}var Dy=Py,qL=Ly;const XL=g.forwardRef(({className:e,value:t,...r},n)=>x.jsx(Dy,{ref:n,className:re("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...r,children:x.jsx(qL,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));XL.displayName=Dy.displayName;function $f(e,[t,r]){return Math.min(r,Math.max(t,e))}function YL(e,t=[]){let r=[];function n(o,l){const i=g.createContext(l),a=r.length;r=[...r,l];const c=u=>{var h;const{scope:v,children:y,...w}=u,_=((h=v==null?void 0:v[e])==null?void 0:h[a])||i,m=g.useMemo(()=>w,Object.values(w));return x.jsx(_.Provider,{value:m,children:y})};c.displayName=o+"Provider";function p(u,v){var _;const y=((_=v==null?void 0:v[e])==null?void 0:_[a])||i,w=g.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,p]}const s=()=>{const o=r.map(l=>g.createContext(l));return function(i){const a=(i==null?void 0:i[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,QL(s,...t)]}function QL(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((i,{useScope:a,scopeName:c})=>{const u=a(o)[`__scope${c}`];return{...i,...u}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function My(e){const t=JL(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(eA);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function JL(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=rA(s),i=tA(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ZL=Symbol("radix.slottable");function eA(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ZL}function tA(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function rA(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var nA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ct=nA.reduce((e,t)=>{const r=My(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function sA(e){const t=iA(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(aA);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function iA(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=cA(s),i=lA(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var oA=Symbol("radix.slottable");function aA(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===oA}function lA(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function cA(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var uA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],dA=uA.reduce((e,t)=>{const r=sA(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ny=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"}),hA="VisuallyHidden",Iy=g.forwardRef((e,t)=>x.jsx(dA.span,{...e,ref:t,style:{...Ny,...e.style}}));Iy.displayName=hA;var fA=Iy,pA=[" ","Enter","ArrowUp","ArrowDown"],mA=[" ","Enter"],Aa="Select",[wd,Da,vA]=rd(Aa),[rs]=YL(Aa,[vA,Mr]),xd=Mr(),[lN,Ir]=rs(Aa),[cN,gA]=rs(Aa),Oy="SelectTrigger",jy=g.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=xd(r),l=Ir(Oy,r),i=l.disabled||n,a=le(t,l.onTriggerChange),c=Da(r),p=g.useRef("touch"),[u,v,y]=i0(_=>{const m=c().filter(f=>!f.disabled),h=m.find(f=>f.value===l.value),d=o0(m,_,h);d!==void 0&&l.onValueChange(d.value)}),w=_=>{i||(l.onOpenChange(!0),y()),_&&(l.triggerPointerDownPosRef.current={x:Math.round(_.pageX),y:Math.round(_.pageY)})};return x.jsx(vi,{asChild:!0,...o,children:x.jsx(ct.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":s0(l.value)?"":void 0,...s,ref:a,onClick:J(s.onClick,_=>{_.currentTarget.focus(),p.current!=="mouse"&&w(_)}),onPointerDown:J(s.onPointerDown,_=>{p.current=_.pointerType;const m=_.target;m.hasPointerCapture(_.pointerId)&&m.releasePointerCapture(_.pointerId),_.button===0&&_.ctrlKey===!1&&_.pointerType==="mouse"&&(w(_),_.preventDefault())}),onKeyDown:J(s.onKeyDown,_=>{const m=u.current!=="";!(_.ctrlKey||_.altKey||_.metaKey)&&_.key.length===1&&v(_.key),!(m&&_.key===" ")&&pA.includes(_.key)&&(w(),_.preventDefault())})})})});jy.displayName=Oy;var By="SelectValue",_A=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:l="",...i}=e,a=Ir(By,r),{onValueNodeHasChildrenChange:c}=a,p=o!==void 0,u=le(t,a.onValueNodeChange);return Le(()=>{c(p)},[c,p]),x.jsx(ct.span,{...i,ref:u,style:{pointerEvents:"none"},children:s0(a.value)?x.jsx(x.Fragment,{children:l}):o})});_A.displayName=By;var yA="SelectIcon",$y=g.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return x.jsx(ct.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});$y.displayName=yA;var SA="SelectPortal",Fy=e=>x.jsx(Zn,{asChild:!0,...e});Fy.displayName=SA;var rn="SelectContent",Hy=g.forwardRef((e,t)=>{const r=Ir(rn,e.__scopeSelect),[n,s]=g.useState();if(Le(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?on.createPortal(x.jsx(Wy,{scope:e.__scopeSelect,children:x.jsx(wd.Slot,{scope:e.__scopeSelect,children:x.jsx("div",{children:e.children})})}),o):null}return x.jsx(zy,{...e,ref:t})});Hy.displayName=rn;var St=10,[Wy,Or]=rs(rn),wA="SelectContentImpl",xA=My("SelectContent.RemoveScroll"),zy=g.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:l,side:i,sideOffset:a,align:c,alignOffset:p,arrowPadding:u,collisionBoundary:v,collisionPadding:y,sticky:w,hideWhenDetached:_,avoidCollisions:m,...h}=e,d=Ir(rn,r),[f,S]=g.useState(null),[E,k]=g.useState(null),b=le(t,O=>S(O)),[C,P]=g.useState(null),[T,M]=g.useState(null),j=Da(r),[N,$]=g.useState(!1),V=g.useRef(!1);g.useEffect(()=>{if(f)return va(f)},[f]),pa();const K=g.useCallback(O=>{const[A,...W]=j().map(X=>X.ref.current),[H]=W.slice(-1),Y=document.activeElement;for(const X of O)if(X===Y||(X==null||X.scrollIntoView({block:"nearest"}),X===A&&E&&(E.scrollTop=0),X===H&&E&&(E.scrollTop=E.scrollHeight),X==null||X.focus(),document.activeElement!==Y))return},[j,E]),q=g.useCallback(()=>K([C,f]),[K,C,f]);g.useEffect(()=>{N&&q()},[N,q]);const{onOpenChange:B,triggerPointerDownPosRef:R}=d;g.useEffect(()=>{if(f){let O={x:0,y:0};const A=H=>{var Y,X;O={x:Math.abs(Math.round(H.pageX)-(((Y=R.current)==null?void 0:Y.x)??0)),y:Math.abs(Math.round(H.pageY)-(((X=R.current)==null?void 0:X.y)??0))}},W=H=>{O.x<=10&&O.y<=10?H.preventDefault():f.contains(H.target)||B(!1),document.removeEventListener("pointermove",A),R.current=null};return R.current!==null&&(document.addEventListener("pointermove",A),document.addEventListener("pointerup",W,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",A),document.removeEventListener("pointerup",W,{capture:!0})}}},[f,B,R]),g.useEffect(()=>{const O=()=>B(!1);return window.addEventListener("blur",O),window.addEventListener("resize",O),()=>{window.removeEventListener("blur",O),window.removeEventListener("resize",O)}},[B]);const[L,I]=i0(O=>{const A=j().filter(Y=>!Y.disabled),W=A.find(Y=>Y.ref.current===document.activeElement),H=o0(A,O,W);H&&setTimeout(()=>H.ref.current.focus())}),D=g.useCallback((O,A,W)=>{const H=!V.current&&!W;(d.value!==void 0&&d.value===A||H)&&(P(O),H&&(V.current=!0))},[d.value]),z=g.useCallback(()=>f==null?void 0:f.focus(),[f]),F=g.useCallback((O,A,W)=>{const H=!V.current&&!W;(d.value!==void 0&&d.value===A||H)&&M(O)},[d.value]),U=n==="popper"?Oc:Uy,G=U===Oc?{side:i,sideOffset:a,align:c,alignOffset:p,arrowPadding:u,collisionBoundary:v,collisionPadding:y,sticky:w,hideWhenDetached:_,avoidCollisions:m}:{};return x.jsx(Wy,{scope:r,content:f,viewport:E,onViewportChange:k,itemRefCallback:D,selectedItem:C,onItemLeave:z,itemTextRefCallback:F,focusSelectedItem:q,selectedItemText:T,position:n,isPositioned:N,searchRef:L,children:x.jsx(di,{as:xA,allowPinchZoom:!0,children:x.jsx(ci,{asChild:!0,trapped:d.open,onMountAutoFocus:O=>{O.preventDefault()},onUnmountAutoFocus:J(s,O=>{var A;(A=d.trigger)==null||A.focus({preventScroll:!0}),O.preventDefault()}),children:x.jsx(Jn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:O=>O.preventDefault(),onDismiss:()=>d.onOpenChange(!1),children:x.jsx(U,{role:"listbox",id:d.contentId,"data-state":d.open?"open":"closed",dir:d.dir,onContextMenu:O=>O.preventDefault(),...h,...G,onPlaced:()=>$(!0),ref:b,style:{display:"flex",flexDirection:"column",outline:"none",...h.style},onKeyDown:J(h.onKeyDown,O=>{const A=O.ctrlKey||O.altKey||O.metaKey;if(O.key==="Tab"&&O.preventDefault(),!A&&O.key.length===1&&I(O.key),["ArrowUp","ArrowDown","Home","End"].includes(O.key)){let H=j().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);if(["ArrowUp","End"].includes(O.key)&&(H=H.slice().reverse()),["ArrowUp","ArrowDown"].includes(O.key)){const Y=O.target,X=H.indexOf(Y);H=H.slice(X+1)}setTimeout(()=>K(H)),O.preventDefault()}})})})})})})});zy.displayName=wA;var CA="SelectItemAlignedPosition",Uy=g.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=Ir(rn,r),l=Or(rn,r),[i,a]=g.useState(null),[c,p]=g.useState(null),u=le(t,b=>p(b)),v=Da(r),y=g.useRef(!1),w=g.useRef(!0),{viewport:_,selectedItem:m,selectedItemText:h,focusSelectedItem:d}=l,f=g.useCallback(()=>{if(o.trigger&&o.valueNode&&i&&c&&_&&m&&h){const b=o.trigger.getBoundingClientRect(),C=c.getBoundingClientRect(),P=o.valueNode.getBoundingClientRect(),T=h.getBoundingClientRect();if(o.dir!=="rtl"){const Y=T.left-C.left,X=P.left-Y,ne=b.left-X,ie=b.width+ne,de=Math.max(ie,C.width),be=window.innerWidth-St,se=$f(X,[St,Math.max(St,be-de)]);i.style.minWidth=ie+"px",i.style.left=se+"px"}else{const Y=C.right-T.right,X=window.innerWidth-P.right-Y,ne=window.innerWidth-b.right-X,ie=b.width+ne,de=Math.max(ie,C.width),be=window.innerWidth-St,se=$f(X,[St,Math.max(St,be-de)]);i.style.minWidth=ie+"px",i.style.right=se+"px"}const M=v(),j=window.innerHeight-St*2,N=_.scrollHeight,$=window.getComputedStyle(c),V=parseInt($.borderTopWidth,10),K=parseInt($.paddingTop,10),q=parseInt($.borderBottomWidth,10),B=parseInt($.paddingBottom,10),R=V+K+N+B+q,L=Math.min(m.offsetHeight*5,R),I=window.getComputedStyle(_),D=parseInt(I.paddingTop,10),z=parseInt(I.paddingBottom,10),F=b.top+b.height/2-St,U=j-F,G=m.offsetHeight/2,O=m.offsetTop+G,A=V+K+O,W=R-A;if(A<=F){const Y=M.length>0&&m===M[M.length-1].ref.current;i.style.bottom="0px";const X=c.clientHeight-_.offsetTop-_.offsetHeight,ne=Math.max(U,G+(Y?z:0)+X+q),ie=A+ne;i.style.height=ie+"px"}else{const Y=M.length>0&&m===M[0].ref.current;i.style.top="0px";const ne=Math.max(F,V+_.offsetTop+(Y?D:0)+G)+W;i.style.height=ne+"px",_.scrollTop=A-F+_.offsetTop}i.style.margin=`${St}px 0`,i.style.minHeight=L+"px",i.style.maxHeight=j+"px",n==null||n(),requestAnimationFrame(()=>y.current=!0)}},[v,o.trigger,o.valueNode,i,c,_,m,h,o.dir,n]);Le(()=>f(),[f]);const[S,E]=g.useState();Le(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const k=g.useCallback(b=>{b&&w.current===!0&&(f(),d==null||d(),w.current=!1)},[f,d]);return x.jsx(EA,{scope:r,contentWrapper:i,shouldExpandOnScrollRef:y,onScrollButtonChange:k,children:x.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:x.jsx(ct.div,{...s,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Uy.displayName=CA;var bA="SelectPopperPosition",Oc=g.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=St,...o}=e,l=xd(r);return x.jsx(Ea,{...l,...o,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...o.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)"}})});Oc.displayName=bA;var[EA,Cd]=rs(rn,{}),jc="SelectViewport",Vy=g.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=Or(jc,r),l=Cd(jc,r),i=le(t,o.onViewportChange),a=g.useRef(0);return x.jsxs(x.Fragment,{children:[x.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),x.jsx(wd.Slot,{scope:r,children:x.jsx(ct.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:J(s.onScroll,c=>{const p=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:v}=l;if(v!=null&&v.current&&u){const y=Math.abs(a.current-p.scrollTop);if(y>0){const w=window.innerHeight-St*2,_=parseFloat(u.style.minHeight),m=parseFloat(u.style.height),h=Math.max(_,m);if(h<w){const d=h+y,f=Math.min(w,d),S=d-f;u.style.height=f+"px",u.style.bottom==="0px"&&(p.scrollTop=S>0?S:0,u.style.justifyContent="flex-end")}}}a.current=p.scrollTop})})})]})});Vy.displayName=jc;var Ky="SelectGroup",[kA,RA]=rs(Ky),PA=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=st();return x.jsx(kA,{scope:r,id:s,children:x.jsx(ct.div,{role:"group","aria-labelledby":s,...n,ref:t})})});PA.displayName=Ky;var Gy="SelectLabel",qy=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=RA(Gy,r);return x.jsx(ct.div,{id:s.id,...n,ref:t})});qy.displayName=Gy;var Go="SelectItem",[TA,Xy]=rs(Go),Yy=g.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...l}=e,i=Ir(Go,r),a=Or(Go,r),c=i.value===n,[p,u]=g.useState(o??""),[v,y]=g.useState(!1),w=le(t,d=>{var f;return(f=a.itemRefCallback)==null?void 0:f.call(a,d,n,s)}),_=st(),m=g.useRef("touch"),h=()=>{s||(i.onValueChange(n),i.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return x.jsx(TA,{scope:r,value:n,disabled:s,textId:_,isSelected:c,onItemTextChange:g.useCallback(d=>{u(f=>f||((d==null?void 0:d.textContent)??"").trim())},[]),children:x.jsx(wd.ItemSlot,{scope:r,value:n,disabled:s,textValue:p,children:x.jsx(ct.div,{role:"option","aria-labelledby":_,"data-highlighted":v?"":void 0,"aria-selected":c&&v,"data-state":c?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:w,onFocus:J(l.onFocus,()=>y(!0)),onBlur:J(l.onBlur,()=>y(!1)),onClick:J(l.onClick,()=>{m.current!=="mouse"&&h()}),onPointerUp:J(l.onPointerUp,()=>{m.current==="mouse"&&h()}),onPointerDown:J(l.onPointerDown,d=>{m.current=d.pointerType}),onPointerMove:J(l.onPointerMove,d=>{var f;m.current=d.pointerType,s?(f=a.onItemLeave)==null||f.call(a):m.current==="mouse"&&d.currentTarget.focus({preventScroll:!0})}),onPointerLeave:J(l.onPointerLeave,d=>{var f;d.currentTarget===document.activeElement&&((f=a.onItemLeave)==null||f.call(a))}),onKeyDown:J(l.onKeyDown,d=>{var S;((S=a.searchRef)==null?void 0:S.current)!==""&&d.key===" "||(mA.includes(d.key)&&h(),d.key===" "&&d.preventDefault())})})})})});Yy.displayName=Go;var xs="SelectItemText",Qy=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,l=Ir(xs,r),i=Or(xs,r),a=Xy(xs,r),c=gA(xs,r),[p,u]=g.useState(null),v=le(t,h=>u(h),a.onItemTextChange,h=>{var d;return(d=i.itemTextRefCallback)==null?void 0:d.call(i,h,a.value,a.disabled)}),y=p==null?void 0:p.textContent,w=g.useMemo(()=>x.jsx("option",{value:a.value,disabled:a.disabled,children:y},a.value),[a.disabled,a.value,y]),{onNativeOptionAdd:_,onNativeOptionRemove:m}=c;return Le(()=>(_(w),()=>m(w)),[_,m,w]),x.jsxs(x.Fragment,{children:[x.jsx(ct.span,{id:a.textId,...o,ref:v}),a.isSelected&&l.valueNode&&!l.valueNodeHasChildren?on.createPortal(o.children,l.valueNode):null]})});Qy.displayName=xs;var Jy="SelectItemIndicator",Zy=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Xy(Jy,r).isSelected?x.jsx(ct.span,{"aria-hidden":!0,...n,ref:t}):null});Zy.displayName=Jy;var Bc="SelectScrollUpButton",e0=g.forwardRef((e,t)=>{const r=Or(Bc,e.__scopeSelect),n=Cd(Bc,e.__scopeSelect),[s,o]=g.useState(!1),l=le(t,n.onScrollButtonChange);return Le(()=>{if(r.viewport&&r.isPositioned){let i=function(){const c=a.scrollTop>0;o(c)};const a=r.viewport;return i(),a.addEventListener("scroll",i),()=>a.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),s?x.jsx(r0,{...e,ref:l,onAutoScroll:()=>{const{viewport:i,selectedItem:a}=r;i&&a&&(i.scrollTop=i.scrollTop-a.offsetHeight)}}):null});e0.displayName=Bc;var $c="SelectScrollDownButton",t0=g.forwardRef((e,t)=>{const r=Or($c,e.__scopeSelect),n=Cd($c,e.__scopeSelect),[s,o]=g.useState(!1),l=le(t,n.onScrollButtonChange);return Le(()=>{if(r.viewport&&r.isPositioned){let i=function(){const c=a.scrollHeight-a.clientHeight,p=Math.ceil(a.scrollTop)<c;o(p)};const a=r.viewport;return i(),a.addEventListener("scroll",i),()=>a.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),s?x.jsx(r0,{...e,ref:l,onAutoScroll:()=>{const{viewport:i,selectedItem:a}=r;i&&a&&(i.scrollTop=i.scrollTop+a.offsetHeight)}}):null});t0.displayName=$c;var r0=g.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=Or("SelectScrollButton",r),l=g.useRef(null),i=Da(r),a=g.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return g.useEffect(()=>()=>a(),[a]),Le(()=>{var p;const c=i().find(u=>u.ref.current===document.activeElement);(p=c==null?void 0:c.ref.current)==null||p.scrollIntoView({block:"nearest"})},[i]),x.jsx(ct.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:J(s.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(n,50))}),onPointerMove:J(s.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),l.current===null&&(l.current=window.setInterval(n,50))}),onPointerLeave:J(s.onPointerLeave,()=>{a()})})}),LA="SelectSeparator",n0=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return x.jsx(ct.div,{"aria-hidden":!0,...n,ref:t})});n0.displayName=LA;var Fc="SelectArrow",AA=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=xd(r),o=Ir(Fc,r),l=Or(Fc,r);return o.open&&l.position==="popper"?x.jsx(ka,{...s,...n,ref:t}):null});AA.displayName=Fc;var DA="SelectBubbleInput",MA=g.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const s=g.useRef(null),o=le(n,s),l=Ku(t);return g.useEffect(()=>{const i=s.current;if(!i)return;const a=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==t&&p){const u=new Event("change",{bubbles:!0});p.call(i,t),i.dispatchEvent(u)}},[l,t]),x.jsx(ct.select,{...r,style:{...Ny,...r.style},ref:o,defaultValue:t})});MA.displayName=DA;function s0(e){return e===""||e===void 0}function i0(e){const t=$t(e),r=g.useRef(""),n=g.useRef(0),s=g.useCallback(l=>{const i=r.current+l;t(i),function a(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>a(""),1e3))}(i)},[t]),o=g.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function o0(e,t,r){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let l=NA(e,Math.max(o,0));s.length===1&&(l=l.filter(c=>c!==r));const a=l.find(c=>c.textValue.toLowerCase().startsWith(s.toLowerCase()));return a!==r?a:void 0}function NA(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var a0=jy,IA=$y,OA=Fy,l0=Hy,jA=Vy,c0=qy,u0=Yy,BA=Qy,$A=Zy,d0=e0,h0=t0,f0=n0;const FA=g.forwardRef(({className:e,children:t,...r},n)=>x.jsxs(a0,{ref:n,className:re("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-transparent bg-input px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground/50 data-[placeholder]:font-light focus:outline-none focus:border-ring focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,x.jsx(IA,{asChild:!0,children:x.jsx(Vu,{className:"h-4 w-4 opacity-50"})})]}));FA.displayName=a0.displayName;const p0=g.forwardRef(({className:e,...t},r)=>x.jsx(d0,{ref:r,className:re("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(eb,{className:"h-4 w-4"})}));p0.displayName=d0.displayName;const m0=g.forwardRef(({className:e,...t},r)=>x.jsx(h0,{ref:r,className:re("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(Vu,{className:"h-4 w-4"})}));m0.displayName=h0.displayName;const HA=g.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>x.jsx(OA,{children:x.jsxs(l0,{ref:s,className:re("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-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 origin-[--radix-select-content-transform-origin]",r==="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:r,...n,children:[x.jsx(p0,{}),x.jsx(jA,{className:re("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),x.jsx(m0,{})]})}));HA.displayName=l0.displayName;const WA=g.forwardRef(({className:e,...t},r)=>x.jsx(c0,{ref:r,className:re("px-2 py-1.5 text-sm font-semibold",e),...t}));WA.displayName=c0.displayName;const zA=g.forwardRef(({className:e,children:t,...r},n)=>x.jsxs(u0,{ref:n,className:re("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[x.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx($A,{children:x.jsx(Uu,{className:"h-4 w-4"})})}),x.jsx(BA,{children:t})]}));zA.displayName=u0.displayName;const UA=g.forwardRef(({className:e,...t},r)=>x.jsx(f0,{ref:r,className:re("-mx-1 my-1 h-px bg-muted",e),...t}));UA.displayName=f0.displayName;var VA="Separator",Ff="horizontal",KA=["horizontal","vertical"],v0=g.forwardRef((e,t)=>{const{decorative:r,orientation:n=Ff,...s}=e,o=GA(n)?n:Ff,i=r?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return x.jsx(Ue.div,{"data-orientation":o,...i,...s,ref:t})});v0.displayName=VA;function GA(e){return KA.includes(e)}var g0=v0;const qA=g.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>x.jsx(g0,{ref:s,decorative:r,orientation:t,className:re("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));qA.displayName=g0.displayName;const XA=ed,_0=g.forwardRef(({className:e,...t},r)=>x.jsx(hi,{className:re("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),...t,ref:r}));_0.displayName=hi.displayName;const YA=zu("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),QA=g.forwardRef(({side:e="right",className:t,children:r,...n},s)=>x.jsxs(XA,{children:[x.jsx(_0,{}),x.jsxs(fi,{ref:s,className:re(YA({side:e}),t),...n,children:[x.jsxs(Og,{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-secondary",children:[x.jsx(Jv,{className:"h-4 w-4"}),x.jsx("span",{className:"sr-only",children:"Close"})]}),r]})]}));QA.displayName=fi.displayName;const JA=g.forwardRef(({className:e,...t},r)=>x.jsx(_a,{ref:r,className:re("text-lg font-semibold text-foreground",e),...t}));JA.displayName=_a.displayName;const ZA=g.forwardRef(({className:e,...t},r)=>x.jsx(ya,{ref:r,className:re("text-sm text-muted-foreground",e),...t}));ZA.displayName=ya.displayName;function eD(e,t=[]){let r=[];function n(o,l){const i=g.createContext(l),a=r.length;r=[...r,l];const c=u=>{var h;const{scope:v,children:y,...w}=u,_=((h=v==null?void 0:v[e])==null?void 0:h[a])||i,m=g.useMemo(()=>w,Object.values(w));return x.jsx(_.Provider,{value:m,children:y})};c.displayName=o+"Provider";function p(u,v){var _;const y=((_=v==null?void 0:v[e])==null?void 0:_[a])||i,w=g.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,p]}const s=()=>{const o=r.map(l=>g.createContext(l));return function(i){const a=(i==null?void 0:i[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,tD(s,...t)]}function tD(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((i,{useScope:a,scopeName:c})=>{const u=a(o)[`__scope${c}`];return{...i,...u}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function rD(e){const t=nD(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(iD);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function nD(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=aD(s),i=oD(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sD=Symbol("radix.slottable");function iD(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sD}function oD(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function aD(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var lD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],y0=lD.reduce((e,t)=>{const r=rD(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ma="Switch",[cD]=eD(Ma),[uD,dD]=cD(Ma),S0=g.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:o,required:l,disabled:i,value:a="on",onCheckedChange:c,form:p,...u}=e,[v,y]=g.useState(null),w=le(t,f=>y(f)),_=g.useRef(!1),m=v?p||!!v.closest("form"):!0,[h,d]=li({prop:s,defaultProp:o??!1,onChange:c,caller:Ma});return x.jsxs(uD,{scope:r,checked:h,disabled:i,children:[x.jsx(y0.button,{type:"button",role:"switch","aria-checked":h,"aria-required":l,"data-state":b0(h),"data-disabled":i?"":void 0,disabled:i,value:a,...u,ref:w,onClick:J(e.onClick,f=>{d(S=>!S),m&&(_.current=f.isPropagationStopped(),_.current||f.stopPropagation())})}),m&&x.jsx(C0,{control:v,bubbles:!_.current,name:n,value:a,checked:h,required:l,disabled:i,form:p,style:{transform:"translateX(-100%)"}})]})});S0.displayName=Ma;var w0="SwitchThumb",x0=g.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=dD(w0,r);return x.jsx(y0.span,{"data-state":b0(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});x0.displayName=w0;var hD="SwitchBubbleInput",C0=g.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...s},o)=>{const l=g.useRef(null),i=le(l,o),a=Ku(r),c=Gu(t);return g.useEffect(()=>{const p=l.current;if(!p)return;const u=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(u,"checked").set;if(a!==r&&y){const w=new Event("click",{bubbles:n});y.call(p,r),p.dispatchEvent(w)}},[a,r,n]),x.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:i,style:{...s.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});C0.displayName=hD;function b0(e){return e?"checked":"unchecked"}var E0=S0,fD=x0;const pD=g.forwardRef(({className:e,...t},r)=>x.jsx(E0,{ref:r,className:re("peer inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,children:x.jsx(fD,{className:re("pointer-events-none block h-3 w-3 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0")})}));pD.displayName=E0.displayName;function mD(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Array(12).fill(0);let Hc=1;class vD{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...s}=t,o=typeof(t==null?void 0:t.id)=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:Hc++,l=this.toasts.find(a=>a.id===o),i=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),l?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...t,id:o,title:n}),{...a,...t,id:o,dismissible:i,title:n}):a):this.addToast({title:n,...s,dismissible:i,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let o=n!==void 0,l;const i=s.then(async c=>{if(l=["resolve",c],Ve.isValidElement(c))o=!1,this.create({id:n,type:"default",message:c});else if(_D(c)&&!c.ok){o=!1;const u=typeof r.error=="function"?await r.error(`HTTP error! status: ${c.status}`):r.error,v=typeof r.description=="function"?await r.description(`HTTP error! status: ${c.status}`):r.description,w=typeof u=="object"&&!Ve.isValidElement(u)?u:{message:u};this.create({id:n,type:"error",description:v,...w})}else if(c instanceof Error){o=!1;const u=typeof r.error=="function"?await r.error(c):r.error,v=typeof r.description=="function"?await r.description(c):r.description,w=typeof u=="object"&&!Ve.isValidElement(u)?u:{message:u};this.create({id:n,type:"error",description:v,...w})}else if(r.success!==void 0){o=!1;const u=typeof r.success=="function"?await r.success(c):r.success,v=typeof r.description=="function"?await r.description(c):r.description,w=typeof u=="object"&&!Ve.isValidElement(u)?u:{message:u};this.create({id:n,type:"success",description:v,...w})}}).catch(async c=>{if(l=["reject",c],r.error!==void 0){o=!1;const p=typeof r.error=="function"?await r.error(c):r.error,u=typeof r.description=="function"?await r.description(c):r.description,y=typeof p=="object"&&!Ve.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:u,...y})}}).finally(()=>{o&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),a=()=>new Promise((c,p)=>i.then(()=>l[0]==="reject"?p(l[1]):c(l[1])).catch(p));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(t,r)=>{const n=(r==null?void 0:r.id)||Hc++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const dt=new vD,gD=(e,t)=>{const r=(t==null?void 0:t.id)||Hc++;return dt.addToast({title:e,...t,id:r}),r},_D=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",yD=gD,SD=()=>dt.toasts,wD=()=>dt.getActiveToasts();Object.assign(yD,{success:dt.success,info:dt.info,warning:dt.warning,error:dt.error,custom:dt.custom,message:dt.message,promise:dt.promise,dismiss:dt.dismiss,loading:dt.loading},{getHistory:SD,getToasts:wD});mD("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function xD(e,t=[]){let r=[];function n(o,l){const i=g.createContext(l),a=r.length;r=[...r,l];const c=u=>{var h;const{scope:v,children:y,...w}=u,_=((h=v==null?void 0:v[e])==null?void 0:h[a])||i,m=g.useMemo(()=>w,Object.values(w));return x.jsx(_.Provider,{value:m,children:y})};c.displayName=o+"Provider";function p(u,v){var _;const y=((_=v==null?void 0:v[e])==null?void 0:_[a])||i,w=g.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,p]}const s=()=>{const o=r.map(l=>g.createContext(l));return function(i){const a=(i==null?void 0:i[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,CD(s,...t)]}function CD(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((i,{useScope:a,scopeName:c})=>{const u=a(o)[`__scope${c}`];return{...i,...u}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function bD(e){const t=ED(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(RD);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function ED(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=TD(s),i=PD(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kD=Symbol("radix.slottable");function RD(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kD}function PD(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function TD(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var LD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Na=LD.reduce((e,t)=>{const r=bD(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ia="Tabs",[AD]=xD(Ia,[Ra]),k0=Ra(),[DD,bd]=AD(Ia),MD=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:s,defaultValue:o,orientation:l="horizontal",dir:i,activationMode:a="automatic",...c}=e,p=Vg(i),[u,v]=li({prop:n,onChange:s,defaultProp:o??"",caller:Ia});return x.jsx(DD,{scope:r,baseId:st(),value:u,onValueChange:v,orientation:l,dir:p,activationMode:a,children:x.jsx(Na.div,{dir:p,"data-orientation":l,...c,ref:t})})});MD.displayName=Ia;var R0="TabsList",P0=g.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...s}=e,o=bd(R0,r),l=k0(r);return x.jsx(w_,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:n,children:x.jsx(Na.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});P0.displayName=R0;var T0="TabsTrigger",L0=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:s=!1,...o}=e,l=bd(T0,r),i=k0(r),a=M0(l.baseId,n),c=N0(l.baseId,n),p=n===l.value;return x.jsx(x_,{asChild:!0,...i,focusable:!s,active:p,children:x.jsx(Na.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":c,"data-state":p?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:a,...o,ref:t,onMouseDown:J(e.onMouseDown,u=>{!s&&u.button===0&&u.ctrlKey===!1?l.onValueChange(n):u.preventDefault()}),onKeyDown:J(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&l.onValueChange(n)}),onFocus:J(e.onFocus,()=>{const u=l.activationMode!=="manual";!p&&!s&&u&&l.onValueChange(n)})})})});L0.displayName=T0;var A0="TabsContent",D0=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:s,children:o,...l}=e,i=bd(A0,r),a=M0(i.baseId,n),c=N0(i.baseId,n),p=n===i.value,u=g.useRef(p);return g.useEffect(()=>{const v=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(v)},[]),x.jsx(Qe,{present:s||p,children:({present:v})=>x.jsx(Na.div,{"data-state":p?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":a,hidden:!v,id:c,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:u.current?"0s":void 0},children:v&&o})})});D0.displayName=A0;function M0(e,t){return`${e}-trigger-${t}`}function N0(e,t){return`${e}-content-${t}`}var I0=P0,O0=L0,j0=D0;const ND=g.forwardRef(({className:e,...t},r)=>x.jsx(I0,{ref:r,className:re("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));ND.displayName=I0.displayName;const ID=g.forwardRef(({className:e,...t},r)=>x.jsx(O0,{ref:r,className:re("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 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-primary/10 data-[state=active]:text-primary data-[state=active]:shadow-sm",e),...t}));ID.displayName=O0.displayName;const OD=g.forwardRef(({className:e,...t},r)=>x.jsx(j0,{ref:r,className:re("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));OD.displayName=j0.displayName;const jD=g.forwardRef(({className:e,...t},r)=>x.jsx("textarea",{className:re("flex min-h-[60px] w-full rounded-md border border-transparent bg-input px-3 py-2 text-base placeholder:text-muted-foreground/50 placeholder:font-light focus-visible:outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...t}));jD.displayName="Textarea";function BD(e,t=[]){let r=[];function n(o,l){const i=g.createContext(l),a=r.length;r=[...r,l];const c=u=>{var h;const{scope:v,children:y,...w}=u,_=((h=v==null?void 0:v[e])==null?void 0:h[a])||i,m=g.useMemo(()=>w,Object.values(w));return x.jsx(_.Provider,{value:m,children:y})};c.displayName=o+"Provider";function p(u,v){var _;const y=((_=v==null?void 0:v[e])==null?void 0:_[a])||i,w=g.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,p]}const s=()=>{const o=r.map(l=>g.createContext(l));return function(i){const a=(i==null?void 0:i[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,$D(s,...t)]}function $D(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((i,{useScope:a,scopeName:c})=>{const u=a(o)[`__scope${c}`];return{...i,...u}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function FD(e){const t=HD(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(zD);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function HD(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=VD(s),i=UD(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var B0=Symbol("radix.slottable");function WD(e){const t=({children:r})=>x.jsx(x.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=B0,t}function zD(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===B0}function UD(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function VD(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var KD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],GD=KD.reduce((e,t)=>{const r=FD(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),[Oa]=BD("Tooltip",[Mr]),Ed=Mr(),qD="TooltipProvider",Hf="tooltip.open",[uN,$0]=Oa(qD),F0="Tooltip",[dN,Si]=Oa(F0),Wc="TooltipTrigger",XD=g.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Si(Wc,r),o=$0(Wc,r),l=Ed(r),i=g.useRef(null),a=le(t,i,s.onTriggerChange),c=g.useRef(!1),p=g.useRef(!1),u=g.useCallback(()=>c.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),x.jsx(vi,{asChild:!0,...l,children:x.jsx(GD.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:a,onPointerMove:J(e.onPointerMove,v=>{v.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),p.current=!0)}),onPointerLeave:J(e.onPointerLeave,()=>{s.onTriggerLeave(),p.current=!1}),onPointerDown:J(e.onPointerDown,()=>{s.open&&s.onClose(),c.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:J(e.onFocus,()=>{c.current||s.onOpen()}),onBlur:J(e.onBlur,s.onClose),onClick:J(e.onClick,s.onClose)})})});XD.displayName=Wc;var kd="TooltipPortal",[YD,QD]=Oa(kd,{forceMount:void 0}),H0=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:s}=e,o=Si(kd,t);return x.jsx(YD,{scope:t,forceMount:r,children:x.jsx(Qe,{present:r||o.open,children:x.jsx(Zn,{asChild:!0,container:s,children:n})})})};H0.displayName=kd;var Gn="TooltipContent",W0=g.forwardRef((e,t)=>{const r=QD(Gn,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,l=Si(Gn,e.__scopeTooltip);return x.jsx(Qe,{present:n||l.open,children:l.disableHoverableContent?x.jsx(z0,{side:s,...o,ref:t}):x.jsx(JD,{side:s,...o,ref:t})})}),JD=g.forwardRef((e,t)=>{const r=Si(Gn,e.__scopeTooltip),n=$0(Gn,e.__scopeTooltip),s=g.useRef(null),o=le(t,s),[l,i]=g.useState(null),{trigger:a,onClose:c}=r,p=s.current,{onPointerInTransitChange:u}=n,v=g.useCallback(()=>{i(null),u(!1)},[u]),y=g.useCallback((w,_)=>{const m=w.currentTarget,h={x:w.clientX,y:w.clientY},d=nM(h,m.getBoundingClientRect()),f=sM(h,d),S=iM(_.getBoundingClientRect()),E=aM([...f,...S]);i(E),u(!0)},[u]);return g.useEffect(()=>()=>v(),[v]),g.useEffect(()=>{if(a&&p){const w=m=>y(m,p),_=m=>y(m,a);return a.addEventListener("pointerleave",w),p.addEventListener("pointerleave",_),()=>{a.removeEventListener("pointerleave",w),p.removeEventListener("pointerleave",_)}}},[a,p,y,v]),g.useEffect(()=>{if(l){const w=_=>{const m=_.target,h={x:_.clientX,y:_.clientY},d=(a==null?void 0:a.contains(m))||(p==null?void 0:p.contains(m)),f=!oM(h,l);d?v():f&&(v(),c())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[a,p,l,c,v]),x.jsx(z0,{...e,ref:o})}),[ZD,eM]=Oa(F0,{isInside:!1}),tM=WD("TooltipContent"),z0=g.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:l,...i}=e,a=Si(Gn,r),c=Ed(r),{onClose:p}=a;return g.useEffect(()=>(document.addEventListener(Hf,p),()=>document.removeEventListener(Hf,p)),[p]),g.useEffect(()=>{if(a.trigger){const u=v=>{const y=v.target;y!=null&&y.contains(a.trigger)&&p()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[a.trigger,p]),x.jsx(Jn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u=>u.preventDefault(),onDismiss:p,children:x.jsxs(Ea,{"data-state":a.stateAttribute,...c,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[x.jsx(tM,{children:n}),x.jsx(ZD,{scope:r,isInside:!0,children:x.jsx(fA,{id:a.contentId,role:"tooltip",children:s||n})})]})})});W0.displayName=Gn;var U0="TooltipArrow",rM=g.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Ed(r);return eM(U0,r).isInside?null:x.jsx(ka,{...s,...n,ref:t})});rM.displayName=U0;function nM(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function sM(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function iM(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function oM(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const i=t[o],a=t[l],c=i.x,p=i.y,u=a.x,v=a.y;p>n!=v>n&&r<(u-c)*(n-p)/(v-p)+c&&(s=!s)}return s}function aM(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),lM(t)}function lM(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const o=t[t.length-1],l=t[t.length-2];if((o.x-l.x)*(s.y-l.y)>=(o.y-l.y)*(s.x-l.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const o=r[r.length-1],l=r[r.length-2];if((o.x-l.x)*(s.y-l.y)>=(o.y-l.y)*(s.x-l.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var cM=H0,V0=W0;const uM=g.forwardRef(({className:e,sideOffset:t=4,...r},n)=>x.jsx(cM,{children:x.jsx(V0,{ref:n,sideOffset:t,className:re("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...r})}));uM.displayName=V0.displayName;function dM({message:e="Loading...",className:t,fullPage:r=!1}){return x.jsxs("div",{className:re("flex flex-col items-center gap-3 text-muted-foreground",r?"fixed inset-0 z-50 justify-center bg-background":"absolute inset-0 justify-center",t),children:[x.jsx(ob,{className:"h-8 w-8 animate-spin text-primary"}),e&&x.jsx("p",{className:"text-sm",children:e})]})}function hM(){const{setTheme:e,resolvedTheme:t}=kC();return x.jsxs(Zv,{variant:"ghost",size:"icon",className:"relative h-8 w-8",onClick:()=>e(t==="dark"?"light":"dark"),children:[x.jsx(bb,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),x.jsx(ub,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),x.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}const fM=()=>x.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[x.jsx("path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"}),x.jsx("path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"}),x.jsx("path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"}),x.jsx("path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"})]});function Rd(){return x.jsxs("span",{className:"logo",children:[x.jsx("span",{className:"logo-icon",children:x.jsx(fM,{})}),x.jsx("span",{className:"logo-text",children:"LaunchPod"})]})}const pM=()=>x.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:x.jsx("polyline",{points:"20 6 9 17 4 12"})}),mM=["Automated security scanning","GitHub-native CI/CD integration","Team collaboration built in"];function vM(){return x.jsxs("div",{className:"brand-panel auth-gradient",children:[x.jsx("div",{className:"auth-blob auth-blob--1"}),x.jsx("div",{className:"auth-blob auth-blob--2"}),x.jsx("div",{className:"auth-blob auth-blob--3"}),x.jsx(Rd,{}),x.jsxs("div",{className:"brand-content",children:[x.jsx("h1",{children:"Ship secure software, faster."}),x.jsx("ul",{className:"feature-list",children:mM.map(e=>x.jsxs("li",{children:[x.jsx(pM,{}),x.jsx("span",{children:e})]},e))})]}),x.jsx("p",{className:"brand-footer",children:"Trusted by development teams"})]})}const gM=()=>x.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[x.jsx("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),x.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),_M=()=>x.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[x.jsx("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),x.jsx("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),x.jsx("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),x.jsx("path",{d:"m2 2 20 20"})]});function yM({onSuccess:e}){const[t,r]=g.useState(""),[n,s]=g.useState(!1),[o,l]=g.useState(""),[i,a]=g.useState(!1),c=async p=>{p.preventDefault(),l(""),a(!0);try{const v=await(await fetch("/api/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t.trim()})})).json();v.success?e():l(v.error||"Invalid token")}catch{l("Connection failed")}finally{a(!1)}};return x.jsxs("div",{className:"auth-layout",children:[x.jsx(vM,{}),x.jsx("div",{className:"form-panel",children:x.jsxs("div",{className:"form-container",children:[x.jsx("div",{className:"mobile-logo",children:x.jsx(Rd,{})}),x.jsxs("div",{className:"form-header",children:[x.jsx("h2",{children:"Connect your pod"}),x.jsx("p",{children:"Enter your MCP runner token to authenticate"})]}),o&&x.jsx("div",{className:"error-box",children:o}),x.jsxs("form",{onSubmit:c,children:[x.jsxs("div",{className:"form-group",children:[x.jsx("label",{htmlFor:"token",children:"MCP Runner Token"}),x.jsxs("div",{className:"input-wrapper",children:[x.jsx("input",{id:"token",className:"input input--with-toggle",type:n?"text":"password",placeholder:"Paste your MCP runner token",required:!0,autoComplete:"off",value:t,onChange:p=>r(p.target.value)}),x.jsx("button",{type:"button",className:"toggle-visibility",onClick:()=>s(!n),tabIndex:-1,children:n?x.jsx(_M,{}):x.jsx(gM,{})})]})]}),x.jsx("button",{type:"submit",className:"btn btn--primary btn--lg",disabled:i,children:i?"Connecting...":"Connect"})]}),x.jsx("p",{className:"help-text",children:"Find your MCP runner token in the LaunchSecure dashboard under Pipeline Settings."})]})})]})}const SM=5,wM=1e3,xM=3e4;function Pd({onMessage:e}){const[t,r]=g.useState("disconnected"),[n,s]=g.useState(null),o=g.useRef(null),l=g.useRef(0),i=g.useRef(null),a=g.useRef(e);a.current=e;const c=g.useCallback(p=>{const u=o.current;u&&u.readyState===WebSocket.OPEN&&u.send(JSON.stringify(p))},[]);return g.useEffect(()=>{let p=!1,u=null;function v(){if(p)return;r("connecting");const w=location.protocol==="https:"?"wss:":"ws:",_=new WebSocket(`${w}//${location.host}/terminal/ws`);o.current=_,_.onopen=()=>{if(p){_.close();return}l.current=0,r("connected"),i.current=setInterval(()=>{_.readyState===WebSocket.OPEN&&_.send(JSON.stringify({type:"ping"}))},xM)},_.onmessage=m=>{if(p)return;const h=JSON.parse(m.data);h.type==="connected"&&s(h.connectionId),a.current(h)},_.onclose=m=>{if(!p&&(y(),r("disconnected"),!m.wasClean&&l.current<SM)){const h=wM*Math.pow(2,l.current);l.current+=1,u=setTimeout(v,h)}},_.onerror=()=>{}}function y(){i.current&&(clearInterval(i.current),i.current=null)}return v(),()=>{var w;p=!0,y(),u&&clearTimeout(u),(w=o.current)==null||w.close(),o.current=null}},[]),{status:t,connectionId:n,send:c}}function CM(){return x.jsxs("header",{className:"sticky top-0 z-40 flex h-[var(--header-height)] items-center border-b bg-background/80 backdrop-blur-md px-4 shadow-sm",children:[x.jsx(Rd,{}),x.jsx("div",{className:"ml-auto flex items-center gap-2",children:x.jsx(hM,{})})]})}const qi="sidebar-nav-item active relative flex items-center gap-3 overflow-hidden rounded-lg px-3 py-1.5 text-sm bg-gradient-to-r from-sidebar-primary/20 via-transparent via-80% to-transparent font-medium text-sidebar-foreground before:absolute before:left-0 before:top-0 before:h-full before:w-[3px] before:rounded-full before:bg-sidebar-primary",vs="sidebar-nav-item relative flex w-full items-center gap-3 overflow-hidden rounded-lg px-3 py-1.5 text-sm font-normal text-sidebar-muted-foreground transition-colors duration-200 hover:text-sidebar-foreground bg-transparent border-none cursor-pointer";function bM({onLogout:e,terminalAvailable:t,activePage:r="dashboard",onNavigate:n}){return x.jsxs("aside",{className:"hidden lg:flex lg:flex-col w-[var(--sidebar-width)] sidebar-gradient",children:[x.jsx("nav",{className:"flex-1 overflow-y-auto px-3 py-4",children:x.jsxs("ul",{className:"space-y-1",children:[x.jsx("li",{children:x.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n("dashboard"),className:r==="dashboard"?qi:vs,children:[x.jsx(sb,{className:"h-4 w-4 shrink-0"}),"Dashboard"]})}),t&&x.jsx("li",{children:x.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n("terminal"),className:r==="terminal"?qi:vs,children:[x.jsx(kb,{className:"h-4 w-4 shrink-0"}),"Terminal"]})}),x.jsx("li",{children:x.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n("settings"),className:r==="settings"?qi:vs,children:[x.jsx(xb,{className:"h-4 w-4 shrink-0"}),"Settings"]})}),x.jsx("li",{children:x.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n("repair"),className:r==="repair"?qi:vs,children:[x.jsx(Lb,{className:"h-4 w-4 shrink-0"}),"Repair"]})})]})}),x.jsx("div",{className:"border-t border-sidebar-border px-3 py-3",children:x.jsxs("button",{type:"button",onClick:e,className:vs,children:[x.jsx(lb,{className:"h-4 w-4 shrink-0"}),"Disconnect"]})})]})}function qo(e){return e.toLowerCase()}function EM(e){const t=new Map;for(const r of e){const n=t.get(r.ph);n?n.push(r):t.set(r.ph,[r])}return t}function K0(e){return e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function kM(e){return e==="script_pod"?"LOCAL":e==="script"?"SCRIPT":"LLM"}function Td({status:e}){return x.jsx("span",{className:`agent-status-dot agent-status-dot--${qo(e)}`})}function RM({agent:e,status:t,selected:r,dim:n,onClick:s}){const o=["pipeline-compact-item",r&&"pipeline-compact-item--selected",n&&"pipeline-compact-item--dim"].filter(Boolean).join(" ");return x.jsxs("button",{type:"button",className:o,onClick:s,children:[x.jsx(Td,{status:t}),x.jsx("span",{className:"pipeline-compact-name",children:e.nm})]})}function Wf({agents:e,agentStatuses:t,selectedId:r,onSelect:n,nextUpIds:s}){const o=EM(e),l=Array.from(o.keys()).sort((i,a)=>i-a);return e.length===0?x.jsx("div",{className:"pipeline-empty-state",children:"None yet"}):x.jsx(x.Fragment,{children:l.map(i=>x.jsxs("div",{className:"pipeline-phase-group",children:[x.jsxs("div",{className:"pipeline-phase-label",children:["Phase ",i]}),o.get(i).map(a=>{var p;const c=t!=null&&t[a.id]?qo(((p=t[a.id])==null?void 0:p.status)??"pending"):"pending";return x.jsx(RM,{agent:a,status:c,selected:r===a.id,dim:s?!s.has(a.id):!1,onClick:()=>n(a.id)},a.id)})]},i))})}function zf({agent:e,status:t,triggeredAt:r,completedAt:n,needsAttention:s,previews:o,onOpenTerminal:l,podProgressState:i,onResolveIntervention:a,interventions:c}){const[p,u]=g.useState(0);let v=i;if(e.rn==="script_pod"&&!v){const h=c==null?void 0:c.find(d=>d.agent_id===e.id&&d.status==="pending");h&&(v={messages:[{text:h.message,level:"info",ts:Date.now()}],templateMatch:null})}const y=e.rn==="script_pod"&&v,w=o&&o.length>0?Math.min(p,o.length-1):0,_=o==null?void 0:o[w],m=e.gr==="per_unit"&&o&&o.length>1;return x.jsxs("div",{className:`pipeline-detail-card pipeline-detail-card--${t}`,children:[x.jsxs("div",{className:"pipeline-detail-left",children:[x.jsxs("div",{className:"pipeline-detail-header",children:[x.jsx(Td,{status:t}),x.jsx("span",{className:"pipeline-detail-name",children:e.nm}),s&&x.jsx("span",{className:"pipeline-attention-dot",title:"Terminal may need input"})]}),x.jsxs("div",{className:"pipeline-detail-meta",children:[x.jsx("span",{className:"pipeline-detail-id",children:e.id}),x.jsx("span",{className:"pipeline-detail-runner",children:kM(e.rn)})]}),x.jsxs("div",{className:"pipeline-detail-badges",children:[x.jsx("span",{className:"agent-badge agent-badge--ia",children:e.ia}),x.jsx("span",{className:"agent-badge agent-badge--gr",children:e.gr==="per_unit"?"per-unit":e.gr})]}),x.jsxs("div",{className:"pipeline-detail-info",children:[x.jsxs("span",{children:["Phase ",e.ph]}),r&&x.jsxs("span",{children:["Started: ",new Date(r).toLocaleTimeString()]}),n&&x.jsxs("span",{children:["Completed: ",new Date(n).toLocaleTimeString()]})]})]}),x.jsxs("div",{className:"pipeline-detail-right",children:[m&&x.jsx("div",{className:"pipeline-unit-tabs",children:o.map((h,d)=>x.jsx("button",{type:"button",className:`pipeline-unit-tab${d===w?" pipeline-unit-tab--active":""}`,onClick:()=>u(d),children:h.unitId||`unit-${d}`},h.sessionId))}),y?x.jsx(TM,{podState:v}):_!=null&&_.text?x.jsx("pre",{className:"pipeline-preview-text",children:_.text}):x.jsx("div",{className:"pipeline-preview-empty",children:"No output yet"}),e.rn==="script_pod"&&a&&(c==null?void 0:c.filter(h=>h.agent_id===e.id&&h.status==="pending").map(h=>{const{runText:d,skipText:f}=G0(h);return x.jsxs("div",{className:"pipeline-intervention-actions",style:{marginTop:"8px"},children:[x.jsx("button",{type:"button",onClick:()=>a(h.id,"continue"),className:"pipeline-intervention-btn pipeline-intervention-btn--run",children:d}),x.jsx("button",{type:"button",onClick:()=>a(h.id,"skip"),className:"pipeline-intervention-btn pipeline-intervention-btn--skip",children:f})]},h.id)})),!y&&(_==null?void 0:_.sessionId)&&l&&x.jsx("button",{type:"button",className:"pipeline-open-terminal-btn",title:"Open terminal",onClick:()=>l(_.sessionId),children:x.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[x.jsx("polyline",{points:"4 17 10 11 4 5"}),x.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})})]})]})}function G0(e){if(e.agent_id==="workspace_setup")return{label:"Workspace Setup",runText:"Use Template",skipText:"Custom Build"};switch(e.type.toLowerCase()){case"checkpoint":return{label:"Checkpoint",runText:"Continue",skipText:"Skip"};case"error":return{label:"Error",runText:"Retry",skipText:"Skip"};case"loop_escalation":return{label:"Loop Escalation",runText:"Continue",skipText:"Stop"};default:return{label:"Review Gate",runText:"Run",skipText:"Skip"}}}function PM({intervention:e,onResolve:t}){const[r,n]=g.useState(!1),{label:s,runText:o,skipText:l}=G0(e),i=a=>{n(!0),t(e.id,a)};return x.jsxs("div",{className:"pipeline-intervention-card",children:[x.jsx("div",{className:"pipeline-intervention-label",children:s}),x.jsx("div",{className:"pipeline-intervention-agent",children:K0(e.agent_id)}),e.message&&x.jsx("p",{className:"pipeline-intervention-msg",children:e.message}),x.jsxs("div",{className:"pipeline-intervention-actions",children:[x.jsx("button",{type:"button",disabled:r,onClick:()=>i("continue"),className:"pipeline-intervention-btn pipeline-intervention-btn--run",children:r?"...":o}),x.jsx("button",{type:"button",disabled:r,onClick:()=>i("skip"),className:"pipeline-intervention-btn pipeline-intervention-btn--skip",children:r?"...":l})]})]})}function TM({podState:e}){const{messages:t}=e;return x.jsx("div",{className:"pod-progress-panel",children:x.jsx("div",{className:"pod-progress-log",children:t.map((r,n)=>x.jsx("div",{className:`pod-progress-entry pod-progress-entry--${r.level}`,children:r.text},n))})})}function LM({agentId:e,agentName:t,error:r}){const[n,s]=g.useState(!1);return x.jsxs("div",{className:"pipeline-detail-card pipeline-detail-card--failed",children:[x.jsxs("div",{className:"pipeline-detail-left",children:[x.jsxs("div",{className:"pipeline-detail-header",children:[x.jsx(Td,{status:"failed"}),x.jsx("span",{className:"pipeline-detail-name",children:t??K0(e)})]}),x.jsx("div",{className:"pipeline-detail-meta",children:x.jsx("span",{className:"pipeline-detail-id",children:e})}),x.jsx("div",{style:{marginTop:"0.5rem"},children:x.jsx("span",{className:"text-red-400 text-xs font-medium",children:"Node failed to start"})}),x.jsx("button",{type:"button",onClick:()=>s(!n),className:"inline-flex items-center gap-1 mt-2 px-2 py-1 rounded text-xs bg-zinc-700 hover:bg-zinc-600 text-zinc-200 transition-colors",children:n?"Hide Log":"Show Log"})]}),x.jsx("div",{className:"pipeline-detail-right",children:n?x.jsx("pre",{className:"pipeline-preview-text",style:{color:"var(--color-red-300, #fca5a5)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:r}):x.jsx("div",{className:"pipeline-preview-empty",children:'Click "Show Log" for details'})})]})}function AM({data:e,agentStatuses:t,interventions:r,onResolveIntervention:n,stalled:s,onPoke:o,attentionAgentIds:l,sessionPreviews:i,onOpenTerminal:a,podProgressStates:c,runStatus:p,nodeErrors:u}){const[v,y]=g.useState(null),w=T=>y(M=>M===T?null:T),_=e.ag??[],m=new Map(_.map(T=>[T.id,T])),h=[],d=[],f=[];for(const T of _){const M=t==null?void 0:t[T.id],j=M?qo(M.status):"pending";j==="completed"||j==="failed"?h.push(T):j==="in_progress"?d.push(T):f.push(T)}const S=new Set;if(f.length>0){const T=Math.min(...f.map(M=>M.ph));for(const M of f)M.ph===T&&S.add(M.id)}const E=new Set(_.filter(T=>T.rn==="script_pod").map(T=>T.id)),k=(r??[]).filter(T=>T.status==="pending"&&!E.has(T.agent_id)),b=v?m.get(v):null,C=v?t==null?void 0:t[v]:null,P=C?qo(C.status):"pending";return x.jsxs("div",{className:"pipeline-dashboard",children:[x.jsxs("div",{className:"pipeline-col pipeline-col--left",children:[x.jsx("div",{className:"pipeline-col-header",children:"Completed"}),x.jsx("div",{className:"pipeline-col-body",children:x.jsx(Wf,{agents:h,agentStatuses:t,selectedId:v,onSelect:w})})]}),x.jsxs("div",{className:"pipeline-col pipeline-col--center",children:[x.jsx("div",{className:"pipeline-col-header",children:"Active"}),x.jsxs("div",{className:"pipeline-col-body",children:[n&&k.map(T=>x.jsx(PM,{intervention:T,onResolve:n},T.id)),b&&!d.some(T=>T.id===v)&&x.jsx(zf,{agent:b,status:P,triggeredAt:C==null?void 0:C.triggered_at,completedAt:C==null?void 0:C.completed_at,needsAttention:l==null?void 0:l.has(b.id),previews:i==null?void 0:i[b.id],onOpenTerminal:a,podProgressState:c==null?void 0:c[b.id],onResolveIntervention:n,interventions:r}),d.map(T=>{const M=t==null?void 0:t[T.id];return x.jsx(zf,{agent:T,status:"in_progress",triggeredAt:M==null?void 0:M.triggered_at,completedAt:M==null?void 0:M.completed_at,needsAttention:l==null?void 0:l.has(T.id),previews:i==null?void 0:i[T.id],onOpenTerminal:a,podProgressState:c==null?void 0:c[T.id],onResolveIntervention:n,interventions:r},T.id)}),u&&Object.entries(u).map(([T,M])=>{const j=m.get(T);return x.jsx(LM,{agentId:T,agentName:j==null?void 0:j.nm,error:M},`err-${T}`)}),!b&&d.length===0&&k.length===0&&Object.keys(u??{}).length===0&&(p==="completed"?x.jsxs("div",{className:"pipeline-empty-state pipeline-empty-state--completed",children:[x.jsx("span",{className:"agent-status-dot agent-status-dot--completed"}),x.jsx("span",{children:"Pipeline Complete"})]}):p==="paused"?x.jsxs("div",{className:"pipeline-empty-state",children:[x.jsx("span",{className:"agent-status-dot agent-status-dot--pending"}),x.jsx("span",{children:"Pipeline Paused"})]}):x.jsxs("div",{className:"pipeline-empty-state",children:[x.jsx("span",{className:"agent-status-dot agent-status-dot--in_progress"}),x.jsx("span",{children:"Waiting for next node..."})]}))]})]}),x.jsxs("div",{className:"pipeline-col pipeline-col--right",children:[x.jsx("div",{className:"pipeline-col-header",children:"Upcoming"}),x.jsx("div",{className:"pipeline-col-body",children:x.jsx(Wf,{agents:f,agentStatuses:t,selectedId:v,onSelect:w,nextUpIds:S})})]})]})}let Uf=!1,Xi=null;function DM({send:e,xtermRef:t,defaultAgent:r,autoSessionId:n}){const[s,o]=g.useState(null),[l,i]=g.useState(!1),a=g.useRef(r);a.current=r;const c=g.useRef(n);c.current=n;function p(w){e({type:w==="claude"?"start_claude":w==="codex"?"start_codex":"start_agent"})}const u=g.useCallback((w,_)=>{e({type:w==="claude"?"start_claude":w==="codex"?"start_codex":"start_agent",options:_})},[e]),v=g.useCallback(()=>{e({type:"stop"})},[e]),y=g.useCallback(w=>{var _,m,h;switch(w.type){case"connected":{if(Uf)break;Uf=!0;const d=c.current;if(d){o(d),e({type:"join_session",sessionId:d});break}Xi==null||Xi.abort();const f=new AbortController;Xi=f,fetch("/terminal/api/sessions/list",{signal:f.signal}).then(S=>S.json()).then(S=>{const E=S.sessions??[];if(E.length>0){const k=E[0];o(k.id),i(k.active),e({type:"join_session",sessionId:k.id}),!k.active&&a.current&&setTimeout(()=>p(a.current),100)}else e({type:"create_session",name:"Session 1"})}).catch(()=>{f.signal.aborted||e({type:"create_session",name:"Session 1"})});break}case"session_created":{o(w.sessionId),i(!1);const d=a.current;d&&p(d);break}case"session_joined":{if(o(w.sessionId),i(w.active),(_=t.current)==null||_.clear(),(m=w.outputBuffer)!=null&&m.length)for(const d of w.outputBuffer)(h=t.current)==null||h.write(d.replace(/\x1b\[\[?[IO]/g,""));break}case"session_left":case"session_deleted":break;case"claude_started":case"codex_started":case"agent_started":i(!0);break;case"claude_stopped":case"codex_stopped":case"agent_stopped":i(!1);break;case"exit":i(!1);break}},[e,t]);return{sessionId:s,agentRunning:l,handleMessage:y,startAgent:u,stopAgent:v}}const Vf=1e4,MM=["Plan mode is active","you MUST NOT make any edits","present your plan by calling the ExitPlanMode tool","Starting plan mode"],NM=["User has approved your plan","You can now start coding","Plan mode exited","Exiting plan mode"],IM=[/## Implementation Plan:/,/### \d+\. /,/## Plan:/,/### Plan Overview/,/## Proposed Solution:/];function Kf(e){return e.replace(/\x1b\[[0-9;]*m/g,"").replace(/\x1b\[[0-9]*[A-Za-z]/g,"")}function q0(){const[e,t]=g.useState(null),[r,n]=g.useState(!1),s=g.useRef([]),o=g.useRef(!1),l=g.useCallback((p=5e4)=>{const u=s.current.join("");return Kf(u).slice(-p)},[]),i=g.useCallback(p=>{let u=null;const v=p.match(/## Implementation Plan:[\s\S]*?(?=(?:User has approved|Exit plan mode|[$>]|^[a-z]+@))/im);if(v&&(u=v[0]),!u){const y=p.match(/##[^#].*?Plan.*?:[\s\S]*?(?:###.*?[\s\S]*?){2,}(?=(?:User has approved|Exit plan mode|[$>]|^[a-z]+@))/im);y&&(u=y[0])}if(!u){const w=p.slice(-5e3).match(/(?:##|Plan:)[\s\S]*?(?:###[\s\S]*?){1,}/);w&&(u=w[0])}return u?(u=Kf(u).replace(/\r\n/g,`
|
|
269
|
+
Defaulting to \`null\`.`}var Dy=Py,qL=Ly;const XL=g.forwardRef(({className:e,value:t,...r},n)=>x.jsx(Dy,{ref:n,className:re("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...r,children:x.jsx(qL,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));XL.displayName=Dy.displayName;function $f(e,[t,r]){return Math.min(r,Math.max(t,e))}function YL(e,t=[]){let r=[];function n(o,l){const i=g.createContext(l),a=r.length;r=[...r,l];const c=u=>{var h;const{scope:v,children:y,...w}=u,_=((h=v==null?void 0:v[e])==null?void 0:h[a])||i,m=g.useMemo(()=>w,Object.values(w));return x.jsx(_.Provider,{value:m,children:y})};c.displayName=o+"Provider";function p(u,v){var _;const y=((_=v==null?void 0:v[e])==null?void 0:_[a])||i,w=g.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,p]}const s=()=>{const o=r.map(l=>g.createContext(l));return function(i){const a=(i==null?void 0:i[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,QL(s,...t)]}function QL(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((i,{useScope:a,scopeName:c})=>{const u=a(o)[`__scope${c}`];return{...i,...u}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function My(e){const t=JL(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(eA);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function JL(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=rA(s),i=tA(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ZL=Symbol("radix.slottable");function eA(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ZL}function tA(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function rA(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var nA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ct=nA.reduce((e,t)=>{const r=My(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function sA(e){const t=iA(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(aA);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function iA(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=cA(s),i=lA(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var oA=Symbol("radix.slottable");function aA(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===oA}function lA(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function cA(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var uA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],dA=uA.reduce((e,t)=>{const r=sA(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ny=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"}),hA="VisuallyHidden",Iy=g.forwardRef((e,t)=>x.jsx(dA.span,{...e,ref:t,style:{...Ny,...e.style}}));Iy.displayName=hA;var fA=Iy,pA=[" ","Enter","ArrowUp","ArrowDown"],mA=[" ","Enter"],Aa="Select",[wd,Da,vA]=rd(Aa),[rs]=YL(Aa,[vA,Mr]),xd=Mr(),[lN,Ir]=rs(Aa),[cN,gA]=rs(Aa),Oy="SelectTrigger",jy=g.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=xd(r),l=Ir(Oy,r),i=l.disabled||n,a=le(t,l.onTriggerChange),c=Da(r),p=g.useRef("touch"),[u,v,y]=i0(_=>{const m=c().filter(f=>!f.disabled),h=m.find(f=>f.value===l.value),d=o0(m,_,h);d!==void 0&&l.onValueChange(d.value)}),w=_=>{i||(l.onOpenChange(!0),y()),_&&(l.triggerPointerDownPosRef.current={x:Math.round(_.pageX),y:Math.round(_.pageY)})};return x.jsx(vi,{asChild:!0,...o,children:x.jsx(ct.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":s0(l.value)?"":void 0,...s,ref:a,onClick:J(s.onClick,_=>{_.currentTarget.focus(),p.current!=="mouse"&&w(_)}),onPointerDown:J(s.onPointerDown,_=>{p.current=_.pointerType;const m=_.target;m.hasPointerCapture(_.pointerId)&&m.releasePointerCapture(_.pointerId),_.button===0&&_.ctrlKey===!1&&_.pointerType==="mouse"&&(w(_),_.preventDefault())}),onKeyDown:J(s.onKeyDown,_=>{const m=u.current!=="";!(_.ctrlKey||_.altKey||_.metaKey)&&_.key.length===1&&v(_.key),!(m&&_.key===" ")&&pA.includes(_.key)&&(w(),_.preventDefault())})})})});jy.displayName=Oy;var By="SelectValue",_A=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:l="",...i}=e,a=Ir(By,r),{onValueNodeHasChildrenChange:c}=a,p=o!==void 0,u=le(t,a.onValueNodeChange);return Le(()=>{c(p)},[c,p]),x.jsx(ct.span,{...i,ref:u,style:{pointerEvents:"none"},children:s0(a.value)?x.jsx(x.Fragment,{children:l}):o})});_A.displayName=By;var yA="SelectIcon",$y=g.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return x.jsx(ct.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});$y.displayName=yA;var SA="SelectPortal",Fy=e=>x.jsx(Zn,{asChild:!0,...e});Fy.displayName=SA;var rn="SelectContent",Hy=g.forwardRef((e,t)=>{const r=Ir(rn,e.__scopeSelect),[n,s]=g.useState();if(Le(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?on.createPortal(x.jsx(Wy,{scope:e.__scopeSelect,children:x.jsx(wd.Slot,{scope:e.__scopeSelect,children:x.jsx("div",{children:e.children})})}),o):null}return x.jsx(zy,{...e,ref:t})});Hy.displayName=rn;var St=10,[Wy,Or]=rs(rn),wA="SelectContentImpl",xA=My("SelectContent.RemoveScroll"),zy=g.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:l,side:i,sideOffset:a,align:c,alignOffset:p,arrowPadding:u,collisionBoundary:v,collisionPadding:y,sticky:w,hideWhenDetached:_,avoidCollisions:m,...h}=e,d=Ir(rn,r),[f,S]=g.useState(null),[E,k]=g.useState(null),b=le(t,O=>S(O)),[C,P]=g.useState(null),[T,M]=g.useState(null),j=Da(r),[N,$]=g.useState(!1),V=g.useRef(!1);g.useEffect(()=>{if(f)return va(f)},[f]),pa();const K=g.useCallback(O=>{const[A,...W]=j().map(X=>X.ref.current),[H]=W.slice(-1),Y=document.activeElement;for(const X of O)if(X===Y||(X==null||X.scrollIntoView({block:"nearest"}),X===A&&E&&(E.scrollTop=0),X===H&&E&&(E.scrollTop=E.scrollHeight),X==null||X.focus(),document.activeElement!==Y))return},[j,E]),q=g.useCallback(()=>K([C,f]),[K,C,f]);g.useEffect(()=>{N&&q()},[N,q]);const{onOpenChange:B,triggerPointerDownPosRef:R}=d;g.useEffect(()=>{if(f){let O={x:0,y:0};const A=H=>{var Y,X;O={x:Math.abs(Math.round(H.pageX)-(((Y=R.current)==null?void 0:Y.x)??0)),y:Math.abs(Math.round(H.pageY)-(((X=R.current)==null?void 0:X.y)??0))}},W=H=>{O.x<=10&&O.y<=10?H.preventDefault():f.contains(H.target)||B(!1),document.removeEventListener("pointermove",A),R.current=null};return R.current!==null&&(document.addEventListener("pointermove",A),document.addEventListener("pointerup",W,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",A),document.removeEventListener("pointerup",W,{capture:!0})}}},[f,B,R]),g.useEffect(()=>{const O=()=>B(!1);return window.addEventListener("blur",O),window.addEventListener("resize",O),()=>{window.removeEventListener("blur",O),window.removeEventListener("resize",O)}},[B]);const[L,I]=i0(O=>{const A=j().filter(Y=>!Y.disabled),W=A.find(Y=>Y.ref.current===document.activeElement),H=o0(A,O,W);H&&setTimeout(()=>H.ref.current.focus())}),D=g.useCallback((O,A,W)=>{const H=!V.current&&!W;(d.value!==void 0&&d.value===A||H)&&(P(O),H&&(V.current=!0))},[d.value]),z=g.useCallback(()=>f==null?void 0:f.focus(),[f]),F=g.useCallback((O,A,W)=>{const H=!V.current&&!W;(d.value!==void 0&&d.value===A||H)&&M(O)},[d.value]),U=n==="popper"?Oc:Uy,G=U===Oc?{side:i,sideOffset:a,align:c,alignOffset:p,arrowPadding:u,collisionBoundary:v,collisionPadding:y,sticky:w,hideWhenDetached:_,avoidCollisions:m}:{};return x.jsx(Wy,{scope:r,content:f,viewport:E,onViewportChange:k,itemRefCallback:D,selectedItem:C,onItemLeave:z,itemTextRefCallback:F,focusSelectedItem:q,selectedItemText:T,position:n,isPositioned:N,searchRef:L,children:x.jsx(di,{as:xA,allowPinchZoom:!0,children:x.jsx(ci,{asChild:!0,trapped:d.open,onMountAutoFocus:O=>{O.preventDefault()},onUnmountAutoFocus:J(s,O=>{var A;(A=d.trigger)==null||A.focus({preventScroll:!0}),O.preventDefault()}),children:x.jsx(Jn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:O=>O.preventDefault(),onDismiss:()=>d.onOpenChange(!1),children:x.jsx(U,{role:"listbox",id:d.contentId,"data-state":d.open?"open":"closed",dir:d.dir,onContextMenu:O=>O.preventDefault(),...h,...G,onPlaced:()=>$(!0),ref:b,style:{display:"flex",flexDirection:"column",outline:"none",...h.style},onKeyDown:J(h.onKeyDown,O=>{const A=O.ctrlKey||O.altKey||O.metaKey;if(O.key==="Tab"&&O.preventDefault(),!A&&O.key.length===1&&I(O.key),["ArrowUp","ArrowDown","Home","End"].includes(O.key)){let H=j().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);if(["ArrowUp","End"].includes(O.key)&&(H=H.slice().reverse()),["ArrowUp","ArrowDown"].includes(O.key)){const Y=O.target,X=H.indexOf(Y);H=H.slice(X+1)}setTimeout(()=>K(H)),O.preventDefault()}})})})})})})});zy.displayName=wA;var CA="SelectItemAlignedPosition",Uy=g.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=Ir(rn,r),l=Or(rn,r),[i,a]=g.useState(null),[c,p]=g.useState(null),u=le(t,b=>p(b)),v=Da(r),y=g.useRef(!1),w=g.useRef(!0),{viewport:_,selectedItem:m,selectedItemText:h,focusSelectedItem:d}=l,f=g.useCallback(()=>{if(o.trigger&&o.valueNode&&i&&c&&_&&m&&h){const b=o.trigger.getBoundingClientRect(),C=c.getBoundingClientRect(),P=o.valueNode.getBoundingClientRect(),T=h.getBoundingClientRect();if(o.dir!=="rtl"){const Y=T.left-C.left,X=P.left-Y,ne=b.left-X,ie=b.width+ne,de=Math.max(ie,C.width),be=window.innerWidth-St,se=$f(X,[St,Math.max(St,be-de)]);i.style.minWidth=ie+"px",i.style.left=se+"px"}else{const Y=C.right-T.right,X=window.innerWidth-P.right-Y,ne=window.innerWidth-b.right-X,ie=b.width+ne,de=Math.max(ie,C.width),be=window.innerWidth-St,se=$f(X,[St,Math.max(St,be-de)]);i.style.minWidth=ie+"px",i.style.right=se+"px"}const M=v(),j=window.innerHeight-St*2,N=_.scrollHeight,$=window.getComputedStyle(c),V=parseInt($.borderTopWidth,10),K=parseInt($.paddingTop,10),q=parseInt($.borderBottomWidth,10),B=parseInt($.paddingBottom,10),R=V+K+N+B+q,L=Math.min(m.offsetHeight*5,R),I=window.getComputedStyle(_),D=parseInt(I.paddingTop,10),z=parseInt(I.paddingBottom,10),F=b.top+b.height/2-St,U=j-F,G=m.offsetHeight/2,O=m.offsetTop+G,A=V+K+O,W=R-A;if(A<=F){const Y=M.length>0&&m===M[M.length-1].ref.current;i.style.bottom="0px";const X=c.clientHeight-_.offsetTop-_.offsetHeight,ne=Math.max(U,G+(Y?z:0)+X+q),ie=A+ne;i.style.height=ie+"px"}else{const Y=M.length>0&&m===M[0].ref.current;i.style.top="0px";const ne=Math.max(F,V+_.offsetTop+(Y?D:0)+G)+W;i.style.height=ne+"px",_.scrollTop=A-F+_.offsetTop}i.style.margin=`${St}px 0`,i.style.minHeight=L+"px",i.style.maxHeight=j+"px",n==null||n(),requestAnimationFrame(()=>y.current=!0)}},[v,o.trigger,o.valueNode,i,c,_,m,h,o.dir,n]);Le(()=>f(),[f]);const[S,E]=g.useState();Le(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const k=g.useCallback(b=>{b&&w.current===!0&&(f(),d==null||d(),w.current=!1)},[f,d]);return x.jsx(EA,{scope:r,contentWrapper:i,shouldExpandOnScrollRef:y,onScrollButtonChange:k,children:x.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:x.jsx(ct.div,{...s,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Uy.displayName=CA;var bA="SelectPopperPosition",Oc=g.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=St,...o}=e,l=xd(r);return x.jsx(Ea,{...l,...o,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...o.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)"}})});Oc.displayName=bA;var[EA,Cd]=rs(rn,{}),jc="SelectViewport",Vy=g.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=Or(jc,r),l=Cd(jc,r),i=le(t,o.onViewportChange),a=g.useRef(0);return x.jsxs(x.Fragment,{children:[x.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),x.jsx(wd.Slot,{scope:r,children:x.jsx(ct.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:J(s.onScroll,c=>{const p=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:v}=l;if(v!=null&&v.current&&u){const y=Math.abs(a.current-p.scrollTop);if(y>0){const w=window.innerHeight-St*2,_=parseFloat(u.style.minHeight),m=parseFloat(u.style.height),h=Math.max(_,m);if(h<w){const d=h+y,f=Math.min(w,d),S=d-f;u.style.height=f+"px",u.style.bottom==="0px"&&(p.scrollTop=S>0?S:0,u.style.justifyContent="flex-end")}}}a.current=p.scrollTop})})})]})});Vy.displayName=jc;var Ky="SelectGroup",[kA,RA]=rs(Ky),PA=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=st();return x.jsx(kA,{scope:r,id:s,children:x.jsx(ct.div,{role:"group","aria-labelledby":s,...n,ref:t})})});PA.displayName=Ky;var Gy="SelectLabel",qy=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=RA(Gy,r);return x.jsx(ct.div,{id:s.id,...n,ref:t})});qy.displayName=Gy;var Go="SelectItem",[TA,Xy]=rs(Go),Yy=g.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...l}=e,i=Ir(Go,r),a=Or(Go,r),c=i.value===n,[p,u]=g.useState(o??""),[v,y]=g.useState(!1),w=le(t,d=>{var f;return(f=a.itemRefCallback)==null?void 0:f.call(a,d,n,s)}),_=st(),m=g.useRef("touch"),h=()=>{s||(i.onValueChange(n),i.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return x.jsx(TA,{scope:r,value:n,disabled:s,textId:_,isSelected:c,onItemTextChange:g.useCallback(d=>{u(f=>f||((d==null?void 0:d.textContent)??"").trim())},[]),children:x.jsx(wd.ItemSlot,{scope:r,value:n,disabled:s,textValue:p,children:x.jsx(ct.div,{role:"option","aria-labelledby":_,"data-highlighted":v?"":void 0,"aria-selected":c&&v,"data-state":c?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:w,onFocus:J(l.onFocus,()=>y(!0)),onBlur:J(l.onBlur,()=>y(!1)),onClick:J(l.onClick,()=>{m.current!=="mouse"&&h()}),onPointerUp:J(l.onPointerUp,()=>{m.current==="mouse"&&h()}),onPointerDown:J(l.onPointerDown,d=>{m.current=d.pointerType}),onPointerMove:J(l.onPointerMove,d=>{var f;m.current=d.pointerType,s?(f=a.onItemLeave)==null||f.call(a):m.current==="mouse"&&d.currentTarget.focus({preventScroll:!0})}),onPointerLeave:J(l.onPointerLeave,d=>{var f;d.currentTarget===document.activeElement&&((f=a.onItemLeave)==null||f.call(a))}),onKeyDown:J(l.onKeyDown,d=>{var S;((S=a.searchRef)==null?void 0:S.current)!==""&&d.key===" "||(mA.includes(d.key)&&h(),d.key===" "&&d.preventDefault())})})})})});Yy.displayName=Go;var xs="SelectItemText",Qy=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,l=Ir(xs,r),i=Or(xs,r),a=Xy(xs,r),c=gA(xs,r),[p,u]=g.useState(null),v=le(t,h=>u(h),a.onItemTextChange,h=>{var d;return(d=i.itemTextRefCallback)==null?void 0:d.call(i,h,a.value,a.disabled)}),y=p==null?void 0:p.textContent,w=g.useMemo(()=>x.jsx("option",{value:a.value,disabled:a.disabled,children:y},a.value),[a.disabled,a.value,y]),{onNativeOptionAdd:_,onNativeOptionRemove:m}=c;return Le(()=>(_(w),()=>m(w)),[_,m,w]),x.jsxs(x.Fragment,{children:[x.jsx(ct.span,{id:a.textId,...o,ref:v}),a.isSelected&&l.valueNode&&!l.valueNodeHasChildren?on.createPortal(o.children,l.valueNode):null]})});Qy.displayName=xs;var Jy="SelectItemIndicator",Zy=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Xy(Jy,r).isSelected?x.jsx(ct.span,{"aria-hidden":!0,...n,ref:t}):null});Zy.displayName=Jy;var Bc="SelectScrollUpButton",e0=g.forwardRef((e,t)=>{const r=Or(Bc,e.__scopeSelect),n=Cd(Bc,e.__scopeSelect),[s,o]=g.useState(!1),l=le(t,n.onScrollButtonChange);return Le(()=>{if(r.viewport&&r.isPositioned){let i=function(){const c=a.scrollTop>0;o(c)};const a=r.viewport;return i(),a.addEventListener("scroll",i),()=>a.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),s?x.jsx(r0,{...e,ref:l,onAutoScroll:()=>{const{viewport:i,selectedItem:a}=r;i&&a&&(i.scrollTop=i.scrollTop-a.offsetHeight)}}):null});e0.displayName=Bc;var $c="SelectScrollDownButton",t0=g.forwardRef((e,t)=>{const r=Or($c,e.__scopeSelect),n=Cd($c,e.__scopeSelect),[s,o]=g.useState(!1),l=le(t,n.onScrollButtonChange);return Le(()=>{if(r.viewport&&r.isPositioned){let i=function(){const c=a.scrollHeight-a.clientHeight,p=Math.ceil(a.scrollTop)<c;o(p)};const a=r.viewport;return i(),a.addEventListener("scroll",i),()=>a.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),s?x.jsx(r0,{...e,ref:l,onAutoScroll:()=>{const{viewport:i,selectedItem:a}=r;i&&a&&(i.scrollTop=i.scrollTop+a.offsetHeight)}}):null});t0.displayName=$c;var r0=g.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=Or("SelectScrollButton",r),l=g.useRef(null),i=Da(r),a=g.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return g.useEffect(()=>()=>a(),[a]),Le(()=>{var p;const c=i().find(u=>u.ref.current===document.activeElement);(p=c==null?void 0:c.ref.current)==null||p.scrollIntoView({block:"nearest"})},[i]),x.jsx(ct.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:J(s.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(n,50))}),onPointerMove:J(s.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),l.current===null&&(l.current=window.setInterval(n,50))}),onPointerLeave:J(s.onPointerLeave,()=>{a()})})}),LA="SelectSeparator",n0=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return x.jsx(ct.div,{"aria-hidden":!0,...n,ref:t})});n0.displayName=LA;var Fc="SelectArrow",AA=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=xd(r),o=Ir(Fc,r),l=Or(Fc,r);return o.open&&l.position==="popper"?x.jsx(ka,{...s,...n,ref:t}):null});AA.displayName=Fc;var DA="SelectBubbleInput",MA=g.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const s=g.useRef(null),o=le(n,s),l=Ku(t);return g.useEffect(()=>{const i=s.current;if(!i)return;const a=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==t&&p){const u=new Event("change",{bubbles:!0});p.call(i,t),i.dispatchEvent(u)}},[l,t]),x.jsx(ct.select,{...r,style:{...Ny,...r.style},ref:o,defaultValue:t})});MA.displayName=DA;function s0(e){return e===""||e===void 0}function i0(e){const t=$t(e),r=g.useRef(""),n=g.useRef(0),s=g.useCallback(l=>{const i=r.current+l;t(i),function a(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>a(""),1e3))}(i)},[t]),o=g.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function o0(e,t,r){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let l=NA(e,Math.max(o,0));s.length===1&&(l=l.filter(c=>c!==r));const a=l.find(c=>c.textValue.toLowerCase().startsWith(s.toLowerCase()));return a!==r?a:void 0}function NA(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var a0=jy,IA=$y,OA=Fy,l0=Hy,jA=Vy,c0=qy,u0=Yy,BA=Qy,$A=Zy,d0=e0,h0=t0,f0=n0;const FA=g.forwardRef(({className:e,children:t,...r},n)=>x.jsxs(a0,{ref:n,className:re("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-transparent bg-input px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground/50 data-[placeholder]:font-light focus:outline-none focus:border-ring focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,x.jsx(IA,{asChild:!0,children:x.jsx(Vu,{className:"h-4 w-4 opacity-50"})})]}));FA.displayName=a0.displayName;const p0=g.forwardRef(({className:e,...t},r)=>x.jsx(d0,{ref:r,className:re("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(eb,{className:"h-4 w-4"})}));p0.displayName=d0.displayName;const m0=g.forwardRef(({className:e,...t},r)=>x.jsx(h0,{ref:r,className:re("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(Vu,{className:"h-4 w-4"})}));m0.displayName=h0.displayName;const HA=g.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>x.jsx(OA,{children:x.jsxs(l0,{ref:s,className:re("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-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 origin-[--radix-select-content-transform-origin]",r==="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:r,...n,children:[x.jsx(p0,{}),x.jsx(jA,{className:re("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),x.jsx(m0,{})]})}));HA.displayName=l0.displayName;const WA=g.forwardRef(({className:e,...t},r)=>x.jsx(c0,{ref:r,className:re("px-2 py-1.5 text-sm font-semibold",e),...t}));WA.displayName=c0.displayName;const zA=g.forwardRef(({className:e,children:t,...r},n)=>x.jsxs(u0,{ref:n,className:re("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[x.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx($A,{children:x.jsx(Uu,{className:"h-4 w-4"})})}),x.jsx(BA,{children:t})]}));zA.displayName=u0.displayName;const UA=g.forwardRef(({className:e,...t},r)=>x.jsx(f0,{ref:r,className:re("-mx-1 my-1 h-px bg-muted",e),...t}));UA.displayName=f0.displayName;var VA="Separator",Ff="horizontal",KA=["horizontal","vertical"],v0=g.forwardRef((e,t)=>{const{decorative:r,orientation:n=Ff,...s}=e,o=GA(n)?n:Ff,i=r?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return x.jsx(Ue.div,{"data-orientation":o,...i,...s,ref:t})});v0.displayName=VA;function GA(e){return KA.includes(e)}var g0=v0;const qA=g.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>x.jsx(g0,{ref:s,decorative:r,orientation:t,className:re("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));qA.displayName=g0.displayName;const XA=ed,_0=g.forwardRef(({className:e,...t},r)=>x.jsx(hi,{className:re("fixed inset-0 z-50 bg-black/80 [will-change:opacity] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));_0.displayName=hi.displayName;const YA=zu("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out [will-change:transform,opacity] data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),QA=g.forwardRef(({side:e="right",className:t,children:r,...n},s)=>x.jsxs(XA,{children:[x.jsx(_0,{}),x.jsxs(fi,{ref:s,className:re(YA({side:e}),t),...n,children:[x.jsxs(Og,{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-secondary",children:[x.jsx(Jv,{className:"h-4 w-4"}),x.jsx("span",{className:"sr-only",children:"Close"})]}),r]})]}));QA.displayName=fi.displayName;const JA=g.forwardRef(({className:e,...t},r)=>x.jsx(_a,{ref:r,className:re("text-lg font-semibold text-foreground",e),...t}));JA.displayName=_a.displayName;const ZA=g.forwardRef(({className:e,...t},r)=>x.jsx(ya,{ref:r,className:re("text-sm text-muted-foreground",e),...t}));ZA.displayName=ya.displayName;function eD(e,t=[]){let r=[];function n(o,l){const i=g.createContext(l),a=r.length;r=[...r,l];const c=u=>{var h;const{scope:v,children:y,...w}=u,_=((h=v==null?void 0:v[e])==null?void 0:h[a])||i,m=g.useMemo(()=>w,Object.values(w));return x.jsx(_.Provider,{value:m,children:y})};c.displayName=o+"Provider";function p(u,v){var _;const y=((_=v==null?void 0:v[e])==null?void 0:_[a])||i,w=g.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,p]}const s=()=>{const o=r.map(l=>g.createContext(l));return function(i){const a=(i==null?void 0:i[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,tD(s,...t)]}function tD(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((i,{useScope:a,scopeName:c})=>{const u=a(o)[`__scope${c}`];return{...i,...u}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function rD(e){const t=nD(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(iD);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function nD(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=aD(s),i=oD(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sD=Symbol("radix.slottable");function iD(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sD}function oD(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function aD(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var lD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],y0=lD.reduce((e,t)=>{const r=rD(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ma="Switch",[cD]=eD(Ma),[uD,dD]=cD(Ma),S0=g.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:o,required:l,disabled:i,value:a="on",onCheckedChange:c,form:p,...u}=e,[v,y]=g.useState(null),w=le(t,f=>y(f)),_=g.useRef(!1),m=v?p||!!v.closest("form"):!0,[h,d]=li({prop:s,defaultProp:o??!1,onChange:c,caller:Ma});return x.jsxs(uD,{scope:r,checked:h,disabled:i,children:[x.jsx(y0.button,{type:"button",role:"switch","aria-checked":h,"aria-required":l,"data-state":b0(h),"data-disabled":i?"":void 0,disabled:i,value:a,...u,ref:w,onClick:J(e.onClick,f=>{d(S=>!S),m&&(_.current=f.isPropagationStopped(),_.current||f.stopPropagation())})}),m&&x.jsx(C0,{control:v,bubbles:!_.current,name:n,value:a,checked:h,required:l,disabled:i,form:p,style:{transform:"translateX(-100%)"}})]})});S0.displayName=Ma;var w0="SwitchThumb",x0=g.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=dD(w0,r);return x.jsx(y0.span,{"data-state":b0(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});x0.displayName=w0;var hD="SwitchBubbleInput",C0=g.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...s},o)=>{const l=g.useRef(null),i=le(l,o),a=Ku(r),c=Gu(t);return g.useEffect(()=>{const p=l.current;if(!p)return;const u=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(u,"checked").set;if(a!==r&&y){const w=new Event("click",{bubbles:n});y.call(p,r),p.dispatchEvent(w)}},[a,r,n]),x.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:i,style:{...s.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});C0.displayName=hD;function b0(e){return e?"checked":"unchecked"}var E0=S0,fD=x0;const pD=g.forwardRef(({className:e,...t},r)=>x.jsx(E0,{ref:r,className:re("peer inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,children:x.jsx(fD,{className:re("pointer-events-none block h-3 w-3 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0")})}));pD.displayName=E0.displayName;function mD(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Array(12).fill(0);let Hc=1;class vD{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...s}=t,o=typeof(t==null?void 0:t.id)=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:Hc++,l=this.toasts.find(a=>a.id===o),i=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),l?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...t,id:o,title:n}),{...a,...t,id:o,dismissible:i,title:n}):a):this.addToast({title:n,...s,dismissible:i,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let o=n!==void 0,l;const i=s.then(async c=>{if(l=["resolve",c],Ve.isValidElement(c))o=!1,this.create({id:n,type:"default",message:c});else if(_D(c)&&!c.ok){o=!1;const u=typeof r.error=="function"?await r.error(`HTTP error! status: ${c.status}`):r.error,v=typeof r.description=="function"?await r.description(`HTTP error! status: ${c.status}`):r.description,w=typeof u=="object"&&!Ve.isValidElement(u)?u:{message:u};this.create({id:n,type:"error",description:v,...w})}else if(c instanceof Error){o=!1;const u=typeof r.error=="function"?await r.error(c):r.error,v=typeof r.description=="function"?await r.description(c):r.description,w=typeof u=="object"&&!Ve.isValidElement(u)?u:{message:u};this.create({id:n,type:"error",description:v,...w})}else if(r.success!==void 0){o=!1;const u=typeof r.success=="function"?await r.success(c):r.success,v=typeof r.description=="function"?await r.description(c):r.description,w=typeof u=="object"&&!Ve.isValidElement(u)?u:{message:u};this.create({id:n,type:"success",description:v,...w})}}).catch(async c=>{if(l=["reject",c],r.error!==void 0){o=!1;const p=typeof r.error=="function"?await r.error(c):r.error,u=typeof r.description=="function"?await r.description(c):r.description,y=typeof p=="object"&&!Ve.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:u,...y})}}).finally(()=>{o&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),a=()=>new Promise((c,p)=>i.then(()=>l[0]==="reject"?p(l[1]):c(l[1])).catch(p));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(t,r)=>{const n=(r==null?void 0:r.id)||Hc++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const dt=new vD,gD=(e,t)=>{const r=(t==null?void 0:t.id)||Hc++;return dt.addToast({title:e,...t,id:r}),r},_D=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",yD=gD,SD=()=>dt.toasts,wD=()=>dt.getActiveToasts();Object.assign(yD,{success:dt.success,info:dt.info,warning:dt.warning,error:dt.error,custom:dt.custom,message:dt.message,promise:dt.promise,dismiss:dt.dismiss,loading:dt.loading},{getHistory:SD,getToasts:wD});mD("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function xD(e,t=[]){let r=[];function n(o,l){const i=g.createContext(l),a=r.length;r=[...r,l];const c=u=>{var h;const{scope:v,children:y,...w}=u,_=((h=v==null?void 0:v[e])==null?void 0:h[a])||i,m=g.useMemo(()=>w,Object.values(w));return x.jsx(_.Provider,{value:m,children:y})};c.displayName=o+"Provider";function p(u,v){var _;const y=((_=v==null?void 0:v[e])==null?void 0:_[a])||i,w=g.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,p]}const s=()=>{const o=r.map(l=>g.createContext(l));return function(i){const a=(i==null?void 0:i[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,CD(s,...t)]}function CD(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((i,{useScope:a,scopeName:c})=>{const u=a(o)[`__scope${c}`];return{...i,...u}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function bD(e){const t=ED(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(RD);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function ED(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=TD(s),i=PD(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kD=Symbol("radix.slottable");function RD(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kD}function PD(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function TD(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var LD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Na=LD.reduce((e,t)=>{const r=bD(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ia="Tabs",[AD]=xD(Ia,[Ra]),k0=Ra(),[DD,bd]=AD(Ia),MD=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:s,defaultValue:o,orientation:l="horizontal",dir:i,activationMode:a="automatic",...c}=e,p=Vg(i),[u,v]=li({prop:n,onChange:s,defaultProp:o??"",caller:Ia});return x.jsx(DD,{scope:r,baseId:st(),value:u,onValueChange:v,orientation:l,dir:p,activationMode:a,children:x.jsx(Na.div,{dir:p,"data-orientation":l,...c,ref:t})})});MD.displayName=Ia;var R0="TabsList",P0=g.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...s}=e,o=bd(R0,r),l=k0(r);return x.jsx(w_,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:n,children:x.jsx(Na.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});P0.displayName=R0;var T0="TabsTrigger",L0=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:s=!1,...o}=e,l=bd(T0,r),i=k0(r),a=M0(l.baseId,n),c=N0(l.baseId,n),p=n===l.value;return x.jsx(x_,{asChild:!0,...i,focusable:!s,active:p,children:x.jsx(Na.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":c,"data-state":p?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:a,...o,ref:t,onMouseDown:J(e.onMouseDown,u=>{!s&&u.button===0&&u.ctrlKey===!1?l.onValueChange(n):u.preventDefault()}),onKeyDown:J(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&l.onValueChange(n)}),onFocus:J(e.onFocus,()=>{const u=l.activationMode!=="manual";!p&&!s&&u&&l.onValueChange(n)})})})});L0.displayName=T0;var A0="TabsContent",D0=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:s,children:o,...l}=e,i=bd(A0,r),a=M0(i.baseId,n),c=N0(i.baseId,n),p=n===i.value,u=g.useRef(p);return g.useEffect(()=>{const v=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(v)},[]),x.jsx(Qe,{present:s||p,children:({present:v})=>x.jsx(Na.div,{"data-state":p?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":a,hidden:!v,id:c,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:u.current?"0s":void 0},children:v&&o})})});D0.displayName=A0;function M0(e,t){return`${e}-trigger-${t}`}function N0(e,t){return`${e}-content-${t}`}var I0=P0,O0=L0,j0=D0;const ND=g.forwardRef(({className:e,...t},r)=>x.jsx(I0,{ref:r,className:re("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));ND.displayName=I0.displayName;const ID=g.forwardRef(({className:e,...t},r)=>x.jsx(O0,{ref:r,className:re("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 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-primary/10 data-[state=active]:text-primary data-[state=active]:shadow-sm",e),...t}));ID.displayName=O0.displayName;const OD=g.forwardRef(({className:e,...t},r)=>x.jsx(j0,{ref:r,className:re("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));OD.displayName=j0.displayName;const jD=g.forwardRef(({className:e,...t},r)=>x.jsx("textarea",{className:re("flex min-h-[60px] w-full rounded-md border border-transparent bg-input px-3 py-2 text-base placeholder:text-muted-foreground/50 placeholder:font-light focus-visible:outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...t}));jD.displayName="Textarea";function BD(e,t=[]){let r=[];function n(o,l){const i=g.createContext(l),a=r.length;r=[...r,l];const c=u=>{var h;const{scope:v,children:y,...w}=u,_=((h=v==null?void 0:v[e])==null?void 0:h[a])||i,m=g.useMemo(()=>w,Object.values(w));return x.jsx(_.Provider,{value:m,children:y})};c.displayName=o+"Provider";function p(u,v){var _;const y=((_=v==null?void 0:v[e])==null?void 0:_[a])||i,w=g.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${u}\` must be used within \`${o}\``)}return[c,p]}const s=()=>{const o=r.map(l=>g.createContext(l));return function(i){const a=(i==null?void 0:i[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,$D(s,...t)]}function $D(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((i,{useScope:a,scopeName:c})=>{const u=a(o)[`__scope${c}`];return{...i,...u}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function FD(e){const t=HD(e),r=g.forwardRef((n,s)=>{const{children:o,...l}=n,i=g.Children.toArray(o),a=i.find(zD);if(a){const c=a.props.children,p=i.map(u=>u===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:u);return x.jsx(t,{...l,ref:s,children:g.isValidElement(c)?g.cloneElement(c,void 0,p):null})}return x.jsx(t,{...l,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function HD(e){const t=g.forwardRef((r,n)=>{const{children:s,...o}=r;if(g.isValidElement(s)){const l=VD(s),i=UD(o,s.props);return s.type!==g.Fragment&&(i.ref=n?fe(n,l):l),g.cloneElement(s,i)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var B0=Symbol("radix.slottable");function WD(e){const t=({children:r})=>x.jsx(x.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=B0,t}function zD(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===B0}function UD(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function VD(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var KD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],GD=KD.reduce((e,t)=>{const r=FD(`Primitive.${t}`),n=g.forwardRef((s,o)=>{const{asChild:l,...i}=s,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),[Oa]=BD("Tooltip",[Mr]),Ed=Mr(),qD="TooltipProvider",Hf="tooltip.open",[uN,$0]=Oa(qD),F0="Tooltip",[dN,Si]=Oa(F0),Wc="TooltipTrigger",XD=g.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Si(Wc,r),o=$0(Wc,r),l=Ed(r),i=g.useRef(null),a=le(t,i,s.onTriggerChange),c=g.useRef(!1),p=g.useRef(!1),u=g.useCallback(()=>c.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),x.jsx(vi,{asChild:!0,...l,children:x.jsx(GD.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:a,onPointerMove:J(e.onPointerMove,v=>{v.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),p.current=!0)}),onPointerLeave:J(e.onPointerLeave,()=>{s.onTriggerLeave(),p.current=!1}),onPointerDown:J(e.onPointerDown,()=>{s.open&&s.onClose(),c.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:J(e.onFocus,()=>{c.current||s.onOpen()}),onBlur:J(e.onBlur,s.onClose),onClick:J(e.onClick,s.onClose)})})});XD.displayName=Wc;var kd="TooltipPortal",[YD,QD]=Oa(kd,{forceMount:void 0}),H0=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:s}=e,o=Si(kd,t);return x.jsx(YD,{scope:t,forceMount:r,children:x.jsx(Qe,{present:r||o.open,children:x.jsx(Zn,{asChild:!0,container:s,children:n})})})};H0.displayName=kd;var Gn="TooltipContent",W0=g.forwardRef((e,t)=>{const r=QD(Gn,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,l=Si(Gn,e.__scopeTooltip);return x.jsx(Qe,{present:n||l.open,children:l.disableHoverableContent?x.jsx(z0,{side:s,...o,ref:t}):x.jsx(JD,{side:s,...o,ref:t})})}),JD=g.forwardRef((e,t)=>{const r=Si(Gn,e.__scopeTooltip),n=$0(Gn,e.__scopeTooltip),s=g.useRef(null),o=le(t,s),[l,i]=g.useState(null),{trigger:a,onClose:c}=r,p=s.current,{onPointerInTransitChange:u}=n,v=g.useCallback(()=>{i(null),u(!1)},[u]),y=g.useCallback((w,_)=>{const m=w.currentTarget,h={x:w.clientX,y:w.clientY},d=nM(h,m.getBoundingClientRect()),f=sM(h,d),S=iM(_.getBoundingClientRect()),E=aM([...f,...S]);i(E),u(!0)},[u]);return g.useEffect(()=>()=>v(),[v]),g.useEffect(()=>{if(a&&p){const w=m=>y(m,p),_=m=>y(m,a);return a.addEventListener("pointerleave",w),p.addEventListener("pointerleave",_),()=>{a.removeEventListener("pointerleave",w),p.removeEventListener("pointerleave",_)}}},[a,p,y,v]),g.useEffect(()=>{if(l){const w=_=>{const m=_.target,h={x:_.clientX,y:_.clientY},d=(a==null?void 0:a.contains(m))||(p==null?void 0:p.contains(m)),f=!oM(h,l);d?v():f&&(v(),c())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[a,p,l,c,v]),x.jsx(z0,{...e,ref:o})}),[ZD,eM]=Oa(F0,{isInside:!1}),tM=WD("TooltipContent"),z0=g.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:l,...i}=e,a=Si(Gn,r),c=Ed(r),{onClose:p}=a;return g.useEffect(()=>(document.addEventListener(Hf,p),()=>document.removeEventListener(Hf,p)),[p]),g.useEffect(()=>{if(a.trigger){const u=v=>{const y=v.target;y!=null&&y.contains(a.trigger)&&p()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[a.trigger,p]),x.jsx(Jn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u=>u.preventDefault(),onDismiss:p,children:x.jsxs(Ea,{"data-state":a.stateAttribute,...c,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[x.jsx(tM,{children:n}),x.jsx(ZD,{scope:r,isInside:!0,children:x.jsx(fA,{id:a.contentId,role:"tooltip",children:s||n})})]})})});W0.displayName=Gn;var U0="TooltipArrow",rM=g.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Ed(r);return eM(U0,r).isInside?null:x.jsx(ka,{...s,...n,ref:t})});rM.displayName=U0;function nM(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function sM(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function iM(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function oM(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const i=t[o],a=t[l],c=i.x,p=i.y,u=a.x,v=a.y;p>n!=v>n&&r<(u-c)*(n-p)/(v-p)+c&&(s=!s)}return s}function aM(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),lM(t)}function lM(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const o=t[t.length-1],l=t[t.length-2];if((o.x-l.x)*(s.y-l.y)>=(o.y-l.y)*(s.x-l.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const o=r[r.length-1],l=r[r.length-2];if((o.x-l.x)*(s.y-l.y)>=(o.y-l.y)*(s.x-l.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var cM=H0,V0=W0;const uM=g.forwardRef(({className:e,sideOffset:t=4,...r},n)=>x.jsx(cM,{children:x.jsx(V0,{ref:n,sideOffset:t,className:re("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...r})}));uM.displayName=V0.displayName;function dM({message:e="Loading...",className:t,fullPage:r=!1}){return x.jsxs("div",{className:re("flex flex-col items-center gap-3 text-muted-foreground",r?"fixed inset-0 z-50 justify-center bg-background":"absolute inset-0 justify-center",t),children:[x.jsx(ob,{className:"h-8 w-8 animate-spin text-primary"}),e&&x.jsx("p",{className:"text-sm",children:e})]})}function hM(){const{setTheme:e,resolvedTheme:t}=kC();return x.jsxs(Zv,{variant:"ghost",size:"icon",className:"relative h-8 w-8",onClick:()=>e(t==="dark"?"light":"dark"),children:[x.jsx(bb,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),x.jsx(ub,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),x.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}const fM=()=>x.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[x.jsx("path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"}),x.jsx("path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"}),x.jsx("path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"}),x.jsx("path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"})]});function Rd(){return x.jsxs("span",{className:"logo",children:[x.jsx("span",{className:"logo-icon",children:x.jsx(fM,{})}),x.jsx("span",{className:"logo-text",children:"LaunchPod"})]})}const pM=()=>x.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:x.jsx("polyline",{points:"20 6 9 17 4 12"})}),mM=["Automated security scanning","GitHub-native CI/CD integration","Team collaboration built in"];function vM(){return x.jsxs("div",{className:"brand-panel auth-gradient",children:[x.jsx("div",{className:"auth-blob auth-blob--1"}),x.jsx("div",{className:"auth-blob auth-blob--2"}),x.jsx("div",{className:"auth-blob auth-blob--3"}),x.jsx(Rd,{}),x.jsxs("div",{className:"brand-content",children:[x.jsx("h1",{children:"Ship secure software, faster."}),x.jsx("ul",{className:"feature-list",children:mM.map(e=>x.jsxs("li",{children:[x.jsx(pM,{}),x.jsx("span",{children:e})]},e))})]}),x.jsx("p",{className:"brand-footer",children:"Trusted by development teams"})]})}const gM=()=>x.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[x.jsx("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),x.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),_M=()=>x.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[x.jsx("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),x.jsx("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),x.jsx("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),x.jsx("path",{d:"m2 2 20 20"})]});function yM({onSuccess:e}){const[t,r]=g.useState(""),[n,s]=g.useState(!1),[o,l]=g.useState(""),[i,a]=g.useState(!1),c=async p=>{p.preventDefault(),l(""),a(!0);try{const v=await(await fetch("/api/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t.trim()})})).json();v.success?e():l(v.error||"Invalid token")}catch{l("Connection failed")}finally{a(!1)}};return x.jsxs("div",{className:"auth-layout",children:[x.jsx(vM,{}),x.jsx("div",{className:"form-panel",children:x.jsxs("div",{className:"form-container",children:[x.jsx("div",{className:"mobile-logo",children:x.jsx(Rd,{})}),x.jsxs("div",{className:"form-header",children:[x.jsx("h2",{children:"Connect your pod"}),x.jsx("p",{children:"Enter your MCP runner token to authenticate"})]}),o&&x.jsx("div",{className:"error-box",children:o}),x.jsxs("form",{onSubmit:c,children:[x.jsxs("div",{className:"form-group",children:[x.jsx("label",{htmlFor:"token",children:"MCP Runner Token"}),x.jsxs("div",{className:"input-wrapper",children:[x.jsx("input",{id:"token",className:"input input--with-toggle",type:n?"text":"password",placeholder:"Paste your MCP runner token",required:!0,autoComplete:"off",value:t,onChange:p=>r(p.target.value)}),x.jsx("button",{type:"button",className:"toggle-visibility",onClick:()=>s(!n),tabIndex:-1,children:n?x.jsx(_M,{}):x.jsx(gM,{})})]})]}),x.jsx("button",{type:"submit",className:"btn btn--primary btn--lg",disabled:i,children:i?"Connecting...":"Connect"})]}),x.jsx("p",{className:"help-text",children:"Find your MCP runner token in the LaunchSecure dashboard under Pipeline Settings."})]})})]})}const SM=5,wM=1e3,xM=3e4;function Pd({onMessage:e}){const[t,r]=g.useState("disconnected"),[n,s]=g.useState(null),o=g.useRef(null),l=g.useRef(0),i=g.useRef(null),a=g.useRef(e);a.current=e;const c=g.useCallback(p=>{const u=o.current;u&&u.readyState===WebSocket.OPEN&&u.send(JSON.stringify(p))},[]);return g.useEffect(()=>{let p=!1,u=null;function v(){if(p)return;r("connecting");const w=location.protocol==="https:"?"wss:":"ws:",_=new WebSocket(`${w}//${location.host}/terminal/ws`);o.current=_,_.onopen=()=>{if(p){_.close();return}l.current=0,r("connected"),i.current=setInterval(()=>{_.readyState===WebSocket.OPEN&&_.send(JSON.stringify({type:"ping"}))},xM)},_.onmessage=m=>{if(p)return;const h=JSON.parse(m.data);h.type==="connected"&&s(h.connectionId),a.current(h)},_.onclose=m=>{if(!p&&(y(),r("disconnected"),!m.wasClean&&l.current<SM)){const h=wM*Math.pow(2,l.current);l.current+=1,u=setTimeout(v,h)}},_.onerror=()=>{}}function y(){i.current&&(clearInterval(i.current),i.current=null)}return v(),()=>{var w;p=!0,y(),u&&clearTimeout(u),(w=o.current)==null||w.close(),o.current=null}},[]),{status:t,connectionId:n,send:c}}function CM(){return x.jsxs("header",{className:"sticky top-0 z-40 flex h-[var(--header-height)] items-center border-b bg-background/80 backdrop-blur-md px-4 shadow-sm",children:[x.jsx(Rd,{}),x.jsx("div",{className:"ml-auto flex items-center gap-2",children:x.jsx(hM,{})})]})}const qi="sidebar-nav-item active relative flex items-center gap-3 overflow-hidden rounded-lg px-3 py-1.5 text-sm bg-gradient-to-r from-sidebar-primary/20 via-transparent via-80% to-transparent font-medium text-sidebar-foreground before:absolute before:left-0 before:top-0 before:h-full before:w-[3px] before:rounded-full before:bg-sidebar-primary",vs="sidebar-nav-item relative flex w-full items-center gap-3 overflow-hidden rounded-lg px-3 py-1.5 text-sm font-normal text-sidebar-muted-foreground transition-colors duration-200 hover:text-sidebar-foreground bg-transparent border-none cursor-pointer";function bM({onLogout:e,terminalAvailable:t,activePage:r="dashboard",onNavigate:n}){return x.jsxs("aside",{className:"hidden lg:flex lg:flex-col w-[var(--sidebar-width)] sidebar-gradient",children:[x.jsx("nav",{className:"flex-1 overflow-y-auto px-3 py-4",children:x.jsxs("ul",{className:"space-y-1",children:[x.jsx("li",{children:x.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n("dashboard"),className:r==="dashboard"?qi:vs,children:[x.jsx(sb,{className:"h-4 w-4 shrink-0"}),"Dashboard"]})}),t&&x.jsx("li",{children:x.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n("terminal"),className:r==="terminal"?qi:vs,children:[x.jsx(kb,{className:"h-4 w-4 shrink-0"}),"Terminal"]})}),x.jsx("li",{children:x.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n("settings"),className:r==="settings"?qi:vs,children:[x.jsx(xb,{className:"h-4 w-4 shrink-0"}),"Settings"]})}),x.jsx("li",{children:x.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n("repair"),className:r==="repair"?qi:vs,children:[x.jsx(Lb,{className:"h-4 w-4 shrink-0"}),"Repair"]})})]})}),x.jsx("div",{className:"border-t border-sidebar-border px-3 py-3",children:x.jsxs("button",{type:"button",onClick:e,className:vs,children:[x.jsx(lb,{className:"h-4 w-4 shrink-0"}),"Disconnect"]})})]})}function qo(e){return e.toLowerCase()}function EM(e){const t=new Map;for(const r of e){const n=t.get(r.ph);n?n.push(r):t.set(r.ph,[r])}return t}function K0(e){return e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function kM(e){return e==="script_pod"?"LOCAL":e==="script"?"SCRIPT":"LLM"}function Td({status:e}){return x.jsx("span",{className:`agent-status-dot agent-status-dot--${qo(e)}`})}function RM({agent:e,status:t,selected:r,dim:n,onClick:s}){const o=["pipeline-compact-item",r&&"pipeline-compact-item--selected",n&&"pipeline-compact-item--dim"].filter(Boolean).join(" ");return x.jsxs("button",{type:"button",className:o,onClick:s,children:[x.jsx(Td,{status:t}),x.jsx("span",{className:"pipeline-compact-name",children:e.nm})]})}function Wf({agents:e,agentStatuses:t,selectedId:r,onSelect:n,nextUpIds:s}){const o=EM(e),l=Array.from(o.keys()).sort((i,a)=>i-a);return e.length===0?x.jsx("div",{className:"pipeline-empty-state",children:"None yet"}):x.jsx(x.Fragment,{children:l.map(i=>x.jsxs("div",{className:"pipeline-phase-group",children:[x.jsxs("div",{className:"pipeline-phase-label",children:["Phase ",i]}),o.get(i).map(a=>{var p;const c=t!=null&&t[a.id]?qo(((p=t[a.id])==null?void 0:p.status)??"pending"):"pending";return x.jsx(RM,{agent:a,status:c,selected:r===a.id,dim:s?!s.has(a.id):!1,onClick:()=>n(a.id)},a.id)})]},i))})}function zf({agent:e,status:t,triggeredAt:r,completedAt:n,needsAttention:s,previews:o,onOpenTerminal:l,podProgressState:i,onResolveIntervention:a,interventions:c}){const[p,u]=g.useState(0);let v=i;if(e.rn==="script_pod"&&!v){const h=c==null?void 0:c.find(d=>d.agent_id===e.id&&d.status==="pending");h&&(v={messages:[{text:h.message,level:"info",ts:Date.now()}],templateMatch:null})}const y=e.rn==="script_pod"&&v,w=o&&o.length>0?Math.min(p,o.length-1):0,_=o==null?void 0:o[w],m=e.gr==="per_unit"&&o&&o.length>1;return x.jsxs("div",{className:`pipeline-detail-card pipeline-detail-card--${t}`,children:[x.jsxs("div",{className:"pipeline-detail-left",children:[x.jsxs("div",{className:"pipeline-detail-header",children:[x.jsx(Td,{status:t}),x.jsx("span",{className:"pipeline-detail-name",children:e.nm}),s&&x.jsx("span",{className:"pipeline-attention-dot",title:"Terminal may need input"})]}),x.jsxs("div",{className:"pipeline-detail-meta",children:[x.jsx("span",{className:"pipeline-detail-id",children:e.id}),x.jsx("span",{className:"pipeline-detail-runner",children:kM(e.rn)})]}),x.jsxs("div",{className:"pipeline-detail-badges",children:[x.jsx("span",{className:"agent-badge agent-badge--ia",children:e.ia}),x.jsx("span",{className:"agent-badge agent-badge--gr",children:e.gr==="per_unit"?"per-unit":e.gr})]}),x.jsxs("div",{className:"pipeline-detail-info",children:[x.jsxs("span",{children:["Phase ",e.ph]}),r&&x.jsxs("span",{children:["Started: ",new Date(r).toLocaleTimeString()]}),n&&x.jsxs("span",{children:["Completed: ",new Date(n).toLocaleTimeString()]})]})]}),x.jsxs("div",{className:"pipeline-detail-right",children:[m&&x.jsx("div",{className:"pipeline-unit-tabs",children:o.map((h,d)=>x.jsx("button",{type:"button",className:`pipeline-unit-tab${d===w?" pipeline-unit-tab--active":""}`,onClick:()=>u(d),children:h.unitId||`unit-${d}`},h.sessionId))}),y?x.jsx(TM,{podState:v}):_!=null&&_.text?x.jsx("pre",{className:"pipeline-preview-text",children:_.text}):x.jsx("div",{className:"pipeline-preview-empty",children:"No output yet"}),e.rn==="script_pod"&&a&&(c==null?void 0:c.filter(h=>h.agent_id===e.id&&h.status==="pending").map(h=>{const{runText:d,skipText:f}=G0(h);return x.jsxs("div",{className:"pipeline-intervention-actions",style:{marginTop:"8px"},children:[x.jsx("button",{type:"button",onClick:()=>a(h.id,"continue"),className:"pipeline-intervention-btn pipeline-intervention-btn--run",children:d}),x.jsx("button",{type:"button",onClick:()=>a(h.id,"skip"),className:"pipeline-intervention-btn pipeline-intervention-btn--skip",children:f})]},h.id)})),!y&&(_==null?void 0:_.sessionId)&&l&&x.jsx("button",{type:"button",className:"pipeline-open-terminal-btn",title:"Open terminal",onClick:()=>l(_.sessionId),children:x.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[x.jsx("polyline",{points:"4 17 10 11 4 5"}),x.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})})]})]})}function G0(e){if(e.agent_id==="workspace_setup")return{label:"Workspace Setup",runText:"Use Template",skipText:"Custom Build"};switch(e.type.toLowerCase()){case"checkpoint":return{label:"Checkpoint",runText:"Continue",skipText:"Skip"};case"error":return{label:"Error",runText:"Retry",skipText:"Skip"};case"loop_escalation":return{label:"Loop Escalation",runText:"Continue",skipText:"Stop"};default:return{label:"Review Gate",runText:"Run",skipText:"Skip"}}}function PM({intervention:e,onResolve:t}){const[r,n]=g.useState(!1),{label:s,runText:o,skipText:l}=G0(e),i=a=>{n(!0),t(e.id,a)};return x.jsxs("div",{className:"pipeline-intervention-card",children:[x.jsx("div",{className:"pipeline-intervention-label",children:s}),x.jsx("div",{className:"pipeline-intervention-agent",children:K0(e.agent_id)}),e.message&&x.jsx("p",{className:"pipeline-intervention-msg",children:e.message}),x.jsxs("div",{className:"pipeline-intervention-actions",children:[x.jsx("button",{type:"button",disabled:r,onClick:()=>i("continue"),className:"pipeline-intervention-btn pipeline-intervention-btn--run",children:r?"...":o}),x.jsx("button",{type:"button",disabled:r,onClick:()=>i("skip"),className:"pipeline-intervention-btn pipeline-intervention-btn--skip",children:r?"...":l})]})]})}function TM({podState:e}){const{messages:t}=e;return x.jsx("div",{className:"pod-progress-panel",children:x.jsx("div",{className:"pod-progress-log",children:t.map((r,n)=>x.jsx("div",{className:`pod-progress-entry pod-progress-entry--${r.level}`,children:r.text},n))})})}function LM({agentId:e,agentName:t,error:r}){const[n,s]=g.useState(!1);return x.jsxs("div",{className:"pipeline-detail-card pipeline-detail-card--failed",children:[x.jsxs("div",{className:"pipeline-detail-left",children:[x.jsxs("div",{className:"pipeline-detail-header",children:[x.jsx(Td,{status:"failed"}),x.jsx("span",{className:"pipeline-detail-name",children:t??K0(e)})]}),x.jsx("div",{className:"pipeline-detail-meta",children:x.jsx("span",{className:"pipeline-detail-id",children:e})}),x.jsx("div",{style:{marginTop:"0.5rem"},children:x.jsx("span",{className:"text-red-400 text-xs font-medium",children:"Node failed to start"})}),x.jsx("button",{type:"button",onClick:()=>s(!n),className:"inline-flex items-center gap-1 mt-2 px-2 py-1 rounded text-xs bg-zinc-700 hover:bg-zinc-600 text-zinc-200 transition-colors",children:n?"Hide Log":"Show Log"})]}),x.jsx("div",{className:"pipeline-detail-right",children:n?x.jsx("pre",{className:"pipeline-preview-text",style:{color:"var(--color-red-300, #fca5a5)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:r}):x.jsx("div",{className:"pipeline-preview-empty",children:'Click "Show Log" for details'})})]})}function AM({data:e,agentStatuses:t,interventions:r,onResolveIntervention:n,stalled:s,onPoke:o,attentionAgentIds:l,sessionPreviews:i,onOpenTerminal:a,podProgressStates:c,runStatus:p,nodeErrors:u}){const[v,y]=g.useState(null),w=T=>y(M=>M===T?null:T),_=e.ag??[],m=new Map(_.map(T=>[T.id,T])),h=[],d=[],f=[];for(const T of _){const M=t==null?void 0:t[T.id],j=M?qo(M.status):"pending";j==="completed"||j==="failed"?h.push(T):j==="in_progress"?d.push(T):f.push(T)}const S=new Set;if(f.length>0){const T=Math.min(...f.map(M=>M.ph));for(const M of f)M.ph===T&&S.add(M.id)}const E=new Set(_.filter(T=>T.rn==="script_pod").map(T=>T.id)),k=(r??[]).filter(T=>T.status==="pending"&&!E.has(T.agent_id)),b=v?m.get(v):null,C=v?t==null?void 0:t[v]:null,P=C?qo(C.status):"pending";return x.jsxs("div",{className:"pipeline-dashboard",children:[x.jsxs("div",{className:"pipeline-col pipeline-col--left",children:[x.jsx("div",{className:"pipeline-col-header",children:"Completed"}),x.jsx("div",{className:"pipeline-col-body",children:x.jsx(Wf,{agents:h,agentStatuses:t,selectedId:v,onSelect:w})})]}),x.jsxs("div",{className:"pipeline-col pipeline-col--center",children:[x.jsx("div",{className:"pipeline-col-header",children:"Active"}),x.jsxs("div",{className:"pipeline-col-body",children:[n&&k.map(T=>x.jsx(PM,{intervention:T,onResolve:n},T.id)),b&&!d.some(T=>T.id===v)&&x.jsx(zf,{agent:b,status:P,triggeredAt:C==null?void 0:C.triggered_at,completedAt:C==null?void 0:C.completed_at,needsAttention:l==null?void 0:l.has(b.id),previews:i==null?void 0:i[b.id],onOpenTerminal:a,podProgressState:c==null?void 0:c[b.id],onResolveIntervention:n,interventions:r}),d.map(T=>{const M=t==null?void 0:t[T.id];return x.jsx(zf,{agent:T,status:"in_progress",triggeredAt:M==null?void 0:M.triggered_at,completedAt:M==null?void 0:M.completed_at,needsAttention:l==null?void 0:l.has(T.id),previews:i==null?void 0:i[T.id],onOpenTerminal:a,podProgressState:c==null?void 0:c[T.id],onResolveIntervention:n,interventions:r},T.id)}),u&&Object.entries(u).map(([T,M])=>{const j=m.get(T);return x.jsx(LM,{agentId:T,agentName:j==null?void 0:j.nm,error:M},`err-${T}`)}),!b&&d.length===0&&k.length===0&&Object.keys(u??{}).length===0&&(p==="completed"?x.jsxs("div",{className:"pipeline-empty-state pipeline-empty-state--completed",children:[x.jsx("span",{className:"agent-status-dot agent-status-dot--completed"}),x.jsx("span",{children:"Pipeline Complete"})]}):p==="paused"?x.jsxs("div",{className:"pipeline-empty-state",children:[x.jsx("span",{className:"agent-status-dot agent-status-dot--pending"}),x.jsx("span",{children:"Pipeline Paused"})]}):x.jsxs("div",{className:"pipeline-empty-state",children:[x.jsx("span",{className:"agent-status-dot agent-status-dot--in_progress"}),x.jsx("span",{children:"Waiting for next node..."})]}))]})]}),x.jsxs("div",{className:"pipeline-col pipeline-col--right",children:[x.jsx("div",{className:"pipeline-col-header",children:"Upcoming"}),x.jsx("div",{className:"pipeline-col-body",children:x.jsx(Wf,{agents:f,agentStatuses:t,selectedId:v,onSelect:w,nextUpIds:S})})]})]})}let Uf=!1,Xi=null;function DM({send:e,xtermRef:t,defaultAgent:r,autoSessionId:n}){const[s,o]=g.useState(null),[l,i]=g.useState(!1),a=g.useRef(r);a.current=r;const c=g.useRef(n);c.current=n;function p(w){e({type:w==="claude"?"start_claude":w==="codex"?"start_codex":"start_agent"})}const u=g.useCallback((w,_)=>{e({type:w==="claude"?"start_claude":w==="codex"?"start_codex":"start_agent",options:_})},[e]),v=g.useCallback(()=>{e({type:"stop"})},[e]),y=g.useCallback(w=>{var _,m,h;switch(w.type){case"connected":{if(Uf)break;Uf=!0;const d=c.current;if(d){o(d),e({type:"join_session",sessionId:d});break}Xi==null||Xi.abort();const f=new AbortController;Xi=f,fetch("/terminal/api/sessions/list",{signal:f.signal}).then(S=>S.json()).then(S=>{const E=S.sessions??[];if(E.length>0){const k=E[0];o(k.id),i(k.active),e({type:"join_session",sessionId:k.id}),!k.active&&a.current&&setTimeout(()=>p(a.current),100)}else e({type:"create_session",name:"Session 1"})}).catch(()=>{f.signal.aborted||e({type:"create_session",name:"Session 1"})});break}case"session_created":{o(w.sessionId),i(!1);const d=a.current;d&&p(d);break}case"session_joined":{if(o(w.sessionId),i(w.active),(_=t.current)==null||_.clear(),(m=w.outputBuffer)!=null&&m.length)for(const d of w.outputBuffer)(h=t.current)==null||h.write(d.replace(/\x1b\[\[?[IO]/g,""));break}case"session_left":case"session_deleted":break;case"claude_started":case"codex_started":case"agent_started":i(!0);break;case"claude_stopped":case"codex_stopped":case"agent_stopped":i(!1);break;case"exit":i(!1);break}},[e,t]);return{sessionId:s,agentRunning:l,handleMessage:y,startAgent:u,stopAgent:v}}const Vf=1e4,MM=["Plan mode is active","you MUST NOT make any edits","present your plan by calling the ExitPlanMode tool","Starting plan mode"],NM=["User has approved your plan","You can now start coding","Plan mode exited","Exiting plan mode"],IM=[/## Implementation Plan:/,/### \d+\. /,/## Plan:/,/### Plan Overview/,/## Proposed Solution:/];function Kf(e){return e.replace(/\x1b\[[0-9;]*m/g,"").replace(/\x1b\[[0-9]*[A-Za-z]/g,"")}function q0(){const[e,t]=g.useState(null),[r,n]=g.useState(!1),s=g.useRef([]),o=g.useRef(!1),l=g.useCallback((p=5e4)=>{const u=s.current.join("");return Kf(u).slice(-p)},[]),i=g.useCallback(p=>{let u=null;const v=p.match(/## Implementation Plan:[\s\S]*?(?=(?:User has approved|Exit plan mode|[$>]|^[a-z]+@))/im);if(v&&(u=v[0]),!u){const y=p.match(/##[^#].*?Plan.*?:[\s\S]*?(?:###.*?[\s\S]*?){2,}(?=(?:User has approved|Exit plan mode|[$>]|^[a-z]+@))/im);y&&(u=y[0])}if(!u){const w=p.slice(-5e3).match(/(?:##|Plan:)[\s\S]*?(?:###[\s\S]*?){1,}/);w&&(u=w[0])}return u?(u=Kf(u).replace(/\r\n/g,`
|
|
270
270
|
`).replace(/\r/g,`
|
|
271
271
|
`).trim(),{content:u,timestamp:Date.now()}):null},[]),a=g.useCallback(p=>{s.current.push(p),s.current.length>Vf&&(s.current=s.current.slice(-Vf/2));const u=l();if(o.current||MM.some(y=>u.includes(y))&&(o.current=!0,n(!0)),o.current){const v=IM.some(w=>w.test(u)),y=u.slice(-1e4);if(v&&y.includes("###")){const w=i(u);w&&t(w)}}o.current&&NM.some(y=>u.includes(y))&&(o.current=!1,n(!1),t(null))},[l,i]),c=g.useCallback(()=>{t(null),s.current=[],o.current=!1,n(!1)},[]);return{plan:e,planModeActive:r,processOutput:a,clearPlan:c}}const X0="launchpod-settings",Tl={defaultAgent:"claude"};function Y0(){try{const e=localStorage.getItem(X0);return e?{...Tl,...JSON.parse(e)}:Tl}catch{return Tl}}function OM(e){localStorage.setItem(X0,JSON.stringify(e));try{const t=JSON.parse(localStorage.getItem("launchpod-terminal-settings")||"{}");t.defaultAgent=e.defaultAgent,localStorage.setItem("launchpod-terminal-settings",JSON.stringify(t))}catch{}}function jM(){const[e,t]=g.useState(Y0),[r,n]=g.useState(!1),s=()=>{OM(e),n(!0),setTimeout(()=>n(!1),2e3)};return x.jsxs("div",{className:"max-w-xl mx-auto py-10 px-6",children:[x.jsx("h1",{className:"text-xl font-semibold text-foreground mb-6",children:"Settings"}),x.jsxs("div",{className:"space-y-6",children:[x.jsxs("div",{className:"space-y-2",children:[x.jsx("label",{className:"block text-sm font-medium text-foreground",children:"Default Agent"}),x.jsx("p",{className:"text-xs text-muted-foreground",children:"Which agent to show in the start prompt when opening the terminal."}),x.jsxs("select",{value:e.defaultAgent,onChange:o=>t({...e,defaultAgent:o.target.value}),className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring",children:[x.jsx("option",{value:"claude",children:"Claude"}),x.jsx("option",{value:"codex",children:"Codex"}),x.jsx("option",{value:"agent",children:"Cursor"})]})]}),x.jsx("button",{onClick:s,className:"rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors",children:r?"Saved":"Save Settings"})]})]})}var Q0={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(globalThis,()=>(()=>{var r={4567:function(l,i,a){var c=this&&this.__decorate||function(d,f,S,E){var k,b=arguments.length,C=b<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(d,f,S,E);else for(var P=d.length-1;P>=0;P--)(k=d[P])&&(C=(b<3?k(C):b>3?k(f,S,C):k(f,S))||C);return b>3&&C&&Object.defineProperty(f,S,C),C},p=this&&this.__param||function(d,f){return function(S,E){f(S,E,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.AccessibilityManager=void 0;const u=a(9042),v=a(9924),y=a(844),w=a(4725),_=a(2585),m=a(3656);let h=i.AccessibilityManager=class extends y.Disposable{constructor(d,f,S,E){super(),this._terminal=d,this._coreBrowserService=S,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let k=0;k<this._terminal.rows;k++)this._rowElements[k]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[k]);if(this._topBoundaryFocusListener=k=>this._handleBoundaryFocus(k,0),this._bottomBoundaryFocusListener=k=>this._handleBoundaryFocus(k,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new v.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(k=>this._handleResize(k.rows))),this.register(this._terminal.onRender(k=>this._refreshRows(k.start,k.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(k=>this._handleChar(k))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
272
272
|
`))),this.register(this._terminal.onA11yTab(k=>this._handleTab(k))),this.register(this._terminal.onKey(k=>this._handleKey(k.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,m.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,y.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(d){for(let f=0;f<d;f++)this._handleChar(" ")}_handleChar(d){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==d&&(this._charsToAnnounce+=d):this._charsToAnnounce+=d,d===`
|
package/dist/client/index.html
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
if (dark) document.documentElement.classList.add('dark');
|
|
14
14
|
})();
|
|
15
15
|
</script>
|
|
16
|
-
<script type="module" crossorigin src="/assets/index-
|
|
17
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
16
|
+
<script type="module" crossorigin src="/assets/index-DldfczJ1.js"></script>
|
|
17
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CCpAvTkG.css">
|
|
18
18
|
</head>
|
|
19
19
|
<body>
|
|
20
20
|
<div id="root"></div>
|