import{r as u,e as m,Z as h,D as E,l as I,Y as w,J as y,g as T,ar as g}from"./jwt-decode.esm-BPi7UGps.js";import{l as _}from"./fetch-Bk8D7R7N.js";import{u as C}from"./polling-DXUkA5fR.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]="47fb98e9-8224-4163-9813-43aaef267714",t._sentryDebugIdIdentifier="sentry-dbid-47fb98e9-8224-4163-9813-43aaef267714")}catch{}})();const d=8,H=3e3,L=3e3,R=1e3,b=t=>{const n=t.router,r=u(""),s=u(Array(d).fill(!0));let a=0;const l=async()=>{try{const e=new AbortController,o=setTimeout(()=>e.abort(),H),p=await _("/_healthcheck",{method:"GET",signal:e.signal,headers:{"Content-Type":"application/json","Cache-Control":"no-cache"}});clearTimeout(o),s.value[a]=p.status===200}catch{s.value[a]=!1}if(a=(a+1)%d,s.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:l,interval:L}),i=async()=>{const e=await _("/_editor/api/web-editor/",{method:"GET"});if(!e.ok){setTimeout(()=>{i()},R);return}const o=await e.json();o.waitingRoomUrl&&(r.value=o.waitingRoomUrl,c())};return{setup:i,cleanUp:f}},v=m({__name:"Home",setup(t){const n=y(),{setup:r,cleanUp:s}=b({router:n});return h(()=>{r()}),E(()=>{s()}),(a,l)=>{const c=w("RouterView");return T(),I(c,{class:"router"})}}}),k=g(v,[["__scopeId","data-v-3737a9c1"]]);export{k as default};
//# sourceMappingURL=Home-DVlkLn8m.js.map
