import{d as x,f as y,u as h,H as w,I as T,h as b,c as k,o as B,i as s,k as r,m as n,z as O,O as P,G as i,B as J,J as m,Y as N}from"./index-CWv_Pcr2.js";import{_ as V}from"./AutomationWizard.vue_vue_type_script_setup_true_lang-CxFzW7kc.js";import{u as Y}from"./usePageTitle-DY9DP8zZ.js";import{u as j}from"./usePrefectApi-DefSgQ13.js";import"./mapper-CBOLB2hm.js";const R=x({__name:"AutomationCreate",async setup(v){let e,u;Y("Create Automation");const l=j(),c=y(),f=h(),p=[{text:"Automations",to:c.automations()},{text:"Create"}],{getActions:_,getTrigger:d}=w(),g=([e,u]=T(()=>C()),e=await e,u(),e);async function C(){const o={},[t,a]=await Promise.all([d(),_()]);return t&&(o.trigger=t),a&&(o.actions=a),o}async function A(o){try{await l.automations.createAutomation(o),m(i.success.automationCreate),f.push(c.automations())}catch(t){console.error(t);const a=N(t,i.error.automationCreate);m(a,"error",{timeout:!1})}}return(o,t)=>{const a=b("p-layout-default");return B(),k(a,{class:"automation-create"},{header:s(()=>[r(n(O),{crumbs:p},{actions:s(()=>[r(n(P),{to:n(i).docs.automations},{default:s(()=>[...t[0]||(t[0]=[J(" Documentation ",-1)])]),_:1},8,["to"])]),_:1})]),default:s(()=>[r(V,{automation:n(g),onSubmit:A},null,8,["automation"])]),_:1})}}});export{R as default};
//# sourceMappingURL=AutomationCreate-BSUGLJsz.js.map
