import{r as u,e as m,N as h,y as E,f as I,ab as b,ai as w,h as y,aO as T}from"./jwt-decode.esm-og2W_mys.js";import{l as _}from"./fetch-BGNhONZ3.js";import{u as C}from"./polling-dbfwjZFl.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]="22041c91-bb4a-432f-b441-3916a6ff4be6",t._sentryDebugIdIdentifier="sentry-dbid-22041c91-bb4a-432f-b441-3916a6ff4be6")}catch{}})();const d=8,g=3e3,H=3e3,L=1e3,R=t=>{const n=t.router,r=u(""),a=u(Array(d).fill(!0));let s=0;const i=async()=>{try{const e=new AbortController,o=setTimeout(()=>e.abort(),g),p=await _("/_healthcheck",{method:"GET",signal:e.signal,headers:{"Content-Type":"application/json","Cache-Control":"no-cache"}});clearTimeout(o),a.value[s]=p.status===200}catch{a.value[s]=!1}if(s=(s+1)%d,a.value.every(e=>!e)&&r.value){const e=n.currentRoute.value.path,o=new URLSearchParams;o.set("redirect",e),window.location.href=r.value+"?"+o.toString()}},{startPolling:c,endPolling:f}=C({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&&(r.value=o.waitingRoomUrl,c())};return{setup:l,cleanUp:f}},v=m({__name:"Home",setup(t){const n=w(),{setup:r,cleanUp:a}=R({router:n});return h(()=>{r()}),E(()=>{a()}),(s,i)=>{const c=b("RouterView");return y(),I(c,{class:"router"})}}}),D=T(v,[["__scopeId","data-v-3737a9c1"]]);export{D as default};
//# sourceMappingURL=Home-DOPm7hSy.js.map
