@zzusp/ccsm 1.0.0 → 1.0.2
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/LICENSE +21 -21
- package/README.md +236 -232
- package/dist/assets/DiskUsage-BY6XwffG.js +2 -0
- package/dist/assets/DiskUsage-BY6XwffG.js.map +1 -0
- package/dist/assets/{ImportPage-b8NORa8b.js → ImportPage-Cwq5bx7G.js} +2 -2
- package/dist/assets/ImportPage-Cwq5bx7G.js.map +1 -0
- package/dist/assets/MarkdownContent-BFu7Nkk_.js +2 -0
- package/dist/assets/MarkdownContent-BFu7Nkk_.js.map +1 -0
- package/dist/assets/{ProjectMemory-aSV8UzQ9.js → ProjectMemory-CcE3KbUK.js} +2 -2
- package/dist/assets/ProjectMemory-CcE3KbUK.js.map +1 -0
- package/dist/assets/{charts-A5eNHLjX.js → charts-jxJqXXUr.js} +2 -2
- package/dist/assets/{charts-A5eNHLjX.js.map → charts-jxJqXXUr.js.map} +1 -1
- package/dist/assets/index-CrWxV6sb.css +1 -0
- package/dist/assets/index-DTbWl1jb.js +11 -0
- package/dist/assets/index-DTbWl1jb.js.map +1 -0
- package/dist/assets/markdown-Bag5rX3T.js +30 -0
- package/dist/assets/markdown-Bag5rX3T.js.map +1 -0
- package/dist/assets/{query-C1K1uQRu.js → query-CS7JQ86v.js} +2 -2
- package/dist/assets/{query-C1K1uQRu.js.map → query-CS7JQ86v.js.map} +1 -1
- package/dist/assets/{react-W0jzChlo.js → react-CPkiFScu.js} +10 -10
- package/dist/assets/{react-W0jzChlo.js.map → react-CPkiFScu.js.map} +1 -1
- package/dist/assets/{router-DfbutHY3.js → router-DwaHAh1G.js} +2 -2
- package/dist/assets/{router-DfbutHY3.js.map → router-DwaHAh1G.js.map} +1 -1
- package/dist/assets/vendor-Cs8vYp-N.js +27 -0
- package/dist/assets/vendor-Cs8vYp-N.js.map +1 -0
- package/dist/favicon.svg +7 -7
- package/dist/index.html +30 -30
- package/package.json +24 -11
- package/server/index.ts +4 -0
- package/server/lib/active-sessions.test.ts +119 -0
- package/server/lib/active-sessions.ts +95 -95
- package/server/lib/bundle.test.ts +182 -0
- package/server/lib/bundle.ts +86 -86
- package/server/lib/claude-paths.test.ts +126 -0
- package/server/lib/claude-paths.ts +43 -36
- package/server/lib/cleanup-suggestions.ts +131 -0
- package/server/lib/constants.ts +8 -7
- package/server/lib/delete-project.ts +100 -100
- package/server/lib/delete.test.ts +244 -0
- package/server/lib/delete.ts +192 -203
- package/server/lib/disk-usage.ts +81 -83
- package/server/lib/encode-cwd.ts +24 -24
- package/server/lib/export-bundle.ts +236 -236
- package/server/lib/export-import-bundle.test.ts +337 -0
- package/server/lib/fs-size.ts +38 -38
- package/server/lib/import-bundle.ts +488 -488
- package/server/lib/load-memory.ts +120 -120
- package/server/lib/load-session.ts +209 -209
- package/server/lib/modified-files.test.ts +280 -0
- package/server/lib/modified-files.ts +228 -0
- package/server/lib/open-folder.ts +47 -40
- package/server/lib/parse-jsonl.ts +160 -107
- package/server/lib/port.ts +23 -23
- package/server/lib/safe-id.test.ts +41 -0
- package/server/lib/safe-id.ts +6 -6
- package/server/lib/safe-remove.test.ts +73 -0
- package/server/lib/safe-remove.ts +25 -0
- package/server/lib/scan.ts +289 -183
- package/server/lib/search-all.ts +130 -130
- package/server/lib/search-session.ts +203 -203
- package/server/lib/system-tags.ts +20 -20
- package/server/lib/update.ts +67 -0
- package/server/lib/version.test.ts +39 -0
- package/server/lib/version.ts +117 -0
- package/server/routes/disk-cleanup.ts +54 -0
- package/server/routes/disk.ts +9 -9
- package/server/routes/import.ts +87 -87
- package/server/routes/projects.ts +104 -104
- package/server/routes/search.ts +79 -79
- package/server/routes/sessions.ts +130 -81
- package/server/routes/version.ts +34 -0
- package/server/types.ts +1 -1
- package/shared/constants.ts +7 -2
- package/shared/types.ts +513 -359
- package/dist/assets/DiskUsage-Bq4VaoUA.js +0 -2
- package/dist/assets/DiskUsage-Bq4VaoUA.js.map +0 -1
- package/dist/assets/ImportPage-b8NORa8b.js.map +0 -1
- package/dist/assets/ProjectMemory-aSV8UzQ9.js.map +0 -1
- package/dist/assets/index-DLATR3tZ.js +0 -5
- package/dist/assets/index-DLATR3tZ.js.map +0 -1
- package/dist/assets/index-DLDtbkux.css +0 -1
- package/dist/assets/vendor-CH80ylbS.js +0 -19
- package/dist/assets/vendor-CH80ylbS.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as i}from"./react-
|
|
1
|
+
import{r as i}from"./react-CPkiFScu.js";/**
|
|
2
2
|
* react-router v7.14.2
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
@@ -10,4 +10,4 @@ import{r as i}from"./react-W0jzChlo.js";/**
|
|
|
10
10
|
*/var he="popstate";function de(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function He(e={}){function t(n,a){var c;let o=(c=a.state)==null?void 0:c.masked,{pathname:l,search:s,hash:u}=o||n.location;return Z("",{pathname:l,search:s,hash:u},a.state&&a.state.usr||null,a.state&&a.state.key||"default",o?{pathname:n.location.pathname,search:n.location.search,hash:n.location.hash}:void 0)}function r(n,a){return typeof a=="string"?a:B(a)}return ze(t,r,null,e)}function E(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function P(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function je(){return Math.random().toString(36).substring(2,10)}function me(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Z(e,t,r=null,n,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?_(t):t,state:r,key:t&&t.key||n||je(),unstable_mask:a}}function B({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function _(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function ze(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,l=a.history,s="POP",u=null,c=h();c==null&&(c=0,l.replaceState({...l.state,idx:c},""));function h(){return(l.state||{idx:null}).idx}function f(){s="POP";let p=h(),d=p==null?null:p-c;c=p,u&&u({action:s,location:y.location,delta:d})}function m(p,d){s="PUSH";let R=de(p)?p:Z(y.location,p,d);c=h()+1;let w=me(R,c),C=y.createHref(R.unstable_mask||R);try{l.pushState(w,"",C)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;a.location.assign(C)}o&&u&&u({action:s,location:y.location,delta:1})}function g(p,d){s="REPLACE";let R=de(p)?p:Z(y.location,p,d);c=h();let w=me(R,c),C=y.createHref(R.unstable_mask||R);l.replaceState(w,"",C),o&&u&&u({action:s,location:y.location,delta:0})}function v(p){return Ve(p)}let y={get action(){return s},get location(){return e(a,l)},listen(p){if(u)throw new Error("A history only accepts one active listener");return a.addEventListener(he,f),u=p,()=>{a.removeEventListener(he,f),u=null}},createHref(p){return t(a,p)},createURL:v,encodeLocation(p){let d=v(p);return{pathname:d.pathname,search:d.search,hash:d.hash}},push:m,replace:g,go(p){return l.go(p)}};return y}function Ve(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),E(r,"No window.location.(origin|href) available to create URL");let n=typeof e=="string"?e:B(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}function Re(e,t,r="/"){return Je(e,t,r,!1)}function Je(e,t,r,n){let a=typeof t=="string"?_(t):t,o=T(a.pathname||"/",r);if(o==null)return null;let l=we(e);Ke(l);let s=null;for(let u=0;s==null&&u<l.length;++u){let c=at(o);s=rt(l[u],c,n)}return s}function we(e,t=[],r=[],n="",a=!1){let o=(l,s,u=a,c)=>{let h={relativePath:c===void 0?l.path||"":c,caseSensitive:l.caseSensitive===!0,childrenIndex:s,route:l};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(n)&&u)return;E(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 f=b([n,h.relativePath]),m=r.concat(h);l.children&&l.children.length>0&&(E(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),we(l.children,t,m,f,u)),!(l.path==null&&!l.index)&&t.push({path:f,score:et(f,l.index),routesMeta:m})};return e.forEach((l,s)=>{var u;if(l.path===""||!((u=l.path)!=null&&u.includes("?")))o(l,s);else for(let c of Ee(l.path))o(l,s,!0,c)}),t}function Ee(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return a?[o,""]:[o];let l=Ee(n.join("/")),s=[];return s.push(...l.map(u=>u===""?o:[o,u].join("/"))),a&&s.push(...l),s.map(u=>e.startsWith("/")&&u===""?"/":u)}function Ke(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:tt(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var Ye=/^:[\w-]+$/,qe=3,Ge=2,Xe=1,Qe=10,Ze=-2,pe=e=>e==="*";function et(e,t){let r=e.split("/"),n=r.length;return r.some(pe)&&(n+=Ze),t&&(n+=Ge),r.filter(a=>!pe(a)).reduce((a,o)=>a+(Ye.test(o)?qe:o===""?Xe:Qe),n)}function tt(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,r=!1){let{routesMeta:n}=e,a={},o="/",l=[];for(let s=0;s<n.length;++s){let u=n[s],c=s===n.length-1,h=o==="/"?t:t.slice(o.length)||"/",f=V({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},h),m=u.route;if(!f&&c&&r&&!n[n.length-1].route.index&&(f=V({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},h)),!f)return null;Object.assign(a,f.params),l.push({params:a,pathname:b([o,f.pathname]),pathnameBase:st(b([o,f.pathnameBase])),route:m}),f.pathnameBase!=="/"&&(o=b([o,f.pathnameBase]))}return l}function V(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=nt(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],l=o.replace(/(.)\/+$/,"$1"),s=a.slice(1);return{params:n.reduce((c,{paramName:h,isOptional:f},m)=>{if(h==="*"){let v=s[m]||"";l=o.slice(0,o.length-v.length).replace(/(.)\/+$/,"$1")}const g=s[m];return f&&!g?c[h]=void 0:c[h]=(g||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:l,pattern:e}}function nt(e,t=!1,r=!0){P(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,(l,s,u,c,h)=>{if(n.push({paramName:s,isOptional:u!=null}),u){let f=h.charAt(c+l.length);return f&&f!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function at(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return P(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function T(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)||"/"}var ot=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function lt(e,t="/"){let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?_(e):e,o;return r?(r=Ce(r),r.startsWith("/")?o=ye(r.substring(1),"/"):o=ye(r,t)):o=t,{pathname:o,search:ut(n),hash:ct(a)}}function ye(e,t){let r=J(t).split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function G(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 it(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function xe(e){let t=it(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function re(e,t,r,n=!1){let a;typeof e=="string"?a=_(e):(a={...e},E(!a.pathname||!a.pathname.includes("?"),G("?","pathname","search",a)),E(!a.pathname||!a.pathname.includes("#"),G("#","pathname","hash",a)),E(!a.search||!a.search.includes("#"),G("#","search","hash",a)));let o=e===""||a.pathname==="",l=o?"/":a.pathname,s;if(l==null)s=r;else{let f=t.length-1;if(!n&&l.startsWith("..")){let m=l.split("/");for(;m[0]==="..";)m.shift(),f-=1;a.pathname=m.join("/")}s=f>=0?t[f]:"/"}let u=lt(a,s),c=l&&l!=="/"&&l.endsWith("/"),h=(o||l===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(c||h)&&(u.pathname+="/"),u}var Ce=e=>e.replace(/\/\/+/g,"/"),b=e=>Ce(e.join("/")),J=e=>e.replace(/\/+$/,""),st=e=>J(e).replace(/^\/*/,"/"),ut=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ct=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ft=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function ht(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function dt(e){let t=e.map(r=>r.route.path).filter(Boolean);return b(t)||"/"}var Se=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function be(e,t){let r=e;if(typeof r!="string"||!ot.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,a=!1;if(Se)try{let o=new URL(window.location.href),l=r.startsWith("//")?new URL(o.protocol+r):new URL(r),s=T(l.pathname,t);l.origin===o.origin&&s!=null?r=s+l.search+l.hash:a=!0}catch{P(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:a,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Pe=["POST","PUT","PATCH","DELETE"];new Set(Pe);var mt=["GET",...Pe];new Set(mt);var N=i.createContext(null);N.displayName="DataRouter";var K=i.createContext(null);K.displayName="DataRouterState";var Le=i.createContext(!1);function pt(){return i.useContext(Le)}var ke=i.createContext({isTransitioning:!1});ke.displayName="ViewTransition";var yt=i.createContext(new Map);yt.displayName="Fetchers";var gt=i.createContext(null);gt.displayName="Await";var S=i.createContext(null);S.displayName="Navigation";var M=i.createContext(null);M.displayName="Location";var k=i.createContext({outlet:null,matches:[],isDataRoute:!1});k.displayName="Route";var ne=i.createContext(null);ne.displayName="RouteError";var $e="REACT_ROUTER_ERROR",vt="REDIRECT",Rt="ROUTE_ERROR_RESPONSE";function wt(e){if(e.startsWith(`${$e}:${vt}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function Et(e){if(e.startsWith(`${$e}:${Rt}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new ft(t.status,t.statusText,t.data)}catch{}}function xt(e,{relative:t}={}){E(O(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=i.useContext(S),{hash:a,pathname:o,search:l}=W(e,{relative:t}),s=o;return r!=="/"&&(s=o==="/"?r:b([r,o])),n.createHref({pathname:s,search:l,hash:a})}function O(){return i.useContext(M)!=null}function $(){return E(O(),"useLocation() may be used only in the context of a <Router> component."),i.useContext(M).location}var Te="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Fe(e){i.useContext(S).static||i.useLayoutEffect(e)}function De(){let{isDataRoute:e}=i.useContext(k);return e?Nt():Ct()}function Ct(){E(O(),"useNavigate() may be used only in the context of a <Router> component.");let e=i.useContext(N),{basename:t,navigator:r}=i.useContext(S),{matches:n}=i.useContext(k),{pathname:a}=$(),o=JSON.stringify(xe(n)),l=i.useRef(!1);return Fe(()=>{l.current=!0}),i.useCallback((u,c={})=>{if(P(l.current,Te),!l.current)return;if(typeof u=="number"){r.go(u);return}let h=re(u,JSON.parse(o),a,c.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:b([t,h.pathname])),(c.replace?r.replace:r.push)(h,c.state,c)},[t,r,o,a,e])}i.createContext(null);function Rr(){let{matches:e}=i.useContext(k),t=e[e.length-1];return(t==null?void 0:t.params)??{}}function W(e,{relative:t}={}){let{matches:r}=i.useContext(k),{pathname:n}=$(),a=JSON.stringify(xe(r));return i.useMemo(()=>re(e,JSON.parse(a),n,t==="path"),[e,a,n,t])}function St(e,t){return Ie(e,t)}function Ie(e,t,r){var p;E(O(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=i.useContext(S),{matches:a}=i.useContext(k),o=a[a.length-1],l=o?o.params:{},s=o?o.pathname:"/",u=o?o.pathnameBase:"/",c=o&&o.route;{let d=c&&c.path||"";Ne(s,!c||d.endsWith("*")||d.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${d}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
11
11
|
|
|
12
12
|
Please change the parent <Route path="${d}"> to <Route path="${d==="/"?"*":`${d}/*`}">.`)}let h=$(),f;if(t){let d=typeof t=="string"?_(t):t;E(u==="/"||((p=d.pathname)==null?void 0:p.startsWith(u)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${d.pathname}" was given in the \`location\` prop.`),f=d}else f=h;let m=f.pathname||"/",g=m;if(u!=="/"){let d=u.replace(/^\//,"").split("/");g="/"+m.replace(/^\//,"").split("/").slice(d.length).join("/")}let v=Re(e,{pathname:g});P(c||v!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),P(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let y=$t(v&&v.map(d=>Object.assign({},d,{params:Object.assign({},l,d.params),pathname:b([u,n.encodeLocation?n.encodeLocation(d.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:d.pathname]),pathnameBase:d.pathnameBase==="/"?u:b([u,n.encodeLocation?n.encodeLocation(d.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:d.pathnameBase])})),a,r);return t&&y?i.createElement(M.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...f},navigationType:"POP"}},y):y}function bt(){let e=_t(),t=ht(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},o={padding:"2px 4px",backgroundColor:n},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=i.createElement(i.Fragment,null,i.createElement("p",null,"💿 Hey developer 👋"),i.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",i.createElement("code",{style:o},"ErrorBoundary")," or"," ",i.createElement("code",{style:o},"errorElement")," prop on your route.")),i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},t),r?i.createElement("pre",{style:a},r):null,l)}var Pt=i.createElement(bt,null),_e=class extends i.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=Et(e.digest);r&&(e=r)}let t=e!==void 0?i.createElement(k.Provider,{value:this.props.routeContext},i.createElement(ne.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?i.createElement(Lt,{error:e},t):t}};_e.contextType=Le;var X=new WeakMap;function Lt({children:e,error:t}){let{basename:r}=i.useContext(S);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=wt(t.digest);if(n){let a=X.get(t);if(a)throw a;let o=be(n.location,r);if(Se&&!X.get(t))if(o.isExternal||n.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:n.replace}));throw X.set(t,l),l}return i.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function kt({routeContext:e,match:t,children:r}){let n=i.useContext(N);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(k.Provider,{value:e},r)}function $t(e,t=[],r){let n=r==null?void 0:r.state;if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n==null?void 0:n.errors;if(o!=null){let h=a.findIndex(f=>f.route.id&&(o==null?void 0:o[f.route.id])!==void 0);E(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),a=a.slice(0,Math.min(a.length,h+1))}let l=!1,s=-1;if(r&&n){l=n.renderFallback;for(let h=0;h<a.length;h++){let f=a[h];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(s=h),f.route.id){let{loaderData:m,errors:g}=n,v=f.route.loader&&!m.hasOwnProperty(f.route.id)&&(!g||g[f.route.id]===void 0);if(f.route.lazy||v){r.isStatic&&(l=!0),s>=0?a=a.slice(0,s+1):a=[a[0]];break}}}}let u=r==null?void 0:r.onError,c=n&&u?(h,f)=>{var m,g;u(h,{location:n.location,params:((g=(m=n.matches)==null?void 0:m[0])==null?void 0:g.params)??{},unstable_pattern:dt(n.matches),errorInfo:f})}:void 0;return a.reduceRight((h,f,m)=>{let g,v=!1,y=null,p=null;n&&(g=o&&f.route.id?o[f.route.id]:void 0,y=f.route.errorElement||Pt,l&&(s<0&&m===0?(Ne("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,p=null):s===m&&(v=!0,p=f.route.hydrateFallbackElement||null)));let d=t.concat(a.slice(0,m+1)),R=()=>{let w;return g?w=y:v?w=p:f.route.Component?w=i.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=h,i.createElement(kt,{match:f,routeContext:{outlet:h,matches:d,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||m===0)?i.createElement(_e,{location:n.location,revalidation:n.revalidation,component:y,error:g,children:R(),routeContext:{outlet:null,matches:d,isDataRoute:!0},onError:c}):R()},null)}function ae(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Tt(e){let t=i.useContext(N);return E(t,ae(e)),t}function Ft(e){let t=i.useContext(K);return E(t,ae(e)),t}function Dt(e){let t=i.useContext(k);return E(t,ae(e)),t}function oe(e){let t=Dt(e),r=t.matches[t.matches.length-1];return E(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function It(){return oe("useRouteId")}function _t(){var n;let e=i.useContext(ne),t=Ft("useRouteError"),r=oe("useRouteError");return e!==void 0?e:(n=t.errors)==null?void 0:n[r]}function Nt(){let{router:e}=Tt("useNavigate"),t=oe("useNavigate"),r=i.useRef(!1);return Fe(()=>{r.current=!0}),i.useCallback(async(a,o={})=>{P(r.current,Te),r.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var ge={};function Ne(e,t,r){!t&&!ge[e]&&(ge[e]=!0,P(!1,r))}i.memo(At);function At({routes:e,future:t,state:r,isStatic:n,onError:a}){return Ie(e,void 0,{state:r,isStatic:n,onError:a})}function Ut(e){E(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Bt({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:o=!1,unstable_useTransitions:l}){E(!O(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),u=i.useMemo(()=>({basename:s,navigator:a,static:o,unstable_useTransitions:l,future:{}}),[s,a,o,l]);typeof r=="string"&&(r=_(r));let{pathname:c="/",search:h="",hash:f="",state:m=null,key:g="default",unstable_mask:v}=r,y=i.useMemo(()=>{let p=T(c,s);return p==null?null:{location:{pathname:p,search:h,hash:f,state:m,key:g,unstable_mask:v},navigationType:n}},[s,c,h,f,m,g,n,v]);return P(y!=null,`<Router basename="${s}"> is not able to match the URL "${c}${h}${f}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:i.createElement(S.Provider,{value:u},i.createElement(M.Provider,{children:t,value:y}))}function wr({children:e,location:t}){return St(ee(e),t)}function ee(e,t=[]){let r=[];return i.Children.forEach(e,(n,a)=>{if(!i.isValidElement(n))return;let o=[...t,a];if(n.type===i.Fragment){r.push.apply(r,ee(n.props.children,o));return}E(n.type===Ut,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),E(!n.props.index||!n.props.children,"An index route cannot have child routes.");let l={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(l.children=ee(n.props.children,o)),r.push(l)}),r}var j="get",z="application/x-www-form-urlencoded";function Y(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Mt(e){return Y(e)&&e.tagName.toLowerCase()==="button"}function Ot(e){return Y(e)&&e.tagName.toLowerCase()==="form"}function Wt(e){return Y(e)&&e.tagName.toLowerCase()==="input"}function Ht(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function jt(e,t){return e.button===0&&(!t||t==="_self")&&!Ht(e)}function te(e=""){return 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 zt(e,t){let r=te(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(o=>{r.append(a,o)})}),r}var H=null;function Vt(){if(H===null)try{new FormData(document.createElement("form"),0),H=!1}catch{H=!0}return H}var Jt=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Q(e){return e!=null&&!Jt.has(e)?(P(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${z}"`),null):e}function Kt(e,t){let r,n,a,o,l;if(Ot(e)){let s=e.getAttribute("action");n=s?T(s,t):null,r=e.getAttribute("method")||j,a=Q(e.getAttribute("enctype"))||z,o=new FormData(e)}else if(Mt(e)||Wt(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||s.getAttribute("action");if(n=u?T(u,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||j,a=Q(e.getAttribute("formenctype"))||Q(s.getAttribute("enctype"))||z,o=new FormData(s,e),!Vt()){let{name:c,type:h,value:f}=e;if(h==="image"){let m=c?`${c}.`:"";o.append(`${m}x`,"0"),o.append(`${m}y`,"0")}else c&&o.append(c,f)}}else{if(Y(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=j,n=null,a=z,l=e}return o&&a==="text/plain"&&(l=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function le(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ae(e,t,r,n){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${n}`:a.pathname=`${a.pathname}.${n}`:a.pathname==="/"?a.pathname=`_root.${n}`:t&&T(a.pathname,t)==="/"?a.pathname=`${J(t)}/_root.${n}`:a.pathname=`${J(a.pathname)}.${n}`,a}async function Yt(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function qt(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Gt(e,t,r){let n=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let l=await Yt(o,r);return l.links?l.links():[]}return[]}));return er(n.flat(1).filter(qt).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function ve(e,t,r,n,a,o){let l=(u,c)=>r[c]?u.route.id!==r[c].route.id:!0,s=(u,c)=>{var h;return r[c].pathname!==u.pathname||((h=r[c].route.path)==null?void 0:h.endsWith("*"))&&r[c].params["*"]!==u.params["*"]};return o==="assets"?t.filter((u,c)=>l(u,c)||s(u,c)):o==="data"?t.filter((u,c)=>{var f;let h=n.routes[u.route.id];if(!h||!h.hasLoader)return!1;if(l(u,c)||s(u,c))return!0;if(u.route.shouldRevalidate){let m=u.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((f=r[0])==null?void 0:f.params)||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function Xt(e,t,{includeHydrateFallback:r}={}){return Qt(e.map(n=>{let a=t.routes[n.route.id];if(!a)return[];let o=[a.module];return a.clientActionModule&&(o=o.concat(a.clientActionModule)),a.clientLoaderModule&&(o=o.concat(a.clientLoaderModule)),r&&a.hydrateFallbackModule&&(o=o.concat(a.hydrateFallbackModule)),a.imports&&(o=o.concat(a.imports)),o}).flat(1))}function Qt(e){return[...new Set(e)]}function Zt(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function er(e,t){let r=new Set;return new Set(t),e.reduce((n,a)=>{let o=JSON.stringify(Zt(a));return r.has(o)||(r.add(o),n.push({key:o,link:a})),n},[])}function ie(){let e=i.useContext(N);return le(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function tr(){let e=i.useContext(K);return le(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var se=i.createContext(void 0);se.displayName="FrameworkContext";function ue(){let e=i.useContext(se);return le(e,"You must render this element inside a <HydratedRouter> element"),e}function rr(e,t){let r=i.useContext(se),[n,a]=i.useState(!1),[o,l]=i.useState(!1),{onFocus:s,onBlur:u,onMouseEnter:c,onMouseLeave:h,onTouchStart:f}=t,m=i.useRef(null);i.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let y=d=>{d.forEach(R=>{l(R.isIntersecting)})},p=new IntersectionObserver(y,{threshold:.5});return m.current&&p.observe(m.current),()=>{p.disconnect()}}},[e]),i.useEffect(()=>{if(n){let y=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(y)}}},[n]);let g=()=>{a(!0)},v=()=>{a(!1),l(!1)};return r?e!=="intent"?[o,m,{}]:[o,m,{onFocus:U(s,g),onBlur:U(u,v),onMouseEnter:U(c,g),onMouseLeave:U(h,v),onTouchStart:U(f,g)}]:[!1,m,{}]}function U(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function nr({page:e,...t}){let r=pt(),{router:n}=ie(),a=i.useMemo(()=>Re(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?r?i.createElement(or,{page:e,matches:a,...t}):i.createElement(lr,{page:e,matches:a,...t}):null}function ar(e){let{manifest:t,routeModules:r}=ue(),[n,a]=i.useState([]);return i.useEffect(()=>{let o=!1;return Gt(e,t,r).then(l=>{o||a(l)}),()=>{o=!0}},[e,t,r]),n}function or({page:e,matches:t,...r}){let n=$(),{future:a}=ue(),{basename:o}=ie(),l=i.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let s=Ae(e,o,a.unstable_trailingSlashAwareDataRequests,"rsc"),u=!1,c=[];for(let h of t)typeof h.route.shouldRevalidate=="function"?u=!0:c.push(h.route.id);return u&&c.length>0&&s.searchParams.set("_routes",c.join(",")),[s.pathname+s.search]},[o,a.unstable_trailingSlashAwareDataRequests,e,n,t]);return i.createElement(i.Fragment,null,l.map(s=>i.createElement("link",{key:s,rel:"prefetch",as:"fetch",href:s,...r})))}function lr({page:e,matches:t,...r}){let n=$(),{future:a,manifest:o,routeModules:l}=ue(),{basename:s}=ie(),{loaderData:u,matches:c}=tr(),h=i.useMemo(()=>ve(e,t,c,o,n,"data"),[e,t,c,o,n]),f=i.useMemo(()=>ve(e,t,c,o,n,"assets"),[e,t,c,o,n]),m=i.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let y=new Set,p=!1;if(t.forEach(R=>{var C;let w=o.routes[R.route.id];!w||!w.hasLoader||(!h.some(x=>x.route.id===R.route.id)&&R.route.id in u&&((C=l[R.route.id])!=null&&C.shouldRevalidate)||w.hasClientLoader?p=!0:y.add(R.route.id))}),y.size===0)return[];let d=Ae(e,s,a.unstable_trailingSlashAwareDataRequests,"data");return p&&y.size>0&&d.searchParams.set("_routes",t.filter(R=>y.has(R.route.id)).map(R=>R.route.id).join(",")),[d.pathname+d.search]},[s,a.unstable_trailingSlashAwareDataRequests,u,n,o,h,t,e,l]),g=i.useMemo(()=>Xt(f,o),[f,o]),v=ar(f);return i.createElement(i.Fragment,null,m.map(y=>i.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...r})),g.map(y=>i.createElement("link",{key:y,rel:"modulepreload",href:y,...r})),v.map(({key:y,link:p})=>i.createElement("link",{key:y,nonce:r.nonce,...p,crossOrigin:p.crossOrigin??r.crossOrigin})))}function ir(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var sr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{sr&&(window.__reactRouterVersion="7.14.2")}catch{}function Er({basename:e,children:t,unstable_useTransitions:r,window:n}){let a=i.useRef();a.current==null&&(a.current=He({window:n,v5Compat:!0}));let o=a.current,[l,s]=i.useState({action:o.action,location:o.location}),u=i.useCallback(c=>{r===!1?s(c):i.startTransition(()=>s(c))},[r]);return i.useLayoutEffect(()=>o.listen(u),[o,u]),i.createElement(Bt,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:o,unstable_useTransitions:r})}var Ue=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Be=i.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:a,reloadDocument:o,replace:l,unstable_mask:s,state:u,target:c,to:h,preventScrollReset:f,viewTransition:m,unstable_defaultShouldRevalidate:g,...v},y){let{basename:p,navigator:d,unstable_useTransitions:R}=i.useContext(S),w=typeof h=="string"&&Ue.test(h),C=be(h,p);h=C.to;let x=xt(h,{relative:a}),L=$(),F=null;if(s){let D=re(s,[],L.unstable_mask?L.unstable_mask.pathname:"/",!0);p!=="/"&&(D.pathname=D.pathname==="/"?p:b([p,D.pathname])),F=d.createHref(D)}let[I,A,q]=rr(n,v),Oe=hr(h,{replace:l,unstable_mask:s,state:u,target:c,preventScrollReset:f,relative:a,viewTransition:m,unstable_defaultShouldRevalidate:g,unstable_useTransitions:R});function We(D){t&&t(D),D.defaultPrevented||Oe(D)}let ce=!(C.isExternal||o),fe=i.createElement("a",{...v,...q,href:(ce?F:void 0)||C.absoluteURL||x,onClick:ce?We:t,ref:ir(y,A),target:c,"data-discover":!w&&r==="render"?"true":void 0});return I&&!w?i.createElement(i.Fragment,null,fe,i.createElement(nr,{page:x})):fe});Be.displayName="Link";var ur=i.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:a=!1,style:o,to:l,viewTransition:s,children:u,...c},h){let f=W(l,{relative:c.relative}),m=$(),g=i.useContext(K),{navigator:v,basename:y}=i.useContext(S),p=g!=null&&gr(f)&&s===!0,d=v.encodeLocation?v.encodeLocation(f).pathname:f.pathname,R=m.pathname,w=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;r||(R=R.toLowerCase(),w=w?w.toLowerCase():null,d=d.toLowerCase()),w&&y&&(w=T(w,y)||w);const C=d!=="/"&&d.endsWith("/")?d.length-1:d.length;let x=R===d||!a&&R.startsWith(d)&&R.charAt(C)==="/",L=w!=null&&(w===d||!a&&w.startsWith(d)&&w.charAt(d.length)==="/"),F={isActive:x,isPending:L,isTransitioning:p},I=x?t:void 0,A;typeof n=="function"?A=n(F):A=[n,x?"active":null,L?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let q=typeof o=="function"?o(F):o;return i.createElement(Be,{...c,"aria-current":I,className:A,ref:h,style:q,to:l,viewTransition:s},typeof u=="function"?u(F):u)});ur.displayName="NavLink";var cr=i.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:l=j,action:s,onSubmit:u,relative:c,preventScrollReset:h,viewTransition:f,unstable_defaultShouldRevalidate:m,...g},v)=>{let{unstable_useTransitions:y}=i.useContext(S),p=pr(),d=yr(s,{relative:c}),R=l.toLowerCase()==="get"?"get":"post",w=typeof s=="string"&&Ue.test(s),C=x=>{if(u&&u(x),x.defaultPrevented)return;x.preventDefault();let L=x.nativeEvent.submitter,F=(L==null?void 0:L.getAttribute("formmethod"))||l,I=()=>p(L||x.currentTarget,{fetcherKey:t,method:F,navigate:r,replace:a,state:o,relative:c,preventScrollReset:h,viewTransition:f,unstable_defaultShouldRevalidate:m});y&&r!==!1?i.startTransition(()=>I()):I()};return i.createElement("form",{ref:v,method:R,action:d,onSubmit:n?u:C,...g,"data-discover":!w&&e==="render"?"true":void 0})});cr.displayName="Form";function fr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Me(e){let t=i.useContext(N);return E(t,fr(e)),t}function hr(e,{target:t,replace:r,unstable_mask:n,state:a,preventScrollReset:o,relative:l,viewTransition:s,unstable_defaultShouldRevalidate:u,unstable_useTransitions:c}={}){let h=De(),f=$(),m=W(e,{relative:l});return i.useCallback(g=>{if(jt(g,t)){g.preventDefault();let v=r!==void 0?r:B(f)===B(m),y=()=>h(e,{replace:v,unstable_mask:n,state:a,preventScrollReset:o,relative:l,viewTransition:s,unstable_defaultShouldRevalidate:u});c?i.startTransition(()=>y()):y()}},[f,h,m,r,n,a,t,e,o,l,s,u,c])}function xr(e){P(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=i.useRef(te(e)),r=i.useRef(!1),n=$(),a=i.useMemo(()=>zt(n.search,r.current?null:t.current),[n.search]),o=De(),l=i.useCallback((s,u)=>{const c=te(typeof s=="function"?s(new URLSearchParams(a)):s);r.current=!0,o("?"+c,u)},[o,a]);return[a,l]}var dr=0,mr=()=>`__${String(++dr)}__`;function pr(){let{router:e}=Me("useSubmit"),{basename:t}=i.useContext(S),r=It(),n=e.fetch,a=e.navigate;return i.useCallback(async(o,l={})=>{let{action:s,method:u,encType:c,formData:h,body:f}=Kt(o,t);if(l.navigate===!1){let m=l.fetcherKey||mr();await n(m,r,l.action||s,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:h,body:f,formMethod:l.method||u,formEncType:l.encType||c,flushSync:l.flushSync})}else await a(l.action||s,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:h,body:f,formMethod:l.method||u,formEncType:l.encType||c,replace:l.replace,state:l.state,fromRouteId:r,flushSync:l.flushSync,viewTransition:l.viewTransition})},[n,a,t,r])}function yr(e,{relative:t}={}){let{basename:r}=i.useContext(S),n=i.useContext(k);E(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),o={...W(e||".",{relative:t})},l=$();if(e==null){o.search=l.search;let s=new URLSearchParams(o.search),u=s.getAll("index");if(u.some(h=>h==="")){s.delete("index"),u.filter(f=>f).forEach(f=>s.append("index",f));let h=s.toString();o.search=h?`?${h}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:b([r,o.pathname])),B(o)}function gr(e,{relative:t}={}){let r=i.useContext(ke);E(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Me("useViewTransitionState"),a=W(e,{relative:t});if(!r.isTransitioning)return!1;let o=T(r.currentLocation.pathname,n)||r.currentLocation.pathname,l=T(r.nextLocation.pathname,n)||r.nextLocation.pathname;return V(a.pathname,l)!=null||V(a.pathname,o)!=null}export{Er as B,Be as L,wr as R,$ as a,Rr as b,xr as c,Ut as d,De as u};
|
|
13
|
-
//# sourceMappingURL=router-
|
|
13
|
+
//# sourceMappingURL=router-DwaHAh1G.js.map
|