xedoc-cli 0.1.11 → 0.1.12

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 (43) hide show
  1. package/README.md +11 -5
  2. package/build/client/assets/api.workspaces.directories-B0tllRDq.js +0 -0
  3. package/build/client/assets/app-layout-Bl4qOwh7.js +1 -0
  4. package/build/client/assets/app-shell-D4VZoy6V.js +2 -0
  5. package/build/client/assets/chat-5ZSZb1GN.js +1 -0
  6. package/build/client/assets/{connect-C_Nz7Dlc.js → connect-xfBRZuAz.js} +1 -1
  7. package/build/client/assets/document-title-bwEcQkgI.js +1 -0
  8. package/build/client/assets/{entry.client-BQZeV9JD.js → entry.client-Bt-W9tr6.js} +1 -1
  9. package/build/client/assets/{ghostty-web-CgkkAFeT.js → ghostty-web-BBN5ya0J.js} +1 -1
  10. package/build/client/assets/home-D-i6W4Ao.js +1 -0
  11. package/build/client/assets/{jsx-runtime-Cal6WBdn.js → jsx-runtime-BUWBtJLv.js} +1 -1
  12. package/build/client/assets/{label-3ZcIm6vU.js → label-BLnKkf67.js} +1 -1
  13. package/build/client/assets/manifest-9317aaeb.js +1 -0
  14. package/build/client/assets/{react-dom-D4MOkHq2.js → react-dom-Bppadr6u.js} +1 -1
  15. package/build/client/assets/root-B6reKqFo.js +1 -0
  16. package/build/client/assets/root-BDyfnfyW.css +2 -0
  17. package/build/client/assets/{session-provider-LuURNNCq.js → session-provider-BFqptX_P.js} +1 -1
  18. package/build/server/index.js +1 -1
  19. package/package.json +1 -1
  20. package/prisma/schema.prisma +22 -0
  21. package/server/sqlite-setup.mjs +63 -0
  22. package/build/client/assets/app-layout-VeZzc2bX.js +0 -1
  23. package/build/client/assets/app-shell-iKMZyGQn.js +0 -2
  24. package/build/client/assets/chat-lT5RuwNC.js +0 -1
  25. package/build/client/assets/document-title-C2ykzN2o.js +0 -1
  26. package/build/client/assets/home-BynJN9xe.js +0 -1
  27. package/build/client/assets/manifest-a5a0eaab.js +0 -1
  28. package/build/client/assets/root-B6ikjQMc.js +0 -1
  29. package/build/client/assets/root-KOlmIkbz.css +0 -2
  30. /package/build/client/assets/{__vite-browser-external-2447137e-Bb2UaVfr.js → __vite-browser-external-2447137e-DSxSsOOp.js} +0 -0
  31. /package/build/client/assets/{api.accounts._accountId.authenticate-Bp51NHGy.js → api.accounts._accountId.authenticate-CLzgv3py.js} +0 -0
  32. /package/build/client/assets/{api.accounts._accountId.authenticate.callback-DLgNMRyd.js → api.accounts._accountId.authenticate.callback-Bqhz8sDl.js} +0 -0
  33. /package/build/client/assets/{api.accounts._accountId.models-DGbCmT_9.js → api.accounts._accountId.models-VIVpVZrj.js} +0 -0
  34. /package/build/client/assets/{api.accounts._accountId.rate-limits-DZh4HPLO.js → api.accounts._accountId.personalization-z2pU64qI.js} +0 -0
  35. /package/build/client/assets/{api.chats-DZ_6Q7rY.js → api.accounts._accountId.rate-limits-C9iUvNFt.js} +0 -0
  36. /package/build/client/assets/{api.chats._chatId-BEX87qHo.js → api.chats-C6-gVaXw.js} +0 -0
  37. /package/build/client/assets/{api.chats._chatId.context-v4G0lNKq.js → api.chats._chatId-DaXHa-ln.js} +0 -0
  38. /package/build/client/assets/{api.chats._chatId.files-BrN7O-wM.js → api.chats._chatId.context-DlBgjpCD.js} +0 -0
  39. /package/build/client/assets/{api.chats._chatId.git._operation-CiUW8Knm.js → api.chats._chatId.files-DVZKcoNV.js} +0 -0
  40. /package/build/client/assets/{api.chats._chatId.interrupt-2DlVPDlX.js → api.chats._chatId.git._operation-8Xtyz4hF.js} +0 -0
  41. /package/build/client/assets/{api.chats._chatId.messages-cDawTuvN.js → api.chats._chatId.interrupt-B71lrxkc.js} +0 -0
  42. /package/build/client/assets/{api.chats._chatId.server-requests._requestId.respond-CTlCffOk.js → api.chats._chatId.messages-iVzJcgvw.js} +0 -0
  43. /package/build/client/assets/{api.workspaces.directories-nVoleT74.js → api.chats._chatId.server-requests._requestId.respond-BLhOUK8A.js} +0 -0
