import{d as y,V as A,u as b,W as w,I as g,j as h,k,c as v,o as C,l as a,m as u,p as e,y as U,U as V,G as r,B,K as d,Y as I}from"./index-C_HOOOpe.js";import{_ as E}from"./AutomationWizard.vue_vue_type_script_setup_true_lang-CzbBuGt2.js";import{u as N}from"./usePageTitle-DzYzWO1v.js";import{u as P}from"./usePrefectApi-sSXMpdgS.js";import"./mapper-CIsJmmgQ.js";import"./api-B9c0WAfg.js";const G=y({__name:"AutomationEdit",async setup(T){let o,m;const i=P(),c=A(),_=b(),p=w("automationId"),s=([o,m]=g(()=>i.automations.getAutomation(p.value)),o=await o,m(),o);N(`Edit Automation: ${s.name}`);const f=h(()=>[{text:"Automations",to:c.automations()},{text:s.name}]);async function x(l){try{await i.automations.updateAutomation(p.value,l),d(r.success.automationUpdate),_.push(c.automations())}catch(t){console.error(t);const n=I(t,r.error.automationUpdate);d(n,"error",{timeout:!1})}}return(l,t)=>{const n=k("p-layout-default");return C(),v(n,{class:"workspace-automation-create"},{header:a(()=>[u(e(U),{crumbs:f.value},{actions:a(()=>[u(e(V),{to:e(r).docs.automations},{default:a(()=>t[0]||(t[0]=[B(" Documentation ")])),_:1},8,["to"])]),_:1},8,["crumbs"])]),default:a(()=>[u(E,{automation:e(s),editing:"",onSubmit:x},null,8,["automation"])]),_:1})}}});export{G as default};
//# sourceMappingURL=AutomationEdit-Csrp3wW8.js.map
