1var bn=Object.defineProperty,En=Object.defineProperties;var Sn=Object.getOwnPropertyDescriptors;var Ot=Object.getOwnPropertySymbols;var Ir=Object.prototype.hasOwnProperty,Nr=Object.prototype.propertyIsEnumerable;var _r=(e,t,r)=>t in e?bn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x=(e,t)=>{for(var r in t||(t={}))Ir.call(t,r)&&_r(e,r,t[r]);if(Ot)for(var r of Ot(t))Nr.call(t,r)&&_r(e,r,t[r]);return e},W=(e,t)=>En(e,Sn(t));var _e=(e,t)=>{var r={};for(var a in e)Ir.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&Ot)for(var a of Ot(e))t.indexOf(a)<0&&Nr.call(e,a)&&(r[a]=e[a]);return r};var A=(e,t,r)=>new Promise((a,n)=>{var o=s=>{try{l(r.next(s))}catch(u){n(u)}},i=s=>{try{l(r.throw(s))}catch(u){n(u)}},l=s=>s.done?a(s.value):Promise.resolve(s.value).then(o,i);l((r=r.apply(e,t)).next())});import"./npm.apollo-client.CXJpJPbe.bundle.js";import{r as h,R as xn}from"./npm.react-hook-form.HNw-giVQ.bundle.js";import{r as Ln}from"./npm.react-dom.DlIYrMBD.bundle.js";try{let e=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="fc5dcc45-1722-4167-aad9-e149c1e9bf0f",e._sentryDebugIdIdentifier="sentry-dbid-fc5dcc45-1722-4167-aad9-e149c1e9bf0f")}catch(e){}{let e=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=Object.assign({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:sellpy-market":!0})}/** 2 * react-router v7.17.0 3 * 4 * Copyright (c) Remix Software Inc. 5 * 6 * This source code is licensed under the MIT license found in the 7 * LICENSE.md file in the root directory of this source tree. 8 * 9 * @license MIT 10 */var va=e=>{throw TypeError(e)},ga=(e,t,r)=>t.has(e)||va("Cannot "+r),Pe=(e,t,r)=>(ga(e,t,"read from private field"),r?r.call(e):t.get(e)),pt=(e,t,r)=>t.has(e)?va("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ie=(e,t,r,a)=>(ga(e,t,"write to private field"),t.set(e,r),r),zr="popstate";function Ar(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Cn(e={}){function t(a,n){var u;let o=(u=n.state)==null?void 0:u.masked,{pathname:i,search:l,hash:s}=o||a.location;return gt("",{pathname:i,search:l,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,n){return typeof n=="string"?n:ze(n)}return Mn(t,r,null,e)}function _(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function Z(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch(r){}}}function Pn(){return Math.random().toString(36).substring(2,10)}function jr(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function gt(e,t,r=null,a,n){return W(x({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ae(t):t),{state:r,key:t&&t.key||a||Pn(),mask:n})}function ze({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 Ae(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 Mn(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,l="POP",s=null,u=m();u==null&&(u=0,i.replaceState(W(x({},i.state),{idx:u}),""));function m(){return(i.state||{idx:null}).idx}function f(){l="POP";let b=m(),M=b==null?null:b-u;u=b,s&&s({action:l,location:S.location,delta:M})}function v(b,M){l="PUSH";let D=Ar(b)?b:gt(S.location,b,M);u=m()+1;let F=jr(D,u),U=S.createHref(D.mask||D);try{i.pushState(F,"",U)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;n.location.assign(U)}o&&s&&s({action:l,location:S.location,delta:1})}function g(b,M){l="REPLACE";let D=Ar(b)?b:gt(S.location,b,M);u=m();
10let F=jr(D,u),U=S.createHref(D.mask||D);i.replaceState(F,"",U),o&&s&&s({action:l,location:S.location,delta:0})}function R(b){return wa(n,b)}let S={get action(){return l},get location(){return e(n,i)},listen(b){if(s)throw new Error("A history only accepts one active listener");return n.addEventListener(zr,f),s=b,()=>{n.removeEventListener(zr,f),s=null}},createHref(b){return t(n,b)},createURL:R,encodeLocation(b){let M=R(b);return{pathname:M.pathname,search:M.search,hash:M.hash}},push:v,replace:g,go(b){return i.go(b)}};return S}function wa(e,t,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),_(a,"No window.location.(origin|href) available to create URL");let n=typeof t=="string"?t:ze(t);return n=n.replace(/ $/,"%20"),!r&&n.startsWith("//")&&(n=a+n),new URL(n,a)}var yt,Hr=class{constructor(e){if(pt(this,yt,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Pe(this,yt).has(e))return Pe(this,yt).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Pe(this,yt).set(e,t)}};yt=new WeakMap;var Dn=new Set(["lazy","caseSensitive","path","id","index","children"]);function Tn(e){return Dn.has(e)}var Fn=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function kn(e){return Fn.has(e)}function On(e){return e.index===!0}function wt(e,t,r=[],a={},n=!1){return e.map((o,i)=>{let l=[...r,String(i)],s=typeof o.id=="string"?o.id:l.join("-");if(_(o.index!==!0||!o.children,"Cannot specify children on an index route"),_(n||!a[s],`Found a route id collision on i
10d "${s}". Route id's must be globally unique within Data Router usages`),On(o)){let u=W(x({},o),{id:s});return a[s]=Br(u,t(u)),u}else{let u=W(x({},o),{id:s,children:void 0});return a[s]=Br(u,t(u)),o.children&&(u.children=wt(o.children,t,l,a,n)),u}})}function Br(e,t){return Object.assign(e,x(x({},t),typeof t.lazy=="object"&&t.lazy!=null?{lazy:x(x({},e.lazy),t.lazy)}:{}))}function Ra(e,t,r="/"){return ke(e,t,r,!1)}function ke(e,t,r,a,n){let o=typeof t=="string"?Ae(t):t,i=xe(o.pathname||"/",r);if(i==null)return null;let l=n!=null?n:Nt(e),s=null,u=Vn(i);for(let m=0;s==null&&m<l.length;++m)s=Bn(l[m],u,a);return s}function ba(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 Nt(e){let t=Ea(e);return Un(t),t}function Ea(e,t=[],r=[],a="",n=!1){let o=(i,l,s=n,u)=>{let m={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(a)&&s)return;_(m.relativePath.startsWith(a),`Absolute route path "${m.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(a.length)}let f=De([a,m.relativePath]),v=r.concat(m);i.children&&i.children.length>0&&(_(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),Ea(i.children,t,v,f,s)),!(i.path==null&&!i.index)&&t.push({path:f,score:jn(f,i.index),routesMeta:v})};return e.forEach((i,l)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,l);else for(let u of Sa(i.path))o(i,l,!0,u)}),t}function Sa(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=Sa(a.join("/")),l=[];return l.push(...i.map(s=>s===""?o:[o,s].join("/"))),n&&l.push(...i),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function Un(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Hn(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var $n=/^:[\w-]+$/,_n=3,In=2,Nn=1,zn=10,An=-2,Wr=e=>e==="*";function jn(e,t){let r=e.split("/"),a=r.length;return r.some(Wr)&&(a+=An),t&&(a+=In),r.filter(n=>!Wr(n)).reduce((n,o)=>n+($n.test(o)?_n:o===""?Nn:zn),a)}function Hn(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 Bn(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let l=0;l<a.length;++l){let s=a[l],u=l===a.length-1,m=o==="/"?t:t.slice(o.length)||"/",f=Ht({path:s.relativePath,caseSensitive:s.caseSensitive,end:u},m),v=s.route;if(!f&&u&&r&&!a[a.length-1].route.index&&(f=Ht({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},m)),!f)return null;
10Object.assign(n,f.params),i.push({params:n,pathname:De([o,f.pathname]),pathnameBase:Kn(De([o,f.pathnameBase])),route:v}),f.pathnameBase!=="/"&&(o=De([o,f.pathnameBase]))}return i}function Ht(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Wn(e.path,e.caseSensitive,e.end),n=t.match(r);if(!n)return null;let o=n[0],i=o.replace(/(.)\/+$/,"$1"),l=n.slice(1);return{params:a.reduce((u,{paramName:m,isOptional:f},v)=>{if(m==="*"){let R=l[v]||"";i=o.slice(0,o.length-R.length).replace(/(.)\/+$/,"$1")}const g=l[v];return f&&!g?u[m]=void 0:u[m]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function Wn(e,t=!1,r=!0){Z(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,s,u,m)=>{if(a.push({paramName:l,isOptional:s!=null}),s){let f=m.charAt(u+i.length);return f&&f!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).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 Vn(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Z(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function xe(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 Yn({basename:e,pathname:t}){return t==="/"?e:De([e,t])}var xa=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cr=e=>xa.test(e);function Jn(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?Ae(e):e,o;return r?(r=dr(r),r.startsWith("/")?o=Vr(r.substring(1),"/"):o=Vr(r,t)):o=t,{pathname:o,search:Gn(a),hash:Xn(n)}}function Vr(e,t){let r=Bt(t).split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function Zt(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 La(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Wt(e){let t=La(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function bt(e,t,r,a=!1){let n;typeof e=="string"?n=Ae(e):(n=x({},e),_(!n.pathname||!n.pathname.includes("?"),Zt("?","pathname","search",n)),_(!n.pathname||!n.pathname.includes("#"),Zt("#","pathname","hash",n)),_(!n.search||!n.search.includes("#"),Zt("#","search","hash",n)));let o=e===""||n.pathname==="",i=o?"/":n.pathname,l;if(i==null)l=r;else{let f=t.length-1;if(!a&&i.startsWith("..")){let v=i.split("/");for(;v[0]==="..";)v.shift(),f-=1;n.pathname=v.join("/")}l=f>=0?t[f]:"/"}let s=Jn(n,l),u=i&&i!=="/"&&i.endsWith("/"),m=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||m)&&(s.pathname+="/"),s}var dr=e=>e.replace(/\/\/+/g,"/"),De=e=>dr(e.join("/")),Bt=e=>e.replace(/\/+$/,""),Kn=e=>Bt(e).replace(/^\/*/,"/"),Gn=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Xn=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,qn=(e,t=302)=>{let r=t;typeof r=="number"?r={status:r}:typeof r.status=="undefined"&&(r.status=302);let a=new Headers(r.headers);return a.set("Location",e),new Response(null,W(x({},r),{headers:a}))},nl=(e,t)=>{let r=qn(e,t);return r.headers.set("X-Remix-Replace","true"),r},Et=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 Rt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function St(e){let t=e.map(r=>
10r.route.path).filter(Boolean);return De(t)||"/"}var Ca=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined";function Pa(e,t){let r=e;if(typeof r!="string"||!xa.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,n=!1;if(Ca)try{let o=new URL(window.location.href),i=r.startsWith("//")?new URL(o.protocol+r):new URL(r),l=xe(i.pathname,t);i.origin===o.origin&&l!=null?r=l+i.search+i.hash:n=!0}catch(o){Z(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:n,to:r}}var Ke=Symbol("Uninstrumented");function Qn(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 l of i)o[l]&&r[l].push(o[l])}}));let a={};if(typeof t.lazy=="function"&&r.lazy.length>0){let n=it(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],l=r[`lazy.${o}`];if(typeof i=="function"&&l.length>0){let s=it(l,i,()=>{});s&&(a.lazy=Object.assign(a.lazy||{},{[o]:s}))}})}return["loader","action"].forEach(n=>{var i;let o=t[n];if(typeof o=="function"&&r[n].length>0){let l=(i=o[Ke])!=null?i:o,s=it(r[n],l,(...u)=>Yr(u[0]));s&&(n==="loader"&&l.hydrate===!0&&(s.hydrate=!0),s[Ke]=l,a[n]=s)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(a.middleware=t.middleware.map(n=>{var l;let o=(l=n[Ke])!=null?l:n,i=it(r.middleware,o,(...s)=>Yr(s[0]));return i?(i[Ke]=o,i):n})),a}function Zn(e,t){var a,n;let r={navigate:[],fetch:[]};if(t.forEach(o=>o({instrument(i){let l=Object.keys(i);for(let s of l)i[s]&&r[s].push(i[s])}})),r.navigate.length>0){let o=(a=e.navigate[Ke])!=null?a:e.navigate,i=it(r.navigate,o,(...l)=>{let[s,u]=l;return x({to:typeof s=="number"||typeof s=="string"?s:s?ze(s):"."},Jr(e,u!=null?u:{}))});i&&(i[Ke]=o,e.navigate=i)}if(r.fetch.length>0){let o=(n=e.fetch[Ke])!=null?n:e.fetch,i=it(r.fetch,o,(...l)=>{let[s,,u,m]=l;return x({href:u!=null?u:".",fetcherKey:s},Jr(e,m!=null?m:{}))});i&&(i[Ke]=o,e.fetch=i)}return e}function it(e,t,r){return e.length===0?null:(...a)=>A(null,null,function*(){let n=yield Ma(e,r(...a),()=>t(...a),e.length-1);if(n.type==="error")throw n.value;return n.value})}function Ma(e,t,r,a){return A(this,null,function*(){let n=e[a],o;if(n){let i,l=()=>A(null,null,function*(){return i?console.error("You cannot call instrumented handlers more than once"):i=Ma(e,t,r,a-1),o=yield i,_(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0}});try{yield n(l,t)}catch(s){console.error("An instrumentation function threw an error:",s)}i||(yield l()),yield i}else try{o={type:"success",value:yield r()}}catch(i){o={type:"error",value:i}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}})}function Yr(e){let{request:t,context:r,params:a,pattern:n}=e;return{request:eo(t),params:x({},a),pattern:n,context:to(r)}}function Jr(e,t){return x(x(x(x({currentUrl:ze(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 eo(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function to(e){if(ao(e)){let t=x({},e);return Object.freeze(t),t}else return{get:t=>e.get(t)}}var ro=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ao(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")===ro}var Da=["POST","PUT","PATCH","DELETE"],no=new Set(Da),oo=["GET",...Da],io=new Set(oo),Ta=new Set([301,302,303,307,308]),lo=new Set([307,308]),er={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},so={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ft={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},uo=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Fa="remix-router-transitions",ka=Symbol("ResetLoaderData"),Ze,at,Ye,nt,co=class{constructor(e){pt(this,Ze),pt(this,at),pt(this,Ye),pt(this,nt),Ie(this,Ze,e),Ie(this,at,Nt(e))}get stableRoutes(){return Pe(this,Ze)}get activeRoutes(){var e;return(e=Pe(this,Ye))!=null?e:Pe(this,Ze)}get branches(){var e;return(e=Pe(this,nt))!=null?e:Pe(this,at)}get hasHMRRoutes(){return Pe(this,Ye)!=null}setRoutes(e){Ie(this,Ze,e),Ie(this,at,Nt(e))}setHmrRoutes(e){Ie(this,Ye,e),Ie(this,nt,Nt(e))}commitHmrRoutes(){Pe(this,Ye)&&(Ie(this,Ze,Pe(this,Ye)),Ie(this,at,Pe(this,nt)),Ie(this,Ye,void 0),Ie(this,nt,void 0))}};Ze=new WeakMap;at=new WeakMap;Ye=new WeakMap;nt=new WeakMap;function fo(e){const t=e.window?e.window:typeof window!="undefined"?window:void 0,r=typeof t!="undefined"&&typeof t.document!="undefined"&&typeof t.document.createElement!="undefined";_(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],n=e.mapRouteProperties||uo,o=n;if(e.instrumentations){let c=e.instrumentations;o=d=>x(x({},n(d)),Qn(c.map(p=>
10p.route).filter(Boolean),d))}let i={},l=new co(wt(e.routes,o,void 0,i)),s=e.basename||"/";s.startsWith("/")||(s=`/${s}`);let u=e.dataStrategy||vo,m=x({},e.future),f=null,v=new Set,g=null,R=null,S=null,b=null,M=e.hydrationData!=null,D=ke(l.activeRoutes,e.history.location,s,!1,l.branches),F=!1,U=null,k,q;if(D==null&&!e.patchRoutesOnNavigation){let c=Me(404,{pathname:e.history.location.pathname}),{matches:d,route:p}=Ut(l.activeRoutes);k=!0,q=!k,D=d,U={[p.id]:c}}else if(D&&!e.hydrationData&&Mt(D,l.activeRoutes,e.history.location.pathname).active&&(D=null),D)if(D.some(c=>c.route.lazy))k=!1,q=!k;else if(!D.some(c=>fr(c.route)))k=!0,q=!k;else{let c=e.hydrationData?e.hydrationData.loaderData:null,d=e.hydrationData?e.hydrationData.errors:null,p=D;if(d){let w=D.findIndex(E=>d[E.route.id]!==void 0);p=p.slice(0,w+1)}q=!1,k=!0,p.forEach(w=>{let E=Oa(w.route,c,d);q=q||E.renderFallback,k=k&&!E.shouldLoad})}else{k=!1,q=!k,D=[];let c=Mt(null,l.activeRoutes,e.history.location.pathname);c.active&&c.matches&&(F=!0,D=c.matches)}let K,y={historyAction:e.history.action,location:e.history.location,matches:D,initialized:k,renderFallback:q,navigation:er,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||U,fetchers:new Map,blockers:new Map},V="POP",$=null,ne=!1,Y,ye=!1,ae=new Map,fe=null,ve=!1,I=!1,oe=new Set,X=new Map,he=0,ie=-1,me=new Map,ge=new Set,Re=new Map,Fe=new Map,se=new Set,Oe=new Map,Ct,Ge=null;function tn(){if(f=e.history.listen(({action:c,location:d,delta:p})=>{if(Ct){Ct(),Ct=void 0;return}Z(Oe.size===0||p!=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 w=Tr({currentLocation:y.location,nextLocation:d,historyAction:c});if(w&&p!=null){let E=new Promise(C=>{Ct=C});e.history.go(p*-1),Pt(w,{state:"blocked",location:d,proceed(){Pt(w,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),E.then(()=>e.history.go(p))},reset(){let C=new Map(y.blockers);C.set(w,ft),ce({blockers:C})}}),$==null||$.resolve(),$=null;return}return Xe(c,d)}),r){$o(t,ae);let c=()=>_o(t,ae);t.addEventListener("pagehide",c),fe=()=>t.removeEventListener("pagehide",c)}return y.initialized||Xe("POP",y.location,{initialHydration:!0}),K}function rn(){f&&f(),fe&&fe(),v.clear(),Y&&Y.abort(),y.fetchers.forEach((c,d)=>Gt(y.fetchers,d)),y.blockers.forEach((c,d)=>Dr(d))}function an(c){if(v.add(c),g){let{newErrors:d}=g;g=null,c(y,{deletedFetchers:[],newErrors:d,viewTransitionOpts:void 0,flushSync:!1})}return()=>v.delete(c)}function ce(c,d={}){var E;c.matches&&(c.matches=c.matches.map(C=>{let P=i[C.route.id],z=C.route;return z.element!==P.element||z.errorElement!==P.errorElement||z.hydrateFallbackElement!==P.hydrateFallbackElement?W(x({},C),{route:P}):C})),y=x(x({},y),c);let p=[],w=[];y.fetchers.forEach((C,P)=>{C.state==="idle"&&(se.has(P)?p.push(P):w.push(P))}),se.forEach(C=>{!y.fetchers.has(C)&&!X.has(C)&&p.push(C)}),v.size===0&&(g={newErrors:(E=c.errors)!=null?E:null}),[...v].forEach(C=>{var P;return C(y,{deletedFetchers:p,newErrors:(P=c.errors)!=null?P:null,viewTransitionOpts:d.viewTransitionOpts,flushSync:d.flushSync===!0})}),p.forEach(C=>Gt(y.fetchers,C)),w.forEach(C=>y.fetchers.delete(C))}function rt(c,d,{flushSync:p}={}){var O,H;let w=y.actionData!=null&&y.navigation.formMethod!=null&&de(y.navigation.formMethod)&&y.navigation.state==="loading"&&((O=c.state)==null?void 0:O._isRedirect)!==!0,E;d.actionData?Object.keys(d.actionData).length>0?E=d.actionData:E=null:w?E=y.actionData:E=null;let C=d.loaderData?na(y.loaderData,d.loaderData,d.matches||[],d.errors):y.loaderData,P=y.blockers;P.size>0&&(P=new Map(P),P.forEach((N,ee)=>P.set(ee,ft)));let z=ve?!1:kr(c,d.matches||y.matches),L=ne===!0||y.navigation.formMethod!=null&&de(y.navigation.formMethod)&&((H=c.state)==null?void 0:H._isRedirect)!==!0;l.commitHmrRoutes(),ve||V==="POP"||(V==="PUSH"?e.history.push(c,c.state):V==="REPLACE"&&e.history.replace(c,c.state));let T;if(V==="POP"){let N=ae.get(y.location.pathname);N&&N.has(c.pathname)?T={currentLocation:y.location,nextLocation:c}:ae.has(c.pathname)&&(T={currentLocation:c,nextLocation:y.location})}else if(ye){let N=ae.get(y.location.pathname);N?N.add(c.pathname):(N=new Set([c.pathname]),ae.set(y.location.pathname,N)),T={currentLocation:y.location,nextLocation:c}}ce(W(x({},d),{actionData:E,loaderData:C,historyAction:V,location:c,initialized:!0,renderFallback:!1,navigation:er,revalidation:"idle",restoreScrollPosition:z,preventScrollReset:L,blockers:P}),{viewTransitionOpts:T,flushSync:p===!0}),V="POP",ne=!1,ye=!1,ve=!1,I=!1,$==null||$.resolve(),$=null,Ge==null||Ge.resolve(),Ge=null}function Sr(c,d){return A(this,null,function*(){if($==null||$.resolve(),$=null,typeof c=="number"){$||($=sa());let le=$.promise;return e.history.go(c),le}let p=nr(y.location,y.matches,s,c,d==null?void 0:d.fromRouteId,d==null?void 0:d.relative),{path:w,submission:E,error:C}=Kr(!1,p,d),P;
10if(d!=null&&d.mask){let le=typeof d.mask=="string"?Ae(d.mask):x(x({},y.location.mask),d.mask);P=x({pathname:"",search:"",hash:""},le)}let z=y.location,L=gt(z,w,d&&d.state,void 0,P);L=x(x({},L),e.history.encodeLocation(L));let T=d&&d.replace!=null?d.replace:void 0,O="PUSH";T===!0?O="REPLACE":T===!1||E!=null&&de(E.formMethod)&&E.formAction===y.location.pathname+y.location.search&&(O="REPLACE");let H=d&&"preventScrollReset"in d?d.preventScrollReset===!0:void 0,N=(d&&d.flushSync)===!0,ee=Tr({currentLocation:z,nextLocation:L,historyAction:O});if(ee){Pt(ee,{state:"blocked",location:L,proceed(){Pt(ee,{state:"proceeding",proceed:void 0,reset:void 0,location:L}),Sr(c,d)},reset(){let le=new Map(y.blockers);le.set(ee,ft),ce({blockers:le})}});return}yield Xe(O,L,{submission:E,pendingError:C,preventScrollReset:H,replace:d&&d.replace,enableViewTransition:d&&d.viewTransition,flushSync:N,callSiteDefaultShouldRevalidate:d&&d.defaultShouldRevalidate})})}function nn(){Ge||(Ge=sa()),Kt(),ce({revalidation:"loading"});let c=Ge.promise;return y.navigation.state==="submitting"?c:y.navigation.state==="idle"?(Xe(y.historyAction,y.location,{startUninterruptedRevalidation:!0}),c):(Xe(V||y.historyAction,y.navigation.location,{overrideNavigation:y.navigation,enableViewTransition:ye===!0}),c)}function Xe(c,d,p){return A(this,null,function*(){Y&&Y.abort(),Y=null,V=c,ve=(p&&p.startUninterruptedRevalidation)===!0,vn(y.location,y.matches),ne=(p&&p.preventScrollReset)===!0,ye=(p&&p.enableViewTransition)===!0;let w=l.activeRoutes,E=p!=null&&p.initialHydration&&y.matches&&y.matches.length>0&&!F?y.matches:ke(w,d,s,!1,l.branches),C=(p&&p.flushSync)===!0;if(E&&y.initialized&&!I&&Lo(y.location,d)&&!(p&&p.submission&&de(p.submission.formMethod))){rt(d,{matches:E},{flushSync:C});return}let P=Mt(E,w,d.pathname);if(P.active&&P.matches&&(E=P.matches),!E){let{error:G,notFoundMatches:j,route:J}=Xt(d.pathname);rt(d,{matches:j,loaderData:{},errors:{[J.id]:G}},{flushSync:C});return}let z=p&&p.overrideNavigation?W(x({},p.overrideNavigation),{matches:E,historyAction:c}):void 0;Y=new AbortController;let L=ot(e.history,d,Y.signal,p&&p.submission),T=e.getContext?yield e.getContext():new Hr,O;if(p&&p.pendingError)O=[Je(E).route.id,{type:"error",error:p.pendingError}];else if(p&&p.submission&&de(p.submission.formMethod)){let G=yield on(L,d,p.submission,E,c,T,P.active,p&&p.initialHydration===!0,{replace:p.replace,flushSync:C});if(G.shortCircuited)return;if(G.pendingActionResult){let[j,J]=G.pendingActionResult;if(Se(J)&&Rt(J.error)&&J.error.status===404){Y=null,rt(d,{matches:G.matches,loaderData:{},errors:{[j]:J.error}});return}}E=G.matches||E,O=G.pendingActionResult,z=tr(d,E,c,p.submission),C=!1,P.active=!1,L=ot(e.history,L.url,L.signal)}let{shortCircuited:H,matches:N,loaderData:ee,errors:le,workingFetchers:be}=yield ln(L,d,E,c,T,P.active,z,p&&p.submission,p&&p.fetcherSubmission,p&&p.replace,p&&p.initialHydration===!0,C,O,p&&p.callSiteDefaultShouldRevalidate);H||(Y=null,rt(d,x(W(x({matches:N||E},oa(O)),{loaderData:ee,errors:le}),be?{fetchers:be}:{})))})}function on(T,O,H,N,ee,le,be,G){return A(this,arguments,function*(c,d,p,w,E,C,P,z,L={}){Kt();let j=Oo(d,w,E,p);if(ce({navigation:j},{flushSync:L.flushSync===!0}),P){let re=yield Dt(w,d.pathname,c.signal);if(re.type==="aborted")return{shortCircuited:!0};if(re.type==="error"){if(re.partialMatches.length===0){let{matches:Ee,route:Ce}=Ut(l.activeRoutes);return{matches:Ee,pendingActionResult:[Ce.id,{type:"error",error:re.error}]}}let ue=Je(re.partialMatches).route.id;return{matches:re.partialMatches,pendingActionResult:[ue,{type:"error",error:re.error}]}}else if(re.matches)w=re.matches;else{let{notFoundMatches:ue,error:Ee,route:Ce}=Xt(d.pathname);return{matches:ue,pendingActionResult:[Ce.id,{type:"error",error:Ee}]}}}let J,te=zt(w,d);if(!te.route.action&&!te.route.lazy)J={type:"error",error:Me(405,{method:c.method,pathname:d.pathname,routeId:te.route.id})};else{let re=lt(o,i,c,d,w,te,z?[]:a,C),ue=yield dt(c,d,re,C,null);if(J=ue[te.route.id],!J){for(let Ee of w)if(ue[Ee.route.id]){J=ue[Ee.route.id];break}}if(c.signal.aborted)return{shortCircuited:!0}}if(et(J)){let re;return L&&L.replace!=null?re=L.replace:re=ta(J.response.headers.get("Location"),new URL(c.url),s,e.history)===y.location.pathname+y.location.search,yield qe(c,J,!0,{submission:p,replace:re}),{shortCircuited:!0}}if(Se(J)){let re=Je(w,te.route.id);return(L&&L.replace)!==!0&&(V="PUSH"),{matches:w,pendingActionResult:[re.route.id,J,te.route.id]}}return{matches:w,pendingActionResult:[te.route.id,J]}})}function ln(c,d,p,w,E,C,P,z,L,T,O,H,N,ee){return A(this,null,function*(){let le=P||tr(d,p,w,z),be=z||L||la(le),G=!ve&&!O;if(C){if(G){let we=xr(N);ce(x({navigation:le},we!==void 0?{actionData:we}:{}),{flushSync:H})}let B=yield Dt(p,d.pathname,c.signal);if(B.type==="aborted")return{shortCircuited:!0};if(B.type==="error"){if(B.partialMatches.length===0){let{matches:$e,route:We}=Ut(l.activeRoutes);return{matches:$e,loaderData:{}
10,errors:{[We.id]:B.error}}}let we=Je(B.partialMatches).route.id;return{matches:B.partialMatches,loaderData:{},errors:{[we]:B.error}}}else if(B.matches)p=B.matches;else{let{error:we,notFoundMatches:$e,route:We}=Xt(d.pathname);return{matches:$e,loaderData:{},errors:{[We.id]:we}}}}let j=l.activeRoutes,{dsMatches:J,revalidatingFetchers:te}=Gr(c,E,o,i,e.history,y,p,be,d,O?[]:a,O===!0,I,oe,se,Re,ge,j,s,e.patchRoutesOnNavigation!=null,l.branches,N,ee);if(ie=++he,!e.dataStrategy&&!J.some(B=>B.shouldLoad)&&!J.some(B=>B.route.middleware&&B.route.middleware.length>0)&&te.length===0){let B=new Map(y.fetchers),we=Pr(B);return rt(d,x(x({matches:p,loaderData:{},errors:N&&Se(N[1])?{[N[0]]:N[1].error}:null},oa(N)),we?{fetchers:B}:{}),{flushSync:H}),{shortCircuited:!0}}if(G){let B={};if(!C){B.navigation=le;let we=xr(N);we!==void 0&&(B.actionData=we)}te.length>0&&(B.fetchers=sn(te)),ce(B,{flushSync:H})}te.forEach(B=>{Be(B.key),B.controller&&X.set(B.key,B.controller)});let re=()=>te.forEach(B=>Be(B.key));Y&&Y.signal.addEventListener("abort",re);let{loaderResults:ue,fetcherResults:Ee}=yield Lr(J,te,c,d,E);if(c.signal.aborted)return{shortCircuited:!0};Y&&Y.signal.removeEventListener("abort",re),te.forEach(B=>X.delete(B.key));let Ce=$t(ue);if(Ce)return yield qe(c,Ce.result,!0,{replace:T}),{shortCircuited:!0};if(Ce=$t(Ee),Ce)return ge.add(Ce.key),yield qe(c,Ce.result,!0,{replace:T}),{shortCircuited:!0};let Ue=new Map(y.fetchers),{loaderData:qt,errors:Ve}=aa(y,p,ue,N,te,Ee,Ue);O&&y.errors&&(Ve=x(x({},y.errors),Ve));let Tt=Pr(Ue),Ft=Mr(ie,Ue),kt=Tt||Ft||te.length>0;return x({matches:p,loaderData:qt,errors:Ve},kt?{workingFetchers:Ue}:{})})}function xr(c){if(c&&!Se(c[1]))return{[c[0]]:c[1].data};if(y.actionData)return Object.keys(y.actionData).length===0?null:y.actionData}function sn(c){let d=new Map(y.fetchers);return c.forEach(p=>{let w=d.get(p.key),E=ht(void 0,w?w.data:void 0);d.set(p.key,E)}),d}function un(c,d,p,w){return A(this,null,function*(){Be(c);let E=(w&&w.flushSync)===!0,C=l.activeRoutes,P=nr(y.location,y.matches,s,p,d,w==null?void 0:w.relative),z=ke(C,P,s,!1,l.branches),L=Mt(z,C,P);if(L.active&&L.matches&&(z=L.matches),!z){He(c,d,Me(404,{pathname:P}),{flushSync:E});return}let{path:T,submission:O,error:H}=Kr(!0,P,w);if(H){He(c,d,H,{flushSync:E});return}let N=e.getContext?yield e.getContext():new Hr,ee=(w&&w.preventScrollReset)===!0;if(O&&de(O.formMethod)){yield cn(c,d,T,z,N,L.active,E,ee,O,w&&w.defaultShouldRevalidate);return}Re.set(c,{routeId:d,path:T}),yield dn(c,d,T,z,N,L.active,E,ee,O)})}function cn(c,d,p,w,E,C,P,z,L,T){return A(this,null,function*(){Kt(),Re.delete(c);let O=y.fetchers.get(c);je(c,Uo(L,O),{flushSync:P});let H=new AbortController,N=ot(e.history,p,H.signal,L);if(C){let Q=yield Dt(w,new URL(N.url).pathname,N.signal,c);if(Q.type==="aborted")return;if(Q.type==="error"){He(c,d,Q.error,{flushSync:P});return}else if(Q.matches)w=Q.matches;else{He(c,d,Me(404,{pathname:p}),{flushSync:P});return}}let ee=zt(w,p);if(!ee.route.action&&!ee.route.lazy){let Q=Me(405,{method:L.formMethod,pathname:p,routeId:d});He(c,d,Q,{flushSync:P});return}X.set(c,H);let le=he,be=lt(o,i,N,p,w,ee,a,E),G=yield dt(N,p,be,E,c),j=G[ee.route.id];if(!j){for(let Q of be)if(G[Q.route.id]){j=G[Q.route.id];break}}if(N.signal.aborted){X.get(c)===H&&X.delete(c);return}if(se.has(c)){if(et(j)||Se(j)){je(c,Ne(void 0));return}}else{if(et(j))if(X.delete(c),ie>le){je(c,Ne(void 0));return}else return ge.add(c),je(c,ht(L)),qe(N,j,!1,{fetcherSubmission:L,preventScrollReset:z});if(Se(j)){He(c,d,j.error);return}}let J=y.navigation.location||y.location,te=ot(e.history,J,H.signal),re=l.activeRoutes,ue=y.navigation.state!=="idle"?ke(re,y.navigation.location,s,!1,l.branches):y.matches;_(ue,"Didn't find any matches after fetcher action");let Ee=++he;me.set(c,Ee);let{dsMatches:Ce,revalidatingFetchers:Ue}=Gr(te,E,o,i,e.history,y,ue,L,J,a,!1,I,oe,se,Re,ge,re,s,e.patchRoutesOnNavigation!=null,l.branches,[ee.route.id,j],T),qt=ht(L,j.data),Ve=new Map(y.fetchers);Ve.set(c,qt),Ue.filter(Q=>Q.key!==c).forEach(Q=>{let Qe=Q.key,$r=Ve.get(Qe),Rn=ht(void 0,$r?$r.data:void 0);Ve.set(Qe,Rn),Be(Qe),Q.controller&&X.set(Qe,Q.controller)}),ce({fetchers:Ve});let Tt=()=>Ue.forEach(Q=>Be(Q.key));H.signal.addEventListener("abort",Tt);let{loaderResults:Ft,fetcherResults:kt}=yield Lr(Ce,Ue,te,J,E);if(H.signal.aborted)return;H.signal.removeEventListener("abort",Tt),me.delete(c),X.delete(c),Ue.forEach(Q=>X.delete(Q.key));let B=y.fetchers.has(c),we=Q=>{if(!B)return Q;let Qe=new Map(Q.fetchers);return Qe.set(c,Ne(j.data)),W(x({},Q),{fetchers:Qe})},$e=$t(Ft);if($e)return y=we(y),qe(te,$e.result,!1,{preventScrollReset:z});if($e=$t(kt),$e)return ge.add($e.key),y=we(y),qe(te,$e.result,!1,{preventScrollReset:z});let We=new Map(y.fetchers);B&&We.set(c,Ne(j.data));let{loaderData:Ur,errors:Qt}=aa(y,ue,Ft,void 0,Ue,kt,We);Mr(Ee,We),y.navigation.state==="loading"&&Ee>ie?(_(V,"Expected pending action"),Y&&Y.abort(),rt(y.navigation.location,{matches:ue,loaderData:Ur,errors:Qt,fetchers:We})):(ce({errors:Qt,loaderData:na(y.loaderData,Ur,ue,Qt),fetchers:We}),I=!1)})}function dn(c,d,p,w,E,C,P,z,L){return A(this,null,function*(){let T=y.fetchers.get(c);je(c,ht(L,T?T.data:void 0),{flushSync:P});let O=new AbortController,H=ot(e.history,p,O.signal);if(C){let j=yield Dt(w,new URL(H.url).pathname,H.signal,c);if(j.type==="aborted")return;if(j.type==="error"){He(c,d,j.error,{flushSync:P});return}else if(j.matches)w=j.matches;else{He(c,d,Me(404,{pathname:p}),{flushSync:P});return}}let N=zt(w,p);X.set(c,O);let ee=he,le=lt(o,i,H,p,w,N,a,E),be=yield dt(H,p,le,E,c),G=be[N.route.id];if(!G){for(let j of w)if(be[j.route.id]){G=be[j.route.id];break}}if(X.get(c)===O&&X.delete(c),!H.signal.aborted){if(se.has(c)){je(c,Ne(void 0));return}if(et(G))if(ie>ee){je(c,Ne(void 0));return}else{ge.add(c),yield qe(H,G,!1,{preventScrollReset:z});return}if(Se(G)){He(c,d,G.error);return}je(c,Ne(G.data))}})}function qe(z,L,T){return A(this,arguments,function*(c,d,p,{submission:w,fetcherSubmission:E,preventScrollReset:C,replace:P}={}){p||($==null||$.resolve(),$=null),d.response.headers.has("X-Remix-Revalidate")&&(I=!0);let O=d.response.headers.get("Location");_(O,"Expected a Location header on the redirect Response"),O=ta(O,new URL(c.url),s,e.history);let H=gt(y.location,O,{_isRedirect:!0});if(r){let j=!1;if(d.response.headers.has("X-Remix-Reload-Document"))j=!0;else if(cr(O)){const J=wa(t,O,!0);j=J.origin!==t.location.origin||xe(J.pathname,s)==null}if(j){P?t.location.replace(O):t.location.assign(O);return}}Y=null;let N=P===!0||d.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:ee,formAction:le,formEncType:be}=y.navigation;!w&&!E&&ee&&le&&be&&(w=la(y.navigation));let G=w||E;if(lo.has(d.response.status)&&G&&de(G.formMethod))yield Xe(N,H,{submission:W(x({},G),{formAction:O}),preventScrollReset:C||ne,enableViewTransition:p?ye:void 0});else{let j=tr(H,[],N,w);yield Xe(N,H,{overrideNavigation:j,fetcherSubmission:E,preventScrollReset:C||ne,enableViewTransition:p?ye:void 0})}})}function dt(c,d,p,w,E){return A(this,null,function*(){var z;let C,P={};try{C=yield wo(u,c,d,p,E,w,!1)}catch(L){return p.filter(T=>
10T.shouldLoad).forEach(T=>{P[T.route.id]={type:"error",error:L}}),P}if(c.signal.aborted)return P;if(!de(c.method))for(let L of p){if(((z=C[L.route.id])==null?void 0:z.type)==="error")break;!C.hasOwnProperty(L.route.id)&&!y.loaderData.hasOwnProperty(L.route.id)&&(!y.errors||!y.errors.hasOwnProperty(L.route.id))&&L.shouldCallHandler()&&(C[L.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${L.route.id}`)})}for(let[L,T]of Object.entries(C))if(Do(T)){let O=T.result;P[L]={type:"redirect",response:So(O,c,L,p,s)}}else P[L]=yield Eo(T);return P})}function Lr(c,d,p,w,E){return A(this,null,function*(){let C=dt(p,w,c,E,null),P=Promise.all(d.map(T=>A(null,null,function*(){if(T.matches&&T.match&&T.request&&T.controller){let H=(yield dt(T.request,T.path,T.matches,E,T.key))[T.match.route.id];return{[T.key]:H}}else return Promise.resolve({[T.key]:{type:"error",error:Me(404,{pathname:T.path})}})}))),z=yield C,L=(yield P).reduce((T,O)=>Object.assign(T,O),{});return{loaderResults:z,fetcherResults:L}})}function Kt(){I=!0,Re.forEach((c,d)=>{X.has(d)&&oe.add(d),Be(d)})}function je(c,d,p={}){let w=new Map(y.fetchers);w.set(c,d),ce({fetchers:w},{flushSync:(p&&p.flushSync)===!0})}function He(c,d,p,w={}){let E=Je(y.matches,d),C=new Map(y.fetchers);Gt(C,c),ce({errors:{[E.route.id]:p},fetchers:C},{flushSync:(w&&w.flushSync)===!0})}function fn(c){return Fe.set(c,(Fe.get(c)||0)+1),se.has(c)&&se.delete(c),y.fetchers.get(c)||so}function hn(c,d){Be(c,d==null?void 0:d.reason),je(c,Ne(null))}function Gt(c,d){let p=y.fetchers.get(d);X.has(d)&&!(p&&p.state==="loading"&&me.has(d))&&Be(d),Re.delete(d),me.delete(d),ge.delete(d),se.delete(d),oe.delete(d),c.delete(d)}function mn(c){let d=(Fe.get(c)||0)-1;d<=0?(Fe.delete(c),se.add(c)):Fe.set(c,d),ce({fetchers:new Map(y.fetchers)})}function Be(c,d){let p=X.get(c);p&&(p.abort(d),X.delete(c))}function Cr(c,d){for(let p of c){let w=d.get(p);_(w,`Expected fetcher: ${p}`);let E=Ne(w.data);d.set(p,E)}}function Pr(c){let d=[],p=!1;for(let w of ge){let E=c.get(w);_(E,`Expected fetcher: ${w}`),E.state==="loading"&&(ge.delete(w),d.push(w),p=!0)}return Cr(d,c),p}function Mr(c,d){let p=[];for(let[w,E]of me)if(E<c){let C=d.get(w);_(C,`Expected fetcher: ${w}`),C.state==="loading"&&(Be(w),me.delete(w),p.push(w))}return Cr(p,d),p.length>0}function pn(c,d){let p=y.blockers.get(c)||ft;return Oe.get(c)!==d&&Oe.set(c,d),p}function Dr(c){y.blockers.delete(c),Oe.delete(c)}function Pt(c,d){let p=y.blockers.get(c)||ft;_(p.state==="unblocked"&&d.state==="blocked"||p.state==="blocked"&&d.state==="blocked"||p.state==="blocked"&&d.state==="proceeding"||p.state==="blocked"&&d.state==="unblocked"||p.state==="proceeding"&&d.state==="unblocked",`Invalid blocker state transition: ${p.state} -> ${d.state}`);let w=new Map(y.blockers);w.set(c,d),ce({blockers:w})}function Tr({currentLocation:c,nextLocation:d,historyAction:p}){if(Oe.size===0)return;Oe.size>1&&Z(!1,"A router only supports one blocker at a time");let w=Array.from(Oe.entries()),[E,C]=w[w.length-1],P=y.blockers.get(E);if(!(P&&P.state==="proceeding")&&C({currentLocation:c,nextLocation:d,historyAction:p}))return E}function Xt(c){let d=Me(404,{pathname:c}),p=l.activeRoutes,{matches:w,route:E}=Ut(p);return{notFoundMatches:w,route:E,error:d}}function yn(c,d,p){if(R=c,b=d,S=p||null,!M&&y.navigation===er){M=!0;let w=kr(y.location,y.matches);w!=null&&ce({restoreScrollPosition:w})}return()=>{R=null,b=null,S=null}}function Fr(c,d){return S&&S(c,d.map(w=>ba(w,y.loaderData)))||c.key}function vn(c,d){if(R&&b){let p=Fr(c,d);R[p]=b()}}function kr(c,d){if(R){let p=Fr(c,d),w=R[p];if(typeof w=="number")return w}return null}function Mt(c,d,p){if(e.patchRoutesOnNavigation){let w=l.branches;if(c){if(Object.keys(c[0].params).length>0)return{active:!0,matches:ke(d,p,s,!0,w)}}else return{active:!0,matches:ke(d,p,s,!0,w)||[]}}return{active:!1,matches:null}}function Dt(c,d,p,w){return A(this,null,function*(){if(!e.patchRoutesOnNavigation)return{type:"success",matches:c};let E=c;for(;;){let C=i;try{yield e.patchRoutesOnNavigation({signal:p,path:d,matches:E,fetcherKey:w,patch:(T,O)=>{p.aborted||Xr(T,O,l,C,o,!1)}})}catch(T){return{type:"error",error:T,partialMatches:E}}if(p.aborted)return{type:"aborted"};let P=l.branches,z=ke(l.activeRoutes,d,s,!1,P),L=null;if(z){if(Object.keys(z[0].params).length===0)return{type:"success",matches:z};if(L=ke(l.activeRoutes,d,s,!0,P),!(L&&E.length<L.length&&Or(E,L.slice(0,E.length))))return{type:"success",matches:z}}if(L||(L=ke(l.activeRoutes,d,s,!0,P)),!L||Or(E,L))return{type:"success",matches:null};E=L}})}function Or(c,d){return c.length===d.length&&c.every((p,w)=>p.route.id===d[w].route.id)}function gn(c){i={},l.setHmrRoutes(wt(c,o,void 0,i))}function wn(c,d,p=!1){Xr(c,d,l,i,o,p),l.hasHMRRoutes||ce({})}return K={get basename(){return s},get future(){return m},get state(){return y},get routes(){return l.stableRoutes},get branches(){return l.branches},get manifest(){return i},get window(){return t},initialize:tn,subscribe:an,enableScrollRestoration:yn,navigate:Sr,fetch:un,revalidate:nn,createHref:c=>e.history.createHref(c),encodeLocation:c=>e.history.encodeLocation(c),getFetcher:fn,resetFetcher:hn,deleteFetcher:mn,dispose:rn,getBlocker:pn,deleteBlocker:Dr,patchRoutes:wn,_internalFetchControllers:X,_internalSetRoutes:gn,_internalSetStateDoNotUseOrYouWillBreakYourApp(c){ce(c)}},e.instrumentations&&(K=Zn(K,e.instrumentations.map(c=>
10c.router).filter(Boolean))),K}function ho(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,l;if(n){i=[];for(let u of t)if(i.push(u),u.route.id===n){l=u;break}}else i=t,l=t[t.length-1];let s=bt(a||".",Wt(i),xe(e.pathname,r)||e.pathname,o==="path");if(a==null&&(s.search=e.search,s.hash=e.hash),(a==null||a===""||a===".")&&l){let u=mr(s.search);if(l.route.index&&!u)s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&u){let m=new URLSearchParams(s.search),f=m.getAll("index");m.delete("index"),f.filter(g=>g).forEach(g=>m.append("index",g));let v=m.toString();s.search=v?`?${v}`:""}}return r!=="/"&&(s.pathname=Yn({basename:r,pathname:s.pathname})),ze(s)}function Kr(e,t,r){if(!r||!ho(r))return{path:t};if(r.formMethod&&!ko(r.formMethod))return{path:t,error:Me(405,{method:r.formMethod})};let a=()=>({path:t,error:Me(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),i=Aa(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((v,[g,R])=>`${v}${g}=${R} 11`,""):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(f){return a()}}}_(typeof FormData=="function","FormData is not available in this environment");let l,s;if(r.formData)l=ir(r.formData),s=r.formData;else if(r.body instanceof FormData)l=ir(r.body),s=r.body;else if(r.body instanceof URLSearchParams)l=r.body,s=ra(l);else if(r.body==null)l=new URLSearchParams,s=new FormData;else try{l=new URLSearchParams(r.body),s=ra(l)}catch(f){return a()}let u={formMethod:o,formAction:i,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:s,json:void 0,text:void 0};if(de(u.formMethod))return{path:t,submission:u};let m=Ae(t);return e&&m.search&&mr(m.search)&&l.append("index",""),m.search=`?${l}`,{path:ze(m),submission:u}}function Gr(e,t,r,a,n,o,i,l,s,u,m,f,v,g,R,S,b,M,D,F,U,k){var ve;let q=U?Se(U[1])?U[1].error:U[1].data:void 0,K=n.createURL(o.location),y=n.createURL(s),V;if(m&&o.errors){let I=Object.keys(o.errors)[0];V=i.findIndex(oe=>oe.route.id===I)}else if(U&&Se(U[1])){let I=U[0];V=i.findIndex(oe=>oe.route.id===I)-1}let $=U?U[1].statusCode:void 0,ne=$&&$>=400,Y=W(x({currentUrl:K,currentParams:((ve=o.matches[0])==null?void 0:ve.params)||{},nextUrl:y,nextParams:i[0].params},l),{actionResult:q,actionStatus:$}),ye=St(i),ae=i.map((I,oe)=>{let{route:X}=I,he=null;if(V!=null&&oe>V)he=!1;else if(X.lazy)he=!0;else if(!fr(X))he=!1;else if(m){let{shouldLoad:Re}=Oa(X,o.loaderData,o.errors);he=Re}else mo(o.loaderData,o.matches[oe],I)&&(he=!0);if(he!==null)return or(r,a,e,s,ye,I,u,t,he);let ie=!1;typeof k=="boolean"?ie=k:ne?ie=!1:(f||K.pathname+K.search===y.pathname+y.search||K.search!==y.search||po(o.matches[oe],I))&&(ie=!0);let me=W(x({},Y),{defaultShouldRevalidate:ie}),ge=vt(I,me);return or(r,a,e,s,ye,I,u,t,ge,me,k)}),fe=[];return R.forEach((I,oe)=>{if(m||!i.some(se=>se.route.id===I.routeId)||g.has(oe))return;let X=o.fetchers.get(oe),he=X&&X.state!=="idle"&&X.data===void 0,ie=ke(b,I.path,M!=null?M:"/",!1,F);if(!ie){if(D&&he)return;fe.push({key:oe,routeId:I.routeId,path:I.path,matches:null,match:null,request:null,controller:null});return}if(S.has(oe))return;let me=zt(ie,I.path),ge=new AbortController,Re=ot(n,I.path,ge.signal),Fe=null;if(v.has(oe))v.delete(oe),Fe=lt(r,a,Re,I.path,ie,me,u,t);else if(he)f&&(Fe=lt(r,a,Re,I.path,ie,me,u,t));else{let se;typeof k=="boolean"?se=k:ne?se=!1:se=f;let Oe=W(x({},Y),{defaultShouldRevalidate:se});vt(me,Oe)&&(Fe=lt(r,a,Re,I.path,ie,me,u,t,Oe))}Fe&&fe.push({key:oe,routeId:I.routeId,path:I.path,matches:Fe,match:me,request:Re,controller:ge})}),{dsMatches:ae,revalidatingFetchers:fe}}function fr(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Oa(e,t,r){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!fr(e))return{shouldLoad:!1,renderFallback:!1};let a=t!=null&&e.id in t,n=r!=null&&r[e.id]!==void 0;if(!a&&n)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!a};let o=!a&&!n;return{shouldLoad:o,renderFallback:o}}function mo(e,t,r){let a=!t||r.route.id!==t.route.id,n=!e.hasOwnProperty(r.route.id);return a||n}function po(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function vt(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function Xr(e,t,r,a,n,o){let i;if(e){let u=a[e];_(u,`No route found to patch children into: routeId = ${e}`),u.children||(u.children=[]),i=u.children}else i=r.activeRoutes;let l=[],s=[];if(t.forEach(u=>{let m=i.find(f=>Ua(u,f));m?s.push({existingRoute:m,newRoute:u}):l.push(u)}),l.length>0){let u=wt(l,n,[e||"_","patch",String((i==null?void 0:i.length)||"0")],a);i.push(...u)}if(o&&s.length>0)for(let u=0;u<s.length;u++){let{existingRoute:m,newRoute:f}=s[u],v=m,[g]=wt([f],n,[],{},!0);Object.assign(v,{element:g.element?g.element:v.element,errorElement:g.errorElement?g.errorElement:v.errorElement,hydrateFallbackElement:g.hydrateFallbackElement?g.hydrateFallbackElement:v.hydrateFallbackElement})}r.hasHMRRoutes||r.setRoutes([...r.activeRoutes])}function Ua(e,t){var r,a;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:(a=(r=e.children)==null?void 0:r.every((n,o)=>{var i;return(i=t.children)==null?void 0:i.some(l=>Ua(n,l))}))!=null?a:!1:!1}var qr=new WeakMap,$a=({key:e,route:t,manifest:r,mapRouteProperties:a})=>{let n=r[t.id];
11if(_(n,"No route found in manifest"),!n.lazy||typeof n.lazy!="object")return;let o=n.lazy[e];if(!o)return;let i=qr.get(n);i||(i={},qr.set(n,i));let l=i[e];if(l)return l;let s=A(null,null,function*(){let u=Tn(e),f=n[e]!==void 0&&e!=="hasErrorBoundary";if(u)Z(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(f)Z(!1,`Route "${n.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let v=yield o();v!=null&&(Object.assign(n,{[e]:v}),Object.assign(n,a(n)))}typeof n.lazy=="object"&&(n.lazy[e]=void 0,Object.values(n.lazy).every(v=>v===void 0)&&(n.lazy=void 0))});return i[e]=s,s},Qr=new WeakMap;function yo(e,t,r,a,n){let o=r[e.id];if(_(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=Qr.get(o);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let f=A(null,null,function*(){_(typeof e.lazy=="function","No lazy route function found");let v=yield e.lazy(),g={};for(let R in v){let S=v[R];if(S===void 0)continue;let b=kn(R),D=o[R]!==void 0&&R!=="hasErrorBoundary";b?Z(!b,"Route property "+R+" is not a supported property to be returned from a lazy route function. This property will be ignored."):D?Z(!D,`Route "${o.id}" has a static property "${R}" defined but its lazy function is also returning a value for this property. The lazy route property "${R}" will be ignored.`):g[R]=S}Object.assign(o,g),Object.assign(o,W(x({},a(o)),{lazy:void 0}))});return Qr.set(o,f),f.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:f}}let i=Object.keys(e.lazy),l=[],s;for(let m of i){if(n&&n.includes(m))continue;let f=$a({key:m,route:e,manifest:r,mapRouteProperties:a});f&&(l.push(f),m===t&&(s=f))}let u=l.length>0?Promise.all(l).then(()=>{}):void 0;return u==null||u.catch(()=>{}),s==null||s.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:s}}function Zr(e){return A(this,null,function*(){let t=e.matches.filter(n=>n.shouldLoad),r={};return(yield Promise.all(t.map(n=>n.resolve()))).forEach((n,o)=>{r[t[o].route.id]=n}),r})}function vo(e){return A(this,null,function*(){return e.matches.some(t=>t.route.middleware)?_a(e,()=>Zr(e)):Zr(e)})}function _a(e,t){return go(e,t,a=>{if(Fo(a))throw a;return a},Po,r);function r(a,n,o){if(o)return Promise.resolve(Object.assign(o.value,{[n]:{type:"error",result:a}}));{let{matches:i}=e,l=Math.min(Math.max(i.findIndex(u=>u.route.id===n),0),Math.max(i.findIndex(u=>u.shouldCallHandler()),0)),s=Je(i,i[l].route.id).route.id;return Promise.resolve({[s]:{type:"error",result:a}})}}}function go(e,t,r,a,n){return A(this,null,function*(){let u=e,{matches:o}=u,i=_e(u,["matches"]),l=o.flatMap(m=>m.route.middleware?m.route.middleware.map(f=>[m.route.id,f]):[]);return yield Ia(i,l,t,r,a,n)})}function Ia(e,t,r,a,n,o,i=0){return A(this,null,function*(){var g;let{request:l}=e;if(l.signal.aborted)throw(g=l.signal.reason)!=null?g:new Error(`Request aborted: ${l.method} ${l.url}`);let s=t[i];if(!s)return yield r();let[u,m]=s,f,v=()=>A(null,null,function*(){if(f)throw new Error("You may only call `next()` once per middleware");try{return f={value:yield Ia(e,t,r,a,n,o,i+1)},f.value}catch(R){return f={value:yield o(R,u,f)},f.value}});try{let R=yield m(e,v),S=R!=null?a(R):void 0;return n(S)?S:f?S!=null?S:f.value:(f={value:yield v()},f.value)}catch(R){return yield o(R,u,f)}})}function Na(e,t,r,a,n){let o=$a({key:"middleware",route:a.route,manifest:t,mapRouteProperties:e}),i=yo(a.route,de(r.method)?"action":"loader",t,e,n);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function or(e,t,r,a,n,o,i,l,s,u=null,m){let f=!1,v=Na(e,t,r,o,i);return W(x({},o),{_lazyPromises:v,shouldLoad:s,shouldRevalidateArgs:u,shouldCallHandler(g){return f=!0,u?typeof m=="boolean"?vt(o,W(x({},u),{defaultShouldRevalidate:m})):typeof g=="boolean"?vt(o,W(x({},u),{defaultShouldRevalidate:g})):vt(o,u):s},resolve(g){let{lazy:R,loader:S,middleware:b}=o.route,M=f||s||g&&!de(r.method)&&(R||S),D=b&&b.length>0&&!S&&!R;return M&&(de(r.method)||!D)?Ro({request:r,path:a,pattern:n,match:o,lazyHandlerPromise:v==null?void 0:v.handler,lazyRoutePromise:v==null?void 0:v.route,handlerOverride:g,scopedContext:l}):Promise.resolve({type:"data",result:void 0})}})}function lt(e,t,r,a,n,o,i,l,s=null){return n.map(u=>u.route.id!==o.route.id?W(x({},u),{shouldLoad:!1,shouldRevalidateArgs:s,shouldCallHandler:()=>!1,_lazyPromises:Na(e,t,r,u,i),resolve:()=>Promise.resolve({type:"data",result:void 0})}):or(e,t,r,a,St(n),u,i,l,!0,s))}function wo(e,t,r,a,n,o,i){return A(this,null,function*(){a.some(m=>{var f;return(f=m._lazyPromises)==null?void 0:f.middleware})&&(yield Promise.all(a.map(m=>{var f;return(f=m._lazyPromises)==null?void 0:f.middleware}
11)));let l={request:t,url:za(t,r),pattern:St(a),params:a[0].params,context:o,matches:a},s=m=>{let f=l;return _a(f,()=>m(W(x({},f),{fetcherKey:n,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}})))},u=yield e(W(x({},l),{fetcherKey:n,runClientMiddleware:s}));try{yield Promise.all(a.flatMap(m=>{var f,v;return[(f=m._lazyPromises)==null?void 0:f.handler,(v=m._lazyPromises)==null?void 0:v.route]}))}catch(m){}return u})}function Ro(s){return A(this,arguments,function*({request:e,path:t,pattern:r,match:a,lazyHandlerPromise:n,lazyRoutePromise:o,handlerOverride:i,scopedContext:l}){let u,m,f=de(e.method),v=f?"action":"loader",g=R=>{let S,b=new Promise((F,U)=>S=U);m=()=>S(),e.signal.addEventListener("abort",m);let M=F=>typeof R!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${v}" [routeId: ${a.route.id}]`)):R({request:e,url:za(e,t),pattern:r,params:a.params,context:l},...F!==void 0?[F]:[]),D=A(null,null,function*(){try{return{type:"data",result:yield i?i(U=>M(U)):M()}}catch(F){return{type:"error",result:F}}});return Promise.race([D,b])};try{let R=f?a.route.action:a.route.loader;if(n||o)if(R){let S,[b]=yield Promise.all([g(R).catch(M=>{S=M}),n,o]);if(S!==void 0)throw S;u=b}else{yield n;let S=f?a.route.action:a.route.loader;if(S)[u]=yield Promise.all([g(S),o]);else if(v==="action"){let b=new URL(e.url),M=b.pathname+b.search;throw Me(405,{method:e.method,pathname:M,routeId:a.route.id})}else return{type:"data",result:void 0}}else if(R)u=yield g(R);else{let S=new URL(e.url),b=S.pathname+S.search;throw Me(404,{pathname:b})}}catch(R){return{type:"error",result:R}}finally{m&&e.signal.removeEventListener("abort",m)}return u})}function bo(e){return A(this,null,function*(){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()})}function Eo(e){return A(this,null,function*(){var a,n,o,i,l;let{result:t,type:r}=e;if(hr(t)){let s;try{s=yield bo(t)}catch(u){return{type:"error",error:u}}return r==="error"?{type:"error",error:new Et(t.status,t.statusText,s),statusCode:t.status,headers:t.headers}:{type:"data",data:s,statusCode:t.status,headers:t.headers}}return r==="error"?ia(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(a=t.init)==null?void 0:a.status,headers:(n=t.init)!=null&&n.headers?new Headers(t.init.headers):void 0}:{type:"error",error:Co(t),statusCode:Rt(t)?t.status:void 0,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Rt(t)?t.status:void 0}:ia(t)?{type:"data",data:t.data,statusCode:(i=t.init)==null?void 0:i.status,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}})}function So(e,t,r,a,n){let o=e.headers.get("Location");if(_(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!cr(o)){let i=a.slice(0,a.findIndex(l=>l.route.id===r)+1);
11o=nr(new URL(t.url),i,n,o),e.headers.set("Location",o)}return e}var ea=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function ta(e,t,r,a){if(cr(e)){let n=e,o=n.startsWith("//")?new URL(t.protocol+n):new URL(n);if(ea.includes(o.protocol))throw new Error("Invalid redirect location");let i=xe(o.pathname,r)!=null;if(o.origin===t.origin&&i)return dr(o.pathname)+o.search+o.hash}try{let n=a.createURL(e);if(ea.includes(n.protocol))throw new Error("Invalid redirect location")}catch(n){}return e}function ot(e,t,r,a){let n=e.createURL(Aa(t)).toString(),o={signal:r};if(a&&de(a.formMethod)){let{formMethod:i,formEncType:l}=a;o.method=i.toUpperCase(),l==="application/json"?(o.headers=new Headers({"Content-Type":l}),o.body=JSON.stringify(a.json)):l==="text/plain"?o.body=a.text:l==="application/x-www-form-urlencoded"&&a.formData?o.body=ir(a.formData):o.body=a.formData}return new Request(n,o)}function za(e,t){let r=new URL(e.url),a=typeof t=="string"?Ae(t):t;if(r.pathname=a.pathname||"/",a.search){let n=new URLSearchParams(a.search),o=n.getAll("index");n.delete("index");for(let i of o.filter(Boolean))n.append("index",i);r.search=n.size?`?${n.toString()}`:""}else r.search="";return r.hash=a.hash||"",r}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 ra(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function xo(e,t,r,a=!1,n=!1){let o={},i=null,l,s=!1,u={},m=r&&Se(r[1])?r[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let v=f.route.id,g=t[v];if(_(!et(g),"Cannot handle redirect results in processLoaderData"),Se(g)){let R=g.error;if(m!==void 0&&(R=m,m=void 0),i=i||{},n)i[v]=R;else{let S=Je(e,v);i[S.route.id]==null&&(i[S.route.id]=R)}a||(o[v]=ka),s||(s=!0,l=Rt(g.error)?g.error.status:500),g.headers&&(u[v]=g.headers)}else o[v]=g.data,g.statusCode&&g.statusCode!==200&&!s&&(l=g.statusCode),g.headers&&(u[v]=g.headers)}),m!==void 0&&r&&(i={[r[0]]:m},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:i,statusCode:l||200,loaderHeaders:u}}function aa(e,t,r,a,n,o,i){let{loaderData:l,errors:s}=xo(t,r,a);return n.filter(u=>!u.matches||u.matches.some(m=>m.shouldLoad)).forEach(u=>{let{key:m,match:f,controller:v}=u;if(v&&v.signal.aborted)return;let g=o[m];if(_(g,"Did not find corresponding fetcher result"),Se(g)){let R=Je(e.matches,f==null?void 0:f.route.id);s&&s[R.route.id]||(s=W(x({},s),{[R.route.id]:g.error})),i.delete(m)}else if(et(g))_(!1,"Unhandled fetcher revalidation redirect");else{let R=Ne(g.data);i.set(m,R)}}),{loaderData:l,errors:s}}function na(e,t,r,a){let n=Object.entries(t).filter(([,o])=>o!==ka).reduce((o,[i,l])=>(o[i]=l,o),{});for(let o of r){let i=o.route.id;if(!t.hasOwnProperty(i)&&e.hasOwnProperty(i)&&o.route.loader&&(n[i]=e[i]),a&&a.hasOwnProperty(i))break}return n}function oa(e){return e?Se(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Je(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 Ut(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 Me(e,{pathname:t,routeId:r,method:a,type:n,message:o}={}){let i="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(i="Bad Request",a&&t&&r?l=`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"&&(l="Unable to encode submission body")):e===403?(i="Forbidden",l=`Route "${r}" does not match URL "${t}"`):e===404?(i="Not Found",l=`No route matches URL "${t}"`):e===405&&(i="Method Not Allowed",a&&t&&r?l=`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&&(l=`Invalid request method "${a.toUpperCase()}"`)),new Et(e||500,i,new Error(l),!0)}function $t(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[a,n]=t[r];
11if(et(n))return{key:a,result:n}}}function Aa(e){let t=typeof e=="string"?Ae(e):e;return ze(W(x({},t),{hash:""}))}function Lo(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Co(e){var t,r,a,n;return new Et((r=(t=e.init)==null?void 0:t.status)!=null?r:500,(n=(a=e.init)==null?void 0:a.statusText)!=null?n:"Internal Server Error",e.data)}function Po(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&Mo(r))}function Mo(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function Do(e){return hr(e.result)&&Ta.has(e.result.status)}function Se(e){return e.type==="error"}function et(e){return(e&&e.type)==="redirect"}function ia(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function hr(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body!="undefined"}function To(e){return Ta.has(e)}function Fo(e){return hr(e)&&To(e.status)&&e.headers.has("Location")}function ko(e){return io.has(e.toUpperCase())}function de(e){return no.has(e.toUpperCase())}function mr(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function zt(e,t){let r=typeof t=="string"?Ae(t).search:t.search;if(e[e.length-1].route.index&&mr(r||""))return e[e.length-1];let a=La(e);return a[a.length-1]}function la(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 tr(e,t,r,a){return a?{state:"loading",location:e,matches:t,historyAction:r,formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text}:{state:"loading",location:e,matches:t,historyAction:r,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Oo(e,t,r,a){return{state:"submitting",location:e,matches:t,historyAction:r,formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text}}function ht(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 Uo(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 $o(e,t){try{let r=e.sessionStorage.getItem(Fa);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(r){}}function _o(e,t){if(t.size>0){let r={};for(let[a,n]of t)r[a]=[...n];try{e.sessionStorage.setItem(Fa,JSON.stringify(r))}catch(a){Z(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function sa(){let e,t,r=new Promise((a,n)=>{e=o=>A(null,null,function*(){a(o);try{yield r}catch(i){}}),t=o=>A(null,null,function*(){n(o);try{yield r}catch(i){}})});return{promise:r,resolve:e,reject:t}}var tt=h.createContext(null);tt.displayName="DataRouter";var st=h.createContext(null);st.displayName="DataRouterState";var ja=h.createContext(!1);function Ha(){return h.useContext(ja)}var pr=h.createContext({isTransitioning:!1});pr.displayName="ViewTransition";var Ba=h.createContext(new Map);Ba.displayName="Fetchers";var Io=h.createContext(null);Io.displayName="Await";var pe=h.createContext(null);pe.displayName="Navigation";var xt=h.createContext(null);xt.displayName="Location";var Te=h.createContext({outlet:null,matches:[],isDataRoute:!1});Te.displayName="Route";var yr=h.createContext(null);yr.displayName="RouteError";var Wa="REACT_ROUTER_ERROR",No="REDIRECT",zo="ROUTE_ERROR_RESPONSE";function Ao(e){if(e.startsWith(`${Wa}:${No}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="str
11ing"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch(t){}}function jo(e){if(e.startsWith(`${Wa}:${zo}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Et(t.status,t.statusText,t.data)}catch(t){}}function Ho(e,{relative:t}={}){_(ut(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=h.useContext(pe),{hash:n,pathname:o,search:i}=Lt(e,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:De([r,o])),a.createHref({pathname:l,search:i,hash:n})}function ut(){return h.useContext(xt)!=null}function Le(){return _(ut(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(xt).location}function ol(){return h.useContext(xt).navigationType}var Va="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ya(e){h.useContext(pe).static||h.useLayoutEffect(e)}function vr(){let{isDataRoute:e}=h.useContext(Te);return e?ri():Bo()}function Bo(){_(ut(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(tt),{basename:t,navigator:r}=h.useContext(pe),{matches:a}=h.useContext(Te),{pathname:n}=Le(),o=JSON.stringify(Wt(a)),i=h.useRef(!1);return Ya(()=>{i.current=!0}),h.useCallback((s,u={})=>{if(Z(i.current,Va),!i.current)return;if(typeof s=="number"){r.go(s);return}let m=bt(s,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:De([t,m.pathname])),(u.replace?r.replace:r.push)(m,u.state,u)},[t,r,o,n,e])}var Wo=h.createContext(null);function Vo(e){let t=h.useContext(Te).outlet;return h.useMemo(()=>t&&h.createElement(Wo.Provider,{value:e},t),[t,e])}function il(){var r;let{matches:e}=h.useContext(Te),t=e[e.length-1];return(r=t==null?void 0:t.params)!=null?r:{}}function Lt(e,{relative:t}={}){let{matches:r}=h.useContext(Te),{pathname:a}=Le(),n=JSON.stringify(Wt(r));return h.useMemo(()=>bt(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function Yo(e,t,r){_(ut(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=h.useContext(pe),{matches:n}=h.useContext(Te),o=n[n.length-1],i=o?o.params:{},l=o?o.pathname:"/",s=o?o.pathnameBase:"/",u=o&&o.route;{let b=u&&u.path||"";Xa(l,!u||b.endsWith("*")||b.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${b}">) 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. 12 13Please change the parent <Route path="${b}"> to <Route path="${b==="/"?"*":`${b}/*`}">.`)}let m=Le(),f;f=m;let v=f.pathname||"/",g=v;if(s!=="/"){let b=s.replace(/^\//,"").split("/");g="/"+v.replace(/^\//,"").split("/").slice(b.length).join("/")}let R=r&&r.state.matches.length?r.state.matches.map(b=>Object.assign(b,{route:r.manifest[b.route.id]||b.route})):Ra(e,{pathname:g});return Z(u||R!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),Z(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.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.`),qo(R&&R.map(b=>Object.assign({},b,{params:Object.assign({},i,b.params),pathname:De([s,a.encodeLocation?a.encodeLocation(b.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?s:De([s,a.encodeLocation?a.encodeLocation(b.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathnameBase])})),n,r)}function Jo(){let e=ti(),t=Rt(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=h.createElement(h.Fragment,null,h.createElement("p",null,"ð¿ Hey developer ð"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:o},"ErrorBoundary")," or"," ",h.createElement("code",{style:o},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application
13Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),r?h.createElement("pre",{style:n},r):null,i)}var Ko=h.createElement(Jo,null),Ja=class extends h.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=jo(e.digest);r&&(e=r)}let t=e!==void 0?h.createElement(Te.Provider,{value:this.props.routeContext},h.createElement(yr.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?h.createElement(Go,{error:e},t):t}};Ja.contextType=ja;var rr=new WeakMap;function Go({children:e,error:t}){let{basename:r}=h.useContext(pe);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=Ao(t.digest);if(a){let n=rr.get(t);if(n)throw n;let o=Pa(a.location,r);if(Ca&&!rr.get(t))if(o.isExternal||a.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const i=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw rr.set(t,i),i}return h.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function Xo({routeContext:e,match:t,children:r}){let a=h.useContext(tt);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(Te.Provider,{value:e},r)}function qo(e,t=[],r){let a=r==null?void 0:r.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let n=e,o=a==null?void 0:a.errors;if(o!=null){let m=n.findIndex(f=>f.route.id&&(o==null?void 0:o[f.route.id])!==void 0);_(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),n=n.slice(0,Math.min(n.length,m+1))}let i=!1,l=-1;if(r&&a){i=a.renderFallback;for(let m=0;m<n.length;m++){let f=n[m];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(l=m),f.route.id){let{loaderData:v,errors:g}=a,R=f.route.loader&&!v.hasOwnProperty(f.route.id)&&(!g||g[f.route.id]===void 0);if(f.route.lazy||R){r.isStatic&&(i=!0),l>=0?n=n.slice(0,l+1):n=[n[0]];break}}}}let s=r==null?void 0:r.onError,u=a&&s?(m,f)=>{var v,g,R;s(m,{location:a.location,params:(R=(g=(v=a.matches)==null?void 0:v[0])==null?void 0:g.params)!=null?R:{},pattern:St(a.matches),errorInfo:f})}:void 0;return n.reduceRight((m,f,v)=>{let g,R=!1,S=null,b=null;a&&(g=o&&f.route.id?o[f.route.id]:void 0,S=f.route.errorElement||Ko,i&&(l<0&&v===0?(Xa("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),R=!0,b=null):l===v&&(R=!0,b=f.route.hydrateFallbackElement||null)));let M=t.concat(n.slice(0,v+1)),D=()=>{let F;return g?F=S:R?F=b:f.route.Component?F=h.createElement(f.route.Component,null):f.route.element?F=f.route.element:F=m,h.createElement(Xo,{match:f,routeContext:{outlet:m,matches:M,isDataRoute:a!=null},children:F})};return a&&(f.route.ErrorBoundary||f.route.errorElement||v===0)?h.createElement(Ja,{location:a.location,revalidation:a.revalidation,component:S,error:g,children:D(),routeContext:{outlet:null,matches:M,isDataRoute:!0},onError:u}):D()},null)}function gr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ka(e){let t=h.useContext(tt);return _(t,gr(e)),t}function ct(e){let t=h.useContext(st);return _(t,gr(e)),t}function Qo(e){let t=h.useContext(Te);return _(t,gr(e)),t}function Vt(e){let t=Qo(e),r=t.matches[t.matches.length-1];return _(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Zo(){return Vt("useRouteId")}function ei(){let e=ct("useNavigation");return h.useMemo(()=>{let n=e.navigation,{matches:t,historyAction:r}=n;return _e(n,["matches","historyAction"])},[e.navigation])}function ll(){let e=Ka("useRevalidator"),t=ct("useRevalidator"),r=h.useCallback(()=>A(null,null,function*(){yield e.router.revalidate()}),[e.router]);return h.useMemo(()=>({revalidate:r,state:t.revalidation}),[r,t.revalidation])}function Ga(){let{matches:e,loaderData:t}=ct("useMatches");return h.useMemo(()=>e.map(r=>ba(r,t)),[e,t])}function sl(){let e=ct("useLoaderData"),t=Vt("useLoaderData");return e.loaderData[t]}function ul(e){return ct("useRouteLoaderData").loaderData[e]}function ti(){var a;let e=h.useContext(yr),t=ct("useRouteError"),r=Vt("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[r]}function ri(){let{router:e}=Ka("useNavigate"),t=Vt("useNavigate"),r=h.useRef(!1);return Ya(()=>{r.current=!0}),h.useCallback((i,...l)=>A(null,[i,...l],function*(n,o={}){Z(r.current,Va),r.current&&(typeof n=="number"?yield e.navigate(n):yield e.navigate(n,x({fromRouteId:t},o)))}),[e,t])}var ua={};function Xa(e,t,r){!t&&!ua[e]&&(ua[e]=!0,Z(!1,r))}var ca={};function da(e,t){!e&&!ca[t]&&(ca[t]=!0,console.warn(t))}var ai="useOptimistic",fa=xn[ai],ni=()=>{};function oi(e){return fa?fa(e):[e,ni]}function ii(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Z(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:h.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Z(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:h.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Z(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:h.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var li=["HydrateFallback","hydrateFallbackElement"],si=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>
13{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function ui({router:e,flushSync:t,onError:r,useTransitions:a}){a=Ha()||a;let[o,i]=h.useState(e.state),[l,s]=oi(o),[u,m]=h.useState(),[f,v]=h.useState({isTransitioning:!1}),[g,R]=h.useState(),[S,b]=h.useState(),[M,D]=h.useState(),F=h.useRef(new Map),U=h.useCallback((y,{deletedFetchers:V,newErrors:$,flushSync:ne,viewTransitionOpts:Y})=>{$&&r&&Object.values($).forEach(ae=>{var fe,ve;return r(ae,{location:y.location,params:(ve=(fe=y.matches[0])==null?void 0:fe.params)!=null?ve:{},pattern:St(y.matches)})}),y.fetchers.forEach((ae,fe)=>{ae.data!==void 0&&F.current.set(fe,ae.data)}),V.forEach(ae=>F.current.delete(ae)),da(ne===!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 ye=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(da(Y==null||ye,"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."),!Y||!ye){t&&ne?t(()=>i(y)):a===!1?i(y):h.startTransition(()=>{a===!0&&s(ae=>ha(ae,y)),i(y)});return}if(t&&ne){t(()=>{S&&(g==null||g.resolve(),S.skipTransition()),v({isTransitioning:!0,flushSync:!0,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation})});let ae=e.window.document.startViewTransition(()=>{t(()=>i(y))});ae.finished.finally(()=>{t(()=>{R(void 0),b(void 0),m(void 0),v({isTransitioning:!1})})}),t(()=>b(ae));return}S?(g==null||g.resolve(),S.skipTransition(),D({state:y,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation})):(m(y),v({isTransitioning:!0,flushSync:!1,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation}))},[e.window,t,S,g,a,s,r]);h.useLayoutEffect(()=>e.subscribe(U),[e,U]),h.useEffect(()=>{f.isTransitioning&&!f.flushSync&&R(new si)},[f]),h.useEffect(()=>{if(g&&u&&e.window){let y=u,V=g.promise,$=e.window.document.startViewTransition(()=>A(null,null,function*(){a===!1?i(y):h.startTransition(()=>{a===!0&&s(ne=>ha(ne,y)),i(y)}),yield V}));$.finished.finally(()=>{R(void 0),b(void 0),m(void 0),v({isTransitioning:!1})}),b($)}},[u,g,e.window,a,s]),h.useEffect(()=>{g&&u&&l.location.key===u.location.key&&g.resolve()},[g,S,l.location,u]),h.useEffect(()=>{!f.isTransitioning&&M&&(m(M.state),v({isTransitioning:!0,flushSync:!1,currentLocation:M.currentLocation,nextLocation:M.nextLocation}),D(void 0))},[f.isTransitioning,M]);let k=h.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:y=>e.navigate(y),push:(y,V,$)=>e.navigate(y,{state:V,preventScrollReset:$==null?void 0:$.preventScrollReset}),replace:(y,V,$)=>e.navigate(y,{replace:!0,state:V,preventScrollReset:$==null?void 0:$.preventScrollReset})}),[e]),q=e.basename||"/",K=h.useMemo(()=>({router:e,navigator:k,static:!1,basename:q,onError:r}),[e,k,q,r]);return h.createElement(h.Fragment,null,h.createElement(tt.Provider,{value:K},h.createElement(st.Provider,{value:l},h.createElement(Ba.Provider,{value:F.current},h.createElement(pr.Provider,{value:f},h.createElement(hi,{basename:q,location:l.location,navigationType:l.historyAction,navigator:k,useTransitions:a},h.createElement(ci,{routes:e.routes,manifest:e.manifest,future:e.future,state:l,isStatic:!1,onError:r})))))),null)}function ha(e,t){return W(x({},e),{navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers})}var ci=h.memo(di);function di({routes:e,manifest:t,future:r,state:a,isStatic:n,onError:o}){return Yo(e,void 0,{manifest:t,state:a,isStatic:n,onError:o})}function cl({to:e,replace:t,state:r,relative:a}){_(ut(),"<Navigate> may be used only in the context of a <Router> component.");let{static:n}=h.useContext(pe);Z(!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}=h.useContext(Te),{pathname:i}=Le(),l=vr(),s=bt(e,Wt(o),i,a==="path"),u=JSON.stringify(s);return h.useEffect(()=>{l(JSON.parse(u),{replace:t,state:r,relative:a})},[l,u,a,t,r]),null}function dl(e){return Vo(e.context)}function fi(e){_(!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 hi({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1,useTransitions:i}){_(!ut(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=h.useMemo(()=>({basename:l,navigator:n,static:o,useTransitions:i,future:{}}),[l,n,o,i]);typeof r=="string"&&(r=Ae(r));
13let{pathname:u="/",search:m="",hash:f="",state:v=null,key:g="default",mask:R}=r,S=h.useMemo(()=>{let b=xe(u,l);return b==null?null:{location:{pathname:b,search:m,hash:f,state:v,key:g,mask:R},navigationType:a}},[l,u,m,f,v,g,a,R]);return Z(S!=null,`<Router basename="${l}"> is not able to match the URL "${u}${m}${f}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:h.createElement(pe.Provider,{value:s},h.createElement(xt.Provider,{children:t,value:S}))}function ma(e,t=[]){let r=[];return h.Children.forEach(e,(a,n)=>{if(!h.isValidElement(a))return;let o=[...t,n];if(a.type===h.Fragment){r.push.apply(r,ma(a.props.children,o));return}_(a.type===fi,`[${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.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=ma(a.props.children,o)),r.push(i)}),r}var At="get",jt="application/x-www-form-urlencoded";function Yt(e){return typeof HTMLElement!="undefined"&&e instanceof HTMLElement}function mi(e){return Yt(e)&&e.tagName.toLowerCase()==="button"}function pi(e){return Yt(e)&&e.tagName.toLowerCase()==="form"}function yi(e){return Yt(e)&&e.tagName.toLowerCase()==="input"}function vi(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function gi(e,t){return e.button===0&&(!t||t==="_self")&&!vi(e)}function lr(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 wi(e,t){let r=lr(e);return t&&t.forEach((a,n)=>{r.has(n)||t.getAll(n).forEach(o=>{r.append(n,o)})}),r}var _t=null;function Ri(){if(_t===null)try{new FormData(document.createElement("form"),0),_t=!1}catch(e){_t=!0}return _t}var bi=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ar(e){return e!=null&&!bi.has(e)?(Z(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${jt}"`),null):e}function Ei(e,t){let r,a,n,o,i;if(pi(e)){let l=e.getAttribute("action");a=l?xe(l,t):null,r=e.getAttribute("method")||At,n=ar(e.getAttribute("enctype"))||jt,o=new FormData(e)}else if(mi(e)||yi(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||l.getAttribute("action");if(a=s?xe(s,t):null,r=e.getAttribute("formmethod")||l.getAttribute("method")||At,n=ar(e.getAttribute("formenctype"))||ar(l.getAttribute("enctype"))||jt,o=new FormData(l,e),!Ri()){let{name:u,type:m,value:f}=e;if(m==="image"){let v=u?`${u}.`:"";o.append(`${v}x`,"0"),o.append(`${v}y`,"0")}else u&&o.append(u,f)}}else{if(Yt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=At,a=null,n=jt,i=e}return o&&n==="text/plain"&&(i=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Si={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},xi=/[&><\u2028\u2029]/g;function pa(e){return e.replace(xi,t=>Si[t])}function wr(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function qa(e,t,r,a){let n=typeof e=="string"?new URL(e,typeof window=="undefined"?"server://singlefetch/":window.location.origin):e;return r?n.pathname.endsWith("/")?n.pathname=`${n.pathname}_.${a}`:n.pathname=`${n.pathname}.${a}`:n.pathname==="/"?n.pathname=`_root.${a}`:t&&xe(n.pathname,t)==="/"?n.pathname=`${Bt(t)}
13/_root.${a}`:n.pathname=`${Bt(n.pathname)}.${a}`,n}function Li(e,t){return A(this,null,function*(){if(e.id in t)return t[e.id];try{let r=yield 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 Ci(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}function Pi(e,t,r){return A(this,null,function*(){let a=yield Promise.all(e.map(n=>A(null,null,function*(){let o=t.routes[n.route.id];if(o){let i=yield Li(o,r);return i.links?i.links():[]}return[]})));return Fi(a.flat(1).filter(Ci).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?W(x({},n),{rel:"prefetch",as:"style"}):W(x({},n),{rel:"prefetch"})))})}function ya(e,t,r,a,n,o){let i=(s,u)=>r[u]?s.route.id!==r[u].route.id:!0,l=(s,u)=>{var m;return r[u].pathname!==s.pathname||((m=r[u].route.path)==null?void 0:m.endsWith("*"))&&r[u].params["*"]!==s.params["*"]};return o==="assets"?t.filter((s,u)=>i(s,u)||l(s,u)):o==="data"?t.filter((s,u)=>{var f;let m=a.routes[s.route.id];if(!m||!m.hasLoader)return!1;if(i(s,u)||l(s,u))return!0;if(s.route.shouldRevalidate){let v=s.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:((f=r[0])==null?void 0:f.params)||{},nextUrl:new URL(e,window.origin),nextParams:s.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function Mi(e,t,{includeHydrateFallback:r}={}){return Di(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 Di(e){return[...new Set(e)]}function Ti(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function Fi(e,t){let r=new Set;return new Set(t),e.reduce((a,n)=>{let o=JSON.stringify(Ti(n));return r.has(o)||(r.add(o),a.push({key:o,link:n})),a},[])}function Rr(){let e=h.useContext(tt);return wr(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function ki(){let e=h.useContext(st);return wr(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Jt=h.createContext(void 0);Jt.displayName="FrameworkContext";function br(){let e=h.useContext(Jt);return wr(e,"You must render this element inside a <HydratedRouter> element"),e}function Oi(e,t){let r=h.useContext(Jt),[a,n]=h.useState(!1),[o,i]=h.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:m,onTouchStart:f}=t,v=h.useRef(null);h.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let S=M=>{M.forEach(D=>{i(D.isIntersecting)})},b=new IntersectionObserver(S,{threshold:.5});return v.current&&b.observe(v.current),()=>{b.disconnect()}}},[e]),h.useEffect(()=>{if(a){let S=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(S)}}},[a]);let g=()=>{n(!0)},R=()=>{n(!1),i(!1)};return r?e!=="intent"?[o,v,{}]:[o,v,{onFocus:mt(l,g),onBlur:mt(s,R),onMouseEnter:mt(u,g),onMouseLeave:mt(m,R),onTouchStart:mt(f,g)}]:[!1,v,{}]}function mt(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Ui(r){var a=r,{page:e}=a,t=_e(a,["page"]);let n=Ha(),{router:o}=Rr(),i=h.useMemo(()=>Ra(o.routes,e,o.basename),[o.routes,e,o.basename]);return i?n?h.createElement(_i,x({page:e,matches:i},t)):h.createElement(Ii,x({page:e,matches:i},t)):null}function $i(e){let{manifest:t,routeModules:r}=br(),[a,n]=h.useState([]);return h.useEffect(()=>{let o=!1;return Pi(e,t,r).then(i=>{o||n(i)}),()=>{o=!0}},[e,t,r]),a}function _i(a){var n=a,{page:e,matches:t}=n,r=_e(n,["page","matches"]);let o=Le(),{future:i}=br(),{basename:l}=Rr(),s=h.useMemo(()=>{if(e===o.pathname+o.search+o.hash)return[];let u=qa(e,l,i.v8_trailingSlashAwareDataRequests,"rsc"),m=!1,f=[];for(let v of t)typeof v.route.shouldRevalidate=="function"?m=!0:f.push(v.route.id);return m&&f.length>
130&&u.searchParams.set("_routes",f.join(",")),[u.pathname+u.search]},[l,i.v8_trailingSlashAwareDataRequests,e,o,t]);return h.createElement(h.Fragment,null,s.map(u=>h.createElement("link",x({key:u,rel:"prefetch",as:"fetch",href:u},r))))}function Ii(a){var n=a,{page:e,matches:t}=n,r=_e(n,["page","matches"]);let o=Le(),{future:i,manifest:l,routeModules:s}=br(),{basename:u}=Rr(),{loaderData:m,matches:f}=ki(),v=h.useMemo(()=>ya(e,t,f,l,o,"data"),[e,t,f,l,o]),g=h.useMemo(()=>ya(e,t,f,l,o,"assets"),[e,t,f,l,o]),R=h.useMemo(()=>{if(e===o.pathname+o.search+o.hash)return[];let M=new Set,D=!1;if(t.forEach(U=>{var q;let k=l.routes[U.route.id];!k||!k.hasLoader||(!v.some(K=>K.route.id===U.route.id)&&U.route.id in m&&((q=s[U.route.id])!=null&&q.shouldRevalidate)||k.hasClientLoader?D=!0:M.add(U.route.id))}),M.size===0)return[];let F=qa(e,u,i.v8_trailingSlashAwareDataRequests,"data");return D&&M.size>0&&F.searchParams.set("_routes",t.filter(U=>M.has(U.route.id)).map(U=>U.route.id).join(",")),[F.pathname+F.search]},[u,i.v8_trailingSlashAwareDataRequests,m,o,l,v,t,e,s]),S=h.useMemo(()=>Mi(g,l),[g,l]),b=$i(g);return h.createElement(h.Fragment,null,R.map(M=>h.createElement("link",x({key:M,rel:"prefetch",as:"fetch",href:M},r))),S.map(M=>h.createElement("link",x({key:M,rel:"modulepreload",href:M},r))),b.map(({key:M,link:D})=>{var F;return h.createElement("link",W(x({key:M,nonce:r.nonce},D),{crossOrigin:(F=D.crossOrigin)!=null?F:r.crossOrigin}))}))}function Ni(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var zi=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined";try{zi&&(window.__reactRouterVersion="7.17.0")}catch(e){}function fl(e,t){return fo({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:Cn({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||Ai(),routes:e,mapRouteProperties:ii,hydrationRouteProperties:li,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window,instrumentations:t==null?void 0:t.instrumentations}).initialize()}function Ai(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e=W(x({},e),{errors:ji(e.errors)})),e}function ji(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 Et(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(i){}}if(r[a]==null){let o=new Error(n.message);o.stack="",r[a]=o}}else r[a]=n;return r}var Qa=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Za=h.forwardRef(function(b,S){var M=b,{onClick:t,discover:r="render",prefetch:a="none",relative:n,reloadDocument:o,replace:i,mask:l,state:s,target:u,to:m,preventScrollReset:f,viewTransition:v,defaultShouldRevalidate:g}=M,R=_e(M,["onClick","discover","prefetch","relative","reloadDocument","replace","mask","state","target","to","preventScrollReset","viewTransition","defaultShouldRevalidate"]);let{basename:D,navigator:F,useTransitions:U}=h.useContext(pe),k=typeof m=="string"&&Qa.test(m),q=Pa(m,D);m=q.to;let K=Ho(m,{relative:n}),y=Le(),V=null;if(l){let I=bt(l,[],y.mask?y.mask.pathname:"/",!0);D!=="/"&&(I.pathname=I.pathname==="/"?D:De([D,I.pathname])),V=F.createHref(I)}let[$,ne,Y]=Oi(a,R),ye=Yi(m,{replace:i,mask:l,state:s,target:u,preventScrollReset:f,relative:n,viewTransition:v,defaultShouldRevalidate:g,useTransitions:U});function ae(I){t&&t(I),I.defaultPrevented||ye(I)}let fe=!(q.isExternal||o),ve=h.createElement("a",W(x(x({},R),Y),{href:(fe?V:void 0)||q.absoluteURL||K,onClick:fe?ae:t,ref:Ni(S,ne),target:u,"data-discover":!k&&r==="render"?"true":void 0}));return $&&!k?h.createElement(h.Fragment,null,ve,h.createElement(Ui,{page:K})):ve});Za.displayName="Link";var Hi=h.forwardRef(function(f,m){var v=f,{"aria-current":t="page",caseSensitive:r=!1,className:a="",end:n=!1,style:o,to:i,viewTransition:l,children:s}=v,u=_e(v,["aria-current","caseSensitive","className","end","style","to","viewTransition","children"]);let g=Lt(i,{relative:u.relative}),R=Le(),S=h.useContext(st),{navigator:b,basename:M}=h.useContext(pe),D=S!=null&&Zi(g)&&l===!0,F=b.encodeLocation?b.encodeLocation(g).pathname:g.pathname,U=R.pathname,k=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;r||(U=U.toLowerCase(),k=k?k.toLowerCase():null,F=F.toLowerCase()),k&&M&&(k=xe(k,M)||k);const q=F!=="/"&&F.endsWith("/")?F.length-1:F.length;let K=U===F||!n&&U.startsWith(F)&&U.charAt(q)==="/",y=k!=null&&(k===F||!n&&k.startsWith(F)&&k.charAt(F.length)==="/"),V={isActive:K,isPending:y,isTransitioning:D},$=K?t:void 0,ne;typeof a=="function"?ne=a(V):ne=[a,K?"active":null,y?"pending":null,D?"transitioning":null].filter(
13Boolean).join(" ");let Y=typeof o=="function"?o(V):o;return h.createElement(Za,W(x({},u),{"aria-current":$,className:ne,ref:m,style:Y,to:i,viewTransition:l}),typeof s=="function"?s(V):s)});Hi.displayName="NavLink";var Bi=h.forwardRef((S,R)=>{var b=S,{discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:i=At,action:l,onSubmit:s,relative:u,preventScrollReset:m,viewTransition:f,defaultShouldRevalidate:v}=b,g=_e(b,["discover","fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","viewTransition","defaultShouldRevalidate"]);let{useTransitions:M}=h.useContext(pe),D=Gi(),F=Xi(l,{relative:u}),U=i.toLowerCase()==="get"?"get":"post",k=typeof l=="string"&&Qa.test(l),q=K=>{if(s&&s(K),K.defaultPrevented)return;K.preventDefault();let y=K.nativeEvent.submitter,V=(y==null?void 0:y.getAttribute("formmethod"))||i,$=()=>D(y||K.currentTarget,{fetcherKey:t,method:V,navigate:r,replace:n,state:o,relative:u,preventScrollReset:m,viewTransition:f,defaultShouldRevalidate:v});M&&r!==!1?h.startTransition(()=>$()):$()};return h.createElement("form",W(x({ref:R,method:U,action:F,onSubmit:a?s:q},g),{"data-discover":!k&&e==="render"?"true":void 0}))});Bi.displayName="Form";function Wi(a){var n=a,{getKey:e,storageKey:t}=n,r=_e(n,["getKey","storageKey"]);let o=h.useContext(Jt),{basename:i}=h.useContext(pe),l=Le(),s=Ga();qi({getKey:e,storageKey:t});let u=h.useMemo(()=>{if(!o||!e)return null;let f=ur(l,s,i,e);return f!==l.key?f:null},[]);if(!o||o.isSpaMode)return null;let m=((f,v)=>{if(!window.history.state||!window.history.state.key){let g=Math.random().toString(32).slice(2);window.history.replaceState({key:g},"")}try{let R=JSON.parse(sessionStorage.getItem(f)||"{}")[v||window.history.state.key];typeof R=="number"&&window.scrollTo(0,R)}catch(g){console.error(g),sessionStorage.removeItem(f)}}).toString();return h.createElement("script",W(x({},r),{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${m})(${pa(JSON.stringify(t||sr))}, ${pa(JSON.stringify(u))})`}}))}Wi.displayName="ScrollRestoration";function en(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Er(e){let t=h.useContext(tt);return _(t,en(e)),t}function Vi(e){let t=h.useContext(st);return _(t,en(e)),t}function Yi(e,{target:t,replace:r,mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s,useTransitions:u}={}){let m=vr(),f=Le(),v=Lt(e,{relative:i});return h.useCallback(g=>{if(gi(g,t)){g.preventDefault();let R=r!==void 0?r:ze(f)===ze(v),S=()=>m(e,{replace:R,mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s});u?h.startTransition(()=>S()):S()}},[f,m,v,r,a,n,t,e,o,i,l,s,u])}function hl(e){Z(typeof URLSearchParams!="undefined","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=h.useRef(lr(e)),r=h.useRef(!1),a=Le(),n=h.useMemo(()=>wi(a.search,r.current?null:t.current),[a.search]),o=vr(),i=h.useCallback((l,s)=>{const u=lr(typeof l=="function"?l(new URLSearchParams(n)):l);r.current=!0,o("?"+u,s)},[o,n]);return[n,i]}var Ji=0,Ki=()=>`__${String(++Ji)}__`;function Gi(){let{router:e}=Er("useSubmit"),{basename:t}=h.useContext(pe),r=Zo(),a=e.fetch,n=e.navigate;return h.useCallback((l,...s)=>A(null,[l,...s],function*(o,i={}){let{action:u,method:m,encType:f,formData:v,body:g}=Ei(o,t);if(i.navigate===!1){let R=i.fetcherKey||Ki();yield a(R,r,i.action||u,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:v,body:g,formMethod:i.method||m,formEncType:i.encType||f,flushSync:i.flushSync})}else yield n(i.action||u,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:v,body:g,formMethod:i.method||m,formEncType:i.encType||f,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})}),[a,n,t,r])}function Xi(e,{relative:t}={}){let{basename:r}=h.useContext(pe),a=h.useContext(Te);_(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o=x({},Lt(e||".",{relative:t})),i=Le();if(e==null){o.search=i.search;let l=new URLSearchParams(o.search),s=l.getAll("index");if(s.some(m=>m==="")){l.delete("index"),s.filter(f=>f).forEach(f=>l.append("index",f));let m=l.toString();o.search=m?`?${m}`:""}}return(!e||e===".")&&n.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:De([r,o.pathname])),ze(o)}var sr="react-router-scroll-positions",It={};function ur(e,t,r,a){let n=null;return a&&(r!=="/"?n=a(W(x({},e),{pathname:xe(e.pathname,r)||e.pathname}),t):n=a(e,t)),n==null&&(n=e.key),n}function qi({getKey:e,storageKey:t}={}){let{router:r}=Er("useScrollRestoration"),{restoreScrollPosition:a,preventScrollReset:n}
13=Vi("useScrollRestoration"),{basename:o}=h.useContext(pe),i=Le(),l=Ga(),s=ei();h.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),Qi(h.useCallback(()=>{if(s.state==="idle"){let u=ur(i,l,o,e);It[u]=window.scrollY}try{sessionStorage.setItem(t||sr,JSON.stringify(It))}catch(u){Z(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[s.state,e,o,i,l,t])),typeof document!="undefined"&&(h.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||sr);u&&(It=JSON.parse(u))}catch(u){}},[t]),h.useLayoutEffect(()=>{let u=r==null?void 0:r.enableScrollRestoration(It,()=>window.scrollY,e?(m,f)=>ur(m,f,o,e):void 0);return()=>u&&u()},[r,o,e]),h.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(u){Z(!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 Qi(e,t){let{capture:r}={};h.useEffect(()=>{let a=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,a),()=>{window.removeEventListener("pagehide",e,a)}},[e,r])}function Zi(e,{relative:t}={}){let r=h.useContext(pr);_(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Er("useViewTransitionState"),n=Lt(e,{relative:t});if(!r.isTransitioning)return!1;let o=xe(r.currentLocation.pathname,a)||r.currentLocation.pathname,i=xe(r.nextLocation.pathname,a)||r.nextLocation.pathname;return Ht(n.pathname,i)!=null||Ht(n.pathname,o)!=null}function ml(e){return h.createElement(ui,x({flushSync:Ln.flushSync},e))}export{Za as L,cl as N,dl as O,ml as R,Wi as S,il as a,vr as b,hl as c,Ho as d,Yi as e,nl as f,ti as g,fl as h,Ht as i,ma as j,ol as k,sl as l,Ra as m,Ga as n,ll as o,ul as p,qn as r,Le as u}; 14//# sourceMappingURL=npm.react-router.BDfxye5A.bundle.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.