@markforster/heroquest-card-creator 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/404/index.html +2 -2
- package/out/404.html +2 -2
- package/out/_next/static/MCjz6tB5cDKjwYnkGDUah/_buildManifest.js +1 -0
- package/out/_next/static/chunks/11-aa6151b8a7487661.js +1 -0
- package/out/_next/static/chunks/117-32c4808da693e8a2.js +2 -0
- package/out/_next/static/chunks/208-82e58e6e4ba19c92.js +67 -0
- package/out/_next/static/chunks/315-55df286699f8b0e8.js +6 -0
- package/out/_next/static/chunks/421.41f21f5dfd414f63.js +1 -0
- package/out/_next/static/chunks/78-a62212fe1e976626.js +1 -0
- package/out/_next/static/chunks/901.26b72b54a20a237e.js +1 -0
- package/out/_next/static/chunks/924.2204e4941500ca44.js +1 -0
- package/out/_next/static/chunks/app/_not-found/page-cd0b8419e04bbf6b.js +1 -0
- package/out/_next/static/chunks/app/layout-ff6d2e61fb935b5c.js +1 -0
- package/out/_next/static/chunks/app/{page-0751bccfe861da74.js → page-cc0cc1a7d8239b11.js} +1 -1
- package/out/_next/static/chunks/{b536a0f1-15fcb22ec48614b3.js → b536a0f1-cae9e701de820869.js} +1 -1
- package/out/_next/static/chunks/cb7556af-561f1379df3518e9.js +9 -0
- package/out/_next/static/chunks/fd9d1056-b7d67a92dad1d910.js +1 -0
- package/out/_next/static/chunks/framework-00a8ba1a63cfdc9e.js +1 -0
- package/out/_next/static/chunks/main-6ca21b4ba1c31341.js +1 -0
- package/out/_next/static/chunks/main-app-f06b48d9d592854a.js +1 -0
- package/out/_next/static/chunks/pages/_app-15e2daefa259f0b5.js +1 -0
- package/out/_next/static/chunks/pages/_error-28b803cb2479b966.js +1 -0
- package/out/_next/static/chunks/webpack-8acc9381d06a0317.js +1 -0
- package/out/_next/static/css/51c5daab4b3c5d98.css +1 -0
- package/out/_next/static/css/d4f81156468795e7.css +1 -0
- package/out/_next/static/media/blueprint.10d46645.png +0 -0
- package/out/_next/static/media/bordered-mask.d506f676.png +0 -0
- package/out/_next/static/media/hero-back-border-and-text.0ba5cc66.png +0 -0
- package/out/_next/static/media/hero-back.838c0783.png +0 -0
- package/out/_next/static/media/parchment.450c71a4.png +0 -0
- package/out/_next/static/media/small-large-artwork-border-alpha-mask.9e1a274f.png +0 -0
- package/out/_next/static/media/small-large-artwork-border-blend-texture.b866e77e.png +0 -0
- package/out/_next/static/media/white-paper.b4831d18.png +0 -0
- package/out/_next/static/media/window-parchment.8f31db79.png +0 -0
- package/out/index.html +2 -2
- package/out/index.txt +10 -10
- package/out/sitemap.xml +1 -1
- package/package.json +12 -4
- package/out/_next/static/6L6jMZaPsBFKQWW48U7cM/_buildManifest.js +0 -1
- package/out/_next/static/chunks/11-78f479f14159541f.js +0 -1
- package/out/_next/static/chunks/117-02a1c5ab3bdda11d.js +0 -2
- package/out/_next/static/chunks/17-500f7d535bcf4606.js +0 -67
- package/out/_next/static/chunks/421.f7d6805b56f50951.js +0 -1
- package/out/_next/static/chunks/78-20d7dfe56eb879a8.js +0 -1
- package/out/_next/static/chunks/901.97c805b54bd60aa3.js +0 -1
- package/out/_next/static/chunks/905-e50cd628660b83ec.js +0 -6
- package/out/_next/static/chunks/924.4a054bc97175666b.js +0 -1
- package/out/_next/static/chunks/app/_not-found/page-721e0182aa7da8b9.js +0 -1
- package/out/_next/static/chunks/app/layout-83a07e4e956306c6.js +0 -1
- package/out/_next/static/chunks/cb7556af-5873e8e79b279109.js +0 -8
- package/out/_next/static/chunks/fd9d1056-524802b9ec96d394.js +0 -1
- package/out/_next/static/chunks/framework-f66176bb897dc684.js +0 -1
- package/out/_next/static/chunks/main-5e42ad27df38cdd8.js +0 -1
- package/out/_next/static/chunks/main-app-0b6a7f5b2fb24b40.js +0 -1
- package/out/_next/static/chunks/pages/_app-72b849fbd24ac258.js +0 -1
- package/out/_next/static/chunks/pages/_error-7ba65e1336b92748.js +0 -1
- package/out/_next/static/chunks/webpack-2acf2b1ed69a3b7c.js +0 -1
- package/out/_next/static/css/a5e7cbab14a9f3ff.css +0 -1
- package/out/_next/static/css/d914dcad9d2056de.css +0 -1
- package/out/_next/static/media/blueprint.73c53722.png +0 -0
- package/out/_next/static/media/bordered-mask.82dc793a.png +0 -0
- package/out/_next/static/media/hero-back-border-and-text.59765c87.png +0 -0
- package/out/_next/static/media/hero-back.af5738a7.png +0 -0
- package/out/_next/static/media/parchment.622421f4.png +0 -0
- package/out/_next/static/media/small-large-artwork-border-alpha-mask.410ecda3.png +0 -0
- package/out/_next/static/media/small-large-artwork-border-blend-texture.002a2faa.png +0 -0
- package/out/_next/static/media/white-paper.b80839b0.png +0 -0
- package/out/_next/static/media/window-parchment.4e3e14fd.png +0 -0
- /package/out/_next/static/{6L6jMZaPsBFKQWW48U7cM → MCjz6tB5cDKjwYnkGDUah}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[97],{84750:function(e,t,r){r.d(t,{AW:function(){return tz},Fg:function(){return tA},OL:function(){return rr},TH:function(){return ti},UO:function(){return td},_Z:function(){return tx},cP:function(){return t6},i7:function(){return tF},j3:function(){return tN},kr:function(){return b},pG:function(){return tM},rU:function(){return rt},s0:function(){return tu},yq:function(){return ri}});var n,a,o,i=r(2265),l=e=>{throw TypeError(e)},s=(e,t,r)=>t.has(e)||l("Cannot "+r),u=(e,t,r)=>(s(e,t,"read from private field"),r?r.call(e):t.get(e)),c=(e,t,r)=>t.has(e)?l("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),d=((n=d||{}).Pop="POP",n.Push="PUSH",n.Replace="REPLACE",n),h="popstate";function f(e,t){if(!1===e||null==e)throw Error(t)}function p(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw Error(t)}catch(e){}}}function m(e,t){return{usr:e.state,key:e.key,idx:t}}function y(e,t,r=null,n){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?g(t):t,state:r,key:t&&t.key||n||Math.random().toString(36).substring(2,10)}}function v({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 g(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 w(e,t=!1){let r="http://localhost";"undefined"!=typeof window&&(r="null"!==window.location.origin?window.location.origin:window.location.href),f(r,"No window.location.(origin|href) available to create URL");let n="string"==typeof e?e:v(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}function b(e){return{defaultValue:e}}var E=class{constructor(e){if(c(this,o,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(u(this,o).has(e))return u(this,o).get(e);if(void 0!==e.defaultValue)return e.defaultValue;throw Error("No value found for context")}set(e,t){u(this,o).set(e,t)}};o=new WeakMap;var R=new Set(["lazy","caseSensitive","path","id","index","children"]),x=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function S(e,t,r=[],n={},a=!1){return e.map((e,o)=>{let i=[...r,String(o)],l="string"==typeof e.id?e.id:i.join("-");if(f(!0!==e.index||!e.children,"Cannot specify children on an index route"),f(a||!n[l],`Found a route id collision on id "${l}". Route id's must be globally unique within Data Router usages`),!0===e.index){let r={...e,id:l};return n[l]=C(r,t(r)),r}{let r={...e,id:l,children:void 0};return n[l]=C(r,t(r)),e.children&&(r.children=S(e.children,t,i,n,a)),r}})}function C(e,t){return Object.assign(e,{...t,..."object"==typeof t.lazy&&null!=t.lazy?{lazy:{...e.lazy,...t.lazy}}:{}})}function k(e,t,r="/"){return P(e,t,r,!1)}function P(e,t,r,n){let a=D(("string"==typeof t?g(t):t).pathname||"/",r);if(null==a)return null;let o=function e(t,r=[],n=[],a="",o=!1){let i=(t,i,l=o,s)=>{let u={relativePath:void 0===s?t.path||"":s,caseSensitive:!0===t.caseSensitive,childrenIndex:i,route:t};if(u.relativePath.startsWith("/")){if(!u.relativePath.startsWith(a)&&l)return;f(u.relativePath.startsWith(a),`Absolute route path "${u.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),u.relativePath=u.relativePath.slice(a.length)}let c=U([a,u.relativePath]),d=n.concat(u);if(t.children&&t.children.length>0&&(f(!0!==t.index,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),e(t.children,r,d,c,l)),null!=t.path||t.index){var h;let e,n;r.push({path:c,score:(h=t.index,n=(e=c.split("/")).length,e.some($)&&(n+=-2),h&&(n+=2),e.filter(e=>!$(e)).reduce((e,t)=>e+(L.test(t)?3:""===t?1:10),n)),routesMeta:d})}};return t.forEach((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let r of function e(t){let r=t.split("/");if(0===r.length)return[];let[n,...a]=r,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===a.length)return o?[i,""]:[i];let l=e(a.join("/")),s=[];return s.push(...l.map(e=>""===e?i:[i,e].join("/"))),o&&s.push(...l),s.map(e=>t.startsWith("/")&&""===e?"/":e)}(e.path))i(e,t,!0,r);else i(e,t)}),r}(e);!function(e){e.sort((e,t)=>{var r,n;return e.score!==t.score?t.score-e.score:(r=e.routesMeta.map(e=>e.childrenIndex),n=t.routesMeta.map(e=>e.childrenIndex),r.length===n.length&&r.slice(0,-1).every((e,t)=>e===n[t])?r[r.length-1]-n[n.length-1]:0)})}(o);let i=null;for(let e=0;null==i&&e<o.length;++e){let t=function(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return p(!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}}(a);i=function(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",i=[];for(let e=0;e<n.length;++e){let l=n[e],s=e===n.length-1,u="/"===o?t:t.slice(o.length)||"/",c=O({path:l.relativePath,caseSensitive:l.caseSensitive,end:s},u),d=l.route;if(!c&&s&&r&&!n[n.length-1].route.index&&(c=O({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!c)return null;Object.assign(a,c.params),i.push({params:a,pathname:U([o,c.pathname]),pathnameBase:F(U([o,c.pathnameBase])),route:d}),"/"!==c.pathnameBase&&(o=U([o,c.pathnameBase]))}return i}(o[e],t,n)}return i}var L=/^:[\w-]+$/,$=e=>"*"===e;function O(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t=!1,r=!0){p("*"===e||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,r)=>(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((e,{paramName:t,isOptional:r},n)=>{if("*"===t){let e=l[n]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}let a=l[n];return r&&!a?e[t]=void 0:e[t]=(a||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:i,pattern:e}}function D(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}var T=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,M=e=>T.test(e);function j(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)}),r.length>1?r.join("/"):"/"}function _(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 A(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function N(e){let t=A(e);return t.map((e,r)=>r===t.length-1?e.pathname:e.pathnameBase)}function z(e,t,r,n=!1){let a,o;"string"==typeof e?a=g(e):(f(!(a={...e}).pathname||!a.pathname.includes("?"),_("?","pathname","search",a)),f(!a.pathname||!a.pathname.includes("#"),_("#","pathname","hash",a)),f(!a.search||!a.search.includes("#"),_("#","search","hash",a)));let i=""===e||""===a.pathname,l=i?"/":a.pathname;if(null==l)o=r;else{let e=t.length-1;if(!n&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}o=e>=0?t[e]:"/"}let s=function(e,t="/"){let{pathname:r,search:n="",hash:a=""}="string"==typeof e?g(e):e;return{pathname:r?(r=r.replace(/\/\/+/g,"/")).startsWith("/")?j(r.substring(1),"/"):j(r,t):t,search:H(n),hash:W(a)}}(a,o),u=l&&"/"!==l&&l.endsWith("/"),c=(i||"."===l)&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}var U=e=>e.join("/").replace(/\/\/+/g,"/"),F=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),H=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",W=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",B=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 I(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}function Y(e){return e.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var J="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function q(e,t){let r=e;if("string"!=typeof r||!T.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,a=!1;if(J)try{let e=new URL(window.location.href),n=new URL(r.startsWith("//")?e.protocol+r:r),o=D(n.pathname,t);n.origin===e.origin&&null!=o?r=o+n.search+n.hash:a=!0}catch(e){p(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:a,to:r}}var V=Symbol("Uninstrumented");function K(e,t,r){return 0===e.length?null:async(...n)=>{let a=await X(e,r(...n),()=>t(...n),e.length-1);if("error"===a.type)throw a.value;return a.value}}async function X(e,t,r,n){let a,o=e[n];if(o){let i;let l=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=X(e,t,r,n-1),f(a=await i,"Expected a result"),"error"===a.type&&a.value instanceof Error)?{status:"error",error:a.value}:{status:"success",error:void 0};try{await o(l,t)}catch(e){console.error("An instrumentation function threw an error:",e)}i||await l(),await i}else try{let e=await r();a={type:"success",value:e}}catch(e){a={type:"error",value:e}}return a||{type:"error",value:Error("No result assigned in instrumentation chain.")}}function G(e){let{request:t,context:r,params:n,unstable_pattern:a}=e;return{request:{method:t.method,url:t.url,headers:{get:(...e)=>t.headers.get(...e)}},params:{...n},unstable_pattern:a,context:function(e){if(!function(e){if(null===e||"object"!=typeof e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t||Object.getOwnPropertyNames(t).sort().join("\0")===Q}(e))return{get:t=>e.get(t)};{let t={...e};return Object.freeze(t),t}}(r)}}function Z(e,t){return{currentUrl:v(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}var Q=Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),ee=["POST","PUT","PATCH","DELETE"],et=new Set(ee),er=new Set(["GET",...ee]),en=new Set([301,302,303,307,308]),ea=new Set([307,308]),eo={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ei={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},el={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},es=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),eu="remix-router-transitions",ec=Symbol("ResetLoaderData");function ed(e,t,r,n,a,o){let i,l;if(a){for(let e of(i=[],t))if(i.push(e),e.route.id===a){l=e;break}}else i=t,l=t[t.length-1];let s=z(n||".",N(i),D(e.pathname,r)||e.pathname,"path"===o);if(null==n&&(s.search=e.search,s.hash=e.hash),(null==n||""===n||"."===n)&&l){let e=eG(s.search);if(l.route.index&&!e)s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&e){let e=new URLSearchParams(s.search),t=e.getAll("index");e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let r=e.toString();s.search=r?`?${r}`:""}}return"/"!==r&&(s.pathname=function({basename:e,pathname:t}){return"/"===t?e:U([e,t])}({basename:r,pathname:s.pathname})),v(s)}function eh(e,t,r){var n;let a,o;if(!r||!(null!=r&&("formData"in r&&null!=r.formData||"body"in r&&void 0!==r.body)))return{path:t};if(r.formMethod&&(n=r.formMethod,!er.has(n.toUpperCase())))return{path:t,error:eW(405,{method:r.formMethod})};let i=()=>({path:t,error:eW(400,{type:"invalid-body"})}),l=(r.formMethod||"get").toUpperCase(),s=eI(t);if(void 0!==r.body){if("text/plain"===r.formEncType){if(!eX(l))return i();let e="string"==typeof r.body?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((e,[t,r])=>`${e}${t}=${r}
|
|
2
|
+
`,""):String(r.body);return{path:t,submission:{formMethod:l,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===r.formEncType){if(!eX(l))return i();try{let e="string"==typeof r.body?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:l,formAction:s,formEncType:r.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return i()}}}if(f("function"==typeof FormData,"FormData is not available in this environment"),r.formData)a=e_(r.formData),o=r.formData;else if(r.body instanceof FormData)a=e_(r.body),o=r.body;else if(r.body instanceof URLSearchParams)o=eA(a=r.body);else if(null==r.body)a=new URLSearchParams,o=new FormData;else try{a=new URLSearchParams(r.body),o=eA(a)}catch(e){return i()}let u={formMethod:l,formAction:s,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:o,json:void 0,text:void 0};if(eX(u.formMethod))return{path:t,submission:u};let c=g(t);return e&&c.search&&eG(c.search)&&a.append("index",""),c.search=`?${a}`,{path:v(c),submission:u}}function ef(e,t,r,n,a,o,i,l,s,u,c,d,h,f,p,m,y,v,g,w,b){let E,R=w?eJ(w[1])?w[1].error:w[1].data:void 0,x=a.createURL(o.location),S=a.createURL(s);if(c&&o.errors){let e=Object.keys(o.errors)[0];E=i.findIndex(t=>t.route.id===e)}else if(w&&eJ(w[1])){let e=w[0];E=i.findIndex(t=>t.route.id===e)-1}let C=w?w[1].statusCode:void 0,P=C&&C>=400,L={currentUrl:x,currentParams:o.matches[0]?.params||{},nextUrl:S,nextParams:i[0].params,...l,actionResult:R,actionStatus:C},$=Y(i),O=i.map((a,i)=>{var l,s,h;let f,p,m,{route:y}=a,v=null;if(null!=E&&i>E?v=!1:y.lazy?v=!0:ep(y)?c?v=em(y,o.loaderData,o.errors):(l=o.loaderData,f=!(s=o.matches[i])||a.route.id!==s.route.id,p=!l.hasOwnProperty(a.route.id),(f||p)&&(v=!0)):v=!1,null!==v)return eP(r,n,e,$,a,u,t,v);let g=!1;"boolean"==typeof b?g=b:P?g=!1:d?g=!0:x.pathname+x.search===S.pathname+S.search?g=!0:x.search!==S.search?g=!0:(m=(h=o.matches[i]).route.path,(h.pathname!==a.pathname||null!=m&&m.endsWith("*")&&h.params["*"]!==a.params["*"])&&(g=!0));let w={...L,defaultShouldRevalidate:g},R=ey(a,w);return eP(r,n,e,$,a,u,t,R,w,b)}),D=[];return p.forEach((e,l)=>{if(c||!i.some(t=>t.route.id===e.routeId)||f.has(l))return;let s=o.fetchers.get(l),p=s&&"idle"!==s.state&&void 0===s.data,w=k(y,e.path,v);if(!w){if(g&&p)return;D.push({key:l,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(m.has(l))return;let E=eZ(w,e.path),R=new AbortController,x=ej(a,e.path,R.signal),S=null;if(h.has(l))h.delete(l),S=eL(r,n,x,w,E,u,t);else if(p)d&&(S=eL(r,n,x,w,E,u,t));else{let e;e="boolean"==typeof b?b:!P&&d;let a={...L,defaultShouldRevalidate:e};ey(E,a)&&(S=eL(r,n,x,w,E,u,t,a))}S&&D.push({key:l,routeId:e.routeId,path:e.path,matches:S,match:E,request:x,controller:R})}),{dsMatches:O,revalidatingFetchers:D}}function ep(e){return null!=e.loader||null!=e.middleware&&e.middleware.length>0}function em(e,t,r){if(e.lazy)return!0;if(!ep(e))return!1;let n=null!=t&&e.id in t,a=null!=r&&void 0!==r[e.id];return(!!n||!a)&&("function"==typeof e.loader&&!0===e.loader.hydrate||!n&&!a)}function ey(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}function ev(e,t,r,n,a,o){let i;if(e){let t=n[e];f(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),i=t.children}else i=r;let l=[],s=[];if(t.forEach(e=>{let t=i.find(t=>(function e(t,r){return"id"in t&&"id"in r&&t.id===r.id||t.index===r.index&&t.path===r.path&&t.caseSensitive===r.caseSensitive&&((!t.children||0===t.children.length)&&(!r.children||0===r.children.length)||t.children.every((t,n)=>r.children?.some(r=>e(t,r))))})(e,t));t?s.push({existingRoute:t,newRoute:e}):l.push(e)}),l.length>0){let t=S(l,a,[e||"_","patch",String(i?.length||"0")],n);i.push(...t)}if(o&&s.length>0)for(let e=0;e<s.length;e++){let{existingRoute:t,newRoute:r}=s[e],[n]=S([r],a,[],{},!0);Object.assign(t,{element:n.element?n.element:t.element,errorElement:n.errorElement?n.errorElement:t.errorElement,hydrateFallbackElement:n.hydrateFallbackElement?n.hydrateFallbackElement:t.hydrateFallbackElement})}}var eg=new WeakMap,ew=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let a=r[t.id];if(f(a,"No route found in manifest"),!a.lazy||"object"!=typeof a.lazy)return;let o=a.lazy[e];if(!o)return;let i=eg.get(a);i||(i={},eg.set(a,i));let l=i[e];if(l)return l;let s=(async()=>{let t=R.has(e),r=void 0!==a[e]&&"hasErrorBoundary"!==e;if(t)p(!t,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(r)p(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await o();null!=t&&(Object.assign(a,{[e]:t}),Object.assign(a,n(a)))}"object"==typeof a.lazy&&(a.lazy[e]=void 0,Object.values(a.lazy).every(e=>void 0===e)&&(a.lazy=void 0))})();return i[e]=s,s},eb=new WeakMap;async function eE(e){let t=e.matches.filter(e=>e.shouldLoad),r={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,n)=>{r[t[n].route.id]=e}),r}async function eR(e){return e.matches.some(e=>e.route.middleware)?ex(e,()=>eE(e)):eE(e)}function ex(e,t){return eS(e,t,e=>{var t;if(eK(e)&&(t=e.status,en.has(t))&&e.headers.has("Location"))throw e;return e},eY,function(t,r,n){if(n)return Promise.resolve(Object.assign(n.value,{[r]:{type:"error",result:t}}));{let{matches:n}=e,a=Math.min(Math.max(n.findIndex(e=>e.route.id===r),0),Math.max(n.findIndex(e=>e.shouldCallHandler()),0));return Promise.resolve({[eF(n,n[a].route.id).route.id]:{type:"error",result:t}})}})}async function eS(e,t,r,n,a){let{matches:o,request:i,params:l,context:s,unstable_pattern:u}=e,c=o.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]);return await eC({request:i,params:l,context:s,unstable_pattern:u},c,t,r,n,a)}async function eC(e,t,r,n,a,o,i=0){let l,{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let u=t[i];if(!u)return await r();let[c,d]=u,h=async()=>{if(l)throw Error("You may only call `next()` once per middleware");try{return(l={value:await eC(e,t,r,n,a,o,i+1)}).value}catch(e){return(l={value:await o(e,c,l)}).value}};try{let t=await d(e,h),r=null!=t?n(t):void 0;if(a(r))return r;if(l)return r??l.value;return(l={value:await h()}).value}catch(e){return await o(e,c,l)}}function ek(e,t,r,n,a){let o=ew({key:"middleware",route:n.route,manifest:t,mapRouteProperties:e}),i=function(e,t,r,n,a){let o,i=r[e.id];if(f(i,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if("function"==typeof e.lazy){let t=eb.get(i);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let r=(async()=>{f("function"==typeof e.lazy,"No lazy route function found");let t=await e.lazy(),r={};for(let e in t){let n=t[e];if(void 0===n)continue;let a=x.has(e),o=void 0!==i[e]&&"hasErrorBoundary"!==e;a?p(!a,"Route property "+e+" is not a supported property to be returned from a lazy route function. This property will be ignored."):o?p(!o,`Route "${i.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):r[e]=n}Object.assign(i,r),Object.assign(i,{...n(i),lazy:void 0})})();return eb.set(i,r),r.catch(()=>{}),{lazyRoutePromise:r,lazyHandlerPromise:r}}let l=Object.keys(e.lazy),s=[];for(let i of l){if(a&&a.includes(i))continue;let l=ew({key:i,route:e,manifest:r,mapRouteProperties:n});l&&(s.push(l),i===t&&(o=l))}let u=s.length>0?Promise.all(s).then(()=>{}):void 0;return u?.catch(()=>{}),o?.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:o}}(n.route,eX(r.method)?"action":"loader",t,e,a);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function eP(e,t,r,n,a,o,i,l,s=null,u){let c=!1,d=ek(e,t,r,a,o);return{...a,_lazyPromises:d,shouldLoad:l,shouldRevalidateArgs:s,shouldCallHandler:e=>(c=!0,s)?"boolean"==typeof u?ey(a,{...s,defaultShouldRevalidate:u}):"boolean"==typeof e?ey(a,{...s,defaultShouldRevalidate:e}):ey(a,s):l,resolve(e){let{lazy:t,loader:o,middleware:s}=a.route,u=c||l||e&&!eX(r.method)&&(t||o),h=s&&s.length>0&&!o&&!t;return u&&(eX(r.method)||!h)?eO({request:r,unstable_pattern:n,match:a,lazyHandlerPromise:d?.handler,lazyRoutePromise:d?.route,handlerOverride:e,scopedContext:i}):Promise.resolve({type:"data",result:void 0})}}}function eL(e,t,r,n,a,o,i,l=null){return n.map(s=>s.route.id!==a.route.id?{...s,shouldLoad:!1,shouldRevalidateArgs:l,shouldCallHandler:()=>!1,_lazyPromises:ek(e,t,r,s,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:eP(e,t,r,Y(n),s,o,i,!0,l))}async function e$(e,t,r,n,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let i={request:t,unstable_pattern:Y(r),params:r[0].params,context:a,matches:r},l=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>ex(i,()=>e({...i,fetcherKey:n,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}})),s=await e({...i,fetcherKey:n,runClientMiddleware:l});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch(e){}return s}async function eO({request:e,unstable_pattern:t,match:r,lazyHandlerPromise:n,lazyRoutePromise:a,handlerOverride:o,scopedContext:i}){let l,s;let u=eX(e.method),c=u?"action":"loader",d=n=>{let a;let l=new Promise((e,t)=>a=t);s=()=>a(),e.signal.addEventListener("abort",s);let u=a=>"function"!=typeof n?Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${c}" [routeId: ${r.route.id}]`)):n({request:e,unstable_pattern:t,params:r.params,context:i},...void 0!==a?[a]:[]);return Promise.race([(async()=>{try{let e=await (o?o(e=>u(e)):u());return{type:"data",result:e}}catch(e){return{type:"error",result:e}}})(),l])};try{let t=u?r.route.action:r.route.loader;if(n||a){if(t){let e;let[r]=await Promise.all([d(t).catch(t=>{e=t}),n,a]);if(void 0!==e)throw e;l=r}else{await n;let t=u?r.route.action:r.route.loader;if(t)[l]=await Promise.all([d(t),a]);else{if("action"!==c)return{type:"data",result:void 0};let t=new URL(e.url),n=t.pathname+t.search;throw eW(405,{method:e.method,pathname:n,routeId:r.route.id})}}}else if(t)l=await d(t);else{let t=new URL(e.url),r=t.pathname+t.search;throw eW(404,{pathname:r})}}catch(e){return{type:"error",result:e}}finally{s&&e.signal.removeEventListener("abort",s)}return l}async function eD(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?null==e.body?null:e.json():e.text()}async function eT(e){let{result:t,type:r}=e;if(eK(t)){let e;try{e=await eD(t)}catch(e){return{type:"error",error:e}}return"error"===r?{type:"error",error:new B(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:"data",data:e,statusCode:t.status,headers:t.headers}}if("error"===r){if(eV(t))return t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new B(t.init?.status??500,t.init?.statusText??"Internal Server Error",t.data),statusCode:I(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0};return{type:"error",error:t,statusCode:I(t)?t.status:void 0}}return eV(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function eM(e,t,r,n){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(M(e)){let n=new URL(e.startsWith("//")?t.protocol+e:e);if(a.includes(n.protocol))throw Error("Invalid redirect location");let o=null!=D(n.pathname,r);if(n.origin===t.origin&&o)return n.pathname+n.search+n.hash}try{let t=n.createURL(e);if(a.includes(t.protocol))throw Error("Invalid redirect location")}catch(e){}return e}function ej(e,t,r,n){let a=e.createURL(eI(t)).toString(),o={signal:r};if(n&&eX(n.formMethod)){let{formMethod:e,formEncType:t}=n;o.method=e.toUpperCase(),"application/json"===t?(o.headers=new Headers({"Content-Type":t}),o.body=JSON.stringify(n.json)):"text/plain"===t?o.body=n.text:"application/x-www-form-urlencoded"===t&&n.formData?o.body=e_(n.formData):o.body=n.formData}return new Request(a,o)}function e_(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function eA(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function eN(e,t,r,n,a,o){let{loaderData:i,errors:l}=function(e,t,r,n=!1,a=!1){let o,i={},l=null,s=!1,u={},c=r&&eJ(r[1])?r[1].error:void 0;return e.forEach(r=>{if(!(r.route.id in t))return;let d=r.route.id,h=t[d];if(f(!eq(h),"Cannot handle redirect results in processLoaderData"),eJ(h)){let t=h.error;if(void 0!==c&&(t=c,c=void 0),l=l||{},a)l[d]=t;else{let r=eF(e,d);null==l[r.route.id]&&(l[r.route.id]=t)}n||(i[d]=ec),s||(s=!0,o=I(h.error)?h.error.status:500),h.headers&&(u[d]=h.headers)}else i[d]=h.data,h.statusCode&&200!==h.statusCode&&!s&&(o=h.statusCode),h.headers&&(u[d]=h.headers)}),void 0!==c&&r&&(l={[r[0]]:c},r[2]&&(i[r[2]]=void 0)),{loaderData:i,errors:l,statusCode:o||200,loaderHeaders:u}}(t,r,n);return a.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:r,match:n,controller:a}=t;if(a&&a.signal.aborted)return;let i=o[r];if(f(i,"Did not find corresponding fetcher result"),eJ(i)){let t=eF(e.matches,n?.route.id);l&&l[t.route.id]||(l={...l,[t.route.id]:i.error}),e.fetchers.delete(r)}else if(eq(i))f(!1,"Unhandled fetcher revalidation redirect");else{let t=e4(i.data);e.fetchers.set(r,t)}}),{loaderData:i,errors:l}}function ez(e,t,r,n){let a=Object.entries(t).filter(([,e])=>e!==ec).reduce((e,[t,r])=>(e[t]=r,e),{});for(let o of r){let r=o.route.id;if(!t.hasOwnProperty(r)&&e.hasOwnProperty(r)&&o.route.loader&&(a[r]=e[r]),n&&n.hasOwnProperty(r))break}return a}function eU(e){return e?eJ(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function eF(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>!0===e.route.hasErrorBoundary)||e[0]}function eH(e){let t=1===e.length?e[0]:e.find(e=>e.index||!e.path||"/"===e.path)||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function eW(e,{pathname:t,routeId:r,method:n,type:a,message:o}={}){let i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",n&&t&&r?l=`You made a ${n} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:"invalid-body"===a&&(l="Unable to encode submission body")):403===e?(i="Forbidden",l=`Route "${r}" does not match URL "${t}"`):404===e?(i="Not Found",l=`No route matches URL "${t}"`):405===e&&(i="Method Not Allowed",n&&t&&r?l=`You made a ${n.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(l=`Invalid request method "${n.toUpperCase()}"`)),new B(e||500,i,Error(l),!0)}function eB(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[r,n]=t[e];if(eq(n))return{key:r,result:n}}}function eI(e){return v({..."string"==typeof e?g(e):e,hash:""})}function eY(e){return null!=e&&"object"==typeof e&&Object.entries(e).every(([e,t])=>{var r;return"string"==typeof e&&null!=(r=t)&&"object"==typeof r&&"type"in r&&"result"in r&&("data"===r.type||"error"===r.type)})}function eJ(e){return"error"===e.type}function eq(e){return"redirect"===(e&&e.type)}function eV(e){return"object"==typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function eK(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function eX(e){return et.has(e.toUpperCase())}function eG(e){return new URLSearchParams(e).getAll("index").some(e=>""===e)}function eZ(e,t){let r="string"==typeof t?g(t).search:t.search;if(e[e.length-1].route.index&&eG(r||""))return e[e.length-1];let n=A(e);return n[n.length-1]}function eQ(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(t&&r&&n){if(null!=a)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(null!=o)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(void 0!==i)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function e0(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 e1(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 e4(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 e2(){let e,t;let r=new Promise((n,a)=>{e=async e=>{n(e);try{await r}catch(e){}},t=async e=>{a(e);try{await r}catch(e){}}});return{promise:r,resolve:e,reject:t}}var e3=i.createContext(null);e3.displayName="DataRouter";var e5=i.createContext(null);e5.displayName="DataRouterState";var e7=i.createContext(!1);function e8(){return i.useContext(e7)}var e9=i.createContext({isTransitioning:!1});e9.displayName="ViewTransition";var e6=i.createContext(new Map);e6.displayName="Fetchers",i.createContext(null).displayName="Await";var te=i.createContext(null);te.displayName="Navigation";var tt=i.createContext(null);tt.displayName="Location";var tr=i.createContext({outlet:null,matches:[],isDataRoute:!1});tr.displayName="Route";var tn=i.createContext(null);tn.displayName="RouteError";var ta="REACT_ROUTER_ERROR";function to(){return null!=i.useContext(tt)}function ti(){return f(to(),"useLocation() may be used only in the context of a <Router> component."),i.useContext(tt).location}var tl="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ts(e){i.useContext(te).static||i.useLayoutEffect(e)}function tu(){let{isDataRoute:e}=i.useContext(tr);return e?function(){let{router:e}=tw("useNavigate"),t=tE("useNavigate"),r=i.useRef(!1);return ts(()=>{r.current=!0}),i.useCallback(async(n,a={})=>{p(r.current,tl),r.current&&("number"==typeof n?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...a}))},[e,t])}():function(){f(to(),"useNavigate() may be used only in the context of a <Router> component.");let e=i.useContext(e3),{basename:t,navigator:r}=i.useContext(te),{matches:n}=i.useContext(tr),{pathname:a}=ti(),o=JSON.stringify(N(n)),l=i.useRef(!1);return ts(()=>{l.current=!0}),i.useCallback((n,i={})=>{if(p(l.current,tl),!l.current)return;if("number"==typeof n){r.go(n);return}let s=z(n,JSON.parse(o),a,"path"===i.relative);null==e&&"/"!==t&&(s.pathname="/"===s.pathname?t:U([t,s.pathname])),(i.replace?r.replace:r.push)(s,i.state,i)},[t,r,o,a,e])}()}var tc=i.createContext(null);function td(){let{matches:e}=i.useContext(tr),t=e[e.length-1];return t?t.params:{}}function th(e,{relative:t}={}){let{matches:r}=i.useContext(tr),{pathname:n}=ti(),a=JSON.stringify(N(r));return i.useMemo(()=>z(e,JSON.parse(a),n,"path"===t),[e,a,n,t])}var tf=i.createElement(function(){let e,t,r;let n=(e=i.useContext(tn),t=tb("useRouteError"),r=tE("useRouteError"),void 0!==e?e:t.errors?.[r]),a=I(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),o=n instanceof Error?n.stack:null,l="rgba(200,200,200, 0.5)",s={padding:"2px 4px",backgroundColor:l},u=null;return console.error("Error handled by React Router default ErrorBoundary:",n),u=i.createElement(i.Fragment,null,i.createElement("p",null,"\uD83D\uDCBF Hey developer \uD83D\uDC4B"),i.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",i.createElement("code",{style:s},"ErrorBoundary")," or"," ",i.createElement("code",{style:s},"errorElement")," prop on your route.")),i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},a),o?i.createElement("pre",{style:{padding:"0.5rem",backgroundColor:l}},o):null,u)},null),tp=class extends i.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&"object"==typeof e&&e&&"digest"in e&&"string"==typeof e.digest){let t=function(e){if(e.startsWith(`${ta}:ROUTE_ERROR_RESPONSE:{`))try{let t=JSON.parse(e.slice(40));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText)return new B(t.status,t.statusText,t.data)}catch{}}(e.digest);t&&(e=t)}let t=void 0!==e?i.createElement(tr.Provider,{value:this.props.routeContext},i.createElement(tn.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?i.createElement(ty,{error:e},t):t}};tp.contextType=e7;var tm=new WeakMap;function ty({children:e,error:t}){let{basename:r}=i.useContext(te);if("object"==typeof t&&t&&"digest"in t&&"string"==typeof t.digest){let e=function(e){if(e.startsWith(`${ta}:REDIRECT:{`))try{let t=JSON.parse(e.slice(28));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"string"==typeof t.location&&"boolean"==typeof t.reloadDocument&&"boolean"==typeof t.replace)return t}catch{}}(t.digest);if(e){let n=tm.get(t);if(n)throw n;let a=q(e.location,r);if(J&&!tm.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=a.absoluteURL||a.to;else{let r=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw tm.set(t,r),r}}return i.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function tv({routeContext:e,match:t,children:r}){let n=i.useContext(e3);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(tr.Provider,{value:e},r)}function tg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function tw(e){let t=i.useContext(e3);return f(t,tg(e)),t}function tb(e){let t=i.useContext(e5);return f(t,tg(e)),t}function tE(e){let t;let r=(f(t=i.useContext(tr),tg(e)),t),n=r.matches[r.matches.length-1];return f(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}var tR=0;function tx(e){let{router:t,basename:r}=tw("useBlocker"),n=tb("useBlocker"),[a,o]=i.useState(""),l=i.useCallback(t=>{if("function"!=typeof e)return!!e;if("/"===r)return e(t);let{currentLocation:n,nextLocation:a,historyAction:o}=t;return e({currentLocation:{...n,pathname:D(n.pathname,r)||n.pathname},nextLocation:{...a,pathname:D(a.pathname,r)||a.pathname},historyAction:o})},[r,e]);return i.useEffect(()=>{let e=String(++tR);return o(e),()=>t.deleteBlocker(e)},[t]),i.useEffect(()=>{""!==a&&t.getBlocker(a,l)},[t,a,l]),a&&n.blockers.has(a)?n.blockers.get(a):el}var tS={};function tC(e,t,r){t||tS[e]||(tS[e]=!0,p(!1,r))}var tk={};function tP(e,t){e||tk[t]||(tk[t]=!0,console.warn(t))}var tL=(a||(a=r.t(i,2))).useOptimistic,t$=()=>void 0;function tO(e){let t={hasErrorBoundary:e.hasErrorBoundary||null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&(e.element&&p(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:i.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&p(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:i.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&p(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:i.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var tD=["HydrateFallback","hydrateFallbackElement"],tT=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}})}};function tM({router:e,flushSync:t,onError:r,unstable_useTransitions:n}){n=e8()||n;let[a,o]=i.useState(e.state),[l,s]=tL?tL(a):[a,t$],[u,c]=i.useState(),[d,h]=i.useState({isTransitioning:!1}),[f,p]=i.useState(),[m,y]=i.useState(),[v,g]=i.useState(),w=i.useRef(new Map),b=i.useCallback((a,{deletedFetchers:l,newErrors:u,flushSync:d,viewTransitionOpts:v})=>{u&&r&&Object.values(u).forEach(e=>r(e,{location:a.location,params:a.matches[0]?.params??{},unstable_pattern:Y(a.matches)})),a.fetchers.forEach((e,t)=>{void 0!==e.data&&w.current.set(t,e.data)}),l.forEach(e=>w.current.delete(e)),tP(!1===d||null!=t,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let b=null!=e.window&&null!=e.window.document&&"function"==typeof e.window.document.startViewTransition;if(tP(null==v||b,"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."),!v||!b){t&&d?t(()=>o(a)):!1===n?o(a):i.startTransition(()=>{!0===n&&s(e=>tj(e,a)),o(a)});return}if(t&&d){t(()=>{m&&(f?.resolve(),m.skipTransition()),h({isTransitioning:!0,flushSync:!0,currentLocation:v.currentLocation,nextLocation:v.nextLocation})});let r=e.window.document.startViewTransition(()=>{t(()=>o(a))});r.finished.finally(()=>{t(()=>{p(void 0),y(void 0),c(void 0),h({isTransitioning:!1})})}),t(()=>y(r));return}m?(f?.resolve(),m.skipTransition(),g({state:a,currentLocation:v.currentLocation,nextLocation:v.nextLocation})):(c(a),h({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}))},[e.window,t,m,f,n,s,r]);i.useLayoutEffect(()=>e.subscribe(b),[e,b]),i.useEffect(()=>{d.isTransitioning&&!d.flushSync&&p(new tT)},[d]),i.useEffect(()=>{if(f&&u&&e.window){let t=f.promise,r=e.window.document.startViewTransition(async()=>{!1===n?o(u):i.startTransition(()=>{!0===n&&s(e=>tj(e,u)),o(u)}),await t});r.finished.finally(()=>{p(void 0),y(void 0),c(void 0),h({isTransitioning:!1})}),y(r)}},[u,f,e.window,n,s]),i.useEffect(()=>{f&&u&&l.location.key===u.location.key&&f.resolve()},[f,m,l.location,u]),i.useEffect(()=>{!d.isTransitioning&&v&&(c(v.state),h({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),g(void 0))},[d.isTransitioning,v]);let E=i.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,r,n)=>e.navigate(t,{state:r,preventScrollReset:n?.preventScrollReset}),replace:(t,r,n)=>e.navigate(t,{replace:!0,state:r,preventScrollReset:n?.preventScrollReset})}),[e]),R=e.basename||"/",x=i.useMemo(()=>({router:e,navigator:E,static:!1,basename:R,onError:r}),[e,E,R,r]);return i.createElement(i.Fragment,null,i.createElement(e3.Provider,{value:x},i.createElement(e5.Provider,{value:l},i.createElement(e6.Provider,{value:w.current},i.createElement(e9.Provider,{value:d},i.createElement(tU,{basename:R,location:l.location,navigationType:l.historyAction,navigator:E,unstable_useTransitions:n},i.createElement(t_,{routes:e.routes,future:e.future,state:l,onError:r})))))),null)}function tj(e,t){return{...e,navigation:"idle"!==t.navigation.state?t.navigation:e.navigation,revalidation:"idle"!==t.revalidation?t.revalidation:e.revalidation,actionData:"submitting"!==t.navigation.state?t.actionData:e.actionData,fetchers:t.fetchers}}var t_=i.memo(function({routes:e,future:t,state:r,onError:n}){return function(e,t,r,n,a){let o;f(to(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=i.useContext(te),{matches:s}=i.useContext(tr),u=s[s.length-1],c=u?u.params:{},d=u?u.pathname:"/",h=u?u.pathnameBase:"/",m=u&&u.route;{let e=m&&m.path||"";tC(d,!m||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
3
|
+
|
|
4
|
+
Please change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}let y=ti();if(t){let e="string"==typeof t?g(t):t;f("/"===h||e.pathname?.startsWith(h),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${e.pathname}" was given in the \`location\` prop.`),o=e}else o=y;let v=o.pathname||"/",w=v;if("/"!==h){let e=h.replace(/^\//,"").split("/");w="/"+v.replace(/^\//,"").split("/").slice(e.length).join("/")}let b=k(e,{pathname:w});p(m||null!=b,`No routes matched location "${o.pathname}${o.search}${o.hash}" `),p(null==b||void 0!==b[b.length-1].route.element||void 0!==b[b.length-1].route.Component||void 0!==b[b.length-1].route.lazy,`Matched leaf route at location "${o.pathname}${o.search}${o.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=function(e,t=[],r=null,n=null,a=null){if(null==e){if(!r)return null;if(r.errors)e=r.matches;else{if(0!==t.length||r.initialized||!(r.matches.length>0))return null;e=r.matches}}let o=e,l=r?.errors;if(null!=l){let e=o.findIndex(e=>e.route.id&&l?.[e.route.id]!==void 0);f(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),o=o.slice(0,Math.min(o.length,e+1))}let s=!1,u=-1;if(r)for(let e=0;e<o.length;e++){let t=o[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(u=e),t.route.id){let{loaderData:e,errors:n}=r,a=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||void 0===n[t.route.id]);if(t.route.lazy||a){s=!0,o=u>=0?o.slice(0,u+1):[o[0]];break}}}let c=r&&n?(e,t)=>{n(e,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:Y(r.matches),errorInfo:t})}:void 0;return o.reduceRight((e,n,a)=>{let d;let h=!1,f=null,p=null;r&&(d=l&&n.route.id?l[n.route.id]:void 0,f=n.route.errorElement||tf,s&&(u<0&&0===a?(tC("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),h=!0,p=null):u===a&&(h=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(o.slice(0,a+1)),y=()=>{let t;return t=d?f:h?p:n.route.Component?i.createElement(n.route.Component,null):n.route.element?n.route.element:e,i.createElement(tv,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===a)?i.createElement(tp,{location:r.location,revalidation:r.revalidation,component:f,error:d,children:y(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:c}):y()},null)}(b&&b.map(e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:U([h,l.encodeLocation?l.encodeLocation(e.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?h:U([h,l.encodeLocation?l.encodeLocation(e.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])})),s,r,n,a);return t&&E?i.createElement(tt.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...o},navigationType:"POP"}},E):E}(e,void 0,r,n,t)});function tA({to:e,replace:t,state:r,relative:n}){f(to(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a}=i.useContext(te);p(!a,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=i.useContext(tr),{pathname:l}=ti(),s=tu(),u=JSON.stringify(z(e,N(o),l,"path"===n));return i.useEffect(()=>{s(JSON.parse(u),{replace:t,state:r,relative:n})},[s,u,n,t,r]),null}function tN(e){var t;let r;return t=e.context,r=i.useContext(tr).outlet,i.useMemo(()=>r&&i.createElement(tc.Provider,{value:t},r),[r,t])}function tz(e){f(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function tU({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:o=!1,unstable_useTransitions:l}){f(!to(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),u=i.useMemo(()=>({basename:s,navigator:a,static:o,unstable_useTransitions:l,future:{}}),[s,a,o,l]);"string"==typeof r&&(r=g(r));let{pathname:c="/",search:d="",hash:h="",state:m=null,key:y="default"}=r,v=i.useMemo(()=>{let e=D(c,s);return null==e?null:{location:{pathname:e,search:d,hash:h,state:m,key:y},navigationType:n}},[s,c,d,h,m,y,n]);return(p(null!=v,`<Router basename="${s}"> is not able to match the URL "${c}${d}${h}" because it does not start with the basename, so the <Router> won't render anything.`),null==v)?null:i.createElement(te.Provider,{value:u},i.createElement(tt.Provider,{children:t,value:v}))}i.Component;var tF=function e(t,r=[]){let n=[];return i.Children.forEach(t,(t,a)=>{if(!i.isValidElement(t))return;let o=[...r,a];if(t.type===i.Fragment){n.push.apply(n,e(t.props.children,o));return}f(t.type===tz,`[${"string"==typeof t.type?t.type:t.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),f(!t.props.index||!t.props.children,"An index route cannot have child routes.");let l={id:t.props.id||o.join("-"),caseSensitive:t.props.caseSensitive,element:t.props.element,Component:t.props.Component,index:t.props.index,path:t.props.path,middleware:t.props.middleware,loader:t.props.loader,action:t.props.action,hydrateFallbackElement:t.props.hydrateFallbackElement,HydrateFallback:t.props.HydrateFallback,errorElement:t.props.errorElement,ErrorBoundary:t.props.ErrorBoundary,hasErrorBoundary:!0===t.props.hasErrorBoundary||null!=t.props.ErrorBoundary||null!=t.props.errorElement,shouldRevalidate:t.props.shouldRevalidate,handle:t.props.handle,lazy:t.props.lazy};t.props.children&&(l.children=e(t.props.children,o)),n.push(l)}),n},tH="get",tW="application/x-www-form-urlencoded";function tB(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement}var tI=null,tY=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function tJ(e){return null==e||tY.has(e)?e:(p(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${tW}"`),null)}Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),"undefined"!=typeof window?window:"undefined"!=typeof globalThis&&globalThis;function tq(e,t){if(!1===e||null==e)throw Error(t)}async function tV(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(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function tK(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}async function tX(e,t,r){var n,a;let o,i;return n=(await Promise.all(e.map(async e=>{let n=t.routes[e.route.id];if(n){let e=await tV(n,r);return e.links?e.links():[]}return[]}))).flat(1).filter(tK).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"}),o=new Set,i=new Set(void 0),n.reduce((e,t)=>{if(a&&!(null!=t&&"string"==typeof t.page)&&"script"===t.as&&t.href&&i.has(t.href))return e;let r=JSON.stringify(function(e){let t={};for(let r of Object.keys(e).sort())t[r]=e[r];return t}(t));return o.has(r)||(o.add(r),e.push({key:r,link:t})),e},[])}function tG(e,t,r,n,a,o){let i=(e,t)=>!r[t]||e.route.id!==r[t].route.id,l=(e,t)=>r[t].pathname!==e.pathname||r[t].route.path?.endsWith("*")&&r[t].params["*"]!==e.params["*"];return"assets"===o?t.filter((e,t)=>i(e,t)||l(e,t)):"data"===o?t.filter((t,o)=>{let s=n.routes[t.route.id];if(!s||!s.hasLoader)return!1;if(i(t,o)||l(t,o))return!0;if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof n)return n}return!0}):[]}function tZ(e,t,{includeHydrateFallback:r}={}){return[...new Set(e.map(e=>{let n=t.routes[e.route.id];if(!n)return[];let a=[n.module];return n.clientActionModule&&(a=a.concat(n.clientActionModule)),n.clientLoaderModule&&(a=a.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(a=a.concat(n.hydrateFallbackModule)),n.imports&&(a=a.concat(n.imports)),a}).flat(1))]}function tQ(){let e=i.useContext(e3);return tq(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function t0(){let e=i.useContext(e5);return tq(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}Symbol("SingleFetchRedirect");var t1=i.createContext(void 0);function t4(){let e=i.useContext(t1);return tq(e,"You must render this element inside a <HydratedRouter> element"),e}function t2(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function t3({page:e,...t}){let{router:r}=tQ(),n=i.useMemo(()=>k(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?i.createElement(t5,{page:e,matches:n,...t}):null}function t5({page:e,matches:t,...r}){let n=ti(),{future:a,manifest:o,routeModules:l}=t4(),{basename:s}=tQ(),{loaderData:u,matches:c}=t0(),d=i.useMemo(()=>tG(e,t,c,o,n,"data"),[e,t,c,o,n]),h=i.useMemo(()=>tG(e,t,c,o,n,"assets"),[e,t,c,o,n]),f=i.useMemo(()=>{var r,i;let c;if(e===n.pathname+n.search+n.hash)return[];let h=new Set,f=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];t&&t.hasLoader&&(!d.some(t=>t.route.id===e.route.id)&&e.route.id in u&&l[e.route.id]?.shouldRevalidate?f=!0:t.hasClientLoader?f=!0:h.add(e.route.id))}),0===h.size)return[];let p=(r=a.unstable_trailingSlashAwareDataRequests,i="data",c="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e,r?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${i}`:c.pathname=`${c.pathname}.${i}`:"/"===c.pathname?c.pathname=`_root.${i}`:s&&"/"===D(c.pathname,s)?c.pathname=`${s.replace(/\/$/,"")}/_root.${i}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${i}`,c);return f&&h.size>0&&p.searchParams.set("_routes",t.filter(e=>h.has(e.route.id)).map(e=>e.route.id).join(",")),[p.pathname+p.search]},[s,a.unstable_trailingSlashAwareDataRequests,u,n,o,d,t,e,l]),p=i.useMemo(()=>tZ(h,o),[h,o]),m=function(e){let{manifest:t,routeModules:r}=t4(),[n,a]=i.useState([]);return i.useEffect(()=>{let n=!1;return tX(e,t,r).then(e=>{n||a(e)}),()=>{n=!0}},[e,t,r]),n}(h);return i.createElement(i.Fragment,null,f.map(e=>i.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...r})),p.map(e=>i.createElement("link",{key:e,rel:"modulepreload",href:e,...r})),m.map(({key:e,link:t})=>i.createElement("link",{key:e,nonce:r.nonce,...t,crossOrigin:t.crossOrigin??r.crossOrigin})))}t1.displayName="FrameworkContext";var t7=!1;function t8(e){let{manifest:t,serverHandoffString:r,isSpaMode:n,renderMeta:a,routeDiscovery:o,ssr:l}=t4(),{router:s,static:u,staticContext:c}=tQ(),{matches:d}=t0(),h=e8(),f="lazy"===o.mode&&!0===l;a&&(a.didRenderScripts=!0);let p=n&&!t7?[d[0]]:d;i.useEffect(()=>{t7=!0},[]);let m=i.useMemo(()=>{if(h)return null;let n=c?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",a=u?`${t.hmr?.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${f?"":`import ${JSON.stringify(t.url)}`};
|
|
5
|
+
${p.map((e,r)=>{let n=`route${r}`,a=t.routes[e.route.id];tq(a,`Route ${e.route.id} not found in manifest`);let{clientActionModule:o,clientLoaderModule:i,clientMiddlewareModule:l,hydrateFallbackModule:s,module:u}=a,c=[...o?[{module:o,varName:`${n}_clientAction`}]:[],...i?[{module:i,varName:`${n}_clientLoader`}]:[],...l?[{module:l,varName:`${n}_clientMiddleware`}]:[],...s?[{module:s,varName:`${n}_HydrateFallback`}]:[],{module:u,varName:`${n}_main`}];return 1===c.length?`import * as ${n} from ${JSON.stringify(u)};`:[c.map(e=>`import * as ${e.varName} from "${e.module}";`).join("\n"),`const ${n} = {${c.map(e=>`...${e.varName}`).join(",")}};`].join("\n")}).join("\n")}
|
|
6
|
+
${f?`window.__reactRouterManifest = ${JSON.stringify(function({sri:e,...t},r){let n=new Set(r.state.matches.map(e=>e.route.id)),a=r.state.location.pathname.split("/").filter(Boolean),o=["/"];for(a.pop();a.length>0;)o.push(`/${a.join("/")}`),a.pop();o.forEach(e=>{let t=k(r.routes,e,r.basename);t&&t.forEach(e=>n.add(e.route.id))});let i=[...n].reduce((e,r)=>Object.assign(e,{[r]:t.routes[r]}),{});return{...t,routes:i,sri:!!e||void 0}}(t,s),null,2)};`:""}
|
|
7
|
+
window.__reactRouterRouteModules = {${p.map((e,t)=>`${JSON.stringify(e.route.id)}:route${t}`).join(",")}};
|
|
8
|
+
|
|
9
|
+
import(${JSON.stringify(t.entry.module)});`:" ";return i.createElement(i.Fragment,null,i.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:n},type:void 0}),i.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:a},type:"module",async:!0}))},[]),y=t7||h?[]:[...new Set(t.entry.imports.concat(tZ(p,t,{includeHydrateFallback:!0})))],v="object"==typeof t.sri?t.sri:{};return tP(!h,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),t7||h?null:i.createElement(i.Fragment,null,"object"==typeof t.sri?i.createElement("script",{...e,"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:v})}}):null,f?null:i.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:v[t.url],suppressHydrationWarning:!0}),i.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:v[t.entry.module],suppressHydrationWarning:!0}),y.map(t=>i.createElement("link",{key:t,rel:"modulepreload",href:t,crossOrigin:e.crossOrigin,integrity:v[t],suppressHydrationWarning:!0})),m)}i.Component;var t9="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{t9&&(window.__reactRouterVersion="7.13.0")}catch(e){}function t6(e,t){let r;return(function(e){let t,r,n,a,o;let i=e.window?e.window:"undefined"!=typeof window?window:void 0,l=void 0!==i&&void 0!==i.document&&void 0!==i.document.createElement;f(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s=e.hydrationRouteProperties||[],u=e.mapRouteProperties||es,c=u;if(e.unstable_instrumentations){let t=e.unstable_instrumentations;c=e=>({...u(e),...function(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){for(let t of Object.keys(r))e[t]&&r[t].push(e[t])}}));let n={};if("function"==typeof t.lazy&&r.lazy.length>0){let e=K(r.lazy,t.lazy,()=>void 0);e&&(n.lazy=e)}if("object"==typeof t.lazy){let e=t.lazy;["middleware","loader","action"].forEach(t=>{let a=e[t],o=r[`lazy.${t}`];if("function"==typeof a&&o.length>0){let e=K(o,a,()=>void 0);e&&(n.lazy=Object.assign(n.lazy||{},{[t]:e}))}})}return["loader","action"].forEach(e=>{let a=t[e];if("function"==typeof a&&r[e].length>0){let t=a[V]??a,o=K(r[e],t,(...e)=>G(e[0]));o&&("loader"===e&&!0===t.hydrate&&(o.hydrate=!0),o[V]=t,n[e]=o)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(n.middleware=t.middleware.map(e=>{let t=e[V]??e,n=K(r.middleware,t,(...e)=>G(e[0]));return n?(n[V]=t,n):e})),n}(t.map(e=>e.route).filter(Boolean),e)})}let d={},h=S(e.routes,c,void 0,d),m=e.basename||"/";m.startsWith("/")||(m=`/${m}`);let g=e.dataStrategy||eR,b={...e.future},R=null,x=new Set,C=null,L=null,$=null,O=null!=e.hydrationData,T=k(h,e.history.location,m),j=!1,_=null;if(null!=T||e.patchRoutesOnNavigation){if(T&&!e.hydrationData&&ti(T,h,e.history.location.pathname).active&&(T=null),T){if(T.some(e=>e.route.lazy))r=!1;else if(T.some(e=>ep(e.route))){let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null;if(n){let e=T.findIndex(e=>void 0!==n[e.route.id]);r=T.slice(0,e+1).every(e=>!em(e.route,t,n))}else r=T.every(e=>!em(e.route,t,n))}else r=!0}else{r=!1,T=[];let t=ti(null,h,e.history.location.pathname);t.active&&t.matches&&(j=!0,T=t.matches)}}else{let t=eW(404,{pathname:e.history.location.pathname}),{matches:n,route:a}=eH(h);r=!0,T=n,_={[a.id]:t}}let A={historyAction:e.history.action,location:e.history.location,matches:T,initialized:r,navigation:eo,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||_,fetchers:new Map,blockers:new Map},N="POP",z=null,U=!1,F=!1,H=new Map,W=null,B=!1,Y=!1,J=new Set,q=new Map,X=0,Q=-1,ee=new Map,et=new Set,er=new Map,ec=new Map,ey=new Set,eg=new Map,ew=null;function eb(e,t={}){e.matches&&(e.matches=e.matches.map(e=>{let t=d[e.route.id],r=e.route;return r.element!==t.element||r.errorElement!==t.errorElement||r.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}));let r=[],n=[];(A={...A,...e}).fetchers.forEach((e,t)=>{"idle"===e.state&&(ey.has(t)?r.push(t):n.push(t))}),ey.forEach(e=>{A.fetchers.has(e)||q.has(e)||r.push(e)}),[...x].forEach(n=>n(A,{deletedFetchers:r,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync})),r.forEach(e=>e5(e)),n.forEach(e=>A.fetchers.delete(e))}function eE(r,n,{flushSync:a}={}){let o,i,l=null!=A.actionData&&null!=A.navigation.formMethod&&eX(A.navigation.formMethod)&&"loading"===A.navigation.state&&r.state?._isRedirect!==!0;o=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:l?A.actionData:null;let s=n.loaderData?ez(A.loaderData,n.loaderData,n.matches||[],n.errors):A.loaderData,u=A.blockers;u.size>0&&(u=new Map(u)).forEach((e,t)=>u.set(t,el));let c=!B&&to(r,n.matches||A.matches),d=!0===U||null!=A.navigation.formMethod&&eX(A.navigation.formMethod)&&r.state?._isRedirect!==!0;if(t&&(h=t,t=void 0),B||"POP"===N||("PUSH"===N?e.history.push(r,r.state):"REPLACE"===N&&e.history.replace(r,r.state)),"POP"===N){let e=H.get(A.location.pathname);e&&e.has(r.pathname)?i={currentLocation:A.location,nextLocation:r}:H.has(r.pathname)&&(i={currentLocation:r,nextLocation:A.location})}else if(F){let e=H.get(A.location.pathname);e?e.add(r.pathname):(e=new Set([r.pathname]),H.set(A.location.pathname,e)),i={currentLocation:A.location,nextLocation:r}}eb({...n,actionData:o,loaderData:s,historyAction:N,location:r,initialized:!0,navigation:eo,revalidation:"idle",restoreScrollPosition:c,preventScrollReset:d,blockers:u},{viewTransitionOpts:i,flushSync:!0===a}),N="POP",U=!1,F=!1,B=!1,Y=!1,z?.resolve(),z=null,ew?.resolve(),ew=null}async function ex(t,r){if(z?.resolve(),z=null,"number"==typeof t){z||(z=e2());let r=z.promise;return e.history.go(t),r}let{path:n,submission:a,error:o}=eh(!1,ed(A.location,A.matches,m,t,r?.fromRouteId,r?.relative),r),i=A.location,l=y(A.location,n,r&&r.state);l={...l,...e.history.encodeLocation(l)};let s=r&&null!=r.replace?r.replace:void 0,u="PUSH";!0===s?u="REPLACE":!1===s||null!=a&&eX(a.formMethod)&&a.formAction===A.location.pathname+A.location.search&&(u="REPLACE");let c=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,d=!0===(r&&r.flushSync),h=tr({currentLocation:i,nextLocation:l,historyAction:u});if(h){tt(h,{state:"blocked",location:l,proceed(){tt(h,{state:"proceeding",proceed:void 0,reset:void 0,location:l}),ex(t,r)},reset(){let e=new Map(A.blockers);e.set(h,el),eb({blockers:e})}});return}await eS(u,l,{submission:a,pendingError:o,preventScrollReset:c,replace:r&&r.replace,enableViewTransition:r&&r.viewTransition,flushSync:d,callSiteDefaultShouldRevalidate:r&&r.unstable_defaultShouldRevalidate})}async function eS(r,n,o){var i,l,s;let u;a&&a.abort(),a=null,N=r,B=!0===(o&&o.startUninterruptedRevalidation),i=A.location,l=A.matches,C&&$&&(C[ta(i,l)]=$()),U=!0===(o&&o.preventScrollReset),F=!0===(o&&o.enableViewTransition);let c=t||h,d=o&&o.overrideNavigation,f=o?.initialHydration&&A.matches&&A.matches.length>0&&!j?A.matches:k(c,n,m),p=!0===(o&&o.flushSync);if(f&&A.initialized&&!Y&&(s=A.location).pathname===n.pathname&&s.search===n.search&&(""===s.hash?""!==n.hash:s.hash===n.hash||""!==n.hash)&&!(o&&o.submission&&eX(o.submission.formMethod))){eE(n,{matches:f},{flushSync:p});return}let y=ti(f,c,n.pathname);if(y.active&&y.matches&&(f=y.matches),!f){let{error:e,notFoundMatches:t,route:r}=tn(n.pathname);eE(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:p});return}a=new AbortController;let v=ej(e.history,n,a.signal,o&&o.submission),g=e.getContext?await e.getContext():new E;if(o&&o.pendingError)u=[eF(f).route.id,{type:"error",error:o.pendingError}];else if(o&&o.submission&&eX(o.submission.formMethod)){let t=await eC(v,n,o.submission,f,g,y.active,o&&!0===o.initialHydration,{replace:o.replace,flushSync:p});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(eJ(r)&&I(r.error)&&404===r.error.status){a=null,eE(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}});return}}f=t.matches||f,u=t.pendingActionResult,d=e0(n,o.submission),p=!1,y.active=!1,v=ej(e.history,v.url,v.signal)}let{shortCircuited:w,matches:b,loaderData:R,errors:x}=await ek(v,n,f,g,y.active,d,o&&o.submission,o&&o.fetcherSubmission,o&&o.replace,o&&!0===o.initialHydration,p,u,o&&o.callSiteDefaultShouldRevalidate);w||(a=null,eE(n,{matches:b||f,...eU(u),loaderData:R,errors:x}))}async function eC(t,r,n,a,o,i,l,u={}){let f;if(eY(),eb({navigation:{state:"submitting",location:r,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}},{flushSync:!0===u.flushSync}),i){let e=await tl(a,r.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:r}=eH(h);return{matches:t,pendingActionResult:[r.id,{type:"error",error:e.error}]}}let t=eF(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:"error",error:e.error}]}}if(e.matches)a=e.matches;else{let{notFoundMatches:e,error:t,route:n}=tn(r.pathname);return{matches:e,pendingActionResult:[n.id,{type:"error",error:t}]}}}let p=eZ(a,r);if(p.route.action||p.route.lazy){let e=eL(c,d,t,a,p,l?[]:s,o),r=await eA(t,e,o,null);if(!(f=r[p.route.id])){for(let e of a)if(r[e.route.id]){f=r[e.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}else f={type:"error",error:eW(405,{method:t.method,pathname:r.pathname,routeId:p.route.id})};if(eq(f)){let r;return r=u&&null!=u.replace?u.replace:eM(f.response.headers.get("Location"),new URL(t.url),m,e.history)===A.location.pathname+A.location.search,await e_(t,f,!0,{submission:n,replace:r}),{shortCircuited:!0}}if(eJ(f)){let e=eF(a,p.route.id);return!0!==(u&&u.replace)&&(N="PUSH"),{matches:a,pendingActionResult:[e.route.id,f,p.route.id]}}return{matches:a,pendingActionResult:[p.route.id,f]}}async function ek(r,n,o,i,l,u,f,p,y,v,g,w,b){let E=u||e0(n,f),R=f||p||eQ(E),x=!B&&!v;if(l){if(x){let e=eP(w);eb({navigation:E,...void 0!==e?{actionData:e}:{}},{flushSync:g})}let e=await tl(o,n.pathname,r.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:r}=eH(h);return{matches:t,loaderData:{},errors:{[r.id]:e.error}}}let t=eF(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)o=e.matches;else{let{error:e,notFoundMatches:t,route:r}=tn(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let S=t||h,{dsMatches:C,revalidatingFetchers:k}=ef(r,i,c,d,e.history,A,o,R,n,v?[]:s,!0===v,Y,J,ey,er,et,S,m,null!=e.patchRoutesOnNavigation,w,b);if(Q=++X,!e.dataStrategy&&!C.some(e=>e.shouldLoad)&&!C.some(e=>e.route.middleware&&e.route.middleware.length>0)&&0===k.length){let e=e9();return eE(n,{matches:o,loaderData:{},errors:w&&eJ(w[1])?{[w[0]]:w[1].error}:null,...eU(w),...e?{fetchers:new Map(A.fetchers)}:{}},{flushSync:g}),{shortCircuited:!0}}if(x){let e={};if(!l){e.navigation=E;let t=eP(w);void 0!==t&&(e.actionData=t)}k.length>0&&(e.fetchers=(k.forEach(e=>{let t=A.fetchers.get(e.key),r=e1(void 0,t?t.data:void 0);A.fetchers.set(e.key,r)}),new Map(A.fetchers))),eb(e,{flushSync:g})}k.forEach(e=>{e7(e.key),e.controller&&q.set(e.key,e.controller)});let P=()=>k.forEach(e=>e7(e.key));a&&a.signal.addEventListener("abort",P);let{loaderResults:L,fetcherResults:$}=await eI(C,k,r,i);if(r.signal.aborted)return{shortCircuited:!0};a&&a.signal.removeEventListener("abort",P),k.forEach(e=>q.delete(e.key));let O=eB(L);if(O)return await e_(r,O.result,!0,{replace:y}),{shortCircuited:!0};if(O=eB($))return et.add(O.key),await e_(r,O.result,!0,{replace:y}),{shortCircuited:!0};let{loaderData:D,errors:T}=eN(A,o,L,w,k,$);v&&A.errors&&(T={...A.errors,...T});let M=e9(),j=e6(Q);return{matches:o,loaderData:D,errors:T,...M||j||k.length>0?{fetchers:new Map(A.fetchers)}:{}}}function eP(e){return e&&!eJ(e[1])?{[e[0]]:e[1].data}:A.actionData?0===Object.keys(A.actionData).length?null:A.actionData:void 0}async function eO(r,n,o,i,l,u,p,y,v,g){eY(),er.delete(r);let w=A.fetchers.get(r);eV(r,{state:"submitting",formMethod:v.formMethod,formAction:v.formAction,formEncType:v.formEncType,formData:v.formData,json:v.json,text:v.text,data:w?w.data:void 0},{flushSync:p});let b=new AbortController,E=ej(e.history,o,b.signal,v);if(u){let e=await tl(i,new URL(E.url).pathname,E.signal,r);if("aborted"===e.type)return;if("error"===e.type){eG(r,n,e.error,{flushSync:p});return}if(e.matches)i=e.matches;else{eG(r,n,eW(404,{pathname:o}),{flushSync:p});return}}let R=eZ(i,o);if(!R.route.action&&!R.route.lazy){let e=eW(405,{method:v.formMethod,pathname:o,routeId:n});eG(r,n,e,{flushSync:p});return}q.set(r,b);let x=X,S=eL(c,d,E,i,R,s,l),C=await eA(E,S,l,r),P=C[R.route.id];if(!P){for(let e of S)if(C[e.route.id]){P=C[e.route.id];break}}if(E.signal.aborted){q.get(r)===b&&q.delete(r);return}if(ey.has(r)){if(eq(P)||eJ(P)){eV(r,e4(void 0));return}}else{if(eq(P))return(q.delete(r),Q>x)?void eV(r,e4(void 0)):(et.add(r),eV(r,e1(v)),e_(E,P,!1,{fetcherSubmission:v,preventScrollReset:y}));if(eJ(P)){eG(r,n,P.error);return}}let L=A.navigation.location||A.location,$=ej(e.history,L,b.signal),O=t||h,D="idle"!==A.navigation.state?k(O,A.navigation.location,m):A.matches;f(D,"Didn't find any matches after fetcher action");let T=++X;ee.set(r,T);let M=e1(v,P.data);A.fetchers.set(r,M);let{dsMatches:j,revalidatingFetchers:_}=ef($,l,c,d,e.history,A,D,v,L,s,!1,Y,J,ey,er,et,O,m,null!=e.patchRoutesOnNavigation,[R.route.id,P],g);_.filter(e=>e.key!==r).forEach(e=>{let t=e.key,r=A.fetchers.get(t),n=e1(void 0,r?r.data:void 0);A.fetchers.set(t,n),e7(t),e.controller&&q.set(t,e.controller)}),eb({fetchers:new Map(A.fetchers)});let z=()=>_.forEach(e=>e7(e.key));b.signal.addEventListener("abort",z);let{loaderResults:U,fetcherResults:F}=await eI(j,_,$,l);if(b.signal.aborted)return;if(b.signal.removeEventListener("abort",z),ee.delete(r),q.delete(r),_.forEach(e=>q.delete(e.key)),A.fetchers.has(r)){let e=e4(P.data);A.fetchers.set(r,e)}let H=eB(U);if(H)return e_($,H.result,!1,{preventScrollReset:y});if(H=eB(F))return et.add(H.key),e_($,H.result,!1,{preventScrollReset:y});let{loaderData:W,errors:B}=eN(A,D,U,void 0,_,F);e6(T),"loading"===A.navigation.state&&T>Q?(f(N,"Expected pending action"),a&&a.abort(),eE(A.navigation.location,{matches:D,loaderData:W,errors:B,fetchers:new Map(A.fetchers)})):(eb({errors:B,loaderData:ez(A.loaderData,W,D,B),fetchers:new Map(A.fetchers)}),Y=!1)}async function eD(t,r,n,a,o,i,l,u,h){let f=A.fetchers.get(t);eV(t,e1(h,f?f.data:void 0),{flushSync:l});let p=new AbortController,m=ej(e.history,n,p.signal);if(i){let e=await tl(a,new URL(m.url).pathname,m.signal,t);if("aborted"===e.type)return;if("error"===e.type){eG(t,r,e.error,{flushSync:l});return}if(e.matches)a=e.matches;else{eG(t,r,eW(404,{pathname:n}),{flushSync:l});return}}let y=eZ(a,n);q.set(t,p);let v=X,g=eL(c,d,m,a,y,s,o),w=(await eA(m,g,o,t))[y.route.id];if(q.get(t)===p&&q.delete(t),!m.signal.aborted){if(ey.has(t)){eV(t,e4(void 0));return}if(eq(w)){if(Q>v){eV(t,e4(void 0));return}et.add(t),await e_(m,w,!1,{preventScrollReset:u});return}if(eJ(w)){eG(t,r,w.error);return}eV(t,e4(w.data))}}async function e_(t,r,n,{submission:o,fetcherSubmission:s,preventScrollReset:u,replace:c}={}){n||(z?.resolve(),z=null),r.response.headers.has("X-Remix-Revalidate")&&(Y=!0);let d=r.response.headers.get("Location");f(d,"Expected a Location header on the redirect Response"),d=eM(d,new URL(t.url),m,e.history);let h=y(A.location,d,{_isRedirect:!0});if(l){let e=!1;if(r.response.headers.has("X-Remix-Reload-Document"))e=!0;else if(M(d)){let t=w(d,!0);e=t.origin!==i.location.origin||null==D(t.pathname,m)}if(e){c?i.location.replace(d):i.location.assign(d);return}}a=null;let p=!0===c||r.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:v,formAction:g,formEncType:b}=A.navigation;!o&&!s&&v&&g&&b&&(o=eQ(A.navigation));let E=o||s;if(ea.has(r.response.status)&&E&&eX(E.formMethod))await eS(p,h,{submission:{...E,formAction:d},preventScrollReset:u||U,enableViewTransition:n?F:void 0});else{let e=e0(h,o);await eS(p,h,{overrideNavigation:e,fetcherSubmission:s,preventScrollReset:u||U,enableViewTransition:n?F:void 0})}}async function eA(e,t,r,n){let a;let o={};try{a=await e$(g,e,t,n,r,!1)}catch(e){return t.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:"error",error:e}}),o}if(e.signal.aborted)return o;if(!eX(e.method))for(let e of t){if(a[e.route.id]?.type==="error")break;!a.hasOwnProperty(e.route.id)&&!A.loaderData.hasOwnProperty(e.route.id)&&(!A.errors||!A.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:"error",result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[r,n]of Object.entries(a))if(eK(n.result)&&en.has(n.result.status)){let a=n.result;o[r]={type:"redirect",response:function(e,t,r,n,a){let o=e.headers.get("Location");if(f(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!M(o)){let i=n.slice(0,n.findIndex(e=>e.route.id===r)+1);o=ed(new URL(t.url),i,a,o),e.headers.set("Location",o)}return e}(a,e,r,t,m)}}else o[r]=await eT(n);return o}async function eI(e,t,r,n){let a=eA(r,e,n,null),o=Promise.all(t.map(async e=>{if(!e.matches||!e.match||!e.request||!e.controller)return Promise.resolve({[e.key]:{type:"error",error:eW(404,{pathname:e.path})}});{let t=(await eA(e.request,e.matches,n,e.key))[e.match.route.id];return{[e.key]:t}}}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function eY(){Y=!0,er.forEach((e,t)=>{q.has(t)&&J.add(t),e7(t)})}function eV(e,t,r={}){A.fetchers.set(e,t),eb({fetchers:new Map(A.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function eG(e,t,r,n={}){let a=eF(A.matches,t);e5(e),eb({errors:{[a.route.id]:r},fetchers:new Map(A.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function e3(e){return ec.set(e,(ec.get(e)||0)+1),ey.has(e)&&ey.delete(e),A.fetchers.get(e)||ei}function e5(e){let t=A.fetchers.get(e);q.has(e)&&!(t&&"loading"===t.state&&ee.has(e))&&e7(e),er.delete(e),ee.delete(e),et.delete(e),ey.delete(e),J.delete(e),A.fetchers.delete(e)}function e7(e,t){let r=q.get(e);r&&(r.abort(t),q.delete(e))}function e8(e){for(let t of e){let e=e4(e3(t).data);A.fetchers.set(t,e)}}function e9(){let e=[],t=!1;for(let r of et){let n=A.fetchers.get(r);f(n,`Expected fetcher: ${r}`),"loading"===n.state&&(et.delete(r),e.push(r),t=!0)}return e8(e),t}function e6(e){let t=[];for(let[r,n]of ee)if(n<e){let e=A.fetchers.get(r);f(e,`Expected fetcher: ${r}`),"loading"===e.state&&(e7(r),ee.delete(r),t.push(r))}return e8(t),t.length>0}function te(e){A.blockers.delete(e),eg.delete(e)}function tt(e,t){let r=A.blockers.get(e)||el;f("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,`Invalid blocker state transition: ${r.state} -> ${t.state}`);let n=new Map(A.blockers);n.set(e,t),eb({blockers:n})}function tr({currentLocation:e,nextLocation:t,historyAction:r}){if(0===eg.size)return;eg.size>1&&p(!1,"A router only supports one blocker at a time");let n=Array.from(eg.entries()),[a,o]=n[n.length-1],i=A.blockers.get(a);if((!i||"proceeding"!==i.state)&&o({currentLocation:e,nextLocation:t,historyAction:r}))return a}function tn(e){let r=eW(404,{pathname:e}),{matches:n,route:a}=eH(t||h);return{notFoundMatches:n,route:a,error:r}}function ta(e,t){return L&&L(e,t.map(e=>(function(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],loaderData:t[r.id],handle:r.handle}})(e,A.loaderData)))||e.key}function to(e,t){if(C){let r=C[ta(e,t)];if("number"==typeof r)return r}return null}function ti(t,r,n){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:P(r,n,m,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:P(r,n,m,!0)}}return{active:!1,matches:null}}async function tl(r,n,a,o){if(!e.patchRoutesOnNavigation)return{type:"success",matches:r};let i=r;for(;;){let r=null==t,l=t||h,s=d;try{await e.patchRoutesOnNavigation({signal:a,path:n,matches:i,fetcherKey:o,patch:(e,t)=>{a.aborted||ev(e,t,l,s,c,!1)}})}catch(e){return{type:"error",error:e,partialMatches:i}}finally{r&&!a.aborted&&(h=[...h])}if(a.aborted)return{type:"aborted"};let u=k(l,n,m),f=null;if(u&&(0===Object.keys(u[0].params).length||!((f=P(l,n,m,!0))&&i.length<f.length&&ts(i,f.slice(0,i.length)))))return{type:"success",matches:u};if(f||(f=P(l,n,m,!0)),!f||ts(i,f))return{type:"success",matches:null};i=f}}function ts(e,t){return e.length===t.length&&e.every((e,r)=>e.route.id===t[r].route.id)}return n={get basename(){return m},get future(){return b},get state(){return A},get routes(){return h},get window(){return i},initialize:function(){if(R=e.history.listen(({action:t,location:r,delta:n})=>{if(o){o(),o=void 0;return}p(0===eg.size||null!=n,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let a=tr({currentLocation:A.location,nextLocation:r,historyAction:t});if(a&&null!=n){let t=new Promise(e=>{o=e});e.history.go(-1*n),tt(a,{state:"blocked",location:r,proceed(){tt(a,{state:"proceeding",proceed:void 0,reset:void 0,location:r}),t.then(()=>e.history.go(n))},reset(){let e=new Map(A.blockers);e.set(a,el),eb({blockers:e})}}),z?.resolve(),z=null;return}return eS(t,r)}),l){(function(e,t){try{let r=e.sessionStorage.getItem(eu);if(r){let e=JSON.parse(r);for(let[r,n]of Object.entries(e||{}))n&&Array.isArray(n)&&t.set(r,new Set(n||[]))}}catch(e){}})(i,H);let e=()=>(function(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(eu,JSON.stringify(r))}catch(e){p(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}})(i,H);i.addEventListener("pagehide",e),W=()=>i.removeEventListener("pagehide",e)}return A.initialized||eS("POP",A.location,{initialHydration:!0}),n},subscribe:function(e){return x.add(e),()=>x.delete(e)},enableScrollRestoration:function(e,t,r){if(C=e,$=t,L=r||null,!O&&A.navigation===eo){O=!0;let e=to(A.location,A.matches);null!=e&&eb({restoreScrollPosition:e})}return()=>{C=null,$=null,L=null}},navigate:ex,fetch:async function(r,n,a,o){e7(r);let i=!0===(o&&o.flushSync),l=t||h,s=ed(A.location,A.matches,m,a,n,o?.relative),u=k(l,s,m),c=ti(u,l,s);if(c.active&&c.matches&&(u=c.matches),!u){eG(r,n,eW(404,{pathname:s}),{flushSync:i});return}let{path:d,submission:f,error:p}=eh(!0,s,o);if(p){eG(r,n,p,{flushSync:i});return}let y=e.getContext?await e.getContext():new E,v=!0===(o&&o.preventScrollReset);if(f&&eX(f.formMethod)){await eO(r,n,d,u,y,c.active,i,v,f,o&&o.unstable_defaultShouldRevalidate);return}er.set(r,{routeId:n,path:d}),await eD(r,n,d,u,y,c.active,i,v,f)},revalidate:function(){ew||(ew=e2()),eY(),eb({revalidation:"loading"});let e=ew.promise;return"submitting"===A.navigation.state||("idle"===A.navigation.state?eS(A.historyAction,A.location,{startUninterruptedRevalidation:!0}):eS(N||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:!0===F})),e},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:e3,resetFetcher:function(e,t){e7(e,t?.reason),eV(e,e4(null))},deleteFetcher:function(e){let t=(ec.get(e)||0)-1;t<=0?(ec.delete(e),ey.add(e)):ec.set(e,t),eb({fetchers:new Map(A.fetchers)})},dispose:function(){R&&R(),W&&W(),x.clear(),a&&a.abort(),A.fetchers.forEach((e,t)=>e5(t)),A.blockers.forEach((e,t)=>te(t))},getBlocker:function(e,t){let r=A.blockers.get(e)||el;return eg.get(e)!==t&&eg.set(e,t),r},deleteBlocker:te,patchRoutes:function(e,r,n=!1){let a=null==t;ev(e,r,t||h,d,c,n),a&&(h=[...h],eb({}))},_internalFetchControllers:q,_internalSetRoutes:function(e){t=S(e,c,void 0,d={})},_internalSetStateDoNotUseOrYouWillBreakYourApp(e){eb(e)}},e.unstable_instrumentations&&(n=function(e,t){let r={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){for(let t of Object.keys(e))e[t]&&r[t].push(e[t])}})),r.navigate.length>0){let t=e.navigate[V]??e.navigate,n=K(r.navigate,t,(...t)=>{let[r,n]=t;return{to:"number"==typeof r||"string"==typeof r?r:r?v(r):".",...Z(e,n??{})}});n&&(n[V]=t,e.navigate=n)}if(r.fetch.length>0){let t=e.fetch[V]??e.fetch,n=K(r.fetch,t,(...t)=>{let[r,,n,a]=t;return{href:n??".",fetcherKey:r,...Z(e,a??{})}});n&&(n[V]=t,e.fetch=n)}return e}(n,e.unstable_instrumentations.map(e=>e.router).filter(Boolean))),n})({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:function(e={}){return function(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,l="POP",s=null,u=c();function c(){return(i.state||{idx:null}).idx}function d(){l="POP";let e=c(),t=null==e?null:e-u;u=e,s&&s({action:l,location:f.location,delta:t})}null==u&&(u=0,i.replaceState({...i.state,idx:u},""));let f={get action(){return l},get location(){return e(a,i)},listen(e){if(s)throw Error("A history only accepts one active listener");return a.addEventListener(h,d),s=e,()=>{a.removeEventListener(h,d),s=null}},createHref:e=>t(a,e),createURL:function(e){return w(e)},encodeLocation(e){let t=w(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){l="PUSH";let n=y(f.location,e,t);r&&r(n,e);let d=m(n,u=c()+1),h=f.createHref(n);try{i.pushState(d,"",h)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;a.location.assign(h)}o&&s&&s({action:l,location:f.location,delta:1})},replace:function(e,t){l="REPLACE";let n=y(f.location,e,t);r&&r(n,e);let a=m(n,u=c()),d=f.createHref(n);i.replaceState(a,"",d),o&&s&&s({action:l,location:f.location,delta:0})},go:e=>i.go(e)};return f}(function(e,t){let{pathname:r="/",search:n="",hash:a=""}=g(e.location.hash.substring(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),y("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){let r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){let t=e.location.href,r=t.indexOf("#");n=-1===r?t:t.slice(0,r)}return n+"#"+("string"==typeof t?t:v(t))},function(e,t){p("/"===e.pathname.charAt(0),`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)},e)}({window:t?.window}),hydrationData:t?.hydrationData||((r=window?.__staticRouterHydrationData)&&r.errors&&(r={...r,errors:function(e){if(!e)return null;let t=Object.entries(e),r={};for(let[e,n]of t)if(n&&"RouteErrorResponse"===n.__type)r[e]=new B(n.status,n.statusText,n.data,!0===n.internal);else if(n&&"Error"===n.__type){if(n.__subType){let t=window[n.__subType];if("function"==typeof t)try{let a=new t(n.message);a.stack="",r[e]=a}catch(e){}}if(null==r[e]){let t=Error(n.message);t.stack="",r[e]=t}}else r[e]=n;return r}(r.errors)}),r),routes:e,mapRouteProperties:tO,hydrationRouteProperties:tD,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}var re=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rt=i.forwardRef(function({onClick:e,discover:t="render",prefetch:r="none",relative:n,reloadDocument:a,replace:o,state:l,target:s,to:u,preventScrollReset:c,viewTransition:d,unstable_defaultShouldRevalidate:h,...p},m){let{basename:y,unstable_useTransitions:g}=i.useContext(te),w="string"==typeof u&&re.test(u),b=q(u,y),E=function(e,{relative:t}={}){f(to(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=i.useContext(te),{hash:a,pathname:o,search:l}=th(e,{relative:t}),s=o;return"/"!==r&&(s="/"===o?r:U([r,o])),n.createHref({pathname:s,search:l,hash:a})}(u=b.to,{relative:n}),[R,x,S]=function(e,t){let r=i.useContext(t1),[n,a]=i.useState(!1),[o,l]=i.useState(!1),{onFocus:s,onBlur:u,onMouseEnter:c,onMouseLeave:d,onTouchStart:h}=t,f=i.useRef(null);i.useEffect(()=>{if("render"===e&&l(!0),"viewport"===e){let e=new IntersectionObserver(e=>{e.forEach(e=>{l(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),i.useEffect(()=>{if(n){let e=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(e)}}},[n]);let p=()=>{a(!0)},m=()=>{a(!1),l(!1)};return r?"intent"!==e?[o,f,{}]:[o,f,{onFocus:t2(s,p),onBlur:t2(u,m),onMouseEnter:t2(c,p),onMouseLeave:t2(d,m),onTouchStart:t2(h,p)}]:[!1,f,{}]}(r,p),C=function(e,{target:t,replace:r,state:n,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:s,unstable_useTransitions:u}={}){let c=tu(),d=ti(),h=th(e,{relative:o});return i.useCallback(f=>{if(0===f.button&&(!t||"_self"===t)&&!(f.metaKey||f.altKey||f.ctrlKey||f.shiftKey)){f.preventDefault();let t=void 0!==r?r:v(d)===v(h),p=()=>c(e,{replace:t,state:n,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:s});u?i.startTransition(()=>p()):p()}},[d,c,h,r,n,t,e,a,o,l,s,u])}(u,{replace:o,state:l,target:s,preventScrollReset:c,relative:n,viewTransition:d,unstable_defaultShouldRevalidate:h,unstable_useTransitions:g}),k=i.createElement("a",{...p,...S,href:b.absoluteURL||E,onClick:b.isExternal||a?e:function(t){e&&e(t),t.defaultPrevented||C(t)},ref:function(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}(m,x),target:s,"data-discover":w||"render"!==t?void 0:"true"});return R&&!w?i.createElement(i.Fragment,null,k,i.createElement(t3,{page:E})):k});rt.displayName="Link";var rr=i.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:r="",end:n=!1,style:a,to:o,viewTransition:l,children:s,...u},c){let d,h=th(o,{relative:u.relative}),p=ti(),m=i.useContext(e5),{navigator:y,basename:v}=i.useContext(te),g=null!=m&&function(e,{relative:t}={}){let r=i.useContext(e9);f(null!=r,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=rn("useViewTransitionState"),a=th(e,{relative:t});if(!r.isTransitioning)return!1;let o=D(r.currentLocation.pathname,n)||r.currentLocation.pathname,l=D(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=O(a.pathname,l)||null!=O(a.pathname,o)}(h)&&!0===l,w=y.encodeLocation?y.encodeLocation(h).pathname:h.pathname,b=p.pathname,E=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;t||(b=b.toLowerCase(),E=E?E.toLowerCase():null,w=w.toLowerCase()),E&&v&&(E=D(E,v)||E);let R="/"!==w&&w.endsWith("/")?w.length-1:w.length,x=b===w||!n&&b.startsWith(w)&&"/"===b.charAt(R),S=null!=E&&(E===w||!n&&E.startsWith(w)&&"/"===E.charAt(w.length)),C={isActive:x,isPending:S,isTransitioning:g},k=x?e:void 0;d="function"==typeof r?r(C):[r,x?"active":null,S?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let P="function"==typeof a?a(C):a;return i.createElement(rt,{...u,"aria-current":k,className:d,ref:c,style:P,to:o,viewTransition:l},"function"==typeof s?s(C):s)});function rn(e){let t=i.useContext(e3);return f(t,`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`),t}rr.displayName="NavLink",i.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:l=tH,action:s,onSubmit:u,relative:c,preventScrollReset:d,viewTransition:h,unstable_defaultShouldRevalidate:p,...m},y)=>{let{unstable_useTransitions:g}=i.useContext(te),w=function(){let{router:e}=rn("useSubmit"),{basename:t}=i.useContext(te),r=tE("useRouteId"),n=e.fetch,a=e.navigate;return i.useCallback(async(e,o={})=>{let{action:i,method:l,encType:s,formData:u,body:c}=function(e,t){let r,n,a,o,i;if(tB(e)&&"form"===e.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?D(i,t):null,r=e.getAttribute("method")||tH,a=tJ(e.getAttribute("enctype"))||tW,o=new FormData(e)}else if(tB(e)&&"button"===e.tagName.toLowerCase()||tB(e)&&"input"===e.tagName.toLowerCase()&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||i.getAttribute("action");if(n=l?D(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||tH,a=tJ(e.getAttribute("formenctype"))||tJ(i.getAttribute("enctype"))||tW,o=new FormData(i,e),!function(){if(null===tI)try{new FormData(document.createElement("form"),0),tI=!1}catch(e){tI=!0}return tI}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?`${t}.`:"";o.append(`${e}x`,"0"),o.append(`${e}y`,"0")}else t&&o.append(t,n)}}else if(tB(e))throw Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');else r=tH,n=null,a=tW,i=e;return o&&"text/plain"===a&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}(e,t);if(!1===o.navigate){let e=o.fetcherKey||ro();await n(e,r,o.action||i,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:u,body:c,formMethod:o.method||l,formEncType:o.encType||s,flushSync:o.flushSync})}else await a(o.action||i,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:u,body:c,formMethod:o.method||l,formEncType:o.encType||s,replace:o.replace,state:o.state,fromRouteId:r,flushSync:o.flushSync,viewTransition:o.viewTransition})},[n,a,t,r])}(),b=function(e,{relative:t}={}){let{basename:r}=i.useContext(te),n=i.useContext(tr);f(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),o={...th(e||".",{relative:t})},l=ti();if(null==e){o.search=l.search;let e=new URLSearchParams(o.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let r=e.toString();o.search=r?`?${r}`:""}}return(!e||"."===e)&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),"/"!==r&&(o.pathname="/"===o.pathname?r:U([r,o.pathname])),v(o)}(s,{relative:c}),E="get"===l.toLowerCase()?"get":"post",R="string"==typeof s&&re.test(s);return i.createElement("form",{ref:y,method:E,action:b,onSubmit:n?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let n=e.nativeEvent.submitter,s=n?.getAttribute("formmethod")||l,f=()=>w(n||e.currentTarget,{fetcherKey:t,method:s,navigate:r,replace:a,state:o,relative:c,preventScrollReset:d,viewTransition:h,unstable_defaultShouldRevalidate:p});g&&!1!==r?i.startTransition(()=>f()):f()},...m,"data-discover":R||"render"!==e?void 0:"true"})}).displayName="Form";var ra=0,ro=()=>`__${String(++ra)}__`;function ri(e,t){let{capture:r}=t||{};i.useEffect(()=>{let t=null!=r?{capture:r}:void 0;return window.addEventListener("beforeunload",e,t),()=>{window.removeEventListener("beforeunload",e,t)}},[e,r])}}}]);
|