@pucp-gidis-hiisc/esm-fua-app 1.0.5 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/116.js +1 -0
  2. package/dist/116.js.map +1 -0
  3. package/dist/123.js +2 -0
  4. package/dist/123.js.map +1 -0
  5. package/dist/191.js +1 -0
  6. package/dist/191.js.map +1 -0
  7. package/dist/194.js +1 -0
  8. package/dist/194.js.map +1 -0
  9. package/dist/276.js +2 -0
  10. package/dist/{556.js.LICENSE.txt → 276.js.LICENSE.txt} +1 -11
  11. package/dist/276.js.map +1 -0
  12. package/dist/300.js +1 -1
  13. package/dist/31.js +1 -0
  14. package/dist/31.js.map +1 -0
  15. package/dist/322.js +1 -0
  16. package/dist/322.js.map +1 -0
  17. package/dist/336.js +1 -1
  18. package/dist/336.js.map +1 -1
  19. package/dist/372.js +1 -1
  20. package/dist/372.js.map +1 -1
  21. package/dist/397.js +1 -0
  22. package/dist/397.js.map +1 -0
  23. package/dist/41.js +1 -1
  24. package/dist/41.js.map +1 -1
  25. package/dist/457.js +1 -1
  26. package/dist/457.js.map +1 -1
  27. package/dist/464.js +1 -1
  28. package/dist/464.js.map +1 -1
  29. package/dist/470.js +1 -1
  30. package/dist/470.js.map +1 -1
  31. package/dist/495.js +2 -1
  32. package/dist/495.js.LICENSE.txt +9 -0
  33. package/dist/495.js.map +1 -1
  34. package/dist/51.js +2 -0
  35. package/dist/{main.js.LICENSE.txt → 51.js.LICENSE.txt} +18 -3
  36. package/dist/51.js.map +1 -0
  37. package/dist/661.js +1 -0
  38. package/dist/661.js.map +1 -0
  39. package/dist/69.js +1 -0
  40. package/dist/69.js.map +1 -0
  41. package/dist/745.js +1 -0
  42. package/dist/745.js.map +1 -0
  43. package/dist/794.js +1 -0
  44. package/dist/794.js.map +1 -0
  45. package/dist/810.js +1 -0
  46. package/dist/810.js.map +1 -0
  47. package/dist/876.js +1 -2
  48. package/dist/876.js.map +1 -1
  49. package/dist/89.js +1 -1
  50. package/dist/89.js.map +1 -1
  51. package/dist/913.js +1 -1
  52. package/dist/913.js.LICENSE.txt +3 -3
  53. package/dist/913.js.map +1 -1
  54. package/dist/932.js +1 -0
  55. package/dist/932.js.map +1 -0
  56. package/dist/964.js +1 -0
  57. package/dist/964.js.map +1 -0
  58. package/dist/99.js +1 -1
  59. package/dist/main.js +1 -2
  60. package/dist/main.js.map +1 -1
  61. package/dist/pucp-gidis-hiisc-esm-fua-app.js +1 -1
  62. package/dist/pucp-gidis-hiisc-esm-fua-app.js.buildmanifest.json +368 -101
  63. package/dist/pucp-gidis-hiisc-esm-fua-app.js.map +1 -1
  64. package/dist/routes.json +1 -1
  65. package/package.json +4 -2
  66. package/src/components/fua-html-viewer.component.tsx +81 -0
  67. package/src/components/fua-html-viewer.scss +44 -0
  68. package/src/components/summary-tiles/summary-tile.component.tsx +35 -0
  69. package/src/components/summary-tiles/summary-tiles.scss +64 -0
  70. package/src/config-schema.ts +15 -53
  71. package/src/declarations.d.ts +4 -6
  72. package/src/fua/fua-date-range-picker.component.tsx +38 -0
  73. package/src/fua/fua-date-range-picker.scss +15 -0
  74. package/src/fua/fua-header.scss +68 -0
  75. package/src/fua/{case-management-header.tsx → fua-header.tsx} +6 -6
  76. package/src/fua/{case-management-illustration.tsx → fua-illustration.tsx} +3 -3
  77. package/src/fua/fua-request-table.scss +80 -128
  78. package/src/fua/fuaRequestTable.tsx +148 -101
  79. package/src/fua-dashboard.component.tsx +25 -0
  80. package/src/fua-dashboard.scss +35 -0
  81. package/src/fua-tabs/data-table-extensions/all-fua-requests-table.extension.tsx +8 -0
  82. package/src/fua-tabs/data-table-extensions/completed-fua-requests-table.extension.tsx +8 -0
  83. package/src/fua-tabs/data-table-extensions/declined-fua-requests-table.extension.tsx +8 -0
  84. package/src/fua-tabs/data-table-extensions/in-progress-fua-requests-table.extension.tsx +8 -0
  85. package/src/fua-tabs/fua-tabs.component.tsx +74 -0
  86. package/src/fua-tabs/fua-tabs.scss +65 -0
  87. package/src/fua-tiles/all-fua-requests-tile.component.tsx +20 -0
  88. package/src/fua-tiles/completed-fua-requests-tile.component.tsx +19 -0
  89. package/src/fua-tiles/fua-summary-tiles.component.tsx +46 -0
  90. package/src/fua-tiles/fua-summary-tiles.scss +16 -0
  91. package/src/fua-tiles/in-progress-fua-requests-tile.component.tsx +20 -0
  92. package/src/fua-viewer-page/fua-viewer-page.component.tsx +90 -0
  93. package/src/fua-viewer-page/fua-viewer-page.scss +82 -0
  94. package/src/hooks/useFuaRequests.ts +93 -26
  95. package/src/index.ts +82 -7
  96. package/src/root.component.tsx +8 -0
  97. package/src/routes.json +94 -10
  98. package/src/types/index.ts +4 -0
  99. package/src/workspaces/fua-viewer.workspace.tsx +20 -0
  100. package/translations/en.json +15 -1
  101. package/translations/es.json +15 -1
  102. package/.turbo/turbo-build.log +0 -43
  103. package/.turbo/turbo-extract-translations.log +0 -11
  104. package/.turbo/turbo-lint.log +0 -14
  105. package/dist/144.js +0 -2
  106. package/dist/144.js.LICENSE.txt +0 -19
  107. package/dist/144.js.map +0 -1
  108. package/dist/466.js +0 -1
  109. package/dist/466.js.map +0 -1
  110. package/dist/556.js +0 -2
  111. package/dist/556.js.map +0 -1
  112. package/dist/596.js +0 -2
  113. package/dist/596.js.LICENSE.txt +0 -30
  114. package/dist/596.js.map +0 -1
  115. package/dist/790.js +0 -1
  116. package/dist/790.js.map +0 -1
  117. package/src/root.scss +0 -102
  118. /package/dist/{876.js.LICENSE.txt → 123.js.LICENSE.txt} +0 -0
