import{r as u,a as m,J as h,q as E,b as I,a8 as w,af as y,f as T,aO as C}from"./jwt-decode.esm-Dzy-9m8i.js";import{l as _}from"./fetch-CweK3EZW.js";import{u as g}from"./polling-B9sVAVz8.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="32a1a68f-a20e-4c7a-956e-03c0330ab0fe",t._sentryDebugIdIdentifier="sentry-dbid-32a1a68f-a20e-4c7a-956e-03c0330ab0fe")}catch{}})();const d=8,b=3e3,H=3e3,L=1e3,R=t=>{const n=t.router,a=u(""),r=u(Array(d).fill(!0));let s=0;const i=async()=>{try{const e=new AbortController,o=setTimeout(()=>e.abort(),b),p=await _("/_healthcheck",{method:"GET",signal:e.signal,headers:{"Content-Type":"application/json","Cache-Control":"no-cache"}});clearTimeout(o),r.value[s]=p.status===200}catch{r.value[s]=!1}if(s=(s+1)%d,r.value.every(e=>!e)&&a.value){const e=n.currentRoute.value.path,o=new URLSearchParams;o.set("redirect",e),window.location.href=a.value+"?"+o.toString()}},{startPolling:c,endPolling:f}=g({task:i,interval:H}),l=async()=>{const e=await _("/_editor/api/web-editor/",{method:"GET"});if(!e.ok){setTimeout(()=>{l()},L);return}const o=await e.json();o.waitingRoomUrl&&(a.value=o.waitingRoomUrl,c())};return{setup:l,cleanUp:f}},v=m({__name:"Home",setup(t){const n=y(),{setup:a,cleanUp:r}=R({router:n});return h(()=>{a()}),E(()=>{r()}),(s,i)=>{const c=w("RouterView");return T(),I(c,{class:"router"})}}}),D=C(v,[["__scopeId","data-v-3737a9c1"]]);export{D as default};
//# sourceMappingURL=Home-BQwz-foi.js.map
