kdu-router 3.4.0-beta.0 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +11 -9
  3. package/dist/composables.js +253 -0
  4. package/dist/composables.mjs +244 -0
  5. package/dist/kdu-router.common.js +2682 -2572
  6. package/dist/kdu-router.esm.browser.js +2677 -2563
  7. package/dist/kdu-router.esm.browser.min.js +5 -5
  8. package/dist/kdu-router.esm.js +2685 -2572
  9. package/dist/kdu-router.js +2682 -2573
  10. package/dist/kdu-router.min.js +5 -5
  11. package/ketur/attributes.json +38 -38
  12. package/ketur/tags.json +20 -20
  13. package/package.json +115 -111
  14. package/src/components/link.js +224 -197
  15. package/src/components/view.js +155 -149
  16. package/src/composables/globals.js +34 -0
  17. package/src/composables/guards.js +68 -0
  18. package/src/composables/index.js +3 -0
  19. package/src/composables/useLink.js +113 -0
  20. package/src/composables/utils.js +11 -0
  21. package/src/create-matcher.js +226 -200
  22. package/src/create-route-map.js +220 -205
  23. package/src/entries/cjs.js +3 -0
  24. package/src/entries/esm.js +12 -0
  25. package/src/history/abstract.js +72 -68
  26. package/src/history/base.js +379 -400
  27. package/src/history/hash.js +152 -163
  28. package/src/history/html5.js +99 -94
  29. package/src/index.js +3 -277
  30. package/src/install.js +52 -52
  31. package/src/router.js +293 -0
  32. package/src/util/async.js +18 -18
  33. package/src/util/dom.js +3 -3
  34. package/src/util/errors.js +86 -85
  35. package/src/util/location.js +69 -69
  36. package/src/util/misc.js +6 -6
  37. package/src/util/params.js +37 -37
  38. package/src/util/path.js +74 -74
  39. package/src/util/push-state.js +46 -46
  40. package/src/util/query.js +113 -96
  41. package/src/util/resolve-components.js +109 -109
  42. package/src/util/route.js +151 -132
  43. package/src/util/scroll.js +175 -165
  44. package/src/util/state-key.js +22 -22
  45. package/src/util/warn.js +14 -14
  46. package/types/composables.d.ts +53 -0
  47. package/types/index.d.ts +25 -17
  48. package/types/kdu.d.ts +22 -22
  49. package/types/router.d.ts +564 -170
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * kdu-router v3.4.0-beta.0
3
- * (c) 2022 NKDuy
2
+ * kdu-router v3.6.0
3
+ * (c) 2026 NKDuy
4
4
  * @license MIT
5
5
  */
6
6
  /*!
7
- * kdu-router v3.4.0-beta.0
8
- * (c) 2022 NKDuy
7
+ * kdu-router v3.6.0
8
+ * (c) 2026 NKDuy
9
9
  * @license MIT
10
10
  */
