@mcp-use/inspector 0.9.1 → 0.9.2
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/dist/client/assets/{browser-BZ1VyPPE.js → browser-BaWfMf0m.js} +20 -20
- package/dist/client/assets/{display-A5IEINAP-BtnnEI1b.js → display-A5IEINAP-C7C5ZEWf.js} +2 -2
- package/dist/client/assets/{embeddings-BL9ejhef.js → embeddings-Cd_IFijr.js} +1 -1
- package/dist/client/assets/index-BDueMm07.js +2 -0
- package/dist/client/assets/index-BaFuUxbj.js +40 -0
- package/dist/client/assets/{index-Chq9-Di8.js → index-BxlzAdRz.js} +1 -1
- package/dist/client/assets/{index-B7YsVTr1.js → index-CejJnjhQ.js} +1 -1
- package/dist/client/assets/{index-DpINZeCw.js → index-D-t8kYzy.js} +1 -1
- package/dist/client/assets/index-DZxMwvFi.js +1683 -0
- package/dist/client/assets/{index-RN7Bwyyp.js → index-Dwx0D9tm.js} +1 -1
- package/dist/client/assets/{index-CKjOo3Yf.js → index-FfhUz5GP.js} +1 -1
- package/dist/client/assets/{winston-FgGR1hHA.js → winston-D_OHtP4E.js} +1 -1
- package/dist/client/index.html +2 -2
- package/package.json +38 -38
- package/dist/client/assets/index-DfkXNide.js +0 -1628
- package/dist/client/assets/index-LHuBhwpA.js +0 -2
- package/dist/client/assets/index-efwGY5fY.js +0 -7
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import{r as d,R as ce,b as Ii,c as Hi}from"./index-DZxMwvFi.js";var Ct={},Ia;function ji(){if(Ia)return Ct;Ia=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.parse=i,Ct.serialize=u;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,r=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,a=/^[\u0020-\u003A\u003D-\u007E]*$/,n=Object.prototype.toString,o=(()=>{const m=function(){};return m.prototype=Object.create(null),m})();function i(m,p){const h=new o,g=m.length;if(g<2)return h;const y=p?.decode||c;let w=0;do{const R=m.indexOf("=",w);if(R===-1)break;const C=m.indexOf(";",w),x=C===-1?g:C;if(R>x){w=m.lastIndexOf(";",R-1)+1;continue}const P=s(m,w,R),D=l(m,R,P),E=m.slice(P,D);if(h[E]===void 0){let F=s(m,R+1,x),T=l(m,x,F);const M=y(m.slice(F,T));h[E]=M}w=x+1}while(w<g);return h}function s(m,p,h){do{const g=m.charCodeAt(p);if(g!==32&&g!==9)return p}while(++p<h);return h}function l(m,p,h){for(;p>h;){const g=m.charCodeAt(--p);if(g!==32&&g!==9)return p+1}return h}function u(m,p,h){const g=h?.encode||encodeURIComponent;if(!e.test(m))throw new TypeError(`argument name is invalid: ${m}`);const y=g(p);if(!t.test(y))throw new TypeError(`argument val is invalid: ${p}`);let w=m+"="+y;if(!h)return w;if(h.maxAge!==void 0){if(!Number.isInteger(h.maxAge))throw new TypeError(`option maxAge is invalid: ${h.maxAge}`);w+="; Max-Age="+h.maxAge}if(h.domain){if(!r.test(h.domain))throw new TypeError(`option domain is invalid: ${h.domain}`);w+="; Domain="+h.domain}if(h.path){if(!a.test(h.path))throw new TypeError(`option path is invalid: ${h.path}`);w+="; Path="+h.path}if(h.expires){if(!f(h.expires)||!Number.isFinite(h.expires.valueOf()))throw new TypeError(`option expires is invalid: ${h.expires}`);w+="; Expires="+h.expires.toUTCString()}if(h.httpOnly&&(w+="; HttpOnly"),h.secure&&(w+="; Secure"),h.partitioned&&(w+="; Partitioned"),h.priority)switch(typeof h.priority=="string"?h.priority.toLowerCase():void 0){case"low":w+="; Priority=Low";break;case"medium":w+="; Priority=Medium";break;case"high":w+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${h.priority}`)}if(h.sameSite)switch(typeof h.sameSite=="string"?h.sameSite.toLowerCase():h.sameSite){case!0:case"strict":w+="; SameSite=Strict";break;case"lax":w+="; SameSite=Lax";break;case"none":w+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${h.sameSite}`)}return w}function c(m){if(m.indexOf("%")===-1)return m;try{return decodeURIComponent(m)}catch{return m}}function f(m){return n.call(m)==="[object Date]"}return Ct}var Ha=ji(),st={exports:{}},ja;function Ui(){if(ja)return st.exports;ja=1;var e={decodeValues:!0,map:!1,silent:!1};function t(l){return typeof l!="string"||l in{}}function r(){return Object.create(null)}function a(l){return typeof l=="string"&&!!l.trim()}function n(l,u){var c=l.split(";").filter(a),f=c.shift(),m=o(f),p=m.name,h=m.value;if(u=u?Object.assign({},e,u):e,t(p))return null;try{h=u.decodeValues?decodeURIComponent(h):h}catch(y){console.error("set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",y)}var g=r();return g.name=p,g.value=h,c.forEach(function(y){var w=y.split("="),R=w.shift().trimLeft().toLowerCase();if(!t(R)){var C=w.join("=");if(R==="expires")g.expires=new Date(C);else if(R==="max-age"){var x=parseInt(C,10);Number.isNaN(x)||(g.maxAge=x)}else R==="secure"?g.secure=!0:R==="httponly"?g.httpOnly=!0:R==="samesite"?g.sameSite=C:R==="partitioned"?g.partitioned=!0:R&&(g[R]=C)}}),g}function o(l){var u="",c="",f=l.split("=");return f.length>1?(u=f.shift(),c=f.join("=")):c=l,{name:u,value:c}}function i(l,u){if(u=u?Object.assign({},e,u):e,!l)return u.map?r():[];if(l.headers)if(typeof l.headers.getSetCookie=="function")l=l.headers.getSetCookie();else if(l.headers["set-cookie"])l=l.headers["set-cookie"];else{var c=l.headers[Object.keys(l.headers).find(function(m){return m.toLowerCase()==="set-cookie"})];!c&&l.headers.cookie&&!u.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),l=c}if(Array.isArray(l)||(l=[l]),u.map){var f=r();return l.filter(a).reduce(function(m,p){var h=n(p,u);return h&&!t(h.name)&&(m[h.name]=h),m},f)}else return l.filter(a).map(function(m){return n(m,u)}).filter(Boolean)}function s(l){if(Array.isArray(l))return l;if(typeof l!="string")return[];var u=[],c=0,f,m,p,h,g;function y(){for(;c<l.length&&/\s/.test(l.charAt(c));)c+=1;return c<l.length}function w(){return m=l.charAt(c),m!=="="&&m!==";"&&m!==","}for(;c<l.length;){for(f=c,g=!1;y();)if(m=l.charAt(c),m===","){for(p=c,c+=1,y(),h=c;c<l.length&&w();)c+=1;c<l.length&&l.charAt(c)==="="?(g=!0,c=h,u.push(l.substring(f,p)),f=c):c=p+1}else c+=1;(!g||c>=l.length)&&u.push(l.substring(f,l.length))}return u}return st.exports=i,st.exports.parse=i,st.exports.parseString=n,st.exports.splitCookiesString=s,st.exports}var zi=Ui();var Pn=e=>{throw TypeError(e)},Bi=(e,t,r)=>t.has(e)||Pn("Cannot "+r),xr=(e,t,r)=>(Bi(e,t,"read from private field"),r?r.call(e):t.get(e)),Wi=(e,t,r)=>t.has(e)?Pn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Vi=(e=>(e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE",e))(Vi||{}),Ua="popstate";function Dn(e={}){let{initialEntries:t=["/"],initialIndex:r,v5Compat:a=!1}=e,n;n=t.map((p,h)=>c(p,typeof p=="string"?null:p.state,h===0?"default":void 0));let o=l(r??n.length-1),i="POP",s=null;function l(p){return Math.min(Math.max(p,0),n.length-1)}function u(){return n[o]}function c(p,h=null,g){let y=$e(n?u().pathname:"/",p,h,g);return X(y.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(p)}`),y}function f(p){return typeof p=="string"?p:he(p)}return{get index(){return o},get action(){return i},get location(){return u()},createHref:f,createURL(p){return new URL(f(p),"http://localhost")},encodeLocation(p){let h=typeof p=="string"?Pe(p):p;return{pathname:h.pathname||"",search:h.search||"",hash:h.hash||""}},push(p,h){i="PUSH";let g=c(p,h);o+=1,n.splice(o,n.length,g),a&&s&&s({action:i,location:g,delta:1})},replace(p,h){i="REPLACE";let g=c(p,h);n[o]=g,a&&s&&s({action:i,location:g,delta:0})},go(p){i="POP";let h=l(o+p),g=n[h];o=h,s&&s({action:i,location:g,delta:p})},listen(p){return s=p,()=>{s=null}}}}function qr(e={}){function t(a,n){let{pathname:o,search:i,hash:s}=a.location;return $e("",{pathname:o,search:i,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default")}function r(a,n){return typeof n=="string"?n:he(n)}return _n(t,r,null,e)}function Ln(e={}){function t(n,o){let{pathname:i="/",search:s="",hash:l=""}=Pe(n.location.hash.substring(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),$e("",{pathname:i,search:s,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function r(n,o){let i=n.document.querySelector("base"),s="";if(i&&i.getAttribute("href")){let l=n.location.href,u=l.indexOf("#");s=u===-1?l:l.slice(0,u)}return s+"#"+(typeof o=="string"?o:he(o))}function a(n,o){X(n.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(o)})`)}return _n(t,r,a,e)}function A(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function X(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Yi(){return Math.random().toString(36).substring(2,10)}function za(e,t){return{usr:e.state,key:e.key,idx:t}}function $e(e,t,r=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Pe(t):t,state:r,key:t&&t.key||a||Yi()}}function he({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 Pe(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function _n(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,s="POP",l=null,u=c();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function c(){return(i.state||{idx:null}).idx}function f(){s="POP";let y=c(),w=y==null?null:y-u;u=y,l&&l({action:s,location:g.location,delta:w})}function m(y,w){s="PUSH";let R=$e(g.location,y,w);r&&r(R,y),u=c()+1;let C=za(R,u),x=g.createHref(R);try{i.pushState(C,"",x)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;n.location.assign(x)}o&&l&&l({action:s,location:g.location,delta:1})}function p(y,w){s="REPLACE";let R=$e(g.location,y,w);r&&r(R,y),u=c();let C=za(R,u),x=g.createHref(R);i.replaceState(C,"",x),o&&l&&l({action:s,location:g.location,delta:0})}function h(y){return Tn(y)}let g={get action(){return s},get location(){return e(n,i)},listen(y){if(l)throw new Error("A history only accepts one active listener");return n.addEventListener(Ua,f),l=y,()=>{n.removeEventListener(Ua,f),l=null}},createHref(y){return t(n,y)},createURL:h,encodeLocation(y){let w=h(y);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:m,replace:p,go(y){return i.go(y)}};return g}function Tn(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),A(r,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:he(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=r+a),new URL(a,r)}function Ec(e){return{defaultValue:e}}var Lt,Ae=class{constructor(e){if(Wi(this,Lt,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(xr(this,Lt).has(e))return xr(this,Lt).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){xr(this,Lt).set(e,t)}};Lt=new WeakMap;var Ji=new Set(["lazy","caseSensitive","path","id","index","children"]);function Ki(e){return Ji.has(e)}var Xi=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Gi(e){return Xi.has(e)}function Qi(e){return e.index===!0}function Ve(e,t,r=[],a={},n=!1){return e.map((o,i)=>{let s=[...r,String(i)],l=typeof o.id=="string"?o.id:s.join("-");if(A(o.index!==!0||!o.children,"Cannot specify children on an index route"),A(n||!a[l],`Found a route id collision on id "${l}". Route id's must be globally unique within Data Router usages`),Qi(o)){let u={...o,id:l};return a[l]=Ba(u,t(u)),u}else{let u={...o,id:l,children:void 0};return a[l]=Ba(u,t(u)),o.children&&(u.children=Ve(o.children,t,s,a,n)),u}})}function Ba(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function ge(e,t,r="/"){return Jt(e,t,r,!1)}function Jt(e,t,r,a){let n=typeof t=="string"?Pe(t):t,o=ne(n.pathname||"/",r);if(o==null)return null;let i=Fn(e);qi(i);let s=null;for(let l=0;s==null&&l<i.length;++l){let u=Nn(o);s=ll(i[l],u,a)}return s}function Mn(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function Fn(e,t=[],r=[],a="",n=!1){let o=(i,s,l=n,u)=>{let c={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};if(c.relativePath.startsWith("/")){if(!c.relativePath.startsWith(a)&&l)return;A(c.relativePath.startsWith(a),`Absolute route path "${c.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(a.length)}let f=Me([a,c.relativePath]),m=r.concat(c);i.children&&i.children.length>0&&(A(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),Fn(i.children,t,m,f,l)),!(i.path==null&&!i.index)&&t.push({path:f,score:ol(f,i.index),routesMeta:m})};return e.forEach((i,s)=>{if(i.path===""||!i.path?.includes("?"))o(i,s);else for(let l of kn(i.path))o(i,s,!0,l)}),t}function kn(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let i=kn(a.join("/")),s=[];return s.push(...i.map(l=>l===""?o:[o,l].join("/"))),n&&s.push(...i),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function qi(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:il(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var Zi=/^:[\w-]+$/,el=3,tl=2,rl=1,al=10,nl=-2,Wa=e=>e==="*";function ol(e,t){let r=e.split("/"),a=r.length;return r.some(Wa)&&(a+=nl),t&&(a+=tl),r.filter(n=>!Wa(n)).reduce((n,o)=>n+(Zi.test(o)?el:o===""?rl:al),a)}function il(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function ll(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let s=0;s<a.length;++s){let l=a[s],u=s===a.length-1,c=o==="/"?t:t.slice(o.length)||"/",f=_t({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},c),m=l.route;if(!f&&u&&r&&!a[a.length-1].route.index&&(f=_t({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},c)),!f)return null;Object.assign(n,f.params),i.push({params:n,pathname:Me([o,f.pathname]),pathnameBase:dl(Me([o,f.pathnameBase])),route:m}),f.pathnameBase!=="/"&&(o=Me([o,f.pathnameBase]))}return i}function bc(e,t={}){let r=e;r.endsWith("*")&&r!=="*"&&!r.endsWith("/*")&&(X(!1,`Route path "${r}" will be treated as if it were "${r.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${r.replace(/\*$/,"/*")}".`),r=r.replace(/\*$/,"/*"));const a=r.startsWith("/")?"/":"",n=i=>i==null?"":typeof i=="string"?i:String(i),o=r.split(/\/+/).map((i,s,l)=>{if(s===l.length-1&&i==="*")return n(t["*"]);const c=i.match(/^:([\w-]+)(\??)$/);if(c){const[,f,m]=c;let p=t[f];return A(m==="?"||p!=null,`Missing ":${f}" param`),encodeURIComponent(n(p))}return i.replace(/\?$/g,"")}).filter(i=>!!i);return a+o.join("/")}function _t(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=On(e.path,e.caseSensitive,e.end),n=t.match(r);if(!n)return null;let o=n[0],i=o.replace(/(.)\/+$/,"$1"),s=n.slice(1);return{params:a.reduce((u,{paramName:c,isOptional:f},m)=>{if(c==="*"){let h=s[m]||"";i=o.slice(0,o.length-h.length).replace(/(.)\/+$/,"$1")}const p=s[m];return f&&!p?u[c]=void 0:u[c]=(p||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function On(e,t=!1,r=!0){X(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,s,l)=>(a.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function Nn(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return X(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ne(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function sl({basename:e,pathname:t}){return t==="/"?e:Me([e,t])}function ul(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?Pe(e):e;return{pathname:r?r.startsWith("/")?r:cl(r,t):t,search:fl(a),hash:hl(n)}}function cl(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function Pr(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. 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 An(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function ir(e){let t=An(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function lr(e,t,r,a=!1){let n;typeof e=="string"?n=Pe(e):(n={...e},A(!n.pathname||!n.pathname.includes("?"),Pr("?","pathname","search",n)),A(!n.pathname||!n.pathname.includes("#"),Pr("#","pathname","hash",n)),A(!n.search||!n.search.includes("#"),Pr("#","search","hash",n)));let o=e===""||n.pathname==="",i=o?"/":n.pathname,s;if(i==null)s=r;else{let f=t.length-1;if(!a&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),f-=1;n.pathname=m.join("/")}s=f>=0?t[f]:"/"}let l=ul(n,s),u=i&&i!=="/"&&i.endsWith("/"),c=(o||i===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}var Me=e=>e.join("/").replace(/\/\/+/g,"/"),dl=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),fl=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,hl=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ml=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function pl(e,t){return new ml(e,typeof t=="number"?{status:t}:t)}var sr=(e,t=302)=>{let r=t;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let a=new Headers(r.headers);return a.set("Location",e),new Response(null,{...r,headers:a})},yl=(e,t)=>{let r=sr(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r},vl=(e,t)=>{let r=sr(e,t);return r.headers.set("X-Remix-Replace","true"),r},pe=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function re(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function dt(e){return e.filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Ue=Symbol("Uninstrumented");function $n(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(n=>n({id:t.id,index:t.index,path:t.path,instrument(o){let i=Object.keys(r);for(let s of i)o[s]&&r[s].push(o[s])}}));let a={};if(typeof t.lazy=="function"&&r.lazy.length>0){let n=rt(r.lazy,t.lazy,()=>{});n&&(a.lazy=n)}if(typeof t.lazy=="object"){let n=t.lazy;["middleware","loader","action"].forEach(o=>{let i=n[o],s=r[`lazy.${o}`];if(typeof i=="function"&&s.length>0){let l=rt(s,i,()=>{});l&&(a.lazy=Object.assign(a.lazy||{},{[o]:l}))}})}return["loader","action"].forEach(n=>{let o=t[n];if(typeof o=="function"&&r[n].length>0){let i=o[Ue]??o,s=rt(r[n],i,(...l)=>Va(l[0]));s&&(s[Ue]=i,a[n]=s)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(a.middleware=t.middleware.map(n=>{let o=n[Ue]??n,i=rt(r.middleware,o,(...s)=>Va(s[0]));return i?(i[Ue]=o,i):n})),a}function gl(e,t){let r={navigate:[],fetch:[]};if(t.forEach(a=>a({instrument(n){let o=Object.keys(n);for(let i of o)n[i]&&r[i].push(n[i])}})),r.navigate.length>0){let a=e.navigate[Ue]??e.navigate,n=rt(r.navigate,a,(...o)=>{let[i,s]=o;return{to:typeof i=="number"||typeof i=="string"?i:i?he(i):".",...Ya(e,s??{})}});n&&(n[Ue]=a,e.navigate=n)}if(r.fetch.length>0){let a=e.fetch[Ue]??e.fetch,n=rt(r.fetch,a,(...o)=>{let[i,,s,l]=o;return{href:s??".",fetcherKey:i,...Ya(e,l??{})}});n&&(n[Ue]=a,e.fetch=n)}return e}function wl(e,t){let r={request:[]};t.forEach(n=>n({instrument(o){let i=Object.keys(o);for(let s of i)o[s]&&r[s].push(o[s])}}));let a=e;return r.request.length>0&&(a=rt(r.request,e,(...n)=>{let[o,i]=n;return{request:Hn(o),context:i!=null?jn(i):i}})),a}function rt(e,t,r){return e.length===0?null:async(...a)=>{let n=await In(e,r(...a),()=>t(...a),e.length-1);if(n.type==="error")throw n.value;return n.value}}async function In(e,t,r,a){let n=e[a],o;if(n){let i,s=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=In(e,t,r,a-1),o=await i,A(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await n(s,t)}catch(l){console.error("An instrumentation function threw an error:",l)}i||await s(),await i}else try{o={type:"success",value:await r()}}catch(i){o={type:"error",value:i}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Va(e){let{request:t,context:r,params:a,unstable_pattern:n}=e;return{request:Hn(t),params:{...a},unstable_pattern:n,context:jn(r)}}function Ya(e,t){return{currentUrl:he(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function Hn(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function jn(e){if(El(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var Rl=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function El(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===Rl}var Un=["POST","PUT","PATCH","DELETE"],bl=new Set(Un),Sl=["GET",...Un],Cl=new Set(Sl),zn=new Set([301,302,303,307,308]),xl=new Set([307,308]),Kt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Zr={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},tt={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Pl=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ea=e=>Pl.test(e),Bn=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Wn="remix-router-transitions",Vn=Symbol("ResetLoaderData");function ur(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";A(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],n=e.mapRouteProperties||Bn,o=n;if(e.unstable_instrumentations){let v=e.unstable_instrumentations;o=b=>({...n(b),...$n(v.map(S=>S.route).filter(Boolean),b)})}let i={},s=Ve(e.routes,o,void 0,i),l,u=e.basename||"/";u.startsWith("/")||(u=`/${u}`);let c=e.dataStrategy||Fl,f={...e.future},m=null,p=new Set,h=null,g=null,y=null,w=e.hydrationData!=null,R=ge(s,e.history.location,u),C=!1,x=null,P;if(R==null&&!e.patchRoutesOnNavigation){let v=te(404,{pathname:e.history.location.pathname}),{matches:b,route:S}=ct(s);P=!0,R=b,x={[S.id]:v}}else if(R&&!e.hydrationData&&$t(R,s,e.history.location.pathname).active&&(R=null),R)if(R.some(v=>v.route.lazy))P=!1;else if(!R.some(v=>ta(v.route)))P=!0;else{let v=e.hydrationData?e.hydrationData.loaderData:null,b=e.hydrationData?e.hydrationData.errors:null;if(b){let S=R.findIndex(L=>b[L.route.id]!==void 0);P=R.slice(0,S+1).every(L=>!Ar(L.route,v,b))}else P=R.every(S=>!Ar(S.route,v,b))}else{P=!1,R=[];let v=$t(null,s,e.history.location.pathname);v.active&&v.matches&&(C=!0,R=v.matches)}let D,E={historyAction:e.history.action,location:e.history.location,matches:R,initialized:P,navigation:Kt,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||x,fetchers:new Map,blockers:new Map},F="POP",T=!1,M,N=!1,Y=new Map,G=null,B=!1,K=!1,le=new Set,J=new Map,be=0,ye=-1,De=new Map,ve=new Set,Se=new Map,Le=new Map,_e=new Set,Ke=new Map,Nt,Rt=null;function Ri(){if(m=e.history.listen(({action:v,location:b,delta:S})=>{if(Nt){Nt(),Nt=void 0;return}X(Ke.size===0||S!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let L=Oa({currentLocation:E.location,nextLocation:b,historyAction:v});if(L&&S!=null){let _=new Promise($=>{Nt=$});e.history.go(S*-1),At(L,{state:"blocked",location:b,proceed(){At(L,{state:"proceeding",proceed:void 0,reset:void 0,location:b}),_.then(()=>e.history.go(S))},reset(){let $=new Map(E.blockers);$.set(L,tt),se({blockers:$})}});return}return Xe(v,b)}),r){Hl(t,Y);let v=()=>jl(t,Y);t.addEventListener("pagehide",v),G=()=>t.removeEventListener("pagehide",v)}return E.initialized||Xe("POP",E.location,{initialHydration:!0}),D}function Ei(){m&&m(),G&&G(),p.clear(),M&&M.abort(),E.fetchers.forEach((v,b)=>br(b)),E.blockers.forEach((v,b)=>ka(b))}function bi(v){return p.add(v),()=>p.delete(v)}function se(v,b={}){v.matches&&(v.matches=v.matches.map(_=>{let $=i[_.route.id],H=_.route;return H.element!==$.element||H.errorElement!==$.errorElement||H.hydrateFallbackElement!==$.hydrateFallbackElement?{..._,route:$}:_})),E={...E,...v};let S=[],L=[];E.fetchers.forEach((_,$)=>{_.state==="idle"&&(_e.has($)?S.push($):L.push($))}),_e.forEach(_=>{!E.fetchers.has(_)&&!J.has(_)&&S.push(_)}),[...p].forEach(_=>_(E,{deletedFetchers:S,viewTransitionOpts:b.viewTransitionOpts,flushSync:b.flushSync===!0})),S.forEach(_=>br(_)),L.forEach(_=>E.fetchers.delete(_))}function it(v,b,{flushSync:S}={}){let L=E.actionData!=null&&E.navigation.formMethod!=null&&de(E.navigation.formMethod)&&E.navigation.state==="loading"&&v.state?._isRedirect!==!0,_;b.actionData?Object.keys(b.actionData).length>0?_=b.actionData:_=null:L?_=E.actionData:_=null;let $=b.loaderData?nn(E.loaderData,b.loaderData,b.matches||[],b.errors):E.loaderData,H=E.blockers;H.size>0&&(H=new Map(H),H.forEach((j,I)=>H.set(I,tt)));let O=B?!1:Aa(v,b.matches||E.matches),U=T===!0||E.navigation.formMethod!=null&&de(E.navigation.formMethod)&&v.state?._isRedirect!==!0;l&&(s=l,l=void 0),B||F==="POP"||(F==="PUSH"?e.history.push(v,v.state):F==="REPLACE"&&e.history.replace(v,v.state));let z;if(F==="POP"){let j=Y.get(E.location.pathname);j&&j.has(v.pathname)?z={currentLocation:E.location,nextLocation:v}:Y.has(v.pathname)&&(z={currentLocation:v,nextLocation:E.location})}else if(N){let j=Y.get(E.location.pathname);j?j.add(v.pathname):(j=new Set([v.pathname]),Y.set(E.location.pathname,j)),z={currentLocation:E.location,nextLocation:v}}se({...b,actionData:_,loaderData:$,historyAction:F,location:v,initialized:!0,navigation:Kt,revalidation:"idle",restoreScrollPosition:O,preventScrollReset:U,blockers:H},{viewTransitionOpts:z,flushSync:S===!0}),F="POP",T=!1,N=!1,B=!1,K=!1,Rt?.resolve(),Rt=null}async function Pa(v,b){if(typeof v=="number"){e.history.go(v);return}let S=Nr(E.location,E.matches,u,v,b?.fromRouteId,b?.relative),{path:L,submission:_,error:$}=Ka(!1,S,b),H=E.location,O=$e(E.location,L,b&&b.state);O={...O,...e.history.encodeLocation(O)};let U=b&&b.replace!=null?b.replace:void 0,z="PUSH";U===!0?z="REPLACE":U===!1||_!=null&&de(_.formMethod)&&_.formAction===E.location.pathname+E.location.search&&(z="REPLACE");let j=b&&"preventScrollReset"in b?b.preventScrollReset===!0:void 0,I=(b&&b.flushSync)===!0,W=Oa({currentLocation:H,nextLocation:O,historyAction:z});if(W){At(W,{state:"blocked",location:O,proceed(){At(W,{state:"proceeding",proceed:void 0,reset:void 0,location:O}),Pa(v,b)},reset(){let q=new Map(E.blockers);q.set(W,tt),se({blockers:q})}});return}await Xe(z,O,{submission:_,pendingError:$,preventScrollReset:j,replace:b&&b.replace,enableViewTransition:b&&b.viewTransition,flushSync:I})}function Si(){Rt||(Rt=Ul()),Er(),se({revalidation:"loading"});let v=Rt.promise;return E.navigation.state==="submitting"?v:E.navigation.state==="idle"?(Xe(E.historyAction,E.location,{startUninterruptedRevalidation:!0}),v):(Xe(F||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation,enableViewTransition:N===!0}),v)}async function Xe(v,b,S){M&&M.abort(),M=null,F=v,B=(S&&S.startUninterruptedRevalidation)===!0,Oi(E.location,E.matches),T=(S&&S.preventScrollReset)===!0,N=(S&&S.enableViewTransition)===!0;let L=l||s,_=S&&S.overrideNavigation,$=S?.initialHydration&&E.matches&&E.matches.length>0&&!C?E.matches:ge(L,b,u),H=(S&&S.flushSync)===!0;if($&&E.initialized&&!K&&Ol(E.location,b)&&!(S&&S.submission&&de(S.submission.formMethod))){it(b,{matches:$},{flushSync:H});return}let O=$t($,L,b.pathname);if(O.active&&O.matches&&($=O.matches),!$){let{error:me,notFoundMatches:Z,route:Q}=Sr(b.pathname);it(b,{matches:Z,loaderData:{},errors:{[Q.id]:me}},{flushSync:H});return}M=new AbortController;let U=ut(e.history,b,M.signal,S&&S.submission),z=e.getContext?await e.getContext():new Ae,j;if(S&&S.pendingError)j=[xe($).route.id,{type:"error",error:S.pendingError}];else if(S&&S.submission&&de(S.submission.formMethod)){let me=await Ci(U,b,S.submission,$,z,O.active,S&&S.initialHydration===!0,{replace:S.replace,flushSync:H});if(me.shortCircuited)return;if(me.pendingActionResult){let[Z,Q]=me.pendingActionResult;if(ie(Q)&&re(Q.error)&&Q.error.status===404){M=null,it(b,{matches:me.matches,loaderData:{},errors:{[Z]:Q.error}});return}}$=me.matches||$,j=me.pendingActionResult,_=Dr(b,S.submission),H=!1,O.active=!1,U=ut(e.history,U.url,U.signal)}let{shortCircuited:I,matches:W,loaderData:q,errors:oe}=await xi(U,b,$,z,O.active,_,S&&S.submission,S&&S.fetcherSubmission,S&&S.replace,S&&S.initialHydration===!0,H,j);I||(M=null,it(b,{matches:W||$,...on(j),loaderData:q,errors:oe}))}async function Ci(v,b,S,L,_,$,H,O={}){Er();let U=$l(b,S);if(se({navigation:U},{flushSync:O.flushSync===!0}),$){let I=await It(L,b.pathname,v.signal);if(I.type==="aborted")return{shortCircuited:!0};if(I.type==="error"){if(I.partialMatches.length===0){let{matches:q,route:oe}=ct(s);return{matches:q,pendingActionResult:[oe.id,{type:"error",error:I.error}]}}let W=xe(I.partialMatches).route.id;return{matches:I.partialMatches,pendingActionResult:[W,{type:"error",error:I.error}]}}else if(I.matches)L=I.matches;else{let{notFoundMatches:W,error:q,route:oe}=Sr(b.pathname);return{matches:W,pendingActionResult:[oe.id,{type:"error",error:q}]}}}let z,j=ft(L,b);if(!j.route.action&&!j.route.lazy)z={type:"error",error:te(405,{method:v.method,pathname:b.pathname,routeId:j.route.id})};else{let I=Be(o,i,v,L,j,H?[]:a,_),W=await Et(v,I,_,null);if(z=W[j.route.id],!z){for(let q of L)if(W[q.route.id]){z=W[q.route.id];break}}if(v.signal.aborted)return{shortCircuited:!0}}if(ze(z)){let I;return O&&O.replace!=null?I=O.replace:I=tn(z.response.headers.get("Location"),new URL(v.url),u)===E.location.pathname+E.location.search,await Ge(v,z,!0,{submission:S,replace:I}),{shortCircuited:!0}}if(ie(z)){let I=xe(L,j.route.id);return(O&&O.replace)!==!0&&(F="PUSH"),{matches:L,pendingActionResult:[I.route.id,z,j.route.id]}}return{matches:L,pendingActionResult:[j.route.id,z]}}async function xi(v,b,S,L,_,$,H,O,U,z,j,I){let W=$||Dr(b,H),q=H||O||ln(W),oe=!B&&!z;if(_){if(oe){let ue=Da(I);se({navigation:W,...ue!==void 0?{actionData:ue}:{}},{flushSync:j})}let V=await It(S,b.pathname,v.signal);if(V.type==="aborted")return{shortCircuited:!0};if(V.type==="error"){if(V.partialMatches.length===0){let{matches:lt,route:Ze}=ct(s);return{matches:lt,loaderData:{},errors:{[Ze.id]:V.error}}}let ue=xe(V.partialMatches).route.id;return{matches:V.partialMatches,loaderData:{},errors:{[ue]:V.error}}}else if(V.matches)S=V.matches;else{let{error:ue,notFoundMatches:lt,route:Ze}=Sr(b.pathname);return{matches:lt,loaderData:{},errors:{[Ze.id]:ue}}}}let me=l||s,{dsMatches:Z,revalidatingFetchers:Q}=Xa(v,L,o,i,e.history,E,S,q,b,z?[]:a,z===!0,K,le,_e,Se,ve,me,u,e.patchRoutesOnNavigation!=null,I);if(ye=++be,!e.dataStrategy&&!Z.some(V=>V.shouldLoad)&&!Z.some(V=>V.route.middleware&&V.route.middleware.length>0)&&Q.length===0){let V=Ma();return it(b,{matches:S,loaderData:{},errors:I&&ie(I[1])?{[I[0]]:I[1].error}:null,...on(I),...V?{fetchers:new Map(E.fetchers)}:{}},{flushSync:j}),{shortCircuited:!0}}if(oe){let V={};if(!_){V.navigation=W;let ue=Da(I);ue!==void 0&&(V.actionData=ue)}Q.length>0&&(V.fetchers=Pi(Q)),se(V,{flushSync:j})}Q.forEach(V=>{Oe(V.key),V.controller&&J.set(V.key,V.controller)});let Qe=()=>Q.forEach(V=>Oe(V.key));M&&M.signal.addEventListener("abort",Qe);let{loaderResults:bt,fetcherResults:je}=await La(Z,Q,v,L);if(v.signal.aborted)return{shortCircuited:!0};M&&M.signal.removeEventListener("abort",Qe),Q.forEach(V=>J.delete(V.key));let Te=zt(bt);if(Te)return await Ge(v,Te.result,!0,{replace:U}),{shortCircuited:!0};if(Te=zt(je),Te)return ve.add(Te.key),await Ge(v,Te.result,!0,{replace:U}),{shortCircuited:!0};let{loaderData:Cr,errors:St}=an(E,S,bt,I,Q,je);z&&E.errors&&(St={...E.errors,...St});let qe=Ma(),Ht=Fa(ye),jt=qe||Ht||Q.length>0;return{matches:S,loaderData:Cr,errors:St,...jt?{fetchers:new Map(E.fetchers)}:{}}}function Da(v){if(v&&!ie(v[1]))return{[v[0]]:v[1].data};if(E.actionData)return Object.keys(E.actionData).length===0?null:E.actionData}function Pi(v){return v.forEach(b=>{let S=E.fetchers.get(b.key),L=xt(void 0,S?S.data:void 0);E.fetchers.set(b.key,L)}),new Map(E.fetchers)}async function Di(v,b,S,L){Oe(v);let _=(L&&L.flushSync)===!0,$=l||s,H=Nr(E.location,E.matches,u,S,b,L?.relative),O=ge($,H,u),U=$t(O,$,H);if(U.active&&U.matches&&(O=U.matches),!O){ke(v,b,te(404,{pathname:H}),{flushSync:_});return}let{path:z,submission:j,error:I}=Ka(!0,H,L);if(I){ke(v,b,I,{flushSync:_});return}let W=e.getContext?await e.getContext():new Ae,q=(L&&L.preventScrollReset)===!0;if(j&&de(j.formMethod)){await Li(v,b,z,O,W,U.active,_,q,j);return}Se.set(v,{routeId:b,path:z}),await _i(v,b,z,O,W,U.active,_,q,j)}async function Li(v,b,S,L,_,$,H,O,U){Er(),Se.delete(v);let z=E.fetchers.get(v);Fe(v,Il(U,z),{flushSync:H});let j=new AbortController,I=ut(e.history,S,j.signal,U);if($){let ae=await It(L,new URL(I.url).pathname,I.signal,v);if(ae.type==="aborted")return;if(ae.type==="error"){ke(v,b,ae.error,{flushSync:H});return}else if(ae.matches)L=ae.matches;else{ke(v,b,te(404,{pathname:S}),{flushSync:H});return}}let W=ft(L,S);if(!W.route.action&&!W.route.lazy){let ae=te(405,{method:U.formMethod,pathname:S,routeId:b});ke(v,b,ae,{flushSync:H});return}J.set(v,j);let q=be,oe=Be(o,i,I,L,W,a,_),Z=(await Et(I,oe,_,v))[W.route.id];if(I.signal.aborted){J.get(v)===j&&J.delete(v);return}if(_e.has(v)){if(ze(Z)||ie(Z)){Fe(v,Ne(void 0));return}}else{if(ze(Z))if(J.delete(v),ye>q){Fe(v,Ne(void 0));return}else return ve.add(v),Fe(v,xt(U)),Ge(I,Z,!1,{fetcherSubmission:U,preventScrollReset:O});if(ie(Z)){ke(v,b,Z.error);return}}let Q=E.navigation.location||E.location,Qe=ut(e.history,Q,j.signal),bt=l||s,je=E.navigation.state!=="idle"?ge(bt,E.navigation.location,u):E.matches;A(je,"Didn't find any matches after fetcher action");let Te=++be;De.set(v,Te);let Cr=xt(U,Z.data);E.fetchers.set(v,Cr);let{dsMatches:St,revalidatingFetchers:qe}=Xa(Qe,_,o,i,e.history,E,je,U,Q,a,!1,K,le,_e,Se,ve,bt,u,e.patchRoutesOnNavigation!=null,[W.route.id,Z]);qe.filter(ae=>ae.key!==v).forEach(ae=>{let Ut=ae.key,$a=E.fetchers.get(Ut),$i=xt(void 0,$a?$a.data:void 0);E.fetchers.set(Ut,$i),Oe(Ut),ae.controller&&J.set(Ut,ae.controller)}),se({fetchers:new Map(E.fetchers)});let Ht=()=>qe.forEach(ae=>Oe(ae.key));j.signal.addEventListener("abort",Ht);let{loaderResults:jt,fetcherResults:V}=await La(St,qe,Qe,_);if(j.signal.aborted)return;if(j.signal.removeEventListener("abort",Ht),De.delete(v),J.delete(v),qe.forEach(ae=>J.delete(ae.key)),E.fetchers.has(v)){let ae=Ne(Z.data);E.fetchers.set(v,ae)}let ue=zt(jt);if(ue)return Ge(Qe,ue.result,!1,{preventScrollReset:O});if(ue=zt(V),ue)return ve.add(ue.key),Ge(Qe,ue.result,!1,{preventScrollReset:O});let{loaderData:lt,errors:Ze}=an(E,je,jt,void 0,qe,V);Fa(Te),E.navigation.state==="loading"&&Te>ye?(A(F,"Expected pending action"),M&&M.abort(),it(E.navigation.location,{matches:je,loaderData:lt,errors:Ze,fetchers:new Map(E.fetchers)})):(se({errors:Ze,loaderData:nn(E.loaderData,lt,je,Ze),fetchers:new Map(E.fetchers)}),K=!1)}async function _i(v,b,S,L,_,$,H,O,U){let z=E.fetchers.get(v);Fe(v,xt(U,z?z.data:void 0),{flushSync:H});let j=new AbortController,I=ut(e.history,S,j.signal);if($){let Q=await It(L,new URL(I.url).pathname,I.signal,v);if(Q.type==="aborted")return;if(Q.type==="error"){ke(v,b,Q.error,{flushSync:H});return}else if(Q.matches)L=Q.matches;else{ke(v,b,te(404,{pathname:S}),{flushSync:H});return}}let W=ft(L,S);J.set(v,j);let q=be,oe=Be(o,i,I,L,W,a,_),Z=(await Et(I,oe,_,v))[W.route.id];if(J.get(v)===j&&J.delete(v),!I.signal.aborted){if(_e.has(v)){Fe(v,Ne(void 0));return}if(ze(Z))if(ye>q){Fe(v,Ne(void 0));return}else{ve.add(v),await Ge(I,Z,!1,{preventScrollReset:O});return}if(ie(Z)){ke(v,b,Z.error);return}Fe(v,Ne(Z.data))}}async function Ge(v,b,S,{submission:L,fetcherSubmission:_,preventScrollReset:$,replace:H}={}){b.response.headers.has("X-Remix-Revalidate")&&(K=!0);let O=b.response.headers.get("Location");A(O,"Expected a Location header on the redirect Response"),O=tn(O,new URL(v.url),u);let U=$e(E.location,O,{_isRedirect:!0});if(r){let oe=!1;if(b.response.headers.has("X-Remix-Reload-Document"))oe=!0;else if(ea(O)){const me=Tn(O,!0);oe=me.origin!==t.location.origin||ne(me.pathname,u)==null}if(oe){H?t.location.replace(O):t.location.assign(O);return}}M=null;let z=H===!0||b.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:j,formAction:I,formEncType:W}=E.navigation;!L&&!_&&j&&I&&W&&(L=ln(E.navigation));let q=L||_;if(xl.has(b.response.status)&&q&&de(q.formMethod))await Xe(z,U,{submission:{...q,formAction:O},preventScrollReset:$||T,enableViewTransition:S?N:void 0});else{let oe=Dr(U,L);await Xe(z,U,{overrideNavigation:oe,fetcherSubmission:_,preventScrollReset:$||T,enableViewTransition:S?N:void 0})}}async function Et(v,b,S,L){let _,$={};try{_=await Zn(c,v,b,L,S,!1)}catch(H){return b.filter(O=>O.shouldLoad).forEach(O=>{$[O.route.id]={type:"error",error:H}}),$}if(v.signal.aborted)return $;for(let[H,O]of Object.entries(_))if(io(O)){let U=O.result;$[H]={type:"redirect",response:ro(U,v,H,b,u)}}else $[H]=await to(O);return $}async function La(v,b,S,L){let _=Et(S,v,L,null),$=Promise.all(b.map(async U=>{if(U.matches&&U.match&&U.request&&U.controller){let j=(await Et(U.request,U.matches,L,U.key))[U.match.route.id];return{[U.key]:j}}else return Promise.resolve({[U.key]:{type:"error",error:te(404,{pathname:U.path})}})})),H=await _,O=(await $).reduce((U,z)=>Object.assign(U,z),{});return{loaderResults:H,fetcherResults:O}}function Er(){K=!0,Se.forEach((v,b)=>{J.has(b)&&le.add(b),Oe(b)})}function Fe(v,b,S={}){E.fetchers.set(v,b),se({fetchers:new Map(E.fetchers)},{flushSync:(S&&S.flushSync)===!0})}function ke(v,b,S,L={}){let _=xe(E.matches,b);br(v),se({errors:{[_.route.id]:S},fetchers:new Map(E.fetchers)},{flushSync:(L&&L.flushSync)===!0})}function _a(v){return Le.set(v,(Le.get(v)||0)+1),_e.has(v)&&_e.delete(v),E.fetchers.get(v)||Zr}function Ti(v,b){Oe(v,b?.reason),Fe(v,Ne(null))}function br(v){let b=E.fetchers.get(v);J.has(v)&&!(b&&b.state==="loading"&&De.has(v))&&Oe(v),Se.delete(v),De.delete(v),ve.delete(v),_e.delete(v),le.delete(v),E.fetchers.delete(v)}function Mi(v){let b=(Le.get(v)||0)-1;b<=0?(Le.delete(v),_e.add(v)):Le.set(v,b),se({fetchers:new Map(E.fetchers)})}function Oe(v,b){let S=J.get(v);S&&(S.abort(b),J.delete(v))}function Ta(v){for(let b of v){let S=_a(b),L=Ne(S.data);E.fetchers.set(b,L)}}function Ma(){let v=[],b=!1;for(let S of ve){let L=E.fetchers.get(S);A(L,`Expected fetcher: ${S}`),L.state==="loading"&&(ve.delete(S),v.push(S),b=!0)}return Ta(v),b}function Fa(v){let b=[];for(let[S,L]of De)if(L<v){let _=E.fetchers.get(S);A(_,`Expected fetcher: ${S}`),_.state==="loading"&&(Oe(S),De.delete(S),b.push(S))}return Ta(b),b.length>0}function Fi(v,b){let S=E.blockers.get(v)||tt;return Ke.get(v)!==b&&Ke.set(v,b),S}function ka(v){E.blockers.delete(v),Ke.delete(v)}function At(v,b){let S=E.blockers.get(v)||tt;A(S.state==="unblocked"&&b.state==="blocked"||S.state==="blocked"&&b.state==="blocked"||S.state==="blocked"&&b.state==="proceeding"||S.state==="blocked"&&b.state==="unblocked"||S.state==="proceeding"&&b.state==="unblocked",`Invalid blocker state transition: ${S.state} -> ${b.state}`);let L=new Map(E.blockers);L.set(v,b),se({blockers:L})}function Oa({currentLocation:v,nextLocation:b,historyAction:S}){if(Ke.size===0)return;Ke.size>1&&X(!1,"A router only supports one blocker at a time");let L=Array.from(Ke.entries()),[_,$]=L[L.length-1],H=E.blockers.get(_);if(!(H&&H.state==="proceeding")&&$({currentLocation:v,nextLocation:b,historyAction:S}))return _}function Sr(v){let b=te(404,{pathname:v}),S=l||s,{matches:L,route:_}=ct(S);return{notFoundMatches:L,route:_,error:b}}function ki(v,b,S){if(h=v,y=b,g=S||null,!w&&E.navigation===Kt){w=!0;let L=Aa(E.location,E.matches);L!=null&&se({restoreScrollPosition:L})}return()=>{h=null,y=null,g=null}}function Na(v,b){return g&&g(v,b.map(L=>Mn(L,E.loaderData)))||v.key}function Oi(v,b){if(h&&y){let S=Na(v,b);h[S]=y()}}function Aa(v,b){if(h){let S=Na(v,b),L=h[S];if(typeof L=="number")return L}return null}function $t(v,b,S){if(e.patchRoutesOnNavigation)if(v){if(Object.keys(v[0].params).length>0)return{active:!0,matches:Jt(b,S,u,!0)}}else return{active:!0,matches:Jt(b,S,u,!0)||[]};return{active:!1,matches:null}}async function It(v,b,S,L){if(!e.patchRoutesOnNavigation)return{type:"success",matches:v};let _=v;for(;;){let $=l==null,H=l||s,O=i;try{await e.patchRoutesOnNavigation({signal:S,path:b,matches:_,fetcherKey:L,patch:(j,I)=>{S.aborted||Ga(j,I,H,O,o,!1)}})}catch(j){return{type:"error",error:j,partialMatches:_}}finally{$&&!S.aborted&&(s=[...s])}if(S.aborted)return{type:"aborted"};let U=ge(H,b,u);if(U)return{type:"success",matches:U};let z=Jt(H,b,u,!0);if(!z||_.length===z.length&&_.every((j,I)=>j.route.id===z[I].route.id))return{type:"success",matches:null};_=z}}function Ni(v){i={},l=Ve(v,o,void 0,i)}function Ai(v,b,S=!1){let L=l==null;Ga(v,b,l||s,i,o,S),L&&(s=[...s],se({}))}return D={get basename(){return u},get future(){return f},get state(){return E},get routes(){return s},get window(){return t},initialize:Ri,subscribe:bi,enableScrollRestoration:ki,navigate:Pa,fetch:Di,revalidate:Si,createHref:v=>e.history.createHref(v),encodeLocation:v=>e.history.encodeLocation(v),getFetcher:_a,resetFetcher:Ti,deleteFetcher:Mi,dispose:Ei,getBlocker:Fi,deleteBlocker:ka,patchRoutes:Ai,_internalFetchControllers:J,_internalSetRoutes:Ni,_internalSetStateDoNotUseOrYouWillBreakYourApp(v){se(v)}},e.unstable_instrumentations&&(D=gl(D,e.unstable_instrumentations.map(v=>v.router).filter(Boolean))),D}function Yn(e,t){A(e.length>0,"You must provide a non-empty routes array to createStaticHandler");let r={},a=(t?t.basename:null)||"/",n=t?.mapRouteProperties||Bn,o=n;if(t?.unstable_instrumentations){let p=t.unstable_instrumentations;o=h=>({...n(h),...$n(p.map(g=>g.route).filter(Boolean),h)})}let i=Ve(e,o,void 0,r);async function s(p,{requestContext:h,filterMatchesToLoad:g,skipLoaderErrorBubbling:y,skipRevalidation:w,dataStrategy:R,generateMiddlewareResponse:C}={}){let x=new URL(p.url),P=p.method,D=$e("",he(x),null,"default"),E=ge(i,D,a);if(h=h??new Ae,!jr(P)&&P!=="HEAD"){let T=te(405,{method:P}),{matches:M,route:N}=ct(i),Y={basename:a,location:D,matches:M,loaderData:{},actionData:null,errors:{[N.id]:T},statusCode:T.status,loaderHeaders:{},actionHeaders:{}};return C?C(()=>Promise.resolve(Y)):Y}else if(!E){let T=te(404,{pathname:D.pathname}),{matches:M,route:N}=ct(i),Y={basename:a,location:D,matches:M,loaderData:{},actionData:null,errors:{[N.id]:T},statusCode:T.status,loaderHeaders:{},actionHeaders:{}};return C?C(()=>Promise.resolve(Y)):Y}if(C){A(h instanceof Ae,"When using middleware in `staticHandler.query()`, any provided `requestContext` must be an instance of `RouterContextProvider`");try{await Za(E,r,o);let T,M=await en({request:p,unstable_pattern:dt(E.map(N=>N.route.path)),matches:E,params:E[0].params,context:h},async()=>await C(async(Y,G={})=>{let B=await u(Y,D,E,h,R||null,y===!0,null,"filterMatchesToLoad"in G?G.filterMatchesToLoad??null:g??null,w===!0);return ee(B)?B:(T={location:D,basename:a,...B},T)}),async(N,Y)=>{if(er(N))return N;if(ee(N))try{N=new pe(N.status,N.statusText,await eo(N))}catch(G){N=G}if(We(N)&&(N=Nl(N)),T){Y in T.loaderData&&(T.loaderData[Y]=void 0);let G=Jn(i,T,N,y?Y:xe(E,Y).route.id);return C(()=>Promise.resolve(G))}else{let G=y?Y:xe(E,E.find(K=>K.route.id===Y||K.route.loader)?.route.id||Y).route.id,B={matches:E,location:D,basename:a,loaderData:{},actionData:null,errors:{[G]:N},statusCode:re(N)?N.status:500,actionHeaders:{},loaderHeaders:{}};return C(()=>Promise.resolve(B))}});return A(ee(M),"Expected a response in query()"),M}catch(T){if(ee(T))return T;throw T}}let F=await u(p,D,E,h,R||null,y===!0,null,g||null,w===!0);return ee(F)?F:{location:D,basename:a,...F}}async function l(p,{routeId:h,requestContext:g,dataStrategy:y,generateMiddlewareResponse:w}={}){let R=new URL(p.url),C=p.method,x=$e("",he(R),null,"default"),P=ge(i,x,a);if(g=g??new Ae,!jr(C)&&C!=="HEAD"&&C!=="OPTIONS")throw te(405,{method:C});if(!P)throw te(404,{pathname:x.pathname});let D=h?P.find(T=>T.route.id===h):ft(P,x);if(h&&!D)throw te(403,{pathname:x.pathname,routeId:h});if(!D)throw te(404,{pathname:x.pathname});if(w)return A(g instanceof Ae,"When using middleware in `staticHandler.queryRoute()`, any provided `requestContext` must be an instance of `RouterContextProvider`"),await Za(P,r,o),await en({request:p,unstable_pattern:dt(P.map(M=>M.route.path)),matches:P,params:P[0].params,context:g},async()=>await w(async N=>{let Y=await u(N,x,P,g,y||null,!1,D,null,!1),G=F(Y);return ee(G)?G:typeof G=="string"?new Response(G):Response.json(G)}),M=>{if(We(M))return Promise.resolve(Hr(M));if(ee(M))return Promise.resolve(M);throw M});let E=await u(p,x,P,g,y||null,!1,D,null,!1);return F(E);function F(T){if(ee(T))return T;let M=T.errors?Object.values(T.errors)[0]:void 0;if(M!==void 0)throw M;if(T.actionData)return Object.values(T.actionData)[0];if(T.loaderData)return Object.values(T.loaderData)[0]}}async function u(p,h,g,y,w,R,C,x,P){A(p.signal,"query()/queryRoute() requests must contain an AbortController signal");try{if(de(p.method))return await c(p,g,C||ft(g,h),y,w,R,C!=null,x,P);let D=await f(p,g,y,w,R,C,x);return ee(D)?D:{...D,actionData:null,actionHeaders:{}}}catch(D){if(oo(D)&&ee(D.result)){if(D.type==="error")throw D.result;return D.result}if(er(D))return D;throw D}}async function c(p,h,g,y,w,R,C,x,P){let D;if(!g.route.action&&!g.route.lazy){let T=te(405,{method:p.method,pathname:new URL(p.url).pathname,routeId:g.route.id});if(C)throw T;D={type:"error",error:T}}else{let T=Be(o,r,p,h,g,[],y);D=(await m(p,T,C,y,w))[g.route.id],p.signal.aborted&&Ja(p,C)}if(ze(D))throw new Response(null,{status:D.response.status,headers:{Location:D.response.headers.get("Location")}});if(C){if(ie(D))throw D.error;return{matches:[g],loaderData:{},actionData:{[g.route.id]:D.data},errors:null,statusCode:200,loaderHeaders:{},actionHeaders:{}}}if(P)if(ie(D)){let T=R?g:xe(h,g.route.id);return{statusCode:re(D.error)?D.error.status:D.statusCode!=null?D.statusCode:500,actionData:null,actionHeaders:{...D.headers?{[g.route.id]:D.headers}:{}},matches:h,loaderData:{},errors:{[T.route.id]:D.error},loaderHeaders:{}}}else return{actionData:{[g.route.id]:D.data},actionHeaders:D.headers?{[g.route.id]:D.headers}:{},matches:h,loaderData:{},errors:null,statusCode:D.statusCode||200,loaderHeaders:{}};let E=new Request(p.url,{headers:p.headers,redirect:p.redirect,signal:p.signal});if(ie(D)){let T=R?g:xe(h,g.route.id);return{...await f(E,h,y,w,R,null,x,[T.route.id,D]),statusCode:re(D.error)?D.error.status:D.statusCode!=null?D.statusCode:500,actionData:null,actionHeaders:{...D.headers?{[g.route.id]:D.headers}:{}}}}return{...await f(E,h,y,w,R,null,x),actionData:{[g.route.id]:D.data},...D.statusCode?{statusCode:D.statusCode}:{},actionHeaders:D.headers?{[g.route.id]:D.headers}:{}}}async function f(p,h,g,y,w,R,C,x){let P=R!=null;if(P&&!R?.route.loader&&!R?.route.lazy)throw te(400,{method:p.method,pathname:new URL(p.url).pathname,routeId:R?.route.id});let D;if(R)D=Be(o,r,p,h,R,[],g);else{let T=x&&ie(x[1])?h.findIndex(N=>N.route.id===x[0])-1:void 0,M=dt(h.map(N=>N.route.path));D=h.map((N,Y)=>T!=null&&Y>T?Tt(o,r,p,M,N,[],g,!1):Tt(o,r,p,M,N,[],g,(N.route.loader||N.route.lazy)!=null&&(!C||C(N))))}if(!y&&!D.some(T=>T.shouldLoad))return{matches:h,loaderData:{},errors:x&&ie(x[1])?{[x[0]]:x[1].error}:null,statusCode:200,loaderHeaders:{}};let E=await m(p,D,P,g,y);return p.signal.aborted&&Ja(p,P),{...ao(h,E,x,!0,w),matches:h}}async function m(p,h,g,y,w){let R=await Zn(w||$r,p,h,null,y,!0),C={};return await Promise.all(h.map(async x=>{if(!(x.route.id in R))return;let P=R[x.route.id];if(io(P)){let D=P.result;throw ro(D,p,x.route.id,h,a)}if(g){if(ee(P.result))throw P;if(We(P.result))throw Hr(P.result)}C[x.route.id]=await to(P)})),C}return{dataRoutes:i,query:s,queryRoute:l}}function Jn(e,t,r,a){let n=a||t._deepestRenderedBoundaryId||e[0].id;return{...t,statusCode:re(r)?r.status:500,errors:{[n]:r}}}function Ja(e,t){if(e.signal.reason!==void 0)throw e.signal.reason;let r=t?"queryRoute":"query";throw new Error(`${r}() call aborted without an \`AbortSignal.reason\`: ${e.method} ${e.url}`)}function Dl(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Nr(e,t,r,a,n,o){let i,s;if(n){i=[];for(let u of t)if(i.push(u),u.route.id===n){s=u;break}}else i=t,s=t[t.length-1];let l=lr(a||".",ir(i),ne(e.pathname,r)||e.pathname,o==="path");if(a==null&&(l.search=e.search,l.hash=e.hash),(a==null||a===""||a===".")&&s){let u=aa(l.search);if(s.route.index&&!u)l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index";else if(!s.route.index&&u){let c=new URLSearchParams(l.search),f=c.getAll("index");c.delete("index"),f.filter(p=>p).forEach(p=>c.append("index",p));let m=c.toString();l.search=m?`?${m}`:""}}return r!=="/"&&(l.pathname=sl({basename:r,pathname:l.pathname})),he(l)}function Ka(e,t,r){if(!r||!Dl(r))return{path:t};if(r.formMethod&&!jr(r.formMethod))return{path:t,error:te(405,{method:r.formMethod})};let a=()=>({path:t,error:te(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),i=no(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!de(o))return a();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,[p,h])=>`${m}${p}=${h}
|
|
2
|
+
`,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:i,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!de(o))return a();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:o,formAction:i,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return a()}}}A(typeof FormData=="function","FormData is not available in this environment");let s,l;if(r.formData)s=Ir(r.formData),l=r.formData;else if(r.body instanceof FormData)s=Ir(r.body),l=r.body;else if(r.body instanceof URLSearchParams)s=r.body,l=rn(s);else if(r.body==null)s=new URLSearchParams,l=new FormData;else try{s=new URLSearchParams(r.body),l=rn(s)}catch{return a()}let u={formMethod:o,formAction:i,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:l,json:void 0,text:void 0};if(de(u.formMethod))return{path:t,submission:u};let c=Pe(t);return e&&c.search&&aa(c.search)&&s.append("index",""),c.search=`?${s}`,{path:he(c),submission:u}}function Xa(e,t,r,a,n,o,i,s,l,u,c,f,m,p,h,g,y,w,R,C){let x=C?ie(C[1])?C[1].error:C[1].data:void 0,P=n.createURL(o.location),D=n.createURL(l),E;if(c&&o.errors){let B=Object.keys(o.errors)[0];E=i.findIndex(K=>K.route.id===B)}else if(C&&ie(C[1])){let B=C[0];E=i.findIndex(K=>K.route.id===B)-1}let F=C?C[1].statusCode:void 0,T=F&&F>=400,M={currentUrl:P,currentParams:o.matches[0]?.params||{},nextUrl:D,nextParams:i[0].params,...s,actionResult:x,actionStatus:F},N=dt(i.map(B=>B.route.path)),Y=i.map((B,K)=>{let{route:le}=B,J=null;if(E!=null&&K>E?J=!1:le.lazy?J=!0:ta(le)?c?J=Ar(le,o.loaderData,o.errors):Ll(o.loaderData,o.matches[K],B)&&(J=!0):J=!1,J!==null)return Tt(r,a,e,N,B,u,t,J);let be=T?!1:f||P.pathname+P.search===D.pathname+D.search||P.search!==D.search||_l(o.matches[K],B),ye={...M,defaultShouldRevalidate:be},De=Zt(B,ye);return Tt(r,a,e,N,B,u,t,De,ye)}),G=[];return h.forEach((B,K)=>{if(c||!i.some(Le=>Le.route.id===B.routeId)||p.has(K))return;let le=o.fetchers.get(K),J=le&&le.state!=="idle"&&le.data===void 0,be=ge(y,B.path,w);if(!be){if(R&&J)return;G.push({key:K,routeId:B.routeId,path:B.path,matches:null,match:null,request:null,controller:null});return}if(g.has(K))return;let ye=ft(be,B.path),De=new AbortController,ve=ut(n,B.path,De.signal),Se=null;if(m.has(K))m.delete(K),Se=Be(r,a,ve,be,ye,u,t);else if(J)f&&(Se=Be(r,a,ve,be,ye,u,t));else{let Le={...M,defaultShouldRevalidate:T?!1:f};Zt(ye,Le)&&(Se=Be(r,a,ve,be,ye,u,t,Le))}Se&&G.push({key:K,routeId:B.routeId,path:B.path,matches:Se,match:ye,request:ve,controller:De})}),{dsMatches:Y,revalidatingFetchers:G}}function ta(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Ar(e,t,r){if(e.lazy)return!0;if(!ta(e))return!1;let a=t!=null&&e.id in t,n=r!=null&&r[e.id]!==void 0;return!a&&n?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!a&&!n}function Ll(e,t,r){let a=!t||r.route.id!==t.route.id,n=!e.hasOwnProperty(r.route.id);return a||n}function _l(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Zt(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function Ga(e,t,r,a,n,o){let i;if(e){let u=a[e];A(u,`No route found to patch children into: routeId = ${e}`),u.children||(u.children=[]),i=u.children}else i=r;let s=[],l=[];if(t.forEach(u=>{let c=i.find(f=>Kn(u,f));c?l.push({existingRoute:c,newRoute:u}):s.push(u)}),s.length>0){let u=Ve(s,n,[e||"_","patch",String(i?.length||"0")],a);i.push(...u)}if(o&&l.length>0)for(let u=0;u<l.length;u++){let{existingRoute:c,newRoute:f}=l[u],m=c,[p]=Ve([f],n,[],{},!0);Object.assign(m,{element:p.element?p.element:m.element,errorElement:p.errorElement?p.errorElement:m.errorElement,hydrateFallbackElement:p.hydrateFallbackElement?p.hydrateFallbackElement:m.hydrateFallbackElement})}}function Kn(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,a)=>t.children?.some(n=>Kn(r,n))):!1}var Qa=new WeakMap,ra=({key:e,route:t,manifest:r,mapRouteProperties:a})=>{let n=r[t.id];if(A(n,"No route found in manifest"),!n.lazy||typeof n.lazy!="object")return;let o=n.lazy[e];if(!o)return;let i=Qa.get(n);i||(i={},Qa.set(n,i));let s=i[e];if(s)return s;let l=(async()=>{let u=Ki(e),f=n[e]!==void 0&&e!=="hasErrorBoundary";if(u)X(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(f)X(!1,`Route "${n.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let m=await o();m!=null&&(Object.assign(n,{[e]:m}),Object.assign(n,a(n)))}typeof n.lazy=="object"&&(n.lazy[e]=void 0,Object.values(n.lazy).every(m=>m===void 0)&&(n.lazy=void 0))})();return i[e]=l,l},qa=new WeakMap;function Tl(e,t,r,a,n){let o=r[e.id];if(A(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let c=qa.get(o);if(c)return{lazyRoutePromise:c,lazyHandlerPromise:c};let f=(async()=>{A(typeof e.lazy=="function","No lazy route function found");let m=await e.lazy(),p={};for(let h in m){let g=m[h];if(g===void 0)continue;let y=Gi(h),R=o[h]!==void 0&&h!=="hasErrorBoundary";y?X(!y,"Route property "+h+" is not a supported property to be returned from a lazy route function. This property will be ignored."):R?X(!R,`Route "${o.id}" has a static property "${h}" defined but its lazy function is also returning a value for this property. The lazy route property "${h}" will be ignored.`):p[h]=g}Object.assign(o,p),Object.assign(o,{...a(o),lazy:void 0})})();return qa.set(o,f),f.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:f}}let i=Object.keys(e.lazy),s=[],l;for(let c of i){if(n&&n.includes(c))continue;let f=ra({key:c,route:e,manifest:r,mapRouteProperties:a});f&&(s.push(f),c===t&&(l=f))}let u=s.length>0?Promise.all(s).then(()=>{}):void 0;return u?.catch(()=>{}),l?.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:l}}function Ml(e){return e!==void 0}function Za(e,t,r){let a=e.map(({route:n})=>{if(!(typeof n.lazy!="object"||!n.lazy.middleware))return ra({key:"middleware",route:n,manifest:t,mapRouteProperties:r})}).filter(Ml);return a.length>0?Promise.all(a):void 0}async function $r(e){let t=e.matches.filter(n=>n.shouldLoad),r={};return(await Promise.all(t.map(n=>n.resolve()))).forEach((n,o)=>{r[t[o].route.id]=n}),r}async function Fl(e){return e.matches.some(t=>t.route.middleware)?Xn(e,()=>$r(e)):$r(e)}function en(e,t,r){return Gn(e,t,a,ee,r);function a(n){return We(n)?Hr(n):n}}function Xn(e,t){return Gn(e,t,a=>a,Al,r);function r(a,n,o){if(o)return Promise.resolve(Object.assign(o.value,{[n]:{type:"error",result:a}}));{let{matches:i}=e,s=Math.min(Math.max(i.findIndex(u=>u.route.id===n),0),Math.max(i.findIndex(u=>u.unstable_shouldCallHandler()),0)),l=xe(i,i[s].route.id).route.id;return Promise.resolve({[l]:{type:"error",result:a}})}}}async function Gn(e,t,r,a,n){let{matches:o,request:i,params:s,context:l,unstable_pattern:u}=e,c=o.flatMap(m=>m.route.middleware?m.route.middleware.map(p=>[m.route.id,p]):[]);return await Qn({request:i,params:s,context:l,unstable_pattern:u},c,t,r,a,n)}async function Qn(e,t,r,a,n,o,i=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??new Error(`Request aborted: ${s.method} ${s.url}`);let l=t[i];if(!l)return await r();let[u,c]=l,f,m=async()=>{if(f)throw new Error("You may only call `next()` once per middleware");try{return f={value:await Qn(e,t,r,a,n,o,i+1)},f.value}catch(p){return f={value:await o(p,u,f)},f.value}};try{let p=await c(e,m),h=p!=null?a(p):void 0;return n(h)?h:f?h??f.value:(f={value:await m()},f.value)}catch(p){return await o(p,u,f)}}function qn(e,t,r,a,n){let o=ra({key:"middleware",route:a.route,manifest:t,mapRouteProperties:e}),i=Tl(a.route,de(r.method)?"action":"loader",t,e,n);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function Tt(e,t,r,a,n,o,i,s,l=null){let u=!1,c=qn(e,t,r,n,o);return{...n,_lazyPromises:c,shouldLoad:s,unstable_shouldRevalidateArgs:l,unstable_shouldCallHandler(f){return u=!0,l?typeof f=="boolean"?Zt(n,{...l,defaultShouldRevalidate:f}):Zt(n,l):s},resolve(f){let{lazy:m,loader:p,middleware:h}=n.route,g=u||s||f&&!de(r.method)&&(m||p),y=h&&h.length>0&&!p&&!m;return g&&(de(r.method)||!y)?kl({request:r,unstable_pattern:a,match:n,lazyHandlerPromise:c?.handler,lazyRoutePromise:c?.route,handlerOverride:f,scopedContext:i}):Promise.resolve({type:"data",result:void 0})}}}function Be(e,t,r,a,n,o,i,s=null){return a.map(l=>l.route.id!==n.route.id?{...l,shouldLoad:!1,unstable_shouldRevalidateArgs:s,unstable_shouldCallHandler:()=>!1,_lazyPromises:qn(e,t,r,l,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Tt(e,t,r,dt(a.map(u=>u.route.path)),l,o,i,!0,s))}async function Zn(e,t,r,a,n,o){r.some(u=>u._lazyPromises?.middleware)&&await Promise.all(r.map(u=>u._lazyPromises?.middleware));let i={request:t,unstable_pattern:dt(r.map(u=>u.route.path)),params:r[0].params,context:n,matches:r},l=await e({...i,fetcherKey:a,runClientMiddleware:o?()=>{throw new Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:u=>{let c=i;return Xn(c,()=>u({...c,fetcherKey:a,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(u=>[u._lazyPromises?.handler,u._lazyPromises?.route]))}catch{}return l}async function kl({request:e,unstable_pattern:t,match:r,lazyHandlerPromise:a,lazyRoutePromise:n,handlerOverride:o,scopedContext:i}){let s,l,u=de(e.method),c=u?"action":"loader",f=m=>{let p,h=new Promise((w,R)=>p=R);l=()=>p(),e.signal.addEventListener("abort",l);let g=w=>typeof m!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${c}" [routeId: ${r.route.id}]`)):m({request:e,unstable_pattern:t,params:r.params,context:i},...w!==void 0?[w]:[]),y=(async()=>{try{return{type:"data",result:await(o?o(R=>g(R)):g())}}catch(w){return{type:"error",result:w}}})();return Promise.race([y,h])};try{let m=u?r.route.action:r.route.loader;if(a||n)if(m){let p,[h]=await Promise.all([f(m).catch(g=>{p=g}),a,n]);if(p!==void 0)throw p;s=h}else{await a;let p=u?r.route.action:r.route.loader;if(p)[s]=await Promise.all([f(p),n]);else if(c==="action"){let h=new URL(e.url),g=h.pathname+h.search;throw te(405,{method:e.method,pathname:g,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(m)s=await f(m);else{let p=new URL(e.url),h=p.pathname+p.search;throw te(404,{pathname:h})}}catch(m){return{type:"error",result:m}}finally{l&&e.signal.removeEventListener("abort",l)}return s}async function eo(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function to(e){let{result:t,type:r}=e;if(ee(t)){let a;try{a=await eo(t)}catch(n){return{type:"error",error:n}}return r==="error"?{type:"error",error:new pe(t.status,t.statusText,a),statusCode:t.status,headers:t.headers}:{type:"data",data:a,statusCode:t.status,headers:t.headers}}return r==="error"?We(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new pe(t.init?.status||500,void 0,t.data),statusCode:re(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:re(t)?t.status:void 0}:We(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 ro(e,t,r,a,n){let o=e.headers.get("Location");if(A(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!ea(o)){let i=a.slice(0,a.findIndex(s=>s.route.id===r)+1);o=Nr(new URL(t.url),i,n,o),e.headers.set("Location",o)}return e}function tn(e,t,r){if(ea(e)){let a=e,n=a.startsWith("//")?new URL(t.protocol+a):new URL(a),o=ne(n.pathname,r)!=null;if(n.origin===t.origin&&o)return n.pathname+n.search+n.hash}return e}function ut(e,t,r,a){let n=e.createURL(no(t)).toString(),o={signal:r};if(a&&de(a.formMethod)){let{formMethod:i,formEncType:s}=a;o.method=i.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(a.json)):s==="text/plain"?o.body=a.text:s==="application/x-www-form-urlencoded"&&a.formData?o.body=Ir(a.formData):o.body=a.formData}return new Request(n,o)}function Ir(e){let t=new URLSearchParams;for(let[r,a]of e.entries())t.append(r,typeof a=="string"?a:a.name);return t}function rn(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function ao(e,t,r,a=!1,n=!1){let o={},i=null,s,l=!1,u={},c=r&&ie(r[1])?r[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let m=f.route.id,p=t[m];if(A(!ze(p),"Cannot handle redirect results in processLoaderData"),ie(p)){let h=p.error;if(c!==void 0&&(h=c,c=void 0),i=i||{},n)i[m]=h;else{let g=xe(e,m);i[g.route.id]==null&&(i[g.route.id]=h)}a||(o[m]=Vn),l||(l=!0,s=re(p.error)?p.error.status:500),p.headers&&(u[m]=p.headers)}else o[m]=p.data,p.statusCode&&p.statusCode!==200&&!l&&(s=p.statusCode),p.headers&&(u[m]=p.headers)}),c!==void 0&&r&&(i={[r[0]]:c},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:i,statusCode:s||200,loaderHeaders:u}}function an(e,t,r,a,n,o){let{loaderData:i,errors:s}=ao(t,r,a);return n.filter(l=>!l.matches||l.matches.some(u=>u.shouldLoad)).forEach(l=>{let{key:u,match:c,controller:f}=l;if(f&&f.signal.aborted)return;let m=o[u];if(A(m,"Did not find corresponding fetcher result"),ie(m)){let p=xe(e.matches,c?.route.id);s&&s[p.route.id]||(s={...s,[p.route.id]:m.error}),e.fetchers.delete(u)}else if(ze(m))A(!1,"Unhandled fetcher revalidation redirect");else{let p=Ne(m.data);e.fetchers.set(u,p)}}),{loaderData:i,errors:s}}function nn(e,t,r,a){let n=Object.entries(t).filter(([,o])=>o!==Vn).reduce((o,[i,s])=>(o[i]=s,o),{});for(let o of r){let i=o.route.id;if(!t.hasOwnProperty(i)&&e.hasOwnProperty(i)&&o.route.loader&&(n[i]=e[i]),a&&a.hasOwnProperty(i))break}return n}function on(e){return e?ie(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function xe(e,t){return(t?e.slice(0,e.findIndex(a=>a.route.id===t)+1):[...e]).reverse().find(a=>a.route.hasErrorBoundary===!0)||e[0]}function ct(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function te(e,{pathname:t,routeId:r,method:a,type:n,message:o}={}){let i="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(i="Bad Request",a&&t&&r?s=`You made a ${a} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:n==="invalid-body"&&(s="Unable to encode submission body")):e===403?(i="Forbidden",s=`Route "${r}" does not match URL "${t}"`):e===404?(i="Not Found",s=`No route matches URL "${t}"`):e===405&&(i="Method Not Allowed",a&&t&&r?s=`You made a ${a.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:a&&(s=`Invalid request method "${a.toUpperCase()}"`)),new pe(e||500,i,new Error(s),!0)}function zt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[a,n]=t[r];if(ze(n))return{key:a,result:n}}}function no(e){let t=typeof e=="string"?Pe(e):e;return he({...t,hash:""})}function Ol(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Hr(e){return Response.json(e.data,e.init??void 0)}function Nl(e){return new pe(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function Al(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&oo(r))}function oo(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function io(e){return ee(e.result)&&zn.has(e.result.status)}function ie(e){return e.type==="error"}function ze(e){return(e&&e.type)==="redirect"}function We(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function ee(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function cr(e){return zn.has(e)}function er(e){return ee(e)&&cr(e.status)&&e.headers.has("Location")}function jr(e){return Cl.has(e.toUpperCase())}function de(e){return bl.has(e.toUpperCase())}function aa(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ft(e,t){let r=typeof t=="string"?Pe(t).search:t.search;if(e[e.length-1].route.index&&aa(r||""))return e[e.length-1];let a=An(e);return a[a.length-1]}function ln(e){let{formMethod:t,formAction:r,formEncType:a,text:n,formData:o,json:i}=e;if(!(!t||!r||!a)){if(n!=null)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:void 0,text:n};if(o!=null)return{formMethod:t,formAction:r,formEncType:a,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:i,text:void 0}}}function Dr(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 $l(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function xt(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 Il(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Ne(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 Hl(e,t){try{let r=e.sessionStorage.getItem(Wn);if(r){let a=JSON.parse(r);for(let[n,o]of Object.entries(a||{}))o&&Array.isArray(o)&&t.set(n,new Set(o||[]))}}catch{}}function jl(e,t){if(t.size>0){let r={};for(let[a,n]of t)r[a]=[...n];try{e.sessionStorage.setItem(Wn,JSON.stringify(r))}catch(a){X(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function Ul(){let e,t,r=new Promise((a,n)=>{e=async o=>{a(o);try{await r}catch{}},t=async o=>{n(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var Ie=d.createContext(null);Ie.displayName="DataRouter";var at=d.createContext(null);at.displayName="DataRouterState";var lo=d.createContext(!1);function zl(){return d.useContext(lo)}var dr=d.createContext({isTransitioning:!1});dr.displayName="ViewTransition";var fr=d.createContext(new Map);fr.displayName="Fetchers";var pt=d.createContext(null);pt.displayName="Await";var Sc=e=>d.createElement(pt.Provider,e),we=d.createContext(null);we.displayName="Navigation";var yt=d.createContext(null);yt.displayName="Location";var Re=d.createContext({outlet:null,matches:[],isDataRoute:!1});Re.displayName="Route";var na=d.createContext(null);na.displayName="RouteError";function Bl(e,{relative:t}={}){A(nt(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=d.useContext(we),{hash:n,pathname:o,search:i}=Ot(e,{relative:t}),s=o;return r!=="/"&&(s=o==="/"?r:Me([r,o])),a.createHref({pathname:s,search:i,hash:n})}function nt(){return d.useContext(yt)!=null}function Ee(){return A(nt(),"useLocation() may be used only in the context of a <Router> component."),d.useContext(yt).location}function Cc(){return d.useContext(yt).navigationType}function xc(e){A(nt(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Ee();return d.useMemo(()=>_t(e,Nn(t)),[t,e])}var so="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function uo(e){d.useContext(we).static||d.useLayoutEffect(e)}function oa(){let{isDataRoute:e}=d.useContext(Re);return e?as():Wl()}function Wl(){A(nt(),"useNavigate() may be used only in the context of a <Router> component.");let e=d.useContext(Ie),{basename:t,navigator:r}=d.useContext(we),{matches:a}=d.useContext(Re),{pathname:n}=Ee(),o=JSON.stringify(ir(a)),i=d.useRef(!1);return uo(()=>{i.current=!0}),d.useCallback((l,u={})=>{if(X(i.current,so),!i.current)return;if(typeof l=="number"){r.go(l);return}let c=lr(l,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Me([t,c.pathname])),(u.replace?r.replace:r.push)(c,u.state,u)},[t,r,o,n,e])}var co=d.createContext(null);function Pc(){return d.useContext(co)}function Vl(e){let t=d.useContext(Re).outlet;return d.useMemo(()=>t&&d.createElement(co.Provider,{value:e},t),[t,e])}function ia(){let{matches:e}=d.useContext(Re),t=e[e.length-1];return t?t.params:{}}function Ot(e,{relative:t}={}){let{matches:r}=d.useContext(Re),{pathname:a}=Ee(),n=JSON.stringify(ir(r));return d.useMemo(()=>lr(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function Yl(e,t){return la(e,t)}function la(e,t,r,a,n){A(nt(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=d.useContext(we),{matches:i}=d.useContext(Re),s=i[i.length-1],l=s?s.params:{},u=s?s.pathname:"/",c=s?s.pathnameBase:"/",f=s&&s.route;{let R=f&&f.path||"";ho(u,!f||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${R}">) 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="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let m=Ee(),p;if(t){let R=typeof t=="string"?Pe(t):t;A(c==="/"||R.pathname?.startsWith(c),`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 "${c}" but pathname "${R.pathname}" was given in the \`location\` prop.`),p=R}else p=m;let h=p.pathname||"/",g=h;if(c!=="/"){let R=c.replace(/^\//,"").split("/");g="/"+h.replace(/^\//,"").split("/").slice(R.length).join("/")}let y=ge(e,{pathname:g});X(f||y!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),X(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.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 w=fo(y&&y.map(R=>Object.assign({},R,{params:Object.assign({},l,R.params),pathname:Me([c,o.encodeLocation?o.encodeLocation(R.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?c:Me([c,o.encodeLocation?o.encodeLocation(R.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),i,r,a,n);return t&&w?d.createElement(yt.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...p},navigationType:"POP"}},w):w}function Jl(){let e=hr(),t=re(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=d.createElement(d.Fragment,null,d.createElement("p",null,"💿 Hey developer 👋"),d.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",d.createElement("code",{style:o},"ErrorBoundary")," or"," ",d.createElement("code",{style:o},"errorElement")," prop on your route.")),d.createElement(d.Fragment,null,d.createElement("h2",null,"Unexpected Application Error!"),d.createElement("h3",{style:{fontStyle:"italic"}},t),r?d.createElement("pre",{style:n},r):null,i)}var Kl=d.createElement(Jl,null),Xl=class extends d.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?d.createElement(Re.Provider,{value:this.props.routeContext},d.createElement(na.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Gl({routeContext:e,match:t,children:r}){let a=d.useContext(Ie);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),d.createElement(Re.Provider,{value:e},r)}function fo(e,t=[],r=null,a=null,n=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,i=r?.errors;if(i!=null){let u=o.findIndex(c=>c.route.id&&i?.[c.route.id]!==void 0);A(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,u+1))}let s=!1,l=-1;if(r)for(let u=0;u<o.length;u++){let c=o[u];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(l=u),c.route.id){let{loaderData:f,errors:m}=r,p=c.route.loader&&!f.hasOwnProperty(c.route.id)&&(!m||m[c.route.id]===void 0);if(c.route.lazy||p){s=!0,l>=0?o=o.slice(0,l+1):o=[o[0]];break}}}return o.reduceRight((u,c,f)=>{let m,p=!1,h=null,g=null;r&&(m=i&&c.route.id?i[c.route.id]:void 0,h=c.route.errorElement||Kl,s&&(l<0&&f===0?(ho("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,g=null):l===f&&(p=!0,g=c.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,f+1)),w=()=>{let R;return m?R=h:p?R=g:c.route.Component?R=d.createElement(c.route.Component,null):c.route.element?R=c.route.element:R=u,d.createElement(Gl,{match:c,routeContext:{outlet:u,matches:y,isDataRoute:r!=null},children:R})};return r&&(c.route.ErrorBoundary||c.route.errorElement||f===0)?d.createElement(Xl,{location:r.location,revalidation:r.revalidation,component:h,error:m,children:w(),routeContext:{outlet:null,matches:y,isDataRoute:!0},unstable_onError:a}):w()},null)}function sa(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ua(e){let t=d.useContext(Ie);return A(t,sa(e)),t}function He(e){let t=d.useContext(at);return A(t,sa(e)),t}function Ql(e){let t=d.useContext(Re);return A(t,sa(e)),t}function vt(e){let t=Ql(e),r=t.matches[t.matches.length-1];return A(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function ql(){return vt("useRouteId")}function Zl(){return He("useNavigation").navigation}function Dc(){let e=ua("useRevalidator"),t=He("useRevalidator"),r=d.useCallback(async()=>{await e.router.revalidate()},[e.router]);return d.useMemo(()=>({revalidate:r,state:t.revalidation}),[r,t.revalidation])}function ca(){let{matches:e,loaderData:t}=He("useMatches");return d.useMemo(()=>e.map(r=>Mn(r,t)),[e,t])}function da(){let e=He("useLoaderData"),t=vt("useLoaderData");return e.loaderData[t]}function Lc(e){return He("useRouteLoaderData").loaderData[e]}function fa(){let e=He("useActionData"),t=vt("useLoaderData");return e.actionData?e.actionData[t]:void 0}function hr(){let e=d.useContext(na),t=He("useRouteError"),r=vt("useRouteError");return e!==void 0?e:t.errors?.[r]}function es(){return d.useContext(pt)?._data}function _c(){return d.useContext(pt)?._error}var ts=0;function rs(e){let{router:t,basename:r}=ua("useBlocker"),a=He("useBlocker"),[n,o]=d.useState(""),i=d.useCallback(s=>{if(typeof e!="function")return!!e;if(r==="/")return e(s);let{currentLocation:l,nextLocation:u,historyAction:c}=s;return e({currentLocation:{...l,pathname:ne(l.pathname,r)||l.pathname},nextLocation:{...u,pathname:ne(u.pathname,r)||u.pathname},historyAction:c})},[r,e]);return d.useEffect(()=>{let s=String(++ts);return o(s),()=>t.deleteBlocker(s)},[t]),d.useEffect(()=>{n!==""&&t.getBlocker(n,i)},[t,n,i]),n&&a.blockers.has(n)?a.blockers.get(n):tt}function as(){let{router:e}=ua("useNavigate"),t=vt("useNavigate"),r=d.useRef(!1);return uo(()=>{r.current=!0}),d.useCallback(async(n,o={})=>{X(r.current,so),r.current&&(typeof n=="number"?e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var sn={};function ho(e,t,r){!t&&!sn[e]&&(sn[e]=!0,X(!1,r))}function Tc(...e){const t=vt("useRoute"),r=e[0]??t,a=He("useRoute"),n=a.matches.find(({route:o})=>o.id===r);if(n!==void 0)return{handle:n.route.handle,loaderData:a.loaderData[r],actionData:a.actionData?.[r]}}var un={};function Mt(e,t){!e&&!un[t]&&(un[t]=!0,console.warn(t))}function gt(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&X(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:d.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&X(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:d.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&X(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:d.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var mr=["HydrateFallback","hydrateFallbackElement"];function ns(e,t){return ur({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:Dn({initialEntries:t?.initialEntries,initialIndex:t?.initialIndex}),hydrationData:t?.hydrationData,routes:e,hydrationRouteProperties:mr,mapRouteProperties:gt,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}var os=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function mo({router:e,flushSync:t,unstable_onError:r}){let[a,n]=d.useState(e.state),[o,i]=d.useState(),[s,l]=d.useState({isTransitioning:!1}),[u,c]=d.useState(),[f,m]=d.useState(),[p,h]=d.useState(),g=d.useRef(new Map),y=d.useCallback(P=>{n(D=>(P.errors&&r&&Object.entries(P.errors).forEach(([E,F])=>{D.errors?.[E]!==F&&r(F)}),P))},[r]),w=d.useCallback((P,{deletedFetchers:D,flushSync:E,viewTransitionOpts:F})=>{P.fetchers.forEach((M,N)=>{M.data!==void 0&&g.current.set(N,M.data)}),D.forEach(M=>g.current.delete(M)),Mt(E===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let T=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(Mt(F==null||T,"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."),!F||!T){t&&E?t(()=>y(P)):d.startTransition(()=>y(P));return}if(t&&E){t(()=>{f&&(u&&u.resolve(),f.skipTransition()),l({isTransitioning:!0,flushSync:!0,currentLocation:F.currentLocation,nextLocation:F.nextLocation})});let M=e.window.document.startViewTransition(()=>{t(()=>y(P))});M.finished.finally(()=>{t(()=>{c(void 0),m(void 0),i(void 0),l({isTransitioning:!1})})}),t(()=>m(M));return}f?(u&&u.resolve(),f.skipTransition(),h({state:P,currentLocation:F.currentLocation,nextLocation:F.nextLocation})):(i(P),l({isTransitioning:!0,flushSync:!1,currentLocation:F.currentLocation,nextLocation:F.nextLocation}))},[e.window,t,f,u,y]);d.useLayoutEffect(()=>e.subscribe(w),[e,w]),d.useEffect(()=>{s.isTransitioning&&!s.flushSync&&c(new os)},[s]),d.useEffect(()=>{if(u&&o&&e.window){let P=o,D=u.promise,E=e.window.document.startViewTransition(async()=>{d.startTransition(()=>y(P)),await D});E.finished.finally(()=>{c(void 0),m(void 0),i(void 0),l({isTransitioning:!1})}),m(E)}},[o,u,e.window,y]),d.useEffect(()=>{u&&o&&a.location.key===o.location.key&&u.resolve()},[u,f,a.location,o]),d.useEffect(()=>{!s.isTransitioning&&p&&(i(p.state),l({isTransitioning:!0,flushSync:!1,currentLocation:p.currentLocation,nextLocation:p.nextLocation}),h(void 0))},[s.isTransitioning,p]);let R=d.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:P=>e.navigate(P),push:(P,D,E)=>e.navigate(P,{state:D,preventScrollReset:E?.preventScrollReset}),replace:(P,D,E)=>e.navigate(P,{replace:!0,state:D,preventScrollReset:E?.preventScrollReset})}),[e]),C=e.basename||"/",x=d.useMemo(()=>({router:e,navigator:R,static:!1,basename:C,unstable_onError:r}),[e,R,C,r]);return d.createElement(d.Fragment,null,d.createElement(Ie.Provider,{value:x},d.createElement(at.Provider,{value:a},d.createElement(fr.Provider,{value:g.current},d.createElement(dr.Provider,{value:s},d.createElement(ot,{basename:C,location:a.location,navigationType:a.historyAction,navigator:R},d.createElement(is,{routes:e.routes,future:e.future,state:a,unstable_onError:r})))))),null)}var is=d.memo(ls);function ls({routes:e,future:t,state:r,unstable_onError:a}){return la(e,void 0,r,a,t)}function Mc({basename:e,children:t,initialEntries:r,initialIndex:a}){let n=d.useRef();n.current==null&&(n.current=Dn({initialEntries:r,initialIndex:a,v5Compat:!0}));let o=n.current,[i,s]=d.useState({action:o.action,location:o.location}),l=d.useCallback(u=>{d.startTransition(()=>s(u))},[s]);return d.useLayoutEffect(()=>o.listen(l),[o,l]),d.createElement(ot,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:o})}function Fc({to:e,replace:t,state:r,relative:a}){A(nt(),"<Navigate> may be used only in the context of a <Router> component.");let{static:n}=d.useContext(we);X(!n,"<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}=d.useContext(Re),{pathname:i}=Ee(),s=oa(),l=lr(e,ir(o),i,a==="path"),u=JSON.stringify(l);return d.useEffect(()=>{s(JSON.parse(u),{replace:t,state:r,relative:a})},[s,u,a,t,r]),null}function ss(e){return Vl(e.context)}function us(e){A(!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 ot({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1}){A(!nt(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),s=d.useMemo(()=>({basename:i,navigator:n,static:o,future:{}}),[i,n,o]);typeof r=="string"&&(r=Pe(r));let{pathname:l="/",search:u="",hash:c="",state:f=null,key:m="default"}=r,p=d.useMemo(()=>{let h=ne(l,i);return h==null?null:{location:{pathname:h,search:u,hash:c,state:f,key:m},navigationType:a}},[i,l,u,c,f,m,a]);return X(p!=null,`<Router basename="${i}"> is not able to match the URL "${l}${u}${c}" because it does not start with the basename, so the <Router> won't render anything.`),p==null?null:d.createElement(we.Provider,{value:s},d.createElement(yt.Provider,{children:t,value:p}))}function kc({children:e,location:t}){return Yl(tr(e),t)}function Oc({children:e,errorElement:t,resolve:r}){let a=d.useContext(Ie);return d.createElement(cs,{resolve:r,errorElement:t,unstable_onError:a?.unstable_onError},d.createElement(ds,null,e))}var cs=class extends d.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("<Await> caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:r}=this.props,a=null,n=0;if(!(r instanceof Promise))n=1,a=Promise.resolve(),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_data",{get:()=>r});else if(this.state.error){n=2;let o=this.state.error;a=Promise.reject().catch(()=>{}),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_error",{get:()=>o})}else r._tracked?(a=r,n="_error"in a?2:"_data"in a?1:0):(n=0,Object.defineProperty(r,"_tracked",{get:()=>!0}),a=r.then(o=>Object.defineProperty(r,"_data",{get:()=>o}),o=>{this.props.unstable_onError?.(o),Object.defineProperty(r,"_error",{get:()=>o})}));if(n===2&&!t)throw a._error;if(n===2)return d.createElement(pt.Provider,{value:a,children:t});if(n===1)return d.createElement(pt.Provider,{value:a,children:e});throw a}};function ds({children:e}){let t=es(),r=typeof e=="function"?e(t):e;return d.createElement(d.Fragment,null,r)}function tr(e,t=[]){let r=[];return d.Children.forEach(e,(a,n)=>{if(!d.isValidElement(a))return;let o=[...t,n];if(a.type===d.Fragment){r.push.apply(r,tr(a.props.children,o));return}A(a.type===us,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),A(!a.props.index||!a.props.children,"An index route cannot have child routes.");let i={id:a.props.id||o.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(i.children=tr(a.props.children,o)),r.push(i)}),r}var Nc=tr;function Ac(e){return fo(e)}function po(){return{params:ia(),loaderData:da(),actionData:fa(),matches:ca()}}function $c({children:e}){const t=po();return d.cloneElement(e,t)}function fs(e){return function(){const r=po();return d.createElement(e,r)}}function yo(){return{params:ia(),loaderData:da(),actionData:fa()}}function Ic({children:e}){const t=yo();return d.cloneElement(e,t)}function hs(e){return function(){const r=yo();return d.createElement(e,r)}}function vo(){return{params:ia(),loaderData:da(),actionData:fa(),error:hr()}}function Hc({children:e}){const t=vo();return d.cloneElement(e,t)}function ms(e){return function(){const r=vo();return d.createElement(e,r)}}var Xt="get",Gt="application/x-www-form-urlencoded";function pr(e){return e!=null&&typeof e.tagName=="string"}function ps(e){return pr(e)&&e.tagName.toLowerCase()==="button"}function ys(e){return pr(e)&&e.tagName.toLowerCase()==="form"}function vs(e){return pr(e)&&e.tagName.toLowerCase()==="input"}function gs(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ws(e,t){return e.button===0&&(!t||t==="_self")&&!gs(e)}function Ur(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let a=e[r];return t.concat(Array.isArray(a)?a.map(n=>[r,n]):[[r,a]])},[]))}function Rs(e,t){let r=Ur(e);return t&&t.forEach((a,n)=>{r.has(n)||t.getAll(n).forEach(o=>{r.append(n,o)})}),r}var Bt=null;function Es(){if(Bt===null)try{new FormData(document.createElement("form"),0),Bt=!1}catch{Bt=!0}return Bt}var bs=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Lr(e){return e!=null&&!bs.has(e)?(X(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Gt}"`),null):e}function Ss(e,t){let r,a,n,o,i;if(ys(e)){let s=e.getAttribute("action");a=s?ne(s,t):null,r=e.getAttribute("method")||Xt,n=Lr(e.getAttribute("enctype"))||Gt,o=new FormData(e)}else if(ps(e)||vs(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||s.getAttribute("action");if(a=l?ne(l,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||Xt,n=Lr(e.getAttribute("formenctype"))||Lr(s.getAttribute("enctype"))||Gt,o=new FormData(s,e),!Es()){let{name:u,type:c,value:f}=e;if(c==="image"){let m=u?`${u}.`:"";o.append(`${m}x`,"0"),o.append(`${m}y`,"0")}else u&&o.append(u,f)}}else{if(pr(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Xt,a=null,n=Gt,i=e}return o&&n==="text/plain"&&(i=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:i}}var go=-1,wo=-2,Ro=-3,Eo=-4,ha=-5,bo=-6,So=-7,Co="B",xo="D",ht="E",zr="M",Po="N",mt="P",Do="R",Br="S",Lo="Y",_o="U",Wr="Z",To=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};function Cs(){const e=new TextDecoder;let t="";return new TransformStream({transform(r,a){const n=e.decode(r,{stream:!0}),o=(t+n).split(`
|
|
5
|
+
`);t=o.pop()||"";for(const i of o)a.enqueue(i)},flush(r){t&&r.enqueue(t)}})}function Ce(e){const{indices:t}=this,r=t.get(e);if(r)return[r];if(e===void 0)return So;if(e===null)return ha;if(Number.isNaN(e))return wo;if(e===Number.POSITIVE_INFINITY)return bo;if(e===Number.NEGATIVE_INFINITY)return Ro;if(e===0&&1/e<0)return Eo;const a=this.index++;return t.set(e,a),xs.call(this,e,a),a}function xs(e,t){const{deferred:r,plugins:a,postPlugins:n}=this,o=this.stringified,i=[[e,t]];for(;i.length>0;){const[s,l]=i.pop(),u=f=>Object.keys(f).map(m=>`"_${Ce.call(this,m)}":${Ce.call(this,f[m])}`).join(",");let c=null;switch(typeof s){case"boolean":case"number":case"string":o[l]=JSON.stringify(s);break;case"bigint":o[l]=`["${Co}","${s}"]`;break;case"symbol":{const f=Symbol.keyFor(s);f?o[l]=`["${Lo}",${JSON.stringify(f)}]`:c=new Error("Cannot encode symbol unless created with Symbol.for()");break}case"object":{if(!s){o[l]=`${ha}`;break}const f=Array.isArray(s);let m=!1;if(!f&&a)for(const p of a){const h=p(s);if(Array.isArray(h)){m=!0;const[g,...y]=h;o[l]=`[${JSON.stringify(g)}`,y.length>0&&(o[l]+=`,${y.map(w=>Ce.call(this,w)).join(",")}`),o[l]+="]";break}}if(!m){let p=f?"[":"{";if(f){for(let h=0;h<s.length;h++)p+=(h?",":"")+(h in s?Ce.call(this,s[h]):go);o[l]=`${p}]`}else if(s instanceof Date){const h=s.getTime();o[l]=`["${xo}",${Number.isNaN(h)?JSON.stringify("invalid"):h}]`}else s instanceof URL?o[l]=`["${_o}",${JSON.stringify(s.href)}]`:s instanceof RegExp?o[l]=`["${Do}",${JSON.stringify(s.source)},${JSON.stringify(s.flags)}]`:s instanceof Set?s.size>0?o[l]=`["${Br}",${[...s].map(h=>Ce.call(this,h)).join(",")}]`:o[l]=`["${Br}"]`:s instanceof Map?s.size>0?o[l]=`["${zr}",${[...s].flatMap(([h,g])=>[Ce.call(this,h),Ce.call(this,g)]).join(",")}]`:o[l]=`["${zr}"]`:s instanceof Promise?(o[l]=`["${mt}",${l}]`,r[l]=s):s instanceof Error?(o[l]=`["${ht}",${JSON.stringify(s.message)}`,s.name!=="Error"&&(o[l]+=`,${JSON.stringify(s.name)}`),o[l]+="]"):Object.getPrototypeOf(s)===null?o[l]=`["${Po}",{${u(s)}}]`:Ds(s)?o[l]=`{${u(s)}}`:c=new Error("Cannot encode object with prototype")}break}default:{const f=Array.isArray(s);let m=!1;if(!f&&a)for(const p of a){const h=p(s);if(Array.isArray(h)){m=!0;const[g,...y]=h;o[l]=`[${JSON.stringify(g)}`,y.length>0&&(o[l]+=`,${y.map(w=>Ce.call(this,w)).join(",")}`),o[l]+="]";break}}m||(c=new Error("Cannot encode function or unexpected type"))}}if(c){let f=!1;if(n)for(const m of n){const p=m(s);if(Array.isArray(p)){f=!0;const[h,...g]=p;o[l]=`[${JSON.stringify(h)}`,g.length>0&&(o[l]+=`,${g.map(y=>Ce.call(this,y)).join(",")}`),o[l]+="]";break}}if(!f)throw c}}}var Ps=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ds(e){const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===Ps}var _r=typeof window<"u"?window:typeof globalThis<"u"?globalThis:void 0;function Vr(e){const{hydrated:t,values:r}=this;if(typeof e=="number")return cn.call(this,e);if(!Array.isArray(e)||!e.length)throw new SyntaxError;const a=r.length;for(const n of e)r.push(n);return t.length=r.length,cn.call(this,a)}function cn(e){const{hydrated:t,values:r,deferred:a,plugins:n}=this;let o;const i=[[e,l=>{o=l}]];let s=[];for(;i.length>0;){const[l,u]=i.pop();switch(l){case So:u(void 0);continue;case ha:u(null);continue;case wo:u(NaN);continue;case bo:u(1/0);continue;case Ro:u(-1/0);continue;case Eo:u(-0);continue}if(t[l]){u(t[l]);continue}const c=r[l];if(!c||typeof c!="object"){t[l]=c,u(c);continue}if(Array.isArray(c))if(typeof c[0]=="string"){const[f,m,p]=c;switch(f){case xo:u(t[l]=new Date(m));continue;case _o:u(t[l]=new URL(m));continue;case Co:u(t[l]=BigInt(m));continue;case Do:u(t[l]=new RegExp(m,p));continue;case Lo:u(t[l]=Symbol.for(m));continue;case Br:const h=new Set;t[l]=h;for(let x=c.length-1;x>0;x--)i.push([c[x],P=>{h.add(P)}]);u(h);continue;case zr:const g=new Map;t[l]=g;for(let x=c.length-2;x>0;x-=2){const P=[];i.push([c[x+1],D=>{P[1]=D}]),i.push([c[x],D=>{P[0]=D}]),s.push(()=>{g.set(P[0],P[1])})}u(g);continue;case Po:const y=Object.create(null);t[l]=y;for(const x of Object.keys(m).reverse()){const P=[];i.push([m[x],D=>{P[1]=D}]),i.push([Number(x.slice(1)),D=>{P[0]=D}]),s.push(()=>{y[P[0]]=P[1]})}u(y);continue;case mt:if(t[m])u(t[l]=t[m]);else{const x=new To;a[m]=x,u(t[l]=x.promise)}continue;case ht:const[,w,R]=c;let C=R&&_r&&_r[R]?new _r[R](w):new Error(w);t[l]=C,u(C);continue;case Wr:u(t[l]=t[m]);continue;default:if(Array.isArray(n)){const x=[],P=c.slice(1);for(let D=0;D<P.length;D++){const E=P[D];i.push([E,F=>{x[D]=F}])}s.push(()=>{for(const D of n){const E=D(c[0],...x);if(E){u(t[l]=E.value);return}}throw new SyntaxError});continue}throw new SyntaxError}}else{const f=[];t[l]=f;for(let m=0;m<c.length;m++){const p=c[m];p!==go&&i.push([p,h=>{f[m]=h}])}u(f);continue}else{const f={};t[l]=f;for(const m of Object.keys(c).reverse()){const p=[];i.push([c[m],h=>{p[1]=h}]),i.push([Number(m.slice(1)),h=>{p[0]=h}]),s.push(()=>{f[p[0]]=p[1]})}u(f);continue}}for(;s.length>0;)s.pop()();return o}async function Ls(e,t){const{plugins:r}=t??{},a=new To,n=e.pipeThrough(Cs()).getReader(),o={values:[],hydrated:[],deferred:{},plugins:r},i=await _s.call(o,n);let s=a.promise;return i.done?a.resolve():s=Ts.call(o,n).then(a.resolve).catch(l=>{for(const u of Object.values(o.deferred))u.reject(l);a.reject(l)}),{done:s.then(()=>n.closed),value:i.value}}async function _s(e){const t=await e.read();if(!t.value)throw new SyntaxError;let r;try{r=JSON.parse(t.value)}catch{throw new SyntaxError}return{done:t.done,value:Vr.call(this,r)}}async function Ts(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const r=t.value;switch(r[0]){case mt:{const a=r.indexOf(":"),n=Number(r.slice(1,a)),o=this.deferred[n];if(!o)throw new Error(`Deferred ID ${n} not found in stream`);const i=r.slice(a+1);let s;try{s=JSON.parse(i)}catch{throw new SyntaxError}const l=Vr.call(this,s);o.resolve(l);break}case ht:{const a=r.indexOf(":"),n=Number(r.slice(1,a)),o=this.deferred[n];if(!o)throw new Error(`Deferred ID ${n} not found in stream`);const i=r.slice(a+1);let s;try{s=JSON.parse(i)}catch{throw new SyntaxError}const l=Vr.call(this,s);o.reject(l);break}default:throw new SyntaxError}t=await e.read()}}function Ms(e,t){const{plugins:r,postPlugins:a,signal:n}=t??{},o={deferred:{},index:0,indices:new Map,stringified:[],plugins:r,postPlugins:a,signal:n},i=new TextEncoder;let s=0;return new ReadableStream({async start(u){const c=Ce.call(o,e);if(Array.isArray(c))throw new Error("This should never happen");c<0?u.enqueue(i.encode(`${c}
|
|
6
|
+
`)):(u.enqueue(i.encode(`[${o.stringified.join(",")}]
|
|
7
|
+
`)),s=o.stringified.length-1);const f=new WeakSet;if(Object.keys(o.deferred).length){let m;const p=new Promise((h,g)=>{if(m=h,n){const y=()=>g(n.reason||new Error("Signal was aborted."));n.aborted?y():n.addEventListener("abort",w=>{y()})}});for(;Object.keys(o.deferred).length>0;){for(const[h,g]of Object.entries(o.deferred))f.has(g)||f.add(o.deferred[Number(h)]=Promise.race([p,g]).then(y=>{const w=Ce.call(o,y);if(Array.isArray(w))u.enqueue(i.encode(`${mt}${h}:[["${Wr}",${w[0]}]]
|
|
8
|
+
`)),o.index++,s++;else if(w<0)u.enqueue(i.encode(`${mt}${h}:${w}
|
|
9
|
+
`));else{const R=o.stringified.slice(s+1).join(",");u.enqueue(i.encode(`${mt}${h}:[${R}]
|
|
10
|
+
`)),s=o.stringified.length-1}},y=>{(!y||typeof y!="object"||!(y instanceof Error))&&(y=new Error("An unknown error occurred"));const w=Ce.call(o,y);if(Array.isArray(w))u.enqueue(i.encode(`${ht}${h}:[["${Wr}",${w[0]}]]
|
|
11
|
+
`)),o.index++,s++;else if(w<0)u.enqueue(i.encode(`${ht}${h}:${w}
|
|
12
|
+
`));else{const R=o.stringified.slice(s+1).join(",");u.enqueue(i.encode(`${ht}${h}:[${R}]
|
|
13
|
+
`)),s=o.stringified.length-1}}).finally(()=>{delete o.deferred[Number(h)]}));await Promise.race(Object.values(o.deferred))}m()}await Promise.all(Object.values(o.deferred)),u.close()}})}async function Fs(e){let t={signal:e.signal};if(e.method!=="GET"){t.method=e.method;let r=e.headers.get("Content-Type");r&&/\bapplication\/json\b/.test(r)?(t.headers={"Content-Type":r},t.body=JSON.stringify(await e.json())):r&&/\btext\/plain\b/.test(r)?(t.headers={"Content-Type":r},t.body=await e.text()):r&&/\bapplication\/x-www-form-urlencoded\b/.test(r)?t.body=new URLSearchParams(await e.text()):t.body=await e.formData()}return t}var ks={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},Os=/[&><\u2028\u2029]/g;function ma(e){return e.replace(Os,t=>ks[t])}function fe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var Ye=Symbol("SingleFetchRedirect"),Mo=class extends Error{},pa=202,Fo=new Set([100,101,204,205]);function ko({context:e,identifier:t,reader:r,textDecoder:a,nonce:n}){if(!e.renderMeta||!e.renderMeta.didRenderScripts)return null;e.renderMeta.streamCache||(e.renderMeta.streamCache={});let{streamCache:o}=e.renderMeta,i=o[t];if(i||(i=o[t]=r.read().then(c=>{o[t].result={done:c.done,value:a.decode(c.value,{stream:!0})}}).catch(c=>{o[t].error=c})),i.error)throw i.error;if(i.result===void 0)throw i;let{done:s,value:l}=i.result,u=l?d.createElement("script",{nonce:n,dangerouslySetInnerHTML:{__html:`window.__reactRouterContext.streamController.enqueue(${ma(JSON.stringify(l))});`}}):null;return s?d.createElement(d.Fragment,null,u,d.createElement("script",{nonce:n,dangerouslySetInnerHTML:{__html:"window.__reactRouterContext.streamController.close();"}})):d.createElement(d.Fragment,null,u,d.createElement(d.Suspense,null,d.createElement(ko,{context:e,identifier:t+1,reader:r,textDecoder:a,nonce:n})))}function Ns(e,t,r,a,n){let o=As(e,i=>{let s=t.routes[i.route.id];fe(s,"Route not found in manifest");let l=r[i.route.id];return{hasLoader:s.hasLoader,hasClientLoader:s.hasClientLoader,hasShouldRevalidate:!!l?.shouldRevalidate}},Bs,a,n);return async i=>i.runClientMiddleware(o)}function As(e,t,r,a,n,o=()=>!0){return async i=>{let{request:s,matches:l,fetcherKey:u}=i,c=e();if(s.method!=="GET")return $s(i,r,n);let f=l.some(m=>{let{hasLoader:p,hasClientLoader:h}=t(m);return m.unstable_shouldCallHandler()&&p&&!h});return!a&&!f?Is(i,t,r,n):u?Us(i,r,n):Hs(i,c,t,r,a,n,o)}}async function $s(e,t,r){let a=e.matches.find(i=>i.unstable_shouldCallHandler());fe(a,"No action match found");let n,o=await a.resolve(async i=>await i(async()=>{let{data:l,status:u}=await t(e,r,[a.route.id]);return n=u,Ft(l,a.route.id)}));return ee(o.result)||re(o.result)||We(o.result)?{[a.route.id]:o}:{[a.route.id]:{type:o.type,result:pl(o.result,n)}}}async function Is(e,t,r,a){let n=e.matches.filter(i=>i.unstable_shouldCallHandler()),o={};return await Promise.all(n.map(i=>i.resolve(async s=>{try{let{hasClientLoader:l}=t(i),u=i.route.id,c=l?await s(async()=>{let{data:f}=await r(e,a,[u]);return Ft(f,u)}):await s();o[i.route.id]={type:"data",result:c}}catch(l){o[i.route.id]={type:"error",result:l}}}))),o}async function Hs(e,t,r,a,n,o,i=()=>!0){let s=new Set,l=!1,u=e.matches.map(()=>dn()),c=dn(),f={},m=Promise.all(e.matches.map(async(h,g)=>h.resolve(async y=>{u[g].resolve();let w=h.route.id,{hasLoader:R,hasClientLoader:C,hasShouldRevalidate:x}=r(h),P=!h.unstable_shouldRevalidateArgs||h.unstable_shouldRevalidateArgs.actionStatus==null||h.unstable_shouldRevalidateArgs.actionStatus<400;if(!h.unstable_shouldCallHandler(P)){l||(l=h.unstable_shouldRevalidateArgs!=null&&R&&x===!0);return}if(i(h)&&C){R&&(l=!0);try{let E=await y(async()=>{let{data:F}=await a(e,o,[w]);return Ft(F,w)});f[w]={type:"data",result:E}}catch(E){f[w]={type:"error",result:E}}return}R&&s.add(w);try{let E=await y(async()=>{let F=await c.promise;return Ft(F,w)});f[w]={type:"data",result:E}}catch(E){f[w]={type:"error",result:E}}})));if(await Promise.all(u.map(h=>h.promise)),(!t.state.initialized&&t.state.navigation.state==="idle"||s.size===0)&&!window.__reactRouterHdrActive)c.resolve({routes:{}});else{let h=n&&l&&s.size>0?[...s.keys()]:void 0;try{let g=await a(e,o,h);c.resolve(g.data)}catch(g){c.reject(g)}}return await m,await js(c.promise,e.matches,s,f),f}async function js(e,t,r,a){try{let n,o=await e;if("routes"in o){for(let i of t)if(i.route.id in o.routes){let s=o.routes[i.route.id];if("error"in s){n=s.error,a[i.route.id]?.result==null&&(a[i.route.id]={type:"error",result:n});break}}}n!==void 0&&Array.from(r.values()).forEach(i=>{a[i].result instanceof Mo&&(a[i].result=n)})}catch{}}async function Us(e,t,r){let a=e.matches.find(i=>i.unstable_shouldCallHandler());fe(a,"No fetcher match found");let n=a.route.id,o=await a.resolve(async i=>i(async()=>{let{data:s}=await t(e,r,[n]);return Ft(s,n)}));return{[a.route.id]:o}}function zs(e){let t=e.searchParams.getAll("index");e.searchParams.delete("index");let r=[];for(let a of t)a&&r.push(a);for(let a of r)e.searchParams.append("index",a);return e}function Oo(e,t,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return a.pathname==="/"?a.pathname=`_root.${r}`:t&&ne(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}async function Bs(e,t,r){let{request:a}=e,n=Oo(a.url,t,"data");a.method==="GET"&&(n=zs(n),r&&n.searchParams.set("_routes",r.join(",")));let o=await fetch(n,await Fs(a));if(o.status>=400&&!o.headers.has("X-Remix-Response"))throw new pe(o.status,o.statusText,await o.text());if(o.status===204&&o.headers.has("X-Remix-Redirect"))return{status:pa,data:{redirect:{redirect:o.headers.get("X-Remix-Redirect"),status:Number(o.headers.get("X-Remix-Status")||"302"),revalidate:o.headers.get("X-Remix-Revalidate")==="true",reload:o.headers.get("X-Remix-Reload-Document")==="true",replace:o.headers.get("X-Remix-Replace")==="true"}}};if(Fo.has(o.status)){let i={};return r&&a.method!=="GET"&&(i[r[0]]={data:void 0}),{status:o.status,data:{routes:i}}}fe(o.body,"No response body to decode");try{let i=await ya(o.body,window),s;if(a.method==="GET"){let l=i.value;Ye in l?s={redirect:l[Ye]}:s={routes:l}}else{let l=i.value,u=r?.[0];fe(u,"No routeId found for single fetch call decoding"),"redirect"in l?s={redirect:l}:s={routes:{[u]:l}}}return{status:o.status,data:s}}catch{throw new Error("Unable to decode turbo-stream response")}}function ya(e,t){return Ls(e,{plugins:[(r,...a)=>{if(r==="SanitizedError"){let[n,o,i]=a,s=Error;n&&n in t&&typeof t[n]=="function"&&(s=t[n]);let l=new s(o);return l.stack=i,{value:l}}if(r==="ErrorResponse"){let[n,o,i]=a;return{value:new pe(o,i,n)}}if(r==="SingleFetchRedirect")return{value:{[Ye]:a[0]}};if(r==="SingleFetchClassInstance")return{value:a[0]};if(r==="SingleFetchFallback")return{value:void 0}}]})}function Ft(e,t){if("redirect"in e){let{redirect:a,revalidate:n,reload:o,replace:i,status:s}=e.redirect;throw sr(a,{status:s,headers:{...n?{"X-Remix-Revalidate":"yes"}:null,...o?{"X-Remix-Reload-Document":"yes"}:null,...i?{"X-Remix-Replace":"yes"}:null}})}let r=e.routes[t];if(r==null)throw new Mo(`No result found for routeId "${t}"`);if("error"in r)throw r.error;if("data"in r)return r.data;throw new Error(`Invalid response found for routeId "${t}"`)}function dn(){let e,t,r=new Promise((a,n)=>{e=async o=>{a(o);try{await r}catch{}},t=async o=>{n(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}async function No(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ws(e,t,r){let a=e.map(o=>{let i=t[o.route.id],s=r.routes[o.route.id];return[s&&s.css?s.css.map(l=>({rel:"stylesheet",href:l})):[],i?.links?.()||[]]}).flat(2),n=ga(e,r);return Ho(a,n)}function Ao(e){return e.css?e.css.map(t=>({rel:"stylesheet",href:t})):[]}async function Vs(e){if(!e.css)return;let t=Ao(e);await Promise.all(t.map(Io))}async function $o(e,t){if(!e.css&&!t.links||!Gs())return;let r=[];if(e.css&&r.push(...Ao(e)),t.links&&r.push(...t.links()),r.length===0)return;let a=[];for(let n of r)!va(n)&&n.rel==="stylesheet"&&a.push({...n,rel:"preload",as:"style"});await Promise.all(a.map(Io))}async function Io(e){return new Promise(t=>{if(e.media&&!window.matchMedia(e.media).matches||document.querySelector(`link[rel="stylesheet"][href="${e.href}"]`))return t();let r=document.createElement("link");Object.assign(r,e);function a(){document.head.contains(r)&&document.head.removeChild(r)}r.onload=()=>{a(),t()},r.onerror=()=>{a(),t()},document.head.appendChild(r)})}function va(e){return e!=null&&typeof e.page=="string"}function Ys(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Js(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let i=await No(o,r);return i.links?i.links():[]}return[]}));return Ho(a.flat(1).filter(Ys).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function fn(e,t,r,a,n,o){let i=(l,u)=>r[u]?l.route.id!==r[u].route.id:!0,s=(l,u)=>r[u].pathname!==l.pathname||r[u].route.path?.endsWith("*")&&r[u].params["*"]!==l.params["*"];return o==="assets"?t.filter((l,u)=>i(l,u)||s(l,u)):o==="data"?t.filter((l,u)=>{let c=a.routes[l.route.id];if(!c||!c.hasLoader)return!1;if(i(l,u)||s(l,u))return!0;if(l.route.shouldRevalidate){let f=l.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function ga(e,t,{includeHydrateFallback:r}={}){return Ks(e.map(a=>{let n=t.routes[a.route.id];if(!n)return[];let o=[n.module];return n.clientActionModule&&(o=o.concat(n.clientActionModule)),n.clientLoaderModule&&(o=o.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(o=o.concat(n.hydrateFallbackModule)),n.imports&&(o=o.concat(n.imports)),o}).flat(1))}function Ks(e){return[...new Set(e)]}function Xs(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function Ho(e,t){let r=new Set,a=new Set(t);return e.reduce((n,o)=>{if(t&&!va(o)&&o.as==="script"&&o.href&&a.has(o.href))return n;let s=JSON.stringify(Xs(o));return r.has(s)||(r.add(s),n.push({key:s,link:o})),n},[])}var Wt;function Gs(){if(Wt!==void 0)return Wt;let e=document.createElement("link");return Wt=e.relList.supports("preload"),e=null,Wt}function Qs(){return d.createElement(Yr,{title:"Loading...",renderScripts:!0},d.createElement("script",{dangerouslySetInnerHTML:{__html:`
|
|
14
|
+
console.log(
|
|
15
|
+
"💿 Hey developer 👋. You can provide a way better UX than this " +
|
|
16
|
+
"when your app is loading JS modules and/or running \`clientLoader\` " +
|
|
17
|
+
"functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +
|
|
18
|
+
"for more information."
|
|
19
|
+
);
|
|
20
|
+
`}}))}function wa(e){let t={};return Object.values(e).forEach(r=>{if(r){let a=r.parentId||"";t[a]||(t[a]=[]),t[a].push(r)}}),t}function jo(e,t,r){let a=zo(t),n=t.HydrateFallback&&(!r||e.id==="root")?t.HydrateFallback:e.id==="root"?Qs:void 0,o=t.ErrorBoundary?t.ErrorBoundary:e.id==="root"?()=>d.createElement(Jo,{error:hr()}):void 0;return e.id==="root"&&t.Layout?{...a?{element:d.createElement(t.Layout,null,d.createElement(a,null))}:{Component:a},...o?{errorElement:d.createElement(t.Layout,null,d.createElement(o,null))}:{ErrorBoundary:o},...n?{hydrateFallbackElement:d.createElement(t.Layout,null,d.createElement(n,null))}:{HydrateFallback:n}}:{Component:a,ErrorBoundary:o,HydrateFallback:n}}function Uo(e,t,r,a,n="",o=wa(e),i=Promise.resolve({Component:()=>null})){return(o[n]||[]).map(s=>{let l=t[s.id];fe(l,"No `routeModule` available to create server routes");let u={...jo(s,l,a),caseSensitive:s.caseSensitive,id:s.id,index:s.index,path:s.path,handle:l.handle,lazy:a?()=>i:void 0,loader:s.hasLoader||s.hasClientLoader?()=>null:void 0},c=Uo(e,t,r,a,s.id,o,i);return c.length>0&&(u.children=c),u})}function qs(e,t,r,a,n,o){return yr(t,r,a,n,o,"",wa(t),e)}function Vt(e,t){if(e==="loader"&&!t.hasLoader||e==="action"&&!t.hasAction){let a=`You are trying to call ${e==="action"?"serverAction()":"serverLoader()"} on a route that does not have a server ${e} (routeId: "${t.id}")`;throw console.error(a),new pe(400,"Bad Request",new Error(a),!0)}}function Tr(e,t){let r=e==="clientAction"?"a":"an",a=`Route "${t}" does not have ${r} ${e}, but you are trying to submit to it. To fix this, please add ${r} \`${e}\` function to the route`;throw console.error(a),new pe(405,"Method Not Allowed",new Error(a),!0)}function yr(e,t,r,a,n,o="",i=wa(e),s){return(i[o]||[]).map(l=>{let u=t[l.id];function c(R){return fe(typeof R=="function","No single fetch function available for route handler"),R()}function f(R){return l.hasLoader?c(R):Promise.resolve(null)}function m(R){if(!l.hasAction)throw Tr("action",l.id);return c(R)}function p(R){import(R)}function h(R){R.clientActionModule&&p(R.clientActionModule),R.clientLoaderModule&&p(R.clientLoaderModule)}async function g(R){let C=t[l.id],x=C?$o(l,C):Promise.resolve();try{return R()}finally{await x}}let y={id:l.id,index:l.index,path:l.path};if(u){Object.assign(y,{...y,...jo(l,u,n),middleware:u.clientMiddleware,handle:u.handle,shouldRevalidate:hn(y.path,u,l,a,s)});let R=r&&r.loaderData&&l.id in r.loaderData,C=R?r?.loaderData?.[l.id]:void 0,x=r&&r.errors&&l.id in r.errors,P=x?r?.errors?.[l.id]:void 0,D=s==null&&(u.clientLoader?.hydrate===!0||!l.hasLoader);y.loader=async({request:E,params:F,context:T,unstable_pattern:M},N)=>{try{return await g(async()=>(fe(u,"No `routeModule` available for critical-route loader"),u.clientLoader?u.clientLoader({request:E,params:F,context:T,unstable_pattern:M,async serverLoader(){if(Vt("loader",l),D){if(R)return C;if(x)throw P}return f(N)}}):f(N)))}finally{D=!1}},y.loader.hydrate=vr(l.id,u.clientLoader,l.hasLoader,n),y.action=({request:E,params:F,context:T,unstable_pattern:M},N)=>g(async()=>{if(fe(u,"No `routeModule` available for critical-route action"),!u.clientAction){if(n)throw Tr("clientAction",l.id);return m(N)}return u.clientAction({request:E,params:F,context:T,unstable_pattern:M,async serverAction(){return Vt("action",l),m(N)}})})}else{l.hasClientLoader||(y.loader=(x,P)=>g(()=>f(P))),l.hasClientAction||(y.action=(x,P)=>g(()=>{if(n)throw Tr("clientAction",l.id);return m(P)}));let R;async function C(){return R?await R:(R=(async()=>{(l.clientLoaderModule||l.clientActionModule)&&await new Promise(P=>setTimeout(P,0));let x=eu(l,t);return h(l),await x})(),await R)}y.lazy={loader:l.hasClientLoader?async()=>{let{clientLoader:x}=l.clientLoaderModule?await import(l.clientLoaderModule):await C();return fe(x,"No `clientLoader` export found"),(P,D)=>x({...P,async serverLoader(){return Vt("loader",l),f(D)}})}:void 0,action:l.hasClientAction?async()=>{let x=l.clientActionModule?import(l.clientActionModule):C();h(l);let{clientAction:P}=await x;return fe(P,"No `clientAction` export found"),(D,E)=>P({...D,async serverAction(){return Vt("action",l),m(E)}})}:void 0,middleware:l.hasClientMiddleware?async()=>{let{clientMiddleware:x}=l.clientMiddlewareModule?await import(l.clientMiddlewareModule):await C();return fe(x,"No `clientMiddleware` export found"),x}:void 0,shouldRevalidate:async()=>{let x=await C();return hn(y.path,x,l,a,s)},handle:async()=>(await C()).handle,Component:async()=>(await C()).Component,ErrorBoundary:l.hasErrorBoundary?async()=>(await C()).ErrorBoundary:void 0}}let w=yr(e,t,r,a,n,l.id,i,s);return w.length>0&&(y.children=w),y})}function hn(e,t,r,a,n){if(n)return Zs(r.id,t.shouldRevalidate,n);if(!a&&r.hasLoader&&!r.hasClientLoader){let o=e?On(e)[1].map(s=>s.paramName):[];const i=s=>o.some(l=>s.currentParams[l]!==s.nextParams[l]);if(t.shouldRevalidate){let s=t.shouldRevalidate;return l=>s({...l,defaultShouldRevalidate:i(l)})}else return s=>i(s)}if(a&&t.shouldRevalidate){let o=t.shouldRevalidate;return i=>o({...i,defaultShouldRevalidate:!0})}return t.shouldRevalidate}function Zs(e,t,r){let a=!1;return n=>a?t?t(n):n.defaultShouldRevalidate:(a=!0,r.has(e))}async function eu(e,t){let r=No(e,t),a=Vs(e),n=await r;return await Promise.all([a,$o(e,n)]),{Component:zo(n),ErrorBoundary:n.ErrorBoundary,clientMiddleware:n.clientMiddleware,clientAction:n.clientAction,clientLoader:n.clientLoader,handle:n.handle,links:n.links,meta:n.meta,shouldRevalidate:n.shouldRevalidate}}function zo(e){if(e.default==null)return;if(!(typeof e.default=="object"&&Object.keys(e.default).length===0))return e.default}function vr(e,t,r,a){return a&&e!=="root"||t!=null&&(t.hydrate===!0||r!==!0)}var Qt=new Set,tu=1e3,rr=new Set,ru=7680;function Ra(e,t){return e.mode==="lazy"&&t===!0}function au({sri:e,...t},r){let a=new Set(r.state.matches.map(s=>s.route.id)),n=r.state.location.pathname.split("/").filter(Boolean),o=["/"];for(n.pop();n.length>0;)o.push(`/${n.join("/")}`),n.pop();o.forEach(s=>{let l=ge(r.routes,s,r.basename);l&&l.forEach(u=>a.add(u.route.id))});let i=[...a].reduce((s,l)=>Object.assign(s,{[l]:t.routes[l]}),{});return{...t,routes:i,sri:e?!0:void 0}}function nu(e,t,r,a,n,o){if(Ra(a,r))return async({path:i,patch:s,signal:l,fetcherKey:u})=>{rr.has(i)||await Wo([i],u?window.location.href:i,e,t,r,n,o,a.manifestPath,s,l)}}function ou(e,t,r,a,n,o){d.useEffect(()=>{if(!Ra(n,a)||window.navigator?.connection?.saveData===!0)return;function i(c){let f=c.tagName==="FORM"?c.getAttribute("action"):c.getAttribute("href");if(!f)return;let m=c.tagName==="A"?c.pathname:new URL(f,window.location.origin).pathname;rr.has(m)||Qt.add(m)}async function s(){document.querySelectorAll("a[data-discover], form[data-discover]").forEach(i);let c=Array.from(Qt.keys()).filter(f=>rr.has(f)?(Qt.delete(f),!1):!0);if(c.length!==0)try{await Wo(c,null,t,r,a,o,e.basename,n.manifestPath,e.patchRoutes)}catch(f){console.error("Failed to fetch manifest patches",f)}}let l=lu(s,100);s();let u=new MutationObserver(()=>l());return u.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["data-discover","href","action"]}),()=>u.disconnect()},[a,o,t,r,e,n])}function Bo(e,t){let r=e||"/__manifest";return t==null?r:`${t}${r}`.replace(/\/+/g,"/")}var Mr="react-router-manifest-version";async function Wo(e,t,r,a,n,o,i,s,l,u){const c=new URLSearchParams;c.set("paths",e.sort().join(",")),c.set("version",r.version);let f=new URL(Bo(s,i),window.location.origin);if(f.search=c.toString(),f.toString().length>ru){Qt.clear();return}let m;try{let y=await fetch(f,{signal:u});if(y.ok){if(y.status===204&&y.headers.has("X-Remix-Reload-Document")){if(!t){console.warn("Detected a manifest version mismatch during eager route discovery. The next navigation/fetch to an undiscovered route will result in a new document navigation to sync up with the latest manifest.");return}try{if(sessionStorage.getItem(Mr)===r.version){console.error("Unable to discover routes due to manifest version mismatch.");return}sessionStorage.setItem(Mr,r.version)}catch{}window.location.href=t,console.warn("Detected manifest version mismatch, reloading..."),await new Promise(()=>{})}else if(y.status>=400)throw new Error(await y.text())}else throw new Error(`${y.status} ${y.statusText}`);try{sessionStorage.removeItem(Mr)}catch{}m=await y.json()}catch(y){if(u?.aborted)return;throw y}let p=new Set(Object.keys(r.routes)),h=Object.values(m).reduce((y,w)=>(w&&!p.has(w.id)&&(y[w.id]=w),y),{});Object.assign(r.routes,h),e.forEach(y=>iu(y,rr));let g=new Set;Object.values(h).forEach(y=>{y&&(!y.parentId||!h[y.parentId])&&g.add(y.parentId)}),g.forEach(y=>l(y||null,yr(h,a,null,n,o,y)))}function iu(e,t){if(t.size>=tu){let r=t.values().next().value;t.delete(r)}t.add(e)}function lu(e,t){let r;return(...a)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...a),t)}}function Ea(){let e=d.useContext(Ie);return fe(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function gr(){let e=d.useContext(at);return fe(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Je=d.createContext(void 0);Je.displayName="FrameworkContext";function wt(){let e=d.useContext(Je);return fe(e,"You must render this element inside a <HydratedRouter> element"),e}function su(e,t){let r=d.useContext(Je),[a,n]=d.useState(!1),[o,i]=d.useState(!1),{onFocus:s,onBlur:l,onMouseEnter:u,onMouseLeave:c,onTouchStart:f}=t,m=d.useRef(null);d.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let g=w=>{w.forEach(R=>{i(R.isIntersecting)})},y=new IntersectionObserver(g,{threshold:.5});return m.current&&y.observe(m.current),()=>{y.disconnect()}}},[e]),d.useEffect(()=>{if(a){let g=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(g)}}},[a]);let p=()=>{n(!0)},h=()=>{n(!1),i(!1)};return r?e!=="intent"?[o,m,{}]:[o,m,{onFocus:Pt(s,p),onBlur:Pt(l,h),onMouseEnter:Pt(u,p),onMouseLeave:Pt(c,h),onTouchStart:Pt(f,p)}]:[!1,m,{}]}function Pt(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function ba(e,t,r){if(r&&!ar)return[e[0]];if(t){let a=e.findIndex(n=>t[n.route.id]!==void 0);return e.slice(0,a+1)}return e}var mn="data-react-router-critical-css";function jc({nonce:e}){let{isSpaMode:t,manifest:r,routeModules:a,criticalCss:n}=wt(),{errors:o,matches:i}=gr(),s=ba(i,o,t),l=d.useMemo(()=>Ws(s,a,r),[s,a,r]);return d.createElement(d.Fragment,null,typeof n=="string"?d.createElement("style",{[mn]:"",dangerouslySetInnerHTML:{__html:n}}):null,typeof n=="object"?d.createElement("link",{[mn]:"",rel:"stylesheet",href:n.href,nonce:e}):null,l.map(({key:u,link:c})=>va(c)?d.createElement(Vo,{key:u,nonce:e,...c}):d.createElement("link",{key:u,nonce:e,...c})))}function Vo({page:e,...t}){let{router:r}=Ea(),a=d.useMemo(()=>ge(r.routes,e,r.basename),[r.routes,e,r.basename]);return a?d.createElement(cu,{page:e,matches:a,...t}):null}function uu(e){let{manifest:t,routeModules:r}=wt(),[a,n]=d.useState([]);return d.useEffect(()=>{let o=!1;return Js(e,t,r).then(i=>{o||n(i)}),()=>{o=!0}},[e,t,r]),a}function cu({page:e,matches:t,...r}){let a=Ee(),{manifest:n,routeModules:o}=wt(),{basename:i}=Ea(),{loaderData:s,matches:l}=gr(),u=d.useMemo(()=>fn(e,t,l,n,a,"data"),[e,t,l,n,a]),c=d.useMemo(()=>fn(e,t,l,n,a,"assets"),[e,t,l,n,a]),f=d.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let h=new Set,g=!1;if(t.forEach(w=>{let R=n.routes[w.route.id];!R||!R.hasLoader||(!u.some(C=>C.route.id===w.route.id)&&w.route.id in s&&o[w.route.id]?.shouldRevalidate||R.hasClientLoader?g=!0:h.add(w.route.id))}),h.size===0)return[];let y=Oo(e,i,"data");return g&&h.size>0&&y.searchParams.set("_routes",t.filter(w=>h.has(w.route.id)).map(w=>w.route.id).join(",")),[y.pathname+y.search]},[i,s,a,n,u,t,e,o]),m=d.useMemo(()=>ga(c,n),[c,n]),p=uu(c);return d.createElement(d.Fragment,null,f.map(h=>d.createElement("link",{key:h,rel:"prefetch",as:"fetch",href:h,...r})),m.map(h=>d.createElement("link",{key:h,rel:"modulepreload",href:h,...r})),p.map(({key:h,link:g})=>d.createElement("link",{key:h,nonce:r.nonce,...g})))}function Uc(){let{isSpaMode:e,routeModules:t}=wt(),{errors:r,matches:a,loaderData:n}=gr(),o=Ee(),i=ba(a,r,e),s=null;r&&(s=r[i[i.length-1].route.id]);let l=[],u=null,c=[];for(let f=0;f<i.length;f++){let m=i[f],p=m.route.id,h=n[p],g=m.params,y=t[p],w=[],R={id:p,data:h,loaderData:h,meta:[],params:m.params,pathname:m.pathname,handle:m.route.handle,error:s};if(c[f]=R,y?.meta?w=typeof y.meta=="function"?y.meta({data:h,loaderData:h,params:g,location:o,matches:c,error:s}):Array.isArray(y.meta)?[...y.meta]:y.meta:u&&(w=[...u]),w=w||[],!Array.isArray(w))throw new Error("The route at "+m.route.path+` returns an invalid value. All route meta functions must return an array of meta objects.
|
|
21
|
+
|
|
22
|
+
To reference the meta function API, see https://remix.run/route/meta`);R.meta=w,c[f]=R,l=[...w],u=l}return d.createElement(d.Fragment,null,l.flat().map(f=>{if(!f)return null;if("tagName"in f){let{tagName:m,...p}=f;if(!du(m))return console.warn(`A meta object uses an invalid tagName: ${m}. Expected either 'link' or 'meta'`),null;let h=m;return d.createElement(h,{key:JSON.stringify(p),...p})}if("title"in f)return d.createElement("title",{key:"title"},String(f.title));if("charset"in f&&(f.charSet??(f.charSet=f.charset),delete f.charset),"charSet"in f&&f.charSet!=null)return typeof f.charSet=="string"?d.createElement("meta",{key:"charSet",charSet:f.charSet}):null;if("script:ld+json"in f)try{let m=JSON.stringify(f["script:ld+json"]);return d.createElement("script",{key:`script:ld+json:${m}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:ma(m)}})}catch{return null}return d.createElement("meta",{key:JSON.stringify(f),...f})}))}function du(e){return typeof e=="string"&&/^(meta|link)$/.test(e)}var ar=!1;function fu(){ar=!0}function hu(e){let{manifest:t,serverHandoffString:r,isSpaMode:a,renderMeta:n,routeDiscovery:o,ssr:i}=wt(),{router:s,static:l,staticContext:u}=Ea(),{matches:c}=gr(),f=zl(),m=Ra(o,i);n&&(n.didRenderScripts=!0);let p=ba(c,null,a);d.useEffect(()=>{fu()},[]);let h=d.useMemo(()=>{if(f)return null;let R=u?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",C=l?`${t.hmr?.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${m?"":`import ${JSON.stringify(t.url)}`};
|
|
23
|
+
${p.map((x,P)=>{let D=`route${P}`,E=t.routes[x.route.id];fe(E,`Route ${x.route.id} not found in manifest`);let{clientActionModule:F,clientLoaderModule:T,clientMiddlewareModule:M,hydrateFallbackModule:N,module:Y}=E,G=[...F?[{module:F,varName:`${D}_clientAction`}]:[],...T?[{module:T,varName:`${D}_clientLoader`}]:[],...M?[{module:M,varName:`${D}_clientMiddleware`}]:[],...N?[{module:N,varName:`${D}_HydrateFallback`}]:[],{module:Y,varName:`${D}_main`}];if(G.length===1)return`import * as ${D} from ${JSON.stringify(Y)};`;let B=G.map(le=>`import * as ${le.varName} from "${le.module}";`).join(`
|
|
24
|
+
`),K=`const ${D} = {${G.map(le=>`...${le.varName}`).join(",")}};`;return[B,K].join(`
|
|
25
|
+
`)}).join(`
|
|
26
|
+
`)}
|
|
27
|
+
${m?`window.__reactRouterManifest = ${JSON.stringify(au(t,s),null,2)};`:""}
|
|
28
|
+
window.__reactRouterRouteModules = {${p.map((x,P)=>`${JSON.stringify(x.route.id)}:route${P}`).join(",")}};
|
|
29
|
+
|
|
30
|
+
import(${JSON.stringify(t.entry.module)});`:" ";return d.createElement(d.Fragment,null,d.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:R},type:void 0}),d.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:C},type:"module",async:!0}))},[]),g=ar||f?[]:mu(t.entry.imports.concat(ga(p,t,{includeHydrateFallback:!0}))),y=typeof t.sri=="object"?t.sri:{};return Mt(!f,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),ar||f?null:d.createElement(d.Fragment,null,typeof t.sri=="object"?d.createElement("script",{"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:y})}}):null,m?null:d.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:y[t.url],suppressHydrationWarning:!0}),d.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:y[t.entry.module],suppressHydrationWarning:!0}),g.map(w=>d.createElement("link",{key:w,rel:"modulepreload",href:w,crossOrigin:e.crossOrigin,integrity:y[w],suppressHydrationWarning:!0})),h)}function mu(e){return[...new Set(e)]}function pu(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var Yo=class extends d.Component{constructor(e){super(e),this.state={error:e.error||null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error||null,location:e.location}:{error:e.error||t.error,location:t.location}}render(){return this.state.error?d.createElement(Jo,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function Jo({error:e,isOutsideRemixApp:t}){console.error(e);let r=d.createElement("script",{dangerouslySetInnerHTML:{__html:`
|
|
31
|
+
console.log(
|
|
32
|
+
"💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
|
|
33
|
+
);
|
|
34
|
+
`}});if(re(e))return d.createElement(Yr,{title:"Unhandled Thrown Response!"},d.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),r);let a;if(e instanceof Error)a=e;else{let n=e==null?"Unknown Error":typeof e=="object"&&"toString"in e?e.toString():JSON.stringify(e);a=new Error(n)}return d.createElement(Yr,{title:"Application Error!",isOutsideRemixApp:t},d.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),d.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},a.stack),r)}function Yr({title:e,renderScripts:t,isOutsideRemixApp:r,children:a}){let{routeModules:n}=wt();return n.root?.Layout&&!r?a:d.createElement("html",{lang:"en"},d.createElement("head",null,d.createElement("meta",{charSet:"utf-8"}),d.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),d.createElement("title",null,e)),d.createElement("body",null,d.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},a,t?d.createElement(hu,null):null)))}var Ko=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Ko&&(window.__reactRouterVersion="7.9.5")}catch{}function zc(e,t){return ur({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:qr({window:t?.window}),hydrationData:t?.hydrationData||Xo(),routes:e,mapRouteProperties:gt,hydrationRouteProperties:mr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function Bc(e,t){return ur({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:Ln({window:t?.window}),hydrationData:t?.hydrationData||Xo(),routes:e,mapRouteProperties:gt,hydrationRouteProperties:mr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function Xo(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:yu(e.errors)}),e}function yu(e){if(!e)return null;let t=Object.entries(e),r={};for(let[a,n]of t)if(n&&n.__type==="RouteErrorResponse")r[a]=new pe(n.status,n.statusText,n.data,n.internal===!0);else if(n&&n.__type==="Error"){if(n.__subType){let o=window[n.__subType];if(typeof o=="function")try{let i=new o(n.message);i.stack="",r[a]=i}catch{}}if(r[a]==null){let o=new Error(n.message);o.stack="",r[a]=o}}else r[a]=n;return r}function Wc({basename:e,children:t,window:r}){let a=d.useRef();a.current==null&&(a.current=qr({window:r,v5Compat:!0}));let n=a.current,[o,i]=d.useState({action:n.action,location:n.location}),s=d.useCallback(l=>{d.startTransition(()=>i(l))},[i]);return d.useLayoutEffect(()=>n.listen(s),[n,s]),d.createElement(ot,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:n})}function Vc({basename:e,children:t,window:r}){let a=d.useRef();a.current==null&&(a.current=Ln({window:r,v5Compat:!0}));let n=a.current,[o,i]=d.useState({action:n.action,location:n.location}),s=d.useCallback(l=>{d.startTransition(()=>i(l))},[i]);return d.useLayoutEffect(()=>n.listen(s),[n,s]),d.createElement(ot,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:n})}function vu({basename:e,children:t,history:r}){let[a,n]=d.useState({action:r.action,location:r.location}),o=d.useCallback(i=>{d.startTransition(()=>n(i))},[n]);return d.useLayoutEffect(()=>r.listen(o),[r,o]),d.createElement(ot,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:r})}vu.displayName="unstable_HistoryRouter";var Go=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qo=d.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:n,reloadDocument:o,replace:i,state:s,target:l,to:u,preventScrollReset:c,viewTransition:f,...m},p){let{basename:h}=d.useContext(we),g=typeof u=="string"&&Go.test(u),y,w=!1;if(typeof u=="string"&&g&&(y=u,Ko))try{let T=new URL(window.location.href),M=u.startsWith("//")?new URL(T.protocol+u):new URL(u),N=ne(M.pathname,h);M.origin===T.origin&&N!=null?u=N+M.search+M.hash:w=!0}catch{X(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let R=Bl(u,{relative:n}),[C,x,P]=su(a,m),D=Ru(u,{replace:i,state:s,target:l,preventScrollReset:c,relative:n,viewTransition:f});function E(T){t&&t(T),T.defaultPrevented||D(T)}let F=d.createElement("a",{...m,...P,href:y||R,onClick:w||o?t:E,ref:pu(p,x),target:l,"data-discover":!g&&r==="render"?"true":void 0});return C&&!g?d.createElement(d.Fragment,null,F,d.createElement(Vo,{page:R})):F});Qo.displayName="Link";var gu=d.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:n=!1,style:o,to:i,viewTransition:s,children:l,...u},c){let f=Ot(i,{relative:u.relative}),m=Ee(),p=d.useContext(at),{navigator:h,basename:g}=d.useContext(we),y=p!=null&&Pu(f)&&s===!0,w=h.encodeLocation?h.encodeLocation(f).pathname:f.pathname,R=m.pathname,C=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;r||(R=R.toLowerCase(),C=C?C.toLowerCase():null,w=w.toLowerCase()),C&&g&&(C=ne(C,g)||C);const x=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let P=R===w||!n&&R.startsWith(w)&&R.charAt(x)==="/",D=C!=null&&(C===w||!n&&C.startsWith(w)&&C.charAt(w.length)==="/"),E={isActive:P,isPending:D,isTransitioning:y},F=P?t:void 0,T;typeof a=="function"?T=a(E):T=[a,P?"active":null,D?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let M=typeof o=="function"?o(E):o;return d.createElement(Qo,{...u,"aria-current":F,className:T,ref:c,style:M,to:i,viewTransition:s},typeof l=="function"?l(E):l)});gu.displayName="NavLink";var qo=d.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:i=Xt,action:s,onSubmit:l,relative:u,preventScrollReset:c,viewTransition:f,...m},p)=>{let h=ei(),g=Su(s,{relative:u}),y=i.toLowerCase()==="get"?"get":"post",w=typeof s=="string"&&Go.test(s),R=C=>{if(l&&l(C),C.defaultPrevented)return;C.preventDefault();let x=C.nativeEvent.submitter,P=x?.getAttribute("formmethod")||i;h(x||C.currentTarget,{fetcherKey:t,method:P,navigate:r,replace:n,state:o,relative:u,preventScrollReset:c,viewTransition:f})};return d.createElement("form",{ref:p,method:y,action:g,onSubmit:a?l:R,...m,"data-discover":!w&&e==="render"?"true":void 0})});qo.displayName="Form";function wu({getKey:e,storageKey:t,...r}){let a=d.useContext(Je),{basename:n}=d.useContext(we),o=Ee(),i=ca();Cu({getKey:e,storageKey:t});let s=d.useMemo(()=>{if(!a||!e)return null;let u=Kr(o,i,n,e);return u!==o.key?u:null},[]);if(!a||a.isSpaMode)return null;let l=((u,c)=>{if(!window.history.state||!window.history.state.key){let f=Math.random().toString(32).slice(2);window.history.replaceState({key:f},"")}try{let m=JSON.parse(sessionStorage.getItem(u)||"{}")[c||window.history.state.key];typeof m=="number"&&window.scrollTo(0,m)}catch(f){console.error(f),sessionStorage.removeItem(u)}}).toString();return d.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${JSON.stringify(t||Jr)}, ${JSON.stringify(s)})`}})}wu.displayName="ScrollRestoration";function Zo(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wr(e){let t=d.useContext(Ie);return A(t,Zo(e)),t}function Sa(e){let t=d.useContext(at);return A(t,Zo(e)),t}function Ru(e,{target:t,replace:r,state:a,preventScrollReset:n,relative:o,viewTransition:i}={}){let s=oa(),l=Ee(),u=Ot(e,{relative:o});return d.useCallback(c=>{if(ws(c,t)){c.preventDefault();let f=r!==void 0?r:he(l)===he(u);s(e,{replace:f,state:a,preventScrollReset:n,relative:o,viewTransition:i})}},[l,s,u,r,a,t,e,n,o,i])}function Yc(e){X(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=d.useRef(Ur(e)),r=d.useRef(!1),a=Ee(),n=d.useMemo(()=>Rs(a.search,r.current?null:t.current),[a.search]),o=oa(),i=d.useCallback((s,l)=>{const u=Ur(typeof s=="function"?s(new URLSearchParams(n)):s);r.current=!0,o("?"+u,l)},[o,n]);return[n,i]}var Eu=0,bu=()=>`__${String(++Eu)}__`;function ei(){let{router:e}=wr("useSubmit"),{basename:t}=d.useContext(we),r=ql();return d.useCallback(async(a,n={})=>{let{action:o,method:i,encType:s,formData:l,body:u}=Ss(a,t);if(n.navigate===!1){let c=n.fetcherKey||bu();await e.fetch(c,r,n.action||o,{preventScrollReset:n.preventScrollReset,formData:l,body:u,formMethod:n.method||i,formEncType:n.encType||s,flushSync:n.flushSync})}else await e.navigate(n.action||o,{preventScrollReset:n.preventScrollReset,formData:l,body:u,formMethod:n.method||i,formEncType:n.encType||s,replace:n.replace,state:n.state,fromRouteId:r,flushSync:n.flushSync,viewTransition:n.viewTransition})},[e,t,r])}function Su(e,{relative:t}={}){let{basename:r}=d.useContext(we),a=d.useContext(Re);A(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o={...Ot(e||".",{relative:t})},i=Ee();if(e==null){o.search=i.search;let s=new URLSearchParams(o.search),l=s.getAll("index");if(l.some(c=>c==="")){s.delete("index"),l.filter(f=>f).forEach(f=>s.append("index",f));let c=s.toString();o.search=c?`?${c}`:""}}return(!e||e===".")&&n.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Me([r,o.pathname])),he(o)}function Jc({key:e}={}){let{router:t}=wr("useFetcher"),r=Sa("useFetcher"),a=d.useContext(fr),n=d.useContext(Re),o=n.matches[n.matches.length-1]?.route.id;A(a,"useFetcher must be used inside a FetchersContext"),A(n,"useFetcher must be used inside a RouteContext"),A(o!=null,'useFetcher can only be used on routes that contain a unique "id"');let i=d.useId(),[s,l]=d.useState(e||i);e&&e!==s&&l(e),d.useEffect(()=>(t.getFetcher(s),()=>t.deleteFetcher(s)),[t,s]);let u=d.useCallback(async(w,R)=>{A(o,"No routeId available for fetcher.load()"),await t.fetch(s,o,w,R)},[s,o,t]),c=ei(),f=d.useCallback(async(w,R)=>{await c(w,{...R,navigate:!1,fetcherKey:s})},[s,c]),m=d.useCallback(w=>t.resetFetcher(s,w),[t,s]),p=d.useMemo(()=>{let w=d.forwardRef((R,C)=>d.createElement(qo,{...R,navigate:!1,fetcherKey:s,ref:C}));return w.displayName="fetcher.Form",w},[s]),h=r.fetchers.get(s)||Zr,g=a.get(s);return d.useMemo(()=>({Form:p,submit:f,load:u,unstable_reset:m,...h,data:g}),[p,f,u,m,h,g])}function Kc(){let e=Sa("useFetchers");return Array.from(e.fetchers.entries()).map(([t,r])=>({...r,key:t}))}var Jr="react-router-scroll-positions",Yt={};function Kr(e,t,r,a){let n=null;return a&&(r!=="/"?n=a({...e,pathname:ne(e.pathname,r)||e.pathname},t):n=a(e,t)),n==null&&(n=e.key),n}function Cu({getKey:e,storageKey:t}={}){let{router:r}=wr("useScrollRestoration"),{restoreScrollPosition:a,preventScrollReset:n}=Sa("useScrollRestoration"),{basename:o}=d.useContext(we),i=Ee(),s=ca(),l=Zl();d.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),xu(d.useCallback(()=>{if(l.state==="idle"){let u=Kr(i,s,o,e);Yt[u]=window.scrollY}try{sessionStorage.setItem(t||Jr,JSON.stringify(Yt))}catch(u){X(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[l.state,e,o,i,s,t])),typeof document<"u"&&(d.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||Jr);u&&(Yt=JSON.parse(u))}catch{}},[t]),d.useLayoutEffect(()=>{let u=r?.enableScrollRestoration(Yt,()=>window.scrollY,e?(c,f)=>Kr(c,f,o,e):void 0);return()=>u&&u()},[r,o,e]),d.useLayoutEffect(()=>{if(a!==!1){if(typeof a=="number"){window.scrollTo(0,a);return}try{if(i.hash){let u=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{X(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}n!==!0&&window.scrollTo(0,0)}},[i,a,n]))}function Xc(e,t){let{capture:r}=t||{};d.useEffect(()=>{let a=r!=null?{capture:r}:void 0;return window.addEventListener("beforeunload",e,a),()=>{window.removeEventListener("beforeunload",e,a)}},[e,r])}function xu(e,t){let{capture:r}={};d.useEffect(()=>{let a=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,a),()=>{window.removeEventListener("pagehide",e,a)}},[e,r])}function Gc({when:e,message:t}){let r=rs(e);d.useEffect(()=>{r.state==="blocked"&&(window.confirm(t)?setTimeout(r.proceed,0):r.reset())},[r,t]),d.useEffect(()=>{r.state==="blocked"&&!e&&r.reset()},[r,e])}function Pu(e,{relative:t}={}){let r=d.useContext(dr);A(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=wr("useViewTransitionState"),n=Ot(e,{relative:t});if(!r.isTransitioning)return!1;let o=ne(r.currentLocation.pathname,a)||r.currentLocation.pathname,i=ne(r.nextLocation.pathname,a)||r.nextLocation.pathname;return _t(n.pathname,i)!=null||_t(n.pathname,o)!=null}function Qc({basename:e,children:t,location:r="/"}){typeof r=="string"&&(r=Pe(r));let a="POP",n={pathname:r.pathname||"/",search:r.search||"",hash:r.hash||"",state:r.state!=null?r.state:null,key:r.key||"default"},o=ri();return d.createElement(ot,{basename:e,children:t,location:n,navigationType:a,navigator:o,static:!0})}function ti({context:e,router:t,hydrate:r=!0,nonce:a}){A(t&&e,"You must provide `router` and `context` to <StaticRouterProvider>");let n={router:t,navigator:ri(),static:!0,staticContext:e,basename:e.basename||"/"},o=new Map,i="";if(r!==!1){let l={loaderData:e.loaderData,actionData:e.actionData,errors:Lu(e.errors)};i=`window.__staticRouterHydrationData = JSON.parse(${Fu(JSON.stringify(JSON.stringify(l)))});`}let{state:s}=n.router;return d.createElement(d.Fragment,null,d.createElement(Ie.Provider,{value:n},d.createElement(at.Provider,{value:s},d.createElement(fr.Provider,{value:o},d.createElement(dr.Provider,{value:{isTransitioning:!1}},d.createElement(ot,{basename:n.basename,location:s.location,navigationType:s.historyAction,navigator:n.navigator,static:n.static},d.createElement(Du,{routes:t.routes,future:t.future,state:s})))))),i?d.createElement("script",{suppressHydrationWarning:!0,nonce:a,dangerouslySetInnerHTML:{__html:i}}):null)}function Du({routes:e,future:t,state:r}){return la(e,void 0,r,void 0,t)}function Lu(e){if(!e)return null;let t=Object.entries(e),r={};for(let[a,n]of t)re(n)?r[a]={...n,__type:"RouteErrorResponse"}:n instanceof Error?r[a]={message:n.message,__type:"Error",...n.name!=="Error"?{__subType:n.name}:{}}:r[a]=n;return r}function ri(){return{createHref:ni,encodeLocation:oi,push(e){throw new Error(`You cannot use navigator.push() on the server because it is a stateless environment. This error was probably triggered when you did a \`navigate(${JSON.stringify(e)})\` somewhere in your app.`)},replace(e){throw new Error(`You cannot use navigator.replace() on the server because it is a stateless environment. This error was probably triggered when you did a \`navigate(${JSON.stringify(e)}, { replace: true })\` somewhere in your app.`)},go(e){throw new Error(`You cannot use navigator.go() on the server because it is a stateless environment. This error was probably triggered when you did a \`navigate(${e})\` somewhere in your app.`)},back(){throw new Error("You cannot use navigator.back() on the server because it is a stateless environment.")},forward(){throw new Error("You cannot use navigator.forward() on the server because it is a stateless environment.")}}}function qc(e,t){return Yn(e,{...t,mapRouteProperties:gt})}function ai(e,t,r={}){let a={},n=Ve(e,gt,void 0,a),o=t.matches.map(s=>{let l=a[s.route.id]||s.route;return{...s,route:l}}),i=s=>`You cannot use router.${s}() on the server because it is a stateless environment`;return{get basename(){return t.basename},get future(){return{v8_middleware:!1,...r?.future}},get state(){return{historyAction:"POP",location:t.location,matches:o,loaderData:t.loaderData,actionData:t.actionData,errors:t.errors,initialized:!0,navigation:Kt,restoreScrollPosition:null,preventScrollReset:!1,revalidation:"idle",fetchers:new Map,blockers:new Map}},get routes(){return n},get window(){},initialize(){throw i("initialize")},subscribe(){throw i("subscribe")},enableScrollRestoration(){throw i("enableScrollRestoration")},navigate(){throw i("navigate")},fetch(){throw i("fetch")},revalidate(){throw i("revalidate")},createHref:ni,encodeLocation:oi,getFetcher(){return Zr},deleteFetcher(){throw i("deleteFetcher")},resetFetcher(){throw i("resetFetcher")},dispose(){throw i("dispose")},getBlocker(){return tt},deleteBlocker(){throw i("deleteBlocker")},patchRoutes(){throw i("patchRoutes")},_internalFetchControllers:new Map,_internalSetRoutes(){throw i("_internalSetRoutes")},_internalSetStateDoNotUseOrYouWillBreakYourApp(){throw i("_internalSetStateDoNotUseOrYouWillBreakYourApp")}}}function ni(e){return typeof e=="string"?e:he(e)}function oi(e){let t=typeof e=="string"?e:he(e);t=t.replace(/ $/,"%20");let r=_u.test(t)?new URL(t):new URL(t,"http://localhost");return{pathname:r.pathname,search:r.search,hash:r.hash}}var _u=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Tu={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},Mu=/[&><\u2028\u2029]/g;function Fu(e){return e.replace(Mu,t=>Tu[t])}var ku={};function Zc({context:e,url:t,nonce:r}){typeof t=="string"&&(t=new URL(t));let{manifest:a,routeModules:n,criticalCss:o,serverHandoffString:i}=e,s=Uo(a.routes,n,e.future,e.isSpaMode);e.staticHandlerContext.loaderData={...e.staticHandlerContext.loaderData};for(let u of e.staticHandlerContext.matches){let c=u.route.id,f=n[c],m=e.manifest.routes[c];f&&m&&vr(c,f.clientLoader,m.hasLoader,e.isSpaMode)&&(f.HydrateFallback||!m.hasLoader)&&delete e.staticHandlerContext.loaderData[c]}let l=ai(s,e.staticHandlerContext);return d.createElement(d.Fragment,null,d.createElement(Je.Provider,{value:{manifest:a,routeModules:n,criticalCss:o,serverHandoffString:i,future:e.future,ssr:e.ssr,isSpaMode:e.isSpaMode,routeDiscovery:e.routeDiscovery,serializeError:e.serializeError,renderMeta:e.renderMeta}},d.createElement(Yo,{location:l.state.location},d.createElement(ti,{router:l,context:e.staticHandlerContext,hydrate:!1}))),e.serverHandoffStream?d.createElement(d.Suspense,null,d.createElement(ko,{context:e,identifier:0,reader:e.serverHandoffStream.getReader(),textDecoder:new TextDecoder,nonce:r})):null)}function ed(e,t){return function({initialEntries:a,initialIndex:n,hydrationData:o,future:i}){let s=d.useRef(),l=d.useRef();if(s.current==null){l.current={future:{unstable_subResourceIntegrity:i?.unstable_subResourceIntegrity===!0,v8_middleware:i?.v8_middleware===!0},manifest:{routes:{},entry:{imports:[],module:""},url:"",version:""},routeModules:{},ssr:!1,isSpaMode:!1,routeDiscovery:{mode:"lazy",manifestPath:"/__manifest"}};let u=ii(Ve(e,c=>c),t!==void 0?t:i?.v8_middleware?new Ae:{},l.current.manifest,l.current.routeModules);s.current=ns(u,{initialEntries:a,initialIndex:n,hydrationData:o})}return d.createElement(Je.Provider,{value:l.current},d.createElement(mo,{router:s.current}))}}function ii(e,t,r,a,n){return e.map(o=>{if(!o.id)throw new Error("Expected a route.id in react-router processRoutes() function");let i={id:o.id,path:o.path,index:o.index,Component:o.Component?fs(o.Component):void 0,HydrateFallback:o.HydrateFallback?hs(o.HydrateFallback):void 0,ErrorBoundary:o.ErrorBoundary?ms(o.ErrorBoundary):void 0,action:o.action?l=>o.action({...l,context:t}):void 0,loader:o.loader?l=>o.loader({...l,context:t}):void 0,middleware:o.middleware?o.middleware.map(l=>(...u)=>l({...u[0],context:t},u[1])):void 0,handle:o.handle,shouldRevalidate:o.shouldRevalidate},s={id:o.id,path:o.path,index:o.index,parentId:n,hasAction:o.action!=null,hasLoader:o.loader!=null,hasClientAction:!1,hasClientLoader:!1,hasClientMiddleware:!1,hasErrorBoundary:o.ErrorBoundary!=null,module:"build/stub-path-to-module.js",clientActionModule:void 0,clientLoaderModule:void 0,clientMiddlewareModule:void 0,hydrateFallbackModule:void 0};return r.routes[i.id]=s,a[o.id]={default:i.Component||ss,ErrorBoundary:i.ErrorBoundary||void 0,handle:o.handle,links:o.links,meta:o.meta,shouldRevalidate:o.shouldRevalidate},o.children&&(i.children=ii(o.children,t,r,a,i.id)),i})}var Ca=new TextEncoder,Ou=async(e,t)=>{let r=Ca.encode(e),a=await li(t,["sign"]),n=await crypto.subtle.sign("HMAC",a,r),o=btoa(String.fromCharCode(...new Uint8Array(n))).replace(/=+$/,"");return e+"."+o},Nu=async(e,t)=>{let r=e.lastIndexOf("."),a=e.slice(0,r),n=e.slice(r+1),o=Ca.encode(a),i=await li(t,["verify"]);try{let s=Au(atob(n));return await crypto.subtle.verify("HMAC",i,s,o)?a:!1}catch{return!1}},li=async(e,t)=>crypto.subtle.importKey("raw",Ca.encode(e),{name:"HMAC",hash:"SHA-256"},!1,t);function Au(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}var si=(e,t={})=>{let{secrets:r=[],...a}={path:"/",sameSite:"lax",...t};return zu(e,a.expires),{get name(){return e},get isSigned(){return r.length>0},get expires(){return typeof a.maxAge<"u"?new Date(Date.now()+a.maxAge*1e3):a.expires},async parse(n,o){if(!n)return null;let i=Ha.parse(n,{...a,...o});if(e in i){let s=i[e];return typeof s=="string"&&s!==""?await Iu(s,r):""}else return null},async serialize(n,o){return Ha.serialize(e,n===""?"":await $u(n,r),{...a,...o})}}},ui=e=>e!=null&&typeof e.name=="string"&&typeof e.isSigned=="boolean"&&typeof e.parse=="function"&&typeof e.serialize=="function";async function $u(e,t){let r=Hu(e);return t.length>0&&(r=await Ou(r,t[0])),r}async function Iu(e,t){if(t.length>0){for(let r of t){let a=await Nu(e,r);if(a!==!1)return pn(a)}return null}return pn(e)}function Hu(e){return btoa(Uu(encodeURIComponent(JSON.stringify(e))))}function pn(e){try{return JSON.parse(decodeURIComponent(ju(atob(e))))}catch{return{}}}function ju(e){let t=e.toString(),r="",a=0,n,o;for(;a<t.length;)n=t.charAt(a++),/[\w*+\-./@]/.exec(n)?r+=n:(o=n.charCodeAt(0),o<256?r+="%"+yn(o,2):r+="%u"+yn(o,4).toUpperCase());return r}function yn(e,t){let r=e.toString(16);for(;r.length<t;)r="0"+r;return r}function Uu(e){let t=e.toString(),r="",a=0,n,o;for(;a<t.length;){if(n=t.charAt(a++),n==="%"){if(t.charAt(a)==="u"){if(o=t.slice(a+1,a+5),/^[\da-f]{4}$/i.exec(o)){r+=String.fromCharCode(parseInt(o,16)),a+=5;continue}}else if(o=t.slice(a,a+2),/^[\da-f]{2}$/i.exec(o)){r+=String.fromCharCode(parseInt(o,16)),a+=2;continue}}r+=n}return r}function zu(e,t){Mt(!t,`The "${e}" cookie has an "expires" property set. This will cause the expires value to not be updated when the session is committed. Instead, you should set the expires value when serializing the cookie. You can use \`commitSession(session, { expires })\` if using a session storage object, or \`cookie.serialize("value", { expires })\` if you're using the cookie directly.`)}function Bu(e){return Object.keys(e).reduce((t,r)=>{let a=e[r];return a&&(t[r]=a.module),t},{})}var Wu=(e=>(e.Development="development",e.Production="production",e.Test="test",e))(Wu||{});function Vu(e){return e==="development"||e==="production"||e==="test"}function Rr(e,t){if(e instanceof Error&&t!=="development"){let r=new Error("Unexpected Server Error");return r.stack=void 0,r}return e}function nr(e,t){return Object.entries(e).reduce((r,[a,n])=>Object.assign(r,{[a]:Rr(n,t)}),{})}function ci(e,t){let r=Rr(e,t);return{message:r.message,stack:r.stack}}function vn(e,t){if(!e)return null;let r=Object.entries(e),a={};for(let[n,o]of r)if(re(o))a[n]={...o,__type:"RouteErrorResponse"};else if(o instanceof Error){let i=Rr(o,t);a[n]={message:i.message,stack:i.stack,__type:"Error",...i.name!=="Error"?{__subType:i.name}:{}}}else a[n]=o;return a}function Xr(e,t,r){let a=ge(e,t,r);return a?a.map(n=>({params:n.params,pathname:n.pathname,route:n.route})):null}async function gn(e,t){let r=await e({request:Ju(Yu(t.request)),params:t.params,context:t.context,unstable_pattern:t.unstable_pattern});if(We(r)&&r.init&&r.init.status&&cr(r.init.status))throw new Response(null,r.init);return r}function Yu(e){let t=new URL(e.url),r=t.searchParams.getAll("index");t.searchParams.delete("index");let a=[];for(let o of r)o&&a.push(o);for(let o of a)t.searchParams.append("index",o);let n={method:e.method,body:e.body,headers:e.headers,signal:e.signal};return n.body&&(n.duplex="half"),new Request(t.href,n)}function Ju(e){let t=new URL(e.url);t.searchParams.delete("_routes");let r={method:e.method,body:e.body,headers:e.headers,signal:e.signal};return r.body&&(r.duplex="half"),new Request(t.href,r)}function qt(e,t){if(e===!1||e===null||typeof e>"u")throw console.error("The following error is a bug in React Router; please open an issue! https://github.com/remix-run/react-router/issues/new/choose"),new Error(t)}var di="__reactRouterDevServerHooks";function td(e){globalThis[di]=e}function Fr(){return globalThis[di]}function fi(e,t){if(typeof process<"u")try{if(ku?.IS_RR_BUILD_REQUEST==="yes")return e.headers.get(t)}catch{}return null}function hi(e){let t={};return Object.values(e).forEach(r=>{if(r){let a=r.parentId||"";t[a]||(t[a]=[]),t[a].push(r)}}),t}function mi(e,t="",r=hi(e)){return(r[t]||[]).map(a=>({...a,children:mi(e,a.id,r)}))}function pi(e,t,r="",a=hi(e)){return(a[r]||[]).map(n=>{let o={hasErrorBoundary:n.id==="root"||n.module.ErrorBoundary!=null,id:n.id,path:n.path,middleware:n.module.middleware,loader:n.module.loader?async i=>{let s=fi(i.request,"X-React-Router-Prerender-Data");if(s!=null){let u=s&&decodeURI(s);qt(u,"Missing prerendered data for route");let c=new TextEncoder().encode(u),f=new ReadableStream({start(h){h.enqueue(c),h.close()}}),p=(await ya(f,globalThis)).value;if(p&&Ye in p){let h=p[Ye],g={status:h.status};throw h.reload?yl(h.redirect,g):h.replace?vl(h.redirect,g):sr(h.redirect,g)}else{qt(p&&n.id in p,"Unable to decode prerendered data");let h=p[n.id];return qt("data"in h,"Unable to process prerendered data"),h.data}}return await gn(n.module.loader,i)}:void 0,action:n.module.action?i=>gn(n.module.action,i):void 0,handle:n.module.handle};return n.index?{index:!0,...o}:{caseSensitive:n.caseSensitive,children:pi(e,t,n.id,a),...o}})}function wn(e){return ma(JSON.stringify(e))}function xa(e,t){return Ku(e,r=>{let a=t.routes[r.route.id];return qt(a,`Route with id "${r.route.id}" not found in build`),a.module.headers})}function Ku(e,t,r){let a=e.errors?e.matches.findIndex(s=>e.errors[s.route.id]):-1,n=a>=0?e.matches.slice(0,a+1):e.matches,o;if(a>=0){let{actionHeaders:s,actionData:l,loaderHeaders:u,loaderData:c}=e;e.matches.slice(a).some(f=>{let m=f.route.id;return s[m]&&(!l||!l.hasOwnProperty(m))?o=s[m]:u[m]&&!c.hasOwnProperty(m)&&(o=u[m]),o!=null})}const i=new Headers(r);return n.reduce((s,l,u)=>{let{id:c}=l.route,f=e.loaderHeaders[c]||new Headers,m=e.actionHeaders[c]||new Headers,p=o!=null&&u===n.length-1,h=p&&o!==f&&o!==m,g=t(l);if(g==null){let w=new Headers(s);return h&&et(o,w),et(m,w),et(f,w),w}let y=new Headers(typeof g=="function"?g({loaderHeaders:f,parentHeaders:s,actionHeaders:m,errorHeaders:p?o:void 0}):g);return h&&et(o,y),et(m,y),et(f,y),et(s,y),y},new Headers(i))}function et(e,t){let r=e.get("Set-Cookie");if(r){let a=zi.splitCookiesString(r),n=new Set(t.getSetCookie());a.forEach(o=>{n.has(o)||t.append("Set-Cookie",o)})}}var yi=new Set([...Fo,304]);async function Xu(e,t,r,a,n,o,i){try{let c=new Request(n,{method:a.method,body:a.body,headers:a.headers,signal:a.signal,...a.body?{duplex:"half"}:void 0}),f=await r.query(c,{requestContext:o,skipLoaderErrorBubbling:!0,skipRevalidation:!0,generateMiddlewareResponse:e.future.v8_middleware?async m=>{try{let p=await m(c);return s(p)}catch(p){return l(p)}}:void 0});return s(f)}catch(c){return l(c)}function s(c){return ee(c)?c:u(c)}function l(c){return i(c),kt(a,e,t,{result:{error:c},headers:new Headers,status:500})}function u(c){let f=xa(c,e);if(cr(c.statusCode)&&f.has("Location"))return new Response(null,{status:c.statusCode,headers:f});c.errors&&(Object.values(c.errors).forEach(p=>{(!re(p)||p.error)&&i(p)}),c.errors=nr(c.errors,t));let m;return c.errors?m={error:Object.values(c.errors)[0]}:m={data:Object.values(c.actionData||{})[0]},kt(a,e,t,{result:m,headers:f,status:c.statusCode})}}async function Gu(e,t,r,a,n,o,i){let s=new URL(a.url).searchParams.get("_routes"),l=s?new Set(s.split(",")):null;try{let m=new Request(n,{headers:a.headers,signal:a.signal}),p=await r.query(m,{requestContext:o,filterMatchesToLoad:h=>!l||l.has(h.route.id),skipLoaderErrorBubbling:!0,generateMiddlewareResponse:e.future.v8_middleware?async h=>{try{let g=await h(m);return u(g)}catch(g){return c(g)}}:void 0});return u(p)}catch(m){return c(m)}function u(m){return ee(m)?m:f(m)}function c(m){return i(m),kt(a,e,t,{result:{error:m},headers:new Headers,status:500})}function f(m){let p=xa(m,e);if(cr(m.statusCode)&&p.has("Location"))return new Response(null,{status:m.statusCode,headers:p});m.errors&&(Object.values(m.errors).forEach(y=>{(!re(y)||y.error)&&i(y)}),m.errors=nr(m.errors,t));let h={},g=new Set(m.matches.filter(y=>l?l.has(y.route.id):y.route.loader!=null).map(y=>y.route.id));if(m.errors)for(let[y,w]of Object.entries(m.errors))h[y]={error:w};for(let[y,w]of Object.entries(m.loaderData))!(y in h)&&g.has(y)&&(h[y]={data:w});return kt(a,e,t,{result:h,headers:p,status:m.statusCode})}}function kt(e,t,r,{result:a,headers:n,status:o}){let i=new Headers(n);return i.set("X-Remix-Response","yes"),yi.has(o)?new Response(null,{status:o,headers:i}):(i.set("Content-Type","text/x-script"),i.delete("Content-Length"),new Response(Gr(a,e.signal,t.entry.module.streamTimeout,r),{status:o||200,headers:i}))}function Rn(e,t,r,a){let n=Qu(e.status,e.headers,r.basename),o=new Headers(e.headers);return o.delete("Location"),o.set("Content-Type","text/x-script"),kt(t,r,a,{result:t.method==="GET"?{[Ye]:n}:n,headers:o,status:pa})}function Qu(e,t,r){let a=t.get("Location");return r&&(a=ne(a,r)||a),{redirect:a,status:e,revalidate:t.has("X-Remix-Revalidate")||t.has("Set-Cookie"),reload:t.has("X-Remix-Reload-Document"),replace:t.has("X-Remix-Replace")}}function Gr(e,t,r,a){let n=new AbortController,o=setTimeout(()=>n.abort(new Error("Server Timeout")),typeof r=="number"?r:4950);return t.addEventListener("abort",()=>clearTimeout(o)),Ms(e,{signal:n.signal,plugins:[i=>{if(i instanceof Error){let{name:s,message:l,stack:u}=a==="production"?Rr(i,a):i;return["SanitizedError",s,l,u]}if(i instanceof pe){let{data:s,status:l,statusText:u}=i;return["ErrorResponse",s,l,u]}if(i&&typeof i=="object"&&Ye in i)return["SingleFetchRedirect",i[Ye]]}],postPlugins:[i=>{if(i&&typeof i=="object")return["SingleFetchClassInstance",Object.fromEntries(Object.entries(i))]},()=>["SingleFetchFallback"]]})}function En(e,t){let r=mi(e.routes),a=pi(e.routes,e.future),n=Vu(t)?t:"production",o=Yn(a,{basename:e.basename,unstable_instrumentations:e.entry.module.unstable_instrumentations}),i=e.entry.module.handleError||((l,{request:u})=>{n!=="test"&&!u.signal.aborted&&console.error(re(l)&&l.error?l.error:l)}),s=async(l,u)=>{let c={},f,m=x=>{t==="development"&&Fr()?.processRequestError?.(x),i(x,{context:f,params:c,request:l})};if(e.future.v8_middleware){if(u&&!(u instanceof Ae)){let x=new Error("Invalid `context` value provided to `handleRequest`. When middleware is enabled you must return an instance of `RouterContextProvider` from your `getLoadContext` function.");return m(x),or(x,n)}f=u||new Ae}else f=u||{};let p=new URL(l.url),h=e.basename||"/",g=p.pathname;ne(g,h)==="/_root.data"?g=h:g.endsWith(".data")&&(g=g.replace(/\.data$/,"")),ne(g,h)!=="/"&&g.endsWith("/")&&(g=g.slice(0,-1));let y=fi(l,"X-React-Router-SPA-Mode")==="yes";if(!e.ssr){let x=decodeURI(g);if(h!=="/"){let P=ne(x,h);if(P==null)return i(new pe(404,"Not Found",`Refusing to prerender the \`${x}\` path because it does not start with the basename \`${h}\``),{context:f,params:c,request:l}),new Response("Not Found",{status:404,statusText:"Not Found"});x=P}if(e.prerender.length===0)y=!0;else if(!e.prerender.includes(x)&&!e.prerender.includes(x+"/")){if(p.pathname.endsWith(".data"))return i(new pe(404,"Not Found",`Refusing to SSR the path \`${x}\` because \`ssr:false\` is set and the path is not included in the \`prerender\` config, so in production the path will be a 404.`),{context:f,params:c,request:l}),new Response("Not Found",{status:404,statusText:"Not Found"});y=!0}}let w=Bo(e.routeDiscovery.manifestPath,h);if(p.pathname===w)try{return await qu(e,r,p)}catch(x){return m(x),new Response("Unknown Server Error",{status:500})}let R=Xr(r,g,e.basename);R&&R.length>0&&Object.assign(c,R[0].params);let C;if(p.pathname.endsWith(".data")){let x=new URL(l.url);x.pathname=g;let P=Xr(r,x.pathname,e.basename);C=await Zu(n,e,o,l,x,f,m),er(C)&&(C=Rn(C,l,e,n)),e.entry.module.handleDataRequest&&(C=await e.entry.module.handleDataRequest(C,{context:f,params:P?P[0].params:{},request:l}),er(C)&&(C=Rn(C,l,e,n)))}else if(!y&&R&&R[R.length-1].route.module.default==null&&R[R.length-1].route.module.ErrorBoundary==null)C=await tc(n,e,o,R.slice(-1)[0].route.id,l,f,m);else{let{pathname:x}=p,P;e.unstable_getCriticalCss?P=await e.unstable_getCriticalCss({pathname:x}):t==="development"&&Fr()?.getCriticalCss&&(P=await Fr()?.getCriticalCss?.(x)),C=await ec(n,e,o,l,f,m,y,P)}return l.method==="HEAD"?new Response(null,{headers:C.headers,status:C.status,statusText:C.statusText}):C};return e.entry.module.unstable_instrumentations&&(s=wl(s,e.entry.module.unstable_instrumentations.map(l=>l.handler).filter(Boolean))),{routes:r,dataRoutes:a,serverMode:n,staticHandler:o,errorHandler:i,requestHandler:s}}var rd=(e,t)=>{let r,a,n,o,i,s;return async function(u,c){if(r=typeof e=="function"?await e():e,typeof e=="function"){let f=En(r,t);a=f.routes,n=f.serverMode,o=f.staticHandler,i=f.errorHandler,s=f.requestHandler}else if(!a||!n||!o||!i||!s){let f=En(r,t);a=f.routes,n=f.serverMode,o=f.staticHandler,i=f.errorHandler,s=f.requestHandler}return s(u,c)}};async function qu(e,t,r){if(e.assets.version!==r.searchParams.get("version"))return new Response(null,{status:204,headers:{"X-Remix-Reload-Document":"true"}});let a={};if(r.searchParams.has("paths")){let n=new Set;(r.searchParams.get("paths")||"").split(",").filter(Boolean).forEach(s=>{s.startsWith("/")||(s=`/${s}`);let l=s.split("/").slice(1);l.forEach((u,c)=>{let f=l.slice(0,c+1).join("/");n.add(`/${f}`)})});for(let s of n){let l=Xr(t,s,e.basename);if(l)for(let u of l){let c=u.route.id,f=e.assets.routes[c];f&&(a[c]=f)}}return Response.json(a,{headers:{"Cache-Control":"public, max-age=31536000, immutable"}})}return new Response("Invalid Request",{status:400})}async function Zu(e,t,r,a,n,o,i){return a.method!=="GET"?await Xu(t,e,r,a,n,o,i):await Gu(t,e,r,a,n,o,i)}async function ec(e,t,r,a,n,o,i,s){try{let u=await r.query(a,{requestContext:n,generateMiddlewareResponse:t.future.v8_middleware?async c=>{try{let f=await c(a);return ee(f)||(f=await l(f,i)),f}catch(f){return o(f),new Response(null,{status:500})}}:void 0});return ee(u)||(u=await l(u,i)),u}catch(u){return o(u),new Response(null,{status:500})}async function l(u,c){let f=xa(u,t);if(yi.has(u.statusCode))return new Response(null,{status:u.statusCode,headers:f});u.errors&&(Object.values(u.errors).forEach(y=>{(!re(y)||y.error)&&o(y)}),u.errors=nr(u.errors,e));let m={loaderData:u.loaderData,actionData:u.actionData,errors:vn(u.errors,e)},p={basename:t.basename,future:t.future,routeDiscovery:t.routeDiscovery,ssr:t.ssr,isSpaMode:c},h={manifest:t.assets,routeModules:Bu(t.routes),staticHandlerContext:u,criticalCss:s,serverHandoffString:wn({...p,criticalCss:s}),serverHandoffStream:Gr(m,a.signal,t.entry.module.streamTimeout,e),renderMeta:{},future:t.future,ssr:t.ssr,routeDiscovery:t.routeDiscovery,isSpaMode:c,serializeError:y=>ci(y,e)},g=t.entry.module.default;try{return await g(a,u.statusCode,f,h,n)}catch(y){o(y);let w=y;if(ee(y))try{let C=await ac(y);w=new pe(y.status,y.statusText,C)}catch{}u=Jn(r.dataRoutes,u,w),u.errors&&(u.errors=nr(u.errors,e));let R={loaderData:u.loaderData,actionData:u.actionData,errors:vn(u.errors,e)};h={...h,staticHandlerContext:u,serverHandoffString:wn(p),serverHandoffStream:Gr(R,a.signal,t.entry.module.streamTimeout,e),renderMeta:{}};try{return await g(a,u.statusCode,f,h,n)}catch(C){return o(C),or(C,e)}}}}async function tc(e,t,r,a,n,o,i){try{let u=await r.queryRoute(n,{routeId:a,requestContext:o,generateMiddlewareResponse:t.future.v8_middleware?async c=>{try{let f=await c(n);return s(f)}catch(f){return l(f)}}:void 0});return s(u)}catch(u){return l(u)}function s(u){return ee(u)?u:typeof u=="string"?new Response(u):Response.json(u)}function l(u){if(ee(u))return u;if(re(u))return i(u),rc(u,e);if(u instanceof Error&&u.message==="Expected a response from queryRoute"){let c=new Error("Expected a Response to be returned from resource route handler");return i(c),or(c,e)}return i(u),or(u,e)}}function rc(e,t){return Response.json(ci(e.error||new Error("Unexpected Server Error"),t),{status:e.status,statusText:e.statusText})}function or(e,t){let r="Unexpected Server Error";return t!=="production"&&(r+=`
|
|
35
|
+
|
|
36
|
+
${String(e)}`),new Response(r,{status:500,headers:{"Content-Type":"text/plain"}})}function ac(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}function kr(e){return`__flash_${e}__`}var vi=(e={},t="")=>{let r=new Map(Object.entries(e));return{get id(){return t},get data(){return Object.fromEntries(r)},has(a){return r.has(a)||r.has(kr(a))},get(a){if(r.has(a))return r.get(a);let n=kr(a);if(r.has(n)){let o=r.get(n);return r.delete(n),o}},set(a,n){r.set(a,n)},flash(a,n){r.set(kr(a),n)},unset(a){r.delete(a)}}},ad=e=>e!=null&&typeof e.id=="string"&&typeof e.data<"u"&&typeof e.has=="function"&&typeof e.get=="function"&&typeof e.set=="function"&&typeof e.flash=="function"&&typeof e.unset=="function";function nc({cookie:e,createData:t,readData:r,updateData:a,deleteData:n}){let o=ui(e)?e:si(e?.name||"__session",e);return gi(o),{async getSession(i,s){let l=i&&await o.parse(i,s),u=l&&await r(l);return vi(u||{},l||"")},async commitSession(i,s){let{id:l,data:u}=i,c=s?.maxAge!=null?new Date(Date.now()+s.maxAge*1e3):s?.expires!=null?s.expires:o.expires;return l?await a(l,u,c):l=await t(u,c),o.serialize(l,s)},async destroySession(i,s){return await n(i.id),o.serialize("",{...s,maxAge:void 0,expires:new Date(0)})}}}function gi(e){Mt(e.isSigned,`The "${e.name}" cookie is not signed, but session cookies should be signed to prevent tampering on the client before they are sent back to the server. See https://reactrouter.com/explanation/sessions-and-cookies#signing-cookies for more information.`)}function nd({cookie:e}={}){let t=ui(e)?e:si(e?.name||"__session",e);return gi(t),{async getSession(r,a){return vi(r&&await t.parse(r,a)||{})},async commitSession(r,a){let n=await t.serialize(r.data,a);if(n.length>4096)throw new Error("Cookie length will exceed browser maximum. Length: "+n.length);return n},async destroySession(r,a){return t.serialize("",{...a,maxAge:void 0,expires:new Date(0)})}}}function od({cookie:e}={}){let t=new Map;return nc({cookie:e,async createData(r,a){let n=Math.random().toString(36).substring(2,10);return t.set(n,{data:r,expires:a}),n},async readData(r){if(t.has(r)){let{data:a,expires:n}=t.get(r);if(!n||n>new Date)return a;n&&t.delete(r)}return null},async updateData(r,a,n){t.set(r,{data:a,expires:n})},async deleteData(r){t.delete(r)}})}function id(e,...t){let r=t[0],a=e.replace(/\/*\*?$/,"").replace(/\/:([\w-]+)(\?)?/g,(n,o,i)=>{const s=i===void 0,l=r?r[o]:void 0;if(s&&l===void 0)throw new Error(`Path '${e}' requires param '${o}' but it was not provided`);return l===void 0?"":"/"+l});if(e.endsWith("*")){const n=r?r["*"]:void 0;n!==void 0&&(a+="/"+n)}return a||"/"}var Qr=new TextEncoder,bn="</body></html>";function Sn(e){let t=new TextDecoder,r,a=new Promise(l=>r=l),n=!1,o=[],i=null;function s(l){for(let u of o){let c=t.decode(u,{stream:!0});c.endsWith(bn)&&(c=c.slice(0,-bn.length)),l.enqueue(Qr.encode(c))}o.length=0,i=null}return new TransformStream({transform(l,u){o.push(l),!i&&(i=setTimeout(async()=>{s(u),n||(n=!0,oc(e,u).catch(c=>u.error(c)).then(r))},0))},async flush(l){await a,i&&(clearTimeout(i),s(l)),l.enqueue(Qr.encode("</body></html>"))}})}async function oc(e,t){let r=new TextDecoder("utf-8",{fatal:!0});const a=e.getReader();try{let o;for(;(o=await a.read())&&!o.done;){const i=o.value;try{Or(JSON.stringify(r.decode(i,{stream:!0})),t)}catch{let l=JSON.stringify(btoa(String.fromCodePoint(...i)));Or(`Uint8Array.from(atob(${l}), m => m.codePointAt(0))`,t)}}}finally{a.releaseLock()}let n=r.decode();n.length&&Or(JSON.stringify(n),t)}function Or(e,t){t.enqueue(Qr.encode(`<script>${ic(`(self.__FLIGHT_DATA||=[]).push(${e})`)}<\/script>`))}function ic(e){return e.replace(/<!--/g,"<\\!--").replace(/<\/(script)/gi,"</\\$1")}var lc=class extends ce.Component{constructor(e){super(e),this.state={error:null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:null,location:e.location}:{error:t.error,location:t.location}}render(){return this.state.error?ce.createElement(wi,{error:this.state.error,renderAppShell:!0}):this.props.children}};function Cn({renderAppShell:e,title:t,children:r}){return e?ce.createElement("html",{lang:"en"},ce.createElement("head",null,ce.createElement("meta",{charSet:"utf-8"}),ce.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),ce.createElement("title",null,t)),ce.createElement("body",null,ce.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},r))):r}function wi({error:e,renderAppShell:t}){console.error(e);let r=ce.createElement("script",{dangerouslySetInnerHTML:{__html:`
|
|
37
|
+
console.log(
|
|
38
|
+
"💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
|
|
39
|
+
);
|
|
40
|
+
`}});if(re(e))return ce.createElement(Cn,{renderAppShell:t,title:"Unhandled Thrown Response!"},ce.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),r);let a;if(e instanceof Error)a=e;else{let n=e==null?"Unknown Error":typeof e=="object"&&"toString"in e?e.toString():JSON.stringify(e);a=new Error(n)}return ce.createElement(Cn,{renderAppShell:t,title:"Application Error!"},ce.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),ce.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},a.stack),r)}function ld({hasRootLayout:e}){let t=hr();if(e===void 0)throw new Error("Missing 'hasRootLayout' prop");return ce.createElement(wi,{renderAppShell:!e,error:t})}function sc(e){const t={};for(const r of e.matches)uc(t,r);return t}function uc(e,t){t=Array.isArray(t)?t:[t];for(const r of t)e[r.id]={links:r.links,meta:r.meta,default:cc}}var cc=()=>null,dc="use",xn=Ii[dc];function fc(e){if(xn)return xn(e);throw new Error("React Router v7 requires React 19+ for RSC features.")}async function sd({request:e,fetchServer:t,createFromReadableStream:r,renderHTML:a,hydrate:n=!0}){const o=new URL(e.url),s=hc(o)||mc(o)||e.headers.has("rsc-action-id"),l=await t(e);if(s||l.headers.get("React-Router-Resource")==="true")return l;if(!l.body)throw new Error("Missing body in server response");const u=l.clone();let c=null;n&&(c=l.clone());const f=l.body;let m,p=[];const h=()=>m?new ReadableStream({start(w){m.forEach(R=>w.enqueue(R)),p.push(w)}}):(m=[],f.pipeThrough(new TransformStream({transform(w,R){m.push(w),R.enqueue(w),p.forEach(C=>C.enqueue(w))},flush(){p.forEach(w=>w.close()),p=[]}})));let g=null;const y=()=>{const w=Promise.resolve(r(h()));return Object.defineProperties(w,{_deepestRenderedBoundaryId:{get(){return g},set(R){g=R}},formState:{get(){return w.then(R=>R.type==="render"?R.formState:void 0)}}})};try{if(!u.body)throw new Error("Failed to clone server response");const w=await r(u.body);if(l.status===pa&&w.type==="redirect"){const P=new Headers(l.headers);return P.delete("Content-Encoding"),P.delete("Content-Length"),P.delete("Content-Type"),P.delete("X-Remix-Response"),P.set("Location",w.location),new Response(c?.body||"",{headers:P,status:w.status,statusText:l.statusText})}const R=await a(y),C=new Headers(l.headers);if(C.set("Content-Type","text/html; charset=utf-8"),!n)return new Response(R,{status:l.status,headers:C});if(!c?.body)throw new Error("Failed to clone server response");const x=R.pipeThrough(Sn(c.body));return new Response(x,{status:l.status,headers:C})}catch(w){if(w instanceof Response)return w;try{const R=re(w)?w.status:500,C=await a(()=>{const E=Promise.resolve(r(h())).then(F=>Object.assign(F,{status:R,errors:g?{[g]:w}:{}}));return Object.defineProperties(E,{_deepestRenderedBoundaryId:{get(){return g},set(F){g=F}},formState:{get(){return E.then(F=>F.type==="render"?F.formState:void 0)}}})}),x=new Headers(l.headers);if(x.set("Content-Type","text/html"),!n)return new Response(C,{status:R,headers:x});if(!c?.body)throw new Error("Failed to clone server response");const P=C.pipeThrough(Sn(c.body));return new Response(P,{status:R,headers:x})}catch{}throw w}}function ud({getPayload:e}){const t=e(),r=fc(t);if(r.type==="redirect")throw new Response(null,{status:r.status,headers:{Location:r.location}});if(r.type!=="render")return null;let a={...r.loaderData};for(const s of r.matches)vr(s.id,s.clientLoader,s.hasLoader,!1)&&(s.hydrateFallbackElement||!s.hasLoader)&&delete a[s.id];const n={get _deepestRenderedBoundaryId(){return t._deepestRenderedBoundaryId??null},set _deepestRenderedBoundaryId(s){t._deepestRenderedBoundaryId=s},actionData:r.actionData,actionHeaders:{},basename:r.basename,errors:r.errors,loaderData:a,loaderHeaders:{},location:r.location,statusCode:200,matches:r.matches.map(s=>({params:s.params,pathname:s.pathname,pathnameBase:s.pathnameBase,route:{id:s.id,action:s.hasAction||!!s.clientAction,handle:s.handle,hasErrorBoundary:s.hasErrorBoundary,loader:s.hasLoader||!!s.clientLoader,index:s.index,path:s.path,shouldRevalidate:s.shouldRevalidate}}))},o=ai(r.matches.reduceRight((s,l)=>{const u={id:l.id,action:l.hasAction||!!l.clientAction,element:l.element,errorElement:l.errorElement,handle:l.handle,hasErrorBoundary:!!l.errorElement,hydrateFallbackElement:l.hydrateFallbackElement,index:l.index,loader:l.hasLoader||!!l.clientLoader,path:l.path,shouldRevalidate:l.shouldRevalidate};return s.length>0&&(u.children=s),[u]},[]),n),i={future:{v8_middleware:!1,unstable_subResourceIntegrity:!1},isSpaMode:!1,ssr:!0,criticalCss:"",manifest:{routes:{},version:"1",url:"",entry:{module:"",imports:[]}},routeDiscovery:{mode:"lazy",manifestPath:"/__manifest"},routeModules:sc(r)};return d.createElement(lo.Provider,{value:!0},d.createElement(lc,{location:r.location},d.createElement(Je.Provider,{value:i},d.createElement(ti,{context:n,router:o,hydrate:!1,nonce:r.nonce}))))}function hc(e){return e.pathname.endsWith(".rsc")}function mc(e){return e.pathname.endsWith(".manifest")}function pc(e){if(!e)return null;let t=Object.entries(e),r={};for(let[a,n]of t)if(n&&n.__type==="RouteErrorResponse")r[a]=new pe(n.status,n.statusText,n.data,n.internal===!0);else if(n&&n.__type==="Error"){if(n.__subType){let o=window[n.__subType];if(typeof o=="function")try{let i=new o(n.message);i.stack=n.stack,r[a]=i}catch{}}if(r[a]==null){let o=new Error(n.message);o.stack=n.stack,r[a]=o}}else r[a]=n;return r}function yc({state:e,routes:t,getRouteInfo:r,location:a,basename:n,isSpaMode:o}){let i={...e,loaderData:{...e.loaderData}},s=ge(t,a,n);if(s)for(let l of s){let u=l.route.id,c=r(u);vr(u,c.clientLoader,c.hasLoader,o)&&(c.hasHydrateFallback||!c.hasLoader)?delete i.loaderData[u]:c.hasLoader||(i.loaderData[u]=null)}return i}function vc(e){return d.createElement(mo,{flushSync:Hi.flushSync,...e})}var k=null,Dt=null;function gc(){if(!k&&window.__reactRouterContext&&window.__reactRouterManifest&&window.__reactRouterRouteModules){if(window.__reactRouterManifest.sri===!0){const e=document.querySelector("script[rr-importmap]");if(e?.textContent)try{window.__reactRouterManifest.sri=JSON.parse(e.textContent).integrity}catch(t){console.error("Failed to parse import map",t)}}k={context:window.__reactRouterContext,manifest:window.__reactRouterManifest,routeModules:window.__reactRouterRouteModules,stateDecodingPromise:void 0,router:void 0,routerInitialized:!1}}}function wc({getContext:e,unstable_instrumentations:t}){if(gc(),!k)throw new Error("You must be using the SSR features of React Router in order to skip passing a `router` prop to `<RouterProvider>`");let r=k;if(!k.stateDecodingPromise){let i=k.context.stream;A(i,"No stream found for single fetch decoding"),k.context.stream=void 0,k.stateDecodingPromise=ya(i,window).then(s=>{k.context.state=s.value,r.stateDecodingPromise.value=!0}).catch(s=>{r.stateDecodingPromise.error=s})}if(k.stateDecodingPromise.error)throw k.stateDecodingPromise.error;if(!k.stateDecodingPromise.value)throw k.stateDecodingPromise;let a=yr(k.manifest.routes,k.routeModules,k.context.state,k.context.ssr,k.context.isSpaMode),n;if(k.context.isSpaMode){let{loaderData:i}=k.context.state;k.manifest.routes.root?.hasLoader&&i&&"root"in i&&(n={loaderData:{root:i.root}})}else n=yc({state:k.context.state,routes:a,getRouteInfo:i=>({clientLoader:k.routeModules[i]?.clientLoader,hasLoader:k.manifest.routes[i]?.hasLoader===!0,hasHydrateFallback:k.routeModules[i]?.HydrateFallback!=null}),location:window.location,basename:window.__reactRouterContext?.basename,isSpaMode:k.context.isSpaMode}),n&&n.errors&&(n.errors=pc(n.errors));let o=ur({routes:a,history:qr(),basename:k.context.basename,getContext:e,hydrationData:n,hydrationRouteProperties:mr,unstable_instrumentations:t,mapRouteProperties:gt,future:{middleware:k.context.future.v8_middleware},dataStrategy:Ns(()=>o,k.manifest,k.routeModules,k.context.ssr,k.context.basename),patchRoutesOnNavigation:nu(k.manifest,k.routeModules,k.context.ssr,k.context.routeDiscovery,k.context.isSpaMode,k.context.basename)});return k.router=o,o.state.initialized&&(k.routerInitialized=!0,o.initialize()),o.createRoutesForHMR=qs,window.__reactRouterDataRouter=o,o}function cd(e){Dt||(Dt=wc({getContext:e.getContext,unstable_instrumentations:e.unstable_instrumentations}));let[t,r]=d.useState(void 0);d.useEffect(()=>{},[]),d.useEffect(()=>{},[t]);let[a,n]=d.useState(Dt.state.location);return d.useLayoutEffect(()=>{k&&k.router&&!k.routerInitialized&&(k.routerInitialized=!0,k.router.initialize())},[]),d.useLayoutEffect(()=>{if(k&&k.router)return k.router.subscribe(o=>{o.location!==a&&n(o.location)})},[a]),A(k,"ssrInfo unavailable for HydratedRouter"),ou(Dt,k.manifest,k.routeModules,k.context.ssr,k.context.routeDiscovery,k.context.isSpaMode),d.createElement(d.Fragment,null,d.createElement(Je.Provider,{value:{manifest:k.manifest,routeModules:k.routeModules,future:k.context.future,criticalCss:t,ssr:k.context.ssr,isSpaMode:k.context.isSpaMode,routeDiscovery:k.context.routeDiscovery}},d.createElement(Yo,{location:a},d.createElement(vc,{router:Dt,unstable_onError:e.unstable_onError}))),d.createElement(d.Fragment,null))}export{Oc as Await,Wc as BrowserRouter,qo as Form,Vc as HashRouter,cd as HydratedRouter,tt as IDLE_BLOCKER,Zr as IDLE_FETCHER,Kt as IDLE_NAVIGATION,Qo as Link,jc as Links,Mc as MemoryRouter,Uc as Meta,gu as NavLink,Fc as Navigate,Vi as NavigationType,ss as Outlet,Vo as PrefetchPageLinks,us as Route,ot as Router,Ae as RouterContextProvider,vc as RouterProvider,kc as Routes,hu as Scripts,wu as ScrollRestoration,Zc as ServerRouter,Qc as StaticRouter,ti as StaticRouterProvider,Sc as UNSAFE_AwaitContextProvider,Ie as UNSAFE_DataRouterContext,at as UNSAFE_DataRouterStateContext,pe as UNSAFE_ErrorResponseImpl,fr as UNSAFE_FetchersContext,Je as UNSAFE_FrameworkContext,yt as UNSAFE_LocationContext,we as UNSAFE_NavigationContext,ld as UNSAFE_RSCDefaultRootErrorBoundary,Yo as UNSAFE_RemixErrorBoundary,Re as UNSAFE_RouteContext,Wu as UNSAFE_ServerMode,Ye as UNSAFE_SingleFetchRedirectSymbol,dr as UNSAFE_ViewTransitionContext,$c as UNSAFE_WithComponentProps,Hc as UNSAFE_WithErrorBoundaryProps,Ic as UNSAFE_WithHydrateFallbackProps,qr as UNSAFE_createBrowserHistory,yr as UNSAFE_createClientRoutes,qs as UNSAFE_createClientRoutesWithHMRRevalidationOptOut,ur as UNSAFE_createRouter,ya as UNSAFE_decodeViaTurboStream,pc as UNSAFE_deserializeErrors,yc as UNSAFE_getHydrationData,nu as UNSAFE_getPatchRoutesOnNavigationFunction,Ns as UNSAFE_getTurboStreamSingleFetchDataStrategy,mr as UNSAFE_hydrationRouteProperties,A as UNSAFE_invariant,gt as UNSAFE_mapRouteProperties,vr as UNSAFE_shouldHydrateRouteLoader,ou as UNSAFE_useFogOFWarDiscovery,Cu as UNSAFE_useScrollRestoration,fs as UNSAFE_withComponentProps,ms as UNSAFE_withErrorBoundaryProps,hs as UNSAFE_withHydrateFallbackProps,zc as createBrowserRouter,Ec as createContext,si as createCookie,nd as createCookieSessionStorage,Bc as createHashRouter,ns as createMemoryRouter,od as createMemorySessionStorage,he as createPath,rd as createRequestHandler,tr as createRoutesFromChildren,Nc as createRoutesFromElements,ed as createRoutesStub,Ur as createSearchParams,vi as createSession,nc as createSessionStorage,qc as createStaticHandler,ai as createStaticRouter,pl as data,bc as generatePath,id as href,ui as isCookie,re as isRouteErrorResponse,ad as isSession,_t as matchPath,ge as matchRoutes,Pe as parsePath,sr as redirect,yl as redirectDocument,Ac as renderMatches,vl as replace,ul as resolvePath,vu as unstable_HistoryRouter,ud as unstable_RSCStaticRouter,sd as unstable_routeRSCServerRequest,td as unstable_setDevServerHooks,Gc as unstable_usePrompt,Tc as unstable_useRoute,fa as useActionData,_c as useAsyncError,es as useAsyncValue,Xc as useBeforeUnload,rs as useBlocker,Jc as useFetcher,Kc as useFetchers,Su as useFormAction,Bl as useHref,nt as useInRouterContext,Ru as useLinkClickHandler,da as useLoaderData,Ee as useLocation,xc as useMatch,ca as useMatches,oa as useNavigate,Zl as useNavigation,Cc as useNavigationType,Vl as useOutlet,Pc as useOutletContext,ia as useParams,Ot as useResolvedPath,Dc as useRevalidator,hr as useRouteError,Lc as useRouteLoaderData,Yl as useRoutes,Yc as useSearchParams,ei as useSubmit,Pu as useViewTransitionState};
|