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