const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-C0Bl3C-v.js","assets/jsx-runtime-NwRKtVrk.js","assets/statusUtils-G17j4Ng-.js","assets/button-CM-rzMOH.js","assets/ColorPresets-BBbJffTn.js","assets/space-Dvitgohy.js","assets/card-D7XvzVif.js","assets/spin-DV35Mdw9.js","assets/tag-C0Yg14A-.js","assets/useClosable-s-Ss4Zwd.js","assets/agent-D8tKYnoa.js","assets/request-Blbag3Ot.js","assets/chat-CqIY9PTi.js","assets/CopyOutlined-bJLUKQgS.js","assets/es-Do50EHua.js","assets/ExclamationCircleFilled-gmOeErIU.js","assets/BarsOutlined-UcCNWNvv.js","assets/WarningFilled-HhpRZ5xC.js","assets/flex-CfpySdsa.js","assets/chat-Iht936bQ.css","assets/conversation-BH-wCZkh.js","assets/table-By97ouEx.js","assets/Input-yLjViSX8.js","assets/useBreakpoint-BdDQSe50.js","assets/dropdown-DMnZiIxT.js","assets/move-KzMQarL_.js","assets/PurePanel-BhXcm5Bt.js","assets/pagination-BnmIuxKW.js","assets/radio-CkoyL693.js","assets/XinTable-Cyzgse09.js","assets/XinForm-ihfVpzb6.js","assets/ImageUploader-CHryWmjJ.js","assets/upload-CV7KMHYr.js","assets/progress-B8Wo5U8C.js","assets/tslib.es6-5i5FW2KX.js","assets/AuthButton-MNxRWjhj.js","assets/analysis-CXEH-AcX.js","assets/list-69SP5aW7.js","assets/row-Ddb-vj9X.js","assets/monitor-CNs-v-LN.js","assets/workplace-CTiucx4Z.js","assets/badge-BLoxw4wl.js","assets/icon-selector-DvJ69vm2.js","assets/image-uploader-CGZ_xy8d.js","assets/user-selector-JM4f9LCc.js","assets/xin-form-Dy8Xcis-.js","assets/xin-table-DIUcvkHY.js","assets/403-CcoghSKz.js","assets/result-C9ArRkbL.js","assets/404-C24BjnyR.js","assets/500-CbygX2w1.js","assets/first-CWdO0BUn.js","assets/second-jhD_Ira_.js","assets/third-D14BDVdB.js","assets/base-layout-QstweyWe.js","assets/descriptions-LfMkIYzo.js","assets/descriptions-BO-jm4UF.js","assets/timeline-BRrB0Mqu.js","assets/fix-header-CGiCwyVs.js","assets/fail-BWFg3qPE.js","assets/info-BQ-O7Xpy.js","assets/success-DGd93qo5.js","assets/warning-D2mOhMC6.js","assets/ai-B-FWBJej.js","assets/alert-DAtI4UaJ.js","assets/config-BRx7ukDN.js","assets/popconfirm-BkTOsppG.js","assets/dept-nMMSMr57.js","assets/useAuth-DKX3y3On.js","assets/dict-P-htQ-Wt.js","assets/item-CSGvZ_-5.js","assets/file-B57O110J.js","assets/info-kjw_3FpF.js","assets/mail-B_iDZSYp.js","assets/role-B5r_Io5w.js","assets/rule-BwIO_H8u.js","assets/storage-Bn7v8O54.js","assets/user-DIEoK18o.js","assets/profile-DNgTuhJ8.js"])))=>i.map(i=>d[i]); import{$ as e,$n as t,$t as n,A as r,At as i,B as a,Bn as o,Bt as s,C as c,Cn as l,Cr as u,Ct as d,D as f,Dr as p,Dt as m,E as h,Er as g,F as _,Fn as v,Ft as y,Gn as b,Gt as x,H as S,I as C,J as w,Jn as T,Jt as E,K as D,Kt as O,L as k,Ln as A,M as j,Mn as M,Mt as N,N as P,Nt as F,O as I,Or as L,Ot as R,Pn as z,Pt as B,Q as ee,Qn as V,Qt as H,R as te,Rn as U,Rt as W,S as G,Sn as ne,Sr as K,St as q,T as re,Tr as ie,Tt as ae,U as oe,Un as se,V as ce,Vn as le,W as ue,X as de,Xn as fe,Xt as J,Y as pe,Yn as me,Yt as he,Z as Y,Zn as ge,Zt as _e,_ as ve,_n as ye,_t as be,an as X,ar as xe,at as Se,b as Ce,br as we,cn as Te,d as Ee,dn as De,dr as Oe,dt as ke,en as Ae,er as je,et as Me,fn as Ne,fr as Pe,ft as Fe,g as Ie,h as Le,hn as Re,hr as ze,ht as Be,i as Ve,it as He,j as Ue,jn as We,jt as Ge,k as Ke,kt as qe,ln as Je,lr as Ye,m as Xe,mn as Ze,mt as Qe,n as $e,nn as et,nt as tt,on as nt,or as rt,p as it,pn as at,pr as ot,pt as st,qt as ct,r as lt,rn as ut,rr as dt,rt as ft,sn as pt,sr as mt,st as ht,t as gt,tn as _t,tr as vt,tt as yt,un as bt,ur as xt,ut as St,v as Ct,vr as wt,w as Tt,wn as Et,wr as Dt,wt as Ot,x as kt,xn as At,xr as jt,xt as Mt,y as Nt,yn as Pt,yt as Ft,zn as It}from"./jsx-runtime-NwRKtVrk.js";import{i as Lt,n as Rt,r as zt,t as Bt}from"./middleware-C7eu6FtN.js";import{t as Vt}from"./request-Blbag3Ot.js";import{n as Ht,r as Ut,t as Wt}from"./ExclamationCircleFilled-gmOeErIU.js";import{_ as Gt,b as Kt,c as qt,d as Jt,g as Yt,h as Xt,i as Zt,m as Qt,n as $t,p as en,r as tn,s as nn,t as rn,v as an,y as on}from"./CopyOutlined-bJLUKQgS.js";import{_ as sn,b as cn,f as ln,g as un,h as dn,l as fn,m as pn,n as mn,o as hn,p as gn,r as _n,t as vn,u as yn,v as bn,y as xn}from"./statusUtils-G17j4Ng-.js";import{n as Sn,t as Cn}from"./Input-yLjViSX8.js";import{n as wn,r as Tn,t as En}from"./useClosable-s-Ss4Zwd.js";import{a as Dn,i as On,r as kn,t as An}from"./useBreakpoint-BdDQSe50.js";import{a as jn,i as Mn,r as Nn,t as Pn}from"./ColorPresets-BBbJffTn.js";import{i as Fn,n as In,r as Ln,t as Rn}from"./button-CM-rzMOH.js";import{t as zn}from"./move-KzMQarL_.js";import{n as Bn,t as Vn}from"./TextArea-D4RcD0z1.js";import{i as Hn,r as Un,t as Wn}from"./space-Dvitgohy.js";import{r as Gn}from"./BarsOutlined-UcCNWNvv.js";import{n as Kn,t as qn}from"./PurePanel-BhXcm5Bt.js";import{a as Jn,i as Yn,n as Xn,o as Zn,s as Qn,t as $n}from"./dropdown-DMnZiIxT.js";import{A as er,H as tr,Ht as nr,J as rr,Mt as ir,N as ar,Rt as or,T as sr,U as cr,Ut as lr,V as ur,Wt as dr,a as fr,ft as pr,i as mr,j as Z,jt as hr,lt as gr,n as _r,o as vr,p as yr,r as br,t as xr,tt as Sr,u as Cr,ut as wr,v as Tr,z as Er}from"./es-Do50EHua.js";import{n as Dr,t as Or}from"./row-Ddb-vj9X.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Q=L(ie(),1),kr=L(u(),1),Ar=`modulepreload`,jr=function(e){return`/`+e},Mr={},Nr=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,new URL(`../../../src/node/plugins/importAnalysisBuild.ts`,import.meta.url)).href}r=o(t.map(t=>{if(t=jr(t,n),t=s(t),t in Mr)return;Mr[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Ar,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Pr=e=>{throw TypeError(e)},Fr=(e,t,n)=>t.has(e)||Pr(`Cannot `+n),Ir=(e,t,n)=>(Fr(e,t,`read from private field`),n?n.call(e):t.get(e)),Lr=(e,t,n)=>t.has(e)?Pr(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Rr=(e,t,n,r)=>(Fr(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),zr=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Br=/^[\\/]{2}/;function Vr(e,t){return t+e.replace(/\\/g,`/`)}var Hr=`popstate`;function Ur(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Wr(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return Yr(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:Xr(t)}return Qr(t,n,null,e)}function Gr(e,t){if(e===!1||e==null)throw Error(t)}function Kr(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function qr(){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 Yr(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Zr(t):t,state:n,key:t&&t.key||r||qr(),mask:i}}function Xr({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Zr(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Qr(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=Ur(e)?e:Yr(h.location,e,t);n&&n(r,e),l=u()+1;let d=Jr(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=Ur(e)?e:Yr(h.location,e,t);n&&n(r,e),l=u();let i=Jr(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return $r(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(Hr,d),c=e,()=>{i.removeEventListener(Hr,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function $r(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),Gr(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:Xr(t);return i=i.replace(/ $/,`%20`),!n&&Br.test(i)&&(i=r+i),new URL(i,r)}var ei,ti=class{constructor(e){if(Lr(this,ei,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(Ir(this,ei).has(e))return Ir(this,ei).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){Ir(this,ei).set(e,t)}};ei=new WeakMap;var ni=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function ri(e){return ni.has(e)}var ii=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function ai(e){return ii.has(e)}function oi(e){return e.index===!0}function si(e,t,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(Gr(e.index!==!0||!e.children,`Cannot specify children on an index route`),Gr(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),oi(e)){let n={...e,id:s};return r[s]=ci(n,t(n)),n}else{let n={...e,id:s,children:void 0};return r[s]=ci(n,t(n)),e.children&&(n.children=si(e.children,t,o,r,i)),n}})}function ci(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function li(e,t,n=`/`){return ui(e,t,n,!1)}function ui(e,t,n,r,i){let a=Ai((typeof t==`string`?Zr(t):t).pathname||`/`,n);if(a==null)return null;let o=i??fi(e),s=null,c=ki(a);for(let e=0;s==null&&e{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;Gr(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Bi([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(Gr(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),pi(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Ci(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Oi(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of mi(e.path))a(e,t,!0,n)}),t}function mi(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=mi(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function hi(e){e.sort((e,t)=>e.score===t.score?wi(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var gi=/^:[\w-]+$/,_i=3,vi=2,yi=1,bi=10,xi=-2,Si=e=>e===`*`;function Ci(e,t){let n=e.split(`/`),r=n.length;return n.some(Si)&&(r+=xi),t&&(r+=vi),n.filter(e=>!Si(e)).reduce((e,t)=>e+(gi.test(t)?_i:t===``?yi:bi),r)}function wi(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Ti(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Oi(e,t=!1,n=!0){Kr(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 r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ki(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return Kr(!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 Ai(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function ji({basename:e,pathname:t}){return t===`/`?e:Bi([e,t])}var Mi=e=>zr.test(e);function Ni(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Zr(e):e,a;return n?(n=zi(n),a=n.startsWith(`/`)?Pi(n.substring(1),`/`):Pi(n,t)):a=t,{pathname:a,search:Ui(r),hash:Wi(i)}}function Pi(e,t){let n=Vi(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Fi(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function Ii(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Li(e){let t=Ii(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Ri(e,t,n,r=!1){let i;typeof e==`string`?i=Zr(e):(i={...e},Gr(!i.pathname||!i.pathname.includes(`?`),Fi(`?`,`pathname`,`search`,i)),Gr(!i.pathname||!i.pathname.includes(`#`),Fi(`#`,`pathname`,`hash`,i)),Gr(!i.search||!i.search.includes(`#`),Fi(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Ni(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var zi=e=>e.replace(/[\\/]{2,}/g,`/`),Bi=e=>zi(e.join(`/`)),Vi=e=>e.replace(/\/+$/,``),Hi=e=>Vi(e).replace(/^\/*/,`/`),Ui=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Wi=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Gi=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Ki=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function qi(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ji(e){return Bi(e.map(e=>e.route.path).filter(Boolean))||`/`}var Yi=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Xi(e,t){let n=e;if(typeof n!=`string`||!zr.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Yi)try{let e=new URL(window.location.href),r=Br.test(n)?new URL(Vr(n,e.protocol)):new URL(n),a=Ai(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{Kr(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var Zi=Symbol(`Uninstrumented`);function Qi(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=ea(n.lazy,t.lazy,()=>void 0);e&&(r.lazy=e)}if(typeof t.lazy==`object`){let e=t.lazy;[`middleware`,`loader`,`action`].forEach(t=>{let i=e[t],a=n[`lazy.${t}`];if(typeof i==`function`&&a.length>0){let e=ea(a,i,()=>void 0);e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return[`loader`,`action`].forEach(e=>{let i=t[e];if(typeof i==`function`&&n[e].length>0){let t=i[Zi]??i,a=ea(n[e],t,(...e)=>na(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[Zi]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[Zi]??e,r=ea(n.middleware,t,(...e)=>na(e[0]));return r?(r[Zi]=t,r):e})),r}function $i(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}})),n.navigate.length>0){let t=e.navigate[Zi]??e.navigate,r=ea(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?Xr(n):`.`,...ra(e,r??{})}});r&&(r[Zi]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[Zi]??e.fetch,r=ea(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...ra(e,i??{})}});r&&(r[Zi]=t,e.fetch=r)}return e}function ea(e,t,n){return e.length===0?null:async(...r)=>{let i=await ta(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function ta(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error(`You cannot call instrumented handlers more than once`):o=ta(e,t,n,r-1),a=await o,Gr(a,`Expected a result`),a.type===`error`&&a.value instanceof Error?{status:`error`,error:a.value}:{status:`success`,error:void 0});try{await i(s,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}o||await s(),await o}else try{a={type:`success`,value:await n()}}catch(e){a={type:`error`,value:e}}return a||{type:`error`,value:Error(`No result assigned in instrumentation chain.`)}}function na(e){let{request:t,context:n,params:r,pattern:i}=e;return{request:ia(t),params:{...r},pattern:i,context:aa(n)}}function ra(e,t){return{currentUrl:Xr(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 ia(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function aa(e){if(sa(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var oa=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function sa(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===oa}var ca=[`POST`,`PUT`,`PATCH`,`DELETE`],la=new Set(ca),ua=[`GET`,...ca],da=new Set(ua),fa=new Set([301,302,303,307,308]),pa=new Set([307,308]),ma={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},ha={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ga={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},_a=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),va=`remix-router-transitions`,ya=Symbol(`ResetLoaderData`),ba,xa,Sa,Ca,wa=class{constructor(e){Lr(this,ba),Lr(this,xa),Lr(this,Sa),Lr(this,Ca),Rr(this,ba,e),Rr(this,xa,fi(e))}get stableRoutes(){return Ir(this,ba)}get activeRoutes(){return Ir(this,Sa)??Ir(this,ba)}get branches(){return Ir(this,Ca)??Ir(this,xa)}get hasHMRRoutes(){return Ir(this,Sa)!=null}setRoutes(e){Rr(this,ba,e),Rr(this,xa,fi(e))}setHmrRoutes(e){Rr(this,Sa,e),Rr(this,Ca,fi(e))}commitHmrRoutes(){Ir(this,Sa)&&(Rr(this,ba,Ir(this,Sa)),Rr(this,xa,Ir(this,Ca)),Rr(this,Sa,void 0),Rr(this,Ca,void 0))}};ba=new WeakMap,xa=new WeakMap,Sa=new WeakMap,Ca=new WeakMap;function Ta(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;Gr(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||_a,a=i;if(e.instrumentations){let t=e.instrumentations;a=e=>({...i(e),...Qi(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new wa(si(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||Ha,u={...e.future},d=null,f=new Set,p=null,m=null,h=null,g=null,_=e.hydrationData!=null,v=ui(s.activeRoutes,e.history.location,c,!1,s.branches),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=mo(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=po(s.activeRoutes);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&Ne(v,s.activeRoutes,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=Ne(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}else if(v.some(e=>e.route.lazy))x=!1,S=!x;else if(!v.some(e=>Aa(e.route)))x=!0,S=!x;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=v;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}S=!1,x=!0,r.forEach(e=>{let r=ja(e.route,t,n);S||=r.renderFallback,x&&=!r.shouldLoad})}let C,w={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,renderFallback:S,navigation:ma,restoreScrollPosition:e.hydrationData==null?null:!1,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},T=`POP`,E=null,D=!1,O,k=!1,A=new Map,j=null,M=!1,N=!1,P=new Set,F=new Map,I=0,L=-1,R=new Map,z=new Set,B=new Map,ee=new Map,V=new Set,H=new Map,te,U=null;function W(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(te){te(),te=void 0;return}Kr(H.size===0||r!=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 i=De({currentLocation:w.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{te=e});e.history.go(r*-1),Ee(i,{state:`blocked`,location:n,proceed(){Ee(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(w.blockers);e.set(i,ga),K({blockers:e})}}),E?.resolve(),E=null;return}return ae(t,n)}),n){Ro(t,A);let e=()=>zo(t,A);t.addEventListener(`pagehide`,e),j=()=>t.removeEventListener(`pagehide`,e)}return w.initialized||ae(`POP`,w.location,{initialHydration:!0}),C}function G(){d&&d(),j&&j(),f.clear(),O&&O.abort(),w.fetchers.forEach((e,t)=>ye(w.fetchers,t)),w.blockers.forEach((e,t)=>Te(t))}function ne(e){if(f.add(e),p){let{newErrors:t}=p;p=null,e(w,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>f.delete(e)}function K(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),w={...w,...e};let n=[],r=[];w.fetchers.forEach((e,t)=>{e.state===`idle`&&(V.has(t)?n.push(t):r.push(t))}),V.forEach(e=>{!w.fetchers.has(e)&&!F.has(e)&&n.push(e)}),f.size===0&&(p={newErrors:e.errors??null}),[...f].forEach(r=>r(w,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>ye(w.fetchers,e)),r.forEach(e=>w.fetchers.delete(e))}function q(t,n,{flushSync:r}={}){let i=w.actionData!=null&&w.navigation.formMethod!=null&&ko(w.navigation.formMethod)&&w.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?w.actionData:null;let o=n.loaderData?lo(w.loaderData,n.loaderData,n.matches||[],n.errors):w.loaderData,c=w.blockers;c.size>0&&(c=new Map(c),c.forEach((e,t)=>c.set(t,ga)));let l=M?!1:Me(t,n.matches||w.matches),u=D===!0||w.navigation.formMethod!=null&&ko(w.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),M||T===`POP`||(T===`PUSH`?e.history.push(t,t.state):T===`REPLACE`&&e.history.replace(t,t.state));let d;if(T===`POP`){let e=A.get(w.location.pathname);e&&e.has(t.pathname)?d={currentLocation:w.location,nextLocation:t}:A.has(t.pathname)&&(d={currentLocation:t,nextLocation:w.location})}else if(k){let e=A.get(w.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),A.set(w.location.pathname,e)),d={currentLocation:w.location,nextLocation:t}}K({...n,actionData:a,loaderData:o,historyAction:T,location:t,initialized:!0,renderFallback:!1,navigation:ma,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),T=`POP`,D=!1,k=!1,M=!1,N=!1,E?.resolve(),E=null,U?.resolve(),U=null}async function re(t,n){if(E?.resolve(),E=null,typeof t==`number`){E||=Bo();let n=E.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=Oa(!1,Da(w.location,w.matches,c,t,n?.fromRouteId,n?.relative),n),o;n?.mask&&(o={pathname:``,search:``,hash:``,...typeof n.mask==`string`?Zr(n.mask):{...w.location.mask,...n.mask}});let s=w.location,l=Yr(s,r,n&&n.state,void 0,o);l={...l,...e.history.encodeLocation(l)};let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&ko(i.formMethod)&&i.formAction===w.location.pathname+w.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=De({currentLocation:s,nextLocation:l,historyAction:d});if(m){Ee(m,{state:`blocked`,location:l,proceed(){Ee(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),re(t,n)},reset(){let e=new Map(w.blockers);e.set(m,ga),K({blockers:e})}});return}await ae(d,l,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})}function ie(){U||=Bo(),he(),K({revalidation:`loading`});let e=U.promise;return w.navigation.state===`submitting`?e:w.navigation.state===`idle`?(ae(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),e):(ae(T||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:k===!0}),e)}async function ae(t,n,r){O&&O.abort(),O=null,T=t,M=(r&&r.startUninterruptedRevalidation)===!0,je(w.location,w.matches),D=(r&&r.preventScrollReset)===!0,k=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&w.matches&&w.matches.length>0&&!y?w.matches:ui(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&w.initialized&&!N&&_o(w.location,n)&&!(r&&r.submission&&ko(r.submission.formMethod))){q(n,{matches:a},{flushSync:o});return}let l=Ne(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),!a){let{error:e,notFoundMatches:t,route:r}=Oe(n.pathname);q(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;O=new AbortController;let d=ro(e.history,n,O.signal,r&&r.submission),f=e.getContext?await e.getContext():new ti,p;if(r&&r.pendingError)p=[fo(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&ko(r.submission.formMethod)){let i=await oe(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if(So(t)&&qi(t.error)&&t.error.status===404){O=null,q(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=No(n,a,t,r.submission),o=!1,l.active=!1,d=ro(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await se(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(O=null,q(n,{matches:h||a,...uo(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function oe(t,n,i,l,u,d,f,p,m={}){if(he(),K({navigation:Po(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await Pe(l,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=po(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=fo(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}else if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Oe(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=jo(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:mo(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await pe(t,n,Ja(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(Co(h)){let n;return n=m&&m.replace!=null?m.replace:no(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===w.location.pathname+w.location.search,await J(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(So(h)){let e=fo(l,g.route.id);return(m&&m.replace)!==!0&&(T=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function se(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||No(n,i,l,p),x=p||m||Mo(b),S=!M&&!g;if(d){if(S){let e=ce(v);K({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await Pe(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=po(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=fo(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}else if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=Oe(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:T,revalidatingFetchers:E}=ka(t,u,a,o,e.history,w,i,x,n,g?[]:r,g===!0,N,P,V,B,z,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(L=++I,!e.dataStrategy&&!T.some(e=>e.shouldLoad)&&!T.some(e=>e.route.middleware&&e.route.middleware.length>0)&&E.length===0){let e=new Map(w.fetchers),t=Se(e);return q(n,{matches:i,loaderData:{},errors:v&&So(v[1])?{[v[0]]:v[1].error}:null,...uo(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=ce(v);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=le(E)),K(e,{flushSync:_})}E.forEach(e=>{X(e.key),e.controller&&F.set(e.key,e.controller)});let D=()=>E.forEach(e=>X(e.key));O&&O.signal.addEventListener(`abort`,D);let{loaderResults:k,fetcherResults:A}=await me(T,E,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener(`abort`,D),E.forEach(e=>F.delete(e.key));let j=ho(k);if(j)return await J(t,j.result,!0,{replace:h}),{shortCircuited:!0};if(j=ho(A),j)return z.add(j.key),await J(t,j.result,!0,{replace:h}),{shortCircuited:!0};let R=new Map(w.fetchers),{loaderData:ee,errors:H}=co(w,i,k,v,E,A,R);g&&w.errors&&(H={...w.errors,...H});let te=Se(R),U=Ce(L,R),W=te||U||E.length>0;return{matches:i,loaderData:ee,errors:H,...W?{workingFetchers:R}:{}}}function ce(e){if(e&&!So(e[1]))return{[e[0]]:e[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function le(e){let t=new Map(w.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=Fo(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function ue(t,n,r,i){X(t);let a=(i&&i.flushSync)===!0,o=s.activeRoutes,l=Da(w.location,w.matches,c,r,n,i?.relative),u=ui(o,l,c,!1,s.branches),d=Ne(u,o,l);if(d.active&&d.matches&&(u=d.matches),!u){ge(t,n,mo(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=Oa(!0,l,i);if(m){ge(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new ti,g=(i&&i.preventScrollReset)===!0;if(p&&ko(p.formMethod)){await de(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}B.set(t,{routeId:n,path:f}),await fe(t,n,f,u,h,d.active,a,g,p)}async function de(t,n,i,l,u,d,f,p,m,h){he(),B.delete(t),Y(t,Io(m,w.fetchers.get(t)),{flushSync:f});let g=new AbortController,_=ro(e.history,i,g.signal,m);if(d){let e=await Pe(l,new URL(_.url).pathname,_.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){ge(t,n,e.error,{flushSync:f});return}else if(e.matches)l=e.matches;else{ge(t,n,mo(404,{pathname:i}),{flushSync:f});return}}let v=jo(l,i);if(!v.route.action&&!v.route.lazy){ge(t,n,mo(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}F.set(t,g);let y=I,b=Ja(a,o,_,i,l,v,r,u),x=await pe(_,i,b,u,t),S=x[v.route.id];if(!S){for(let e of b)if(x[e.route.id]){S=x[e.route.id];break}}if(_.signal.aborted){F.get(t)===g&&F.delete(t);return}if(V.has(t)){if(Co(S)||So(S)){Y(t,Lo(void 0));return}}else{if(Co(S))if(F.delete(t),L>y){Y(t,Lo(void 0));return}else return z.add(t),Y(t,Fo(m)),J(_,S,!1,{fetcherSubmission:m,preventScrollReset:p});if(So(S)){ge(t,n,S.error);return}}let C=w.navigation.location||w.location,E=ro(e.history,C,g.signal),D=s.activeRoutes,k=w.navigation.state===`idle`?w.matches:ui(D,w.navigation.location,c,!1,s.branches);Gr(k,`Didn't find any matches after fetcher action`);let A=++I;R.set(t,A);let{dsMatches:j,revalidatingFetchers:M}=ka(E,u,a,o,e.history,w,k,m,C,r,!1,N,P,V,B,z,D,c,e.patchRoutesOnNavigation!=null,s.branches,[v.route.id,S],h),ee=Fo(m,S.data),H=new Map(w.fetchers);H.set(t,ee),M.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=H.get(t),r=Fo(void 0,n?n.data:void 0);H.set(t,r),X(t),e.controller&&F.set(t,e.controller)}),K({fetchers:H});let te=()=>M.forEach(e=>X(e.key));g.signal.addEventListener(`abort`,te);let{loaderResults:U,fetcherResults:W}=await me(j,M,E,C,u);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,te),R.delete(t),F.delete(t),M.forEach(e=>F.delete(e.key));let G=w.fetchers.has(t),ne=e=>{if(!G)return e;let n=new Map(e.fetchers);return n.set(t,Lo(S.data)),{...e,fetchers:n}},re=ho(U);if(re)return w=ne(w),J(E,re.result,!1,{preventScrollReset:p});if(re=ho(W),re)return z.add(re.key),w=ne(w),J(E,re.result,!1,{preventScrollReset:p});let ie=new Map(w.fetchers);G&&ie.set(t,Lo(S.data));let{loaderData:ae,errors:oe}=co(w,k,U,void 0,M,W,ie);Ce(A,ie),w.navigation.state===`loading`&&A>L?(Gr(T,`Expected pending action`),O&&O.abort(),q(w.navigation.location,{matches:k,loaderData:ae,errors:oe,fetchers:ie})):(K({errors:oe,loaderData:lo(w.loaderData,ae,k,oe),fetchers:ie}),N=!1)}async function fe(t,n,i,s,c,l,u,d,f){let p=w.fetchers.get(t);Y(t,Fo(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=ro(e.history,i,m.signal);if(l){let e=await Pe(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){ge(t,n,e.error,{flushSync:u});return}else if(e.matches)s=e.matches;else{ge(t,n,mo(404,{pathname:i}),{flushSync:u});return}}let g=jo(s,i);F.set(t,m);let _=I,v=await pe(h,i,Ja(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(F.get(t)===m&&F.delete(t),!h.signal.aborted){if(V.has(t)){Y(t,Lo(void 0));return}if(Co(y))if(L>_){Y(t,Lo(void 0));return}else{z.add(t),await J(h,y,!1,{preventScrollReset:d});return}if(So(y)){ge(t,n,y.error);return}Y(t,Lo(y.data))}}async function J(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(E?.resolve(),E=null),i.response.headers.has(`X-Remix-Revalidate`)&&(N=!0);let d=i.response.headers.get(`Location`);Gr(d,`Expected a Location header on the redirect Response`),d=no(d,new URL(r.url),c,e.history);let f=Yr(w.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(Mi(d)){let n=$r(t,d,!0);e=n.origin!==t.location.origin||Ai(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}O=null;let p=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:m,formAction:h,formEncType:g}=w.navigation;!o&&!s&&m&&h&&g&&(o=Mo(w.navigation));let _=o||s;pa.has(i.response.status)&&_&&ko(_.formMethod)?await ae(p,f,{submission:{..._,formAction:d},preventScrollReset:l||D,enableViewTransition:a?k:void 0}):await ae(p,f,{overrideNavigation:No(f,[],p,o),fetcherSubmission:s,preventScrollReset:l||D,enableViewTransition:a?k:void 0})}async function pe(e,t,n,r,i){let a,o={};try{a=await Ya(l,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!ko(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!w.loaderData.hasOwnProperty(e.route.id)&&(!w.errors||!w.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(xo(r)){let i=r.result;o[t]={type:`redirect`,response:$a(i,e,t,n,c)}}else o[t]=await Qa(r);return o}async function me(e,t,n,r,i){let a=pe(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await pe(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}else return Promise.resolve({[e.key]:{type:`error`,error:mo(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function he(){N=!0,B.forEach((e,t)=>{F.has(t)&&P.add(t),X(t)})}function Y(e,t,n={}){let r=new Map(w.fetchers);r.set(e,t),K({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function ge(e,t,n,r={}){let i=fo(w.matches,t),a=new Map(w.fetchers);ye(a,e),K({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function _e(e){return ee.set(e,(ee.get(e)||0)+1),V.has(e)&&V.delete(e),w.fetchers.get(e)||ha}function ve(e,t){X(e,t?.reason),Y(e,Lo(null))}function ye(e,t){let n=w.fetchers.get(t);F.has(t)&&!(n&&n.state===`loading`&&R.has(t))&&X(t),B.delete(t),R.delete(t),z.delete(t),V.delete(t),P.delete(t),e.delete(t)}function be(e){let t=(ee.get(e)||0)-1;t<=0?(ee.delete(e),V.add(e)):ee.set(e,t),K({fetchers:new Map(w.fetchers)})}function X(e,t){let n=F.get(e);n&&(n.abort(t),F.delete(e))}function xe(e,t){for(let n of e){let e=t.get(n);Gr(e,`Expected fetcher: ${n}`);let r=Lo(e.data);t.set(n,r)}}function Se(e){let t=[],n=!1;for(let r of z){let i=e.get(r);Gr(i,`Expected fetcher: ${r}`),i.state===`loading`&&(z.delete(r),t.push(r),n=!0)}return xe(t,e),n}function Ce(e,t){let n=[];for(let[r,i]of R)if(i0}function we(e,t){let n=w.blockers.get(e)||ga;return H.get(e)!==t&&H.set(e,t),n}function Te(e){w.blockers.delete(e),H.delete(e)}function Ee(e,t){let n=w.blockers.get(e)||ga;Gr(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(w.blockers);r.set(e,t),K({blockers:r})}function De({currentLocation:e,nextLocation:t,historyAction:n}){if(H.size===0)return;H.size>1&&Kr(!1,`A router only supports one blocker at a time`);let r=Array.from(H.entries()),[i,a]=r[r.length-1],o=w.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function Oe(e){let t=mo(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=po(n);return{notFoundMatches:r,route:i,error:t}}function ke(e,t,n){if(m=e,g=t,h=n||null,!_&&w.navigation===ma){_=!0;let e=Me(w.location,w.matches);e!=null&&K({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function Ae(e,t){return h&&h(e,t.map(e=>di(e,w.loaderData)))||e.key}function je(e,t){if(m&&g){let n=Ae(e,t);m[n]=g()}}function Me(e,t){if(m){let n=Ae(e,t),r=m[n];if(typeof r==`number`)return r}return null}function Ne(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:ui(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:ui(n,r,c,!0,e)}}return{active:!1,matches:null}}async function Pe(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||Fa(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=ui(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=ui(s.activeRoutes,n,c,!0,u),!(f&&l.lengthe.route.id===t[n].route.id)}function Ie(e){o={},s.setHmrRoutes(si(e,a,void 0,o))}function Le(e,t,n=!1){Fa(e,t,s,o,a,n),s.hasHMRRoutes||K({})}return C={get basename(){return c},get future(){return u},get state(){return w},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:W,subscribe:ne,enableScrollRestoration:ke,navigate:re,fetch:ue,revalidate:ie,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:_e,resetFetcher:ve,deleteFetcher:be,dispose:G,getBlocker:we,deleteBlocker:Te,patchRoutes:Le,_internalFetchControllers:F,_internalSetRoutes:Ie,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){K(e)}},e.instrumentations&&(C=$i(C,e.instrumentations.map(e=>e.router).filter(Boolean))),C}function Ea(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function Da(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=Ri(r||`.`,Li(o),Ai(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=Ao(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=ji({basename:n,pathname:c.pathname})),Xr(c)}function Oa(e,t,n){if(!n||!Ea(n))return{path:t};if(n.formMethod&&!Oo(n.formMethod))return{path:t,error:mo(405,{method:n.formMethod})};let r=()=>({path:t,error:mo(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=go(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!ko(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n} `,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}else if(n.formEncType===`application/json`){if(!ko(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}Gr(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=ao(n.formData),s=n.formData;else if(n.body instanceof FormData)o=ao(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=oo(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=oo(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(ko(c.formMethod))return{path:t,submission:c};let l=Zr(t);return e&&l.search&&Ao(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:Xr(l),submission:c}}function ka(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?So(b[1])?b[1].error:b[1].data:void 0,C=i.createURL(a.location),w=i.createURL(c),T;if(u&&a.errors){let e=Object.keys(a.errors)[0];T=o.findIndex(t=>t.route.id===e)}else if(b&&So(b[1])){let e=b[0];T=o.findIndex(t=>t.route.id===e)-1}let E=b?b[1].statusCode:void 0,D=E&&E>=400,O={currentUrl:C,currentParams:a.matches[0]?.params||{},nextUrl:w,nextParams:o[0].params,...s,actionResult:S,actionStatus:E},k=Ji(o),A=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!Aa(s))f=!1;else if(u){let{shouldLoad:e}=ja(s,a.loaderData,a.errors);f=e}else Ma(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return qa(n,r,e,c,k,i,l,t,f);let p=!1;typeof x==`boolean`?p=x:D?p=!1:d||C.pathname+C.search===w.pathname+w.search?p=!0:C.search===w.search?Na(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p};return qa(n,r,e,c,k,i,l,t,Pa(i,m),m,x)}),j=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,b=ui(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;j.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let S=jo(b,e.path),C=new AbortController,w=ro(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=Ja(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=Ja(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:D?!1:d;let a={...O,defaultShouldRevalidate:i};Pa(S,a)&&(T=Ja(n,r,w,e.path,b,S,l,t,a))}T&&j.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:A,revalidatingFetchers:j}}function Aa(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function ja(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Aa(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function Ma(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function Na(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function Pa(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function Fa(e,t,n,r,i,a){let o;if(e){let t=r[e];Gr(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>Ia(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=si(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;et.children?.some(t=>Ia(e,t)))??!1:!1}var La=new WeakMap,Ra=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(Gr(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=La.get(i);o||(o={},La.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=ri(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)Kr(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)Kr(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},za=new WeakMap;function Ba(e,t,n,r,i){let a=n[e.id];if(Gr(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=za.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{Gr(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=ai(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?Kr(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?Kr(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return za.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=Ra({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function Va(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Ha(e){return e.matches.some(e=>e.route.middleware)?Ua(e,()=>Va(e)):Va(e)}function Ua(e,t){return Wa(e,t,e=>{if(Do(e))throw e;return e},yo,n);function n(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:`error`,result:t}}));{let{matches:r}=e,i=fo(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:`error`,result:t}})}}}async function Wa(e,t,n,r,i){let{matches:a,...o}=e;return await Ga(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Ga(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await Ga(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function Ka(e,t,n,r,i){let a=Ra({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Ba(r.route,ko(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function qa(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=Ka(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?Pa(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?Pa(a,{...l,defaultShouldRevalidate:e}):Pa(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!ko(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(ko(n.method)||!p)?Xa({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function Ja(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?qa(e,t,n,r,Ji(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Ka(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Ya(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:io(t,n),pattern:Ji(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return Ua(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function Xa({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=ko(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:io(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a)if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw mo(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}else if(t)c=await f(t);else{let t=new URL(e.url);throw mo(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function Za(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Qa(e){let{result:t,type:n}=e;if(To(t)){let e;try{e=await Za(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new Ki(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?wo(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:vo(t),statusCode:qi(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:qi(t)?t.status:void 0}:wo(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function $a(e,t,n,r,i){let a=e.headers.get(`Location`);if(Gr(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!Mi(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=Da(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var eo=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function to(e){try{return eo.includes(new URL(e).protocol)}catch{return!1}}function no(e,t,n,r){if(Mi(e)){let r=e,i=Br.test(r)?new URL(Vr(r,t.protocol)):new URL(r);if(to(i.toString()))throw Error(`Invalid redirect location`);let a=Ai(i.pathname,n)!=null;if(i.origin===t.origin&&a)return zi(i.pathname)+i.search+i.hash}try{if(to(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function ro(e,t,n,r){let i=e.createURL(go(t)).toString(),a={signal:n};if(r&&ko(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):t===`text/plain`?a.body=r.text:t===`application/x-www-form-urlencoded`&&r.formData?a.body=ao(r.formData):a.body=r.formData}return new Request(i,a)}function io(e,t){let n=new URL(e.url),r=typeof t==`string`?Zr(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);n.search=e.size?`?${e.toString()}`:``}else n.search=``;return n.hash=r.hash||``,n}function ao(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function oo(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function so(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&So(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(Gr(!Co(f),`Cannot handle redirect results in processLoaderData`),So(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=fo(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=ya),c||(c=!0,s=qi(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function co(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=so(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(Gr(s,`Did not find corresponding fetcher result`),So(s)){let t=fo(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(Co(s))Gr(!1,`Unhandled fetcher revalidation redirect`);else{let e=Lo(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function lo(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==ya).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function uo(e){return e?So(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function fo(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function po(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function mo(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new Ki(e||500,o,Error(s),!0)}function ho(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(Co(r))return{key:n,result:r}}}function go(e){return Xr({...typeof e==`string`?Zr(e):e,hash:``})}function _o(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash?!0:t.hash!==``}function vo(e){return new Ki(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function yo(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&bo(t))}function bo(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function xo(e){return To(e.result)&&fa.has(e.result.status)}function So(e){return e.type===`error`}function Co(e){return(e&&e.type)===`redirect`}function wo(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function To(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Eo(e){return fa.has(e)}function Do(e){return To(e)&&Eo(e.status)&&e.headers.has(`Location`)}function Oo(e){return da.has(e.toUpperCase())}function ko(e){return la.has(e.toUpperCase())}function Ao(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function jo(e,t){let n=typeof t==`string`?Zr(t).search:t.search;if(e[e.length-1].route.index&&Ao(n||``))return e[e.length-1];let r=Ii(e);return r[r.length-1]}function Mo(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function No(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Po(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function Fo(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 Io(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 Lo(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 Ro(e,t){try{let n=e.sessionStorage.getItem(va);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function zo(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(va,JSON.stringify(n))}catch(e){Kr(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Bo(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Vo=Q.createContext(null);Vo.displayName=`DataRouter`;var Ho=Q.createContext(null);Ho.displayName=`DataRouterState`;var Uo=Q.createContext(!1);function Wo(){return Q.useContext(Uo)}var Go=Q.createContext({isTransitioning:!1});Go.displayName=`ViewTransition`;var Ko=Q.createContext(new Map);Ko.displayName=`Fetchers`;var qo=Q.createContext(null);qo.displayName=`Await`;var Jo=Q.createContext(null);Jo.displayName=`Navigation`;var Yo=Q.createContext(null);Yo.displayName=`Location`;var Xo=Q.createContext({outlet:null,matches:[],isDataRoute:!1});Xo.displayName=`Route`;var Zo=Q.createContext(null);Zo.displayName=`RouteError`;var Qo=`REACT_ROUTER_ERROR`,$o=`REDIRECT`,es=`ROUTE_ERROR_RESPONSE`;function ts(e){if(e.startsWith(`${Qo}:${$o}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function ns(e){if(e.startsWith(`${Qo}:${es}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Ki(t.status,t.statusText,t.data)}catch{}}function rs(e,{relative:t}={}){Gr(is(),`useHref() may be used only in the context of a component.`);let{basename:n,navigator:r}=Q.useContext(Jo),{hash:i,pathname:a,search:o}=fs(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Bi([n,a])),r.createHref({pathname:s,search:o,hash:i})}function is(){return Q.useContext(Yo)!=null}function as(){return Gr(is(),`useLocation() may be used only in the context of a component.`),Q.useContext(Yo).location}var os=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function ss(e){Q.useContext(Jo).static||Q.useLayoutEffect(e)}function cs(){let{isDataRoute:e}=Q.useContext(Xo);return e?As():ls()}function ls(){Gr(is(),`useNavigate() may be used only in the context of a component.`);let e=Q.useContext(Vo),{basename:t,navigator:n}=Q.useContext(Jo),{matches:r}=Q.useContext(Xo),{pathname:i}=as(),a=JSON.stringify(Li(r)),o=Q.useRef(!1);return ss(()=>{o.current=!0}),Q.useCallback((r,s={})=>{if(Kr(o.current,os),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Ri(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Bi([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var us=Q.createContext(null);function ds(e){let t=Q.useContext(Xo).outlet;return Q.useMemo(()=>t&&Q.createElement(us.Provider,{value:e},t),[t,e])}function fs(e,{relative:t}={}){let{matches:n}=Q.useContext(Xo),{pathname:r}=as(),i=JSON.stringify(Li(n));return Q.useMemo(()=>Ri(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function ps(e,t,n){Gr(is(),`useRoutes() may be used only in the context of a component.`);let{navigator:r}=Q.useContext(Jo),{matches:i}=Q.useContext(Xo),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Ms(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant (or called \`useRoutes()\`) at "${s}" (under ) 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. Please change the parent to .`)}let u=as(),d;if(t){let e=typeof t==`string`?Zr(t):t;Gr(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):li(e,{pathname:p});Kr(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),Kr(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let h=bs(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Bi([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Bi([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?Q.createElement(Yo.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function ms(){let e=ks(),t=qi(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=Q.createElement(Q.Fragment,null,Q.createElement(`p`,null,`💿 Hey developer 👋`),Q.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,Q.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,Q.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),Q.createElement(Q.Fragment,null,Q.createElement(`h2`,null,`Unexpected Application Error!`),Q.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?Q.createElement(`pre`,{style:i},n):null,o)}var hs=Q.createElement(ms,null),gs=class extends Q.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?t.error:e.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`){let t=ns(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:Q.createElement(Xo.Provider,{value:this.props.routeContext},Q.createElement(Zo.Provider,{value:e,children:this.props.component}));return this.context?Q.createElement(vs,{error:e},t):t}};gs.contextType=Uo;var _s=new WeakMap;function vs({children:e,error:t}){let{basename:n}=Q.useContext(Jo);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=ts(t.digest);if(e){let r=_s.get(t);if(r)throw r;let i=Xi(e.location,n),a=i.absoluteURL||i.to;if(to(a))throw Error(`Invalid redirect location`);if(Yi&&!_s.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw _s.set(t,n),n}return Q.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function ys({routeContext:e,match:t,children:n}){let r=Q.useContext(Vo);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),Q.createElement(Xo.Provider,{value:e},n)}function bs(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);Gr(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Ji(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||hs,o&&(s<0&&c===0?(Ms(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?Q.createElement(n.route.Component,null):n.route.element?n.route.element:e,Q.createElement(ys,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?Q.createElement(gs,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function xs(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ss(e){let t=Q.useContext(Vo);return Gr(t,xs(e)),t}function Cs(e){let t=Q.useContext(Ho);return Gr(t,xs(e)),t}function ws(e){let t=Q.useContext(Xo);return Gr(t,xs(e)),t}function Ts(e){let t=ws(e),n=t.matches[t.matches.length-1];return Gr(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Es(){return Ts(`useRouteId`)}function Ds(){let e=Cs(`useNavigation`);return Q.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function Os(){let{matches:e,loaderData:t}=Cs(`useMatches`);return Q.useMemo(()=>e.map(e=>di(e,t)),[e,t])}function ks(){let e=Q.useContext(Zo),t=Cs(`useRouteError`),n=Ts(`useRouteError`);return e===void 0?t.errors?.[n]:e}function As(){let{router:e}=Ss(`useNavigate`),t=Ts(`useNavigate`),n=Q.useRef(!1);return ss(()=>{n.current=!0}),Q.useCallback(async(r,i={})=>{Kr(n.current,os),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var js={};function Ms(e,t,n){!t&&!js[e]&&(js[e]=!0,Kr(!1,n))}var Ns={};function Ps(e,t){!e&&!Ns[t]&&(Ns[t]=!0,console.warn(t))}var Fs=Q.useOptimistic,Is=()=>void 0;function Ls(e){return Fs?Fs(e):[e,Is]}function Rs(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Kr(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:Q.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Kr(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:Q.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Kr(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:Q.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var zs=[`HydrateFallback`,`hydrateFallbackElement`],Bs=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function Vs({router:e,flushSync:t,onError:n,useTransitions:r}){r=Wo()||r;let[i,a]=Q.useState(e.state),[o,s]=Ls(i),[c,l]=Q.useState(),[u,d]=Q.useState({isTransitioning:!1}),[f,p]=Q.useState(),[m,h]=Q.useState(),[g,_]=Q.useState(),v=Q.useRef(new Map),y=Q.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:g})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:Ji(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&v.current.set(t,e.data)}),o.forEach(e=>v.current.delete(e)),Ps(u===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `` 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 y=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(Ps(g==null||y,"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."),!g||!y){t&&u?t(()=>a(i)):r===!1?a(i):Q.startTransition(()=>{r===!0&&s(e=>Hs(e,i)),a(i)});return}if(t&&u){t(()=>{m&&(f?.resolve(),m.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:g.currentLocation,nextLocation:g.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>h(n));return}m?(f?.resolve(),m.skipTransition(),_({state:i,currentLocation:g.currentLocation,nextLocation:g.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}))},[e.window,t,m,f,r,s,n]);Q.useLayoutEffect(()=>e.subscribe(y),[e,y]),Q.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new Bs)},[u]),Q.useEffect(()=>{if(f&&c&&e.window){let t=c,n=f.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):Q.startTransition(()=>{r===!0&&s(e=>Hs(e,t)),a(t)}),await n});i.finished.finally(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})}),h(i)}},[c,f,e.window,r,s]),Q.useEffect(()=>{f&&c&&o.location.key===c.location.key&&f.resolve()},[f,m,o.location,c]),Q.useEffect(()=>{!u.isTransitioning&&g&&(l(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),_(void 0))},[u.isTransitioning,g]);let b=Q.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),x=e.basename||`/`,S=Q.useMemo(()=>({router:e,navigator:b,static:!1,basename:x,onError:n}),[e,b,x,n]);return Q.createElement(Q.Fragment,null,Q.createElement(Vo.Provider,{value:S},Q.createElement(Ho.Provider,{value:o},Q.createElement(Ko.Provider,{value:v.current},Q.createElement(Go.Provider,{value:u},Q.createElement(qs,{basename:x,location:o.location,navigationType:o.historyAction,navigator:b,useTransitions:r},Q.createElement(Us,{routes:e.routes,manifest:e.manifest,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function Hs(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var Us=Q.memo(Ws);function Ws({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return ps(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Gs({to:e,replace:t,state:n,relative:r}){Gr(is(),` may be used only in the context of a component.`);let{static:i}=Q.useContext(Jo);Kr(!i,` must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.`);let{matches:a}=Q.useContext(Xo),{pathname:o}=as(),s=cs(),c=Ri(e,Li(a),o,r===`path`),l=JSON.stringify(c);return Q.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function Ks(e){return ds(e.context)}function qs({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){Gr(!is(),`You cannot render a inside another . You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=Q.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=Zr(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=Q.useMemo(()=>{let e=Ai(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return Kr(h!=null,` is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the won't render anything.`),h==null?null:Q.createElement(Jo.Provider,{value:c},Q.createElement(Yo.Provider,{children:t,value:h}))}Q.Component;var Js=`get`,Ys=`application/x-www-form-urlencoded`;function Xs(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Zs(e){return Xs(e)&&e.tagName.toLowerCase()===`button`}function Qs(e){return Xs(e)&&e.tagName.toLowerCase()===`form`}function $s(e){return Xs(e)&&e.tagName.toLowerCase()===`input`}function ec(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function tc(e,t){return e.button===0&&(!t||t===`_self`)&&!ec(e)}function nc(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function rc(e,t){let n=nc(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var ic=null;function ac(){if(ic===null)try{new FormData(document.createElement(`form`),0),ic=!1}catch{ic=!0}return ic}var oc=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function sc(e){return e!=null&&!oc.has(e)?(Kr(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${Ys}"`),null):e}function cc(e,t){let n,r,i,a,o;if(Qs(e)){let o=e.getAttribute(`action`);r=o?Ai(o,t):null,n=e.getAttribute(`method`)||Js,i=sc(e.getAttribute(`enctype`))||Ys,a=new FormData(e)}else if(Zs(e)||$s(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a