import{n as e}from"./rolldown-runtime.Bh1tDfsg.js";import{i as t}from"./vendor-react.22oolo8W.js";var n=e(t(),1),r=`modulepreload`,i=function(e){return`/zhangtian/`+e},a={},o=function(e,t,n){let o=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),s=document.querySelector(`meta[property=csp-nonce]`),c=s?.nonce||s?.getAttribute(`nonce`);function l(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function u(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}o=l(t.map(t=>{if(t=i(t,n),t=u(t),t in a)return;a[t]=!0;let o=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.href===t&&(!o||r.rel===`stylesheet`))return}let s=document.createElement(`link`);if(s.rel=o?`stylesheet`:r,o||(s.as=`script`),s.crossOrigin=``,s.href=t,c&&s.setAttribute(`nonce`,c),document.head.appendChild(s),o)return new Promise((e,n)=>{s.addEventListener(`load`,e),s.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function s(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return o.then(t=>{for(let e of t||[])e.status===`rejected`&&s(e.reason);return e().catch(s)})},s=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,c=/^[\\/]{2}/;function l(e,t){return t+e.replace(/\\/g,`/`)}var u=`popstate`;function d(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function f(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=y(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),_(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){let n=e.document.querySelector(`base`),r=``;if(n&&n.getAttribute(`href`)){let t=e.location.href,n=t.indexOf(`#`);r=n===-1?t:t.slice(0,n)}return r+`#`+(typeof t==`string`?t:v(t))}function r(e,t){m(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return b(t,n,r,e)}function p(e,t){if(e===!1||e==null)throw Error(t)}function m(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function h(){return Math.random().toString(36).substring(2,10)}function g(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 _(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?y(t):t,state:n,key:t&&t.key||r||h(),mask:i}}function v({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 y(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 b(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=f();l??(l=0,o.replaceState({...o.state,idx:l},``));function f(){return(o.state||{idx:null}).idx}function p(){s=`POP`;let e=f(),t=e==null?null:e-l;l=e,c&&c({action:s,location:y.location,delta:t})}function m(e,t){s=`PUSH`;let r=d(e)?e:_(y.location,e,t);n&&n(r,e),l=f()+1;let u=g(r,l),p=y.createHref(r.mask||r);try{o.pushState(u,``,p)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(p)}a&&c&&c({action:s,location:y.location,delta:1})}function h(e,t){s=`REPLACE`;let r=d(e)?e:_(y.location,e,t);n&&n(r,e),l=f();let i=g(r,l),u=y.createHref(r.mask||r);o.replaceState(i,``,u),a&&c&&c({action:s,location:y.location,delta:0})}function v(e){return x(i,e)}let y={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(u,p),c=e,()=>{i.removeEventListener(u,p),c=null}},createHref(e){return t(i,e)},createURL:v,encodeLocation(e){let t=v(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:m,replace:h,go(e){return o.go(e)}};return y}function x(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),p(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:v(t);return i=i.replace(/ $/,`%20`),!n&&c.test(i)&&(i=r+i),new URL(i,r)}function S(e,t,n=`/`){return C(e,t,n,!1)}function C(e,t,n,r,i){let a=k((typeof t==`string`?y(t):t).pathname||`/`,n);if(a==null)return null;let o=i??T(e),s=null,c=pe(a);for(let e=0;s==null&&e<o.length;++e)s=ue(o[e],c,r);return s}function w(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function T(e){let t=E(e);return ee(t),t}function E(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{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;p(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=j([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(p(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),E(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:ce(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=fe(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 D(e.path))a(e,t,!0,n)}),t}function D(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=D(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 ee(e){e.sort((e,t)=>e.score===t.score?le(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var te=/^:[\w-]+$/,ne=3,re=2,ie=1,ae=10,oe=-2,se=e=>e===`*`;function ce(e,t){let n=e.split(`/`),r=n.length;return n.some(se)&&(r+=oe),t&&(r+=re),n.filter(e=>!se(e)).reduce((e,t)=>e+(te.test(t)?ne:t===``?ie:ae),r)}function le(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 ue(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?de(u,l,s.matcher,s.compiledParams):O(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=O({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:j([a,d.pathname]),pathnameBase:be(j([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=j([a,d.pathnameBase]))}return o}function O(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=fe(e.path,e.caseSensitive,e.end);return de(e,t,n,r)}function de(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{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 fe(e,t=!1,n=!0){m(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 pe(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return m(!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 k(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 me(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?y(e):e,a;return n?(n=ye(n),a=n.startsWith(`/`)?he(n.substring(1),`/`):he(n,t)):a=t,{pathname:a,search:xe(r),hash:Se(i)}}function he(e,t){let n=M(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function A(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 <Link to="..."> and the router will parse it for you.`}function ge(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function _e(e){let t=ge(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function ve(e,t,n,r=!1){let i;typeof e==`string`?i=y(e):(i={...e},p(!i.pathname||!i.pathname.includes(`?`),A(`?`,`pathname`,`search`,i)),p(!i.pathname||!i.pathname.includes(`#`),A(`#`,`pathname`,`hash`,i)),p(!i.search||!i.search.includes(`#`),A(`#`,`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=me(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var ye=e=>e.replace(/[\\/]{2,}/g,`/`),j=e=>ye(e.join(`/`)),M=e=>e.replace(/\/+$/,``),be=e=>M(e).replace(/^\/*/,`/`),xe=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Se=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Ce=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 we(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Te(e){return j(e.map(e=>e.route.path).filter(Boolean))||`/`}var Ee=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function De(e,t){let n=e;if(typeof n!=`string`||!s.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ee)try{let e=new URL(window.location.href),r=c.test(n)?new URL(l(n,e.protocol)):new URL(n),a=k(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{m(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Oe=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Oe);var ke=[`GET`,...Oe];new Set(ke);var Ae=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function je(e){try{return Ae.includes(new URL(e).protocol)}catch{return!1}}var N=n.createContext(null);N.displayName=`DataRouter`;var P=n.createContext(null);P.displayName=`DataRouterState`;var Me=n.createContext(!1);function Ne(){return n.useContext(Me)}var Pe=n.createContext({isTransitioning:!1});Pe.displayName=`ViewTransition`;var Fe=n.createContext(new Map);Fe.displayName=`Fetchers`;var Ie=n.createContext(null);Ie.displayName=`Await`;var F=n.createContext(null);F.displayName=`Navigation`;var I=n.createContext(null);I.displayName=`Location`;var L=n.createContext({outlet:null,matches:[],isDataRoute:!1});L.displayName=`Route`;var R=n.createContext(null);R.displayName=`RouteError`;var Le=`REACT_ROUTER_ERROR`,Re=`REDIRECT`,ze=`ROUTE_ERROR_RESPONSE`;function Be(e){if(e.startsWith(`${Le}:${Re}:{`))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 Ve(e){if(e.startsWith(`${Le}:${ze}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Ce(t.status,t.statusText,t.data)}catch{}}function He(e,{relative:t}={}){p(z(),`useHref() may be used only in the context of a <Router> component.`);let{basename:r,navigator:i}=n.useContext(F),{hash:a,pathname:o,search:s}=V(e,{relative:t}),c=o;return r!==`/`&&(c=o===`/`?r:j([r,o])),i.createHref({pathname:c,search:s,hash:a})}function z(){return n.useContext(I)!=null}function B(){return p(z(),`useLocation() may be used only in the context of a <Router> component.`),n.useContext(I).location}var Ue=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function We(e){n.useContext(F).static||n.useLayoutEffect(e)}function Ge(){let{isDataRoute:e}=n.useContext(L);return e?ut():Ke()}function Ke(){p(z(),`useNavigate() may be used only in the context of a <Router> component.`);let e=n.useContext(N),{basename:t,navigator:r}=n.useContext(F),{matches:i}=n.useContext(L),{pathname:a}=B(),o=JSON.stringify(_e(i)),s=n.useRef(!1);return We(()=>{s.current=!0}),n.useCallback((n,i={})=>{if(m(s.current,Ue),!s.current)return;if(typeof n==`number`){r.go(n);return}let c=ve(n,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:j([t,c.pathname])),(i.replace?r.replace:r.push)(c,i.state,i)},[t,r,o,a,e])}n.createContext(null);function qe(){let{matches:e}=n.useContext(L);return e[e.length-1]?.params??{}}function V(e,{relative:t}={}){let{matches:r}=n.useContext(L),{pathname:i}=B(),a=JSON.stringify(_e(r));return n.useMemo(()=>ve(e,JSON.parse(a),i,t===`path`),[e,a,i,t])}function Je(e,t){return Ye(e,t)}function Ye(e,t,r){p(z(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:i}=n.useContext(F),{matches:a}=n.useContext(L),o=a[a.length-1],s=o?o.params:{},c=o?o.pathname:`/`,l=o?o.pathnameBase:`/`,u=o&&o.route;{let e=u&&u.path||``;ft(c,!u||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let d=B(),f;if(t){let e=typeof t==`string`?y(t):t;p(l===`/`||e.pathname?.startsWith(l),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=d;let h=f.pathname||`/`,g=h;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);g=`/`+h.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let _=r&&r.state.matches.length?r.state.matches.map(e=>Object.assign(e,{route:r.manifest[e.route.id]||e.route})):S(e,{pathname:g});m(u||_!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),m(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.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.`);let v=tt(_&&_.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:j([l,i.encodeLocation?i.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:j([l,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),a,r);return t&&v?n.createElement(I.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...f},navigationType:`POP`}},v):v}function Xe(){let e=lt(),t=we(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i=`rgba(200,200,200, 0.5)`,a={padding:`0.5rem`,backgroundColor:i},o={padding:`2px 4px`,backgroundColor:i},s=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),s=n.createElement(n.Fragment,null,n.createElement(`p`,null,`💿 Hey developer 👋`),n.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,n.createElement(`code`,{style:o},`ErrorBoundary`),` or`,` `,n.createElement(`code`,{style:o},`errorElement`),` prop on your route.`)),n.createElement(n.Fragment,null,n.createElement(`h2`,null,`Unexpected Application Error!`),n.createElement(`h3`,{style:{fontStyle:`italic`}},t),r?n.createElement(`pre`,{style:a},r):null,s)}var Ze=n.createElement(Xe,null),Qe=class extends n.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=Ve(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:n.createElement(L.Provider,{value:this.props.routeContext},n.createElement(R.Provider,{value:e,children:this.props.component}));return this.context?n.createElement($e,{error:e},t):t}};Qe.contextType=Me;var H=new WeakMap;function $e({children:e,error:t}){let{basename:r}=n.useContext(F);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Be(t.digest);if(e){let i=H.get(t);if(i)throw i;let a=De(e.location,r),o=a.absoluteURL||a.to;if(je(o))throw Error(`Invalid redirect location`);if(Ee&&!H.get(t))if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw H.set(t,n),n}return n.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function et({routeContext:e,match:t,children:r}){let i=n.useContext(N);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),n.createElement(L.Provider,{value:e},r)}function tt(e,t=[],r){let i=r?.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let a=e,o=i?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);p(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(r&&i){s=i.renderFallback;for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:n}=i,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||n[t.route.id]===void 0);if(t.route.lazy||o){r.isStatic&&(s=!0),a=c>=0?a.slice(0,c+1):[a[0]];break}}}}let l=r?.onError,u=i&&l?(e,t)=>{l(e,{location:i.location,params:i.matches?.[0]?.params??{},pattern:Te(i.matches),errorInfo:t})}:void 0;return a.reduceRight((e,r,l)=>{let d,f=!1,p=null,m=null;i&&(d=o&&r.route.id?o[r.route.id]:void 0,p=r.route.errorElement||Ze,s&&(c<0&&l===0?(ft(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):c===l&&(f=!0,m=r.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,l+1)),g=()=>{let t;return t=d?p:f?m:r.route.Component?n.createElement(r.route.Component,null):r.route.element?r.route.element:e,n.createElement(et,{match:r,routeContext:{outlet:e,matches:h,isDataRoute:i!=null},children:t})};return i&&(r.route.ErrorBoundary||r.route.errorElement||l===0)?n.createElement(Qe,{location:i.location,revalidation:i.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function U(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function nt(e){let t=n.useContext(N);return p(t,U(e)),t}function rt(e){let t=n.useContext(P);return p(t,U(e)),t}function it(e){let t=n.useContext(L);return p(t,U(e)),t}function at(e){let t=it(e),n=t.matches[t.matches.length-1];return p(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function ot(){return at(`useRouteId`)}function st(){let e=rt(`useNavigation`);return n.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function ct(){let{matches:e,loaderData:t}=rt(`useMatches`);return n.useMemo(()=>e.map(e=>w(e,t)),[e,t])}function lt(){let e=n.useContext(R),t=rt(`useRouteError`),r=at(`useRouteError`);return e===void 0?t.errors?.[r]:e}function ut(){let{router:e}=nt(`useNavigate`),t=at(`useNavigate`),r=n.useRef(!1);return We(()=>{r.current=!0}),n.useCallback(async(n,i={})=>{m(r.current,Ue),r.current&&(typeof n==`number`?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...i}))},[e,t])}var dt={};function ft(e,t,n){!t&&!dt[e]&&(dt[e]=!0,m(!1,n))}n.memo(pt);function pt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Ye(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function mt(e){p(!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 ht({basename:e=`/`,children:t=null,location:r,navigationType:i=`POP`,navigator:a,static:o=!1,useTransitions:s}){p(!z(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=n.useMemo(()=>({basename:c,navigator:a,static:o,useTransitions:s,future:{}}),[c,a,o,s]);typeof r==`string`&&(r=y(r));let{pathname:u=`/`,search:d=``,hash:f=``,state:h=null,key:g=`default`,mask:_}=r,v=n.useMemo(()=>{let e=k(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:h,key:g,mask:_},navigationType:i}},[c,u,d,f,h,g,i,_]);return m(v!=null,`<Router basename="${c}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:n.createElement(F.Provider,{value:l},n.createElement(I.Provider,{children:t,value:v}))}function gt({children:e,location:t}){return Je(_t(e),t)}n.Component;function _t(e,t=[]){let r=[];return n.Children.forEach(e,(e,i)=>{if(!n.isValidElement(e))return;let a=[...t,i];if(e.type===n.Fragment){r.push.apply(r,_t(e.props.children,a));return}p(e.type===mt,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),p(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let o={id:e.props.id||a.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(o.children=_t(e.props.children,a)),r.push(o)}),r}var W=`get`,G=`application/x-www-form-urlencoded`;function K(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function vt(e){return K(e)&&e.tagName.toLowerCase()===`button`}function yt(e){return K(e)&&e.tagName.toLowerCase()===`form`}function bt(e){return K(e)&&e.tagName.toLowerCase()===`input`}function xt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function St(e,t){return e.button===0&&(!t||t===`_self`)&&!xt(e)}var q=null;function Ct(){if(q===null)try{new FormData(document.createElement(`form`),0),q=!1}catch{q=!0}return q}var wt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Tt(e){return e!=null&&!wt.has(e)?(m(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${G}"`),null):e}function Et(e,t){let n,r,i,a,o;if(yt(e)){let o=e.getAttribute(`action`);r=o?k(o,t):null,n=e.getAttribute(`method`)||W,i=Tt(e.getAttribute(`enctype`))||G,a=new FormData(e)}else if(vt(e)||bt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?k(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||W,i=Tt(e.getAttribute(`formenctype`))||Tt(o.getAttribute(`enctype`))||G,a=new FormData(o,e),!Ct()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(K(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=W,r=null,i=G,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Dt={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Ot=/[&><\u2028\u2029]/g;function kt(e){return e.replace(Ot,e=>Dt[e])}function At(e,t){if(e===!1||e==null)throw Error(t)}function jt(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&k(i.pathname,t)===`/`?i.pathname=`${M(t)}/_root.${r}`:i.pathname=`${M(i.pathname)}.${r}`,i}async function Mt(e,t){if(e.id in t)return t[e.id];try{let n=await o(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Nt(e){return e!=null&&typeof e.page==`string`}function Pt(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Ft(e,t,n){return Bt((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Mt(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Pt).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function It(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Lt(e,t,{includeHydrateFallback:n}={}){return Rt(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Rt(e){return[...new Set(e)]}function zt(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Bt(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Nt(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(zt(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function J(){let e=n.useContext(N);return At(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Vt(){let e=n.useContext(P);return At(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Y=n.createContext(void 0);Y.displayName=`FrameworkContext`;function X(){let e=n.useContext(Y);return At(e,`You must render this element inside a <HydratedRouter> element`),e}function Ht(e,t){let r=n.useContext(Y),[i,a]=n.useState(!1),[o,s]=n.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=n.useRef(null);n.useEffect(()=>{if(e===`render`&&s(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),n.useEffect(()=>{if(i){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[i]);let m=()=>{a(!0)},h=()=>{a(!1),s(!1)};return r?e===`intent`?[o,p,{onFocus:Z(c,m),onBlur:Z(l,h),onMouseEnter:Z(u,m),onMouseLeave:Z(d,h),onTouchStart:Z(f,m)}]:[o,p,{}]:[!1,p,{}]}function Z(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Ut({page:e,...t}){let r=Ne(),{nonce:i}=X(),{router:a}=J(),o=n.useMemo(()=>S(a.routes,e,a.basename),[a.routes,e,a.basename]);return o?(t.nonce==null&&i&&(t={...t,nonce:i}),r?n.createElement(Gt,{page:e,matches:o,...t}):n.createElement(Kt,{page:e,matches:o,...t})):null}function Wt(e){let{manifest:t,routeModules:r}=X(),[i,a]=n.useState([]);return n.useEffect(()=>{let n=!1;return Ft(e,t,r).then(e=>{n||a(e)}),()=>{n=!0}},[e,t,r]),i}function Gt({page:e,matches:t,...r}){let i=B(),{future:a}=X(),{basename:o}=J(),s=n.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=jt(e,o,a.v8_trailingSlashAwareDataRequests,`rsc`),r=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?r=!0:s.push(e.route.id);return r&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[o,a.v8_trailingSlashAwareDataRequests,e,i,t]);return n.createElement(n.Fragment,null,s.map(e=>n.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...r})))}function Kt({page:e,matches:t,...r}){let i=B(),{future:a,manifest:o,routeModules:s}=X(),{basename:c}=J(),{loaderData:l,matches:u}=Vt(),d=n.useMemo(()=>It(e,t,u,o,i,`data`),[e,t,u,o,i]),f=n.useMemo(()=>It(e,t,u,o,i,`assets`),[e,t,u,o,i]),p=n.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=new Set,r=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&s[e.route.id]?.shouldRevalidate||t.hasClientLoader?r=!0:n.add(e.route.id))}),n.size===0)return[];let u=jt(e,c,a.v8_trailingSlashAwareDataRequests,`data`);return r&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[c,a.v8_trailingSlashAwareDataRequests,l,i,o,d,t,e,s]),m=n.useMemo(()=>Lt(f,o),[f,o]),h=Wt(f);return n.createElement(n.Fragment,null,p.map(e=>n.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...r})),m.map(e=>n.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...r})),h.map(({key:e,link:t})=>n.createElement(`link`,{key:e,nonce:r.nonce,...t,crossOrigin:t.crossOrigin??r.crossOrigin})))}function qt(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}n.Component;var Jt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Jt&&(window.__reactRouterVersion=`7.18.1`)}catch{}function Yt({basename:e,children:t,useTransitions:r,window:i}){let a=n.useRef();a.current??=f({window:i,v5Compat:!0});let o=a.current,[s,c]=n.useState({action:o.action,location:o.location}),l=n.useCallback(e=>{r===!1?c(e):n.startTransition(()=>c(e))},[r]);return n.useLayoutEffect(()=>o.listen(l),[o,l]),n.createElement(ht,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:o,useTransitions:r})}function Xt({basename:e,children:t,history:r,useTransitions:i}){let[a,o]=n.useState({action:r.action,location:r.location}),s=n.useCallback(e=>{i===!1?o(e):n.startTransition(()=>o(e))},[i]);return n.useLayoutEffect(()=>r.listen(s),[r,s]),n.createElement(ht,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:r,useTransitions:i})}Xt.displayName=`unstable_HistoryRouter`;var Zt=n.forwardRef(function({onClick:e,discover:t=`render`,prefetch:r=`none`,relative:i,reloadDocument:a,replace:o,mask:c,state:l,target:u,to:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g){let{basename:_,navigator:v,useTransitions:y}=n.useContext(F),b=typeof d==`string`&&s.test(d),x=De(d,_);d=x.to;let S=He(d,{relative:i}),C=B(),w=null;if(c){let e=ve(c,[],C.mask?C.mask.pathname:`/`,!0);_!==`/`&&(e.pathname=e.pathname===`/`?_:j([_,e.pathname])),w=v.createHref(e)}let[T,E,D]=Ht(r,h),ee=an(d,{replace:o,mask:c,state:l,target:u,preventScrollReset:f,relative:i,viewTransition:p,defaultShouldRevalidate:m,useTransitions:y});function te(t){e&&e(t),t.defaultPrevented||ee(t)}let ne=!(x.isExternal||a),re=n.createElement(`a`,{...h,...D,href:(ne?w:void 0)||x.absoluteURL||S,onClick:ne?te:e,ref:qt(g,E),target:u,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?n.createElement(n.Fragment,null,re,n.createElement(Ut,{page:S})):re});Zt.displayName=`Link`;var Qt=n.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:r=``,end:i=!1,style:a,to:o,viewTransition:s,children:c,...l},u){let d=V(o,{relative:l.relative}),f=B(),p=n.useContext(P),{navigator:m,basename:h}=n.useContext(F),g=p!=null&&pn(d)&&s===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=k(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!i&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!i&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof r==`function`?r(C):[r,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof a==`function`?a(C):a;return n.createElement(Zt,{...l,"aria-current":w,className:T,ref:u,style:E,to:o,viewTransition:s},typeof c==`function`?c(C):c)});Qt.displayName=`NavLink`;var $t=n.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:r,reloadDocument:i,replace:a,state:o,method:c=W,action:l,onSubmit:u,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g)=>{let{useTransitions:_}=n.useContext(F),v=cn(),y=ln(l,{relative:d}),b=c.toLowerCase()===`get`?`get`:`post`,x=typeof l==`string`&&s.test(l);return n.createElement(`form`,{ref:g,method:b,action:y,onSubmit:i?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let i=e.nativeEvent.submitter,s=i?.getAttribute(`formmethod`)||c,l=()=>v(i||e.currentTarget,{fetcherKey:t,method:s,navigate:r,replace:a,state:o,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m});_&&r!==!1?n.startTransition(()=>l()):l()},...h,"data-discover":!x&&e===`render`?`true`:void 0})});$t.displayName=`Form`;function en({getKey:e,storageKey:t,...r}){let i=n.useContext(Y),{basename:a}=n.useContext(F),o=B(),s=ct();dn({getKey:e,storageKey:t});let c=n.useMemo(()=>{if(!i||!e)return null;let t=$(o,s,a,e);return t===o.key?null:t},[]);if(!i||i.isSpaMode)return null;let l=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return r.nonce==null&&i?.nonce&&(r.nonce=i.nonce),n.createElement(`script`,{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${kt(JSON.stringify(t||un))}, ${kt(JSON.stringify(c))})`}})}en.displayName=`ScrollRestoration`;function tn(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function nn(e){let t=n.useContext(N);return p(t,tn(e)),t}function rn(e){let t=n.useContext(P);return p(t,tn(e)),t}function an(e,{target:t,replace:r,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=Ge(),f=B(),p=V(e,{relative:s});return n.useCallback(m=>{if(St(m,t)){m.preventDefault();let t=r===void 0?v(f)===v(p):r,h=()=>d(e,{replace:t,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l});u?n.startTransition(()=>h()):h()}},[f,d,p,r,i,a,t,e,o,s,c,l,u])}var on=0,sn=()=>`__${String(++on)}__`;function cn(){let{router:e}=nn(`useSubmit`),{basename:t}=n.useContext(F),r=ot(),i=e.fetch,a=e.navigate;return n.useCallback(async(e,n={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Et(e,t);if(n.navigate===!1){let e=n.fetcherKey||sn();await i(e,r,n.action||o,{defaultShouldRevalidate:n.defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:l,body:u,formMethod:n.method||s,formEncType:n.encType||c,flushSync:n.flushSync})}else await a(n.action||o,{defaultShouldRevalidate:n.defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:l,body:u,formMethod:n.method||s,formEncType:n.encType||c,replace:n.replace,state:n.state,fromRouteId:r,flushSync:n.flushSync,viewTransition:n.viewTransition})},[i,a,t,r])}function ln(e,{relative:t}={}){let{basename:r}=n.useContext(F),i=n.useContext(L);p(i,`useFormAction must be used inside a RouteContext`);let[a]=i.matches.slice(-1),o={...V(e||`.`,{relative:t})},s=B();if(e==null){o.search=s.search;let e=new URLSearchParams(o.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();o.search=n?`?${n}`:``}}return(!e||e===`.`)&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,`?index&`):`?index`),r!==`/`&&(o.pathname=o.pathname===`/`?r:j([r,o.pathname])),v(o)}var un=`react-router-scroll-positions`,Q={};function $(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:k(e.pathname,n)||e.pathname},t)),i??=e.key,i}function dn({getKey:e,storageKey:t}={}){let{router:r}=nn(`useScrollRestoration`),{restoreScrollPosition:i,preventScrollReset:a}=rn(`useScrollRestoration`),{basename:o}=n.useContext(F),s=B(),c=ct(),l=st();n.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),fn(n.useCallback(()=>{if(l.state===`idle`){let t=$(s,c,o,e);Q[t]=window.scrollY}try{sessionStorage.setItem(t||un,JSON.stringify(Q))}catch(e){m(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,o,s,c,t])),typeof document<`u`&&(n.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||un);e&&(Q=JSON.parse(e))}catch{}},[t]),n.useLayoutEffect(()=>{let t=r?.enableScrollRestoration(Q,()=>window.scrollY,e?(t,n)=>$(t,n,o,e):void 0);return()=>t&&t()},[r,o,e]),n.useLayoutEffect(()=>{if(i!==!1){if(typeof i==`number`){window.scrollTo(0,i);return}try{if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{m(!1,`"${s.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[s,i,a]))}function fn(e,t){let{capture:r}=t||{};n.useEffect(()=>{let t=r==null?void 0:{capture:r};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,r])}function pn(e,{relative:t}={}){let r=n.useContext(Pe);p(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=nn(`useViewTransitionState`),a=V(e,{relative:t});if(!r.isTransitioning)return!1;let o=k(r.currentLocation.pathname,i)||r.currentLocation.pathname,s=k(r.nextLocation.pathname,i)||r.nextLocation.pathname;return O(a.pathname,s)!=null||O(a.pathname,o)!=null}export{B as a,gt as i,Zt as n,qe as o,mt as r,o as s,Yt as t};