@@ -1 +1 @@
1
- var e,t=Object.create,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,l=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,t)=>{let n={};for(var a in e)r(n,a,{get:e[a],enumerable:!0});return t||r(n,Symbol.toStringTag,{value:"Module"}),n},u=(e,l,s)=>(s=null!=e?t(o(e)):{},((e,t,o,l)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var s,u=a(t),c=0,d=u.length;c<d;c++)s=u[c],i.call(e,s)||s===o||r(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(l=n(t,s))||l.enumerable});return e})(!l&&e&&e.__esModule?s:r(s,"default",{value:e,enumerable:!0}),e)),c=l(e=>{var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),f=Symbol.iterator;var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,y={};function v(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||m}function g(){}function w(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||m}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=v.prototype;var b=w.prototype=new g;b.constructor=w,p(b,v.prototype),b.isPureReactComponent=!0;var E=Array.isArray;function R(){}var S={H:null,A:null,T:null,S:null},x=Object.prototype.hasOwnProperty;function k(e,r,n){var a=n.ref;return{$$typeof:t,type:e,key:r,ref:void 0!==a?a:null,props:n}}function L(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}var C=/\/+/g;function M(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(r=""+e.key,n={"=":"=0",":":"=2"},"$"+r.replace(/[=:]/g,function(e){return n[e]})):t.toString(36);var r,n}function P(e,n,a,o,i){var l=typeof e;"undefined"!==l&&"boolean"!==l||(e=null);var s,u,c=!1;if(null===e)c=!0;else switch(l){case"bigint":case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case t:case r:c=!0;break;case d:return P((c=e._init)(e._payload),n,a,o,i)}}if(c)return i=i(e),c=""===o?"."+M(e,0):o,E(i)?(a="",null!=c&&(a=c.replace(C,"$&/")+"/"),P(i,n,a,"",function(e){return e})):null!=i&&(L(i)&&(s=i,u=a+(null==i.key||e&&e.key===i.key?"":(""+i.key).replace(C,"$&/")+"/")+c,i=k(s.type,u,s.props)),n.push(i)),1;c=0;var h,m=""===o?".":o+":";if(E(e))for(var p=0;p<e.length;p++)c+=P(o=e[p],n,a,l=m+M(o,p),i);else if("function"==typeof(p=null===(h=e)||"object"!=typeof h?null:"function"==typeof(h=f&&h[f]||h["@@iterator"])?h:null))for(e=p.call(e),p=0;!(o=e.next()).done;)c+=P(o=o.value,n,a,l=m+M(o,p++),i);else if("object"===l){if("function"==typeof e.then)return P(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(R,R):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(e),n,a,o,i);throw n=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===n?"object with keys {"+Object.keys(e).join(", ")+"}":n)+"). If you meant to render a collection of children, use an array instead.")}return c}function T(e,t,r){if(null==e)return e;var n=[],a=0;return P(e,n,"","",function(e){return t.call(r,e,a++)}),n}function D(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var O="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},$={map:T,forEach:function(e,t,r){T(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return T(e,function(){t++}),t},toArray:function(e){return T(e,function(e){return e})||[]},only:function(e){if(!L(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};e.Activity=h,e.Children=$,e.Component=v,e.Fragment=n,e.Profiler=o,e.PureComponent=w,e.StrictMode=a,e.Suspense=u,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=S,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return S.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,r){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var n=p({},e.props),a=e.key;if(null!=t)for(o in void 0!==t.key&&(a=""+t.key),t)!x.call(t,o)||"key"===o||"__self"===o||"__source"===o||"ref"===o&&void 0===t.ref||(n[o]=t[o]);var o=arguments.length-2;if(1===o)n.children=r;else if(1<o){for(var i=Array(o),l=0;l<o;l++)i[l]=arguments[l+2];n.children=i}return k(e.type,a,n)},e.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:i,_context:e},e},e.createElement=function(e,t,r){var n,a={},o=null;if(null!=t)for(n in void 0!==t.key&&(o=""+t.key),t)x.call(t,n)&&"key"!==n&&"__self"!==n&&"__source"!==n&&(a[n]=t[n]);var i=arguments.length-2;if(1===i)a.children=r;else if(1<i){for(var l=Array(i),s=0;s<i;s++)l[s]=arguments[s+2];a.children=l}if(e&&e.defaultProps)for(n in i=e.defaultProps)void 0===a[n]&&(a[n]=i[n]);return k(e,o,a)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:s,render:e}},e.isValidElement=L,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:D}},e.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},e.startTransition=function(e){var t=S.T,r={};S.T=r;try{var n=e(),a=S.S;null!==a&&a(r,n),"object"==typeof n&&null!==n&&"function"==typeof n.then&&n.then(R,O)}catch(o){O(o)}finally{null!==t&&null!==r.types&&(t.types=r.types),S.T=t}},e.unstable_useCacheRefresh=function(){return S.H.useCacheRefresh()},e.use=function(e){return S.H.use(e)},e.useActionState=function(e,t,r){return S.H.useActionState(e,t,r)},e.useCallback=function(e,t){return S.H.useCallback(e,t)},e.useContext=function(e){return S.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return S.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return S.H.useEffect(e,t)},e.useEffectEvent=function(e){return S.H.useEffectEvent(e)},e.useId=function(){return S.H.useId()},e.useImperativeHandle=function(e,t,r){return S.H.useImperativeHandle(e,t,r)},e.useInsertionEffect=function(e,t){return S.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return S.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return S.H.useMemo(e,t)},e.useOptimistic=function(e,t){return S.H.useOptimistic(e,t)},e.useReducer=function(e,t,r){return S.H.useReducer(e,t,r)},e.useRef=function(e){return S.H.useRef(e)},e.useState=function(e){return S.H.useState(e)},e.useSyncExternalStore=function(e,t,r){return S.H.useSyncExternalStore(e,t,r)},e.useTransition=function(){return S.H.useTransition()},e.version="19.2.6"}),d=l((e,t)=>{t.exports=c()}),h=u(d(),1),f={},m=function(e,t,r){let n=Promise.resolve();if(t&&t.length>0){const e=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),i=o?.nonce||o?.getAttribute("nonce");a=t.map(t=>{if((t=function(e){return"/"+e}(t))in f)return;f[t]=!0;const n=t.endsWith(".css"),a=n?'[rel="stylesheet"]':"";if(r)for(let r=e.length-1;r>=0;r--){const a=e[r];if(a.href===t&&(!n||"stylesheet"===a.rel))return}else if(document.querySelector(`link[href="${t}"]${a}`))return;const o=document.createElement("link");return o.rel=n?"stylesheet":"modulepreload",n||(o.as="script"),o.crossOrigin="",o.href=t,i&&o.setAttribute("nonce",i),document.head.appendChild(o),n?new Promise((e,r)=>{o.addEventListener("load",e),o.addEventListener("error",()=>r(new Error(`Unable to preload CSS for ${t}`)))}):void 0}),n=Promise.all(a.map(e=>Promise.resolve(e).then(e=>({status:"fulfilled",value:e}),e=>({status:"rejected",reason:e}))))}var a;function o(e){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return n.then(t=>{for(const e of t||[])"rejected"===e.status&&o(e.reason);return e().catch(o)})},p=e=>{throw TypeError(e)},y=(e,t,r)=>t.has(e)||p("Cannot "+r),v=(e,t,r)=>(y(e,t,"read from private field"),r?r.call(e):t.get(e)),g=(e,t,r)=>t.has(e)?p("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),w=(e,t,r,n)=>(y(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),b="popstate";function E(e){return"object"==typeof e&&null!=e&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function R(e={}){return function(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,l="POP",s=null,u=c();null==u&&(u=0,i.replaceState({...i.state,idx:u},""));function c(){return(i.state||{idx:null}).idx}function d(){l="POP";let e=c(),t=null==e?null:e-u;u=e,s&&s({action:l,location:p.location,delta:t})}function h(e,t){l="PUSH";let n=E(e)?e:L(p.location,e,t);r&&r(n,e),u=c()+1;let d=k(n,u),h=p.createHref(n.mask||n);try{i.pushState(d,"",h)}catch(f){if(f instanceof DOMException&&"DataCloneError"===f.name)throw f;a.location.assign(h)}o&&s&&s({action:l,location:p.location,delta:1})}function f(e,t){l="REPLACE";let n=E(e)?e:L(p.location,e,t);r&&r(n,e),u=c();let a=k(n,u),d=p.createHref(n.mask||n);i.replaceState(a,"",d),o&&s&&s({action:l,location:p.location,delta:0})}function m(e){return P(e)}let p={get action(){return l},get location(){return e(a,i)},listen(e){if(s)throw new Error("A history only accepts one active listener");return a.addEventListener(b,d),s=e,()=>{a.removeEventListener(b,d),s=null}},createHref:e=>t(a,e),createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:h,replace:f,go:e=>i.go(e)};return p}(function(e,t){let r=t.state?.masked,{pathname:n,search:a,hash:o}=r||e.location;return L("",{pathname:n,search:a,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default",r?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)},function(e,t){return"string"==typeof t?t:C(t)},null,e)}function S(e,t){if(!1===e||null==e)throw new Error(t)}function x(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(r){}}}function k(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function L(e,t,r=null,n,a){return{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).substring(2,10),mask:a}}function C({pathname:e="/",search:t="",hash:r=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),r&&"#"!==r&&(e+="#"===r.charAt(0)?r:"#"+r),e}function M(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function P(e,t=!1){let r="http://localhost";"undefined"!=typeof window&&(r="null"!==window.location.origin?window.location.origin:window.location.href),S(r,"No window.location.(origin|href) available to create URL");let n="string"==typeof e?e:C(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}function T(e){return{defaultValue:e}}var D=class{constructor(t){if(g(this,e,new Map),t)for(let[e,r]of t)this.set(e,r)}get(t){if(v(this,e).has(t))return v(this,e).get(t);if(void 0!==t.defaultValue)return t.defaultValue;throw new Error("No value found for context")}set(t,r){v(this,e).set(t,r)}};e=new WeakMap;var O=new Set(["lazy","caseSensitive","path","id","index","children"]);var $=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function A(e){return $.has(e)}function j(e,t,r=[],n={},a=!1){return e.map((e,o)=>{let i=[...r,String(o)],l="string"==typeof e.id?e.id:i.join("-");if(S(!0!==e.index||!e.children,"Cannot specify children on an index route"),S(a||!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={...e,id:l};return n[l]=_(r,t(r)),r}{let r={...e,id:l,children:void 0};return n[l]=_(r,t(r)),e.children&&(r.children=j(e.children,t,i,n,a)),r}})}function _(e,t){return Object.assign(e,{...t,..."object"==typeof t.lazy&&null!=t.lazy?{lazy:{...e.lazy,...t.lazy}}:{}})}function N(e,t,r="/"){return H(e,t,r,!1)}function H(e,t,r,n,a){let o=ee(("string"==typeof t?M(t):t).pathname||"/",r);if(null==o)return null;let i=a??z(e),l=null,s=function(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return x(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}(o);for(let u=0;null==l&&u<i.length;++u)l=G(i[u],s,n);return l}function F(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function z(e){let t=U(e);return 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)))}(t),t}function U(e,t=[],r=[],n="",a=!1){let o=(e,o,i=a,l)=>{let s={relativePath:void 0===l?e.path||"":l,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};if(s.relativePath.startsWith("/")){if(!s.relativePath.startsWith(n)&&i)return;S(s.relativePath.startsWith(n),`Absolute route path "${s.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),s.relativePath=s.relativePath.slice(n.length)}let u=ue([n,s.relativePath]),c=r.concat(s);e.children&&e.children.length>0&&(S(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),U(e.children,t,c,u,i)),(null!=e.path||e.index)&&t.push({path:u,score:X(u,e.index),routesMeta:c})};return e.forEach((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let r of I(e.path))o(e,t,!0,r);else o(e,t)}),t}function I(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=I(n.join("/")),l=[];return l.push(...i.map(e=>""===e?o:[o,e].join("/"))),a&&l.push(...i),l.map(t=>e.startsWith("/")&&""===t?"/":t)}var B=/^:[\w-]+$/,W=3,q=2,J=1,Y=10,V=-2,K=e=>"*"===e;function X(e,t){let r=e.split("/"),n=r.length;return r.some(K)&&(n+=V),t&&(n+=q),r.filter(e=>!K(e)).reduce((e,t)=>e+(B.test(t)?W:""===t?J:Y),n)}function G(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",i=[];for(let l=0;l<n.length;++l){let e=n[l],s=l===n.length-1,u="/"===o?t:t.slice(o.length)||"/",c=Z({path:e.relativePath,caseSensitive:e.caseSensitive,end:s},u),d=e.route;if(!c&&s&&r&&!n[n.length-1].route.index&&(c=Z({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},u)),!c)return null;Object.assign(a,c.params),i.push({params:a,pathname:ue([o,c.pathname]),pathnameBase:de(ue([o,c.pathnameBase])),route:d}),"/"!==c.pathnameBase&&(o=ue([o,c.pathnameBase]))}return i}function Z(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Q(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((e,{paramName:t,isOptional:r},n)=>{if("*"===t){let e=l[n]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const a=l[n];return e[t]=r&&!a?void 0:(a||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:i,pattern:e}}function Q(e,t=!1,r=!0){x("*"===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,a,o)=>{if(n.push({paramName:t,isOptional:null!=r}),r){let t=o.charAt(a+e.length);return t&&"/"!==t?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function ee(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)||"/"}var te=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,re=e=>te.test(e);function ne(e,t){let r=ce(t).split("/");return e.split("/").forEach(e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)}),r.length>1?r.join("/"):"/"}function ae(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 oe(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function ie(e){let t=oe(e);return t.map((e,r)=>r===t.length-1?e.pathname:e.pathnameBase)}function le(e,t,r,n=!1){let a;"string"==typeof e?a=M(e):(a={...e},S(!a.pathname||!a.pathname.includes("?"),ae("?","pathname","search",a)),S(!a.pathname||!a.pathname.includes("#"),ae("#","pathname","hash",a)),S(!a.search||!a.search.includes("#"),ae("#","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 s=function(e,t="/"){let r,{pathname:n,search:a="",hash:o=""}="string"==typeof e?M(e):e;return n?(n=se(n),r=n.startsWith("/")?ne(n.substring(1),"/"):ne(n,t)):r=t,{pathname:r,search:he(a),hash:fe(o)}}(a,o),u=l&&"/"!==l&&l.endsWith("/"),c=(i||"."===l)&&r.endsWith("/");return s.pathname.endsWith("/")||!u&&!c||(s.pathname+="/"),s}var se=e=>e.replace(/\/\/+/g,"/"),ue=e=>se(e.join("/")),ce=e=>e.replace(/\/+$/,""),de=e=>ce(e).replace(/^\/*/,"/"),he=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",fe=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",me=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function pe(e,t){return new me(e,"number"==typeof t?{status:t}:t)}var ye=class{constructor(e,t,r,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 ve(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}function ge(e){return ue(e.map(e=>e.route.path).filter(Boolean))||"/"}var we="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function be(e,t){let r=e;if("string"!=typeof r||!te.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,a=!1;if(we)try{let e=new URL(window.location.href),n=r.startsWith("//")?new URL(e.protocol+r):new URL(r),o=ee(n.pathname,t);n.origin===e.origin&&null!=o?r=o+n.search+n.hash:a=!0}catch(o){x(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:a,to:r}}var Ee=Symbol("Uninstrumented");function Re(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(r);for(let n of t)e[n]&&r[n].push(e[n])}}));let n={};if("function"==typeof t.lazy&&r.lazy.length>0){let e=Se(r.lazy,t.lazy,()=>{});e&&(n.lazy=e)}if("object"==typeof t.lazy){let e=t.lazy;["middleware","loader","action"].forEach(t=>{let a=e[t],o=r[`lazy.${t}`];if("function"==typeof a&&o.length>0){let e=Se(o,a,()=>{});e&&(n.lazy=Object.assign(n.lazy||{},{[t]:e}))}})}return["loader","action"].forEach(e=>{let a=t[e];if("function"==typeof a&&r[e].length>0){let t=a[Ee]??a,o=Se(r[e],t,(...e)=>ke(e[0]));o&&("loader"===e&&!0===t.hydrate&&(o.hydrate=!0),o[Ee]=t,n[e]=o)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(n.middleware=t.middleware.map(e=>{let t=e[Ee]??e,n=Se(r.middleware,t,(...e)=>ke(e[0]));return n?(n[Ee]=t,n):e})),n}function Se(e,t,r){return 0===e.length?null:async(...n)=>{let a=await xe(e,r(...n),()=>t(...n),e.length-1);if("error"===a.type)throw a.value;return a.value}}async function xe(e,t,r,n){let a,o=e[n];if(o){let l,s=async()=>(l?console.error("You cannot call instrumented handlers more than once"):l=xe(e,t,r,n-1),a=await l,S(a,"Expected a result"),"error"===a.type&&a.value instanceof Error?{status:"error",error:a.value}:{status:"success",error:void 0});try{await o(s,t)}catch(i){console.error("An instrumentation function threw an error:",i)}l||await s(),await l}else try{a={type:"success",value:await r()}}catch(i){a={type:"error",value:i}}return a||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function ke(e){let{request:t,context:r,params:n,pattern:a}=e;return{request:Ce(t),params:{...n},pattern:a,context:Me(r)}}function Le(e,t){return{currentUrl:C(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function Ce(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Me(e){if(function(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t||Object.getOwnPropertyNames(t).sort().join("\0")===Pe}(e)){let t={...e};return Object.freeze(t),t}return{get:t=>e.get(t)}}var Pe=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Te,De,Oe,$e,Ae=["POST","PUT","PATCH","DELETE"],je=new Set(Ae),_e=["GET",...Ae],Ne=new Set(_e),He=new Set([301,302,303,307,308]),Fe=new Set([307,308]),ze={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ue={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ie={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Be=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),We="remix-router-transitions",qe=Symbol("ResetLoaderData"),Je=class{constructor(e){g(this,Te),g(this,De),g(this,Oe),g(this,$e),w(this,Te,e),w(this,De,z(e))}get stableRoutes(){return v(this,Te)}get activeRoutes(){return v(this,Oe)??v(this,Te)}get branches(){return v(this,$e)??v(this,De)}get hasHMRRoutes(){return null!=v(this,Oe)}setRoutes(e){w(this,Te,e),w(this,De,z(e))}setHmrRoutes(e){w(this,Oe,e),w(this,$e,z(e))}commitHmrRoutes(){v(this,Oe)&&(w(this,Te,v(this,Oe)),w(this,De,v(this,$e)),w(this,Oe,void 0),w(this,$e,void 0))}};function Ye(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;S(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let n=e.hydrationRouteProperties||[],a=e.mapRouteProperties||Be,o=a;if(e.instrumentations){let t=e.instrumentations;o=e=>({...a(e),...Re(t.map(e=>e.route).filter(Boolean),e)})}let i={},l=new Je(j(e.routes,o,void 0,i)),s=e.basename||"/";s.startsWith("/")||(s=`/${s}`);let u,c,d,h=e.dataStrategy||it,f={...e.future},m=null,p=new Set,y=null,v=null,g=null,w=null,b=null!=e.hydrationData,E=H(l.activeRoutes,e.history.location,s,!1,l.branches),R=!1,k=null;if(null!=E||e.patchRoutesOnNavigation)if(E&&!e.hydrationData&&De(E,l.activeRoutes,e.history.location.pathname).active&&(E=null),E)if(E.some(e=>e.route.lazy))u=!1,c=!u;else if(E.some(e=>Ge(e.route))){let t=e.hydrationData?e.hydrationData.loaderData:null,r=e.hydrationData?e.hydrationData.errors:null,n=E;if(r){let e=E.findIndex(e=>void 0!==r[e.route.id]);n=n.slice(0,e+1)}c=!1,u=!0,n.forEach(e=>{let n=Ze(e.route,t,r);c=c||n.renderFallback,u=u&&!n.shouldLoad})}else u=!0,c=!u;else{u=!1,c=!u,E=[];let t=De(null,l.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(R=!0,E=t.matches)}else{let t=kt(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=xt(l.activeRoutes);u=!0,c=!u,E=r,k={[n.id]:t}}let T,O,$={historyAction:e.history.action,location:e.history.location,matches:E,initialized:u,renderFallback:c,navigation:ze,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||k,fetchers:new Map,blockers:new Map},A="POP",_=null,N=!1,z=!1,U=new Map,I=null,B=!1,W=!1,q=new Set,J=new Map,Y=0,V=-1,K=new Map,X=new Set,G=new Map,Z=new Map,Q=new Set,te=new Map,ne=null;function ae(e,t={}){e.matches&&(e.matches=e.matches.map(e=>{let t=i[e.route.id],r=e.route;return r.element!==t.element||r.errorElement!==t.errorElement||r.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e})),$={...$,...e};let r=[],n=[];$.fetchers.forEach((e,t)=>{"idle"===e.state&&(Q.has(t)?r.push(t):n.push(t))}),Q.forEach(e=>{$.fetchers.has(e)||J.has(e)||r.push(e)}),0===p.size&&(y={newErrors:e.errors??null}),[...p].forEach(n=>n($,{deletedFetchers:r,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync})),r.forEach(e=>me($.fetchers,e)),n.forEach(e=>$.fetchers.delete(e))}function oe(t,r,{flushSync:n}={}){let a,o=null!=$.actionData&&null!=$.navigation.formMethod&&At($.navigation.formMethod)&&"loading"===$.navigation.state&&!0!==t.state?._isRedirect;a=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:o?$.actionData:null;let i=r.loaderData?Et($.loaderData,r.loaderData,r.matches||[],r.errors):$.loaderData,s=$.blockers;s.size>0&&(s=new Map(s),s.forEach((e,t)=>s.set(t,Ie)));let u,c=!B&&Te(t,r.matches||$.matches),d=!0===N||null!=$.navigation.formMethod&&At($.navigation.formMethod)&&!0!==t.state?._isRedirect;if(l.commitHmrRoutes(),B||"POP"===A||("PUSH"===A?e.history.push(t,t.state):"REPLACE"===A&&e.history.replace(t,t.state)),"POP"===A){let e=U.get($.location.pathname);e&&e.has(t.pathname)?u={currentLocation:$.location,nextLocation:t}:U.has(t.pathname)&&(u={currentLocation:t,nextLocation:$.location})}else if(z){let e=U.get($.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),U.set($.location.pathname,e)),u={currentLocation:$.location,nextLocation:t}}ae({...r,actionData:a,loaderData:i,historyAction:A,location:t,initialized:!0,renderFallback:!1,navigation:ze,revalidation:"idle",restoreScrollPosition:c,preventScrollReset:d,blockers:s},{viewTransitionOpts:u,flushSync:!0===n}),A="POP",N=!1,z=!1,B=!1,W=!1,_?.resolve(),_=null,ne?.resolve(),ne=null}async function ie(t,r,a){T&&T.abort(),T=null,A=t,B=!0===(a&&a.startUninterruptedRevalidation),function(e,t){if(v&&w){let r=Pe(e,t);v[r]=w()}}($.location,$.matches),N=!0===(a&&a.preventScrollReset),z=!0===(a&&a.enableViewTransition);let u=l.activeRoutes,c=a?.initialHydration&&$.matches&&$.matches.length>0&&!R?$.matches:H(u,r,s,!1,l.branches),d=!0===(a&&a.flushSync);if(c&&$.initialized&&!W&&function(e,t){if(e.pathname!==t.pathname||e.search!==t.search)return!1;if(""===e.hash)return""!==t.hash;if(e.hash===t.hash)return!0;if(""!==t.hash)return!0;return!1}($.location,r)&&!(a&&a.submission&&At(a.submission.formMethod)))return void oe(r,{matches:c},{flushSync:d});let h=De(c,u,r.pathname);if(h.active&&h.matches&&(c=h.matches),!c){let{error:e,notFoundMatches:t,route:n}=Me(r.pathname);return void oe(r,{matches:t,loaderData:{},errors:{[n.id]:e}},{flushSync:d})}let f=a&&a.overrideNavigation?{...a.overrideNavigation,matches:c,historyAction:t}:void 0;T=new AbortController;let m,p=yt(e.history,r,T.signal,a&&a.submission),y=e.getContext?await e.getContext():new D;if(a&&a.pendingError)m=[St(c).route.id,{type:"error",error:a.pendingError}];else if(a&&a.submission&&At(a.submission.formMethod)){let u=await async function(t,r,a,u,c,d,h,f,m={}){if(de(),ae({navigation:Ft(r,u,c,a)},{flushSync:!0===m.flushSync}),h){let e=await Oe(u,r.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:r}=xt(l.activeRoutes);return{matches:t,pendingActionResult:[r.id,{type:"error",error:e.error}]}}let t=St(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:"error",error:e.error}]}}if(!e.matches){let{notFoundMatches:e,error:t,route:n}=Me(r.pathname);return{matches:e,pendingActionResult:[n.id,{type:"error",error:t}]}}u=e.matches}let p,y=_t(u,r);if(y.route.action||y.route.lazy){let e=await ue(t,r,dt(o,i,t,r,u,y,f?[]:n,d),d,null);if(p=e[y.route.id],!p)for(let t of u)if(e[t.route.id]){p=e[t.route.id];break}if(t.signal.aborted)return{shortCircuited:!0}}else p={type:"error",error:kt(405,{method:t.method,pathname:r.pathname,routeId:y.route.id})};if(Dt(p)){let r;return r=m&&null!=m.replace?m.replace:pt(p.response.headers.get("Location"),new URL(t.url),s,e.history)===$.location.pathname+$.location.search,await se(t,p,!0,{submission:a,replace:r}),{shortCircuited:!0}}if(Tt(p)){let e=St(u,y.route.id);return!0!==(m&&m.replace)&&(A="PUSH"),{matches:u,pendingActionResult:[e.route.id,p,y.route.id]}}return{matches:u,pendingActionResult:[y.route.id,p]}}(p,r,a.submission,c,t,y,h.active,a&&!0===a.initialHydration,{replace:a.replace,flushSync:d});if(u.shortCircuited)return;if(u.pendingActionResult){let[e,t]=u.pendingActionResult;if(Tt(t)&&ve(t.error)&&404===t.error.status)return T=null,void oe(r,{matches:u.matches,loaderData:{},errors:{[e]:t.error}})}c=u.matches||c,m=u.pendingActionResult,f=Ht(r,c,t,a.submission),d=!1,h.active=!1,p=yt(e.history,p.url,p.signal)}let{shortCircuited:g,matches:b,loaderData:E,errors:S,workingFetchers:x}=await async function(t,r,a,u,c,d,h,f,m,p,y,v,g,w){let b=h||Ht(r,a,u,f),E=f||m||Nt(b),R=!B&&!y;if(d){if(R){let e=le(g);ae({navigation:b,...void 0!==e?{actionData:e}:{}},{flushSync:v})}let e=await Oe(a,r.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:r}=xt(l.activeRoutes);return{matches:t,loaderData:{},errors:{[r.id]:e.error}}}let t=St(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(!e.matches){let{error:e,notFoundMatches:t,route:n}=Me(r.pathname);return{matches:t,loaderData:{},errors:{[n.id]:e}}}a=e.matches}let S=l.activeRoutes,{dsMatches:x,revalidatingFetchers:k}=Xe(t,c,o,i,e.history,$,a,E,r,y?[]:n,!0===y,W,q,Q,G,X,S,s,null!=e.patchRoutesOnNavigation,l.branches,g,w);if(V=++Y,!e.dataStrategy&&!x.some(e=>e.shouldLoad)&&!x.some(e=>e.route.middleware&&e.route.middleware.length>0)&&0===k.length){let e=new Map($.fetchers),t=we(e);return oe(r,{matches:a,loaderData:{},errors:g&&Tt(g[1])?{[g[0]]:g[1].error}:null,...Rt(g),...t?{fetchers:e}:{}},{flushSync:v}),{shortCircuited:!0}}if(R){let e={};if(!d){e.navigation=b;let t=le(g);void 0!==t&&(e.actionData=t)}k.length>0&&(e.fetchers=function(e){let t=new Map($.fetchers);return e.forEach(e=>{let r=t.get(e.key),n=zt(void 0,r?r.data:void 0);t.set(e.key,n)}),t}(k)),ae(e,{flushSync:v})}k.forEach(e=>{pe(e.key),e.controller&&J.set(e.key,e.controller)});let L=()=>k.forEach(e=>pe(e.key));T&&T.signal.addEventListener("abort",L);let{loaderResults:C,fetcherResults:M}=await ce(x,k,t,r,c);if(t.signal.aborted)return{shortCircuited:!0};T&&T.signal.removeEventListener("abort",L);k.forEach(e=>J.delete(e.key));let P=Lt(C);if(P)return await se(t,P.result,!0,{replace:p}),{shortCircuited:!0};if(P=Lt(M),P)return X.add(P.key),await se(t,P.result,!0,{replace:p}),{shortCircuited:!0};let D=new Map($.fetchers),{loaderData:O,errors:A}=bt($,a,C,g,k,M,D);y&&$.errors&&(A={...$.errors,...A});let j=we(D),_=be(V,D),N=j||_||k.length>0;return{matches:a,loaderData:O,errors:A,...N?{workingFetchers:D}:{}}}(p,r,c,t,y,h.active,f,a&&a.submission,a&&a.fetcherSubmission,a&&a.replace,a&&!0===a.initialHydration,d,m,a&&a.callSiteDefaultShouldRevalidate);g||(T=null,oe(r,{matches:b||c,...Rt(m),loaderData:E,errors:S,...x?{fetchers:x}:{}}))}function le(e){return e&&!Tt(e[1])?{[e[0]]:e[1].data}:$.actionData?0===Object.keys($.actionData).length?null:$.actionData:void 0}async function se(n,a,o,{submission:i,fetcherSubmission:l,preventScrollReset:u,replace:c}={}){o||(_?.resolve(),_=null),a.response.headers.has("X-Remix-Revalidate")&&(W=!0);let d=a.response.headers.get("Location");S(d,"Expected a Location header on the redirect Response"),d=pt(d,new URL(n.url),s,e.history);let h=L($.location,d,{_isRedirect:!0});if(r){let e=!1;if(a.response.headers.has("X-Remix-Reload-Document"))e=!0;else if(re(d)){const r=P(d,!0);e=r.origin!==t.location.origin||null==ee(r.pathname,s)}if(e)return void(c?t.location.replace(d):t.location.assign(d))}T=null;let f=!0===c||a.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:m,formAction:p,formEncType:y}=$.navigation;!i&&!l&&m&&p&&y&&(i=Nt($.navigation));let v=i||l;Fe.has(a.response.status)&&v&&At(v.formMethod)?await ie(f,h,{submission:{...v,formAction:d},preventScrollReset:u||N,enableViewTransition:o?z:void 0}):await ie(f,h,{overrideNavigation:Ht(h,[],f,i),fetcherSubmission:l,preventScrollReset:u||N,enableViewTransition:o?z:void 0})}async function ue(e,t,r,n,a){let o,i={};try{o=await async function(e,t,r,n,a,o,i){n.some(e=>e._lazyPromises?.middleware)&&await Promise.all(n.map(e=>e._lazyPromises?.middleware));let l={request:t,url:vt(t,r),pattern:ge(n),params:n[0].params,context:o,matches:n},s=i?()=>{throw new Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=l;return lt(t,()=>e({...t,fetcherKey:a,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},u=await e({...l,fetcherKey:a,runClientMiddleware:s});try{await Promise.all(n.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch(c){}return u}(h,e,t,r,a,n,!1)}catch(l){return r.filter(e=>e.shouldLoad).forEach(e=>{i[e.route.id]={type:"error",error:l}}),i}if(e.signal.aborted)return i;if(!At(e.method))for(let s of r){if("error"===o[s.route.id]?.type)break;o.hasOwnProperty(s.route.id)||$.loaderData.hasOwnProperty(s.route.id)||$.errors&&$.errors.hasOwnProperty(s.route.id)||!s.shouldCallHandler()||(o[s.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${s.route.id}`)})}for(let[u,c]of Object.entries(o))if(Pt(c)){let t=c.result;i[u]={type:"redirect",response:ft(t,e,u,r,s)}}else i[u]=await ht(c);return i}async function ce(e,t,r,n,a){let o=ue(r,n,e,a,null),i=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await ue(e.request,e.path,e.matches,a,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:"error",error:kt(404,{pathname:e.path})}})}));return{loaderResults:await o,fetcherResults:(await i).reduce((e,t)=>Object.assign(e,t),{})}}function de(){W=!0,G.forEach((e,t)=>{J.has(t)&&q.add(t),pe(t)})}function he(e,t,r={}){let n=new Map($.fetchers);n.set(e,t),ae({fetchers:n},{flushSync:!0===(r&&r.flushSync)})}function fe(e,t,r,n={}){let a=St($.matches,t),o=new Map($.fetchers);me(o,e),ae({errors:{[a.route.id]:r},fetchers:o},{flushSync:!0===(n&&n.flushSync)})}function me(e,t){let r=$.fetchers.get(t);!J.has(t)||r&&"loading"===r.state&&K.has(t)||pe(t),G.delete(t),K.delete(t),X.delete(t),Q.delete(t),q.delete(t),e.delete(t)}function pe(e,t){let r=J.get(e);r&&(r.abort(t),J.delete(e))}function ye(e,t){for(let r of e){let e=t.get(r);S(e,`Expected fetcher: ${r}`);let n=Ut(e.data);t.set(r,n)}}function we(e){let t=[],r=!1;for(let n of X){let a=e.get(n);S(a,`Expected fetcher: ${n}`),"loading"===a.state&&(X.delete(n),t.push(n),r=!0)}return ye(t,e),r}function be(e,t){let r=[];for(let[n,a]of K)if(a<e){let e=t.get(n);S(e,`Expected fetcher: ${n}`),"loading"===e.state&&(pe(n),K.delete(n),r.push(n))}return ye(r,t),r.length>0}function xe(e){$.blockers.delete(e),te.delete(e)}function ke(e,t){let r=$.blockers.get(e)||Ie;S("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($.blockers);n.set(e,t),ae({blockers:n})}function Ce({currentLocation:e,nextLocation:t,historyAction:r}){if(0===te.size)return;te.size>1&&x(!1,"A router only supports one blocker at a time");let n=Array.from(te.entries()),[a,o]=n[n.length-1],i=$.blockers.get(a);return i&&"proceeding"===i.state?void 0:o({currentLocation:e,nextLocation:t,historyAction:r})?a:void 0}function Me(e){let t=kt(404,{pathname:e}),r=l.activeRoutes,{matches:n,route:a}=xt(r);return{notFoundMatches:n,route:a,error:t}}function Pe(e,t){return g&&g(e,t.map(e=>F(e,$.loaderData)))||e.key}function Te(e,t){if(v){let r=Pe(e,t),n=v[r];if("number"==typeof n)return n}return null}function De(t,r,n){if(e.patchRoutesOnNavigation){let e=l.branches;if(!t)return{active:!0,matches:H(r,n,s,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:H(r,n,s,!0,e)}}return{active:!1,matches:null}}async function Oe(t,r,n,a){if(!e.patchRoutesOnNavigation)return{type:"success",matches:t};let u=t;for(;;){let t=i;try{await e.patchRoutesOnNavigation({signal:n,path:r,matches:u,fetcherKey:a,patch:(e,r)=>{n.aborted||et(e,r,l,t,o,!1)}})}catch(c){return{type:"error",error:c,partialMatches:u}}if(n.aborted)return{type:"aborted"};let d=l.branches,h=H(l.activeRoutes,r,s,!1,d),f=null;if(h){if(0===Object.keys(h[0].params).length)return{type:"success",matches:h};if(f=H(l.activeRoutes,r,s,!0,d),!(f&&u.length<f.length&&$e(u,f.slice(0,u.length))))return{type:"success",matches:h}}if(f||(f=H(l.activeRoutes,r,s,!0,d)),!f||$e(u,f))return{type:"success",matches:null};u=f}}function $e(e,t){return e.length===t.length&&e.every((e,r)=>e.route.id===t[r].route.id)}return d={get basename(){return s},get future(){return f},get state(){return $},get routes(){return l.stableRoutes},get branches(){return l.branches},get manifest(){return i},get window(){return t},initialize:function(){if(m=e.history.listen(({action:t,location:r,delta:n})=>{if(O)return O(),void(O=void 0);x(0===te.size||null!=n,"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=Ce({currentLocation:$.location,nextLocation:r,historyAction:t});if(a&&null!=n){let t=new Promise(e=>{O=e});return e.history.go(-1*n),ke(a,{state:"blocked",location:r,proceed(){ke(a,{state:"proceeding",proceed:void 0,reset:void 0,location:r}),t.then(()=>e.history.go(n))},reset(){let e=new Map($.blockers);e.set(a,Ie),ae({blockers:e})}}),_?.resolve(),void(_=null)}return ie(t,r)}),r){!function(e,t){try{let r=e.sessionStorage.getItem(We);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(r){}}(t,U);let e=()=>function(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(We,JSON.stringify(n))}catch(r){x(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}(t,U);t.addEventListener("pagehide",e),I=()=>t.removeEventListener("pagehide",e)}return $.initialized||ie("POP",$.location,{initialHydration:!0}),d},subscribe:function(e){if(p.add(e),y){let{newErrors:t}=y;y=null,e($,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>p.delete(e)},enableScrollRestoration:function(e,t,r){if(v=e,w=t,g=r||null,!b&&$.navigation===ze){b=!0;let e=Te($.location,$.matches);null!=e&&ae({restoreScrollPosition:e})}return()=>{v=null,w=null,g=null}},navigate:async function t(r,n){if(_?.resolve(),_=null,"number"==typeof r){_||(_=It());let t=_.promise;return e.history.go(r),t}let a,{path:o,submission:i,error:l}=Ke(!1,Ve($.location,$.matches,s,r,n?.fromRouteId,n?.relative),n);n?.mask&&(a={pathname:"",search:"",hash:"",..."string"==typeof n.mask?M(n.mask):{...$.location.mask,...n.mask}});let u=$.location,c=L(u,o,n&&n.state,void 0,a);c={...c,...e.history.encodeLocation(c)};let d=n&&null!=n.replace?n.replace:void 0,h="PUSH";!0===d?h="REPLACE":!1===d||null!=i&&At(i.formMethod)&&i.formAction===$.location.pathname+$.location.search&&(h="REPLACE");let f=n&&"preventScrollReset"in n?!0===n.preventScrollReset:void 0,m=!0===(n&&n.flushSync),p=Ce({currentLocation:u,nextLocation:c,historyAction:h});p?ke(p,{state:"blocked",location:c,proceed(){ke(p,{state:"proceeding",proceed:void 0,reset:void 0,location:c}),t(r,n)},reset(){let e=new Map($.blockers);e.set(p,Ie),ae({blockers:e})}}):await ie(h,c,{submission:i,pendingError:l,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:m,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})},fetch:async function(t,r,a,u){pe(t);let c=!0===(u&&u.flushSync),d=l.activeRoutes,h=Ve($.location,$.matches,s,a,r,u?.relative),f=H(d,h,s,!1,l.branches),m=De(f,d,h);if(m.active&&m.matches&&(f=m.matches),!f)return void fe(t,r,kt(404,{pathname:h}),{flushSync:c});let{path:p,submission:y,error:v}=Ke(!0,h,u);if(v)return void fe(t,r,v,{flushSync:c});let g=e.getContext?await e.getContext():new D,w=!0===(u&&u.preventScrollReset);y&&At(y.formMethod)?await async function(t,r,a,u,c,d,h,f,m,p){de(),G.delete(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}}(m,$.fetchers.get(t)),{flushSync:h});let y=new AbortController,v=yt(e.history,a,y.signal,m);if(d){let e=await Oe(u,new URL(v.url).pathname,v.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void fe(t,r,e.error,{flushSync:h});if(!e.matches)return void fe(t,r,kt(404,{pathname:a}),{flushSync:h});u=e.matches}let g=_t(u,a);if(!g.route.action&&!g.route.lazy)return void fe(t,r,kt(405,{method:m.formMethod,pathname:a,routeId:r}),{flushSync:h});J.set(t,y);let w=Y,b=dt(o,i,v,a,u,g,n,c),E=await ue(v,a,b,c,t),R=E[g.route.id];if(!R)for(let e of b)if(E[e.route.id]){R=E[e.route.id];break}if(v.signal.aborted)return void(J.get(t)===y&&J.delete(t));if(Q.has(t)){if(Dt(R)||Tt(R))return void he(t,Ut(void 0))}else{if(Dt(R))return J.delete(t),V>w?void he(t,Ut(void 0)):(X.add(t),he(t,zt(m)),se(v,R,!1,{fetcherSubmission:m,preventScrollReset:f}));if(Tt(R))return void fe(t,r,R.error)}let x=$.navigation.location||$.location,k=yt(e.history,x,y.signal),L=l.activeRoutes,C="idle"!==$.navigation.state?H(L,$.navigation.location,s,!1,l.branches):$.matches;S(C,"Didn't find any matches after fetcher action");let M=++Y;K.set(t,M);let{dsMatches:P,revalidatingFetchers:D}=Xe(k,c,o,i,e.history,$,C,m,x,n,!1,W,q,Q,G,X,L,s,null!=e.patchRoutesOnNavigation,l.branches,[g.route.id,R],p),O=zt(m,R.data),j=new Map($.fetchers);j.set(t,O),D.filter(e=>e.key!==t).forEach(e=>{let t=e.key,r=j.get(t),n=zt(void 0,r?r.data:void 0);j.set(t,n),pe(t),e.controller&&J.set(t,e.controller)}),ae({fetchers:j});let _=()=>D.forEach(e=>pe(e.key));y.signal.addEventListener("abort",_);let{loaderResults:N,fetcherResults:F}=await ce(P,D,k,x,c);if(y.signal.aborted)return;y.signal.removeEventListener("abort",_),K.delete(t),J.delete(t),D.forEach(e=>J.delete(e.key));let z=$.fetchers.has(t),U=e=>{if(!z)return e;let r=new Map(e.fetchers);return r.set(t,Ut(R.data)),{...e,fetchers:r}},I=Lt(N);if(I)return $=U($),se(k,I.result,!1,{preventScrollReset:f});if(I=Lt(F),I)return X.add(I.key),$=U($),se(k,I.result,!1,{preventScrollReset:f});let B=new Map($.fetchers);z&&B.set(t,Ut(R.data));let{loaderData:Z,errors:ee}=bt($,C,N,void 0,D,F,B);be(M,B),"loading"===$.navigation.state&&M>V?(S(A,"Expected pending action"),T&&T.abort(),oe($.navigation.location,{matches:C,loaderData:Z,errors:ee,fetchers:B})):(ae({errors:ee,loaderData:Et($.loaderData,Z,C,ee),fetchers:B}),W=!1)}(t,r,p,f,g,m.active,c,w,y,u&&u.defaultShouldRevalidate):(G.set(t,{routeId:r,path:p}),await async function(t,r,a,l,s,u,c,d,h){let f=$.fetchers.get(t);he(t,zt(h,f?f.data:void 0),{flushSync:c});let m=new AbortController,p=yt(e.history,a,m.signal);if(u){let e=await Oe(l,new URL(p.url).pathname,p.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void fe(t,r,e.error,{flushSync:c});if(!e.matches)return void fe(t,r,kt(404,{pathname:a}),{flushSync:c});l=e.matches}let y=_t(l,a);J.set(t,m);let v=Y,g=await ue(p,a,dt(o,i,p,a,l,y,n,s),s,t),w=g[y.route.id];if(!w)for(let e of l)if(g[e.route.id]){w=g[e.route.id];break}J.get(t)===m&&J.delete(t);if(p.signal.aborted)return;if(Q.has(t))return void he(t,Ut(void 0));if(Dt(w))return V>v?void he(t,Ut(void 0)):(X.add(t),void(await se(p,w,!1,{preventScrollReset:d})));if(Tt(w))return void fe(t,r,w.error);he(t,Ut(w.data))}(t,r,p,f,g,m.active,c,w,y))},revalidate:function(){ne||(ne=It()),de(),ae({revalidation:"loading"});let e=ne.promise;return"submitting"===$.navigation.state?e:"idle"===$.navigation.state?(ie($.historyAction,$.location,{startUninterruptedRevalidation:!0}),e):(ie(A||$.historyAction,$.navigation.location,{overrideNavigation:$.navigation,enableViewTransition:!0===z}),e)},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:function(e){return Z.set(e,(Z.get(e)||0)+1),Q.has(e)&&Q.delete(e),$.fetchers.get(e)||Ue},resetFetcher:function(e,t){pe(e,t?.reason),he(e,Ut(null))},deleteFetcher:function(e){let t=(Z.get(e)||0)-1;t<=0?(Z.delete(e),Q.add(e)):Z.set(e,t),ae({fetchers:new Map($.fetchers)})},dispose:function(){m&&m(),I&&I(),p.clear(),T&&T.abort(),$.fetchers.forEach((e,t)=>me($.fetchers,t)),$.blockers.forEach((e,t)=>xe(t))},getBlocker:function(e,t){let r=$.blockers.get(e)||Ie;return te.get(e)!==t&&te.set(e,t),r},deleteBlocker:xe,patchRoutes:function(e,t,r=!1){et(e,t,l,i,o,r),l.hasHMRRoutes||ae({})},_internalFetchControllers:J,_internalSetRoutes:function(e){i={},l.setHmrRoutes(j(e,o,void 0,i))},_internalSetStateDoNotUseOrYouWillBreakYourApp(e){ae(e)}},e.instrumentations&&(d=function(e,t){let r={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let n of t)e[n]&&r[n].push(e[n])}})),r.navigate.length>0){let t=e.navigate[Ee]??e.navigate,n=Se(r.navigate,t,(...t)=>{let[r,n]=t;return{to:"number"==typeof r||"string"==typeof r?r:r?C(r):".",...Le(e,n??{})}});n&&(n[Ee]=t,e.navigate=n)}if(r.fetch.length>0){let t=e.fetch[Ee]??e.fetch,n=Se(r.fetch,t,(...t)=>{let[r,,n,a]=t;return{href:n??".",fetcherKey:r,...Le(e,a??{})}});n&&(n[Ee]=t,e.fetch=n)}return e}(d,e.instrumentations.map(e=>e.router).filter(Boolean))),d}function Ve(e,t,r,n,a,o){let i,l;if(a){i=[];for(let e of t)if(i.push(e),e.route.id===a){l=e;break}}else i=t,l=t[t.length-1];let s=le(n||".",ie(i),ee(e.pathname,r)||e.pathname,"path"===o);if(null==n&&(s.search=e.search,s.hash=e.hash),(null==n||""===n||"."===n)&&l){let e=jt(s.search);if(l.route.index&&!e)s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&e){let e=new URLSearchParams(s.search),t=e.getAll("index");e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let r=e.toString();s.search=r?`?${r}`:""}}return"/"!==r&&(s.pathname=function({basename:e,pathname:t}){return"/"===t?e:ue([e,t])}({basename:r,pathname:s.pathname})),C(s)}function Ke(e,t,r){if(!r||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(r))return{path:t};if(r.formMethod&&(n=r.formMethod,!Ne.has(n.toUpperCase())))return{path:t,error:kt(405,{method:r.formMethod})};var n;let a,o,i=()=>({path:t,error:kt(400,{type:"invalid-body"})}),l=(r.formMethod||"get").toUpperCase(),s=Ct(t);if(void 0!==r.body){if("text/plain"===r.formEncType){if(!At(l))return i();let e="string"==typeof r.body?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((e,[t,r])=>`${e}${t}=${r}\n`,""):String(r.body);return{path:t,submission:{formMethod:l,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===r.formEncType){if(!At(l))return i();try{let e="string"==typeof r.body?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:l,formAction:s,formEncType:r.formEncType,formData:void 0,json:e,text:void 0}}}catch(d){return i()}}}if(S("function"==typeof FormData,"FormData is not available in this environment"),r.formData)a=gt(r.formData),o=r.formData;else if(r.body instanceof FormData)a=gt(r.body),o=r.body;else if(r.body instanceof URLSearchParams)a=r.body,o=wt(a);else if(null==r.body)a=new URLSearchParams,o=new FormData;else try{a=new URLSearchParams(r.body),o=wt(a)}catch(d){return i()}let u={formMethod:l,formAction:s,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:o,json:void 0,text:void 0};if(At(u.formMethod))return{path:t,submission:u};let c=M(t);return e&&c.search&&jt(c.search)&&a.append("index",""),c.search=`?${a}`,{path:C(c),submission:u}}function Xe(e,t,r,n,a,o,i,l,s,u,c,d,h,f,m,p,y,v,g,w,b,E){let R,S=b?Tt(b[1])?b[1].error:b[1].data:void 0,x=a.createURL(o.location),k=a.createURL(s);if(c&&o.errors){let e=Object.keys(o.errors)[0];R=i.findIndex(t=>t.route.id===e)}else if(b&&Tt(b[1])){let e=b[0];R=i.findIndex(t=>t.route.id===e)-1}let L=b?b[1].statusCode:void 0,C=L&&L>=400,M={currentUrl:x,currentParams:o.matches[0]?.params||{},nextUrl:k,nextParams:i[0].params,...l,actionResult:S,actionStatus:L},P=ge(i),T=i.map((a,i)=>{let{route:l}=a,h=null;if(null!=R&&i>R)h=!1;else if(l.lazy)h=!0;else if(Ge(l))if(c){let{shouldLoad:e}=Ze(l,o.loaderData,o.errors);h=e}else(function(e,t,r){let n=!t||r.route.id!==t.route.id,a=!e.hasOwnProperty(r.route.id);return n||a})(o.loaderData,o.matches[i],a)&&(h=!0);else h=!1;if(null!==h)return ct(r,n,e,s,P,a,u,t,h);let f=!1;"boolean"==typeof E?f=E:C?f=!1:(d||x.pathname+x.search===k.pathname+k.search||x.search!==k.search||function(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}(o.matches[i],a))&&(f=!0);let m={...M,defaultShouldRevalidate:f};return ct(r,n,e,s,P,a,u,t,Qe(a,m),m,E)}),D=[];return m.forEach((e,l)=>{if(c||!i.some(t=>t.route.id===e.routeId)||f.has(l))return;let s=o.fetchers.get(l),m=s&&"idle"!==s.state&&void 0===s.data,b=H(y,e.path,v??"/",!1,w);if(!b){if(g&&m)return;return void D.push({key:l,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null})}if(p.has(l))return;let R=_t(b,e.path),S=new AbortController,x=yt(a,e.path,S.signal),k=null;if(h.has(l))h.delete(l),k=dt(r,n,x,e.path,b,R,u,t);else if(m)d&&(k=dt(r,n,x,e.path,b,R,u,t));else{let a;a="boolean"==typeof E?E:!C&&d;let o={...M,defaultShouldRevalidate:a};Qe(R,o)&&(k=dt(r,n,x,e.path,b,R,u,t,o))}k&&D.push({key:l,routeId:e.routeId,path:e.path,matches:k,match:R,request:x,controller:S})}),{dsMatches:T,revalidatingFetchers:D}}function Ge(e){return null!=e.loader||null!=e.middleware&&e.middleware.length>0}function Ze(e,t,r){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Ge(e))return{shouldLoad:!1,renderFallback:!1};let n=null!=t&&e.id in t,a=null!=r&&void 0!==r[e.id];if(!n&&a)return{shouldLoad:!1,renderFallback:!1};if("function"==typeof e.loader&&!0===e.loader.hydrate)return{shouldLoad:!0,renderFallback:!n};let o=!n&&!a;return{shouldLoad:o,renderFallback:o}}function Qe(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}function et(e,t,r,n,a,o){let i;if(e){let t=n[e];S(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),i=t.children}else i=r.activeRoutes;let l=[],s=[];if(t.forEach(e=>{let t=i.find(t=>tt(e,t));t?s.push({existingRoute:t,newRoute:e}):l.push(e)}),l.length>0){let t=j(l,a,[e||"_","patch",String(i?.length||"0")],n);i.push(...t)}if(o&&s.length>0)for(let u=0;u<s.length;u++){let{existingRoute:e,newRoute:t}=s[u],r=e,[n]=j([t],a,[],{},!0);Object.assign(r,{element:n.element?n.element:r.element,errorElement:n.errorElement?n.errorElement:r.errorElement,hydrateFallbackElement:n.hydrateFallbackElement?n.hydrateFallbackElement:r.hydrateFallbackElement})}r.hasHMRRoutes||r.setRoutes([...r.activeRoutes])}function tt(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)=>t.children?.some(t=>tt(e,t)))??!1))}Te=new WeakMap,De=new WeakMap,Oe=new WeakMap,$e=new WeakMap;var rt=new WeakMap,nt=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let a=r[t.id];if(S(a,"No route found in manifest"),!a.lazy||"object"!=typeof a.lazy)return;let o=a.lazy[e];if(!o)return;let i=rt.get(a);i||(i={},rt.set(a,i));let l=i[e];if(l)return l;let s=(async()=>{let t=function(e){return O.has(e)}(e),r=void 0!==a[e]&&"hasErrorBoundary"!==e;if(t)x(!t,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(r)x(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await o();null!=t&&(Object.assign(a,{[e]:t}),Object.assign(a,n(a)))}"object"==typeof a.lazy&&(a.lazy[e]=void 0,Object.values(a.lazy).every(e=>void 0===e)&&(a.lazy=void 0))})();return i[e]=s,s},at=new WeakMap;async function ot(e){let t=e.matches.filter(e=>e.shouldLoad),r={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,n)=>{r[t[n].route.id]=e}),r}async function it(e){return e.matches.some(e=>e.route.middleware)?lt(e,()=>ot(e)):ot(e)}function lt(e,t){return async function(e,t,r,n,a){let{matches:o,...i}=e;return await st(i,o.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,r,n,a)}(e,t,e=>{if($t(t=e)&&(r=t.status,He.has(r))&&t.headers.has("Location"))throw e;var t,r;return e},Mt,function(t,r,n){if(n)return Promise.resolve(Object.assign(n.value,{[r]:{type:"error",result:t}}));{let{matches:n}=e,a=St(n,n[Math.min(Math.max(n.findIndex(e=>e.route.id===r),0),Math.max(n.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[a]:{type:"error",result:t}})}})}async function st(e,t,r,n,a,o,i=0){let{request:l}=e;if(l.signal.aborted)throw l.signal.reason??new Error(`Request aborted: ${l.method} ${l.url}`);let s=t[i];if(!s)return await r();let u,[c,d]=s,h=async()=>{if(u)throw new Error("You may only call `next()` once per middleware");try{return u={value:await st(e,t,r,n,a,o,i+1)},u.value}catch(l){return u={value:await o(l,c,u)},u.value}};try{let t=await d(e,h),r=null!=t?n(t):void 0;return a(r)?r:u?r??u.value:(u={value:await h()},u.value)}catch(f){return await o(f,c,u)}}function ut(e,t,r,n,a){let o=nt({key:"middleware",route:n.route,manifest:t,mapRouteProperties:e}),i=function(e,t,r,n,a){let o=r[e.id];if(S(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if("function"==typeof e.lazy){let t=at.get(o);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let r=(async()=>{S("function"==typeof e.lazy,"No lazy route function found");let t=await e.lazy(),r={};for(let e in t){let n=t[e];if(void 0===n)continue;let a=A(e),i=void 0!==o[e]&&"hasErrorBoundary"!==e;a?x(!a,"Route property "+e+" is not a supported property to be returned from a lazy route function. This property will be ignored."):i?x(!i,`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.`):r[e]=n}Object.assign(o,r),Object.assign(o,{...n(o),lazy:void 0})})();return at.set(o,r),r.catch(()=>{}),{lazyRoutePromise:r,lazyHandlerPromise:r}}let i,l=Object.keys(e.lazy),s=[];for(let c of l){if(a&&a.includes(c))continue;let o=nt({key:c,route:e,manifest:r,mapRouteProperties:n});o&&(s.push(o),c===t&&(i=o))}let u=s.length>0?Promise.all(s).then(()=>{}):void 0;return u?.catch(()=>{}),i?.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:i}}(n.route,At(r.method)?"action":"loader",t,e,a);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function ct(e,t,r,n,a,o,i,l,s,u=null,c){let d=!1,h=ut(e,t,r,o,i);return{...o,_lazyPromises:h,shouldLoad:s,shouldRevalidateArgs:u,shouldCallHandler:e=>(d=!0,u?Qe(o,"boolean"==typeof c?{...u,defaultShouldRevalidate:c}:"boolean"==typeof e?{...u,defaultShouldRevalidate:e}:u):s),resolve(e){let{lazy:t,loader:i,middleware:u}=o.route,c=d||s||e&&!At(r.method)&&(t||i),f=u&&u.length>0&&!i&&!t;return!c||!At(r.method)&&f?Promise.resolve({type:"data",result:void 0}):async function({request:e,path:t,pattern:r,match:n,lazyHandlerPromise:a,lazyRoutePromise:o,handlerOverride:i,scopedContext:l}){let s,u,c=At(e.method),d=c?"action":"loader",h=a=>{let o,s=new Promise((e,t)=>o=t);u=()=>o(),e.signal.addEventListener("abort",u);let c=o=>"function"!=typeof a?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${n.route.id}]`)):a({request:e,url:vt(e,t),pattern:r,params:n.params,context:l},...void 0!==o?[o]:[]),h=(async()=>{try{return{type:"data",result:await(i?i(e=>c(e)):c())}}catch(e){return{type:"error",result:e}}})();return Promise.race([h,s])};try{let t=c?n.route.action:n.route.loader;if(a||o)if(t){let e,[r]=await Promise.all([h(t).catch(t=>{e=t}),a,o]);if(void 0!==e)throw e;s=r}else{await a;let t=c?n.route.action:n.route.loader;if(!t){if("action"===d){let t=new URL(e.url),r=t.pathname+t.search;throw kt(405,{method:e.method,pathname:r,routeId:n.route.id})}return{type:"data",result:void 0}}[s]=await Promise.all([h(t),o])}else{if(!t){let t=new URL(e.url);throw kt(404,{pathname:t.pathname+t.search})}s=await h(t)}}catch(f){return{type:"error",result:f}}finally{u&&e.signal.removeEventListener("abort",u)}return s}({request:r,path:n,pattern:a,match:o,lazyHandlerPromise:h?.handler,lazyRoutePromise:h?.route,handlerOverride:e,scopedContext:l})}}}function dt(e,t,r,n,a,o,i,l,s=null){return a.map(u=>u.route.id!==o.route.id?{...u,shouldLoad:!1,shouldRevalidateArgs:s,shouldCallHandler:()=>!1,_lazyPromises:ut(e,t,r,u,i),resolve:()=>Promise.resolve({type:"data",result:void 0})}:ct(e,t,r,n,ge(a),u,i,l,!0,s))}async function ht(e){let{result:t,type:r}=e;if($t(t)){let e;try{e=await async function(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?null==e.body?null:e.json():e.text()}(t)}catch(a){return{type:"error",error:a}}return"error"===r?{type:"error",error:new ye(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:"data",data:e,statusCode:t.status,headers:t.headers}}return"error"===r?Ot(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:(n=t,new ye(n.init?.status??500,n.init?.statusText??"Internal Server Error",n.data)),statusCode:ve(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:ve(t)?t.status:void 0}:Ot(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t};var n}function ft(e,t,r,n,a){let o=e.headers.get("Location");if(S(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!re(o)){let i=n.slice(0,n.findIndex(e=>e.route.id===r)+1);o=Ve(new URL(t.url),i,a,o),e.headers.set("Location",o)}return e}var mt=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function pt(e,t,r,n){if(re(e)){let n=e,a=n.startsWith("//")?new URL(t.protocol+n):new URL(n);if(mt.includes(a.protocol))throw new Error("Invalid redirect location");let o=null!=ee(a.pathname,r);if(a.origin===t.origin&&o)return se(a.pathname)+a.search+a.hash}try{let t=n.createURL(e);if(mt.includes(t.protocol))throw new Error("Invalid redirect location")}catch(a){}return e}function yt(e,t,r,n){let a=e.createURL(Ct(t)).toString(),o={signal:r};if(n&&At(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=gt(n.formData):o.body=n.formData}return new Request(a,o)}function vt(e,t){let r=new URL(e.url),n="string"==typeof t?M(t):t;if(r.pathname=n.pathname||"/",n.search){let e=new URLSearchParams(n.search),t=e.getAll("index");e.delete("index");for(let r of t.filter(Boolean))e.append("index",r);r.search=e.size?`?${e.toString()}`:""}else r.search="";return r.hash=n.hash||"",r}function gt(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function wt(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function bt(e,t,r,n,a,o,i){let{loaderData:l,errors:s}=function(e,t,r,n=!1,a=!1){let o,i={},l=null,s=!1,u={},c=r&&Tt(r[1])?r[1].error:void 0;return e.forEach(r=>{if(!(r.route.id in t))return;let d=r.route.id,h=t[d];if(S(!Dt(h),"Cannot handle redirect results in processLoaderData"),Tt(h)){let t=h.error;if(void 0!==c&&(t=c,c=void 0),l=l||{},a)l[d]=t;else{let r=St(e,d);null==l[r.route.id]&&(l[r.route.id]=t)}n||(i[d]=qe),s||(s=!0,o=ve(h.error)?h.error.status:500),h.headers&&(u[d]=h.headers)}else i[d]=h.data,h.statusCode&&200!==h.statusCode&&!s&&(o=h.statusCode),h.headers&&(u[d]=h.headers)}),void 0!==c&&r&&(l={[r[0]]:c},r[2]&&(i[r[2]]=void 0)),{loaderData:i,errors:l,statusCode:o||200,loaderHeaders:u}}(t,r,n);return a.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:r,match:n,controller:a}=t;if(a&&a.signal.aborted)return;let l=o[r];if(S(l,"Did not find corresponding fetcher result"),Tt(l)){let t=St(e.matches,n?.route.id);s&&s[t.route.id]||(s={...s,[t.route.id]:l.error}),i.delete(r)}else if(Dt(l))S(!1,"Unhandled fetcher revalidation redirect");else{let e=Ut(l.data);i.set(r,e)}}),{loaderData:l,errors:s}}function Et(e,t,r,n){let a=Object.entries(t).filter(([,e])=>e!==qe).reduce((e,[t,r])=>(e[t]=r,e),{});for(let o of r){let r=o.route.id;if(!t.hasOwnProperty(r)&&e.hasOwnProperty(r)&&o.route.loader&&(a[r]=e[r]),n&&n.hasOwnProperty(r))break}return a}function Rt(e){return e?Tt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function St(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 xt(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 kt(e,{pathname:t,routeId:r,method:n,type:a,message:o}={}){let i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",n&&t&&r?l=`You made a ${n} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:"invalid-body"===a&&(l="Unable to encode submission body")):403===e?(i="Forbidden",l=`Route "${r}" does not match URL "${t}"`):404===e?(i="Not Found",l=`No route matches URL "${t}"`):405===e&&(i="Method Not Allowed",n&&t&&r?l=`You made a ${n.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(l=`Invalid request method "${n.toUpperCase()}"`)),new ye(e||500,i,new Error(l),!0)}function Lt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[e,n]=t[r];if(Dt(n))return{key:e,result:n}}}function Ct(e){return C({..."string"==typeof e?M(e):e,hash:""})}function Mt(e){return null!=e&&"object"==typeof e&&Object.entries(e).every(([e,t])=>"string"==typeof e&&function(e){return null!=e&&"object"==typeof e&&"type"in e&&"result"in e&&("data"===e.type||"error"===e.type)}(t))}function Pt(e){return $t(e.result)&&He.has(e.result.status)}function Tt(e){return"error"===e.type}function Dt(e){return"redirect"===(e&&e.type)}function Ot(e){return"object"==typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function $t(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function At(e){return je.has(e.toUpperCase())}function jt(e){return new URLSearchParams(e).getAll("index").some(e=>""===e)}function _t(e,t){let r="string"==typeof t?M(t).search:t.search;if(e[e.length-1].route.index&&jt(r||""))return e[e.length-1];let n=oe(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 Ht(e,t,r,n){return n?{state:"loading",location:e,matches:t,historyAction:r,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}:{state:"loading",location:e,matches:t,historyAction:r,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Ft(e,t,r,n){return{state:"submitting",location:e,matches:t,historyAction:r,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}}function zt(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 Ut(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 It(){let e,t,r=new Promise((n,a)=>{e=async e=>{n(e);try{await r}catch(t){}},t=async e=>{a(e);try{await r}catch(t){}}});return{promise:r,resolve:e,reject:t}}var Bt=h.createContext(null);Bt.displayName="DataRouter";var Wt=h.createContext(null);Wt.displayName="DataRouterState";var qt=h.createContext(!1);function Jt(){return h.useContext(qt)}var Yt=h.createContext({isTransitioning:!1});Yt.displayName="ViewTransition";var Vt=h.createContext(new Map);Vt.displayName="Fetchers";var Kt=h.createContext(null);Kt.displayName="Await";var Xt=h.createContext(null);Xt.displayName="Navigation";var Gt=h.createContext(null);Gt.displayName="Location";var Zt=h.createContext({outlet:null,matches:[],isDataRoute:!1});Zt.displayName="Route";var Qt=h.createContext(null);Qt.displayName="RouteError";var er="REACT_ROUTER_ERROR";function tr(){return null!=h.useContext(Gt)}function rr(){return S(tr(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(Gt).location}var nr="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ar(e){h.useContext(Xt).static||h.useLayoutEffect(e)}function or(){let{isDataRoute:e}=h.useContext(Zt);return e?function(){let{router:e}=function(e){let t=h.useContext(Bt);return S(t,vr(e)),t}("useNavigate"),t=wr("useNavigate"),r=h.useRef(!1);return ar(()=>{r.current=!0}),h.useCallback(async(n,a={})=>{x(r.current,nr),r.current&&("number"==typeof n?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...a}))},[e,t])}():function(){S(tr(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(Bt),{basename:t,navigator:r}=h.useContext(Xt),{matches:n}=h.useContext(Zt),{pathname:a}=rr(),o=JSON.stringify(ie(n)),i=h.useRef(!1);return ar(()=>{i.current=!0}),h.useCallback((n,l={})=>{if(x(i.current,nr),!i.current)return;if("number"==typeof n)return void r.go(n);let s=le(n,JSON.parse(o),a,"path"===l.relative);null==e&&"/"!==t&&(s.pathname="/"===s.pathname?t:ue([t,s.pathname])),(l.replace?r.replace:r.push)(s,l.state,l)},[t,r,o,a,e])}()}var ir=h.createContext(null);function lr(){return h.useContext(ir)}function sr(){let{matches:e}=h.useContext(Zt);return e[e.length-1]?.params??{}}function ur(e,{relative:t}={}){let{matches:r}=h.useContext(Zt),{pathname:n}=rr(),a=JSON.stringify(ie(r));return h.useMemo(()=>le(e,JSON.parse(a),n,"path"===t),[e,a,n,t])}function cr(e,t,r){S(tr(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=h.useContext(Xt),{matches:a}=h.useContext(Zt),o=a[a.length-1],i=o?o.params:{},l=o?o.pathname:"/",s=o?o.pathnameBase:"/",u=o&&o.route;{let e=u&&u.path||"";kr(l,!u||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}let c,d=rr();if(t){let e="string"==typeof t?M(t):t;S("/"===s||e.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`),c=e}else c=d;let f=c.pathname||"/",m=f;if("/"!==s){let e=s.replace(/^\//,"").split("/");m="/"+f.replace(/^\//,"").split("/").slice(e.length).join("/")}let p=r&&r.state.matches.length?r.state.matches.map(e=>Object.assign(e,{route:r.manifest[e.route.id]||e.route})):N(e,{pathname:m});x(u||null!=p,`No routes matched location "${c.pathname}${c.search}${c.hash}" `),x(null==p||void 0!==p[p.length-1].route.element||void 0!==p[p.length-1].route.Component||void 0!==p[p.length-1].route.lazy,`Matched leaf route at location "${c.pathname}${c.search}${c.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let y=function(e,t=[],r){let n=r?.state;if(null==e){if(!n)return null;if(n.errors)e=n.matches;else{if(0!==t.length||n.initialized||!(n.matches.length>0))return null;e=n.matches}}let a=e,o=n?.errors;if(null!=o){let e=a.findIndex(e=>e.route.id&&void 0!==o?.[e.route.id]);S(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),a=a.slice(0,Math.min(a.length,e+1))}let i=!1,l=-1;if(r&&n){i=n.renderFallback;for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(l=e),t.route.id){let{loaderData:e,errors:o}=n,s=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!o||void 0===o[t.route.id]);if(t.route.lazy||s){r.isStatic&&(i=!0),a=l>=0?a.slice(0,l+1):[a[0]];break}}}}let s=r?.onError,u=n&&s?(e,t)=>{s(e,{location:n.location,params:n.matches?.[0]?.params??{},pattern:ge(n.matches),errorInfo:t})}:void 0;return a.reduceRight((e,r,s)=>{let c,d=!1,f=null,m=null;n&&(c=o&&r.route.id?o[r.route.id]:void 0,f=r.route.errorElement||hr,i&&(l<0&&0===s?(kr("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,m=null):l===s&&(d=!0,m=r.route.hydrateFallbackElement||null)));let p=t.concat(a.slice(0,s+1)),y=()=>{let t;return t=c?f:d?m:r.route.Component?h.createElement(r.route.Component,null):r.route.element?r.route.element:e,h.createElement(yr,{match:r,routeContext:{outlet:e,matches:p,isDataRoute:null!=n},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===s)?h.createElement(fr,{location:n.location,revalidation:n.revalidation,component:f,error:c,children:y(),routeContext:{outlet:null,matches:p,isDataRoute:!0},onError:u}):y()},null)}(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},i,e.params),pathname:ue([s,n.encodeLocation?n.encodeLocation(e.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?s:ue([s,n.encodeLocation?n.encodeLocation(e.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])})),a,r);return t&&y?h.createElement(Gt.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...c},navigationType:"POP"}},y):y}function dr(){let e=Sr(),t=ve(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},o={padding:"2px 4px",backgroundColor:n},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:o},"ErrorBoundary")," or"," ",h.createElement("code",{style:o},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),r?h.createElement("pre",{style:a},r):null,i)}var hr=h.createElement(dr,null),fr=class extends h.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){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&"object"==typeof e&&e&&"digest"in e&&"string"==typeof e.digest){const t=function(e){if(e.startsWith(`${er}:ROUTE_ERROR_RESPONSE:{`))try{let t=JSON.parse(e.slice(40));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText)return new ye(t.status,t.statusText,t.data)}catch{}}(e.digest);t&&(e=t)}let t=void 0!==e?h.createElement(Zt.Provider,{value:this.props.routeContext},h.createElement(Qt.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?h.createElement(pr,{error:e},t):t}};fr.contextType=qt;var mr=new WeakMap;function pr({children:e,error:t}){let{basename:r}=h.useContext(Xt);if("object"==typeof t&&t&&"digest"in t&&"string"==typeof t.digest){let e=function(e){if(e.startsWith(`${er}:REDIRECT:{`))try{let t=JSON.parse(e.slice(28));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"string"==typeof t.location&&"boolean"==typeof t.reloadDocument&&"boolean"==typeof t.replace)return t}catch{}}(t.digest);if(e){let n=mr.get(t);if(n)throw n;let a=be(e.location,r);if(we&&!mr.get(t)){if(!a.isExternal&&!e.reloadDocument){const r=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw mr.set(t,r),r}window.location.href=a.absoluteURL||a.to}return h.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function yr({routeContext:e,match:t,children:r}){let n=h.useContext(Bt);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(Zt.Provider,{value:e},r)}function vr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gr(e){let t=h.useContext(Wt);return S(t,vr(e)),t}function wr(e){let t=function(e){let t=h.useContext(Zt);return S(t,vr(e)),t}(e),r=t.matches[t.matches.length-1];return S(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function br(){let{matches:e,loaderData:t}=gr("useMatches");return h.useMemo(()=>e.map(e=>F(e,t)),[e,t])}function Er(){let e=gr("useLoaderData"),t=wr("useLoaderData");return e.loaderData[t]}function Rr(){let e=gr("useActionData"),t=wr("useLoaderData");return e.actionData?e.actionData[t]:void 0}function Sr(){let e=h.useContext(Qt),t=gr("useRouteError"),r=wr("useRouteError");return void 0!==e?e:t.errors?.[r]}var xr={};function kr(e,t,r){t||xr[e]||(xr[e]=!0,x(!1,r))}var Lr={};function Cr(e,t){e||Lr[t]||(Lr[t]=!0,console.warn(t))}var Mr=h.useOptimistic,Pr=()=>{};function Tr(e){let t={hasErrorBoundary:e.hasErrorBoundary||null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&(e.element&&x(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:h.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&x(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:h.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&x(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:h.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Dr=["HydrateFallback","hydrateFallbackElement"],Or=class{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 $r({router:e,flushSync:t,onError:r,useTransitions:n}){n=Jt()||n;let[a,o]=h.useState(e.state),[i,l]=(s=a,Mr?Mr(s):[s,Pr]);var s;let[u,c]=h.useState(),[d,f]=h.useState({isTransitioning:!1}),[m,p]=h.useState(),[y,v]=h.useState(),[g,w]=h.useState(),b=h.useRef(new Map),E=h.useCallback((a,{deletedFetchers:i,newErrors:s,flushSync:u,viewTransitionOpts:d})=>{s&&r&&Object.values(s).forEach(e=>r(e,{location:a.location,params:a.matches[0]?.params??{},pattern:ge(a.matches)})),a.fetchers.forEach((e,t)=>{void 0!==e.data&&b.current.set(t,e.data)}),i.forEach(e=>b.current.delete(e)),Cr(!1===u||null!=t,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let g=null!=e.window&&null!=e.window.document&&"function"==typeof e.window.document.startViewTransition;if(Cr(null==d||g,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),d&&g){if(t&&u){t(()=>{y&&(m?.resolve(),y.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:d.currentLocation,nextLocation:d.nextLocation})});let r=e.window.document.startViewTransition(()=>{t(()=>o(a))});return r.finished.finally(()=>{t(()=>{p(void 0),v(void 0),c(void 0),f({isTransitioning:!1})})}),void t(()=>v(r))}y?(m?.resolve(),y.skipTransition(),w({state:a,currentLocation:d.currentLocation,nextLocation:d.nextLocation})):(c(a),f({isTransitioning:!0,flushSync:!1,currentLocation:d.currentLocation,nextLocation:d.nextLocation}))}else t&&u?t(()=>o(a)):!1===n?o(a):h.startTransition(()=>{!0===n&&l(e=>Ar(e,a)),o(a)})},[e.window,t,y,m,n,l,r]);h.useLayoutEffect(()=>e.subscribe(E),[e,E]),h.useEffect(()=>{d.isTransitioning&&!d.flushSync&&p(new Or)},[d]),h.useEffect(()=>{if(m&&u&&e.window){let t=u,r=m.promise,a=e.window.document.startViewTransition(async()=>{!1===n?o(t):h.startTransition(()=>{!0===n&&l(e=>Ar(e,t)),o(t)}),await r});a.finished.finally(()=>{p(void 0),v(void 0),c(void 0),f({isTransitioning:!1})}),v(a)}},[u,m,e.window,n,l]),h.useEffect(()=>{m&&u&&i.location.key===u.location.key&&m.resolve()},[m,y,i.location,u]),h.useEffect(()=>{!d.isTransitioning&&g&&(c(g.state),f({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),w(void 0))},[d.isTransitioning,g]);let R=h.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,r,n)=>e.navigate(t,{state:r,preventScrollReset:n?.preventScrollReset}),replace:(t,r,n)=>e.navigate(t,{replace:!0,state:r,preventScrollReset:n?.preventScrollReset})}),[e]),S=e.basename||"/",x=h.useMemo(()=>({router:e,navigator:R,static:!1,basename:S,onError:r}),[e,R,S,r]);return h.createElement(h.Fragment,null,h.createElement(Bt.Provider,{value:x},h.createElement(Wt.Provider,{value:i},h.createElement(Vt.Provider,{value:b.current},h.createElement(Yt.Provider,{value:d},h.createElement(Hr,{basename:S,location:i.location,navigationType:i.historyAction,navigator:R,useTransitions:n},h.createElement(jr,{routes:e.routes,manifest:e.manifest,future:e.future,state:i,isStatic:!1,onError:r})))))),null)}function Ar(e,t){return{...e,navigation:"idle"!==t.navigation.state?t.navigation:e.navigation,revalidation:"idle"!==t.revalidation?t.revalidation:e.revalidation,actionData:"submitting"!==t.navigation.state?t.actionData:e.actionData,fetchers:t.fetchers}}var jr=h.memo(function({routes:e,manifest:t,future:r,state:n,isStatic:a,onError:o}){return cr(e,void 0,{manifest:t,state:n,isStatic:a,onError:o,future:r})});function _r({to:e,replace:t,state:r,relative:n}){S(tr(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a}=h.useContext(Xt);x(!a,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=h.useContext(Zt),{pathname:i}=rr(),l=or(),s=le(e,ie(o),i,"path"===n),u=JSON.stringify(s);return h.useEffect(()=>{l(JSON.parse(u),{replace:t,state:r,relative:n})},[l,u,n,t,r]),null}function Nr(e){return function(e){let t=h.useContext(Zt).outlet;return h.useMemo(()=>t&&h.createElement(ir.Provider,{value:e},t),[t,e])}(e.context)}function Hr({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:o=!1,useTransitions:i}){S(!tr(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=h.useMemo(()=>({basename:l,navigator:a,static:o,useTransitions:i,future:{}}),[l,a,o,i]);"string"==typeof r&&(r=M(r));let{pathname:u="/",search:c="",hash:d="",state:f=null,key:m="default",mask:p}=r,y=h.useMemo(()=>{let e=ee(u,l);return null==e?null:{location:{pathname:e,search:c,hash:d,state:f,key:m,mask:p},navigationType:n}},[l,u,c,d,f,m,n,p]);return x(null!=y,`<Router basename="${l}"> is not able to match the URL "${u}${c}${d}" because it does not start with the basename, so the <Router> won't render anything.`),null==y?null:h.createElement(Xt.Provider,{value:s},h.createElement(Gt.Provider,{children:t,value:y}))}h.Component;function Fr(e){return function(){const t={params:sr(),loaderData:Er(),actionData:Rr(),matches:br()};return h.createElement(e,t)}}function zr(e){return function(){const t={params:sr(),loaderData:Er(),actionData:Rr(),error:Sr()};return h.createElement(e,t)}}var Ur="get",Ir="application/x-www-form-urlencoded";function Br(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement}var Wr=null;var qr=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Jr(e){return null==e||qr.has(e)?e:(x(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ir}"`),null)}function Yr(e,t){let r,n,a,o,i;if(Br(l=e)&&"form"===l.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?ee(i,t):null,r=e.getAttribute("method")||Ur,a=Jr(e.getAttribute("enctype"))||Ir,o=new FormData(e)}else if(function(e){return Br(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Br(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?ee(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||Ur,a=Jr(e.getAttribute("formenctype"))||Jr(i.getAttribute("enctype"))||Ir,o=new FormData(i,e),!function(){if(null===Wr)try{new FormData(document.createElement("form"),0),Wr=!1}catch(e){Wr=!0}return Wr}()){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(Br(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Ur,n=null,a=Ir,i=e}var l;return o&&"text/plain"===a&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}var Vr=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Kr=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Xr="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:void 0;function Gr(e){const{hydrated:t,values:r}=this;if("number"==typeof e)return Zr.call(this,e);if(!Array.isArray(e)||!e.length)throw new SyntaxError;const n=r.length;for(const a of e)r.push(a);return t.length=r.length,Zr.call(this,n)}function Zr(e){const{hydrated:t,values:r,deferred:n,plugins:a}=this;let o;const i=[[e,e=>{o=e}]];let l=[];for(;i.length>0;){const[e,o]=i.pop();switch(e){case-7:o(void 0);continue;case-5:o(null);continue;case-2:o(NaN);continue;case-6:o(1/0);continue;case-3:o(-1/0);continue;case-4:o(-0);continue}if(t[e]){o(t[e]);continue}const s=r[e];if(s&&"object"==typeof s){if(!Array.isArray(s)){const r={};t[e]=r;for(const e of Object.keys(s).reverse()){const t=[];i.push([s[e],e=>{t[1]=e}]),i.push([Number(e.slice(1)),e=>{t[0]=e}]),l.push(()=>{r[t[0]]=t[1]})}o(r);continue}if("string"!=typeof s[0]){const r=[];t[e]=r;for(let e=0;e<s.length;e++){const t=s[e];-1!==t&&i.push([t,t=>{r[e]=t}])}o(r);continue}{const[r,u,c]=s;switch(r){case"D":o(t[e]=new Date(u));continue;case"U":o(t[e]=new URL(u));continue;case"B":o(t[e]=BigInt(u));continue;case"R":o(t[e]=new RegExp(u,c));continue;case"Y":o(t[e]=Symbol.for(u));continue;case"S":const r=new Set;t[e]=r;for(let e=s.length-1;e>0;e--)i.push([s[e],e=>{r.add(e)}]);o(r);continue;case"M":const d=new Map;t[e]=d;for(let e=s.length-2;e>0;e-=2){const t=[];i.push([s[e+1],e=>{t[1]=e}]),i.push([s[e],e=>{t[0]=e}]),l.push(()=>{d.set(t[0],t[1])})}o(d);continue;case"N":const h=Object.create(null);t[e]=h;for(const e of Object.keys(u).reverse()){const t=[];i.push([u[e],e=>{t[1]=e}]),i.push([Number(e.slice(1)),e=>{t[0]=e}]),l.push(()=>{h[t[0]]=t[1]})}o(h);continue;case"P":if(t[u])o(t[e]=t[u]);else{const r=new Kr;n[u]=r,o(t[e]=r.promise)}continue;case"E":const[,f,m]=s;let p=m&&Xr&&Vr.includes(m)&&m in Xr&&"function"==typeof Xr[m]?new Xr[m](f):new Error(f);t[e]=p,o(p);continue;case"Z":o(t[e]=t[u]);continue;default:if(Array.isArray(a)){const r=[],n=s.slice(1);for(let e=0;e<n.length;e++){const t=n[e];i.push([t,t=>{r[e]=t}])}l.push(()=>{for(const n of a){const a=n(s[0],...r);if(a)return void o(t[e]=a.value)}throw new SyntaxError});continue}throw new SyntaxError}}}else t[e]=s,o(s)}for(;l.length>0;)l.pop()();return o}async function Qr(e,t){const{plugins:r}=t??{},n=new Kr,a=e.pipeThrough(function(){const e=new TextDecoder;let t="";return new TransformStream({transform(r,n){const a=e.decode(r,{stream:!0}),o=(t+a).split("\n");t=o.pop()||"";for(const e of o)n.enqueue(e)},flush(e){t&&e.enqueue(t)}})}()).getReader(),o={values:[],hydrated:[],deferred:{},plugins:r},i=await en.call(o,a);let l=n.promise;return i.done?n.resolve():l=tn.call(o,a).then(n.resolve).catch(e=>{for(const t of Object.values(o.deferred))t.reject(e);n.reject(e)}),{done:l.then(()=>a.closed),value:i.value}}async function en(e){const t=await e.read();if(!t.value)throw new SyntaxError;let r;try{r=JSON.parse(t.value)}catch(n){throw new SyntaxError}return{done:t.done,value:Gr.call(this,r)}}async function tn(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const n=t.value;switch(n[0]){case"P":{const e=n.indexOf(":"),t=Number(n.slice(1,e)),a=this.deferred[t];if(!a)throw new Error(`Deferred ID ${t} not found in stream`);const o=n.slice(e+1);let i;try{i=JSON.parse(o)}catch(r){throw new SyntaxError}const l=Gr.call(this,i);a.resolve(l);break}case"E":{const e=n.indexOf(":"),t=Number(n.slice(1,e)),a=this.deferred[t];if(!a)throw new Error(`Deferred ID ${t} not found in stream`);const o=n.slice(e+1);let i;try{i=JSON.parse(o)}catch(r){throw new SyntaxError}const l=Gr.call(this,i);a.reject(l);break}default:throw new SyntaxError}t=await e.read()}}var rn={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},nn=/[&><\u2028\u2029]/g;function an(e){return e.replace(nn,e=>rn[e])}function on(e,t){if(!1===e||null==e)throw new Error(t)}var ln,sn=Symbol("SingleFetchRedirect"),un=class extends Error{},cn=new Set([100,101,204,205]);function dn(e,t,r,n,a,o){let i=function(e,t,r,n,a,o,i=()=>!0){return async l=>{let{request:s,matches:u,fetcherKey:c}=l,d=e();if("GET"!==s.method)return async function(e,t,r,n){let a=e.matches.find(e=>e.shouldCallHandler());on(a,"No action match found");let o,i=await a.resolve(async i=>await i(async()=>{let{data:i,status:l}=await t(e,r,n,[a.route.id]);return o=l,pn(i,a.route.id)}));return $t(i.result)||ve(i.result)||Ot(i.result)?{[a.route.id]:i}:{[a.route.id]:{type:i.type,result:pe(i.result,o)}}}(l,r,a,o);let h=u.some(e=>{let{hasLoader:r,hasClientLoader:n}=t(e);return e.shouldCallHandler()&&r&&!n});return n||h?c?async function(e,t,r,n){let a=e.matches.find(e=>e.shouldCallHandler());on(a,"No fetcher match found");let o=a.route.id,i=await a.resolve(async a=>a(async()=>{let{data:a}=await t(e,r,n,[o]);return pn(a,o)}));return{[a.route.id]:i}}(l,r,a,o):async function(e,t,r,n,a,o,i,l=()=>!0){let s=new Set,u=!1,c=e.matches.map(()=>yn()),d=yn(),h={},f=Promise.all(e.matches.map(async(t,a)=>t.resolve(async f=>{c[a].resolve();let m=t.route.id,{hasLoader:p,hasClientLoader:y}=r(t),v=!t.shouldRevalidateArgs||null==t.shouldRevalidateArgs.actionStatus||t.shouldRevalidateArgs.actionStatus<400;if(t.shouldCallHandler(v))if(l(t)&&y){p&&(u=!0);try{h[m]={type:"data",result:await f(async()=>{let{data:t}=await n(e,o,i,[m]);return pn(t,m)})}}catch(g){h[m]={type:"error",result:g}}}else{p&&s.add(m);try{h[m]={type:"data",result:await f(async()=>pn(await d.promise,m))}}catch(g){h[m]={type:"error",result:g}}}else u||(u=null!=t.shouldRevalidateArgs&&p)})));if(await Promise.all(c.map(e=>e.promise)),(t.state.initialized||"idle"!==t.state.navigation.state)&&0!==s.size||window.__reactRouterHdrActive){let t=a&&u&&s.size>0?[...s.keys()]:void 0;try{let r=await n(e,o,i,t);d.resolve(r.data)}catch(m){d.reject(m)}}else d.resolve({routes:{}});return await f,await async function(e,t,r,n){try{let a,o=await e;if("routes"in o)for(let e of t)if(e.route.id in o.routes){let t=o.routes[e.route.id];if("error"in t){a=t.error,null==n[e.route.id]?.result&&(n[e.route.id]={type:"error",result:a});break}}void 0!==a&&Array.from(r.values()).forEach(e=>{n[e].result instanceof un&&(n[e].result=a)})}catch(m){}}(d.promise,e.matches,s,h),h}(l,d,t,r,n,a,o,i):async function(e,t,r,n,a){let o=e.matches.filter(e=>e.shouldCallHandler()),i={};return await Promise.all(o.map(o=>o.resolve(async l=>{try{let{hasClientLoader:s}=t(o),u=o.route.id,c=s?await l(async()=>{let{data:t}=await r(e,n,a,[u]);return pn(t,u)}):await l();i[o.route.id]={type:"data",result:c}}catch(s){i[o.route.id]={type:"error",result:s}}}))),i}(l,t,r,a,o)}}(e,e=>{let r=t.routes[e.route.id];return on(r,"Route not found in manifest"),{hasLoader:r.hasLoader,hasClientLoader:r.hasClientLoader}},fn,n,a,o);return async e=>e.runClientMiddleware(i)}function hn(e,t,r,n){let a="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return r?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${n}`:a.pathname=`${a.pathname}.${n}`:"/"===a.pathname?a.pathname=`_root.${n}`:t&&"/"===ee(a.pathname,t)?a.pathname=`${ce(t)}/_root.${n}`:a.pathname=`${ce(a.pathname)}.${n}`,a}async function fn(e,t,r,n){let{request:a}=e,o=hn(a.url,t,r,"data");"GET"===a.method&&(o=function(e){let t=e.searchParams.getAll("index");e.searchParams.delete("index");let r=[];for(let n of t)n&&r.push(n);for(let n of r)e.searchParams.append("index",n);return e}(o),n&&o.searchParams.set("_routes",n.join(",")));let i=await fetch(o,await async function(e){let t={signal:e.signal};if("GET"!==e.method){t.method=e.method;let r=e.headers.get("Content-Type");r&&/\bapplication\/json\b/.test(r)?(t.headers={"Content-Type":r},t.body=JSON.stringify(await e.json())):r&&/\btext\/plain\b/.test(r)?(t.headers={"Content-Type":r},t.body=await e.text()):r&&/\bapplication\/x-www-form-urlencoded\b/.test(r)?t.body=new URLSearchParams(await e.text()):t.body=await e.formData()}return t}(a));if(i.status>=400&&!i.headers.has("X-Remix-Response"))throw new ye(i.status,i.statusText,await i.text());if(204===i.status&&i.headers.has("X-Remix-Redirect"))return{status:202,data:{redirect:{redirect:i.headers.get("X-Remix-Redirect"),status:Number(i.headers.get("X-Remix-Status")||"302"),revalidate:"true"===i.headers.get("X-Remix-Revalidate"),reload:"true"===i.headers.get("X-Remix-Reload-Document"),replace:"true"===i.headers.get("X-Remix-Replace")}}};if(cn.has(i.status)){let e={};return n&&"GET"!==a.method&&(e[n[0]]={data:void 0}),{status:i.status,data:{routes:e}}}on(i.body,"No response body to decode");try{let e,t=await mn(i.body,window);if("GET"===a.method){let r=t.value;e=sn in r?{redirect:r[sn]}:{routes:r}}else{let r=t.value,a=n?.[0];on(a,"No routeId found for single fetch call decoding"),e="redirect"in r?{redirect:r}:{routes:{[a]:r}}}return{status:i.status,data:e}}catch(l){throw new Error("Unable to decode turbo-stream response")}}function mn(e,t){return Qr(e,{plugins:[(e,...r)=>{if("SanitizedError"===e){let[e,n,a]=r,o=Error;e&&Vr.includes(e)&&e in t&&"function"==typeof t[e]&&(o=t[e]);let i=new o(n);return i.stack=a,{value:i}}if("ErrorResponse"===e){let[e,t,n]=r;return{value:new ye(t,n,e)}}return"SingleFetchRedirect"===e?{value:{[sn]:r[0]}}:"SingleFetchClassInstance"===e?{value:r[0]}:"SingleFetchFallback"===e?{value:void 0}:void 0}]})}function pn(e,t){if("redirect"in e){let{redirect:t,revalidate:r,reload:n,replace:a,status:o}=e.redirect;throw((e,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,{...r,headers:n})})(t,{status:o,headers:{...r?{"X-Remix-Revalidate":"yes"}:null,...n?{"X-Remix-Reload-Document":"yes"}:null,...a?{"X-Remix-Replace":"yes"}:null}})}let r=e.routes[t];if(null==r)throw new un(`No result found for routeId "${t}"`);if("error"in r)throw r.error;if("data"in r)return r.data;throw new Error(`Invalid response found for routeId "${t}"`)}function yn(){let e,t,r=new Promise((n,a)=>{e=async e=>{n(e);try{await r}catch(t){}},t=async e=>{a(e);try{await r}catch(t){}}});return{promise:r,resolve:e,reject:t}}async function vn(e,t){if(e.id in t)return t[e.id];try{let r=await m(()=>import(e.module),[]);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function gn(e){return e.css?e.css.map(e=>({rel:"stylesheet",href:e})):[]}async function wn(e,t){if(!e.css&&!t.links||!function(){if(void 0!==ln)return ln;let e=document.createElement("link");return ln=e.relList.supports("preload"),e=null,ln}())return;let r=[];if(e.css&&r.push(...gn(e)),t.links&&r.push(...t.links()),0===r.length)return;let n=[];for(let a of r)En(a)||"stylesheet"!==a.rel||n.push({...a,rel:"preload",as:"style"});await Promise.all(n.map(bn))}async function bn(e){return new Promise(t=>{if(e.media&&!window.matchMedia(e.media).matches||document.querySelector(`link[rel="stylesheet"][href="${e.href}"]`))return t();let r=document.createElement("link");function n(){document.head.contains(r)&&document.head.removeChild(r)}Object.assign(r,e),r.onload=()=>{n(),t()},r.onerror=()=>{n(),t()},document.head.appendChild(r)})}function En(e){return null!=e&&"string"==typeof e.page}function Rn(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}function Sn(e,t,r,n,a,o){let i=(e,t)=>!r[t]||e.route.id!==r[t].route.id,l=(e,t)=>r[t].pathname!==e.pathname||r[t].route.path?.endsWith("*")&&r[t].params["*"]!==e.params["*"];return"assets"===o?t.filter((e,t)=>i(e,t)||l(e,t)):"data"===o?t.filter((t,o)=>{let s=n.routes[t.route.id];if(!s||!s.hasLoader)return!1;if(i(t,o)||l(t,o))return!0;if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof n)return n}return!0}):[]}function xn(e,t,{includeHydrateFallback:r}={}){return n=e.map(e=>{let n=t.routes[e.route.id];if(!n)return[];let a=[n.module];return n.clientActionModule&&(a=a.concat(n.clientActionModule)),n.clientLoaderModule&&(a=a.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(a=a.concat(n.hydrateFallbackModule)),n.imports&&(a=a.concat(n.imports)),a}).flat(1),[...new Set(n)];var n}function kn(e,t){let r=new Set,n=new Set(t);return e.reduce((e,a)=>{if(t&&!En(a)&&"script"===a.as&&a.href&&n.has(a.href))return e;let o=JSON.stringify(function(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}(a));return r.has(o)||(r.add(o),e.push({key:o,link:a})),e},[])}function Ln(){return h.createElement(la,{title:"Loading...",renderScripts:!0},h.createElement("script",{dangerouslySetInnerHTML:{__html:'\n console.log(\n "💿 Hey developer 👋. You can provide a way better UX than this " +\n "when your app is loading JS modules and/or running `clientLoader` " +\n "functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +\n "for more information."\n );\n '}}))}function Cn(e){let t={};return Object.values(e).forEach(e=>{if(e){let r=e.parentId||"";t[r]||(t[r]=[]),t[r].push(e)}}),t}function Mn(e,t,r){let n=An(t),a=!t.HydrateFallback||r&&"root"!==e.id?"root"===e.id?Ln:void 0:t.HydrateFallback,o=t.ErrorBoundary?t.ErrorBoundary:"root"===e.id?()=>h.createElement(ia,{error:Sr()}):void 0;return"root"===e.id&&t.Layout?{...n?{element:h.createElement(t.Layout,null,h.createElement(n,null))}:{Component:n},...o?{errorElement:h.createElement(t.Layout,null,h.createElement(o,null))}:{ErrorBoundary:o},...a?{hydrateFallbackElement:h.createElement(t.Layout,null,h.createElement(a,null))}:{HydrateFallback:a}}:{Component:n,ErrorBoundary:o,HydrateFallback:a}}function Pn(e,t,r,n,a,o){return On(t,r,n,a,o,"",Cn(t),e)}function Tn(e,t){if("loader"===e&&!t.hasLoader||"action"===e&&!t.hasAction){let r=`You are trying to call ${"action"===e?"serverAction()":"serverLoader()"} on a route that does not have a server ${e} (routeId: "${t.id}")`;throw console.error(r),new ye(400,"Bad Request",new Error(r),!0)}}function Dn(e,t){let r="clientAction"===e?"a":"an",n=`Route "${t}" does not have ${r} ${e}, but you are trying to submit to it. To fix this, please add ${r} \`${e}\` function to the route`;throw console.error(n),new ye(405,"Method Not Allowed",new Error(n),!0)}function On(e,t,r,n,a,o="",i=Cn(e),l){return(i[o]||[]).map(o=>{let s=t[o.id];function u(e){return on("function"==typeof e,"No single fetch function available for route handler"),e()}function c(e){return o.hasLoader?u(e):Promise.resolve(null)}function d(e){if(!o.hasAction)throw Dn("action",o.id);return u(e)}function h(e){m(()=>import(e),[])}function f(e){e.clientActionModule&&h(e.clientActionModule),e.clientLoaderModule&&h(e.clientLoaderModule)}async function p(e){let r=t[o.id],n=r?wn(o,r):Promise.resolve();try{return e()}finally{await n}}let y={id:o.id,index:o.index,path:o.path};if(s){Object.assign(y,{...y,...Mn(o,s,a),middleware:s.clientMiddleware,handle:s.handle,shouldRevalidate:$n(y.path,s,o,n,l)});let g=r&&r.loaderData&&o.id in r.loaderData,w=g?r?.loaderData?.[o.id]:void 0,b=r&&r.errors&&o.id in r.errors,E=b?r?.errors?.[o.id]:void 0,R=null==l&&(!0===s.clientLoader?.hydrate||!o.hasLoader);y.loader=async({request:e,params:t,context:r,pattern:n,url:a},i)=>{let l=R;return R=!1,await p(async()=>(on(s,"No `routeModule` available for critical-route loader"),s.clientLoader?s.clientLoader({request:e,params:t,context:r,pattern:n,url:a,async serverLoader(){if(Tn("loader",o),l){if(g)return w;if(b)throw E}return c(i)}}):c(i)))},y.loader.hydrate=jn(o.id,s.clientLoader,o.hasLoader,a),y.action=({request:e,params:t,context:r,pattern:n,url:i},l)=>p(async()=>{if(on(s,"No `routeModule` available for critical-route action"),!s.clientAction){if(a)throw Dn("clientAction",o.id);return d(l)}return s.clientAction({request:e,params:t,context:r,pattern:n,url:i,serverAction:async()=>(Tn("action",o),d(l))})})}else{let S;async function x(){return S||(S=(async()=>{(o.clientLoaderModule||o.clientActionModule)&&await new Promise(e=>setTimeout(e,0));let e=async function(e,t){let r=vn(e,t),n=async function(e){if(!e.css)return;let t=gn(e);await Promise.all(t.map(bn))}(e),a=await r;return await Promise.all([n,wn(e,a)]),{Component:An(a),ErrorBoundary:a.ErrorBoundary,clientMiddleware:a.clientMiddleware,clientAction:a.clientAction,clientLoader:a.clientLoader,handle:a.handle,links:a.links,meta:a.meta,shouldRevalidate:a.shouldRevalidate}}(o,t);return f(o),await e})()),await S}o.hasClientLoader||(y.loader=(e,t)=>p(()=>c(t))),o.hasClientAction||(y.action=(e,t)=>p(()=>{if(a)throw Dn("clientAction",o.id);return d(t)})),y.lazy={loader:o.hasClientLoader?async()=>{let{clientLoader:e}=o.clientLoaderModule?await m(()=>import(o.clientLoaderModule),[]):await x();return on(e,"No `clientLoader` export found"),(t,r)=>e({...t,serverLoader:async()=>(Tn("loader",o),c(r))})}:void 0,action:o.hasClientAction?async()=>{let e=o.clientActionModule?m(()=>import(o.clientActionModule),[]):x();f(o);let{clientAction:t}=await e;return on(t,"No `clientAction` export found"),(e,r)=>t({...e,serverAction:async()=>(Tn("action",o),d(r))})}:void 0,middleware:o.hasClientMiddleware?async()=>{let{clientMiddleware:e}=o.clientMiddlewareModule?await m(()=>import(o.clientMiddlewareModule),[]):await x();return on(e,"No `clientMiddleware` export found"),e}:void 0,shouldRevalidate:async()=>{let e=await x();return $n(y.path,e,o,n,l)},handle:async()=>(await x()).handle,Component:async()=>(await x()).Component,ErrorBoundary:o.hasErrorBoundary?async()=>(await x()).ErrorBoundary:void 0}}let v=On(e,t,r,n,a,o.id,i,l);return v.length>0&&(y.children=v),y})}function $n(e,t,r,n,a){if(a)return function(e,t,r){let n=!1;return a=>n?t?t(a):a.defaultShouldRevalidate:(n=!0,r.has(e))}(r.id,t.shouldRevalidate,a);if(!n&&r.hasLoader&&!r.hasClientLoader){let r=e?Q(e)[1].map(e=>e.paramName):[];const n=e=>r.some(t=>e.currentParams[t]!==e.nextParams[t]);if(t.shouldRevalidate){let e=t.shouldRevalidate;return t=>e({...t,defaultShouldRevalidate:n(t)})}return e=>n(e)}return t.shouldRevalidate}function An(e){if(null!=e.default)return"object"!=typeof e.default||0!==Object.keys(e.default).length?e.default:void 0}function jn(e,t,r,n){return n&&"root"!==e||null!=t&&(!0===t.hydrate||!0!==r)}var _n=new Set,Nn=new Set;function Hn(e,t){return"lazy"===e.mode&&!0===t}function Fn(e,t,r,n,a,o,i){if(Hn(a,n))return async({path:l,patch:s,signal:u,fetcherKey:c})=>{if(Nn.has(l))return;let{state:d}=e();await In([l],c?window.location.href:C(d.navigation.location||d.location),t,r,n,o,i,a.manifestPath,s,u)}}function zn(e,t,r,n,a,o){h.useEffect(()=>{if(!Hn(a,n)||!0===window.navigator?.connection?.saveData)return;function i(e){let t="FORM"===e.tagName?e.getAttribute("action"):e.getAttribute("href");if(!t)return;let r="A"===e.tagName?e.pathname:new URL(t,window.location.origin).pathname;Nn.has(r)||_n.add(r)}async function l(){document.querySelectorAll("a[data-discover], form[data-discover]").forEach(i);let l=Array.from(_n.keys()).filter(e=>!Nn.has(e)||(_n.delete(e),!1));if(0!==l.length)try{await In(l,null,t,r,n,o,e.basename,a.manifestPath,e.patchRoutes)}catch(s){console.error("Failed to fetch manifest patches",s)}}let s=function(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}(l,100);l();let u=new MutationObserver(()=>s());return u.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["data-discover","href","action"]}),()=>u.disconnect()},[n,o,t,r,e,a])}var Un="react-router-manifest-version";async function In(e,t,r,n,a,o,i,l,s,u){const c=new URLSearchParams;c.set("paths",e.sort().join(",")),c.set("version",r.version);let d,h=new URL(function(e,t){let r=e||"/__manifest";return null==t?r:ue([t,r])}(l,i),window.location.origin);if(h.search=c.toString(),h.toString().length>7680)return void _n.clear();try{let e=await fetch(h,{signal:u});if(!e.ok)throw new Error(`${e.status} ${e.statusText}`);if(204===e.status&&e.headers.has("X-Remix-Reload-Document")){if(!t)return void console.warn("Detected a manifest version mismatch during eager route discovery. The next navigation/fetch to an undiscovered route will result in a new document navigation to sync up with the latest manifest.");try{if(sessionStorage.getItem(Un)===r.version)return void console.error("Unable to discover routes due to manifest version mismatch.");sessionStorage.setItem(Un,r.version)}catch{}window.location.href=t,console.warn("Detected manifest version mismatch, reloading..."),await new Promise(()=>{})}else if(e.status>=400)throw new Error(await e.text());try{sessionStorage.removeItem(Un)}catch{}d=await e.json()}catch(y){if(u?.aborted)return;throw y}let f=new Set(Object.keys(r.routes)),m=Object.values(d).reduce((e,t)=>(t&&!f.has(t.id)&&(e[t.id]=t),e),{});Object.assign(r.routes,m),e.forEach(e=>function(e,t){if(t.size>=1e3){let e=t.values().next().value;t.delete(e)}t.add(e)}(e,Nn));let p=new Set;Object.values(m).forEach(e=>{!e||e.parentId&&m[e.parentId]||p.add(e.parentId)}),p.forEach(e=>s(e||null,On(m,n,null,a,o,e)))}function Bn(){let e=h.useContext(Bt);return on(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Wn(){let e=h.useContext(Wt);return on(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var qn=h.createContext(void 0);function Jn(){let e=h.useContext(qn);return on(e,"You must render this element inside a <HydratedRouter> element"),e}function Yn(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Vn(e,t,r){if(r&&!ra)return[e[0]];if(t){let r=e.findIndex(e=>void 0!==t[e.route.id]);return e.slice(0,r+1)}return e}qn.displayName="FrameworkContext";var Kn="data-react-router-critical-css";function Xn({nonce:e,crossOrigin:t}){let{isSpaMode:r,manifest:n,routeModules:a,criticalCss:o}=Jn(),{errors:i,matches:l}=Wn(),s=Vn(l,i,r),u=h.useMemo(()=>function(e,t,r){return kn(e.map(e=>{let n=t[e.route.id],a=r.routes[e.route.id];return[a&&a.css?a.css.map(e=>({rel:"stylesheet",href:e})):[],n?.links?.()||[]]}).flat(2),xn(e,r))}(s,a,n),[s,a,n]);return h.createElement(h.Fragment,null,"string"==typeof o?h.createElement("style",{[Kn]:"",nonce:e,dangerouslySetInnerHTML:{__html:o}}):null,"object"==typeof o?h.createElement("link",{[Kn]:"",rel:"stylesheet",href:o.href,nonce:e,crossOrigin:t}):null,u.map(({key:r,link:n})=>En(n)?h.createElement(Gn,{key:r,nonce:e,...n,crossOrigin:n.crossOrigin??t}):h.createElement("link",{key:r,nonce:e,...n,crossOrigin:n.crossOrigin??t})))}function Gn({page:e,...t}){let r=Jt(),{router:n}=Bn(),a=h.useMemo(()=>N(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?r?h.createElement(Qn,{page:e,matches:a,...t}):h.createElement(ea,{page:e,matches:a,...t}):null}function Zn(e){let{manifest:t,routeModules:r}=Jn(),[n,a]=h.useState([]);return h.useEffect(()=>{let n=!1;return async function(e,t,r){return kn((await Promise.all(e.map(async e=>{let n=t.routes[e.route.id];if(n){let e=await vn(n,r);return e.links?e.links():[]}return[]}))).flat(1).filter(Rn).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"}))}(e,t,r).then(e=>{n||a(e)}),()=>{n=!0}},[e,t,r]),n}function Qn({page:e,matches:t,...r}){let n=rr(),{future:a}=Jn(),{basename:o}=Bn(),i=h.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let r=hn(e,o,a.unstable_trailingSlashAwareDataRequests,"rsc"),i=!1,l=[];for(let e of t)"function"==typeof e.route.shouldRevalidate?i=!0:l.push(e.route.id);return i&&l.length>0&&r.searchParams.set("_routes",l.join(",")),[r.pathname+r.search]},[o,a.unstable_trailingSlashAwareDataRequests,e,n,t]);return h.createElement(h.Fragment,null,i.map(e=>h.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...r})))}function ea({page:e,matches:t,...r}){let n=rr(),{future:a,manifest:o,routeModules:i}=Jn(),{basename:l}=Bn(),{loaderData:s,matches:u}=Wn(),c=h.useMemo(()=>Sn(e,t,u,o,n,"data"),[e,t,u,o,n]),d=h.useMemo(()=>Sn(e,t,u,o,n,"assets"),[e,t,u,o,n]),f=h.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let r=new Set,u=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];t&&t.hasLoader&&(!c.some(t=>t.route.id===e.route.id)&&e.route.id in s&&i[e.route.id]?.shouldRevalidate||t.hasClientLoader?u=!0:r.add(e.route.id))}),0===r.size)return[];let d=hn(e,l,a.unstable_trailingSlashAwareDataRequests,"data");return u&&r.size>0&&d.searchParams.set("_routes",t.filter(e=>r.has(e.route.id)).map(e=>e.route.id).join(",")),[d.pathname+d.search]},[l,a.unstable_trailingSlashAwareDataRequests,s,n,o,c,t,e,i]),m=h.useMemo(()=>xn(d,o),[d,o]),p=Zn(d);return h.createElement(h.Fragment,null,f.map(e=>h.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...r})),m.map(e=>h.createElement("link",{key:e,rel:"modulepreload",href:e,...r})),p.map(({key:e,link:t})=>h.createElement("link",{key:e,nonce:r.nonce,...t,crossOrigin:t.crossOrigin??r.crossOrigin})))}function ta(){let{isSpaMode:e,routeModules:t}=Jn(),{errors:r,matches:n,loaderData:a}=Wn(),o=rr(),i=Vn(n,r,e),l=null;r&&(l=r[i[i.length-1].route.id]);let s=[],u=null,c=[];for(let d=0;d<i.length;d++){let e=i[d],r=e.route.id,n=a[r],h=e.params,f=t[r],m=[],p={id:r,data:n,loaderData:n,meta:[],params:e.params,pathname:e.pathname,handle:e.route.handle,error:l};if(c[d]=p,f?.meta?m="function"==typeof f.meta?f.meta({data:n,loaderData:n,params:h,location:o,matches:c,error:l}):Array.isArray(f.meta)?[...f.meta]:f.meta:u&&(m=[...u]),m=m||[],!Array.isArray(m))throw new Error("The route at "+e.route.path+" returns an invalid value. All route meta functions must return an array of meta objects.\n\nTo reference the meta function API, see https://reactrouter.com/start/framework/route-module#meta");p.meta=m,c[d]=p,s=[...m],u=s}return h.createElement(h.Fragment,null,s.flat().map(e=>{if(!e)return null;if("tagName"in e){let{tagName:t,...r}=e;if(!function(e){return"string"==typeof e&&/^(meta|link)$/.test(e)}(t))return console.warn(`A meta object uses an invalid tagName: ${t}. Expected either 'link' or 'meta'`),null;let n=t;return h.createElement(n,{key:JSON.stringify(r),...r})}if("title"in e)return h.createElement("title",{key:"title"},String(e.title));if("charset"in e&&(e.charSet??(e.charSet=e.charset),delete e.charset),"charSet"in e&&null!=e.charSet)return"string"==typeof e.charSet?h.createElement("meta",{key:"charSet",charSet:e.charSet}):null;if("script:ld+json"in e)try{let t=JSON.stringify(e["script:ld+json"]);return h.createElement("script",{key:`script:ld+json:${t}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:an(t)}})}catch(t){return null}return h.createElement("meta",{key:JSON.stringify(e),...e})}))}var ra=!1;function na(e){let{manifest:t,serverHandoffString:r,isSpaMode:n,renderMeta:a,routeDiscovery:o,ssr:i}=Jn(),{router:l,static:s,staticContext:u}=Bn(),{matches:c}=Wn(),d=Jt(),f=Hn(o,i);a&&(a.didRenderScripts=!0);let m=Vn(c,null,n);h.useEffect(()=>{ra=!0},[]);let p=h.useMemo(()=>{if(d)return null;let n=u?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",a=s?`${t.hmr?.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${f?"":`import ${JSON.stringify(t.url)}`};\n${m.map((e,r)=>{let n=`route${r}`,a=t.routes[e.route.id];on(a,`Route ${e.route.id} not found in manifest`);let{clientActionModule:o,clientLoaderModule:i,clientMiddlewareModule:l,hydrateFallbackModule:s,module:u}=a,c=[...o?[{module:o,varName:`${n}_clientAction`}]:[],...i?[{module:i,varName:`${n}_clientLoader`}]:[],...l?[{module:l,varName:`${n}_clientMiddleware`}]:[],...s?[{module:s,varName:`${n}_HydrateFallback`}]:[],{module:u,varName:`${n}_main`}];return 1===c.length?`import * as ${n} from ${JSON.stringify(u)};`:[c.map(e=>`import * as ${e.varName} from "${e.module}";`).join("\n"),`const ${n} = {${c.map(e=>`...${e.varName}`).join(",")}};`].join("\n")}).join("\n")}\n ${f?`window.__reactRouterManifest = ${JSON.stringify(function({sri:e,...t},r){let n=new Set(r.state.matches.map(e=>e.route.id)),a=r.state.location.pathname.split("/").filter(Boolean),o=["/"];for(a.pop();a.length>0;)o.push(`/${a.join("/")}`),a.pop();o.forEach(e=>{let t=H(r.routes,e,r.basename||"/",!1,r.branches);t&&t.forEach(e=>n.add(e.route.id))});let i=[...n].reduce((e,r)=>Object.assign(e,{[r]:t.routes[r]}),{});return{...t,routes:i,sri:!!e||void 0}}(t,l),null,2)};`:""}\n window.__reactRouterRouteModules = {${m.map((e,t)=>`${JSON.stringify(e.route.id)}:route${t}`).join(",")}};\n\nimport(${JSON.stringify(t.entry.module)});`:" ";return h.createElement(h.Fragment,null,h.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:n},type:void 0}),h.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:a},type:"module",async:!0}))},[]),y=ra||d?[]:[...new Set(t.entry.imports.concat(xn(m,t,{includeHydrateFallback:!0})))],v="object"==typeof t.sri?t.sri:{};return Cr(!d,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),ra||d?null:h.createElement(h.Fragment,null,"object"==typeof t.sri?h.createElement("script",{...e,"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:v})}}):null,f?null:h.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:v[t.url],nonce:e.nonce,suppressHydrationWarning:!0}),h.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:v[t.entry.module],nonce:e.nonce,suppressHydrationWarning:!0}),y.map(t=>h.createElement("link",{key:t,rel:"modulepreload",href:t,crossOrigin:e.crossOrigin,integrity:v[t],nonce:e.nonce,suppressHydrationWarning:!0})),p)}function aa(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}var oa=class extends h.Component{constructor(e){super(e),this.state={error:e.error||null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error||null,location:e.location}:{error:e.error||t.error,location:t.location}}render(){return this.state.error?h.createElement(ia,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function ia({error:e,isOutsideRemixApp:t}){console.error(e);let r,n=h.createElement("script",{dangerouslySetInnerHTML:{__html:'\n console.log(\n "💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."\n );\n '}});if(ve(e))return h.createElement(la,{title:"Unhandled Thrown Response!"},h.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),n);if(e instanceof Error)r=e;else{let t=null==e?"Unknown Error":"object"==typeof e&&"toString"in e?e.toString():JSON.stringify(e);r=new Error(t)}return h.createElement(la,{title:"Application Error!",isOutsideRemixApp:t},h.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),h.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},r.stack),n)}function la({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){let{routeModules:a}=Jn();return a.root?.Layout&&!r?n:h.createElement("html",{lang:"en"},h.createElement("head",null,h.createElement("meta",{charSet:"utf-8"}),h.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),h.createElement("title",null,e)),h.createElement("body",null,h.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,t?h.createElement(na,null):null)))}var sa="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{sa&&(window.__reactRouterVersion="7.15.1")}catch(Ea){}var ua=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ca=h.forwardRef(function({onClick:e,discover:t="render",prefetch:r="none",relative:n,reloadDocument:a,replace:o,mask:i,state:l,target:s,to:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:f,...m},p){let{basename:y,navigator:v,useTransitions:g}=h.useContext(Xt),w="string"==typeof u&&ua.test(u),b=be(u,y),E=function(e,{relative:t}={}){S(tr(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=h.useContext(Xt),{hash:a,pathname:o,search:i}=ur(e,{relative:t}),l=o;return"/"!==r&&(l="/"===o?r:ue([r,o])),n.createHref({pathname:l,search:i,hash:a})}(u=b.to,{relative:n}),R=rr(),x=null;if(i){let e=le(i,[],R.mask?R.mask.pathname:"/",!0);"/"!==y&&(e.pathname="/"===e.pathname?y:ue([y,e.pathname])),x=v.createHref(e)}let[k,L,M]=function(e,t){let r=h.useContext(qn),[n,a]=h.useState(!1),[o,i]=h.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:c,onTouchStart:d}=t,f=h.useRef(null);h.useEffect(()=>{if("render"===e&&i(!0),"viewport"===e){let e=new IntersectionObserver(e=>{e.forEach(e=>{i(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),h.useEffect(()=>{if(n){let e=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(e)}}},[n]);let m=()=>{a(!0)},p=()=>{a(!1),i(!1)};return r?"intent"!==e?[o,f,{}]:[o,f,{onFocus:Yn(l,m),onBlur:Yn(s,p),onMouseEnter:Yn(u,m),onMouseLeave:Yn(c,p),onTouchStart:Yn(d,m)}]:[!1,f,{}]}(r,m),P=function(e,{target:t,replace:r,mask:n,state:a,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s,useTransitions:u}={}){let c=or(),d=rr(),f=ur(e,{relative:i});return h.useCallback(m=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(m,t)){m.preventDefault();let t=void 0!==r?r:C(d)===C(f),p=()=>c(e,{replace:t,mask:n,state:a,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s});u?h.startTransition(()=>p()):p()}},[d,c,f,r,n,a,t,e,o,i,l,s,u])}(u,{replace:o,mask:i,state:l,target:s,preventScrollReset:c,relative:n,viewTransition:d,defaultShouldRevalidate:f,useTransitions:g});let T=!(b.isExternal||a),D=h.createElement("a",{...m,...M,href:(T?x:void 0)||b.absoluteURL||E,onClick:T?function(t){e&&e(t),t.defaultPrevented||P(t)}:e,ref:aa(p,L),target:s,"data-discover":w||"render"!==t?void 0:"true"});return k&&!w?h.createElement(h.Fragment,null,D,h.createElement(Gn,{page:E})):D});function da({getKey:e,storageKey:t,...r}){let n=h.useContext(qn),{basename:a}=h.useContext(Xt),o=rr(),i=br();!function({getKey:e,storageKey:t}={}){let{router:r}=fa("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:a}=function(e){let t=h.useContext(Wt);return S(t,ha(e)),t}("useScrollRestoration"),{basename:o}=h.useContext(Xt),i=rr(),l=br(),s=function(){let e=gr("useNavigation");return h.useMemo(()=>{let{matches:t,historyAction:r,...n}=e.navigation;return n},[e.navigation])}();h.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),function(e,t){let{capture:r}=t||{};h.useEffect(()=>{let t=null!=r?{capture:r}:void 0;return window.addEventListener("pagehide",e,t),()=>{window.removeEventListener("pagehide",e,t)}},[e,r])}(h.useCallback(()=>{if("idle"===s.state){let t=ga(i,l,o,e);va[t]=window.scrollY}try{sessionStorage.setItem(t||ya,JSON.stringify(va))}catch(r){x(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${r}).`)}window.history.scrollRestoration="auto"},[s.state,e,o,i,l,t])),"undefined"!=typeof document&&(h.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||ya);e&&(va=JSON.parse(e))}catch(Ea){}},[t]),h.useLayoutEffect(()=>{let t=r?.enableScrollRestoration(va,()=>window.scrollY,e?(t,r)=>ga(t,r,o,e):void 0);return()=>t&&t()},[r,o,e]),h.useLayoutEffect(()=>{if(!1!==n)if("number"!=typeof n){try{if(i.hash){let e=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(e)return void e.scrollIntoView()}}catch{x(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}!0!==a&&window.scrollTo(0,0)}else window.scrollTo(0,n)},[i,n,a]))}({getKey:e,storageKey:t});let l=h.useMemo(()=>{if(!n||!e)return null;let t=ga(o,i,a,e);return t!==o.key?t:null},[]);if(!n||n.isSpaMode)return null;let s=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},"")}try{let r=JSON.parse(sessionStorage.getItem(e)||"{}")[t||window.history.state.key];"number"==typeof r&&window.scrollTo(0,r)}catch(r){console.error(r),sessionStorage.removeItem(e)}}).toString();return h.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${s})(${an(JSON.stringify(t||ya))}, ${an(JSON.stringify(l))})`}})}function ha(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fa(e){let t=h.useContext(Bt);return S(t,ha(e)),t}ca.displayName="Link",h.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:r="",end:n=!1,style:a,to:o,viewTransition:i,children:l,...s},u){let c=ur(o,{relative:s.relative}),d=rr(),f=h.useContext(Wt),{navigator:m,basename:p}=h.useContext(Xt),y=null!=f&&function(e,{relative:t}={}){let r=h.useContext(Yt);S(null!=r,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=fa("useViewTransitionState"),a=ur(e,{relative:t});if(!r.isTransitioning)return!1;let o=ee(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=ee(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=Z(a.pathname,i)||null!=Z(a.pathname,o)}(c)&&!0===i,v=m.encodeLocation?m.encodeLocation(c).pathname:c.pathname,g=d.pathname,w=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(g=g.toLowerCase(),w=w?w.toLowerCase():null,v=v.toLowerCase()),w&&p&&(w=ee(w,p)||w);const b="/"!==v&&v.endsWith("/")?v.length-1:v.length;let E,R=g===v||!n&&g.startsWith(v)&&"/"===g.charAt(b),x=null!=w&&(w===v||!n&&w.startsWith(v)&&"/"===w.charAt(v.length)),k={isActive:R,isPending:x,isTransitioning:y},L=R?e:void 0;E="function"==typeof r?r(k):[r,R?"active":null,x?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let C="function"==typeof a?a(k):a;return h.createElement(ca,{...s,"aria-current":L,className:E,ref:u,style:C,to:o,viewTransition:i},"function"==typeof l?l(k):l)}).displayName="NavLink",h.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:i=Ur,action:l,onSubmit:s,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:f,...m},p)=>{let{useTransitions:y}=h.useContext(Xt),v=function(){let{router:e}=fa("useSubmit"),{basename:t}=h.useContext(Xt),r=wr("useRouteId"),n=e.fetch,a=e.navigate;return h.useCallback(async(e,o={})=>{let{action:i,method:l,encType:s,formData:u,body:c}=Yr(e,t);!1===o.navigate?await n(o.fetcherKey||pa(),r,o.action||i,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:u,body:c,formMethod:o.method||l,formEncType:o.encType||s,flushSync:o.flushSync}):await a(o.action||i,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:u,body:c,formMethod:o.method||l,formEncType:o.encType||s,replace:o.replace,state:o.state,fromRouteId:r,flushSync:o.flushSync,viewTransition:o.viewTransition})},[n,a,t,r])}(),g=function(e,{relative:t}={}){let{basename:r}=h.useContext(Xt),n=h.useContext(Zt);S(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),o={...ur(e||".",{relative:t})},i=rr();if(null==e){o.search=i.search;let e=new URLSearchParams(o.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();o.search=r?`?${r}`:""}}e&&"."!==e||!a.route.index||(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index");"/"!==r&&(o.pathname="/"===o.pathname?r:ue([r,o.pathname]));return C(o)}(l,{relative:u}),w="get"===i.toLowerCase()?"get":"post",b="string"==typeof l&&ua.test(l);return h.createElement("form",{ref:p,method:w,action:g,onSubmit:n?s:e=>{if(s&&s(e),e.defaultPrevented)return;e.preventDefault();let n=e.nativeEvent.submitter,l=n?.getAttribute("formmethod")||i,m=()=>v(n||e.currentTarget,{fetcherKey:t,method:l,navigate:r,replace:a,state:o,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:f});y&&!1!==r?h.startTransition(()=>m()):m()},...m,"data-discover":b||"render"!==e?void 0:"true"})}).displayName="Form",da.displayName="ScrollRestoration";var ma=0,pa=()=>`__${String(++ma)}__`;var ya="react-router-scroll-positions",va={};function ga(e,t,r,n){let a=null;return n&&(a=n("/"!==r?{...e,pathname:ee(e.pathname,r)||e.pathname}:e,t)),null==a&&(a=e.key),a}var wa=l(e=>{var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function n(e,r,n){var a=null;if(void 0!==n&&(a=""+n),void 0!==r.key&&(a=""+r.key),"key"in r)for(var o in n={},r)"key"!==o&&(n[o]=r[o]);else n=r;return r=n.ref,{$$typeof:t,type:e,key:a,ref:void 0!==r?r:null,props:n}}e.Fragment=r,e.jsx=n,e.jsxs=n}),ba=l((e,t)=>{t.exports=wa()});export{sr as A,ve as C,zn as D,jn as E,l as F,s as I,u as L,zr as M,m as N,or as O,d as P,S,N as T,Ye as _,ta as a,dn as b,Nr as c,na as d,da as f,T as g,Pn as h,Xn as i,Fr as j,lr as k,oa as l,On as m,ye as n,cn as o,R as p,qn as r,_r as s,ba as t,$r as u,mn as v,Tr as w,Dr as x,Fn as y};
1
+ var e,t=Object.create,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,l=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,t)=>{let n={};for(var a in e)r(n,a,{get:e[a],enumerable:!0});return t||r(n,Symbol.toStringTag,{value:"Module"}),n},u=(e,l,s)=>(s=null!=e?t(o(e)):{},((e,t,o,l)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var s,u=a(t),c=0,d=u.length;c<d;c++)s=u[c],i.call(e,s)||s===o||r(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(l=n(t,s))||l.enumerable});return e})(!l&&e&&e.__esModule?s:r(s,"default",{value:e,enumerable:!0}),e)),c=l(e=>{var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),f=Symbol.iterator;var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,y={};function v(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||m}function g(){}function w(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||m}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=v.prototype;var b=w.prototype=new g;b.constructor=w,p(b,v.prototype),b.isPureReactComponent=!0;var E=Array.isArray;function R(){}var S={H:null,A:null,T:null,S:null},x=Object.prototype.hasOwnProperty;function k(e,r,n){var a=n.ref;return{$$typeof:t,type:e,key:r,ref:void 0!==a?a:null,props:n}}function L(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}var C=/\/+/g;function M(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(r=""+e.key,n={"=":"=0",":":"=2"},"$"+r.replace(/[=:]/g,function(e){return n[e]})):t.toString(36);var r,n}function P(e,n,a,o,i){var l=typeof e;"undefined"!==l&&"boolean"!==l||(e=null);var s,u,c=!1;if(null===e)c=!0;else switch(l){case"bigint":case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case t:case r:c=!0;break;case d:return P((c=e._init)(e._payload),n,a,o,i)}}if(c)return i=i(e),c=""===o?"."+M(e,0):o,E(i)?(a="",null!=c&&(a=c.replace(C,"$&/")+"/"),P(i,n,a,"",function(e){return e})):null!=i&&(L(i)&&(s=i,u=a+(null==i.key||e&&e.key===i.key?"":(""+i.key).replace(C,"$&/")+"/")+c,i=k(s.type,u,s.props)),n.push(i)),1;c=0;var h,m=""===o?".":o+":";if(E(e))for(var p=0;p<e.length;p++)c+=P(o=e[p],n,a,l=m+M(o,p),i);else if("function"==typeof(p=null===(h=e)||"object"!=typeof h?null:"function"==typeof(h=f&&h[f]||h["@@iterator"])?h:null))for(e=p.call(e),p=0;!(o=e.next()).done;)c+=P(o=o.value,n,a,l=m+M(o,p++),i);else if("object"===l){if("function"==typeof e.then)return P(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(R,R):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(e),n,a,o,i);throw n=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===n?"object with keys {"+Object.keys(e).join(", ")+"}":n)+"). If you meant to render a collection of children, use an array instead.")}return c}function T(e,t,r){if(null==e)return e;var n=[],a=0;return P(e,n,"","",function(e){return t.call(r,e,a++)}),n}function D(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var O="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},$={map:T,forEach:function(e,t,r){T(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return T(e,function(){t++}),t},toArray:function(e){return T(e,function(e){return e})||[]},only:function(e){if(!L(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};e.Activity=h,e.Children=$,e.Component=v,e.Fragment=n,e.Profiler=o,e.PureComponent=w,e.StrictMode=a,e.Suspense=u,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=S,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return S.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,r){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var n=p({},e.props),a=e.key;if(null!=t)for(o in void 0!==t.key&&(a=""+t.key),t)!x.call(t,o)||"key"===o||"__self"===o||"__source"===o||"ref"===o&&void 0===t.ref||(n[o]=t[o]);var o=arguments.length-2;if(1===o)n.children=r;else if(1<o){for(var i=Array(o),l=0;l<o;l++)i[l]=arguments[l+2];n.children=i}return k(e.type,a,n)},e.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:i,_context:e},e},e.createElement=function(e,t,r){var n,a={},o=null;if(null!=t)for(n in void 0!==t.key&&(o=""+t.key),t)x.call(t,n)&&"key"!==n&&"__self"!==n&&"__source"!==n&&(a[n]=t[n]);var i=arguments.length-2;if(1===i)a.children=r;else if(1<i){for(var l=Array(i),s=0;s<i;s++)l[s]=arguments[s+2];a.children=l}if(e&&e.defaultProps)for(n in i=e.defaultProps)void 0===a[n]&&(a[n]=i[n]);return k(e,o,a)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:s,render:e}},e.isValidElement=L,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:D}},e.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},e.startTransition=function(e){var t=S.T,r={};S.T=r;try{var n=e(),a=S.S;null!==a&&a(r,n),"object"==typeof n&&null!==n&&"function"==typeof n.then&&n.then(R,O)}catch(o){O(o)}finally{null!==t&&null!==r.types&&(t.types=r.types),S.T=t}},e.unstable_useCacheRefresh=function(){return S.H.useCacheRefresh()},e.use=function(e){return S.H.use(e)},e.useActionState=function(e,t,r){return S.H.useActionState(e,t,r)},e.useCallback=function(e,t){return S.H.useCallback(e,t)},e.useContext=function(e){return S.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return S.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return S.H.useEffect(e,t)},e.useEffectEvent=function(e){return S.H.useEffectEvent(e)},e.useId=function(){return S.H.useId()},e.useImperativeHandle=function(e,t,r){return S.H.useImperativeHandle(e,t,r)},e.useInsertionEffect=function(e,t){return S.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return S.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return S.H.useMemo(e,t)},e.useOptimistic=function(e,t){return S.H.useOptimistic(e,t)},e.useReducer=function(e,t,r){return S.H.useReducer(e,t,r)},e.useRef=function(e){return S.H.useRef(e)},e.useState=function(e){return S.H.useState(e)},e.useSyncExternalStore=function(e,t,r){return S.H.useSyncExternalStore(e,t,r)},e.useTransition=function(){return S.H.useTransition()},e.version="19.2.6"}),d=l((e,t)=>{t.exports=c()}),h=u(d(),1),f={},m=function(e,t,r){let n=Promise.resolve();if(t&&t.length>0){const e=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),i=o?.nonce||o?.getAttribute("nonce");a=t.map(t=>{if((t=function(e){return"/"+e}(t))in f)return;f[t]=!0;const n=t.endsWith(".css"),a=n?'[rel="stylesheet"]':"";if(r)for(let r=e.length-1;r>=0;r--){const a=e[r];if(a.href===t&&(!n||"stylesheet"===a.rel))return}else if(document.querySelector(`link[href="${t}"]${a}`))return;const o=document.createElement("link");return o.rel=n?"stylesheet":"modulepreload",n||(o.as="script"),o.crossOrigin="",o.href=t,i&&o.setAttribute("nonce",i),document.head.appendChild(o),n?new Promise((e,r)=>{o.addEventListener("load",e),o.addEventListener("error",()=>r(new Error(`Unable to preload CSS for ${t}`)))}):void 0}),n=Promise.all(a.map(e=>Promise.resolve(e).then(e=>({status:"fulfilled",value:e}),e=>({status:"rejected",reason:e}))))}var a;function o(e){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return n.then(t=>{for(const e of t||[])"rejected"===e.status&&o(e.reason);return e().catch(o)})},p=e=>{throw TypeError(e)},y=(e,t,r)=>t.has(e)||p("Cannot "+r),v=(e,t,r)=>(y(e,t,"read from private field"),r?r.call(e):t.get(e)),g=(e,t,r)=>t.has(e)?p("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),w=(e,t,r,n)=>(y(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),b="popstate";function E(e){return"object"==typeof e&&null!=e&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function R(e={}){return function(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,l="POP",s=null,u=c();null==u&&(u=0,i.replaceState({...i.state,idx:u},""));function c(){return(i.state||{idx:null}).idx}function d(){l="POP";let e=c(),t=null==e?null:e-u;u=e,s&&s({action:l,location:p.location,delta:t})}function h(e,t){l="PUSH";let n=E(e)?e:L(p.location,e,t);r&&r(n,e),u=c()+1;let d=k(n,u),h=p.createHref(n.mask||n);try{i.pushState(d,"",h)}catch(f){if(f instanceof DOMException&&"DataCloneError"===f.name)throw f;a.location.assign(h)}o&&s&&s({action:l,location:p.location,delta:1})}function f(e,t){l="REPLACE";let n=E(e)?e:L(p.location,e,t);r&&r(n,e),u=c();let a=k(n,u),d=p.createHref(n.mask||n);i.replaceState(a,"",d),o&&s&&s({action:l,location:p.location,delta:0})}function m(e){return P(e)}let p={get action(){return l},get location(){return e(a,i)},listen(e){if(s)throw new Error("A history only accepts one active listener");return a.addEventListener(b,d),s=e,()=>{a.removeEventListener(b,d),s=null}},createHref:e=>t(a,e),createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:h,replace:f,go:e=>i.go(e)};return p}(function(e,t){let r=t.state?.masked,{pathname:n,search:a,hash:o}=r||e.location;return L("",{pathname:n,search:a,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default",r?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)},function(e,t){return"string"==typeof t?t:C(t)},null,e)}function S(e,t){if(!1===e||null==e)throw new Error(t)}function x(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(r){}}}function k(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function L(e,t,r=null,n,a){return{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).substring(2,10),mask:a}}function C({pathname:e="/",search:t="",hash:r=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),r&&"#"!==r&&(e+="#"===r.charAt(0)?r:"#"+r),e}function M(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function P(e,t=!1){let r="http://localhost";"undefined"!=typeof window&&(r="null"!==window.location.origin?window.location.origin:window.location.href),S(r,"No window.location.(origin|href) available to create URL");let n="string"==typeof e?e:C(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}function T(e){return{defaultValue:e}}var D=class{constructor(t){if(g(this,e,new Map),t)for(let[e,r]of t)this.set(e,r)}get(t){if(v(this,e).has(t))return v(this,e).get(t);if(void 0!==t.defaultValue)return t.defaultValue;throw new Error("No value found for context")}set(t,r){v(this,e).set(t,r)}};e=new WeakMap;var O=new Set(["lazy","caseSensitive","path","id","index","children"]);var $=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function A(e){return $.has(e)}function j(e,t,r=[],n={},a=!1){return e.map((e,o)=>{let i=[...r,String(o)],l="string"==typeof e.id?e.id:i.join("-");if(S(!0!==e.index||!e.children,"Cannot specify children on an index route"),S(a||!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={...e,id:l};return n[l]=_(r,t(r)),r}{let r={...e,id:l,children:void 0};return n[l]=_(r,t(r)),e.children&&(r.children=j(e.children,t,i,n,a)),r}})}function _(e,t){return Object.assign(e,{...t,..."object"==typeof t.lazy&&null!=t.lazy?{lazy:{...e.lazy,...t.lazy}}:{}})}function N(e,t,r="/"){return H(e,t,r,!1)}function H(e,t,r,n,a){let o=ee(("string"==typeof t?M(t):t).pathname||"/",r);if(null==o)return null;let i=a??z(e),l=null,s=function(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return x(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}(o);for(let u=0;null==l&&u<i.length;++u)l=G(i[u],s,n);return l}function F(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function z(e){let t=U(e);return 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)))}(t),t}function U(e,t=[],r=[],n="",a=!1){let o=(e,o,i=a,l)=>{let s={relativePath:void 0===l?e.path||"":l,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};if(s.relativePath.startsWith("/")){if(!s.relativePath.startsWith(n)&&i)return;S(s.relativePath.startsWith(n),`Absolute route path "${s.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),s.relativePath=s.relativePath.slice(n.length)}let u=ue([n,s.relativePath]),c=r.concat(s);e.children&&e.children.length>0&&(S(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),U(e.children,t,c,u,i)),(null!=e.path||e.index)&&t.push({path:u,score:X(u,e.index),routesMeta:c})};return e.forEach((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let r of I(e.path))o(e,t,!0,r);else o(e,t)}),t}function I(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=I(n.join("/")),l=[];return l.push(...i.map(e=>""===e?o:[o,e].join("/"))),a&&l.push(...i),l.map(t=>e.startsWith("/")&&""===t?"/":t)}var B=/^:[\w-]+$/,W=3,q=2,J=1,Y=10,V=-2,K=e=>"*"===e;function X(e,t){let r=e.split("/"),n=r.length;return r.some(K)&&(n+=V),t&&(n+=q),r.filter(e=>!K(e)).reduce((e,t)=>e+(B.test(t)?W:""===t?J:Y),n)}function G(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",i=[];for(let l=0;l<n.length;++l){let e=n[l],s=l===n.length-1,u="/"===o?t:t.slice(o.length)||"/",c=Z({path:e.relativePath,caseSensitive:e.caseSensitive,end:s},u),d=e.route;if(!c&&s&&r&&!n[n.length-1].route.index&&(c=Z({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},u)),!c)return null;Object.assign(a,c.params),i.push({params:a,pathname:ue([o,c.pathname]),pathnameBase:de(ue([o,c.pathnameBase])),route:d}),"/"!==c.pathnameBase&&(o=ue([o,c.pathnameBase]))}return i}function Z(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Q(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((e,{paramName:t,isOptional:r},n)=>{if("*"===t){let e=l[n]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const a=l[n];return e[t]=r&&!a?void 0:(a||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:i,pattern:e}}function Q(e,t=!1,r=!0){x("*"===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,a,o)=>{if(n.push({paramName:t,isOptional:null!=r}),r){let t=o.charAt(a+e.length);return t&&"/"!==t?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function ee(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)||"/"}var te=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,re=e=>te.test(e);function ne(e,t){let r=ce(t).split("/");return e.split("/").forEach(e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)}),r.length>1?r.join("/"):"/"}function ae(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 oe(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function ie(e){let t=oe(e);return t.map((e,r)=>r===t.length-1?e.pathname:e.pathnameBase)}function le(e,t,r,n=!1){let a;"string"==typeof e?a=M(e):(a={...e},S(!a.pathname||!a.pathname.includes("?"),ae("?","pathname","search",a)),S(!a.pathname||!a.pathname.includes("#"),ae("#","pathname","hash",a)),S(!a.search||!a.search.includes("#"),ae("#","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 s=function(e,t="/"){let r,{pathname:n,search:a="",hash:o=""}="string"==typeof e?M(e):e;return n?(n=se(n),r=n.startsWith("/")?ne(n.substring(1),"/"):ne(n,t)):r=t,{pathname:r,search:he(a),hash:fe(o)}}(a,o),u=l&&"/"!==l&&l.endsWith("/"),c=(i||"."===l)&&r.endsWith("/");return s.pathname.endsWith("/")||!u&&!c||(s.pathname+="/"),s}var se=e=>e.replace(/\/\/+/g,"/"),ue=e=>se(e.join("/")),ce=e=>e.replace(/\/+$/,""),de=e=>ce(e).replace(/^\/*/,"/"),he=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",fe=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",me=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function pe(e,t){return new me(e,"number"==typeof t?{status:t}:t)}var ye=class{constructor(e,t,r,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 ve(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}function ge(e){return ue(e.map(e=>e.route.path).filter(Boolean))||"/"}var we="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function be(e,t){let r=e;if("string"!=typeof r||!te.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,a=!1;if(we)try{let e=new URL(window.location.href),n=r.startsWith("//")?new URL(e.protocol+r):new URL(r),o=ee(n.pathname,t);n.origin===e.origin&&null!=o?r=o+n.search+n.hash:a=!0}catch(o){x(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:a,to:r}}var Ee=Symbol("Uninstrumented");function Re(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(r);for(let n of t)e[n]&&r[n].push(e[n])}}));let n={};if("function"==typeof t.lazy&&r.lazy.length>0){let e=Se(r.lazy,t.lazy,()=>{});e&&(n.lazy=e)}if("object"==typeof t.lazy){let e=t.lazy;["middleware","loader","action"].forEach(t=>{let a=e[t],o=r[`lazy.${t}`];if("function"==typeof a&&o.length>0){let e=Se(o,a,()=>{});e&&(n.lazy=Object.assign(n.lazy||{},{[t]:e}))}})}return["loader","action"].forEach(e=>{let a=t[e];if("function"==typeof a&&r[e].length>0){let t=a[Ee]??a,o=Se(r[e],t,(...e)=>ke(e[0]));o&&("loader"===e&&!0===t.hydrate&&(o.hydrate=!0),o[Ee]=t,n[e]=o)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(n.middleware=t.middleware.map(e=>{let t=e[Ee]??e,n=Se(r.middleware,t,(...e)=>ke(e[0]));return n?(n[Ee]=t,n):e})),n}function Se(e,t,r){return 0===e.length?null:async(...n)=>{let a=await xe(e,r(...n),()=>t(...n),e.length-1);if("error"===a.type)throw a.value;return a.value}}async function xe(e,t,r,n){let a,o=e[n];if(o){let l,s=async()=>(l?console.error("You cannot call instrumented handlers more than once"):l=xe(e,t,r,n-1),a=await l,S(a,"Expected a result"),"error"===a.type&&a.value instanceof Error?{status:"error",error:a.value}:{status:"success",error:void 0});try{await o(s,t)}catch(i){console.error("An instrumentation function threw an error:",i)}l||await s(),await l}else try{a={type:"success",value:await r()}}catch(i){a={type:"error",value:i}}return a||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function ke(e){let{request:t,context:r,params:n,pattern:a}=e;return{request:Ce(t),params:{...n},pattern:a,context:Me(r)}}function Le(e,t){return{currentUrl:C(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function Ce(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Me(e){if(function(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t||Object.getOwnPropertyNames(t).sort().join("\0")===Pe}(e)){let t={...e};return Object.freeze(t),t}return{get:t=>e.get(t)}}var Pe=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Te,De,Oe,$e,Ae=["POST","PUT","PATCH","DELETE"],je=new Set(Ae),_e=["GET",...Ae],Ne=new Set(_e),He=new Set([301,302,303,307,308]),Fe=new Set([307,308]),ze={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ue={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ie={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Be=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),We="remix-router-transitions",qe=Symbol("ResetLoaderData"),Je=class{constructor(e){g(this,Te),g(this,De),g(this,Oe),g(this,$e),w(this,Te,e),w(this,De,z(e))}get stableRoutes(){return v(this,Te)}get activeRoutes(){return v(this,Oe)??v(this,Te)}get branches(){return v(this,$e)??v(this,De)}get hasHMRRoutes(){return null!=v(this,Oe)}setRoutes(e){w(this,Te,e),w(this,De,z(e))}setHmrRoutes(e){w(this,Oe,e),w(this,$e,z(e))}commitHmrRoutes(){v(this,Oe)&&(w(this,Te,v(this,Oe)),w(this,De,v(this,$e)),w(this,Oe,void 0),w(this,$e,void 0))}};function Ye(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;S(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let n=e.hydrationRouteProperties||[],a=e.mapRouteProperties||Be,o=a;if(e.instrumentations){let t=e.instrumentations;o=e=>({...a(e),...Re(t.map(e=>e.route).filter(Boolean),e)})}let i={},l=new Je(j(e.routes,o,void 0,i)),s=e.basename||"/";s.startsWith("/")||(s=`/${s}`);let u,c,d,h=e.dataStrategy||it,f={...e.future},m=null,p=new Set,y=null,v=null,g=null,w=null,b=null!=e.hydrationData,E=H(l.activeRoutes,e.history.location,s,!1,l.branches),R=!1,k=null;if(null!=E||e.patchRoutesOnNavigation)if(E&&!e.hydrationData&&De(E,l.activeRoutes,e.history.location.pathname).active&&(E=null),E)if(E.some(e=>e.route.lazy))u=!1,c=!u;else if(E.some(e=>Ge(e.route))){let t=e.hydrationData?e.hydrationData.loaderData:null,r=e.hydrationData?e.hydrationData.errors:null,n=E;if(r){let e=E.findIndex(e=>void 0!==r[e.route.id]);n=n.slice(0,e+1)}c=!1,u=!0,n.forEach(e=>{let n=Ze(e.route,t,r);c=c||n.renderFallback,u=u&&!n.shouldLoad})}else u=!0,c=!u;else{u=!1,c=!u,E=[];let t=De(null,l.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(R=!0,E=t.matches)}else{let t=kt(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=xt(l.activeRoutes);u=!0,c=!u,E=r,k={[n.id]:t}}let T,O,$={historyAction:e.history.action,location:e.history.location,matches:E,initialized:u,renderFallback:c,navigation:ze,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||k,fetchers:new Map,blockers:new Map},A="POP",_=null,N=!1,z=!1,U=new Map,I=null,B=!1,W=!1,q=new Set,J=new Map,Y=0,V=-1,K=new Map,X=new Set,G=new Map,Z=new Map,Q=new Set,te=new Map,ne=null;function ae(e,t={}){e.matches&&(e.matches=e.matches.map(e=>{let t=i[e.route.id],r=e.route;return r.element!==t.element||r.errorElement!==t.errorElement||r.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e})),$={...$,...e};let r=[],n=[];$.fetchers.forEach((e,t)=>{"idle"===e.state&&(Q.has(t)?r.push(t):n.push(t))}),Q.forEach(e=>{$.fetchers.has(e)||J.has(e)||r.push(e)}),0===p.size&&(y={newErrors:e.errors??null}),[...p].forEach(n=>n($,{deletedFetchers:r,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync})),r.forEach(e=>me($.fetchers,e)),n.forEach(e=>$.fetchers.delete(e))}function oe(t,r,{flushSync:n}={}){let a,o=null!=$.actionData&&null!=$.navigation.formMethod&&At($.navigation.formMethod)&&"loading"===$.navigation.state&&!0!==t.state?._isRedirect;a=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:o?$.actionData:null;let i=r.loaderData?Et($.loaderData,r.loaderData,r.matches||[],r.errors):$.loaderData,s=$.blockers;s.size>0&&(s=new Map(s),s.forEach((e,t)=>s.set(t,Ie)));let u,c=!B&&Te(t,r.matches||$.matches),d=!0===N||null!=$.navigation.formMethod&&At($.navigation.formMethod)&&!0!==t.state?._isRedirect;if(l.commitHmrRoutes(),B||"POP"===A||("PUSH"===A?e.history.push(t,t.state):"REPLACE"===A&&e.history.replace(t,t.state)),"POP"===A){let e=U.get($.location.pathname);e&&e.has(t.pathname)?u={currentLocation:$.location,nextLocation:t}:U.has(t.pathname)&&(u={currentLocation:t,nextLocation:$.location})}else if(z){let e=U.get($.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),U.set($.location.pathname,e)),u={currentLocation:$.location,nextLocation:t}}ae({...r,actionData:a,loaderData:i,historyAction:A,location:t,initialized:!0,renderFallback:!1,navigation:ze,revalidation:"idle",restoreScrollPosition:c,preventScrollReset:d,blockers:s},{viewTransitionOpts:u,flushSync:!0===n}),A="POP",N=!1,z=!1,B=!1,W=!1,_?.resolve(),_=null,ne?.resolve(),ne=null}async function ie(t,r,a){T&&T.abort(),T=null,A=t,B=!0===(a&&a.startUninterruptedRevalidation),function(e,t){if(v&&w){let r=Pe(e,t);v[r]=w()}}($.location,$.matches),N=!0===(a&&a.preventScrollReset),z=!0===(a&&a.enableViewTransition);let u=l.activeRoutes,c=a?.initialHydration&&$.matches&&$.matches.length>0&&!R?$.matches:H(u,r,s,!1,l.branches),d=!0===(a&&a.flushSync);if(c&&$.initialized&&!W&&function(e,t){if(e.pathname!==t.pathname||e.search!==t.search)return!1;if(""===e.hash)return""!==t.hash;if(e.hash===t.hash)return!0;if(""!==t.hash)return!0;return!1}($.location,r)&&!(a&&a.submission&&At(a.submission.formMethod)))return void oe(r,{matches:c},{flushSync:d});let h=De(c,u,r.pathname);if(h.active&&h.matches&&(c=h.matches),!c){let{error:e,notFoundMatches:t,route:n}=Me(r.pathname);return void oe(r,{matches:t,loaderData:{},errors:{[n.id]:e}},{flushSync:d})}let f=a&&a.overrideNavigation?{...a.overrideNavigation,matches:c,historyAction:t}:void 0;T=new AbortController;let m,p=yt(e.history,r,T.signal,a&&a.submission),y=e.getContext?await e.getContext():new D;if(a&&a.pendingError)m=[St(c).route.id,{type:"error",error:a.pendingError}];else if(a&&a.submission&&At(a.submission.formMethod)){let u=await async function(t,r,a,u,c,d,h,f,m={}){if(de(),ae({navigation:Ft(r,u,c,a)},{flushSync:!0===m.flushSync}),h){let e=await Oe(u,r.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:r}=xt(l.activeRoutes);return{matches:t,pendingActionResult:[r.id,{type:"error",error:e.error}]}}let t=St(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:"error",error:e.error}]}}if(!e.matches){let{notFoundMatches:e,error:t,route:n}=Me(r.pathname);return{matches:e,pendingActionResult:[n.id,{type:"error",error:t}]}}u=e.matches}let p,y=_t(u,r);if(y.route.action||y.route.lazy){let e=await ue(t,r,dt(o,i,t,r,u,y,f?[]:n,d),d,null);if(p=e[y.route.id],!p)for(let t of u)if(e[t.route.id]){p=e[t.route.id];break}if(t.signal.aborted)return{shortCircuited:!0}}else p={type:"error",error:kt(405,{method:t.method,pathname:r.pathname,routeId:y.route.id})};if(Dt(p)){let r;return r=m&&null!=m.replace?m.replace:pt(p.response.headers.get("Location"),new URL(t.url),s,e.history)===$.location.pathname+$.location.search,await se(t,p,!0,{submission:a,replace:r}),{shortCircuited:!0}}if(Tt(p)){let e=St(u,y.route.id);return!0!==(m&&m.replace)&&(A="PUSH"),{matches:u,pendingActionResult:[e.route.id,p,y.route.id]}}return{matches:u,pendingActionResult:[y.route.id,p]}}(p,r,a.submission,c,t,y,h.active,a&&!0===a.initialHydration,{replace:a.replace,flushSync:d});if(u.shortCircuited)return;if(u.pendingActionResult){let[e,t]=u.pendingActionResult;if(Tt(t)&&ve(t.error)&&404===t.error.status)return T=null,void oe(r,{matches:u.matches,loaderData:{},errors:{[e]:t.error}})}c=u.matches||c,m=u.pendingActionResult,f=Ht(r,c,t,a.submission),d=!1,h.active=!1,p=yt(e.history,p.url,p.signal)}let{shortCircuited:g,matches:b,loaderData:E,errors:S,workingFetchers:x}=await async function(t,r,a,u,c,d,h,f,m,p,y,v,g,w){let b=h||Ht(r,a,u,f),E=f||m||Nt(b),R=!B&&!y;if(d){if(R){let e=le(g);ae({navigation:b,...void 0!==e?{actionData:e}:{}},{flushSync:v})}let e=await Oe(a,r.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:r}=xt(l.activeRoutes);return{matches:t,loaderData:{},errors:{[r.id]:e.error}}}let t=St(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(!e.matches){let{error:e,notFoundMatches:t,route:n}=Me(r.pathname);return{matches:t,loaderData:{},errors:{[n.id]:e}}}a=e.matches}let S=l.activeRoutes,{dsMatches:x,revalidatingFetchers:k}=Xe(t,c,o,i,e.history,$,a,E,r,y?[]:n,!0===y,W,q,Q,G,X,S,s,null!=e.patchRoutesOnNavigation,l.branches,g,w);if(V=++Y,!e.dataStrategy&&!x.some(e=>e.shouldLoad)&&!x.some(e=>e.route.middleware&&e.route.middleware.length>0)&&0===k.length){let e=new Map($.fetchers),t=we(e);return oe(r,{matches:a,loaderData:{},errors:g&&Tt(g[1])?{[g[0]]:g[1].error}:null,...Rt(g),...t?{fetchers:e}:{}},{flushSync:v}),{shortCircuited:!0}}if(R){let e={};if(!d){e.navigation=b;let t=le(g);void 0!==t&&(e.actionData=t)}k.length>0&&(e.fetchers=function(e){let t=new Map($.fetchers);return e.forEach(e=>{let r=t.get(e.key),n=zt(void 0,r?r.data:void 0);t.set(e.key,n)}),t}(k)),ae(e,{flushSync:v})}k.forEach(e=>{pe(e.key),e.controller&&J.set(e.key,e.controller)});let L=()=>k.forEach(e=>pe(e.key));T&&T.signal.addEventListener("abort",L);let{loaderResults:C,fetcherResults:M}=await ce(x,k,t,r,c);if(t.signal.aborted)return{shortCircuited:!0};T&&T.signal.removeEventListener("abort",L);k.forEach(e=>J.delete(e.key));let P=Lt(C);if(P)return await se(t,P.result,!0,{replace:p}),{shortCircuited:!0};if(P=Lt(M),P)return X.add(P.key),await se(t,P.result,!0,{replace:p}),{shortCircuited:!0};let D=new Map($.fetchers),{loaderData:O,errors:A}=bt($,a,C,g,k,M,D);y&&$.errors&&(A={...$.errors,...A});let j=we(D),_=be(V,D),N=j||_||k.length>0;return{matches:a,loaderData:O,errors:A,...N?{workingFetchers:D}:{}}}(p,r,c,t,y,h.active,f,a&&a.submission,a&&a.fetcherSubmission,a&&a.replace,a&&!0===a.initialHydration,d,m,a&&a.callSiteDefaultShouldRevalidate);g||(T=null,oe(r,{matches:b||c,...Rt(m),loaderData:E,errors:S,...x?{fetchers:x}:{}}))}function le(e){return e&&!Tt(e[1])?{[e[0]]:e[1].data}:$.actionData?0===Object.keys($.actionData).length?null:$.actionData:void 0}async function se(n,a,o,{submission:i,fetcherSubmission:l,preventScrollReset:u,replace:c}={}){o||(_?.resolve(),_=null),a.response.headers.has("X-Remix-Revalidate")&&(W=!0);let d=a.response.headers.get("Location");S(d,"Expected a Location header on the redirect Response"),d=pt(d,new URL(n.url),s,e.history);let h=L($.location,d,{_isRedirect:!0});if(r){let e=!1;if(a.response.headers.has("X-Remix-Reload-Document"))e=!0;else if(re(d)){const r=P(d,!0);e=r.origin!==t.location.origin||null==ee(r.pathname,s)}if(e)return void(c?t.location.replace(d):t.location.assign(d))}T=null;let f=!0===c||a.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:m,formAction:p,formEncType:y}=$.navigation;!i&&!l&&m&&p&&y&&(i=Nt($.navigation));let v=i||l;Fe.has(a.response.status)&&v&&At(v.formMethod)?await ie(f,h,{submission:{...v,formAction:d},preventScrollReset:u||N,enableViewTransition:o?z:void 0}):await ie(f,h,{overrideNavigation:Ht(h,[],f,i),fetcherSubmission:l,preventScrollReset:u||N,enableViewTransition:o?z:void 0})}async function ue(e,t,r,n,a){let o,i={};try{o=await async function(e,t,r,n,a,o,i){n.some(e=>e._lazyPromises?.middleware)&&await Promise.all(n.map(e=>e._lazyPromises?.middleware));let l={request:t,url:vt(t,r),pattern:ge(n),params:n[0].params,context:o,matches:n},s=i?()=>{throw new Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=l;return lt(t,()=>e({...t,fetcherKey:a,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},u=await e({...l,fetcherKey:a,runClientMiddleware:s});try{await Promise.all(n.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch(c){}return u}(h,e,t,r,a,n,!1)}catch(l){return r.filter(e=>e.shouldLoad).forEach(e=>{i[e.route.id]={type:"error",error:l}}),i}if(e.signal.aborted)return i;if(!At(e.method))for(let s of r){if("error"===o[s.route.id]?.type)break;o.hasOwnProperty(s.route.id)||$.loaderData.hasOwnProperty(s.route.id)||$.errors&&$.errors.hasOwnProperty(s.route.id)||!s.shouldCallHandler()||(o[s.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${s.route.id}`)})}for(let[u,c]of Object.entries(o))if(Pt(c)){let t=c.result;i[u]={type:"redirect",response:ft(t,e,u,r,s)}}else i[u]=await ht(c);return i}async function ce(e,t,r,n,a){let o=ue(r,n,e,a,null),i=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await ue(e.request,e.path,e.matches,a,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:"error",error:kt(404,{pathname:e.path})}})}));return{loaderResults:await o,fetcherResults:(await i).reduce((e,t)=>Object.assign(e,t),{})}}function de(){W=!0,G.forEach((e,t)=>{J.has(t)&&q.add(t),pe(t)})}function he(e,t,r={}){let n=new Map($.fetchers);n.set(e,t),ae({fetchers:n},{flushSync:!0===(r&&r.flushSync)})}function fe(e,t,r,n={}){let a=St($.matches,t),o=new Map($.fetchers);me(o,e),ae({errors:{[a.route.id]:r},fetchers:o},{flushSync:!0===(n&&n.flushSync)})}function me(e,t){let r=$.fetchers.get(t);!J.has(t)||r&&"loading"===r.state&&K.has(t)||pe(t),G.delete(t),K.delete(t),X.delete(t),Q.delete(t),q.delete(t),e.delete(t)}function pe(e,t){let r=J.get(e);r&&(r.abort(t),J.delete(e))}function ye(e,t){for(let r of e){let e=t.get(r);S(e,`Expected fetcher: ${r}`);let n=Ut(e.data);t.set(r,n)}}function we(e){let t=[],r=!1;for(let n of X){let a=e.get(n);S(a,`Expected fetcher: ${n}`),"loading"===a.state&&(X.delete(n),t.push(n),r=!0)}return ye(t,e),r}function be(e,t){let r=[];for(let[n,a]of K)if(a<e){let e=t.get(n);S(e,`Expected fetcher: ${n}`),"loading"===e.state&&(pe(n),K.delete(n),r.push(n))}return ye(r,t),r.length>0}function xe(e){$.blockers.delete(e),te.delete(e)}function ke(e,t){let r=$.blockers.get(e)||Ie;S("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($.blockers);n.set(e,t),ae({blockers:n})}function Ce({currentLocation:e,nextLocation:t,historyAction:r}){if(0===te.size)return;te.size>1&&x(!1,"A router only supports one blocker at a time");let n=Array.from(te.entries()),[a,o]=n[n.length-1],i=$.blockers.get(a);return i&&"proceeding"===i.state?void 0:o({currentLocation:e,nextLocation:t,historyAction:r})?a:void 0}function Me(e){let t=kt(404,{pathname:e}),r=l.activeRoutes,{matches:n,route:a}=xt(r);return{notFoundMatches:n,route:a,error:t}}function Pe(e,t){return g&&g(e,t.map(e=>F(e,$.loaderData)))||e.key}function Te(e,t){if(v){let r=Pe(e,t),n=v[r];if("number"==typeof n)return n}return null}function De(t,r,n){if(e.patchRoutesOnNavigation){let e=l.branches;if(!t)return{active:!0,matches:H(r,n,s,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:H(r,n,s,!0,e)}}return{active:!1,matches:null}}async function Oe(t,r,n,a){if(!e.patchRoutesOnNavigation)return{type:"success",matches:t};let u=t;for(;;){let t=i;try{await e.patchRoutesOnNavigation({signal:n,path:r,matches:u,fetcherKey:a,patch:(e,r)=>{n.aborted||et(e,r,l,t,o,!1)}})}catch(c){return{type:"error",error:c,partialMatches:u}}if(n.aborted)return{type:"aborted"};let d=l.branches,h=H(l.activeRoutes,r,s,!1,d),f=null;if(h){if(0===Object.keys(h[0].params).length)return{type:"success",matches:h};if(f=H(l.activeRoutes,r,s,!0,d),!(f&&u.length<f.length&&$e(u,f.slice(0,u.length))))return{type:"success",matches:h}}if(f||(f=H(l.activeRoutes,r,s,!0,d)),!f||$e(u,f))return{type:"success",matches:null};u=f}}function $e(e,t){return e.length===t.length&&e.every((e,r)=>e.route.id===t[r].route.id)}return d={get basename(){return s},get future(){return f},get state(){return $},get routes(){return l.stableRoutes},get branches(){return l.branches},get manifest(){return i},get window(){return t},initialize:function(){if(m=e.history.listen(({action:t,location:r,delta:n})=>{if(O)return O(),void(O=void 0);x(0===te.size||null!=n,"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=Ce({currentLocation:$.location,nextLocation:r,historyAction:t});if(a&&null!=n){let t=new Promise(e=>{O=e});return e.history.go(-1*n),ke(a,{state:"blocked",location:r,proceed(){ke(a,{state:"proceeding",proceed:void 0,reset:void 0,location:r}),t.then(()=>e.history.go(n))},reset(){let e=new Map($.blockers);e.set(a,Ie),ae({blockers:e})}}),_?.resolve(),void(_=null)}return ie(t,r)}),r){!function(e,t){try{let r=e.sessionStorage.getItem(We);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(r){}}(t,U);let e=()=>function(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(We,JSON.stringify(n))}catch(r){x(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}(t,U);t.addEventListener("pagehide",e),I=()=>t.removeEventListener("pagehide",e)}return $.initialized||ie("POP",$.location,{initialHydration:!0}),d},subscribe:function(e){if(p.add(e),y){let{newErrors:t}=y;y=null,e($,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>p.delete(e)},enableScrollRestoration:function(e,t,r){if(v=e,w=t,g=r||null,!b&&$.navigation===ze){b=!0;let e=Te($.location,$.matches);null!=e&&ae({restoreScrollPosition:e})}return()=>{v=null,w=null,g=null}},navigate:async function t(r,n){if(_?.resolve(),_=null,"number"==typeof r){_||(_=It());let t=_.promise;return e.history.go(r),t}let a,{path:o,submission:i,error:l}=Ke(!1,Ve($.location,$.matches,s,r,n?.fromRouteId,n?.relative),n);n?.mask&&(a={pathname:"",search:"",hash:"",..."string"==typeof n.mask?M(n.mask):{...$.location.mask,...n.mask}});let u=$.location,c=L(u,o,n&&n.state,void 0,a);c={...c,...e.history.encodeLocation(c)};let d=n&&null!=n.replace?n.replace:void 0,h="PUSH";!0===d?h="REPLACE":!1===d||null!=i&&At(i.formMethod)&&i.formAction===$.location.pathname+$.location.search&&(h="REPLACE");let f=n&&"preventScrollReset"in n?!0===n.preventScrollReset:void 0,m=!0===(n&&n.flushSync),p=Ce({currentLocation:u,nextLocation:c,historyAction:h});p?ke(p,{state:"blocked",location:c,proceed(){ke(p,{state:"proceeding",proceed:void 0,reset:void 0,location:c}),t(r,n)},reset(){let e=new Map($.blockers);e.set(p,Ie),ae({blockers:e})}}):await ie(h,c,{submission:i,pendingError:l,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:m,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})},fetch:async function(t,r,a,u){pe(t);let c=!0===(u&&u.flushSync),d=l.activeRoutes,h=Ve($.location,$.matches,s,a,r,u?.relative),f=H(d,h,s,!1,l.branches),m=De(f,d,h);if(m.active&&m.matches&&(f=m.matches),!f)return void fe(t,r,kt(404,{pathname:h}),{flushSync:c});let{path:p,submission:y,error:v}=Ke(!0,h,u);if(v)return void fe(t,r,v,{flushSync:c});let g=e.getContext?await e.getContext():new D,w=!0===(u&&u.preventScrollReset);y&&At(y.formMethod)?await async function(t,r,a,u,c,d,h,f,m,p){de(),G.delete(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}}(m,$.fetchers.get(t)),{flushSync:h});let y=new AbortController,v=yt(e.history,a,y.signal,m);if(d){let e=await Oe(u,new URL(v.url).pathname,v.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void fe(t,r,e.error,{flushSync:h});if(!e.matches)return void fe(t,r,kt(404,{pathname:a}),{flushSync:h});u=e.matches}let g=_t(u,a);if(!g.route.action&&!g.route.lazy)return void fe(t,r,kt(405,{method:m.formMethod,pathname:a,routeId:r}),{flushSync:h});J.set(t,y);let w=Y,b=dt(o,i,v,a,u,g,n,c),E=await ue(v,a,b,c,t),R=E[g.route.id];if(!R)for(let e of b)if(E[e.route.id]){R=E[e.route.id];break}if(v.signal.aborted)return void(J.get(t)===y&&J.delete(t));if(Q.has(t)){if(Dt(R)||Tt(R))return void he(t,Ut(void 0))}else{if(Dt(R))return J.delete(t),V>w?void he(t,Ut(void 0)):(X.add(t),he(t,zt(m)),se(v,R,!1,{fetcherSubmission:m,preventScrollReset:f}));if(Tt(R))return void fe(t,r,R.error)}let x=$.navigation.location||$.location,k=yt(e.history,x,y.signal),L=l.activeRoutes,C="idle"!==$.navigation.state?H(L,$.navigation.location,s,!1,l.branches):$.matches;S(C,"Didn't find any matches after fetcher action");let M=++Y;K.set(t,M);let{dsMatches:P,revalidatingFetchers:D}=Xe(k,c,o,i,e.history,$,C,m,x,n,!1,W,q,Q,G,X,L,s,null!=e.patchRoutesOnNavigation,l.branches,[g.route.id,R],p),O=zt(m,R.data),j=new Map($.fetchers);j.set(t,O),D.filter(e=>e.key!==t).forEach(e=>{let t=e.key,r=j.get(t),n=zt(void 0,r?r.data:void 0);j.set(t,n),pe(t),e.controller&&J.set(t,e.controller)}),ae({fetchers:j});let _=()=>D.forEach(e=>pe(e.key));y.signal.addEventListener("abort",_);let{loaderResults:N,fetcherResults:F}=await ce(P,D,k,x,c);if(y.signal.aborted)return;y.signal.removeEventListener("abort",_),K.delete(t),J.delete(t),D.forEach(e=>J.delete(e.key));let z=$.fetchers.has(t),U=e=>{if(!z)return e;let r=new Map(e.fetchers);return r.set(t,Ut(R.data)),{...e,fetchers:r}},I=Lt(N);if(I)return $=U($),se(k,I.result,!1,{preventScrollReset:f});if(I=Lt(F),I)return X.add(I.key),$=U($),se(k,I.result,!1,{preventScrollReset:f});let B=new Map($.fetchers);z&&B.set(t,Ut(R.data));let{loaderData:Z,errors:ee}=bt($,C,N,void 0,D,F,B);be(M,B),"loading"===$.navigation.state&&M>V?(S(A,"Expected pending action"),T&&T.abort(),oe($.navigation.location,{matches:C,loaderData:Z,errors:ee,fetchers:B})):(ae({errors:ee,loaderData:Et($.loaderData,Z,C,ee),fetchers:B}),W=!1)}(t,r,p,f,g,m.active,c,w,y,u&&u.defaultShouldRevalidate):(G.set(t,{routeId:r,path:p}),await async function(t,r,a,l,s,u,c,d,h){let f=$.fetchers.get(t);he(t,zt(h,f?f.data:void 0),{flushSync:c});let m=new AbortController,p=yt(e.history,a,m.signal);if(u){let e=await Oe(l,new URL(p.url).pathname,p.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void fe(t,r,e.error,{flushSync:c});if(!e.matches)return void fe(t,r,kt(404,{pathname:a}),{flushSync:c});l=e.matches}let y=_t(l,a);J.set(t,m);let v=Y,g=await ue(p,a,dt(o,i,p,a,l,y,n,s),s,t),w=g[y.route.id];if(!w)for(let e of l)if(g[e.route.id]){w=g[e.route.id];break}J.get(t)===m&&J.delete(t);if(p.signal.aborted)return;if(Q.has(t))return void he(t,Ut(void 0));if(Dt(w))return V>v?void he(t,Ut(void 0)):(X.add(t),void(await se(p,w,!1,{preventScrollReset:d})));if(Tt(w))return void fe(t,r,w.error);he(t,Ut(w.data))}(t,r,p,f,g,m.active,c,w,y))},revalidate:function(){ne||(ne=It()),de(),ae({revalidation:"loading"});let e=ne.promise;return"submitting"===$.navigation.state?e:"idle"===$.navigation.state?(ie($.historyAction,$.location,{startUninterruptedRevalidation:!0}),e):(ie(A||$.historyAction,$.navigation.location,{overrideNavigation:$.navigation,enableViewTransition:!0===z}),e)},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:function(e){return Z.set(e,(Z.get(e)||0)+1),Q.has(e)&&Q.delete(e),$.fetchers.get(e)||Ue},resetFetcher:function(e,t){pe(e,t?.reason),he(e,Ut(null))},deleteFetcher:function(e){let t=(Z.get(e)||0)-1;t<=0?(Z.delete(e),Q.add(e)):Z.set(e,t),ae({fetchers:new Map($.fetchers)})},dispose:function(){m&&m(),I&&I(),p.clear(),T&&T.abort(),$.fetchers.forEach((e,t)=>me($.fetchers,t)),$.blockers.forEach((e,t)=>xe(t))},getBlocker:function(e,t){let r=$.blockers.get(e)||Ie;return te.get(e)!==t&&te.set(e,t),r},deleteBlocker:xe,patchRoutes:function(e,t,r=!1){et(e,t,l,i,o,r),l.hasHMRRoutes||ae({})},_internalFetchControllers:J,_internalSetRoutes:function(e){i={},l.setHmrRoutes(j(e,o,void 0,i))},_internalSetStateDoNotUseOrYouWillBreakYourApp(e){ae(e)}},e.instrumentations&&(d=function(e,t){let r={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let n of t)e[n]&&r[n].push(e[n])}})),r.navigate.length>0){let t=e.navigate[Ee]??e.navigate,n=Se(r.navigate,t,(...t)=>{let[r,n]=t;return{to:"number"==typeof r||"string"==typeof r?r:r?C(r):".",...Le(e,n??{})}});n&&(n[Ee]=t,e.navigate=n)}if(r.fetch.length>0){let t=e.fetch[Ee]??e.fetch,n=Se(r.fetch,t,(...t)=>{let[r,,n,a]=t;return{href:n??".",fetcherKey:r,...Le(e,a??{})}});n&&(n[Ee]=t,e.fetch=n)}return e}(d,e.instrumentations.map(e=>e.router).filter(Boolean))),d}function Ve(e,t,r,n,a,o){let i,l;if(a){i=[];for(let e of t)if(i.push(e),e.route.id===a){l=e;break}}else i=t,l=t[t.length-1];let s=le(n||".",ie(i),ee(e.pathname,r)||e.pathname,"path"===o);if(null==n&&(s.search=e.search,s.hash=e.hash),(null==n||""===n||"."===n)&&l){let e=jt(s.search);if(l.route.index&&!e)s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&e){let e=new URLSearchParams(s.search),t=e.getAll("index");e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let r=e.toString();s.search=r?`?${r}`:""}}return"/"!==r&&(s.pathname=function({basename:e,pathname:t}){return"/"===t?e:ue([e,t])}({basename:r,pathname:s.pathname})),C(s)}function Ke(e,t,r){if(!r||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(r))return{path:t};if(r.formMethod&&(n=r.formMethod,!Ne.has(n.toUpperCase())))return{path:t,error:kt(405,{method:r.formMethod})};var n;let a,o,i=()=>({path:t,error:kt(400,{type:"invalid-body"})}),l=(r.formMethod||"get").toUpperCase(),s=Ct(t);if(void 0!==r.body){if("text/plain"===r.formEncType){if(!At(l))return i();let e="string"==typeof r.body?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((e,[t,r])=>`${e}${t}=${r}\n`,""):String(r.body);return{path:t,submission:{formMethod:l,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===r.formEncType){if(!At(l))return i();try{let e="string"==typeof r.body?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:l,formAction:s,formEncType:r.formEncType,formData:void 0,json:e,text:void 0}}}catch(d){return i()}}}if(S("function"==typeof FormData,"FormData is not available in this environment"),r.formData)a=gt(r.formData),o=r.formData;else if(r.body instanceof FormData)a=gt(r.body),o=r.body;else if(r.body instanceof URLSearchParams)a=r.body,o=wt(a);else if(null==r.body)a=new URLSearchParams,o=new FormData;else try{a=new URLSearchParams(r.body),o=wt(a)}catch(d){return i()}let u={formMethod:l,formAction:s,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:o,json:void 0,text:void 0};if(At(u.formMethod))return{path:t,submission:u};let c=M(t);return e&&c.search&&jt(c.search)&&a.append("index",""),c.search=`?${a}`,{path:C(c),submission:u}}function Xe(e,t,r,n,a,o,i,l,s,u,c,d,h,f,m,p,y,v,g,w,b,E){let R,S=b?Tt(b[1])?b[1].error:b[1].data:void 0,x=a.createURL(o.location),k=a.createURL(s);if(c&&o.errors){let e=Object.keys(o.errors)[0];R=i.findIndex(t=>t.route.id===e)}else if(b&&Tt(b[1])){let e=b[0];R=i.findIndex(t=>t.route.id===e)-1}let L=b?b[1].statusCode:void 0,C=L&&L>=400,M={currentUrl:x,currentParams:o.matches[0]?.params||{},nextUrl:k,nextParams:i[0].params,...l,actionResult:S,actionStatus:L},P=ge(i),T=i.map((a,i)=>{let{route:l}=a,h=null;if(null!=R&&i>R)h=!1;else if(l.lazy)h=!0;else if(Ge(l))if(c){let{shouldLoad:e}=Ze(l,o.loaderData,o.errors);h=e}else(function(e,t,r){let n=!t||r.route.id!==t.route.id,a=!e.hasOwnProperty(r.route.id);return n||a})(o.loaderData,o.matches[i],a)&&(h=!0);else h=!1;if(null!==h)return ct(r,n,e,s,P,a,u,t,h);let f=!1;"boolean"==typeof E?f=E:C?f=!1:(d||x.pathname+x.search===k.pathname+k.search||x.search!==k.search||function(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}(o.matches[i],a))&&(f=!0);let m={...M,defaultShouldRevalidate:f};return ct(r,n,e,s,P,a,u,t,Qe(a,m),m,E)}),D=[];return m.forEach((e,l)=>{if(c||!i.some(t=>t.route.id===e.routeId)||f.has(l))return;let s=o.fetchers.get(l),m=s&&"idle"!==s.state&&void 0===s.data,b=H(y,e.path,v??"/",!1,w);if(!b){if(g&&m)return;return void D.push({key:l,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null})}if(p.has(l))return;let R=_t(b,e.path),S=new AbortController,x=yt(a,e.path,S.signal),k=null;if(h.has(l))h.delete(l),k=dt(r,n,x,e.path,b,R,u,t);else if(m)d&&(k=dt(r,n,x,e.path,b,R,u,t));else{let a;a="boolean"==typeof E?E:!C&&d;let o={...M,defaultShouldRevalidate:a};Qe(R,o)&&(k=dt(r,n,x,e.path,b,R,u,t,o))}k&&D.push({key:l,routeId:e.routeId,path:e.path,matches:k,match:R,request:x,controller:S})}),{dsMatches:T,revalidatingFetchers:D}}function Ge(e){return null!=e.loader||null!=e.middleware&&e.middleware.length>0}function Ze(e,t,r){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Ge(e))return{shouldLoad:!1,renderFallback:!1};let n=null!=t&&e.id in t,a=null!=r&&void 0!==r[e.id];if(!n&&a)return{shouldLoad:!1,renderFallback:!1};if("function"==typeof e.loader&&!0===e.loader.hydrate)return{shouldLoad:!0,renderFallback:!n};let o=!n&&!a;return{shouldLoad:o,renderFallback:o}}function Qe(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}function et(e,t,r,n,a,o){let i;if(e){let t=n[e];S(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),i=t.children}else i=r.activeRoutes;let l=[],s=[];if(t.forEach(e=>{let t=i.find(t=>tt(e,t));t?s.push({existingRoute:t,newRoute:e}):l.push(e)}),l.length>0){let t=j(l,a,[e||"_","patch",String(i?.length||"0")],n);i.push(...t)}if(o&&s.length>0)for(let u=0;u<s.length;u++){let{existingRoute:e,newRoute:t}=s[u],r=e,[n]=j([t],a,[],{},!0);Object.assign(r,{element:n.element?n.element:r.element,errorElement:n.errorElement?n.errorElement:r.errorElement,hydrateFallbackElement:n.hydrateFallbackElement?n.hydrateFallbackElement:r.hydrateFallbackElement})}r.hasHMRRoutes||r.setRoutes([...r.activeRoutes])}function tt(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)=>t.children?.some(t=>tt(e,t)))??!1))}Te=new WeakMap,De=new WeakMap,Oe=new WeakMap,$e=new WeakMap;var rt=new WeakMap,nt=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let a=r[t.id];if(S(a,"No route found in manifest"),!a.lazy||"object"!=typeof a.lazy)return;let o=a.lazy[e];if(!o)return;let i=rt.get(a);i||(i={},rt.set(a,i));let l=i[e];if(l)return l;let s=(async()=>{let t=function(e){return O.has(e)}(e),r=void 0!==a[e]&&"hasErrorBoundary"!==e;if(t)x(!t,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(r)x(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await o();null!=t&&(Object.assign(a,{[e]:t}),Object.assign(a,n(a)))}"object"==typeof a.lazy&&(a.lazy[e]=void 0,Object.values(a.lazy).every(e=>void 0===e)&&(a.lazy=void 0))})();return i[e]=s,s},at=new WeakMap;async function ot(e){let t=e.matches.filter(e=>e.shouldLoad),r={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,n)=>{r[t[n].route.id]=e}),r}async function it(e){return e.matches.some(e=>e.route.middleware)?lt(e,()=>ot(e)):ot(e)}function lt(e,t){return async function(e,t,r,n,a){let{matches:o,...i}=e;return await st(i,o.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,r,n,a)}(e,t,e=>{if($t(t=e)&&(r=t.status,He.has(r))&&t.headers.has("Location"))throw e;var t,r;return e},Mt,function(t,r,n){if(n)return Promise.resolve(Object.assign(n.value,{[r]:{type:"error",result:t}}));{let{matches:n}=e,a=St(n,n[Math.min(Math.max(n.findIndex(e=>e.route.id===r),0),Math.max(n.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[a]:{type:"error",result:t}})}})}async function st(e,t,r,n,a,o,i=0){let{request:l}=e;if(l.signal.aborted)throw l.signal.reason??new Error(`Request aborted: ${l.method} ${l.url}`);let s=t[i];if(!s)return await r();let u,[c,d]=s,h=async()=>{if(u)throw new Error("You may only call `next()` once per middleware");try{return u={value:await st(e,t,r,n,a,o,i+1)},u.value}catch(l){return u={value:await o(l,c,u)},u.value}};try{let t=await d(e,h),r=null!=t?n(t):void 0;return a(r)?r:u?r??u.value:(u={value:await h()},u.value)}catch(f){return await o(f,c,u)}}function ut(e,t,r,n,a){let o=nt({key:"middleware",route:n.route,manifest:t,mapRouteProperties:e}),i=function(e,t,r,n,a){let o=r[e.id];if(S(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if("function"==typeof e.lazy){let t=at.get(o);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let r=(async()=>{S("function"==typeof e.lazy,"No lazy route function found");let t=await e.lazy(),r={};for(let e in t){let n=t[e];if(void 0===n)continue;let a=A(e),i=void 0!==o[e]&&"hasErrorBoundary"!==e;a?x(!a,"Route property "+e+" is not a supported property to be returned from a lazy route function. This property will be ignored."):i?x(!i,`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.`):r[e]=n}Object.assign(o,r),Object.assign(o,{...n(o),lazy:void 0})})();return at.set(o,r),r.catch(()=>{}),{lazyRoutePromise:r,lazyHandlerPromise:r}}let i,l=Object.keys(e.lazy),s=[];for(let c of l){if(a&&a.includes(c))continue;let o=nt({key:c,route:e,manifest:r,mapRouteProperties:n});o&&(s.push(o),c===t&&(i=o))}let u=s.length>0?Promise.all(s).then(()=>{}):void 0;return u?.catch(()=>{}),i?.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:i}}(n.route,At(r.method)?"action":"loader",t,e,a);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function ct(e,t,r,n,a,o,i,l,s,u=null,c){let d=!1,h=ut(e,t,r,o,i);return{...o,_lazyPromises:h,shouldLoad:s,shouldRevalidateArgs:u,shouldCallHandler:e=>(d=!0,u?Qe(o,"boolean"==typeof c?{...u,defaultShouldRevalidate:c}:"boolean"==typeof e?{...u,defaultShouldRevalidate:e}:u):s),resolve(e){let{lazy:t,loader:i,middleware:u}=o.route,c=d||s||e&&!At(r.method)&&(t||i),f=u&&u.length>0&&!i&&!t;return!c||!At(r.method)&&f?Promise.resolve({type:"data",result:void 0}):async function({request:e,path:t,pattern:r,match:n,lazyHandlerPromise:a,lazyRoutePromise:o,handlerOverride:i,scopedContext:l}){let s,u,c=At(e.method),d=c?"action":"loader",h=a=>{let o,s=new Promise((e,t)=>o=t);u=()=>o(),e.signal.addEventListener("abort",u);let c=o=>"function"!=typeof a?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${n.route.id}]`)):a({request:e,url:vt(e,t),pattern:r,params:n.params,context:l},...void 0!==o?[o]:[]),h=(async()=>{try{return{type:"data",result:await(i?i(e=>c(e)):c())}}catch(e){return{type:"error",result:e}}})();return Promise.race([h,s])};try{let t=c?n.route.action:n.route.loader;if(a||o)if(t){let e,[r]=await Promise.all([h(t).catch(t=>{e=t}),a,o]);if(void 0!==e)throw e;s=r}else{await a;let t=c?n.route.action:n.route.loader;if(!t){if("action"===d){let t=new URL(e.url),r=t.pathname+t.search;throw kt(405,{method:e.method,pathname:r,routeId:n.route.id})}return{type:"data",result:void 0}}[s]=await Promise.all([h(t),o])}else{if(!t){let t=new URL(e.url);throw kt(404,{pathname:t.pathname+t.search})}s=await h(t)}}catch(f){return{type:"error",result:f}}finally{u&&e.signal.removeEventListener("abort",u)}return s}({request:r,path:n,pattern:a,match:o,lazyHandlerPromise:h?.handler,lazyRoutePromise:h?.route,handlerOverride:e,scopedContext:l})}}}function dt(e,t,r,n,a,o,i,l,s=null){return a.map(u=>u.route.id!==o.route.id?{...u,shouldLoad:!1,shouldRevalidateArgs:s,shouldCallHandler:()=>!1,_lazyPromises:ut(e,t,r,u,i),resolve:()=>Promise.resolve({type:"data",result:void 0})}:ct(e,t,r,n,ge(a),u,i,l,!0,s))}async function ht(e){let{result:t,type:r}=e;if($t(t)){let e;try{e=await async function(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?null==e.body?null:e.json():e.text()}(t)}catch(a){return{type:"error",error:a}}return"error"===r?{type:"error",error:new ye(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:"data",data:e,statusCode:t.status,headers:t.headers}}return"error"===r?Ot(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:(n=t,new ye(n.init?.status??500,n.init?.statusText??"Internal Server Error",n.data)),statusCode:ve(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:ve(t)?t.status:void 0}:Ot(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t};var n}function ft(e,t,r,n,a){let o=e.headers.get("Location");if(S(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!re(o)){let i=n.slice(0,n.findIndex(e=>e.route.id===r)+1);o=Ve(new URL(t.url),i,a,o),e.headers.set("Location",o)}return e}var mt=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function pt(e,t,r,n){if(re(e)){let n=e,a=n.startsWith("//")?new URL(t.protocol+n):new URL(n);if(mt.includes(a.protocol))throw new Error("Invalid redirect location");let o=null!=ee(a.pathname,r);if(a.origin===t.origin&&o)return se(a.pathname)+a.search+a.hash}try{let t=n.createURL(e);if(mt.includes(t.protocol))throw new Error("Invalid redirect location")}catch(a){}return e}function yt(e,t,r,n){let a=e.createURL(Ct(t)).toString(),o={signal:r};if(n&&At(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=gt(n.formData):o.body=n.formData}return new Request(a,o)}function vt(e,t){let r=new URL(e.url),n="string"==typeof t?M(t):t;if(r.pathname=n.pathname||"/",n.search){let e=new URLSearchParams(n.search),t=e.getAll("index");e.delete("index");for(let r of t.filter(Boolean))e.append("index",r);r.search=e.size?`?${e.toString()}`:""}else r.search="";return r.hash=n.hash||"",r}function gt(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function wt(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function bt(e,t,r,n,a,o,i){let{loaderData:l,errors:s}=function(e,t,r,n=!1,a=!1){let o,i={},l=null,s=!1,u={},c=r&&Tt(r[1])?r[1].error:void 0;return e.forEach(r=>{if(!(r.route.id in t))return;let d=r.route.id,h=t[d];if(S(!Dt(h),"Cannot handle redirect results in processLoaderData"),Tt(h)){let t=h.error;if(void 0!==c&&(t=c,c=void 0),l=l||{},a)l[d]=t;else{let r=St(e,d);null==l[r.route.id]&&(l[r.route.id]=t)}n||(i[d]=qe),s||(s=!0,o=ve(h.error)?h.error.status:500),h.headers&&(u[d]=h.headers)}else i[d]=h.data,h.statusCode&&200!==h.statusCode&&!s&&(o=h.statusCode),h.headers&&(u[d]=h.headers)}),void 0!==c&&r&&(l={[r[0]]:c},r[2]&&(i[r[2]]=void 0)),{loaderData:i,errors:l,statusCode:o||200,loaderHeaders:u}}(t,r,n);return a.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:r,match:n,controller:a}=t;if(a&&a.signal.aborted)return;let l=o[r];if(S(l,"Did not find corresponding fetcher result"),Tt(l)){let t=St(e.matches,n?.route.id);s&&s[t.route.id]||(s={...s,[t.route.id]:l.error}),i.delete(r)}else if(Dt(l))S(!1,"Unhandled fetcher revalidation redirect");else{let e=Ut(l.data);i.set(r,e)}}),{loaderData:l,errors:s}}function Et(e,t,r,n){let a=Object.entries(t).filter(([,e])=>e!==qe).reduce((e,[t,r])=>(e[t]=r,e),{});for(let o of r){let r=o.route.id;if(!t.hasOwnProperty(r)&&e.hasOwnProperty(r)&&o.route.loader&&(a[r]=e[r]),n&&n.hasOwnProperty(r))break}return a}function Rt(e){return e?Tt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function St(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 xt(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 kt(e,{pathname:t,routeId:r,method:n,type:a,message:o}={}){let i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",n&&t&&r?l=`You made a ${n} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:"invalid-body"===a&&(l="Unable to encode submission body")):403===e?(i="Forbidden",l=`Route "${r}" does not match URL "${t}"`):404===e?(i="Not Found",l=`No route matches URL "${t}"`):405===e&&(i="Method Not Allowed",n&&t&&r?l=`You made a ${n.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(l=`Invalid request method "${n.toUpperCase()}"`)),new ye(e||500,i,new Error(l),!0)}function Lt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[e,n]=t[r];if(Dt(n))return{key:e,result:n}}}function Ct(e){return C({..."string"==typeof e?M(e):e,hash:""})}function Mt(e){return null!=e&&"object"==typeof e&&Object.entries(e).every(([e,t])=>"string"==typeof e&&function(e){return null!=e&&"object"==typeof e&&"type"in e&&"result"in e&&("data"===e.type||"error"===e.type)}(t))}function Pt(e){return $t(e.result)&&He.has(e.result.status)}function Tt(e){return"error"===e.type}function Dt(e){return"redirect"===(e&&e.type)}function Ot(e){return"object"==typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function $t(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function At(e){return je.has(e.toUpperCase())}function jt(e){return new URLSearchParams(e).getAll("index").some(e=>""===e)}function _t(e,t){let r="string"==typeof t?M(t).search:t.search;if(e[e.length-1].route.index&&jt(r||""))return e[e.length-1];let n=oe(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 Ht(e,t,r,n){return n?{state:"loading",location:e,matches:t,historyAction:r,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}:{state:"loading",location:e,matches:t,historyAction:r,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Ft(e,t,r,n){return{state:"submitting",location:e,matches:t,historyAction:r,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}}function zt(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 Ut(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 It(){let e,t,r=new Promise((n,a)=>{e=async e=>{n(e);try{await r}catch(t){}},t=async e=>{a(e);try{await r}catch(t){}}});return{promise:r,resolve:e,reject:t}}var Bt=h.createContext(null);Bt.displayName="DataRouter";var Wt=h.createContext(null);Wt.displayName="DataRouterState";var qt=h.createContext(!1);function Jt(){return h.useContext(qt)}var Yt=h.createContext({isTransitioning:!1});Yt.displayName="ViewTransition";var Vt=h.createContext(new Map);Vt.displayName="Fetchers";var Kt=h.createContext(null);Kt.displayName="Await";var Xt=h.createContext(null);Xt.displayName="Navigation";var Gt=h.createContext(null);Gt.displayName="Location";var Zt=h.createContext({outlet:null,matches:[],isDataRoute:!1});Zt.displayName="Route";var Qt=h.createContext(null);Qt.displayName="RouteError";var er="REACT_ROUTER_ERROR";function tr(){return null!=h.useContext(Gt)}function rr(){return S(tr(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(Gt).location}var nr="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ar(e){h.useContext(Xt).static||h.useLayoutEffect(e)}function or(){let{isDataRoute:e}=h.useContext(Zt);return e?function(){let{router:e}=function(e){let t=h.useContext(Bt);return S(t,vr(e)),t}("useNavigate"),t=wr("useNavigate"),r=h.useRef(!1);return ar(()=>{r.current=!0}),h.useCallback(async(n,a={})=>{x(r.current,nr),r.current&&("number"==typeof n?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...a}))},[e,t])}():function(){S(tr(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(Bt),{basename:t,navigator:r}=h.useContext(Xt),{matches:n}=h.useContext(Zt),{pathname:a}=rr(),o=JSON.stringify(ie(n)),i=h.useRef(!1);return ar(()=>{i.current=!0}),h.useCallback((n,l={})=>{if(x(i.current,nr),!i.current)return;if("number"==typeof n)return void r.go(n);let s=le(n,JSON.parse(o),a,"path"===l.relative);null==e&&"/"!==t&&(s.pathname="/"===s.pathname?t:ue([t,s.pathname])),(l.replace?r.replace:r.push)(s,l.state,l)},[t,r,o,a,e])}()}var ir=h.createContext(null);function lr(){return h.useContext(ir)}function sr(){let{matches:e}=h.useContext(Zt);return e[e.length-1]?.params??{}}function ur(e,{relative:t}={}){let{matches:r}=h.useContext(Zt),{pathname:n}=rr(),a=JSON.stringify(ie(r));return h.useMemo(()=>le(e,JSON.parse(a),n,"path"===t),[e,a,n,t])}function cr(e,t,r){S(tr(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=h.useContext(Xt),{matches:a}=h.useContext(Zt),o=a[a.length-1],i=o?o.params:{},l=o?o.pathname:"/",s=o?o.pathnameBase:"/",u=o&&o.route;{let e=u&&u.path||"";kr(l,!u||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}let c,d=rr();if(t){let e="string"==typeof t?M(t):t;S("/"===s||e.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`),c=e}else c=d;let f=c.pathname||"/",m=f;if("/"!==s){let e=s.replace(/^\//,"").split("/");m="/"+f.replace(/^\//,"").split("/").slice(e.length).join("/")}let p=r&&r.state.matches.length?r.state.matches.map(e=>Object.assign(e,{route:r.manifest[e.route.id]||e.route})):N(e,{pathname:m});x(u||null!=p,`No routes matched location "${c.pathname}${c.search}${c.hash}" `),x(null==p||void 0!==p[p.length-1].route.element||void 0!==p[p.length-1].route.Component||void 0!==p[p.length-1].route.lazy,`Matched leaf route at location "${c.pathname}${c.search}${c.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let y=function(e,t=[],r){let n=r?.state;if(null==e){if(!n)return null;if(n.errors)e=n.matches;else{if(0!==t.length||n.initialized||!(n.matches.length>0))return null;e=n.matches}}let a=e,o=n?.errors;if(null!=o){let e=a.findIndex(e=>e.route.id&&void 0!==o?.[e.route.id]);S(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),a=a.slice(0,Math.min(a.length,e+1))}let i=!1,l=-1;if(r&&n){i=n.renderFallback;for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(l=e),t.route.id){let{loaderData:e,errors:o}=n,s=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!o||void 0===o[t.route.id]);if(t.route.lazy||s){r.isStatic&&(i=!0),a=l>=0?a.slice(0,l+1):[a[0]];break}}}}let s=r?.onError,u=n&&s?(e,t)=>{s(e,{location:n.location,params:n.matches?.[0]?.params??{},pattern:ge(n.matches),errorInfo:t})}:void 0;return a.reduceRight((e,r,s)=>{let c,d=!1,f=null,m=null;n&&(c=o&&r.route.id?o[r.route.id]:void 0,f=r.route.errorElement||hr,i&&(l<0&&0===s?(kr("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,m=null):l===s&&(d=!0,m=r.route.hydrateFallbackElement||null)));let p=t.concat(a.slice(0,s+1)),y=()=>{let t;return t=c?f:d?m:r.route.Component?h.createElement(r.route.Component,null):r.route.element?r.route.element:e,h.createElement(yr,{match:r,routeContext:{outlet:e,matches:p,isDataRoute:null!=n},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===s)?h.createElement(fr,{location:n.location,revalidation:n.revalidation,component:f,error:c,children:y(),routeContext:{outlet:null,matches:p,isDataRoute:!0},onError:u}):y()},null)}(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},i,e.params),pathname:ue([s,n.encodeLocation?n.encodeLocation(e.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?s:ue([s,n.encodeLocation?n.encodeLocation(e.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])})),a,r);return t&&y?h.createElement(Gt.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...c},navigationType:"POP"}},y):y}function dr(){let e=Sr(),t=ve(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},o={padding:"2px 4px",backgroundColor:n},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:o},"ErrorBoundary")," or"," ",h.createElement("code",{style:o},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),r?h.createElement("pre",{style:a},r):null,i)}var hr=h.createElement(dr,null),fr=class extends h.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){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&"object"==typeof e&&e&&"digest"in e&&"string"==typeof e.digest){const t=function(e){if(e.startsWith(`${er}:ROUTE_ERROR_RESPONSE:{`))try{let t=JSON.parse(e.slice(40));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText)return new ye(t.status,t.statusText,t.data)}catch{}}(e.digest);t&&(e=t)}let t=void 0!==e?h.createElement(Zt.Provider,{value:this.props.routeContext},h.createElement(Qt.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?h.createElement(pr,{error:e},t):t}};fr.contextType=qt;var mr=new WeakMap;function pr({children:e,error:t}){let{basename:r}=h.useContext(Xt);if("object"==typeof t&&t&&"digest"in t&&"string"==typeof t.digest){let e=function(e){if(e.startsWith(`${er}:REDIRECT:{`))try{let t=JSON.parse(e.slice(28));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"string"==typeof t.location&&"boolean"==typeof t.reloadDocument&&"boolean"==typeof t.replace)return t}catch{}}(t.digest);if(e){let n=mr.get(t);if(n)throw n;let a=be(e.location,r);if(we&&!mr.get(t)){if(!a.isExternal&&!e.reloadDocument){const r=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw mr.set(t,r),r}window.location.href=a.absoluteURL||a.to}return h.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function yr({routeContext:e,match:t,children:r}){let n=h.useContext(Bt);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(Zt.Provider,{value:e},r)}function vr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gr(e){let t=h.useContext(Wt);return S(t,vr(e)),t}function wr(e){let t=function(e){let t=h.useContext(Zt);return S(t,vr(e)),t}(e),r=t.matches[t.matches.length-1];return S(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function br(){let{matches:e,loaderData:t}=gr("useMatches");return h.useMemo(()=>e.map(e=>F(e,t)),[e,t])}function Er(){let e=gr("useLoaderData"),t=wr("useLoaderData");return e.loaderData[t]}function Rr(){let e=gr("useActionData"),t=wr("useLoaderData");return e.actionData?e.actionData[t]:void 0}function Sr(){let e=h.useContext(Qt),t=gr("useRouteError"),r=wr("useRouteError");return void 0!==e?e:t.errors?.[r]}var xr={};function kr(e,t,r){t||xr[e]||(xr[e]=!0,x(!1,r))}var Lr={};function Cr(e,t){e||Lr[t]||(Lr[t]=!0,console.warn(t))}var Mr=h.useOptimistic,Pr=()=>{};function Tr(e){let t={hasErrorBoundary:e.hasErrorBoundary||null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&(e.element&&x(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:h.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&x(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:h.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&x(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:h.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Dr=["HydrateFallback","hydrateFallbackElement"],Or=class{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 $r({router:e,flushSync:t,onError:r,useTransitions:n}){n=Jt()||n;let[a,o]=h.useState(e.state),[i,l]=(s=a,Mr?Mr(s):[s,Pr]);var s;let[u,c]=h.useState(),[d,f]=h.useState({isTransitioning:!1}),[m,p]=h.useState(),[y,v]=h.useState(),[g,w]=h.useState(),b=h.useRef(new Map),E=h.useCallback((a,{deletedFetchers:i,newErrors:s,flushSync:u,viewTransitionOpts:d})=>{s&&r&&Object.values(s).forEach(e=>r(e,{location:a.location,params:a.matches[0]?.params??{},pattern:ge(a.matches)})),a.fetchers.forEach((e,t)=>{void 0!==e.data&&b.current.set(t,e.data)}),i.forEach(e=>b.current.delete(e)),Cr(!1===u||null!=t,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let g=null!=e.window&&null!=e.window.document&&"function"==typeof e.window.document.startViewTransition;if(Cr(null==d||g,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),d&&g){if(t&&u){t(()=>{y&&(m?.resolve(),y.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:d.currentLocation,nextLocation:d.nextLocation})});let r=e.window.document.startViewTransition(()=>{t(()=>o(a))});return r.finished.finally(()=>{t(()=>{p(void 0),v(void 0),c(void 0),f({isTransitioning:!1})})}),void t(()=>v(r))}y?(m?.resolve(),y.skipTransition(),w({state:a,currentLocation:d.currentLocation,nextLocation:d.nextLocation})):(c(a),f({isTransitioning:!0,flushSync:!1,currentLocation:d.currentLocation,nextLocation:d.nextLocation}))}else t&&u?t(()=>o(a)):!1===n?o(a):h.startTransition(()=>{!0===n&&l(e=>Ar(e,a)),o(a)})},[e.window,t,y,m,n,l,r]);h.useLayoutEffect(()=>e.subscribe(E),[e,E]),h.useEffect(()=>{d.isTransitioning&&!d.flushSync&&p(new Or)},[d]),h.useEffect(()=>{if(m&&u&&e.window){let t=u,r=m.promise,a=e.window.document.startViewTransition(async()=>{!1===n?o(t):h.startTransition(()=>{!0===n&&l(e=>Ar(e,t)),o(t)}),await r});a.finished.finally(()=>{p(void 0),v(void 0),c(void 0),f({isTransitioning:!1})}),v(a)}},[u,m,e.window,n,l]),h.useEffect(()=>{m&&u&&i.location.key===u.location.key&&m.resolve()},[m,y,i.location,u]),h.useEffect(()=>{!d.isTransitioning&&g&&(c(g.state),f({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),w(void 0))},[d.isTransitioning,g]);let R=h.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,r,n)=>e.navigate(t,{state:r,preventScrollReset:n?.preventScrollReset}),replace:(t,r,n)=>e.navigate(t,{replace:!0,state:r,preventScrollReset:n?.preventScrollReset})}),[e]),S=e.basename||"/",x=h.useMemo(()=>({router:e,navigator:R,static:!1,basename:S,onError:r}),[e,R,S,r]);return h.createElement(h.Fragment,null,h.createElement(Bt.Provider,{value:x},h.createElement(Wt.Provider,{value:i},h.createElement(Vt.Provider,{value:b.current},h.createElement(Yt.Provider,{value:d},h.createElement(Hr,{basename:S,location:i.location,navigationType:i.historyAction,navigator:R,useTransitions:n},h.createElement(jr,{routes:e.routes,manifest:e.manifest,future:e.future,state:i,isStatic:!1,onError:r})))))),null)}function Ar(e,t){return{...e,navigation:"idle"!==t.navigation.state?t.navigation:e.navigation,revalidation:"idle"!==t.revalidation?t.revalidation:e.revalidation,actionData:"submitting"!==t.navigation.state?t.actionData:e.actionData,fetchers:t.fetchers}}var jr=h.memo(function({routes:e,manifest:t,future:r,state:n,isStatic:a,onError:o}){return cr(e,void 0,{manifest:t,state:n,isStatic:a,onError:o,future:r})});function _r({to:e,replace:t,state:r,relative:n}){S(tr(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a}=h.useContext(Xt);x(!a,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=h.useContext(Zt),{pathname:i}=rr(),l=or(),s=le(e,ie(o),i,"path"===n),u=JSON.stringify(s);return h.useEffect(()=>{l(JSON.parse(u),{replace:t,state:r,relative:n})},[l,u,n,t,r]),null}function Nr(e){return function(e){let t=h.useContext(Zt).outlet;return h.useMemo(()=>t&&h.createElement(ir.Provider,{value:e},t),[t,e])}(e.context)}function Hr({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:o=!1,useTransitions:i}){S(!tr(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=h.useMemo(()=>({basename:l,navigator:a,static:o,useTransitions:i,future:{}}),[l,a,o,i]);"string"==typeof r&&(r=M(r));let{pathname:u="/",search:c="",hash:d="",state:f=null,key:m="default",mask:p}=r,y=h.useMemo(()=>{let e=ee(u,l);return null==e?null:{location:{pathname:e,search:c,hash:d,state:f,key:m,mask:p},navigationType:n}},[l,u,c,d,f,m,n,p]);return x(null!=y,`<Router basename="${l}"> is not able to match the URL "${u}${c}${d}" because it does not start with the basename, so the <Router> won't render anything.`),null==y?null:h.createElement(Xt.Provider,{value:s},h.createElement(Gt.Provider,{children:t,value:y}))}h.Component;function Fr(e){return function(){const t={params:sr(),loaderData:Er(),actionData:Rr(),matches:br()};return h.createElement(e,t)}}function zr(e){return function(){const t={params:sr(),loaderData:Er(),actionData:Rr(),error:Sr()};return h.createElement(e,t)}}var Ur="get",Ir="application/x-www-form-urlencoded";function Br(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement}var Wr=null;var qr=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Jr(e){return null==e||qr.has(e)?e:(x(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ir}"`),null)}function Yr(e,t){let r,n,a,o,i;if(Br(l=e)&&"form"===l.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?ee(i,t):null,r=e.getAttribute("method")||Ur,a=Jr(e.getAttribute("enctype"))||Ir,o=new FormData(e)}else if(function(e){return Br(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Br(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?ee(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||Ur,a=Jr(e.getAttribute("formenctype"))||Jr(i.getAttribute("enctype"))||Ir,o=new FormData(i,e),!function(){if(null===Wr)try{new FormData(document.createElement("form"),0),Wr=!1}catch(e){Wr=!0}return Wr}()){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(Br(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Ur,n=null,a=Ir,i=e}var l;return o&&"text/plain"===a&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}var Vr=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Kr=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Xr="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:void 0;function Gr(e){const{hydrated:t,values:r}=this;if("number"==typeof e)return Zr.call(this,e);if(!Array.isArray(e)||!e.length)throw new SyntaxError;const n=r.length;for(const a of e)r.push(a);return t.length=r.length,Zr.call(this,n)}function Zr(e){const{hydrated:t,values:r,deferred:n,plugins:a}=this;let o;const i=[[e,e=>{o=e}]];let l=[];for(;i.length>0;){const[e,o]=i.pop();switch(e){case-7:o(void 0);continue;case-5:o(null);continue;case-2:o(NaN);continue;case-6:o(1/0);continue;case-3:o(-1/0);continue;case-4:o(-0);continue}if(t[e]){o(t[e]);continue}const s=r[e];if(s&&"object"==typeof s){if(!Array.isArray(s)){const r={};t[e]=r;for(const e of Object.keys(s).reverse()){const t=[];i.push([s[e],e=>{t[1]=e}]),i.push([Number(e.slice(1)),e=>{t[0]=e}]),l.push(()=>{r[t[0]]=t[1]})}o(r);continue}if("string"!=typeof s[0]){const r=[];t[e]=r;for(let e=0;e<s.length;e++){const t=s[e];-1!==t&&i.push([t,t=>{r[e]=t}])}o(r);continue}{const[r,u,c]=s;switch(r){case"D":o(t[e]=new Date(u));continue;case"U":o(t[e]=new URL(u));continue;case"B":o(t[e]=BigInt(u));continue;case"R":o(t[e]=new RegExp(u,c));continue;case"Y":o(t[e]=Symbol.for(u));continue;case"S":const r=new Set;t[e]=r;for(let e=s.length-1;e>0;e--)i.push([s[e],e=>{r.add(e)}]);o(r);continue;case"M":const d=new Map;t[e]=d;for(let e=s.length-2;e>0;e-=2){const t=[];i.push([s[e+1],e=>{t[1]=e}]),i.push([s[e],e=>{t[0]=e}]),l.push(()=>{d.set(t[0],t[1])})}o(d);continue;case"N":const h=Object.create(null);t[e]=h;for(const e of Object.keys(u).reverse()){const t=[];i.push([u[e],e=>{t[1]=e}]),i.push([Number(e.slice(1)),e=>{t[0]=e}]),l.push(()=>{h[t[0]]=t[1]})}o(h);continue;case"P":if(t[u])o(t[e]=t[u]);else{const r=new Kr;n[u]=r,o(t[e]=r.promise)}continue;case"E":const[,f,m]=s;let p=m&&Xr&&Vr.includes(m)&&m in Xr&&"function"==typeof Xr[m]?new Xr[m](f):new Error(f);t[e]=p,o(p);continue;case"Z":o(t[e]=t[u]);continue;default:if(Array.isArray(a)){const r=[],n=s.slice(1);for(let e=0;e<n.length;e++){const t=n[e];i.push([t,t=>{r[e]=t}])}l.push(()=>{for(const n of a){const a=n(s[0],...r);if(a)return void o(t[e]=a.value)}throw new SyntaxError});continue}throw new SyntaxError}}}else t[e]=s,o(s)}for(;l.length>0;)l.pop()();return o}async function Qr(e,t){const{plugins:r}=t??{},n=new Kr,a=e.pipeThrough(function(){const e=new TextDecoder;let t="";return new TransformStream({transform(r,n){const a=e.decode(r,{stream:!0}),o=(t+a).split("\n");t=o.pop()||"";for(const e of o)n.enqueue(e)},flush(e){t&&e.enqueue(t)}})}()).getReader(),o={values:[],hydrated:[],deferred:{},plugins:r},i=await en.call(o,a);let l=n.promise;return i.done?n.resolve():l=tn.call(o,a).then(n.resolve).catch(e=>{for(const t of Object.values(o.deferred))t.reject(e);n.reject(e)}),{done:l.then(()=>a.closed),value:i.value}}async function en(e){const t=await e.read();if(!t.value)throw new SyntaxError;let r;try{r=JSON.parse(t.value)}catch(n){throw new SyntaxError}return{done:t.done,value:Gr.call(this,r)}}async function tn(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const n=t.value;switch(n[0]){case"P":{const e=n.indexOf(":"),t=Number(n.slice(1,e)),a=this.deferred[t];if(!a)throw new Error(`Deferred ID ${t} not found in stream`);const o=n.slice(e+1);let i;try{i=JSON.parse(o)}catch(r){throw new SyntaxError}const l=Gr.call(this,i);a.resolve(l);break}case"E":{const e=n.indexOf(":"),t=Number(n.slice(1,e)),a=this.deferred[t];if(!a)throw new Error(`Deferred ID ${t} not found in stream`);const o=n.slice(e+1);let i;try{i=JSON.parse(o)}catch(r){throw new SyntaxError}const l=Gr.call(this,i);a.reject(l);break}default:throw new SyntaxError}t=await e.read()}}var rn={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},nn=/[&><\u2028\u2029]/g;function an(e){return e.replace(nn,e=>rn[e])}function on(e,t){if(!1===e||null==e)throw new Error(t)}var ln,sn=Symbol("SingleFetchRedirect"),un=class extends Error{},cn=new Set([100,101,204,205]);function dn(e,t,r,n,a,o){let i=function(e,t,r,n,a,o,i=()=>!0){return async l=>{let{request:s,matches:u,fetcherKey:c}=l,d=e();if("GET"!==s.method)return async function(e,t,r,n){let a=e.matches.find(e=>e.shouldCallHandler());on(a,"No action match found");let o,i=await a.resolve(async i=>await i(async()=>{let{data:i,status:l}=await t(e,r,n,[a.route.id]);return o=l,pn(i,a.route.id)}));return $t(i.result)||ve(i.result)||Ot(i.result)?{[a.route.id]:i}:{[a.route.id]:{type:i.type,result:pe(i.result,o)}}}(l,r,a,o);let h=u.some(e=>{let{hasLoader:r,hasClientLoader:n}=t(e);return e.shouldCallHandler()&&r&&!n});return n||h?c?async function(e,t,r,n){let a=e.matches.find(e=>e.shouldCallHandler());on(a,"No fetcher match found");let o=a.route.id,i=await a.resolve(async a=>a(async()=>{let{data:a}=await t(e,r,n,[o]);return pn(a,o)}));return{[a.route.id]:i}}(l,r,a,o):async function(e,t,r,n,a,o,i,l=()=>!0){let s=new Set,u=!1,c=e.matches.map(()=>yn()),d=yn(),h={},f=Promise.all(e.matches.map(async(t,a)=>t.resolve(async f=>{c[a].resolve();let m=t.route.id,{hasLoader:p,hasClientLoader:y}=r(t),v=!t.shouldRevalidateArgs||null==t.shouldRevalidateArgs.actionStatus||t.shouldRevalidateArgs.actionStatus<400;if(t.shouldCallHandler(v))if(l(t)&&y){p&&(u=!0);try{h[m]={type:"data",result:await f(async()=>{let{data:t}=await n(e,o,i,[m]);return pn(t,m)})}}catch(g){h[m]={type:"error",result:g}}}else{p&&s.add(m);try{h[m]={type:"data",result:await f(async()=>pn(await d.promise,m))}}catch(g){h[m]={type:"error",result:g}}}else u||(u=null!=t.shouldRevalidateArgs&&p)})));if(await Promise.all(c.map(e=>e.promise)),(t.state.initialized||"idle"!==t.state.navigation.state)&&0!==s.size||window.__reactRouterHdrActive){let t=a&&u&&s.size>0?[...s.keys()]:void 0;try{let r=await n(e,o,i,t);d.resolve(r.data)}catch(m){d.reject(m)}}else d.resolve({routes:{}});return await f,await async function(e,t,r,n){try{let a,o=await e;if("routes"in o)for(let e of t)if(e.route.id in o.routes){let t=o.routes[e.route.id];if("error"in t){a=t.error,null==n[e.route.id]?.result&&(n[e.route.id]={type:"error",result:a});break}}void 0!==a&&Array.from(r.values()).forEach(e=>{n[e].result instanceof un&&(n[e].result=a)})}catch(m){}}(d.promise,e.matches,s,h),h}(l,d,t,r,n,a,o,i):async function(e,t,r,n,a){let o=e.matches.filter(e=>e.shouldCallHandler()),i={};return await Promise.all(o.map(o=>o.resolve(async l=>{try{let{hasClientLoader:s}=t(o),u=o.route.id,c=s?await l(async()=>{let{data:t}=await r(e,n,a,[u]);return pn(t,u)}):await l();i[o.route.id]={type:"data",result:c}}catch(s){i[o.route.id]={type:"error",result:s}}}))),i}(l,t,r,a,o)}}(e,e=>{let r=t.routes[e.route.id];return on(r,"Route not found in manifest"),{hasLoader:r.hasLoader,hasClientLoader:r.hasClientLoader}},fn,n,a,o);return async e=>e.runClientMiddleware(i)}function hn(e,t,r,n){let a="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return r?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${n}`:a.pathname=`${a.pathname}.${n}`:"/"===a.pathname?a.pathname=`_root.${n}`:t&&"/"===ee(a.pathname,t)?a.pathname=`${ce(t)}/_root.${n}`:a.pathname=`${ce(a.pathname)}.${n}`,a}async function fn(e,t,r,n){let{request:a}=e,o=hn(a.url,t,r,"data");"GET"===a.method&&(o=function(e){let t=e.searchParams.getAll("index");e.searchParams.delete("index");let r=[];for(let n of t)n&&r.push(n);for(let n of r)e.searchParams.append("index",n);return e}(o),n&&o.searchParams.set("_routes",n.join(",")));let i=await fetch(o,await async function(e){let t={signal:e.signal};if("GET"!==e.method){t.method=e.method;let r=e.headers.get("Content-Type");r&&/\bapplication\/json\b/.test(r)?(t.headers={"Content-Type":r},t.body=JSON.stringify(await e.json())):r&&/\btext\/plain\b/.test(r)?(t.headers={"Content-Type":r},t.body=await e.text()):r&&/\bapplication\/x-www-form-urlencoded\b/.test(r)?t.body=new URLSearchParams(await e.text()):t.body=await e.formData()}return t}(a));if(i.status>=400&&!i.headers.has("X-Remix-Response"))throw new ye(i.status,i.statusText,await i.text());if(204===i.status&&i.headers.has("X-Remix-Redirect"))return{status:202,data:{redirect:{redirect:i.headers.get("X-Remix-Redirect"),status:Number(i.headers.get("X-Remix-Status")||"302"),revalidate:"true"===i.headers.get("X-Remix-Revalidate"),reload:"true"===i.headers.get("X-Remix-Reload-Document"),replace:"true"===i.headers.get("X-Remix-Replace")}}};if(cn.has(i.status)){let e={};return n&&"GET"!==a.method&&(e[n[0]]={data:void 0}),{status:i.status,data:{routes:e}}}on(i.body,"No response body to decode");try{let e,t=await mn(i.body,window);if("GET"===a.method){let r=t.value;e=sn in r?{redirect:r[sn]}:{routes:r}}else{let r=t.value,a=n?.[0];on(a,"No routeId found for single fetch call decoding"),e="redirect"in r?{redirect:r}:{routes:{[a]:r}}}return{status:i.status,data:e}}catch(l){throw new Error("Unable to decode turbo-stream response")}}function mn(e,t){return Qr(e,{plugins:[(e,...r)=>{if("SanitizedError"===e){let[e,n,a]=r,o=Error;e&&Vr.includes(e)&&e in t&&"function"==typeof t[e]&&(o=t[e]);let i=new o(n);return i.stack=a,{value:i}}if("ErrorResponse"===e){let[e,t,n]=r;return{value:new ye(t,n,e)}}return"SingleFetchRedirect"===e?{value:{[sn]:r[0]}}:"SingleFetchClassInstance"===e?{value:r[0]}:"SingleFetchFallback"===e?{value:void 0}:void 0}]})}function pn(e,t){if("redirect"in e){let{redirect:t,revalidate:r,reload:n,replace:a,status:o}=e.redirect;throw((e,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,{...r,headers:n})})(t,{status:o,headers:{...r?{"X-Remix-Revalidate":"yes"}:null,...n?{"X-Remix-Reload-Document":"yes"}:null,...a?{"X-Remix-Replace":"yes"}:null}})}let r=e.routes[t];if(null==r)throw new un(`No result found for routeId "${t}"`);if("error"in r)throw r.error;if("data"in r)return r.data;throw new Error(`Invalid response found for routeId "${t}"`)}function yn(){let e,t,r=new Promise((n,a)=>{e=async e=>{n(e);try{await r}catch(t){}},t=async e=>{a(e);try{await r}catch(t){}}});return{promise:r,resolve:e,reject:t}}async function vn(e,t){if(e.id in t)return t[e.id];try{let r=await m(()=>import(e.module),[]);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function gn(e){return e.css?e.css.map(e=>({rel:"stylesheet",href:e})):[]}async function wn(e,t){if(!e.css&&!t.links||!function(){if(void 0!==ln)return ln;let e=document.createElement("link");return ln=e.relList.supports("preload"),e=null,ln}())return;let r=[];if(e.css&&r.push(...gn(e)),t.links&&r.push(...t.links()),0===r.length)return;let n=[];for(let a of r)En(a)||"stylesheet"!==a.rel||n.push({...a,rel:"preload",as:"style"});await Promise.all(n.map(bn))}async function bn(e){return new Promise(t=>{if(e.media&&!window.matchMedia(e.media).matches||document.querySelector(`link[rel="stylesheet"][href="${e.href}"]`))return t();let r=document.createElement("link");function n(){document.head.contains(r)&&document.head.removeChild(r)}Object.assign(r,e),r.onload=()=>{n(),t()},r.onerror=()=>{n(),t()},document.head.appendChild(r)})}function En(e){return null!=e&&"string"==typeof e.page}function Rn(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}function Sn(e,t,r,n,a,o){let i=(e,t)=>!r[t]||e.route.id!==r[t].route.id,l=(e,t)=>r[t].pathname!==e.pathname||r[t].route.path?.endsWith("*")&&r[t].params["*"]!==e.params["*"];return"assets"===o?t.filter((e,t)=>i(e,t)||l(e,t)):"data"===o?t.filter((t,o)=>{let s=n.routes[t.route.id];if(!s||!s.hasLoader)return!1;if(i(t,o)||l(t,o))return!0;if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof n)return n}return!0}):[]}function xn(e,t,{includeHydrateFallback:r}={}){return n=e.map(e=>{let n=t.routes[e.route.id];if(!n)return[];let a=[n.module];return n.clientActionModule&&(a=a.concat(n.clientActionModule)),n.clientLoaderModule&&(a=a.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(a=a.concat(n.hydrateFallbackModule)),n.imports&&(a=a.concat(n.imports)),a}).flat(1),[...new Set(n)];var n}function kn(e,t){let r=new Set,n=new Set(t);return e.reduce((e,a)=>{if(t&&!En(a)&&"script"===a.as&&a.href&&n.has(a.href))return e;let o=JSON.stringify(function(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}(a));return r.has(o)||(r.add(o),e.push({key:o,link:a})),e},[])}function Ln(){return h.createElement(la,{title:"Loading...",renderScripts:!0},h.createElement("script",{dangerouslySetInnerHTML:{__html:'\n console.log(\n "💿 Hey developer 👋. You can provide a way better UX than this " +\n "when your app is loading JS modules and/or running `clientLoader` " +\n "functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +\n "for more information."\n );\n '}}))}function Cn(e){let t={};return Object.values(e).forEach(e=>{if(e){let r=e.parentId||"";t[r]||(t[r]=[]),t[r].push(e)}}),t}function Mn(e,t,r){let n=An(t),a=!t.HydrateFallback||r&&"root"!==e.id?"root"===e.id?Ln:void 0:t.HydrateFallback,o=t.ErrorBoundary?t.ErrorBoundary:"root"===e.id?()=>h.createElement(ia,{error:Sr()}):void 0;return"root"===e.id&&t.Layout?{...n?{element:h.createElement(t.Layout,null,h.createElement(n,null))}:{Component:n},...o?{errorElement:h.createElement(t.Layout,null,h.createElement(o,null))}:{ErrorBoundary:o},...a?{hydrateFallbackElement:h.createElement(t.Layout,null,h.createElement(a,null))}:{HydrateFallback:a}}:{Component:n,ErrorBoundary:o,HydrateFallback:a}}function Pn(e,t,r,n,a,o){return On(t,r,n,a,o,"",Cn(t),e)}function Tn(e,t){if("loader"===e&&!t.hasLoader||"action"===e&&!t.hasAction){let r=`You are trying to call ${"action"===e?"serverAction()":"serverLoader()"} on a route that does not have a server ${e} (routeId: "${t.id}")`;throw console.error(r),new ye(400,"Bad Request",new Error(r),!0)}}function Dn(e,t){let r="clientAction"===e?"a":"an",n=`Route "${t}" does not have ${r} ${e}, but you are trying to submit to it. To fix this, please add ${r} \`${e}\` function to the route`;throw console.error(n),new ye(405,"Method Not Allowed",new Error(n),!0)}function On(e,t,r,n,a,o="",i=Cn(e),l){return(i[o]||[]).map(o=>{let s=t[o.id];function u(e){return on("function"==typeof e,"No single fetch function available for route handler"),e()}function c(e){return o.hasLoader?u(e):Promise.resolve(null)}function d(e){if(!o.hasAction)throw Dn("action",o.id);return u(e)}function h(e){m(()=>import(e),[])}function f(e){e.clientActionModule&&h(e.clientActionModule),e.clientLoaderModule&&h(e.clientLoaderModule)}async function p(e){let r=t[o.id],n=r?wn(o,r):Promise.resolve();try{return e()}finally{await n}}let y={id:o.id,index:o.index,path:o.path};if(s){Object.assign(y,{...y,...Mn(o,s,a),middleware:s.clientMiddleware,handle:s.handle,shouldRevalidate:$n(y.path,s,o,n,l)});let g=r&&r.loaderData&&o.id in r.loaderData,w=g?r?.loaderData?.[o.id]:void 0,b=r&&r.errors&&o.id in r.errors,E=b?r?.errors?.[o.id]:void 0,R=null==l&&(!0===s.clientLoader?.hydrate||!o.hasLoader);y.loader=async({request:e,params:t,context:r,pattern:n,url:a},i)=>{let l=R;return R=!1,await p(async()=>(on(s,"No `routeModule` available for critical-route loader"),s.clientLoader?s.clientLoader({request:e,params:t,context:r,pattern:n,url:a,async serverLoader(){if(Tn("loader",o),l){if(g)return w;if(b)throw E}return c(i)}}):c(i)))},y.loader.hydrate=jn(o.id,s.clientLoader,o.hasLoader,a),y.action=({request:e,params:t,context:r,pattern:n,url:i},l)=>p(async()=>{if(on(s,"No `routeModule` available for critical-route action"),!s.clientAction){if(a)throw Dn("clientAction",o.id);return d(l)}return s.clientAction({request:e,params:t,context:r,pattern:n,url:i,serverAction:async()=>(Tn("action",o),d(l))})})}else{let S;async function x(){return S||(S=(async()=>{(o.clientLoaderModule||o.clientActionModule)&&await new Promise(e=>setTimeout(e,0));let e=async function(e,t){let r=vn(e,t),n=async function(e){if(!e.css)return;let t=gn(e);await Promise.all(t.map(bn))}(e),a=await r;return await Promise.all([n,wn(e,a)]),{Component:An(a),ErrorBoundary:a.ErrorBoundary,clientMiddleware:a.clientMiddleware,clientAction:a.clientAction,clientLoader:a.clientLoader,handle:a.handle,links:a.links,meta:a.meta,shouldRevalidate:a.shouldRevalidate}}(o,t);return f(o),await e})()),await S}o.hasClientLoader||(y.loader=(e,t)=>p(()=>c(t))),o.hasClientAction||(y.action=(e,t)=>p(()=>{if(a)throw Dn("clientAction",o.id);return d(t)})),y.lazy={loader:o.hasClientLoader?async()=>{let{clientLoader:e}=o.clientLoaderModule?await m(()=>import(o.clientLoaderModule),[]):await x();return on(e,"No `clientLoader` export found"),(t,r)=>e({...t,serverLoader:async()=>(Tn("loader",o),c(r))})}:void 0,action:o.hasClientAction?async()=>{let e=o.clientActionModule?m(()=>import(o.clientActionModule),[]):x();f(o);let{clientAction:t}=await e;return on(t,"No `clientAction` export found"),(e,r)=>t({...e,serverAction:async()=>(Tn("action",o),d(r))})}:void 0,middleware:o.hasClientMiddleware?async()=>{let{clientMiddleware:e}=o.clientMiddlewareModule?await m(()=>import(o.clientMiddlewareModule),[]):await x();return on(e,"No `clientMiddleware` export found"),e}:void 0,shouldRevalidate:async()=>{let e=await x();return $n(y.path,e,o,n,l)},handle:async()=>(await x()).handle,Component:async()=>(await x()).Component,ErrorBoundary:o.hasErrorBoundary?async()=>(await x()).ErrorBoundary:void 0}}let v=On(e,t,r,n,a,o.id,i,l);return v.length>0&&(y.children=v),y})}function $n(e,t,r,n,a){if(a)return function(e,t,r){let n=!1;return a=>n?t?t(a):a.defaultShouldRevalidate:(n=!0,r.has(e))}(r.id,t.shouldRevalidate,a);if(!n&&r.hasLoader&&!r.hasClientLoader){let r=e?Q(e)[1].map(e=>e.paramName):[];const n=e=>r.some(t=>e.currentParams[t]!==e.nextParams[t]);if(t.shouldRevalidate){let e=t.shouldRevalidate;return t=>e({...t,defaultShouldRevalidate:n(t)})}return e=>n(e)}return t.shouldRevalidate}function An(e){if(null!=e.default)return"object"!=typeof e.default||0!==Object.keys(e.default).length?e.default:void 0}function jn(e,t,r,n){return n&&"root"!==e||null!=t&&(!0===t.hydrate||!0!==r)}var _n=new Set,Nn=new Set;function Hn(e,t){return"lazy"===e.mode&&!0===t}function Fn(e,t,r,n,a,o,i){if(Hn(a,n))return async({path:l,patch:s,signal:u,fetcherKey:c})=>{if(Nn.has(l))return;let{state:d}=e();await In([l],c?window.location.href:C(d.navigation.location||d.location),t,r,n,o,i,a.manifestPath,s,u)}}function zn(e,t,r,n,a,o){h.useEffect(()=>{if(!Hn(a,n)||!0===window.navigator?.connection?.saveData)return;function i(e){let t="FORM"===e.tagName?e.getAttribute("action"):e.getAttribute("href");if(!t)return;let r="A"===e.tagName?e.pathname:new URL(t,window.location.origin).pathname;Nn.has(r)||_n.add(r)}async function l(){document.querySelectorAll("a[data-discover], form[data-discover]").forEach(i);let l=Array.from(_n.keys()).filter(e=>!Nn.has(e)||(_n.delete(e),!1));if(0!==l.length)try{await In(l,null,t,r,n,o,e.basename,a.manifestPath,e.patchRoutes)}catch(s){console.error("Failed to fetch manifest patches",s)}}let s=function(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}(l,100);l();let u=new MutationObserver(()=>s());return u.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["data-discover","href","action"]}),()=>u.disconnect()},[n,o,t,r,e,a])}var Un="react-router-manifest-version";async function In(e,t,r,n,a,o,i,l,s,u){const c=new URLSearchParams;c.set("paths",e.sort().join(",")),c.set("version",r.version);let d,h=new URL(function(e,t){let r=e||"/__manifest";return null==t?r:ue([t,r])}(l,i),window.location.origin);if(h.search=c.toString(),h.toString().length>7680)return void _n.clear();try{let e=await fetch(h,{signal:u});if(!e.ok)throw new Error(`${e.status} ${e.statusText}`);if(204===e.status&&e.headers.has("X-Remix-Reload-Document")){if(!t)return void console.warn("Detected a manifest version mismatch during eager route discovery. The next navigation/fetch to an undiscovered route will result in a new document navigation to sync up with the latest manifest.");try{if(sessionStorage.getItem(Un)===r.version)return void console.error("Unable to discover routes due to manifest version mismatch.");sessionStorage.setItem(Un,r.version)}catch{}window.location.href=t,console.warn("Detected manifest version mismatch, reloading..."),await new Promise(()=>{})}else if(e.status>=400)throw new Error(await e.text());try{sessionStorage.removeItem(Un)}catch{}d=await e.json()}catch(y){if(u?.aborted)return;throw y}let f=new Set(Object.keys(r.routes)),m=Object.values(d).reduce((e,t)=>(t&&!f.has(t.id)&&(e[t.id]=t),e),{});Object.assign(r.routes,m),e.forEach(e=>function(e,t){if(t.size>=1e3){let e=t.values().next().value;t.delete(e)}t.add(e)}(e,Nn));let p=new Set;Object.values(m).forEach(e=>{!e||e.parentId&&m[e.parentId]||p.add(e.parentId)}),p.forEach(e=>s(e||null,On(m,n,null,a,o,e)))}function Bn(){let e=h.useContext(Bt);return on(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Wn(){let e=h.useContext(Wt);return on(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var qn=h.createContext(void 0);function Jn(){let e=h.useContext(qn);return on(e,"You must render this element inside a <HydratedRouter> element"),e}function Yn(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Vn(e,t,r){if(r&&!ra)return[e[0]];if(t){let r=e.findIndex(e=>void 0!==t[e.route.id]);return e.slice(0,r+1)}return e}qn.displayName="FrameworkContext";var Kn="data-react-router-critical-css";function Xn({nonce:e,crossOrigin:t}){let{isSpaMode:r,manifest:n,routeModules:a,criticalCss:o}=Jn(),{errors:i,matches:l}=Wn(),s=Vn(l,i,r),u=h.useMemo(()=>function(e,t,r){return kn(e.map(e=>{let n=t[e.route.id],a=r.routes[e.route.id];return[a&&a.css?a.css.map(e=>({rel:"stylesheet",href:e})):[],n?.links?.()||[]]}).flat(2),xn(e,r))}(s,a,n),[s,a,n]);return h.createElement(h.Fragment,null,"string"==typeof o?h.createElement("style",{[Kn]:"",nonce:e,dangerouslySetInnerHTML:{__html:o}}):null,"object"==typeof o?h.createElement("link",{[Kn]:"",rel:"stylesheet",href:o.href,nonce:e,crossOrigin:t}):null,u.map(({key:r,link:n})=>En(n)?h.createElement(Gn,{key:r,nonce:e,...n,crossOrigin:n.crossOrigin??t}):h.createElement("link",{key:r,nonce:e,...n,crossOrigin:n.crossOrigin??t})))}function Gn({page:e,...t}){let r=Jt(),{router:n}=Bn(),a=h.useMemo(()=>N(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?r?h.createElement(Qn,{page:e,matches:a,...t}):h.createElement(ea,{page:e,matches:a,...t}):null}function Zn(e){let{manifest:t,routeModules:r}=Jn(),[n,a]=h.useState([]);return h.useEffect(()=>{let n=!1;return async function(e,t,r){return kn((await Promise.all(e.map(async e=>{let n=t.routes[e.route.id];if(n){let e=await vn(n,r);return e.links?e.links():[]}return[]}))).flat(1).filter(Rn).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"}))}(e,t,r).then(e=>{n||a(e)}),()=>{n=!0}},[e,t,r]),n}function Qn({page:e,matches:t,...r}){let n=rr(),{future:a}=Jn(),{basename:o}=Bn(),i=h.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let r=hn(e,o,a.unstable_trailingSlashAwareDataRequests,"rsc"),i=!1,l=[];for(let e of t)"function"==typeof e.route.shouldRevalidate?i=!0:l.push(e.route.id);return i&&l.length>0&&r.searchParams.set("_routes",l.join(",")),[r.pathname+r.search]},[o,a.unstable_trailingSlashAwareDataRequests,e,n,t]);return h.createElement(h.Fragment,null,i.map(e=>h.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...r})))}function ea({page:e,matches:t,...r}){let n=rr(),{future:a,manifest:o,routeModules:i}=Jn(),{basename:l}=Bn(),{loaderData:s,matches:u}=Wn(),c=h.useMemo(()=>Sn(e,t,u,o,n,"data"),[e,t,u,o,n]),d=h.useMemo(()=>Sn(e,t,u,o,n,"assets"),[e,t,u,o,n]),f=h.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let r=new Set,u=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];t&&t.hasLoader&&(!c.some(t=>t.route.id===e.route.id)&&e.route.id in s&&i[e.route.id]?.shouldRevalidate||t.hasClientLoader?u=!0:r.add(e.route.id))}),0===r.size)return[];let d=hn(e,l,a.unstable_trailingSlashAwareDataRequests,"data");return u&&r.size>0&&d.searchParams.set("_routes",t.filter(e=>r.has(e.route.id)).map(e=>e.route.id).join(",")),[d.pathname+d.search]},[l,a.unstable_trailingSlashAwareDataRequests,s,n,o,c,t,e,i]),m=h.useMemo(()=>xn(d,o),[d,o]),p=Zn(d);return h.createElement(h.Fragment,null,f.map(e=>h.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...r})),m.map(e=>h.createElement("link",{key:e,rel:"modulepreload",href:e,...r})),p.map(({key:e,link:t})=>h.createElement("link",{key:e,nonce:r.nonce,...t,crossOrigin:t.crossOrigin??r.crossOrigin})))}function ta(){let{isSpaMode:e,routeModules:t}=Jn(),{errors:r,matches:n,loaderData:a}=Wn(),o=rr(),i=Vn(n,r,e),l=null;r&&(l=r[i[i.length-1].route.id]);let s=[],u=null,c=[];for(let d=0;d<i.length;d++){let e=i[d],r=e.route.id,n=a[r],h=e.params,f=t[r],m=[],p={id:r,data:n,loaderData:n,meta:[],params:e.params,pathname:e.pathname,handle:e.route.handle,error:l};if(c[d]=p,f?.meta?m="function"==typeof f.meta?f.meta({data:n,loaderData:n,params:h,location:o,matches:c,error:l}):Array.isArray(f.meta)?[...f.meta]:f.meta:u&&(m=[...u]),m=m||[],!Array.isArray(m))throw new Error("The route at "+e.route.path+" returns an invalid value. All route meta functions must return an array of meta objects.\n\nTo reference the meta function API, see https://reactrouter.com/start/framework/route-module#meta");p.meta=m,c[d]=p,s=[...m],u=s}return h.createElement(h.Fragment,null,s.flat().map(e=>{if(!e)return null;if("tagName"in e){let{tagName:t,...r}=e;if(!function(e){return"string"==typeof e&&/^(meta|link)$/.test(e)}(t))return console.warn(`A meta object uses an invalid tagName: ${t}. Expected either 'link' or 'meta'`),null;let n=t;return h.createElement(n,{key:JSON.stringify(r),...r})}if("title"in e)return h.createElement("title",{key:"title"},String(e.title));if("charset"in e&&(e.charSet??(e.charSet=e.charset),delete e.charset),"charSet"in e&&null!=e.charSet)return"string"==typeof e.charSet?h.createElement("meta",{key:"charSet",charSet:e.charSet}):null;if("script:ld+json"in e)try{let t=JSON.stringify(e["script:ld+json"]);return h.createElement("script",{key:`script:ld+json:${t}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:an(t)}})}catch(t){return null}return h.createElement("meta",{key:JSON.stringify(e),...e})}))}var ra=!1;function na(e){let{manifest:t,serverHandoffString:r,isSpaMode:n,renderMeta:a,routeDiscovery:o,ssr:i}=Jn(),{router:l,static:s,staticContext:u}=Bn(),{matches:c}=Wn(),d=Jt(),f=Hn(o,i);a&&(a.didRenderScripts=!0);let m=Vn(c,null,n);h.useEffect(()=>{ra=!0},[]);let p=h.useMemo(()=>{if(d)return null;let n=u?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",a=s?`${t.hmr?.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${f?"":`import ${JSON.stringify(t.url)}`};\n${m.map((e,r)=>{let n=`route${r}`,a=t.routes[e.route.id];on(a,`Route ${e.route.id} not found in manifest`);let{clientActionModule:o,clientLoaderModule:i,clientMiddlewareModule:l,hydrateFallbackModule:s,module:u}=a,c=[...o?[{module:o,varName:`${n}_clientAction`}]:[],...i?[{module:i,varName:`${n}_clientLoader`}]:[],...l?[{module:l,varName:`${n}_clientMiddleware`}]:[],...s?[{module:s,varName:`${n}_HydrateFallback`}]:[],{module:u,varName:`${n}_main`}];return 1===c.length?`import * as ${n} from ${JSON.stringify(u)};`:[c.map(e=>`import * as ${e.varName} from "${e.module}";`).join("\n"),`const ${n} = {${c.map(e=>`...${e.varName}`).join(",")}};`].join("\n")}).join("\n")}\n ${f?`window.__reactRouterManifest = ${JSON.stringify(function({sri:e,...t},r){let n=new Set(r.state.matches.map(e=>e.route.id)),a=r.state.location.pathname.split("/").filter(Boolean),o=["/"];for(a.pop();a.length>0;)o.push(`/${a.join("/")}`),a.pop();o.forEach(e=>{let t=H(r.routes,e,r.basename||"/",!1,r.branches);t&&t.forEach(e=>n.add(e.route.id))});let i=[...n].reduce((e,r)=>Object.assign(e,{[r]:t.routes[r]}),{});return{...t,routes:i,sri:!!e||void 0}}(t,l),null,2)};`:""}\n window.__reactRouterRouteModules = {${m.map((e,t)=>`${JSON.stringify(e.route.id)}:route${t}`).join(",")}};\n\nimport(${JSON.stringify(t.entry.module)});`:" ";return h.createElement(h.Fragment,null,h.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:n},type:void 0}),h.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:a},type:"module",async:!0}))},[]),y=ra||d?[]:[...new Set(t.entry.imports.concat(xn(m,t,{includeHydrateFallback:!0})))],v="object"==typeof t.sri?t.sri:{};return Cr(!d,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),ra||d?null:h.createElement(h.Fragment,null,"object"==typeof t.sri?h.createElement("script",{...e,"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:v})}}):null,f?null:h.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:v[t.url],nonce:e.nonce,suppressHydrationWarning:!0}),h.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:v[t.entry.module],nonce:e.nonce,suppressHydrationWarning:!0}),y.map(t=>h.createElement("link",{key:t,rel:"modulepreload",href:t,crossOrigin:e.crossOrigin,integrity:v[t],nonce:e.nonce,suppressHydrationWarning:!0})),p)}function aa(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}var oa=class extends h.Component{constructor(e){super(e),this.state={error:e.error||null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error||null,location:e.location}:{error:e.error||t.error,location:t.location}}render(){return this.state.error?h.createElement(ia,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function ia({error:e,isOutsideRemixApp:t}){console.error(e);let r,n=h.createElement("script",{dangerouslySetInnerHTML:{__html:'\n console.log(\n "💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."\n );\n '}});if(ve(e))return h.createElement(la,{title:"Unhandled Thrown Response!"},h.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),n);if(e instanceof Error)r=e;else{let t=null==e?"Unknown Error":"object"==typeof e&&"toString"in e?e.toString():JSON.stringify(e);r=new Error(t)}return h.createElement(la,{title:"Application Error!",isOutsideRemixApp:t},h.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),h.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},r.stack),n)}function la({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){let{routeModules:a}=Jn();return a.root?.Layout&&!r?n:h.createElement("html",{lang:"en"},h.createElement("head",null,h.createElement("meta",{charSet:"utf-8"}),h.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),h.createElement("title",null,e)),h.createElement("body",null,h.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,t?h.createElement(na,null):null)))}var sa="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{sa&&(window.__reactRouterVersion="7.15.1")}catch(Ea){}var ua=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ca=h.forwardRef(function({onClick:e,discover:t="render",prefetch:r="none",relative:n,reloadDocument:a,replace:o,mask:i,state:l,target:s,to:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:f,...m},p){let{basename:y,navigator:v,useTransitions:g}=h.useContext(Xt),w="string"==typeof u&&ua.test(u),b=be(u,y),E=function(e,{relative:t}={}){S(tr(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=h.useContext(Xt),{hash:a,pathname:o,search:i}=ur(e,{relative:t}),l=o;return"/"!==r&&(l="/"===o?r:ue([r,o])),n.createHref({pathname:l,search:i,hash:a})}(u=b.to,{relative:n}),R=rr(),x=null;if(i){let e=le(i,[],R.mask?R.mask.pathname:"/",!0);"/"!==y&&(e.pathname="/"===e.pathname?y:ue([y,e.pathname])),x=v.createHref(e)}let[k,L,M]=function(e,t){let r=h.useContext(qn),[n,a]=h.useState(!1),[o,i]=h.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:c,onTouchStart:d}=t,f=h.useRef(null);h.useEffect(()=>{if("render"===e&&i(!0),"viewport"===e){let e=new IntersectionObserver(e=>{e.forEach(e=>{i(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),h.useEffect(()=>{if(n){let e=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(e)}}},[n]);let m=()=>{a(!0)},p=()=>{a(!1),i(!1)};return r?"intent"!==e?[o,f,{}]:[o,f,{onFocus:Yn(l,m),onBlur:Yn(s,p),onMouseEnter:Yn(u,m),onMouseLeave:Yn(c,p),onTouchStart:Yn(d,m)}]:[!1,f,{}]}(r,m),P=function(e,{target:t,replace:r,mask:n,state:a,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s,useTransitions:u}={}){let c=or(),d=rr(),f=ur(e,{relative:i});return h.useCallback(m=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(m,t)){m.preventDefault();let t=void 0!==r?r:C(d)===C(f),p=()=>c(e,{replace:t,mask:n,state:a,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s});u?h.startTransition(()=>p()):p()}},[d,c,f,r,n,a,t,e,o,i,l,s,u])}(u,{replace:o,mask:i,state:l,target:s,preventScrollReset:c,relative:n,viewTransition:d,defaultShouldRevalidate:f,useTransitions:g});let T=!(b.isExternal||a),D=h.createElement("a",{...m,...M,href:(T?x:void 0)||b.absoluteURL||E,onClick:T?function(t){e&&e(t),t.defaultPrevented||P(t)}:e,ref:aa(p,L),target:s,"data-discover":w||"render"!==t?void 0:"true"});return k&&!w?h.createElement(h.Fragment,null,D,h.createElement(Gn,{page:E})):D});function da({getKey:e,storageKey:t,...r}){let n=h.useContext(qn),{basename:a}=h.useContext(Xt),o=rr(),i=br();!function({getKey:e,storageKey:t}={}){let{router:r}=fa("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:a}=function(e){let t=h.useContext(Wt);return S(t,ha(e)),t}("useScrollRestoration"),{basename:o}=h.useContext(Xt),i=rr(),l=br(),s=function(){let e=gr("useNavigation");return h.useMemo(()=>{let{matches:t,historyAction:r,...n}=e.navigation;return n},[e.navigation])}();h.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),function(e,t){let{capture:r}=t||{};h.useEffect(()=>{let t=null!=r?{capture:r}:void 0;return window.addEventListener("pagehide",e,t),()=>{window.removeEventListener("pagehide",e,t)}},[e,r])}(h.useCallback(()=>{if("idle"===s.state){let t=ga(i,l,o,e);va[t]=window.scrollY}try{sessionStorage.setItem(t||ya,JSON.stringify(va))}catch(r){x(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${r}).`)}window.history.scrollRestoration="auto"},[s.state,e,o,i,l,t])),"undefined"!=typeof document&&(h.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||ya);e&&(va=JSON.parse(e))}catch(Ea){}},[t]),h.useLayoutEffect(()=>{let t=r?.enableScrollRestoration(va,()=>window.scrollY,e?(t,r)=>ga(t,r,o,e):void 0);return()=>t&&t()},[r,o,e]),h.useLayoutEffect(()=>{if(!1!==n)if("number"!=typeof n){try{if(i.hash){let e=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(e)return void e.scrollIntoView()}}catch{x(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}!0!==a&&window.scrollTo(0,0)}else window.scrollTo(0,n)},[i,n,a]))}({getKey:e,storageKey:t});let l=h.useMemo(()=>{if(!n||!e)return null;let t=ga(o,i,a,e);return t!==o.key?t:null},[]);if(!n||n.isSpaMode)return null;let s=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},"")}try{let r=JSON.parse(sessionStorage.getItem(e)||"{}")[t||window.history.state.key];"number"==typeof r&&window.scrollTo(0,r)}catch(r){console.error(r),sessionStorage.removeItem(e)}}).toString();return h.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${s})(${an(JSON.stringify(t||ya))}, ${an(JSON.stringify(l))})`}})}function ha(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fa(e){let t=h.useContext(Bt);return S(t,ha(e)),t}ca.displayName="Link",h.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:r="",end:n=!1,style:a,to:o,viewTransition:i,children:l,...s},u){let c=ur(o,{relative:s.relative}),d=rr(),f=h.useContext(Wt),{navigator:m,basename:p}=h.useContext(Xt),y=null!=f&&function(e,{relative:t}={}){let r=h.useContext(Yt);S(null!=r,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=fa("useViewTransitionState"),a=ur(e,{relative:t});if(!r.isTransitioning)return!1;let o=ee(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=ee(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=Z(a.pathname,i)||null!=Z(a.pathname,o)}(c)&&!0===i,v=m.encodeLocation?m.encodeLocation(c).pathname:c.pathname,g=d.pathname,w=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(g=g.toLowerCase(),w=w?w.toLowerCase():null,v=v.toLowerCase()),w&&p&&(w=ee(w,p)||w);const b="/"!==v&&v.endsWith("/")?v.length-1:v.length;let E,R=g===v||!n&&g.startsWith(v)&&"/"===g.charAt(b),x=null!=w&&(w===v||!n&&w.startsWith(v)&&"/"===w.charAt(v.length)),k={isActive:R,isPending:x,isTransitioning:y},L=R?e:void 0;E="function"==typeof r?r(k):[r,R?"active":null,x?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let C="function"==typeof a?a(k):a;return h.createElement(ca,{...s,"aria-current":L,className:E,ref:u,style:C,to:o,viewTransition:i},"function"==typeof l?l(k):l)}).displayName="NavLink",h.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:i=Ur,action:l,onSubmit:s,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:f,...m},p)=>{let{useTransitions:y}=h.useContext(Xt),v=function(){let{router:e}=fa("useSubmit"),{basename:t}=h.useContext(Xt),r=wr("useRouteId"),n=e.fetch,a=e.navigate;return h.useCallback(async(e,o={})=>{let{action:i,method:l,encType:s,formData:u,body:c}=Yr(e,t);!1===o.navigate?await n(o.fetcherKey||pa(),r,o.action||i,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:u,body:c,formMethod:o.method||l,formEncType:o.encType||s,flushSync:o.flushSync}):await a(o.action||i,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:u,body:c,formMethod:o.method||l,formEncType:o.encType||s,replace:o.replace,state:o.state,fromRouteId:r,flushSync:o.flushSync,viewTransition:o.viewTransition})},[n,a,t,r])}(),g=function(e,{relative:t}={}){let{basename:r}=h.useContext(Xt),n=h.useContext(Zt);S(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),o={...ur(e||".",{relative:t})},i=rr();if(null==e){o.search=i.search;let e=new URLSearchParams(o.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();o.search=r?`?${r}`:""}}e&&"."!==e||!a.route.index||(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index");"/"!==r&&(o.pathname="/"===o.pathname?r:ue([r,o.pathname]));return C(o)}(l,{relative:u}),w="get"===i.toLowerCase()?"get":"post",b="string"==typeof l&&ua.test(l);return h.createElement("form",{ref:p,method:w,action:g,onSubmit:n?s:e=>{if(s&&s(e),e.defaultPrevented)return;e.preventDefault();let n=e.nativeEvent.submitter,l=n?.getAttribute("formmethod")||i,m=()=>v(n||e.currentTarget,{fetcherKey:t,method:l,navigate:r,replace:a,state:o,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:f});y&&!1!==r?h.startTransition(()=>m()):m()},...m,"data-discover":b||"render"!==e?void 0:"true"})}).displayName="Form",da.displayName="ScrollRestoration";var ma=0,pa=()=>`__${String(++ma)}__`;var ya="react-router-scroll-positions",va={};function ga(e,t,r,n){let a=null;return n&&(a=n("/"!==r?{...e,pathname:ee(e.pathname,r)||e.pathname}:e,t)),null==a&&(a=e.key),a}var wa=l(e=>{var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function n(e,r,n){var a=null;if(void 0!==n&&(a=""+n),void 0!==r.key&&(a=""+r.key),"key"in r)for(var o in n={},r)"key"!==o&&(n[o]=r[o]);else n=r;return r=n.ref,{$$typeof:t,type:e,key:a,ref:void 0!==r?r:null,props:n}}e.Fragment=r,e.jsx=n,e.jsxs=n}),ba=l((e,t)=>{t.exports=wa()});export{lr as A,ve as C,zn as D,jn as E,d as F,l as I,s as L,Fr as M,zr as N,rr as O,m as P,u as R,S,N as T,Ye as _,ta as a,dn as b,Nr as c,na as d,da as f,T as g,Pn as h,Xn as i,sr as j,or as k,oa as l,On as m,ye as n,cn as o,R as p,qn as r,_r as s,ba as t,$r as u,mn as v,Tr as w,Dr as x,Fn as y};