import{r as e,j as t}from"./jsx-runtime-BnbLqBWP.js";import{R as o,m as i,r}from"./index-C4j0XBvN.js";import{E as n,m as a,c as s,a as _}from"./router-BXPf1XsM.js";import{i as w,d,c as u,s as m,g as l,e as x,f,h as c,R as p,j as v}from"./components-B5_r6Vif.js";import"./_commonjsHelpers-TUi1EdFu.js";import"./single-fetch-vTdWVr6V.js"; /** * @remix-run/react v2.15.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */ /** * @remix-run/react v2.15.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */ let C,h,M,R=!1;function g(t){if(!h){if(window.__remixContext.future.v3_singleFetch){if(!C){let e=window.__remixContext.stream;w(e,"No stream found for single fetch decoding"),window.__remixContext.stream=void 0,C=d(e,window).then((e=>{window.__remixContext.state=e.value,C.value=!0})).catch((e=>{C.error=e}))}if(C.error)throw C.error;if(!C.value)throw C}let e,t=u(window.__remixManifest.routes,window.__remixRouteModules,window.__remixContext.state,window.__remixContext.future,window.__remixContext.isSpaMode);if(!window.__remixContext.isSpaMode){e={...window.__remixContext.state,loaderData:{...window.__remixContext.state.loaderData}};let o=a(t,window.location,window.__remixContext.basename);if(o)for(let t of o){let o=t.route.id,i=window.__remixRouteModules[o],r=window.__remixManifest.routes[o];i&&m(r,i,window.__remixContext.isSpaMode)&&(i.HydrateFallback||!r.hasLoader)?e.loaderData[o]=void 0:r&&!r.hasLoader&&(e.loaderData[o]=null)}e&&e.errors&&(e.errors=function(e){if(!e)return null;let t=Object.entries(e),o={};for(let[r,a]of t)if(a&&"RouteErrorResponse"===a.__type)o[r]=new n(a.status,a.statusText,a.data,!0===a.internal);else if(a&&"Error"===a.__type){if(a.__subType){let e=window[a.__subType];if("function"==typeof e)try{let t=new e(a.message);t.stack=a.stack,o[r]=t}catch(i){}}if(null==o[r]){let e=new Error(a.message);e.stack=a.stack,o[r]=e}}else o[r]=a;return o}(e.errors))}h=s({routes:t,history:_(),basename:window.__remixContext.basename,future:{v7_normalizeFormMethod:!0,v7_fetcherPersist:window.__remixContext.future.v3_fetcherPersist,v7_partialHydration:!0,v7_prependBasename:!0,v7_relativeSplatPath:window.__remixContext.future.v3_relativeSplatPath,v7_skipActionErrorRevalidation:!0===window.__remixContext.future.v3_singleFetch},hydrationData:e,mapRouteProperties:i,dataStrategy:window.__remixContext.future.v3_singleFetch?x(window.__remixManifest,window.__remixRouteModules,(()=>h)):void 0,patchRoutesOnNavigation:l(window.__remixManifest,window.__remixRouteModules,window.__remixContext.future,window.__remixContext.isSpaMode,window.__remixContext.basename)}),h.state.initialized&&(R=!0,h.initialize()),h.createRoutesForHMR=f,window.__remixRouter=h,M&&M(h)}let[r,g]=e.useState(void 0),[y,E]=e.useState(h.state.location);return e.useLayoutEffect((()=>{R||(R=!0,h.initialize())}),[]),e.useLayoutEffect((()=>h.subscribe((e=>{e.location!==y&&E(e.location)}))),[y]),c(h,window.__remixManifest,window.__remixRouteModules,window.__remixContext.future,window.__remixContext.isSpaMode),e.createElement(e.Fragment,null,e.createElement(p.Provider,{value:{manifest:window.__remixManifest,routeModules:window.__remixRouteModules,future:window.__remixContext.future,criticalCss:r,isSpaMode:window.__remixContext.isSpaMode}},e.createElement(v,{location:y},e.createElement(o,{router:h,fallbackElement:null,future:{v7_startTransition:!0}}))),window.__remixContext.future.v3_singleFetch?e.createElement(e.Fragment,null):null)}var y;new Promise((e=>{M=e})).catch((()=>{}));var E=r;E.createRoot,y=E.hydrateRoot,e.startTransition((()=>{y(document,t.jsx(g,{}))}));