import{f as u,d as m,e3 as h,J as b,a8 as y,r as w,c as g,o as v,Q as I}from"./index.a59ca186.js";import{l as d}from"./fetch.29ff9ac6.js";import{u as C}from"./polling.773eec85.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]="bff5981a-8ab8-4bd5-8ff4-052196646aeb",t._sentryDebugIdIdentifier="sentry-dbid-bff5981a-8ab8-4bd5-8ff4-052196646aeb")}catch{}})();const f=4,H=t=>{const n=t.router,a=u(""),r=u(Array(f).fill(!0));let s=0;const l=async()=>{try{const e=new AbortController,o=setTimeout(()=>e.abort(),1e3),p=await d("/_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)%f,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:_}=C({task:l,interval:2e3}),i=async()=>{const e=await d("/_editor/api/web-editor/",{method:"GET"});if(!e.ok){setTimeout(()=>{i()},1e3);return}const o=await e.json();o.waitingRoomUrl&&(a.value=o.waitingRoomUrl,c())};return{setup:i,cleanUp:_}},R=m({__name:"Home",setup(t){const n=h(),{setup:a,cleanUp:r}=H({router:n});return b(()=>{a()}),y(()=>{r()}),(s,l)=>{const c=w("RouterView");return v(),g(c,{class:"router"})}}});const U=I(R,[["__scopeId","data-v-3737a9c1"]]);export{U as default};
//# sourceMappingURL=Home.5d1a4b96.js.map
