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