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