import{r as i,j as e}from"./@radix-3bj3otF9.js";import{e as o,B as n,r as c,bX as d}from"./index-Cs2FY84s.js";import{S as h}from"./StackList-DOWge3kz.js";import{p as m,c as j}from"./persist-B60VYqgN.js";import{p as l,c as k}from"./persist-09j6UHzB.js";import{I as p}from"./Infobox-D2Qx_9-M.js";import{s as u}from"./index-Aaj1O_4o.js";import{b as f}from"./@tanstack-CByuvRcg.js";import{L as x}from"./@react-router-Ct_TgVUW.js";import"./@reactflow-CwWcBchH.js";import"./plus-Cewn_igr.js";import"./refresh-BaK7e0kN.js";import"./Pagination-Du1A_aqP.js";import"./chevron-right-double-BuLe9bCa.js";import"./SearchField-Bd1JmJXg.js";import"./index-FwZ5fdjO.js";import"./CodeSnippet-C2p1JJEZ.js";import"./CollapsibleCard-ErHP3-9N.js";import"./chevron-down-smmnLxYI.js";import"./SheetHeader-Bv1lWAFV.js";import"./components-Br2ezRib.js";import"./NumberBox-DK1mZUWe.js";import"./ComponentBadge-DxjeE6Hn.js";import"./ComponentIcon-CLH2B8Js.js";import"./bar-chart-square-check-Diki0CFQ.js";import"./layout-zVxDzB0C.js";import"./transform-CRpCHU_K.js";import"./trash-B0fyghWi.js";import"./DeleteAlertDialog-8-J1PO_I.js";import"./zod-36FJuF1H.js";import"./index.esm-DnoyTjte.js";import"./sharedSchema-nFSDUSiQ.js";import"./index.es-CgyQaT4l.js";import"./alert-triangle-BvW2I3qT.js";import"./stack-detail-query-DR_HwbzU.js";function w({setHasResumeableStack:a}){const{success:t,data:s}=m(),r=f({...u.stackDeploymentStack({provider:(s==null?void 0:s.provider)||"aws",stack_name:(s==null?void 0:s.stackName)||"",date_start:s==null?void 0:s.timestamp}),enabled:t,throwOnError:!0});return i.useEffect(()=>{r.data&&(j(),a(!1))},[r.data]),!t||r.isError?null:r.isPending?e.jsx(o,{className:"h-[70px] w-full"}):e.jsx(p,{className:"w-full",children:e.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"font-semibold",children:"You have a Stack provision incomplete"}),e.jsx("p",{className:"text-text-sm",children:"Return to the setup and finish the configuration on your cloud provider"})]}),e.jsx("div",{children:e.jsx(n,{className:"w-fit bg-theme-surface-primary",intent:"primary",emphasis:"subtle",asChild:!0,children:e.jsx(x,{to:c.stacks.create.newInfra,children:e.jsx("span",{children:"Review Stack"})})})})]})})}function b({setHasResumeableTerraform:a}){const{success:t,data:s}=l(),r=f({...u.stackDeploymentStack({provider:(s==null?void 0:s.provider)||"aws",stack_name:(s==null?void 0:s.stackName)||"",date_start:s==null?void 0:s.timestamp}),enabled:t,throwOnError:!0});return i.useEffect(()=>{r.data&&(k(),a(!1))},[r.data]),!t||r.isError?null:r.isPending?e.jsx(o,{className:"h-[70px] w-full"}):e.jsx(p,{className:"w-full",children:e.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"font-semibold",children:"You have a Terraform Stack provision incomplete"}),e.jsx("p",{className:"text-text-sm",children:"Return to the setup and finish the configuration on your cloud provider"})]}),e.jsx("div",{children:e.jsx(n,{className:"w-fit bg-theme-surface-primary",intent:"primary",emphasis:"subtle",asChild:!0,children:e.jsx(x,{to:c.stacks.create.terraform,children:e.jsx("span",{children:"Review Stack"})})})})]})})}function v(){const[a,t]=i.useState(m().success),[s,r]=i.useState(l().success);return!a&&!s?null:e.jsxs("div",{className:"space-y-5",children:[a&&e.jsx(w,{setHasResumeableStack:t}),s&&e.jsx(b,{setHasResumeableTerraform:r})]})}function te(){const{setTourState:a,tourState:{tourActive:t}}=d();return i.useEffect(()=>{t&&a(s=>({...s,run:!0,stepIndex:s.stepIndex}))},[t]),e.jsxs("div",{className:"space-y-5 py-5",children:[e.jsx(v,{}),e.jsx(h,{})]})}export{te as default};