package/dist/913.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see 913.js.LICENSE.txt */
2
- "use strict";(globalThis.webpackChunk_pucp_gidis_hiisc_esm_fua_app=globalThis.webpackChunk_pucp_gidis_hiisc_esm_fua_app||[]).push([[913],{2913:(e,t,r)=>{r.r(t),r.d(t,{AbortedDeferredError:()=>Z,Await:()=>sr,BrowserRouter:()=>Hr,Form:()=>Yr,HashRouter:()=>Wr,Link:()=>Jr,MemoryRouter:()=>tr,NavLink:()=>qr,Navigate:()=>rr,NavigationType:()=>n,Outlet:()=>nr,Route:()=>ar,Router:()=>or,RouterProvider:()=>Br,Routes:()=>ir,ScrollRestoration:()=>Xr,UNSAFE_DataRouterContext:()=>lt,UNSAFE_DataRouterStateContext:()=>ut,UNSAFE_ErrorResponseImpl:()=>ie,UNSAFE_FetchersContext:()=>Mr,UNSAFE_LocationContext:()=>ht,UNSAFE_NavigationContext:()=>dt,UNSAFE_RouteContext:()=>ft,UNSAFE_ViewTransitionContext:()=>Ar,UNSAFE_useRouteId:()=>Bt,UNSAFE_useScrollRestoration:()=>hn,createBrowserRouter:()=>Lr,createHashRouter:()=>kr,createMemoryRouter:()=>mr,createPath:()=>v,createRoutesFromChildren:()=>hr,createRoutesFromElements:()=>hr,createSearchParams:()=>Sr,defer:()=>re,generatePath:()=>O,isRouteErrorResponse:()=>se,json:()=>Q,matchPath:()=>F,matchRoutes:()=>E,parsePath:()=>y,redirect:()=>ne,redirectDocument:()=>ae,renderMatches:()=>fr,replace:()=>oe,resolvePath:()=>H,unstable_HistoryRouter:()=>Kr,unstable_usePrompt:()=>pn,useActionData:()=>$t,useAsyncError:()=>qt,useAsyncValue:()=>Jt,useBeforeUnload:()=>fn,useBlocker:()=>Xt,useFetcher:()=>ln,useFetchers:()=>un,useFormAction:()=>sn,useHref:()=>mt,useInRouterContext:()=>vt,useLinkClickHandler:()=>tn,useLoaderData:()=>Wt,useLocation:()=>yt,useMatch:()=>bt,useMatches:()=>Ht,useNavigate:()=>St,useNavigation:()=>It,useNavigationType:()=>gt,useOutlet:()=>xt,useOutletContext:()=>Rt,useParams:()=>Dt,useResolvedPath:()=>Ct,useRevalidator:()=>zt,useRouteError:()=>Vt,useRouteLoaderData:()=>Kt,useRoutes:()=>Pt,useSearchParams:()=>rn,useSubmit:()=>on,useViewTransitionState:()=>mn});var n,a=r(1343),o=r(3144),i=r.t(o,2);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(n||(n={}));const l="popstate";function u(e){void 0===e&&(e={});let t,{initialEntries:r=["/"],initialIndex:a,v5Compat:o=!1}=e;t=r.map((e,t)=>d(e,"string"==typeof e?null:e.state,0===t?"default":void 0));let i=u(null==a?t.length-1:a),s=n.Pop,l=null;function u(e){return Math.min(Math.max(e,0),t.length-1)}function c(){return t[i]}function d(e,r,n){void 0===r&&(r=null);let a=m(t?c().pathname:"/",e,r,n);return f("/"===a.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),a}function h(e){return"string"==typeof e?e:v(e)}return{get index(){return i},get action(){return s},get location(){return c()},createHref:h,createURL:e=>new URL(h(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?y(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,r){s=n.Push;let a=d(e,r);i+=1,t.splice(i,t.length,a),o&&l&&l({action:s,location:a,delta:1})},replace(e,r){s=n.Replace;let a=d(e,r);t[i]=a,o&&l&&l({action:s,location:a,delta:0})},go(e){s=n.Pop;let r=u(i+e),a=t[r];i=r,l&&l({action:s,location:a,delta:e})},listen:e=>(l=e,()=>{l=null})}}function c(e){return void 0===e&&(e={}),g(function(e,t){let{pathname:r,search:n,hash:a}=e.location;return m("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){return"string"==typeof t?t:v(t)},null,e)}function d(e){return void 0===e&&(e={}),g(function(e,t){let{pathname:r="/",search:n="",hash:a=""}=y(e.location.hash.substr(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),m("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){let r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){let t=e.location.href,r=t.indexOf("#");n=-1===r?t:t.slice(0,r)}return n+"#"+("string"==typeof t?t:v(t))},function(e,t){f("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")},e)}function h(e,t){if(!1===e||null==e)throw new Error(t)}function f(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function p(e,t){return{usr:e.state,key:e.key,idx:t}}function m(e,t,r,n){return void 0===r&&(r=null),s({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?y(t):t,{state:r,key:t&&t.key||n||Math.random().toString(36).substr(2,8)})}function v(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&"?"!==r&&(t+="?"===r.charAt(0)?r:"?"+r),n&&"#"!==n&&(t+="#"===n.charAt(0)?n:"#"+n),t}function y(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function g(e,t,r,a){void 0===a&&(a={});let{window:o=document.defaultView,v5Compat:i=!1}=a,u=o.history,c=n.Pop,d=null,f=y();function y(){return(u.state||{idx:null}).idx}function g(){c=n.Pop;let e=y(),t=null==e?null:e-f;f=e,d&&d({action:c,location:w.location,delta:t})}function b(e){let t="null"!==o.location.origin?o.location.origin:o.location.href,r="string"==typeof e?e:v(e);return r=r.replace(/ $/,"%20"),h(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==f&&(f=0,u.replaceState(s({},u.state,{idx:f}),""));let w={get action(){return c},get location(){return e(o,u)},listen(e){if(d)throw new Error("A history only accepts one active listener");return o.addEventListener(l,g),d=e,()=>{o.removeEventListener(l,g),d=null}},createHref:e=>t(o,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){c=n.Push;let a=m(w.location,e,t);r&&r(a,e),f=y()+1;let s=p(a,f),l=w.createHref(a);try{u.pushState(s,"",l)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;o.location.assign(l)}i&&d&&d({action:c,location:w.location,delta:1})},replace:function(e,t){c=n.Replace;let a=m(w.location,e,t);r&&r(a,e),f=y();let o=p(a,f),s=w.createHref(a);u.replaceState(o,"",s),i&&d&&d({action:c,location:w.location,delta:0})},go:e=>u.go(e)};return w}var b;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(b||(b={}));const w=new Set(["lazy","caseSensitive","path","id","index","children"]);function S(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n={}),e.map((e,a)=>{let o=[...r,String(a)],i="string"==typeof e.id?e.id:o.join("-");if(h(!0!==e.index||!e.children,"Cannot specify children on an index route"),h(!n[i],'Found a route id collision on id "'+i+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let r=s({},e,t(e),{id:i});return n[i]=r,r}{let r=s({},e,t(e),{id:i,children:void 0});return n[i]=r,e.children&&(r.children=S(e.children,t,o,n)),r}})}function E(e,t,r){return void 0===r&&(r="/"),R(e,t,r,!1)}function R(e,t,r,n){let a=B(("string"==typeof t?y(t):t).pathname||"/",r);if(null==a)return null;let o=D(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every((e,r)=>e===t[r])?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(o);let i=null;for(let e=0;null==i&&e<o.length;++e){let t=N(a);i=j(o[e],t,n)}return i}function x(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function D(e,t,r,n){void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n="");let a=(e,a,o)=>{let i={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};i.relativePath.startsWith("/")&&(h(i.relativePath.startsWith(n),'Absolute route path "'+i.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(n.length));let s=q([n,i.relativePath]),l=r.concat(i);e.children&&e.children.length>0&&(h(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),D(e.children,t,l,s)),(null!=e.path||e.index)&&t.push({path:s,score:U(s,e.index),routesMeta:l})};return e.forEach((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let r of C(e.path))a(e,t,r);else a(e,t)}),t}function C(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(0===n.length)return a?[o,""]:[o];let i=C(n.join("/")),s=[];return s.push(...i.map(e=>""===e?o:[o,e].join("/"))),a&&s.push(...i),s.map(t=>e.startsWith("/")&&""===t?"/":t)}const P=/^:[\w-]+$/,L=3,k=2,_=1,T=10,A=-2,M=e=>"*"===e;function U(e,t){let r=e.split("/"),n=r.length;return r.some(M)&&(n+=A),t&&(n+=k),r.filter(e=>!M(e)).reduce((e,t)=>e+(P.test(t)?L:""===t?_:T),n)}function j(e,t,r){void 0===r&&(r=!1);let{routesMeta:n}=e,a={},o="/",i=[];for(let e=0;e<n.length;++e){let s=n[e],l=e===n.length-1,u="/"===o?t:t.slice(o.length)||"/",c=F({path:s.relativePath,caseSensitive:s.caseSensitive,end:l},u),d=s.route;if(!c&&l&&r&&!n[n.length-1].route.index&&(c=F({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},u)),!c)return null;Object.assign(a,c.params),i.push({params:a,pathname:q([o,c.pathname]),pathnameBase:Y(q([o,c.pathnameBase])),route:d}),"/"!==c.pathnameBase&&(o=q([o,c.pathnameBase]))}return i}function O(e,t){void 0===t&&(t={});let r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(f(!1,'Route path "'+r+'" will be treated as if it were "'+r.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+r.replace(/\*$/,"/*")+'".'),r=r.replace(/\*$/,"/*"));const n=r.startsWith("/")?"/":"",a=e=>null==e?"":"string"==typeof e?e:String(e);return n+r.split(/\/+/).map((e,r,n)=>{if(r===n.length-1&&"*"===e)return a(t["*"]);const o=e.match(/^:([\w-]+)(\??)$/);if(o){const[,e,r]=o;let n=t[e];return h("?"===r||null!=n,'Missing ":'+e+'" param'),a(n)}return e.replace(/\?$/g,"")}).filter(e=>!!e).join("/")}function F(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!0),f("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,r)=>(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),s=a.slice(1);return{params:n.reduce((e,t,r)=>{let{paramName:n,isOptional:a}=t;if("*"===n){let e=s[r]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const l=s[r];return e[n]=a&&!l?void 0:(l||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:i,pattern:e}}function N(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return f(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function B(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}const I=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,z=e=>I.test(e);function H(e,t){void 0===t&&(t="/");let r,{pathname:n,search:a="",hash:o=""}="string"==typeof e?y(e):e;if(n)if(z(n))r=n;else{if(n.includes("//")){let e=n;n=n.replace(/\/\/+/g,"/"),f(!1,"Pathnames cannot have embedded double slashes - normalizing "+e+" -> "+n)}r=n.startsWith("/")?W(n.substring(1),"/"):W(n,t)}else r=t;return{pathname:r,search:X(a),hash:G(o)}}function W(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)}),r.length>1?r.join("/"):"/"}function K(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function $(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function V(e,t){let r=$(e);return t?r.map((e,t)=>t===r.length-1?e.pathname:e.pathnameBase):r.map(e=>e.pathnameBase)}function J(e,t,r,n){let a;void 0===n&&(n=!1),"string"==typeof e?a=y(e):(a=s({},e),h(!a.pathname||!a.pathname.includes("?"),K("?","pathname","search",a)),h(!a.pathname||!a.pathname.includes("#"),K("#","pathname","hash",a)),h(!a.search||!a.search.includes("#"),K("#","search","hash",a)));let o,i=""===e||""===a.pathname,l=i?"/":a.pathname;if(null==l)o=r;else{let e=t.length-1;if(!n&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}o=e>=0?t[e]:"/"}let u=H(a,o),c=l&&"/"!==l&&l.endsWith("/"),d=(i||"."===l)&&r.endsWith("/");return u.pathname.endsWith("/")||!c&&!d||(u.pathname+="/"),u}const q=e=>e.join("/").replace(/\/\/+/g,"/"),Y=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),X=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",G=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",Q=function(e,t){void 0===t&&(t={});let r="number"==typeof t?{status:t}:t,n=new Headers(r.headers);return n.has("Content-Type")||n.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(e),s({},r,{headers:n}))};class Z extends Error{}class ee{constructor(e,t){let r;this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],h(e&&"object"==typeof e&&!Array.isArray(e),"defer() only accepts plain objects"),this.abortPromise=new Promise((e,t)=>r=t),this.controller=new AbortController;let n=()=>r(new Z("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",n),this.controller.signal.addEventListener("abort",n),this.data=Object.entries(e).reduce((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:this.trackPromise(r,n)})},{}),this.done&&this.unlistenAbortSignal(),this.init=t}trackPromise(e,t){if(!(t instanceof Promise))return t;this.deferredKeys.push(e),this.pendingKeysSet.add(e);let r=Promise.race([t,this.abortPromise]).then(t=>this.onSettle(r,e,void 0,t),t=>this.onSettle(r,e,t));return r.catch(()=>{}),Object.defineProperty(r,"_tracked",{get:()=>!0}),r}onSettle(e,t,r,n){if(this.controller.signal.aborted&&r instanceof Z)return this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:()=>r}),Promise.reject(r);if(this.pendingKeysSet.delete(t),this.done&&this.unlistenAbortSignal(),void 0===r&&void 0===n){let r=new Error('Deferred data for key "'+t+'" resolved/rejected with `undefined`, you must resolve/reject with a value or `null`.');return Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)}return void 0===n?(Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)):(Object.defineProperty(e,"_data",{get:()=>n}),this.emit(!1,t),n)}emit(e,t){this.subscribers.forEach(r=>r(e,t))}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach((e,t)=>this.pendingKeysSet.delete(t)),this.emit(!0)}async resolveData(e){let t=!1;if(!this.done){let r=()=>this.cancel();e.addEventListener("abort",r),t=await new Promise(t=>{this.subscribe(n=>{e.removeEventListener("abort",r),(n||this.done)&&t(n)})})}return t}get done(){return 0===this.pendingKeysSet.size}get unwrappedData(){return h(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:te(n)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function te(e){if(!function(e){return e instanceof Promise&&!0===e._tracked}(e))return e;if(e._error)throw e._error;return e._data}const re=function(e,t){return void 0===t&&(t={}),new ee(e,"number"==typeof t?{status:t}:t)},ne=function(e,t){void 0===t&&(t=302);let r=t;"number"==typeof r?r={status:r}:void 0===r.status&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,s({},r,{headers:n}))},ae=(e,t)=>{let r=ne(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r},oe=(e,t)=>{let r=ne(e,t);return r.headers.set("X-Remix-Replace","true"),r};class ie{constructor(e,t,r,n){void 0===n&&(n=!1),this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function se(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const le=["post","put","patch","delete"],ue=new Set(le),ce=["get",...le],de=new Set(ce),he=new Set([301,302,303,307,308]),fe=new Set([307,308]),pe={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},me={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ve={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ye=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ge=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),be="remix-router-transitions";function we(e){const t=e.window?e.window:"undefined"!=typeof window?window:void 0,r=void 0!==t&&void 0!==t.document&&void 0!==t.document.createElement,a=!r;let o;if(h(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;o=e=>({hasErrorBoundary:t(e)})}else o=ge;let i,l,u,c={},d=S(e.routes,o,void 0,c),p=e.basename||"/",v=e.dataStrategy||_e,y=e.patchRoutesOnNavigation,g=s({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),D=null,C=new Set,P=null,L=null,k=null,_=null!=e.hydrationData,T=E(d,e.history.location,p),A=!1,M=null;if(null==T&&!y){let t=He(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=ze(d);T=r,M={[n.id]:t}}if(T&&!e.hydrationData&&ct(T,d,e.history.location.pathname).active&&(T=null),T)if(T.some(e=>e.route.lazy))l=!1;else if(T.some(e=>e.route.loader))if(g.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,r=e.hydrationData?e.hydrationData.errors:null;if(r){let e=T.findIndex(e=>void 0!==r[e.route.id]);l=T.slice(0,e+1).every(e=>!De(e.route,t,r))}else l=T.every(e=>!De(e.route,t,r))}else l=null!=e.hydrationData;else l=!0;else if(l=!1,T=[],g.v7_partialHydration){let t=ct(null,d,e.history.location.pathname);t.active&&t.matches&&(A=!0,T=t.matches)}let U,j,O={historyAction:e.history.action,location:e.history.location,matches:T,initialized:l,navigation:pe,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||M,fetchers:new Map,blockers:new Map},F=n.Pop,N=!1,I=!1,z=new Map,H=null,W=!1,K=!1,$=[],V=new Set,J=new Map,q=0,Y=-1,X=new Map,G=new Set,Q=new Map,Z=new Map,ee=new Set,te=new Map,re=new Map;function ne(e,t){void 0===t&&(t={}),O=s({},O,e);let r=[],n=[];g.v7_fetcherPersist&&O.fetchers.forEach((e,t)=>{"idle"===e.state&&(ee.has(t)?n.push(t):r.push(t))}),ee.forEach(e=>{O.fetchers.has(e)||J.has(e)||n.push(e)}),[...C].forEach(e=>e(O,{deletedFetchers:n,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync})),g.v7_fetcherPersist?(r.forEach(e=>O.fetchers.delete(e)),n.forEach(e=>Ce(e))):n.forEach(e=>ee.delete(e))}function ae(t,r,a){var o,l;let u,{flushSync:c}=void 0===a?{}:a,h=null!=O.actionData&&null!=O.navigation.formMethod&&Ge(O.navigation.formMethod)&&"loading"===O.navigation.state&&!0!==(null==(o=t.state)?void 0:o._isRedirect);u=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:h?O.actionData:null;let f=r.loaderData?Ne(O.loaderData,r.loaderData,r.matches||[],r.errors):O.loaderData,p=O.blockers;p.size>0&&(p=new Map(p),p.forEach((e,t)=>p.set(t,ve)));let m,v=!0===N||null!=O.navigation.formMethod&&Ge(O.navigation.formMethod)&&!0!==(null==(l=t.state)?void 0:l._isRedirect);if(i&&(d=i,i=void 0),W||F===n.Pop||(F===n.Push?e.history.push(t,t.state):F===n.Replace&&e.history.replace(t,t.state)),F===n.Pop){let e=z.get(O.location.pathname);e&&e.has(t.pathname)?m={currentLocation:O.location,nextLocation:t}:z.has(t.pathname)&&(m={currentLocation:t,nextLocation:O.location})}else if(I){let e=z.get(O.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),z.set(O.location.pathname,e)),m={currentLocation:O.location,nextLocation:t}}ne(s({},r,{actionData:u,loaderData:f,historyAction:F,location:t,initialized:!0,navigation:pe,revalidation:"idle",restoreScrollPosition:ut(t,r.matches||O.matches),preventScrollReset:v,blockers:p}),{viewTransitionOpts:m,flushSync:!0===c}),F=n.Pop,N=!1,I=!1,W=!1,K=!1,$=[]}async function oe(t,r,a){U&&U.abort(),U=null,F=t,W=!0===(a&&a.startUninterruptedRevalidation),function(e,t){if(P&&k){let r=lt(e,t);P[r]=k()}}(O.location,O.matches),N=!0===(a&&a.preventScrollReset),I=!0===(a&&a.enableViewTransition);let o=i||d,l=a&&a.overrideNavigation,u=null!=a&&a.initialHydration&&O.matches&&O.matches.length>0&&!A?O.matches:E(o,r,p),c=!0===(a&&a.flushSync);if(u&&O.initialized&&!K&&(h=O.location,f=r,h.pathname===f.pathname&&h.search===f.search&&(""===h.hash?""!==f.hash:h.hash===f.hash||""!==f.hash))&&!(a&&a.submission&&Ge(a.submission.formMethod)))return void ae(r,{matches:u},{flushSync:c});var h,f;let m=ct(u,o,r.pathname);if(m.active&&m.matches&&(u=m.matches),!u){let{error:e,notFoundMatches:t,route:n}=tt(r.pathname);return void ae(r,{matches:t,loaderData:{},errors:{[n.id]:e}},{flushSync:c})}U=new AbortController;let v,y=Ue(e.history,r,U.signal,a&&a.submission);if(a&&a.pendingError)v=[Ie(u).route.id,{type:b.error,error:a.pendingError}];else if(a&&a.submission&&Ge(a.submission.formMethod)){let t=await async function(e,t,r,a,o,i){void 0===i&&(i={}),de();let s,l=function(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}(t,r);if(ne({navigation:l},{flushSync:!0===i.flushSync}),o){let r=await dt(a,t.pathname,e.signal);if("aborted"===r.type)return{shortCircuited:!0};if("error"===r.type){let e=Ie(r.partialMatches).route.id;return{matches:r.partialMatches,pendingActionResult:[e,{type:b.error,error:r.error}]}}if(!r.matches){let{notFoundMatches:e,error:r,route:n}=tt(t.pathname);return{matches:e,pendingActionResult:[n.id,{type:b.error,error:r}]}}a=r.matches}let u=rt(a,t);if(u.route.action||u.route.lazy){if(s=(await ue("action",O,e,[u],a,null))[u.route.id],e.signal.aborted)return{shortCircuited:!0}}else s={type:b.error,error:He(405,{method:e.method,pathname:t.pathname,routeId:u.route.id})};if(qe(s)){let t;return t=i&&null!=i.replace?i.replace:Me(s.response.headers.get("Location"),new URL(e.url),p)===O.location.pathname+O.location.search,await le(e,s,!0,{submission:r,replace:t}),{shortCircuited:!0}}if(Ve(s))throw He(400,{type:"defer-action"});if(Je(s)){let e=Ie(a,u.route.id);return!0!==(i&&i.replace)&&(F=n.Push),{matches:a,pendingActionResult:[e.route.id,s]}}return{matches:a,pendingActionResult:[u.route.id,s]}}(y,r,a.submission,u,m.active,{replace:a.replace,flushSync:c});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,n]=t.pendingActionResult;if(Je(n)&&se(n.error)&&404===n.error.status)return U=null,void ae(r,{matches:t.matches,loaderData:{},errors:{[e]:n.error}})}u=t.matches||u,v=t.pendingActionResult,l=at(r,a.submission),c=!1,m.active=!1,y=Ue(e.history,y.url,y.signal)}let{shortCircuited:w,matches:S,loaderData:R,errors:x}=await async function(t,r,n,a,o,l,u,c,h,f,m){let v=o||at(r,l),y=l||u||nt(v),b=!(W||g.v7_partialHydration&&h);if(a){if(b){let e=ie(m);ne(s({navigation:v},void 0!==e?{actionData:e}:{}),{flushSync:f})}let e=await dt(n,r.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){let t=Ie(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(!e.matches){let{error:e,notFoundMatches:t,route:n}=tt(r.pathname);return{matches:t,loaderData:{},errors:{[n.id]:e}}}n=e.matches}let w=i||d,[S,E]=xe(e.history,O,n,y,r,g.v7_partialHydration&&!0===h,g.v7_skipActionErrorRevalidation,K,$,V,ee,Q,G,w,p,m);if(st(e=>!(n&&n.some(t=>t.route.id===e))||S&&S.some(t=>t.route.id===e)),Y=++q,0===S.length&&0===E.length){let e=je();return ae(r,s({matches:n,loaderData:{},errors:m&&Je(m[1])?{[m[0]]:m[1].error}:null},Be(m),e?{fetchers:new Map(O.fetchers)}:{}),{flushSync:f}),{shortCircuited:!0}}if(b){let e={};if(!a){e.navigation=v;let t=ie(m);void 0!==t&&(e.actionData=t)}E.length>0&&(e.fetchers=function(e){return e.forEach(e=>{let t=O.fetchers.get(e.key),r=ot(void 0,t?t.data:void 0);O.fetchers.set(e.key,r)}),new Map(O.fetchers)}(E)),ne(e,{flushSync:f})}E.forEach(e=>{Pe(e.key),e.controller&&J.set(e.key,e.controller)});let R=()=>E.forEach(e=>Pe(e.key));U&&U.signal.addEventListener("abort",R);let{loaderResults:x,fetcherResults:D}=await ce(O,n,S,E,t);if(t.signal.aborted)return{shortCircuited:!0};U&&U.signal.removeEventListener("abort",R),E.forEach(e=>J.delete(e.key));let C=We(x);if(C)return await le(t,C.result,!0,{replace:c}),{shortCircuited:!0};if(C=We(D),C)return G.add(C.key),await le(t,C.result,!0,{replace:c}),{shortCircuited:!0};let{loaderData:P,errors:L}=Fe(O,n,x,m,E,D,te);te.forEach((e,t)=>{e.subscribe(r=>{(r||e.done)&&te.delete(t)})}),g.v7_partialHydration&&h&&O.errors&&(L=s({},O.errors,L));let k=je(),_=Oe(Y),T=k||_||E.length>0;return s({matches:n,loaderData:P,errors:L},T?{fetchers:new Map(O.fetchers)}:{})}(y,r,u,m.active,l,a&&a.submission,a&&a.fetcherSubmission,a&&a.replace,a&&!0===a.initialHydration,c,v);w||(U=null,ae(r,s({matches:S||u},Be(v),{loaderData:R,errors:x})))}function ie(e){return e&&!Je(e[1])?{[e[0]]:e[1].data}:O.actionData?0===Object.keys(O.actionData).length?null:O.actionData:void 0}async function le(a,o,i,l){let{submission:u,fetcherSubmission:c,preventScrollReset:d,replace:f}=void 0===l?{}:l;o.response.headers.has("X-Remix-Revalidate")&&(K=!0);let v=o.response.headers.get("Location");h(v,"Expected a Location header on the redirect Response"),v=Me(v,new URL(a.url),p);let y=m(O.location,v,{_isRedirect:!0});if(r){let r=!1;if(o.response.headers.has("X-Remix-Reload-Document"))r=!0;else if(ye.test(v)){const n=e.history.createURL(v);r=n.origin!==t.location.origin||null==B(n.pathname,p)}if(r)return void(f?t.location.replace(v):t.location.assign(v))}U=null;let g=!0===f||o.response.headers.has("X-Remix-Replace")?n.Replace:n.Push,{formMethod:b,formAction:w,formEncType:S}=O.navigation;!u&&!c&&b&&w&&S&&(u=nt(O.navigation));let E=u||c;if(fe.has(o.response.status)&&E&&Ge(E.formMethod))await oe(g,y,{submission:s({},E,{formAction:v}),preventScrollReset:d||N,enableViewTransition:i?I:void 0});else{let e=at(y,u);await oe(g,y,{overrideNavigation:e,fetcherSubmission:c,preventScrollReset:d||N,enableViewTransition:i?I:void 0})}}async function ue(e,t,r,n,a,i){let l,u={};try{l=await async function(e,t,r,n,a,o,i,l,u,c){let d=o.map(e=>e.route.lazy?async function(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];h(a,"No route found in manifest");let o={};for(let e in n){let t=void 0!==a[e]&&"hasErrorBoundary"!==e;f(!t,'Route "'+a.id+'" has a static property "'+e+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+e+'" will be ignored.'),t||w.has(e)||(o[e]=n[e])}Object.assign(a,o),Object.assign(a,s({},t(a),{lazy:void 0}))}(e.route,u,l):void 0),p=o.map((e,r)=>{let o=d[r],i=a.some(t=>t.route.id===e.route.id);return s({},e,{shouldLoad:i,resolve:async r=>(r&&"GET"===n.method&&(e.route.lazy||e.route.loader)&&(i=!0),i?async function(e,t,r,n,a,o){let i,s,l=n=>{let i,l=new Promise((e,t)=>i=t);s=()=>i(),t.signal.addEventListener("abort",s);let u=a=>"function"!=typeof n?Promise.reject(new Error('You cannot call the handler for a route which defines a boolean "'+e+'" [routeId: '+r.route.id+"]")):n({request:t,params:r.params,context:o},...void 0!==a?[a]:[]),c=(async()=>{try{return{type:"data",result:await(a?a(e=>u(e)):u())}}catch(e){return{type:"error",result:e}}})();return Promise.race([c,l])};try{let a=r.route[e];if(n)if(a){let e,[t]=await Promise.all([l(a).catch(t=>{e=t}),n]);if(void 0!==e)throw e;i=t}else{if(await n,a=r.route[e],!a){if("action"===e){let e=new URL(t.url),n=e.pathname+e.search;throw He(405,{method:t.method,pathname:n,routeId:r.route.id})}return{type:b.data,result:void 0}}i=await l(a)}else{if(!a){let e=new URL(t.url);throw He(404,{pathname:e.pathname+e.search})}i=await l(a)}h(void 0!==i.result,"You defined "+("action"===e?"an action":"a loader")+' for route "'+r.route.id+"\" but didn't return anything from your `"+e+"` function. Please return a value or `null`.")}catch(e){return{type:b.error,result:e}}finally{s&&t.signal.removeEventListener("abort",s)}return i}(t,n,e,o,r,c):Promise.resolve({type:b.data,result:void 0}))})}),m=await e({matches:p,request:n,params:o[0].params,fetcherKey:i,context:c});try{await Promise.all(d)}catch(e){}return m}(v,e,0,r,n,a,i,c,o)}catch(e){return n.forEach(t=>{u[t.route.id]={type:b.error,error:e}}),u}for(let[e,t]of Object.entries(l))if($e(t)){let n=t.result;u[e]={type:b.redirect,response:Ae(n,r,e,a,p,g.v7_relativeSplatPath)}}else u[e]=await Te(t);return u}async function ce(t,r,n,a,o){let i=t.matches,s=ue("loader",0,o,n,r,null),l=Promise.all(a.map(async t=>{if(t.matches&&t.match&&t.controller){let r=(await ue("loader",0,Ue(e.history,t.path,t.controller.signal),[t.match],t.matches,t.key))[t.match.route.id];return{[t.key]:r}}return Promise.resolve({[t.key]:{type:b.error,error:He(404,{pathname:t.path})}})})),u=await s,c=(await l).reduce((e,t)=>Object.assign(e,t),{});return await Promise.all([Qe(r,u,o.signal,i,t.loaderData),Ze(r,c,a)]),{loaderResults:u,fetcherResults:c}}function de(){K=!0,$.push(...st()),Q.forEach((e,t)=>{J.has(t)&&V.add(t),Pe(t)})}function he(e,t,r){void 0===r&&(r={}),O.fetchers.set(e,t),ne({fetchers:new Map(O.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function we(e,t,r,n){void 0===n&&(n={});let a=Ie(O.matches,t);Ce(e),ne({errors:{[a.route.id]:r},fetchers:new Map(O.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function Re(e){return Z.set(e,(Z.get(e)||0)+1),ee.has(e)&&ee.delete(e),O.fetchers.get(e)||me}function Ce(e){let t=O.fetchers.get(e);!J.has(e)||t&&"loading"===t.state&&X.has(e)||Pe(e),Q.delete(e),X.delete(e),G.delete(e),g.v7_fetcherPersist&&ee.delete(e),V.delete(e),O.fetchers.delete(e)}function Pe(e){let t=J.get(e);t&&(t.abort(),J.delete(e))}function ke(e){for(let t of e){let e=it(Re(t).data);O.fetchers.set(t,e)}}function je(){let e=[],t=!1;for(let r of G){let n=O.fetchers.get(r);h(n,"Expected fetcher: "+r),"loading"===n.state&&(G.delete(r),e.push(r),t=!0)}return ke(e),t}function Oe(e){let t=[];for(let[r,n]of X)if(n<e){let e=O.fetchers.get(r);h(e,"Expected fetcher: "+r),"loading"===e.state&&(Pe(r),X.delete(r),t.push(r))}return ke(t),t.length>0}function Ke(e){O.blockers.delete(e),re.delete(e)}function Ye(e,t){let r=O.blockers.get(e)||ve;h("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,"Invalid blocker state transition: "+r.state+" -> "+t.state);let n=new Map(O.blockers);n.set(e,t),ne({blockers:n})}function Xe(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===re.size)return;re.size>1&&f(!1,"A router only supports one blocker at a time");let a=Array.from(re.entries()),[o,i]=a[a.length-1],s=O.blockers.get(o);return s&&"proceeding"===s.state?void 0:i({currentLocation:t,nextLocation:r,historyAction:n})?o:void 0}function tt(e){let t=He(404,{pathname:e}),r=i||d,{matches:n,route:a}=ze(r);return st(),{notFoundMatches:n,route:a,error:t}}function st(e){let t=[];return te.forEach((r,n)=>{e&&!e(n)||(r.cancel(),t.push(n),te.delete(n))}),t}function lt(e,t){return L&&L(e,t.map(e=>x(e,O.loaderData)))||e.key}function ut(e,t){if(P){let r=lt(e,t),n=P[r];if("number"==typeof n)return n}return null}function ct(e,t,r){if(y){if(!e)return{active:!0,matches:R(t,r,p,!0)||[]};if(Object.keys(e[0].params).length>0)return{active:!0,matches:R(t,r,p,!0)}}return{active:!1,matches:null}}async function dt(e,t,r,n){if(!y)return{type:"success",matches:e};let a=e;for(;;){let e=null==i,s=i||d,l=c;try{await y({signal:r,path:t,matches:a,fetcherKey:n,patch:(e,t)=>{r.aborted||Le(e,t,s,l,o)}})}catch(e){return{type:"error",error:e,partialMatches:a}}finally{e&&!r.aborted&&(d=[...d])}if(r.aborted)return{type:"aborted"};let u=E(s,t,p);if(u)return{type:"success",matches:u};let h=R(s,t,p,!0);if(!h||a.length===h.length&&a.every((e,t)=>e.route.id===h[t].route.id))return{type:"success",matches:null};a=h}}return u={get basename(){return p},get future(){return g},get state(){return O},get routes(){return d},get window(){return t},initialize:function(){if(D=e.history.listen(t=>{let{action:r,location:n,delta:a}=t;if(j)return j(),void(j=void 0);f(0===re.size||null!=a,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let o=Xe({currentLocation:O.location,nextLocation:n,historyAction:r});if(o&&null!=a){let t=new Promise(e=>{j=e});return e.history.go(-1*a),void Ye(o,{state:"blocked",location:n,proceed(){Ye(o,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(a))},reset(){let e=new Map(O.blockers);e.set(o,ve),ne({blockers:e})}})}return oe(r,n)}),r){!function(e,t){try{let r=e.sessionStorage.getItem(be);if(r){let e=JSON.parse(r);for(let[r,n]of Object.entries(e||{}))n&&Array.isArray(n)&&t.set(r,new Set(n||[]))}}catch(e){}}(t,z);let e=()=>function(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(be,JSON.stringify(r))}catch(e){f(!1,"Failed to save applied view transitions in sessionStorage ("+e+").")}}}(t,z);t.addEventListener("pagehide",e),H=()=>t.removeEventListener("pagehide",e)}return O.initialized||oe(n.Pop,O.location,{initialHydration:!0}),u},subscribe:function(e){return C.add(e),()=>C.delete(e)},enableScrollRestoration:function(e,t,r){if(P=e,k=t,L=r||null,!_&&O.navigation===pe){_=!0;let e=ut(O.location,O.matches);null!=e&&ne({restoreScrollPosition:e})}return()=>{P=null,k=null,L=null}},navigate:async function t(r,a){if("number"==typeof r)return void e.history.go(r);let o=Se(O.location,O.matches,p,g.v7_prependBasename,r,g.v7_relativeSplatPath,null==a?void 0:a.fromRouteId,null==a?void 0:a.relative),{path:i,submission:l,error:u}=Ee(g.v7_normalizeFormMethod,!1,o,a),c=O.location,d=m(O.location,i,a&&a.state);d=s({},d,e.history.encodeLocation(d));let h=a&&null!=a.replace?a.replace:void 0,f=n.Push;!0===h?f=n.Replace:!1===h||null!=l&&Ge(l.formMethod)&&l.formAction===O.location.pathname+O.location.search&&(f=n.Replace);let v=a&&"preventScrollReset"in a?!0===a.preventScrollReset:void 0,y=!0===(a&&a.flushSync),b=Xe({currentLocation:c,nextLocation:d,historyAction:f});if(!b)return await oe(f,d,{submission:l,pendingError:u,preventScrollReset:v,replace:a&&a.replace,enableViewTransition:a&&a.viewTransition,flushSync:y});Ye(b,{state:"blocked",location:d,proceed(){Ye(b,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),t(r,a)},reset(){let e=new Map(O.blockers);e.set(b,ve),ne({blockers:e})}})},fetch:function(t,r,n,o){if(a)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Pe(t);let s=!0===(o&&o.flushSync),l=i||d,u=Se(O.location,O.matches,p,g.v7_prependBasename,n,g.v7_relativeSplatPath,r,null==o?void 0:o.relative),c=E(l,u,p),f=ct(c,l,u);if(f.active&&f.matches&&(c=f.matches),!c)return void we(t,r,He(404,{pathname:u}),{flushSync:s});let{path:m,submission:v,error:y}=Ee(g.v7_normalizeFormMethod,!0,u,o);if(y)return void we(t,r,y,{flushSync:s});let b=rt(c,m),w=!0===(o&&o.preventScrollReset);v&&Ge(v.formMethod)?async function(t,r,n,a,o,s,l,u,c){function f(e){if(!e.route.action&&!e.route.lazy){let e=He(405,{method:c.formMethod,pathname:n,routeId:r});return we(t,r,e,{flushSync:l}),!0}return!1}if(de(),Q.delete(t),!s&&f(a))return;let m=O.fetchers.get(t);he(t,function(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}(c,m),{flushSync:l});let v=new AbortController,y=Ue(e.history,n,v.signal,c);if(s){let e=await dt(o,new URL(y.url).pathname,y.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void we(t,r,e.error,{flushSync:l});if(!e.matches)return void we(t,r,He(404,{pathname:n}),{flushSync:l});if(f(a=rt(o=e.matches,n)))return}J.set(t,v);let b=q,w=(await ue("action",0,y,[a],o,t))[a.route.id];if(y.signal.aborted)return void(J.get(t)===v&&J.delete(t));if(g.v7_fetcherPersist&&ee.has(t)){if(qe(w)||Je(w))return void he(t,it(void 0))}else{if(qe(w))return J.delete(t),Y>b?void he(t,it(void 0)):(G.add(t),he(t,ot(c)),le(y,w,!1,{fetcherSubmission:c,preventScrollReset:u}));if(Je(w))return void we(t,r,w.error)}if(Ve(w))throw He(400,{type:"defer-action"});let S=O.navigation.location||O.location,R=Ue(e.history,S,v.signal),x=i||d,D="idle"!==O.navigation.state?E(x,O.navigation.location,p):O.matches;h(D,"Didn't find any matches after fetcher action");let C=++q;X.set(t,C);let P=ot(c,w.data);O.fetchers.set(t,P);let[L,k]=xe(e.history,O,D,c,S,!1,g.v7_skipActionErrorRevalidation,K,$,V,ee,Q,G,x,p,[a.route.id,w]);k.filter(e=>e.key!==t).forEach(e=>{let t=e.key,r=O.fetchers.get(t),n=ot(void 0,r?r.data:void 0);O.fetchers.set(t,n),Pe(t),e.controller&&J.set(t,e.controller)}),ne({fetchers:new Map(O.fetchers)});let _=()=>k.forEach(e=>Pe(e.key));v.signal.addEventListener("abort",_);let{loaderResults:T,fetcherResults:A}=await ce(O,D,L,k,R);if(v.signal.aborted)return;v.signal.removeEventListener("abort",_),X.delete(t),J.delete(t),k.forEach(e=>J.delete(e.key));let M=We(T);if(M)return le(R,M.result,!1,{preventScrollReset:u});if(M=We(A),M)return G.add(M.key),le(R,M.result,!1,{preventScrollReset:u});let{loaderData:j,errors:N}=Fe(O,D,T,void 0,k,A,te);if(O.fetchers.has(t)){let e=it(w.data);O.fetchers.set(t,e)}Oe(C),"loading"===O.navigation.state&&C>Y?(h(F,"Expected pending action"),U&&U.abort(),ae(O.navigation.location,{matches:D,loaderData:j,errors:N,fetchers:new Map(O.fetchers)})):(ne({errors:N,loaderData:Ne(O.loaderData,j,D,N),fetchers:new Map(O.fetchers)}),K=!1)}(t,r,m,b,c,f.active,s,w,v):(Q.set(t,{routeId:r,path:m}),async function(t,r,n,a,o,i,s,l,u){let c=O.fetchers.get(t);he(t,ot(u,c?c.data:void 0),{flushSync:s});let d=new AbortController,f=Ue(e.history,n,d.signal);if(i){let e=await dt(o,new URL(f.url).pathname,f.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void we(t,r,e.error,{flushSync:s});if(!e.matches)return void we(t,r,He(404,{pathname:n}),{flushSync:s});a=rt(o=e.matches,n)}J.set(t,d);let p=q,m=(await ue("loader",0,f,[a],o,t))[a.route.id];if(Ve(m)&&(m=await et(m,f.signal,!0)||m),J.get(t)===d&&J.delete(t),!f.signal.aborted){if(!ee.has(t))return qe(m)?Y>p?void he(t,it(void 0)):(G.add(t),void await le(f,m,!1,{preventScrollReset:l})):void(Je(m)?we(t,r,m.error):(h(!Ve(m),"Unhandled fetcher deferred data"),he(t,it(m.data))));he(t,it(void 0))}}(t,r,m,b,c,f.active,s,w,v))},revalidate:function(){de(),ne({revalidation:"loading"}),"submitting"!==O.navigation.state&&("idle"!==O.navigation.state?oe(F||O.historyAction,O.navigation.location,{overrideNavigation:O.navigation,enableViewTransition:!0===I}):oe(O.historyAction,O.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Re,deleteFetcher:function(e){let t=(Z.get(e)||0)-1;t<=0?(Z.delete(e),ee.add(e),g.v7_fetcherPersist||Ce(e)):Z.set(e,t),ne({fetchers:new Map(O.fetchers)})},dispose:function(){D&&D(),H&&H(),C.clear(),U&&U.abort(),O.fetchers.forEach((e,t)=>Ce(t)),O.blockers.forEach((e,t)=>Ke(t))},getBlocker:function(e,t){let r=O.blockers.get(e)||ve;return re.get(e)!==t&&re.set(e,t),r},deleteBlocker:Ke,patchRoutes:function(e,t){let r=null==i;Le(e,t,i||d,c,o),r&&(d=[...d],ne({}))},_internalFetchControllers:J,_internalActiveDeferreds:te,_internalSetRoutes:function(e){c={},i=S(e,o,void 0,c)}},u}function Se(e,t,r,n,a,o,i,s){let l,u;if(i){l=[];for(let e of t)if(l.push(e),e.route.id===i){u=e;break}}else l=t,u=t[t.length-1];let c=J(a||".",V(l,o),B(e.pathname,r)||e.pathname,"path"===s);if(null==a&&(c.search=e.search,c.hash=e.hash),(null==a||""===a||"."===a)&&u){let e=tt(c.search);if(u.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll("index");e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let r=e.toString();c.search=r?"?"+r:""}}return n&&"/"!==r&&(c.pathname="/"===c.pathname?r:q([r,c.pathname])),v(c)}function Ee(e,t,r,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:r};if(n.formMethod&&(a=n.formMethod,!de.has(a.toLowerCase())))return{path:r,error:He(405,{method:n.formMethod})};var a;let o,i,s=()=>({path:r,error:He(400,{type:"invalid-body"})}),l=n.formMethod||"get",u=e?l.toUpperCase():l.toLowerCase(),c=Ke(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!Ge(u))return s();let e="string"==typeof n.body?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,t)=>{let[r,n]=t;return""+e+r+"="+n+"\n"},""):String(n.body);return{path:r,submission:{formMethod:u,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===n.formEncType){if(!Ge(u))return s();try{let e="string"==typeof n.body?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:u,formAction:c,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return s()}}}if(h("function"==typeof FormData,"FormData is not available in this environment"),n.formData)o=je(n.formData),i=n.formData;else if(n.body instanceof FormData)o=je(n.body),i=n.body;else if(n.body instanceof URLSearchParams)o=n.body,i=Oe(o);else if(null==n.body)o=new URLSearchParams,i=new FormData;else try{o=new URLSearchParams(n.body),i=Oe(o)}catch(e){return s()}let d={formMethod:u,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(Ge(d.formMethod))return{path:r,submission:d};let f=y(r);return t&&f.search&&tt(f.search)&&o.append("index",""),f.search="?"+o,{path:v(f),submission:d}}function Re(e,t,r){void 0===r&&(r=!1);let n=e.findIndex(e=>e.route.id===t);return n>=0?e.slice(0,r?n+1:n):e}function xe(e,t,r,n,a,o,i,l,u,c,d,h,f,p,m,v){let y=v?Je(v[1])?v[1].error:v[1].data:void 0,g=e.createURL(t.location),b=e.createURL(a),w=r;o&&t.errors?w=Re(r,Object.keys(t.errors)[0],!0):v&&Je(v[1])&&(w=Re(r,v[0]));let S=v?v[1].statusCode:void 0,R=i&&S&&S>=400,x=w.filter((e,r)=>{let{route:a}=e;if(a.lazy)return!0;if(null==a.loader)return!1;if(o)return De(a,t.loaderData,t.errors);if(function(e,t,r){let n=!t||r.route.id!==t.route.id,a=void 0===e[r.route.id];return n||a}(t.loaderData,t.matches[r],e)||u.some(t=>t===e.route.id))return!0;let i=t.matches[r],c=e;return Pe(e,s({currentUrl:g,currentParams:i.params,nextUrl:b,nextParams:c.params},n,{actionResult:y,actionStatus:S,defaultShouldRevalidate:!R&&(l||g.pathname+g.search===b.pathname+b.search||g.search!==b.search||Ce(i,c))}))}),D=[];return h.forEach((e,a)=>{if(o||!r.some(t=>t.route.id===e.routeId)||d.has(a))return;let i=E(p,e.path,m);if(!i)return void D.push({key:a,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let u=t.fetchers.get(a),h=rt(i,e.path),v=!1;f.has(a)?v=!1:c.has(a)?(c.delete(a),v=!0):v=u&&"idle"!==u.state&&void 0===u.data?l:Pe(h,s({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:b,nextParams:r[r.length-1].params},n,{actionResult:y,actionStatus:S,defaultShouldRevalidate:!R&&l})),v&&D.push({key:a,routeId:e.routeId,path:e.path,matches:i,match:h,controller:new AbortController})}),[x,D]}function De(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let n=null!=t&&void 0!==t[e.id],a=null!=r&&void 0!==r[e.id];return!(!n&&a)&&("function"==typeof e.loader&&!0===e.loader.hydrate||!n&&!a)}function Ce(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Pe(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}function Le(e,t,r,n,a){var o;let i;if(e){let t=n[e];h(t,"No route found to patch children into: routeId = "+e),t.children||(t.children=[]),i=t.children}else i=r;let s=S(t.filter(e=>!i.some(t=>ke(e,t))),a,[e||"_","patch",String((null==(o=i)?void 0:o.length)||"0")],n);i.push(...s)}function ke(e,t){return"id"in e&&"id"in t&&e.id===t.id||e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive&&(!(e.children&&0!==e.children.length||t.children&&0!==t.children.length)||e.children.every((e,r)=>{var n;return null==(n=t.children)?void 0:n.some(t=>ke(e,t))}))}async function _e(e){let{matches:t}=e,r=t.filter(e=>e.shouldLoad);return(await Promise.all(r.map(e=>e.resolve()))).reduce((e,t,n)=>Object.assign(e,{[r[n].route.id]:t}),{})}async function Te(e){let{result:t,type:r}=e;if(Xe(t)){let e;try{let r=t.headers.get("Content-Type");e=r&&/\bapplication\/json\b/.test(r)?null==t.body?null:await t.json():await t.text()}catch(e){return{type:b.error,error:e}}return r===b.error?{type:b.error,error:new ie(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:b.data,data:e,statusCode:t.status,headers:t.headers}}var n,a,o,i,s,l,u,c;return r===b.error?Ye(t)?t.data instanceof Error?{type:b.error,error:t.data,statusCode:null==(o=t.init)?void 0:o.status,headers:null!=(i=t.init)&&i.headers?new Headers(t.init.headers):void 0}:{type:b.error,error:new ie((null==(n=t.init)?void 0:n.status)||500,void 0,t.data),statusCode:se(t)?t.status:void 0,headers:null!=(a=t.init)&&a.headers?new Headers(t.init.headers):void 0}:{type:b.error,error:t,statusCode:se(t)?t.status:void 0}:function(e){let t=e;return t&&"object"==typeof t&&"object"==typeof t.data&&"function"==typeof t.subscribe&&"function"==typeof t.cancel&&"function"==typeof t.resolveData}(t)?{type:b.deferred,deferredData:t,statusCode:null==(s=t.init)?void 0:s.status,headers:(null==(l=t.init)?void 0:l.headers)&&new Headers(t.init.headers)}:Ye(t)?{type:b.data,data:t.data,statusCode:null==(u=t.init)?void 0:u.status,headers:null!=(c=t.init)&&c.headers?new Headers(t.init.headers):void 0}:{type:b.data,data:t}}function Ae(e,t,r,n,a,o){let i=e.headers.get("Location");if(h(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!ye.test(i)){let s=n.slice(0,n.findIndex(e=>e.route.id===r)+1);i=Se(new URL(t.url),s,a,!0,i,o),e.headers.set("Location",i)}return e}function Me(e,t,r){if(ye.test(e)){let n=e,a=n.startsWith("//")?new URL(t.protocol+n):new URL(n),o=null!=B(a.pathname,r);if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}return e}function Ue(e,t,r,n){let a=e.createURL(Ke(t)).toString(),o={signal:r};if(n&&Ge(n.formMethod)){let{formMethod:e,formEncType:t}=n;o.method=e.toUpperCase(),"application/json"===t?(o.headers=new Headers({"Content-Type":t}),o.body=JSON.stringify(n.json)):"text/plain"===t?o.body=n.text:"application/x-www-form-urlencoded"===t&&n.formData?o.body=je(n.formData):o.body=n.formData}return new Request(a,o)}function je(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function Oe(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Fe(e,t,r,n,a,o,i){let{loaderData:l,errors:u}=function(e,t,r,n,a){let o,i={},s=null,l=!1,u={},c=r&&Je(r[1])?r[1].error:void 0;return e.forEach(r=>{if(!(r.route.id in t))return;let d=r.route.id,f=t[d];if(h(!qe(f),"Cannot handle redirect results in processLoaderData"),Je(f)){let t=f.error;if(void 0!==c&&(t=c,c=void 0),s=s||{},a)s[d]=t;else{let r=Ie(e,d);null==s[r.route.id]&&(s[r.route.id]=t)}i[d]=void 0,l||(l=!0,o=se(f.error)?f.error.status:500),f.headers&&(u[d]=f.headers)}else Ve(f)?(n.set(d,f.deferredData),i[d]=f.deferredData.data,null==f.statusCode||200===f.statusCode||l||(o=f.statusCode),f.headers&&(u[d]=f.headers)):(i[d]=f.data,f.statusCode&&200!==f.statusCode&&!l&&(o=f.statusCode),f.headers&&(u[d]=f.headers))}),void 0!==c&&r&&(s={[r[0]]:c},i[r[0]]=void 0),{loaderData:i,errors:s,statusCode:o||200,loaderHeaders:u}}(t,r,n,i,!1);return a.forEach(t=>{let{key:r,match:n,controller:a}=t,i=o[r];if(h(i,"Did not find corresponding fetcher result"),!a||!a.signal.aborted)if(Je(i)){let t=Ie(e.matches,null==n?void 0:n.route.id);u&&u[t.route.id]||(u=s({},u,{[t.route.id]:i.error})),e.fetchers.delete(r)}else if(qe(i))h(!1,"Unhandled fetcher revalidation redirect");else if(Ve(i))h(!1,"Unhandled fetcher deferred data");else{let t=it(i.data);e.fetchers.set(r,t)}}),{loaderData:l,errors:u}}function Ne(e,t,r,n){let a=s({},t);for(let o of r){let r=o.route.id;if(t.hasOwnProperty(r)?void 0!==t[r]&&(a[r]=t[r]):void 0!==e[r]&&o.route.loader&&(a[r]=e[r]),n&&n.hasOwnProperty(r))break}return a}function Be(e){return e?Je(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ie(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>!0===e.route.hasErrorBoundary)||e[0]}function ze(e){let t=1===e.length?e[0]:e.find(e=>e.index||!e.path||"/"===e.path)||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function He(e,t){let{pathname:r,routeId:n,method:a,type:o,message:i}=void 0===t?{}:t,s="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(s="Bad Request",a&&r&&n?l="You made a "+a+' request to "'+r+'" but did not provide a `loader` for route "'+n+'", so there is no way to handle the request.':"defer-action"===o?l="defer() is not supported in actions":"invalid-body"===o&&(l="Unable to encode submission body")):403===e?(s="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):404===e?(s="Not Found",l='No route matches URL "'+r+'"'):405===e&&(s="Method Not Allowed",a&&r&&n?l="You made a "+a.toUpperCase()+' request to "'+r+'" but did not provide an `action` for route "'+n+'", so there is no way to handle the request.':a&&(l='Invalid request method "'+a.toUpperCase()+'"')),new ie(e||500,s,new Error(l),!0)}function We(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[r,n]=t[e];if(qe(n))return{key:r,result:n}}}function Ke(e){return v(s({},"string"==typeof e?y(e):e,{hash:""}))}function $e(e){return Xe(e.result)&&he.has(e.result.status)}function Ve(e){return e.type===b.deferred}function Je(e){return e.type===b.error}function qe(e){return(e&&e.type)===b.redirect}function Ye(e){return"object"==typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function Xe(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function Ge(e){return ue.has(e.toLowerCase())}async function Qe(e,t,r,n,a){let o=Object.entries(t);for(let i=0;i<o.length;i++){let[s,l]=o[i],u=e.find(e=>(null==e?void 0:e.route.id)===s);if(!u)continue;let c=n.find(e=>e.route.id===u.route.id),d=null!=c&&!Ce(c,u)&&void 0!==(a&&a[u.route.id]);Ve(l)&&d&&await et(l,r,!1).then(e=>{e&&(t[s]=e)})}}async function Ze(e,t,r){for(let n=0;n<r.length;n++){let{key:a,routeId:o,controller:i}=r[n],s=t[a];e.find(e=>(null==e?void 0:e.route.id)===o)&&Ve(s)&&(h(i,"Expected an AbortController for revalidating fetcher deferred result"),await et(s,i.signal,!0).then(e=>{e&&(t[a]=e)}))}}async function et(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:b.data,data:e.deferredData.unwrappedData}}catch(e){return{type:b.error,error:e}}return{type:b.data,data:e.deferredData.data}}}function tt(e){return new URLSearchParams(e).getAll("index").some(e=>""===e)}function rt(e,t){let r="string"==typeof t?y(t).search:t.search;if(e[e.length-1].route.index&&tt(r||""))return e[e.length-1];let n=$(e);return n[n.length-1]}function nt(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(t&&r&&n)return null!=a?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a}:null!=o?{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0}:void 0!==i?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}:void 0}function at(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function ot(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function it(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function st(){return st=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},st.apply(this,arguments)}Symbol("deferred");const lt=a.createContext(null),ut=a.createContext(null),ct=a.createContext(null),dt=a.createContext(null),ht=a.createContext(null),ft=a.createContext({outlet:null,matches:[],isDataRoute:!1}),pt=a.createContext(null);function mt(e,t){let{relative:r}=void 0===t?{}:t;vt()||h(!1);let{basename:n,navigator:o}=a.useContext(dt),{hash:i,pathname:s,search:l}=Ct(e,{relative:r}),u=s;return"/"!==n&&(u="/"===s?n:q([n,s])),o.createHref({pathname:u,search:l,hash:i})}function vt(){return null!=a.useContext(ht)}function yt(){return vt()||h(!1),a.useContext(ht).location}function gt(){return a.useContext(ht).navigationType}function bt(e){vt()||h(!1);let{pathname:t}=yt();return a.useMemo(()=>F(e,N(t)),[t,e])}function wt(e){a.useContext(dt).static||a.useLayoutEffect(e)}function St(){let{isDataRoute:e}=a.useContext(ft);return e?function(){let{router:e}=Ot(Ut.UseNavigateStable),t=Nt(jt.UseNavigateStable),r=a.useRef(!1);return wt(()=>{r.current=!0}),a.useCallback(function(n,a){void 0===a&&(a={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,st({fromRouteId:t},a)))},[e,t])}():function(){vt()||h(!1);let e=a.useContext(lt),{basename:t,future:r,navigator:n}=a.useContext(dt),{matches:o}=a.useContext(ft),{pathname:i}=yt(),s=JSON.stringify(V(o,r.v7_relativeSplatPath)),l=a.useRef(!1);return wt(()=>{l.current=!0}),a.useCallback(function(r,a){if(void 0===a&&(a={}),!l.current)return;if("number"==typeof r)return void n.go(r);let o=J(r,JSON.parse(s),i,"path"===a.relative);null==e&&"/"!==t&&(o.pathname="/"===o.pathname?t:q([t,o.pathname])),(a.replace?n.replace:n.push)(o,a.state,a)},[t,n,s,i,e])}()}const Et=a.createContext(null);function Rt(){return a.useContext(Et)}function xt(e){let t=a.useContext(ft).outlet;return t?a.createElement(Et.Provider,{value:e},t):t}function Dt(){let{matches:e}=a.useContext(ft),t=e[e.length-1];return t?t.params:{}}function Ct(e,t){let{relative:r}=void 0===t?{}:t,{future:n}=a.useContext(dt),{matches:o}=a.useContext(ft),{pathname:i}=yt(),s=JSON.stringify(V(o,n.v7_relativeSplatPath));return a.useMemo(()=>J(e,JSON.parse(s),i,"path"===r),[e,s,i,r])}function Pt(e,t){return Lt(e,t)}function Lt(e,t,r,o){vt()||h(!1);let{navigator:i}=a.useContext(dt),{matches:s}=a.useContext(ft),l=s[s.length-1],u=l?l.params:{},c=(l&&l.pathname,l?l.pathnameBase:"/");l&&l.route;let d,f=yt();if(t){var p;let e="string"==typeof t?y(t):t;"/"===c||(null==(p=e.pathname)?void 0:p.startsWith(c))||h(!1),d=e}else d=f;let m=d.pathname||"/",v=m;if("/"!==c){let e=c.replace(/^\//,"").split("/");v="/"+m.replace(/^\//,"").split("/").slice(e.length).join("/")}let g=E(e,{pathname:v}),b=Mt(g&&g.map(e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:q([c,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:q([c,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),s,r,o);return t&&b?a.createElement(ht.Provider,{value:{location:st({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:n.Pop}},b):b}function kt(){let e=Vt(),t=se(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return a.createElement(a.Fragment,null,a.createElement("h2",null,"Unexpected Application Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},t),r?a.createElement("pre",{style:n},r):null,null)}const _t=a.createElement(kt,null);class Tt extends a.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?a.createElement(ft.Provider,{value:this.props.routeContext},a.createElement(pt.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function At(e){let{routeContext:t,match:r,children:n}=e,o=a.useContext(lt);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),a.createElement(ft.Provider,{value:t},n)}function Mt(e,t,r,n){var o;if(void 0===t&&(t=[]),void 0===r&&(r=null),void 0===n&&(n=null),null==e){var i;if(!r)return null;if(r.errors)e=r.matches;else{if(!(null!=(i=n)&&i.v7_partialHydration&&0===t.length&&!r.initialized&&r.matches.length>0))return null;e=r.matches}}let s=e,l=null==(o=r)?void 0:o.errors;if(null!=l){let e=s.findIndex(e=>e.route.id&&void 0!==(null==l?void 0:l[e.route.id]));e>=0||h(!1),s=s.slice(0,Math.min(s.length,e+1))}let u=!1,c=-1;if(r&&n&&n.v7_partialHydration)for(let e=0;e<s.length;e++){let t=s[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:n}=r,a=t.route.loader&&void 0===e[t.route.id]&&(!n||void 0===n[t.route.id]);if(t.route.lazy||a){u=!0,s=c>=0?s.slice(0,c+1):[s[0]];break}}}return s.reduceRight((e,n,o)=>{let i,d=!1,h=null,f=null;var p;r&&(i=l&&n.route.id?l[n.route.id]:void 0,h=n.route.errorElement||_t,u&&(c<0&&0===o?(Gt[p="route-fallback"]||(Gt[p]=!0),d=!0,f=null):c===o&&(d=!0,f=n.route.hydrateFallbackElement||null)));let m=t.concat(s.slice(0,o+1)),v=()=>{let t;return t=i?h:d?f:n.route.Component?a.createElement(n.route.Component,null):n.route.element?n.route.element:e,a.createElement(At,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===o)?a.createElement(Tt,{location:r.location,revalidation:r.revalidation,component:h,error:i,children:v(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):v()},null)}var Ut=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Ut||{}),jt=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(jt||{});function Ot(e){let t=a.useContext(lt);return t||h(!1),t}function Ft(e){let t=a.useContext(ut);return t||h(!1),t}function Nt(e){let t=function(){let e=a.useContext(ft);return e||h(!1),e}(),r=t.matches[t.matches.length-1];return r.route.id||h(!1),r.route.id}function Bt(){return Nt(jt.UseRouteId)}function It(){return Ft(jt.UseNavigation).navigation}function zt(){let e=Ot(Ut.UseRevalidator),t=Ft(jt.UseRevalidator);return a.useMemo(()=>({revalidate:e.router.revalidate,state:t.revalidation}),[e.router.revalidate,t.revalidation])}function Ht(){let{matches:e,loaderData:t}=Ft(jt.UseMatches);return a.useMemo(()=>e.map(e=>x(e,t)),[e,t])}function Wt(){let e=Ft(jt.UseLoaderData),t=Nt(jt.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")}function Kt(e){return Ft(jt.UseRouteLoaderData).loaderData[e]}function $t(){let e=Ft(jt.UseActionData),t=Nt(jt.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function Vt(){var e;let t=a.useContext(pt),r=Ft(jt.UseRouteError),n=Nt(jt.UseRouteError);return void 0!==t?t:null==(e=r.errors)?void 0:e[n]}function Jt(){let e=a.useContext(ct);return null==e?void 0:e._data}function qt(){let e=a.useContext(ct);return null==e?void 0:e._error}let Yt=0;function Xt(e){let{router:t,basename:r}=Ot(Ut.UseBlocker),n=Ft(jt.UseBlocker),[o,i]=a.useState(""),s=a.useCallback(t=>{if("function"!=typeof e)return!!e;if("/"===r)return e(t);let{currentLocation:n,nextLocation:a,historyAction:o}=t;return e({currentLocation:st({},n,{pathname:B(n.pathname,r)||n.pathname}),nextLocation:st({},a,{pathname:B(a.pathname,r)||a.pathname}),historyAction:o})},[r,e]);return a.useEffect(()=>{let e=String(++Yt);return i(e),()=>t.deleteBlocker(e)},[t]),a.useEffect(()=>{""!==o&&t.getBlocker(o,s)},[t,o,s]),o&&n.blockers.has(o)?n.blockers.get(o):ve}const Gt={},Qt=(e,t,r)=>{};function Zt(e,t){void 0===(null==e?void 0:e.v7_startTransition)&&Qt("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),void 0!==(null==e?void 0:e.v7_relativeSplatPath)||t&&void 0!==t.v7_relativeSplatPath||Qt("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),t&&(void 0===t.v7_fetcherPersist&&Qt("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),void 0===t.v7_normalizeFormMethod&&Qt("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),void 0===t.v7_partialHydration&&Qt("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),void 0===t.v7_skipActionErrorRevalidation&&Qt("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation"))}const er=a.startTransition;function tr(e){let{basename:t,children:r,initialEntries:n,initialIndex:o,future:i}=e,s=a.useRef();null==s.current&&(s.current=u({initialEntries:n,initialIndex:o,v5Compat:!0}));let l=s.current,[c,d]=a.useState({action:l.action,location:l.location}),{v7_startTransition:h}=i||{},f=a.useCallback(e=>{h&&er?er(()=>d(e)):d(e)},[d,h]);return a.useLayoutEffect(()=>l.listen(f),[l,f]),a.useEffect(()=>Zt(i),[i]),a.createElement(or,{basename:t,children:r,location:c.location,navigationType:c.action,navigator:l,future:i})}function rr(e){let{to:t,replace:r,state:n,relative:o}=e;vt()||h(!1);let{future:i,static:s}=a.useContext(dt),{matches:l}=a.useContext(ft),{pathname:u}=yt(),c=St(),d=J(t,V(l,i.v7_relativeSplatPath),u,"path"===o),f=JSON.stringify(d);return a.useEffect(()=>c(JSON.parse(f),{replace:r,state:n,relative:o}),[c,f,o,r,n]),null}function nr(e){return xt(e.context)}function ar(e){h(!1)}function or(e){let{basename:t="/",children:r=null,location:o,navigationType:i=n.Pop,navigator:s,static:l=!1,future:u}=e;vt()&&h(!1);let c=t.replace(/^\/*/,"/"),d=a.useMemo(()=>({basename:c,navigator:s,static:l,future:st({v7_relativeSplatPath:!1},u)}),[c,u,s,l]);"string"==typeof o&&(o=y(o));let{pathname:f="/",search:p="",hash:m="",state:v=null,key:g="default"}=o,b=a.useMemo(()=>{let e=B(f,c);return null==e?null:{location:{pathname:e,search:p,hash:m,state:v,key:g},navigationType:i}},[c,f,p,m,v,g,i]);return null==b?null:a.createElement(dt.Provider,{value:d},a.createElement(ht.Provider,{children:r,value:b}))}function ir(e){let{children:t,location:r}=e;return Pt(hr(t),r)}function sr(e){let{children:t,errorElement:r,resolve:n}=e;return a.createElement(cr,{resolve:n,errorElement:r},a.createElement(dr,null,t))}var lr=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(lr||{});const ur=new Promise(()=>{});class cr extends a.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:r}=this.props,n=null,o=lr.pending;if(r instanceof Promise)if(this.state.error){o=lr.error;let e=this.state.error;n=Promise.reject().catch(()=>{}),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_error",{get:()=>e})}else r._tracked?(n=r,o="_error"in n?lr.error:"_data"in n?lr.success:lr.pending):(o=lr.pending,Object.defineProperty(r,"_tracked",{get:()=>!0}),n=r.then(e=>Object.defineProperty(r,"_data",{get:()=>e}),e=>Object.defineProperty(r,"_error",{get:()=>e})));else o=lr.success,n=Promise.resolve(),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_data",{get:()=>r});if(o===lr.error&&n._error instanceof Z)throw ur;if(o===lr.error&&!t)throw n._error;if(o===lr.error)return a.createElement(ct.Provider,{value:n,children:t});if(o===lr.success)return a.createElement(ct.Provider,{value:n,children:e});throw n}}function dr(e){let{children:t}=e,r=Jt(),n="function"==typeof t?t(r):t;return a.createElement(a.Fragment,null,n)}function hr(e,t){void 0===t&&(t=[]);let r=[];return a.Children.forEach(e,(e,n)=>{if(!a.isValidElement(e))return;let o=[...t,n];if(e.type===a.Fragment)return void r.push.apply(r,hr(e.props.children,o));e.type!==ar&&h(!1),e.props.index&&e.props.children&&h(!1);let i={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(i.children=hr(e.props.children,o)),r.push(i)}),r}function fr(e){return Mt(e)}function pr(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:a.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:a.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:a.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function mr(e,t){return we({basename:null==t?void 0:t.basename,future:st({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:u({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:pr,dataStrategy:null==t?void 0:t.dataStrategy,patchRoutesOnNavigation:null==t?void 0:t.patchRoutesOnNavigation}).initialize()}function vr(){return vr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vr.apply(this,arguments)}function yr(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}const gr="get",br="application/x-www-form-urlencoded";function wr(e){return null!=e&&"string"==typeof e.tagName}function Sr(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(e=>[r,e]):[[r,n]])},[]))}let Er=null;const Rr=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function xr(e){return null==e||Rr.has(e)?e:null}const Dr=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Cr=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Pr=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","viewTransition"];try{window.__reactRouterVersion="6"}catch(e){}function Lr(e,t){return we({basename:null==t?void 0:t.basename,future:vr({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:c({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||_r(),routes:e,mapRouteProperties:pr,dataStrategy:null==t?void 0:t.dataStrategy,patchRoutesOnNavigation:null==t?void 0:t.patchRoutesOnNavigation,window:null==t?void 0:t.window}).initialize()}function kr(e,t){return we({basename:null==t?void 0:t.basename,future:vr({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:d({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||_r(),routes:e,mapRouteProperties:pr,dataStrategy:null==t?void 0:t.dataStrategy,patchRoutesOnNavigation:null==t?void 0:t.patchRoutesOnNavigation,window:null==t?void 0:t.window}).initialize()}function _r(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=vr({},t,{errors:Tr(t.errors)})),t}function Tr(e){if(!e)return null;let t=Object.entries(e),r={};for(let[e,n]of t)if(n&&"RouteErrorResponse"===n.__type)r[e]=new ie(n.status,n.statusText,n.data,!0===n.internal);else if(n&&"Error"===n.__type){if(n.__subType){let t=window[n.__subType];if("function"==typeof t)try{let a=new t(n.message);a.stack="",r[e]=a}catch(e){}}if(null==r[e]){let t=new Error(n.message);t.stack="",r[e]=t}}else r[e]=n;return r}const Ar=a.createContext({isTransitioning:!1}),Mr=a.createContext(new Map),Ur=a.startTransition,jr=i.flushSync,Or=a.useId;function Fr(e){jr?jr(e):e()}class Nr{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}})}}function Br(e){let{fallbackElement:t,router:r,future:n}=e,[o,i]=a.useState(r.state),[s,l]=a.useState(),[u,c]=a.useState({isTransitioning:!1}),[d,h]=a.useState(),[f,p]=a.useState(),[m,v]=a.useState(),y=a.useRef(new Map),{v7_startTransition:g}=n||{},b=a.useCallback(e=>{g?function(e){Ur?Ur(e):e()}(e):e()},[g]),w=a.useCallback((e,t)=>{let{deletedFetchers:n,flushSync:a,viewTransitionOpts:o}=t;e.fetchers.forEach((e,t)=>{void 0!==e.data&&y.current.set(t,e.data)}),n.forEach(e=>y.current.delete(e));let s=null==r.window||null==r.window.document||"function"!=typeof r.window.document.startViewTransition;if(o&&!s){if(a){Fr(()=>{f&&(d&&d.resolve(),f.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:o.currentLocation,nextLocation:o.nextLocation})});let t=r.window.document.startViewTransition(()=>{Fr(()=>i(e))});return t.finished.finally(()=>{Fr(()=>{h(void 0),p(void 0),l(void 0),c({isTransitioning:!1})})}),void Fr(()=>p(t))}f?(d&&d.resolve(),f.skipTransition(),v({state:e,currentLocation:o.currentLocation,nextLocation:o.nextLocation})):(l(e),c({isTransitioning:!0,flushSync:!1,currentLocation:o.currentLocation,nextLocation:o.nextLocation}))}else a?Fr(()=>i(e)):b(()=>i(e))},[r.window,f,d,y,b]);a.useLayoutEffect(()=>r.subscribe(w),[r,w]),a.useEffect(()=>{u.isTransitioning&&!u.flushSync&&h(new Nr)},[u]),a.useEffect(()=>{if(d&&s&&r.window){let e=s,t=d.promise,n=r.window.document.startViewTransition(async()=>{b(()=>i(e)),await t});n.finished.finally(()=>{h(void 0),p(void 0),l(void 0),c({isTransitioning:!1})}),p(n)}},[b,s,d,r.window]),a.useEffect(()=>{d&&s&&o.location.key===s.location.key&&d.resolve()},[d,f,o.location,s]),a.useEffect(()=>{!u.isTransitioning&&m&&(l(m.state),c({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),v(void 0))},[u.isTransitioning,m]),a.useEffect(()=>{},[]);let S=a.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})}),[r]),E=r.basename||"/",R=a.useMemo(()=>({router:r,navigator:S,static:!1,basename:E}),[r,S,E]),x=a.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return a.useEffect(()=>Zt(n,r.future),[n,r.future]),a.createElement(a.Fragment,null,a.createElement(lt.Provider,{value:R},a.createElement(ut.Provider,{value:o},a.createElement(Mr.Provider,{value:y.current},a.createElement(Ar.Provider,{value:u},a.createElement(or,{basename:E,location:o.location,navigationType:o.historyAction,navigator:S,future:x},o.initialized||r.future.v7_partialHydration?a.createElement(Ir,{routes:r.routes,future:r.future,state:o}):t))))),null)}const Ir=a.memo(zr);function zr(e){let{routes:t,future:r,state:n}=e;return Lt(t,void 0,n,r)}function Hr(e){let{basename:t,children:r,future:n,window:o}=e,i=a.useRef();null==i.current&&(i.current=c({window:o,v5Compat:!0}));let s=i.current,[l,u]=a.useState({action:s.action,location:s.location}),{v7_startTransition:d}=n||{},h=a.useCallback(e=>{d&&Ur?Ur(()=>u(e)):u(e)},[u,d]);return a.useLayoutEffect(()=>s.listen(h),[s,h]),a.useEffect(()=>Zt(n),[n]),a.createElement(or,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}function Wr(e){let{basename:t,children:r,future:n,window:o}=e,i=a.useRef();null==i.current&&(i.current=d({window:o,v5Compat:!0}));let s=i.current,[l,u]=a.useState({action:s.action,location:s.location}),{v7_startTransition:c}=n||{},h=a.useCallback(e=>{c&&Ur?Ur(()=>u(e)):u(e)},[u,c]);return a.useLayoutEffect(()=>s.listen(h),[s,h]),a.useEffect(()=>Zt(n),[n]),a.createElement(or,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}function Kr(e){let{basename:t,children:r,future:n,history:o}=e,[i,s]=a.useState({action:o.action,location:o.location}),{v7_startTransition:l}=n||{},u=a.useCallback(e=>{l&&Ur?Ur(()=>s(e)):s(e)},[s,l]);return a.useLayoutEffect(()=>o.listen(u),[o,u]),a.useEffect(()=>Zt(n),[n]),a.createElement(or,{basename:t,children:r,location:i.location,navigationType:i.action,navigator:o,future:n})}const $r="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Vr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jr=a.forwardRef(function(e,t){let r,{onClick:n,relative:o,reloadDocument:i,replace:s,state:l,target:u,to:c,preventScrollReset:d,viewTransition:h}=e,f=yr(e,Dr),{basename:p}=a.useContext(dt),m=!1;if("string"==typeof c&&Vr.test(c)&&(r=c,$r))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),r=B(t.pathname,p);t.origin===e.origin&&null!=r?c=r+t.search+t.hash:m=!0}catch(e){}let v=mt(c,{relative:o}),y=tn(c,{replace:s,state:l,target:u,preventScrollReset:d,relative:o,viewTransition:h});return a.createElement("a",vr({},f,{href:r||v,onClick:m||i?n:function(e){n&&n(e),e.defaultPrevented||y(e)},ref:t,target:u}))}),qr=a.forwardRef(function(e,t){let{"aria-current":r="page",caseSensitive:n=!1,className:o="",end:i=!1,style:s,to:l,viewTransition:u,children:c}=e,d=yr(e,Cr),h=Ct(l,{relative:d.relative}),f=yt(),p=a.useContext(ut),{navigator:m,basename:v}=a.useContext(dt),y=null!=p&&mn(h)&&!0===u,g=m.encodeLocation?m.encodeLocation(h).pathname:h.pathname,b=f.pathname,w=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;n||(b=b.toLowerCase(),w=w?w.toLowerCase():null,g=g.toLowerCase()),w&&v&&(w=B(w,v)||w);const S="/"!==g&&g.endsWith("/")?g.length-1:g.length;let E,R=b===g||!i&&b.startsWith(g)&&"/"===b.charAt(S),x=null!=w&&(w===g||!i&&w.startsWith(g)&&"/"===w.charAt(g.length)),D={isActive:R,isPending:x,isTransitioning:y},C=R?r:void 0;E="function"==typeof o?o(D):[o,R?"active":null,x?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let P="function"==typeof s?s(D):s;return a.createElement(Jr,vr({},d,{"aria-current":C,className:E,ref:t,style:P,to:l,viewTransition:u}),"function"==typeof c?c(D):c)}),Yr=a.forwardRef((e,t)=>{let{fetcherKey:r,navigate:n,reloadDocument:o,replace:i,state:s,method:l=gr,action:u,onSubmit:c,relative:d,preventScrollReset:h,viewTransition:f}=e,p=yr(e,Pr),m=on(),v=sn(u,{relative:d}),y="get"===l.toLowerCase()?"get":"post";return a.createElement("form",vr({ref:t,method:y,action:v,onSubmit:o?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,a=(null==t?void 0:t.getAttribute("formmethod"))||l;m(t||e.currentTarget,{fetcherKey:r,method:a,navigate:n,replace:i,state:s,relative:d,preventScrollReset:h,viewTransition:f})}},p))});function Xr(e){let{getKey:t,storageKey:r}=e;return hn({getKey:t,storageKey:r}),null}var Gr,Qr;function Zr(e){let t=a.useContext(lt);return t||h(!1),t}function en(e){let t=a.useContext(ut);return t||h(!1),t}function tn(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:s,viewTransition:l}=void 0===t?{}:t,u=St(),c=yt(),d=Ct(e,{relative:s});return a.useCallback(t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,r)){t.preventDefault();let r=void 0!==n?n:v(c)===v(d);u(e,{replace:r,state:o,preventScrollReset:i,relative:s,viewTransition:l})}},[c,u,d,n,o,r,e,i,s,l])}function rn(e){let t=a.useRef(Sr(e)),r=a.useRef(!1),n=yt(),o=a.useMemo(()=>function(e,t){let r=Sr(e);return t&&t.forEach((e,n)=>{r.has(n)||t.getAll(n).forEach(e=>{r.append(n,e)})}),r}(n.search,r.current?null:t.current),[n.search]),i=St(),s=a.useCallback((e,t)=>{const n=Sr("function"==typeof e?e(o):e);r.current=!0,i("?"+n,t)},[i,o]);return[o,s]}(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Gr||(Gr={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Qr||(Qr={}));let nn=0,an=()=>"__"+String(++nn)+"__";function on(){let{router:e}=Zr(Gr.UseSubmit),{basename:t}=a.useContext(dt),r=Bt();return a.useCallback(function(n,a){void 0===a&&(a={}),function(){if("undefined"==typeof document)throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}();let{action:o,method:i,encType:s,formData:l,body:u}=function(e,t){let r,n,a,o,i;if(wr(s=e)&&"form"===s.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?B(i,t):null,r=e.getAttribute("method")||gr,a=xr(e.getAttribute("enctype"))||br,o=new FormData(e)}else if(function(e){return wr(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return wr(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||i.getAttribute("action");if(n=s?B(s,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||gr,a=xr(e.getAttribute("formenctype"))||xr(i.getAttribute("enctype"))||br,o=new FormData(i,e),!function(){if(null===Er)try{new FormData(document.createElement("form"),0),Er=!1}catch(e){Er=!0}return Er}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?t+".":"";o.append(e+"x","0"),o.append(e+"y","0")}else t&&o.append(t,n)}}else{if(wr(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=gr,n=null,a=br,i=e}var s;return o&&"text/plain"===a&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}(n,t);if(!1===a.navigate){let t=a.fetcherKey||an();e.fetch(t,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||i,formEncType:a.encType||s,flushSync:a.flushSync})}else e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||i,formEncType:a.encType||s,replace:a.replace,state:a.state,fromRouteId:r,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,r])}function sn(e,t){let{relative:r}=void 0===t?{}:t,{basename:n}=a.useContext(dt),o=a.useContext(ft);o||h(!1);let[i]=o.matches.slice(-1),s=vr({},Ct(e||".",{relative:r})),l=yt();if(null==e){s.search=l.search;let e=new URLSearchParams(s.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let r=e.toString();s.search=r?"?"+r:""}}return e&&"."!==e||!i.route.index||(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),"/"!==n&&(s.pathname="/"===s.pathname?n:q([n,s.pathname])),v(s)}function ln(e){var t;let{key:r}=void 0===e?{}:e,{router:n}=Zr(Gr.UseFetcher),o=en(Qr.UseFetcher),i=a.useContext(Mr),s=a.useContext(ft),l=null==(t=s.matches[s.matches.length-1])?void 0:t.route.id;i||h(!1),s||h(!1),null==l&&h(!1);let u=Or?Or():"",[c,d]=a.useState(r||u);r&&r!==c?d(r):c||d(an()),a.useEffect(()=>(n.getFetcher(c),()=>{n.deleteFetcher(c)}),[n,c]);let f=a.useCallback((e,t)=>{l||h(!1),n.fetch(c,l,e,t)},[c,l,n]),p=on(),m=a.useCallback((e,t)=>{p(e,vr({},t,{navigate:!1,fetcherKey:c}))},[c,p]),v=a.useMemo(()=>a.forwardRef((e,t)=>a.createElement(Yr,vr({},e,{navigate:!1,fetcherKey:c,ref:t}))),[c]),y=o.fetchers.get(c)||me,g=i.get(c);return a.useMemo(()=>vr({Form:v,submit:m,load:f},y,{data:g}),[v,m,f,y,g])}function un(){let e=en(Qr.UseFetchers);return Array.from(e.fetchers.entries()).map(e=>{let[t,r]=e;return vr({},r,{key:t})})}const cn="react-router-scroll-positions";let dn={};function hn(e){let{getKey:t,storageKey:r}=void 0===e?{}:e,{router:n}=Zr(Gr.UseScrollRestoration),{restoreScrollPosition:o,preventScrollReset:i}=en(Qr.UseScrollRestoration),{basename:s}=a.useContext(dt),l=yt(),u=Ht(),c=It();a.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),function(e){let{capture:t}={};a.useEffect(()=>{let r=null!=t?{capture:t}:void 0;return window.addEventListener("pagehide",e,r),()=>{window.removeEventListener("pagehide",e,r)}},[e,t])}(a.useCallback(()=>{if("idle"===c.state){let e=(t?t(l,u):null)||l.key;dn[e]=window.scrollY}try{sessionStorage.setItem(r||cn,JSON.stringify(dn))}catch(e){}window.history.scrollRestoration="auto"},[r,t,c.state,l,u])),"undefined"!=typeof document&&(a.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(r||cn);e&&(dn=JSON.parse(e))}catch(e){}},[r]),a.useLayoutEffect(()=>{let e=t&&"/"!==s?(e,r)=>t(vr({},e,{pathname:B(e.pathname,s)||e.pathname}),r):t,r=null==n?void 0:n.enableScrollRestoration(dn,()=>window.scrollY,e);return()=>r&&r()},[n,s,t]),a.useLayoutEffect(()=>{if(!1!==o)if("number"!=typeof o){if(l.hash){let e=document.getElementById(decodeURIComponent(l.hash.slice(1)));if(e)return void e.scrollIntoView()}!0!==i&&window.scrollTo(0,0)}else window.scrollTo(0,o)},[l,o,i]))}function fn(e,t){let{capture:r}=t||{};a.useEffect(()=>{let t=null!=r?{capture:r}:void 0;return window.addEventListener("beforeunload",e,t),()=>{window.removeEventListener("beforeunload",e,t)}},[e,r])}function pn(e){let{when:t,message:r}=e,n=Xt(t);a.useEffect(()=>{"blocked"===n.state&&(window.confirm(r)?setTimeout(n.proceed,0):n.reset())},[n,r]),a.useEffect(()=>{"blocked"!==n.state||t||n.reset()},[n,t])}function mn(e,t){void 0===t&&(t={});let r=a.useContext(Ar);null==r&&h(!1);let{basename:n}=Zr(Gr.useViewTransitionState),o=Ct(e,{relative:t.relative});if(!r.isTransitioning)return!1;let i=B(r.currentLocation.pathname,n)||r.currentLocation.pathname,s=B(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=F(o.pathname,s)||null!=F(o.pathname,i)}}}]);
2
+ "use strict";(globalThis.webpackChunk_pucp_gidis_hiisc_esm_fua_app=globalThis.webpackChunk_pucp_gidis_hiisc_esm_fua_app||[]).push([[913],{52913:(e,t,r)=>{r.r(t),r.d(t,{AbortedDeferredError:()=>q,Await:()=>It,BrowserRouter:()=>fr,Form:()=>wr,HashRouter:()=>pr,Link:()=>gr,MemoryRouter:()=>Tt,NavLink:()=>br,Navigate:()=>_t,NavigationType:()=>n,Outlet:()=>Ot,Route:()=>Bt,Router:()=>Nt,RouterProvider:()=>Mt,Routes:()=>Ft,ScrollRestoration:()=>Rr,UNSAFE_DataRouterContext:()=>We,UNSAFE_DataRouterStateContext:()=>He,UNSAFE_LocationContext:()=>qe,UNSAFE_NavigationContext:()=>Ke,UNSAFE_RouteContext:()=>Je,UNSAFE_useRouteId:()=>bt,UNSAFE_useScrollRestoration:()=>Nr,createBrowserRouter:()=>sr,createHashRouter:()=>ur,createMemoryRouter:()=>Yt,createPath:()=>p,createRoutesFromChildren:()=>Kt,createRoutesFromElements:()=>Kt,createSearchParams:()=>er,defer:()=>V,generatePath:()=>j,isRouteErrorResponse:()=>Z,json:()=>K,matchPath:()=>T,matchRoutes:()=>w,parsePath:()=>m,redirect:()=>X,redirectDocument:()=>G,renderMatches:()=>qt,resolvePath:()=>B,unstable_HistoryRouter:()=>mr,unstable_useBlocker:()=>At,unstable_usePrompt:()=>Ir,useActionData:()=>Dt,useAsyncError:()=>kt,useAsyncValue:()=>Pt,useBeforeUnload:()=>Fr,useFetcher:()=>Tr,useFetchers:()=>_r,useFormAction:()=>Mr,useHref:()=>Ve,useInRouterContext:()=>Xe,useLinkClickHandler:()=>Pr,useLoaderData:()=>xt,useLocation:()=>Ge,useMatch:()=>Ze,useMatches:()=>Rt,useNavigate:()=>tt,useNavigation:()=>wt,useNavigationType:()=>Qe,useOutlet:()=>ot,useOutletContext:()=>nt,useParams:()=>at,useResolvedPath:()=>it,useRevalidator:()=>Et,useRouteError:()=>Ct,useRouteLoaderData:()=>St,useRoutes:()=>lt,useSearchParams:()=>kr,useSubmit:()=>Ar});var n,o=r(1343);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(n||(n={}));const i="popstate";function l(e){void 0===e&&(e={});let t,{initialEntries:r=["/"],initialIndex:o,v5Compat:a=!1}=e;t=r.map(((e,t)=>h(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let i=u(null==o?t.length-1:o),l=n.Pop,s=null;function u(e){return Math.min(Math.max(e,0),t.length-1)}function c(){return t[i]}function h(e,r,n){void 0===r&&(r=null);let o=f(t?c().pathname:"/",e,r,n);return d("/"===o.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),o}function v(e){return"string"==typeof e?e:p(e)}return{get index(){return i},get action(){return l},get location(){return c()},createHref:v,createURL:e=>new URL(v(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?m(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,r){l=n.Push;let o=h(e,r);i+=1,t.splice(i,t.length,o),a&&s&&s({action:l,location:o,delta:1})},replace(e,r){l=n.Replace;let o=h(e,r);t[i]=o,a&&s&&s({action:l,location:o,delta:0})},go(e){l=n.Pop;let r=u(i+e),o=t[r];i=r,s&&s({action:l,location:o,delta:e})},listen:e=>(s=e,()=>{s=null})}}function s(e){return void 0===e&&(e={}),v((function(e,t){let{pathname:r,search:n,hash:o}=e.location;return f("",{pathname:r,search:n,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:p(t)}),null,e)}function u(e){return void 0===e&&(e={}),v((function(e,t){let{pathname:r="/",search:n="",hash:o=""}=m(e.location.hash.substr(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),f("",{pathname:r,search:n,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){let t=e.location.href,r=t.indexOf("#");n=-1===r?t:t.slice(0,r)}return n+"#"+("string"==typeof t?t:p(t))}),(function(e,t){d("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)}function c(e,t){if(!1===e||null==e)throw new Error(t)}function d(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function h(e,t){return{usr:e.state,key:e.key,idx:t}}function f(e,t,r,n){return void 0===r&&(r=null),a({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?m(t):t,{state:r,key:t&&t.key||n||Math.random().toString(36).substr(2,8)})}function p(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&"?"!==r&&(t+="?"===r.charAt(0)?r:"?"+r),n&&"#"!==n&&(t+="#"===n.charAt(0)?n:"#"+n),t}function m(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function v(e,t,r,o){void 0===o&&(o={});let{window:l=document.defaultView,v5Compat:s=!1}=o,u=l.history,d=n.Pop,m=null,v=y();function y(){return(u.state||{idx:null}).idx}function g(){d=n.Pop;let e=y(),t=null==e?null:e-v;v=e,m&&m({action:d,location:w.location,delta:t})}function b(e){let t="null"!==l.location.origin?l.location.origin:l.location.href,r="string"==typeof e?e:p(e);return c(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==v&&(v=0,u.replaceState(a({},u.state,{idx:v}),""));let w={get action(){return d},get location(){return e(l,u)},listen(e){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(i,g),m=e,()=>{l.removeEventListener(i,g),m=null}},createHref:e=>t(l,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){d=n.Push;let o=f(w.location,e,t);r&&r(o,e),v=y()+1;let a=h(o,v),i=w.createHref(o);try{u.pushState(a,"",i)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;l.location.assign(i)}s&&m&&m({action:d,location:w.location,delta:1})},replace:function(e,t){d=n.Replace;let o=f(w.location,e,t);r&&r(o,e),v=y();let a=h(o,v),i=w.createHref(o);u.replaceState(a,"",i),s&&m&&m({action:d,location:w.location,delta:0})},go:e=>u.go(e)};return w}var y;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(y||(y={}));const g=new Set(["lazy","caseSensitive","path","id","index","children"]);function b(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n={}),e.map(((e,o)=>{let i=[...r,o],l="string"==typeof e.id?e.id:i.join("-");if(c(!0!==e.index||!e.children,"Cannot specify children on an index route"),c(!n[l],'Found a route id collision on id "'+l+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let r=a({},e,t(e),{id:l});return n[l]=r,r}{let r=a({},e,t(e),{id:l,children:void 0});return n[l]=r,e.children&&(r.children=b(e.children,t,i,n)),r}}))}function w(e,t,r){void 0===r&&(r="/");let n=O(("string"==typeof t?m(t):t).pathname||"/",r);if(null==n)return null;let o=R(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every(((e,r)=>e===t[r]))?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let a=null;for(let e=0;null==a&&e<o.length;++e)a=M(o[e],_(n));return a}function E(e,t){let{route:r,pathname:n,params:o}=e;return{id:r.id,pathname:n,params:o,data:t[r.id],handle:r.handle}}function R(e,t,r,n){void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n="");let o=(e,o,a)=>{let i={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};i.relativePath.startsWith("/")&&(c(i.relativePath.startsWith(n),'Absolute route path "'+i.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(n.length));let l=z([n,i.relativePath]),s=r.concat(i);e.children&&e.children.length>0&&(c(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),R(e.children,t,s,l)),(null!=e.path||e.index)&&t.push({path:l,score:U(l,e.index),routesMeta:s})};return e.forEach(((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let r of x(e.path))o(e,t,r);else o(e,t)})),t}function x(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,o=r.endsWith("?"),a=r.replace(/\?$/,"");if(0===n.length)return o?[a,""]:[a];let i=x(n.join("/")),l=[];return l.push(...i.map((e=>""===e?a:[a,e].join("/")))),o&&l.push(...i),l.map((t=>e.startsWith("/")&&""===t?"/":t))}const S=/^:\w+$/,D=3,C=2,P=1,k=10,L=-2,A=e=>"*"===e;function U(e,t){let r=e.split("/"),n=r.length;return r.some(A)&&(n+=L),t&&(n+=C),r.filter((e=>!A(e))).reduce(((e,t)=>e+(S.test(t)?D:""===t?P:k)),n)}function M(e,t){let{routesMeta:r}=e,n={},o="/",a=[];for(let e=0;e<r.length;++e){let i=r[e],l=e===r.length-1,s="/"===o?t:t.slice(o.length)||"/",u=T({path:i.relativePath,caseSensitive:i.caseSensitive,end:l},s);if(!u)return null;Object.assign(n,u.params);let c=i.route;a.push({params:n,pathname:z([o,u.pathname]),pathnameBase:W(z([o,u.pathnameBase])),route:c}),"/"!==u.pathnameBase&&(o=z([o,u.pathnameBase]))}return a}function j(e,t){void 0===t&&(t={});let r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(d(!1,'Route path "'+r+'" will be treated as if it were "'+r.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+r.replace(/\*$/,"/*")+'".'),r=r.replace(/\*$/,"/*"));const n=r.startsWith("/")?"/":"",o=e=>null==e?"":"string"==typeof e?e:String(e);return n+r.split(/\/+/).map(((e,r,n)=>{if(r===n.length-1&&"*"===e)return o(t["*"]);const a=e.match(/^:(\w+)(\??)$/);if(a){const[,e,r]=a;let n=t[e];return c("?"===r||null!=n,'Missing ":'+e+'" param'),o(n)}return e.replace(/\?$/g,"")})).filter((e=>!!e)).join("/")}function T(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!0),d("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let n=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,((e,t)=>(n.push(t),"/([^\\/]+)")));return e.endsWith("*")?(n.push("*"),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),n]}(e.path,e.caseSensitive,e.end),o=t.match(r);if(!o)return null;let a=o[0],i=a.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:n.reduce(((e,t,r)=>{if("*"===t){let e=l[r]||"";i=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(r){return d(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+r+")."),e}}(l[r]||"",t),e}),{}),pathname:a,pathnameBase:i,pattern:e}}function _(e){try{return decodeURI(e)}catch(t){return d(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function O(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}function B(e,t){void 0===t&&(t="/");let{pathname:r,search:n="",hash:o=""}="string"==typeof e?m(e):e,a=r?r.startsWith("/")?r:function(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)})),r.length>1?r.join("/"):"/"}(r,t):t;return{pathname:a,search:H(n),hash:$(o)}}function N(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function F(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function I(e,t,r,n){let o;void 0===n&&(n=!1),"string"==typeof e?o=m(e):(o=a({},e),c(!o.pathname||!o.pathname.includes("?"),N("?","pathname","search",o)),c(!o.pathname||!o.pathname.includes("#"),N("#","pathname","hash",o)),c(!o.search||!o.search.includes("#"),N("#","search","hash",o)));let i,l=""===e||""===o.pathname,s=l?"/":o.pathname;if(n||null==s)i=r;else{let e=t.length-1;if(s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}i=e>=0?t[e]:"/"}let u=B(o,i),d=s&&"/"!==s&&s.endsWith("/"),h=(l||"."===s)&&r.endsWith("/");return u.pathname.endsWith("/")||!d&&!h||(u.pathname+="/"),u}const z=e=>e.join("/").replace(/\/\/+/g,"/"),W=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),H=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",$=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",K=function(e,t){void 0===t&&(t={});let r="number"==typeof t?{status:t}:t,n=new Headers(r.headers);return n.has("Content-Type")||n.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(e),a({},r,{headers:n}))};class q extends Error{}class J{constructor(e,t){let r;this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],c(e&&"object"==typeof e&&!Array.isArray(e),"defer() only accepts plain objects"),this.abortPromise=new Promise(((e,t)=>r=t)),this.controller=new AbortController;let n=()=>r(new q("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",n),this.controller.signal.addEventListener("abort",n),this.data=Object.entries(e).reduce(((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:this.trackPromise(r,n)})}),{}),this.done&&this.unlistenAbortSignal(),this.init=t}trackPromise(e,t){if(!(t instanceof Promise))return t;this.deferredKeys.push(e),this.pendingKeysSet.add(e);let r=Promise.race([t,this.abortPromise]).then((t=>this.onSettle(r,e,void 0,t)),(t=>this.onSettle(r,e,t)));return r.catch((()=>{})),Object.defineProperty(r,"_tracked",{get:()=>!0}),r}onSettle(e,t,r,n){if(this.controller.signal.aborted&&r instanceof q)return this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:()=>r}),Promise.reject(r);if(this.pendingKeysSet.delete(t),this.done&&this.unlistenAbortSignal(),void 0===r&&void 0===n){let r=new Error('Deferred data for key "'+t+'" resolved/rejected with `undefined`, you must resolve/reject with a value or `null`.');return Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)}return void 0===n?(Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)):(Object.defineProperty(e,"_data",{get:()=>n}),this.emit(!1,t),n)}emit(e,t){this.subscribers.forEach((r=>r(e,t)))}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach(((e,t)=>this.pendingKeysSet.delete(t))),this.emit(!0)}async resolveData(e){let t=!1;if(!this.done){let r=()=>this.cancel();e.addEventListener("abort",r),t=await new Promise((t=>{this.subscribe((n=>{e.removeEventListener("abort",r),(n||this.done)&&t(n)}))}))}return t}get done(){return 0===this.pendingKeysSet.size}get unwrappedData(){return c(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce(((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:Y(n)})}),{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function Y(e){if(!function(e){return e instanceof Promise&&!0===e._tracked}(e))return e;if(e._error)throw e._error;return e._data}const V=function(e,t){return void 0===t&&(t={}),new J(e,"number"==typeof t?{status:t}:t)},X=function(e,t){void 0===t&&(t=302);let r=t;"number"==typeof r?r={status:r}:void 0===r.status&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,a({},r,{headers:n}))},G=(e,t)=>{let r=X(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class Q{constructor(e,t,r,n){void 0===n&&(n=!1),this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Z(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const ee=["post","put","patch","delete"],te=new Set(ee),re=["get",...ee],ne=new Set(re),oe=new Set([301,302,303,307,308]),ae=new Set([307,308]),ie={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},le={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},se={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ue=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ce=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)});function de(e){const t=e.window?e.window:"undefined"!=typeof window?window:void 0,r=void 0!==t&&void 0!==t.document&&void 0!==t.document.createElement,o=!r;let i;if(c(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;i=e=>({hasErrorBoundary:t(e)})}else i=ce;let l,s={},u=b(e.routes,i,void 0,s),h=e.basename||"/",p=a({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),m=null,v=new Set,g=null,R=null,x=null,S=null!=e.hydrationData,D=w(u,e.history.location,h),C=null;if(null==D){let t=Ce(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=De(u);D=r,C={[n.id]:t}}let P,k,L=!(D.some((e=>e.route.lazy))||D.some((e=>e.route.loader))&&null==e.hydrationData),A={historyAction:e.history.action,location:e.history.location,matches:D,initialized:L,navigation:ie,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||C,fetchers:new Map,blockers:new Map},U=n.Pop,M=!1,j=!1,T=!1,_=[],B=[],N=new Map,F=0,I=-1,z=new Map,W=new Set,H=new Map,$=new Map,K=new Map,q=!1;function J(e){A=a({},A,e),v.forEach((e=>e(A)))}function Y(t,r){var o,i;let s,c=null!=A.actionData&&null!=A.navigation.formMethod&&Me(A.navigation.formMethod)&&"loading"===A.navigation.state&&!0!==(null==(o=t.state)?void 0:o._isRedirect);s=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:c?A.actionData:null;let d=r.loaderData?xe(A.loaderData,r.loaderData,r.matches||[],r.errors):A.loaderData,h=A.blockers;h.size>0&&(h=new Map(h),h.forEach(((e,t)=>h.set(t,se))));let f=!0===M||null!=A.navigation.formMethod&&Me(A.navigation.formMethod)&&!0!==(null==(i=t.state)?void 0:i._isRedirect);l&&(u=l,l=void 0),j||U===n.Pop||(U===n.Push?e.history.push(t,t.state):U===n.Replace&&e.history.replace(t,t.state)),J(a({},r,{actionData:s,loaderData:d,historyAction:U,location:t,initialized:!0,navigation:ie,revalidation:"idle",restoreScrollPosition:ke(t,r.matches||A.matches),preventScrollReset:f,blockers:h})),U=n.Pop,M=!1,j=!1,T=!1,_=[],B=[]}async function V(t,r,o){k&&k.abort(),k=null,U=t,j=!0===(o&&o.startUninterruptedRevalidation),function(e,t){if(g&&x){let r=Ee(e,t);g[r]=x()}}(A.location,A.matches),M=!0===(o&&o.preventScrollReset);let c=l||u,d=o&&o.overrideNavigation,f=w(c,r,h);if(!f){let e=Ce(404,{pathname:r.pathname}),{matches:t,route:n}=De(c);return we(),void Y(r,{matches:t,loaderData:{},errors:{[n.id]:e}})}if(A.initialized&&!T&&(p=A.location,m=r,p.pathname===m.pathname&&p.search===m.search&&(""===p.hash?""!==m.hash:p.hash===m.hash||""!==m.hash))&&!(o&&o.submission&&Me(o.submission.formMethod)))return void Y(r,{matches:f});var p,m;k=new AbortController;let v,b,E=be(e.history,r,k.signal,o&&o.submission);if(o&&o.pendingError)b={[Se(f).route.id]:o.pendingError};else if(o&&o.submission&&Me(o.submission.formMethod)){let e=await async function(e,t,r,o,a){void 0===a&&(a={}),Z();let l,u=function(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}(t,r);J({navigation:u});let c=Oe(o,t);if(c.route.action||c.route.lazy){if(l=await ge("action",e,c,o,s,i,h),e.signal.aborted)return{shortCircuited:!0}}else l={type:y.error,error:Ce(405,{method:e.method,pathname:t.pathname,routeId:c.route.id})};if(Ue(l)){let e;return e=a&&null!=a.replace?a.replace:l.location===A.location.pathname+A.location.search,await G(A,l,{submission:r,replace:e}),{shortCircuited:!0}}if(Ae(l)){let e=Se(o,c.route.id);return!0!==(a&&a.replace)&&(U=n.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:l.error}}}if(Le(l))throw Ce(400,{type:"defer-action"});return{pendingActionData:{[c.route.id]:l.data}}}(E,r,o.submission,f,{replace:o.replace});if(e.shortCircuited)return;v=e.pendingActionData,b=e.pendingActionError,d=Ne(r,o.submission),E=new Request(E.url,{signal:E.signal})}let{shortCircuited:R,loaderData:S,errors:D}=await async function(t,r,n,o,i,s,c,d,f){let p=o||Ne(r,i),m=i||s||Be(p),v=l||u,[y,g]=pe(e.history,A,n,m,r,T,_,B,H,W,v,h,d,f);if(we((e=>!(n&&n.some((t=>t.route.id===e)))||y&&y.some((t=>t.route.id===e)))),I=++F,0===y.length&&0===g.length){let e=oe();return Y(r,a({matches:n,loaderData:{},errors:f||null},d?{actionData:d}:{},e?{fetchers:new Map(A.fetchers)}:{})),{shortCircuited:!0}}if(!j){g.forEach((e=>{let t=A.fetchers.get(e.key),r=Fe(void 0,t?t.data:void 0);A.fetchers.set(e.key,r)}));let e=d||A.actionData;J(a({navigation:p},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},g.length>0?{fetchers:new Map(A.fetchers)}:{}))}g.forEach((e=>{N.has(e.key)&&re(e.key),e.controller&&N.set(e.key,e.controller)}));let b=()=>g.forEach((e=>re(e.key)));k&&k.signal.addEventListener("abort",b);let{results:w,loaderResults:E,fetcherResults:R}=await Q(A.matches,n,y,g,t);if(t.signal.aborted)return{shortCircuited:!0};k&&k.signal.removeEventListener("abort",b),g.forEach((e=>N.delete(e.key)));let x=Pe(w);if(x){if(x.idx>=y.length){let e=g[x.idx-y.length].key;W.add(e)}return await G(A,x.result,{replace:c}),{shortCircuited:!0}}let{loaderData:S,errors:D}=Re(A,n,y,E,f,g,R,$);$.forEach(((e,t)=>{e.subscribe((r=>{(r||e.done)&&$.delete(t)}))}));let C=oe(),P=de(I);return a({loaderData:S,errors:D},C||P||g.length>0?{fetchers:new Map(A.fetchers)}:{})}(E,r,f,d,o&&o.submission,o&&o.fetcherSubmission,o&&o.replace,v,b);R||(k=null,Y(r,a({matches:f},v?{actionData:v}:{},{loaderData:S,errors:D})))}function X(e){return A.fetchers.get(e)||le}async function G(o,i,l){let{submission:s,fetcherSubmission:u,replace:d}=void 0===l?{}:l;i.revalidate&&(T=!0);let p=f(o.location,i.location,{_isRedirect:!0});if(c(p,"Expected a location on the redirect navigation"),r){let r=!1;if(i.reloadDocument)r=!0;else if(ue.test(i.location)){const n=e.history.createURL(i.location);r=n.origin!==t.location.origin||null==O(n.pathname,h)}if(r)return void(d?t.location.replace(i.location):t.location.assign(i.location))}k=null;let m=!0===d?n.Replace:n.Push,{formMethod:v,formAction:y,formEncType:g}=o.navigation;!s&&!u&&v&&y&&g&&(s=Be(o.navigation));let b=s||u;if(ae.has(i.status)&&b&&Me(b.formMethod))await V(m,p,{submission:a({},b,{formAction:i.location}),preventScrollReset:M});else{let e=Ne(p,s);await V(m,p,{overrideNavigation:e,fetcherSubmission:u,preventScrollReset:M})}}async function Q(t,r,n,o,a){let l=await Promise.all([...n.map((e=>ge("loader",a,e,r,s,i,h))),...o.map((t=>t.matches&&t.match&&t.controller?ge("loader",be(e.history,t.path,t.controller.signal),t.match,t.matches,s,i,h):{type:y.error,error:Ce(404,{pathname:t.path})}))]),u=l.slice(0,n.length),c=l.slice(n.length);return await Promise.all([je(t,n,u,u.map((()=>a.signal)),!1,A.loaderData),je(t,o.map((e=>e.match)),c,o.map((e=>e.controller?e.controller.signal:null)),!0)]),{results:l,loaderResults:u,fetcherResults:c}}function Z(){T=!0,_.push(...we()),H.forEach(((e,t)=>{N.has(t)&&(B.push(t),re(t))}))}function ee(e,t,r){let n=Se(A.matches,t);te(e),J({errors:{[n.route.id]:r},fetchers:new Map(A.fetchers)})}function te(e){let t=A.fetchers.get(e);!N.has(e)||t&&"loading"===t.state&&z.has(e)||re(e),H.delete(e),z.delete(e),W.delete(e),A.fetchers.delete(e)}function re(e){let t=N.get(e);c(t,"Expected fetch controller: "+e),t.abort(),N.delete(e)}function ne(e){for(let t of e){let e=Ie(X(t).data);A.fetchers.set(t,e)}}function oe(){let e=[],t=!1;for(let r of W){let n=A.fetchers.get(r);c(n,"Expected fetcher: "+r),"loading"===n.state&&(W.delete(r),e.push(r),t=!0)}return ne(e),t}function de(e){let t=[];for(let[r,n]of z)if(n<e){let e=A.fetchers.get(r);c(e,"Expected fetcher: "+r),"loading"===e.state&&(re(r),z.delete(r),t.push(r))}return ne(t),t.length>0}function me(e){A.blockers.delete(e),K.delete(e)}function ve(e,t){let r=A.blockers.get(e)||se;c("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,"Invalid blocker state transition: "+r.state+" -> "+t.state);let n=new Map(A.blockers);n.set(e,t),J({blockers:n})}function ye(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===K.size)return;K.size>1&&d(!1,"A router only supports one blocker at a time");let o=Array.from(K.entries()),[a,i]=o[o.length-1],l=A.blockers.get(a);return l&&"proceeding"===l.state?void 0:i({currentLocation:t,nextLocation:r,historyAction:n})?a:void 0}function we(e){let t=[];return $.forEach(((r,n)=>{e&&!e(n)||(r.cancel(),t.push(n),$.delete(n))})),t}function Ee(e,t){return R&&R(e,t.map((e=>E(e,A.loaderData))))||e.key}function ke(e,t){if(g){let r=Ee(e,t),n=g[r];if("number"==typeof n)return n}return null}return P={get basename(){return h},get state(){return A},get routes(){return u},initialize:function(){return m=e.history.listen((t=>{let{action:r,location:n,delta:o}=t;if(q)return void(q=!1);d(0===K.size||null!=o,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let a=ye({currentLocation:A.location,nextLocation:n,historyAction:r});return a&&null!=o?(q=!0,e.history.go(-1*o),void ve(a,{state:"blocked",location:n,proceed(){ve(a,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(o)},reset(){let e=new Map(A.blockers);e.set(a,se),J({blockers:e})}})):V(r,n)})),A.initialized||V(n.Pop,A.location),P},subscribe:function(e){return v.add(e),()=>v.delete(e)},enableScrollRestoration:function(e,t,r){if(g=e,x=t,R=r||null,!S&&A.navigation===ie){S=!0;let e=ke(A.location,A.matches);null!=e&&J({restoreScrollPosition:e})}return()=>{g=null,x=null,R=null}},navigate:async function t(r,o){if("number"==typeof r)return void e.history.go(r);let i=he(A.location,A.matches,h,p.v7_prependBasename,r,null==o?void 0:o.fromRouteId,null==o?void 0:o.relative),{path:l,submission:s,error:u}=fe(p.v7_normalizeFormMethod,!1,i,o),c=A.location,d=f(A.location,l,o&&o.state);d=a({},d,e.history.encodeLocation(d));let m=o&&null!=o.replace?o.replace:void 0,v=n.Push;!0===m?v=n.Replace:!1===m||null!=s&&Me(s.formMethod)&&s.formAction===A.location.pathname+A.location.search&&(v=n.Replace);let y=o&&"preventScrollReset"in o?!0===o.preventScrollReset:void 0,g=ye({currentLocation:c,nextLocation:d,historyAction:v});if(!g)return await V(v,d,{submission:s,pendingError:u,preventScrollReset:y,replace:o&&o.replace});ve(g,{state:"blocked",location:d,proceed(){ve(g,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),t(r,o)},reset(){let e=new Map(A.blockers);e.set(g,se),J({blockers:e})}})},fetch:function(t,r,n,d){if(o)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");N.has(t)&&re(t);let f=l||u,m=he(A.location,A.matches,h,p.v7_prependBasename,n,r,null==d?void 0:d.relative),v=w(f,m,h);if(!v)return void ee(t,r,Ce(404,{pathname:m}));let{path:y,submission:g,error:b}=fe(p.v7_normalizeFormMethod,!0,m,d);if(b)return void ee(t,r,b);let E=Oe(v,y);M=!0===(d&&d.preventScrollReset),g&&Me(g.formMethod)?async function(t,r,n,o,d,f){if(Z(),H.delete(t),!o.route.action&&!o.route.lazy){let e=Ce(405,{method:f.formMethod,pathname:n,routeId:r});return void ee(t,r,e)}let p=function(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}(f,A.fetchers.get(t));A.fetchers.set(t,p),J({fetchers:new Map(A.fetchers)});let m=new AbortController,v=be(e.history,n,m.signal,f);N.set(t,m);let y=F,g=await ge("action",v,o,d,s,i,h);if(v.signal.aborted)return void(N.get(t)===m&&N.delete(t));if(Ue(g)){if(N.delete(t),I>y){let e=Ie(void 0);return A.fetchers.set(t,e),void J({fetchers:new Map(A.fetchers)})}{W.add(t);let e=Fe(f);return A.fetchers.set(t,e),J({fetchers:new Map(A.fetchers)}),G(A,g,{fetcherSubmission:f})}}if(Ae(g))return void ee(t,r,g.error);if(Le(g))throw Ce(400,{type:"defer-action"});let b=A.navigation.location||A.location,E=be(e.history,b,m.signal),R=l||u,x="idle"!==A.navigation.state?w(R,A.navigation.location,h):A.matches;c(x,"Didn't find any matches after fetcher action");let S=++F;z.set(t,S);let D=Fe(f,g.data);A.fetchers.set(t,D);let[C,P]=pe(e.history,A,x,f,b,T,_,B,H,W,R,h,{[o.route.id]:g.data},void 0);P.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,r=A.fetchers.get(t),n=Fe(void 0,r?r.data:void 0);A.fetchers.set(t,n),N.has(t)&&re(t),e.controller&&N.set(t,e.controller)})),J({fetchers:new Map(A.fetchers)});let L=()=>P.forEach((e=>re(e.key)));m.signal.addEventListener("abort",L);let{results:M,loaderResults:j,fetcherResults:O}=await Q(A.matches,x,C,P,E);if(m.signal.aborted)return;m.signal.removeEventListener("abort",L),z.delete(t),N.delete(t),P.forEach((e=>N.delete(e.key)));let K=Pe(M);if(K){if(K.idx>=C.length){let e=P[K.idx-C.length].key;W.add(e)}return G(A,K.result)}let{loaderData:q,errors:V}=Re(A,A.matches,C,j,void 0,P,O,$);if(A.fetchers.has(t)){let e=Ie(g.data);A.fetchers.set(t,e)}let X=de(S);"loading"===A.navigation.state&&S>I?(c(U,"Expected pending action"),k&&k.abort(),Y(A.navigation.location,{matches:x,loaderData:q,errors:V,fetchers:new Map(A.fetchers)})):(J(a({errors:V,loaderData:xe(A.loaderData,q,x,V)},X||P.length>0?{fetchers:new Map(A.fetchers)}:{})),T=!1)}(t,r,y,E,v,g):(H.set(t,{routeId:r,path:y}),async function(t,r,n,o,a,l){let u=A.fetchers.get(t),d=Fe(l,u?u.data:void 0);A.fetchers.set(t,d),J({fetchers:new Map(A.fetchers)});let f=new AbortController,p=be(e.history,n,f.signal);N.set(t,f);let m=F,v=await ge("loader",p,o,a,s,i,h);if(Le(v)&&(v=await Te(v,p.signal,!0)||v),N.get(t)===f&&N.delete(t),p.signal.aborted)return;if(Ue(v)){if(I>m){let e=Ie(void 0);return A.fetchers.set(t,e),void J({fetchers:new Map(A.fetchers)})}return W.add(t),void await G(A,v)}if(Ae(v)){let e=Se(A.matches,r);return A.fetchers.delete(t),void J({fetchers:new Map(A.fetchers),errors:{[e.route.id]:v.error}})}c(!Le(v),"Unhandled fetcher deferred data");let y=Ie(v.data);A.fetchers.set(t,y),J({fetchers:new Map(A.fetchers)})}(t,r,y,E,v,g))},revalidate:function(){Z(),J({revalidation:"loading"}),"submitting"!==A.navigation.state&&("idle"!==A.navigation.state?V(U||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation}):V(A.historyAction,A.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:X,deleteFetcher:te,dispose:function(){m&&m(),v.clear(),k&&k.abort(),A.fetchers.forEach(((e,t)=>te(t))),A.blockers.forEach(((e,t)=>me(t)))},getBlocker:function(e,t){let r=A.blockers.get(e)||se;return K.get(e)!==t&&K.set(e,t),r},deleteBlocker:me,_internalFetchControllers:N,_internalActiveDeferreds:$,_internalSetRoutes:function(e){s={},l=b(e,i,void 0,s)}},P}function he(e,t,r,n,o,a,i){let l,s;if(null!=a&&"path"!==i){l=[];for(let e of t)if(l.push(e),e.route.id===a){s=e;break}}else l=t,s=t[t.length-1];let u=I(o||".",F(l).map((e=>e.pathnameBase)),O(e.pathname,r)||e.pathname,"path"===i);return null==o&&(u.search=e.search,u.hash=e.hash),null!=o&&""!==o&&"."!==o||!s||!s.route.index||_e(u.search)||(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(u.pathname="/"===u.pathname?r:z([r,u.pathname])),p(u)}function fe(e,t,r,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:r};if(n.formMethod&&(o=n.formMethod,!ne.has(o.toLowerCase())))return{path:r,error:Ce(405,{method:n.formMethod})};var o;let a,i,l=()=>({path:r,error:Ce(400,{type:"invalid-body"})}),s=n.formMethod||"get",u=e?s.toUpperCase():s.toLowerCase(),d=ke(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!Me(u))return l();let e="string"==typeof n.body?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce(((e,t)=>{let[r,n]=t;return""+e+r+"="+n+"\n"}),""):String(n.body);return{path:r,submission:{formMethod:u,formAction:d,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===n.formEncType){if(!Me(u))return l();try{let e="string"==typeof n.body?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:u,formAction:d,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return l()}}}if(c("function"==typeof FormData,"FormData is not available in this environment"),n.formData)a=we(n.formData),i=n.formData;else if(n.body instanceof FormData)a=we(n.body),i=n.body;else if(n.body instanceof URLSearchParams)a=n.body,i=Ee(a);else if(null==n.body)a=new URLSearchParams,i=new FormData;else try{a=new URLSearchParams(n.body),i=Ee(a)}catch(e){return l()}let h={formMethod:u,formAction:d,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(Me(h.formMethod))return{path:r,submission:h};let f=m(r);return t&&f.search&&_e(f.search)&&a.append("index",""),f.search="?"+a,{path:p(f),submission:h}}function pe(e,t,r,n,o,i,l,s,u,c,d,h,f,p){let m=p?Object.values(p)[0]:f?Object.values(f)[0]:void 0,v=e.createURL(t.location),y=e.createURL(o),g=p?Object.keys(p)[0]:void 0,b=function(e,t){let r=e;if(t){let n=e.findIndex((e=>e.route.id===t));n>=0&&(r=e.slice(0,n))}return r}(r,g).filter(((e,r)=>{if(e.route.lazy)return!0;if(null==e.route.loader)return!1;if(function(e,t,r){let n=!t||r.route.id!==t.route.id,o=void 0===e[r.route.id];return n||o}(t.loaderData,t.matches[r],e)||l.some((t=>t===e.route.id)))return!0;let o=t.matches[r],s=e;return ve(e,a({currentUrl:v,currentParams:o.params,nextUrl:y,nextParams:s.params},n,{actionResult:m,defaultShouldRevalidate:i||v.pathname+v.search===y.pathname+y.search||v.search!==y.search||me(o,s)}))})),E=[];return u.forEach(((e,o)=>{if(!r.some((t=>t.route.id===e.routeId)))return;let l=w(d,e.path,h);if(!l)return void E.push({key:o,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let u=t.fetchers.get(o),f=Oe(l,e.path),p=!1;p=!c.has(o)&&(!!s.includes(o)||(u&&"idle"!==u.state&&void 0===u.data?i:ve(f,a({currentUrl:v,currentParams:t.matches[t.matches.length-1].params,nextUrl:y,nextParams:r[r.length-1].params},n,{actionResult:m,defaultShouldRevalidate:i})))),p&&E.push({key:o,routeId:e.routeId,path:e.path,matches:l,match:f,controller:new AbortController})})),[b,E]}function me(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function ve(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}async function ye(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let o=r[e.id];c(o,"No route found in manifest");let i={};for(let e in n){let t=void 0!==o[e]&&"hasErrorBoundary"!==e;d(!t,'Route "'+o.id+'" has a static property "'+e+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+e+'" will be ignored.'),t||g.has(e)||(i[e]=n[e])}Object.assign(o,i),Object.assign(o,a({},t(o),{lazy:void 0}))}async function ge(e,t,r,n,o,a,i,l){let s,u,d;void 0===l&&(l={});let h=e=>{let n,o=new Promise(((e,t)=>n=t));return d=()=>n(),t.signal.addEventListener("abort",d),Promise.race([e({request:t,params:r.params,context:l.requestContext}),o])};try{let n=r.route[e];if(r.route.lazy)if(n){let e,t=await Promise.all([h(n).catch((t=>{e=t})),ye(r.route,a,o)]);if(e)throw e;u=t[0]}else{if(await ye(r.route,a,o),n=r.route[e],!n){if("action"===e){let e=new URL(t.url),n=e.pathname+e.search;throw Ce(405,{method:t.method,pathname:n,routeId:r.route.id})}return{type:y.data,data:void 0}}u=await h(n)}else{if(!n){let e=new URL(t.url);throw Ce(404,{pathname:e.pathname+e.search})}u=await h(n)}c(void 0!==u,"You defined "+("action"===e?"an action":"a loader")+' for route "'+r.route.id+"\" but didn't return anything from your `"+e+"` function. Please return a value or `null`.")}catch(e){s=y.error,u=e}finally{d&&t.signal.removeEventListener("abort",d)}if(null!=(f=u)&&"number"==typeof f.status&&"string"==typeof f.statusText&&"object"==typeof f.headers&&void 0!==f.body){let e,o=u.status;if(oe.has(o)){let e=u.headers.get("Location");if(c(e,"Redirects returned/thrown from loaders/actions must have a Location header"),ue.test(e)){if(!l.isStaticRequest){let r=new URL(t.url),n=e.startsWith("//")?new URL(r.protocol+e):new URL(e),o=null!=O(n.pathname,i);n.origin===r.origin&&o&&(e=n.pathname+n.search+n.hash)}}else e=he(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,e);if(l.isStaticRequest)throw u.headers.set("Location",e),u;return{type:y.redirect,status:o,location:e,revalidate:null!==u.headers.get("X-Remix-Revalidate"),reloadDocument:null!==u.headers.get("X-Remix-Reload-Document")}}if(l.isRouteRequest)throw{type:s===y.error?y.error:y.data,response:u};let a=u.headers.get("Content-Type");return e=a&&/\bapplication\/json\b/.test(a)?await u.json():await u.text(),s===y.error?{type:s,error:new Q(o,u.statusText,e),headers:u.headers}:{type:y.data,data:e,statusCode:u.status,headers:u.headers}}var f,p,m;return s===y.error?{type:s,error:u}:function(e){let t=e;return t&&"object"==typeof t&&"object"==typeof t.data&&"function"==typeof t.subscribe&&"function"==typeof t.cancel&&"function"==typeof t.resolveData}(u)?{type:y.deferred,deferredData:u,statusCode:null==(p=u.init)?void 0:p.status,headers:(null==(m=u.init)?void 0:m.headers)&&new Headers(u.init.headers)}:{type:y.data,data:u}}function be(e,t,r,n){let o=e.createURL(ke(t)).toString(),a={signal:r};if(n&&Me(n.formMethod)){let{formMethod:e,formEncType:t}=n;a.method=e.toUpperCase(),"application/json"===t?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(n.json)):"text/plain"===t?a.body=n.text:"application/x-www-form-urlencoded"===t&&n.formData?a.body=we(n.formData):a.body=n.formData}return new Request(o,a)}function we(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function Ee(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Re(e,t,r,n,o,i,l,s){let{loaderData:u,errors:d}=function(e,t,r,n,o){let a,i={},l=null,s=!1,u={};return r.forEach(((r,d)=>{let h=t[d].route.id;if(c(!Ue(r),"Cannot handle redirect results in processLoaderData"),Ae(r)){let t=Se(e,h),o=r.error;n&&(o=Object.values(n)[0],n=void 0),l=l||{},null==l[t.route.id]&&(l[t.route.id]=o),i[h]=void 0,s||(s=!0,a=Z(r.error)?r.error.status:500),r.headers&&(u[h]=r.headers)}else Le(r)?(o.set(h,r.deferredData),i[h]=r.deferredData.data):i[h]=r.data,null==r.statusCode||200===r.statusCode||s||(a=r.statusCode),r.headers&&(u[h]=r.headers)})),n&&(l=n,i[Object.keys(n)[0]]=void 0),{loaderData:i,errors:l,statusCode:a||200,loaderHeaders:u}}(t,r,n,o,s);for(let t=0;t<i.length;t++){let{key:r,match:n,controller:o}=i[t];c(void 0!==l&&void 0!==l[t],"Did not find corresponding fetcher result");let s=l[t];if(!o||!o.signal.aborted)if(Ae(s)){let t=Se(e.matches,null==n?void 0:n.route.id);d&&d[t.route.id]||(d=a({},d,{[t.route.id]:s.error})),e.fetchers.delete(r)}else if(Ue(s))c(!1,"Unhandled fetcher revalidation redirect");else if(Le(s))c(!1,"Unhandled fetcher deferred data");else{let t=Ie(s.data);e.fetchers.set(r,t)}}return{loaderData:u,errors:d}}function xe(e,t,r,n){let o=a({},t);for(let a of r){let r=a.route.id;if(t.hasOwnProperty(r)?void 0!==t[r]&&(o[r]=t[r]):void 0!==e[r]&&a.route.loader&&(o[r]=e[r]),n&&n.hasOwnProperty(r))break}return o}function Se(e,t){return(t?e.slice(0,e.findIndex((e=>e.route.id===t))+1):[...e]).reverse().find((e=>!0===e.route.hasErrorBoundary))||e[0]}function De(e){let t=e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Ce(e,t){let{pathname:r,routeId:n,method:o,type:a}=void 0===t?{}:t,i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",o&&r&&n?l="You made a "+o+' request to "'+r+'" but did not provide a `loader` for route "'+n+'", so there is no way to handle the request.':"defer-action"===a?l="defer() is not supported in actions":"invalid-body"===a&&(l="Unable to encode submission body")):403===e?(i="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):404===e?(i="Not Found",l='No route matches URL "'+r+'"'):405===e&&(i="Method Not Allowed",o&&r&&n?l="You made a "+o.toUpperCase()+' request to "'+r+'" but did not provide an `action` for route "'+n+'", so there is no way to handle the request.':o&&(l='Invalid request method "'+o.toUpperCase()+'"')),new Q(e||500,i,new Error(l),!0)}function Pe(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(Ue(r))return{result:r,idx:t}}}function ke(e){return p(a({},"string"==typeof e?m(e):e,{hash:""}))}function Le(e){return e.type===y.deferred}function Ae(e){return e.type===y.error}function Ue(e){return(e&&e.type)===y.redirect}function Me(e){return te.has(e.toLowerCase())}async function je(e,t,r,n,o,a){for(let i=0;i<r.length;i++){let l=r[i],s=t[i];if(!s)continue;let u=e.find((e=>e.route.id===s.route.id)),d=null!=u&&!me(u,s)&&void 0!==(a&&a[s.route.id]);if(Le(l)&&(o||d)){let e=n[i];c(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await Te(l,e,o).then((e=>{e&&(r[i]=e||r[i])}))}}}async function Te(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:y.data,data:e.deferredData.unwrappedData}}catch(e){return{type:y.error,error:e}}return{type:y.data,data:e.deferredData.data}}}function _e(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Oe(e,t){let r="string"==typeof t?m(t).search:t.search;if(e[e.length-1].route.index&&_e(r||""))return e[e.length-1];let n=F(e);return n[n.length-1]}function Be(e){let{formMethod:t,formAction:r,formEncType:n,text:o,formData:a,json:i}=e;if(t&&r&&n)return null!=o?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:o}:null!=a?{formMethod:t,formAction:r,formEncType:n,formData:a,json:void 0,text:void 0}:void 0!==i?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}:void 0}function Ne(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Fe(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Ie(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function ze(){return ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ze.apply(this,arguments)}Symbol("deferred");const We=o.createContext(null),He=o.createContext(null),$e=o.createContext(null),Ke=o.createContext(null),qe=o.createContext(null),Je=o.createContext({outlet:null,matches:[],isDataRoute:!1}),Ye=o.createContext(null);function Ve(e,t){let{relative:r}=void 0===t?{}:t;Xe()||c(!1);let{basename:n,navigator:a}=o.useContext(Ke),{hash:i,pathname:l,search:s}=it(e,{relative:r}),u=l;return"/"!==n&&(u="/"===l?n:z([n,l])),a.createHref({pathname:u,search:s,hash:i})}function Xe(){return null!=o.useContext(qe)}function Ge(){return Xe()||c(!1),o.useContext(qe).location}function Qe(){return o.useContext(qe).navigationType}function Ze(e){Xe()||c(!1);let{pathname:t}=Ge();return o.useMemo((()=>T(e,t)),[t,e])}function et(e){o.useContext(Ke).static||o.useLayoutEffect(e)}function tt(){let{isDataRoute:e}=o.useContext(Je);return e?function(){let{router:e}=vt(pt.UseNavigateStable),t=gt(mt.UseNavigateStable),r=o.useRef(!1);return et((()=>{r.current=!0})),o.useCallback((function(n,o){void 0===o&&(o={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,ze({fromRouteId:t},o)))}),[e,t])}():function(){Xe()||c(!1);let e=o.useContext(We),{basename:t,navigator:r}=o.useContext(Ke),{matches:n}=o.useContext(Je),{pathname:a}=Ge(),i=JSON.stringify(F(n).map((e=>e.pathnameBase))),l=o.useRef(!1);return et((()=>{l.current=!0})),o.useCallback((function(n,o){if(void 0===o&&(o={}),!l.current)return;if("number"==typeof n)return void r.go(n);let s=I(n,JSON.parse(i),a,"path"===o.relative);null==e&&"/"!==t&&(s.pathname="/"===s.pathname?t:z([t,s.pathname])),(o.replace?r.replace:r.push)(s,o.state,o)}),[t,r,i,a,e])}()}const rt=o.createContext(null);function nt(){return o.useContext(rt)}function ot(e){let t=o.useContext(Je).outlet;return t?o.createElement(rt.Provider,{value:e},t):t}function at(){let{matches:e}=o.useContext(Je),t=e[e.length-1];return t?t.params:{}}function it(e,t){let{relative:r}=void 0===t?{}:t,{matches:n}=o.useContext(Je),{pathname:a}=Ge(),i=JSON.stringify(F(n).map((e=>e.pathnameBase)));return o.useMemo((()=>I(e,JSON.parse(i),a,"path"===r)),[e,i,a,r])}function lt(e,t){return st(e,t)}function st(e,t,r){Xe()||c(!1);let{navigator:a}=o.useContext(Ke),{matches:i}=o.useContext(Je),l=i[i.length-1],s=l?l.params:{},u=(l&&l.pathname,l?l.pathnameBase:"/");l&&l.route;let d,h=Ge();if(t){var f;let e="string"==typeof t?m(t):t;"/"===u||(null==(f=e.pathname)?void 0:f.startsWith(u))||c(!1),d=e}else d=h;let p=d.pathname||"/",v=w(e,{pathname:"/"===u?p:p.slice(u.length)||"/"}),y=ft(v&&v.map((e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:z([u,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?u:z([u,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),i,r);return t&&y?o.createElement(qe.Provider,{value:{location:ze({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:n.Pop}},y):y}function ut(){let e=Ct(),t=Z(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return o.createElement(o.Fragment,null,o.createElement("h2",null,"Unexpected Application Error!"),o.createElement("h3",{style:{fontStyle:"italic"}},t),r?o.createElement("pre",{style:n},r):null,null)}const ct=o.createElement(ut,null);class dt extends o.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error||t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?o.createElement(Je.Provider,{value:this.props.routeContext},o.createElement(Ye.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ht(e){let{routeContext:t,match:r,children:n}=e,a=o.useContext(We);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),o.createElement(Je.Provider,{value:t},n)}function ft(e,t,r){var n;if(void 0===t&&(t=[]),void 0===r&&(r=null),null==e){var a;if(null==(a=r)||!a.errors)return null;e=r.matches}let i=e,l=null==(n=r)?void 0:n.errors;if(null!=l){let e=i.findIndex((e=>e.route.id&&(null==l?void 0:l[e.route.id])));e>=0||c(!1),i=i.slice(0,Math.min(i.length,e+1))}return i.reduceRight(((e,n,a)=>{let s=n.route.id?null==l?void 0:l[n.route.id]:null,u=null;r&&(u=n.route.errorElement||ct);let c=t.concat(i.slice(0,a+1)),d=()=>{let t;return t=s?u:n.route.Component?o.createElement(n.route.Component,null):n.route.element?n.route.element:e,o.createElement(ht,{match:n,routeContext:{outlet:e,matches:c,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===a)?o.createElement(dt,{location:r.location,revalidation:r.revalidation,component:u,error:s,children:d(),routeContext:{outlet:null,matches:c,isDataRoute:!0}}):d()}),null)}var pt=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(pt||{}),mt=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(mt||{});function vt(e){let t=o.useContext(We);return t||c(!1),t}function yt(e){let t=o.useContext(He);return t||c(!1),t}function gt(e){let t=function(){let e=o.useContext(Je);return e||c(!1),e}(),r=t.matches[t.matches.length-1];return r.route.id||c(!1),r.route.id}function bt(){return gt(mt.UseRouteId)}function wt(){return yt(mt.UseNavigation).navigation}function Et(){let e=vt(pt.UseRevalidator),t=yt(mt.UseRevalidator);return o.useMemo((()=>({revalidate:e.router.revalidate,state:t.revalidation})),[e.router.revalidate,t.revalidation])}function Rt(){let{matches:e,loaderData:t}=yt(mt.UseMatches);return o.useMemo((()=>e.map((e=>E(e,t)))),[e,t])}function xt(){let e=yt(mt.UseLoaderData),t=gt(mt.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")}function St(e){return yt(mt.UseRouteLoaderData).loaderData[e]}function Dt(){let e=yt(mt.UseActionData);return o.useContext(Je)||c(!1),Object.values((null==e?void 0:e.actionData)||{})[0]}function Ct(){var e;let t=o.useContext(Ye),r=yt(mt.UseRouteError),n=gt(mt.UseRouteError);return t||(null==(e=r.errors)?void 0:e[n])}function Pt(){let e=o.useContext($e);return null==e?void 0:e._data}function kt(){let e=o.useContext($e);return null==e?void 0:e._error}let Lt=0;function At(e){let{router:t,basename:r}=vt(pt.UseBlocker),n=yt(mt.UseBlocker),[a,i]=o.useState(""),l=o.useCallback((t=>{if("function"!=typeof e)return!!e;if("/"===r)return e(t);let{currentLocation:n,nextLocation:o,historyAction:a}=t;return e({currentLocation:ze({},n,{pathname:O(n.pathname,r)||n.pathname}),nextLocation:ze({},o,{pathname:O(o.pathname,r)||o.pathname}),historyAction:a})}),[r,e]);return o.useEffect((()=>{let e=String(++Lt);return i(e),()=>t.deleteBlocker(e)}),[t]),o.useEffect((()=>{""!==a&&t.getBlocker(a,l)}),[t,a,l]),a&&n.blockers.has(a)?n.blockers.get(a):se}const Ut=o.startTransition;function Mt(e){let{fallbackElement:t,router:r,future:n}=e,[a,i]=o.useState(r.state),{v7_startTransition:l}=n||{},s=o.useCallback((e=>{l&&Ut?Ut((()=>i(e))):i(e)}),[i,l]);o.useLayoutEffect((()=>r.subscribe(s)),[r,s]);let u=o.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})})),[r]),c=r.basename||"/",d=o.useMemo((()=>({router:r,navigator:u,static:!1,basename:c})),[r,u,c]);return o.createElement(o.Fragment,null,o.createElement(We.Provider,{value:d},o.createElement(He.Provider,{value:a},o.createElement(Nt,{basename:c,location:a.location,navigationType:a.historyAction,navigator:u},a.initialized?o.createElement(jt,{routes:r.routes,state:a}):t))),null)}function jt(e){let{routes:t,state:r}=e;return st(t,void 0,r)}function Tt(e){let{basename:t,children:r,initialEntries:n,initialIndex:a,future:i}=e,s=o.useRef();null==s.current&&(s.current=l({initialEntries:n,initialIndex:a,v5Compat:!0}));let u=s.current,[c,d]=o.useState({action:u.action,location:u.location}),{v7_startTransition:h}=i||{},f=o.useCallback((e=>{h&&Ut?Ut((()=>d(e))):d(e)}),[d,h]);return o.useLayoutEffect((()=>u.listen(f)),[u,f]),o.createElement(Nt,{basename:t,children:r,location:c.location,navigationType:c.action,navigator:u})}function _t(e){let{to:t,replace:r,state:n,relative:a}=e;Xe()||c(!1);let{matches:i}=o.useContext(Je),{pathname:l}=Ge(),s=tt(),u=I(t,F(i).map((e=>e.pathnameBase)),l,"path"===a),d=JSON.stringify(u);return o.useEffect((()=>s(JSON.parse(d),{replace:r,state:n,relative:a})),[s,d,a,r,n]),null}function Ot(e){return ot(e.context)}function Bt(e){c(!1)}function Nt(e){let{basename:t="/",children:r=null,location:a,navigationType:i=n.Pop,navigator:l,static:s=!1}=e;Xe()&&c(!1);let u=t.replace(/^\/*/,"/"),d=o.useMemo((()=>({basename:u,navigator:l,static:s})),[u,l,s]);"string"==typeof a&&(a=m(a));let{pathname:h="/",search:f="",hash:p="",state:v=null,key:y="default"}=a,g=o.useMemo((()=>{let e=O(h,u);return null==e?null:{location:{pathname:e,search:f,hash:p,state:v,key:y},navigationType:i}}),[u,h,f,p,v,y,i]);return null==g?null:o.createElement(Ke.Provider,{value:d},o.createElement(qe.Provider,{children:r,value:g}))}function Ft(e){let{children:t,location:r}=e;return lt(Kt(t),r)}function It(e){let{children:t,errorElement:r,resolve:n}=e;return o.createElement(Ht,{resolve:n,errorElement:r},o.createElement($t,null,t))}var zt=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(zt||{});const Wt=new Promise((()=>{}));class Ht extends o.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:r}=this.props,n=null,a=zt.pending;if(r instanceof Promise)if(this.state.error){a=zt.error;let e=this.state.error;n=Promise.reject().catch((()=>{})),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_error",{get:()=>e})}else r._tracked?(n=r,a=void 0!==n._error?zt.error:void 0!==n._data?zt.success:zt.pending):(a=zt.pending,Object.defineProperty(r,"_tracked",{get:()=>!0}),n=r.then((e=>Object.defineProperty(r,"_data",{get:()=>e})),(e=>Object.defineProperty(r,"_error",{get:()=>e}))));else a=zt.success,n=Promise.resolve(),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_data",{get:()=>r});if(a===zt.error&&n._error instanceof q)throw Wt;if(a===zt.error&&!t)throw n._error;if(a===zt.error)return o.createElement($e.Provider,{value:n,children:t});if(a===zt.success)return o.createElement($e.Provider,{value:n,children:e});throw n}}function $t(e){let{children:t}=e,r=Pt(),n="function"==typeof t?t(r):t;return o.createElement(o.Fragment,null,n)}function Kt(e,t){void 0===t&&(t=[]);let r=[];return o.Children.forEach(e,((e,n)=>{if(!o.isValidElement(e))return;let a=[...t,n];if(e.type===o.Fragment)return void r.push.apply(r,Kt(e.props.children,a));e.type!==Bt&&c(!1),e.props.index&&e.props.children&&c(!1);let i={id:e.props.id||a.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(i.children=Kt(e.props.children,a)),r.push(i)})),r}function qt(e){return ft(e)}function Jt(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:o.createElement(e.Component),Component:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:o.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function Yt(e,t){return de({basename:null==t?void 0:t.basename,future:ze({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:l({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:Jt}).initialize()}function Vt(){return Vt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vt.apply(this,arguments)}function Xt(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}const Gt="get",Qt="application/x-www-form-urlencoded";function Zt(e){return null!=e&&"string"==typeof e.tagName}function er(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map((e=>[r,e])):[[r,n]])}),[]))}let tr=null;const rr=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function nr(e){return null==e||rr.has(e)?e:null}function or(e,t){let r,n,o,a,i;if(Zt(l=e)&&"form"===l.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?O(i,t):null,r=e.getAttribute("method")||Gt,o=nr(e.getAttribute("enctype"))||Qt,a=new FormData(e)}else if(function(e){return Zt(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Zt(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||i.getAttribute("action");if(n=l?O(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||Gt,o=nr(e.getAttribute("formenctype"))||nr(i.getAttribute("enctype"))||Qt,a=new FormData(i,e),!function(){if(null===tr)try{new FormData(document.createElement("form"),0),tr=!1}catch(e){tr=!0}return tr}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?t+".":"";a.append(e+"x","0"),a.append(e+"y","0")}else t&&a.append(t,n)}}else{if(Zt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Gt,n=null,o=Qt,i=e}var l;return a&&"text/plain"===o&&(i=a,a=void 0),{action:n,method:r.toLowerCase(),encType:o,formData:a,body:i}}const ar=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],ir=["aria-current","caseSensitive","className","end","style","to","children"],lr=["reloadDocument","replace","state","method","action","onSubmit","submit","relative","preventScrollReset"];function sr(e,t){return de({basename:null==t?void 0:t.basename,future:Vt({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:s({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||cr(),routes:e,mapRouteProperties:Jt}).initialize()}function ur(e,t){return de({basename:null==t?void 0:t.basename,future:Vt({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:u({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||cr(),routes:e,mapRouteProperties:Jt}).initialize()}function cr(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Vt({},t,{errors:dr(t.errors)})),t}function dr(e){if(!e)return null;let t=Object.entries(e),r={};for(let[e,n]of t)if(n&&"RouteErrorResponse"===n.__type)r[e]=new Q(n.status,n.statusText,n.data,!0===n.internal);else if(n&&"Error"===n.__type){if(n.__subType){let t=window[n.__subType];if("function"==typeof t)try{let o=new t(n.message);o.stack="",r[e]=o}catch(e){}}if(null==r[e]){let t=new Error(n.message);t.stack="",r[e]=t}}else r[e]=n;return r}const hr=o.startTransition;function fr(e){let{basename:t,children:r,future:n,window:a}=e,i=o.useRef();null==i.current&&(i.current=s({window:a,v5Compat:!0}));let l=i.current,[u,c]=o.useState({action:l.action,location:l.location}),{v7_startTransition:d}=n||{},h=o.useCallback((e=>{d&&hr?hr((()=>c(e))):c(e)}),[c,d]);return o.useLayoutEffect((()=>l.listen(h)),[l,h]),o.createElement(Nt,{basename:t,children:r,location:u.location,navigationType:u.action,navigator:l})}function pr(e){let{basename:t,children:r,future:n,window:a}=e,i=o.useRef();null==i.current&&(i.current=u({window:a,v5Compat:!0}));let l=i.current,[s,c]=o.useState({action:l.action,location:l.location}),{v7_startTransition:d}=n||{},h=o.useCallback((e=>{d&&hr?hr((()=>c(e))):c(e)}),[c,d]);return o.useLayoutEffect((()=>l.listen(h)),[l,h]),o.createElement(Nt,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:l})}function mr(e){let{basename:t,children:r,future:n,history:a}=e,[i,l]=o.useState({action:a.action,location:a.location}),{v7_startTransition:s}=n||{},u=o.useCallback((e=>{s&&hr?hr((()=>l(e))):l(e)}),[l,s]);return o.useLayoutEffect((()=>a.listen(u)),[a,u]),o.createElement(Nt,{basename:t,children:r,location:i.location,navigationType:i.action,navigator:a})}const vr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,yr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gr=o.forwardRef((function(e,t){let r,{onClick:n,relative:a,reloadDocument:i,replace:l,state:s,target:u,to:c,preventScrollReset:d}=e,h=Xt(e,ar),{basename:f}=o.useContext(Ke),p=!1;if("string"==typeof c&&yr.test(c)&&(r=c,vr))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),r=O(t.pathname,f);t.origin===e.origin&&null!=r?c=r+t.search+t.hash:p=!0}catch(e){}let m=Ve(c,{relative:a}),v=Pr(c,{replace:l,state:s,target:u,preventScrollReset:d,relative:a});return o.createElement("a",Vt({},h,{href:r||m,onClick:p||i?n:function(e){n&&n(e),e.defaultPrevented||v(e)},ref:t,target:u}))})),br=o.forwardRef((function(e,t){let{"aria-current":r="page",caseSensitive:n=!1,className:a="",end:i=!1,style:l,to:s,children:u}=e,c=Xt(e,ir),d=it(s,{relative:c.relative}),h=Ge(),f=o.useContext(He),{navigator:p}=o.useContext(Ke),m=p.encodeLocation?p.encodeLocation(d).pathname:d.pathname,v=h.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;n||(v=v.toLowerCase(),y=y?y.toLowerCase():null,m=m.toLowerCase());let g,b=v===m||!i&&v.startsWith(m)&&"/"===v.charAt(m.length),w=null!=y&&(y===m||!i&&y.startsWith(m)&&"/"===y.charAt(m.length)),E=b?r:void 0;g="function"==typeof a?a({isActive:b,isPending:w}):[a,b?"active":null,w?"pending":null].filter(Boolean).join(" ");let R="function"==typeof l?l({isActive:b,isPending:w}):l;return o.createElement(gr,Vt({},c,{"aria-current":E,className:g,ref:t,style:R,to:s}),"function"==typeof u?u({isActive:b,isPending:w}):u)})),wr=o.forwardRef(((e,t)=>{let r=Ar();return o.createElement(Er,Vt({},e,{submit:r,ref:t}))})),Er=o.forwardRef(((e,t)=>{let{reloadDocument:r,replace:n,state:a,method:i=Gt,action:l,onSubmit:s,submit:u,relative:c,preventScrollReset:d}=e,h=Xt(e,lr),f="get"===i.toLowerCase()?"get":"post",p=Mr(l,{relative:c});return o.createElement("form",Vt({ref:t,method:f,action:p,onSubmit:r?s:e=>{if(s&&s(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,r=(null==t?void 0:t.getAttribute("formmethod"))||i;u(t||e.currentTarget,{method:r,replace:n,state:a,relative:c,preventScrollReset:d})}},h))}));function Rr(e){let{getKey:t,storageKey:r}=e;return Nr({getKey:t,storageKey:r}),null}var xr,Sr;function Dr(e){let t=o.useContext(We);return t||c(!1),t}function Cr(e){let t=o.useContext(He);return t||c(!1),t}function Pr(e,t){let{target:r,replace:n,state:a,preventScrollReset:i,relative:l}=void 0===t?{}:t,s=tt(),u=Ge(),c=it(e,{relative:l});return o.useCallback((t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,r)){t.preventDefault();let r=void 0!==n?n:p(u)===p(c);s(e,{replace:r,state:a,preventScrollReset:i,relative:l})}}),[u,s,c,n,a,r,e,i,l])}function kr(e){let t=o.useRef(er(e)),r=o.useRef(!1),n=Ge(),a=o.useMemo((()=>function(e,t){let r=er(e);return t&&t.forEach(((e,n)=>{r.has(n)||t.getAll(n).forEach((e=>{r.append(n,e)}))})),r}(n.search,r.current?null:t.current)),[n.search]),i=tt(),l=o.useCallback(((e,t)=>{const n=er("function"==typeof e?e(a):e);r.current=!0,i("?"+n,t)}),[i,a]);return[a,l]}function Lr(){if("undefined"==typeof document)throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}function Ar(){let{router:e}=Dr(xr.UseSubmit),{basename:t}=o.useContext(Ke),r=bt();return o.useCallback((function(n,o){void 0===o&&(o={}),Lr();let{action:a,method:i,encType:l,formData:s,body:u}=or(n,t);e.navigate(o.action||a,{preventScrollReset:o.preventScrollReset,formData:s,body:u,formMethod:o.method||i,formEncType:o.encType||l,replace:o.replace,state:o.state,fromRouteId:r})}),[e,t,r])}function Ur(e,t){let{router:r}=Dr(xr.UseSubmitFetcher),{basename:n}=o.useContext(Ke);return o.useCallback((function(o,a){void 0===a&&(a={}),Lr();let{action:i,method:l,encType:s,formData:u,body:d}=or(o,n);null==t&&c(!1),r.fetch(e,t,a.action||i,{preventScrollReset:a.preventScrollReset,formData:u,body:d,formMethod:a.method||l,formEncType:a.encType||s})}),[r,n,e,t])}function Mr(e,t){let{relative:r}=void 0===t?{}:t,{basename:n}=o.useContext(Ke),a=o.useContext(Je);a||c(!1);let[i]=a.matches.slice(-1),l=Vt({},it(e||".",{relative:r})),s=Ge();if(null==e&&(l.search=s.search,i.route.index)){let e=new URLSearchParams(l.search);e.delete("index"),l.search=e.toString()?"?"+e.toString():""}return e&&"."!==e||!i.route.index||(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),"/"!==n&&(l.pathname="/"===l.pathname?n:z([n,l.pathname])),p(l)}(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"})(xr||(xr={})),function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Sr||(Sr={}));let jr=0;function Tr(){var e;let{router:t}=Dr(xr.UseFetcher),r=o.useContext(Je);r||c(!1);let n=null==(e=r.matches[r.matches.length-1])?void 0:e.route.id;null==n&&c(!1);let[a]=o.useState((()=>String(++jr))),[i]=o.useState((()=>(n||c(!1),function(e,t){return o.forwardRef(((r,n)=>{let a=Ur(e,t);return o.createElement(Er,Vt({},r,{ref:n,submit:a}))}))}(a,n)))),[l]=o.useState((()=>e=>{t||c(!1),n||c(!1),t.fetch(a,n,e)})),s=Ur(a,n),u=t.getFetcher(a),d=o.useMemo((()=>Vt({Form:i,submit:s,load:l},u)),[u,i,s,l]);return o.useEffect((()=>()=>{t?t.deleteFetcher(a):console.warn("No router available to clean up from useFetcher()")}),[t,a]),d}function _r(){return[...Cr(Sr.UseFetchers).fetchers.values()]}const Or="react-router-scroll-positions";let Br={};function Nr(e){let{getKey:t,storageKey:r}=void 0===e?{}:e,{router:n}=Dr(xr.UseScrollRestoration),{restoreScrollPosition:a,preventScrollReset:i}=Cr(Sr.UseScrollRestoration),{basename:l}=o.useContext(Ke),s=Ge(),u=Rt(),c=wt();o.useEffect((()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"})),[]),function(e){let{capture:t}={};o.useEffect((()=>{let r=null!=t?{capture:t}:void 0;return window.addEventListener("pagehide",e,r),()=>{window.removeEventListener("pagehide",e,r)}}),[e,t])}(o.useCallback((()=>{if("idle"===c.state){let e=(t?t(s,u):null)||s.key;Br[e]=window.scrollY}sessionStorage.setItem(r||Or,JSON.stringify(Br)),window.history.scrollRestoration="auto"}),[r,t,c.state,s,u])),"undefined"!=typeof document&&(o.useLayoutEffect((()=>{try{let e=sessionStorage.getItem(r||Or);e&&(Br=JSON.parse(e))}catch(e){}}),[r]),o.useLayoutEffect((()=>{let e=t&&"/"!==l?(e,r)=>t(Vt({},e,{pathname:O(e.pathname,l)||e.pathname}),r):t,r=null==n?void 0:n.enableScrollRestoration(Br,(()=>window.scrollY),e);return()=>r&&r()}),[n,l,t]),o.useLayoutEffect((()=>{if(!1!==a)if("number"!=typeof a){if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e)return void e.scrollIntoView()}!0!==i&&window.scrollTo(0,0)}else window.scrollTo(0,a)}),[s,a,i]))}function Fr(e,t){let{capture:r}=t||{};o.useEffect((()=>{let t=null!=r?{capture:r}:void 0;return window.addEventListener("beforeunload",e,t),()=>{window.removeEventListener("beforeunload",e,t)}}),[e,r])}function Ir(e){let{when:t,message:r}=e,n=At(t);o.useEffect((()=>{"blocked"===n.state&&(window.confirm(r)?setTimeout(n.proceed,0):n.reset())}),[n,r]),o.useEffect((()=>{"blocked"!==n.state||t||n.reset()}),[n,t])}}}]);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @remix-run/router v1.23.1
2
+ * @remix-run/router v1.9.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -10,7 +10,7 @@
10
10
  */
11
11
 
12
12
  /**
13
- * React Router DOM v6.30.2
13
+ * React Router DOM v6.16.0
14
14
  *
15
15
  * Copyright (c) Remix Software Inc.
16
16
  *
@@ -21,7 +21,7 @@
21
21
  */
22
22
 
23
23
  /**
24
- * React Router v6.30.2
24
+ * React Router v6.16.0
25
25
  *
26
26
  * Copyright (c) Remix Software Inc.
27
27
  *