const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DynamicDashboard-BiSAmfR8.js","assets/useToast-CS8pZhce.js","assets/dollar-sign-Bf6JneNn.js","assets/truck-D5o8mTsH.js","assets/utensils-BhILG_B7.js","assets/formatters-WvGQLZg0.js","assets/AreaChart-Bzq_VEEn.js","assets/OperationsModule-DU0oT0Rt.js","assets/building-BdUpGLM5.js","assets/phone-DpnQw4if.js","assets/user-CuEEaB8a.js","assets/mockData-DAqQG5te.js","assets/InventoryModule-DWliKRH1.js","assets/useOrders-D9bouyEq.js","assets/currency-DdDs82F5.js","assets/useInventory-d78AKbIO.js","assets/SalesModule-DAKBTXjF.js","assets/CrmModule-96_lCLTJ.js","assets/DynamicFormRenderer-BPuYsHXt.js","assets/types-DMl_5q2N.js","assets/file-text-DR21jZDS.js","assets/list-XDoRqfJ2.js","assets/star-B6hvSjuv.js","assets/upload-CY2IsfiN.js","assets/FinanceModule-CxEjvopo.js","assets/EmployeesModule-C0VszbvR.js","assets/CommunicationsModule-CRXuUNuh.js","assets/HelpDeskModule-DAbGCOpV.js","assets/TasksModule-CJeRoUgf.js","assets/link-DOg0dLYA.js","assets/CmsModule-Bp0oqz_9.js","assets/arrow-down-CWbiHuZO.js","assets/arrow-up-B4Ca-HNG.js","assets/image-B_RO1I7c.js","assets/settings-2-CSojebrG.js","assets/MarketingModule-RpE5CcpH.js","assets/AnalyticsModule-CUIgYnvl.js","assets/AutomationModule-ChWg_nAL.js","assets/terminal-CcncyL3J.js","assets/AiCenterModule-DJPYM3Y6.js","assets/AppsCatalogModule-BXZcdjXz.js","assets/types-CTcNpN0z.js","assets/SettingsModule-ClG-ZgbR.js","assets/indexedDb-D30TbhA6.js","assets/EntityCatalog-CEDNI60l.js","assets/panels-top-left-BomsDlf9.js","assets/table-_fqSCPRE.js","assets/FieldBuilder-DHYEX2iP.js","assets/fieldTypesMeta-8EBMnBZg.js","assets/mail-DOD5KO1v.js","assets/eye-CkF1gwUX.js","assets/pen-D8SS70u3.js","assets/FormBuilder-DsYKgy0A.js","assets/move-up-qiRY8MuU.js","assets/save-D8euL60I.js","assets/CardLayoutBuilder-CAtgCQkT.js","assets/ViewBuilder-C3JVZeVE.js","assets/arrow-up-down--M136cK3.js","assets/CustomEntityPage-DRX7pNvW.js"])))=>i.map(i=>d[i]); import{a as e,c as t,f as n,h as r,i,l as a,n as o,o as s,p as c,r as l,s as u,u as d}from"./useToast-CS8pZhce.js";import{n as f,t as p}from"./demo-D1nHL60J.js";import{S as m,b as h,c as g,f as _,g as v,h as y,i as b,l as x,m as S,n as C,o as w,p as T,r as E,s as ee,t as D,u as O,v as te,x as ne,y as re}from"./indexedDb-D30TbhA6.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var ie=c((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&ne(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-Tt&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ne(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(ee)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,te=O.port2;O.port1.onmessage=ee,D=function(){te.postMessage(null)}}else D=function(){_(ee,0)};function ne(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ne(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ae=c(((e,t)=>{t.exports=ie()})),oe=c((e=>{var t=n();function r(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=oe()})),ce=c((e=>{var t=ae(),r=n(),i=se();function a(e){var t=`https://react.dev/errors/`+e;if(1xe||(e.current=be[xe],be[xe]=null,xe--)}function Se(e,t){xe++,be[xe]=e.current,e.current=t}var Ce=P(null),we=P(null),Te=P(null),Ee=P(null);function De(e,t){switch(Se(Te,t),Se(we,e),Se(Ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}F(Ce),Se(Ce,e)}function Oe(){F(Ce),F(we),F(Te)}function ke(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,Se(Ee,e)),t=Ce.current;var n=dp(t,e.type);t!==n&&(Se(we,e),Se(Ce,n))}function Ae(e){we.current===e&&(F(Ce),F(we)),Ee.current===e&&(F(Ee),sh._currentValue=ye)}var je,Me;function Ne(e){if(je===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);je=t&&t[1]||``,Me=-1)`:-1i||c[r]!==l[i]){var u=` `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Pe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ne(n):``}function Ie(e,t){switch(e.tag){case 26:case 27:case 5:return Ne(e.type);case 16:return Ne(`Lazy`);case 13:return e.child!==t&&t!==null?Ne(`Suspense Fallback`):Ne(`Suspense`);case 19:return Ne(`SuspenseList`);case 0:case 15:return Fe(e.type,!1);case 11:return Fe(e.type.render,!1);case 1:return Fe(e.type,!0);case 31:return Ne(`Activity`);case 30:return Ne(`ViewTransition`);default:return``}}function Le(e){try{var t=``,n=null;do t+=Ie(e,n),n=e,e=e.return;while(e);return t}catch(e){return` Error generating stack: `+e.message+` `+e.stack}}var Re=Object.prototype.hasOwnProperty,ze=t.unstable_scheduleCallback,Be=t.unstable_cancelCallback,Ve=t.unstable_shouldYield,He=t.unstable_requestPaint,Ue=t.unstable_now,We=t.unstable_getCurrentPriorityLevel,Ge=t.unstable_ImmediatePriority,Ke=t.unstable_UserBlockingPriority,qe=t.unstable_NormalPriority,Je=t.unstable_LowPriority,Ye=t.unstable_IdlePriority,Xe=t.log,Ze=t.unstable_setDisableYieldValue,Qe=null,$e=null;function et(e){if(typeof Xe==`function`&&Ze(e),$e&&typeof $e.setStrictMode==`function`)try{$e.setStrictMode(Qe,e)}catch{}}var tt=Math.clz32?Math.clz32:it,nt=Math.log,rt=Math.LN2;function it(e){return e>>>=0,e===0?32:31-(nt(e)/rt|0)|0}var at=256,ot=262144,st=4194304;function ct(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function lt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=ct(n))):i=ct(o):i=ct(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ct(n))):i=ct(o)):i=ct(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function ut(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function dt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0n;n++)t.push(e);return t}function ht(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function gt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),jn=!1;if(An)try{var Mn={};Object.defineProperty(Mn,"passive",{get:function(){jn=!0}}),window.addEventListener(`test`,Mn,Mn),window.removeEventListener(`test`,Mn,Mn)}catch{jn=!1}var Nn=null,Pn=null,Fn=null;function In(){if(Fn)return Fn;var e,t=Pn,n=t.length,r,i=`value`in Nn?Nn.value:Nn.textContent,a=i.length;for(e=0;e=hr),vr=` `,yr=!1;function br(e,t){switch(e){case`keyup`:return pr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function xr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Sr=!1;function Cr(e,t){switch(e){case`compositionend`:return xr(t);case`keypress`:return t.which===32?(yr=!0,vr):null;case`textInput`:return e=t.data,e===vr&&yr?null:e;default:return null}}function wr(e,t){if(Sr)return e===`compositionend`||!mr&&br(e,t)?(e=In(),Fn=Pn=Nn=null,Sr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=qr(n)}}function Yr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Yr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Kr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Kr(e.document)}return t}function Zr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Qr=An&&`documentMode`in document&&11>=document.documentMode,$r=null,ei=null,ti=null,ni=!1;function ri(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ni||$r==null||$r!==Kr(r)||(r=$r,`selectionStart`in r&&Zr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ti&&Gr(ti,r)||(ti=r,r=Jf(ei,`onSelect`),0>=o,i-=o,$i=1<<32-tt(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),L&&ta(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),L&&ta(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return L&&ta(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),L&&ta(i,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===O&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case ee:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===O){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),uo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ue&&ro(l)===r.type){n(e,r.sibling),c=i(r,o.props),uo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===O?(c=Bi(o.props.children,e.mode,c,o.key),uo(c,o),c.return=e,e=c):(c=zi(o.type,o.key,o.props,null,e.mode,c),uo(c,o),c.return=e,e=c)}return s(e);case D:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ui(o,e.mode,c),c.return=e,e=c}return s(e);case ue:return o=ro(o),_(e,r,o,c)}if(ve(o))return h(e,r,o,c);if(ge(o)){if(l=ge(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,lo(o),c);if(o.$$typeof===ie)return _(e,r,ka(e,o),c);fo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=Vi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{co=0;var i=_(e,t,n,r);return so=null,i}catch(t){if(t===Za||t===$a)throw t;var a=Fi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var mo=po(!0),ho=po(!1),go=!1;function _o(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function yo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function bo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Mi(e),ji(e,null,n),t}return Oi(e,r,t,n),Mi(e)}function xo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vt(e,n)}}function So(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Co=!1;function wo(){if(Co){var e=Ha;if(e!==null)throw e}}function To(e,t,n,r){Co=!1;var i=e.updateQueue;go=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Y&f)===f:(r&f)===f){f!==0&&f===R&&(Co=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:go=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),od|=o,e.lanes=o,e.memoizedState=d}}function Eo(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function Do(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=M.T,s={};s.types=o===null?null:o.types,M.T=s,pc(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?fc(e,t,Ga(c,r),jd(e)):fc(e,t,r,jd(e))}catch(n){fc(e,t,{then:function(){},status:`rejected`,reason:n},jd())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function nc(){}function rc(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=ic(e).queue;tc(e,i,t,ye,n===null?nc:function(){return ac(e),n(r)})}function ic(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:ye},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ac(e){var t=ic(e);t.next===null&&(t=e.alternate.memoizedState),fc(e,t.next.queue,{},jd())}function oc(){return Oa(sh)}function sc(){return ls().memoizedState}function cc(){return ls().memoizedState}function lc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=jd();e=yo(n);var r=bo(t,e,n);r!==null&&(Pd(r,t,n),xo(r,t,n)),t={cache:Fa()},e.payload=t;return}t=t.return}}function uc(e,t,n){var r=jd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},mc(e)?hc(t,n):(n=ki(e,t,n,r),n!==null&&(Pd(n,e,r),gc(n,t,r)))}function dc(e,t,n){fc(e,t,n,jd())}function fc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(mc(e))hc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Wr(s,o))return Oi(e,t,i,0),q===null&&Di(),!1}catch{}if(n=ki(e,t,i,r),n!==null)return Pd(n,e,r),gc(n,t,r),!0}return!1}function pc(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},mc(e)){if(t)throw Error(a(479))}else t=ki(e,n,r,2),t!==null&&Pd(t,e,2)}function mc(e){var t=e.alternate;return e===z||t!==null&&t===z}function hc(e,t){qo=Ko=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function gc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vt(e,n)}}var _c={readContext:Oa,use:fs,useCallback:$o,useContext:$o,useEffect:$o,useImperativeHandle:$o,useLayoutEffect:$o,useInsertionEffect:$o,useMemo:$o,useReducer:$o,useRef:$o,useState:$o,useDebugValue:$o,useDeferredValue:$o,useTransition:$o,useSyncExternalStore:$o,useId:$o,useHostTransitionStatus:$o,useFormState:$o,useActionState:$o,useOptimistic:$o,useMemoCache:$o,useCacheRefresh:$o,useEffectEvent:$o},vc={readContext:Oa,use:fs,useCallback:function(e,t){return cs().memoizedState=[e,t===void 0?null:t],e},useContext:Oa,useEffect:Hs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Bs(4194308,4,Js.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bs(4194308,4,e,t)},useInsertionEffect:function(e,t){Bs(4,2,e,t)},useMemo:function(e,t){var n=cs();t=t===void 0?null:t;var r=e();if(Jo){et(!0);try{e()}finally{et(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=cs();if(n!==void 0){var i=n(t);if(Jo){et(!0);try{n(t)}finally{et(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=uc.bind(null,z,e),[r.memoizedState,e]},useRef:function(e){var t=cs();return e={current:e},t.memoizedState=e},useState:function(e){e=ws(e);var t=e.queue,n=dc.bind(null,z,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Xs,useDeferredValue:function(e,t){return $s(cs(),e,t)},useTransition:function(){var e=ws(!1);return e=tc.bind(null,z,e.queue,!0,!1),cs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=z,i=cs();if(L){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),q===null)throw Error(a(349));Y&127||ys(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Hs(xs.bind(null,r,o,e),[e]),r.flags|=2048,Rs(9,{destroy:void 0},bs.bind(null,r,o,n,t),null),n},useId:function(){var e=cs(),t=q.identifierPrefix;if(L){var n=ea,r=$i;n=(r&~(1<<32-tt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Yo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[Tt]=t,o[Et]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(np(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&hl(t)}}return bl(t),t.subtreeFlags&=-33554433,gl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=Te.current,ma(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=oa,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Tt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||da(t,!0)}else e=lp(e).createTextNode(r),e[Tt]=t,t.stateNode=e}return bl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ma(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[Tt]=t}else ha(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;bl(t),e=!1}else n=ga(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(zo(t),t):(zo(t),null);if(t.flags&128)throw Error(a(558))}return bl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=ma(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[Tt]=t}else ha(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;bl(t),i=!1}else i=ga(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(zo(t),t):(zo(t),null)}return zo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),vl(t,t.updateQueue),bl(t),null);case 4:return Oe(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,bl(t),null;case 10:return Sa(t.type),bl(t),null;case 19:if(Ho(t),r=t.memoizedState,r===null)return bl(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)yl(r,!1);else{if(ad!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Uo(e),o!==null){for(t.flags|=128,yl(r,!1),e=o.updateQueue,t.updateQueue=e,vl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ri(n,e),n=n.sibling;return Vo(t,Bo.current&1|2),L&&ta(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ue()>gd&&(t.flags|=128,i=!0,yl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=Uo(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,vl(t,e),yl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!L)return bl(t),null}else 2*Ue()-r.renderingStartTime>gd&&n!==536870912&&(t.flags|=128,i=!0,yl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ue(),e.sibling=null,o=Bo.current,o=i?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||L?Vo(t,o):(n=o,Se(No,t),Se(Bo,n),Po===null&&(Po=t)),L&&ta(t,r.treeForkCount),e}return bl(t),null;case 22:case 23:return zo(t),Mo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(bl(t),t.subtreeFlags&6&&(t.flags|=8192)):bl(t),n=t.updateQueue,n!==null&&vl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&F(qa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Sa(Pa),bl(t),null;case 25:return null;case 30:return t.flags|=33554432,bl(t),null}throw Error(a(156,t.tag))}function Sl(e,t){switch(ia(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Sa(Pa),Oe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ae(t),null;case 31:if(t.memoizedState!==null){if(zo(t),t.alternate===null)throw Error(a(340));ha()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(zo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));ha()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ho(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Oe(),null;case 10:return Sa(t.type),null;case 22:case 23:return zo(t),Mo(),e!==null&&F(qa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Sa(Pa),null;case 25:return null;default:return null}}function Cl(e,t){switch(ia(t),t.tag){case 3:Sa(Pa),Oe();break;case 26:case 27:case 5:Ae(t);break;case 4:Oe();break;case 31:t.memoizedState!==null&&zo(t);break;case 13:zo(t);break;case 19:Ho(t);break;case 10:Sa(t.type);break;case 22:case 23:zo(t),Mo(),e!==null&&F(qa);break;case 24:Sa(Pa)}}function H(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function wl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Tl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Do(t,n)}catch(t){Z(e,e.return,t)}}}function El(e,t,n){n.props=Tc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Dl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=bi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);p(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Ol(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}}function kl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n title`))),np(r,t,n),r[Tt]=e,zt(r),t=r;break a;case`link`:if(o=Gm(`link`,`href`,i).get(t+(n.href||``))){for(s=0;sg&&(o=g,g=h,h=o);var _=Jr(s,h),v=Jr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,M.T=null,n=wd,wd=null;var o=bd,s=Sd;if(yd=0,xd=bd=null,Sd=0,K&6)throw Error(a(331));var c=K;if(K|=4,Yu(o.current),Uu(o,o.current,s,n),K=c,Df(0,!1),$e&&typeof $e.onPostCommitFiberRoot==`function`)try{$e.onPostCommitFiberRoot(Qe,o)}catch{}return!0}finally{N.p=i,M.T=r,uf(e,t)}}function pf(e,t,n){t=Gi(n,t),t=jc(e.stateNode,t,2),e=bo(e,t,2),e!==null&&(ht(e,2),Ef(e))}function Z(e,t,n){if(e.tag===3)pf(e,e,n);else for(;t!==null;){if(t.tag===3){pf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(vd===null||!vd.has(r))){e=Gi(n,e),n=Mc(2),r=bo(t,n,2),r!==null&&(Nc(n,r,t,e),ht(r,2),Ef(r));break}}t=t.return}}function mf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $u;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(rd=!0,i.add(n),e=hf.bind(null,e,t,n),t.then(e,e))}function hf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,q===e&&(Y&n)===n&&(ad===4||ad===3&&(Y&62914560)===Y&&300>Ue()-md?K&2?cd|=n:Vd(e,0):cd|=n,ud===Y&&(ud=0)),Ef(e)}function gf(e,t){t===0&&(t=pt()),e=Ai(e,t),e!==null&&(ht(e,t),Ef(e))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gf(e,n)}function vf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),gf(e,n)}function yf(e,t){return ze(e,t)}var bf=null,xf=null,Sf=!1,Cf=!1,wf=!1,Tf=0;function Ef(e){e!==xf&&e.next===null&&(xf===null?bf=xf=e:xf=xf.next=e),Cf=!0,Sf||(Sf=!0,Nf())}function Df(e,t){if(!wf&&Cf){wf=!0;do for(var n=!1,r=bf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-tt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Mf(r,a))}else a=Y,a=lt(r,r===q?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ut(r,a)||(n=!0,Mf(r,a))}r=r.next}while(n);wf=!1}}function Of(){kf()}function kf(){Cf=Sf=!1;var e=0;Tf!==0&&hp()&&(e=Tf);for(var t=Ue(),n=null,r=bf;r!==null;){var i=r.next,a=Af(r,t);a===0?(r.next=null,n===null?bf=i:n.next=i,i===null&&(xf=n)):(n=r,(e!==0||a&3)&&(Cf=!0)),r=i}yd!==0&&yd!==5||Df(e,!1),Tf!==0&&(Tf=0)}function Af(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=on(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),zt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+on(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+on(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+on(n.imageSizes)+`"]`)):i+=`[href="`+on(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[Nt]=!0,o.onload=o.onerror=function(){Bt(o)}),zt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+on(r)+`"][href="`+on(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),zt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Rt(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);zt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Rt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),zt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Rt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),zt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var i=(i=Te.current)?bm(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=Rt(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var o=Rt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(i,e,o,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=Rt(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Pm(e){return`href="`+on(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Nt]){r.loading=1;return}}else t=e.createElement(`link`),t[Nt]=!0,t.onload=t.onerror=Bt.bind(null,t),np(t,`link`,n),zt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+on(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+on(n.href)+`"]`);if(r)return t.instance=r,zt(r),r;var i=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),zt(r),np(r,`style`,i),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Pm(n.href);var o=e.querySelector(Fm(i));if(o)return t.state.loading|=4,t.instance=o,zt(o),o;r=Im(n),(i=vm.get(i))&&Hm(r,i),o=(e.ownerDocument||e).createElement(`link`),zt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(i=e.querySelector(zm(o)))?(t.instance=i,zt(i),i):(r=n,(i=vm.get(o))&&(r=T({},n),Um(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),zt(i),np(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,zt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),zt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=ce()})),k=r(n(),1),ue=le(),de=`modulepreload`,fe=function(e){return`/`+e},pe={},A=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=fe(t,n),t=s(t),t in pe)return;pe[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:de,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},me=e=>{throw TypeError(e)},he=(e,t,n)=>t.has(e)||me(`Cannot `+n),ge=(e,t,n)=>(he(e,t,`read from private field`),n?n.call(e):t.get(e)),_e=(e,t,n)=>t.has(e)?me(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),j=(e,t,n,r)=>(he(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),ve=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,M=/^[\\/]{2}/;function N(e,t){return t+e.replace(/\\/g,`/`)}var ye=`popstate`;function be(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function xe(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return we(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:Te(t)}return De(t,n,null,e)}function P(e,t){if(e===!1||e==null)throw Error(t)}function F(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function Se(){return Math.random().toString(36).substring(2,10)}function Ce(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function we(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Ee(t):t,state:n,key:t&&t.key||r||Se(),mask:i}}function Te({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Ee(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function De(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=be(e)?e:we(h.location,e,t);n&&n(r,e),l=u()+1;let d=Ce(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=be(e)?e:we(h.location,e,t);n&&n(r,e),l=u();let i=Ce(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Oe(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(ye,d),c=e,()=>{i.removeEventListener(ye,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Oe(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),P(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:Te(t);return i=i.replace(/ $/,`%20`),!n&&M.test(i)&&(i=r+i),new URL(i,r)}var ke,Ae=class{constructor(e){if(_e(this,ke,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(ge(this,ke).has(e))return ge(this,ke).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){ge(this,ke).set(e,t)}};ke=new WeakMap;var je=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function Me(e){return je.has(e)}var Ne=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function Pe(e){return Ne.has(e)}function Fe(e){return e.index===!0}function Ie(e,t,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(P(e.index!==!0||!e.children,`Cannot specify children on an index route`),P(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),Fe(e)){let n={...e,id:s};return r[s]=Le(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=Le(n,t(n)),e.children&&(n.children=Ie(e.children,t,o,r,i)),n}})}function Le(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Re(e,t,n=`/`){return ze(e,t,n,!1)}function ze(e,t,n,r,i){let a=at((typeof t==`string`?Ee(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Ve(e),s=null,c=it(a);for(let e=0;s==null&&e{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;P(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=ht([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(P(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),He(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:Qe(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=rt(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Ue(e.path))a(e,t,!0,n)}),t}function Ue(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Ue(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function We(e){e.sort((e,t)=>e.score===t.score?$e(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Ge=/^:[\w-]+$/,Ke=3,qe=2,Je=1,Ye=10,Xe=-2,Ze=e=>e===`*`;function Qe(e,t){let n=e.split(`/`),r=n.length;return n.some(Ze)&&(r+=Xe),t&&(r+=qe),n.filter(e=>!Ze(e)).reduce((e,t)=>e+(Ge.test(t)?Ke:t===``?Je:Ye),r)}function $e(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function et(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e{if(t===`*`){let e=s[r]||``;o=gt(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function rt(e,t=!1,n=!0){F(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=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function it(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return F(!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 at(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 ot({basename:e,pathname:t}){return t===`/`?e:ht([e,t])}var st=e=>ve.test(e);function ct(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Ee(e):e,a;return n?(n=mt(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?lt(n.substring(1),`/`):lt(n,t)):a=t,{pathname:a,search:vt(r),hash:yt(i)}}function lt(e,t){let n=gt(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function ut(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 dt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function ft(e){let t=dt(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function pt(e,t,n,r=!1){let i;typeof e==`string`?i=Ee(e):(i={...e},P(!i.pathname||!i.pathname.includes(`?`),ut(`?`,`pathname`,`search`,i)),P(!i.pathname||!i.pathname.includes(`#`),ut(`#`,`pathname`,`hash`,i)),P(!i.search||!i.search.includes(`#`),ut(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=ct(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var mt=e=>e.replace(/[\\/]{2,}/g,`/`),ht=e=>mt(e.join(`/`));function gt(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var _t=e=>gt(e).replace(/^\/*/,`/`),vt=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,yt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,bt=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],xt=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function St(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ct(e){return ht(e.map(e=>e.route.path).filter(Boolean))||`/`}var wt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Tt(e,t){let n=e;if(typeof n!=`string`||!ve.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(wt)try{let e=new URL(window.location.href),r=M.test(n)?new URL(N(n,e.protocol)):new URL(n),a=at(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{F(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var Et=Symbol(`Uninstrumented`);function Dt(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=kt(n.lazy,t.lazy,()=>void 0);e&&(r.lazy=e)}if(typeof t.lazy==`object`){let e=t.lazy;[`middleware`,`loader`,`action`].forEach(t=>{let i=e[t],a=n[`lazy.${t}`];if(typeof i==`function`&&a.length>0){let e=kt(a,i,()=>void 0);e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return[`loader`,`action`].forEach(e=>{let i=t[e];if(typeof i==`function`&&n[e].length>0){let t=i[Et]??i,a=kt(n[e],t,(...e)=>jt(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[Et]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[Et]??e,r=kt(n.middleware,t,(...e)=>jt(e[0]));return r?(r[Et]=t,r):e})),r}function Ot(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}})),n.navigate.length>0){let t=e.navigate[Et]??e.navigate,r=kt(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?Te(n):`.`,...Mt(e,r??{})}});r&&(r[Et]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[Et]??e.fetch,r=kt(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...Mt(e,i??{})}});r&&(r[Et]=t,e.fetch=r)}return e}function kt(e,t,n){return e.length===0?null:async(...r)=>{let i=await At(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function At(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error(`You cannot call instrumented handlers more than once`):o=At(e,t,n,r-1),a=await o,P(a,`Expected a result`),a.type===`error`&&a.value instanceof Error?{status:`error`,error:a.value}:{status:`success`,error:void 0});try{await i(s,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}o||await s(),await o}else try{a={type:`success`,value:await n()}}catch(e){a={type:`error`,value:e}}return a||{type:`error`,value:Error(`No result assigned in instrumentation chain.`)}}function jt(e){let{request:t,context:n,params:r,pattern:i}=e;return{request:Nt(t),params:{...r},pattern:i,context:Pt(n)}}function Mt(e,t){return{currentUrl:Te(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function Nt(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Pt(e){if(It(e)){let t={...e};return Object.freeze(t),t}return{get:t=>e.get(t)}}var Ft=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function It(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===Ft}var Lt=new URL(`http://localhost`);function Rt(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Lt)}catch{return Lt}}function zt(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Bt(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function Vt(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!zt(i,n),s=!zt(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Bt(e,i)||!zt(i,a)))throw Error(`External navigation is not allowed`)}var Ht=[`POST`,`PUT`,`PATCH`,`DELETE`],Ut=new Set(Ht),Wt=[`GET`,...Ht],Gt=new Set(Wt),Kt=new Set([301,302,303,307,308]),qt=new Set([307,308]),Jt={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},I={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Yt={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Xt=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Zt=`remix-router-transitions`,Qt=Symbol(`ResetLoaderData`),$t,en,tn,nn,rn=class{constructor(e){_e(this,$t),_e(this,en),_e(this,tn),_e(this,nn),j(this,$t,e),j(this,en,Ve(e))}get stableRoutes(){return ge(this,$t)}get activeRoutes(){return ge(this,tn)??ge(this,$t)}get branches(){return ge(this,nn)??ge(this,en)}get hasHMRRoutes(){return ge(this,tn)!=null}setRoutes(e){j(this,$t,e),j(this,en,Ve(e))}setHmrRoutes(e){j(this,tn,e),j(this,nn,Ve(e))}commitHmrRoutes(){ge(this,tn)&&(j(this,$t,ge(this,tn)),j(this,en,ge(this,nn)),j(this,tn,void 0),j(this,nn,void 0))}};$t=new WeakMap,en=new WeakMap,tn=new WeakMap,nn=new WeakMap;function an(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;P(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||Xt,a=i;if(e.instrumentations){let t=e.instrumentations;a=e=>({...i(e),...Dt(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new rn(Ie(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||Sn,u={...e.future},d=null,f=new Set,p=null,m=null,h=null,g=null,_=e.hydrationData!=null,v=ze(s.activeRoutes,e.history.location,c,!1,s.branches),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=qn(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Kn(s.activeRoutes);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&ot(v,s.activeRoutes,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=ot(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}else if(v.some(e=>e.route.lazy))x=!1,S=!x;else if(!v.some(e=>un(e.route)))x=!0,S=!x;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=v;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}S=!1,x=!0,r.forEach(e=>{let r=dn(e.route,t,n);S||=r.renderFallback,x&&=!r.shouldLoad})}let C,w={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,renderFallback:S,navigation:Jt,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},T=`POP`,E=null,ee=!1,D,O=!1,te=new Map,ne=null,re=!1,ie=!1,ae=new Set,oe=new Map,se=0,ce=-1,le=new Map,k=new Set,ue=new Map,de=new Map,fe=new Set,pe=new Map,A,me=null;function he(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(A){A(),A=void 0;return}F(pe.size===0||r!=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 i=$e({currentLocation:w.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{A=e});e.history.go(r*-1),Qe(i,{state:`blocked`,location:n,proceed(){Qe(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(w.blockers);e.set(i,Yt),j({blockers:e})}}),E?.resolve(),E=null;return}return be(t,n)}),n){_r(t,te);let e=()=>vr(t,te);t.addEventListener(`pagehide`,e),ne=()=>t.removeEventListener(`pagehide`,e)}return w.initialized||be(`POP`,w.location,{initialHydration:!0}),C}function ge(){d&&d(),ne&&ne(),f.clear(),D&&D.abort(),w.fetchers.forEach((e,t)=>We(w.fetchers,t)),w.blockers.forEach((e,t)=>Ze(t))}function _e(e){if(f.add(e),p){let{newErrors:t}=p;p=null,e(w,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>f.delete(e)}function j(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),w={...w,...e};let n=[],r=[];w.fetchers.forEach((e,t)=>{e.state===`idle`&&(fe.has(t)?n.push(t):r.push(t))}),fe.forEach(e=>{!w.fetchers.has(e)&&!oe.has(e)&&n.push(e)}),f.size===0&&(p={newErrors:e.errors??null}),[...f].forEach(r=>r(w,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>We(w.fetchers,e)),r.forEach(e=>w.fetchers.delete(e))}function ve(t,n,{flushSync:r}={}){let i=w.actionData!=null&&w.navigation.formMethod!=null&&cr(w.navigation.formMethod)&&w.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?w.actionData:null;let o=n.loaderData?Un(w.loaderData,n.loaderData,n.matches||[],n.errors):w.loaderData,c=w.blockers;c.size>0&&(c=new Map(c),c.forEach((e,t)=>c.set(t,Yt)));let l=!re&&it(t,n.matches||w.matches),u=ee===!0||w.navigation.formMethod!=null&&cr(w.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),re||T===`POP`||(T===`PUSH`?e.history.push(t,t.state):T===`REPLACE`&&e.history.replace(t,t.state));let d;if(T===`POP`){let e=te.get(w.location.pathname);e&&e.has(t.pathname)?d={currentLocation:w.location,nextLocation:t}:te.has(t.pathname)&&(d={currentLocation:t,nextLocation:w.location})}else if(O){let e=te.get(w.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),te.set(w.location.pathname,e)),d={currentLocation:w.location,nextLocation:t}}j({...n,actionData:a,loaderData:o,historyAction:T,location:t,initialized:!0,renderFallback:!1,navigation:Jt,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),T=`POP`,ee=!1,O=!1,re=!1,ie=!1,E?.resolve(),E=null,me?.resolve(),me=null}async function N(t,n){if(E?.resolve(),E=null,typeof t==`number`){E||=yr();let n=E.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=cn(!1,sn(w.location,w.matches,c,t,n?.fromRouteId,n?.relative),n),o;if(n?.mask){let t=typeof n.mask==`string`?Ee(n.mask):{...w.location.mask,...n.mask};if(o={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},M.test(o.pathname))throw Error(`External navigation is not allowed`);o.pathname.startsWith(`\\`)&&(o.pathname=o.pathname.replace(/^\\+/,`/`)),Vt(typeof n.mask==`string`?n.mask:Te(n.mask),Te(o),e.history.createURL(`/`),`reject`)}let s=w.location,l=we(s,r,n&&n.state,void 0,o);l={...l,...e.history.encodeLocation(l)},Vt(t==null?e.history.createHref(w.location):typeof t==`string`?t:Te(t),e.history.createHref(l.mask||l),e.history.createURL(`/`),`reject`);let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&cr(i.formMethod)&&i.formAction===w.location.pathname+w.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=$e({currentLocation:s,nextLocation:l,historyAction:d});if(m){Qe(m,{state:`blocked`,location:l,proceed(){Qe(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),N(t,n)},reset(){let e=new Map(w.blockers);e.set(m,Yt),j({blockers:e})}});return}await be(d,l,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})}function ye(){me||=yr(),Le(),j({revalidation:`loading`});let e=me.promise;return w.navigation.state===`submitting`?e:w.navigation.state===`idle`?(be(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),e):(be(T||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:O===!0}),e)}async function be(t,n,r){D&&D.abort(),D=null,T=t,re=(r&&r.startUninterruptedRevalidation)===!0,rt(w.location,w.matches),ee=(r&&r.preventScrollReset)===!0,O=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&w.matches&&w.matches.length>0&&!y?w.matches:ze(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&w.initialized&&!ie&&Xn(w.location,n)&&!(r&&r.submission&&cr(r.submission.formMethod))){ve(n,{matches:a},{flushSync:o});return}let l=ot(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),!a){let{error:e,notFoundMatches:t,route:r}=et(n.pathname);ve(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;D=new AbortController;let d=Ln(e.history,n,D.signal,r&&r.submission),f=e.getContext?await e.getContext():new Ae,p;if(r&&r.pendingError)p=[Gn(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&cr(r.submission.formMethod)){let i=await xe(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if(tr(t)&&St(t.error)&&t.error.status===404){D=null,ve(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=fr(n,a,t,r.submission),o=!1,l.active=!1,d=Ln(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await Se(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(D=null,ve(n,{matches:h||a,...Wn(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function xe(t,n,i,l,u,d,f,p,m={}){if(Le(),j({navigation:pr(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await ct(l,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Kn(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Gn(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=et(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=ur(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:qn(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await Pe(t,n,On(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(nr(h)){let n;return n=m&&m.replace!=null?m.replace:In(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===w.location.pathname+w.location.search,await Ne(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(tr(h)){let e=Gn(l,g.route.id);return(m&&m.replace)!==!0&&(T=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function Se(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||fr(n,i,l,p),x=p||m||dr(b),S=!re&&!g;if(d){if(S){let e=Ce(v);j({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await ct(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Kn(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Gn(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=et(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:T,revalidatingFetchers:E}=ln(t,u,a,o,e.history,w,i,x,n,g?[]:r,g===!0,ie,ae,fe,ue,k,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(ce=++se,!e.dataStrategy&&!T.some(e=>e.shouldLoad)&&!T.some(e=>e.route.middleware&&e.route.middleware.length>0)&&E.length===0){let e=new Map(w.fetchers),t=Je(e);return ve(n,{matches:i,loaderData:{},errors:v&&tr(v[1])?{[v[0]]:v[1].error}:null,...Wn(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=Ce(v);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=De(E)),j(e,{flushSync:_})}E.forEach(e=>{Ke(e.key),e.controller&&oe.set(e.key,e.controller)});let ee=()=>E.forEach(e=>Ke(e.key));D&&D.signal.addEventListener(`abort`,ee);let{loaderResults:O,fetcherResults:te}=await Fe(T,E,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};D&&D.signal.removeEventListener(`abort`,ee),E.forEach(e=>oe.delete(e.key));let ne=Jn(O);if(ne)return await Ne(t,ne.result,!0,{replace:h}),{shortCircuited:!0};if(ne=Jn(te),ne)return k.add(ne.key),await Ne(t,ne.result,!0,{replace:h}),{shortCircuited:!0};let le=new Map(w.fetchers),{loaderData:de,errors:pe}=Hn(w,i,O,v,E,te,le);g&&w.errors&&(pe={...w.errors,...pe});let A=Je(le),me=Ye(ce,le),he=A||me||E.length>0;return{matches:i,loaderData:de,errors:pe,...he?{workingFetchers:le}:{}}}function Ce(e){if(e&&!tr(e[1]))return{[e[0]]:e[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function De(e){let t=new Map(w.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=mr(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function ke(t,n,r,i){Ke(t);let a=(i&&i.flushSync)===!0,o=s.activeRoutes,l=sn(w.location,w.matches,c,r,n,i?.relative),u=ze(o,l,c,!1,s.branches),d=ot(u,o,l);if(d.active&&d.matches&&(u=d.matches),!u){Ve(t,n,qn(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=cn(!0,l,i);if(m){Ve(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new Ae,g=(i&&i.preventScrollReset)===!0;if(p&&cr(p.formMethod)){await je(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}ue.set(t,{routeId:n,path:f}),await Me(t,n,f,u,h,d.active,a,g,p)}async function je(t,n,i,l,u,d,f,p,m,h){Le(),ue.delete(t),Re(t,hr(m,w.fetchers.get(t)),{flushSync:f});let g=new AbortController,_=Ln(e.history,i,g.signal,m);if(d){let e=await ct(l,new URL(_.url).pathname,_.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Ve(t,n,e.error,{flushSync:f});return}if(e.matches)l=e.matches;else{Ve(t,n,qn(404,{pathname:i}),{flushSync:f});return}}let v=ur(l,i);if(!v.route.action&&!v.route.lazy){Ve(t,n,qn(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}oe.set(t,g);let y=se,b=On(a,o,_,i,l,v,r,u),x=await Pe(_,i,b,u,t),S=x[v.route.id];if(!S){for(let e of b)if(x[e.route.id]){S=x[e.route.id];break}}if(_.signal.aborted){oe.get(t)===g&&oe.delete(t);return}if(fe.has(t)){if(nr(S)||tr(S)){Re(t,gr(void 0));return}}else{if(nr(S)){if(oe.delete(t),ce>y){Re(t,gr(void 0));return}return k.add(t),Re(t,mr(m)),Ne(_,S,!1,{fetcherSubmission:m,preventScrollReset:p})}if(tr(S)){Ve(t,n,S.error);return}}let C=w.navigation.location||w.location,E=Ln(e.history,C,g.signal),ee=s.activeRoutes,O=w.navigation.state===`idle`?w.matches:ze(ee,w.navigation.location,c,!1,s.branches);P(O,`Didn't find any matches after fetcher action`);let te=++se;le.set(t,te);let{dsMatches:ne,revalidatingFetchers:re}=ln(E,u,a,o,e.history,w,O,m,C,r,!1,ie,ae,fe,ue,k,ee,c,e.patchRoutesOnNavigation!=null,s.branches,[v.route.id,S],h),de=mr(m,S.data),pe=new Map(w.fetchers);pe.set(t,de),re.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=pe.get(t),r=mr(void 0,n?n.data:void 0);pe.set(t,r),Ke(t),e.controller&&oe.set(t,e.controller)}),j({fetchers:pe});let A=()=>re.forEach(e=>Ke(e.key));g.signal.addEventListener(`abort`,A);let{loaderResults:me,fetcherResults:he}=await Fe(ne,re,E,C,u);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,A),le.delete(t),oe.delete(t),re.forEach(e=>oe.delete(e.key));let ge=w.fetchers.has(t),_e=e=>{if(!ge)return e;let n=new Map(e.fetchers);return n.set(t,gr(S.data)),{...e,fetchers:n}},M=Jn(me);if(M)return w=_e(w),Ne(E,M.result,!1,{preventScrollReset:p});if(M=Jn(he),M)return k.add(M.key),w=_e(w),Ne(E,M.result,!1,{preventScrollReset:p});let N=new Map(w.fetchers);ge&&N.set(t,gr(S.data));let{loaderData:ye,errors:be}=Hn(w,O,me,void 0,re,he,N);Ye(te,N),w.navigation.state===`loading`&&te>ce?(P(T,`Expected pending action`),D&&D.abort(),ve(w.navigation.location,{matches:O,loaderData:ye,errors:be,fetchers:N})):(j({errors:be,loaderData:Un(w.loaderData,ye,O,be),fetchers:N}),ie=!1)}async function Me(t,n,i,s,c,l,u,d,f){let p=w.fetchers.get(t);Re(t,mr(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=Ln(e.history,i,m.signal);if(l){let e=await ct(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Ve(t,n,e.error,{flushSync:u});return}if(e.matches)s=e.matches;else{Ve(t,n,qn(404,{pathname:i}),{flushSync:u});return}}let g=ur(s,i);oe.set(t,m);let _=se,v=await Pe(h,i,On(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(oe.get(t)===m&&oe.delete(t),!h.signal.aborted){if(fe.has(t)){Re(t,gr(void 0));return}if(nr(y)){if(ce>_){Re(t,gr(void 0));return}k.add(t),await Ne(h,y,!1,{preventScrollReset:d});return}if(tr(y)){Ve(t,n,y.error);return}Re(t,gr(y.data))}}async function Ne(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(E?.resolve(),E=null),i.response.headers.has(`X-Remix-Revalidate`)&&(ie=!0);let d=i.response.headers.get(`Location`);P(d,`Expected a Location header on the redirect Response`);let f=d,p=new URL(r.url);d=In(d,p,c,e.history),Vt(f,d,p,`allow-explicit`);let m=we(w.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(st(d)){let n=Oe(t,d,!0);e=n.origin!==t.location.origin||at(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}D=null;let h=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:g,formAction:_,formEncType:v}=w.navigation;!o&&!s&&g&&_&&v&&(o=dr(w.navigation));let y=o||s;qt.has(i.response.status)&&y&&cr(y.formMethod)?await be(h,m,{submission:{...y,formAction:d},preventScrollReset:l||ee,enableViewTransition:a?O:void 0}):await be(h,m,{overrideNavigation:fr(m,[],h,o),fetcherSubmission:s,preventScrollReset:l||ee,enableViewTransition:a?O:void 0})}async function Pe(e,t,n,r,i){let a,o={};try{a=await kn(l,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!cr(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!w.loaderData.hasOwnProperty(e.route.id)&&(!w.errors||!w.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(er(r)){let i=r.result;o[t]={type:`redirect`,response:Nn(i,e,t,n,c)}}else o[t]=await Mn(r);return o}async function Fe(e,t,n,r,i){let a=Pe(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Pe(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:qn(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Le(){ie=!0,ue.forEach((e,t)=>{oe.has(t)&&ae.add(t),Ke(t)})}function Re(e,t,n={}){let r=new Map(w.fetchers);r.set(e,t),j({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function Ve(e,t,n,r={}){let i=Gn(w.matches,t),a=new Map(w.fetchers);We(a,e),j({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function He(e){return de.set(e,(de.get(e)||0)+1),fe.has(e)&&fe.delete(e),w.fetchers.get(e)||I}function Ue(e,t){Ke(e,t?.reason),Re(e,gr(null))}function We(e,t){let n=w.fetchers.get(t);oe.has(t)&&!(n&&n.state===`loading`&&le.has(t))&&Ke(t),ue.delete(t),le.delete(t),k.delete(t),fe.delete(t),ae.delete(t),e.delete(t)}function Ge(e){let t=(de.get(e)||0)-1;t<=0?(de.delete(e),fe.add(e)):de.set(e,t),j({fetchers:new Map(w.fetchers)})}function Ke(e,t){let n=oe.get(e);n&&(n.abort(t),oe.delete(e))}function qe(e,t){for(let n of e){let e=t.get(n);P(e,`Expected fetcher: ${n}`);let r=gr(e.data);t.set(n,r)}}function Je(e){let t=[],n=!1;for(let r of k){let i=e.get(r);P(i,`Expected fetcher: ${r}`),i.state===`loading`&&(k.delete(r),t.push(r),n=!0)}return qe(t,e),n}function Ye(e,t){let n=[];for(let[r,i]of le)if(i0}function Xe(e,t){let n=w.blockers.get(e)||Yt;return pe.get(e)!==t&&pe.set(e,t),n}function Ze(e){w.blockers.delete(e),pe.delete(e)}function Qe(e,t){let n=w.blockers.get(e)||Yt;P(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(w.blockers);r.set(e,t),j({blockers:r})}function $e({currentLocation:e,nextLocation:t,historyAction:n}){if(pe.size===0)return;pe.size>1&&F(!1,`A router only supports one blocker at a time`);let r=Array.from(pe.entries()),[i,a]=r[r.length-1],o=w.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function et(e){let t=qn(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=Kn(n);return{notFoundMatches:r,route:i,error:t}}function tt(e,t,n){if(m=e,g=t,h=n||null,!_&&w.navigation===Jt){_=!0;let e=it(w.location,w.matches);e!=null&&j({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function nt(e,t){return h&&h(e,t.map(e=>Be(e,w.loaderData)))||e.key}function rt(e,t){if(m&&g){let n=nt(e,t);m[n]=g()}}function it(e,t){if(m){let n=nt(e,t),r=m[n];if(typeof r==`number`)return r}return null}function ot(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:ze(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:ze(n,r,c,!0,e)}}return{active:!1,matches:null}}async function ct(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||hn(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=ze(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=ze(s.activeRoutes,n,c,!0,u),!(f&&l.lengthe.route.id===t[n].route.id)}function ut(e){o={},s.setHmrRoutes(Ie(e,a,void 0,o))}function dt(e,t,n=!1){hn(e,t,s,o,a,n),s.hasHMRRoutes||j({})}return C={get basename(){return c},get future(){return u},get state(){return w},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:he,subscribe:_e,enableScrollRestoration:tt,navigate:N,fetch:ke,revalidate:ye,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:He,resetFetcher:Ue,deleteFetcher:Ge,dispose:ge,getBlocker:Xe,deleteBlocker:Ze,patchRoutes:dt,_internalFetchControllers:oe,_internalSetRoutes:ut,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){j(e)}},e.instrumentations&&(C=Ot(C,e.instrumentations.map(e=>e.router).filter(Boolean))),C}function on(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function sn(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=pt(r||`.`,ft(o),at(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=lr(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=ot({basename:n,pathname:c.pathname})),Te(c)}function cn(e,t,n){if(!n||!on(n))return{path:t};if(n.formMethod&&!sr(n.formMethod))return{path:t,error:qn(405,{method:n.formMethod})};let r=()=>({path:t,error:qn(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Yn(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!cr(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n} `,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if(n.formEncType===`application/json`){if(!cr(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}P(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=zn(n.formData),s=n.formData;else if(n.body instanceof FormData)o=zn(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Bn(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Bn(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(cr(c.formMethod))return{path:t,submission:c};let l=Ee(t);return e&&l.search&&lr(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:Te(l),submission:c}}function ln(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?tr(b[1])?b[1].error:b[1].data:void 0,C=i.createURL(a.location),w=i.createURL(c),T;if(u&&a.errors){let e=Object.keys(a.errors)[0];T=o.findIndex(t=>t.route.id===e)}else if(b&&tr(b[1])){let e=b[0];T=o.findIndex(t=>t.route.id===e)-1}let E=b?b[1].statusCode:void 0,ee=E&&E>=400,D={currentUrl:C,currentParams:a.matches[0]?.params||{},nextUrl:w,nextParams:o[0].params,...s,actionResult:S,actionStatus:E},O=Ct(o),te=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!un(s))f=!1;else if(u){let{shouldLoad:e}=dn(s,a.loaderData,a.errors);f=e}else fn(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Dn(n,r,e,c,O,i,l,t,f);let p=!1;typeof x==`boolean`?p=x:ee?p=!1:d||C.pathname+C.search===w.pathname+w.search?p=!0:C.search===w.search?pn(a.matches[o],i)&&(p=!0):p=!0;let m={...D,defaultShouldRevalidate:p},h=mn(i,m);return Dn(n,r,e,c,O,i,l,t,h,m,x)}),ne=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,b=ze(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;ne.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let S=ur(b,e.path),C=new AbortController,w=Ln(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=On(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=On(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!ee&&d;let a={...D,defaultShouldRevalidate:i};mn(S,a)&&(T=On(n,r,w,e.path,b,S,l,t,a))}T&&ne.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:te,revalidatingFetchers:ne}}function un(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function dn(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!un(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function fn(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function pn(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function mn(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function hn(e,t,n,r,i,a){let o;if(e){let t=r[e];P(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>gn(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=Ie(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;et.children?.some(t=>gn(e,t)))??!1}var _n=new WeakMap,vn=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(P(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=_n.get(i);o||(o={},_n.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=Me(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)F(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)F(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},yn=new WeakMap;function bn(e,t,n,r,i){let a=n[e.id];if(P(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=yn.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{P(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=Pe(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?F(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?F(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return yn.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=vn({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function xn(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Sn(e){return e.matches.some(e=>e.route.middleware)?Cn(e,()=>xn(e)):xn(e)}function Cn(e,t){return wn(e,t,e=>{if(or(e))throw e;return e},Qn,n);function n(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:`error`,result:t}}));{let{matches:r}=e,i=Gn(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:`error`,result:t}})}}}async function wn(e,t,n,r,i){let{matches:a,...o}=e;return await Tn(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Tn(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await Tn(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function En(e,t,n,r,i){let a=vn({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=bn(r.route,cr(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Dn(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=En(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?mn(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?mn(a,{...l,defaultShouldRevalidate:e}):mn(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!cr(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(cr(n.method)||!p)?An({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function On(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Dn(e,t,n,r,Ct(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:En(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function kn(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:Rn(t,n),pattern:Ct(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return Cn(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function An({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=cr(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:Rn(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a){if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw qn(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}}else if(t)c=await f(t);else{let t=new URL(e.url);throw qn(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function jn(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Mn(e){let{result:t,type:n}=e;if(ir(t)){let e;try{e=await jn(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new xt(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?rr(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:Zn(t),statusCode:St(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:St(t)?t.status:void 0}:rr(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function Nn(e,t,n,r,i){let a=e.headers.get(`Location`);if(P(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!st(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=sn(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Pn=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Fn(e){try{return Pn.includes(new URL(e).protocol)}catch{return!1}}function In(e,t,n,r){if(st(e)){let r=e,i=M.test(r)?new URL(N(r,t.protocol)):new URL(r);if(Fn(i.toString()))throw Error(`Invalid redirect location`);let a=at(i.pathname,n)!=null;if(i.origin===t.origin&&a)return mt(i.pathname)+i.search+i.hash}try{if(Fn(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function Ln(e,t,n,r){let i=e.createURL(Yn(t)).toString(),a={signal:n};if(r&&cr(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?zn(r.formData):r.formData}return new Request(i,a)}function Rn(e,t){let n=new URL(e.url),r=typeof t==`string`?Ee(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);n.search=e.size?`?${e.toString()}`:``}else n.search=``;return n.hash=r.hash||``,n}function zn(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Bn(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Vn(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&tr(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(P(!nr(f),`Cannot handle redirect results in processLoaderData`),tr(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=Gn(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=Qt),c||(c=!0,s=St(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Hn(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Vn(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(P(s,`Did not find corresponding fetcher result`),tr(s)){let t=Gn(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(nr(s))P(!1,`Unhandled fetcher revalidation redirect`);else{let e=gr(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function Un(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==Qt).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function Wn(e){return e?tr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Gn(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function Kn(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function qn(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new xt(e||500,o,Error(s),!0)}function Jn(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(nr(r))return{key:n,result:r}}}function Yn(e){return Te({...typeof e==`string`?Ee(e):e,hash:``})}function Xn(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Zn(e){return new xt(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Qn(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&$n(t))}function $n(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function er(e){return ir(e.result)&&Kt.has(e.result.status)}function tr(e){return e.type===`error`}function nr(e){return(e&&e.type)===`redirect`}function rr(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function ir(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function ar(e){return Kt.has(e)}function or(e){return ir(e)&&ar(e.status)&&e.headers.has(`Location`)}function sr(e){return Gt.has(e.toUpperCase())}function cr(e){return Ut.has(e.toUpperCase())}function lr(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function ur(e,t){let n=typeof t==`string`?Ee(t).search:t.search;if(e[e.length-1].route.index&&lr(n||``))return e[e.length-1];let r=dt(e);return r[r.length-1]}function dr(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(t&&n&&r){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function fr(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function pr(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function mr(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 hr(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 gr(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 _r(e,t){try{let n=e.sessionStorage.getItem(Zt);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function vr(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Zt,JSON.stringify(n))}catch(e){F(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function yr(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var br=k.createContext(null);br.displayName=`DataRouter`;var xr=k.createContext(null);xr.displayName=`DataRouterState`;var Sr=k.createContext(!1);function Cr(){return k.useContext(Sr)}var wr=k.createContext({isTransitioning:!1});wr.displayName=`ViewTransition`;var Tr=k.createContext(new Map);Tr.displayName=`Fetchers`;var Er=k.createContext(null);Er.displayName=`Await`;var Dr=k.createContext(null);Dr.displayName=`Navigation`;var Or=k.createContext(null);Or.displayName=`Location`;var kr=k.createContext({outlet:null,matches:[],isDataRoute:!1});kr.displayName=`Route`;var Ar=k.createContext(null);Ar.displayName=`RouteError`;var jr=`REACT_ROUTER_ERROR`,Mr=`REDIRECT`,Nr=`ROUTE_ERROR_RESPONSE`;function Pr(e){if(e.startsWith(`${jr}:${Mr}:{`))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 Fr(e){if(e.startsWith(`${jr}:${Nr}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new xt(t.status,t.statusText,t.data)}catch{}}function Ir(e,{relative:t}={}){P(Lr(),`useHref() may be used only in the context of a component.`);let{basename:n,navigator:r}=k.useContext(Dr),{hash:i,pathname:a,search:o}=Kr(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:ht([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Lr(){return k.useContext(Or)!=null}function Rr(){return P(Lr(),`useLocation() may be used only in the context of a component.`),k.useContext(Or).location}var zr=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Br(e){k.useContext(Dr).static||k.useLayoutEffect(e)}function Vr(){let{isDataRoute:e}=k.useContext(kr);return e?ci():Hr()}function Hr(){P(Lr(),`useNavigate() may be used only in the context of a component.`);let e=k.useContext(br),{basename:t,navigator:n}=k.useContext(Dr),{matches:r}=k.useContext(kr),{pathname:i}=Rr(),a=JSON.stringify(ft(r)),o=k.useRef(!1);return Br(()=>{o.current=!0}),k.useCallback((r,s={})=>{if(F(o.current,zr),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=pt(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:ht([t,c.pathname])),Vt(typeof r==`string`?r:Te(r),n.createHref(c),Rt(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Ur=k.createContext(null);function Wr(e){let t=k.useContext(kr).outlet;return k.useMemo(()=>t&&k.createElement(Ur.Provider,{value:e},t),[t,e])}function Gr(){let{matches:e}=k.useContext(kr);return e[e.length-1]?.params??{}}function Kr(e,{relative:t}={}){let{matches:n}=k.useContext(kr),{pathname:r}=Rr(),i=JSON.stringify(ft(n));return k.useMemo(()=>pt(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function qr(e,t,n){P(Lr(),`useRoutes() may be used only in the context of a component.`);let{navigator:r}=k.useContext(Dr),{matches:i}=k.useContext(kr),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;ui(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant (or called \`useRoutes()\`) at "${s}" (under ) 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. Please change the parent to .`)}let u=Rr(),d;if(t){let e=typeof t==`string`?Ee(t):t;P(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`\` 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 "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):Re(e,{pathname:p});F(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),F(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let h=ei(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:ht([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:ht([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?k.createElement(Or.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Jr(){let e=si(),t=St(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=k.createElement(k.Fragment,null,k.createElement(`p`,null,`💿 Hey developer 👋`),k.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,k.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,k.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),k.createElement(k.Fragment,null,k.createElement(`h2`,null,`Unexpected Application Error!`),k.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?k.createElement(`pre`,{style:i},n):null,o)}var Yr=k.createElement(Jr,null),Xr=class extends k.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?t.error:e.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`){let t=Fr(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:k.createElement(kr.Provider,{value:this.props.routeContext},k.createElement(Ar.Provider,{value:e,children:this.props.component}));return this.context?k.createElement(Qr,{error:e},t):t}};Xr.contextType=Sr;var Zr=new WeakMap;function Qr({children:e,error:t}){let{basename:n,navigator:r}=k.useContext(Dr);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Pr(t.digest);if(e){let i=Zr.get(t);if(i)throw i;let a=Tt(e.location,n),o=a.absoluteURL||a.to;if(Vt(e.location,o,Rt(r),`allow-explicit`),Fn(o))throw Error(`Invalid redirect location`);if(wt&&!Zr.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Zr.set(t,n),n}}return k.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function $r({routeContext:e,match:t,children:n}){let r=k.useContext(br);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),k.createElement(kr.Provider,{value:e},n)}function ei(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);P(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Ct(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Yr,o&&(s<0&&c===0?(ui(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?k.createElement(n.route.Component,null):n.route.element?n.route.element:e,k.createElement($r,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?k.createElement(Xr,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function ti(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ni(e){let t=k.useContext(br);return P(t,ti(e)),t}function ri(e){let t=k.useContext(xr);return P(t,ti(e)),t}function ii(e){let t=k.useContext(kr);return P(t,ti(e)),t}function ai(e){let t=ii(e),n=t.matches[t.matches.length-1];return P(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function oi(){return ai(`useRouteId`)}function si(){let e=k.useContext(Ar),t=ri(`useRouteError`),n=ai(`useRouteError`);return e===void 0?t.errors?.[n]:e}function ci(){let{router:e}=ni(`useNavigate`),t=ai(`useNavigate`),n=k.useRef(!1);return Br(()=>{n.current=!0}),k.useCallback(async(r,i={})=>{F(n.current,zr),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var li={};function ui(e,t,n){!t&&!li[e]&&(li[e]=!0,F(!1,n))}var di={};function fi(e,t){!e&&!di[t]&&(di[t]=!0,console.warn(t))}var pi=k.useOptimistic,mi=()=>void 0;function hi(e){return pi?pi(e):[e,mi]}function gi(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&F(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:k.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&F(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:k.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&F(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:k.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var _i=[`HydrateFallback`,`hydrateFallbackElement`],vi=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function yi({router:e,flushSync:t,onError:n,useTransitions:r}){r=Cr()||r;let[i,a]=k.useState(e.state),[o,s]=hi(i),[c,l]=k.useState(),[u,d]=k.useState({isTransitioning:!1}),[f,p]=k.useState(),[m,h]=k.useState(),[g,_]=k.useState(),v=k.useRef(new Map),y=k.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:g})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:Ct(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&v.current.set(t,e.data)}),o.forEach(e=>v.current.delete(e)),fi(u===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let y=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(fi(g==null||y,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!g||!y){t&&u?t(()=>a(i)):r===!1?a(i):k.startTransition(()=>{r===!0&&s(e=>bi(e,i)),a(i)});return}if(t&&u){t(()=>{m&&(f?.resolve(),m.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:g.currentLocation,nextLocation:g.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>h(n));return}m?(f?.resolve(),m.skipTransition(),_({state:i,currentLocation:g.currentLocation,nextLocation:g.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}))},[e.window,t,m,f,r,s,n]);k.useLayoutEffect(()=>e.subscribe(y),[e,y]),k.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new vi)},[u]),k.useEffect(()=>{if(f&&c&&e.window){let t=c,n=f.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):k.startTransition(()=>{r===!0&&s(e=>bi(e,t)),a(t)}),await n});i.finished.finally(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})}),h(i)}},[c,f,e.window,r,s]),k.useEffect(()=>{f&&c&&o.location.key===c.location.key&&f.resolve()},[f,m,o.location,c]),k.useEffect(()=>{!u.isTransitioning&&g&&(l(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),_(void 0))},[u.isTransitioning,g]);let b=k.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),x=e.basename||`/`,S=k.useMemo(()=>({router:e,navigator:b,static:!1,basename:x,onError:n}),[e,b,x,n]);return k.createElement(k.Fragment,null,k.createElement(br.Provider,{value:S},k.createElement(xr.Provider,{value:o},k.createElement(Tr.Provider,{value:v.current},k.createElement(wr.Provider,{value:u},k.createElement(wi,{basename:x,location:o.location,navigationType:o.historyAction,navigator:b,useTransitions:r},k.createElement(xi,{routes:e.routes,manifest:e.manifest,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function bi(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var xi=k.memo(Si);function Si({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return qr(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Ci(e){return Wr(e.context)}function wi({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){P(!Lr(),`You cannot render a inside another . You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=k.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=Ee(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=k.useMemo(()=>{let e=at(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return F(h!=null,` is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the won't render anything.`),h==null?null:k.createElement(Dr.Provider,{value:c},k.createElement(Or.Provider,{children:t,value:h}))}k.Component;var Ti=`get`,Ei=`application/x-www-form-urlencoded`;function Di(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Oi(e){return Di(e)&&e.tagName.toLowerCase()===`button`}function ki(e){return Di(e)&&e.tagName.toLowerCase()===`form`}function Ai(e){return Di(e)&&e.tagName.toLowerCase()===`input`}function ji(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Mi(e,t){return e.button===0&&(!t||t===`_self`)&&!ji(e)}var Ni=null;function Pi(){if(Ni===null)try{new FormData(document.createElement(`form`),0),Ni=!1}catch{Ni=!0}return Ni}var Fi=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Ii(e){return e!=null&&!Fi.has(e)?(F(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${Ei}"`),null):e}function Li(e,t){let n,r,i,a,o;if(ki(e)){let o=e.getAttribute(`action`);r=o?at(o,t):null,n=e.getAttribute(`method`)||Ti,i=Ii(e.getAttribute(`enctype`))||Ei,a=new FormData(e)}else if(Oi(e)||Ai(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a