import{d as A,f as y,K as h,L as w,c as b,i as s,j as T,g as B,o as N,l as r,m as n,E as P,G as i,B as k,Z as E,M as m,N as K}from"./index-7qezL2zM.js";import{_ as V}from"./AutomationWizard.vue_vue_type_script_setup_true_lang-B0dJblCd.js";import{u as Z}from"./usePageTitle-k72s0--o.js";import{u as j}from"./usePrefectApi-Z5ZnFhWQ.js";const O=A({__name:"AutomationCreate",async setup(v){let e,u;Z("Create Automation");const _=j(),c=y(),l=B(),f=[{text:"Automations",to:c.automations()},{text:"Create"}],{getActions:p,getTrigger:g}=h(),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 x(t){try{await _.automations.createAutomation(t),m(i.success.automationCreate),l.push(c.automations())}catch(o){console.error(o);const a=K(o,i.error.automationCreate);m(a,"error",{timeout:!1})}}return(t,o)=>{const a=T("p-layout-default");return N(),b(a,{class:"automation-create"},{header:s(()=>[r(n(E),{crumbs:f},{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:x},null,8,["automation"])]),_:1})}}});export{O as default};
//# sourceMappingURL=AutomationCreate-Da58y0xU.js.map
