@techdocs/cli 1.8.5-next.0 → 1.8.5
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.
- package/CHANGELOG.md +19 -6
- package/dist/embedded-app/.config-schema.json +30 -521
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/124.0135c04a.chunk.js +5 -0
- package/dist/embedded-app/static/124.0135c04a.chunk.js.map +1 -0
- package/dist/embedded-app/static/2401.ef30400a.chunk.js +5 -0
- package/dist/embedded-app/static/2401.ef30400a.chunk.js.map +1 -0
- package/dist/embedded-app/static/2420.9681849a.chunk.js +5 -0
- package/dist/embedded-app/static/2420.9681849a.chunk.js.map +1 -0
- package/dist/embedded-app/static/2490.5e7810f2.chunk.js +3 -0
- package/dist/embedded-app/static/2490.5e7810f2.chunk.js.map +1 -0
- package/dist/embedded-app/static/287.06d3556f.chunk.js +5 -0
- package/dist/embedded-app/static/287.06d3556f.chunk.js.map +1 -0
- package/dist/embedded-app/static/3182.950641c7.chunk.js +6 -0
- package/dist/embedded-app/static/{3182.1f1ac12b.chunk.js.map → 3182.950641c7.chunk.js.map} +1 -1
- package/dist/embedded-app/static/3308.4f503c75.chunk.js +7 -0
- package/dist/embedded-app/static/3308.4f503c75.chunk.js.map +1 -0
- package/dist/embedded-app/static/3632.09c5925e.chunk.js +5 -0
- package/dist/embedded-app/static/3632.09c5925e.chunk.js.map +1 -0
- package/dist/embedded-app/static/6271.df98b248.chunk.js +5 -0
- package/dist/embedded-app/static/6271.df98b248.chunk.js.map +1 -0
- package/dist/embedded-app/static/8307.2c2ef2dd.chunk.js +8 -0
- package/dist/embedded-app/static/{8307.4878037e.chunk.js.map → 8307.2c2ef2dd.chunk.js.map} +1 -1
- package/dist/embedded-app/static/8384.516f6f61.chunk.js +5 -0
- package/dist/embedded-app/static/8384.516f6f61.chunk.js.map +1 -0
- package/dist/embedded-app/static/9652.a7eea251.chunk.js +5 -0
- package/dist/embedded-app/static/9652.a7eea251.chunk.js.map +1 -0
- package/dist/embedded-app/static/main.1f016c9f.js +495 -0
- package/dist/embedded-app/static/main.1f016c9f.js.map +1 -0
- package/dist/embedded-app/static/module-react-router-dom.b2a616ac.js +22 -0
- package/dist/embedded-app/static/module-react-router-dom.b2a616ac.js.map +1 -0
- package/dist/embedded-app/static/module-react-router.96a60fdb.js +22 -0
- package/dist/embedded-app/static/module-react-router.96a60fdb.js.map +1 -0
- package/dist/embedded-app/static/{runtime.76ed602b.js → runtime.1f016c9f.js} +2 -2
- package/dist/embedded-app/static/{runtime.76ed602b.js.map → runtime.1f016c9f.js.map} +1 -1
- package/dist/embedded-app/static/vendor.1f016c9f.js +160 -0
- package/dist/embedded-app/static/vendor.1f016c9f.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +6 -6
- package/dist/embedded-app/static/124.b3c877f4.chunk.js +0 -5
- package/dist/embedded-app/static/124.b3c877f4.chunk.js.map +0 -1
- package/dist/embedded-app/static/1600.9d865b04.chunk.js +0 -3
- package/dist/embedded-app/static/1600.9d865b04.chunk.js.map +0 -1
- package/dist/embedded-app/static/2401.dc2fecde.chunk.js +0 -5
- package/dist/embedded-app/static/2401.dc2fecde.chunk.js.map +0 -1
- package/dist/embedded-app/static/2420.cd4a65c3.chunk.js +0 -5
- package/dist/embedded-app/static/2420.cd4a65c3.chunk.js.map +0 -1
- package/dist/embedded-app/static/287.4b32d161.chunk.js +0 -5
- package/dist/embedded-app/static/287.4b32d161.chunk.js.map +0 -1
- package/dist/embedded-app/static/3182.1f1ac12b.chunk.js +0 -6
- package/dist/embedded-app/static/3308.7a6908ef.chunk.js +0 -7
- package/dist/embedded-app/static/3308.7a6908ef.chunk.js.map +0 -1
- package/dist/embedded-app/static/3632.92f2c3f7.chunk.js +0 -5
- package/dist/embedded-app/static/3632.92f2c3f7.chunk.js.map +0 -1
- package/dist/embedded-app/static/6271.18498a88.chunk.js +0 -5
- package/dist/embedded-app/static/6271.18498a88.chunk.js.map +0 -1
- package/dist/embedded-app/static/8307.4878037e.chunk.js +0 -8
- package/dist/embedded-app/static/8384.69d4b96e.chunk.js +0 -5
- package/dist/embedded-app/static/8384.69d4b96e.chunk.js.map +0 -1
- package/dist/embedded-app/static/9652.80cea275.chunk.js +0 -5
- package/dist/embedded-app/static/9652.80cea275.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.76ed602b.js +0 -497
- package/dist/embedded-app/static/main.76ed602b.js.map +0 -1
- package/dist/embedded-app/static/module-react-router-dom.3fde9fd7.js +0 -22
- package/dist/embedded-app/static/module-react-router-dom.3fde9fd7.js.map +0 -1
- package/dist/embedded-app/static/module-react-router.296c491a.js +0 -22
- package/dist/embedded-app/static/module-react-router.296c491a.js.map +0 -1
- package/dist/embedded-app/static/vendor.76ed602b.js +0 -160
- package/dist/embedded-app/static/vendor.76ed602b.js.map +0 -1
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[2754],{18690:function(Kr,Wt,tt){var z;tt.d(Wt,{$P:function(){return Re},AV:function(){return Ge},BV:function(){return ir},C5:function(){return At},Ix:function(){return mt},P1:function(){return xt},Ri:function(){return ie},Ye:function(){return Pt},Zp:function(){return Se},fS:function(){return at},g:function(){return Yt},jb:function(){return se},qh:function(){return Ut},sv:function(){return or},x$:function(){return Dt},zy:function(){return Te}});var y=tt(14041),B=tt(74808);/**
|
|
2
|
-
* React Router v6.22.1
|
|
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 Le(){return Le=Object.assign?Object.assign.bind():function(l){for(var s=1;s<arguments.length;s++){var v=arguments[s];for(var R in v)Object.prototype.hasOwnProperty.call(v,R)&&(l[R]=v[R])}return l},Le.apply(this,arguments)}const ft=y.createContext(null),$t=y.createContext(null),H=y.createContext(null),se=y.createContext(null),We=y.createContext(null),ge=y.createContext({outlet:null,matches:[],isDataRoute:!1}),be=y.createContext(null);function Re(l,s){let{relative:v}=s===void 0?{}:s;ie()||(0,B.Oi)(!1);let{basename:R,navigator:S}=y.useContext(se),{hash:A,pathname:M,search:K}=Dt(l,{relative:v}),q=M;return R!=="/"&&(q=M==="/"?R:(0,B.HS)([R,M])),S.createHref({pathname:q,search:K,hash:A})}function ie(){return y.useContext(We)!=null}function Te(){return ie()||(0,B.Oi)(!1),y.useContext(We).location}function Z(){return React.useContext(We).navigationType}function br(l){ie()||UNSAFE_invariant(!1);let{pathname:s}=Te();return React.useMemo(()=>matchPath(l,s),[s,l])}const Rr=null;function $e(l){y.useContext(se).static||y.useLayoutEffect(l)}function Se(){let{isDataRoute:l}=y.useContext(ge);return l?nr():Vt()}function Vt(){ie()||(0,B.Oi)(!1);let l=y.useContext(ft),{basename:s,future:v,navigator:R}=y.useContext(se),{matches:S}=y.useContext(ge),{pathname:A}=Te(),M=JSON.stringify((0,B.yD)(S,v.v7_relativeSplatPath)),K=y.useRef(!1);return $e(()=>{K.current=!0}),y.useCallback(function(k,$){if($===void 0&&($={}),!K.current)return;if(typeof k=="number"){R.go(k);return}let T=(0,B.Gh)(k,JSON.parse(M),A,$.relative==="path");l==null&&s!=="/"&&(T.pathname=T.pathname==="/"?s:(0,B.HS)([s,T.pathname])),($.replace?R.replace:R.push)(T,$.state,$)},[s,R,M,A,l])}const ht=y.createContext(null);function Jt(){return React.useContext(ht)}function xt(l){let s=y.useContext(ge).outlet;return s&&y.createElement(ht.Provider,{value:l},s)}function Yt(){let{matches:l}=y.useContext(ge),s=l[l.length-1];return s?s.params:{}}function Dt(l,s){let{relative:v}=s===void 0?{}:s,{future:R}=y.useContext(se),{matches:S}=y.useContext(ge),{pathname:A}=Te(),M=JSON.stringify((0,B.yD)(S,R.v7_relativeSplatPath));return y.useMemo(()=>(0,B.Gh)(l,JSON.parse(M),A,v==="path"),[l,M,A,v])}function Pt(l,s){return St(l,s)}function St(l,s,v,R){ie()||(0,B.Oi)(!1);let{navigator:S}=y.useContext(se),{matches:A}=y.useContext(ge),M=A[A.length-1],K=M?M.params:{},q=M?M.pathname:"/",k=M?M.pathnameBase:"/",$=M&&M.route,T=Te(),X;if(s){var ne;let ue=typeof s=="string"?(0,B.Rr)(s):s;k==="/"||(ne=ue.pathname)!=null&&ne.startsWith(k)||(0,B.Oi)(!1),X=ue}else X=T;let me=X.pathname||"/",Ee=me;if(k!=="/"){let ue=k.replace(/^\//,"").split("/");Ee="/"+me.replace(/^\//,"").split("/").slice(ue.length).join("/")}let we=(0,B.ue)(l,{pathname:Ee}),Ae=Lt(we&&we.map(ue=>Object.assign({},ue,{params:Object.assign({},K,ue.params),pathname:(0,B.HS)([k,S.encodeLocation?S.encodeLocation(ue.pathname).pathname:ue.pathname]),pathnameBase:ue.pathnameBase==="/"?k:(0,B.HS)([k,S.encodeLocation?S.encodeLocation(ue.pathnameBase).pathname:ue.pathnameBase])})),A,v,R);return s&&Ae?y.createElement(We.Provider,{value:{location:Le({pathname:"/",search:"",hash:"",state:null,key:"default"},X),navigationType:B.rc.Pop}},Ae):Ae}function Gt(){let l=tr(),s=(0,B.pX)(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},A={padding:"2px 4px",backgroundColor:R};return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},s),v?y.createElement("pre",{style:S},v):null,null)}const Xt=y.createElement(Gt,null);class Ct extends y.Component{constructor(s){super(s),this.state={location:s.location,revalidation:s.revalidation,error:s.error}}static getDerivedStateFromError(s){return{error:s}}static getDerivedStateFromProps(s,v){return v.location!==s.location||v.revalidation!=="idle"&&s.revalidation==="idle"?{error:s.error,location:s.location,revalidation:s.revalidation}:{error:s.error!==void 0?s.error:v.error,location:v.location,revalidation:s.revalidation||v.revalidation}}componentDidCatch(s,v){console.error("React Router caught the following error during render",s,v)}render(){return this.state.error!==void 0?y.createElement(ge.Provider,{value:this.props.routeContext},y.createElement(be.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Qt(l){let{routeContext:s,match:v,children:R}=l,S=y.useContext(ft);return S&&S.static&&S.staticContext&&(v.route.errorElement||v.route.ErrorBoundary)&&(S.staticContext._deepestRenderedBoundaryId=v.route.id),y.createElement(ge.Provider,{value:s},R)}function Lt(l,s,v,R){var S;if(s===void 0&&(s=[]),v===void 0&&(v=null),R===void 0&&(R=null),l==null){var A;if((A=v)!=null&&A.errors)l=v.matches;else return null}let M=l,K=(S=v)==null?void 0:S.errors;if(K!=null){let $=M.findIndex(T=>T.route.id&&(K==null?void 0:K[T.route.id]));$>=0||(0,B.Oi)(!1),M=M.slice(0,Math.min(M.length,$+1))}let q=!1,k=-1;if(v&&R&&R.v7_partialHydration)for(let $=0;$<M.length;$++){let T=M[$];if((T.route.HydrateFallback||T.route.hydrateFallbackElement)&&(k=$),T.route.id){let{loaderData:X,errors:ne}=v,me=T.route.loader&&X[T.route.id]===void 0&&(!ne||ne[T.route.id]===void 0);if(T.route.lazy||me){q=!0,k>=0?M=M.slice(0,k+1):M=[M[0]];break}}}return M.reduceRight(($,T,X)=>{let ne,me=!1,Ee=null,we=null;v&&(ne=K&&T.route.id?K[T.route.id]:void 0,Ee=T.route.errorElement||Xt,q&&(k<0&&X===0?(ar("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),me=!0,we=null):k===X&&(me=!0,we=T.route.hydrateFallbackElement||null)));let Ae=s.concat(M.slice(0,X+1)),ue=()=>{let ve;return ne?ve=Ee:me?ve=we:T.route.Component?ve=y.createElement(T.route.Component,null):T.route.element?ve=T.route.element:ve=$,y.createElement(Qt,{match:T,routeContext:{outlet:$,matches:Ae,isDataRoute:v!=null},children:ve})};return v&&(T.route.ErrorBoundary||T.route.errorElement||X===0)?y.createElement(Ct,{location:v.location,revalidation:v.revalidation,component:Ee,error:ne,children:ue(),routeContext:{outlet:null,matches:Ae,isDataRoute:!0}}):ue()},null)}var rt=function(l){return l.UseBlocker="useBlocker",l.UseRevalidator="useRevalidator",l.UseNavigateStable="useNavigate",l}(rt||{}),he=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}(he||{});function Er(l){return l+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function pt(l){let s=y.useContext(ft);return s||(0,B.Oi)(!1),s}function Me(l){let s=y.useContext($t);return s||(0,B.Oi)(!1),s}function Ve(l){let s=y.useContext(ge);return s||(0,B.Oi)(!1),s}function Fe(l){let s=Ve(l),v=s.matches[s.matches.length-1];return v.route.id||(0,B.Oi)(!1),v.route.id}function wr(){return Fe(he.UseRouteId)}function Mt(){return Me(he.UseNavigation).navigation}function Zt(){let l=pt(rt.UseRevalidator),s=Me(he.UseRevalidator);return React.useMemo(()=>({revalidate:l.router.revalidate,state:s.revalidation}),[l.router.revalidate,s.revalidation])}function qt(){let{matches:l,loaderData:s}=Me(he.UseMatches);return React.useMemo(()=>l.map(v=>UNSAFE_convertRouteMatchToUiMatch(v,s)),[l,s])}function er(){let l=Me(he.UseLoaderData),s=Fe(he.UseLoaderData);if(l.errors&&l.errors[s]!=null){console.error("You cannot `useLoaderData` in an errorElement (routeId: "+s+")");return}return l.loaderData[s]}function Wr(l){return Me(he.UseRouteLoaderData).loaderData[l]}function Je(){let l=Me(he.UseActionData),s=Fe(he.UseLoaderData);return l.actionData?l.actionData[s]:void 0}function tr(){var l;let s=y.useContext(be),v=Me(he.UseRouteError),R=Fe(he.UseRouteError);return s!==void 0?s:(l=v.errors)==null?void 0:l[R]}function rr(){let l=React.useContext(H);return l==null?void 0:l._data}function xr(){let l=React.useContext(H);return l==null?void 0:l._error}let Dr=0;function _t(l){let{router:s,basename:v}=pt(rt.UseBlocker),R=Me(he.UseBlocker),[S,A]=React.useState(""),M=React.useCallback(K=>{if(typeof l!="function")return!!l;if(v==="/")return l(K);let{currentLocation:q,nextLocation:k,historyAction:$}=K;return l({currentLocation:Le({},q,{pathname:stripBasename(q.pathname,v)||q.pathname}),nextLocation:Le({},k,{pathname:stripBasename(k.pathname,v)||k.pathname}),historyAction:$})},[v,l]);return React.useEffect(()=>{let K=String(++Dr);return A(K),()=>s.deleteBlocker(K)},[s]),React.useEffect(()=>{S!==""&&s.getBlocker(S,M)},[s,S,M]),S&&R.blockers.has(S)?R.blockers.get(S):IDLE_BLOCKER}function nr(){let{router:l}=pt(rt.UseNavigateStable),s=Fe(he.UseNavigateStable),v=y.useRef(!1);return $e(()=>{v.current=!0}),y.useCallback(function(S,A){A===void 0&&(A={}),v.current&&(typeof S=="number"?l.navigate(S):l.navigate(S,Le({fromRouteId:s},A)))},[l,s])}const Ot={};function ar(l,s,v){!s&&!Ot[l]&&(Ot[l]=!0)}const nt=(z||(z=tt.t(y,2)))["startTransition"];function Vr(l){let{fallbackElement:s,router:v,future:R}=l,[S,A]=React.useState(v.state),{v7_startTransition:M}=R||{},K=React.useCallback(T=>{M&&nt?nt(()=>A(T)):A(T)},[A,M]);React.useLayoutEffect(()=>v.subscribe(K),[v,K]),React.useEffect(()=>{},[]);let q=React.useMemo(()=>({createHref:v.createHref,encodeLocation:v.encodeLocation,go:T=>v.navigate(T),push:(T,X,ne)=>v.navigate(T,{state:X,preventScrollReset:ne==null?void 0:ne.preventScrollReset}),replace:(T,X,ne)=>v.navigate(T,{replace:!0,state:X,preventScrollReset:ne==null?void 0:ne.preventScrollReset})}),[v]),k=v.basename||"/",$=React.useMemo(()=>({router:v,navigator:q,static:!1,basename:k}),[v,q,k]);return React.createElement(React.Fragment,null,React.createElement(ft.Provider,{value:$},React.createElement($t.Provider,{value:S},React.createElement(mt,{basename:k,location:S.location,navigationType:S.historyAction,navigator:q,future:{v7_relativeSplatPath:v.future.v7_relativeSplatPath}},S.initialized||v.future.v7_partialHydration?React.createElement(Tt,{routes:v.routes,future:v.future,state:S}):s))),null)}function Tt(l){let{routes:s,future:v,state:R}=l;return St(s,void 0,R,v)}function at(l){let{basename:s,children:v,initialEntries:R,initialIndex:S,future:A}=l,M=y.useRef();M.current==null&&(M.current=(0,B.sC)({initialEntries:R,initialIndex:S,v5Compat:!0}));let K=M.current,[q,k]=y.useState({action:K.action,location:K.location}),{v7_startTransition:$}=A||{},T=y.useCallback(X=>{$&&nt?nt(()=>k(X)):k(X)},[k,$]);return y.useLayoutEffect(()=>K.listen(T),[K,T]),y.createElement(mt,{basename:s,children:v,location:q.location,navigationType:q.action,navigator:K,future:A})}function At(l){let{to:s,replace:v,state:R,relative:S}=l;ie()||(0,B.Oi)(!1);let{future:A,static:M}=y.useContext(se),{matches:K}=y.useContext(ge),{pathname:q}=Te(),k=Se(),$=(0,B.Gh)(s,(0,B.yD)(K,A.v7_relativeSplatPath),q,S==="path"),T=JSON.stringify($);return y.useEffect(()=>k(JSON.parse(T),{replace:v,state:R,relative:S}),[k,T,S,v,R]),null}function or(l){return xt(l.context)}function Ut(l){(0,B.Oi)(!1)}function mt(l){let{basename:s="/",children:v=null,location:R,navigationType:S=B.rc.Pop,navigator:A,static:M=!1,future:K}=l;ie()&&(0,B.Oi)(!1);let q=s.replace(/^\/*/,"/"),k=y.useMemo(()=>({basename:q,navigator:A,static:M,future:Le({v7_relativeSplatPath:!1},K)}),[q,K,A,M]);typeof R=="string"&&(R=(0,B.Rr)(R));let{pathname:$="/",search:T="",hash:X="",state:ne=null,key:me="default"}=R,Ee=y.useMemo(()=>{let we=(0,B.pb)($,q);return we==null?null:{location:{pathname:we,search:T,hash:X,state:ne,key:me},navigationType:S}},[q,$,T,X,ne,me,S]);return Ee==null?null:y.createElement(se.Provider,{value:k},y.createElement(We.Provider,{children:v,value:Ee}))}function ir(l){let{children:s,location:v}=l;return Pt(Ge(s),v)}function Pr(l){let{children:s,errorElement:v,resolve:R}=l;return React.createElement(Ye,{resolve:R,errorElement:v},React.createElement(jt,null,s))}var pe=function(l){return l[l.pending=0]="pending",l[l.success=1]="success",l[l.error=2]="error",l}(pe||{});const lr=new Promise(()=>{});class Ye extends y.Component{constructor(s){super(s),this.state={error:null}}static getDerivedStateFromError(s){return{error:s}}componentDidCatch(s,v){console.error("<Await> caught the following error during render",s,v)}render(){let{children:s,errorElement:v,resolve:R}=this.props,S=null,A=pe.pending;if(!(R instanceof Promise))A=pe.success,S=Promise.resolve(),Object.defineProperty(S,"_tracked",{get:()=>!0}),Object.defineProperty(S,"_data",{get:()=>R});else if(this.state.error){A=pe.error;let M=this.state.error;S=Promise.reject().catch(()=>{}),Object.defineProperty(S,"_tracked",{get:()=>!0}),Object.defineProperty(S,"_error",{get:()=>M})}else R._tracked?(S=R,A=S._error!==void 0?pe.error:S._data!==void 0?pe.success:pe.pending):(A=pe.pending,Object.defineProperty(R,"_tracked",{get:()=>!0}),S=R.then(M=>Object.defineProperty(R,"_data",{get:()=>M}),M=>Object.defineProperty(R,"_error",{get:()=>M})));if(A===pe.error&&S._error instanceof B.tH)throw lr;if(A===pe.error&&!v)throw S._error;if(A===pe.error)return y.createElement(H.Provider,{value:S,children:v});if(A===pe.success)return y.createElement(H.Provider,{value:S,children:s});throw S}}function jt(l){let{children:s}=l,v=rr(),R=typeof s=="function"?s(v):s;return React.createElement(React.Fragment,null,R)}function Ge(l,s){s===void 0&&(s=[]);let v=[];return y.Children.forEach(l,(R,S)=>{if(!y.isValidElement(R))return;let A=[...s,S];if(R.type===y.Fragment){v.push.apply(v,Ge(R.props.children,A));return}R.type!==Ut&&(0,B.Oi)(!1),!R.props.index||!R.props.children||(0,B.Oi)(!1);let M={id:R.props.id||A.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&&(M.children=Ge(R.props.children,A)),v.push(M)}),v}function sr(l){return Lt(l)}function Sr(l){let s={hasErrorBoundary:l.ErrorBoundary!=null||l.errorElement!=null};return l.Component&&Object.assign(s,{element:React.createElement(l.Component),Component:void 0}),l.HydrateFallback&&Object.assign(s,{hydrateFallbackElement:React.createElement(l.HydrateFallback),HydrateFallback:void 0}),l.ErrorBoundary&&Object.assign(s,{errorElement:React.createElement(l.ErrorBoundary),ErrorBoundary:void 0}),s}function Cr(l,s){return createRouter({basename:s==null?void 0:s.basename,future:Le({},s==null?void 0:s.future,{v7_prependBasename:!0}),history:createMemoryHistory({initialEntries:s==null?void 0:s.initialEntries,initialIndex:s==null?void 0:s.initialIndex}),hydrationData:s==null?void 0:s.hydrationData,routes:l,mapRouteProperties:Sr}).initialize()}},74808:function(Kr,Wt,tt){tt.d(Wt,{AO:function(){return Re},Gh:function(){return er},HS:function(){return Je},Oi:function(){return H},Rr:function(){return ie},o1:function(){return Fe},pX:function(){return at},pb:function(){return Ve},rc:function(){return y},sC:function(){return Le},tH:function(){return _t},tW:function(){return he},ue:function(){return Se},yD:function(){return qt}});/**
|
|
11
|
-
* @remix-run/router v1.15.1
|
|
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 z(){return z=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},z.apply(this,arguments)}var y;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(y||(y={}));const B="popstate";function Le(e){e===void 0&&(e={});let{initialEntries:t=["/"],initialIndex:r,v5Compat:n=!1}=e,a;a=t.map((x,C)=>m(x,typeof x=="string"?null:x.state,C===0?"default":void 0));let d=h(r==null?a.length-1:r),i=y.Pop,p=null;function h(x){return Math.min(Math.max(x,0),a.length-1)}function b(){return a[d]}function m(x,C,P){C===void 0&&(C=null);let w=be(a?b().pathname:"/",x,C,P);return se(w.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(x)),w}function _(x){return typeof x=="string"?x:Re(x)}return{get index(){return d},get action(){return i},get location(){return b()},createHref:_,createURL(x){return new URL(_(x),"http://localhost")},encodeLocation(x){let C=typeof x=="string"?ie(x):x;return{pathname:C.pathname||"",search:C.search||"",hash:C.hash||""}},push(x,C){i=y.Push;let P=m(x,C);d+=1,a.splice(d,a.length,P),n&&p&&p({action:i,location:P,delta:1})},replace(x,C){i=y.Replace;let P=m(x,C);a[d]=P,n&&p&&p({action:i,location:P,delta:0})},go(x){i=y.Pop;let C=h(d+x),P=a[C];d=C,p&&p({action:i,location:P,delta:x})},listen(x){return p=x,()=>{p=null}}}}function ft(e){e===void 0&&(e={});function t(n,a){let{pathname:d,search:i,hash:p}=n.location;return be("",{pathname:d,search:i,hash:p},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:Re(a)}return Te(t,r,null,e)}function $t(e){e===void 0&&(e={});function t(a,d){let{pathname:i="/",search:p="",hash:h=""}=ie(a.location.hash.substr(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),be("",{pathname:i,search:p,hash:h},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function r(a,d){let i=a.document.querySelector("base"),p="";if(i&&i.getAttribute("href")){let h=a.location.href,b=h.indexOf("#");p=b===-1?h:h.slice(0,b)}return p+"#"+(typeof d=="string"?d:Re(d))}function n(a,d){se(a.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(d)+")")}return Te(t,r,n,e)}function H(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function se(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch{}}}function We(){return Math.random().toString(36).substr(2,8)}function ge(e,t){return{usr:e.state,key:e.key,idx:t}}function be(e,t,r,n){return r===void 0&&(r=null),z({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ie(t):t,{state:r,key:t&&t.key||n||We()})}function Re(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 ie(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 Te(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:d=!1}=n,i=a.history,p=y.Pop,h=null,b=m();b==null&&(b=0,i.replaceState(z({},i.state,{idx:b}),""));function m(){return(i.state||{idx:null}).idx}function _(){p=y.Pop;let w=m(),g=w==null?null:w-b;b=w,h&&h({action:p,location:P.location,delta:g})}function E(w,g){p=y.Push;let F=be(P.location,w,g);r&&r(F,w),b=m()+1;let J=ge(F,b),Y=P.createHref(F);try{i.pushState(J,"",Y)}catch(G){if(G instanceof DOMException&&G.name==="DataCloneError")throw G;a.location.assign(Y)}d&&h&&h({action:p,location:P.location,delta:1})}function x(w,g){p=y.Replace;let F=be(P.location,w,g);r&&r(F,w),b=m();let J=ge(F,b),Y=P.createHref(F);i.replaceState(J,"",Y),d&&h&&h({action:p,location:P.location,delta:0})}function C(w){let g=a.location.origin!=="null"?a.location.origin:a.location.href,F=typeof w=="string"?w:Re(w);return F=F.replace(/ $/,"%20"),H(g,"No window.location.(origin|href) available to create URL for href: "+F),new URL(F,g)}let P={get action(){return p},get location(){return e(a,i)},listen(w){if(h)throw new Error("A history only accepts one active listener");return a.addEventListener(B,_),h=w,()=>{a.removeEventListener(B,_),h=null}},createHref(w){return t(a,w)},createURL:C,encodeLocation(w){let g=C(w);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:E,replace:x,go(w){return i.go(w)}};return P}var Z;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Z||(Z={}));const br=new Set(["lazy","caseSensitive","path","id","index","children"]);function Rr(e){return e.index===!0}function $e(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,d)=>{let i=[...r,d],p=typeof a.id=="string"?a.id:i.join("-");if(H(a.index!==!0||!a.children,"Cannot specify children on an index route"),H(!n[p],'Found a route id collision on id "'+p+`". Route id's must be globally unique within Data Router usages`),Rr(a)){let h=z({},a,t(a),{id:p});return n[p]=h,h}else{let h=z({},a,t(a),{id:p,children:void 0});return n[p]=h,a.children&&(h.children=$e(a.children,t,i,n)),h}})}function Se(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?ie(t):t,a=Ve(n.pathname||"/",r);if(a==null)return null;let d=ht(e);xt(d);let i=null;for(let p=0;i==null&&p<d.length;++p){let h=Me(a);i=rt(d[p],h)}return i}function Vt(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 ht(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(d,i,p)=>{let h={relativePath:p===void 0?d.path||"":p,caseSensitive:d.caseSensitive===!0,childrenIndex:i,route:d};h.relativePath.startsWith("/")&&(H(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 b=Je([n,h.relativePath]),m=r.concat(h);d.children&&d.children.length>0&&(H(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+b+'".')),ht(d.children,t,m,b)),!(d.path==null&&!d.index)&&t.push({path:b,score:Qt(b,d.index),routesMeta:m})};return e.forEach((d,i)=>{var p;if(d.path===""||!((p=d.path)!=null&&p.includes("?")))a(d,i);else for(let h of Jt(d.path))a(d,i,h)}),t}function Jt(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),d=r.replace(/\?$/,"");if(n.length===0)return a?[d,""]:[d];let i=Jt(n.join("/")),p=[];return p.push(...i.map(h=>h===""?d:[d,h].join("/"))),a&&p.push(...i),p.map(h=>e.startsWith("/")&&h===""?"/":h)}function xt(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Lt(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Yt=/^:[\w-]+$/,Dt=3,Pt=2,St=1,Gt=10,Xt=-2,Ct=e=>e==="*";function Qt(e,t){let r=e.split("/"),n=r.length;return r.some(Ct)&&(n+=Xt),t&&(n+=Pt),r.filter(a=>!Ct(a)).reduce((a,d)=>a+(Yt.test(d)?Dt:d===""?St:Gt),n)}function Lt(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 rt(e,t){let{routesMeta:r}=e,n={},a="/",d=[];for(let i=0;i<r.length;++i){let p=r[i],h=i===r.length-1,b=a==="/"?t:t.slice(a.length)||"/",m=Er({path:p.relativePath,caseSensitive:p.caseSensitive,end:h},b);if(!m)return null;Object.assign(n,m.params);let _=p.route;d.push({params:n,pathname:Je([a,m.pathname]),pathnameBase:tr(Je([a,m.pathnameBase])),route:_}),m.pathnameBase!=="/"&&(a=Je([a,m.pathnameBase]))}return d}function he(e,t){t===void 0&&(t={});let r=e;r.endsWith("*")&&r!=="*"&&!r.endsWith("/*")&&(se(!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=i=>i==null?"":typeof i=="string"?i:String(i),d=r.split(/\/+/).map((i,p,h)=>{if(p===h.length-1&&i==="*")return a(t["*"]);const m=i.match(/^:([\w-]+)(\??)$/);if(m){const[,_,E]=m;let x=t[_];return H(E==="?"||x!=null,'Missing ":'+_+'" param'),a(x)}return i.replace(/\?$/g,"")}).filter(i=>!!i);return n+d.join("/")}function Er(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=pt(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let d=a[0],i=d.replace(/(.)\/+$/,"$1"),p=a.slice(1);return{params:n.reduce((b,m,_)=>{let{paramName:E,isOptional:x}=m;if(E==="*"){let P=p[_]||"";i=d.slice(0,d.length-P.length).replace(/(.)\/+$/,"$1")}const C=p[_];return x&&!C?b[E]=void 0:b[E]=(C||"").replace(/%2F/g,"/"),b},{}),pathname:d,pathnameBase:i,pattern:e}}function pt(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),se(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,(i,p,h)=>(n.push({paramName:p,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 Me(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return se(!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 Ve(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 Fe(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?ie(e):e;return{pathname:r?r.startsWith("/")?r:wr(r,t):t,search:rr(n),hash:xr(a)}}function wr(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 Mt(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 Zt(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function qt(e,t){let r=Zt(e);return t?r.map((n,a)=>a===e.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function er(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=ie(e):(a=z({},e),H(!a.pathname||!a.pathname.includes("?"),Mt("?","pathname","search",a)),H(!a.pathname||!a.pathname.includes("#"),Mt("#","pathname","hash",a)),H(!a.search||!a.search.includes("#"),Mt("#","search","hash",a)));let d=e===""||a.pathname==="",i=d?"/":a.pathname,p;if(i==null)p=r;else{let _=t.length-1;if(!n&&i.startsWith("..")){let E=i.split("/");for(;E[0]==="..";)E.shift(),_-=1;a.pathname=E.join("/")}p=_>=0?t[_]:"/"}let h=Fe(a,p),b=i&&i!=="/"&&i.endsWith("/"),m=(d||i===".")&&r.endsWith("/");return!h.pathname.endsWith("/")&&(b||m)&&(h.pathname+="/"),h}function Wr(e){return e===""||e.pathname===""?"/":typeof e=="string"?ie(e).pathname:e.pathname}const Je=e=>e.join("/").replace(/\/\/+/g,"/"),tr=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),rr=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,xr=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Dr=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),z({},n,{headers:a}))};class _t extends Error{}class nr{constructor(t,r){this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],H(t&&typeof t=="object"&&!Array.isArray(t),"defer() only accepts plain objects");let n;this.abortPromise=new Promise((d,i)=>n=i),this.controller=new AbortController;let a=()=>n(new _t("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",a),this.controller.signal.addEventListener("abort",a),this.data=Object.entries(t).reduce((d,i)=>{let[p,h]=i;return Object.assign(d,{[p]:this.trackPromise(p,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 _t)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 d=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:()=>d}),this.emit(!1,r),Promise.reject(d)}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(d=>{t.removeEventListener("abort",n),(d||this.done)&&a(d)})})}return r}get done(){return this.pendingKeysSet.size===0}get unwrappedData(){return H(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]:ar(a)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function Ot(e){return e instanceof Promise&&e._tracked===!0}function ar(e){if(!Ot(e))return e;if(e._error)throw e._error;return e._data}const $r=function(t,r){r===void 0&&(r={});let n=typeof r=="number"?{status:r}:r;return new nr(t,n)},nt=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,z({},n,{headers:a}))},Vr=(e,t)=>{let r=nt(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class Tt{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 at(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const At=["post","put","patch","delete"],or=new Set(At),Ut=["get",...At],mt=new Set(Ut),ir=new Set([301,302,303,307,308]),Pr=new Set([307,308]),pe={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},lr={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ye={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},jt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ge=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),sr="remix-router-transitions";function Sr(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;H(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=u=>({hasErrorBoundary:o(u)})}else a=Ge;let d={},i=$e(e.routes,a,void 0,d),p,h=e.basename||"/",b=z({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),m=null,_=new Set,E=null,x=null,C=null,P=e.hydrationData!=null,w=Se(i,e.history.location,h),g=null;if(w==null){let o=oe(404,{pathname:e.history.location.pathname}),{matches:u,route:f}=Ft(i);w=u,g={[f.id]:o}}let F,J=w.some(o=>o.route.lazy),Y=w.some(o=>o.route.loader);if(J)F=!1;else if(!Y)F=!0;else if(b.v7_partialHydration){let o=e.hydrationData?e.hydrationData.loaderData:null,u=e.hydrationData?e.hydrationData.errors:null;F=w.every(f=>f.route.loader&&f.route.loader.hydrate!==!0&&(o&&o[f.route.id]!==void 0||u&&u[f.route.id]!==void 0))}else F=e.hydrationData!=null;let G,c={historyAction:e.history.action,location:e.history.location,matches:w,initialized:F,navigation:pe,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||g,fetchers:new Map,blockers:new Map},Q=y.Pop,V=!1,ee,_e=!1,De=new Map,Ce=null,it=!1,Xe=!1,It=[],Nt=[],le=new Map,Bt=0,yt=-1,lt=new Map,Ue=new Set,st=new Map,bt=new Map,je=new Set,Qe=new Map,Ze=new Map,fr=!1;function tn(){if(m=e.history.listen(o=>{let{action:u,location:f,delta:D}=o;if(fr){fr=!1;return}se(Ze.size===0||D!=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 L=Hr({currentLocation:c.location,nextLocation:f,historyAction:u});if(L&&D!=null){fr=!0,e.history.go(D*-1),kt(L,{state:"blocked",location:f,proceed(){kt(L,{state:"proceeding",proceed:void 0,reset:void 0,location:f}),e.history.go(D)},reset(){let N=new Map(c.blockers);N.set(L,Ye),ye({blockers:N})}});return}return qe(u,f)}),r){qr(t,De);let o=()=>en(t,De);t.addEventListener("pagehide",o),Ce=()=>t.removeEventListener("pagehide",o)}return c.initialized||qe(y.Pop,c.location,{initialHydration:!0}),G}function rn(){m&&m(),Ce&&Ce(),_.clear(),ee&&ee.abort(),c.fetchers.forEach((o,u)=>Ht(u)),c.blockers.forEach((o,u)=>Br(u))}function nn(o){return _.add(o),()=>_.delete(o)}function ye(o,u){u===void 0&&(u={}),c=z({},c,o);let f=[],D=[];b.v7_fetcherPersist&&c.fetchers.forEach((L,N)=>{L.state==="idle"&&(je.has(N)?D.push(N):f.push(N))}),[..._].forEach(L=>L(c,{deletedFetchers:D,unstable_viewTransitionOpts:u.viewTransitionOpts,unstable_flushSync:u.flushSync===!0})),b.v7_fetcherPersist&&(f.forEach(L=>c.fetchers.delete(L)),D.forEach(L=>Ht(L)))}function Rt(o,u,f){var D,L;let{flushSync:N}=f===void 0?{}:f,j=c.actionData!=null&&c.navigation.formMethod!=null&&xe(c.navigation.formMethod)&&c.navigation.state==="loading"&&((D=o.state)==null?void 0:D._isRedirect)!==!0,U;u.actionData?Object.keys(u.actionData).length>0?U=u.actionData:U=null:j?U=c.actionData:U=null;let O=u.loaderData?ue(c.loaderData,u.loaderData,u.matches||[],u.errors):c.loaderData,W=c.blockers;W.size>0&&(W=new Map(W),W.forEach((re,fe)=>W.set(fe,Ye)));let de=V===!0||c.navigation.formMethod!=null&&xe(c.navigation.formMethod)&&((L=o.state)==null?void 0:L._isRedirect)!==!0;p&&(i=p,p=void 0),it||Q===y.Pop||(Q===y.Push?e.history.push(o,o.state):Q===y.Replace&&e.history.replace(o,o.state));let I;if(Q===y.Pop){let re=De.get(c.location.pathname);re&&re.has(o.pathname)?I={currentLocation:c.location,nextLocation:o}:De.has(o.pathname)&&(I={currentLocation:o,nextLocation:c.location})}else if(_e){let re=De.get(c.location.pathname);re?re.add(o.pathname):(re=new Set([o.pathname]),De.set(c.location.pathname,re)),I={currentLocation:c.location,nextLocation:o}}ye(z({},u,{actionData:U,loaderData:O,historyAction:Q,location:o,initialized:!0,navigation:pe,revalidation:"idle",restoreScrollPosition:zr(o,u.matches||c.matches),preventScrollReset:de,blockers:W}),{viewTransitionOpts:I,flushSync:N===!0}),Q=y.Pop,V=!1,_e=!1,it=!1,Xe=!1,It=[],Nt=[]}async function Ar(o,u){if(typeof o=="number"){e.history.go(o);return}let f=S(c.location,c.matches,h,b.v7_prependBasename,o,b.v7_relativeSplatPath,u==null?void 0:u.fromRouteId,u==null?void 0:u.relative),{path:D,submission:L,error:N}=A(b.v7_normalizeFormMethod,!1,f,u),j=c.location,U=be(c.location,D,u&&u.state);U=z({},U,e.history.encodeLocation(U));let O=u&&u.replace!=null?u.replace:void 0,W=y.Push;O===!0?W=y.Replace:O===!1||L!=null&&xe(L.formMethod)&&L.formAction===c.location.pathname+c.location.search&&(W=y.Replace);let de=u&&"preventScrollReset"in u?u.preventScrollReset===!0:void 0,I=(u&&u.unstable_flushSync)===!0,re=Hr({currentLocation:j,nextLocation:U,historyAction:W});if(re){kt(re,{state:"blocked",location:U,proceed(){kt(re,{state:"proceeding",proceed:void 0,reset:void 0,location:U}),Ar(o,u)},reset(){let fe=new Map(c.blockers);fe.set(re,Ye),ye({blockers:fe})}});return}return await qe(W,U,{submission:L,pendingError:N,preventScrollReset:de,replace:u&&u.replace,enableViewTransition:u&&u.unstable_viewTransition,flushSync:I})}function an(){if(hr(),ye({revalidation:"loading"}),c.navigation.state!=="submitting"){if(c.navigation.state==="idle"){qe(c.historyAction,c.location,{startUninterruptedRevalidation:!0});return}qe(Q||c.historyAction,c.navigation.location,{overrideNavigation:c.navigation})}}async function qe(o,u,f){ee&&ee.abort(),ee=null,Q=o,it=(f&&f.startUninterruptedRevalidation)===!0,pn(c.location,c.matches),V=(f&&f.preventScrollReset)===!0,_e=(f&&f.enableViewTransition)===!0;let D=p||i,L=f&&f.overrideNavigation,N=Se(D,u,h),j=(f&&f.flushSync)===!0;if(!N){let fe=oe(404,{pathname:u.pathname}),{matches:Pe,route:ce}=Ft(D);pr(),Rt(u,{matches:Pe,loaderData:{},errors:{[ce.id]:fe}},{flushSync:j});return}if(c.initialized&&!Xe&&Jr(c.location,u)&&!(f&&f.submission&&xe(f.submission.formMethod))){Rt(u,{matches:N},{flushSync:j});return}ee=new AbortController;let U=ne(e.history,u,ee.signal,f&&f.submission),O,W;if(f&&f.pendingError)W={[ve(N).route.id]:f.pendingError};else if(f&&f.submission&&xe(f.submission.formMethod)){let fe=await on(U,u,f.submission,N,{replace:f.replace,flushSync:j});if(fe.shortCircuited)return;O=fe.pendingActionData,W=fe.pendingActionError,L=cr(u,f.submission),j=!1,U=new Request(U.url,{signal:U.signal})}let{shortCircuited:de,loaderData:I,errors:re}=await ln(U,u,N,L,f&&f.submission,f&&f.fetcherSubmission,f&&f.replace,f&&f.initialHydration===!0,j,O,W);de||(ee=null,Rt(u,z({matches:N},O?{actionData:O}:{},{loaderData:I,errors:re})))}async function on(o,u,f,D,L){L===void 0&&(L={}),hr();let N=Qr(u,f);ye({navigation:N},{flushSync:L.flushSync===!0});let j,U=vt(D,u);if(!U.route.action&&!U.route.lazy)j={type:Z.error,error:oe(405,{method:o.method,pathname:u.pathname,routeId:U.route.id})};else if(j=await X("action",o,U,D,d,a,h,b.v7_relativeSplatPath),o.signal.aborted)return{shortCircuited:!0};if(Be(j)){let O;return L&&L.replace!=null?O=L.replace:O=j.location===c.location.pathname+c.location.search,await Et(c,j,{submission:f,replace:O}),{shortCircuited:!0}}if(Ne(j)){let O=ve(D,U.route.id);return(L&&L.replace)!==!0&&(Q=y.Push),{pendingActionData:{},pendingActionError:{[O.route.id]:j.error}}}if(Ie(j))throw oe(400,{type:"defer-action"});return{pendingActionData:{[U.route.id]:j.data}}}async function ln(o,u,f,D,L,N,j,U,O,W,de){let I=D||cr(u,L),re=L||N||Tr(I),fe=p||i,[Pe,ce]=K(e.history,c,f,re,u,b.v7_partialHydration&&U===!0,Xe,It,Nt,je,st,Ue,fe,h,W,de);if(pr(te=>!(f&&f.some(ae=>ae.route.id===te))||Pe&&Pe.some(ae=>ae.route.id===te)),yt=++Bt,Pe.length===0&&ce.length===0){let te=Ir();return Rt(u,z({matches:f,loaderData:{},errors:de||null},W?{actionData:W}:{},te?{fetchers:new Map(c.fetchers)}:{}),{flushSync:O}),{shortCircuited:!0}}if(!it&&(!b.v7_partialHydration||!U)){ce.forEach(ae=>{let Oe=c.fetchers.get(ae.key),Kt=gt(void 0,Oe?Oe.data:void 0);c.fetchers.set(ae.key,Kt)});let te=W||c.actionData;ye(z({navigation:I},te?Object.keys(te).length===0?{actionData:null}:{actionData:te}:{},ce.length>0?{fetchers:new Map(c.fetchers)}:{}),{flushSync:O})}ce.forEach(te=>{le.has(te.key)&&ze(te.key),te.controller&&le.set(te.key,te.controller)});let ut=()=>ce.forEach(te=>ze(te.key));ee&&ee.signal.addEventListener("abort",ut);let{results:mr,loaderResults:dt,fetcherResults:Ke}=await Ur(c.matches,f,Pe,ce,o);if(o.signal.aborted)return{shortCircuited:!0};ee&&ee.signal.removeEventListener("abort",ut),ce.forEach(te=>le.delete(te.key));let et=Lr(mr);if(et){if(et.idx>=Pe.length){let te=ce[et.idx-Pe.length].key;Ue.add(te)}return await Et(c,et.result,{replace:j}),{shortCircuited:!0}}let{loaderData:vr,errors:gr}=Ae(c,f,Pe,dt,de,ce,Ke,Qe);Qe.forEach((te,ae)=>{te.subscribe(Oe=>{(Oe||te.done)&&Qe.delete(ae)})});let yr=Ir(),ct=Nr(yt),zt=yr||ct||ce.length>0;return z({loaderData:vr,errors:gr},zt?{fetchers:new Map(c.fetchers)}:{})}function sn(o,u,f,D){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.");le.has(o)&&ze(o);let L=(D&&D.unstable_flushSync)===!0,N=p||i,j=S(c.location,c.matches,h,b.v7_prependBasename,f,b.v7_relativeSplatPath,u,D==null?void 0:D.relative),U=Se(N,j,h);if(!U){wt(o,u,oe(404,{pathname:j}),{flushSync:L});return}let{path:O,submission:W,error:de}=A(b.v7_normalizeFormMethod,!0,j,D);if(de){wt(o,u,de,{flushSync:L});return}let I=vt(U,O);if(V=(D&&D.preventScrollReset)===!0,W&&xe(W.formMethod)){un(o,u,O,I,U,L,W);return}st.set(o,{routeId:u,path:O}),dn(o,u,O,I,U,L,W)}async function un(o,u,f,D,L,N,j){if(hr(),st.delete(o),!D.route.action&&!D.route.lazy){let ae=oe(405,{method:j.formMethod,pathname:f,routeId:u});wt(o,u,ae,{flushSync:N});return}let U=c.fetchers.get(o);ke(o,Zr(j,U),{flushSync:N});let O=new AbortController,W=ne(e.history,f,O.signal,j);le.set(o,O);let de=Bt,I=await X("action",W,D,L,d,a,h,b.v7_relativeSplatPath);if(W.signal.aborted){le.get(o)===O&&le.delete(o);return}if(b.v7_fetcherPersist&&je.has(o)){if(Be(I)||Ne(I)){ke(o,He(void 0));return}}else{if(Be(I))if(le.delete(o),yt>de){ke(o,He(void 0));return}else return Ue.add(o),ke(o,gt(j)),Et(c,I,{fetcherSubmission:j});if(Ne(I)){wt(o,u,I.error);return}}if(Ie(I))throw oe(400,{type:"defer-action"});let re=c.navigation.location||c.location,fe=ne(e.history,re,O.signal),Pe=p||i,ce=c.navigation.state!=="idle"?Se(Pe,c.navigation.location,h):c.matches;H(ce,"Didn't find any matches after fetcher action");let ut=++Bt;lt.set(o,ut);let mr=gt(j,I.data);c.fetchers.set(o,mr);let[dt,Ke]=K(e.history,c,ce,j,re,!1,Xe,It,Nt,je,st,Ue,Pe,h,{[D.route.id]:I.data},void 0);Ke.filter(ae=>ae.key!==o).forEach(ae=>{let Oe=ae.key,Kt=c.fetchers.get(Oe),vn=gt(void 0,Kt?Kt.data:void 0);c.fetchers.set(Oe,vn),le.has(Oe)&&ze(Oe),ae.controller&&le.set(Oe,ae.controller)}),ye({fetchers:new Map(c.fetchers)});let et=()=>Ke.forEach(ae=>ze(ae.key));O.signal.addEventListener("abort",et);let{results:vr,loaderResults:gr,fetcherResults:yr}=await Ur(c.matches,ce,dt,Ke,fe);if(O.signal.aborted)return;O.signal.removeEventListener("abort",et),lt.delete(o),le.delete(o),Ke.forEach(ae=>le.delete(ae.key));let ct=Lr(vr);if(ct){if(ct.idx>=dt.length){let ae=Ke[ct.idx-dt.length].key;Ue.add(ae)}return Et(c,ct.result)}let{loaderData:zt,errors:te}=Ae(c,c.matches,dt,gr,void 0,Ke,yr,Qe);if(c.fetchers.has(o)){let ae=He(I.data);c.fetchers.set(o,ae)}Nr(ut),c.navigation.state==="loading"&&ut>yt?(H(Q,"Expected pending action"),ee&&ee.abort(),Rt(c.navigation.location,{matches:ce,loaderData:zt,errors:te,fetchers:new Map(c.fetchers)})):(ye({errors:te,loaderData:ue(c.loaderData,zt,ce,te),fetchers:new Map(c.fetchers)}),Xe=!1)}async function dn(o,u,f,D,L,N,j){let U=c.fetchers.get(o);ke(o,gt(j,U?U.data:void 0),{flushSync:N});let O=new AbortController,W=ne(e.history,f,O.signal);le.set(o,O);let de=Bt,I=await X("loader",W,D,L,d,a,h,b.v7_relativeSplatPath);if(Ie(I)&&(I=await Or(I,W.signal,!0)||I),le.get(o)===O&&le.delete(o),!W.signal.aborted){if(je.has(o)){ke(o,He(void 0));return}if(Be(I))if(yt>de){ke(o,He(void 0));return}else{Ue.add(o),await Et(c,I);return}if(Ne(I)){wt(o,u,I.error);return}H(!Ie(I),"Unhandled fetcher deferred data"),ke(o,He(I.data))}}async function Et(o,u,f){let{submission:D,fetcherSubmission:L,replace:N}=f===void 0?{}:f;u.revalidate&&(Xe=!0);let j=be(o.location,u.location,{_isRedirect:!0});if(H(j,"Expected a location on the redirect navigation"),r){let re=!1;if(u.reloadDocument)re=!0;else if(jt.test(u.location)){const fe=e.history.createURL(u.location);re=fe.origin!==t.location.origin||Ve(fe.pathname,h)==null}if(re){N?t.location.replace(u.location):t.location.assign(u.location);return}}ee=null;let U=N===!0?y.Replace:y.Push,{formMethod:O,formAction:W,formEncType:de}=o.navigation;!D&&!L&&O&&W&&de&&(D=Tr(o.navigation));let I=D||L;if(Pr.has(u.status)&&I&&xe(I.formMethod))await qe(U,j,{submission:z({},I,{formAction:u.location}),preventScrollReset:V});else{let re=cr(j,D);await qe(U,j,{overrideNavigation:re,fetcherSubmission:L,preventScrollReset:V})}}async function Ur(o,u,f,D,L){let N=await Promise.all([...f.map(O=>X("loader",L,O,u,d,a,h,b.v7_relativeSplatPath)),...D.map(O=>O.matches&&O.match&&O.controller?X("loader",ne(e.history,O.path,O.controller.signal),O.match,O.matches,d,a,h,b.v7_relativeSplatPath):{type:Z.error,error:oe(404,{pathname:O.path})})]),j=N.slice(0,f.length),U=N.slice(f.length);return await Promise.all([_r(o,f,j,j.map(()=>L.signal),!1,c.loaderData),_r(o,D.map(O=>O.match),U,D.map(O=>O.controller?O.controller.signal:null),!0)]),{results:N,loaderResults:j,fetcherResults:U}}function hr(){Xe=!0,It.push(...pr()),st.forEach((o,u)=>{le.has(u)&&(Nt.push(u),ze(u))})}function ke(o,u,f){f===void 0&&(f={}),c.fetchers.set(o,u),ye({fetchers:new Map(c.fetchers)},{flushSync:(f&&f.flushSync)===!0})}function wt(o,u,f,D){D===void 0&&(D={});let L=ve(c.matches,u);Ht(o),ye({errors:{[L.route.id]:f},fetchers:new Map(c.fetchers)},{flushSync:(D&&D.flushSync)===!0})}function jr(o){return b.v7_fetcherPersist&&(bt.set(o,(bt.get(o)||0)+1),je.has(o)&&je.delete(o)),c.fetchers.get(o)||lr}function Ht(o){let u=c.fetchers.get(o);le.has(o)&&!(u&&u.state==="loading"&<.has(o))&&ze(o),st.delete(o),lt.delete(o),Ue.delete(o),je.delete(o),c.fetchers.delete(o)}function cn(o){if(b.v7_fetcherPersist){let u=(bt.get(o)||0)-1;u<=0?(bt.delete(o),je.add(o)):bt.set(o,u)}else Ht(o);ye({fetchers:new Map(c.fetchers)})}function ze(o){let u=le.get(o);H(u,"Expected fetch controller: "+o),u.abort(),le.delete(o)}function Fr(o){for(let u of o){let f=jr(u),D=He(f.data);c.fetchers.set(u,D)}}function Ir(){let o=[],u=!1;for(let f of Ue){let D=c.fetchers.get(f);H(D,"Expected fetcher: "+f),D.state==="loading"&&(Ue.delete(f),o.push(f),u=!0)}return Fr(o),u}function Nr(o){let u=[];for(let[f,D]of lt)if(D<o){let L=c.fetchers.get(f);H(L,"Expected fetcher: "+f),L.state==="loading"&&(ze(f),lt.delete(f),u.push(f))}return Fr(u),u.length>0}function fn(o,u){let f=c.blockers.get(o)||Ye;return Ze.get(o)!==u&&Ze.set(o,u),f}function Br(o){c.blockers.delete(o),Ze.delete(o)}function kt(o,u){let f=c.blockers.get(o)||Ye;H(f.state==="unblocked"&&u.state==="blocked"||f.state==="blocked"&&u.state==="blocked"||f.state==="blocked"&&u.state==="proceeding"||f.state==="blocked"&&u.state==="unblocked"||f.state==="proceeding"&&u.state==="unblocked","Invalid blocker state transition: "+f.state+" -> "+u.state);let D=new Map(c.blockers);D.set(o,u),ye({blockers:D})}function Hr(o){let{currentLocation:u,nextLocation:f,historyAction:D}=o;if(Ze.size===0)return;Ze.size>1&&se(!1,"A router only supports one blocker at a time");let L=Array.from(Ze.entries()),[N,j]=L[L.length-1],U=c.blockers.get(N);if(!(U&&U.state==="proceeding")&&j({currentLocation:u,nextLocation:f,historyAction:D}))return N}function pr(o){let u=[];return Qe.forEach((f,D)=>{(!o||o(D))&&(f.cancel(),u.push(D),Qe.delete(D))}),u}function hn(o,u,f){if(E=o,C=u,x=f||null,!P&&c.navigation===pe){P=!0;let D=zr(c.location,c.matches);D!=null&&ye({restoreScrollPosition:D})}return()=>{E=null,C=null,x=null}}function kr(o,u){return x&&x(o,u.map(D=>Vt(D,c.loaderData)))||o.key}function pn(o,u){if(E&&C){let f=kr(o,u);E[f]=C()}}function zr(o,u){if(E){let f=kr(o,u),D=E[f];if(typeof D=="number")return D}return null}function mn(o){d={},p=$e(o,a,void 0,d)}return G={get basename(){return h},get future(){return b},get state(){return c},get routes(){return i},get window(){return t},initialize:tn,subscribe:nn,enableScrollRestoration:hn,navigate:Ar,fetch:sn,revalidate:an,createHref:o=>e.history.createHref(o),encodeLocation:o=>e.history.encodeLocation(o),getFetcher:jr,deleteFetcher:cn,dispose:rn,getBlocker:fn,deleteBlocker:Br,_internalFetchControllers:le,_internalActiveDeferreds:Qe,_internalSetRoutes:mn},G}const Cr=Symbol("deferred");function l(e,t){H(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 E=t.detectErrorBoundary;a=x=>({hasErrorBoundary:E(x)})}else a=Ge;let d=z({v7_relativeSplatPath:!1,v7_throwAbortReason:!1},t?t.future:null),i=$e(e,a,void 0,r);async function p(E,x){let{requestContext:C}=x===void 0?{}:x,P=new URL(E.url),w=E.method,g=be("",Re(P),null,"default"),F=Se(i,g,n);if(!ur(w)&&w!=="HEAD"){let Y=oe(405,{method:w}),{matches:G,route:c}=Ft(i);return{basename:n,location:g,matches:G,loaderData:{},actionData:null,errors:{[c.id]:Y},statusCode:Y.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}else if(!F){let Y=oe(404,{pathname:g.pathname}),{matches:G,route:c}=Ft(i);return{basename:n,location:g,matches:G,loaderData:{},actionData:null,errors:{[c.id]:Y},statusCode:Y.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let J=await b(E,g,F,C);return ot(J)?J:z({location:g,basename:n},J)}async function h(E,x){let{routeId:C,requestContext:P}=x===void 0?{}:x,w=new URL(E.url),g=E.method,F=be("",Re(w),null,"default"),J=Se(i,F,n);if(!ur(g)&&g!=="HEAD"&&g!=="OPTIONS")throw oe(405,{method:g});if(!J)throw oe(404,{pathname:F.pathname});let Y=C?J.find(V=>V.route.id===C):vt(J,F);if(C&&!Y)throw oe(403,{pathname:F.pathname,routeId:C});if(!Y)throw oe(404,{pathname:F.pathname});let G=await b(E,F,J,P,Y);if(ot(G))return G;let c=G.errors?Object.values(G.errors)[0]:void 0;if(c!==void 0)throw c;if(G.actionData)return Object.values(G.actionData)[0];if(G.loaderData){var Q;let V=Object.values(G.loaderData)[0];return(Q=G.activeDeferreds)!=null&&Q[Y.route.id]&&(V[Cr]=G.activeDeferreds[Y.route.id]),V}}async function b(E,x,C,P,w){H(E.signal,"query()/queryRoute() requests must contain an AbortController signal");try{if(xe(E.method.toLowerCase()))return await m(E,C,w||vt(C,x),P,w!=null);let g=await _(E,C,P,w);return ot(g)?g:z({},g,{actionData:null,actionHeaders:{}})}catch(g){if(Xr(g)){if(g.type===Z.error)throw g.response;return g.response}if(Gr(g))return g;throw g}}async function m(E,x,C,P,w){let g;if(!C.route.action&&!C.route.lazy){let Y=oe(405,{method:E.method,pathname:new URL(E.url).pathname,routeId:C.route.id});if(w)throw Y;g={type:Z.error,error:Y}}else g=await X("action",E,C,x,r,a,n,d.v7_relativeSplatPath,{isStaticRequest:!0,isRouteRequest:w,requestContext:P}),E.signal.aborted&&v(E,w,d);if(Be(g))throw new Response(null,{status:g.status,headers:{Location:g.location}});if(Ie(g)){let Y=oe(400,{type:"defer-action"});if(w)throw Y;g={type:Z.error,error:Y}}if(w){if(Ne(g))throw g.error;return{matches:[C],loaderData:{},actionData:{[C.route.id]:g.data},errors:null,statusCode:200,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}if(Ne(g)){let Y=ve(x,C.route.id),G=await _(E,x,P,void 0,{[Y.route.id]:g.error});return z({},G,{statusCode:at(g.error)?g.error.status:500,actionData:null,actionHeaders:z({},g.headers?{[C.route.id]:g.headers}:{})})}let F=new Request(E.url,{headers:E.headers,redirect:E.redirect,signal:E.signal}),J=await _(F,x,P);return z({},J,g.statusCode?{statusCode:g.statusCode}:{},{actionData:{[C.route.id]:g.data},actionHeaders:z({},g.headers?{[C.route.id]:g.headers}:{})})}async function _(E,x,C,P,w){let g=P!=null;if(g&&!(P!=null&&P.route.loader)&&!(P!=null&&P.route.lazy))throw oe(400,{method:E.method,pathname:new URL(E.url).pathname,routeId:P==null?void 0:P.route.id});let J=(P?[P]:M(x,Object.keys(w||{})[0])).filter(V=>V.route.loader||V.route.lazy);if(J.length===0)return{matches:x,loaderData:x.reduce((V,ee)=>Object.assign(V,{[ee.route.id]:null}),{}),errors:w||null,statusCode:200,loaderHeaders:{},activeDeferreds:null};let Y=await Promise.all([...J.map(V=>X("loader",E,V,x,r,a,n,d.v7_relativeSplatPath,{isStaticRequest:!0,isRouteRequest:g,requestContext:C}))]);E.signal.aborted&&v(E,g,d);let G=new Map,c=we(x,J,Y,w,G),Q=new Set(J.map(V=>V.route.id));return x.forEach(V=>{Q.has(V.route.id)||(c.loaderData[V.route.id]=null)}),z({},c,{matches:x,activeDeferreds:G.size>0?Object.fromEntries(G.entries()):null})}return{dataRoutes:i,query:p,queryRoute:h}}function s(e,t,r){return z({},t,{statusCode:at(r)?r.status:500,errors:{[t._deepestRenderedBoundaryId||e[0].id]:r}})}function v(e,t,r){if(r.v7_throwAbortReason&&e.signal.reason!==void 0)throw e.signal.reason;let n=t?"queryRoute":"query";throw new Error(n+"() call aborted: "+e.method+" "+e.url)}function R(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function S(e,t,r,n,a,d,i,p){let h,b;if(i){h=[];for(let _ of t)if(h.push(_),_.route.id===i){b=_;break}}else h=t,b=t[t.length-1];let m=er(a||".",qt(h,d),Ve(e.pathname,r)||e.pathname,p==="path");return a==null&&(m.search=e.search,m.hash=e.hash),(a==null||a===""||a===".")&&b&&b.route.index&&!dr(m.search)&&(m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(m.pathname=m.pathname==="/"?r:Je([r,m.pathname])),Re(m)}function A(e,t,r,n){if(!n||!R(n))return{path:r};if(n.formMethod&&!ur(n.formMethod))return{path:r,error:oe(405,{method:n.formMethod})};let a=()=>({path:r,error:oe(400,{type:"invalid-body"})}),d=n.formMethod||"get",i=e?d.toUpperCase():d.toLowerCase(),p=Mr(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!xe(i))return a();let E=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((x,C)=>{let[P,w]=C;return""+x+P+"="+w+`
|
|
20
|
-
`},""):String(n.body);return{path:r,submission:{formMethod:i,formAction:p,formEncType:n.formEncType,formData:void 0,json:void 0,text:E}}}else if(n.formEncType==="application/json"){if(!xe(i))return a();try{let E=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:i,formAction:p,formEncType:n.formEncType,formData:void 0,json:E,text:void 0}}}catch{return a()}}}H(typeof FormData=="function","FormData is not available in this environment");let h,b;if(n.formData)h=me(n.formData),b=n.formData;else if(n.body instanceof FormData)h=me(n.body),b=n.body;else if(n.body instanceof URLSearchParams)h=n.body,b=Ee(h);else if(n.body==null)h=new URLSearchParams,b=new FormData;else try{h=new URLSearchParams(n.body),b=Ee(h)}catch{return a()}let m={formMethod:i,formAction:p,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:b,json:void 0,text:void 0};if(xe(m.formMethod))return{path:r,submission:m};let _=ie(r);return t&&_.search&&dr(_.search)&&h.append("index",""),_.search="?"+h,{path:Re(_),submission:m}}function M(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 K(e,t,r,n,a,d,i,p,h,b,m,_,E,x,C,P){let w=P?Object.values(P)[0]:C?Object.values(C)[0]:void 0,g=e.createURL(t.location),F=e.createURL(a),J=P?Object.keys(P)[0]:void 0,G=M(r,J).filter((Q,V)=>{let{route:ee}=Q;if(ee.lazy)return!0;if(ee.loader==null)return!1;if(d)return ee.loader.hydrate?!0:t.loaderData[ee.id]===void 0&&(!t.errors||t.errors[ee.id]===void 0);if(q(t.loaderData,t.matches[V],Q)||p.some(Ce=>Ce===Q.route.id))return!0;let _e=t.matches[V],De=Q;return $(Q,z({currentUrl:g,currentParams:_e.params,nextUrl:F,nextParams:De.params},n,{actionResult:w,defaultShouldRevalidate:i||g.pathname+g.search===F.pathname+F.search||g.search!==F.search||k(_e,De)}))}),c=[];return m.forEach((Q,V)=>{if(d||!r.some(it=>it.route.id===Q.routeId)||b.has(V))return;let ee=Se(E,Q.path,x);if(!ee){c.push({key:V,routeId:Q.routeId,path:Q.path,matches:null,match:null,controller:null});return}let _e=t.fetchers.get(V),De=vt(ee,Q.path),Ce=!1;_.has(V)?Ce=!1:h.includes(V)?Ce=!0:_e&&_e.state!=="idle"&&_e.data===void 0?Ce=i:Ce=$(De,z({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:F,nextParams:r[r.length-1].params},n,{actionResult:w,defaultShouldRevalidate:i})),Ce&&c.push({key:V,routeId:Q.routeId,path:Q.path,matches:ee,match:De,controller:new AbortController})}),[G,c]}function q(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function k(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 T(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];H(a,"No route found in manifest");let d={};for(let i in n){let h=a[i]!==void 0&&i!=="hasErrorBoundary";se(!h,'Route "'+a.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+i+'" will be ignored.')),!h&&!br.has(i)&&(d[i]=n[i])}Object.assign(a,d),Object.assign(a,z({},t(a),{lazy:void 0}))}async function X(e,t,r,n,a,d,i,p,h){h===void 0&&(h={});let b,m,_,E=P=>{let w,g=new Promise((F,J)=>w=J);return _=()=>w(),t.signal.addEventListener("abort",_),Promise.race([P({request:t,params:r.params,context:h.requestContext}),g])};try{let P=r.route[e];if(r.route.lazy)if(P){let w,g=await Promise.all([E(P).catch(F=>{w=F}),T(r.route,d,a)]);if(w)throw w;m=g[0]}else if(await T(r.route,d,a),P=r.route[e],P)m=await E(P);else if(e==="action"){let w=new URL(t.url),g=w.pathname+w.search;throw oe(405,{method:t.method,pathname:g,routeId:r.route.id})}else return{type:Z.data,data:void 0};else if(P)m=await E(P);else{let w=new URL(t.url),g=w.pathname+w.search;throw oe(404,{pathname:g})}H(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(P){b=Z.error,m=P}finally{_&&t.signal.removeEventListener("abort",_)}if(ot(m)){let P=m.status;if(ir.has(P)){let g=m.headers.get("Location");if(H(g,"Redirects returned/thrown from loaders/actions must have a Location header"),!jt.test(g))g=S(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,g,p);else if(!h.isStaticRequest){let F=new URL(t.url),J=g.startsWith("//")?new URL(F.protocol+g):new URL(g),Y=Ve(J.pathname,i)!=null;J.origin===F.origin&&Y&&(g=J.pathname+J.search+J.hash)}if(h.isStaticRequest)throw m.headers.set("Location",g),m;return{type:Z.redirect,status:P,location:g,revalidate:m.headers.get("X-Remix-Revalidate")!==null,reloadDocument:m.headers.get("X-Remix-Reload-Document")!==null}}if(h.isRouteRequest)throw{type:b===Z.error?Z.error:Z.data,response:m};let w;try{let g=m.headers.get("Content-Type");g&&/\bapplication\/json\b/.test(g)?m.body==null?w=null:w=await m.json():w=await m.text()}catch(g){return{type:Z.error,error:g}}return b===Z.error?{type:b,error:new Tt(P,m.statusText,w),headers:m.headers}:{type:Z.data,data:w,statusCode:m.status,headers:m.headers}}if(b===Z.error)return{type:b,error:m};if(Yr(m)){var x,C;return{type:Z.deferred,deferredData:m,statusCode:(x=m.init)==null?void 0:x.status,headers:((C=m.init)==null?void 0:C.headers)&&new Headers(m.init.headers)}}return{type:Z.data,data:m}}function ne(e,t,r,n){let a=e.createURL(Mr(t)).toString(),d={signal:r};if(n&&xe(n.formMethod)){let{formMethod:i,formEncType:p}=n;d.method=i.toUpperCase(),p==="application/json"?(d.headers=new Headers({"Content-Type":p}),d.body=JSON.stringify(n.json)):p==="text/plain"?d.body=n.text:p==="application/x-www-form-urlencoded"&&n.formData?d.body=me(n.formData):d.body=n.formData}return new Request(a,d)}function me(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function Ee(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function we(e,t,r,n,a){let d={},i=null,p,h=!1,b={};return r.forEach((m,_)=>{let E=t[_].route.id;if(H(!Be(m),"Cannot handle redirect results in processLoaderData"),Ne(m)){let x=ve(e,E),C=m.error;n&&(C=Object.values(n)[0],n=void 0),i=i||{},i[x.route.id]==null&&(i[x.route.id]=C),d[E]=void 0,h||(h=!0,p=at(m.error)?m.error.status:500),m.headers&&(b[E]=m.headers)}else Ie(m)?(a.set(E,m.deferredData),d[E]=m.deferredData.data):d[E]=m.data,m.statusCode!=null&&m.statusCode!==200&&!h&&(p=m.statusCode),m.headers&&(b[E]=m.headers)}),n&&(i=n,d[Object.keys(n)[0]]=void 0),{loaderData:d,errors:i,statusCode:p||200,loaderHeaders:b}}function Ae(e,t,r,n,a,d,i,p){let{loaderData:h,errors:b}=we(t,r,n,a,p);for(let m=0;m<d.length;m++){let{key:_,match:E,controller:x}=d[m];H(i!==void 0&&i[m]!==void 0,"Did not find corresponding fetcher result");let C=i[m];if(!(x&&x.signal.aborted))if(Ne(C)){let P=ve(e.matches,E==null?void 0:E.route.id);b&&b[P.route.id]||(b=z({},b,{[P.route.id]:C.error})),e.fetchers.delete(_)}else if(Be(C))H(!1,"Unhandled fetcher revalidation redirect");else if(Ie(C))H(!1,"Unhandled fetcher deferred data");else{let P=He(C.data);e.fetchers.set(_,P)}}return{loaderData:h,errors:b}}function ue(e,t,r,n){let a=z({},t);for(let d of r){let i=d.route.id;if(t.hasOwnProperty(i)?t[i]!==void 0&&(a[i]=t[i]):e[i]!==void 0&&d.route.loader&&(a[i]=e[i]),n&&n.hasOwnProperty(i))break}return a}function ve(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 Ft(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 oe(e,t){let{pathname:r,routeId:n,method:a,type:d}=t===void 0?{}:t,i="Unknown Server Error",p="Unknown @remix-run/router error";return e===400?(i="Bad Request",a&&r&&n?p="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.":d==="defer-action"?p="defer() is not supported in actions":d==="invalid-body"&&(p="Unable to encode submission body")):e===403?(i="Forbidden",p='Route "'+n+'" does not match URL "'+r+'"'):e===404?(i="Not Found",p='No route matches URL "'+r+'"'):e===405&&(i="Method Not Allowed",a&&r&&n?p="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&&(p='Invalid request method "'+a.toUpperCase()+'"')),new Tt(e||500,i,new Error(p),!0)}function Lr(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(Be(r))return{result:r,idx:t}}}function Mr(e){let t=typeof e=="string"?ie(e):e;return Re(z({},t,{hash:""}))}function Jr(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Ie(e){return e.type===Z.deferred}function Ne(e){return e.type===Z.error}function Be(e){return(e&&e.type)===Z.redirect}function Yr(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 ot(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body!="undefined"}function Gr(e){if(!ot(e))return!1;let t=e.status,r=e.headers.get("Location");return t>=300&&t<=399&&r!=null}function Xr(e){return e&&ot(e.response)&&(e.type===Z.data||e.type===Z.error)}function ur(e){return mt.has(e.toLowerCase())}function xe(e){return or.has(e.toLowerCase())}async function _r(e,t,r,n,a,d){for(let i=0;i<r.length;i++){let p=r[i],h=t[i];if(!h)continue;let b=e.find(_=>_.route.id===h.route.id),m=b!=null&&!k(b,h)&&(d&&d[h.route.id])!==void 0;if(Ie(p)&&(a||m)){let _=n[i];H(_,"Expected an AbortSignal for revalidating fetcher deferred result"),await Or(p,_,a).then(E=>{E&&(r[i]=E||r[i])})}}}async function Or(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:Z.data,data:e.deferredData.unwrappedData}}catch(a){return{type:Z.error,error:a}}return{type:Z.data,data:e.deferredData.data}}}function dr(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function vt(e,t){let r=typeof t=="string"?ie(t).search:t.search;if(e[e.length-1].route.index&&dr(r||""))return e[e.length-1];let n=Zt(e);return n[n.length-1]}function Tr(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:d,json:i}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(d!=null)return{formMethod:t,formAction:r,formEncType:n,formData:d,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function cr(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 Qr(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 gt(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 Zr(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 He(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(sr);if(r){let n=JSON.parse(r);for(let[a,d]of Object.entries(n||{}))d&&Array.isArray(d)&&t.set(a,new Set(d||[]))}}catch{}}function en(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(sr,JSON.stringify(r))}catch(n){se(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}}}]);})();
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=module-react-router.296c491a.js.map
|