diff --git a/assets/index-88b13fc1.js b/assets/index-a5f31c04.js similarity index 96% rename from assets/index-88b13fc1.js rename to assets/index-a5f31c04.js index 2273ca6..0703c08 100644 --- a/assets/index-88b13fc1.js +++ b/assets/index-a5f31c04.js @@ -14,7 +14,7 @@ function $d(e,t){for(var n=0;n"u")throw new Error(t)}function Zt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function vm(){return Math.random().toString(36).substr(2,8)}function Fs(e,t){return{usr:e.state,key:e.key,idx:t}}function el(e,t,n,r){return n===void 0&&(n=null),oe({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?pt(t):t,{state:n,key:t&&t.key||r||vm()})}function Sn(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function pt(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function gm(e,t,n,r){r===void 0&&(r={});let{window:l=document.defaultView,v5Compat:o=!1}=r,i=l.history,u=de.Pop,a=null,s=p();s==null&&(s=0,i.replaceState(oe({},i.state,{idx:s}),""));function p(){return(i.state||{idx:null}).idx}function y(){u=de.Pop;let k=p(),d=k==null?null:k-s;s=k,a&&a({action:u,location:g.location,delta:d})}function v(k,d){u=de.Push;let f=el(g.location,k,d);n&&n(f,k),s=p()+1;let m=Fs(f,s),c=g.createHref(f);try{i.pushState(m,"",c)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;l.location.assign(c)}o&&a&&a({action:u,location:g.location,delta:1})}function E(k,d){u=de.Replace;let f=el(g.location,k,d);n&&n(f,k),s=p();let m=Fs(f,s),c=g.createHref(f);i.replaceState(m,"",c),o&&a&&a({action:u,location:g.location,delta:0})}function h(k){let d=l.location.origin!=="null"?l.location.origin:l.location.href,f=typeof k=="string"?k:Sn(k);return V(d,"No window.location.(origin|href) available to create URL for href: "+f),new URL(f,d)}let g={get action(){return u},get location(){return e(l,i)},listen(k){if(a)throw new Error("A history only accepts one active listener");return l.addEventListener(Os,y),a=k,()=>{l.removeEventListener(Os,y),a=null}},createHref(k){return t(l,k)},createURL:h,encodeLocation(k){let d=h(k);return{pathname:d.pathname,search:d.search,hash:d.hash}},push:v,replace:E,go(k){return i.go(k)}};return g}var pe;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(pe||(pe={}));const ym=new Set(["lazy","caseSensitive","path","id","index","children"]);function wm(e){return e.index===!0}function su(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((l,o)=>{let i=[...n,o],u=typeof l.id=="string"?l.id:i.join("-");if(V(l.index!==!0||!l.children,"Cannot specify children on an index route"),V(!r[u],'Found a route id collision on id "'+u+`". Route id's must be globally unique within Data Router usages`),wm(l)){let a=oe({},l,t(l),{id:u});return r[u]=a,a}else{let a=oe({},l,t(l),{id:u,children:void 0});return r[u]=a,l.children&&(a.children=su(l.children,t,i,r)),a}})}function In(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?pt(t):t,l=rr(r.pathname||"/",n);if(l==null)return null;let o=md(e);Em(o);let i=null;for(let u=0;i==null&&u{let a={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};a.relativePath.startsWith("/")&&(V(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(r.length));let s=Ct([r,a.relativePath]),p=n.concat(a);o.children&&o.children.length>0&&(V(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+s+'".')),md(o.children,t,p,s)),!(o.path==null&&!o.index)&&t.push({path:s,score:Lm(s,o.index),routesMeta:p})};return e.forEach((o,i)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))l(o,i);else for(let a of vd(o.path))l(o,i,a)}),t}function vd(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return l?[o,""]:[o];let i=vd(r.join("/")),u=[];return u.push(...i.map(a=>a===""?o:[o,a].join("/"))),l&&u.push(...i),u.map(a=>e.startsWith("/")&&a===""?"/":a)}function Em(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Tm(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const km=/^:\w+$/,xm=3,Cm=2,Pm=1,Rm=10,_m=-2,Us=e=>e==="*";function Lm(e,t){let n=e.split("/"),r=n.length;return n.some(Us)&&(r+=_m),t&&(r+=Cm),n.filter(l=>!Us(l)).reduce((l,o)=>l+(km.test(o)?xm:o===""?Pm:Rm),r)}function Tm(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function Nm(e,t){let{routesMeta:n}=e,r={},l="/",o=[];for(let i=0;i{if(p==="*"){let v=u[y]||"";i=o.slice(0,o.length-v.length).replace(/(.)\/+$/,"$1")}return s[p]=jm(u[y]||"",p),s},{}),pathname:o,pathnameBase:i,pattern:e}}function Mm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Zt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(i,u)=>(r.push(u),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function zm(e){try{return decodeURI(e)}catch(t){return Zt(!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 jm(e,t){try{return decodeURIComponent(e)}catch(n){return Zt(!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 ("+n+").")),e}}function rr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Om(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?pt(e):e;return{pathname:n?n.startsWith("/")?n:Fm(n,t):t,search:Im(r),hash:Am(l)}}function Fm(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function pi(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function To(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function aa(e,t,n,r){r===void 0&&(r=!1);let l;typeof e=="string"?l=pt(e):(l=oe({},e),V(!l.pathname||!l.pathname.includes("?"),pi("?","pathname","search",l)),V(!l.pathname||!l.pathname.includes("#"),pi("#","pathname","hash",l)),V(!l.search||!l.search.includes("#"),pi("#","search","hash",l)));let o=e===""||l.pathname==="",i=o?"/":l.pathname,u;if(r||i==null)u=n;else{let y=t.length-1;if(i.startsWith("..")){let v=i.split("/");for(;v[0]==="..";)v.shift(),y-=1;l.pathname=v.join("/")}u=y>=0?t[y]:"/"}let a=Om(l,u),s=i&&i!=="/"&&i.endsWith("/"),p=(o||i===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(s||p)&&(a.pathname+="/"),a}const Ct=e=>e.join("/").replace(/\/\/+/g,"/"),Um=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Im=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Am=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class sa{constructor(t,n,r,l){l===void 0&&(l=!1),this.status=t,this.statusText=n||"",this.internal=l,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function gd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const yd=["post","put","patch","delete"],Bm=new Set(yd),$m=["get",...yd],Vm=new Set($m),Wm=new Set([301,302,303,307,308]),Hm=new Set([307,308]),hi={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Qm={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},yr={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},wd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Km=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Sd="remix-router-transitions";function Ym(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;V(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let l;if(e.mapRouteProperties)l=e.mapRouteProperties;else if(e.detectErrorBoundary){let w=e.detectErrorBoundary;l=S=>({hasErrorBoundary:w(S)})}else l=Km;let o={},i=su(e.routes,l,void 0,o),u,a=e.basename||"/",s=oe({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),p=null,y=new Set,v=null,E=null,h=null,g=e.hydrationData!=null,k=In(i,e.history.location,a),d=null;if(k==null){let w=Qe(404,{pathname:e.history.location.pathname}),{matches:S,route:C}=Qs(i);k=S,d={[C.id]:w}}let f=!k.some(w=>w.route.lazy)&&(!k.some(w=>w.route.loader)||e.hydrationData!=null),m,c={historyAction:e.history.action,location:e.history.location,matches:k,initialized:f,navigation:hi,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||d,fetchers:new Map,blockers:new Map},x=de.Pop,P=!1,R,T=!1,Q=new Map,U=null,we=!1,Ie=!1,ut=[],nn=[],se=new Map,Nt=0,ht=-1,N=new Map,O=new Set,I=new Map,Y=new Map,q=new Map,Dt=!1;function mt(){if(p=e.history.listen(w=>{let{action:S,location:C,delta:M}=w;if(Dt){Dt=!1;return}Zt(q.size===0||M!=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 B=ka({currentLocation:c.location,nextLocation:C,historyAction:S});if(B&&M!=null){Dt=!0,e.history.go(M*-1),cl(B,{state:"blocked",location:C,proceed(){cl(B,{state:"proceeding",proceed:void 0,reset:void 0,location:C}),e.history.go(M)},reset(){let A=new Map(c.blockers);A.set(B,yr),re({blockers:A})}});return}return rn(S,C)}),n){lv(t,Q);let w=()=>ov(t,Q);t.addEventListener("pagehide",w),U=()=>t.removeEventListener("pagehide",w)}return c.initialized||rn(de.Pop,c.location),m}function or(){p&&p(),U&&U(),y.clear(),R&&R.abort(),c.fetchers.forEach((w,S)=>jo(S)),c.blockers.forEach((w,S)=>Ea(S))}function vt(w){return y.add(w),()=>y.delete(w)}function re(w,S){c=oe({},c,w),y.forEach(C=>C(c,{unstable_viewTransitionOpts:S}))}function ir(w,S){var C,M;let B=c.actionData!=null&&c.navigation.formMethod!=null&&nt(c.navigation.formMethod)&&c.navigation.state==="loading"&&((C=w.state)==null?void 0:C._isRedirect)!==!0,A;S.actionData?Object.keys(S.actionData).length>0?A=S.actionData:A=null:B?A=c.actionData:A=null;let $=S.loaderData?Hs(c.loaderData,S.loaderData,S.matches||[],S.errors):c.loaderData,F=c.blockers;F.size>0&&(F=new Map(F),F.forEach((le,H)=>F.set(H,yr)));let j=P===!0||c.navigation.formMethod!=null&&nt(c.navigation.formMethod)&&((M=w.state)==null?void 0:M._isRedirect)!==!0;u&&(i=u,u=void 0),we||x===de.Pop||(x===de.Push?e.history.push(w,w.state):x===de.Replace&&e.history.replace(w,w.state));let J;if(x===de.Pop){let le=Q.get(c.location.pathname);le&&le.has(w.pathname)?J={currentLocation:c.location,nextLocation:w}:Q.has(w.pathname)&&(J={currentLocation:w,nextLocation:c.location})}else if(T){let le=Q.get(c.location.pathname);le?le.add(w.pathname):(le=new Set([w.pathname]),Q.set(c.location.pathname,le)),J={currentLocation:c.location,nextLocation:w}}re(oe({},S,{actionData:A,loaderData:$,historyAction:x,location:w,initialized:!0,navigation:hi,revalidation:"idle",restoreScrollPosition:Ca(w,S.matches||c.matches),preventScrollReset:j,blockers:F}),J),x=de.Pop,P=!1,T=!1,we=!1,Ie=!1,ut=[],nn=[]}async function ma(w,S){if(typeof w=="number"){e.history.go(w);return}let C=cu(c.location,c.matches,a,s.v7_prependBasename,w,S==null?void 0:S.fromRouteId,S==null?void 0:S.relative),{path:M,submission:B,error:A}=Is(s.v7_normalizeFormMethod,!1,C,S),$=c.location,F=el(c.location,M,S&&S.state);F=oe({},F,e.history.encodeLocation(F));let j=S&&S.replace!=null?S.replace:void 0,J=de.Push;j===!0?J=de.Replace:j===!1||B!=null&&nt(B.formMethod)&&B.formAction===c.location.pathname+c.location.search&&(J=de.Replace);let le=S&&"preventScrollReset"in S?S.preventScrollReset===!0:void 0,H=ka({currentLocation:$,nextLocation:F,historyAction:J});if(H){cl(H,{state:"blocked",location:F,proceed(){cl(H,{state:"proceeding",proceed:void 0,reset:void 0,location:F}),ma(w,S)},reset(){let Z=new Map(c.blockers);Z.set(H,yr),re({blockers:Z})}});return}return await rn(J,F,{submission:B,pendingError:A,preventScrollReset:le,replace:S&&S.replace,enableViewTransition:S&&S.unstable_viewTransition})}function Nd(){if(zo(),re({revalidation:"loading"}),c.navigation.state!=="submitting"){if(c.navigation.state==="idle"){rn(c.historyAction,c.location,{startUninterruptedRevalidation:!0});return}rn(x||c.historyAction,c.navigation.location,{overrideNavigation:c.navigation})}}async function rn(w,S,C){R&&R.abort(),R=null,x=w,we=(C&&C.startUninterruptedRevalidation)===!0,Id(c.location,c.matches),P=(C&&C.preventScrollReset)===!0,T=(C&&C.enableViewTransition)===!0;let M=u||i,B=C&&C.overrideNavigation,A=In(M,S,a);if(!A){let Z=Qe(404,{pathname:S.pathname}),{matches:fe,route:ln}=Qs(M);Oo(),ir(S,{matches:fe,loaderData:{},errors:{[ln.id]:Z}});return}if(c.initialized&&!Ie&&qm(c.location,S)&&!(C&&C.submission&&nt(C.submission.formMethod))){ir(S,{matches:A});return}R=new AbortController;let $=Sr(e.history,S,R.signal,C&&C.submission),F,j;if(C&&C.pendingError)j={[An(A).route.id]:C.pendingError};else if(C&&C.submission&&nt(C.submission.formMethod)){let Z=await Dd($,S,C.submission,A,{replace:C.replace});if(Z.shortCircuited)return;F=Z.pendingActionData,j=Z.pendingActionError,B=mi(S,C.submission),$=new Request($.url,{signal:$.signal})}let{shortCircuited:J,loaderData:le,errors:H}=await Md($,S,A,B,C&&C.submission,C&&C.fetcherSubmission,C&&C.replace,F,j);J||(R=null,ir(S,oe({matches:A},F?{actionData:F}:{},{loaderData:le,errors:H})))}async function Dd(w,S,C,M,B){B===void 0&&(B={}),zo();let A=nv(S,C);re({navigation:A});let $,F=du(M,S);if(!F.route.action&&!F.route.lazy)$={type:pe.error,error:Qe(405,{method:w.method,pathname:S.pathname,routeId:F.route.id})};else if($=await wr("action",w,F,M,o,l,a),w.signal.aborted)return{shortCircuited:!0};if(Kn($)){let j;return B&&B.replace!=null?j=B.replace:j=$.location===c.location.pathname+c.location.search,await ur(c,$,{submission:C,replace:j}),{shortCircuited:!0}}if(Fr($)){let j=An(M,F.route.id);return(B&&B.replace)!==!0&&(x=de.Push),{pendingActionData:{},pendingActionError:{[j.route.id]:$.error}}}if(dn($))throw Qe(400,{type:"defer-action"});return{pendingActionData:{[F.route.id]:$.data}}}async function Md(w,S,C,M,B,A,$,F,j){let J=M||mi(S,B),le=B||A||Xs(J),H=u||i,[Z,fe]=As(e.history,c,C,le,S,Ie,ut,nn,I,O,H,a,F,j);if(Oo(G=>!(C&&C.some(qe=>qe.route.id===G))||Z&&Z.some(qe=>qe.route.id===G)),ht=++Nt,Z.length===0&&fe.length===0){let G=wa();return ir(S,oe({matches:C,loaderData:{},errors:j||null},F?{actionData:F}:{},G?{fetchers:new Map(c.fetchers)}:{})),{shortCircuited:!0}}if(!we){fe.forEach(qe=>{let zt=c.fetchers.get(qe.key),Bo=Er(void 0,zt?zt.data:void 0);c.fetchers.set(qe.key,Bo)});let G=F||c.actionData;re(oe({navigation:J},G?Object.keys(G).length===0?{actionData:null}:{actionData:G}:{},fe.length>0?{fetchers:new Map(c.fetchers)}:{}))}fe.forEach(G=>{se.has(G.key)&&Mt(G.key),G.controller&&se.set(G.key,G.controller)});let ln=()=>fe.forEach(G=>Mt(G.key));R&&R.signal.addEventListener("abort",ln);let{results:on,loaderResults:ar,fetcherResults:Fo}=await ga(c.matches,C,Z,fe,w);if(w.signal.aborted)return{shortCircuited:!0};R&&R.signal.removeEventListener("abort",ln),fe.forEach(G=>se.delete(G.key));let gt=Ks(on);if(gt){if(gt.idx>=Z.length){let G=fe[gt.idx-Z.length].key;O.add(G)}return await ur(c,gt.result,{replace:$}),{shortCircuited:!0}}let{loaderData:yt,errors:fl}=Ws(c,C,Z,ar,j,fe,Fo,Y);Y.forEach((G,qe)=>{G.subscribe(zt=>{(zt||G.done)&&Y.delete(qe)})});let Uo=wa(),Io=Sa(ht),Ao=Uo||Io||fe.length>0;return oe({loaderData:yt,errors:fl},Ao?{fetchers:new Map(c.fetchers)}:{})}function va(w){return c.fetchers.get(w)||Qm}function zd(w,S,C,M){if(r)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.");se.has(w)&&Mt(w);let B=u||i,A=cu(c.location,c.matches,a,s.v7_prependBasename,C,S,M==null?void 0:M.relative),$=In(B,A,a);if(!$){sl(w,S,Qe(404,{pathname:A}));return}let{path:F,submission:j,error:J}=Is(s.v7_normalizeFormMethod,!0,A,M);if(J){sl(w,S,J);return}let le=du($,F);if(P=(M&&M.preventScrollReset)===!0,j&&nt(j.formMethod)){jd(w,S,F,le,$,j);return}I.set(w,{routeId:S,path:F}),Od(w,S,F,le,$,j)}async function jd(w,S,C,M,B,A){if(zo(),I.delete(w),!M.route.action&&!M.route.lazy){let ve=Qe(405,{method:A.formMethod,pathname:C,routeId:S});sl(w,S,ve);return}let $=c.fetchers.get(w),F=rv(A,$);c.fetchers.set(w,F),re({fetchers:new Map(c.fetchers)});let j=new AbortController,J=Sr(e.history,C,j.signal,A);se.set(w,j);let le=Nt,H=await wr("action",J,M,B,o,l,a);if(J.signal.aborted){se.get(w)===j&&se.delete(w);return}if(Kn(H))if(se.delete(w),ht>le){let ve=Pn(void 0);c.fetchers.set(w,ve),re({fetchers:new Map(c.fetchers)});return}else{O.add(w);let ve=Er(A);return c.fetchers.set(w,ve),re({fetchers:new Map(c.fetchers)}),ur(c,H,{fetcherSubmission:A})}if(Fr(H)){sl(w,S,H.error);return}if(dn(H))throw Qe(400,{type:"defer-action"});let Z=c.navigation.location||c.location,fe=Sr(e.history,Z,j.signal),ln=u||i,on=c.navigation.state!=="idle"?In(ln,c.navigation.location,a):c.matches;V(on,"Didn't find any matches after fetcher action");let ar=++Nt;N.set(w,ar);let Fo=Er(A,H.data);c.fetchers.set(w,Fo);let[gt,yt]=As(e.history,c,on,A,Z,Ie,ut,nn,I,O,ln,a,{[M.route.id]:H.data},void 0);yt.filter(ve=>ve.key!==w).forEach(ve=>{let sr=ve.key,Pa=c.fetchers.get(sr),Bd=Er(void 0,Pa?Pa.data:void 0);c.fetchers.set(sr,Bd),se.has(sr)&&Mt(sr),ve.controller&&se.set(sr,ve.controller)}),re({fetchers:new Map(c.fetchers)});let fl=()=>yt.forEach(ve=>Mt(ve.key));j.signal.addEventListener("abort",fl);let{results:Uo,loaderResults:Io,fetcherResults:Ao}=await ga(c.matches,on,gt,yt,fe);if(j.signal.aborted)return;j.signal.removeEventListener("abort",fl),N.delete(w),se.delete(w),yt.forEach(ve=>se.delete(ve.key));let G=Ks(Uo);if(G){if(G.idx>=gt.length){let ve=yt[G.idx-gt.length].key;O.add(ve)}return ur(c,G.result)}let{loaderData:qe,errors:zt}=Ws(c,c.matches,gt,Io,void 0,yt,Ao,Y);if(c.fetchers.has(w)){let ve=Pn(H.data);c.fetchers.set(w,ve)}let Bo=Sa(ar);c.navigation.state==="loading"&&ar>ht?(V(x,"Expected pending action"),R&&R.abort(),ir(c.navigation.location,{matches:on,loaderData:qe,errors:zt,fetchers:new Map(c.fetchers)})):(re(oe({errors:zt,loaderData:Hs(c.loaderData,qe,on,zt)},Bo||yt.length>0?{fetchers:new Map(c.fetchers)}:{})),Ie=!1)}async function Od(w,S,C,M,B,A){let $=c.fetchers.get(w),F=Er(A,$?$.data:void 0);c.fetchers.set(w,F),re({fetchers:new Map(c.fetchers)});let j=new AbortController,J=Sr(e.history,C,j.signal);se.set(w,j);let le=Nt,H=await wr("loader",J,M,B,o,l,a);if(dn(H)&&(H=await xd(H,J.signal,!0)||H),se.get(w)===j&&se.delete(w),J.signal.aborted)return;if(Kn(H))if(ht>le){let fe=Pn(void 0);c.fetchers.set(w,fe),re({fetchers:new Map(c.fetchers)});return}else{O.add(w),await ur(c,H);return}if(Fr(H)){let fe=An(c.matches,S);c.fetchers.delete(w),re({fetchers:new Map(c.fetchers),errors:{[fe.route.id]:H.error}});return}V(!dn(H),"Unhandled fetcher deferred data");let Z=Pn(H.data);c.fetchers.set(w,Z),re({fetchers:new Map(c.fetchers)})}async function ur(w,S,C){let{submission:M,fetcherSubmission:B,replace:A}=C===void 0?{}:C;S.revalidate&&(Ie=!0);let $=el(w.location,S.location,{_isRedirect:!0});if(V($,"Expected a location on the redirect navigation"),n){let Z=!1;if(S.reloadDocument)Z=!0;else if(wd.test(S.location)){const fe=e.history.createURL(S.location);Z=fe.origin!==t.location.origin||rr(fe.pathname,a)==null}if(Z){A?t.location.replace(S.location):t.location.assign(S.location);return}}R=null;let F=A===!0?de.Replace:de.Push,{formMethod:j,formAction:J,formEncType:le}=w.navigation;!M&&!B&&j&&J&&le&&(M=Xs(w.navigation));let H=M||B;if(Hm.has(S.status)&&H&&nt(H.formMethod))await rn(F,$,{submission:oe({},H,{formAction:S.location}),preventScrollReset:P});else{let Z=mi($,M);await rn(F,$,{overrideNavigation:Z,fetcherSubmission:B,preventScrollReset:P})}}async function ga(w,S,C,M,B){let A=await Promise.all([...C.map(j=>wr("loader",B,j,S,o,l,a)),...M.map(j=>j.matches&&j.match&&j.controller?wr("loader",Sr(e.history,j.path,j.controller.signal),j.match,j.matches,o,l,a):{type:pe.error,error:Qe(404,{pathname:j.path})})]),$=A.slice(0,C.length),F=A.slice(C.length);return await Promise.all([Ys(w,C,$,$.map(()=>B.signal),!1,c.loaderData),Ys(w,M.map(j=>j.match),F,M.map(j=>j.controller?j.controller.signal:null),!0)]),{results:A,loaderResults:$,fetcherResults:F}}function zo(){Ie=!0,ut.push(...Oo()),I.forEach((w,S)=>{se.has(S)&&(nn.push(S),Mt(S))})}function sl(w,S,C){let M=An(c.matches,S);jo(w),re({errors:{[M.route.id]:C},fetchers:new Map(c.fetchers)})}function jo(w){let S=c.fetchers.get(w);se.has(w)&&!(S&&S.state==="loading"&&N.has(w))&&Mt(w),I.delete(w),N.delete(w),O.delete(w),c.fetchers.delete(w)}function Mt(w){let S=se.get(w);V(S,"Expected fetch controller: "+w),S.abort(),se.delete(w)}function ya(w){for(let S of w){let C=va(S),M=Pn(C.data);c.fetchers.set(S,M)}}function wa(){let w=[],S=!1;for(let C of O){let M=c.fetchers.get(C);V(M,"Expected fetcher: "+C),M.state==="loading"&&(O.delete(C),w.push(C),S=!0)}return ya(w),S}function Sa(w){let S=[];for(let[C,M]of N)if(M0}function Fd(w,S){let C=c.blockers.get(w)||yr;return q.get(w)!==S&&q.set(w,S),C}function Ea(w){c.blockers.delete(w),q.delete(w)}function cl(w,S){let C=c.blockers.get(w)||yr;V(C.state==="unblocked"&&S.state==="blocked"||C.state==="blocked"&&S.state==="blocked"||C.state==="blocked"&&S.state==="proceeding"||C.state==="blocked"&&S.state==="unblocked"||C.state==="proceeding"&&S.state==="unblocked","Invalid blocker state transition: "+C.state+" -> "+S.state);let M=new Map(c.blockers);M.set(w,S),re({blockers:M})}function ka(w){let{currentLocation:S,nextLocation:C,historyAction:M}=w;if(q.size===0)return;q.size>1&&Zt(!1,"A router only supports one blocker at a time");let B=Array.from(q.entries()),[A,$]=B[B.length-1],F=c.blockers.get(A);if(!(F&&F.state==="proceeding")&&$({currentLocation:S,nextLocation:C,historyAction:M}))return A}function Oo(w){let S=[];return Y.forEach((C,M)=>{(!w||w(M))&&(C.cancel(),S.push(M),Y.delete(M))}),S}function Ud(w,S,C){if(v=w,h=S,E=C||null,!g&&c.navigation===hi){g=!0;let M=Ca(c.location,c.matches);M!=null&&re({restoreScrollPosition:M})}return()=>{v=null,h=null,E=null}}function xa(w,S){return E&&E(w,S.map(M=>Sm(M,c.loaderData)))||w.key}function Id(w,S){if(v&&h){let C=xa(w,S);v[C]=h()}}function Ca(w,S){if(v){let C=xa(w,S),M=v[C];if(typeof M=="number")return M}return null}function Ad(w){o={},u=su(w,l,void 0,o)}return m={get basename(){return a},get state(){return c},get routes(){return i},get window(){return t},initialize:mt,subscribe:vt,enableScrollRestoration:Ud,navigate:ma,fetch:zd,revalidate:Nd,createHref:w=>e.history.createHref(w),encodeLocation:w=>e.history.encodeLocation(w),getFetcher:va,deleteFetcher:jo,dispose:or,getBlocker:Fd,deleteBlocker:Ea,_internalFetchControllers:se,_internalActiveDeferreds:Y,_internalSetRoutes:Ad},m}function Xm(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function cu(e,t,n,r,l,o,i){let u,a;if(o!=null&&i!=="path"){u=[];for(let p of t)if(u.push(p),p.route.id===o){a=p;break}}else u=t,a=t[t.length-1];let s=aa(l||".",To(u).map(p=>p.pathnameBase),rr(e.pathname,n)||e.pathname,i==="path");return l==null&&(s.search=e.search,s.hash=e.hash),(l==null||l===""||l===".")&&a&&a.route.index&&!ca(s.search)&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(s.pathname=s.pathname==="/"?n:Ct([n,s.pathname])),Sn(s)}function Is(e,t,n,r){if(!r||!Xm(r))return{path:n};if(r.formMethod&&!tv(r.formMethod))return{path:n,error:Qe(405,{method:r.formMethod})};let l=()=>({path:n,error:Qe(400,{type:"invalid-body"})}),o=r.formMethod||"get",i=e?o.toUpperCase():o.toLowerCase(),u=kd(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!nt(i))return l();let v=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((E,h)=>{let[g,k]=h;return""+E+g+"="+k+` + */function oe(){return oe=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Zt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function vm(){return Math.random().toString(36).substr(2,8)}function Fs(e,t){return{usr:e.state,key:e.key,idx:t}}function el(e,t,n,r){return n===void 0&&(n=null),oe({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?pt(t):t,{state:n,key:t&&t.key||r||vm()})}function Sn(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function pt(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function gm(e,t,n,r){r===void 0&&(r={});let{window:l=document.defaultView,v5Compat:o=!1}=r,i=l.history,u=de.Pop,a=null,s=p();s==null&&(s=0,i.replaceState(oe({},i.state,{idx:s}),""));function p(){return(i.state||{idx:null}).idx}function y(){u=de.Pop;let k=p(),d=k==null?null:k-s;s=k,a&&a({action:u,location:g.location,delta:d})}function v(k,d){u=de.Push;let f=el(g.location,k,d);n&&n(f,k),s=p()+1;let m=Fs(f,s),c=g.createHref(f);try{i.pushState(m,"",c)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;l.location.assign(c)}o&&a&&a({action:u,location:g.location,delta:1})}function E(k,d){u=de.Replace;let f=el(g.location,k,d);n&&n(f,k),s=p();let m=Fs(f,s),c=g.createHref(f);i.replaceState(m,"",c),o&&a&&a({action:u,location:g.location,delta:0})}function h(k){let d=l.location.origin!=="null"?l.location.origin:l.location.href,f=typeof k=="string"?k:Sn(k);return V(d,"No window.location.(origin|href) available to create URL for href: "+f),new URL(f,d)}let g={get action(){return u},get location(){return e(l,i)},listen(k){if(a)throw new Error("A history only accepts one active listener");return l.addEventListener(Os,y),a=k,()=>{l.removeEventListener(Os,y),a=null}},createHref(k){return t(l,k)},createURL:h,encodeLocation(k){let d=h(k);return{pathname:d.pathname,search:d.search,hash:d.hash}},push:v,replace:E,go(k){return i.go(k)}};return g}var pe;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(pe||(pe={}));const ym=new Set(["lazy","caseSensitive","path","id","index","children"]);function wm(e){return e.index===!0}function su(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((l,o)=>{let i=[...n,o],u=typeof l.id=="string"?l.id:i.join("-");if(V(l.index!==!0||!l.children,"Cannot specify children on an index route"),V(!r[u],'Found a route id collision on id "'+u+`". Route id's must be globally unique within Data Router usages`),wm(l)){let a=oe({},l,t(l),{id:u});return r[u]=a,a}else{let a=oe({},l,t(l),{id:u,children:void 0});return r[u]=a,l.children&&(a.children=su(l.children,t,i,r)),a}})}function In(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?pt(t):t,l=rr(r.pathname||"/",n);if(l==null)return null;let o=md(e);Em(o);let i=null;for(let u=0;i==null&&u{let a={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};a.relativePath.startsWith("/")&&(V(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(r.length));let s=Ct([r,a.relativePath]),p=n.concat(a);o.children&&o.children.length>0&&(V(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+s+'".')),md(o.children,t,p,s)),!(o.path==null&&!o.index)&&t.push({path:s,score:Lm(s,o.index),routesMeta:p})};return e.forEach((o,i)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))l(o,i);else for(let a of vd(o.path))l(o,i,a)}),t}function vd(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return l?[o,""]:[o];let i=vd(r.join("/")),u=[];return u.push(...i.map(a=>a===""?o:[o,a].join("/"))),l&&u.push(...i),u.map(a=>e.startsWith("/")&&a===""?"/":a)}function Em(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Tm(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const km=/^:\w+$/,xm=3,Cm=2,Pm=1,Rm=10,_m=-2,Us=e=>e==="*";function Lm(e,t){let n=e.split("/"),r=n.length;return n.some(Us)&&(r+=_m),t&&(r+=Cm),n.filter(l=>!Us(l)).reduce((l,o)=>l+(km.test(o)?xm:o===""?Pm:Rm),r)}function Tm(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function Nm(e,t){let{routesMeta:n}=e,r={},l="/",o=[];for(let i=0;i{if(p==="*"){let v=u[y]||"";i=o.slice(0,o.length-v.length).replace(/(.)\/+$/,"$1")}return s[p]=jm(u[y]||"",p),s},{}),pathname:o,pathnameBase:i,pattern:e}}function Mm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Zt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(i,u)=>(r.push(u),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function zm(e){try{return decodeURI(e)}catch(t){return Zt(!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 jm(e,t){try{return decodeURIComponent(e)}catch(n){return Zt(!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 ("+n+").")),e}}function rr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Om(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?pt(e):e;return{pathname:n?n.startsWith("/")?n:Fm(n,t):t,search:Im(r),hash:Am(l)}}function Fm(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function pi(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function To(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function aa(e,t,n,r){r===void 0&&(r=!1);let l;typeof e=="string"?l=pt(e):(l=oe({},e),V(!l.pathname||!l.pathname.includes("?"),pi("?","pathname","search",l)),V(!l.pathname||!l.pathname.includes("#"),pi("#","pathname","hash",l)),V(!l.search||!l.search.includes("#"),pi("#","search","hash",l)));let o=e===""||l.pathname==="",i=o?"/":l.pathname,u;if(r||i==null)u=n;else{let y=t.length-1;if(i.startsWith("..")){let v=i.split("/");for(;v[0]==="..";)v.shift(),y-=1;l.pathname=v.join("/")}u=y>=0?t[y]:"/"}let a=Om(l,u),s=i&&i!=="/"&&i.endsWith("/"),p=(o||i===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(s||p)&&(a.pathname+="/"),a}const Ct=e=>e.join("/").replace(/\/\/+/g,"/"),Um=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Im=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Am=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class sa{constructor(t,n,r,l){l===void 0&&(l=!1),this.status=t,this.statusText=n||"",this.internal=l,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function gd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const yd=["post","put","patch","delete"],Bm=new Set(yd),$m=["get",...yd],Vm=new Set($m),Wm=new Set([301,302,303,307,308]),Hm=new Set([307,308]),hi={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Qm={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},yr={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},wd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Km=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Sd="remix-router-transitions";function Ym(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;V(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let l;if(e.mapRouteProperties)l=e.mapRouteProperties;else if(e.detectErrorBoundary){let w=e.detectErrorBoundary;l=S=>({hasErrorBoundary:w(S)})}else l=Km;let o={},i=su(e.routes,l,void 0,o),u,a=e.basename||"/",s=oe({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),p=null,y=new Set,v=null,E=null,h=null,g=e.hydrationData!=null,k=In(i,e.history.location,a),d=null;if(k==null){let w=Qe(404,{pathname:e.history.location.pathname}),{matches:S,route:C}=Qs(i);k=S,d={[C.id]:w}}let f=!k.some(w=>w.route.lazy)&&(!k.some(w=>w.route.loader)||e.hydrationData!=null),m,c={historyAction:e.history.action,location:e.history.location,matches:k,initialized:f,navigation:hi,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||d,fetchers:new Map,blockers:new Map},x=de.Pop,P=!1,R,T=!1,Q=new Map,U=null,we=!1,Ie=!1,ut=[],nn=[],se=new Map,Nt=0,ht=-1,N=new Map,O=new Set,I=new Map,Y=new Map,q=new Map,Dt=!1;function mt(){if(p=e.history.listen(w=>{let{action:S,location:C,delta:D}=w;if(Dt){Dt=!1;return}Zt(q.size===0||D!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let B=ka({currentLocation:c.location,nextLocation:C,historyAction:S});if(B&&D!=null){Dt=!0,e.history.go(D*-1),cl(B,{state:"blocked",location:C,proceed(){cl(B,{state:"proceeding",proceed:void 0,reset:void 0,location:C}),e.history.go(D)},reset(){let A=new Map(c.blockers);A.set(B,yr),re({blockers:A})}});return}return rn(S,C)}),n){lv(t,Q);let w=()=>ov(t,Q);t.addEventListener("pagehide",w),U=()=>t.removeEventListener("pagehide",w)}return c.initialized||rn(de.Pop,c.location),m}function or(){p&&p(),U&&U(),y.clear(),R&&R.abort(),c.fetchers.forEach((w,S)=>jo(S)),c.blockers.forEach((w,S)=>Ea(S))}function vt(w){return y.add(w),()=>y.delete(w)}function re(w,S){c=oe({},c,w),y.forEach(C=>C(c,{unstable_viewTransitionOpts:S}))}function ir(w,S){var C,D;let B=c.actionData!=null&&c.navigation.formMethod!=null&&nt(c.navigation.formMethod)&&c.navigation.state==="loading"&&((C=w.state)==null?void 0:C._isRedirect)!==!0,A;S.actionData?Object.keys(S.actionData).length>0?A=S.actionData:A=null:B?A=c.actionData:A=null;let $=S.loaderData?Hs(c.loaderData,S.loaderData,S.matches||[],S.errors):c.loaderData,F=c.blockers;F.size>0&&(F=new Map(F),F.forEach((le,H)=>F.set(H,yr)));let j=P===!0||c.navigation.formMethod!=null&&nt(c.navigation.formMethod)&&((D=w.state)==null?void 0:D._isRedirect)!==!0;u&&(i=u,u=void 0),we||x===de.Pop||(x===de.Push?e.history.push(w,w.state):x===de.Replace&&e.history.replace(w,w.state));let J;if(x===de.Pop){let le=Q.get(c.location.pathname);le&&le.has(w.pathname)?J={currentLocation:c.location,nextLocation:w}:Q.has(w.pathname)&&(J={currentLocation:w,nextLocation:c.location})}else if(T){let le=Q.get(c.location.pathname);le?le.add(w.pathname):(le=new Set([w.pathname]),Q.set(c.location.pathname,le)),J={currentLocation:c.location,nextLocation:w}}re(oe({},S,{actionData:A,loaderData:$,historyAction:x,location:w,initialized:!0,navigation:hi,revalidation:"idle",restoreScrollPosition:Ca(w,S.matches||c.matches),preventScrollReset:j,blockers:F}),J),x=de.Pop,P=!1,T=!1,we=!1,Ie=!1,ut=[],nn=[]}async function ma(w,S){if(typeof w=="number"){e.history.go(w);return}let C=cu(c.location,c.matches,a,s.v7_prependBasename,w,S==null?void 0:S.fromRouteId,S==null?void 0:S.relative),{path:D,submission:B,error:A}=Is(s.v7_normalizeFormMethod,!1,C,S),$=c.location,F=el(c.location,D,S&&S.state);F=oe({},F,e.history.encodeLocation(F));let j=S&&S.replace!=null?S.replace:void 0,J=de.Push;j===!0?J=de.Replace:j===!1||B!=null&&nt(B.formMethod)&&B.formAction===c.location.pathname+c.location.search&&(J=de.Replace);let le=S&&"preventScrollReset"in S?S.preventScrollReset===!0:void 0,H=ka({currentLocation:$,nextLocation:F,historyAction:J});if(H){cl(H,{state:"blocked",location:F,proceed(){cl(H,{state:"proceeding",proceed:void 0,reset:void 0,location:F}),ma(w,S)},reset(){let Z=new Map(c.blockers);Z.set(H,yr),re({blockers:Z})}});return}return await rn(J,F,{submission:B,pendingError:A,preventScrollReset:le,replace:S&&S.replace,enableViewTransition:S&&S.unstable_viewTransition})}function Nd(){if(zo(),re({revalidation:"loading"}),c.navigation.state!=="submitting"){if(c.navigation.state==="idle"){rn(c.historyAction,c.location,{startUninterruptedRevalidation:!0});return}rn(x||c.historyAction,c.navigation.location,{overrideNavigation:c.navigation})}}async function rn(w,S,C){R&&R.abort(),R=null,x=w,we=(C&&C.startUninterruptedRevalidation)===!0,Id(c.location,c.matches),P=(C&&C.preventScrollReset)===!0,T=(C&&C.enableViewTransition)===!0;let D=u||i,B=C&&C.overrideNavigation,A=In(D,S,a);if(!A){let Z=Qe(404,{pathname:S.pathname}),{matches:fe,route:ln}=Qs(D);Oo(),ir(S,{matches:fe,loaderData:{},errors:{[ln.id]:Z}});return}if(c.initialized&&!Ie&&qm(c.location,S)&&!(C&&C.submission&&nt(C.submission.formMethod))){ir(S,{matches:A});return}R=new AbortController;let $=Sr(e.history,S,R.signal,C&&C.submission),F,j;if(C&&C.pendingError)j={[An(A).route.id]:C.pendingError};else if(C&&C.submission&&nt(C.submission.formMethod)){let Z=await Dd($,S,C.submission,A,{replace:C.replace});if(Z.shortCircuited)return;F=Z.pendingActionData,j=Z.pendingActionError,B=mi(S,C.submission),$=new Request($.url,{signal:$.signal})}let{shortCircuited:J,loaderData:le,errors:H}=await Md($,S,A,B,C&&C.submission,C&&C.fetcherSubmission,C&&C.replace,F,j);J||(R=null,ir(S,oe({matches:A},F?{actionData:F}:{},{loaderData:le,errors:H})))}async function Dd(w,S,C,D,B){B===void 0&&(B={}),zo();let A=nv(S,C);re({navigation:A});let $,F=du(D,S);if(!F.route.action&&!F.route.lazy)$={type:pe.error,error:Qe(405,{method:w.method,pathname:S.pathname,routeId:F.route.id})};else if($=await wr("action",w,F,D,o,l,a),w.signal.aborted)return{shortCircuited:!0};if(Kn($)){let j;return B&&B.replace!=null?j=B.replace:j=$.location===c.location.pathname+c.location.search,await ur(c,$,{submission:C,replace:j}),{shortCircuited:!0}}if(Fr($)){let j=An(D,F.route.id);return(B&&B.replace)!==!0&&(x=de.Push),{pendingActionData:{},pendingActionError:{[j.route.id]:$.error}}}if(dn($))throw Qe(400,{type:"defer-action"});return{pendingActionData:{[F.route.id]:$.data}}}async function Md(w,S,C,D,B,A,$,F,j){let J=D||mi(S,B),le=B||A||Xs(J),H=u||i,[Z,fe]=As(e.history,c,C,le,S,Ie,ut,nn,I,O,H,a,F,j);if(Oo(G=>!(C&&C.some(qe=>qe.route.id===G))||Z&&Z.some(qe=>qe.route.id===G)),ht=++Nt,Z.length===0&&fe.length===0){let G=wa();return ir(S,oe({matches:C,loaderData:{},errors:j||null},F?{actionData:F}:{},G?{fetchers:new Map(c.fetchers)}:{})),{shortCircuited:!0}}if(!we){fe.forEach(qe=>{let zt=c.fetchers.get(qe.key),Bo=Er(void 0,zt?zt.data:void 0);c.fetchers.set(qe.key,Bo)});let G=F||c.actionData;re(oe({navigation:J},G?Object.keys(G).length===0?{actionData:null}:{actionData:G}:{},fe.length>0?{fetchers:new Map(c.fetchers)}:{}))}fe.forEach(G=>{se.has(G.key)&&Mt(G.key),G.controller&&se.set(G.key,G.controller)});let ln=()=>fe.forEach(G=>Mt(G.key));R&&R.signal.addEventListener("abort",ln);let{results:on,loaderResults:ar,fetcherResults:Fo}=await ga(c.matches,C,Z,fe,w);if(w.signal.aborted)return{shortCircuited:!0};R&&R.signal.removeEventListener("abort",ln),fe.forEach(G=>se.delete(G.key));let gt=Ks(on);if(gt){if(gt.idx>=Z.length){let G=fe[gt.idx-Z.length].key;O.add(G)}return await ur(c,gt.result,{replace:$}),{shortCircuited:!0}}let{loaderData:yt,errors:fl}=Ws(c,C,Z,ar,j,fe,Fo,Y);Y.forEach((G,qe)=>{G.subscribe(zt=>{(zt||G.done)&&Y.delete(qe)})});let Uo=wa(),Io=Sa(ht),Ao=Uo||Io||fe.length>0;return oe({loaderData:yt,errors:fl},Ao?{fetchers:new Map(c.fetchers)}:{})}function va(w){return c.fetchers.get(w)||Qm}function zd(w,S,C,D){if(r)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.");se.has(w)&&Mt(w);let B=u||i,A=cu(c.location,c.matches,a,s.v7_prependBasename,C,S,D==null?void 0:D.relative),$=In(B,A,a);if(!$){sl(w,S,Qe(404,{pathname:A}));return}let{path:F,submission:j,error:J}=Is(s.v7_normalizeFormMethod,!0,A,D);if(J){sl(w,S,J);return}let le=du($,F);if(P=(D&&D.preventScrollReset)===!0,j&&nt(j.formMethod)){jd(w,S,F,le,$,j);return}I.set(w,{routeId:S,path:F}),Od(w,S,F,le,$,j)}async function jd(w,S,C,D,B,A){if(zo(),I.delete(w),!D.route.action&&!D.route.lazy){let ve=Qe(405,{method:A.formMethod,pathname:C,routeId:S});sl(w,S,ve);return}let $=c.fetchers.get(w),F=rv(A,$);c.fetchers.set(w,F),re({fetchers:new Map(c.fetchers)});let j=new AbortController,J=Sr(e.history,C,j.signal,A);se.set(w,j);let le=Nt,H=await wr("action",J,D,B,o,l,a);if(J.signal.aborted){se.get(w)===j&&se.delete(w);return}if(Kn(H))if(se.delete(w),ht>le){let ve=Pn(void 0);c.fetchers.set(w,ve),re({fetchers:new Map(c.fetchers)});return}else{O.add(w);let ve=Er(A);return c.fetchers.set(w,ve),re({fetchers:new Map(c.fetchers)}),ur(c,H,{fetcherSubmission:A})}if(Fr(H)){sl(w,S,H.error);return}if(dn(H))throw Qe(400,{type:"defer-action"});let Z=c.navigation.location||c.location,fe=Sr(e.history,Z,j.signal),ln=u||i,on=c.navigation.state!=="idle"?In(ln,c.navigation.location,a):c.matches;V(on,"Didn't find any matches after fetcher action");let ar=++Nt;N.set(w,ar);let Fo=Er(A,H.data);c.fetchers.set(w,Fo);let[gt,yt]=As(e.history,c,on,A,Z,Ie,ut,nn,I,O,ln,a,{[D.route.id]:H.data},void 0);yt.filter(ve=>ve.key!==w).forEach(ve=>{let sr=ve.key,Pa=c.fetchers.get(sr),Bd=Er(void 0,Pa?Pa.data:void 0);c.fetchers.set(sr,Bd),se.has(sr)&&Mt(sr),ve.controller&&se.set(sr,ve.controller)}),re({fetchers:new Map(c.fetchers)});let fl=()=>yt.forEach(ve=>Mt(ve.key));j.signal.addEventListener("abort",fl);let{results:Uo,loaderResults:Io,fetcherResults:Ao}=await ga(c.matches,on,gt,yt,fe);if(j.signal.aborted)return;j.signal.removeEventListener("abort",fl),N.delete(w),se.delete(w),yt.forEach(ve=>se.delete(ve.key));let G=Ks(Uo);if(G){if(G.idx>=gt.length){let ve=yt[G.idx-gt.length].key;O.add(ve)}return ur(c,G.result)}let{loaderData:qe,errors:zt}=Ws(c,c.matches,gt,Io,void 0,yt,Ao,Y);if(c.fetchers.has(w)){let ve=Pn(H.data);c.fetchers.set(w,ve)}let Bo=Sa(ar);c.navigation.state==="loading"&&ar>ht?(V(x,"Expected pending action"),R&&R.abort(),ir(c.navigation.location,{matches:on,loaderData:qe,errors:zt,fetchers:new Map(c.fetchers)})):(re(oe({errors:zt,loaderData:Hs(c.loaderData,qe,on,zt)},Bo||yt.length>0?{fetchers:new Map(c.fetchers)}:{})),Ie=!1)}async function Od(w,S,C,D,B,A){let $=c.fetchers.get(w),F=Er(A,$?$.data:void 0);c.fetchers.set(w,F),re({fetchers:new Map(c.fetchers)});let j=new AbortController,J=Sr(e.history,C,j.signal);se.set(w,j);let le=Nt,H=await wr("loader",J,D,B,o,l,a);if(dn(H)&&(H=await xd(H,J.signal,!0)||H),se.get(w)===j&&se.delete(w),J.signal.aborted)return;if(Kn(H))if(ht>le){let fe=Pn(void 0);c.fetchers.set(w,fe),re({fetchers:new Map(c.fetchers)});return}else{O.add(w),await ur(c,H);return}if(Fr(H)){let fe=An(c.matches,S);c.fetchers.delete(w),re({fetchers:new Map(c.fetchers),errors:{[fe.route.id]:H.error}});return}V(!dn(H),"Unhandled fetcher deferred data");let Z=Pn(H.data);c.fetchers.set(w,Z),re({fetchers:new Map(c.fetchers)})}async function ur(w,S,C){let{submission:D,fetcherSubmission:B,replace:A}=C===void 0?{}:C;S.revalidate&&(Ie=!0);let $=el(w.location,S.location,{_isRedirect:!0});if(V($,"Expected a location on the redirect navigation"),n){let Z=!1;if(S.reloadDocument)Z=!0;else if(wd.test(S.location)){const fe=e.history.createURL(S.location);Z=fe.origin!==t.location.origin||rr(fe.pathname,a)==null}if(Z){A?t.location.replace(S.location):t.location.assign(S.location);return}}R=null;let F=A===!0?de.Replace:de.Push,{formMethod:j,formAction:J,formEncType:le}=w.navigation;!D&&!B&&j&&J&&le&&(D=Xs(w.navigation));let H=D||B;if(Hm.has(S.status)&&H&&nt(H.formMethod))await rn(F,$,{submission:oe({},H,{formAction:S.location}),preventScrollReset:P});else{let Z=mi($,D);await rn(F,$,{overrideNavigation:Z,fetcherSubmission:B,preventScrollReset:P})}}async function ga(w,S,C,D,B){let A=await Promise.all([...C.map(j=>wr("loader",B,j,S,o,l,a)),...D.map(j=>j.matches&&j.match&&j.controller?wr("loader",Sr(e.history,j.path,j.controller.signal),j.match,j.matches,o,l,a):{type:pe.error,error:Qe(404,{pathname:j.path})})]),$=A.slice(0,C.length),F=A.slice(C.length);return await Promise.all([Ys(w,C,$,$.map(()=>B.signal),!1,c.loaderData),Ys(w,D.map(j=>j.match),F,D.map(j=>j.controller?j.controller.signal:null),!0)]),{results:A,loaderResults:$,fetcherResults:F}}function zo(){Ie=!0,ut.push(...Oo()),I.forEach((w,S)=>{se.has(S)&&(nn.push(S),Mt(S))})}function sl(w,S,C){let D=An(c.matches,S);jo(w),re({errors:{[D.route.id]:C},fetchers:new Map(c.fetchers)})}function jo(w){let S=c.fetchers.get(w);se.has(w)&&!(S&&S.state==="loading"&&N.has(w))&&Mt(w),I.delete(w),N.delete(w),O.delete(w),c.fetchers.delete(w)}function Mt(w){let S=se.get(w);V(S,"Expected fetch controller: "+w),S.abort(),se.delete(w)}function ya(w){for(let S of w){let C=va(S),D=Pn(C.data);c.fetchers.set(S,D)}}function wa(){let w=[],S=!1;for(let C of O){let D=c.fetchers.get(C);V(D,"Expected fetcher: "+C),D.state==="loading"&&(O.delete(C),w.push(C),S=!0)}return ya(w),S}function Sa(w){let S=[];for(let[C,D]of N)if(D0}function Fd(w,S){let C=c.blockers.get(w)||yr;return q.get(w)!==S&&q.set(w,S),C}function Ea(w){c.blockers.delete(w),q.delete(w)}function cl(w,S){let C=c.blockers.get(w)||yr;V(C.state==="unblocked"&&S.state==="blocked"||C.state==="blocked"&&S.state==="blocked"||C.state==="blocked"&&S.state==="proceeding"||C.state==="blocked"&&S.state==="unblocked"||C.state==="proceeding"&&S.state==="unblocked","Invalid blocker state transition: "+C.state+" -> "+S.state);let D=new Map(c.blockers);D.set(w,S),re({blockers:D})}function ka(w){let{currentLocation:S,nextLocation:C,historyAction:D}=w;if(q.size===0)return;q.size>1&&Zt(!1,"A router only supports one blocker at a time");let B=Array.from(q.entries()),[A,$]=B[B.length-1],F=c.blockers.get(A);if(!(F&&F.state==="proceeding")&&$({currentLocation:S,nextLocation:C,historyAction:D}))return A}function Oo(w){let S=[];return Y.forEach((C,D)=>{(!w||w(D))&&(C.cancel(),S.push(D),Y.delete(D))}),S}function Ud(w,S,C){if(v=w,h=S,E=C||null,!g&&c.navigation===hi){g=!0;let D=Ca(c.location,c.matches);D!=null&&re({restoreScrollPosition:D})}return()=>{v=null,h=null,E=null}}function xa(w,S){return E&&E(w,S.map(D=>Sm(D,c.loaderData)))||w.key}function Id(w,S){if(v&&h){let C=xa(w,S);v[C]=h()}}function Ca(w,S){if(v){let C=xa(w,S),D=v[C];if(typeof D=="number")return D}return null}function Ad(w){o={},u=su(w,l,void 0,o)}return m={get basename(){return a},get state(){return c},get routes(){return i},get window(){return t},initialize:mt,subscribe:vt,enableScrollRestoration:Ud,navigate:ma,fetch:zd,revalidate:Nd,createHref:w=>e.history.createHref(w),encodeLocation:w=>e.history.encodeLocation(w),getFetcher:va,deleteFetcher:jo,dispose:or,getBlocker:Fd,deleteBlocker:Ea,_internalFetchControllers:se,_internalActiveDeferreds:Y,_internalSetRoutes:Ad},m}function Xm(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function cu(e,t,n,r,l,o,i){let u,a;if(o!=null&&i!=="path"){u=[];for(let p of t)if(u.push(p),p.route.id===o){a=p;break}}else u=t,a=t[t.length-1];let s=aa(l||".",To(u).map(p=>p.pathnameBase),rr(e.pathname,n)||e.pathname,i==="path");return l==null&&(s.search=e.search,s.hash=e.hash),(l==null||l===""||l===".")&&a&&a.route.index&&!ca(s.search)&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(s.pathname=s.pathname==="/"?n:Ct([n,s.pathname])),Sn(s)}function Is(e,t,n,r){if(!r||!Xm(r))return{path:n};if(r.formMethod&&!tv(r.formMethod))return{path:n,error:Qe(405,{method:r.formMethod})};let l=()=>({path:n,error:Qe(400,{type:"invalid-body"})}),o=r.formMethod||"get",i=e?o.toUpperCase():o.toLowerCase(),u=kd(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!nt(i))return l();let v=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((E,h)=>{let[g,k]=h;return""+E+g+"="+k+` `},""):String(r.body);return{path:n,submission:{formMethod:i,formAction:u,formEncType:r.formEncType,formData:void 0,json:void 0,text:v}}}else if(r.formEncType==="application/json"){if(!nt(i))return l();try{let v=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:i,formAction:u,formEncType:r.formEncType,formData:void 0,json:v,text:void 0}}}catch{return l()}}}V(typeof FormData=="function","FormData is not available in this environment");let a,s;if(r.formData)a=fu(r.formData),s=r.formData;else if(r.body instanceof FormData)a=fu(r.body),s=r.body;else if(r.body instanceof URLSearchParams)a=r.body,s=Vs(a);else if(r.body==null)a=new URLSearchParams,s=new FormData;else try{a=new URLSearchParams(r.body),s=Vs(a)}catch{return l()}let p={formMethod:i,formAction:u,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:s,json:void 0,text:void 0};if(nt(p.formMethod))return{path:n,submission:p};let y=pt(n);return t&&y.search&&ca(y.search)&&a.append("index",""),y.search="?"+a,{path:Sn(y),submission:p}}function Gm(e,t){let n=e;if(t){let r=e.findIndex(l=>l.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function As(e,t,n,r,l,o,i,u,a,s,p,y,v,E){let h=E?Object.values(E)[0]:v?Object.values(v)[0]:void 0,g=e.createURL(t.location),k=e.createURL(l),d=E?Object.keys(E)[0]:void 0,m=Gm(n,d).filter((x,P)=>{if(x.route.lazy)return!0;if(x.route.loader==null)return!1;if(Jm(t.loaderData,t.matches[P],x)||i.some(Q=>Q===x.route.id))return!0;let R=t.matches[P],T=x;return Bs(x,oe({currentUrl:g,currentParams:R.params,nextUrl:k,nextParams:T.params},r,{actionResult:h,defaultShouldRevalidate:o||g.pathname+g.search===k.pathname+k.search||g.search!==k.search||Ed(R,T)}))}),c=[];return a.forEach((x,P)=>{if(!n.some(we=>we.route.id===x.routeId))return;let R=In(p,x.path,y);if(!R){c.push({key:P,routeId:x.routeId,path:x.path,matches:null,match:null,controller:null});return}let T=t.fetchers.get(P),Q=du(R,x.path),U=!1;s.has(P)?U=!1:u.includes(P)?U=!0:T&&T.state!=="idle"&&T.data===void 0?U=o:U=Bs(Q,oe({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:k,nextParams:n[n.length-1].params},r,{actionResult:h,defaultShouldRevalidate:o})),U&&c.push({key:P,routeId:x.routeId,path:x.path,matches:R,match:Q,controller:new AbortController})}),[m,c]}function Jm(e,t,n){let r=!t||n.route.id!==t.route.id,l=e[n.route.id]===void 0;return r||l}function Ed(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Bs(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function $s(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let l=n[e.id];V(l,"No route found in manifest");let o={};for(let i in r){let a=l[i]!==void 0&&i!=="hasErrorBoundary";Zt(!a,'Route "'+l.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+i+'" will be ignored.')),!a&&!ym.has(i)&&(o[i]=r[i])}Object.assign(l,o),Object.assign(l,oe({},t(l),{lazy:void 0}))}async function wr(e,t,n,r,l,o,i,u){u===void 0&&(u={});let a,s,p,y=h=>{let g,k=new Promise((d,f)=>g=f);return p=()=>g(),t.signal.addEventListener("abort",p),Promise.race([h({request:t,params:n.params,context:u.requestContext}),k])};try{let h=n.route[e];if(n.route.lazy)if(h){let g,k=await Promise.all([y(h).catch(d=>{g=d}),$s(n.route,o,l)]);if(g)throw g;s=k[0]}else if(await $s(n.route,o,l),h=n.route[e],h)s=await y(h);else if(e==="action"){let g=new URL(t.url),k=g.pathname+g.search;throw Qe(405,{method:t.method,pathname:k,routeId:n.route.id})}else return{type:pe.data,data:void 0};else if(h)s=await y(h);else{let g=new URL(t.url),k=g.pathname+g.search;throw Qe(404,{pathname:k})}V(s!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(h){a=pe.error,s=h}finally{p&&t.signal.removeEventListener("abort",p)}if(ev(s)){let h=s.status;if(Wm.has(h)){let d=s.headers.get("Location");if(V(d,"Redirects returned/thrown from loaders/actions must have a Location header"),!wd.test(d))d=cu(new URL(t.url),r.slice(0,r.indexOf(n)+1),i,!0,d);else if(!u.isStaticRequest){let f=new URL(t.url),m=d.startsWith("//")?new URL(f.protocol+d):new URL(d),c=rr(m.pathname,i)!=null;m.origin===f.origin&&c&&(d=m.pathname+m.search+m.hash)}if(u.isStaticRequest)throw s.headers.set("Location",d),s;return{type:pe.redirect,status:h,location:d,revalidate:s.headers.get("X-Remix-Revalidate")!==null,reloadDocument:s.headers.get("X-Remix-Reload-Document")!==null}}if(u.isRouteRequest)throw{type:a===pe.error?pe.error:pe.data,response:s};let g,k=s.headers.get("Content-Type");return k&&/\bapplication\/json\b/.test(k)?g=await s.json():g=await s.text(),a===pe.error?{type:a,error:new sa(h,s.statusText,g),headers:s.headers}:{type:pe.data,data:g,statusCode:s.status,headers:s.headers}}if(a===pe.error)return{type:a,error:s};if(bm(s)){var v,E;return{type:pe.deferred,deferredData:s,statusCode:(v=s.init)==null?void 0:v.status,headers:((E=s.init)==null?void 0:E.headers)&&new Headers(s.init.headers)}}return{type:pe.data,data:s}}function Sr(e,t,n,r){let l=e.createURL(kd(t)).toString(),o={signal:n};if(r&&nt(r.formMethod)){let{formMethod:i,formEncType:u}=r;o.method=i.toUpperCase(),u==="application/json"?(o.headers=new Headers({"Content-Type":u}),o.body=JSON.stringify(r.json)):u==="text/plain"?o.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?o.body=fu(r.formData):o.body=r.formData}return new Request(l,o)}function fu(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Vs(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Zm(e,t,n,r,l){let o={},i=null,u,a=!1,s={};return n.forEach((p,y)=>{let v=t[y].route.id;if(V(!Kn(p),"Cannot handle redirect results in processLoaderData"),Fr(p)){let E=An(e,v),h=p.error;r&&(h=Object.values(r)[0],r=void 0),i=i||{},i[E.route.id]==null&&(i[E.route.id]=h),o[v]=void 0,a||(a=!0,u=gd(p.error)?p.error.status:500),p.headers&&(s[v]=p.headers)}else dn(p)?(l.set(v,p.deferredData),o[v]=p.deferredData.data):o[v]=p.data,p.statusCode!=null&&p.statusCode!==200&&!a&&(u=p.statusCode),p.headers&&(s[v]=p.headers)}),r&&(i=r,o[Object.keys(r)[0]]=void 0),{loaderData:o,errors:i,statusCode:u||200,loaderHeaders:s}}function Ws(e,t,n,r,l,o,i,u){let{loaderData:a,errors:s}=Zm(t,n,r,l,u);for(let p=0;pr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Qs(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Qe(e,t){let{pathname:n,routeId:r,method:l,type:o}=t===void 0?{}:t,i="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(i="Bad Request",l&&n&&r?u="You made a "+l+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?u="defer() is not supported in actions":o==="invalid-body"&&(u="Unable to encode submission body")):e===403?(i="Forbidden",u='Route "'+r+'" does not match URL "'+n+'"'):e===404?(i="Not Found",u='No route matches URL "'+n+'"'):e===405&&(i="Method Not Allowed",l&&n&&r?u="You made a "+l.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":l&&(u='Invalid request method "'+l.toUpperCase()+'"')),new sa(e||500,i,new Error(u),!0)}function Ks(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(Kn(n))return{result:n,idx:t}}}function kd(e){let t=typeof e=="string"?pt(e):e;return Sn(oe({},t,{hash:""}))}function qm(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function dn(e){return e.type===pe.deferred}function Fr(e){return e.type===pe.error}function Kn(e){return(e&&e.type)===pe.redirect}function bm(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 ev(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function tv(e){return Vm.has(e.toLowerCase())}function nt(e){return Bm.has(e.toLowerCase())}async function Ys(e,t,n,r,l,o){for(let i=0;iy.route.id===a.route.id),p=s!=null&&!Ed(s,a)&&(o&&o[a.route.id])!==void 0;if(dn(u)&&(l||p)){let y=r[i];V(y,"Expected an AbortSignal for revalidating fetcher deferred result"),await xd(u,y,l).then(v=>{v&&(n[i]=v||n[i])})}}}async function xd(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:pe.data,data:e.deferredData.unwrappedData}}catch(l){return{type:pe.error,error:l}}return{type:pe.data,data:e.deferredData.data}}}function ca(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function du(e,t){let n=typeof t=="string"?pt(t).search:t.search;if(e[e.length-1].route.index&&ca(n||""))return e[e.length-1];let r=To(e);return r[r.length-1]}function Xs(e){let{formMethod:t,formAction:n,formEncType:r,text:l,formData:o,json:i}=e;if(!(!t||!n||!r)){if(l!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:l};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:i,text:void 0}}}function mi(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 nv(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 Er(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 rv(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 Pn(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 lv(e,t){try{let n=e.sessionStorage.getItem(Sd);if(n){let r=JSON.parse(n);for(let[l,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(l,new Set(o||[]))}}catch{}}function ov(e,t){if(t.size>0){let n={};for(let[r,l]of t)n[r]=[...l];try{e.sessionStorage.setItem(Sd,JSON.stringify(n))}catch(r){Zt(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** * React Router v6.17.0 * @@ -66,4 +66,4 @@ Error generating stack: `+o.message+` * * @license MIT */function tl(){return tl=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[l]=e[l]);return n}function Cv(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Pv(e,t){return e.button===0&&(!t||t==="_self")&&!Cv(e)}function pu(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(l=>[n,l]):[[n,r]])},[]))}function Rv(e,t){let n=pu(e);return t&&t.forEach((r,l)=>{n.has(l)||t.getAll(l).forEach(o=>{n.append(l,o)})}),n}const _v=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"];function Lv(e,t){return Ym({basename:t==null?void 0:t.basename,future:tl({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:mm({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||Tv(),routes:e,mapRouteProperties:kv,window:t==null?void 0:t.window}).initialize()}function Tv(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=tl({},t,{errors:Nv(t.errors)})),t}function Nv(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,l]of t)if(l&&l.__type==="RouteErrorResponse")n[r]=new sa(l.status,l.statusText,l.data,l.internal===!0);else if(l&&l.__type==="Error"){if(l.__subType){let o=window[l.__subType];if(typeof o=="function")try{let i=new o(l.message);i.stack="",n[r]=i}catch{}}if(n[r]==null){let o=new Error(l.message);o.stack="",n[r]=o}}else n[r]=l;return n}const Dv=_.createContext({isTransitioning:!1}),Mv="startTransition",Gs=lp[Mv];function zv(e){Gs?Gs(e):e()}class jv{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function Ov(e){let{fallbackElement:t,router:n,future:r}=e,[l,o]=_.useState(n.state),[i,u]=_.useState(),[a,s]=_.useState({isTransitioning:!1}),[p,y]=_.useState(),[v,E]=_.useState(),[h,g]=_.useState(),{v7_startTransition:k}=r||{},d=_.useCallback(P=>{k?zv(P):P()},[k]),f=_.useCallback((P,R)=>{let{unstable_viewTransitionOpts:T}=R;!T||n.window==null||typeof n.window.document.startViewTransition!="function"?d(()=>o(P)):v&&p?(p.resolve(),v.skipTransition(),g({state:P,currentLocation:T.currentLocation,nextLocation:T.nextLocation})):(u(P),s({isTransitioning:!0,currentLocation:T.currentLocation,nextLocation:T.nextLocation}))},[d,v,p,n.window]);_.useLayoutEffect(()=>n.subscribe(f),[n,f]),_.useEffect(()=>{a.isTransitioning&&y(new jv)},[a.isTransitioning]),_.useEffect(()=>{if(p&&i&&n.window){let P=i,R=p.promise,T=n.window.document.startViewTransition(async()=>{d(()=>o(P)),await R});T.finished.finally(()=>{y(void 0),E(void 0),u(void 0),s({isTransitioning:!1})}),E(T)}},[d,i,p,n.window]),_.useEffect(()=>{p&&i&&l.location.key===i.location.key&&p.resolve()},[p,v,l.location,i]),_.useEffect(()=>{!a.isTransitioning&&h&&(u(h.state),s({isTransitioning:!0,currentLocation:h.currentLocation,nextLocation:h.nextLocation}),g(void 0))},[a.isTransitioning,h]);let m=_.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:P=>n.navigate(P),push:(P,R,T)=>n.navigate(P,{state:R,preventScrollReset:T==null?void 0:T.preventScrollReset}),replace:(P,R,T)=>n.navigate(P,{replace:!0,state:R,preventScrollReset:T==null?void 0:T.preventScrollReset})}),[n]),c=n.basename||"/",x=_.useMemo(()=>({router:n,navigator:m,static:!1,basename:c}),[n,m,c]);return _.createElement(_.Fragment,null,_.createElement(No.Provider,{value:x},_.createElement(Cd.Provider,{value:l},_.createElement(Dv.Provider,{value:a},_.createElement(Ev,{basename:c,location:l.location,navigationType:l.historyAction,navigator:m},l.initialized?_.createElement(Fv,{routes:n.routes,state:l}):t)))),null)}function Fv(e){let{routes:t,state:n}=e;return sv(t,void 0,n)}const Uv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Iv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kr=_.forwardRef(function(t,n){let{onClick:r,relative:l,reloadDocument:o,replace:i,state:u,target:a,to:s,preventScrollReset:p,unstable_viewTransition:y}=t,v=xv(t,_v),{basename:E}=_.useContext(lr),h,g=!1;if(typeof s=="string"&&Iv.test(s)&&(h=s,Uv))try{let m=new URL(window.location.href),c=s.startsWith("//")?new URL(m.protocol+s):new URL(s),x=rr(c.pathname,E);c.origin===m.origin&&x!=null?s=x+c.search+c.hash:g=!0}catch{}let k=iv(s,{relative:l}),d=Av(s,{replace:i,state:u,target:a,preventScrollReset:p,relative:l,unstable_viewTransition:y});function f(m){r&&r(m),m.defaultPrevented||d(m)}return _.createElement("a",tl({},v,{href:h||k,onClick:g||o?r:f,ref:n,target:a}))});var Js;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Js||(Js={}));var Zs;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Zs||(Zs={}));function Av(e,t){let{target:n,replace:r,state:l,preventScrollReset:o,relative:i,unstable_viewTransition:u}=t===void 0?{}:t,a=fa(),s=al(),p=_d(e,{relative:i});return _.useCallback(y=>{if(Pv(y,n)){y.preventDefault();let v=r!==void 0?r:Sn(s)===Sn(p);a(e,{replace:v,state:l,preventScrollReset:o,relative:i,unstable_viewTransition:u})}},[s,a,p,r,l,n,e,o,i,u])}function Bv(e){let t=_.useRef(pu(e)),n=_.useRef(!1),r=al(),l=_.useMemo(()=>Rv(r.search,n.current?null:t.current),[r.search]),o=fa(),i=_.useCallback((u,a)=>{const s=pu(typeof u=="function"?u(l):u);n.current=!0,o("?"+s,a)},[o,l]);return[l,i]}const ha=_.createContext();var Td={exports:{}};/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress - * @license MIT */(function(e,t){(function(n,r){e.exports=r()})(Vd,function(){var n={};n.version="0.2.0";var r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
'};n.configure=function(h){var g,k;for(g in h)k=h[g],k!==void 0&&h.hasOwnProperty(g)&&(r[g]=k);return this},n.status=null,n.set=function(h){var g=n.isStarted();h=l(h,r.minimum,1),n.status=h===1?null:h;var k=n.render(!g),d=k.querySelector(r.barSelector),f=r.speed,m=r.easing;return k.offsetWidth,u(function(c){r.positionUsing===""&&(r.positionUsing=n.getPositioningCSS()),a(d,i(h,f,m)),h===1?(a(k,{transition:"none",opacity:1}),k.offsetWidth,setTimeout(function(){a(k,{transition:"all "+f+"ms linear",opacity:0}),setTimeout(function(){n.remove(),c()},f)},f)):setTimeout(c,f)}),this},n.isStarted=function(){return typeof n.status=="number"},n.start=function(){n.status||n.set(0);var h=function(){setTimeout(function(){n.status&&(n.trickle(),h())},r.trickleSpeed)};return r.trickle&&h(),this},n.done=function(h){return!h&&!n.status?this:n.inc(.3+.5*Math.random()).set(1)},n.inc=function(h){var g=n.status;return g?(typeof h!="number"&&(h=(1-g)*l(Math.random()*g,.1,.95)),g=l(g+h,0,.994),n.set(g)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},function(){var h=0,g=0;n.promise=function(k){return!k||k.state()==="resolved"?this:(g===0&&n.start(),h++,g++,k.always(function(){g--,g===0?(h=0,n.done()):n.set((h-g)/h)}),this)}}(),n.render=function(h){if(n.isRendered())return document.getElementById("nprogress");p(document.documentElement,"nprogress-busy");var g=document.createElement("div");g.id="nprogress",g.innerHTML=r.template;var k=g.querySelector(r.barSelector),d=h?"-100":o(n.status||0),f=document.querySelector(r.parent),m;return a(k,{transition:"all 0 linear",transform:"translate3d("+d+"%,0,0)"}),r.showSpinner||(m=g.querySelector(r.spinnerSelector),m&&E(m)),f!=document.body&&p(f,"nprogress-custom-parent"),f.appendChild(g),g},n.remove=function(){y(document.documentElement,"nprogress-busy"),y(document.querySelector(r.parent),"nprogress-custom-parent");var h=document.getElementById("nprogress");h&&E(h)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var h=document.body.style,g="WebkitTransform"in h?"Webkit":"MozTransform"in h?"Moz":"msTransform"in h?"ms":"OTransform"in h?"O":"";return g+"Perspective"in h?"translate3d":g+"Transform"in h?"translate":"margin"};function l(h,g,k){return hk?k:h}function o(h){return(-1+h)*100}function i(h,g,k){var d;return r.positionUsing==="translate3d"?d={transform:"translate3d("+o(h)+"%,0,0)"}:r.positionUsing==="translate"?d={transform:"translate("+o(h)+"%,0)"}:d={"margin-left":o(h)+"%"},d.transition="all "+g+"ms "+k,d}var u=function(){var h=[];function g(){var k=h.shift();k&&k(g)}return function(k){h.push(k),h.length==1&&g()}}(),a=function(){var h=["Webkit","O","Moz","ms"],g={};function k(c){return c.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(x,P){return P.toUpperCase()})}function d(c){var x=document.body.style;if(c in x)return c;for(var P=h.length,R=c.charAt(0).toUpperCase()+c.slice(1),T;P--;)if(T=h[P]+R,T in x)return T;return c}function f(c){return c=k(c),g[c]||(g[c]=d(c))}function m(c,x,P){x=f(x),c.style[x]=P}return function(c,x){var P=arguments,R,T;if(P.length==2)for(R in x)T=x[R],T!==void 0&&x.hasOwnProperty(R)&&m(c,R,T);else m(c,P[1],P[2])}}();function s(h,g){var k=typeof h=="string"?h:v(h);return k.indexOf(" "+g+" ")>=0}function p(h,g){var k=v(h),d=k+g;s(k,g)||(h.className=d.substring(1))}function y(h,g){var k=v(h),d;s(h,g)&&(d=k.replace(" "+g+" "," "),h.className=d.substring(1,d.length-1))}function v(h){return(" "+(h.className||"")+" ").replace(/\s+/gi," ")}function E(h){h&&h.parentNode&&h.parentNode.removeChild(h)}return n})})(Td);var $v=Td.exports;const qs=bs($v);const Mo=({title:e="Default Title",children:t})=>{const n=_.useContext(ha),r=gv();return _.useEffect(()=>{r.state==="loading"?qs.start():qs.done()}),document.title=e,D.jsxs("div",{children:["Global State: ",n.data.data.user.name," ",n.data.data.user.email,D.jsx("h2",{children:" Links:"})," ",D.jsx("br",{}),D.jsx(kr,{to:"/",children:"Home"})," ",D.jsx("br",{}),D.jsx(kr,{to:"/test",children:"Loader APi Example"})," ",D.jsx("br",{}),D.jsx(kr,{to:"/redirect",children:"Redirect"})," ",D.jsx("br",{}),D.jsx(kr,{to:"/update/hello-world",children:"Parameter"})," ",D.jsx("br",{}),D.jsx(kr,{to:"/datatable",replace:!0,children:"Data Table"})," ",D.jsx("br",{}),D.jsx("br",{}),t]})};function Vv(){var r,l,o;const e=_.useContext(ha),{id:t}=av();function n(){e.setData({...e.data,isLoading:!0,data:{...e.data.data,user:{...e.data.data.user,name:"updated name"}}})}return D.jsx(D.Fragment,{children:D.jsxs(Mo,{children:["Dynamic param: ",t," ",D.jsx("br",{}),(o=(l=(r=e==null?void 0:e.data)==null?void 0:r.data)==null?void 0:l.user)==null?void 0:o.name,D.jsx("button",{onClick:n,children:"Update Global State"})]})})}function Wv(){const e=yv();return D.jsx(D.Fragment,{children:D.jsxs(Mo,{children:["Loader data:",e.map((t,n)=>D.jsx("li",{children:t.name},n))]})})}function Hv(){const e=fa();return _.useEffect(()=>{e("/")}),D.jsx(D.Fragment,{children:"Redirecting..."})}const Qv=()=>{const[e,t]=_.useState([{name:"sharif",email:"sharif@default.com",age:22},{name:"arif",email:"arif@default.com",age:23},{name:"test",email:"test@default.com",age:21}]),[n,r]=_.useState(),[l,o]=_.useState(),[i,u]=Bv();_.useEffect(()=>{const s=i.get("search");if(s){const p=e.filter(y=>y.name.includes(s)||y.email.includes(s)||y.age==s);p.length>0&&r(p)}else u(""),r(e)},[i,e]);function a(s){s.preventDefault(),t(p=>[l,...p])}return D.jsx(D.Fragment,{children:D.jsx(Mo,{title:"DataTable Page",children:D.jsxs("center",{children:[D.jsx("h2",{children:"Live Data Form."}),D.jsx("hr",{}),D.jsx("h3",{children:"Add Data"}),D.jsxs("form",{children:[D.jsx("input",{type:"text",placeholder:"Name",onChange:s=>o({...l,name:s.target.value})})," ",D.jsx("br",{}),D.jsx("input",{type:"email",placeholder:"Email",onChange:s=>o({...l,email:s.target.value})})," ",D.jsx("br",{}),D.jsx("input",{type:"number",placeholder:"Age",onChange:s=>o({...l,age:s.target.value})})," ",D.jsx("br",{}),D.jsx("input",{type:"submit",value:"Add",onClick:a})]}),D.jsx("br",{}),D.jsx("hr",{}),D.jsx("h3",{children:"Search Data"}),D.jsx("input",{type:"search",placeholder:"Search...",onChange:s=>u(`search=${s.target.value}`)}),D.jsxs("table",{border:"1",children:[D.jsx("thead",{children:D.jsxs("tr",{children:[D.jsx("th",{children:"Name"}),D.jsx("th",{children:"Email"}),D.jsx("th",{children:"Age"})]})}),D.jsx("tbody",{children:n&&n.map((s,p)=>D.jsxs("tr",{children:[D.jsx("td",{children:s.name}),D.jsx("td",{children:s.email}),D.jsx("td",{children:s.age})]},p))})]})]})})})};function Kv(){return D.jsx(D.Fragment,{children:D.jsx(Mo,{title:"Home Page"})})}const Yv=Lv([{path:"/",element:D.jsx(Kv,{})},{path:"/test",element:D.jsx(Wv,{}),loader:()=>(async()=>await(await fetch("https://jsonplaceholder.typicode.com/users")).json())()},{path:"/update/:id?",element:D.jsx(Vv,{})},{path:"/redirect",element:D.jsx(Hv,{})},{path:"/datatable",element:D.jsx(Qv,{})}]),Xv=()=>{const[e,t]=_.useState({isLoading:!1,data:{user:{name:"sharif",email:"developersharif@yahoo.com"}}});return D.jsx(sc.StrictMode,{children:D.jsx(ha.Provider,{value:{data:e,setData:t},children:D.jsx(Ov,{router:Yv})})})};vi.createRoot(document.getElementById("root")).render(D.jsx(Xv,{})); + * @license MIT */(function(e,t){(function(n,r){e.exports=r()})(Vd,function(){var n={};n.version="0.2.0";var r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
'};n.configure=function(h){var g,k;for(g in h)k=h[g],k!==void 0&&h.hasOwnProperty(g)&&(r[g]=k);return this},n.status=null,n.set=function(h){var g=n.isStarted();h=l(h,r.minimum,1),n.status=h===1?null:h;var k=n.render(!g),d=k.querySelector(r.barSelector),f=r.speed,m=r.easing;return k.offsetWidth,u(function(c){r.positionUsing===""&&(r.positionUsing=n.getPositioningCSS()),a(d,i(h,f,m)),h===1?(a(k,{transition:"none",opacity:1}),k.offsetWidth,setTimeout(function(){a(k,{transition:"all "+f+"ms linear",opacity:0}),setTimeout(function(){n.remove(),c()},f)},f)):setTimeout(c,f)}),this},n.isStarted=function(){return typeof n.status=="number"},n.start=function(){n.status||n.set(0);var h=function(){setTimeout(function(){n.status&&(n.trickle(),h())},r.trickleSpeed)};return r.trickle&&h(),this},n.done=function(h){return!h&&!n.status?this:n.inc(.3+.5*Math.random()).set(1)},n.inc=function(h){var g=n.status;return g?(typeof h!="number"&&(h=(1-g)*l(Math.random()*g,.1,.95)),g=l(g+h,0,.994),n.set(g)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},function(){var h=0,g=0;n.promise=function(k){return!k||k.state()==="resolved"?this:(g===0&&n.start(),h++,g++,k.always(function(){g--,g===0?(h=0,n.done()):n.set((h-g)/h)}),this)}}(),n.render=function(h){if(n.isRendered())return document.getElementById("nprogress");p(document.documentElement,"nprogress-busy");var g=document.createElement("div");g.id="nprogress",g.innerHTML=r.template;var k=g.querySelector(r.barSelector),d=h?"-100":o(n.status||0),f=document.querySelector(r.parent),m;return a(k,{transition:"all 0 linear",transform:"translate3d("+d+"%,0,0)"}),r.showSpinner||(m=g.querySelector(r.spinnerSelector),m&&E(m)),f!=document.body&&p(f,"nprogress-custom-parent"),f.appendChild(g),g},n.remove=function(){y(document.documentElement,"nprogress-busy"),y(document.querySelector(r.parent),"nprogress-custom-parent");var h=document.getElementById("nprogress");h&&E(h)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var h=document.body.style,g="WebkitTransform"in h?"Webkit":"MozTransform"in h?"Moz":"msTransform"in h?"ms":"OTransform"in h?"O":"";return g+"Perspective"in h?"translate3d":g+"Transform"in h?"translate":"margin"};function l(h,g,k){return hk?k:h}function o(h){return(-1+h)*100}function i(h,g,k){var d;return r.positionUsing==="translate3d"?d={transform:"translate3d("+o(h)+"%,0,0)"}:r.positionUsing==="translate"?d={transform:"translate("+o(h)+"%,0)"}:d={"margin-left":o(h)+"%"},d.transition="all "+g+"ms "+k,d}var u=function(){var h=[];function g(){var k=h.shift();k&&k(g)}return function(k){h.push(k),h.length==1&&g()}}(),a=function(){var h=["Webkit","O","Moz","ms"],g={};function k(c){return c.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(x,P){return P.toUpperCase()})}function d(c){var x=document.body.style;if(c in x)return c;for(var P=h.length,R=c.charAt(0).toUpperCase()+c.slice(1),T;P--;)if(T=h[P]+R,T in x)return T;return c}function f(c){return c=k(c),g[c]||(g[c]=d(c))}function m(c,x,P){x=f(x),c.style[x]=P}return function(c,x){var P=arguments,R,T;if(P.length==2)for(R in x)T=x[R],T!==void 0&&x.hasOwnProperty(R)&&m(c,R,T);else m(c,P[1],P[2])}}();function s(h,g){var k=typeof h=="string"?h:v(h);return k.indexOf(" "+g+" ")>=0}function p(h,g){var k=v(h),d=k+g;s(k,g)||(h.className=d.substring(1))}function y(h,g){var k=v(h),d;s(h,g)&&(d=k.replace(" "+g+" "," "),h.className=d.substring(1,d.length-1))}function v(h){return(" "+(h.className||"")+" ").replace(/\s+/gi," ")}function E(h){h&&h.parentNode&&h.parentNode.removeChild(h)}return n})})(Td);var $v=Td.exports;const qs=bs($v);const Mo=({title:e="Default Title",children:t})=>{const n=_.useContext(ha),r=gv();return _.useEffect(()=>{r.state==="loading"?qs.start():qs.done()}),document.title=e,M.jsxs("div",{children:["Global State: ",n.data.data.user.name," ",n.data.data.user.email,M.jsx("h2",{children:" Routes:"}),M.jsx(kr,{to:"/",children:"Home"})," ",M.jsx("br",{}),M.jsx(kr,{to:"/test",children:"Loader APi Example"})," ",M.jsx("br",{}),M.jsx(kr,{to:"/redirect",children:"Redirect"})," ",M.jsx("br",{}),M.jsx(kr,{to:"/update/hello-world",children:"Parameter"})," ",M.jsx("br",{}),M.jsx(kr,{to:"/datatable",replace:!0,children:"Data Table"})," ",M.jsx("br",{}),M.jsx("br",{}),t]})};function Vv(){var r,l,o;const e=_.useContext(ha),{id:t}=av();function n(){e.setData({...e.data,isLoading:!0,data:{...e.data.data,user:{...e.data.data.user,name:"updated name"}}})}return M.jsx(M.Fragment,{children:M.jsxs(Mo,{children:["Dynamic param: ",t," ",M.jsx("br",{}),(o=(l=(r=e==null?void 0:e.data)==null?void 0:r.data)==null?void 0:l.user)==null?void 0:o.name,M.jsx("button",{onClick:n,children:"Update Global State"})]})})}function Wv(){const e=yv();return M.jsx(M.Fragment,{children:M.jsxs(Mo,{children:["Loader data:",e.map((t,n)=>M.jsx("li",{children:t.name},n))]})})}function Hv(){const e=fa();return _.useEffect(()=>{e("/")}),M.jsx(M.Fragment,{children:"Redirecting..."})}const Qv=()=>{const[e,t]=_.useState([{name:"sharif",email:"sharif@default.com",age:22},{name:"arif",email:"arif@default.com",age:23},{name:"test",email:"test@default.com",age:21}]),[n,r]=_.useState(),[l,o]=_.useState(),[i,u]=Bv();_.useEffect(()=>{const s=i.get("search");if(s){const p=e.filter(y=>y.name.includes(s)||y.email.includes(s)||y.age==s);p.length>0&&r(p)}else u(""),r(e)},[i,e]);function a(s){s.preventDefault(),t(p=>[l,...p])}return M.jsx(M.Fragment,{children:M.jsx(Mo,{title:"DataTable Page",children:M.jsxs("center",{children:[M.jsx("h2",{children:"Live Data Form."}),M.jsx("hr",{}),M.jsx("h3",{children:"Add Data"}),M.jsxs("form",{children:[M.jsx("input",{type:"text",placeholder:"Name",onChange:s=>o({...l,name:s.target.value})})," ",M.jsx("br",{}),M.jsx("input",{type:"email",placeholder:"Email",onChange:s=>o({...l,email:s.target.value})})," ",M.jsx("br",{}),M.jsx("input",{type:"number",placeholder:"Age",onChange:s=>o({...l,age:s.target.value})})," ",M.jsx("br",{}),M.jsx("input",{type:"submit",value:"Add",onClick:a})]}),M.jsx("br",{}),M.jsx("hr",{}),M.jsx("h3",{children:"Search Data"}),M.jsx("input",{type:"search",placeholder:"Search...",onChange:s=>u(`search=${s.target.value}`)}),M.jsxs("table",{border:"1",children:[M.jsx("thead",{children:M.jsxs("tr",{children:[M.jsx("th",{children:"Name"}),M.jsx("th",{children:"Email"}),M.jsx("th",{children:"Age"})]})}),M.jsx("tbody",{children:n&&n.map((s,p)=>M.jsxs("tr",{children:[M.jsx("td",{children:s.name}),M.jsx("td",{children:s.email}),M.jsx("td",{children:s.age})]},p))})]})]})})})};function Kv(){return M.jsx(M.Fragment,{children:M.jsx(Mo,{title:"Home Page"})})}const Yv=Lv([{path:"/",element:M.jsx(Kv,{})},{path:"/test",element:M.jsx(Wv,{}),loader:()=>(async()=>await(await fetch("https://jsonplaceholder.typicode.com/users")).json())()},{path:"/update/:id?",element:M.jsx(Vv,{})},{path:"/redirect",element:M.jsx(Hv,{})},{path:"/datatable",element:M.jsx(Qv,{})}]),Xv=()=>{const[e,t]=_.useState({isLoading:!1,data:{user:{name:"sharif",email:"developersharif@yahoo.com"}}});return M.jsx(sc.StrictMode,{children:M.jsx(ha.Provider,{value:{data:e,setData:t},children:M.jsx(Ov,{router:Yv})})})};vi.createRoot(document.getElementById("root")).render(M.jsx(Xv,{})); diff --git a/index.html b/index.html index 4555fd6..4a5d7d3 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ Vite + React - +