@powerhousedao/ph-clint-app 0.1.0-dev.97 → 0.1.0-dev.98
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/dist/connect/assets/{ClearStorageModal-BlNfe-Or-DUX3Khqr.js → ClearStorageModal-BlNfe-Or-cRmQdz4_.js} +2 -2
- package/dist/connect/assets/{ClearStorageModal-BlNfe-Or-DUX3Khqr.js.map → ClearStorageModal-BlNfe-Or-cRmQdz4_.js.map} +1 -1
- package/dist/connect/assets/{DebugSettingsModal-riB4L92f-D87nXvay.js → DebugSettingsModal-riB4L92f-3PXUVk9n.js} +2 -2
- package/dist/connect/assets/{DebugSettingsModal-riB4L92f-D87nXvay.js.map → DebugSettingsModal-riB4L92f-3PXUVk9n.js.map} +1 -1
- package/dist/connect/assets/{InspectorModal-M3Km_wKa-BGQ8ah65.js → InspectorModal-M3Km_wKa-Bbi6h0IY.js} +2 -2
- package/dist/connect/assets/{InspectorModal-M3Km_wKa-BGQ8ah65.js.map → InspectorModal-M3Km_wKa-Bbi6h0IY.js.map} +1 -1
- package/dist/connect/assets/{SettingsModal-GHeTgO9h-XSdSFOjt.js → SettingsModal-GHeTgO9h-C3Fm49sz.js} +2 -2
- package/dist/connect/assets/{SettingsModal-GHeTgO9h-XSdSFOjt.js.map → SettingsModal-GHeTgO9h-C3Fm49sz.js.map} +1 -1
- package/dist/connect/assets/{components-CZ7Sq5Nz-mHKz_9LK.js → components-CZ7Sq5Nz-BXiGdiaB.js} +4 -4
- package/dist/connect/assets/{components-CZ7Sq5Nz-mHKz_9LK.js.map → components-CZ7Sq5Nz-BXiGdiaB.js.map} +1 -1
- package/dist/connect/assets/{connect.config-Bt4pvvWV-C9JX7SrE.js → connect.config-Bt4pvvWV-BGQwxlgI.js} +2 -2
- package/dist/connect/assets/{connect.config-Bt4pvvWV-C9JX7SrE.js.map → connect.config-Bt4pvvWV-BGQwxlgI.js.map} +1 -1
- package/dist/connect/assets/{index-uLMU3BbK.js → index-Bm1DrqwR.js} +3 -3
- package/dist/connect/assets/{index-uLMU3BbK.js.map → index-Bm1DrqwR.js.map} +1 -1
- package/dist/connect/assets/{load-DgTrakHO-CeBo0rmj.js → load-DgTrakHO-140Yl8Hq.js} +2 -2
- package/dist/connect/assets/{load-DgTrakHO-CeBo0rmj.js.map → load-DgTrakHO-140Yl8Hq.js.map} +1 -1
- package/dist/connect/assets/{module-BpuFTuoo.js → module-C0ZfaSzR.js} +2 -2
- package/dist/connect/assets/{module-BpuFTuoo.js.map → module-C0ZfaSzR.js.map} +1 -1
- package/dist/connect/assets/{pglite-seed-BWk7yOwr-Blnaz8Ov.js → pglite-seed-BWk7yOwr-D_BdNLSV.js} +2 -2
- package/dist/connect/assets/{pglite-seed-BWk7yOwr-Blnaz8Ov.js.map → pglite-seed-BWk7yOwr-D_BdNLSV.js.map} +1 -1
- package/dist/connect/assets/{reactor-CK8fF-NZ-CcvRt2kY.js → reactor-CK8fF-NZ-CMHH9WfW.js} +2 -2
- package/dist/connect/assets/{reactor-CK8fF-NZ-CcvRt2kY.js.map → reactor-CK8fF-NZ-CMHH9WfW.js.map} +1 -1
- package/dist/connect/assets/{registerServiceWorker-D9l1kja7-DvjQ1Shp.js → registerServiceWorker-D9l1kja7-CjV3G1S5.js} +2 -2
- package/dist/connect/assets/{registerServiceWorker-D9l1kja7-DvjQ1Shp.js.map → registerServiceWorker-D9l1kja7-CjV3G1S5.js.map} +1 -1
- package/dist/connect/index.html +1 -1
- package/dist/connect/powerhouse.config.json +1 -1
- package/package.json +1 -1
package/dist/connect/assets/{components-CZ7Sq5Nz-mHKz_9LK.js → components-CZ7Sq5Nz-BXiGdiaB.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-B47ain9H.js","assets/chunk-BNv3lrIs.js","assets/preload-helper-ca-nBW7U.js","assets/chunk-A7RFOIQ7-LfOdAcBB.js","assets/chunk-BTBUZ646-BwTZXBLs.js","assets/chunk-EADU5A67-BHbnANQy.js","assets/chunk-WGR4JCLS-CvmEYK_g.js","assets/pg_dump-BL-IQ0O5.js","assets/dist-xKhBcQ062.js","assets/esm-C1l-NYkd.js","assets/esm-BRpdu9J8.js","assets/AddDriveModal-BoKLJyUY-Cmg70V3l.js","assets/connect-BAAo0kCL.js","assets/dist-BgjHZed8.js","assets/hmac-wnxCe4SN.js","assets/worker-XYrQaEmt-w0FhumYk.js","assets/error-info-Cpu4OY3o-DJ8lg6ye.js","assets/types-CxSpmNGK-BaNo7EHQ.js","assets/esm-0nAQjFUV.js","assets/errors-D3S6Eysd-DUmQAeoG.js","assets/dist-Cb4AoJ-8.js","assets/clsx-CtFH8AOT.js","assets/toast-BEy42aYx-Dg_jZf6v.js","assets/i18next-kqPoxo7u.js","assets/ClearStorageModal-BlNfe-Or-
|
|
2
|
-
import{$ as e,A as t,At as n,Ct as r,G as i,H as a,I as o,It as s,Kt as c,L as l,Lt as u,R as d,Rt as f,St as p,Tt as m,X as h,Xt as g,Y as _,_ as v,bt as y,ct as b,dt as x,ht as S,j as C,jt as w,kt as T,lt as E,ot as D,q as ee,qt as O,sn as te,vt as ne,wt as re,y as ie,zt as k}from"./dist-BgjHZed8.js";import{C as ae,E as oe,F as se,L as A,M as j,R as M,S as N,T as ce,_ as P,c as F,d as le,h as ue,j as de,k as I,l as fe,x as pe,y as me,z as he}from"./connect-BAAo0kCL.js";import{n as ge}from"./runtime-config-DL3QjcfM-D9g4VFtY.js";import{t as L}from"./preload-helper-ca-nBW7U.js";import{$ as _e,R as ve,U as ye,it as be,rt as xe}from"./types-CxSpmNGK-BaNo7EHQ.js";import{r as R}from"./dist-Cb4AoJ-8.js";import{l as Se}from"./worker-XYrQaEmt-w0FhumYk.js";import{t as Ce}from"./dist-DC27BFRa.js";import{n as we}from"./clsx-CtFH8AOT.js";import{n as z,t as B}from"./toast-BEy42aYx-Dg_jZf6v.js";import{t as Te}from"./i18next-kqPoxo7u.js";import{a as Ee,i as De,r as V}from"./connect.config-Bt4pvvWV-C9JX7SrE.js";import{_ as Oe,h as ke,l as Ae,m as je,n as Me,o as Ne,r as Pe,t as Fe,u as Ie}from"./module-BpuFTuoo.js";import{t as Le}from"./Trans-DDyWfeQm.js";import{t as Re}from"./useTranslation-DQCCLfKw.js";import{t as ze}from"./registerServiceWorker-D9l1kja7-DvjQ1Shp.js";import{Fragment as Be,jsx as H,jsxs as U}from"react/jsx-runtime";import*as W from"react";import Ve,{Component as He,StrictMode as Ue,Suspense as We,createContext as Ge,createElement as Ke,lazy as G,useCallback as qe,useContext as Je,useEffect as K,useLayoutEffect as Ye,useMemo as Xe,useRef as Ze,useState as Qe,useSyncExternalStore as $e}from"react";import*as et from"react-dom";function q(){return q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},q.apply(null,arguments)}var J;(function(e){e.Pop=`POP`,e.Push=`PUSH`,e.Replace=`REPLACE`})(J||={});var tt=`popstate`;function nt(e){e===void 0&&(e={});function t(e,t){let{pathname:n,search:r,hash:i}=e.location;return ot(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){return typeof t==`string`?t:st(t)}return lt(t,n,null,e)}function Y(e,t){if(e===!1||e==null)throw Error(t)}function rt(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function it(){return Math.random().toString(36).substr(2,8)}function at(e,t){return{usr:e.state,key:e.key,idx:t}}function ot(e,t,n,r){return n===void 0&&(n=null),q({pathname:typeof e==`string`?e:e.pathname,search:``,hash:``},typeof t==`string`?ct(t):t,{state:n,key:t&&t.key||r||it()})}function st(e){let{pathname:t=`/`,search:n=``,hash:r=``}=e;return n&&n!==`?`&&(t+=n.charAt(0)===`?`?n:`?`+n),r&&r!==`#`&&(t+=r.charAt(0)===`#`?r:`#`+r),t}function ct(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function lt(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=J.Pop,c=null,l=u();l??(l=0,o.replaceState(q({},o.state,{idx:l}),``));function u(){return(o.state||{idx:null}).idx}function d(){s=J.Pop;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=J.Push;let r=ot(h.location,e,t);n&&n(r,e),l=u()+1;let d=at(r,l),f=h.createHref(r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=J.Replace;let r=ot(h.location,e,t);n&&n(r,e),l=u();let i=at(r,l),d=h.createHref(r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){let t=i.location.origin===`null`?i.location.href:i.location.origin,n=typeof e==`string`?e:st(e);return n=n.replace(/ $/,`%20`),Y(t,`No window.location.(origin|href) available to create URL for href: `+n),new URL(n,t)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(tt,d),c=e,()=>{i.removeEventListener(tt,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}var X;(function(e){e.data=`data`,e.deferred=`deferred`,e.redirect=`redirect`,e.error=`error`})(X||={});var ut=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function dt(e){return e.index===!0}function ft(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((e,i)=>{let a=[...n,String(i)],o=typeof e.id==`string`?e.id:a.join(`-`);if(Y(e.index!==!0||!e.children,`Cannot specify children on an index route`),Y(!r[o],`Found a route id collision on id "`+o+`". Route id's must be globally unique within Data Router usages`),dt(e)){let n=q({},e,t(e),{id:o});return r[o]=n,n}else{let n=q({},e,t(e),{id:o,children:void 0});return r[o]=n,e.children&&(n.children=ft(e.children,t,a,r)),n}})}function pt(e,t,n){return n===void 0&&(n=`/`),mt(e,t,n,!1)}function mt(e,t,n,r){let i=Mt((typeof t==`string`?ct(t):t).pathname||`/`,n);if(i==null)return null;let a=gt(e);vt(a);let o=null,s=jt(i);for(let e=0;o==null&&e<a.length;++e)o=Ot(a[e],s,r);return o}function ht(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function gt(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r=``);let i=(e,i,a)=>{let o={relativePath:a===void 0?e.path||``:a,caseSensitive:e.caseSensitive===!0,childrenIndex:i,route:e};o.relativePath.startsWith(`/`)&&(Y(o.relativePath.startsWith(r),`Absolute route path "`+o.relativePath+`" nested under path `+(`"`+r+`" is not valid. An absolute child route path `)+`must start with the combined path of all its parent routes.`),o.relativePath=o.relativePath.slice(r.length));let s=Ht([r,o.relativePath]),c=n.concat(o);e.children&&e.children.length>0&&(Y(e.index!==!0,`Index routes must not have child routes. Please remove `+(`all child routes from route path "`+s+`".`)),gt(e.children,t,c,s)),!(e.path==null&&!e.index)&&t.push({path:s,score:Et(s,e.index),routesMeta:c})};return e.forEach((e,t)=>{var n;if(e.path===``||!((n=e.path)!=null&&n.includes(`?`)))i(e,t);else for(let n of _t(e.path))i(e,t,n)}),t}function _t(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=_t(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 vt(e){e.sort((e,t)=>e.score===t.score?Dt(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var yt=/^:[\w-]+$/,bt=3,xt=2,St=1,Ct=10,wt=-2,Tt=e=>e===`*`;function Et(e,t){let n=e.split(`/`),r=n.length;return n.some(Tt)&&(r+=wt),t&&(r+=xt),n.filter(e=>!Tt(e)).reduce((e,t)=>e+(yt.test(t)?bt:t===``?St:Ct),r)}function Dt(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 Ot(e,t,n){n===void 0&&(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=kt({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=kt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:Ht([a,u.pathname]),pathnameBase:Ut(Ht([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=Ht([a,u.pathnameBase]))}return o}function kt(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=At(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,t,n)=>{let{paramName:r,isOptional:i}=t;if(r===`*`){let e=s[n]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let c=s[n];return i&&!c?e[r]=void 0:e[r]=(c||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function At(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),rt(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)=>(r.push({paramName:t,isOptional:n!=null}),n?`/?([^\\/]+)?`:`/([^\\/]+)`));return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function jt(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return rt(!1,`The URL path "`+e+`" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent `+(`encoding (`+t+`).`)),e}}function Mt(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)||`/`}var Nt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pt=e=>Nt.test(e);function Ft(e,t){t===void 0&&(t=`/`);let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?ct(e):e,a;if(n)if(Pt(n))a=n;else{if(n.includes(`//`)){let e=n;n=Vt(n),rt(!1,`Pathnames cannot have embedded double slashes - normalizing `+(e+` -> `+n))}a=n.startsWith(`/`)?It(n.substring(1),`/`):It(n,t)}else a=t;return{pathname:a,search:Wt(r),hash:Gt(i)}}function It(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Lt(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 Rt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function zt(e,t){let n=Rt(e);return t?n.map((e,t)=>t===n.length-1?e.pathname:e.pathnameBase):n.map(e=>e.pathnameBase)}function Bt(e,t,n,r){r===void 0&&(r=!1);let i;typeof e==`string`?i=ct(e):(i=q({},e),Y(!i.pathname||!i.pathname.includes(`?`),Lt(`?`,`pathname`,`search`,i)),Y(!i.pathname||!i.pathname.includes(`#`),Lt(`#`,`pathname`,`hash`,i)),Y(!i.search||!i.search.includes(`#`),Lt(`#`,`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=Ft(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Vt=e=>e.replace(/\/\/+/g,`/`),Ht=e=>Vt(e.join(`/`)),Ut=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),Wt=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Gt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Kt=class{constructor(e,t,n,r){r===void 0&&(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 qt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}var Jt=[`post`,`put`,`patch`,`delete`],Yt=new Set(Jt),Xt=[`get`,...Jt],Zt=new Set(Xt),Qt=new Set([301,302,303,307,308]),$t=new Set([307,308]),en={state:`idle`,location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},tn={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},nn={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},rn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,an=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),on=`remix-router-transitions`;function sn(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,r=!n;Y(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;i=e=>({hasErrorBoundary:t(e)})}else i=an;let a={},o=ft(e.routes,i,void 0,a),s,c=e.basename||`/`,l=e.dataStrategy||bn,u=e.patchRoutesOnNavigation,d=q({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),f=null,p=new Set,m=null,h=null,g=null,_=e.hydrationData!=null,v=pt(o,e.history.location,c),y=!1,b=null;if(v==null&&!u){let t=Z(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Pn(o);v=n,b={[r.id]:t}}v&&!e.hydrationData&&H(v,o,e.history.location.pathname).active&&(v=null);let x;if(!v){if(x=!1,v=[],d.v7_partialHydration){let t=H(null,o,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}}else if(v.some(e=>e.route.lazy))x=!1;else if(!v.some(e=>e.route.loader))x=!0;else if(d.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);x=v.slice(0,e+1).every(e=>!pn(e.route,t,n))}else x=v.every(e=>!pn(e.route,t,n))}else x=e.hydrationData!=null;let S,C={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,navigation:en,restoreScrollPosition:e.hydrationData==null?null:!1,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},w=J.Pop,T=!1,E,D=!1,ee=new Map,O=null,te=!1,ne=!1,re=[],ie=new Set,k=new Map,ae=0,oe=-1,se=new Map,A=new Set,j=new Map,M=new Map,N=new Set,ce=new Map,P=new Map,F;function le(){if(f=e.history.listen(t=>{let{action:n,location:r,delta:i}=t;if(F){F(),F=void 0;return}rt(P.size===0||i!=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 a=Pe({currentLocation:C.location,nextLocation:r,historyAction:n});if(a&&i!=null){let t=new Promise(e=>{F=e});e.history.go(i*-1),Ne(a,{state:`blocked`,location:r,proceed(){Ne(a,{state:`proceeding`,proceed:void 0,reset:void 0,location:r}),t.then(()=>e.history.go(i))},reset(){let e=new Map(C.blockers);e.set(a,nn),I({blockers:e})}});return}return he(n,r)}),n){nr(t,ee);let e=()=>rr(t,ee);t.addEventListener(`pagehide`,e),O=()=>t.removeEventListener(`pagehide`,e)}return C.initialized||he(J.Pop,C.location,{initialHydration:!0}),S}function ue(){f&&f(),O&&O(),p.clear(),E&&E.abort(),C.fetchers.forEach((e,t)=>Ee(t)),C.blockers.forEach((e,t)=>Me(t))}function de(e){return p.add(e),()=>p.delete(e)}function I(e,t){t===void 0&&(t={}),C=q({},C,e);let n=[],r=[];d.v7_fetcherPersist&&C.fetchers.forEach((e,t)=>{e.state===`idle`&&(N.has(t)?r.push(t):n.push(t))}),N.forEach(e=>{!C.fetchers.has(e)&&!k.has(e)&&r.push(e)}),[...p].forEach(e=>e(C,{deletedFetchers:r,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),d.v7_fetcherPersist?(n.forEach(e=>C.fetchers.delete(e)),r.forEach(e=>Ee(e))):r.forEach(e=>N.delete(e))}function fe(t,n,r){let{flushSync:i}=r===void 0?{}:r,a=C.actionData!=null&&C.navigation.formMethod!=null&&$(C.navigation.formMethod)&&C.navigation.state===`loading`&&t.state?._isRedirect!==!0,c;c=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:a?C.actionData:null;let l=n.loaderData?jn(C.loaderData,n.loaderData,n.matches||[],n.errors):C.loaderData,u=C.blockers;u.size>0&&(u=new Map(u),u.forEach((e,t)=>u.set(t,nn)));let d=T===!0||C.navigation.formMethod!=null&&$(C.navigation.formMethod)&&t.state?._isRedirect!==!0;s&&=(o=s,void 0),te||w===J.Pop||(w===J.Push?e.history.push(t,t.state):w===J.Replace&&e.history.replace(t,t.state));let f;if(w===J.Pop){let e=ee.get(C.location.pathname);e&&e.has(t.pathname)?f={currentLocation:C.location,nextLocation:t}:ee.has(t.pathname)&&(f={currentLocation:t,nextLocation:C.location})}else if(D){let e=ee.get(C.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),ee.set(C.location.pathname,e)),f={currentLocation:C.location,nextLocation:t}}I(q({},n,{actionData:c,loaderData:l,historyAction:w,location:t,initialized:!0,navigation:en,revalidation:`idle`,restoreScrollPosition:Be(t,n.matches||C.matches),preventScrollReset:d,blockers:u}),{viewTransitionOpts:f,flushSync:i===!0}),w=J.Pop,T=!1,D=!1,te=!1,ne=!1,re=[]}async function pe(t,n){if(typeof t==`number`){e.history.go(t);return}let r=ln(C.location,C.matches,c,d.v7_prependBasename,t,d.v7_relativeSplatPath,n?.fromRouteId,n?.relative),{path:i,submission:a,error:o}=un(d.v7_normalizeFormMethod,!1,r,n),s=C.location,l=ot(C.location,i,n&&n.state);l=q({},l,e.history.encodeLocation(l));let u=n&&n.replace!=null?n.replace:void 0,f=J.Push;u===!0?f=J.Replace:u===!1||a!=null&&$(a.formMethod)&&a.formAction===C.location.pathname+C.location.search&&(f=J.Replace);let p=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,m=(n&&n.flushSync)===!0,h=Pe({currentLocation:s,nextLocation:l,historyAction:f});if(h){Ne(h,{state:`blocked`,location:l,proceed(){Ne(h,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),pe(t,n)},reset(){let e=new Map(C.blockers);e.set(h,nn),I({blockers:e})}});return}return await he(f,l,{submission:a,pendingError:o,preventScrollReset:p,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:m})}function me(){if(we(),I({revalidation:`loading`}),C.navigation.state!==`submitting`){if(C.navigation.state===`idle`){he(C.historyAction,C.location,{startUninterruptedRevalidation:!0});return}he(w||C.historyAction,C.navigation.location,{overrideNavigation:C.navigation,enableViewTransition:D===!0})}}async function he(t,n,r){E&&E.abort(),E=null,w=t,te=(r&&r.startUninterruptedRevalidation)===!0,ze(C.location,C.matches),T=(r&&r.preventScrollReset)===!0,D=(r&&r.enableViewTransition)===!0;let i=s||o,a=r&&r.overrideNavigation,l=r!=null&&r.initialHydration&&C.matches&&C.matches.length>0&&!y?C.matches:pt(i,n,c),u=(r&&r.flushSync)===!0;if(l&&C.initialized&&!ne&&Ln(C.location,n)&&!(r&&r.submission&&$(r.submission.formMethod))){fe(n,{matches:l},{flushSync:u});return}let d=H(l,i,n.pathname);if(d.active&&d.matches&&(l=d.matches),!l){let{error:e,notFoundMatches:t,route:r}=Fe(n.pathname);fe(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:u});return}E=new AbortController;let f=En(e.history,n,E.signal,r&&r.submission),p;if(r&&r.pendingError)p=[Nn(l).route.id,{type:X.error,error:r.pendingError}];else if(r&&r.submission&&$(r.submission.formMethod)){let t=await ge(f,n,r.submission,l,d.active,{replace:r.replace,flushSync:u});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(Q(r)&&qt(r.error)&&r.error.status===404){E=null,fe(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}});return}}l=t.matches||l,p=t.pendingActionResult,a=Zn(n,r.submission),u=!1,d.active=!1,f=En(e.history,f.url,f.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_}=await L(f,n,l,d.active,a,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,u,p);m||(E=null,fe(n,q({matches:h||l},Mn(p),{loaderData:g,errors:_})))}async function ge(t,n,r,i,a,o){if(o===void 0&&(o={}),we(),I({navigation:Qn(n,r)},{flushSync:o.flushSync===!0}),a){let e=await U(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){let t=Nn(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:X.error,error:e.error}]}}else if(e.matches)i=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Fe(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:X.error,error:t}]}}}let s,l=Yn(i,n);if(!l.route.action&&!l.route.lazy)s={type:X.error,error:Z(405,{method:t.method,pathname:n.pathname,routeId:l.route.id})};else if(s=(await Se(`action`,C,t,[l],i,null))[l.route.id],t.signal.aborted)return{shortCircuited:!0};if(Bn(s)){let n;return n=o&&o.replace!=null?o.replace:Tn(s.response.headers.get(`Location`),new URL(t.url),c,e.history)===C.location.pathname+C.location.search,await R(t,s,!0,{submission:r,replace:n}),{shortCircuited:!0}}if(zn(s))throw Z(400,{type:`defer-action`});if(Q(s)){let e=Nn(i,l.route.id);return(o&&o.replace)!==!0&&(w=J.Push),{matches:i,pendingActionResult:[e.route.id,s]}}return{matches:i,pendingActionResult:[l.route.id,s]}}async function L(t,n,r,i,a,l,u,f,p,m,h){let g=a||Zn(n,l),_=l||u||Xn(g),v=!te&&(!d.v7_partialHydration||!p);if(i){if(v){let e=_e(h);I(q({navigation:g},e===void 0?{}:{actionData:e}),{flushSync:m})}let e=await U(r,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){let t=Nn(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}else if(e.matches)r=e.matches;else{let{error:e,notFoundMatches:t,route:r}=Fe(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let y=s||o,[b,x]=fn(e.history,C,r,_,n,d.v7_partialHydration&&p===!0,d.v7_skipActionErrorRevalidation,ne,re,ie,N,j,A,y,c,h);if(Ie(e=>!(r&&r.some(t=>t.route.id===e))||b&&b.some(t=>t.route.id===e)),oe=++ae,b.length===0&&x.length===0){let e=ke();return fe(n,q({matches:r,loaderData:{},errors:h&&Q(h[1])?{[h[0]]:h[1].error}:null},Mn(h),e?{fetchers:new Map(C.fetchers)}:{}),{flushSync:m}),{shortCircuited:!0}}if(v){let e={};if(!i){e.navigation=g;let t=_e(h);t!==void 0&&(e.actionData=t)}x.length>0&&(e.fetchers=ve(x)),I(e,{flushSync:m})}x.forEach(e=>{V(e.key),e.controller&&k.set(e.key,e.controller)});let S=()=>x.forEach(e=>V(e.key));E&&E.signal.addEventListener(`abort`,S);let{loaderResults:w,fetcherResults:T}=await Ce(C,r,b,x,t);if(t.signal.aborted)return{shortCircuited:!0};E&&E.signal.removeEventListener(`abort`,S),x.forEach(e=>k.delete(e.key));let D=Fn(w);if(D)return await R(t,D.result,!0,{replace:f}),{shortCircuited:!0};if(D=Fn(T),D)return A.add(D.key),await R(t,D.result,!0,{replace:f}),{shortCircuited:!0};let{loaderData:ee,errors:O}=An(C,r,w,h,x,T,ce);ce.forEach((e,t)=>{e.subscribe(n=>{(n||e.done)&&ce.delete(t)})}),d.v7_partialHydration&&p&&C.errors&&(O=q({},C.errors,O));let se=ke(),M=Ae(oe),P=se||M||x.length>0;return q({matches:r,loaderData:ee,errors:O},P?{fetchers:new Map(C.fetchers)}:{})}function _e(e){if(e&&!Q(e[1]))return{[e[0]]:e[1].data};if(C.actionData)return Object.keys(C.actionData).length===0?null:C.actionData}function ve(e){return e.forEach(e=>{let t=C.fetchers.get(e.key),n=$n(void 0,t?t.data:void 0);C.fetchers.set(e.key,n)}),new Map(C.fetchers)}function ye(e,t,n,i){if(r)throw Error(`router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.`);V(e);let a=(i&&i.flushSync)===!0,l=s||o,u=ln(C.location,C.matches,c,d.v7_prependBasename,n,d.v7_relativeSplatPath,t,i?.relative),f=pt(l,u,c),p=H(f,l,u);if(p.active&&p.matches&&(f=p.matches),!f){B(e,t,Z(404,{pathname:u}),{flushSync:a});return}let{path:m,submission:h,error:g}=un(d.v7_normalizeFormMethod,!0,u,i);if(g){B(e,t,g,{flushSync:a});return}let _=Yn(f,m),v=(i&&i.preventScrollReset)===!0;if(h&&$(h.formMethod)){be(e,t,m,_,f,p.active,a,v,h);return}j.set(e,{routeId:t,path:m}),xe(e,t,m,_,f,p.active,a,v,h)}async function be(t,n,r,i,a,l,u,f,p){we(),j.delete(t);function m(e){return!e.route.action&&!e.route.lazy?(B(t,n,Z(405,{method:p.formMethod,pathname:r,routeId:n}),{flushSync:u}),!0):!1}if(!l&&m(i))return;z(t,er(p,C.fetchers.get(t)),{flushSync:u});let h=new AbortController,g=En(e.history,r,h.signal,p);if(l){let e=await U(a,new URL(g.url).pathname,g.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){B(t,n,e.error,{flushSync:u});return}else if(!e.matches){B(t,n,Z(404,{pathname:r}),{flushSync:u});return}else if(a=e.matches,i=Yn(a,r),m(i))return}k.set(t,h);let _=ae,v=(await Se(`action`,C,g,[i],a,t))[i.route.id];if(g.signal.aborted){k.get(t)===h&&k.delete(t);return}if(d.v7_fetcherPersist&&N.has(t)){if(Bn(v)||Q(v)){z(t,tr(void 0));return}}else{if(Bn(v))if(k.delete(t),oe>_){z(t,tr(void 0));return}else return A.add(t),z(t,$n(p)),R(g,v,!1,{fetcherSubmission:p,preventScrollReset:f});if(Q(v)){B(t,n,v.error);return}}if(zn(v))throw Z(400,{type:`defer-action`});let y=C.navigation.location||C.location,b=En(e.history,y,h.signal),x=s||o,S=C.navigation.state===`idle`?C.matches:pt(x,C.navigation.location,c);Y(S,`Didn't find any matches after fetcher action`);let T=++ae;se.set(t,T);let D=$n(p,v.data);C.fetchers.set(t,D);let[ee,O]=fn(e.history,C,S,p,y,!1,d.v7_skipActionErrorRevalidation,ne,re,ie,N,j,A,x,c,[i.route.id,v]);O.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=C.fetchers.get(t),r=$n(void 0,n?n.data:void 0);C.fetchers.set(t,r),V(t),e.controller&&k.set(t,e.controller)}),I({fetchers:new Map(C.fetchers)});let te=()=>O.forEach(e=>V(e.key));h.signal.addEventListener(`abort`,te);let{loaderResults:M,fetcherResults:P}=await Ce(C,S,ee,O,b);if(h.signal.aborted)return;h.signal.removeEventListener(`abort`,te),se.delete(t),k.delete(t),O.forEach(e=>k.delete(e.key));let F=Fn(M);if(F)return R(b,F.result,!1,{preventScrollReset:f});if(F=Fn(P),F)return A.add(F.key),R(b,F.result,!1,{preventScrollReset:f});let{loaderData:le,errors:ue}=An(C,S,M,void 0,O,P,ce);if(C.fetchers.has(t)){let e=tr(v.data);C.fetchers.set(t,e)}Ae(T),C.navigation.state===`loading`&&T>oe?(Y(w,`Expected pending action`),E&&E.abort(),fe(C.navigation.location,{matches:S,loaderData:le,errors:ue,fetchers:new Map(C.fetchers)})):(I({errors:ue,loaderData:jn(C.loaderData,le,S,ue),fetchers:new Map(C.fetchers)}),ne=!1)}async function xe(t,n,r,i,a,o,s,c,l){let u=C.fetchers.get(t);z(t,$n(l,u?u.data:void 0),{flushSync:s});let d=new AbortController,f=En(e.history,r,d.signal);if(o){let e=await U(a,new URL(f.url).pathname,f.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){B(t,n,e.error,{flushSync:s});return}else if(e.matches)a=e.matches,i=Yn(a,r);else{B(t,n,Z(404,{pathname:r}),{flushSync:s});return}}k.set(t,d);let p=ae,m=(await Se(`loader`,C,f,[i],a,t))[i.route.id];if(zn(m)&&(m=await qn(m,f.signal,!0)||m),k.get(t)===d&&k.delete(t),!f.signal.aborted){if(N.has(t)){z(t,tr(void 0));return}if(Bn(m))if(oe>p){z(t,tr(void 0));return}else{A.add(t),await R(f,m,!1,{preventScrollReset:c});return}if(Q(m)){B(t,n,m.error);return}Y(!zn(m),`Unhandled fetcher deferred data`),z(t,tr(m.data))}}async function R(r,i,a,o){let{submission:s,fetcherSubmission:l,preventScrollReset:u,replace:d}=o===void 0?{}:o;i.response.headers.has(`X-Remix-Revalidate`)&&(ne=!0);let f=i.response.headers.get(`Location`);Y(f,`Expected a Location header on the redirect Response`),f=Tn(f,new URL(r.url),c,e.history);let p=ot(C.location,f,{_isRedirect:!0});if(n){let n=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))n=!0;else if(rn.test(f)){let r=e.history.createURL(f);n=r.origin!==t.location.origin||Mt(r.pathname,c)==null}if(n){d?t.location.replace(f):t.location.assign(f);return}}E=null;let m=d===!0||i.response.headers.has(`X-Remix-Replace`)?J.Replace:J.Push,{formMethod:h,formAction:g,formEncType:_}=C.navigation;!s&&!l&&h&&g&&_&&(s=Xn(C.navigation));let v=s||l;$t.has(i.response.status)&&v&&$(v.formMethod)?await he(m,p,{submission:q({},v,{formAction:f}),preventScrollReset:u||T,enableViewTransition:a?D:void 0}):await he(m,p,{overrideNavigation:Zn(p,s),fetcherSubmission:l,preventScrollReset:u||T,enableViewTransition:a?D:void 0})}async function Se(e,t,n,r,o,s){let u,f={};try{u=await xn(l,e,t,n,r,o,s,a,i)}catch(e){return r.forEach(t=>{f[t.route.id]={type:X.error,error:e}}),f}for(let[e,t]of Object.entries(u))if(Rn(t)){let r=t.result;f[e]={type:X.redirect,response:wn(r,n,e,o,c,d.v7_relativeSplatPath)}}else f[e]=await Cn(t);return f}async function Ce(t,n,r,i,a){let o=t.matches,s=Se(`loader`,t,a,r,n,null),c=Promise.all(i.map(async n=>{if(n.matches&&n.match&&n.controller){let r=(await Se(`loader`,t,En(e.history,n.path,n.controller.signal),[n.match],n.matches,n.key))[n.match.route.id];return{[n.key]:r}}else return Promise.resolve({[n.key]:{type:X.error,error:Z(404,{pathname:n.path})}})})),l=await s,u=(await c).reduce((e,t)=>Object.assign(e,t),{});return await Promise.all([Gn(n,l,a.signal,o,t.loaderData),Kn(n,u,i)]),{loaderResults:l,fetcherResults:u}}function we(){ne=!0,re.push(...Ie()),j.forEach((e,t)=>{k.has(t)&&ie.add(t),V(t)})}function z(e,t,n){n===void 0&&(n={}),C.fetchers.set(e,t),I({fetchers:new Map(C.fetchers)},{flushSync:(n&&n.flushSync)===!0})}function B(e,t,n,r){r===void 0&&(r={});let i=Nn(C.matches,t);Ee(e),I({errors:{[i.route.id]:n},fetchers:new Map(C.fetchers)},{flushSync:(r&&r.flushSync)===!0})}function Te(e){return M.set(e,(M.get(e)||0)+1),N.has(e)&&N.delete(e),C.fetchers.get(e)||tn}function Ee(e){let t=C.fetchers.get(e);k.has(e)&&!(t&&t.state===`loading`&&se.has(e))&&V(e),j.delete(e),se.delete(e),A.delete(e),d.v7_fetcherPersist&&N.delete(e),ie.delete(e),C.fetchers.delete(e)}function De(e){let t=(M.get(e)||0)-1;t<=0?(M.delete(e),N.add(e),d.v7_fetcherPersist||Ee(e)):M.set(e,t),I({fetchers:new Map(C.fetchers)})}function V(e){let t=k.get(e);t&&(t.abort(),k.delete(e))}function Oe(e){for(let t of e){let e=tr(Te(t).data);C.fetchers.set(t,e)}}function ke(){let e=[],t=!1;for(let n of A){let r=C.fetchers.get(n);Y(r,`Expected fetcher: `+n),r.state===`loading`&&(A.delete(n),e.push(n),t=!0)}return Oe(e),t}function Ae(e){let t=[];for(let[n,r]of se)if(r<e){let e=C.fetchers.get(n);Y(e,`Expected fetcher: `+n),e.state===`loading`&&(V(n),se.delete(n),t.push(n))}return Oe(t),t.length>0}function je(e,t){let n=C.blockers.get(e)||nn;return P.get(e)!==t&&P.set(e,t),n}function Me(e){C.blockers.delete(e),P.delete(e)}function Ne(e,t){let n=C.blockers.get(e)||nn;Y(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(C.blockers);r.set(e,t),I({blockers:r})}function Pe(e){let{currentLocation:t,nextLocation:n,historyAction:r}=e;if(P.size===0)return;P.size>1&&rt(!1,`A router only supports one blocker at a time`);let i=Array.from(P.entries()),[a,o]=i[i.length-1],s=C.blockers.get(a);if(!(s&&s.state===`proceeding`)&&o({currentLocation:t,nextLocation:n,historyAction:r}))return a}function Fe(e){let t=Z(404,{pathname:e}),{matches:n,route:r}=Pn(s||o);return Ie(),{notFoundMatches:n,route:r,error:t}}function Ie(e){let t=[];return ce.forEach((n,r)=>{(!e||e(r))&&(n.cancel(),t.push(r),ce.delete(r))}),t}function Le(e,t,n){if(m=e,g=t,h=n||null,!_&&C.navigation===en){_=!0;let e=Be(C.location,C.matches);e!=null&&I({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function Re(e,t){return h&&h(e,t.map(e=>ht(e,C.loaderData)))||e.key}function ze(e,t){if(m&&g){let n=Re(e,t);m[n]=g()}}function Be(e,t){if(m){let n=Re(e,t),r=m[n];if(typeof r==`number`)return r}return null}function H(e,t,n){if(u){if(!e)return{active:!0,matches:mt(t,n,c,!0)||[]};if(Object.keys(e[0].params).length>0)return{active:!0,matches:mt(t,n,c,!0)}}return{active:!1,matches:null}}async function U(e,t,n,r){if(!u)return{type:`success`,matches:e};let l=e;for(;;){let e=s==null,d=s||o,f=a;try{await u({signal:n,path:t,matches:l,fetcherKey:r,patch:(e,t)=>{n.aborted||_n(e,t,d,f,i)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}finally{e&&!n.aborted&&(o=[...o])}if(n.aborted)return{type:`aborted`};let p=pt(d,t,c);if(p)return{type:`success`,matches:p};let m=mt(d,t,c,!0);if(!m||l.length===m.length&&l.every((e,t)=>e.route.id===m[t].route.id))return{type:`success`,matches:null};l=m}}function W(e){a={},s=ft(e,i,void 0,a)}function Ve(e,t){let n=s==null;_n(e,t,s||o,a,i),n&&(o=[...o],I({}))}return S={get basename(){return c},get future(){return d},get state(){return C},get routes(){return o},get window(){return t},initialize:le,subscribe:de,enableScrollRestoration:Le,navigate:pe,fetch:ye,revalidate:me,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Te,deleteFetcher:De,dispose:ue,getBlocker:je,deleteBlocker:Me,patchRoutes:Ve,_internalFetchControllers:k,_internalActiveDeferreds:ce,_internalSetRoutes:W},S}function cn(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function ln(e,t,n,r,i,a,o,s){let c,l;if(o){c=[];for(let e of t)if(c.push(e),e.route.id===o){l=e;break}}else c=t,l=t[t.length-1];let u=Bt(i||`.`,zt(c,a),Mt(e.pathname,n)||e.pathname,s===`path`);if(i??(u.search=e.search,u.hash=e.hash),(i==null||i===``||i===`.`)&&l){let e=Jn(u.search);if(l.route.index&&!e)u.search=u.search?u.search.replace(/^\?/,`?index&`):`?index`;else if(!l.route.index&&e){let e=new URLSearchParams(u.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();u.search=n?`?`+n:``}}return r&&n!==`/`&&(u.pathname=u.pathname===`/`?n:Ht([n,u.pathname])),st(u)}function un(e,t,n,r){if(!r||!cn(r))return{path:n};if(r.formMethod&&!Wn(r.formMethod))return{path:n,error:Z(405,{method:r.formMethod})};let i=()=>({path:n,error:Z(400,{type:`invalid-body`})}),a=r.formMethod||`get`,o=e?a.toUpperCase():a.toLowerCase(),s=In(n);if(r.body!==void 0){if(r.formEncType===`text/plain`){if(!$(o))return i();let e=typeof r.body==`string`?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((e,t)=>{let[n,r]=t;return``+e+n+`=`+r+`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-B47ain9H.js","assets/chunk-BNv3lrIs.js","assets/preload-helper-ca-nBW7U.js","assets/chunk-A7RFOIQ7-LfOdAcBB.js","assets/chunk-BTBUZ646-BwTZXBLs.js","assets/chunk-EADU5A67-BHbnANQy.js","assets/chunk-WGR4JCLS-CvmEYK_g.js","assets/pg_dump-BL-IQ0O5.js","assets/dist-xKhBcQ062.js","assets/esm-C1l-NYkd.js","assets/esm-BRpdu9J8.js","assets/AddDriveModal-BoKLJyUY-Cmg70V3l.js","assets/connect-BAAo0kCL.js","assets/dist-BgjHZed8.js","assets/hmac-wnxCe4SN.js","assets/worker-XYrQaEmt-w0FhumYk.js","assets/error-info-Cpu4OY3o-DJ8lg6ye.js","assets/types-CxSpmNGK-BaNo7EHQ.js","assets/esm-0nAQjFUV.js","assets/errors-D3S6Eysd-DUmQAeoG.js","assets/dist-Cb4AoJ-8.js","assets/clsx-CtFH8AOT.js","assets/toast-BEy42aYx-Dg_jZf6v.js","assets/i18next-kqPoxo7u.js","assets/ClearStorageModal-BlNfe-Or-cRmQdz4_.js","assets/reactor-CK8fF-NZ-CMHH9WfW.js","assets/connect.config-Bt4pvvWV-BGQwxlgI.js","assets/runtime-config-DL3QjcfM-D9g4VFtY.js","assets/module-C0ZfaSzR.js","assets/dist-DXM8ccKa-DV1gto78.js","assets/parser-CkF6Qt8V-CqvnWRuI.js","assets/chunk-pbuEa-1d-KEQyMDN_.js","assets/module-1hr_ne9w-CWAVsMzZ.js","assets/module-CRq_lUkG-D61oeRlC.js","assets/module-DP3bVbak-VbUPIBZP.js","assets/utils-BiV3cs9Y-B7i9WJ1b.js","assets/utils-CkWB3DRk-DGZeD5qw.js","assets/dist-DMXkjzve.js","assets/useTranslation-DQCCLfKw.js","assets/CookiesPolicyModal-1nOh6oN3-BQzsmGcn.js","assets/Trans-DDyWfeQm.js","assets/CreateDocumentModal-nQbLVDq3-D4-Jna78.js","assets/DebugSettingsModal-riB4L92f-3PXUVk9n.js","assets/build-info-W8Bo1g21-CSxABXgB.js","assets/registerServiceWorker-D9l1kja7-CjV3G1S5.js","assets/DeleteDriveModal-6P0T1QgD-WKQT96LL.js","assets/DeleteItemModal-BmV1aQyZ-CEUrEMsE.js","assets/DisclaimerModal-CVTFfN0_-DS2bpS0M.js","assets/DriveSettingsModal-CsNFEJ9E-k3N2ZkhY.js","assets/DownloadDocumentWithErrorsModal-CXeFUtaz-BigyXlwN.js","assets/SettingsModal-GHeTgO9h-C3Fm49sz.js","assets/package-ZGUeneK4-hTh111mI.js","assets/useRegistryPackages-B-gFECmd-BVbSAyJB.js","assets/UpgradeDriveModal-C7lV4rAX-BOojyWpU.js","assets/InspectorModal-M3Km_wKa-Bbi6h0IY.js","assets/pglite-seed-BWk7yOwr-D_BdNLSV.js","assets/MissingPackageModal-Bn036mWQ-RFcA7w_j.js","assets/DriveAuthRequiredModal-B3VdLwSH-DkXM9nTW.js","assets/load-DgTrakHO-140Yl8Hq.js","assets/reload-connect-toast-CwvSc6F--BQcqGaN_.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{$ as e,A as t,At as n,Ct as r,G as i,H as a,I as o,It as s,Kt as c,L as l,Lt as u,R as d,Rt as f,St as p,Tt as m,X as h,Xt as g,Y as _,_ as v,bt as y,ct as b,dt as x,ht as S,j as C,jt as w,kt as T,lt as E,ot as D,q as ee,qt as O,sn as te,vt as ne,wt as re,y as ie,zt as k}from"./dist-BgjHZed8.js";import{C as ae,E as oe,F as se,L as A,M as j,R as M,S as N,T as ce,_ as P,c as F,d as le,h as ue,j as de,k as I,l as fe,x as pe,y as me,z as he}from"./connect-BAAo0kCL.js";import{n as ge}from"./runtime-config-DL3QjcfM-D9g4VFtY.js";import{t as L}from"./preload-helper-ca-nBW7U.js";import{$ as _e,R as ve,U as ye,it as be,rt as xe}from"./types-CxSpmNGK-BaNo7EHQ.js";import{r as R}from"./dist-Cb4AoJ-8.js";import{l as Se}from"./worker-XYrQaEmt-w0FhumYk.js";import{t as Ce}from"./dist-DC27BFRa.js";import{n as we}from"./clsx-CtFH8AOT.js";import{n as z,t as B}from"./toast-BEy42aYx-Dg_jZf6v.js";import{t as Te}from"./i18next-kqPoxo7u.js";import{a as Ee,i as De,r as V}from"./connect.config-Bt4pvvWV-BGQwxlgI.js";import{_ as Oe,h as ke,l as Ae,m as je,n as Me,o as Ne,r as Pe,t as Fe,u as Ie}from"./module-C0ZfaSzR.js";import{t as Le}from"./Trans-DDyWfeQm.js";import{t as Re}from"./useTranslation-DQCCLfKw.js";import{t as ze}from"./registerServiceWorker-D9l1kja7-CjV3G1S5.js";import{Fragment as Be,jsx as H,jsxs as U}from"react/jsx-runtime";import*as W from"react";import Ve,{Component as He,StrictMode as Ue,Suspense as We,createContext as Ge,createElement as Ke,lazy as G,useCallback as qe,useContext as Je,useEffect as K,useLayoutEffect as Ye,useMemo as Xe,useRef as Ze,useState as Qe,useSyncExternalStore as $e}from"react";import*as et from"react-dom";function q(){return q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},q.apply(null,arguments)}var J;(function(e){e.Pop=`POP`,e.Push=`PUSH`,e.Replace=`REPLACE`})(J||={});var tt=`popstate`;function nt(e){e===void 0&&(e={});function t(e,t){let{pathname:n,search:r,hash:i}=e.location;return ot(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){return typeof t==`string`?t:st(t)}return lt(t,n,null,e)}function Y(e,t){if(e===!1||e==null)throw Error(t)}function rt(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function it(){return Math.random().toString(36).substr(2,8)}function at(e,t){return{usr:e.state,key:e.key,idx:t}}function ot(e,t,n,r){return n===void 0&&(n=null),q({pathname:typeof e==`string`?e:e.pathname,search:``,hash:``},typeof t==`string`?ct(t):t,{state:n,key:t&&t.key||r||it()})}function st(e){let{pathname:t=`/`,search:n=``,hash:r=``}=e;return n&&n!==`?`&&(t+=n.charAt(0)===`?`?n:`?`+n),r&&r!==`#`&&(t+=r.charAt(0)===`#`?r:`#`+r),t}function ct(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function lt(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=J.Pop,c=null,l=u();l??(l=0,o.replaceState(q({},o.state,{idx:l}),``));function u(){return(o.state||{idx:null}).idx}function d(){s=J.Pop;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=J.Push;let r=ot(h.location,e,t);n&&n(r,e),l=u()+1;let d=at(r,l),f=h.createHref(r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=J.Replace;let r=ot(h.location,e,t);n&&n(r,e),l=u();let i=at(r,l),d=h.createHref(r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){let t=i.location.origin===`null`?i.location.href:i.location.origin,n=typeof e==`string`?e:st(e);return n=n.replace(/ $/,`%20`),Y(t,`No window.location.(origin|href) available to create URL for href: `+n),new URL(n,t)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(tt,d),c=e,()=>{i.removeEventListener(tt,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}var X;(function(e){e.data=`data`,e.deferred=`deferred`,e.redirect=`redirect`,e.error=`error`})(X||={});var ut=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function dt(e){return e.index===!0}function ft(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((e,i)=>{let a=[...n,String(i)],o=typeof e.id==`string`?e.id:a.join(`-`);if(Y(e.index!==!0||!e.children,`Cannot specify children on an index route`),Y(!r[o],`Found a route id collision on id "`+o+`". Route id's must be globally unique within Data Router usages`),dt(e)){let n=q({},e,t(e),{id:o});return r[o]=n,n}else{let n=q({},e,t(e),{id:o,children:void 0});return r[o]=n,e.children&&(n.children=ft(e.children,t,a,r)),n}})}function pt(e,t,n){return n===void 0&&(n=`/`),mt(e,t,n,!1)}function mt(e,t,n,r){let i=Mt((typeof t==`string`?ct(t):t).pathname||`/`,n);if(i==null)return null;let a=gt(e);vt(a);let o=null,s=jt(i);for(let e=0;o==null&&e<a.length;++e)o=Ot(a[e],s,r);return o}function ht(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function gt(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r=``);let i=(e,i,a)=>{let o={relativePath:a===void 0?e.path||``:a,caseSensitive:e.caseSensitive===!0,childrenIndex:i,route:e};o.relativePath.startsWith(`/`)&&(Y(o.relativePath.startsWith(r),`Absolute route path "`+o.relativePath+`" nested under path `+(`"`+r+`" is not valid. An absolute child route path `)+`must start with the combined path of all its parent routes.`),o.relativePath=o.relativePath.slice(r.length));let s=Ht([r,o.relativePath]),c=n.concat(o);e.children&&e.children.length>0&&(Y(e.index!==!0,`Index routes must not have child routes. Please remove `+(`all child routes from route path "`+s+`".`)),gt(e.children,t,c,s)),!(e.path==null&&!e.index)&&t.push({path:s,score:Et(s,e.index),routesMeta:c})};return e.forEach((e,t)=>{var n;if(e.path===``||!((n=e.path)!=null&&n.includes(`?`)))i(e,t);else for(let n of _t(e.path))i(e,t,n)}),t}function _t(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=_t(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 vt(e){e.sort((e,t)=>e.score===t.score?Dt(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var yt=/^:[\w-]+$/,bt=3,xt=2,St=1,Ct=10,wt=-2,Tt=e=>e===`*`;function Et(e,t){let n=e.split(`/`),r=n.length;return n.some(Tt)&&(r+=wt),t&&(r+=xt),n.filter(e=>!Tt(e)).reduce((e,t)=>e+(yt.test(t)?bt:t===``?St:Ct),r)}function Dt(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 Ot(e,t,n){n===void 0&&(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=kt({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=kt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:Ht([a,u.pathname]),pathnameBase:Ut(Ht([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=Ht([a,u.pathnameBase]))}return o}function kt(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=At(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,t,n)=>{let{paramName:r,isOptional:i}=t;if(r===`*`){let e=s[n]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let c=s[n];return i&&!c?e[r]=void 0:e[r]=(c||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function At(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),rt(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)=>(r.push({paramName:t,isOptional:n!=null}),n?`/?([^\\/]+)?`:`/([^\\/]+)`));return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function jt(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return rt(!1,`The URL path "`+e+`" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent `+(`encoding (`+t+`).`)),e}}function Mt(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)||`/`}var Nt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pt=e=>Nt.test(e);function Ft(e,t){t===void 0&&(t=`/`);let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?ct(e):e,a;if(n)if(Pt(n))a=n;else{if(n.includes(`//`)){let e=n;n=Vt(n),rt(!1,`Pathnames cannot have embedded double slashes - normalizing `+(e+` -> `+n))}a=n.startsWith(`/`)?It(n.substring(1),`/`):It(n,t)}else a=t;return{pathname:a,search:Wt(r),hash:Gt(i)}}function It(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Lt(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 Rt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function zt(e,t){let n=Rt(e);return t?n.map((e,t)=>t===n.length-1?e.pathname:e.pathnameBase):n.map(e=>e.pathnameBase)}function Bt(e,t,n,r){r===void 0&&(r=!1);let i;typeof e==`string`?i=ct(e):(i=q({},e),Y(!i.pathname||!i.pathname.includes(`?`),Lt(`?`,`pathname`,`search`,i)),Y(!i.pathname||!i.pathname.includes(`#`),Lt(`#`,`pathname`,`hash`,i)),Y(!i.search||!i.search.includes(`#`),Lt(`#`,`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=Ft(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Vt=e=>e.replace(/\/\/+/g,`/`),Ht=e=>Vt(e.join(`/`)),Ut=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),Wt=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Gt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Kt=class{constructor(e,t,n,r){r===void 0&&(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 qt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}var Jt=[`post`,`put`,`patch`,`delete`],Yt=new Set(Jt),Xt=[`get`,...Jt],Zt=new Set(Xt),Qt=new Set([301,302,303,307,308]),$t=new Set([307,308]),en={state:`idle`,location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},tn={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},nn={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},rn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,an=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),on=`remix-router-transitions`;function sn(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,r=!n;Y(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;i=e=>({hasErrorBoundary:t(e)})}else i=an;let a={},o=ft(e.routes,i,void 0,a),s,c=e.basename||`/`,l=e.dataStrategy||bn,u=e.patchRoutesOnNavigation,d=q({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),f=null,p=new Set,m=null,h=null,g=null,_=e.hydrationData!=null,v=pt(o,e.history.location,c),y=!1,b=null;if(v==null&&!u){let t=Z(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Pn(o);v=n,b={[r.id]:t}}v&&!e.hydrationData&&H(v,o,e.history.location.pathname).active&&(v=null);let x;if(!v){if(x=!1,v=[],d.v7_partialHydration){let t=H(null,o,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}}else if(v.some(e=>e.route.lazy))x=!1;else if(!v.some(e=>e.route.loader))x=!0;else if(d.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);x=v.slice(0,e+1).every(e=>!pn(e.route,t,n))}else x=v.every(e=>!pn(e.route,t,n))}else x=e.hydrationData!=null;let S,C={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,navigation:en,restoreScrollPosition:e.hydrationData==null?null:!1,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},w=J.Pop,T=!1,E,D=!1,ee=new Map,O=null,te=!1,ne=!1,re=[],ie=new Set,k=new Map,ae=0,oe=-1,se=new Map,A=new Set,j=new Map,M=new Map,N=new Set,ce=new Map,P=new Map,F;function le(){if(f=e.history.listen(t=>{let{action:n,location:r,delta:i}=t;if(F){F(),F=void 0;return}rt(P.size===0||i!=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 a=Pe({currentLocation:C.location,nextLocation:r,historyAction:n});if(a&&i!=null){let t=new Promise(e=>{F=e});e.history.go(i*-1),Ne(a,{state:`blocked`,location:r,proceed(){Ne(a,{state:`proceeding`,proceed:void 0,reset:void 0,location:r}),t.then(()=>e.history.go(i))},reset(){let e=new Map(C.blockers);e.set(a,nn),I({blockers:e})}});return}return he(n,r)}),n){nr(t,ee);let e=()=>rr(t,ee);t.addEventListener(`pagehide`,e),O=()=>t.removeEventListener(`pagehide`,e)}return C.initialized||he(J.Pop,C.location,{initialHydration:!0}),S}function ue(){f&&f(),O&&O(),p.clear(),E&&E.abort(),C.fetchers.forEach((e,t)=>Ee(t)),C.blockers.forEach((e,t)=>Me(t))}function de(e){return p.add(e),()=>p.delete(e)}function I(e,t){t===void 0&&(t={}),C=q({},C,e);let n=[],r=[];d.v7_fetcherPersist&&C.fetchers.forEach((e,t)=>{e.state===`idle`&&(N.has(t)?r.push(t):n.push(t))}),N.forEach(e=>{!C.fetchers.has(e)&&!k.has(e)&&r.push(e)}),[...p].forEach(e=>e(C,{deletedFetchers:r,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),d.v7_fetcherPersist?(n.forEach(e=>C.fetchers.delete(e)),r.forEach(e=>Ee(e))):r.forEach(e=>N.delete(e))}function fe(t,n,r){let{flushSync:i}=r===void 0?{}:r,a=C.actionData!=null&&C.navigation.formMethod!=null&&$(C.navigation.formMethod)&&C.navigation.state===`loading`&&t.state?._isRedirect!==!0,c;c=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:a?C.actionData:null;let l=n.loaderData?jn(C.loaderData,n.loaderData,n.matches||[],n.errors):C.loaderData,u=C.blockers;u.size>0&&(u=new Map(u),u.forEach((e,t)=>u.set(t,nn)));let d=T===!0||C.navigation.formMethod!=null&&$(C.navigation.formMethod)&&t.state?._isRedirect!==!0;s&&=(o=s,void 0),te||w===J.Pop||(w===J.Push?e.history.push(t,t.state):w===J.Replace&&e.history.replace(t,t.state));let f;if(w===J.Pop){let e=ee.get(C.location.pathname);e&&e.has(t.pathname)?f={currentLocation:C.location,nextLocation:t}:ee.has(t.pathname)&&(f={currentLocation:t,nextLocation:C.location})}else if(D){let e=ee.get(C.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),ee.set(C.location.pathname,e)),f={currentLocation:C.location,nextLocation:t}}I(q({},n,{actionData:c,loaderData:l,historyAction:w,location:t,initialized:!0,navigation:en,revalidation:`idle`,restoreScrollPosition:Be(t,n.matches||C.matches),preventScrollReset:d,blockers:u}),{viewTransitionOpts:f,flushSync:i===!0}),w=J.Pop,T=!1,D=!1,te=!1,ne=!1,re=[]}async function pe(t,n){if(typeof t==`number`){e.history.go(t);return}let r=ln(C.location,C.matches,c,d.v7_prependBasename,t,d.v7_relativeSplatPath,n?.fromRouteId,n?.relative),{path:i,submission:a,error:o}=un(d.v7_normalizeFormMethod,!1,r,n),s=C.location,l=ot(C.location,i,n&&n.state);l=q({},l,e.history.encodeLocation(l));let u=n&&n.replace!=null?n.replace:void 0,f=J.Push;u===!0?f=J.Replace:u===!1||a!=null&&$(a.formMethod)&&a.formAction===C.location.pathname+C.location.search&&(f=J.Replace);let p=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,m=(n&&n.flushSync)===!0,h=Pe({currentLocation:s,nextLocation:l,historyAction:f});if(h){Ne(h,{state:`blocked`,location:l,proceed(){Ne(h,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),pe(t,n)},reset(){let e=new Map(C.blockers);e.set(h,nn),I({blockers:e})}});return}return await he(f,l,{submission:a,pendingError:o,preventScrollReset:p,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:m})}function me(){if(we(),I({revalidation:`loading`}),C.navigation.state!==`submitting`){if(C.navigation.state===`idle`){he(C.historyAction,C.location,{startUninterruptedRevalidation:!0});return}he(w||C.historyAction,C.navigation.location,{overrideNavigation:C.navigation,enableViewTransition:D===!0})}}async function he(t,n,r){E&&E.abort(),E=null,w=t,te=(r&&r.startUninterruptedRevalidation)===!0,ze(C.location,C.matches),T=(r&&r.preventScrollReset)===!0,D=(r&&r.enableViewTransition)===!0;let i=s||o,a=r&&r.overrideNavigation,l=r!=null&&r.initialHydration&&C.matches&&C.matches.length>0&&!y?C.matches:pt(i,n,c),u=(r&&r.flushSync)===!0;if(l&&C.initialized&&!ne&&Ln(C.location,n)&&!(r&&r.submission&&$(r.submission.formMethod))){fe(n,{matches:l},{flushSync:u});return}let d=H(l,i,n.pathname);if(d.active&&d.matches&&(l=d.matches),!l){let{error:e,notFoundMatches:t,route:r}=Fe(n.pathname);fe(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:u});return}E=new AbortController;let f=En(e.history,n,E.signal,r&&r.submission),p;if(r&&r.pendingError)p=[Nn(l).route.id,{type:X.error,error:r.pendingError}];else if(r&&r.submission&&$(r.submission.formMethod)){let t=await ge(f,n,r.submission,l,d.active,{replace:r.replace,flushSync:u});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(Q(r)&&qt(r.error)&&r.error.status===404){E=null,fe(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}});return}}l=t.matches||l,p=t.pendingActionResult,a=Zn(n,r.submission),u=!1,d.active=!1,f=En(e.history,f.url,f.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_}=await L(f,n,l,d.active,a,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,u,p);m||(E=null,fe(n,q({matches:h||l},Mn(p),{loaderData:g,errors:_})))}async function ge(t,n,r,i,a,o){if(o===void 0&&(o={}),we(),I({navigation:Qn(n,r)},{flushSync:o.flushSync===!0}),a){let e=await U(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){let t=Nn(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:X.error,error:e.error}]}}else if(e.matches)i=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Fe(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:X.error,error:t}]}}}let s,l=Yn(i,n);if(!l.route.action&&!l.route.lazy)s={type:X.error,error:Z(405,{method:t.method,pathname:n.pathname,routeId:l.route.id})};else if(s=(await Se(`action`,C,t,[l],i,null))[l.route.id],t.signal.aborted)return{shortCircuited:!0};if(Bn(s)){let n;return n=o&&o.replace!=null?o.replace:Tn(s.response.headers.get(`Location`),new URL(t.url),c,e.history)===C.location.pathname+C.location.search,await R(t,s,!0,{submission:r,replace:n}),{shortCircuited:!0}}if(zn(s))throw Z(400,{type:`defer-action`});if(Q(s)){let e=Nn(i,l.route.id);return(o&&o.replace)!==!0&&(w=J.Push),{matches:i,pendingActionResult:[e.route.id,s]}}return{matches:i,pendingActionResult:[l.route.id,s]}}async function L(t,n,r,i,a,l,u,f,p,m,h){let g=a||Zn(n,l),_=l||u||Xn(g),v=!te&&(!d.v7_partialHydration||!p);if(i){if(v){let e=_e(h);I(q({navigation:g},e===void 0?{}:{actionData:e}),{flushSync:m})}let e=await U(r,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){let t=Nn(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}else if(e.matches)r=e.matches;else{let{error:e,notFoundMatches:t,route:r}=Fe(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let y=s||o,[b,x]=fn(e.history,C,r,_,n,d.v7_partialHydration&&p===!0,d.v7_skipActionErrorRevalidation,ne,re,ie,N,j,A,y,c,h);if(Ie(e=>!(r&&r.some(t=>t.route.id===e))||b&&b.some(t=>t.route.id===e)),oe=++ae,b.length===0&&x.length===0){let e=ke();return fe(n,q({matches:r,loaderData:{},errors:h&&Q(h[1])?{[h[0]]:h[1].error}:null},Mn(h),e?{fetchers:new Map(C.fetchers)}:{}),{flushSync:m}),{shortCircuited:!0}}if(v){let e={};if(!i){e.navigation=g;let t=_e(h);t!==void 0&&(e.actionData=t)}x.length>0&&(e.fetchers=ve(x)),I(e,{flushSync:m})}x.forEach(e=>{V(e.key),e.controller&&k.set(e.key,e.controller)});let S=()=>x.forEach(e=>V(e.key));E&&E.signal.addEventListener(`abort`,S);let{loaderResults:w,fetcherResults:T}=await Ce(C,r,b,x,t);if(t.signal.aborted)return{shortCircuited:!0};E&&E.signal.removeEventListener(`abort`,S),x.forEach(e=>k.delete(e.key));let D=Fn(w);if(D)return await R(t,D.result,!0,{replace:f}),{shortCircuited:!0};if(D=Fn(T),D)return A.add(D.key),await R(t,D.result,!0,{replace:f}),{shortCircuited:!0};let{loaderData:ee,errors:O}=An(C,r,w,h,x,T,ce);ce.forEach((e,t)=>{e.subscribe(n=>{(n||e.done)&&ce.delete(t)})}),d.v7_partialHydration&&p&&C.errors&&(O=q({},C.errors,O));let se=ke(),M=Ae(oe),P=se||M||x.length>0;return q({matches:r,loaderData:ee,errors:O},P?{fetchers:new Map(C.fetchers)}:{})}function _e(e){if(e&&!Q(e[1]))return{[e[0]]:e[1].data};if(C.actionData)return Object.keys(C.actionData).length===0?null:C.actionData}function ve(e){return e.forEach(e=>{let t=C.fetchers.get(e.key),n=$n(void 0,t?t.data:void 0);C.fetchers.set(e.key,n)}),new Map(C.fetchers)}function ye(e,t,n,i){if(r)throw Error(`router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.`);V(e);let a=(i&&i.flushSync)===!0,l=s||o,u=ln(C.location,C.matches,c,d.v7_prependBasename,n,d.v7_relativeSplatPath,t,i?.relative),f=pt(l,u,c),p=H(f,l,u);if(p.active&&p.matches&&(f=p.matches),!f){B(e,t,Z(404,{pathname:u}),{flushSync:a});return}let{path:m,submission:h,error:g}=un(d.v7_normalizeFormMethod,!0,u,i);if(g){B(e,t,g,{flushSync:a});return}let _=Yn(f,m),v=(i&&i.preventScrollReset)===!0;if(h&&$(h.formMethod)){be(e,t,m,_,f,p.active,a,v,h);return}j.set(e,{routeId:t,path:m}),xe(e,t,m,_,f,p.active,a,v,h)}async function be(t,n,r,i,a,l,u,f,p){we(),j.delete(t);function m(e){return!e.route.action&&!e.route.lazy?(B(t,n,Z(405,{method:p.formMethod,pathname:r,routeId:n}),{flushSync:u}),!0):!1}if(!l&&m(i))return;z(t,er(p,C.fetchers.get(t)),{flushSync:u});let h=new AbortController,g=En(e.history,r,h.signal,p);if(l){let e=await U(a,new URL(g.url).pathname,g.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){B(t,n,e.error,{flushSync:u});return}else if(!e.matches){B(t,n,Z(404,{pathname:r}),{flushSync:u});return}else if(a=e.matches,i=Yn(a,r),m(i))return}k.set(t,h);let _=ae,v=(await Se(`action`,C,g,[i],a,t))[i.route.id];if(g.signal.aborted){k.get(t)===h&&k.delete(t);return}if(d.v7_fetcherPersist&&N.has(t)){if(Bn(v)||Q(v)){z(t,tr(void 0));return}}else{if(Bn(v))if(k.delete(t),oe>_){z(t,tr(void 0));return}else return A.add(t),z(t,$n(p)),R(g,v,!1,{fetcherSubmission:p,preventScrollReset:f});if(Q(v)){B(t,n,v.error);return}}if(zn(v))throw Z(400,{type:`defer-action`});let y=C.navigation.location||C.location,b=En(e.history,y,h.signal),x=s||o,S=C.navigation.state===`idle`?C.matches:pt(x,C.navigation.location,c);Y(S,`Didn't find any matches after fetcher action`);let T=++ae;se.set(t,T);let D=$n(p,v.data);C.fetchers.set(t,D);let[ee,O]=fn(e.history,C,S,p,y,!1,d.v7_skipActionErrorRevalidation,ne,re,ie,N,j,A,x,c,[i.route.id,v]);O.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=C.fetchers.get(t),r=$n(void 0,n?n.data:void 0);C.fetchers.set(t,r),V(t),e.controller&&k.set(t,e.controller)}),I({fetchers:new Map(C.fetchers)});let te=()=>O.forEach(e=>V(e.key));h.signal.addEventListener(`abort`,te);let{loaderResults:M,fetcherResults:P}=await Ce(C,S,ee,O,b);if(h.signal.aborted)return;h.signal.removeEventListener(`abort`,te),se.delete(t),k.delete(t),O.forEach(e=>k.delete(e.key));let F=Fn(M);if(F)return R(b,F.result,!1,{preventScrollReset:f});if(F=Fn(P),F)return A.add(F.key),R(b,F.result,!1,{preventScrollReset:f});let{loaderData:le,errors:ue}=An(C,S,M,void 0,O,P,ce);if(C.fetchers.has(t)){let e=tr(v.data);C.fetchers.set(t,e)}Ae(T),C.navigation.state===`loading`&&T>oe?(Y(w,`Expected pending action`),E&&E.abort(),fe(C.navigation.location,{matches:S,loaderData:le,errors:ue,fetchers:new Map(C.fetchers)})):(I({errors:ue,loaderData:jn(C.loaderData,le,S,ue),fetchers:new Map(C.fetchers)}),ne=!1)}async function xe(t,n,r,i,a,o,s,c,l){let u=C.fetchers.get(t);z(t,$n(l,u?u.data:void 0),{flushSync:s});let d=new AbortController,f=En(e.history,r,d.signal);if(o){let e=await U(a,new URL(f.url).pathname,f.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){B(t,n,e.error,{flushSync:s});return}else if(e.matches)a=e.matches,i=Yn(a,r);else{B(t,n,Z(404,{pathname:r}),{flushSync:s});return}}k.set(t,d);let p=ae,m=(await Se(`loader`,C,f,[i],a,t))[i.route.id];if(zn(m)&&(m=await qn(m,f.signal,!0)||m),k.get(t)===d&&k.delete(t),!f.signal.aborted){if(N.has(t)){z(t,tr(void 0));return}if(Bn(m))if(oe>p){z(t,tr(void 0));return}else{A.add(t),await R(f,m,!1,{preventScrollReset:c});return}if(Q(m)){B(t,n,m.error);return}Y(!zn(m),`Unhandled fetcher deferred data`),z(t,tr(m.data))}}async function R(r,i,a,o){let{submission:s,fetcherSubmission:l,preventScrollReset:u,replace:d}=o===void 0?{}:o;i.response.headers.has(`X-Remix-Revalidate`)&&(ne=!0);let f=i.response.headers.get(`Location`);Y(f,`Expected a Location header on the redirect Response`),f=Tn(f,new URL(r.url),c,e.history);let p=ot(C.location,f,{_isRedirect:!0});if(n){let n=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))n=!0;else if(rn.test(f)){let r=e.history.createURL(f);n=r.origin!==t.location.origin||Mt(r.pathname,c)==null}if(n){d?t.location.replace(f):t.location.assign(f);return}}E=null;let m=d===!0||i.response.headers.has(`X-Remix-Replace`)?J.Replace:J.Push,{formMethod:h,formAction:g,formEncType:_}=C.navigation;!s&&!l&&h&&g&&_&&(s=Xn(C.navigation));let v=s||l;$t.has(i.response.status)&&v&&$(v.formMethod)?await he(m,p,{submission:q({},v,{formAction:f}),preventScrollReset:u||T,enableViewTransition:a?D:void 0}):await he(m,p,{overrideNavigation:Zn(p,s),fetcherSubmission:l,preventScrollReset:u||T,enableViewTransition:a?D:void 0})}async function Se(e,t,n,r,o,s){let u,f={};try{u=await xn(l,e,t,n,r,o,s,a,i)}catch(e){return r.forEach(t=>{f[t.route.id]={type:X.error,error:e}}),f}for(let[e,t]of Object.entries(u))if(Rn(t)){let r=t.result;f[e]={type:X.redirect,response:wn(r,n,e,o,c,d.v7_relativeSplatPath)}}else f[e]=await Cn(t);return f}async function Ce(t,n,r,i,a){let o=t.matches,s=Se(`loader`,t,a,r,n,null),c=Promise.all(i.map(async n=>{if(n.matches&&n.match&&n.controller){let r=(await Se(`loader`,t,En(e.history,n.path,n.controller.signal),[n.match],n.matches,n.key))[n.match.route.id];return{[n.key]:r}}else return Promise.resolve({[n.key]:{type:X.error,error:Z(404,{pathname:n.path})}})})),l=await s,u=(await c).reduce((e,t)=>Object.assign(e,t),{});return await Promise.all([Gn(n,l,a.signal,o,t.loaderData),Kn(n,u,i)]),{loaderResults:l,fetcherResults:u}}function we(){ne=!0,re.push(...Ie()),j.forEach((e,t)=>{k.has(t)&&ie.add(t),V(t)})}function z(e,t,n){n===void 0&&(n={}),C.fetchers.set(e,t),I({fetchers:new Map(C.fetchers)},{flushSync:(n&&n.flushSync)===!0})}function B(e,t,n,r){r===void 0&&(r={});let i=Nn(C.matches,t);Ee(e),I({errors:{[i.route.id]:n},fetchers:new Map(C.fetchers)},{flushSync:(r&&r.flushSync)===!0})}function Te(e){return M.set(e,(M.get(e)||0)+1),N.has(e)&&N.delete(e),C.fetchers.get(e)||tn}function Ee(e){let t=C.fetchers.get(e);k.has(e)&&!(t&&t.state===`loading`&&se.has(e))&&V(e),j.delete(e),se.delete(e),A.delete(e),d.v7_fetcherPersist&&N.delete(e),ie.delete(e),C.fetchers.delete(e)}function De(e){let t=(M.get(e)||0)-1;t<=0?(M.delete(e),N.add(e),d.v7_fetcherPersist||Ee(e)):M.set(e,t),I({fetchers:new Map(C.fetchers)})}function V(e){let t=k.get(e);t&&(t.abort(),k.delete(e))}function Oe(e){for(let t of e){let e=tr(Te(t).data);C.fetchers.set(t,e)}}function ke(){let e=[],t=!1;for(let n of A){let r=C.fetchers.get(n);Y(r,`Expected fetcher: `+n),r.state===`loading`&&(A.delete(n),e.push(n),t=!0)}return Oe(e),t}function Ae(e){let t=[];for(let[n,r]of se)if(r<e){let e=C.fetchers.get(n);Y(e,`Expected fetcher: `+n),e.state===`loading`&&(V(n),se.delete(n),t.push(n))}return Oe(t),t.length>0}function je(e,t){let n=C.blockers.get(e)||nn;return P.get(e)!==t&&P.set(e,t),n}function Me(e){C.blockers.delete(e),P.delete(e)}function Ne(e,t){let n=C.blockers.get(e)||nn;Y(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(C.blockers);r.set(e,t),I({blockers:r})}function Pe(e){let{currentLocation:t,nextLocation:n,historyAction:r}=e;if(P.size===0)return;P.size>1&&rt(!1,`A router only supports one blocker at a time`);let i=Array.from(P.entries()),[a,o]=i[i.length-1],s=C.blockers.get(a);if(!(s&&s.state===`proceeding`)&&o({currentLocation:t,nextLocation:n,historyAction:r}))return a}function Fe(e){let t=Z(404,{pathname:e}),{matches:n,route:r}=Pn(s||o);return Ie(),{notFoundMatches:n,route:r,error:t}}function Ie(e){let t=[];return ce.forEach((n,r)=>{(!e||e(r))&&(n.cancel(),t.push(r),ce.delete(r))}),t}function Le(e,t,n){if(m=e,g=t,h=n||null,!_&&C.navigation===en){_=!0;let e=Be(C.location,C.matches);e!=null&&I({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function Re(e,t){return h&&h(e,t.map(e=>ht(e,C.loaderData)))||e.key}function ze(e,t){if(m&&g){let n=Re(e,t);m[n]=g()}}function Be(e,t){if(m){let n=Re(e,t),r=m[n];if(typeof r==`number`)return r}return null}function H(e,t,n){if(u){if(!e)return{active:!0,matches:mt(t,n,c,!0)||[]};if(Object.keys(e[0].params).length>0)return{active:!0,matches:mt(t,n,c,!0)}}return{active:!1,matches:null}}async function U(e,t,n,r){if(!u)return{type:`success`,matches:e};let l=e;for(;;){let e=s==null,d=s||o,f=a;try{await u({signal:n,path:t,matches:l,fetcherKey:r,patch:(e,t)=>{n.aborted||_n(e,t,d,f,i)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}finally{e&&!n.aborted&&(o=[...o])}if(n.aborted)return{type:`aborted`};let p=pt(d,t,c);if(p)return{type:`success`,matches:p};let m=mt(d,t,c,!0);if(!m||l.length===m.length&&l.every((e,t)=>e.route.id===m[t].route.id))return{type:`success`,matches:null};l=m}}function W(e){a={},s=ft(e,i,void 0,a)}function Ve(e,t){let n=s==null;_n(e,t,s||o,a,i),n&&(o=[...o],I({}))}return S={get basename(){return c},get future(){return d},get state(){return C},get routes(){return o},get window(){return t},initialize:le,subscribe:de,enableScrollRestoration:Le,navigate:pe,fetch:ye,revalidate:me,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Te,deleteFetcher:De,dispose:ue,getBlocker:je,deleteBlocker:Me,patchRoutes:Ve,_internalFetchControllers:k,_internalActiveDeferreds:ce,_internalSetRoutes:W},S}function cn(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function ln(e,t,n,r,i,a,o,s){let c,l;if(o){c=[];for(let e of t)if(c.push(e),e.route.id===o){l=e;break}}else c=t,l=t[t.length-1];let u=Bt(i||`.`,zt(c,a),Mt(e.pathname,n)||e.pathname,s===`path`);if(i??(u.search=e.search,u.hash=e.hash),(i==null||i===``||i===`.`)&&l){let e=Jn(u.search);if(l.route.index&&!e)u.search=u.search?u.search.replace(/^\?/,`?index&`):`?index`;else if(!l.route.index&&e){let e=new URLSearchParams(u.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();u.search=n?`?`+n:``}}return r&&n!==`/`&&(u.pathname=u.pathname===`/`?n:Ht([n,u.pathname])),st(u)}function un(e,t,n,r){if(!r||!cn(r))return{path:n};if(r.formMethod&&!Wn(r.formMethod))return{path:n,error:Z(405,{method:r.formMethod})};let i=()=>({path:n,error:Z(400,{type:`invalid-body`})}),a=r.formMethod||`get`,o=e?a.toUpperCase():a.toLowerCase(),s=In(n);if(r.body!==void 0){if(r.formEncType===`text/plain`){if(!$(o))return i();let e=typeof r.body==`string`?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((e,t)=>{let[n,r]=t;return``+e+n+`=`+r+`
|
|
3
3
|
`},``):String(r.body);return{path:n,submission:{formMethod:o,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:e}}}else if(r.formEncType===`application/json`){if(!$(o))return i();try{let e=typeof r.body==`string`?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:o,formAction:s,formEncType:r.formEncType,formData:void 0,json:e,text:void 0}}}catch{return i()}}}Y(typeof FormData==`function`,`FormData is not available in this environment`);let c,l;if(r.formData)c=Dn(r.formData),l=r.formData;else if(r.body instanceof FormData)c=Dn(r.body),l=r.body;else if(r.body instanceof URLSearchParams)c=r.body,l=On(c);else if(r.body==null)c=new URLSearchParams,l=new FormData;else try{c=new URLSearchParams(r.body),l=On(c)}catch{return i()}let u={formMethod:o,formAction:s,formEncType:r&&r.formEncType||`application/x-www-form-urlencoded`,formData:l,json:void 0,text:void 0};if($(u.formMethod))return{path:n,submission:u};let d=ct(n);return t&&d.search&&Jn(d.search)&&c.append(`index`,``),d.search=`?`+c,{path:st(d),submission:u}}function dn(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(e=>e.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function fn(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=h?Q(h[1])?h[1].error:h[1].data:void 0,_=e.createURL(t.location),v=e.createURL(i),y=n;a&&t.errors?y=dn(n,Object.keys(t.errors)[0],!0):h&&Q(h[1])&&(y=dn(n,h[0]));let b=h?h[1].statusCode:void 0,x=o&&b&&b>=400,S=y.filter((e,n)=>{let{route:i}=e;if(i.lazy)return!0;if(i.loader==null)return!1;if(a)return pn(i,t.loaderData,t.errors);if(mn(t.loaderData,t.matches[n],e)||c.some(t=>t===e.route.id))return!0;let o=t.matches[n],l=e;return gn(e,q({currentUrl:_,currentParams:o.params,nextUrl:v,nextParams:l.params},r,{actionResult:g,actionStatus:b,defaultShouldRevalidate:x?!1:s||_.pathname+_.search===v.pathname+v.search||_.search!==v.search||hn(o,l)}))}),C=[];return d.forEach((e,i)=>{if(a||!n.some(t=>t.route.id===e.routeId)||u.has(i))return;let o=pt(p,e.path,m);if(!o){C.push({key:i,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});return}let c=t.fetchers.get(i),d=Yn(o,e.path),h=!1;f.has(i)?h=!1:l.has(i)?(l.delete(i),h=!0):h=c&&c.state!==`idle`&&c.data===void 0?s:gn(d,q({currentUrl:_,currentParams:t.matches[t.matches.length-1].params,nextUrl:v,nextParams:n[n.length-1].params},r,{actionResult:g,actionStatus:b,defaultShouldRevalidate:x?!1:s})),h&&C.push({key:i,routeId:e.routeId,path:e.path,matches:o,match:d,controller:new AbortController})}),[S,C]}function pn(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader==`function`&&e.loader.hydrate===!0?!0:!r&&!i}function mn(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function hn(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function gn(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function _n(e,t,n,r,i){let a;if(e){let t=r[e];Y(t,`No route found to patch children into: routeId = `+e),t.children||=[],a=t.children}else a=n;let o=ft(t.filter(e=>!a.some(t=>vn(e,t))),i,[e||`_`,`patch`,String(a?.length||`0`)],r);a.push(...o)}function vn(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?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((e,n)=>t.children?.some(t=>vn(e,t))):!1}async function yn(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];Y(i,`No route found in manifest`);let a={};for(let e in r){let t=i[e]!==void 0&&e!==`hasErrorBoundary`;rt(!t,`Route "`+i.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.`)),!t&&!ut.has(e)&&(a[e]=r[e])}Object.assign(i,a),Object.assign(i,q({},t(i),{lazy:void 0}))}async function bn(e){let{matches:t}=e,n=t.filter(e=>e.shouldLoad);return(await Promise.all(n.map(e=>e.resolve()))).reduce((e,t,r)=>Object.assign(e,{[n[r].route.id]:t}),{})}async function xn(e,t,n,r,i,a,o,s,c,l){let u=a.map(e=>e.route.lazy?yn(e.route,c,s):void 0),d=await e({matches:a.map((e,n)=>{let a=u[n],o=i.some(t=>t.route.id===e.route.id);return q({},e,{shouldLoad:o,resolve:async n=>(n&&r.method===`GET`&&(e.route.lazy||e.route.loader)&&(o=!0),o?Sn(t,r,e,a,n,l):Promise.resolve({type:X.data,result:void 0}))})}),request:r,params:a[0].params,fetcherKey:o,context:l});try{await Promise.all(u)}catch{}return d}async function Sn(e,t,n,r,i,a){let o,s,c=r=>{let o,c=new Promise((e,t)=>o=t);s=()=>o(),t.signal.addEventListener(`abort`,s);let l=i=>typeof r==`function`?r({request:t,params:n.params,context:a},...i===void 0?[]:[i]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean `+(`"`+e+`" [routeId: `+n.route.id+`]`))),u=(async()=>{try{return{type:`data`,result:await(i?i(e=>l(e)):l())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([u,c])};try{let i=n.route[e];if(r)if(i){let e,[t]=await Promise.all([c(i).catch(t=>{e=t}),r]);if(e!==void 0)throw e;o=t}else if(await r,i=n.route[e],i)o=await c(i);else if(e===`action`){let e=new URL(t.url),r=e.pathname+e.search;throw Z(405,{method:t.method,pathname:r,routeId:n.route.id})}else return{type:X.data,result:void 0};else if(i)o=await c(i);else{let e=new URL(t.url);throw Z(404,{pathname:e.pathname+e.search})}Y(o.result!==void 0,`You defined `+(e===`action`?`an action`:`a loader`)+` for route `+(`"`+n.route.id+`" but didn't return anything from your \``+e+"` ")+"function. Please return a value or `null`.")}catch(e){return{type:X.error,result:e}}finally{s&&t.signal.removeEventListener(`abort`,s)}return o}async function Cn(e){let{result:t,type:n}=e;if(Un(t)){let e;try{let n=t.headers.get(`Content-Type`);e=n&&/\bapplication\/json\b/.test(n)?t.body==null?null:await t.json():await t.text()}catch(e){return{type:X.error,error:e}}return n===X.error?{type:X.error,error:new Kt(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:X.data,data:e,statusCode:t.status,headers:t.headers}}if(n===X.error){if(Vn(t)){var r;if(t.data instanceof Error){var i;return{type:X.error,error:t.data,statusCode:t.init?.status,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}}return{type:X.error,error:new Kt(t.init?.status||500,void 0,t.data),statusCode:qt(t)?t.status:void 0,headers:(r=t.init)!=null&&r.headers?new Headers(t.init.headers):void 0}}return{type:X.error,error:t,statusCode:qt(t)?t.status:void 0}}if(Hn(t))return{type:X.deferred,deferredData:t,statusCode:t.init?.status,headers:t.init?.headers&&new Headers(t.init.headers)};if(Vn(t)){var a;return{type:X.data,data:t.data,statusCode:t.init?.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}}return{type:X.data,data:t}}function wn(e,t,n,r,i,a){let o=e.headers.get(`Location`);if(Y(o,`Redirects returned/thrown from loaders/actions must have a Location header`),!rn.test(o)){let s=r.slice(0,r.findIndex(e=>e.route.id===n)+1);o=ln(new URL(t.url),s,i,!0,o,a),e.headers.set(`Location`,o)}return e}function Tn(e,t,n,r){let i=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];if(rn.test(e)){let r=e,a=r.startsWith(`//`)?new URL(t.protocol+r):new URL(r);if(i.includes(a.protocol))throw Error(`Invalid redirect location`);let o=Mt(a.pathname,n)!=null;if(a.origin===t.origin&&o)return Vt(a.pathname)+a.search+a.hash}try{let t=r.createURL(e);if(i.includes(t.protocol))throw Error(`Invalid redirect location`)}catch{}return e}function En(e,t,n,r){let i=e.createURL(In(t)).toString(),a={signal:n};if(r&&$(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)):t===`text/plain`?a.body=r.text:t===`application/x-www-form-urlencoded`&&r.formData?a.body=Dn(r.formData):a.body=r.formData}return new Request(i,a)}function Dn(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function On(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function kn(e,t,n,r,i){let a={},o=null,s,c=!1,l={},u=n&&Q(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(Y(!Bn(f),`Cannot handle redirect results in processLoaderData`),Q(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=Nn(e,d);o[n.route.id]??(o[n.route.id]=t)}a[d]=void 0,c||(c=!0,s=qt(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else zn(f)?(r.set(d,f.deferredData),a[d]=f.deferredData.data,f.statusCode!=null&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)):(a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers))}),u!==void 0&&n&&(o={[n[0]]:u},a[n[0]]=void 0),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function An(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=kn(t,n,r,o,!1);return i.forEach(t=>{let{key:n,match:r,controller:i}=t,o=a[n];if(Y(o,`Did not find corresponding fetcher result`),!(i&&i.signal.aborted))if(Q(o)){let t=Nn(e.matches,r?.route.id);c&&c[t.route.id]||(c=q({},c,{[t.route.id]:o.error})),e.fetchers.delete(n)}else if(Bn(o))Y(!1,`Unhandled fetcher revalidation redirect`);else if(zn(o))Y(!1,`Unhandled fetcher deferred data`);else{let t=tr(o.data);e.fetchers.set(n,t)}}),{loaderData:s,errors:c}}function jn(e,t,n,r){let i=q({},t);for(let a of n){let n=a.route.id;if(t.hasOwnProperty(n)?t[n]!==void 0&&(i[n]=t[n]):e[n]!==void 0&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function Mn(e){return e?Q(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Nn(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function Pn(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 Z(e,t){let{pathname:n,routeId:r,method:i,type:a,message:o}=t===void 0?{}:t,s=`Unknown Server Error`,c=`Unknown @remix-run/router error`;return e===400?(s=`Bad Request`,i&&n&&r?c=`You made a `+i+` request to "`+n+`" but `+('did not provide a `loader` for route "'+r+`", `)+`so there is no way to handle the request.`:a===`defer-action`?c=`defer() is not supported in actions`:a===`invalid-body`&&(c=`Unable to encode submission body`)):e===403?(s=`Forbidden`,c=`Route "`+r+`" does not match URL "`+n+`"`):e===404?(s=`Not Found`,c=`No route matches URL "`+n+`"`):e===405&&(s=`Method Not Allowed`,i&&n&&r?c=`You made a `+i.toUpperCase()+` request to "`+n+`" but `+('did not provide an `action` for route "'+r+`", `)+`so there is no way to handle the request.`:i&&(c=`Invalid request method "`+i.toUpperCase()+`"`)),new Kt(e||500,s,Error(c),!0)}function Fn(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(Bn(r))return{key:n,result:r}}}function In(e){let t=typeof e==`string`?ct(e):e;return st(q({},t,{hash:``}))}function Ln(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash?!0:t.hash!==``}function Rn(e){return Un(e.result)&&Qt.has(e.result.status)}function zn(e){return e.type===X.deferred}function Q(e){return e.type===X.error}function Bn(e){return(e&&e.type)===X.redirect}function Vn(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function Hn(e){let t=e;return t&&typeof t==`object`&&typeof t.data==`object`&&typeof t.subscribe==`function`&&typeof t.cancel==`function`&&typeof t.resolveData==`function`}function Un(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Wn(e){return Zt.has(e.toLowerCase())}function $(e){return Yt.has(e.toLowerCase())}async function Gn(e,t,n,r,i){let a=Object.entries(t);for(let o=0;o<a.length;o++){let[s,c]=a[o],l=e.find(e=>e?.route.id===s);if(!l)continue;let u=r.find(e=>e.route.id===l.route.id),d=u!=null&&!hn(u,l)&&(i&&i[l.route.id])!==void 0;zn(c)&&d&&await qn(c,n,!1).then(e=>{e&&(t[s]=e)})}}async function Kn(e,t,n){for(let r=0;r<n.length;r++){let{key:i,routeId:a,controller:o}=n[r],s=t[i];e.find(e=>e?.route.id===a)&&zn(s)&&(Y(o,`Expected an AbortController for revalidating fetcher deferred result`),await qn(s,o.signal,!0).then(e=>{e&&(t[i]=e)}))}}async function qn(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:X.data,data:e.deferredData.unwrappedData}}catch(e){return{type:X.error,error:e}}return{type:X.data,data:e.deferredData.data}}}function Jn(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function Yn(e,t){let n=typeof t==`string`?ct(t).search:t.search;if(e[e.length-1].route.index&&Jn(n||``))return e[e.length-1];let r=Rt(e);return r[r.length-1]}function Xn(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 Zn(e,t){return t?{state:`loading`,location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:`loading`,location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Qn(e,t){return{state:`submitting`,location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function $n(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 er(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 tr(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 nr(e,t){try{let n=e.sessionStorage.getItem(on);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 rr(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(on,JSON.stringify(n))}catch(e){rt(!1,`Failed to save applied view transitions in sessionStorage (`+e+`).`)}}}function ir(){return ir=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ir.apply(null,arguments)}var ar=W.createContext(null),or=W.createContext(null),sr=W.createContext(null),cr=W.createContext(null),lr=W.createContext({outlet:null,matches:[],isDataRoute:!1}),ur=W.createContext(null);function dr(){return W.useContext(cr)!=null}function fr(){return!dr()&&Y(!1),W.useContext(cr).location}function pr(){return W.useContext(cr).navigationType}var mr=W.createContext(null);function hr(e){let t=W.useContext(lr).outlet;return t&&W.createElement(mr.Provider,{value:e},t)}function gr(e,t,n,r){!dr()&&Y(!1);let{navigator:i}=W.useContext(sr),{matches:a}=W.useContext(lr),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:`/`;o&&o.route;let l=fr(),u;if(t){let e=typeof t==`string`?ct(t):t;!(c===`/`||e.pathname?.startsWith(c))&&Y(!1),u=e}else u=l;let d=u.pathname||`/`,f=d;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);f=`/`+d.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let p=pt(e,{pathname:f}),m=xr(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:Ht([c,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Ht([c,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),a,n,r);return t&&m?W.createElement(cr.Provider,{value:{location:ir({pathname:`/`,search:``,hash:``,state:null,key:`default`},u),navigationType:J.Pop}},m):m}function _r(){let e=Er(),t=qt(e)?e.status+` `+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return W.createElement(W.Fragment,null,W.createElement(`h2`,null,`Unexpected Application Error!`),W.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?W.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var vr=W.createElement(_r,null),yr=class extends W.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error(`React Router caught the following error during render`,e,t)}render(){return this.state.error===void 0?this.props.children:W.createElement(lr.Provider,{value:this.props.routeContext},W.createElement(ur.Provider,{value:this.state.error,children:this.props.component}))}};function br(e){let{routeContext:t,match:n,children:r}=e,i=W.useContext(ar);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),W.createElement(lr.Provider,{value:t},r)}function xr(e,t,n,r){if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);!(e>=0)&&Y(!1),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&e[t.route.id]===void 0&&(!r||r[t.route.id]===void 0);if(t.route.lazy||i){s=!0,a=c>=0?a.slice(0,c+1):[a[0]];break}}}return a.reduceRight((e,r,i)=>{let l,u=!1,d=null,f=null;n&&(l=o&&r.route.id?o[r.route.id]:void 0,d=r.route.errorElement||vr,s&&(c<0&&i===0?(Or(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),u=!0,f=null):c===i&&(u=!0,f=r.route.hydrateFallbackElement||null)));let p=t.concat(a.slice(0,i+1)),m=()=>{let t;return t=l?d:u?f:r.route.Component?W.createElement(r.route.Component,null):r.route.element?r.route.element:e,W.createElement(br,{match:r,routeContext:{outlet:e,matches:p,isDataRoute:n!=null},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||i===0)?W.createElement(yr,{location:n.location,revalidation:n.revalidation,component:d,error:l,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):m()},null)}var Sr=function(e){return e.UseBlocker=`useBlocker`,e.UseLoaderData=`useLoaderData`,e.UseActionData=`useActionData`,e.UseRouteError=`useRouteError`,e.UseNavigation=`useNavigation`,e.UseRouteLoaderData=`useRouteLoaderData`,e.UseMatches=`useMatches`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e.UseRouteId=`useRouteId`,e}(Sr||{});function Cr(e){let t=W.useContext(or);return!t&&Y(!1),t}function wr(e){let t=W.useContext(lr);return!t&&Y(!1),t}function Tr(e){let t=wr(e),n=t.matches[t.matches.length-1];return!n.route.id&&Y(!1),n.route.id}function Er(){let e=W.useContext(ur),t=Cr(Sr.UseRouteError),n=Tr(Sr.UseRouteError);return e===void 0?t.errors?.[n]:e}var Dr={};function Or(e,t,n){!t&&!Dr[e]&&(Dr[e]=!0)}var kr=(e,t,n)=>(``+t+("You can use the `"+e+"` future flag to opt-in early. ")+(`For more information, see `+n+`.`),void 0);function Ar(e,t){e?.v7_startTransition===void 0&&kr(`v7_startTransition`,"React Router will begin wrapping state updates in `React.startTransition` in v7",`https://reactrouter.com/v6/upgrading/future#v7_starttransition`),e?.v7_relativeSplatPath===void 0&&(!t||t.v7_relativeSplatPath===void 0)&&kr(`v7_relativeSplatPath`,`Relative route resolution within Splat routes is changing in v7`,`https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath`),t&&(t.v7_fetcherPersist===void 0&&kr(`v7_fetcherPersist`,`The persistence behavior of fetchers is changing in v7`,`https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist`),t.v7_normalizeFormMethod===void 0&&kr(`v7_normalizeFormMethod`,"Casing of `formMethod` fields is being normalized to uppercase in v7",`https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod`),t.v7_partialHydration===void 0&&kr(`v7_partialHydration`,"`RouterProvider` hydration behavior is changing in v7",`https://reactrouter.com/v6/upgrading/future#v7_partialhydration`),t.v7_skipActionErrorRevalidation===void 0&&kr(`v7_skipActionErrorRevalidation`,"The revalidation behavior after 4xx/5xx `action` responses is changing in v7",`https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation`))}function jr(e){return hr(e.context)}function Mr(e){Y(!1)}function Nr(e){let{basename:t=`/`,children:n=null,location:r,navigationType:i=J.Pop,navigator:a,static:o=!1,future:s}=e;dr()&&Y(!1);let c=t.replace(/^\/*/,`/`),l=W.useMemo(()=>({basename:c,navigator:a,static:o,future:ir({v7_relativeSplatPath:!1},s)}),[c,s,a,o]);typeof r==`string`&&(r=ct(r));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`}=r,h=W.useMemo(()=>{let e=Mt(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m},navigationType:i}},[c,u,d,f,p,m,i]);return h==null?null:W.createElement(sr.Provider,{value:l},W.createElement(cr.Provider,{children:n,value:h}))}var Pr=function(e){return e[e.pending=0]=`pending`,e[e.success=1]=`success`,e[e.error=2]=`error`,e}(Pr||{});new Promise(()=>{}),W.Component;function Fr(e,t){t===void 0&&(t=[]);let n=[];return W.Children.forEach(e,(e,r)=>{if(!W.isValidElement(e))return;let i=[...t,r];if(e.type===W.Fragment){n.push.apply(n,Fr(e.props.children,i));return}e.type!==Mr&&Y(!1),!(!e.props.index||!e.props.children)&&Y(!1);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Fr(e.props.children,i)),n.push(a)}),n}function Ir(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:W.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:W.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:W.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function Lr(){return Lr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lr.apply(null,arguments)}var Rr=`6`;try{window.__reactRouterVersion=Rr}catch{}function zr(e,t){return sn({basename:t?.basename,future:Lr({},t?.future,{v7_prependBasename:!0}),history:nt({window:t?.window}),hydrationData:t?.hydrationData||Br(),routes:e,mapRouteProperties:Ir,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window}).initialize()}function Br(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e=Lr({},e,{errors:Vr(e.errors)})),e}function Vr(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 Kt(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(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 Hr=W.createContext({isTransitioning:!1}),Ur=W.createContext(new Map),Wr=W.startTransition,Gr=et.flushSync;function Kr(e){Wr?Wr(e):e()}function qr(e){Gr?Gr(e):e()}var Jr=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function Yr(e){let{fallbackElement:t,router:n,future:r}=e,[i,a]=W.useState(n.state),[o,s]=W.useState(),[c,l]=W.useState({isTransitioning:!1}),[u,d]=W.useState(),[f,p]=W.useState(),[m,h]=W.useState(),g=W.useRef(new Map),{v7_startTransition:_}=r||{},v=W.useCallback(e=>{_?Kr(e):e()},[_]),y=W.useCallback((e,t)=>{let{deletedFetchers:r,flushSync:i,viewTransitionOpts:o}=t;e.fetchers.forEach((e,t)=>{e.data!==void 0&&g.current.set(t,e.data)}),r.forEach(e=>g.current.delete(e));let c=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!=`function`;if(!o||c){i?qr(()=>a(e)):v(()=>a(e));return}if(i){qr(()=>{f&&(u&&u.resolve(),f.skipTransition()),l({isTransitioning:!0,flushSync:!0,currentLocation:o.currentLocation,nextLocation:o.nextLocation})});let t=n.window.document.startViewTransition(()=>{qr(()=>a(e))});t.finished.finally(()=>{qr(()=>{d(void 0),p(void 0),s(void 0),l({isTransitioning:!1})})}),qr(()=>p(t));return}f?(u&&u.resolve(),f.skipTransition(),h({state:e,currentLocation:o.currentLocation,nextLocation:o.nextLocation})):(s(e),l({isTransitioning:!0,flushSync:!1,currentLocation:o.currentLocation,nextLocation:o.nextLocation}))},[n.window,f,u,g,v]);W.useLayoutEffect(()=>n.subscribe(y),[n,y]),W.useEffect(()=>{c.isTransitioning&&!c.flushSync&&d(new Jr)},[c]),W.useEffect(()=>{if(u&&o&&n.window){let e=o,t=u.promise,r=n.window.document.startViewTransition(async()=>{v(()=>a(e)),await t});r.finished.finally(()=>{d(void 0),p(void 0),s(void 0),l({isTransitioning:!1})}),p(r)}},[v,o,u,n.window]),W.useEffect(()=>{u&&o&&i.location.key===o.location.key&&u.resolve()},[u,f,i.location,o]),W.useEffect(()=>{!c.isTransitioning&&m&&(s(m.state),l({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),h(void 0))},[c.isTransitioning,m]),W.useEffect(()=>{},[]);let b=W.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:e=>n.navigate(e),push:(e,t,r)=>n.navigate(e,{state:t,preventScrollReset:r?.preventScrollReset}),replace:(e,t,r)=>n.navigate(e,{replace:!0,state:t,preventScrollReset:r?.preventScrollReset})}),[n]),x=n.basename||`/`,S=W.useMemo(()=>({router:n,navigator:b,static:!1,basename:x}),[n,b,x]),C=W.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return W.useEffect(()=>Ar(r,n.future),[r,n.future]),W.createElement(W.Fragment,null,W.createElement(ar.Provider,{value:S},W.createElement(or.Provider,{value:i},W.createElement(Ur.Provider,{value:g.current},W.createElement(Hr.Provider,{value:c},W.createElement(Nr,{basename:x,location:i.location,navigationType:i.historyAction,navigator:b,future:C},i.initialized||n.future.v7_partialHydration?W.createElement(Xr,{routes:n.routes,future:n.future,state:i}):t))))),null)}var Xr=W.memo(Zr);function Zr(e){let{routes:t,future:n,state:r}=e;return gr(t,void 0,r,n)}typeof window<`u`&&window.document!==void 0&&window.document.createElement;var Qr;(function(e){e.UseScrollRestoration=`useScrollRestoration`,e.UseSubmit=`useSubmit`,e.UseSubmitFetcher=`useSubmitFetcher`,e.UseFetcher=`useFetcher`,e.useViewTransitionState=`useViewTransitionState`})(Qr||={});var $r;(function(e){e.UseFetcher=`useFetcher`,e.UseFetchers=`useFetchers`,e.UseScrollRestoration=`useScrollRestoration`})($r||={});function ei(){return ei=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ei.apply(null,arguments)}var ti=[`shift`,`alt`,`meta`,`mod`,`ctrl`],ni={esc:`escape`,return:`enter`,".":`period`,",":`comma`,"-":`slash`," ":`space`,"`":`backquote`,"#":`backslash`,"+":`bracketright`,ShiftLeft:`shift`,ShiftRight:`shift`,AltLeft:`alt`,AltRight:`alt`,MetaLeft:`meta`,MetaRight:`meta`,OSLeft:`meta`,OSRight:`meta`,ControlLeft:`ctrl`,ControlRight:`ctrl`};function ri(e){return(e&&ni[e]||e||``).trim().toLowerCase().replace(/key|digit|numpad|arrow/,``)}function ii(e){return ti.includes(e)}function ai(e,t){return t===void 0&&(t=`,`),e.split(t)}function oi(e,t,n){t===void 0&&(t=`+`);var r=e.toLocaleLowerCase().split(t).map(function(e){return ri(e)}),i={alt:r.includes(`alt`),ctrl:r.includes(`ctrl`)||r.includes(`control`),shift:r.includes(`shift`),meta:r.includes(`meta`),mod:r.includes(`mod`)},a=r.filter(function(e){return!ti.includes(e)});return ei({},i,{keys:a,description:n,hotkey:e})}(function(){typeof document<`u`&&(document.addEventListener(`keydown`,function(e){e.key!==void 0&&ui([ri(e.key),ri(e.code)])}),document.addEventListener(`keyup`,function(e){e.key!==void 0&&di([ri(e.key),ri(e.code)])})),typeof window<`u`&&window.addEventListener(`blur`,function(){si.clear()})})();var si=new Set;function ci(e){return Array.isArray(e)}function li(e,t){return t===void 0&&(t=`,`),(ci(e)?e:e.split(t)).every(function(e){return si.has(e.trim().toLowerCase())})}function ui(e){var t=Array.isArray(e)?e:[e];si.has(`meta`)&&si.forEach(function(e){return!ii(e)&&si.delete(e.toLowerCase())}),t.forEach(function(e){return si.add(e.toLowerCase())})}function di(e){e===`meta`?si.clear():(Array.isArray(e)?e:[e]).forEach(function(e){return si.delete(e.toLowerCase())})}function fi(e,t,n){(typeof n==`function`&&n(e,t)||n===!0)&&e.preventDefault()}function pi(e,t,n){return typeof n==`function`?n(e,t):n===!0||n===void 0}function mi(e){return hi(e,[`input`,`textarea`,`select`])}function hi(e,t){t===void 0&&(t=!1);var n=e.target,r=e.composed,i=null;return i=gi(n)&&r?e.composedPath()[0]&&e.composedPath()[0].tagName:n&&n.tagName,ci(t)?!!(i&&t&&t.some(function(e){return e.toLowerCase()===i?.toLowerCase()})):!!(i&&t&&t)}function gi(e){return!!e.tagName&&!e.tagName.startsWith(`-`)&&e.tagName.includes(`-`)}function _i(e,t){return e.length===0&&t?(console.warn(`A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>`),!0):t?e.some(function(e){return t.includes(e)})||e.includes(`*`):!0}var vi=function(e,t,n){n===void 0&&(n=!1);var r=t.alt,i=t.meta,a=t.mod,o=t.shift,s=t.ctrl,c=t.keys,l=e.key,u=e.code,d=e.ctrlKey,f=e.metaKey,p=e.shiftKey,m=e.altKey,h=ri(u),g=l.toLowerCase();if(!(c!=null&&c.includes(h))&&!(c!=null&&c.includes(g))&&![`ctrl`,`control`,`unknown`,`meta`,`alt`,`shift`,`os`].includes(h))return!1;if(!n){if(r===!m&&g!==`alt`||o===!p&&g!==`shift`)return!1;if(a){if(!f&&!d)return!1}else if(i===!f&&g!==`meta`&&g!==`os`||s===!d&&g!==`ctrl`&&g!==`control`)return!1}return c&&c.length===1&&(c.includes(g)||c.includes(h))?!0:c?li(c):!c},yi=Ge(void 0),bi=function(){return Je(yi)};function xi(e,t){return e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,r){return n&&xi(e[r],t[r])},!0):e===t}var Si=Ge({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),Ci=function(){return Je(Si)};function wi(e){var t=Ze(void 0);return xi(t.current,e)||(t.current=e),t.current}var Ti=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},Ei=typeof window<`u`?Ye:K;function Di(e,t,n,r){var i=Qe(null),a=i[0],o=i[1],s=Ze(!1),c=n instanceof Array?r instanceof Array?void 0:r:n,l=ci(e)?e.join(c?.splitKey):e,u=n instanceof Array?n:r instanceof Array?r:void 0,d=qe(t,u??[]),f=Ze(d);u?f.current=d:f.current=t;var p=wi(c),m=Ci().enabledScopes,h=bi();return Ei(function(){if(!(p?.enabled===!1||!_i(m,p?.scopes))){var e=function(e,t){var n;if(t===void 0&&(t=!1),!(mi(e)&&!hi(e,p?.enableOnFormTags))){if(a!==null){var r=a.getRootNode();if((r instanceof Document||r instanceof ShadowRoot)&&r.activeElement!==a&&!a.contains(r.activeElement)){Ti(e);return}}(n=e.target)!=null&&n.isContentEditable&&!(p!=null&&p.enableOnContentEditable)||ai(l,p?.splitKey).forEach(function(n){var r,i=oi(n,p?.combinationKey);if(vi(e,i,p?.ignoreModifiers)||(r=i.keys)!=null&&r.includes(`*`)){if(p!=null&&p.ignoreEventWhen!=null&&p.ignoreEventWhen(e)||t&&s.current)return;if(fi(e,i,p?.preventDefault),!pi(e,i,p?.enabled)){Ti(e);return}f.current(e,i),t||(s.current=!0)}})}},t=function(t){t.key!==void 0&&(ui(ri(t.code)),(p?.keydown===void 0&&p?.keyup!==!0||p!=null&&p.keydown)&&e(t))},n=function(t){t.key!==void 0&&(di(ri(t.code)),s.current=!1,p!=null&&p.keyup&&e(t,!0))},r=a||c?.document||document;return r.addEventListener(`keyup`,n,c?.eventListenerOptions),r.addEventListener(`keydown`,t,c?.eventListenerOptions),h&&ai(l,p?.splitKey).forEach(function(e){return h.addHotkey(oi(e,p?.combinationKey,p?.description))}),function(){r.removeEventListener(`keyup`,n,c?.eventListenerOptions),r.removeEventListener(`keydown`,t,c?.eventListenerOptions),h&&ai(l,p?.splitKey).forEach(function(e){return h.removeHotkey(oi(e,p?.combinationKey,p?.description))})}}},[a,l,p,m]),o}var Oi=Ge(null),ki={didCatch:!1,error:null},Ai=class extends He{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=ki}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){let{error:e}=this.state;if(e!==null){var t,n,r=[...arguments];(t=(n=this.props).onReset)==null||t.call(n,{args:r,reason:`imperative-api`}),this.setState(ki)}}componentDidCatch(e,t){var n,r;(n=(r=this.props).onError)==null||n.call(r,e,t)}componentDidUpdate(e,t){let{didCatch:n}=this.state,{resetKeys:r}=this.props;if(n&&t.error!==null&&ji(e.resetKeys,r)){var i,a;(i=(a=this.props).onReset)==null||i.call(a,{next:r,prev:e.resetKeys,reason:`keys`}),this.setState(ki)}}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:i,error:a}=this.state,o=e;if(i){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof t==`function`)o=t(e);else if(n)o=Ke(n,e);else if(r!==void 0)o=r;else throw a}return Ke(Oi.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}};function ji(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`9fc0b26b-1946-5965-a3ff-8893e632112b`)}catch{}})();function Mi(){return typeof document>`u`?`/`:document.querySelector(`base`)?.getAttribute(`href`)||`/`}var Ni=null,Pi=new Set;function Fi(e){Ni=e;for(let e of Pi)e()}function Ii(){return Ni}function Li(e){return Pi.add(e),()=>{Pi.delete(e)}}var Ri=`ph-pglite-backup::`,zi=`ph:pglite-backups`,Bi=720*60*60*1e3,Vi={16:async()=>{let[{PGlite:e},{pgDump:t}]=await Promise.all([L(()=>import(`./dist-B47ain9H.js`),__vite__mapDeps([0,1,2,3,4,5,6])),L(()=>import(`./pg_dump-BL-IQ0O5.js`),__vite__mapDeps([7,1,2]))]);return async n=>{let r=new e(`idb://${n.replace(/^\/pglite\//,``)}`);try{return await r.waitReady,await(await t({pg:r})).text()}finally{await r.close()}}}};function Hi(e,t=15e3){return new Promise((n,r)=>{let i=indexedDB.deleteDatabase(e),a=!1,o=e=>{a||(a=!0,e())},s=setTimeout(()=>o(()=>r(Error(`IDB delete timed out for ${e} after ${t}ms`))),t);i.onsuccess=()=>o(()=>{clearTimeout(s),n()}),i.onerror=()=>o(()=>{clearTimeout(s),r(Ie(i,`IDB delete failed for ${e}`))})})}async function Ui(e){let t=await je(e,21,Ne);try{await new Promise((n,r)=>{let i=t.transaction(Me,`readwrite`);i.oncomplete=()=>n(),i.onerror=()=>r(Ie(i,`FILE_DATA clear failed for ${e}`)),i.onabort=()=>r(Ie(i,`FILE_DATA clear aborted for ${e}`)),i.objectStore(Me).clear()})}finally{t.close()}}async function Wi(e,t){let n=await je(e,21,Ne);try{let r=await je(t,21,Ne);try{let i=n.transaction(Me,`readonly`).objectStore(Me),a=await new Promise((t,n)=>{let r=[],a=i.openCursor();a.onerror=()=>n(Ie(a,`FILE_DATA read cursor failed for ${e}`)),a.onsuccess=()=>{let e=a.result;if(!e)return t(r);r.push({key:e.key,value:e.value}),e.continue()}});await new Promise((e,n)=>{let i=r.transaction(Me,`readwrite`);i.oncomplete=()=>e(),i.onerror=()=>n(Ie(i,`FILE_DATA write failed for ${t}`)),i.onabort=()=>n(Ie(i,`FILE_DATA write aborted for ${t}`));let o=i.objectStore(Me);o.clear();for(let{key:e,value:t}of a)o.put(t,e)})}finally{r.close()}}finally{n.close()}}function Gi(){try{let e=localStorage.getItem(zi);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function Ki(e){try{localStorage.setItem(zi,JSON.stringify(e))}catch{}}function qi(e){Ki([...Gi(),e])}function Ji(e){Ki(Gi().filter(t=>t.name!==e))}async function Yi(){let e=Date.now()-Bi,t=[];for(let n of Gi()){if(n.createdAt>=e){t.push(n);continue}try{await Hi(n.name)}catch(e){console.warn(`Failed to delete expired pglite backup ${n.name}`,e),t.push(n)}}Ki(t)}function Xi(e,t){Fi({idbName:e,phase:t})}async function Zi(e){let t=await ke(e);if(t===null||t===17)return;let n=Vi[t];if(!n)throw Error(`Unsupported legacy PGlite data dir: PG_VERSION=${t} for ${e}`);let r=`${Ri}${e}::${new Date().toISOString()}`,i={name:r,idbName:e,createdAt:Date.now()};Xi(e,`clone`),await Wi(e,r),qi(i);let a;try{Xi(e,`dump`),a=await(await n())(e)}catch(e){throw await Hi(r).catch(()=>{}),Ji(r),e}try{await Ui(e),Xi(e,`restore`);let t=new Ce(`idb://${e.replace(/^\/pglite\//,``)}`,{relaxedDurability:!1});try{await t.waitReady,console.info(`[pglite-migration] Dump preamble (first 500 chars):\n${a.slice(0,500)}`);try{await t.exec(`SET standard_conforming_strings = off;`)}catch(e){console.warn(`[pglite-migration] Could not force standard_conforming_strings=off`,e)}try{await t.exec(a)}catch(t){throw Qi(e,a,t),t}}finally{await t.close()}}catch(t){throw await $i(e,r,t),t}}function Qi(e,t,n){let r=n,i=typeof r.position==`string`?parseInt(r.position,10):typeof r.position==`number`?r.position:NaN;if(console.error(`[pglite-migration] Restore failed for ${e}`,{message:r.message,code:r.code,severity:r.severity,detail:r.detail,where:r.where,position:r.position,sqlLength:t.length}),Number.isFinite(i)&&i>0){let e=i-1,n=Math.max(0,e-200),r=Math.min(t.length,e+200),a=t.slice(n,e),o=t.slice(e,e+1),s=t.slice(e+1,r);console.error(`[pglite-migration] SQL context around position ${i}:\n${a}»${o}«${s}`);let c=t.lastIndexOf(`
|
|
4
4
|
`,e)+1,l=t.indexOf(`
|
|
5
5
|
`,e),u=t.slice(c,l===-1?t.length:l);console.error(`[pglite-migration] Failing line (truncated to 500 chars):\n${u.slice(0,500)}`)}else console.error(`[pglite-migration] No position info. First 2000 chars of dump:\n${t.slice(0,2e3)}`)}async function $i(e,t,n){try{await Ui(e).catch(()=>{}),await Wi(t,e)}catch(t){console.error(`PGlite migration failed AND rollback failed for ${e}. Primary error:`,n,`Rollback error:`,t);return}await Hi(t).catch(()=>{}),Ji(t)}async function ea(){for(let e of Pe)await Zi(e);Fi(null)}async function ta(){if(Yi().catch(e=>console.warn(`PGlite backup janitor failed`,e)),!(typeof navigator<`u`&&`locks`in navigator&&typeof navigator.locks.request==`function`)){await ea();return}await navigator.locks.request(`ph-pglite-migration`,{mode:`exclusive`},async()=>{await ea()})}var na=`${V.routerBasename}:acceptedCookies`,ra=new Set,ia=aa();function aa(){try{let e=localStorage.getItem(na);return e?JSON.parse(e):{analytics:!1,marketing:!1,functional:!1}}catch{return{analytics:!1,marketing:!1,functional:!1}}}function oa(){return ia}function sa(e){ia=e(ia),localStorage.setItem(na,JSON.stringify(ia)),ra.forEach(e=>e())}function ca(e){return ra.add(e),()=>ra.delete(e)}var la=()=>[$e(ca,oa,oa),sa],ua=[],da;function fa(e){console.warn(`[useOpenPanelAnalytics] track failed:`,e)}function pa(e,t,n){try{Promise.resolve(e.track(t,n)).catch(e=>(da??fa)(e))}catch(e){(da??fa)(e)}}function ma(e,t){da=t;let n=ua.splice(0,ua.length);for(let[t,r]of n)pa(e,t,r)}function ha(){ua.length=0,da=void 0}var ga;async function _a(e){if(!e.clientId)return;if(ga)return ga;let{OpenPanel:t}=await L(async()=>{let{OpenPanel:e}=await import(`./dist-xKhBcQ062.js`);return{OpenPanel:e}},__vite__mapDeps([8,2]));return ga=new t({clientId:e.clientId,...e.apiUrl?{apiUrl:e.apiUrl}:{},trackScreenViews:!0,trackOutgoingLinks:!0}),ga.setGlobalProperties({app:`connect`}),ma(ga),ga}function va(){ga=void 0,ha()}var ya=[{documentType:`powerhouse/document-drive`,actionTypes:[`ADD_FOLDER`,`DELETE_NODE`,`ADD_FILE`,`UPDATE_FILE`,`COPY_NODE`,`MOVE_NODE`,`SET_DRIVE_NAME`,`SET_DRIVE_ICON`]},{documentType:`powerhouse/document-model`,actionTypes:[`SET_MODEL_NAME`,`SET_MODEL_ID`,`ADD_MODULE`,`DELETE_MODULE`,`ADD_OPERATION`,`DELETE_OPERATION`]},{documentType:`powerhouse/reactor-drive`,actionTypes:[`ADD_FOLDER`,`REMOVE_FOLDER`,`UPDATE_FOLDER`]}],ba=_e(xe({documentType:be().min(1),actionTypes:_e(be().min(1)).min(1),alias:be().optional()}).strict()).readonly();function xa(e=ya){let t=ba.safeParse(e);if(!t.success)throw Error(`Invalid OpenPanel events.json: ${t.error.message}`);let n=t.data,r=new Map;for(let e of n){let t=r.get(e.documentType);t||(t=new Map,r.set(e.documentType,t));for(let n of e.actionTypes){if(t.has(n))throw Error(`Duplicate OpenPanel event mapping for ${e.documentType}/${n}`);t.set(n,e)}}return{mappings:n,lookupMap:r}}var{mappings:Sa,lookupMap:Ca}=xa(),wa=Sa,Ta=Ca;function Ea(e){return e.toLowerCase().replace(/\//g,`.`).replace(/[^a-z0-9._-]/g,``)}function Da(e,t){return e.alias?e.alias:`${Ea(t.context.documentType)}.${t.operation.action.type.toLowerCase()}`}function Oa(e){return{documentType:e.context.documentType,actionType:e.operation.action.type,documentId:e.context.documentId,scope:e.context.scope,branch:e.context.branch}}var ka=class{constructor(e,t,n=e=>console.warn(`[OpenPanelProcessor] Error tracking event:`,e)){this.client=e,this.lookupMap=t,this.onError=n}async onOperations(e){for(let t of e){let e=this.lookupMap.get(t.context.documentType);if(!e)continue;let n=e.get(t.operation.action.type);if(!n)continue;let r=Da(n,t),i=Oa(t);try{await this.client.track(r,i)}catch(e){this.onError(e,t)}}}onDisconnect(){return this.client.flush?.(),Promise.resolve()}};function Aa(e){return function(t){let n=Array.from(e.events.lookupMap.keys());return[{processor:new ka(e.client,e.events.lookupMap,e.onError),filter:{documentType:n},startFrom:e.startFrom??`current`}]}}function ja(){if(typeof window>`u`)return!1;try{let e=new URLSearchParams(window.location.search).get(`embed`);return e!==null&&e!==`0`&&e!==`false`}catch{return!1}}function Ma(){return ja()}var Na=`${V.routerBasename}:display-cookie-banner`,Pa=new Set,Fa=Ia();function Ia(){if(ja())return!1;try{return localStorage.getItem(Na)!==`false`}catch(e){return console.error(e),!0}}function La(){return Fa}function Ra(e){Fa=e,localStorage.setItem(Na,JSON.stringify(e))}function za(e){return Pa.add(e),()=>Pa.delete(e)}var Ba=()=>[$e(za,La,La),Ra],Va=[];function Ha(){let e=y();return $e(t=>e?.subscribeFailed(t)??(()=>{}),()=>e?.getFailedInstallations()??Va)}var Ua=R([`sentry`]),Wa=!1;async function Ga(){return await L(()=>import(`./esm-C1l-NYkd.js`),__vite__mapDeps([9,10,1]))}async function Ka(){let e=await Ga(),t=[e.httpClientIntegration(),e.extraErrorDataIntegration({depth:5}),e.replayIntegration(),e.captureConsoleIntegration({levels:[`error`]})];V.sentry.tracing&&t.push(e.reactRouterV6BrowserTracingIntegration({useEffect:Ve.useEffect,useLocation:fr,useNavigationType:pr,createRoutesFromChildren:Fr,matchRoutes:pt})),e.init({release:V.sentry.release,dsn:V.sentry.dsn??void 0,environment:V.sentry.env,integrations:t,ignoreErrors:[`User is not allowed to create files`,`User is not allowed to move documents`,`The user aborted a request.`],sendDefaultPii:!0,tracesSampleRate:1,replaysSessionSampleRate:.1,replaysOnErrorSampleRate:1,beforeSend(e,t){let n=t.originalException;return n instanceof TypeError&&n.message.includes(`Failed to fetch`)&&!navigator.onLine?null:e}}),Wa=!0}async function qa(){if(Wa)return(await Ga()).getClient()?.close()}function Ja(){let[e]=la(),{analytics:t}=e;K(()=>{if(!t){qa().catch(e=>Ua.error(`@error`,e));return}Wa||V.sentry.dsn===null||V.sentry.dsn===void 0||V.sentry.dsn===``||Ka().catch(e=>Ua.error(`@error`,e))},[t])}var Ya=[];function Xa(){let e=y(),t=Ze(Ya);return $e(t=>e?.subscribePending(t)??(()=>{}),qe(()=>{if(!e)return Ya;let n=e.getPendingInstallations()??Ya,r=t.current;return n===r||n.length===r.length&&n.every((e,t)=>e===r[t])?r:(t.current=n,n)},[e]))}var Za=e=>{let{undo:t,redo:n,canRedo:r,canUndo:i}=e,a=window.navigator.userAgent.includes(`Mac`),o=`ctrl+z`,s=`ctrl+y`;a&&(o=`mod+z`,s=`mod+shift+z`),Di(o,e=>{e.preventDefault(),i&&t()},{},[i,t]),Di(s,e=>{e.preventDefault(),r&&n()},{},[r,n])},Qa=250,$a={clone:`Backing up local database…`,dump:`Exporting data from previous version…`,restore:`Restoring data into the new database…`},eo=()=>{let e=$e(Li,Ii,()=>null);return e?H(`div`,{className:`absolute inset-0 z-20 flex items-center justify-center`,children:U(`div`,{className:`rounded-lg bg-card/90 px-6 py-4 text-sm text-foreground shadow-lg`,children:[H(`div`,{className:`font-medium`,children:`Upgrading local database…`}),H(`div`,{className:`text-foreground`,children:$a[e.phase]})]})}):null},to=({delay:e=Qa})=>{let t=typeof window>`u`,n=typeof document<`u`&&document.body.getAttribute(`data-show-loader`)===`true`;t||ie();let[r,i]=Qe(!e||n);return K(()=>{let t=setTimeout(()=>{i(!0)},e);return()=>clearTimeout(t)},[]),U(`div`,{className:`skeleton-loader absolute inset-0 z-10 flex items-center justify-center ${r?``:`hidden`}`,children:[H(`div`,{className:`animate-pulse overflow-hidden rounded-full shadow-lg`,children:H(ce,{})}),t?H(`script`,{dangerouslySetInnerHTML:{__html:`setTimeout(() => {
|
|
@@ -11,5 +11,5 @@ import{$ as e,A as t,At as n,Ct as r,G as i,H as a,I as o,It as s,Kt as c,L as l
|
|
|
11
11
|
const basePath = href || '/';
|
|
12
12
|
if (window.location.pathname === basePath) {
|
|
13
13
|
document.querySelector('.home-screen')?.classList.remove('hidden')
|
|
14
|
-
}`}}):null,e.children?null:H(to,{}),H(eo,{})]})},ro=R([`Connect`]);function io(e){return`fallbackRender`in e}function ao(){return null}function oo({message:e=`Something went wrong`}){return H(`div`,{className:`text-center`,children:e})}function so({error:e,resetErrorBoundary:t}){let n=e instanceof Error?e.message:String(e),r=e instanceof Error?e.stack??String(e.cause):JSON.stringify(e,null,2);return H(`div`,{className:`z-10 mx-auto flex max-w-[80%] flex-1 items-center justify-center p-6`,children:U(`div`,{className:`w-full max-w-lg rounded-lg border border-border bg-background p-6 shadow-sm`,children:[U(`div`,{className:`mb-3 flex items-center gap-2`,children:[H(we,{name:`Error`,className:`size-5 shrink-0`}),H(`h1`,{className:`text-lg font-semibold`,children:`Something went wrong`})]}),H(`p`,{className:`mb-4 text-sm text-foreground`,children:n}),r!==`{}`&&U(`details`,{className:`group`,children:[H(`summary`,{className:`cursor-pointer text-sm font-medium text-foreground underline select-none hover:hover-effect`,children:`Show details`}),H(`pre`,{className:`mt-2 max-h-48 overflow-auto rounded-sm bg-muted p-3 text-xs`,children:r})]}),H(M,{type:`button`,onClick:t,className:`mt-4 px-3 py-1.5 text-base font-medium`,children:`Try again`})]})})}function co({error:e}){return H(`div`,{className:`flex size-full items-center justify-center`,children:H(`h3`,{className:`text-lg font-semibold`,children:e instanceof Error?e.message:String(e)})})}function lo(e,t){switch(e){case`silent`:return ao;case`text`:return()=>H(oo,{message:t});case`detailed`:return so;default:return co}}function uo(e){let{children:t,onError:n,resetKeys:r,loggerContext:i}=e;return H(Ai,{fallbackRender:io(e)?e.fallbackRender:lo(e.variant,e.fallbackMessage),onError:(e,t)=>{if(e.message.includes(`Failed to fetch dynamically imported module`)&&e.message.includes(`node_modules/.vite`)){console.error(e),console.log(`Outdated chunk detected, reloading page...`),window.location.reload();return}(i?R(i):ro).error(`@error @info`,e,t),n?.(e,t)},resetKeys:r,children:t})}function fo(...e){window.dataLayer?.push(...e)}var po=()=>{let e=V.gaTrackingId,[{analytics:t}]=la(),n=e&&t;return K(()=>{if(n){let t=document.createElement(`script`);return t.src=`https://www.googletagmanager.com/gtag/js?id=${e}`,t.async=!0,document.head.appendChild(t),window.dataLayer=window.dataLayer||[],fo(`js`,new Date),fo(`config`,e),()=>{document.head.removeChild(t)}}},[n,e]),null};function mo(e){let{credential:t,...n}=e,r={address:n.address,did:n.did,networkId:n.networkId,chainId:n.chainId,caip2:`${n.networkId}:${n.chainId}`};return n.ens?.name!=null&&(r.ensName=n.ens.name),n.ens?.avatarUrl!=null&&(r.ensAvatar=n.ens.avatarUrl),n.profile?.username!=null&&(r.username=n.profile.username),n.profile?.userImage!=null&&(r.userImage=n.profile.userImage),n.profile?.documentId!=null&&(r.profileDocumentId=n.profile.documentId),n.profile?.createdAt!=null&&(r.profileCreatedAt=n.profile.createdAt),r}function ho(e){let t=e.profile?.userImage??e.ens?.avatarUrl,n=e.ens?.name??e.profile?.username;return{profileId:e.address,...t==null?{}:{avatar:t},...n==null?{}:{firstName:n},properties:mo(e)}}function go(){let[{analytics:e}]=la(),t=g(),n=p(),[r,i]=Qe(),a=Ze(void 0),o=e&&!!V.openPanel.clientId,s=n?.reactorModule?.processorManager;return K(()=>{if(!o)return;let e=!1,t=()=>e;return(async()=>{let e;try{e=await _a(V.openPanel)}catch(e){console.warn(`[OpenPanel] Failed to build client:`,e);return}if(!(t()||!e)&&(i(e),window.openPanel=e,V.openPanel.trackOperations&&s))try{await s.registerFactory(`openpanel`,Aa({client:e,events:{mappings:wa,lookupMap:Ta},startFrom:`current`})),t()&&await s.unregisterFactory(`openpanel`).catch(e=>console.warn(`[OpenPanel] Failed to unregister factory after cancellation:`,e))}catch(e){console.warn(`[OpenPanel] Failed to register processor factory:`,e)}})(),()=>{e=!0,a.current=void 0,V.openPanel.trackOperations&&s&&s.unregisterFactory(`openpanel`).catch(e=>console.warn(`[OpenPanel] Failed to unregister processor factory:`,e)),va(),window.openPanel=void 0,i(void 0)}},[o,s]),K(()=>{if(!o||!r)return;let e=a.current;if(a.current=t,!e&&t)try{r.identify(ho(t))}catch(e){console.warn(`[OpenPanel] Failed to identify user:`,e)}else if(e&&!t)try{r.clear()}catch(e){console.warn(`[OpenPanel] Failed to clear user:`,e)}},[r,t,o]),null}function _o(){let[e]=re(),t=S(e.header.id);return Xe(()=>async()=>{},[]),qe(()=>{d(t)},[t]),H(`div`,{id:`document-editor-container`,className:`flex-1`,"data-document-type":e.header.documentType,children:H(jo,{document:e})})}function vo(e){let[t,n]=Qe(!1);if(K(()=>{setTimeout(()=>{n(!0)},e.loadingTimeout??200)},[e]),!t)return null;let{customEditorLoader:r,...i}=e;return r?H(Be,{children:r}):H(ue,{...i})}function yo(){let[e]=T(),t=m(),n=i(e?.header.meta?.preferredEditor),r=_();if(!e)return H(vo,{});let a=n?.Component??r?.Component??Fe.Component;if(!a)throw Error(`No app component found`);return H(uo,{variant:`detailed`,resetKeys:[e.header.id],loggerContext:[`Connect`,`App`],children:H(We,{fallback:H(vo,{}),children:H(me,{className:`flex h-full flex-col overflow-auto`,children:H(a,{children:t?H(_o,{}):null})})})})}var bo=({children:e})=>(Ja(),e),xo={"no-registry":`No package registry is configured.`,"not-in-registry":`No matching package found in the registry.`,"registry-error":`Couldn't reach the package registry.`,"install-failed":`Package failed to install.`,dismissed:`Installation was dismissed.`};function So(e){return e!==`no-registry`}function Co(){let e=Ha(),[t,n]=Qe(!1);return e.length===0?null:U(Be,{children:[U(`div`,{className:`flex items-center justify-between gap-3 bg-warning/10 px-4 py-2 text-sm text-warning`,children:[H(`span`,{children:e.length===1?`1 document type couldn't load (missing model).`:`${e.length} document types couldn't load (missing models).`}),H(`button`,{type:`button`,onClick:()=>n(!0),className:`rounded-md border border-warning bg-background px-3 py-1 text-warning hover:hover-effect`,children:`View`})]}),H(wo,{open:t,failed:e,onClose:()=>n(!1)})]})}function wo(e){let{open:t,failed:n,onClose:r}=e,i=y(),[a,o]=Qe(()=>new Set);async function s(e){if(i){o(t=>new Set(t).add(e));try{await i.retryInstallation(e)}finally{o(t=>{let n=new Set(t);return n.delete(e),n})}}}return H(A,{open:t,onOpenChange:e=>{e||r()},contentProps:{className:`rounded-3xl`},children:U(`div`,{className:`w-[520px] max-w-[90vw] bg-background p-6`,children:[H(`div`,{className:`border-b border-border pb-2 text-2xl font-bold text-foreground`,children:`Missing document models`}),H(`div`,{className:`my-4 text-sm text-foreground`,children:`The following document types couldn't be loaded. Documents using them won't display until the underlying package is installed.`}),n.length===0?H(`div`,{className:`rounded-xl bg-background p-4 text-sm text-foreground`,children:`No outstanding failures.`}):H(`div`,{className:`flex max-h-[60vh] flex-col gap-3 overflow-y-auto`,children:n.map(e=>{let t=a.has(e.documentType),n=!So(e.reason)||t;return U(`div`,{className:`rounded-xl bg-background p-4`,children:[H(`div`,{className:`mb-1 font-mono text-sm font-semibold text-foreground`,children:e.documentType}),H(`div`,{className:`mb-2 text-xs text-foreground`,children:xo[e.reason]}),e.packageNames.length>0?U(`div`,{className:`mb-2 text-xs text-muted-foreground`,children:[`Package`,e.packageNames.length>1?`s`:``,`:`,` `,e.packageNames.join(`, `)]}):null,e.error?H(`div`,{className:`mb-2 font-mono text-xs wrap-break-word text-destructive`,children:e.error.message}):null,H(`div`,{className:`flex justify-end`,children:H(`button`,{type:`button`,onClick:()=>void s(e.documentType),disabled:n,title:So(e.reason)?void 0:`No registry is configured; nothing to retry against.`,className:he(`min-h-[32px] rounded-xl px-3 py-1 text-sm font-semibold text-foreground transition-all hover:hover-effect`,n?`cursor-not-allowed bg-secondary hover:hover-effect`:`bg-primary text-primary-foreground active:active-effect`),children:t?`Retrying...`:`Try install again`})})]},e.documentType)})}),H(`div`,{className:`mt-4 flex justify-end`,children:H(`button`,{type:`button`,onClick:r,className:`min-h-[36px] rounded-xl border border-border bg-background px-4 py-2 text-sm font-semibold text-foreground hover:hover-effect`,children:`Close`})})]})})}function To(){let e=Xa(),t=y();return!t||e.length===0?null:H(oe,{pendingInstallations:e.flatMap(e=>e.packageNames.map(t=>({documentType:e.documentType,packageName:t}))),onInstall:e=>t.approveInstallation(e),onDismiss:e=>t.dismissInstallation(e)})}var Eo=()=>(u(),K(()=>{let e=e=>{let t=e.payload,n=(t instanceof Error?t.message:typeof t==`string`?t:``).match(/https?:\/\/[^\s"']+/)?.[0];if(n&&!n.startsWith(window.location.origin)){console.debug(`[Connect] Skipping reload — vite:preloadError for off-origin URL: ${n}`);return}console.log(`Outdated chunks detected, reloading page...`),window.location.reload()};return window.addEventListener(`vite:preloadError`,e),()=>{window.removeEventListener(`vite:preloadError`,e)}},[]),K(()=>{ze.registerServiceWorker(!1)},[]),U(bo,{children:[H(B,{position:`bottom-right`}),H(Co,{}),H(Ho,{}),H(To,{}),H(po,{}),H(go,{})]})),Do=(e,t)=>e.some(e=>e.id===t&&e.value),Oo=()=>{let{t:e}=Re(void 0,{useSuspense:!0,i18n:Te}),[t,n]=Ba(),[,r]=la(),i=[{id:`analytics-cookie`,label:e(`cookieBanner.cookies.analytics`),value:!0}];return t?U(`div`,{className:`absolute inset-0 z-10000 backdrop-blur-sm`,children:[H(`div`,{className:`absolute inset-0 bg-primary opacity-15`}),H(`div`,{className:`absolute inset-x-0 bottom-0 flex justify-center bg-background px-10 pt-10 pb-16 shadow-lg`,children:H(le,{className:`max-w-[1024px]`,cookies:i,onSubmit:e=>{n(!1),Do(e,`analytics-cookie`)&&r(e=>({...e,analytics:!0}))},onReject:()=>{n(!1),r(()=>({analytics:!1,functional:!1,marketing:!1}))},submitLabel:e(`cookieBanner.accept`),rejectLabel:e(`cookieBanner.reject`),children:H(`p`,{className:`font-semibold text-muted-foreground`,children:H(Le,{i18nKey:`cookieBanner.message`,components:{a:H(`a`,{onClick:()=>a({type:`cookiesPolicy`}),className:`cursor-pointer text-foreground hover:underline`},`cookieBanner.message-link`)}},`cookieBanner.message`)})})})]}):null};function ko({drive:e}){let t=s(),n=Xe(()=>e?t.some(t=>t.collectionId.equals(Se.forDrive(e.header.id))):!1,[t,e]),r=e?.state.global.icon;return r?H(`img`,{src:r,alt:e.header.name,height:32,width:32}):n?H(we,{name:`Server`,size:32}):H(we,{name:`Hdd`,size:32})}function Ao({message:e}){return H(`div`,{className:`flex size-full items-center justify-center`,children:H(`h3`,{className:`text-lg font-semibold`,children:e})})}var jo=t=>{let{document:n}=t,i=w(),s=r(),[c,l]=te(n.header.id),u=c?.header.id??void 0,d=c?.header.name??void 0,p=c?.header.documentType??void 0,m=c?.header.meta?.preferredEditor??void 0,{globalOperations:g,localOperations:_,isLoading:y,refetch:x}=e(u);K(()=>{s&&x()},[s,x]);let S=c?.header.revision.global??0,C=c?.header.revision.local??0,T=h(p),D=b(m),ee=E(p),O=D??ee,ne=k(),re=f(),ie=O?ne.find(e=>e.editors.includes(O))?.manifest.name:void 0,ae=ie&&re?re.getPackageVersion(ie):void 0,oe=ie?`${ie}@${ae??`unknown`}`:O?.config.id??`no-editor`,se=!c,A=O&&p&&!O.documentTypes.includes(p)&&!O.documentTypes.includes(`*`);Za({undo:()=>l(ye()),redo:()=>l(ve()),canUndo:S>0||C>0,canRedo:!!c?.clipboard.length}),K(()=>()=>{window.documentEditorDebugTools?.clear()},[]);let[j,M]=Qe(void 0);K(()=>{j&&j.documentId!==u&&M(void 0)},[j,u]);let N=(e,t)=>{M({error:e,documentId:u,info:t})};if(A)return H(vo,{message:`Loading editor`});if(se)return H(vo,{message:`Loading document`});if(!T)return H(Ao,{message:U(`div`,{className:`text-center leading-10`,children:[U(`p`,{children:[`Unable to open the document because the document model "`,p,`" is not supported.`]}),U(`p`,{children:[`Go to the`,` `,H(`button`,{type:`button`,className:`cursor-pointer underline`,onClick:()=>{a({type:`settings`})},children:`package manager`}),` `,`to install this document model`]})]})});if(!O)return H(Ao,{message:U(`div`,{className:`text-center leading-10`,children:[H(`p`,{children:`Unable to open the document because no editor has been found`}),U(`p`,{children:[`Go to the`,` `,H(`button`,{type:`button`,className:`cursor-pointer underline`,onClick:()=>{a({type:`settings`})},children:`package manager`}),` `,`an editor for the "$`,p,`" document type`]})]})});let ce=O.Component;return H(`div`,{className:`relative h-full`,id:`document-editor-context`,"data-editor":O.config.id,"data-document-type":p,children:s?y?H(vo,{message:`Loading operations`}):H(I,{documentTitle:d??``,documentId:u??``,globalOperations:g,localOperations:_,onClose:()=>o(!1),documentState:c.state,onCopyState:()=>{z(`Copied document state to clipboard`,{type:`success`})},onCopyDocId:()=>{z(`Copied document ID to clipboard`,{type:`success`})}},u):H(We,{fallback:H(vo,{message:`Loading editor`}),name:`EditorLoader`,children:H(uo,{fallbackRender:co,resetKeys:[u],onError:N,loggerContext:[`Connect`,`DocumentEditor`],children:!j?.error&&H(ce,{context:{readMode:!!i,selectedTimelineRevision:v(i?.startDate,i?.endDate,g)},documentId:c.header.id},`${oe}:${u}`)})})})};function Mo(){return H(`div`,{className:`h-screen bg-background`,children:H(`div`,{className:`flex h-screen items-stretch overflow-auto`,role:`presentation`,tabIndex:0,children:U(We,{name:`Root`,children:[!Ma()&&H(Uo,{}),H(`div`,{className:`relative flex-1 overflow-auto`,children:H(jr,{})})]})})})}function No(e,t){if(e)return!1;for(let e of t.values())if(e.state===`error`&&e.requiresAuth)return!0;return!1}function Po(){let e=g(),t=ee();return{needsLogin:No(!!e,t)}}function Fo(){let{needsLogin:e}=Po(),[r]=T(),i=n(),a=m();return K(()=>{a||C(Ee)},[a]),K(()=>{r||t(De)},[r]),H(Io,{children:e?H(`div`,{className:`flex h-full items-center justify-center p-4`,children:H(P,{onLogin:O})}):H(!a&&!r&&!i?Ro:yo,{})})}function Io({children:e}){return H(`div`,{className:`flex h-full flex-col overflow-auto`,id:`content-view`,children:e})}function Lo({drive:e}){let t=i(e.header.meta?.preferredEditor)?.config.name||`Drive Explorer App`;return H(ae,{title:e.state.global.name||e.header.name,description:t,icon:H(ko,{drive:e}),onClick:()=>l(e)},e.header.id)}function Ro(){let e=D(),t=x(),n=ge().connect?.branding?.homeBackground;return U(pe,{homeBackground:n,children:[e?.map(e=>H(Lo,{drive:e},e.header.id)),t&&H(N,{})]})}function zo(e){let t=V.routerBasename;return zr(e,{basename:t,future:{v7_fetcherPersist:!0,v7_relativeSplatPath:!0}})}function Bo(){return[{element:H(We,{name:`RouteRoot`,children:H(Mo,{})}),children:[{index:!0,path:`d?/:driveId?/*?`,element:H(We,{name:`Drive`,children:H(Fo,{})})}]}]}var Vo=zo(Bo()),Ho=()=>H(Yr,{router:Vo});function Uo(){let e=g(),t=D(),n=x(),[r]=T(),i=localStorage.getItem(`CONNECT_DEBUG`)===`true`,o=e?.ens?.name||e?.profile?.username||void 0,s=e?.ens?.avatarUrl||e?.profile?.userImage||void 0,u=se(s?void 0:e?.address),d=()=>{a({type:`settings`})},f=()=>{a({type:`addDrive`})},p=e?.address?`https://etherscan.io/address/${e.address}`:``;return H(fe,{children:H(F,{id:`sidebar`,onClick:()=>l(void 0),onClickSettings:d,address:e?.address,onLogin:O,onDisconnect:()=>{c()},ensName:o||u.data?.ens,avatarUrl:s||u.data?.avatar_small||u.data?.avatar_url||void 0,etherscanUrl:p,showDebug:i,onDebugClick:()=>a({type:`debugSettings`}),children:U(uo,{variant:`text`,fallbackMessage:`There was an error loading drives`,loggerContext:[`Connect`,`Sidebar`],children:[t?.map((e,t)=>H(j,{title:e.header.name,onClick:()=>l(e),active:r?.header.id===e.header.id,icon:H(ko,{drive:e})},t)),n&&H(de,{onClick:f})]})})})}var Wo=!1,Go=new Set;function Ko(){for(let e of Go)e()}function qo(){Wo=!0,Ko()}function Jo(e){return Go.add(e),()=>{Go.delete(e)}}function Yo(){return Wo}var Xo=()=>{let e=$e(Jo,Yo,()=>!1),t=$e(Oe,Ae,()=>void 0),[n,r]=Qe(!1),[i,a]=Qe(null);return t==null||t===17||e?null:H(`div`,{className:`absolute inset-x-0 top-0 z-30 flex justify-center p-3`,children:U(`div`,{className:`flex max-w-3xl items-center gap-3 rounded-lg border border-warning bg-warning px-4 py-3 text-sm text-warning-foreground shadow-lg`,children:[U(`div`,{className:`flex-1`,children:[U(`div`,{className:`font-semibold`,children:[`Your local database uses Postgres `,t,`.`]}),U(`div`,{className:`text-foreground`,children:[`Migrate to Postgres `,17,` to pick up the latest features. Your data will be backed up first.`]}),i&&U(`div`,{className:`mt-2 font-medium text-destructive`,children:[`Migration failed: `,i]})]}),H(`button`,{type:`button`,disabled:n,onClick:()=>{a(null),r(!0),ta().then(()=>{window.location.reload()}).catch(e=>{a(e instanceof Error?e.message:String(e)),r(!1)})},className:`rounded-sm bg-primary px-3 py-1 text-sm font-medium text-primary-foreground hover:hover-effect disabled:disabled-effect`,children:n?`Migrating…`:`Migrate now`}),H(`button`,{type:`button`,disabled:n,onClick:qo,className:`rounded-sm border border-foreground bg-transparent px-3 py-1 text-sm font-medium text-foreground hover:hover-effect disabled:disabled-effect`,children:`Dismiss`})]})})},Zo=G(()=>L(()=>import(`./AddDriveModal-BoKLJyUY-Cmg70V3l.js`).then(e=>({default:e.AddDriveModal})),__vite__mapDeps([11,12,1,2,13,14,15,16,17,18,19,20,21,22,23]))),Qo=G(()=>L(()=>import(`./ClearStorageModal-BlNfe-Or-DUX3Khqr.js`).then(e=>({default:e.ClearStorageModal})),__vite__mapDeps([24,12,1,2,13,14,15,16,17,18,19,20,21,25,26,27,28,22,29,30,31,32,33,34,35,36,37,38]))),$o=G(()=>L(()=>import(`./CookiesPolicyModal-1nOh6oN3-BQzsmGcn.js`).then(e=>({default:e.CookiesPolicyModal})),__vite__mapDeps([39,12,1,2,13,14,15,16,17,18,19,20,21,40,23,38]))),es=G(()=>L(()=>import(`./CreateDocumentModal-nQbLVDq3-D4-Jna78.js`).then(e=>({default:e.CreateDocumentModal})),__vite__mapDeps([41,12,1,2,13,14,15,16,17,18,19,20,21]))),ts=G(()=>L(()=>import(`./DebugSettingsModal-riB4L92f-D87nXvay.js`).then(e=>({default:e.DebugSettingsModal})),__vite__mapDeps([42,12,1,2,13,14,15,16,17,18,19,20,21,43,26,27,44]))),ns=G(()=>L(()=>import(`./DeleteDriveModal-6P0T1QgD-WKQT96LL.js`).then(e=>({default:e.DeleteDriveModal})),__vite__mapDeps([45,12,1,2,13,14,15,16,17,18,19,20,21,22,38]))),rs=G(()=>L(()=>import(`./DeleteItemModal-BmV1aQyZ-CEUrEMsE.js`).then(e=>({default:e.DeleteItemModal})),__vite__mapDeps([46,12,1,2,13,14,15,16,17,18,19,20,21,22,38]))),is=G(()=>L(()=>import(`./DisclaimerModal-CVTFfN0_-DS2bpS0M.js`).then(e=>({default:e.DisclaimerModal})),__vite__mapDeps([47,12,1,2,13,14,15,16,17,18,19,20,21,38]))),as=G(()=>L(()=>import(`./DriveSettingsModal-CsNFEJ9E-k3N2ZkhY.js`).then(e=>({default:e.DriveSettingsModal})),__vite__mapDeps([48,12,1,2,13,14,15,16,17,18,19,20,21]))),os=G(()=>L(()=>import(`./DownloadDocumentWithErrorsModal-CXeFUtaz-BigyXlwN.js`).then(e=>({default:e.DownloadDocumentWithErrorsModal})),__vite__mapDeps([49,12,1,2,13,14,15,16,17,18,19,20,21,38]))),ss=G(()=>L(()=>import(`./SettingsModal-GHeTgO9h-XSdSFOjt.js`).then(e=>({default:e.SettingsModal})),__vite__mapDeps([50,12,1,2,13,14,15,16,17,18,19,20,21,43,26,27,51,22,52,23]))),cs=G(()=>L(()=>import(`./UpgradeDriveModal-C7lV4rAX-BOojyWpU.js`).then(e=>({default:e.UpgradeDriveModal})),__vite__mapDeps([53,12,1,2,13,14,15,16,17,18,19,20,21,38]))),ls={addDrive:Zo,clearStorage:Qo,cookiesPolicy:$o,createDocument:es,debugSettings:ts,deleteDrive:ns,deleteItem:rs,disclaimer:is,driveSettings:as,downloadDocumentWithErrors:os,inspector:G(()=>L(()=>import(`./InspectorModal-M3Km_wKa-BGQ8ah65.js`).then(e=>({default:e.InspectorModal})),__vite__mapDeps([54,12,1,2,13,14,15,16,17,18,19,20,21,25,26,27,28,22,29,30,31,32,33,34,35,36,37,55]))),settings:ss,upgradeDrive:cs,missingPackage:G(()=>L(()=>import(`./MissingPackageModal-Bn036mWQ-RFcA7w_j.js`).then(e=>({default:e.ConnectMissingPackageModal})),__vite__mapDeps([56,12,1,2,13,14,15,16,17,18,19,20,21,52,27]))),driveAuthRequired:G(()=>L(()=>import(`./DriveAuthRequiredModal-B3VdLwSH-DkXM9nTW.js`).then(e=>({default:e.DriveAuthRequiredModal})),__vite__mapDeps([57,12,1,2,13,14,15,16,17,18,19,20,21])))},us=G(()=>Promise.resolve({default:()=>{let e=ne();if(!e?.type)return null;let t=ls[e.type];return t?H(uo,{variant:`silent`,loggerContext:[`Connect`,`Modals`],children:H(We,{fallback:null,children:H(t,{})})}):null}})),ds=e=>{let t=G(()=>L(()=>import(`./load-DgTrakHO-CeBo0rmj.js`).then(t=>t.loadComponent(e.localPackage)),__vite__mapDeps([58,13,1,2,14,15,16,17,18,19,20,25,26,27,28,22,21,29,30,31,32,33,34,35,36,37,51,55,59,23,38,10])));return H(Ue,{children:U(uo,{fallbackRender:e=>H(no,{children:H(so,{...e})}),resetKeys:[e.localPackage],loggerContext:[`Connect`],children:[H(We,{fallback:H(no,{}),name:`AppLoader`,children:H(t,{...e,children:H(Eo,{})})}),H(We,{name:`CookieBanner`,children:H(Oo,{})}),H(We,{name:`ModalsContainer`,children:H(us,{})}),H(Xo,{})]})})};(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`833209e1-a61f-5d5e-bd7a-fc61c2ab4129`)}catch{}})();export{ds as AppLoader};
|
|
15
|
-
//# sourceMappingURL=components-CZ7Sq5Nz-
|
|
14
|
+
}`}}):null,e.children?null:H(to,{}),H(eo,{})]})},ro=R([`Connect`]);function io(e){return`fallbackRender`in e}function ao(){return null}function oo({message:e=`Something went wrong`}){return H(`div`,{className:`text-center`,children:e})}function so({error:e,resetErrorBoundary:t}){let n=e instanceof Error?e.message:String(e),r=e instanceof Error?e.stack??String(e.cause):JSON.stringify(e,null,2);return H(`div`,{className:`z-10 mx-auto flex max-w-[80%] flex-1 items-center justify-center p-6`,children:U(`div`,{className:`w-full max-w-lg rounded-lg border border-border bg-background p-6 shadow-sm`,children:[U(`div`,{className:`mb-3 flex items-center gap-2`,children:[H(we,{name:`Error`,className:`size-5 shrink-0`}),H(`h1`,{className:`text-lg font-semibold`,children:`Something went wrong`})]}),H(`p`,{className:`mb-4 text-sm text-foreground`,children:n}),r!==`{}`&&U(`details`,{className:`group`,children:[H(`summary`,{className:`cursor-pointer text-sm font-medium text-foreground underline select-none hover:hover-effect`,children:`Show details`}),H(`pre`,{className:`mt-2 max-h-48 overflow-auto rounded-sm bg-muted p-3 text-xs`,children:r})]}),H(M,{type:`button`,onClick:t,className:`mt-4 px-3 py-1.5 text-base font-medium`,children:`Try again`})]})})}function co({error:e}){return H(`div`,{className:`flex size-full items-center justify-center`,children:H(`h3`,{className:`text-lg font-semibold`,children:e instanceof Error?e.message:String(e)})})}function lo(e,t){switch(e){case`silent`:return ao;case`text`:return()=>H(oo,{message:t});case`detailed`:return so;default:return co}}function uo(e){let{children:t,onError:n,resetKeys:r,loggerContext:i}=e;return H(Ai,{fallbackRender:io(e)?e.fallbackRender:lo(e.variant,e.fallbackMessage),onError:(e,t)=>{if(e.message.includes(`Failed to fetch dynamically imported module`)&&e.message.includes(`node_modules/.vite`)){console.error(e),console.log(`Outdated chunk detected, reloading page...`),window.location.reload();return}(i?R(i):ro).error(`@error @info`,e,t),n?.(e,t)},resetKeys:r,children:t})}function fo(...e){window.dataLayer?.push(...e)}var po=()=>{let e=V.gaTrackingId,[{analytics:t}]=la(),n=e&&t;return K(()=>{if(n){let t=document.createElement(`script`);return t.src=`https://www.googletagmanager.com/gtag/js?id=${e}`,t.async=!0,document.head.appendChild(t),window.dataLayer=window.dataLayer||[],fo(`js`,new Date),fo(`config`,e),()=>{document.head.removeChild(t)}}},[n,e]),null};function mo(e){let{credential:t,...n}=e,r={address:n.address,did:n.did,networkId:n.networkId,chainId:n.chainId,caip2:`${n.networkId}:${n.chainId}`};return n.ens?.name!=null&&(r.ensName=n.ens.name),n.ens?.avatarUrl!=null&&(r.ensAvatar=n.ens.avatarUrl),n.profile?.username!=null&&(r.username=n.profile.username),n.profile?.userImage!=null&&(r.userImage=n.profile.userImage),n.profile?.documentId!=null&&(r.profileDocumentId=n.profile.documentId),n.profile?.createdAt!=null&&(r.profileCreatedAt=n.profile.createdAt),r}function ho(e){let t=e.profile?.userImage??e.ens?.avatarUrl,n=e.ens?.name??e.profile?.username;return{profileId:e.address,...t==null?{}:{avatar:t},...n==null?{}:{firstName:n},properties:mo(e)}}function go(){let[{analytics:e}]=la(),t=g(),n=p(),[r,i]=Qe(),a=Ze(void 0),o=e&&!!V.openPanel.clientId,s=n?.reactorModule?.processorManager;return K(()=>{if(!o)return;let e=!1,t=()=>e;return(async()=>{let e;try{e=await _a(V.openPanel)}catch(e){console.warn(`[OpenPanel] Failed to build client:`,e);return}if(!(t()||!e)&&(i(e),window.openPanel=e,V.openPanel.trackOperations&&s))try{await s.registerFactory(`openpanel`,Aa({client:e,events:{mappings:wa,lookupMap:Ta},startFrom:`current`})),t()&&await s.unregisterFactory(`openpanel`).catch(e=>console.warn(`[OpenPanel] Failed to unregister factory after cancellation:`,e))}catch(e){console.warn(`[OpenPanel] Failed to register processor factory:`,e)}})(),()=>{e=!0,a.current=void 0,V.openPanel.trackOperations&&s&&s.unregisterFactory(`openpanel`).catch(e=>console.warn(`[OpenPanel] Failed to unregister processor factory:`,e)),va(),window.openPanel=void 0,i(void 0)}},[o,s]),K(()=>{if(!o||!r)return;let e=a.current;if(a.current=t,!e&&t)try{r.identify(ho(t))}catch(e){console.warn(`[OpenPanel] Failed to identify user:`,e)}else if(e&&!t)try{r.clear()}catch(e){console.warn(`[OpenPanel] Failed to clear user:`,e)}},[r,t,o]),null}function _o(){let[e]=re(),t=S(e.header.id);return Xe(()=>async()=>{},[]),qe(()=>{d(t)},[t]),H(`div`,{id:`document-editor-container`,className:`flex-1`,"data-document-type":e.header.documentType,children:H(jo,{document:e})})}function vo(e){let[t,n]=Qe(!1);if(K(()=>{setTimeout(()=>{n(!0)},e.loadingTimeout??200)},[e]),!t)return null;let{customEditorLoader:r,...i}=e;return r?H(Be,{children:r}):H(ue,{...i})}function yo(){let[e]=T(),t=m(),n=i(e?.header.meta?.preferredEditor),r=_();if(!e)return H(vo,{});let a=n?.Component??r?.Component??Fe.Component;if(!a)throw Error(`No app component found`);return H(uo,{variant:`detailed`,resetKeys:[e.header.id],loggerContext:[`Connect`,`App`],children:H(We,{fallback:H(vo,{}),children:H(me,{className:`flex h-full flex-col overflow-auto`,children:H(a,{children:t?H(_o,{}):null})})})})}var bo=({children:e})=>(Ja(),e),xo={"no-registry":`No package registry is configured.`,"not-in-registry":`No matching package found in the registry.`,"registry-error":`Couldn't reach the package registry.`,"install-failed":`Package failed to install.`,dismissed:`Installation was dismissed.`};function So(e){return e!==`no-registry`}function Co(){let e=Ha(),[t,n]=Qe(!1);return e.length===0?null:U(Be,{children:[U(`div`,{className:`flex items-center justify-between gap-3 bg-warning/10 px-4 py-2 text-sm text-warning`,children:[H(`span`,{children:e.length===1?`1 document type couldn't load (missing model).`:`${e.length} document types couldn't load (missing models).`}),H(`button`,{type:`button`,onClick:()=>n(!0),className:`rounded-md border border-warning bg-background px-3 py-1 text-warning hover:hover-effect`,children:`View`})]}),H(wo,{open:t,failed:e,onClose:()=>n(!1)})]})}function wo(e){let{open:t,failed:n,onClose:r}=e,i=y(),[a,o]=Qe(()=>new Set);async function s(e){if(i){o(t=>new Set(t).add(e));try{await i.retryInstallation(e)}finally{o(t=>{let n=new Set(t);return n.delete(e),n})}}}return H(A,{open:t,onOpenChange:e=>{e||r()},contentProps:{className:`rounded-3xl`},children:U(`div`,{className:`w-[520px] max-w-[90vw] bg-background p-6`,children:[H(`div`,{className:`border-b border-border pb-2 text-2xl font-bold text-foreground`,children:`Missing document models`}),H(`div`,{className:`my-4 text-sm text-foreground`,children:`The following document types couldn't be loaded. Documents using them won't display until the underlying package is installed.`}),n.length===0?H(`div`,{className:`rounded-xl bg-background p-4 text-sm text-foreground`,children:`No outstanding failures.`}):H(`div`,{className:`flex max-h-[60vh] flex-col gap-3 overflow-y-auto`,children:n.map(e=>{let t=a.has(e.documentType),n=!So(e.reason)||t;return U(`div`,{className:`rounded-xl bg-background p-4`,children:[H(`div`,{className:`mb-1 font-mono text-sm font-semibold text-foreground`,children:e.documentType}),H(`div`,{className:`mb-2 text-xs text-foreground`,children:xo[e.reason]}),e.packageNames.length>0?U(`div`,{className:`mb-2 text-xs text-muted-foreground`,children:[`Package`,e.packageNames.length>1?`s`:``,`:`,` `,e.packageNames.join(`, `)]}):null,e.error?H(`div`,{className:`mb-2 font-mono text-xs wrap-break-word text-destructive`,children:e.error.message}):null,H(`div`,{className:`flex justify-end`,children:H(`button`,{type:`button`,onClick:()=>void s(e.documentType),disabled:n,title:So(e.reason)?void 0:`No registry is configured; nothing to retry against.`,className:he(`min-h-[32px] rounded-xl px-3 py-1 text-sm font-semibold text-foreground transition-all hover:hover-effect`,n?`cursor-not-allowed bg-secondary hover:hover-effect`:`bg-primary text-primary-foreground active:active-effect`),children:t?`Retrying...`:`Try install again`})})]},e.documentType)})}),H(`div`,{className:`mt-4 flex justify-end`,children:H(`button`,{type:`button`,onClick:r,className:`min-h-[36px] rounded-xl border border-border bg-background px-4 py-2 text-sm font-semibold text-foreground hover:hover-effect`,children:`Close`})})]})})}function To(){let e=Xa(),t=y();return!t||e.length===0?null:H(oe,{pendingInstallations:e.flatMap(e=>e.packageNames.map(t=>({documentType:e.documentType,packageName:t}))),onInstall:e=>t.approveInstallation(e),onDismiss:e=>t.dismissInstallation(e)})}var Eo=()=>(u(),K(()=>{let e=e=>{let t=e.payload,n=(t instanceof Error?t.message:typeof t==`string`?t:``).match(/https?:\/\/[^\s"']+/)?.[0];if(n&&!n.startsWith(window.location.origin)){console.debug(`[Connect] Skipping reload — vite:preloadError for off-origin URL: ${n}`);return}console.log(`Outdated chunks detected, reloading page...`),window.location.reload()};return window.addEventListener(`vite:preloadError`,e),()=>{window.removeEventListener(`vite:preloadError`,e)}},[]),K(()=>{ze.registerServiceWorker(!1)},[]),U(bo,{children:[H(B,{position:`bottom-right`}),H(Co,{}),H(Ho,{}),H(To,{}),H(po,{}),H(go,{})]})),Do=(e,t)=>e.some(e=>e.id===t&&e.value),Oo=()=>{let{t:e}=Re(void 0,{useSuspense:!0,i18n:Te}),[t,n]=Ba(),[,r]=la(),i=[{id:`analytics-cookie`,label:e(`cookieBanner.cookies.analytics`),value:!0}];return t?U(`div`,{className:`absolute inset-0 z-10000 backdrop-blur-sm`,children:[H(`div`,{className:`absolute inset-0 bg-primary opacity-15`}),H(`div`,{className:`absolute inset-x-0 bottom-0 flex justify-center bg-background px-10 pt-10 pb-16 shadow-lg`,children:H(le,{className:`max-w-[1024px]`,cookies:i,onSubmit:e=>{n(!1),Do(e,`analytics-cookie`)&&r(e=>({...e,analytics:!0}))},onReject:()=>{n(!1),r(()=>({analytics:!1,functional:!1,marketing:!1}))},submitLabel:e(`cookieBanner.accept`),rejectLabel:e(`cookieBanner.reject`),children:H(`p`,{className:`font-semibold text-muted-foreground`,children:H(Le,{i18nKey:`cookieBanner.message`,components:{a:H(`a`,{onClick:()=>a({type:`cookiesPolicy`}),className:`cursor-pointer text-foreground hover:underline`},`cookieBanner.message-link`)}},`cookieBanner.message`)})})})]}):null};function ko({drive:e}){let t=s(),n=Xe(()=>e?t.some(t=>t.collectionId.equals(Se.forDrive(e.header.id))):!1,[t,e]),r=e?.state.global.icon;return r?H(`img`,{src:r,alt:e.header.name,height:32,width:32}):n?H(we,{name:`Server`,size:32}):H(we,{name:`Hdd`,size:32})}function Ao({message:e}){return H(`div`,{className:`flex size-full items-center justify-center`,children:H(`h3`,{className:`text-lg font-semibold`,children:e})})}var jo=t=>{let{document:n}=t,i=w(),s=r(),[c,l]=te(n.header.id),u=c?.header.id??void 0,d=c?.header.name??void 0,p=c?.header.documentType??void 0,m=c?.header.meta?.preferredEditor??void 0,{globalOperations:g,localOperations:_,isLoading:y,refetch:x}=e(u);K(()=>{s&&x()},[s,x]);let S=c?.header.revision.global??0,C=c?.header.revision.local??0,T=h(p),D=b(m),ee=E(p),O=D??ee,ne=k(),re=f(),ie=O?ne.find(e=>e.editors.includes(O))?.manifest.name:void 0,ae=ie&&re?re.getPackageVersion(ie):void 0,oe=ie?`${ie}@${ae??`unknown`}`:O?.config.id??`no-editor`,se=!c,A=O&&p&&!O.documentTypes.includes(p)&&!O.documentTypes.includes(`*`);Za({undo:()=>l(ye()),redo:()=>l(ve()),canUndo:S>0||C>0,canRedo:!!c?.clipboard.length}),K(()=>()=>{window.documentEditorDebugTools?.clear()},[]);let[j,M]=Qe(void 0);K(()=>{j&&j.documentId!==u&&M(void 0)},[j,u]);let N=(e,t)=>{M({error:e,documentId:u,info:t})};if(A)return H(vo,{message:`Loading editor`});if(se)return H(vo,{message:`Loading document`});if(!T)return H(Ao,{message:U(`div`,{className:`text-center leading-10`,children:[U(`p`,{children:[`Unable to open the document because the document model "`,p,`" is not supported.`]}),U(`p`,{children:[`Go to the`,` `,H(`button`,{type:`button`,className:`cursor-pointer underline`,onClick:()=>{a({type:`settings`})},children:`package manager`}),` `,`to install this document model`]})]})});if(!O)return H(Ao,{message:U(`div`,{className:`text-center leading-10`,children:[H(`p`,{children:`Unable to open the document because no editor has been found`}),U(`p`,{children:[`Go to the`,` `,H(`button`,{type:`button`,className:`cursor-pointer underline`,onClick:()=>{a({type:`settings`})},children:`package manager`}),` `,`an editor for the "$`,p,`" document type`]})]})});let ce=O.Component;return H(`div`,{className:`relative h-full`,id:`document-editor-context`,"data-editor":O.config.id,"data-document-type":p,children:s?y?H(vo,{message:`Loading operations`}):H(I,{documentTitle:d??``,documentId:u??``,globalOperations:g,localOperations:_,onClose:()=>o(!1),documentState:c.state,onCopyState:()=>{z(`Copied document state to clipboard`,{type:`success`})},onCopyDocId:()=>{z(`Copied document ID to clipboard`,{type:`success`})}},u):H(We,{fallback:H(vo,{message:`Loading editor`}),name:`EditorLoader`,children:H(uo,{fallbackRender:co,resetKeys:[u],onError:N,loggerContext:[`Connect`,`DocumentEditor`],children:!j?.error&&H(ce,{context:{readMode:!!i,selectedTimelineRevision:v(i?.startDate,i?.endDate,g)},documentId:c.header.id},`${oe}:${u}`)})})})};function Mo(){return H(`div`,{className:`h-screen bg-background`,children:H(`div`,{className:`flex h-screen items-stretch overflow-auto`,role:`presentation`,tabIndex:0,children:U(We,{name:`Root`,children:[!Ma()&&H(Uo,{}),H(`div`,{className:`relative flex-1 overflow-auto`,children:H(jr,{})})]})})})}function No(e,t){if(e)return!1;for(let e of t.values())if(e.state===`error`&&e.requiresAuth)return!0;return!1}function Po(){let e=g(),t=ee();return{needsLogin:No(!!e,t)}}function Fo(){let{needsLogin:e}=Po(),[r]=T(),i=n(),a=m();return K(()=>{a||C(Ee)},[a]),K(()=>{r||t(De)},[r]),H(Io,{children:e?H(`div`,{className:`flex h-full items-center justify-center p-4`,children:H(P,{onLogin:O})}):H(!a&&!r&&!i?Ro:yo,{})})}function Io({children:e}){return H(`div`,{className:`flex h-full flex-col overflow-auto`,id:`content-view`,children:e})}function Lo({drive:e}){let t=i(e.header.meta?.preferredEditor)?.config.name||`Drive Explorer App`;return H(ae,{title:e.state.global.name||e.header.name,description:t,icon:H(ko,{drive:e}),onClick:()=>l(e)},e.header.id)}function Ro(){let e=D(),t=x(),n=ge().connect?.branding?.homeBackground;return U(pe,{homeBackground:n,children:[e?.map(e=>H(Lo,{drive:e},e.header.id)),t&&H(N,{})]})}function zo(e){let t=V.routerBasename;return zr(e,{basename:t,future:{v7_fetcherPersist:!0,v7_relativeSplatPath:!0}})}function Bo(){return[{element:H(We,{name:`RouteRoot`,children:H(Mo,{})}),children:[{index:!0,path:`d?/:driveId?/*?`,element:H(We,{name:`Drive`,children:H(Fo,{})})}]}]}var Vo=zo(Bo()),Ho=()=>H(Yr,{router:Vo});function Uo(){let e=g(),t=D(),n=x(),[r]=T(),i=localStorage.getItem(`CONNECT_DEBUG`)===`true`,o=e?.ens?.name||e?.profile?.username||void 0,s=e?.ens?.avatarUrl||e?.profile?.userImage||void 0,u=se(s?void 0:e?.address),d=()=>{a({type:`settings`})},f=()=>{a({type:`addDrive`})},p=e?.address?`https://etherscan.io/address/${e.address}`:``;return H(fe,{children:H(F,{id:`sidebar`,onClick:()=>l(void 0),onClickSettings:d,address:e?.address,onLogin:O,onDisconnect:()=>{c()},ensName:o||u.data?.ens,avatarUrl:s||u.data?.avatar_small||u.data?.avatar_url||void 0,etherscanUrl:p,showDebug:i,onDebugClick:()=>a({type:`debugSettings`}),children:U(uo,{variant:`text`,fallbackMessage:`There was an error loading drives`,loggerContext:[`Connect`,`Sidebar`],children:[t?.map((e,t)=>H(j,{title:e.header.name,onClick:()=>l(e),active:r?.header.id===e.header.id,icon:H(ko,{drive:e})},t)),n&&H(de,{onClick:f})]})})})}var Wo=!1,Go=new Set;function Ko(){for(let e of Go)e()}function qo(){Wo=!0,Ko()}function Jo(e){return Go.add(e),()=>{Go.delete(e)}}function Yo(){return Wo}var Xo=()=>{let e=$e(Jo,Yo,()=>!1),t=$e(Oe,Ae,()=>void 0),[n,r]=Qe(!1),[i,a]=Qe(null);return t==null||t===17||e?null:H(`div`,{className:`absolute inset-x-0 top-0 z-30 flex justify-center p-3`,children:U(`div`,{className:`flex max-w-3xl items-center gap-3 rounded-lg border border-warning bg-warning px-4 py-3 text-sm text-warning-foreground shadow-lg`,children:[U(`div`,{className:`flex-1`,children:[U(`div`,{className:`font-semibold`,children:[`Your local database uses Postgres `,t,`.`]}),U(`div`,{className:`text-foreground`,children:[`Migrate to Postgres `,17,` to pick up the latest features. Your data will be backed up first.`]}),i&&U(`div`,{className:`mt-2 font-medium text-destructive`,children:[`Migration failed: `,i]})]}),H(`button`,{type:`button`,disabled:n,onClick:()=>{a(null),r(!0),ta().then(()=>{window.location.reload()}).catch(e=>{a(e instanceof Error?e.message:String(e)),r(!1)})},className:`rounded-sm bg-primary px-3 py-1 text-sm font-medium text-primary-foreground hover:hover-effect disabled:disabled-effect`,children:n?`Migrating…`:`Migrate now`}),H(`button`,{type:`button`,disabled:n,onClick:qo,className:`rounded-sm border border-foreground bg-transparent px-3 py-1 text-sm font-medium text-foreground hover:hover-effect disabled:disabled-effect`,children:`Dismiss`})]})})},Zo=G(()=>L(()=>import(`./AddDriveModal-BoKLJyUY-Cmg70V3l.js`).then(e=>({default:e.AddDriveModal})),__vite__mapDeps([11,12,1,2,13,14,15,16,17,18,19,20,21,22,23]))),Qo=G(()=>L(()=>import(`./ClearStorageModal-BlNfe-Or-cRmQdz4_.js`).then(e=>({default:e.ClearStorageModal})),__vite__mapDeps([24,12,1,2,13,14,15,16,17,18,19,20,21,25,26,27,28,22,29,30,31,32,33,34,35,36,37,38]))),$o=G(()=>L(()=>import(`./CookiesPolicyModal-1nOh6oN3-BQzsmGcn.js`).then(e=>({default:e.CookiesPolicyModal})),__vite__mapDeps([39,12,1,2,13,14,15,16,17,18,19,20,21,40,23,38]))),es=G(()=>L(()=>import(`./CreateDocumentModal-nQbLVDq3-D4-Jna78.js`).then(e=>({default:e.CreateDocumentModal})),__vite__mapDeps([41,12,1,2,13,14,15,16,17,18,19,20,21]))),ts=G(()=>L(()=>import(`./DebugSettingsModal-riB4L92f-3PXUVk9n.js`).then(e=>({default:e.DebugSettingsModal})),__vite__mapDeps([42,12,1,2,13,14,15,16,17,18,19,20,21,43,26,27,44]))),ns=G(()=>L(()=>import(`./DeleteDriveModal-6P0T1QgD-WKQT96LL.js`).then(e=>({default:e.DeleteDriveModal})),__vite__mapDeps([45,12,1,2,13,14,15,16,17,18,19,20,21,22,38]))),rs=G(()=>L(()=>import(`./DeleteItemModal-BmV1aQyZ-CEUrEMsE.js`).then(e=>({default:e.DeleteItemModal})),__vite__mapDeps([46,12,1,2,13,14,15,16,17,18,19,20,21,22,38]))),is=G(()=>L(()=>import(`./DisclaimerModal-CVTFfN0_-DS2bpS0M.js`).then(e=>({default:e.DisclaimerModal})),__vite__mapDeps([47,12,1,2,13,14,15,16,17,18,19,20,21,38]))),as=G(()=>L(()=>import(`./DriveSettingsModal-CsNFEJ9E-k3N2ZkhY.js`).then(e=>({default:e.DriveSettingsModal})),__vite__mapDeps([48,12,1,2,13,14,15,16,17,18,19,20,21]))),os=G(()=>L(()=>import(`./DownloadDocumentWithErrorsModal-CXeFUtaz-BigyXlwN.js`).then(e=>({default:e.DownloadDocumentWithErrorsModal})),__vite__mapDeps([49,12,1,2,13,14,15,16,17,18,19,20,21,38]))),ss=G(()=>L(()=>import(`./SettingsModal-GHeTgO9h-C3Fm49sz.js`).then(e=>({default:e.SettingsModal})),__vite__mapDeps([50,12,1,2,13,14,15,16,17,18,19,20,21,43,26,27,51,22,52,23]))),cs=G(()=>L(()=>import(`./UpgradeDriveModal-C7lV4rAX-BOojyWpU.js`).then(e=>({default:e.UpgradeDriveModal})),__vite__mapDeps([53,12,1,2,13,14,15,16,17,18,19,20,21,38]))),ls={addDrive:Zo,clearStorage:Qo,cookiesPolicy:$o,createDocument:es,debugSettings:ts,deleteDrive:ns,deleteItem:rs,disclaimer:is,driveSettings:as,downloadDocumentWithErrors:os,inspector:G(()=>L(()=>import(`./InspectorModal-M3Km_wKa-Bbi6h0IY.js`).then(e=>({default:e.InspectorModal})),__vite__mapDeps([54,12,1,2,13,14,15,16,17,18,19,20,21,25,26,27,28,22,29,30,31,32,33,34,35,36,37,55]))),settings:ss,upgradeDrive:cs,missingPackage:G(()=>L(()=>import(`./MissingPackageModal-Bn036mWQ-RFcA7w_j.js`).then(e=>({default:e.ConnectMissingPackageModal})),__vite__mapDeps([56,12,1,2,13,14,15,16,17,18,19,20,21,52,27]))),driveAuthRequired:G(()=>L(()=>import(`./DriveAuthRequiredModal-B3VdLwSH-DkXM9nTW.js`).then(e=>({default:e.DriveAuthRequiredModal})),__vite__mapDeps([57,12,1,2,13,14,15,16,17,18,19,20,21])))},us=G(()=>Promise.resolve({default:()=>{let e=ne();if(!e?.type)return null;let t=ls[e.type];return t?H(uo,{variant:`silent`,loggerContext:[`Connect`,`Modals`],children:H(We,{fallback:null,children:H(t,{})})}):null}})),ds=e=>{let t=G(()=>L(()=>import(`./load-DgTrakHO-140Yl8Hq.js`).then(t=>t.loadComponent(e.localPackage)),__vite__mapDeps([58,13,1,2,14,15,16,17,18,19,20,25,26,27,28,22,21,29,30,31,32,33,34,35,36,37,51,55,59,23,38,10])));return H(Ue,{children:U(uo,{fallbackRender:e=>H(no,{children:H(so,{...e})}),resetKeys:[e.localPackage],loggerContext:[`Connect`],children:[H(We,{fallback:H(no,{}),name:`AppLoader`,children:H(t,{...e,children:H(Eo,{})})}),H(We,{name:`CookieBanner`,children:H(Oo,{})}),H(We,{name:`ModalsContainer`,children:H(us,{})}),H(Xo,{})]})})};(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`833209e1-a61f-5d5e-bd7a-fc61c2ab4129`)}catch{}})();export{ds as AppLoader};
|
|
15
|
+
//# sourceMappingURL=components-CZ7Sq5Nz-BXiGdiaB.js.map
|