import{d as k,h as b,l as i,o as s,c as m,k as o,m as t,x as c,n as e,D as A,y as v,p as E,q as P,A as d,a as C,v as T,E as U,B as $,F as h,C as F,t as I,j as y,G as S,H as Z,I as j,Z as q,J as w,K as z}from"./index-CgvuCQfr.js";import{u as G}from"./usePageTitle-DVT0B9Gy.js";import{u as H}from"./usePrefectApi-BpSnfZdy.js";const J={class:"automation-card__header"},K={class:"automation-card__header-actions"},L={key:0,class:"automation-card__description"},W=c("span",{class:"automation-card__label"},"Trigger",-1),M={class:"automation-card__label"},Q=k({__name:"AutomationCard",props:{automation:{}},emits:["update"],setup(B,{emit:_}){const l=_,p=b();return(a,n)=>{const f=i("p-link"),u=i("p-content"),g=i("p-card");return s(),m(g,{class:"automation-card"},{default:o(()=>[t(u,null,{default:o(()=>[t(u,{secondary:""},{default:o(()=>[c("div",J,[t(f,{class:"automation-card__name",to:e(p).automation(a.automation.id)},{default:o(()=>[A(v(a.automation.name),1)]),_:1},8,["to"]),c("div",K,[t(e(E),{automation:a.automation,onUpdate:n[0]||(n[0]=r=>l("update"))},null,8,["automation"]),t(e(P),{automation:a.automation,onDelete:n[1]||(n[1]=r=>l("update"))},null,8,["automation"])])]),a.automation.description?(s(),d("p",L,v(a.automation.description),1)):C("",!0)]),_:1}),t(u,{secondary:""},{default:o(()=>[W,t(e(T),{trigger:a.automation.trigger},null,8,["trigger"])]),_:1}),t(u,{secondary:""},{default:o(()=>[c("span",M,v(e(U)("Action",a.automation.actions.length)),1),(s(!0),d(h,null,$(a.automation.actions,r=>(s(),m(g,{key:r.id},{default:o(()=>[t(e(F),{action:r},null,8,["action"])]),_:2},1024))),128))]),_:1})]),_:1})]),_:1})}}}),x=k({__name:"Automations",setup(B){const _=b();G("Automations");const l=[{text:"Automations"}],p=H(),a=I(p.automations.getAutomations),n=y(()=>a.response??[]),f=y(()=>a.executed),u=y(()=>n.value.length===0);return(g,r)=>{const O=i("p-button"),D=i("p-virtual-scroller"),N=i("p-layout-default");return s(),m(N,{class:"automations"},{header:o(()=>[t(e(q),{crumbs:l},S({"after-crumbs":o(()=>[t(O,{size:"sm",icon:"PlusIcon",to:e(_).automationCreate()},null,8,["to"])]),_:2},[u.value?void 0:{name:"actions",fn:o(()=>[t(e(Z),{to:e(j).docs.automations},{default:o(()=>[A(" Documentation ")]),_:1},8,["to"])]),key:"0"}]),1024)]),default:o(()=>[f.value?(s(),d(h,{key:0},[u.value?(s(),m(e(w),{key:0})):(s(),d(h,{key:1},[t(e(z),{count:n.value.length,label:"automation"},null,8,["count"]),t(D,{items:n.value,class:"automations-list"},{default:o(({item:V})=>[t(Q,{automation:V,onUpdate:e(a).refresh},null,8,["automation","onUpdate"])]),_:1},8,["items"])],64))],64)):C("",!0)]),_:1})}}});export{x as default};
//# sourceMappingURL=Automations-BkOLNl2l.js.map
