driftjs-router 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Hrutav Modha
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("driftjs-shared");function t(e){if(!e||e===`/`)return`/`;let t=e.replace(/\/+/g,`/`);return t.startsWith(`/`)||(t=`/`+t),t.length>1&&t.endsWith(`/`)&&(t=t.slice(0,-1)),t}function n(e){if(!e)return``;let t=e.trim();return t.startsWith(`/`)||(t=`/`+t),t.length>1&&t.endsWith(`/`)&&(t=t.slice(0,-1)),t===`/`?``:t}function r(e,t){if(!t)return e;if(e.startsWith(t)){let n=e.slice(t.length);return n.startsWith(`/`)?n:`/`+n}return e}function i(e,t){let n=t.startsWith(`/`)?t:`/`+t;return e?e+n:n}function a(e,t){let n=t.startsWith(`/`)?t:`/`+t;return(e||``)+`#`+n}function o(){let e=[];return{get list(){return e},listen(t){return e.push(t),()=>{let n=e.indexOf(t);n!==-1&&e.splice(n,1)}},notify(t,n,r){for(let i of e)i(t,n,r)},clear(){e.length=0}}}function s(e){if(typeof window>`u`)return null;let t=e??window.history.state;if(!t||typeof t!=`object`)return t??null;let{__drift_pos:n,__drift_has_data:r,...i}=t;return Object.keys(i).length>0||r?i:null}function c(e,t){return{...e||{},__drift_pos:t,...e===void 0?{}:{__drift_has_data:!0}}}function l(e=``){let t=n(e),a=o(),l=()=>typeof window>`u`?`/`:window.location.pathname+window.location.search+window.location.hash,u=()=>r(l(),t)||`/`,d=u(),f=typeof window<`u`&&window.history.state&&typeof window.history.state.__drift_pos==`number`?window.history.state.__drift_pos:0;if(typeof window<`u`&&(window.history.state==null||typeof window.history.state.__drift_pos!=`number`)){let e=window.history.state||{};window.history.replaceState({...e,__drift_pos:f},``,i(t,d))}let p=e=>{let t=d,n=u();d=n;let r=typeof window<`u`&&window.history.state||e.state||null,i=r&&typeof r.__drift_pos==`number`?r.__drift_pos:f,o=i-f;f=i;let s={direction:o>0?`forward`:o<0?`back`:`unknown`,delta:o,type:`pop`};a.notify(n,t,s)};return typeof window<`u`&&window.addEventListener(`popstate`,p),{get base(){return t},get location(){return u()},get state(){return s(window.history.state)},listen(e){return a.listen(e)},push(e,n){if(typeof window>`u`)return;f++;let r=i(t,e),a=c(n,f);window.history.pushState(a,``,r),d=e},replace(e,n){if(typeof window>`u`)return;let r=i(t,e),a=c(n,f);window.history.replaceState(a,``,r),d=e},go(e){typeof window<`u`&&window.history.go(e)},destroy(){typeof window<`u`&&window.removeEventListener(`popstate`,p),a.clear()}}}function u(e=``){let t=n(e),r=o(),i=()=>{if(typeof window>`u`)return`/`;let e=window.location.hash;if(!e||e===`#`)return`/`;let t=e.startsWith(`#`)?e.slice(1):e;return t.startsWith(`/`)?t:`/`+t},l=i(),u=typeof window<`u`&&window.history.state&&typeof window.history.state.__drift_pos==`number`?window.history.state.__drift_pos:0;if(typeof window<`u`&&(window.history.state==null||typeof window.history.state.__drift_pos!=`number`)){let e=window.history.state||{};window.history.replaceState({...e,__drift_pos:u},``,a(t,l))}let d=e=>{let t=i();if(t===l)return;let n=l;l=t;let a=typeof window<`u`&&window.history.state||null,o=a&&typeof a.__drift_pos==`number`?a.__drift_pos:u,s=o-u;u=o;let c={direction:s>0?`forward`:s<0?`back`:`unknown`,delta:s,type:`pop`};r.notify(t,n,c)};return typeof window<`u`&&(window.addEventListener(`popstate`,d),window.addEventListener(`hashchange`,d)),{get base(){return t},get location(){return i()},get state(){return s(window.history.state)},listen(e){return r.listen(e)},push(e,n){if(typeof window>`u`)return;u++;let r=a(t,e),i=c(n,u);window.history.pushState(i,``,r),l=e},replace(e,n){if(typeof window>`u`)return;let r=a(t,e),i=c(n,u);window.history.replaceState(i,``,r),l=e},go(e){typeof window<`u`&&window.history.go(e)},destroy(){typeof window<`u`&&(window.removeEventListener(`popstate`,d),window.removeEventListener(`hashchange`,d)),r.clear()}}}function d(e=`/`,t=``){let i=n(t),a=[r(e.startsWith(`/`)?e:`/`+e,i)||`/`],o=[null],s=0,c=[];return{get base(){return i},get location(){return a[s]??`/`},get state(){return o[s]??null},listen(e){return c.push(e),()=>{let t=c.indexOf(e);t!==-1&&c.splice(t,1)}},push(e,t){let n=e.startsWith(`/`)?e:`/`+e;a.splice(s+1),o.splice(s+1),a.push(n),o.push(t||null),s++},replace(e,t){let n=e.startsWith(`/`)?e:`/`+e;a[s]=n,o[s]=t||null},go(e){let t=a[s]??`/`,n=s+e;if(n>=0&&n<a.length){s=n;let r=a[s]??`/`,i={direction:e>0?`forward`:e<0?`back`:`unknown`,delta:e,type:`pop`};for(let e of c)e(r,t,i)}},destroy(){c.length=0,a.length=0,o.length=0,s=0}}}function f(e){for(var t=[],n=0;n<e.length;){var r=e[n];if(r===`*`||r===`+`||r===`?`){t.push({type:`MODIFIER`,index:n,value:e[n++]});continue}if(r===`\\`){t.push({type:`ESCAPED_CHAR`,index:n++,value:e[n++]});continue}if(r===`{`){t.push({type:`OPEN`,index:n,value:e[n++]});continue}if(r===`}`){t.push({type:`CLOSE`,index:n,value:e[n++]});continue}if(r===`:`){for(var i=``,a=n+1;a<e.length;){var o=e.charCodeAt(a);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||o===95){i+=e[a++];continue}break}if(!i)throw TypeError(`Missing parameter name at ${n}`);t.push({type:`NAME`,index:n,value:i}),n=a;continue}if(r===`(`){var s=1,c=``,a=n+1;if(e[a]===`?`)throw TypeError(`Pattern cannot start with "?" at ${a}`);for(;a<e.length;){if(e[a]===`\\`){c+=e[a++]+e[a++];continue}if(e[a]===`)`){if(s--,s===0){a++;break}}else if(e[a]===`(`&&(s++,e[a+1]!==`?`))throw TypeError(`Capturing groups are not allowed at ${a}`);c+=e[a++]}if(s)throw TypeError(`Unbalanced pattern at ${n}`);if(!c)throw TypeError(`Missing pattern at ${n}`);t.push({type:`PATTERN`,index:n,value:c}),n=a;continue}t.push({type:`CHAR`,index:n,value:e[n++]})}return t.push({type:`END`,index:n,value:``}),t}function p(e,t){t===void 0&&(t={});for(var n=f(e),r=t.prefixes,i=r===void 0?`./`:r,a=t.delimiter,o=a===void 0?`/#?`:a,s=[],c=0,l=0,u=``,d=function(e){if(l<n.length&&n[l].type===e)return n[l++].value},p=function(e){var t=d(e);if(t!==void 0)return t;var r=n[l],i=r.type,a=r.index;throw TypeError(`Unexpected ${i} at ${a}, expected ${e}`)},m=function(){for(var e=``,t;t=d(`CHAR`)||d(`ESCAPED_CHAR`);)e+=t;return e},h=function(e){for(var t=0,n=o;t<n.length;t++){var r=n[t];if(e.indexOf(r)>-1)return!0}return!1},_=function(e){var t=s[s.length-1],n=e||(t&&typeof t==`string`?t:``);if(t&&!n)throw TypeError(`Must have text between two parameters, missing text after "${t.name}"`);return!n||h(n)?`[^${g(o)}]+?`:`(?:(?!${g(n)})[^${g(o)}])+?`};l<n.length;){var v=d(`CHAR`),y=d(`NAME`),b=d(`PATTERN`);if(y||b){var x=v||``;i.indexOf(x)===-1&&(u+=x,x=``),u&&=(s.push(u),``),s.push({name:y||c++,prefix:x,suffix:``,pattern:b||_(x),modifier:d(`MODIFIER`)||``});continue}var S=v||d(`ESCAPED_CHAR`);if(S){u+=S;continue}if(u&&=(s.push(u),``),d(`OPEN`)){var x=m(),C=d(`NAME`)||``,w=d(`PATTERN`)||``,T=m();p(`CLOSE`),s.push({name:C||(w?c++:``),pattern:C&&!w?_(x):w,prefix:x,suffix:T,modifier:d(`MODIFIER`)||``});continue}p(`END`)}return s}function m(e,t){return h(p(e,t),t)}function h(e,t){t===void 0&&(t={});var n=_(t),r=t.encode,i=r===void 0?function(e){return e}:r,a=t.validate,o=a===void 0||a,s=e.map(function(e){if(typeof e==`object`)return RegExp(`^(?:${e.pattern})\$`,n)});return function(t){for(var n=``,r=0;r<e.length;r++){var a=e[r];if(typeof a==`string`){n+=a;continue}var c=t?t[a.name]:void 0,l=a.modifier===`?`||a.modifier===`*`,u=a.modifier===`*`||a.modifier===`+`;if(Array.isArray(c)){if(!u)throw TypeError(`Expected "${a.name}" to not repeat, but got an array`);if(c.length===0){if(l)continue;throw TypeError(`Expected "${a.name}" to not be empty`)}for(var d=0;d<c.length;d++){var f=i(c[d],a);if(o&&!s[r].test(f))throw TypeError(`Expected all "${a.name}" to match "${a.pattern}", but got "${f}"`);n+=a.prefix+f+a.suffix}continue}if(typeof c==`string`||typeof c==`number`){var f=i(String(c),a);if(o&&!s[r].test(f))throw TypeError(`Expected "${a.name}" to match "${a.pattern}", but got "${f}"`);n+=a.prefix+f+a.suffix;continue}if(!l){var p=u?`an array`:`a string`;throw TypeError(`Expected "${a.name}" to be ${p}`)}}return n}}function g(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,`\\$1`)}function _(e){return e&&e.sensitive?``:`i`}function v(e,t){if(!t)return e;for(var n=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,i=n.exec(e.source);i;)t.push({name:i[1]||r++,prefix:``,suffix:``,modifier:``,pattern:``}),i=n.exec(e.source);return e}function y(e,t,n){var r=e.map(function(e){return S(e,t,n).source});return RegExp(`(?:${r.join(`|`)})`,_(n))}function b(e,t,n){return x(p(e,n),t,n)}function x(e,t,n){n===void 0&&(n={});for(var r=n.strict,i=r!==void 0&&r,a=n.start,o=a===void 0||a,s=n.end,c=s===void 0||s,l=n.encode,u=l===void 0?function(e){return e}:l,d=n.delimiter,f=d===void 0?`/#?`:d,p=n.endsWith,m=`[${g(p===void 0?``:p)}]|\$`,h=`[${g(f)}]`,v=o?`^`:``,y=0,b=e;y<b.length;y++){var x=b[y];if(typeof x==`string`)v+=g(u(x));else{var S=g(u(x.prefix)),C=g(u(x.suffix));if(x.pattern)if(t&&t.push(x),S||C)if(x.modifier===`+`||x.modifier===`*`){var w=x.modifier===`*`?`?`:``;v+=`(?:${S}((?:${x.pattern})(?:${C}${S}(?:${x.pattern}))*)${C})${w}`}else v+=`(?:${S}(${x.pattern})${C})${x.modifier}`;else{if(x.modifier===`+`||x.modifier===`*`)throw TypeError(`Can not repeat "${x.name}" without a prefix and suffix`);v+=`(${x.pattern})${x.modifier}`}else v+=`(?:${S}${C})${x.modifier}`}}if(c)i||(v+=`${h}?`),v+=n.endsWith?`(?=${m})`:`$`;else{var T=e[e.length-1],E=typeof T==`string`?h.indexOf(T[T.length-1])>-1:T===void 0;i||(v+=`(?:${h}(?=${m}))?`),E||(v+=`(?=${h}|${m})`)}return new RegExp(v,_(n))}function S(e,t,n){return e instanceof RegExp?v(e,t):Array.isArray(e)?y(e,t,n):b(e,t,n)}function C(e){try{return decodeURIComponent(e)}catch{return e}}function w(e){let t=Object.create(null);if(!e)return t;let n=e.startsWith(`?`)?e.slice(1):e;if(!n)return t;let r=new URLSearchParams(n),i=new Set;for(let e of r.keys()){if(e===`__proto__`||e===`constructor`||e===`prototype`||i.has(e))continue;i.add(e);let n=r.getAll(e);t[e]=n.length>1?n:n[0]??null}for(let e of n.split(`&`))if(e&&e.indexOf(`=`)===-1)try{let n=decodeURIComponent(e);n!==`__proto__`&&n!==`constructor`&&n!==`prototype`&&t[n]===``&&(t[n]=null)}catch{e!==`__proto__`&&e!==`constructor`&&e!==`prototype`&&t[e]===``&&(t[e]=null)}return t}function T(e){let t=Object.keys(e);if(t.length===0)return``;let n=[];for(let r of t){if(r===`__proto__`)continue;let t=e[r];if(t===void 0)continue;let i=encodeURIComponent(r);if(t===null)n.push(i);else if(Array.isArray(t))for(let e of t)e==null?n.push(i):n.push(`${i}=${encodeURIComponent(e)}`);else n.push(`${i}=${encodeURIComponent(t)}`)}return n.length>0?`?`+n.join(`&`):``}function E(e){let t=e.replace(/\/\*$/,`/(.*)`),n=0,r=``;for(;n<t.length;)if(t[n]===`:`&&/[a-zA-Z0-9_$]/.test(t[n+1]||``)){let e=``;for(n++;n<t.length&&/[a-zA-Z0-9_$]/.test(t[n]);)e+=t[n],n++;if(t[n]===`(`){let i=1,a=``;for(n++;n<t.length&&i>0;){if(t[n]===`\\`){a+=t[n]+(t[n+1]||``),n+=2;continue}if(t[n]===`(`){i++,a+=`(?:`,n++;continue}if(t[n]===`)`&&(i--,i===0)){n++;break}a+=t[n],n++}r+=`:${e}(${a})`}else r+=`:${e}`}else r+=t[n],n++;return r}function D(e,t){let n={};for(let[e,r]of Object.entries(t))r!=null&&(n[e]=r);try{return m(E(e.replace(/\/\*$/,`/:pathMatch(.*)`)),{validate:!1,encode:e=>e})(n)}catch{let t=e;for(let[e,r]of Object.entries(n))t=e===`pathMatch`?t.replace(/\/\*$/,`/`+(Array.isArray(r)?r.join(`/`):String(r))):t.replace(RegExp(`:${e}\\b(?:\\([^)]+\\))?[?*+]?`,`g`),Array.isArray(r)?r.join(`/`):String(r));return t=t.replace(/\/:[a-zA-Z0-9_$]+\?/g,``).replace(/:[a-zA-Z0-9_$]+\?/g,``),t}}function O(e){if(e===`/`||e===``)return{regex:/^\/?$/,paramNames:[],score:1e3};let t=E(e),n=[],r=S(t,n,{sensitive:!1,strict:!1,end:!0}),i=n.map(e=>typeof e.name==`number`?`pathMatch`:String(e.name)),a=0;for(let t of e.split(`/`).filter(Boolean))t===`*`||t.includes(`(.*)`)?a+=1:t.includes(`:`)?t.includes(`(`)?a+=30:t.includes(`?`)?a+=15:a+=20:a+=100;return{regex:r,paramNames:i,score:a}}function k(e,n){let r=e.path;r=n?e.path.startsWith(`/`)?t(e.path):t(`${n.path===`/`?``:n.path}/${e.path}`):t(e.path);let{regex:i,paramNames:a,score:o}=O(r),s={};e.components?Object.assign(s,e.components):e.component&&(s.default=e.component);let c=e.beforeEnter?Array.isArray(e.beforeEnter)?e.beforeEnter:[e.beforeEnter]:void 0,l={};typeof e.props==`boolean`||typeof e.props==`function`?l.default=e.props:e.props&&typeof e.props==`object`&&(l=e.props);let u={path:r,name:e.name,components:s,children:[],meta:e.meta||{},beforeEnter:c,props:l,parent:n,regex:i,paramNames:a,score:o,redirect:e.redirect};return e.children&&e.children.length>0&&(u.children=e.children.map(e=>k(e,u))),u}function A(e){let n=[],r=new Map,i=[];function a(e,t){t.push(e),e.name&&r.set(e.name,e);for(let n of e.children)a(n,t)}function o(){r.clear();let e=[];for(let t of i)a(t,e);n=e.sort((e,t)=>{let n=e.score??0;return(t.score??0)-n})}for(let t of e)i.push(k(t));o();function s(e){let r=t(e);for(let e of n){let t=r.match(e.regex);if(t){let n={};for(let r=0;r<e.paramNames.length;r++){let i=e.paramNames[r],a=t[r+1];n[i]=a===void 0?``:C(a)}return{record:e,params:n}}}return{record:null,params:{}}}function c(e,n){let i=`/`,a={},o=``,c={},l;if(typeof e==`string`){let t=e.indexOf(`#`),n=e;t!==-1&&(o=e.slice(t),n=e.slice(0,t));let r=n.indexOf(`?`);r===-1?i=n:(a=w(n.slice(r)),i=n.slice(0,r))}else{if(e.name){l=e.name;let t=r.get(l);t&&(i=t.path,c={...e.params||{}},i=D(i,c))}else e.path&&(i=e.path);e.query&&(a={...e.query}),e.hash&&(o=e.hash.startsWith(`#`)?e.hash:`#`+e.hash),e.params&&(c={...c,...e.params})}i=t(i);let{record:u,params:d}=s(i),f={...d,...c},p=[];if(u){let e=u;for(;e;)p.unshift(e),e=e.parent}let m=T(a),h=i+m+o;return{path:i,fullPath:h,query:a,hash:o,params:f,name:u?.name||l,matched:p,meta:u?.meta||{},href:h}}return{resolve:c,addRoute(e,t){if(typeof e==`string`&&t){let n=r.get(e);if(n){let e=k(t,n);return n.children.push(e),o(),()=>{let t=n.children.indexOf(e);t!==-1&&(n.children.splice(t,1),o())}}}else if(typeof e==`object`){let t=k(e);return i.push(t),o(),()=>{let e=i.indexOf(t);e!==-1&&(i.splice(e,1),o())}}return()=>{}},removeRoute(e){let t=r.get(e);if(t){if(t.parent){let e=t.parent.children.indexOf(t);e!==-1&&t.parent.children.splice(e,1)}else{let e=i.indexOf(t);e!==-1&&i.splice(e,1)}o()}},hasRoute(e){return r.has(e)},getRoutes(){return[...n]}}}var j=function(e){return e[e.aborted=4]=`aborted`,e[e.cancelled=8]=`cancelled`,e[e.duplicated=16]=`duplicated`,e}({}),M=(0,e.createContext)(void 0,`DriftRouter`),N=(0,e.createContext)(void 0,`DriftRoute`),P=(0,e.createContext)(0,`DriftRouterDepth`),F=Object.freeze({path:`/`,fullPath:`/`,query:{},hash:``,params:{},name:void 0,matched:[],meta:{},href:`/`});function I(e,t,n,r){let i=`Navigation failed`;e===j.aborted?i=`Navigation aborted from "${t.fullPath}" to "${n.fullPath}" via a navigation guard.`:e===j.cancelled?i=`Navigation cancelled from "${t.fullPath}" to "${n.fullPath}" with a newer navigation.`:e===j.duplicated&&(i=`Avoided redundant navigation to current location: "${n.fullPath}".`);let a=Error(r||i);return a.name=`NavigationFailure`,a.type=e,a.from=t,a.to=n,a}function L(e,t){return!e||typeof e!=`object`||e.name!==`NavigationFailure`||typeof e.type!=`number`?!1:t===void 0||e.type===t}async function R(e){for(let t of e)for(let e of Object.keys(t.components)){let n=t.components[e];if(typeof n==`function`&&!(`__drift_fn__`in n)&&!n.bytecode)try{let r=await n();t.components[e]=r?.default||r}catch(e){throw console.error(`[DriftRouter] Failed to resolve async route component for path "${t.path}":`,e),e}}}async function z(e,t,n){for(let r of e){let e;try{if(r.length>=3)e=await new Promise((e,i)=>{let a=!1,o=t=>{a||(a=!0,e(t))};try{let s=r(t,n,o);s instanceof Promise&&s.then(t=>{a||(a=!0,e(t))}).catch(i)}catch(e){i(e)}});else{let i=r(t,n,()=>{});e=i instanceof Promise?await i:i}}catch(e){return e instanceof Error?e:Error(String(e))}if(e!==void 0&&e!==!0)return e}return!0}function B(e){let{history:t,routes:n,scrollBehavior:r,linkActiveClass:i,linkExactActiveClass:a}=e,o=A(n),s=[],c=[],l=[],u=[],d=[],f=F,p=null,m=null,h=null;p=new Promise((e,t)=>{m=e,h=t});let g=0;function _(e){if(u.length>0)for(let t of u)t(e)}function v(e,t,n){if(!(typeof window>`u`||!r))try{let i=r(e,t,n);if(!i)return;let a=e=>{if(`el`in e){let t=typeof e.el==`string`?document.querySelector(e.el):e.el;t&&t.scrollIntoView({behavior:e.behavior||`auto`})}else window.scrollTo({left:e.left??window.scrollX,top:e.top??window.scrollY,behavior:e.behavior||`auto`})};i instanceof Promise?i.then(e=>{e&&a(e)}):a(i)}catch{}}async function y(e,n=!1,r=!1,i=0){if(i>20){let t=o.resolve(e,f);return I(j.aborted,f,t,`Infinite redirect loop detected`)}let a=o.resolve(e,f),u=f;if(a.matched.length>0){let e=a.matched[a.matched.length-1];if(e.redirect)return y(typeof e.redirect==`function`?e.redirect(a):e.redirect,!0,r,i+1)}if(u.fullPath===a.fullPath&&u!==F)return I(j.duplicated,u,a);let p=++g,m=[...s];for(let e of a.matched)e.beforeEnter&&m.push(...e.beforeEnter);let h=await z(m,a,u);if(p!==g)return I(j.cancelled,u,a);if(h===!1)return I(j.aborted,u,a);if(h instanceof Error)return _(h),I(j.aborted,u,a,h.message);if(typeof h==`string`||typeof h==`object`&&h)return y(h,n,r,i+1);try{await R(a.matched)}catch(e){return _(e),I(j.aborted,u,a,String(e))}if(p!==g)return I(j.cancelled,u,a);if(c.length>0){let e=await z(c,a,u);if(p!==g)return I(j.cancelled,u,a);if(e===!1)return I(j.aborted,u,a);if(e instanceof Error)return _(e),I(j.aborted,u,a,e.message);if(typeof e==`string`||typeof e==`object`&&e)return y(e,n,r,i+1)}r||(n?t.replace(a.fullPath):t.push(a.fullPath));let b=f;f=Object.freeze(a),v(f,b,t.state);for(let e of l)try{e(f,b)}catch(e){_(e)}for(let e of d)try{e(f,b)}catch(e){_(e)}}let b=t.listen(async(e,n,r)=>{let i=await y(e,!1,r.type===`pop`);i&&L(i,j.aborted)&&r.delta&&t.go(-r.delta)});return y(t.location||`/`,!0,!0).then(e=>{e&&e.type===j.aborted?(h&&h(e),_(e)):m&&m()}).catch(e=>{h&&h(e),_(e)}),{get currentRoute(){return f},get options(){return e},push(e){return y(e,!1)},replace(e){return y(e,!0)},go(e){t.go(e)},back(){t.go(-1)},forward(){t.go(1)},beforeEach(e){return s.push(e),()=>{let t=s.indexOf(e);t!==-1&&s.splice(t,1)}},beforeResolve(e){return c.push(e),()=>{let t=c.indexOf(e);t!==-1&&c.splice(t,1)}},afterEach(e){return l.push(e),()=>{let t=l.indexOf(e);t!==-1&&l.splice(t,1)}},onError(e){return u.push(e),()=>{let t=u.indexOf(e);t!==-1&&u.splice(t,1)}},isReady(){return p},resolve(e,t){return o.resolve(e,t||f)},addRoute(e,t){return o.addRoute(e,t)},removeRoute(e){o.removeRoute(e)},hasRoute(e){return o.hasRoute(e)},getRoutes(){return o.getRoutes()},subscribe(e){return d.push(e),()=>{let t=d.indexOf(e);t!==-1&&d.splice(t,1)}},destroy(){b(),s.length=0,c.length=0,l.length=0,u.length=0,d.length=0,t.destroy()}}}var V={bytecode:new Uint32Array([6,0,12,0,1,1,1,5,1,2,3,0,13,1,6,4,255,5,4,0,1,0,0]),constants:[{__drift_fn__:(e,t,n,r,i,a)=>{if((e||{}).router=(typeof a==`function`?a(e,`RouterContext`):typeof r==`function`&&r(e,`RouterContext`)?e.RouterContext:typeof globalThis<`u`&&globalThis&&`RouterContext`in globalThis?globalThis.RouterContext:(e||{}).RouterContext).inject(),(e||{}).depth=(typeof a==`function`?a(e,`RouterDepthContext`):typeof r==`function`&&r(e,`RouterDepthContext`)?e.RouterDepthContext:typeof globalThis<`u`&&globalThis&&`RouterDepthContext`in globalThis?globalThis.RouterDepthContext:(e||{}).RouterDepthContext).inject(0),(e||{}).CurrentComponent=null,(typeof a==`function`?a(e,`RouterDepthContext`):typeof r==`function`&&r(e,`RouterDepthContext`)?e.RouterDepthContext:typeof globalThis<`u`&&globalThis&&`RouterDepthContext`in globalThis?globalThis.RouterDepthContext:(e||{}).RouterDepthContext).provide((typeof a==`function`?a(e,`depth`):typeof r==`function`&&r(e,`depth`)?e.depth:typeof globalThis<`u`&&globalThis&&`depth`in globalThis?globalThis.depth:(e||{}).depth)+1),(e||{}).updateCurrentComponent=function(){if(!(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router)||!(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router).currentRoute||!(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router).currentRoute.matched||!(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router).currentRoute.matched[typeof a==`function`?a(e,`depth`):typeof r==`function`&&r(e,`depth`)?e.depth:typeof globalThis<`u`&&globalThis&&`depth`in globalThis?globalThis.depth:(e||{}).depth]){(typeof a==`function`?a(e,`CurrentComponent`):typeof r==`function`&&r(e,`CurrentComponent`)?e.CurrentComponent:typeof globalThis<`u`&&globalThis&&`CurrentComponent`in globalThis?globalThis.CurrentComponent:(e||{}).CurrentComponent)!==null&&(typeof n==`function`?n(e,`CurrentComponent`,null):(e||{}).CurrentComponent=null);return}(typeof a==`function`?a(e,`CurrentComponent`):typeof r==`function`&&r(e,`CurrentComponent`)?e.CurrentComponent:typeof globalThis<`u`&&globalThis&&`CurrentComponent`in globalThis?globalThis.CurrentComponent:(e||{}).CurrentComponent)!==((typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router).currentRoute.matched[typeof a==`function`?a(e,`depth`):typeof r==`function`&&r(e,`depth`)?e.depth:typeof globalThis<`u`&&globalThis&&`depth`in globalThis?globalThis.depth:(e||{}).depth].components?.default||(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router).currentRoute.matched[typeof a==`function`?a(e,`depth`):typeof r==`function`&&r(e,`depth`)?e.depth:typeof globalThis<`u`&&globalThis&&`depth`in globalThis?globalThis.depth:(e||{}).depth].component||null)&&(typeof n==`function`?n(e,`CurrentComponent`,(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router).currentRoute.matched[typeof a==`function`?a(e,`depth`):typeof r==`function`&&r(e,`depth`)?e.depth:typeof globalThis<`u`&&globalThis&&`depth`in globalThis?globalThis.depth:(e||{}).depth].components?.default||(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router).currentRoute.matched[typeof a==`function`?a(e,`depth`):typeof r==`function`&&r(e,`depth`)?e.depth:typeof globalThis<`u`&&globalThis&&`depth`in globalThis?globalThis.depth:(e||{}).depth].component||null):(e||{}).CurrentComponent=(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router).currentRoute.matched[typeof a==`function`?a(e,`depth`):typeof r==`function`&&r(e,`depth`)?e.depth:typeof globalThis<`u`&&globalThis&&`depth`in globalThis?globalThis.depth:(e||{}).depth].components?.default||(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router).currentRoute.matched[typeof a==`function`?a(e,`depth`):typeof r==`function`&&r(e,`depth`)?e.depth:typeof globalThis<`u`&&globalThis&&`depth`in globalThis?globalThis.depth:(e||{}).depth].component||null)},(typeof a==`function`?a(e,`updateCurrentComponent`):typeof r==`function`&&r(e,`updateCurrentComponent`)?e.updateCurrentComponent:typeof globalThis<`u`&&globalThis&&`updateCurrentComponent`in globalThis?globalThis.updateCurrentComponent:(e||{}).updateCurrentComponent)(),(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router)&&typeof(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router).subscribe==`function`){let t=(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router).subscribe((()=>{(typeof a==`function`?a(e,`updateCurrentComponent`):typeof r==`function`&&r(e,`updateCurrentComponent`)?e.updateCurrentComponent:typeof globalThis<`u`&&globalThis&&`updateCurrentComponent`in globalThis?globalThis.updateCurrentComponent:(e||{}).updateCurrentComponent)()}));typeof(typeof a==`function`?a(e,`onUnmount`):typeof r==`function`&&r(e,`onUnmount`)?e.onUnmount:typeof globalThis<`u`&&globalThis&&`onUnmount`in globalThis?globalThis.onUnmount:(e||{}).onUnmount)==`function`&&(typeof a==`function`?a(e,`onUnmount`):typeof r==`function`&&r(e,`onUnmount`)?e.onUnmount:typeof globalThis<`u`&&globalThis&&`onUnmount`in globalThis?globalThis.onUnmount:(e||{}).onUnmount)((()=>{t()}))}}},`div`,`class`,`drift-router-view`,{bytecode:[6,0,15,1,0,255,4,0,1,0,0],constants:[`CurrentComponent`],reactiveBindings:[]},[`CurrentComponent`],{__drift_fn__:(e,t,n,r,i,a)=>typeof a==`function`?a(e,`CurrentComponent`):typeof r==`function`&&r(e,`CurrentComponent`)?e.CurrentComponent:typeof globalThis<`u`&&globalThis&&`CurrentComponent`in globalThis?globalThis.CurrentComponent:(e||{}).CurrentComponent}],reactiveBindings:[],declaredVars:[`RouterContext`,`RouterDepthContext`,`onUnmount`,`router`,`depth`,`CurrentComponent`,`updateCurrentComponent`],derived:[],scope:{RouterContext:M,RouterDepthContext:P,onUnmount:e.onUnmount}},H={bytecode:new Uint32Array([6,0,12,0,1,1,1,5,1,2,3,1,5,1,4,5,1,5,1,6,7,1,5,1,8,9,1,5,1,10,11,1,7,2,12,4,1,2,4,0,1,0,0]),constants:[{__drift_fn__:(e,t,n,r,i,a)=>{if((e||{}).router=(typeof a==`function`?a(e,`RouterContext`):typeof r==`function`&&r(e,`RouterContext`)?e.RouterContext:typeof globalThis<`u`&&globalThis&&`RouterContext`in globalThis?globalThis.RouterContext:(e||{}).RouterContext).inject(),(e||{}).to=(typeof a==`function`?a(e,`props`):typeof r==`function`&&r(e,`props`)?e.props:typeof globalThis<`u`&&globalThis&&`props`in globalThis?globalThis.props:(e||{}).props).to||`/`,(e||{}).replace=(typeof a==`function`?a(e,`props`):typeof r==`function`&&r(e,`props`)?e.props:typeof globalThis<`u`&&globalThis&&`props`in globalThis?globalThis.props:(e||{}).props).replace||!1,(e||{}).target=(typeof a==`function`?a(e,`props`):typeof r==`function`&&r(e,`props`)?e.props:typeof globalThis<`u`&&globalThis&&`props`in globalThis?globalThis.props:(e||{}).props).target||`_self`,(e||{}).rel=(typeof a==`function`?a(e,`props`):typeof r==`function`&&r(e,`props`)?e.props:typeof globalThis<`u`&&globalThis&&`props`in globalThis?globalThis.props:(e||{}).props).rel||``,(e||{}).customClass=(typeof a==`function`?a(e,`props`):typeof r==`function`&&r(e,`props`)?e.props:typeof globalThis<`u`&&globalThis&&`props`in globalThis?globalThis.props:(e||{}).props).class||``,(e||{}).label=(typeof a==`function`?a(e,`props`):typeof r==`function`&&r(e,`props`)?e.props:typeof globalThis<`u`&&globalThis&&`props`in globalThis?globalThis.props:(e||{}).props).label||(typeof a==`function`?a(e,`props`):typeof r==`function`&&r(e,`props`)?e.props:typeof globalThis<`u`&&globalThis&&`props`in globalThis?globalThis.props:(e||{}).props).title||``,(e||{}).currentPath=(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router)&&(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router).currentRoute?(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router).currentRoute.path:``,(e||{}).getHref=function(e,t){let n=e||`/`;return t?t.resolve(n).href:typeof n==`string`?n:n&&n.path?n.path:`#`},(e||{}).getActiveClass=function(e,t,n,r,i,a){let o=n||``;if(!t)return o;let s=e||`/`,c=t.resolve(s).path,l=t.currentRoute.path,u=r||t.options&&t.options.linkActiveClass||`router-link-active`,d=i||t.options&&t.options.linkExactActiveClass||`router-link-exact-active`;return l===c?(o?o+` `:``)+u+` `+d:c!==`/`&&l.startsWith(c.endsWith(`/`)?c:c+`/`)?(o?o+` `:``)+u:o},(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router)&&typeof(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router).subscribe==`function`){let t=(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router).subscribe((()=>{typeof n==`function`?n(e,`currentPath`,(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router).currentRoute.path):(e||{}).currentPath=(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router).currentRoute.path,typeof(typeof a==`function`?a(e,`__drift_mark_dirty__`):typeof r==`function`&&r(e,`__drift_mark_dirty__`)?e.__drift_mark_dirty__:typeof globalThis<`u`&&globalThis&&`__drift_mark_dirty__`in globalThis?globalThis.__drift_mark_dirty__:(e||{}).__drift_mark_dirty__)==`function`&&(typeof a==`function`?a(e,`__drift_mark_dirty__`):typeof r==`function`&&r(e,`__drift_mark_dirty__`)?e.__drift_mark_dirty__:typeof globalThis<`u`&&globalThis&&`__drift_mark_dirty__`in globalThis?globalThis.__drift_mark_dirty__:(e||{}).__drift_mark_dirty__)(`currentPath`)}));typeof(typeof a==`function`?a(e,`onUnmount`):typeof r==`function`&&r(e,`onUnmount`)?e.onUnmount:typeof globalThis<`u`&&globalThis&&`onUnmount`in globalThis?globalThis.onUnmount:(e||{}).onUnmount)==`function`&&(typeof a==`function`?a(e,`onUnmount`):typeof r==`function`&&r(e,`onUnmount`)?e.onUnmount:typeof globalThis<`u`&&globalThis&&`onUnmount`in globalThis?globalThis.onUnmount:(e||{}).onUnmount)((()=>{t()}))}(e||{}).handleClick=function(t){if(t.defaultPrevented||t.button!==0)return;let i=(typeof a==`function`?a(e,`props`):typeof r==`function`&&r(e,`props`)?e.props:typeof globalThis<`u`&&globalThis&&`props`in globalThis?globalThis.props:(e||{}).props).target||(typeof a==`function`?a(e,`target`):typeof r==`function`&&r(e,`target`)?e.target:typeof globalThis<`u`&&globalThis&&`target`in globalThis?globalThis.target:(e||{}).target);if(i&&i!==`_self`||t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||(t.preventDefault(),!(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router)))return;let o=(typeof a==`function`?a(e,`props`):typeof r==`function`&&r(e,`props`)?e.props:typeof globalThis<`u`&&globalThis&&`props`in globalThis?globalThis.props:(e||{}).props).to||(typeof a==`function`?a(e,`to`):typeof r==`function`&&r(e,`to`)?e.to:typeof globalThis<`u`&&globalThis&&`to`in globalThis?globalThis.to:(e||{}).to)||`/`;(typeof a==`function`?a(e,`props`):typeof r==`function`&&r(e,`props`)?e.props:typeof globalThis<`u`&&globalThis&&`props`in globalThis?globalThis.props:(e||{}).props).replace||(typeof a==`function`?a(e,`replace`):typeof r==`function`&&r(e,`replace`)?e.replace:typeof globalThis<`u`&&globalThis&&`replace`in globalThis?globalThis.replace:(e||{}).replace)?(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router).replace(o):(()=>{let t=(typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router).push(o);return typeof n==`function`&&e&&typeof r==`function`&&r(e,`router`)&&n(e,`router`,e.router),t})()}}},`a`,`href`,{__drift_fn__:(e,t,n,r,i,a)=>(typeof a==`function`?a(e,`getHref`):typeof r==`function`&&r(e,`getHref`)?e.getHref:typeof globalThis<`u`&&globalThis&&`getHref`in globalThis?globalThis.getHref:(e||{}).getHref)((typeof a==`function`?a(e,`props`):typeof r==`function`&&r(e,`props`)?e.props:typeof globalThis<`u`&&globalThis&&`props`in globalThis?globalThis.props:(e||{}).props).to||(typeof a==`function`?a(e,`to`):typeof r==`function`&&r(e,`to`)?e.to:typeof globalThis<`u`&&globalThis&&`to`in globalThis?globalThis.to:(e||{}).to),typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router)},`class`,{__drift_fn__:(e,t,n,r,i,a)=>(typeof a==`function`?a(e,`getActiveClass`):typeof r==`function`&&r(e,`getActiveClass`)?e.getActiveClass:typeof globalThis<`u`&&globalThis&&`getActiveClass`in globalThis?globalThis.getActiveClass:(e||{}).getActiveClass)((typeof a==`function`?a(e,`props`):typeof r==`function`&&r(e,`props`)?e.props:typeof globalThis<`u`&&globalThis&&`props`in globalThis?globalThis.props:(e||{}).props).to||(typeof a==`function`?a(e,`to`):typeof r==`function`&&r(e,`to`)?e.to:typeof globalThis<`u`&&globalThis&&`to`in globalThis?globalThis.to:(e||{}).to),typeof a==`function`?a(e,`router`):typeof r==`function`&&r(e,`router`)?e.router:typeof globalThis<`u`&&globalThis&&`router`in globalThis?globalThis.router:(e||{}).router,(typeof a==`function`?a(e,`props`):typeof r==`function`&&r(e,`props`)?e.props:typeof globalThis<`u`&&globalThis&&`props`in globalThis?globalThis.props:(e||{}).props).class||(typeof a==`function`?a(e,`customClass`):typeof r==`function`&&r(e,`customClass`)?e.customClass:typeof globalThis<`u`&&globalThis&&`customClass`in globalThis?globalThis.customClass:(e||{}).customClass),(typeof a==`function`?a(e,`props`):typeof r==`function`&&r(e,`props`)?e.props:typeof globalThis<`u`&&globalThis&&`props`in globalThis?globalThis.props:(e||{}).props).activeClass,(typeof a==`function`?a(e,`props`):typeof r==`function`&&r(e,`props`)?e.props:typeof globalThis<`u`&&globalThis&&`props`in globalThis?globalThis.props:(e||{}).props).exactActiveClass,typeof a==`function`?a(e,`currentPath`):typeof r==`function`&&r(e,`currentPath`)?e.currentPath:typeof globalThis<`u`&&globalThis&&`currentPath`in globalThis?globalThis.currentPath:(e||{}).currentPath)},`target`,{__drift_fn__:(e,t,n,r,i,a)=>(typeof a==`function`?a(e,`props`):typeof r==`function`&&r(e,`props`)?e.props:typeof globalThis<`u`&&globalThis&&`props`in globalThis?globalThis.props:(e||{}).props).target||(typeof a==`function`?a(e,`target`):typeof r==`function`&&r(e,`target`)?e.target:typeof globalThis<`u`&&globalThis&&`target`in globalThis?globalThis.target:(e||{}).target)},`rel`,{__drift_fn__:(e,t,n,r,i,a)=>(typeof a==`function`?a(e,`props`):typeof r==`function`&&r(e,`props`)?e.props:typeof globalThis<`u`&&globalThis&&`props`in globalThis?globalThis.props:(e||{}).props).rel||(typeof a==`function`?a(e,`rel`):typeof r==`function`&&r(e,`rel`)?e.rel:typeof globalThis<`u`&&globalThis&&`rel`in globalThis?globalThis.rel:(e||{}).rel)},`onclick`,{__drift_fn__:(e,t,n,r,i,a)=>typeof a==`function`?a(e,`handleClick`):typeof r==`function`&&r(e,`handleClick`)?e.handleClick:typeof globalThis<`u`&&globalThis&&`handleClick`in globalThis?globalThis.handleClick:(e||{}).handleClick},{__drift_fn__:(e,t,n,r,i,a)=>(typeof a==`function`?a(e,`props`):typeof r==`function`&&r(e,`props`)?e.props:typeof globalThis<`u`&&globalThis&&`props`in globalThis?globalThis.props:(e||{}).props).label||(typeof a==`function`?a(e,`props`):typeof r==`function`&&r(e,`props`)?e.props:typeof globalThis<`u`&&globalThis&&`props`in globalThis?globalThis.props:(e||{}).props).title||(typeof a==`function`?a(e,`label`):typeof r==`function`&&r(e,`label`)?e.label:typeof globalThis<`u`&&globalThis&&`label`in globalThis?globalThis.label:(e||{}).label)}],reactiveBindings:[{variable:`getHref`,positions:[{pc:7,opcode:5}]},{variable:`to`,positions:[{pc:7,opcode:5},{pc:12,opcode:5}]},{variable:`router`,positions:[{pc:7,opcode:5},{pc:12,opcode:5}]},{variable:`getActiveClass`,positions:[{pc:12,opcode:5}]},{variable:`customClass`,positions:[{pc:12,opcode:5}]},{variable:`currentPath`,positions:[{pc:12,opcode:5}]},{variable:`target`,positions:[{pc:17,opcode:5}]},{variable:`rel`,positions:[{pc:22,opcode:5}]},{variable:`handleClick`,positions:[{pc:27,opcode:5}]},{variable:`label`,positions:[{pc:32,opcode:7}]}],declaredVars:[`RouterContext`,`onUnmount`,`router`,`to`,`replace`,`target`,`rel`,`customClass`,`label`,`currentPath`,`getHref`,`getActiveClass`,`handleClick`],derived:[],scope:{RouterContext:M,onUnmount:e.onUnmount}};exports.Link=H,exports.RouteContext=N,exports.RouterContext=M,exports.RouterDepthContext=P,exports.RouterView=V,exports.START_LOCATION_NORMALIZED=F,exports.buildHistoryState=c,exports.compilePathToRegex=O,exports.createHistoryListeners=o,exports.createHref=i,exports.createMatcher=A,exports.createMemoryHistory=d,exports.createNavigationFailure=I,exports.createRouter=B,exports.createWebHashHistory=u,exports.createWebHistory=l,exports.extractHistoryState=s,exports.formatHashHref=a,exports.isNavigationFailure=L,exports.normalizeBase=n,exports.normalizePath=t,exports.normalizeRouteRecord=k,exports.parseQuery=w,exports.stringifyQuery=T,exports.stripBase=r;