@techdocs/cli 1.7.0 → 1.8.0-next.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 (72) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/{generate-5fb2bc8c.cjs.js → generate-f9a039d6.cjs.js} +3 -2
  3. package/dist/cjs/{generate-5fb2bc8c.cjs.js.map → generate-f9a039d6.cjs.js.map} +1 -1
  4. package/dist/embedded-app/.config-schema.json +773 -224
  5. package/dist/embedded-app/index.html +1 -1
  6. package/dist/embedded-app/static/{1032.88fa9fda.chunk.js → 1032.8ff1a4ae.chunk.js} +2 -2
  7. package/dist/embedded-app/static/{1032.88fa9fda.chunk.js.map → 1032.8ff1a4ae.chunk.js.map} +1 -1
  8. package/dist/embedded-app/static/{1105.2ef0665c.chunk.js → 1105.cdd66625.chunk.js} +2 -2
  9. package/dist/embedded-app/static/{1105.2ef0665c.chunk.js.map → 1105.cdd66625.chunk.js.map} +1 -1
  10. package/dist/embedded-app/static/{184.8fc549e9.chunk.js → 184.c5591ae8.chunk.js} +2 -2
  11. package/dist/embedded-app/static/{184.8fc549e9.chunk.js.map → 184.c5591ae8.chunk.js.map} +1 -1
  12. package/dist/embedded-app/static/{2440.2451b337.chunk.js → 2440.f1360e66.chunk.js} +2 -2
  13. package/dist/embedded-app/static/{2440.2451b337.chunk.js.map → 2440.f1360e66.chunk.js.map} +1 -1
  14. package/dist/embedded-app/static/{3487.1c93df49.chunk.js → 3487.8e09c79a.chunk.js} +2 -2
  15. package/dist/embedded-app/static/{3487.1c93df49.chunk.js.map → 3487.8e09c79a.chunk.js.map} +1 -1
  16. package/dist/embedded-app/static/{3510.6d8cb98c.chunk.js → 3510.3082d0d9.chunk.js} +1 -1
  17. package/dist/embedded-app/static/{3510.6d8cb98c.chunk.js.map → 3510.3082d0d9.chunk.js.map} +1 -1
  18. package/dist/embedded-app/static/{4109.6335d16f.chunk.js → 4109.703c7257.chunk.js} +1 -1
  19. package/dist/embedded-app/static/4109.703c7257.chunk.js.map +1 -0
  20. package/dist/embedded-app/static/{5458.abed4572.chunk.js → 5458.8860bd67.chunk.js} +2 -2
  21. package/dist/embedded-app/static/{5458.abed4572.chunk.js.map → 5458.8860bd67.chunk.js.map} +1 -1
  22. package/dist/embedded-app/static/{5877.c521a57f.chunk.js → 5877.a7d3fb6d.chunk.js} +2 -2
  23. package/dist/embedded-app/static/5877.a7d3fb6d.chunk.js.map +1 -0
  24. package/dist/embedded-app/static/{5914.633b2934.chunk.js → 5914.1a3da6a4.chunk.js} +1 -1
  25. package/dist/embedded-app/static/{5914.633b2934.chunk.js.map → 5914.1a3da6a4.chunk.js.map} +1 -1
  26. package/dist/embedded-app/static/{6051.9eefea24.chunk.js → 6051.b5d6107a.chunk.js} +1 -1
  27. package/dist/embedded-app/static/{6051.9eefea24.chunk.js.map → 6051.b5d6107a.chunk.js.map} +1 -1
  28. package/dist/embedded-app/static/{7750.cb06dc85.chunk.js → 7750.80c8867a.chunk.js} +1 -1
  29. package/dist/embedded-app/static/7750.80c8867a.chunk.js.map +1 -0
  30. package/dist/embedded-app/static/{8096.752da27d.chunk.js → 8096.c58c75a0.chunk.js} +1 -1
  31. package/dist/embedded-app/static/8096.c58c75a0.chunk.js.map +1 -0
  32. package/dist/embedded-app/static/{8662.7243a5c6.chunk.js → 8662.f83727a2.chunk.js} +1 -1
  33. package/dist/embedded-app/static/{8662.7243a5c6.chunk.js.map → 8662.f83727a2.chunk.js.map} +1 -1
  34. package/dist/embedded-app/static/{8951.6ae94626.chunk.js → 8951.1fe70f2a.chunk.js} +1 -1
  35. package/dist/embedded-app/static/{8951.6ae94626.chunk.js.map → 8951.1fe70f2a.chunk.js.map} +1 -1
  36. package/dist/embedded-app/static/{9545.8e4a2868.chunk.js → 9545.d08cf7be.chunk.js} +2 -2
  37. package/dist/embedded-app/static/9545.d08cf7be.chunk.js.map +1 -0
  38. package/dist/embedded-app/static/{9770.2d75fe33.chunk.js → 9770.733a2bbb.chunk.js} +2 -2
  39. package/dist/embedded-app/static/{9770.2d75fe33.chunk.js.map → 9770.733a2bbb.chunk.js.map} +1 -1
  40. package/dist/embedded-app/static/9814.d48dafd2.chunk.js +3 -0
  41. package/dist/embedded-app/static/9814.d48dafd2.chunk.js.map +1 -0
  42. package/dist/embedded-app/static/main.2b22ee03.js +487 -0
  43. package/dist/embedded-app/static/main.2b22ee03.js.map +1 -0
  44. package/dist/embedded-app/static/{module-material-ui.263ce9b5.js → module-material-ui.0420d68d.js} +2 -2
  45. package/dist/embedded-app/static/{module-material-ui.263ce9b5.js.map → module-material-ui.0420d68d.js.map} +1 -1
  46. package/dist/embedded-app/static/module-react-router-dom.48ea1f60.js +22 -0
  47. package/dist/embedded-app/static/module-react-router-dom.48ea1f60.js.map +1 -0
  48. package/dist/embedded-app/static/module-react-router.67245b2c.js +22 -0
  49. package/dist/embedded-app/static/module-react-router.67245b2c.js.map +1 -0
  50. package/dist/embedded-app/static/{runtime.6ea4af3c.js → runtime.2b22ee03.js} +3 -3
  51. package/dist/embedded-app/static/runtime.2b22ee03.js.map +1 -0
  52. package/dist/embedded-app/static/vendor.2b22ee03.js +159 -0
  53. package/dist/embedded-app/static/vendor.2b22ee03.js.map +1 -0
  54. package/dist/index.cjs.js +6 -2
  55. package/dist/index.cjs.js.map +1 -1
  56. package/package.json +4 -4
  57. package/dist/embedded-app/static/1600.ec5e759e.chunk.js +0 -3
  58. package/dist/embedded-app/static/1600.ec5e759e.chunk.js.map +0 -1
  59. package/dist/embedded-app/static/4109.6335d16f.chunk.js.map +0 -1
  60. package/dist/embedded-app/static/5877.c521a57f.chunk.js.map +0 -1
  61. package/dist/embedded-app/static/7750.cb06dc85.chunk.js.map +0 -1
  62. package/dist/embedded-app/static/8096.752da27d.chunk.js.map +0 -1
  63. package/dist/embedded-app/static/9545.8e4a2868.chunk.js.map +0 -1
  64. package/dist/embedded-app/static/main.6ea4af3c.js +0 -487
  65. package/dist/embedded-app/static/main.6ea4af3c.js.map +0 -1
  66. package/dist/embedded-app/static/module-react-router-dom.9e5a6865.js +0 -22
  67. package/dist/embedded-app/static/module-react-router-dom.9e5a6865.js.map +0 -1
  68. package/dist/embedded-app/static/module-react-router.d96a5b36.js +0 -22
  69. package/dist/embedded-app/static/module-react-router.d96a5b36.js.map +0 -1
  70. package/dist/embedded-app/static/runtime.6ea4af3c.js.map +0 -1
  71. package/dist/embedded-app/static/vendor.6ea4af3c.js +0 -207
  72. package/dist/embedded-app/static/vendor.6ea4af3c.js.map +0 -1
