import{d as A,B as x,I as w,J as P,c as h,f as s,g as B,u as T,o as b,j as r,k as n,D as k,E as i,z as D,K,P as m,Y as N}from"./index-BrFqolpA.js";import{_ as V}from"./AutomationWizard.vue_vue_type_script_setup_true_lang-BSlCZivh.js";import{u as Y}from"./usePageTitle-CsnULHHx.js";import{u as j}from"./usePrefectApi-Q0V-aAwL.js";const O=A({__name:"AutomationCreate",async setup(v){let e,u;Y("Create Automation");const f=j(),c=x(),l=T(),_=[{text:"Automations",to:c.automations()},{text:"Create"}],{getActions:p,getTrigger:g}=w(),d=([e,u]=P(()=>C()),e=await e,u(),e);async function C(){const o={},[t,a]=await Promise.all([g(),p()]);return t&&(o.trigger=t),a&&(o.actions=a),o}async function y(o){try{await f.automations.createAutomation(o),m(i.success.automationCreate),l.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(),h(a,{class:"automation-create"},{header:s(()=>[r(n(K),{crumbs:_},{actions:s(()=>[r(n(k),{to:n(i).docs.automations},{default:s(()=>t[0]||(t[0]=[D(" Documentation ")])),_:1},8,["to"])]),_:1})]),default:s(()=>[r(V,{automation:n(d),onSubmit:y},null,8,["automation"])]),_:1})}}});export{O as default};
//# sourceMappingURL=AutomationCreate-zsRw4WzA.js.map
