import{j as e,aY as h,ak as r,Q as l,aT as f}from"./vendor-mui-core-CnXrAOs3.js";import{c as u,N as w,A as j,B as y,r as g}from"./index-sNHCLgAE.js";import{C as v}from"./config-space-zpk7zMxf.js";import{P as b}from"./vendor-arcblock-CuFtPveO.js";import{V as k,E as C}from"./vendor-ux-IiQnod3w.js";import{r as S}from"./vendor-react-Dvs43sk9.js";import{u as W,a as P,S as E,b as z,c as I,W as B}from"./wizard-components-BJpLH2_r.js";import"./vendor-utils-cJEl_UEd.js";import"./vendor-hooks-CjESGRlR.js";import"./spaces-B0p4-23K.js";import"./api-Btn0Tp3W.js";import"./lottie-web-4koyQiv_.js";import"./get-safe-url-DpalOXcM.js";import"./use-server-logo-n_aaKVoZ.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./use-mobile-maRlSUwU.js";const D=f`
  html,
  body,
  #app,
  #app > .wrapper {
    height: 100%;
  }
`;function $(){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:D}),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(z,{sx:t?{flex:1}:{},children:[o.length>0&&i!==-1&&!window.location.pathname.includes("complete")&&e.jsx(I,{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(B,{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{$ as default};
