import{_ as e,a as t,c as n,i as r,s as i}from"./i18n-DfIivedY.js";import{Dt as a,It as o,s}from"./app-BUWZBqJJ.js";import{WorkflowForm as c}from"./workflow-form-BwQhlel2.js";var l=e(),u=t();function d(e){let t=(0,l.c)(47),{workflow:d,agents:f}=e,{t:p}=r(),m;t[0]===p?m=t[1]:(m=p(`Workflows`),t[0]=p,t[1]=m);let h;t[2]===m?h=t[3]:(h={title:m,href:`/app/workflows`},t[2]=m,t[3]=h);let g=`/app/workflows/${d.id}/edit`,_;t[4]!==g||t[5]!==d.name?(_={title:d.name,href:g},t[4]=g,t[5]=d.name,t[6]=_):_=t[6];let v;t[7]!==h||t[8]!==_?(v=[h,_],t[7]=h,t[8]=_,t[9]=v):v=t[9];let y=v,b;t[10]!==p||t[11]!==d.name?(b=p(`Edit :name`,{name:d.name}),t[10]=p,t[11]=d.name,t[12]=b):b=t[12];let x;t[13]===b?x=t[14]:(x=(0,u.jsx)(i,{title:b}),t[13]=b,t[14]=x);let S;t[15]===d.name?S=t[16]:(S=(0,u.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:d.name}),t[15]=d.name,t[16]=S);let C=`/app/workflows/${d.id}/canvas`,w;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,u.jsx)(o,{className:`me-1 size-4`}),t[17]=w):w=t[17];let T;t[18]===p?T=t[19]:(T=p(`Open canvas`),t[18]=p,t[19]=T);let E;t[20]!==T||t[21]!==C?(E=(0,u.jsx)(a,{asChild:!0,variant:`outline`,size:`sm`,children:(0,u.jsxs)(n,{href:C,children:[w,` `,T]})}),t[20]=T,t[21]=C,t[22]=E):E=t[22];let D;t[23]!==E||t[24]!==S?(D=(0,u.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[S,E]}),t[23]=E,t[24]=S,t[25]=D):D=t[25];let O;t[26]!==d.agent_id||t[27]!==d.keywords||t[28]!==d.name||t[29]!==d.status||t[30]!==d.steps||t[31]!==d.trigger_kind?(O={name:d.name,status:d.status,agent_id:d.agent_id,trigger_kind:d.trigger_kind,keywords:d.keywords,steps:d.steps},t[26]=d.agent_id,t[27]=d.keywords,t[28]=d.name,t[29]=d.status,t[30]=d.steps,t[31]=d.trigger_kind,t[32]=O):O=t[32];let k=`/app/workflows/${d.id}`,A;t[33]===p?A=t[34]:(A=p(`Save workflow`),t[33]=p,t[34]=A);let j;t[35]!==f||t[36]!==O||t[37]!==k||t[38]!==A?(j=(0,u.jsx)(c,{initial:O,method:`patch`,action:k,submitLabel:A,agents:f}),t[35]=f,t[36]=O,t[37]=k,t[38]=A,t[39]=j):j=t[39];let M;t[40]!==D||t[41]!==j?(M=(0,u.jsxs)(`div`,{className:`flex flex-1 flex-col gap-4 p-4`,children:[D,j]}),t[40]=D,t[41]=j,t[42]=M):M=t[42];let N;return t[43]!==y||t[44]!==M||t[45]!==x?(N=(0,u.jsxs)(s,{breadcrumbs:y,children:[x,M]}),t[43]=y,t[44]=M,t[45]=x,t[46]=N):N=t[46],N}export{d as default};