11
- var t,e;t=this,e=function(){"use strict";function t(t,e){for(var r in e)t[r]=e[r];return t}var e={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render:function(e,n){var o=n.props,i=n.children,a=n.parent,s=n.data;s.routerView=!0;for(var u=a.$createElement,c=o.name,p=a.$route,f=a._routerViewCache||(a._routerViewCache={}),h=0,l=!1;a&&a._routerRoot!==a;){var d=a.$knode?a.$knode.data:{};d.routerView&&h++,d.keepAlive&&a._directInactive&&a._inactive&&(l=!0),a=a.$parent}if(s.routerViewDepth=h,l){var v=f[c],y=v&&v.component;return y?(v.configProps&&r(y,s,v.route,v.configProps),u(y,s,i)):u()}var m=p.matched[h],g=m&&m.components[c];if(!m||!g)return f[c]=null,u();f[c]={component:g},s.registerRouteInstance=function(t,e){var r=m.instances[c];(e&&r!==t||!e&&r===t)&&(m.instances[c]=e)},(s.hook||(s.hook={})).prepatch=function(t,e){m.instances[c]=e.componentInstance},s.hook.init=function(t){t.data.keepAlive&&t.componentInstance&&t.componentInstance!==m.instances[c]&&(m.instances[c]=t.componentInstance)};var w=m.props&&m.props[c];return w&&(t(f[c],{route:p,configProps:w}),r(g,s,p,w)),u(g,s,i)}};function r(e,r,n,o){var i=r.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}}(n,o);if(i){i=r.props=t({},i);var a=r.attrs=r.attrs||{};for(var s in i)e.props&&s in e.props||(a[s]=i[s],delete i[s])}}var n=/[!'()*]/g,o=function(t){return"%"+t.charCodeAt(0).toString(16)},i=/%2C/g,a=function(t){return encodeURIComponent(t).replace(n,o).replace(i,",")},s=decodeURIComponent;function u(t){var e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach((function(t){var r=t.replace(/\+/g," ").split("="),n=s(r.shift()),o=r.length>0?s(r.join("=")):null;void 0===e[n]?e[n]=o:Array.isArray(e[n])?e[n].push(o):e[n]=[e[n],o]})),e):e}function c(t){var e=t?Object.keys(t).map((function(e){var r=t[e];if(void 0===r)return"";if(null===r)return a(e);if(Array.isArray(r)){var n=[];return r.forEach((function(t){void 0!==t&&(null===t?n.push(a(e)):n.push(a(e)+"="+a(t)))})),n.join("&")}return a(e)+"="+a(r)})).filter((function(t){return t.length>0})).join("&"):null;return e?"?"+e:""}var p=/\/?$/;function f(t,e,r,n){var o=n&&n.options.stringifyQuery,i=e.query||{};try{i=h(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:v(e,o),matched:t?d(t):[]};return r&&(a.redirectedFrom=v(r,o)),Object.freeze(a)}function h(t){if(Array.isArray(t))return t.map(h);if(t&&"object"==typeof t){var e={};for(var r in t)e[r]=h(t[r]);return e}return t}var l=f(null,{path:"/"});function d(t){for(var e=[];t;)e.unshift(t),t=t.parent;return e}function v(t,e){var r=t.path,n=t.query;void 0===n&&(n={});var o=t.hash;return void 0===o&&(o=""),(r||"/")+(e||c)(n)+o}function y(t,e){return e===l?t===e:!!e&&(t.path&&e.path?t.path.replace(p,"")===e.path.replace(p,"")&&t.hash===e.hash&&m(t.query,e.query):!(!t.name||!e.name)&&t.name===e.name&&t.hash===e.hash&&m(t.query,e.query)&&m(t.params,e.params))}function m(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),!t||!e)return t===e;var r=Object.keys(t),n=Object.keys(e);return r.length===n.length&&r.every((function(r){var n=t[r],o=e[r];return"object"==typeof n&&"object"==typeof o?m(n,o):String(n)===String(o)}))}function g(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 s=i[a];".."===s?o.pop():"."!==s&&o.push(s)}return""!==o[0]&&o.unshift(""),o.join("/")}function w(t){return t.replace(/\/\//g,"/")}var b=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},x=q,R=C,k=function(t,e){return j(C(t,e),e)},E=j,A=T,O=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function C(t,e){for(var r,n=[],o=0,i=0,a="",s=e&&e.delimiter||"/";null!=(r=O.exec(t));){var u=r[0],c=r[1],p=r.index;if(a+=t.slice(i,p),i=p+u.length,c)a+=c[1];else{var f=t[i],h=r[2],l=r[3],d=r[4],v=r[5],y=r[6],m=r[7];a&&(n.push(a),a="");var g=null!=h&&null!=f&&f!==h,w="+"===y||"*"===y,b="?"===y||"*"===y,x=r[2]||s,R=d||v;n.push({name:l||o++,prefix:h||"",delimiter:x,optional:b,repeat:w,partial:g,asterisk:!!m,pattern:R?L(R):m?".*":"[^"+S(x)+"]+?"})}}return i<t.length&&(a+=t.substr(i)),a&&n.push(a),n}function _(t){return encodeURI(t).replace(/[\/?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}))}function j(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)"object"==typeof t[n]&&(r[n]=new RegExp("^(?:"+t[n].pattern+")$",P(e)));return function(e,n){for(var o="",i=e||{},a=(n||{}).pretty?_:encodeURIComponent,s=0;s<t.length;s++){var u=t[s];if("string"!=typeof u){var c,p=i[u.name];if(null==p){if(u.optional){u.partial&&(o+=u.prefix);continue}throw new TypeError('Expected "'+u.name+'" to be defined')}if(b(p)){if(!u.repeat)throw new TypeError('Expected "'+u.name+'" to not repeat, but received `'+JSON.stringify(p)+"`");if(0===p.length){if(u.optional)continue;throw new TypeError('Expected "'+u.name+'" to not be empty')}for(var f=0;f<p.length;f++){if(c=a(p[f]),!r[s].test(c))throw new TypeError('Expected all "'+u.name+'" to match "'+u.pattern+'", but received `'+JSON.stringify(c)+"`");o+=(0===f?u.prefix:u.delimiter)+c}}else{if(c=u.asterisk?encodeURI(p).replace(/[?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})):a(p),!r[s].test(c))throw new TypeError('Expected "'+u.name+'" to match "'+u.pattern+'", but received "'+c+'"');o+=u.prefix+c}}else o+=u}return o}}function S(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function L(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function $(t,e){return t.keys=e,t}function P(t){return t&&t.sensitive?"":"i"}function T(t,e,r){b(e)||(r=e||r,e=[]);for(var n=(r=r||{}).strict,o=!1!==r.end,i="",a=0;a<t.length;a++){var s=t[a];if("string"==typeof s)i+=S(s);else{var u=S(s.prefix),c="(?:"+s.pattern+")";e.push(s),s.repeat&&(c+="(?:"+u+c+")*"),i+=c=s.optional?s.partial?u+"("+c+")?":"(?:"+u+"("+c+"))?":u+"("+c+")"}}var p=S(r.delimiter||"/"),f=i.slice(-p.length)===p;return n||(i=(f?i.slice(0,-p.length):i)+"(?:"+p+"(?=$))?"),i+=o?"$":n&&f?"":"(?="+p+"|$)",$(new RegExp("^"+i,P(r)),e)}function q(t,e,r){return b(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 $(t,e)}(t,e):b(t)?function(t,e,r){for(var n=[],o=0;o<t.length;o++)n.push(q(t[o],e,r).source);return $(new RegExp("(?:"+n.join("|")+")",P(r)),e)}(t,e,r):function(t,e,r){return T(C(t,r),e,r)}(t,e,r)}x.parse=R,x.compile=k,x.tokensToFunction=E,x.tokensToRegExp=A;var U=Object.create(null);function I(t,e,r){e=e||{};try{var n=U[t]||(U[t]=x.compile(t));return"string"==typeof e.pathMatch&&(e[0]=e.pathMatch),n(e,{pretty:!0})}catch(t){return""}finally{delete e[0]}}function M(e,r,n,o){var i="string"==typeof e?{path:e}:e;if(i._normalized)return i;if(i.name){var a=(i=t({},e)).params;return a&&"object"==typeof a&&(i.params=t({},a)),i}if(!i.path&&i.params&&r){(i=t({},i))._normalized=!0;var s=t(t({},r.params),i.params);if(r.name)i.name=r.name,i.params=s;else if(r.matched.length){var c=r.matched[r.matched.length-1].path;i.path=I(c,s,r.path)}return i}var p=function(t){var e="",r="",n=t.indexOf("#");n>=0&&(e=t.slice(n),t=t.slice(0,n));var o=t.indexOf("?");return o>=0&&(r=t.slice(o+1),t=t.slice(0,o)),{path:t,query:r,hash:e}}(i.path||""),f=r&&r.path||"/",h=p.path?g(p.path,f,n||i.append):f,l=function(t,e,r){void 0===e&&(e={});var n,o=r||u;try{n=o(t||"")}catch(t){n={}}for(var i in e){var a=e[i];n[i]=Array.isArray(a)?a.map((function(t){return""+t})):""+a}return n}(p.query,i.query,o&&o.options.parseQuery),d=i.hash||p.hash;return d&&"#"!==d.charAt(0)&&(d="#"+d),{_normalized:!0,path:h,query:l,hash:d}}var B,F=function(){},H={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},exact:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render:function(e){var r=this,n=this.$router,o=this.$route,i=n.resolve(this.to,o,this.append),a=i.location,s=i.route,u=i.href,c={},h=n.options.linkActiveClass,l=n.options.linkExactActiveClass,d=null==h?"router-link-active":h,v=null==l?"router-link-exact-active":l,m=null==this.activeClass?d:this.activeClass,g=null==this.exactActiveClass?v:this.exactActiveClass,w=s.redirectedFrom?f(null,M(s.redirectedFrom),null,n):s;c[g]=y(o,w),c[m]=this.exact?c[g]:function(t,e){return 0===t.path.replace(p,"/").indexOf(e.path.replace(p,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var r in e)if(!(r in t))return!1;return!0}(t.query,e.query)}(o,w);var b=c[g]?this.ariaCurrentValue:null,x=function(t){N(t)&&(r.replace?n.replace(a,F):n.push(a,F))},R={click:N};Array.isArray(this.event)?this.event.forEach((function(t){R[t]=x})):R[this.event]=x;var k={class:c},E=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:u,route:s,navigate:x,isActive:c[m],isExactActive:c[g]});if(E){if(1===E.length)return E[0];if(E.length>1||!E.length)return 0===E.length?e():e("span",{},E)}if("a"===this.tag)k.on=R,k.attrs={href:u,"aria-current":b};else{var A=function t(e){var r;if(e)for(var 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(A){A.isStatic=!1;var O=A.data=t({},A.data);for(var C in O.on=O.on||{},O.on){var _=O.on[C];C in R&&(O.on[C]=Array.isArray(_)?_:[_])}for(var j in R)j in O.on?O.on[j].push(R[j]):O.on[j]=x;var S=A.data.attrs=t({},A.data.attrs);S.href=u,S["aria-current"]=b}else k.on=R}return e(this.tag,k,this.$slots.default)}};function N(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}}var V="undefined"!=typeof window;function z(t,e,r,n){var o=e||[],i=r||Object.create(null),a=n||Object.create(null);t.forEach((function(t){!function t(e,r,n,o,i,a){var s=o.path,u=o.name,c=o.pathToRegexpOptions||{},p=function(t,e,r){return r||(t=t.replace(/\/$/,"")),"/"===t[0]||null==e?t:w(e.path+"/"+t)}(s,i,c.strict);"boolean"==typeof o.caseSensitive&&(c.sensitive=o.caseSensitive);var f={path:p,regex:K(p,c),components:o.components||{default:o.component},instances:{},name:u,parent:i,matchAs:a,redirect:o.redirect,beforeEnter:o.beforeEnter,meta:o.meta||{},props:null==o.props?{}:o.components?o.props:{default:o.props}};if(o.children&&o.children.forEach((function(o){var i=a?w(a+"/"+o.path):void 0;t(e,r,n,o,f,i)})),r[f.path]||(e.push(f.path),r[f.path]=f),void 0!==o.alias)for(var h=Array.isArray(o.alias)?o.alias:[o.alias],l=0;l<h.length;++l){var d={path:h[l],children:o.children};t(e,r,n,d,i,f.path||"/")}u&&(n[u]||(n[u]=f))}(o,i,a,t)}));for(var s=0,u=o.length;s<u;s++)"*"===o[s]&&(o.push(o.splice(s,1)[0]),u--,s--);return{pathList:o,pathMap:i,nameMap:a}}function K(t,e){return x(t,[],e)}function D(t,e){var r=z(t),n=r.pathList,o=r.pathMap,i=r.nameMap;function a(t,r,a){var s=M(t,r,!1,e),c=s.name;if(c){var p=i[c];if(!p)return u(null,s);var f=p.regex.keys.filter((function(t){return!t.optional})).map((function(t){return t.name}));if("object"!=typeof s.params&&(s.params={}),r&&"object"==typeof r.params)for(var h in r.params)!(h in s.params)&&f.indexOf(h)>-1&&(s.params[h]=r.params[h]);return s.path=I(p.path,s.params),u(p,s,a)}if(s.path){s.params={};for(var l=0;l<n.length;l++){var d=n[l],v=o[d];if(J(v.regex,s.path,s.params))return u(v,s,a)}}return u(null,s)}function s(t,r){var n=t.redirect,o="function"==typeof n?n(f(t,r,null,e)):n;if("string"==typeof o&&(o={path:o}),!o||"object"!=typeof o)return u(null,r);var s=o,c=s.name,p=s.path,h=r.query,l=r.hash,d=r.params;return h=s.hasOwnProperty("query")?s.query:h,l=s.hasOwnProperty("hash")?s.hash:l,d=s.hasOwnProperty("params")?s.params:d,c?(i[c],a({_normalized:!0,name:c,query:h,hash:l,params:d},void 0,r)):p?a({_normalized:!0,path:I(function(t,e){return g(t,e.parent?e.parent.path:"/",!0)}(p,t),d),query:h,hash:l},void 0,r):u(null,r)}function u(t,r,n){return t&&t.redirect?s(t,n||r):t&&t.matchAs?function(t,e,r){var n=a({_normalized:!0,path:I(r,e.params)});if(n){var o=n.matched,i=o[o.length-1];return e.params=n.params,u(i,e)}return u(null,e)}(0,r,t.matchAs):f(t,r,n,e)}return{match:a,addRoutes:function(t){z(t,n,o,i)}}}function J(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],s="string"==typeof n[o]?decodeURIComponent(n[o]):n[o];a&&(r[a.name||"pathMatch"]=s)}return!0}var Q=V&&window.performance&&window.performance.now?window.performance:Date;function X(){return Q.now().toFixed(3)}var Y=X();function W(){return Y}function G(t){return Y=t}var Z=Object.create(null);function tt(){"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual");var e=window.location.protocol+"//"+window.location.host,r=window.location.href.replace(e,""),n=t({},window.history.state);return n.key=W(),window.history.replaceState(n,"",r),window.addEventListener("popstate",nt),function(){window.removeEventListener("popstate",nt)}}function et(t,e,r,n){if(t.app){var o=t.options.scrollBehavior;o&&t.app.$nextTick((function(){var i=function(){var t=W();if(t)return Z[t]}(),a=o.call(t,e,r,n?i:null);a&&("function"==typeof a.then?a.then((function(t){ut(t,i)})).catch((function(t){})):ut(a,i))}))}}function rt(){var t=W();t&&(Z[t]={x:window.pageXOffset,y:window.pageYOffset})}function nt(t){rt(),t.state&&t.state.key&&G(t.state.key)}function ot(t){return at(t.x)||at(t.y)}function it(t){return{x:at(t.x)?t.x:window.pageXOffset,y:at(t.y)?t.y:window.pageYOffset}}function at(t){return"number"==typeof t}var st=/^#\d/;function ut(t,e){var r,n="object"==typeof t;if(n&&"string"==typeof t.selector){var o=st.test(t.selector)?document.getElementById(t.selector.slice(1)):document.querySelector(t.selector);if(o){var i=t.offset&&"object"==typeof t.offset?t.offset:{};e=function(t,e){var r=document.documentElement.getBoundingClientRect(),n=t.getBoundingClientRect();return{x:n.left-r.left-e.x,y:n.top-r.top-e.y}}(o,i={x:at((r=i).x)?r.x:0,y:at(r.y)?r.y:0})}else ot(t)&&(e=it(t))}else n&&ot(t)&&(e=it(t));e&&window.scrollTo(e.x,e.y)}var ct,pt=V&&(-1===(ct=window.navigator.userAgent).indexOf("Android 2.")&&-1===ct.indexOf("Android 4.0")||-1===ct.indexOf("Mobile Safari")||-1!==ct.indexOf("Chrome")||-1!==ct.indexOf("Windows Phone"))&&window.history&&"function"==typeof window.history.pushState;function ft(e,r){rt();var n=window.history;try{if(r){var o=t({},n.state);o.key=W(),n.replaceState(o,"",e)}else n.pushState({key:G(X())},"",e)}catch(t){window.location[r?"replace":"assign"](e)}}function ht(t){ft(t,!0)}function lt(t,e,r){var n=function(o){o>=t.length?r():t[o]?e(t[o],(function(){n(o+1)})):n(o+1)};n(0)}var dt={redirected:2,aborted:4,cancelled:8,duplicated:16};function vt(t,e){return mt(t,e,dt.redirected,'Redirected when going from "'+t.fullPath+'" to "'+function(t){if("string"==typeof t)return t;if("path"in t)return t.path;var e={};return gt.forEach((function(r){r in t&&(e[r]=t[r])})),JSON.stringify(e,null,2)}(e)+'" via a navigation guard.')}function yt(t,e){return mt(t,e,dt.cancelled,'Navigation cancelled from "'+t.fullPath+'" to "'+e.fullPath+'" with a new navigation.')}function mt(t,e,r,n){var o=new Error(n);return o._isRouter=!0,o.from=t,o.to=e,o.type=r,o}var gt=["params","query","hash"];function wt(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}function bt(t,e){return wt(t)&&t._isRouter&&(null==e||t.type===e)}function xt(t){return function(e,r,n){var o=!1,i=0,a=null;Rt(t,(function(t,e,r,s){if("function"==typeof t&&void 0===t.cid){o=!0,i++;var u,c=At((function(e){var o;((o=e).__esModule||Et&&"Module"===o[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:B.extend(e),r.components[s]=e,--i<=0&&n()})),p=At((function(t){var e="Failed to resolve async component "+s+": "+t;a||(a=wt(t)?t:new Error(e),n(a))}));try{u=t(c,p)}catch(t){p(t)}if(u)if("function"==typeof u.then)u.then(c,p);else{var f=u.component;f&&"function"==typeof f.then&&f.then(c,p)}}})),o||n()}}function Rt(t,e){return kt(t.map((function(t){return Object.keys(t.components).map((function(r){return e(t.components[r],t.instances[r],t,r)}))})))}function kt(t){return Array.prototype.concat.apply([],t)}var Et="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function At(t){var e=!1;return function(){for(var r=[],n=arguments.length;n--;)r[n]=arguments[n];if(!e)return e=!0,t.apply(this,r)}}var Ot=function(t,e){this.router=t,this.base=function(t){if(!t)if(V){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";return"/"!==t.charAt(0)&&(t="/"+t),t.replace(/\/$/,"")}(e),this.current=l,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function Ct(t,e,r,n){var o=Rt(t,(function(t,n,o,i){var a=function(t,e){return"function"!=typeof t&&(t=B.extend(t)),t.options[e]}(t,e);if(a)return Array.isArray(a)?a.map((function(t){return r(t,n,o,i)})):r(a,n,o,i)}));return kt(n?o.reverse():o)}function _t(t,e){if(e)return function(){return t.apply(e,arguments)}}Ot.prototype.listen=function(t){this.cb=t},Ot.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},Ot.prototype.onError=function(t){this.errorCbs.push(t)},Ot.prototype.transitionTo=function(t,e,r){var n,o=this;try{n=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach((function(e){e(t)})),t}this.confirmTransition(n,(function(){var t=o.current;o.updateRoute(n),e&&e(n),o.ensureURL(),o.router.afterHooks.forEach((function(e){e&&e(n,t)})),o.ready||(o.ready=!0,o.readyCbs.forEach((function(t){t(n)})))}),(function(t){r&&r(t),t&&!o.ready&&(o.ready=!0,bt(t,dt.redirected)?o.readyCbs.forEach((function(t){t(n)})):o.readyErrorCbs.forEach((function(e){e(t)})))}))},Ot.prototype.confirmTransition=function(t,e,r){var n,o,i=this,a=this.current,s=function(t){!bt(t)&&wt(t)&&(i.errorCbs.length?i.errorCbs.forEach((function(e){e(t)})):console.error(t)),r&&r(t)},u=t.matched.length-1,c=a.matched.length-1;if(y(t,a)&&u===c&&t.matched[u]===a.matched[c])return this.ensureURL(),s(((o=mt(n=a,t,dt.duplicated,'Avoided redundant navigation to current location: "'+n.fullPath+'".')).name="NavigationDuplicated",o));var p=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,t.matched),f=p.updated,h=p.deactivated,l=p.activated,d=[].concat(function(t){return Ct(t,"beforeRouteLeave",_t,!0)}(h),this.router.beforeHooks,function(t){return Ct(t,"beforeRouteUpdate",_t)}(f),l.map((function(t){return t.beforeEnter})),xt(l));this.pending=t;var v=function(e,r){if(i.pending!==t)return s(yt(a,t));try{e(t,a,(function(e){!1===e?(i.ensureURL(!0),s(function(t,e){return mt(t,e,dt.aborted,'Navigation aborted from "'+t.fullPath+'" to "'+e.fullPath+'" via a navigation guard.')}(a,t))):wt(e)?(i.ensureURL(!0),s(e)):"string"==typeof e||"object"==typeof e&&("string"==typeof e.path||"string"==typeof e.name)?(s(vt(a,t)),"object"==typeof e&&e.replace?i.replace(e):i.push(e)):r(e)}))}catch(t){s(t)}};lt(d,v,(function(){var r=[];lt(function(t,e,r){return Ct(t,"beforeRouteEnter",(function(t,n,o,i){return function(t,e,r,n,o){return function(i,a,s){return t(i,a,(function(t){"function"==typeof t&&n.push((function(){!function t(e,r,n,o){r[n]&&!r[n]._isBeingDestroyed?e(r[n]):o()&&setTimeout((function(){t(e,r,n,o)}),16)}(t,e.instances,r,o)})),s(t)}))}}(t,o,i,e,r)}))}(l,r,(function(){return i.current===t})).concat(i.router.resolveHooks),v,(function(){if(i.pending!==t)return s(yt(a,t));i.pending=null,e(t),i.router.app&&i.router.app.$nextTick((function(){r.forEach((function(t){t()}))}))}))}))},Ot.prototype.updateRoute=function(t){this.current=t,this.cb&&this.cb(t)},Ot.prototype.setupListeners=function(){},Ot.prototype.teardownListeners=function(){this.listeners.forEach((function(t){t()})),this.listeners=[]};var jt=function(t){function e(e,r){t.call(this,e,r),this._startLocation=St(this.base)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router,r=e.options.scrollBehavior,n=pt&&r;n&&this.listeners.push(tt());var o=function(){var r=t.current,o=St(t.base);t.current===l&&o===t._startLocation||t.transitionTo(o,(function(t){n&&et(e,t,r,!0)}))};window.addEventListener("popstate",o),this.listeners.push((function(){window.removeEventListener("popstate",o)}))}},e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){ft(w(n.base+t.fullPath)),et(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.replace=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){ht(w(n.base+t.fullPath)),et(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.ensureURL=function(t){if(St(this.base)!==this.current.fullPath){var e=w(this.base+this.current.fullPath);t?ft(e):ht(e)}},e.prototype.getCurrentLocation=function(){return St(this.base)},e}(Ot);function St(t){var e=decodeURI(window.location.pathname);return t&&0===e.toLowerCase().indexOf(t.toLowerCase())&&(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var Lt=function(t){function e(e,r,n){t.call(this,e,r),n&&function(t){var e=St(t);if(!/^\/#/.test(e))return window.location.replace(w(t+"/#"+e)),!0}(this.base)||$t()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router.options.scrollBehavior,r=pt&&e;r&&this.listeners.push(tt());var n=function(){var e=t.current;$t()&&t.transitionTo(Pt(),(function(n){r&&et(t.router,n,e,!0),pt||Ut(n.fullPath)}))},o=pt?"popstate":"hashchange";window.addEventListener(o,n),this.listeners.push((function(){window.removeEventListener(o,n)}))}},e.prototype.push=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){qt(t.fullPath),et(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.replace=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){Ut(t.fullPath),et(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;Pt()!==e&&(t?qt(e):Ut(e))},e.prototype.getCurrentLocation=function(){return Pt()},e}(Ot);function $t(){var t=Pt();return"/"===t.charAt(0)||(Ut("/"+t),!1)}function Pt(){var t=window.location.href,e=t.indexOf("#");if(e<0)return"";var r=(t=t.slice(e+1)).indexOf("?");if(r<0){var n=t.indexOf("#");t=n>-1?decodeURI(t.slice(0,n))+t.slice(n):decodeURI(t)}else t=decodeURI(t.slice(0,r))+t.slice(r);return t}function Tt(t){var e=window.location.href,r=e.indexOf("#");return(r>=0?e.slice(0,r):e)+"#"+t}function qt(t){pt?ft(Tt(t)):window.location.hash=t}function Ut(t){pt?ht(Tt(t)):window.location.replace(Tt(t))}var It=function(t){function e(e,r){t.call(this,e,r),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,r){var n=this;this.transitionTo(t,(function(t){n.stack=n.stack.slice(0,n.index+1).concat(t),n.index++,e&&e(t)}),r)},e.prototype.replace=function(t,e,r){var n=this;this.transitionTo(t,(function(t){n.stack=n.stack.slice(0,n.index).concat(t),e&&e(t)}),r)},e.prototype.go=function(t){var e=this,r=this.index+t;if(!(r<0||r>=this.stack.length)){var n=this.stack[r];this.confirmTransition(n,(function(){e.index=r,e.updateRoute(n)}),(function(t){bt(t,dt.duplicated)&&(e.index=r)}))}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(Ot),Mt=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=D(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!pt&&!1!==t.fallback,this.fallback&&(e="hash"),V||(e="abstract"),this.mode=e,e){case"history":this.history=new jt(this,t.base);break;case"hash":this.history=new Lt(this,t.base,this.fallback);break;case"abstract":this.history=new It(this,t.base)}},Bt={currentRoute:{configurable:!0}};function Ft(t,e){return t.push(e),function(){var r=t.indexOf(e);r>-1&&t.splice(r,1)}}return Mt.prototype.match=function(t,e,r){return this.matcher.match(t,e,r)},Bt.currentRoute.get=function(){return this.history&&this.history.current},Mt.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",(function(){var r=e.apps.indexOf(t);r>-1&&e.apps.splice(r,1),e.app===t&&(e.app=e.apps[0]||null),e.app||e.history.teardownListeners()})),!this.app){this.app=t;var r=this.history;if(r instanceof jt||r instanceof Lt){var n=function(t){r.setupListeners(),function(t){var n=r.current,o=e.options.scrollBehavior;pt&&o&&"fullPath"in t&&et(e,t,n,!1)}(t)};r.transitionTo(r.getCurrentLocation(),n,n)}r.listen((function(t){e.apps.forEach((function(e){e._route=t}))}))}},Mt.prototype.beforeEach=function(t){return Ft(this.beforeHooks,t)},Mt.prototype.beforeResolve=function(t){return Ft(this.resolveHooks,t)},Mt.prototype.afterEach=function(t){return Ft(this.afterHooks,t)},Mt.prototype.onReady=function(t,e){this.history.onReady(t,e)},Mt.prototype.onError=function(t){this.history.onError(t)},Mt.prototype.push=function(t,e,r){var n=this;if(!e&&!r&&"undefined"!=typeof Promise)return new Promise((function(e,r){n.history.push(t,e,r)}));this.history.push(t,e,r)},Mt.prototype.replace=function(t,e,r){var n=this;if(!e&&!r&&"undefined"!=typeof Promise)return new Promise((function(e,r){n.history.replace(t,e,r)}));this.history.replace(t,e,r)},Mt.prototype.go=function(t){this.history.go(t)},Mt.prototype.back=function(){this.go(-1)},Mt.prototype.forward=function(){this.go(1)},Mt.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map((function(t){return Object.keys(t.components).map((function(e){return t.components[e]}))}))):[]},Mt.prototype.resolve=function(t,e,r){var n=M(t,e=e||this.history.current,r,this),o=this.match(n,e),i=o.redirectedFrom||o.fullPath;return{location:n,route:o,href:function(t,e,r){var n="hash"===r?"#"+e:e;return t?w(t+"/"+n):n}(this.history.base,i,this.mode),normalizedTo:n,resolved:o}},Mt.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==l&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Mt.prototype,Bt),Mt.install=function t(r){if(!t.installed||B!==r){t.installed=!0,B=r;var n=function(t){return void 0!==t},o=function(t,e){var r=t.$options._parentKnode;n(r)&&n(r=r.data)&&n(r=r.registerRouteInstance)&&r(t,e)};r.mixin({beforeCreate:function(){n(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),r.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,o(this,this)},destroyed:function(){o(this)}}),Object.defineProperty(r.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(r.prototype,"$route",{get:function(){return this._routerRoot._route}}),r.component("RouterView",e),r.component("RouterLink",H);var i=r.config.optionMergeStrategies;i.beforeRouteEnter=i.beforeRouteLeave=i.beforeRouteUpdate=i.created}},Mt.version="3.4.0-beta.0",Mt.isNavigationFailure=bt,Mt.NavigationFailureType=dt,V&&window.Kdu&&window.Kdu.use(Mt),Mt},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).KduRouter=e();
11
+ var t,e;t=this,e=function(){"use strict";function t(t,e){for(var r in e)t[r]=e[r];return t}var e=/[!'()*]/g,r=function(t){return"%"+t.charCodeAt(0).toString(16)},n=/%2C/g,o=function(t){return encodeURIComponent(t).replace(e,r).replace(n,",")};function i(t){try{return decodeURIComponent(t)}catch(t){}return t}var a=function(t){return null==t||"object"==typeof t?t:String(t)};function s(t){var e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach((function(t){var r=t.replace(/\+/g," ").split("="),n=i(r.shift()),o=r.length>0?i(r.join("=")):null;void 0===e[n]?e[n]=o:Array.isArray(e[n])?e[n].push(o):e[n]=[e[n],o]})),e):e}function u(t){var e=t?Object.keys(t).map((function(e){var r=t[e];if(void 0===r)return"";if(null===r)return o(e);if(Array.isArray(r)){var n=[];return r.forEach((function(t){void 0!==t&&(null===t?n.push(o(e)):n.push(o(e)+"="+o(t)))})),n.join("&")}return o(e)+"="+o(r)})).filter((function(t){return t.length>0})).join("&"):null;return e?"?"+e:""}var c=/\/?$/;function p(t,e,r,n){var o=n&&n.options.stringifyQuery,i=e.query||{};try{i=f(i)}catch(t){}var a={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:i,params:e.params||{},fullPath:d(e,o),matched:t?l(t):[]};return r&&(a.redirectedFrom=d(r,o)),Object.freeze(a)}function f(t){if(Array.isArray(t))return t.map(f);if(t&&"object"==typeof t){var e={};for(var r in t)e[r]=f(t[r]);return e}return t}var h=p(null,{path:"/"});function l(t){for(var e=[];t;)e.unshift(t),t=t.parent;return e}function d(t,e){var r=t.path,n=t.query;void 0===n&&(n={});var o=t.hash;return void 0===o&&(o=""),(r||"/")+(e||u)(n)+o}function v(t,e,r){return e===h?t===e:!!e&&(t.path&&e.path?t.path.replace(c,"")===e.path.replace(c,"")&&(r||t.hash===e.hash&&y(t.query,e.query)):!(!t.name||!e.name)&&t.name===e.name&&(r||t.hash===e.hash&&y(t.query,e.query)&&y(t.params,e.params)))}function y(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),!t||!e)return t===e;var r=Object.keys(t).sort(),n=Object.keys(e).sort();return r.length===n.length&&r.every((function(r,o){var i=t[r];if(n[o]!==r)return!1;var a=e[r];return null==i||null==a?i===a:"object"==typeof i&&"object"==typeof a?y(i,a):String(i)===String(a)}))}function m(t){for(var e=0;e<t.matched.length;e++){var r=t.matched[e];for(var n in r.instances){var o=r.instances[n],i=r.enteredCbs[n];if(o&&i){delete r.enteredCbs[n];for(var a=0;a<i.length;a++)o._isBeingDestroyed||i[a](o)}}}}var g={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render:function(e,r){var n=r.props,o=r.children,i=r.parent,a=r.data;a.routerView=!0;for(var s=i.$createElement,u=n.name,c=i.$route,p=i._routerViewCache||(i._routerViewCache={}),f=0,h=!1;i&&i._routerRoot!==i;){var l=i.$knode?i.$knode.data:{};l.routerView&&f++,l.keepAlive&&i._directInactive&&i._inactive&&(h=!0),i=i.$parent}if(a.routerViewDepth=f,h){var d=p[u],v=d&&d.component;return v?(d.configProps&&w(v,a,d.route,d.configProps),s(v,a,o)):s()}var y=c.matched[f],g=y&&y.components[u];if(!y||!g)return p[u]=null,s();p[u]={component:g},a.registerRouteInstance=function(t,e){var r=y.instances[u];(e&&r!==t||!e&&r===t)&&(y.instances[u]=e)},(a.hook||(a.hook={})).prepatch=function(t,e){y.instances[u]=e.componentInstance},a.hook.init=function(t){t.data.keepAlive&&t.componentInstance&&t.componentInstance!==y.instances[u]&&(y.instances[u]=t.componentInstance),m(c)};var b=y.props&&y.props[u];return b&&(t(p[u],{route:c,configProps:b}),w(g,a,c,b)),s(g,a,o)}};function w(e,r,n,o){var i=r.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}}(n,o);if(i){i=r.props=t({},i);var a=r.attrs=r.attrs||{};for(var s in i)e.props&&s in e.props||(a[s]=i[s],delete i[s])}}function b(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 s=i[a];".."===s?o.pop():"."!==s&&o.push(s)}return""!==o[0]&&o.unshift(""),o.join("/")}function x(t){return t.replace(/\/(?:\s*\/)+/g,"/")}var R=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},k=B,E=j,C=function(t,e){return S(j(t,e),e)},A=S,O=U,_=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function j(t,e){for(var r,n=[],o=0,i=0,a="",s=e&&e.delimiter||"/";null!=(r=_.exec(t));){var u=r[0],c=r[1],p=r.index;if(a+=t.slice(i,p),i=p+u.length,c)a+=c[1];else{var f=t[i],h=r[2],l=r[3],d=r[4],v=r[5],y=r[6],m=r[7];a&&(n.push(a),a="");var g=null!=h&&null!=f&&f!==h,w="+"===y||"*"===y,b="?"===y||"*"===y,x=r[2]||s,R=d||v;n.push({name:l||o++,prefix:h||"",delimiter:x,optional:b,repeat:w,partial:g,asterisk:!!m,pattern:R?L(R):m?".*":"[^"+P(x)+"]+?"})}}return i<t.length&&(a+=t.substr(i)),a&&n.push(a),n}function T(t){return encodeURI(t).replace(/[\/?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}))}function S(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)"object"==typeof t[n]&&(r[n]=new RegExp("^(?:"+t[n].pattern+")$",q(e)));return function(e,n){for(var o="",i=e||{},a=(n||{}).pretty?T:encodeURIComponent,s=0;s<t.length;s++){var u=t[s];if("string"!=typeof u){var c,p=i[u.name];if(null==p){if(u.optional){u.partial&&(o+=u.prefix);continue}throw new TypeError('Expected "'+u.name+'" to be defined')}if(R(p)){if(!u.repeat)throw new TypeError('Expected "'+u.name+'" to not repeat, but received `'+JSON.stringify(p)+"`");if(0===p.length){if(u.optional)continue;throw new TypeError('Expected "'+u.name+'" to not be empty')}for(var f=0;f<p.length;f++){if(c=a(p[f]),!r[s].test(c))throw new TypeError('Expected all "'+u.name+'" to match "'+u.pattern+'", but received `'+JSON.stringify(c)+"`");o+=(0===f?u.prefix:u.delimiter)+c}}else{if(c=u.asterisk?encodeURI(p).replace(/[?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})):a(p),!r[s].test(c))throw new TypeError('Expected "'+u.name+'" to match "'+u.pattern+'", but received "'+c+'"');o+=u.prefix+c}}else o+=u}return o}}function P(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function L(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function $(t,e){return t.keys=e,t}function q(t){return t&&t.sensitive?"":"i"}function U(t,e,r){R(e)||(r=e||r,e=[]);for(var n=(r=r||{}).strict,o=!1!==r.end,i="",a=0;a<t.length;a++){var s=t[a];if("string"==typeof s)i+=P(s);else{var u=P(s.prefix),c="(?:"+s.pattern+")";e.push(s),s.repeat&&(c+="(?:"+u+c+")*"),i+=c=s.optional?s.partial?u+"("+c+")?":"(?:"+u+"("+c+"))?":u+"("+c+")"}}var p=P(r.delimiter||"/"),f=i.slice(-p.length)===p;return n||(i=(f?i.slice(0,-p.length):i)+"(?:"+p+"(?=$))?"),i+=o?"$":n&&f?"":"(?="+p+"|$)",$(new RegExp("^"+i,q(r)),e)}function B(t,e,r){return R(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 $(t,e)}(t,e):R(t)?function(t,e,r){for(var n=[],o=0;o<t.length;o++)n.push(B(t[o],e,r).source);return $(new RegExp("(?:"+n.join("|")+")",q(r)),e)}(t,e,r):function(t,e,r){return U(j(t,r),e,r)}(t,e,r)}k.parse=E,k.compile=C,k.tokensToFunction=A,k.tokensToRegExp=O;var I=Object.create(null);function M(t,e,r){e=e||{};try{var n=I[t]||(I[t]=k.compile(t));return"string"==typeof e.pathMatch&&(e[0]=e.pathMatch),n(e,{pretty:!0})}catch(t){return""}finally{delete e[0]}}function H(e,r,n,o){var i="string"==typeof e?{path:e}:e;if(i._normalized)return i;if(i.name){var u=(i=t({},e)).params;return u&&"object"==typeof u&&(i.params=t({},u)),i}if(!i.path&&i.params&&r){(i=t({},i))._normalized=!0;var c=t(t({},r.params),i.params);if(r.name)i.name=r.name,i.params=c;else if(r.matched.length){var p=r.matched[r.matched.length-1].path;i.path=M(p,c,r.path)}return i}var f=function(t){var e="",r="",n=t.indexOf("#");n>=0&&(e=t.slice(n),t=t.slice(0,n));var o=t.indexOf("?");return o>=0&&(r=t.slice(o+1),t=t.slice(0,o)),{path:t,query:r,hash:e}}(i.path||""),h=r&&r.path||"/",l=f.path?b(f.path,h,n||i.append):h,d=function(t,e,r){void 0===e&&(e={});var n,o=r||s;try{n=o(t||"")}catch(t){n={}}for(var i in e){var u=e[i];n[i]=Array.isArray(u)?u.map(a):a(u)}return n}(f.query,i.query,o&&o.options.parseQuery),v=i.hash||f.hash;return v&&"#"!==v.charAt(0)&&(v="#"+v),{_normalized:!0,path:l,query:d,hash:v}}var N,F=function(){},V={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render:function(e){var r=this,n=this.$router,o=this.$route,i=n.resolve(this.to,o,this.append),a=i.location,s=i.route,u=i.href,f={},h=n.options.linkActiveClass,l=n.options.linkExactActiveClass,d=null==h?"router-link-active":h,y=null==l?"router-link-exact-active":l,m=null==this.activeClass?d:this.activeClass,g=null==this.exactActiveClass?y:this.exactActiveClass,w=s.redirectedFrom?p(null,H(s.redirectedFrom),null,n):s;f[g]=v(o,w,this.exactPath),f[m]=this.exact||this.exactPath?f[g]:function(t,e){return 0===t.path.replace(c,"/").indexOf(e.path.replace(c,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var r in e)if(!(r in t))return!1;return!0}(t.query,e.query)}(o,w);var b=f[g]?this.ariaCurrentValue:null,x=function(t){z(t)&&(r.replace?n.replace(a,F):n.push(a,F))},R={click:z};Array.isArray(this.event)?this.event.forEach((function(t){R[t]=x})):R[this.event]=x;var k={class:f},E=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:u,route:s,navigate:x,isActive:f[m],isExactActive:f[g]});if(E){if(1===E.length)return E[0];if(E.length>1||!E.length)return 0===E.length?e():e("span",{},E)}if("a"===this.tag)k.on=R,k.attrs={href:u,"aria-current":b};else{var C=function t(e){var r;if(e)for(var n=0;n<e.length;n++){if("a"===(r=e[n]).tag)return r;if(r.children&&(r=t(r.children)))return r}}(this.$slots.default);if(C){C.isStatic=!1;var A=C.data=t({},C.data);for(var O in A.on=A.on||{},A.on){var _=A.on[O];O in R&&(A.on[O]=Array.isArray(_)?_:[_])}for(var j in R)j in A.on?A.on[j].push(R[j]):A.on[j]=x;var T=C.data.attrs=t({},C.data.attrs);T.href=u,T["aria-current"]=b}else k.on=R}return e(this.tag,k,this.$slots.default)}};function z(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}}var K="undefined"!=typeof window;function D(t,e,r,n,o){var i=e||[],a=r||Object.create(null),s=n||Object.create(null);t.forEach((function(t){!function t(e,r,n,o,i,a){var s=o.path,u=o.name,c=o.pathToRegexpOptions||{},p=function(t,e,r){return r||(t=t.replace(/\/$/,"")),"/"===t[0]||null==e?t:x(e.path+"/"+t)}(s,i,c.strict);"boolean"==typeof o.caseSensitive&&(c.sensitive=o.caseSensitive);var f={path:p,regex:J(p,c),components:o.components||{default:o.component},alias:o.alias?"string"==typeof o.alias?[o.alias]:o.alias:[],instances:{},enteredCbs:{},name:u,parent:i,matchAs:a,redirect:o.redirect,beforeEnter:o.beforeEnter,meta:o.meta||{},props:null==o.props?{}:o.components?o.props:{default:o.props}};if(o.children&&o.children.forEach((function(o){var i=a?x(a+"/"+o.path):void 0;t(e,r,n,o,f,i)})),r[f.path]||(e.push(f.path),r[f.path]=f),void 0!==o.alias)for(var h=Array.isArray(o.alias)?o.alias:[o.alias],l=0;l<h.length;++l){var d={path:h[l],children:o.children};t(e,r,n,d,i,f.path||"/")}u&&(n[u]||(n[u]=f))}(i,a,s,t,o)}));for(var u=0,c=i.length;u<c;u++)"*"===i[u]&&(i.push(i.splice(u,1)[0]),c--,u--);return{pathList:i,pathMap:a,nameMap:s}}function J(t,e){return k(t,[],e)}function Q(t,e){var r=D(t),n=r.pathList,o=r.pathMap,i=r.nameMap;function a(t,r,a){var s=H(t,r,!1,e),c=s.name;if(c){var p=i[c];if(!p)return u(null,s);var f=p.regex.keys.filter((function(t){return!t.optional})).map((function(t){return t.name}));if("object"!=typeof s.params&&(s.params={}),r&&"object"==typeof r.params)for(var h in r.params)!(h in s.params)&&f.indexOf(h)>-1&&(s.params[h]=r.params[h]);return s.path=M(p.path,s.params),u(p,s,a)}if(s.path){s.params={};for(var l=0;l<n.length;l++){var d=n[l],v=o[d];if(X(v.regex,s.path,s.params))return u(v,s,a)}}return u(null,s)}function s(t,r){var n=t.redirect,o="function"==typeof n?n(p(t,r,null,e)):n;if("string"==typeof o&&(o={path:o}),!o||"object"!=typeof o)return u(null,r);var s=o,c=s.name,f=s.path,h=r.query,l=r.hash,d=r.params;return h=s.hasOwnProperty("query")?s.query:h,l=s.hasOwnProperty("hash")?s.hash:l,d=s.hasOwnProperty("params")?s.params:d,c?(i[c],a({_normalized:!0,name:c,query:h,hash:l,params:d},void 0,r)):f?a({_normalized:!0,path:M(function(t,e){return b(t,e.parent?e.parent.path:"/",!0)}(f,t),d),query:h,hash:l},void 0,r):u(null,r)}function u(t,r,n){return t&&t.redirect?s(t,n||r):t&&t.matchAs?function(t,e,r){var n=a({_normalized:!0,path:M(r,e.params)});if(n){var o=n.matched,i=o[o.length-1];return e.params=n.params,u(i,e)}return u(null,e)}(0,r,t.matchAs):p(t,r,n,e)}return{match:a,addRoute:function(t,e){var r="object"!=typeof t?i[t]:void 0;D([e||t],n,o,i,r),r&&r.alias.length&&D(r.alias.map((function(t){return{path:t,children:[e]}})),n,o,i,r)},getRoutes:function(){return n.map((function(t){return o[t]}))},addRoutes:function(t){D(t,n,o,i)}}}function X(t,e,r){var n=e.match(t);if(!n)return!1;if(!r)return!0;for(var o=1,a=n.length;o<a;++o){var s=t.keys[o-1];s&&(r[s.name||"pathMatch"]="string"==typeof n[o]?i(n[o]):n[o])}return!0}var Y=K&&window.performance&&window.performance.now?window.performance:Date;function W(){return Y.now().toFixed(3)}var G=W();function Z(){return G}function tt(t){return G=t}var et=Object.create(null);function rt(){"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual");var e=window.location.protocol+"//"+window.location.host,r=window.location.href.replace(e,""),n=t({},window.history.state);return n.key=Z(),window.history.replaceState(n,"",r),window.addEventListener("popstate",it),function(){window.removeEventListener("popstate",it)}}function nt(t,e,r,n){if(t.app){var o=t.options.scrollBehavior;o&&t.app.$nextTick((function(){var i=function(){var t=Z();if(t)return et[t]}(),a=o.call(t,e,r,n?i:null);a&&("function"==typeof a.then?a.then((function(t){pt(t,i)})).catch((function(t){})):pt(a,i))}))}}function ot(){var t=Z();t&&(et[t]={x:window.pageXOffset,y:window.pageYOffset})}function it(t){ot(),t.state&&t.state.key&&tt(t.state.key)}function at(t){return ut(t.x)||ut(t.y)}function st(t){return{x:ut(t.x)?t.x:window.pageXOffset,y:ut(t.y)?t.y:window.pageYOffset}}function ut(t){return"number"==typeof t}var ct=/^#\d/;function pt(t,e){var r,n="object"==typeof t;if(n&&"string"==typeof t.selector){var o=ct.test(t.selector)?document.getElementById(t.selector.slice(1)):document.querySelector(t.selector);if(o){var i=t.offset&&"object"==typeof t.offset?t.offset:{};e=function(t,e){var r=document.documentElement.getBoundingClientRect(),n=t.getBoundingClientRect();return{x:n.left-r.left-e.x,y:n.top-r.top-e.y}}(o,i={x:ut((r=i).x)?r.x:0,y:ut(r.y)?r.y:0})}else at(t)&&(e=st(t))}else n&&at(t)&&(e=st(t));e&&("scrollBehavior"in document.documentElement.style?window.scrollTo({left:e.x,top:e.y,behavior:t.behavior}):window.scrollTo(e.x,e.y))}var ft,ht=K&&(-1===(ft=window.navigator.userAgent).indexOf("Android 2.")&&-1===ft.indexOf("Android 4.0")||-1===ft.indexOf("Mobile Safari")||-1!==ft.indexOf("Chrome")||-1!==ft.indexOf("Windows Phone"))&&window.history&&"function"==typeof window.history.pushState;function lt(e,r){ot();var n=window.history;try{if(r){var o=t({},n.state);o.key=Z(),n.replaceState(o,"",e)}else n.pushState({key:tt(W())},"",e)}catch(t){window.location[r?"replace":"assign"](e)}}function dt(t){lt(t,!0)}var vt={redirected:2,aborted:4,cancelled:8,duplicated:16};function yt(t,e){return gt(t,e,vt.redirected,'Redirected when going from "'+t.fullPath+'" to "'+function(t){if("string"==typeof t)return t;if("path"in t)return t.path;var e={};return wt.forEach((function(r){r in t&&(e[r]=t[r])})),JSON.stringify(e,null,2)}(e)+'" via a navigation guard.')}function mt(t,e){return gt(t,e,vt.cancelled,'Navigation cancelled from "'+t.fullPath+'" to "'+e.fullPath+'" with a new navigation.')}function gt(t,e,r,n){var o=new Error(n);return o._isRouter=!0,o.from=t,o.to=e,o.type=r,o}var wt=["params","query","hash"];function bt(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}function xt(t,e){return bt(t)&&t._isRouter&&(null==e||t.type===e)}function Rt(t,e,r){var n=function(o){o>=t.length?r():t[o]?e(t[o],(function(){n(o+1)})):n(o+1)};n(0)}function kt(t){return function(e,r,n){var o=!1,i=0,a=null;Et(t,(function(t,e,r,s){if("function"==typeof t&&void 0===t.cid){o=!0,i++;var u,c=Ot((function(e){var o;((o=e).__esModule||At&&"Module"===o[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:N.extend(e),r.components[s]=e,--i<=0&&n()})),p=Ot((function(t){var e="Failed to resolve async component "+s+": "+t;a||(a=bt(t)?t:new Error(e),n(a))}));try{u=t(c,p)}catch(t){p(t)}if(u)if("function"==typeof u.then)u.then(c,p);else{var f=u.component;f&&"function"==typeof f.then&&f.then(c,p)}}})),o||n()}}function Et(t,e){return Ct(t.map((function(t){return Object.keys(t.components).map((function(r){return e(t.components[r],t.instances[r],t,r)}))})))}function Ct(t){return Array.prototype.concat.apply([],t)}var At="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Ot(t){var e=!1;return function(){for(var r=[],n=arguments.length;n--;)r[n]=arguments[n];if(!e)return e=!0,t.apply(this,r)}}var _t=function(t,e){this.router=t,this.base=function(t){if(!t)if(K){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";return"/"!==t.charAt(0)&&(t="/"+t),t.replace(/\/$/,"")}(e),this.current=h,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function jt(t,e,r,n){var o=Et(t,(function(t,n,o,i){var a=function(t,e){return"function"!=typeof t&&(t=N.extend(t)),t.options[e]}(t,e);if(a)return Array.isArray(a)?a.map((function(t){return r(t,n,o,i)})):r(a,n,o,i)}));return Ct(n?o.reverse():o)}function Tt(t,e){if(e)return function(){return t.apply(e,arguments)}}_t.prototype.listen=function(t){this.cb=t},_t.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},_t.prototype.onError=function(t){this.errorCbs.push(t)},_t.prototype.transitionTo=function(t,e,r){var n,o=this;try{n=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach((function(e){e(t)})),t}var i=this.current;this.confirmTransition(n,(function(){o.updateRoute(n),e&&e(n),o.ensureURL(),o.router.afterHooks.forEach((function(t){t&&t(n,i)})),o.ready||(o.ready=!0,o.readyCbs.forEach((function(t){t(n)})))}),(function(t){r&&r(t),t&&!o.ready&&(xt(t,vt.redirected)&&i===h||(o.ready=!0,o.readyErrorCbs.forEach((function(e){e(t)}))))}))},_t.prototype.confirmTransition=function(t,e,r){var n=this,o=this.current;this.pending=t;var i,a,s=function(t){!xt(t)&&bt(t)&&(n.errorCbs.length?n.errorCbs.forEach((function(e){e(t)})):console.error(t)),r&&r(t)},u=t.matched.length-1,c=o.matched.length-1;if(v(t,o)&&u===c&&t.matched[u]===o.matched[c])return this.ensureURL(),t.hash&&nt(this.router,o,t,!1),s(((a=gt(i=o,t,vt.duplicated,'Avoided redundant navigation to current location: "'+i.fullPath+'".')).name="NavigationDuplicated",a));var p=function(t,e){var r,n=Math.max(t.length,e.length);for(r=0;r<n&&t[r]===e[r];r++);return{updated:e.slice(0,r),activated:e.slice(r),deactivated:t.slice(r)}}(this.current.matched,t.matched),f=p.updated,h=p.deactivated,l=p.activated,d=[].concat(function(t){return jt(t,"beforeRouteLeave",Tt,!0)}(h),this.router.beforeHooks,function(t){return jt(t,"beforeRouteUpdate",Tt)}(f),l.map((function(t){return t.beforeEnter})),kt(l)),y=function(e,r){if(n.pending!==t)return s(mt(o,t));try{e(t,o,(function(e){!1===e?(n.ensureURL(!0),s(function(t,e){return gt(t,e,vt.aborted,'Navigation aborted from "'+t.fullPath+'" to "'+e.fullPath+'" via a navigation guard.')}(o,t))):bt(e)?(n.ensureURL(!0),s(e)):"string"==typeof e||"object"==typeof e&&("string"==typeof e.path||"string"==typeof e.name)?(s(yt(o,t)),"object"==typeof e&&e.replace?n.replace(e):n.push(e)):r(e)}))}catch(t){s(t)}};Rt(d,y,(function(){Rt(function(t){return jt(t,"beforeRouteEnter",(function(t,e,r,n){return function(t,e,r){return function(n,o,i){return t(n,o,(function(t){"function"==typeof t&&(e.enteredCbs[r]||(e.enteredCbs[r]=[]),e.enteredCbs[r].push(t)),i(t)}))}}(t,r,n)}))}(l).concat(n.router.resolveHooks),y,(function(){if(n.pending!==t)return s(mt(o,t));n.pending=null,e(t),n.router.app&&n.router.app.$nextTick((function(){m(t)}))}))}))},_t.prototype.updateRoute=function(t){this.current=t,this.cb&&this.cb(t)},_t.prototype.setupListeners=function(){},_t.prototype.teardown=function(){this.listeners.forEach((function(t){t()})),this.listeners=[],this.current=h,this.pending=null};var St=function(t){function e(e,r){t.call(this,e,r),this._startLocation=Pt(this.base)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router,r=e.options.scrollBehavior,n=ht&&r;n&&this.listeners.push(rt());var o=function(){var r=t.current,o=Pt(t.base);t.current===h&&o===t._startLocation||t.transitionTo(o,(function(t){n&&nt(e,t,r,!0)}))};window.addEventListener("popstate",o),this.listeners.push((function(){window.removeEventListener("popstate",o)}))}},e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){lt(x(n.base+t.fullPath)),nt(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.replace=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){dt(x(n.base+t.fullPath)),nt(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.ensureURL=function(t){if(Pt(this.base)!==this.current.fullPath){var e=x(this.base+this.current.fullPath);t?lt(e):dt(e)}},e.prototype.getCurrentLocation=function(){return Pt(this.base)},e}(_t);function Pt(t){var e=window.location.pathname,r=e.toLowerCase(),n=t.toLowerCase();return!t||r!==n&&0!==r.indexOf(x(n+"/"))||(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var Lt=function(t){function e(e,r,n){t.call(this,e,r),n&&function(t){var e=Pt(t);if(!/^\/#/.test(e))return window.location.replace(x(t+"/#"+e)),!0}(this.base)||$t()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router.options.scrollBehavior,r=ht&&e;r&&this.listeners.push(rt());var n=function(){var e=t.current;$t()&&t.transitionTo(qt(),(function(n){r&&nt(t.router,n,e,!0),ht||It(n.fullPath)}))},o=ht?"popstate":"hashchange";window.addEventListener(o,n),this.listeners.push((function(){window.removeEventListener(o,n)}))}},e.prototype.push=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){Bt(t.fullPath),nt(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.replace=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){It(t.fullPath),nt(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;qt()!==e&&(t?Bt(e):It(e))},e.prototype.getCurrentLocation=function(){return qt()},e}(_t);function $t(){var t=qt();return"/"===t.charAt(0)||(It("/"+t),!1)}function qt(){var t=window.location.href,e=t.indexOf("#");return e<0?"":t=t.slice(e+1)}function Ut(t){var e=window.location.href,r=e.indexOf("#");return(r>=0?e.slice(0,r):e)+"#"+t}function Bt(t){ht?lt(Ut(t)):window.location.hash=t}function It(t){ht?dt(Ut(t)):window.location.replace(Ut(t))}var Mt=function(t){function e(e,r){t.call(this,e,r),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,r){var n=this;this.transitionTo(t,(function(t){n.stack=n.stack.slice(0,n.index+1).concat(t),n.index++,e&&e(t)}),r)},e.prototype.replace=function(t,e,r){var n=this;this.transitionTo(t,(function(t){n.stack=n.stack.slice(0,n.index).concat(t),e&&e(t)}),r)},e.prototype.go=function(t){var e=this,r=this.index+t;if(!(r<0||r>=this.stack.length)){var n=this.stack[r];this.confirmTransition(n,(function(){var t=e.current;e.index=r,e.updateRoute(n),e.router.afterHooks.forEach((function(e){e&&e(n,t)}))}),(function(t){xt(t,vt.duplicated)&&(e.index=r)}))}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(_t),Ht=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Q(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!ht&&!1!==t.fallback,this.fallback&&(e="hash"),K||(e="abstract"),this.mode=e,e){case"history":this.history=new St(this,t.base);break;case"hash":this.history=new Lt(this,t.base,this.fallback);break;case"abstract":this.history=new Mt(this,t.base)}},Nt={currentRoute:{configurable:!0}};function Ft(t,e){return t.push(e),function(){var r=t.indexOf(e);r>-1&&t.splice(r,1)}}return Ht.prototype.match=function(t,e,r){return this.matcher.match(t,e,r)},Nt.currentRoute.get=function(){return this.history&&this.history.current},Ht.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",(function(){var r=e.apps.indexOf(t);r>-1&&e.apps.splice(r,1),e.app===t&&(e.app=e.apps[0]||null),e.app||e.history.teardown()})),!this.app){this.app=t;var r=this.history;if(r instanceof St||r instanceof Lt){var n=function(t){r.setupListeners(),function(t){var n=r.current,o=e.options.scrollBehavior;ht&&o&&"fullPath"in t&&nt(e,t,n,!1)}(t)};r.transitionTo(r.getCurrentLocation(),n,n)}r.listen((function(t){e.apps.forEach((function(e){e._route=t}))}))}},Ht.prototype.beforeEach=function(t){return Ft(this.beforeHooks,t)},Ht.prototype.beforeResolve=function(t){return Ft(this.resolveHooks,t)},Ht.prototype.afterEach=function(t){return Ft(this.afterHooks,t)},Ht.prototype.onReady=function(t,e){this.history.onReady(t,e)},Ht.prototype.onError=function(t){this.history.onError(t)},Ht.prototype.push=function(t,e,r){var n=this;if(!e&&!r&&"undefined"!=typeof Promise)return new Promise((function(e,r){n.history.push(t,e,r)}));this.history.push(t,e,r)},Ht.prototype.replace=function(t,e,r){var n=this;if(!e&&!r&&"undefined"!=typeof Promise)return new Promise((function(e,r){n.history.replace(t,e,r)}));this.history.replace(t,e,r)},Ht.prototype.go=function(t){this.history.go(t)},Ht.prototype.back=function(){this.go(-1)},Ht.prototype.forward=function(){this.go(1)},Ht.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map((function(t){return Object.keys(t.components).map((function(e){return t.components[e]}))}))):[]},Ht.prototype.resolve=function(t,e,r){var n=H(t,e=e||this.history.current,r,this),o=this.match(n,e),i=o.redirectedFrom||o.fullPath;return{location:n,route:o,href:function(t,e,r){var n="hash"===r?"#"+e:e;return t?x(t+"/"+n):n}(this.history.base,i,this.mode),normalizedTo:n,resolved:o}},Ht.prototype.getRoutes=function(){return this.matcher.getRoutes()},Ht.prototype.addRoute=function(t,e){this.matcher.addRoute(t,e),this.history.current!==h&&this.history.transitionTo(this.history.getCurrentLocation())},Ht.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==h&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Ht.prototype,Nt),K&&window.Kdu&&window.Kdu.use(Ht),Ht.install=function t(e){if(!t.installed||N!==e){t.installed=!0,N=e;var r=function(t){return void 0!==t},n=function(t,e){var n=t.$options._parentKnode;r(n)&&r(n=n.data)&&r(n=n.registerRouteInstance)&&n(t,e)};e.mixin({beforeCreate:function(){r(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,n(this,this)},destroyed:function(){n(this)}}),Object.defineProperty(e.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get:function(){return this._routerRoot._route}}),e.component("RouterView",g),e.component("RouterLink",V);var o=e.config.optionMergeStrategies;o.beforeRouteEnter=o.beforeRouteLeave=o.beforeRouteUpdate=o.created}},Ht.version="3.6.0",Ht.isNavigationFailure=xt,Ht.NavigationFailureType=vt,Ht.START_LOCATION=h,Ht},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).KduRouter=e();
@@ -1,38 +1,38 @@
1
- {
2
- "name": {
3
- "type": "string",
4
- "description": "When a `<router-view>` has a `name` prop, it will render the component with the corresponding name in the matched route record's components option."
5
- },
6
- "to": {
7
- "description": "Denotes the target route of the link. When clicked, the value of the `to` prop will be internally passed to `router.push()`, so the value can be either a string or a location descriptor object."
8
- },
9
- "append": {
10
- "type": "boolean",
11
- "description": "Setting the append prop always appends the relative path to the current path. For example, assuming we are navigating from /a to a relative link b, without append we will end up at /b, but with append we will end up at /a/b."
12
- },
13
- "tag": {
14
- "description": "Specify which tag to render to, and it will still listen to click events for navigation. By default, an `a` tag is rendered."
15
- },
16
- "event": {
17
- "description": "Specify the event(s) that can trigger the link navigation. By default, the `click` event triggers a navigation."
18
- },
19
- "replace": {
20
- "type": "boolean",
21
- "description": "Call `router.replace()` instead of `router.push()` when the link is clicked, so the navigation replaces the current history entry."
22
- },
23
- "exact": {
24
- "description": "The default active class matching behavior is inclusive match. For example, `<router-link to=\"/a\">` will get this class applied as long as the current path starts with /a/ or is /a.\nOne consequence of this is that `<router-link to=\"/\">` will be active for every route! To force the link into \"exact match mode\", use the exact prop: `<router-link to=\"/\" exact>`"
25
- },
26
- "active-class": {
27
- "type": "string",
28
- "description": "Configure the active CSS class applied when the link is active. Note the default value can also be configured globally via the `linkActiveClass` router constructor option."
29
- },
30
- "exact-active-class": {
31
- "type": "string",
32
- "description": "Configure the active CSS class applied when the link is exactly active. Note the default value can also be configured globally via the `linkExactActiveClass` router constructor option."
33
- },
34
- "aria-current-value": {
35
- "options": ["page", "step", "location", "date", "time", "true", "false"],
36
- "description": "Configure the value of `aria-current` when the link is active with exact match. It must be one of the [allowed values for `aria-current`](https://www.w3.org/TR/wai-aria-1.2/#aria-current) in the ARIA spec. In most cases, the default of `page` should be the best fit."
37
- }
38
- }
1
+ {
2
+ "name": {
3
+ "type": "string",
4
+ "description": "When a `<router-view>` has a `name` prop, it will render the component with the corresponding name in the matched route record's components option."
5
+ },
6
+ "to": {
7
+ "description": "Denotes the target route of the link. When clicked, the value of the `to` prop will be internally passed to `router.push()`, so the value can be either a string or a location descriptor object."
8
+ },
9
+ "append": {
10
+ "type": "boolean",
11
+ "description": "Setting the append prop always appends the relative path to the current path. For example, assuming we are navigating from /a to a relative link b, without append we will end up at /b, but with append we will end up at /a/b."
12
+ },
13
+ "tag": {
14
+ "description": "Specify which tag to render to, and it will still listen to click events for navigation. By default, an `a` tag is rendered."
15
+ },
16
+ "event": {
17
+ "description": "Specify the event(s) that can trigger the link navigation. By default, the `click` event triggers a navigation."
18
+ },
19
+ "replace": {
20
+ "type": "boolean",
21
+ "description": "Call `router.replace()` instead of `router.push()` when the link is clicked, so the navigation replaces the current history entry."
22
+ },
23
+ "exact": {
24
+ "description": "The default active class matching behavior is inclusive match. For example, `<router-link to=\"/a\">` will get this class applied as long as the current path starts with /a/ or is /a.\nOne consequence of this is that `<router-link to=\"/\">` will be active for every route! To force the link into \"exact match mode\", use the exact prop: `<router-link to=\"/\" exact>`"
25
+ },
26
+ "active-class": {
27
+ "type": "string",
28
+ "description": "Configure the active CSS class applied when the link is active. Note the default value can also be configured globally via the `linkActiveClass` router constructor option."
29
+ },
30
+ "exact-active-class": {
31
+ "type": "string",
32
+ "description": "Configure the active CSS class applied when the link is exactly active. Note the default value can also be configured globally via the `linkExactActiveClass` router constructor option."
33
+ },
34
+ "aria-current-value": {
35
+ "options": ["page", "step", "location", "date", "time", "true", "false"],
36
+ "description": "Configure the value of `aria-current` when the link is active with exact match. It must be one of the [allowed values for `aria-current`](https://www.w3.org/TR/wai-aria-1.2/#aria-current) in the ARIA spec. In most cases, the default of `page` should be the best fit."
37
+ }
38
+ }
package/ketur/tags.json CHANGED
@@ -1,20 +1,20 @@
1
- {
2
- "router-view": {
3
- "attributes": ["name"],
4
- "description": "Component that renders the matched component for the current location. Components rendered by `<router-view>` can also contain their own `<router-view>` to render nested routes."
5
- },
6
- "router-link": {
7
- "attributes": [
8
- "to",
9
- "replace",
10
- "append",
11
- "tag",
12
- "active-class",
13
- "exact",
14
- "event",
15
- "exact-active-class",
16
- "aria-current-value"
17
- ],
18
- "description": "Component that renders an `<a>` with the correct `href` attribute and click listeners to trigger a local navigation when clicked. Can also customize its rendering by providing the `custom` prop and using its `k-slot` API."
19
- }
20
- }
1
+ {
2
+ "router-view": {
3
+ "attributes": ["name"],
4
+ "description": "Component that renders the matched component for the current location. Components rendered by `<router-view>` can also contain their own `<router-view>` to render nested routes."
5
+ },
6
+ "router-link": {
7
+ "attributes": [
8
+ "to",
9
+ "replace",
10
+ "append",
11
+ "tag",
12
+ "active-class",
13
+ "exact",
14
+ "event",
15
+ "exact-active-class",
16
+ "aria-current-value"
17
+ ],
18
+ "description": "Component that renders an `<a>` with the correct `href` attribute and click listeners to trigger a local navigation when clicked. Can also customize its rendering by providing the `custom` prop and using its `k-slot` API."
19
+ }
20
+ }
package/package.json CHANGED
@@ -1,111 +1,115 @@
1
- {
2
- "name": "kdu-router",
3
- "version": "3.4.0-beta.0",
4
- "description": "Official router for Kdu.js 2",
5
- "author": "NKDuy",
6
- "license": "MIT",
7
- "main": "dist/kdu-router.common.js",
8
- "module": "dist/kdu-router.esm.js",
9
- "unpkg": "dist/kdu-router.js",
10
- "jsdelivr": "dist/kdu-router.js",
11
- "sideEffects": false,
12
- "repository": {
13
- "type": "git",
14
- "url": "https://github.com/kdujs/kdu-router.git"
15
- },
16
- "typings": "types/index.d.ts",
17
- "files": [
18
- "src",
19
- "dist/*.js",
20
- "types/*.d.ts",
21
- "ketur/tags.json",
22
- "ketur/attributes.json"
23
- ],
24
- "ketur": {
25
- "tags": "ketur/tags.json",
26
- "attributes": "ketur/attributes.json"
27
- },
28
- "keywords": [
29
- "kdu",
30
- "router",
31
- "routing"
32
- ],
33
- "scripts": {
34
- "dev": "node examples/server.js",
35
- "dev:dist": "rollup -wm -c build/rollup.dev.config.js",
36
- "build": "node build/build.js",
37
- "lint": "eslint src examples test",
38
- "test": "npm run lint && npm run flow && npm run test:unit && npm run test:e2e && npm run test:types",
39
- "flow": "flow check",
40
- "test:unit": "jasmine JASMINE_CONFIG_PATH=test/unit/jasmine.json",
41
- "test:e2e": "node test/e2e/runner.js",
42
- "test:e2e:ci": "node test/e2e/runner.js --local -e ie,android44 -c test/e2e/nightwatch.browserstack.js test/e2e/specs/active-links.js",
43
- "test:e2e:ff": "node test/e2e/runner.js -e firefox -c test/e2e/nightwatch.config.js",
44
- "test:e2e:ie9": "node test/e2e/runner.js --local -e ie9 -c test/e2e/nightwatch.browserstack.js --skiptags history,ie9-fail",
45
- "test:types": "tsc -p types/test",
46
- "docs": "kdupress dev docs",
47
- "docs:build": "kdupress build docs",
48
- "changelog": "conventional-changelog -p angular -r 2 -i CHANGELOG.md -s",
49
- "release": "bash scripts/release.sh"
50
- },
51
- "gitHooks": {
52
- "pre-commit": "lint-staged",
53
- "commit-msg": "node scripts/verifyCommitMsg.js"
54
- },
55
- "lint-staged": {
56
- "*.{js,kdu}": [
57
- "eslint --fix",
58
- "git add"
59
- ]
60
- },
61
- "devDependencies": {
62
- "axios": "^0.19.0",
63
- "babel-core": "^6.24.1",
64
- "babel-eslint": "^10.0.2",
65
- "babel-loader": "^7.1.3",
66
- "babel-plugin-syntax-dynamic-import": "^6.18.0",
67
- "babel-preset-env": "^1.6.1",
68
- "babel-preset-flow-kdu": "^1.0.0",
69
- "browserstack-local": "^1.4.0",
70
- "buble": "^0.19.8",
71
- "chromedriver": "^83.0.0",
72
- "conventional-changelog-cli": "^2.0.11",
73
- "cross-spawn": "^6.0.5",
74
- "css-loader": "^2.1.1",
75
- "dotenv": "^8.0.0",
76
- "es6-promise": "^4.2.8",
77
- "eslint": "^4.19.1",
78
- "eslint-plugin-flowtype": "^2.46.1",
79
- "eslint-plugin-jasmine": "^2.10.1",
80
- "eslint-plugin-kdu-libs": "^3.0.0",
81
- "express": "^4.17.1",
82
- "express-urlrewrite": "^1.2.0",
83
- "flow-bin": "^0.66.0",
84
- "geckodriver": "^1.19.1",
85
- "jasmine": "2.8.0",
86
- "kdu": "^2.5.16-alpha.0",
87
- "kdu-loader": "^15.2.1-beta.0",
88
- "kdu-template-compiler": "^2.5.16-alpha.0",
89
- "lint-staged": "^8.2.0",
90
- "nightwatch": "^1.3.6",
91
- "nightwatch-helpers": "^1.0.0",
92
- "path-to-regexp": "^1.8.0",
93
- "rollup": "^1.20.1",
94
- "rollup-plugin-buble": "^0.19.8",
95
- "rollup-plugin-commonjs": "^10.0.2",
96
- "rollup-plugin-flow-no-whitespace": "^1.0.0",
97
- "rollup-plugin-node-resolve": "^5.2.0",
98
- "rollup-plugin-replace": "^2.0.0",
99
- "rollup-watch": "^4.0.0",
100
- "selenium-server": "^3.141.59",
101
- "terser": "^4.2.0",
102
- "typescript": "^3.5.2",
103
- "webpack": "^4.35.2",
104
- "webpack-dev-middleware": "^3.7.0",
105
- "yorkie": "^2.0.0"
106
- },
107
- "bugs": {
108
- "url": "https://github.com/kdujs/kdu-router/issues"
109
- },
110
- "homepage": "https://github.com/kdujs/kdu-router#readme"
111
- }
1
+ {
2
+ "name": "kdu-router",
3
+ "version": "3.6.0",
4
+ "description": "Official router for Kdu.js 2",
5
+ "author": "NKDuy",
6
+ "license": "MIT",
7
+ "main": "dist/kdu-router.common.js",
8
+ "module": "dist/kdu-router.esm.js",
9
+ "unpkg": "dist/kdu-router.js",
10
+ "jsdelivr": "dist/kdu-router.js",
11
+ "sideEffects": false,
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/kdujs/kdu-router.git"
15
+ },
16
+ "typings": "types/index.d.ts",
17
+ "files": [
18
+ "src",
19
+ "dist/*.js",
20
+ "dist/*.mjs",
21
+ "types/*.d.ts",
22
+ "ketur/tags.json",
23
+ "ketur/attributes.json"
24
+ ],
25
+ "exports": {
26
+ ".": {
27
+ "import": {
28
+ "node": "./dist/kdu-router.mjs",
29
+ "default": "./dist/kdu-router.esm.js"
30
+ },
31
+ "require": "./dist/kdu-router.common.js",
32
+ "types": "./types/index.d.ts"
33
+ },
34
+ "./composables": {
35
+ "import": "./dist/composables.mjs",
36
+ "require": "./dist/composables.js",
37
+ "types": "./types/composables.d.ts"
38
+ },
39
+ "./dist/*": "./dist/*",
40
+ "./types/*": "./types/*",
41
+ "./package.json": "./package.json"
42
+ },
43
+ "ketur": {
44
+ "tags": "ketur/tags.json",
45
+ "attributes": "ketur/attributes.json"
46
+ },
47
+ "keywords": [
48
+ "kdu",
49
+ "router",
50
+ "routing"
51
+ ],
52
+ "scripts": {
53
+ "dev:dist": "rollup -wm -c build/rollup.dev.config.js",
54
+ "build": "node build/build.js",
55
+ "lint": "eslint src",
56
+ "docs": "kdupress dev docs",
57
+ "docs:build": "kdupress build docs",
58
+ "docs:deploy": "yarn docs:build && firebase deploy",
59
+ "release": "bash scripts/release.sh",
60
+ "commit": "git-cz"
61
+ },
62
+ "gitHooks": {
63
+ "commit-msg": "node scripts/verifyCommitMsg.js"
64
+ },
65
+ "devDependencies": {
66
+ "@kdupress/plugin-pwa": "^1.8.0",
67
+ "@kdupress/theme-kdu": "^1.8.0",
68
+ "@rollup/plugin-commonjs": "^17.0.0",
69
+ "@rollup/plugin-node-resolve": "^11.0.0",
70
+ "axios": "^0.21.1",
71
+ "babel-core": "^6.24.1",
72
+ "babel-eslint": "^10.0.2",
73
+ "babel-loader": "^7.1.3",
74
+ "babel-plugin-syntax-dynamic-import": "^6.18.0",
75
+ "babel-preset-env": "^1.6.1",
76
+ "babel-preset-flow-kdu": "^1.0.0",
77
+ "browserstack-local": "^1.4.8",
78
+ "buble": "^0.19.8",
79
+ "chromedriver": "^96.0.0",
80
+ "cross-spawn": "^7.0.3",
81
+ "css-loader": "^2.1.1",
82
+ "dotenv": "^8.2.0",
83
+ "es6-promise": "^4.2.8",
84
+ "eslint": "^4.19.1",
85
+ "eslint-plugin-flowtype": "^2.46.1",
86
+ "eslint-plugin-jasmine": "^2.10.1",
87
+ "eslint-plugin-kdu-libs": "^2.1.0",
88
+ "express": "^4.17.1",
89
+ "express-urlrewrite": "^1.2.0",
90
+ "flow-bin": "^0.66.0",
91
+ "geckodriver": "^1.20.0",
92
+ "jasmine": "2.8.0",
93
+ "kdu": "^2.7.0",
94
+ "kdupress": "^1.8.0",
95
+ "lint-staged": "^8.2.0",
96
+ "nightwatch": "^1.3.6",
97
+ "nightwatch-helpers": "^1.0.0",
98
+ "path-to-regexp": "^1.8.0",
99
+ "rollup": "^2.34.1",
100
+ "rollup-plugin-buble": "^0.19.8",
101
+ "rollup-plugin-flow-no-whitespace": "^1.0.0",
102
+ "rollup-plugin-replace": "^2.0.0",
103
+ "rollup-watch": "^4.0.0",
104
+ "selenium-server": "^3.141.59",
105
+ "terser": "^4.2.0",
106
+ "typescript": "^4.7.0",
107
+ "webpack": "^4.35.2",
108
+ "webpack-dev-middleware": "^3.7.0",
109
+ "yorkie": "^2.0.0"
110
+ },
111
+ "bugs": {
112
+ "url": "https://github.com/kdujs/kdu-router/issues"
113
+ },
114
+ "homepage": "https://github.com/kdujs/kdu-router#readme"
115
+ }