import{d as D,k as h,W as v,t as b,h as l,c as k,i as s,a as w,j as C,o as g,l as c,m as r,c9 as x,ca as I,M as p,cb as m,bo as N,N as W}from"./index-7qezL2zM.js";import{u as B}from"./usePageTitle-k72s0--o.js";const V=D({__name:"DeploymentDuplicate",setup(E){const a=h(),u=v("deploymentId"),d=b(a.deployments.getDeployment,[u.value],{}),e=l(()=>d.response);function i(t){return"name"in t}async function y(t){try{if(!i(t))throw new Error("Invalid request");const n=await a.deployments.createDeployement(t);p("Deployment created","success"),m.push(N.deployment(n.id))}catch(n){const o=W(n,"Error creating deployment");p(o,"error"),console.warn(n)}}function f(){m.back()}const _=l(()=>e.value?`Duplicate Deployment: ${e.value.name}`:"Duplicate Deployment");return B(_),(t,n)=>{const o=C("p-layout-default");return e.value?(g(),k(o,{key:0,class:"deployment-edit"},{header:s(()=>[c(r(x),{deployment:e.value},null,8,["deployment"])]),default:s(()=>[c(r(I),{deployment:e.value,onCancel:f,mode:"duplicate",onSubmit:y},null,8,["deployment"])]),_:1})):w("",!0)}}});export{V as default};
//# sourceMappingURL=DeploymentDuplicate-ow-A2an_.js.map
