From ba68375be1ecf777ec53d59db024a269849cda67 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Thu, 25 Aug 2022 08:30:33 +0200 Subject: [PATCH] build: bundle 3.6.4 --- composables.js | 2 +- composables.mjs | 2 +- dist/vue-router.common.js | 4 ++-- dist/vue-router.esm.browser.js | 6 +++--- dist/vue-router.esm.browser.min.js | 6 +++--- dist/vue-router.esm.js | 6 +++--- dist/vue-router.js | 4 ++-- dist/vue-router.min.js | 6 +++--- dist/vue-router.mjs | 6 +++--- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/composables.js b/composables.js index a8139dc8e..fb1ef732c 100644 --- a/composables.js +++ b/composables.js @@ -1,5 +1,5 @@ /*! - * vue-router v3.6.3 + * vue-router v3.6.4 * (c) 2022 Evan You * @license MIT */ diff --git a/composables.mjs b/composables.mjs index 39b1994a8..29c1bd882 100644 --- a/composables.mjs +++ b/composables.mjs @@ -1,5 +1,5 @@ /*! - * vue-router v3.6.3 + * vue-router v3.6.4 * (c) 2022 Evan You * @license MIT */ diff --git a/dist/vue-router.common.js b/dist/vue-router.common.js index f18ef0dab..daa69c396 100644 --- a/dist/vue-router.common.js +++ b/dist/vue-router.common.js @@ -1,5 +1,5 @@ /*! - * vue-router v3.6.3 + * vue-router v3.6.4 * (c) 2022 Evan You * @license MIT */ @@ -3147,7 +3147,7 @@ function createHref (base, fullPath, mode) { // We cannot remove this as it would be a breaking change VueRouter.install = install; -VueRouter.version = '3.6.3'; +VueRouter.version = '3.6.4'; VueRouter.isNavigationFailure = isNavigationFailure; VueRouter.NavigationFailureType = NavigationFailureType; VueRouter.START_LOCATION = START; diff --git a/dist/vue-router.esm.browser.js b/dist/vue-router.esm.browser.js index 05011b4b7..2b719d4fd 100644 --- a/dist/vue-router.esm.browser.js +++ b/dist/vue-router.esm.browser.js @@ -1,5 +1,5 @@ /*! - * vue-router v3.6.3 + * vue-router v3.6.4 * (c) 2022 Evan You * @license MIT */ @@ -3111,7 +3111,7 @@ function createHref (base, fullPath, mode) { // We cannot remove this as it would be a breaking change VueRouter.install = install; -VueRouter.version = '3.6.3'; +VueRouter.version = '3.6.4'; VueRouter.isNavigationFailure = isNavigationFailure; VueRouter.NavigationFailureType = NavigationFailureType; VueRouter.START_LOCATION = START; @@ -3120,6 +3120,6 @@ if (inBrowser && window.Vue) { window.Vue.use(VueRouter); } -const version = '3.6.3'; +const version = '3.6.4'; export { NavigationFailureType, Link as RouterLink, View as RouterView, START as START_LOCATION, VueRouter as default, isNavigationFailure, version }; diff --git a/dist/vue-router.esm.browser.min.js b/dist/vue-router.esm.browser.min.js index 003c2ca03..10107e5bc 100644 --- a/dist/vue-router.esm.browser.min.js +++ b/dist/vue-router.esm.browser.min.js @@ -1,11 +1,11 @@ /*! - * vue-router v3.6.3 + * vue-router v3.6.4 * (c) 2022 Evan You * @license MIT */ /*! - * vue-router v3.6.3 + * vue-router v3.6.4 * (c) 2022 Evan You * @license MIT */ -function t(t,e){for(const n in e)t[n]=e[n];return t}const e=/[!'()*]/g,n=t=>"%"+t.charCodeAt(0).toString(16),r=/%2C/g,o=t=>encodeURIComponent(t).replace(e,n).replace(r,",");function i(t){try{return decodeURIComponent(t)}catch(t){}return t}const s=t=>null==t||"object"==typeof t?t:String(t);function a(t){const e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach(t=>{const n=t.replace(/\+/g," ").split("="),r=i(n.shift()),o=n.length>0?i(n.join("=")):null;void 0===e[r]?e[r]=o:Array.isArray(e[r])?e[r].push(o):e[r]=[e[r],o]}),e):e}function c(t){const e=t?Object.keys(t).map(e=>{const n=t[e];if(void 0===n)return"";if(null===n)return o(e);if(Array.isArray(n)){const t=[];return n.forEach(n=>{void 0!==n&&(null===n?t.push(o(e)):t.push(o(e)+"="+o(n)))}),t.join("&")}return o(e)+"="+o(n)}).filter(t=>t.length>0).join("&"):null;return e?"?"+e:""}const u=/\/?$/;function h(t,e,n,r){const o=r&&r.options.stringifyQuery;let i=e.query||{};try{i=l(i)}catch(t){}const s={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:i,params:e.params||{},fullPath:d(e,o),matched:t?f(t):[]};return n&&(s.redirectedFrom=d(n,o)),Object.freeze(s)}function l(t){if(Array.isArray(t))return t.map(l);if(t&&"object"==typeof t){const e={};for(const n in t)e[n]=l(t[n]);return e}return t}const p=h(null,{path:"/"});function f(t){const e=[];for(;t;)e.unshift(t),t=t.parent;return e}function d({path:t,query:e={},hash:n=""},r){return(t||"/")+(r||c)(e)+n}function y(t,e,n){return e===p?t===e:!!e&&(t.path&&e.path?t.path.replace(u,"")===e.path.replace(u,"")&&(n||t.hash===e.hash&&m(t.query,e.query)):!(!t.name||!e.name)&&(t.name===e.name&&(n||t.hash===e.hash&&m(t.query,e.query)&&m(t.params,e.params))))}function m(t={},e={}){if(!t||!e)return t===e;const n=Object.keys(t).sort(),r=Object.keys(e).sort();return n.length===r.length&&n.every((n,o)=>{const i=t[n];if(r[o]!==n)return!1;const s=e[n];return null==i||null==s?i===s:"object"==typeof i&&"object"==typeof s?m(i,s):String(i)===String(s)})}function g(t){for(let e=0;e{const n=p.instances[a];(e&&n!==t||!e&&n===t)&&(p.instances[a]=e)},(i.hook||(i.hook={})).prepatch=(t,e)=>{p.instances[a]=e.componentInstance},i.hook.init=t=>{t.data.keepAlive&&t.componentInstance&&t.componentInstance!==p.instances[a]&&(p.instances[a]=t.componentInstance),g(c)};const d=p.props&&p.props[a];return d&&(t(u[a],{route:c,configProps:d}),b(f,i,c,d)),s(f,i,r)}};function b(e,n,r,o){let i=n.props=function(t,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(t);case"boolean":return e?t.params:void 0}}(r,o);if(i){i=n.props=t({},i);const r=n.attrs=n.attrs||{};for(const t in i)e.props&&t in e.props||(r[t]=i[t],delete i[t])}}function v(t,e,n){const r=t.charAt(0);if("/"===r)return t;if("?"===r||"#"===r)return e+t;const o=e.split("/");n&&o[o.length-1]||o.pop();const i=t.replace(/^\//,"").split("/");for(let t=0;t=0&&(e=t.slice(r),t=t.slice(0,r));const o=t.indexOf("?");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{path:t,query:n,hash:e}}(i.path||""),u=n&&n.path||"/",h=c.path?v(c.path,u,r||i.append):u,l=function(t,e={},n){const r=n||a;let o;try{o=r(t||"")}catch(t){o={}}for(const t in e){const n=e[t];o[t]=Array.isArray(n)?n.map(s):s(n)}return o}(c.query,i.query,o&&o.options.parseQuery);let p=i.hash||c.hash;return p&&"#"!==p.charAt(0)&&(p="#"+p),{_normalized:!0,path:h,query:l,hash:p}}const N=()=>{};var H={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render(e){const n=this.$router,r=this.$route,{location:o,route:i,href:s}=n.resolve(this.to,r,this.append),a={},c=n.options.linkActiveClass,l=n.options.linkExactActiveClass,p=null==c?"router-link-active":c,f=null==l?"router-link-exact-active":l,d=null==this.activeClass?p:this.activeClass,m=null==this.exactActiveClass?f:this.exactActiveClass,g=i.redirectedFrom?h(null,V(i.redirectedFrom),null,n):i;a[m]=y(r,g,this.exactPath),a[d]=this.exact||this.exactPath?a[m]:function(t,e){return 0===t.path.replace(u,"/").indexOf(e.path.replace(u,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(const n in e)if(!(n in t))return!1;return!0}(t.query,e.query)}(r,g);const w=a[m]?this.ariaCurrentValue:null,b=t=>{F(t)&&(this.replace?n.replace(o,N):n.push(o,N))},v={click:F};Array.isArray(this.event)?this.event.forEach(t=>{v[t]=b}):v[this.event]=b;const x={class:a},R=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:s,route:i,navigate:b,isActive:a[d],isExactActive:a[m]});if(R){if(1===R.length)return R[0];if(R.length>1||!R.length)return 0===R.length?e():e("span",{},R)}if("a"===this.tag)x.on=v,x.attrs={href:s,"aria-current":w};else{const e=function t(e){if(e){let n;for(let r=0;r{!function t(e,n,r,o,i,s){const{path:a,name:c}=o,u=o.pathToRegexpOptions||{},h=function(t,e,n){n||(t=t.replace(/\/$/,""));return"/"===t[0]||null==e?t:x(`${e.path}/${t}`)}(a,i,u.strict);"boolean"==typeof o.caseSensitive&&(u.sensitive=o.caseSensitive);const l={path:h,regex:J(h,u),components:o.components||{default:o.component},alias:o.alias?"string"==typeof o.alias?[o.alias]:o.alias:[],instances:{},enteredCbs:{},name:c,parent:i,matchAs:s,redirect:o.redirect,beforeEnter:o.beforeEnter,meta:o.meta||{},props:null==o.props?{}:o.components?o.props:{default:o.props}};o.children&&o.children.forEach(o=>{const i=s?x(`${s}/${o.path}`):void 0;t(e,n,r,o,l,i)});n[l.path]||(e.push(l.path),n[l.path]=l);if(void 0!==o.alias){const s=Array.isArray(o.alias)?o.alias:[o.alias];for(let a=0;a!t.optional).map(t=>t.name);if("object"!=typeof c.params&&(c.params={}),i&&"object"==typeof i.params)for(const t in i.params)!(t in c.params)&&e.indexOf(t)>-1&&(c.params[t]=i.params[t]);return c.path=M(t.path,c.params),a(t,c,s)}if(c.path){c.params={};for(let t=0;t({path:t,children:[e]})),n,r,o,i)},getRoutes:function(){return n.map(t=>r[t])},addRoutes:function(t){K(t,n,r,o)}}}function X(t,e,n){const r=e.match(t);if(!r)return!1;if(!n)return!0;for(let e=1,o=r.length;e{window.removeEventListener("popstate",it)}}function rt(t,e,n,r){if(!t.app)return;const o=t.options.scrollBehavior;o&&t.app.$nextTick(()=>{const i=function(){const t=Z();if(t)return et[t]}(),s=o.call(t,e,n,r?i:null);s&&("function"==typeof s.then?s.then(t=>{ht(t,i)}).catch(t=>{}):ht(s,i))})}function ot(){const t=Z();t&&(et[t]={x:window.pageXOffset,y:window.pageYOffset})}function it(t){ot(),t.state&&t.state.key&&tt(t.state.key)}function st(t){return ct(t.x)||ct(t.y)}function at(t){return{x:ct(t.x)?t.x:window.pageXOffset,y:ct(t.y)?t.y:window.pageYOffset}}function ct(t){return"number"==typeof t}const ut=/^#\d/;function ht(t,e){const n="object"==typeof t;if(n&&"string"==typeof t.selector){const n=ut.test(t.selector)?document.getElementById(t.selector.slice(1)):document.querySelector(t.selector);if(n){let o=t.offset&&"object"==typeof t.offset?t.offset:{};o={x:ct((r=o).x)?r.x:0,y:ct(r.y)?r.y:0},e=function(t,e){const n=document.documentElement.getBoundingClientRect(),r=t.getBoundingClientRect();return{x:r.left-n.left-e.x,y:r.top-n.top-e.y}}(n,o)}else st(t)&&(e=at(t))}else n&&st(t)&&(e=at(t));var r;e&&("scrollBehavior"in document.documentElement.style?window.scrollTo({left:e.x,top:e.y,behavior:t.behavior}):window.scrollTo(e.x,e.y))}const lt=D&&function(){const t=window.navigator.userAgent;return(-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&(window.history&&"function"==typeof window.history.pushState)}();function pt(e,n){ot();const r=window.history;try{if(n){const n=t({},r.state);n.key=Z(),r.replaceState(n,"",e)}else r.pushState({key:tt(W())},"",e)}catch(t){window.location[n?"replace":"assign"](e)}}function ft(t){pt(t,!0)}const dt={redirected:2,aborted:4,cancelled:8,duplicated:16};function yt(t,e){return gt(t,e,dt.redirected,`Redirected when going from "${t.fullPath}" to "${function(t){if("string"==typeof t)return t;if("path"in t)return t.path;const e={};return wt.forEach(n=>{n in t&&(e[n]=t[n])}),JSON.stringify(e,null,2)}(e)}" via a navigation guard.`)}function mt(t,e){return gt(t,e,dt.cancelled,`Navigation cancelled from "${t.fullPath}" to "${e.fullPath}" with a new navigation.`)}function gt(t,e,n,r){const o=new Error(r);return o._isRouter=!0,o.from=t,o.to=e,o.type=n,o}const wt=["params","query","hash"];function bt(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}function vt(t,e){return bt(t)&&t._isRouter&&(null==e||t.type===e)}function xt(t,e,n){const r=o=>{o>=t.length?n():t[o]?e(t[o],()=>{r(o+1)}):r(o+1)};r(0)}function Rt(t){return(e,n,r)=>{let o=!1,i=0,s=null;kt(t,(t,e,n,a)=>{if("function"==typeof t&&void 0===t.cid){o=!0,i++;const e=At(e=>{var o;((o=e).__esModule||Ct&&"Module"===o[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:z.extend(e),n.components[a]=e,i--,i<=0&&r()}),c=At(t=>{const e=`Failed to resolve async component ${a}: ${t}`;s||(s=bt(t)?t:new Error(e),r(s))});let u;try{u=t(e,c)}catch(t){c(t)}if(u)if("function"==typeof u.then)u.then(e,c);else{const t=u.component;t&&"function"==typeof t.then&&t.then(e,c)}}}),o||r()}}function kt(t,e){return Et(t.map(t=>Object.keys(t.components).map(n=>e(t.components[n],t.instances[n],t,n))))}function Et(t){return Array.prototype.concat.apply([],t)}const Ct="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function At(t){let e=!1;return function(...n){if(!e)return e=!0,t.apply(this,n)}}class $t{constructor(t,e){this.router=t,this.base=function(t){if(!t)if(D){const e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";"/"!==t.charAt(0)&&(t="/"+t);return t.replace(/\/$/,"")}(e),this.current=p,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]}listen(t){this.cb=t}onReady(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))}onError(t){this.errorCbs.push(t)}transitionTo(t,e,n){let r;try{r=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach(e=>{e(t)}),t}const o=this.current;this.confirmTransition(r,()=>{this.updateRoute(r),e&&e(r),this.ensureURL(),this.router.afterHooks.forEach(t=>{t&&t(r,o)}),this.ready||(this.ready=!0,this.readyCbs.forEach(t=>{t(r)}))},t=>{n&&n(t),t&&!this.ready&&(vt(t,dt.redirected)&&o===p||(this.ready=!0,this.readyErrorCbs.forEach(e=>{e(t)})))})}confirmTransition(t,e,n){const r=this.current;this.pending=t;const o=t=>{!vt(t)&&bt(t)&&(this.errorCbs.length?this.errorCbs.forEach(e=>{e(t)}):console.error(t)),n&&n(t)},i=t.matched.length-1,s=r.matched.length-1;if(y(t,r)&&i===s&&t.matched[i]===r.matched[s])return this.ensureURL(),t.hash&&rt(this.router,r,t,!1),o(function(t,e){const n=gt(t,e,dt.duplicated,`Avoided redundant navigation to current location: "${t.fullPath}".`);return n.name="NavigationDuplicated",n}(r,t));const{updated:a,deactivated:c,activated:u}=function(t,e){let n;const r=Math.max(t.length,e.length);for(n=0;nt.beforeEnter),Rt(u)),l=(e,n)=>{if(this.pending!==t)return o(mt(r,t));try{e(t,r,e=>{!1===e?(this.ensureURL(!0),o(function(t,e){return gt(t,e,dt.aborted,`Navigation aborted from "${t.fullPath}" to "${e.fullPath}" via a navigation guard.`)}(r,t))):bt(e)?(this.ensureURL(!0),o(e)):"string"==typeof e||"object"==typeof e&&("string"==typeof e.path||"string"==typeof e.name)?(o(yt(r,t)),"object"==typeof e&&e.replace?this.replace(e):this.push(e)):n(e)})}catch(t){o(t)}};xt(h,l,()=>{xt(function(t){return Ot(t,"beforeRouteEnter",(t,e,n,r)=>function(t,e,n){return function(r,o,i){return t(r,o,t=>{"function"==typeof t&&(e.enteredCbs[n]||(e.enteredCbs[n]=[]),e.enteredCbs[n].push(t)),i(t)})}}(t,n,r))}(u).concat(this.router.resolveHooks),l,()=>{if(this.pending!==t)return o(mt(r,t));this.pending=null,e(t),this.router.app&&this.router.app.$nextTick(()=>{g(t)})})})}updateRoute(t){this.current=t,this.cb&&this.cb(t)}setupListeners(){}teardown(){this.listeners.forEach(t=>{t()}),this.listeners=[],this.current=p,this.pending=null}}function Ot(t,e,n,r){const o=kt(t,(t,r,o,i)=>{const s=function(t,e){"function"!=typeof t&&(t=z.extend(t));return t.options[e]}(t,e);if(s)return Array.isArray(s)?s.map(t=>n(t,r,o,i)):n(s,r,o,i)});return Et(r?o.reverse():o)}function Tt(t,e){if(e)return function(){return t.apply(e,arguments)}}class St extends $t{constructor(t,e){super(t,e),this._startLocation=jt(this.base)}setupListeners(){if(this.listeners.length>0)return;const t=this.router,e=t.options.scrollBehavior,n=lt&&e;n&&this.listeners.push(nt());const r=()=>{const e=this.current,r=jt(this.base);this.current===p&&r===this._startLocation||this.transitionTo(r,r=>{n&&rt(t,r,e,!0)})};window.addEventListener("popstate",r),this.listeners.push(()=>{window.removeEventListener("popstate",r)})}go(t){window.history.go(t)}push(t,e,n){const{current:r}=this;this.transitionTo(t,t=>{pt(x(this.base+t.fullPath)),rt(this.router,t,r,!1),e&&e(t)},n)}replace(t,e,n){const{current:r}=this;this.transitionTo(t,t=>{ft(x(this.base+t.fullPath)),rt(this.router,t,r,!1),e&&e(t)},n)}ensureURL(t){if(jt(this.base)!==this.current.fullPath){const e=x(this.base+this.current.fullPath);t?pt(e):ft(e)}}getCurrentLocation(){return jt(this.base)}}function jt(t){let e=window.location.pathname;const n=e.toLowerCase(),r=t.toLowerCase();return!t||n!==r&&0!==n.indexOf(x(r+"/"))||(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}class Lt extends $t{constructor(t,e,n){super(t,e),n&&function(t){const e=jt(t);if(!/^\/#/.test(e))return window.location.replace(x(t+"/#"+e)),!0}(this.base)||Pt()}setupListeners(){if(this.listeners.length>0)return;const t=this.router.options.scrollBehavior,e=lt&&t;e&&this.listeners.push(nt());const n=()=>{const t=this.current;Pt()&&this.transitionTo(_t(),n=>{e&&rt(this.router,n,t,!0),lt||It(n.fullPath)})},r=lt?"popstate":"hashchange";window.addEventListener(r,n),this.listeners.push(()=>{window.removeEventListener(r,n)})}push(t,e,n){const{current:r}=this;this.transitionTo(t,t=>{Ut(t.fullPath),rt(this.router,t,r,!1),e&&e(t)},n)}replace(t,e,n){const{current:r}=this;this.transitionTo(t,t=>{It(t.fullPath),rt(this.router,t,r,!1),e&&e(t)},n)}go(t){window.history.go(t)}ensureURL(t){const e=this.current.fullPath;_t()!==e&&(t?Ut(e):It(e))}getCurrentLocation(){return _t()}}function Pt(){const t=_t();return"/"===t.charAt(0)||(It("/"+t),!1)}function _t(){let t=window.location.href;const e=t.indexOf("#");return e<0?"":(t=t.slice(e+1),t)}function qt(t){const e=window.location.href,n=e.indexOf("#");return`${n>=0?e.slice(0,n):e}#${t}`}function Ut(t){lt?pt(qt(t)):window.location.hash=t}function It(t){lt?ft(qt(t)):window.location.replace(qt(t))}class Bt extends $t{constructor(t,e){super(t,e),this.stack=[],this.index=-1}push(t,e,n){this.transitionTo(t,t=>{this.stack=this.stack.slice(0,this.index+1).concat(t),this.index++,e&&e(t)},n)}replace(t,e,n){this.transitionTo(t,t=>{this.stack=this.stack.slice(0,this.index).concat(t),e&&e(t)},n)}go(t){const e=this.index+t;if(e<0||e>=this.stack.length)return;const n=this.stack[e];this.confirmTransition(n,()=>{const t=this.current;this.index=e,this.updateRoute(n),this.router.afterHooks.forEach(e=>{e&&e(n,t)})},t=>{vt(t,dt.duplicated)&&(this.index=e)})}getCurrentLocation(){const t=this.stack[this.stack.length-1];return t?t.fullPath:"/"}ensureURL(){}}class Mt{constructor(t={}){this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Q(t.routes||[],this);let e=t.mode||"hash";switch(this.fallback="history"===e&&!lt&&!1!==t.fallback,this.fallback&&(e="hash"),D||(e="abstract"),this.mode=e,e){case"history":this.history=new St(this,t.base);break;case"hash":this.history=new Lt(this,t.base,this.fallback);break;case"abstract":this.history=new Bt(this,t.base)}}match(t,e,n){return this.matcher.match(t,e,n)}get currentRoute(){return this.history&&this.history.current}init(t){if(this.apps.push(t),t.$once("hook:destroyed",()=>{const e=this.apps.indexOf(t);e>-1&&this.apps.splice(e,1),this.app===t&&(this.app=this.apps[0]||null),this.app||this.history.teardown()}),this.app)return;this.app=t;const e=this.history;if(e instanceof St||e instanceof Lt){const t=t=>{const n=e.current,r=this.options.scrollBehavior;lt&&r&&"fullPath"in t&&rt(this,t,n,!1)},n=n=>{e.setupListeners(),t(n)};e.transitionTo(e.getCurrentLocation(),n,n)}e.listen(t=>{this.apps.forEach(e=>{e._route=t})})}beforeEach(t){return Vt(this.beforeHooks,t)}beforeResolve(t){return Vt(this.resolveHooks,t)}afterEach(t){return Vt(this.afterHooks,t)}onReady(t,e){this.history.onReady(t,e)}onError(t){this.history.onError(t)}push(t,e,n){if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((e,n)=>{this.history.push(t,e,n)});this.history.push(t,e,n)}replace(t,e,n){if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((e,n)=>{this.history.replace(t,e,n)});this.history.replace(t,e,n)}go(t){this.history.go(t)}back(){this.go(-1)}forward(){this.go(1)}getMatchedComponents(t){const e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map(t=>Object.keys(t.components).map(e=>t.components[e]))):[]}resolve(t,e,n){const r=V(t,e=e||this.history.current,n,this),o=this.match(r,e),i=o.redirectedFrom||o.fullPath;return{location:r,route:o,href:function(t,e,n){var r="hash"===n?"#"+e:e;return t?x(t+"/"+r):r}(this.history.base,i,this.mode),normalizedTo:r,resolved:o}}getRoutes(){return this.matcher.getRoutes()}addRoute(t,e){this.matcher.addRoute(t,e),this.history.current!==p&&this.history.transitionTo(this.history.getCurrentLocation())}addRoutes(t){this.matcher.addRoutes(t),this.history.current!==p&&this.history.transitionTo(this.history.getCurrentLocation())}}function Vt(t,e){return t.push(e),()=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)}}Mt.install=function t(e){if(t.installed&&z===e)return;t.installed=!0,z=e;const n=t=>void 0!==t,r=(t,e)=>{let r=t.$options._parentVnode;n(r)&&n(r=r.data)&&n(r=r.registerRouteInstance)&&r(t,e)};e.mixin({beforeCreate(){n(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,r(this,this)},destroyed(){r(this)}}),Object.defineProperty(e.prototype,"$router",{get(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get(){return this._routerRoot._route}}),e.component("RouterView",w),e.component("RouterLink",H);const o=e.config.optionMergeStrategies;o.beforeRouteEnter=o.beforeRouteLeave=o.beforeRouteUpdate=o.created},Mt.version="3.6.3",Mt.isNavigationFailure=vt,Mt.NavigationFailureType=dt,Mt.START_LOCATION=p,D&&window.Vue&&window.Vue.use(Mt);const Nt="3.6.3";export{dt as NavigationFailureType,H as RouterLink,w as RouterView,p as START_LOCATION,Mt as default,vt as isNavigationFailure,Nt as version}; \ No newline at end of file +function t(t,e){for(const n in e)t[n]=e[n];return t}const e=/[!'()*]/g,n=t=>"%"+t.charCodeAt(0).toString(16),r=/%2C/g,o=t=>encodeURIComponent(t).replace(e,n).replace(r,",");function i(t){try{return decodeURIComponent(t)}catch(t){}return t}const s=t=>null==t||"object"==typeof t?t:String(t);function a(t){const e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach(t=>{const n=t.replace(/\+/g," ").split("="),r=i(n.shift()),o=n.length>0?i(n.join("=")):null;void 0===e[r]?e[r]=o:Array.isArray(e[r])?e[r].push(o):e[r]=[e[r],o]}),e):e}function c(t){const e=t?Object.keys(t).map(e=>{const n=t[e];if(void 0===n)return"";if(null===n)return o(e);if(Array.isArray(n)){const t=[];return n.forEach(n=>{void 0!==n&&(null===n?t.push(o(e)):t.push(o(e)+"="+o(n)))}),t.join("&")}return o(e)+"="+o(n)}).filter(t=>t.length>0).join("&"):null;return e?"?"+e:""}const u=/\/?$/;function h(t,e,n,r){const o=r&&r.options.stringifyQuery;let i=e.query||{};try{i=l(i)}catch(t){}const s={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:i,params:e.params||{},fullPath:d(e,o),matched:t?f(t):[]};return n&&(s.redirectedFrom=d(n,o)),Object.freeze(s)}function l(t){if(Array.isArray(t))return t.map(l);if(t&&"object"==typeof t){const e={};for(const n in t)e[n]=l(t[n]);return e}return t}const p=h(null,{path:"/"});function f(t){const e=[];for(;t;)e.unshift(t),t=t.parent;return e}function d({path:t,query:e={},hash:n=""},r){return(t||"/")+(r||c)(e)+n}function y(t,e,n){return e===p?t===e:!!e&&(t.path&&e.path?t.path.replace(u,"")===e.path.replace(u,"")&&(n||t.hash===e.hash&&m(t.query,e.query)):!(!t.name||!e.name)&&(t.name===e.name&&(n||t.hash===e.hash&&m(t.query,e.query)&&m(t.params,e.params))))}function m(t={},e={}){if(!t||!e)return t===e;const n=Object.keys(t).sort(),r=Object.keys(e).sort();return n.length===r.length&&n.every((n,o)=>{const i=t[n];if(r[o]!==n)return!1;const s=e[n];return null==i||null==s?i===s:"object"==typeof i&&"object"==typeof s?m(i,s):String(i)===String(s)})}function g(t){for(let e=0;e{const n=p.instances[a];(e&&n!==t||!e&&n===t)&&(p.instances[a]=e)},(i.hook||(i.hook={})).prepatch=(t,e)=>{p.instances[a]=e.componentInstance},i.hook.init=t=>{t.data.keepAlive&&t.componentInstance&&t.componentInstance!==p.instances[a]&&(p.instances[a]=t.componentInstance),g(c)};const d=p.props&&p.props[a];return d&&(t(u[a],{route:c,configProps:d}),b(f,i,c,d)),s(f,i,r)}};function b(e,n,r,o){let i=n.props=function(t,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(t);case"boolean":return e?t.params:void 0}}(r,o);if(i){i=n.props=t({},i);const r=n.attrs=n.attrs||{};for(const t in i)e.props&&t in e.props||(r[t]=i[t],delete i[t])}}function v(t,e,n){const r=t.charAt(0);if("/"===r)return t;if("?"===r||"#"===r)return e+t;const o=e.split("/");n&&o[o.length-1]||o.pop();const i=t.replace(/^\//,"").split("/");for(let t=0;t=0&&(e=t.slice(r),t=t.slice(0,r));const o=t.indexOf("?");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{path:t,query:n,hash:e}}(i.path||""),u=n&&n.path||"/",h=c.path?v(c.path,u,r||i.append):u,l=function(t,e={},n){const r=n||a;let o;try{o=r(t||"")}catch(t){o={}}for(const t in e){const n=e[t];o[t]=Array.isArray(n)?n.map(s):s(n)}return o}(c.query,i.query,o&&o.options.parseQuery);let p=i.hash||c.hash;return p&&"#"!==p.charAt(0)&&(p="#"+p),{_normalized:!0,path:h,query:l,hash:p}}const N=()=>{};var H={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render(e){const n=this.$router,r=this.$route,{location:o,route:i,href:s}=n.resolve(this.to,r,this.append),a={},c=n.options.linkActiveClass,l=n.options.linkExactActiveClass,p=null==c?"router-link-active":c,f=null==l?"router-link-exact-active":l,d=null==this.activeClass?p:this.activeClass,m=null==this.exactActiveClass?f:this.exactActiveClass,g=i.redirectedFrom?h(null,V(i.redirectedFrom),null,n):i;a[m]=y(r,g,this.exactPath),a[d]=this.exact||this.exactPath?a[m]:function(t,e){return 0===t.path.replace(u,"/").indexOf(e.path.replace(u,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(const n in e)if(!(n in t))return!1;return!0}(t.query,e.query)}(r,g);const w=a[m]?this.ariaCurrentValue:null,b=t=>{F(t)&&(this.replace?n.replace(o,N):n.push(o,N))},v={click:F};Array.isArray(this.event)?this.event.forEach(t=>{v[t]=b}):v[this.event]=b;const x={class:a},R=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:s,route:i,navigate:b,isActive:a[d],isExactActive:a[m]});if(R){if(1===R.length)return R[0];if(R.length>1||!R.length)return 0===R.length?e():e("span",{},R)}if("a"===this.tag)x.on=v,x.attrs={href:s,"aria-current":w};else{const e=function t(e){if(e){let n;for(let r=0;r{!function t(e,n,r,o,i,s){const{path:a,name:c}=o,u=o.pathToRegexpOptions||{},h=function(t,e,n){n||(t=t.replace(/\/$/,""));return"/"===t[0]||null==e?t:x(`${e.path}/${t}`)}(a,i,u.strict);"boolean"==typeof o.caseSensitive&&(u.sensitive=o.caseSensitive);const l={path:h,regex:J(h,u),components:o.components||{default:o.component},alias:o.alias?"string"==typeof o.alias?[o.alias]:o.alias:[],instances:{},enteredCbs:{},name:c,parent:i,matchAs:s,redirect:o.redirect,beforeEnter:o.beforeEnter,meta:o.meta||{},props:null==o.props?{}:o.components?o.props:{default:o.props}};o.children&&o.children.forEach(o=>{const i=s?x(`${s}/${o.path}`):void 0;t(e,n,r,o,l,i)});n[l.path]||(e.push(l.path),n[l.path]=l);if(void 0!==o.alias){const s=Array.isArray(o.alias)?o.alias:[o.alias];for(let a=0;a!t.optional).map(t=>t.name);if("object"!=typeof c.params&&(c.params={}),i&&"object"==typeof i.params)for(const t in i.params)!(t in c.params)&&e.indexOf(t)>-1&&(c.params[t]=i.params[t]);return c.path=M(t.path,c.params),a(t,c,s)}if(c.path){c.params={};for(let t=0;t({path:t,children:[e]})),n,r,o,i)},getRoutes:function(){return n.map(t=>r[t])},addRoutes:function(t){K(t,n,r,o)}}}function X(t,e,n){const r=e.match(t);if(!r)return!1;if(!n)return!0;for(let e=1,o=r.length;e{window.removeEventListener("popstate",it)}}function rt(t,e,n,r){if(!t.app)return;const o=t.options.scrollBehavior;o&&t.app.$nextTick(()=>{const i=function(){const t=Z();if(t)return et[t]}(),s=o.call(t,e,n,r?i:null);s&&("function"==typeof s.then?s.then(t=>{ht(t,i)}).catch(t=>{}):ht(s,i))})}function ot(){const t=Z();t&&(et[t]={x:window.pageXOffset,y:window.pageYOffset})}function it(t){ot(),t.state&&t.state.key&&tt(t.state.key)}function st(t){return ct(t.x)||ct(t.y)}function at(t){return{x:ct(t.x)?t.x:window.pageXOffset,y:ct(t.y)?t.y:window.pageYOffset}}function ct(t){return"number"==typeof t}const ut=/^#\d/;function ht(t,e){const n="object"==typeof t;if(n&&"string"==typeof t.selector){const n=ut.test(t.selector)?document.getElementById(t.selector.slice(1)):document.querySelector(t.selector);if(n){let o=t.offset&&"object"==typeof t.offset?t.offset:{};o={x:ct((r=o).x)?r.x:0,y:ct(r.y)?r.y:0},e=function(t,e){const n=document.documentElement.getBoundingClientRect(),r=t.getBoundingClientRect();return{x:r.left-n.left-e.x,y:r.top-n.top-e.y}}(n,o)}else st(t)&&(e=at(t))}else n&&st(t)&&(e=at(t));var r;e&&("scrollBehavior"in document.documentElement.style?window.scrollTo({left:e.x,top:e.y,behavior:t.behavior}):window.scrollTo(e.x,e.y))}const lt=D&&function(){const t=window.navigator.userAgent;return(-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&(window.history&&"function"==typeof window.history.pushState)}();function pt(e,n){ot();const r=window.history;try{if(n){const n=t({},r.state);n.key=Z(),r.replaceState(n,"",e)}else r.pushState({key:tt(W())},"",e)}catch(t){window.location[n?"replace":"assign"](e)}}function ft(t){pt(t,!0)}const dt={redirected:2,aborted:4,cancelled:8,duplicated:16};function yt(t,e){return gt(t,e,dt.redirected,`Redirected when going from "${t.fullPath}" to "${function(t){if("string"==typeof t)return t;if("path"in t)return t.path;const e={};return wt.forEach(n=>{n in t&&(e[n]=t[n])}),JSON.stringify(e,null,2)}(e)}" via a navigation guard.`)}function mt(t,e){return gt(t,e,dt.cancelled,`Navigation cancelled from "${t.fullPath}" to "${e.fullPath}" with a new navigation.`)}function gt(t,e,n,r){const o=new Error(r);return o._isRouter=!0,o.from=t,o.to=e,o.type=n,o}const wt=["params","query","hash"];function bt(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}function vt(t,e){return bt(t)&&t._isRouter&&(null==e||t.type===e)}function xt(t,e,n){const r=o=>{o>=t.length?n():t[o]?e(t[o],()=>{r(o+1)}):r(o+1)};r(0)}function Rt(t){return(e,n,r)=>{let o=!1,i=0,s=null;kt(t,(t,e,n,a)=>{if("function"==typeof t&&void 0===t.cid){o=!0,i++;const e=At(e=>{var o;((o=e).__esModule||Ct&&"Module"===o[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:z.extend(e),n.components[a]=e,i--,i<=0&&r()}),c=At(t=>{const e=`Failed to resolve async component ${a}: ${t}`;s||(s=bt(t)?t:new Error(e),r(s))});let u;try{u=t(e,c)}catch(t){c(t)}if(u)if("function"==typeof u.then)u.then(e,c);else{const t=u.component;t&&"function"==typeof t.then&&t.then(e,c)}}}),o||r()}}function kt(t,e){return Et(t.map(t=>Object.keys(t.components).map(n=>e(t.components[n],t.instances[n],t,n))))}function Et(t){return Array.prototype.concat.apply([],t)}const Ct="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function At(t){let e=!1;return function(...n){if(!e)return e=!0,t.apply(this,n)}}class $t{constructor(t,e){this.router=t,this.base=function(t){if(!t)if(D){const e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";"/"!==t.charAt(0)&&(t="/"+t);return t.replace(/\/$/,"")}(e),this.current=p,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]}listen(t){this.cb=t}onReady(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))}onError(t){this.errorCbs.push(t)}transitionTo(t,e,n){let r;try{r=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach(e=>{e(t)}),t}const o=this.current;this.confirmTransition(r,()=>{this.updateRoute(r),e&&e(r),this.ensureURL(),this.router.afterHooks.forEach(t=>{t&&t(r,o)}),this.ready||(this.ready=!0,this.readyCbs.forEach(t=>{t(r)}))},t=>{n&&n(t),t&&!this.ready&&(vt(t,dt.redirected)&&o===p||(this.ready=!0,this.readyErrorCbs.forEach(e=>{e(t)})))})}confirmTransition(t,e,n){const r=this.current;this.pending=t;const o=t=>{!vt(t)&&bt(t)&&(this.errorCbs.length?this.errorCbs.forEach(e=>{e(t)}):console.error(t)),n&&n(t)},i=t.matched.length-1,s=r.matched.length-1;if(y(t,r)&&i===s&&t.matched[i]===r.matched[s])return this.ensureURL(),t.hash&&rt(this.router,r,t,!1),o(function(t,e){const n=gt(t,e,dt.duplicated,`Avoided redundant navigation to current location: "${t.fullPath}".`);return n.name="NavigationDuplicated",n}(r,t));const{updated:a,deactivated:c,activated:u}=function(t,e){let n;const r=Math.max(t.length,e.length);for(n=0;nt.beforeEnter),Rt(u)),l=(e,n)=>{if(this.pending!==t)return o(mt(r,t));try{e(t,r,e=>{!1===e?(this.ensureURL(!0),o(function(t,e){return gt(t,e,dt.aborted,`Navigation aborted from "${t.fullPath}" to "${e.fullPath}" via a navigation guard.`)}(r,t))):bt(e)?(this.ensureURL(!0),o(e)):"string"==typeof e||"object"==typeof e&&("string"==typeof e.path||"string"==typeof e.name)?(o(yt(r,t)),"object"==typeof e&&e.replace?this.replace(e):this.push(e)):n(e)})}catch(t){o(t)}};xt(h,l,()=>{xt(function(t){return Ot(t,"beforeRouteEnter",(t,e,n,r)=>function(t,e,n){return function(r,o,i){return t(r,o,t=>{"function"==typeof t&&(e.enteredCbs[n]||(e.enteredCbs[n]=[]),e.enteredCbs[n].push(t)),i(t)})}}(t,n,r))}(u).concat(this.router.resolveHooks),l,()=>{if(this.pending!==t)return o(mt(r,t));this.pending=null,e(t),this.router.app&&this.router.app.$nextTick(()=>{g(t)})})})}updateRoute(t){this.current=t,this.cb&&this.cb(t)}setupListeners(){}teardown(){this.listeners.forEach(t=>{t()}),this.listeners=[],this.current=p,this.pending=null}}function Ot(t,e,n,r){const o=kt(t,(t,r,o,i)=>{const s=function(t,e){"function"!=typeof t&&(t=z.extend(t));return t.options[e]}(t,e);if(s)return Array.isArray(s)?s.map(t=>n(t,r,o,i)):n(s,r,o,i)});return Et(r?o.reverse():o)}function Tt(t,e){if(e)return function(){return t.apply(e,arguments)}}class St extends $t{constructor(t,e){super(t,e),this._startLocation=jt(this.base)}setupListeners(){if(this.listeners.length>0)return;const t=this.router,e=t.options.scrollBehavior,n=lt&&e;n&&this.listeners.push(nt());const r=()=>{const e=this.current,r=jt(this.base);this.current===p&&r===this._startLocation||this.transitionTo(r,r=>{n&&rt(t,r,e,!0)})};window.addEventListener("popstate",r),this.listeners.push(()=>{window.removeEventListener("popstate",r)})}go(t){window.history.go(t)}push(t,e,n){const{current:r}=this;this.transitionTo(t,t=>{pt(x(this.base+t.fullPath)),rt(this.router,t,r,!1),e&&e(t)},n)}replace(t,e,n){const{current:r}=this;this.transitionTo(t,t=>{ft(x(this.base+t.fullPath)),rt(this.router,t,r,!1),e&&e(t)},n)}ensureURL(t){if(jt(this.base)!==this.current.fullPath){const e=x(this.base+this.current.fullPath);t?pt(e):ft(e)}}getCurrentLocation(){return jt(this.base)}}function jt(t){let e=window.location.pathname;const n=e.toLowerCase(),r=t.toLowerCase();return!t||n!==r&&0!==n.indexOf(x(r+"/"))||(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}class Lt extends $t{constructor(t,e,n){super(t,e),n&&function(t){const e=jt(t);if(!/^\/#/.test(e))return window.location.replace(x(t+"/#"+e)),!0}(this.base)||Pt()}setupListeners(){if(this.listeners.length>0)return;const t=this.router.options.scrollBehavior,e=lt&&t;e&&this.listeners.push(nt());const n=()=>{const t=this.current;Pt()&&this.transitionTo(_t(),n=>{e&&rt(this.router,n,t,!0),lt||It(n.fullPath)})},r=lt?"popstate":"hashchange";window.addEventListener(r,n),this.listeners.push(()=>{window.removeEventListener(r,n)})}push(t,e,n){const{current:r}=this;this.transitionTo(t,t=>{Ut(t.fullPath),rt(this.router,t,r,!1),e&&e(t)},n)}replace(t,e,n){const{current:r}=this;this.transitionTo(t,t=>{It(t.fullPath),rt(this.router,t,r,!1),e&&e(t)},n)}go(t){window.history.go(t)}ensureURL(t){const e=this.current.fullPath;_t()!==e&&(t?Ut(e):It(e))}getCurrentLocation(){return _t()}}function Pt(){const t=_t();return"/"===t.charAt(0)||(It("/"+t),!1)}function _t(){let t=window.location.href;const e=t.indexOf("#");return e<0?"":(t=t.slice(e+1),t)}function qt(t){const e=window.location.href,n=e.indexOf("#");return`${n>=0?e.slice(0,n):e}#${t}`}function Ut(t){lt?pt(qt(t)):window.location.hash=t}function It(t){lt?ft(qt(t)):window.location.replace(qt(t))}class Bt extends $t{constructor(t,e){super(t,e),this.stack=[],this.index=-1}push(t,e,n){this.transitionTo(t,t=>{this.stack=this.stack.slice(0,this.index+1).concat(t),this.index++,e&&e(t)},n)}replace(t,e,n){this.transitionTo(t,t=>{this.stack=this.stack.slice(0,this.index).concat(t),e&&e(t)},n)}go(t){const e=this.index+t;if(e<0||e>=this.stack.length)return;const n=this.stack[e];this.confirmTransition(n,()=>{const t=this.current;this.index=e,this.updateRoute(n),this.router.afterHooks.forEach(e=>{e&&e(n,t)})},t=>{vt(t,dt.duplicated)&&(this.index=e)})}getCurrentLocation(){const t=this.stack[this.stack.length-1];return t?t.fullPath:"/"}ensureURL(){}}class Mt{constructor(t={}){this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Q(t.routes||[],this);let e=t.mode||"hash";switch(this.fallback="history"===e&&!lt&&!1!==t.fallback,this.fallback&&(e="hash"),D||(e="abstract"),this.mode=e,e){case"history":this.history=new St(this,t.base);break;case"hash":this.history=new Lt(this,t.base,this.fallback);break;case"abstract":this.history=new Bt(this,t.base)}}match(t,e,n){return this.matcher.match(t,e,n)}get currentRoute(){return this.history&&this.history.current}init(t){if(this.apps.push(t),t.$once("hook:destroyed",()=>{const e=this.apps.indexOf(t);e>-1&&this.apps.splice(e,1),this.app===t&&(this.app=this.apps[0]||null),this.app||this.history.teardown()}),this.app)return;this.app=t;const e=this.history;if(e instanceof St||e instanceof Lt){const t=t=>{const n=e.current,r=this.options.scrollBehavior;lt&&r&&"fullPath"in t&&rt(this,t,n,!1)},n=n=>{e.setupListeners(),t(n)};e.transitionTo(e.getCurrentLocation(),n,n)}e.listen(t=>{this.apps.forEach(e=>{e._route=t})})}beforeEach(t){return Vt(this.beforeHooks,t)}beforeResolve(t){return Vt(this.resolveHooks,t)}afterEach(t){return Vt(this.afterHooks,t)}onReady(t,e){this.history.onReady(t,e)}onError(t){this.history.onError(t)}push(t,e,n){if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((e,n)=>{this.history.push(t,e,n)});this.history.push(t,e,n)}replace(t,e,n){if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((e,n)=>{this.history.replace(t,e,n)});this.history.replace(t,e,n)}go(t){this.history.go(t)}back(){this.go(-1)}forward(){this.go(1)}getMatchedComponents(t){const e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map(t=>Object.keys(t.components).map(e=>t.components[e]))):[]}resolve(t,e,n){const r=V(t,e=e||this.history.current,n,this),o=this.match(r,e),i=o.redirectedFrom||o.fullPath;return{location:r,route:o,href:function(t,e,n){var r="hash"===n?"#"+e:e;return t?x(t+"/"+r):r}(this.history.base,i,this.mode),normalizedTo:r,resolved:o}}getRoutes(){return this.matcher.getRoutes()}addRoute(t,e){this.matcher.addRoute(t,e),this.history.current!==p&&this.history.transitionTo(this.history.getCurrentLocation())}addRoutes(t){this.matcher.addRoutes(t),this.history.current!==p&&this.history.transitionTo(this.history.getCurrentLocation())}}function Vt(t,e){return t.push(e),()=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)}}Mt.install=function t(e){if(t.installed&&z===e)return;t.installed=!0,z=e;const n=t=>void 0!==t,r=(t,e)=>{let r=t.$options._parentVnode;n(r)&&n(r=r.data)&&n(r=r.registerRouteInstance)&&r(t,e)};e.mixin({beforeCreate(){n(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,r(this,this)},destroyed(){r(this)}}),Object.defineProperty(e.prototype,"$router",{get(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get(){return this._routerRoot._route}}),e.component("RouterView",w),e.component("RouterLink",H);const o=e.config.optionMergeStrategies;o.beforeRouteEnter=o.beforeRouteLeave=o.beforeRouteUpdate=o.created},Mt.version="3.6.4",Mt.isNavigationFailure=vt,Mt.NavigationFailureType=dt,Mt.START_LOCATION=p,D&&window.Vue&&window.Vue.use(Mt);const Nt="3.6.4";export{dt as NavigationFailureType,H as RouterLink,w as RouterView,p as START_LOCATION,Mt as default,vt as isNavigationFailure,Nt as version}; \ No newline at end of file diff --git a/dist/vue-router.esm.js b/dist/vue-router.esm.js index 2d9d53163..67a7616e7 100644 --- a/dist/vue-router.esm.js +++ b/dist/vue-router.esm.js @@ -1,5 +1,5 @@ /*! - * vue-router v3.6.3 + * vue-router v3.6.4 * (c) 2022 Evan You * @license MIT */ @@ -3145,7 +3145,7 @@ function createHref (base, fullPath, mode) { // We cannot remove this as it would be a breaking change VueRouter.install = install; -VueRouter.version = '3.6.3'; +VueRouter.version = '3.6.4'; VueRouter.isNavigationFailure = isNavigationFailure; VueRouter.NavigationFailureType = NavigationFailureType; VueRouter.START_LOCATION = START; @@ -3154,6 +3154,6 @@ if (inBrowser && window.Vue) { window.Vue.use(VueRouter); } -var version = '3.6.3'; +var version = '3.6.4'; export { NavigationFailureType, Link as RouterLink, View as RouterView, START as START_LOCATION, VueRouter$1 as default, isNavigationFailure, version }; diff --git a/dist/vue-router.js b/dist/vue-router.js index 6ea93d04a..c785f5cd6 100644 --- a/dist/vue-router.js +++ b/dist/vue-router.js @@ -1,5 +1,5 @@ /*! - * vue-router v3.6.3 + * vue-router v3.6.4 * (c) 2022 Evan You * @license MIT */ @@ -3150,7 +3150,7 @@ // We cannot remove this as it would be a breaking change VueRouter.install = install; - VueRouter.version = '3.6.3'; + VueRouter.version = '3.6.4'; VueRouter.isNavigationFailure = isNavigationFailure; VueRouter.NavigationFailureType = NavigationFailureType; VueRouter.START_LOCATION = START; diff --git a/dist/vue-router.min.js b/dist/vue-router.min.js index 3c7e90f4b..6751d4d25 100644 --- a/dist/vue-router.min.js +++ b/dist/vue-router.min.js @@ -1,11 +1,11 @@ /*! - * vue-router v3.6.3 + * vue-router v3.6.4 * (c) 2022 Evan You * @license MIT */ /*! - * vue-router v3.6.3 + * vue-router v3.6.4 * (c) 2022 Evan You * @license MIT */ -var t,e;t=this,e=function(){"use strict";function t(t,e){for(var r in e)t[r]=e[r];return t}var e=/[!'()*]/g,r=function(t){return"%"+t.charCodeAt(0).toString(16)},n=/%2C/g,o=function(t){return encodeURIComponent(t).replace(e,r).replace(n,",")};function i(t){try{return decodeURIComponent(t)}catch(t){}return t}var a=function(t){return null==t||"object"==typeof t?t:String(t)};function s(t){var e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach((function(t){var r=t.replace(/\+/g," ").split("="),n=i(r.shift()),o=r.length>0?i(r.join("=")):null;void 0===e[n]?e[n]=o:Array.isArray(e[n])?e[n].push(o):e[n]=[e[n],o]})),e):e}function u(t){var e=t?Object.keys(t).map((function(e){var r=t[e];if(void 0===r)return"";if(null===r)return o(e);if(Array.isArray(r)){var n=[];return r.forEach((function(t){void 0!==t&&(null===t?n.push(o(e)):n.push(o(e)+"="+o(t)))})),n.join("&")}return o(e)+"="+o(r)})).filter((function(t){return t.length>0})).join("&"):null;return e?"?"+e:""}var c=/\/?$/;function p(t,e,r,n){var o=n&&n.options.stringifyQuery,i=e.query||{};try{i=f(i)}catch(t){}var a={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:i,params:e.params||{},fullPath:d(e,o),matched:t?l(t):[]};return r&&(a.redirectedFrom=d(r,o)),Object.freeze(a)}function f(t){if(Array.isArray(t))return t.map(f);if(t&&"object"==typeof t){var e={};for(var r in t)e[r]=f(t[r]);return e}return t}var h=p(null,{path:"/"});function l(t){for(var e=[];t;)e.unshift(t),t=t.parent;return e}function d(t,e){var r=t.path,n=t.query;void 0===n&&(n={});var o=t.hash;return void 0===o&&(o=""),(r||"/")+(e||u)(n)+o}function v(t,e,r){return e===h?t===e:!!e&&(t.path&&e.path?t.path.replace(c,"")===e.path.replace(c,"")&&(r||t.hash===e.hash&&y(t.query,e.query)):!(!t.name||!e.name)&&t.name===e.name&&(r||t.hash===e.hash&&y(t.query,e.query)&&y(t.params,e.params)))}function y(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),!t||!e)return t===e;var r=Object.keys(t).sort(),n=Object.keys(e).sort();return r.length===n.length&&r.every((function(r,o){var i=t[r];if(n[o]!==r)return!1;var a=e[r];return null==i||null==a?i===a:"object"==typeof i&&"object"==typeof a?y(i,a):String(i)===String(a)}))}function m(t){for(var e=0;e=0&&(e=t.slice(n),t=t.slice(0,n));var o=t.indexOf("?");return o>=0&&(r=t.slice(o+1),t=t.slice(0,o)),{path:t,query:r,hash:e}}(i.path||""),h=r&&r.path||"/",l=f.path?b(f.path,h,n||i.append):h,d=function(t,e,r){void 0===e&&(e={});var n,o=r||s;try{n=o(t||"")}catch(t){n={}}for(var i in e){var u=e[i];n[i]=Array.isArray(u)?u.map(a):a(u)}return n}(f.query,i.query,o&&o.options.parseQuery),v=i.hash||f.hash;return v&&"#"!==v.charAt(0)&&(v="#"+v),{_normalized:!0,path:l,query:d,hash:v}}var H,N=function(){},F={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render:function(e){var r=this,n=this.$router,o=this.$route,i=n.resolve(this.to,o,this.append),a=i.location,s=i.route,u=i.href,f={},h=n.options.linkActiveClass,l=n.options.linkExactActiveClass,d=null==h?"router-link-active":h,y=null==l?"router-link-exact-active":l,m=null==this.activeClass?d:this.activeClass,g=null==this.exactActiveClass?y:this.exactActiveClass,w=s.redirectedFrom?p(null,V(s.redirectedFrom),null,n):s;f[g]=v(o,w,this.exactPath),f[m]=this.exact||this.exactPath?f[g]:function(t,e){return 0===t.path.replace(c,"/").indexOf(e.path.replace(c,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var r in e)if(!(r in t))return!1;return!0}(t.query,e.query)}(o,w);var b=f[g]?this.ariaCurrentValue:null,x=function(t){z(t)&&(r.replace?n.replace(a,N):n.push(a,N))},R={click:z};Array.isArray(this.event)?this.event.forEach((function(t){R[t]=x})):R[this.event]=x;var k={class:f},E=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:u,route:s,navigate:x,isActive:f[m],isExactActive:f[g]});if(E){if(1===E.length)return E[0];if(E.length>1||!E.length)return 0===E.length?e():e("span",{},E)}if("a"===this.tag)k.on=R,k.attrs={href:u,"aria-current":b};else{var C=function t(e){var r;if(e)for(var n=0;n-1&&(s.params[h]=r.params[h]);return s.path=M(p.path,s.params),u(p,s,a)}if(s.path){s.params={};for(var l=0;l-1}function xt(t,e){return bt(t)&&t._isRouter&&(null==e||t.type===e)}function Rt(t,e,r){var n=function(o){o>=t.length?r():t[o]?e(t[o],(function(){n(o+1)})):n(o+1)};n(0)}function kt(t){return function(e,r,n){var o=!1,i=0,a=null;Et(t,(function(t,e,r,s){if("function"==typeof t&&void 0===t.cid){o=!0,i++;var u,c=Ot((function(e){var o;((o=e).__esModule||At&&"Module"===o[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:H.extend(e),r.components[s]=e,--i<=0&&n()})),p=Ot((function(t){var e="Failed to resolve async component "+s+": "+t;a||(a=bt(t)?t:new Error(e),n(a))}));try{u=t(c,p)}catch(t){p(t)}if(u)if("function"==typeof u.then)u.then(c,p);else{var f=u.component;f&&"function"==typeof f.then&&f.then(c,p)}}})),o||n()}}function Et(t,e){return Ct(t.map((function(t){return Object.keys(t.components).map((function(r){return e(t.components[r],t.instances[r],t,r)}))})))}function Ct(t){return Array.prototype.concat.apply([],t)}var At="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Ot(t){var e=!1;return function(){for(var r=[],n=arguments.length;n--;)r[n]=arguments[n];if(!e)return e=!0,t.apply(this,r)}}var _t=function(t,e){this.router=t,this.base=function(t){if(!t)if(D){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";return"/"!==t.charAt(0)&&(t="/"+t),t.replace(/\/$/,"")}(e),this.current=h,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function jt(t,e,r,n){var o=Et(t,(function(t,n,o,i){var a=function(t,e){return"function"!=typeof t&&(t=H.extend(t)),t.options[e]}(t,e);if(a)return Array.isArray(a)?a.map((function(t){return r(t,n,o,i)})):r(a,n,o,i)}));return Ct(n?o.reverse():o)}function Tt(t,e){if(e)return function(){return t.apply(e,arguments)}}_t.prototype.listen=function(t){this.cb=t},_t.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},_t.prototype.onError=function(t){this.errorCbs.push(t)},_t.prototype.transitionTo=function(t,e,r){var n,o=this;try{n=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach((function(e){e(t)})),t}var i=this.current;this.confirmTransition(n,(function(){o.updateRoute(n),e&&e(n),o.ensureURL(),o.router.afterHooks.forEach((function(t){t&&t(n,i)})),o.ready||(o.ready=!0,o.readyCbs.forEach((function(t){t(n)})))}),(function(t){r&&r(t),t&&!o.ready&&(xt(t,vt.redirected)&&i===h||(o.ready=!0,o.readyErrorCbs.forEach((function(e){e(t)}))))}))},_t.prototype.confirmTransition=function(t,e,r){var n=this,o=this.current;this.pending=t;var i,a,s=function(t){!xt(t)&&bt(t)&&(n.errorCbs.length?n.errorCbs.forEach((function(e){e(t)})):console.error(t)),r&&r(t)},u=t.matched.length-1,c=o.matched.length-1;if(v(t,o)&&u===c&&t.matched[u]===o.matched[c])return this.ensureURL(),t.hash&&nt(this.router,o,t,!1),s(((a=gt(i=o,t,vt.duplicated,'Avoided redundant navigation to current location: "'+i.fullPath+'".')).name="NavigationDuplicated",a));var p=function(t,e){var r,n=Math.max(t.length,e.length);for(r=0;r0)){var e=this.router,r=e.options.scrollBehavior,n=ht&&r;n&&this.listeners.push(rt());var o=function(){var r=t.current,o=Pt(t.base);t.current===h&&o===t._startLocation||t.transitionTo(o,(function(t){n&&nt(e,t,r,!0)}))};window.addEventListener("popstate",o),this.listeners.push((function(){window.removeEventListener("popstate",o)}))}},e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){lt(x(n.base+t.fullPath)),nt(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.replace=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){dt(x(n.base+t.fullPath)),nt(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.ensureURL=function(t){if(Pt(this.base)!==this.current.fullPath){var e=x(this.base+this.current.fullPath);t?lt(e):dt(e)}},e.prototype.getCurrentLocation=function(){return Pt(this.base)},e}(_t);function Pt(t){var e=window.location.pathname,r=e.toLowerCase(),n=t.toLowerCase();return!t||r!==n&&0!==r.indexOf(x(n+"/"))||(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var Lt=function(t){function e(e,r,n){t.call(this,e,r),n&&function(t){var e=Pt(t);if(!/^\/#/.test(e))return window.location.replace(x(t+"/#"+e)),!0}(this.base)||$t()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router.options.scrollBehavior,r=ht&&e;r&&this.listeners.push(rt());var n=function(){var e=t.current;$t()&&t.transitionTo(qt(),(function(n){r&&nt(t.router,n,e,!0),ht||It(n.fullPath)}))},o=ht?"popstate":"hashchange";window.addEventListener(o,n),this.listeners.push((function(){window.removeEventListener(o,n)}))}},e.prototype.push=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){Bt(t.fullPath),nt(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.replace=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){It(t.fullPath),nt(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;qt()!==e&&(t?Bt(e):It(e))},e.prototype.getCurrentLocation=function(){return qt()},e}(_t);function $t(){var t=qt();return"/"===t.charAt(0)||(It("/"+t),!1)}function qt(){var t=window.location.href,e=t.indexOf("#");return e<0?"":t=t.slice(e+1)}function Ut(t){var e=window.location.href,r=e.indexOf("#");return(r>=0?e.slice(0,r):e)+"#"+t}function Bt(t){ht?lt(Ut(t)):window.location.hash=t}function It(t){ht?dt(Ut(t)):window.location.replace(Ut(t))}var Mt=function(t){function e(e,r){t.call(this,e,r),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,r){var n=this;this.transitionTo(t,(function(t){n.stack=n.stack.slice(0,n.index+1).concat(t),n.index++,e&&e(t)}),r)},e.prototype.replace=function(t,e,r){var n=this;this.transitionTo(t,(function(t){n.stack=n.stack.slice(0,n.index).concat(t),e&&e(t)}),r)},e.prototype.go=function(t){var e=this,r=this.index+t;if(!(r<0||r>=this.stack.length)){var n=this.stack[r];this.confirmTransition(n,(function(){var t=e.current;e.index=r,e.updateRoute(n),e.router.afterHooks.forEach((function(e){e&&e(n,t)}))}),(function(t){xt(t,vt.duplicated)&&(e.index=r)}))}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(_t),Vt=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Q(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!ht&&!1!==t.fallback,this.fallback&&(e="hash"),D||(e="abstract"),this.mode=e,e){case"history":this.history=new St(this,t.base);break;case"hash":this.history=new Lt(this,t.base,this.fallback);break;case"abstract":this.history=new Mt(this,t.base)}},Ht={currentRoute:{configurable:!0}};Vt.prototype.match=function(t,e,r){return this.matcher.match(t,e,r)},Ht.currentRoute.get=function(){return this.history&&this.history.current},Vt.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",(function(){var r=e.apps.indexOf(t);r>-1&&e.apps.splice(r,1),e.app===t&&(e.app=e.apps[0]||null),e.app||e.history.teardown()})),!this.app){this.app=t;var r=this.history;if(r instanceof St||r instanceof Lt){var n=function(t){r.setupListeners(),function(t){var n=r.current,o=e.options.scrollBehavior;ht&&o&&"fullPath"in t&&nt(e,t,n,!1)}(t)};r.transitionTo(r.getCurrentLocation(),n,n)}r.listen((function(t){e.apps.forEach((function(e){e._route=t}))}))}},Vt.prototype.beforeEach=function(t){return Ft(this.beforeHooks,t)},Vt.prototype.beforeResolve=function(t){return Ft(this.resolveHooks,t)},Vt.prototype.afterEach=function(t){return Ft(this.afterHooks,t)},Vt.prototype.onReady=function(t,e){this.history.onReady(t,e)},Vt.prototype.onError=function(t){this.history.onError(t)},Vt.prototype.push=function(t,e,r){var n=this;if(!e&&!r&&"undefined"!=typeof Promise)return new Promise((function(e,r){n.history.push(t,e,r)}));this.history.push(t,e,r)},Vt.prototype.replace=function(t,e,r){var n=this;if(!e&&!r&&"undefined"!=typeof Promise)return new Promise((function(e,r){n.history.replace(t,e,r)}));this.history.replace(t,e,r)},Vt.prototype.go=function(t){this.history.go(t)},Vt.prototype.back=function(){this.go(-1)},Vt.prototype.forward=function(){this.go(1)},Vt.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map((function(t){return Object.keys(t.components).map((function(e){return t.components[e]}))}))):[]},Vt.prototype.resolve=function(t,e,r){var n=V(t,e=e||this.history.current,r,this),o=this.match(n,e),i=o.redirectedFrom||o.fullPath;return{location:n,route:o,href:function(t,e,r){var n="hash"===r?"#"+e:e;return t?x(t+"/"+n):n}(this.history.base,i,this.mode),normalizedTo:n,resolved:o}},Vt.prototype.getRoutes=function(){return this.matcher.getRoutes()},Vt.prototype.addRoute=function(t,e){this.matcher.addRoute(t,e),this.history.current!==h&&this.history.transitionTo(this.history.getCurrentLocation())},Vt.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==h&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Vt.prototype,Ht);var Nt=Vt;function Ft(t,e){return t.push(e),function(){var r=t.indexOf(e);r>-1&&t.splice(r,1)}}return Vt.install=function t(e){if(!t.installed||H!==e){t.installed=!0,H=e;var r=function(t){return void 0!==t},n=function(t,e){var n=t.$options._parentVnode;r(n)&&r(n=n.data)&&r(n=n.registerRouteInstance)&&n(t,e)};e.mixin({beforeCreate:function(){r(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,n(this,this)},destroyed:function(){n(this)}}),Object.defineProperty(e.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get:function(){return this._routerRoot._route}}),e.component("RouterView",g),e.component("RouterLink",F);var o=e.config.optionMergeStrategies;o.beforeRouteEnter=o.beforeRouteLeave=o.beforeRouteUpdate=o.created}},Vt.version="3.6.3",Vt.isNavigationFailure=xt,Vt.NavigationFailureType=vt,Vt.START_LOCATION=h,D&&window.Vue&&window.Vue.use(Vt),Nt},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).VueRouter=e(); \ No newline at end of file +var t,e;t=this,e=function(){"use strict";function t(t,e){for(var r in e)t[r]=e[r];return t}var e=/[!'()*]/g,r=function(t){return"%"+t.charCodeAt(0).toString(16)},n=/%2C/g,o=function(t){return encodeURIComponent(t).replace(e,r).replace(n,",")};function i(t){try{return decodeURIComponent(t)}catch(t){}return t}var a=function(t){return null==t||"object"==typeof t?t:String(t)};function s(t){var e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach((function(t){var r=t.replace(/\+/g," ").split("="),n=i(r.shift()),o=r.length>0?i(r.join("=")):null;void 0===e[n]?e[n]=o:Array.isArray(e[n])?e[n].push(o):e[n]=[e[n],o]})),e):e}function u(t){var e=t?Object.keys(t).map((function(e){var r=t[e];if(void 0===r)return"";if(null===r)return o(e);if(Array.isArray(r)){var n=[];return r.forEach((function(t){void 0!==t&&(null===t?n.push(o(e)):n.push(o(e)+"="+o(t)))})),n.join("&")}return o(e)+"="+o(r)})).filter((function(t){return t.length>0})).join("&"):null;return e?"?"+e:""}var c=/\/?$/;function p(t,e,r,n){var o=n&&n.options.stringifyQuery,i=e.query||{};try{i=f(i)}catch(t){}var a={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:i,params:e.params||{},fullPath:d(e,o),matched:t?l(t):[]};return r&&(a.redirectedFrom=d(r,o)),Object.freeze(a)}function f(t){if(Array.isArray(t))return t.map(f);if(t&&"object"==typeof t){var e={};for(var r in t)e[r]=f(t[r]);return e}return t}var h=p(null,{path:"/"});function l(t){for(var e=[];t;)e.unshift(t),t=t.parent;return e}function d(t,e){var r=t.path,n=t.query;void 0===n&&(n={});var o=t.hash;return void 0===o&&(o=""),(r||"/")+(e||u)(n)+o}function v(t,e,r){return e===h?t===e:!!e&&(t.path&&e.path?t.path.replace(c,"")===e.path.replace(c,"")&&(r||t.hash===e.hash&&y(t.query,e.query)):!(!t.name||!e.name)&&t.name===e.name&&(r||t.hash===e.hash&&y(t.query,e.query)&&y(t.params,e.params)))}function y(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),!t||!e)return t===e;var r=Object.keys(t).sort(),n=Object.keys(e).sort();return r.length===n.length&&r.every((function(r,o){var i=t[r];if(n[o]!==r)return!1;var a=e[r];return null==i||null==a?i===a:"object"==typeof i&&"object"==typeof a?y(i,a):String(i)===String(a)}))}function m(t){for(var e=0;e=0&&(e=t.slice(n),t=t.slice(0,n));var o=t.indexOf("?");return o>=0&&(r=t.slice(o+1),t=t.slice(0,o)),{path:t,query:r,hash:e}}(i.path||""),h=r&&r.path||"/",l=f.path?b(f.path,h,n||i.append):h,d=function(t,e,r){void 0===e&&(e={});var n,o=r||s;try{n=o(t||"")}catch(t){n={}}for(var i in e){var u=e[i];n[i]=Array.isArray(u)?u.map(a):a(u)}return n}(f.query,i.query,o&&o.options.parseQuery),v=i.hash||f.hash;return v&&"#"!==v.charAt(0)&&(v="#"+v),{_normalized:!0,path:l,query:d,hash:v}}var H,N=function(){},F={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render:function(e){var r=this,n=this.$router,o=this.$route,i=n.resolve(this.to,o,this.append),a=i.location,s=i.route,u=i.href,f={},h=n.options.linkActiveClass,l=n.options.linkExactActiveClass,d=null==h?"router-link-active":h,y=null==l?"router-link-exact-active":l,m=null==this.activeClass?d:this.activeClass,g=null==this.exactActiveClass?y:this.exactActiveClass,w=s.redirectedFrom?p(null,V(s.redirectedFrom),null,n):s;f[g]=v(o,w,this.exactPath),f[m]=this.exact||this.exactPath?f[g]:function(t,e){return 0===t.path.replace(c,"/").indexOf(e.path.replace(c,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var r in e)if(!(r in t))return!1;return!0}(t.query,e.query)}(o,w);var b=f[g]?this.ariaCurrentValue:null,x=function(t){z(t)&&(r.replace?n.replace(a,N):n.push(a,N))},R={click:z};Array.isArray(this.event)?this.event.forEach((function(t){R[t]=x})):R[this.event]=x;var k={class:f},E=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:u,route:s,navigate:x,isActive:f[m],isExactActive:f[g]});if(E){if(1===E.length)return E[0];if(E.length>1||!E.length)return 0===E.length?e():e("span",{},E)}if("a"===this.tag)k.on=R,k.attrs={href:u,"aria-current":b};else{var C=function t(e){var r;if(e)for(var n=0;n-1&&(s.params[h]=r.params[h]);return s.path=M(p.path,s.params),u(p,s,a)}if(s.path){s.params={};for(var l=0;l-1}function xt(t,e){return bt(t)&&t._isRouter&&(null==e||t.type===e)}function Rt(t,e,r){var n=function(o){o>=t.length?r():t[o]?e(t[o],(function(){n(o+1)})):n(o+1)};n(0)}function kt(t){return function(e,r,n){var o=!1,i=0,a=null;Et(t,(function(t,e,r,s){if("function"==typeof t&&void 0===t.cid){o=!0,i++;var u,c=Ot((function(e){var o;((o=e).__esModule||At&&"Module"===o[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:H.extend(e),r.components[s]=e,--i<=0&&n()})),p=Ot((function(t){var e="Failed to resolve async component "+s+": "+t;a||(a=bt(t)?t:new Error(e),n(a))}));try{u=t(c,p)}catch(t){p(t)}if(u)if("function"==typeof u.then)u.then(c,p);else{var f=u.component;f&&"function"==typeof f.then&&f.then(c,p)}}})),o||n()}}function Et(t,e){return Ct(t.map((function(t){return Object.keys(t.components).map((function(r){return e(t.components[r],t.instances[r],t,r)}))})))}function Ct(t){return Array.prototype.concat.apply([],t)}var At="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Ot(t){var e=!1;return function(){for(var r=[],n=arguments.length;n--;)r[n]=arguments[n];if(!e)return e=!0,t.apply(this,r)}}var _t=function(t,e){this.router=t,this.base=function(t){if(!t)if(D){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";return"/"!==t.charAt(0)&&(t="/"+t),t.replace(/\/$/,"")}(e),this.current=h,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function jt(t,e,r,n){var o=Et(t,(function(t,n,o,i){var a=function(t,e){return"function"!=typeof t&&(t=H.extend(t)),t.options[e]}(t,e);if(a)return Array.isArray(a)?a.map((function(t){return r(t,n,o,i)})):r(a,n,o,i)}));return Ct(n?o.reverse():o)}function Tt(t,e){if(e)return function(){return t.apply(e,arguments)}}_t.prototype.listen=function(t){this.cb=t},_t.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},_t.prototype.onError=function(t){this.errorCbs.push(t)},_t.prototype.transitionTo=function(t,e,r){var n,o=this;try{n=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach((function(e){e(t)})),t}var i=this.current;this.confirmTransition(n,(function(){o.updateRoute(n),e&&e(n),o.ensureURL(),o.router.afterHooks.forEach((function(t){t&&t(n,i)})),o.ready||(o.ready=!0,o.readyCbs.forEach((function(t){t(n)})))}),(function(t){r&&r(t),t&&!o.ready&&(xt(t,vt.redirected)&&i===h||(o.ready=!0,o.readyErrorCbs.forEach((function(e){e(t)}))))}))},_t.prototype.confirmTransition=function(t,e,r){var n=this,o=this.current;this.pending=t;var i,a,s=function(t){!xt(t)&&bt(t)&&(n.errorCbs.length?n.errorCbs.forEach((function(e){e(t)})):console.error(t)),r&&r(t)},u=t.matched.length-1,c=o.matched.length-1;if(v(t,o)&&u===c&&t.matched[u]===o.matched[c])return this.ensureURL(),t.hash&&nt(this.router,o,t,!1),s(((a=gt(i=o,t,vt.duplicated,'Avoided redundant navigation to current location: "'+i.fullPath+'".')).name="NavigationDuplicated",a));var p=function(t,e){var r,n=Math.max(t.length,e.length);for(r=0;r0)){var e=this.router,r=e.options.scrollBehavior,n=ht&&r;n&&this.listeners.push(rt());var o=function(){var r=t.current,o=Pt(t.base);t.current===h&&o===t._startLocation||t.transitionTo(o,(function(t){n&&nt(e,t,r,!0)}))};window.addEventListener("popstate",o),this.listeners.push((function(){window.removeEventListener("popstate",o)}))}},e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){lt(x(n.base+t.fullPath)),nt(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.replace=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){dt(x(n.base+t.fullPath)),nt(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.ensureURL=function(t){if(Pt(this.base)!==this.current.fullPath){var e=x(this.base+this.current.fullPath);t?lt(e):dt(e)}},e.prototype.getCurrentLocation=function(){return Pt(this.base)},e}(_t);function Pt(t){var e=window.location.pathname,r=e.toLowerCase(),n=t.toLowerCase();return!t||r!==n&&0!==r.indexOf(x(n+"/"))||(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var Lt=function(t){function e(e,r,n){t.call(this,e,r),n&&function(t){var e=Pt(t);if(!/^\/#/.test(e))return window.location.replace(x(t+"/#"+e)),!0}(this.base)||$t()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router.options.scrollBehavior,r=ht&&e;r&&this.listeners.push(rt());var n=function(){var e=t.current;$t()&&t.transitionTo(qt(),(function(n){r&&nt(t.router,n,e,!0),ht||It(n.fullPath)}))},o=ht?"popstate":"hashchange";window.addEventListener(o,n),this.listeners.push((function(){window.removeEventListener(o,n)}))}},e.prototype.push=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){Bt(t.fullPath),nt(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.replace=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){It(t.fullPath),nt(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;qt()!==e&&(t?Bt(e):It(e))},e.prototype.getCurrentLocation=function(){return qt()},e}(_t);function $t(){var t=qt();return"/"===t.charAt(0)||(It("/"+t),!1)}function qt(){var t=window.location.href,e=t.indexOf("#");return e<0?"":t=t.slice(e+1)}function Ut(t){var e=window.location.href,r=e.indexOf("#");return(r>=0?e.slice(0,r):e)+"#"+t}function Bt(t){ht?lt(Ut(t)):window.location.hash=t}function It(t){ht?dt(Ut(t)):window.location.replace(Ut(t))}var Mt=function(t){function e(e,r){t.call(this,e,r),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,r){var n=this;this.transitionTo(t,(function(t){n.stack=n.stack.slice(0,n.index+1).concat(t),n.index++,e&&e(t)}),r)},e.prototype.replace=function(t,e,r){var n=this;this.transitionTo(t,(function(t){n.stack=n.stack.slice(0,n.index).concat(t),e&&e(t)}),r)},e.prototype.go=function(t){var e=this,r=this.index+t;if(!(r<0||r>=this.stack.length)){var n=this.stack[r];this.confirmTransition(n,(function(){var t=e.current;e.index=r,e.updateRoute(n),e.router.afterHooks.forEach((function(e){e&&e(n,t)}))}),(function(t){xt(t,vt.duplicated)&&(e.index=r)}))}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(_t),Vt=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Q(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!ht&&!1!==t.fallback,this.fallback&&(e="hash"),D||(e="abstract"),this.mode=e,e){case"history":this.history=new St(this,t.base);break;case"hash":this.history=new Lt(this,t.base,this.fallback);break;case"abstract":this.history=new Mt(this,t.base)}},Ht={currentRoute:{configurable:!0}};Vt.prototype.match=function(t,e,r){return this.matcher.match(t,e,r)},Ht.currentRoute.get=function(){return this.history&&this.history.current},Vt.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",(function(){var r=e.apps.indexOf(t);r>-1&&e.apps.splice(r,1),e.app===t&&(e.app=e.apps[0]||null),e.app||e.history.teardown()})),!this.app){this.app=t;var r=this.history;if(r instanceof St||r instanceof Lt){var n=function(t){r.setupListeners(),function(t){var n=r.current,o=e.options.scrollBehavior;ht&&o&&"fullPath"in t&&nt(e,t,n,!1)}(t)};r.transitionTo(r.getCurrentLocation(),n,n)}r.listen((function(t){e.apps.forEach((function(e){e._route=t}))}))}},Vt.prototype.beforeEach=function(t){return Ft(this.beforeHooks,t)},Vt.prototype.beforeResolve=function(t){return Ft(this.resolveHooks,t)},Vt.prototype.afterEach=function(t){return Ft(this.afterHooks,t)},Vt.prototype.onReady=function(t,e){this.history.onReady(t,e)},Vt.prototype.onError=function(t){this.history.onError(t)},Vt.prototype.push=function(t,e,r){var n=this;if(!e&&!r&&"undefined"!=typeof Promise)return new Promise((function(e,r){n.history.push(t,e,r)}));this.history.push(t,e,r)},Vt.prototype.replace=function(t,e,r){var n=this;if(!e&&!r&&"undefined"!=typeof Promise)return new Promise((function(e,r){n.history.replace(t,e,r)}));this.history.replace(t,e,r)},Vt.prototype.go=function(t){this.history.go(t)},Vt.prototype.back=function(){this.go(-1)},Vt.prototype.forward=function(){this.go(1)},Vt.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map((function(t){return Object.keys(t.components).map((function(e){return t.components[e]}))}))):[]},Vt.prototype.resolve=function(t,e,r){var n=V(t,e=e||this.history.current,r,this),o=this.match(n,e),i=o.redirectedFrom||o.fullPath;return{location:n,route:o,href:function(t,e,r){var n="hash"===r?"#"+e:e;return t?x(t+"/"+n):n}(this.history.base,i,this.mode),normalizedTo:n,resolved:o}},Vt.prototype.getRoutes=function(){return this.matcher.getRoutes()},Vt.prototype.addRoute=function(t,e){this.matcher.addRoute(t,e),this.history.current!==h&&this.history.transitionTo(this.history.getCurrentLocation())},Vt.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==h&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Vt.prototype,Ht);var Nt=Vt;function Ft(t,e){return t.push(e),function(){var r=t.indexOf(e);r>-1&&t.splice(r,1)}}return Vt.install=function t(e){if(!t.installed||H!==e){t.installed=!0,H=e;var r=function(t){return void 0!==t},n=function(t,e){var n=t.$options._parentVnode;r(n)&&r(n=n.data)&&r(n=n.registerRouteInstance)&&n(t,e)};e.mixin({beforeCreate:function(){r(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,n(this,this)},destroyed:function(){n(this)}}),Object.defineProperty(e.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get:function(){return this._routerRoot._route}}),e.component("RouterView",g),e.component("RouterLink",F);var o=e.config.optionMergeStrategies;o.beforeRouteEnter=o.beforeRouteLeave=o.beforeRouteUpdate=o.created}},Vt.version="3.6.4",Vt.isNavigationFailure=xt,Vt.NavigationFailureType=vt,Vt.START_LOCATION=h,D&&window.Vue&&window.Vue.use(Vt),Nt},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).VueRouter=e(); \ No newline at end of file diff --git a/dist/vue-router.mjs b/dist/vue-router.mjs index 2d9d53163..67a7616e7 100644 --- a/dist/vue-router.mjs +++ b/dist/vue-router.mjs @@ -1,5 +1,5 @@ /*! - * vue-router v3.6.3 + * vue-router v3.6.4 * (c) 2022 Evan You * @license MIT */ @@ -3145,7 +3145,7 @@ function createHref (base, fullPath, mode) { // We cannot remove this as it would be a breaking change VueRouter.install = install; -VueRouter.version = '3.6.3'; +VueRouter.version = '3.6.4'; VueRouter.isNavigationFailure = isNavigationFailure; VueRouter.NavigationFailureType = NavigationFailureType; VueRouter.START_LOCATION = START; @@ -3154,6 +3154,6 @@ if (inBrowser && window.Vue) { window.Vue.use(VueRouter); } -var version = '3.6.3'; +var version = '3.6.4'; export { NavigationFailureType, Link as RouterLink, View as RouterView, START as START_LOCATION, VueRouter$1 as default, isNavigationFailure, version };