import{r as i}from"./vendor-react-core-DRQGgXXF.js";/** * react-router v7.9.5 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */var le="popstate";function Se(e={}){function t(r,a){let{pathname:o,search:l,hash:c}=r.location;return G("",{pathname:o,search:l,hash:c},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:B(a)}return $e(t,n,null,e)}function R(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function L(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ke(){return Math.random().toString(36).substring(2,10)}function ie(e,t){return{usr:e.state,key:e.key,idx:t}}function G(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?I(t):t,state:n,key:t&&t.key||r||ke()}}function B({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 I(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 $e(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:o=!1}=r,l=a.history,c="POP",u=null,s=f();s==null&&(s=0,l.replaceState({...l.state,idx:s},""));function f(){return(l.state||{idx:null}).idx}function d(){c="POP";let h=f(),y=h==null?null:h-s;s=h,u&&u({action:c,location:w.location,delta:y})}function m(h,y){c="PUSH";let x=G(w.location,h,y);s=f()+1;let p=ie(x,s),E=w.createHref(x);try{l.pushState(p,"",E)}catch(b){if(b instanceof DOMException&&b.name==="DataCloneError")throw b;a.location.assign(E)}o&&u&&u({action:c,location:w.location,delta:1})}function g(h,y){c="REPLACE";let x=G(w.location,h,y);s=f();let p=ie(x,s),E=w.createHref(x);l.replaceState(p,"",E),o&&u&&u({action:c,location:w.location,delta:0})}function v(h){return Fe(h)}let w={get action(){return c},get location(){return e(a,l)},listen(h){if(u)throw new Error("A history only accepts one active listener");return a.addEventListener(le,d),u=h,()=>{a.removeEventListener(le,d),u=null}},createHref(h){return t(a,h)},createURL:v,encodeLocation(h){let y=v(h);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:m,replace:g,go(h){return l.go(h)}};return w}function Fe(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),R(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:B(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function fe(e,t,n="/"){return Ne(e,t,n,!1)}function Ne(e,t,n,r){let a=typeof t=="string"?I(t):t,o=$(a.pathname||"/",n);if(o==null)return null;let l=de(e);Ie(l);let c=null;for(let u=0;c==null&&u{let f={relativePath:s===void 0?l.path||"":s,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(r)&&u)return;R(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length)}let d=k([r,f.relativePath]),m=n.concat(f);l.children&&l.children.length>0&&(R(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),de(l.children,t,m,d,u)),!(l.path==null&&!l.index)&&t.push({path:d,score:We(d,l.index),routesMeta:m})};return e.forEach((l,c)=>{var u;if(l.path===""||!((u=l.path)!=null&&u.includes("?")))o(l,c);else for(let s of he(l.path))o(l,c,!0,s)}),t}function he(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return a?[o,""]:[o];let l=he(r.join("/")),c=[];return c.push(...l.map(u=>u===""?o:[o,u].join("/"))),a&&c.push(...l),c.map(u=>e.startsWith("/")&&u===""?"/":u)}function Ie(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Ue(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Te=/^:[\w-]+$/,De=3,Me=2,Oe=1,Be=10,Ae=-2,ue=e=>e==="*";function We(e,t){let n=e.split("/"),r=n.length;return n.some(ue)&&(r+=Ae),t&&(r+=Me),n.filter(a=>!ue(a)).reduce((a,o)=>a+(Te.test(o)?De:o===""?Oe:Be),r)}function Ue(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function He(e,t,n=!1){let{routesMeta:r}=e,a={},o="/",l=[];for(let c=0;c{if(f==="*"){let v=c[m]||"";l=o.slice(0,o.length-v.length).replace(/(.)\/+$/,"$1")}const g=c[m];return d&&!g?s[f]=void 0:s[f]=(g||"").replace(/%2F/g,"/"),s},{}),pathname:o,pathnameBase:l,pattern:e}}function _e(e,t=!1,n=!0){L(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=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,u)=>(r.push({paramName:c,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function je(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return L(!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 $(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 Ve(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?I(e):e;return{pathname:n?n.startsWith("/")?n:ze(n,t):t,search:Ye(r),hash:qe(a)}}function ze(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Y(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 Je(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Q(e){let t=Je(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Z(e,t,n,r=!1){let a;typeof e=="string"?a=I(e):(a={...e},R(!a.pathname||!a.pathname.includes("?"),Y("?","pathname","search",a)),R(!a.pathname||!a.pathname.includes("#"),Y("#","pathname","hash",a)),R(!a.search||!a.search.includes("#"),Y("#","search","hash",a)));let o=e===""||a.pathname==="",l=o?"/":a.pathname,c;if(l==null)c=n;else{let d=t.length-1;if(!r&&l.startsWith("..")){let m=l.split("/");for(;m[0]==="..";)m.shift(),d-=1;a.pathname=m.join("/")}c=d>=0?t[d]:"/"}let u=Ve(a,c),s=l&&l!=="/"&&l.endsWith("/"),f=(o||l===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(s||f)&&(u.pathname+="/"),u}var k=e=>e.join("/").replace(/\/\/+/g,"/"),Ke=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ye=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,qe=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Ge(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var pe=["POST","PUT","PATCH","DELETE"];new Set(pe);var Xe=["GET",...pe];new Set(Xe);var T=i.createContext(null);T.displayName="DataRouter";var J=i.createContext(null);J.displayName="DataRouterState";i.createContext(!1);var me=i.createContext({isTransitioning:!1});me.displayName="ViewTransition";var Qe=i.createContext(new Map);Qe.displayName="Fetchers";var Ze=i.createContext(null);Ze.displayName="Await";var S=i.createContext(null);S.displayName="Navigation";var A=i.createContext(null);A.displayName="Location";var C=i.createContext({outlet:null,matches:[],isDataRoute:!1});C.displayName="Route";var ee=i.createContext(null);ee.displayName="RouteError";function et(e,{relative:t}={}){R(D(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=i.useContext(S),{hash:a,pathname:o,search:l}=W(e,{relative:t}),c=o;return n!=="/"&&(c=o==="/"?n:k([n,o])),r.createHref({pathname:c,search:l,hash:a})}function D(){return i.useContext(A)!=null}function F(){return R(D(),"useLocation() may be used only in the context of a component."),i.useContext(A).location}var ye="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ge(e){i.useContext(S).static||i.useLayoutEffect(e)}function ve(){let{isDataRoute:e}=i.useContext(C);return e?mt():tt()}function tt(){R(D(),"useNavigate() may be used only in the context of a component.");let e=i.useContext(T),{basename:t,navigator:n}=i.useContext(S),{matches:r}=i.useContext(C),{pathname:a}=F(),o=JSON.stringify(Q(r)),l=i.useRef(!1);return ge(()=>{l.current=!0}),i.useCallback((u,s={})=>{if(L(l.current,ye),!l.current)return;if(typeof u=="number"){n.go(u);return}let f=Z(u,JSON.parse(o),a,s.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:k([t,f.pathname])),(s.replace?n.replace:n.push)(f,s.state,s)},[t,n,o,a,e])}var nt=i.createContext(null);function rt(e){let t=i.useContext(C).outlet;return i.useMemo(()=>t&&i.createElement(nt.Provider,{value:e},t),[t,e])}function Xt(){let{matches:e}=i.useContext(C),t=e[e.length-1];return t?t.params:{}}function W(e,{relative:t}={}){let{matches:n}=i.useContext(C),{pathname:r}=F(),a=JSON.stringify(Q(n));return i.useMemo(()=>Z(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function at(e,t){return we(e,t)}function we(e,t,n,r,a){var x;R(D(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=i.useContext(S),{matches:l}=i.useContext(C),c=l[l.length-1],u=c?c.params:{},s=c?c.pathname:"/",f=c?c.pathnameBase:"/",d=c&&c.route;{let p=d&&d.path||"";xe(s,!d||p.endsWith("*")||p.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 m=F(),g;if(t){let p=typeof t=="string"?I(t):t;R(f==="/"||((x=p.pathname)==null?void 0:x.startsWith(f)),`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 "${f}" but pathname "${p.pathname}" was given in the \`location\` prop.`),g=p}else g=m;let v=g.pathname||"/",w=v;if(f!=="/"){let p=f.replace(/^\//,"").split("/");w="/"+v.replace(/^\//,"").split("/").slice(p.length).join("/")}let h=fe(e,{pathname:w});L(d||h!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),L(h==null||h[h.length-1].route.element!==void 0||h[h.length-1].route.Component!==void 0||h[h.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.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 y=st(h&&h.map(p=>Object.assign({},p,{params:Object.assign({},u,p.params),pathname:k([f,o.encodeLocation?o.encodeLocation(p.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?f:k([f,o.encodeLocation?o.encodeLocation(p.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathnameBase])})),l,n,r,a);return t&&y?i.createElement(A.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...g},navigationType:"POP"}},y):y}function ot(){let e=pt(),t=Ge(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)",a={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=i.createElement(i.Fragment,null,i.createElement("p",null,"💿 Hey developer 👋"),i.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",i.createElement("code",{style:o},"ErrorBoundary")," or"," ",i.createElement("code",{style:o},"errorElement")," prop on your route.")),i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},t),n?i.createElement("pre",{style:a},n):null,l)}var lt=i.createElement(ot,null),it=class extends i.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?i.createElement(C.Provider,{value:this.props.routeContext},i.createElement(ee.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function ut({routeContext:e,match:t,children:n}){let r=i.useContext(T);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(C.Provider,{value:e},n)}function st(e,t=[],n=null,r=null,a=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=n==null?void 0:n.errors;if(l!=null){let s=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);R(s>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),o=o.slice(0,Math.min(o.length,s+1))}let c=!1,u=-1;if(n)for(let s=0;s=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((s,f,d)=>{let m,g=!1,v=null,w=null;n&&(m=l&&f.route.id?l[f.route.id]:void 0,v=f.route.errorElement||lt,c&&(u<0&&d===0?(xe("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),g=!0,w=null):u===d&&(g=!0,w=f.route.hydrateFallbackElement||null)));let h=t.concat(o.slice(0,d+1)),y=()=>{let x;return m?x=v:g?x=w:f.route.Component?x=i.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=s,i.createElement(ut,{match:f,routeContext:{outlet:s,matches:h,isDataRoute:n!=null},children:x})};return n&&(f.route.ErrorBoundary||f.route.errorElement||d===0)?i.createElement(it,{location:n.location,revalidation:n.revalidation,component:v,error:m,children:y(),routeContext:{outlet:null,matches:h,isDataRoute:!0},unstable_onError:r}):y()},null)}function te(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ct(e){let t=i.useContext(T);return R(t,te(e)),t}function ft(e){let t=i.useContext(J);return R(t,te(e)),t}function dt(e){let t=i.useContext(C);return R(t,te(e)),t}function ne(e){let t=dt(e),n=t.matches[t.matches.length-1];return R(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function ht(){return ne("useRouteId")}function pt(){var r;let e=i.useContext(ee),t=ft("useRouteError"),n=ne("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function mt(){let{router:e}=ct("useNavigate"),t=ne("useNavigate"),n=i.useRef(!1);return ge(()=>{n.current=!0}),i.useCallback(async(a,o={})=>{L(n.current,ye),n.current&&(typeof a=="number"?e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var se={};function xe(e,t,n){!t&&!se[e]&&(se[e]=!0,L(!1,n))}i.memo(yt);function yt({routes:e,future:t,state:n,unstable_onError:r}){return we(e,void 0,n,r,t)}function Qt({to:e,replace:t,state:n,relative:r}){R(D()," may be used only in the context of a component.");let{static:a}=i.useContext(S);L(!a," 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:o}=i.useContext(C),{pathname:l}=F(),c=ve(),u=Z(e,Q(o),l,r==="path"),s=JSON.stringify(u);return i.useEffect(()=>{c(JSON.parse(s),{replace:t,state:n,relative:r})},[c,s,r,t,n]),null}function Zt(e){return rt(e.context)}function gt(e){R(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function vt({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:o=!1}){R(!D(),"You cannot render a inside another . You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),c=i.useMemo(()=>({basename:l,navigator:a,static:o,future:{}}),[l,a,o]);typeof n=="string"&&(n=I(n));let{pathname:u="/",search:s="",hash:f="",state:d=null,key:m="default"}=n,g=i.useMemo(()=>{let v=$(u,l);return v==null?null:{location:{pathname:v,search:s,hash:f,state:d,key:m},navigationType:r}},[l,u,s,f,d,m,r]);return L(g!=null,` is not able to match the URL "${u}${s}${f}" because it does not start with the basename, so the won't render anything.`),g==null?null:i.createElement(S.Provider,{value:c},i.createElement(A.Provider,{children:t,value:g}))}function en({children:e,location:t}){return at(X(e),t)}function X(e,t=[]){let n=[];return i.Children.forEach(e,(r,a)=>{if(!i.isValidElement(r))return;let o=[...t,a];if(r.type===i.Fragment){n.push.apply(n,X(r.props.children,o));return}R(r.type===gt,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),R(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=X(r.props.children,o)),n.push(l)}),n}var j="get",V="application/x-www-form-urlencoded";function K(e){return e!=null&&typeof e.tagName=="string"}function wt(e){return K(e)&&e.tagName.toLowerCase()==="button"}function xt(e){return K(e)&&e.tagName.toLowerCase()==="form"}function Rt(e){return K(e)&&e.tagName.toLowerCase()==="input"}function Et(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ct(e,t){return e.button===0&&(!t||t==="_self")&&!Et(e)}var _=null;function bt(){if(_===null)try{new FormData(document.createElement("form"),0),_=!1}catch{_=!0}return _}var Pt=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function q(e){return e!=null&&!Pt.has(e)?(L(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${V}"`),null):e}function Lt(e,t){let n,r,a,o,l;if(xt(e)){let c=e.getAttribute("action");r=c?$(c,t):null,n=e.getAttribute("method")||j,a=q(e.getAttribute("enctype"))||V,o=new FormData(e)}else if(wt(e)||Rt(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a