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