@cyberskill/cyber-editor 3.9.0 → 3.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/dist/_tsup-dts-rollup.d.cts +196 -0
  2. package/dist/_tsup-dts-rollup.d.ts +196 -0
  3. package/dist/index.cjs +1 -0
  4. package/dist/index.d.cts +20 -0
  5. package/dist/index.d.ts +20 -0
  6. package/dist/index.js +1 -0
  7. package/dist/modules/accordion/accordion-extension.cjs +1 -0
  8. package/dist/modules/accordion/accordion-extension.d.cts +1 -0
  9. package/dist/modules/accordion/accordion-extension.d.ts +1 -0
  10. package/dist/modules/accordion/accordion-extension.js +1 -0
  11. package/dist/modules/accordion/accordion-view.component.cjs +1 -0
  12. package/dist/modules/accordion/accordion-view.component.d.cts +1 -0
  13. package/dist/modules/accordion/accordion-view.component.d.ts +1 -0
  14. package/dist/modules/accordion/accordion-view.component.js +1 -0
  15. package/dist/modules/accordion/accordion-view.type.cjs +1 -0
  16. package/dist/modules/accordion/accordion-view.type.d.cts +2 -0
  17. package/dist/modules/accordion/accordion-view.type.d.ts +2 -0
  18. package/dist/modules/accordion/accordion-view.type.js +0 -0
  19. package/dist/modules/accordion/index.cjs +1 -0
  20. package/dist/modules/accordion/index.d.cts +4 -0
  21. package/dist/modules/accordion/index.d.ts +4 -0
  22. package/dist/modules/accordion/index.js +1 -0
  23. package/dist/modules/color-picker/color-picker.component.cjs +1 -0
  24. package/dist/modules/color-picker/color-picker.component.d.cts +1 -0
  25. package/dist/modules/color-picker/color-picker.component.d.ts +1 -0
  26. package/dist/modules/color-picker/color-picker.component.js +1 -0
  27. package/dist/modules/color-picker/color-picker.type.cjs +1 -0
  28. package/dist/modules/color-picker/color-picker.type.d.cts +1 -0
  29. package/dist/modules/color-picker/color-picker.type.d.ts +1 -0
  30. package/dist/modules/color-picker/color-picker.type.js +0 -0
  31. package/dist/modules/color-picker/index.cjs +1 -0
  32. package/dist/modules/color-picker/index.d.cts +2 -0
  33. package/dist/modules/color-picker/index.d.ts +2 -0
  34. package/dist/modules/color-picker/index.js +1 -0
  35. package/dist/modules/editor/editor.component.cjs +1 -0
  36. package/dist/modules/editor/editor.component.d.cts +1 -0
  37. package/dist/modules/editor/editor.component.d.ts +1 -0
  38. package/dist/modules/editor/editor.component.js +1 -0
  39. package/dist/modules/editor/editor.constant.cjs +1 -0
  40. package/dist/modules/editor/editor.constant.d.cts +1 -0
  41. package/dist/modules/editor/editor.constant.d.ts +1 -0
  42. package/dist/modules/editor/editor.constant.js +1 -0
  43. package/dist/modules/editor/editor.module.d.cts +1 -0
  44. package/dist/modules/editor/editor.module.d.ts +1 -0
  45. package/dist/modules/editor/editor.module.scss +313 -0
  46. package/dist/modules/editor/editor.type.cjs +1 -0
  47. package/dist/modules/editor/editor.type.d.cts +1 -0
  48. package/dist/modules/editor/editor.type.d.ts +1 -0
  49. package/dist/modules/editor/editor.type.js +0 -0
  50. package/dist/modules/editor/index.cjs +1 -0
  51. package/dist/modules/editor/index.d.cts +3 -0
  52. package/dist/modules/editor/index.d.ts +3 -0
  53. package/dist/modules/editor/index.js +1 -0
  54. package/dist/modules/heading/heading.component.cjs +1 -0
  55. package/dist/modules/heading/heading.component.d.cts +1 -0
  56. package/dist/modules/heading/heading.component.d.ts +1 -0
  57. package/dist/modules/heading/heading.component.js +1 -0
  58. package/dist/modules/heading/heading.type.cjs +1 -0
  59. package/dist/modules/heading/heading.type.d.cts +1 -0
  60. package/dist/modules/heading/heading.type.d.ts +1 -0
  61. package/dist/modules/heading/heading.type.js +0 -0
  62. package/dist/modules/heading/index.cjs +1 -0
  63. package/dist/modules/heading/index.d.cts +2 -0
  64. package/dist/modules/heading/index.d.ts +2 -0
  65. package/dist/modules/heading/index.js +1 -0
  66. package/dist/modules/home/home.page.cjs +1 -0
  67. package/dist/modules/home/home.page.d.cts +1 -0
  68. package/dist/modules/home/home.page.d.ts +1 -0
  69. package/dist/modules/home/home.page.js +1 -0
  70. package/dist/modules/home/index.cjs +1 -0
  71. package/dist/modules/home/index.d.cts +1 -0
  72. package/dist/modules/home/index.d.ts +1 -0
  73. package/dist/modules/home/index.js +1 -0
  74. package/dist/modules/image/image-view.component.cjs +1 -0
  75. package/dist/modules/image/image-view.component.d.cts +1 -0
  76. package/dist/modules/image/image-view.component.d.ts +1 -0
  77. package/dist/modules/image/image-view.component.js +1 -0
  78. package/dist/modules/image/image-view.type.cjs +1 -0
  79. package/dist/modules/image/image-view.type.d.cts +2 -0
  80. package/dist/modules/image/image-view.type.d.ts +2 -0
  81. package/dist/modules/image/image-view.type.js +0 -0
  82. package/dist/modules/image/image.cjs +1 -0
  83. package/dist/modules/image/image.d.cts +1 -0
  84. package/dist/modules/image/image.d.ts +1 -0
  85. package/dist/modules/image/image.js +1 -0
  86. package/dist/modules/image/index.cjs +1 -0
  87. package/dist/modules/image/index.d.cts +4 -0
  88. package/dist/modules/image/index.d.ts +4 -0
  89. package/dist/modules/image/index.js +1 -0
  90. package/dist/modules/index.cjs +1 -0
  91. package/dist/modules/index.d.cts +20 -0
  92. package/dist/modules/index.d.ts +20 -0
  93. package/dist/modules/index.js +1 -0
  94. package/dist/modules/table/index.cjs +1 -0
  95. package/dist/modules/table/index.d.cts +2 -0
  96. package/dist/modules/table/index.d.ts +2 -0
  97. package/dist/modules/table/index.js +1 -0
  98. package/dist/modules/table/table.component.cjs +1 -0
  99. package/dist/modules/table/table.component.d.cts +1 -0
  100. package/dist/modules/table/table.component.d.ts +1 -0
  101. package/dist/modules/table/table.component.js +1 -0
  102. package/dist/modules/table/table.type.cjs +1 -0
  103. package/dist/modules/table/table.type.d.cts +1 -0
  104. package/dist/modules/table/table.type.d.ts +1 -0
  105. package/dist/modules/table/table.type.js +0 -0
  106. package/dist/modules/toolbar/index.cjs +1 -0
  107. package/dist/modules/toolbar/index.d.cts +2 -0
  108. package/dist/modules/toolbar/index.d.ts +2 -0
  109. package/dist/modules/toolbar/index.js +1 -0
  110. package/dist/modules/toolbar/toolbar.component.cjs +1 -0
  111. package/dist/modules/toolbar/toolbar.component.d.cts +1 -0
  112. package/dist/modules/toolbar/toolbar.component.d.ts +1 -0
  113. package/dist/modules/toolbar/toolbar.component.js +1 -0
  114. package/dist/modules/toolbar/toolbar.custom.component.cjs +1 -0
  115. package/dist/modules/toolbar/toolbar.custom.component.d.cts +1 -0
  116. package/dist/modules/toolbar/toolbar.custom.component.d.ts +1 -0
  117. package/dist/modules/toolbar/toolbar.custom.component.js +1 -0
  118. package/dist/shared/component/color-picker/color-picker.component.cjs +1 -0
  119. package/dist/shared/component/color-picker/color-picker.component.d.cts +1 -0
  120. package/dist/shared/component/color-picker/color-picker.component.d.ts +1 -0
  121. package/dist/shared/component/color-picker/color-picker.component.js +1 -0
  122. package/dist/shared/component/color-picker/color-picker.type.cjs +1 -0
  123. package/dist/shared/component/color-picker/color-picker.type.d.cts +1 -0
  124. package/dist/shared/component/color-picker/color-picker.type.d.ts +1 -0
  125. package/dist/shared/component/color-picker/color-picker.type.js +0 -0
  126. package/dist/shared/component/color-picker/index.cjs +1 -0
  127. package/dist/shared/component/color-picker/index.d.cts +2 -0
  128. package/dist/shared/component/color-picker/index.d.ts +2 -0
  129. package/dist/shared/component/color-picker/index.js +1 -0
  130. package/dist/shared/component/index.cjs +1 -0
  131. package/dist/shared/component/index.d.cts +4 -0
  132. package/dist/shared/component/index.d.ts +4 -0
  133. package/dist/shared/component/index.js +1 -0
  134. package/dist/shared/component/modal-edit/index.cjs +1 -0
  135. package/dist/shared/component/modal-edit/index.d.cts +2 -0
  136. package/dist/shared/component/modal-edit/index.d.ts +2 -0
  137. package/dist/shared/component/modal-edit/index.js +1 -0
  138. package/dist/shared/component/modal-edit/modal-edit.component.cjs +1 -0
  139. package/dist/shared/component/modal-edit/modal-edit.component.d.cts +1 -0
  140. package/dist/shared/component/modal-edit/modal-edit.component.d.ts +1 -0
  141. package/dist/shared/component/modal-edit/modal-edit.component.js +1 -0
  142. package/dist/shared/component/modal-edit/modal-edit.type.cjs +1 -0
  143. package/dist/shared/component/modal-edit/modal-edit.type.d.cts +1 -0
  144. package/dist/shared/component/modal-edit/modal-edit.type.d.ts +1 -0
  145. package/dist/shared/component/modal-edit/modal-edit.type.js +0 -0
  146. package/dist/shared/style/global.css +2 -0
  147. package/dist/shared/style/global.d.cts +1 -0
  148. package/dist/shared/style/global.d.ts +1 -0
  149. package/dist/shared/typescript/style.d.cjs +1 -0
  150. package/dist/shared/typescript/style.d.d.cts +1 -0
  151. package/dist/shared/typescript/style.d.d.ts +1 -0
  152. package/dist/shared/typescript/style.d.js +0 -0
  153. package/package.json +42 -32
  154. package/dist/client/_commonjsHelpers-C6fGbg64.js +0 -6
  155. package/dist/client/_commonjsHelpers-DwGv2jUC.cjs +0 -1
  156. package/dist/client/assets/manifest-e1ae6e39.js +0 -1
  157. package/dist/client/chunk-D4RADZKF-CqCYZIAv.js +0 -6257
  158. package/dist/client/chunk-D4RADZKF-sLhgGPy5.cjs +0 -56
  159. package/dist/client/cyber-editor.cjs.js +0 -259
  160. package/dist/client/cyber-editor.cjs2.js +0 -1
  161. package/dist/client/cyber-editor.cjs3.js +0 -1
  162. package/dist/client/cyber-editor.cjs4.js +0 -604
  163. package/dist/client/cyber-editor.cjs5.js +0 -1
  164. package/dist/client/cyber-editor.css +0 -1
  165. package/dist/client/cyber-editor.es.js +0 -25364
  166. package/dist/client/cyber-editor.es2.js +0 -43
  167. package/dist/client/cyber-editor.es3.js +0 -11
  168. package/dist/client/cyber-editor.es4.js +0 -46769
  169. package/dist/client/cyber-editor.es5.js +0 -11
  170. package/dist/client/index-HJNgKdvE.cjs +0 -5
  171. package/dist/client/index-rkLJDvut.js +0 -156
  172. package/dist/client/index.d.ts +0 -23
  173. package/dist/client/index.html +0 -6
  174. package/dist/client/with-props-Ba4118z_.js +0 -27
  175. package/dist/client/with-props-CuGIah2q.cjs +0 -1
  176. /package/{dist/client → public}/assets/icons/index.ts +0 -0
  177. /package/{dist/client → public}/favicon.svg +0 -0
