@techdocs/cli 1.6.1-next.2 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/{mkdocs-571e2dc0.cjs.js → mkdocs-062c745e.cjs.js} +11 -4
  3. package/dist/cjs/mkdocs-062c745e.cjs.js.map +1 -0
  4. package/dist/cjs/{serve-bf2ff8e3.cjs.js → serve-d8eba600.cjs.js} +11 -4
  5. package/dist/cjs/serve-d8eba600.cjs.js.map +1 -0
  6. package/dist/cjs/{mkdocsServer-107b8efd.cjs.js → utils-fa60b533.cjs.js} +20 -1
  7. package/dist/cjs/utils-fa60b533.cjs.js.map +1 -0
  8. package/dist/embedded-app/index.html +1 -1
  9. package/dist/embedded-app/static/1600.ec5e759e.chunk.js +3 -0
  10. package/dist/embedded-app/static/1600.ec5e759e.chunk.js.map +1 -0
  11. package/dist/embedded-app/static/{5914.111b8c95.chunk.js → 5914.633b2934.chunk.js} +2 -2
  12. package/dist/embedded-app/static/{5914.111b8c95.chunk.js.map → 5914.633b2934.chunk.js.map} +1 -1
  13. package/dist/embedded-app/static/7241.a066d2d0.chunk.js +3 -0
  14. package/dist/embedded-app/static/7241.a066d2d0.chunk.js.map +1 -0
  15. package/dist/embedded-app/static/{8096.60ff0c3e.chunk.js → 8096.752da27d.chunk.js} +3 -3
  16. package/dist/embedded-app/static/{8096.60ff0c3e.chunk.js.map → 8096.752da27d.chunk.js.map} +1 -1
  17. package/dist/embedded-app/static/8629.ee337616.chunk.js +7 -0
  18. package/dist/embedded-app/static/8629.ee337616.chunk.js.map +1 -0
  19. package/dist/embedded-app/static/main.6ea4af3c.js +487 -0
  20. package/dist/embedded-app/static/main.6ea4af3c.js.map +1 -0
  21. package/dist/embedded-app/static/{module-react-beautiful-dnd.0ca788d0.js → module-react-beautiful-dnd.71ae82d9.js} +2 -2
  22. package/dist/embedded-app/static/{module-react-beautiful-dnd.0ca788d0.js.map → module-react-beautiful-dnd.71ae82d9.js.map} +1 -1
  23. package/dist/embedded-app/static/module-react-router-dom.9e5a6865.js +22 -0
  24. package/dist/embedded-app/static/module-react-router-dom.9e5a6865.js.map +1 -0
  25. package/dist/embedded-app/static/module-react-router.d96a5b36.js +22 -0
  26. package/dist/embedded-app/static/module-react-router.d96a5b36.js.map +1 -0
  27. package/dist/embedded-app/static/{runtime.21f1591c.js → runtime.6ea4af3c.js} +3 -3
  28. package/dist/embedded-app/static/runtime.6ea4af3c.js.map +1 -0
  29. package/dist/embedded-app/static/vendor.6ea4af3c.js +207 -0
  30. package/dist/embedded-app/static/vendor.6ea4af3c.js.map +1 -0
  31. package/dist/index.cjs.js +3 -3
  32. package/package.json +4 -4
  33. package/dist/cjs/mkdocs-571e2dc0.cjs.js.map +0 -1
  34. package/dist/cjs/mkdocsServer-107b8efd.cjs.js.map +0 -1
  35. package/dist/cjs/serve-bf2ff8e3.cjs.js.map +0 -1
  36. package/dist/embedded-app/static/1600.ef4a7196.chunk.js +0 -3
  37. package/dist/embedded-app/static/1600.ef4a7196.chunk.js.map +0 -1
  38. package/dist/embedded-app/static/3893.118c937c.chunk.js +0 -3
  39. package/dist/embedded-app/static/3893.118c937c.chunk.js.map +0 -1
  40. package/dist/embedded-app/static/8629.34b012ba.chunk.js +0 -7
  41. package/dist/embedded-app/static/8629.34b012ba.chunk.js.map +0 -1
  42. package/dist/embedded-app/static/main.21f1591c.js +0 -487
  43. package/dist/embedded-app/static/main.21f1591c.js.map +0 -1
  44. package/dist/embedded-app/static/module-react-router-dom.8eff32d7.js +0 -22
  45. package/dist/embedded-app/static/module-react-router-dom.8eff32d7.js.map +0 -1
  46. package/dist/embedded-app/static/module-react-router.05179f87.js +0 -22
  47. package/dist/embedded-app/static/module-react-router.05179f87.js.map +0 -1
  48. package/dist/embedded-app/static/runtime.21f1591c.js.map +0 -1
  49. package/dist/embedded-app/static/vendor.21f1591c.js +0 -206
  50. package/dist/embedded-app/static/vendor.21f1591c.js.map +0 -1
