import{j as e,bq as h,ak as r,Q as l,aT as f}from"./vendor-mui-core-DnR6WYuU.js";import{c as u,N as w,F as j,G as y,I as g}from"./index-BZxsCCR_.js";import{C as v}from"./config-space-LrsWMRQl.js";import{P as b}from"./vendor-arcblock-CIBaEWEy.js";import{V as k,a0 as C}from"./vendor-ux-DTEmWsko.js";import{r as S}from"./vendor-react-CTtPmzVP.js";import{u as W,a as P,S as E,b as I,c as z,W as D}from"./wizard-components-Brz3KBMW.js";import"./vendor-utils-CxWN1dT3.js";import"./vendor-hooks-qxhUUbW5.js";import"./lottie-web-4koyQiv_.js";import"./spaces-DBCz6tUn.js";import"./api-FQQlzPOP.js";import"./get-safe-url-D4mirsKD.js";import"./use-server-logo-Cv1kAPgB.js";import"./server-logo-notext.svg-xZ-i1SpD.js";import"./use-mobile-BINJTzMb.js";const N=f`
  html,
  body,
  #app,
  #app > .wrapper {
    height: 100%;
  }
`;function X(){const t=window.self!==window.top,d=`${u.WELLKNOWN_SERVICE_PATH_PREFIX}/onboard`,{t:s}=k(),{blocklet:n,launcherSession:p,steps:o,stepIndex:i,totalSteps:c,onNext:a,onPrevious:x,onStepClick:m}=W(d,!0,()=>{t?window.parent.postMessage({type:"wizard.finished"},window.location.origin):window.location.href=window.blocklet?.prefix||"/"});return S.useEffect(()=>{t&&window.parent.postMessage({type:"wizard.loaded"},window.location.origin)},[t]),e.jsx(w,{children:e.jsx(j,{roles:y,children:e.jsx(b,{steps:c,children:e.jsxs(v,{children:[e.jsx(h,{styles:N}),e.jsxs(P,{children:[t?null:e.jsx(g,{width:"100%",brandAddon:n?.meta?.title?e.jsx(C,{variant:"h4",children:n.meta?.title}):null,description:n?.meta?.description,maxWidth:!1,bordered:!0,showDomainWarningDialog:!1}),e.jsx(E,{maxWidth:"md",mt:t?0:{xs:0,md:10},sx:t?{display:"flex",flexDirection:"column",height:"100vh",p:0}:{p:{xs:1,md:3}},children:e.jsxs(I,{sx:t?{flex:1}:{},children:[o.length>0&&i!==-1&&!window.location.pathname.includes("complete")&&e.jsx(z,{steps:o,currentIndex:i>=0?i:0,onStepClick:m}),e.jsxs(r,{sx:{display:"flex",flex:1,py:3,width:"100%",flexDirection:"column","& .header":{display:"none"},"&& .form-container":{overflowY:"visible"},"&& .container-inner":{position:"relative"},".form-container + div":{display:"none"},overflowY:"hidden"},children:[e.jsx(r,{sx:{flex:1,overflowY:"auto",width:"100%",height:"100%",px:3,"& > div":{overflowY:"visible"},...["access","bind-account"].includes(o[i]?.key)?{display:"flex",alignItems:"center",justifyContent:"center","& > div":{height:"unset"}}:{}},children:e.jsx(D,{blocklet:n,stepIndex:i,steps:o,onNext:a,onPrevious:x,launcherSession:p})}),e.jsxs(r,{sx:{display:"flex",flexDirection:{xs:"column-reverse",md:"row"},justifyContent:"flex-end",gap:2,width:"100%",px:3,pt:2,"& button":{minWidth:"100px",height:"40px"}},children:[e.jsxs(r,{sx:{display:"flex",gap:2},children:[e.jsx(l,{variant:"text",color:"primary",sx:{width:{xs:"35%",md:"auto"}},onClick:()=>{t?window.parent.postMessage({type:"wizard.close"},window.location.origin):window.location.href=window.blocklet?.prefix||"/"},children:s("setup.later")}),i>0&&e.jsx(l,{variant:"outlined",color:"primary",sx:{width:{xs:"65%",md:"auto"}},onClick:()=>a(o[i-1]?.key),children:s("setup.previous")})]}),e.jsx(l,{variant:"contained",color:"primary",onClick:()=>a(o[i+1]?.key),disabled:o[i]?.getButtonDisabled?.(),children:i===o.length-1?s("setup.finished"):s("setup.next")})]})]})]})})]})]})})})})}export{X as default};