@@ -1,56 +0,0 @@
1
- "use strict";const da=require("react");function gn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const h=gn(da);var bt={exports:{}},tt={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Fr;function wn(){if(Fr)return tt;Fr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,a,o){var l=null;if(o!==void 0&&(l=""+o),a.key!==void 0&&(l=""+a.key),"key"in a){o={};for(var s in a)s!=="key"&&(o[s]=a[s])}else o=a;return a=o.ref,{$$typeof:e,type:n,key:l,ref:a!==void 0?a:null,props:o}}return tt.Fragment=t,tt.jsx=r,tt.jsxs=r,tt}var rt={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Ir;function En(){return Ir||(Ir=1,process.env.NODE_ENV!=="production"&&function(){function e(S){if(S==null)return null;if(typeof S=="function")return S.$$typeof===G?null:S.displayName||S.name||null;if(typeof S=="string")return S;switch(S){case R:return"Fragment";case b:return"Profiler";case E:return"StrictMode";case L:return"Suspense";case p:return"SuspenseList";case I:return"Activity"}if(typeof S=="object")switch(typeof S.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),S.$$typeof){case g:return"Portal";case M:return(S.displayName||"Context")+".Provider";case P:return(S._context.displayName||"Context")+".Consumer";case T:var F=S.render;return S=S.displayName,S||(S=F.displayName||F.name||"",S=S!==""?"ForwardRef("+S+")":"ForwardRef"),S;case _:return F=S.displayName||null,F!==null?F:e(S.type)||"Memo";case j:F=S._payload,S=S._init;try{return e(S(F))}catch{}}return null}function t(S){return""+S}function r(S){try{t(S);var F=!1}catch{F=!0}if(F){F=console;var J=F.error,K=typeof Symbol=="function"&&Symbol.toStringTag&&S[Symbol.toStringTag]||S.constructor.name||"Object";return J.call(F,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",K),t(S)}}function n(S){if(S===R)return"<>";if(typeof S=="object"&&S!==null&&S.$$typeof===j)return"<...>";try{var F=e(S);return F?"<"+F+">":"<...>"}catch{return"<...>"}}function a(){var S=Q.A;return S===null?null:S.getOwner()}function o(){return Error("react-stack-top-frame")}function l(S){if(oe.call(S,"key")){var F=Object.getOwnPropertyDescriptor(S,"key").get;if(F&&F.isReactWarning)return!1}return S.key!==void 0}function s(S,F){function J(){te||(te=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",F))}J.isReactWarning=!0,Object.defineProperty(S,"key",{get:J,configurable:!0})}function i(){var S=e(this.type);return B[S]||(B[S]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),S=this.props.ref,S!==void 0?S:null}function u(S,F,J,K,le,ce,be,Xe){return J=ce.ref,S={$$typeof:v,type:S,key:F,props:ce,_owner:le},(J!==void 0?J:null)!==null?Object.defineProperty(S,"ref",{enumerable:!1,get:i}):Object.defineProperty(S,"ref",{enumerable:!1,value:null}),S._store={},Object.defineProperty(S._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(S,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(S,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:be}),Object.defineProperty(S,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Xe}),Object.freeze&&(Object.freeze(S.props),Object.freeze(S)),S}function c(S,F,J,K,le,ce,be,Xe){var ne=F.children;if(ne!==void 0)if(K)if(W(ne)){for(K=0;K<ne.length;K++)m(ne[K]);Object.freeze&&Object.freeze(ne)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else m(ne);if(oe.call(F,"key")){ne=e(S);var Ce=Object.keys(F).filter(function(Te){return Te!=="key"});K=0<Ce.length?"{key: someKey, "+Ce.join(": ..., ")+": ...}":"{key: someKey}",ie[ne+K]||(Ce=0<Ce.length?"{"+Ce.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
- let props = %s;
19
- <%s {...props} />
20
- React keys must be passed directly to JSX without using spread:
21
- let props = %s;
22
- <%s key={someKey} {...props} />`,K,ne,Ce,ne),ie[ne+K]=!0)}if(ne=null,J!==void 0&&(r(J),ne=""+J),l(F)&&(r(F.key),ne=""+F.key),"key"in F){J={};for(var re in F)re!=="key"&&(J[re]=F[re])}else J=F;return ne&&s(J,typeof S=="function"?S.displayName||S.name||"Unknown":S),u(S,ne,ce,le,a(),J,be,Xe)}function m(S){typeof S=="object"&&S!==null&&S.$$typeof===v&&S._store&&(S._store.validated=1)}var f=da,v=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),M=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),G=Symbol.for("react.client.reference"),Q=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=Object.prototype.hasOwnProperty,W=Array.isArray,V=console.createTask?console.createTask:function(){return null};f={"react-stack-bottom-frame":function(S){return S()}};var te,B={},ue=f["react-stack-bottom-frame"].bind(f,o)(),fe=V(n(o)),ie={};rt.Fragment=R,rt.jsx=function(S,F,J,K,le){var ce=1e4>Q.recentlyCreatedOwnerStacks++;return c(S,F,J,!1,K,le,ce?Error("react-stack-top-frame"):ue,ce?V(n(S)):fe)},rt.jsxs=function(S,F,J,K,le){var ce=1e4>Q.recentlyCreatedOwnerStacks++;return c(S,F,J,!0,K,le,ce?Error("react-stack-top-frame"):ue,ce?V(n(S)):fe)}}()),rt}var $r;function bn(){return $r||($r=1,process.env.NODE_ENV==="production"?bt.exports=wn():bt.exports=En()),bt.exports}var Rn=bn(),at={},jr;function Sn(){if(jr)return at;jr=1,Object.defineProperty(at,"__esModule",{value:!0}),at.parse=l,at.serialize=u;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,r=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,n=/^[\u0020-\u003A\u003D-\u007E]*$/,a=Object.prototype.toString,o=(()=>{const f=function(){};return f.prototype=Object.create(null),f})();function l(f,v){const g=new o,R=f.length;if(R<2)return g;const E=(v==null?void 0:v.decode)||c;let b=0;do{const P=f.indexOf("=",b);if(P===-1)break;const M=f.indexOf(";",b),T=M===-1?R:M;if(P>T){b=f.lastIndexOf(";",P-1)+1;continue}const L=s(f,b,P),p=i(f,P,L),_=f.slice(L,p);if(g[_]===void 0){let j=s(f,P+1,T),I=i(f,T,j);const G=E(f.slice(j,I));g[_]=G}b=T+1}while(b<R);return g}function s(f,v,g){do{const R=f.charCodeAt(v);if(R!==32&&R!==9)return v}while(++v<g);return g}function i(f,v,g){for(;v>g;){const R=f.charCodeAt(--v);if(R!==32&&R!==9)return v+1}return g}function u(f,v,g){const R=(g==null?void 0:g.encode)||encodeURIComponent;if(!e.test(f))throw new TypeError(`argument name is invalid: ${f}`);const E=R(v);if(!t.test(E))throw new TypeError(`argument val is invalid: ${v}`);let b=f+"="+E;if(!g)return b;if(g.maxAge!==void 0){if(!Number.isInteger(g.maxAge))throw new TypeError(`option maxAge is invalid: ${g.maxAge}`);b+="; Max-Age="+g.maxAge}if(g.domain){if(!r.test(g.domain))throw new TypeError(`option domain is invalid: ${g.domain}`);b+="; Domain="+g.domain}if(g.path){if(!n.test(g.path))throw new TypeError(`option path is invalid: ${g.path}`);b+="; Path="+g.path}if(g.expires){if(!m(g.expires)||!Number.isFinite(g.expires.valueOf()))throw new TypeError(`option expires is invalid: ${g.expires}`);b+="; Expires="+g.expires.toUTCString()}if(g.httpOnly&&(b+="; HttpOnly"),g.secure&&(b+="; Secure"),g.partitioned&&(b+="; Partitioned"),g.priority)switch(typeof g.priority=="string"?g.priority.toLowerCase():void 0){case"low":b+="; Priority=Low";break;case"medium":b+="; Priority=Medium";break;case"high":b+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${g.priority}`)}if(g.sameSite)switch(typeof g.sameSite=="string"?g.sameSite.toLowerCase():g.sameSite){case!0:case"strict":b+="; SameSite=Strict";break;case"lax":b+="; SameSite=Lax";break;case"none":b+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${g.sameSite}`)}return b}function c(f){if(f.indexOf("%")===-1)return f;try{return decodeURIComponent(f)}catch{return f}}function m(f){return a.call(f)==="[object Date]"}return at}Sn();/**
23
- * react-router v7.6.0
24
- *
25
- * Copyright (c) Remix Software Inc.
26
- *
27
- * This source code is licensed under the MIT license found in the
28
- * LICENSE.md file in the root directory of this source tree.
29
- *
30
- * @license MIT
31
- */var fa=e=>{throw TypeError(e)},xn=(e,t,r)=>t.has(e)||fa("Cannot "+r),Yt=(e,t,r)=>(xn(e,t,"read from private field"),r?r.call(e):t.get(e)),Ln=(e,t,r)=>t.has(e)?fa("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ur="popstate";function Pn(e={}){function t(n,a){let{pathname:o,search:l,hash:s}=n.location;return ut("",{pathname:o,search:l,hash:s},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:Oe(a)}return Tn(t,r,null,e)}function z(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Z(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Cn(){return Math.random().toString(36).substring(2,10)}function Hr(e,t){return{usr:e.state,key:e.key,idx:t}}function ut(e,t,r=null,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ne(t):t,state:r,key:t&&t.key||n||Cn()}}function Oe({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 Ne(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 Tn(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,l=a.history,s="POP",i=null,u=c();u==null&&(u=0,l.replaceState({...l.state,idx:u},""));function c(){return(l.state||{idx:null}).idx}function m(){s="POP";let E=c(),b=E==null?null:E-u;u=E,i&&i({action:s,location:R.location,delta:b})}function f(E,b){s="PUSH";let P=ut(R.location,E,b);u=c()+1;let M=Hr(P,u),T=R.createHref(P);try{l.pushState(M,"",T)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;a.location.assign(T)}o&&i&&i({action:s,location:R.location,delta:1})}function v(E,b){s="REPLACE";let P=ut(R.location,E,b);u=c();let M=Hr(P,u),T=R.createHref(P);l.replaceState(M,"",T),o&&i&&i({action:s,location:R.location,delta:0})}function g(E){return ha(E)}let R={get action(){return s},get location(){return e(a,l)},listen(E){if(i)throw new Error("A history only accepts one active listener");return a.addEventListener(Ur,m),i=E,()=>{a.removeEventListener(Ur,m),i=null}},createHref(E){return t(a,E)},createURL:g,encodeLocation(E){let b=g(E);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:f,replace:v,go(E){return l.go(E)}};return R}function ha(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),z(r,"No window.location.(origin|href) available to create URL");let n=typeof e=="string"?e:Oe(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}var lt,zr=class{constructor(e){if(Ln(this,lt,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Yt(this,lt).has(e))return Yt(this,lt).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Yt(this,lt).set(e,t)}};lt=new WeakMap;var Mn=new Set(["lazy","caseSensitive","path","id","index","children"]);function Dn(e){return Mn.has(e)}var _n=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function kn(e){return _n.has(e)}function On(e){return e.index===!0}function kt(e,t,r=[],n={}){return e.map((a,o)=>{let l=[...r,String(o)],s=typeof a.id=="string"?a.id:l.join("-");if(z(a.index!==!0||!a.children,"Cannot specify children on an index route"),z(!n[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),On(a)){let i={...a,...t(a),id:s};return n[s]=i,i}else{let i={...a,...t(a),id:s,children:void 0};return n[s]=i,a.children&&(i.children=kt(a.children,t,l,n)),i}})}function Se(e,t,r="/"){return Ct(e,t,r,!1)}function Ct(e,t,r,n){let a=typeof t=="string"?Ne(t):t,o=ye(a.pathname||"/",r);if(o==null)return null;let l=pa(e);An(l);let s=null;for(let i=0;s==null&&i<l.length;++i){let u=Wn(o);s=Bn(l[i],u,n)}return s}function ma(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function pa(e,t=[],r=[],n=""){let a=(o,l,s)=>{let i={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};i.relativePath.startsWith("/")&&(z(i.relativePath.startsWith(n),`Absolute route path "${i.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),i.relativePath=i.relativePath.slice(n.length));let u=xe([n,i.relativePath]),c=r.concat(i);o.children&&o.children.length>0&&(z(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),pa(o.children,t,c,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:Hn(u,o.index),routesMeta:c})};return e.forEach((o,l)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))a(o,l);else for(let i of ya(o.path))a(o,l,i)}),t}function ya(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 l=ya(n.join("/")),s=[];return s.push(...l.map(i=>i===""?o:[o,i].join("/"))),a&&s.push(...l),s.map(i=>e.startsWith("/")&&i===""?"/":i)}function An(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:zn(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var Nn=/^:[\w-]+$/,Fn=3,In=2,$n=1,jn=10,Un=-2,Br=e=>e==="*";function Hn(e,t){let r=e.split("/"),n=r.length;return r.some(Br)&&(n+=Un),t&&(n+=In),r.filter(a=>!Br(a)).reduce((a,o)=>a+(Nn.test(o)?Fn:o===""?$n:jn),n)}function zn(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 Bn(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",l=[];for(let s=0;s<n.length;++s){let i=n[s],u=s===n.length-1,c=o==="/"?t:t.slice(o.length)||"/",m=Ot({path:i.relativePath,caseSensitive:i.caseSensitive,end:u},c),f=i.route;if(!m&&u&&r&&!n[n.length-1].route.index&&(m=Ot({path:i.relativePath,caseSensitive:i.caseSensitive,end:!1},c)),!m)return null;Object.assign(a,m.params),l.push({params:a,pathname:xe([o,m.pathname]),pathnameBase:Jn(xe([o,m.pathnameBase])),route:f}),m.pathnameBase!=="/"&&(o=xe([o,m.pathnameBase]))}return l}function Ot(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=va(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],l=o.replace(/(.)\/+$/,"$1"),s=a.slice(1);return{params:n.reduce((u,{paramName:c,isOptional:m},f)=>{if(c==="*"){let g=s[f]||"";l=o.slice(0,o.length-g.length).replace(/(.)\/+$/,"$1")}const v=s[f];return m&&!v?u[c]=void 0:u[c]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:l,pattern:e}}function va(e,t=!1,r=!0){Z(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,(l,s,i)=>(n.push({paramName:s,isOptional:i!=null}),i?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function Wn(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Z(!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 ye(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 Yn(e,t="/"){let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?Ne(e):e;return{pathname:r?r.startsWith("/")?r:Vn(r,t):t,search:Gn(n),hash:Xn(a)}}function Vn(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 Vt(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 ga(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function ur(e){let t=ga(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function cr(e,t,r,n=!1){let a;typeof e=="string"?a=Ne(e):(a={...e},z(!a.pathname||!a.pathname.includes("?"),Vt("?","pathname","search",a)),z(!a.pathname||!a.pathname.includes("#"),Vt("#","pathname","hash",a)),z(!a.search||!a.search.includes("#"),Vt("#","search","hash",a)));let o=e===""||a.pathname==="",l=o?"/":a.pathname,s;if(l==null)s=r;else{let m=t.length-1;if(!n&&l.startsWith("..")){let f=l.split("/");for(;f[0]==="..";)f.shift(),m-=1;a.pathname=f.join("/")}s=m>=0?t[m]:"/"}let i=Yn(a,s),u=l&&l!=="/"&&l.endsWith("/"),c=(o||l===".")&&r.endsWith("/");return!i.pathname.endsWith("/")&&(u||c)&&(i.pathname+="/"),i}var xe=e=>e.join("/").replace(/\/\/+/g,"/"),Jn=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Gn=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Xn=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Kn=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function qn(e,t){return new Kn(e,typeof t=="number"?{status:t}:t)}var Qn=(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})},Ae=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 ze(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var wa=["POST","PUT","PATCH","DELETE"],Zn=new Set(wa),eo=["GET",...wa],to=new Set(eo),ro=new Set([301,302,303,307,308]),ao=new Set([307,308]),Jt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},no={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},nt={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},dr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,oo=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Ea="remix-router-transitions",ba=Symbol("ResetLoaderData");function io(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";z(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let n=e.hydrationRouteProperties||[],a=e.mapRouteProperties||oo,o={},l=kt(e.routes,a,void 0,o),s,i=e.basename||"/",u=e.dataStrategy||fo,c={unstable_middleware:!1,...e.future},m=null,f=new Set,v=null,g=null,R=null,E=e.hydrationData!=null,b=Se(l,e.history.location,i),P=!1,M=null,T;if(b==null&&!e.patchRoutesOnNavigation){let d=we(404,{pathname:e.history.location.pathname}),{matches:y,route:w}=ta(l);T=!0,b=y,M={[w.id]:d}}else if(b&&!e.hydrationData&&vt(b,l,e.history.location.pathname).active&&(b=null),b)if(b.some(d=>d.route.lazy))T=!1;else if(!b.some(d=>d.route.loader))T=!0;else{let d=e.hydrationData?e.hydrationData.loaderData:null,y=e.hydrationData?e.hydrationData.errors:null;if(y){let w=b.findIndex(x=>y[x.route.id]!==void 0);T=b.slice(0,w+1).every(x=>!er(x.route,d,y))}else T=b.every(w=>!er(w.route,d,y))}else{T=!1,b=[];let d=vt(null,l,e.history.location.pathname);d.active&&d.matches&&(P=!0,b=d.matches)}let L,p={historyAction:e.history.action,location:e.history.location,matches:b,initialized:T,navigation:Jt,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||M,fetchers:new Map,blockers:new Map},_="POP",j=!1,I,G=!1,Q=new Map,oe=null,W=!1,V=!1,te=new Set,B=new Map,ue=0,fe=-1,ie=new Map,S=new Set,F=new Map,J=new Map,K=new Set,le=new Map,ce,be=null;function Xe(){if(m=e.history.listen(({action:d,location:y,delta:w})=>{if(ce){ce(),ce=void 0;return}Z(le.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 x=kr({currentLocation:p.location,nextLocation:y,historyAction:d});if(x&&w!=null){let C=new Promise(k=>{ce=k});e.history.go(w*-1),yt(x,{state:"blocked",location:y,proceed(){yt(x,{state:"proceeding",proceed:void 0,reset:void 0,location:y}),C.then(()=>e.history.go(w))},reset(){let k=new Map(p.blockers);k.set(x,nt),re({blockers:k})}});return}return Fe(d,y)}),r){So(t,Q);let d=()=>xo(t,Q);t.addEventListener("pagehide",d),oe=()=>t.removeEventListener("pagehide",d)}return p.initialized||Fe("POP",p.location,{initialHydration:!0}),L}function ne(){m&&m(),oe&&oe(),f.clear(),I&&I.abort(),p.fetchers.forEach((d,y)=>Ht(y)),p.blockers.forEach((d,y)=>_r(y))}function Ce(d){return f.add(d),()=>f.delete(d)}function re(d,y={}){p={...p,...d};let w=[],x=[];p.fetchers.forEach((C,k)=>{C.state==="idle"&&(K.has(k)?w.push(k):x.push(k))}),K.forEach(C=>{!p.fetchers.has(C)&&!B.has(C)&&w.push(C)}),[...f].forEach(C=>C(p,{deletedFetchers:w,viewTransitionOpts:y.viewTransitionOpts,flushSync:y.flushSync===!0})),w.forEach(C=>Ht(C)),x.forEach(C=>p.fetchers.delete(C))}function Te(d,y,{flushSync:w}={}){var N,U;let x=p.actionData!=null&&p.navigation.formMethod!=null&&pe(p.navigation.formMethod)&&p.navigation.state==="loading"&&((N=d.state)==null?void 0:N._isRedirect)!==!0,C;y.actionData?Object.keys(y.actionData).length>0?C=y.actionData:C=null:x?C=p.actionData:C=null;let k=y.loaderData?Zr(p.loaderData,y.loaderData,y.matches||[],y.errors):p.loaderData,$=p.blockers;$.size>0&&($=new Map($),$.forEach((A,H)=>$.set(H,nt)));let D=j===!0||p.navigation.formMethod!=null&&pe(p.navigation.formMethod)&&((U=d.state)==null?void 0:U._isRedirect)!==!0;s&&(l=s,s=void 0),W||_==="POP"||(_==="PUSH"?e.history.push(d,d.state):_==="REPLACE"&&e.history.replace(d,d.state));let O;if(_==="POP"){let A=Q.get(p.location.pathname);A&&A.has(d.pathname)?O={currentLocation:p.location,nextLocation:d}:Q.has(d.pathname)&&(O={currentLocation:d,nextLocation:p.location})}else if(G){let A=Q.get(p.location.pathname);A?A.add(d.pathname):(A=new Set([d.pathname]),Q.set(p.location.pathname,A)),O={currentLocation:p.location,nextLocation:d}}re({...y,actionData:C,loaderData:k,historyAction:_,location:d,initialized:!0,navigation:Jt,revalidation:"idle",restoreScrollPosition:Ar(d,y.matches||p.matches),preventScrollReset:D,blockers:$},{viewTransitionOpts:O,flushSync:w===!0}),_="POP",j=!1,G=!1,W=!1,V=!1,be==null||be.resolve(),be=null}async function xr(d,y){if(typeof d=="number"){e.history.go(d);return}let w=Zt(p.location,p.matches,i,d,y==null?void 0:y.fromRouteId,y==null?void 0:y.relative),{path:x,submission:C,error:k}=Wr(!1,w,y),$=p.location,D=ut(p.location,x,y&&y.state);D={...D,...e.history.encodeLocation(D)};let O=y&&y.replace!=null?y.replace:void 0,N="PUSH";O===!0?N="REPLACE":O===!1||C!=null&&pe(C.formMethod)&&C.formAction===p.location.pathname+p.location.search&&(N="REPLACE");let U=y&&"preventScrollReset"in y?y.preventScrollReset===!0:void 0,A=(y&&y.flushSync)===!0,H=kr({currentLocation:$,nextLocation:D,historyAction:N});if(H){yt(H,{state:"blocked",location:D,proceed(){yt(H,{state:"proceeding",proceed:void 0,reset:void 0,location:D}),xr(d,y)},reset(){let q=new Map(p.blockers);q.set(H,nt),re({blockers:q})}});return}await Fe(N,D,{submission:C,pendingError:k,preventScrollReset:U,replace:y&&y.replace,enableViewTransition:y&&y.viewTransition,flushSync:A})}function an(){be||(be=Lo()),Ut(),re({revalidation:"loading"});let d=be.promise;return p.navigation.state==="submitting"?d:p.navigation.state==="idle"?(Fe(p.historyAction,p.location,{startUninterruptedRevalidation:!0}),d):(Fe(_||p.historyAction,p.navigation.location,{overrideNavigation:p.navigation,enableViewTransition:G===!0}),d)}async function Fe(d,y,w){I&&I.abort(),I=null,_=d,W=(w&&w.startUninterruptedRevalidation)===!0,mn(p.location,p.matches),j=(w&&w.preventScrollReset)===!0,G=(w&&w.enableViewTransition)===!0;let x=s||l,C=w&&w.overrideNavigation,k=w!=null&&w.initialHydration&&p.matches&&p.matches.length>0&&!P?p.matches:Se(x,y,i),$=(w&&w.flushSync)===!0;if(k&&p.initialized&&!V&&go(p.location,y)&&!(w&&w.submission&&pe(w.submission.formMethod))){Te(y,{matches:k},{flushSync:$});return}let D=vt(k,x,y.pathname);if(D.active&&D.matches&&(k=D.matches),!k){let{error:se,notFoundMatches:he,route:Y}=zt(y.pathname);Te(y,{matches:he,loaderData:{},errors:{[Y.id]:se}},{flushSync:$});return}I=new AbortController;let O=Ye(e.history,y,I.signal,w&&w.submission),N=new zr(e.unstable_getContext?await e.unstable_getContext():void 0),U;if(w&&w.pendingError)U=[Ue(k).route.id,{type:"error",error:w.pendingError}];else if(w&&w.submission&&pe(w.submission.formMethod)){let se=await nn(O,y,w.submission,k,N,D.active,w&&w.initialHydration===!0,{replace:w.replace,flushSync:$});if(se.shortCircuited)return;if(se.pendingActionResult){let[he,Y]=se.pendingActionResult;if(me(Y)&&ze(Y.error)&&Y.error.status===404){I=null,Te(y,{matches:se.matches,loaderData:{},errors:{[he]:Y.error}});return}}k=se.matches||k,U=se.pendingActionResult,C=Gt(y,w.submission),$=!1,D.active=!1,O=Ye(e.history,O.url,O.signal)}let{shortCircuited:A,matches:H,loaderData:q,errors:ae}=await on(O,y,k,N,D.active,C,w&&w.submission,w&&w.fetcherSubmission,w&&w.replace,w&&w.initialHydration===!0,$,U);A||(I=null,Te(y,{matches:H||k,...ea(U),loaderData:q,errors:ae}))}async function nn(d,y,w,x,C,k,$,D={}){Ut();let O=bo(y,w);if(re({navigation:O},{flushSync:D.flushSync===!0}),k){let A=await gt(x,y.pathname,d.signal);if(A.type==="aborted")return{shortCircuited:!0};if(A.type==="error"){let H=Ue(A.partialMatches).route.id;return{matches:A.partialMatches,pendingActionResult:[H,{type:"error",error:A.error}]}}else if(A.matches)x=A.matches;else{let{notFoundMatches:H,error:q,route:ae}=zt(y.pathname);return{matches:H,pendingActionResult:[ae.id,{type:"error",error:q}]}}}let N,U=st(x,y);if(!U.route.action&&!U.route.lazy)N={type:"error",error:we(405,{method:d.method,pathname:y.pathname,routeId:U.route.id})};else{let A=Ve(a,o,d,x,U,$?[]:n,C),H=await Ke(d,A,C,null);if(N=H[U.route.id],!N){for(let q of x)if(H[q.route.id]){N=H[q.route.id];break}}if(d.signal.aborted)return{shortCircuited:!0}}if(He(N)){let A;return D&&D.replace!=null?A=D.replace:A=Kr(N.response.headers.get("Location"),new URL(d.url),i)===p.location.pathname+p.location.search,await Ie(d,N,!0,{submission:w,replace:A}),{shortCircuited:!0}}if(me(N)){let A=Ue(x,U.route.id);return(D&&D.replace)!==!0&&(_="PUSH"),{matches:x,pendingActionResult:[A.route.id,N,U.route.id]}}return{matches:x,pendingActionResult:[U.route.id,N]}}async function on(d,y,w,x,C,k,$,D,O,N,U,A){let H=k||Gt(y,$),q=$||D||ra(H),ae=!W&&!N;if(C){if(ae){let ge=Lr(A);re({navigation:H,...ge!==void 0?{actionData:ge}:{}},{flushSync:U})}let X=await gt(w,y.pathname,d.signal);if(X.type==="aborted")return{shortCircuited:!0};if(X.type==="error"){let ge=Ue(X.partialMatches).route.id;return{matches:X.partialMatches,loaderData:{},errors:{[ge]:X.error}}}else if(X.matches)w=X.matches;else{let{error:ge,notFoundMatches:_e,route:Et}=zt(y.pathname);return{matches:_e,loaderData:{},errors:{[Et.id]:ge}}}}let se=s||l,{dsMatches:he,revalidatingFetchers:Y}=Yr(d,x,a,o,e.history,p,w,q,y,N?[]:n,N===!0,V,te,K,F,S,se,i,A);if(fe=++ue,!e.dataStrategy&&!he.some(X=>X.shouldLoad)&&Y.length===0){let X=Mr();return Te(y,{matches:w,loaderData:{},errors:A&&me(A[1])?{[A[0]]:A[1].error}:null,...ea(A),...X?{fetchers:new Map(p.fetchers)}:{}},{flushSync:U}),{shortCircuited:!0}}if(ae){let X={};if(!C){X.navigation=H;let ge=Lr(A);ge!==void 0&&(X.actionData=ge)}Y.length>0&&(X.fetchers=ln(Y)),re(X,{flushSync:U})}Y.forEach(X=>{De(X.key),X.controller&&B.set(X.key,X.controller)});let qe=()=>Y.forEach(X=>De(X.key));I&&I.signal.addEventListener("abort",qe);let{loaderResults:$e,fetcherResults:Qe}=await Pr(he,Y,d,x);if(d.signal.aborted)return{shortCircuited:!0};I&&I.signal.removeEventListener("abort",qe),Y.forEach(X=>B.delete(X.key));let ve=Rt($e);if(ve)return await Ie(d,ve.result,!0,{replace:O}),{shortCircuited:!0};if(ve=Rt(Qe),ve)return S.add(ve.key),await Ie(d,ve.result,!0,{replace:O}),{shortCircuited:!0};let{loaderData:Ze,errors:et}=Qr(p,w,$e,A,Y,Qe);N&&p.errors&&(et={...p.errors,...et});let Bt=Mr(),je=Dr(fe),wt=Bt||je||Y.length>0;return{matches:w,loaderData:Ze,errors:et,...wt?{fetchers:new Map(p.fetchers)}:{}}}function Lr(d){if(d&&!me(d[1]))return{[d[0]]:d[1].data};if(p.actionData)return Object.keys(p.actionData).length===0?null:p.actionData}function ln(d){return d.forEach(y=>{let w=p.fetchers.get(y.key),x=ot(void 0,w?w.data:void 0);p.fetchers.set(y.key,x)}),new Map(p.fetchers)}async function sn(d,y,w,x){De(d);let C=(x&&x.flushSync)===!0,k=s||l,$=Zt(p.location,p.matches,i,w,y,x==null?void 0:x.relative),D=Se(k,$,i),O=vt(D,k,$);if(O.active&&O.matches&&(D=O.matches),!D){Pe(d,y,we(404,{pathname:$}),{flushSync:C});return}let{path:N,submission:U,error:A}=Wr(!0,$,x);if(A){Pe(d,y,A,{flushSync:C});return}let H=st(D,N),q=new zr(e.unstable_getContext?await e.unstable_getContext():void 0),ae=(x&&x.preventScrollReset)===!0;if(U&&pe(U.formMethod)){await un(d,y,N,H,D,q,O.active,C,ae,U);return}F.set(d,{routeId:y,path:N}),await cn(d,y,N,H,D,q,O.active,C,ae,U)}async function un(d,y,w,x,C,k,$,D,O,N){Ut(),F.delete(d);function U(ee){if(!ee.route.action&&!ee.route.lazy){let We=we(405,{method:N.formMethod,pathname:w,routeId:y});return Pe(d,y,We,{flushSync:D}),!0}return!1}if(!$&&U(x))return;let A=p.fetchers.get(d);Me(d,Ro(N,A),{flushSync:D});let H=new AbortController,q=Ye(e.history,w,H.signal,N);if($){let ee=await gt(C,w,q.signal,d);if(ee.type==="aborted")return;if(ee.type==="error"){Pe(d,y,ee.error,{flushSync:D});return}else if(ee.matches){if(C=ee.matches,x=st(C,w),U(x))return}else{Pe(d,y,we(404,{pathname:w}),{flushSync:D});return}}B.set(d,H);let ae=ue,se=Ve(a,o,q,C,x,n,k),Y=(await Ke(q,se,k,d))[x.route.id];if(q.signal.aborted){B.get(d)===H&&B.delete(d);return}if(K.has(d)){if(He(Y)||me(Y)){Me(d,ke(void 0));return}}else{if(He(Y))if(B.delete(d),fe>ae){Me(d,ke(void 0));return}else return S.add(d),Me(d,ot(N)),Ie(q,Y,!1,{fetcherSubmission:N,preventScrollReset:O});if(me(Y)){Pe(d,y,Y.error);return}}let qe=p.navigation.location||p.location,$e=Ye(e.history,qe,H.signal),Qe=s||l,ve=p.navigation.state!=="idle"?Se(Qe,p.navigation.location,i):p.matches;z(ve,"Didn't find any matches after fetcher action");let Ze=++ue;ie.set(d,Ze);let et=ot(N,Y.data);p.fetchers.set(d,et);let{dsMatches:Bt,revalidatingFetchers:je}=Yr($e,k,a,o,e.history,p,ve,N,qe,n,!1,V,te,K,F,S,Qe,i,[x.route.id,Y]);je.filter(ee=>ee.key!==d).forEach(ee=>{let We=ee.key,Nr=p.fetchers.get(We),vn=ot(void 0,Nr?Nr.data:void 0);p.fetchers.set(We,vn),De(We),ee.controller&&B.set(We,ee.controller)}),re({fetchers:new Map(p.fetchers)});let wt=()=>je.forEach(ee=>De(ee.key));H.signal.addEventListener("abort",wt);let{loaderResults:X,fetcherResults:ge}=await Pr(Bt,je,$e,k);if(H.signal.aborted)return;if(H.signal.removeEventListener("abort",wt),ie.delete(d),B.delete(d),je.forEach(ee=>B.delete(ee.key)),p.fetchers.has(d)){let ee=ke(Y.data);p.fetchers.set(d,ee)}let _e=Rt(X);if(_e)return Ie($e,_e.result,!1,{preventScrollReset:O});if(_e=Rt(ge),_e)return S.add(_e.key),Ie($e,_e.result,!1,{preventScrollReset:O});let{loaderData:Et,errors:Wt}=Qr(p,ve,X,void 0,je,ge);Dr(Ze),p.navigation.state==="loading"&&Ze>fe?(z(_,"Expected pending action"),I&&I.abort(),Te(p.navigation.location,{matches:ve,loaderData:Et,errors:Wt,fetchers:new Map(p.fetchers)})):(re({errors:Wt,loaderData:Zr(p.loaderData,Et,ve,Wt),fetchers:new Map(p.fetchers)}),V=!1)}async function cn(d,y,w,x,C,k,$,D,O,N){let U=p.fetchers.get(d);Me(d,ot(N,U?U.data:void 0),{flushSync:D});let A=new AbortController,H=Ye(e.history,w,A.signal);if($){let Y=await gt(C,w,H.signal,d);if(Y.type==="aborted")return;if(Y.type==="error"){Pe(d,y,Y.error,{flushSync:D});return}else if(Y.matches)C=Y.matches,x=st(C,w);else{Pe(d,y,we(404,{pathname:w}),{flushSync:D});return}}B.set(d,A);let q=ue,ae=Ve(a,o,H,C,x,n,k),he=(await Ke(H,ae,k,d))[x.route.id];if(B.get(d)===A&&B.delete(d),!H.signal.aborted){if(K.has(d)){Me(d,ke(void 0));return}if(He(he))if(fe>q){Me(d,ke(void 0));return}else{S.add(d),await Ie(H,he,!1,{preventScrollReset:O});return}if(me(he)){Pe(d,y,he.error);return}Me(d,ke(he.data))}}async function Ie(d,y,w,{submission:x,fetcherSubmission:C,preventScrollReset:k,replace:$}={}){y.response.headers.has("X-Remix-Revalidate")&&(V=!0);let D=y.response.headers.get("Location");z(D,"Expected a Location header on the redirect Response"),D=Kr(D,new URL(d.url),i);let O=ut(p.location,D,{_isRedirect:!0});if(r){let ae=!1;if(y.response.headers.has("X-Remix-Reload-Document"))ae=!0;else if(dr.test(D)){const se=ha(D,!0);ae=se.origin!==t.location.origin||ye(se.pathname,i)==null}if(ae){$?t.location.replace(D):t.location.assign(D);return}}I=null;let N=$===!0||y.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:U,formAction:A,formEncType:H}=p.navigation;!x&&!C&&U&&A&&H&&(x=ra(p.navigation));let q=x||C;if(ao.has(y.response.status)&&q&&pe(q.formMethod))await Fe(N,O,{submission:{...q,formAction:D},preventScrollReset:k||j,enableViewTransition:w?G:void 0});else{let ae=Gt(O,x);await Fe(N,O,{overrideNavigation:ae,fetcherSubmission:C,preventScrollReset:k||j,enableViewTransition:w?G:void 0})}}async function Ke(d,y,w,x){let C,k={};try{C=await ho(u,d,y,x,w,!1)}catch($){return y.filter(D=>D.shouldLoad).forEach(D=>{k[D.route.id]={type:"error",error:$}}),k}if(d.signal.aborted)return k;for(let[$,D]of Object.entries(C))if(wo(D)){let O=D.result;k[$]={type:"redirect",response:yo(O,d,$,y,i)}}else k[$]=await po(D);return k}async function Pr(d,y,w,x){let C=Ke(w,d,x,null),k=Promise.all(y.map(async O=>{if(O.matches&&O.match&&O.request&&O.controller){let U=(await Ke(O.request,O.matches,x,O.key))[O.match.route.id];return{[O.key]:U}}else return Promise.resolve({[O.key]:{type:"error",error:we(404,{pathname:O.path})}})})),$=await C,D=(await k).reduce((O,N)=>Object.assign(O,N),{});return{loaderResults:$,fetcherResults:D}}function Ut(){V=!0,F.forEach((d,y)=>{B.has(y)&&te.add(y),De(y)})}function Me(d,y,w={}){p.fetchers.set(d,y),re({fetchers:new Map(p.fetchers)},{flushSync:(w&&w.flushSync)===!0})}function Pe(d,y,w,x={}){let C=Ue(p.matches,y);Ht(d),re({errors:{[C.route.id]:w},fetchers:new Map(p.fetchers)},{flushSync:(x&&x.flushSync)===!0})}function Cr(d){return J.set(d,(J.get(d)||0)+1),K.has(d)&&K.delete(d),p.fetchers.get(d)||no}function Ht(d){let y=p.fetchers.get(d);B.has(d)&&!(y&&y.state==="loading"&&ie.has(d))&&De(d),F.delete(d),ie.delete(d),S.delete(d),K.delete(d),te.delete(d),p.fetchers.delete(d)}function dn(d){let y=(J.get(d)||0)-1;y<=0?(J.delete(d),K.add(d)):J.set(d,y),re({fetchers:new Map(p.fetchers)})}function De(d){let y=B.get(d);y&&(y.abort(),B.delete(d))}function Tr(d){for(let y of d){let w=Cr(y),x=ke(w.data);p.fetchers.set(y,x)}}function Mr(){let d=[],y=!1;for(let w of S){let x=p.fetchers.get(w);z(x,`Expected fetcher: ${w}`),x.state==="loading"&&(S.delete(w),d.push(w),y=!0)}return Tr(d),y}function Dr(d){let y=[];for(let[w,x]of ie)if(x<d){let C=p.fetchers.get(w);z(C,`Expected fetcher: ${w}`),C.state==="loading"&&(De(w),ie.delete(w),y.push(w))}return Tr(y),y.length>0}function fn(d,y){let w=p.blockers.get(d)||nt;return le.get(d)!==y&&le.set(d,y),w}function _r(d){p.blockers.delete(d),le.delete(d)}function yt(d,y){let w=p.blockers.get(d)||nt;z(w.state==="unblocked"&&y.state==="blocked"||w.state==="blocked"&&y.state==="blocked"||w.state==="blocked"&&y.state==="proceeding"||w.state==="blocked"&&y.state==="unblocked"||w.state==="proceeding"&&y.state==="unblocked",`Invalid blocker state transition: ${w.state} -> ${y.state}`);let x=new Map(p.blockers);x.set(d,y),re({blockers:x})}function kr({currentLocation:d,nextLocation:y,historyAction:w}){if(le.size===0)return;le.size>1&&Z(!1,"A router only supports one blocker at a time");let x=Array.from(le.entries()),[C,k]=x[x.length-1],$=p.blockers.get(C);if(!($&&$.state==="proceeding")&&k({currentLocation:d,nextLocation:y,historyAction:w}))return C}function zt(d){let y=we(404,{pathname:d}),w=s||l,{matches:x,route:C}=ta(w);return{notFoundMatches:x,route:C,error:y}}function hn(d,y,w){if(v=d,R=y,g=w||null,!E&&p.navigation===Jt){E=!0;let x=Ar(p.location,p.matches);x!=null&&re({restoreScrollPosition:x})}return()=>{v=null,R=null,g=null}}function Or(d,y){return g&&g(d,y.map(x=>ma(x,p.loaderData)))||d.key}function mn(d,y){if(v&&R){let w=Or(d,y);v[w]=R()}}function Ar(d,y){if(v){let w=Or(d,y),x=v[w];if(typeof x=="number")return x}return null}function vt(d,y,w){if(e.patchRoutesOnNavigation)if(d){if(Object.keys(d[0].params).length>0)return{active:!0,matches:Ct(y,w,i,!0)}}else return{active:!0,matches:Ct(y,w,i,!0)||[]};return{active:!1,matches:null}}async function gt(d,y,w,x){if(!e.patchRoutesOnNavigation)return{type:"success",matches:d};let C=d;for(;;){let k=s==null,$=s||l,D=o;try{await e.patchRoutesOnNavigation({signal:w,path:y,matches:C,fetcherKey:x,patch:(U,A)=>{w.aborted||Vr(U,A,$,D,a)}})}catch(U){return{type:"error",error:U,partialMatches:C}}finally{k&&!w.aborted&&(l=[...l])}if(w.aborted)return{type:"aborted"};let O=Se($,y,i);if(O)return{type:"success",matches:O};let N=Ct($,y,i,!0);if(!N||C.length===N.length&&C.every((U,A)=>U.route.id===N[A].route.id))return{type:"success",matches:null};C=N}}function pn(d){o={},s=kt(d,a,void 0,o)}function yn(d,y){let w=s==null;Vr(d,y,s||l,o,a),w&&(l=[...l],re({}))}return L={get basename(){return i},get future(){return c},get state(){return p},get routes(){return l},get window(){return t},initialize:Xe,subscribe:Ce,enableScrollRestoration:hn,navigate:xr,fetch:sn,revalidate:an,createHref:d=>e.history.createHref(d),encodeLocation:d=>e.history.encodeLocation(d),getFetcher:Cr,deleteFetcher:dn,dispose:ne,getBlocker:fn,deleteBlocker:_r,patchRoutes:yn,_internalFetchControllers:B,_internalSetRoutes:pn},L}function lo(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Zt(e,t,r,n,a,o){let l,s;if(a){l=[];for(let u of t)if(l.push(u),u.route.id===a){s=u;break}}else l=t,s=t[t.length-1];let i=cr(n||".",ur(l),ye(e.pathname,r)||e.pathname,o==="path");if(n==null&&(i.search=e.search,i.hash=e.hash),(n==null||n===""||n===".")&&s){let u=hr(i.search);if(s.route.index&&!u)i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index";else if(!s.route.index&&u){let c=new URLSearchParams(i.search),m=c.getAll("index");c.delete("index"),m.filter(v=>v).forEach(v=>c.append("index",v));let f=c.toString();i.search=f?`?${f}`:""}}return r!=="/"&&(i.pathname=i.pathname==="/"?r:xe([r,i.pathname])),Oe(i)}function Wr(e,t,r){if(!r||!lo(r))return{path:t};if(r.formMethod&&!Eo(r.formMethod))return{path:t,error:we(405,{method:r.formMethod})};let n=()=>({path:t,error:we(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),l=Ca(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!pe(o))return n();let m=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((f,[v,g])=>`${f}${v}=${g}
32
- `,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:m}}}else if(r.formEncType==="application/json"){if(!pe(o))return n();try{let m=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:o,formAction:l,formEncType:r.formEncType,formData:void 0,json:m,text:void 0}}}catch{return n()}}}z(typeof FormData=="function","FormData is not available in this environment");let s,i;if(r.formData)s=rr(r.formData),i=r.formData;else if(r.body instanceof FormData)s=rr(r.body),i=r.body;else if(r.body instanceof URLSearchParams)s=r.body,i=qr(s);else if(r.body==null)s=new URLSearchParams,i=new FormData;else try{s=new URLSearchParams(r.body),i=qr(s)}catch{return n()}let u={formMethod:o,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(pe(u.formMethod))return{path:t,submission:u};let c=Ne(t);return e&&c.search&&hr(c.search)&&s.append("index",""),c.search=`?${s}`,{path:Oe(c),submission:u}}function Yr(e,t,r,n,a,o,l,s,i,u,c,m,f,v,g,R,E,b,P){var oe;let M=P?me(P[1])?P[1].error:P[1].data:void 0,T=a.createURL(o.location),L=a.createURL(i),p;if(c&&o.errors){let W=Object.keys(o.errors)[0];p=l.findIndex(V=>V.route.id===W)}else if(P&&me(P[1])){let W=P[0];p=l.findIndex(V=>V.route.id===W)-1}let _=P?P[1].statusCode:void 0,j=_&&_>=400,I={currentUrl:T,currentParams:((oe=o.matches[0])==null?void 0:oe.params)||{},nextUrl:L,nextParams:l[0].params,...s,actionResult:M,actionStatus:_},G=l.map((W,V)=>{let{route:te}=W,B=null;if(p!=null&&V>p?B=!1:te.lazy?B=!0:te.loader==null?B=!1:c?B=er(te,o.loaderData,o.errors):so(o.loaderData,o.matches[V],W)&&(B=!0),B!==null)return tr(r,n,e,W,u,t,B);let ue=j?!1:m||T.pathname+T.search===L.pathname+L.search||T.search!==L.search||uo(o.matches[V],W),fe={...I,defaultShouldRevalidate:ue},ie=At(W,fe);return tr(r,n,e,W,u,t,ie,fe)}),Q=[];return g.forEach((W,V)=>{if(c||!l.some(F=>F.route.id===W.routeId)||v.has(V))return;let te=Se(E,W.path,b);if(!te){Q.push({key:V,routeId:W.routeId,path:W.path,matches:null,match:null,request:null,controller:null});return}if(R.has(V))return;let B=o.fetchers.get(V),ue=st(te,W.path),fe=new AbortController,ie=Ye(a,W.path,fe.signal),S=null;if(f.has(V))f.delete(V),S=Ve(r,n,ie,te,ue,u,t);else if(B&&B.state!=="idle"&&B.data===void 0)m&&(S=Ve(r,n,ie,te,ue,u,t));else{let F={...I,defaultShouldRevalidate:j?!1:m};At(ue,F)&&(S=Ve(r,n,ie,te,ue,u,t,F))}S&&Q.push({key:V,routeId:W.routeId,path:W.path,matches:S,match:ue,request:ie,controller:fe})}),{dsMatches:G,revalidatingFetchers:Q}}function er(e,t,r){if(e.lazy)return!0;if(!e.loader)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 so(e,t,r){let n=!t||r.route.id!==t.route.id,a=!e.hasOwnProperty(r.route.id);return n||a}function uo(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function At(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function Vr(e,t,r,n,a){let o;if(e){let i=n[e];z(i,`No route found to patch children into: routeId = ${e}`),i.children||(i.children=[]),o=i.children}else o=r;let l=t.filter(i=>!o.some(u=>Ra(i,u))),s=kt(l,a,[e||"_","patch",String((o==null?void 0:o.length)||"0")],n);o.push(...s)}function Ra(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=>Ra(r,o))}):!1}var Jr=new WeakMap,Sa=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let a=r[t.id];if(z(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let o=a.lazy[e];if(!o)return;let l=Jr.get(a);l||(l={},Jr.set(a,l));let s=l[e];if(s)return s;let i=(async()=>{let u=Dn(e),m=a[e]!==void 0&&e!=="hasErrorBoundary";if(u)Z(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),l[e]=Promise.resolve();else if(m)Z(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let f=await o();f!=null&&(Object.assign(a,{[e]:f}),Object.assign(a,n(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(f=>f===void 0)&&(a.lazy=void 0))})();return l[e]=i,i},Gr=new WeakMap;function co(e,t,r,n,a){let o=r[e.id];if(z(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let c=Gr.get(o);if(c)return{lazyRoutePromise:c,lazyHandlerPromise:c};let m=(async()=>{z(typeof e.lazy=="function","No lazy route function found");let f=await e.lazy(),v={};for(let g in f){let R=f[g];if(R===void 0)continue;let E=kn(g),P=o[g]!==void 0&&g!=="hasErrorBoundary";E?Z(!E,"Route property "+g+" is not a supported property to be returned from a lazy route function. This property will be ignored."):P?Z(!P,`Route "${o.id}" has a static property "${g}" defined but its lazy function is also returning a value for this property. The lazy route property "${g}" will be ignored.`):v[g]=R}Object.assign(o,v),Object.assign(o,{...n(o),lazy:void 0})})();return Gr.set(o,m),m.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:m}}let l=Object.keys(e.lazy),s=[],i;for(let c of l){if(a&&a.includes(c))continue;let m=Sa({key:c,route:e,manifest:r,mapRouteProperties:n});m&&(s.push(m),c===t&&(i=m))}let u=s.length>0?Promise.all(s).then(()=>{}):void 0;return u==null||u.catch(()=>{}),i==null||i.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:i}}async function Xr(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 fo(e){return e.matches.some(t=>t.route.unstable_middleware)?xa(e,!1,()=>Xr(e),(t,r)=>({[r]:{type:"error",result:t}})):Xr(e)}async function xa(e,t,r,n){let{matches:a,request:o,params:l,context:s}=e,i={handlerResult:void 0};try{let u=a.flatMap(m=>m.route.unstable_middleware?m.route.unstable_middleware.map(f=>[m.route.id,f]):[]),c=await La({request:o,params:l,context:s},u,t,i,r);return t?c:i.handlerResult}catch(u){if(!i.middlewareError)throw u;let c=await n(i.middlewareError.error,i.middlewareError.routeId);return i.handlerResult?Object.assign(i.handlerResult,c):c}}async function La(e,t,r,n,a,o=0){let{request:l}=e;if(l.signal.aborted)throw l.signal.reason?l.signal.reason:new Error(`Request aborted without an \`AbortSignal.reason\`: ${l.method} ${l.url}`);let s=t[o];if(!s)return n.handlerResult=await a(),n.handlerResult;let[i,u]=s,c=!1,m,f=async()=>{if(c)throw new Error("You may only call `next()` once per middleware");c=!0,await La(e,t,r,n,a,o+1)};try{let v=await u({request:e.request,params:e.params,context:e.context},f);return c?v===void 0?m:v:f()}catch(v){throw n.middlewareError?n.middlewareError.error!==v&&(n.middlewareError={routeId:i,error:v}):n.middlewareError={routeId:i,error:v},v}}function Pa(e,t,r,n,a){let o=Sa({key:"unstable_middleware",route:n.route,manifest:t,mapRouteProperties:e}),l=co(n.route,pe(r.method)?"action":"loader",t,e,a);return{middleware:o,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function tr(e,t,r,n,a,o,l,s=null){let i=!1,u=Pa(e,t,r,n,a);return{...n,_lazyPromises:u,shouldLoad:l,unstable_shouldRevalidateArgs:s,unstable_shouldCallHandler(c){return i=!0,s?typeof c=="boolean"?At(n,{...s,defaultShouldRevalidate:c}):At(n,s):l},resolve(c){return i||l||c&&r.method==="GET"&&(n.route.lazy||n.route.loader)?mo({request:r,match:n,lazyHandlerPromise:u==null?void 0:u.handler,lazyRoutePromise:u==null?void 0:u.route,handlerOverride:c,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}}function Ve(e,t,r,n,a,o,l,s=null){return n.map(i=>i.route.id!==a.route.id?{...i,shouldLoad:!1,unstable_shouldRevalidateArgs:s,unstable_shouldCallHandler:()=>!1,_lazyPromises:Pa(e,t,r,i,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:tr(e,t,r,i,o,l,!0,s))}async function ho(e,t,r,n,a,o){r.some(u=>{var c;return(c=u._lazyPromises)==null?void 0:c.middleware})&&await Promise.all(r.map(u=>{var c;return(c=u._lazyPromises)==null?void 0:c.middleware}));let l={request:t,params:r[0].params,context:a,matches:r},i=await e({...l,fetcherKey:n,unstable_runClientMiddleware:u=>{let c=l;return xa(c,!1,()=>u({...c,fetcherKey:n,unstable_runClientMiddleware:()=>{throw new Error("Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler")}}),(m,f)=>({[f]:{type:"error",result:m}}))}});try{await Promise.all(r.flatMap(u=>{var c,m;return[(c=u._lazyPromises)==null?void 0:c.handler,(m=u._lazyPromises)==null?void 0:m.route]}))}catch{}return i}async function mo({request:e,match:t,lazyHandlerPromise:r,lazyRoutePromise:n,handlerOverride:a,scopedContext:o}){let l,s,i=pe(e.method),u=i?"action":"loader",c=m=>{let f,v=new Promise((E,b)=>f=b);s=()=>f(),e.signal.addEventListener("abort",s);let g=E=>typeof m!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${u}" [routeId: ${t.route.id}]`)):m({request:e,params:t.params,context:o},...E!==void 0?[E]:[]),R=(async()=>{try{return{type:"data",result:await(a?a(b=>g(b)):g())}}catch(E){return{type:"error",result:E}}})();return Promise.race([R,v])};try{let m=i?t.route.action:t.route.loader;if(r||n)if(m){let f,[v]=await Promise.all([c(m).catch(g=>{f=g}),r,n]);if(f!==void 0)throw f;l=v}else{await r;let f=i?t.route.action:t.route.loader;if(f)[l]=await Promise.all([c(f),n]);else if(u==="action"){let v=new URL(e.url),g=v.pathname+v.search;throw we(405,{method:e.method,pathname:g,routeId:t.route.id})}else return{type:"data",result:void 0}}else if(m)l=await c(m);else{let f=new URL(e.url),v=f.pathname+f.search;throw we(404,{pathname:v})}}catch(m){return{type:"error",result:m}}finally{s&&e.signal.removeEventListener("abort",s)}return l}async function po(e){var n,a,o,l,s,i;let{result:t,type:r}=e;if(fr(t)){let u;try{let c=t.headers.get("Content-Type");c&&/\bapplication\/json\b/.test(c)?t.body==null?u=null:u=await t.json():u=await t.text()}catch(c){return{type:"error",error:c}}return r==="error"?{type:"error",error:new Ae(t.status,t.statusText,u),statusCode:t.status,headers:t.headers}:{type:"data",data:u,statusCode:t.status,headers:t.headers}}return r==="error"?ar(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:new Ae(((o=t.init)==null?void 0:o.status)||500,void 0,t.data),statusCode:ze(t)?t.status:void 0,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:ze(t)?t.status:void 0}:ar(t)?{type:"data",data:t.data,statusCode:(s=t.init)==null?void 0:s.status,headers:(i=t.init)!=null&&i.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(z(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!dr.test(o)){let l=n.slice(0,n.findIndex(s=>s.route.id===r)+1);o=Zt(new URL(t.url),l,a,o),e.headers.set("Location",o)}return e}function Kr(e,t,r){if(dr.test(e)){let n=e,a=n.startsWith("//")?new URL(t.protocol+n):new URL(n),o=ye(a.pathname,r)!=null;if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}return e}function Ye(e,t,r,n){let a=e.createURL(Ca(t)).toString(),o={signal:r};if(n&&pe(n.formMethod)){let{formMethod:l,formEncType:s}=n;o.method=l.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(n.json)):s==="text/plain"?o.body=n.text:s==="application/x-www-form-urlencoded"&&n.formData?o.body=rr(n.formData):o.body=n.formData}return new Request(a,o)}function rr(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function qr(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={},l=null,s,i=!1,u={},c=r&&me(r[1])?r[1].error:void 0;return e.forEach(m=>{if(!(m.route.id in t))return;let f=m.route.id,v=t[f];if(z(!He(v),"Cannot handle redirect results in processLoaderData"),me(v)){let g=v.error;if(c!==void 0&&(g=c,c=void 0),l=l||{},a)l[f]=g;else{let R=Ue(e,f);l[R.route.id]==null&&(l[R.route.id]=g)}n||(o[f]=ba),i||(i=!0,s=ze(v.error)?v.error.status:500),v.headers&&(u[f]=v.headers)}else o[f]=v.data,v.statusCode&&v.statusCode!==200&&!i&&(s=v.statusCode),v.headers&&(u[f]=v.headers)}),c!==void 0&&r&&(l={[r[0]]:c},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:l,statusCode:s||200,loaderHeaders:u}}function Qr(e,t,r,n,a,o){let{loaderData:l,errors:s}=vo(t,r,n);return a.filter(i=>!i.matches||i.matches.some(u=>u.shouldLoad)).forEach(i=>{let{key:u,match:c,controller:m}=i,f=o[u];if(z(f,"Did not find corresponding fetcher result"),!(m&&m.signal.aborted))if(me(f)){let v=Ue(e.matches,c==null?void 0:c.route.id);s&&s[v.route.id]||(s={...s,[v.route.id]:f.error}),e.fetchers.delete(u)}else if(He(f))z(!1,"Unhandled fetcher revalidation redirect");else{let v=ke(f.data);e.fetchers.set(u,v)}}),{loaderData:l,errors:s}}function Zr(e,t,r,n){let a=Object.entries(t).filter(([,o])=>o!==ba).reduce((o,[l,s])=>(o[l]=s,o),{});for(let o of r){let l=o.route.id;if(!t.hasOwnProperty(l)&&e.hasOwnProperty(l)&&o.route.loader&&(a[l]=e[l]),n&&n.hasOwnProperty(l))break}return a}function ea(e){return e?me(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ue(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 ta(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 we(e,{pathname:t,routeId:r,method:n,type:a,message:o}={}){let l="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(l="Bad Request",n&&t&&r?s=`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"&&(s="Unable to encode submission body")):e===403?(l="Forbidden",s=`Route "${r}" does not match URL "${t}"`):e===404?(l="Not Found",s=`No route matches URL "${t}"`):e===405&&(l="Method Not Allowed",n&&t&&r?s=`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&&(s=`Invalid request method "${n.toUpperCase()}"`)),new Ae(e||500,l,new Error(s),!0)}function Rt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,a]=t[r];if(He(a))return{key:n,result:a}}}function Ca(e){let t=typeof e=="string"?Ne(e):e;return Oe({...t,hash:""})}function go(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function wo(e){return fr(e.result)&&ro.has(e.result.status)}function me(e){return e.type==="error"}function He(e){return(e&&e.type)==="redirect"}function ar(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function fr(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Eo(e){return to.has(e.toUpperCase())}function pe(e){return Zn.has(e.toUpperCase())}function hr(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function st(e,t){let r=typeof t=="string"?Ne(t).search:t.search;if(e[e.length-1].route.index&&hr(r||""))return e[e.length-1];let n=ga(e);return n[n.length-1]}function ra(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:l}=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(l!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:l,text:void 0}}}function Gt(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 bo(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 ot(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Ro(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 ke(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 So(e,t){try{let r=e.sessionStorage.getItem(Ea);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 xo(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(Ea,JSON.stringify(r))}catch(n){Z(!1,`Failed to save applied view transitions in sessionStorage (${n}).`)}}}function Lo(){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 Be=h.createContext(null);Be.displayName="DataRouter";var Je=h.createContext(null);Je.displayName="DataRouterState";var mr=h.createContext({isTransitioning:!1});mr.displayName="ViewTransition";var Ta=h.createContext(new Map);Ta.displayName="Fetchers";var Po=h.createContext(null);Po.displayName="Await";var Ee=h.createContext(null);Ee.displayName="Navigation";var Ft=h.createContext(null);Ft.displayName="Location";var Re=h.createContext({outlet:null,matches:[],isDataRoute:!1});Re.displayName="Route";var pr=h.createContext(null);pr.displayName="RouteError";function Co(e,{relative:t}={}){z(dt(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=h.useContext(Ee),{hash:a,pathname:o,search:l}=ft(e,{relative:t}),s=o;return r!=="/"&&(s=o==="/"?r:xe([r,o])),n.createHref({pathname:s,search:l,hash:a})}function dt(){return h.useContext(Ft)!=null}function Le(){return z(dt(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(Ft).location}var Ma="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Da(e){h.useContext(Ee).static||h.useLayoutEffect(e)}function To(){let{isDataRoute:e}=h.useContext(Re);return e?Yo():Mo()}function Mo(){z(dt(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(Be),{basename:t,navigator:r}=h.useContext(Ee),{matches:n}=h.useContext(Re),{pathname:a}=Le(),o=JSON.stringify(ur(n)),l=h.useRef(!1);return Da(()=>{l.current=!0}),h.useCallback((i,u={})=>{if(Z(l.current,Ma),!l.current)return;if(typeof i=="number"){r.go(i);return}let c=cr(i,JSON.parse(o),a,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:xe([t,c.pathname])),(u.replace?r.replace:r.push)(c,u.state,u)},[t,r,o,a,e])}var Do=h.createContext(null);function _o(e){let t=h.useContext(Re).outlet;return t&&h.createElement(Do.Provider,{value:e},t)}function ko(){let{matches:e}=h.useContext(Re),t=e[e.length-1];return t?t.params:{}}function ft(e,{relative:t}={}){let{matches:r}=h.useContext(Re),{pathname:n}=Le(),a=JSON.stringify(ur(r));return h.useMemo(()=>cr(e,JSON.parse(a),n,t==="path"),[e,a,n,t])}function Oo(e,t,r,n){z(dt(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a,static:o}=h.useContext(Ee),{matches:l}=h.useContext(Re),s=l[l.length-1],i=s?s.params:{},u=s?s.pathname:"/",c=s?s.pathnameBase:"/",m=s&&s.route;{let P=m&&m.path||"";ka(u,!m||P.endsWith("*")||P.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${P}">) 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.
33
-
34
- Please change the parent <Route path="${P}"> to <Route path="${P==="/"?"*":`${P}/*`}">.`)}let f=Le(),v;v=f;let g=v.pathname||"/",R=g;if(c!=="/"){let P=c.replace(/^\//,"").split("/");R="/"+g.replace(/^\//,"").split("/").slice(P.length).join("/")}let E=!o&&r&&r.matches&&r.matches.length>0?r.matches:Se(e,{pathname:R});return Z(m||E!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Z(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 "${v.pathname}${v.search}${v.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.`),$o(E&&E.map(P=>Object.assign({},P,{params:Object.assign({},i,P.params),pathname:xe([c,a.encodeLocation?a.encodeLocation(P.pathname).pathname:P.pathname]),pathnameBase:P.pathnameBase==="/"?c:xe([c,a.encodeLocation?a.encodeLocation(P.pathnameBase).pathname:P.pathnameBase])})),l,r,n)}function Ao(){let e=_a(),t=ze(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},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:o},"ErrorBoundary")," or"," ",h.createElement("code",{style:o},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),r?h.createElement("pre",{style:a},r):null,l)}var No=h.createElement(Ao,null),Fo=class extends h.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||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){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?h.createElement(Re.Provider,{value:this.props.routeContext},h.createElement(pr.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Io({routeContext:e,match:t,children:r}){let n=h.useContext(Be);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(Re.Provider,{value:e},r)}function $o(e,t=[],r=null,n=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 a=e,o=r==null?void 0:r.errors;if(o!=null){let i=a.findIndex(u=>u.route.id&&(o==null?void 0:o[u.route.id])!==void 0);z(i>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),a=a.slice(0,Math.min(a.length,i+1))}let l=!1,s=-1;if(r)for(let i=0;i<a.length;i++){let u=a[i];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(s=i),u.route.id){let{loaderData:c,errors:m}=r,f=u.route.loader&&!c.hasOwnProperty(u.route.id)&&(!m||m[u.route.id]===void 0);if(u.route.lazy||f){l=!0,s>=0?a=a.slice(0,s+1):a=[a[0]];break}}}return a.reduceRight((i,u,c)=>{let m,f=!1,v=null,g=null;r&&(m=o&&u.route.id?o[u.route.id]:void 0,v=u.route.errorElement||No,l&&(s<0&&c===0?(ka("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,g=null):s===c&&(f=!0,g=u.route.hydrateFallbackElement||null)));let R=t.concat(a.slice(0,c+1)),E=()=>{let b;return m?b=v:f?b=g:u.route.Component?b=h.createElement(u.route.Component,null):u.route.element?b=u.route.element:b=i,h.createElement(Io,{match:u,routeContext:{outlet:i,matches:R,isDataRoute:r!=null},children:b})};return r&&(u.route.ErrorBoundary||u.route.errorElement||c===0)?h.createElement(Fo,{location:r.location,revalidation:r.revalidation,component:v,error:m,children:E(),routeContext:{outlet:null,matches:R,isDataRoute:!0}}):E()},null)}function yr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jo(e){let t=h.useContext(Be);return z(t,yr(e)),t}function ht(e){let t=h.useContext(Je);return z(t,yr(e)),t}function Uo(e){let t=h.useContext(Re);return z(t,yr(e)),t}function mt(e){let t=Uo(e),r=t.matches[t.matches.length-1];return z(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Ho(){return mt("useRouteId")}function zo(){return ht("useNavigation").navigation}function vr(){let{matches:e,loaderData:t}=ht("useMatches");return h.useMemo(()=>e.map(r=>ma(r,t)),[e,t])}function Bo(){let e=ht("useLoaderData"),t=mt("useLoaderData");return e.loaderData[t]}function Wo(){let e=ht("useActionData"),t=mt("useLoaderData");return e.actionData?e.actionData[t]:void 0}function _a(){var n;let e=h.useContext(pr),t=ht("useRouteError"),r=mt("useRouteError");return e!==void 0?e:(n=t.errors)==null?void 0:n[r]}function Yo(){let{router:e}=jo("useNavigate"),t=mt("useNavigate"),r=h.useRef(!1);return Da(()=>{r.current=!0}),h.useCallback(async(a,o={})=>{Z(r.current,Ma),r.current&&(typeof a=="number"?e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var aa={};function ka(e,t,r){!t&&!aa[e]&&(aa[e]=!0,Z(!1,r))}var na={};function oa(e,t){!e&&!na[t]&&(na[t]=!0,console.warn(t))}function Vo(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Z(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:h.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Z(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:h.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Z(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:h.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Jo=["HydrateFallback","hydrateFallbackElement"],Go=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 Xo({router:e,flushSync:t}){let[r,n]=h.useState(e.state),[a,o]=h.useState(),[l,s]=h.useState({isTransitioning:!1}),[i,u]=h.useState(),[c,m]=h.useState(),[f,v]=h.useState(),g=h.useRef(new Map),R=h.useCallback((M,{deletedFetchers:T,flushSync:L,viewTransitionOpts:p})=>{M.fetchers.forEach((j,I)=>{j.data!==void 0&&g.current.set(I,j.data)}),T.forEach(j=>g.current.delete(j)),oa(L===!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 _=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(oa(p==null||_,"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."),!p||!_){t&&L?t(()=>n(M)):h.startTransition(()=>n(M));return}if(t&&L){t(()=>{c&&(i&&i.resolve(),c.skipTransition()),s({isTransitioning:!0,flushSync:!0,currentLocation:p.currentLocation,nextLocation:p.nextLocation})});let j=e.window.document.startViewTransition(()=>{t(()=>n(M))});j.finished.finally(()=>{t(()=>{u(void 0),m(void 0),o(void 0),s({isTransitioning:!1})})}),t(()=>m(j));return}c?(i&&i.resolve(),c.skipTransition(),v({state:M,currentLocation:p.currentLocation,nextLocation:p.nextLocation})):(o(M),s({isTransitioning:!0,flushSync:!1,currentLocation:p.currentLocation,nextLocation:p.nextLocation}))},[e.window,t,c,i]);h.useLayoutEffect(()=>e.subscribe(R),[e,R]),h.useEffect(()=>{l.isTransitioning&&!l.flushSync&&u(new Go)},[l]),h.useEffect(()=>{if(i&&a&&e.window){let M=a,T=i.promise,L=e.window.document.startViewTransition(async()=>{h.startTransition(()=>n(M)),await T});L.finished.finally(()=>{u(void 0),m(void 0),o(void 0),s({isTransitioning:!1})}),m(L)}},[a,i,e.window]),h.useEffect(()=>{i&&a&&r.location.key===a.location.key&&i.resolve()},[i,c,r.location,a]),h.useEffect(()=>{!l.isTransitioning&&f&&(o(f.state),s({isTransitioning:!0,flushSync:!1,currentLocation:f.currentLocation,nextLocation:f.nextLocation}),v(void 0))},[l.isTransitioning,f]);let E=h.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:M=>e.navigate(M),push:(M,T,L)=>e.navigate(M,{state:T,preventScrollReset:L==null?void 0:L.preventScrollReset}),replace:(M,T,L)=>e.navigate(M,{replace:!0,state:T,preventScrollReset:L==null?void 0:L.preventScrollReset})}),[e]),b=e.basename||"/",P=h.useMemo(()=>({router:e,navigator:E,static:!1,basename:b}),[e,E,b]);return h.createElement(h.Fragment,null,h.createElement(Be.Provider,{value:P},h.createElement(Je.Provider,{value:r},h.createElement(Ta.Provider,{value:g.current},h.createElement(mr.Provider,{value:l},h.createElement(Zo,{basename:b,location:r.location,navigationType:r.historyAction,navigator:E},h.createElement(Ko,{routes:e.routes,future:e.future,state:r})))))),null)}var Ko=h.memo(qo);function qo({routes:e,future:t,state:r}){return Oo(e,void 0,r,t)}function Qo(e){return _o(e.context)}function Zo({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:o=!1}){z(!dt(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=h.useMemo(()=>({basename:l,navigator:a,static:o,future:{}}),[l,a,o]);typeof r=="string"&&(r=Ne(r));let{pathname:i="/",search:u="",hash:c="",state:m=null,key:f="default"}=r,v=h.useMemo(()=>{let g=ye(i,l);return g==null?null:{location:{pathname:g,search:u,hash:c,state:m,key:f},navigationType:n}},[l,i,u,c,m,f,n]);return Z(v!=null,`<Router basename="${l}"> is not able to match the URL "${i}${u}${c}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:h.createElement(Ee.Provider,{value:s},h.createElement(Ft.Provider,{children:t,value:v}))}var Tt="get",Mt="application/x-www-form-urlencoded";function It(e){return e!=null&&typeof e.tagName=="string"}function ei(e){return It(e)&&e.tagName.toLowerCase()==="button"}function ti(e){return It(e)&&e.tagName.toLowerCase()==="form"}function ri(e){return It(e)&&e.tagName.toLowerCase()==="input"}function ai(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ni(e,t){return e.button===0&&(!t||t==="_self")&&!ai(e)}var St=null;function oi(){if(St===null)try{new FormData(document.createElement("form"),0),St=!1}catch{St=!0}return St}var ii=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Xt(e){return e!=null&&!ii.has(e)?(Z(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Mt}"`),null):e}function li(e,t){let r,n,a,o,l;if(ti(e)){let s=e.getAttribute("action");n=s?ye(s,t):null,r=e.getAttribute("method")||Tt,a=Xt(e.getAttribute("enctype"))||Mt,o=new FormData(e)}else if(ei(e)||ri(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let i=e.getAttribute("formaction")||s.getAttribute("action");if(n=i?ye(i,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||Tt,a=Xt(e.getAttribute("formenctype"))||Xt(s.getAttribute("enctype"))||Mt,o=new FormData(s,e),!oi()){let{name:u,type:c,value:m}=e;if(c==="image"){let f=u?`${u}.`:"";o.append(`${f}x`,"0"),o.append(`${f}y`,"0")}else u&&o.append(u,m)}}else{if(It(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Tt,n=null,a=Mt,l=e}return o&&a==="text/plain"&&(l=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:l}}function de(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function Oa(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 si(e,t,r){let n=e.map(o=>{var i;let l=t[o.route.id],s=r.routes[o.route.id];return[s&&s.css?s.css.map(u=>({rel:"stylesheet",href:u})):[],((i=l==null?void 0:l.links)==null?void 0:i.call(l))||[]]}).flat(2),a=wr(e,r);return Ia(n,a)}function Aa(e){return e.css?e.css.map(t=>({rel:"stylesheet",href:t})):[]}async function ui(e){if(!e.css)return;let t=Aa(e);await Promise.all(t.map(Fa))}async function Na(e,t){if(!e.css&&!t.links||!mi())return;let r=[];if(e.css&&r.push(...Aa(e)),t.links&&r.push(...t.links()),r.length===0)return;let n=[];for(let a of r)!gr(a)&&a.rel==="stylesheet"&&n.push({...a,rel:"preload",as:"style"});await Promise.all(n.map(Fa))}async function Fa(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 gr(e){return e!=null&&typeof e.page=="string"}function ci(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 di(e,t,r){let n=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let l=await Oa(o,r);return l.links?l.links():[]}return[]}));return Ia(n.flat(1).filter(ci).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function ia(e,t,r,n,a,o){let l=(i,u)=>r[u]?i.route.id!==r[u].route.id:!0,s=(i,u)=>{var c;return r[u].pathname!==i.pathname||((c=r[u].route.path)==null?void 0:c.endsWith("*"))&&r[u].params["*"]!==i.params["*"]};return o==="assets"?t.filter((i,u)=>l(i,u)||s(i,u)):o==="data"?t.filter((i,u)=>{var m;let c=n.routes[i.route.id];if(!c||!c.hasLoader)return!1;if(l(i,u)||s(i,u))return!0;if(i.route.shouldRevalidate){let f=i.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((m=r[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:i.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function wr(e,t,{includeHydrateFallback:r}={}){return fi(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 fi(e){return[...new Set(e)]}function hi(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function Ia(e,t){let r=new Set,n=new Set(t);return e.reduce((a,o)=>{if(t&&!gr(o)&&o.as==="script"&&o.href&&n.has(o.href))return a;let s=JSON.stringify(hi(o));return r.has(s)||(r.add(s),a.push({key:s,link:o})),a},[])}var xt;function mi(){if(xt!==void 0)return xt;let e=document.createElement("link");return xt=e.relList.supports("preload"),e=null,xt}function la(e){return{__html:e}}var pi=-1,yi=-2,vi=-3,gi=-4,wi=-5,Ei=-6,bi=-7,Ri="B",Si="D",$a="E",xi="M",Li="N",ja="P",Pi="R",Ci="S",Ti="Y",Mi="U",Di="Z",Ua=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};function _i(){const e=new TextDecoder;let t="";return new TransformStream({transform(r,n){const a=e.decode(r,{stream:!0}),o=(t+a).split(`
35
- `);t=o.pop()||"";for(const l of o)n.enqueue(l)},flush(r){t&&r.enqueue(t)}})}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Kt=typeof window<"u"?window:typeof globalThis<"u"?globalThis:void 0;function nr(e){const{hydrated:t,values:r}=this;if(typeof e=="number")return sa.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,sa.call(this,n)}function sa(e){const{hydrated:t,values:r,deferred:n,plugins:a}=this;let o;const l=[[e,i=>{o=i}]];let s=[];for(;l.length>0;){const[i,u]=l.pop();switch(i){case bi:u(void 0);continue;case wi:u(null);continue;case yi:u(NaN);continue;case Ei:u(1/0);continue;case vi:u(-1/0);continue;case gi:u(-0);continue}if(t[i]){u(t[i]);continue}const c=r[i];if(!c||typeof c!="object"){t[i]=c,u(c);continue}if(Array.isArray(c))if(typeof c[0]=="string"){const[m,f,v]=c;switch(m){case Si:u(t[i]=new Date(f));continue;case Mi:u(t[i]=new URL(f));continue;case Ri:u(t[i]=BigInt(f));continue;case Pi:u(t[i]=new RegExp(f,v));continue;case Ti:u(t[i]=Symbol.for(f));continue;case Ci:const g=new Set;t[i]=g;for(let T=c.length-1;T>0;T--)l.push([c[T],L=>{g.add(L)}]);u(g);continue;case xi:const R=new Map;t[i]=R;for(let T=c.length-2;T>0;T-=2){const L=[];l.push([c[T+1],p=>{L[1]=p}]),l.push([c[T],p=>{L[0]=p}]),s.push(()=>{R.set(L[0],L[1])})}u(R);continue;case Li:const E=Object.create(null);t[i]=E;for(const T of Object.keys(f).reverse()){const L=[];l.push([f[T],p=>{L[1]=p}]),l.push([Number(T.slice(1)),p=>{L[0]=p}]),s.push(()=>{E[L[0]]=L[1]})}u(E);continue;case ja:if(t[f])u(t[i]=t[f]);else{const T=new Ua;n[f]=T,u(t[i]=T.promise)}continue;case $a:const[,b,P]=c;let M=P&&Kt&&Kt[P]?new Kt[P](b):new Error(b);t[i]=M,u(M);continue;case Di:u(t[i]=t[f]);continue;default:if(Array.isArray(a)){const T=[],L=c.slice(1);for(let p=0;p<L.length;p++){const _=L[p];l.push([_,j=>{T[p]=j}])}s.push(()=>{for(const p of a){const _=p(c[0],...T);if(_){u(t[i]=_.value);return}}throw new SyntaxError});continue}throw new SyntaxError}}else{const m=[];t[i]=m;for(let f=0;f<c.length;f++){const v=c[f];v!==pi&&l.push([v,g=>{m[f]=g}])}u(m);continue}else{const m={};t[i]=m;for(const f of Object.keys(c).reverse()){const v=[];l.push([c[f],g=>{v[1]=g}]),l.push([Number(f.slice(1)),g=>{v[0]=g}]),s.push(()=>{m[v[0]]=v[1]})}u(m);continue}}for(;s.length>0;)s.pop()();return o}async function ki(e,t){const{plugins:r}=t??{},n=new Ua,a=e.pipeThrough(_i()).getReader(),o={values:[],hydrated:[],deferred:{},plugins:r},l=await Oi.call(o,a);let s=n.promise;return l.done?n.resolve():s=Ai.call(o,a).then(n.resolve).catch(i=>{for(const u of Object.values(o.deferred))u.reject(i);n.reject(i)}),{done:s.then(()=>a.closed),value:l.value}}async function Oi(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:nr.call(this,r)}}async function Ai(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const r=t.value;switch(r[0]){case ja:{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 l=r.slice(n+1);let s;try{s=JSON.parse(l)}catch{throw new SyntaxError}const i=nr.call(this,s);o.resolve(i);break}case $a:{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 l=r.slice(n+1);let s;try{s=JSON.parse(l)}catch{throw new SyntaxError}const i=nr.call(this,s);o.reject(i);break}default:throw new SyntaxError}t=await e.read()}}async function Ni(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 or=Symbol("SingleFetchRedirect"),Ha=class extends Error{},Fi=202,za=new Set([100,101,204,205]);function Ii(e,t,r,n,a){let o=$i(e,l=>{let s=t.routes[l.route.id];de(s,"Route not found in manifest");let i=r[l.route.id];return{hasLoader:s.hasLoader,hasClientLoader:s.hasClientLoader,hasShouldRevalidate:!!(i!=null&&i.shouldRevalidate)}},Yi,n,a);return async l=>l.unstable_runClientMiddleware(o)}function $i(e,t,r,n,a){return async o=>{let{request:l,matches:s,fetcherKey:i}=o,u=e();if(l.method!=="GET")return ji(o,r,a);let c=s.some(m=>{let{hasLoader:f,hasClientLoader:v}=t(m);return m.unstable_shouldCallHandler()&&f&&!v});return!n&&!c?Ui(o,t,r,a):i?Bi(o,r,a):Hi(o,u,t,r,n,a)}}async function ji(e,t,r){let n=e.matches.find(l=>l.unstable_shouldCallHandler());de(n,"No action match found");let a,o=await n.resolve(async l=>await l(async()=>{let{data:i,status:u}=await t(e,r,[n.route.id]);return a=u,ct(i,n.route.id)}));return fr(o.result)||ze(o.result)||ar(o.result)?{[n.route.id]:o}:{[n.route.id]:{type:o.type,result:qn(o.result,a)}}}async function Ui(e,t,r,n){let a=e.matches.filter(l=>l.unstable_shouldCallHandler()),o={};return await Promise.all(a.map(l=>l.resolve(async s=>{try{let{hasClientLoader:i}=t(l),u=l.route.id,c=i?await s(async()=>{let{data:m}=await r(e,n,[u]);return ct(m,u)}):await s();o[l.route.id]={type:"data",result:c}}catch(i){o[l.route.id]={type:"error",result:i}}}))),o}async function Hi(e,t,r,n,a,o){let l=new Set,s=!1,i=e.matches.map(()=>ua()),u=ua(),c={},m=Promise.all(e.matches.map(async(v,g)=>v.resolve(async R=>{i[g].resolve();let E=v.route.id,{hasLoader:b,hasClientLoader:P,hasShouldRevalidate:M}=r(v),T=!v.unstable_shouldRevalidateArgs||v.unstable_shouldRevalidateArgs.actionStatus==null||v.unstable_shouldRevalidateArgs.actionStatus<400;if(!v.unstable_shouldCallHandler(T)){s||(s=v.unstable_shouldRevalidateArgs!=null&&b&&M===!0);return}if(P){b&&(s=!0);try{let p=await R(async()=>{let{data:_}=await n(e,o,[E]);return ct(_,E)});c[E]={type:"data",result:p}}catch(p){c[E]={type:"error",result:p}}return}b&&l.add(E);try{let p=await R(async()=>{let _=await u.promise;return ct(_,E)});c[E]={type:"data",result:p}}catch(p){c[E]={type:"error",result:p}}})));if(await Promise.all(i.map(v=>v.promise)),(!t.state.initialized&&t.state.navigation.state==="idle"||l.size===0)&&!window.__reactRouterHdrActive)u.resolve({routes:{}});else{let v=a&&s&&l.size>0?[...l.keys()]:void 0;try{let g=await n(e,o,v);u.resolve(g.data)}catch(g){u.reject(g)}}return await m,await zi(u.promise,e.matches,l,c),c}async function zi(e,t,r,n){try{let a,o=await e;if("routes"in o){for(let l of t)if(l.route.id in o.routes){let s=o.routes[l.route.id];if("error"in s){a=s.error;break}}}a!==void 0&&Array.from(r.values()).forEach(l=>{n[l].result instanceof Ha&&(n[l].result=a)})}catch{}}async function Bi(e,t,r){let n=e.matches.find(l=>l.unstable_shouldCallHandler());de(n,"No fetcher match found");let a=n.route.id,o=await n.resolve(async l=>l(async()=>{let{data:s}=await t(e,r,[a]);return ct(s,a)}));return{[n.route.id]:o}}function Wi(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 Ba(e,t){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname="_root.data":t&&ye(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.data`:r.pathname=`${r.pathname.replace(/\/$/,"")}.data`,r}async function Yi(e,t,r){let{request:n}=e,a=Ba(n.url,t);n.method==="GET"&&(a=Wi(a),r&&a.searchParams.set("_routes",r.join(",")));let o=await fetch(a,await Ni(n));if(o.status===404&&!o.headers.has("X-Remix-Response"))throw new Ae(404,"Not Found",!0);if(o.status===204&&o.headers.has("X-Remix-Redirect"))return{status:Fi,data:{redirect:{redirect:o.headers.get("X-Remix-Redirect"),status:Number(o.headers.get("X-Remix-Status")||"302"),revalidate:o.headers.get("X-Remix-Revalidate")==="true",reload:o.headers.get("X-Remix-Reload-Document")==="true",replace:o.headers.get("X-Remix-Replace")==="true"}}};if(za.has(o.status)){let l={};return r&&n.method!=="GET"&&(l[r[0]]={data:void 0}),{status:o.status,data:{routes:l}}}de(o.body,"No response body to decode");try{let l=await Wa(o.body,window),s;if(n.method==="GET"){let i=l.value;or in i?s={redirect:i[or]}:s={routes:i}}else{let i=l.value,u=r==null?void 0:r[0];de(u,"No routeId found for single fetch call decoding"),"redirect"in i?s={redirect:i}:s={routes:{[u]:i}}}return{status:o.status,data:s}}catch{throw new Error("Unable to decode turbo-stream response")}}function Wa(e,t){return ki(e,{plugins:[(r,...n)=>{if(r==="SanitizedError"){let[a,o,l]=n,s=Error;a&&a in t&&typeof t[a]=="function"&&(s=t[a]);let i=new s(o);return i.stack=l,{value:i}}if(r==="ErrorResponse"){let[a,o,l]=n;return{value:new Ae(o,l,a)}}if(r==="SingleFetchRedirect")return{value:{[or]:n[0]}};if(r==="SingleFetchClassInstance")return{value:n[0]};if(r==="SingleFetchFallback")return{value:void 0}}]})}function ct(e,t){if("redirect"in e){let{redirect:n,revalidate:a,reload:o,replace:l,status:s}=e.redirect;throw Qn(n,{status:s,headers:{...a?{"X-Remix-Revalidate":"yes"}:null,...o?{"X-Remix-Reload-Document":"yes"}:null,...l?{"X-Remix-Replace":"yes"}:null}})}let r=e.routes[t];if(r==null)throw new Ha(`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 ua(){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 Vi=class extends h.Component{constructor(e){super(e),this.state={error:e.error||null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error||null,location:e.location}:{error:e.error||t.error,location:t.location}}render(){return this.state.error?h.createElement(Ya,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function Ya({error:e,isOutsideRemixApp:t}){console.error(e);let r=h.createElement("script",{dangerouslySetInnerHTML:{__html:`
36
- console.log(
37
- "💿 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."
38
- );
39
- `}});if(ze(e))return h.createElement(ir,{title:"Unhandled Thrown Response!"},h.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 h.createElement(ir,{title:"Application Error!",isOutsideRemixApp:t},h.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),h.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},n.stack),r)}function ir({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){var o;let{routeModules:a}=Ge();return(o=a.root)!=null&&o.Layout&&!r?n:h.createElement("html",{lang:"en"},h.createElement("head",null,h.createElement("meta",{charSet:"utf-8"}),h.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),h.createElement("title",null,e)),h.createElement("body",null,h.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,t?h.createElement(qa,null):null)))}function Ji(){return h.createElement(ir,{title:"Loading...",renderScripts:!0},h.createElement("script",{dangerouslySetInnerHTML:{__html:`
40
- console.log(
41
- "💿 Hey developer 👋. You can provide a way better UX than this " +
42
- "when your app is loading JS modules and/or running \`clientLoader\` " +
43
- "functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +
44
- "for more information."
45
- );
46
- `}}))}function Va(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 Gi(e,t,r){let n=Ja(t),a=t.HydrateFallback&&(!r||e.id==="root")?t.HydrateFallback:e.id==="root"?Ji:void 0,o=t.ErrorBoundary?t.ErrorBoundary:e.id==="root"?()=>h.createElement(Ya,{error:_a()}):void 0;return e.id==="root"&&t.Layout?{...n?{element:h.createElement(t.Layout,null,h.createElement(n,null))}:{Component:n},...o?{errorElement:h.createElement(t.Layout,null,h.createElement(o,null))}:{ErrorBoundary:o},...a?{hydrateFallbackElement:h.createElement(t.Layout,null,h.createElement(a,null))}:{HydrateFallback:a}}:{Component:n,ErrorBoundary:o,HydrateFallback:a}}function Xi(e,t,r,n,a,o){return $t(t,r,n,a,o,"",Va(t),e)}function Lt(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 Ae(400,"Bad Request",new Error(n),!0)}}function qt(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 Ae(405,"Method Not Allowed",new Error(n),!0)}function $t(e,t,r,n,a,o="",l=Va(e),s){return(l[o]||[]).map(i=>{var P,M,T;let u=t[i.id];function c(L){return de(typeof L=="function","No single fetch function available for route handler"),L()}function m(L){return i.hasLoader?c(L):Promise.resolve(null)}function f(L){if(!i.hasAction)throw qt("action",i.id);return c(L)}function v(L){import(L)}function g(L){L.clientActionModule&&v(L.clientActionModule),L.clientLoaderModule&&v(L.clientLoaderModule)}async function R(L){let p=t[i.id],_=p?Na(i,p):Promise.resolve();try{return L()}finally{await _}}let E={id:i.id,index:i.index,path:i.path};if(u){Object.assign(E,{...E,...Gi(i,u,a),unstable_middleware:u.unstable_clientMiddleware,handle:u.handle,shouldRevalidate:ca(E.path,u,i,n,s)});let L=r&&r.loaderData&&i.id in r.loaderData,p=L?(P=r==null?void 0:r.loaderData)==null?void 0:P[i.id]:void 0,_=r&&r.errors&&i.id in r.errors,j=_?(M=r==null?void 0:r.errors)==null?void 0:M[i.id]:void 0,I=s==null&&(((T=u.clientLoader)==null?void 0:T.hydrate)===!0||!i.hasLoader);E.loader=async({request:G,params:Q,context:oe},W)=>{try{return await R(async()=>(de(u,"No `routeModule` available for critical-route loader"),u.clientLoader?u.clientLoader({request:G,params:Q,context:oe,async serverLoader(){if(Lt("loader",i),I){if(L)return p;if(_)throw j}return m(W)}}):m(W)))}finally{I=!1}},E.loader.hydrate=Ga(i.id,u.clientLoader,i.hasLoader,a),E.action=({request:G,params:Q,context:oe},W)=>R(async()=>{if(de(u,"No `routeModule` available for critical-route action"),!u.clientAction){if(a)throw qt("clientAction",i.id);return f(W)}return u.clientAction({request:G,params:Q,context:oe,async serverAction(){return Lt("action",i),f(W)}})})}else{i.hasClientLoader||(E.loader=(_,j)=>R(()=>m(j))),i.hasClientAction||(E.action=(_,j)=>R(()=>{if(a)throw qt("clientAction",i.id);return f(j)}));let L;async function p(){return L?await L:(L=(async()=>{(i.clientLoaderModule||i.clientActionModule)&&await new Promise(j=>setTimeout(j,0));let _=qi(i,t);return g(i),await _})(),await L)}E.lazy={loader:i.hasClientLoader?async()=>{let{clientLoader:_}=i.clientLoaderModule?await import(i.clientLoaderModule):await p();return de(_,"No `clientLoader` export found"),(j,I)=>_({...j,async serverLoader(){return Lt("loader",i),m(I)}})}:void 0,action:i.hasClientAction?async()=>{let _=i.clientActionModule?import(i.clientActionModule):p();g(i);let{clientAction:j}=await _;return de(j,"No `clientAction` export found"),(I,G)=>j({...I,async serverAction(){return Lt("action",i),f(G)}})}:void 0,unstable_middleware:i.hasClientMiddleware?async()=>{let{unstable_clientMiddleware:_}=i.clientMiddlewareModule?await import(i.clientMiddlewareModule):await p();return de(_,"No `unstable_clientMiddleware` export found"),_}:void 0,shouldRevalidate:async()=>{let _=await p();return ca(E.path,_,i,n,s)},handle:async()=>(await p()).handle,Component:async()=>(await p()).Component,ErrorBoundary:i.hasErrorBoundary?async()=>(await p()).ErrorBoundary:void 0}}let b=$t(e,t,r,n,a,i.id,l,s);return b.length>0&&(E.children=b),E})}function ca(e,t,r,n,a){if(a)return Ki(r.id,t.shouldRevalidate,a);if(!n&&r.hasLoader&&!r.hasClientLoader){let o=e?va(e)[1].map(s=>s.paramName):[];const l=s=>o.some(i=>s.currentParams[i]!==s.nextParams[i]);if(t.shouldRevalidate){let s=t.shouldRevalidate;return i=>s({...i,defaultShouldRevalidate:l(i)})}else return s=>l(s)}if(n&&t.shouldRevalidate){let o=t.shouldRevalidate;return l=>o({...l,defaultShouldRevalidate:!0})}return t.shouldRevalidate}function Ki(e,t,r){let n=!1;return a=>n?t?t(a):a.defaultShouldRevalidate:(n=!0,r.has(e))}async function qi(e,t){let r=Oa(e,t),n=ui(e),a=await r;return await Promise.all([n,Na(e,a)]),{Component:Ja(a),ErrorBoundary:a.ErrorBoundary,unstable_clientMiddleware:a.unstable_clientMiddleware,clientAction:a.clientAction,clientLoader:a.clientLoader,handle:a.handle,links:a.links,meta:a.meta,shouldRevalidate:a.shouldRevalidate}}function Ja(e){if(e.default==null)return;if(!(typeof e.default=="object"&&Object.keys(e.default).length===0))return e.default}function Ga(e,t,r,n){return n&&e!=="root"||t!=null&&(t.hydrate===!0||r!==!0)}var Dt=new Set,Qi=1e3,Nt=new Set,Zi=7680;function Er(e,t){return e.mode==="lazy"&&t===!0}function el({sri:e,...t},r){let n=new Set(r.state.matches.map(s=>s.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(s=>{let i=Se(r.routes,s,r.basename);i&&i.forEach(u=>n.add(u.route.id))});let l=[...n].reduce((s,i)=>Object.assign(s,{[i]:t.routes[i]}),{});return{...t,routes:l,sri:e?!0:void 0}}function tl(e,t,r,n,a,o){if(Er(n,r))return async({path:l,patch:s,signal:i,fetcherKey:u})=>{Nt.has(l)||await Xa([l],u?window.location.href:l,e,t,r,a,o,n.manifestPath,s,i)}}function rl(e,t,r,n,a,o){h.useEffect(()=>{var c,m;if(!Er(a,n)||((m=(c=window.navigator)==null?void 0:c.connection)==null?void 0:m.saveData)===!0)return;function l(f){let v=f.tagName==="FORM"?f.getAttribute("action"):f.getAttribute("href");if(!v)return;let g=f.tagName==="A"?f.pathname:new URL(v,window.location.origin).pathname;Nt.has(g)||Dt.add(g)}async function s(){document.querySelectorAll("a[data-discover], form[data-discover]").forEach(l);let f=Array.from(Dt.keys()).filter(v=>Nt.has(v)?(Dt.delete(v),!1):!0);if(f.length!==0)try{await Xa(f,null,t,r,n,o,e.basename,a.manifestPath,e.patchRoutes)}catch(v){console.error("Failed to fetch manifest patches",v)}}let i=ol(s,100);s();let u=new MutationObserver(()=>i());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 al(e,t){let r=e||"/__manifest";return t==null?r:`${t}${r}`.replace(/\/+/g,"/")}var Qt="react-router-manifest-version";async function Xa(e,t,r,n,a,o,l,s,i,u){let c=new URL(al(s,l),window.location.origin);if(e.sort().forEach(R=>c.searchParams.append("p",R)),c.searchParams.set("version",r.version),c.toString().length>Zi){Dt.clear();return}let m;try{let R=await fetch(c,{signal:u});if(R.ok){if(R.status===204&&R.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}if(sessionStorage.getItem(Qt)===r.version){console.error("Unable to discover routes due to manifest version mismatch.");return}sessionStorage.setItem(Qt,r.version),window.location.href=t,console.warn("Detected manifest version mismatch, reloading..."),await new Promise(()=>{})}else if(R.status>=400)throw new Error(await R.text())}else throw new Error(`${R.status} ${R.statusText}`);sessionStorage.removeItem(Qt),m=await R.json()}catch(R){if(u!=null&&u.aborted)return;throw R}let f=new Set(Object.keys(r.routes)),v=Object.values(m).reduce((R,E)=>(E&&!f.has(E.id)&&(R[E.id]=E),R),{});Object.assign(r.routes,v),e.forEach(R=>nl(R,Nt));let g=new Set;Object.values(v).forEach(R=>{R&&(!R.parentId||!v[R.parentId])&&g.add(R.parentId)}),g.forEach(R=>i(R||null,$t(v,n,null,a,o,R)))}function nl(e,t){if(t.size>=Qi){let r=t.values().next().value;t.delete(r)}t.add(e)}function ol(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}function br(){let e=h.useContext(Be);return de(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function jt(){let e=h.useContext(Je);return de(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var pt=h.createContext(void 0);pt.displayName="FrameworkContext";function Ge(){let e=h.useContext(pt);return de(e,"You must render this element inside a <HydratedRouter> element"),e}function il(e,t){let r=h.useContext(pt),[n,a]=h.useState(!1),[o,l]=h.useState(!1),{onFocus:s,onBlur:i,onMouseEnter:u,onMouseLeave:c,onTouchStart:m}=t,f=h.useRef(null);h.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let R=b=>{b.forEach(P=>{l(P.isIntersecting)})},E=new IntersectionObserver(R,{threshold:.5});return f.current&&E.observe(f.current),()=>{E.disconnect()}}},[e]),h.useEffect(()=>{if(n){let R=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(R)}}},[n]);let v=()=>{a(!0)},g=()=>{a(!1),l(!1)};return r?e!=="intent"?[o,f,{}]:[o,f,{onFocus:it(s,v),onBlur:it(i,g),onMouseEnter:it(u,v),onMouseLeave:it(c,g),onTouchStart:it(m,v)}]:[!1,f,{}]}function it(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Rr(e,t,r){if(r&&!_t)return[e[0]];if(t){let n=e.findIndex(a=>t[a.route.id]!==void 0);return e.slice(0,n+1)}return e}function ll(){let{isSpaMode:e,manifest:t,routeModules:r,criticalCss:n}=Ge(),{errors:a,matches:o}=jt(),l=Rr(o,a,e),s=h.useMemo(()=>si(l,r,t),[l,r,t]);return h.createElement(h.Fragment,null,typeof n=="string"?h.createElement("style",{dangerouslySetInnerHTML:{__html:n}}):null,typeof n=="object"?h.createElement("link",{rel:"stylesheet",href:n.href}):null,s.map(({key:i,link:u})=>gr(u)?h.createElement(Ka,{key:i,...u}):h.createElement("link",{key:i,...u})))}function Ka({page:e,...t}){let{router:r}=br(),n=h.useMemo(()=>Se(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?h.createElement(ul,{page:e,matches:n,...t}):null}function sl(e){let{manifest:t,routeModules:r}=Ge(),[n,a]=h.useState([]);return h.useEffect(()=>{let o=!1;return di(e,t,r).then(l=>{o||a(l)}),()=>{o=!0}},[e,t,r]),n}function ul({page:e,matches:t,...r}){let n=Le(),{manifest:a,routeModules:o}=Ge(),{basename:l}=br(),{loaderData:s,matches:i}=jt(),u=h.useMemo(()=>ia(e,t,i,a,n,"data"),[e,t,i,a,n]),c=h.useMemo(()=>ia(e,t,i,a,n,"assets"),[e,t,i,a,n]),m=h.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let g=new Set,R=!1;if(t.forEach(b=>{var M;let P=a.routes[b.route.id];!P||!P.hasLoader||(!u.some(T=>T.route.id===b.route.id)&&b.route.id in s&&((M=o[b.route.id])!=null&&M.shouldRevalidate)||P.hasClientLoader?R=!0:g.add(b.route.id))}),g.size===0)return[];let E=Ba(e,l);return R&&g.size>0&&E.searchParams.set("_routes",t.filter(b=>g.has(b.route.id)).map(b=>b.route.id).join(",")),[E.pathname+E.search]},[l,s,n,a,u,t,e,o]),f=h.useMemo(()=>wr(c,a),[c,a]),v=sl(c);return h.createElement(h.Fragment,null,m.map(g=>h.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...r})),f.map(g=>h.createElement("link",{key:g,rel:"modulepreload",href:g,...r})),v.map(({key:g,link:R})=>h.createElement("link",{key:g,...R})))}function cl(){let{isSpaMode:e,routeModules:t}=Ge(),{errors:r,matches:n,loaderData:a}=jt(),o=Le(),l=Rr(n,r,e),s=null;r&&(s=r[l[l.length-1].route.id]);let i=[],u=null,c=[];for(let m=0;m<l.length;m++){let f=l[m],v=f.route.id,g=a[v],R=f.params,E=t[v],b=[],P={id:v,data:g,meta:[],params:f.params,pathname:f.pathname,handle:f.route.handle,error:s};if(c[m]=P,E!=null&&E.meta?b=typeof E.meta=="function"?E.meta({data:g,params:R,location:o,matches:c,error:s}):Array.isArray(E.meta)?[...E.meta]:E.meta:u&&(b=[...u]),b=b||[],!Array.isArray(b))throw new Error("The route at "+f.route.path+` returns an invalid value. All route meta functions must return an array of meta objects.
47
-
48
- To reference the meta function API, see https://remix.run/route/meta`);P.meta=b,c[m]=P,i=[...b],u=i}return h.createElement(h.Fragment,null,i.flat().map(m=>{if(!m)return null;if("tagName"in m){let{tagName:f,...v}=m;if(!dl(f))return console.warn(`A meta object uses an invalid tagName: ${f}. Expected either 'link' or 'meta'`),null;let g=f;return h.createElement(g,{key:JSON.stringify(v),...v})}if("title"in m)return h.createElement("title",{key:"title"},String(m.title));if("charset"in m&&(m.charSet??(m.charSet=m.charset),delete m.charset),"charSet"in m&&m.charSet!=null)return typeof m.charSet=="string"?h.createElement("meta",{key:"charSet",charSet:m.charSet}):null;if("script:ld+json"in m)try{let f=JSON.stringify(m["script:ld+json"]);return h.createElement("script",{key:`script:ld+json:${f}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:f}})}catch{return null}return h.createElement("meta",{key:JSON.stringify(m),...m})}))}function dl(e){return typeof e=="string"&&/^(meta|link)$/.test(e)}var _t=!1;function qa(e){let{manifest:t,serverHandoffString:r,isSpaMode:n,renderMeta:a,routeDiscovery:o,ssr:l}=Ge(),{router:s,static:i,staticContext:u}=br(),{matches:c}=jt(),m=Er(o,l);a&&(a.didRenderScripts=!0);let f=Rr(c,null,n);h.useEffect(()=>{_t=!0},[]);let v=h.useMemo(()=>{var M;let b=u?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",P=i?`${(M=t.hmr)!=null&&M.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${m?"":`import ${JSON.stringify(t.url)}`};
49
- ${f.map((T,L)=>{let p=`route${L}`,_=t.routes[T.route.id];de(_,`Route ${T.route.id} not found in manifest`);let{clientActionModule:j,clientLoaderModule:I,clientMiddlewareModule:G,hydrateFallbackModule:Q,module:oe}=_,W=[...j?[{module:j,varName:`${p}_clientAction`}]:[],...I?[{module:I,varName:`${p}_clientLoader`}]:[],...G?[{module:G,varName:`${p}_clientMiddleware`}]:[],...Q?[{module:Q,varName:`${p}_HydrateFallback`}]:[],{module:oe,varName:`${p}_main`}];if(W.length===1)return`import * as ${p} from ${JSON.stringify(oe)};`;let V=W.map(B=>`import * as ${B.varName} from "${B.module}";`).join(`
50
- `),te=`const ${p} = {${W.map(B=>`...${B.varName}`).join(",")}};`;return[V,te].join(`
51
- `)}).join(`
52
- `)}
53
- ${m?`window.__reactRouterManifest = ${JSON.stringify(el(t,s),null,2)};`:""}
54
- window.__reactRouterRouteModules = {${f.map((T,L)=>`${JSON.stringify(T.route.id)}:route${L}`).join(",")}};
55
-
56
- import(${JSON.stringify(t.entry.module)});`:" ";return h.createElement(h.Fragment,null,h.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:la(b),type:void 0}),h.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:la(P),type:"module",async:!0}))},[]),g=_t?[]:fl(t.entry.imports.concat(wr(f,t,{includeHydrateFallback:!0}))),R=typeof t.sri=="object"?t.sri:{};return _t?null:h.createElement(h.Fragment,null,typeof t.sri=="object"?h.createElement("script",{"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:R})}}):null,m?null:h.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:R[t.url],suppressHydrationWarning:!0}),h.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:R[t.entry.module],suppressHydrationWarning:!0}),g.map(E=>h.createElement("link",{key:E,rel:"modulepreload",href:E,crossOrigin:e.crossOrigin,integrity:R[E],suppressHydrationWarning:!0})),v)}function fl(e){return[...new Set(e)]}function hl(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var Qa=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Qa&&(window.__reactRouterVersion="7.6.0")}catch{}var Za=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,en=h.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:a,reloadDocument:o,replace:l,state:s,target:i,to:u,preventScrollReset:c,viewTransition:m,...f},v){let{basename:g}=h.useContext(Ee),R=typeof u=="string"&&Za.test(u),E,b=!1;if(typeof u=="string"&&R&&(E=u,Qa))try{let I=new URL(window.location.href),G=u.startsWith("//")?new URL(I.protocol+u):new URL(u),Q=ye(G.pathname,g);G.origin===I.origin&&Q!=null?u=Q+G.search+G.hash:b=!0}catch{Z(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let P=Co(u,{relative:a}),[M,T,L]=il(n,f),p=vl(u,{replace:l,state:s,target:i,preventScrollReset:c,relative:a,viewTransition:m});function _(I){t&&t(I),I.defaultPrevented||p(I)}let j=h.createElement("a",{...f,...L,href:E||P,onClick:b||o?t:_,ref:hl(v,T),target:i,"data-discover":!R&&r==="render"?"true":void 0});return M&&!R?h.createElement(h.Fragment,null,j,h.createElement(Ka,{page:P})):j});en.displayName="Link";var ml=h.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:a=!1,style:o,to:l,viewTransition:s,children:i,...u},c){let m=ft(l,{relative:u.relative}),f=Le(),v=h.useContext(Je),{navigator:g,basename:R}=h.useContext(Ee),E=v!=null&&xl(m)&&s===!0,b=g.encodeLocation?g.encodeLocation(m).pathname:m.pathname,P=f.pathname,M=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;r||(P=P.toLowerCase(),M=M?M.toLowerCase():null,b=b.toLowerCase()),M&&R&&(M=ye(M,R)||M);const T=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let L=P===b||!a&&P.startsWith(b)&&P.charAt(T)==="/",p=M!=null&&(M===b||!a&&M.startsWith(b)&&M.charAt(b.length)==="/"),_={isActive:L,isPending:p,isTransitioning:E},j=L?t:void 0,I;typeof n=="function"?I=n(_):I=[n,L?"active":null,p?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let G=typeof o=="function"?o(_):o;return h.createElement(en,{...u,"aria-current":j,className:I,ref:c,style:G,to:l,viewTransition:s},typeof i=="function"?i(_):i)});ml.displayName="NavLink";var pl=h.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:l=Tt,action:s,onSubmit:i,relative:u,preventScrollReset:c,viewTransition:m,...f},v)=>{let g=El(),R=bl(s,{relative:u}),E=l.toLowerCase()==="get"?"get":"post",b=typeof s=="string"&&Za.test(s),P=M=>{if(i&&i(M),M.defaultPrevented)return;M.preventDefault();let T=M.nativeEvent.submitter,L=(T==null?void 0:T.getAttribute("formmethod"))||l;g(T||M.currentTarget,{fetcherKey:t,method:L,navigate:r,replace:a,state:o,relative:u,preventScrollReset:c,viewTransition:m})};return h.createElement("form",{ref:v,method:E,action:R,onSubmit:n?i:P,...f,"data-discover":!b&&e==="render"?"true":void 0})});pl.displayName="Form";function tn({getKey:e,storageKey:t,...r}){let n=h.useContext(pt),{basename:a}=h.useContext(Ee),o=Le(),l=vr();Rl({getKey:e,storageKey:t});let s=h.useMemo(()=>{if(!n||!e)return null;let u=sr(o,l,a,e);return u!==o.key?u:null},[]);if(!n||n.isSpaMode)return null;let i=((u,c)=>{if(!window.history.state||!window.history.state.key){let m=Math.random().toString(32).slice(2);window.history.replaceState({key:m},"")}try{let f=JSON.parse(sessionStorage.getItem(u)||"{}")[c||window.history.state.key];typeof f=="number"&&window.scrollTo(0,f)}catch(m){console.error(m),sessionStorage.removeItem(u)}}).toString();return h.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${i})(${JSON.stringify(t||lr)}, ${JSON.stringify(s)})`}})}tn.displayName="ScrollRestoration";function rn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Sr(e){let t=h.useContext(Be);return z(t,rn(e)),t}function yl(e){let t=h.useContext(Je);return z(t,rn(e)),t}function vl(e,{target:t,replace:r,state:n,preventScrollReset:a,relative:o,viewTransition:l}={}){let s=To(),i=Le(),u=ft(e,{relative:o});return h.useCallback(c=>{if(ni(c,t)){c.preventDefault();let m=r!==void 0?r:Oe(i)===Oe(u);s(e,{replace:m,state:n,preventScrollReset:a,relative:o,viewTransition:l})}},[i,s,u,r,n,t,e,a,o,l])}var gl=0,wl=()=>`__${String(++gl)}__`;function El(){let{router:e}=Sr("useSubmit"),{basename:t}=h.useContext(Ee),r=Ho();return h.useCallback(async(n,a={})=>{let{action:o,method:l,encType:s,formData:i,body:u}=li(n,t);if(a.navigate===!1){let c=a.fetcherKey||wl();await e.fetch(c,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:i,body:u,formMethod:a.method||l,formEncType:a.encType||s,flushSync:a.flushSync})}else await e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:i,body:u,formMethod:a.method||l,formEncType:a.encType||s,replace:a.replace,state:a.state,fromRouteId:r,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,r])}function bl(e,{relative:t}={}){let{basename:r}=h.useContext(Ee),n=h.useContext(Re);z(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),o={...ft(e||".",{relative:t})},l=Le();if(e==null){o.search=l.search;let s=new URLSearchParams(o.search),i=s.getAll("index");if(i.some(c=>c==="")){s.delete("index"),i.filter(m=>m).forEach(m=>s.append("index",m));let c=s.toString();o.search=c?`?${c}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:xe([r,o.pathname])),Oe(o)}var lr="react-router-scroll-positions",Pt={};function sr(e,t,r,n){let a=null;return n&&(r!=="/"?a=n({...e,pathname:ye(e.pathname,r)||e.pathname},t):a=n(e,t)),a==null&&(a=e.key),a}function Rl({getKey:e,storageKey:t}={}){let{router:r}=Sr("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:a}=yl("useScrollRestoration"),{basename:o}=h.useContext(Ee),l=Le(),s=vr(),i=zo();h.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),Sl(h.useCallback(()=>{if(i.state==="idle"){let u=sr(l,s,o,e);Pt[u]=window.scrollY}try{sessionStorage.setItem(t||lr,JSON.stringify(Pt))}catch(u){Z(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[i.state,e,o,l,s,t])),typeof document<"u"&&(h.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||lr);u&&(Pt=JSON.parse(u))}catch{}},[t]),h.useLayoutEffect(()=>{let u=r==null?void 0:r.enableScrollRestoration(Pt,()=>window.scrollY,e?(c,m)=>sr(c,m,o,e):void 0);return()=>u&&u()},[r,o,e]),h.useLayoutEffect(()=>{if(n!==!1){if(typeof n=="number"){window.scrollTo(0,n);return}if(l.hash){let u=document.getElementById(decodeURIComponent(l.hash.slice(1)));if(u){u.scrollIntoView();return}}a!==!0&&window.scrollTo(0,0)}},[l,n,a]))}function Sl(e,t){let{capture:r}={};h.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}function xl(e,t={}){let r=h.useContext(mr);z(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Sr("useViewTransitionState"),a=ft(e,{relative:t.relative});if(!r.isTransitioning)return!1;let o=ye(r.currentLocation.pathname,n)||r.currentLocation.pathname,l=ye(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Ot(a.pathname,l)!=null||Ot(a.pathname,o)!=null}[...za];function Ll(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,a]of t)if(a&&a.__type==="RouteErrorResponse")r[n]=new Ae(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let o=window[a.__subType];if(typeof o=="function")try{let l=new o(a.message);l.stack=a.stack,r[n]=l}catch{}}if(r[n]==null){let o=new Error(a.message);o.stack=a.stack,r[n]=o}}else r[n]=a;return r}function Pl(e,t,r,n,a,o){let l={...e,loaderData:{...e.loaderData}},s=Se(t,n,a);if(s)for(let i of s){let u=i.route.id,c=r(u);Ga(u,c.clientLoader,c.hasLoader,o)&&(c.hasHydrateFallback||!c.hasLoader)?delete l.loaderData[u]:c.hasLoader||(l.loaderData[u]=null)}return l}exports.FrameworkContext=pt;exports.Links=ll;exports.Meta=cl;exports.Outlet=Qo;exports.RemixErrorBoundary=Vi;exports.RouterProvider=Xo;exports.Scripts=qa;exports.ScrollRestoration=tn;exports.createBrowserHistory=Pn;exports.createClientRoutes=$t;exports.createClientRoutesWithHMRRevalidationOptOut=Xi;exports.createRouter=io;exports.decodeViaTurboStream=Wa;exports.deserializeErrors2=Ll;exports.getHydrationData=Pl;exports.getPatchRoutesOnNavigationFunction=tl;exports.getTurboStreamSingleFetchDataStrategy=Ii;exports.hydrationRouteProperties=Jo;exports.invariant=z;exports.jsxRuntimeExports=Rn;exports.mapRouteProperties=Vo;exports.useActionData=Wo;exports.useFogOFWarDiscovery=rl;exports.useLoaderData=Bo;exports.useMatches=vr;exports.useParams=ko;