@@ -0,0 +1,22 @@
1
+ "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[242],{73557:function(zr,Bt,Qe){var H;Qe.d(Bt,{AW:function(){return Ut},F0:function(){return st},Fg:function(){return Mt},GV:function(){return ne},TH:function(){return Pe},UO:function(){return Wt},Us:function(){return ue},V$:function(){return bt},VA:function(){return lt},WU:function(){return Rt},Z5:function(){return er},is:function(){return Be},j3:function(){return qt},oQ:function(){return ge},pC:function(){return yt},s0:function(){return Re}});var y=Qe(2784),z=Qe(84800);/**
2
+ * React Router v6.18.0
3
+ *
4
+ * Copyright (c) Remix Software Inc.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE.md file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */function De(){return De=Object.assign?Object.assign.bind():function(l){for(var c=1;c<arguments.length;c++){var v=arguments[c];for(var R in v)Object.prototype.hasOwnProperty.call(v,R)&&(l[R]=v[R])}return l},De.apply(this,arguments)}const at=y.createContext(null),zt=y.createContext(null),k=y.createContext(null),ue=y.createContext(null),_e=y.createContext(null),fe=y.createContext({outlet:null,matches:[],isDataRoute:!1}),me=y.createContext(null);function ge(l,c){let{relative:v}=c===void 0?{}:c;ne()||(0,z.J0)(!1);let{basename:R,navigator:S}=y.useContext(ue),{hash:L,pathname:_,search:W}=Rt(l,{relative:v}),j=_;return R!=="/"&&(j=_==="/"?R:(0,z.RQ)([R,_])),S.createHref({pathname:j,search:W,hash:L})}function ne(){return y.useContext(_e)!=null}function Pe(){return ne()||(0,z.J0)(!1),y.useContext(_e).location}function Q(){return React.useContext(_e).navigationType}function hr(l){ne()||UNSAFE_invariant(!1);let{pathname:c}=Pe();return React.useMemo(()=>matchPath(l,c),[c,l])}const pr=null;function Fe(l){y.useContext(ue).static||y.useLayoutEffect(l)}function Re(){let{isDataRoute:l}=y.useContext(fe);return l?Xt():kt()}function kt(){ne()||(0,z.J0)(!1);let l=y.useContext(at),{basename:c,navigator:v}=y.useContext(ue),{matches:R}=y.useContext(fe),{pathname:S}=Pe(),L=JSON.stringify((0,z.Zq)(R).map(j=>j.pathnameBase)),_=y.useRef(!1);return Fe(()=>{_.current=!0}),y.useCallback(function(j,$){if($===void 0&&($={}),!_.current)return;if(typeof j=="number"){v.go(j);return}let X=(0,z.pC)(j,JSON.parse(L),S,$.relative==="path");l==null&&c!=="/"&&(X.pathname=X.pathname==="/"?c:(0,z.RQ)([c,X.pathname])),($.replace?v.replace:v.push)(X,$.state,$)},[c,v,L,S,l])}const ot=y.createContext(null);function Ht(){return React.useContext(ot)}function yt(l){let c=y.useContext(fe).outlet;return c&&y.createElement(ot.Provider,{value:l},c)}function Wt(){let{matches:l}=y.useContext(fe),c=l[l.length-1];return c?c.params:{}}function Rt(l,c){let{relative:v}=c===void 0?{}:c,{matches:R}=y.useContext(fe),{pathname:S}=Pe(),L=JSON.stringify((0,z.Zq)(R).map(_=>_.pathnameBase));return y.useMemo(()=>(0,z.pC)(l,JSON.parse(L),S,v==="path"),[l,L,S,v])}function bt(l,c){return wt(l,c)}function wt(l,c,v){ne()||(0,z.J0)(!1);let{navigator:R}=y.useContext(ue),{matches:S}=y.useContext(fe),L=S[S.length-1],_=L?L.params:{},W=L?L.pathname:"/",j=L?L.pathnameBase:"/",$=L&&L.route,X=Pe(),V;if(c){var ee;let pe=typeof c=="string"?(0,z.cP)(c):c;j==="/"||(ee=pe.pathname)!=null&&ee.startsWith(j)||(0,z.J0)(!1),V=pe}else V=X;let se=V.pathname||"/",he=j==="/"?se:se.slice(j.length)||"/",Me=(0,z.fp)(l,{pathname:he}),Xe=xt(Me&&Me.map(pe=>Object.assign({},pe,{params:Object.assign({},_,pe.params),pathname:(0,z.RQ)([j,R.encodeLocation?R.encodeLocation(pe.pathname).pathname:pe.pathname]),pathnameBase:pe.pathnameBase==="/"?j:(0,z.RQ)([j,R.encodeLocation?R.encodeLocation(pe.pathnameBase).pathname:pe.pathnameBase])})),S,v);return c&&Xe?y.createElement(_e.Provider,{value:{location:De({pathname:"/",search:"",hash:"",state:null,key:"default"},V),navigationType:z.aU.Pop}},Xe):Xe}function Jt(){let l=Zt(),c=(0,z.WK)(l)?l.status+" "+l.statusText:l instanceof Error?l.message:JSON.stringify(l),v=l instanceof Error?l.stack:null,R="rgba(200,200,200, 0.5)",S={padding:"0.5rem",backgroundColor:R},L={padding:"2px 4px",backgroundColor:R},_=null;return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},c),v?y.createElement("pre",{style:S},v):null,_)}const Kt=y.createElement(Jt,null);class Et extends y.Component{constructor(c){super(c),this.state={location:c.location,revalidation:c.revalidation,error:c.error}}static getDerivedStateFromError(c){return{error:c}}static getDerivedStateFromProps(c,v){return v.location!==c.location||v.revalidation!=="idle"&&c.revalidation==="idle"?{error:c.error,location:c.location,revalidation:c.revalidation}:{error:c.error||v.error,location:v.location,revalidation:c.revalidation||v.revalidation}}componentDidCatch(c,v){console.error("React Router caught the following error during render",c,v)}render(){return this.state.error?y.createElement(fe.Provider,{value:this.props.routeContext},y.createElement(me.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function $t(l){let{routeContext:c,match:v,children:R}=l,S=y.useContext(at);return S&&S.static&&S.staticContext&&(v.route.errorElement||v.route.ErrorBoundary)&&(S.staticContext._deepestRenderedBoundaryId=v.route.id),y.createElement(fe.Provider,{value:c},R)}function xt(l,c,v){var R;if(c===void 0&&(c=[]),v===void 0&&(v=null),l==null){var S;if((S=v)!=null&&S.errors)l=v.matches;else return null}let L=l,_=(R=v)==null?void 0:R.errors;if(_!=null){let W=L.findIndex(j=>j.route.id&&(_==null?void 0:_[j.route.id]));W>=0||(0,z.J0)(!1),L=L.slice(0,Math.min(L.length,W+1))}return L.reduceRight((W,j,$)=>{let X=j.route.id?_==null?void 0:_[j.route.id]:null,V=null;v&&(V=j.route.errorElement||Kt);let ee=c.concat(L.slice(0,$+1)),se=()=>{let he;return X?he=V:j.route.Component?he=y.createElement(j.route.Component,null):j.route.element?he=j.route.element:he=W,y.createElement($t,{match:j,routeContext:{outlet:W,matches:ee,isDataRoute:v!=null},children:he})};return v&&(j.route.ErrorBoundary||j.route.errorElement||$===0)?y.createElement(Et,{location:v.location,revalidation:v.revalidation,component:V,error:X,children:se(),routeContext:{outlet:null,matches:ee,isDataRoute:!0}}):se()},null)}var Ze=function(l){return l.UseBlocker="useBlocker",l.UseRevalidator="useRevalidator",l.UseNavigateStable="useNavigate",l}(Ze||{}),de=function(l){return l.UseBlocker="useBlocker",l.UseLoaderData="useLoaderData",l.UseActionData="useActionData",l.UseRouteError="useRouteError",l.UseNavigation="useNavigation",l.UseRouteLoaderData="useRouteLoaderData",l.UseMatches="useMatches",l.UseRevalidator="useRevalidator",l.UseNavigateStable="useNavigate",l.UseRouteId="useRouteId",l}(de||{});function mr(l){return l+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function it(l){let c=y.useContext(at);return c||(0,z.J0)(!1),c}function Ee(l){let c=y.useContext(zt);return c||(0,z.J0)(!1),c}function Vt(l){let c=y.useContext(fe);return c||(0,z.J0)(!1),c}function xe(l){let c=Vt(l),v=c.matches[c.matches.length-1];return v.route.id||(0,z.J0)(!1),v.route.id}function Yt(){return xe(de.UseRouteId)}function gr(){return Ee(de.UseNavigation).navigation}function Dt(){let l=it(Ze.UseRevalidator),c=Ee(de.UseRevalidator);return React.useMemo(()=>({revalidate:l.router.revalidate,state:c.revalidation}),[l.router.revalidate,c.revalidation])}function Pt(){let{matches:l,loaderData:c}=Ee(de.UseMatches);return React.useMemo(()=>l.map(v=>UNSAFE_convertRouteMatchToUiMatch(v,c)),[l,c])}function Qt(){let l=Ee(de.UseLoaderData),c=xe(de.UseLoaderData);if(l.errors&&l.errors[c]!=null){console.error("You cannot `useLoaderData` in an errorElement (routeId: "+c+")");return}return l.loaderData[c]}function kr(l){return Ee(de.UseRouteLoaderData).loaderData[l]}function Ie(){let l=Ee(de.UseActionData);return React.useContext(fe)||UNSAFE_invariant(!1),Object.values((l==null?void 0:l.actionData)||{})[0]}function Zt(){var l;let c=y.useContext(me),v=Ee(de.UseRouteError),R=xe(de.UseRouteError);return c||((l=v.errors)==null?void 0:l[R])}function Gt(){let l=React.useContext(k);return l==null?void 0:l._data}function vr(){let l=React.useContext(k);return l==null?void 0:l._error}let yr=0;function Ct(l){let{router:c,basename:v}=it(Ze.UseBlocker),R=Ee(de.UseBlocker),[S,L]=React.useState(""),_=React.useCallback(W=>{if(typeof l!="function")return!!l;if(v==="/")return l(W);let{currentLocation:j,nextLocation:$,historyAction:X}=W;return l({currentLocation:De({},j,{pathname:stripBasename(j.pathname,v)||j.pathname}),nextLocation:De({},$,{pathname:stripBasename($.pathname,v)||$.pathname}),historyAction:X})},[v,l]);return React.useEffect(()=>{let W=String(++yr);return L(W),()=>c.deleteBlocker(W)},[c]),React.useEffect(()=>{S!==""&&c.getBlocker(S,_)},[c,S,_]),S&&R.blockers.has(S)?R.blockers.get(S):IDLE_BLOCKER}function Xt(){let{router:l}=it(Ze.UseNavigateStable),c=xe(de.UseNavigateStable),v=y.useRef(!1);return Fe(()=>{v.current=!0}),y.useCallback(function(S,L){L===void 0&&(L={}),v.current&&(typeof S=="number"?l.navigate(S):l.navigate(S,De({fromRouteId:c},L)))},[l,c])}const St={};function Rr(l,c,v){!c&&!St[l]&&(St[l]=!0)}const br="startTransition",Ge=(H||(H=Qe.t(y,2)))[br];function Hr(l){let{fallbackElement:c,router:v,future:R}=l,[S,L]=React.useState(v.state),{v7_startTransition:_}=R||{},W=React.useCallback(V=>{_&&Ge?Ge(()=>L(V)):L(V)},[L,_]);React.useLayoutEffect(()=>v.subscribe(W),[v,W]);let j=React.useMemo(()=>({createHref:v.createHref,encodeLocation:v.encodeLocation,go:V=>v.navigate(V),push:(V,ee,se)=>v.navigate(V,{state:ee,preventScrollReset:se==null?void 0:se.preventScrollReset}),replace:(V,ee,se)=>v.navigate(V,{replace:!0,state:ee,preventScrollReset:se==null?void 0:se.preventScrollReset})}),[v]),$=v.basename||"/",X=React.useMemo(()=>({router:v,navigator:j,static:!1,basename:$}),[v,j,$]);return React.createElement(React.Fragment,null,React.createElement(at.Provider,{value:X},React.createElement(zt.Provider,{value:S},React.createElement(st,{basename:$,location:S.location,navigationType:S.historyAction,navigator:j},S.initialized?React.createElement(Lt,{routes:v.routes,state:S}):c))),null)}function Lt(l){let{routes:c,state:v}=l;return wt(c,void 0,v)}function lt(l){let{basename:c,children:v,initialEntries:R,initialIndex:S,future:L}=l,_=y.useRef();_.current==null&&(_.current=(0,z.PP)({initialEntries:R,initialIndex:S,v5Compat:!0}));let W=_.current,[j,$]=y.useState({action:W.action,location:W.location}),{v7_startTransition:X}=L||{},V=y.useCallback(ee=>{X&&Ge?Ge(()=>$(ee)):$(ee)},[$,X]);return y.useLayoutEffect(()=>W.listen(V),[W,V]),y.createElement(st,{basename:c,children:v,location:j.location,navigationType:j.action,navigator:W})}function Mt(l){let{to:c,replace:v,state:R,relative:S}=l;ne()||(0,z.J0)(!1);let{matches:L}=y.useContext(fe),{pathname:_}=Pe(),W=Re(),j=(0,z.pC)(c,(0,z.Zq)(L).map(X=>X.pathnameBase),_,S==="path"),$=JSON.stringify(j);return y.useEffect(()=>W(JSON.parse($),{replace:v,state:R,relative:S}),[W,$,S,v,R]),null}function qt(l){return yt(l.context)}function Ut(l){(0,z.J0)(!1)}function st(l){let{basename:c="/",children:v=null,location:R,navigationType:S=z.aU.Pop,navigator:L,static:_=!1}=l;ne()&&(0,z.J0)(!1);let W=c.replace(/^\/*/,"/"),j=y.useMemo(()=>({basename:W,navigator:L,static:_}),[W,L,_]);typeof R=="string"&&(R=(0,z.cP)(R));let{pathname:$="/",search:X="",hash:V="",state:ee=null,key:se="default"}=R,he=y.useMemo(()=>{let Me=(0,z.Zn)($,W);return Me==null?null:{location:{pathname:Me,search:X,hash:V,state:ee,key:se},navigationType:S}},[W,$,X,V,ee,se,S]);return he==null?null:y.createElement(ue.Provider,{value:j},y.createElement(_e.Provider,{children:v,value:he}))}function er(l){let{children:c,location:v}=l;return bt(Be(c),v)}function wr(l){let{children:c,errorElement:v,resolve:R}=l;return React.createElement(Ne,{resolve:R,errorElement:v},React.createElement(Ot,null,c))}var ce=function(l){return l[l.pending=0]="pending",l[l.success=1]="success",l[l.error=2]="error",l}(ce||{});const tr=new Promise(()=>{});class Ne extends y.Component{constructor(c){super(c),this.state={error:null}}static getDerivedStateFromError(c){return{error:c}}componentDidCatch(c,v){console.error("<Await> caught the following error during render",c,v)}render(){let{children:c,errorElement:v,resolve:R}=this.props,S=null,L=ce.pending;if(!(R instanceof Promise))L=ce.success,S=Promise.resolve(),Object.defineProperty(S,"_tracked",{get:()=>!0}),Object.defineProperty(S,"_data",{get:()=>R});else if(this.state.error){L=ce.error;let _=this.state.error;S=Promise.reject().catch(()=>{}),Object.defineProperty(S,"_tracked",{get:()=>!0}),Object.defineProperty(S,"_error",{get:()=>_})}else R._tracked?(S=R,L=S._error!==void 0?ce.error:S._data!==void 0?ce.success:ce.pending):(L=ce.pending,Object.defineProperty(R,"_tracked",{get:()=>!0}),S=R.then(_=>Object.defineProperty(R,"_data",{get:()=>_}),_=>Object.defineProperty(R,"_error",{get:()=>_})));if(L===ce.error&&S._error instanceof z.X3)throw tr;if(L===ce.error&&!v)throw S._error;if(L===ce.error)return y.createElement(k.Provider,{value:S,children:v});if(L===ce.success)return y.createElement(k.Provider,{value:S,children:c});throw S}}function Ot(l){let{children:c}=l,v=Gt(),R=typeof c=="function"?c(v):c;return React.createElement(React.Fragment,null,R)}function Be(l,c){c===void 0&&(c=[]);let v=[];return y.Children.forEach(l,(R,S)=>{if(!y.isValidElement(R))return;let L=[...c,S];if(R.type===y.Fragment){v.push.apply(v,Be(R.props.children,L));return}R.type!==Ut&&(0,z.J0)(!1),!R.props.index||!R.props.children||(0,z.J0)(!1);let _={id:R.props.id||L.join("-"),caseSensitive:R.props.caseSensitive,element:R.props.element,Component:R.props.Component,index:R.props.index,path:R.props.path,loader:R.props.loader,action:R.props.action,errorElement:R.props.errorElement,ErrorBoundary:R.props.ErrorBoundary,hasErrorBoundary:R.props.ErrorBoundary!=null||R.props.errorElement!=null,shouldRevalidate:R.props.shouldRevalidate,handle:R.props.handle,lazy:R.props.lazy};R.props.children&&(_.children=Be(R.props.children,L)),v.push(_)}),v}function rr(l){return xt(l)}function Er(l){let c={hasErrorBoundary:l.ErrorBoundary!=null||l.errorElement!=null};return l.Component&&Object.assign(c,{element:React.createElement(l.Component),Component:void 0}),l.ErrorBoundary&&Object.assign(c,{errorElement:React.createElement(l.ErrorBoundary),ErrorBoundary:void 0}),c}function xr(l,c){return createRouter({basename:c==null?void 0:c.basename,future:De({},c==null?void 0:c.future,{v7_prependBasename:!0}),history:createMemoryHistory({initialEntries:c==null?void 0:c.initialEntries,initialIndex:c==null?void 0:c.initialIndex}),hydrationData:c==null?void 0:c.hydrationData,routes:l,mapRouteProperties:Er}).initialize()}},84800:function(zr,Bt,Qe){Qe.d(Bt,{Ep:function(){return ge},Gn:function(){return de},J0:function(){return k},PP:function(){return De},RQ:function(){return Ie},WK:function(){return lt},X3:function(){return Ct},Zn:function(){return xe},Zq:function(){return Pt},aU:function(){return y},cP:function(){return ne},fp:function(){return Re},i3:function(){return Yt},pC:function(){return Qt}});/**
11
+ * @remix-run/router v1.11.0
12
+ *
13
+ * Copyright (c) Remix Software Inc.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE.md file in the root directory of this source tree.
17
+ *
18
+ * @license MIT
19
+ */function H(){return H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},H.apply(this,arguments)}var y;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(y||(y={}));const z="popstate";function De(e){e===void 0&&(e={});let{initialEntries:t=["/"],initialIndex:r,v5Compat:n=!1}=e,a;a=t.map((b,E)=>x(b,typeof b=="string"?null:b.state,E===0?"default":void 0));let u=h(r==null?a.length-1:r),s=y.Pop,f=null;function h(b){return Math.min(Math.max(b,0),a.length-1)}function m(){return a[u]}function x(b,E,D){E===void 0&&(E=null);let g=me(a?m().pathname:"/",b,E,D);return ue(g.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(b)),g}function w(b){return typeof b=="string"?b:ge(b)}return{get index(){return u},get action(){return s},get location(){return m()},createHref:w,createURL(b){return new URL(w(b),"http://localhost")},encodeLocation(b){let E=typeof b=="string"?ne(b):b;return{pathname:E.pathname||"",search:E.search||"",hash:E.hash||""}},push(b,E){s=y.Push;let D=x(b,E);u+=1,a.splice(u,a.length,D),n&&f&&f({action:s,location:D,delta:1})},replace(b,E){s=y.Replace;let D=x(b,E);a[u]=D,n&&f&&f({action:s,location:D,delta:0})},go(b){s=y.Pop;let E=h(u+b),D=a[E];u=E,f&&f({action:s,location:D,delta:b})},listen(b){return f=b,()=>{f=null}}}}function at(e){e===void 0&&(e={});function t(n,a){let{pathname:u,search:s,hash:f}=n.location;return me("",{pathname:u,search:s,hash:f},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:ge(a)}return Pe(t,r,null,e)}function zt(e){e===void 0&&(e={});function t(a,u){let{pathname:s="/",search:f="",hash:h=""}=ne(a.location.hash.substr(1));return!s.startsWith("/")&&!s.startsWith(".")&&(s="/"+s),me("",{pathname:s,search:f,hash:h},u.state&&u.state.usr||null,u.state&&u.state.key||"default")}function r(a,u){let s=a.document.querySelector("base"),f="";if(s&&s.getAttribute("href")){let h=a.location.href,m=h.indexOf("#");f=m===-1?h:h.slice(0,m)}return f+"#"+(typeof u=="string"?u:ge(u))}function n(a,u){ue(a.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(u)+")")}return Pe(t,r,n,e)}function k(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function ue(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch{}}}function _e(){return Math.random().toString(36).substr(2,8)}function fe(e,t){return{usr:e.state,key:e.key,idx:t}}function me(e,t,r,n){return r===void 0&&(r=null),H({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ne(t):t,{state:r,key:t&&t.key||n||_e()})}function ge(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function ne(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Pe(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:u=!1}=n,s=a.history,f=y.Pop,h=null,m=x();m==null&&(m=0,s.replaceState(H({},s.state,{idx:m}),""));function x(){return(s.state||{idx:null}).idx}function w(){f=y.Pop;let g=x(),A=g==null?null:g-m;m=g,h&&h({action:f,location:D.location,delta:A})}function C(g,A){f=y.Push;let J=me(D.location,g,A);r&&r(J,g),m=x()+1;let N=fe(J,m),i=D.createHref(J);try{s.pushState(N,"",i)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;a.location.assign(i)}u&&h&&h({action:f,location:D.location,delta:1})}function b(g,A){f=y.Replace;let J=me(D.location,g,A);r&&r(J,g),m=x();let N=fe(J,m),i=D.createHref(J);s.replaceState(N,"",i),u&&h&&h({action:f,location:D.location,delta:0})}function E(g){let A=a.location.origin!=="null"?a.location.origin:a.location.href,J=typeof g=="string"?g:ge(g);return k(A,"No window.location.(origin|href) available to create URL for href: "+J),new URL(J,A)}let D={get action(){return f},get location(){return e(a,s)},listen(g){if(h)throw new Error("A history only accepts one active listener");return a.addEventListener(z,w),h=g,()=>{a.removeEventListener(z,w),h=null}},createHref(g){return t(a,g)},createURL:E,encodeLocation(g){let A=E(g);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:C,replace:b,go(g){return s.go(g)}};return D}var Q;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Q||(Q={}));const hr=new Set(["lazy","caseSensitive","path","id","index","children"]);function pr(e){return e.index===!0}function Fe(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,u)=>{let s=[...r,u],f=typeof a.id=="string"?a.id:s.join("-");if(k(a.index!==!0||!a.children,"Cannot specify children on an index route"),k(!n[f],'Found a route id collision on id "'+f+`". Route id's must be globally unique within Data Router usages`),pr(a)){let h=H({},a,t(a),{id:f});return n[f]=h,h}else{let h=H({},a,t(a),{id:f,children:void 0});return n[f]=h,a.children&&(h.children=Fe(a.children,t,s,n)),h}})}function Re(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?ne(t):t,a=xe(n.pathname||"/",r);if(a==null)return null;let u=ot(e);yt(u);let s=null;for(let f=0;s==null&&f<u.length;++f)s=Ze(u[f],Ee(a));return s}function kt(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function ot(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(u,s,f)=>{let h={relativePath:f===void 0?u.path||"":f,caseSensitive:u.caseSensitive===!0,childrenIndex:s,route:u};h.relativePath.startsWith("/")&&(k(h.relativePath.startsWith(n),'Absolute route path "'+h.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),h.relativePath=h.relativePath.slice(n.length));let m=Ie([n,h.relativePath]),x=r.concat(h);u.children&&u.children.length>0&&(k(u.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+m+'".')),ot(u.children,t,x,m)),!(u.path==null&&!u.index)&&t.push({path:m,score:$t(m,u.index),routesMeta:x})};return e.forEach((u,s)=>{var f;if(u.path===""||!((f=u.path)!=null&&f.includes("?")))a(u,s);else for(let h of Ht(u.path))a(u,s,h)}),t}function Ht(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),u=r.replace(/\?$/,"");if(n.length===0)return a?[u,""]:[u];let s=Ht(n.join("/")),f=[];return f.push(...s.map(h=>h===""?u:[u,h].join("/"))),a&&f.push(...s),f.map(h=>e.startsWith("/")&&h===""?"/":h)}function yt(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:xt(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Wt=/^:\w+$/,Rt=3,bt=2,wt=1,Jt=10,Kt=-2,Et=e=>e==="*";function $t(e,t){let r=e.split("/"),n=r.length;return r.some(Et)&&(n+=Kt),t&&(n+=bt),r.filter(a=>!Et(a)).reduce((a,u)=>a+(Wt.test(u)?Rt:u===""?wt:Jt),n)}function xt(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function Ze(e,t){let{routesMeta:r}=e,n={},a="/",u=[];for(let s=0;s<r.length;++s){let f=r[s],h=s===r.length-1,m=a==="/"?t:t.slice(a.length)||"/",x=mr({path:f.relativePath,caseSensitive:f.caseSensitive,end:h},m);if(!x)return null;Object.assign(n,x.params);let w=f.route;u.push({params:n,pathname:Ie([a,x.pathname]),pathnameBase:Zt(Ie([a,x.pathnameBase])),route:w}),x.pathnameBase!=="/"&&(a=Ie([a,x.pathnameBase]))}return u}function de(e,t){t===void 0&&(t={});let r=e;r.endsWith("*")&&r!=="*"&&!r.endsWith("/*")&&(ue(!1,'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".')),r=r.replace(/\*$/,"/*"));const n=r.startsWith("/")?"/":"",a=s=>s==null?"":typeof s=="string"?s:String(s),u=r.split(/\/+/).map((s,f,h)=>{if(f===h.length-1&&s==="*")return a(t["*"]);const x=s.match(/^:(\w+)(\??)$/);if(x){const[,w,C]=x;let b=t[w];return k(C==="?"||b!=null,'Missing ":'+w+'" param'),a(b)}return s.replace(/\?$/g,"")}).filter(s=>!!s);return n+u.join("/")}function mr(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=it(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let u=a[0],s=u.replace(/(.)\/+$/,"$1"),f=a.slice(1);return{params:n.reduce((m,x,w)=>{let{paramName:C,isOptional:b}=x;if(C==="*"){let D=f[w]||"";s=u.slice(0,u.length-D.length).replace(/(.)\/+$/,"$1")}const E=f[w];return b&&!E?m[C]=void 0:m[C]=Vt(E||"",C),m},{}),pathname:u,pathnameBase:s,pattern:e}}function it(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),ue(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 n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,(s,f,h)=>(n.push({paramName:f,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function Ee(e){try{return decodeURI(e)}catch(t){return ue(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Vt(e,t){try{return decodeURIComponent(e)}catch(r){return ue(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+r+").")),e}}function xe(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function Yt(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?ne(e):e;return{pathname:r?r.startsWith("/")?r:gr(r,t):t,search:Gt(n),hash:vr(a)}}function gr(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Dt(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Pt(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Qt(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=ne(e):(a=H({},e),k(!a.pathname||!a.pathname.includes("?"),Dt("?","pathname","search",a)),k(!a.pathname||!a.pathname.includes("#"),Dt("#","pathname","hash",a)),k(!a.search||!a.search.includes("#"),Dt("#","search","hash",a)));let u=e===""||a.pathname==="",s=u?"/":a.pathname,f;if(n||s==null)f=r;else{let w=t.length-1;if(s.startsWith("..")){let C=s.split("/");for(;C[0]==="..";)C.shift(),w-=1;a.pathname=C.join("/")}f=w>=0?t[w]:"/"}let h=Yt(a,f),m=s&&s!=="/"&&s.endsWith("/"),x=(u||s===".")&&r.endsWith("/");return!h.pathname.endsWith("/")&&(m||x)&&(h.pathname+="/"),h}function kr(e){return e===""||e.pathname===""?"/":typeof e=="string"?ne(e).pathname:e.pathname}const Ie=e=>e.join("/").replace(/\/\/+/g,"/"),Zt=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Gt=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,vr=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,yr=function(t,r){r===void 0&&(r={});let n=typeof r=="number"?{status:r}:r,a=new Headers(n.headers);return a.has("Content-Type")||a.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(t),H({},n,{headers:a}))};class Ct extends Error{}class Xt{constructor(t,r){this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],k(t&&typeof t=="object"&&!Array.isArray(t),"defer() only accepts plain objects");let n;this.abortPromise=new Promise((u,s)=>n=s),this.controller=new AbortController;let a=()=>n(new Ct("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",a),this.controller.signal.addEventListener("abort",a),this.data=Object.entries(t).reduce((u,s)=>{let[f,h]=s;return Object.assign(u,{[f]:this.trackPromise(f,h)})},{}),this.done&&this.unlistenAbortSignal(),this.init=r}trackPromise(t,r){if(!(r instanceof Promise))return r;this.deferredKeys.push(t),this.pendingKeysSet.add(t);let n=Promise.race([r,this.abortPromise]).then(a=>this.onSettle(n,t,void 0,a),a=>this.onSettle(n,t,a));return n.catch(()=>{}),Object.defineProperty(n,"_tracked",{get:()=>!0}),n}onSettle(t,r,n,a){if(this.controller.signal.aborted&&n instanceof Ct)return this.unlistenAbortSignal(),Object.defineProperty(t,"_error",{get:()=>n}),Promise.reject(n);if(this.pendingKeysSet.delete(r),this.done&&this.unlistenAbortSignal(),n===void 0&&a===void 0){let u=new Error('Deferred data for key "'+r+'" resolved/rejected with `undefined`, you must resolve/reject with a value or `null`.');return Object.defineProperty(t,"_error",{get:()=>u}),this.emit(!1,r),Promise.reject(u)}return a===void 0?(Object.defineProperty(t,"_error",{get:()=>n}),this.emit(!1,r),Promise.reject(n)):(Object.defineProperty(t,"_data",{get:()=>a}),this.emit(!1,r),a)}emit(t,r){this.subscribers.forEach(n=>n(t,r))}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach((t,r)=>this.pendingKeysSet.delete(r)),this.emit(!0)}async resolveData(t){let r=!1;if(!this.done){let n=()=>this.cancel();t.addEventListener("abort",n),r=await new Promise(a=>{this.subscribe(u=>{t.removeEventListener("abort",n),(u||this.done)&&a(u)})})}return r}get done(){return this.pendingKeysSet.size===0}get unwrappedData(){return k(this.data!==null&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce((t,r)=>{let[n,a]=r;return Object.assign(t,{[n]:Rr(a)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function St(e){return e instanceof Promise&&e._tracked===!0}function Rr(e){if(!St(e))return e;if(e._error)throw e._error;return e._data}const br=function(t,r){r===void 0&&(r={});let n=typeof r=="number"?{status:r}:r;return new Xt(t,n)},Ge=function(t,r){r===void 0&&(r=302);let n=r;typeof n=="number"?n={status:n}:typeof n.status=="undefined"&&(n.status=302);let a=new Headers(n.headers);return a.set("Location",t),new Response(null,H({},n,{headers:a}))},Hr=(e,t)=>{let r=Ge(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class Lt{constructor(t,r,n,a){a===void 0&&(a=!1),this.status=t,this.statusText=r||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function lt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Mt=["post","put","patch","delete"],qt=new Set(Mt),Ut=["get",...Mt],st=new Set(Ut),er=new Set([301,302,303,307,308]),wr=new Set([307,308]),ce={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},tr={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ne={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Ot=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Be=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),rr="remix-router-transitions";function Er(e){const t=e.window?e.window:typeof window!="undefined"?window:void 0,r=typeof t!="undefined"&&typeof t.document!="undefined"&&typeof t.document.createElement!="undefined",n=!r;k(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a;if(e.mapRouteProperties)a=e.mapRouteProperties;else if(e.detectErrorBoundary){let o=e.detectErrorBoundary;a=d=>({hasErrorBoundary:o(d)})}else a=Be;let u={},s=Fe(e.routes,a,void 0,u),f,h=e.basename||"/",m=H({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),x=null,w=new Set,C=null,b=null,E=null,D=e.hydrationData!=null,g=Re(s,e.history.location,h),A=null;if(g==null){let o=te(404,{pathname:e.history.location.pathname}),{matches:d,route:p}=Tt(s);g=d,A={[p.id]:o}}let J=!g.some(o=>o.route.lazy)&&(!g.some(o=>o.route.loader)||e.hydrationData!=null),N,i={historyAction:e.history.action,location:e.history.location,matches:g,initialized:J,navigation:ce,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||A,fetchers:new Map,blockers:new Map},B=y.Pop,ae=!1,I,ye=!1,be=new Map,Ce=null,tt=!1,He=!1,jt=[],At=[],oe=new Map,_t=0,dt=-1,rt=new Map,Se=new Set,nt=new Map,ft=new Map,We=new Set,Je=new Map,Ke=new Map,ir=!1;function Gr(){if(x=e.history.listen(o=>{let{action:d,location:p,delta:P}=o;if(ir){ir=!1;return}ue(Ke.size===0||P!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let U=Fr({currentLocation:i.location,nextLocation:p,historyAction:d});if(U&&P!=null){ir=!0,e.history.go(P*-1),It(U,{state:"blocked",location:p,proceed(){It(U,{state:"proceeding",proceed:void 0,reset:void 0,location:p}),e.history.go(P)},reset(){let O=new Map(i.blockers);O.set(U,Ne),ie({blockers:O})}});return}return $e(d,p)}),r){Qr(t,be);let o=()=>Zr(t,be);t.addEventListener("pagehide",o),Ce=()=>t.removeEventListener("pagehide",o)}return i.initialized||$e(y.Pop,i.location),N}function Xr(){x&&x(),Ce&&Ce(),w.clear(),I&&I.abort(),i.fetchers.forEach((o,d)=>Ft(d)),i.blockers.forEach((o,d)=>_r(d))}function qr(o){return w.add(o),()=>w.delete(o)}function ie(o,d){i=H({},i,o);let p=[],P=[];m.v7_fetcherPersist&&i.fetchers.forEach((U,O)=>{U.state==="idle"&&(We.has(O)?P.push(O):p.push(O))}),w.forEach(U=>U(i,{deletedFetchers:P,unstable_viewTransitionOpts:d})),m.v7_fetcherPersist&&(p.forEach(U=>i.fetchers.delete(U)),P.forEach(U=>Ft(U)))}function ht(o,d){var p,P;let U=i.actionData!=null&&i.navigation.formMethod!=null&&ve(i.navigation.formMethod)&&i.navigation.state==="loading"&&((p=o.state)==null?void 0:p._isRedirect)!==!0,O;d.actionData?Object.keys(d.actionData).length>0?O=d.actionData:O=null:U?O=i.actionData:O=null;let F=d.loaderData?pe(i.loaderData,d.loaderData,d.matches||[],d.errors):i.loaderData,T=i.blockers;T.size>0&&(T=new Map(T),T.forEach((q,K)=>T.set(K,Ne)));let M=ae===!0||i.navigation.formMethod!=null&&ve(i.navigation.formMethod)&&((P=o.state)==null?void 0:P._isRedirect)!==!0;f&&(s=f,f=void 0),tt||B===y.Pop||(B===y.Push?e.history.push(o,o.state):B===y.Replace&&e.history.replace(o,o.state));let Z;if(B===y.Pop){let q=be.get(i.location.pathname);q&&q.has(o.pathname)?Z={currentLocation:i.location,nextLocation:o}:be.has(o.pathname)&&(Z={currentLocation:o,nextLocation:i.location})}else if(ye){let q=be.get(i.location.pathname);q?q.add(o.pathname):(q=new Set([o.pathname]),be.set(i.location.pathname,q)),Z={currentLocation:i.location,nextLocation:o}}ie(H({},d,{actionData:O,loaderData:F,historyAction:B,location:o,initialized:!0,navigation:ce,revalidation:"idle",restoreScrollPosition:Nr(o,d.matches||i.matches),preventScrollReset:M,blockers:T}),Z),B=y.Pop,ae=!1,ye=!1,tt=!1,He=!1,jt=[],At=[]}async function Mr(o,d){if(typeof o=="number"){e.history.go(o);return}let p=R(i.location,i.matches,h,m.v7_prependBasename,o,d==null?void 0:d.fromRouteId,d==null?void 0:d.relative),{path:P,submission:U,error:O}=S(m.v7_normalizeFormMethod,!1,p,d),F=i.location,T=me(i.location,P,d&&d.state);T=H({},T,e.history.encodeLocation(T));let M=d&&d.replace!=null?d.replace:void 0,Z=y.Push;M===!0?Z=y.Replace:M===!1||U!=null&&ve(U.formMethod)&&U.formAction===i.location.pathname+i.location.search&&(Z=y.Replace);let q=d&&"preventScrollReset"in d?d.preventScrollReset===!0:void 0,K=Fr({currentLocation:F,nextLocation:T,historyAction:Z});if(K){It(K,{state:"blocked",location:T,proceed(){It(K,{state:"proceeding",proceed:void 0,reset:void 0,location:T}),Mr(o,d)},reset(){let G=new Map(i.blockers);G.set(K,Ne),ie({blockers:G})}});return}return await $e(Z,T,{submission:U,pendingError:O,preventScrollReset:q,replace:d&&d.replace,enableViewTransition:d&&d.unstable_viewTransition})}function en(){if(lr(),ie({revalidation:"loading"}),i.navigation.state!=="submitting"){if(i.navigation.state==="idle"){$e(i.historyAction,i.location,{startUninterruptedRevalidation:!0});return}$e(B||i.historyAction,i.navigation.location,{overrideNavigation:i.navigation})}}async function $e(o,d,p){I&&I.abort(),I=null,B=o,tt=(p&&p.startUninterruptedRevalidation)===!0,cn(i.location,i.matches),ae=(p&&p.preventScrollReset)===!0,ye=(p&&p.enableViewTransition)===!0;let P=f||s,U=p&&p.overrideNavigation,O=Re(P,d,h);if(!O){let G=te(404,{pathname:d.pathname}),{matches:le,route:Ve}=Tt(P);sr(),ht(d,{matches:le,loaderData:{},errors:{[Ve.id]:G}});return}if(i.initialized&&!He&&Wr(i.location,d)&&!(p&&p.submission&&ve(p.submission.formMethod))){ht(d,{matches:O});return}I=new AbortController;let F=ee(e.history,d,I.signal,p&&p.submission),T,M;if(p&&p.pendingError)M={[qe(O).route.id]:p.pendingError};else if(p&&p.submission&&ve(p.submission.formMethod)){let G=await tn(F,d,p.submission,O,{replace:p.replace});if(G.shortCircuited)return;T=G.pendingActionData,M=G.pendingActionError,U=or(d,p.submission),F=new Request(F.url,{signal:F.signal})}let{shortCircuited:Z,loaderData:q,errors:K}=await rn(F,d,O,U,p&&p.submission,p&&p.fetcherSubmission,p&&p.replace,T,M);Z||(I=null,ht(d,H({matches:O},T?{actionData:T}:{},{loaderData:q,errors:K})))}async function tn(o,d,p,P,U){U===void 0&&(U={}),lr();let O=Vr(d,p);ie({navigation:O});let F,T=ut(P,d);if(!T.route.action&&!T.route.lazy)F={type:Q.error,error:te(405,{method:o.method,pathname:d.pathname,routeId:T.route.id})};else if(F=await V("action",o,T,P,u,a,h),o.signal.aborted)return{shortCircuited:!0};if(ke(F)){let M;return U&&U.replace!=null?M=U.replace:M=F.location===i.location.pathname+i.location.search,await pt(i,F,{submission:p,replace:M}),{shortCircuited:!0}}if(ze(F)){let M=qe(P,T.route.id);return(U&&U.replace)!==!0&&(B=y.Push),{pendingActionData:{},pendingActionError:{[M.route.id]:F.error}}}if(Ue(F))throw te(400,{type:"defer-action"});return{pendingActionData:{[T.route.id]:F.data}}}async function rn(o,d,p,P,U,O,F,T,M){let Z=P||or(d,U),q=U||O||Lr(Z),K=f||s,[G,le]=_(e.history,i,p,q,d,He,jt,At,nt,Se,K,h,T,M);if(sr(Y=>!(p&&p.some(we=>we.route.id===Y))||G&&G.some(we=>we.route.id===Y)),dt=++_t,G.length===0&&le.length===0){let Y=jr();return ht(d,H({matches:p,loaderData:{},errors:M||null},T?{actionData:T}:{},Y?{fetchers:new Map(i.fetchers)}:{})),{shortCircuited:!0}}if(!tt){le.forEach(we=>{let Ae=i.fetchers.get(we.key),re=ct(void 0,Ae?Ae.data:void 0);i.fetchers.set(we.key,re)});let Y=T||i.actionData;ie(H({navigation:Z},Y?Object.keys(Y).length===0?{actionData:null}:{actionData:Y}:{},le.length>0?{fetchers:new Map(i.fetchers)}:{}))}le.forEach(Y=>{oe.has(Y.key)&&Te(Y.key),Y.controller&&oe.set(Y.key,Y.controller)});let Ve=()=>le.forEach(Y=>Te(Y.key));I&&I.signal.addEventListener("abort",Ve);let{results:Ye,loaderResults:gt,fetcherResults:ur}=await Or(i.matches,p,G,le,o);if(o.signal.aborted)return{shortCircuited:!0};I&&I.signal.removeEventListener("abort",Ve),le.forEach(Y=>oe.delete(Y.key));let Le=Dr(Ye);if(Le){if(Le.idx>=G.length){let Y=le[Le.idx-G.length].key;Se.add(Y)}return await pt(i,Le.result,{replace:F}),{shortCircuited:!0}}let{loaderData:je,errors:Nt}=Xe(i,p,G,gt,M,le,ur,Je);Je.forEach((Y,we)=>{Y.subscribe(Ae=>{(Ae||Y.done)&&Je.delete(we)})});let cr=jr(),dr=Ar(dt),fr=cr||dr||le.length>0;return H({loaderData:je,errors:Nt},fr?{fetchers:new Map(i.fetchers)}:{})}function Ur(o){return m.v7_fetcherPersist&&(ft.set(o,(ft.get(o)||0)+1),We.has(o)&&We.delete(o)),i.fetchers.get(o)||tr}function nn(o,d,p,P){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");oe.has(o)&&Te(o);let U=f||s,O=R(i.location,i.matches,h,m.v7_prependBasename,p,d,P==null?void 0:P.relative),F=Re(U,O,h);if(!F){mt(o,d,te(404,{pathname:O}));return}let{path:T,submission:M,error:Z}=S(m.v7_normalizeFormMethod,!0,O,P);if(Z){mt(o,d,Z);return}let q=ut(F,T);if(ae=(P&&P.preventScrollReset)===!0,M&&ve(M.formMethod)){an(o,d,T,q,F,M);return}nt.set(o,{routeId:d,path:T}),on(o,d,T,q,F,M)}async function an(o,d,p,P,U,O){if(lr(),nt.delete(o),!P.route.action&&!P.route.lazy){let re=te(405,{method:O.formMethod,pathname:p,routeId:d});mt(o,d,re);return}let F=i.fetchers.get(o),T=Yr(O,F);i.fetchers.set(o,T),ie({fetchers:new Map(i.fetchers)});let M=new AbortController,Z=ee(e.history,p,M.signal,O);oe.set(o,M);let q=_t,K=await V("action",Z,P,U,u,a,h);if(Z.signal.aborted){oe.get(o)===M&&oe.delete(o);return}if(We.has(o)){i.fetchers.set(o,Oe(void 0)),ie({fetchers:new Map(i.fetchers)});return}if(ke(K))if(oe.delete(o),dt>q){let re=Oe(void 0);i.fetchers.set(o,re),ie({fetchers:new Map(i.fetchers)});return}else{Se.add(o);let re=ct(O);return i.fetchers.set(o,re),ie({fetchers:new Map(i.fetchers)}),pt(i,K,{fetcherSubmission:O})}if(ze(K)){mt(o,d,K.error);return}if(Ue(K))throw te(400,{type:"defer-action"});let G=i.navigation.location||i.location,le=ee(e.history,G,M.signal),Ve=f||s,Ye=i.navigation.state!=="idle"?Re(Ve,i.navigation.location,h):i.matches;k(Ye,"Didn't find any matches after fetcher action");let gt=++_t;rt.set(o,gt);let ur=ct(O,K.data);i.fetchers.set(o,ur);let[Le,je]=_(e.history,i,Ye,O,G,He,jt,At,nt,Se,Ve,h,{[P.route.id]:K.data},void 0);je.filter(re=>re.key!==o).forEach(re=>{let vt=re.key,Br=i.fetchers.get(vt),fn=ct(void 0,Br?Br.data:void 0);i.fetchers.set(vt,fn),oe.has(vt)&&Te(vt),re.controller&&oe.set(vt,re.controller)}),ie({fetchers:new Map(i.fetchers)});let Nt=()=>je.forEach(re=>Te(re.key));M.signal.addEventListener("abort",Nt);let{results:cr,loaderResults:dr,fetcherResults:fr}=await Or(i.matches,Ye,Le,je,le);if(M.signal.aborted)return;M.signal.removeEventListener("abort",Nt),rt.delete(o),oe.delete(o),je.forEach(re=>oe.delete(re.key));let Y=Dr(cr);if(Y){if(Y.idx>=Le.length){let re=je[Y.idx-Le.length].key;Se.add(re)}return pt(i,Y.result)}let{loaderData:we,errors:Ae}=Xe(i,i.matches,Le,dr,void 0,je,fr,Je);if(i.fetchers.has(o)){let re=Oe(K.data);i.fetchers.set(o,re)}Ar(gt),i.navigation.state==="loading"&&gt>dt?(k(B,"Expected pending action"),I&&I.abort(),ht(i.navigation.location,{matches:Ye,loaderData:we,errors:Ae,fetchers:new Map(i.fetchers)})):(ie({errors:Ae,loaderData:pe(i.loaderData,we,Ye,Ae),fetchers:new Map(i.fetchers)}),He=!1)}async function on(o,d,p,P,U,O){let F=i.fetchers.get(o),T=ct(O,F?F.data:void 0);i.fetchers.set(o,T),ie({fetchers:new Map(i.fetchers)});let M=new AbortController,Z=ee(e.history,p,M.signal);oe.set(o,M);let q=_t,K=await V("loader",Z,P,U,u,a,h);if(Ue(K)&&(K=await Sr(K,Z.signal,!0)||K),oe.get(o)===M&&oe.delete(o),Z.signal.aborted)return;if(We.has(o)){i.fetchers.set(o,Oe(void 0)),ie({fetchers:new Map(i.fetchers)});return}if(ke(K))if(dt>q){let le=Oe(void 0);i.fetchers.set(o,le),ie({fetchers:new Map(i.fetchers)});return}else{Se.add(o),await pt(i,K);return}if(ze(K)){mt(o,d,K.error);return}k(!Ue(K),"Unhandled fetcher deferred data");let G=Oe(K.data);i.fetchers.set(o,G),ie({fetchers:new Map(i.fetchers)})}async function pt(o,d,p){let{submission:P,fetcherSubmission:U,replace:O}=p===void 0?{}:p;d.revalidate&&(He=!0);let F=me(o.location,d.location,{_isRedirect:!0});if(k(F,"Expected a location on the redirect navigation"),r){let G=!1;if(d.reloadDocument)G=!0;else if(Ot.test(d.location)){const le=e.history.createURL(d.location);G=le.origin!==t.location.origin||xe(le.pathname,h)==null}if(G){O?t.location.replace(d.location):t.location.assign(d.location);return}}I=null;let T=O===!0?y.Replace:y.Push,{formMethod:M,formAction:Z,formEncType:q}=o.navigation;!P&&!U&&M&&Z&&q&&(P=Lr(o.navigation));let K=P||U;if(wr.has(d.status)&&K&&ve(K.formMethod))await $e(T,F,{submission:H({},K,{formAction:d.location}),preventScrollReset:ae});else{let G=or(F,P);await $e(T,F,{overrideNavigation:G,fetcherSubmission:U,preventScrollReset:ae})}}async function Or(o,d,p,P,U){let O=await Promise.all([...p.map(M=>V("loader",U,M,d,u,a,h)),...P.map(M=>M.matches&&M.match&&M.controller?V("loader",ee(e.history,M.path,M.controller.signal),M.match,M.matches,u,a,h):{type:Q.error,error:te(404,{pathname:M.path})})]),F=O.slice(0,p.length),T=O.slice(p.length);return await Promise.all([Cr(o,p,F,F.map(()=>U.signal),!1,i.loaderData),Cr(o,P.map(M=>M.match),T,P.map(M=>M.controller?M.controller.signal:null),!0)]),{results:O,loaderResults:F,fetcherResults:T}}function lr(){He=!0,jt.push(...sr()),nt.forEach((o,d)=>{oe.has(d)&&(At.push(d),Te(d))})}function mt(o,d,p){let P=qe(i.matches,d);Ft(o),ie({errors:{[P.route.id]:p},fetchers:new Map(i.fetchers)})}function Ft(o){let d=i.fetchers.get(o);oe.has(o)&&!(d&&d.state==="loading"&&rt.has(o))&&Te(o),nt.delete(o),rt.delete(o),Se.delete(o),We.delete(o),i.fetchers.delete(o)}function ln(o){if(m.v7_fetcherPersist){let d=(ft.get(o)||0)-1;d<=0?(ft.delete(o),We.add(o)):ft.set(o,d)}else Ft(o);ie({fetchers:new Map(i.fetchers)})}function Te(o){let d=oe.get(o);k(d,"Expected fetch controller: "+o),d.abort(),oe.delete(o)}function Tr(o){for(let d of o){let p=Ur(d),P=Oe(p.data);i.fetchers.set(d,P)}}function jr(){let o=[],d=!1;for(let p of Se){let P=i.fetchers.get(p);k(P,"Expected fetcher: "+p),P.state==="loading"&&(Se.delete(p),o.push(p),d=!0)}return Tr(o),d}function Ar(o){let d=[];for(let[p,P]of rt)if(P<o){let U=i.fetchers.get(p);k(U,"Expected fetcher: "+p),U.state==="loading"&&(Te(p),rt.delete(p),d.push(p))}return Tr(d),d.length>0}function sn(o,d){let p=i.blockers.get(o)||Ne;return Ke.get(o)!==d&&Ke.set(o,d),p}function _r(o){i.blockers.delete(o),Ke.delete(o)}function It(o,d){let p=i.blockers.get(o)||Ne;k(p.state==="unblocked"&&d.state==="blocked"||p.state==="blocked"&&d.state==="blocked"||p.state==="blocked"&&d.state==="proceeding"||p.state==="blocked"&&d.state==="unblocked"||p.state==="proceeding"&&d.state==="unblocked","Invalid blocker state transition: "+p.state+" -> "+d.state);let P=new Map(i.blockers);P.set(o,d),ie({blockers:P})}function Fr(o){let{currentLocation:d,nextLocation:p,historyAction:P}=o;if(Ke.size===0)return;Ke.size>1&&ue(!1,"A router only supports one blocker at a time");let U=Array.from(Ke.entries()),[O,F]=U[U.length-1],T=i.blockers.get(O);if(!(T&&T.state==="proceeding")&&F({currentLocation:d,nextLocation:p,historyAction:P}))return O}function sr(o){let d=[];return Je.forEach((p,P)=>{(!o||o(P))&&(p.cancel(),d.push(P),Je.delete(P))}),d}function un(o,d,p){if(C=o,E=d,b=p||null,!D&&i.navigation===ce){D=!0;let P=Nr(i.location,i.matches);P!=null&&ie({restoreScrollPosition:P})}return()=>{C=null,E=null,b=null}}function Ir(o,d){return b&&b(o,d.map(P=>kt(P,i.loaderData)))||o.key}function cn(o,d){if(C&&E){let p=Ir(o,d);C[p]=E()}}function Nr(o,d){if(C){let p=Ir(o,d),P=C[p];if(typeof P=="number")return P}return null}function dn(o){u={},f=Fe(o,a,void 0,u)}return N={get basename(){return h},get state(){return i},get routes(){return s},get window(){return t},initialize:Gr,subscribe:qr,enableScrollRestoration:un,navigate:Mr,fetch:nn,revalidate:en,createHref:o=>e.history.createHref(o),encodeLocation:o=>e.history.encodeLocation(o),getFetcher:Ur,deleteFetcher:ln,dispose:Xr,getBlocker:sn,deleteBlocker:_r,_internalFetchControllers:oe,_internalActiveDeferreds:Je,_internalSetRoutes:dn},N}const xr=Symbol("deferred");function l(e,t){k(e.length>0,"You must provide a non-empty routes array to createStaticHandler");let r={},n=(t?t.basename:null)||"/",a;if(t!=null&&t.mapRouteProperties)a=t.mapRouteProperties;else if(t!=null&&t.detectErrorBoundary){let w=t.detectErrorBoundary;a=C=>({hasErrorBoundary:w(C)})}else a=Be;let u=Fe(e,a,void 0,r);async function s(w,C){let{requestContext:b}=C===void 0?{}:C,E=new URL(w.url),D=w.method,g=me("",ge(E),null,"default"),A=Re(u,g,n);if(!nr(D)&&D!=="HEAD"){let N=te(405,{method:D}),{matches:i,route:B}=Tt(u);return{basename:n,location:g,matches:i,loaderData:{},actionData:null,errors:{[B.id]:N},statusCode:N.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}else if(!A){let N=te(404,{pathname:g.pathname}),{matches:i,route:B}=Tt(u);return{basename:n,location:g,matches:i,loaderData:{},actionData:null,errors:{[B.id]:N},statusCode:N.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let J=await h(w,g,A,b);return et(J)?J:H({location:g,basename:n},J)}async function f(w,C){let{routeId:b,requestContext:E}=C===void 0?{}:C,D=new URL(w.url),g=w.method,A=me("",ge(D),null,"default"),J=Re(u,A,n);if(!nr(g)&&g!=="HEAD"&&g!=="OPTIONS")throw te(405,{method:g});if(!J)throw te(404,{pathname:A.pathname});let N=b?J.find(I=>I.route.id===b):ut(J,A);if(b&&!N)throw te(403,{pathname:A.pathname,routeId:b});if(!N)throw te(404,{pathname:A.pathname});let i=await h(w,A,J,E,N);if(et(i))return i;let B=i.errors?Object.values(i.errors)[0]:void 0;if(B!==void 0)throw B;if(i.actionData)return Object.values(i.actionData)[0];if(i.loaderData){var ae;let I=Object.values(i.loaderData)[0];return(ae=i.activeDeferreds)!=null&&ae[N.route.id]&&(I[xr]=i.activeDeferreds[N.route.id]),I}}async function h(w,C,b,E,D){k(w.signal,"query()/queryRoute() requests must contain an AbortController signal");try{if(ve(w.method.toLowerCase()))return await m(w,b,D||ut(b,C),E,D!=null);let g=await x(w,b,E,D);return et(g)?g:H({},g,{actionData:null,actionHeaders:{}})}catch(g){if($r(g)){if(g.type===Q.error)throw g.response;return g.response}if(Kr(g))return g;throw g}}async function m(w,C,b,E,D){let g;if(!b.route.action&&!b.route.lazy){let N=te(405,{method:w.method,pathname:new URL(w.url).pathname,routeId:b.route.id});if(D)throw N;g={type:Q.error,error:N}}else if(g=await V("action",w,b,C,r,a,n,{isStaticRequest:!0,isRouteRequest:D,requestContext:E}),w.signal.aborted){let N=D?"queryRoute":"query";throw new Error(N+"() call aborted: "+w.method+" "+w.url)}if(ke(g))throw new Response(null,{status:g.status,headers:{Location:g.location}});if(Ue(g)){let N=te(400,{type:"defer-action"});if(D)throw N;g={type:Q.error,error:N}}if(D){if(ze(g))throw g.error;return{matches:[b],loaderData:{},actionData:{[b.route.id]:g.data},errors:null,statusCode:200,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}if(ze(g)){let N=qe(C,b.route.id),i=await x(w,C,E,void 0,{[N.route.id]:g.error});return H({},i,{statusCode:lt(g.error)?g.error.status:500,actionData:null,actionHeaders:H({},g.headers?{[b.route.id]:g.headers}:{})})}let A=new Request(w.url,{headers:w.headers,redirect:w.redirect,signal:w.signal}),J=await x(A,C,E);return H({},J,g.statusCode?{statusCode:g.statusCode}:{},{actionData:{[b.route.id]:g.data},actionHeaders:H({},g.headers?{[b.route.id]:g.headers}:{})})}async function x(w,C,b,E,D){let g=E!=null;if(g&&!(E!=null&&E.route.loader)&&!(E!=null&&E.route.lazy))throw te(400,{method:w.method,pathname:new URL(w.url).pathname,routeId:E==null?void 0:E.route.id});let J=(E?[E]:L(C,Object.keys(D||{})[0])).filter(I=>I.route.loader||I.route.lazy);if(J.length===0)return{matches:C,loaderData:C.reduce((I,ye)=>Object.assign(I,{[ye.route.id]:null}),{}),errors:D||null,statusCode:200,loaderHeaders:{},activeDeferreds:null};let N=await Promise.all([...J.map(I=>V("loader",w,I,C,r,a,n,{isStaticRequest:!0,isRouteRequest:g,requestContext:b}))]);if(w.signal.aborted){let I=g?"queryRoute":"query";throw new Error(I+"() call aborted: "+w.method+" "+w.url)}let i=new Map,B=Me(C,J,N,D,i),ae=new Set(J.map(I=>I.route.id));return C.forEach(I=>{ae.has(I.route.id)||(B.loaderData[I.route.id]=null)}),H({},B,{matches:C,activeDeferreds:i.size>0?Object.fromEntries(i.entries()):null})}return{dataRoutes:u,query:s,queryRoute:f}}function c(e,t,r){return H({},t,{statusCode:500,errors:{[t._deepestRenderedBoundaryId||e[0].id]:r}})}function v(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function R(e,t,r,n,a,u,s){let f,h;if(u!=null&&s!=="path"){f=[];for(let x of t)if(f.push(x),x.route.id===u){h=x;break}}else f=t,h=t[t.length-1];let m=Qt(a||".",Pt(f).map(x=>x.pathnameBase),xe(e.pathname,r)||e.pathname,s==="path");return a==null&&(m.search=e.search,m.hash=e.hash),(a==null||a===""||a===".")&&h&&h.route.index&&!ar(m.search)&&(m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(m.pathname=m.pathname==="/"?r:Ie([r,m.pathname])),ge(m)}function S(e,t,r,n){if(!n||!v(n))return{path:r};if(n.formMethod&&!nr(n.formMethod))return{path:r,error:te(405,{method:n.formMethod})};let a=()=>({path:r,error:te(400,{type:"invalid-body"})}),u=n.formMethod||"get",s=e?u.toUpperCase():u.toLowerCase(),f=Pr(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!ve(s))return a();let C=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((b,E)=>{let[D,g]=E;return""+b+D+"="+g+`
20
+ `},""):String(n.body);return{path:r,submission:{formMethod:s,formAction:f,formEncType:n.formEncType,formData:void 0,json:void 0,text:C}}}else if(n.formEncType==="application/json"){if(!ve(s))return a();try{let C=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:s,formAction:f,formEncType:n.formEncType,formData:void 0,json:C,text:void 0}}}catch{return a()}}}k(typeof FormData=="function","FormData is not available in this environment");let h,m;if(n.formData)h=se(n.formData),m=n.formData;else if(n.body instanceof FormData)h=se(n.body),m=n.body;else if(n.body instanceof URLSearchParams)h=n.body,m=he(h);else if(n.body==null)h=new URLSearchParams,m=new FormData;else try{h=new URLSearchParams(n.body),m=he(h)}catch{return a()}let x={formMethod:s,formAction:f,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:m,json:void 0,text:void 0};if(ve(x.formMethod))return{path:r,submission:x};let w=ne(r);return t&&w.search&&ar(w.search)&&h.append("index",""),w.search="?"+h,{path:ge(w),submission:x}}function L(e,t){let r=e;if(t){let n=e.findIndex(a=>a.route.id===t);n>=0&&(r=e.slice(0,n))}return r}function _(e,t,r,n,a,u,s,f,h,m,x,w,C,b){let E=b?Object.values(b)[0]:C?Object.values(C)[0]:void 0,D=e.createURL(t.location),g=e.createURL(a),A=b?Object.keys(b)[0]:void 0,N=L(r,A).filter((B,ae)=>{if(B.route.lazy)return!0;if(B.route.loader==null)return!1;if(W(t.loaderData,t.matches[ae],B)||s.some(be=>be===B.route.id))return!0;let I=t.matches[ae],ye=B;return $(B,H({currentUrl:D,currentParams:I.params,nextUrl:g,nextParams:ye.params},n,{actionResult:E,defaultShouldRevalidate:u||D.pathname+D.search===g.pathname+g.search||D.search!==g.search||j(I,ye)}))}),i=[];return h.forEach((B,ae)=>{if(!r.some(tt=>tt.route.id===B.routeId))return;let I=Re(x,B.path,w);if(!I){i.push({key:ae,routeId:B.routeId,path:B.path,matches:null,match:null,controller:null});return}let ye=t.fetchers.get(ae),be=ut(I,B.path),Ce=!1;m.has(ae)?Ce=!1:f.includes(ae)?Ce=!0:ye&&ye.state!=="idle"&&ye.data===void 0?Ce=u:Ce=$(be,H({currentUrl:D,currentParams:t.matches[t.matches.length-1].params,nextUrl:g,nextParams:r[r.length-1].params},n,{actionResult:E,defaultShouldRevalidate:u})),Ce&&i.push({key:ae,routeId:B.routeId,path:B.path,matches:I,match:be,controller:new AbortController})}),[N,i]}function W(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function j(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function $(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function X(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];k(a,"No route found in manifest");let u={};for(let s in n){let h=a[s]!==void 0&&s!=="hasErrorBoundary";ue(!h,'Route "'+a.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!h&&!hr.has(s)&&(u[s]=n[s])}Object.assign(a,u),Object.assign(a,H({},t(a),{lazy:void 0}))}async function V(e,t,r,n,a,u,s,f){f===void 0&&(f={});let h,m,x,w=E=>{let D,g=new Promise((A,J)=>D=J);return x=()=>D(),t.signal.addEventListener("abort",x),Promise.race([E({request:t,params:r.params,context:f.requestContext}),g])};try{let E=r.route[e];if(r.route.lazy)if(E){let D,g=await Promise.all([w(E).catch(A=>{D=A}),X(r.route,u,a)]);if(D)throw D;m=g[0]}else if(await X(r.route,u,a),E=r.route[e],E)m=await w(E);else if(e==="action"){let D=new URL(t.url),g=D.pathname+D.search;throw te(405,{method:t.method,pathname:g,routeId:r.route.id})}else return{type:Q.data,data:void 0};else if(E)m=await w(E);else{let D=new URL(t.url),g=D.pathname+D.search;throw te(404,{pathname:g})}k(m!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(E){h=Q.error,m=E}finally{x&&t.signal.removeEventListener("abort",x)}if(et(m)){let E=m.status;if(er.has(E)){let A=m.headers.get("Location");if(k(A,"Redirects returned/thrown from loaders/actions must have a Location header"),!Ot.test(A))A=R(new URL(t.url),n.slice(0,n.indexOf(r)+1),s,!0,A);else if(!f.isStaticRequest){let J=new URL(t.url),N=A.startsWith("//")?new URL(J.protocol+A):new URL(A),i=xe(N.pathname,s)!=null;N.origin===J.origin&&i&&(A=N.pathname+N.search+N.hash)}if(f.isStaticRequest)throw m.headers.set("Location",A),m;return{type:Q.redirect,status:E,location:A,revalidate:m.headers.get("X-Remix-Revalidate")!==null,reloadDocument:m.headers.get("X-Remix-Reload-Document")!==null}}if(f.isRouteRequest)throw{type:h===Q.error?Q.error:Q.data,response:m};let D,g=m.headers.get("Content-Type");return g&&/\bapplication\/json\b/.test(g)?D=await m.json():D=await m.text(),h===Q.error?{type:h,error:new Lt(E,m.statusText,D),headers:m.headers}:{type:Q.data,data:D,statusCode:m.status,headers:m.headers}}if(h===Q.error)return{type:h,error:m};if(Jr(m)){var C,b;return{type:Q.deferred,deferredData:m,statusCode:(C=m.init)==null?void 0:C.status,headers:((b=m.init)==null?void 0:b.headers)&&new Headers(m.init.headers)}}return{type:Q.data,data:m}}function ee(e,t,r,n){let a=e.createURL(Pr(t)).toString(),u={signal:r};if(n&&ve(n.formMethod)){let{formMethod:s,formEncType:f}=n;u.method=s.toUpperCase(),f==="application/json"?(u.headers=new Headers({"Content-Type":f}),u.body=JSON.stringify(n.json)):f==="text/plain"?u.body=n.text:f==="application/x-www-form-urlencoded"&&n.formData?u.body=se(n.formData):u.body=n.formData}return new Request(a,u)}function se(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function he(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Me(e,t,r,n,a){let u={},s=null,f,h=!1,m={};return r.forEach((x,w)=>{let C=t[w].route.id;if(k(!ke(x),"Cannot handle redirect results in processLoaderData"),ze(x)){let b=qe(e,C),E=x.error;n&&(E=Object.values(n)[0],n=void 0),s=s||{},s[b.route.id]==null&&(s[b.route.id]=E),u[C]=void 0,h||(h=!0,f=lt(x.error)?x.error.status:500),x.headers&&(m[C]=x.headers)}else Ue(x)?(a.set(C,x.deferredData),u[C]=x.deferredData.data):u[C]=x.data,x.statusCode!=null&&x.statusCode!==200&&!h&&(f=x.statusCode),x.headers&&(m[C]=x.headers)}),n&&(s=n,u[Object.keys(n)[0]]=void 0),{loaderData:u,errors:s,statusCode:f||200,loaderHeaders:m}}function Xe(e,t,r,n,a,u,s,f){let{loaderData:h,errors:m}=Me(t,r,n,a,f);for(let x=0;x<u.length;x++){let{key:w,match:C,controller:b}=u[x];k(s!==void 0&&s[x]!==void 0,"Did not find corresponding fetcher result");let E=s[x];if(!(b&&b.signal.aborted))if(ze(E)){let D=qe(e.matches,C==null?void 0:C.route.id);m&&m[D.route.id]||(m=H({},m,{[D.route.id]:E.error})),e.fetchers.delete(w)}else if(ke(E))k(!1,"Unhandled fetcher revalidation redirect");else if(Ue(E))k(!1,"Unhandled fetcher deferred data");else{let D=Oe(E.data);e.fetchers.set(w,D)}}return{loaderData:h,errors:m}}function pe(e,t,r,n){let a=H({},t);for(let u of r){let s=u.route.id;if(t.hasOwnProperty(s)?t[s]!==void 0&&(a[s]=t[s]):e[s]!==void 0&&u.route.loader&&(a[s]=e[s]),n&&n.hasOwnProperty(s))break}return a}function qe(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function Tt(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function te(e,t){let{pathname:r,routeId:n,method:a,type:u}=t===void 0?{}:t,s="Unknown Server Error",f="Unknown @remix-run/router error";return e===400?(s="Bad Request",a&&r&&n?f="You made a "+a+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":u==="defer-action"?f="defer() is not supported in actions":u==="invalid-body"&&(f="Unable to encode submission body")):e===403?(s="Forbidden",f='Route "'+n+'" does not match URL "'+r+'"'):e===404?(s="Not Found",f='No route matches URL "'+r+'"'):e===405&&(s="Method Not Allowed",a&&r&&n?f="You made a "+a.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":a&&(f='Invalid request method "'+a.toUpperCase()+'"')),new Lt(e||500,s,new Error(f),!0)}function Dr(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(ke(r))return{result:r,idx:t}}}function Pr(e){let t=typeof e=="string"?ne(e):e;return ge(H({},t,{hash:""}))}function Wr(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Ue(e){return e.type===Q.deferred}function ze(e){return e.type===Q.error}function ke(e){return(e&&e.type)===Q.redirect}function Jr(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function et(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body!="undefined"}function Kr(e){if(!et(e))return!1;let t=e.status,r=e.headers.get("Location");return t>=300&&t<=399&&r!=null}function $r(e){return e&&et(e.response)&&(e.type===Q.data||e.type===Q.error)}function nr(e){return st.has(e.toLowerCase())}function ve(e){return qt.has(e.toLowerCase())}async function Cr(e,t,r,n,a,u){for(let s=0;s<r.length;s++){let f=r[s],h=t[s];if(!h)continue;let m=e.find(w=>w.route.id===h.route.id),x=m!=null&&!j(m,h)&&(u&&u[h.route.id])!==void 0;if(Ue(f)&&(a||x)){let w=n[s];k(w,"Expected an AbortSignal for revalidating fetcher deferred result"),await Sr(f,w,a).then(C=>{C&&(r[s]=C||r[s])})}}}async function Sr(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:Q.data,data:e.deferredData.unwrappedData}}catch(a){return{type:Q.error,error:a}}return{type:Q.data,data:e.deferredData.data}}}function ar(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ut(e,t){let r=typeof t=="string"?ne(t).search:t.search;if(e[e.length-1].route.index&&ar(r||""))return e[e.length-1];let n=Pt(e);return n[n.length-1]}function Lr(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:u,json:s}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(u!=null)return{formMethod:t,formAction:r,formEncType:n,formData:u,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:s,text:void 0}}}function or(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Vr(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function ct(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 Yr(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 Oe(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 Qr(e,t){try{let r=e.sessionStorage.getItem(rr);if(r){let n=JSON.parse(r);for(let[a,u]of Object.entries(n||{}))u&&Array.isArray(u)&&t.set(a,new Set(u||[]))}}catch{}}function Zr(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(rr,JSON.stringify(r))}catch(n){ue(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}}}]);})();
21
+
22
+ //# sourceMappingURL=module-react-router.d96a5b36.js.map