@coralai/sps-cli 0.65.23 → 0.65.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ShowcasePage-DlksLyHb.js","assets/ShowcasePage-EkuegwaP.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ShowcasePage-C-y4JCT4.js","assets/ShowcasePage-EkuegwaP.css"])))=>i.map(i=>d[i]);
2
2
  var Fz=Object.defineProperty;var oN=e=>{throw TypeError(e)};var $z=(e,t,n)=>t in e?Fz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var lN=(e,t,n)=>$z(e,typeof t!="symbol"?t+"":t,n),xb=(e,t,n)=>t.has(e)||oN("Cannot "+n);var ee=(e,t,n)=>(xb(e,t,"read from private field"),n?n.call(e):t.get(e)),nt=(e,t,n)=>t.has(e)?oN("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Be=(e,t,n,i)=>(xb(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),kt=(e,t,n)=>(xb(e,t,"access private method"),n);var Ih=(e,t,n,i)=>({set _(s){Be(e,t,s,n)},get _(){return ee(e,t,i)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();function nf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vb={exports:{}},Wu={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -852,4 +852,4 @@ description: ...
852
852
  `)),m=f.reduce((p,y)=>p.concat(...y),[]);return[f,m]}return[[],[]]},[e]);return C.useEffect(()=>{const u=(t==null?void 0:t.target)??rA,f=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=b=>{var E,v;if(s.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!s.current||s.current&&!f)&&LI(b))return!1;const w=oA(b.code,c);if(a.current.add(b[w]),aA(o,a.current,!1)){const _=((v=(E=b.composedPath)==null?void 0:E.call(b))==null?void 0:v[0])||b.target,k=(_==null?void 0:_.nodeName)==="BUTTON"||(_==null?void 0:_.nodeName)==="A";t.preventDefault!==!1&&(s.current||!k)&&b.preventDefault(),i(!0)}},p=b=>{const x=oA(b.code,c);aA(o,a.current,!0)?(i(!1),a.current.clear()):a.current.delete(b[x]),b.key==="Meta"&&a.current.clear(),s.current=!1},y=()=>{a.current.clear(),i(!1)};return u==null||u.addEventListener("keydown",m),u==null||u.addEventListener("keyup",p),window.addEventListener("blur",y),window.addEventListener("contextmenu",y),()=>{u==null||u.removeEventListener("keydown",m),u==null||u.removeEventListener("keyup",p),window.removeEventListener("blur",y),window.removeEventListener("contextmenu",y)}}},[e,i]),n}function aA(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(s=>t.has(s)))}function oA(e,t){return t.includes(e)?"code":"key"}const Sce=()=>{const e=Sn();return C.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:i}=e.getState();return i?i.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[i,s,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??i,y:t.y??s,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{const[t,n,i]=e.getState().transform;return{x:t,y:n,zoom:i}},setCenter:async(t,n,i)=>e.getState().setCenter(t,n,i),fitBounds:async(t,n)=>{const{width:i,height:s,minZoom:a,maxZoom:o,panZoom:c}=e.getState(),u=Sw(t,i,s,a,o,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(u,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:i,snapGrid:s,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;const{x:c,y:u}=o.getBoundingClientRect(),f={x:t.x-c,y:t.y-u},m=n.snapGrid??s,p=n.snapToGrid??a;return _f(f,i,p,m)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:s,y:a}=i.getBoundingClientRect(),o=Fc(t,n);return{x:o.x+s,y:o.y+a}}}),[])};function sP(e,t){const n=[],i=new Map,s=[];for(const a of e)if(a.type==="add"){s.push(a);continue}else if(a.type==="remove"||a.type==="replace")i.set(a.id,[a]);else{const o=i.get(a.id);o?o.push(a):i.set(a.id,[a])}for(const a of t){const o=i.get(a.id);if(!o){n.push(a);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const c={...a};for(const u of o)kce(u,c);n.push(c)}return s.length&&s.forEach(a=>{a.index!==void 0?n.splice(a.index,0,{...a.item}):n.push({...a.item})}),n}function kce(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function rP(e,t){return sP(e,t)}function aP(e,t){return sP(e,t)}function Do(e,t){return{id:e,type:"select",selected:t}}function uc(e,t=new Set,n=!1){const i=[];for(const[s,a]of e){const o=t.has(s);!(a.selected===void 0&&!o)&&a.selected!==o&&(n&&(a.selected=o),i.push(Do(a.id,o)))}return i}function lA({items:e=[],lookup:t}){var s;const n=[],i=new Map(e.map(a=>[a.id,a]));for(const[a,o]of e.entries()){const c=t.get(o.id),u=((s=c==null?void 0:c.internals)==null?void 0:s.userNode)??c;u!==void 0&&u!==o&&n.push({id:o.id,item:o,type:"replace"}),u===void 0&&n.push({item:o,type:"add",index:a})}for(const[a]of t)i.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function cA(e){return{id:e.id,type:"remove"}}const oP=MI();function lP(e,t,n={}){return ule(e,t,{...n,onError:n.onError??oP})}function Nce(e,t,n,i={shouldReplaceId:!0}){return dle(e,t,n,{...i,onError:i.onError??oP})}const uA=e=>Xoe(e),_ce=e=>_I(e);function cP(e){return C.forwardRef(e)}const Cce=typeof window<"u"?C.useLayoutEffect:C.useEffect;function dA(e){const[t,n]=C.useState(BigInt(0)),[i]=C.useState(()=>Tce(()=>n(s=>s+BigInt(1))));return Cce(()=>{const s=i.get();s.length&&(e(s),i.reset())},[t]),i}function Tce(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const uP=C.createContext(null);function Ace({children:e}){const t=Sn(),n=C.useCallback(c=>{const{nodes:u=[],setNodes:f,hasDefaultNodes:m,onNodesChange:p,nodeLookup:y,fitViewQueued:b,onNodesChangeMiddlewareMap:x}=t.getState();let w=u;for(const v of c)w=typeof v=="function"?v(w):v;let E=lA({items:w,lookup:y});for(const v of x.values())E=v(E);m&&f(w),E.length>0?p==null||p(E):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:v,nodes:_,setNodes:k}=t.getState();v&&k(_)})},[]),i=dA(n),s=C.useCallback(c=>{const{edges:u=[],setEdges:f,hasDefaultEdges:m,onEdgesChange:p,edgeLookup:y}=t.getState();let b=u;for(const x of c)b=typeof x=="function"?x(b):x;m?f(b):p&&p(lA({items:b,lookup:y}))},[]),a=dA(s),o=C.useMemo(()=>({nodeQueue:i,edgeQueue:a}),[]);return d.jsx(uP.Provider,{value:o,children:e})}function jce(){const e=C.useContext(uP);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Mce=e=>!!e.panZoom;function gg(){const e=Sce(),t=Sn(),n=jce(),i=Ft(Mce),s=C.useMemo(()=>{const a=p=>t.getState().nodeLookup.get(p),o=p=>{n.nodeQueue.push(p)},c=p=>{n.edgeQueue.push(p)},u=p=>{var v,_;const{nodeLookup:y,nodeOrigin:b}=t.getState(),x=uA(p)?p:y.get(p.id),w=x.parentId?DI(x.position,x.measured,x.parentId,y,b):x.position,E={...x,position:w,width:((v=x.measured)==null?void 0:v.width)??x.width,height:((_=x.measured)==null?void 0:_.height)??x.height};return Wd(E)},f=(p,y,b={replace:!1})=>{o(x=>x.map(w=>{if(w.id===p){const E=typeof y=="function"?y(w):y;return b.replace&&uA(E)?E:{...w,...E}}return w}))},m=(p,y,b={replace:!1})=>{c(x=>x.map(w=>{if(w.id===p){const E=typeof y=="function"?y(w):y;return b.replace&&_ce(E)?E:{...w,...E}}return w}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>{var y;return(y=a(p))==null?void 0:y.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:p=[]}=t.getState();return p.map(y=>({...y}))},getEdge:p=>t.getState().edgeLookup.get(p),setNodes:o,setEdges:c,addNodes:p=>{const y=Array.isArray(p)?p:[p];n.nodeQueue.push(b=>[...b,...y])},addEdges:p=>{const y=Array.isArray(p)?p:[p];n.edgeQueue.push(b=>[...b,...y])},toObject:()=>{const{nodes:p=[],edges:y=[],transform:b}=t.getState(),[x,w,E]=b;return{nodes:p.map(v=>({...v})),edges:y.map(v=>({...v})),viewport:{x,y:w,zoom:E}}},deleteElements:async({nodes:p=[],edges:y=[]})=>{const{nodes:b,edges:x,onNodesDelete:w,onEdgesDelete:E,triggerNodeChanges:v,triggerEdgeChanges:_,onDelete:k,onBeforeDelete:T}=t.getState(),{nodes:A,edges:j}=await tle({nodesToRemove:p,edgesToRemove:y,nodes:b,edges:x,onBeforeDelete:T}),M=j.length>0,D=A.length>0;if(M){const I=j.map(cA);E==null||E(j),_(I)}if(D){const I=A.map(cA);w==null||w(A),v(I)}return(D||M)&&(k==null||k({nodes:A,edges:j})),{deletedNodes:A,deletedEdges:j}},getIntersectingNodes:(p,y=!0,b)=>{const x=LT(p),w=x?p:u(p),E=b!==void 0;return w?(b||t.getState().nodes).filter(v=>{const _=t.getState().nodeLookup.get(v.id);if(_&&!x&&(v.id===p.id||!_.internals.positionAbsolute))return!1;const k=Wd(E?v:_),T=_m(k,w);return y&&T>0||T>=k.width*k.height||T>=w.width*w.height}):[]},isNodeIntersecting:(p,y,b=!0)=>{const w=LT(p)?p:u(p);if(!w)return!1;const E=_m(w,y);return b&&E>0||E>=y.width*y.height||E>=w.width*w.height},updateNode:f,updateNodeData:(p,y,b={replace:!1})=>{f(p,x=>{const w=typeof y=="function"?y(x):y;return b.replace?{...x,data:w}:{...x,data:{...x.data,...w}}},b)},updateEdge:m,updateEdgeData:(p,y,b={replace:!1})=>{m(p,x=>{const w=typeof y=="function"?y(x):y;return b.replace?{...x,data:w}:{...x,data:{...x.data,...w}}},b)},getNodesBounds:p=>{const{nodeLookup:y,nodeOrigin:b}=t.getState();return Qoe(p,{nodeLookup:y,nodeOrigin:b})},getHandleConnections:({type:p,id:y,nodeId:b})=>{var x;return Array.from(((x=t.getState().connectionLookup.get(`${b}-${p}${y?`-${y}`:""}`))==null?void 0:x.values())??[])},getNodeConnections:({type:p,handleId:y,nodeId:b})=>{var x;return Array.from(((x=t.getState().connectionLookup.get(`${b}${p?y?`-${p}-${y}`:`-${p}`:""}`))==null?void 0:x.values())??[])},fitView:async p=>{const y=t.getState().fitViewResolver??sle();return t.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:y}),n.nodeQueue.push(b=>[...b]),y.promise}}},[]);return C.useMemo(()=>({...s,...e,viewportInitialized:i}),[i])}const fA=e=>e.selected,Rce=typeof window<"u"?window:void 0;function Dce({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Sn(),{deleteElements:i}=gg(),s=Xd(e,{actInsideInputWithModifier:!1}),a=Xd(t,{target:Rce});C.useEffect(()=>{if(s){const{edges:o,nodes:c}=n.getState();i({nodes:c.filter(fA),edges:o.filter(fA)}),n.setState({nodesSelectionActive:!1})}},[s]),C.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function Oce(e){const t=Sn();C.useEffect(()=>{const n=()=>{var s,a,o,c;if(!e.current||!(((a=(s=e.current).checkVisibility)==null?void 0:a.call(s))??!0))return!1;const i=kw(e.current);(i.height===0||i.width===0)&&((c=(o=t.getState()).onError)==null||c.call(o,"004",as.error004())),t.setState({width:i.width||500,height:i.height||500})};if(e.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(e.current),()=>{window.removeEventListener("resize",n),i&&e.current&&i.unobserve(e.current)}}},[])}const yg={position:"absolute",width:"100%",height:"100%",top:0,left:0},Lce=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Ice({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:s=.5,panOnScrollMode:a=Jo.Free,zoomOnDoubleClick:o=!0,panOnDrag:c=!0,defaultViewport:u,translateExtent:f,minZoom:m,maxZoom:p,zoomActivationKeyCode:y,preventScrolling:b=!0,children:x,noWheelClassName:w,noPanClassName:E,onViewportChange:v,isControlledViewport:_,paneClickDistance:k,selectionOnDrag:T}){const A=Sn(),j=C.useRef(null),{userSelectionActive:M,lib:D,connectionInProgress:I}=Ft(Lce,En),P=Xd(y),U=C.useRef();Oce(j);const q=C.useCallback(V=>{v==null||v({x:V[0],y:V[1],zoom:V[2]}),_||A.setState({transform:V})},[v,_]);return C.useEffect(()=>{if(j.current){U.current=Fle({domNode:j.current,minZoom:m,maxZoom:p,translateExtent:f,viewport:u,onDraggingChange:z=>A.setState(G=>G.paneDragging===z?G:{paneDragging:z}),onPanZoomStart:(z,G)=>{const{onViewportChangeStart:Y,onMoveStart:K}=A.getState();K==null||K(z,G),Y==null||Y(G)},onPanZoom:(z,G)=>{const{onViewportChange:Y,onMove:K}=A.getState();K==null||K(z,G),Y==null||Y(G)},onPanZoomEnd:(z,G)=>{const{onViewportChangeEnd:Y,onMoveEnd:K}=A.getState();K==null||K(z,G),Y==null||Y(G)}});const{x:V,y:O,zoom:R}=U.current.getViewport();return A.setState({panZoom:U.current,transform:[V,O,R],domNode:j.current.closest(".react-flow")}),()=>{var z;(z=U.current)==null||z.destroy()}}},[]),C.useEffect(()=>{var V;(V=U.current)==null||V.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:s,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:c,zoomActivationKeyPressed:P,preventScrolling:b,noPanClassName:E,userSelectionActive:M,noWheelClassName:w,lib:D,onTransformChange:q,connectionInProgress:I,selectionOnDrag:T,paneClickDistance:k})},[e,t,n,i,s,a,o,c,P,b,E,M,w,D,q,I,T,k]),d.jsx("div",{className:"react-flow__renderer",ref:j,style:yg,children:x})}const Pce=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function zce(){const{userSelectionActive:e,userSelectionRect:t}=Ft(Pce,En);return e&&t?d.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Hx=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Bce=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Uce({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Gd.Full,panOnDrag:i,autoPanOnSelection:s,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:c,onSelectionEnd:u,onPaneClick:f,onPaneContextMenu:m,onPaneScroll:p,onPaneMouseEnter:y,onPaneMouseMove:b,onPaneMouseLeave:x,children:w}){const E=C.useRef(0),v=Sn(),{userSelectionActive:_,elementsSelectable:k,dragging:T,panBy:A,autoPanSpeed:j}=Ft(Bce,En),M=k&&(e||_),D=C.useRef(null),I=C.useRef(),P=C.useRef(new Set),U=C.useRef(new Set),q=C.useRef(!1),V=C.useRef(!1),O=C.useRef({x:0,y:0}),R=C.useRef(!1),z=re=>{if(V.current||q.current||v.getState().connection.inProgress){V.current=!1,q.current=!1;return}f==null||f(re),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},G=re=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){re.preventDefault();return}m==null||m(re)},Y=p?re=>p(re):void 0,K=re=>{V.current&&(re.stopPropagation(),V.current=!1)},B=re=>{var Re,Qe;const{domNode:me,transform:se}=v.getState();if(I.current=me==null?void 0:me.getBoundingClientRect(),!I.current)return;const Q=re.target===D.current;if(!Q&&!!re.target.closest(".nokey")||!e||!(o&&Q||t)||re.button!==0||!re.isPrimary)return;(Qe=(Re=re.target)==null?void 0:Re.setPointerCapture)==null||Qe.call(Re,re.pointerId),V.current=!1;const{x:ze,y:fe}=Us(re.nativeEvent,I.current),Se=_f({x:ze,y:fe},se);v.setState({userSelectionRect:{width:0,height:0,startX:Se.x,startY:Se.y,x:ze,y:fe}}),Q||(re.stopPropagation(),re.preventDefault())};function F(re,me){const{userSelectionRect:se}=v.getState();if(!se)return;const{transform:Q,nodeLookup:ye,edgeLookup:_e,connectionLookup:ze,triggerNodeChanges:fe,triggerEdgeChanges:Se,defaultEdgeOptions:Re}=v.getState(),Qe={x:se.startX,y:se.startY},{x:ht,y:it}=Fc(Qe,Q),Bt={startX:Qe.x,startY:Qe.y,x:re<ht?re:ht,y:me<it?me:it,width:Math.abs(re-ht),height:Math.abs(me-it)},mt=P.current,wt=U.current;P.current=new Set(ww(ye,Bt,Q,n===Gd.Partial,!0).map(ct=>ct.id)),U.current=new Set;const Te=(Re==null?void 0:Re.selectable)??!0;for(const ct of P.current){const ne=ze.get(ct);if(ne)for(const{edgeId:we}of ne.values()){const he=_e.get(we);he&&(he.selectable??Te)&&U.current.add(we)}}if(!IT(mt,P.current)){const ct=uc(ye,P.current,!0);fe(ct)}if(!IT(wt,U.current)){const ct=uc(_e,U.current);Se(ct)}v.setState({userSelectionRect:Bt,userSelectionActive:!0,nodesSelectionActive:!1})}function W(){if(!s||!I.current)return;const[re,me]=Ew(O.current,I.current,j);A({x:re,y:me}).then(se=>{if(!V.current||!se){E.current=requestAnimationFrame(W);return}const{x:Q,y:ye}=O.current;F(Q,ye),E.current=requestAnimationFrame(W)})}const $=()=>{cancelAnimationFrame(E.current),E.current=0,R.current=!1};C.useEffect(()=>()=>$(),[]);const ae=re=>{const{userSelectionRect:me,transform:se,resetSelectedElements:Q}=v.getState();if(!I.current||!me)return;const{x:ye,y:_e}=Us(re.nativeEvent,I.current);O.current={x:ye,y:_e};const ze=Fc({x:me.startX,y:me.startY},se);if(!V.current){const fe=t?0:a;if(Math.hypot(ye-ze.x,_e-ze.y)<=fe)return;Q(),c==null||c(re)}V.current=!0,R.current||(W(),R.current=!0),F(ye,_e)},be=re=>{var me,se;if(!M){re.target===D.current&&v.getState().connection.inProgress&&(q.current=!0);return}re.button===0&&((se=(me=re.target)==null?void 0:me.releasePointerCapture)==null||se.call(me,re.pointerId),!_&&re.target===D.current&&v.getState().userSelectionRect&&(z==null||z(re)),v.setState({userSelectionActive:!1,userSelectionRect:null}),V.current&&(u==null||u(re),v.setState({nodesSelectionActive:P.current.size>0})),$())},le=re=>{var me,se;(se=(me=re.target)==null?void 0:me.releasePointerCapture)==null||se.call(me,re.pointerId),$()},Ne=i===!0||Array.isArray(i)&&i.includes(0);return d.jsxs("div",{className:Wn(["react-flow__pane",{draggable:Ne,dragging:T,selection:e}]),onClick:M?void 0:Hx(z,D),onContextMenu:Hx(G,D),onWheel:Hx(Y,D),onPointerEnter:M?void 0:y,onPointerMove:M?ae:b,onPointerUp:be,onPointerCancel:M?le:void 0,onPointerDownCapture:M?B:void 0,onClickCapture:M?K:void 0,onPointerLeave:x,ref:D,style:yg,children:[w,d.jsx(zce,{})]})}function _v({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:s,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:c,onError:u}=t.getState(),f=c.get(e);if(!f){u==null||u("012",as.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&o)&&(a({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var m;return(m=i==null?void 0:i.current)==null?void 0:m.blur()})):s([e])}function dP({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:s,isSelectable:a,nodeClickDistance:o}){const c=Sn(),[u,f]=C.useState(!1),m=C.useRef();return C.useEffect(()=>{m.current=Cle({getStoreItems:()=>c.getState(),onNodeMouseDown:p=>{_v({id:p,store:c,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),C.useEffect(()=>{if(!(t||!e.current||!m.current))return m.current.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:a,nodeId:s,nodeClickDistance:o}),()=>{var p;(p=m.current)==null||p.destroy()}},[n,i,t,a,e,s,o]),u}const Fce=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function fP(){const e=Sn();return C.useCallback(n=>{const{nodeExtent:i,snapToGrid:s,snapGrid:a,nodesDraggable:o,onError:c,updateNodePositions:u,nodeLookup:f,nodeOrigin:m}=e.getState(),p=new Map,y=Fce(o),b=s?a[0]:5,x=s?a[1]:5,w=n.direction.x*b*n.factor,E=n.direction.y*x*n.factor;for(const[,v]of f){if(!y(v))continue;let _={x:v.internals.positionAbsolute.x+w,y:v.internals.positionAbsolute.y+E};s&&(_=Nf(_,a));const{position:k,positionAbsolute:T}=CI({nodeId:v.id,nextPosition:_,nodeLookup:f,nodeExtent:i,nodeOrigin:m,onError:c});v.position=k,v.internals.positionAbsolute=T,p.set(v.id,v)}u(p)},[])}const jw=C.createContext(null),$ce=jw.Provider;jw.Consumer;const hP=()=>C.useContext(jw),qce=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),pP=C.createContext(null);function Hce({children:e}){const t=Ft(qce,En);return d.jsx(pP.Provider,{value:t,children:e})}function Vce(){const e=C.useContext(pP);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const Kce={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},Gce=(e,t,n)=>i=>{const{connectionClickStartHandle:s,connectionMode:a,connection:o}=i,{fromHandle:c,toHandle:u,isValid:f}=o;if(!c&&!s)return Kce;const m=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:m,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:a===Bc.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!s,valid:m&&f}};function Wce({type:e="source",position:t=Je.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:s=!0,isConnectableEnd:a=!0,id:o,onConnect:c,children:u,className:f,onMouseDown:m,onTouchStart:p,...y},b){var R,z;const x=o||null,w=e==="target",E=Sn(),v=hP(),{connectOnClick:_,noPanClassName:k,rfId:T}=Vce(),{connectingFrom:A,connectingTo:j,clickConnecting:M,isPossibleEndHandle:D,connectionInProcess:I,clickConnectionInProcess:P,valid:U}=Ft(Gce(v,x,e),En);v||(z=(R=E.getState()).onError)==null||z.call(R,"010",as.error010());const q=G=>{const{defaultEdgeOptions:Y,onConnect:K,hasDefaultEdges:B}=E.getState(),F={...Y,...G};if(B){const{edges:W,setEdges:$,onError:ae}=E.getState();$(lP(F,W,{onError:ae}))}K==null||K(F),c==null||c(F)},V=G=>{if(!v)return;const Y=II(G.nativeEvent);if(s&&(Y&&G.button===0||!Y)){const K=E.getState();Nv.onPointerDown(G.nativeEvent,{handleDomNode:G.currentTarget,autoPanOnConnect:K.autoPanOnConnect,connectionMode:K.connectionMode,connectionRadius:K.connectionRadius,domNode:K.domNode,nodeLookup:K.nodeLookup,lib:K.lib,isTarget:w,handleId:x,nodeId:v,flowId:K.rfId,panBy:K.panBy,cancelConnection:K.cancelConnection,onConnectStart:K.onConnectStart,onConnectEnd:(...B)=>{var F,W;return(W=(F=E.getState()).onConnectEnd)==null?void 0:W.call(F,...B)},updateConnection:K.updateConnection,onConnect:q,isValidConnection:n||((...B)=>{var F,W;return((W=(F=E.getState()).isValidConnection)==null?void 0:W.call(F,...B))??!0}),getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,autoPanSpeed:K.autoPanSpeed,dragThreshold:K.connectionDragThreshold})}Y?m==null||m(G):p==null||p(G)},O=G=>{const{onClickConnectStart:Y,onClickConnectEnd:K,connectionClickStartHandle:B,connectionMode:F,isValidConnection:W,lib:$,rfId:ae,nodeLookup:be,connection:le}=E.getState();if(!v||!B&&!s)return;if(!B){Y==null||Y(G.nativeEvent,{nodeId:v,handleId:x,handleType:e}),E.setState({connectionClickStartHandle:{nodeId:v,type:e,id:x}});return}const Ne=OI(G.target),re=n||W,{connection:me,isValid:se}=Nv.isValid(G.nativeEvent,{handle:{nodeId:v,id:x,type:e},connectionMode:F,fromNodeId:B.nodeId,fromHandleId:B.id||null,fromType:B.type,isValidConnection:re,flowId:ae,doc:Ne,lib:$,nodeLookup:be});se&&me&&q(me);const Q=structuredClone(le);delete Q.inProgress,Q.toPosition=Q.toHandle?Q.toHandle.position:null,K==null||K(G,Q),E.setState({connectionClickStartHandle:null})};return d.jsx("div",{"data-handleid":x,"data-nodeid":v,"data-handlepos":t,"data-id":`${T}-${v}-${x}-${e}`,className:Wn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",k,f,{source:!w,target:w,connectable:i,connectablestart:s,connectableend:a,clickconnecting:M,connectingfrom:A,connectingto:j,valid:U,connectionindicator:i&&(!I||D)&&(I||P?a:s)}]),onMouseDown:V,onTouchStart:V,onClick:_?O:void 0,ref:b,...y,children:u})}const Za=C.memo(cP(Wce));function Yce({data:e,isConnectable:t,sourcePosition:n=Je.Bottom}){return d.jsxs(d.Fragment,{children:[e==null?void 0:e.label,d.jsx(Za,{type:"source",position:n,isConnectable:t})]})}function Xce({data:e,isConnectable:t,targetPosition:n=Je.Top,sourcePosition:i=Je.Bottom}){return d.jsxs(d.Fragment,{children:[d.jsx(Za,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,d.jsx(Za,{type:"source",position:i,isConnectable:t})]})}function Qce(){return null}function Zce({data:e,isConnectable:t,targetPosition:n=Je.Top}){return d.jsxs(d.Fragment,{children:[d.jsx(Za,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Cm={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},hA={input:Yce,default:Xce,output:Zce,group:Qce};function Jce(e){var t,n,i,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((i=e.style)==null?void 0:i.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const eue=e=>{const{width:t,height:n,x:i,y:s}=kf(e.nodeLookup,{filter:a=>!!a.selected});return{width:Bs(t)?t:null,height:Bs(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${s}px)`}};function tue({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=Sn(),{width:s,height:a,transformString:o,userSelectionActive:c}=Ft(eue,En),u=fP(),f=C.useRef(null);C.useEffect(()=>{var b;n||(b=f.current)==null||b.focus({preventScroll:!0})},[n]);const m=!c&&s!==null&&a!==null;if(dP({nodeRef:f,disabled:!m}),!m)return null;const p=e?b=>{const x=i.getState().nodes.filter(w=>w.selected);e(b,x)}:void 0,y=b=>{Object.prototype.hasOwnProperty.call(Cm,b.key)&&(b.preventDefault(),u({direction:Cm[b.key],factor:b.shiftKey?4:1}))};return d.jsx("div",{className:Wn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:d.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:n?void 0:-1,onKeyDown:n?void 0:y,style:{width:s,height:a}})})}const pA=typeof window<"u"?window:void 0,nue=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function mP({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:s,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:c,deleteKeyCode:u,selectionKeyCode:f,selectionOnDrag:m,selectionMode:p,onSelectionStart:y,onSelectionEnd:b,multiSelectionKeyCode:x,panActivationKeyCode:w,zoomActivationKeyCode:E,elementsSelectable:v,zoomOnScroll:_,zoomOnPinch:k,panOnScroll:T,panOnScrollSpeed:A,panOnScrollMode:j,zoomOnDoubleClick:M,panOnDrag:D,autoPanOnSelection:I,defaultViewport:P,translateExtent:U,minZoom:q,maxZoom:V,preventScrolling:O,onSelectionContextMenu:R,noWheelClassName:z,noPanClassName:G,disableKeyboardA11y:Y,onViewportChange:K,isControlledViewport:B}){const{nodesSelectionActive:F,userSelectionActive:W}=Ft(nue,En),$=Xd(f,{target:pA}),ae=Xd(w,{target:pA}),be=ae||D,le=ae||T,Ne=m&&be!==!0,re=$||W||Ne;return Dce({deleteKeyCode:u,multiSelectionKeyCode:x}),d.jsx(Ice,{onPaneContextMenu:a,elementsSelectable:v,zoomOnScroll:_,zoomOnPinch:k,panOnScroll:le,panOnScrollSpeed:A,panOnScrollMode:j,zoomOnDoubleClick:M,panOnDrag:!$&&be,defaultViewport:P,translateExtent:U,minZoom:q,maxZoom:V,zoomActivationKeyCode:E,preventScrolling:O,noWheelClassName:z,noPanClassName:G,onViewportChange:K,isControlledViewport:B,paneClickDistance:c,selectionOnDrag:Ne,children:d.jsxs(Uce,{onSelectionStart:y,onSelectionEnd:b,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:s,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:be,autoPanOnSelection:I,isSelecting:!!re,selectionMode:p,selectionKeyPressed:$,paneClickDistance:c,selectionOnDrag:Ne,children:[e,F&&d.jsx(tue,{onSelectionContextMenu:R,noPanClassName:G,disableKeyboardA11y:Y})]})})}mP.displayName="FlowRenderer";const iue=C.memo(mP),sue=e=>t=>e?ww(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function rue(e){return Ft(C.useCallback(sue(e),[e]),En)}const aue=e=>e.updateNodeInternals;function oue(){const e=Ft(aue),[t]=C.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(s=>{const a=s.target.getAttribute("data-id");i.set(a,{id:a,nodeElement:s.target,force:!0})}),e(i)}));return C.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function lue({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const s=Sn(),a=C.useRef(null),o=C.useRef(null),c=C.useRef(e.sourcePosition),u=C.useRef(e.targetPosition),f=C.useRef(t),m=n&&!!e.internals.handleBounds;return C.useEffect(()=>{a.current&&!e.hidden&&(!m||o.current!==a.current)&&(o.current&&(i==null||i.unobserve(o.current)),i==null||i.observe(a.current),o.current=a.current)},[m,e.hidden]),C.useEffect(()=>()=>{o.current&&(i==null||i.unobserve(o.current),o.current=null)},[]),C.useEffect(()=>{if(a.current){const p=f.current!==t,y=c.current!==e.sourcePosition,b=u.current!==e.targetPosition;(p||y||b)&&(f.current=t,c.current=e.sourcePosition,u.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function cue({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:s,onContextMenu:a,onDoubleClick:o,nodesDraggable:c,elementsSelectable:u,nodesConnectable:f,nodesFocusable:m,resizeObserver:p,noDragClassName:y,noPanClassName:b,disableKeyboardA11y:x,rfId:w,nodeTypes:E,nodeClickDistance:v,onError:_}){const{node:k,internals:T,isParent:A}=Ft(re=>{const me=re.nodeLookup.get(e),se=re.parentLookup.has(e);return{node:me,internals:me.internals,isParent:se}},En);let j=k.type||"default",M=(E==null?void 0:E[j])||hA[j];M===void 0&&(_==null||_("003",as.error003(j)),j="default",M=(E==null?void 0:E.default)||hA.default);const D=!!(k.draggable||c&&typeof k.draggable>"u"),I=!!(k.selectable||u&&typeof k.selectable>"u"),P=!!(k.connectable||f&&typeof k.connectable>"u"),U=!!(k.focusable||m&&typeof k.focusable>"u"),q=Sn(),V=RI(k),O=lue({node:k,nodeType:j,hasDimensions:V,resizeObserver:p}),R=dP({nodeRef:O,disabled:k.hidden||!D,noDragClassName:y,handleSelector:k.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:v}),z=fP();if(k.hidden)return null;const G=ia(k),Y=Jce(k),K=I||D||t||n||i||s,B=n?re=>n(re,{...T.userNode}):void 0,F=i?re=>i(re,{...T.userNode}):void 0,W=s?re=>s(re,{...T.userNode}):void 0,$=a?re=>a(re,{...T.userNode}):void 0,ae=o?re=>o(re,{...T.userNode}):void 0,be=re=>{const{selectNodesOnDrag:me,nodeDragThreshold:se}=q.getState();I&&(!me||!D||se>0)&&_v({id:e,store:q,nodeRef:O}),t&&t(re,{...T.userNode})},le=re=>{if(!(LI(re.nativeEvent)||x)){if(EI.includes(re.key)&&I){const me=re.key==="Escape";_v({id:e,store:q,unselect:me,nodeRef:O})}else if(D&&k.selected&&Object.prototype.hasOwnProperty.call(Cm,re.key)){re.preventDefault();const{ariaLabelConfig:me}=q.getState();q.setState({ariaLiveMessage:me["node.a11yDescription.ariaLiveMessage"]({direction:re.key.replace("Arrow","").toLowerCase(),x:~~T.positionAbsolute.x,y:~~T.positionAbsolute.y})}),z({direction:Cm[re.key],factor:re.shiftKey?4:1})}}},Ne=()=>{var ze;if(x||!((ze=O.current)!=null&&ze.matches(":focus-visible")))return;const{transform:re,width:me,height:se,autoPanOnNodeFocus:Q,setCenter:ye}=q.getState();if(!Q)return;ww(new Map([[e,k]]),{x:0,y:0,width:me,height:se},re,!0).length>0||ye(k.position.x+G.width/2,k.position.y+G.height/2,{zoom:re[2]})};return d.jsx("div",{className:Wn(["react-flow__node",`react-flow__node-${j}`,{[b]:D},k.className,{selected:k.selected,selectable:I,parent:A,draggable:D,dragging:R}]),ref:O,style:{zIndex:T.z,transform:`translate(${T.positionAbsolute.x}px,${T.positionAbsolute.y}px)`,pointerEvents:K?"all":"none",visibility:V?"visible":"hidden",...k.style,...Y},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:B,onMouseMove:F,onMouseLeave:W,onContextMenu:$,onClick:be,onDoubleClick:ae,onKeyDown:U?le:void 0,tabIndex:U?0:void 0,onFocus:U?Ne:void 0,role:k.ariaRole??(U?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${tP}-${w}`,"aria-label":k.ariaLabel,...k.domAttributes,children:d.jsx($ce,{value:e,children:d.jsx(M,{id:e,data:k.data,type:j,positionAbsoluteX:T.positionAbsolute.x,positionAbsoluteY:T.positionAbsolute.y,selected:k.selected??!1,selectable:I,draggable:D,deletable:k.deletable??!0,isConnectable:P,sourcePosition:k.sourcePosition,targetPosition:k.targetPosition,dragging:R,dragHandle:k.dragHandle,zIndex:T.z,parentId:k.parentId,...G})})})}var uue=C.memo(cue);const due=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function gP(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:s,onError:a}=Ft(due,En),o=rue(e.onlyRenderVisibleElements),c=oue();return d.jsx("div",{className:"react-flow__nodes",style:yg,children:o.map(u=>d.jsx(uue,{id:u,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:a},u))})}gP.displayName="NodeRenderer";const fue=C.memo(gP);function hue(e){return Ft(C.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const i=[];if(n.width&&n.height)for(const s of n.edges){const a=n.nodeLookup.get(s.source),o=n.nodeLookup.get(s.target);a&&o&&lle({sourceNode:a,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&i.push(s.id)}return i},[e]),En)}const pue=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return d.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},mue=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return d.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},mA={[km.Arrow]:pue,[km.ArrowClosed]:mue};function gue(e){const t=Sn();return C.useMemo(()=>{var s,a;return Object.prototype.hasOwnProperty.call(mA,e)?mA[e]:((a=(s=t.getState()).onError)==null||a.call(s,"009",as.error009(e)),null)},[e])}const yue=({id:e,type:t,color:n,width:i=12.5,height:s=12.5,markerUnits:a="strokeWidth",strokeWidth:o,orient:c="auto-start-reverse"})=>{const u=gue(t);return u?d.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:c,refX:"0",refY:"0",children:d.jsx(u,{color:n,strokeWidth:o})}):null},yP=({defaultColor:e,rfId:t})=>{const n=Ft(a=>a.edges),i=Ft(a=>a.defaultEdgeOptions),s=C.useMemo(()=>gle(n,{id:t,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,t,e]);return s.length?d.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:d.jsx("defs",{children:s.map(a=>d.jsx(yue,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};yP.displayName="MarkerDefinitions";var bue=C.memo(yP);function bP({x:e,y:t,label:n,labelStyle:i,labelShowBg:s=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:c=2,children:u,className:f,...m}){const[p,y]=C.useState({x:1,y:0,width:0,height:0}),b=Wn(["react-flow__edge-textwrapper",f]),x=C.useRef(null);return C.useEffect(()=>{if(x.current){const w=x.current.getBBox();y({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?d.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:b,visibility:p.width?"visible":"hidden",...m,children:[s&&d.jsx("rect",{width:p.width+2*o[0],x:-o[0],y:-o[1],height:p.height+2*o[1],className:"react-flow__edge-textbg",style:a,rx:c,ry:c}),d.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:x,style:i,children:n}),u]}):null}bP.displayName="EdgeText";const xue=C.memo(bP);function bg({path:e,labelX:t,labelY:n,label:i,labelStyle:s,labelShowBg:a,labelBgStyle:o,labelBgPadding:c,labelBgBorderRadius:u,interactionWidth:f=20,...m}){return d.jsxs(d.Fragment,{children:[d.jsx("path",{...m,d:e,fill:"none",className:Wn(["react-flow__edge-path",m.className])}),f?d.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,i&&Bs(t)&&Bs(n)?d.jsx(xue,{x:t,y:n,label:i,labelStyle:s,labelShowBg:a,labelBgStyle:o,labelBgPadding:c,labelBgBorderRadius:u}):null]})}function gA({pos:e,x1:t,y1:n,x2:i,y2:s}){return e===Je.Left||e===Je.Right?[.5*(t+i),n]:[t,.5*(n+s)]}function xP({sourceX:e,sourceY:t,sourcePosition:n=Je.Bottom,targetX:i,targetY:s,targetPosition:a=Je.Top}){const[o,c]=gA({pos:n,x1:e,y1:t,x2:i,y2:s}),[u,f]=gA({pos:a,x1:i,y1:s,x2:e,y2:t}),[m,p,y,b]=PI({sourceX:e,sourceY:t,targetX:i,targetY:s,sourceControlX:o,sourceControlY:c,targetControlX:u,targetControlY:f});return[`M${e},${t} C${o},${c} ${u},${f} ${i},${s}`,m,p,y,b]}function vP(e){return C.memo(({id:t,sourceX:n,sourceY:i,targetX:s,targetY:a,sourcePosition:o,targetPosition:c,label:u,labelStyle:f,labelShowBg:m,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:b,style:x,markerEnd:w,markerStart:E,interactionWidth:v})=>{const[_,k,T]=xP({sourceX:n,sourceY:i,sourcePosition:o,targetX:s,targetY:a,targetPosition:c}),A=e.isInternal?void 0:t;return d.jsx(bg,{id:A,path:_,labelX:k,labelY:T,label:u,labelStyle:f,labelShowBg:m,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:b,style:x,markerEnd:w,markerStart:E,interactionWidth:v})})}const vue=vP({isInternal:!1}),wP=vP({isInternal:!0});vue.displayName="SimpleBezierEdge";wP.displayName="SimpleBezierEdgeInternal";function EP(e){return C.memo(({id:t,sourceX:n,sourceY:i,targetX:s,targetY:a,label:o,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:p,style:y,sourcePosition:b=Je.Bottom,targetPosition:x=Je.Top,markerEnd:w,markerStart:E,pathOptions:v,interactionWidth:_})=>{const[k,T,A]=Ev({sourceX:n,sourceY:i,sourcePosition:b,targetX:s,targetY:a,targetPosition:x,borderRadius:v==null?void 0:v.borderRadius,offset:v==null?void 0:v.offset,stepPosition:v==null?void 0:v.stepPosition}),j=e.isInternal?void 0:t;return d.jsx(bg,{id:j,path:k,labelX:T,labelY:A,label:o,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:p,style:y,markerEnd:w,markerStart:E,interactionWidth:_})})}const SP=EP({isInternal:!1}),kP=EP({isInternal:!0});SP.displayName="SmoothStepEdge";kP.displayName="SmoothStepEdgeInternal";function NP(e){return C.memo(({id:t,...n})=>{var s;const i=e.isInternal?void 0:t;return d.jsx(SP,{...n,id:i,pathOptions:C.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const wue=NP({isInternal:!1}),_P=NP({isInternal:!0});wue.displayName="StepEdge";_P.displayName="StepEdgeInternal";function CP(e){return C.memo(({id:t,sourceX:n,sourceY:i,targetX:s,targetY:a,label:o,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:p,style:y,markerEnd:b,markerStart:x,interactionWidth:w})=>{const[E,v,_]=FI({sourceX:n,sourceY:i,targetX:s,targetY:a}),k=e.isInternal?void 0:t;return d.jsx(bg,{id:k,path:E,labelX:v,labelY:_,label:o,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:p,style:y,markerEnd:b,markerStart:x,interactionWidth:w})})}const Eue=CP({isInternal:!1}),TP=CP({isInternal:!0});Eue.displayName="StraightEdge";TP.displayName="StraightEdgeInternal";function AP(e){return C.memo(({id:t,sourceX:n,sourceY:i,targetX:s,targetY:a,sourcePosition:o=Je.Bottom,targetPosition:c=Je.Top,label:u,labelStyle:f,labelShowBg:m,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:b,style:x,markerEnd:w,markerStart:E,pathOptions:v,interactionWidth:_})=>{const[k,T,A]=zI({sourceX:n,sourceY:i,sourcePosition:o,targetX:s,targetY:a,targetPosition:c,curvature:v==null?void 0:v.curvature}),j=e.isInternal?void 0:t;return d.jsx(bg,{id:j,path:k,labelX:T,labelY:A,label:u,labelStyle:f,labelShowBg:m,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:b,style:x,markerEnd:w,markerStart:E,interactionWidth:_})})}const Sue=AP({isInternal:!1}),jP=AP({isInternal:!0});Sue.displayName="BezierEdge";jP.displayName="BezierEdgeInternal";const yA={default:jP,straight:TP,step:_P,smoothstep:kP,simplebezier:wP},bA={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},kue=(e,t,n)=>n===Je.Left?e-t:n===Je.Right?e+t:e,Nue=(e,t,n)=>n===Je.Top?e-t:n===Je.Bottom?e+t:e,xA="react-flow__edgeupdater";function vA({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:s,onMouseEnter:a,onMouseOut:o,type:c}){return d.jsx("circle",{onMouseDown:s,onMouseEnter:a,onMouseOut:o,className:Wn([xA,`${xA}-${c}`]),cx:kue(t,i,e),cy:Nue(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function _ue({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:s,targetX:a,targetY:o,sourcePosition:c,targetPosition:u,onReconnect:f,onReconnectStart:m,onReconnectEnd:p,setReconnecting:y,setUpdateHover:b}){const x=Sn(),w=(T,A)=>{if(T.button!==0)return;const{autoPanOnConnect:j,domNode:M,connectionMode:D,connectionRadius:I,lib:P,onConnectStart:U,cancelConnection:q,nodeLookup:V,rfId:O,panBy:R,updateConnection:z}=x.getState(),G=A.type==="target",Y=(F,W)=>{y(!1),p==null||p(F,n,A.type,W)},K=F=>f==null?void 0:f(n,F),B=(F,W)=>{y(!0),m==null||m(T,n,A.type),U==null||U(F,W)};Nv.onPointerDown(T.nativeEvent,{autoPanOnConnect:j,connectionMode:D,connectionRadius:I,domNode:M,handleId:A.id,nodeId:A.nodeId,nodeLookup:V,isTarget:G,edgeUpdaterType:A.type,lib:P,flowId:O,cancelConnection:q,panBy:R,isValidConnection:(...F)=>{var W,$;return(($=(W=x.getState()).isValidConnection)==null?void 0:$.call(W,...F))??!0},onConnect:K,onConnectStart:B,onConnectEnd:(...F)=>{var W,$;return($=(W=x.getState()).onConnectEnd)==null?void 0:$.call(W,...F)},onReconnectEnd:Y,updateConnection:z,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:T.currentTarget})},E=T=>w(T,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),v=T=>w(T,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),_=()=>b(!0),k=()=>b(!1);return d.jsxs(d.Fragment,{children:[(e===!0||e==="source")&&d.jsx(vA,{position:c,centerX:i,centerY:s,radius:t,onMouseDown:E,onMouseEnter:_,onMouseOut:k,type:"source"}),(e===!0||e==="target")&&d.jsx(vA,{position:u,centerX:a,centerY:o,radius:t,onMouseDown:v,onMouseEnter:_,onMouseOut:k,type:"target"})]})}function Cue({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:s,onDoubleClick:a,onContextMenu:o,onMouseEnter:c,onMouseMove:u,onMouseLeave:f,reconnectRadius:m,onReconnect:p,onReconnectStart:y,onReconnectEnd:b,rfId:x,edgeTypes:w,noPanClassName:E,onError:v,disableKeyboardA11y:_}){let k=Ft(ye=>ye.edgeLookup.get(e));const T=Ft(ye=>ye.defaultEdgeOptions);k=T?{...T,...k}:k;let A=k.type||"default",j=(w==null?void 0:w[A])||yA[A];j===void 0&&(v==null||v("011",as.error011(A)),A="default",j=(w==null?void 0:w.default)||yA.default);const M=!!(k.focusable||t&&typeof k.focusable>"u"),D=typeof p<"u"&&(k.reconnectable||n&&typeof k.reconnectable>"u"),I=!!(k.selectable||i&&typeof k.selectable>"u"),P=C.useRef(null),[U,q]=C.useState(!1),[V,O]=C.useState(!1),R=Sn(),{zIndex:z=k.zIndex,sourceX:G,sourceY:Y,targetX:K,targetY:B,sourcePosition:F,targetPosition:W}=Ft(C.useCallback(ye=>{const _e=ye.nodeLookup.get(k.source),ze=ye.nodeLookup.get(k.target);if(!_e||!ze)return bA;const fe=mle({id:e,sourceNode:_e,targetNode:ze,sourceHandle:k.sourceHandle||null,targetHandle:k.targetHandle||null,connectionMode:ye.connectionMode,onError:v}),Se=ole({selected:k.selected,zIndex:k.zIndex,sourceNode:_e,targetNode:ze,elevateOnSelect:ye.elevateEdgesOnSelect,zIndexMode:ye.zIndexMode});return{...fe||bA,zIndex:Se}},[k.source,k.target,k.sourceHandle,k.targetHandle,k.selected,k.zIndex]),En),$=C.useMemo(()=>k.markerStart?`url('#${Sv(k.markerStart,x)}')`:void 0,[k.markerStart,x]),ae=C.useMemo(()=>k.markerEnd?`url('#${Sv(k.markerEnd,x)}')`:void 0,[k.markerEnd,x]);if(k.hidden||G===null||Y===null||K===null||B===null)return null;const be=ye=>{var Se;const{addSelectedEdges:_e,unselectNodesAndEdges:ze,multiSelectionActive:fe}=R.getState();I&&(R.setState({nodesSelectionActive:!1}),k.selected&&fe?(ze({nodes:[],edges:[k]}),(Se=P.current)==null||Se.blur()):_e([e])),s&&s(ye,k)},le=a?ye=>{a(ye,{...k})}:void 0,Ne=o?ye=>{o(ye,{...k})}:void 0,re=c?ye=>{c(ye,{...k})}:void 0,me=u?ye=>{u(ye,{...k})}:void 0,se=f?ye=>{f(ye,{...k})}:void 0,Q=ye=>{var _e;if(!_&&EI.includes(ye.key)&&I){const{unselectNodesAndEdges:ze,addSelectedEdges:fe}=R.getState();ye.key==="Escape"?((_e=P.current)==null||_e.blur(),ze({edges:[k]})):fe([e])}};return d.jsx("svg",{style:{zIndex:z},children:d.jsxs("g",{className:Wn(["react-flow__edge",`react-flow__edge-${A}`,k.className,E,{selected:k.selected,animated:k.animated,inactive:!I&&!s,updating:U,selectable:I}]),onClick:be,onDoubleClick:le,onContextMenu:Ne,onMouseEnter:re,onMouseMove:me,onMouseLeave:se,onKeyDown:M?Q:void 0,tabIndex:M?0:void 0,role:k.ariaRole??(M?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":k.ariaLabel===null?void 0:k.ariaLabel||`Edge from ${k.source} to ${k.target}`,"aria-describedby":M?`${nP}-${x}`:void 0,ref:P,...k.domAttributes,children:[!V&&d.jsx(j,{id:e,source:k.source,target:k.target,type:k.type,selected:k.selected,animated:k.animated,selectable:I,deletable:k.deletable??!0,label:k.label,labelStyle:k.labelStyle,labelShowBg:k.labelShowBg,labelBgStyle:k.labelBgStyle,labelBgPadding:k.labelBgPadding,labelBgBorderRadius:k.labelBgBorderRadius,sourceX:G,sourceY:Y,targetX:K,targetY:B,sourcePosition:F,targetPosition:W,data:k.data,style:k.style,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle,markerStart:$,markerEnd:ae,pathOptions:"pathOptions"in k?k.pathOptions:void 0,interactionWidth:k.interactionWidth}),D&&d.jsx(_ue,{edge:k,isReconnectable:D,reconnectRadius:m,onReconnect:p,onReconnectStart:y,onReconnectEnd:b,sourceX:G,sourceY:Y,targetX:K,targetY:B,sourcePosition:F,targetPosition:W,setUpdateHover:q,setReconnecting:O})]})})}var Tue=C.memo(Cue);const Aue=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function MP({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:s,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:c,onEdgeMouseMove:u,onEdgeMouseLeave:f,onEdgeClick:m,reconnectRadius:p,onEdgeDoubleClick:y,onReconnectStart:b,onReconnectEnd:x,disableKeyboardA11y:w}){const{edgesFocusable:E,edgesReconnectable:v,elementsSelectable:_,onError:k}=Ft(Aue,En),T=hue(t);return d.jsxs("div",{className:"react-flow__edges",children:[d.jsx(bue,{defaultColor:e,rfId:n}),T.map(A=>d.jsx(Tue,{id:A,edgesFocusable:E,edgesReconnectable:v,elementsSelectable:_,noPanClassName:s,onReconnect:a,onContextMenu:o,onMouseEnter:c,onMouseMove:u,onMouseLeave:f,onClick:m,reconnectRadius:p,onDoubleClick:y,onReconnectStart:b,onReconnectEnd:x,rfId:n,onError:k,edgeTypes:i,disableKeyboardA11y:w},A))]})}MP.displayName="EdgeRenderer";const jue=C.memo(MP),Mue=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Rue({children:e}){const t=Ft(Mue);return d.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Due(e){const t=gg(),n=C.useRef(!1);C.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Oue=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Lue(e){const t=Ft(Oue),n=Sn();return C.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Iue(e){return e.connection.inProgress?{...e.connection,to:_f(e.connection.to,e.transform)}:{...e.connection}}function Pue(e){return Iue}function zue(e){const t=Pue();return Ft(t,En)}const Bue=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Uue({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:s,width:a,height:o,isValid:c,inProgress:u}=Ft(Bue,En);return!(a&&s&&u)?null:d.jsx("svg",{style:e,width:a,height:o,className:"react-flow__connectionline react-flow__container",children:d.jsx("g",{className:Wn(["react-flow__connection",NI(c)]),children:d.jsx(RP,{style:t,type:n,CustomComponent:i,isValid:c})})})}const RP=({style:e,type:t=Fa.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:s,from:a,fromNode:o,fromHandle:c,fromPosition:u,to:f,toNode:m,toHandle:p,toPosition:y,pointer:b}=zue();if(!s)return;if(n)return d.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:c,fromX:a.x,fromY:a.y,toX:f.x,toY:f.y,fromPosition:u,toPosition:y,connectionStatus:NI(i),toNode:m,toHandle:p,pointer:b});let x="";const w={sourceX:a.x,sourceY:a.y,sourcePosition:u,targetX:f.x,targetY:f.y,targetPosition:y};switch(t){case Fa.Bezier:[x]=zI(w);break;case Fa.SimpleBezier:[x]=xP(w);break;case Fa.Step:[x]=Ev({...w,borderRadius:0});break;case Fa.SmoothStep:[x]=Ev(w);break;default:[x]=FI(w)}return d.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:e})};RP.displayName="ConnectionLine";const Fue={};function wA(e=Fue){C.useRef(e),Sn(),C.useEffect(()=>{},[e])}function $ue(){Sn(),C.useRef(!1),C.useEffect(()=>{},[])}function DP({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:s,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:f,onNodeContextMenu:m,onSelectionContextMenu:p,onSelectionStart:y,onSelectionEnd:b,connectionLineType:x,connectionLineStyle:w,connectionLineComponent:E,connectionLineContainerStyle:v,selectionKeyCode:_,selectionOnDrag:k,selectionMode:T,multiSelectionKeyCode:A,panActivationKeyCode:j,zoomActivationKeyCode:M,deleteKeyCode:D,onlyRenderVisibleElements:I,elementsSelectable:P,defaultViewport:U,translateExtent:q,minZoom:V,maxZoom:O,preventScrolling:R,defaultMarkerColor:z,zoomOnScroll:G,zoomOnPinch:Y,panOnScroll:K,panOnScrollSpeed:B,panOnScrollMode:F,zoomOnDoubleClick:W,panOnDrag:$,autoPanOnSelection:ae,onPaneClick:be,onPaneMouseEnter:le,onPaneMouseMove:Ne,onPaneMouseLeave:re,onPaneScroll:me,onPaneContextMenu:se,paneClickDistance:Q,nodeClickDistance:ye,onEdgeContextMenu:_e,onEdgeMouseEnter:ze,onEdgeMouseMove:fe,onEdgeMouseLeave:Se,reconnectRadius:Re,onReconnect:Qe,onReconnectStart:ht,onReconnectEnd:it,noDragClassName:Bt,noWheelClassName:mt,noPanClassName:wt,disableKeyboardA11y:Te,nodeExtent:ct,rfId:ne,viewport:we,onViewportChange:he}){return wA(e),wA(t),$ue(),Due(n),Lue(we),d.jsx(iue,{onPaneClick:be,onPaneMouseEnter:le,onPaneMouseMove:Ne,onPaneMouseLeave:re,onPaneContextMenu:se,onPaneScroll:me,paneClickDistance:Q,deleteKeyCode:D,selectionKeyCode:_,selectionOnDrag:k,selectionMode:T,onSelectionStart:y,onSelectionEnd:b,multiSelectionKeyCode:A,panActivationKeyCode:j,zoomActivationKeyCode:M,elementsSelectable:P,zoomOnScroll:G,zoomOnPinch:Y,zoomOnDoubleClick:W,panOnScroll:K,panOnScrollSpeed:B,panOnScrollMode:F,panOnDrag:$,autoPanOnSelection:ae,defaultViewport:U,translateExtent:q,minZoom:V,maxZoom:O,onSelectionContextMenu:p,preventScrolling:R,noDragClassName:Bt,noWheelClassName:mt,noPanClassName:wt,disableKeyboardA11y:Te,onViewportChange:he,isControlledViewport:!!we,children:d.jsxs(Rue,{children:[d.jsx(jue,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:o,onReconnect:Qe,onReconnectStart:ht,onReconnectEnd:it,onlyRenderVisibleElements:I,onEdgeContextMenu:_e,onEdgeMouseEnter:ze,onEdgeMouseMove:fe,onEdgeMouseLeave:Se,reconnectRadius:Re,defaultMarkerColor:z,noPanClassName:wt,disableKeyboardA11y:Te,rfId:ne}),d.jsx(Uue,{style:w,type:x,component:E,containerStyle:v}),d.jsx("div",{className:"react-flow__edgelabel-renderer"}),d.jsx(fue,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:f,onNodeContextMenu:m,nodeClickDistance:ye,onlyRenderVisibleElements:I,noPanClassName:wt,noDragClassName:Bt,disableKeyboardA11y:Te,nodeExtent:ct,rfId:ne}),d.jsx("div",{className:"react-flow__viewport-portal"})]})})}DP.displayName="GraphView";const que=C.memo(DP),Hue=MI(),EA=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:s,height:a,fitView:o,fitViewOptions:c,minZoom:u=.5,maxZoom:f=2,nodeOrigin:m,nodeExtent:p,zIndexMode:y="basic"}={})=>{const b=new Map,x=new Map,w=new Map,E=new Map,v=i??t??[],_=n??e??[],k=m??[0,0],T=p??Kd;HI(w,E,v);const{nodesInitialized:A}=kv(_,b,x,{nodeOrigin:k,nodeExtent:T,zIndexMode:y});let j=[0,0,1];if(o&&s&&a){const M=kf(b,{filter:U=>!!((U.width||U.initialWidth)&&(U.height||U.initialHeight))}),{x:D,y:I,zoom:P}=Sw(M,s,a,u,f,(c==null?void 0:c.padding)??.1);j=[D,I,P]}return{rfId:"1",width:s??0,height:a??0,transform:j,nodes:_,nodesInitialized:A,nodeLookup:b,parentLookup:x,edges:v,edgeLookup:E,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:u,maxZoom:f,translateExtent:Kd,nodeExtent:T,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Bc.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:k,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:c,fitViewResolver:null,connection:{...kI},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Hue,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:SI,zIndexMode:y,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Vue=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:s,height:a,fitView:o,fitViewOptions:c,minZoom:u,maxZoom:f,nodeOrigin:m,nodeExtent:p,zIndexMode:y})=>sce((b,x)=>{async function w(){const{nodeLookup:E,panZoom:v,fitViewOptions:_,fitViewResolver:k,width:T,height:A,minZoom:j,maxZoom:M}=x();v&&(await ele({nodes:E,width:T,height:A,panZoom:v,minZoom:j,maxZoom:M},_),k==null||k.resolve(!0),b({fitViewResolver:null}))}return{...EA({nodes:e,edges:t,width:s,height:a,fitView:o,fitViewOptions:c,minZoom:u,maxZoom:f,nodeOrigin:m,nodeExtent:p,defaultNodes:n,defaultEdges:i,zIndexMode:y}),setNodes:E=>{const{nodeLookup:v,parentLookup:_,nodeOrigin:k,elevateNodesOnSelect:T,fitViewQueued:A,zIndexMode:j,nodesSelectionActive:M}=x(),{nodesInitialized:D,hasSelectedNodes:I}=kv(E,v,_,{nodeOrigin:k,nodeExtent:p,elevateNodesOnSelect:T,checkEquality:!0,zIndexMode:j}),P=M&&I;A&&D?(w(),b({nodes:E,nodesInitialized:D,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:P})):b({nodes:E,nodesInitialized:D,nodesSelectionActive:P})},setEdges:E=>{const{connectionLookup:v,edgeLookup:_}=x();HI(v,_,E),b({edges:E})},setDefaultNodesAndEdges:(E,v)=>{if(E){const{setNodes:_}=x();_(E),b({hasDefaultNodes:!0})}if(v){const{setEdges:_}=x();_(v),b({hasDefaultEdges:!0})}},updateNodeInternals:E=>{const{triggerNodeChanges:v,nodeLookup:_,parentLookup:k,domNode:T,nodeOrigin:A,nodeExtent:j,debug:M,fitViewQueued:D,zIndexMode:I}=x(),{changes:P,updatedInternals:U}=Sle(E,_,k,T,A,j,I);U&&(xle(_,k,{nodeOrigin:A,nodeExtent:j,zIndexMode:I}),D?(w(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),(P==null?void 0:P.length)>0&&(M&&console.log("React Flow: trigger node changes",P),v==null||v(P)))},updateNodePositions:(E,v=!1)=>{const _=[];let k=[];const{nodeLookup:T,triggerNodeChanges:A,connection:j,updateConnection:M,onNodesChangeMiddlewareMap:D}=x();for(const[I,P]of E){const U=T.get(I),q=!!(U!=null&&U.expandParent&&(U!=null&&U.parentId)&&(P!=null&&P.position)),V={id:I,type:"position",position:q?{x:Math.max(0,P.position.x),y:Math.max(0,P.position.y)}:P.position,dragging:v};if(U&&j.inProgress&&j.fromNode.id===U.id){const O=ul(U,j.fromHandle,Je.Left,!0);M({...j,from:O})}q&&U.parentId&&_.push({id:I,parentId:U.parentId,rect:{...P.internals.positionAbsolute,width:P.measured.width??0,height:P.measured.height??0}}),k.push(V)}if(_.length>0){const{parentLookup:I,nodeOrigin:P}=x(),U=Aw(_,T,I,P);k.push(...U)}for(const I of D.values())k=I(k);A(k)},triggerNodeChanges:E=>{const{onNodesChange:v,setNodes:_,nodes:k,hasDefaultNodes:T,debug:A}=x();if(E!=null&&E.length){if(T){const j=rP(E,k);_(j)}A&&console.log("React Flow: trigger node changes",E),v==null||v(E)}},triggerEdgeChanges:E=>{const{onEdgesChange:v,setEdges:_,edges:k,hasDefaultEdges:T,debug:A}=x();if(E!=null&&E.length){if(T){const j=aP(E,k);_(j)}A&&console.log("React Flow: trigger edge changes",E),v==null||v(E)}},addSelectedNodes:E=>{const{multiSelectionActive:v,edgeLookup:_,nodeLookup:k,triggerNodeChanges:T,triggerEdgeChanges:A}=x();if(v){const j=E.map(M=>Do(M,!0));T(j);return}T(uc(k,new Set([...E]),!0)),A(uc(_))},addSelectedEdges:E=>{const{multiSelectionActive:v,edgeLookup:_,nodeLookup:k,triggerNodeChanges:T,triggerEdgeChanges:A}=x();if(v){const j=E.map(M=>Do(M,!0));A(j);return}A(uc(_,new Set([...E]))),T(uc(k,new Set,!0))},unselectNodesAndEdges:({nodes:E,edges:v}={})=>{const{edges:_,nodes:k,nodeLookup:T,triggerNodeChanges:A,triggerEdgeChanges:j}=x(),M=E||k,D=v||_,I=[];for(const U of M){if(!U.selected)continue;const q=T.get(U.id);q&&(q.selected=!1),I.push(Do(U.id,!1))}const P=[];for(const U of D)U.selected&&P.push(Do(U.id,!1));A(I),j(P)},setMinZoom:E=>{const{panZoom:v,maxZoom:_}=x();v==null||v.setScaleExtent([E,_]),b({minZoom:E})},setMaxZoom:E=>{const{panZoom:v,minZoom:_}=x();v==null||v.setScaleExtent([_,E]),b({maxZoom:E})},setTranslateExtent:E=>{var v;(v=x().panZoom)==null||v.setTranslateExtent(E),b({translateExtent:E})},resetSelectedElements:()=>{const{edges:E,nodes:v,triggerNodeChanges:_,triggerEdgeChanges:k,elementsSelectable:T}=x();if(!T)return;const A=v.reduce((M,D)=>D.selected?[...M,Do(D.id,!1)]:M,[]),j=E.reduce((M,D)=>D.selected?[...M,Do(D.id,!1)]:M,[]);_(A),k(j)},setNodeExtent:E=>{const{nodes:v,nodeLookup:_,parentLookup:k,nodeOrigin:T,elevateNodesOnSelect:A,nodeExtent:j,zIndexMode:M}=x();E[0][0]===j[0][0]&&E[0][1]===j[0][1]&&E[1][0]===j[1][0]&&E[1][1]===j[1][1]||(kv(v,_,k,{nodeOrigin:T,nodeExtent:E,elevateNodesOnSelect:A,checkEquality:!1,zIndexMode:M}),b({nodeExtent:E}))},panBy:E=>{const{transform:v,width:_,height:k,panZoom:T,translateExtent:A}=x();return kle({delta:E,panZoom:T,transform:v,translateExtent:A,width:_,height:k})},setCenter:async(E,v,_)=>{const{width:k,height:T,maxZoom:A,panZoom:j}=x();if(!j)return!1;const M=typeof(_==null?void 0:_.zoom)<"u"?_.zoom:A;return await j.setViewport({x:k/2-E*M,y:T/2-v*M,zoom:M},{duration:_==null?void 0:_.duration,ease:_==null?void 0:_.ease,interpolate:_==null?void 0:_.interpolate}),!0},cancelConnection:()=>{b({connection:{...kI}})},updateConnection:E=>{b({connection:E})},reset:()=>b({...EA()})}},Object.is);function OP({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:s,initialHeight:a,initialMinZoom:o,initialMaxZoom:c,initialFitViewOptions:u,fitView:f,nodeOrigin:m,nodeExtent:p,zIndexMode:y,children:b}){const[x]=C.useState(()=>Vue({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:s,height:a,fitView:f,minZoom:o,maxZoom:c,fitViewOptions:u,nodeOrigin:m,nodeExtent:p,zIndexMode:y}));return d.jsx(rce,{value:x,children:d.jsx(Ace,{children:d.jsx(Hce,{children:b})})})}function Kue({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:s,width:a,height:o,fitView:c,fitViewOptions:u,minZoom:f,maxZoom:m,nodeOrigin:p,nodeExtent:y,zIndexMode:b}){return C.useContext(pg)?d.jsx(d.Fragment,{children:e}):d.jsx(OP,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:s,initialWidth:a,initialHeight:o,fitView:c,initialFitViewOptions:u,initialMinZoom:f,initialMaxZoom:m,nodeOrigin:p,nodeExtent:y,zIndexMode:b,children:e})}const Gue={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Wue({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:s,nodeTypes:a,edgeTypes:o,onNodeClick:c,onEdgeClick:u,onInit:f,onMove:m,onMoveStart:p,onMoveEnd:y,onConnect:b,onConnectStart:x,onConnectEnd:w,onClickConnectStart:E,onClickConnectEnd:v,onNodeMouseEnter:_,onNodeMouseMove:k,onNodeMouseLeave:T,onNodeContextMenu:A,onNodeDoubleClick:j,onNodeDragStart:M,onNodeDrag:D,onNodeDragStop:I,onNodesDelete:P,onEdgesDelete:U,onDelete:q,onSelectionChange:V,onSelectionDragStart:O,onSelectionDrag:R,onSelectionDragStop:z,onSelectionContextMenu:G,onSelectionStart:Y,onSelectionEnd:K,onBeforeDelete:B,connectionMode:F,connectionLineType:W=Fa.Bezier,connectionLineStyle:$,connectionLineComponent:ae,connectionLineContainerStyle:be,deleteKeyCode:le="Backspace",selectionKeyCode:Ne="Shift",selectionOnDrag:re=!1,selectionMode:me=Gd.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:Q=Yd()?"Meta":"Control",zoomActivationKeyCode:ye=Yd()?"Meta":"Control",snapToGrid:_e,snapGrid:ze,onlyRenderVisibleElements:fe=!1,selectNodesOnDrag:Se,nodesDraggable:Re,autoPanOnNodeFocus:Qe,nodesConnectable:ht,nodesFocusable:it,nodeOrigin:Bt=iP,edgesFocusable:mt,edgesReconnectable:wt,elementsSelectable:Te=!0,defaultViewport:ct=bce,minZoom:ne=.5,maxZoom:we=2,translateExtent:he=Kd,preventScrolling:Ve=!0,nodeExtent:Ze,defaultMarkerColor:Ct="#b1b1b7",zoomOnScroll:Gt=!0,zoomOnPinch:ce=!0,panOnScroll:pe=!1,panOnScrollSpeed:Ce=.5,panOnScrollMode:je=Jo.Free,zoomOnDoubleClick:qe=!0,panOnDrag:st=!0,onPaneClick:Fe,onPaneMouseEnter:et,onPaneMouseMove:Qt,onPaneMouseLeave:Yn,onPaneScroll:Wt,onPaneContextMenu:Z,paneClickDistance:xe=1,nodeClickDistance:Ie=0,children:ut,onReconnect:Yt,onReconnectStart:Tt,onReconnectEnd:$e,onEdgeContextMenu:Ue,onEdgeDoubleClick:ot,onEdgeMouseEnter:hn,onEdgeMouseMove:Zt,onEdgeMouseLeave:Vi,reconnectRadius:Ys=10,onNodesChange:Jn,onEdgesChange:kn,noDragClassName:mn="nodrag",noWheelClassName:An="nowheel",noPanClassName:Ti="nopan",fitView:Xs,fitViewOptions:wr,connectOnClick:Qs,attributionPosition:sa,proOptions:_s,defaultEdgeOptions:Zs,elevateNodesOnSelect:Bn=!0,elevateEdgesOnSelect:Ai=!1,disableKeyboardA11y:In=!1,autoPanOnConnect:ri,autoPanOnNodeDrag:bn,autoPanOnSelection:ra=!0,autoPanSpeed:xi,connectionRadius:hi,isValidConnection:Me,onError:Ge,style:xt,id:Rt,nodeDragThreshold:on,connectionDragThreshold:Un,viewport:ei,onViewportChange:ti,width:Vt,height:ai,colorMode:aa="light",debug:Cs,onScroll:os,ariaLabelConfig:Ts,zIndexMode:Er="basic",...X},Ae){const Oe=Rt||"1",gt=Ece(aa),pt=C.useCallback(ji=>{ji.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),os==null||os(ji)},[os]);return d.jsx("div",{"data-testid":"rf__wrapper",...X,onScroll:pt,style:{...xt,...Gue},ref:Ae,className:Wn(["react-flow",s,gt]),id:Rt,role:"application",children:d.jsxs(Kue,{nodes:e,edges:t,width:Vt,height:ai,fitView:Xs,fitViewOptions:wr,minZoom:ne,maxZoom:we,nodeOrigin:Bt,nodeExtent:Ze,zIndexMode:Er,children:[d.jsx(wce,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:b,onConnectStart:x,onConnectEnd:w,onClickConnectStart:E,onClickConnectEnd:v,nodesDraggable:Re,autoPanOnNodeFocus:Qe,nodesConnectable:ht,nodesFocusable:it,edgesFocusable:mt,edgesReconnectable:wt,elementsSelectable:Te,elevateNodesOnSelect:Bn,elevateEdgesOnSelect:Ai,minZoom:ne,maxZoom:we,nodeExtent:Ze,onNodesChange:Jn,onEdgesChange:kn,snapToGrid:_e,snapGrid:ze,connectionMode:F,translateExtent:he,connectOnClick:Qs,defaultEdgeOptions:Zs,fitView:Xs,fitViewOptions:wr,onNodesDelete:P,onEdgesDelete:U,onDelete:q,onNodeDragStart:M,onNodeDrag:D,onNodeDragStop:I,onSelectionDrag:R,onSelectionDragStart:O,onSelectionDragStop:z,onMove:m,onMoveStart:p,onMoveEnd:y,noPanClassName:Ti,nodeOrigin:Bt,rfId:Oe,autoPanOnConnect:ri,autoPanOnNodeDrag:bn,autoPanSpeed:xi,onError:Ge,connectionRadius:hi,isValidConnection:Me,selectNodesOnDrag:Se,nodeDragThreshold:on,connectionDragThreshold:Un,onBeforeDelete:B,debug:Cs,ariaLabelConfig:Ts,zIndexMode:Er}),d.jsx(que,{onInit:f,onNodeClick:c,onEdgeClick:u,onNodeMouseEnter:_,onNodeMouseMove:k,onNodeMouseLeave:T,onNodeContextMenu:A,onNodeDoubleClick:j,nodeTypes:a,edgeTypes:o,connectionLineType:W,connectionLineStyle:$,connectionLineComponent:ae,connectionLineContainerStyle:be,selectionKeyCode:Ne,selectionOnDrag:re,selectionMode:me,deleteKeyCode:le,multiSelectionKeyCode:Q,panActivationKeyCode:se,zoomActivationKeyCode:ye,onlyRenderVisibleElements:fe,defaultViewport:ct,translateExtent:he,minZoom:ne,maxZoom:we,preventScrolling:Ve,zoomOnScroll:Gt,zoomOnPinch:ce,zoomOnDoubleClick:qe,panOnScroll:pe,panOnScrollSpeed:Ce,panOnScrollMode:je,panOnDrag:st,autoPanOnSelection:ra,onPaneClick:Fe,onPaneMouseEnter:et,onPaneMouseMove:Qt,onPaneMouseLeave:Yn,onPaneScroll:Wt,onPaneContextMenu:Z,paneClickDistance:xe,nodeClickDistance:Ie,onSelectionContextMenu:G,onSelectionStart:Y,onSelectionEnd:K,onReconnect:Yt,onReconnectStart:Tt,onReconnectEnd:$e,onEdgeContextMenu:Ue,onEdgeDoubleClick:ot,onEdgeMouseEnter:hn,onEdgeMouseMove:Zt,onEdgeMouseLeave:Vi,reconnectRadius:Ys,defaultMarkerColor:Ct,noDragClassName:mn,noWheelClassName:An,noPanClassName:Ti,rfId:Oe,disableKeyboardA11y:In,nodeExtent:Ze,viewport:ei,onViewportChange:ti}),d.jsx(yce,{onSelectionChange:V}),ut,d.jsx(fce,{proOptions:_s,position:sa}),d.jsx(dce,{rfId:Oe,disableKeyboardA11y:In})]})})}var Yue=cP(Wue);function Xue(e){const[t,n]=C.useState(e),i=C.useCallback(s=>n(a=>rP(s,a)),[]);return[t,n,i]}function Que(e){const[t,n]=C.useState(e),i=C.useCallback(s=>n(a=>aP(s,a)),[]);return[t,n,i]}function Zue({dimensions:e,lineWidth:t,variant:n,className:i}){return d.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Wn(["react-flow__background-pattern",n,i])})}function Jue({radius:e,className:t}){return d.jsx("circle",{cx:e,cy:e,r:e,className:Wn(["react-flow__background-pattern","dots",t])})}var Qr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Qr||(Qr={}));const ede={[Qr.Dots]:1,[Qr.Lines]:1,[Qr.Cross]:6},tde=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function LP({id:e,variant:t=Qr.Dots,gap:n=20,size:i,lineWidth:s=1,offset:a=0,color:o,bgColor:c,style:u,className:f,patternClassName:m}){const p=C.useRef(null),{transform:y,patternId:b}=Ft(tde,En),x=i||ede[t],w=t===Qr.Dots,E=t===Qr.Cross,v=Array.isArray(n)?n:[n,n],_=[v[0]*y[2]||1,v[1]*y[2]||1],k=x*y[2],T=Array.isArray(a)?a:[a,a],A=E?[k,k]:_,j=[T[0]*y[2]||1+A[0]/2,T[1]*y[2]||1+A[1]/2],M=`${b}${e||""}`;return d.jsxs("svg",{className:Wn(["react-flow__background",f]),style:{...u,...yg,"--xy-background-color-props":c,"--xy-background-pattern-color-props":o},ref:p,"data-testid":"rf__background",children:[d.jsx("pattern",{id:M,x:y[0]%_[0],y:y[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${j[0]},-${j[1]})`,children:w?d.jsx(Jue,{radius:k/2,className:m}):d.jsx(Zue,{dimensions:A,lineWidth:s,variant:t,className:m})}),d.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${M})`})]})}LP.displayName="Background";const nde=C.memo(LP);function ide(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:d.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function sde(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:d.jsx("path",{d:"M0 0h32v4.2H0z"})})}function rde(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:d.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function ade(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:d.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function ode(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:d.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function md({children:e,className:t,...n}){return d.jsx("button",{type:"button",className:Wn(["react-flow__controls-button",t]),...n,children:e})}const lde=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function IP({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:s,onZoomIn:a,onZoomOut:o,onFitView:c,onInteractiveChange:u,className:f,children:m,position:p="bottom-left",orientation:y="vertical","aria-label":b}){const x=Sn(),{isInteractive:w,minZoomReached:E,maxZoomReached:v,ariaLabelConfig:_}=Ft(lde,En),{zoomIn:k,zoomOut:T,fitView:A}=gg(),j=()=>{k(),a==null||a()},M=()=>{T(),o==null||o()},D=()=>{A(s),c==null||c()},I=()=>{x.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),u==null||u(!w)},P=y==="horizontal"?"horizontal":"vertical";return d.jsxs(mg,{className:Wn(["react-flow__controls",P,f]),position:p,style:e,"data-testid":"rf__controls","aria-label":b??_["controls.ariaLabel"],children:[t&&d.jsxs(d.Fragment,{children:[d.jsx(md,{onClick:j,className:"react-flow__controls-zoomin",title:_["controls.zoomIn.ariaLabel"],"aria-label":_["controls.zoomIn.ariaLabel"],disabled:v,children:d.jsx(ide,{})}),d.jsx(md,{onClick:M,className:"react-flow__controls-zoomout",title:_["controls.zoomOut.ariaLabel"],"aria-label":_["controls.zoomOut.ariaLabel"],disabled:E,children:d.jsx(sde,{})})]}),n&&d.jsx(md,{className:"react-flow__controls-fitview",onClick:D,title:_["controls.fitView.ariaLabel"],"aria-label":_["controls.fitView.ariaLabel"],children:d.jsx(rde,{})}),i&&d.jsx(md,{className:"react-flow__controls-interactive",onClick:I,title:_["controls.interactive.ariaLabel"],"aria-label":_["controls.interactive.ariaLabel"],children:w?d.jsx(ode,{}):d.jsx(ade,{})}),m]})}IP.displayName="Controls";const cde=C.memo(IP);function ude({id:e,x:t,y:n,width:i,height:s,style:a,color:o,strokeColor:c,strokeWidth:u,className:f,borderRadius:m,shapeRendering:p,selected:y,onClick:b}){const{background:x,backgroundColor:w}=a||{},E=o||x||w;return d.jsx("rect",{className:Wn(["react-flow__minimap-node",{selected:y},f]),x:t,y:n,rx:m,ry:m,width:i,height:s,style:{fill:E,stroke:c,strokeWidth:u},shapeRendering:p,onClick:b?v=>b(v,e):void 0})}const dde=C.memo(ude),fde=e=>e.nodes.map(t=>t.id),Vx=e=>e instanceof Function?e:()=>e;function hde({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:a=dde,onClick:o}){const c=Ft(fde,En),u=Vx(t),f=Vx(e),m=Vx(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return d.jsx(d.Fragment,{children:c.map(y=>d.jsx(mde,{id:y,nodeColorFunc:u,nodeStrokeColorFunc:f,nodeClassNameFunc:m,nodeBorderRadius:i,nodeStrokeWidth:s,NodeComponent:a,onClick:o,shapeRendering:p},y))})}function pde({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:s,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:c,onClick:u}){const{node:f,x:m,y:p,width:y,height:b}=Ft(x=>{const w=x.nodeLookup.get(e);if(!w)return{node:void 0,x:0,y:0,width:0,height:0};const E=w.internals.userNode,{x:v,y:_}=w.internals.positionAbsolute,{width:k,height:T}=ia(E);return{node:E,x:v,y:_,width:k,height:T}},En);return!f||f.hidden||!RI(f)?null:d.jsx(c,{x:m,y:p,width:y,height:b,style:f.style,selected:!!f.selected,className:i(f),color:t(f),borderRadius:s,strokeColor:n(f),strokeWidth:a,shapeRendering:o,onClick:u,id:f.id})}const mde=C.memo(pde);var gde=C.memo(hde);const yde=200,bde=150,xde=e=>!e.hidden,vde=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?AI(kf(e.nodeLookup,{filter:xde}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},wde="react-flow__minimap-desc";function PP({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:s="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:c,bgColor:u,maskColor:f,maskStrokeColor:m,maskStrokeWidth:p,position:y="bottom-right",onClick:b,onNodeClick:x,pannable:w=!1,zoomable:E=!1,ariaLabel:v,inversePan:_,zoomStep:k=1,offsetScale:T=5}){const A=Sn(),j=C.useRef(null),{boundingRect:M,viewBB:D,rfId:I,panZoom:P,translateExtent:U,flowWidth:q,flowHeight:V,ariaLabelConfig:O}=Ft(vde,En),R=(e==null?void 0:e.width)??yde,z=(e==null?void 0:e.height)??bde,G=M.width/R,Y=M.height/z,K=Math.max(G,Y),B=K*R,F=K*z,W=T*K,$=M.x-(B-M.width)/2-W,ae=M.y-(F-M.height)/2-W,be=B+W*2,le=F+W*2,Ne=`${wde}-${I}`,re=C.useRef(0),me=C.useRef();re.current=K,C.useEffect(()=>{if(j.current&&P)return me.current=Dle({domNode:j.current,panZoom:P,getTransform:()=>A.getState().transform,getViewScale:()=>re.current}),()=>{var _e;(_e=me.current)==null||_e.destroy()}},[P]),C.useEffect(()=>{var _e;(_e=me.current)==null||_e.update({translateExtent:U,width:q,height:V,inversePan:_,pannable:w,zoomStep:k,zoomable:E})},[w,E,_,k,U,q,V]);const se=b?_e=>{var Se;const[ze,fe]=((Se=me.current)==null?void 0:Se.pointer(_e))||[0,0];b(_e,{x:ze,y:fe})}:void 0,Q=x?C.useCallback((_e,ze)=>{const fe=A.getState().nodeLookup.get(ze).internals.userNode;x(_e,fe)},[]):void 0,ye=v??O["minimap.ariaLabel"];return d.jsx(mg,{position:y,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*K:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:Wn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:d.jsxs("svg",{width:R,height:z,viewBox:`${$} ${ae} ${be} ${le}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Ne,ref:j,onClick:se,children:[ye&&d.jsx("title",{id:Ne,children:ye}),d.jsx(gde,{onClick:Q,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:s,nodeStrokeWidth:o,nodeComponent:c}),d.jsx("path",{className:"react-flow__minimap-mask",d:`M${$-W},${ae-W}h${be+W*2}v${le+W*2}h${-be-W*2}z
853
853
  M${D.x},${D.y}h${D.width}v${D.height}h${-D.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}PP.displayName="MiniMap";C.memo(PP);const Ede=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Sde={[$c.Line]:"right",[$c.Handle]:"bottom-right"};function kde({nodeId:e,position:t,variant:n=$c.Handle,className:i,style:s=void 0,children:a,color:o,minWidth:c=10,minHeight:u=10,maxWidth:f=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:y,autoScale:b=!0,shouldResize:x,onResizeStart:w,onResize:E,onResizeEnd:v}){const _=hP(),k=typeof e=="string"?e:_,T=Sn(),A=C.useRef(null),j=n===$c.Handle,M=Ft(C.useCallback(Ede(j&&b),[j,b]),En),D=C.useRef(null),I=t??Sde[n];C.useEffect(()=>{if(!(!A.current||!k))return D.current||(D.current=Kle({domNode:A.current,nodeId:k,getStoreItems:()=>{const{nodeLookup:U,transform:q,snapGrid:V,snapToGrid:O,nodeOrigin:R,domNode:z}=T.getState();return{nodeLookup:U,transform:q,snapGrid:V,snapToGrid:O,nodeOrigin:R,paneDomNode:z}},onChange:(U,q)=>{const{triggerNodeChanges:V,nodeLookup:O,parentLookup:R,nodeOrigin:z}=T.getState(),G=[],Y={x:U.x,y:U.y},K=O.get(k);if(K&&K.expandParent&&K.parentId){const B=K.origin??z,F=U.width??K.measured.width??0,W=U.height??K.measured.height??0,$={id:K.id,parentId:K.parentId,rect:{width:F,height:W,...DI({x:U.x??K.position.x,y:U.y??K.position.y},{width:F,height:W},K.parentId,O,B)}},ae=Aw([$],O,R,z);G.push(...ae),Y.x=U.x?Math.max(B[0]*F,U.x):void 0,Y.y=U.y?Math.max(B[1]*W,U.y):void 0}if(Y.x!==void 0&&Y.y!==void 0){const B={id:k,type:"position",position:{...Y}};G.push(B)}if(U.width!==void 0&&U.height!==void 0){const F={id:k,type:"dimensions",resizing:!0,setAttributes:y?y==="horizontal"?"width":"height":!0,dimensions:{width:U.width,height:U.height}};G.push(F)}for(const B of q){const F={...B,type:"position"};G.push(F)}V(G)},onEnd:({width:U,height:q})=>{const V={id:k,type:"dimensions",resizing:!1,dimensions:{width:U,height:q}};T.getState().triggerNodeChanges([V])}})),D.current.update({controlPosition:I,boundaries:{minWidth:c,minHeight:u,maxWidth:f,maxHeight:m},keepAspectRatio:p,resizeDirection:y,onResizeStart:w,onResize:E,onResizeEnd:v,shouldResize:x}),()=>{var U;(U=D.current)==null||U.destroy()}},[I,c,u,f,m,p,w,E,v,x]);const P=I.split("-");return d.jsx("div",{className:Wn(["react-flow__resize-control","nodrag",...P,n,i]),ref:A,style:{...s,scale:M,...o&&{[j?"backgroundColor":"borderColor"]:o}},children:a})}C.memo(kde);function Nde(e){return _t(`/api/projects/${encodeURIComponent(e)}/flow`)}function _de(e,t){return Rm(`/api/projects/${encodeURIComponent(e)}/flow`,t)}const Cv={done:"var(--color-running)",doing:"var(--color-running)",todo:"var(--color-text-subtle)",stuck:"var(--color-crashed)"},SA=["var(--color-accent-mint)","var(--color-accent-pink)","var(--color-accent-purple)","var(--color-accent-yellow)","var(--color-running-bg)","var(--color-idle-bg)"];function Cde(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*31+e.charCodeAt(n)>>>0;return SA[t%SA.length]}const yp={width:9,height:9,background:"var(--color-bg)",border:"1px solid var(--color-border-light)"},Tde=C.memo(function({id:t,data:n,selected:i}){const s=n,a=s.skills.split(",").map(o=>o.trim()).filter(Boolean);return d.jsxs("div",{className:`flow-node-glow${i?" is-selected":""}${s.status==="doing"?" is-running":""}`,children:[d.jsx(Za,{id:"l",type:"target",position:Je.Left,style:yp}),d.jsx(Za,{id:"t",type:"target",position:Je.Top,style:yp}),d.jsxs("div",{className:"rounded-2xl border border-[var(--color-border-light)] bg-[var(--color-bg-soft)] overflow-hidden cursor-pointer flex flex-col",style:{width:260,height:158,boxShadow:"var(--surface-card-border) 0 0 0 1px inset"},children:[d.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 border-b border-[var(--color-border-light)]",style:{background:Cde(t)},children:[d.jsxs("span",{className:"font-[family-name:var(--font-mono)] text-xs font-bold text-[var(--color-text)]",children:["#",s.seq]}),d.jsxs("span",{className:"relative shrink-0 ml-auto flex items-center justify-center w-2.5 h-2.5",title:s.status,children:[s.status==="doing"&&d.jsx("span",{className:"absolute inline-flex w-full h-full rounded-full animate-ping opacity-60",style:{background:Cv.doing}}),d.jsx("span",{className:"relative w-2.5 h-2.5 rounded-full",style:{background:Cv[s.status]??"var(--color-text-subtle)"}})]})]}),d.jsxs("div",{className:"px-2.5 py-2 flex-1 min-h-0 overflow-hidden",children:[d.jsx("p",{className:"text-[13px] font-semibold text-[var(--color-text)] leading-snug line-clamp-3",children:s.title||"任务"}),a.length>0&&d.jsx("div",{className:"flex flex-wrap gap-1 mt-2 max-h-[46px] overflow-hidden",children:a.slice(0,6).map(o=>d.jsx("span",{className:"text-[10px] font-[family-name:var(--font-mono)] px-1.5 py-0.5 rounded bg-[var(--surface-code)] text-[var(--color-text)]",children:o},o))})]})]}),d.jsx(Za,{id:"r",type:"source",position:Je.Right,style:yp}),d.jsx(Za,{id:"b",type:"source",position:Je.Bottom,style:yp})]})});function Ade(e){if(!e)return"";const t=e.split(`
854
854
  `),n=t.findIndex(s=>/^##\s+描述\s*$/.test(s));if(n===-1)return"";let i=t.length;for(let s=n+1;s<t.length;s+=1)if(/^##\s+/.test(t[s]??"")){i=s;break}return t.slice(n+1,i).join(`
855
- `).trim()}function jde(e,t){return t.includes("NEEDS-FIX")?"stuck":e==="Done"?"done":e==="Inprogress"?"doing":"todo"}function Mde({project:e,seq:t,onClose:n,onChanged:i,onDelete:s}){var V;const a=Xe(),[o,c]=C.useState(!0),[u,f]=C.useState(!1),[m,p]=C.useState(""),[y,b]=C.useState(""),[x,w]=C.useState(new Set),[E,v]=C.useState(""),[_,k]=C.useState("todo"),[T,A]=C.useState(null),[j,M]=C.useState(""),D=at({queryKey:["skills-all",e],queryFn:()=>ig(e)}),I=((V=D.data)==null?void 0:V.data)??[];C.useEffect(()=>{const O=R=>{R.key==="Escape"&&n()};return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[n]),C.useEffect(()=>{let O=!1;return c(!0),RL(e,t).then(R=>{O||(p(R.title),w(new Set(R.skills??[])),b(Ade(R.body)),v(R.state),k(jde(R.state,R.labels??[])),A(typeof R.order=="number"?R.order:null))}).catch(()=>{}).finally(()=>{O||c(!1)}),()=>{O=!0}},[e,t]);const P=O=>{w(R=>{const z=new Set(R);return z.has(O)?z.delete(O):z.add(O),z})},U=async()=>{M(""),f(!0);try{await gm(e,t,{title:m.trim()||a("flow.node.default"),description:y,skills:[...x]}),i(),n()}catch(O){M(O instanceof Error?O.message:String(O)),f(!1)}},q=()=>s(t);return d.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-center justify-center p-4 md:p-6 bg-black/30 overflow-hidden",onClick:n,children:d.jsxs("div",{className:"nb-card w-full max-w-4xl flex flex-col bg-[var(--color-bg)]",style:{maxHeight:"calc(100vh - 48px)"},onClick:O=>O.stopPropagation(),children:[d.jsxs("header",{className:"flex items-start justify-between gap-4 mb-4 flex-shrink-0",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs px-2 py-0.5 bg-[var(--color-accent-purple)] border-2 border-[var(--color-text)] rounded-full",children:["#",t]}),E&&d.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs px-2 py-0.5 border-2 border-[var(--color-text)] rounded-full font-semibold",children:[d.jsx("span",{className:"w-2.5 h-2.5 rounded-full inline-block border border-[var(--color-text)]",style:{background:Cv[_]??"gray"}}),E]}),T!=null&&d.jsx("span",{className:"font-[family-name:var(--font-mono)] text-xs px-2 py-0.5 bg-[var(--color-accent-mint)] border-2 border-[var(--color-text)] rounded-full font-semibold",title:a("flow.lane.orderTip"),children:a("flow.lane.wave",{n:T})})]}),d.jsx("button",{onClick:n,className:"nb-btn nb-btn-mint p-2 flex-shrink-0","aria-label":a("flow.node.close"),type:"button",children:d.jsx(vn,{size:14,strokeWidth:3})})]}),o?d.jsxs("div",{className:"flex items-center gap-2 text-sm text-[var(--color-text-muted)] py-10 justify-center",children:[d.jsx(lt,{size:16,className:"animate-spin"})," …"]}):d.jsxs(d.Fragment,{children:[j&&d.jsx("div",{className:"text-sm text-[var(--color-crashed)] mb-3",children:j}),d.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-1 gap-4 overflow-y-auto pr-1 md:grid-cols-[minmax(0,1fr)_minmax(260px,340px)] md:overflow-hidden md:pr-0",children:[d.jsxs("div",{className:"flex min-h-0 flex-col gap-4 md:overflow-y-auto md:pr-1",children:[d.jsxs("label",{className:"flex flex-col gap-1.5",children:[d.jsx("span",{className:"text-sm font-bold",children:a("flow.node.title")}),d.jsx("input",{className:"nb-input w-full text-base font-semibold",value:m,onChange:O=>p(O.target.value),autoFocus:!0})]}),d.jsxs("label",{className:"flex flex-1 min-h-0 flex-col gap-1.5",children:[d.jsx("span",{className:"text-sm font-bold",children:a("flow.node.desc")}),d.jsx("textarea",{className:"nb-input w-full flex-1 min-h-0",style:{minHeight:200,resize:"vertical"},value:y,onChange:O=>b(O.target.value)})]})]}),d.jsxs("section",{className:"flex min-h-[200px] flex-col gap-2 md:min-h-0 md:overflow-hidden",children:[d.jsx("span",{className:"text-sm font-bold",children:a("flow.node.skills")}),d.jsx("div",{className:"scroll-frame min-h-0 flex-1 rounded-lg border-2 border-[var(--color-border-light)] bg-[var(--color-bg-cream)]",children:d.jsxs("div",{className:"scroll-frame-body h-full p-2",children:[D.isLoading&&d.jsx(lt,{size:14,className:"animate-spin text-[var(--color-text-muted)]"}),I.length>0&&d.jsx("div",{className:"flex flex-wrap gap-2",children:I.map(O=>{const R=x.has(O.name);return d.jsx("button",{type:"button",onClick:()=>P(O.name),className:["max-w-full break-all px-2.5 py-1 text-left text-xs font-[family-name:var(--font-mono)] rounded-full border-2 transition-all",R?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),"aria-pressed":R,children:O.name},O.name)})})]})}),x.size>0&&d.jsx("p",{className:"max-h-14 overflow-y-auto break-words text-xs text-[var(--color-text-muted)]",children:[...x].join(", ")})]})]}),d.jsxs("div",{className:"flex gap-2 justify-between mt-4 pt-3 border-t-2 border-dashed border-[var(--color-text)] flex-shrink-0",children:[d.jsxs("button",{type:"button",className:"nb-btn nb-btn-danger",onClick:()=>void q(),disabled:u,children:[d.jsx(qi,{size:14,strokeWidth:2.4})," ",a("flow.node.delete")]}),d.jsxs("button",{type:"button",className:"nb-btn nb-btn-cta",onClick:()=>void U(),disabled:u,children:[u?d.jsx(lt,{size:14,className:"animate-spin"}):null,a("flow.node.save")]})]})]})]})})}const Rde=C.memo(function({data:t}){const n=t;return d.jsxs("div",{className:"relative w-full h-full rounded-2xl border-2 border-dashed border-[var(--color-text)]",children:[d.jsx("div",{className:"absolute inset-0 rounded-2xl",style:{background:n.color,opacity:.16}}),d.jsxs("span",{className:"absolute top-1.5 left-2.5 inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-bold rounded-md border-2 border-[var(--color-text)] bg-[var(--color-bg)] text-[var(--color-text)] whitespace-nowrap max-w-[90%]",children:[d.jsx("span",{className:"truncate",children:n.label}),n.sub&&d.jsx("span",{className:"font-normal text-[var(--color-text-muted)]",children:n.sub})]})]})});function Dde(e){const t=e;if(typeof t.seq=="number")return t.seq;const n=/#(\d+)/.exec(t.output??"");return n?Number(n[1]):null}const Ode={task:Tde,waveBox:Rde},kA="sps.flow.lastProject",NA="sps.flow.mode";function _A(e){return(e.labels??[]).includes("NEEDS-FIX")?"stuck":e.state==="Done"?"done":e.state==="Inprogress"?"doing":"todo"}function Lde(e){return e==="done"?{animated:!1,style:{stroke:"var(--color-running)",strokeWidth:2.5}}:e==="doing"?{animated:!1,className:"arrange-flow-edge-working",style:{stroke:"var(--color-running)",strokeWidth:3,strokeDasharray:"8 6"}}:e==="stuck"?{animated:!1,style:{stroke:"var(--color-crashed)",strokeWidth:2.5,strokeDasharray:"6 4"}}:{animated:!1,style:{stroke:"var(--color-accent-yellow)",strokeWidth:2.5,strokeDasharray:"6 4"}}}const el=260,tl=158,Tm=28,bp=el+120,Kx=tl+28,CA=16,TA=44,xp=60,Gx=100,AA=["var(--color-accent-mint)","var(--color-accent-pink)","var(--color-accent-yellow)","var(--color-accent-purple)","var(--color-running-bg)","var(--color-idle-bg)"];function od(e){const t=new Map;for(const n of e){const i=t.get(n.order)??[];i.push(n),t.set(n.order,i)}return[...t.entries()].sort((n,i)=>n[0]-i[0]).map(([,n])=>n.sort((i,s)=>i.seq-s.seq))}function Ide(e,t){return Math.abs(e.x-t.x)<el+Tm&&Math.abs(e.y-t.y)<tl+Tm}function Pde(e){for(let t=0;t<80;t+=1)for(let n=0;n<8;n+=1){const i={x:60+n*(el+Tm),y:60+t*(tl+Tm)};if(!e.some(s=>Ide(i,s)))return i}return{x:60,y:60}}function jA(e){return{x:e.position.x+el/2,y:e.position.y+tl/2}}function zde(e,t,n){const i=n.x-t.x,s=n.y-t.y,a=i*i+s*s;if(a===0)return Math.hypot(e.x-t.x,e.y-t.y);let o=((e.x-t.x)*i+(e.y-t.y)*s)/a;return o=Math.max(0,Math.min(1,o)),Math.hypot(e.x-(t.x+o*i),e.y-(t.y+o*s))}function Bde(){var Ve,Ze,Ct,Gt;const e=Xe(),t=tn(),n=dl(),{confirm:i}=Ln(),{screenToFlowPosition:s,fitView:a}=gg(),o=C.useRef([]),[c,u]=C.useState(()=>localStorage.getItem(kA)??""),[f,m]=C.useState(()=>localStorage.getItem(NA)==="lanes"?"lanes":"free"),[p,y]=C.useState(!1),[b,x,w]=Xue([]),[E,v,_]=Que([]),[k,T]=C.useState(null),[A,j]=C.useState(null),[M,D]=C.useState(!1),[I,P]=C.useState(""),[U,q]=C.useState(null),[V,O]=C.useState(null),[R,z]=C.useState(0),G=C.useRef({}),Y=C.useRef(E);Y.current=E;const K=C.useRef(b);K.current=b;const B=C.useRef(null),F=C.useRef(null),W=C.useRef(new Set),$=C.useRef(""),ae=C.useRef(null);LL(c||null);const be=at({queryKey:["cards",c],queryFn:()=>ML(c),enabled:!!c,refetchInterval:3e3}),le=((Ve=be.data)==null?void 0:Ve.data)??[],re=((Gt=(Ct=(Ze=at({queryKey:["projects"],queryFn:ro,refetchInterval:3e3}).data)==null?void 0:Ze.data)==null?void 0:Ct.find(ce=>ce.name===c))==null?void 0:Gt.pipelineStatus)==="running",me=C.useMemo(()=>{const ce={};for(const pe of le)ce[String(pe.seq)]=_A(pe);return ce},[le]),se=C.useMemo(()=>{if(f!=="lanes")return[];const ce=od(le),pe=[];for(let Ce=1;Ce<ce.length;Ce+=1)for(const je of ce[Ce-1]??[])for(const qe of ce[Ce]??[])pe.push({id:`w${je.seq}-${qe.seq}`,source:String(je.seq),target:String(qe.seq),sourceHandle:"r",targetHandle:"l",animated:!1,selectable:!1,deletable:!1});return pe},[f,le]),Q=C.useMemo(()=>(f==="lanes"?se:E).map(ce=>{const pe=Lde(me[ce.target]);return ce.selected?{...ce,...pe,style:{...pe.style,strokeWidth:6}}:{...ce,...pe}}),[f,se,E,me]),ye=C.useCallback(()=>{t.invalidateQueries({queryKey:["cards",c]})},[t,c]),_e=C.useCallback(()=>{!c||B.current!==c||(ae.current&&clearTimeout(ae.current),ae.current=setTimeout(()=>{_de(c,{positions:G.current,edges:Y.current.map(ce=>({id:ce.id,source:ce.source,target:ce.target,sourceHandle:ce.sourceHandle??null,targetHandle:ce.targetHandle??null}))}).catch(()=>{})},600))},[c]);C.useEffect(()=>{if(B.current=null,T(null),O(null),G.current={},W.current=new Set,$.current="",x([]),v([]),!c)return;localStorage.setItem(kA,c);let ce=!1;return Nde(c).then(pe=>{ce||(G.current=pe.positions??{},v((pe.edges??[]).map(Ce=>({id:Ce.id,source:Ce.source,target:Ce.target,sourceHandle:Ce.sourceHandle??void 0,targetHandle:Ce.targetHandle??void 0,animated:!1}))))}).catch(()=>{}).finally(()=>{ce||(B.current=c,z(pe=>pe+1))}),()=>{ce=!0}},[c,x,v]),C.useEffect(()=>{if(!c||B.current!==c)return;const ce=`${f}|`+le.map(Fe=>`${Fe.seq}:${Fe.title}:${Fe.state}:${Fe.order}:${(Fe.skills??[]).join("|")}`).join(",");if(ce===$.current)return;$.current=ce;const pe=Fe=>({seq:String(Fe.seq),title:Fe.title,skills:(Fe.skills??[]).join(", "),status:_A(Fe),label:Fe.title,desc:""});if(f==="lanes"){const Fe=od(le),et=Fe.map((Yn,Wt)=>({id:`wave-${Wt}`,type:"waveBox",position:{x:xp+Wt*bp-CA,y:Gx-TA},data:{label:e("flow.lane.wave",{n:Wt+1}),sub:Yn.length>1?e("flow.lane.parallel",{n:Yn.length}):"",color:AA[Wt%AA.length]},style:{width:el+CA*2,height:TA+(Yn.length-1)*Kx+tl+14},draggable:!1,selectable:!1,zIndex:0})),Qt=Fe.flatMap((Yn,Wt)=>Yn.map((Z,xe)=>({id:String(Z.seq),type:"task",position:{x:xp+Wt*bp,y:Gx+xe*Kx},deletable:!1,zIndex:1,data:pe(Z)})));x([...et,...Qt]);return}const Ce=new Map(K.current.map(Fe=>[Fe.id,Fe.position])),je=[];for(const Fe of le){const et=Ce.get(String(Fe.seq))??G.current[String(Fe.seq)];et&&je.push(et)}let qe=!1;const st=le.map(Fe=>{const et=String(Fe.seq);let Qt=Ce.get(et)??G.current[et];return Qt||(Qt=Pde(je),je.push(Qt),qe=!0),G.current[et]=Qt,{id:et,type:"task",position:Qt,deletable:!1,data:pe(Fe)}});x(st),qe&&_e()},[le,c,f,R,x,_e,e]),C.useEffect(()=>{if(B.current!==c)return;const ce=new Set(le.map(pe=>String(pe.seq)));v(pe=>{const Ce=pe.filter(je=>ce.has(je.source)&&ce.has(je.target));return Ce.length!==pe.length&&_e(),Ce.length===pe.length?pe:Ce})},[le,c,v,_e]),C.useEffect(()=>{if(!c||B.current!==c||f!=="free"||le.length<2)return;const ce=od(le),pe=[];for(let qe=1;qe<ce.length;qe+=1)for(const st of ce[qe-1]??[])for(const Fe of ce[qe]??[])pe.push({id:`seed-${st.seq}-${Fe.seq}`,source:String(st.seq),target:String(Fe.seq),sourceHandle:"r",targetHandle:"l",animated:!1});const Ce=Y.current,je=F.current!==c;if(F.current=c,je&&Ce.length===0)pe.length>0&&(v(pe),_e());else{const qe=new Set;for(const et of Ce)qe.add(et.source),qe.add(et.target);const st=new Set(Ce.map(et=>`${et.source}->${et.target}`)),Fe=new Set(le.map(et=>String(et.seq)).filter(et=>!W.current.has(et)&&!qe.has(et)));if(Fe.size>0){const et=pe.filter(Qt=>(Fe.has(Qt.source)||Fe.has(Qt.target))&&!st.has(`${Qt.source}->${Qt.target}`));et.length>0&&(v([...Ce,...et]),_e())}}W.current=new Set(le.map(qe=>String(qe.seq)))},[le,c,f,R,v,_e]);const ze=C.useCallback(ce=>{if(w(ce),f!=="free")return;let pe=!1;for(const Ce of ce)Ce.type==="position"&&Ce.position&&(G.current[Ce.id]=Ce.position,pe=!0);pe&&_e()},[w,_e,f]),fe=C.useCallback(ce=>{f==="free"&&(v(pe=>lP({...ce,animated:!1},pe)),_e())},[v,_e,f]),Se=C.useCallback(()=>{if(f!=="free"||le.length===0)return;const ce=od(le),pe={},Ce=[];ce.forEach((je,qe)=>{if(je.forEach((st,Fe)=>{pe[String(st.seq)]={x:xp+qe*bp,y:Gx+Fe*Kx}}),qe>0)for(const st of ce[qe-1]??[])for(const Fe of je)Ce.push({id:`seed-${st.seq}-${Fe.seq}`,source:String(st.seq),target:String(Fe.seq),sourceHandle:"r",targetHandle:"l",animated:!1})}),G.current={...G.current,...pe},x(je=>je.map(qe=>pe[qe.id]?{...qe,position:pe[qe.id]}:qe)),v(Ce),_e(),setTimeout(()=>a({padding:.2,duration:300}),60)},[f,le,x,v,_e,a]),Re=C.useCallback(async ce=>{if(!await i({title:e("flow.confirm.deleteTitle"),body:e("flow.confirm.deleteBody",{seq:ce}),danger:!0,confirm:e("flow.node.delete")}))return;P("");const Ce=Y.current.filter(je=>je.source===String(ce)||je.target===String(ce)).map(je=>({...je}));try{await DL(c,ce),o.current.push({seq:ce,edges:Ce})}catch(je){P(je instanceof Error?je.message:String(je))}finally{T(je=>je===ce?null:je),j(je=>je===ce?null:je),$.current="",z(je=>je+1),ye()}},[c,i,e,ye]),Qe=C.useCallback(async()=>{const ce=o.current.pop();if(ce){P("");try{await jne(c,ce.seq),v(pe=>{const Ce=new Set(pe.map(je=>je.id));return[...pe,...ce.edges.filter(je=>!Ce.has(je.id))]}),_e(),ye()}catch(pe){P(pe instanceof Error?pe.message:String(pe))}}},[c,v,_e,ye]),ht=C.useCallback((ce,pe)=>{var st;if(f!=="free"||pe.isValid)return;const Ce=pe.fromNode;if(!Ce||!c)return;const je="changedTouches"in ce?ce.changedTouches[0]:ce;if(!je)return;const qe=s({x:je.clientX,y:je.clientY});q({fromId:Ce.id,fromHandle:((st=pe.fromHandle)==null?void 0:st.id)??null,clientX:je.clientX,clientY:je.clientY,flowX:qe.x,flowY:qe.y})},[f,c,s]),it=C.useCallback(async()=>{const ce=U;if(q(null),!(!ce||!c))try{const pe=await cv(c,{title:`${e("flow.node.default")} ${le.length+1}`,initialState:"Planning"}),Ce=Dde(pe);if(Ce==null)return;const je=String(Ce);G.current[je]={x:ce.flowX-el/2,y:ce.flowY-tl/2},v(qe=>[...qe,{id:`e-${ce.fromId}-${je}-drop`,source:ce.fromId,target:je,sourceHandle:ce.fromHandle??void 0,animated:!1}]),_e(),ye()}catch(pe){P(pe instanceof Error?pe.message:String(pe))}},[U,c,le.length,v,_e,e,ye]);C.useEffect(()=>{if(!U)return;const ce=pe=>{pe.key==="Escape"&&q(null)};return window.addEventListener("keydown",ce),()=>window.removeEventListener("keydown",ce)},[U]);const Bt=C.useCallback((ce,pe)=>{f==="free"&&(v(Ce=>Nce(ce,pe,Ce)),_e())},[f,v,_e]);C.useEffect(()=>{const ce=pe=>{if(pe.key!=="Delete"&&pe.key!=="Backspace"||A!=null)return;const Ce=pe.target;Ce&&(Ce.tagName==="INPUT"||Ce.tagName==="TEXTAREA"||Ce.isContentEditable)||k!=null&&(pe.preventDefault(),Re(k))};return window.addEventListener("keydown",ce),()=>window.removeEventListener("keydown",ce)},[k,A,Re]),C.useEffect(()=>{const ce=pe=>{if(!(pe.metaKey||pe.ctrlKey)||pe.key!=="z"&&pe.key!=="Z"||A!=null)return;const Ce=pe.target;Ce&&(Ce.tagName==="INPUT"||Ce.tagName==="TEXTAREA"||Ce.isContentEditable)||(pe.preventDefault(),Qe())};return window.addEventListener("keydown",ce),()=>window.removeEventListener("keydown",ce)},[A,Qe]);const mt=C.useCallback(async ce=>{if(c){y(!0),P("");try{const pe=new Map(le.map(Ce=>[Ce.seq,Ce.order]));for(let Ce=0;Ce<ce.length;Ce+=1)for(const je of ce[Ce]??[])pe.get(je)!==Ce+1&&await gm(c,je,{order:Ce+1});ye()}catch(pe){P(pe instanceof Error?pe.message:String(pe))}finally{y(!1)}}},[c,le,ye]),wt=C.useCallback(ce=>{const pe=Number(ce.id);if(!Number.isInteger(pe))return;const Ce=od(le).map(Fe=>Fe.map(et=>et.seq)),je=(ce.position.x-xp)/bp,qe=Math.round(je),st=Ce.map(Fe=>Fe.filter(et=>et!==pe));if(qe>=0&&qe<Ce.length&&Math.abs(je-qe)<=.35)st[qe].push(pe);else{const Fe=Math.max(0,Math.min(st.length,Math.ceil(je)));st.splice(Fe,0,[pe])}mt(st.filter(Fe=>Fe.length>0)).finally(()=>{$.current="",z(Fe=>Fe+1)})},[le,mt]),Te=C.useCallback((ce,pe)=>{if(f==="lanes"){wt(pe);return}const Ce=new Map(K.current.map(et=>[et.id,et])),je={x:pe.position.x+el/2,y:pe.position.y+tl/2};let qe=null,st=40;for(const et of Y.current){if(et.source===pe.id||et.target===pe.id)continue;const Qt=Ce.get(et.source),Yn=Ce.get(et.target);if(!Qt||!Yn)continue;const Wt=zde(je,jA(Qt),jA(Yn));Wt<st&&(st=Wt,qe=et)}if(!qe)return;const Fe=qe;v(et=>[...et.filter(Qt=>Qt.id!==Fe.id),{id:`e-${Fe.source}-${pe.id}-${Fe.id}`,source:Fe.source,target:pe.id,animated:!1},{id:`e-${pe.id}-${Fe.target}-${Fe.id}`,source:pe.id,target:Fe.target,animated:!1}]),_e()},[f,wt,v,_e]),ct=C.useCallback(ce=>{m(ce),localStorage.setItem(NA,ce)},[]);C.useEffect(()=>{const ce=setTimeout(()=>{a({padding:.2,duration:300})},80);return()=>clearTimeout(ce)},[f,a]);const ne=async()=>{if(c){P("");try{await cv(c,{title:`${e("flow.node.default")} ${le.length+1}`,initialState:"Planning"}),ye()}catch(ce){P(ce instanceof Error?ce.message:String(ce))}}},we=async()=>{if(P(""),O(null),!c)return P(e("flow.err.noProject"));if(le.length===0)return P(e("flow.err.noNodes"));D(!0);try{const ce=le.filter(je=>je.state==="Planning"),pe=ce.length;let Ce=0;O({phase:"creating",made:Ce,total:pe});for(const je of ce)await gm(c,je.seq,{state:"Backlog",labels:Array.from(new Set([...je.labels??[],"AI-PIPELINE"]))}),Ce+=1,O({phase:"creating",made:Ce,total:pe});O({phase:"starting",made:Ce,total:pe}),await OL(c),ye(),O({phase:"done",made:Ce,total:pe})}catch(ce){P(ce instanceof Error?ce.message:String(ce))}finally{D(!1)}},he=be.isLoading&&!!c;return d.jsxs("div",{className:"flex flex-col h-full",children:[d.jsxs("header",{className:"flex items-center gap-3 flex-wrap px-4 py-3 border-b border-[var(--surface-card-border)]",children:[d.jsxs("h1",{className:"text-lg font-[family-name:var(--font-heading)] flex items-center gap-2",children:[d.jsx(UN,{size:18,strokeWidth:2.4}),e("nav.arrange")]}),d.jsx(zL,{current:c,onChange:u}),d.jsxs("div",{className:"flex gap-1",role:"group","aria-label":e("flow.mode.aria"),children:[d.jsxs("button",{type:"button",className:["nb-btn",f==="free"?"nb-btn-primary":""].join(" "),"aria-pressed":f==="free",onClick:()=>ct("free"),children:[d.jsx(UN,{size:14,strokeWidth:2.4})," ",e("flow.mode.free")]}),d.jsxs("button",{type:"button",className:["nb-btn",f==="lanes"?"nb-btn-primary":""].join(" "),"aria-pressed":f==="lanes",onClick:()=>ct("lanes"),children:[d.jsx(WB,{size:14,strokeWidth:2.4})," ",e("flow.mode.lanes")]})]}),he&&d.jsx(lt,{size:15,className:"animate-spin text-[var(--color-text-muted)]"}),d.jsxs("button",{type:"button",className:"nb-btn",onClick:()=>void ne(),disabled:!c||he,children:[d.jsx(Gn,{size:15,strokeWidth:2.4})," ",e("flow.addNode")]}),d.jsxs("button",{type:"button",className:"nb-btn nb-btn-cta ml-auto",onClick:()=>void we(),disabled:M||re||he||!c,title:re?e("flow.pipelineRunning"):void 0,children:[M||re?d.jsx(lt,{size:15,className:"animate-spin"}):d.jsx(Mm,{size:15,strokeWidth:2.4}),e(M?"flow.running":re?"flow.pipelineRunning":"flow.run")]})]}),!c&&d.jsx("div",{className:"px-4 py-2 text-sm text-[var(--color-text-muted)] border-b border-[var(--surface-card-border)]",children:e("flow.pickProject")}),I&&d.jsx("div",{className:"px-4 py-2 text-sm text-[var(--color-crashed)] bg-[var(--color-crashed-bg)] border-b border-[var(--surface-card-border)]",children:I}),V&&d.jsxs("div",{className:"px-4 py-2 text-sm flex items-center gap-3 bg-[var(--surface-input)] border-b border-[var(--surface-card-border)]",children:[V.phase==="creating"&&d.jsxs("span",{children:[e("flow.status.creating")," ",V.made,"/",V.total,"…"]}),V.phase==="starting"&&d.jsx("span",{children:e("flow.status.starting")}),V.phase==="done"&&d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"text-[var(--color-running)] font-bold",children:["✓ ",e("flow.status.done").replace("{n}",String(V.made))]}),d.jsx("button",{type:"button",className:"nb-btn nb-btn-blue",onClick:()=>n(`/board?project=${encodeURIComponent(c)}`),children:e("flow.goBoard")})]})]}),d.jsx("div",{className:"flex-1 min-h-0 arrange-flow-shell",children:d.jsxs(Yue,{nodes:b,edges:Q,nodeTypes:Ode,connectionRadius:160,nodesConnectable:f==="free",edgesReconnectable:f==="free",deleteKeyCode:A!=null?null:["Delete","Backspace"],onNodesChange:ze,onEdgesChange:ce=>{f==="free"&&(_(ce),_e())},onConnect:fe,onConnectEnd:ht,onReconnect:Bt,onNodeClick:(ce,pe)=>{const Ce=Number(pe.id);Number.isInteger(Ce)&&j(Ce)},onNodeDragStop:Te,onSelectionChange:({nodes:ce})=>{const pe=ce[0]?Number(ce[0].id):null;T(pe!=null&&Number.isInteger(pe)?pe:null)},fitView:!0,children:[d.jsx(nde,{variant:Qr.Dots,gap:18,size:1}),d.jsx(cde,{children:f==="free"&&d.jsx(md,{onClick:Se,title:e("flow.tidy"),"aria-label":e("flow.tidy"),children:d.jsx(Dj,{size:14,strokeWidth:2.4})})})]})}),U&&d.jsx("div",{className:"fixed inset-0 z-30",onClick:()=>q(null),children:d.jsxs("button",{type:"button",className:"nb-btn nb-btn-cta absolute -translate-x-1/2 -translate-y-1/2",style:{left:U.clientX,top:U.clientY},onClick:ce=>{ce.stopPropagation(),it()},children:[d.jsx(Gn,{size:14,strokeWidth:2.4})," ",e("flow.pending.create")]})}),p&&d.jsxs("div",{className:"px-4 py-1 text-xs text-[var(--color-text-muted)] border-t border-[var(--surface-card-border)] flex items-center gap-2",children:[d.jsx(lt,{size:12,className:"animate-spin"})," ",e("flow.lane.applying")]}),d.jsx("footer",{className:"px-4 py-2 text-xs text-[var(--color-text-muted)] border-t border-[var(--surface-card-border)]",children:e(f==="free"?"flow.hint":"flow.lane.hint")}),A!=null&&c&&d.jsx(Mde,{project:c,seq:A,onClose:()=>j(null),onChanged:ye,onDelete:ce=>void Re(ce)})]})}function Ude(){return d.jsx(OP,{children:d.jsx(Bde,{})})}function Fde(){const e=Xe();return d.jsxs("div",{className:"nb-card max-w-2xl mt-12",children:[d.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold mb-2",children:e("notFound.title")}),d.jsx("p",{className:"text-[var(--color-text-muted)] mb-6",children:e("notFound.body")}),d.jsx(jc,{to:"/",className:"nb-btn nb-btn-mint inline-flex",children:e("notFound.home")})]})}const $de=C.lazy(()=>yB(()=>import("./ShowcasePage-DlksLyHb.js"),__vite__mapDeps([0,1])));function qde(){return d.jsx(gF,{children:d.jsxs(L5,{children:[d.jsx(ii,{path:"/showcase",element:d.jsx(C.Suspense,{fallback:null,children:d.jsx($de,{})})}),d.jsxs(ii,{element:d.jsx(HN,{contentMode:"workspace"}),children:[d.jsx(ii,{index:!0,element:d.jsx(bx,{})}),d.jsx(ii,{path:"/projects",element:d.jsx(aT,{})}),d.jsx(ii,{path:"/projects/:name",element:d.jsx(aT,{})}),d.jsx(ii,{path:"/board",element:d.jsx(Qne,{})}),d.jsx(ii,{path:"/prompts",element:d.jsx(die,{})}),d.jsx(ii,{path:"/chat",element:d.jsx(bx,{})}),d.jsx(ii,{path:"/chat/:sessionId",element:d.jsx(bx,{})}),d.jsx(ii,{path:"/arrange",element:d.jsx(Ude,{})})]}),d.jsxs(ii,{element:d.jsx(HN,{contentMode:"document"}),children:[d.jsx(ii,{path:"/projects/new",element:d.jsx(jL,{})}),d.jsx(ii,{path:"/skills",element:d.jsx(sie,{})}),d.jsx(ii,{path:"/system",element:d.jsx(Aie,{})}),d.jsx(ii,{path:"/memory",element:d.jsx(Fie,{})}),d.jsx(ii,{path:"/plugins",element:d.jsx(sse,{})}),d.jsx(ii,{path:"*",element:d.jsx(Fde,{})})]})]})})}mF();$6();const Hde=new S4({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1}}}),zP=document.getElementById("root");if(!zP)throw new Error("#root not found");Zz.createRoot(zP).render(d.jsx(C.StrictMode,{children:d.jsx(R6,{children:d.jsx(k4,{client:Hde,children:d.jsx(aB,{children:d.jsx(BW,{children:d.jsx(qde,{})})})})})}));export{kj as A,VB as C,Aj as E,jc as L,Hv as P,f0 as S,_B as a,Pe as c,d as j,C as r,qj as u};
855
+ `).trim()}function jde(e,t){return t.includes("NEEDS-FIX")?"stuck":e==="Done"?"done":e==="Inprogress"?"doing":"todo"}function Mde({project:e,seq:t,onClose:n,onChanged:i,onDelete:s}){var V;const a=Xe(),[o,c]=C.useState(!0),[u,f]=C.useState(!1),[m,p]=C.useState(""),[y,b]=C.useState(""),[x,w]=C.useState(new Set),[E,v]=C.useState(""),[_,k]=C.useState("todo"),[T,A]=C.useState(null),[j,M]=C.useState(""),D=at({queryKey:["skills-all",e],queryFn:()=>ig(e)}),I=((V=D.data)==null?void 0:V.data)??[];C.useEffect(()=>{const O=R=>{R.key==="Escape"&&n()};return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[n]),C.useEffect(()=>{let O=!1;return c(!0),RL(e,t).then(R=>{O||(p(R.title),w(new Set(R.skills??[])),b(Ade(R.body)),v(R.state),k(jde(R.state,R.labels??[])),A(typeof R.order=="number"?R.order:null))}).catch(()=>{}).finally(()=>{O||c(!1)}),()=>{O=!0}},[e,t]);const P=O=>{w(R=>{const z=new Set(R);return z.has(O)?z.delete(O):z.add(O),z})},U=async()=>{M(""),f(!0);try{await gm(e,t,{title:m.trim()||a("flow.node.default"),description:y,skills:[...x]}),i(),n()}catch(O){M(O instanceof Error?O.message:String(O)),f(!1)}},q=()=>s(t);return d.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-center justify-center p-4 md:p-6 bg-black/30 overflow-hidden",onClick:n,children:d.jsxs("div",{className:"nb-card w-full max-w-4xl flex flex-col bg-[var(--color-bg)]",style:{maxHeight:"calc(100vh - 48px)"},onClick:O=>O.stopPropagation(),children:[d.jsxs("header",{className:"flex items-start justify-between gap-4 mb-4 flex-shrink-0",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs px-2 py-0.5 bg-[var(--color-accent-purple)] border-2 border-[var(--color-text)] rounded-full",children:["#",t]}),E&&d.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs px-2 py-0.5 border-2 border-[var(--color-text)] rounded-full font-semibold",children:[d.jsx("span",{className:"w-2.5 h-2.5 rounded-full inline-block border border-[var(--color-text)]",style:{background:Cv[_]??"gray"}}),E]}),T!=null&&d.jsx("span",{className:"font-[family-name:var(--font-mono)] text-xs px-2 py-0.5 bg-[var(--color-accent-mint)] border-2 border-[var(--color-text)] rounded-full font-semibold",title:a("flow.lane.orderTip"),children:a("flow.lane.wave",{n:T})})]}),d.jsx("button",{onClick:n,className:"nb-btn nb-btn-mint p-2 flex-shrink-0","aria-label":a("flow.node.close"),type:"button",children:d.jsx(vn,{size:14,strokeWidth:3})})]}),o?d.jsxs("div",{className:"flex items-center gap-2 text-sm text-[var(--color-text-muted)] py-10 justify-center",children:[d.jsx(lt,{size:16,className:"animate-spin"})," …"]}):d.jsxs(d.Fragment,{children:[j&&d.jsx("div",{className:"text-sm text-[var(--color-crashed)] mb-3",children:j}),d.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-1 gap-4 overflow-y-auto pr-1 md:grid-cols-[minmax(0,1fr)_minmax(260px,340px)] md:overflow-hidden md:pr-0",children:[d.jsxs("div",{className:"flex min-h-0 flex-col gap-4 md:overflow-y-auto md:pr-1",children:[d.jsxs("label",{className:"flex flex-col gap-1.5",children:[d.jsx("span",{className:"text-sm font-bold",children:a("flow.node.title")}),d.jsx("input",{className:"nb-input w-full text-base font-semibold",value:m,onChange:O=>p(O.target.value),autoFocus:!0})]}),d.jsxs("label",{className:"flex flex-1 min-h-0 flex-col gap-1.5",children:[d.jsx("span",{className:"text-sm font-bold",children:a("flow.node.desc")}),d.jsx("textarea",{className:"nb-input w-full flex-1 min-h-0",style:{minHeight:200,resize:"vertical"},value:y,onChange:O=>b(O.target.value)})]})]}),d.jsxs("section",{className:"flex min-h-[200px] flex-col gap-2 md:min-h-0 md:overflow-hidden",children:[d.jsx("span",{className:"text-sm font-bold",children:a("flow.node.skills")}),d.jsx("div",{className:"scroll-frame min-h-0 flex-1 rounded-lg border-2 border-[var(--color-border-light)] bg-[var(--color-bg-cream)]",children:d.jsxs("div",{className:"scroll-frame-body h-full p-2",children:[D.isLoading&&d.jsx(lt,{size:14,className:"animate-spin text-[var(--color-text-muted)]"}),I.length>0&&d.jsx("div",{className:"flex flex-wrap gap-2",children:I.map(O=>{const R=x.has(O.name);return d.jsx("button",{type:"button",onClick:()=>P(O.name),className:["max-w-full break-all px-2.5 py-1 text-left text-xs font-[family-name:var(--font-mono)] rounded-full border-2 transition-all",R?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),"aria-pressed":R,children:O.name},O.name)})})]})}),x.size>0&&d.jsx("p",{className:"max-h-14 overflow-y-auto break-words text-xs text-[var(--color-text-muted)]",children:[...x].join(", ")})]})]}),d.jsxs("div",{className:"flex gap-2 justify-between mt-4 pt-3 border-t-2 border-dashed border-[var(--color-text)] flex-shrink-0",children:[d.jsxs("button",{type:"button",className:"nb-btn nb-btn-danger",onClick:()=>void q(),disabled:u,children:[d.jsx(qi,{size:14,strokeWidth:2.4})," ",a("flow.node.delete")]}),d.jsxs("button",{type:"button",className:"nb-btn nb-btn-cta",onClick:()=>void U(),disabled:u,children:[u?d.jsx(lt,{size:14,className:"animate-spin"}):null,a("flow.node.save")]})]})]})]})})}const Rde=C.memo(function({data:t}){const n=t;return d.jsxs("div",{className:"relative w-full h-full rounded-2xl border-2 border-dashed border-[var(--color-text)]",children:[d.jsx("div",{className:"absolute inset-0 rounded-2xl",style:{background:n.color,opacity:.16}}),d.jsxs("span",{className:"absolute top-1.5 left-2.5 inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-bold rounded-md border-2 border-[var(--color-text)] bg-[var(--color-bg)] text-[var(--color-text)] whitespace-nowrap max-w-[90%]",children:[d.jsx("span",{className:"truncate",children:n.label}),n.sub&&d.jsx("span",{className:"font-normal text-[var(--color-text-muted)]",children:n.sub})]})]})});function Dde(e){const t=e;if(typeof t.seq=="number")return t.seq;const n=/#(\d+)/.exec(t.output??"");return n?Number(n[1]):null}const Ode={task:Tde,waveBox:Rde},kA="sps.flow.lastProject",NA="sps.flow.mode";function _A(e){return(e.labels??[]).includes("NEEDS-FIX")?"stuck":e.state==="Done"?"done":e.state==="Inprogress"?"doing":"todo"}function Lde(e){return e==="done"?{animated:!1,style:{stroke:"var(--color-running)",strokeWidth:2.5}}:e==="doing"?{animated:!1,className:"arrange-flow-edge-working",style:{stroke:"var(--color-running)",strokeWidth:3,strokeDasharray:"8 6"}}:e==="stuck"?{animated:!1,style:{stroke:"var(--color-crashed)",strokeWidth:2.5,strokeDasharray:"6 4"}}:{animated:!1,style:{stroke:"var(--color-accent-yellow)",strokeWidth:2.5,strokeDasharray:"6 4"}}}const el=260,tl=158,Tm=28,bp=el+120,Kx=tl+28,CA=16,TA=44,xp=60,Gx=100,AA=["var(--color-accent-mint)","var(--color-accent-pink)","var(--color-accent-yellow)","var(--color-accent-purple)","var(--color-running-bg)","var(--color-idle-bg)"];function od(e){const t=new Map;for(const n of e){const i=t.get(n.order)??[];i.push(n),t.set(n.order,i)}return[...t.entries()].sort((n,i)=>n[0]-i[0]).map(([,n])=>n.sort((i,s)=>i.seq-s.seq))}function Ide(e,t){return Math.abs(e.x-t.x)<el+Tm&&Math.abs(e.y-t.y)<tl+Tm}function Pde(e){for(let t=0;t<80;t+=1)for(let n=0;n<8;n+=1){const i={x:60+n*(el+Tm),y:60+t*(tl+Tm)};if(!e.some(s=>Ide(i,s)))return i}return{x:60,y:60}}function jA(e){return{x:e.position.x+el/2,y:e.position.y+tl/2}}function zde(e,t,n){const i=n.x-t.x,s=n.y-t.y,a=i*i+s*s;if(a===0)return Math.hypot(e.x-t.x,e.y-t.y);let o=((e.x-t.x)*i+(e.y-t.y)*s)/a;return o=Math.max(0,Math.min(1,o)),Math.hypot(e.x-(t.x+o*i),e.y-(t.y+o*s))}function Bde(){var Ve,Ze,Ct,Gt;const e=Xe(),t=tn(),n=dl(),{confirm:i}=Ln(),{screenToFlowPosition:s,fitView:a}=gg(),o=C.useRef([]),[c,u]=C.useState(()=>localStorage.getItem(kA)??""),[f,m]=C.useState(()=>localStorage.getItem(NA)==="lanes"?"lanes":"free"),[p,y]=C.useState(!1),[b,x,w]=Xue([]),[E,v,_]=Que([]),[k,T]=C.useState(null),[A,j]=C.useState(null),[M,D]=C.useState(!1),[I,P]=C.useState(""),[U,q]=C.useState(null),[V,O]=C.useState(null),[R,z]=C.useState(0),G=C.useRef({}),Y=C.useRef(E);Y.current=E;const K=C.useRef(b);K.current=b;const B=C.useRef(null),F=C.useRef(null),W=C.useRef(new Set),$=C.useRef(""),ae=C.useRef(null);LL(c||null);const be=at({queryKey:["cards",c],queryFn:()=>ML(c),enabled:!!c,refetchInterval:3e3}),le=((Ve=be.data)==null?void 0:Ve.data)??[],re=((Gt=(Ct=(Ze=at({queryKey:["projects"],queryFn:ro,refetchInterval:3e3}).data)==null?void 0:Ze.data)==null?void 0:Ct.find(ce=>ce.name===c))==null?void 0:Gt.pipelineStatus)==="running",me=C.useMemo(()=>{const ce={};for(const pe of le)ce[String(pe.seq)]=_A(pe);return ce},[le]),se=C.useMemo(()=>{if(f!=="lanes")return[];const ce=od(le),pe=[];for(let Ce=1;Ce<ce.length;Ce+=1)for(const je of ce[Ce-1]??[])for(const qe of ce[Ce]??[])pe.push({id:`w${je.seq}-${qe.seq}`,source:String(je.seq),target:String(qe.seq),sourceHandle:"r",targetHandle:"l",animated:!1,selectable:!1,deletable:!1});return pe},[f,le]),Q=C.useMemo(()=>(f==="lanes"?se:E).map(ce=>{const pe=Lde(me[ce.target]);return ce.selected?{...ce,...pe,style:{...pe.style,strokeWidth:6}}:{...ce,...pe}}),[f,se,E,me]),ye=C.useCallback(()=>{t.invalidateQueries({queryKey:["cards",c]})},[t,c]),_e=C.useCallback(()=>{!c||B.current!==c||(ae.current&&clearTimeout(ae.current),ae.current=setTimeout(()=>{_de(c,{positions:G.current,edges:Y.current.map(ce=>({id:ce.id,source:ce.source,target:ce.target,sourceHandle:ce.sourceHandle??null,targetHandle:ce.targetHandle??null}))}).catch(()=>{})},600))},[c]);C.useEffect(()=>{if(B.current=null,T(null),O(null),G.current={},W.current=new Set,$.current="",x([]),v([]),!c)return;localStorage.setItem(kA,c);let ce=!1;return Nde(c).then(pe=>{ce||(G.current=pe.positions??{},v((pe.edges??[]).map(Ce=>({id:Ce.id,source:Ce.source,target:Ce.target,sourceHandle:Ce.sourceHandle??void 0,targetHandle:Ce.targetHandle??void 0,animated:!1}))))}).catch(()=>{}).finally(()=>{ce||(B.current=c,z(pe=>pe+1))}),()=>{ce=!0}},[c,x,v]),C.useEffect(()=>{if(!c||B.current!==c)return;const ce=`${f}|`+le.map(Fe=>`${Fe.seq}:${Fe.title}:${Fe.state}:${Fe.order}:${(Fe.skills??[]).join("|")}`).join(",");if(ce===$.current)return;$.current=ce;const pe=Fe=>({seq:String(Fe.seq),title:Fe.title,skills:(Fe.skills??[]).join(", "),status:_A(Fe),label:Fe.title,desc:""});if(f==="lanes"){const Fe=od(le),et=Fe.map((Yn,Wt)=>({id:`wave-${Wt}`,type:"waveBox",position:{x:xp+Wt*bp-CA,y:Gx-TA},data:{label:e("flow.lane.wave",{n:Wt+1}),sub:Yn.length>1?e("flow.lane.parallel",{n:Yn.length}):"",color:AA[Wt%AA.length]},style:{width:el+CA*2,height:TA+(Yn.length-1)*Kx+tl+14},draggable:!1,selectable:!1,zIndex:0})),Qt=Fe.flatMap((Yn,Wt)=>Yn.map((Z,xe)=>({id:String(Z.seq),type:"task",position:{x:xp+Wt*bp,y:Gx+xe*Kx},deletable:!1,zIndex:1,data:pe(Z)})));x([...et,...Qt]);return}const Ce=new Map(K.current.map(Fe=>[Fe.id,Fe.position])),je=[];for(const Fe of le){const et=Ce.get(String(Fe.seq))??G.current[String(Fe.seq)];et&&je.push(et)}let qe=!1;const st=le.map(Fe=>{const et=String(Fe.seq);let Qt=Ce.get(et)??G.current[et];return Qt||(Qt=Pde(je),je.push(Qt),qe=!0),G.current[et]=Qt,{id:et,type:"task",position:Qt,deletable:!1,data:pe(Fe)}});x(st),qe&&_e()},[le,c,f,R,x,_e,e]),C.useEffect(()=>{if(B.current!==c)return;const ce=new Set(le.map(pe=>String(pe.seq)));v(pe=>{const Ce=pe.filter(je=>ce.has(je.source)&&ce.has(je.target));return Ce.length!==pe.length&&_e(),Ce.length===pe.length?pe:Ce})},[le,c,v,_e]),C.useEffect(()=>{if(!c||B.current!==c||f!=="free"||le.length<2)return;const ce=od(le),pe=[];for(let qe=1;qe<ce.length;qe+=1)for(const st of ce[qe-1]??[])for(const Fe of ce[qe]??[])pe.push({id:`seed-${st.seq}-${Fe.seq}`,source:String(st.seq),target:String(Fe.seq),sourceHandle:"r",targetHandle:"l",animated:!1});const Ce=Y.current,je=F.current!==c;if(F.current=c,je&&Ce.length===0)pe.length>0&&(v(pe),_e());else{const qe=new Set;for(const et of Ce)qe.add(et.source),qe.add(et.target);const st=new Set(Ce.map(et=>`${et.source}->${et.target}`)),Fe=new Set(le.map(et=>String(et.seq)).filter(et=>!W.current.has(et)&&!qe.has(et)));if(Fe.size>0){const et=pe.filter(Qt=>(Fe.has(Qt.source)||Fe.has(Qt.target))&&!st.has(`${Qt.source}->${Qt.target}`));et.length>0&&(v([...Ce,...et]),_e())}}W.current=new Set(le.map(qe=>String(qe.seq)))},[le,c,f,R,v,_e]);const ze=C.useCallback(ce=>{if(w(ce),f!=="free")return;let pe=!1;for(const Ce of ce)Ce.type==="position"&&Ce.position&&(G.current[Ce.id]=Ce.position,pe=!0);pe&&_e()},[w,_e,f]),fe=C.useCallback(ce=>{f==="free"&&(v(pe=>lP({...ce,animated:!1},pe)),_e())},[v,_e,f]),Se=C.useCallback(()=>{if(f!=="free"||le.length===0)return;const ce=od(le),pe={},Ce=[];ce.forEach((je,qe)=>{if(je.forEach((st,Fe)=>{pe[String(st.seq)]={x:xp+qe*bp,y:Gx+Fe*Kx}}),qe>0)for(const st of ce[qe-1]??[])for(const Fe of je)Ce.push({id:`seed-${st.seq}-${Fe.seq}`,source:String(st.seq),target:String(Fe.seq),sourceHandle:"r",targetHandle:"l",animated:!1})}),G.current={...G.current,...pe},x(je=>je.map(qe=>pe[qe.id]?{...qe,position:pe[qe.id]}:qe)),v(Ce),_e(),setTimeout(()=>a({padding:.2,duration:300}),60)},[f,le,x,v,_e,a]),Re=C.useCallback(async ce=>{if(!await i({title:e("flow.confirm.deleteTitle"),body:e("flow.confirm.deleteBody",{seq:ce}),danger:!0,confirm:e("flow.node.delete")}))return;P("");const Ce=Y.current.filter(je=>je.source===String(ce)||je.target===String(ce)).map(je=>({...je}));try{await DL(c,ce),o.current.push({seq:ce,edges:Ce})}catch(je){P(je instanceof Error?je.message:String(je))}finally{T(je=>je===ce?null:je),j(je=>je===ce?null:je),$.current="",z(je=>je+1),ye()}},[c,i,e,ye]),Qe=C.useCallback(async()=>{const ce=o.current.pop();if(ce){P("");try{await jne(c,ce.seq),v(pe=>{const Ce=new Set(pe.map(je=>je.id));return[...pe,...ce.edges.filter(je=>!Ce.has(je.id))]}),_e(),ye()}catch(pe){P(pe instanceof Error?pe.message:String(pe))}}},[c,v,_e,ye]),ht=C.useCallback((ce,pe)=>{var st;if(f!=="free"||pe.isValid)return;const Ce=pe.fromNode;if(!Ce||!c)return;const je="changedTouches"in ce?ce.changedTouches[0]:ce;if(!je)return;const qe=s({x:je.clientX,y:je.clientY});q({fromId:Ce.id,fromHandle:((st=pe.fromHandle)==null?void 0:st.id)??null,clientX:je.clientX,clientY:je.clientY,flowX:qe.x,flowY:qe.y})},[f,c,s]),it=C.useCallback(async()=>{const ce=U;if(q(null),!(!ce||!c))try{const pe=await cv(c,{title:`${e("flow.node.default")} ${le.length+1}`,initialState:"Planning"}),Ce=Dde(pe);if(Ce==null)return;const je=String(Ce);G.current[je]={x:ce.flowX-el/2,y:ce.flowY-tl/2},v(qe=>[...qe,{id:`e-${ce.fromId}-${je}-drop`,source:ce.fromId,target:je,sourceHandle:ce.fromHandle??void 0,animated:!1}]),_e(),ye()}catch(pe){P(pe instanceof Error?pe.message:String(pe))}},[U,c,le.length,v,_e,e,ye]);C.useEffect(()=>{if(!U)return;const ce=pe=>{pe.key==="Escape"&&q(null)};return window.addEventListener("keydown",ce),()=>window.removeEventListener("keydown",ce)},[U]);const Bt=C.useCallback((ce,pe)=>{f==="free"&&(v(Ce=>Nce(ce,pe,Ce)),_e())},[f,v,_e]);C.useEffect(()=>{const ce=pe=>{if(pe.key!=="Delete"&&pe.key!=="Backspace"||A!=null)return;const Ce=pe.target;Ce&&(Ce.tagName==="INPUT"||Ce.tagName==="TEXTAREA"||Ce.isContentEditable)||k!=null&&(pe.preventDefault(),Re(k))};return window.addEventListener("keydown",ce),()=>window.removeEventListener("keydown",ce)},[k,A,Re]),C.useEffect(()=>{const ce=pe=>{if(!(pe.metaKey||pe.ctrlKey)||pe.key!=="z"&&pe.key!=="Z"||A!=null)return;const Ce=pe.target;Ce&&(Ce.tagName==="INPUT"||Ce.tagName==="TEXTAREA"||Ce.isContentEditable)||(pe.preventDefault(),Qe())};return window.addEventListener("keydown",ce),()=>window.removeEventListener("keydown",ce)},[A,Qe]);const mt=C.useCallback(async ce=>{if(c){y(!0),P("");try{const pe=new Map(le.map(Ce=>[Ce.seq,Ce.order]));for(let Ce=0;Ce<ce.length;Ce+=1)for(const je of ce[Ce]??[])pe.get(je)!==Ce+1&&await gm(c,je,{order:Ce+1});ye()}catch(pe){P(pe instanceof Error?pe.message:String(pe))}finally{y(!1)}}},[c,le,ye]),wt=C.useCallback(ce=>{const pe=Number(ce.id);if(!Number.isInteger(pe))return;const Ce=od(le).map(Fe=>Fe.map(et=>et.seq)),je=(ce.position.x-xp)/bp,qe=Math.round(je),st=Ce.map(Fe=>Fe.filter(et=>et!==pe));if(qe>=0&&qe<Ce.length&&Math.abs(je-qe)<=.35)st[qe].push(pe);else{const Fe=Math.max(0,Math.min(st.length,Math.ceil(je)));st.splice(Fe,0,[pe])}mt(st.filter(Fe=>Fe.length>0)).finally(()=>{$.current="",z(Fe=>Fe+1)})},[le,mt]),Te=C.useCallback((ce,pe)=>{if(f==="lanes"){wt(pe);return}const Ce=new Map(K.current.map(et=>[et.id,et])),je={x:pe.position.x+el/2,y:pe.position.y+tl/2};let qe=null,st=40;for(const et of Y.current){if(et.source===pe.id||et.target===pe.id)continue;const Qt=Ce.get(et.source),Yn=Ce.get(et.target);if(!Qt||!Yn)continue;const Wt=zde(je,jA(Qt),jA(Yn));Wt<st&&(st=Wt,qe=et)}if(!qe)return;const Fe=qe;v(et=>[...et.filter(Qt=>Qt.id!==Fe.id),{id:`e-${Fe.source}-${pe.id}-${Fe.id}`,source:Fe.source,target:pe.id,animated:!1},{id:`e-${pe.id}-${Fe.target}-${Fe.id}`,source:pe.id,target:Fe.target,animated:!1}]),_e()},[f,wt,v,_e]),ct=C.useCallback(ce=>{m(ce),localStorage.setItem(NA,ce)},[]);C.useEffect(()=>{const ce=setTimeout(()=>{a({padding:.2,duration:300})},80);return()=>clearTimeout(ce)},[f,a]);const ne=async()=>{if(c){P("");try{await cv(c,{title:`${e("flow.node.default")} ${le.length+1}`,initialState:"Planning"}),ye()}catch(ce){P(ce instanceof Error?ce.message:String(ce))}}},we=async()=>{if(P(""),O(null),!c)return P(e("flow.err.noProject"));if(le.length===0)return P(e("flow.err.noNodes"));D(!0);try{const ce=le.filter(je=>je.state==="Planning"),pe=ce.length;let Ce=0;O({phase:"creating",made:Ce,total:pe});for(const je of ce)await gm(c,je.seq,{state:"Backlog",labels:Array.from(new Set([...je.labels??[],"AI-PIPELINE"]))}),Ce+=1,O({phase:"creating",made:Ce,total:pe});O({phase:"starting",made:Ce,total:pe}),await OL(c),ye(),O({phase:"done",made:Ce,total:pe})}catch(ce){P(ce instanceof Error?ce.message:String(ce))}finally{D(!1)}},he=be.isLoading&&!!c;return d.jsxs("div",{className:"flex flex-col h-full",children:[d.jsxs("header",{className:"flex items-center gap-3 flex-wrap px-4 py-3 border-b border-[var(--surface-card-border)]",children:[d.jsxs("h1",{className:"text-lg font-[family-name:var(--font-heading)] flex items-center gap-2",children:[d.jsx(UN,{size:18,strokeWidth:2.4}),e("nav.arrange")]}),d.jsx(zL,{current:c,onChange:u}),d.jsxs("div",{className:"flex gap-1",role:"group","aria-label":e("flow.mode.aria"),children:[d.jsxs("button",{type:"button",className:["nb-btn",f==="free"?"nb-btn-primary":""].join(" "),"aria-pressed":f==="free",onClick:()=>ct("free"),children:[d.jsx(UN,{size:14,strokeWidth:2.4})," ",e("flow.mode.free")]}),d.jsxs("button",{type:"button",className:["nb-btn",f==="lanes"?"nb-btn-primary":""].join(" "),"aria-pressed":f==="lanes",onClick:()=>ct("lanes"),children:[d.jsx(WB,{size:14,strokeWidth:2.4})," ",e("flow.mode.lanes")]})]}),he&&d.jsx(lt,{size:15,className:"animate-spin text-[var(--color-text-muted)]"}),d.jsxs("button",{type:"button",className:"nb-btn",onClick:()=>void ne(),disabled:!c||he,children:[d.jsx(Gn,{size:15,strokeWidth:2.4})," ",e("flow.addNode")]}),d.jsxs("button",{type:"button",className:"nb-btn nb-btn-cta ml-auto",onClick:()=>void we(),disabled:M||re||he||!c,title:re?e("flow.pipelineRunning"):void 0,children:[M||re?d.jsx(lt,{size:15,className:"animate-spin"}):d.jsx(Mm,{size:15,strokeWidth:2.4}),e(M?"flow.running":re?"flow.pipelineRunning":"flow.run")]})]}),!c&&d.jsx("div",{className:"px-4 py-2 text-sm text-[var(--color-text-muted)] border-b border-[var(--surface-card-border)]",children:e("flow.pickProject")}),I&&d.jsx("div",{className:"px-4 py-2 text-sm text-[var(--color-crashed)] bg-[var(--color-crashed-bg)] border-b border-[var(--surface-card-border)]",children:I}),V&&d.jsxs("div",{className:"px-4 py-2 text-sm flex items-center gap-3 bg-[var(--surface-input)] border-b border-[var(--surface-card-border)]",children:[V.phase==="creating"&&d.jsxs("span",{children:[e("flow.status.creating")," ",V.made,"/",V.total,"…"]}),V.phase==="starting"&&d.jsx("span",{children:e("flow.status.starting")}),V.phase==="done"&&d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"text-[var(--color-running)] font-bold",children:["✓ ",e("flow.status.done").replace("{n}",String(V.made))]}),d.jsx("button",{type:"button",className:"nb-btn nb-btn-blue",onClick:()=>n(`/board?project=${encodeURIComponent(c)}`),children:e("flow.goBoard")})]})]}),d.jsx("div",{className:"flex-1 min-h-0 arrange-flow-shell",children:d.jsxs(Yue,{nodes:b,edges:Q,nodeTypes:Ode,connectionRadius:160,nodesConnectable:f==="free",edgesReconnectable:f==="free",deleteKeyCode:A!=null?null:["Delete","Backspace"],onNodesChange:ze,onEdgesChange:ce=>{f==="free"&&(_(ce),_e())},onConnect:fe,onConnectEnd:ht,onReconnect:Bt,onNodeClick:(ce,pe)=>{const Ce=Number(pe.id);Number.isInteger(Ce)&&j(Ce)},onNodeDragStop:Te,onSelectionChange:({nodes:ce})=>{const pe=ce[0]?Number(ce[0].id):null;T(pe!=null&&Number.isInteger(pe)?pe:null)},fitView:!0,children:[d.jsx(nde,{variant:Qr.Dots,gap:18,size:1}),d.jsx(cde,{children:f==="free"&&d.jsx(md,{onClick:Se,title:e("flow.tidy"),"aria-label":e("flow.tidy"),children:d.jsx(Dj,{size:14,strokeWidth:2.4})})})]})}),U&&d.jsx("div",{className:"fixed inset-0 z-30",onClick:()=>q(null),children:d.jsxs("button",{type:"button",className:"nb-btn nb-btn-cta absolute -translate-x-1/2 -translate-y-1/2",style:{left:U.clientX,top:U.clientY},onClick:ce=>{ce.stopPropagation(),it()},children:[d.jsx(Gn,{size:14,strokeWidth:2.4})," ",e("flow.pending.create")]})}),p&&d.jsxs("div",{className:"px-4 py-1 text-xs text-[var(--color-text-muted)] border-t border-[var(--surface-card-border)] flex items-center gap-2",children:[d.jsx(lt,{size:12,className:"animate-spin"})," ",e("flow.lane.applying")]}),d.jsx("footer",{className:"px-4 py-2 text-xs text-[var(--color-text-muted)] border-t border-[var(--surface-card-border)]",children:e(f==="free"?"flow.hint":"flow.lane.hint")}),A!=null&&c&&d.jsx(Mde,{project:c,seq:A,onClose:()=>j(null),onChanged:ye,onDelete:ce=>void Re(ce)})]})}function Ude(){return d.jsx(OP,{children:d.jsx(Bde,{})})}function Fde(){const e=Xe();return d.jsxs("div",{className:"nb-card max-w-2xl mt-12",children:[d.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold mb-2",children:e("notFound.title")}),d.jsx("p",{className:"text-[var(--color-text-muted)] mb-6",children:e("notFound.body")}),d.jsx(jc,{to:"/",className:"nb-btn nb-btn-mint inline-flex",children:e("notFound.home")})]})}const $de=C.lazy(()=>yB(()=>import("./ShowcasePage-C-y4JCT4.js"),__vite__mapDeps([0,1])));function qde(){return d.jsx(gF,{children:d.jsxs(L5,{children:[d.jsx(ii,{path:"/showcase",element:d.jsx(C.Suspense,{fallback:null,children:d.jsx($de,{})})}),d.jsxs(ii,{element:d.jsx(HN,{contentMode:"workspace"}),children:[d.jsx(ii,{index:!0,element:d.jsx(bx,{})}),d.jsx(ii,{path:"/projects",element:d.jsx(aT,{})}),d.jsx(ii,{path:"/projects/:name",element:d.jsx(aT,{})}),d.jsx(ii,{path:"/board",element:d.jsx(Qne,{})}),d.jsx(ii,{path:"/prompts",element:d.jsx(die,{})}),d.jsx(ii,{path:"/chat",element:d.jsx(bx,{})}),d.jsx(ii,{path:"/chat/:sessionId",element:d.jsx(bx,{})}),d.jsx(ii,{path:"/arrange",element:d.jsx(Ude,{})})]}),d.jsxs(ii,{element:d.jsx(HN,{contentMode:"document"}),children:[d.jsx(ii,{path:"/projects/new",element:d.jsx(jL,{})}),d.jsx(ii,{path:"/skills",element:d.jsx(sie,{})}),d.jsx(ii,{path:"/system",element:d.jsx(Aie,{})}),d.jsx(ii,{path:"/memory",element:d.jsx(Fie,{})}),d.jsx(ii,{path:"/plugins",element:d.jsx(sse,{})}),d.jsx(ii,{path:"*",element:d.jsx(Fde,{})})]})]})})}mF();$6();const Hde=new S4({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1}}}),zP=document.getElementById("root");if(!zP)throw new Error("#root not found");Zz.createRoot(zP).render(d.jsx(C.StrictMode,{children:d.jsx(R6,{children:d.jsx(k4,{client:Hde,children:d.jsx(aB,{children:d.jsx(BW,{children:d.jsx(qde,{})})})})})}));export{kj as A,VB as C,Aj as E,jc as L,Hv as P,f0 as S,_B as a,Pe as c,d as j,C as r,qj as u};
@@ -8,8 +8,8 @@
8
8
  <link rel="preconnect" href="https://fonts.googleapis.com">
9
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
10
  <link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
11
- <script type="module" crossorigin src="/assets/index-CZhMVChp.js"></script>
12
- <link rel="stylesheet" crossorigin href="/assets/index-BLzc86Oa.css">
11
+ <script type="module" crossorigin src="/assets/index-D3_htjwc.js"></script>
12
+ <link rel="stylesheet" crossorigin href="/assets/index-5SxV_3Ku.css">
13
13
  </head>
14
14
  <body>
15
15
  <div id="root"></div>
@@ -1 +1 @@
1
- {"version":3,"file":"sessionDaemon.d.ts","sourceRoot":"","sources":["../../src/daemon/sessionDaemon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA4CH,MAAM,WAAW,aAAa;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EACF,eAAe,GACf,UAAU,GACV,SAAS,GACT,aAAa,GACb,eAAe,GACf,UAAU,GACV,WAAW,GACX,mBAAmB,GACnB,mBAAmB,GACnB,UAAU,GACV,cAAc,GACd,UAAU,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,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A+BtB,OAAO,CAAC,IAAI;IAQZ,OAAO,CAAC,GAAG;CAIZ"}
@@ -39,12 +39,22 @@ const SESSION_GC_MS = (() => {
39
39
  * 空闲看门狗阈值:chat 会话(session-*)一轮 run 处于活动、但**超此时长无任何事件流出**(text/tool/result),
40
40
  * 判定卡死 → 冒 error+complete(failed)+ 取消 run,**避免静默 stuck 无限挂着**(见 daemon 模式下限额/网络挂死
41
41
  * 停在 running 数小时的事故;旧 jsonl-silence 看门狗只覆盖 ACP 路,此为 engine 无关的事件级兜底)。
42
- * chat 工具都很快(MCP/记忆秒级),故默认 5min 足够宽、不误杀;pipeline(worker-*)不走此路,由 MonitorEngine 管超时。
42
+ * 普通输出默认 5min;运行中的长耗时工具另用更宽窗口( RUN_TOOL_IDLE_MS)
43
+ * pipeline(worker-*)不走此路,由 MonitorEngine 管超时。
43
44
  */
44
45
  const RUN_IDLE_MS = (() => {
45
46
  const n = parseInt(process.env.SPS_RUN_IDLE_MINUTES || '', 10);
46
47
  return (Number.isFinite(n) && n > 0 ? n : 5) * 60_000;
47
48
  })();
49
+ /**
50
+ * 工具运行静默阈值:MCP 工具自身最长可运行 10min(媒体生成尤其可能超过 5min),额外留 2min
51
+ * 给下载/落盘/结果回传。仍保留上限,避免真正挂死的工具无限占住会话。
52
+ */
53
+ const RUN_TOOL_IDLE_MS = (() => {
54
+ const n = parseInt(process.env.SPS_RUN_TOOL_IDLE_MINUTES || '', 10);
55
+ return (Number.isFinite(n) && n > 0 ? n : 12) * 60_000;
56
+ })();
57
+ const ACTIVE_TOOL_STATUSES = new Set(['pending', 'running', 'in_progress']);
48
58
  import { createSessionContext } from '../core/sessionContext.js';
49
59
  import { createSessionRuntime } from '../providers/registry.js';
50
60
  import { CapacityError, loadRunGovernorConfig, RunGovernor } from './runGovernor.js';
@@ -205,6 +215,7 @@ export class SessionDaemon {
205
215
  const watchable = slot.startsWith('session-');
206
216
  let lastEvt = Date.now();
207
217
  let settled = false;
218
+ const activeTools = new Set();
208
219
  let watchdog = null;
209
220
  const clearWatchdog = () => {
210
221
  if (watchdog) {
@@ -214,6 +225,12 @@ export class SessionDaemon {
214
225
  };
215
226
  const unsubscribe = this.runtime.subscribe(slot, (evt) => {
216
227
  lastEvt = Date.now();
228
+ if (evt.type === 'tool_use' || evt.type === 'tool_update') {
229
+ if (ACTIVE_TOOL_STATUSES.has(evt.status))
230
+ activeTools.add(evt.id);
231
+ else
232
+ activeTools.delete(evt.id);
233
+ }
217
234
  // Translate AccumulatorEvent → DaemonEvent (1:1 mapping, just rename type→event)
218
235
  const { type, ...rest } = evt;
219
236
  this.send(socket, { event: type, ...rest });
@@ -227,11 +244,13 @@ export class SessionDaemon {
227
244
  watchdog = setInterval(() => {
228
245
  if (settled)
229
246
  return;
230
- if (Date.now() - lastEvt > RUN_IDLE_MS) {
247
+ const idleLimit = activeTools.size > 0 ? RUN_TOOL_IDLE_MS : RUN_IDLE_MS;
248
+ if (Date.now() - lastEvt > idleLimit) {
231
249
  settled = true;
232
250
  clearWatchdog();
233
- const mins = Math.round(RUN_IDLE_MS / 60_000);
234
- this.log(`slot ${slot}: run 空闲 ${mins}min 无事件 判卡死,冒失败 + 取消(防静默 stuck)`);
251
+ const mins = Math.round(idleLimit / 60_000);
252
+ const phase = activeTools.size > 0 ? '工具运行' : 'run';
253
+ this.log(`slot ${slot}: ${phase}空闲 ${mins}min 无事件 → 判卡死,冒失败 + 取消(防静默 stuck)`);
235
254
  // 冒错 + complete(failed)让 chat 收尾成错误回合(而非无限 running);再取消挂死的底层 run,腾出 slot。
236
255
  this.send(socket, { event: 'error', error: `run 卡死:${mins} 分钟无任何输出(可能限额/网络/挂死),已判失败,请重试` });
237
256
  this.send(socket, { event: 'complete', stopReason: 'failed' });
@@ -1 +1 @@
1
- {"version":3,"file":"sessionDaemon.js","sourceRoot":"","sources":["../../src/daemon/sessionDaemon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,E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,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,kBAAkB,CAAC,CAAC;AAClE,IAAI,WAAW,EAAE,CAAC;IAChB,MAAM,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;IACnC,MAAM,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QAC3B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC7F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coralai/sps-cli",
3
- "version": "0.65.23",
3
+ "version": "0.65.24",
4
4
  "description": "SPS CLI — AI-driven development pipeline orchestrator",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",