@@ -1,22 +0,0 @@
1
- "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[5109],{71597:function(Xn,mr,Ae){Ae.d(mr,{VK:function(){return Pn},rU:function(){return Dn}});var X=Ae(2784),pr=Ae.t(X,2),Pe=Ae(73557),St=Ae(84800);/**
2
- * @remix-run/router v1.11.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 M(){return M=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},M.apply(this,arguments)}var H;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(H||(H={}));const Et="popstate";function Qn(e){e===void 0&&(e={});let{initialEntries:t=["/"],initialIndex:r,v5Compat:n=!1}=e,a;a=t.map((v,y)=>h(v,typeof v=="string"?null:v.state,y===0?"default":void 0));let i=s(r==null?a.length-1:r),o=H.Pop,l=null;function s(v){return Math.min(Math.max(v,0),a.length-1)}function d(){return a[i]}function h(v,y,R){y===void 0&&(y=null);let m=ne(a?d().pathname:"/",v,y,R);return te(m.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(v)),m}function g(v){return typeof v=="string"?v:ae(v)}return{get index(){return i},get action(){return o},get location(){return d()},createHref:g,createURL(v){return new URL(g(v),"http://localhost")},encodeLocation(v){let y=typeof v=="string"?re(v):v;return{pathname:y.pathname||"",search:y.search||"",hash:y.hash||""}},push(v,y){o=H.Push;let R=h(v,y);i+=1,a.splice(i,a.length,R),n&&l&&l({action:o,location:R,delta:1})},replace(v,y){o=H.Replace;let R=h(v,y);a[i]=R,n&&l&&l({action:o,location:R,delta:0})},go(v){o=H.Pop;let y=s(i+v),R=a[y];i=y,l&&l({action:o,location:R,delta:v})},listen(v){return l=v,()=>{l=null}}}}function gr(e){e===void 0&&(e={});function t(n,a){let{pathname:i,search:o,hash:l}=n.location;return ne("",{pathname:i,search:o,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:ae(a)}return xt(t,r,null,e)}function Zn(e){e===void 0&&(e={});function t(a,i){let{pathname:o="/",search:l="",hash:s=""}=re(a.location.hash.substr(1));return!o.startsWith("/")&&!o.startsWith(".")&&(o="/"+o),ne("",{pathname:o,search:l,hash:s},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(a,i){let o=a.document.querySelector("base"),l="";if(o&&o.getAttribute("href")){let s=a.location.href,d=s.indexOf("#");l=d===-1?s:s.slice(0,d)}return l+"#"+(typeof i=="string"?i:ae(i))}function n(a,i){te(a.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(i)+")")}return xt(t,r,n,e)}function U(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function te(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch{}}}function yr(){return Math.random().toString(36).substr(2,8)}function Pt(e,t){return{usr:e.state,key:e.key,idx:t}}function ne(e,t,r,n){return r===void 0&&(r=null),M({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?re(t):t,{state:r,key:t&&t.key||n||yr()})}function ae(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 re(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 xt(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,o=a.history,l=H.Pop,s=null,d=h();d==null&&(d=0,o.replaceState(M({},o.state,{idx:d}),""));function h(){return(o.state||{idx:null}).idx}function g(){l=H.Pop;let m=h(),S=m==null?null:m-d;d=m,s&&s({action:l,location:R.location,delta:S})}function w(m,S){l=H.Push;let C=ne(R.location,m,S);r&&r(C,m),d=h()+1;let P=Pt(C,d),u=R.createHref(C);try{o.pushState(P,"",u)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;a.location.assign(u)}i&&s&&s({action:l,location:R.location,delta:1})}function v(m,S){l=H.Replace;let C=ne(R.location,m,S);r&&r(C,m),d=h();let P=Pt(C,d),u=R.createHref(C);o.replaceState(P,"",u),i&&s&&s({action:l,location:R.location,delta:0})}function y(m){let S=a.location.origin!=="null"?a.location.origin:a.location.href,C=typeof m=="string"?m:ae(m);return U(S,"No window.location.(origin|href) available to create URL for href: "+C),new URL(C,S)}let R={get action(){return l},get location(){return e(a,o)},listen(m){if(s)throw new Error("A history only accepts one active listener");return a.addEventListener(Et,g),s=m,()=>{a.removeEventListener(Et,g),s=null}},createHref(m){return t(a,m)},createURL:y,encodeLocation(m){let S=y(m);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:w,replace:v,go(m){return o.go(m)}};return R}var I;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(I||(I={}));const vr=new Set(["lazy","caseSensitive","path","id","index","children"]);function wr(e){return e.index===!0}function Ve(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,i)=>{let o=[...r,i],l=typeof a.id=="string"?a.id:o.join("-");if(U(a.index!==!0||!a.children,"Cannot specify children on an index route"),U(!n[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),wr(a)){let s=M({},a,t(a),{id:l});return n[l]=s,s}else{let s=M({},a,t(a),{id:l,children:void 0});return n[l]=s,a.children&&(s.children=Ve(a.children,t,o,n)),s}})}function me(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?re(t):t,a=Fe(n.pathname||"/",r);if(a==null)return null;let i=Lt(e);br(i);let o=null;for(let l=0;o==null&&l<i.length;++l)o=Ar(i[l],Mr(a));return o}function Rr(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 Lt(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(i,o,l)=>{let s={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};s.relativePath.startsWith("/")&&(U(s.relativePath.startsWith(n),'Absolute route path "'+s.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),s.relativePath=s.relativePath.slice(n.length));let d=_e([n,s.relativePath]),h=r.concat(s);i.children&&i.children.length>0&&(U(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),Lt(i.children,t,h,d)),!(i.path==null&&!i.index)&&t.push({path:d,score:Tr(d,i.index),routesMeta:h})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))a(i,o);else for(let s of Dt(i.path))a(i,o,s)}),t}function Dt(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let o=Dt(n.join("/")),l=[];return l.push(...o.map(s=>s===""?i:[i,s].join("/"))),a&&l.push(...o),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function br(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Cr(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Sr=/^:\w+$/,Er=3,Pr=2,xr=1,Lr=10,Dr=null,Tt=e=>e==="*";function Tr(e,t){let r=e.split("/"),n=r.length;return r.some(Tt)&&(n+=Dr),t&&(n+=Pr),r.filter(a=>!Tt(a)).reduce((a,i)=>a+(Sr.test(i)?Er:i===""?xr:Lr),n)}function Cr(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 Ar(e,t){let{routesMeta:r}=e,n={},a="/",i=[];for(let o=0;o<r.length;++o){let l=r[o],s=o===r.length-1,d=a==="/"?t:t.slice(a.length)||"/",h=Fr({path:l.relativePath,caseSensitive:l.caseSensitive,end:s},d);if(!h)return null;Object.assign(n,h.params);let g=l.route;i.push({params:n,pathname:_e([a,h.pathname]),pathnameBase:Ir(_e([a,h.pathnameBase])),route:g}),h.pathnameBase!=="/"&&(a=_e([a,h.pathnameBase]))}return i}function qn(e,t){t===void 0&&(t={});let r=e;r.endsWith("*")&&r!=="*"&&!r.endsWith("/*")&&(te(!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=o=>o==null?"":typeof o=="string"?o:String(o),i=r.split(/\/+/).map((o,l,s)=>{if(l===s.length-1&&o==="*")return a(t["*"]);const h=o.match(/^:(\w+)(\??)$/);if(h){const[,g,w]=h;let v=t[g];return U(w==="?"||v!=null,'Missing ":'+g+'" param'),a(v)}return o.replace(/\?$/g,"")}).filter(o=>!!o);return n+i.join("/")}function Fr(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=_r(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((d,h,g)=>{let{paramName:w,isOptional:v}=h;if(w==="*"){let R=l[g]||"";o=i.slice(0,i.length-R.length).replace(/(.)\/+$/,"$1")}const y=l[g];return v&&!y?d[w]=void 0:d[w]=Ur(y||"",w),d},{}),pathname:i,pathnameBase:o,pattern:e}}function _r(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),te(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,(o,l,s)=>(n.push({paramName:l,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function Mr(e){try{return decodeURI(e)}catch(t){return te(!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 Ur(e,t){try{return decodeURIComponent(e)}catch(r){return te(!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 Fe(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 Nr(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?re(e):e;return{pathname:r?r.startsWith("/")?r:jr(r,t):t,search:Hr(n),hash:Br(a)}}function jr(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 nt(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 Ct(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Or(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=re(e):(a=M({},e),U(!a.pathname||!a.pathname.includes("?"),nt("?","pathname","search",a)),U(!a.pathname||!a.pathname.includes("#"),nt("#","pathname","hash",a)),U(!a.search||!a.search.includes("#"),nt("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,l;if(n||o==null)l=r;else{let g=t.length-1;if(o.startsWith("..")){let w=o.split("/");for(;w[0]==="..";)w.shift(),g-=1;a.pathname=w.join("/")}l=g>=0?t[g]:"/"}let s=Nr(a,l),d=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(d||h)&&(s.pathname+="/"),s}function ea(e){return e===""||e.pathname===""?"/":typeof e=="string"?re(e).pathname:e.pathname}const _e=e=>e.join("/").replace(/\/\/+/g,"/"),Ir=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Hr=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Br=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ta=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),M({},n,{headers:a}))};class At extends null{}class kr{constructor(t,r){this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],U(t&&typeof t=="object"&&!Array.isArray(t),"defer() only accepts plain objects");let n;this.abortPromise=new Promise((i,o)=>n=o),this.controller=new AbortController;let a=()=>n(new At("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",a),this.controller.signal.addEventListener("abort",a),this.data=Object.entries(t).reduce((i,o)=>{let[l,s]=o;return Object.assign(i,{[l]:this.trackPromise(l,s)})},{}),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 At)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 i=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:()=>i}),this.emit(!1,r),Promise.reject(i)}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(i=>{t.removeEventListener("abort",n),(i||this.done)&&a(i)})})}return r}get done(){return this.pendingKeysSet.size===0}get unwrappedData(){return U(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]:Kr(a)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function zr(e){return e instanceof Promise&&e._tracked===!0}function Kr(e){if(!zr(e))return e;if(e._error)throw e._error;return e._data}const ra=function(t,r){r===void 0&&(r={});let n=typeof r=="number"?{status:r}:r;return new kr(t,n)},Wr=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,M({},n,{headers:a}))},na=(e,t)=>{let r=Wr(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class Ft{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 _t(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"],Vr=new Set(Mt),$r=["get",...Mt],Yr=new Set($r),Jr=new Set([301,302,303,307,308]),Gr=new Set([307,308]),at={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Xr={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Me={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Ut=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Nt=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),jt="remix-router-transitions";function aa(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;U(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 c=e.detectErrorBoundary;a=f=>({hasErrorBoundary:c(f)})}else a=Nt;let i={},o=Ve(e.routes,a,void 0,i),l,s=e.basename||"/",d=M({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),h=null,g=new Set,w=null,v=null,y=null,R=e.hydrationData!=null,m=me(o,e.history.location,s),S=null;if(m==null){let c=K(404,{pathname:e.history.location.pathname}),{matches:f,route:p}=$e(o);m=f,S={[p.id]:c}}let C=!m.some(c=>c.route.lazy)&&(!m.some(c=>c.route.loader)||e.hydrationData!=null),P,u={historyAction:e.history.action,location:e.history.location,matches:m,initialized:C,navigation:at,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||S,fetchers:new Map,blockers:new Map},A=H.Pop,B=!1,E,W=!1,k=new Map,G=null,q=!1,oe=!1,Qe=[],Ze=[],$=new Map,qe=0,Ie=-1,Te=new Map,ie=new Set,Ce=new Map,He=new Map,ve=new Set,we=new Map,Re=new Map,pt=!1;function Nn(){if(h=e.history.listen(c=>{let{action:f,location:p,delta:b}=c;if(pt){pt=!1;return}te(Re.size===0||b!=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=cr({currentLocation:u.location,nextLocation:p,historyAction:f});if(L&&b!=null){pt=!0,e.history.go(b*-1),tt(L,{state:"blocked",location:p,proceed(){tt(L,{state:"proceeding",proceed:void 0,reset:void 0,location:p}),e.history.go(b)},reset(){let D=new Map(u.blockers);D.set(L,Me),Y({blockers:D})}});return}return be(f,p)}),r){ln(t,k);let c=()=>sn(t,k);t.addEventListener("pagehide",c),G=()=>t.removeEventListener("pagehide",c)}return u.initialized||be(H.Pop,u.location),P}function jn(){h&&h(),G&&G(),g.clear(),E&&E.abort(),u.fetchers.forEach((c,f)=>et(f)),u.blockers.forEach((c,f)=>ur(f))}function On(c){return g.add(c),()=>g.delete(c)}function Y(c,f){u=M({},u,c);let p=[],b=[];d.v7_fetcherPersist&&u.fetchers.forEach((L,D)=>{L.state==="idle"&&(ve.has(D)?b.push(D):p.push(D))}),g.forEach(L=>L(u,{deletedFetchers:b,unstable_viewTransitionOpts:f})),d.v7_fetcherPersist&&(p.forEach(L=>u.fetchers.delete(L)),b.forEach(L=>et(L)))}function Be(c,f){var p,b;let L=u.actionData!=null&&u.navigation.formMethod!=null&&Q(u.navigation.formMethod)&&u.navigation.state==="loading"&&((p=c.state)==null?void 0:p._isRedirect)!==!0,D;f.actionData?Object.keys(f.actionData).length>0?D=f.actionData:D=null:L?D=u.actionData:D=null;let F=f.loaderData?$t(u.loaderData,f.loaderData,f.matches||[],f.errors):u.loaderData,T=u.blockers;T.size>0&&(T=new Map(T),T.forEach((z,_)=>T.set(_,Me)));let x=B===!0||u.navigation.formMethod!=null&&Q(u.navigation.formMethod)&&((b=c.state)==null?void 0:b._isRedirect)!==!0;l&&(o=l,l=void 0),q||A===H.Pop||(A===H.Push?e.history.push(c,c.state):A===H.Replace&&e.history.replace(c,c.state));let j;if(A===H.Pop){let z=k.get(u.location.pathname);z&&z.has(c.pathname)?j={currentLocation:u.location,nextLocation:c}:k.has(c.pathname)&&(j={currentLocation:c,nextLocation:u.location})}else if(W){let z=k.get(u.location.pathname);z?z.add(c.pathname):(z=new Set([c.pathname]),k.set(u.location.pathname,z)),j={currentLocation:u.location,nextLocation:c}}Y(M({},f,{actionData:D,loaderData:F,historyAction:A,location:c,initialized:!0,navigation:at,revalidation:"idle",restoreScrollPosition:fr(c,f.matches||u.matches),preventScrollReset:x,blockers:T}),j),A=H.Pop,B=!1,W=!1,q=!1,oe=!1,Qe=[],Ze=[]}async function nr(c,f){if(typeof c=="number"){e.history.go(c);return}let p=ot(u.location,u.matches,s,d.v7_prependBasename,c,f==null?void 0:f.fromRouteId,f==null?void 0:f.relative),{path:b,submission:L,error:D}=Ot(d.v7_normalizeFormMethod,!1,p,f),F=u.location,T=ne(u.location,b,f&&f.state);T=M({},T,e.history.encodeLocation(T));let x=f&&f.replace!=null?f.replace:void 0,j=H.Push;x===!0?j=H.Replace:x===!1||L!=null&&Q(L.formMethod)&&L.formAction===u.location.pathname+u.location.search&&(j=H.Replace);let z=f&&"preventScrollReset"in f?f.preventScrollReset===!0:void 0,_=cr({currentLocation:F,nextLocation:T,historyAction:j});if(_){tt(_,{state:"blocked",location:T,proceed(){tt(_,{state:"proceeding",proceed:void 0,reset:void 0,location:T}),nr(c,f)},reset(){let O=new Map(u.blockers);O.set(_,Me),Y({blockers:O})}});return}return await be(j,T,{submission:L,pendingError:D,preventScrollReset:z,replace:f&&f.replace,enableViewTransition:f&&f.unstable_viewTransition})}function In(){if(gt(),Y({revalidation:"loading"}),u.navigation.state!=="submitting"){if(u.navigation.state==="idle"){be(u.historyAction,u.location,{startUninterruptedRevalidation:!0});return}be(A||u.historyAction,u.navigation.location,{overrideNavigation:u.navigation})}}async function be(c,f,p){E&&E.abort(),E=null,A=c,q=(p&&p.startUninterruptedRevalidation)===!0,Yn(u.location,u.matches),B=(p&&p.preventScrollReset)===!0,W=(p&&p.enableViewTransition)===!0;let b=l||o,L=p&&p.overrideNavigation,D=me(b,f,s);if(!D){let O=K(404,{pathname:f.pathname}),{matches:J,route:Se}=$e(b);yt(),Be(f,{matches:J,loaderData:{},errors:{[Se.id]:O}});return}if(u.initialized&&!oe&&en(u.location,f)&&!(p&&p.submission&&Q(p.submission.formMethod))){Be(f,{matches:D});return}E=new AbortController;let F=Ue(e.history,f,E.signal,p&&p.submission),T,x;if(p&&p.pendingError)x={[xe(D).route.id]:p.pendingError};else if(p&&p.submission&&Q(p.submission.formMethod)){let O=await Hn(F,f,p.submission,D,{replace:p.replace});if(O.shortCircuited)return;T=O.pendingActionData,x=O.pendingActionError,L=ut(f,p.submission),F=new Request(F.url,{signal:F.signal})}let{shortCircuited:j,loaderData:z,errors:_}=await Bn(F,f,D,L,p&&p.submission,p&&p.fetcherSubmission,p&&p.replace,T,x);j||(E=null,Be(f,M({matches:D},T?{actionData:T}:{},{loaderData:z,errors:_})))}async function Hn(c,f,p,b,L){L===void 0&&(L={}),gt();let D=an(f,p);Y({navigation:D});let F,T=Ne(b,f);if(!T.route.action&&!T.route.lazy)F={type:I.error,error:K(405,{method:c.method,pathname:f.pathname,routeId:T.route.id})};else if(F=await pe("action",c,T,b,i,a,s),c.signal.aborted)return{shortCircuited:!0};if(ye(F)){let x;return L&&L.replace!=null?x=L.replace:x=F.location===u.location.pathname+u.location.search,await ke(u,F,{submission:p,replace:x}),{shortCircuited:!0}}if(ge(F)){let x=xe(b,T.route.id);return(L&&L.replace)!==!0&&(A=H.Push),{pendingActionData:{},pendingActionError:{[x.route.id]:F.error}}}if(se(F))throw K(400,{type:"defer-action"});return{pendingActionData:{[T.route.id]:F.data}}}async function Bn(c,f,p,b,L,D,F,T,x){let j=b||ut(f,L),z=L||D||Qt(j),_=l||o,[O,J]=Ht(e.history,u,p,z,f,oe,Qe,Ze,Ce,ie,_,s,T,x);if(yt(N=>!(p&&p.some(ee=>ee.route.id===N))||O&&O.some(ee=>ee.route.id===N)),Ie=++qe,O.length===0&&J.length===0){let N=lr();return Be(f,M({matches:p,loaderData:{},errors:x||null},T?{actionData:T}:{},N?{fetchers:new Map(u.fetchers)}:{})),{shortCircuited:!0}}if(!q){J.forEach(ee=>{let he=u.fetchers.get(ee.key),V=je(void 0,he?he.data:void 0);u.fetchers.set(ee.key,V)});let N=T||u.actionData;Y(M({navigation:j},N?Object.keys(N).length===0?{actionData:null}:{actionData:N}:{},J.length>0?{fetchers:new Map(u.fetchers)}:{}))}J.forEach(N=>{$.has(N.key)&&de(N.key),N.controller&&$.set(N.key,N.controller)});let Se=()=>J.forEach(N=>de(N.key));E&&E.signal.addEventListener("abort",Se);let{results:Ee,loaderResults:Ke,fetcherResults:vt}=await or(u.matches,p,O,J,c);if(c.signal.aborted)return{shortCircuited:!0};E&&E.signal.removeEventListener("abort",Se),J.forEach(N=>$.delete(N.key));let le=Yt(Ee);if(le){if(le.idx>=O.length){let N=J[le.idx-O.length].key;ie.add(N)}return await ke(u,le.result,{replace:F}),{shortCircuited:!0}}let{loaderData:fe,errors:rt}=Vt(u,p,O,Ke,x,J,vt,we);we.forEach((N,ee)=>{N.subscribe(he=>{(he||N.done)&&we.delete(ee)})});let wt=lr(),Rt=sr(Ie),bt=wt||Rt||J.length>0;return M({loaderData:fe,errors:rt},bt?{fetchers:new Map(u.fetchers)}:{})}function ar(c){return d.v7_fetcherPersist&&(He.set(c,(He.get(c)||0)+1),ve.has(c)&&ve.delete(c)),u.fetchers.get(c)||Xr}function kn(c,f,p,b){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.");$.has(c)&&de(c);let L=l||o,D=ot(u.location,u.matches,s,d.v7_prependBasename,p,f,b==null?void 0:b.relative),F=me(L,D,s);if(!F){ze(c,f,K(404,{pathname:D}));return}let{path:T,submission:x,error:j}=Ot(d.v7_normalizeFormMethod,!0,D,b);if(j){ze(c,f,j);return}let z=Ne(F,T);if(B=(b&&b.preventScrollReset)===!0,x&&Q(x.formMethod)){zn(c,f,T,z,F,x);return}Ce.set(c,{routeId:f,path:T}),Kn(c,f,T,z,F,x)}async function zn(c,f,p,b,L,D){if(gt(),Ce.delete(c),!b.route.action&&!b.route.lazy){let V=K(405,{method:D.formMethod,pathname:p,routeId:f});ze(c,f,V);return}let F=u.fetchers.get(c),T=on(D,F);u.fetchers.set(c,T),Y({fetchers:new Map(u.fetchers)});let x=new AbortController,j=Ue(e.history,p,x.signal,D);$.set(c,x);let z=qe,_=await pe("action",j,b,L,i,a,s);if(j.signal.aborted){$.get(c)===x&&$.delete(c);return}if(ve.has(c)){u.fetchers.set(c,ue(void 0)),Y({fetchers:new Map(u.fetchers)});return}if(ye(_))if($.delete(c),Ie>z){let V=ue(void 0);u.fetchers.set(c,V),Y({fetchers:new Map(u.fetchers)});return}else{ie.add(c);let V=je(D);return u.fetchers.set(c,V),Y({fetchers:new Map(u.fetchers)}),ke(u,_,{fetcherSubmission:D})}if(ge(_)){ze(c,f,_.error);return}if(se(_))throw K(400,{type:"defer-action"});let O=u.navigation.location||u.location,J=Ue(e.history,O,x.signal),Se=l||o,Ee=u.navigation.state!=="idle"?me(Se,u.navigation.location,s):u.matches;U(Ee,"Didn't find any matches after fetcher action");let Ke=++qe;Te.set(c,Ke);let vt=je(D,_.data);u.fetchers.set(c,vt);let[le,fe]=Ht(e.history,u,Ee,D,O,oe,Qe,Ze,Ce,ie,Se,s,{[b.route.id]:_.data},void 0);fe.filter(V=>V.key!==c).forEach(V=>{let We=V.key,hr=u.fetchers.get(We),Gn=je(void 0,hr?hr.data:void 0);u.fetchers.set(We,Gn),$.has(We)&&de(We),V.controller&&$.set(We,V.controller)}),Y({fetchers:new Map(u.fetchers)});let rt=()=>fe.forEach(V=>de(V.key));x.signal.addEventListener("abort",rt);let{results:wt,loaderResults:Rt,fetcherResults:bt}=await or(u.matches,Ee,le,fe,J);if(x.signal.aborted)return;x.signal.removeEventListener("abort",rt),Te.delete(c),$.delete(c),fe.forEach(V=>$.delete(V.key));let N=Yt(wt);if(N){if(N.idx>=le.length){let V=fe[N.idx-le.length].key;ie.add(V)}return ke(u,N.result)}let{loaderData:ee,errors:he}=Vt(u,u.matches,le,Rt,void 0,fe,bt,we);if(u.fetchers.has(c)){let V=ue(_.data);u.fetchers.set(c,V)}sr(Ke),u.navigation.state==="loading"&&Ke>Ie?(U(A,"Expected pending action"),E&&E.abort(),Be(u.navigation.location,{matches:Ee,loaderData:ee,errors:he,fetchers:new Map(u.fetchers)})):(Y({errors:he,loaderData:$t(u.loaderData,ee,Ee,he),fetchers:new Map(u.fetchers)}),oe=!1)}async function Kn(c,f,p,b,L,D){let F=u.fetchers.get(c),T=je(D,F?F.data:void 0);u.fetchers.set(c,T),Y({fetchers:new Map(u.fetchers)});let x=new AbortController,j=Ue(e.history,p,x.signal);$.set(c,x);let z=qe,_=await pe("loader",j,b,L,i,a,s);if(se(_)&&(_=await Xt(_,j.signal,!0)||_),$.get(c)===x&&$.delete(c),j.signal.aborted)return;if(ve.has(c)){u.fetchers.set(c,ue(void 0)),Y({fetchers:new Map(u.fetchers)});return}if(ye(_))if(Ie>z){let J=ue(void 0);u.fetchers.set(c,J),Y({fetchers:new Map(u.fetchers)});return}else{ie.add(c),await ke(u,_);return}if(ge(_)){ze(c,f,_.error);return}U(!se(_),"Unhandled fetcher deferred data");let O=ue(_.data);u.fetchers.set(c,O),Y({fetchers:new Map(u.fetchers)})}async function ke(c,f,p){let{submission:b,fetcherSubmission:L,replace:D}=p===void 0?{}:p;f.revalidate&&(oe=!0);let F=ne(c.location,f.location,{_isRedirect:!0});if(U(F,"Expected a location on the redirect navigation"),r){let O=!1;if(f.reloadDocument)O=!0;else if(Ut.test(f.location)){const J=e.history.createURL(f.location);O=J.origin!==t.location.origin||Fe(J.pathname,s)==null}if(O){D?t.location.replace(f.location):t.location.assign(f.location);return}}E=null;let T=D===!0?H.Replace:H.Push,{formMethod:x,formAction:j,formEncType:z}=c.navigation;!b&&!L&&x&&j&&z&&(b=Qt(c.navigation));let _=b||L;if(Gr.has(f.status)&&_&&Q(_.formMethod))await be(T,F,{submission:M({},_,{formAction:f.location}),preventScrollReset:B});else{let O=ut(F,b);await be(T,F,{overrideNavigation:O,fetcherSubmission:L,preventScrollReset:B})}}async function or(c,f,p,b,L){let D=await Promise.all([...p.map(x=>pe("loader",L,x,f,i,a,s)),...b.map(x=>x.matches&&x.match&&x.controller?pe("loader",Ue(e.history,x.path,x.controller.signal),x.match,x.matches,i,a,s):{type:I.error,error:K(404,{pathname:x.path})})]),F=D.slice(0,p.length),T=D.slice(p.length);return await Promise.all([Gt(c,p,F,F.map(()=>L.signal),!1,u.loaderData),Gt(c,b.map(x=>x.match),T,b.map(x=>x.controller?x.controller.signal:null),!0)]),{results:D,loaderResults:F,fetcherResults:T}}function gt(){oe=!0,Qe.push(...yt()),Ce.forEach((c,f)=>{$.has(f)&&(Ze.push(f),de(f))})}function ze(c,f,p){let b=xe(u.matches,f);et(c),Y({errors:{[b.route.id]:p},fetchers:new Map(u.fetchers)})}function et(c){let f=u.fetchers.get(c);$.has(c)&&!(f&&f.state==="loading"&&Te.has(c))&&de(c),Ce.delete(c),Te.delete(c),ie.delete(c),ve.delete(c),u.fetchers.delete(c)}function Wn(c){if(d.v7_fetcherPersist){let f=(He.get(c)||0)-1;f<=0?(He.delete(c),ve.add(c)):He.set(c,f)}else et(c);Y({fetchers:new Map(u.fetchers)})}function de(c){let f=$.get(c);U(f,"Expected fetch controller: "+c),f.abort(),$.delete(c)}function ir(c){for(let f of c){let p=ar(f),b=ue(p.data);u.fetchers.set(f,b)}}function lr(){let c=[],f=!1;for(let p of ie){let b=u.fetchers.get(p);U(b,"Expected fetcher: "+p),b.state==="loading"&&(ie.delete(p),c.push(p),f=!0)}return ir(c),f}function sr(c){let f=[];for(let[p,b]of Te)if(b<c){let L=u.fetchers.get(p);U(L,"Expected fetcher: "+p),L.state==="loading"&&(de(p),Te.delete(p),f.push(p))}return ir(f),f.length>0}function Vn(c,f){let p=u.blockers.get(c)||Me;return Re.get(c)!==f&&Re.set(c,f),p}function ur(c){u.blockers.delete(c),Re.delete(c)}function tt(c,f){let p=u.blockers.get(c)||Me;U(p.state==="unblocked"&&f.state==="blocked"||p.state==="blocked"&&f.state==="blocked"||p.state==="blocked"&&f.state==="proceeding"||p.state==="blocked"&&f.state==="unblocked"||p.state==="proceeding"&&f.state==="unblocked","Invalid blocker state transition: "+p.state+" -> "+f.state);let b=new Map(u.blockers);b.set(c,f),Y({blockers:b})}function cr(c){let{currentLocation:f,nextLocation:p,historyAction:b}=c;if(Re.size===0)return;Re.size>1&&te(!1,"A router only supports one blocker at a time");let L=Array.from(Re.entries()),[D,F]=L[L.length-1],T=u.blockers.get(D);if(!(T&&T.state==="proceeding")&&F({currentLocation:f,nextLocation:p,historyAction:b}))return D}function yt(c){let f=[];return we.forEach((p,b)=>{(!c||c(b))&&(p.cancel(),f.push(b),we.delete(b))}),f}function $n(c,f,p){if(w=c,y=f,v=p||null,!R&&u.navigation===at){R=!0;let b=fr(u.location,u.matches);b!=null&&Y({restoreScrollPosition:b})}return()=>{w=null,y=null,v=null}}function dr(c,f){return v&&v(c,f.map(b=>Rr(b,u.loaderData)))||c.key}function Yn(c,f){if(w&&y){let p=dr(c,f);w[p]=y()}}function fr(c,f){if(w){let p=dr(c,f),b=w[p];if(typeof b=="number")return b}return null}function Jn(c){i={},l=Ve(c,a,void 0,i)}return P={get basename(){return s},get state(){return u},get routes(){return o},get window(){return t},initialize:Nn,subscribe:On,enableScrollRestoration:$n,navigate:nr,fetch:kn,revalidate:In,createHref:c=>e.history.createHref(c),encodeLocation:c=>e.history.encodeLocation(c),getFetcher:ar,deleteFetcher:Wn,dispose:jn,getBlocker:Vn,deleteBlocker:ur,_internalFetchControllers:$,_internalActiveDeferreds:we,_internalSetRoutes:Jn},P}const Qr=Symbol("deferred");function oa(e,t){U(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 g=t.detectErrorBoundary;a=w=>({hasErrorBoundary:g(w)})}else a=Nt;let i=Ve(e,a,void 0,r);async function o(g,w){let{requestContext:v}=w===void 0?{}:w,y=new URL(g.url),R=g.method,m=ne("",ae(y),null,"default"),S=me(i,m,n);if(!lt(R)&&R!=="HEAD"){let P=K(405,{method:R}),{matches:u,route:A}=$e(i);return{basename:n,location:m,matches:u,loaderData:{},actionData:null,errors:{[A.id]:P},statusCode:P.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}else if(!S){let P=K(404,{pathname:m.pathname}),{matches:u,route:A}=$e(i);return{basename:n,location:m,matches:u,loaderData:{},actionData:null,errors:{[A.id]:P},statusCode:P.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let C=await s(g,m,S,v);return Le(C)?C:M({location:m,basename:n},C)}async function l(g,w){let{routeId:v,requestContext:y}=w===void 0?{}:w,R=new URL(g.url),m=g.method,S=ne("",ae(R),null,"default"),C=me(i,S,n);if(!lt(m)&&m!=="HEAD"&&m!=="OPTIONS")throw K(405,{method:m});if(!C)throw K(404,{pathname:S.pathname});let P=v?C.find(E=>E.route.id===v):Ne(C,S);if(v&&!P)throw K(403,{pathname:S.pathname,routeId:v});if(!P)throw K(404,{pathname:S.pathname});let u=await s(g,S,C,y,P);if(Le(u))return u;let A=u.errors?Object.values(u.errors)[0]:void 0;if(A!==void 0)throw A;if(u.actionData)return Object.values(u.actionData)[0];if(u.loaderData){var B;let E=Object.values(u.loaderData)[0];return(B=u.activeDeferreds)!=null&&B[P.route.id]&&(E[Qr]=u.activeDeferreds[P.route.id]),E}}async function s(g,w,v,y,R){U(g.signal,"query()/queryRoute() requests must contain an AbortController signal");try{if(Q(g.method.toLowerCase()))return await d(g,v,R||Ne(v,w),y,R!=null);let m=await h(g,v,y,R);return Le(m)?m:M({},m,{actionData:null,actionHeaders:{}})}catch(m){if(nn(m)){if(m.type===I.error)throw m.response;return m.response}if(rn(m))return m;throw m}}async function d(g,w,v,y,R){let m;if(!v.route.action&&!v.route.lazy){let P=K(405,{method:g.method,pathname:new URL(g.url).pathname,routeId:v.route.id});if(R)throw P;m={type:I.error,error:P}}else if(m=await pe("action",g,v,w,r,a,n,{isStaticRequest:!0,isRouteRequest:R,requestContext:y}),g.signal.aborted){let P=R?"queryRoute":"query";throw new Error(P+"() call aborted: "+g.method+" "+g.url)}if(ye(m))throw new Response(null,{status:m.status,headers:{Location:m.location}});if(se(m)){let P=K(400,{type:"defer-action"});if(R)throw P;m={type:I.error,error:P}}if(R){if(ge(m))throw m.error;return{matches:[v],loaderData:{},actionData:{[v.route.id]:m.data},errors:null,statusCode:200,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}if(ge(m)){let P=xe(w,v.route.id),u=await h(g,w,y,void 0,{[P.route.id]:m.error});return M({},u,{statusCode:_t(m.error)?m.error.status:500,actionData:null,actionHeaders:M({},m.headers?{[v.route.id]:m.headers}:{})})}let S=new Request(g.url,{headers:g.headers,redirect:g.redirect,signal:g.signal}),C=await h(S,w,y);return M({},C,m.statusCode?{statusCode:m.statusCode}:{},{actionData:{[v.route.id]:m.data},actionHeaders:M({},m.headers?{[v.route.id]:m.headers}:{})})}async function h(g,w,v,y,R){let m=y!=null;if(m&&!(y!=null&&y.route.loader)&&!(y!=null&&y.route.lazy))throw K(400,{method:g.method,pathname:new URL(g.url).pathname,routeId:y==null?void 0:y.route.id});let C=(y?[y]:It(w,Object.keys(R||{})[0])).filter(E=>E.route.loader||E.route.lazy);if(C.length===0)return{matches:w,loaderData:w.reduce((E,W)=>Object.assign(E,{[W.route.id]:null}),{}),errors:R||null,statusCode:200,loaderHeaders:{},activeDeferreds:null};let P=await Promise.all([...C.map(E=>pe("loader",g,E,w,r,a,n,{isStaticRequest:!0,isRouteRequest:m,requestContext:v}))]);if(g.signal.aborted){let E=m?"queryRoute":"query";throw new Error(E+"() call aborted: "+g.method+" "+g.url)}let u=new Map,A=Wt(w,C,P,R,u),B=new Set(C.map(E=>E.route.id));return w.forEach(E=>{B.has(E.route.id)||(A.loaderData[E.route.id]=null)}),M({},A,{matches:w,activeDeferreds:u.size>0?Object.fromEntries(u.entries()):null})}return{dataRoutes:i,query:o,queryRoute:l}}function ia(e,t,r){return M({},t,{statusCode:500,errors:{[t._deepestRenderedBoundaryId||e[0].id]:r}})}function Zr(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function ot(e,t,r,n,a,i,o){let l,s;if(i!=null&&o!=="path"){l=[];for(let h of t)if(l.push(h),h.route.id===i){s=h;break}}else l=t,s=t[t.length-1];let d=Or(a||".",Ct(l).map(h=>h.pathnameBase),Fe(e.pathname,r)||e.pathname,o==="path");return a==null&&(d.search=e.search,d.hash=e.hash),(a==null||a===""||a===".")&&s&&s.route.index&&!st(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(d.pathname=d.pathname==="/"?r:_e([r,d.pathname])),ae(d)}function Ot(e,t,r,n){if(!n||!Zr(n))return{path:r};if(n.formMethod&&!lt(n.formMethod))return{path:r,error:K(405,{method:n.formMethod})};let a=()=>({path:r,error:K(400,{type:"invalid-body"})}),i=n.formMethod||"get",o=e?i.toUpperCase():i.toLowerCase(),l=Jt(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Q(o))return a();let w=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((v,y)=>{let[R,m]=y;return""+v+R+"="+m+`
11
- `},""):String(n.body);return{path:r,submission:{formMethod:o,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:w}}}else if(n.formEncType==="application/json"){if(!Q(o))return a();try{let w=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:o,formAction:l,formEncType:n.formEncType,formData:void 0,json:w,text:void 0}}}catch{return a()}}}U(typeof FormData=="function","FormData is not available in this environment");let s,d;if(n.formData)s=it(n.formData),d=n.formData;else if(n.body instanceof FormData)s=it(n.body),d=n.body;else if(n.body instanceof URLSearchParams)s=n.body,d=Kt(s);else if(n.body==null)s=new URLSearchParams,d=new FormData;else try{s=new URLSearchParams(n.body),d=Kt(s)}catch{return a()}let h={formMethod:o,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:d,json:void 0,text:void 0};if(Q(h.formMethod))return{path:r,submission:h};let g=re(r);return t&&g.search&&st(g.search)&&s.append("index",""),g.search="?"+s,{path:ae(g),submission:h}}function It(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 Ht(e,t,r,n,a,i,o,l,s,d,h,g,w,v){let y=v?Object.values(v)[0]:w?Object.values(w)[0]:void 0,R=e.createURL(t.location),m=e.createURL(a),S=v?Object.keys(v)[0]:void 0,P=It(r,S).filter((A,B)=>{if(A.route.lazy)return!0;if(A.route.loader==null)return!1;if(qr(t.loaderData,t.matches[B],A)||o.some(k=>k===A.route.id))return!0;let E=t.matches[B],W=A;return kt(A,M({currentUrl:R,currentParams:E.params,nextUrl:m,nextParams:W.params},n,{actionResult:y,defaultShouldRevalidate:i||R.pathname+R.search===m.pathname+m.search||R.search!==m.search||Bt(E,W)}))}),u=[];return s.forEach((A,B)=>{if(!r.some(q=>q.route.id===A.routeId))return;let E=me(h,A.path,g);if(!E){u.push({key:B,routeId:A.routeId,path:A.path,matches:null,match:null,controller:null});return}let W=t.fetchers.get(B),k=Ne(E,A.path),G=!1;d.has(B)?G=!1:l.includes(B)?G=!0:W&&W.state!=="idle"&&W.data===void 0?G=i:G=kt(k,M({currentUrl:R,currentParams:t.matches[t.matches.length-1].params,nextUrl:m,nextParams:r[r.length-1].params},n,{actionResult:y,defaultShouldRevalidate:i})),G&&u.push({key:B,routeId:A.routeId,path:A.path,matches:E,match:k,controller:new AbortController})}),[P,u]}function qr(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function Bt(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function kt(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function zt(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];U(a,"No route found in manifest");let i={};for(let o in n){let s=a[o]!==void 0&&o!=="hasErrorBoundary";te(!s,'Route "'+a.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!s&&!vr.has(o)&&(i[o]=n[o])}Object.assign(a,i),Object.assign(a,M({},t(a),{lazy:void 0}))}async function pe(e,t,r,n,a,i,o,l){l===void 0&&(l={});let s,d,h,g=y=>{let R,m=new Promise((S,C)=>R=C);return h=()=>R(),t.signal.addEventListener("abort",h),Promise.race([y({request:t,params:r.params,context:l.requestContext}),m])};try{let y=r.route[e];if(r.route.lazy)if(y){let R,m=await Promise.all([g(y).catch(S=>{R=S}),zt(r.route,i,a)]);if(R)throw R;d=m[0]}else if(await zt(r.route,i,a),y=r.route[e],y)d=await g(y);else if(e==="action"){let R=new URL(t.url),m=R.pathname+R.search;throw K(405,{method:t.method,pathname:m,routeId:r.route.id})}else return{type:I.data,data:void 0};else if(y)d=await g(y);else{let R=new URL(t.url),m=R.pathname+R.search;throw K(404,{pathname:m})}U(d!==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(y){s=I.error,d=y}finally{h&&t.signal.removeEventListener("abort",h)}if(Le(d)){let y=d.status;if(Jr.has(y)){let S=d.headers.get("Location");if(U(S,"Redirects returned/thrown from loaders/actions must have a Location header"),!Ut.test(S))S=ot(new URL(t.url),n.slice(0,n.indexOf(r)+1),o,!0,S);else if(!l.isStaticRequest){let C=new URL(t.url),P=S.startsWith("//")?new URL(C.protocol+S):new URL(S),u=Fe(P.pathname,o)!=null;P.origin===C.origin&&u&&(S=P.pathname+P.search+P.hash)}if(l.isStaticRequest)throw d.headers.set("Location",S),d;return{type:I.redirect,status:y,location:S,revalidate:d.headers.get("X-Remix-Revalidate")!==null,reloadDocument:d.headers.get("X-Remix-Reload-Document")!==null}}if(l.isRouteRequest)throw{type:s===I.error?I.error:I.data,response:d};let R,m=d.headers.get("Content-Type");return m&&/\bapplication\/json\b/.test(m)?R=await d.json():R=await d.text(),s===I.error?{type:s,error:new Ft(y,d.statusText,R),headers:d.headers}:{type:I.data,data:R,statusCode:d.status,headers:d.headers}}if(s===I.error)return{type:s,error:d};if(tn(d)){var w,v;return{type:I.deferred,deferredData:d,statusCode:(w=d.init)==null?void 0:w.status,headers:((v=d.init)==null?void 0:v.headers)&&new Headers(d.init.headers)}}return{type:I.data,data:d}}function Ue(e,t,r,n){let a=e.createURL(Jt(t)).toString(),i={signal:r};if(n&&Q(n.formMethod)){let{formMethod:o,formEncType:l}=n;i.method=o.toUpperCase(),l==="application/json"?(i.headers=new Headers({"Content-Type":l}),i.body=JSON.stringify(n.json)):l==="text/plain"?i.body=n.text:l==="application/x-www-form-urlencoded"&&n.formData?i.body=it(n.formData):i.body=n.formData}return new Request(a,i)}function it(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function Kt(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Wt(e,t,r,n,a){let i={},o=null,l,s=!1,d={};return r.forEach((h,g)=>{let w=t[g].route.id;if(U(!ye(h),"Cannot handle redirect results in processLoaderData"),ge(h)){let v=xe(e,w),y=h.error;n&&(y=Object.values(n)[0],n=void 0),o=o||{},o[v.route.id]==null&&(o[v.route.id]=y),i[w]=void 0,s||(s=!0,l=_t(h.error)?h.error.status:500),h.headers&&(d[w]=h.headers)}else se(h)?(a.set(w,h.deferredData),i[w]=h.deferredData.data):i[w]=h.data,h.statusCode!=null&&h.statusCode!==200&&!s&&(l=h.statusCode),h.headers&&(d[w]=h.headers)}),n&&(o=n,i[Object.keys(n)[0]]=void 0),{loaderData:i,errors:o,statusCode:l||200,loaderHeaders:d}}function Vt(e,t,r,n,a,i,o,l){let{loaderData:s,errors:d}=Wt(t,r,n,a,l);for(let h=0;h<i.length;h++){let{key:g,match:w,controller:v}=i[h];U(o!==void 0&&o[h]!==void 0,"Did not find corresponding fetcher result");let y=o[h];if(!(v&&v.signal.aborted))if(ge(y)){let R=xe(e.matches,w==null?void 0:w.route.id);d&&d[R.route.id]||(d=M({},d,{[R.route.id]:y.error})),e.fetchers.delete(g)}else if(ye(y))U(!1,"Unhandled fetcher revalidation redirect");else if(se(y))U(!1,"Unhandled fetcher deferred data");else{let R=ue(y.data);e.fetchers.set(g,R)}}return{loaderData:s,errors:d}}function $t(e,t,r,n){let a=M({},t);for(let i of r){let o=i.route.id;if(t.hasOwnProperty(o)?t[o]!==void 0&&(a[o]=t[o]):e[o]!==void 0&&i.route.loader&&(a[o]=e[o]),n&&n.hasOwnProperty(o))break}return a}function xe(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 $e(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 K(e,t){let{pathname:r,routeId:n,method:a,type:i}=t===void 0?{}:t,o="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(o="Bad Request",a&&r&&n?l="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.":i==="defer-action"?l="defer() is not supported in actions":i==="invalid-body"&&(l="Unable to encode submission body")):e===403?(o="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):e===404?(o="Not Found",l='No route matches URL "'+r+'"'):e===405&&(o="Method Not Allowed",a&&r&&n?l="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&&(l='Invalid request method "'+a.toUpperCase()+'"')),new Ft(e||500,o,new Error(l),!0)}function Yt(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(ye(r))return{result:r,idx:t}}}function Jt(e){let t=typeof e=="string"?re(e):e;return ae(M({},t,{hash:""}))}function en(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function se(e){return e.type===I.deferred}function ge(e){return e.type===I.error}function ye(e){return(e&&e.type)===I.redirect}function tn(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 Le(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body!="undefined"}function rn(e){if(!Le(e))return!1;let t=e.status,r=e.headers.get("Location");return t>=300&&t<=399&&r!=null}function nn(e){return e&&Le(e.response)&&(e.type===I.data||e.type===I.error)}function lt(e){return Yr.has(e.toLowerCase())}function Q(e){return Vr.has(e.toLowerCase())}async function Gt(e,t,r,n,a,i){for(let o=0;o<r.length;o++){let l=r[o],s=t[o];if(!s)continue;let d=e.find(g=>g.route.id===s.route.id),h=d!=null&&!Bt(d,s)&&(i&&i[s.route.id])!==void 0;if(se(l)&&(a||h)){let g=n[o];U(g,"Expected an AbortSignal for revalidating fetcher deferred result"),await Xt(l,g,a).then(w=>{w&&(r[o]=w||r[o])})}}}async function Xt(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:I.data,data:e.deferredData.unwrappedData}}catch(a){return{type:I.error,error:a}}return{type:I.data,data:e.deferredData.data}}}function st(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Ne(e,t){let r=typeof t=="string"?re(t).search:t.search;if(e[e.length-1].route.index&&st(r||""))return e[e.length-1];let n=Ct(e);return n[n.length-1]}function Qt(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:i,json:o}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(i!=null)return{formMethod:t,formAction:r,formEncType:n,formData:i,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:o,text:void 0}}}function ut(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 an(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 je(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 on(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 ue(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 ln(e,t){try{let r=e.sessionStorage.getItem(jt);if(r){let n=JSON.parse(r);for(let[a,i]of Object.entries(n||{}))i&&Array.isArray(i)&&t.set(a,new Set(i||[]))}}catch{}}function sn(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(jt,JSON.stringify(r))}catch(n){te(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/**
12
- * React Router DOM v6.18.0
13
- *
14
- * Copyright (c) Remix Software Inc.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE.md file in the root directory of this source tree.
18
- *
19
- * @license MIT
20
- */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)}function un(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}const ct="get",dt="application/x-www-form-urlencoded";function Ye(e){return e!=null&&typeof e.tagName=="string"}function cn(e){return Ye(e)&&e.tagName.toLowerCase()==="button"}function dn(e){return Ye(e)&&e.tagName.toLowerCase()==="form"}function fn(e){return Ye(e)&&e.tagName.toLowerCase()==="input"}function hn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function mn(e,t){return e.button===0&&(!t||t==="_self")&&!hn(e)}function ft(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function pn(e,t){let r=ft(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(i=>{r.append(a,i)})}),r}let Je=null;function gn(){if(Je===null)try{new FormData(document.createElement("form"),0),Je=!1}catch{Je=!0}return Je}const yn=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ht(e){return e!=null&&!yn.has(e)?null:e}function vn(e,t){let r,n,a,i,o;if(dn(e)){let l=e.getAttribute("action");n=l?stripBasename(l,t):null,r=e.getAttribute("method")||ct,a=ht(e.getAttribute("enctype"))||dt,i=new FormData(e)}else if(cn(e)||fn(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||l.getAttribute("action");if(n=s?stripBasename(s,t):null,r=e.getAttribute("formmethod")||l.getAttribute("method")||ct,a=ht(e.getAttribute("formenctype"))||ht(l.getAttribute("enctype"))||dt,i=new FormData(l,e),!gn()){let{name:d,type:h,value:g}=e;if(h==="image"){let w=d?d+".":"";i.append(w+"x","0"),i.append(w+"y","0")}else d&&i.append(d,g)}}else{if(Ye(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=ct,n=null,a=dt,o=e}return i&&a==="text/plain"&&(o=i,i=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:i,body:o}}const wn=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],la=null,sa=null;function ua(e,t){return createRouter({basename:t==null?void 0:t.basename,future:Z({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:createBrowserHistory({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||Zt(),routes:e,mapRouteProperties:UNSAFE_mapRouteProperties,window:t==null?void 0:t.window}).initialize()}function ca(e,t){return createRouter({basename:t==null?void 0:t.basename,future:Z({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:createHashHistory({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||Zt(),routes:e,mapRouteProperties:UNSAFE_mapRouteProperties,window:t==null?void 0:t.window}).initialize()}function Zt(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Z({},t,{errors:Rn(t.errors)})),t}function Rn(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,a]of t)if(a&&a.__type==="RouteErrorResponse")r[n]=new UNSAFE_ErrorResponseImpl(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let i=window[a.__subType];if(typeof i=="function")try{let o=new i(a.message);o.stack="",r[n]=o}catch{}}if(r[n]==null){let i=new Error(a.message);i.stack="",r[n]=i}}else r[n]=a;return r}const qt=X.createContext({isTransitioning:!1}),er=X.createContext(new Map),ce=pr["startTransition"];function bn(e){ce?ce(e):e()}class Sn{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function fa(e){let{fallbackElement:t,router:r,future:n}=e,[a,i]=React.useState(r.state),[o,l]=React.useState(),[s,d]=React.useState({isTransitioning:!1}),[h,g]=React.useState(),[w,v]=React.useState(),[y,R]=React.useState(),m=React.useRef(new Map),{v7_startTransition:S}=n||{},C=React.useCallback(E=>{S?bn(E):E()},[S]),P=React.useCallback((E,W)=>{let{deletedFetchers:k,unstable_viewTransitionOpts:G}=W;k.forEach(q=>m.current.delete(q)),E.fetchers.forEach((q,oe)=>{q.data!==void 0&&m.current.set(oe,q.data)}),!G||r.window==null||typeof r.window.document.startViewTransition!="function"?C(()=>i(E)):w&&h?(h.resolve(),w.skipTransition(),R({state:E,currentLocation:G.currentLocation,nextLocation:G.nextLocation})):(l(E),d({isTransitioning:!0,currentLocation:G.currentLocation,nextLocation:G.nextLocation}))},[r.window,w,h,m,C]);React.useLayoutEffect(()=>r.subscribe(P),[r,P]),React.useEffect(()=>{s.isTransitioning&&g(new Sn)},[s.isTransitioning]),React.useEffect(()=>{if(h&&o&&r.window){let E=o,W=h.promise,k=r.window.document.startViewTransition(async()=>{C(()=>i(E)),await W});k.finished.finally(()=>{g(void 0),v(void 0),l(void 0),d({isTransitioning:!1})}),v(k)}},[C,o,h,r.window]),React.useEffect(()=>{h&&o&&a.location.key===o.location.key&&h.resolve()},[h,w,a.location,o]),React.useEffect(()=>{!s.isTransitioning&&y&&(l(y.state),d({isTransitioning:!0,currentLocation:y.currentLocation,nextLocation:y.nextLocation}),R(void 0))},[s.isTransitioning,y]);let u=React.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:E=>r.navigate(E),push:(E,W,k)=>r.navigate(E,{state:W,preventScrollReset:k==null?void 0:k.preventScrollReset}),replace:(E,W,k)=>r.navigate(E,{replace:!0,state:W,preventScrollReset:k==null?void 0:k.preventScrollReset})}),[r]),A=r.basename||"/",B=React.useMemo(()=>({router:r,navigator:u,static:!1,basename:A}),[r,u,A]);return React.createElement(React.Fragment,null,React.createElement(UNSAFE_DataRouterContext.Provider,{value:B},React.createElement(UNSAFE_DataRouterStateContext.Provider,{value:a},React.createElement(er.Provider,{value:m.current},React.createElement(qt.Provider,{value:s},React.createElement(Router,{basename:A,location:a.location,navigationType:a.historyAction,navigator:u},a.initialized?React.createElement(En,{routes:r.routes,state:a}):t))))),null)}function En(e){let{routes:t,state:r}=e;return UNSAFE_useRoutesImpl(t,void 0,r)}function Pn(e){let{basename:t,children:r,future:n,window:a}=e,i=X.useRef();i.current==null&&(i.current=gr({window:a,v5Compat:!0}));let o=i.current,[l,s]=X.useState({action:o.action,location:o.location}),{v7_startTransition:d}=n||{},h=X.useCallback(g=>{d&&ce?ce(()=>s(g)):s(g)},[s,d]);return X.useLayoutEffect(()=>o.listen(h),[o,h]),X.createElement(Pe.F0,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:o})}function ha(e){let{basename:t,children:r,future:n,window:a}=e,i=React.useRef();i.current==null&&(i.current=createHashHistory({window:a,v5Compat:!0}));let o=i.current,[l,s]=React.useState({action:o.action,location:o.location}),{v7_startTransition:d}=n||{},h=React.useCallback(g=>{d&&ce?ce(()=>s(g)):s(g)},[s,d]);return React.useLayoutEffect(()=>o.listen(h),[o,h]),React.createElement(Router,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:o})}function ma(e){let{basename:t,children:r,future:n,history:a}=e,[i,o]=React.useState({action:a.action,location:a.location}),{v7_startTransition:l}=n||{},s=React.useCallback(d=>{l&&ce?ce(()=>o(d)):o(d)},[o,l]);return React.useLayoutEffect(()=>a.listen(s),[a,s]),React.createElement(Router,{basename:t,children:r,location:i.location,navigationType:i.action,navigator:a})}const xn=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",Ln=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Dn=X.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:i,replace:o,state:l,target:s,to:d,preventScrollReset:h,unstable_viewTransition:g}=t,w=un(t,wn),{basename:v}=X.useContext(Pe.Us),y,R=!1;if(typeof d=="string"&&Ln.test(d)&&(y=d,xn))try{let P=new URL(window.location.href),u=d.startsWith("//")?new URL(P.protocol+d):new URL(d),A=Fe(u.pathname,v);u.origin===P.origin&&A!=null?d=A+u.search+u.hash:R=!0}catch{}let m=(0,Pe.oQ)(d,{relative:a}),S=Cn(d,{replace:o,state:l,target:s,preventScrollReset:h,relative:a,unstable_viewTransition:g});function C(P){n&&n(P),P.defaultPrevented||S(P)}return X.createElement("a",Z({},w,{href:y||m,onClick:R||i?n:C,ref:r,target:s}))}),pa=null,Tn=null;function ga(e){let{getKey:t,storageKey:r}=e;return Mn({getKey:t,storageKey:r}),null}var De;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(De||(De={}));var Oe;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Oe||(Oe={}));function ya(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function Ge(e){let t=React.useContext(UNSAFE_DataRouterContext);return t||UNSAFE_invariant(!1),t}function mt(e){let t=React.useContext(UNSAFE_DataRouterStateContext);return t||UNSAFE_invariant(!1),t}function Cn(e,t){let{target:r,replace:n,state:a,preventScrollReset:i,relative:o,unstable_viewTransition:l}=t===void 0?{}:t,s=(0,Pe.s0)(),d=(0,Pe.TH)(),h=(0,Pe.WU)(e,{relative:o});return X.useCallback(g=>{if(mn(g,r)){g.preventDefault();let w=n!==void 0?n:(0,St.Ep)(d)===(0,St.Ep)(h);s(e,{replace:w,state:a,preventScrollReset:i,relative:o,unstable_viewTransition:l})}},[d,s,h,n,a,r,e,i,o,l])}function va(e){let t=React.useRef(ft(e)),r=React.useRef(!1),n=useLocation(),a=React.useMemo(()=>pn(n.search,r.current?null:t.current),[n.search]),i=useNavigate(),o=React.useCallback((l,s)=>{const d=ft(typeof l=="function"?l(a):l);r.current=!0,i("?"+d,s)},[i,a]);return[a,o]}function An(){if(typeof document=="undefined")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let Fn=0,tr=()=>"__"+String(++Fn)+"__";function _n(){let{router:e}=Ge(De.UseSubmit),{basename:t}=React.useContext(UNSAFE_NavigationContext),r=UNSAFE_useRouteId();return React.useCallback(function(n,a){a===void 0&&(a={}),An();let{action:i,method:o,encType:l,formData:s,body:d}=vn(n,t);if(a.navigate===!1){let h=a.fetcherKey||tr();e.fetch(h,r,a.action||i,{preventScrollReset:a.preventScrollReset,formData:s,body:d,formMethod:a.method||o,formEncType:a.encType||l})}else e.navigate(a.action||i,{preventScrollReset:a.preventScrollReset,formData:s,body:d,formMethod:a.method||o,formEncType:a.encType||l,replace:a.replace,state:a.state,fromRouteId:r,unstable_viewTransition:a.unstable_viewTransition})},[e,t,r])}function wa(e,t){let{relative:r}=t===void 0?{}:t,{basename:n}=React.useContext(UNSAFE_NavigationContext),a=React.useContext(UNSAFE_RouteContext);a||UNSAFE_invariant(!1);let[i]=a.matches.slice(-1),o=Z({},useResolvedPath(e||".",{relative:r})),l=useLocation();if(e==null&&(o.search=l.search,i.route.index)){let s=new URLSearchParams(o.search);s.delete("index"),o.search=s.toString()?"?"+s.toString():""}return(!e||e===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:joinPaths([n,o.pathname])),createPath(o)}function Ra(e){var t;let{key:r}=e===void 0?{}:e,{router:n}=Ge(De.UseFetcher),a=mt(Oe.UseFetcher),i=React.useContext(er),o=React.useContext(UNSAFE_RouteContext),l=(t=o.matches[o.matches.length-1])==null?void 0:t.route.id;i||UNSAFE_invariant(!1),o||UNSAFE_invariant(!1),l==null&&UNSAFE_invariant(!1);let[s,d]=React.useState(r||"");s||d(tr()),React.useEffect(()=>(n.getFetcher(s),()=>{n.deleteFetcher(s)}),[n,s]);let h=React.useCallback(S=>{l||UNSAFE_invariant(!1),n.fetch(s,l,S)},[s,l,n]),g=_n(),w=React.useCallback((S,C)=>{g(S,Z({},C,{navigate:!1,fetcherKey:s}))},[s,g]),v=React.useMemo(()=>React.forwardRef((C,P)=>React.createElement(Tn,Z({},C,{navigate:!1,fetcherKey:s,ref:P}))),[s]),y=a.fetchers.get(s)||IDLE_FETCHER,R=i.get(s);return React.useMemo(()=>Z({Form:v,submit:w,load:h},y,{data:R}),[v,w,h,y,R])}function ba(){let e=mt(Oe.UseFetchers);return Array.from(e.fetchers.entries()).map(t=>{let[r,n]=t;return Z({},n,{key:r})})}const rr="react-router-scroll-positions";let Xe={};function Mn(e){let{getKey:t,storageKey:r}=e===void 0?{}:e,{router:n}=Ge(De.UseScrollRestoration),{restoreScrollPosition:a,preventScrollReset:i}=mt(Oe.UseScrollRestoration),{basename:o}=React.useContext(UNSAFE_NavigationContext),l=useLocation(),s=useMatches(),d=useNavigation();React.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),Un(React.useCallback(()=>{if(d.state==="idle"){let h=(t?t(l,s):null)||l.key;Xe[h]=window.scrollY}try{sessionStorage.setItem(r||rr,JSON.stringify(Xe))}catch{}window.history.scrollRestoration="auto"},[r,t,d.state,l,s])),typeof document!="undefined"&&(React.useLayoutEffect(()=>{try{let h=sessionStorage.getItem(r||rr);h&&(Xe=JSON.parse(h))}catch{}},[r]),React.useLayoutEffect(()=>{let h=t&&o!=="/"?(w,v)=>t(Z({},w,{pathname:stripBasename(w.pathname,o)||w.pathname}),v):t,g=n==null?void 0:n.enableScrollRestoration(Xe,()=>window.scrollY,h);return()=>g&&g()},[n,o,t]),React.useLayoutEffect(()=>{if(a!==!1){if(typeof a=="number"){window.scrollTo(0,a);return}if(l.hash){let h=document.getElementById(decodeURIComponent(l.hash.slice(1)));if(h){h.scrollIntoView();return}}i!==!0&&window.scrollTo(0,0)}},[l,a,i]))}function Sa(e,t){let{capture:r}=t||{};React.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("beforeunload",e,n),()=>{window.removeEventListener("beforeunload",e,n)}},[e,r])}function Un(e,t){let{capture:r}=t||{};React.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}function Ea(e){let{when:t,message:r}=e,n=unstable_useBlocker(t);React.useEffect(()=>{n.state==="blocked"&&(window.confirm(r)?setTimeout(n.proceed,0):n.reset())},[n,r]),React.useEffect(()=>{n.state==="blocked"&&!t&&n.reset()},[n,t])}function Pa(e,t){t===void 0&&(t={});let r=React.useContext(qt);r==null&&UNSAFE_invariant(!1);let{basename:n}=Ge(De.useViewTransitionState),a=useResolvedPath(e,{relative:t.relative});if(!r.isTransitioning)return!1;let i=stripBasename(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=stripBasename(r.nextLocation.pathname,n)||r.nextLocation.pathname;return matchPath(a.pathname,o)!=null||matchPath(a.pathname,i)!=null}}}]);})();
21
-
22
- //# sourceMappingURL=module-react-router-dom.9e5a6865.js.map