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 0.6.1 to 0.6.2

4

dist/vue-router.min.js
/*!
* vue-router v0.6.1
* vue-router v0.6.2
* (c) 2015 Evan You
* Released under the MIT License.
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VueRouter=e():t.VueRouter=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=n(1)["default"],o=n(2)["default"];Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),i=o(a),s=n(4),u=o(s),c=n(7),h=o(c),l=n(8),f=o(l),d=n(26),p=o(d),v=n(27),g=o(v),m=n(28),y=o(m),_=n(29),w=o(_),b=n(30),x=o(b),C=n(31),P=o(C),R={"abstract":w["default"],hash:x["default"],html5:P["default"]},k=function E(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],e=t.hashbang,n=void 0===e?!0:e,o=t["abstract"],a=void 0===o?!1:o,s=t.history,c=void 0===s?!1:s,h=t.saveScrollPosition,l=void 0===h?!1:h,f=t.transitionOnLoad,d=void 0===f?!1:f,p=t.suppressTransitionError,v=void 0===p?!1:p,g=t.root,m=void 0===g?null:g,y=t.linkActiveClass,_=void 0===y?"v-link-active":y;if(r(this,E),!E.installed)throw new Error("Please install the Router with Vue.use() before creating an instance.");this.app=null,this._views=[],this._children=[],this._recognizer=new u["default"],this._guardRecognizer=new u["default"],this._started=!1,this._currentRoute={},this._currentTransition=null,this._previousTransition=null,this._notFoundHandler=null,this._beforeEachHooks=[],this._afterEachHooks=[],this._hasPushState="undefined"!=typeof window&&window.history&&window.history.pushState,this._rendered=!1,this._transitionOnLoad=d,this._abstract=a,this._hashbang=n,this._history=this._hasPushState&&c,this._saveScrollPosition=l,this._linkActiveClass=_,this._suppress=v;var w=i["default"].Vue.util.inBrowser;this.mode=!w||this._abstract?"abstract":this._history?"html5":"hash";var b=R[this.mode],x=this;this.history=new b({root:m,hashbang:this._hashbang,onChange:function(t,e,n){x._match(t,e,n)}})};e["default"]=k,k.installed=!1,k.install=function(t){if(k.installed)return void a.warn("already installed.");h["default"](t,k),f["default"](t,k),p["default"](t),g["default"](t),y["default"](t),i["default"].Vue=t;var e=t.config.optionMergeStrategies;e&&(e.route=e.methods),k.installed=!0},"undefined"!=typeof window&&window.Vue&&window.Vue.use(k),t.exports=e["default"]},function(t,e){"use strict";e["default"]=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},e.__esModule=!0},function(t,e){"use strict";e["default"]=function(t){return t&&t.__esModule?t:{"default":t}},e.__esModule=!0},function(t,e,n){"use strict";function r(t,e){window.console&&(console.warn("[vue-router] "+t),e&&console.warn(e.stack))}function o(t,e){var n=t.match(/(\?.*)$/);if(n&&(n=n[1],t=t.slice(0,-n.length)),"?"===e.charAt(0))return t+e;var r=t.split("/");r.pop();for(var o=e.split("/"),a=0;a<o.length;a++){var i=o[a];"."!==i&&(".."===i?r.pop():r.push(i))}return""!==r[0]&&r.unshift(""),r.join("/")}function a(t){return t&&"function"==typeof t.then}function i(t,e){var n=t&&(t.$options||t.options);return n&&n.route&&n.route[e]}function s(t,e){v?v.$options.components._=t.component:v={resolve:p.Vue.prototype._resolveComponent,$options:{components:{_:t.component}}},v.resolve("_",function(n){t.component=n,e(n)})}function u(t,e,n){for(var r in e)t=c(t,e,r);return n&&(t+=d(n)),t}function c(t,e,n){var r=new RegExp(":"+n+"(\\/|$)"),o=e[n];return t.replace(r,function(t){return"/"===t.charAt(t.length-1)?o+"/":o})}var h=n(2)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.warn=r,e.resolvePath=o,e.isPromise=a,e.getRouteConfig=i,e.resolveAsyncComponent=s,e.mapParams=u;var l=n(4),f=h(l),d=f["default"].prototype.generateQueryString,p={};e["default"]=p;var v=void 0},function(t,e,n){var r;(function(t){(function(){"use strict";function o(t,e,n){this.path=t,this.matcher=e,this.delegate=n}function a(t){this.routes={},this.children={},this.target=t}function i(t,e,n){return function(r,a){var s=t+r;return a?void a(i(s,e,n)):new o(t+r,e,n)}}function s(t,e,n){for(var r=0,o=0,a=t.length;a>o;o++)r+=t[o].path.length;e=e.substr(r);var i={path:e,handler:n};t.push(i)}function u(t,e,n,r){var o=e.routes;for(var a in o)if(o.hasOwnProperty(a)){var i=t.slice();s(i,a,o[a]),e.children[a]?u(i,e.children[a],n,r):n.call(r,i)}}function c(t){return"[object Array]"===Object.prototype.toString.call(t)}function h(t){this.string=t}function l(t){this.name=t}function f(t){this.name=t}function d(){}function p(t,e,n){"/"===t.charAt(0)&&(t=t.substr(1));var r=t.split("/"),o=[];n.val="";for(var a=0,i=r.length;i>a;a++){var s,u=r[a];(s=u.match(/^:([^\/]+)$/))?(o.push(new l(s[1])),e.push(s[1]),n.val+="3"):(s=u.match(/^\*([^\/]+)$/))?(o.push(new f(s[1])),n.val+="2",e.push(s[1])):""===u?(o.push(new d),n.val+="1"):(o.push(new h(u)),n.val+="4")}return n.val=+n.val,o}function v(t){this.charSpec=t,this.nextStates=[]}function g(t){return t.sort(function(t,e){return e.specificity.val-t.specificity.val})}function m(t,e){for(var n=[],r=0,o=t.length;o>r;r++){var a=t[r];n=n.concat(a.match(e))}return n}function y(t){this.queryParams=t||{}}function _(t,e,n){for(var r=t.handlers,o=t.regex,a=e.match(o),i=1,s=new y(n),u=0,c=r.length;c>u;u++){for(var h=r[u],l=h.names,f={},d=0,p=l.length;p>d;d++)f[l[d]]=a[i++];s.push({handler:h.handler,params:f,isDynamic:!!l.length})}return s}function w(t,e){return e.eachChar(function(e){t=t.put(e)}),t}function b(t){return t=t.replace(/\+/gm,"%20"),decodeURIComponent(t)}o.prototype={to:function(t,e){var n=this.delegate;if(n&&n.willAddRoute&&(t=n.willAddRoute(this.matcher.target,t)),this.matcher.add(this.path,t),e){if(0===e.length)throw new Error("You must have an argument in the function passed to `to`");this.matcher.addChild(this.path,t,e,this.delegate)}return this}},a.prototype={add:function(t,e){this.routes[t]=e},addChild:function(t,e,n,r){var o=new a(e);this.children[t]=o;var s=i(t,o,r);r&&r.contextEntered&&r.contextEntered(e,s),n(s)}};var x=function(t,e){var n=new a;t(i("",n,this.delegate)),u([],n,function(t){e?e(this,t):this.add(t)},this)},C=["/",".","*","+","?","|","(",")","[","]","{","}","\\"],P=new RegExp("(\\"+C.join("|\\")+")","g");h.prototype={eachChar:function(t){for(var e,n=this.string,r=0,o=n.length;o>r;r++)e=n.charAt(r),t({validChars:e})},regex:function(){return this.string.replace(P,"\\$1")},generate:function(){return this.string}},l.prototype={eachChar:function(t){t({invalidChars:"/",repeat:!0})},regex:function(){return"([^/]+)"},generate:function(t){return t[this.name]}},f.prototype={eachChar:function(t){t({invalidChars:"",repeat:!0})},regex:function(){return"(.+)"},generate:function(t){return t[this.name]}},d.prototype={eachChar:function(){},regex:function(){return""},generate:function(){return""}},v.prototype={get:function(t){for(var e=this.nextStates,n=0,r=e.length;r>n;n++){var o=e[n],a=o.charSpec.validChars===t.validChars;if(a=a&&o.charSpec.invalidChars===t.invalidChars)return o}},put:function(t){var e;return(e=this.get(t))?e:(e=new v(t),this.nextStates.push(e),t.repeat&&e.nextStates.push(e),e)},match:function(t){for(var e,n,r,o=this.nextStates,a=[],i=0,s=o.length;s>i;i++)e=o[i],n=e.charSpec,"undefined"!=typeof(r=n.validChars)?-1!==r.indexOf(t)&&a.push(e):"undefined"!=typeof(r=n.invalidChars)&&-1===r.indexOf(t)&&a.push(e);return a}};var R=Object.create||function(t){function e(){}return e.prototype=t,new e};y.prototype=R({splice:Array.prototype.splice,slice:Array.prototype.slice,push:Array.prototype.push,length:0,queryParams:null});var k=function(){this.rootState=new v,this.names={}};k.prototype={add:function(t,e){for(var n,r=this.rootState,o="^",a={},i=[],s=[],u=!0,c=0,h=t.length;h>c;c++){var l=t[c],f=[],v=p(l.path,f,a);s=s.concat(v);for(var g=0,m=v.length;m>g;g++){var y=v[g];y instanceof d||(u=!1,r=r.put({validChars:"/"}),o+="/",r=w(r,y),o+=y.regex())}var _={handler:l.handler,names:f};i.push(_)}u&&(r=r.put({validChars:"/"}),o+="/"),r.handlers=i,r.regex=new RegExp(o+"$"),r.specificity=a,(n=e&&e.as)&&(this.names[n]={segments:s,handlers:i})},handlersFor:function(t){var e=this.names[t],n=[];if(!e)throw new Error("There is no route named "+t);for(var r=0,o=e.handlers.length;o>r;r++)n.push(e.handlers[r]);return n},hasRoute:function(t){return!!this.names[t]},generate:function(t,e){var n=this.names[t],r="";if(!n)throw new Error("There is no route named "+t);for(var o=n.segments,a=0,i=o.length;i>a;a++){var s=o[a];s instanceof d||(r+="/",r+=s.generate(e))}return"/"!==r.charAt(0)&&(r="/"+r),e&&e.queryParams&&(r+=this.generateQueryString(e.queryParams,n.handlers)),r},generateQueryString:function(t,e){var n=[],r=[];for(var o in t)t.hasOwnProperty(o)&&r.push(o);r.sort();for(var a=0,i=r.length;i>a;a++){o=r[a];var s=t[o];if(null!=s){var u=encodeURIComponent(o);if(c(s))for(var h=0,l=s.length;l>h;h++){var f=o+"[]="+encodeURIComponent(s[h]);n.push(f)}else u+="="+encodeURIComponent(s),n.push(u)}}return 0===n.length?"":"?"+n.join("&")},parseQueryString:function(t){for(var e=t.split("&"),n={},r=0;r<e.length;r++){var o,a=e[r].split("="),i=b(a[0]),s=i.length,u=!1;1===a.length?o="true":(s>2&&"[]"===i.slice(s-2)&&(u=!0,i=i.slice(0,s-2),n[i]||(n[i]=[])),o=a[1]?b(a[1]):""),u?n[i].push(o):n[i]=o}return n},recognize:function(t){var e,n,r,o,a=[this.rootState],i={},s=!1;if(o=t.indexOf("?"),-1!==o){var u=t.substr(o+1,t.length);t=t.substr(0,o),i=this.parseQueryString(u)}for(t=decodeURI(t),"/"!==t.charAt(0)&&(t="/"+t),e=t.length,e>1&&"/"===t.charAt(e-1)&&(t=t.substr(0,e-1),s=!0),n=0,r=t.length;r>n&&(a=m(a,t.charAt(n)),a.length);n++);var c=[];for(n=0,r=a.length;r>n;n++)a[n].handlers&&c.push(a[n]);a=g(c);var h=c[0];return h&&h.handlers?(s&&"(.+)$"===h.regex.source.slice(-5)&&(t+="/"),_(h,t,i)):void 0}},k.prototype.map=x,k.VERSION="0.1.9";var E=k;n(6).amd?(r=function(){return E}.call(e,n,e,t),!(void 0!==r&&(t.exports=r))):"undefined"!=typeof t&&t.exports?t.exports=E:"undefined"!=typeof this&&(this.RouteRecognizer=E)}).call(this)}).call(e,n(5)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){t.exports=function(){throw new Error("define cannot be used indirect")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3);e["default"]=function(t,e){e.prototype.map=function(t){for(var e in t)this.on(e,t[e])},e.prototype.on=function(t,e){"*"===t?this._notFound(e):this._addRoute(t,e,[])},e.prototype.redirect=function(t){for(var e in t)this._addRedirect(e,t[e])},e.prototype.alias=function(t){for(var e in t)this._addAlias(e,t[e])},e.prototype.beforeEach=function(t){this._beforeEachHooks.push(t)},e.prototype.afterEach=function(t){this._afterEachHooks.push(t)},e.prototype.go=function(t,e){t=this._normalizePath(t),this.history.go(t,e)},e.prototype.replace=function(t){this.go(t,!0)},e.prototype.start=function(e,n){if(this._started)return void r.warn("already started.");if(this._started=!0,!this.app){if(!e||!n)throw new Error("Must start vue-router with a component and a root container.");this._appContainer=n,this._appConstructor="function"==typeof e?e:t.extend(e)}this.history.start()},e.prototype.stop=function(){this.history.stop(),this._started=!1}},t.exports=e["default"]},function(t,e,n){"use strict";var r=n(2)["default"];Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),a=n(9),i=r(a),s=n(10),u=r(s);e["default"]=function(t,e){function n(e){var n=e.component;r.isPlainObject(n)&&(n=e.component=t.extend(n)),"function"!=typeof n&&(e.component=null,o.warn('invalid component for route "'+e.path+'"'))}var r=t.util;e.prototype._addRoute=function(t,e,r){if(n(e),r.push({path:t,handler:e}),this._recognizer.add(r,{as:e.name}),e.subRoutes)for(var o in e.subRoutes)this._addRoute(o,e.subRoutes[o],r.slice())},e.prototype._notFound=function(t){n(t),this._notFoundHandler=[{handler:t}]},e.prototype._addRedirect=function(t,e){this._addGuard(t,e,this.replace)},e.prototype._addAlias=function(t,e){this._addGuard(t,e,this._match)},e.prototype._addGuard=function(t,e,n){var r=this;this._guardRecognizer.add([{path:t,handler:function(t,a){var i=o.mapParams(e,t.params,a);n.call(r,i)}}])},e.prototype._checkGuard=function(t){var e=this._guardRecognizer.recognize(t);return e?(e[0].handler(e[0],e.queryParams),!0):void 0},e.prototype._match=function(t,e,n){var r=this;if(!this._checkGuard(t)){var o=this._currentRoute,a=this._currentTransition;if(!a||t!==o.path){var s=new i["default"](t,this),c=new u["default"](this,s,o);this._prevTransition=a,this._currentTransition=c,this.app||(this.app=new this._appConstructor({el:this._appContainer,_meta:{$route:s}}));var h=this._beforeEachHooks,l=function(){c.start(function(){r._postTransition(s,e,n)})};h.length?c.runQueue(h,function(t,e,n){c===r._currentTransition&&c.callHook(t,null,n,!0)},l):l(),this._rendered=!0}}},e.prototype._onTransitionValidated=function(t){var e=this._prevTransition;e&&(e.aborted=!0);var n=this._currentRoute=t.to;this.app.$route!==n&&(this.app.$route=n,this._children.forEach(function(t){t.$route=n})),this._afterEachHooks.length&&this._afterEachHooks.forEach(function(e){return e.call(null,{to:t.to,from:t.from})}),this._currentTransition.done=!0},e.prototype._postTransition=function(e,n,r){var o=n&&n.pos;o&&this._saveScrollPosition?t.nextTick(function(){window.scrollTo(o.x,o.y)}):r&&t.nextTick(function(){var t=document.getElementById(r.slice(1));t&&window.scrollTo(window.scrollX,t.offsetTop)})},e.prototype._normalizePath=function(t){if("object"==typeof t){if(t.name){var e=t.params||{};return t.query&&(e.queryParams=t.query),this._recognizer.generate(t.name,e)}return t.path?t.path:""}return t+""}},t.exports=e["default"]},function(t,e,n){"use strict";var r=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var o=/^(component|subRoutes|name)$/,a=function i(t,e){var n=this;r(this,i);var a=e._recognizer.recognize(t);a&&([].forEach.call(a,function(t){for(var e in t.handler)o.test(e)||(n[e]=t.handler[e])}),this.query=a.queryParams,this.params=[].reduce.call(a,function(t,e){if(e.params)for(var n in e.params)t[n]=e.params[n];return t},{})),this.path=t,this.router=e,this._matched=a||e._notFoundHandler};e["default"]=a,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return"[object Object]"===Object.prototype.toString.call(t)}var o=n(11)["default"],a=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),s=n(15),u=function(){function t(e,n,r){a(this,t),this.router=e,this.to=n,this.from=r,this.next=null,this.aborted=!1,this.done=!1,this.deactivateQueue=e._views;var o=n._matched?Array.prototype.slice.call(n._matched):[];this.activateQueue=o.map(function(t){return t.handler})}return o(t,[{key:"abort",value:function(){if(!this.aborted){this.aborted=!0;var t=!this.from.path&&"/"===this.to.path;t||this.router.replace(this.from.path||"/")}}},{key:"redirect",value:function(t){this.aborted||(this.aborted=!0,"string"==typeof t?t=i.mapParams(t,this.to.params,this.to.query):(t.params=this.to.params,t.query=this.to.query),this.router.replace(t))}},{key:"start",value:function(t){var e=this,n=this.deactivateQueue,r=this.activateQueue,o=n.slice().reverse(),a=void 0,i=void 0;for(i=0;i<o.length&&s.canReuse(o[i],r[i],e);i++);i>0&&(a=o.slice(0,i),n=o.slice(i).reverse(),r=r.slice(i)),e.runQueue(n,s.canDeactivate,function(){e.runQueue(r,s.canActivate,function(){e.runQueue(n,s.deactivate,function(){if(e.router._onTransitionValidated(e),a&&a.forEach(function(t){s.reuse(t,e)}),n.length){var r=n[n.length-1],o=a?a.length:0;s.activate(r,e,o,t)}else t()})})})}},{key:"runQueue",value:function(t,e,n){function r(a){a>=t.length?n():e(t[a],o,function(){r(a+1)})}var o=this;r(0)}},{key:"callHook",value:function(t,e,n){var o=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],a=o.expectBoolean,s=void 0===a?!1:a,u=o.expectData,c=void 0===u?!1:u,h=o.cleanup,l=this,f=!1,d=function(t){h&&h(),l.abort(t)},p=function(t){if(h?v():d(),t&&!l.router._suppress)throw i.warn("Uncaught error during transition: "),t instanceof Error?t:new Error(t)},v=function(t){return f?void i.warn("transition.next() should be called only once."):(f=!0,void(n&&!l.aborted&&n(t,p)))},g={to:l.to,from:l.from,abort:d,next:v,redirect:function(){l.redirect.apply(l,arguments)}},m=void 0;try{m=t.call(e,g)}catch(y){return p(y)}var _=i.isPromise(m);s?"boolean"==typeof m?m?v():d():_&&m.then(function(t){t?v():d()},p):_?m.then(v,p):c&&r(m)&&v(m)}}]),t}();e["default"]=u,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(12)["default"];e["default"]=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),r(t,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),e.__esModule=!0},function(t,e,n){t.exports={"default":n(13),__esModule:!0}},function(t,e,n){var r=n(14);t.exports=function(t,e,n){return r.setDesc(t,e,n)}},function(t,e){var n=Object;t.exports={create:n.create,getProto:n.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:n.getOwnPropertyDescriptor,setDesc:n.defineProperty,setDescs:n.defineProperties,getKeys:n.keys,getNames:n.getOwnPropertyNames,getSymbols:n.getOwnPropertySymbols,each:[].forEach}},function(t,e,n){"use strict";function r(t,e,n){var r=t.childVM;if(!r||!e)return!1;if(t.Component!==e.component)return!1;var o=l.getRouteConfig(r,"canReuse");return"boolean"==typeof o?o:o?o.call(r,{to:n.to,from:n.from}):!0}function o(t,e,n){var r=t.childVM,o=l.getRouteConfig(r,"canDeactivate");o?e.callHook(o,r,n,{expectBoolean:!0}):n()}function a(t,e,n){l.resolveAsyncComponent(t,function(t){if(!e.aborted){var r=l.getRouteConfig(t,"canActivate");r?e.callHook(r,null,n,{expectBoolean:!0}):n()}})}function i(t,e,n){var r=t.childVM,o=l.getRouteConfig(r,"deactivate");o?e.callHook(o,r,n):n()}function s(t,n,r,o){var a=n.activateQueue[r];if(!a)return t._bound&&t.setComponent(null),void(o&&o());var i=t.Component=a.component,s=l.getRouteConfig(i,"activate"),u=l.getRouteConfig(i,"data"),h=l.getRouteConfig(i,"waitForData");t.depth=r,t.activated=!1,t.unbuild(!0);var f=t.build({_meta:{$loadingRouteData:!(!u||h)}}),d=function(){f.$destroy()},p=function(){var e=n.router;e._rendered||e._transitionOnLoad?t.transition(f):(t.setCurrent?t.setCurrent(f):t.childVM=f,f.$before(t.anchor,null,!1)),o&&o()},v=function(){t.activated=!0,t.childView&&e.activate(t.childView,n,r+1),u&&h?c(f,n,u,p,d):(u&&c(f,n,u),p())};s?n.callHook(s,f,v,{cleanup:d}):v()}function u(t,e){var n=t.childVM,r=l.getRouteConfig(n,"data");r&&c(n,e,r)}function c(t,e,n,r,o){t.$loadingRouteData=!0,e.callHook(n,t,function(e,n){var o=[];h(e).forEach(function(n){var r=e[n];l.isPromise(r)?o.push(r.then(function(e){t.$set(n,e)})):t.$set(n,r)}),o.length?o[0].constructor.all(o).then(function(e){t.$loadingRouteData=!1},n):t.$loadingRouteData=!1,r&&r(e)},{cleanup:o,expectData:!0})}var h=n(16)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.canReuse=r,e.canDeactivate=o,e.canActivate=a,e.deactivate=i,e.activate=s,e.reuse=u;var l=n(3)},function(t,e,n){t.exports={"default":n(17),__esModule:!0}},function(t,e,n){n(18),t.exports=n(24).Object.keys},function(t,e,n){var r=n(19);n(21)("keys",function(t){return function(e){return t(r(e))}})},function(t,e,n){var r=n(20);t.exports=function(t){return Object(r(t))}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){t.exports=function(t,e){var r=n(22),o=(n(24).Object||{})[t]||Object[t],a={};a[t]=e(o),r(r.S+r.F*n(25)(function(){o(1)}),"Object",a)}},function(t,e,n){var r=n(23),o=n(24),a="prototype",i=function(t,e){return function(){return t.apply(e,arguments)}},s=function(t,e,n){var u,c,h,l,f=t&s.G,d=t&s.P,p=f?r:t&s.S?r[e]:(r[e]||{})[a],v=f?o:o[e]||(o[e]={});f&&(n=e);for(u in n)c=!(t&s.F)&&p&&u in p,c&&u in v||(h=c?p[u]:n[u],f&&"function"!=typeof p[u]?l=n[u]:t&s.B&&c?l=i(h,r):t&s.W&&p[u]==h?!function(t){l=function(e){return this instanceof t?new t(e):t(e)},l[a]=t[a]}(h):l=d&&"function"==typeof h?i(Function.call,h):h,v[u]=l,d&&((v[a]||(v[a]={}))[u]=h))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,t.exports=s},function(t,e){var n="undefined",r=t.exports=typeof window!=n&&window.Math==Math?window:typeof self!=n&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,e){var n=t.exports={};"number"==typeof __e&&(__e=n)},function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),o=n(15);e["default"]=function(t){var e=t.util,n=t.directive("_component")||t.internalDirectives.component,a=e.extend({},n);e.extend(a,{_isRouterView:!0,bind:function(){var t=this.vm.$route;if(!t)return void r.warn("<router-view> can only be used inside a router-enabled app.");this._isDynamicLiteral=!0,n.bind.call(this),this.keepAlive&&(this.keepAlive=!1,r.warn("<router-view> does not support keep-alive.")),this.waitForEvent&&(this.waitForEvent=null,r.warn("<router-view> does not support wait-for. Use the acitvate route hook instead."));var e=this.router=t.router;e._views.unshift(this);var a=e._views[1];a&&(a.childView=this);var i=t.router._currentTransition;if(!a&&i.done||a&&a.activated){var s=a?a.depth+1:0;o.activate(this,i,s)}},unbind:function(){this.router._views.$remove(this),n.unbind.call(this)}}),t.elementDirective("router-view",a)},t.exports=e["default"]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),o=/[-.*+?^${}()|[\]\/\\]/g;e["default"]=function(t){function e(t){return t.protocol===location.protocol&&t.hostname===location.hostname&&t.port===location.port}var n=t.util;t.directive("link",{bind:function(){var t=this,o=this.vm;if(!o.$route)return void r.warn("v-link can only be used inside a router-enabled app.");var a=o.$route.router;this.handler=function(n){if(!(n.metaKey||n.ctrlKey||n.shiftKey||n.defaultPrevented||0!==n.button))if("A"===t.el.tagName)n.preventDefault(),null!=t.destination&&a.go(t.destination);else{for(var r=n.target;r&&"A"!==r.tagName&&r!==t.el;)r=r.parentNode;if(!r||"A"!==r.tagName||!r.href)return;e(r)&&(n.preventDefault(),a.go(r.pathname))}},this.el.addEventListener("click",this.handler),this.unwatch=o.$watch("$route.path",n.bind(this.updateClasses,this))},update:function(t){var e=this.vm.$route.router;t=e._normalizePath(t),this.destination=t,this.activeRE=t?new RegExp("^"+t.replace(o,"\\$&")+"\\b"):null,this.updateClasses(this.vm.$route.path);var n="/"===t.charAt(0),r="hash"===e.mode||n?e.history.formatPath(t):t;"A"===this.el.tagName&&(r?this.el.href=r:this.el.removeAttribute("href"))},updateClasses:function(t){var e=this.el,r=this.destination,o=this.vm.$route.router,a=o._linkActiveClass,i=a+"-exact";this.activeRE&&this.activeRE.test(t)&&"/"!==t?n.addClass(e,a):n.removeClass(e,a),t===r?n.addClass(e,i):n.removeClass(e,i)},unbind:function(){this.el.removeEventListener("click",this.handler),this.unwatch&&this.unwatch()}})},t.exports=e["default"]},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=function(t){var e=t.prototype.$addChild;t.prototype.$addChild=function(t,n){var r=this.$route,o=r&&r.router;if(o){t=t||{};var a=t._meta=t._meta||{};a.$route=r,t._isRouterView&&(a.$loadingRouteData=a.$loadingRouteData||!1)}var i=e.call(this,t,n);return o&&(o._children.push(i),i.$on("hook:beforeDestroy",function(){o._children.$remove(i)})),i}},t.exports=e["default"]},function(t,e,n){"use strict";var r=n(11)["default"],o=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),i=function(){function t(e){var n=e.onChange;o(this,t),this.onChange=n,this.currentPath="/"}return r(t,[{key:"start",value:function(){this.onChange("/")}},{key:"stop",value:function(){}},{key:"go",value:function(t){t=this.currentPath=this.formatPath(t),this.onChange(t)}},{key:"formatPath",value:function(t){return"/"===t.charAt(0)?t:a.resolvePath(this.currentPath,t)}}]),t}();e["default"]=i,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(11)["default"],o=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),i=function(){function t(e){var n=e.hashbang,r=e.onChange;o(this,t),this.hashbang=n,this.onChange=r}return r(t,[{key:"start",value:function(){var t=this;this.listener=function(){var e=location.hash,n=t.formatPath(e,!0);if(n!==e)return void location.replace(n);var r=decodeURI(e.replace(/^#!?/,"")+location.search);t.onChange(r)},window.addEventListener("hashchange",this.listener),this.listener()}},{key:"stop",value:function(){window.removeEventListener("hashchange",this.listener)}},{key:"go",value:function(t,e){t=this.formatPath(t),e?location.replace(t):location.hash=t}},{key:"formatPath",value:function(t,e){t=t.replace(/^#!?/,"");var n="/"===t.charAt(0);e&&!n&&(t="/"+t);var r="#"+(this.hashbang?"!":"");return n||e?r+t:r+a.resolvePath(location.hash.replace(/^#!?/,""),t)}}]),t}();e["default"]=i,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(11)["default"],o=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),i=/#.*$/,s=function(){function t(e){var n=e.root,r=e.onChange;o(this,t),n?("/"!==n.charAt(0)&&(n="/"+n),this.root=n.replace(/\/$/,""),this.rootRE=new RegExp("^\\"+this.root)):this.root=null,this.onChange=r;var a=document.querySelector("base");this.base=a&&a.getAttribute("href")}return r(t,[{key:"start",value:function(){var t=this;this.listener=function(e){var n=decodeURI(location.pathname+location.search);t.root&&(n=n.replace(t.rootRE,"")),t.onChange(n,e&&e.state,location.hash)},window.addEventListener("popstate",this.listener),this.listener()}},{key:"stop",value:function(){window.removeEventListener("popstate",this.listener)}},{key:"go",value:function(t,e){var n=this.root,r=this.formatPath(t,n);e?history.replaceState({},"",r):(history.replaceState({pos:{x:window.pageXOffset,y:window.pageYOffset}},""),history.pushState({},"",r));var o=t.match(i),a=o&&o[0];t=r.replace(i,"").replace(this.rootRE,""),this.onChange(t,null,a)}},{key:"formatPath",value:function(t){return"/"===t.charAt(0)?this.root?this.root+"/"+t.replace(/^\//,""):t:a.resolvePath(this.base||location.pathname,t)}}]),t}();e["default"]=s,t.exports=e["default"]}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VueRouter=e():t.VueRouter=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=n(1)["default"],o=n(2)["default"];Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),i=o(a),s=n(4),u=o(s),c=n(7),h=o(c),l=n(8),f=o(l),d=n(26),p=o(d),v=n(27),g=o(v),y=n(28),m=o(y),_=n(29),w=o(_),b=n(30),x=o(b),C=n(31),P=o(C),R={"abstract":w["default"],hash:x["default"],html5:P["default"]},k=function E(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],e=t.hashbang,n=void 0===e?!0:e,o=t["abstract"],a=void 0===o?!1:o,s=t.history,c=void 0===s?!1:s,h=t.saveScrollPosition,l=void 0===h?!1:h,f=t.transitionOnLoad,d=void 0===f?!1:f,p=t.suppressTransitionError,v=void 0===p?!1:p,g=t.root,y=void 0===g?null:g,m=t.linkActiveClass,_=void 0===m?"v-link-active":m;if(r(this,E),!E.installed)throw new Error("Please install the Router with Vue.use() before creating an instance.");this.app=null,this._views=[],this._children=[],this._recognizer=new u["default"],this._guardRecognizer=new u["default"],this._started=!1,this._currentRoute={},this._currentTransition=null,this._previousTransition=null,this._notFoundHandler=null,this._beforeEachHooks=[],this._afterEachHooks=[],this._hasPushState="undefined"!=typeof window&&window.history&&window.history.pushState,this._rendered=!1,this._transitionOnLoad=d,this._abstract=a,this._hashbang=n,this._history=this._hasPushState&&c,this._saveScrollPosition=l,this._linkActiveClass=_,this._suppress=v;var w=i["default"].Vue.util.inBrowser;this.mode=!w||this._abstract?"abstract":this._history?"html5":"hash";var b=R[this.mode],x=this;this.history=new b({root:y,hashbang:this._hashbang,onChange:function(t,e,n){x._match(t,e,n)}})};e["default"]=k,k.installed=!1,k.install=function(t){if(k.installed)return void a.warn("already installed.");h["default"](t,k),f["default"](t,k),p["default"](t),g["default"](t),m["default"](t),i["default"].Vue=t;var e=t.config.optionMergeStrategies;e&&(e.route=e.methods),k.installed=!0},"undefined"!=typeof window&&window.Vue&&window.Vue.use(k),t.exports=e["default"]},function(t,e){"use strict";e["default"]=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},e.__esModule=!0},function(t,e){"use strict";e["default"]=function(t){return t&&t.__esModule?t:{"default":t}},e.__esModule=!0},function(t,e,n){"use strict";function r(t,e){window.console&&(console.warn("[vue-router] "+t),e&&console.warn(e.stack))}function o(t,e){var n=t.match(/(\?.*)$/);if(n&&(n=n[1],t=t.slice(0,-n.length)),"?"===e.charAt(0))return t+e;var r=t.split("/");r.pop();for(var o=e.split("/"),a=0;a<o.length;a++){var i=o[a];"."!==i&&(".."===i?r.pop():r.push(i))}return""!==r[0]&&r.unshift(""),r.join("/")}function a(t){return t&&"function"==typeof t.then}function i(t,e){var n=t&&(t.$options||t.options);return n&&n.route&&n.route[e]}function s(t,e){v?v.$options.components._=t.component:v={resolve:p.Vue.prototype._resolveComponent,$options:{components:{_:t.component}}},v.resolve("_",function(n){t.component=n,e(n)})}function u(t,e,n){for(var r in e)t=c(t,e,r);return n&&(t+=d(n)),t}function c(t,e,n){var r=new RegExp(":"+n+"(\\/|$)"),o=e[n];return t.replace(r,function(t){return"/"===t.charAt(t.length-1)?o+"/":o})}var h=n(2)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.warn=r,e.resolvePath=o,e.isPromise=a,e.getRouteConfig=i,e.resolveAsyncComponent=s,e.mapParams=u;var l=n(4),f=h(l),d=f["default"].prototype.generateQueryString,p={};e["default"]=p;var v=void 0},function(t,e,n){var r;(function(t){(function(){"use strict";function o(t,e,n){this.path=t,this.matcher=e,this.delegate=n}function a(t){this.routes={},this.children={},this.target=t}function i(t,e,n){return function(r,a){var s=t+r;return a?void a(i(s,e,n)):new o(t+r,e,n)}}function s(t,e,n){for(var r=0,o=0,a=t.length;a>o;o++)r+=t[o].path.length;e=e.substr(r);var i={path:e,handler:n};t.push(i)}function u(t,e,n,r){var o=e.routes;for(var a in o)if(o.hasOwnProperty(a)){var i=t.slice();s(i,a,o[a]),e.children[a]?u(i,e.children[a],n,r):n.call(r,i)}}function c(t){return"[object Array]"===Object.prototype.toString.call(t)}function h(t){this.string=t}function l(t){this.name=t}function f(t){this.name=t}function d(){}function p(t,e,n){"/"===t.charAt(0)&&(t=t.substr(1));var r=t.split("/"),o=[];n.val="";for(var a=0,i=r.length;i>a;a++){var s,u=r[a];(s=u.match(/^:([^\/]+)$/))?(o.push(new l(s[1])),e.push(s[1]),n.val+="3"):(s=u.match(/^\*([^\/]+)$/))?(o.push(new f(s[1])),n.val+="2",e.push(s[1])):""===u?(o.push(new d),n.val+="1"):(o.push(new h(u)),n.val+="4")}return n.val=+n.val,o}function v(t){this.charSpec=t,this.nextStates=[]}function g(t){return t.sort(function(t,e){return e.specificity.val-t.specificity.val})}function y(t,e){for(var n=[],r=0,o=t.length;o>r;r++){var a=t[r];n=n.concat(a.match(e))}return n}function m(t){this.queryParams=t||{}}function _(t,e,n){for(var r=t.handlers,o=t.regex,a=e.match(o),i=1,s=new m(n),u=0,c=r.length;c>u;u++){for(var h=r[u],l=h.names,f={},d=0,p=l.length;p>d;d++)f[l[d]]=a[i++];s.push({handler:h.handler,params:f,isDynamic:!!l.length})}return s}function w(t,e){return e.eachChar(function(e){t=t.put(e)}),t}function b(t){return t=t.replace(/\+/gm,"%20"),decodeURIComponent(t)}o.prototype={to:function(t,e){var n=this.delegate;if(n&&n.willAddRoute&&(t=n.willAddRoute(this.matcher.target,t)),this.matcher.add(this.path,t),e){if(0===e.length)throw new Error("You must have an argument in the function passed to `to`");this.matcher.addChild(this.path,t,e,this.delegate)}return this}},a.prototype={add:function(t,e){this.routes[t]=e},addChild:function(t,e,n,r){var o=new a(e);this.children[t]=o;var s=i(t,o,r);r&&r.contextEntered&&r.contextEntered(e,s),n(s)}};var x=function(t,e){var n=new a;t(i("",n,this.delegate)),u([],n,function(t){e?e(this,t):this.add(t)},this)},C=["/",".","*","+","?","|","(",")","[","]","{","}","\\"],P=new RegExp("(\\"+C.join("|\\")+")","g");h.prototype={eachChar:function(t){for(var e,n=this.string,r=0,o=n.length;o>r;r++)e=n.charAt(r),t({validChars:e})},regex:function(){return this.string.replace(P,"\\$1")},generate:function(){return this.string}},l.prototype={eachChar:function(t){t({invalidChars:"/",repeat:!0})},regex:function(){return"([^/]+)"},generate:function(t){return t[this.name]}},f.prototype={eachChar:function(t){t({invalidChars:"",repeat:!0})},regex:function(){return"(.+)"},generate:function(t){return t[this.name]}},d.prototype={eachChar:function(){},regex:function(){return""},generate:function(){return""}},v.prototype={get:function(t){for(var e=this.nextStates,n=0,r=e.length;r>n;n++){var o=e[n],a=o.charSpec.validChars===t.validChars;if(a=a&&o.charSpec.invalidChars===t.invalidChars)return o}},put:function(t){var e;return(e=this.get(t))?e:(e=new v(t),this.nextStates.push(e),t.repeat&&e.nextStates.push(e),e)},match:function(t){for(var e,n,r,o=this.nextStates,a=[],i=0,s=o.length;s>i;i++)e=o[i],n=e.charSpec,"undefined"!=typeof(r=n.validChars)?-1!==r.indexOf(t)&&a.push(e):"undefined"!=typeof(r=n.invalidChars)&&-1===r.indexOf(t)&&a.push(e);return a}};var R=Object.create||function(t){function e(){}return e.prototype=t,new e};m.prototype=R({splice:Array.prototype.splice,slice:Array.prototype.slice,push:Array.prototype.push,length:0,queryParams:null});var k=function(){this.rootState=new v,this.names={}};k.prototype={add:function(t,e){for(var n,r=this.rootState,o="^",a={},i=[],s=[],u=!0,c=0,h=t.length;h>c;c++){var l=t[c],f=[],v=p(l.path,f,a);s=s.concat(v);for(var g=0,y=v.length;y>g;g++){var m=v[g];m instanceof d||(u=!1,r=r.put({validChars:"/"}),o+="/",r=w(r,m),o+=m.regex())}var _={handler:l.handler,names:f};i.push(_)}u&&(r=r.put({validChars:"/"}),o+="/"),r.handlers=i,r.regex=new RegExp(o+"$"),r.specificity=a,(n=e&&e.as)&&(this.names[n]={segments:s,handlers:i})},handlersFor:function(t){var e=this.names[t],n=[];if(!e)throw new Error("There is no route named "+t);for(var r=0,o=e.handlers.length;o>r;r++)n.push(e.handlers[r]);return n},hasRoute:function(t){return!!this.names[t]},generate:function(t,e){var n=this.names[t],r="";if(!n)throw new Error("There is no route named "+t);for(var o=n.segments,a=0,i=o.length;i>a;a++){var s=o[a];s instanceof d||(r+="/",r+=s.generate(e))}return"/"!==r.charAt(0)&&(r="/"+r),e&&e.queryParams&&(r+=this.generateQueryString(e.queryParams,n.handlers)),r},generateQueryString:function(t,e){var n=[],r=[];for(var o in t)t.hasOwnProperty(o)&&r.push(o);r.sort();for(var a=0,i=r.length;i>a;a++){o=r[a];var s=t[o];if(null!=s){var u=encodeURIComponent(o);if(c(s))for(var h=0,l=s.length;l>h;h++){var f=o+"[]="+encodeURIComponent(s[h]);n.push(f)}else u+="="+encodeURIComponent(s),n.push(u)}}return 0===n.length?"":"?"+n.join("&")},parseQueryString:function(t){for(var e=t.split("&"),n={},r=0;r<e.length;r++){var o,a=e[r].split("="),i=b(a[0]),s=i.length,u=!1;1===a.length?o="true":(s>2&&"[]"===i.slice(s-2)&&(u=!0,i=i.slice(0,s-2),n[i]||(n[i]=[])),o=a[1]?b(a[1]):""),u?n[i].push(o):n[i]=o}return n},recognize:function(t){var e,n,r,o,a=[this.rootState],i={},s=!1;if(o=t.indexOf("?"),-1!==o){var u=t.substr(o+1,t.length);t=t.substr(0,o),i=this.parseQueryString(u)}for(t=decodeURI(t),"/"!==t.charAt(0)&&(t="/"+t),e=t.length,e>1&&"/"===t.charAt(e-1)&&(t=t.substr(0,e-1),s=!0),n=0,r=t.length;r>n&&(a=y(a,t.charAt(n)),a.length);n++);var c=[];for(n=0,r=a.length;r>n;n++)a[n].handlers&&c.push(a[n]);a=g(c);var h=c[0];return h&&h.handlers?(s&&"(.+)$"===h.regex.source.slice(-5)&&(t+="/"),_(h,t,i)):void 0}},k.prototype.map=x,k.VERSION="0.1.9";var E=k;n(6).amd?(r=function(){return E}.call(e,n,e,t),!(void 0!==r&&(t.exports=r))):"undefined"!=typeof t&&t.exports?t.exports=E:"undefined"!=typeof this&&(this.RouteRecognizer=E)}).call(this)}).call(e,n(5)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){t.exports=function(){throw new Error("define cannot be used indirect")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3);e["default"]=function(t,e){e.prototype.map=function(t){for(var e in t)this.on(e,t[e])},e.prototype.on=function(t,e){"*"===t?this._notFound(e):this._addRoute(t,e,[])},e.prototype.redirect=function(t){for(var e in t)this._addRedirect(e,t[e])},e.prototype.alias=function(t){for(var e in t)this._addAlias(e,t[e])},e.prototype.beforeEach=function(t){this._beforeEachHooks.push(t)},e.prototype.afterEach=function(t){this._afterEachHooks.push(t)},e.prototype.go=function(t,e){t=this._normalizePath(t),this.history.go(t,e)},e.prototype.replace=function(t){this.go(t,!0)},e.prototype.start=function(e,n){if(this._started)return void r.warn("already started.");if(this._started=!0,!this.app){if(!e||!n)throw new Error("Must start vue-router with a component and a root container.");this._appContainer=n,this._appConstructor="function"==typeof e?e:t.extend(e)}this.history.start()},e.prototype.stop=function(){this.history.stop(),this._started=!1}},t.exports=e["default"]},function(t,e,n){"use strict";var r=n(2)["default"];Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),a=n(9),i=r(a),s=n(10),u=r(s);e["default"]=function(t,e){function n(e){var n=e.component;r.isPlainObject(n)&&(n=e.component=t.extend(n)),"function"!=typeof n&&(e.component=null,o.warn('invalid component for route "'+e.path+'"'))}var r=t.util;e.prototype._addRoute=function(t,e,r){if(n(e),r.push({path:t,handler:e}),this._recognizer.add(r,{as:e.name}),e.subRoutes)for(var o in e.subRoutes)this._addRoute(o,e.subRoutes[o],r.slice())},e.prototype._notFound=function(t){n(t),this._notFoundHandler=[{handler:t}]},e.prototype._addRedirect=function(t,e){this._addGuard(t,e,this.replace)},e.prototype._addAlias=function(t,e){this._addGuard(t,e,this._match)},e.prototype._addGuard=function(t,e,n){var r=this;this._guardRecognizer.add([{path:t,handler:function(t,a){var i=o.mapParams(e,t.params,a);n.call(r,i)}}])},e.prototype._checkGuard=function(t){var e=this._guardRecognizer.recognize(t);return e?(e[0].handler(e[0],e.queryParams),!0):void 0},e.prototype._match=function(t,e,n){var r=this;if(!this._checkGuard(t)){var o=this._currentRoute,a=this._currentTransition;if(!a||t!==o.path){var s=new i["default"](t,this),c=new u["default"](this,s,o);this._prevTransition=a,this._currentTransition=c,this.app||(this.app=new this._appConstructor({el:this._appContainer,_meta:{$route:s}}));var h=this._beforeEachHooks,l=function(){c.start(function(){r._postTransition(s,e,n)})};h.length?c.runQueue(h,function(t,e,n){c===r._currentTransition&&c.callHook(t,null,n,!0)},l):l(),this._rendered=!0}}},e.prototype._onTransitionValidated=function(t){var e=this._prevTransition;e&&(e.aborted=!0);var n=this._currentRoute=t.to;this.app.$route!==n&&(this.app.$route=n,this._children.forEach(function(t){t.$route=n})),this._afterEachHooks.length&&this._afterEachHooks.forEach(function(e){return e.call(null,{to:t.to,from:t.from})}),this._currentTransition.done=!0},e.prototype._postTransition=function(e,n,r){var o=n&&n.pos;o&&this._saveScrollPosition?t.nextTick(function(){window.scrollTo(o.x,o.y)}):r&&t.nextTick(function(){var t=document.getElementById(r.slice(1));t&&window.scrollTo(window.scrollX,t.offsetTop)})},e.prototype._normalizePath=function(t){if("object"==typeof t){if(t.name){var e=t.params||{};return t.query&&(e.queryParams=t.query),this._recognizer.generate(t.name,e)}return t.path?t.path:""}return t+""}},t.exports=e["default"]},function(t,e,n){"use strict";var r=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var o=/^(component|subRoutes)$/,a=function i(t,e){var n=this;r(this,i);var a=e._recognizer.recognize(t);a&&([].forEach.call(a,function(t){for(var e in t.handler)o.test(e)||(n[e]=t.handler[e])}),this.query=a.queryParams,this.params=[].reduce.call(a,function(t,e){if(e.params)for(var n in e.params)t[n]=e.params[n];return t},{})),this.path=t,this.router=e,this._matched=a||e._notFoundHandler};e["default"]=a,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return"[object Object]"===Object.prototype.toString.call(t)}var o=n(11)["default"],a=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),s=n(15),u=function(){function t(e,n,r){a(this,t),this.router=e,this.to=n,this.from=r,this.next=null,this.aborted=!1,this.done=!1,this.deactivateQueue=e._views;var o=n._matched?Array.prototype.slice.call(n._matched):[];this.activateQueue=o.map(function(t){return t.handler})}return o(t,[{key:"abort",value:function(){if(!this.aborted){this.aborted=!0;var t=!this.from.path&&"/"===this.to.path;t||this.router.replace(this.from.path||"/")}}},{key:"redirect",value:function(t){this.aborted||(this.aborted=!0,"string"==typeof t?t=i.mapParams(t,this.to.params,this.to.query):(t.params=this.to.params,t.query=this.to.query),this.router.replace(t))}},{key:"start",value:function(t){var e=this,n=this.deactivateQueue,r=this.activateQueue,o=n.slice().reverse(),a=void 0,i=void 0;for(i=0;i<o.length&&s.canReuse(o[i],r[i],e);i++);i>0&&(a=o.slice(0,i),n=o.slice(i).reverse(),r=r.slice(i)),e.runQueue(n,s.canDeactivate,function(){e.runQueue(r,s.canActivate,function(){e.runQueue(n,s.deactivate,function(){if(e.router._onTransitionValidated(e),a&&a.forEach(function(t){s.reuse(t,e)}),n.length){var r=n[n.length-1],o=a?a.length:0;s.activate(r,e,o,t)}else t()})})})}},{key:"runQueue",value:function(t,e,n){function r(a){a>=t.length?n():e(t[a],o,function(){r(a+1)})}var o=this;r(0)}},{key:"callHook",value:function(t,e,n){var o=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],a=o.expectBoolean,s=void 0===a?!1:a,u=o.expectData,c=void 0===u?!1:u,h=o.cleanup,l=this,f=!1,d=function(t){h&&h(),l.abort(t)},p=function(t){if(h?v():d(),t&&!l.router._suppress)throw i.warn("Uncaught error during transition: "),t instanceof Error?t:new Error(t)},v=function(t){return f?void i.warn("transition.next() should be called only once."):(f=!0,void(n&&!l.aborted&&n(t,p)))},g={to:l.to,from:l.from,abort:d,next:v,redirect:function(){l.redirect.apply(l,arguments)}},y=void 0;try{y=t.call(e,g)}catch(m){return p(m)}var _=i.isPromise(y);s?"boolean"==typeof y?y?v():d():_&&y.then(function(t){t?v():d()},p):_?y.then(v,p):c&&r(y)&&v(y)}}]),t}();e["default"]=u,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(12)["default"];e["default"]=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),r(t,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),e.__esModule=!0},function(t,e,n){t.exports={"default":n(13),__esModule:!0}},function(t,e,n){var r=n(14);t.exports=function(t,e,n){return r.setDesc(t,e,n)}},function(t,e){var n=Object;t.exports={create:n.create,getProto:n.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:n.getOwnPropertyDescriptor,setDesc:n.defineProperty,setDescs:n.defineProperties,getKeys:n.keys,getNames:n.getOwnPropertyNames,getSymbols:n.getOwnPropertySymbols,each:[].forEach}},function(t,e,n){"use strict";function r(t,e,n){var r=t.childVM;if(!r||!e)return!1;if(t.Component!==e.component)return!1;var o=l.getRouteConfig(r,"canReuse");return"boolean"==typeof o?o:o?o.call(r,{to:n.to,from:n.from}):!0}function o(t,e,n){var r=t.childVM,o=l.getRouteConfig(r,"canDeactivate");o?e.callHook(o,r,n,{expectBoolean:!0}):n()}function a(t,e,n){l.resolveAsyncComponent(t,function(t){if(!e.aborted){var r=l.getRouteConfig(t,"canActivate");r?e.callHook(r,null,n,{expectBoolean:!0}):n()}})}function i(t,e,n){var r=t.childVM,o=l.getRouteConfig(r,"deactivate");o?e.callHook(o,r,n):n()}function s(t,n,r,o){var a=n.activateQueue[r];if(!a)return t._bound&&t.setComponent(null),void(o&&o());var i=t.Component=a.component,s=l.getRouteConfig(i,"activate"),u=l.getRouteConfig(i,"data"),h=l.getRouteConfig(i,"waitForData");t.depth=r,t.activated=!1,t.unbuild(!0);var f=t.build({_meta:{$loadingRouteData:!(!u||h)}}),d=function(){f.$destroy()},p=function(){var e=n.router;e._rendered||e._transitionOnLoad?t.transition(f):(t.setCurrent?t.setCurrent(f):t.childVM=f,f.$before(t.anchor,null,!1)),o&&o()},v=function(){t.activated=!0,t.childView&&e.activate(t.childView,n,r+1),u&&h?c(f,n,u,p,d):(u&&c(f,n,u),p())};s?n.callHook(s,f,v,{cleanup:d}):v()}function u(t,e){var n=t.childVM,r=l.getRouteConfig(n,"data");r&&c(n,e,r)}function c(t,e,n,r,o){t.$loadingRouteData=!0,e.callHook(n,t,function(e,n){var o=[];h(e).forEach(function(n){var r=e[n];l.isPromise(r)?o.push(r.then(function(e){t.$set(n,e)})):t.$set(n,r)}),o.length?o[0].constructor.all(o).then(function(e){t.$loadingRouteData=!1},n):t.$loadingRouteData=!1,r&&r(e)},{cleanup:o,expectData:!0})}var h=n(16)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.canReuse=r,e.canDeactivate=o,e.canActivate=a,e.deactivate=i,e.activate=s,e.reuse=u;var l=n(3)},function(t,e,n){t.exports={"default":n(17),__esModule:!0}},function(t,e,n){n(18),t.exports=n(24).Object.keys},function(t,e,n){var r=n(19);n(21)("keys",function(t){return function(e){return t(r(e))}})},function(t,e,n){var r=n(20);t.exports=function(t){return Object(r(t))}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){t.exports=function(t,e){var r=n(22),o=(n(24).Object||{})[t]||Object[t],a={};a[t]=e(o),r(r.S+r.F*n(25)(function(){o(1)}),"Object",a)}},function(t,e,n){var r=n(23),o=n(24),a="prototype",i=function(t,e){return function(){return t.apply(e,arguments)}},s=function(t,e,n){var u,c,h,l,f=t&s.G,d=t&s.P,p=f?r:t&s.S?r[e]:(r[e]||{})[a],v=f?o:o[e]||(o[e]={});f&&(n=e);for(u in n)c=!(t&s.F)&&p&&u in p,c&&u in v||(h=c?p[u]:n[u],f&&"function"!=typeof p[u]?l=n[u]:t&s.B&&c?l=i(h,r):t&s.W&&p[u]==h?!function(t){l=function(e){return this instanceof t?new t(e):t(e)},l[a]=t[a]}(h):l=d&&"function"==typeof h?i(Function.call,h):h,v[u]=l,d&&((v[a]||(v[a]={}))[u]=h))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,t.exports=s},function(t,e){var n="undefined",r=t.exports=typeof window!=n&&window.Math==Math?window:typeof self!=n&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,e){var n=t.exports={};"number"==typeof __e&&(__e=n)},function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),o=n(15);e["default"]=function(t){var e=t.util,n=t.directive("_component")||t.internalDirectives.component,a=e.extend({},n);e.extend(a,{_isRouterView:!0,bind:function(){var t=this.vm.$route;if(!t)return void r.warn("<router-view> can only be used inside a router-enabled app.");this._isDynamicLiteral=!0,n.bind.call(this),this.keepAlive&&(this.keepAlive=!1,r.warn("<router-view> does not support keep-alive.")),this.waitForEvent&&(this.waitForEvent=null,r.warn("<router-view> does not support wait-for. Use the acitvate route hook instead."));var e=this.router=t.router;e._views.unshift(this);var a=e._views[1];a&&(a.childView=this);var i=t.router._currentTransition;if(!a&&i.done||a&&a.activated){var s=a?a.depth+1:0;o.activate(this,i,s)}},unbind:function(){this.router._views.$remove(this),n.unbind.call(this)}}),t.elementDirective("router-view",a)},t.exports=e["default"]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),o=/[-.*+?^${}()|[\]\/\\]/g;e["default"]=function(t){function e(t){return t.protocol===location.protocol&&t.hostname===location.hostname&&t.port===location.port}var n=t.util;t.directive("link",{bind:function(){var t=this,o=this.vm;if(!o.$route)return void r.warn("v-link can only be used inside a router-enabled app.");var a=o.$route.router;this.handler=function(n){if(!(n.metaKey||n.ctrlKey||n.shiftKey||n.defaultPrevented||0!==n.button))if("A"===t.el.tagName||n.target===t.el)n.preventDefault(),null!=t.destination&&a.go(t.destination,t.replace===!0);else{for(var r=n.target;r&&"A"!==r.tagName&&r!==t.el;)r=r.parentNode;if(!r||"A"!==r.tagName||!r.href)return;e(r)&&(n.preventDefault(),a.go(r.pathname))}},this.el.addEventListener("click",this.handler),this.unwatch=o.$watch("$route.path",n.bind(this.updateClasses,this))},update:function(t){var e=this.vm.$route.router;this.replace="object"==typeof t?t.replace:!1,t=e._normalizePath(t),this.destination=t,this.activeRE=t?new RegExp("^"+t.replace(o,"\\$&")+"\\b"):null,this.updateClasses(this.vm.$route.path);var n="/"===t.charAt(0),r="hash"===e.mode||n?e.history.formatPath(t):t;"A"===this.el.tagName&&(r?this.el.href=r:this.el.removeAttribute("href"))},updateClasses:function(t){var e=this.el,r=this.destination,o=this.vm.$route.router,a=o._linkActiveClass,i=a+"-exact";this.activeRE&&this.activeRE.test(t)&&"/"!==t?n.addClass(e,a):n.removeClass(e,a),t===r?n.addClass(e,i):n.removeClass(e,i)},unbind:function(){this.el.removeEventListener("click",this.handler),this.unwatch&&this.unwatch()}})},t.exports=e["default"]},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=function(t){var e=t.prototype.$addChild;t.prototype.$addChild=function(t,n){var r=this.$route,o=r&&r.router;if(o){t=t||{};var a=t._meta=t._meta||{};a.$route=r,t._isRouterView&&(a.$loadingRouteData=a.$loadingRouteData||!1)}var i=e.call(this,t,n);return o&&(o._children.push(i),i.$on("hook:beforeDestroy",function(){o._children.$remove(i)})),i}},t.exports=e["default"]},function(t,e,n){"use strict";var r=n(11)["default"],o=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),i=function(){function t(e){var n=e.onChange;o(this,t),this.onChange=n,this.currentPath="/"}return r(t,[{key:"start",value:function(){this.onChange("/")}},{key:"stop",value:function(){}},{key:"go",value:function(t){t=this.currentPath=this.formatPath(t),this.onChange(t)}},{key:"formatPath",value:function(t){return"/"===t.charAt(0)?t:a.resolvePath(this.currentPath,t)}}]),t}();e["default"]=i,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(11)["default"],o=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),i=function(){function t(e){var n=e.hashbang,r=e.onChange;o(this,t),this.hashbang=n,this.onChange=r}return r(t,[{key:"start",value:function(){var t=this;this.listener=function(){var e=location.hash,n=t.formatPath(e,!0);if(n!==e)return void location.replace(n);var r=decodeURI(e.replace(/^#!?/,"")+location.search);t.onChange(r)},window.addEventListener("hashchange",this.listener),this.listener()}},{key:"stop",value:function(){window.removeEventListener("hashchange",this.listener)}},{key:"go",value:function(t,e){t=this.formatPath(t),e?location.replace(t):location.hash=t}},{key:"formatPath",value:function(t,e){t=t.replace(/^#!?/,"");var n="/"===t.charAt(0);e&&!n&&(t="/"+t);var r="#"+(this.hashbang?"!":"");return n||e?r+t:r+a.resolvePath(location.hash.replace(/^#!?/,""),t)}}]),t}();e["default"]=i,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(11)["default"],o=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),i=/#.*$/,s=function(){function t(e){var n=e.root,r=e.onChange;o(this,t),n?("/"!==n.charAt(0)&&(n="/"+n),this.root=n.replace(/\/$/,""),this.rootRE=new RegExp("^\\"+this.root)):this.root=null,this.onChange=r;var a=document.querySelector("base");this.base=a&&a.getAttribute("href")}return r(t,[{key:"start",value:function(){var t=this;this.listener=function(e){var n=decodeURI(location.pathname+location.search);t.root&&(n=n.replace(t.rootRE,"")),t.onChange(n,e&&e.state,location.hash)},window.addEventListener("popstate",this.listener),this.listener()}},{key:"stop",value:function(){window.removeEventListener("popstate",this.listener)}},{key:"go",value:function(t,e){var n=this.root,r=this.formatPath(t,n);e?history.replaceState({},"",r):(history.replaceState({pos:{x:window.pageXOffset,y:window.pageYOffset}},""),history.pushState({},"",r));var o=t.match(i),a=o&&o[0];t=r.replace(i,"").replace(this.rootRE,""),this.onChange(t,null,a)}},{key:"formatPath",value:function(t){return"/"===t.charAt(0)?this.root?this.root+"/"+t.replace(/^\//,""):t:a.resolvePath(this.base||location.pathname,t)}}]),t}();e["default"]=s,t.exports=e["default"]}])});

@@ -38,7 +38,7 @@ 'use strict';

if (_this.el.tagName === 'A') {
if (_this.el.tagName === 'A' || e.target === _this.el) {
// v-link on <a v-link="'path'">
e.preventDefault();
if (_this.destination != null) {
router.go(_this.destination);
router.go(_this.destination, _this.replace === true);
}

@@ -65,2 +65,3 @@ } else {

var router = this.vm.$route.router;
this.replace = typeof path === 'object' ? path.replace : false;
path = router._normalizePath(path);

@@ -67,0 +68,0 @@ this.destination = path;

@@ -8,3 +8,3 @@ "use strict";

});
var internalKeysRE = /^(component|subRoutes|name)$/;
var internalKeysRE = /^(component|subRoutes)$/;

@@ -11,0 +11,0 @@ /**

{
"name": "vue-router",
"version": "0.6.1",
"version": "0.6.2",
"description": "A router for Vue.js",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is too big to display

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