const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.client-CsIUPfXc.js","assets/index-CqIc3cxq.js"])))=>i.map(i=>d[i]);
import{_ as p}from"./preload-helper-BXl3LOEh.js";import{j as e}from"./jsx-runtime-C5WNSv3b.js";import{r as n}from"./index-CqIc3cxq.js";import{h as x,i as j,j as i}from"./chunk-EPOLDU6W-BCLmut3y.js";import{g as m}from"./misc-W4055b-0.js";const f=await p(()=>import("./index.client-CsIUPfXc.js"),__vite__mapDeps([0,1])).catch(s=>(console.warn("Failed to import @sentry/react-router:",s instanceof Error?s.message:String(s),"- Sentry monitoring will be disabled but the application will continue to work normally"),null)),v={400:({error:s})=>e.jsxs("div",{children:[e.jsx("h1",{children:"Bad Request"}),e.jsx("p",{children:s.data})]}),401:()=>e.jsxs("div",{children:[e.jsx("h1",{children:"Unauthorized"}),e.jsx("p",{children:"You don't have permission to access this resource."})]}),403:()=>e.jsxs("div",{children:[e.jsx("h1",{children:"Forbidden"}),e.jsx("p",{children:"You don't have permission to access this resource."})]}),404:()=>e.jsxs("div",{children:[e.jsx("h1",{children:"Not Found"}),e.jsx("p",{children:"Sorry, we couldn't find what you were looking for."})]}),500:({error:s})=>e.jsxs("div",{children:[e.jsx("h1",{children:"Internal Server Error"}),e.jsx("p",{children:"Sorry, something went wrong on our end."}),e.jsx("p",{children:s.data})]}),502:()=>e.jsxs("div",{children:[e.jsx("h1",{children:"Bad Gateway"}),e.jsx("p",{children:"Sorry, we're having a temporary problem. Please try again later."}),e.jsx("button",{onClick:()=>window.location.reload(),children:"Refresh"})]}),503:()=>e.jsxs("div",{children:[e.jsx("h1",{children:"Service Unavailable"}),e.jsx("p",{children:"Sorry, we're having a temporary problem. Please try again later."}),e.jsx("button",{onClick:()=>window.location.reload(),children:"Refresh"})]})};function P({className:s="container flex items-center justify-center p-20 text-h2 flex-col gap-6",defaultStatusHandler:a=({error:t})=>e.jsxs("p",{children:[t.status," ",t.data]}),statusHandlers:l,unexpectedErrorHandler:c=t=>e.jsx("p",{children:m(t)})}){const[t,d]=n.useState(!1),r=x(),h=j(),o=i(r),u={...v,...l};return n.useEffect(()=>{o||ENV.EPICSHOP_IS_PUBLISHED&&f?.captureException(r)},[r,o]),n.useEffect(()=>{r instanceof Error&&r.message.includes("Failed to fetch")&&fetch("/resources/healthcheck").catch(()=>{d(!0)})},[r]),typeof document<"u"&&console.error(r),e.jsxs("div",{className:s,children:[t?e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6",children:[e.jsx("h1",{className:"text-h2 font-bold",children:"Server is down"}),e.jsx("p",{className:"text-body-md",children:ENV.EPICSHOP_DEPLOYED?"Sorry, we're having a temporary problem. Please try again later.":"Your server is not running. Please restart the workshop app."})]}):null,i(r)?(u?.[r.status]??a)({error:r,params:h}):c(r)]})}export{P as G};
//# sourceMappingURL=error-boundary-DxHqAEHX.js.map
