import{j as e,bc as h,al as n,R as l,aR as f}from"./vendor-mui-core-D7t4vMS5.js";import{c as u,N as w,E as j,F as y}from"./index-Ca33rdd_.js";import{C as g}from"./config-space-HmsYCb6s.js";import{P as v}from"./vendor-arcblock-ivFYo5vP.js";import{N as b}from"./index-DCxNOCc2.js";import{W as k,b5 as C}from"./vendor-ux-Dl3wVbv_.js";import{r as W}from"./vendor-react-DX7tU9aY.js";import{u as S,a as E,S as P,b as z,c as I,W as N}from"./wizard-components-BzPyRFRt.js";import"./vendor-utils-BzQg432x.js";import"./vendor-hooks-DAZ1H6Va.js";import"./spaces-Ckljlc4d.js";import"./api-B8JXuhVp.js";import"./fallback-CZRO9TTQ.js";import"./nav-menu-5M0Q4jYU.js";import"./wallet-hidden-topbar-DKISAPb3.js";import"./theme-mode-toggle-BltDSXhy.js";import"./use-mobile-DgmmfWdl.js";import"./purify.es-HRjpPm7y.js";import"./index-sb6EjUcD.js";import"./use-blocklet-logo-BWPJOOVd.js";import"./get-safe-url-D4zRnTpF.js";import"./use-server-logo-BLcfNvrR.js";import"./server-logo-notext.svg-CtPRYaCm.js";import"./use-mobile-BSL5RsRd.js";const R=f`
  html,
  body,
  #app,
  #app > .wrapper {
    height: 100%;
  }
`;function te(){const o=window.self!==window.top,d=`${u.WELLKNOWN_SERVICE_PATH_PREFIX}/onboard`,{t:s}=k(),{blocklet:r,launcherSession:p,steps:t,stepIndex:i,totalSteps:c,onNext:a,onPrevious:x,onStepClick:m}=S(d,!0,()=>{o?window.parent.postMessage({type:"wizard.finished"},window.location.origin):window.location.href=window.blocklet?.prefix||"/"});return W.useEffect(()=>{o&&window.parent.postMessage({type:"wizard.loaded"},window.location.origin)},[o]),e.jsx(w,{children:e.jsx(j,{roles:y,children:e.jsx(v,{steps:c,children:e.jsxs(g,{children:[e.jsx(h,{styles:R}),e.jsxs(E,{children:[o?null:e.jsx(b,{width:"100%",brandAddon:r?.meta?.title?e.jsx(C,{variant:"h4",children:r.meta?.title}):null,description:r?.meta?.description,maxWidth:!1,bordered:!0,showDomainWarningDialog:!1}),e.jsx(P,{maxWidth:"md",mt:o?0:{xs:0,md:10},sx:o?{display:"flex",flexDirection:"column",height:"100vh",p:0}:{p:{xs:1,md:3}},children:e.jsxs(z,{sx:o?{flex:1}:{},children:[t.length>0&&i!==-1&&!window.location.pathname.includes("complete")&&e.jsx(I,{steps:t,currentIndex:i>=0?i:0,onStepClick:m}),e.jsxs(n,{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(n,{sx:{flex:1,overflowY:"auto",width:"100%",height:"100%",px:3,"& > div":{overflowY:"visible"},...["access","bind-account"].includes(t[i]?.key)?{display:"flex",alignItems:"center",justifyContent:"center","& > div":{height:"unset"}}:{}},children:e.jsx(N,{blocklet:r,stepIndex:i,steps:t,onNext:a,onPrevious:x,launcherSession:p})}),e.jsxs(n,{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(n,{sx:{display:"flex",gap:2},children:[e.jsx(l,{variant:"text",color:"primary",sx:{width:{xs:"35%",md:"auto"}},onClick:()=>{o?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(t[i-1]?.key),children:s("setup.previous")})]}),e.jsx(l,{variant:"contained",color:"primary",onClick:()=>a(t[i+1]?.key),disabled:t[i]?.getButtonDisabled?.(),children:i===t.length-1?s("setup.finished"):s("setup.next")})]})]})]})})]})]})})})})}export{te as default};
