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