import{r as u,a as m,D as h,k as E,p as I,a4 as b,ad as w,e as y,aN as T}from"./jwt-decode.esm-1629-i6Y.js";import{l as _}from"./fetch-cPI2uPj6.js";import{u as C}from"./polling-D_d1w8cY.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]="25afaa17-eb9a-49f3-87b2-7ba5b5765120",t._sentryDebugIdIdentifier="sentry-dbid-25afaa17-eb9a-49f3-87b2-7ba5b5765120")}catch{}})();const d=8,g=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(),g),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}=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&&(a.value=o.waitingRoomUrl,c())};return{setup:l,cleanUp:f}},v=m({__name:"Home",setup(t){const n=w(),{setup:a,cleanUp:r}=R({router:n});return h(()=>{a()}),E(()=>{r()}),(s,i)=>{const c=b("RouterView");return y(),I(c,{class:"router"})}}}),U=T(v,[["__scopeId","data-v-3737a9c1"]]);export{U as default};
//# sourceMappingURL=Home-D3DpqnNF.js.map
