import{j as e,bc as h,al as n,R as l,aR as f}from"./vendor-mui-core-CDEc-eG6.js";import{W as u,N as w,D as j,E as y}from"./index-DGZk149v.js";import{C as g}from"./config-space-B2Ba5sf-.js";import{P as v}from"./vendor-arcblock-DY2miJjh.js";import{N as b}from"./index-Ct2LxGuf.js";import{W,b6 as k}from"./vendor-ux-bFYdDLNG.js";import{r as C}from"./vendor-react-DX7tU9aY.js";import{u as S,a as P,S as E,b as z,c as D,W as I}from"./wizard-components-UY9OTLzx.js";import"./vendor-utils-_C9URqjS.js";import"./vendor-hooks-BrgYeCrj.js";import"./spaces-Cf-lxsd-.js";import"./api-Bo6lutcq.js";import"./fallback-DtbVvsNl.js";import"./nav-menu-Cdiq5B2R.js";import"./wallet-hidden-topbar-B5INDesa.js";import"./theme-mode-toggle-DMuDz8uK.js";import"./use-mobile-DKWj9MJD.js";import"./purify.es-HRjpPm7y.js";import"./isEqual-BQciOGCh.js";import"./use-blocklet-logo-BSClbuwz.js";import"./get-safe-url-B1bR9jl-.js";import"./use-server-logo-btsDYvqE.js";import"./server-logo-notext.svg-CtPRYaCm.js";import"./use-mobile-CnCzXOEv.js";const N=f`
  html,
  body,
  #app,
  #app > .wrapper {
    height: 100%;
  }
`;function te(){const o=window.self!==window.top,d=`${u}/onboard`,{t:r}=W(),{blocklet:s,launcherSession:p,steps:t,stepIndex:i,totalSteps:c,onNext:a,onPrevious:m,onStepClick:x}=S(d,!0,()=>{o?window.parent.postMessage({type:"wizard.finished"},window.location.origin):window.location.href=window.blocklet?.prefix||"/"});return C.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:N}),e.jsxs(P,{children:[o?null:e.jsx(b,{width:"100%",brandAddon:s?.meta?.title?e.jsx(k,{variant:"h4",children:s.meta?.title}):null,description:s?.meta?.description,maxWidth:!1,bordered:!0,showDomainWarningDialog:!1}),e.jsx(E,{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(D,{steps:t,currentIndex:i>=0?i:0,onStepClick:x}),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(I,{blocklet:s,stepIndex:i,steps:t,onNext:a,onPrevious:m,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:r("setup.later")}),i>0&&e.jsx(l,{variant:"outlined",color:"primary",sx:{width:{xs:"65%",md:"auto"}},onClick:()=>a(t[i-1]?.key),children:r("setup.previous")})]}),e.jsx(l,{variant:"contained",color:"primary",onClick:()=>a(t[i+1]?.key),disabled:t[i]?.getButtonDisabled?.(),children:i===t.length-1?r("setup.finished"):r("setup.next")})]})]})]})})]})]})})})})}export{te as default};
