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