import{h as s,ad as a,at as F,r as l,j as o,L as x,aP as j,aQ as P}from"./index-f9c70843.js";import{I as h}from"./index-2cf85b82.js";import"./index-d8909728.js";import"./tabs-d59cdba9.js";import"./index-0665146f.js";import"./input-ae70f3cc.js";import"./textarea-2b2c5564.js";import"./table-ef59afbe.js";import"./index-21d0a8f9.js";import"./index-6a592cdd.js";import"./popover-6c4eec5c.js";import"./index-ec47a6a3.js";function D(){const t=s(e=>e.currentFlow),c=s(e=>e.getFlowById),m=s(e=>e.setCurrentFlowId);s(e=>e.currentFlowId);const p=s(e=>e.setCurrentFlow),i=a(e=>e.setNodes),d=a(e=>e.setEdges),u=a(e=>e.CleanFlowPool),{id:r}=F(),[f,w]=l.useState(!0);async function g(){const e=await j(r);return P(e,e.id,!1,!0)}return l.useEffect(()=>{c(r)?m(r):g().then(e=>{p(e)})},[r]),l.useEffect(()=>{var e,n;return t&&(i(((e=t==null?void 0:t.data)==null?void 0:e.nodes)??[],!0),d(((n=t==null?void 0:t.data)==null?void 0:n.edges)??[],!0),u(),w(!1)),()=>{i([],!0),d([],!0),u()}},[t]),o.jsx("div",{className:"flex h-full w-full flex-col items-center justify-center align-middle",children:f?o.jsx("div",{children:o.jsx(x,{remSize:24})}):o.jsx(h,{open:!0,setOpen:()=>{},isPlayground:!0,children:o.jsx(o.Fragment,{})})})}export{D as default};
