import{r as u,d as m,e5 as h,J as y,I as w,i as g,a as b,o as v,_ as I}from"./jwt-decode.esm.54a1ea22.js";import{l as d}from"./fetch.1b3d01a0.js";import{u as C}from"./polling.b5a32c22.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]="297f2b05-4870-4931-8d41-bd772ff4264f",t._sentryDebugIdIdentifier="sentry-dbid-297f2b05-4870-4931-8d41-bd772ff4264f")}catch{}})();const _=4,H=t=>{const n=t.router,r=u(""),s=u(Array(_).fill(!0));let a=0;const i=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),s.value[a]=p.status===200}catch{s.value[a]=!1}if(a=(a+1)%_,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:i,interval:2e3}),l=async()=>{const e=await d("/_editor/api/web-editor/",{method:"GET"});if(!e.ok){setTimeout(()=>{l()},1e3);return}const o=await e.json();o.waitingRoomUrl&&(r.value=o.waitingRoomUrl,c())};return{setup:l,cleanUp:f}},R=m({__name:"Home",setup(t){const n=h(),{setup:r,cleanUp:s}=H({router:n});return y(()=>{r()}),w(()=>{s()}),(a,i)=>{const c=g("RouterView");return v(),b(c,{class:"router"})}}});const U=I(R,[["__scopeId","data-v-3737a9c1"]]);export{U as default};
//# sourceMappingURL=Home.782c5702.js.map
