import{j as e}from"./@radix-DAoBbclx.js";import{e as o,B as n,r as c,c8 as d}from"./index-DnCFURX3.js";import{a as i}from"./@monaco-editor-Di1Jq_O0.js";import{S as h}from"./StackList-CjOZALLh.js";import{p as m,c as j}from"./persist-BHPX-J-X.js";import{p as l,c as k}from"./persist-BOr9slxt.js";import{I as p}from"./Infobox-CwivD_sG.js";import{s as u}from"./index-DPy_6htP.js";import{b as f}from"./@tanstack-2852wz5w.js";import{L as x}from"./@react-router-BTai9D5g.js";import"./@elkjs-CmhuJAjY.js";import"./@reactflow-CLotj7HR.js";import"./@zod-3snSrKBm.js";import"./plus-E8wmxLMS.js";import"./refresh-DhdtzFSJ.js";import"./Pagination-hLnXxv_M.js";import"./chevron-right-double-DmxLx4B3.js";import"./SearchField-CVlpmsG6.js";import"./CodeSnippet-j6SUjNoa.js";import"./CollapsibleCard-CehR97tz.js";import"./chevron-down-DPrYU2vK.js";import"./resizable-sheet-CEiuNeHE.js";import"./react-resizable-panels.browser-B4wG35w6.js";import"./components-Br2ezRib.js";import"./NumberBox-DS0FZaRY.js";import"./ComponentBadge-C5RQs_A7.js";import"./ComponentIcon-BOGF3ktm.js";import"./bar-chart-square-check-CVLivjI6.js";import"./layout-BtXy9gkl.js";import"./transform-CoT5Lusb.js";import"./trash-DsZfFPdX.js";import"./DeleteAlertDialog-B-lA-7-t.js";import"./sharedSchema-BFTQlZzj.js";import"./index.es-kPiYYmIR.js";import"./alert-triangle-D6M9IW_W.js";import"./stack-detail-query-CIp7lmsE.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 v({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 N(){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(v,{setHasResumeableTerraform:r})]})}function ae(){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(N,{}),e.jsx(h,{})]})}export{ae as default};
