Socket
Socket
Sign inDemoInstall

vue-router

Package Overview
Dependencies
Maintainers
1
Versions
185
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-router - npm Package Compare versions

Comparing version 2.3.0 to 2.3.1

17

dist/vue-router.common.js
/**
* vue-router v2.2.1
* vue-router v2.3.1
* (c) 2017 Evan You

@@ -1452,3 +1452,4 @@ * @license MIT

function getElementPosition (el) {
var docRect = document.documentElement.getBoundingClientRect();
var docEl = document.documentElement;
var docRect = docEl.getBoundingClientRect();
var elRect = el.getBoundingClientRect();

@@ -1684,3 +1685,3 @@ return {

var baseEl = document.querySelector('base');
base = baseEl ? baseEl.getAttribute('href') : '/';
base = (baseEl && baseEl.getAttribute('href')) || '/';
} else {

@@ -1900,5 +1901,7 @@ base = '/';

var ref = this;
var fromRoute = ref.current;
this.transitionTo(location, function (route) {
pushState(cleanPath(this$1.base + route.fullPath));
handleScroll(this$1.router, route, this$1.current, false);
handleScroll(this$1.router, route, fromRoute, false);
onComplete && onComplete(route);

@@ -1911,5 +1914,7 @@ }, onAbort);

var ref = this;
var fromRoute = ref.current;
this.transitionTo(location, function (route) {
replaceState(cleanPath(this$1.base + route.fullPath));
handleScroll(this$1.router, route, this$1.current, false);
handleScroll(this$1.router, route, fromRoute, false);
onComplete && onComplete(route);

@@ -2276,3 +2281,3 @@ }, onAbort);

VueRouter.install = install;
VueRouter.version = '2.2.1';
VueRouter.version = '2.3.1';

@@ -2279,0 +2284,0 @@ if (inBrowser && window.Vue) {

/**
* vue-router v2.2.1
* vue-router v2.3.1
* (c) 2017 Evan You

@@ -1897,5 +1897,7 @@ * @license MIT

var ref = this;
var fromRoute = ref.current;
this.transitionTo(location, function (route) {
pushState(cleanPath(this$1.base + route.fullPath));
handleScroll(this$1.router, route, this$1.current, false);
handleScroll(this$1.router, route, fromRoute, false);
onComplete && onComplete(route);

@@ -1908,5 +1910,7 @@ }, onAbort);

var ref = this;
var fromRoute = ref.current;
this.transitionTo(location, function (route) {
replaceState(cleanPath(this$1.base + route.fullPath));
handleScroll(this$1.router, route, this$1.current, false);
handleScroll(this$1.router, route, fromRoute, false);
onComplete && onComplete(route);

@@ -2273,3 +2277,3 @@ }, onAbort);

VueRouter.install = install;
VueRouter.version = '2.2.1';
VueRouter.version = '2.3.1';

@@ -2276,0 +2280,0 @@ if (inBrowser && window.Vue) {

/**
* vue-router v2.2.1
* vue-router v2.3.1
* (c) 2017 Evan You

@@ -1456,3 +1456,4 @@ * @license MIT

function getElementPosition (el) {
var docRect = document.documentElement.getBoundingClientRect();
var docEl = document.documentElement;
var docRect = docEl.getBoundingClientRect();
var elRect = el.getBoundingClientRect();

@@ -1688,3 +1689,3 @@ return {

var baseEl = document.querySelector('base');
base = baseEl ? baseEl.getAttribute('href') : '/';
base = (baseEl && baseEl.getAttribute('href')) || '/';
} else {

@@ -1904,5 +1905,7 @@ base = '/';

var ref = this;
var fromRoute = ref.current;
this.transitionTo(location, function (route) {
pushState(cleanPath(this$1.base + route.fullPath));
handleScroll(this$1.router, route, this$1.current, false);
handleScroll(this$1.router, route, fromRoute, false);
onComplete && onComplete(route);

@@ -1915,5 +1918,7 @@ }, onAbort);

var ref = this;
var fromRoute = ref.current;
this.transitionTo(location, function (route) {
replaceState(cleanPath(this$1.base + route.fullPath));
handleScroll(this$1.router, route, this$1.current, false);
handleScroll(this$1.router, route, fromRoute, false);
onComplete && onComplete(route);

@@ -2280,3 +2285,3 @@ }, onAbort);

VueRouter.install = install;
VueRouter.version = '2.2.1';
VueRouter.version = '2.3.1';

@@ -2283,0 +2288,0 @@ if (inBrowser && window.Vue) {

/**
* vue-router v2.2.1
* vue-router v2.3.1
* (c) 2017 Evan You
* @license MIT
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueRouter=e()}(this,function(){"use strict";function t(t,e){t||"undefined"!=typeof console&&console.warn("[vue-router] "+e)}function e(e,n){switch(typeof n){case"undefined":return;case"object":return n;case"function":return n(e);case"boolean":return n?e.params:void 0;default:t(!1,'props in "'+e.path+'" is a '+typeof n+", expecting an object, function or boolean.")}}function n(t,e){if(void 0===e&&(e={}),t){var n;try{n=r(t)}catch(t){n={}}for(var o in e)n[o]=e[o];return n}return e}function r(t){var e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach(function(t){var n=t.replace(/\+/g," ").split("="),r=_t(n.shift()),o=n.length>0?_t(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 o(t){var e=t?Object.keys(t).map(function(e){var n=t[e];if(void 0===n)return"";if(null===n)return Ct(e);if(Array.isArray(n)){var r=[];return n.slice().forEach(function(t){void 0!==t&&(null===t?r.push(Ct(e)):r.push(Ct(e)+"="+Ct(t)))}),r.join("&")}return Ct(e)+"="+Ct(n)}).filter(function(t){return t.length>0}).join("&"):null;return e?"?"+e:""}function i(t,e,n){var r={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:e.query||{},params:e.params||{},fullPath:u(e),matched:t?a(t):[]};return n&&(r.redirectedFrom=u(n)),Object.freeze(r)}function a(t){for(var e=[];t;)e.unshift(t),t=t.parent;return e}function u(t){var e=t.path,n=t.query;void 0===n&&(n={});var r=t.hash;return void 0===r&&(r=""),(e||"/")+o(n)+r}function c(t,e){return e===$t?t===e:!!e&&(t.path&&e.path?t.path.replace(Tt,"")===e.path.replace(Tt,"")&&t.hash===e.hash&&s(t.query,e.query):!(!t.name||!e.name)&&(t.name===e.name&&t.hash===e.hash&&s(t.query,e.query)&&s(t.params,e.params)))}function s(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&n.every(function(n){return String(t[n])===String(e[n])})}function p(t,e){return 0===t.path.replace(Tt,"/").indexOf(e.path.replace(Tt,"/"))&&(!e.hash||t.hash===e.hash)&&f(t.query,e.query)}function f(t,e){for(var n in e)if(!(n in t))return!1;return!0}function h(t){if(!(t.metaKey||t.ctrlKey||t.shiftKey||t.defaultPrevented||void 0!==t.button&&0!==t.button)){if(t.target&&t.target.getAttribute){var e=t.target.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function l(t){if(t)for(var e,n=0;n<t.length;n++){if(e=t[n],"a"===e.tag)return e;if(e.children&&(e=l(e.children)))return e}}function d(t){if(!d.installed){d.installed=!0,Ot=t,Object.defineProperty(t.prototype,"$router",{get:function(){return this.$root._router}}),Object.defineProperty(t.prototype,"$route",{get:function(){return this.$root._route}}),t.mixin({beforeCreate:function(){this.$options.router&&(this._router=this.$options.router,this._router.init(this),t.util.defineReactive(this,"_route",this._router.history.current))}}),t.component("router-view",Rt),t.component("router-link",Lt);var e=t.config.optionMergeStrategies;e.beforeRouteEnter=e.beforeRouteLeave=e.created}}function y(t,e,n){if("/"===t.charAt(0))return t;if("?"===t.charAt(0)||"#"===t.charAt(0))return e+t;var r=e.split("/");n&&r[r.length-1]||r.pop();for(var o=t.replace(/^\//,"").split("/"),i=0;i<o.length;i++){var a=o[i];"."!==a&&(".."===a?r.pop():r.push(a))}return""!==r[0]&&r.unshift(""),r.join("/")}function v(t){var e="",n="",r=t.indexOf("#");r>=0&&(e=t.slice(r),t=t.slice(0,r));var o=t.indexOf("?");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{path:t,query:n,hash:e}}function m(t){return t.replace(/\/\//g,"/")}function g(t,e,n){var r=e||Object.create(null),o=n||Object.create(null);return t.forEach(function(t){w(r,o,t)}),{pathMap:r,nameMap:o}}function w(t,e,n,r,o){var i=n.path,a=n.name,u={path:b(i,r),components:n.components||{default:n.component},instances:{},name:a,parent:r,matchAs:o,redirect:n.redirect,beforeEnter:n.beforeEnter,meta:n.meta||{},props:null==n.props?{}:n.components?n.props:{default:n.props}};if(n.children&&n.children.forEach(function(n){var r=o?m(o+"/"+n.path):void 0;w(t,e,n,u,r)}),void 0!==n.alias)if(Array.isArray(n.alias))n.alias.forEach(function(o){var i={path:o,children:n.children};w(t,e,i,r,u.path)});else{var c={path:n.alias,children:n.children};w(t,e,c,r,u.path)}t[u.path]||(t[u.path]=u),a&&(e[a]||(e[a]=u))}function b(t,e){return t=t.replace(/\/$/,""),"/"===t[0]?t:null==e?t:m(e.path+"/"+t)}function x(t,e){for(var n,r=[],o=0,i=0,a="",u=e&&e.delimiter||"/";null!=(n=Ft.exec(t));){var c=n[0],s=n[1],p=n.index;if(a+=t.slice(i,p),i=p+c.length,s)a+=s[1];else{var f=t[i],h=n[2],l=n[3],d=n[4],y=n[5],v=n[6],m=n[7];a&&(r.push(a),a="");var g=null!=h&&null!=f&&f!==h,w="+"===v||"*"===v,b="?"===v||"*"===v,x=n[2]||u,k=d||y;r.push({name:l||o++,prefix:h||"",delimiter:x,optional:b,repeat:w,partial:g,asterisk:!!m,pattern:k?A(k):m?".*":"[^"+j(x)+"]+?"})}}return i<t.length&&(a+=t.substr(i)),a&&r.push(a),r}function k(t,e){return E(x(t,e))}function O(t){return encodeURI(t).replace(/[\/?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function R(t){return encodeURI(t).replace(/[?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function E(t){for(var e=new Array(t.length),n=0;n<t.length;n++)"object"==typeof t[n]&&(e[n]=new RegExp("^(?:"+t[n].pattern+")$"));return function(n,r){for(var o="",i=n||{},a=r||{},u=a.pretty?O:encodeURIComponent,c=0;c<t.length;c++){var s=t[c];if("string"!=typeof s){var p,f=i[s.name];if(null==f){if(s.optional){s.partial&&(o+=s.prefix);continue}throw new TypeError('Expected "'+s.name+'" to be defined')}if(zt(f)){if(!s.repeat)throw new TypeError('Expected "'+s.name+'" to not repeat, but received `'+JSON.stringify(f)+"`");if(0===f.length){if(s.optional)continue;throw new TypeError('Expected "'+s.name+'" to not be empty')}for(var h=0;h<f.length;h++){if(p=u(f[h]),!e[c].test(p))throw new TypeError('Expected all "'+s.name+'" to match "'+s.pattern+'", but received `'+JSON.stringify(p)+"`");o+=(0===h?s.prefix:s.delimiter)+p}}else{if(p=s.asterisk?R(f):u(f),!e[c].test(p))throw new TypeError('Expected "'+s.name+'" to match "'+s.pattern+'", but received "'+p+'"');o+=s.prefix+p}}else o+=s}return o}}function j(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function A(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function C(t,e){return t.keys=e,t}function _(t){return t.sensitive?"":"i"}function T(t,e){var n=t.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)e.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return C(t,e)}function $(t,e,n){for(var r=[],o=0;o<t.length;o++)r.push(L(t[o],e,n).source);var i=new RegExp("(?:"+r.join("|")+")",_(n));return C(i,e)}function S(t,e,n){return q(x(t,n),e,n)}function q(t,e,n){zt(e)||(n=e||n,e=[]),n=n||{};for(var r=n.strict,o=n.end!==!1,i="",a=0;a<t.length;a++){var u=t[a];if("string"==typeof u)i+=j(u);else{var c=j(u.prefix),s="(?:"+u.pattern+")";e.push(u),u.repeat&&(s+="(?:"+c+s+")*"),s=u.optional?u.partial?c+"("+s+")?":"(?:"+c+"("+s+"))?":c+"("+s+")",i+=s}}var p=j(n.delimiter||"/"),f=i.slice(-p.length)===p;return r||(i=(f?i.slice(0,-p.length):i)+"(?:"+p+"(?=$))?"),i+=o?"$":r&&f?"":"(?="+p+"|$)",C(new RegExp("^"+i,_(n)),e)}function L(t,e,n){return zt(e)||(n=e||n,e=[]),n=n||{},t instanceof RegExp?T(t,e):zt(t)?$(t,e,n):S(t,e,n)}function P(t){var e,n,r=Dt[t];return r?(e=r.keys,n=r.regexp):(e=[],n=Mt(t,e),Dt[t]={keys:e,regexp:n}),{keys:e,regexp:n}}function U(t,e,n){try{var r=Jt[t]||(Jt[t]=Mt.compile(t));return r(e||{},{pretty:!0})}catch(t){return""}}function z(t,e,r){var o="string"==typeof t?{path:t}:t;if(o.name||o._normalized)return o;if(!o.path&&o.params&&e){o=M({},o),o._normalized=!0;var i=M(M({},e.params),o.params);if(e.name)o.name=e.name,o.params=i;else if(e.matched){var a=e.matched[e.matched.length-1].path;o.path=U(a,i,"path "+e.path)}return o}var u=v(o.path||""),c=e&&e.path||"/",s=u.path?y(u.path,c,r||o.append):e&&e.path||"/",p=n(u.query,o.query),f=o.hash||u.hash;return f&&"#"!==f.charAt(0)&&(f="#"+f),{_normalized:!0,path:s,query:p,hash:f}}function M(t,e){for(var n in e)t[n]=e[n];return t}function V(e){function n(t){g(t,s,p)}function r(t,e,n){var r=z(t,e),o=r.name;if(o){var i=p[o],a=P(i.path).keys.filter(function(t){return!t.optional}).map(function(t){return t.name});if("object"!=typeof r.params&&(r.params={}),e&&"object"==typeof e.params)for(var c in e.params)!(c in r.params)&&a.indexOf(c)>-1&&(r.params[c]=e.params[c]);if(i)return r.path=U(i.path,r.params,'named route "'+o+'"'),u(i,r,n)}else if(r.path){r.params={};for(var f in s)if(B(f,r.params,r.path))return u(s[f],r,n)}return u(null,r)}function o(e,n){var o=e.redirect,a="function"==typeof o?o(i(e,n)):o;if("string"==typeof a&&(a={path:a}),!a||"object"!=typeof a)return u(null,n);var c=a,s=c.name,f=c.path,h=n.query,l=n.hash,d=n.params;if(h=c.hasOwnProperty("query")?c.query:h,l=c.hasOwnProperty("hash")?c.hash:l,d=c.hasOwnProperty("params")?c.params:d,s){p[s];return r({_normalized:!0,name:s,query:h,hash:l,params:d},void 0,n)}if(f){var y=H(f,e),v=U(y,d,'redirect route with path "'+y+'"');return r({_normalized:!0,path:v,query:h,hash:l},void 0,n)}return t(!1,"invalid redirect option: "+JSON.stringify(a)),u(null,n)}function a(t,e,n){var o=U(n,e.params,'aliased route with path "'+n+'"'),i=r({_normalized:!0,path:o});if(i){var a=i.matched,c=a[a.length-1];return e.params=i.params,u(c,e)}return u(null,e)}function u(t,e,n){return t&&t.redirect?o(t,n||e):t&&t.matchAs?a(t,e,t.matchAs):i(t,e,n)}var c=g(e),s=c.pathMap,p=c.nameMap;return{match:r,addRoutes:n}}function B(t,e,n){var r=P(t),o=r.regexp,i=r.keys,a=n.match(o);if(!a)return!1;if(!e)return!0;for(var u=1,c=a.length;u<c;++u){var s=i[u-1],p="string"==typeof a[u]?decodeURIComponent(a[u]):a[u];s&&(e[s.name]=p)}return!0}function H(t,e){return y(t,e.parent?e.parent.path:"/",!0)}function I(){window.addEventListener("popstate",function(t){D(),t.state&&t.state.key&&Q(t.state.key)})}function F(t,e,n,r){if(t.app){var o=t.options.scrollBehavior;o&&t.app.$nextTick(function(){var t=J(),i=o(e,n,r?t:null);if(i){var a="object"==typeof i;if(a&&"string"==typeof i.selector){var u=document.querySelector(i.selector);u?t=K(u):N(i)&&(t=X(i))}else a&&N(i)&&(t=X(i));t&&window.scrollTo(t.x,t.y)}})}}function D(){var t=G();t&&(Kt[t]={x:window.pageXOffset,y:window.pageYOffset})}function J(){var t=G();if(t)return Kt[t]}function K(t){var e=document.documentElement.getBoundingClientRect(),n=t.getBoundingClientRect();return{x:n.left-e.left,y:n.top-e.top}}function N(t){return Y(t.x)||Y(t.y)}function X(t){return{x:Y(t.x)?t.x:window.pageXOffset,y:Y(t.y)?t.y:window.pageYOffset}}function Y(t){return"number"==typeof t}function W(){return Xt.now().toFixed(3)}function G(){return Yt}function Q(t){Yt=t}function Z(t,e){D();var n=window.history;try{e?n.replaceState({key:Yt},"",t):(Yt=W(),n.pushState({key:Yt},"",t))}catch(n){window.location[e?"replace":"assign"](t)}}function tt(t){Z(t,!0)}function et(t,e,n){var r=function(o){o>=t.length?n():t[o]?e(t[o],function(){r(o+1)}):r(o+1)};r(0)}function nt(t){if(!t)if(Pt){var e=document.querySelector("base");t=e?e.getAttribute("href"):"/"}else t="/";return"/"!==t.charAt(0)&&(t="/"+t),t.replace(/\/$/,"")}function rt(t,e){var n,r=Math.max(t.length,e.length);for(n=0;n<r&&t[n]===e[n];n++);return{updated:e.slice(0,n),activated:e.slice(n),deactivated:t.slice(n)}}function ot(t,e,n,r){var o=lt(t,function(t,r,o,i){var a=it(t,e);if(a)return Array.isArray(a)?a.map(function(t){return n(t,r,o,i)}):n(a,r,o,i)});return dt(r?o.reverse():o)}function it(t,e){return"function"!=typeof t&&(t=Ot.extend(t)),t.options[e]}function at(t){return ot(t,"beforeRouteLeave",ct,!0)}function ut(t){return ot(t,"beforeRouteUpdate",ct)}function ct(t,e){return function(){return t.apply(e,arguments)}}function st(t,e,n){return ot(t,"beforeRouteEnter",function(t,r,o,i){return pt(t,o,i,e,n)})}function pt(t,e,n,r,o){return function(i,a,u){return t(i,a,function(t){u(t),"function"==typeof t&&r.push(function(){ft(t,e.instances,n,o)})})}}function ft(t,e,n,r){e[n]?t(e[n]):r()&&setTimeout(function(){ft(t,e,n,r)},16)}function ht(e){return lt(e,function(e,n,r,o){if("function"==typeof e&&!e.options)return function(n,i,a){var u=yt(function(t){r.components[o]=t,a()}),c=yt(function(e){t(!1,"Failed to resolve async component "+o+": "+e),a(!1)}),s=e(u,c);s&&"function"==typeof s.then&&s.then(u,c)}})}function lt(t,e){return dt(t.map(function(t){return Object.keys(t.components).map(function(n){return e(t.components[n],t.instances[n],t,n)})}))}function dt(t){return Array.prototype.concat.apply([],t)}function yt(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}function vt(t){var e=window.location.pathname;return t&&0===e.indexOf(t)&&(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}function mt(t){var e=vt(t);if(!/^\/#/.test(e))return window.location.replace(m(t+"/#"+e)),!0}function gt(){var t=wt();return"/"===t.charAt(0)||(xt("/"+t),!1)}function wt(){var t=window.location.href,e=t.indexOf("#");return e===-1?"":t.slice(e+1)}function bt(t){window.location.hash=t}function xt(t){var e=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,e>=0?e:0)+"#"+t)}function kt(t,e,n){var r="hash"===n?"#"+e:e;return t?m(t+"/"+r):r}var Ot,Rt={name:"router-view",functional:!0,props:{name:{type:String,default:"default"}},render:function(t,n){var r=n.props,o=n.children,i=n.parent,a=n.data;a.routerView=!0;for(var u=r.name,c=i.$route,s=i._routerViewCache||(i._routerViewCache={}),p=0,f=!1;i;)i.$vnode&&i.$vnode.data.routerView&&p++,i._inactive&&(f=!0),i=i.$parent;if(a.routerViewDepth=p,f)return t(s[u],a,o);var h=c.matched[p];if(!h)return s[u]=null,t();var l=s[u]=h.components[u],d=a.hook||(a.hook={});return d.init=function(t){h.instances[u]=t.child},d.prepatch=function(t,e){h.instances[u]=e.child},d.destroy=function(t){h.instances[u]===t.child&&(h.instances[u]=void 0)},a.props=e(c,h.props&&h.props[u]),t(l,a,o)}},Et=/[!'()*]/g,jt=function(t){return"%"+t.charCodeAt(0).toString(16)},At=/%2C/g,Ct=function(t){return encodeURIComponent(t).replace(Et,jt).replace(At,",")},_t=decodeURIComponent,Tt=/\/?$/,$t=i(null,{path:"/"}),St=[String,Object],qt=[String,Array],Lt={name:"router-link",props:{to:{type:St,required:!0},tag:{type:String,default:"a"},exact:Boolean,append:Boolean,replace:Boolean,activeClass:String,event:{type:qt,default:"click"}},render:function(t){var e=this,n=this.$router,r=this.$route,o=n.resolve(this.to,r,this.append),a=o.location,u=o.route,s=o.href,f={},d=this.activeClass||n.options.linkActiveClass||"router-link-active",y=a.path?i(null,a):u;f[d]=this.exact?c(r,y):p(r,y);var v=function(t){h(t)&&(e.replace?n.replace(a):n.push(a))},m={click:h};Array.isArray(this.event)?this.event.forEach(function(t){m[t]=v}):m[this.event]=v;var g={class:f};if("a"===this.tag)g.on=m,g.attrs={href:s};else{var w=l(this.$slots.default);if(w){w.isStatic=!1;var b=Ot.util.extend,x=w.data=b({},w.data);x.on=m;var k=w.data.attrs=b({},w.data.attrs);k.href=s}else g.on=m}return t(this.tag,g,this.$slots.default)}},Pt="undefined"!=typeof window,Ut=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},zt=Ut,Mt=L,Vt=x,Bt=k,Ht=E,It=q,Ft=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");Mt.parse=Vt,Mt.compile=Bt,Mt.tokensToFunction=Ht,Mt.tokensToRegExp=It;var Dt=Object.create(null),Jt=Object.create(null),Kt=Object.create(null),Nt=Pt&&function(){var t=window.navigator.userAgent;return(t.indexOf("Android 2.")===-1&&t.indexOf("Android 4.0")===-1||t.indexOf("Mobile Safari")===-1||t.indexOf("Chrome")!==-1||t.indexOf("Windows Phone")!==-1)&&(window.history&&"pushState"in window.history)}(),Xt=Pt&&window.performance&&window.performance.now?window.performance:Date,Yt=W(),Wt=function(t,e){this.router=t,this.base=nt(e),this.current=$t,this.pending=null,this.ready=!1,this.readyCbs=[]};Wt.prototype.listen=function(t){this.cb=t},Wt.prototype.onReady=function(t){this.ready?t():this.readyCbs.push(t)},Wt.prototype.transitionTo=function(t,e,n){var r=this,o=this.router.match(t,this.current);this.confirmTransition(o,function(){r.updateRoute(o),e&&e(o),r.ensureURL(),r.ready||(r.ready=!0,r.readyCbs.forEach(function(t){t(o)}))},n)},Wt.prototype.confirmTransition=function(t,e,n){var r=this,o=this.current,i=function(){n&&n()};if(c(t,o)&&t.matched.length===o.matched.length)return this.ensureURL(),i();var a=rt(this.current.matched,t.matched),u=a.updated,s=a.deactivated,p=a.activated,f=[].concat(at(s),this.router.beforeHooks,ut(u),p.map(function(t){return t.beforeEnter}),ht(p));this.pending=t;var h=function(e,n){return r.pending!==t?i():void e(t,o,function(t){t===!1?(r.ensureURL(!0),i()):"string"==typeof t||"object"==typeof t?("object"==typeof t&&t.replace?r.replace(t):r.push(t),i()):n(t)})};et(f,h,function(){var n=[],o=function(){return r.current===t},a=st(p,n,o);et(a,h,function(){return r.pending!==t?i():(r.pending=null,e(t),void(r.router.app&&r.router.app.$nextTick(function(){n.forEach(function(t){return t()})})))})})},Wt.prototype.updateRoute=function(t){var e=this.current;this.current=t,this.cb&&this.cb(t),this.router.afterHooks.forEach(function(n){n&&n(t,e)})};var Gt=function(t){function e(e,n){var r=this;t.call(this,e,n);var o=e.options.scrollBehavior;o&&I(),window.addEventListener("popstate",function(t){r.transitionTo(vt(r.base),function(t){o&&F(e,t,r.current,!0)})})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,n){var r=this;this.transitionTo(t,function(t){Z(m(r.base+t.fullPath)),F(r.router,t,r.current,!1),e&&e(t)},n)},e.prototype.replace=function(t,e,n){var r=this;this.transitionTo(t,function(t){tt(m(r.base+t.fullPath)),F(r.router,t,r.current,!1),e&&e(t)},n)},e.prototype.ensureURL=function(t){if(vt(this.base)!==this.current.fullPath){var e=m(this.base+this.current.fullPath);t?Z(e):tt(e)}},e.prototype.getCurrentLocation=function(){return vt(this.base)},e}(Wt),Qt=function(t){function e(e,n,r){t.call(this,e,n),r&&mt(this.base)||gt()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;window.addEventListener("hashchange",function(){gt()&&t.transitionTo(wt(),function(t){xt(t.fullPath)})})},e.prototype.push=function(t,e,n){this.transitionTo(t,function(t){bt(t.fullPath),e&&e(t)},n)},e.prototype.replace=function(t,e,n){this.transitionTo(t,function(t){xt(t.fullPath),e&&e(t)},n)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;wt()!==e&&(t?bt(e):xt(e))},e.prototype.getCurrentLocation=function(){return wt()},e}(Wt),Zt=function(t){function e(e,n){t.call(this,e,n),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,n){var r=this;this.transitionTo(t,function(t){r.stack=r.stack.slice(0,r.index+1).concat(t),r.index++,e&&e(t)},n)},e.prototype.replace=function(t,e,n){var r=this;this.transitionTo(t,function(t){r.stack=r.stack.slice(0,r.index).concat(t),e&&e(t)},n)},e.prototype.go=function(t){var e=this,n=this.index+t;if(!(n<0||n>=this.stack.length)){var r=this.stack[n];this.confirmTransition(r,function(){e.index=n,e.updateRoute(r)})}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(Wt),te=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.afterHooks=[],this.matcher=V(t.routes||[]);var e=t.mode||"hash";switch(this.fallback="history"===e&&!Nt,this.fallback&&(e="hash"),Pt||(e="abstract"),this.mode=e,e){case"history":this.history=new Gt(this,t.base);break;case"hash":this.history=new Qt(this,t.base,this.fallback);break;case"abstract":this.history=new Zt(this,t.base)}},ee={currentRoute:{}};return te.prototype.match=function(t,e,n){return this.matcher.match(t,e,n)},ee.currentRoute.get=function(){return this.history&&this.history.current},te.prototype.init=function(t){var e=this;if(this.apps.push(t),!this.app){this.app=t;var n=this.history;if(n instanceof Gt)n.transitionTo(n.getCurrentLocation());else if(n instanceof Qt){var r=function(){n.setupListeners()};n.transitionTo(n.getCurrentLocation(),r,r)}n.listen(function(t){e.apps.forEach(function(e){e._route=t})})}},te.prototype.beforeEach=function(t){this.beforeHooks.push(t)},te.prototype.afterEach=function(t){this.afterHooks.push(t)},te.prototype.onReady=function(t){this.history.onReady(t)},te.prototype.push=function(t,e,n){this.history.push(t,e,n)},te.prototype.replace=function(t,e,n){this.history.replace(t,e,n)},te.prototype.go=function(t){this.history.go(t)},te.prototype.back=function(){this.go(-1)},te.prototype.forward=function(){this.go(1)},te.prototype.getMatchedComponents=function(t){var e=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]})})):[]},te.prototype.resolve=function(t,e,n){var r=z(t,e||this.history.current,n),o=this.match(r,e),i=o.redirectedFrom||o.fullPath,a=this.history.base,u=kt(a,i,this.mode);return{location:r,route:o,href:u,normalizedTo:r,resolved:o}},te.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==$t&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(te.prototype,ee),te.install=d,te.version="2.2.1",Pt&&window.Vue&&window.Vue.use(te),te});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueRouter=e()}(this,function(){"use strict";function t(t,e){t||"undefined"!=typeof console&&console.warn("[vue-router] "+e)}function e(e,n){switch(typeof n){case"undefined":return;case"object":return n;case"function":return n(e);case"boolean":return n?e.params:void 0;default:t(!1,'props in "'+e.path+'" is a '+typeof n+", expecting an object, function or boolean.")}}function n(t,e){if(void 0===e&&(e={}),t){var n;try{n=r(t)}catch(t){n={}}for(var o in e)n[o]=e[o];return n}return e}function r(t){var e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach(function(t){var n=t.replace(/\+/g," ").split("="),r=_t(n.shift()),o=n.length>0?_t(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 o(t){var e=t?Object.keys(t).map(function(e){var n=t[e];if(void 0===n)return"";if(null===n)return Ct(e);if(Array.isArray(n)){var r=[];return n.slice().forEach(function(t){void 0!==t&&(null===t?r.push(Ct(e)):r.push(Ct(e)+"="+Ct(t)))}),r.join("&")}return Ct(e)+"="+Ct(n)}).filter(function(t){return t.length>0}).join("&"):null;return e?"?"+e:""}function i(t,e,n){var r={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:e.query||{},params:e.params||{},fullPath:u(e),matched:t?a(t):[]};return n&&(r.redirectedFrom=u(n)),Object.freeze(r)}function a(t){for(var e=[];t;)e.unshift(t),t=t.parent;return e}function u(t){var e=t.path,n=t.query;void 0===n&&(n={});var r=t.hash;return void 0===r&&(r=""),(e||"/")+o(n)+r}function c(t,e){return e===$t?t===e:!!e&&(t.path&&e.path?t.path.replace(Tt,"")===e.path.replace(Tt,"")&&t.hash===e.hash&&s(t.query,e.query):!(!t.name||!e.name)&&(t.name===e.name&&t.hash===e.hash&&s(t.query,e.query)&&s(t.params,e.params)))}function s(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&n.every(function(n){return String(t[n])===String(e[n])})}function p(t,e){return 0===t.path.replace(Tt,"/").indexOf(e.path.replace(Tt,"/"))&&(!e.hash||t.hash===e.hash)&&f(t.query,e.query)}function f(t,e){for(var n in e)if(!(n in t))return!1;return!0}function h(t){if(!(t.metaKey||t.ctrlKey||t.shiftKey||t.defaultPrevented||void 0!==t.button&&0!==t.button)){if(t.target&&t.target.getAttribute){var e=t.target.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function l(t){if(t)for(var e,n=0;n<t.length;n++){if(e=t[n],"a"===e.tag)return e;if(e.children&&(e=l(e.children)))return e}}function d(t){if(!d.installed){d.installed=!0,Ot=t,Object.defineProperty(t.prototype,"$router",{get:function(){return this.$root._router}}),Object.defineProperty(t.prototype,"$route",{get:function(){return this.$root._route}}),t.mixin({beforeCreate:function(){this.$options.router&&(this._router=this.$options.router,this._router.init(this),t.util.defineReactive(this,"_route",this._router.history.current))}}),t.component("router-view",Rt),t.component("router-link",Lt);var e=t.config.optionMergeStrategies;e.beforeRouteEnter=e.beforeRouteLeave=e.created}}function y(t,e,n){if("/"===t.charAt(0))return t;if("?"===t.charAt(0)||"#"===t.charAt(0))return e+t;var r=e.split("/");n&&r[r.length-1]||r.pop();for(var o=t.replace(/^\//,"").split("/"),i=0;i<o.length;i++){var a=o[i];"."!==a&&(".."===a?r.pop():r.push(a))}return""!==r[0]&&r.unshift(""),r.join("/")}function v(t){var e="",n="",r=t.indexOf("#");r>=0&&(e=t.slice(r),t=t.slice(0,r));var o=t.indexOf("?");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{path:t,query:n,hash:e}}function m(t){return t.replace(/\/\//g,"/")}function g(t,e,n){var r=e||Object.create(null),o=n||Object.create(null);return t.forEach(function(t){w(r,o,t)}),{pathMap:r,nameMap:o}}function w(t,e,n,r,o){var i=n.path,a=n.name,u={path:b(i,r),components:n.components||{default:n.component},instances:{},name:a,parent:r,matchAs:o,redirect:n.redirect,beforeEnter:n.beforeEnter,meta:n.meta||{},props:null==n.props?{}:n.components?n.props:{default:n.props}};if(n.children&&n.children.forEach(function(n){var r=o?m(o+"/"+n.path):void 0;w(t,e,n,u,r)}),void 0!==n.alias)if(Array.isArray(n.alias))n.alias.forEach(function(o){var i={path:o,children:n.children};w(t,e,i,r,u.path)});else{var c={path:n.alias,children:n.children};w(t,e,c,r,u.path)}t[u.path]||(t[u.path]=u),a&&(e[a]||(e[a]=u))}function b(t,e){return t=t.replace(/\/$/,""),"/"===t[0]?t:null==e?t:m(e.path+"/"+t)}function x(t,e){for(var n,r=[],o=0,i=0,a="",u=e&&e.delimiter||"/";null!=(n=Ft.exec(t));){var c=n[0],s=n[1],p=n.index;if(a+=t.slice(i,p),i=p+c.length,s)a+=s[1];else{var f=t[i],h=n[2],l=n[3],d=n[4],y=n[5],v=n[6],m=n[7];a&&(r.push(a),a="");var g=null!=h&&null!=f&&f!==h,w="+"===v||"*"===v,b="?"===v||"*"===v,x=n[2]||u,k=d||y;r.push({name:l||o++,prefix:h||"",delimiter:x,optional:b,repeat:w,partial:g,asterisk:!!m,pattern:k?A(k):m?".*":"[^"+j(x)+"]+?"})}}return i<t.length&&(a+=t.substr(i)),a&&r.push(a),r}function k(t,e){return E(x(t,e))}function O(t){return encodeURI(t).replace(/[\/?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function R(t){return encodeURI(t).replace(/[?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function E(t){for(var e=new Array(t.length),n=0;n<t.length;n++)"object"==typeof t[n]&&(e[n]=new RegExp("^(?:"+t[n].pattern+")$"));return function(n,r){for(var o="",i=n||{},a=r||{},u=a.pretty?O:encodeURIComponent,c=0;c<t.length;c++){var s=t[c];if("string"!=typeof s){var p,f=i[s.name];if(null==f){if(s.optional){s.partial&&(o+=s.prefix);continue}throw new TypeError('Expected "'+s.name+'" to be defined')}if(zt(f)){if(!s.repeat)throw new TypeError('Expected "'+s.name+'" to not repeat, but received `'+JSON.stringify(f)+"`");if(0===f.length){if(s.optional)continue;throw new TypeError('Expected "'+s.name+'" to not be empty')}for(var h=0;h<f.length;h++){if(p=u(f[h]),!e[c].test(p))throw new TypeError('Expected all "'+s.name+'" to match "'+s.pattern+'", but received `'+JSON.stringify(p)+"`");o+=(0===h?s.prefix:s.delimiter)+p}}else{if(p=s.asterisk?R(f):u(f),!e[c].test(p))throw new TypeError('Expected "'+s.name+'" to match "'+s.pattern+'", but received "'+p+'"');o+=s.prefix+p}}else o+=s}return o}}function j(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function A(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function C(t,e){return t.keys=e,t}function _(t){return t.sensitive?"":"i"}function T(t,e){var n=t.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)e.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return C(t,e)}function $(t,e,n){for(var r=[],o=0;o<t.length;o++)r.push(L(t[o],e,n).source);var i=new RegExp("(?:"+r.join("|")+")",_(n));return C(i,e)}function S(t,e,n){return q(x(t,n),e,n)}function q(t,e,n){zt(e)||(n=e||n,e=[]),n=n||{};for(var r=n.strict,o=n.end!==!1,i="",a=0;a<t.length;a++){var u=t[a];if("string"==typeof u)i+=j(u);else{var c=j(u.prefix),s="(?:"+u.pattern+")";e.push(u),u.repeat&&(s+="(?:"+c+s+")*"),s=u.optional?u.partial?c+"("+s+")?":"(?:"+c+"("+s+"))?":c+"("+s+")",i+=s}}var p=j(n.delimiter||"/"),f=i.slice(-p.length)===p;return r||(i=(f?i.slice(0,-p.length):i)+"(?:"+p+"(?=$))?"),i+=o?"$":r&&f?"":"(?="+p+"|$)",C(new RegExp("^"+i,_(n)),e)}function L(t,e,n){return zt(e)||(n=e||n,e=[]),n=n||{},t instanceof RegExp?T(t,e):zt(t)?$(t,e,n):S(t,e,n)}function P(t){var e,n,r=Dt[t];return r?(e=r.keys,n=r.regexp):(e=[],n=Mt(t,e),Dt[t]={keys:e,regexp:n}),{keys:e,regexp:n}}function U(t,e,n){try{var r=Jt[t]||(Jt[t]=Mt.compile(t));return r(e||{},{pretty:!0})}catch(t){return""}}function z(t,e,r){var o="string"==typeof t?{path:t}:t;if(o.name||o._normalized)return o;if(!o.path&&o.params&&e){o=M({},o),o._normalized=!0;var i=M(M({},e.params),o.params);if(e.name)o.name=e.name,o.params=i;else if(e.matched){var a=e.matched[e.matched.length-1].path;o.path=U(a,i,"path "+e.path)}return o}var u=v(o.path||""),c=e&&e.path||"/",s=u.path?y(u.path,c,r||o.append):e&&e.path||"/",p=n(u.query,o.query),f=o.hash||u.hash;return f&&"#"!==f.charAt(0)&&(f="#"+f),{_normalized:!0,path:s,query:p,hash:f}}function M(t,e){for(var n in e)t[n]=e[n];return t}function V(e){function n(t){g(t,s,p)}function r(t,e,n){var r=z(t,e),o=r.name;if(o){var i=p[o],a=P(i.path).keys.filter(function(t){return!t.optional}).map(function(t){return t.name});if("object"!=typeof r.params&&(r.params={}),e&&"object"==typeof e.params)for(var c in e.params)!(c in r.params)&&a.indexOf(c)>-1&&(r.params[c]=e.params[c]);if(i)return r.path=U(i.path,r.params,'named route "'+o+'"'),u(i,r,n)}else if(r.path){r.params={};for(var f in s)if(B(f,r.params,r.path))return u(s[f],r,n)}return u(null,r)}function o(e,n){var o=e.redirect,a="function"==typeof o?o(i(e,n)):o;if("string"==typeof a&&(a={path:a}),!a||"object"!=typeof a)return u(null,n);var c=a,s=c.name,f=c.path,h=n.query,l=n.hash,d=n.params;if(h=c.hasOwnProperty("query")?c.query:h,l=c.hasOwnProperty("hash")?c.hash:l,d=c.hasOwnProperty("params")?c.params:d,s){p[s];return r({_normalized:!0,name:s,query:h,hash:l,params:d},void 0,n)}if(f){var y=H(f,e),v=U(y,d,'redirect route with path "'+y+'"');return r({_normalized:!0,path:v,query:h,hash:l},void 0,n)}return t(!1,"invalid redirect option: "+JSON.stringify(a)),u(null,n)}function a(t,e,n){var o=U(n,e.params,'aliased route with path "'+n+'"'),i=r({_normalized:!0,path:o});if(i){var a=i.matched,c=a[a.length-1];return e.params=i.params,u(c,e)}return u(null,e)}function u(t,e,n){return t&&t.redirect?o(t,n||e):t&&t.matchAs?a(t,e,t.matchAs):i(t,e,n)}var c=g(e),s=c.pathMap,p=c.nameMap;return{match:r,addRoutes:n}}function B(t,e,n){var r=P(t),o=r.regexp,i=r.keys,a=n.match(o);if(!a)return!1;if(!e)return!0;for(var u=1,c=a.length;u<c;++u){var s=i[u-1],p="string"==typeof a[u]?decodeURIComponent(a[u]):a[u];s&&(e[s.name]=p)}return!0}function H(t,e){return y(t,e.parent?e.parent.path:"/",!0)}function I(){window.addEventListener("popstate",function(t){D(),t.state&&t.state.key&&Q(t.state.key)})}function F(t,e,n,r){if(t.app){var o=t.options.scrollBehavior;o&&t.app.$nextTick(function(){var t=J(),i=o(e,n,r?t:null);if(i){var a="object"==typeof i;if(a&&"string"==typeof i.selector){var u=document.querySelector(i.selector);u?t=K(u):N(i)&&(t=X(i))}else a&&N(i)&&(t=X(i));t&&window.scrollTo(t.x,t.y)}})}}function D(){var t=G();t&&(Kt[t]={x:window.pageXOffset,y:window.pageYOffset})}function J(){var t=G();if(t)return Kt[t]}function K(t){var e=document.documentElement,n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return{x:r.left-n.left,y:r.top-n.top}}function N(t){return Y(t.x)||Y(t.y)}function X(t){return{x:Y(t.x)?t.x:window.pageXOffset,y:Y(t.y)?t.y:window.pageYOffset}}function Y(t){return"number"==typeof t}function W(){return Xt.now().toFixed(3)}function G(){return Yt}function Q(t){Yt=t}function Z(t,e){D();var n=window.history;try{e?n.replaceState({key:Yt},"",t):(Yt=W(),n.pushState({key:Yt},"",t))}catch(n){window.location[e?"replace":"assign"](t)}}function tt(t){Z(t,!0)}function et(t,e,n){var r=function(o){o>=t.length?n():t[o]?e(t[o],function(){r(o+1)}):r(o+1)};r(0)}function nt(t){if(!t)if(Pt){var e=document.querySelector("base");t=e&&e.getAttribute("href")||"/"}else t="/";return"/"!==t.charAt(0)&&(t="/"+t),t.replace(/\/$/,"")}function rt(t,e){var n,r=Math.max(t.length,e.length);for(n=0;n<r&&t[n]===e[n];n++);return{updated:e.slice(0,n),activated:e.slice(n),deactivated:t.slice(n)}}function ot(t,e,n,r){var o=lt(t,function(t,r,o,i){var a=it(t,e);if(a)return Array.isArray(a)?a.map(function(t){return n(t,r,o,i)}):n(a,r,o,i)});return dt(r?o.reverse():o)}function it(t,e){return"function"!=typeof t&&(t=Ot.extend(t)),t.options[e]}function at(t){return ot(t,"beforeRouteLeave",ct,!0)}function ut(t){return ot(t,"beforeRouteUpdate",ct)}function ct(t,e){return function(){return t.apply(e,arguments)}}function st(t,e,n){return ot(t,"beforeRouteEnter",function(t,r,o,i){return pt(t,o,i,e,n)})}function pt(t,e,n,r,o){return function(i,a,u){return t(i,a,function(t){u(t),"function"==typeof t&&r.push(function(){ft(t,e.instances,n,o)})})}}function ft(t,e,n,r){e[n]?t(e[n]):r()&&setTimeout(function(){ft(t,e,n,r)},16)}function ht(e){return lt(e,function(e,n,r,o){if("function"==typeof e&&!e.options)return function(n,i,a){var u=yt(function(t){r.components[o]=t,a()}),c=yt(function(e){t(!1,"Failed to resolve async component "+o+": "+e),a(!1)}),s=e(u,c);s&&"function"==typeof s.then&&s.then(u,c)}})}function lt(t,e){return dt(t.map(function(t){return Object.keys(t.components).map(function(n){return e(t.components[n],t.instances[n],t,n)})}))}function dt(t){return Array.prototype.concat.apply([],t)}function yt(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}function vt(t){var e=window.location.pathname;return t&&0===e.indexOf(t)&&(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}function mt(t){var e=vt(t);if(!/^\/#/.test(e))return window.location.replace(m(t+"/#"+e)),!0}function gt(){var t=wt();return"/"===t.charAt(0)||(xt("/"+t),!1)}function wt(){var t=window.location.href,e=t.indexOf("#");return e===-1?"":t.slice(e+1)}function bt(t){window.location.hash=t}function xt(t){var e=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,e>=0?e:0)+"#"+t)}function kt(t,e,n){var r="hash"===n?"#"+e:e;return t?m(t+"/"+r):r}var Ot,Rt={name:"router-view",functional:!0,props:{name:{type:String,default:"default"}},render:function(t,n){var r=n.props,o=n.children,i=n.parent,a=n.data;a.routerView=!0;for(var u=r.name,c=i.$route,s=i._routerViewCache||(i._routerViewCache={}),p=0,f=!1;i;)i.$vnode&&i.$vnode.data.routerView&&p++,i._inactive&&(f=!0),i=i.$parent;if(a.routerViewDepth=p,f)return t(s[u],a,o);var h=c.matched[p];if(!h)return s[u]=null,t();var l=s[u]=h.components[u],d=a.hook||(a.hook={});return d.init=function(t){h.instances[u]=t.child},d.prepatch=function(t,e){h.instances[u]=e.child},d.destroy=function(t){h.instances[u]===t.child&&(h.instances[u]=void 0)},a.props=e(c,h.props&&h.props[u]),t(l,a,o)}},Et=/[!'()*]/g,jt=function(t){return"%"+t.charCodeAt(0).toString(16)},At=/%2C/g,Ct=function(t){return encodeURIComponent(t).replace(Et,jt).replace(At,",")},_t=decodeURIComponent,Tt=/\/?$/,$t=i(null,{path:"/"}),St=[String,Object],qt=[String,Array],Lt={name:"router-link",props:{to:{type:St,required:!0},tag:{type:String,default:"a"},exact:Boolean,append:Boolean,replace:Boolean,activeClass:String,event:{type:qt,default:"click"}},render:function(t){var e=this,n=this.$router,r=this.$route,o=n.resolve(this.to,r,this.append),a=o.location,u=o.route,s=o.href,f={},d=this.activeClass||n.options.linkActiveClass||"router-link-active",y=a.path?i(null,a):u;f[d]=this.exact?c(r,y):p(r,y);var v=function(t){h(t)&&(e.replace?n.replace(a):n.push(a))},m={click:h};Array.isArray(this.event)?this.event.forEach(function(t){m[t]=v}):m[this.event]=v;var g={class:f};if("a"===this.tag)g.on=m,g.attrs={href:s};else{var w=l(this.$slots.default);if(w){w.isStatic=!1;var b=Ot.util.extend,x=w.data=b({},w.data);x.on=m;var k=w.data.attrs=b({},w.data.attrs);k.href=s}else g.on=m}return t(this.tag,g,this.$slots.default)}},Pt="undefined"!=typeof window,Ut=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},zt=Ut,Mt=L,Vt=x,Bt=k,Ht=E,It=q,Ft=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");Mt.parse=Vt,Mt.compile=Bt,Mt.tokensToFunction=Ht,Mt.tokensToRegExp=It;var Dt=Object.create(null),Jt=Object.create(null),Kt=Object.create(null),Nt=Pt&&function(){var t=window.navigator.userAgent;return(t.indexOf("Android 2.")===-1&&t.indexOf("Android 4.0")===-1||t.indexOf("Mobile Safari")===-1||t.indexOf("Chrome")!==-1||t.indexOf("Windows Phone")!==-1)&&(window.history&&"pushState"in window.history)}(),Xt=Pt&&window.performance&&window.performance.now?window.performance:Date,Yt=W(),Wt=function(t,e){this.router=t,this.base=nt(e),this.current=$t,this.pending=null,this.ready=!1,this.readyCbs=[]};Wt.prototype.listen=function(t){this.cb=t},Wt.prototype.onReady=function(t){this.ready?t():this.readyCbs.push(t)},Wt.prototype.transitionTo=function(t,e,n){var r=this,o=this.router.match(t,this.current);this.confirmTransition(o,function(){r.updateRoute(o),e&&e(o),r.ensureURL(),r.ready||(r.ready=!0,r.readyCbs.forEach(function(t){t(o)}))},n)},Wt.prototype.confirmTransition=function(t,e,n){var r=this,o=this.current,i=function(){n&&n()};if(c(t,o)&&t.matched.length===o.matched.length)return this.ensureURL(),i();var a=rt(this.current.matched,t.matched),u=a.updated,s=a.deactivated,p=a.activated,f=[].concat(at(s),this.router.beforeHooks,ut(u),p.map(function(t){return t.beforeEnter}),ht(p));this.pending=t;var h=function(e,n){return r.pending!==t?i():void e(t,o,function(t){t===!1?(r.ensureURL(!0),i()):"string"==typeof t||"object"==typeof t?("object"==typeof t&&t.replace?r.replace(t):r.push(t),i()):n(t)})};et(f,h,function(){var n=[],o=function(){return r.current===t},a=st(p,n,o);et(a,h,function(){return r.pending!==t?i():(r.pending=null,e(t),void(r.router.app&&r.router.app.$nextTick(function(){n.forEach(function(t){return t()})})))})})},Wt.prototype.updateRoute=function(t){var e=this.current;this.current=t,this.cb&&this.cb(t),this.router.afterHooks.forEach(function(n){n&&n(t,e)})};var Gt=function(t){function e(e,n){var r=this;t.call(this,e,n);var o=e.options.scrollBehavior;o&&I(),window.addEventListener("popstate",function(t){r.transitionTo(vt(r.base),function(t){o&&F(e,t,r.current,!0)})})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,n){var r=this,o=this,i=o.current;this.transitionTo(t,function(t){Z(m(r.base+t.fullPath)),F(r.router,t,i,!1),e&&e(t)},n)},e.prototype.replace=function(t,e,n){var r=this,o=this,i=o.current;this.transitionTo(t,function(t){tt(m(r.base+t.fullPath)),F(r.router,t,i,!1),e&&e(t)},n)},e.prototype.ensureURL=function(t){if(vt(this.base)!==this.current.fullPath){var e=m(this.base+this.current.fullPath);t?Z(e):tt(e)}},e.prototype.getCurrentLocation=function(){return vt(this.base)},e}(Wt),Qt=function(t){function e(e,n,r){t.call(this,e,n),r&&mt(this.base)||gt()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;window.addEventListener("hashchange",function(){gt()&&t.transitionTo(wt(),function(t){xt(t.fullPath)})})},e.prototype.push=function(t,e,n){this.transitionTo(t,function(t){bt(t.fullPath),e&&e(t)},n)},e.prototype.replace=function(t,e,n){this.transitionTo(t,function(t){xt(t.fullPath),e&&e(t)},n)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;wt()!==e&&(t?bt(e):xt(e))},e.prototype.getCurrentLocation=function(){return wt()},e}(Wt),Zt=function(t){function e(e,n){t.call(this,e,n),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,n){var r=this;this.transitionTo(t,function(t){r.stack=r.stack.slice(0,r.index+1).concat(t),r.index++,e&&e(t)},n)},e.prototype.replace=function(t,e,n){var r=this;this.transitionTo(t,function(t){r.stack=r.stack.slice(0,r.index).concat(t),e&&e(t)},n)},e.prototype.go=function(t){var e=this,n=this.index+t;if(!(n<0||n>=this.stack.length)){var r=this.stack[n];this.confirmTransition(r,function(){e.index=n,e.updateRoute(r)})}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(Wt),te=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.afterHooks=[],this.matcher=V(t.routes||[]);var e=t.mode||"hash";switch(this.fallback="history"===e&&!Nt,this.fallback&&(e="hash"),Pt||(e="abstract"),this.mode=e,e){case"history":this.history=new Gt(this,t.base);break;case"hash":this.history=new Qt(this,t.base,this.fallback);break;case"abstract":this.history=new Zt(this,t.base)}},ee={currentRoute:{}};return te.prototype.match=function(t,e,n){return this.matcher.match(t,e,n)},ee.currentRoute.get=function(){return this.history&&this.history.current},te.prototype.init=function(t){var e=this;if(this.apps.push(t),!this.app){this.app=t;var n=this.history;if(n instanceof Gt)n.transitionTo(n.getCurrentLocation());else if(n instanceof Qt){var r=function(){n.setupListeners()};n.transitionTo(n.getCurrentLocation(),r,r)}n.listen(function(t){e.apps.forEach(function(e){e._route=t})})}},te.prototype.beforeEach=function(t){this.beforeHooks.push(t)},te.prototype.afterEach=function(t){this.afterHooks.push(t)},te.prototype.onReady=function(t){this.history.onReady(t)},te.prototype.push=function(t,e,n){this.history.push(t,e,n)},te.prototype.replace=function(t,e,n){this.history.replace(t,e,n)},te.prototype.go=function(t){this.history.go(t)},te.prototype.back=function(){this.go(-1)},te.prototype.forward=function(){this.go(1)},te.prototype.getMatchedComponents=function(t){var e=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]})})):[]},te.prototype.resolve=function(t,e,n){var r=z(t,e||this.history.current,n),o=this.match(r,e),i=o.redirectedFrom||o.fullPath,a=this.history.base,u=kt(a,i,this.mode);return{location:r,route:o,href:u,normalizedTo:r,resolved:o}},te.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==$t&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(te.prototype,ee),te.install=d,te.version="2.3.1",Pt&&window.Vue&&window.Vue.use(te),te});
{
"name": "vue-router",
"version": "2.3.0",
"version": "2.3.1",
"description": "Official router for Vue.js 2",

@@ -16,10 +16,5 @@ "author": "Evan You",

"files": [
"dist/vue-router.js",
"dist/vue-router.min.js",
"dist/vue-router.common.js",
"dist/vue-router.esm.js",
"src",
"types/index.d.ts",
"types/router.d.ts",
"types/vue.d.ts"
"dist/*.js",
"types/*.d.ts"
],

@@ -26,0 +21,0 @@ "keywords": [

@@ -33,5 +33,6 @@ /* @flow */

push (location: RawLocation, onComplete?: Function, onAbort?: Function) {
const { current: fromRoute } = this
this.transitionTo(location, route => {
pushState(cleanPath(this.base + route.fullPath))
handleScroll(this.router, route, this.current, false)
handleScroll(this.router, route, fromRoute, false)
onComplete && onComplete(route)

@@ -42,5 +43,6 @@ }, onAbort)

replace (location: RawLocation, onComplete?: Function, onAbort?: Function) {
const { current: fromRoute } = this
this.transitionTo(location, route => {
replaceState(cleanPath(this.base + route.fullPath))
handleScroll(this.router, route, this.current, false)
handleScroll(this.router, route, fromRoute, false)
onComplete && onComplete(route)

@@ -47,0 +49,0 @@ }, onAbort)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc