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