libre-webui 0.42.0 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/backend/dist/db.d.ts.map +1 -1
- package/backend/dist/db.js +12 -1
- package/backend/dist/db.js.map +1 -1
- package/backend/dist/services/agentCliService.d.ts +22 -1
- package/backend/dist/services/agentCliService.d.ts.map +1 -1
- package/backend/dist/services/agentCliService.js +110 -3
- package/backend/dist/services/agentCliService.js.map +1 -1
- package/backend/dist/services/agentCliUsage.d.ts +3 -2
- package/backend/dist/services/agentCliUsage.d.ts.map +1 -1
- package/backend/dist/services/agentCliUsage.js +19 -1
- package/backend/dist/services/agentCliUsage.js.map +1 -1
- package/backend/dist/services/workAgentAccessService.js +1 -1
- package/backend/dist/services/workAgentCatalog.d.ts +15 -3
- package/backend/dist/services/workAgentCatalog.d.ts.map +1 -1
- package/backend/dist/services/workAgentCatalog.js +28 -0
- package/backend/dist/services/workAgentCatalog.js.map +1 -1
- package/backend/dist/services/workAgentCliRunner.d.ts +1 -0
- package/backend/dist/services/workAgentCliRunner.d.ts.map +1 -1
- package/backend/dist/services/workAgentCliRunner.js +31 -1
- package/backend/dist/services/workAgentCliRunner.js.map +1 -1
- package/backend/dist/services/workAgentHostLogins.d.ts +37 -0
- package/backend/dist/services/workAgentHostLogins.d.ts.map +1 -1
- package/backend/dist/services/workAgentHostLogins.js +190 -0
- package/backend/dist/services/workAgentHostLogins.js.map +1 -1
- package/backend/dist/services/workAgentService.d.ts +2 -0
- package/backend/dist/services/workAgentService.d.ts.map +1 -1
- package/backend/dist/services/workAgentService.js +10 -2
- package/backend/dist/services/workAgentService.js.map +1 -1
- package/backend/dist/services/workAgentStream.d.ts +4 -0
- package/backend/dist/services/workAgentStream.d.ts.map +1 -1
- package/backend/dist/services/workAgentStream.js +80 -0
- package/backend/dist/services/workAgentStream.js.map +1 -1
- package/backend/dist/services/workAgentToolchainService.d.ts.map +1 -1
- package/backend/dist/services/workAgentToolchainService.js +22 -5
- package/backend/dist/services/workAgentToolchainService.js.map +1 -1
- package/backend/dist/services/workEgressRelay.d.ts.map +1 -1
- package/backend/dist/services/workEgressRelay.js +19 -4
- package/backend/dist/services/workEgressRelay.js.map +1 -1
- package/backend/dist/services/workRuntimeService.d.ts.map +1 -1
- package/backend/dist/services/workRuntimeService.js +26 -8
- package/backend/dist/services/workRuntimeService.js.map +1 -1
- package/backend/dist/types/work.d.ts +2 -2
- package/backend/dist/types/work.d.ts.map +1 -1
- package/backend/dist/utils/pluginChatAdapter.d.ts.map +1 -1
- package/backend/dist/utils/pluginChatAdapter.js +2 -1
- package/backend/dist/utils/pluginChatAdapter.js.map +1 -1
- package/backend/dist/utils/pluginDefinitionTrust.d.ts.map +1 -1
- package/backend/dist/utils/pluginDefinitionTrust.js +1 -0
- package/backend/dist/utils/pluginDefinitionTrust.js.map +1 -1
- package/backend/package.json +1 -1
- package/frontend/dist/artifact-runtime/.build-fingerprint +1 -1
- package/frontend/dist/artifact-runtime/babel.js +15 -15
- package/frontend/dist/artifact-runtime/chart.js +2 -2
- package/frontend/dist/artifact-runtime/d3.js +2 -2
- package/frontend/dist/artifact-runtime/framer-motion.js +5 -5
- package/frontend/dist/artifact-runtime/lodash.js +2 -2
- package/frontend/dist/artifact-runtime/lucide-react.js +1 -1
- package/frontend/dist/artifact-runtime/mathjs.js +4 -4
- package/frontend/dist/artifact-runtime/mermaid.js +360 -360
- package/frontend/dist/artifact-runtime/papaparse.js +1 -1
- package/frontend/dist/artifact-runtime/plotly.js +146 -20
- package/frontend/dist/artifact-runtime/react.js +2 -2
- package/frontend/dist/artifact-runtime/recharts.js +8 -8
- package/frontend/dist/artifact-runtime/tailwind.js +1 -1
- package/frontend/dist/artifact-runtime/three.js +2 -2
- package/frontend/dist/artifact-runtime/tone.js +3 -3
- package/frontend/dist/assets/index-BnbO3eTY.js +83 -0
- package/frontend/dist/index.html +33 -33
- package/frontend/dist/js/{ArtifactContainer-D5wijGHA.js → ArtifactContainer-C0R4kYVM.js} +1 -1
- package/frontend/dist/js/{ArtifactDemoPage-DwQzUFI-.js → ArtifactDemoPage-BQmbCyat.js} +1 -1
- package/frontend/dist/js/{ArtifactSandboxFrame-CQCAALvW.js → ArtifactSandboxFrame-CkDkrHpg.js} +1 -1
- package/frontend/dist/js/{ArtifactSlideOutPanel-Cn6Rp7Yx.js → ArtifactSlideOutPanel-DZnVzC0c.js} +1 -1
- package/frontend/dist/js/{AutomationModal-mgkoNA-S.js → AutomationModal-Cx1e_4df.js} +1 -1
- package/frontend/dist/js/AutomationsPage-D7UtYZ_0.js +1 -0
- package/frontend/dist/js/{AvatarUpload-BFU2a_eT.js → AvatarUpload-DGRQC20B.js} +1 -1
- package/frontend/dist/js/{Button-D_msp6KT.js → Button-DwZ26Lqc.js} +1 -1
- package/frontend/dist/js/{CalendarPage-DT6_t4fJ.js → CalendarPage-WmA1i7MQ.js} +1 -1
- package/frontend/dist/js/ChannelsPage-Bq4JQPR_.js +1 -0
- package/frontend/dist/js/ChatPage-Cd3fxx-N.js +14 -0
- package/frontend/dist/js/ConnectModels-BYul-veF.js +1 -0
- package/frontend/dist/js/EvaluationsPage-CV_Terzn.js +2 -0
- package/frontend/dist/js/FirstTimeSetup-CFhGy9a8.js +1 -0
- package/frontend/dist/js/GalleryPage-BRKZyq1w.js +1 -0
- package/frontend/dist/js/{HomePage-CXG83Qjk.js → HomePage-DdpnBu-Z.js} +1 -1
- package/frontend/dist/js/{LanguageSwitcher-DK5aMjVJ.js → LanguageSwitcher-CASJ8p5d.js} +1 -1
- package/frontend/dist/js/{Logo--9H7Lqkg.js → Logo-C-qwuy58.js} +1 -1
- package/frontend/dist/js/{LogoMark-DNzLawJz.js → LogoMark-zP-mitdI.js} +1 -1
- package/frontend/dist/js/{ModelManagerModals-MjJMyvPJ.js → ModelManagerModals-BYhFWv22.js} +1 -1
- package/frontend/dist/js/NotesPage-CmvVoWcH.js +3 -0
- package/frontend/dist/js/{OptimizedSyntaxHighlighter-Cruo0gJb.js → OptimizedSyntaxHighlighter-B8vbflQA.js} +1 -1
- package/frontend/dist/js/{OptimizedSyntaxHighlighter-BCkQOsIb.js → OptimizedSyntaxHighlighter-DoJF0j0l.js} +1 -1
- package/frontend/dist/js/{PasswordStrengthMeter-CEmuISNU.js → PasswordStrengthMeter-Dow8ZeTs.js} +1 -1
- package/frontend/dist/js/PersonasPage-BYKtoKWl.js +13 -0
- package/frontend/dist/js/PluginUsagePage-BVTOCxoE.js +1 -0
- package/frontend/dist/js/{RichMessageContent-CQY0R6rI.js → RichMessageContent-Bwpg3rfV.js} +3 -3
- package/frontend/dist/js/{RichMessageContent-B1TrzEbs.js → RichMessageContent-DJTLGpws.js} +1 -1
- package/frontend/dist/js/SettingsModal-CGyVfxOz.js +19 -0
- package/frontend/dist/js/{SettingsToggle-CjckNl8v.js → SettingsToggle-BpD6NSri.js} +1 -1
- package/frontend/dist/js/{ShareDialog-DiXoIWJx.js → ShareDialog-DYwyeyaI.js} +1 -1
- package/frontend/dist/js/{StrandsPage-BQ-PMkvY.js → StrandsPage-CvXeYOYR.js} +1 -1
- package/frontend/dist/js/SystemPage-B4qFsAsb.js +1 -0
- package/frontend/dist/js/{TurnstileWidget-J61wYyqA.js → TurnstileWidget-xx9lQV0b.js} +1 -1
- package/frontend/dist/js/UserManagementPage-DhMRuhqj.js +1 -0
- package/frontend/dist/js/UserManagementPanel-BVLSvRwa.js +1 -0
- package/frontend/dist/js/{WhatsNewModal-DcAyhGzi.js → WhatsNewModal-DfR7W93-.js} +1 -1
- package/frontend/dist/js/WorkPage-DSKBQEW0.js +7 -0
- package/frontend/dist/js/api-C5ps_CWQ.js +1 -0
- package/frontend/dist/js/{api-D3RzHftc.js → api-D6IF0v9_.js} +1 -1
- package/frontend/dist/js/{appNavigation-Df-xsLY5.js → appNavigation-BifMRN3D.js} +1 -1
- package/frontend/dist/js/{appStore-qi0l_wou.js → appStore-B6pAGo3p.js} +2 -2
- package/frontend/dist/js/appVersion-9UMn7b1T.js +1 -0
- package/frontend/dist/js/authStore-CDo5Co2D.js +1 -0
- package/frontend/dist/js/{authStore-BhwtFhS3.js → authStore-DdIb6km_.js} +3 -3
- package/frontend/dist/js/babel-BaOs8qJH.js +16 -0
- package/frontend/dist/js/{chatStore-mB6kXQVu.js → chatStore-hzQyRM9H.js} +3 -3
- package/frontend/dist/js/{client-tVKsnAVI.js → client-D_F_0LqX.js} +2 -2
- package/frontend/dist/js/{config-bhyjjacC.js → config-CHUQTU6j.js} +1 -1
- package/frontend/dist/js/{estree-BmKwYjuD.js → estree-Cw-tQG5d.js} +1 -1
- package/frontend/dist/js/{evaluationsApi-DxuXU4NS.js → evaluationsApi-C0FKNJua.js} +1 -1
- package/frontend/dist/js/{markdown-D-PuDeiZ.js → markdown-C7cnJl_Q.js} +5 -5
- package/frontend/dist/js/{markdown-core-D-4xNKNv.js → markdown-core-CGWDtd6X.js} +5 -5
- package/frontend/dist/js/{markdown-html-Cd75Y-85.js → markdown-html-BdYVneHE.js} +1 -1
- package/frontend/dist/js/{markdown-math-DUQvxNgB.js → markdown-math-BzLEmswF.js} +1 -1
- package/frontend/dist/js/{markdownHtml-mmK-QYY6.js → markdownHtml-B1Ll_Qgp.js} +1 -1
- package/frontend/dist/js/markdownMath-aI8uDQmz.js +1 -0
- package/frontend/dist/js/{messageCodeStyles-nVE1JYdR.js → messageCodeStyles-DVYyK8wm.js} +2 -2
- package/frontend/dist/js/{postcss-CU3LgMVN.js → postcss-DB_e0nkW.js} +1 -1
- package/frontend/dist/js/{react-vendor-GLIQTwVZ.js → react-vendor-C1iE8mnY.js} +2 -2
- package/frontend/dist/js/rfb-IV07oQgM.js +5 -0
- package/frontend/dist/js/rolldown-runtime-XKyaHtl9.js +1 -0
- package/frontend/dist/js/router-vendor-qltZAWoz.js +1 -0
- package/frontend/dist/js/{strandsApi-C04kQWMg.js → strandsApi-CeJLezXW.js} +1 -1
- package/frontend/dist/js/{syntax-highlight-BlVvro-Z.js → syntax-highlight-CemL-n1v.js} +2 -2
- package/frontend/dist/js/{teamEventStream-Cf62joPP.js → teamEventStream-DOMyufrH.js} +1 -1
- package/frontend/dist/js/{typescript-C28ytPnl.js → typescript-2anSzo_N.js} +2 -2
- package/frontend/dist/js/ui-D4Ytvr6d.js +2 -0
- package/frontend/dist/js/ui-vendor-BTcw5yZ6.js +1 -0
- package/frontend/dist/js/{useChat-BWWunIVw.js → useChat-BEbNywiP.js} +4 -4
- package/frontend/dist/js/{useDialogFocus-Dfa5Utj4.js → useDialogFocus-DpTun-ZV.js} +1 -1
- package/frontend/dist/js/useDictation-jTaorrHm.js +1 -0
- package/frontend/dist/js/useQuery-2_pQiHbl.js +1 -0
- package/frontend/dist/js/{useTranslation-B69j_cNd.js → useTranslation-D9EScZXH.js} +1 -1
- package/frontend/dist/js/utils-BvvV-Cka.js +1 -0
- package/frontend/dist/js/{utils-vendor-DWQLsiSj.js → utils-vendor-CsC5rH1J.js} +1 -1
- package/frontend/dist/js/workAnnouncements--WBYN99v.js +1 -0
- package/frontend/dist/js/workApi-CGvfDTRY.js +1 -0
- package/frontend/dist/js/{workApi-CMbUePsX.js → workApi-_0oxRyak.js} +1 -1
- package/frontend/dist/js/xterm-BMsy1fDS.js +16 -0
- package/frontend/dist/js/{yaml-uvx2gM_u.js → yaml-Breo7DWT.js} +1 -1
- package/package.json +4 -4
- package/plugins/meta.json +77 -0
- package/frontend/dist/assets/index-BvQepfeH.js +0 -53
- package/frontend/dist/js/AutomationsPage-CsaCHmN_.js +0 -1
- package/frontend/dist/js/ChannelsPage-DXD6PlTg.js +0 -1
- package/frontend/dist/js/ChatPage-C7NQy4ts.js +0 -14
- package/frontend/dist/js/ConnectModels-De18RKwJ.js +0 -1
- package/frontend/dist/js/EvaluationsPage-BCVJse6N.js +0 -2
- package/frontend/dist/js/FirstTimeSetup-M3iWWKTn.js +0 -1
- package/frontend/dist/js/GalleryPage-C-F45c09.js +0 -1
- package/frontend/dist/js/NotesPage-Dd2N_7zQ.js +0 -3
- package/frontend/dist/js/PersonasPage-DONF1JmU.js +0 -13
- package/frontend/dist/js/PluginUsagePage-Bu4pTUjq.js +0 -1
- package/frontend/dist/js/SettingsModal-Dabi8xVs.js +0 -19
- package/frontend/dist/js/SystemPage-CCCL2ByV.js +0 -1
- package/frontend/dist/js/UserManagementPage-H_uXYSnx.js +0 -1
- package/frontend/dist/js/UserManagementPanel-B2cJLYCP.js +0 -1
- package/frontend/dist/js/WorkPage-B1Rt99I9.js +0 -7
- package/frontend/dist/js/api-BU9PuoZz.js +0 -1
- package/frontend/dist/js/appVersion-CVfieEPW.js +0 -1
- package/frontend/dist/js/authStore-dszH-1C-.js +0 -1
- package/frontend/dist/js/babel-Dxd799BX.js +0 -16
- package/frontend/dist/js/markdownMath-Cf7jtPFB.js +0 -1
- package/frontend/dist/js/rfb-CtGtw_KV.js +0 -5
- package/frontend/dist/js/rolldown-runtime-hePW80VL.js +0 -1
- package/frontend/dist/js/router-vendor-BHaThOyH.js +0 -1
- package/frontend/dist/js/ui-DF-BqCU3.js +0 -2
- package/frontend/dist/js/ui-vendor--a64oKSu.js +0 -1
- package/frontend/dist/js/useDictation-Dxq5DG5V.js +0 -1
- package/frontend/dist/js/useQuery-Cv6hRATl.js +0 -1
- package/frontend/dist/js/utils-BCv-T6HP.js +0 -1
- package/frontend/dist/js/workAnnouncements-C2Cd6YCk.js +0 -1
- package/frontend/dist/js/workApi-CsmIQW0M.js +0 -1
- package/frontend/dist/js/xterm-CerOhKYV.js +0 -16
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t}from"./react-vendor-C1iE8mnY.js";var n=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,r=/^[\\/]{2}/;function i(e,t){return t+e.replace(/\\/g,`/`)}var a=`popstate`;function o(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function s(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return p(``,{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:m(t)}return g(t,n,null,e)}function c(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=h(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),p(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){let n=e.document.querySelector(`base`),r=``;if(n&&n.getAttribute(`href`)){let t=e.location.href,n=t.indexOf(`#`);r=n===-1?t:t.slice(0,n)}return r+`#`+(typeof t==`string`?t:m(t))}function r(e,t){u(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return g(t,n,r,e)}function l(e,t){if(e===!1||e==null)throw Error(t)}function u(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function d(){return Math.random().toString(36).substring(2,10)}function f(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 p(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?h(t):t,state:n,key:t&&t.key||r||d(),mask:i}}function m({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 h(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 g(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,c=i.history,l=`POP`,u=null,d=m();d??(d=0,c.replaceState({...c.state,idx:d},``));function m(){return(c.state||{idx:null}).idx}function h(){l=`POP`;let e=m(),t=e==null?null:e-d;d=e,u&&u({action:l,location:b.location,delta:t})}function g(e,t){l=`PUSH`;let r=o(e)?e:p(b.location,e,t);n&&n(r,e),d=m()+1;let a=f(r,d),h=b.createHref(r.mask||r);try{c.pushState(a,``,h)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(h)}s&&u&&u({action:l,location:b.location,delta:1})}function v(e,t){l=`REPLACE`;let r=o(e)?e:p(b.location,e,t);n&&n(r,e),d=m();let i=f(r,d),a=b.createHref(r.mask||r);c.replaceState(i,``,a),s&&u&&u({action:l,location:b.location,delta:0})}function y(e){return _(i,e)}let b={get action(){return l},get location(){return e(i,c)},listen(e){if(u)throw Error(`A history only accepts one active listener`);return i.addEventListener(a,h),u=e,()=>{i.removeEventListener(a,h),u=null}},createHref(e){return t(i,e)},createURL:y,encodeLocation(e){let t=y(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:g,replace:v,go(e){return c.go(e)}};return b}function _(e,t,n=!1){let i=`http://localhost`;e&&(i=e.location.origin===`null`?e.location.href:e.location.origin),l(i,`No window.location.(origin|href) available to create URL`);let a=typeof t==`string`?t:m(t);return a=a.replace(/ $/,`%20`),!n&&r.test(a)&&(a=i+a),new URL(a,i)}var v=e(t(),1),y=class{#e=new Map;constructor(e){if(e)for(let[t,n]of e)this.set(t,n)}get(e){if(this.#e.has(e))return this.#e.get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){this.#e.set(e,t)}},b=class extends Error{},x=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`,`unstable_validateParams`]);function S(e){return x.has(e)}var C=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`,`unstable_validateParams`]);function w(e){return C.has(e)}function T(e){return e.index===!0}function E(e){let t={};return e.Component&&Object.assign(t,{element:v.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function D(e,t=E,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(l(e.index!==!0||!e.children,`Cannot specify children on an index route`),l(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),T(e)){let n={...e,id:s};return r[s]=O(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=O(n,t(n)),e.children&&(n.children=D(e.children,t,o,r,i)),n}})}function O(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function ee(e,t,n=`/`){return k(e,t,n,!1)}function k(e,t,n,r,i){let a=V((typeof t==`string`?h(t):t).pathname||`/`,n);if(a==null)return null;let o=i??A(e),s=null,c=ue(a);for(let e=0;s==null&&e<o.length;++e)s=se(o[e],c,r);return s}function te(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,loaderData:t[n.id],handle:n.handle}}function A(e){let t=j(e);return N(t),t}function j(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{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;l(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 u=U([r,c.relativePath]),d=n.concat(c);e.children&&e.children.length>0&&(l(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),j(e.children,t,d,u,o)),(e.path!=null||e.index)&&t.push({path:u,score:ae(u,e.index),routesMeta:d.map((e,t)=>{let[n,r]=le(e.relativePath,e.caseSensitive,t===d.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 M(e.path))a(e,t,!0,n)}),t}function M(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=M(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 N(e){e.sort((e,t)=>e.score===t.score?oe(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var P=/^:[\w-]+$/,ne=/^:[\w-]+/,F=3.5,I=3,L=2,R=1,z=10,re=-2,ie=e=>e===`*`;function ae(e,t){let n=e.split(`/`),r=n.length;return n.some(ie)&&(r+=re),t&&(r+=L),n.filter(e=>!ie(e)).reduce((e,t)=>e+(P.test(t)?I:ne.test(t)?F:t===``?R:z),r)}function oe(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 se(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?ce(u,l,s.matcher,s.compiledParams):B(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=B({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:U([a,d.pathname]),pathnameBase:W(U([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=U([a,d.pathnameBase]))}return o}function B(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=le(e.path,e.caseSensitive,e.end);return ce(e,t,n,r)}function ce(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=ye(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=ye(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 le(e,t=!1,n=!0){u(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(/\/((?:[^/?()[\]*^\\]|\\.)+)\?(?=\/|$|\()/g,`(?:/$1)?`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ue(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return u(!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 V(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 de({basename:e,pathname:t}){return t===`/`?e:U([e,t])}var fe=e=>n.test(e);function pe(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?h(e):e,a;return n?(n=ve(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?me(n.substring(1),`/`):me(n,t)):a=t,{pathname:a,search:be(r),hash:xe(i)}}function me(e,t){let n=ye(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function H(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 <Link to="..."> and the router will parse it for you.`}function he(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function ge(e){let t=he(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function _e(e,t,n,r=!1){let i;typeof e==`string`?i=h(e):(i={...e},l(!i.pathname||!i.pathname.includes(`?`),H(`?`,`pathname`,`search`,i)),l(!i.pathname||!i.pathname.includes(`#`),H(`#`,`pathname`,`hash`,i)),l(!i.search||!i.search.includes(`#`),H(`#`,`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=pe(i,s),u=o&&o!==`/`&&o.endsWith(`/`),d=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(u||d)&&(c.pathname+=`/`),c}var ve=e=>e.replace(/[\\/]{2,}/g,`/`),U=e=>ve(e.join(`/`));function ye(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 W=e=>ye(e).replace(/^\/*/,`/`),be=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,xe=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Se=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Ce=class{status;statusText;data;error;internal;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 we(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function G(e){return U(e.map(e=>e.route.path).filter(Boolean))||`/`}function Te(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?h(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);let i=e.toString();n.search=i?`?${i}`:``}else n.search=``;return n.hash=r.hash||``,n}var Ee=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function De(e,t){let a=e;if(typeof a!=`string`||!n.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let o=a,s=!1;if(Ee)try{let e=new URL(window.location.href),n=r.test(a)?new URL(i(a,e.protocol)):new URL(a),o=V(n.pathname,t);n.origin===e.origin&&o!=null?a=o+n.search+n.hash:s=!0}catch{u(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:s,to:a}}var Oe=Symbol(`Uninstrumented`),ke=new WeakMap;function Ae(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){e.lazy!=null&&n.lazy.push(e.lazy),e[`lazy.loader`]!=null&&n[`lazy.loader`].push(e[`lazy.loader`]),e[`lazy.action`]!=null&&n[`lazy.action`].push(e[`lazy.action`]),e[`lazy.middleware`]!=null&&n[`lazy.middleware`].push(e[`lazy.middleware`]),e.middleware!=null&&n.middleware.push(e.middleware),e.loader!=null&&n.loader.push(e.loader),e.action!=null&&n.action.push(e.action)}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=t.lazy;r.lazy=async(...t)=>K(await q(n.lazy,void 0,()=>e(...t),Ie))}if(typeof t.lazy==`object`){let e=t.lazy;if(typeof e.middleware==`function`&&n[`lazy.middleware`].length>0){let t=e.middleware;r.lazy=Object.assign(r.lazy||{},{middleware:async(...e)=>K(await q(n[`lazy.middleware`],void 0,()=>t(...e),Ie))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>K(await q(n[`lazy.loader`],void 0,()=>t(...e),Ie))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>K(await q(n[`lazy.action`],void 0,()=>t(...e),Ie))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=Me(t.loader),i=async(...t)=>K(await q(n.loader,Le(t[0]),()=>e(...t),Ie));e.hydrate===!0&&(i.hydrate=!0),Ne(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=Me(t.action),i=async(...t)=>K(await q(n.action,Le(t[0]),()=>e(...t),Ie));Ne(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=Me(e),r=async(...e)=>K(await q(n.middleware,Le(e[0]),()=>t(...e),Ie));return Ne(r,t),r})),r}function je(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){e.navigate!=null&&n.navigate.push(e.navigate),e.fetch!=null&&n.fetch.push(e.fetch)}})),n.navigate.length>0){let t=Me(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?m(i):`.`,...J(e,a??{})};return K(await q(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=Pe(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...Ie(e),meta:o})))};Ne(r,t),e.navigate=r}if(n.fetch.length>0){let t=Me(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return K(await q(n.fetch,{href:o??`.`,fetcherKey:i,...J(e,s??{})},async()=>{let n=Pe(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...Ie(e),meta:c})))};Ne(r,t),e.fetch=r}return e}function Me(e){return e[Oe]??e}function Ne(e,t){e[Oe]=t}function Pe(e,t){return ke.set(e,t),()=>{ke.get(e)===t&&ke.delete(e)}}function Fe(e){let t=ke.get(e);return ke.delete(e),t}function K(e){if(e.type===`error`)throw e.value;return e.value}async function q(e,t,n,r,i={result:null,innerResult:null},a=e.length-1){let o=e[a];if(o){let s,c=async()=>(s?console.error(`You cannot call instrumented handlers more than once`):s=q(e,t,n,r,i,a-1),await s,l(i.innerResult,`Expected an inner result`),i.innerResult);try{await o(c,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}s||await c(),await s}else{try{i.result={type:`success`,value:await n()}}catch(e){i.result={type:`error`,value:e}}i.innerResult=r(i.result,t)}return i.result||(i.result={type:`error`,value:Error(`No result assigned in instrumentation chain.`)},i.innerResult=r(i.result,t)),i.result}function Ie(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function Le(e){let{request:t,context:n,params:r}=e;return{...e,request:Re(t),params:{...r},context:ze(n)}}function J(e,t){return{currentUrl:m(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 Re(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function ze(e){return{get:t=>e.get(t)}}var Be=class{#e=[];#t=[];#n;constructor(e){this.#n=e}update(e){this.#e=e,this.#t=A(e)}match(e,t=!1){return k(this.#e,e,this.#n,t,this.#t)}},Ve=new URL(`http://localhost`);function He(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Ve)}catch{return Ve}}function Y(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Ue(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 We(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&&!Y(i,n),s=!Y(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Ue(e,i)||!Y(i,a)))throw Error(`External navigation is not allowed`)}var Ge=[`POST`,`PUT`,`PATCH`,`DELETE`],Ke=new Set(Ge),qe=[`GET`,...Ge],Je=new Set(qe),Ye=new Set([301,302,303,307,308]),Xe=new Set([307,308]),Ze={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},Qe={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},$e={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},et=`remix-router-transitions`,tt=Symbol(`ResetLoaderData`);function nt(e,t){return e.unstable_routePatternMatching?(l(void 0,`You must call unstable_preloadRoutePattern() from "react-router/route-pattern" before enabling future.unstable_routePatternMatching.`),new(void 0)(t)):new Be(t)}var rt=class{#e;#t;#n;constructor(e,t){this.#e=e,this.#n=t,this.#n.update(e)}get stableRoutes(){return this.#e}get activeRoutes(){return this.#t??this.#e}get hasHMRRoutes(){return this.#t!=null}setRoutes(e){this.#e=e,this.#t||this.#n.update(e)}setHmrRoutes(e){this.#t=e,this.#n.update(e)}commitHmrRoutes(){this.#t&&(this.#e=this.#t,this.#t=void 0,this.#n.update(this.#e))}},it=new WeakMap;function at(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;l(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let i=e.hydrationRouteProperties||[],a=e.mapRouteProperties,o=a||(()=>({}));if(e.instrumentations){let t=e.instrumentations;o=e=>({...a?.(e),...Ae(t.map(e=>e.route).filter(Boolean),e)})}let s={...e.future},c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let d=nt(s,c),f={},g=new rt(D(e.routes,o,void 0,f),d),v=e.dataStrategy||St,x=null,S=new Set,C=null,w=null,T=null,E=e.hydrationData!=null,O=d.match(e.history.location),ee=!1,k=null,A,j;if(O==null&&!e.patchRoutesOnNavigation){let t=X(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Gt(g.activeRoutes);A=!0,j=!A,O=n,k={[r.id]:t}}else if(O&&!e.hydrationData&&mt(O,e.history.location.pathname).active&&(O=null),!O){A=!1,j=!A,O=[];let t=mt(null,e.history.location.pathname);t.active&&t.matches&&(ee=!0,O=t.matches)}else if(O.some(e=>e.route.lazy))A=!1,j=!A;else if(!O.some(e=>ut(e.route)))A=!0,j=!A;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=O;if(n){let e=O.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}j=!1,A=!0,r.forEach(e=>{let r=dt(e.route,t,n);j||=r.renderFallback,A&&=!r.shouldLoad})}let M,N={historyAction:e.history.action,location:e.history.location,matches:O,initialized:A,renderFallback:j,navigation:Ze,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||k,fetchers:new Map,blockers:new Map},P=`POP`,ne=0,F,I=null,L=!1,R,z=!1,re=new Map,ie=null,ae=!1,oe=!1,se=new Set,B=new Map,ce=0,le=-1,ue=new Map,de=new Set,pe=new Map,me=new Map,H=new Set,he=new Map,ge,_e=null;function ve(){if(x=e.history.listen(({action:t,location:n,delta:r})=>{if(ge){ge(),ge=void 0;return}u(he.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=et({currentLocation:N.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{ge=e});e.history.go(r*-1),Ye(i,{state:`blocked`,location:n,proceed(){Ye(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(N.blockers);e.set(i,$e),W({blockers:e})}}),I?.resolve(),I=null}else return s.unstable_customRouteDiscovery&&(ne+=r||0),G(t,n)}),n){mn(t,re);let e=()=>hn(t,re);t.addEventListener(`pagehide`,e),ie=()=>t.removeEventListener(`pagehide`,e)}return N.initialized||G(`POP`,N.location,{initialHydration:!0}),M}function U(){x&&x(),ie&&ie(),S.clear(),R&&R.abort(),N.fetchers.forEach((e,t)=>Ve(N.fetchers,t)),N.blockers.forEach((e,t)=>Je(t))}function ye(e){return S.add(e),()=>S.delete(e)}function W(e,t={}){let n=e.errors??null,r=n?it.get(n):void 0;r!==void 0&&(n=r),(e.errors!==void 0||e.initialized)&&(N.errors&&it.delete(N.errors),e.errors&&it.set(e.errors,n)),e.matches&&=e.matches.map(e=>{let t=f[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),N={...N,...e};let i=[],a=[];N.fetchers.forEach((e,t)=>{e.state===`idle`&&(H.has(t)?i.push(t):a.push(t))}),H.forEach(e=>{!N.fetchers.has(e)&&!B.has(e)&&i.push(e)}),[...S].forEach(e=>e(N,{deletedFetchers:i,newErrors:n,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),i.forEach(e=>Ve(N.fetchers,e)),a.forEach(e=>N.fetchers.delete(e))}function be(t,n,{flushSync:r}={}){let i=N.actionData!=null&&N.navigation.formMethod!=null&&Q(N.navigation.formMethod)&&N.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?N.actionData:null;let o=n.loaderData?Ht(N.loaderData,n.loaderData,n.matches||[],n.errors):N.loaderData,s=N.blockers;s.size>0&&!ae&&(s=new Map(s),s.forEach((e,t)=>s.set(t,$e)));let c=!ae&&pt(t,n.matches||N.matches),l=L===!0||N.navigation.formMethod!=null&&Q(N.navigation.formMethod)&&t.state?._isRedirect!==!0;g.commitHmrRoutes(),ae||P===`POP`||(P===`PUSH`?e.history.push(t,t.state):P===`REPLACE`&&e.history.replace(t,t.state));let u;if(P===`POP`&&!ae&&t!==N.location){let e=re.get(N.location.pathname);e&&e.has(t.pathname)?u={currentLocation:N.location,nextLocation:t}:re.has(t.pathname)&&(u={currentLocation:t,nextLocation:N.location})}else if(z){let e=re.get(N.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),re.set(N.location.pathname,e)),u={currentLocation:N.location,nextLocation:t}}W({...n,actionData:a,loaderData:o,historyAction:P,location:t,initialized:!0,renderFallback:!1,navigation:Ze,revalidation:`idle`,restoreScrollPosition:c,preventScrollReset:l,blockers:s},{viewTransitionOpts:u,flushSync:r===!0}),xe(),I?.resolve(),I=null,_e?.resolve(),_e=null}function xe(){ne=0,P=`POP`,L=!1,z=!1,ae=!1,oe=!1}async function Se(t,n){if(F&&await F,I?.resolve(),I=null,typeof t==`number`){I||=gn();let n=I.promise;return e.history.go(t),n}let i=Fe(M),{path:a,submission:o,error:s}=ct(!1,st(N.location,N.matches,c,t,n?.fromRouteId,n?.relative),n),l;if(n?.mask){let t=typeof n.mask==`string`?h(n.mask):{...N.location.mask,...n.mask};if(l={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},r.test(l.pathname))throw Error(`External navigation is not allowed`);l.pathname.startsWith(`\\`)&&(l.pathname=l.pathname.replace(/^\\+/,`/`)),We(typeof n.mask==`string`?n.mask:m(n.mask),m(l),e.history.createURL(`/`),`reject`)}let u=N.location,d=p(u,a,n&&n.state,void 0,l);d={...d,...e.history.encodeLocation(d)},We(t==null?e.history.createHref(N.location):typeof t==`string`?t:m(t),e.history.createHref(d.mask||d),e.history.createURL(`/`),`reject`);let f=n&&n.replace!=null?n.replace:void 0,g=`PUSH`;f===!0?g=`REPLACE`:f===!1||o!=null&&Q(o.formMethod)&&o.formAction===N.location.pathname+N.location.search&&(g=`REPLACE`);let _=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,v=(n&&n.flushSync)===!0,y=et({currentLocation:u,nextLocation:d,historyAction:g});y?Ye(y,{state:`blocked`,location:d,proceed(){Ye(y,{state:`proceeding`,proceed:void 0,reset:void 0,location:d}),Se(t,n)},reset(){let e=new Map(N.blockers);e.set(y,$e),W({blockers:e})}}):await G(g,d,{submission:o,pendingError:s,preventScrollReset:_,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:v,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:i})}function Ce(){if(F)return F.then(Ce);_e||=gn(),Le(),W({revalidation:`loading`});let e=_e.promise;return N.navigation.state===`submitting`?e:N.navigation.state===`idle`?(G(N.historyAction,N.location,{startUninterruptedRevalidation:!0,dataStrategyInitiator:`revalidation`}),e):(G(P||N.historyAction,N.navigation.location,{overrideNavigation:N.navigation,dataStrategyInitiator:`revalidation`,enableViewTransition:z===!0}),e)}async function G(t,n,r){F&&await F,R&&R.abort(),R=null,P=t,ae=(r&&r.startUninterruptedRevalidation)===!0,ft(N.location,N.matches),L=(r&&r.preventScrollReset)===!0,z=(r&&r.enableViewTransition)===!0;let i=r?.initialHydration&&N.matches&&N.matches.length>0&&!ee?N.matches:d.match(n),a=(r&&r.flushSync)===!0;if(i&&N.initialized&&!oe&&Jt(N.location,n)&&!(r&&r.submission&&Q(r.submission.formMethod))){be(n,{matches:i},{flushSync:a});return}let o=mt(i,n.pathname);if(o.active&&o.matches&&(i=o.matches),r?.instrumentationNavigateMetaReceiver){let t=cn(e.history,n,i);r.instrumentationNavigateMetaReceiver(t)}if(!i){let{error:e,notFoundMatches:t,route:r}=tt(n.pathname);be(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:a});return}let s=r&&r.overrideNavigation?{...r.overrideNavigation,matches:i,historyAction:t}:void 0;R=new AbortController;let c=Lt(e.history,n,R.signal,r&&r.submission),l=r?.initialHydration?`initialization`:r?.dataStrategyInitiator??`navigation`,u=e.getContext?await e.getContext():new y,f;if(r&&r.pendingError)f=[Wt(i).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Q(r.submission.formMethod)){let d=await Ee(c,l,n,r.submission,i,t,u,o.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:a});if(d.shortCircuited)return;if(d.pendingActionResult){let[e,t]=d.pendingActionResult;if(Z(t)&&we(t.error)&&t.error.status===404){R=null,be(n,{matches:d.matches,loaderData:{},errors:{[e]:t.error}});return}}i=d.matches||i,f=d.pendingActionResult,s=un(n,i,t,r.submission),a=!1,o.active=!1,c=Lt(e.history,c.url,c.signal)}let{shortCircuited:p,matches:m,loaderData:h,errors:g,workingFetchers:_}=await De(c,l,n,i,t,u,o.active,s,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,a,f,r&&r.callSiteDefaultShouldRevalidate);p||(R=null,be(n,{matches:m||i,...Ut(f),loaderData:h,errors:g,..._?{fetchers:_}:{}}))}function Te(){let t=gn();F=t.promise;let n=ne,r=I;I=null,R?.abort(),R=null,xe(),_e?.resolve(),_e=null;let i=new Map(N.blockers);i.forEach((e,t)=>{e.state===`proceeding`&&i.set(t,$e)});let a=new Map(N.fetchers),o=Ge(a);a.forEach((e,t)=>{e.state===`loading`&&!B.has(t)&&(a.set(t,$(e.data)),o=!0)}),se.clear(),W({navigation:Ze,revalidation:`idle`,blockers:i,...o?{fetchers:a}:{}});function s(){F=void 0,r?.resolve(),t.resolve()}return n?(ge=s,e.history.go(-n)):s(),t.promise}async function Ee(t,n,r,a,l,u,d,p,m,h={}){if(s.unstable_customRouteDiscovery||Le(),W({navigation:dn(r,l,u,a)},{flushSync:h.flushSync===!0}),p){let e=await gt(l,r.pathname,t.signal);if(s.unstable_customRouteDiscovery&&t.signal.aborted||e.type===`aborted`)return{shortCircuited:!0};if(e.type===`cancelled`)return await Te(),{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Gt(g.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Wt(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:n}=tt(r.pathname);return{matches:e,pendingActionResult:[n.id,{type:`error`,error:t}]}}}s.unstable_customRouteDiscovery&&Le();let _,v=sn(l,r);if(!v.route.action&&!v.route.lazy)_={type:`error`,error:X(405,{method:t.method,pathname:r.pathname,routeId:v.route.id})};else{let e=await q(t,r,Ot(o,f,t,r,l,v,m?[]:i,d),d,null,n,u);if(_=e[v.route.id],!_){for(let t of l)if(e[t.route.id]){_=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if($t(_)){let r;return r=h&&h.replace!=null?h.replace:It(_.response.headers.get(`Location`),new URL(t.url),c,e.history)===N.location.pathname+N.location.search,await K(t,_,!0,n,{submission:a,replace:r}),{shortCircuited:!0}}if(Z(_)){let e=Wt(l,v.route.id);return(h&&h.replace)!==!0&&(P=`PUSH`),{matches:l,pendingActionResult:[e.route.id,_,v.route.id]}}return{matches:l,pendingActionResult:[v.route.id,_]}}async function De(t,n,r,a,c,l,u,p,m,h,_,v,y,b,x){let S=p||un(r,a,c,m),C=m||h||ln(S),w=!ae&&!v;if(u){if(w){let e=Oe(b);W({navigation:S,...e===void 0?{}:{actionData:e}},{flushSync:y})}let e=await gt(a,r.pathname,t.signal);if(s.unstable_customRouteDiscovery&&t.signal.aborted||e.type===`aborted`)return{shortCircuited:!0};if(e.type===`cancelled`)return await Te(),{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Gt(g.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Wt(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)a=e.matches,v&&!t.signal.aborted&&W({matches:a});else{let{error:e,notFoundMatches:t,route:n}=tt(r.pathname);return{matches:t,loaderData:{},errors:{[n.id]:e}}}}let{dsMatches:T,revalidatingFetchers:E}=lt(t,l,o,f,e.history,N,a,C,r,v?[]:i,v===!0,oe,se,H,pe,de,d,b,x);if(le=++ce,!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(N.fetchers),t=Ge(e);return be(r,{matches:a,loaderData:{},errors:b&&Z(b[1])?{[b[0]]:b[1].error}:null,...Ut(b),...t?{fetchers:e}:{}},{flushSync:y}),{shortCircuited:!0}}if(w){let e={};if(!u){e.navigation=S;let t=Oe(b);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=ke(E)),W(e,{flushSync:y})}E.forEach(e=>{Y(e.key),e.controller&&B.set(e.key,e.controller)});let D=()=>E.forEach(e=>Y(e.key));R&&R.signal.addEventListener(`abort`,D);let{loaderResults:O,fetcherResults:ee}=await Ie(T,E,t,r,l,n,c);if(t.signal.aborted)return{shortCircuited:!0};R&&R.signal.removeEventListener(`abort`,D),E.forEach(e=>B.delete(e.key));let k=Kt(O);if(k)return await K(t,k.result,!0,n,{replace:_}),{shortCircuited:!0};if(k=Kt(ee),k)return de.add(k.key),await K(t,k.result,!0,n,{replace:_}),{shortCircuited:!0};let te=new Map(N.fetchers),{loaderData:A,errors:j}=Vt(N,a,O,b,E,ee,te);if(v&&N.errors){let e=j??null;j={...N.errors,...j},it.set(j,e)}let M=Ge(te),P=Ke(le,te),ne=M||P||E.length>0;return{matches:a,loaderData:A,errors:j,...ne?{workingFetchers:te}:{}}}function Oe(e){if(e&&!Z(e[1]))return{[e[0]]:e[1].data};if(N.actionData)return Object.keys(N.actionData).length===0?null:N.actionData}function ke(e){let t=new Map(N.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=fn(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function Me(t,n,r,i){F&&await F,Y(t);let a=(i&&i.flushSync)===!0,o=Fe(M),s=st(N.location,N.matches,c,r,n,i?.relative),l=d.match(s),u=mt(l,s);if(u.active&&u.matches&&(l=u.matches),o&&o(cn(e.history,s,l)),!l){Re(t,n,X(404,{pathname:s}),{flushSync:a});return}let{path:f,submission:p,error:m}=ct(!0,s,i);if(m){Re(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new y,g=(i&&i.preventScrollReset)===!0;if(p&&Q(p.formMethod)){await Ne(t,n,f,l,h,u.active,a,g,p,i&&i.defaultShouldRevalidate);return}let _={routeId:n,path:f,isDiscovering:u.active};pe.set(t,_),await Pe(t,_,l,h,a,g,p)}async function Ne(t,n,r,a,c,u,p,m,h,g){s.unstable_customRouteDiscovery||Le(),pe.delete(t);let _=N.fetchers.get(t);J(t,pn(h,_),{flushSync:p});let v=new AbortController;s.unstable_customRouteDiscovery&&B.set(t,v);let y=Lt(e.history,r,v.signal,h);if(u){let e=await gt(a,new URL(y.url).pathname,y.signal,t);if(s.unstable_customRouteDiscovery&&y.signal.aborted||e.type===`aborted`)return;if(e.type===`cancelled`){B.delete(t),pe.delete(t),J(t,$(_?.data),{flushSync:p});return}if(e.type===`error`){Re(t,n,e.error,{flushSync:p});return}if(e.matches)a=e.matches;else{Re(t,n,X(404,{pathname:r}),{flushSync:p});return}}let b=sn(a,r);if(!b.route.action&&!b.route.lazy){Re(t,n,X(405,{method:h.formMethod,pathname:r,routeId:n}),{flushSync:p});return}s.unstable_customRouteDiscovery&&Le(),B.set(t,v);let x=ce,S=Ot(o,f,y,r,a,b,i,c),C=await q(y,r,S,c,t,`fetcher`),w=C[b.route.id];if(!w){for(let e of S)if(C[e.route.id]){w=C[e.route.id];break}}if(y.signal.aborted){B.get(t)===v&&B.delete(t);return}if(H.has(t)){if($t(w)||Z(w)){J(t,$(void 0));return}}else{if($t(w)){if(B.delete(t),le>x){J(t,$(void 0));return}return de.add(t),J(t,fn(h)),K(y,w,!1,`fetcher`,{fetcherSubmission:h,preventScrollReset:m})}if(Z(w)){Re(t,n,w.error);return}}let T=N.navigation.location||N.location,E=Lt(e.history,T,v.signal),D=N.navigation.state===`idle`?N.matches:d.match(N.navigation.location);l(D,`Didn't find any matches after fetcher action`);let O=++ce;ue.set(t,O);let{dsMatches:ee,revalidatingFetchers:k}=lt(E,c,o,f,e.history,N,D,h,T,i,!1,oe,se,H,pe,de,d,[b.route.id,w],g),te=fn(h,w.data),A=new Map(N.fetchers);A.set(t,te),k.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=A.get(t),r=fn(void 0,n?n.data:void 0);A.set(t,r),Y(t),e.controller&&B.set(t,e.controller)}),W({fetchers:A});let j=()=>k.forEach(e=>Y(e.key));v.signal.addEventListener(`abort`,j);let{loaderResults:M,fetcherResults:ne}=await Ie(ee,k,E,T,c,`fetcher`);if(v.signal.aborted){ue.get(t)===O&&ue.delete(t);return}v.signal.removeEventListener(`abort`,j),ue.delete(t),B.delete(t),k.forEach(e=>B.delete(e.key));let F=N.fetchers.has(t),I=e=>{if(!F)return e;let n=new Map(e.fetchers);return n.set(t,$(w.data)),{...e,fetchers:n}},L=Kt(M);if(L)return N=I(N),K(E,L.result,!1,`fetcher`,{preventScrollReset:m});if(L=Kt(ne),L)return de.add(L.key),N=I(N),K(E,L.result,!1,`fetcher`,{preventScrollReset:m});let z=new Map(N.fetchers);F&&z.set(t,$(w.data));let{loaderData:re,errors:ie}=Vt(N,D,M,void 0,k,ne,z);Ke(O,z),N.navigation.state===`loading`&&O>le?(l(P,`Expected pending action`),R&&R.abort(),be(N.navigation.location,{matches:D,loaderData:re,errors:ie,fetchers:z})):(W({errors:ie,loaderData:Ht(N.loaderData,re,D,ie),fetchers:z}),oe=!1)}async function Pe(t,n,r,a,c,l,u){let{routeId:d,path:p}=n,m=N.fetchers.get(t);J(t,fn(u,m?m.data:void 0),{flushSync:c});let h=new AbortController;s.unstable_customRouteDiscovery&&B.set(t,h);let g=Lt(e.history,p,h.signal);if(n.isDiscovering){let e=await gt(r,new URL(g.url).pathname,g.signal,t);if(s.unstable_customRouteDiscovery&&g.signal.aborted||e.type===`aborted`)return;if(e.type===`cancelled`){B.delete(t),pe.delete(t),J(t,$(m?.data),{flushSync:c});return}if(e.type===`error`){Re(t,d,e.error,{flushSync:c});return}if(e.matches)r=e.matches,n.isDiscovering=!1;else{Re(t,d,X(404,{pathname:p}),{flushSync:c});return}}let _=sn(r,p);B.set(t,h);let v=ce,y=await q(g,p,Ot(o,f,g,p,r,_,i,a),a,t,`fetcher`),b=y[_.route.id];if(!b){for(let e of r)if(y[e.route.id]){b=y[e.route.id];break}}if(B.get(t)===h&&B.delete(t),!g.signal.aborted){if(H.has(t))J(t,$(void 0));else{if($t(b)){if(le>v){J(t,$(void 0));return}de.add(t),await K(g,b,!1,`fetcher`,{preventScrollReset:l});return}Z(b)?Re(t,d,b.error):J(t,$(b.data))}}}async function K(r,i,a,o,{submission:s,fetcherSubmission:u,preventScrollReset:d,replace:f}={}){a||(I?.resolve(),I=null),i.response.headers.has(`X-Remix-Revalidate`)&&(oe=!0);let m=i.response.headers.get(`Location`);l(m,`Expected a Location header on the redirect Response`);let h=m,g=new URL(r.url);m=It(m,g,c,e.history),We(h,m,g,`allow-explicit`);let v=p(N.location,m,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(fe(m)){let n=_(t,m,!0);e=n.origin!==t.location.origin||V(n.pathname,c)==null}if(e){f?t.location.replace(m):t.location.assign(m);return}}R=null;let y=f===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:b,formAction:x,formEncType:S}=N.navigation;!s&&!u&&b&&x&&S&&(s=ln(N.navigation));let C=s||u;Xe.has(i.response.status)&&C&&Q(C.formMethod)?await G(y,v,{submission:{...C,formAction:m},preventScrollReset:d||L,enableViewTransition:a?z:void 0,dataStrategyInitiator:o}):await G(y,v,{overrideNavigation:un(v,[],y,s),fetcherSubmission:u,preventScrollReset:d||L,enableViewTransition:a?z:void 0,dataStrategyInitiator:o})}async function q(e,t,n,r,i,a,o=null){let s,l={};try{s=await kt(v,e,t,n,i,a,r,!1,o)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{l[t.route.id]={type:`error`,error:e}}),l}if(e.signal.aborted)return l;if(!Q(e.method))for(let e of n){if(s[e.route.id]?.type===`error`)break;s.hasOwnProperty(e.route.id)||N.loaderData.hasOwnProperty(e.route.id)||N.errors&&N.errors.hasOwnProperty(e.route.id)||!e.shouldCallHandler()||(s[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(s))if(Qt(r)){let i=r.result;l[t]={type:`redirect`,response:Nt(i,e,t,n,c)}}else l[t]=await Mt(r);return l}async function Ie(e,t,n,r,i,a,o=null){let s=q(n,r,e,i,null,a,o),c=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await q(e.request,e.path,e.matches,i,e.key,a,o))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:X(404,{pathname:e.path})}})}));return{loaderResults:await s,fetcherResults:(await c).reduce((e,t)=>Object.assign(e,t),{})}}function Le(){oe=!0,pe.forEach((e,t)=>{s.unstable_customRouteDiscovery&&e.isDiscovering||(B.has(t)&&se.add(t),Y(t))})}function J(e,t,n={}){let r=new Map(N.fetchers);r.set(e,t),W({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function Re(e,t,n,r={}){let i=Wt(N.matches,t),a=new Map(N.fetchers);Ve(a,e),W({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function ze(e){return me.set(e,(me.get(e)||0)+1),H.has(e)&&H.delete(e),N.fetchers.get(e)||Qe}function Be(e,t){Y(e,t?.reason),pe.delete(e),se.delete(e),J(e,$(null))}function Ve(e,t){let n=N.fetchers.get(t);B.has(t)&&!(n&&n.state===`loading`&&ue.has(t))&&Y(t),pe.delete(t),ue.delete(t),de.delete(t),H.delete(t),se.delete(t),e.delete(t)}function He(e){let t=(me.get(e)||0)-1;t<=0?(me.delete(e),H.add(e)):me.set(e,t),W({fetchers:new Map(N.fetchers)})}function Y(e,t){let n=B.get(e);n&&(n.abort(t),B.delete(e))}function Ue(e,t){for(let n of e){let e=t.get(n);l(e,`Expected fetcher: ${n}`);let r=$(e.data);t.set(n,r)}}function Ge(e){let t=[],n=!1;for(let r of de){let i=e.get(r);l(i,`Expected fetcher: ${r}`),i.state===`loading`&&(de.delete(r),t.push(r),n=!0)}return Ue(t,e),n}function Ke(e,t){let n=[];for(let[r,i]of ue)if(i<e){let e=t.get(r);l(e,`Expected fetcher: ${r}`),e.state===`loading`&&(Y(r),ue.delete(r),n.push(r))}return Ue(n,t),n.length>0}function qe(e,t){let n=N.blockers.get(e)||$e;return he.get(e)!==t&&he.set(e,t),n}function Je(e){N.blockers.delete(e),he.delete(e)}function Ye(e,t){let n=N.blockers.get(e)||$e;l(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(N.blockers);r.set(e,t),W({blockers:r})}function et({currentLocation:e,nextLocation:t,historyAction:n}){if(he.size===0)return;he.size>1&&u(!1,`A router only supports one blocker at a time`);let r=Array.from(he.entries()),[i,a]=r[r.length-1],o=N.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function tt(e){let t=X(404,{pathname:e}),n=g.activeRoutes,{matches:r,route:i}=Gt(n);return{notFoundMatches:r,route:i,error:t}}function at(e,t,n){if(C=e,T=t,w=n||null,!E&&N.navigation===Ze){E=!0;let e=pt(N.location,N.matches);e!=null&&W({restoreScrollPosition:e})}return()=>{C=null,T=null,w=null}}function ot(e,t){return w&&w(e,t.map(e=>te(e,N.loaderData)))||e.key}function ft(e,t){if(C&&T){let n=ot(e,t);C[n]=T()}}function pt(e,t){if(C){let n=ot(e,t),r=C[n];if(typeof r==`number`)return r}return null}function mt(t,n){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:d.match(n,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:d.match(n,!0)}}return{active:!1,matches:null}}async function gt(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let a=t;for(;;){let t=f;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:a,fetcherKey:i,patch:(e,n)=>{r.aborted||ht(e,n,g,t,o,!1)}})}catch(e){if(s.unstable_customRouteDiscovery){if(r.aborted)return{type:`aborted`};if(e instanceof b)return{type:`cancelled`}}return{type:`error`,error:e,partialMatches:a}}if(r.aborted)return{type:`aborted`};let c=d.match(n),l=null;if(c&&(Object.keys(c[0].params).length===0||(l=d.match(n,!0),!(l&&a.length<l.length&&_t(a,l.slice(0,a.length))))))return{type:`success`,matches:c};if(l||=d.match(n,!0),!l||_t(a,l))return{type:`success`,matches:null};a=l}}function _t(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function vt(e){f={},g.setHmrRoutes(D(e,o,void 0,f))}function yt(e,t,n=!1){ht(e,t,g,f,o,n),g.hasHMRRoutes||W({})}return M={get basename(){return c},get future(){return s},get state(){return N},get routes(){return g.stableRoutes},match(e){return d.match(e)},get manifest(){return f},get window(){return t},initialize:ve,subscribe:ye,enableScrollRestoration:at,navigate:Se,fetch:Me,revalidate:Ce,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:ze,resetFetcher:Be,deleteFetcher:He,dispose:U,getBlocker:qe,deleteBlocker:Je,patchRoutes:yt,_internalFetchControllers:B,_internalSetRoutes:vt,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){W(e)}},e.instrumentations&&(M=je(M,e.instrumentations.map(e=>e.router).filter(Boolean))),M}function ot(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function st(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=_e(r||`.`,ge(o),V(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=on(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=de({basename:n,pathname:c.pathname})),m(c)}function ct(e,t,n){if(!n||!ot(n))return{path:t};if(n.formMethod&&!an(n.formMethod))return{path:t,error:X(405,{method:n.formMethod})};let r=()=>({path:t,error:X(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=qt(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Q(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}\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(!Q(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()}}}l(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Rt(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Rt(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=zt(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=zt(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(Q(c.formMethod))return{path:t,submission:c};let u=h(t);return e&&u.search&&on(u.search)&&o.append(`index`,``),u.search=`?${o}`,{path:m(u),submission:c}}function lt(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=_?Z(_[1])?_[1].error:_[1].data:void 0,b=i.createURL(a.location),x=i.createURL(c),S;if(u&&a.errors){let e=Object.keys(a.errors)[0];S=o.findIndex(t=>t.route.id===e)}else if(_&&Z(_[1])){let e=_[0];S=o.findIndex(t=>t.route.id===e)-1}let C=_?_[1].statusCode:void 0,w=C&&C>=400,T={currentUrl:b,currentParams:a.matches[0]?.params||{},nextUrl:x,nextParams:o[0].params,...s,actionResult:y,actionStatus:C},E=G(o),D=o.map((i,o)=>{let{route:s}=i,f=null;if(S!=null&&o>S)f=!1;else if(s.lazy)f=!0;else if(!ut(s))f=!1;else if(u){let{shouldLoad:e}=dt(s,a.loaderData,a.errors);f=e}else ft(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Dt(n,r,e,c,E,i,l,t,f);let p=!1;typeof v==`boolean`?p=v:w?p=!1:d||b.pathname+b.search===x.pathname+x.search?p=!0:b.search===x.search?pt(a.matches[o],i)&&(p=!0):p=!0;let m={...T,defaultShouldRevalidate:p};return Dt(n,r,e,c,E,i,l,t,mt(i,m),m,v)}),O=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s)||e.isDiscovering)return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,_=g.match(e.path);if(!_){O.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let y=sn(_,e.path),b=new AbortController,x=Lt(i,e.path,b.signal),S=null;if(f.has(s))f.delete(s),S=Ot(n,r,x,e.path,_,y,l,t);else if(m)d&&(S=Ot(n,r,x,e.path,_,y,l,t));else{let i;i=typeof v==`boolean`?v:!w&&d;let a={...T,defaultShouldRevalidate:i};mt(y,a)&&(S=Ot(n,r,x,e.path,_,y,l,t,a))}S&&O.push({key:s,routeId:e.routeId,path:e.path,matches:S,match:y,request:x,controller:b})}),{dsMatches:D,revalidatingFetchers:O}}function ut(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function dt(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!ut(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 ft(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function pt(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function mt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function ht(e,t,n,r,i,a){let o;if(e){let t=r[e];l(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=>gt(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=D(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=D([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function gt(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index!==t.index||e.path!==t.path||e.caseSensitive!==t.caseSensitive?!1:(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>gt(e,t)))??!1}var _t=new WeakMap,vt=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(l(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=_t.get(i);o||(o={},_t.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=S(e),n=i[e]!==void 0;if(t)u(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)u(!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},yt=new WeakMap;function bt(e,t,n,r,i){let a=n[e.id];if(l(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=yt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{l(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=w(e),o=a[e]!==void 0;i?u(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?u(!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 yt.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=vt({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let d=s.length>0?Promise.all(s).then(()=>{}):void 0;return d?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:c}}async function xt(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 St(e){return e.matches.some(e=>e.route.middleware)?Ct(e,()=>xt(e)):xt(e)}function Ct(e,t){return wt(e,t,e=>{if(rn(e))throw e;return e},Xt,n);async function n(t,n,r){if(r)return Object.assign(r.value,{[n]:{type:`error`,result:t}});{let{matches:r}=e,i=Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0)),a=r[i].route.id;for(let e of r.slice(0,i+1))try{await e._lazyPromises?.route}catch{a=e.route.id;break}return{[Wt(r,a).route.id]:{type:`error`,result:t}}}}}async function wt(e,t,n,r,i){let{matches:a,...o}=e;return await Tt(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Tt(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 Tt(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 Et(e,t,n,r,i){let a=vt({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=bt(r.route,Q(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Dt(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=Et(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?mt(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?mt(a,{...l,defaultShouldRevalidate:e}):mt(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Q(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Q(n.method)||!p)?At({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 Ot(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Dt(e,t,n,r,G(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Et(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function kt(e,t,n,r,i,a,o,s,c=null){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let l={request:t,url:Te(t,n),pattern:G(r),params:r[0].params,context:o,matches:r,unstable_initiator:a,unstable_navigationType:a===`navigation`?c:null},u=s?()=>{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=l;return Ct(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},d=await e({...l,fetcherKey:i,runClientMiddleware:u});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return d}async function At({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Q(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:Te(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 X(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 X(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function jt(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 Mt(e){let{result:t,type:n}=e;if(tn(t)){let e;try{e=await jt(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new Ce(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?en(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:Yt(t),statusCode:we(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:we(t)?t.status:void 0}:en(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 Nt(e,t,n,r,i){let a=e.headers.get(`Location`);if(l(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!fe(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=st(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Pt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Ft(e){try{return Pt.includes(new URL(e).protocol)}catch{return!1}}function It(e,t,n,a){if(fe(e)){let a=e,o=r.test(a)?new URL(i(a,t.protocol)):new URL(a);if(Ft(o.toString()))throw Error(`Invalid redirect location`);let s=V(o.pathname,n)!=null;if(o.origin===t.origin&&s)return ve(o.pathname)+o.search+o.hash}try{if(Ft(a.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function Lt(e,t,n,r){let i=e.createURL(qt(t)).toString(),a={signal:n};if(r&&Q(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?Rt(r.formData):r.formData}return new Request(i,a)}function Rt(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function zt(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Bt(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,u={},d=n&&Z(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let f=n.route.id,p=t[f];if(l(!$t(p),`Cannot handle redirect results in processLoaderData`),Z(p)){let t=p.error;if(d!==void 0&&(t=d,d=void 0),o||={},i)o[f]=t;else{let n=Wt(e,f);o[n.route.id]??(o[n.route.id]=t)}r||(a[f]=tt),c||(c=!0,s=we(p.error)?p.error.status:500),p.headers&&(u[f]=p.headers)}else a[f]=p.data,p.statusCode&&p.statusCode!==200&&!c&&(s=p.statusCode),p.headers&&(u[f]=p.headers)}),d!==void 0&&n&&(o={[n[0]]:d},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:u}}function Vt(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Bt(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(l(s,`Did not find corresponding fetcher result`),Z(s)){let t=Wt(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if($t(s))l(!1,`Unhandled fetcher revalidation redirect`);else{let e=$(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function Ht(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==tt).reduce((e,[t,n])=>(e[t]=n,e),{}),a=0;for(let o of n){let n=o.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&o.route.loader&&(i[n]=e[n],a++),r&&r.hasOwnProperty(n))break}return Object.keys(t).length===0&&a===Object.keys(e).length?e:i}function Ut(e){return e?Z(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Wt(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.ErrorBoundary!=null||e.route.errorElement!=null)||e[0]}function Gt(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 X(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 Ce(e||500,o,Error(s),!0)}function Kt(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if($t(r))return{key:n,result:r}}}function qt(e){return m({...typeof e==`string`?h(e):e,hash:``})}function Jt(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Yt(e){return new Ce(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Xt(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Zt(t))}function Zt(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function Qt(e){return tn(e.result)&&Ye.has(e.result.status)}function Z(e){return e.type===`error`}function $t(e){return(e&&e.type)===`redirect`}function en(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function tn(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function nn(e){return Ye.has(e)}function rn(e){return tn(e)&&nn(e.status)&&e.headers.has(`Location`)}function an(e){return Je.has(e.toUpperCase())}function Q(e){return Ke.has(e.toUpperCase())}function on(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function sn(e,t){let n=typeof t==`string`?h(t).search:t.search;if(e[e.length-1].route.index&&on(n||``))return e[e.length-1];let r=he(e);return r[r.length-1]}function cn(e,t,n){return{url:Te(e.createURL(t),t),pattern:n?G(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function ln(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 un(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 dn(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 fn(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 pn(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 $(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 mn(e,t){try{let n=e.sessionStorage.getItem(et);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 hn(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(et,JSON.stringify(n))}catch(e){u(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function gn(){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 _n=v.createContext(null);_n.displayName=`DataRouter`;var vn=v.createContext(null);vn.displayName=`DataRouterState`;var yn=v.createContext(null);yn.displayName=`DataRouterData`;var bn=v.createContext(null);bn.displayName=`DataRouterNavigation`;var xn=v.createContext(!1);function Sn(){return v.useContext(xn)}var Cn=v.createContext({isTransitioning:!1});Cn.displayName=`ViewTransition`;var wn=v.createContext(null);wn.displayName=`Fetchers`;var Tn=v.createContext(null);Tn.displayName=`Await`;var En=v.createContext(null);En.displayName=`Navigation`;var Dn=v.createContext(null);Dn.displayName=`Location`;var On=v.createContext({outlet:null,matches:[],isDataRoute:!1});On.displayName=`Route`;var kn=v.createContext(!1);kn.displayName=`IsDataRoute`;var An=v.createContext(void 0);An.displayName=`RouteId`;var jn=v.createContext(null);jn.displayName=`RouteError`;var Mn=`REACT_ROUTER_ERROR`,Nn=`REDIRECT`,Pn=`ROUTE_ERROR_RESPONSE`;function Fn(e){if(e.startsWith(`${Mn}:${Nn}:{`))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 In(e){if(e.startsWith(`${Mn}:${Pn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Ce(t.status,t.statusText,t.data)}catch{}}function Ln(e,{relative:t}={}){l(Rn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=v.useContext(En),{hash:i,pathname:a,search:o}=Wn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:U([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Rn(){return v.useContext(Dn)!=null}function zn(){return l(Rn(),`useLocation() may be used only in the context of a <Router> component.`),v.useContext(Dn).location}var Bn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Vn(){return v.useContext(kn)?cr():Hn()}function Hn(){l(Rn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=v.useContext(_n),{basename:t,navigator:n}=v.useContext(En),{matches:r}=v.useContext(On),{pathname:i}=zn(),a=JSON.stringify(ge(r)),o=v.useRef(!1);return v.useLayoutEffect(()=>{o.current=!0}),v.useCallback((r,s={})=>{if(u(o.current,Bn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=_e(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:U([t,c.pathname])),We(typeof r==`string`?r:m(r),n.createHref(c),He(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}v.createContext(null);function Un(){let{matches:e}=v.useContext(On);return e[e.length-1]?.params??{}}function Wn(e,{relative:t}={}){let{matches:n}=v.useContext(On),{pathname:r}=zn(),i=JSON.stringify(ge(n));return v.useMemo(()=>_e(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Gn(e,t){return Kn(e,t)}function Kn(e,t,n){l(Rn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=v.useContext(En),{matches:i}=v.useContext(On),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let c=zn(),u;if(t){let e=typeof t==`string`?h(t):t;l(s===`/`||e.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`),u=e}else u=c;let d=u.pathname||`/`,f=d;if(s!==`/`){let e=s.replace(/^\//,``).split(`/`);f=`/`+d.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let p;p=n?n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):n.router.match(n.state.location):ee(e,{pathname:f});let m=$n(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:U([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:U([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&m?v.createElement(Dn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...u},navigationType:`POP`}},m):m}function qn(){let e=ar(),t=we(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return v.createElement(v.Fragment,null,v.createElement(`h2`,null,`Unexpected Application Error!`),v.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?v.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var Jn=v.createElement(qn,null),Yn=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=xn;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=In(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:v.createElement(On.Provider,{value:this.props.routeContext},v.createElement(kn.Provider,{value:this.props.routeContext.isDataRoute},v.createElement(An.Provider,{value:this.props.routeContext.matches[this.props.routeContext.matches.length-1]?.route.id},v.createElement(jn.Provider,{value:e,children:this.props.component}))));return this.context?v.createElement(Zn,{error:e},t):t}},Xn=new WeakMap;function Zn({children:e,error:t}){let{basename:n,navigator:r}=v.useContext(En);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Fn(t.digest);if(e){let i=Xn.get(t);if(i)throw i;let a=De(e.location,n),o=a.absoluteURL||a.to;if(We(e.location,o,He(r),`allow-explicit`),Ft(o))throw Error(`Invalid redirect location`);if(Ee&&!Xn.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 Xn.set(t,n),n}}return v.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function Qn({routeContext:e,match:t,children:n}){let r=v.useContext(_n);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(On.Provider,{value:e},v.createElement(kn.Provider,{value:e.isDataRoute},v.createElement(An.Provider,{value:t.route.id},n)))}function $n(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);l(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<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,u=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:G(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let l,d=!1,f=null,p=null;r&&(l=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Jn,o&&(s<0&&c===0?(ur(`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=l?f:d?p:n.route.Component?v.createElement(n.route.Component,null):n.route.element?n.route.element:e,v.createElement(Qn,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?v.createElement(Yn,{location:r.location,revalidation:r.revalidation,component:f,error:l,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:u}):h()},null)}function er(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function tr(e){let t=v.useContext(_n);return l(t,er(e)),t}function nr(e){let t=v.useContext(vn);return l(t,er(e)),t}function rr(e){let t=v.useContext(yn);return l(t,er(e)),t}function ir(e){let t=v.useContext(An);return l(t,`${e} can only be used on routes that contain a unique "id"`),t}function ar(){let e=v.useContext(jn),t=rr(`useRouteError`),n=ir(`useRouteError`);return e===void 0?t.errors?.[n]:e}var or=0;function sr(e){let{router:t,basename:n}=tr(`useBlocker`),r=nr(`useBlocker`),[i,a]=v.useState(``),o=v.useCallback(t=>{if(typeof e!=`function`)return!!e;if(n===`/`)return e(t);let{currentLocation:r,nextLocation:i,historyAction:a}=t;return e({currentLocation:{...r,pathname:V(r.pathname,n)||r.pathname},nextLocation:{...i,pathname:V(i.pathname,n)||i.pathname},historyAction:a})},[n,e]);return v.useEffect(()=>{let e=String(++or);return a(e),()=>t.deleteBlocker(e)},[t]),v.useEffect(()=>{i!==``&&t.getBlocker(i,o)},[t,i,o]),i&&r.blockers.has(i)?r.blockers.get(i):$e}function cr(){let{router:e}=tr(`useNavigate`),t=ir(`useNavigate`),n=v.useRef(!1);return v.useLayoutEffect(()=>{n.current=!0}),v.useCallback(async(r,i={})=>{u(n.current,Bn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var lr={};function ur(e,t,n){!t&&!lr[e]&&(lr[e]=!0,u(!1,n))}function dr(e,t){if(e===!1||e==null)throw Error(t)}function fr(e,t,n){let r=typeof e==`string`?new URL(e,n??(typeof window>`u`?`server://singlefetch/`:window.location.origin)):new URL(e);return n&&r.origin!==n&&(r=new URL(r.pathname+r.search+r.hash,n)),r.pathname.endsWith(`/`)?r.pathname=`${r.pathname}_.${t}`:r.pathname=`${r.pathname}.${t}`,r}async function pr(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function mr(e){return e!=null&&typeof e.page==`string`}function hr(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function gr(e,t,n){return xr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await pr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(hr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function _r(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function vr(e,t,{includeHydrateFallback:n}={}){return yr(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function yr(e){return[...new Set(e)]}function br(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function xr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!mr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(br(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}var Sr={};function Cr(e,t){!e&&!Sr[t]&&(Sr[t]=!0,console.warn(t))}var wr=v.createContext(void 0);wr.displayName=`FrameworkContext`;function Tr(){let e=v.useContext(wr);return dr(e,`You must render this element inside a <HydratedRouter> element`),e}function Er(e,t){let n=v.useContext(wr),[r,i]=v.useState(!1),[a,o]=v.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=v.useRef(null);v.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),v.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Dr(s,p),onBlur:Dr(c,m),onMouseEnter:Dr(l,p),onMouseLeave:Dr(u,m),onTouchStart:Dr(d,p)}]:[a,f,{}]:[!1,f,{}]}function Dr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Or({page:e,...t}){let n=Sn(),{nonce:r}=Tr(),{router:i}=tr(`PrefetchPageLinks`),a=v.useMemo(()=>i.match(e),[i,i.routes,e]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?v.createElement(Ar,{page:e,matches:a,...t}):v.createElement(jr,{page:e,matches:a,...t})):null}function kr(e){let{manifest:t,routeModules:n}=Tr(),[r,i]=v.useState([]);return v.useEffect(()=>{let r=!1;return gr(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Ar({page:e,matches:t,...n}){let r=zn(),{unstable_apiServerOrigin:i}=Tr(),a=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=fr(e,`rsc`,i),a=!1,o=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?a=!0:o.push(e.route.id);return a&&o.length>0&&n.searchParams.set(`_routes`,o.join(`,`)),[i?n.toString():n.pathname+n.search]},[e,r,t,i]);return v.createElement(v.Fragment,null,a.map(e=>v.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function jr({page:e,matches:t,...n}){let r=zn(),{manifest:i,routeModules:a,unstable_apiServerOrigin:o}=Tr(),{matches:s}=nr(`PrefetchPageLinks`),{loaderData:c}=rr(`PrefetchPageLinks`),l=v.useMemo(()=>_r(e,t,s,i,r,`data`),[e,t,s,i,r]),u=v.useMemo(()=>_r(e,t,s,i,r,`assets`),[e,t,s,i,r]),d=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,s=!1;if(t.forEach(e=>{let t=i.routes[e.route.id];t&&t.hasLoader&&(!l.some(t=>t.route.id===e.route.id)&&e.route.id in c&&a[e.route.id]?.shouldRevalidate||t.hasClientLoader?s=!0:n.add(e.route.id))}),n.size===0)return[];let u=fr(e,`data`,o);return s&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[o?u.toString():u.pathname+u.search]},[c,r,i,l,t,e,a,o]),f=v.useMemo(()=>vr(u,i),[u,i]),p=kr(u);return v.createElement(v.Fragment,null,d.map(e=>v.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),f.map(e=>v.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),p.map(({key:e,link:t})=>v.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Mr(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var Nr=[`HydrateFallback`,`hydrateFallbackElement`],Pr=class{status=`pending`;promise;resolve;reject;constructor(){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 Fr({router:e,flushSync:t,onError:n,useTransitions:r}){r=Sn()||r;let[i,a]=v.useState(e.state),[o,s]=(0,v.useOptimistic)(i),c=v.useRef(o),[l,u]=v.useState(),[d,f]=v.useState({isTransitioning:!1}),[p,m]=v.useState(),[h,g]=v.useState(),[_,y]=v.useState(),b=v.useRef(new Map),x=v.useRef(new WeakSet),S=v.useCallback((i,{deletedFetchers:o,newErrors:l,flushSync:d,viewTransitionOpts:_})=>{c.current=i,l&&i.errors&&it.has(i.errors)&&(x.current.has(i.errors)?l=null:x.current.add(i.errors)),l&&n&&Object.values(l).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:G(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&b.current.set(t,e.data)}),o.forEach(e=>b.current.delete(e)),Cr(d===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` 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 S=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(Cr(_==null||S,"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."),!_||!S)t&&d?t(()=>a(i)):r===!1?a(i):v.startTransition(()=>{r===!0&&s(e=>Ir(e,i)),a(i)});else if(t&&d){t(()=>{h&&(p?.resolve(),h.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})})}),t(()=>g(n))}else h?(p?.resolve(),h.skipTransition(),y({state:i,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(u(i),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,p,r,s,n]);v.useLayoutEffect(()=>e.subscribe(S),[e,S]),v.useLayoutEffect(()=>{let t=e.state.errors,n=t?it.get(t):null;(c.current!==e.state||t&&n&&!x.current.has(t))&&S(e.state,{deletedFetchers:[],flushSync:!1,newErrors:n??null})},[e,S]),v.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new Pr)},[d]),v.useEffect(()=>{if(p&&l&&e.window){let t=l,n=p.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):v.startTransition(()=>{r===!0&&s(e=>Ir(e,t)),a(t)}),await n});i.finished.finally(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})}),g(i)}},[l,p,e.window,r,s]),v.useEffect(()=>{p&&l&&o.location.key===l.location.key&&p.resolve()},[p,h,o.location,l]),v.useEffect(()=>{!d.isTransitioning&&_&&(u(_.state),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),y(void 0))},[d.isTransitioning,_]);let C=v.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]),w=e.basename||`/`,T=v.useMemo(()=>({router:e,navigator:C,static:!1,basename:w,onError:n}),[e,C,w,n]),E=v.useMemo(()=>({historyAction:o.historyAction,location:o.location,matches:o.matches,initialized:o.initialized,renderFallback:o.renderFallback,restoreScrollPosition:o.restoreScrollPosition,preventScrollReset:o.preventScrollReset,blockers:o.blockers}),[o.historyAction,o.location,o.matches,o.initialized,o.renderFallback,o.restoreScrollPosition,o.preventScrollReset,o.blockers]),D=v.useMemo(()=>({navigation:o.navigation,revalidation:o.revalidation}),[o.navigation,o.revalidation]),O=v.useMemo(()=>({loaderData:o.loaderData,actionData:o.actionData,errors:o.errors}),[o.loaderData,o.actionData,o.errors]),ee=v.useMemo(()=>({fetchers:o.fetchers,fetcherData:b.current}),[o.fetchers]);return v.createElement(v.Fragment,null,v.createElement(_n.Provider,{value:T},v.createElement(vn.Provider,{value:E},v.createElement(bn.Provider,{value:D},v.createElement(yn.Provider,{value:O},v.createElement(wn.Provider,{value:ee},v.createElement(Cn.Provider,{value:d},v.createElement(Vr,{basename:w,location:o.location,navigationType:o.historyAction,navigator:C,useTransitions:r},v.createElement(Lr,{routes:e.routes,manifest:e.manifest,state:o,isStatic:!1,onError:n})))))))),null)}function Ir(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 Lr=v.memo(Rr);function Rr({routes:e,manifest:t,state:n,isStatic:r,onError:i}){let a=v.useContext(_n);l(a,`You must render this element inside a <DataRouterContext.Provider> element`);let o=v.useContext(wr)?.routeDiscoveryRuntime;return v.useEffect(()=>{n.initialized&&o?.markReady()},[n.initialized,o]),Kn(e,void 0,{router:a.router,manifest:t,state:n,isStatic:r,onError:i})}function zr({to:e,replace:t,state:n,relative:r}){l(Rn(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=v.useContext(En);u(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=v.useContext(On),{pathname:s}=zn(),c=Vn(),d=_e(e,ge(o),s,r===`path`);We(typeof e==`string`?e:m(e),a.createHref(d),He(a),`reject`);let f=JSON.stringify(d);return v.useEffect(()=>{c(JSON.parse(f),{replace:t,state:n,relative:r})},[c,f,r,t,n]),null}function Br(e){l(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Vr({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){l(!Rn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=v.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=h(n));let{pathname:d=`/`,search:f=``,hash:p=``,state:m=null,key:g=`default`,mask:_}=n,y=v.useMemo(()=>{let e=V(d,s);return e==null?null:{location:{pathname:e,search:f,hash:p,state:m,key:g,mask:_},navigationType:r}},[s,d,f,p,m,g,r,_]);return u(y!=null,`<Router basename="${s}"> is not able to match the URL "${d}${f}${p}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:v.createElement(En.Provider,{value:c},v.createElement(Dn.Provider,{children:t,value:y}))}function Hr({children:e,location:t}){return Gn(Ur(e),t)}v.Component;function Ur(e,t=[]){let n=[];return v.Children.forEach(e,(e,r)=>{if(!v.isValidElement(e))return;let i=[...t,r];if(e.type===v.Fragment){n.push.apply(n,Ur(e.props.children,i));return}l(e.type===Br,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`);let a=e.props;l(!a.index||!a.children,`An index route cannot have child routes.`);let o={id:a.id||i.join(`-`),caseSensitive:a.caseSensitive,element:a.element,Component:a.Component,index:a.index,path:a.path,middleware:a.middleware,loader:a.loader,action:a.action,hydrateFallbackElement:a.hydrateFallbackElement,HydrateFallback:a.HydrateFallback,errorElement:a.errorElement,ErrorBoundary:a.ErrorBoundary,shouldRevalidate:a.shouldRevalidate,handle:a.handle,lazy:a.lazy};a.children&&(o.children=Ur(a.children,i)),n.push(o)}),n}var Wr=`application/x-www-form-urlencoded`;function Gr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Kr(e){return Gr(e)&&e.tagName.toLowerCase()===`button`}function qr(e){return Gr(e)&&e.tagName.toLowerCase()===`form`}function Jr(e){return Gr(e)&&e.tagName.toLowerCase()===`input`}function Yr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Xr(e,t){return e.button===0&&(!t||t===`_self`)&&!Yr(e)}function Zr(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Qr(e,t){let n=Zr(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var $r=null;function ei(){if($r===null)try{new FormData(document.createElement(`form`),0),$r=!1}catch{$r=!0}return $r}var ti=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function ni(e){return e!=null&&!ti.has(e)?(u(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Wr}"`),null):e}function ri(e,t){let n,r,i,a,o;if(qr(e)){let o=e.getAttribute(`action`);r=o?V(o,t):null,n=e.getAttribute(`method`)||`get`,i=ni(e.getAttribute(`enctype`))||Wr,a=new FormData(e)}else if(Kr(e)||Jr(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?V(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=ni(e.getAttribute(`formenctype`))||ni(o.getAttribute(`enctype`))||Wr,a=new FormData(o,e),!ei()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Gr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=Wr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}var ii=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{ii&&(window.__reactRouterVersion=`8`)}catch{}function ai(e,t){return at({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:s({window:t?.window}),hydrationData:t?.hydrationData||si(),routes:e,mapRouteProperties:E,hydrationRouteProperties:Nr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function oi(e,t){return at({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:c({window:t?.window}),hydrationData:t?.hydrationData||si(),routes:e,mapRouteProperties:E,hydrationRouteProperties:Nr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function si(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:ci(e.errors)}),e}function ci(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new Ce(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&Se.includes(r.__subType)){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}var li=v.forwardRef(function({onClick:e,discover:t=`render`,prefetch:r=`none`,relative:i,reloadDocument:a,replace:o,mask:s,state:c,target:l,to:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h){let{basename:g,navigator:_,useTransitions:y}=v.useContext(En),b=typeof u==`string`&&n.test(u),x=De(u,g);u=x.to;let S=Ln(u,{relative:i}),C=zn(),w=null;if(s){let e=_e(s,[],C.mask?C.mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:U([g,e.pathname])),w=_.createHref(e)}let[T,E,D]=Er(r,m),O=fi(u,{replace:o,mask:s,state:c,target:l,preventScrollReset:d,relative:i,viewTransition:f,defaultShouldRevalidate:p,useTransitions:y});function ee(t){e&&e(t),t.defaultPrevented||O(t)}let k=!(x.isExternal||a),te=v.createElement(`a`,{...m,...D,href:(k?w:void 0)||x.absoluteURL||S,onClick:k?ee:e,ref:Mr(h,E),target:l,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?v.createElement(v.Fragment,null,te,v.createElement(Or,{page:S})):te});li.displayName=`Link`;var ui=v.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Wn(a,{relative:c.relative}),d=zn(),f=v.useContext(bn),{navigator:p,basename:m}=v.useContext(En),h=f!=null&&vi(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,y=f?.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&m&&(y=V(y,m)||y);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=_===g||!r&&_.startsWith(g)&&_.charAt(b)===`/`,S=y!=null&&(y===g||!r&&y.startsWith(g)&&y.charAt(b)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return v.createElement(li,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});ui.displayName=`NavLink`;var di=v.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:r,reloadDocument:i,replace:a,state:o,method:s=`get`,action:c,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h)=>{let{useTransitions:g}=v.useContext(En),_=gi(),y=_i(c,{relative:u}),b=s.toLowerCase()===`get`?`get`:`post`,x=typeof c==`string`&&n.test(c);return v.createElement(`form`,{ref:h,method:b,action:y,onSubmit:i?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let n=e.nativeEvent.submitter,i=n?.getAttribute(`formmethod`)||s,c=()=>_(n||e.currentTarget,{fetcherKey:t,method:i,navigate:r,replace:a,state:o,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p});g&&r!==!1?v.startTransition(()=>c()):c()},...m,"data-discover":!x&&e===`render`?`true`:void 0})});di.displayName=`Form`;function fi(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Vn(),d=zn(),f=Wn(e,{relative:o});return v.useCallback(p=>{if(Xr(p,t)){p.preventDefault();let t=n===void 0?m(d)===m(f):n,h=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?v.startTransition(()=>h()):h()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function pi(e){u(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=v.useRef(Zr(e)),n=v.useRef(!1),r=zn(),i=v.useMemo(()=>Qr(r.search,n.current?null:t.current),[r.search]),a=Vn();return[i,v.useCallback((e,t)=>{let r=Zr(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var mi=0,hi=()=>`__${String(++mi)}__`;function gi(){let{router:e}=tr(`useSubmit`),{basename:t}=v.useContext(En),n=ir(`useSubmit`),r=e.fetch,i=e.navigate;return v.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=ri(e,t);a.navigate===!1?await r(a.fetcherKey||hi(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function _i(e,{relative:t}={}){let{basename:n}=v.useContext(En),r=v.useContext(On);l(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Wn(e||`.`,{relative:t})},o=zn();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:U([n,a.pathname])),m(a)}function vi(e,{relative:t}={}){let n=v.useContext(Cn);l(n!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=tr(`useViewTransitionState`),i=Wn(e,{relative:t});if(!n.isTransitioning)return!1;let a=V(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=V(n.nextLocation.pathname,r)||n.nextLocation.pathname;return B(i.pathname,o)!=null||B(i.pathname,a)!=null}export{zr as a,Hr as c,Vn as d,Un as f,pi as i,sr as l,we as m,ai as n,Br as o,ar as p,oi as r,Fr as s,li as t,zn as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./logger-rEW7uQ8m.js";import{t}from"./config-
|
|
1
|
+
import{a as e}from"./logger-rEW7uQ8m.js";import{t}from"./config-CHUQTU6j.js";import{n,t as r}from"./client-D_F_0LqX.js";var i=()=>{let e=localStorage.getItem(`auth-token`);return e?{Authorization:`Bearer ${e}`}:{}},a=e=>`/strands/sessions/${encodeURIComponent(e)}`,o=e=>{let t=JSON.parse(e);if(!t||typeof t!=`object`||typeof t.type!=`string`)throw Error(`The Strands engine sent an invalid event.`);return t},s={getAccess:()=>e()?n({mode:`disabled`,lockedByEnv:!1}):r.get(`/strands/access`).then(e=>e.data),setAccess:t=>e()?n({mode:t,lockedByEnv:!1}):r.put(`/strands/access`,{mode:t}).then(e=>e.data),health:()=>r.get(`/strands/health`).then(e=>e.data),models:()=>e()?n([]):r.get(`/strands/models`).then(e=>e.data),listSessions:()=>e()?n([]):r.get(`/strands/sessions`).then(e=>e.data),createSession:e=>r.post(`/strands/sessions`,e).then(e=>e.data),getSession:e=>r.get(a(e)).then(e=>e.data),updateSession:(e,t)=>r.patch(a(e),t).then(e=>e.data),deleteSession:e=>r.delete(a(e)).then(e=>e.data),cancel:e=>r.post(`${a(e)}/cancel`).then(e=>e.data),sendMessage:async(e,n,r={})=>{let s=await fetch(`${t}${a(e)}/messages`,{method:`POST`,headers:{"Content-Type":`application/json`,...i()},body:JSON.stringify({text:n}),signal:r.signal});if(!s.ok){let e=await s.json().then(e=>e.error).catch(()=>void 0);throw Error(e??`HTTP error! status: ${s.status}`)}if(!s.body)throw Error(`No response body reader available`);let c=s.body.getReader(),l=new TextDecoder,u=[],d=``;try{for(;;){let{done:e,value:t}=await c.read();d+=l.decode(t,{stream:!e});let n=d.split(`
|
|
2
2
|
`);d=n.pop()??``,e&&d.trim()!==``&&n.push(d);for(let e of n){if(e.trim()===``)continue;let t=o(e);if(u.push(t),r.onEvent?.(t),t.type===`done`||t.type===`error`)return u}if(e)throw Error(`The Strands turn ended unexpectedly.`)}}finally{await c.cancel().catch(()=>void 0),c.releaseLock()}}};export{s as t};
|