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