import{d as b,ao as g,j as m,u as t,c as v,w as p,m as D,r as k,ah as F,o as T,a as d,b6 as x,b7 as B,b8 as S,b9 as I}from"./index-4d9fe32c-718dc5d9.js";import{L as i}from"./prefect-design-a921a7c6.js";import{u as L,c as N}from"./vue-compositions-55710141.js";import{u as V}from"./usePageTitle-e8e2e29d.js";import"./index-558d177a.js";import{r as y}from"./routes-1bd54f1a.js";import"./meta-26546594.js";const G=b({__name:"FlowRunCreate",setup($){const u=g(),n=L("deploymentId"),a=F(),f=N(u.deployments.getDeployment,[n]),e=m(()=>f.response),w=async s=>{var r,o;try{const l=await u.deployments.createDeploymentFlowRun(n.value,s),c=((o=(r=s.state)==null?void 0:r.stateDetails)==null?void 0:o.scheduledTime)??void 0,R=!c,C=S(I,{flowRun:l,flowRunRoute:y.flowRun,router:a,immediate:R,startTime:c});i(C,"success"),a.push(y.deployment(n.value))}catch(l){i("Something went wrong trying to create a flow run","error"),console.error(l)}},_=()=>{a.back()},h=m(()=>e.value?`Create Flow Run for Deployment: ${e.value.name}`:"Create Flow Run for Deployment");return V(h),(s,r)=>{const o=k("p-layout-default");return t(e)?(T(),v(o,{key:0},{header:p(()=>[d(t(x),{deployment:t(e)},null,8,["deployment"])]),default:p(()=>[d(t(B),{deployment:t(e),onSubmit:w,onCancel:_},null,8,["deployment"])]),_:1})):D("",!0)}}});export{G as default};
