import{d as B,h as C,f as O,t as D,j as n,c as p,k as e,a as N,l as s,i as T,o as c,m as a,n as o,p as V,q as F,Z as I,v as P,x as _,y as U,z as W,A as Z,B as j,F as q,C as w}from"./index-CgvuCQfr.js";import{u as z}from"./usePageTitle-DVT0B9Gy.js";import{u as E}from"./usePrefectApi-BpSnfZdy.js";const L=_("span",{class:"automation-card__label"},"Trigger",-1),R={class:"automation-card__label"},K=B({__name:"Automation",setup(S){const r=C(),d=T(),f=E(),v=O("automationId"),i=D(f.automations.getAutomation,[v]),t=n(()=>i.response),g=n(()=>{var u;return((u=t.value)==null?void 0:u.name)??""}),y=n(()=>[{text:"Automations",to:r.automations()},{text:g.value}]),h=n(()=>t.value?`Automation: ${t.value.name}`:"Automation");z(h);function A(){d.push(r.automations())}return(u,$)=>{const k=s("p-key-value"),l=s("p-content"),b=s("p-card"),x=s("p-layout-default");return t.value?(c(),p(x,{key:0,class:"automation"},{header:e(()=>[a(o(I),{crumbs:y.value},{actions:e(()=>[a(o(V),{automation:t.value,onUpdate:o(i).refresh},null,8,["automation","onUpdate"]),a(o(F),{automation:t.value,onDelete:A},null,8,["automation"])]),_:1},8,["crumbs"])]),default:e(()=>[a(l,null,{default:e(()=>[a(k,{label:"Description",value:t.value.description},null,8,["value"]),a(l,{secondary:""},{default:e(()=>[L,a(o(P),{trigger:t.value.trigger},null,8,["trigger"])]),_:1}),a(l,{secondary:""},{default:e(()=>[_("span",R,U(o(W)("Action",t.value.actions.length)),1),(c(!0),Z(q,null,j(t.value.actions,m=>(c(),p(b,{key:m.id},{default:e(()=>[a(o(w),{action:m},null,8,["action"])]),_:2},1024))),128))]),_:1})]),_:1})]),_:1})):N("",!0)}}});export{K as default};
//# sourceMappingURL=Automation-BWz-aFYG.js.map
