@codeyam/codeyam-cli 0.1.13 → 0.1.15
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.
- package/analyzer-template/.build-info.json +6 -6
- package/analyzer-template/log.txt +3 -3
- package/codeyam-cli/src/commands/editor.js +62 -27
- package/codeyam-cli/src/commands/editor.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +440 -1
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js +58 -4
- package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +76 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js +139 -1
- package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js.map +1 -1
- package/codeyam-cli/src/utils/backgroundServer.js +1 -1
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/editorAudit.js +107 -6
- package/codeyam-cli/src/utils/editorAudit.js.map +1 -1
- package/codeyam-cli/src/utils/editorEntityHelpers.js +18 -3
- package/codeyam-cli/src/utils/editorEntityHelpers.js.map +1 -1
- package/codeyam-cli/src/utils/editorScenarios.js +10 -1
- package/codeyam-cli/src/utils/editorScenarios.js.map +1 -1
- package/codeyam-cli/src/utils/scenariosManifest.js +30 -0
- package/codeyam-cli/src/utils/scenariosManifest.js.map +1 -1
- package/codeyam-cli/src/webserver/backgroundServer.js +42 -57
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{CopyButton-CzTDWkF2.js → CopyButton-CLe80MMu.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-BFbq6iFk.js → EntityItem-Crt_KN_U.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-B6OMi58N.js → EntityTypeIcon-CD7lGABo.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{InlineSpinner-DuYodzo1.js → InlineSpinner-CgTNOhnu.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-CXo9EeCl.js → InteractivePreview-CKeQT5Ty.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-DYCNb2It.js → LibraryFunctionPreview-D3s1MFkb.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-CZgY3sxX.js → LogViewer-CM5zg40N.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-CnYYwRDw.js → ReportIssueModal-C2PLkej3.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-CDoF7ZpU.js → SafeScreenshot-DanvyBPb.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-DrnfvaLL.js → ScenarioViewer-DUMfcNVK.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{Spinner-Df3UCi8k.js → Spinner-D0LgAaSa.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ViewportInspectBar-DRKR9T0U.js → ViewportInspectBar-BA_Ry-rs.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{_index-ClR-g3tY.js → _index-BAWd-Xjf.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-DTH6ydEA.js → activity.(_tab)-BOARiB-g.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{addon-web-links-74hnHF59.js → addon-web-links-CHx25PAe.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{agent-transcripts-B8CYhCO9.js → agent-transcripts-Bg3e7q4S.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{book-open-CLaoh4ac.js → book-open-CL-lMgHh.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-BZ2DZxbW.js → chevron-down-GmAjGS9-.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{chunk-JZWAC4HX-BBXArFPl.js → chunk-JZWAC4HX-BAdwhyCx.js} +11 -11
- package/codeyam-cli/src/webserver/build/client/assets/{circle-check-CT4unAk-.js → circle-check-DFcQkN5j.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{copy-zK0B6Nu-.js → copy-C6iF61Xs.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-DJB0YQJL.js → createLucideIcon-4ImjHTVC.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{dev.empty-CkXFP_i-.js → dev.empty-C8y4mmyv.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/editor._tab-Gbk_i5Js.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/editor.entity.(_sha)-B7xQ9Sjy.js +58 -0
- package/codeyam-cli/src/webserver/build/client/assets/editorPreview-CxmrE6AF.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-BqAN7hyG.js → entity._sha._-Blfy9UlN.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.dev-BOi8kpwd.js → entity._sha.scenarios._scenarioId.dev-CUobbQdQ.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.fullscreen-Dg1NhIms.js → entity._sha.scenarios._scenarioId.fullscreen-C6eeL24i.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-CJX6kkkV.js → entity._sha_.create-scenario-DQM8E7L4.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-BhVjZhKg.js → entity._sha_.edit._scenarioId-CAoXLsQr.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-_gzKltPN.js → entry.client-SuW9syRS.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{files-CV_17tZS.js → files-D-xGrg29.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{git-D-YXmMbR.js → git-Bq_fbXP5.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/globals-fAqOD9ex.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{index-CCrgCshv.js → index-Bp1l4hSv.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-BsX0F-9C.js → index-CWV9XZiG.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-Blo6EK8G.js → index-DE3jI_dv.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{labs-Byazq8Pv.js → labs-B_IX45ih.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-DVQ0oHR7.js → loader-circle-De-7qQ2u.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-5d53342d.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{memory-b-VmA2Vj.js → memory-Cx2xEx7s.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{pause-DGcndCAa.js → pause-CFxEKL1u.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-DB3O9_9j.js +67 -0
- package/codeyam-cli/src/webserver/build/client/assets/{search-C0Uw0bcK.js → search-BdBb5aqc.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{settings-OoNgHIfW.js → settings-DdE-Untf.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{simulations-Bcemfu8a.js → simulations-DSCdE99u.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{terminal-BgMmG7R9.js → terminal-CrplD4b1.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-Cs87hJYK.js → triangle-alert-DqJ0j69l.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-BR3Rs7JY.js → useCustomSizes-DhXHbEjP.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-BxxP_XF9.js → useLastLogLine-BNd5hYuW.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-BermyNU5.js → useReportContext-Cy5Qg_UR.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useToast-a_QN_W9_.js → useToast-5HR2j9ZE.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/{analysisRunner-lv2ooewK.js → analysisRunner-DcJSnBCE.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/{index-Im3Smyei.js → index-CEaDhUiv.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/{init-BjuAFKGM.js → init-DA7guOrE.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-juyiY2m6.js +551 -0
- package/codeyam-cli/src/webserver/build/server/index.js +1 -1
- package/codeyam-cli/src/webserver/build-info.json +5 -5
- package/codeyam-cli/src/webserver/terminalServer.js +1 -1
- package/codeyam-cli/src/webserver/terminalServer.js.map +1 -1
- package/codeyam-cli/templates/nextjs-prisma-sqlite/package.json +1 -1
- package/codeyam-cli/templates/nextjs-prisma-supabase/package.json +1 -1
- package/package.json +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/editor._tab-DPw7NZHc.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/editor.entity.(_sha)-CjC3_6JI.js +0 -58
- package/codeyam-cli/src/webserver/build/client/assets/editorPreview-DBa7T2FK.js +0 -41
- package/codeyam-cli/src/webserver/build/client/assets/globals-DRvOjyO3.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-75b1b319.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-F-k2uYj5.js +0 -67
- package/codeyam-cli/src/webserver/build/server/assets/server-build-CNjF0B9B.js +0 -551
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Ba(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const o=Object.getOwnPropertyDescriptor(n,a);o&&Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var as=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gt={exports:{}},B={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@ function Ua(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Jr;function Ya(){if(Jr)return B;Jr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),i=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),c=Symbol.for("react.activity"),m=Symbol.iterator;function g(p){return p===null||typeof p!="object"?null:(p=m&&p[m]||p["@@iterator"],typeof p=="function"?p:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,E={};function x(p,C,U){this.props=p,this.context=C,this.refs=E,this.updater=U||R}x.prototype.isReactComponent={},x.prototype.setState=function(p,C){if(typeof p!="object"&&typeof p!="function"&&p!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,p,C,"setState")},x.prototype.forceUpdate=function(p){this.updater.enqueueForceUpdate(this,p,"forceUpdate")};function S(){}S.prototype=x.prototype;function _(p,C,U){this.props=p,this.context=C,this.refs=E,this.updater=U||R}var A=_.prototype=new S;A.constructor=_,b(A,x.prototype),A.isPureReactComponent=!0;var P=Array.isArray;function D(){}var y={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function F(p,C,U){var k=U.ref;return{$$typeof:e,type:p,key:C,ref:k!==void 0?k:null,props:U}}function J(p,C){return F(p.type,C,p.props)}function K(p){return typeof p=="object"&&p!==null&&p.$$typeof===e}function ae(p){var C={"=":"=0",":":"=2"};return"$"+p.replace(/[=:]/g,function(U){return C[U]})}var le=/\/+/g;function Q(p,C){return typeof p=="object"&&p!==null&&p.key!=null?ae(""+p.key):C.toString(36)}function ue(p){switch(p.status){case"fulfilled":return p.value;case"rejected":throw p.reason;default:switch(typeof p.status=="string"?p.then(D,D):(p.status="pending",p.then(function(C){p.status==="pending"&&(p.status="fulfilled",p.value=C)},function(C){p.status==="pending"&&(p.status="rejected",p.reason=C)})),p.status){case"fulfilled":return p.value;case"rejected":throw p.reason}}throw p}function X(p,C,U,k,z){var G=typeof p;(G==="undefined"||G==="boolean")&&(p=null);var te=!1;if(p===null)te=!0;else switch(G){case"bigint":case"string":case"number":te=!0;break;case"object":switch(p.$$typeof){case e:case t:te=!0;break;case h:return te=p._init,X(te(p._payload),C,U,k,z)}}if(te)return z=z(p),te=k===""?"."+Q(p,0):k,P(z)?(U="",te!=null&&(U=te.replace(le,"$&/")+"/"),X(z,C,U,"",function(Bt){return Bt})):z!=null&&(K(z)&&(z=J(z,U+(z.key==null||p&&p.key===z.key?"":(""+z.key).replace(le,"$&/")+"/")+te)),C.push(z)),1;te=0;var de=k===""?".":k+":";if(P(p))for(var me=0;me<p.length;me++)k=p[me],G=de+Q(k,me),te+=X(k,C,U,G,z);else if(me=g(p),typeof me=="function")for(p=me.call(p),me=0;!(k=p.next()).done;)k=k.value,G=de+Q(k,me++),te+=X(k,C,U,G,z);else if(G==="object"){if(typeof p.then=="function")return X(ue(p),C,U,k,z);throw C=String(p),Error("Objects are not valid as a React child (found: "+(C==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":C)+"). If you meant to render a collection of children, use an array instead.")}return te}function ee(p,C,U){if(p==null)return p;var k=[],z=0;return X(p,k,"","",function(G){return C.call(U,G,z++)}),k}function re(p){if(p._status===-1){var C=p._result;C=C(),C.then(function(U){(p._status===0||p._status===-1)&&(p._status=1,p._result=U)},function(U){(p._status===0||p._status===-1)&&(p._status=2,p._result=U)}),p._status===-1&&(p._status=0,p._result=C)}if(p._status===1)return p._result.default;throw p._result}var ce=typeof reportError=="function"?reportError:function(p){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var C=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof p=="object"&&p!==null&&typeof p.message=="string"?String(p.message):String(p),error:p});if(!window.dispatchEvent(C))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",p);return}console.error(p)},se={map:ee,forEach:function(p,C,U){ee(p,function(){C.apply(this,arguments)},U)},count:function(p){var C=0;return ee(p,function(){C++}),C},toArray:function(p){return ee(p,function(C){return C})||[]},only:function(p){if(!K(p))throw Error("React.Children.only expected to receive a single React element child.");return p}};return B.Activity=c,B.Children=se,B.Component=x,B.Fragment=r,B.Profiler=a,B.PureComponent=_,B.StrictMode=n,B.Suspense=s,B.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=y,B.__COMPILER_RUNTIME={__proto__:null,c:function(p){return y.H.useMemoCache(p)}},B.cache=function(p){return function(){return p.apply(null,arguments)}},B.cacheSignal=function(){return null},B.cloneElement=function(p,C,U){if(p==null)throw Error("The argument must be a React element, but you passed "+p+".");var k=b({},p.props),z=p.key;if(C!=null)for(G in C.key!==void 0&&(z=""+C.key),C)!M.call(C,G)||G==="key"||G==="__self"||G==="__source"||G==="ref"&&C.ref===void 0||(k[G]=C[G]);var G=arguments.length-2;if(G===1)k.children=U;else if(1<G){for(var te=Array(G),de=0;de<G;de++)te[de]=arguments[de+2];k.children=te}return F(p.type,z,k)},B.createContext=function(p){return p={$$typeof:i,_currentValue:p,_currentValue2:p,_threadCount:0,Provider:null,Consumer:null},p.Provider=p,p.Consumer={$$typeof:o,_context:p},p},B.createElement=function(p,C,U){var k,z={},G=null;if(C!=null)for(k in C.key!==void 0&&(G=""+C.key),C)M.call(C,k)&&k!=="key"&&k!=="__self"&&k!=="__source"&&(z[k]=C[k]);var te=arguments.length-2;if(te===1)z.children=U;else if(1<te){for(var de=Array(te),me=0;me<te;me++)de[me]=arguments[me+2];z.children=de}if(p&&p.defaultProps)for(k in te=p.defaultProps,te)z[k]===void 0&&(z[k]=te[k]);return F(p,G,z)},B.createRef=function(){return{current:null}},B.forwardRef=function(p){return{$$typeof:l,render:p}},B.isValidElement=K,B.lazy=function(p){return{$$typeof:h,_payload:{_status:-1,_result:p},_init:re}},B.memo=function(p,C){return{$$typeof:u,type:p,compare:C===void 0?null:C}},B.startTransition=function(p){var C=y.T,U={};y.T=U;try{var k=p(),z=y.S;z!==null&&z(U,k),typeof k=="object"&&k!==null&&typeof k.then=="function"&&k.then(D,ce)}catch(G){ce(G)}finally{C!==null&&U.types!==null&&(C.types=U.types),y.T=C}},B.unstable_useCacheRefresh=function(){return y.H.useCacheRefresh()},B.use=function(p){return y.H.use(p)},B.useActionState=function(p,C,U){return y.H.useActionState(p,C,U)},B.useCallback=function(p,C){return y.H.useCallback(p,C)},B.useContext=function(p){return y.H.useContext(p)},B.useDebugValue=function(){},B.useDeferredValue=function(p,C){return y.H.useDeferredValue(p,C)},B.useEffect=function(p,C){return y.H.useEffect(p,C)},B.useEffectEvent=function(p){return y.H.useEffectEvent(p)},B.useId=function(){return y.H.useId()},B.useImperativeHandle=function(p,C,U){return y.H.useImperativeHandle(p,C,U)},B.useInsertionEffect=function(p,C){return y.H.useInsertionEffect(p,C)},B.useLayoutEffect=function(p,C){return y.H.useLayoutEffect(p,C)},B.useMemo=function(p,C){return y.H.useMemo(p,C)},B.useOptimistic=function(p,C){return y.H.useOptimistic(p,C)},B.useReducer=function(p,C,U){return y.H.useReducer(p,C,U)},B.useRef=function(p){return y.H.useRef(p)},B.useState=function(p){return y.H.useState(p)},B.useSyncExternalStore=function(p,C,U){return y.H.useSyncExternalStore(p,C,U)},B.useTransition=function(){return y.H.useTransition()},B.version="19.2.3",B}var Gr;function Va(){return Gr||(Gr=1,Gt.exports=Ya()),Gt.exports}var d=Va();const Ja=Wa(d),Ga=Ba({__proto__:null,default:Ja},[d]);/**
|
|
10
10
|
* react-router v7.13.0
|
|
11
11
|
*
|
|
12
12
|
* Copyright (c) Remix Software Inc.
|
|
@@ -15,29 +15,29 @@ function Ua(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&
|
|
|
15
15
|
* LICENSE.md file in the root directory of this source tree.
|
|
16
16
|
*
|
|
17
17
|
* @license MIT
|
|
18
|
-
*/var Ln=e=>{throw TypeError(e)},Va=(e,t,r)=>t.has(e)||Ln("Cannot "+r),Kt=(e,t,r)=>(Va(e,t,"read from private field"),r?r.call(e):t.get(e)),Ja=(e,t,r)=>t.has(e)?Ln("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Gr="popstate";function as(e={}){function t(n,a){let{pathname:o,search:i,hash:l}=n.location;return dt("",{pathname:o,search:i,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:Me(a)}return Ka(t,r,null,e)}function W(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function oe(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ga(){return Math.random().toString(36).substring(2,10)}function Kr(e,t){return{usr:e.state,key:e.key,idx:t}}function dt(e,t,r=null,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ke(t):t,state:r,key:t&&t.key||n||Ga()}}function Me({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 ke(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 Ka(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,l="POP",s=null,u=h();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function h(){return(i.state||{idx:null}).idx}function c(){l="POP";let E=h(),x=E==null?null:E-u;u=E,s&&s({action:l,location:b.location,delta:x})}function m(E,x){l="PUSH";let S=dt(b.location,E,x);u=h()+1;let _=Kr(S,u),A=b.createHref(S);try{i.pushState(_,"",A)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;a.location.assign(A)}o&&s&&s({action:l,location:b.location,delta:1})}function g(E,x){l="REPLACE";let S=dt(b.location,E,x);u=h();let _=Kr(S,u),A=b.createHref(S);i.replaceState(_,"",A),o&&s&&s({action:l,location:b.location,delta:0})}function R(E){return xn(E)}let b={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(Gr,c),s=E,()=>{a.removeEventListener(Gr,c),s=null}},createHref(E){return t(a,E)},createURL:R,encodeLocation(E){let x=R(E);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:m,replace:g,go(E){return i.go(E)}};return b}function xn(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),W(r,"No window.location.(origin|href) available to create URL");let n=typeof e=="string"?e:Me(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}var st,Xr=class{constructor(e){if(Ja(this,st,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Kt(this,st).has(e))return Kt(this,st).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Kt(this,st).set(e,t)}};st=new WeakMap;var Xa=new Set(["lazy","caseSensitive","path","id","index","children"]);function qa(e){return Xa.has(e)}var Qa=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Za(e){return Qa.has(e)}function eo(e){return e.index===!0}function ft(e,t,r=[],n={},a=!1){return e.map((o,i)=>{let l=[...r,String(i)],s=typeof o.id=="string"?o.id:l.join("-");if(W(o.index!==!0||!o.children,"Cannot specify children on an index route"),W(a||!n[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),eo(o)){let u={...o,id:s};return n[s]=qr(u,t(u)),u}else{let u={...o,id:s,children:void 0};return n[s]=qr(u,t(u)),o.children&&(u.children=ft(o.children,t,l,n,a)),u}})}function qr(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ae(e,t,r="/"){return ut(e,t,r,!1)}function ut(e,t,r,n){let a=typeof t=="string"?ke(t):t,o=be(a.pathname||"/",r);if(o==null)return null;let i=Tn(e);to(i);let l=null;for(let s=0;l==null&&s<i.length;++s){let u=fo(o);l=co(i[s],u,n)}return l}function Pn(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 Tn(e,t=[],r=[],n="",a=!1){let o=(i,l,s=a,u)=>{let h={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(n)&&s)return;W(h.relativePath.startsWith(n),`Absolute route path "${h.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(n.length)}let c=Te([n,h.relativePath]),m=r.concat(h);i.children&&i.children.length>0&&(W(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),Tn(i.children,t,m,c,s)),!(i.path==null&&!i.index)&&t.push({path:c,score:so(c,i.index),routesMeta:m})};return e.forEach((i,l)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,l);else for(let u of Mn(i.path))o(i,l,!0,u)}),t}function Mn(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return a?[o,""]:[o];let i=Mn(n.join("/")),l=[];return l.push(...i.map(s=>s===""?o:[o,s].join("/"))),a&&l.push(...i),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function to(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:uo(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var ro=/^:[\w-]+$/,no=3,ao=2,oo=1,io=10,lo=-2,Qr=e=>e==="*";function so(e,t){let r=e.split("/"),n=r.length;return r.some(Qr)&&(n+=lo),t&&(n+=ao),r.filter(a=>!Qr(a)).reduce((a,o)=>a+(ro.test(o)?no:o===""?oo:io),n)}function uo(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function co(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",i=[];for(let l=0;l<n.length;++l){let s=n[l],u=l===n.length-1,h=o==="/"?t:t.slice(o.length)||"/",c=At({path:s.relativePath,caseSensitive:s.caseSensitive,end:u},h),m=s.route;if(!c&&u&&r&&!n[n.length-1].route.index&&(c=At({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},h)),!c)return null;Object.assign(a,c.params),i.push({params:a,pathname:Te([o,c.pathname]),pathnameBase:po(Te([o,c.pathnameBase])),route:m}),c.pathnameBase!=="/"&&(o=Te([o,c.pathnameBase]))}return i}function At(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Dn(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((u,{paramName:h,isOptional:c},m)=>{if(h==="*"){let R=l[m]||"";i=o.slice(0,o.length-R.length).replace(/(.)\/+$/,"$1")}const g=l[m];return c&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function Dn(e,t=!1,r=!0){oe(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,(i,l,s)=>(n.push({paramName:l,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)")).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 fo(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return oe(!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}}function be(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function ho({basename:e,pathname:t}){return t==="/"?e:Te([e,t])}var _n=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vr=e=>_n.test(e);function mo(e,t="/"){let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?ke(e):e,o;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?o=Zr(r.substring(1),"/"):o=Zr(r,t)):o=t,{pathname:o,search:yo(n),hash:vo(a)}}function Zr(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Xt(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 On(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function gr(e){let t=On(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function wr(e,t,r,n=!1){let a;typeof e=="string"?a=ke(e):(a={...e},W(!a.pathname||!a.pathname.includes("?"),Xt("?","pathname","search",a)),W(!a.pathname||!a.pathname.includes("#"),Xt("#","pathname","hash",a)),W(!a.search||!a.search.includes("#"),Xt("#","search","hash",a)));let o=e===""||a.pathname==="",i=o?"/":a.pathname,l;if(i==null)l=r;else{let c=t.length-1;if(!n&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),c-=1;a.pathname=m.join("/")}l=c>=0?t[c]:"/"}let s=mo(a,l),u=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||h)&&(s.pathname+="/"),s}var Te=e=>e.join("/").replace(/\/\/+/g,"/"),po=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),yo=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,vo=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,go=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function wo(e,t){return new go(e,typeof t=="number"?{status:t}:t)}var Eo=(e,t=302)=>{let r=t;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,{...r,headers:n})},je=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 e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function mt(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var In=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function An(e,t){let r=e;if(typeof r!="string"||!_n.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,a=!1;if(In)try{let o=new URL(window.location.href),i=r.startsWith("//")?new URL(o.protocol+r):new URL(r),l=be(i.pathname,t);i.origin===o.origin&&l!=null?r=l+i.search+i.hash:a=!0}catch{oe(!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 $e=Symbol("Uninstrumented");function Ro(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(a=>a({id:t.id,index:t.index,path:t.path,instrument(o){let i=Object.keys(r);for(let l of i)o[l]&&r[l].push(o[l])}}));let n={};if(typeof t.lazy=="function"&&r.lazy.length>0){let a=Qe(r.lazy,t.lazy,()=>{});a&&(n.lazy=a)}if(typeof t.lazy=="object"){let a=t.lazy;["middleware","loader","action"].forEach(o=>{let i=a[o],l=r[`lazy.${o}`];if(typeof i=="function"&&l.length>0){let s=Qe(l,i,()=>{});s&&(n.lazy=Object.assign(n.lazy||{},{[o]:s}))}})}return["loader","action"].forEach(a=>{let o=t[a];if(typeof o=="function"&&r[a].length>0){let i=o[$e]??o,l=Qe(r[a],i,(...s)=>en(s[0]));l&&(a==="loader"&&i.hydrate===!0&&(l.hydrate=!0),l[$e]=i,n[a]=l)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(n.middleware=t.middleware.map(a=>{let o=a[$e]??a,i=Qe(r.middleware,o,(...l)=>en(l[0]));return i?(i[$e]=o,i):a})),n}function bo(e,t){let r={navigate:[],fetch:[]};if(t.forEach(n=>n({instrument(a){let o=Object.keys(a);for(let i of o)a[i]&&r[i].push(a[i])}})),r.navigate.length>0){let n=e.navigate[$e]??e.navigate,a=Qe(r.navigate,n,(...o)=>{let[i,l]=o;return{to:typeof i=="number"||typeof i=="string"?i:i?Me(i):".",...tn(e,l??{})}});a&&(a[$e]=n,e.navigate=a)}if(r.fetch.length>0){let n=e.fetch[$e]??e.fetch,a=Qe(r.fetch,n,(...o)=>{let[i,,l,s]=o;return{href:l??".",fetcherKey:i,...tn(e,s??{})}});a&&(a[$e]=n,e.fetch=a)}return e}function Qe(e,t,r){return e.length===0?null:async(...n)=>{let a=await Fn(e,r(...n),()=>t(...n),e.length-1);if(a.type==="error")throw a.value;return a.value}}async function Fn(e,t,r,n){let a=e[n],o;if(a){let i,l=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=Fn(e,t,r,n-1),o=await i,W(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await a(l,t)}catch(s){console.error("An instrumentation function threw an error:",s)}i||await l(),await i}else try{o={type:"success",value:await r()}}catch(i){o={type:"error",value:i}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function en(e){let{request:t,context:r,params:n,unstable_pattern:a}=e;return{request:So(t),params:{...n},unstable_pattern:a,context:Co(r)}}function tn(e,t){return{currentUrl:Me(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 So(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Co(e){if(xo(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var Lo=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function xo(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===Lo}var Nn=["POST","PUT","PATCH","DELETE"],Po=new Set(Nn),To=["GET",...Nn],Mo=new Set(To),$n=new Set([301,302,303,307,308]),Do=new Set([307,308]),qt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},kn={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ot={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},_o=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),jn="remix-router-transitions",Un=Symbol("ResetLoaderData");function os(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";W(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let n=e.hydrationRouteProperties||[],a=e.mapRouteProperties||_o,o=a;if(e.unstable_instrumentations){let d=e.unstable_instrumentations;o=v=>({...a(v),...Ro(d.map(w=>w.route).filter(Boolean),v)})}let i={},l=ft(e.routes,o,void 0,i),s,u=e.basename||"/";u.startsWith("/")||(u=`/${u}`);let h=e.dataStrategy||No,c={...e.future},m=null,g=new Set,R=null,b=null,E=null,x=e.hydrationData!=null,S=Ae(l,e.history.location,u),_=!1,A=null,P;if(S==null&&!e.patchRoutesOnNavigation){let d=Ce(404,{pathname:e.history.location.pathname}),{matches:v,route:w}=Ct(l);P=!0,S=v,A={[w.id]:d}}else if(S&&!e.hydrationData&&wt(S,l,e.history.location.pathname).active&&(S=null),S)if(S.some(d=>d.route.lazy))P=!1;else if(!S.some(d=>Er(d.route)))P=!0;else{let d=e.hydrationData?e.hydrationData.loaderData:null,v=e.hydrationData?e.hydrationData.errors:null;if(v){let w=S.findIndex(L=>v[L.route.id]!==void 0);P=S.slice(0,w+1).every(L=>!or(L.route,d,v))}else P=S.every(w=>!or(w.route,d,v))}else{P=!1,S=[];let d=wt(null,l,e.history.location.pathname);d.active&&d.matches&&(_=!0,S=d.matches)}let D,y={historyAction:e.history.action,location:e.history.location,matches:S,initialized:P,navigation:qt,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||A,fetchers:new Map,blockers:new Map},M="POP",F=null,J=!1,K,ae=!1,le=new Map,Q=null,ue=!1,X=!1,ee=new Set,re=new Map,ce=0,se=-1,p=new Map,C=new Set,U=new Map,k=new Map,z=new Set,G=new Map,te,de=null;function me(){if(m=e.history.listen(({action:d,location:v,delta:w})=>{if(te){te(),te=void 0;return}oe(G.size===0||w!=null,"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 L=Hr({currentLocation:y.location,nextLocation:v,historyAction:d});if(L&&w!=null){let T=new Promise(N=>{te=N});e.history.go(w*-1),gt(L,{state:"blocked",location:v,proceed(){gt(L,{state:"proceeding",proceed:void 0,reset:void 0,location:v}),T.then(()=>e.history.go(w))},reset(){let N=new Map(y.blockers);N.set(L,ot),pe({blockers:N})}}),F==null||F.resolve(),F=null;return}return Ue(d,v)}),r){ei(t,le);let d=()=>ti(t,le);t.addEventListener("pagehide",d),Q=()=>t.removeEventListener("pagehide",d)}return y.initialized||Ue("POP",y.location,{initialHydration:!0}),D}function Bt(){m&&m(),Q&&Q(),g.clear(),K&&K.abort(),y.fetchers.forEach((d,v)=>Yt(v)),y.blockers.forEach((d,v)=>Ur(v))}function Ca(d){return g.add(d),()=>g.delete(d)}function pe(d,v={}){d.matches&&(d.matches=d.matches.map(T=>{let N=i[T.route.id],H=T.route;return H.element!==N.element||H.errorElement!==N.errorElement||H.hydrateFallbackElement!==N.hydrateFallbackElement?{...T,route:N}:T})),y={...y,...d};let w=[],L=[];y.fetchers.forEach((T,N)=>{T.state==="idle"&&(z.has(N)?w.push(N):L.push(N))}),z.forEach(T=>{!y.fetchers.has(T)&&!re.has(T)&&w.push(T)}),[...g].forEach(T=>T(y,{deletedFetchers:w,newErrors:d.errors??null,viewTransitionOpts:v.viewTransitionOpts,flushSync:v.flushSync===!0})),w.forEach(T=>Yt(T)),L.forEach(T=>y.fetchers.delete(T))}function Ke(d,v,{flushSync:w}={}){var Y,$;let L=y.actionData!=null&&y.navigation.formMethod!=null&&ve(y.navigation.formMethod)&&y.navigation.state==="loading"&&((Y=d.state)==null?void 0:Y._isRedirect)!==!0,T;v.actionData?Object.keys(v.actionData).length>0?T=v.actionData:T=null:L?T=y.actionData:T=null;let N=v.loaderData?fn(y.loaderData,v.loaderData,v.matches||[],v.errors):y.loaderData,H=y.blockers;H.size>0&&(H=new Map(H),H.forEach((V,q)=>H.set(q,ot)));let O=ue?!1:Br(d,v.matches||y.matches),I=J===!0||y.navigation.formMethod!=null&&ve(y.navigation.formMethod)&&(($=d.state)==null?void 0:$._isRedirect)!==!0;s&&(l=s,s=void 0),ue||M==="POP"||(M==="PUSH"?e.history.push(d,d.state):M==="REPLACE"&&e.history.replace(d,d.state));let j;if(M==="POP"){let V=le.get(y.location.pathname);V&&V.has(d.pathname)?j={currentLocation:y.location,nextLocation:d}:le.has(d.pathname)&&(j={currentLocation:d,nextLocation:y.location})}else if(ae){let V=le.get(y.location.pathname);V?V.add(d.pathname):(V=new Set([d.pathname]),le.set(y.location.pathname,V)),j={currentLocation:y.location,nextLocation:d}}pe({...v,actionData:T,loaderData:N,historyAction:M,location:d,initialized:!0,navigation:qt,revalidation:"idle",restoreScrollPosition:O,preventScrollReset:I,blockers:H},{viewTransitionOpts:j,flushSync:w===!0}),M="POP",J=!1,ae=!1,ue=!1,X=!1,F==null||F.resolve(),F=null,de==null||de.resolve(),de=null}async function Ir(d,v){if(F==null||F.resolve(),F=null,typeof d=="number"){F||(F=pn());let q=F.promise;return e.history.go(d),q}let w=ar(y.location,y.matches,u,d,v==null?void 0:v.fromRouteId,v==null?void 0:v.relative),{path:L,submission:T,error:N}=rn(!1,w,v),H=y.location,O=dt(y.location,L,v&&v.state);O={...O,...e.history.encodeLocation(O)};let I=v&&v.replace!=null?v.replace:void 0,j="PUSH";I===!0?j="REPLACE":I===!1||T!=null&&ve(T.formMethod)&&T.formAction===y.location.pathname+y.location.search&&(j="REPLACE");let Y=v&&"preventScrollReset"in v?v.preventScrollReset===!0:void 0,$=(v&&v.flushSync)===!0,V=Hr({currentLocation:H,nextLocation:O,historyAction:j});if(V){gt(V,{state:"blocked",location:O,proceed(){gt(V,{state:"proceeding",proceed:void 0,reset:void 0,location:O}),Ir(d,v)},reset(){let q=new Map(y.blockers);q.set(V,ot),pe({blockers:q})}});return}await Ue(j,O,{submission:T,pendingError:N,preventScrollReset:Y,replace:v&&v.replace,enableViewTransition:v&&v.viewTransition,flushSync:$,callSiteDefaultShouldRevalidate:v&&v.unstable_defaultShouldRevalidate})}function La(){de||(de=pn()),Wt(),pe({revalidation:"loading"});let d=de.promise;return y.navigation.state==="submitting"?d:y.navigation.state==="idle"?(Ue(y.historyAction,y.location,{startUninterruptedRevalidation:!0}),d):(Ue(M||y.historyAction,y.navigation.location,{overrideNavigation:y.navigation,enableViewTransition:ae===!0}),d)}async function Ue(d,v,w){K&&K.abort(),K=null,M=d,ue=(w&&w.startUninterruptedRevalidation)===!0,Na(y.location,y.matches),J=(w&&w.preventScrollReset)===!0,ae=(w&&w.enableViewTransition)===!0;let L=s||l,T=w&&w.overrideNavigation,N=w!=null&&w.initialHydration&&y.matches&&y.matches.length>0&&!_?y.matches:Ae(L,v,u),H=(w&&w.flushSync)===!0;if(N&&y.initialized&&!X&&Wo(y.location,v)&&!(w&&w.submission&&ve(w.submission.formMethod))){Ke(v,{matches:N},{flushSync:H});return}let O=wt(N,L,v.pathname);if(O.active&&O.matches&&(N=O.matches),!N){let{error:fe,notFoundMatches:ge,route:ne}=Vt(v.pathname);Ke(v,{matches:ge,loaderData:{},errors:{[ne.id]:fe}},{flushSync:H});return}K=new AbortController;let I=qe(e.history,v,K.signal,w&&w.submission),j=e.getContext?await e.getContext():new Xr,Y;if(w&&w.pendingError)Y=[Ne(N).route.id,{type:"error",error:w.pendingError}];else if(w&&w.submission&&ve(w.submission.formMethod)){let fe=await xa(I,v,w.submission,N,j,O.active,w&&w.initialHydration===!0,{replace:w.replace,flushSync:H});if(fe.shortCircuited)return;if(fe.pendingActionResult){let[ge,ne]=fe.pendingActionResult;if(Re(ne)&&Ve(ne.error)&&ne.error.status===404){K=null,Ke(v,{matches:fe.matches,loaderData:{},errors:{[ge]:ne.error}});return}}N=fe.matches||N,Y=fe.pendingActionResult,T=Qt(v,w.submission),H=!1,O.active=!1,I=qe(e.history,I.url,I.signal)}let{shortCircuited:$,matches:V,loaderData:q,errors:he}=await Pa(I,v,N,j,O.active,T,w&&w.submission,w&&w.fetcherSubmission,w&&w.replace,w&&w.initialHydration===!0,H,Y,w&&w.callSiteDefaultShouldRevalidate);$||(K=null,Ke(v,{matches:V||N,...hn(Y),loaderData:q,errors:he}))}async function xa(d,v,w,L,T,N,H,O={}){Wt();let I=Qo(v,w);if(pe({navigation:I},{flushSync:O.flushSync===!0}),N){let $=await Et(L,v.pathname,d.signal);if($.type==="aborted")return{shortCircuited:!0};if($.type==="error"){if($.partialMatches.length===0){let{matches:q,route:he}=Ct(l);return{matches:q,pendingActionResult:[he.id,{type:"error",error:$.error}]}}let V=Ne($.partialMatches).route.id;return{matches:$.partialMatches,pendingActionResult:[V,{type:"error",error:$.error}]}}else if($.matches)L=$.matches;else{let{notFoundMatches:V,error:q,route:he}=Vt(v.pathname);return{matches:V,pendingActionResult:[he.id,{type:"error",error:q}]}}}let j,Y=Dt(L,v);if(!Y.route.action&&!Y.route.lazy)j={type:"error",error:Ce(405,{method:d.method,pathname:v.pathname,routeId:Y.route.id})};else{let $=Ze(o,i,d,L,Y,H?[]:n,T),V=await rt(d,$,T,null);if(j=V[Y.route.id],!j){for(let q of L)if(V[q.route.id]){j=V[q.route.id];break}}if(d.signal.aborted)return{shortCircuited:!0}}if(Ye(j)){let $;return O&&O.replace!=null?$=O.replace:$=un(j.response.headers.get("Location"),new URL(d.url),u,e.history)===y.location.pathname+y.location.search,await He(d,j,!0,{submission:w,replace:$}),{shortCircuited:!0}}if(Re(j)){let $=Ne(L,Y.route.id);return(O&&O.replace)!==!0&&(M="PUSH"),{matches:L,pendingActionResult:[$.route.id,j,Y.route.id]}}return{matches:L,pendingActionResult:[Y.route.id,j]}}async function Pa(d,v,w,L,T,N,H,O,I,j,Y,$,V){let q=N||Qt(v,H),he=H||O||mn(q),fe=!ue&&!j;if(T){if(fe){let ye=Ar($);pe({navigation:q,...ye!==void 0?{actionData:ye}:{}},{flushSync:Y})}let Z=await Et(w,v.pathname,d.signal);if(Z.type==="aborted")return{shortCircuited:!0};if(Z.type==="error"){if(Z.partialMatches.length===0){let{matches:Xe,route:We}=Ct(l);return{matches:Xe,loaderData:{},errors:{[We.id]:Z.error}}}let ye=Ne(Z.partialMatches).route.id;return{matches:Z.partialMatches,loaderData:{},errors:{[ye]:Z.error}}}else if(Z.matches)w=Z.matches;else{let{error:ye,notFoundMatches:Xe,route:We}=Vt(v.pathname);return{matches:Xe,loaderData:{},errors:{[We.id]:ye}}}}let ge=s||l,{dsMatches:ne,revalidatingFetchers:Se}=nn(d,L,o,i,e.history,y,w,he,v,j?[]:n,j===!0,X,ee,z,U,C,ge,u,e.patchRoutesOnNavigation!=null,$,V);if(se=++ce,!e.dataStrategy&&!ne.some(Z=>Z.shouldLoad)&&!ne.some(Z=>Z.route.middleware&&Z.route.middleware.length>0)&&Se.length===0){let Z=kr();return Ke(v,{matches:w,loaderData:{},errors:$&&Re($[1])?{[$[0]]:$[1].error}:null,...hn($),...Z?{fetchers:new Map(y.fetchers)}:{}},{flushSync:Y}),{shortCircuited:!0}}if(fe){let Z={};if(!T){Z.navigation=q;let ye=Ar($);ye!==void 0&&(Z.actionData=ye)}Se.length>0&&(Z.fetchers=Ta(Se)),pe(Z,{flushSync:Y})}Se.forEach(Z=>{Oe(Z.key),Z.controller&&re.set(Z.key,Z.controller)});let ze=()=>Se.forEach(Z=>Oe(Z.key));K&&K.signal.addEventListener("abort",ze);let{loaderResults:nt,fetcherResults:Fe}=await Fr(ne,Se,d,L);if(d.signal.aborted)return{shortCircuited:!0};K&&K.signal.removeEventListener("abort",ze),Se.forEach(Z=>re.delete(Z.key));let Pe=Lt(nt);if(Pe)return await He(d,Pe.result,!0,{replace:I}),{shortCircuited:!0};if(Pe=Lt(Fe),Pe)return C.add(Pe.key),await He(d,Pe.result,!0,{replace:I}),{shortCircuited:!0};let{loaderData:Jt,errors:at}=dn(y,w,nt,$,Se,Fe);j&&y.errors&&(at={...y.errors,...at});let Be=kr(),Rt=jr(se),bt=Be||Rt||Se.length>0;return{matches:w,loaderData:Jt,errors:at,...bt?{fetchers:new Map(y.fetchers)}:{}}}function Ar(d){if(d&&!Re(d[1]))return{[d[0]]:d[1].data};if(y.actionData)return Object.keys(y.actionData).length===0?null:y.actionData}function Ta(d){return d.forEach(v=>{let w=y.fetchers.get(v.key),L=it(void 0,w?w.data:void 0);y.fetchers.set(v.key,L)}),new Map(y.fetchers)}async function Ma(d,v,w,L){Oe(d);let T=(L&&L.flushSync)===!0,N=s||l,H=ar(y.location,y.matches,u,w,v,L==null?void 0:L.relative),O=Ae(N,H,u),I=wt(O,N,H);if(I.active&&I.matches&&(O=I.matches),!O){_e(d,v,Ce(404,{pathname:H}),{flushSync:T});return}let{path:j,submission:Y,error:$}=rn(!0,H,L);if($){_e(d,v,$,{flushSync:T});return}let V=e.getContext?await e.getContext():new Xr,q=(L&&L.preventScrollReset)===!0;if(Y&&ve(Y.formMethod)){await Da(d,v,j,O,V,I.active,T,q,Y,L&&L.unstable_defaultShouldRevalidate);return}U.set(d,{routeId:v,path:j}),await _a(d,v,j,O,V,I.active,T,q,Y)}async function Da(d,v,w,L,T,N,H,O,I,j){Wt(),U.delete(d);let Y=y.fetchers.get(d);De(d,Zo(I,Y),{flushSync:H});let $=new AbortController,V=qe(e.history,w,$.signal,I);if(N){let ie=await Et(L,new URL(V.url).pathname,V.signal,d);if(ie.type==="aborted")return;if(ie.type==="error"){_e(d,v,ie.error,{flushSync:H});return}else if(ie.matches)L=ie.matches;else{_e(d,v,Ce(404,{pathname:w}),{flushSync:H});return}}let q=Dt(L,w);if(!q.route.action&&!q.route.lazy){let ie=Ce(405,{method:I.formMethod,pathname:w,routeId:v});_e(d,v,ie,{flushSync:H});return}re.set(d,$);let he=ce,fe=Ze(o,i,V,L,q,n,T),ge=await rt(V,fe,T,d),ne=ge[q.route.id];if(!ne){for(let ie of fe)if(ge[ie.route.id]){ne=ge[ie.route.id];break}}if(V.signal.aborted){re.get(d)===$&&re.delete(d);return}if(z.has(d)){if(Ye(ne)||Re(ne)){De(d,Ie(void 0));return}}else{if(Ye(ne))if(re.delete(d),se>he){De(d,Ie(void 0));return}else return C.add(d),De(d,it(I)),He(V,ne,!1,{fetcherSubmission:I,preventScrollReset:O});if(Re(ne)){_e(d,v,ne.error);return}}let Se=y.navigation.location||y.location,ze=qe(e.history,Se,$.signal),nt=s||l,Fe=y.navigation.state!=="idle"?Ae(nt,y.navigation.location,u):y.matches;W(Fe,"Didn't find any matches after fetcher action");let Pe=++ce;p.set(d,Pe);let Jt=it(I,ne.data);y.fetchers.set(d,Jt);let{dsMatches:at,revalidatingFetchers:Be}=nn(ze,T,o,i,e.history,y,Fe,I,Se,n,!1,X,ee,z,U,C,nt,u,e.patchRoutesOnNavigation!=null,[q.route.id,ne],j);Be.filter(ie=>ie.key!==d).forEach(ie=>{let St=ie.key,Yr=y.fetchers.get(St),ja=it(void 0,Yr?Yr.data:void 0);y.fetchers.set(St,ja),Oe(St),ie.controller&&re.set(St,ie.controller)}),pe({fetchers:new Map(y.fetchers)});let Rt=()=>Be.forEach(ie=>Oe(ie.key));$.signal.addEventListener("abort",Rt);let{loaderResults:bt,fetcherResults:Z}=await Fr(at,Be,ze,T);if($.signal.aborted)return;if($.signal.removeEventListener("abort",Rt),p.delete(d),re.delete(d),Be.forEach(ie=>re.delete(ie.key)),y.fetchers.has(d)){let ie=Ie(ne.data);y.fetchers.set(d,ie)}let ye=Lt(bt);if(ye)return He(ze,ye.result,!1,{preventScrollReset:O});if(ye=Lt(Z),ye)return C.add(ye.key),He(ze,ye.result,!1,{preventScrollReset:O});let{loaderData:Xe,errors:We}=dn(y,Fe,bt,void 0,Be,Z);jr(Pe),y.navigation.state==="loading"&&Pe>se?(W(M,"Expected pending action"),K&&K.abort(),Ke(y.navigation.location,{matches:Fe,loaderData:Xe,errors:We,fetchers:new Map(y.fetchers)})):(pe({errors:We,loaderData:fn(y.loaderData,Xe,Fe,We),fetchers:new Map(y.fetchers)}),X=!1)}async function _a(d,v,w,L,T,N,H,O,I){let j=y.fetchers.get(d);De(d,it(I,j?j.data:void 0),{flushSync:H});let Y=new AbortController,$=qe(e.history,w,Y.signal);if(N){let ne=await Et(L,new URL($.url).pathname,$.signal,d);if(ne.type==="aborted")return;if(ne.type==="error"){_e(d,v,ne.error,{flushSync:H});return}else if(ne.matches)L=ne.matches;else{_e(d,v,Ce(404,{pathname:w}),{flushSync:H});return}}let V=Dt(L,w);re.set(d,Y);let q=ce,he=Ze(o,i,$,L,V,n,T),ge=(await rt($,he,T,d))[V.route.id];if(re.get(d)===Y&&re.delete(d),!$.signal.aborted){if(z.has(d)){De(d,Ie(void 0));return}if(Ye(ge))if(se>q){De(d,Ie(void 0));return}else{C.add(d),await He($,ge,!1,{preventScrollReset:O});return}if(Re(ge)){_e(d,v,ge.error);return}De(d,Ie(ge.data))}}async function He(d,v,w,{submission:L,fetcherSubmission:T,preventScrollReset:N,replace:H}={}){w||(F==null||F.resolve(),F=null),v.response.headers.has("X-Remix-Revalidate")&&(X=!0);let O=v.response.headers.get("Location");W(O,"Expected a Location header on the redirect Response"),O=un(O,new URL(d.url),u,e.history);let I=dt(y.location,O,{_isRedirect:!0});if(r){let he=!1;if(v.response.headers.has("X-Remix-Reload-Document"))he=!0;else if(vr(O)){const fe=xn(O,!0);he=fe.origin!==t.location.origin||be(fe.pathname,u)==null}if(he){H?t.location.replace(O):t.location.assign(O);return}}K=null;let j=H===!0||v.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Y,formAction:$,formEncType:V}=y.navigation;!L&&!T&&Y&&$&&V&&(L=mn(y.navigation));let q=L||T;if(Do.has(v.response.status)&&q&&ve(q.formMethod))await Ue(j,I,{submission:{...q,formAction:O},preventScrollReset:N||J,enableViewTransition:w?ae:void 0});else{let he=Qt(I,L);await Ue(j,I,{overrideNavigation:he,fetcherSubmission:T,preventScrollReset:N||J,enableViewTransition:w?ae:void 0})}}async function rt(d,v,w,L){var H;let T,N={};try{T=await ko(h,d,v,L,w,!1)}catch(O){return v.filter(I=>I.shouldLoad).forEach(I=>{N[I.route.id]={type:"error",error:O}}),N}if(d.signal.aborted)return N;if(!ve(d.method))for(let O of v){if(((H=T[O.route.id])==null?void 0:H.type)==="error")break;!T.hasOwnProperty(O.route.id)&&!y.loaderData.hasOwnProperty(O.route.id)&&(!y.errors||!y.errors.hasOwnProperty(O.route.id))&&O.shouldCallHandler()&&(T[O.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${O.route.id}`)})}for(let[O,I]of Object.entries(T))if(Go(I)){let j=I.result;N[O]={type:"redirect",response:zo(j,d,O,v,u)}}else N[O]=await Ho(I);return N}async function Fr(d,v,w,L){let T=rt(w,d,L,null),N=Promise.all(v.map(async I=>{if(I.matches&&I.match&&I.request&&I.controller){let Y=(await rt(I.request,I.matches,L,I.key))[I.match.route.id];return{[I.key]:Y}}else return Promise.resolve({[I.key]:{type:"error",error:Ce(404,{pathname:I.path})}})})),H=await T,O=(await N).reduce((I,j)=>Object.assign(I,j),{});return{loaderResults:H,fetcherResults:O}}function Wt(){X=!0,U.forEach((d,v)=>{re.has(v)&&ee.add(v),Oe(v)})}function De(d,v,w={}){y.fetchers.set(d,v),pe({fetchers:new Map(y.fetchers)},{flushSync:(w&&w.flushSync)===!0})}function _e(d,v,w,L={}){let T=Ne(y.matches,v);Yt(d),pe({errors:{[T.route.id]:w},fetchers:new Map(y.fetchers)},{flushSync:(L&&L.flushSync)===!0})}function Nr(d){return k.set(d,(k.get(d)||0)+1),z.has(d)&&z.delete(d),y.fetchers.get(d)||kn}function Oa(d,v){Oe(d,v==null?void 0:v.reason),De(d,Ie(null))}function Yt(d){let v=y.fetchers.get(d);re.has(d)&&!(v&&v.state==="loading"&&p.has(d))&&Oe(d),U.delete(d),p.delete(d),C.delete(d),z.delete(d),ee.delete(d),y.fetchers.delete(d)}function Ia(d){let v=(k.get(d)||0)-1;v<=0?(k.delete(d),z.add(d)):k.set(d,v),pe({fetchers:new Map(y.fetchers)})}function Oe(d,v){let w=re.get(d);w&&(w.abort(v),re.delete(d))}function $r(d){for(let v of d){let w=Nr(v),L=Ie(w.data);y.fetchers.set(v,L)}}function kr(){let d=[],v=!1;for(let w of C){let L=y.fetchers.get(w);W(L,`Expected fetcher: ${w}`),L.state==="loading"&&(C.delete(w),d.push(w),v=!0)}return $r(d),v}function jr(d){let v=[];for(let[w,L]of p)if(L<d){let T=y.fetchers.get(w);W(T,`Expected fetcher: ${w}`),T.state==="loading"&&(Oe(w),p.delete(w),v.push(w))}return $r(v),v.length>0}function Aa(d,v){let w=y.blockers.get(d)||ot;return G.get(d)!==v&&G.set(d,v),w}function Ur(d){y.blockers.delete(d),G.delete(d)}function gt(d,v){let w=y.blockers.get(d)||ot;W(w.state==="unblocked"&&v.state==="blocked"||w.state==="blocked"&&v.state==="blocked"||w.state==="blocked"&&v.state==="proceeding"||w.state==="blocked"&&v.state==="unblocked"||w.state==="proceeding"&&v.state==="unblocked",`Invalid blocker state transition: ${w.state} -> ${v.state}`);let L=new Map(y.blockers);L.set(d,v),pe({blockers:L})}function Hr({currentLocation:d,nextLocation:v,historyAction:w}){if(G.size===0)return;G.size>1&&oe(!1,"A router only supports one blocker at a time");let L=Array.from(G.entries()),[T,N]=L[L.length-1],H=y.blockers.get(T);if(!(H&&H.state==="proceeding")&&N({currentLocation:d,nextLocation:v,historyAction:w}))return T}function Vt(d){let v=Ce(404,{pathname:d}),w=s||l,{matches:L,route:T}=Ct(w);return{notFoundMatches:L,route:T,error:v}}function Fa(d,v,w){if(R=d,E=v,b=w||null,!x&&y.navigation===qt){x=!0;let L=Br(y.location,y.matches);L!=null&&pe({restoreScrollPosition:L})}return()=>{R=null,E=null,b=null}}function zr(d,v){return b&&b(d,v.map(L=>Pn(L,y.loaderData)))||d.key}function Na(d,v){if(R&&E){let w=zr(d,v);R[w]=E()}}function Br(d,v){if(R){let w=zr(d,v),L=R[w];if(typeof L=="number")return L}return null}function wt(d,v,w){if(e.patchRoutesOnNavigation)if(d){if(Object.keys(d[0].params).length>0)return{active:!0,matches:ut(v,w,u,!0)}}else return{active:!0,matches:ut(v,w,u,!0)||[]};return{active:!1,matches:null}}async function Et(d,v,w,L){if(!e.patchRoutesOnNavigation)return{type:"success",matches:d};let T=d;for(;;){let N=s==null,H=s||l,O=i;try{await e.patchRoutesOnNavigation({signal:w,path:v,matches:T,fetcherKey:L,patch:(Y,$)=>{w.aborted||an(Y,$,H,O,o,!1)}})}catch(Y){return{type:"error",error:Y,partialMatches:T}}finally{N&&!w.aborted&&(l=[...l])}if(w.aborted)return{type:"aborted"};let I=Ae(H,v,u),j=null;if(I){if(Object.keys(I[0].params).length===0)return{type:"success",matches:I};if(j=ut(H,v,u,!0),!(j&&T.length<j.length&&Wr(T,j.slice(0,T.length))))return{type:"success",matches:I}}if(j||(j=ut(H,v,u,!0)),!j||Wr(T,j))return{type:"success",matches:null};T=j}}function Wr(d,v){return d.length===v.length&&d.every((w,L)=>w.route.id===v[L].route.id)}function $a(d){i={},s=ft(d,o,void 0,i)}function ka(d,v,w=!1){let L=s==null;an(d,v,s||l,i,o,w),L&&(l=[...l],pe({}))}return D={get basename(){return u},get future(){return c},get state(){return y},get routes(){return l},get window(){return t},initialize:me,subscribe:Ca,enableScrollRestoration:Fa,navigate:Ir,fetch:Ma,revalidate:La,createHref:d=>e.history.createHref(d),encodeLocation:d=>e.history.encodeLocation(d),getFetcher:Nr,resetFetcher:Oa,deleteFetcher:Ia,dispose:Bt,getBlocker:Aa,deleteBlocker:Ur,patchRoutes:ka,_internalFetchControllers:re,_internalSetRoutes:$a,_internalSetStateDoNotUseOrYouWillBreakYourApp(d){pe(d)}},e.unstable_instrumentations&&(D=bo(D,e.unstable_instrumentations.map(d=>d.router).filter(Boolean))),D}function Oo(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function ar(e,t,r,n,a,o){let i,l;if(a){i=[];for(let u of t)if(i.push(u),u.route.id===a){l=u;break}}else i=t,l=t[t.length-1];let s=wr(n||".",gr(i),be(e.pathname,r)||e.pathname,o==="path");if(n==null&&(s.search=e.search,s.hash=e.hash),(n==null||n===""||n===".")&&l){let u=Rr(s.search);if(l.route.index&&!u)s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&u){let h=new URLSearchParams(s.search),c=h.getAll("index");h.delete("index"),c.filter(g=>g).forEach(g=>h.append("index",g));let m=h.toString();s.search=m?`?${m}`:""}}return r!=="/"&&(s.pathname=ho({basename:r,pathname:s.pathname})),Me(s)}function rn(e,t,r){if(!r||!Oo(r))return{path:t};if(r.formMethod&&!qo(r.formMethod))return{path:t,error:Ce(405,{method:r.formMethod})};let n=()=>({path:t,error:Ce(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),i=Vn(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ve(o))return n();let c=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,[g,R])=>`${m}${g}=${R}
|
|
19
|
-
`,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:i,formEncType:r.formEncType,formData:void 0,json:void 0,text:c}}}else if(r.formEncType==="application/json"){if(!ve(o))return n();try{let c=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:o,formAction:i,formEncType:r.formEncType,formData:void 0,json:c,text:void 0}}}catch{return n()}}}W(typeof FormData=="function","FormData is not available in this environment");let l,s;if(r.formData)l=lr(r.formData),s=r.formData;else if(r.body instanceof FormData)l=lr(r.body),s=r.body;else if(r.body instanceof URLSearchParams)l=r.body,s=cn(l);else if(r.body==null)l=new URLSearchParams,s=new FormData;else try{l=new URLSearchParams(r.body),s=cn(l)}catch{return n()}let u={formMethod:o,formAction:i,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:s,json:void 0,text:void 0};if(ve(u.formMethod))return{path:t,submission:u};let h=ke(t);return e&&h.search&&Rr(h.search)&&l.append("index",""),h.search=`?${l}`,{path:Me(h),submission:u}}function nn(e,t,r,n,a,o,i,l,s,u,h,c,m,g,R,b,E,x,S,_,A){var ue;let P=_?Re(_[1])?_[1].error:_[1].data:void 0,D=a.createURL(o.location),y=a.createURL(s),M;if(h&&o.errors){let X=Object.keys(o.errors)[0];M=i.findIndex(ee=>ee.route.id===X)}else if(_&&Re(_[1])){let X=_[0];M=i.findIndex(ee=>ee.route.id===X)-1}let F=_?_[1].statusCode:void 0,J=F&&F>=400,K={currentUrl:D,currentParams:((ue=o.matches[0])==null?void 0:ue.params)||{},nextUrl:y,nextParams:i[0].params,...l,actionResult:P,actionStatus:F},ae=mt(i),le=i.map((X,ee)=>{let{route:re}=X,ce=null;if(M!=null&&ee>M?ce=!1:re.lazy?ce=!0:Er(re)?h?ce=or(re,o.loaderData,o.errors):Io(o.loaderData,o.matches[ee],X)&&(ce=!0):ce=!1,ce!==null)return ir(r,n,e,ae,X,u,t,ce);let se=!1;typeof A=="boolean"?se=A:J?se=!1:(c||D.pathname+D.search===y.pathname+y.search||D.search!==y.search||Ao(o.matches[ee],X))&&(se=!0);let p={...K,defaultShouldRevalidate:se},C=ct(X,p);return ir(r,n,e,ae,X,u,t,C,p,A)}),Q=[];return R.forEach((X,ee)=>{if(h||!i.some(z=>z.route.id===X.routeId)||g.has(ee))return;let re=o.fetchers.get(ee),ce=re&&re.state!=="idle"&&re.data===void 0,se=Ae(E,X.path,x);if(!se){if(S&&ce)return;Q.push({key:ee,routeId:X.routeId,path:X.path,matches:null,match:null,request:null,controller:null});return}if(b.has(ee))return;let p=Dt(se,X.path),C=new AbortController,U=qe(a,X.path,C.signal),k=null;if(m.has(ee))m.delete(ee),k=Ze(r,n,U,se,p,u,t);else if(ce)c&&(k=Ze(r,n,U,se,p,u,t));else{let z;typeof A=="boolean"?z=A:J?z=!1:z=c;let G={...K,defaultShouldRevalidate:z};ct(p,G)&&(k=Ze(r,n,U,se,p,u,t,G))}k&&Q.push({key:ee,routeId:X.routeId,path:X.path,matches:k,match:p,request:U,controller:C})}),{dsMatches:le,revalidatingFetchers:Q}}function Er(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function or(e,t,r){if(e.lazy)return!0;if(!Er(e))return!1;let n=t!=null&&e.id in t,a=r!=null&&r[e.id]!==void 0;return!n&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!n&&!a}function Io(e,t,r){let n=!t||r.route.id!==t.route.id,a=!e.hasOwnProperty(r.route.id);return n||a}function Ao(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function ct(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function an(e,t,r,n,a,o){let i;if(e){let u=n[e];W(u,`No route found to patch children into: routeId = ${e}`),u.children||(u.children=[]),i=u.children}else i=r;let l=[],s=[];if(t.forEach(u=>{let h=i.find(c=>Hn(u,c));h?s.push({existingRoute:h,newRoute:u}):l.push(u)}),l.length>0){let u=ft(l,a,[e||"_","patch",String((i==null?void 0:i.length)||"0")],n);i.push(...u)}if(o&&s.length>0)for(let u=0;u<s.length;u++){let{existingRoute:h,newRoute:c}=s[u],m=h,[g]=ft([c],a,[],{},!0);Object.assign(m,{element:g.element?g.element:m.element,errorElement:g.errorElement?g.errorElement:m.errorElement,hydrateFallbackElement:g.hydrateFallbackElement?g.hydrateFallbackElement:m.hydrateFallbackElement})}}function Hn(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,n)=>{var a;return(a=t.children)==null?void 0:a.some(o=>Hn(r,o))}):!1}var on=new WeakMap,zn=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let a=r[t.id];if(W(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let o=a.lazy[e];if(!o)return;let i=on.get(a);i||(i={},on.set(a,i));let l=i[e];if(l)return l;let s=(async()=>{let u=qa(e),c=a[e]!==void 0&&e!=="hasErrorBoundary";if(u)oe(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(c)oe(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let m=await o();m!=null&&(Object.assign(a,{[e]:m}),Object.assign(a,n(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(m=>m===void 0)&&(a.lazy=void 0))})();return i[e]=s,s},ln=new WeakMap;function Fo(e,t,r,n,a){let o=r[e.id];if(W(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let h=ln.get(o);if(h)return{lazyRoutePromise:h,lazyHandlerPromise:h};let c=(async()=>{W(typeof e.lazy=="function","No lazy route function found");let m=await e.lazy(),g={};for(let R in m){let b=m[R];if(b===void 0)continue;let E=Za(R),S=o[R]!==void 0&&R!=="hasErrorBoundary";E?oe(!E,"Route property "+R+" is not a supported property to be returned from a lazy route function. This property will be ignored."):S?oe(!S,`Route "${o.id}" has a static property "${R}" defined but its lazy function is also returning a value for this property. The lazy route property "${R}" will be ignored.`):g[R]=b}Object.assign(o,g),Object.assign(o,{...n(o),lazy:void 0})})();return ln.set(o,c),c.catch(()=>{}),{lazyRoutePromise:c,lazyHandlerPromise:c}}let i=Object.keys(e.lazy),l=[],s;for(let h of i){if(a&&a.includes(h))continue;let c=zn({key:h,route:e,manifest:r,mapRouteProperties:n});c&&(l.push(c),h===t&&(s=c))}let u=l.length>0?Promise.all(l).then(()=>{}):void 0;return u==null||u.catch(()=>{}),s==null||s.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:s}}async function sn(e){let t=e.matches.filter(a=>a.shouldLoad),r={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,o)=>{r[t[o].route.id]=a}),r}async function No(e){return e.matches.some(t=>t.route.middleware)?Bn(e,()=>sn(e)):sn(e)}function Bn(e,t){return $o(e,t,n=>{if(Xo(n))throw n;return n},Vo,r);function r(n,a,o){if(o)return Promise.resolve(Object.assign(o.value,{[a]:{type:"error",result:n}}));{let{matches:i}=e,l=Math.min(Math.max(i.findIndex(u=>u.route.id===a),0),Math.max(i.findIndex(u=>u.shouldCallHandler()),0)),s=Ne(i,i[l].route.id).route.id;return Promise.resolve({[s]:{type:"error",result:n}})}}}async function $o(e,t,r,n,a){let{matches:o,request:i,params:l,context:s,unstable_pattern:u}=e,h=o.flatMap(m=>m.route.middleware?m.route.middleware.map(g=>[m.route.id,g]):[]);return await Wn({request:i,params:l,context:s,unstable_pattern:u},h,t,r,n,a)}async function Wn(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,h]=s,c,m=async()=>{if(c)throw new Error("You may only call `next()` once per middleware");try{return c={value:await Wn(e,t,r,n,a,o,i+1)},c.value}catch(g){return c={value:await o(g,u,c)},c.value}};try{let g=await h(e,m),R=g!=null?n(g):void 0;return a(R)?R:c?R??c.value:(c={value:await m()},c.value)}catch(g){return await o(g,u,c)}}function Yn(e,t,r,n,a){let o=zn({key:"middleware",route:n.route,manifest:t,mapRouteProperties:e}),i=Fo(n.route,ve(r.method)?"action":"loader",t,e,a);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function ir(e,t,r,n,a,o,i,l,s=null,u){let h=!1,c=Yn(e,t,r,a,o);return{...a,_lazyPromises:c,shouldLoad:l,shouldRevalidateArgs:s,shouldCallHandler(m){return h=!0,s?typeof u=="boolean"?ct(a,{...s,defaultShouldRevalidate:u}):typeof m=="boolean"?ct(a,{...s,defaultShouldRevalidate:m}):ct(a,s):l},resolve(m){let{lazy:g,loader:R,middleware:b}=a.route,E=h||l||m&&!ve(r.method)&&(g||R),x=b&&b.length>0&&!R&&!g;return E&&(ve(r.method)||!x)?jo({request:r,unstable_pattern:n,match:a,lazyHandlerPromise:c==null?void 0:c.handler,lazyRoutePromise:c==null?void 0:c.route,handlerOverride:m,scopedContext:i}):Promise.resolve({type:"data",result:void 0})}}}function Ze(e,t,r,n,a,o,i,l=null){return n.map(s=>s.route.id!==a.route.id?{...s,shouldLoad:!1,shouldRevalidateArgs:l,shouldCallHandler:()=>!1,_lazyPromises:Yn(e,t,r,s,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:ir(e,t,r,mt(n),s,o,i,!0,l))}async function ko(e,t,r,n,a,o){r.some(u=>{var h;return(h=u._lazyPromises)==null?void 0:h.middleware})&&await Promise.all(r.map(u=>{var h;return(h=u._lazyPromises)==null?void 0:h.middleware}));let i={request:t,unstable_pattern:mt(r),params:r[0].params,context:a,matches:r},s=await e({...i,fetcherKey:n,runClientMiddleware:u=>{let h=i;return Bn(h,()=>u({...h,fetcherKey:n,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(u=>{var h,c;return[(h=u._lazyPromises)==null?void 0:h.handler,(c=u._lazyPromises)==null?void 0:c.route]}))}catch{}return s}async function jo({request:e,unstable_pattern:t,match:r,lazyHandlerPromise:n,lazyRoutePromise:a,handlerOverride:o,scopedContext:i}){let l,s,u=ve(e.method),h=u?"action":"loader",c=m=>{let g,R=new Promise((x,S)=>g=S);s=()=>g(),e.signal.addEventListener("abort",s);let b=x=>typeof m!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${h}" [routeId: ${r.route.id}]`)):m({request:e,unstable_pattern:t,params:r.params,context:i},...x!==void 0?[x]:[]),E=(async()=>{try{return{type:"data",result:await(o?o(S=>b(S)):b())}}catch(x){return{type:"error",result:x}}})();return Promise.race([E,R])};try{let m=u?r.route.action:r.route.loader;if(n||a)if(m){let g,[R]=await Promise.all([c(m).catch(b=>{g=b}),n,a]);if(g!==void 0)throw g;l=R}else{await n;let g=u?r.route.action:r.route.loader;if(g)[l]=await Promise.all([c(g),a]);else if(h==="action"){let R=new URL(e.url),b=R.pathname+R.search;throw Ce(405,{method:e.method,pathname:b,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(m)l=await c(m);else{let g=new URL(e.url),R=g.pathname+g.search;throw Ce(404,{pathname:R})}}catch(m){return{type:"error",result:m}}finally{s&&e.signal.removeEventListener("abort",s)}return l}async function Uo(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Ho(e){var n,a,o,i,l;let{result:t,type:r}=e;if($t(t)){let s;try{s=await Uo(t)}catch(u){return{type:"error",error:u}}return r==="error"?{type:"error",error:new je(t.status,t.statusText,s),statusCode:t.status,headers:t.headers}:{type:"data",data:s,statusCode:t.status,headers:t.headers}}return r==="error"?sr(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(n=t.init)==null?void 0:n.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:Yo(t),statusCode:Ve(t)?t.status:void 0,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Ve(t)?t.status:void 0}:sr(t)?{type:"data",data:t.data,statusCode:(i=t.init)==null?void 0:i.status,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function zo(e,t,r,n,a){let o=e.headers.get("Location");if(W(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!vr(o)){let i=n.slice(0,n.findIndex(l=>l.route.id===r)+1);o=ar(new URL(t.url),i,a,o),e.headers.set("Location",o)}return e}function un(e,t,r,n){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(vr(e)){let o=e,i=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(a.includes(i.protocol))throw new Error("Invalid redirect location");let l=be(i.pathname,r)!=null;if(i.origin===t.origin&&l)return i.pathname+i.search+i.hash}try{let o=n.createURL(e);if(a.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function qe(e,t,r,n){let a=e.createURL(Vn(t)).toString(),o={signal:r};if(n&&ve(n.formMethod)){let{formMethod:i,formEncType:l}=n;o.method=i.toUpperCase(),l==="application/json"?(o.headers=new Headers({"Content-Type":l}),o.body=JSON.stringify(n.json)):l==="text/plain"?o.body=n.text:l==="application/x-www-form-urlencoded"&&n.formData?o.body=lr(n.formData):o.body=n.formData}return new Request(a,o)}function lr(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function cn(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Bo(e,t,r,n=!1,a=!1){let o={},i=null,l,s=!1,u={},h=r&&Re(r[1])?r[1].error:void 0;return e.forEach(c=>{if(!(c.route.id in t))return;let m=c.route.id,g=t[m];if(W(!Ye(g),"Cannot handle redirect results in processLoaderData"),Re(g)){let R=g.error;if(h!==void 0&&(R=h,h=void 0),i=i||{},a)i[m]=R;else{let b=Ne(e,m);i[b.route.id]==null&&(i[b.route.id]=R)}n||(o[m]=Un),s||(s=!0,l=Ve(g.error)?g.error.status:500),g.headers&&(u[m]=g.headers)}else o[m]=g.data,g.statusCode&&g.statusCode!==200&&!s&&(l=g.statusCode),g.headers&&(u[m]=g.headers)}),h!==void 0&&r&&(i={[r[0]]:h},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:i,statusCode:l||200,loaderHeaders:u}}function dn(e,t,r,n,a,o){let{loaderData:i,errors:l}=Bo(t,r,n);return a.filter(s=>!s.matches||s.matches.some(u=>u.shouldLoad)).forEach(s=>{let{key:u,match:h,controller:c}=s;if(c&&c.signal.aborted)return;let m=o[u];if(W(m,"Did not find corresponding fetcher result"),Re(m)){let g=Ne(e.matches,h==null?void 0:h.route.id);l&&l[g.route.id]||(l={...l,[g.route.id]:m.error}),e.fetchers.delete(u)}else if(Ye(m))W(!1,"Unhandled fetcher revalidation redirect");else{let g=Ie(m.data);e.fetchers.set(u,g)}}),{loaderData:i,errors:l}}function fn(e,t,r,n){let a=Object.entries(t).filter(([,o])=>o!==Un).reduce((o,[i,l])=>(o[i]=l,o),{});for(let o of r){let i=o.route.id;if(!t.hasOwnProperty(i)&&e.hasOwnProperty(i)&&o.route.loader&&(a[i]=e[i]),n&&n.hasOwnProperty(i))break}return a}function hn(e){return e?Re(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ne(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function Ct(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Ce(e,{pathname:t,routeId:r,method:n,type:a,message:o}={}){let i="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(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.`:a==="invalid-body"&&(l="Unable to encode submission body")):e===403?(i="Forbidden",l=`Route "${r}" does not match URL "${t}"`):e===404?(i="Not Found",l=`No route matches URL "${t}"`):e===405&&(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 je(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[n,a]=t[r];if(Ye(a))return{key:n,result:a}}}function Vn(e){let t=typeof e=="string"?ke(e):e;return Me({...t,hash:""})}function Wo(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Yo(e){var t,r;return new je(((t=e.init)==null?void 0:t.status)??500,((r=e.init)==null?void 0:r.statusText)??"Internal Server Error",e.data)}function Vo(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&Jo(r))}function Jo(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function Go(e){return $t(e.result)&&$n.has(e.result.status)}function Re(e){return e.type==="error"}function Ye(e){return(e&&e.type)==="redirect"}function sr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function $t(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Ko(e){return $n.has(e)}function Xo(e){return $t(e)&&Ko(e.status)&&e.headers.has("Location")}function qo(e){return Mo.has(e.toUpperCase())}function ve(e){return Po.has(e.toUpperCase())}function Rr(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Dt(e,t){let r=typeof t=="string"?ke(t).search:t.search;if(e[e.length-1].route.index&&Rr(r||""))return e[e.length-1];let n=On(e);return n[n.length-1]}function mn(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function Qt(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Qo(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function it(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 Zo(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}}function Ie(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function ei(e,t){try{let r=e.sessionStorage.getItem(jn);if(r){let n=JSON.parse(r);for(let[a,o]of Object.entries(n||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function ti(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(jn,JSON.stringify(r))}catch(n){oe(!1,`Failed to save applied view transitions in sessionStorage (${n}).`)}}}function pn(){let e,t,r=new Promise((n,a)=>{e=async o=>{n(o);try{await r}catch{}},t=async o=>{a(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var Je=f.createContext(null);Je.displayName="DataRouter";var et=f.createContext(null);et.displayName="DataRouterState";var Jn=f.createContext(!1);function Gn(){return f.useContext(Jn)}var br=f.createContext({isTransitioning:!1});br.displayName="ViewTransition";var Sr=f.createContext(new Map);Sr.displayName="Fetchers";var ri=f.createContext(null);ri.displayName="Await";var Ee=f.createContext(null);Ee.displayName="Navigation";var kt=f.createContext(null);kt.displayName="Location";var Le=f.createContext({outlet:null,matches:[],isDataRoute:!1});Le.displayName="Route";var Cr=f.createContext(null);Cr.displayName="RouteError";var Kn="REACT_ROUTER_ERROR",ni="REDIRECT",ai="ROUTE_ERROR_RESPONSE";function oi(e){if(e.startsWith(`${Kn}:${ni}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function ii(e){if(e.startsWith(`${Kn}:${ai}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new je(t.status,t.statusText,t.data)}catch{}}function li(e,{relative:t}={}){W(pt(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=f.useContext(Ee),{hash:a,pathname:o,search:i}=yt(e,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:Te([r,o])),n.createHref({pathname:l,search:i,hash:a})}function pt(){return f.useContext(kt)!=null}function xe(){return W(pt(),"useLocation() may be used only in the context of a <Router> component."),f.useContext(kt).location}var Xn="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function qn(e){f.useContext(Ee).static||f.useLayoutEffect(e)}function Qn(){let{isDataRoute:e}=f.useContext(Le);return e?Si():si()}function si(){W(pt(),"useNavigate() may be used only in the context of a <Router> component.");let e=f.useContext(Je),{basename:t,navigator:r}=f.useContext(Ee),{matches:n}=f.useContext(Le),{pathname:a}=xe(),o=JSON.stringify(gr(n)),i=f.useRef(!1);return qn(()=>{i.current=!0}),f.useCallback((s,u={})=>{if(oe(i.current,Xn),!i.current)return;if(typeof s=="number"){r.go(s);return}let h=wr(s,JSON.parse(o),a,u.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Te([t,h.pathname])),(u.replace?r.replace:r.push)(h,u.state,u)},[t,r,o,a,e])}var ui=f.createContext(null);function ci(e){let t=f.useContext(Le).outlet;return f.useMemo(()=>t&&f.createElement(ui.Provider,{value:e},t),[t,e])}function di(){let{matches:e}=f.useContext(Le),t=e[e.length-1];return t?t.params:{}}function yt(e,{relative:t}={}){let{matches:r}=f.useContext(Le),{pathname:n}=xe(),a=JSON.stringify(gr(r));return f.useMemo(()=>wr(e,JSON.parse(a),n,t==="path"),[e,a,n,t])}function fi(e,t,r,n,a){W(pt(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=f.useContext(Ee),{matches:i}=f.useContext(Le),l=i[i.length-1],s=l?l.params:{},u=l?l.pathname:"/",h=l?l.pathnameBase:"/",c=l&&l.route;{let S=c&&c.path||"";ra(u,!c||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${S}">) 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.
|
|
18
|
+
*/var xn=e=>{throw TypeError(e)},Ka=(e,t,r)=>t.has(e)||xn("Cannot "+r),Kt=(e,t,r)=>(Ka(e,t,"read from private field"),r?r.call(e):t.get(e)),Xa=(e,t,r)=>t.has(e)?xn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Kr="popstate";function os(e={}){function t(n,a){let{pathname:o,search:i,hash:l}=n.location;return dt("",{pathname:o,search:i,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:Me(a)}return Qa(t,r,null,e)}function W(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function oe(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function qa(){return Math.random().toString(36).substring(2,10)}function Xr(e,t){return{usr:e.state,key:e.key,idx:t}}function dt(e,t,r=null,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ke(t):t,state:r,key:t&&t.key||n||qa()}}function Me({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 ke(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 Qa(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,l="POP",s=null,u=h();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function h(){return(i.state||{idx:null}).idx}function c(){l="POP";let E=h(),x=E==null?null:E-u;u=E,s&&s({action:l,location:b.location,delta:x})}function m(E,x){l="PUSH";let S=dt(b.location,E,x);u=h()+1;let _=Xr(S,u),A=b.createHref(S);try{i.pushState(_,"",A)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;a.location.assign(A)}o&&s&&s({action:l,location:b.location,delta:1})}function g(E,x){l="REPLACE";let S=dt(b.location,E,x);u=h();let _=Xr(S,u),A=b.createHref(S);i.replaceState(_,"",A),o&&s&&s({action:l,location:b.location,delta:0})}function R(E){return Pn(E)}let b={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(Kr,c),s=E,()=>{a.removeEventListener(Kr,c),s=null}},createHref(E){return t(a,E)},createURL:R,encodeLocation(E){let x=R(E);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:m,replace:g,go(E){return i.go(E)}};return b}function Pn(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),W(r,"No window.location.(origin|href) available to create URL");let n=typeof e=="string"?e:Me(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}var st,qr=class{constructor(e){if(Xa(this,st,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Kt(this,st).has(e))return Kt(this,st).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Kt(this,st).set(e,t)}};st=new WeakMap;var Za=new Set(["lazy","caseSensitive","path","id","index","children"]);function eo(e){return Za.has(e)}var to=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function ro(e){return to.has(e)}function no(e){return e.index===!0}function ft(e,t,r=[],n={},a=!1){return e.map((o,i)=>{let l=[...r,String(i)],s=typeof o.id=="string"?o.id:l.join("-");if(W(o.index!==!0||!o.children,"Cannot specify children on an index route"),W(a||!n[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),no(o)){let u={...o,id:s};return n[s]=Qr(u,t(u)),u}else{let u={...o,id:s,children:void 0};return n[s]=Qr(u,t(u)),o.children&&(u.children=ft(o.children,t,l,n,a)),u}})}function Qr(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ae(e,t,r="/"){return ut(e,t,r,!1)}function ut(e,t,r,n){let a=typeof t=="string"?ke(t):t,o=be(a.pathname||"/",r);if(o==null)return null;let i=Mn(e);ao(i);let l=null;for(let s=0;l==null&&s<i.length;++s){let u=po(o);l=mo(i[s],u,n)}return l}function Tn(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 Mn(e,t=[],r=[],n="",a=!1){let o=(i,l,s=a,u)=>{let h={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(n)&&s)return;W(h.relativePath.startsWith(n),`Absolute route path "${h.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(n.length)}let c=Te([n,h.relativePath]),m=r.concat(h);i.children&&i.children.length>0&&(W(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),Mn(i.children,t,m,c,s)),!(i.path==null&&!i.index)&&t.push({path:c,score:fo(c,i.index),routesMeta:m})};return e.forEach((i,l)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,l);else for(let u of Dn(i.path))o(i,l,!0,u)}),t}function Dn(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return a?[o,""]:[o];let i=Dn(n.join("/")),l=[];return l.push(...i.map(s=>s===""?o:[o,s].join("/"))),a&&l.push(...i),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function ao(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:ho(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var oo=/^:[\w-]+$/,io=3,lo=2,so=1,uo=10,co=-2,Zr=e=>e==="*";function fo(e,t){let r=e.split("/"),n=r.length;return r.some(Zr)&&(n+=co),t&&(n+=lo),r.filter(a=>!Zr(a)).reduce((a,o)=>a+(oo.test(o)?io:o===""?so:uo),n)}function ho(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function mo(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",i=[];for(let l=0;l<n.length;++l){let s=n[l],u=l===n.length-1,h=o==="/"?t:t.slice(o.length)||"/",c=At({path:s.relativePath,caseSensitive:s.caseSensitive,end:u},h),m=s.route;if(!c&&u&&r&&!n[n.length-1].route.index&&(c=At({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},h)),!c)return null;Object.assign(a,c.params),i.push({params:a,pathname:Te([o,c.pathname]),pathnameBase:go(Te([o,c.pathnameBase])),route:m}),c.pathnameBase!=="/"&&(o=Te([o,c.pathnameBase]))}return i}function At(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=_n(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((u,{paramName:h,isOptional:c},m)=>{if(h==="*"){let R=l[m]||"";i=o.slice(0,o.length-R.length).replace(/(.)\/+$/,"$1")}const g=l[m];return c&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function _n(e,t=!1,r=!0){oe(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,(i,l,s)=>(n.push({paramName:l,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)")).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 po(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return oe(!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}}function be(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function yo({basename:e,pathname:t}){return t==="/"?e:Te([e,t])}var On=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vr=e=>On.test(e);function vo(e,t="/"){let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?ke(e):e,o;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?o=en(r.substring(1),"/"):o=en(r,t)):o=t,{pathname:o,search:wo(n),hash:Eo(a)}}function en(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Xt(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 In(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function gr(e){let t=In(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function wr(e,t,r,n=!1){let a;typeof e=="string"?a=ke(e):(a={...e},W(!a.pathname||!a.pathname.includes("?"),Xt("?","pathname","search",a)),W(!a.pathname||!a.pathname.includes("#"),Xt("#","pathname","hash",a)),W(!a.search||!a.search.includes("#"),Xt("#","search","hash",a)));let o=e===""||a.pathname==="",i=o?"/":a.pathname,l;if(i==null)l=r;else{let c=t.length-1;if(!n&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),c-=1;a.pathname=m.join("/")}l=c>=0?t[c]:"/"}let s=vo(a,l),u=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||h)&&(s.pathname+="/"),s}var Te=e=>e.join("/").replace(/\/\/+/g,"/"),go=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),wo=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Eo=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Ro=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function bo(e,t){return new Ro(e,typeof t=="number"?{status:t}:t)}var So=(e,t=302)=>{let r=t;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,{...r,headers:n})},je=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 e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function mt(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var An=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Fn(e,t){let r=e;if(typeof r!="string"||!On.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,a=!1;if(An)try{let o=new URL(window.location.href),i=r.startsWith("//")?new URL(o.protocol+r):new URL(r),l=be(i.pathname,t);i.origin===o.origin&&l!=null?r=l+i.search+i.hash:a=!0}catch{oe(!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 $e=Symbol("Uninstrumented");function Co(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(a=>a({id:t.id,index:t.index,path:t.path,instrument(o){let i=Object.keys(r);for(let l of i)o[l]&&r[l].push(o[l])}}));let n={};if(typeof t.lazy=="function"&&r.lazy.length>0){let a=Qe(r.lazy,t.lazy,()=>{});a&&(n.lazy=a)}if(typeof t.lazy=="object"){let a=t.lazy;["middleware","loader","action"].forEach(o=>{let i=a[o],l=r[`lazy.${o}`];if(typeof i=="function"&&l.length>0){let s=Qe(l,i,()=>{});s&&(n.lazy=Object.assign(n.lazy||{},{[o]:s}))}})}return["loader","action"].forEach(a=>{let o=t[a];if(typeof o=="function"&&r[a].length>0){let i=o[$e]??o,l=Qe(r[a],i,(...s)=>tn(s[0]));l&&(a==="loader"&&i.hydrate===!0&&(l.hydrate=!0),l[$e]=i,n[a]=l)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(n.middleware=t.middleware.map(a=>{let o=a[$e]??a,i=Qe(r.middleware,o,(...l)=>tn(l[0]));return i?(i[$e]=o,i):a})),n}function Lo(e,t){let r={navigate:[],fetch:[]};if(t.forEach(n=>n({instrument(a){let o=Object.keys(a);for(let i of o)a[i]&&r[i].push(a[i])}})),r.navigate.length>0){let n=e.navigate[$e]??e.navigate,a=Qe(r.navigate,n,(...o)=>{let[i,l]=o;return{to:typeof i=="number"||typeof i=="string"?i:i?Me(i):".",...rn(e,l??{})}});a&&(a[$e]=n,e.navigate=a)}if(r.fetch.length>0){let n=e.fetch[$e]??e.fetch,a=Qe(r.fetch,n,(...o)=>{let[i,,l,s]=o;return{href:l??".",fetcherKey:i,...rn(e,s??{})}});a&&(a[$e]=n,e.fetch=a)}return e}function Qe(e,t,r){return e.length===0?null:async(...n)=>{let a=await Nn(e,r(...n),()=>t(...n),e.length-1);if(a.type==="error")throw a.value;return a.value}}async function Nn(e,t,r,n){let a=e[n],o;if(a){let i,l=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=Nn(e,t,r,n-1),o=await i,W(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await a(l,t)}catch(s){console.error("An instrumentation function threw an error:",s)}i||await l(),await i}else try{o={type:"success",value:await r()}}catch(i){o={type:"error",value:i}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function tn(e){let{request:t,context:r,params:n,unstable_pattern:a}=e;return{request:xo(t),params:{...n},unstable_pattern:a,context:Po(r)}}function rn(e,t){return{currentUrl:Me(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 xo(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Po(e){if(Mo(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var To=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Mo(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===To}var $n=["POST","PUT","PATCH","DELETE"],Do=new Set($n),_o=["GET",...$n],Oo=new Set(_o),kn=new Set([301,302,303,307,308]),Io=new Set([307,308]),qt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},jn={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ot={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Ao=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Un="remix-router-transitions",Hn=Symbol("ResetLoaderData");function is(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";W(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let n=e.hydrationRouteProperties||[],a=e.mapRouteProperties||Ao,o=a;if(e.unstable_instrumentations){let f=e.unstable_instrumentations;o=v=>({...a(v),...Co(f.map(w=>w.route).filter(Boolean),v)})}let i={},l=ft(e.routes,o,void 0,i),s,u=e.basename||"/";u.startsWith("/")||(u=`/${u}`);let h=e.dataStrategy||jo,c={...e.future},m=null,g=new Set,R=null,b=null,E=null,x=e.hydrationData!=null,S=Ae(l,e.history.location,u),_=!1,A=null,P;if(S==null&&!e.patchRoutesOnNavigation){let f=Ce(404,{pathname:e.history.location.pathname}),{matches:v,route:w}=Ct(l);P=!0,S=v,A={[w.id]:f}}else if(S&&!e.hydrationData&&wt(S,l,e.history.location.pathname).active&&(S=null),S)if(S.some(f=>f.route.lazy))P=!1;else if(!S.some(f=>Er(f.route)))P=!0;else{let f=e.hydrationData?e.hydrationData.loaderData:null,v=e.hydrationData?e.hydrationData.errors:null;if(v){let w=S.findIndex(L=>v[L.route.id]!==void 0);P=S.slice(0,w+1).every(L=>!or(L.route,f,v))}else P=S.every(w=>!or(w.route,f,v))}else{P=!1,S=[];let f=wt(null,l,e.history.location.pathname);f.active&&f.matches&&(_=!0,S=f.matches)}let D,y={historyAction:e.history.action,location:e.history.location,matches:S,initialized:P,navigation:qt,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||A,fetchers:new Map,blockers:new Map},M="POP",F=null,J=!1,K,ae=!1,le=new Map,Q=null,ue=!1,X=!1,ee=new Set,re=new Map,ce=0,se=-1,p=new Map,C=new Set,U=new Map,k=new Map,z=new Set,G=new Map,te,de=null;function me(){if(m=e.history.listen(({action:f,location:v,delta:w})=>{if(te){te(),te=void 0;return}oe(G.size===0||w!=null,"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 L=zr({currentLocation:y.location,nextLocation:v,historyAction:f});if(L&&w!=null){let T=new Promise(N=>{te=N});e.history.go(w*-1),gt(L,{state:"blocked",location:v,proceed(){gt(L,{state:"proceeding",proceed:void 0,reset:void 0,location:v}),T.then(()=>e.history.go(w))},reset(){let N=new Map(y.blockers);N.set(L,ot),pe({blockers:N})}}),F==null||F.resolve(),F=null;return}return Ue(f,v)}),r){ni(t,le);let f=()=>ai(t,le);t.addEventListener("pagehide",f),Q=()=>t.removeEventListener("pagehide",f)}return y.initialized||Ue("POP",y.location,{initialHydration:!0}),D}function Bt(){m&&m(),Q&&Q(),g.clear(),K&&K.abort(),y.fetchers.forEach((f,v)=>Yt(v)),y.blockers.forEach((f,v)=>Hr(v))}function Pa(f){return g.add(f),()=>g.delete(f)}function pe(f,v={}){f.matches&&(f.matches=f.matches.map(T=>{let N=i[T.route.id],H=T.route;return H.element!==N.element||H.errorElement!==N.errorElement||H.hydrateFallbackElement!==N.hydrateFallbackElement?{...T,route:N}:T})),y={...y,...f};let w=[],L=[];y.fetchers.forEach((T,N)=>{T.state==="idle"&&(z.has(N)?w.push(N):L.push(N))}),z.forEach(T=>{!y.fetchers.has(T)&&!re.has(T)&&w.push(T)}),[...g].forEach(T=>T(y,{deletedFetchers:w,newErrors:f.errors??null,viewTransitionOpts:v.viewTransitionOpts,flushSync:v.flushSync===!0})),w.forEach(T=>Yt(T)),L.forEach(T=>y.fetchers.delete(T))}function Ke(f,v,{flushSync:w}={}){var Y,$;let L=y.actionData!=null&&y.navigation.formMethod!=null&&ve(y.navigation.formMethod)&&y.navigation.state==="loading"&&((Y=f.state)==null?void 0:Y._isRedirect)!==!0,T;v.actionData?Object.keys(v.actionData).length>0?T=v.actionData:T=null:L?T=y.actionData:T=null;let N=v.loaderData?hn(y.loaderData,v.loaderData,v.matches||[],v.errors):y.loaderData,H=y.blockers;H.size>0&&(H=new Map(H),H.forEach((V,q)=>H.set(q,ot)));let O=ue?!1:Wr(f,v.matches||y.matches),I=J===!0||y.navigation.formMethod!=null&&ve(y.navigation.formMethod)&&(($=f.state)==null?void 0:$._isRedirect)!==!0;s&&(l=s,s=void 0),ue||M==="POP"||(M==="PUSH"?e.history.push(f,f.state):M==="REPLACE"&&e.history.replace(f,f.state));let j;if(M==="POP"){let V=le.get(y.location.pathname);V&&V.has(f.pathname)?j={currentLocation:y.location,nextLocation:f}:le.has(f.pathname)&&(j={currentLocation:f,nextLocation:y.location})}else if(ae){let V=le.get(y.location.pathname);V?V.add(f.pathname):(V=new Set([f.pathname]),le.set(y.location.pathname,V)),j={currentLocation:y.location,nextLocation:f}}pe({...v,actionData:T,loaderData:N,historyAction:M,location:f,initialized:!0,navigation:qt,revalidation:"idle",restoreScrollPosition:O,preventScrollReset:I,blockers:H},{viewTransitionOpts:j,flushSync:w===!0}),M="POP",J=!1,ae=!1,ue=!1,X=!1,F==null||F.resolve(),F=null,de==null||de.resolve(),de=null}async function Ar(f,v){if(F==null||F.resolve(),F=null,typeof f=="number"){F||(F=yn());let q=F.promise;return e.history.go(f),q}let w=ar(y.location,y.matches,u,f,v==null?void 0:v.fromRouteId,v==null?void 0:v.relative),{path:L,submission:T,error:N}=nn(!1,w,v),H=y.location,O=dt(y.location,L,v&&v.state);O={...O,...e.history.encodeLocation(O)};let I=v&&v.replace!=null?v.replace:void 0,j="PUSH";I===!0?j="REPLACE":I===!1||T!=null&&ve(T.formMethod)&&T.formAction===y.location.pathname+y.location.search&&(j="REPLACE");let Y=v&&"preventScrollReset"in v?v.preventScrollReset===!0:void 0,$=(v&&v.flushSync)===!0,V=zr({currentLocation:H,nextLocation:O,historyAction:j});if(V){gt(V,{state:"blocked",location:O,proceed(){gt(V,{state:"proceeding",proceed:void 0,reset:void 0,location:O}),Ar(f,v)},reset(){let q=new Map(y.blockers);q.set(V,ot),pe({blockers:q})}});return}await Ue(j,O,{submission:T,pendingError:N,preventScrollReset:Y,replace:v&&v.replace,enableViewTransition:v&&v.viewTransition,flushSync:$,callSiteDefaultShouldRevalidate:v&&v.unstable_defaultShouldRevalidate})}function Ta(){de||(de=yn()),Wt(),pe({revalidation:"loading"});let f=de.promise;return y.navigation.state==="submitting"?f:y.navigation.state==="idle"?(Ue(y.historyAction,y.location,{startUninterruptedRevalidation:!0}),f):(Ue(M||y.historyAction,y.navigation.location,{overrideNavigation:y.navigation,enableViewTransition:ae===!0}),f)}async function Ue(f,v,w){K&&K.abort(),K=null,M=f,ue=(w&&w.startUninterruptedRevalidation)===!0,ja(y.location,y.matches),J=(w&&w.preventScrollReset)===!0,ae=(w&&w.enableViewTransition)===!0;let L=s||l,T=w&&w.overrideNavigation,N=w!=null&&w.initialHydration&&y.matches&&y.matches.length>0&&!_?y.matches:Ae(L,v,u),H=(w&&w.flushSync)===!0;if(N&&y.initialized&&!X&&Jo(y.location,v)&&!(w&&w.submission&&ve(w.submission.formMethod))){Ke(v,{matches:N},{flushSync:H});return}let O=wt(N,L,v.pathname);if(O.active&&O.matches&&(N=O.matches),!N){let{error:fe,notFoundMatches:ge,route:ne}=Vt(v.pathname);Ke(v,{matches:ge,loaderData:{},errors:{[ne.id]:fe}},{flushSync:H});return}K=new AbortController;let I=qe(e.history,v,K.signal,w&&w.submission),j=e.getContext?await e.getContext():new qr,Y;if(w&&w.pendingError)Y=[Ne(N).route.id,{type:"error",error:w.pendingError}];else if(w&&w.submission&&ve(w.submission.formMethod)){let fe=await Ma(I,v,w.submission,N,j,O.active,w&&w.initialHydration===!0,{replace:w.replace,flushSync:H});if(fe.shortCircuited)return;if(fe.pendingActionResult){let[ge,ne]=fe.pendingActionResult;if(Re(ne)&&Ve(ne.error)&&ne.error.status===404){K=null,Ke(v,{matches:fe.matches,loaderData:{},errors:{[ge]:ne.error}});return}}N=fe.matches||N,Y=fe.pendingActionResult,T=Qt(v,w.submission),H=!1,O.active=!1,I=qe(e.history,I.url,I.signal)}let{shortCircuited:$,matches:V,loaderData:q,errors:he}=await Da(I,v,N,j,O.active,T,w&&w.submission,w&&w.fetcherSubmission,w&&w.replace,w&&w.initialHydration===!0,H,Y,w&&w.callSiteDefaultShouldRevalidate);$||(K=null,Ke(v,{matches:V||N,...mn(Y),loaderData:q,errors:he}))}async function Ma(f,v,w,L,T,N,H,O={}){Wt();let I=ti(v,w);if(pe({navigation:I},{flushSync:O.flushSync===!0}),N){let $=await Et(L,v.pathname,f.signal);if($.type==="aborted")return{shortCircuited:!0};if($.type==="error"){if($.partialMatches.length===0){let{matches:q,route:he}=Ct(l);return{matches:q,pendingActionResult:[he.id,{type:"error",error:$.error}]}}let V=Ne($.partialMatches).route.id;return{matches:$.partialMatches,pendingActionResult:[V,{type:"error",error:$.error}]}}else if($.matches)L=$.matches;else{let{notFoundMatches:V,error:q,route:he}=Vt(v.pathname);return{matches:V,pendingActionResult:[he.id,{type:"error",error:q}]}}}let j,Y=Dt(L,v);if(!Y.route.action&&!Y.route.lazy)j={type:"error",error:Ce(405,{method:f.method,pathname:v.pathname,routeId:Y.route.id})};else{let $=Ze(o,i,f,L,Y,H?[]:n,T),V=await rt(f,$,T,null);if(j=V[Y.route.id],!j){for(let q of L)if(V[q.route.id]){j=V[q.route.id];break}}if(f.signal.aborted)return{shortCircuited:!0}}if(Ye(j)){let $;return O&&O.replace!=null?$=O.replace:$=cn(j.response.headers.get("Location"),new URL(f.url),u,e.history)===y.location.pathname+y.location.search,await He(f,j,!0,{submission:w,replace:$}),{shortCircuited:!0}}if(Re(j)){let $=Ne(L,Y.route.id);return(O&&O.replace)!==!0&&(M="PUSH"),{matches:L,pendingActionResult:[$.route.id,j,Y.route.id]}}return{matches:L,pendingActionResult:[Y.route.id,j]}}async function Da(f,v,w,L,T,N,H,O,I,j,Y,$,V){let q=N||Qt(v,H),he=H||O||pn(q),fe=!ue&&!j;if(T){if(fe){let ye=Fr($);pe({navigation:q,...ye!==void 0?{actionData:ye}:{}},{flushSync:Y})}let Z=await Et(w,v.pathname,f.signal);if(Z.type==="aborted")return{shortCircuited:!0};if(Z.type==="error"){if(Z.partialMatches.length===0){let{matches:Xe,route:We}=Ct(l);return{matches:Xe,loaderData:{},errors:{[We.id]:Z.error}}}let ye=Ne(Z.partialMatches).route.id;return{matches:Z.partialMatches,loaderData:{},errors:{[ye]:Z.error}}}else if(Z.matches)w=Z.matches;else{let{error:ye,notFoundMatches:Xe,route:We}=Vt(v.pathname);return{matches:Xe,loaderData:{},errors:{[We.id]:ye}}}}let ge=s||l,{dsMatches:ne,revalidatingFetchers:Se}=an(f,L,o,i,e.history,y,w,he,v,j?[]:n,j===!0,X,ee,z,U,C,ge,u,e.patchRoutesOnNavigation!=null,$,V);if(se=++ce,!e.dataStrategy&&!ne.some(Z=>Z.shouldLoad)&&!ne.some(Z=>Z.route.middleware&&Z.route.middleware.length>0)&&Se.length===0){let Z=jr();return Ke(v,{matches:w,loaderData:{},errors:$&&Re($[1])?{[$[0]]:$[1].error}:null,...mn($),...Z?{fetchers:new Map(y.fetchers)}:{}},{flushSync:Y}),{shortCircuited:!0}}if(fe){let Z={};if(!T){Z.navigation=q;let ye=Fr($);ye!==void 0&&(Z.actionData=ye)}Se.length>0&&(Z.fetchers=_a(Se)),pe(Z,{flushSync:Y})}Se.forEach(Z=>{Oe(Z.key),Z.controller&&re.set(Z.key,Z.controller)});let ze=()=>Se.forEach(Z=>Oe(Z.key));K&&K.signal.addEventListener("abort",ze);let{loaderResults:nt,fetcherResults:Fe}=await Nr(ne,Se,f,L);if(f.signal.aborted)return{shortCircuited:!0};K&&K.signal.removeEventListener("abort",ze),Se.forEach(Z=>re.delete(Z.key));let Pe=Lt(nt);if(Pe)return await He(f,Pe.result,!0,{replace:I}),{shortCircuited:!0};if(Pe=Lt(Fe),Pe)return C.add(Pe.key),await He(f,Pe.result,!0,{replace:I}),{shortCircuited:!0};let{loaderData:Jt,errors:at}=fn(y,w,nt,$,Se,Fe);j&&y.errors&&(at={...y.errors,...at});let Be=jr(),Rt=Ur(se),bt=Be||Rt||Se.length>0;return{matches:w,loaderData:Jt,errors:at,...bt?{fetchers:new Map(y.fetchers)}:{}}}function Fr(f){if(f&&!Re(f[1]))return{[f[0]]:f[1].data};if(y.actionData)return Object.keys(y.actionData).length===0?null:y.actionData}function _a(f){return f.forEach(v=>{let w=y.fetchers.get(v.key),L=it(void 0,w?w.data:void 0);y.fetchers.set(v.key,L)}),new Map(y.fetchers)}async function Oa(f,v,w,L){Oe(f);let T=(L&&L.flushSync)===!0,N=s||l,H=ar(y.location,y.matches,u,w,v,L==null?void 0:L.relative),O=Ae(N,H,u),I=wt(O,N,H);if(I.active&&I.matches&&(O=I.matches),!O){_e(f,v,Ce(404,{pathname:H}),{flushSync:T});return}let{path:j,submission:Y,error:$}=nn(!0,H,L);if($){_e(f,v,$,{flushSync:T});return}let V=e.getContext?await e.getContext():new qr,q=(L&&L.preventScrollReset)===!0;if(Y&&ve(Y.formMethod)){await Ia(f,v,j,O,V,I.active,T,q,Y,L&&L.unstable_defaultShouldRevalidate);return}U.set(f,{routeId:v,path:j}),await Aa(f,v,j,O,V,I.active,T,q,Y)}async function Ia(f,v,w,L,T,N,H,O,I,j){Wt(),U.delete(f);let Y=y.fetchers.get(f);De(f,ri(I,Y),{flushSync:H});let $=new AbortController,V=qe(e.history,w,$.signal,I);if(N){let ie=await Et(L,new URL(V.url).pathname,V.signal,f);if(ie.type==="aborted")return;if(ie.type==="error"){_e(f,v,ie.error,{flushSync:H});return}else if(ie.matches)L=ie.matches;else{_e(f,v,Ce(404,{pathname:w}),{flushSync:H});return}}let q=Dt(L,w);if(!q.route.action&&!q.route.lazy){let ie=Ce(405,{method:I.formMethod,pathname:w,routeId:v});_e(f,v,ie,{flushSync:H});return}re.set(f,$);let he=ce,fe=Ze(o,i,V,L,q,n,T),ge=await rt(V,fe,T,f),ne=ge[q.route.id];if(!ne){for(let ie of fe)if(ge[ie.route.id]){ne=ge[ie.route.id];break}}if(V.signal.aborted){re.get(f)===$&&re.delete(f);return}if(z.has(f)){if(Ye(ne)||Re(ne)){De(f,Ie(void 0));return}}else{if(Ye(ne))if(re.delete(f),se>he){De(f,Ie(void 0));return}else return C.add(f),De(f,it(I)),He(V,ne,!1,{fetcherSubmission:I,preventScrollReset:O});if(Re(ne)){_e(f,v,ne.error);return}}let Se=y.navigation.location||y.location,ze=qe(e.history,Se,$.signal),nt=s||l,Fe=y.navigation.state!=="idle"?Ae(nt,y.navigation.location,u):y.matches;W(Fe,"Didn't find any matches after fetcher action");let Pe=++ce;p.set(f,Pe);let Jt=it(I,ne.data);y.fetchers.set(f,Jt);let{dsMatches:at,revalidatingFetchers:Be}=an(ze,T,o,i,e.history,y,Fe,I,Se,n,!1,X,ee,z,U,C,nt,u,e.patchRoutesOnNavigation!=null,[q.route.id,ne],j);Be.filter(ie=>ie.key!==f).forEach(ie=>{let St=ie.key,Vr=y.fetchers.get(St),za=it(void 0,Vr?Vr.data:void 0);y.fetchers.set(St,za),Oe(St),ie.controller&&re.set(St,ie.controller)}),pe({fetchers:new Map(y.fetchers)});let Rt=()=>Be.forEach(ie=>Oe(ie.key));$.signal.addEventListener("abort",Rt);let{loaderResults:bt,fetcherResults:Z}=await Nr(at,Be,ze,T);if($.signal.aborted)return;if($.signal.removeEventListener("abort",Rt),p.delete(f),re.delete(f),Be.forEach(ie=>re.delete(ie.key)),y.fetchers.has(f)){let ie=Ie(ne.data);y.fetchers.set(f,ie)}let ye=Lt(bt);if(ye)return He(ze,ye.result,!1,{preventScrollReset:O});if(ye=Lt(Z),ye)return C.add(ye.key),He(ze,ye.result,!1,{preventScrollReset:O});let{loaderData:Xe,errors:We}=fn(y,Fe,bt,void 0,Be,Z);Ur(Pe),y.navigation.state==="loading"&&Pe>se?(W(M,"Expected pending action"),K&&K.abort(),Ke(y.navigation.location,{matches:Fe,loaderData:Xe,errors:We,fetchers:new Map(y.fetchers)})):(pe({errors:We,loaderData:hn(y.loaderData,Xe,Fe,We),fetchers:new Map(y.fetchers)}),X=!1)}async function Aa(f,v,w,L,T,N,H,O,I){let j=y.fetchers.get(f);De(f,it(I,j?j.data:void 0),{flushSync:H});let Y=new AbortController,$=qe(e.history,w,Y.signal);if(N){let ne=await Et(L,new URL($.url).pathname,$.signal,f);if(ne.type==="aborted")return;if(ne.type==="error"){_e(f,v,ne.error,{flushSync:H});return}else if(ne.matches)L=ne.matches;else{_e(f,v,Ce(404,{pathname:w}),{flushSync:H});return}}let V=Dt(L,w);re.set(f,Y);let q=ce,he=Ze(o,i,$,L,V,n,T),ge=(await rt($,he,T,f))[V.route.id];if(re.get(f)===Y&&re.delete(f),!$.signal.aborted){if(z.has(f)){De(f,Ie(void 0));return}if(Ye(ge))if(se>q){De(f,Ie(void 0));return}else{C.add(f),await He($,ge,!1,{preventScrollReset:O});return}if(Re(ge)){_e(f,v,ge.error);return}De(f,Ie(ge.data))}}async function He(f,v,w,{submission:L,fetcherSubmission:T,preventScrollReset:N,replace:H}={}){w||(F==null||F.resolve(),F=null),v.response.headers.has("X-Remix-Revalidate")&&(X=!0);let O=v.response.headers.get("Location");W(O,"Expected a Location header on the redirect Response"),O=cn(O,new URL(f.url),u,e.history);let I=dt(y.location,O,{_isRedirect:!0});if(r){let he=!1;if(v.response.headers.has("X-Remix-Reload-Document"))he=!0;else if(vr(O)){const fe=Pn(O,!0);he=fe.origin!==t.location.origin||be(fe.pathname,u)==null}if(he){H?t.location.replace(O):t.location.assign(O);return}}K=null;let j=H===!0||v.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Y,formAction:$,formEncType:V}=y.navigation;!L&&!T&&Y&&$&&V&&(L=pn(y.navigation));let q=L||T;if(Io.has(v.response.status)&&q&&ve(q.formMethod))await Ue(j,I,{submission:{...q,formAction:O},preventScrollReset:N||J,enableViewTransition:w?ae:void 0});else{let he=Qt(I,L);await Ue(j,I,{overrideNavigation:he,fetcherSubmission:T,preventScrollReset:N||J,enableViewTransition:w?ae:void 0})}}async function rt(f,v,w,L){var H;let T,N={};try{T=await Ho(h,f,v,L,w,!1)}catch(O){return v.filter(I=>I.shouldLoad).forEach(I=>{N[I.route.id]={type:"error",error:O}}),N}if(f.signal.aborted)return N;if(!ve(f.method))for(let O of v){if(((H=T[O.route.id])==null?void 0:H.type)==="error")break;!T.hasOwnProperty(O.route.id)&&!y.loaderData.hasOwnProperty(O.route.id)&&(!y.errors||!y.errors.hasOwnProperty(O.route.id))&&O.shouldCallHandler()&&(T[O.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${O.route.id}`)})}for(let[O,I]of Object.entries(T))if(qo(I)){let j=I.result;N[O]={type:"redirect",response:Yo(j,f,O,v,u)}}else N[O]=await Wo(I);return N}async function Nr(f,v,w,L){let T=rt(w,f,L,null),N=Promise.all(v.map(async I=>{if(I.matches&&I.match&&I.request&&I.controller){let Y=(await rt(I.request,I.matches,L,I.key))[I.match.route.id];return{[I.key]:Y}}else return Promise.resolve({[I.key]:{type:"error",error:Ce(404,{pathname:I.path})}})})),H=await T,O=(await N).reduce((I,j)=>Object.assign(I,j),{});return{loaderResults:H,fetcherResults:O}}function Wt(){X=!0,U.forEach((f,v)=>{re.has(v)&&ee.add(v),Oe(v)})}function De(f,v,w={}){y.fetchers.set(f,v),pe({fetchers:new Map(y.fetchers)},{flushSync:(w&&w.flushSync)===!0})}function _e(f,v,w,L={}){let T=Ne(y.matches,v);Yt(f),pe({errors:{[T.route.id]:w},fetchers:new Map(y.fetchers)},{flushSync:(L&&L.flushSync)===!0})}function $r(f){return k.set(f,(k.get(f)||0)+1),z.has(f)&&z.delete(f),y.fetchers.get(f)||jn}function Fa(f,v){Oe(f,v==null?void 0:v.reason),De(f,Ie(null))}function Yt(f){let v=y.fetchers.get(f);re.has(f)&&!(v&&v.state==="loading"&&p.has(f))&&Oe(f),U.delete(f),p.delete(f),C.delete(f),z.delete(f),ee.delete(f),y.fetchers.delete(f)}function Na(f){let v=(k.get(f)||0)-1;v<=0?(k.delete(f),z.add(f)):k.set(f,v),pe({fetchers:new Map(y.fetchers)})}function Oe(f,v){let w=re.get(f);w&&(w.abort(v),re.delete(f))}function kr(f){for(let v of f){let w=$r(v),L=Ie(w.data);y.fetchers.set(v,L)}}function jr(){let f=[],v=!1;for(let w of C){let L=y.fetchers.get(w);W(L,`Expected fetcher: ${w}`),L.state==="loading"&&(C.delete(w),f.push(w),v=!0)}return kr(f),v}function Ur(f){let v=[];for(let[w,L]of p)if(L<f){let T=y.fetchers.get(w);W(T,`Expected fetcher: ${w}`),T.state==="loading"&&(Oe(w),p.delete(w),v.push(w))}return kr(v),v.length>0}function $a(f,v){let w=y.blockers.get(f)||ot;return G.get(f)!==v&&G.set(f,v),w}function Hr(f){y.blockers.delete(f),G.delete(f)}function gt(f,v){let w=y.blockers.get(f)||ot;W(w.state==="unblocked"&&v.state==="blocked"||w.state==="blocked"&&v.state==="blocked"||w.state==="blocked"&&v.state==="proceeding"||w.state==="blocked"&&v.state==="unblocked"||w.state==="proceeding"&&v.state==="unblocked",`Invalid blocker state transition: ${w.state} -> ${v.state}`);let L=new Map(y.blockers);L.set(f,v),pe({blockers:L})}function zr({currentLocation:f,nextLocation:v,historyAction:w}){if(G.size===0)return;G.size>1&&oe(!1,"A router only supports one blocker at a time");let L=Array.from(G.entries()),[T,N]=L[L.length-1],H=y.blockers.get(T);if(!(H&&H.state==="proceeding")&&N({currentLocation:f,nextLocation:v,historyAction:w}))return T}function Vt(f){let v=Ce(404,{pathname:f}),w=s||l,{matches:L,route:T}=Ct(w);return{notFoundMatches:L,route:T,error:v}}function ka(f,v,w){if(R=f,E=v,b=w||null,!x&&y.navigation===qt){x=!0;let L=Wr(y.location,y.matches);L!=null&&pe({restoreScrollPosition:L})}return()=>{R=null,E=null,b=null}}function Br(f,v){return b&&b(f,v.map(L=>Tn(L,y.loaderData)))||f.key}function ja(f,v){if(R&&E){let w=Br(f,v);R[w]=E()}}function Wr(f,v){if(R){let w=Br(f,v),L=R[w];if(typeof L=="number")return L}return null}function wt(f,v,w){if(e.patchRoutesOnNavigation)if(f){if(Object.keys(f[0].params).length>0)return{active:!0,matches:ut(v,w,u,!0)}}else return{active:!0,matches:ut(v,w,u,!0)||[]};return{active:!1,matches:null}}async function Et(f,v,w,L){if(!e.patchRoutesOnNavigation)return{type:"success",matches:f};let T=f;for(;;){let N=s==null,H=s||l,O=i;try{await e.patchRoutesOnNavigation({signal:w,path:v,matches:T,fetcherKey:L,patch:(Y,$)=>{w.aborted||on(Y,$,H,O,o,!1)}})}catch(Y){return{type:"error",error:Y,partialMatches:T}}finally{N&&!w.aborted&&(l=[...l])}if(w.aborted)return{type:"aborted"};let I=Ae(H,v,u),j=null;if(I){if(Object.keys(I[0].params).length===0)return{type:"success",matches:I};if(j=ut(H,v,u,!0),!(j&&T.length<j.length&&Yr(T,j.slice(0,T.length))))return{type:"success",matches:I}}if(j||(j=ut(H,v,u,!0)),!j||Yr(T,j))return{type:"success",matches:null};T=j}}function Yr(f,v){return f.length===v.length&&f.every((w,L)=>w.route.id===v[L].route.id)}function Ua(f){i={},s=ft(f,o,void 0,i)}function Ha(f,v,w=!1){let L=s==null;on(f,v,s||l,i,o,w),L&&(l=[...l],pe({}))}return D={get basename(){return u},get future(){return c},get state(){return y},get routes(){return l},get window(){return t},initialize:me,subscribe:Pa,enableScrollRestoration:ka,navigate:Ar,fetch:Oa,revalidate:Ta,createHref:f=>e.history.createHref(f),encodeLocation:f=>e.history.encodeLocation(f),getFetcher:$r,resetFetcher:Fa,deleteFetcher:Na,dispose:Bt,getBlocker:$a,deleteBlocker:Hr,patchRoutes:Ha,_internalFetchControllers:re,_internalSetRoutes:Ua,_internalSetStateDoNotUseOrYouWillBreakYourApp(f){pe(f)}},e.unstable_instrumentations&&(D=Lo(D,e.unstable_instrumentations.map(f=>f.router).filter(Boolean))),D}function Fo(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function ar(e,t,r,n,a,o){let i,l;if(a){i=[];for(let u of t)if(i.push(u),u.route.id===a){l=u;break}}else i=t,l=t[t.length-1];let s=wr(n||".",gr(i),be(e.pathname,r)||e.pathname,o==="path");if(n==null&&(s.search=e.search,s.hash=e.hash),(n==null||n===""||n===".")&&l){let u=Rr(s.search);if(l.route.index&&!u)s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&u){let h=new URLSearchParams(s.search),c=h.getAll("index");h.delete("index"),c.filter(g=>g).forEach(g=>h.append("index",g));let m=h.toString();s.search=m?`?${m}`:""}}return r!=="/"&&(s.pathname=yo({basename:r,pathname:s.pathname})),Me(s)}function nn(e,t,r){if(!r||!Fo(r))return{path:t};if(r.formMethod&&!ei(r.formMethod))return{path:t,error:Ce(405,{method:r.formMethod})};let n=()=>({path:t,error:Ce(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),i=Jn(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ve(o))return n();let c=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,[g,R])=>`${m}${g}=${R}
|
|
19
|
+
`,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:i,formEncType:r.formEncType,formData:void 0,json:void 0,text:c}}}else if(r.formEncType==="application/json"){if(!ve(o))return n();try{let c=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:o,formAction:i,formEncType:r.formEncType,formData:void 0,json:c,text:void 0}}}catch{return n()}}}W(typeof FormData=="function","FormData is not available in this environment");let l,s;if(r.formData)l=lr(r.formData),s=r.formData;else if(r.body instanceof FormData)l=lr(r.body),s=r.body;else if(r.body instanceof URLSearchParams)l=r.body,s=dn(l);else if(r.body==null)l=new URLSearchParams,s=new FormData;else try{l=new URLSearchParams(r.body),s=dn(l)}catch{return n()}let u={formMethod:o,formAction:i,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:s,json:void 0,text:void 0};if(ve(u.formMethod))return{path:t,submission:u};let h=ke(t);return e&&h.search&&Rr(h.search)&&l.append("index",""),h.search=`?${l}`,{path:Me(h),submission:u}}function an(e,t,r,n,a,o,i,l,s,u,h,c,m,g,R,b,E,x,S,_,A){var ue;let P=_?Re(_[1])?_[1].error:_[1].data:void 0,D=a.createURL(o.location),y=a.createURL(s),M;if(h&&o.errors){let X=Object.keys(o.errors)[0];M=i.findIndex(ee=>ee.route.id===X)}else if(_&&Re(_[1])){let X=_[0];M=i.findIndex(ee=>ee.route.id===X)-1}let F=_?_[1].statusCode:void 0,J=F&&F>=400,K={currentUrl:D,currentParams:((ue=o.matches[0])==null?void 0:ue.params)||{},nextUrl:y,nextParams:i[0].params,...l,actionResult:P,actionStatus:F},ae=mt(i),le=i.map((X,ee)=>{let{route:re}=X,ce=null;if(M!=null&&ee>M?ce=!1:re.lazy?ce=!0:Er(re)?h?ce=or(re,o.loaderData,o.errors):No(o.loaderData,o.matches[ee],X)&&(ce=!0):ce=!1,ce!==null)return ir(r,n,e,ae,X,u,t,ce);let se=!1;typeof A=="boolean"?se=A:J?se=!1:(c||D.pathname+D.search===y.pathname+y.search||D.search!==y.search||$o(o.matches[ee],X))&&(se=!0);let p={...K,defaultShouldRevalidate:se},C=ct(X,p);return ir(r,n,e,ae,X,u,t,C,p,A)}),Q=[];return R.forEach((X,ee)=>{if(h||!i.some(z=>z.route.id===X.routeId)||g.has(ee))return;let re=o.fetchers.get(ee),ce=re&&re.state!=="idle"&&re.data===void 0,se=Ae(E,X.path,x);if(!se){if(S&&ce)return;Q.push({key:ee,routeId:X.routeId,path:X.path,matches:null,match:null,request:null,controller:null});return}if(b.has(ee))return;let p=Dt(se,X.path),C=new AbortController,U=qe(a,X.path,C.signal),k=null;if(m.has(ee))m.delete(ee),k=Ze(r,n,U,se,p,u,t);else if(ce)c&&(k=Ze(r,n,U,se,p,u,t));else{let z;typeof A=="boolean"?z=A:J?z=!1:z=c;let G={...K,defaultShouldRevalidate:z};ct(p,G)&&(k=Ze(r,n,U,se,p,u,t,G))}k&&Q.push({key:ee,routeId:X.routeId,path:X.path,matches:k,match:p,request:U,controller:C})}),{dsMatches:le,revalidatingFetchers:Q}}function Er(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function or(e,t,r){if(e.lazy)return!0;if(!Er(e))return!1;let n=t!=null&&e.id in t,a=r!=null&&r[e.id]!==void 0;return!n&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!n&&!a}function No(e,t,r){let n=!t||r.route.id!==t.route.id,a=!e.hasOwnProperty(r.route.id);return n||a}function $o(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function ct(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function on(e,t,r,n,a,o){let i;if(e){let u=n[e];W(u,`No route found to patch children into: routeId = ${e}`),u.children||(u.children=[]),i=u.children}else i=r;let l=[],s=[];if(t.forEach(u=>{let h=i.find(c=>zn(u,c));h?s.push({existingRoute:h,newRoute:u}):l.push(u)}),l.length>0){let u=ft(l,a,[e||"_","patch",String((i==null?void 0:i.length)||"0")],n);i.push(...u)}if(o&&s.length>0)for(let u=0;u<s.length;u++){let{existingRoute:h,newRoute:c}=s[u],m=h,[g]=ft([c],a,[],{},!0);Object.assign(m,{element:g.element?g.element:m.element,errorElement:g.errorElement?g.errorElement:m.errorElement,hydrateFallbackElement:g.hydrateFallbackElement?g.hydrateFallbackElement:m.hydrateFallbackElement})}}function zn(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,n)=>{var a;return(a=t.children)==null?void 0:a.some(o=>zn(r,o))}):!1}var ln=new WeakMap,Bn=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let a=r[t.id];if(W(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let o=a.lazy[e];if(!o)return;let i=ln.get(a);i||(i={},ln.set(a,i));let l=i[e];if(l)return l;let s=(async()=>{let u=eo(e),c=a[e]!==void 0&&e!=="hasErrorBoundary";if(u)oe(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(c)oe(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let m=await o();m!=null&&(Object.assign(a,{[e]:m}),Object.assign(a,n(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(m=>m===void 0)&&(a.lazy=void 0))})();return i[e]=s,s},sn=new WeakMap;function ko(e,t,r,n,a){let o=r[e.id];if(W(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let h=sn.get(o);if(h)return{lazyRoutePromise:h,lazyHandlerPromise:h};let c=(async()=>{W(typeof e.lazy=="function","No lazy route function found");let m=await e.lazy(),g={};for(let R in m){let b=m[R];if(b===void 0)continue;let E=ro(R),S=o[R]!==void 0&&R!=="hasErrorBoundary";E?oe(!E,"Route property "+R+" is not a supported property to be returned from a lazy route function. This property will be ignored."):S?oe(!S,`Route "${o.id}" has a static property "${R}" defined but its lazy function is also returning a value for this property. The lazy route property "${R}" will be ignored.`):g[R]=b}Object.assign(o,g),Object.assign(o,{...n(o),lazy:void 0})})();return sn.set(o,c),c.catch(()=>{}),{lazyRoutePromise:c,lazyHandlerPromise:c}}let i=Object.keys(e.lazy),l=[],s;for(let h of i){if(a&&a.includes(h))continue;let c=Bn({key:h,route:e,manifest:r,mapRouteProperties:n});c&&(l.push(c),h===t&&(s=c))}let u=l.length>0?Promise.all(l).then(()=>{}):void 0;return u==null||u.catch(()=>{}),s==null||s.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:s}}async function un(e){let t=e.matches.filter(a=>a.shouldLoad),r={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,o)=>{r[t[o].route.id]=a}),r}async function jo(e){return e.matches.some(t=>t.route.middleware)?Wn(e,()=>un(e)):un(e)}function Wn(e,t){return Uo(e,t,n=>{if(Zo(n))throw n;return n},Ko,r);function r(n,a,o){if(o)return Promise.resolve(Object.assign(o.value,{[a]:{type:"error",result:n}}));{let{matches:i}=e,l=Math.min(Math.max(i.findIndex(u=>u.route.id===a),0),Math.max(i.findIndex(u=>u.shouldCallHandler()),0)),s=Ne(i,i[l].route.id).route.id;return Promise.resolve({[s]:{type:"error",result:n}})}}}async function Uo(e,t,r,n,a){let{matches:o,request:i,params:l,context:s,unstable_pattern:u}=e,h=o.flatMap(m=>m.route.middleware?m.route.middleware.map(g=>[m.route.id,g]):[]);return await Yn({request:i,params:l,context:s,unstable_pattern:u},h,t,r,n,a)}async function Yn(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,h]=s,c,m=async()=>{if(c)throw new Error("You may only call `next()` once per middleware");try{return c={value:await Yn(e,t,r,n,a,o,i+1)},c.value}catch(g){return c={value:await o(g,u,c)},c.value}};try{let g=await h(e,m),R=g!=null?n(g):void 0;return a(R)?R:c?R??c.value:(c={value:await m()},c.value)}catch(g){return await o(g,u,c)}}function Vn(e,t,r,n,a){let o=Bn({key:"middleware",route:n.route,manifest:t,mapRouteProperties:e}),i=ko(n.route,ve(r.method)?"action":"loader",t,e,a);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function ir(e,t,r,n,a,o,i,l,s=null,u){let h=!1,c=Vn(e,t,r,a,o);return{...a,_lazyPromises:c,shouldLoad:l,shouldRevalidateArgs:s,shouldCallHandler(m){return h=!0,s?typeof u=="boolean"?ct(a,{...s,defaultShouldRevalidate:u}):typeof m=="boolean"?ct(a,{...s,defaultShouldRevalidate:m}):ct(a,s):l},resolve(m){let{lazy:g,loader:R,middleware:b}=a.route,E=h||l||m&&!ve(r.method)&&(g||R),x=b&&b.length>0&&!R&&!g;return E&&(ve(r.method)||!x)?zo({request:r,unstable_pattern:n,match:a,lazyHandlerPromise:c==null?void 0:c.handler,lazyRoutePromise:c==null?void 0:c.route,handlerOverride:m,scopedContext:i}):Promise.resolve({type:"data",result:void 0})}}}function Ze(e,t,r,n,a,o,i,l=null){return n.map(s=>s.route.id!==a.route.id?{...s,shouldLoad:!1,shouldRevalidateArgs:l,shouldCallHandler:()=>!1,_lazyPromises:Vn(e,t,r,s,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:ir(e,t,r,mt(n),s,o,i,!0,l))}async function Ho(e,t,r,n,a,o){r.some(u=>{var h;return(h=u._lazyPromises)==null?void 0:h.middleware})&&await Promise.all(r.map(u=>{var h;return(h=u._lazyPromises)==null?void 0:h.middleware}));let i={request:t,unstable_pattern:mt(r),params:r[0].params,context:a,matches:r},s=await e({...i,fetcherKey:n,runClientMiddleware:u=>{let h=i;return Wn(h,()=>u({...h,fetcherKey:n,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(u=>{var h,c;return[(h=u._lazyPromises)==null?void 0:h.handler,(c=u._lazyPromises)==null?void 0:c.route]}))}catch{}return s}async function zo({request:e,unstable_pattern:t,match:r,lazyHandlerPromise:n,lazyRoutePromise:a,handlerOverride:o,scopedContext:i}){let l,s,u=ve(e.method),h=u?"action":"loader",c=m=>{let g,R=new Promise((x,S)=>g=S);s=()=>g(),e.signal.addEventListener("abort",s);let b=x=>typeof m!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${h}" [routeId: ${r.route.id}]`)):m({request:e,unstable_pattern:t,params:r.params,context:i},...x!==void 0?[x]:[]),E=(async()=>{try{return{type:"data",result:await(o?o(S=>b(S)):b())}}catch(x){return{type:"error",result:x}}})();return Promise.race([E,R])};try{let m=u?r.route.action:r.route.loader;if(n||a)if(m){let g,[R]=await Promise.all([c(m).catch(b=>{g=b}),n,a]);if(g!==void 0)throw g;l=R}else{await n;let g=u?r.route.action:r.route.loader;if(g)[l]=await Promise.all([c(g),a]);else if(h==="action"){let R=new URL(e.url),b=R.pathname+R.search;throw Ce(405,{method:e.method,pathname:b,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(m)l=await c(m);else{let g=new URL(e.url),R=g.pathname+g.search;throw Ce(404,{pathname:R})}}catch(m){return{type:"error",result:m}}finally{s&&e.signal.removeEventListener("abort",s)}return l}async function Bo(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Wo(e){var n,a,o,i,l;let{result:t,type:r}=e;if($t(t)){let s;try{s=await Bo(t)}catch(u){return{type:"error",error:u}}return r==="error"?{type:"error",error:new je(t.status,t.statusText,s),statusCode:t.status,headers:t.headers}:{type:"data",data:s,statusCode:t.status,headers:t.headers}}return r==="error"?sr(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(n=t.init)==null?void 0:n.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:Go(t),statusCode:Ve(t)?t.status:void 0,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Ve(t)?t.status:void 0}:sr(t)?{type:"data",data:t.data,statusCode:(i=t.init)==null?void 0:i.status,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function Yo(e,t,r,n,a){let o=e.headers.get("Location");if(W(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!vr(o)){let i=n.slice(0,n.findIndex(l=>l.route.id===r)+1);o=ar(new URL(t.url),i,a,o),e.headers.set("Location",o)}return e}function cn(e,t,r,n){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(vr(e)){let o=e,i=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(a.includes(i.protocol))throw new Error("Invalid redirect location");let l=be(i.pathname,r)!=null;if(i.origin===t.origin&&l)return i.pathname+i.search+i.hash}try{let o=n.createURL(e);if(a.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function qe(e,t,r,n){let a=e.createURL(Jn(t)).toString(),o={signal:r};if(n&&ve(n.formMethod)){let{formMethod:i,formEncType:l}=n;o.method=i.toUpperCase(),l==="application/json"?(o.headers=new Headers({"Content-Type":l}),o.body=JSON.stringify(n.json)):l==="text/plain"?o.body=n.text:l==="application/x-www-form-urlencoded"&&n.formData?o.body=lr(n.formData):o.body=n.formData}return new Request(a,o)}function lr(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function dn(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Vo(e,t,r,n=!1,a=!1){let o={},i=null,l,s=!1,u={},h=r&&Re(r[1])?r[1].error:void 0;return e.forEach(c=>{if(!(c.route.id in t))return;let m=c.route.id,g=t[m];if(W(!Ye(g),"Cannot handle redirect results in processLoaderData"),Re(g)){let R=g.error;if(h!==void 0&&(R=h,h=void 0),i=i||{},a)i[m]=R;else{let b=Ne(e,m);i[b.route.id]==null&&(i[b.route.id]=R)}n||(o[m]=Hn),s||(s=!0,l=Ve(g.error)?g.error.status:500),g.headers&&(u[m]=g.headers)}else o[m]=g.data,g.statusCode&&g.statusCode!==200&&!s&&(l=g.statusCode),g.headers&&(u[m]=g.headers)}),h!==void 0&&r&&(i={[r[0]]:h},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:i,statusCode:l||200,loaderHeaders:u}}function fn(e,t,r,n,a,o){let{loaderData:i,errors:l}=Vo(t,r,n);return a.filter(s=>!s.matches||s.matches.some(u=>u.shouldLoad)).forEach(s=>{let{key:u,match:h,controller:c}=s;if(c&&c.signal.aborted)return;let m=o[u];if(W(m,"Did not find corresponding fetcher result"),Re(m)){let g=Ne(e.matches,h==null?void 0:h.route.id);l&&l[g.route.id]||(l={...l,[g.route.id]:m.error}),e.fetchers.delete(u)}else if(Ye(m))W(!1,"Unhandled fetcher revalidation redirect");else{let g=Ie(m.data);e.fetchers.set(u,g)}}),{loaderData:i,errors:l}}function hn(e,t,r,n){let a=Object.entries(t).filter(([,o])=>o!==Hn).reduce((o,[i,l])=>(o[i]=l,o),{});for(let o of r){let i=o.route.id;if(!t.hasOwnProperty(i)&&e.hasOwnProperty(i)&&o.route.loader&&(a[i]=e[i]),n&&n.hasOwnProperty(i))break}return a}function mn(e){return e?Re(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ne(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function Ct(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Ce(e,{pathname:t,routeId:r,method:n,type:a,message:o}={}){let i="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(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.`:a==="invalid-body"&&(l="Unable to encode submission body")):e===403?(i="Forbidden",l=`Route "${r}" does not match URL "${t}"`):e===404?(i="Not Found",l=`No route matches URL "${t}"`):e===405&&(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 je(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[n,a]=t[r];if(Ye(a))return{key:n,result:a}}}function Jn(e){let t=typeof e=="string"?ke(e):e;return Me({...t,hash:""})}function Jo(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Go(e){var t,r;return new je(((t=e.init)==null?void 0:t.status)??500,((r=e.init)==null?void 0:r.statusText)??"Internal Server Error",e.data)}function Ko(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&Xo(r))}function Xo(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function qo(e){return $t(e.result)&&kn.has(e.result.status)}function Re(e){return e.type==="error"}function Ye(e){return(e&&e.type)==="redirect"}function sr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function $t(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Qo(e){return kn.has(e)}function Zo(e){return $t(e)&&Qo(e.status)&&e.headers.has("Location")}function ei(e){return Oo.has(e.toUpperCase())}function ve(e){return Do.has(e.toUpperCase())}function Rr(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Dt(e,t){let r=typeof t=="string"?ke(t).search:t.search;if(e[e.length-1].route.index&&Rr(r||""))return e[e.length-1];let n=In(e);return n[n.length-1]}function pn(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function Qt(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function ti(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function it(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 ri(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}}function Ie(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function ni(e,t){try{let r=e.sessionStorage.getItem(Un);if(r){let n=JSON.parse(r);for(let[a,o]of Object.entries(n||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function ai(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(Un,JSON.stringify(r))}catch(n){oe(!1,`Failed to save applied view transitions in sessionStorage (${n}).`)}}}function yn(){let e,t,r=new Promise((n,a)=>{e=async o=>{n(o);try{await r}catch{}},t=async o=>{a(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var Je=d.createContext(null);Je.displayName="DataRouter";var et=d.createContext(null);et.displayName="DataRouterState";var Gn=d.createContext(!1);function Kn(){return d.useContext(Gn)}var br=d.createContext({isTransitioning:!1});br.displayName="ViewTransition";var Sr=d.createContext(new Map);Sr.displayName="Fetchers";var oi=d.createContext(null);oi.displayName="Await";var Ee=d.createContext(null);Ee.displayName="Navigation";var kt=d.createContext(null);kt.displayName="Location";var Le=d.createContext({outlet:null,matches:[],isDataRoute:!1});Le.displayName="Route";var Cr=d.createContext(null);Cr.displayName="RouteError";var Xn="REACT_ROUTER_ERROR",ii="REDIRECT",li="ROUTE_ERROR_RESPONSE";function si(e){if(e.startsWith(`${Xn}:${ii}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function ui(e){if(e.startsWith(`${Xn}:${li}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new je(t.status,t.statusText,t.data)}catch{}}function ci(e,{relative:t}={}){W(pt(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=d.useContext(Ee),{hash:a,pathname:o,search:i}=yt(e,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:Te([r,o])),n.createHref({pathname:l,search:i,hash:a})}function pt(){return d.useContext(kt)!=null}function xe(){return W(pt(),"useLocation() may be used only in the context of a <Router> component."),d.useContext(kt).location}var qn="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Qn(e){d.useContext(Ee).static||d.useLayoutEffect(e)}function Zn(){let{isDataRoute:e}=d.useContext(Le);return e?Si():di()}function di(){W(pt(),"useNavigate() may be used only in the context of a <Router> component.");let e=d.useContext(Je),{basename:t,navigator:r}=d.useContext(Ee),{matches:n}=d.useContext(Le),{pathname:a}=xe(),o=JSON.stringify(gr(n)),i=d.useRef(!1);return Qn(()=>{i.current=!0}),d.useCallback((s,u={})=>{if(oe(i.current,qn),!i.current)return;if(typeof s=="number"){r.go(s);return}let h=wr(s,JSON.parse(o),a,u.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Te([t,h.pathname])),(u.replace?r.replace:r.push)(h,u.state,u)},[t,r,o,a,e])}var fi=d.createContext(null);function hi(e){let t=d.useContext(Le).outlet;return d.useMemo(()=>t&&d.createElement(fi.Provider,{value:e},t),[t,e])}function ea(){let{matches:e}=d.useContext(Le),t=e[e.length-1];return t?t.params:{}}function yt(e,{relative:t}={}){let{matches:r}=d.useContext(Le),{pathname:n}=xe(),a=JSON.stringify(gr(r));return d.useMemo(()=>wr(e,JSON.parse(a),n,t==="path"),[e,a,n,t])}function mi(e,t,r,n,a){W(pt(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=d.useContext(Ee),{matches:i}=d.useContext(Le),l=i[i.length-1],s=l?l.params:{},u=l?l.pathname:"/",h=l?l.pathnameBase:"/",c=l&&l.route;{let S=c&&c.path||"";oa(u,!c||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${S}">) 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.
|
|
20
20
|
|
|
21
|
-
Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let m=xe(),g;g=m;let R=g.pathname||"/",b=R;if(h!=="/"){let S=h.replace(/^\//,"").split("/");b="/"+R.replace(/^\//,"").split("/").slice(S.length).join("/")}let E=Ae(e,{pathname:b});return oe(c||E!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),oe(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.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.`),vi(E&&E.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Te([h,o.encodeLocation?o.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?h:Te([h,o.encodeLocation?o.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),i,r,n,a)}function hi(){let e=ta(),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=f.createElement(f.Fragment,null,f.createElement("p",null,"💿 Hey developer 👋"),f.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",f.createElement("code",{style:o},"ErrorBoundary")," or"," ",f.createElement("code",{style:o},"errorElement")," prop on your route.")),f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),r?f.createElement("pre",{style:a},r):null,i)}var mi=f.createElement(hi,null),Zn=class extends f.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||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?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&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=ii(e.digest);r&&(e=r)}let t=e!==void 0?f.createElement(Le.Provider,{value:this.props.routeContext},f.createElement(Cr.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?f.createElement(pi,{error:e},t):t}};Zn.contextType=Jn;var Zt=new WeakMap;function pi({children:e,error:t}){let{basename:r}=f.useContext(Ee);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=oi(t.digest);if(n){let a=Zt.get(t);if(a)throw a;let o=An(n.location,r);if(In&&!Zt.get(t))if(o.isExternal||n.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const i=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:n.replace}));throw Zt.set(t,i),i}return f.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function yi({routeContext:e,match:t,children:r}){let n=f.useContext(Je);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),f.createElement(Le.Provider,{value:e},r)}function vi(e,t=[],r=null,n=null,a=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,i=r==null?void 0:r.errors;if(i!=null){let h=o.findIndex(c=>c.route.id&&(i==null?void 0:i[c.route.id])!==void 0);W(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,h+1))}let l=!1,s=-1;if(r)for(let h=0;h<o.length;h++){let c=o[h];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(s=h),c.route.id){let{loaderData:m,errors:g}=r,R=c.route.loader&&!m.hasOwnProperty(c.route.id)&&(!g||g[c.route.id]===void 0);if(c.route.lazy||R){l=!0,s>=0?o=o.slice(0,s+1):o=[o[0]];break}}}let u=r&&n?(h,c)=>{var m,g;n(h,{location:r.location,params:((g=(m=r.matches)==null?void 0:m[0])==null?void 0:g.params)??{},unstable_pattern:mt(r.matches),errorInfo:c})}:void 0;return o.reduceRight((h,c,m)=>{let g,R=!1,b=null,E=null;r&&(g=i&&c.route.id?i[c.route.id]:void 0,b=c.route.errorElement||mi,l&&(s<0&&m===0?(ra("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),R=!0,E=null):s===m&&(R=!0,E=c.route.hydrateFallbackElement||null)));let x=t.concat(o.slice(0,m+1)),S=()=>{let _;return g?_=b:R?_=E:c.route.Component?_=f.createElement(c.route.Component,null):c.route.element?_=c.route.element:_=h,f.createElement(yi,{match:c,routeContext:{outlet:h,matches:x,isDataRoute:r!=null},children:_})};return r&&(c.route.ErrorBoundary||c.route.errorElement||m===0)?f.createElement(Zn,{location:r.location,revalidation:r.revalidation,component:b,error:g,children:S(),routeContext:{outlet:null,matches:x,isDataRoute:!0},onError:u}):S()},null)}function Lr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ea(e){let t=f.useContext(Je);return W(t,Lr(e)),t}function Ge(e){let t=f.useContext(et);return W(t,Lr(e)),t}function gi(e){let t=f.useContext(Le);return W(t,Lr(e)),t}function vt(e){let t=gi(e),r=t.matches[t.matches.length-1];return W(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function wi(){return vt("useRouteId")}function Ei(){return Ge("useNavigation").navigation}function is(){let e=ea("useRevalidator"),t=Ge("useRevalidator"),r=f.useCallback(async()=>{await e.router.revalidate()},[e.router]);return f.useMemo(()=>({revalidate:r,state:t.revalidation}),[r,t.revalidation])}function xr(){let{matches:e,loaderData:t}=Ge("useMatches");return f.useMemo(()=>e.map(r=>Pn(r,t)),[e,t])}function Ri(){let e=Ge("useLoaderData"),t=vt("useLoaderData");return e.loaderData[t]}function ls(e){return Ge("useRouteLoaderData").loaderData[e]}function bi(){let e=Ge("useActionData"),t=vt("useLoaderData");return e.actionData?e.actionData[t]:void 0}function ta(){var n;let e=f.useContext(Cr),t=Ge("useRouteError"),r=vt("useRouteError");return e!==void 0?e:(n=t.errors)==null?void 0:n[r]}function Si(){let{router:e}=ea("useNavigate"),t=vt("useNavigate"),r=f.useRef(!1);return qn(()=>{r.current=!0}),f.useCallback(async(a,o={})=>{oe(r.current,Xn),r.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var yn={};function ra(e,t,r){!t&&!yn[e]&&(yn[e]=!0,oe(!1,r))}var vn={};function ur(e,t){!e&&!vn[t]&&(vn[t]=!0,console.warn(t))}var Ci="useOptimistic",gn=Ya[Ci],Li=()=>{};function xi(e){return gn?gn(e):[e,Li]}function ss(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&oe(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:f.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&oe(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:f.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&oe(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:f.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var us=["HydrateFallback","hydrateFallbackElement"],Pi=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function cs({router:e,flushSync:t,onError:r,unstable_useTransitions:n}){n=Gn()||n;let[o,i]=f.useState(e.state),[l,s]=xi(o),[u,h]=f.useState(),[c,m]=f.useState({isTransitioning:!1}),[g,R]=f.useState(),[b,E]=f.useState(),[x,S]=f.useState(),_=f.useRef(new Map),A=f.useCallback((M,{deletedFetchers:F,newErrors:J,flushSync:K,viewTransitionOpts:ae})=>{J&&r&&Object.values(J).forEach(Q=>{var ue;return r(Q,{location:M.location,params:((ue=M.matches[0])==null?void 0:ue.params)??{},unstable_pattern:mt(M.matches)})}),M.fetchers.forEach((Q,ue)=>{Q.data!==void 0&&_.current.set(ue,Q.data)}),F.forEach(Q=>_.current.delete(Q)),ur(K===!1||t!=null,'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 le=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(ur(ae==null||le,"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."),!ae||!le){t&&K?t(()=>i(M)):n===!1?i(M):f.startTransition(()=>{n===!0&&s(Q=>wn(Q,M)),i(M)});return}if(t&&K){t(()=>{b&&(g==null||g.resolve(),b.skipTransition()),m({isTransitioning:!0,flushSync:!0,currentLocation:ae.currentLocation,nextLocation:ae.nextLocation})});let Q=e.window.document.startViewTransition(()=>{t(()=>i(M))});Q.finished.finally(()=>{t(()=>{R(void 0),E(void 0),h(void 0),m({isTransitioning:!1})})}),t(()=>E(Q));return}b?(g==null||g.resolve(),b.skipTransition(),S({state:M,currentLocation:ae.currentLocation,nextLocation:ae.nextLocation})):(h(M),m({isTransitioning:!0,flushSync:!1,currentLocation:ae.currentLocation,nextLocation:ae.nextLocation}))},[e.window,t,b,g,n,s,r]);f.useLayoutEffect(()=>e.subscribe(A),[e,A]),f.useEffect(()=>{c.isTransitioning&&!c.flushSync&&R(new Pi)},[c]),f.useEffect(()=>{if(g&&u&&e.window){let M=u,F=g.promise,J=e.window.document.startViewTransition(async()=>{n===!1?i(M):f.startTransition(()=>{n===!0&&s(K=>wn(K,M)),i(M)}),await F});J.finished.finally(()=>{R(void 0),E(void 0),h(void 0),m({isTransitioning:!1})}),E(J)}},[u,g,e.window,n,s]),f.useEffect(()=>{g&&u&&l.location.key===u.location.key&&g.resolve()},[g,b,l.location,u]),f.useEffect(()=>{!c.isTransitioning&&x&&(h(x.state),m({isTransitioning:!0,flushSync:!1,currentLocation:x.currentLocation,nextLocation:x.nextLocation}),S(void 0))},[c.isTransitioning,x]);let P=f.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:M=>e.navigate(M),push:(M,F,J)=>e.navigate(M,{state:F,preventScrollReset:J==null?void 0:J.preventScrollReset}),replace:(M,F,J)=>e.navigate(M,{replace:!0,state:F,preventScrollReset:J==null?void 0:J.preventScrollReset})}),[e]),D=e.basename||"/",y=f.useMemo(()=>({router:e,navigator:P,static:!1,basename:D,onError:r}),[e,P,D,r]);return f.createElement(f.Fragment,null,f.createElement(Je.Provider,{value:y},f.createElement(et.Provider,{value:l},f.createElement(Sr.Provider,{value:_.current},f.createElement(br.Provider,{value:c},f.createElement(Di,{basename:D,location:l.location,navigationType:l.historyAction,navigator:P,unstable_useTransitions:n},f.createElement(Ti,{routes:e.routes,future:e.future,state:l,onError:r})))))),null)}function wn(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var Ti=f.memo(Mi);function Mi({routes:e,future:t,state:r,onError:n}){return fi(e,void 0,r,n,t)}function ds(e){return ci(e.context)}function Di({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:o=!1,unstable_useTransitions:i}){W(!pt(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=f.useMemo(()=>({basename:l,navigator:a,static:o,unstable_useTransitions:i,future:{}}),[l,a,o,i]);typeof r=="string"&&(r=ke(r));let{pathname:u="/",search:h="",hash:c="",state:m=null,key:g="default"}=r,R=f.useMemo(()=>{let b=be(u,l);return b==null?null:{location:{pathname:b,search:h,hash:c,state:m,key:g},navigationType:n}},[l,u,h,c,m,g,n]);return oe(R!=null,`<Router basename="${l}"> is not able to match the URL "${u}${h}${c}" because it does not start with the basename, so the <Router> won't render anything.`),R==null?null:f.createElement(Ee.Provider,{value:s},f.createElement(kt.Provider,{children:t,value:R}))}function _i(){return{params:di(),loaderData:Ri(),actionData:bi(),matches:xr()}}function fs(e){return function(){const r=_i();return f.createElement(e,r)}}var _t="get",Ot="application/x-www-form-urlencoded";function jt(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Oi(e){return jt(e)&&e.tagName.toLowerCase()==="button"}function Ii(e){return jt(e)&&e.tagName.toLowerCase()==="form"}function Ai(e){return jt(e)&&e.tagName.toLowerCase()==="input"}function Fi(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ni(e,t){return e.button===0&&(!t||t==="_self")&&!Fi(e)}function cr(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function $i(e,t){let r=cr(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(o=>{r.append(a,o)})}),r}var xt=null;function ki(){if(xt===null)try{new FormData(document.createElement("form"),0),xt=!1}catch{xt=!0}return xt}var ji=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function er(e){return e!=null&&!ji.has(e)?(oe(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ot}"`),null):e}function Ui(e,t){let r,n,a,o,i;if(Ii(e)){let l=e.getAttribute("action");n=l?be(l,t):null,r=e.getAttribute("method")||_t,a=er(e.getAttribute("enctype"))||Ot,o=new FormData(e)}else if(Oi(e)||Ai(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||l.getAttribute("action");if(n=s?be(s,t):null,r=e.getAttribute("formmethod")||l.getAttribute("method")||_t,a=er(e.getAttribute("formenctype"))||er(l.getAttribute("enctype"))||Ot,o=new FormData(l,e),!ki()){let{name:u,type:h,value:c}=e;if(h==="image"){let m=u?`${u}.`:"";o.append(`${m}x`,"0"),o.append(`${m}y`,"0")}else u&&o.append(u,c)}}else{if(jt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=_t,n=null,a=Ot,i=e}return o&&a==="text/plain"&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}var Hi=-1,zi=-2,Bi=-3,Wi=-4,Yi=-5,Vi=-6,Ji=-7,Gi="B",Ki="D",na="E",Xi="M",qi="N",aa="P",Qi="R",Zi="S",el="Y",tl="U",rl="Z",oa=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};function nl(){const e=new TextDecoder;let t="";return new TransformStream({transform(r,n){const a=e.decode(r,{stream:!0}),o=(t+a).split(`
|
|
22
|
-
`);t=o.pop()||"";for(const i of o)n.enqueue(i)},flush(r){t&&r.enqueue(t)}})}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var tr=typeof window<"u"?window:typeof globalThis<"u"?globalThis:void 0;function dr(e){const{hydrated:t,values:r}=this;if(typeof e=="number")return En.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,En.call(this,n)}function En(e){const{hydrated:t,values:r,deferred:n,plugins:a}=this;let o;const i=[[e,s=>{o=s}]];let l=[];for(;i.length>0;){const[s,u]=i.pop();switch(s){case Ji:u(void 0);continue;case Yi:u(null);continue;case zi:u(NaN);continue;case Vi:u(1/0);continue;case Bi:u(-1/0);continue;case Wi:u(-0);continue}if(t[s]){u(t[s]);continue}const h=r[s];if(!h||typeof h!="object"){t[s]=h,u(h);continue}if(Array.isArray(h))if(typeof h[0]=="string"){const[c,m,g]=h;switch(c){case Ki:u(t[s]=new Date(m));continue;case tl:u(t[s]=new URL(m));continue;case Gi:u(t[s]=BigInt(m));continue;case Qi:u(t[s]=new RegExp(m,g));continue;case el:u(t[s]=Symbol.for(m));continue;case Zi:const R=new Set;t[s]=R;for(let A=h.length-1;A>0;A--)i.push([h[A],P=>{R.add(P)}]);u(R);continue;case Xi:const b=new Map;t[s]=b;for(let A=h.length-2;A>0;A-=2){const P=[];i.push([h[A+1],D=>{P[1]=D}]),i.push([h[A],D=>{P[0]=D}]),l.push(()=>{b.set(P[0],P[1])})}u(b);continue;case qi:const E=Object.create(null);t[s]=E;for(const A of Object.keys(m).reverse()){const P=[];i.push([m[A],D=>{P[1]=D}]),i.push([Number(A.slice(1)),D=>{P[0]=D}]),l.push(()=>{E[P[0]]=P[1]})}u(E);continue;case aa:if(t[m])u(t[s]=t[m]);else{const A=new oa;n[m]=A,u(t[s]=A.promise)}continue;case na:const[,x,S]=h;let _=S&&tr&&tr[S]?new tr[S](x):new Error(x);t[s]=_,u(_);continue;case rl:u(t[s]=t[m]);continue;default:if(Array.isArray(a)){const A=[],P=h.slice(1);for(let D=0;D<P.length;D++){const y=P[D];i.push([y,M=>{A[D]=M}])}l.push(()=>{for(const D of a){const y=D(h[0],...A);if(y){u(t[s]=y.value);return}}throw new SyntaxError});continue}throw new SyntaxError}}else{const c=[];t[s]=c;for(let m=0;m<h.length;m++){const g=h[m];g!==Hi&&i.push([g,R=>{c[m]=R}])}u(c);continue}else{const c={};t[s]=c;for(const m of Object.keys(h).reverse()){const g=[];i.push([h[m],R=>{g[1]=R}]),i.push([Number(m.slice(1)),R=>{g[0]=R}]),l.push(()=>{c[g[0]]=g[1]})}u(c);continue}}for(;l.length>0;)l.pop()();return o}async function al(e,t){const{plugins:r}=t??{},n=new oa,a=e.pipeThrough(nl()).getReader(),o={values:[],hydrated:[],deferred:{},plugins:r},i=await ol.call(o,a);let l=n.promise;return i.done?n.resolve():l=il.call(o,a).then(n.resolve).catch(s=>{for(const u of Object.values(o.deferred))u.reject(s);n.reject(s)}),{done:l.then(()=>a.closed),value:i.value}}async function ol(e){const t=await e.read();if(!t.value)throw new SyntaxError;let r;try{r=JSON.parse(t.value)}catch{throw new SyntaxError}return{done:t.done,value:dr.call(this,r)}}async function il(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const r=t.value;switch(r[0]){case aa:{const n=r.indexOf(":"),a=Number(r.slice(1,n)),o=this.deferred[a];if(!o)throw new Error(`Deferred ID ${a} not found in stream`);const i=r.slice(n+1);let l;try{l=JSON.parse(i)}catch{throw new SyntaxError}const s=dr.call(this,l);o.resolve(s);break}case na:{const n=r.indexOf(":"),a=Number(r.slice(1,n)),o=this.deferred[a];if(!o)throw new Error(`Deferred ID ${a} not found in stream`);const i=r.slice(n+1);let l;try{l=JSON.parse(i)}catch{throw new SyntaxError}const s=dr.call(this,l);o.reject(s);break}default:throw new SyntaxError}t=await e.read()}}async function ll(e){let t={signal:e.signal};if(e.method!=="GET"){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}var sl={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},ul=/[&><\u2028\u2029]/g;function fr(e){return e.replace(ul,t=>sl[t])}function we(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var hr=Symbol("SingleFetchRedirect"),ia=class extends Error{},cl=202,dl=new Set([100,101,204,205]);function hs(e,t,r,n,a,o){let i=fl(e,l=>{let s=t.routes[l.route.id];we(s,"Route not found in manifest");let u=r[l.route.id];return{hasLoader:s.hasLoader,hasClientLoader:s.hasClientLoader,hasShouldRevalidate:!!(u!=null&&u.shouldRevalidate)}},wl,n,a,o);return async l=>l.runClientMiddleware(i)}function fl(e,t,r,n,a,o,i=()=>!0){return async l=>{let{request:s,matches:u,fetcherKey:h}=l,c=e();if(s.method!=="GET")return hl(l,r,a,o);let m=u.some(g=>{let{hasLoader:R,hasClientLoader:b}=t(g);return g.shouldCallHandler()&&R&&!b});return!n&&!m?ml(l,t,r,a,o):h?vl(l,r,a,o):pl(l,c,t,r,n,a,o,i)}}async function hl(e,t,r,n){let a=e.matches.find(l=>l.shouldCallHandler());we(a,"No action match found");let o,i=await a.resolve(async l=>await l(async()=>{let{data:u,status:h}=await t(e,r,n,[a.route.id]);return o=h,ht(u,a.route.id)}));return $t(i.result)||Ve(i.result)||sr(i.result)?{[a.route.id]:i}:{[a.route.id]:{type:i.type,result:wo(i.result,o)}}}async function ml(e,t,r,n,a){let o=e.matches.filter(l=>l.shouldCallHandler()),i={};return await Promise.all(o.map(l=>l.resolve(async s=>{try{let{hasClientLoader:u}=t(l),h=l.route.id,c=u?await s(async()=>{let{data:m}=await r(e,n,a,[h]);return ht(m,h)}):await s();i[l.route.id]={type:"data",result:c}}catch(u){i[l.route.id]={type:"error",result:u}}}))),i}async function pl(e,t,r,n,a,o,i,l=()=>!0){let s=new Set,u=!1,h=e.matches.map(()=>Rn()),c=Rn(),m={},g=Promise.all(e.matches.map(async(b,E)=>b.resolve(async x=>{h[E].resolve();let S=b.route.id,{hasLoader:_,hasClientLoader:A,hasShouldRevalidate:P}=r(b),D=!b.shouldRevalidateArgs||b.shouldRevalidateArgs.actionStatus==null||b.shouldRevalidateArgs.actionStatus<400;if(!b.shouldCallHandler(D)){u||(u=b.shouldRevalidateArgs!=null&&_&&P===!0);return}if(l(b)&&A){_&&(u=!0);try{let M=await x(async()=>{let{data:F}=await n(e,o,i,[S]);return ht(F,S)});m[S]={type:"data",result:M}}catch(M){m[S]={type:"error",result:M}}return}_&&s.add(S);try{let M=await x(async()=>{let F=await c.promise;return ht(F,S)});m[S]={type:"data",result:M}}catch(M){m[S]={type:"error",result:M}}})));if(await Promise.all(h.map(b=>b.promise)),(!t.state.initialized&&t.state.navigation.state==="idle"||s.size===0)&&!window.__reactRouterHdrActive)c.resolve({routes:{}});else{let b=a&&u&&s.size>0?[...s.keys()]:void 0;try{let E=await n(e,o,i,b);c.resolve(E.data)}catch(E){c.reject(E)}}return await g,await yl(c.promise,e.matches,s,m),m}async function yl(e,t,r,n){var a;try{let o,i=await e;if("routes"in i){for(let l of t)if(l.route.id in i.routes){let s=i.routes[l.route.id];if("error"in s){o=s.error,((a=n[l.route.id])==null?void 0:a.result)==null&&(n[l.route.id]={type:"error",result:o});break}}}o!==void 0&&Array.from(r.values()).forEach(l=>{n[l].result instanceof ia&&(n[l].result=o)})}catch{}}async function vl(e,t,r,n){let a=e.matches.find(l=>l.shouldCallHandler());we(a,"No fetcher match found");let o=a.route.id,i=await a.resolve(async l=>l(async()=>{let{data:s}=await t(e,r,n,[o]);return ht(s,o)}));return{[a.route.id]:i}}function gl(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}function la(e,t,r,n){let a=typeof e=="string"?new URL(e,typeof window>"u"?"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&&be(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${n}`,a}async function wl(e,t,r,n){let{request:a}=e,o=la(a.url,t,r,"data");a.method==="GET"&&(o=gl(o),n&&o.searchParams.set("_routes",n.join(",")));let i=await fetch(o,await ll(a));if(i.status>=400&&!i.headers.has("X-Remix-Response"))throw new je(i.status,i.statusText,await i.text());if(i.status===204&&i.headers.has("X-Remix-Redirect"))return{status:cl,data:{redirect:{redirect:i.headers.get("X-Remix-Redirect"),status:Number(i.headers.get("X-Remix-Status")||"302"),revalidate:i.headers.get("X-Remix-Revalidate")==="true",reload:i.headers.get("X-Remix-Reload-Document")==="true",replace:i.headers.get("X-Remix-Replace")==="true"}}};if(dl.has(i.status)){let l={};return n&&a.method!=="GET"&&(l[n[0]]={data:void 0}),{status:i.status,data:{routes:l}}}we(i.body,"No response body to decode");try{let l=await El(i.body,window),s;if(a.method==="GET"){let u=l.value;hr in u?s={redirect:u[hr]}:s={routes:u}}else{let u=l.value,h=n==null?void 0:n[0];we(h,"No routeId found for single fetch call decoding"),"redirect"in u?s={redirect:u}:s={routes:{[h]:u}}}return{status:i.status,data:s}}catch{throw new Error("Unable to decode turbo-stream response")}}function El(e,t){return al(e,{plugins:[(r,...n)=>{if(r==="SanitizedError"){let[a,o,i]=n,l=Error;a&&a in t&&typeof t[a]=="function"&&(l=t[a]);let s=new l(o);return s.stack=i,{value:s}}if(r==="ErrorResponse"){let[a,o,i]=n;return{value:new je(o,i,a)}}if(r==="SingleFetchRedirect")return{value:{[hr]:n[0]}};if(r==="SingleFetchClassInstance")return{value:n[0]};if(r==="SingleFetchFallback")return{value:void 0}}]})}function ht(e,t){if("redirect"in e){let{redirect:n,revalidate:a,reload:o,replace:i,status:l}=e.redirect;throw Eo(n,{status:l,headers:{...a?{"X-Remix-Revalidate":"yes"}:null,...o?{"X-Remix-Reload-Document":"yes"}:null,...i?{"X-Remix-Replace":"yes"}:null}})}let r=e.routes[t];if(r==null)throw new ia(`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 Rn(){let e,t,r=new Promise((n,a)=>{e=async o=>{n(o);try{await r}catch{}},t=async o=>{a(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}async function sa(e,t){if(e.id in t)return t[e.id];try{let r=await 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 Rl(e,t,r){let n=e.map(o=>{var s;let i=t[o.route.id],l=r.routes[o.route.id];return[l&&l.css?l.css.map(u=>({rel:"stylesheet",href:u})):[],((s=i==null?void 0:i.links)==null?void 0:s.call(i))||[]]}).flat(2),a=Tr(e,r);return fa(n,a)}function ua(e){return e.css?e.css.map(t=>({rel:"stylesheet",href:t})):[]}async function bl(e){if(!e.css)return;let t=ua(e);await Promise.all(t.map(da))}async function ca(e,t){if(!e.css&&!t.links||!Pl())return;let r=[];if(e.css&&r.push(...ua(e)),t.links&&r.push(...t.links()),r.length===0)return;let n=[];for(let a of r)!Pr(a)&&a.rel==="stylesheet"&&n.push({...a,rel:"preload",as:"style"});await Promise.all(n.map(da))}async function da(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");Object.assign(r,e);function n(){document.head.contains(r)&&document.head.removeChild(r)}r.onload=()=>{n(),t()},r.onerror=()=>{n(),t()},document.head.appendChild(r)})}function Pr(e){return e!=null&&typeof e.page=="string"}function Sl(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Cl(e,t,r){let n=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let i=await sa(o,r);return i.links?i.links():[]}return[]}));return fa(n.flat(1).filter(Sl).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function bn(e,t,r,n,a,o){let i=(s,u)=>r[u]?s.route.id!==r[u].route.id:!0,l=(s,u)=>{var h;return r[u].pathname!==s.pathname||((h=r[u].route.path)==null?void 0:h.endsWith("*"))&&r[u].params["*"]!==s.params["*"]};return o==="assets"?t.filter((s,u)=>i(s,u)||l(s,u)):o==="data"?t.filter((s,u)=>{var c;let h=n.routes[s.route.id];if(!h||!h.hasLoader)return!1;if(i(s,u)||l(s,u))return!0;if(s.route.shouldRevalidate){let m=s.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((c=r[0])==null?void 0:c.params)||{},nextUrl:new URL(e,window.origin),nextParams:s.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function Tr(e,t,{includeHydrateFallback:r}={}){return Ll(e.map(n=>{let a=t.routes[n.route.id];if(!a)return[];let o=[a.module];return a.clientActionModule&&(o=o.concat(a.clientActionModule)),a.clientLoaderModule&&(o=o.concat(a.clientLoaderModule)),r&&a.hydrateFallbackModule&&(o=o.concat(a.hydrateFallbackModule)),a.imports&&(o=o.concat(a.imports)),o}).flat(1))}function Ll(e){return[...new Set(e)]}function xl(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function fa(e,t){let r=new Set,n=new Set(t);return e.reduce((a,o)=>{if(t&&!Pr(o)&&o.as==="script"&&o.href&&n.has(o.href))return a;let l=JSON.stringify(xl(o));return r.has(l)||(r.add(l),a.push({key:l,link:o})),a},[])}var Pt;function Pl(){if(Pt!==void 0)return Pt;let e=document.createElement("link");return Pt=e.relList.supports("preload"),e=null,Pt}function Tl(){return f.createElement(mr,{title:"Loading...",renderScripts:!0},f.createElement("script",{dangerouslySetInnerHTML:{__html:`
|
|
21
|
+
Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let m=xe(),g;g=m;let R=g.pathname||"/",b=R;if(h!=="/"){let S=h.replace(/^\//,"").split("/");b="/"+R.replace(/^\//,"").split("/").slice(S.length).join("/")}let E=Ae(e,{pathname:b});return oe(c||E!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),oe(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.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.`),wi(E&&E.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Te([h,o.encodeLocation?o.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?h:Te([h,o.encodeLocation?o.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),i,r,n,a)}function pi(){let e=Pr(),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=d.createElement(d.Fragment,null,d.createElement("p",null,"💿 Hey developer 👋"),d.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",d.createElement("code",{style:o},"ErrorBoundary")," or"," ",d.createElement("code",{style:o},"errorElement")," prop on your route.")),d.createElement(d.Fragment,null,d.createElement("h2",null,"Unexpected Application Error!"),d.createElement("h3",{style:{fontStyle:"italic"}},t),r?d.createElement("pre",{style:a},r):null,i)}var yi=d.createElement(pi,null),ta=class extends d.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||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?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&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=ui(e.digest);r&&(e=r)}let t=e!==void 0?d.createElement(Le.Provider,{value:this.props.routeContext},d.createElement(Cr.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?d.createElement(vi,{error:e},t):t}};ta.contextType=Gn;var Zt=new WeakMap;function vi({children:e,error:t}){let{basename:r}=d.useContext(Ee);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=si(t.digest);if(n){let a=Zt.get(t);if(a)throw a;let o=Fn(n.location,r);if(An&&!Zt.get(t))if(o.isExternal||n.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const i=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:n.replace}));throw Zt.set(t,i),i}return d.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function gi({routeContext:e,match:t,children:r}){let n=d.useContext(Je);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),d.createElement(Le.Provider,{value:e},r)}function wi(e,t=[],r=null,n=null,a=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,i=r==null?void 0:r.errors;if(i!=null){let h=o.findIndex(c=>c.route.id&&(i==null?void 0:i[c.route.id])!==void 0);W(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,h+1))}let l=!1,s=-1;if(r)for(let h=0;h<o.length;h++){let c=o[h];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(s=h),c.route.id){let{loaderData:m,errors:g}=r,R=c.route.loader&&!m.hasOwnProperty(c.route.id)&&(!g||g[c.route.id]===void 0);if(c.route.lazy||R){l=!0,s>=0?o=o.slice(0,s+1):o=[o[0]];break}}}let u=r&&n?(h,c)=>{var m,g;n(h,{location:r.location,params:((g=(m=r.matches)==null?void 0:m[0])==null?void 0:g.params)??{},unstable_pattern:mt(r.matches),errorInfo:c})}:void 0;return o.reduceRight((h,c,m)=>{let g,R=!1,b=null,E=null;r&&(g=i&&c.route.id?i[c.route.id]:void 0,b=c.route.errorElement||yi,l&&(s<0&&m===0?(oa("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),R=!0,E=null):s===m&&(R=!0,E=c.route.hydrateFallbackElement||null)));let x=t.concat(o.slice(0,m+1)),S=()=>{let _;return g?_=b:R?_=E:c.route.Component?_=d.createElement(c.route.Component,null):c.route.element?_=c.route.element:_=h,d.createElement(gi,{match:c,routeContext:{outlet:h,matches:x,isDataRoute:r!=null},children:_})};return r&&(c.route.ErrorBoundary||c.route.errorElement||m===0)?d.createElement(ta,{location:r.location,revalidation:r.revalidation,component:b,error:g,children:S(),routeContext:{outlet:null,matches:x,isDataRoute:!0},onError:u}):S()},null)}function Lr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ra(e){let t=d.useContext(Je);return W(t,Lr(e)),t}function Ge(e){let t=d.useContext(et);return W(t,Lr(e)),t}function Ei(e){let t=d.useContext(Le);return W(t,Lr(e)),t}function vt(e){let t=Ei(e),r=t.matches[t.matches.length-1];return W(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Ri(){return vt("useRouteId")}function bi(){return Ge("useNavigation").navigation}function ls(){let e=ra("useRevalidator"),t=Ge("useRevalidator"),r=d.useCallback(async()=>{await e.router.revalidate()},[e.router]);return d.useMemo(()=>({revalidate:r,state:t.revalidation}),[r,t.revalidation])}function xr(){let{matches:e,loaderData:t}=Ge("useMatches");return d.useMemo(()=>e.map(r=>Tn(r,t)),[e,t])}function na(){let e=Ge("useLoaderData"),t=vt("useLoaderData");return e.loaderData[t]}function ss(e){return Ge("useRouteLoaderData").loaderData[e]}function aa(){let e=Ge("useActionData"),t=vt("useLoaderData");return e.actionData?e.actionData[t]:void 0}function Pr(){var n;let e=d.useContext(Cr),t=Ge("useRouteError"),r=vt("useRouteError");return e!==void 0?e:(n=t.errors)==null?void 0:n[r]}function Si(){let{router:e}=ra("useNavigate"),t=vt("useNavigate"),r=d.useRef(!1);return Qn(()=>{r.current=!0}),d.useCallback(async(a,o={})=>{oe(r.current,qn),r.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var vn={};function oa(e,t,r){!t&&!vn[e]&&(vn[e]=!0,oe(!1,r))}var gn={};function ur(e,t){!e&&!gn[t]&&(gn[t]=!0,console.warn(t))}var Ci="useOptimistic",wn=Ga[Ci],Li=()=>{};function xi(e){return wn?wn(e):[e,Li]}function us(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&oe(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:d.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&oe(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:d.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&oe(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:d.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var cs=["HydrateFallback","hydrateFallbackElement"],Pi=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function ds({router:e,flushSync:t,onError:r,unstable_useTransitions:n}){n=Kn()||n;let[o,i]=d.useState(e.state),[l,s]=xi(o),[u,h]=d.useState(),[c,m]=d.useState({isTransitioning:!1}),[g,R]=d.useState(),[b,E]=d.useState(),[x,S]=d.useState(),_=d.useRef(new Map),A=d.useCallback((M,{deletedFetchers:F,newErrors:J,flushSync:K,viewTransitionOpts:ae})=>{J&&r&&Object.values(J).forEach(Q=>{var ue;return r(Q,{location:M.location,params:((ue=M.matches[0])==null?void 0:ue.params)??{},unstable_pattern:mt(M.matches)})}),M.fetchers.forEach((Q,ue)=>{Q.data!==void 0&&_.current.set(ue,Q.data)}),F.forEach(Q=>_.current.delete(Q)),ur(K===!1||t!=null,'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 le=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(ur(ae==null||le,"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."),!ae||!le){t&&K?t(()=>i(M)):n===!1?i(M):d.startTransition(()=>{n===!0&&s(Q=>En(Q,M)),i(M)});return}if(t&&K){t(()=>{b&&(g==null||g.resolve(),b.skipTransition()),m({isTransitioning:!0,flushSync:!0,currentLocation:ae.currentLocation,nextLocation:ae.nextLocation})});let Q=e.window.document.startViewTransition(()=>{t(()=>i(M))});Q.finished.finally(()=>{t(()=>{R(void 0),E(void 0),h(void 0),m({isTransitioning:!1})})}),t(()=>E(Q));return}b?(g==null||g.resolve(),b.skipTransition(),S({state:M,currentLocation:ae.currentLocation,nextLocation:ae.nextLocation})):(h(M),m({isTransitioning:!0,flushSync:!1,currentLocation:ae.currentLocation,nextLocation:ae.nextLocation}))},[e.window,t,b,g,n,s,r]);d.useLayoutEffect(()=>e.subscribe(A),[e,A]),d.useEffect(()=>{c.isTransitioning&&!c.flushSync&&R(new Pi)},[c]),d.useEffect(()=>{if(g&&u&&e.window){let M=u,F=g.promise,J=e.window.document.startViewTransition(async()=>{n===!1?i(M):d.startTransition(()=>{n===!0&&s(K=>En(K,M)),i(M)}),await F});J.finished.finally(()=>{R(void 0),E(void 0),h(void 0),m({isTransitioning:!1})}),E(J)}},[u,g,e.window,n,s]),d.useEffect(()=>{g&&u&&l.location.key===u.location.key&&g.resolve()},[g,b,l.location,u]),d.useEffect(()=>{!c.isTransitioning&&x&&(h(x.state),m({isTransitioning:!0,flushSync:!1,currentLocation:x.currentLocation,nextLocation:x.nextLocation}),S(void 0))},[c.isTransitioning,x]);let P=d.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:M=>e.navigate(M),push:(M,F,J)=>e.navigate(M,{state:F,preventScrollReset:J==null?void 0:J.preventScrollReset}),replace:(M,F,J)=>e.navigate(M,{replace:!0,state:F,preventScrollReset:J==null?void 0:J.preventScrollReset})}),[e]),D=e.basename||"/",y=d.useMemo(()=>({router:e,navigator:P,static:!1,basename:D,onError:r}),[e,P,D,r]);return d.createElement(d.Fragment,null,d.createElement(Je.Provider,{value:y},d.createElement(et.Provider,{value:l},d.createElement(Sr.Provider,{value:_.current},d.createElement(br.Provider,{value:c},d.createElement(Di,{basename:D,location:l.location,navigationType:l.historyAction,navigator:P,unstable_useTransitions:n},d.createElement(Ti,{routes:e.routes,future:e.future,state:l,onError:r})))))),null)}function En(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var Ti=d.memo(Mi);function Mi({routes:e,future:t,state:r,onError:n}){return mi(e,void 0,r,n,t)}function fs(e){return hi(e.context)}function Di({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:o=!1,unstable_useTransitions:i}){W(!pt(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=d.useMemo(()=>({basename:l,navigator:a,static:o,unstable_useTransitions:i,future:{}}),[l,a,o,i]);typeof r=="string"&&(r=ke(r));let{pathname:u="/",search:h="",hash:c="",state:m=null,key:g="default"}=r,R=d.useMemo(()=>{let b=be(u,l);return b==null?null:{location:{pathname:b,search:h,hash:c,state:m,key:g},navigationType:n}},[l,u,h,c,m,g,n]);return oe(R!=null,`<Router basename="${l}"> is not able to match the URL "${u}${h}${c}" because it does not start with the basename, so the <Router> won't render anything.`),R==null?null:d.createElement(Ee.Provider,{value:s},d.createElement(kt.Provider,{children:t,value:R}))}function _i(){return{params:ea(),loaderData:na(),actionData:aa(),matches:xr()}}function hs(e){return function(){const r=_i();return d.createElement(e,r)}}function Oi(){return{params:ea(),loaderData:na(),actionData:aa(),error:Pr()}}function ms(e){return function(){const r=Oi();return d.createElement(e,r)}}var _t="get",Ot="application/x-www-form-urlencoded";function jt(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Ii(e){return jt(e)&&e.tagName.toLowerCase()==="button"}function Ai(e){return jt(e)&&e.tagName.toLowerCase()==="form"}function Fi(e){return jt(e)&&e.tagName.toLowerCase()==="input"}function Ni(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function $i(e,t){return e.button===0&&(!t||t==="_self")&&!Ni(e)}function cr(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function ki(e,t){let r=cr(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(o=>{r.append(a,o)})}),r}var xt=null;function ji(){if(xt===null)try{new FormData(document.createElement("form"),0),xt=!1}catch{xt=!0}return xt}var Ui=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function er(e){return e!=null&&!Ui.has(e)?(oe(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ot}"`),null):e}function Hi(e,t){let r,n,a,o,i;if(Ai(e)){let l=e.getAttribute("action");n=l?be(l,t):null,r=e.getAttribute("method")||_t,a=er(e.getAttribute("enctype"))||Ot,o=new FormData(e)}else if(Ii(e)||Fi(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||l.getAttribute("action");if(n=s?be(s,t):null,r=e.getAttribute("formmethod")||l.getAttribute("method")||_t,a=er(e.getAttribute("formenctype"))||er(l.getAttribute("enctype"))||Ot,o=new FormData(l,e),!ji()){let{name:u,type:h,value:c}=e;if(h==="image"){let m=u?`${u}.`:"";o.append(`${m}x`,"0"),o.append(`${m}y`,"0")}else u&&o.append(u,c)}}else{if(jt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=_t,n=null,a=Ot,i=e}return o&&a==="text/plain"&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}var zi=-1,Bi=-2,Wi=-3,Yi=-4,Vi=-5,Ji=-6,Gi=-7,Ki="B",Xi="D",ia="E",qi="M",Qi="N",la="P",Zi="R",el="S",tl="Y",rl="U",nl="Z",sa=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};function al(){const e=new TextDecoder;let t="";return new TransformStream({transform(r,n){const a=e.decode(r,{stream:!0}),o=(t+a).split(`
|
|
22
|
+
`);t=o.pop()||"";for(const i of o)n.enqueue(i)},flush(r){t&&r.enqueue(t)}})}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var tr=typeof window<"u"?window:typeof globalThis<"u"?globalThis:void 0;function dr(e){const{hydrated:t,values:r}=this;if(typeof e=="number")return Rn.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,Rn.call(this,n)}function Rn(e){const{hydrated:t,values:r,deferred:n,plugins:a}=this;let o;const i=[[e,s=>{o=s}]];let l=[];for(;i.length>0;){const[s,u]=i.pop();switch(s){case Gi:u(void 0);continue;case Vi:u(null);continue;case Bi:u(NaN);continue;case Ji:u(1/0);continue;case Wi:u(-1/0);continue;case Yi:u(-0);continue}if(t[s]){u(t[s]);continue}const h=r[s];if(!h||typeof h!="object"){t[s]=h,u(h);continue}if(Array.isArray(h))if(typeof h[0]=="string"){const[c,m,g]=h;switch(c){case Xi:u(t[s]=new Date(m));continue;case rl:u(t[s]=new URL(m));continue;case Ki:u(t[s]=BigInt(m));continue;case Zi:u(t[s]=new RegExp(m,g));continue;case tl:u(t[s]=Symbol.for(m));continue;case el:const R=new Set;t[s]=R;for(let A=h.length-1;A>0;A--)i.push([h[A],P=>{R.add(P)}]);u(R);continue;case qi:const b=new Map;t[s]=b;for(let A=h.length-2;A>0;A-=2){const P=[];i.push([h[A+1],D=>{P[1]=D}]),i.push([h[A],D=>{P[0]=D}]),l.push(()=>{b.set(P[0],P[1])})}u(b);continue;case Qi:const E=Object.create(null);t[s]=E;for(const A of Object.keys(m).reverse()){const P=[];i.push([m[A],D=>{P[1]=D}]),i.push([Number(A.slice(1)),D=>{P[0]=D}]),l.push(()=>{E[P[0]]=P[1]})}u(E);continue;case la:if(t[m])u(t[s]=t[m]);else{const A=new sa;n[m]=A,u(t[s]=A.promise)}continue;case ia:const[,x,S]=h;let _=S&&tr&&tr[S]?new tr[S](x):new Error(x);t[s]=_,u(_);continue;case nl:u(t[s]=t[m]);continue;default:if(Array.isArray(a)){const A=[],P=h.slice(1);for(let D=0;D<P.length;D++){const y=P[D];i.push([y,M=>{A[D]=M}])}l.push(()=>{for(const D of a){const y=D(h[0],...A);if(y){u(t[s]=y.value);return}}throw new SyntaxError});continue}throw new SyntaxError}}else{const c=[];t[s]=c;for(let m=0;m<h.length;m++){const g=h[m];g!==zi&&i.push([g,R=>{c[m]=R}])}u(c);continue}else{const c={};t[s]=c;for(const m of Object.keys(h).reverse()){const g=[];i.push([h[m],R=>{g[1]=R}]),i.push([Number(m.slice(1)),R=>{g[0]=R}]),l.push(()=>{c[g[0]]=g[1]})}u(c);continue}}for(;l.length>0;)l.pop()();return o}async function ol(e,t){const{plugins:r}=t??{},n=new sa,a=e.pipeThrough(al()).getReader(),o={values:[],hydrated:[],deferred:{},plugins:r},i=await il.call(o,a);let l=n.promise;return i.done?n.resolve():l=ll.call(o,a).then(n.resolve).catch(s=>{for(const u of Object.values(o.deferred))u.reject(s);n.reject(s)}),{done:l.then(()=>a.closed),value:i.value}}async function il(e){const t=await e.read();if(!t.value)throw new SyntaxError;let r;try{r=JSON.parse(t.value)}catch{throw new SyntaxError}return{done:t.done,value:dr.call(this,r)}}async function ll(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const r=t.value;switch(r[0]){case la:{const n=r.indexOf(":"),a=Number(r.slice(1,n)),o=this.deferred[a];if(!o)throw new Error(`Deferred ID ${a} not found in stream`);const i=r.slice(n+1);let l;try{l=JSON.parse(i)}catch{throw new SyntaxError}const s=dr.call(this,l);o.resolve(s);break}case ia:{const n=r.indexOf(":"),a=Number(r.slice(1,n)),o=this.deferred[a];if(!o)throw new Error(`Deferred ID ${a} not found in stream`);const i=r.slice(n+1);let l;try{l=JSON.parse(i)}catch{throw new SyntaxError}const s=dr.call(this,l);o.reject(s);break}default:throw new SyntaxError}t=await e.read()}}async function sl(e){let t={signal:e.signal};if(e.method!=="GET"){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}var ul={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},cl=/[&><\u2028\u2029]/g;function fr(e){return e.replace(cl,t=>ul[t])}function we(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var hr=Symbol("SingleFetchRedirect"),ua=class extends Error{},dl=202,fl=new Set([100,101,204,205]);function ps(e,t,r,n,a,o){let i=hl(e,l=>{let s=t.routes[l.route.id];we(s,"Route not found in manifest");let u=r[l.route.id];return{hasLoader:s.hasLoader,hasClientLoader:s.hasClientLoader,hasShouldRevalidate:!!(u!=null&&u.shouldRevalidate)}},El,n,a,o);return async l=>l.runClientMiddleware(i)}function hl(e,t,r,n,a,o,i=()=>!0){return async l=>{let{request:s,matches:u,fetcherKey:h}=l,c=e();if(s.method!=="GET")return ml(l,r,a,o);let m=u.some(g=>{let{hasLoader:R,hasClientLoader:b}=t(g);return g.shouldCallHandler()&&R&&!b});return!n&&!m?pl(l,t,r,a,o):h?gl(l,r,a,o):yl(l,c,t,r,n,a,o,i)}}async function ml(e,t,r,n){let a=e.matches.find(l=>l.shouldCallHandler());we(a,"No action match found");let o,i=await a.resolve(async l=>await l(async()=>{let{data:u,status:h}=await t(e,r,n,[a.route.id]);return o=h,ht(u,a.route.id)}));return $t(i.result)||Ve(i.result)||sr(i.result)?{[a.route.id]:i}:{[a.route.id]:{type:i.type,result:bo(i.result,o)}}}async function pl(e,t,r,n,a){let o=e.matches.filter(l=>l.shouldCallHandler()),i={};return await Promise.all(o.map(l=>l.resolve(async s=>{try{let{hasClientLoader:u}=t(l),h=l.route.id,c=u?await s(async()=>{let{data:m}=await r(e,n,a,[h]);return ht(m,h)}):await s();i[l.route.id]={type:"data",result:c}}catch(u){i[l.route.id]={type:"error",result:u}}}))),i}async function yl(e,t,r,n,a,o,i,l=()=>!0){let s=new Set,u=!1,h=e.matches.map(()=>bn()),c=bn(),m={},g=Promise.all(e.matches.map(async(b,E)=>b.resolve(async x=>{h[E].resolve();let S=b.route.id,{hasLoader:_,hasClientLoader:A,hasShouldRevalidate:P}=r(b),D=!b.shouldRevalidateArgs||b.shouldRevalidateArgs.actionStatus==null||b.shouldRevalidateArgs.actionStatus<400;if(!b.shouldCallHandler(D)){u||(u=b.shouldRevalidateArgs!=null&&_&&P===!0);return}if(l(b)&&A){_&&(u=!0);try{let M=await x(async()=>{let{data:F}=await n(e,o,i,[S]);return ht(F,S)});m[S]={type:"data",result:M}}catch(M){m[S]={type:"error",result:M}}return}_&&s.add(S);try{let M=await x(async()=>{let F=await c.promise;return ht(F,S)});m[S]={type:"data",result:M}}catch(M){m[S]={type:"error",result:M}}})));if(await Promise.all(h.map(b=>b.promise)),(!t.state.initialized&&t.state.navigation.state==="idle"||s.size===0)&&!window.__reactRouterHdrActive)c.resolve({routes:{}});else{let b=a&&u&&s.size>0?[...s.keys()]:void 0;try{let E=await n(e,o,i,b);c.resolve(E.data)}catch(E){c.reject(E)}}return await g,await vl(c.promise,e.matches,s,m),m}async function vl(e,t,r,n){var a;try{let o,i=await e;if("routes"in i){for(let l of t)if(l.route.id in i.routes){let s=i.routes[l.route.id];if("error"in s){o=s.error,((a=n[l.route.id])==null?void 0:a.result)==null&&(n[l.route.id]={type:"error",result:o});break}}}o!==void 0&&Array.from(r.values()).forEach(l=>{n[l].result instanceof ua&&(n[l].result=o)})}catch{}}async function gl(e,t,r,n){let a=e.matches.find(l=>l.shouldCallHandler());we(a,"No fetcher match found");let o=a.route.id,i=await a.resolve(async l=>l(async()=>{let{data:s}=await t(e,r,n,[o]);return ht(s,o)}));return{[a.route.id]:i}}function wl(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}function ca(e,t,r,n){let a=typeof e=="string"?new URL(e,typeof window>"u"?"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&&be(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${n}`,a}async function El(e,t,r,n){let{request:a}=e,o=ca(a.url,t,r,"data");a.method==="GET"&&(o=wl(o),n&&o.searchParams.set("_routes",n.join(",")));let i=await fetch(o,await sl(a));if(i.status>=400&&!i.headers.has("X-Remix-Response"))throw new je(i.status,i.statusText,await i.text());if(i.status===204&&i.headers.has("X-Remix-Redirect"))return{status:dl,data:{redirect:{redirect:i.headers.get("X-Remix-Redirect"),status:Number(i.headers.get("X-Remix-Status")||"302"),revalidate:i.headers.get("X-Remix-Revalidate")==="true",reload:i.headers.get("X-Remix-Reload-Document")==="true",replace:i.headers.get("X-Remix-Replace")==="true"}}};if(fl.has(i.status)){let l={};return n&&a.method!=="GET"&&(l[n[0]]={data:void 0}),{status:i.status,data:{routes:l}}}we(i.body,"No response body to decode");try{let l=await Rl(i.body,window),s;if(a.method==="GET"){let u=l.value;hr in u?s={redirect:u[hr]}:s={routes:u}}else{let u=l.value,h=n==null?void 0:n[0];we(h,"No routeId found for single fetch call decoding"),"redirect"in u?s={redirect:u}:s={routes:{[h]:u}}}return{status:i.status,data:s}}catch{throw new Error("Unable to decode turbo-stream response")}}function Rl(e,t){return ol(e,{plugins:[(r,...n)=>{if(r==="SanitizedError"){let[a,o,i]=n,l=Error;a&&a in t&&typeof t[a]=="function"&&(l=t[a]);let s=new l(o);return s.stack=i,{value:s}}if(r==="ErrorResponse"){let[a,o,i]=n;return{value:new je(o,i,a)}}if(r==="SingleFetchRedirect")return{value:{[hr]:n[0]}};if(r==="SingleFetchClassInstance")return{value:n[0]};if(r==="SingleFetchFallback")return{value:void 0}}]})}function ht(e,t){if("redirect"in e){let{redirect:n,revalidate:a,reload:o,replace:i,status:l}=e.redirect;throw So(n,{status:l,headers:{...a?{"X-Remix-Revalidate":"yes"}:null,...o?{"X-Remix-Reload-Document":"yes"}:null,...i?{"X-Remix-Replace":"yes"}:null}})}let r=e.routes[t];if(r==null)throw new ua(`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 bn(){let e,t,r=new Promise((n,a)=>{e=async o=>{n(o);try{await r}catch{}},t=async o=>{a(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}async function da(e,t){if(e.id in t)return t[e.id];try{let r=await 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 bl(e,t,r){let n=e.map(o=>{var s;let i=t[o.route.id],l=r.routes[o.route.id];return[l&&l.css?l.css.map(u=>({rel:"stylesheet",href:u})):[],((s=i==null?void 0:i.links)==null?void 0:s.call(i))||[]]}).flat(2),a=Mr(e,r);return pa(n,a)}function fa(e){return e.css?e.css.map(t=>({rel:"stylesheet",href:t})):[]}async function Sl(e){if(!e.css)return;let t=fa(e);await Promise.all(t.map(ma))}async function ha(e,t){if(!e.css&&!t.links||!Tl())return;let r=[];if(e.css&&r.push(...fa(e)),t.links&&r.push(...t.links()),r.length===0)return;let n=[];for(let a of r)!Tr(a)&&a.rel==="stylesheet"&&n.push({...a,rel:"preload",as:"style"});await Promise.all(n.map(ma))}async function ma(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");Object.assign(r,e);function n(){document.head.contains(r)&&document.head.removeChild(r)}r.onload=()=>{n(),t()},r.onerror=()=>{n(),t()},document.head.appendChild(r)})}function Tr(e){return e!=null&&typeof e.page=="string"}function Cl(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Ll(e,t,r){let n=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let i=await da(o,r);return i.links?i.links():[]}return[]}));return pa(n.flat(1).filter(Cl).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function Sn(e,t,r,n,a,o){let i=(s,u)=>r[u]?s.route.id!==r[u].route.id:!0,l=(s,u)=>{var h;return r[u].pathname!==s.pathname||((h=r[u].route.path)==null?void 0:h.endsWith("*"))&&r[u].params["*"]!==s.params["*"]};return o==="assets"?t.filter((s,u)=>i(s,u)||l(s,u)):o==="data"?t.filter((s,u)=>{var c;let h=n.routes[s.route.id];if(!h||!h.hasLoader)return!1;if(i(s,u)||l(s,u))return!0;if(s.route.shouldRevalidate){let m=s.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((c=r[0])==null?void 0:c.params)||{},nextUrl:new URL(e,window.origin),nextParams:s.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function Mr(e,t,{includeHydrateFallback:r}={}){return xl(e.map(n=>{let a=t.routes[n.route.id];if(!a)return[];let o=[a.module];return a.clientActionModule&&(o=o.concat(a.clientActionModule)),a.clientLoaderModule&&(o=o.concat(a.clientLoaderModule)),r&&a.hydrateFallbackModule&&(o=o.concat(a.hydrateFallbackModule)),a.imports&&(o=o.concat(a.imports)),o}).flat(1))}function xl(e){return[...new Set(e)]}function Pl(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function pa(e,t){let r=new Set,n=new Set(t);return e.reduce((a,o)=>{if(t&&!Tr(o)&&o.as==="script"&&o.href&&n.has(o.href))return a;let l=JSON.stringify(Pl(o));return r.has(l)||(r.add(l),a.push({key:l,link:o})),a},[])}var Pt;function Tl(){if(Pt!==void 0)return Pt;let e=document.createElement("link");return Pt=e.relList.supports("preload"),e=null,Pt}function Ml(){return d.createElement(mr,{title:"Loading...",renderScripts:!0},d.createElement("script",{dangerouslySetInnerHTML:{__html:`
|
|
23
23
|
console.log(
|
|
24
24
|
"💿 Hey developer 👋. You can provide a way better UX than this " +
|
|
25
25
|
"when your app is loading JS modules and/or running \`clientLoader\` " +
|
|
26
26
|
"functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +
|
|
27
27
|
"for more information."
|
|
28
28
|
);
|
|
29
|
-
`}}))}function ha(e){let t={};return Object.values(e).forEach(r=>{if(r){let n=r.parentId||"";t[n]||(t[n]=[]),t[n].push(r)}}),t}function Ml(e,t,r){let n=ma(t),a=t.HydrateFallback&&(!r||e.id==="root")?t.HydrateFallback:e.id==="root"?Tl:void 0,o=t.ErrorBoundary?t.ErrorBoundary:e.id==="root"?()=>f.createElement(va,{error:ta()}):void 0;return e.id==="root"&&t.Layout?{...n?{element:f.createElement(t.Layout,null,f.createElement(n,null))}:{Component:n},...o?{errorElement:f.createElement(t.Layout,null,f.createElement(o,null))}:{ErrorBoundary:o},...a?{hydrateFallbackElement:f.createElement(t.Layout,null,f.createElement(a,null))}:{HydrateFallback:a}}:{Component:n,ErrorBoundary:o,HydrateFallback:a}}function ms(e,t,r,n,a,o){return Mr(t,r,n,a,o,"",ha(t),e)}function Tt(e,t){if(e==="loader"&&!t.hasLoader||e==="action"&&!t.hasAction){let n=`You are trying to call ${e==="action"?"serverAction()":"serverLoader()"} on a route that does not have a server ${e} (routeId: "${t.id}")`;throw console.error(n),new je(400,"Bad Request",new Error(n),!0)}}function rr(e,t){let r=e==="clientAction"?"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 je(405,"Method Not Allowed",new Error(n),!0)}function Mr(e,t,r,n,a,o="",i=ha(e),l){return(i[o]||[]).map(s=>{var S,_,A;let u=t[s.id];function h(P){return we(typeof P=="function","No single fetch function available for route handler"),P()}function c(P){return s.hasLoader?h(P):Promise.resolve(null)}function m(P){if(!s.hasAction)throw rr("action",s.id);return h(P)}function g(P){import(P)}function R(P){P.clientActionModule&&g(P.clientActionModule),P.clientLoaderModule&&g(P.clientLoaderModule)}async function b(P){let D=t[s.id],y=D?ca(s,D):Promise.resolve();try{return P()}finally{await y}}let E={id:s.id,index:s.index,path:s.path};if(u){Object.assign(E,{...E,...Ml(s,u,a),middleware:u.clientMiddleware,handle:u.handle,shouldRevalidate:Sn(E.path,u,s,n,l)});let P=r&&r.loaderData&&s.id in r.loaderData,D=P?(S=r==null?void 0:r.loaderData)==null?void 0:S[s.id]:void 0,y=r&&r.errors&&s.id in r.errors,M=y?(_=r==null?void 0:r.errors)==null?void 0:_[s.id]:void 0,F=l==null&&(((A=u.clientLoader)==null?void 0:A.hydrate)===!0||!s.hasLoader);E.loader=async({request:J,params:K,context:ae,unstable_pattern:le},Q)=>{try{return await b(async()=>(we(u,"No `routeModule` available for critical-route loader"),u.clientLoader?u.clientLoader({request:J,params:K,context:ae,unstable_pattern:le,async serverLoader(){if(Tt("loader",s),F){if(P)return D;if(y)throw M}return c(Q)}}):c(Q)))}finally{F=!1}},E.loader.hydrate=Ol(s.id,u.clientLoader,s.hasLoader,a),E.action=({request:J,params:K,context:ae,unstable_pattern:le},Q)=>b(async()=>{if(we(u,"No `routeModule` available for critical-route action"),!u.clientAction){if(a)throw rr("clientAction",s.id);return m(Q)}return u.clientAction({request:J,params:K,context:ae,unstable_pattern:le,async serverAction(){return Tt("action",s),m(Q)}})})}else{s.hasClientLoader||(E.loader=(y,M)=>b(()=>c(M))),s.hasClientAction||(E.action=(y,M)=>b(()=>{if(a)throw rr("clientAction",s.id);return m(M)}));let P;async function D(){return P?await P:(P=(async()=>{(s.clientLoaderModule||s.clientActionModule)&&await new Promise(M=>setTimeout(M,0));let y=_l(s,t);return R(s),await y})(),await P)}E.lazy={loader:s.hasClientLoader?async()=>{let{clientLoader:y}=s.clientLoaderModule?await import(s.clientLoaderModule):await D();return we(y,"No `clientLoader` export found"),(M,F)=>y({...M,async serverLoader(){return Tt("loader",s),c(F)}})}:void 0,action:s.hasClientAction?async()=>{let y=s.clientActionModule?import(s.clientActionModule):D();R(s);let{clientAction:M}=await y;return we(M,"No `clientAction` export found"),(F,J)=>M({...F,async serverAction(){return Tt("action",s),m(J)}})}:void 0,middleware:s.hasClientMiddleware?async()=>{let{clientMiddleware:y}=s.clientMiddlewareModule?await import(s.clientMiddlewareModule):await D();return we(y,"No `clientMiddleware` export found"),y}:void 0,shouldRevalidate:async()=>{let y=await D();return Sn(E.path,y,s,n,l)},handle:async()=>(await D()).handle,Component:async()=>(await D()).Component,ErrorBoundary:s.hasErrorBoundary?async()=>(await D()).ErrorBoundary:void 0}}let x=Mr(e,t,r,n,a,s.id,i,l);return x.length>0&&(E.children=x),E})}function Sn(e,t,r,n,a){if(a)return Dl(r.id,t.shouldRevalidate,a);if(!n&&r.hasLoader&&!r.hasClientLoader){let o=e?Dn(e)[1].map(l=>l.paramName):[];const i=l=>o.some(s=>l.currentParams[s]!==l.nextParams[s]);if(t.shouldRevalidate){let l=t.shouldRevalidate;return s=>l({...s,defaultShouldRevalidate:i(s)})}else return l=>i(l)}return t.shouldRevalidate}function Dl(e,t,r){let n=!1;return a=>n?t?t(a):a.defaultShouldRevalidate:(n=!0,r.has(e))}async function _l(e,t){let r=sa(e,t),n=bl(e),a=await r;return await Promise.all([n,ca(e,a)]),{Component:ma(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}}function ma(e){if(e.default==null)return;if(!(typeof e.default=="object"&&Object.keys(e.default).length===0))return e.default}function Ol(e,t,r,n){return n&&e!=="root"||t!=null&&(t.hydrate===!0||r!==!0)}var It=new Set,Il=1e3,Ft=new Set,Al=7680;function Dr(e,t){return e.mode==="lazy"&&t===!0}function Fl({sri:e,...t},r){let n=new Set(r.state.matches.map(l=>l.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(l=>{let s=Ae(r.routes,l,r.basename);s&&s.forEach(u=>n.add(u.route.id))});let i=[...n].reduce((l,s)=>Object.assign(l,{[s]:t.routes[s]}),{});return{...t,routes:i,sri:e?!0:void 0}}function ps(e,t,r,n,a,o){if(Dr(n,r))return async({path:i,patch:l,signal:s,fetcherKey:u})=>{Ft.has(i)||await pa([i],u?window.location.href:i,e,t,r,a,o,n.manifestPath,l,s)}}function ys(e,t,r,n,a,o){f.useEffect(()=>{var h,c;if(!Dr(a,n)||((c=(h=window.navigator)==null?void 0:h.connection)==null?void 0:c.saveData)===!0)return;function i(m){let g=m.tagName==="FORM"?m.getAttribute("action"):m.getAttribute("href");if(!g)return;let R=m.tagName==="A"?m.pathname:new URL(g,window.location.origin).pathname;Ft.has(R)||It.add(R)}async function l(){document.querySelectorAll("a[data-discover], form[data-discover]").forEach(i);let m=Array.from(It.keys()).filter(g=>Ft.has(g)?(It.delete(g),!1):!0);if(m.length!==0)try{await pa(m,null,t,r,n,o,e.basename,a.manifestPath,e.patchRoutes)}catch(g){console.error("Failed to fetch manifest patches",g)}}let s=kl(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])}function Nl(e,t){let r=e||"/__manifest";return t==null?r:`${t}${r}`.replace(/\/+/g,"/")}var nr="react-router-manifest-version";async function pa(e,t,r,n,a,o,i,l,s,u){const h=new URLSearchParams;h.set("paths",e.sort().join(",")),h.set("version",r.version);let c=new URL(Nl(l,i),window.location.origin);if(c.search=h.toString(),c.toString().length>Al){It.clear();return}let m;try{let E=await fetch(c,{signal:u});if(E.ok){if(E.status===204&&E.headers.has("X-Remix-Reload-Document")){if(!t){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.");return}try{if(sessionStorage.getItem(nr)===r.version){console.error("Unable to discover routes due to manifest version mismatch.");return}sessionStorage.setItem(nr,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())}else throw new Error(`${E.status} ${E.statusText}`);try{sessionStorage.removeItem(nr)}catch{}m=await E.json()}catch(E){if(u!=null&&u.aborted)return;throw E}let g=new Set(Object.keys(r.routes)),R=Object.values(m).reduce((E,x)=>(x&&!g.has(x.id)&&(E[x.id]=x),E),{});Object.assign(r.routes,R),e.forEach(E=>$l(E,Ft));let b=new Set;Object.values(R).forEach(E=>{E&&(!E.parentId||!R[E.parentId])&&b.add(E.parentId)}),b.forEach(E=>s(E||null,Mr(R,n,null,a,o,E)))}function $l(e,t){if(t.size>=Il){let r=t.values().next().value;t.delete(r)}t.add(e)}function kl(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}function _r(){let e=f.useContext(Je);return we(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Ut(){let e=f.useContext(et);return we(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Ht=f.createContext(void 0);Ht.displayName="FrameworkContext";function tt(){let e=f.useContext(Ht);return we(e,"You must render this element inside a <HydratedRouter> element"),e}function jl(e,t){let r=f.useContext(Ht),[n,a]=f.useState(!1),[o,i]=f.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:h,onTouchStart:c}=t,m=f.useRef(null);f.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let b=x=>{x.forEach(S=>{i(S.isIntersecting)})},E=new IntersectionObserver(b,{threshold:.5});return m.current&&E.observe(m.current),()=>{E.disconnect()}}},[e]),f.useEffect(()=>{if(n){let b=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(b)}}},[n]);let g=()=>{a(!0)},R=()=>{a(!1),i(!1)};return r?e!=="intent"?[o,m,{}]:[o,m,{onFocus:lt(l,g),onBlur:lt(s,R),onMouseEnter:lt(u,g),onMouseLeave:lt(h,R),onTouchStart:lt(c,g)}]:[!1,m,{}]}function lt(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Or(e,t,r){if(r&&!Nt)return[e[0]];if(t){let n=e.findIndex(a=>t[a.route.id]!==void 0);return e.slice(0,n+1)}return e}var Cn="data-react-router-critical-css";function vs({nonce:e,crossOrigin:t}){let{isSpaMode:r,manifest:n,routeModules:a,criticalCss:o}=tt(),{errors:i,matches:l}=Ut(),s=Or(l,i,r),u=f.useMemo(()=>Rl(s,a,n),[s,a,n]);return f.createElement(f.Fragment,null,typeof o=="string"?f.createElement("style",{[Cn]:"",nonce:e,dangerouslySetInnerHTML:{__html:o}}):null,typeof o=="object"?f.createElement("link",{[Cn]:"",rel:"stylesheet",href:o.href,nonce:e,crossOrigin:t}):null,u.map(({key:h,link:c})=>Pr(c)?f.createElement(ya,{key:h,nonce:e,...c,crossOrigin:c.crossOrigin??t}):f.createElement("link",{key:h,nonce:e,...c,crossOrigin:c.crossOrigin??t})))}function ya({page:e,...t}){let{router:r}=_r(),n=f.useMemo(()=>Ae(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?f.createElement(Hl,{page:e,matches:n,...t}):null}function Ul(e){let{manifest:t,routeModules:r}=tt(),[n,a]=f.useState([]);return f.useEffect(()=>{let o=!1;return Cl(e,t,r).then(i=>{o||a(i)}),()=>{o=!0}},[e,t,r]),n}function Hl({page:e,matches:t,...r}){let n=xe(),{future:a,manifest:o,routeModules:i}=tt(),{basename:l}=_r(),{loaderData:s,matches:u}=Ut(),h=f.useMemo(()=>bn(e,t,u,o,n,"data"),[e,t,u,o,n]),c=f.useMemo(()=>bn(e,t,u,o,n,"assets"),[e,t,u,o,n]),m=f.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let b=new Set,E=!1;if(t.forEach(S=>{var A;let _=o.routes[S.route.id];!_||!_.hasLoader||(!h.some(P=>P.route.id===S.route.id)&&S.route.id in s&&((A=i[S.route.id])!=null&&A.shouldRevalidate)||_.hasClientLoader?E=!0:b.add(S.route.id))}),b.size===0)return[];let x=la(e,l,a.unstable_trailingSlashAwareDataRequests,"data");return E&&b.size>0&&x.searchParams.set("_routes",t.filter(S=>b.has(S.route.id)).map(S=>S.route.id).join(",")),[x.pathname+x.search]},[l,a.unstable_trailingSlashAwareDataRequests,s,n,o,h,t,e,i]),g=f.useMemo(()=>Tr(c,o),[c,o]),R=Ul(c);return f.createElement(f.Fragment,null,m.map(b=>f.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...r})),g.map(b=>f.createElement("link",{key:b,rel:"modulepreload",href:b,...r})),R.map(({key:b,link:E})=>f.createElement("link",{key:b,nonce:r.nonce,...E,crossOrigin:E.crossOrigin??r.crossOrigin})))}function gs(){let{isSpaMode:e,routeModules:t}=tt(),{errors:r,matches:n,loaderData:a}=Ut(),o=xe(),i=Or(n,r,e),l=null;r&&(l=r[i[i.length-1].route.id]);let s=[],u=null,h=[];for(let c=0;c<i.length;c++){let m=i[c],g=m.route.id,R=a[g],b=m.params,E=t[g],x=[],S={id:g,data:R,loaderData:R,meta:[],params:m.params,pathname:m.pathname,handle:m.route.handle,error:l};if(h[c]=S,E!=null&&E.meta?x=typeof E.meta=="function"?E.meta({data:R,loaderData:R,params:b,location:o,matches:h,error:l}):Array.isArray(E.meta)?[...E.meta]:E.meta:u&&(x=[...u]),x=x||[],!Array.isArray(x))throw new Error("The route at "+m.route.path+` returns an invalid value. All route meta functions must return an array of meta objects.
|
|
29
|
+
`}}))}function ya(e){let t={};return Object.values(e).forEach(r=>{if(r){let n=r.parentId||"";t[n]||(t[n]=[]),t[n].push(r)}}),t}function Dl(e,t,r){let n=va(t),a=t.HydrateFallback&&(!r||e.id==="root")?t.HydrateFallback:e.id==="root"?Ml:void 0,o=t.ErrorBoundary?t.ErrorBoundary:e.id==="root"?()=>d.createElement(Ea,{error:Pr()}):void 0;return e.id==="root"&&t.Layout?{...n?{element:d.createElement(t.Layout,null,d.createElement(n,null))}:{Component:n},...o?{errorElement:d.createElement(t.Layout,null,d.createElement(o,null))}:{ErrorBoundary:o},...a?{hydrateFallbackElement:d.createElement(t.Layout,null,d.createElement(a,null))}:{HydrateFallback:a}}:{Component:n,ErrorBoundary:o,HydrateFallback:a}}function ys(e,t,r,n,a,o){return Dr(t,r,n,a,o,"",ya(t),e)}function Tt(e,t){if(e==="loader"&&!t.hasLoader||e==="action"&&!t.hasAction){let n=`You are trying to call ${e==="action"?"serverAction()":"serverLoader()"} on a route that does not have a server ${e} (routeId: "${t.id}")`;throw console.error(n),new je(400,"Bad Request",new Error(n),!0)}}function rr(e,t){let r=e==="clientAction"?"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 je(405,"Method Not Allowed",new Error(n),!0)}function Dr(e,t,r,n,a,o="",i=ya(e),l){return(i[o]||[]).map(s=>{var S,_,A;let u=t[s.id];function h(P){return we(typeof P=="function","No single fetch function available for route handler"),P()}function c(P){return s.hasLoader?h(P):Promise.resolve(null)}function m(P){if(!s.hasAction)throw rr("action",s.id);return h(P)}function g(P){import(P)}function R(P){P.clientActionModule&&g(P.clientActionModule),P.clientLoaderModule&&g(P.clientLoaderModule)}async function b(P){let D=t[s.id],y=D?ha(s,D):Promise.resolve();try{return P()}finally{await y}}let E={id:s.id,index:s.index,path:s.path};if(u){Object.assign(E,{...E,...Dl(s,u,a),middleware:u.clientMiddleware,handle:u.handle,shouldRevalidate:Cn(E.path,u,s,n,l)});let P=r&&r.loaderData&&s.id in r.loaderData,D=P?(S=r==null?void 0:r.loaderData)==null?void 0:S[s.id]:void 0,y=r&&r.errors&&s.id in r.errors,M=y?(_=r==null?void 0:r.errors)==null?void 0:_[s.id]:void 0,F=l==null&&(((A=u.clientLoader)==null?void 0:A.hydrate)===!0||!s.hasLoader);E.loader=async({request:J,params:K,context:ae,unstable_pattern:le},Q)=>{try{return await b(async()=>(we(u,"No `routeModule` available for critical-route loader"),u.clientLoader?u.clientLoader({request:J,params:K,context:ae,unstable_pattern:le,async serverLoader(){if(Tt("loader",s),F){if(P)return D;if(y)throw M}return c(Q)}}):c(Q)))}finally{F=!1}},E.loader.hydrate=Il(s.id,u.clientLoader,s.hasLoader,a),E.action=({request:J,params:K,context:ae,unstable_pattern:le},Q)=>b(async()=>{if(we(u,"No `routeModule` available for critical-route action"),!u.clientAction){if(a)throw rr("clientAction",s.id);return m(Q)}return u.clientAction({request:J,params:K,context:ae,unstable_pattern:le,async serverAction(){return Tt("action",s),m(Q)}})})}else{s.hasClientLoader||(E.loader=(y,M)=>b(()=>c(M))),s.hasClientAction||(E.action=(y,M)=>b(()=>{if(a)throw rr("clientAction",s.id);return m(M)}));let P;async function D(){return P?await P:(P=(async()=>{(s.clientLoaderModule||s.clientActionModule)&&await new Promise(M=>setTimeout(M,0));let y=Ol(s,t);return R(s),await y})(),await P)}E.lazy={loader:s.hasClientLoader?async()=>{let{clientLoader:y}=s.clientLoaderModule?await import(s.clientLoaderModule):await D();return we(y,"No `clientLoader` export found"),(M,F)=>y({...M,async serverLoader(){return Tt("loader",s),c(F)}})}:void 0,action:s.hasClientAction?async()=>{let y=s.clientActionModule?import(s.clientActionModule):D();R(s);let{clientAction:M}=await y;return we(M,"No `clientAction` export found"),(F,J)=>M({...F,async serverAction(){return Tt("action",s),m(J)}})}:void 0,middleware:s.hasClientMiddleware?async()=>{let{clientMiddleware:y}=s.clientMiddlewareModule?await import(s.clientMiddlewareModule):await D();return we(y,"No `clientMiddleware` export found"),y}:void 0,shouldRevalidate:async()=>{let y=await D();return Cn(E.path,y,s,n,l)},handle:async()=>(await D()).handle,Component:async()=>(await D()).Component,ErrorBoundary:s.hasErrorBoundary?async()=>(await D()).ErrorBoundary:void 0}}let x=Dr(e,t,r,n,a,s.id,i,l);return x.length>0&&(E.children=x),E})}function Cn(e,t,r,n,a){if(a)return _l(r.id,t.shouldRevalidate,a);if(!n&&r.hasLoader&&!r.hasClientLoader){let o=e?_n(e)[1].map(l=>l.paramName):[];const i=l=>o.some(s=>l.currentParams[s]!==l.nextParams[s]);if(t.shouldRevalidate){let l=t.shouldRevalidate;return s=>l({...s,defaultShouldRevalidate:i(s)})}else return l=>i(l)}return t.shouldRevalidate}function _l(e,t,r){let n=!1;return a=>n?t?t(a):a.defaultShouldRevalidate:(n=!0,r.has(e))}async function Ol(e,t){let r=da(e,t),n=Sl(e),a=await r;return await Promise.all([n,ha(e,a)]),{Component:va(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}}function va(e){if(e.default==null)return;if(!(typeof e.default=="object"&&Object.keys(e.default).length===0))return e.default}function Il(e,t,r,n){return n&&e!=="root"||t!=null&&(t.hydrate===!0||r!==!0)}var It=new Set,Al=1e3,Ft=new Set,Fl=7680;function _r(e,t){return e.mode==="lazy"&&t===!0}function Nl({sri:e,...t},r){let n=new Set(r.state.matches.map(l=>l.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(l=>{let s=Ae(r.routes,l,r.basename);s&&s.forEach(u=>n.add(u.route.id))});let i=[...n].reduce((l,s)=>Object.assign(l,{[s]:t.routes[s]}),{});return{...t,routes:i,sri:e?!0:void 0}}function vs(e,t,r,n,a,o){if(_r(n,r))return async({path:i,patch:l,signal:s,fetcherKey:u})=>{Ft.has(i)||await ga([i],u?window.location.href:i,e,t,r,a,o,n.manifestPath,l,s)}}function gs(e,t,r,n,a,o){d.useEffect(()=>{var h,c;if(!_r(a,n)||((c=(h=window.navigator)==null?void 0:h.connection)==null?void 0:c.saveData)===!0)return;function i(m){let g=m.tagName==="FORM"?m.getAttribute("action"):m.getAttribute("href");if(!g)return;let R=m.tagName==="A"?m.pathname:new URL(g,window.location.origin).pathname;Ft.has(R)||It.add(R)}async function l(){document.querySelectorAll("a[data-discover], form[data-discover]").forEach(i);let m=Array.from(It.keys()).filter(g=>Ft.has(g)?(It.delete(g),!1):!0);if(m.length!==0)try{await ga(m,null,t,r,n,o,e.basename,a.manifestPath,e.patchRoutes)}catch(g){console.error("Failed to fetch manifest patches",g)}}let s=jl(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])}function $l(e,t){let r=e||"/__manifest";return t==null?r:`${t}${r}`.replace(/\/+/g,"/")}var nr="react-router-manifest-version";async function ga(e,t,r,n,a,o,i,l,s,u){const h=new URLSearchParams;h.set("paths",e.sort().join(",")),h.set("version",r.version);let c=new URL($l(l,i),window.location.origin);if(c.search=h.toString(),c.toString().length>Fl){It.clear();return}let m;try{let E=await fetch(c,{signal:u});if(E.ok){if(E.status===204&&E.headers.has("X-Remix-Reload-Document")){if(!t){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.");return}try{if(sessionStorage.getItem(nr)===r.version){console.error("Unable to discover routes due to manifest version mismatch.");return}sessionStorage.setItem(nr,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())}else throw new Error(`${E.status} ${E.statusText}`);try{sessionStorage.removeItem(nr)}catch{}m=await E.json()}catch(E){if(u!=null&&u.aborted)return;throw E}let g=new Set(Object.keys(r.routes)),R=Object.values(m).reduce((E,x)=>(x&&!g.has(x.id)&&(E[x.id]=x),E),{});Object.assign(r.routes,R),e.forEach(E=>kl(E,Ft));let b=new Set;Object.values(R).forEach(E=>{E&&(!E.parentId||!R[E.parentId])&&b.add(E.parentId)}),b.forEach(E=>s(E||null,Dr(R,n,null,a,o,E)))}function kl(e,t){if(t.size>=Al){let r=t.values().next().value;t.delete(r)}t.add(e)}function jl(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}function Or(){let e=d.useContext(Je);return we(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Ut(){let e=d.useContext(et);return we(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Ht=d.createContext(void 0);Ht.displayName="FrameworkContext";function tt(){let e=d.useContext(Ht);return we(e,"You must render this element inside a <HydratedRouter> element"),e}function Ul(e,t){let r=d.useContext(Ht),[n,a]=d.useState(!1),[o,i]=d.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:h,onTouchStart:c}=t,m=d.useRef(null);d.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let b=x=>{x.forEach(S=>{i(S.isIntersecting)})},E=new IntersectionObserver(b,{threshold:.5});return m.current&&E.observe(m.current),()=>{E.disconnect()}}},[e]),d.useEffect(()=>{if(n){let b=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(b)}}},[n]);let g=()=>{a(!0)},R=()=>{a(!1),i(!1)};return r?e!=="intent"?[o,m,{}]:[o,m,{onFocus:lt(l,g),onBlur:lt(s,R),onMouseEnter:lt(u,g),onMouseLeave:lt(h,R),onTouchStart:lt(c,g)}]:[!1,m,{}]}function lt(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Ir(e,t,r){if(r&&!Nt)return[e[0]];if(t){let n=e.findIndex(a=>t[a.route.id]!==void 0);return e.slice(0,n+1)}return e}var Ln="data-react-router-critical-css";function ws({nonce:e,crossOrigin:t}){let{isSpaMode:r,manifest:n,routeModules:a,criticalCss:o}=tt(),{errors:i,matches:l}=Ut(),s=Ir(l,i,r),u=d.useMemo(()=>bl(s,a,n),[s,a,n]);return d.createElement(d.Fragment,null,typeof o=="string"?d.createElement("style",{[Ln]:"",nonce:e,dangerouslySetInnerHTML:{__html:o}}):null,typeof o=="object"?d.createElement("link",{[Ln]:"",rel:"stylesheet",href:o.href,nonce:e,crossOrigin:t}):null,u.map(({key:h,link:c})=>Tr(c)?d.createElement(wa,{key:h,nonce:e,...c,crossOrigin:c.crossOrigin??t}):d.createElement("link",{key:h,nonce:e,...c,crossOrigin:c.crossOrigin??t})))}function wa({page:e,...t}){let{router:r}=Or(),n=d.useMemo(()=>Ae(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?d.createElement(zl,{page:e,matches:n,...t}):null}function Hl(e){let{manifest:t,routeModules:r}=tt(),[n,a]=d.useState([]);return d.useEffect(()=>{let o=!1;return Ll(e,t,r).then(i=>{o||a(i)}),()=>{o=!0}},[e,t,r]),n}function zl({page:e,matches:t,...r}){let n=xe(),{future:a,manifest:o,routeModules:i}=tt(),{basename:l}=Or(),{loaderData:s,matches:u}=Ut(),h=d.useMemo(()=>Sn(e,t,u,o,n,"data"),[e,t,u,o,n]),c=d.useMemo(()=>Sn(e,t,u,o,n,"assets"),[e,t,u,o,n]),m=d.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let b=new Set,E=!1;if(t.forEach(S=>{var A;let _=o.routes[S.route.id];!_||!_.hasLoader||(!h.some(P=>P.route.id===S.route.id)&&S.route.id in s&&((A=i[S.route.id])!=null&&A.shouldRevalidate)||_.hasClientLoader?E=!0:b.add(S.route.id))}),b.size===0)return[];let x=ca(e,l,a.unstable_trailingSlashAwareDataRequests,"data");return E&&b.size>0&&x.searchParams.set("_routes",t.filter(S=>b.has(S.route.id)).map(S=>S.route.id).join(",")),[x.pathname+x.search]},[l,a.unstable_trailingSlashAwareDataRequests,s,n,o,h,t,e,i]),g=d.useMemo(()=>Mr(c,o),[c,o]),R=Hl(c);return d.createElement(d.Fragment,null,m.map(b=>d.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...r})),g.map(b=>d.createElement("link",{key:b,rel:"modulepreload",href:b,...r})),R.map(({key:b,link:E})=>d.createElement("link",{key:b,nonce:r.nonce,...E,crossOrigin:E.crossOrigin??r.crossOrigin})))}function Es(){let{isSpaMode:e,routeModules:t}=tt(),{errors:r,matches:n,loaderData:a}=Ut(),o=xe(),i=Ir(n,r,e),l=null;r&&(l=r[i[i.length-1].route.id]);let s=[],u=null,h=[];for(let c=0;c<i.length;c++){let m=i[c],g=m.route.id,R=a[g],b=m.params,E=t[g],x=[],S={id:g,data:R,loaderData:R,meta:[],params:m.params,pathname:m.pathname,handle:m.route.handle,error:l};if(h[c]=S,E!=null&&E.meta?x=typeof E.meta=="function"?E.meta({data:R,loaderData:R,params:b,location:o,matches:h,error:l}):Array.isArray(E.meta)?[...E.meta]:E.meta:u&&(x=[...u]),x=x||[],!Array.isArray(x))throw new Error("The route at "+m.route.path+` returns an invalid value. All route meta functions must return an array of meta objects.
|
|
30
30
|
|
|
31
|
-
To reference the meta function API, see https://remix.run/route/meta`);S.meta=x,h[c]=S,s=[...x],u=s}return
|
|
31
|
+
To reference the meta function API, see https://remix.run/route/meta`);S.meta=x,h[c]=S,s=[...x],u=s}return d.createElement(d.Fragment,null,s.flat().map(c=>{if(!c)return null;if("tagName"in c){let{tagName:m,...g}=c;if(!Bl(m))return console.warn(`A meta object uses an invalid tagName: ${m}. Expected either 'link' or 'meta'`),null;let R=m;return d.createElement(R,{key:JSON.stringify(g),...g})}if("title"in c)return d.createElement("title",{key:"title"},String(c.title));if("charset"in c&&(c.charSet??(c.charSet=c.charset),delete c.charset),"charSet"in c&&c.charSet!=null)return typeof c.charSet=="string"?d.createElement("meta",{key:"charSet",charSet:c.charSet}):null;if("script:ld+json"in c)try{let m=JSON.stringify(c["script:ld+json"]);return d.createElement("script",{key:`script:ld+json:${m}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:fr(m)}})}catch{return null}return d.createElement("meta",{key:JSON.stringify(c),...c})}))}function Bl(e){return typeof e=="string"&&/^(meta|link)$/.test(e)}var Nt=!1;function Wl(){Nt=!0}function Yl(e){let{manifest:t,serverHandoffString:r,isSpaMode:n,renderMeta:a,routeDiscovery:o,ssr:i}=tt(),{router:l,static:s,staticContext:u}=Or(),{matches:h}=Ut(),c=Kn(),m=_r(o,i);a&&(a.didRenderScripts=!0);let g=Ir(h,null,n);d.useEffect(()=>{Wl()},[]);let R=d.useMemo(()=>{var A;if(c)return null;let S=u?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",_=s?`${(A=t.hmr)!=null&&A.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${m?"":`import ${JSON.stringify(t.url)}`};
|
|
32
32
|
${g.map((P,D)=>{let y=`route${D}`,M=t.routes[P.route.id];we(M,`Route ${P.route.id} not found in manifest`);let{clientActionModule:F,clientLoaderModule:J,clientMiddlewareModule:K,hydrateFallbackModule:ae,module:le}=M,Q=[...F?[{module:F,varName:`${y}_clientAction`}]:[],...J?[{module:J,varName:`${y}_clientLoader`}]:[],...K?[{module:K,varName:`${y}_clientMiddleware`}]:[],...ae?[{module:ae,varName:`${y}_HydrateFallback`}]:[],{module:le,varName:`${y}_main`}];if(Q.length===1)return`import * as ${y} from ${JSON.stringify(le)};`;let ue=Q.map(ee=>`import * as ${ee.varName} from "${ee.module}";`).join(`
|
|
33
33
|
`),X=`const ${y} = {${Q.map(ee=>`...${ee.varName}`).join(",")}};`;return[ue,X].join(`
|
|
34
34
|
`)}).join(`
|
|
35
35
|
`)}
|
|
36
|
-
${m?`window.__reactRouterManifest = ${JSON.stringify(
|
|
36
|
+
${m?`window.__reactRouterManifest = ${JSON.stringify(Nl(t,l),null,2)};`:""}
|
|
37
37
|
window.__reactRouterRouteModules = {${g.map((P,D)=>`${JSON.stringify(P.route.id)}:route${D}`).join(",")}};
|
|
38
38
|
|
|
39
|
-
import(${JSON.stringify(t.entry.module)});`:" ";return
|
|
39
|
+
import(${JSON.stringify(t.entry.module)});`:" ";return d.createElement(d.Fragment,null,d.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:S},type:void 0}),d.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:_},type:"module",async:!0}))},[]),b=Nt||c?[]:Vl(t.entry.imports.concat(Mr(g,t,{includeHydrateFallback:!0}))),E=typeof t.sri=="object"?t.sri:{};return ur(!c,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),Nt||c?null:d.createElement(d.Fragment,null,typeof t.sri=="object"?d.createElement("script",{...e,"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:E})}}):null,m?null:d.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:E[t.url],suppressHydrationWarning:!0}),d.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:E[t.entry.module],suppressHydrationWarning:!0}),b.map(x=>d.createElement("link",{key:x,rel:"modulepreload",href:x,crossOrigin:e.crossOrigin,integrity:E[x],suppressHydrationWarning:!0})),R)}function Vl(e){return[...new Set(e)]}function Jl(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var Rs=class extends d.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?d.createElement(Ea,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function Ea({error:e,isOutsideRemixApp:t}){console.error(e);let r=d.createElement("script",{dangerouslySetInnerHTML:{__html:`
|
|
40
40
|
console.log(
|
|
41
41
|
"💿 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."
|
|
42
42
|
);
|
|
43
|
-
`}});if(Ve(e))return f.createElement(mr,{title:"Unhandled Thrown Response!"},f.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),r);let n;if(e instanceof Error)n=e;else{let a=e==null?"Unknown Error":typeof e=="object"&&"toString"in e?e.toString():JSON.stringify(e);n=new Error(a)}return f.createElement(mr,{title:"Application Error!",isOutsideRemixApp:t},f.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),f.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},n.stack),r)}function mr({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){var o;let{routeModules:a}=tt();return(o=a.root)!=null&&o.Layout&&!r?n:f.createElement("html",{lang:"en"},f.createElement("head",null,f.createElement("meta",{charSet:"utf-8"}),f.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),f.createElement("title",null,e)),f.createElement("body",null,f.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,t?f.createElement(Wl,null):null)))}var Jl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Jl&&(window.__reactRouterVersion="7.13.0")}catch{}var ga=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wa=f.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:a,reloadDocument:o,replace:i,state:l,target:s,to:u,preventScrollReset:h,viewTransition:c,unstable_defaultShouldRevalidate:m,...g},R){let{basename:b,unstable_useTransitions:E}=f.useContext(Ee),x=typeof u=="string"&&ga.test(u),S=An(u,b);u=S.to;let _=li(u,{relative:a}),[A,P,D]=jl(n,g),y=Xl(u,{replace:i,state:l,target:s,preventScrollReset:h,relative:a,viewTransition:c,unstable_defaultShouldRevalidate:m,unstable_useTransitions:E});function M(J){t&&t(J),J.defaultPrevented||y(J)}let F=f.createElement("a",{...g,...D,href:S.absoluteURL||_,onClick:S.isExternal||o?t:M,ref:Vl(R,P),target:s,"data-discover":!x&&r==="render"?"true":void 0});return A&&!x?f.createElement(f.Fragment,null,F,f.createElement(ya,{page:_})):F});wa.displayName="Link";var Gl=f.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:a=!1,style:o,to:i,viewTransition:l,children:s,...u},h){let c=yt(i,{relative:u.relative}),m=xe(),g=f.useContext(et),{navigator:R,basename:b}=f.useContext(Ee),E=g!=null&&rs(c)&&l===!0,x=R.encodeLocation?R.encodeLocation(c).pathname:c.pathname,S=m.pathname,_=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;r||(S=S.toLowerCase(),_=_?_.toLowerCase():null,x=x.toLowerCase()),_&&b&&(_=be(_,b)||_);const A=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let P=S===x||!a&&S.startsWith(x)&&S.charAt(A)==="/",D=_!=null&&(_===x||!a&&_.startsWith(x)&&_.charAt(x.length)==="/"),y={isActive:P,isPending:D,isTransitioning:E},M=P?t:void 0,F;typeof n=="function"?F=n(y):F=[n,P?"active":null,D?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let J=typeof o=="function"?o(y):o;return f.createElement(wa,{...u,"aria-current":M,className:F,ref:h,style:J,to:i,viewTransition:l},typeof s=="function"?s(y):s)});Gl.displayName="NavLink";var Ea=f.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:i=_t,action:l,onSubmit:s,relative:u,preventScrollReset:h,viewTransition:c,unstable_defaultShouldRevalidate:m,...g},R)=>{let{unstable_useTransitions:b}=f.useContext(Ee),E=Sa(),x=Zl(l,{relative:u}),S=i.toLowerCase()==="get"?"get":"post",_=typeof l=="string"&&ga.test(l),A=P=>{if(s&&s(P),P.defaultPrevented)return;P.preventDefault();let D=P.nativeEvent.submitter,y=(D==null?void 0:D.getAttribute("formmethod"))||i,M=()=>E(D||P.currentTarget,{fetcherKey:t,method:y,navigate:r,replace:a,state:o,relative:u,preventScrollReset:h,viewTransition:c,unstable_defaultShouldRevalidate:m});b&&r!==!1?f.startTransition(()=>M()):M()};return f.createElement("form",{ref:R,method:S,action:x,onSubmit:n?s:A,...g,"data-discover":!_&&e==="render"?"true":void 0})});Ea.displayName="Form";function Kl({getKey:e,storageKey:t,...r}){let n=f.useContext(Ht),{basename:a}=f.useContext(Ee),o=xe(),i=xr();es({getKey:e,storageKey:t});let l=f.useMemo(()=>{if(!n||!e)return null;let u=yr(o,i,a,e);return u!==o.key?u:null},[]);if(!n||n.isSpaMode)return null;let s=((u,h)=>{if(!window.history.state||!window.history.state.key){let c=Math.random().toString(32).slice(2);window.history.replaceState({key:c},"")}try{let m=JSON.parse(sessionStorage.getItem(u)||"{}")[h||window.history.state.key];typeof m=="number"&&window.scrollTo(0,m)}catch(c){console.error(c),sessionStorage.removeItem(u)}}).toString();return f.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${s})(${fr(JSON.stringify(t||pr))}, ${fr(JSON.stringify(l))})`}})}Kl.displayName="ScrollRestoration";function Ra(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function zt(e){let t=f.useContext(Je);return W(t,Ra(e)),t}function ba(e){let t=f.useContext(et);return W(t,Ra(e)),t}function Xl(e,{target:t,replace:r,state:n,preventScrollReset:a,relative:o,viewTransition:i,unstable_defaultShouldRevalidate:l,unstable_useTransitions:s}={}){let u=Qn(),h=xe(),c=yt(e,{relative:o});return f.useCallback(m=>{if(Ni(m,t)){m.preventDefault();let g=r!==void 0?r:Me(h)===Me(c),R=()=>u(e,{replace:g,state:n,preventScrollReset:a,relative:o,viewTransition:i,unstable_defaultShouldRevalidate:l});s?f.startTransition(()=>R()):R()}},[h,u,c,r,n,t,e,a,o,i,l,s])}function Es(e){oe(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=f.useRef(cr(e)),r=f.useRef(!1),n=xe(),a=f.useMemo(()=>$i(n.search,r.current?null:t.current),[n.search]),o=Qn(),i=f.useCallback((l,s)=>{const u=cr(typeof l=="function"?l(new URLSearchParams(a)):l);r.current=!0,o("?"+u,s)},[o,a]);return[a,i]}var ql=0,Ql=()=>`__${String(++ql)}__`;function Sa(){let{router:e}=zt("useSubmit"),{basename:t}=f.useContext(Ee),r=wi(),n=e.fetch,a=e.navigate;return f.useCallback(async(o,i={})=>{let{action:l,method:s,encType:u,formData:h,body:c}=Ui(o,t);if(i.navigate===!1){let m=i.fetcherKey||Ql();await n(m,r,i.action||l,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:h,body:c,formMethod:i.method||s,formEncType:i.encType||u,flushSync:i.flushSync})}else await a(i.action||l,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:h,body:c,formMethod:i.method||s,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[n,a,t,r])}function Zl(e,{relative:t}={}){let{basename:r}=f.useContext(Ee),n=f.useContext(Le);W(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),o={...yt(e||".",{relative:t})},i=xe();if(e==null){o.search=i.search;let l=new URLSearchParams(o.search),s=l.getAll("index");if(s.some(h=>h==="")){l.delete("index"),s.filter(c=>c).forEach(c=>l.append("index",c));let h=l.toString();o.search=h?`?${h}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Te([r,o.pathname])),Me(o)}function Rs({key:e}={}){var P;let{router:t}=zt("useFetcher"),r=ba("useFetcher"),n=f.useContext(Sr),a=f.useContext(Le),o=(P=a.matches[a.matches.length-1])==null?void 0:P.route.id;W(n,"useFetcher must be used inside a FetchersContext"),W(a,"useFetcher must be used inside a RouteContext"),W(o!=null,'useFetcher can only be used on routes that contain a unique "id"');let i=f.useId(),[l,s]=f.useState(e||i);e&&e!==l&&s(e);let{deleteFetcher:u,getFetcher:h,resetFetcher:c,fetch:m}=t;f.useEffect(()=>(h(l),()=>u(l)),[u,h,l]);let g=f.useCallback(async(D,y)=>{W(o,"No routeId available for fetcher.load()"),await m(l,o,D,y)},[l,o,m]),R=Sa(),b=f.useCallback(async(D,y)=>{await R(D,{...y,navigate:!1,fetcherKey:l})},[l,R]),E=f.useCallback(D=>c(l,D),[c,l]),x=f.useMemo(()=>{let D=f.forwardRef((y,M)=>f.createElement(Ea,{...y,navigate:!1,fetcherKey:l,ref:M}));return D.displayName="fetcher.Form",D},[l]),S=r.fetchers.get(l)||kn,_=n.get(l);return f.useMemo(()=>({Form:x,submit:b,load:g,reset:E,...S,data:_}),[x,b,g,E,S,_])}var pr="react-router-scroll-positions",Mt={};function yr(e,t,r,n){let a=null;return n&&(r!=="/"?a=n({...e,pathname:be(e.pathname,r)||e.pathname},t):a=n(e,t)),a==null&&(a=e.key),a}function es({getKey:e,storageKey:t}={}){let{router:r}=zt("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:a}=ba("useScrollRestoration"),{basename:o}=f.useContext(Ee),i=xe(),l=xr(),s=Ei();f.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),ts(f.useCallback(()=>{if(s.state==="idle"){let u=yr(i,l,o,e);Mt[u]=window.scrollY}try{sessionStorage.setItem(t||pr,JSON.stringify(Mt))}catch(u){oe(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[s.state,e,o,i,l,t])),typeof document<"u"&&(f.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||pr);u&&(Mt=JSON.parse(u))}catch{}},[t]),f.useLayoutEffect(()=>{let u=r==null?void 0:r.enableScrollRestoration(Mt,()=>window.scrollY,e?(h,c)=>yr(h,c,o,e):void 0);return()=>u&&u()},[r,o,e]),f.useLayoutEffect(()=>{if(n!==!1){if(typeof n=="number"){window.scrollTo(0,n);return}try{if(i.hash){let u=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{oe(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[i,n,a]))}function ts(e,t){let{capture:r}={};f.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}function rs(e,{relative:t}={}){let r=f.useContext(br);W(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=zt("useViewTransitionState"),a=yt(e,{relative:t});if(!r.isTransitioning)return!1;let o=be(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=be(r.nextLocation.pathname,n)||r.nextLocation.pathname;return At(a.pathname,i)!=null||At(a.pathname,o)!=null}export{ms as A,ss as B,us as C,vs as D,je as E,Ht as F,Wl as G,ns as H,wa as L,gs as M,dl as N,ds as O,Wa as R,Kl as S,Qn as a,Es as b,xe as c,Rs as d,bi as e,is as f,Ha as g,Ba as h,ls as i,di as j,Ve as k,W as l,Ae as m,ys as n,ws as o,cs as p,El as q,f as r,Ol as s,Mr as t,Ri as u,os as v,fs as w,ps as x,hs as y,as as z};
|
|
43
|
+
`}});if(Ve(e))return d.createElement(mr,{title:"Unhandled Thrown Response!"},d.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),r);let n;if(e instanceof Error)n=e;else{let a=e==null?"Unknown Error":typeof e=="object"&&"toString"in e?e.toString():JSON.stringify(e);n=new Error(a)}return d.createElement(mr,{title:"Application Error!",isOutsideRemixApp:t},d.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),d.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},n.stack),r)}function mr({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){var o;let{routeModules:a}=tt();return(o=a.root)!=null&&o.Layout&&!r?n:d.createElement("html",{lang:"en"},d.createElement("head",null,d.createElement("meta",{charSet:"utf-8"}),d.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),d.createElement("title",null,e)),d.createElement("body",null,d.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,t?d.createElement(Yl,null):null)))}var Gl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Gl&&(window.__reactRouterVersion="7.13.0")}catch{}var Ra=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ba=d.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:a,reloadDocument:o,replace:i,state:l,target:s,to:u,preventScrollReset:h,viewTransition:c,unstable_defaultShouldRevalidate:m,...g},R){let{basename:b,unstable_useTransitions:E}=d.useContext(Ee),x=typeof u=="string"&&Ra.test(u),S=Fn(u,b);u=S.to;let _=ci(u,{relative:a}),[A,P,D]=Ul(n,g),y=ql(u,{replace:i,state:l,target:s,preventScrollReset:h,relative:a,viewTransition:c,unstable_defaultShouldRevalidate:m,unstable_useTransitions:E});function M(J){t&&t(J),J.defaultPrevented||y(J)}let F=d.createElement("a",{...g,...D,href:S.absoluteURL||_,onClick:S.isExternal||o?t:M,ref:Jl(R,P),target:s,"data-discover":!x&&r==="render"?"true":void 0});return A&&!x?d.createElement(d.Fragment,null,F,d.createElement(wa,{page:_})):F});ba.displayName="Link";var Kl=d.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:a=!1,style:o,to:i,viewTransition:l,children:s,...u},h){let c=yt(i,{relative:u.relative}),m=xe(),g=d.useContext(et),{navigator:R,basename:b}=d.useContext(Ee),E=g!=null&&ns(c)&&l===!0,x=R.encodeLocation?R.encodeLocation(c).pathname:c.pathname,S=m.pathname,_=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;r||(S=S.toLowerCase(),_=_?_.toLowerCase():null,x=x.toLowerCase()),_&&b&&(_=be(_,b)||_);const A=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let P=S===x||!a&&S.startsWith(x)&&S.charAt(A)==="/",D=_!=null&&(_===x||!a&&_.startsWith(x)&&_.charAt(x.length)==="/"),y={isActive:P,isPending:D,isTransitioning:E},M=P?t:void 0,F;typeof n=="function"?F=n(y):F=[n,P?"active":null,D?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let J=typeof o=="function"?o(y):o;return d.createElement(ba,{...u,"aria-current":M,className:F,ref:h,style:J,to:i,viewTransition:l},typeof s=="function"?s(y):s)});Kl.displayName="NavLink";var Sa=d.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:i=_t,action:l,onSubmit:s,relative:u,preventScrollReset:h,viewTransition:c,unstable_defaultShouldRevalidate:m,...g},R)=>{let{unstable_useTransitions:b}=d.useContext(Ee),E=xa(),x=es(l,{relative:u}),S=i.toLowerCase()==="get"?"get":"post",_=typeof l=="string"&&Ra.test(l),A=P=>{if(s&&s(P),P.defaultPrevented)return;P.preventDefault();let D=P.nativeEvent.submitter,y=(D==null?void 0:D.getAttribute("formmethod"))||i,M=()=>E(D||P.currentTarget,{fetcherKey:t,method:y,navigate:r,replace:a,state:o,relative:u,preventScrollReset:h,viewTransition:c,unstable_defaultShouldRevalidate:m});b&&r!==!1?d.startTransition(()=>M()):M()};return d.createElement("form",{ref:R,method:S,action:x,onSubmit:n?s:A,...g,"data-discover":!_&&e==="render"?"true":void 0})});Sa.displayName="Form";function Xl({getKey:e,storageKey:t,...r}){let n=d.useContext(Ht),{basename:a}=d.useContext(Ee),o=xe(),i=xr();ts({getKey:e,storageKey:t});let l=d.useMemo(()=>{if(!n||!e)return null;let u=yr(o,i,a,e);return u!==o.key?u:null},[]);if(!n||n.isSpaMode)return null;let s=((u,h)=>{if(!window.history.state||!window.history.state.key){let c=Math.random().toString(32).slice(2);window.history.replaceState({key:c},"")}try{let m=JSON.parse(sessionStorage.getItem(u)||"{}")[h||window.history.state.key];typeof m=="number"&&window.scrollTo(0,m)}catch(c){console.error(c),sessionStorage.removeItem(u)}}).toString();return d.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${s})(${fr(JSON.stringify(t||pr))}, ${fr(JSON.stringify(l))})`}})}Xl.displayName="ScrollRestoration";function Ca(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function zt(e){let t=d.useContext(Je);return W(t,Ca(e)),t}function La(e){let t=d.useContext(et);return W(t,Ca(e)),t}function ql(e,{target:t,replace:r,state:n,preventScrollReset:a,relative:o,viewTransition:i,unstable_defaultShouldRevalidate:l,unstable_useTransitions:s}={}){let u=Zn(),h=xe(),c=yt(e,{relative:o});return d.useCallback(m=>{if($i(m,t)){m.preventDefault();let g=r!==void 0?r:Me(h)===Me(c),R=()=>u(e,{replace:g,state:n,preventScrollReset:a,relative:o,viewTransition:i,unstable_defaultShouldRevalidate:l});s?d.startTransition(()=>R()):R()}},[h,u,c,r,n,t,e,a,o,i,l,s])}function bs(e){oe(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=d.useRef(cr(e)),r=d.useRef(!1),n=xe(),a=d.useMemo(()=>ki(n.search,r.current?null:t.current),[n.search]),o=Zn(),i=d.useCallback((l,s)=>{const u=cr(typeof l=="function"?l(new URLSearchParams(a)):l);r.current=!0,o("?"+u,s)},[o,a]);return[a,i]}var Ql=0,Zl=()=>`__${String(++Ql)}__`;function xa(){let{router:e}=zt("useSubmit"),{basename:t}=d.useContext(Ee),r=Ri(),n=e.fetch,a=e.navigate;return d.useCallback(async(o,i={})=>{let{action:l,method:s,encType:u,formData:h,body:c}=Hi(o,t);if(i.navigate===!1){let m=i.fetcherKey||Zl();await n(m,r,i.action||l,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:h,body:c,formMethod:i.method||s,formEncType:i.encType||u,flushSync:i.flushSync})}else await a(i.action||l,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:h,body:c,formMethod:i.method||s,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[n,a,t,r])}function es(e,{relative:t}={}){let{basename:r}=d.useContext(Ee),n=d.useContext(Le);W(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),o={...yt(e||".",{relative:t})},i=xe();if(e==null){o.search=i.search;let l=new URLSearchParams(o.search),s=l.getAll("index");if(s.some(h=>h==="")){l.delete("index"),s.filter(c=>c).forEach(c=>l.append("index",c));let h=l.toString();o.search=h?`?${h}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Te([r,o.pathname])),Me(o)}function Ss({key:e}={}){var P;let{router:t}=zt("useFetcher"),r=La("useFetcher"),n=d.useContext(Sr),a=d.useContext(Le),o=(P=a.matches[a.matches.length-1])==null?void 0:P.route.id;W(n,"useFetcher must be used inside a FetchersContext"),W(a,"useFetcher must be used inside a RouteContext"),W(o!=null,'useFetcher can only be used on routes that contain a unique "id"');let i=d.useId(),[l,s]=d.useState(e||i);e&&e!==l&&s(e);let{deleteFetcher:u,getFetcher:h,resetFetcher:c,fetch:m}=t;d.useEffect(()=>(h(l),()=>u(l)),[u,h,l]);let g=d.useCallback(async(D,y)=>{W(o,"No routeId available for fetcher.load()"),await m(l,o,D,y)},[l,o,m]),R=xa(),b=d.useCallback(async(D,y)=>{await R(D,{...y,navigate:!1,fetcherKey:l})},[l,R]),E=d.useCallback(D=>c(l,D),[c,l]),x=d.useMemo(()=>{let D=d.forwardRef((y,M)=>d.createElement(Sa,{...y,navigate:!1,fetcherKey:l,ref:M}));return D.displayName="fetcher.Form",D},[l]),S=r.fetchers.get(l)||jn,_=n.get(l);return d.useMemo(()=>({Form:x,submit:b,load:g,reset:E,...S,data:_}),[x,b,g,E,S,_])}var pr="react-router-scroll-positions",Mt={};function yr(e,t,r,n){let a=null;return n&&(r!=="/"?a=n({...e,pathname:be(e.pathname,r)||e.pathname},t):a=n(e,t)),a==null&&(a=e.key),a}function ts({getKey:e,storageKey:t}={}){let{router:r}=zt("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:a}=La("useScrollRestoration"),{basename:o}=d.useContext(Ee),i=xe(),l=xr(),s=bi();d.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),rs(d.useCallback(()=>{if(s.state==="idle"){let u=yr(i,l,o,e);Mt[u]=window.scrollY}try{sessionStorage.setItem(t||pr,JSON.stringify(Mt))}catch(u){oe(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[s.state,e,o,i,l,t])),typeof document<"u"&&(d.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||pr);u&&(Mt=JSON.parse(u))}catch{}},[t]),d.useLayoutEffect(()=>{let u=r==null?void 0:r.enableScrollRestoration(Mt,()=>window.scrollY,e?(h,c)=>yr(h,c,o,e):void 0);return()=>u&&u()},[r,o,e]),d.useLayoutEffect(()=>{if(n!==!1){if(typeof n=="number"){window.scrollTo(0,n);return}try{if(i.hash){let u=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{oe(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[i,n,a]))}function rs(e,t){let{capture:r}={};d.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}function ns(e,{relative:t}={}){let r=d.useContext(br);W(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=zt("useViewTransitionState"),a=yt(e,{relative:t});if(!r.isTransitioning)return!1;let o=be(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=be(r.nextLocation.pathname,n)||r.nextLocation.pathname;return At(a.pathname,i)!=null||At(a.pathname,o)!=null}export{ys as A,us as B,cs as C,ms as D,je as E,Ht as F,ws as G,Yl as H,Pr as I,as as J,ba as L,Es as M,fl as N,fs as O,Ja as R,Xl as S,Zn as a,bs as b,xe as c,Ss as d,aa as e,ls as f,Wa as g,Va as h,ss as i,ea as j,Ve as k,W as l,Ae as m,gs as n,Rs as o,ds as p,Rl as q,d as r,Il as s,Dr as t,na as u,is as v,hs as w,vs as x,ps as y,os as z};
|