@pipelex/mthds-ui 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@ Error generating stack: `+o.message+`
14
14
  `)),c=u.reduce((d,f)=>d.concat(...f),[]);return[u,c]}return[[],[]]},[e]);return(0,k.useEffect)(()=>{let s=t?.target??z_,u=t?.actInsideInputWithModifier??!0;if(e!==null){let c=p=>{if(i.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!i.current||i.current&&!u)&&xh(p))return!1;let b=P_(p.code,l);if(a.current.add(p[b]),L_(r,a.current,!1)){let x=p.composedPath?.()?.[0]||p.target,g=x?.nodeName==="BUTTON"||x?.nodeName==="A";t.preventDefault!==!1&&(i.current||!g)&&p.preventDefault(),o(!0)}},d=p=>{let v=P_(p.code,l);L_(r,a.current,!0)?(o(!1),a.current.clear()):a.current.delete(p[v]),p.key==="Meta"&&a.current.clear(),i.current=!1},f=()=>{a.current.clear(),o(!1)};return s?.addEventListener("keydown",c),s?.addEventListener("keyup",d),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{s?.removeEventListener("keydown",c),s?.removeEventListener("keyup",d),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,o]),n}function L_(e,t,n){return e.filter(o=>n||o.length===t.size).some(o=>o.every(i=>t.has(i)))}function P_(e,t){return t.includes(e)?"code":"key"}var XD=()=>{let e=Qe();return(0,k.useMemo)(()=>({zoomIn:t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{let{panZoom:o}=e.getState();return o?o.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[o,i,a],panZoom:r}=e.getState();return r?(await r.setViewport({x:t.x??o,y:t.y??i,zoom:t.zoom??a},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{let[t,n,o]=e.getState().transform;return{x:t,y:n,zoom:o}},setCenter:async(t,n,o)=>e.getState().setCenter(t,n,o),fitBounds:async(t,n)=>{let{width:o,height:i,minZoom:a,maxZoom:r,panZoom:l}=e.getState(),s=Zs(t,o,i,a,r,n?.padding??.1);return l?(await l.setViewport(s,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{let{transform:o,snapGrid:i,snapToGrid:a,domNode:r}=e.getState();if(!r)return t;let{x:l,y:s}=r.getBoundingClientRect(),u={x:t.x-l,y:t.y-s},c=n.snapGrid??i,d=n.snapToGrid??a;return il(u,o,d,c)},flowToScreenPosition:t=>{let{transform:n,domNode:o}=e.getState();if(!o)return t;let{x:i,y:a}=o.getBoundingClientRect(),r=Xs(t,n);return{x:r.x+i,y:r.y+a}}}),[])};function nE(e,t){let n=[],o=new Map,i=[];for(let a of e)if(a.type==="add"){i.push(a);continue}else if(a.type==="remove"||a.type==="replace")o.set(a.id,[a]);else{let r=o.get(a.id);r?r.push(a):o.set(a.id,[a])}for(let a of t){let r=o.get(a.id);if(!r){n.push(a);continue}if(r[0].type==="remove")continue;if(r[0].type==="replace"){n.push({...r[0].item});continue}let l={...a};for(let s of r)qD(s,l);n.push(l)}return i.length&&i.forEach(a=>{a.index!==void 0?n.splice(a.index,0,{...a.item}):n.push({...a.item})}),n}function qD(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 oE(e,t){return nE(e,t)}function iE(e,t){return nE(e,t)}function Pa(e,t){return{id:e,type:"select",selected:t}}function ll(e,t=new Set,n=!1){let o=[];for(let[i,a]of e){let r=t.has(i);!(a.selected===void 0&&!r)&&a.selected!==r&&(n&&(a.selected=r),o.push(Pa(a.id,r)))}return o}function B_({items:e=[],lookup:t}){let n=[],o=new Map(e.map(i=>[i.id,i]));for(let[i,a]of e.entries()){let r=t.get(a.id),l=r?.internals?.userNode??r;l!==void 0&&l!==a&&n.push({id:a.id,item:a,type:"replace"}),l===void 0&&n.push({item:a,type:"add",index:i})}for(let[i]of t)o.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function H_(e){return{id:e.id,type:"remove"}}var k_=e=>Gx(e),ZD=e=>ch(e);function aE(e){return(0,k.forwardRef)(e)}var jD=typeof window<"u"?k.useLayoutEffect:k.useEffect;function G_(e){let[t,n]=(0,k.useState)(BigInt(0)),[o]=(0,k.useState)(()=>$D(()=>n(i=>i+BigInt(1))));return jD(()=>{let i=o.get();i.length&&(e(i),o.reset())},[t]),o}function $D(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var rE=(0,k.createContext)(null);function FD({children:e}){let t=Qe(),n=(0,k.useCallback)(l=>{let{nodes:s=[],setNodes:u,hasDefaultNodes:c,onNodesChange:d,nodeLookup:f,fitViewQueued:p,onNodesChangeMiddlewareMap:v}=t.getState(),b=s;for(let g of l)b=typeof g=="function"?g(b):g;let x=B_({items:b,lookup:f});for(let g of v.values())x=g(x);c&&u(b),x.length>0?d?.(x):p&&window.requestAnimationFrame(()=>{let{fitViewQueued:g,nodes:h,setNodes:m}=t.getState();g&&m(h)})},[]),o=G_(n),i=(0,k.useCallback)(l=>{let{edges:s=[],setEdges:u,hasDefaultEdges:c,onEdgesChange:d,edgeLookup:f}=t.getState(),p=s;for(let v of l)p=typeof v=="function"?v(p):v;c?u(p):d&&d(B_({items:p,lookup:f}))},[]),a=G_(i),r=(0,k.useMemo)(()=>({nodeQueue:o,edgeQueue:a}),[]);return(0,B.jsx)(rE.Provider,{value:r,children:e})}function KD(){let e=(0,k.useContext)(rE);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}var QD=e=>!!e.panZoom;function Ph(){let e=XD(),t=Qe(),n=KD(),o=Ce(QD),i=(0,k.useMemo)(()=>{let a=d=>t.getState().nodeLookup.get(d),r=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},s=d=>{let{nodeLookup:f,nodeOrigin:p}=t.getState(),v=k_(d)?d:f.get(d.id),b=v.parentId?vh(v.position,v.measured,v.parentId,f,p):v.position,x={...v,position:b,width:v.measured?.width??v.width,height:v.measured?.height??v.height};return La(x)},u=(d,f,p={replace:!1})=>{r(v=>v.map(b=>{if(b.id===d){let x=typeof f=="function"?f(b):f;return p.replace&&k_(x)?x:{...b,...x}}return b}))},c=(d,f,p={replace:!1})=>{l(v=>v.map(b=>{if(b.id===d){let x=typeof f=="function"?f(b):f;return p.replace&&ZD(x)?x:{...b,...x}}return b}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>a(d)?.internals.userNode,getInternalNode:a,getEdges:()=>{let{edges:d=[]}=t.getState();return d.map(f=>({...f}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:r,setEdges:l,addNodes:d=>{let f=Array.isArray(d)?d:[d];n.nodeQueue.push(p=>[...p,...f])},addEdges:d=>{let f=Array.isArray(d)?d:[d];n.edgeQueue.push(p=>[...p,...f])},toObject:()=>{let{nodes:d=[],edges:f=[],transform:p}=t.getState(),[v,b,x]=p;return{nodes:d.map(g=>({...g})),edges:f.map(g=>({...g})),viewport:{x:v,y:b,zoom:x}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{let{nodes:p,edges:v,onNodesDelete:b,onEdgesDelete:x,triggerNodeChanges:g,triggerEdgeChanges:h,onDelete:m,onBeforeDelete:y}=t.getState(),{nodes:S,edges:E}=await Vx({nodesToRemove:d,edgesToRemove:f,nodes:p,edges:v,onBeforeDelete:y}),_=E.length>0,w=S.length>0;if(_){let C=E.map(H_);x?.(E),h(C)}if(w){let C=S.map(H_);b?.(S),g(C)}return(w||_)&&m?.({nodes:S,edges:E}),{deletedNodes:S,deletedEdges:E}},getIntersectingNodes:(d,f=!0,p)=>{let v=hh(d),b=v?d:s(d),x=p!==void 0;return b?(p||t.getState().nodes).filter(g=>{let h=t.getState().nodeLookup.get(g.id);if(h&&!v&&(g.id===d.id||!h.internals.positionAbsolute))return!1;let m=La(x?g:h),y=nl(m,b);return f&&y>0||y>=m.width*m.height||y>=b.width*b.height}):[]},isNodeIntersecting:(d,f,p=!0)=>{let b=hh(d)?d:s(d);if(!b)return!1;let x=nl(b,f);return p&&x>0||x>=f.width*f.height||x>=b.width*b.height},updateNode:u,updateNodeData:(d,f,p={replace:!1})=>{u(d,v=>{let b=typeof f=="function"?f(v):f;return p.replace?{...v,data:b}:{...v,data:{...v.data,...b}}},p)},updateEdge:c,updateEdgeData:(d,f,p={replace:!1})=>{c(d,v=>{let b=typeof f=="function"?f(v):f;return p.replace?{...v,data:b}:{...v,data:{...v.data,...b}}},p)},getNodesBounds:d=>{let{nodeLookup:f,nodeOrigin:p}=t.getState();return dh(d,{nodeLookup:f,nodeOrigin:p})},getHandleConnections:({type:d,id:f,nodeId:p})=>Array.from(t.getState().connectionLookup.get(`${p}-${d}${f?`-${f}`:""}`)?.values()??[]),getNodeConnections:({type:d,handleId:f,nodeId:p})=>Array.from(t.getState().connectionLookup.get(`${p}${d?f?`-${d}-${f}`:`-${d}`:""}`)?.values()??[]),fitView:async d=>{let f=t.getState().fitViewResolver??qx();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:f}),n.nodeQueue.push(p=>[...p]),f.promise}}},[]);return(0,k.useMemo)(()=>({...i,...e,viewportInitialized:o}),[o])}var I_=e=>e.selected,WD=typeof window<"u"?window:void 0;function JD({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=Qe(),{deleteElements:o}=Ph(),i=$s(e,{actInsideInputWithModifier:!1}),a=$s(t,{target:WD});(0,k.useEffect)(()=>{if(i){let{edges:r,nodes:l}=n.getState();o({nodes:l.filter(I_),edges:r.filter(I_)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,k.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function eR(e){let t=Qe();(0,k.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let o=Ef(e.current);(o.height===0||o.width===0)&&t.getState().onError?.("004",An.error004()),t.setState({width:o.width||500,height:o.height||500})};if(e.current){n(),window.addEventListener("resize",n);let o=new ResizeObserver(()=>n());return o.observe(e.current),()=>{window.removeEventListener("resize",n),o&&e.current&&o.unobserve(e.current)}}},[])}var Hf={position:"absolute",width:"100%",height:"100%",top:0,left:0},tR=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function nR({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:o=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=ai.Free,zoomOnDoubleClick:r=!0,panOnDrag:l=!0,defaultViewport:s,translateExtent:u,minZoom:c,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:p=!0,children:v,noWheelClassName:b,noPanClassName:x,onViewportChange:g,isControlledViewport:h,paneClickDistance:m,selectionOnDrag:y}){let S=Qe(),E=(0,k.useRef)(null),{userSelectionActive:_,lib:w,connectionInProgress:C}=Ce(tR,je),P=$s(f),M=(0,k.useRef)();eR(E);let z=(0,k.useCallback)(I=>{g?.({x:I[0],y:I[1],zoom:I[2]}),h||S.setState({transform:I})},[g,h]);return(0,k.useEffect)(()=>{if(E.current){M.current=f_({domNode:E.current,minZoom:c,maxZoom:d,translateExtent:u,viewport:s,onDraggingChange:A=>S.setState(R=>R.paneDragging===A?R:{paneDragging:A}),onPanZoomStart:(A,R)=>{let{onViewportChangeStart:O,onMoveStart:L}=S.getState();L?.(A,R),O?.(R)},onPanZoom:(A,R)=>{let{onViewportChange:O,onMove:L}=S.getState();L?.(A,R),O?.(R)},onPanZoomEnd:(A,R)=>{let{onViewportChangeEnd:O,onMoveEnd:L}=S.getState();L?.(A,R),O?.(R)}});let{x:I,y:T,zoom:D}=M.current.getViewport();return S.setState({panZoom:M.current,transform:[I,T,D],domNode:E.current.closest(".react-flow")}),()=>{M.current?.destroy()}}},[]),(0,k.useEffect)(()=>{M.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:o,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:r,panOnDrag:l,zoomActivationKeyPressed:P,preventScrolling:p,noPanClassName:x,userSelectionActive:_,noWheelClassName:b,lib:w,onTransformChange:z,connectionInProgress:C,selectionOnDrag:y,paneClickDistance:m})},[e,t,n,o,i,a,r,l,P,p,x,_,b,w,z,C,y,m]),(0,B.jsx)("div",{className:"react-flow__renderer",ref:E,style:Hf,children:v})}var oR=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function iR(){let{userSelectionActive:e,userSelectionRect:t}=Ce(oR,je);return e&&t?(0,B.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}var Oh=(e,t)=>n=>{n.target===t.current&&e?.(n)},aR=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function rR({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Oa.Full,panOnDrag:o,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:r,onSelectionEnd:l,onPaneClick:s,onPaneContextMenu:u,onPaneScroll:c,onPaneMouseEnter:d,onPaneMouseMove:f,onPaneMouseLeave:p,children:v}){let b=Qe(),{userSelectionActive:x,elementsSelectable:g,dragging:h,connectionInProgress:m}=Ce(aR,je),y=g&&(e||x),S=(0,k.useRef)(null),E=(0,k.useRef)(),_=(0,k.useRef)(new Set),w=(0,k.useRef)(new Set),C=(0,k.useRef)(!1),P=O=>{if(C.current||m){C.current=!1;return}s?.(O),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},M=O=>{if(Array.isArray(o)&&o?.includes(2)){O.preventDefault();return}u?.(O)},z=c?O=>c(O):void 0,I=O=>{C.current&&(O.stopPropagation(),C.current=!1)},T=O=>{let{domNode:L}=b.getState();if(E.current=L?.getBoundingClientRect(),!E.current)return;let Y=O.target===S.current;if(!Y&&!!O.target.closest(".nokey")||!e||!(a&&Y||t)||O.button!==0||!O.isPrimary)return;O.target?.setPointerCapture?.(O.pointerId),C.current=!1;let{x:F,y:K}=jn(O.nativeEvent,E.current);b.setState({userSelectionRect:{width:0,height:0,startX:F,startY:K,x:F,y:K}}),Y||(O.stopPropagation(),O.preventDefault())},D=O=>{let{userSelectionRect:L,transform:Y,nodeLookup:G,edgeLookup:X,connectionLookup:F,triggerNodeChanges:K,triggerEdgeChanges:$,defaultEdgeOptions:le,resetSelectedElements:W}=b.getState();if(!E.current||!L)return;let{x:j,y:te}=jn(O.nativeEvent,E.current),{startX:ge,startY:me}=L;if(!C.current){let _e=t?0:i;if(Math.hypot(j-ge,te-me)<=_e)return;W(),r?.(O)}C.current=!0;let re={startX:ge,startY:me,x:j<ge?j:ge,y:te<me?te:me,width:Math.abs(j-ge),height:Math.abs(te-me)},Q=_.current,xe=w.current;_.current=new Set(Sf(G,re,Y,n===Oa.Partial,!0).map(_e=>_e.id)),w.current=new Set;let Ne=le?.selectable??!0;for(let _e of _.current){let et=F.get(_e);if(et)for(let{edgeId:De}of et.values()){let we=X.get(De);we&&(we.selectable??Ne)&&w.current.add(De)}}if(!bh(Q,_.current)){let _e=ll(G,_.current,!0);K(_e)}if(!bh(xe,w.current)){let _e=ll(X,w.current);$(_e)}b.setState({userSelectionRect:re,userSelectionActive:!0,nodesSelectionActive:!1})},A=O=>{O.button===0&&(O.target?.releasePointerCapture?.(O.pointerId),!x&&O.target===S.current&&b.getState().userSelectionRect&&P?.(O),b.setState({userSelectionActive:!1,userSelectionRect:null}),C.current&&(l?.(O),b.setState({nodesSelectionActive:_.current.size>0})))},R=o===!0||Array.isArray(o)&&o.includes(0);return(0,B.jsxs)("div",{className:rt(["react-flow__pane",{draggable:R,dragging:h,selection:e}]),onClick:y?void 0:Oh(P,S),onContextMenu:Oh(M,S),onWheel:Oh(z,S),onPointerEnter:y?void 0:d,onPointerMove:y?D:f,onPointerUp:y?A:void 0,onPointerDownCapture:y?T:void 0,onClickCapture:y?I:void 0,onPointerLeave:p,ref:S,style:Hf,children:[v,(0,B.jsx)(iR,{})]})}function Lh({id:e,store:t,unselect:n=!1,nodeRef:o}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:r,nodeLookup:l,onError:s}=t.getState(),u=l.get(e);if(!u){s?.("012",An.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&r)&&(a({nodes:[u],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):i([e])}function lE({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:o,nodeId:i,isSelectable:a,nodeClickDistance:r}){let l=Qe(),[s,u]=(0,k.useState)(!1),c=(0,k.useRef)();return(0,k.useEffect)(()=>{c.current=o_({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{Lh({id:d,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),(0,k.useEffect)(()=>{if(!(t||!e.current||!c.current))return c.current.update({noDragClassName:n,handleSelector:o,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:r}),()=>{c.current?.destroy()}},[n,o,t,a,e,i,r]),s}var lR=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function sE(){let e=Qe();return(0,k.useCallback)(n=>{let{nodeExtent:o,snapToGrid:i,snapGrid:a,nodesDraggable:r,onError:l,updateNodePositions:s,nodeLookup:u,nodeOrigin:c}=e.getState(),d=new Map,f=lR(r),p=i?a[0]:5,v=i?a[1]:5,b=n.direction.x*p*n.factor,x=n.direction.y*v*n.factor;for(let[,g]of u){if(!f(g))continue;let h={x:g.internals.positionAbsolute.x+b,y:g.internals.positionAbsolute.y+x};i&&(h=ol(h,a));let{position:m,positionAbsolute:y}=ph({nodeId:g.id,nextPosition:h,nodeLookup:u,nodeExtent:o,nodeOrigin:c,onError:l});g.position=m,g.internals.positionAbsolute=y,d.set(g.id,g)}s(d)},[])}var Bh=(0,k.createContext)(null),sR=Bh.Provider;Bh.Consumer;var uE=()=>(0,k.useContext)(Bh),uR=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),cR=(e,t,n)=>o=>{let{connectionClickStartHandle:i,connectionMode:a,connection:r}=o,{fromHandle:l,toHandle:s,isValid:u}=r,c=s?.nodeId===e&&s?.id===t&&s?.type===n;return{connectingFrom:l?.nodeId===e&&l?.id===t&&l?.type===n,connectingTo:c,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===$i.Strict?l?.type!==n:e!==l?.nodeId||t!==l?.id,connectionInProcess:!!l,clickConnectionInProcess:!!i,valid:c&&u}};function fR({type:e="source",position:t=ne.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:r,onConnect:l,children:s,className:u,onMouseDown:c,onTouchStart:d,...f},p){let v=r||null,b=e==="target",x=Qe(),g=uE(),{connectOnClick:h,noPanClassName:m,rfId:y}=Ce(uR,je),{connectingFrom:S,connectingTo:E,clickConnecting:_,isPossibleEndHandle:w,connectionInProcess:C,clickConnectionInProcess:P,valid:M}=Ce(cR(g,v,e),je);g||x.getState().onError?.("010",An.error010());let z=D=>{let{defaultEdgeOptions:A,onConnect:R,hasDefaultEdges:O}=x.getState(),L={...A,...D};if(O){let{edges:Y,setEdges:G}=x.getState();G(Th(L,Y))}R?.(L),l?.(L)},I=D=>{if(!g)return;let A=_h(D.nativeEvent);if(i&&(A&&D.button===0||!A)){let R=x.getState();Df.onPointerDown(D.nativeEvent,{handleDomNode:D.currentTarget,autoPanOnConnect:R.autoPanOnConnect,connectionMode:R.connectionMode,connectionRadius:R.connectionRadius,domNode:R.domNode,nodeLookup:R.nodeLookup,lib:R.lib,isTarget:b,handleId:v,nodeId:g,flowId:R.rfId,panBy:R.panBy,cancelConnection:R.cancelConnection,onConnectStart:R.onConnectStart,onConnectEnd:(...O)=>x.getState().onConnectEnd?.(...O),updateConnection:R.updateConnection,onConnect:z,isValidConnection:n||((...O)=>x.getState().isValidConnection?.(...O)??!0),getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,autoPanSpeed:R.autoPanSpeed,dragThreshold:R.connectionDragThreshold})}A?c?.(D):d?.(D)},T=D=>{let{onClickConnectStart:A,onClickConnectEnd:R,connectionClickStartHandle:O,connectionMode:L,isValidConnection:Y,lib:G,rfId:X,nodeLookup:F,connection:K}=x.getState();if(!g||!O&&!i)return;if(!O){A?.(D.nativeEvent,{nodeId:g,handleId:v,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:g,type:e,id:v}});return}let $=Sh(D.target),le=n||Y,{connection:W,isValid:j}=Df.isValid(D.nativeEvent,{handle:{nodeId:g,id:v,type:e},connectionMode:L,fromNodeId:O.nodeId,fromHandleId:O.id||null,fromType:O.type,isValidConnection:le,flowId:X,doc:$,lib:G,nodeLookup:F});j&&W&&z(W);let te=structuredClone(K);delete te.inProgress,te.toPosition=te.toHandle?te.toHandle.position:null,R?.(D,te),x.setState({connectionClickStartHandle:null})};return(0,B.jsx)("div",{"data-handleid":v,"data-nodeid":g,"data-handlepos":t,"data-id":`${y}-${g}-${v}-${e}`,className:rt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",m,u,{source:!b,target:b,connectable:o,connectablestart:i,connectableend:a,clickconnecting:_,connectingfrom:S,connectingto:E,valid:M,connectionindicator:o&&(!C||w)&&(C||P?a:i)}]),onMouseDown:I,onTouchStart:I,onClick:h?T:void 0,ref:p,...f,children:s})}var Ba=(0,k.memo)(aE(fR));function dR({data:e,isConnectable:t,sourcePosition:n=ne.Bottom}){return(0,B.jsxs)(B.Fragment,{children:[e?.label,(0,B.jsx)(Ba,{type:"source",position:n,isConnectable:t})]})}function pR({data:e,isConnectable:t,targetPosition:n=ne.Top,sourcePosition:o=ne.Bottom}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Ba,{type:"target",position:n,isConnectable:t}),e?.label,(0,B.jsx)(Ba,{type:"source",position:o,isConnectable:t})]})}function mR(){return null}function hR({data:e,isConnectable:t,targetPosition:n=ne.Top}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Ba,{type:"target",position:n,isConnectable:t}),e?.label]})}var Pf={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},U_={input:dR,default:pR,output:hR,group:mR};function gR(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var yR=e=>{let{width:t,height:n,x:o,y:i}=tl(e.nodeLookup,{filter:a=>!!a.selected});return{width:Zn(t)?t:null,height:Zn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${i}px)`}};function vR({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let o=Qe(),{width:i,height:a,transformString:r,userSelectionActive:l}=Ce(yR,je),s=sE(),u=(0,k.useRef)(null);(0,k.useEffect)(()=>{n||u.current?.focus({preventScroll:!0})},[n]);let c=!l&&i!==null&&a!==null;if(lE({nodeRef:u,disabled:!c}),!c)return null;let d=e?p=>{let v=o.getState().nodes.filter(b=>b.selected);e(p,v)}:void 0,f=p=>{Object.prototype.hasOwnProperty.call(Pf,p.key)&&(p.preventDefault(),s({direction:Pf[p.key],factor:p.shiftKey?4:1}))};return(0,B.jsx)("div",{className:rt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:r},children:(0,B.jsx)("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:f,style:{width:i,height:a}})})}var V_=typeof window<"u"?window:void 0,bR=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function cE({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:r,paneClickDistance:l,deleteKeyCode:s,selectionKeyCode:u,selectionOnDrag:c,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:v,panActivationKeyCode:b,zoomActivationKeyCode:x,elementsSelectable:g,zoomOnScroll:h,zoomOnPinch:m,panOnScroll:y,panOnScrollSpeed:S,panOnScrollMode:E,zoomOnDoubleClick:_,panOnDrag:w,defaultViewport:C,translateExtent:P,minZoom:M,maxZoom:z,preventScrolling:I,onSelectionContextMenu:T,noWheelClassName:D,noPanClassName:A,disableKeyboardA11y:R,onViewportChange:O,isControlledViewport:L}){let{nodesSelectionActive:Y,userSelectionActive:G}=Ce(bR,je),X=$s(u,{target:V_}),F=$s(b,{target:V_}),K=F||w,$=F||y,le=c&&K!==!0,W=X||G||le;return JD({deleteKeyCode:s,multiSelectionKeyCode:v}),(0,B.jsx)(nR,{onPaneContextMenu:a,elementsSelectable:g,zoomOnScroll:h,zoomOnPinch:m,panOnScroll:$,panOnScrollSpeed:S,panOnScrollMode:E,zoomOnDoubleClick:_,panOnDrag:!X&&K,defaultViewport:C,translateExtent:P,minZoom:M,maxZoom:z,zoomActivationKeyCode:x,preventScrolling:I,noWheelClassName:D,noPanClassName:A,onViewportChange:O,isControlledViewport:L,paneClickDistance:l,selectionOnDrag:le,children:(0,B.jsxs)(rR,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:r,panOnDrag:K,isSelecting:!!W,selectionMode:d,selectionKeyPressed:X,paneClickDistance:l,selectionOnDrag:le,children:[e,Y&&(0,B.jsx)(vR,{onSelectionContextMenu:T,noPanClassName:A,disableKeyboardA11y:R})]})})}cE.displayName="FlowRenderer";var SR=(0,k.memo)(cE),xR=e=>t=>e?Sf(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 _R(e){return Ce((0,k.useCallback)(xR(e),[e]),je)}var ER=e=>e.updateNodeInternals;function TR(){let e=Ce(ER),[t]=(0,k.useState)(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{let o=new Map;n.forEach(i=>{let a=i.target.getAttribute("data-id");o.set(a,{id:a,nodeElement:i.target,force:!0})}),e(o)}));return(0,k.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function NR({node:e,nodeType:t,hasDimensions:n,resizeObserver:o}){let i=Qe(),a=(0,k.useRef)(null),r=(0,k.useRef)(null),l=(0,k.useRef)(e.sourcePosition),s=(0,k.useRef)(e.targetPosition),u=(0,k.useRef)(t),c=n&&!!e.internals.handleBounds;return(0,k.useEffect)(()=>{a.current&&!e.hidden&&(!c||r.current!==a.current)&&(r.current&&o?.unobserve(r.current),o?.observe(a.current),r.current=a.current)},[c,e.hidden]),(0,k.useEffect)(()=>()=>{r.current&&(o?.unobserve(r.current),r.current=null)},[]),(0,k.useEffect)(()=>{if(a.current){let d=u.current!==t,f=l.current!==e.sourcePosition,p=s.current!==e.targetPosition;(d||f||p)&&(u.current=t,l.current=e.sourcePosition,s.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function CR({id:e,onClick:t,onMouseEnter:n,onMouseMove:o,onMouseLeave:i,onContextMenu:a,onDoubleClick:r,nodesDraggable:l,elementsSelectable:s,nodesConnectable:u,nodesFocusable:c,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:v,rfId:b,nodeTypes:x,nodeClickDistance:g,onError:h}){let{node:m,internals:y,isParent:S}=Ce(j=>{let te=j.nodeLookup.get(e),ge=j.parentLookup.has(e);return{node:te,internals:te.internals,isParent:ge}},je),E=m.type||"default",_=x?.[E]||U_[E];_===void 0&&(h?.("003",An.error003(E)),E="default",_=x?.default||U_.default);let w=!!(m.draggable||l&&typeof m.draggable>"u"),C=!!(m.selectable||s&&typeof m.selectable>"u"),P=!!(m.connectable||u&&typeof m.connectable>"u"),M=!!(m.focusable||c&&typeof m.focusable>"u"),z=Qe(),I=yh(m),T=NR({node:m,nodeType:E,hasDimensions:I,resizeObserver:d}),D=lE({nodeRef:T,disabled:m.hidden||!w,noDragClassName:f,handleSelector:m.dragHandle,nodeId:e,isSelectable:C,nodeClickDistance:g}),A=sE();if(m.hidden)return null;let R=wo(m),O=gR(m),L=C||w||t||n||o||i,Y=n?j=>n(j,{...y.userNode}):void 0,G=o?j=>o(j,{...y.userNode}):void 0,X=i?j=>i(j,{...y.userNode}):void 0,F=a?j=>a(j,{...y.userNode}):void 0,K=r?j=>r(j,{...y.userNode}):void 0,$=j=>{let{selectNodesOnDrag:te,nodeDragThreshold:ge}=z.getState();C&&(!te||!w||ge>0)&&Lh({id:e,store:z,nodeRef:T}),t&&t(j,{...y.userNode})},le=j=>{if(!(xh(j.nativeEvent)||v)){if(rh.includes(j.key)&&C){let te=j.key==="Escape";Lh({id:e,store:z,unselect:te,nodeRef:T})}else if(w&&m.selected&&Object.prototype.hasOwnProperty.call(Pf,j.key)){j.preventDefault();let{ariaLabelConfig:te}=z.getState();z.setState({ariaLiveMessage:te["node.a11yDescription.ariaLiveMessage"]({direction:j.key.replace("Arrow","").toLowerCase(),x:~~y.positionAbsolute.x,y:~~y.positionAbsolute.y})}),A({direction:Pf[j.key],factor:j.shiftKey?4:1})}}},W=()=>{if(v||!T.current?.matches(":focus-visible"))return;let{transform:j,width:te,height:ge,autoPanOnNodeFocus:me,setCenter:re}=z.getState();if(!me)return;Sf(new Map([[e,m]]),{x:0,y:0,width:te,height:ge},j,!0).length>0||re(m.position.x+R.width/2,m.position.y+R.height/2,{zoom:j[2]})};return(0,B.jsx)("div",{className:rt(["react-flow__node",`react-flow__node-${E}`,{[p]:w},m.className,{selected:m.selected,selectable:C,parent:S,draggable:w,dragging:D}]),ref:T,style:{zIndex:y.z,transform:`translate(${y.positionAbsolute.x}px,${y.positionAbsolute.y}px)`,pointerEvents:L?"all":"none",visibility:I?"visible":"hidden",...m.style,...O},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:Y,onMouseMove:G,onMouseLeave:X,onContextMenu:F,onClick:$,onDoubleClick:K,onKeyDown:M?le:void 0,tabIndex:M?0:void 0,onFocus:M?W:void 0,role:m.ariaRole??(M?"group":void 0),"aria-roledescription":"node","aria-describedby":v?void 0:`${J_}-${b}`,"aria-label":m.ariaLabel,...m.domAttributes,children:(0,B.jsx)(sR,{value:e,children:(0,B.jsx)(_,{id:e,data:m.data,type:E,positionAbsoluteX:y.positionAbsolute.x,positionAbsoluteY:y.positionAbsolute.y,selected:m.selected??!1,selectable:C,draggable:w,deletable:m.deletable??!0,isConnectable:P,sourcePosition:m.sourcePosition,targetPosition:m.targetPosition,dragging:D,dragHandle:m.dragHandle,zIndex:y.z,parentId:m.parentId,...R})})})}var wR=(0,k.memo)(CR),AR=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function fE(e){let{nodesDraggable:t,nodesConnectable:n,nodesFocusable:o,elementsSelectable:i,onError:a}=Ce(AR,je),r=_R(e.onlyRenderVisibleElements),l=TR();return(0,B.jsx)("div",{className:"react-flow__nodes",style:Hf,children:r.map(s=>(0,B.jsx)(wR,{id:s,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:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:o,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},s))})}fE.displayName="NodeRenderer";var MR=(0,k.memo)(fE);function DR(e){return Ce((0,k.useCallback)(n=>{if(!e)return n.edges.map(i=>i.id);let o=[];if(n.width&&n.height)for(let i of n.edges){let a=n.nodeLookup.get(i.source),r=n.nodeLookup.get(i.target);a&&r&&$x({sourceNode:a,targetNode:r,width:n.width,height:n.height,transform:n.transform})&&o.push(i.id)}return o},[e]),je)}var RR=({color:e="none",strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return(0,B.jsx)("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},OR=({color:e="none",strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,B.jsx)("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Y_={[Qr.Arrow]:RR,[Qr.ArrowClosed]:OR};function zR(e){let t=Qe();return(0,k.useMemo)(()=>Object.prototype.hasOwnProperty.call(Y_,e)?Y_[e]:(t.getState().onError?.("009",An.error009(e)),null),[e])}var LR=({id:e,type:t,color:n,width:o=12.5,height:i=12.5,markerUnits:a="strokeWidth",strokeWidth:r,orient:l="auto-start-reverse"})=>{let s=zR(t);return s?(0,B.jsx)("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:l,refX:"0",refY:"0",children:(0,B.jsx)(s,{color:n,strokeWidth:r})}):null},dE=({defaultColor:e,rfId:t})=>{let n=Ce(a=>a.edges),o=Ce(a=>a.defaultEdgeOptions),i=(0,k.useMemo)(()=>Kx(n,{id:t,defaultColor:e,defaultMarkerStart:o?.markerStart,defaultMarkerEnd:o?.markerEnd}),[n,o,t,e]);return i.length?(0,B.jsx)("svg",{className:"react-flow__marker","aria-hidden":"true",children:(0,B.jsx)("defs",{children:i.map(a=>(0,B.jsx)(LR,{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};dE.displayName="MarkerDefinitions";var PR=(0,k.memo)(dE);function pE({x:e,y:t,label:n,labelStyle:o,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:r=[2,4],labelBgBorderRadius:l=2,children:s,className:u,...c}){let[d,f]=(0,k.useState)({x:1,y:0,width:0,height:0}),p=rt(["react-flow__edge-textwrapper",u]),v=(0,k.useRef)(null);return(0,k.useEffect)(()=>{if(v.current){let b=v.current.getBBox();f({x:b.x,y:b.y,width:b.width,height:b.height})}},[n]),n?(0,B.jsxs)("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?"visible":"hidden",...c,children:[i&&(0,B.jsx)("rect",{width:d.width+2*r[0],x:-r[0],y:-r[1],height:d.height+2*r[1],className:"react-flow__edge-textbg",style:a,rx:l,ry:l}),(0,B.jsx)("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:v,style:o,children:n}),s]}):null}pE.displayName="EdgeText";var BR=(0,k.memo)(pE);function kf({path:e,labelX:t,labelY:n,label:o,labelStyle:i,labelShowBg:a,labelBgStyle:r,labelBgPadding:l,labelBgBorderRadius:s,interactionWidth:u=20,...c}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("path",{...c,d:e,fill:"none",className:rt(["react-flow__edge-path",c.className])}),u?(0,B.jsx)("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,o&&Zn(t)&&Zn(n)?(0,B.jsx)(BR,{x:t,y:n,label:o,labelStyle:i,labelShowBg:a,labelBgStyle:r,labelBgPadding:l,labelBgBorderRadius:s}):null]})}function X_({pos:e,x1:t,y1:n,x2:o,y2:i}){return e===ne.Left||e===ne.Right?[.5*(t+o),n]:[t,.5*(n+i)]}function mE({sourceX:e,sourceY:t,sourcePosition:n=ne.Bottom,targetX:o,targetY:i,targetPosition:a=ne.Top}){let[r,l]=X_({pos:n,x1:e,y1:t,x2:o,y2:i}),[s,u]=X_({pos:a,x1:o,y1:i,x2:e,y2:t}),[c,d,f,p]=Tf({sourceX:e,sourceY:t,targetX:o,targetY:i,sourceControlX:r,sourceControlY:l,targetControlX:s,targetControlY:u});return[`M${e},${t} C${r},${l} ${s},${u} ${o},${i}`,c,d,f,p]}function hE(e){return(0,k.memo)(({id:t,sourceX:n,sourceY:o,targetX:i,targetY:a,sourcePosition:r,targetPosition:l,label:s,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:v,markerEnd:b,markerStart:x,interactionWidth:g})=>{let[h,m,y]=mE({sourceX:n,sourceY:o,sourcePosition:r,targetX:i,targetY:a,targetPosition:l}),S=e.isInternal?void 0:t;return(0,B.jsx)(kf,{id:S,path:h,labelX:m,labelY:y,label:s,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:v,markerEnd:b,markerStart:x,interactionWidth:g})})}var HR=hE({isInternal:!1}),gE=hE({isInternal:!0});HR.displayName="SimpleBezierEdge";gE.displayName="SimpleBezierEdgeInternal";function yE(e){return(0,k.memo)(({id:t,sourceX:n,sourceY:o,targetX:i,targetY:a,label:r,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,sourcePosition:p=ne.Bottom,targetPosition:v=ne.Top,markerEnd:b,markerStart:x,pathOptions:g,interactionWidth:h})=>{let[m,y,S]=js({sourceX:n,sourceY:o,sourcePosition:p,targetX:i,targetY:a,targetPosition:v,borderRadius:g?.borderRadius,offset:g?.offset,stepPosition:g?.stepPosition}),E=e.isInternal?void 0:t;return(0,B.jsx)(kf,{id:E,path:m,labelX:y,labelY:S,label:r,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:b,markerStart:x,interactionWidth:h})})}var vE=yE({isInternal:!1}),bE=yE({isInternal:!0});vE.displayName="SmoothStepEdge";bE.displayName="SmoothStepEdgeInternal";function SE(e){return(0,k.memo)(({id:t,...n})=>{let o=e.isInternal?void 0:t;return(0,B.jsx)(vE,{...n,id:o,pathOptions:(0,k.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var kR=SE({isInternal:!1}),xE=SE({isInternal:!0});kR.displayName="StepEdge";xE.displayName="StepEdgeInternal";function _E(e){return(0,k.memo)(({id:t,sourceX:n,sourceY:o,targetX:i,targetY:a,label:r,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:v,interactionWidth:b})=>{let[x,g,h]=Cf({sourceX:n,sourceY:o,targetX:i,targetY:a}),m=e.isInternal?void 0:t;return(0,B.jsx)(kf,{id:m,path:x,labelX:g,labelY:h,label:r,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:v,interactionWidth:b})})}var GR=_E({isInternal:!1}),EE=_E({isInternal:!0});GR.displayName="StraightEdge";EE.displayName="StraightEdgeInternal";function TE(e){return(0,k.memo)(({id:t,sourceX:n,sourceY:o,targetX:i,targetY:a,sourcePosition:r=ne.Bottom,targetPosition:l=ne.Top,label:s,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:v,markerEnd:b,markerStart:x,pathOptions:g,interactionWidth:h})=>{let[m,y,S]=Nf({sourceX:n,sourceY:o,sourcePosition:r,targetX:i,targetY:a,targetPosition:l,curvature:g?.curvature}),E=e.isInternal?void 0:t;return(0,B.jsx)(kf,{id:E,path:m,labelX:y,labelY:S,label:s,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:v,markerEnd:b,markerStart:x,interactionWidth:h})})}var IR=TE({isInternal:!1}),NE=TE({isInternal:!0});IR.displayName="BezierEdge";NE.displayName="BezierEdgeInternal";var q_={default:NE,straight:EE,step:xE,smoothstep:bE,simplebezier:gE},Z_={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},UR=(e,t,n)=>n===ne.Left?e-t:n===ne.Right?e+t:e,VR=(e,t,n)=>n===ne.Top?e-t:n===ne.Bottom?e+t:e,j_="react-flow__edgeupdater";function $_({position:e,centerX:t,centerY:n,radius:o=10,onMouseDown:i,onMouseEnter:a,onMouseOut:r,type:l}){return(0,B.jsx)("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:r,className:rt([j_,`${j_}-${l}`]),cx:UR(t,o,e),cy:VR(n,o,e),r:o,stroke:"transparent",fill:"transparent"})}function YR({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:o,sourceY:i,targetX:a,targetY:r,sourcePosition:l,targetPosition:s,onReconnect:u,onReconnectStart:c,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let v=Qe(),b=(y,S)=>{if(y.button!==0)return;let{autoPanOnConnect:E,domNode:_,connectionMode:w,connectionRadius:C,lib:P,onConnectStart:M,cancelConnection:z,nodeLookup:I,rfId:T,panBy:D,updateConnection:A}=v.getState(),R=S.type==="target",O=(G,X)=>{f(!1),d?.(G,n,S.type,X)},L=G=>u?.(n,G),Y=(G,X)=>{f(!0),c?.(y,n,S.type),M?.(G,X)};Df.onPointerDown(y.nativeEvent,{autoPanOnConnect:E,connectionMode:w,connectionRadius:C,domNode:_,handleId:S.id,nodeId:S.nodeId,nodeLookup:I,isTarget:R,edgeUpdaterType:S.type,lib:P,flowId:T,cancelConnection:z,panBy:D,isValidConnection:(...G)=>v.getState().isValidConnection?.(...G)??!0,onConnect:L,onConnectStart:Y,onConnectEnd:(...G)=>v.getState().onConnectEnd?.(...G),onReconnectEnd:O,updateConnection:A,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,dragThreshold:v.getState().connectionDragThreshold,handleDomNode:y.currentTarget})},x=y=>b(y,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=y=>b(y,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),h=()=>p(!0),m=()=>p(!1);return(0,B.jsxs)(B.Fragment,{children:[(e===!0||e==="source")&&(0,B.jsx)($_,{position:l,centerX:o,centerY:i,radius:t,onMouseDown:x,onMouseEnter:h,onMouseOut:m,type:"source"}),(e===!0||e==="target")&&(0,B.jsx)($_,{position:s,centerX:a,centerY:r,radius:t,onMouseDown:g,onMouseEnter:h,onMouseOut:m,type:"target"})]})}function XR({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:o,onClick:i,onDoubleClick:a,onContextMenu:r,onMouseEnter:l,onMouseMove:s,onMouseLeave:u,reconnectRadius:c,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:v,edgeTypes:b,noPanClassName:x,onError:g,disableKeyboardA11y:h}){let m=Ce(re=>re.edgeLookup.get(e)),y=Ce(re=>re.defaultEdgeOptions);m=y?{...y,...m}:m;let S=m.type||"default",E=b?.[S]||q_[S];E===void 0&&(g?.("011",An.error011(S)),S="default",E=b?.default||q_.default);let _=!!(m.focusable||t&&typeof m.focusable>"u"),w=typeof d<"u"&&(m.reconnectable||n&&typeof m.reconnectable>"u"),C=!!(m.selectable||o&&typeof m.selectable>"u"),P=(0,k.useRef)(null),[M,z]=(0,k.useState)(!1),[I,T]=(0,k.useState)(!1),D=Qe(),{zIndex:A,sourceX:R,sourceY:O,targetX:L,targetY:Y,sourcePosition:G,targetPosition:X}=Ce((0,k.useCallback)(re=>{let Q=re.nodeLookup.get(m.source),xe=re.nodeLookup.get(m.target);if(!Q||!xe)return{zIndex:m.zIndex,...Z_};let Ne=Fx({id:e,sourceNode:Q,targetNode:xe,sourceHandle:m.sourceHandle||null,targetHandle:m.targetHandle||null,connectionMode:re.connectionMode,onError:g});return{zIndex:jx({selected:m.selected,zIndex:m.zIndex,sourceNode:Q,targetNode:xe,elevateOnSelect:re.elevateEdgesOnSelect,zIndexMode:re.zIndexMode}),...Ne||Z_}},[m.source,m.target,m.sourceHandle,m.targetHandle,m.selected,m.zIndex]),je),F=(0,k.useMemo)(()=>m.markerStart?`url('#${wf(m.markerStart,v)}')`:void 0,[m.markerStart,v]),K=(0,k.useMemo)(()=>m.markerEnd?`url('#${wf(m.markerEnd,v)}')`:void 0,[m.markerEnd,v]);if(m.hidden||R===null||O===null||L===null||Y===null)return null;let $=re=>{let{addSelectedEdges:Q,unselectNodesAndEdges:xe,multiSelectionActive:Ne}=D.getState();C&&(D.setState({nodesSelectionActive:!1}),m.selected&&Ne?(xe({nodes:[],edges:[m]}),P.current?.blur()):Q([e])),i&&i(re,m)},le=a?re=>{a(re,{...m})}:void 0,W=r?re=>{r(re,{...m})}:void 0,j=l?re=>{l(re,{...m})}:void 0,te=s?re=>{s(re,{...m})}:void 0,ge=u?re=>{u(re,{...m})}:void 0,me=re=>{if(!h&&rh.includes(re.key)&&C){let{unselectNodesAndEdges:Q,addSelectedEdges:xe}=D.getState();re.key==="Escape"?(P.current?.blur(),Q({edges:[m]})):xe([e])}};return(0,B.jsx)("svg",{style:{zIndex:A},children:(0,B.jsxs)("g",{className:rt(["react-flow__edge",`react-flow__edge-${S}`,m.className,x,{selected:m.selected,animated:m.animated,inactive:!C&&!i,updating:M,selectable:C}]),onClick:$,onDoubleClick:le,onContextMenu:W,onMouseEnter:j,onMouseMove:te,onMouseLeave:ge,onKeyDown:_?me:void 0,tabIndex:_?0:void 0,role:m.ariaRole??(_?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":m.ariaLabel===null?void 0:m.ariaLabel||`Edge from ${m.source} to ${m.target}`,"aria-describedby":_?`${eE}-${v}`:void 0,ref:P,...m.domAttributes,children:[!I&&(0,B.jsx)(E,{id:e,source:m.source,target:m.target,type:m.type,selected:m.selected,animated:m.animated,selectable:C,deletable:m.deletable??!0,label:m.label,labelStyle:m.labelStyle,labelShowBg:m.labelShowBg,labelBgStyle:m.labelBgStyle,labelBgPadding:m.labelBgPadding,labelBgBorderRadius:m.labelBgBorderRadius,sourceX:R,sourceY:O,targetX:L,targetY:Y,sourcePosition:G,targetPosition:X,data:m.data,style:m.style,sourceHandleId:m.sourceHandle,targetHandleId:m.targetHandle,markerStart:F,markerEnd:K,pathOptions:"pathOptions"in m?m.pathOptions:void 0,interactionWidth:m.interactionWidth}),w&&(0,B.jsx)(YR,{edge:m,isReconnectable:w,reconnectRadius:c,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:R,sourceY:O,targetX:L,targetY:Y,sourcePosition:G,targetPosition:X,setUpdateHover:z,setReconnecting:T})]})})}var qR=(0,k.memo)(XR),ZR=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function CE({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:o,noPanClassName:i,onReconnect:a,onEdgeContextMenu:r,onEdgeMouseEnter:l,onEdgeMouseMove:s,onEdgeMouseLeave:u,onEdgeClick:c,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:v,disableKeyboardA11y:b}){let{edgesFocusable:x,edgesReconnectable:g,elementsSelectable:h,onError:m}=Ce(ZR,je),y=DR(t);return(0,B.jsxs)("div",{className:"react-flow__edges",children:[(0,B.jsx)(PR,{defaultColor:e,rfId:n}),y.map(S=>(0,B.jsx)(qR,{id:S,edgesFocusable:x,edgesReconnectable:g,elementsSelectable:h,noPanClassName:i,onReconnect:a,onContextMenu:r,onMouseEnter:l,onMouseMove:s,onMouseLeave:u,onClick:c,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:v,rfId:n,onError:m,edgeTypes:o,disableKeyboardA11y:b},S))]})}CE.displayName="EdgeRenderer";var jR=(0,k.memo)(CE),$R=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function FR({children:e}){let t=Ce($R);return(0,B.jsx)("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function KR(e){let t=Ph(),n=(0,k.useRef)(!1);(0,k.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var QR=e=>e.panZoom?.syncViewport;function WR(e){let t=Ce(QR),n=Qe();return(0,k.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function F_(e){return e.connection.inProgress?{...e.connection,to:il(e.connection.to,e.transform)}:{...e.connection}}function JR(e){return e?n=>{let o=F_(n);return e(o)}:F_}function eO(e){let t=JR(e);return Ce(t,je)}var tO=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function nO({containerStyle:e,style:t,type:n,component:o}){let{nodesConnectable:i,width:a,height:r,isValid:l,inProgress:s}=Ce(tO,je);return!(a&&i&&s)?null:(0,B.jsx)("svg",{style:e,width:a,height:r,className:"react-flow__connectionline react-flow__container",children:(0,B.jsx)("g",{className:rt(["react-flow__connection",uh(l)]),children:(0,B.jsx)(wE,{style:t,type:n,CustomComponent:o,isValid:l})})})}var wE=({style:e,type:t=Co.Bezier,CustomComponent:n,isValid:o})=>{let{inProgress:i,from:a,fromNode:r,fromHandle:l,fromPosition:s,to:u,toNode:c,toHandle:d,toPosition:f,pointer:p}=eO();if(!i)return;if(n)return(0,B.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:r,fromHandle:l,fromX:a.x,fromY:a.y,toX:u.x,toY:u.y,fromPosition:s,toPosition:f,connectionStatus:uh(o),toNode:c,toHandle:d,pointer:p});let v="",b={sourceX:a.x,sourceY:a.y,sourcePosition:s,targetX:u.x,targetY:u.y,targetPosition:f};switch(t){case Co.Bezier:[v]=Nf(b);break;case Co.SimpleBezier:[v]=mE(b);break;case Co.Step:[v]=js({...b,borderRadius:0});break;case Co.SmoothStep:[v]=js(b);break;default:[v]=Cf(b)}return(0,B.jsx)("path",{d:v,fill:"none",className:"react-flow__connection-path",style:e})};wE.displayName="ConnectionLine";var oO={};function K_(e=oO){let t=(0,k.useRef)(e),n=Qe();(0,k.useEffect)(()=>{},[e])}function iO(){let e=Qe(),t=(0,k.useRef)(!1);(0,k.useEffect)(()=>{},[])}function AE({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:o,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:r,onNodeMouseEnter:l,onNodeMouseMove:s,onNodeMouseLeave:u,onNodeContextMenu:c,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:v,connectionLineStyle:b,connectionLineComponent:x,connectionLineContainerStyle:g,selectionKeyCode:h,selectionOnDrag:m,selectionMode:y,multiSelectionKeyCode:S,panActivationKeyCode:E,zoomActivationKeyCode:_,deleteKeyCode:w,onlyRenderVisibleElements:C,elementsSelectable:P,defaultViewport:M,translateExtent:z,minZoom:I,maxZoom:T,preventScrolling:D,defaultMarkerColor:A,zoomOnScroll:R,zoomOnPinch:O,panOnScroll:L,panOnScrollSpeed:Y,panOnScrollMode:G,zoomOnDoubleClick:X,panOnDrag:F,onPaneClick:K,onPaneMouseEnter:$,onPaneMouseMove:le,onPaneMouseLeave:W,onPaneScroll:j,onPaneContextMenu:te,paneClickDistance:ge,nodeClickDistance:me,onEdgeContextMenu:re,onEdgeMouseEnter:Q,onEdgeMouseMove:xe,onEdgeMouseLeave:Ne,reconnectRadius:_e,onReconnect:et,onReconnectStart:De,onReconnectEnd:we,noDragClassName:tt,noWheelClassName:Pe,noPanClassName:pn,disableKeyboardA11y:lo,nodeExtent:On,rfId:nt,viewport:_t,onViewportChange:We}){return K_(e),K_(t),iO(),KR(n),WR(_t),(0,B.jsx)(SR,{onPaneClick:K,onPaneMouseEnter:$,onPaneMouseMove:le,onPaneMouseLeave:W,onPaneContextMenu:te,onPaneScroll:j,paneClickDistance:ge,deleteKeyCode:w,selectionKeyCode:h,selectionOnDrag:m,selectionMode:y,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:S,panActivationKeyCode:E,zoomActivationKeyCode:_,elementsSelectable:P,zoomOnScroll:R,zoomOnPinch:O,zoomOnDoubleClick:X,panOnScroll:L,panOnScrollSpeed:Y,panOnScrollMode:G,panOnDrag:F,defaultViewport:M,translateExtent:z,minZoom:I,maxZoom:T,onSelectionContextMenu:d,preventScrolling:D,noDragClassName:tt,noWheelClassName:Pe,noPanClassName:pn,disableKeyboardA11y:lo,onViewportChange:We,isControlledViewport:!!_t,children:(0,B.jsxs)(FR,{children:[(0,B.jsx)(jR,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:r,onReconnect:et,onReconnectStart:De,onReconnectEnd:we,onlyRenderVisibleElements:C,onEdgeContextMenu:re,onEdgeMouseEnter:Q,onEdgeMouseMove:xe,onEdgeMouseLeave:Ne,reconnectRadius:_e,defaultMarkerColor:A,noPanClassName:pn,disableKeyboardA11y:lo,rfId:nt}),(0,B.jsx)(nO,{style:b,type:v,component:x,containerStyle:g}),(0,B.jsx)("div",{className:"react-flow__edgelabel-renderer"}),(0,B.jsx)(MR,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:s,onNodeMouseLeave:u,onNodeContextMenu:c,nodeClickDistance:me,onlyRenderVisibleElements:C,noPanClassName:pn,noDragClassName:tt,disableKeyboardA11y:lo,nodeExtent:On,rfId:nt}),(0,B.jsx)("div",{className:"react-flow__viewport-portal"})]})})}AE.displayName="GraphView";var aO=(0,k.memo)(AE),Q_=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:i,height:a,fitView:r,fitViewOptions:l,minZoom:s=.5,maxZoom:u=2,nodeOrigin:c,nodeExtent:d,zIndexMode:f="basic"}={})=>{let p=new Map,v=new Map,b=new Map,x=new Map,g=o??t??[],h=n??e??[],m=c??[0,0],y=d??el;Mh(b,x,g);let S=Af(h,p,v,{nodeOrigin:m,nodeExtent:y,zIndexMode:f}),E=[0,0,1];if(r&&i&&a){let _=tl(p,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:w,y:C,zoom:P}=Zs(_,i,a,s,u,l?.padding??.1);E=[w,C,P]}return{rfId:"1",width:i??0,height:a??0,transform:E,nodes:h,nodesInitialized:S,nodeLookup:p,parentLookup:v,edges:g,edgeLookup:x,connectionLookup:b,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:s,maxZoom:u,translateExtent:el,nodeExtent:y,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:$i.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:m,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:r??!1,fitViewOptions:l,fitViewResolver:null,connection:{...sh},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:gh,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:lh,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},rO=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:i,height:a,fitView:r,fitViewOptions:l,minZoom:s,maxZoom:u,nodeOrigin:c,nodeExtent:d,zIndexMode:f})=>A_((p,v)=>{async function b(){let{nodeLookup:x,panZoom:g,fitViewOptions:h,fitViewResolver:m,width:y,height:S,minZoom:E,maxZoom:_}=v();g&&(await Ux({nodes:x,width:y,height:S,panZoom:g,minZoom:E,maxZoom:_},h),m?.resolve(!0),p({fitViewResolver:null}))}return{...Q_({nodes:e,edges:t,width:i,height:a,fitView:r,fitViewOptions:l,minZoom:s,maxZoom:u,nodeOrigin:c,nodeExtent:d,defaultNodes:n,defaultEdges:o,zIndexMode:f}),setNodes:x=>{let{nodeLookup:g,parentLookup:h,nodeOrigin:m,elevateNodesOnSelect:y,fitViewQueued:S,zIndexMode:E}=v(),_=Af(x,g,h,{nodeOrigin:m,nodeExtent:d,elevateNodesOnSelect:y,checkEquality:!0,zIndexMode:E});S&&_?(b(),p({nodes:x,nodesInitialized:_,fitViewQueued:!1,fitViewOptions:void 0})):p({nodes:x,nodesInitialized:_})},setEdges:x=>{let{connectionLookup:g,edgeLookup:h}=v();Mh(g,h,x),p({edges:x})},setDefaultNodesAndEdges:(x,g)=>{if(x){let{setNodes:h}=v();h(x),p({hasDefaultNodes:!0})}if(g){let{setEdges:h}=v();h(g),p({hasDefaultEdges:!0})}},updateNodeInternals:x=>{let{triggerNodeChanges:g,nodeLookup:h,parentLookup:m,domNode:y,nodeOrigin:S,nodeExtent:E,debug:_,fitViewQueued:w,zIndexMode:C}=v(),{changes:P,updatedInternals:M}=e_(x,h,m,y,S,E,C);M&&(Wx(h,m,{nodeOrigin:S,nodeExtent:E,zIndexMode:C}),w?(b(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),P?.length>0&&(_&&console.log("React Flow: trigger node changes",P),g?.(P)))},updateNodePositions:(x,g=!1)=>{let h=[],m=[],{nodeLookup:y,triggerNodeChanges:S,connection:E,updateConnection:_,onNodesChangeMiddlewareMap:w}=v();for(let[C,P]of x){let M=y.get(C),z=!!(M?.expandParent&&M?.parentId&&P?.position),I={id:C,type:"position",position:z?{x:Math.max(0,P.position.x),y:Math.max(0,P.position.y)}:P.position,dragging:g};if(M&&E.inProgress&&E.fromNode.id===M.id){let T=Fi(M,E.fromHandle,ne.Left,!0);_({...E,from:T})}z&&M.parentId&&h.push({id:C,parentId:M.parentId,rect:{...P.internals.positionAbsolute,width:P.measured.width??0,height:P.measured.height??0}}),m.push(I)}if(h.length>0){let{parentLookup:C,nodeOrigin:P}=v(),M=Mf(h,y,C,P);m.push(...M)}for(let C of w.values())m=C(m);S(m)},triggerNodeChanges:x=>{let{onNodesChange:g,setNodes:h,nodes:m,hasDefaultNodes:y,debug:S}=v();if(x?.length){if(y){let E=oE(x,m);h(E)}S&&console.log("React Flow: trigger node changes",x),g?.(x)}},triggerEdgeChanges:x=>{let{onEdgesChange:g,setEdges:h,edges:m,hasDefaultEdges:y,debug:S}=v();if(x?.length){if(y){let E=iE(x,m);h(E)}S&&console.log("React Flow: trigger edge changes",x),g?.(x)}},addSelectedNodes:x=>{let{multiSelectionActive:g,edgeLookup:h,nodeLookup:m,triggerNodeChanges:y,triggerEdgeChanges:S}=v();if(g){let E=x.map(_=>Pa(_,!0));y(E);return}y(ll(m,new Set([...x]),!0)),S(ll(h))},addSelectedEdges:x=>{let{multiSelectionActive:g,edgeLookup:h,nodeLookup:m,triggerNodeChanges:y,triggerEdgeChanges:S}=v();if(g){let E=x.map(_=>Pa(_,!0));S(E);return}S(ll(h,new Set([...x]))),y(ll(m,new Set,!0))},unselectNodesAndEdges:({nodes:x,edges:g}={})=>{let{edges:h,nodes:m,nodeLookup:y,triggerNodeChanges:S,triggerEdgeChanges:E}=v(),_=x||m,w=g||h,C=[];for(let M of _){if(!M.selected)continue;let z=y.get(M.id);z&&(z.selected=!1),C.push(Pa(M.id,!1))}let P=[];for(let M of w)M.selected&&P.push(Pa(M.id,!1));S(C),E(P)},setMinZoom:x=>{let{panZoom:g,maxZoom:h}=v();g?.setScaleExtent([x,h]),p({minZoom:x})},setMaxZoom:x=>{let{panZoom:g,minZoom:h}=v();g?.setScaleExtent([h,x]),p({maxZoom:x})},setTranslateExtent:x=>{v().panZoom?.setTranslateExtent(x),p({translateExtent:x})},resetSelectedElements:()=>{let{edges:x,nodes:g,triggerNodeChanges:h,triggerEdgeChanges:m,elementsSelectable:y}=v();if(!y)return;let S=g.reduce((_,w)=>w.selected?[..._,Pa(w.id,!1)]:_,[]),E=x.reduce((_,w)=>w.selected?[..._,Pa(w.id,!1)]:_,[]);h(S),m(E)},setNodeExtent:x=>{let{nodes:g,nodeLookup:h,parentLookup:m,nodeOrigin:y,elevateNodesOnSelect:S,nodeExtent:E,zIndexMode:_}=v();x[0][0]===E[0][0]&&x[0][1]===E[0][1]&&x[1][0]===E[1][0]&&x[1][1]===E[1][1]||(Af(g,h,m,{nodeOrigin:y,nodeExtent:x,elevateNodesOnSelect:S,checkEquality:!1,zIndexMode:_}),p({nodeExtent:x}))},panBy:x=>{let{transform:g,width:h,height:m,panZoom:y,translateExtent:S}=v();return t_({delta:x,panZoom:y,transform:g,translateExtent:S,width:h,height:m})},setCenter:async(x,g,h)=>{let{width:m,height:y,maxZoom:S,panZoom:E}=v();if(!E)return Promise.resolve(!1);let _=typeof h?.zoom<"u"?h.zoom:S;return await E.setViewport({x:m/2-x*_,y:y/2-g*_,zoom:_},{duration:h?.duration,ease:h?.ease,interpolate:h?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{p({connection:{...sh}})},updateConnection:x=>{p({connection:x})},reset:()=>p({...Q_()})}},Object.is);function lO({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:o,initialWidth:i,initialHeight:a,initialMinZoom:r,initialMaxZoom:l,initialFitViewOptions:s,fitView:u,nodeOrigin:c,nodeExtent:d,zIndexMode:f,children:p}){let[v]=(0,k.useState)(()=>rO({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:i,height:a,fitView:u,minZoom:r,maxZoom:l,fitViewOptions:s,nodeOrigin:c,nodeExtent:d,zIndexMode:f}));return(0,B.jsx)(CD,{value:v,children:(0,B.jsx)(FD,{children:p})})}function sO({children:e,nodes:t,edges:n,defaultNodes:o,defaultEdges:i,width:a,height:r,fitView:l,fitViewOptions:s,minZoom:u,maxZoom:c,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return(0,k.useContext)(Bf)?(0,B.jsx)(B.Fragment,{children:e}):(0,B.jsx)(lO,{initialNodes:t,initialEdges:n,defaultNodes:o,defaultEdges:i,initialWidth:a,initialHeight:r,fitView:l,initialFitViewOptions:s,initialMinZoom:u,initialMaxZoom:c,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}var uO={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function cO({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,className:i,nodeTypes:a,edgeTypes:r,onNodeClick:l,onEdgeClick:s,onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:v,onConnectEnd:b,onClickConnectStart:x,onClickConnectEnd:g,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:y,onNodeContextMenu:S,onNodeDoubleClick:E,onNodeDragStart:_,onNodeDrag:w,onNodeDragStop:C,onNodesDelete:P,onEdgesDelete:M,onDelete:z,onSelectionChange:I,onSelectionDragStart:T,onSelectionDrag:D,onSelectionDragStop:A,onSelectionContextMenu:R,onSelectionStart:O,onSelectionEnd:L,onBeforeDelete:Y,connectionMode:G,connectionLineType:X=Co.Bezier,connectionLineStyle:F,connectionLineComponent:K,connectionLineContainerStyle:$,deleteKeyCode:le="Backspace",selectionKeyCode:W="Shift",selectionOnDrag:j=!1,selectionMode:te=Oa.Full,panActivationKeyCode:ge="Space",multiSelectionKeyCode:me=al()?"Meta":"Control",zoomActivationKeyCode:re=al()?"Meta":"Control",snapToGrid:Q,snapGrid:xe,onlyRenderVisibleElements:Ne=!1,selectNodesOnDrag:_e,nodesDraggable:et,autoPanOnNodeFocus:De,nodesConnectable:we,nodesFocusable:tt,nodeOrigin:Pe=tE,edgesFocusable:pn,edgesReconnectable:lo,elementsSelectable:On=!0,defaultViewport:nt=GD,minZoom:_t=.5,maxZoom:We=2,translateExtent:so=el,preventScrolling:Oo=!0,nodeExtent:kt,defaultMarkerColor:zo="#b1b1b7",zoomOnScroll:ui=!0,zoomOnPinch:Kn=!0,panOnScroll:Lo=!1,panOnScrollSpeed:ct=.5,panOnScrollMode:Gt=ai.Free,zoomOnDoubleClick:uo=!0,panOnDrag:mn=!0,onPaneClick:Ya,onPaneMouseEnter:zn,onPaneMouseMove:co,onPaneMouseLeave:Xa,onPaneScroll:fo,onPaneContextMenu:ml,paneClickDistance:qa=1,nodeClickDistance:$e=0,children:Ln,onReconnect:Za,onReconnectStart:Qt,onReconnectEnd:ci,onEdgeContextMenu:Wi,onEdgeDoubleClick:po,onEdgeMouseEnter:hl,onEdgeMouseMove:It,onEdgeMouseLeave:Qn,reconnectRadius:Ji=10,onNodesChange:ja,onEdgesChange:fi,noDragClassName:di="nodrag",noWheelClassName:hn="nowheel",noPanClassName:$a="nopan",fitView:Wn,fitViewOptions:mo,connectOnClick:ue,attributionPosition:ae,proOptions:U,defaultEdgeOptions:N,elevateNodesOnSelect:H=!0,elevateEdgesOnSelect:q=!1,disableKeyboardA11y:ce=!1,autoPanOnConnect:Ve,autoPanOnNodeDrag:Re,autoPanSpeed:gt,connectionRadius:ot,isValidConnection:ho,onError:gl,style:yt,id:yl,nodeDragThreshold:ou,connectionDragThreshold:QT,viewport:WT,onViewportChange:JT,width:eN,height:tN,colorMode:nN="light",debug:oN,onScroll:Tg,ariaLabelConfig:iN,zIndexMode:Ng="basic",...aN},rN){let ed=yl||"1",lN=YD(nN),sN=(0,k.useCallback)(Cg=>{Cg.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Tg?.(Cg)},[Tg]);return(0,B.jsx)("div",{"data-testid":"rf__wrapper",...aN,onScroll:sN,style:{...yt,...uO},ref:rN,className:rt(["react-flow",i,lN]),id:yl,role:"application",children:(0,B.jsxs)(sO,{nodes:e,edges:t,width:eN,height:tN,fitView:Wn,fitViewOptions:mo,minZoom:_t,maxZoom:We,nodeOrigin:Pe,nodeExtent:kt,zIndexMode:Ng,children:[(0,B.jsx)(aO,{onInit:u,onNodeClick:l,onEdgeClick:s,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:y,onNodeContextMenu:S,onNodeDoubleClick:E,nodeTypes:a,edgeTypes:r,connectionLineType:X,connectionLineStyle:F,connectionLineComponent:K,connectionLineContainerStyle:$,selectionKeyCode:W,selectionOnDrag:j,selectionMode:te,deleteKeyCode:le,multiSelectionKeyCode:me,panActivationKeyCode:ge,zoomActivationKeyCode:re,onlyRenderVisibleElements:Ne,defaultViewport:nt,translateExtent:so,minZoom:_t,maxZoom:We,preventScrolling:Oo,zoomOnScroll:ui,zoomOnPinch:Kn,zoomOnDoubleClick:uo,panOnScroll:Lo,panOnScrollSpeed:ct,panOnScrollMode:Gt,panOnDrag:mn,onPaneClick:Ya,onPaneMouseEnter:zn,onPaneMouseMove:co,onPaneMouseLeave:Xa,onPaneScroll:fo,onPaneContextMenu:ml,paneClickDistance:qa,nodeClickDistance:$e,onSelectionContextMenu:R,onSelectionStart:O,onSelectionEnd:L,onReconnect:Za,onReconnectStart:Qt,onReconnectEnd:ci,onEdgeContextMenu:Wi,onEdgeDoubleClick:po,onEdgeMouseEnter:hl,onEdgeMouseMove:It,onEdgeMouseLeave:Qn,reconnectRadius:Ji,defaultMarkerColor:zo,noDragClassName:di,noWheelClassName:hn,noPanClassName:$a,rfId:ed,disableKeyboardA11y:ce,nodeExtent:kt,viewport:WT,onViewportChange:JT}),(0,B.jsx)(VD,{nodes:e,edges:t,defaultNodes:n,defaultEdges:o,onConnect:p,onConnectStart:v,onConnectEnd:b,onClickConnectStart:x,onClickConnectEnd:g,nodesDraggable:et,autoPanOnNodeFocus:De,nodesConnectable:we,nodesFocusable:tt,edgesFocusable:pn,edgesReconnectable:lo,elementsSelectable:On,elevateNodesOnSelect:H,elevateEdgesOnSelect:q,minZoom:_t,maxZoom:We,nodeExtent:kt,onNodesChange:ja,onEdgesChange:fi,snapToGrid:Q,snapGrid:xe,connectionMode:G,translateExtent:so,connectOnClick:ue,defaultEdgeOptions:N,fitView:Wn,fitViewOptions:mo,onNodesDelete:P,onEdgesDelete:M,onDelete:z,onNodeDragStart:_,onNodeDrag:w,onNodeDragStop:C,onSelectionDrag:D,onSelectionDragStart:T,onSelectionDragStop:A,onMove:c,onMoveStart:d,onMoveEnd:f,noPanClassName:$a,nodeOrigin:Pe,rfId:ed,autoPanOnConnect:Ve,autoPanOnNodeDrag:Re,autoPanSpeed:gt,onError:gl,connectionRadius:ot,isValidConnection:ho,selectNodesOnDrag:_e,nodeDragThreshold:ou,connectionDragThreshold:QT,onBeforeDelete:Y,debug:oN,ariaLabelConfig:iN,zIndexMode:Ng}),(0,B.jsx)(kD,{onSelectionChange:I}),Ln,(0,B.jsx)(zD,{proOptions:U,position:ae}),(0,B.jsx)(OD,{rfId:ed,disableKeyboardA11y:ce})]})})}var ME=aE(cO);function DE(e){let[t,n]=(0,k.useState)(e),o=(0,k.useCallback)(i=>n(a=>oE(i,a)),[]);return[t,n,o]}function RE(e){let[t,n]=(0,k.useState)(e),o=(0,k.useCallback)(i=>n(a=>iE(i,a)),[]);return[t,n,o]}var wH=An.error014();function fO({dimensions:e,lineWidth:t,variant:n,className:o}){return(0,B.jsx)("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:rt(["react-flow__background-pattern",n,o])})}function dO({radius:e,className:t}){return(0,B.jsx)("circle",{cx:e,cy:e,r:e,className:rt(["react-flow__background-pattern","dots",t])})}var Ao;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ao||(Ao={}));var pO={[Ao.Dots]:1,[Ao.Lines]:1,[Ao.Cross]:6},mO=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function OE({id:e,variant:t=Ao.Dots,gap:n=20,size:o,lineWidth:i=1,offset:a=0,color:r,bgColor:l,style:s,className:u,patternClassName:c}){let d=(0,k.useRef)(null),{transform:f,patternId:p}=Ce(mO,je),v=o||pO[t],b=t===Ao.Dots,x=t===Ao.Cross,g=Array.isArray(n)?n:[n,n],h=[g[0]*f[2]||1,g[1]*f[2]||1],m=v*f[2],y=Array.isArray(a)?a:[a,a],S=x?[m,m]:h,E=[y[0]*f[2]||1+S[0]/2,y[1]*f[2]||1+S[1]/2],_=`${p}${e||""}`;return(0,B.jsxs)("svg",{className:rt(["react-flow__background",u]),style:{...s,...Hf,"--xy-background-color-props":l,"--xy-background-pattern-color-props":r},ref:d,"data-testid":"rf__background",children:[(0,B.jsx)("pattern",{id:_,x:f[0]%h[0],y:f[1]%h[1],width:h[0],height:h[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:b?(0,B.jsx)(dO,{radius:m/2,className:c}):(0,B.jsx)(fO,{dimensions:S,lineWidth:i,variant:t,className:c})}),(0,B.jsx)("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${_})`})]})}OE.displayName="Background";var zE=(0,k.memo)(OE);function hO(){return(0,B.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:(0,B.jsx)("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function gO(){return(0,B.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:(0,B.jsx)("path",{d:"M0 0h32v4.2H0z"})})}function yO(){return(0,B.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:(0,B.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 vO(){return(0,B.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,B.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 bO(){return(0,B.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,B.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 Lf({children:e,className:t,...n}){return(0,B.jsx)("button",{type:"button",className:rt(["react-flow__controls-button",t]),...n,children:e})}var SO=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function LE({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:r,onFitView:l,onInteractiveChange:s,className:u,children:c,position:d="bottom-left",orientation:f="vertical","aria-label":p}){let v=Qe(),{isInteractive:b,minZoomReached:x,maxZoomReached:g,ariaLabelConfig:h}=Ce(SO,je),{zoomIn:m,zoomOut:y,fitView:S}=Ph(),E=()=>{m(),a?.()},_=()=>{y(),r?.()},w=()=>{S(i),l?.()},C=()=>{v.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),s?.(!b)};return(0,B.jsxs)(sl,{className:rt(["react-flow__controls",f==="horizontal"?"horizontal":"vertical",u]),position:d,style:e,"data-testid":"rf__controls","aria-label":p??h["controls.ariaLabel"],children:[t&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Lf,{onClick:E,className:"react-flow__controls-zoomin",title:h["controls.zoomIn.ariaLabel"],"aria-label":h["controls.zoomIn.ariaLabel"],disabled:g,children:(0,B.jsx)(hO,{})}),(0,B.jsx)(Lf,{onClick:_,className:"react-flow__controls-zoomout",title:h["controls.zoomOut.ariaLabel"],"aria-label":h["controls.zoomOut.ariaLabel"],disabled:x,children:(0,B.jsx)(gO,{})})]}),n&&(0,B.jsx)(Lf,{className:"react-flow__controls-fitview",onClick:w,title:h["controls.fitView.ariaLabel"],"aria-label":h["controls.fitView.ariaLabel"],children:(0,B.jsx)(yO,{})}),o&&(0,B.jsx)(Lf,{className:"react-flow__controls-interactive",onClick:C,title:h["controls.interactive.ariaLabel"],"aria-label":h["controls.interactive.ariaLabel"],children:b?(0,B.jsx)(bO,{}):(0,B.jsx)(vO,{})}),c]})}LE.displayName="Controls";var AH=(0,k.memo)(LE);function xO({id:e,x:t,y:n,width:o,height:i,style:a,color:r,strokeColor:l,strokeWidth:s,className:u,borderRadius:c,shapeRendering:d,selected:f,onClick:p}){let{background:v,backgroundColor:b}=a||{},x=r||v||b;return(0,B.jsx)("rect",{className:rt(["react-flow__minimap-node",{selected:f},u]),x:t,y:n,rx:c,ry:c,width:o,height:i,style:{fill:x,stroke:l,strokeWidth:s},shapeRendering:d,onClick:p?g=>p(g,e):void 0})}var _O=(0,k.memo)(xO),EO=e=>e.nodes.map(t=>t.id),zh=e=>e instanceof Function?e:()=>e;function TO({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:o=5,nodeStrokeWidth:i,nodeComponent:a=_O,onClick:r}){let l=Ce(EO,je),s=zh(t),u=zh(e),c=zh(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return(0,B.jsx)(B.Fragment,{children:l.map(f=>(0,B.jsx)(CO,{id:f,nodeColorFunc:s,nodeStrokeColorFunc:u,nodeClassNameFunc:c,nodeBorderRadius:o,nodeStrokeWidth:i,NodeComponent:a,onClick:r,shapeRendering:d},f))})}function NO({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:o,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:r,NodeComponent:l,onClick:s}){let{node:u,x:c,y:d,width:f,height:p}=Ce(v=>{let b=v.nodeLookup.get(e);if(!b)return{node:void 0,x:0,y:0,width:0,height:0};let x=b.internals.userNode,{x:g,y:h}=b.internals.positionAbsolute,{width:m,height:y}=wo(x);return{node:x,x:g,y:h,width:m,height:y}},je);return!u||u.hidden||!yh(u)?null:(0,B.jsx)(l,{x:c,y:d,width:f,height:p,style:u.style,selected:!!u.selected,className:o(u),color:t(u),borderRadius:i,strokeColor:n(u),strokeWidth:a,shapeRendering:r,onClick:s,id:u.id})}var CO=(0,k.memo)(NO),wO=(0,k.memo)(TO),AO=200,MO=150,DO=e=>!e.hidden,RO=e=>{let 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?mh(tl(e.nodeLookup,{filter:DO}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},OO="react-flow__minimap-desc";function PE({style:e,className:t,nodeStrokeColor:n,nodeColor:o,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:r,nodeComponent:l,bgColor:s,maskColor:u,maskStrokeColor:c,maskStrokeWidth:d,position:f="bottom-right",onClick:p,onNodeClick:v,pannable:b=!1,zoomable:x=!1,ariaLabel:g,inversePan:h,zoomStep:m=1,offsetScale:y=5}){let S=Qe(),E=(0,k.useRef)(null),{boundingRect:_,viewBB:w,rfId:C,panZoom:P,translateExtent:M,flowWidth:z,flowHeight:I,ariaLabelConfig:T}=Ce(RO,je),D=e?.width??AO,A=e?.height??MO,R=_.width/D,O=_.height/A,L=Math.max(R,O),Y=L*D,G=L*A,X=y*L,F=_.x-(Y-_.width)/2-X,K=_.y-(G-_.height)/2-X,$=Y+X*2,le=G+X*2,W=`${OO}-${C}`,j=(0,k.useRef)(0),te=(0,k.useRef)();j.current=L,(0,k.useEffect)(()=>{if(E.current&&P)return te.current=s_({domNode:E.current,panZoom:P,getTransform:()=>S.getState().transform,getViewScale:()=>j.current}),()=>{te.current?.destroy()}},[P]),(0,k.useEffect)(()=>{te.current?.update({translateExtent:M,width:z,height:I,inversePan:h,pannable:b,zoomStep:m,zoomable:x})},[b,x,h,m,M,z,I]);let ge=p?Q=>{let[xe,Ne]=te.current?.pointer(Q)||[0,0];p(Q,{x:xe,y:Ne})}:void 0,me=v?(0,k.useCallback)((Q,xe)=>{let Ne=S.getState().nodeLookup.get(xe).internals.userNode;v(Q,Ne)},[]):void 0,re=g??T["minimap.ariaLabel"];return(0,B.jsx)(sl,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*L:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof r=="number"?r:void 0},className:rt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:(0,B.jsxs)("svg",{width:D,height:A,viewBox:`${F} ${K} ${$} ${le}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":W,ref:E,onClick:ge,children:[re&&(0,B.jsx)("title",{id:W,children:re}),(0,B.jsx)(wO,{onClick:me,nodeColor:o,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:r,nodeComponent:l}),(0,B.jsx)("path",{className:"react-flow__minimap-mask",d:`M${F-X},${K-X}h${$+X*2}v${le+X*2}h${-$-X*2}z
15
15
  M${w.x},${w.y}h${w.width}v${w.height}h${-w.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}PE.displayName="MiniMap";var MH=(0,k.memo)(PE),zO=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,LO={[Ki.Line]:"right",[Ki.Handle]:"bottom-right"};function PO({nodeId:e,position:t,variant:n=Ki.Handle,className:o,style:i=void 0,children:a,color:r,minWidth:l=10,minHeight:s=10,maxWidth:u=Number.MAX_VALUE,maxHeight:c=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:v,onResizeStart:b,onResize:x,onResizeEnd:g}){let h=uE(),m=typeof e=="string"?e:h,y=Qe(),S=(0,k.useRef)(null),E=n===Ki.Handle,_=Ce((0,k.useCallback)(zO(E&&p),[E,p]),je),w=(0,k.useRef)(null),C=t??LO[n];(0,k.useEffect)(()=>{if(!(!S.current||!m))return w.current||(w.current=p_({domNode:S.current,nodeId:m,getStoreItems:()=>{let{nodeLookup:M,transform:z,snapGrid:I,snapToGrid:T,nodeOrigin:D,domNode:A}=y.getState();return{nodeLookup:M,transform:z,snapGrid:I,snapToGrid:T,nodeOrigin:D,paneDomNode:A}},onChange:(M,z)=>{let{triggerNodeChanges:I,nodeLookup:T,parentLookup:D,nodeOrigin:A}=y.getState(),R=[],O={x:M.x,y:M.y},L=T.get(m);if(L&&L.expandParent&&L.parentId){let Y=L.origin??A,G=M.width??L.measured.width??0,X=M.height??L.measured.height??0,F={id:L.id,parentId:L.parentId,rect:{width:G,height:X,...vh({x:M.x??L.position.x,y:M.y??L.position.y},{width:G,height:X},L.parentId,T,Y)}},K=Mf([F],T,D,A);R.push(...K),O.x=M.x?Math.max(Y[0]*G,M.x):void 0,O.y=M.y?Math.max(Y[1]*X,M.y):void 0}if(O.x!==void 0&&O.y!==void 0){let Y={id:m,type:"position",position:{...O}};R.push(Y)}if(M.width!==void 0&&M.height!==void 0){let G={id:m,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:M.width,height:M.height}};R.push(G)}for(let Y of z){let G={...Y,type:"position"};R.push(G)}I(R)},onEnd:({width:M,height:z})=>{let I={id:m,type:"dimensions",resizing:!1,dimensions:{width:M,height:z}};y.getState().triggerNodeChanges([I])}})),w.current.update({controlPosition:C,boundaries:{minWidth:l,minHeight:s,maxWidth:u,maxHeight:c},keepAspectRatio:d,resizeDirection:f,onResizeStart:b,onResize:x,onResizeEnd:g,shouldResize:v}),()=>{w.current?.destroy()}},[C,l,s,u,c,d,b,x,g,v]);let P=C.split("-");return(0,B.jsx)("div",{className:rt(["react-flow__resize-control","nodrag",...P,n,o]),ref:S,style:{...i,scale:_,...r&&{[E?"backgroundColor":"borderColor"]:r}},children:a})}var DH=(0,k.memo)(PO);var Hh=J(Et(),1);var BE="(prefers-color-scheme: dark)";function BO(e){return e?Sa.DARK:Sa.LIGHT}function kh(){return typeof window>"u"||typeof window.matchMedia!="function"?Sa.DARK:BO(window.matchMedia(BE).matches)}function HO(e){if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let t=window.matchMedia(BE);return typeof t.addEventListener=="function"?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):(t.addListener(e),()=>t.removeListener(e))}function kO(e){return e!==void 0?{subscribe:()=>()=>{},getSnapshot:()=>e,getServerSnapshot:()=>e}:{subscribe:HO,getSnapshot:kh,getServerSnapshot:()=>Sa.DARK}}function HE(e){let t=Hh.default.useMemo(()=>kO(e),[e]);return Hh.default.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot)}function kE(e){if(!e)return null;let t={},n={},o={},i={},a=new Set;for(let l of e.edges)l.kind==="contains"&&(i[l.source]||(i[l.source]=[]),i[l.source].push(l.target),a.add(l.target));let r=new Set(Object.keys(i));for(let l of e.nodes){let s=l.io,u=r.has(l.id);for(let c of s.outputs)c.digest&&!t[c.digest]&&(t[c.digest]={name:c.name,concept:c.concept,contentType:c.content_type}),c.digest&&!u&&(n[c.digest]=l.id);for(let c of s.inputs)c.digest&&!t[c.digest]&&(t[c.digest]={name:c.name,concept:c.concept,contentType:c.content_type}),c.digest&&!u&&(o[c.digest]||(o[c.digest]=[]),o[c.digest].push(l.id))}return{stuffRegistry:t,stuffProducers:n,stuffConsumers:o,controllerNodeIds:r,childNodeIds:a,containmentTree:i}}function $n(e,t){let n={};for(let[r,l]of Object.entries(t.containmentTree))for(let s of l)n[s]=r;for(let[r,l]of Object.entries(t.stuffProducers)){let s="stuff_"+r,u=n[l];u&&(n[s]=u)}for(let r of e.nodes){if(!t.controllerNodeIds.has(r.id))continue;let l=n[r.id];if(l)for(let s of r.io.outputs){if(!s.digest)continue;let u="stuff_"+s.digest;n[u]||(n[u]=l)}}for(let r of e.edges)if(r.kind==="batch_item"&&r.target_stuff_digest){let l="stuff_"+r.target_stuff_digest;t.controllerNodeIds.has(r.source)&&(n[l]=r.source)}let o=new Set;for(let r of e.edges)(r.kind==="batch_item"||r.kind==="batch_aggregate"||r.kind==="parallel_combine")&&(r.source_stuff_digest&&o.add(r.source_stuff_digest),r.target_stuff_digest&&o.add(r.target_stuff_digest));let i="stuff_",a=Object.keys(n).filter(r=>r.startsWith(i));for(let r of a){let l=r.slice(i.length),s=n[r];if(!s)continue;let u=t.stuffConsumers[l]||[];if(u.length===0){o.has(l)||delete n[r];continue}for(;s;){let c=s;if(u.some(p=>GO(p,c,n)))break;let f=n[s];f?(n[r]=f,s=f):(delete n[r],s=void 0)}}return n}function GO(e,t,n){let o=n[e];for(;o;){if(o===t)return!0;o=n[o]}return!1}function GE(e,t){return e.pipe_registry?.[t]}function Gh(e,t){if(!e.concept_registry)return;let n=e.concept_registry[t];if(n)return n;for(let o of Object.values(e.concept_registry))if(o.code===t)return o}function Gf(e,t){let n={pipeCode:e.pipe_code,pipeType:e.pipe_type,description:e.description,status:e.status,inputs:e.io.inputs.map(o=>({name:o.name,concept:o.concept??""})),outputs:e.io.outputs.map(o=>({name:o.name,concept:o.concept??""}))};return t!==void 0&&(n.graphMode=t),e.tags!==void 0&&(n.tags=e.tags),n}function UE(e,t,n){let o=new Set([e]),a=t.nodes.find(r=>r.id===e)?.pipe_code;if(!a)return o;for(let r of t.nodes)r.pipe_code===a&&n.has(r.id)&&o.add(r.id);return o}function IO(e,t){let n=[],o=t[e],i=new Set;for(;o&&!i.has(o);)n.push(o),i.add(o),o=t[o];return n}function Qi(e,t,n){let o=IO(e,t),i=null;for(let a of o)n.has(a)&&(i=a);return i}function If(e,t,n){return Qi(e,t,n)??e}function IE(e,t){return e.nodes.find(n=>n.id===t)}function Ih(e,t,n,o,i){if(o.size===0)return{nodes:e.nodes,edges:e.edges,analysis:t};let a=$n(n,t),r=Eo(n),l=new Map;for(let h of o){let y=IE(n,h)?.io?.outputs;if(y)for(let S of y){if(!S.digest)continue;let E=l.get(S.digest);E||(E=new Set,l.set(S.digest,E)),E.add(h)}}if(l.size>0)for(let h of e.nodes){if(!Vr(h.id))continue;let m=l.get(bs(h.id));if(!m)continue;let y=a[h.id],S=null,E=new Set;for(;y&&!E.has(y);)E.add(y),m.has(y)&&(S=y),y=a[y];if(!S)continue;let _=a[S];_?a[h.id]=_:delete a[h.id]}let s=[];for(let h of e.nodes)Qi(h.id,a,o)||s.push(h);for(let h of o){if(Qi(h,a,o))continue;let m=IE(n,h);if(!m)continue;let y=Gf(Yr(m,h),r);i&&(y.onExpand=E=>i(h,E));let S={id:h,type:Ur,data:{labelDescriptor:{kind:"pipe",label:y.pipeCode,isFailed:y.status==="failed"},nodeData:m,isPipe:!1,isStuff:!1,isController:!0,labelText:y.pipeCode,pipeCode:y.pipeCode,pipeType:m.pipe_type,graphMode:r,pipeCardData:y},position:{x:0,y:0}};s.push(S)}let u=new Set;for(let h of t.controllerNodeIds)o.has(h)||Qi(h,a,o)||u.add(h);let c={};for(let h of u){let m=t.containmentTree[h]??[],y=[];for(let S of m){let E=Qi(S,a,o);E&&E!==S||y.push(S)}c[h]=y}let d=new Set;for(let h of Object.values(c))for(let m of h)d.add(m);let f={};for(let[h,m]of Object.entries(t.stuffProducers))f[h]=If(m,a,o);let p={};for(let[h,m]of Object.entries(t.stuffConsumers)){let y=new Set;for(let S of m)y.add(If(S,a,o));p[h]=[...y]}let v={stuffRegistry:t.stuffRegistry,stuffProducers:f,stuffConsumers:p,controllerNodeIds:u,childNodeIds:d,containmentTree:c},b=new Map;for(let h of e.edges){let m=If(h.source,a,o),y=If(h.target,a,o);if(m===y)continue;let S=h._batchEdge?"batch":"data",E=`${m}->${y}|${S}`;if(b.has(E))continue;let _={...h,source:m,target:y,id:h.id};h._batchEdge&&(m!==h.source||y!==h.target)&&(_.label="[N]"),delete _._crossGroup,b.set(E,_)}let x=$n({...n,edges:n.edges.filter(h=>h.kind!=="contains"?!0:u.has(h.source))},v),g=[];for(let h of b.values()){let m=x[h.source]||null,y=x[h.target]||null;if(m&&y&&m!==y)h._crossGroup=!0,h.style={...h.style,strokeWidth:1.5,opacity:.65};else if(h.style&&(h.style.opacity===.65||h.style.strokeWidth===1.5)){let{opacity:S,strokeWidth:E,..._}=h.style;h.style={..._,strokeWidth:2},h.markerEnd||(h.markerEnd={type:xa,color:"var(--color-edge)"})}g.push(h)}return{nodes:s,edges:g,analysis:v}}function VE(e,t){return`${e}.${t}`}function YE(e,t){return e.nodeId?[e.nodeId]:e.pipeRef?t.nodes.filter(n=>n.domain_code!==void 0&&n.pipe_code!==void 0&&VE(n.domain_code,n.pipe_code)===e.pipeRef).map(n=>n.id):[]}function XE(e,t,n,o){let i=new Map;if(!e||e.length===0||!t)return i;for(let a of e)for(let r of YE(a,t)){let l=Qi(r,n,o)??r,s=i.get(l),u=[a.message,...a.suggestedFix?[`Fix: ${a.suggestedFix}`]:[]];s?(a.severity==="error"&&(s.severity="error"),s.count+=1,s.lines.push(...u)):i.set(l,{severity:a.severity,count:1,lines:u})}return i}function qE(e,t,n,o,i){if(!t)return null;for(let a of YE(e,t)){let r=Qi(a,n,o)??a;if(i.has(r))return r}return null}function ZE(e,t,n){return e.map(o=>{let i=t.get(o.id);if(!i&&!o.data.validation&&!o.data.pipeCardData?.validation)return o;let a=i?n:void 0;return{...o,data:{...o.data,validation:i,onValidationBadgeClick:a,pipeCardData:o.data.pipeCardData?{...o.data.pipeCardData,validation:i,onValidationBadgeClick:a}:o.data.pipeCardData}}})}function jE(e){return!e||typeof e!="string"?!1:e.startsWith("https://")||e.startsWith("http://")||e.startsWith("file://")||e.startsWith("/")}function Uf(e){return!e||typeof e!="string"?!1:e.startsWith("https://")||e.startsWith("http://")||e.startsWith("file://")||e.startsWith("/")}function $E(e){if(!e)return null;if(typeof e=="string")return jE(e)?e:null;if(typeof e!="object")return null;let t=e,n=[t.public_url,t.src,t.href,t.uri,t.url];for(let o of n)if(jE(o))return o;return null}function FE(e){if(!e)return null;if(typeof e=="string")return Uf(e)?e:null;if(typeof e!="object")return null;let t=e,n=[t.public_url,t.src,t.href,t.uri,t.url];for(let o of n)if(Uf(o))return o;return null}function KE(e){if(!e)return null;if(typeof e=="string")return e.startsWith("pipelex-storage://")?e:null;if(typeof e!="object")return null;let t=e,n=[t.uri,t.url,t.src,t.href];for(let o of n)if(typeof o=="string"&&o.startsWith("pipelex-storage://"))return o;return null}function QE(e){let t=i=>{let a=i.inner_html;return typeof a=="string"&&a.trim()!==""?a:null};if(!e||typeof e!="object"||Array.isArray(e))return null;let n=e,o=t(n);if(o!=null)return o;for(let i of Object.values(n))if(i&&typeof i=="object"&&!Array.isArray(i)){let a=t(i);if(a!=null)return a}return null}function Uh(e){if(!e||typeof e!="object")return null;let t=e;return typeof t.filename=="string"&&t.filename?t.filename:null}function WE(e,t,n){if(t&&t.includes("/"))return t;if(e&&typeof e=="object"){let i=e;if(typeof i.mime_type=="string"&&i.mime_type)return i.mime_type}let o=Uh(e)||n||(typeof e=="string"?e:null);if(o){let a=o.match(/\.([a-zA-Z0-9]+)(?:\?|#|$)/)?.[1]?.toLowerCase();if(a){if(a==="pdf")return"application/pdf";if(["png","jpg","jpeg","gif","webp","svg","bmp"].includes(a))return`image/${a==="jpg"?"jpeg":a==="svg"?"svg+xml":a}`}}return null}function JE(e){return e==="application/pdf"?"PDF":e?.startsWith("image/")?"Image":"HTML"}function Vh(e,t){for(let n of e.nodes)for(let o of n.io?.outputs??[])if(o.digest===t)return{digest:t,name:o.name,concept:o.concept,contentType:o.content_type,data:o.data,dataText:o.data_text,dataHtml:o.data_html};for(let n of e.nodes)for(let o of n.io?.inputs??[])if(o.digest===t)return{digest:t,name:o.name,concept:o.concept,contentType:o.content_type,data:o.data,dataText:o.data_text,dataHtml:o.data_html};return null}var un=J(Et(),1);var{entries:sT,setPrototypeOf:eT,isFrozen:UO,getPrototypeOf:VO,getOwnPropertyDescriptor:YO}=Object,{freeze:$t,seal:Fn,create:eu}=Object,{apply:Fh,construct:Kh}=typeof Reflect<"u"&&Reflect;$t||($t=function(t){return t});Fn||(Fn=function(t){return t});Fh||(Fh=function(t,n){for(var o=arguments.length,i=new Array(o>2?o-2:0),a=2;a<o;a++)i[a-2]=arguments[a];return t.apply(n,i)});Kh||(Kh=function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return new t(...o)});var Fs=Ft(Array.prototype.forEach),XO=Ft(Array.prototype.lastIndexOf),tT=Ft(Array.prototype.pop),Ks=Ft(Array.prototype.push),qO=Ft(Array.prototype.splice),Yf=Ft(String.prototype.toLowerCase),Yh=Ft(String.prototype.toString),Xh=Ft(String.prototype.match),ul=Ft(String.prototype.replace),ZO=Ft(String.prototype.indexOf),jO=Ft(String.prototype.trim),ro=Ft(Object.prototype.hasOwnProperty),jt=Ft(RegExp.prototype.test),Qs=$O(TypeError);function Ft(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return Fh(e,t,o)}}function $O(e){return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return Kh(e,n)}}function ye(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Yf;eT&&eT(e,null);let o=t.length;for(;o--;){let i=t[o];if(typeof i=="string"){let a=n(i);a!==i&&(UO(t)||(t[o]=a),i=a)}e[i]=!0}return e}function FO(e){for(let t=0;t<e.length;t++)ro(e,t)||(e[t]=null);return e}function Mo(e){let t=eu(null);for(let[n,o]of sT(e))ro(e,n)&&(Array.isArray(o)?t[n]=FO(o):o&&typeof o=="object"&&o.constructor===Object?t[n]=Mo(o):t[n]=o);return t}function Ws(e,t){for(;e!==null;){let o=YO(e,t);if(o){if(o.get)return Ft(o.get);if(typeof o.value=="function")return Ft(o.value)}e=VO(e)}function n(){return null}return n}var nT=$t(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),qh=$t(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Zh=$t(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),KO=$t(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),jh=$t(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),QO=$t(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),oT=$t(["#text"]),iT=$t(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),$h=$t(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),aT=$t(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Vf=$t(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),WO=Fn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),JO=Fn(/<%[\w\W]*|[\w\W]*%>/gm),e3=Fn(/\$\{[\w\W]*/gm),t3=Fn(/^data-[\-\w.\u00B7-\uFFFF]+$/),n3=Fn(/^aria-[\-\w]+$/),uT=Fn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),o3=Fn(/^(?:\w+script|data):/i),i3=Fn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),cT=Fn(/^html$/i),a3=Fn(/^[a-z][.\w]*(-[.\w]+)+$/i),rT=Object.freeze({__proto__:null,ARIA_ATTR:n3,ATTR_WHITESPACE:i3,CUSTOM_ELEMENT:a3,DATA_ATTR:t3,DOCTYPE_NAME:cT,ERB_EXPR:JO,IS_ALLOWED_URI:uT,IS_SCRIPT_OR_DATA:o3,MUSTACHE_EXPR:WO,TMPLIT_EXPR:e3}),Js={element:1,text:3,progressingInstruction:7,comment:8,document:9},r3=function(){return typeof window>"u"?null:window},l3=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let o=null,i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(o=n.getAttribute(i));let a="dompurify"+(o?"#"+o:"");try{return t.createPolicy(a,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},lT=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function fT(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r3(),t=U=>fT(U);if(t.version="3.4.0",t.removed=[],!e||!e.document||e.document.nodeType!==Js.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,o=n,i=o.currentScript,{DocumentFragment:a,HTMLTemplateElement:r,Node:l,Element:s,NodeFilter:u,NamedNodeMap:c=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,v=s.prototype,b=Ws(v,"cloneNode"),x=Ws(v,"remove"),g=Ws(v,"nextSibling"),h=Ws(v,"childNodes"),m=Ws(v,"parentNode");if(typeof r=="function"){let U=n.createElement("template");U.content&&U.content.ownerDocument&&(n=U.content.ownerDocument)}let y,S="",{implementation:E,createNodeIterator:_,createDocumentFragment:w,getElementsByTagName:C}=n,{importNode:P}=o,M=lT();t.isSupported=typeof sT=="function"&&typeof m=="function"&&E&&E.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:z,ERB_EXPR:I,TMPLIT_EXPR:T,DATA_ATTR:D,ARIA_ATTR:A,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:O,CUSTOM_ELEMENT:L}=rT,{IS_ALLOWED_URI:Y}=rT,G=null,X=ye({},[...nT,...qh,...Zh,...jh,...oT]),F=null,K=ye({},[...iT,...$h,...aT,...Vf]),$=Object.seal(eu(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),le=null,W=null,j=Object.seal(eu(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),te=!0,ge=!0,me=!1,re=!0,Q=!1,xe=!0,Ne=!1,_e=!1,et=!1,De=!1,we=!1,tt=!1,Pe=!0,pn=!1,lo="user-content-",On=!0,nt=!1,_t={},We=null,so=ye({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Oo=null,kt=ye({},["audio","video","img","source","image","track"]),zo=null,ui=ye({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Kn="http://www.w3.org/1998/Math/MathML",Lo="http://www.w3.org/2000/svg",ct="http://www.w3.org/1999/xhtml",Gt=ct,uo=!1,mn=null,Ya=ye({},[Kn,Lo,ct],Yh),zn=ye({},["mi","mo","mn","ms","mtext"]),co=ye({},["annotation-xml"]),Xa=ye({},["title","style","font","a","script"]),fo=null,ml=["application/xhtml+xml","text/html"],qa="text/html",$e=null,Ln=null,Za=n.createElement("form"),Qt=function(N){return N instanceof RegExp||N instanceof Function},ci=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ln&&Ln===N)){if((!N||typeof N!="object")&&(N={}),N=Mo(N),fo=ml.indexOf(N.PARSER_MEDIA_TYPE)===-1?qa:N.PARSER_MEDIA_TYPE,$e=fo==="application/xhtml+xml"?Yh:Yf,G=ro(N,"ALLOWED_TAGS")?ye({},N.ALLOWED_TAGS,$e):X,F=ro(N,"ALLOWED_ATTR")?ye({},N.ALLOWED_ATTR,$e):K,mn=ro(N,"ALLOWED_NAMESPACES")?ye({},N.ALLOWED_NAMESPACES,Yh):Ya,zo=ro(N,"ADD_URI_SAFE_ATTR")?ye(Mo(ui),N.ADD_URI_SAFE_ATTR,$e):ui,Oo=ro(N,"ADD_DATA_URI_TAGS")?ye(Mo(kt),N.ADD_DATA_URI_TAGS,$e):kt,We=ro(N,"FORBID_CONTENTS")?ye({},N.FORBID_CONTENTS,$e):so,le=ro(N,"FORBID_TAGS")?ye({},N.FORBID_TAGS,$e):Mo({}),W=ro(N,"FORBID_ATTR")?ye({},N.FORBID_ATTR,$e):Mo({}),_t=ro(N,"USE_PROFILES")?N.USE_PROFILES:!1,te=N.ALLOW_ARIA_ATTR!==!1,ge=N.ALLOW_DATA_ATTR!==!1,me=N.ALLOW_UNKNOWN_PROTOCOLS||!1,re=N.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Q=N.SAFE_FOR_TEMPLATES||!1,xe=N.SAFE_FOR_XML!==!1,Ne=N.WHOLE_DOCUMENT||!1,De=N.RETURN_DOM||!1,we=N.RETURN_DOM_FRAGMENT||!1,tt=N.RETURN_TRUSTED_TYPE||!1,et=N.FORCE_BODY||!1,Pe=N.SANITIZE_DOM!==!1,pn=N.SANITIZE_NAMED_PROPS||!1,On=N.KEEP_CONTENT!==!1,nt=N.IN_PLACE||!1,Y=N.ALLOWED_URI_REGEXP||uT,Gt=N.NAMESPACE||ct,zn=N.MATHML_TEXT_INTEGRATION_POINTS||zn,co=N.HTML_INTEGRATION_POINTS||co,$=N.CUSTOM_ELEMENT_HANDLING||eu(null),N.CUSTOM_ELEMENT_HANDLING&&Qt(N.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&($.tagNameCheck=N.CUSTOM_ELEMENT_HANDLING.tagNameCheck),N.CUSTOM_ELEMENT_HANDLING&&Qt(N.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&($.attributeNameCheck=N.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),N.CUSTOM_ELEMENT_HANDLING&&typeof N.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&($.allowCustomizedBuiltInElements=N.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Q&&(ge=!1),we&&(De=!0),_t&&(G=ye({},oT),F=eu(null),_t.html===!0&&(ye(G,nT),ye(F,iT)),_t.svg===!0&&(ye(G,qh),ye(F,$h),ye(F,Vf)),_t.svgFilters===!0&&(ye(G,Zh),ye(F,$h),ye(F,Vf)),_t.mathMl===!0&&(ye(G,jh),ye(F,aT),ye(F,Vf))),j.tagCheck=null,j.attributeCheck=null,N.ADD_TAGS&&(typeof N.ADD_TAGS=="function"?j.tagCheck=N.ADD_TAGS:(G===X&&(G=Mo(G)),ye(G,N.ADD_TAGS,$e))),N.ADD_ATTR&&(typeof N.ADD_ATTR=="function"?j.attributeCheck=N.ADD_ATTR:(F===K&&(F=Mo(F)),ye(F,N.ADD_ATTR,$e))),N.ADD_URI_SAFE_ATTR&&ye(zo,N.ADD_URI_SAFE_ATTR,$e),N.FORBID_CONTENTS&&(We===so&&(We=Mo(We)),ye(We,N.FORBID_CONTENTS,$e)),N.ADD_FORBID_CONTENTS&&(We===so&&(We=Mo(We)),ye(We,N.ADD_FORBID_CONTENTS,$e)),On&&(G["#text"]=!0),Ne&&ye(G,["html","head","body"]),G.table&&(ye(G,["tbody"]),delete le.tbody),N.TRUSTED_TYPES_POLICY){if(typeof N.TRUSTED_TYPES_POLICY.createHTML!="function")throw Qs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof N.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Qs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=N.TRUSTED_TYPES_POLICY,S=y.createHTML("")}else y===void 0&&(y=l3(p,i)),y!==null&&typeof S=="string"&&(S=y.createHTML(""));$t&&$t(N),Ln=N}},Wi=ye({},[...qh,...Zh,...KO]),po=ye({},[...jh,...QO]),hl=function(N){let H=m(N);(!H||!H.tagName)&&(H={namespaceURI:Gt,tagName:"template"});let q=Yf(N.tagName),ce=Yf(H.tagName);return mn[N.namespaceURI]?N.namespaceURI===Lo?H.namespaceURI===ct?q==="svg":H.namespaceURI===Kn?q==="svg"&&(ce==="annotation-xml"||zn[ce]):!!Wi[q]:N.namespaceURI===Kn?H.namespaceURI===ct?q==="math":H.namespaceURI===Lo?q==="math"&&co[ce]:!!po[q]:N.namespaceURI===ct?H.namespaceURI===Lo&&!co[ce]||H.namespaceURI===Kn&&!zn[ce]?!1:!po[q]&&(Xa[q]||!Wi[q]):!!(fo==="application/xhtml+xml"&&mn[N.namespaceURI]):!1},It=function(N){Ks(t.removed,{element:N});try{m(N).removeChild(N)}catch{x(N)}},Qn=function(N,H){try{Ks(t.removed,{attribute:H.getAttributeNode(N),from:H})}catch{Ks(t.removed,{attribute:null,from:H})}if(H.removeAttribute(N),N==="is")if(De||we)try{It(H)}catch{}else try{H.setAttribute(N,"")}catch{}},Ji=function(N){let H=null,q=null;if(et)N="<remove></remove>"+N;else{let Re=Xh(N,/^[\r\n\t ]+/);q=Re&&Re[0]}fo==="application/xhtml+xml"&&Gt===ct&&(N='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+N+"</body></html>");let ce=y?y.createHTML(N):N;if(Gt===ct)try{H=new f().parseFromString(ce,fo)}catch{}if(!H||!H.documentElement){H=E.createDocument(Gt,"template",null);try{H.documentElement.innerHTML=uo?S:ce}catch{}}let Ve=H.body||H.documentElement;return N&&q&&Ve.insertBefore(n.createTextNode(q),Ve.childNodes[0]||null),Gt===ct?C.call(H,Ne?"html":"body")[0]:Ne?H.documentElement:Ve},ja=function(N){return _.call(N.ownerDocument||N,N,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},fi=function(N){return N instanceof d&&(typeof N.nodeName!="string"||typeof N.textContent!="string"||typeof N.removeChild!="function"||!(N.attributes instanceof c)||typeof N.removeAttribute!="function"||typeof N.setAttribute!="function"||typeof N.namespaceURI!="string"||typeof N.insertBefore!="function"||typeof N.hasChildNodes!="function")},di=function(N){return typeof l=="function"&&N instanceof l};function hn(U,N,H){Fs(U,q=>{q.call(t,N,H,Ln)})}let $a=function(N){let H=null;if(hn(M.beforeSanitizeElements,N,null),fi(N))return It(N),!0;let q=$e(N.nodeName);if(hn(M.uponSanitizeElement,N,{tagName:q,allowedTags:G}),xe&&N.hasChildNodes()&&!di(N.firstElementChild)&&jt(/<[/\w!]/g,N.innerHTML)&&jt(/<[/\w!]/g,N.textContent)||xe&&N.namespaceURI===ct&&q==="style"&&di(N.firstElementChild)||N.nodeType===Js.progressingInstruction||xe&&N.nodeType===Js.comment&&jt(/<[/\w]/g,N.data))return It(N),!0;if(le[q]||!(j.tagCheck instanceof Function&&j.tagCheck(q))&&!G[q]){if(!le[q]&&mo(q)&&($.tagNameCheck instanceof RegExp&&jt($.tagNameCheck,q)||$.tagNameCheck instanceof Function&&$.tagNameCheck(q)))return!1;if(On&&!We[q]){let ce=m(N)||N.parentNode,Ve=h(N)||N.childNodes;if(Ve&&ce){let Re=Ve.length;for(let gt=Re-1;gt>=0;--gt){let ot=b(Ve[gt],!0);ot.__removalCount=(N.__removalCount||0)+1,ce.insertBefore(ot,g(N))}}}return It(N),!0}return N instanceof s&&!hl(N)||(q==="noscript"||q==="noembed"||q==="noframes")&&jt(/<\/no(script|embed|frames)/i,N.innerHTML)?(It(N),!0):(Q&&N.nodeType===Js.text&&(H=N.textContent,Fs([z,I,T],ce=>{H=ul(H,ce," ")}),N.textContent!==H&&(Ks(t.removed,{element:N.cloneNode()}),N.textContent=H)),hn(M.afterSanitizeElements,N,null),!1)},Wn=function(N,H,q){if(W[H]||Pe&&(H==="id"||H==="name")&&(q in n||q in Za))return!1;if(!(ge&&!W[H]&&jt(D,H))){if(!(te&&jt(A,H))){if(!(j.attributeCheck instanceof Function&&j.attributeCheck(H,N))){if(!F[H]||W[H]){if(!(mo(N)&&($.tagNameCheck instanceof RegExp&&jt($.tagNameCheck,N)||$.tagNameCheck instanceof Function&&$.tagNameCheck(N))&&($.attributeNameCheck instanceof RegExp&&jt($.attributeNameCheck,H)||$.attributeNameCheck instanceof Function&&$.attributeNameCheck(H,N))||H==="is"&&$.allowCustomizedBuiltInElements&&($.tagNameCheck instanceof RegExp&&jt($.tagNameCheck,q)||$.tagNameCheck instanceof Function&&$.tagNameCheck(q))))return!1}else if(!zo[H]){if(!jt(Y,ul(q,O,""))){if(!((H==="src"||H==="xlink:href"||H==="href")&&N!=="script"&&ZO(q,"data:")===0&&Oo[N])){if(!(me&&!jt(R,ul(q,O,"")))){if(q)return!1}}}}}}}return!0},mo=function(N){return N!=="annotation-xml"&&Xh(N,L)},ue=function(N){hn(M.beforeSanitizeAttributes,N,null);let{attributes:H}=N;if(!H||fi(N))return;let q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:F,forceKeepAttr:void 0},ce=H.length;for(;ce--;){let Ve=H[ce],{name:Re,namespaceURI:gt,value:ot}=Ve,ho=$e(Re),gl=ot,yt=Re==="value"?gl:jO(gl);if(q.attrName=ho,q.attrValue=yt,q.keepAttr=!0,q.forceKeepAttr=void 0,hn(M.uponSanitizeAttribute,N,q),yt=q.attrValue,pn&&(ho==="id"||ho==="name")&&(Qn(Re,N),yt=lo+yt),xe&&jt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,yt)){Qn(Re,N);continue}if(ho==="attributename"&&Xh(yt,"href")){Qn(Re,N);continue}if(q.forceKeepAttr)continue;if(!q.keepAttr){Qn(Re,N);continue}if(!re&&jt(/\/>/i,yt)){Qn(Re,N);continue}Q&&Fs([z,I,T],ou=>{yt=ul(yt,ou," ")});let yl=$e(N.nodeName);if(!Wn(yl,ho,yt)){Qn(Re,N);continue}if(y&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!gt)switch(p.getAttributeType(yl,ho)){case"TrustedHTML":{yt=y.createHTML(yt);break}case"TrustedScriptURL":{yt=y.createScriptURL(yt);break}}if(yt!==gl)try{gt?N.setAttributeNS(gt,Re,yt):N.setAttribute(Re,yt),fi(N)?It(N):tT(t.removed)}catch{Qn(Re,N)}}hn(M.afterSanitizeAttributes,N,null)},ae=function(N){let H=null,q=ja(N);for(hn(M.beforeSanitizeShadowDOM,N,null);H=q.nextNode();)hn(M.uponSanitizeShadowNode,H,null),$a(H),ue(H),H.content instanceof a&&ae(H.content);hn(M.afterSanitizeShadowDOM,N,null)};return t.sanitize=function(U){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},H=null,q=null,ce=null,Ve=null;if(uo=!U,uo&&(U="<!-->"),typeof U!="string"&&!di(U))if(typeof U.toString=="function"){if(U=U.toString(),typeof U!="string")throw Qs("dirty is not a string, aborting")}else throw Qs("toString is not a function");if(!t.isSupported)return U;if(_e||ci(N),t.removed=[],typeof U=="string"&&(nt=!1),nt){if(U.nodeName){let ot=$e(U.nodeName);if(!G[ot]||le[ot])throw Qs("root node is forbidden and cannot be sanitized in-place")}}else if(U instanceof l)H=Ji("<!---->"),q=H.ownerDocument.importNode(U,!0),q.nodeType===Js.element&&q.nodeName==="BODY"||q.nodeName==="HTML"?H=q:H.appendChild(q);else{if(!De&&!Q&&!Ne&&U.indexOf("<")===-1)return y&&tt?y.createHTML(U):U;if(H=Ji(U),!H)return De?null:tt?S:""}H&&et&&It(H.firstChild);let Re=ja(nt?U:H);for(;ce=Re.nextNode();)$a(ce),ue(ce),ce.content instanceof a&&ae(ce.content);if(nt)return U;if(De){if(Q){H.normalize();let ot=H.innerHTML;Fs([z,I,T],ho=>{ot=ul(ot,ho," ")}),H.innerHTML=ot}if(we)for(Ve=w.call(H.ownerDocument);H.firstChild;)Ve.appendChild(H.firstChild);else Ve=H;return(F.shadowroot||F.shadowrootmode)&&(Ve=P.call(o,Ve,!0)),Ve}let gt=Ne?H.outerHTML:H.innerHTML;return Ne&&G["!doctype"]&&H.ownerDocument&&H.ownerDocument.doctype&&H.ownerDocument.doctype.name&&jt(cT,H.ownerDocument.doctype.name)&&(gt="<!DOCTYPE "+H.ownerDocument.doctype.name+`>
16
16
  `+gt),Q&&Fs([z,I,T],ot=>{gt=ul(gt,ot," ")}),y&&tt?y.createHTML(gt):gt},t.setConfig=function(){let U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ci(U),_e=!0},t.clearConfig=function(){Ln=null,_e=!1},t.isValidAttribute=function(U,N,H){Ln||ci({});let q=$e(U),ce=$e(N);return Wn(q,ce,H)},t.addHook=function(U,N){typeof N=="function"&&Ks(M[U],N)},t.removeHook=function(U,N){if(N!==void 0){let H=XO(M[U],N);return H===-1?void 0:qO(M[U],H,1)[0]}return tT(M[U])},t.removeHooks=function(U){M[U]=[]},t.removeAllHooks=function(){M=lT()},t}var Qh=fT();var se=J(de(),1),s3=(0,se.jsx)("svg",{viewBox:"0 0 24 24",children:(0,se.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),u3=(0,se.jsx)("svg",{viewBox:"0 0 24 24",children:(0,se.jsx)("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})}),c3=(0,se.jsx)("svg",{viewBox:"0 0 24 24",children:(0,se.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"})}),f3=(0,se.jsx)("svg",{viewBox:"0 0 24 24",children:(0,se.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"})}),dT=(0,se.jsx)("svg",{viewBox:"0 0 24 24",children:(0,se.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"})});function Xf(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Wh(e,t,n){let o=new Blob([e],{type:n}),i=URL.createObjectURL(o),a=document.createElement("a");a.href=i,a.download=t,a.click(),setTimeout(()=>URL.revokeObjectURL(i),1e4)}function pT(e,t){let n=document.createElement("a");n.href=e,n.download=t,n.target="_blank",n.click()}function qf({stuff:e,className:t,resolveStorageUrl:n,canEmbedPdf:o,onOpenExternally:i}){let[a,r]=un.default.useState("html"),[l,s]=un.default.useState(!1),u=un.default.useRef(null),c=un.default.useMemo(()=>FE(e.data),[e.data]),d=un.default.useMemo(()=>$E(e.data),[e.data]),f=un.default.useMemo(()=>KE(e.data),[e.data]),p=un.default.useMemo(()=>Uh(e.data),[e.data]),v=un.default.useMemo(()=>QE(e.data),[e.data]),[b,x]=un.default.useState(null);un.default.useEffect(()=>{if(x(null),!f||!n||c)return;let A=!1;return n(f).then(R=>{A||x(Uf(R)?R:null)}).catch(()=>{A||x(null)}),()=>{A=!0}},[f,n,c]);let g=c??b,h=d??b,m=un.default.useMemo(()=>WE(e.data,e.contentType,h??f),[e.data,e.contentType,h,f]),y=m==="application/pdf",S=m?.startsWith("image/")??!1,E=JE(m??e.contentType),{jsonString:_,jsonError:w}=un.default.useMemo(()=>{if(e.data==null)return{jsonString:null,jsonError:null};try{return{jsonString:JSON.stringify(e.data,null,2),jsonError:null}}catch(A){return{jsonString:null,jsonError:A instanceof Error?A.message:String(A)}}},[e.data]);un.default.useEffect(()=>{a!=="html"||!u.current||u.current.querySelectorAll("a").forEach(A=>{A.setAttribute("target","_blank"),A.setAttribute("rel","noopener noreferrer")})},[a,e.dataHtml]);function C(A){let R=p||e.name;return(0,se.jsxs)("div",{className:"stuff-viewer-local-file",children:[(0,se.jsx)("div",{className:"stuff-viewer-local-file-icon",children:dT}),(0,se.jsxs)("div",{className:"stuff-viewer-local-file-info",children:[R&&(0,se.jsx)("div",{className:"stuff-viewer-local-file-name",children:R}),(0,se.jsxs)("div",{className:"stuff-viewer-local-file-hint",children:[A," \u2014 no preview available"]})]})]})}function P(A){return(0,se.jsxs)("div",{className:"stuff-viewer-error",role:"alert",children:[(0,se.jsx)("div",{className:"stuff-viewer-error-title",children:"Unable to serialize data"}),(0,se.jsx)("div",{className:"stuff-viewer-error-detail",children:A})]})}function M(){if(a==="html"){if(y){if(o!==!1&&g){let R=g.includes("#")?g:`${g}#pagemode=none`;return(0,se.jsx)("div",{className:"stuff-viewer-pdf",children:(0,se.jsx)("embed",{src:R,type:"application/pdf"})})}if(h){let R=p||e.name;return(0,se.jsxs)("button",{type:"button",className:"stuff-viewer-local-file stuff-viewer-local-file--button",onClick:T,children:[(0,se.jsx)("div",{className:"stuff-viewer-local-file-icon",children:dT}),(0,se.jsxs)("div",{className:"stuff-viewer-local-file-info",children:[R&&(0,se.jsx)("div",{className:"stuff-viewer-local-file-name",children:R}),(0,se.jsx)("div",{className:"stuff-viewer-local-file-hint",children:"Click to open PDF externally"})]})]})}return C("PDF")}return S?g?(0,se.jsx)("div",{className:"stuff-viewer-image",children:(0,se.jsx)("img",{src:g,alt:e.name??"(unnamed stuff)"})}):C("Image"):v!=null?(0,se.jsx)("iframe",{className:"stuff-viewer-html-frame",title:e.name?`${e.name} preview`:"HTML preview",sandbox:"",srcDoc:Qh.sanitize(v,{WHOLE_DOCUMENT:!0})}):e.dataHtml?(0,se.jsx)("div",{className:"stuff-viewer-html",dangerouslySetInnerHTML:{__html:Qh.sanitize(e.dataHtml)}}):_?(0,se.jsx)("pre",{className:"stuff-viewer-pre",dangerouslySetInnerHTML:{__html:Xf(_)}}):w?P(w):(0,se.jsx)("div",{className:"stuff-viewer-placeholder",children:"No content available"})}return a==="json"?_?(0,se.jsx)("pre",{className:"stuff-viewer-pre",dangerouslySetInnerHTML:{__html:Xf(_)}}):w?P(w):(0,se.jsx)("div",{className:"stuff-viewer-placeholder",children:"No JSON data available"}):e.dataText?(0,se.jsx)("pre",{className:"stuff-viewer-pre stuff-viewer-pre--nowrap",dangerouslySetInnerHTML:{__html:Xf(e.dataText)}}):_?(0,se.jsx)("pre",{className:"stuff-viewer-pre",dangerouslySetInnerHTML:{__html:Xf(_)}}):w?P(w):(0,se.jsx)("div",{className:"stuff-viewer-placeholder",children:"No text data available"})}function z(){let A;a==="json"?A=_||"":a==="text"?A=e.dataText||_||"":A=v||e.dataText||e.dataHtml||_||"",A&&navigator.clipboard&&navigator.clipboard.writeText(A).then(()=>{s(!0),setTimeout(()=>s(!1),1500)}).catch(()=>{})}function I(){if(S&&h){let A=m?.split("/")[1]||"png";pT(h,`${e.name||"stuff"}.${A}`);return}if(y&&h){pT(h,`${e.name||"stuff"}.pdf`);return}a==="json"?Wh(_||"{}",`${e.name||"stuff"}.json`,"application/json"):a==="text"?Wh(e.dataText||_||"",`${e.name||"stuff"}.txt`,"text/plain"):Wh(v||e.dataHtml||_||"",`${e.name||"stuff"}.html`,"text/html")}function T(){if(h){if(i){i(h,p??void 0);return}window.open(h,"_blank","noopener,noreferrer")}}let D=["stuff-viewer",t].filter(Boolean).join(" ");return(0,se.jsxs)("div",{className:D,children:[(0,se.jsxs)("div",{className:"stuff-viewer-header",children:[(0,se.jsx)("h3",{className:"stuff-viewer-title",children:e.name??"(unnamed stuff)"}),e.concept&&(0,se.jsx)("p",{className:"stuff-viewer-subtitle",children:e.concept})]}),(0,se.jsxs)("div",{className:"stuff-viewer-toolbar",children:[(0,se.jsx)("div",{className:"stuff-viewer-tabs",children:["html","json","text"].map(A=>(0,se.jsx)("button",{type:"button",className:`stuff-viewer-tab${a===A?" stuff-viewer-tab--active":""}`,onClick:()=>r(A),children:A==="html"?E:A==="json"?"JSON":"Pretty"},A))}),(0,se.jsxs)("div",{className:"stuff-viewer-actions",children:[h&&(0,se.jsx)("button",{type:"button",className:"stuff-viewer-action-btn",onClick:T,title:"Open in new window","aria-label":"Open in new window",children:f3}),(0,se.jsx)("button",{type:"button",className:`stuff-viewer-action-btn${l?" stuff-viewer-action-btn--copied":""}`,onClick:z,title:"Copy","aria-label":"Copy",children:l?u3:s3}),(0,se.jsx)("button",{type:"button",className:"stuff-viewer-action-btn",onClick:I,title:"Download","aria-label":"Download",children:c3})]})]}),(0,se.jsx)("div",{className:"stuff-viewer-content",ref:u,children:M()})]})}var mT=J(Et(),1);var Ha=J(de(),1);function hT({isOpen:e,onClose:t,children:n,width:o,isDragging:i,onResizeHandleMouseDown:a,closeOnEscape:r=!0}){mT.default.useEffect(()=>{if(!e||!r)return;let s=u=>{u.key==="Escape"&&t()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e,r,t]);let l=["detail-panel",!e&&"detail-panel--closed",i&&"detail-panel--dragging"].filter(Boolean).join(" ");return(0,Ha.jsxs)("div",{className:l,style:o?{width:`${o}px`}:void 0,children:[a&&(0,Ha.jsx)("div",{className:"detail-panel-resize-handle",onMouseDown:a,role:"separator","aria-orientation":"vertical","aria-label":"Resize panel"}),(0,Ha.jsxs)("div",{className:"detail-panel-content",children:[(0,Ha.jsx)("div",{className:"detail-panel-close-row",children:(0,Ha.jsx)("button",{className:"detail-panel-close",onClick:t,"aria-label":"Close panel",children:"x"})}),n]})]})}var ka=J(Et(),1),d3=.6;function gT({defaultWidth:e,minWidth:t,maxWidth:n,containerRef:o}){let[i,a]=ka.default.useState(e),[r,l]=ka.default.useState(!1),s=ka.default.useRef({startX:0,startWidth:0,maxAllowed:n}),u=ka.default.useRef(null),c=ka.default.useCallback(d=>{d.preventDefault(),d.stopPropagation();let f=o?.current?.getBoundingClientRect().width,p=f?Math.min(n,f*d3):n;s.current={startX:d.clientX,startWidth:i,maxAllowed:p},l(!0),document.body.style.userSelect="none",document.body.style.cursor="col-resize"},[i,n,o]);return ka.default.useEffect(()=>{if(!r)return;let d=p=>{u.current!==null&&cancelAnimationFrame(u.current),u.current=requestAnimationFrame(()=>{let{startX:v,startWidth:b,maxAllowed:x}=s.current,g=v-p.clientX,h=Math.max(t,Math.min(x,b+g));a(h),u.current=null})},f=()=>{l(!1),document.body.style.userSelect="",document.body.style.cursor="",u.current!==null&&(cancelAnimationFrame(u.current),u.current=null)};return document.addEventListener("mousemove",d),document.addEventListener("mouseup",f),()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",f),document.body.style.userSelect="",document.body.style.cursor="",u.current!==null&&(cancelAnimationFrame(u.current),u.current=null)}},[r,t]),{width:i,isDragging:r,handleMouseDown:c}}var _T=J(Et(),1);var Zf=J(Et(),1),Ue=J(de(),1);function Jh(e){return e<1?`${(e*1e3).toFixed(0)}ms`:`${e.toFixed(2)}s`}function ee({label:e,value:t}){return t==null?null:(0,Ue.jsxs)("div",{className:"detail-kv-row",children:[(0,Ue.jsx)("span",{className:"detail-kv-key",children:e}),(0,Ue.jsx)("span",{className:"detail-kv-value",children:String(t)})]})}function eg({label:e,text:t}){return t?(0,Ue.jsxs)("div",{children:[(0,Ue.jsx)("div",{className:"detail-section-label",children:e}),(0,Ue.jsx)("div",{className:"detail-prompt-block",children:t})]}):null}var p3=(0,Ue.jsx)("svg",{viewBox:"0 0 24 24",width:"10",height:"10",fill:"currentColor",children:(0,Ue.jsx)("path",{d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"})}),m3=(0,Ue.jsx)("svg",{viewBox:"0 0 24 24",width:"10",height:"10",fill:"currentColor",children:(0,Ue.jsx)("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),h3=(0,Ue.jsx)("svg",{viewBox:"0 0 24 24",width:"10",height:"10",fill:"currentColor",children:(0,Ue.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),g3=(0,Ue.jsx)("svg",{viewBox:"0 0 24 24",width:"10",height:"10",fill:"currentColor",children:(0,Ue.jsx)("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})}),yT={all:"unset",cursor:"pointer",display:"flex",alignItems:"center",gap:4,fontSize:9,color:"#64748b",padding:"2px 6px",borderRadius:3,background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.06)",transition:"color 0.15s"};function Mn({label:e,templateText:t,renderedText:n}){let[o,i]=(0,Zf.useState)(!1),[a,r]=(0,Zf.useState)(!1),[l,s]=(0,Zf.useState)(!1),u=!!t,c=!!n;if(!u&&!c)return null;let d=u&&c,f=d?o?t:n:t||n;function p(){!f||!navigator.clipboard||navigator.clipboard.writeText(f).then(()=>{r(!0),setTimeout(()=>r(!1),1500)}).catch(()=>{})}return(0,Ue.jsxs)("div",{children:[(0,Ue.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:4},children:[(0,Ue.jsx)("div",{className:"detail-section-label",style:{marginBottom:0},children:e}),(0,Ue.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4},children:[(0,Ue.jsx)("button",{onClick:()=>s(v=>!v),title:l?"Collapse prompt":"Expand prompt","aria-label":l?"Collapse prompt":"Expand prompt",className:"detail-prompt-expand-btn",children:l?m3:p3}),(0,Ue.jsx)("button",{onClick:p,title:"Copy prompt","aria-label":"Copy prompt",style:{...yT,color:a?"#10b981":"#64748b"},children:a?g3:h3}),d&&(0,Ue.jsxs)("button",{onClick:()=>i(v=>!v),style:yT,children:[(0,Ue.jsx)("span",{style:{width:22,height:12,borderRadius:6,background:o?"rgba(255,255,255,0.12)":"#50FA7B33",position:"relative",display:"inline-block",transition:"background 0.15s"},children:(0,Ue.jsx)("span",{style:{position:"absolute",top:2,left:o?2:12,width:8,height:8,borderRadius:"50%",background:o?"#94a3b8":"#50FA7B",transition:"left 0.15s, background 0.15s"}})}),o?"template":"rendered"]})]})]}),(0,Ue.jsx)("div",{className:`detail-prompt-block ${l?"detail-prompt-block--expanded":"detail-prompt-block--collapsed"}`,style:{marginTop:6},children:f})]})}var Lt=J(de(),1);function tg({blueprint:e,executionData:t}){let n=e.llm_prompt_spec,o=n.user_image_references&&n.user_image_references.length>0,i=n.user_document_references&&n.user_document_references.length>0,a=n.system_image_references&&n.system_image_references.length>0,r=n.system_document_references&&n.system_document_references.length>0,l=t?.resolved_model,s=t?.resolved_model_for_object,u=t?.rendered_system_prompt,c=t?.rendered_user_prompt,d=t?.structuring_path,f=t?.is_multiple_output,p=l||e.llm_choices?.for_text,v=s||e.llm_choices?.for_object;return(0,Lt.jsxs)(Lt.Fragment,{children:[(0,Lt.jsx)(ee,{label:"Model",value:p}),v&&v!==p&&(0,Lt.jsx)(ee,{label:"Model (object)",value:v}),(0,Lt.jsx)(ee,{label:"Structuring",value:d||e.structuring_method}),(0,Lt.jsx)(ee,{label:"Multiple Output",value:f}),(0,Lt.jsx)(ee,{label:"Output Multiplicity",value:e.output_multiplicity}),(0,Lt.jsx)(ee,{label:"Prompt Category",value:n.prompt_blueprint?.category}),o&&(0,Lt.jsx)(ee,{label:"User Image Refs",value:`${n.user_image_references.length} references`}),i&&(0,Lt.jsx)(ee,{label:"User Document Refs",value:`${n.user_document_references.length} references`}),a&&(0,Lt.jsx)(ee,{label:"System Image Refs",value:`${n.system_image_references.length} references`}),r&&(0,Lt.jsx)(ee,{label:"System Document Refs",value:`${n.system_document_references.length} references`}),(0,Lt.jsx)(Mn,{label:"System Prompt",templateText:n.system_prompt_blueprint?.template,renderedText:u}),(0,Lt.jsx)(Mn,{label:"Prompt",templateText:n.prompt_blueprint?.template,renderedText:c})]})}var cn=J(de(),1);function ng({blueprint:e,executionData:t}){let n=e.img_gen_prompt_blueprint,o=t?.resolved_model,i=t?.rendered_prompt,a=t?.rendered_negative_prompt;return(0,cn.jsxs)(cn.Fragment,{children:[(0,cn.jsx)(ee,{label:"Model",value:o||e.img_gen_choice}),(0,cn.jsx)(Mn,{label:"Prompt",templateText:n.prompt_blueprint?.template,renderedText:i}),(0,cn.jsx)(Mn,{label:"Negative Prompt",templateText:n.negative_prompt_blueprint?.template,renderedText:a}),(0,cn.jsx)(ee,{label:"Aspect Ratio",value:e.aspect_ratio}),(0,cn.jsx)(ee,{label:"Output Format",value:e.output_format}),(0,cn.jsx)(ee,{label:"Background",value:e.background}),(0,cn.jsx)(ee,{label:"Is Raw",value:e.is_raw}),(0,cn.jsx)(ee,{label:"Seed",value:e.seed}),(0,cn.jsx)(ee,{label:"Images",value:t?.nb_images??e.output_multiplicity})]})}var fn=J(de(),1);function og({blueprint:e,executionData:t}){let n=t?.resolved_model;return(0,fn.jsxs)(fn.Fragment,{children:[(0,fn.jsx)(ee,{label:"Model",value:n||e.extract_choice}),(0,fn.jsx)(ee,{label:"Document Variable",value:e.document_stuff_name}),(0,fn.jsx)(ee,{label:"Caption Images",value:e.should_caption_images}),(0,fn.jsx)(ee,{label:"Max Page Images",value:e.max_page_images}),(0,fn.jsx)(ee,{label:"Include Page Views",value:e.should_include_page_views}),(0,fn.jsx)(ee,{label:"Page Views DPI",value:e.page_views_dpi}),(0,fn.jsx)(ee,{label:"Render JS",value:e.render_js}),(0,fn.jsx)(ee,{label:"Include Raw HTML",value:e.include_raw_html}),(0,fn.jsx)(ee,{label:"Image Variable",value:e.image_stuff_name})]})}var dn=J(de(),1);function ig({blueprint:e,executionData:t}){let n=t?.resolved_model,o=t?.rendered_query;return(0,dn.jsxs)(dn.Fragment,{children:[(0,dn.jsx)(ee,{label:"Model",value:n||e.search_choice}),(0,dn.jsx)(Mn,{label:"Search Query",templateText:e.prompt_blueprint.template,renderedText:o}),(0,dn.jsx)(ee,{label:"Max Results",value:e.max_results_override}),(0,dn.jsx)(ee,{label:"Include Images",value:e.include_images_override}),(0,dn.jsx)(ee,{label:"Structured Output",value:e.is_structured_output}),(0,dn.jsx)(ee,{label:"From Date",value:e.from_date}),(0,dn.jsx)(ee,{label:"To Date",value:e.to_date}),e.include_domains&&e.include_domains.length>0&&(0,dn.jsx)(ee,{label:"Include Domains",value:e.include_domains.join(", ")}),e.exclude_domains&&e.exclude_domains.length>0&&(0,dn.jsx)(ee,{label:"Exclude Domains",value:e.exclude_domains.join(", ")})]})}var y3=["model","llm_handle","handle","llm_name","name"];function vT(e){if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}function bT(e){if(typeof e=="string")return vT(e);if(e&&typeof e=="object")for(let t of y3){let n=vT(e[t]);if(n)return n}}var Do=J(de(),1);function ag({blueprint:e,executionData:t}){let n=t?.resolved_model,o=t?.is_multiple_output,i=t?.rendered_user_prompt,a=n||bT(e.llm_choice);return(0,Do.jsxs)(Do.Fragment,{children:[(0,Do.jsx)(ee,{label:"Model",value:a}),(0,Do.jsx)(ee,{label:"Text Variable",value:e.text_input_name}),(0,Do.jsx)(ee,{label:"Multiple Output",value:o}),(0,Do.jsx)(ee,{label:"Output Multiplicity",value:e.output_multiplicity}),(0,Do.jsx)(Mn,{label:"Prompt",templateText:void 0,renderedText:i})]})}var Le=J(de(),1);function v3(e){switch(e.method){case"from_var":{let t=`\u2190 ${e.from_path??"?"}`;return e.list_to_dict_keyed_by?`${t} (keyed by ${e.list_to_dict_keyed_by})`:t}case"fixed":return`= ${JSON.stringify(e.fixed_value)}`;case"nested":return"(nested construct)";case"template":return e.template??"(empty template)"}}var b3=60;function S3(e){return e.length>b3||e.includes(`
17
- `)}function x3({label:e,value:t}){return(0,Le.jsxs)("div",{className:"detail-field-block",children:[(0,Le.jsx)("div",{className:"detail-field-block-label",children:e}),(0,Le.jsx)("div",{className:"detail-field-block-value",children:t})]})}function ST({blueprint:e,depth:t,fieldResolutions:n}){let o=[],i=[],a=[];for(let[l,s]of Object.entries(e.fields))s.method==="template"?a.push([l,s]):s.method==="nested"?i.push([l,s]):o.push([l,s]);let r=t>0?{paddingLeft:t*12}:void 0;return(0,Le.jsxs)(Le.Fragment,{children:[o.map(([l,s])=>{let u=v3(s);return S3(u)?(0,Le.jsx)("div",{style:r,children:(0,Le.jsx)(x3,{label:l,value:u})},l):(0,Le.jsx)("div",{style:r,children:(0,Le.jsx)(ee,{label:l,value:u})},l)}),a.map(([l,s])=>{let u=n?.[l]?.rendered;return(0,Le.jsx)("div",{style:r,children:(0,Le.jsx)(Mn,{label:`Template \u2014 ${l}`,templateText:s.template??null,renderedText:u})},l)}),i.map(([l,s])=>s.nested?(0,Le.jsxs)("div",{children:[(0,Le.jsxs)("div",{className:"detail-nested-header",style:t>0?{paddingLeft:t*12}:void 0,children:[(0,Le.jsx)("span",{className:"detail-nested-header-name",children:l}),(0,Le.jsxs)("span",{className:"detail-nested-header-meta",children:["nested \xB7 ",Object.keys(s.nested.fields).length," field",Object.keys(s.nested.fields).length===1?"":"s"]})]}),(0,Le.jsx)(ST,{blueprint:s.nested,depth:t+1,fieldResolutions:null})]},l):null)]})}function rg({blueprint:e,executionData:t}){let n=t?.rendered_text,o=t?.compose_mode,i=t?.fields??null,a=e.construct_blueprint,r=a!==null&&Object.keys(a.fields).length>0;return(0,Le.jsxs)(Le.Fragment,{children:[(0,Le.jsx)(ee,{label:"Mode",value:o||(r?"construct":"template")}),(0,Le.jsx)(ee,{label:"Category",value:e.category}),(0,Le.jsx)(ee,{label:"Templating Style",value:e.templating_style}),e.template&&(0,Le.jsx)(Mn,{label:"Template",templateText:e.template,renderedText:n}),r&&(0,Le.jsxs)(Le.Fragment,{children:[(0,Le.jsx)("div",{className:"detail-section-label",children:"FIELDS"}),(0,Le.jsx)(ST,{blueprint:a,depth:0,fieldResolutions:i})]})]})}var Bt=J(de(),1);function lg({blueprint:e,executionData:t}){let n=t?.evaluated_expression,o=t?.selected_outcome;return(0,Bt.jsxs)(Bt.Fragment,{children:[(0,Bt.jsx)(eg,{label:"Expression",text:e.expression}),n&&(0,Bt.jsx)(ee,{label:"Expression Result",value:n}),(0,Bt.jsxs)("div",{children:[(0,Bt.jsx)("div",{className:"detail-section-label",children:"Outcomes"}),Object.entries(e.outcome_map).map(([i,a])=>(0,Bt.jsxs)("div",{className:"detail-kv-row",style:o===a?{background:"rgba(80,250,123,0.08)"}:void 0,children:[(0,Bt.jsx)("span",{className:"detail-kv-key",children:i}),(0,Bt.jsx)("span",{className:"detail-kv-value",style:o===a?{color:"#50FA7B"}:void 0,children:a})]},i)),(0,Bt.jsxs)("div",{className:"detail-kv-row",children:[(0,Bt.jsx)("span",{className:"detail-kv-key",children:"default"}),(0,Bt.jsx)("span",{className:"detail-kv-value",children:e.default_outcome})]})]}),(0,Bt.jsx)(ee,{label:"Alias Expression To",value:e.add_alias_from_expression_to})]})}var ri=J(de(),1);function sg({blueprint:e}){return(0,ri.jsxs)("div",{children:[(0,ri.jsx)("div",{className:"detail-section-label",children:"Steps"}),(0,ri.jsx)("div",{className:"detail-steps-list",children:e.sequential_sub_pipes.map((t,n)=>(0,ri.jsxs)("div",{className:"detail-step-item",children:[(0,ri.jsx)("span",{className:"detail-step-index",children:n+1}),(0,ri.jsx)("span",{className:"detail-step-code",children:t.pipe_code}),t.output_name&&(0,ri.jsxs)("span",{className:"detail-io-concept",children:["-> ",t.output_name]})]},n))})]})}var Dn=J(de(),1);function ug({blueprint:e}){return(0,Dn.jsxs)(Dn.Fragment,{children:[(0,Dn.jsxs)("div",{children:[(0,Dn.jsx)("div",{className:"detail-section-label",children:"Branches"}),(0,Dn.jsx)("div",{className:"detail-steps-list",children:e.parallel_sub_pipes.map((t,n)=>(0,Dn.jsxs)("div",{className:"detail-step-item",children:[(0,Dn.jsx)("span",{className:"detail-step-code",children:t.pipe_code}),t.output_name&&(0,Dn.jsxs)("span",{className:"detail-io-concept",children:["-> ",t.output_name]})]},n))})]}),(0,Dn.jsx)(ee,{label:"Add Each Output",value:e.add_each_output}),(0,Dn.jsx)(ee,{label:"Combined Output",value:e.combined_output})]})}var li=J(de(),1);function cg({blueprint:e,executionData:t}){let n=t?.item_count;return(0,li.jsxs)(li.Fragment,{children:[(0,li.jsx)(ee,{label:"Branch Pipe",value:e.branch_pipe_code}),(0,li.jsx)(ee,{label:"Input List Variable",value:e.batch_params.input_list_stuff_name}),(0,li.jsx)(ee,{label:"Input Item Variable",value:e.batch_params.input_item_stuff_name}),n!=null&&(0,li.jsx)(ee,{label:"Items Processed",value:n})]})}var xT=new Set(["PipeLLM","PipeImgGen","PipeExtract","PipeSearch","PipeStructure","PipeCompose","PipeSequence","PipeParallel","PipeCondition","PipeBatch"]);function fg(e,t){return xT.has(e)?!t:!0}var oe=J(de(),1),_3={PipeLLM:"LLM",PipeExtract:"Extract",PipeCompose:"Compose",PipeImgGen:"ImgGen",PipeSearch:"Search",PipeFunc:"Func",PipeStructure:"Structure",PipeSignature:"Signature",PipeSequence:"Seq",PipeParallel:"Par",PipeCondition:"Cond",PipeBatch:"Batch"},E3=new Set(["PipeSequence","PipeParallel","PipeCondition","PipeBatch"]),T3={succeeded:"#50FA7B",failed:"#FF5555",running:"#8BE9FD",scheduled:"#6272a4",skipped:"#6272a4",canceled:"#6272a4"};function ET({node:e,spec:t,onConceptClick:n}){let o=e.pipe_type,i=E3.has(o),a=S1(t),r=!a&&!x1(t),l=_3[o],s=e.status,u=T3[s]??"#6272a4",c=_T.default.useMemo(()=>{if(!e.pipe_code||!t.pipe_registry)return;let v=`${t.pipeline_ref?.domain??""}.${e.pipe_code}`,b=GE(t,v);if(b)return b;for(let[x,g]of Object.entries(t.pipe_registry))if(x.endsWith(`.${e.pipe_code}`))return g},[e.pipe_code,t]),d=e.io?.inputs??[],f=e.io?.outputs??[],p=c?.description??e.description;return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)("div",{className:"detail-sticky-header",children:[(0,oe.jsxs)("div",{className:"detail-header",children:[(0,oe.jsx)("span",{className:`detail-badge ${i?"detail-badge--controller":"detail-badge--operator"}`,children:l}),(0,oe.jsx)("span",{className:`detail-pipe-code ${i?"detail-pipe-code--controller":""}`,children:e.pipe_code})]}),!a&&(0,oe.jsxs)("div",{className:"detail-status",children:[(0,oe.jsx)("span",{className:"detail-status-dot",style:{background:u}}),(0,oe.jsx)("span",{className:"detail-status-label",style:{color:u},children:s}),e.timing?.duration!=null&&(0,oe.jsx)("span",{className:"detail-duration",children:Jh(e.timing.duration)})]}),p&&(0,oe.jsx)("div",{className:"detail-description",children:p}),d.length>0&&(0,oe.jsxs)("div",{children:[(0,oe.jsx)("div",{className:"detail-section-label",children:"Inputs"}),(0,oe.jsx)("div",{className:"detail-io-list",children:d.map((v,b)=>(0,oe.jsxs)("div",{className:"detail-io-pill",style:{cursor:v.concept&&n?"pointer":void 0},onClick:()=>v.concept&&n?.(v.concept),children:[(0,oe.jsx)("span",{className:"detail-io-name",children:v.name}),v.concept&&(0,oe.jsx)("span",{className:"detail-io-concept",children:v.concept})]},b))})]}),f.length>0&&(0,oe.jsxs)("div",{children:[(0,oe.jsx)("div",{className:"detail-section-label",children:"Output"}),(0,oe.jsx)("div",{className:"detail-io-list",children:f.map((v,b)=>(0,oe.jsxs)("div",{className:"detail-io-pill",style:{cursor:v.concept&&n?"pointer":void 0},onClick:()=>v.concept&&n?.(v.concept),children:[(0,oe.jsx)("span",{className:"detail-io-name",children:v.name}),v.concept&&(0,oe.jsx)("span",{className:"detail-io-concept",children:v.concept})]},b))})]}),(d.length>0||f.length>0)&&(0,oe.jsx)("div",{style:{borderTop:"1px solid rgba(255,255,255,0.06)",margin:"4px 0"}})]}),c&&(0,oe.jsx)(N3,{blueprint:c,executionData:r?e.execution_data:void 0}),r&&e.execution_data&&Object.keys(e.execution_data).length>0&&(0,oe.jsx)(C3,{executionData:e.execution_data,pipeType:o,hasBlueprint:!!c}),e.error&&(0,oe.jsxs)("div",{className:"detail-error",children:[(0,oe.jsx)("div",{className:"detail-error-type",children:e.error.error_type}),(0,oe.jsx)("div",{className:"detail-error-message",children:e.error.message}),e.error.stack&&(0,oe.jsx)("div",{className:"detail-error-stack",children:e.error.stack})]}),r&&e.metrics&&Object.keys(e.metrics).length>0&&(0,oe.jsxs)("div",{children:[(0,oe.jsx)("div",{className:"detail-section-label",children:"Metrics"}),Object.entries(e.metrics).map(([v,b])=>(0,oe.jsx)(ee,{label:v,value:typeof b=="number"?b.toLocaleString():String(b)},v))]}),e.tags&&Object.keys(e.tags).length>0&&(0,oe.jsxs)("div",{children:[(0,oe.jsx)("div",{className:"detail-section-label",children:"Tags"}),(0,oe.jsx)("div",{className:"detail-tags",children:Object.entries(e.tags).map(([v,b])=>(0,oe.jsxs)("span",{className:"detail-tag",children:[(0,oe.jsxs)("span",{className:"detail-tag-key",children:[v,": "]}),(0,oe.jsx)("span",{className:"detail-tag-value",children:b})]},v))})]}),!c&&(0,oe.jsx)("div",{className:"detail-not-available",children:"Blueprint not available"})]})}function N3({blueprint:e,executionData:t}){switch(e.type){case"PipeLLM":return(0,oe.jsx)(tg,{blueprint:e,executionData:t});case"PipeImgGen":return(0,oe.jsx)(ng,{blueprint:e,executionData:t});case"PipeCompose":return(0,oe.jsx)(rg,{blueprint:e,executionData:t});case"PipeExtract":return(0,oe.jsx)(og,{blueprint:e,executionData:t});case"PipeSearch":return(0,oe.jsx)(ig,{blueprint:e,executionData:t});case"PipeStructure":return(0,oe.jsx)(ag,{blueprint:e,executionData:t});case"PipeSequence":return(0,oe.jsx)(sg,{blueprint:e,executionData:t});case"PipeParallel":return(0,oe.jsx)(ug,{blueprint:e,executionData:t});case"PipeCondition":return(0,oe.jsx)(lg,{blueprint:e,executionData:t});case"PipeBatch":return(0,oe.jsx)(cg,{blueprint:e,executionData:t});case"PipeFunc":return null;case"PipeSignature":return(0,oe.jsx)("div",{className:"detail-not-available",children:"Signature stub \u2014 declared but not yet implemented."});default:return null}}function C3({executionData:e,pipeType:t,hasBlueprint:n}){return fg(t,n)?(0,oe.jsx)(w3,{data:e}):null}function w3({data:e}){let t=Object.entries(e);return t.length===0?null:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("div",{className:"detail-section-label",children:"Execution"}),t.map(([n,o])=>(0,oe.jsx)(ee,{label:n,value:String(o)},n))]})}var dg=J(Et(),1);var Se=J(de(),1);function pg({concept:e,ioData:t,isDryRun:n,resolveStorageUrl:o,canEmbedPdf:i,onOpenExternally:a,instanceKey:r}){return(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsxs)("div",{className:"detail-header",children:[(0,Se.jsx)("span",{className:"detail-concept-code",children:e.code}),(0,Se.jsx)("span",{className:"detail-concept-domain",children:e.domain_code})]}),e.description&&(0,Se.jsx)("div",{className:"detail-description",children:e.description}),e.refines&&(0,Se.jsxs)("div",{className:"detail-refines",children:["refines ",(0,Se.jsx)("span",{className:"detail-refines-code",children:e.refines})]}),(0,Se.jsx)(A3,{concept:e,ioData:t,isDryRun:n,resolveStorageUrl:o,canEmbedPdf:i,onOpenExternally:a},r??`${e.code}:${t&&"digest"in t?t.digest:t?.name??""}`)]})}function A3({concept:e,ioData:t,isDryRun:n,resolveStorageUrl:o,canEmbedPdf:i,onOpenExternally:a}){let r=!!t&&!n,[l,s]=dg.default.useState(r?"data":"structure"),u=dg.default.useId(),c=b=>`${u}-tab-${b}`,d=b=>`${u}-tabpanel-${b}`,f=e.json_schema?(0,Se.jsxs)("div",{children:[(0,Se.jsx)("div",{className:"detail-section-label",children:"Structure"}),(0,Se.jsx)(M3,{schema:e.json_schema,isDryRun:n})]}):(0,Se.jsx)("div",{className:"detail-not-available",children:"Schema not available"});if(!r)return f;let p=b=>{let x;switch(b.key){case"ArrowLeft":case"ArrowRight":x=l==="data"?"structure":"data";break;case"Home":x="data";break;case"End":x="structure";break;default:return}b.preventDefault(),s(x),document.getElementById(c(x))?.focus()},v=(b,x)=>(0,Se.jsx)("button",{type:"button",role:"tab",id:c(b),"aria-selected":l===b,"aria-controls":d(b),tabIndex:l===b?0:-1,className:`detail-tab ${l===b?"detail-tab--active":""}`,onClick:()=>s(b),onKeyDown:p,children:x});return(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsxs)("div",{className:"detail-tabs",role:"tablist","aria-label":"Concept views",children:[v("data","Data"),v("structure","Structure")]}),(0,Se.jsx)("div",{role:"tabpanel",id:d(l),"aria-labelledby":c(l),children:l==="data"?(0,Se.jsx)(qf,{stuff:R3(t),resolveStorageUrl:o,canEmbedPdf:i,onOpenExternally:a}):f})]})}function M3({schema:e,isDryRun:t}){let n=e.properties,o=new Set(e.required??[]);if(!n||Object.keys(n).length===0)return(0,Se.jsx)("div",{className:"detail-not-available",children:"No fields defined"});let i=Object.entries(n),a=t?i.filter(([r])=>o.has(r)):i;return(0,Se.jsxs)("table",{className:"detail-schema-table",children:[(0,Se.jsx)("thead",{children:(0,Se.jsxs)("tr",{children:[(0,Se.jsx)("th",{children:"Field"}),(0,Se.jsx)("th",{children:"Type"}),(0,Se.jsx)("th",{}),(0,Se.jsx)("th",{children:"Description"})]})}),(0,Se.jsx)("tbody",{children:a.map(([r,l])=>(0,Se.jsxs)("tr",{children:[(0,Se.jsx)("td",{className:"detail-schema-field",children:r}),(0,Se.jsx)("td",{className:"detail-schema-type",children:D3(l)}),(0,Se.jsx)("td",{children:o.has(r)&&(0,Se.jsx)("span",{className:"detail-schema-required",children:"req"})}),(0,Se.jsx)("td",{children:l.description??""})]},r))})]})}function D3(e){return typeof e.type=="string"?e.type:Array.isArray(e.type)?e.type.join(" | "):e.anyOf?"union":e.allOf?"all":typeof e.$ref=="string"?e.$ref.split("/").pop()??"(unresolved type)":"(unresolved type)"}function R3(e){return O3(e)?e:{digest:e.digest??"",name:e.name,concept:e.concept,contentType:e.content_type,data:e.data,dataText:e.data_text,dataHtml:e.data_html}}function O3(e){return"contentType"in e||"dataText"in e||"dataHtml"in e}function TT(e){return e.map(t=>({id:t.id,type:t.type,data:t.data,position:t.position,style:t.style,sourcePosition:t.sourcePosition,targetPosition:t.targetPosition,parentId:t.parentId,extent:t.extent,selected:t.selected}))}function cl(e){return e.map(t=>({id:t.id,source:t.source,target:t.target,type:t.type,animated:t.animated,label:t.label,labelStyle:t.labelStyle,labelBgStyle:t.labelBgStyle,labelBgPadding:t.labelBgPadding,labelBgBorderRadius:t.labelBgBorderRadius,style:t.style,markerEnd:t.markerEnd}))}var z3=7,L3=48,P3=140;function B3(e,t,n){let o=[],i=[],a=Eo(e),r=new Set;for(let c of e.edges)c.kind==="parallel_combine"&&c.target_stuff_digest&&r.add(c.target_stuff_digest);let l=new Set;for(let c of Object.values(t.stuffProducers))l.add(c);for(let c of Object.values(t.stuffConsumers))for(let d of c)l.add(d);for(let c of e.nodes){if(!l.has(c.id))continue;let d=Yr(c,`nodes[${c.id}]`),f=d.status==="failed",p=d.pipe_code,v=Gf(d,a);o.push({id:d.id,type:Ur,data:{labelDescriptor:{kind:"pipe",label:p,isFailed:f},nodeData:d,isPipe:!0,isStuff:!1,labelText:p,pipeCode:v.pipeCode,pipeType:d.pipe_type,graphMode:a,pipeCardData:v},position:{x:0,y:0}})}for(let[c,d]of Object.entries(t.stuffRegistry)){let f=Ui(c),p=d.name,v=d.concept||"",b=Math.max(p.length,v.length)*z3+L3,x=Math.max(P3,b),g=r.has(c),h=!t.stuffProducers[c]&&!g,m=!h&&!g&&!t.stuffConsumers[c]?.length,y=g?"combined":h?"input":m?"output":void 0,S=h?"var(--color-stuff-input-border, #50FA7B)":m?"var(--color-stuff-output-border, #a78bfa)":g?"var(--color-parallel-combine)":"var(--color-stuff-border)";o.push({id:f,type:v1,data:{labelDescriptor:{kind:"stuff",label:p,concept:v},isStuff:!0,isPipe:!1,labelText:p,stuffRole:y,stuffDigest:c},position:{x:0,y:0},style:{background:"var(--color-stuff-bg)",border:`2px solid ${S}`,borderRadius:"999px",padding:"0",width:x+"px",boxShadow:"var(--shadow-md)"}})}let s=0;for(let[c,d]of Object.entries(t.stuffProducers)){let f=Ui(c);i.push({id:"edge_"+s++,source:d,target:f,type:n,animated:!1,style:{stroke:"var(--color-edge)",strokeWidth:2},markerEnd:{type:xa,color:"var(--color-edge)"}})}for(let[c,d]of Object.entries(t.stuffConsumers)){let f=Ui(c);for(let p of d)i.push({id:"edge_"+s++,source:f,target:p,type:n,animated:!1,style:{stroke:"var(--color-edge)",strokeWidth:2},markerEnd:{type:xa,color:"var(--color-edge)"}})}for(let c of e.edges){if(c.kind!=="parallel_combine"||!c.source_stuff_digest||!c.target_stuff_digest||!t.stuffRegistry[c.source_stuff_digest]||!t.stuffRegistry[c.target_stuff_digest])continue;let d=Ui(c.source_stuff_digest),f=Ui(c.target_stuff_digest);i.push({id:c.id,source:d,target:f,type:"smoothstep",animated:!1,style:{stroke:"var(--color-parallel-combine)",strokeWidth:2,strokeDasharray:"5,5"},markerEnd:{type:xa,color:"var(--color-parallel-combine)"}})}for(let c of e.edges){if(c.kind!=="batch_item"&&c.kind!=="batch_aggregate"||!c.source_stuff_digest||!c.target_stuff_digest||!t.stuffRegistry[c.source_stuff_digest]||!t.stuffRegistry[c.target_stuff_digest])continue;let d=Ui(c.source_stuff_digest),f=Ui(c.target_stuff_digest),p=c.kind==="batch_item";i.push({id:c.id,source:d,target:f,type:n,animated:!1,_batchEdge:!0,label:c.label||"",labelStyle:{fontSize:"10px",fontFamily:"var(--font-mono)",fill:p?"var(--color-batch-item)":"var(--color-batch-aggregate)"},labelBgStyle:{fill:"var(--color-bg)",fillOpacity:.9},style:{stroke:p?"var(--color-batch-item)":"var(--color-batch-aggregate)",strokeWidth:2,strokeDasharray:"5,5"},markerEnd:{type:xa,color:p?"var(--color-batch-item)":"var(--color-batch-aggregate)"}})}let u=$n(e,t);for(let c of i){let d=u[c.source]||null,f=u[c.target]||null;d&&f&&d!==f&&(c._crossGroup=!0,c.style={...c.style,strokeWidth:1.5,opacity:.65})}for(let c of i)c._batchEdge&&(c.style={...c.style,opacity:.7});return{nodes:o,edges:i}}function NT(e,t){if(e){let n=kE(e);if(n&&(Object.keys(n.stuffProducers).length>0||Object.keys(n.stuffConsumers).length>0))return{graphData:B3(e,n,t),analysis:n}}return{graphData:{nodes:[],edges:[]},analysis:null}}var H3=window.ELK,CT=H3;function k3(e){switch(e){case"LR":return"RIGHT";case"RL":return"LEFT";case"BT":return"UP";default:return"DOWN"}}var G3="_in",I3="_out";function hg(e){return e+G3}function gg(e){return e+I3}function U3(e,t,n){let o={LR:{inSide:"WEST",outSide:"EAST"},RL:{inSide:"EAST",outSide:"WEST"},TB:{inSide:"NORTH",outSide:"SOUTH"},BT:{inSide:"SOUTH",outSide:"NORTH"}},{inSide:i,outSide:a}=o[n],r=n==="LR"||n==="RL",l=r?n==="LR"?0:t.width:t.width/2,s=r?t.height/2:n==="TB"?0:t.height,u=r?n==="LR"?t.width:0:t.width/2,c=r?t.height/2:n==="TB"?t.height:0;return[{id:hg(e),x:l,y:s,width:1,height:1,layoutOptions:{"elk.port.side":i}},{id:gg(e),x:u,y:c,width:1,height:1,layoutOptions:{"elk.port.side":a}}]}var V3=320,DT=28,Y3=24,mg=8,X3=22,q3=50,Z3=16,j3=3,wT=38,AT=30,jf=22,$3=140,F3=100,K3=17,Q3=58,W3=5.5,J3=5,e4=4.5,t4=4;function n4(e,t,n){if(!e)return 0;if(!t)return 1;let o=n-DT,i=Math.max(1,Math.floor(o/W3)),a=Math.ceil(e.length/i);return Math.min(j3,Math.max(1,a))}function o4(e,t){let n=Math.min($3,Math.ceil(e.length*J3)),o=Math.min(F3,Math.ceil(t.length*e4));return n+o+K3}function MT(e,t){if(e.length===0)return 0;let n=t-DT-Q3,o=1,i=0;for(let a of e){let r=o4(a.name,a.concept);if(i===0){i=r;continue}i+r<=n?i+=r:(o+=1,i=r)}return o}function fl(e,t){let n=e.data||{},o=n.isStuff,i=n.labelText||"",a=e.type===Ur,r=t?180:280,l=t?240:400,s=Math.max(180,Math.min(l,i.length*8+60)),u;o?u=Math.max(180,s):a&&n.pipeCardData?u=l:u=Math.max(a?r:200,s);let c;if(o)c=60;else if(a&&n.pipeCardData){let d=n.pipeCardData,f=d.inputs??[],p=d.outputs??[],v=d.description||n.nodeData?.description||"",b=Y3+(t?q3:X3),x=n4(v,t,u);x>0&&(b+=mg+x*Z3);let g=f.slice(0,t4);if(g.length>0)if(b+=mg,t)b+=wT+(g.length-1)*jf;else{let h=MT(g,u);b+=AT+(h-1)*jf}if(p.length>0)if(b+=mg,t)b+=wT+(p.length-1)*jf;else{let h=MT(p,u);b+=AT+(h-1)*jf}c=Math.min(V3,b)}else c=a?120:70;return{width:u,height:c}}function i4(e,t){let n={},o=new Set;function i(a){if(n[a]!==void 0)return n[a];if(o.has(a))return 0;o.add(a);let r=t[a]||[],l=-1;for(let s of r)e.has(s)&&(l=Math.max(l,i(s)));return o.delete(a),n[a]=l+1,n[a]}for(let a of e)i(a);return n}function $f(e,t,n){return{id:e,width:t.width,height:t.height,ports:U3(e,t,n),layoutOptions:{"elk.portConstraints":"FIXED_POS"}}}function RT(e,t,n,o,i,a){let r=i==="LR"||i==="RL",l=a?.nodesep??80,s=a?.ranksep??70,u=k3(i),c="30",d={"elk.algorithm":"layered","elk.direction":u,"elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.spacing.nodeNode":String(l),"elk.layered.spacing.nodeNodeBetweenLayers":String(s),"elk.spacing.edgeNode":c,"elk.spacing.edgeEdge":"20","elk.layered.spacing.edgeNodeBetweenLayers":c,"elk.layered.spacing.edgeEdgeBetweenLayers":"15","elk.layered.nodePlacement.favorStraightEdges":"true"};if(!n||!o||o.controllerNodeIds.size===0){let S={},E=e.map(w=>{let C=fl(w,r);return S[w.id]=C,$f(w.id,C,i)}),_=t.map(w=>({id:w.id,sources:[gg(w.source)],targets:[hg(w.target)]}));return{elkGraph:{id:"root",layoutOptions:d,children:E,edges:_},dimensionMap:S}}let f=$n(n,o),p=i4(o.controllerNodeIds,o.containmentTree),v={},b=new Map;for(let S of e)b.set(S.id,S);let x={},g=Array.from(o.controllerNodeIds);g.sort((S,E)=>(p[S]??0)-(p[E]??0));for(let S of g){let _=1+(p[S]??0)*.15,w=Math.round(Bc*_),C=Math.round(Hc*_),P=Math.round(kc*_),M={"elk.padding":`[top=${C},left=${w},bottom=${P},right=${w}]`,"elk.spacing.nodeNode":String(l),"elk.layered.spacing.nodeNodeBetweenLayers":String(s),"elk.spacing.edgeNode":c,"elk.layered.spacing.edgeNodeBetweenLayers":c},z=[],I=o.containmentTree[S]||[];for(let T of I)if(o.controllerNodeIds.has(T)){let D=x[T];D&&z.push(D)}else{let D=b.get(T);if(D){let A=fl(D,r);v[T]=A,z.push($f(T,A,i))}}for(let T of e)if(T.data.isStuff&&f[T.id]===S&&!z.some(D=>D.id===T.id)){let D=fl(T,r);v[T.id]=D,z.push($f(T.id,D,i))}x[S]={id:S,layoutOptions:M,children:z}}let h=[];for(let S of g)if(!f[S]){let E=x[S];E&&h.push(E)}for(let S of e)if(!f[S.id]&&!o.controllerNodeIds.has(S.id)){let E=fl(S,r);v[S.id]=E,h.push($f(S.id,E,i))}let m=new Set(e.map(S=>S.id)),y=t.filter(S=>m.has(S.source)&&m.has(S.target)).map(S=>({id:S.id,sources:[gg(S.source)],targets:[hg(S.target)]}));return{elkGraph:{id:"root",layoutOptions:d,children:h,edges:y},dimensionMap:v}}function OT(e){let t={};function n(o,i,a){let r=i+(o.x??0),l=a+(o.y??0);o.id!=="root"&&(t[o.id]={x:r,y:l,width:o.width??0,height:o.height??0});for(let s of o.children??[])n(s,r,l)}return n(e,0,0),t}var yg=null;function a4(){return yg||(yg=new CT),yg}async function Ff(e,t,n,o,i,a){if(e.length===0)return{nodes:[],edges:t,controllerPositions:{}};let r=n==="LR"||n==="RL",{elkGraph:l,dimensionMap:s}=RT(e,t,i??null,a??null,n,o),u=await a4().layout(l),c=OT(u),d={};if(a)for(let p of a.controllerNodeIds)c[p]&&(d[p]=c[p]);return{nodes:e.map(p=>{let v=c[p.id],b=s[p.id]??fl(p,r),x=b.width,g=b.height,h=p.data.pipeCardData,y=h?{...h,direction:r?"LR":"TB"}:void 0;return{...p,data:{...p.data,_estimatedWidth:x,_estimatedHeight:g,pipeCardData:y},style:{...p.style,width:x+"px",height:g+"px"},position:{x:v?v.x:0,y:v?v.y:0},sourcePosition:r?n==="LR"?"right":"left":n==="TB"?"bottom":"top",targetPosition:r?n==="LR"?"left":"right":n==="TB"?"top":"bottom"}}),edges:t,controllerPositions:d}}var tu=5;function r4(e,t,n){let o=new Set,i=[e];for(;i.length>0;){let a=i.pop();for(let r of t[a]||[])o.add(r),n.has(r)&&i.push(r)}return o}function l4(e,t,n,o){let i={},a=Eo(e);for(let b of n)i[b.id]=b;let r={};for(let b of e.nodes)t.controllerNodeIds.has(b.id)&&(r[b.id]=Yr(b,`nodes[${b.id}]`));let l={},s=new Set;function u(b){if(l[b]!==void 0)return l[b];if(s.has(b))throw new Error(`Cycle detected in containment tree: controller "${b}" is part of a containment cycle`);s.add(b);let x=t.containmentTree[b]||[],g=-1;for(let h of x)t.controllerNodeIds.has(h)&&(g=Math.max(g,u(h)));return s.delete(b),l[b]=g+1,l[b]}let c=$n(e,t),d={};for(let[b,x]of Object.entries(c))Vr(b)&&i[b]&&(d[x]||(d[x]=[]),d[x].push(b));let f=Array.from(t.controllerNodeIds);for(let b of f)u(b);f.sort((b,x)=>l[b]-l[x]);let p=[],v={};for(let b of f){let g=(t.containmentTree[b]||[]).filter(z=>i[z]),h=d[b]||[],m=[...g,...h];if(m.length===0)continue;let y,S,E,_,w=o?.[b];if(w)y=w.x,S=w.y,E=w.width,_=w.height;else{let z=1/0,I=1/0,T=-1/0,D=-1/0;for(let G of m){let X=i[G],F=X.position,K=T1(X),$=N1(X);z=Math.min(z,F.x),I=Math.min(I,F.y),T=Math.max(T,F.x+K),D=Math.max(D,F.y+$)}let R=1+(l[b]??0)*.15,O=Math.round(Bc*R),L=Math.round(Hc*R),Y=Math.round(kc*R);y=z-O,S=I-L,E=T-z+2*O,_=D-I+L+Y}let C=r[b];if(!C)throw new Ss(`nodes[${b}]`,`controller "${b}" is referenced by a "contains" edge but has no corresponding node in graphspec.nodes`);let P=C.pipe_code,M={id:b,type:b1,data:{label:P,pipeType:C.pipe_type,isController:!0,isPipe:!1,isStuff:!1,pipeCode:P,labelText:P,graphMode:a},position:{x:y,y:S},style:{width:E+"px",height:_+"px",padding:"0"}};p.push(M),i[b]=M;for(let z of m)v[z]=b}for(let[b,x]of Object.entries(v)){let g=i[b],h=i[x];!g||!h||(g.position={x:g.position.x-h.position.x,y:g.position.y-h.position.y},g.parentId=x,g.extent="parent")}return p}function Ga(e,t,n,o,i,a,r,l,s){if(!i||!o||!n)return{nodes:e,edges:t};let u={},c=new Set,d={};for(let y of n.nodes)o.controllerNodeIds.has(y.id)&&(d[y.id]=y.pipe_type);for(let y of o.controllerNodeIds){let S=o.containmentTree[y]||[];u[y]=S.length;let E=d[y];(E==="PipeParallel"||E==="PipeBatch")&&S.length>tu&&!a?.has(y)&&c.add(y)}let f=e,p=t;if(c.size>0){let y=new Set;for(let E of c){let w=(o.containmentTree[E]||[]).slice(tu);for(let C of w)if(y.add(C),o.controllerNodeIds.has(C))for(let P of r4(C,o.containmentTree,o.controllerNodeIds))y.add(P)}let S=$n(n,o);for(let E of e){if(!Vr(E.id)||y.has(E.id))continue;let _=S[E.id];if(!_||!c.has(_)&&!y.has(_))continue;let w=t.filter(C=>{if(C.source!==E.id&&C.target!==E.id)return!1;let P=C.source===E.id?C.target:C.source;return!Vr(P)});(w.length===0||w.every(C=>{let P=C.source===E.id?C.target:C.source;return y.has(P)}))&&y.add(E.id)}f=e.filter(E=>!y.has(E.id)),p=t.filter(E=>!y.has(E.source)&&!y.has(E.target))}let v=l4(n,o,f,l);if(v.length===0)return{nodes:f,edges:p};for(let y of v){let S=u[y.id]??0,E=c.has(y.id);if(y.data.childCount=S,y.data.isCollapsed=E,r){let _=y.id;y.data.onToggleCollapse=()=>r(_)}if(s){let _=y.id;y.data.onToggleFold=w=>s(_,w)}}let b=[...v,...f],x={};for(let y of b)x[y.id]=y;let g={},h=new Set;function m(y){if(g[y]!==void 0)return g[y];if(h.has(y))throw new Error(`Cycle detected in node parent chain: node "${y}" references itself as an ancestor`);h.add(y);let S=x[y];return g[y]=S&&S.parentId?1+m(S.parentId):0,h.delete(y),g[y]}for(let y of b)m(y.id);return b.sort((y,S)=>g[y.id]-g[S.id]),{nodes:b,edges:p}}var zT={"--font-sans":'"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',"--font-mono":'"JetBrains Mono", "Monaco", "Menlo", monospace'},s4={...zT,"--surface-page":"#0a0a0a","--surface-panel":"#111118","--surface-overlay":"rgba(17, 17, 24, 0.8)","--surface-overlay-hover":"rgba(30, 30, 40, 0.9)","--surface-overlay-disabled":"rgba(17, 17, 24, 0.6)","--surface-elevated":"rgba(255, 255, 255, 0.06)","--surface-elevated-hover":"rgba(255, 255, 255, 0.1)","--surface-sunken":"rgba(255, 255, 255, 0.03)","--surface-pill":"rgba(255, 255, 255, 0.06)","--surface-pill-border":"rgba(255, 255, 255, 0.08)","--border-subtle":"rgba(255, 255, 255, 0.06)","--border-default":"rgba(255, 255, 255, 0.1)","--border-strong":"rgba(255, 255, 255, 0.18)","--border-dashed":"rgba(255, 255, 255, 0.15)","--text-primary":"#f8fafc","--text-default":"#e2e8f0","--text-secondary":"#cbd5e1","--text-muted":"#94a3b8","--text-dim":"#64748b","--text-on-accent":"#0e0e0e","--shadow-sm":"0 2px 8px rgba(0, 0, 0, 0.4)","--shadow-md":"0 4px 16px rgba(0, 0, 0, 0.6)","--shadow-lg":"0 8px 24px rgba(0, 0, 0, 0.5)","--focus-ring":"rgba(59, 130, 246, 0.6)","--color-pipe":"#ff6b6b","--color-pipe-bg":"rgba(224,108,117,0.18)","--color-pipe-text":"#ffffff","--color-stuff":"#4ECDC4","--color-stuff-bg":"rgba(78,205,196,0.12)","--color-stuff-border":"#9ddcfd","--color-stuff-text":"#98FB98","--color-stuff-text-dim":"#9ddcfd","--color-edge":"#FFFACD","--color-batch-item":"#bd93f9","--color-batch-aggregate":"#50fa7b","--color-parallel-combine":"#d6a4ff","--color-success":"#50FA7B","--color-success-bg":"rgba(80,250,123,0.15)","--color-error":"#FF5555","--color-error-bg":"rgba(255,85,85,0.15)","--color-error-border":"rgba(255,85,85,0.2)","--color-accent":"#8BE9FD","--color-accent-strong":"#3b82f6","--color-warning":"#FFB86C","--ctrl-sequence-border":"rgba(148, 163, 184, 0.25)","--ctrl-sequence-bg":"rgba(148, 163, 184, 0.03)","--ctrl-sequence-text":"#94a3b8","--ctrl-parallel-border":"rgba(139, 233, 253, 0.35)","--ctrl-parallel-bg":"rgba(139, 233, 253, 0.03)","--ctrl-parallel-text":"#8be9fd","--ctrl-condition-border":"rgba(251, 191, 36, 0.35)","--ctrl-condition-bg":"rgba(251, 191, 36, 0.03)","--ctrl-condition-text":"#fbbf24","--ctrl-batch-border":"rgba(167, 139, 250, 0.35)","--ctrl-batch-bg":"rgba(167, 139, 250, 0.03)","--ctrl-batch-text":"#a78bfa","--ctrl-folded-bg":"rgba(148, 163, 184, 0.25)","--ctrl-folded-border":"rgba(148, 163, 184, 0.4)","--color-bg":"#0a0a0a","--color-bg-dots":"rgba(255, 255, 255, 0.35)","--color-text-muted":"#94a3b8","--color-controller-text":"#94a3b8"},u4={...zT,"--surface-page":"#f8fafc","--surface-panel":"#ffffff","--surface-overlay":"rgba(255, 255, 255, 0.92)","--surface-overlay-hover":"rgba(241, 245, 249, 0.96)","--surface-overlay-disabled":"rgba(255, 255, 255, 0.7)","--surface-elevated":"rgba(15, 23, 42, 0.05)","--surface-elevated-hover":"rgba(15, 23, 42, 0.09)","--surface-sunken":"rgba(15, 23, 42, 0.03)","--surface-pill":"rgba(15, 23, 42, 0.05)","--surface-pill-border":"rgba(15, 23, 42, 0.1)","--border-subtle":"rgba(15, 23, 42, 0.08)","--border-default":"rgba(15, 23, 42, 0.12)","--border-strong":"rgba(15, 23, 42, 0.22)","--border-dashed":"rgba(15, 23, 42, 0.18)","--text-primary":"#020617","--text-default":"#0f172a","--text-secondary":"#1e293b","--text-muted":"#475569","--text-dim":"#64748b","--text-on-accent":"#ffffff","--shadow-sm":"0 2px 8px rgba(15, 23, 42, 0.08)","--shadow-md":"0 4px 16px rgba(15, 23, 42, 0.14)","--shadow-lg":"0 8px 24px rgba(15, 23, 42, 0.15)","--focus-ring":"rgba(2, 132, 199, 0.5)","--color-pipe":"#dc2626","--color-pipe-bg":"rgba(220, 38, 38, 0.1)","--color-pipe-text":"#ffffff","--color-stuff":"#0891b2","--color-stuff-bg":"rgba(8, 145, 178, 0.08)","--color-stuff-border":"#0e7490","--color-stuff-text":"#0f172a","--color-stuff-text-dim":"#475569","--color-edge":"#64748b","--color-batch-item":"#7c3aed","--color-batch-aggregate":"#15803d","--color-parallel-combine":"#6d28d9","--color-success":"#15803d","--color-success-bg":"rgba(21, 128, 61, 0.12)","--color-error":"#dc2626","--color-error-bg":"rgba(220, 38, 38, 0.1)","--color-error-border":"rgba(220, 38, 38, 0.25)","--color-accent":"#0284c7","--color-accent-strong":"#0284c7","--color-warning":"#d97706","--ctrl-sequence-border":"rgba(71, 85, 105, 0.3)","--ctrl-sequence-bg":"rgba(71, 85, 105, 0.04)","--ctrl-sequence-text":"#475569","--ctrl-parallel-border":"rgba(8, 145, 178, 0.4)","--ctrl-parallel-bg":"rgba(8, 145, 178, 0.05)","--ctrl-parallel-text":"#0e7490","--ctrl-condition-border":"rgba(217, 119, 6, 0.4)","--ctrl-condition-bg":"rgba(217, 119, 6, 0.05)","--ctrl-condition-text":"#b45309","--ctrl-batch-border":"rgba(124, 58, 237, 0.4)","--ctrl-batch-bg":"rgba(124, 58, 237, 0.05)","--ctrl-batch-text":"#6d28d9","--ctrl-folded-bg":"rgba(71, 85, 105, 0.18)","--ctrl-folded-border":"rgba(71, 85, 105, 0.35)","--color-bg":"#f8fafc","--color-bg-dots":"rgba(15, 23, 42, 0.18)","--color-text-muted":"#475569","--color-controller-text":"#475569"};function Kf(e){return e===Sa.LIGHT?u4:s4}var Ia={direction:"LR",showControllers:!1,foldMode:no.EXPANDED,theme:St.SYSTEM,toolbarPosition:Je.TOP_RIGHT,nodesep:50,ranksep:100,edgeType:Pc.DEFAULT,initialZoom:null,panToTop:!0};var Ua=J(de(),1);function c4(e){return e.kind==="pipe"?(0,Ua.jsx)("div",{style:{padding:"10px 14px",display:"flex",flexDirection:"column",gap:"2px",textAlign:"center",width:"100%",boxSizing:"border-box",minWidth:0},title:e.label,children:(0,Ua.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:"13px",fontWeight:600,color:"var(--color-pipe-text)",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label})}):(0,Ua.jsxs)("div",{style:{padding:"8px 24px",display:"flex",flexDirection:"column",alignItems:"center",gap:"2px",textAlign:"center",width:"100%",boxSizing:"border-box",minWidth:0},title:e.concept?`${e.label}: ${e.concept}`:e.label,children:[(0,Ua.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:"12px",fontWeight:600,color:"var(--color-stuff-text)",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label}),e.concept&&(0,Ua.jsx)("span",{style:{fontSize:"14px",color:"var(--color-stuff-text-dim)",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.concept})]})}function LT(e){return e.map(t=>t.data.labelDescriptor?{...t,data:{...t.data,label:c4(t.data.labelDescriptor)}}:t)}var dl=J(Et(),1);var Rn=J(de(),1);function Qf(e,t){let n=t===1?"1 issue":`${t} issues`;switch(e){case ln.VALIDATING:return t>0?`Validating method\u2026 \u2014 ${n}`:"Validating method\u2026";case ln.VALID:return t>0?`Method is valid \u2014 ${n}`:"Method is valid";case ln.INVALID:return`Method is invalid \u2014 ${n}`;case ln.ERROR:return"Validation could not run";default:return e}}function PT(e){switch(e){case Je.TOP_LEFT:case Je.TOP_CENTER:return"down-start";case Je.TOP_RIGHT:return"down-end";case Je.BOTTOM_LEFT:case Je.BOTTOM_CENTER:return"up-start";case Je.BOTTOM_RIGHT:return"up-end";case Je.CENTER_LEFT:return"side-end";case Je.CENTER_RIGHT:return"side-start";default:return e}}function f4(e){switch(e){case ln.VALIDATING:return"Validating\u2026";case ln.VALID:return"No issues found.";case ln.INVALID:return"No details available.";case ln.ERROR:return"Validation could not run.";default:return e}}function BT({state:e,issues:t,onIssueClick:n,placement:o,id:i}){return(0,Rn.jsxs)("div",{id:i,className:`graph-validation-panel graph-validation-panel--${o}`,role:"region","aria-label":"Validation issues",children:[(0,Rn.jsx)("div",{className:"graph-validation-panel-header",children:Qf(e,t.length)}),t.length===0?(0,Rn.jsx)("div",{className:"graph-validation-empty",children:f4(e)}):(0,Rn.jsx)("ul",{className:"graph-validation-issues",role:"list",children:t.map((a,r)=>{let l=n!==void 0,s=(a.context||a.file)&&(0,Rn.jsxs)("div",{className:"graph-validation-issue-meta",children:[a.context&&(0,Rn.jsx)("span",{className:"graph-validation-issue-context",children:a.context}),a.file&&(0,Rn.jsx)("span",{className:"graph-validation-issue-file",children:a.file})]});return(0,Rn.jsx)("li",{className:`graph-validation-issue graph-validation-issue--${a.severity}`+(l?" graph-validation-issue--clickable":""),children:(0,Rn.jsxs)("div",{className:"graph-validation-issue-body",role:l?"button":void 0,tabIndex:l?0:void 0,onClick:l?()=>n(r,a):void 0,onKeyDown:l?u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n(r,a))}:void 0,children:[s,(0,Rn.jsx)("div",{className:"graph-validation-issue-message",children:a.message}),a.suggestedFix&&(0,Rn.jsx)("div",{className:"graph-validation-issue-fix",children:a.suggestedFix})]})},r)})})]})}var Z=J(de(),1),d4=15;var p4=(0,Z.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),(0,Z.jsx)("polyline",{points:"12 5 19 12 12 19"})]}),m4=(0,Z.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,Z.jsx)("polyline",{points:"19 12 12 19 5 12"})]}),h4=(0,Z.jsx)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,Z.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})}),g4=(0,Z.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,Z.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),y4=(0,Z.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("polyline",{points:"15 3 21 3 21 9"}),(0,Z.jsx)("polyline",{points:"9 21 3 21 3 15"}),(0,Z.jsx)("line",{x1:"21",y1:"3",x2:"14",y2:"10"}),(0,Z.jsx)("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]}),v4=(0,Z.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z"}),(0,Z.jsx)("path",{d:"m7 16.5-4.74-2.85"}),(0,Z.jsx)("path",{d:"m7 16.5 5-3"}),(0,Z.jsx)("path",{d:"M7 16.5v5.17"}),(0,Z.jsx)("path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z"}),(0,Z.jsx)("path",{d:"m17 16.5-5-3"}),(0,Z.jsx)("path",{d:"m17 16.5 4.74-2.85"}),(0,Z.jsx)("path",{d:"M17 16.5v5.17"}),(0,Z.jsx)("path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z"}),(0,Z.jsx)("path",{d:"M12 8 7.26 5.15"}),(0,Z.jsx)("path",{d:"m12 8 4.74-2.85"}),(0,Z.jsx)("path",{d:"M12 13.5V8"})]}),b4=(0,Z.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"}),(0,Z.jsx)("polyline",{points:"2 2 6 6 2 6"}),(0,Z.jsx)("polyline",{points:"22 2 18 6 22 6"}),(0,Z.jsx)("polyline",{points:"2 22 6 18 2 18"}),(0,Z.jsx)("polyline",{points:"22 22 18 18 22 18"})]}),S4=(0,Z.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("rect",{x:"9",y:"9",width:"6",height:"6",rx:"1"}),(0,Z.jsx)("polyline",{points:"3 3 7 7 3 7"}),(0,Z.jsx)("polyline",{points:"21 3 17 7 21 7"}),(0,Z.jsx)("polyline",{points:"3 21 7 17 3 17"}),(0,Z.jsx)("polyline",{points:"21 21 17 17 21 17"})]}),x4=(0,Z.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,Z.jsx)("line",{x1:"12",y1:"2",x2:"12",y2:"4"}),(0,Z.jsx)("line",{x1:"12",y1:"20",x2:"12",y2:"22"}),(0,Z.jsx)("line",{x1:"4.93",y1:"4.93",x2:"6.34",y2:"6.34"}),(0,Z.jsx)("line",{x1:"17.66",y1:"17.66",x2:"19.07",y2:"19.07"}),(0,Z.jsx)("line",{x1:"2",y1:"12",x2:"4",y2:"12"}),(0,Z.jsx)("line",{x1:"20",y1:"12",x2:"22",y2:"12"}),(0,Z.jsx)("line",{x1:"4.93",y1:"19.07",x2:"6.34",y2:"17.66"}),(0,Z.jsx)("line",{x1:"17.66",y1:"6.34",x2:"19.07",y2:"4.93"})]}),_4=(0,Z.jsx)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,Z.jsx)("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),E4=(0,Z.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),(0,Z.jsx)("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),(0,Z.jsx)("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),T4=(0,Z.jsx)("svg",{className:"graph-toolbar-validation-spin",viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,Z.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),N4=(0,Z.jsx)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,Z.jsx)("polyline",{points:"20 6 9 17 4 12"})}),C4=(0,Z.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Z.jsx)("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),(0,Z.jsx)("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]}),w4=(0,Z.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),(0,Z.jsx)("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),(0,Z.jsx)("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]});function A4(e){switch(e){case ln.VALIDATING:return T4;case ln.VALID:return N4;case ln.INVALID:return C4;case ln.ERROR:return w4;default:return e}}var vg=[St.SYSTEM,St.LIGHT,St.DARK];function kT(e){let t=vg.indexOf(e);return vg[(t+1)%vg.length]}function M4(e){return e===St.LIGHT?x4:e===St.DARK?_4:E4}function HT(e){let t={[St.SYSTEM]:"system",[St.LIGHT]:"light",[St.DARK]:"dark"},n=kT(e);return`Theme: ${t[e]} \u2014 switch to ${t[n]}`}function GT({direction:e,onDirectionChange:t,showControllers:n,onShowControllersChange:o,onZoomIn:i,onZoomOut:a,onFitView:r,onFoldAll:l,onExpandAll:s,foldAllDisabled:u=!1,expandAllDisabled:c=!1,themeMode:d,onThemeModeChange:f,rightOffset:p=0,position:v,validationState:b,validationIssues:x=[],onValidationIssueClick:g,validationOpen:h=!1,onValidationOpenChange:m}){let y=d!==void 0&&f!==void 0,S=_1(v),E=m??(()=>{}),_=dl.default.useRef(E);_.current=E;let w=dl.default.useRef(null),C=dl.default.useId();dl.default.useEffect(()=>{b===void 0&&_.current(!1)},[b]),dl.default.useEffect(()=>{if(!h)return;let O=Y=>{let G=w.current;G&&Y.target instanceof Node&&!G.contains(Y.target)&&_.current(!1)},L=Y=>{Y.key==="Escape"&&_.current(!1)};return document.addEventListener("mousedown",O),document.addEventListener("keydown",L),()=>{document.removeEventListener("mousedown",O),document.removeEventListener("keydown",L)}},[h]);let M=E1(v)==="right"&&p>0?{marginRight:d4+p}:void 0,z=e===Cn.TB||e===Cn.BT,I=z?"Switch to horizontal layout":"Switch to vertical layout",T=n?"Hide pipe controllers":"Show pipe controllers \u2014 groups pipes by their controlling pipe",D=l||s,A=u?"Fold all controllers (nothing to fold)":"Fold all controllers",R=c?"Expand all controllers (nothing to expand)":"Expand all controllers";return(0,Z.jsx)(sl,{position:v,className:"graph-toolbar-panel",style:M,children:(0,Z.jsxs)("div",{className:`graph-toolbar graph-toolbar--${S}`,children:[b!==void 0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)("div",{className:"graph-toolbar-validation",ref:w,children:[(0,Z.jsxs)("button",{type:"button",className:`graph-toolbar-btn graph-toolbar-validation-btn graph-toolbar-validation-btn--${b}`,onClick:()=>E(!h),title:Qf(b,x.length),"aria-label":Qf(b,x.length),"aria-expanded":h,"aria-haspopup":"true","aria-controls":C,children:[A4(b),x.length>0&&(0,Z.jsx)("span",{className:"graph-toolbar-validation-badge",children:x.length>99?"99+":x.length})]}),h&&(0,Z.jsx)(BT,{id:C,state:b,issues:x,onIssueClick:g,placement:PT(v)})]}),(0,Z.jsx)("div",{className:"graph-toolbar-separator"})]}),l&&(0,Z.jsx)("button",{type:"button",className:"graph-toolbar-btn",onClick:l,disabled:u,title:A,"aria-label":A,children:b4}),s&&(0,Z.jsx)("button",{type:"button",className:"graph-toolbar-btn",onClick:s,disabled:c,title:R,"aria-label":R,children:S4}),D&&(0,Z.jsx)("div",{className:"graph-toolbar-separator"}),(0,Z.jsx)("button",{type:"button",className:`graph-toolbar-btn${n?" graph-toolbar-btn--active":""}`,onClick:()=>o(!n),title:T,"aria-label":T,children:v4}),(0,Z.jsx)("button",{type:"button",className:"graph-toolbar-btn",onClick:()=>t(z?Cn.LR:Cn.TB),title:I,"aria-label":I,children:z?p4:m4}),(a||i||r)&&(0,Z.jsx)("div",{className:"graph-toolbar-separator"}),a&&(0,Z.jsx)("button",{type:"button",className:"graph-toolbar-btn",onClick:a,title:"Zoom out","aria-label":"Zoom out",children:h4}),i&&(0,Z.jsx)("button",{type:"button",className:"graph-toolbar-btn",onClick:i,title:"Zoom in","aria-label":"Zoom in",children:g4}),r&&(0,Z.jsx)("button",{type:"button",className:"graph-toolbar-btn",onClick:r,title:"Fit view","aria-label":"Fit view",children:y4}),y&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)("div",{className:"graph-toolbar-separator"}),(0,Z.jsx)("button",{type:"button",className:"graph-toolbar-btn",onClick:()=>f(kT(d)),title:HT(d),"aria-label":HT(d),children:M4(d)})]})]})})}var bg=J(de(),1);function Wf({validation:e,onClick:t}){let n=`${e.count} validation ${e.count===1?"issue":"issues"}`,o=e.lines.join(`
17
+ `)}function x3({label:e,value:t}){return(0,Le.jsxs)("div",{className:"detail-field-block",children:[(0,Le.jsx)("div",{className:"detail-field-block-label",children:e}),(0,Le.jsx)("div",{className:"detail-field-block-value",children:t})]})}function ST({blueprint:e,depth:t,fieldResolutions:n}){let o=[],i=[],a=[];for(let[l,s]of Object.entries(e.fields))s.method==="template"?a.push([l,s]):s.method==="nested"?i.push([l,s]):o.push([l,s]);let r=t>0?{paddingLeft:t*12}:void 0;return(0,Le.jsxs)(Le.Fragment,{children:[o.map(([l,s])=>{let u=v3(s);return S3(u)?(0,Le.jsx)("div",{style:r,children:(0,Le.jsx)(x3,{label:l,value:u})},l):(0,Le.jsx)("div",{style:r,children:(0,Le.jsx)(ee,{label:l,value:u})},l)}),a.map(([l,s])=>{let u=n?.[l]?.rendered;return(0,Le.jsx)("div",{style:r,children:(0,Le.jsx)(Mn,{label:`Template \u2014 ${l}`,templateText:s.template??null,renderedText:u})},l)}),i.map(([l,s])=>s.nested?(0,Le.jsxs)("div",{children:[(0,Le.jsxs)("div",{className:"detail-nested-header",style:t>0?{paddingLeft:t*12}:void 0,children:[(0,Le.jsx)("span",{className:"detail-nested-header-name",children:l}),(0,Le.jsxs)("span",{className:"detail-nested-header-meta",children:["nested \xB7 ",Object.keys(s.nested.fields).length," field",Object.keys(s.nested.fields).length===1?"":"s"]})]}),(0,Le.jsx)(ST,{blueprint:s.nested,depth:t+1,fieldResolutions:null})]},l):null)]})}function rg({blueprint:e,executionData:t}){let n=t?.rendered_text,o=t?.compose_mode,i=t?.fields??null,a=e.construct_blueprint,r=a!==null&&Object.keys(a.fields).length>0;return(0,Le.jsxs)(Le.Fragment,{children:[(0,Le.jsx)(ee,{label:"Mode",value:o||(r?"construct":"template")}),(0,Le.jsx)(ee,{label:"Category",value:e.category}),(0,Le.jsx)(ee,{label:"Templating Style",value:e.templating_style}),e.template&&(0,Le.jsx)(Mn,{label:"Template",templateText:e.template,renderedText:n}),r&&(0,Le.jsxs)(Le.Fragment,{children:[(0,Le.jsx)("div",{className:"detail-section-label",children:"FIELDS"}),(0,Le.jsx)(ST,{blueprint:a,depth:0,fieldResolutions:i})]})]})}var Bt=J(de(),1);function lg({blueprint:e,executionData:t}){let n=t?.evaluated_expression,o=t?.selected_outcome;return(0,Bt.jsxs)(Bt.Fragment,{children:[(0,Bt.jsx)(eg,{label:"Expression",text:e.expression}),n&&(0,Bt.jsx)(ee,{label:"Expression Result",value:n}),(0,Bt.jsxs)("div",{children:[(0,Bt.jsx)("div",{className:"detail-section-label",children:"Outcomes"}),Object.entries(e.outcome_map).map(([i,a])=>(0,Bt.jsxs)("div",{className:"detail-kv-row",style:o===a?{background:"rgba(80,250,123,0.08)"}:void 0,children:[(0,Bt.jsx)("span",{className:"detail-kv-key",children:i}),(0,Bt.jsx)("span",{className:"detail-kv-value",style:o===a?{color:"#50FA7B"}:void 0,children:a})]},i)),(0,Bt.jsxs)("div",{className:"detail-kv-row",children:[(0,Bt.jsx)("span",{className:"detail-kv-key",children:"default"}),(0,Bt.jsx)("span",{className:"detail-kv-value",children:e.default_outcome})]})]}),(0,Bt.jsx)(ee,{label:"Alias Expression To",value:e.add_alias_from_expression_to})]})}var ri=J(de(),1);function sg({blueprint:e}){return(0,ri.jsxs)("div",{children:[(0,ri.jsx)("div",{className:"detail-section-label",children:"Steps"}),(0,ri.jsx)("div",{className:"detail-steps-list",children:e.sequential_sub_pipes.map((t,n)=>(0,ri.jsxs)("div",{className:"detail-step-item",children:[(0,ri.jsx)("span",{className:"detail-step-index",children:n+1}),(0,ri.jsx)("span",{className:"detail-step-code",children:t.pipe_code}),t.output_name&&(0,ri.jsxs)("span",{className:"detail-io-concept",children:["-> ",t.output_name]})]},n))})]})}var Dn=J(de(),1);function ug({blueprint:e}){return(0,Dn.jsxs)(Dn.Fragment,{children:[(0,Dn.jsxs)("div",{children:[(0,Dn.jsx)("div",{className:"detail-section-label",children:"Branches"}),(0,Dn.jsx)("div",{className:"detail-steps-list",children:e.parallel_sub_pipes.map((t,n)=>(0,Dn.jsxs)("div",{className:"detail-step-item",children:[(0,Dn.jsx)("span",{className:"detail-step-code",children:t.pipe_code}),t.output_name&&(0,Dn.jsxs)("span",{className:"detail-io-concept",children:["-> ",t.output_name]})]},n))})]}),(0,Dn.jsx)(ee,{label:"Add Each Output",value:e.add_each_output}),(0,Dn.jsx)(ee,{label:"Combined Output",value:e.combined_output})]})}var li=J(de(),1);function cg({blueprint:e,executionData:t}){let n=t?.item_count;return(0,li.jsxs)(li.Fragment,{children:[(0,li.jsx)(ee,{label:"Branch Pipe",value:e.branch_pipe_code}),(0,li.jsx)(ee,{label:"Input List Variable",value:e.batch_params.input_list_stuff_name}),(0,li.jsx)(ee,{label:"Input Item Variable",value:e.batch_params.input_item_stuff_name}),n!=null&&(0,li.jsx)(ee,{label:"Items Processed",value:n})]})}var xT=new Set(["PipeLLM","PipeImgGen","PipeExtract","PipeSearch","PipeStructure","PipeCompose","PipeSequence","PipeParallel","PipeCondition","PipeBatch"]);function fg(e,t){return xT.has(e)?!t:!0}var oe=J(de(),1),_3={PipeLLM:"LLM",PipeExtract:"Extract",PipeCompose:"Compose",PipeImgGen:"ImgGen",PipeSearch:"Search",PipeFunc:"Func",PipeStructure:"Structure",PipeSignature:"Signature",PipeSequence:"Seq",PipeParallel:"Par",PipeCondition:"Cond",PipeBatch:"Batch"},E3=new Set(["PipeSequence","PipeParallel","PipeCondition","PipeBatch"]),T3={succeeded:"#50FA7B",failed:"#FF5555",running:"#8BE9FD",scheduled:"#6272a4",skipped:"#6272a4",canceled:"#6272a4"};function ET({node:e,spec:t,onConceptClick:n}){let o=e.pipe_type,i=E3.has(o),a=S1(t),r=!a&&!x1(t),l=_3[o],s=e.status,u=T3[s]??"#6272a4",c=_T.default.useMemo(()=>{if(!e.pipe_code||!t.pipe_registry)return;let v=`${t.pipeline_ref?.domain??""}.${e.pipe_code}`,b=GE(t,v);if(b)return b;for(let[x,g]of Object.entries(t.pipe_registry))if(x.endsWith(`.${e.pipe_code}`))return g},[e.pipe_code,t]),d=e.io?.inputs??[],f=e.io?.outputs??[],p=c?.description??e.description;return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)("div",{className:"detail-sticky-header",children:[(0,oe.jsxs)("div",{className:"detail-header",children:[(0,oe.jsx)("span",{className:`detail-badge ${i?"detail-badge--controller":"detail-badge--operator"}`,children:l}),(0,oe.jsx)("span",{className:`detail-pipe-code ${i?"detail-pipe-code--controller":""}`,children:e.pipe_code})]}),!a&&(0,oe.jsxs)("div",{className:"detail-status",children:[(0,oe.jsx)("span",{className:"detail-status-dot",style:{background:u}}),(0,oe.jsx)("span",{className:"detail-status-label",style:{color:u},children:s}),e.timing?.duration!=null&&(0,oe.jsx)("span",{className:"detail-duration",children:Jh(e.timing.duration)})]}),p&&(0,oe.jsx)("div",{className:"detail-description",children:p}),d.length>0&&(0,oe.jsxs)("div",{children:[(0,oe.jsx)("div",{className:"detail-section-label",children:"Inputs"}),(0,oe.jsx)("div",{className:"detail-io-list",children:d.map((v,b)=>(0,oe.jsxs)("div",{className:"detail-io-pill",style:{cursor:v.concept&&n?"pointer":void 0},onClick:()=>v.concept&&n?.(v.concept),children:[(0,oe.jsx)("span",{className:"detail-io-name",children:v.name}),v.concept&&(0,oe.jsx)("span",{className:"detail-io-concept",children:v.concept})]},b))})]}),f.length>0&&(0,oe.jsxs)("div",{children:[(0,oe.jsx)("div",{className:"detail-section-label",children:"Output"}),(0,oe.jsx)("div",{className:"detail-io-list",children:f.map((v,b)=>(0,oe.jsxs)("div",{className:"detail-io-pill",style:{cursor:v.concept&&n?"pointer":void 0},onClick:()=>v.concept&&n?.(v.concept),children:[(0,oe.jsx)("span",{className:"detail-io-name",children:v.name}),v.concept&&(0,oe.jsx)("span",{className:"detail-io-concept",children:v.concept})]},b))})]}),(d.length>0||f.length>0)&&(0,oe.jsx)("div",{style:{borderTop:"1px solid rgba(255,255,255,0.06)",margin:"4px 0"}})]}),c&&(0,oe.jsx)(N3,{blueprint:c,executionData:r?e.execution_data:void 0}),r&&e.execution_data&&Object.keys(e.execution_data).length>0&&(0,oe.jsx)(C3,{executionData:e.execution_data,pipeType:o,hasBlueprint:!!c}),e.error&&(0,oe.jsxs)("div",{className:"detail-error",children:[(0,oe.jsx)("div",{className:"detail-error-type",children:e.error.error_type}),(0,oe.jsx)("div",{className:"detail-error-message",children:e.error.message}),e.error.stack&&(0,oe.jsx)("div",{className:"detail-error-stack",children:e.error.stack})]}),r&&e.metrics&&Object.keys(e.metrics).length>0&&(0,oe.jsxs)("div",{children:[(0,oe.jsx)("div",{className:"detail-section-label",children:"Metrics"}),Object.entries(e.metrics).map(([v,b])=>(0,oe.jsx)(ee,{label:v,value:typeof b=="number"?b.toLocaleString():String(b)},v))]}),e.tags&&Object.keys(e.tags).length>0&&(0,oe.jsxs)("div",{children:[(0,oe.jsx)("div",{className:"detail-section-label",children:"Tags"}),(0,oe.jsx)("div",{className:"detail-tags",children:Object.entries(e.tags).map(([v,b])=>(0,oe.jsxs)("span",{className:"detail-tag",children:[(0,oe.jsxs)("span",{className:"detail-tag-key",children:[v,": "]}),(0,oe.jsx)("span",{className:"detail-tag-value",children:b})]},v))})]}),!c&&(0,oe.jsx)("div",{className:"detail-not-available",children:"Blueprint not available"})]})}function N3({blueprint:e,executionData:t}){switch(e.type){case"PipeLLM":return(0,oe.jsx)(tg,{blueprint:e,executionData:t});case"PipeImgGen":return(0,oe.jsx)(ng,{blueprint:e,executionData:t});case"PipeCompose":return(0,oe.jsx)(rg,{blueprint:e,executionData:t});case"PipeExtract":return(0,oe.jsx)(og,{blueprint:e,executionData:t});case"PipeSearch":return(0,oe.jsx)(ig,{blueprint:e,executionData:t});case"PipeStructure":return(0,oe.jsx)(ag,{blueprint:e,executionData:t});case"PipeSequence":return(0,oe.jsx)(sg,{blueprint:e,executionData:t});case"PipeParallel":return(0,oe.jsx)(ug,{blueprint:e,executionData:t});case"PipeCondition":return(0,oe.jsx)(lg,{blueprint:e,executionData:t});case"PipeBatch":return(0,oe.jsx)(cg,{blueprint:e,executionData:t});case"PipeFunc":return null;case"PipeSignature":return(0,oe.jsx)("div",{className:"detail-not-available",children:"Signature stub \u2014 declared but not yet implemented."});default:return null}}function C3({executionData:e,pipeType:t,hasBlueprint:n}){return fg(t,n)?(0,oe.jsx)(w3,{data:e}):null}function w3({data:e}){let t=Object.entries(e);return t.length===0?null:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("div",{className:"detail-section-label",children:"Execution"}),t.map(([n,o])=>(0,oe.jsx)(ee,{label:n,value:String(o)},n))]})}var dg=J(Et(),1);var Se=J(de(),1);function pg({concept:e,ioData:t,isDryRun:n,resolveStorageUrl:o,canEmbedPdf:i,onOpenExternally:a,instanceKey:r}){return(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsxs)("div",{className:"detail-header",children:[(0,Se.jsx)("span",{className:"detail-concept-code",children:e.code}),(0,Se.jsx)("span",{className:"detail-concept-domain",children:e.domain_code})]}),e.description&&(0,Se.jsx)("div",{className:"detail-description",children:e.description}),e.refines&&(0,Se.jsxs)("div",{className:"detail-refines",children:["refines ",(0,Se.jsx)("span",{className:"detail-refines-code",children:e.refines})]}),(0,Se.jsx)(A3,{concept:e,ioData:t,isDryRun:n,resolveStorageUrl:o,canEmbedPdf:i,onOpenExternally:a},r??`${e.code}:${t&&"digest"in t?t.digest:t?.name??""}`)]})}function A3({concept:e,ioData:t,isDryRun:n,resolveStorageUrl:o,canEmbedPdf:i,onOpenExternally:a}){let r=!!t&&!n,[l,s]=dg.default.useState(r?"data":"structure"),u=dg.default.useId(),c=b=>`${u}-tab-${b}`,d=b=>`${u}-tabpanel-${b}`,f=e.json_schema?(0,Se.jsxs)("div",{children:[(0,Se.jsx)("div",{className:"detail-section-label",children:"Structure"}),(0,Se.jsx)(M3,{schema:e.json_schema})]}):(0,Se.jsx)("div",{className:"detail-not-available",children:"Schema not available"});if(!r)return f;let p=b=>{let x;switch(b.key){case"ArrowLeft":case"ArrowRight":x=l==="data"?"structure":"data";break;case"Home":x="data";break;case"End":x="structure";break;default:return}b.preventDefault(),s(x),document.getElementById(c(x))?.focus()},v=(b,x)=>(0,Se.jsx)("button",{type:"button",role:"tab",id:c(b),"aria-selected":l===b,"aria-controls":d(b),tabIndex:l===b?0:-1,className:`detail-tab ${l===b?"detail-tab--active":""}`,onClick:()=>s(b),onKeyDown:p,children:x});return(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsxs)("div",{className:"detail-tabs",role:"tablist","aria-label":"Concept views",children:[v("data","Data"),v("structure","Structure")]}),(0,Se.jsx)("div",{role:"tabpanel",id:d(l),"aria-labelledby":c(l),children:l==="data"?(0,Se.jsx)(qf,{stuff:R3(t),resolveStorageUrl:o,canEmbedPdf:i,onOpenExternally:a}):f})]})}function M3({schema:e}){let t=e.properties,n=new Set(e.required??[]);if(!t||Object.keys(t).length===0)return(0,Se.jsx)("div",{className:"detail-not-available",children:"No fields defined"});let o=Object.entries(t);return(0,Se.jsxs)("table",{className:"detail-schema-table",children:[(0,Se.jsx)("thead",{children:(0,Se.jsxs)("tr",{children:[(0,Se.jsx)("th",{children:"Field"}),(0,Se.jsx)("th",{children:"Type"}),(0,Se.jsx)("th",{}),(0,Se.jsx)("th",{children:"Description"})]})}),(0,Se.jsx)("tbody",{children:o.map(([i,a])=>(0,Se.jsxs)("tr",{children:[(0,Se.jsx)("td",{className:"detail-schema-field",children:i}),(0,Se.jsx)("td",{className:"detail-schema-type",children:D3(a)}),(0,Se.jsx)("td",{children:n.has(i)&&(0,Se.jsx)("span",{className:"detail-schema-required",children:"req"})}),(0,Se.jsx)("td",{children:a.description??""})]},i))})]})}function D3(e){return typeof e.type=="string"?e.type:Array.isArray(e.type)?e.type.join(" | "):e.anyOf?"union":e.allOf?"all":typeof e.$ref=="string"?e.$ref.split("/").pop()??"(unresolved type)":"(unresolved type)"}function R3(e){return O3(e)?e:{digest:e.digest??"",name:e.name,concept:e.concept,contentType:e.content_type,data:e.data,dataText:e.data_text,dataHtml:e.data_html}}function O3(e){return"contentType"in e||"dataText"in e||"dataHtml"in e}function TT(e){return e.map(t=>({id:t.id,type:t.type,data:t.data,position:t.position,style:t.style,sourcePosition:t.sourcePosition,targetPosition:t.targetPosition,parentId:t.parentId,extent:t.extent,selected:t.selected}))}function cl(e){return e.map(t=>({id:t.id,source:t.source,target:t.target,type:t.type,animated:t.animated,label:t.label,labelStyle:t.labelStyle,labelBgStyle:t.labelBgStyle,labelBgPadding:t.labelBgPadding,labelBgBorderRadius:t.labelBgBorderRadius,style:t.style,markerEnd:t.markerEnd}))}var z3=7,L3=48,P3=140;function B3(e,t,n){let o=[],i=[],a=Eo(e),r=new Set;for(let c of e.edges)c.kind==="parallel_combine"&&c.target_stuff_digest&&r.add(c.target_stuff_digest);let l=new Set;for(let c of Object.values(t.stuffProducers))l.add(c);for(let c of Object.values(t.stuffConsumers))for(let d of c)l.add(d);for(let c of e.nodes){if(!l.has(c.id))continue;let d=Yr(c,`nodes[${c.id}]`),f=d.status==="failed",p=d.pipe_code,v=Gf(d,a);o.push({id:d.id,type:Ur,data:{labelDescriptor:{kind:"pipe",label:p,isFailed:f},nodeData:d,isPipe:!0,isStuff:!1,labelText:p,pipeCode:v.pipeCode,pipeType:d.pipe_type,graphMode:a,pipeCardData:v},position:{x:0,y:0}})}for(let[c,d]of Object.entries(t.stuffRegistry)){let f=Ui(c),p=d.name,v=d.concept||"",b=Math.max(p.length,v.length)*z3+L3,x=Math.max(P3,b),g=r.has(c),h=!t.stuffProducers[c]&&!g,m=!h&&!g&&!t.stuffConsumers[c]?.length,y=g?"combined":h?"input":m?"output":void 0,S=h?"var(--color-stuff-input-border, #50FA7B)":m?"var(--color-stuff-output-border, #a78bfa)":g?"var(--color-parallel-combine)":"var(--color-stuff-border)";o.push({id:f,type:v1,data:{labelDescriptor:{kind:"stuff",label:p,concept:v},isStuff:!0,isPipe:!1,labelText:p,stuffRole:y,stuffDigest:c},position:{x:0,y:0},style:{background:"var(--color-stuff-bg)",border:`2px solid ${S}`,borderRadius:"999px",padding:"0",width:x+"px",boxShadow:"var(--shadow-md)"}})}let s=0;for(let[c,d]of Object.entries(t.stuffProducers)){let f=Ui(c);i.push({id:"edge_"+s++,source:d,target:f,type:n,animated:!1,style:{stroke:"var(--color-edge)",strokeWidth:2},markerEnd:{type:xa,color:"var(--color-edge)"}})}for(let[c,d]of Object.entries(t.stuffConsumers)){let f=Ui(c);for(let p of d)i.push({id:"edge_"+s++,source:f,target:p,type:n,animated:!1,style:{stroke:"var(--color-edge)",strokeWidth:2},markerEnd:{type:xa,color:"var(--color-edge)"}})}for(let c of e.edges){if(c.kind!=="parallel_combine"||!c.source_stuff_digest||!c.target_stuff_digest||!t.stuffRegistry[c.source_stuff_digest]||!t.stuffRegistry[c.target_stuff_digest])continue;let d=Ui(c.source_stuff_digest),f=Ui(c.target_stuff_digest);i.push({id:c.id,source:d,target:f,type:"smoothstep",animated:!1,style:{stroke:"var(--color-parallel-combine)",strokeWidth:2,strokeDasharray:"5,5"},markerEnd:{type:xa,color:"var(--color-parallel-combine)"}})}for(let c of e.edges){if(c.kind!=="batch_item"&&c.kind!=="batch_aggregate"||!c.source_stuff_digest||!c.target_stuff_digest||!t.stuffRegistry[c.source_stuff_digest]||!t.stuffRegistry[c.target_stuff_digest])continue;let d=Ui(c.source_stuff_digest),f=Ui(c.target_stuff_digest),p=c.kind==="batch_item";i.push({id:c.id,source:d,target:f,type:n,animated:!1,_batchEdge:!0,label:c.label||"",labelStyle:{fontSize:"10px",fontFamily:"var(--font-mono)",fill:p?"var(--color-batch-item)":"var(--color-batch-aggregate)"},labelBgStyle:{fill:"var(--color-bg)",fillOpacity:.9},style:{stroke:p?"var(--color-batch-item)":"var(--color-batch-aggregate)",strokeWidth:2,strokeDasharray:"5,5"},markerEnd:{type:xa,color:p?"var(--color-batch-item)":"var(--color-batch-aggregate)"}})}let u=$n(e,t);for(let c of i){let d=u[c.source]||null,f=u[c.target]||null;d&&f&&d!==f&&(c._crossGroup=!0,c.style={...c.style,strokeWidth:1.5,opacity:.65})}for(let c of i)c._batchEdge&&(c.style={...c.style,opacity:.7});return{nodes:o,edges:i}}function NT(e,t){if(e){let n=kE(e);if(n&&(Object.keys(n.stuffProducers).length>0||Object.keys(n.stuffConsumers).length>0))return{graphData:B3(e,n,t),analysis:n}}return{graphData:{nodes:[],edges:[]},analysis:null}}var H3=window.ELK,CT=H3;function k3(e){switch(e){case"LR":return"RIGHT";case"RL":return"LEFT";case"BT":return"UP";default:return"DOWN"}}var G3="_in",I3="_out";function hg(e){return e+G3}function gg(e){return e+I3}function U3(e,t,n){let o={LR:{inSide:"WEST",outSide:"EAST"},RL:{inSide:"EAST",outSide:"WEST"},TB:{inSide:"NORTH",outSide:"SOUTH"},BT:{inSide:"SOUTH",outSide:"NORTH"}},{inSide:i,outSide:a}=o[n],r=n==="LR"||n==="RL",l=r?n==="LR"?0:t.width:t.width/2,s=r?t.height/2:n==="TB"?0:t.height,u=r?n==="LR"?t.width:0:t.width/2,c=r?t.height/2:n==="TB"?t.height:0;return[{id:hg(e),x:l,y:s,width:1,height:1,layoutOptions:{"elk.port.side":i}},{id:gg(e),x:u,y:c,width:1,height:1,layoutOptions:{"elk.port.side":a}}]}var V3=320,DT=28,Y3=24,mg=8,X3=22,q3=50,Z3=16,j3=3,wT=38,AT=30,jf=22,$3=140,F3=100,K3=17,Q3=58,W3=5.5,J3=5,e4=4.5,t4=4;function n4(e,t,n){if(!e)return 0;if(!t)return 1;let o=n-DT,i=Math.max(1,Math.floor(o/W3)),a=Math.ceil(e.length/i);return Math.min(j3,Math.max(1,a))}function o4(e,t){let n=Math.min($3,Math.ceil(e.length*J3)),o=Math.min(F3,Math.ceil(t.length*e4));return n+o+K3}function MT(e,t){if(e.length===0)return 0;let n=t-DT-Q3,o=1,i=0;for(let a of e){let r=o4(a.name,a.concept);if(i===0){i=r;continue}i+r<=n?i+=r:(o+=1,i=r)}return o}function fl(e,t){let n=e.data||{},o=n.isStuff,i=n.labelText||"",a=e.type===Ur,r=t?180:280,l=t?240:400,s=Math.max(180,Math.min(l,i.length*8+60)),u;o?u=Math.max(180,s):a&&n.pipeCardData?u=l:u=Math.max(a?r:200,s);let c;if(o)c=60;else if(a&&n.pipeCardData){let d=n.pipeCardData,f=d.inputs??[],p=d.outputs??[],v=d.description||n.nodeData?.description||"",b=Y3+(t?q3:X3),x=n4(v,t,u);x>0&&(b+=mg+x*Z3);let g=f.slice(0,t4);if(g.length>0)if(b+=mg,t)b+=wT+(g.length-1)*jf;else{let h=MT(g,u);b+=AT+(h-1)*jf}if(p.length>0)if(b+=mg,t)b+=wT+(p.length-1)*jf;else{let h=MT(p,u);b+=AT+(h-1)*jf}c=Math.min(V3,b)}else c=a?120:70;return{width:u,height:c}}function i4(e,t){let n={},o=new Set;function i(a){if(n[a]!==void 0)return n[a];if(o.has(a))return 0;o.add(a);let r=t[a]||[],l=-1;for(let s of r)e.has(s)&&(l=Math.max(l,i(s)));return o.delete(a),n[a]=l+1,n[a]}for(let a of e)i(a);return n}function $f(e,t,n){return{id:e,width:t.width,height:t.height,ports:U3(e,t,n),layoutOptions:{"elk.portConstraints":"FIXED_POS"}}}function RT(e,t,n,o,i,a){let r=i==="LR"||i==="RL",l=a?.nodesep??80,s=a?.ranksep??70,u=k3(i),c="30",d={"elk.algorithm":"layered","elk.direction":u,"elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.spacing.nodeNode":String(l),"elk.layered.spacing.nodeNodeBetweenLayers":String(s),"elk.spacing.edgeNode":c,"elk.spacing.edgeEdge":"20","elk.layered.spacing.edgeNodeBetweenLayers":c,"elk.layered.spacing.edgeEdgeBetweenLayers":"15","elk.layered.nodePlacement.favorStraightEdges":"true"};if(!n||!o||o.controllerNodeIds.size===0){let S={},E=e.map(w=>{let C=fl(w,r);return S[w.id]=C,$f(w.id,C,i)}),_=t.map(w=>({id:w.id,sources:[gg(w.source)],targets:[hg(w.target)]}));return{elkGraph:{id:"root",layoutOptions:d,children:E,edges:_},dimensionMap:S}}let f=$n(n,o),p=i4(o.controllerNodeIds,o.containmentTree),v={},b=new Map;for(let S of e)b.set(S.id,S);let x={},g=Array.from(o.controllerNodeIds);g.sort((S,E)=>(p[S]??0)-(p[E]??0));for(let S of g){let _=1+(p[S]??0)*.15,w=Math.round(Bc*_),C=Math.round(Hc*_),P=Math.round(kc*_),M={"elk.padding":`[top=${C},left=${w},bottom=${P},right=${w}]`,"elk.spacing.nodeNode":String(l),"elk.layered.spacing.nodeNodeBetweenLayers":String(s),"elk.spacing.edgeNode":c,"elk.layered.spacing.edgeNodeBetweenLayers":c},z=[],I=o.containmentTree[S]||[];for(let T of I)if(o.controllerNodeIds.has(T)){let D=x[T];D&&z.push(D)}else{let D=b.get(T);if(D){let A=fl(D,r);v[T]=A,z.push($f(T,A,i))}}for(let T of e)if(T.data.isStuff&&f[T.id]===S&&!z.some(D=>D.id===T.id)){let D=fl(T,r);v[T.id]=D,z.push($f(T.id,D,i))}x[S]={id:S,layoutOptions:M,children:z}}let h=[];for(let S of g)if(!f[S]){let E=x[S];E&&h.push(E)}for(let S of e)if(!f[S.id]&&!o.controllerNodeIds.has(S.id)){let E=fl(S,r);v[S.id]=E,h.push($f(S.id,E,i))}let m=new Set(e.map(S=>S.id)),y=t.filter(S=>m.has(S.source)&&m.has(S.target)).map(S=>({id:S.id,sources:[gg(S.source)],targets:[hg(S.target)]}));return{elkGraph:{id:"root",layoutOptions:d,children:h,edges:y},dimensionMap:v}}function OT(e){let t={};function n(o,i,a){let r=i+(o.x??0),l=a+(o.y??0);o.id!=="root"&&(t[o.id]={x:r,y:l,width:o.width??0,height:o.height??0});for(let s of o.children??[])n(s,r,l)}return n(e,0,0),t}var yg=null;function a4(){return yg||(yg=new CT),yg}async function Ff(e,t,n,o,i,a){if(e.length===0)return{nodes:[],edges:t,controllerPositions:{}};let r=n==="LR"||n==="RL",{elkGraph:l,dimensionMap:s}=RT(e,t,i??null,a??null,n,o),u=await a4().layout(l),c=OT(u),d={};if(a)for(let p of a.controllerNodeIds)c[p]&&(d[p]=c[p]);return{nodes:e.map(p=>{let v=c[p.id],b=s[p.id]??fl(p,r),x=b.width,g=b.height,h=p.data.pipeCardData,y=h?{...h,direction:r?"LR":"TB"}:void 0;return{...p,data:{...p.data,_estimatedWidth:x,_estimatedHeight:g,pipeCardData:y},style:{...p.style,width:x+"px",height:g+"px"},position:{x:v?v.x:0,y:v?v.y:0},sourcePosition:r?n==="LR"?"right":"left":n==="TB"?"bottom":"top",targetPosition:r?n==="LR"?"left":"right":n==="TB"?"top":"bottom"}}),edges:t,controllerPositions:d}}var tu=5;function r4(e,t,n){let o=new Set,i=[e];for(;i.length>0;){let a=i.pop();for(let r of t[a]||[])o.add(r),n.has(r)&&i.push(r)}return o}function l4(e,t,n,o){let i={},a=Eo(e);for(let b of n)i[b.id]=b;let r={};for(let b of e.nodes)t.controllerNodeIds.has(b.id)&&(r[b.id]=Yr(b,`nodes[${b.id}]`));let l={},s=new Set;function u(b){if(l[b]!==void 0)return l[b];if(s.has(b))throw new Error(`Cycle detected in containment tree: controller "${b}" is part of a containment cycle`);s.add(b);let x=t.containmentTree[b]||[],g=-1;for(let h of x)t.controllerNodeIds.has(h)&&(g=Math.max(g,u(h)));return s.delete(b),l[b]=g+1,l[b]}let c=$n(e,t),d={};for(let[b,x]of Object.entries(c))Vr(b)&&i[b]&&(d[x]||(d[x]=[]),d[x].push(b));let f=Array.from(t.controllerNodeIds);for(let b of f)u(b);f.sort((b,x)=>l[b]-l[x]);let p=[],v={};for(let b of f){let g=(t.containmentTree[b]||[]).filter(z=>i[z]),h=d[b]||[],m=[...g,...h];if(m.length===0)continue;let y,S,E,_,w=o?.[b];if(w)y=w.x,S=w.y,E=w.width,_=w.height;else{let z=1/0,I=1/0,T=-1/0,D=-1/0;for(let G of m){let X=i[G],F=X.position,K=T1(X),$=N1(X);z=Math.min(z,F.x),I=Math.min(I,F.y),T=Math.max(T,F.x+K),D=Math.max(D,F.y+$)}let R=1+(l[b]??0)*.15,O=Math.round(Bc*R),L=Math.round(Hc*R),Y=Math.round(kc*R);y=z-O,S=I-L,E=T-z+2*O,_=D-I+L+Y}let C=r[b];if(!C)throw new Ss(`nodes[${b}]`,`controller "${b}" is referenced by a "contains" edge but has no corresponding node in graphspec.nodes`);let P=C.pipe_code,M={id:b,type:b1,data:{label:P,pipeType:C.pipe_type,isController:!0,isPipe:!1,isStuff:!1,pipeCode:P,labelText:P,graphMode:a},position:{x:y,y:S},style:{width:E+"px",height:_+"px",padding:"0"}};p.push(M),i[b]=M;for(let z of m)v[z]=b}for(let[b,x]of Object.entries(v)){let g=i[b],h=i[x];!g||!h||(g.position={x:g.position.x-h.position.x,y:g.position.y-h.position.y},g.parentId=x,g.extent="parent")}return p}function Ga(e,t,n,o,i,a,r,l,s){if(!i||!o||!n)return{nodes:e,edges:t};let u={},c=new Set,d={};for(let y of n.nodes)o.controllerNodeIds.has(y.id)&&(d[y.id]=y.pipe_type);for(let y of o.controllerNodeIds){let S=o.containmentTree[y]||[];u[y]=S.length;let E=d[y];(E==="PipeParallel"||E==="PipeBatch")&&S.length>tu&&!a?.has(y)&&c.add(y)}let f=e,p=t;if(c.size>0){let y=new Set;for(let E of c){let w=(o.containmentTree[E]||[]).slice(tu);for(let C of w)if(y.add(C),o.controllerNodeIds.has(C))for(let P of r4(C,o.containmentTree,o.controllerNodeIds))y.add(P)}let S=$n(n,o);for(let E of e){if(!Vr(E.id)||y.has(E.id))continue;let _=S[E.id];if(!_||!c.has(_)&&!y.has(_))continue;let w=t.filter(C=>{if(C.source!==E.id&&C.target!==E.id)return!1;let P=C.source===E.id?C.target:C.source;return!Vr(P)});(w.length===0||w.every(C=>{let P=C.source===E.id?C.target:C.source;return y.has(P)}))&&y.add(E.id)}f=e.filter(E=>!y.has(E.id)),p=t.filter(E=>!y.has(E.source)&&!y.has(E.target))}let v=l4(n,o,f,l);if(v.length===0)return{nodes:f,edges:p};for(let y of v){let S=u[y.id]??0,E=c.has(y.id);if(y.data.childCount=S,y.data.isCollapsed=E,r){let _=y.id;y.data.onToggleCollapse=()=>r(_)}if(s){let _=y.id;y.data.onToggleFold=w=>s(_,w)}}let b=[...v,...f],x={};for(let y of b)x[y.id]=y;let g={},h=new Set;function m(y){if(g[y]!==void 0)return g[y];if(h.has(y))throw new Error(`Cycle detected in node parent chain: node "${y}" references itself as an ancestor`);h.add(y);let S=x[y];return g[y]=S&&S.parentId?1+m(S.parentId):0,h.delete(y),g[y]}for(let y of b)m(y.id);return b.sort((y,S)=>g[y.id]-g[S.id]),{nodes:b,edges:p}}var zT={"--font-sans":'"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',"--font-mono":'"JetBrains Mono", "Monaco", "Menlo", monospace'},s4={...zT,"--surface-page":"#0a0a0a","--surface-panel":"#111118","--surface-overlay":"rgba(17, 17, 24, 0.8)","--surface-overlay-hover":"rgba(30, 30, 40, 0.9)","--surface-overlay-disabled":"rgba(17, 17, 24, 0.6)","--surface-elevated":"rgba(255, 255, 255, 0.06)","--surface-elevated-hover":"rgba(255, 255, 255, 0.1)","--surface-sunken":"rgba(255, 255, 255, 0.03)","--surface-pill":"rgba(255, 255, 255, 0.06)","--surface-pill-border":"rgba(255, 255, 255, 0.08)","--border-subtle":"rgba(255, 255, 255, 0.06)","--border-default":"rgba(255, 255, 255, 0.1)","--border-strong":"rgba(255, 255, 255, 0.18)","--border-dashed":"rgba(255, 255, 255, 0.15)","--text-primary":"#f8fafc","--text-default":"#e2e8f0","--text-secondary":"#cbd5e1","--text-muted":"#94a3b8","--text-dim":"#64748b","--text-on-accent":"#0e0e0e","--shadow-sm":"0 2px 8px rgba(0, 0, 0, 0.4)","--shadow-md":"0 4px 16px rgba(0, 0, 0, 0.6)","--shadow-lg":"0 8px 24px rgba(0, 0, 0, 0.5)","--focus-ring":"rgba(59, 130, 246, 0.6)","--color-pipe":"#ff6b6b","--color-pipe-bg":"rgba(224,108,117,0.18)","--color-pipe-text":"#ffffff","--color-stuff":"#4ECDC4","--color-stuff-bg":"rgba(78,205,196,0.12)","--color-stuff-border":"#9ddcfd","--color-stuff-text":"#98FB98","--color-stuff-text-dim":"#9ddcfd","--color-edge":"#FFFACD","--color-batch-item":"#bd93f9","--color-batch-aggregate":"#50fa7b","--color-parallel-combine":"#d6a4ff","--color-success":"#50FA7B","--color-success-bg":"rgba(80,250,123,0.15)","--color-error":"#FF5555","--color-error-bg":"rgba(255,85,85,0.15)","--color-error-border":"rgba(255,85,85,0.2)","--color-accent":"#8BE9FD","--color-accent-strong":"#3b82f6","--color-warning":"#FFB86C","--ctrl-sequence-border":"rgba(148, 163, 184, 0.25)","--ctrl-sequence-bg":"rgba(148, 163, 184, 0.03)","--ctrl-sequence-text":"#94a3b8","--ctrl-parallel-border":"rgba(139, 233, 253, 0.35)","--ctrl-parallel-bg":"rgba(139, 233, 253, 0.03)","--ctrl-parallel-text":"#8be9fd","--ctrl-condition-border":"rgba(251, 191, 36, 0.35)","--ctrl-condition-bg":"rgba(251, 191, 36, 0.03)","--ctrl-condition-text":"#fbbf24","--ctrl-batch-border":"rgba(167, 139, 250, 0.35)","--ctrl-batch-bg":"rgba(167, 139, 250, 0.03)","--ctrl-batch-text":"#a78bfa","--ctrl-folded-bg":"rgba(148, 163, 184, 0.25)","--ctrl-folded-border":"rgba(148, 163, 184, 0.4)","--color-bg":"#0a0a0a","--color-bg-dots":"rgba(255, 255, 255, 0.35)","--color-text-muted":"#94a3b8","--color-controller-text":"#94a3b8"},u4={...zT,"--surface-page":"#f8fafc","--surface-panel":"#ffffff","--surface-overlay":"rgba(255, 255, 255, 0.92)","--surface-overlay-hover":"rgba(241, 245, 249, 0.96)","--surface-overlay-disabled":"rgba(255, 255, 255, 0.7)","--surface-elevated":"rgba(15, 23, 42, 0.05)","--surface-elevated-hover":"rgba(15, 23, 42, 0.09)","--surface-sunken":"rgba(15, 23, 42, 0.03)","--surface-pill":"rgba(15, 23, 42, 0.05)","--surface-pill-border":"rgba(15, 23, 42, 0.1)","--border-subtle":"rgba(15, 23, 42, 0.08)","--border-default":"rgba(15, 23, 42, 0.12)","--border-strong":"rgba(15, 23, 42, 0.22)","--border-dashed":"rgba(15, 23, 42, 0.18)","--text-primary":"#020617","--text-default":"#0f172a","--text-secondary":"#1e293b","--text-muted":"#475569","--text-dim":"#64748b","--text-on-accent":"#ffffff","--shadow-sm":"0 2px 8px rgba(15, 23, 42, 0.08)","--shadow-md":"0 4px 16px rgba(15, 23, 42, 0.14)","--shadow-lg":"0 8px 24px rgba(15, 23, 42, 0.15)","--focus-ring":"rgba(2, 132, 199, 0.5)","--color-pipe":"#dc2626","--color-pipe-bg":"rgba(220, 38, 38, 0.1)","--color-pipe-text":"#ffffff","--color-stuff":"#0891b2","--color-stuff-bg":"rgba(8, 145, 178, 0.08)","--color-stuff-border":"#0e7490","--color-stuff-text":"#0f172a","--color-stuff-text-dim":"#475569","--color-edge":"#64748b","--color-batch-item":"#7c3aed","--color-batch-aggregate":"#15803d","--color-parallel-combine":"#6d28d9","--color-success":"#15803d","--color-success-bg":"rgba(21, 128, 61, 0.12)","--color-error":"#dc2626","--color-error-bg":"rgba(220, 38, 38, 0.1)","--color-error-border":"rgba(220, 38, 38, 0.25)","--color-accent":"#0284c7","--color-accent-strong":"#0284c7","--color-warning":"#d97706","--ctrl-sequence-border":"rgba(71, 85, 105, 0.3)","--ctrl-sequence-bg":"rgba(71, 85, 105, 0.04)","--ctrl-sequence-text":"#475569","--ctrl-parallel-border":"rgba(8, 145, 178, 0.4)","--ctrl-parallel-bg":"rgba(8, 145, 178, 0.05)","--ctrl-parallel-text":"#0e7490","--ctrl-condition-border":"rgba(217, 119, 6, 0.4)","--ctrl-condition-bg":"rgba(217, 119, 6, 0.05)","--ctrl-condition-text":"#b45309","--ctrl-batch-border":"rgba(124, 58, 237, 0.4)","--ctrl-batch-bg":"rgba(124, 58, 237, 0.05)","--ctrl-batch-text":"#6d28d9","--ctrl-folded-bg":"rgba(71, 85, 105, 0.18)","--ctrl-folded-border":"rgba(71, 85, 105, 0.35)","--color-bg":"#f8fafc","--color-bg-dots":"rgba(15, 23, 42, 0.18)","--color-text-muted":"#475569","--color-controller-text":"#475569"};function Kf(e){return e===Sa.LIGHT?u4:s4}var Ia={direction:"LR",showControllers:!1,foldMode:no.EXPANDED,theme:St.SYSTEM,toolbarPosition:Je.TOP_RIGHT,nodesep:50,ranksep:100,edgeType:Pc.DEFAULT,initialZoom:null,panToTop:!0};var Ua=J(de(),1);function c4(e){return e.kind==="pipe"?(0,Ua.jsx)("div",{style:{padding:"10px 14px",display:"flex",flexDirection:"column",gap:"2px",textAlign:"center",width:"100%",boxSizing:"border-box",minWidth:0},title:e.label,children:(0,Ua.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:"13px",fontWeight:600,color:"var(--color-pipe-text)",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label})}):(0,Ua.jsxs)("div",{style:{padding:"8px 24px",display:"flex",flexDirection:"column",alignItems:"center",gap:"2px",textAlign:"center",width:"100%",boxSizing:"border-box",minWidth:0},title:e.concept?`${e.label}: ${e.concept}`:e.label,children:[(0,Ua.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:"12px",fontWeight:600,color:"var(--color-stuff-text)",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label}),e.concept&&(0,Ua.jsx)("span",{style:{fontSize:"14px",color:"var(--color-stuff-text-dim)",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.concept})]})}function LT(e){return e.map(t=>t.data.labelDescriptor?{...t,data:{...t.data,label:c4(t.data.labelDescriptor)}}:t)}var dl=J(Et(),1);var Rn=J(de(),1);function Qf(e,t){let n=t===1?"1 issue":`${t} issues`;switch(e){case ln.VALIDATING:return t>0?`Validating method\u2026 \u2014 ${n}`:"Validating method\u2026";case ln.VALID:return t>0?`Method is valid \u2014 ${n}`:"Method is valid";case ln.INVALID:return`Method is invalid \u2014 ${n}`;case ln.ERROR:return"Validation could not run";default:return e}}function PT(e){switch(e){case Je.TOP_LEFT:case Je.TOP_CENTER:return"down-start";case Je.TOP_RIGHT:return"down-end";case Je.BOTTOM_LEFT:case Je.BOTTOM_CENTER:return"up-start";case Je.BOTTOM_RIGHT:return"up-end";case Je.CENTER_LEFT:return"side-end";case Je.CENTER_RIGHT:return"side-start";default:return e}}function f4(e){switch(e){case ln.VALIDATING:return"Validating\u2026";case ln.VALID:return"No issues found.";case ln.INVALID:return"No details available.";case ln.ERROR:return"Validation could not run.";default:return e}}function BT({state:e,issues:t,onIssueClick:n,placement:o,id:i}){return(0,Rn.jsxs)("div",{id:i,className:`graph-validation-panel graph-validation-panel--${o}`,role:"region","aria-label":"Validation issues",children:[(0,Rn.jsx)("div",{className:"graph-validation-panel-header",children:Qf(e,t.length)}),t.length===0?(0,Rn.jsx)("div",{className:"graph-validation-empty",children:f4(e)}):(0,Rn.jsx)("ul",{className:"graph-validation-issues",role:"list",children:t.map((a,r)=>{let l=n!==void 0,s=(a.context||a.file)&&(0,Rn.jsxs)("div",{className:"graph-validation-issue-meta",children:[a.context&&(0,Rn.jsx)("span",{className:"graph-validation-issue-context",children:a.context}),a.file&&(0,Rn.jsx)("span",{className:"graph-validation-issue-file",children:a.file})]});return(0,Rn.jsx)("li",{className:`graph-validation-issue graph-validation-issue--${a.severity}`+(l?" graph-validation-issue--clickable":""),children:(0,Rn.jsxs)("div",{className:"graph-validation-issue-body",role:l?"button":void 0,tabIndex:l?0:void 0,onClick:l?()=>n(r,a):void 0,onKeyDown:l?u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n(r,a))}:void 0,children:[s,(0,Rn.jsx)("div",{className:"graph-validation-issue-message",children:a.message}),a.suggestedFix&&(0,Rn.jsx)("div",{className:"graph-validation-issue-fix",children:a.suggestedFix})]})},r)})})]})}var Z=J(de(),1),d4=15;var p4=(0,Z.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),(0,Z.jsx)("polyline",{points:"12 5 19 12 12 19"})]}),m4=(0,Z.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,Z.jsx)("polyline",{points:"19 12 12 19 5 12"})]}),h4=(0,Z.jsx)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,Z.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})}),g4=(0,Z.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,Z.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),y4=(0,Z.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("polyline",{points:"15 3 21 3 21 9"}),(0,Z.jsx)("polyline",{points:"9 21 3 21 3 15"}),(0,Z.jsx)("line",{x1:"21",y1:"3",x2:"14",y2:"10"}),(0,Z.jsx)("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]}),v4=(0,Z.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z"}),(0,Z.jsx)("path",{d:"m7 16.5-4.74-2.85"}),(0,Z.jsx)("path",{d:"m7 16.5 5-3"}),(0,Z.jsx)("path",{d:"M7 16.5v5.17"}),(0,Z.jsx)("path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z"}),(0,Z.jsx)("path",{d:"m17 16.5-5-3"}),(0,Z.jsx)("path",{d:"m17 16.5 4.74-2.85"}),(0,Z.jsx)("path",{d:"M17 16.5v5.17"}),(0,Z.jsx)("path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z"}),(0,Z.jsx)("path",{d:"M12 8 7.26 5.15"}),(0,Z.jsx)("path",{d:"m12 8 4.74-2.85"}),(0,Z.jsx)("path",{d:"M12 13.5V8"})]}),b4=(0,Z.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"}),(0,Z.jsx)("polyline",{points:"2 2 6 6 2 6"}),(0,Z.jsx)("polyline",{points:"22 2 18 6 22 6"}),(0,Z.jsx)("polyline",{points:"2 22 6 18 2 18"}),(0,Z.jsx)("polyline",{points:"22 22 18 18 22 18"})]}),S4=(0,Z.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("rect",{x:"9",y:"9",width:"6",height:"6",rx:"1"}),(0,Z.jsx)("polyline",{points:"3 3 7 7 3 7"}),(0,Z.jsx)("polyline",{points:"21 3 17 7 21 7"}),(0,Z.jsx)("polyline",{points:"3 21 7 17 3 17"}),(0,Z.jsx)("polyline",{points:"21 21 17 17 21 17"})]}),x4=(0,Z.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,Z.jsx)("line",{x1:"12",y1:"2",x2:"12",y2:"4"}),(0,Z.jsx)("line",{x1:"12",y1:"20",x2:"12",y2:"22"}),(0,Z.jsx)("line",{x1:"4.93",y1:"4.93",x2:"6.34",y2:"6.34"}),(0,Z.jsx)("line",{x1:"17.66",y1:"17.66",x2:"19.07",y2:"19.07"}),(0,Z.jsx)("line",{x1:"2",y1:"12",x2:"4",y2:"12"}),(0,Z.jsx)("line",{x1:"20",y1:"12",x2:"22",y2:"12"}),(0,Z.jsx)("line",{x1:"4.93",y1:"19.07",x2:"6.34",y2:"17.66"}),(0,Z.jsx)("line",{x1:"17.66",y1:"6.34",x2:"19.07",y2:"4.93"})]}),_4=(0,Z.jsx)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,Z.jsx)("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),E4=(0,Z.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),(0,Z.jsx)("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),(0,Z.jsx)("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),T4=(0,Z.jsx)("svg",{className:"graph-toolbar-validation-spin",viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,Z.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),N4=(0,Z.jsx)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,Z.jsx)("polyline",{points:"20 6 9 17 4 12"})}),C4=(0,Z.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Z.jsx)("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),(0,Z.jsx)("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]}),w4=(0,Z.jsxs)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),(0,Z.jsx)("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),(0,Z.jsx)("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]});function A4(e){switch(e){case ln.VALIDATING:return T4;case ln.VALID:return N4;case ln.INVALID:return C4;case ln.ERROR:return w4;default:return e}}var vg=[St.SYSTEM,St.LIGHT,St.DARK];function kT(e){let t=vg.indexOf(e);return vg[(t+1)%vg.length]}function M4(e){return e===St.LIGHT?x4:e===St.DARK?_4:E4}function HT(e){let t={[St.SYSTEM]:"system",[St.LIGHT]:"light",[St.DARK]:"dark"},n=kT(e);return`Theme: ${t[e]} \u2014 switch to ${t[n]}`}function GT({direction:e,onDirectionChange:t,showControllers:n,onShowControllersChange:o,onZoomIn:i,onZoomOut:a,onFitView:r,onFoldAll:l,onExpandAll:s,foldAllDisabled:u=!1,expandAllDisabled:c=!1,themeMode:d,onThemeModeChange:f,rightOffset:p=0,position:v,validationState:b,validationIssues:x=[],onValidationIssueClick:g,validationOpen:h=!1,onValidationOpenChange:m}){let y=d!==void 0&&f!==void 0,S=_1(v),E=m??(()=>{}),_=dl.default.useRef(E);_.current=E;let w=dl.default.useRef(null),C=dl.default.useId();dl.default.useEffect(()=>{b===void 0&&_.current(!1)},[b]),dl.default.useEffect(()=>{if(!h)return;let O=Y=>{let G=w.current;G&&Y.target instanceof Node&&!G.contains(Y.target)&&_.current(!1)},L=Y=>{Y.key==="Escape"&&_.current(!1)};return document.addEventListener("mousedown",O),document.addEventListener("keydown",L),()=>{document.removeEventListener("mousedown",O),document.removeEventListener("keydown",L)}},[h]);let M=E1(v)==="right"&&p>0?{marginRight:d4+p}:void 0,z=e===Cn.TB||e===Cn.BT,I=z?"Switch to horizontal layout":"Switch to vertical layout",T=n?"Hide pipe controllers":"Show pipe controllers \u2014 groups pipes by their controlling pipe",D=l||s,A=u?"Fold all controllers (nothing to fold)":"Fold all controllers",R=c?"Expand all controllers (nothing to expand)":"Expand all controllers";return(0,Z.jsx)(sl,{position:v,className:"graph-toolbar-panel",style:M,children:(0,Z.jsxs)("div",{className:`graph-toolbar graph-toolbar--${S}`,children:[b!==void 0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)("div",{className:"graph-toolbar-validation",ref:w,children:[(0,Z.jsxs)("button",{type:"button",className:`graph-toolbar-btn graph-toolbar-validation-btn graph-toolbar-validation-btn--${b}`,onClick:()=>E(!h),title:Qf(b,x.length),"aria-label":Qf(b,x.length),"aria-expanded":h,"aria-haspopup":"true","aria-controls":C,children:[A4(b),x.length>0&&(0,Z.jsx)("span",{className:"graph-toolbar-validation-badge",children:x.length>99?"99+":x.length})]}),h&&(0,Z.jsx)(BT,{id:C,state:b,issues:x,onIssueClick:g,placement:PT(v)})]}),(0,Z.jsx)("div",{className:"graph-toolbar-separator"})]}),l&&(0,Z.jsx)("button",{type:"button",className:"graph-toolbar-btn",onClick:l,disabled:u,title:A,"aria-label":A,children:b4}),s&&(0,Z.jsx)("button",{type:"button",className:"graph-toolbar-btn",onClick:s,disabled:c,title:R,"aria-label":R,children:S4}),D&&(0,Z.jsx)("div",{className:"graph-toolbar-separator"}),(0,Z.jsx)("button",{type:"button",className:`graph-toolbar-btn${n?" graph-toolbar-btn--active":""}`,onClick:()=>o(!n),title:T,"aria-label":T,children:v4}),(0,Z.jsx)("button",{type:"button",className:"graph-toolbar-btn",onClick:()=>t(z?Cn.LR:Cn.TB),title:I,"aria-label":I,children:z?p4:m4}),(a||i||r)&&(0,Z.jsx)("div",{className:"graph-toolbar-separator"}),a&&(0,Z.jsx)("button",{type:"button",className:"graph-toolbar-btn",onClick:a,title:"Zoom out","aria-label":"Zoom out",children:h4}),i&&(0,Z.jsx)("button",{type:"button",className:"graph-toolbar-btn",onClick:i,title:"Zoom in","aria-label":"Zoom in",children:g4}),r&&(0,Z.jsx)("button",{type:"button",className:"graph-toolbar-btn",onClick:r,title:"Fit view","aria-label":"Fit view",children:y4}),y&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)("div",{className:"graph-toolbar-separator"}),(0,Z.jsx)("button",{type:"button",className:"graph-toolbar-btn",onClick:()=>f(kT(d)),title:HT(d),"aria-label":HT(d),children:M4(d)})]})]})})}var bg=J(de(),1);function Wf({validation:e,onClick:t}){let n=`${e.count} validation ${e.count===1?"issue":"issues"}`,o=e.lines.join(`
18
18
  `),i=`node-validation-badge node-validation-badge--${e.severity}`,a=e.count>99?"99+":String(e.count);return t?(0,bg.jsx)("button",{type:"button",className:i,title:o,"aria-label":`${n} \u2014 open validation panel`,onClick:r=>{r.stopPropagation(),t()},children:a}):(0,bg.jsx)("span",{className:i,title:o,"aria-label":n,children:a})}function Jf(e){return e?` node-validation-ring--${e.severity}`:""}var Ro=J(de(),1),D4={PipeSequence:{badge:"Sequence",icon:"\u2192"},PipeParallel:{badge:"Parallel",icon:"//"},PipeCondition:{badge:"Condition",icon:"\u25C7"},PipeBatch:{badge:"Batch",icon:"\u2261"}};function R4(e){return e?D4[e]:{badge:"",icon:""}}function O4(e){return e?`controller-group--${e.replace("Pipe","").toLowerCase()}`:""}function z4({data:e}){let t=R4(e.pipeType),n=O4(e.pipeType),o=(e.pipeType==="PipeParallel"||e.pipeType==="PipeBatch")&&(e.childCount??0)>tu,i=o?(e.childCount??0)-tu:0;return(0,Ro.jsxs)("div",{className:`controller-group-node ${n}${Jf(e.validation)}`,children:[(0,Ro.jsxs)("div",{className:"controller-group-header",children:[(0,Ro.jsx)("span",{className:"controller-group-icon",children:t.icon}),(0,Ro.jsx)("span",{className:"controller-group-badge",children:t.badge}),e.label&&(0,Ro.jsx)("span",{className:"controller-group-label",children:e.label}),e.onToggleFold&&(0,Ro.jsx)("button",{type:"button",className:"controller-group-fold",title:"Fold controller (alt/option: only this one)","aria-label":"Fold controller",onClick:a=>{a.stopPropagation(),e.onToggleFold?.({soloMode:a.altKey})},children:"\u2921"}),e.validation&&(0,Ro.jsx)(Wf,{validation:e.validation,onClick:e.onValidationBadgeClick})]}),o&&(0,Ro.jsx)("button",{className:"controller-group-collapse",onClick:a=>{a.stopPropagation(),e.onToggleCollapse?.()},children:e.isCollapsed?`+${i} hidden`:"collapse"})]})}var IT={controllerGroup:z4};var UT=J(Et(),1);var Ge=J(de(),1),L4={PipeLLM:"LLM",PipeExtract:"Extract",PipeCompose:"Compose",PipeImgGen:"ImgGen",PipeSearch:"Search",PipeFunc:"Func",PipeStructure:"Structure",PipeSignature:"Signature",PipeSequence:"Sequence",PipeParallel:"Parallel",PipeCondition:"Condition",PipeBatch:"Batch"},P4={PipeSequence:!0,PipeParallel:!0,PipeCondition:!0,PipeBatch:!0};function B4(e){return e in P4}var H4={succeeded:{color:"#50FA7B",label:"Succeeded"},failed:{color:"#FF5555",label:"Failed"},running:{color:"#8BE9FD",label:"Running"},scheduled:{color:"#6272a4",label:"Scheduled"},skipped:{color:"#6272a4",label:"Skipped"},canceled:{color:"#6272a4",label:"Canceled"}},Sg=4;function k4(e){return L4[e]}function Kt({data:e,children:t}){let n=k4(e.pipeType),o=H4[e.status],i=e.status==="running",a=B4(e.pipeType),r=e.pipeType==="PipeSignature",l=e.graphMode==="static",s=l?e.tags?.outcome:void 0,u=l?e.tags?.batch_multiplicity:void 0,[c,d]=(0,UT.useState)(!1),f=e.inputs.length>Sg,p=f&&!c?e.inputs.slice(0,Sg):e.inputs,v=e.inputs.length-Sg,b=e.direction==="TB"?"pipe-card--tb":"pipe-card--lr",x=a?" pipe-card--controller":"",g=r?" pipe-card--signature":"",h=l?" pipe-card--static":"",m=a?"pipe-card-badge pipe-card-badge--controller":r?"pipe-card-badge pipe-card-badge--signature":"pipe-card-badge",y=Jf(e.validation);return(0,Ge.jsxs)("div",{className:`pipe-card ${b}${x}${g}${h}${y}`,children:[(0,Ge.jsxs)("div",{className:"pipe-card-header",children:[(0,Ge.jsx)("span",{className:m,children:n}),(0,Ge.jsx)("span",{className:"pipe-card-code",title:e.pipeCode,children:e.pipeCode}),!l&&(0,Ge.jsx)("span",{className:"pipe-card-status",style:{color:o.color},title:o.label,children:(0,Ge.jsx)("span",{className:`pipe-card-status-dot ${i?"pipe-card-status-dot--pulse":""}`,style:{background:o.color}})}),e.onExpand&&(0,Ge.jsx)("button",{type:"button",className:"pipe-card-expand",title:"Expand controller (alt/option: only this one)","aria-label":"Expand controller",onClick:S=>{S.stopPropagation(),e.onExpand?.({soloMode:S.altKey})},children:"\u2922"}),e.validation&&(0,Ge.jsx)(Wf,{validation:e.validation,onClick:e.onValidationBadgeClick})]}),(s||u)&&(0,Ge.jsxs)("div",{className:"pipe-card-annotations",children:[s&&(0,Ge.jsxs)("span",{className:"pipe-card-annotation pipe-card-annotation--outcome",children:["outcome: ",s]}),u&&(0,Ge.jsx)("span",{className:"pipe-card-annotation pipe-card-annotation--batch",children:u})]}),e.description&&(0,Ge.jsx)("span",{className:"pipe-card-description",title:e.description,children:e.description}),e.inputs.length>0&&(0,Ge.jsxs)("div",{className:"pipe-card-io",children:[(0,Ge.jsx)("span",{className:"pipe-card-io-label",children:"INPUTS"}),(0,Ge.jsxs)("div",{className:"pipe-card-io-pills",children:[p.map(S=>(0,Ge.jsxs)("span",{className:"pipe-card-io-pill",title:`${S.name}: ${S.concept}`,children:[(0,Ge.jsx)("span",{className:"pipe-card-io-pill-name",children:S.name}),(0,Ge.jsx)("span",{className:"pipe-card-io-pill-concept",children:S.concept})]},S.name)),f&&(0,Ge.jsx)("button",{className:"pipe-card-io-more",onClick:S=>{S.stopPropagation(),d(E=>!E)},children:c?"show less":`+${v} more`})]})]}),e.outputs.length>0&&(0,Ge.jsxs)("div",{className:"pipe-card-io",children:[(0,Ge.jsx)("span",{className:"pipe-card-io-label",children:"OUTPUT"}),(0,Ge.jsx)("div",{className:"pipe-card-io-pills",children:e.outputs.map(S=>(0,Ge.jsxs)("span",{className:"pipe-card-io-pill",title:`${S.name}: ${S.concept}`,children:[(0,Ge.jsx)("span",{className:"pipe-card-io-pill-name",children:S.name}),(0,Ge.jsx)("span",{className:"pipe-card-io-pill-concept",children:S.concept})]},S.name))})]}),t]})}var G4={PipeLLM:Kt,PipeExtract:Kt,PipeCompose:Kt,PipeImgGen:Kt,PipeSearch:Kt,PipeFunc:Kt,PipeStructure:Kt,PipeSignature:Kt,PipeSequence:Kt,PipeParallel:Kt,PipeCondition:Kt,PipeBatch:Kt};function VT(e){return G4[e]}var si=J(de(),1);function I4({data:e}){let t=VT(e.pipeType)??Kt;return(0,si.jsx)(t,{data:e})}function YT({data:e,sourcePosition:t=ne.Bottom,targetPosition:n=ne.Top}){let o=e.pipeCardData;return o?(0,si.jsxs)(si.Fragment,{children:[(0,si.jsx)(Ba,{type:"target",position:n}),(0,si.jsx)(I4,{data:o}),(0,si.jsx)(Ba,{type:"source",position:t})]}):null}var Ht=J(de(),1),U4={...IT,pipeCard:YT};function V4({nodeId:e,stuffData:t,graphspec:n,resolveStorageUrl:o,canEmbedPdf:i,onOpenExternally:a}){let r=t.concept&&n?Gh(n,t.concept):void 0,l=Eo(n)===Lc.DRY;return(0,Ht.jsx)(Ht.Fragment,{children:r?(0,Ht.jsx)(pg,{concept:r,ioData:t,isDryRun:l,instanceKey:e,resolveStorageUrl:o,canEmbedPdf:i,onOpenExternally:a}):l?(0,Ht.jsx)("div",{className:"detail-not-available",children:"Dry run data hidden"}):(0,Ht.jsx)(qf,{stuff:t,resolveStorageUrl:o,canEmbedPdf:i,onOpenExternally:a})})}function Y4(e,t){return e===no.FOLDED?new Set(t):new Set}function X4(e,t){return e??t??Ia.theme??St.SYSTEM}function xg(e,t){return e===St.SYSTEM?t:e}function q4(e,t){return e??t??Ia.toolbarPosition}function XT(e){return e?.replace(/\s*\bnode-validation-flash\b/,"")||void 0}function pl(e){return e.map(t=>({...t,position:{...t.position},data:{...t.data},style:t.style?{...t.style}:void 0}))}function Z4(e,t){return!t||Object.keys(t).length===0?e:e.map(n=>{if(n.data.graphMode==="static"||n.data.pipeCardData?.graphMode==="static")return n;let o=n.data.pipeCode;if(!o||!Object.hasOwn(t,o))return n;let i=t[o];return n.data.pipeCardData?.status===i?n:{...n,data:{...n.data,nodeData:n.data.nodeData?{...n.data.nodeData,status:i}:n.data.nodeData,pipeCardData:n.data.pipeCardData?{...n.data.pipeCardData,status:i}:n.data.pipeCardData}}})}function qT(e){let{graphspec:t,config:n=Ia,initialDirection:o,initialShowControllers:i,initialFoldMode:a,hideToolbar:r=!1,theme:l,toolbarPosition:s,systemTheme:u,showThemeToggle:c=!0,onThemeChange:d,onNavigateToPipe:f,onStuffNodeClick:p,onReactFlowInit:v,statusMap:b,onNodeSelect:x,onPaneClick:g,renderDetailExtra:h,resolveStorageUrl:m,canEmbedPdf:y,onOpenExternally:S,validationState:E,validationIssues:_,onValidationIssueClick:w}=e,C=ie.default.useMemo(()=>t===null?null:Gc(t),[t]),[P,M]=ie.default.useState(()=>o??n.direction??Ia.direction??Cn.TB),z=X4(l,n.theme),[I,T]=ie.default.useState(z),D=ie.default.useRef(z);ie.default.useEffect(()=>{z!==D.current&&(D.current=z,T(z))},[z]);let A=HE(u),R=xg(I,A),O=ie.default.useRef(d);O.current=d;let L=ie.default.useRef({mode:I,resolvedTheme:R});ie.default.useEffect(()=>{let ue=L.current;(ue.mode!==I||ue.resolvedTheme!==R)&&(L.current={mode:I,resolvedTheme:R},O.current?.(I,R))},[I,R]);let Y=a??n.foldMode??Ia.foldMode??no.EXPANDED,[G,X]=ie.default.useState(()=>Y===no.FOLDED?!0:i??n.showControllers??Ia.showControllers??!1),F=ie.default.useRef(Y);F.current=Y;let K=ie.default.useRef(null),[$,le]=ie.default.useState(null),[W,j]=ie.default.useState(null),{width:te,isDragging:ge,handleMouseDown:me}=gT({defaultWidth:380,minWidth:280,maxWidth:800,containerRef:K});ie.default.useEffect(()=>{le(null),j(null)},[C]),ie.default.useEffect(()=>{let ue=K.current;if(!ue)return;let ae=Kf(R),U=n.paletteColors,N=U?{...ae,...U}:ae;for(let[H,q]of Object.entries(N))ue.style.setProperty(H,q);return()=>{for(let H of Object.keys(N))ue.style.removeProperty(H)}},[n.paletteColors,R]);let[re,Q,xe]=DE([]),[Ne,_e,et]=RE([]),De=ie.default.useRef(null),we=ie.default.useRef(null),tt=ie.default.useRef(null),Pe=ie.default.useRef(null),[pn,lo]=ie.default.useState(new Set),On=ie.default.useCallback(ue=>{lo(ae=>{let U=new Set(ae);return U.has(ue)?U.delete(ue):U.add(ue),U})},[]),[nt,_t]=ie.default.useState(new Set),We=ie.default.useCallback((ue,ae)=>{_t(U=>{let N=new Set(U),H=!N.has(ue),q=tt.current,ce=!ae?.soloMode&&q?.graphspec&&q.analysis?UE(ue,q.graphspec,q.analysis.controllerNodeIds):new Set([ue]);for(let Ve of ce)H?N.add(Ve):N.delete(Ve);return N})},[]),so=n.edgeType||Pc.DEFAULT,Oo=ie.default.useMemo(()=>({nodesep:n.nodesep,ranksep:n.ranksep}),[n.nodesep,n.ranksep]),kt=ie.default.useRef(G);kt.current=G;let zo=ie.default.useRef(P);zo.current=P;let ui=ie.default.useRef(Oo);ui.current=Oo;let Kn=ie.default.useRef(n.initialZoom);Kn.current=n.initialZoom;let Lo=ie.default.useRef(n.panToTop);Lo.current=n.panToTop;let ct=ie.default.useRef(pn);ct.current=pn;let Gt=ie.default.useRef(On);Gt.current=On;let uo=ie.default.useRef(nt);uo.current=nt;let mn=ie.default.useRef(We);mn.current=We;let Ya=ie.default.useRef(!0),zn=ie.default.useRef(0),co=ie.default.useRef(!1),Xa=ie.default.useRef(b);Xa.current=b;let fo=ie.default.useRef(_);fo.current=_;let[ml,qa]=ie.default.useState(!1),$e=ie.default.useCallback(()=>qa(!0),[]),Ln=E!==void 0&&!r,Za=ie.default.useRef(Ln);Za.current=Ln;let Qt=ie.default.useCallback(ue=>{let ae=tt.current,U=XE(fo.current,ae?.graphspec??null,ae?.childToCtrl??{},uo.current);return ZE(Z4(TT(LT(ue)),Xa.current),U,Za.current?$e:void 0)},[$e]),ci=ie.default.useRef([]);ci.current=re;let Wi=ie.default.useRef(w);Wi.current=w;let po=ie.default.useRef(null);ie.default.useEffect(()=>()=>{po.current&&clearTimeout(po.current)},[]);let hl=ie.default.useCallback((ue,ae)=>{Wi.current?.(ue,ae);let U=tt.current;if(!U?.graphspec||!U.analysis)return;let N=qE(ae,U.graphspec,U.childToCtrl,uo.current,new Set(ci.current.map(H=>H.id)));N&&(De.current?.fitView({nodes:[{id:N}],duration:500,padding:.4}),po.current&&clearTimeout(po.current),Q(H=>H.map(q=>{let ce=XT(q.className);return q.id===N?{...q,className:ce?`${ce} node-validation-flash`:"node-validation-flash"}:ce===q.className?q:{...q,className:ce}})),po.current=setTimeout(()=>{Q(H=>H.map(q=>{let ce=XT(q.className);return ce===q.className?q:{...q,className:ce}}))},1800))},[Q]);ie.default.useEffect(()=>{if(!we.current)return;let ue=!1;return(async()=>{try{let ae=we.current;if(!ae)return;let U=await Ff(ae.nodes,ae.edges,P,Oo,ae._graphspec,ae._analysis);if(ue)return;Pe.current={nodes:U.nodes,edges:U.edges,controllerPositions:U.controllerPositions,graphspec:ae._graphspec};let N=Ga(pl(U.nodes),U.edges,ae._graphspec,ae._analysis,kt.current,ct.current,Gt.current,U.controllerPositions,mn.current);Q(Qt(N.nodes)),_e(cl(N.edges)),setTimeout(()=>{!ue&&De.current&&De.current.fitView({padding:.1})},50)}catch(ae){console.error("[GraphViewer] ELK layout failed:",ae)}})(),()=>{ue=!0}},[P,Oo]),ie.default.useEffect(()=>{if(!Pe.current||!we.current||Pe.current.graphspec!==we.current._graphspec)return;let ue=pl(Pe.current.nodes),ae=Pe.current.edges,U=Ga(ue,ae,we.current._graphspec,we.current._analysis,G,pn,On,Pe.current.controllerPositions,We);Q(Qt(U.nodes)),_e(cl(U.edges))},[G,pn,On,We,Qt]),ie.default.useEffect(()=>{if(!C){we.current=null,tt.current=null,Pe.current=null,Q([]),_e([]);return}let ue=!1;lo(new Set),ct.current=new Set;let{graphData:ae,analysis:U}=NT(C,so);tt.current={nodes:ae.nodes,edges:ae.edges,analysis:U,graphspec:C,childToCtrl:U?$n(C,U):{}};let N=U?Y4(F.current,U.controllerNodeIds):new Set;_t(N),uo.current=N,co.current=N.size>0,zn.current=N.size,N.size>0&&!kt.current&&(X(!0),kt.current=!0);let H=N.size>0&&U?Ih({nodes:ae.nodes,edges:ae.edges},U,C,N,mn.current):{nodes:ae.nodes,edges:ae.edges,analysis:U};return we.current={nodes:H.nodes,edges:H.edges,_analysis:H.analysis,_graphspec:C},(async()=>{try{let q=zo.current,ce=ui.current,Re=H.nodes.some(ot=>!ot.position||ot.position.x===0&&ot.position.y===0)?await Ff(H.nodes,H.edges,q,ce,C,H.analysis):{nodes:H.nodes,edges:H.edges,controllerPositions:{}};if(ue)return;Pe.current={nodes:Re.nodes,edges:Re.edges,controllerPositions:Re.controllerPositions,graphspec:C};let gt=Ga(pl(Re.nodes),Re.edges,C,H.analysis,kt.current,ct.current,Gt.current,Re.controllerPositions,mn.current);Q(Qt(gt.nodes)),_e(cl(gt.edges)),setTimeout(()=>{if(!ue&&De.current&&(De.current.fitView({padding:.1}),Kn.current!==void 0&&Kn.current!==null&&De.current.zoomTo(Kn.current),Lo.current)){let ot=De.current.getViewport();De.current.setViewport({x:ot.x,y:20,zoom:ot.zoom})}},100)}catch(q){console.error("[GraphViewer] ELK layout failed:",q)}})(),()=>{ue=!0}},[C,so]),ie.default.useEffect(()=>{if(Ya.current){Ya.current=!1,zn.current=nt.size;return}if(co.current){co.current=!1,zn.current=nt.size;return}let ue=zn.current;if(zn.current=nt.size,ue===0&&nt.size===0||!tt.current||!tt.current.analysis)return;let ae=tt.current,U=ae.graphspec,N=ae.analysis;if(!U||!N)return;let H=!1,q=Ih({nodes:ae.nodes,edges:ae.edges},N,U,nt,We);return we.current={nodes:q.nodes,edges:q.edges,_analysis:q.analysis,_graphspec:U},(async()=>{try{let ce=await Ff(q.nodes,q.edges,zo.current,ui.current,U,q.analysis);if(H)return;Pe.current={nodes:ce.nodes,edges:ce.edges,controllerPositions:ce.controllerPositions,graphspec:U};let Ve=Ga(pl(ce.nodes),ce.edges,U,q.analysis,kt.current,ct.current,Gt.current,ce.controllerPositions,mn.current);Q(Qt(Ve.nodes)),_e(cl(Ve.edges)),setTimeout(()=>{!H&&De.current&&De.current.fitView({padding:.1})},50)}catch(ce){console.error("[GraphViewer] ELK layout failed:",ce)}})(),()=>{H=!0}},[nt,We]),ie.default.useEffect(()=>{if(!Pe.current||!we.current||Pe.current.graphspec!==we.current._graphspec)return;let ue=pl(Pe.current.nodes),ae=Pe.current.edges,U=Ga(ue,ae,we.current._graphspec,we.current._analysis,kt.current,ct.current,Gt.current,Pe.current.controllerPositions,mn.current);Q(Qt(U.nodes)),_e(cl(U.edges))},[b,Qt]),ie.default.useEffect(()=>{if(!Pe.current||!we.current||Pe.current.graphspec!==we.current._graphspec)return;let ue=pl(Pe.current.nodes),ae=Ga(ue,Pe.current.edges,we.current._graphspec,we.current._analysis,kt.current,ct.current,Gt.current,Pe.current.controllerPositions,mn.current);Q(Qt(ae.nodes))},[_,Ln,Qt]);let It=ie.default.useCallback((ue,ae)=>{let U=ae.data;if(x?.(ae.id,U,ue),U.isController||U.isPipe){let N=U.pipeCode||U.labelText;N&&f&&f(N,U.pipeCardData?.status)}else if(U.isStuff&&p&&C){let N=bs(ae.id),H=Vh(C,N);H&&p(H)}if(j(null),$?.nodeId===ae.id&&!W)le(null);else if(U.isPipe||U.isController)le({kind:"pipe",nodeId:ae.id,nodeData:U});else if(U.isStuff&&C){let N=bs(ae.id),H=Vh(C,N);le({kind:"stuff",nodeId:ae.id,nodeData:U,stuffData:H??void 0})}Q(N=>N.map(H=>({...H,selected:H.id===ae.id})))},[Q,f,x,p,C,$,W]),Qn=ie.default.useCallback(ue=>{De.current=ue,v&&v(ue)},[v]),Ji=ie.default.useCallback(()=>{le(null),j(null),g?.()},[g]),ja=ie.default.useCallback(ue=>{if(!C)return;let ae=Gh(C,ue);ae&&j(ae)},[C]),fi=$?.kind==="pipe"&&C?C.nodes.find(ue=>ue.pipe_code===$.nodeData.pipeCode):void 0,di=$!==null||W!==null,hn=q4(s,n.toolbarPosition),Wn=tt.current?.analysis?.controllerNodeIds,mo=ie.default.useMemo(()=>!G||!Wn||Wn.size===0?{onFoldAll:void 0,onExpandAll:void 0,foldAllDisabled:!1,expandAllDisabled:!1}:{onFoldAll:()=>_t(new Set(Wn)),onExpandAll:()=>_t(new Set),foldAllDisabled:nt.size===Wn.size,expandAllDisabled:nt.size===0},[G,Wn,nt]);return(0,Ht.jsxs)("div",{ref:K,className:`react-flow-container react-flow-container--theme-${R} react-flow-container--mode-${I}`,children:[(0,Ht.jsxs)(ME,{nodes:re,edges:Ne,nodeTypes:U4,onNodesChange:xe,onEdgesChange:et,onNodeClick:It,onPaneClick:Ji,onInit:Qn,fitView:!0,fitViewOptions:{padding:.1},defaultEdgeOptions:{type:so},panOnScroll:!0,minZoom:.1,proOptions:{hideAttribution:!0},panActivationKeyCode:null,children:[(0,Ht.jsx)(zE,{variant:Ao.Dots,gap:20,size:1,color:"var(--color-bg-dots)"}),!r&&(0,Ht.jsx)(GT,{direction:P,onDirectionChange:M,showControllers:G,onShowControllersChange:X,onZoomIn:()=>{De.current?.zoomIn()},onZoomOut:()=>{De.current?.zoomOut()},onFitView:()=>{De.current?.fitView({padding:.1})},onFoldAll:mo.onFoldAll,onExpandAll:mo.onExpandAll,foldAllDisabled:mo.foldAllDisabled,expandAllDisabled:mo.expandAllDisabled,themeMode:c?I:void 0,onThemeModeChange:c?T:void 0,rightOffset:di?te:0,position:hn,validationState:E,validationIssues:_,onValidationIssueClick:hl,validationOpen:ml,onValidationOpenChange:qa})]}),(0,Ht.jsxs)(hT,{isOpen:di,onClose:Ji,width:te,isDragging:ge,onResizeHandleMouseDown:me,children:[W?(0,Ht.jsx)(pg,{concept:W}):fi&&C?(0,Ht.jsx)(ET,{node:fi,spec:C,onConceptClick:ja}):$?.stuffData?(0,Ht.jsx)(V4,{nodeId:$.nodeId,stuffData:$.stuffData,graphspec:C,resolveStorageUrl:m,canEmbedPdf:y,onOpenExternally:S}):null,h&&$&&!W&&h($.nodeId,$.nodeData)]})]})}function j4(e){if(e==null)return no.EXPANDED;if(e===no.FOLDED||e===no.EXPANDED||e===no.AUTO)return e;throw new Error(`Invalid foldMode in standalone config: ${JSON.stringify(e)} \u2014 expected one of "folded", "expanded", "auto".`)}function $4(e){if(e==null)return St.SYSTEM;if(e===St.LIGHT||e===St.DARK||e===St.SYSTEM)return e;throw new Error(`Invalid theme in standalone config: ${JSON.stringify(e)} \u2014 expected one of "dark", "light", "system".`)}function F4(e){if(e==null)return Cn.LR;if(e===Cn.LR||e===Cn.RL||e===Cn.TB||e===Cn.BT)return e;throw new Error(`Invalid direction in standalone config: ${JSON.stringify(e)} \u2014 expected one of "TB", "BT", "LR", "RL".`)}function K4(e){if(e==null)return;let t=Object.values(Je);if(t.includes(e))return e;throw new Error(`Invalid toolbarPosition in standalone config: ${JSON.stringify(e)} \u2014 expected one of ${t.map(n=>`"${n}"`).join(", ")}.`)}function _g(e,t){let n=e&&typeof e=="object"?e:{},o=F4(n.direction),i=!!n.showControllers,a=j4(n.foldMode),r=$4(n.theme),l=K4(n.toolbarPosition);return{graphspec:t,config:{...n,direction:o,showControllers:i,foldMode:a,theme:r,toolbarPosition:l},initialDirection:o,initialShowControllers:i,initialFoldMode:a,theme:r}}function ZT(e,t){let n=e?.trim();if(!n)return null;try{return JSON.parse(n)}catch(o){let i=o instanceof Error?o.message:String(o);throw new Error(`Failed to parse JSON from <script id="${t}">: ${i}`)}}var nu=_g({},null),Eg=null;function jT(e){return ZT(document.getElementById(e)?.textContent,e)}function Q4(e,t){let n=Kf(e),o=t?{...n,...t}:n;for(let[i,a]of Object.entries(o))document.body.style.setProperty(i,a)}function KT(e,t){document.body.setAttribute("data-theme",e),Q4(t,nu.config.paletteColors)}function W4(){return Va.default.createElement(qT,{...nu,onThemeChange:(e,t)=>{KT(e,t)}})}function J4({message:e}){return Va.default.createElement("div",{className:"standalone-error",role:"alert"},Va.default.createElement("strong",{className:"standalone-error-title"},"Failed to render method graph"),Va.default.createElement("pre",{className:"standalone-error-message"},e))}function $T(){let e=document.getElementById("root");if(!e)return;let t=(0,FT.createRoot)(e);Eg=()=>{t.render(Va.default.createElement(W4))},Eg(),setTimeout(()=>{try{let n=jT("pipelex-config"),o=jT("pipelex-graphspec"),i=o===null?null:Gc(o);nu=_g(n,i),KT(nu.theme,xg(nu.theme,kh())),Eg?.()}catch(n){let o=n instanceof Error?n.message:String(n);t.render(Va.default.createElement(J4,{message:o}))}},0)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",$T):$T();})();
19
19
  /*! Bundled license information:
20
20