File: /home/accemeff/vendor/craftcms/cms/lib/vue-router/vue-router.js
!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 m(t,e){if(!t)throw new Error("[vue-router] "+e)}function g(t,e){t||"undefined"!=typeof console&&console.warn("[vue-router] "+e)}function l(t){return-1<Object.prototype.toString.call(t).indexOf("Error")}var o={name:"router-view",functional:!0,props:{name:{type:String,default:"default"}},render:function(t,e){var r=e.props,n=e.children,o=e.parent,i=e.data;i.routerView=!0;for(var a=o.$createElement,u=r.name,s=o.$route,c=o._routerViewCache||(o._routerViewCache={}),p=0,f=!1;o&&o._routerRoot!==o;)o.$vnode&&o.$vnode.data.routerView&&p++,o._inactive&&(f=!0),o=o.$parent;if(i.routerViewDepth=p,f)return a(c[u],i,n);var h=s.matched[p];if(!h)return c[u]=null,a();var l=c[u]=h.components[u];i.registerRouteInstance=function(t,e){var r=h.instances[u];(e&&r!==t||!e&&r===t)&&(h.instances[u]=e)},(i.hook||(i.hook={})).prepatch=function(t,e){h.instances[u]=e.componentInstance};var d=i.props=function(t,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(t);case"boolean":return e?t.params:void 0;default:g(!1,'props in "'+t.path+'" is a '+typeof e+", expecting an object, function or boolean.")}}(s,h.props&&h.props[u]);if(d){d=i.props=function(t,e){for(var r in e)t[r]=e[r];return t}({},d);var v=i.attrs=i.attrs||{};for(var y in d)l.props&&y in l.props||(v[y]=d[y],delete d[y])}return a(l,i,n)}};var e=/[!'()*]/g,r=function(t){return"%"+t.charCodeAt(0).toString(16)},n=/%2C/g,i=function(t){return encodeURIComponent(t).replace(e,r).replace(n,",")},a=decodeURIComponent;function h(t){var o={};return(t=t.trim().replace(/^(\?|#|&)/,""))&&t.split("&").forEach(function(t){var e=t.replace(/\+/g," ").split("="),r=a(e.shift()),n=0<e.length?a(e.join("=")):null;void 0===o[r]?o[r]=n:Array.isArray(o[r])?o[r].push(n):o[r]=[o[r],n]}),o}function u(n){var t=n?Object.keys(n).map(function(e){var t=n[e];if(void 0===t)return"";if(null===t)return i(e);if(Array.isArray(t)){var r=[];return t.forEach(function(t){void 0!==t&&(null===t?r.push(i(e)):r.push(i(e)+"="+i(t)))}),r.join("&")}return i(e)+"="+i(t)}).filter(function(t){return 0<t.length}).join("&"):null;return t?"?"+t:""}var R=/\/?$/;function E(t,e,r,n){var o=n&&n.options.stringifyQuery,i=e.query||{};try{i=s(i)}catch(t){}var a={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:i,params:e.params||{},fullPath:p(e,o),matched:t?function(t){var e=[];for(;t;)e.unshift(t),t=t.parent;return e}(t):[]};return r&&(a.redirectedFrom=p(r,o)),Object.freeze(a)}function s(t){if(Array.isArray(t))return t.map(s);if(t&&"object"==typeof t){var e={};for(var r in t)e[r]=s(t[r]);return e}return t}var c=E(null,{path:"/"});function p(t,e){var r=t.path,n=t.query;void 0===n&&(n={});var o=t.hash;return void 0===o&&(o=""),(r||"/")+(e||u)(n)+o}function O(t,e){return e===c?t===e:!!e&&(t.path&&e.path?t.path.replace(R,"")===e.path.replace(R,"")&&t.hash===e.hash&&f(t.query,e.query):!(!t.name||!e.name)&&(t.name===e.name&&t.hash===e.hash&&f(t.query,e.query)&&f(t.params,e.params)))}function f(n,o){if(void 0===n&&(n={}),void 0===o&&(o={}),!n||!o)return n===o;var t=Object.keys(n),e=Object.keys(o);return t.length===e.length&&t.every(function(t){var e=n[t],r=o[t];return"object"==typeof e&&"object"==typeof r?f(e,r):String(e)===String(r)})}var j,t=[String,Object],d=[String,Array],v={name:"router-link",props:{to:{type:t,required:!0},tag:{type:String,default:"a"},exact:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,event:{type:d,default:"click"}},render:function(t){var e,r,n=this,o=this.$router,i=this.$route,a=o.resolve(this.to,i,this.append),u=a.location,s=a.route,c=a.href,p={},f=o.options.linkActiveClass,h=o.options.linkExactActiveClass,l=null==f?"router-link-active":f,d=null==h?"router-link-exact-active":h,v=null==this.activeClass?l:this.activeClass,y=null==this.exactActiveClass?d:this.exactActiveClass,m=u.path?E(null,u,null,o):s;p[y]=O(i,m),p[v]=this.exact?p[y]:(r=m,0===(e=i).path.replace(R,"/").indexOf(r.path.replace(R,"/"))&&(!r.hash||e.hash===r.hash)&&function(t,e){for(var r in e)if(!(r in t))return!1;return!0}(e.query,r.query));var g=function(t){C(t)&&(n.replace?o.replace(u):o.push(u))},b={click:C};Array.isArray(this.event)?this.event.forEach(function(t){b[t]=g}):b[this.event]=g;var w={class:p};if("a"===this.tag)w.on=b,w.attrs={href:c};else{var x=function t(e){if(e)for(var r,n=0;n<e.length;n++){if("a"===(r=e[n]).tag)return r;if(r.children&&(r=t(r.children)))return r}}(this.$slots.default);if(x){x.isStatic=!1;var k=j.util.extend;(x.data=k({},x.data)).on=b,(x.data.attrs=k({},x.data.attrs)).href=c}else w.on=b}return t(this.tag,w,this.$slots.default)}};function C(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||t.defaultPrevented||void 0!==t.button&&0!==t.button)){if(t.currentTarget&&t.currentTarget.getAttribute){var e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function y(t){if(!y.installed||j!==t){y.installed=!0;var n=function(t){return void 0!==t},e=function(t,e){var r=t.$options._parentVnode;n(r)&&n(r=r.data)&&n(r=r.registerRouteInstance)&&r(t,e)};(j=t).mixin({beforeCreate:function(){n(this.$options.router)?((this._routerRoot=this)._router=this.$options.router,this._router.init(this),t.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,e(this,this)},destroyed:function(){e(this)}}),Object.defineProperty(t.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(t.prototype,"$route",{get:function(){return this._routerRoot._route}}),t.component("router-view",o),t.component("router-link",v);var r=t.config.optionMergeStrategies;r.beforeRouteEnter=r.beforeRouteLeave=r.beforeRouteUpdate=r.created}}var b="undefined"!=typeof window;function w(t,e,r){var n=t.charAt(0);if("/"===n)return t;if("?"===n||"#"===n)return e+t;var o=e.split("/");r&&o[o.length-1]||o.pop();for(var i=t.replace(/^\//,"").split("/"),a=0;a<i.length;a++){var u=i[a];".."===u?o.pop():"."!==u&&o.push(u)}return""!==o[0]&&o.unshift(""),o.join("/")}function x(t){return t.replace(/\/\//g,"/")}var k=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},A=I,_=L,S=function(t,e){return U(L(t,e))},T=U,$=H,q=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function L(t,e){for(var r,n,o=[],i=0,a=0,u="",s=e&&e.delimiter||"/";null!=(r=q.exec(t));){var c=r[0],p=r[1],f=r.index;if(u+=t.slice(a,f),a=f+c.length,p)u+=p[1];else{var h=t[a],l=r[2],d=r[3],v=r[4],y=r[5],m=r[6],g=r[7];u&&(o.push(u),u="");var b=null!=l&&null!=h&&h!==l,w="+"===m||"*"===m,x="?"===m||"*"===m,k=r[2]||s,R=v||y;o.push({name:d||i++,prefix:l||"",delimiter:k,optional:x,repeat:w,partial:b,asterisk:!!g,pattern:R?(n=R,n.replace(/([=!:$\/()])/g,"\\$1")):g?".*":"[^"+M(k)+"]+?"})}}return a<t.length&&(u+=t.substr(a)),u&&o.push(u),o}function P(t){return encodeURI(t).replace(/[\/?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function U(p){for(var f=new Array(p.length),t=0;t<p.length;t++)"object"==typeof p[t]&&(f[t]=new RegExp("^(?:"+p[t].pattern+")$"));return function(t,e){for(var r="",n=t||{},o=(e||{}).pretty?P:encodeURIComponent,i=0;i<p.length;i++){var a=p[i];if("string"!=typeof a){var u,s=n[a.name];if(null==s){if(a.optional){a.partial&&(r+=a.prefix);continue}throw new TypeError('Expected "'+a.name+'" to be defined')}if(k(s)){if(!a.repeat)throw new TypeError('Expected "'+a.name+'" to not repeat, but received `'+JSON.stringify(s)+"`");if(0===s.length){if(a.optional)continue;throw new TypeError('Expected "'+a.name+'" to not be empty')}for(var c=0;c<s.length;c++){if(u=o(s[c]),!f[i].test(u))throw new TypeError('Expected all "'+a.name+'" to match "'+a.pattern+'", but received `'+JSON.stringify(u)+"`");r+=(0===c?a.prefix:a.delimiter)+u}}else{if(u=a.asterisk?encodeURI(s).replace(/[?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}):o(s),!f[i].test(u))throw new TypeError('Expected "'+a.name+'" to match "'+a.pattern+'", but received "'+u+'"');r+=a.prefix+u}}else r+=a}return r}}function M(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function V(t,e){return t.keys=e,t}function B(t){return t.sensitive?"":"i"}function H(t,e,r){k(e)||(r=e||r,e=[]);for(var n=(r=r||{}).strict,o=!1!==r.end,i="",a=0;a<t.length;a++){var u=t[a];if("string"==typeof u)i+=M(u);else{var s=M(u.prefix),c="(?:"+u.pattern+")";e.push(u),u.repeat&&(c+="(?:"+s+c+")*"),i+=c=u.optional?u.partial?s+"("+c+")?":"(?:"+s+"("+c+"))?":s+"("+c+")"}}var p=M(r.delimiter||"/"),f=i.slice(-p.length)===p;return n||(i=(f?i.slice(0,-p.length):i)+"(?:"+p+"(?=$))?"),i+=o?"$":n&&f?"":"(?="+p+"|$)",V(new RegExp("^"+i,B(r)),e)}function I(t,e,r){return k(e)||(r=e||r,e=[]),r=r||{},t instanceof RegExp?function(t,e){var r=t.source.match(/\((?!\?)/g);if(r)for(var n=0;n<r.length;n++)e.push({name:n,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return V(t,e)}(t,e):k(t)?function(t,e,r){for(var n=[],o=0;o<t.length;o++)n.push(I(t[o],e,r).source);return V(new RegExp("(?:"+n.join("|")+")",B(r)),e)}(t,e,r):(n=e,H(L(t,o=r),n,o));var n,o}A.parse=_,A.compile=S,A.tokensToFunction=T,A.tokensToRegExp=$;var z=Object.create(null);function D(t,e,r){try{return(z[t]||(z[t]=A.compile(t)))(e||{},{pretty:!0})}catch(t){return g(!1,"missing param for "+r+": "+t.message),""}}function F(t,e,r,n){var o=e||[],i=r||Object.create(null),a=n||Object.create(null);t.forEach(function(t){!function r(n,o,i,a,u,s){var t=a.path;var e=a.name;m(null!=t,'"path" is required in a route configuration.'),m("string"!=typeof a.component,'route config "component" for path: '+String(t||e)+" cannot be a string id. Use an actual component instead.");var c=a.pathToRegexpOptions||{};var p=J(t,u,c.strict);"boolean"==typeof a.caseSensitive&&(c.sensitive=a.caseSensitive);var f={path:p,regex:N(p,c),components:a.components||{default:a.component},instances:{},name:e,parent:u,matchAs:s,redirect:a.redirect,beforeEnter:a.beforeEnter,meta:a.meta||{},props:null==a.props?{}:a.components?a.props:{default:a.props}};a.children&&(a.name&&!a.redirect&&a.children.some(function(t){return/^\/?$/.test(t.path)})&&g(!1,"Named Route '"+a.name+"' has a default child route. When navigating to this named route (:to=\"{name: '"+a.name+"'\"), the default child route will not be rendered. Remove the name from this route and use the name of the default child route for named links instead."),a.children.forEach(function(t){var e=s?x(s+"/"+t.path):void 0;r(n,o,i,t,f,e)}));if(void 0!==a.alias){var h=Array.isArray(a.alias)?a.alias:[a.alias];h.forEach(function(t){var e={path:t,children:a.children};r(n,o,i,e,u,f.path||"/")})}o[f.path]||(n.push(f.path),o[f.path]=f);e&&(i[e]?s||g(!1,'Duplicate named routes definition: { name: "'+e+'", path: "'+f.path+'" }'):i[e]=f)}(o,i,a,t)});for(var u=0,s=o.length;u<s;u++)"*"===o[u]&&(o.push(o.splice(u,1)[0]),s--,u--);return{pathList:o,pathMap:i,nameMap:a}}function N(e,t){var r=A(e,[],t),n=Object.create(null);return r.keys.forEach(function(t){g(!n[t.name],'Duplicate param keys in route with path: "'+e+'"'),n[t.name]=!0}),r}function J(t,e,r){return r||(t=t.replace(/\/$/,"")),"/"===t[0]?t:null==e?t:x(e.path+"/"+t)}function K(t,e,r,n){var o="string"==typeof t?{path:t}:t;if(o.name||o._normalized)return o;if(!o.path&&o.params&&e){(o=Q({},o))._normalized=!0;var i=Q(Q({},e.params),o.params);if(e.name)o.name=e.name,o.params=i;else if(e.matched.length){var a=e.matched[e.matched.length-1].path;o.path=D(a,i,"path "+e.path)}else g(!1,"relative params navigation requires a current route.");return o}var u=function(t){var e="",r="",n=t.indexOf("#");0<=n&&(e=t.slice(n),t=t.slice(0,n));var o=t.indexOf("?");return 0<=o&&(r=t.slice(o+1),t=t.slice(0,o)),{path:t,query:r,hash:e}}(o.path||""),s=e&&e.path||"/",c=u.path?w(u.path,s,r||o.append):s,p=function(t,e,r){void 0===e&&(e={});var n,o=r||h;try{n=o(t||"")}catch(t){g(!1,t.message),n={}}for(var i in e)n[i]=e[i];return n}(u.query,o.query,n&&n.options.parseQuery),f=o.hash||u.hash;return f&&"#"!==f.charAt(0)&&(f="#"+f),{_normalized:!0,path:c,query:p,hash:f}}function Q(t,e){for(var r in e)t[r]=e[r];return t}function W(t,h){var e=F(t),f=e.pathList,l=e.pathMap,d=e.nameMap;function v(t,e,r){var n=K(t,e,!1,h),o=n.name;if(o){var i=d[o];if(g(i,"Route with name '"+o+"' does not exist"),!i)return y(null,n);var a=i.regex.keys.filter(function(t){return!t.optional}).map(function(t){return t.name});if("object"!=typeof n.params&&(n.params={}),e&&"object"==typeof e.params)for(var u in e.params)!(u in n.params)&&-1<a.indexOf(u)&&(n.params[u]=e.params[u]);if(i)return n.path=D(i.path,n.params,'named route "'+o+'"'),y(i,n,r)}else if(n.path){n.params={};for(var s=0;s<f.length;s++){var c=f[s],p=l[c];if(X(p.regex,n.path,n.params))return y(p,n,r)}}return y(null,n)}function n(t,e){var r=t.redirect,n="function"==typeof r?r(E(t,e,null,h)):r;if("string"==typeof n&&(n={path:n}),!n||"object"!=typeof n)return g(!1,"invalid redirect option: "+JSON.stringify(n)),y(null,e);var o,i=n,a=i.name,u=i.path,s=e.query,c=e.hash,p=e.params;if(s=i.hasOwnProperty("query")?i.query:s,c=i.hasOwnProperty("hash")?i.hash:c,p=i.hasOwnProperty("params")?i.params:p,a)return m(d[a],'redirect failed: named route "'+a+'" not found.'),v({_normalized:!0,name:a,query:s,hash:c,params:p},void 0,e);if(u){var f=w(u,(o=t).parent?o.parent.path:"/",!0);return v({_normalized:!0,path:D(f,p,'redirect route with path "'+f+'"'),query:s,hash:c},void 0,e)}return g(!1,"invalid redirect option: "+JSON.stringify(n)),y(null,e)}function y(t,e,r){return t&&t.redirect?n(t,r||e):t&&t.matchAs?function(t,e,r){var n=v({_normalized:!0,path:D(r,e.params,'aliased route with path "'+r+'"')});if(n){var o=n.matched,i=o[o.length-1];return e.params=n.params,y(i,e)}return y(null,e)}(0,e,t.matchAs):E(t,e,r,h)}return{match:v,addRoutes:function(t){F(t,f,l,d)}}}function X(t,e,r){var n=e.match(t);if(!n)return!1;if(!r)return!0;for(var o=1,i=n.length;o<i;++o){var a=t.keys[o-1],u="string"==typeof n[o]?decodeURIComponent(n[o]):n[o];a&&(r[a.name]=u)}return!0}var Y=Object.create(null);function G(){window.history.replaceState({key:pt()},""),window.addEventListener("popstate",function(t){var e;tt(),t.state&&t.state.key&&(e=t.state.key,st=e)})}function Z(t,r,n,o){if(t.app){var i=t.options.scrollBehavior;i&&(m("function"==typeof i,"scrollBehavior must be a function"),t.app.$nextTick(function(){var e=function(){var t=pt();if(t)return Y[t]}(),t=i(r,n,o?e:null);t&&("function"==typeof t.then?t.then(function(t){ot(t,e)}).catch(function(t){m(!1,t.toString())}):ot(t,e))}))}}function tt(){var t=pt();t&&(Y[t]={x:window.pageXOffset,y:window.pageYOffset})}function et(t){return nt(t.x)||nt(t.y)}function rt(t){return{x:nt(t.x)?t.x:window.pageXOffset,y:nt(t.y)?t.y:window.pageYOffset}}function nt(t){return"number"==typeof t}function ot(t,e){var r,n,o,i,a,u="object"==typeof t;if(u&&"string"==typeof t.selector){var s=document.querySelector(t.selector);if(s){var c=t.offset&&"object"==typeof t.offset?t.offset:{};c={x:nt((a=c).x)?a.x:0,y:nt(a.y)?a.y:0},r=s,n=c,o=document.documentElement.getBoundingClientRect(),e={x:(i=r.getBoundingClientRect()).left-o.left-n.x,y:i.top-o.top-n.y}}else et(t)&&(e=rt(t))}else u&&et(t)&&(e=rt(t));e&&window.scrollTo(e.x,e.y)}var it,at=b&&((-1===(it=window.navigator.userAgent).indexOf("Android 2.")&&-1===it.indexOf("Android 4.0")||-1===it.indexOf("Mobile Safari")||-1!==it.indexOf("Chrome")||-1!==it.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history),ut=b&&window.performance&&window.performance.now?window.performance:Date,st=ct();function ct(){return ut.now().toFixed(3)}function pt(){return st}function ft(e,r){tt();var t=window.history;try{r?t.replaceState({key:st},"",e):(st=ct(),t.pushState({key:st},"",e))}catch(t){window.location[r?"replace":"assign"](e)}}function ht(t){ft(t,!0)}function lt(e,r,n){var o=function(t){t>=e.length?n():e[t]?r(e[t],function(){o(t+1)}):o(t+1)};o(0)}function dt(r){return function(t,e,s){var c=!1,p=0,f=null;vt(r,function(r,t,n,o){if("function"==typeof r&&void 0===r.cid){c=!0,p++;var e,i=gt(function(t){var e;((e=t).__esModule||mt&&"Module"===e[Symbol.toStringTag])&&(t=t.default),r.resolved="function"==typeof t?t:j.extend(t),n.components[o]=t,--p<=0&&s()}),a=gt(function(t){var e="Failed to resolve async component "+o+": "+t;g(!1,e),f||(f=l(t)?t:new Error(e),s(f))});try{e=r(i,a)}catch(t){a(t)}if(e)if("function"==typeof e.then)e.then(i,a);else{var u=e.component;u&&"function"==typeof u.then&&u.then(i,a)}}}),c||s()}}function vt(t,r){return yt(t.map(function(e){return Object.keys(e.components).map(function(t){return r(e.components[t],e.instances[t],e,t)})}))}function yt(t){return Array.prototype.concat.apply([],t)}var mt="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function gt(r){var n=!1;return function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];if(!n)return n=!0,r.apply(this,t)}}var bt=function(t,e){this.router=t,this.base=function(t){if(!t)if(b){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";"/"!==t.charAt(0)&&(t="/"+t);return t.replace(/\/$/,"")}(e),this.current=c,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[]};function wt(t,i,a,e){var r=vt(t,function(t,e,r,n){var o=function(t,e){"function"!=typeof t&&(t=j.extend(t));return t.options[e]}(t,i);if(o)return Array.isArray(o)?o.map(function(t){return a(t,e,r,n)}):a(o,e,r,n)});return yt(e?r.reverse():r)}function xt(t,e){if(e)return function(){return t.apply(e,arguments)}}bt.prototype.listen=function(t){this.cb=t},bt.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},bt.prototype.onError=function(t){this.errorCbs.push(t)},bt.prototype.transitionTo=function(t,e,r){var n=this,o=this.router.match(t,this.current);this.confirmTransition(o,function(){n.updateRoute(o),e&&e(o),n.ensureURL(),n.ready||(n.ready=!0,n.readyCbs.forEach(function(t){t(o)}))},function(e){r&&r(e),e&&!n.ready&&(n.ready=!0,n.readyErrorCbs.forEach(function(t){t(e)}))})},bt.prototype.confirmTransition=function(r,e,t){var n=this,o=this.current,i=function(e){l(e)&&(n.errorCbs.length?n.errorCbs.forEach(function(t){t(e)}):(g(!1,"uncaught error during route navigation:"),console.error(e))),t&&t(e)};if(O(r,o)&&r.matched.length===o.matched.length)return this.ensureURL(),i();var a=function(t,e){var r,n=Math.max(t.length,e.length);for(r=0;r<n&&t[r]===e[r];r++);return{updated:e.slice(0,r),activated:e.slice(r),deactivated:t.slice(r)}}(this.current.matched,r.matched),u=a.updated,s=a.deactivated,f=a.activated,c=[].concat(wt(s,"beforeRouteLeave",xt,!0),this.router.beforeHooks,wt(u,"beforeRouteUpdate",xt),f.map(function(t){return t.beforeEnter}),dt(f));this.pending=r;var h=function(t,e){if(n.pending!==r)return i();try{t(r,o,function(t){!1===t||l(t)?(n.ensureURL(!0),i(t)):"string"==typeof t||"object"==typeof t&&("string"==typeof t.path||"string"==typeof t.name)?(i(),"object"==typeof t&&t.replace?n.replace(t):n.push(t)):e(t)})}catch(t){i(t)}};lt(c,h,function(){var c,p,t=[];lt((c=t,p=function(){return n.current===r},wt(f,"beforeRouteEnter",function(t,e,r,n){return o=t,i=r,a=n,u=c,s=p,function(t,e,r){return o(t,e,function(t){r(t),"function"==typeof t&&u.push(function(){!function t(e,r,n,o){r[n]?e(r[n]):o()&&setTimeout(function(){t(e,r,n,o)},16)}(t,i.instances,a,s)})})};var o,i,a,u,s})).concat(n.router.resolveHooks),h,function(){if(n.pending!==r)return i();n.pending=null,e(r),n.router.app&&n.router.app.$nextTick(function(){t.forEach(function(t){t()})})})})},bt.prototype.updateRoute=function(e){var r=this.current;this.current=e,this.cb&&this.cb(e),this.router.afterHooks.forEach(function(t){t&&t(e,r)})};var kt=function(e){function t(n,t){var o=this;e.call(this,n,t);var i=n.options.scrollBehavior;i&&G();var a=Rt(this.base);window.addEventListener("popstate",function(t){var e=o.current,r=Rt(o.base);o.current===c&&r===a||o.transitionTo(r,function(t){i&&Z(n,t,e,!0)})})}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.go=function(t){window.history.go(t)},t.prototype.push=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,function(t){ft(x(n.base+t.fullPath)),Z(n.router,t,o,!1),e&&e(t)},r)},t.prototype.replace=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,function(t){ht(x(n.base+t.fullPath)),Z(n.router,t,o,!1),e&&e(t)},r)},t.prototype.ensureURL=function(t){if(Rt(this.base)!==this.current.fullPath){var e=x(this.base+this.current.fullPath);t?ft(e):ht(e)}},t.prototype.getCurrentLocation=function(){return Rt(this.base)},t}(bt);function Rt(t){var e=window.location.pathname;return t&&0===e.indexOf(t)&&(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var Et=function(n){function t(t,e,r){n.call(this,t,e),r&&function(t){var e=Rt(t);if(!/^\/#/.test(e))return window.location.replace(x(t+"/#"+e)),!0}(this.base)||Ot()}return n&&(t.__proto__=n),((t.prototype=Object.create(n&&n.prototype)).constructor=t).prototype.setupListeners=function(){var r=this,t=this.router.options.scrollBehavior,n=at&&t;n&&G(),window.addEventListener(at?"popstate":"hashchange",function(){var e=r.current;Ot()&&r.transitionTo(jt(),function(t){n&&Z(r.router,t,e,!0),at||_t(t.fullPath)})})},t.prototype.push=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,function(t){At(t.fullPath),Z(n.router,t,o,!1),e&&e(t)},r)},t.prototype.replace=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,function(t){_t(t.fullPath),Z(n.router,t,o,!1),e&&e(t)},r)},t.prototype.go=function(t){window.history.go(t)},t.prototype.ensureURL=function(t){var e=this.current.fullPath;jt()!==e&&(t?At(e):_t(e))},t.prototype.getCurrentLocation=function(){return jt()},t}(bt);function Ot(){var t=jt();return"/"===t.charAt(0)||(_t("/"+t),!1)}function jt(){var t=window.location.href,e=t.indexOf("#");return-1===e?"":t.slice(e+1)}function Ct(t){var e=window.location.href,r=e.indexOf("#");return(0<=r?e.slice(0,r):e)+"#"+t}function At(t){at?ft(Ct(t)):window.location.hash=t}function _t(t){at?ht(Ct(t)):window.location.replace(Ct(t))}var St=function(r){function t(t,e){r.call(this,t,e),this.stack=[],this.index=-1}return r&&(t.__proto__=r),((t.prototype=Object.create(r&&r.prototype)).constructor=t).prototype.push=function(t,e,r){var n=this;this.transitionTo(t,function(t){n.stack=n.stack.slice(0,n.index+1).concat(t),n.index++,e&&e(t)},r)},t.prototype.replace=function(t,e,r){var n=this;this.transitionTo(t,function(t){n.stack=n.stack.slice(0,n.index).concat(t),e&&e(t)},r)},t.prototype.go=function(t){var e=this,r=this.index+t;if(!(r<0||r>=this.stack.length)){var n=this.stack[r];this.confirmTransition(n,function(){e.index=r,e.updateRoute(n)})}},t.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},t.prototype.ensureURL=function(){},t}(bt),Tt=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=W(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!at&&!1!==t.fallback,this.fallback&&(e="hash"),b||(e="abstract"),this.mode=e){case"history":this.history=new kt(this,t.base);break;case"hash":this.history=new Et(this,t.base,this.fallback);break;case"abstract":this.history=new St(this,t.base);break;default:m(!1,"invalid mode: "+e)}},$t={currentRoute:{configurable:!0}};function qt(e,r){return e.push(r),function(){var t=e.indexOf(r);-1<t&&e.splice(t,1)}}return Tt.prototype.match=function(t,e,r){return this.matcher.match(t,e,r)},$t.currentRoute.get=function(){return this.history&&this.history.current},Tt.prototype.init=function(t){var r=this;if(m(y.installed,"not installed. Make sure to call `Vue.use(VueRouter)` before creating root instance."),this.apps.push(t),!this.app){this.app=t;var e=this.history;if(e instanceof kt)e.transitionTo(e.getCurrentLocation());else if(e instanceof Et){var n=function(){e.setupListeners()};e.transitionTo(e.getCurrentLocation(),n,n)}e.listen(function(e){r.apps.forEach(function(t){t._route=e})})}},Tt.prototype.beforeEach=function(t){return qt(this.beforeHooks,t)},Tt.prototype.beforeResolve=function(t){return qt(this.resolveHooks,t)},Tt.prototype.afterEach=function(t){return qt(this.afterHooks,t)},Tt.prototype.onReady=function(t,e){this.history.onReady(t,e)},Tt.prototype.onError=function(t){this.history.onError(t)},Tt.prototype.push=function(t,e,r){this.history.push(t,e,r)},Tt.prototype.replace=function(t,e,r){this.history.replace(t,e,r)},Tt.prototype.go=function(t){this.history.go(t)},Tt.prototype.back=function(){this.go(-1)},Tt.prototype.forward=function(){this.go(1)},Tt.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map(function(e){return Object.keys(e.components).map(function(t){return e.components[t]})})):[]},Tt.prototype.resolve=function(t,e,r){var n,o,i,a,u=K(t,e||this.history.current,r,this),s=this.match(u,e),c=s.redirectedFrom||s.fullPath,p=this.history.base;return{location:u,route:s,href:(n=p,o=c,i=this.mode,a="hash"===i?"#"+o:o,n?x(n+"/"+a):a),normalizedTo:u,resolved:s}},Tt.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==c&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Tt.prototype,$t),Tt.install=y,Tt.version="3.0.1",b&&window.Vue&&window.Vue.use(Tt),Tt});
//# sourceMappingURL=vue-router.js.map