@angular/router 6.1.6 → 6.1.10
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.
- package/bundles/router-testing.umd.js +37 -26
- package/bundles/router-testing.umd.js.map +1 -1
- package/bundles/router-testing.umd.min.js +4 -4
- package/bundles/router-testing.umd.min.js.map +1 -1
- package/bundles/router-upgrade.umd.js +1 -1
- package/bundles/router-upgrade.umd.min.js +1 -1
- package/bundles/router-upgrade.umd.min.js.map +1 -1
- package/bundles/router.umd.js +214 -126
- package/bundles/router.umd.js.map +1 -1
- package/bundles/router.umd.min.js +19 -19
- package/bundles/router.umd.min.js.map +1 -1
- package/esm2015/src/config.js +1 -1
- package/esm2015/src/router.js +36 -12
- package/esm2015/src/router_module.js +2 -1
- package/esm2015/src/router_state.js +3 -1
- package/esm2015/src/url_tree.js +4 -2
- package/esm2015/src/version.js +1 -1
- package/esm2015/testing/src/router_testing_module.js +2 -1
- package/esm5/src/components/empty_outlet.js +5 -4
- package/esm5/src/config.js +1 -1
- package/esm5/src/directives/router_link.js +100 -45
- package/esm5/src/directives/router_link_active.js +27 -20
- package/esm5/src/directives/router_outlet.js +16 -16
- package/esm5/src/router.js +30 -11
- package/esm5/src/router_module.js +20 -22
- package/esm5/src/router_preloader.js +6 -12
- package/esm5/src/router_state.js +3 -1
- package/esm5/src/url_tree.js +4 -2
- package/esm5/src/version.js +1 -1
- package/esm5/testing/src/router_testing_module.js +26 -26
- package/fesm2015/router.js +39 -14
- package/fesm2015/router.js.map +1 -1
- package/fesm2015/testing.js +2 -1
- package/fesm2015/testing.js.map +1 -1
- package/fesm2015/upgrade.js +1 -1
- package/fesm5/router.js +201 -128
- package/fesm5/router.js.map +1 -1
- package/fesm5/testing.js +27 -27
- package/fesm5/testing.js.map +1 -1
- package/fesm5/upgrade.js +1 -1
- package/package.json +4 -4
- package/router.metadata.json +1 -1
- package/src/config.d.ts +1 -0
- package/src/router.d.ts +21 -8
- package/src/router_module.d.ts +1 -0
- package/src/router_state.d.ts +2 -0
- package/src/url_tree.d.ts +3 -1
- package/testing/src/router_testing_module.d.ts +1 -0
- package/testing/testing.metadata.json +1 -1
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v6.1.
|
|
2
|
+
* @license Angular v6.1.10
|
|
3
3
|
* (c) 2010-2018 Google, Inc. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("@angular/common"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define("@angular/router",["exports","@angular/core","rxjs","rxjs/operators","@angular/common","@angular/platform-browser"],e):e((t.ng=t.ng||{},t.ng.router={}),t.ng.core,t.rxjs,t.rxjs.operators,t.ng.common,t.ng.platformBrowser)}(this,function(t,e,r,n,o,i){"use strict";var a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function u(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var s=function(){return(s=Object.assign||function t(e){for(var r,n=1,o=arguments.length;n<o;n++)for(var i in r=arguments[n])Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i]);return e}).apply(this,arguments)};function c(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function
|
|
6
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("@angular/common"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define("@angular/router",["exports","@angular/core","rxjs","rxjs/operators","@angular/common","@angular/platform-browser"],e):e((t.ng=t.ng||{},t.ng.router={}),t.ng.core,t.rxjs,t.rxjs.operators,t.ng.common,t.ng.platformBrowser)}(this,function(t,e,r,n,o,i){"use strict";var a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function u(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var s=function(){return(s=Object.assign||function t(e){for(var r,n=1,o=arguments.length;n<o;n++)for(var i in r=arguments[n])Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i]);return e}).apply(this,arguments)};function c(t,e,r,n){var o,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function l(t,e){return function(r,n){e(r,n,t)}}function p(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function h(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function f(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function d(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(f(arguments[e]));return t}
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright Google Inc. All Rights Reserved.
|
|
10
10
|
*
|
|
11
11
|
* Use of this source code is governed by an MIT-style license that can be
|
|
12
12
|
* found in the LICENSE file at https://angular.io/license
|
|
13
|
-
*/var
|
|
13
|
+
*/var g,v=function(t){function e(e,r,n,o){void 0===n&&(n="imperative"),void 0===o&&(o=null);var i=t.call(this,e,r)||this;return i.navigationTrigger=n,i.restoredState=o,i}return u(e,t),e.prototype.toString=function(){return"NavigationStart(id: "+this.id+", url: '"+this.url+"')"},e}(g=function g(t,e){this.id=t,this.url=e}),m=function(t){function e(e,r,n){var o=t.call(this,e,r)||this;return o.urlAfterRedirects=n,o}return u(e,t),e.prototype.toString=function(){return"NavigationEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"')"},e}(g),y=function(t){function e(e,r,n){var o=t.call(this,e,r)||this;return o.reason=n,o}return u(e,t),e.prototype.toString=function(){return"NavigationCancel(id: "+this.id+", url: '"+this.url+"')"},e}(g),S=function(t){function e(e,r,n){var o=t.call(this,e,r)||this;return o.error=n,o}return u(e,t),e.prototype.toString=function(){return"NavigationError(id: "+this.id+", url: '"+this.url+"', error: "+this.error+")"},e}(g),w=function(t){function e(e,r,n,o){var i=t.call(this,e,r)||this;return i.urlAfterRedirects=n,i.state=o,i}return u(e,t),e.prototype.toString=function(){return"RoutesRecognized(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},e}(g),b=function(t){function e(e,r,n,o){var i=t.call(this,e,r)||this;return i.urlAfterRedirects=n,i.state=o,i}return u(e,t),e.prototype.toString=function(){return"GuardsCheckStart(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},e}(g),C=function(t){function e(e,r,n,o,i){var a=t.call(this,e,r)||this;return a.urlAfterRedirects=n,a.state=o,a.shouldActivate=i,a}return u(e,t),e.prototype.toString=function(){return"GuardsCheckEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+", shouldActivate: "+this.shouldActivate+")"},e}(g),R=function(t){function e(e,r,n,o){var i=t.call(this,e,r)||this;return i.urlAfterRedirects=n,i.state=o,i}return u(e,t),e.prototype.toString=function(){return"ResolveStart(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},e}(g),P=function(t){function e(e,r,n,o){var i=t.call(this,e,r)||this;return i.urlAfterRedirects=n,i.state=o,i}return u(e,t),e.prototype.toString=function(){return"ResolveEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},e}(g),O=function(){function t(t){this.route=t}return t.prototype.toString=function(){return"RouteConfigLoadStart(path: "+this.route.path+")"},t}(),A=function(){function t(t){this.route=t}return t.prototype.toString=function(){return"RouteConfigLoadEnd(path: "+this.route.path+")"},t}(),_=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ChildActivationStart(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),U=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ChildActivationEnd(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),E=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ActivationStart(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),x=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ActivationEnd(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),T=function(){function t(t,e,r){this.routerEvent=t,this.position=e,this.anchor=r}return t.prototype.toString=function(){return"Scroll(anchor: '"+this.anchor+"', position: '"+(this.position?this.position[0]+", "+this.position[1]:null)+"')"},t}(),I=function(){return c([e.Component({template:"<router-outlet></router-outlet>"})],function t(){})}(),j="primary",k=function(){function t(t){this.params=t||{}}return t.prototype.has=function(t){return this.params.hasOwnProperty(t)},t.prototype.get=function(t){if(this.has(t)){var e=this.params[t];return Array.isArray(e)?e[0]:e}return null},t.prototype.getAll=function(t){if(this.has(t)){var e=this.params[t];return Array.isArray(e)?e:[e]}return[]},Object.defineProperty(t.prototype,"keys",{get:function(){return Object.keys(this.params)},enumerable:!0,configurable:!0}),t}();function L(t){return new k(t)}function M(t,e,r){var n=r.path.split("/");if(n.length>t.length)return null;if("full"===r.pathMatch&&(e.hasChildren()||n.length<t.length))return null;for(var o={},i=0;i<n.length;i++){var a=n[i],u=t[i];if(a.startsWith(":"))o[a.substring(1)]=u;else if(a!==u.path)return null}return{consumed:t.slice(0,n.length),posParams:o}}
|
|
14
14
|
/**
|
|
15
15
|
* @license
|
|
16
16
|
* Copyright Google Inc. All Rights Reserved.
|
|
17
17
|
*
|
|
18
18
|
* Use of this source code is governed by an MIT-style license that can be
|
|
19
19
|
* found in the LICENSE file at https://angular.io/license
|
|
20
|
-
*/var
|
|
20
|
+
*/var N=function N(t,e){this.routes=t,this.module=e};function D(t,e){void 0===e&&(e="");for(var r=0;r<t.length;r++){var n=t[r];q(n,z(e,n))}}function q(t,e){if(!t)throw new Error("\n Invalid configuration of route '"+e+"': Encountered undefined route.\n The reason might be an extra comma.\n\n Example:\n const routes: Routes = [\n { path: '', redirectTo: '/dashboard', pathMatch: 'full' },\n { path: 'dashboard', component: DashboardComponent },, << two commas\n { path: 'detail/:id', component: HeroDetailComponent }\n ];\n ");if(Array.isArray(t))throw new Error("Invalid configuration of route '"+e+"': Array cannot be specified");if(!t.component&&!t.children&&!t.loadChildren&&t.outlet&&t.outlet!==j)throw new Error("Invalid configuration of route '"+e+"': a componentless route without children or loadChildren cannot have a named outlet set");if(t.redirectTo&&t.children)throw new Error("Invalid configuration of route '"+e+"': redirectTo and children cannot be used together");if(t.redirectTo&&t.loadChildren)throw new Error("Invalid configuration of route '"+e+"': redirectTo and loadChildren cannot be used together");if(t.children&&t.loadChildren)throw new Error("Invalid configuration of route '"+e+"': children and loadChildren cannot be used together");if(t.redirectTo&&t.component)throw new Error("Invalid configuration of route '"+e+"': redirectTo and component cannot be used together");if(t.path&&t.matcher)throw new Error("Invalid configuration of route '"+e+"': path and matcher cannot be used together");if(void 0===t.redirectTo&&!t.component&&!t.children&&!t.loadChildren)throw new Error("Invalid configuration of route '"+e+"'. One of the following must be provided: component, redirectTo, children or loadChildren");if(void 0===t.path&&void 0===t.matcher)throw new Error("Invalid configuration of route '"+e+"': routes must have either a path or a matcher specified");if("string"==typeof t.path&&"/"===t.path.charAt(0))throw new Error("Invalid configuration of route '"+e+"': path cannot start with a slash");if(""===t.path&&void 0!==t.redirectTo&&void 0===t.pathMatch)throw new Error("Invalid configuration of route '{path: \""+e+'", redirectTo: "'+t.redirectTo+"\"}': please provide 'pathMatch'. The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.");if(void 0!==t.pathMatch&&"full"!==t.pathMatch&&"prefix"!==t.pathMatch)throw new Error("Invalid configuration of route '"+e+"': pathMatch can only be set to 'prefix' or 'full'");t.children&&D(t.children,e)}function z(t,e){return e?t||e.path?t&&!e.path?t+"/":!t&&e.path?e.path:t+"/"+e.path:"":t}function H(t){var e=t.children&&t.children.map(H),r=e?s({},t,{children:e}):s({},t);return!r.component&&(e||r.loadChildren)&&r.outlet&&r.outlet!==j&&(r.component=I),r}
|
|
21
21
|
/**
|
|
22
22
|
* @license
|
|
23
23
|
* Copyright Google Inc. All Rights Reserved.
|
|
24
24
|
*
|
|
25
25
|
* Use of this source code is governed by an MIT-style license that can be
|
|
26
26
|
* found in the LICENSE file at https://angular.io/license
|
|
27
|
-
*/function
|
|
27
|
+
*/function G(t,e){var r,n=Object.keys(t),o=Object.keys(e);if(n.length!=o.length)return!1;for(var i=0;i<n.length;i++)if(t[r=n[i]]!==e[r])return!1;return!0}function F(t){return Array.prototype.concat.apply([],t)}function B(t){return t.length>0?t[t.length-1]:null}function W(t,e){for(var r in t)t.hasOwnProperty(r)&&e(t[r],r)}function Q(t){return t.pipe(n.mergeAll(),n.every(function(t){return!0===t}))}function Z(t){return e.ɵisObservable(t)?t:e.ɵisPromise(t)?r.from(Promise.resolve(t)):r.of(t)}
|
|
28
28
|
/**
|
|
29
29
|
* @license
|
|
30
30
|
* Copyright Google Inc. All Rights Reserved.
|
|
31
31
|
*
|
|
32
32
|
* Use of this source code is governed by an MIT-style license that can be
|
|
33
33
|
* found in the LICENSE file at https://angular.io/license
|
|
34
|
-
*/function B(t,e,r){return r?function n(t,e){return q(t,e)}(t.queryParams,e.queryParams)&&function t(e,r){if(!Z(e.segments,r.segments))return!1;if(e.numberOfChildren!==r.numberOfChildren)return!1;for(var n in r.children){if(!e.children[n])return!1;if(!t(e.children[n],r.children[n]))return!1}return!0}(t.root,e.root):function o(t,e){return Object.keys(e).length<=Object.keys(t).length&&Object.keys(e).every(function(r){return e[r]===t[r]})}(t.queryParams,e.queryParams)&&function t(e,r){return function e(r,n,o){if(r.segments.length>o.length)return!!Z(a=r.segments.slice(0,o.length),o)&&!n.hasChildren();if(r.segments.length===o.length){if(!Z(r.segments,o))return!1;for(var i in n.children){if(!r.children[i])return!1;if(!t(r.children[i],n.children[i]))return!1}return!0}var a=o.slice(0,r.segments.length),u=o.slice(r.segments.length);return!!Z(r.segments,a)&&!!r.children[x]&&e(r.children[x],n,u)}(e,r,r.segments)}(t.root,e.root)}var Q=function(){function t(t,e,r){this.root=t,this.queryParams=e,this.fragment=r}return Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=I(this.queryParams)),this._queryParamMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return X.serialize(this)},t}(),V=function(){function t(t,e){var r=this;this.segments=t,this.children=e,this.parent=null,G(e,function(t,e){return t.parent=r})}return t.prototype.hasChildren=function(){return this.numberOfChildren>0},Object.defineProperty(t.prototype,"numberOfChildren",{get:function(){return Object.keys(this.children).length},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return tt(this)},t}(),$=function(){function t(t,e){this.path=t,this.parameters=e}return Object.defineProperty(t.prototype,"parameterMap",{get:function(){return this._parameterMap||(this._parameterMap=I(this.parameters)),this._parameterMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return at(this)},t}();function Z(t,e){return t.length===e.length&&t.every(function(t,r){return t.path===e[r].path})}function K(t,e){var r=[];return G(t.children,function(t,n){n===x&&(r=r.concat(e(t,n)))}),G(t.children,function(t,n){n!==x&&(r=r.concat(e(t,n)))}),r}var Y=function Y(){},J=function(){function t(){}return t.prototype.parse=function(t){var e=new ht(t);return new Q(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())},t.prototype.serialize=function(t){return"/"+function t(e,r){if(!e.hasChildren())return tt(e);if(r){var n=e.children[x]?t(e.children[x],!1):"",o=[];return G(e.children,function(e,r){r!==x&&o.push(r+":"+t(e,!1))}),o.length>0?n+"("+o.join("//")+")":n}var i=K(e,function(r,n){return n===x?[t(e.children[x],!1)]:[n+":"+t(r,!1)]});return tt(e)+"/("+i.join("//")+")"}(t.root,!0)+function e(t){var e=Object.keys(t).map(function(e){var r=t[e];return Array.isArray(r)?r.map(function(t){return rt(e)+"="+rt(t)}).join("&"):rt(e)+"="+rt(r)});return e.length?"?"+e.join("&"):""}(t.queryParams)+("string"==typeof t.fragment?"#"+function r(t){return encodeURI(t)}(t.fragment):"")},t}(),X=new J;function tt(t){return t.segments.map(function(t){return at(t)}).join("/")}function et(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function rt(t){return et(t).replace(/%3B/gi,";")}function nt(t){return et(t).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function ot(t){return decodeURIComponent(t)}function it(t){return ot(t.replace(/\+/g,"%20"))}function at(t){return""+nt(t.path)+function e(t){return Object.keys(t).map(function(e){return";"+nt(e)+"="+nt(t[e])}).join("")}(t.parameters)}var ut=/^[^\/()?;=#]+/;function st(t){var e=t.match(ut);return e?e[0]:""}var ct=/^[^=?&#]+/,lt=/^[^?&#]+/,ht=function(){function t(t){this.url=t,this.remaining=t}return t.prototype.parseRootSegment=function(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new V([],{}):new V([],this.parseChildren())},t.prototype.parseQueryParams=function(){var t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t},t.prototype.parseFragment=function(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null},t.prototype.parseChildren=function(){if(""===this.remaining)return{};this.consumeOptional("/");var t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());var e={};this.peekStartsWith("/(")&&(this.capture("/"),e=this.parseParens(!0));var r={};return this.peekStartsWith("(")&&(r=this.parseParens(!1)),(t.length>0||Object.keys(e).length>0)&&(r[x]=new V(t,e)),r},t.prototype.parseSegment=function(){var t=st(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new Error("Empty path url segment cannot have parameters: '"+this.remaining+"'.");return this.capture(t),new $(ot(t),this.parseMatrixParams())},t.prototype.parseMatrixParams=function(){for(var t={};this.consumeOptional(";");)this.parseParam(t);return t},t.prototype.parseParam=function(t){var e=st(this.remaining);if(e){this.capture(e);var r="";if(this.consumeOptional("=")){var n=st(this.remaining);n&&this.capture(r=n)}t[ot(e)]=ot(r)}},t.prototype.parseQueryParam=function(t){var e=function r(t){var e=t.match(ct);return e?e[0]:""}(this.remaining);if(e){this.capture(e);var n="";if(this.consumeOptional("=")){var o=function i(t){var e=t.match(lt);return e?e[0]:""}(this.remaining);o&&this.capture(n=o)}var a=it(e),u=it(n);if(t.hasOwnProperty(a)){var s=t[a];Array.isArray(s)||(t[a]=s=[s]),s.push(u)}else t[a]=u}},t.prototype.parseParens=function(t){var e={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){var r=st(this.remaining),n=this.remaining[r.length];if("/"!==n&&")"!==n&&";"!==n)throw new Error("Cannot parse url '"+this.url+"'");var o=void 0;r.indexOf(":")>-1?(o=r.substr(0,r.indexOf(":")),this.capture(o),this.capture(":")):t&&(o=x);var i=this.parseChildren();e[o]=1===Object.keys(i).length?i[x]:new V([],i),this.consumeOptional("//")}return e},t.prototype.peekStartsWith=function(t){return this.remaining.startsWith(t)},t.prototype.consumeOptional=function(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)},t.prototype.capture=function(t){if(!this.consumeOptional(t))throw new Error('Expected "'+t+'".')},t}(),pt=function pt(t){this.segmentGroup=t||null},ft=function ft(t){this.urlTree=t};function dt(t){return new r.Observable(function(e){return e.error(new pt(t))})}function gt(t){return new r.Observable(function(e){return e.error(new ft(t))})}function vt(t){return new r.Observable(function(e){return e.error(new Error("Only absolute redirects can have named outlets. redirectTo: '"+t+"'"))})}var mt=function(){function t(t,r,n,o,i){this.configLoader=r,this.urlSerializer=n,this.urlTree=o,this.config=i,this.allowRedirects=!0,this.ngModule=t.get(e.NgModuleRef)}return t.prototype.apply=function(){var t=this;return this.expandSegmentGroup(this.ngModule,this.config,this.urlTree.root,x).pipe(n.map(function(e){return t.createUrlTree(e,t.urlTree.queryParams,t.urlTree.fragment)})).pipe(n.catchError(function(e){if(e instanceof ft)return t.allowRedirects=!1,t.match(e.urlTree);if(e instanceof pt)throw t.noMatchError(e);throw e}))},t.prototype.match=function(t){var e=this;return this.expandSegmentGroup(this.ngModule,this.config,t.root,x).pipe(n.map(function(r){return e.createUrlTree(r,t.queryParams,t.fragment)})).pipe(n.catchError(function(t){if(t instanceof pt)throw e.noMatchError(t);throw t}))},t.prototype.noMatchError=function(t){return new Error("Cannot match any routes. URL Segment: '"+t.segmentGroup+"'")},t.prototype.createUrlTree=function(t,e,r){var n,o=t.segments.length>0?new V([],((n={})[x]=t,n)):t;return new Q(o,e,r)},t.prototype.expandSegmentGroup=function(t,e,r,o){return 0===r.segments.length&&r.hasChildren()?this.expandChildren(t,e,r).pipe(n.map(function(t){return new V([],t)})):this.expandSegment(t,r,e,r.segments,o,!0)},t.prototype.expandChildren=function(t,e,o){var i=this;return function a(t,e){if(0===Object.keys(t).length)return r.of({});var o=[],i=[],a={};return G(t,function(t,r){var u=e(r,t).pipe(n.map(function(t){return a[r]=t}));r===x?o.push(u):i.push(u)}),r.of.apply(null,o.concat(i)).pipe(n.concatAll(),n.last(),n.map(function(){return a}))}(o.children,function(r,n){return i.expandSegmentGroup(t,e,n,r)})},t.prototype.expandSegment=function(t,e,o,i,a,u){var s=this;return r.of.apply(void 0,h(o)).pipe(n.map(function(c){return s.expandSegmentAgainstRoute(t,e,o,c,i,a,u).pipe(n.catchError(function(t){if(t instanceof pt)return r.of(null);throw t}))}),n.concatAll(),n.first(function(t){return!!t}),n.catchError(function(t,n){if(t instanceof r.EmptyError||"EmptyError"===t.name){if(s.noLeftoversInUrl(e,i,a))return r.of(new V([],{}));throw new pt(e)}throw t}))},t.prototype.noLeftoversInUrl=function(t,e,r){return 0===e.length&&!t.children[r]},t.prototype.expandSegmentAgainstRoute=function(t,e,r,n,o,i,a){return Ct(n)!==i?dt(e):void 0===n.redirectTo?this.matchSegmentAgainstRoute(t,e,n,o):a&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(t,e,r,n,o,i):dt(e)},t.prototype.expandSegmentAgainstRouteUsingRedirect=function(t,e,r,n,o,i){return"**"===n.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(t,r,n,i):this.expandRegularSegmentAgainstRouteUsingRedirect(t,e,r,n,o,i)},t.prototype.expandWildCardWithParamsAgainstRouteUsingRedirect=function(t,e,r,o){var i=this,a=this.applyRedirectCommands([],r.redirectTo,{});return r.redirectTo.startsWith("/")?gt(a):this.lineralizeSegments(r,a).pipe(n.mergeMap(function(r){var n=new V(r,{});return i.expandSegment(t,n,e,r,o,!1)}))},t.prototype.expandRegularSegmentAgainstRouteUsingRedirect=function(t,e,r,o,i,a){var u=this,s=yt(e,o,i),c=s.consumedSegments,l=s.lastChild,h=s.positionalParamSegments;if(!s.matched)return dt(e);var p=this.applyRedirectCommands(c,o.redirectTo,h);return o.redirectTo.startsWith("/")?gt(p):this.lineralizeSegments(o,p).pipe(n.mergeMap(function(n){return u.expandSegment(t,e,r,n.concat(i.slice(l)),a,!1)}))},t.prototype.matchSegmentAgainstRoute=function(t,e,o,i){var a=this;if("**"===o.path)return o.loadChildren?this.configLoader.load(t.injector,o).pipe(n.map(function(t){return o._loadedConfig=t,new V(i,{})})):r.of(new V(i,{}));var u=yt(e,o,i),l=u.consumedSegments,h=u.lastChild;if(!u.matched)return dt(e);var p=i.slice(h);return this.getChildConfig(t,o).pipe(n.mergeMap(function(t){var o=t.module,i=t.routes,u=function h(t,e,r,n){return r.length>0&&function o(t,e,r){return r.some(function(r){return wt(t,e,r)&&Ct(r)!==x})}(t,r,n)?{segmentGroup:St(new V(e,function i(t,e){var r,n,o={};o[x]=e;try{for(var i=c(t),a=i.next();!a.done;a=i.next()){var u=a.value;""===u.path&&Ct(u)!==x&&(o[Ct(u)]=new V([],{}))}}catch(t){r={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return o}(n,new V(r,t.children)))),slicedSegments:[]}:0===r.length&&function a(t,e,r){return r.some(function(r){return wt(t,e,r)})}(t,r,n)?{segmentGroup:St(new V(t.segments,function u(t,e,r,n){var o,i,a={};try{for(var u=c(r),l=u.next();!l.done;l=u.next()){var h=l.value;wt(t,e,h)&&!n[Ct(h)]&&(a[Ct(h)]=new V([],{}))}}catch(t){o={error:t}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}return s({},n,a)}(t,r,n,t.children))),slicedSegments:r}:{segmentGroup:t,slicedSegments:r}}(e,l,p,i),f=u.segmentGroup,d=u.slicedSegments;return 0===d.length&&f.hasChildren()?a.expandChildren(o,i,f).pipe(n.map(function(t){return new V(l,t)})):0===i.length&&0===d.length?r.of(new V(l,{})):a.expandSegment(o,f,i,d,x,!0).pipe(n.map(function(t){return new V(l.concat(t.segments),t.children)}))}))},t.prototype.getChildConfig=function(t,e){var o=this;return e.children?r.of(new j(e.children,t)):e.loadChildren?void 0!==e._loadedConfig?r.of(e._loadedConfig):function i(t,e){var o=e.canLoad;return o&&0!==o.length?F(r.from(o).pipe(n.map(function(r){var n=t.get(r);return W(n.canLoad?n.canLoad(e):n(e))}))):r.of(!0)}(t.injector,e).pipe(n.mergeMap(function(i){return i?o.configLoader.load(t.injector,e).pipe(n.map(function(t){return e._loadedConfig=t,t})):function a(t){return new r.Observable(function(e){return e.error(function r(t){var e=Error("NavigationCancelingError: "+t);return e.ngNavigationCancelingError=!0,e}("Cannot load children because the guard of the route \"path: '"+t.path+"'\" returned false"))})}(e)})):r.of(new j([],t))},t.prototype.lineralizeSegments=function(t,e){for(var n=[],o=e.root;;){if(n=n.concat(o.segments),0===o.numberOfChildren)return r.of(n);if(o.numberOfChildren>1||!o.children[x])return vt(t.redirectTo);o=o.children[x]}},t.prototype.applyRedirectCommands=function(t,e,r){return this.applyRedirectCreatreUrlTree(e,this.urlSerializer.parse(e),t,r)},t.prototype.applyRedirectCreatreUrlTree=function(t,e,r,n){var o=this.createSegmentGroup(t,e.root,r,n);return new Q(o,this.createQueryParams(e.queryParams,this.urlTree.queryParams),e.fragment)},t.prototype.createQueryParams=function(t,e){var r={};return G(t,function(t,n){if("string"==typeof t&&t.startsWith(":")){var o=t.substring(1);r[n]=e[o]}else r[n]=t}),r},t.prototype.createSegmentGroup=function(t,e,r,n){var o=this,i=this.createSegments(t,e.segments,r,n),a={};return G(e.children,function(e,i){a[i]=o.createSegmentGroup(t,e,r,n)}),new V(i,a)},t.prototype.createSegments=function(t,e,r,n){var o=this;return e.map(function(e){return e.path.startsWith(":")?o.findPosParam(t,e,n):o.findOrReturn(e,r)})},t.prototype.findPosParam=function(t,e,r){var n=r[e.path.substring(1)];if(!n)throw new Error("Cannot redirect to '"+t+"'. Cannot find '"+e.path+"'.");return n},t.prototype.findOrReturn=function(t,e){var r,n,o=0;try{for(var i=c(e),a=i.next();!a.done;a=i.next()){var u=a.value;if(u.path===t.path)return e.splice(o),u;o++}}catch(t){r={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return t},t}();function yt(t,e,r){if(""===e.path)return"full"===e.pathMatch&&(t.hasChildren()||r.length>0)?{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}:{matched:!0,consumedSegments:[],lastChild:0,positionalParamSegments:{}};var n=(e.matcher||k)(r,t,e);return n?{matched:!0,consumedSegments:n.consumed,lastChild:n.consumed.length,positionalParamSegments:n.posParams}:{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}}function St(t){if(1===t.numberOfChildren&&t.children[x]){var e=t.children[x];return new V(t.segments.concat(e.segments),e.children)}return t}function wt(t,e,r){return(!(t.hasChildren()||e.length>0)||"full"!==r.pathMatch)&&""===r.path&&void 0!==r.redirectTo}function Ct(t){return t.outlet||x}
|
|
34
|
+
*/function V(t,e,r){return r?function n(t,e){return G(t,e)}(t.queryParams,e.queryParams)&&function t(e,r){if(!J(e.segments,r.segments))return!1;if(e.numberOfChildren!==r.numberOfChildren)return!1;for(var n in r.children){if(!e.children[n])return!1;if(!t(e.children[n],r.children[n]))return!1}return!0}(t.root,e.root):function o(t,e){return Object.keys(e).length<=Object.keys(t).length&&Object.keys(e).every(function(r){return e[r]===t[r]})}(t.queryParams,e.queryParams)&&function t(e,r){return function e(r,n,o){if(r.segments.length>o.length)return!!J(a=r.segments.slice(0,o.length),o)&&!n.hasChildren();if(r.segments.length===o.length){if(!J(r.segments,o))return!1;for(var i in n.children){if(!r.children[i])return!1;if(!t(r.children[i],n.children[i]))return!1}return!0}var a=o.slice(0,r.segments.length),u=o.slice(r.segments.length);return!!J(r.segments,a)&&!!r.children[j]&&e(r.children[j],n,u)}(e,r,r.segments)}(t.root,e.root)}var $=function(){function t(t,e,r){this.root=t,this.queryParams=e,this.fragment=r}return Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=L(this.queryParams)),this._queryParamMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return rt.serialize(this)},t}(),K=function(){function t(t,e){var r=this;this.segments=t,this.children=e,this.parent=null,W(e,function(t,e){return t.parent=r})}return t.prototype.hasChildren=function(){return this.numberOfChildren>0},Object.defineProperty(t.prototype,"numberOfChildren",{get:function(){return Object.keys(this.children).length},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return nt(this)},t}(),Y=function(){function t(t,e){this.path=t,this.parameters=e}return Object.defineProperty(t.prototype,"parameterMap",{get:function(){return this._parameterMap||(this._parameterMap=L(this.parameters)),this._parameterMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return ct(this)},t}();function J(t,e){return t.length===e.length&&t.every(function(t,r){return t.path===e[r].path})}function X(t,e){var r=[];return W(t.children,function(t,n){n===j&&(r=r.concat(e(t,n)))}),W(t.children,function(t,n){n!==j&&(r=r.concat(e(t,n)))}),r}var tt=function tt(){},et=function(){function t(){}return t.prototype.parse=function(t){var e=new dt(t);return new $(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())},t.prototype.serialize=function(t){return"/"+function t(e,r){if(!e.hasChildren())return nt(e);if(r){var n=e.children[j]?t(e.children[j],!1):"",o=[];return W(e.children,function(e,r){r!==j&&o.push(r+":"+t(e,!1))}),o.length>0?n+"("+o.join("//")+")":n}var i=X(e,function(r,n){return n===j?[t(e.children[j],!1)]:[n+":"+t(r,!1)]});return nt(e)+"/("+i.join("//")+")"}(t.root,!0)+function e(t){var e=Object.keys(t).map(function(e){var r=t[e];return Array.isArray(r)?r.map(function(t){return it(e)+"="+it(t)}).join("&"):it(e)+"="+it(r)});return e.length?"?"+e.join("&"):""}(t.queryParams)+("string"==typeof t.fragment?"#"+function r(t){return encodeURI(t)}(t.fragment):"")},t}(),rt=new et;function nt(t){return t.segments.map(function(t){return ct(t)}).join("/")}function ot(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function it(t){return ot(t).replace(/%3B/gi,";")}function at(t){return ot(t).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function ut(t){return decodeURIComponent(t)}function st(t){return ut(t.replace(/\+/g,"%20"))}function ct(t){return""+at(t.path)+function e(t){return Object.keys(t).map(function(e){return";"+at(e)+"="+at(t[e])}).join("")}(t.parameters)}var lt=/^[^\/()?;=#]+/;function pt(t){var e=t.match(lt);return e?e[0]:""}var ht=/^[^=?&#]+/,ft=/^[^?&#]+/,dt=function(){function t(t){this.url=t,this.remaining=t}return t.prototype.parseRootSegment=function(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new K([],{}):new K([],this.parseChildren())},t.prototype.parseQueryParams=function(){var t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t},t.prototype.parseFragment=function(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null},t.prototype.parseChildren=function(){if(""===this.remaining)return{};this.consumeOptional("/");var t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());var e={};this.peekStartsWith("/(")&&(this.capture("/"),e=this.parseParens(!0));var r={};return this.peekStartsWith("(")&&(r=this.parseParens(!1)),(t.length>0||Object.keys(e).length>0)&&(r[j]=new K(t,e)),r},t.prototype.parseSegment=function(){var t=pt(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new Error("Empty path url segment cannot have parameters: '"+this.remaining+"'.");return this.capture(t),new Y(ut(t),this.parseMatrixParams())},t.prototype.parseMatrixParams=function(){for(var t={};this.consumeOptional(";");)this.parseParam(t);return t},t.prototype.parseParam=function(t){var e=pt(this.remaining);if(e){this.capture(e);var r="";if(this.consumeOptional("=")){var n=pt(this.remaining);n&&this.capture(r=n)}t[ut(e)]=ut(r)}},t.prototype.parseQueryParam=function(t){var e=function r(t){var e=t.match(ht);return e?e[0]:""}(this.remaining);if(e){this.capture(e);var n="";if(this.consumeOptional("=")){var o=function i(t){var e=t.match(ft);return e?e[0]:""}(this.remaining);o&&this.capture(n=o)}var a=st(e),u=st(n);if(t.hasOwnProperty(a)){var s=t[a];Array.isArray(s)||(t[a]=s=[s]),s.push(u)}else t[a]=u}},t.prototype.parseParens=function(t){var e={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){var r=pt(this.remaining),n=this.remaining[r.length];if("/"!==n&&")"!==n&&";"!==n)throw new Error("Cannot parse url '"+this.url+"'");var o=void 0;r.indexOf(":")>-1?(o=r.substr(0,r.indexOf(":")),this.capture(o),this.capture(":")):t&&(o=j);var i=this.parseChildren();e[o]=1===Object.keys(i).length?i[j]:new K([],i),this.consumeOptional("//")}return e},t.prototype.peekStartsWith=function(t){return this.remaining.startsWith(t)},t.prototype.consumeOptional=function(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)},t.prototype.capture=function(t){if(!this.consumeOptional(t))throw new Error('Expected "'+t+'".')},t}(),gt=function gt(t){this.segmentGroup=t||null},vt=function vt(t){this.urlTree=t};function mt(t){return new r.Observable(function(e){return e.error(new gt(t))})}function yt(t){return new r.Observable(function(e){return e.error(new vt(t))})}function St(t){return new r.Observable(function(e){return e.error(new Error("Only absolute redirects can have named outlets. redirectTo: '"+t+"'"))})}var wt=function(){function t(t,r,n,o,i){this.configLoader=r,this.urlSerializer=n,this.urlTree=o,this.config=i,this.allowRedirects=!0,this.ngModule=t.get(e.NgModuleRef)}return t.prototype.apply=function(){var t=this;return this.expandSegmentGroup(this.ngModule,this.config,this.urlTree.root,j).pipe(n.map(function(e){return t.createUrlTree(e,t.urlTree.queryParams,t.urlTree.fragment)})).pipe(n.catchError(function(e){if(e instanceof vt)return t.allowRedirects=!1,t.match(e.urlTree);if(e instanceof gt)throw t.noMatchError(e);throw e}))},t.prototype.match=function(t){var e=this;return this.expandSegmentGroup(this.ngModule,this.config,t.root,j).pipe(n.map(function(r){return e.createUrlTree(r,t.queryParams,t.fragment)})).pipe(n.catchError(function(t){if(t instanceof gt)throw e.noMatchError(t);throw t}))},t.prototype.noMatchError=function(t){return new Error("Cannot match any routes. URL Segment: '"+t.segmentGroup+"'")},t.prototype.createUrlTree=function(t,e,r){var n,o=t.segments.length>0?new K([],((n={})[j]=t,n)):t;return new $(o,e,r)},t.prototype.expandSegmentGroup=function(t,e,r,o){return 0===r.segments.length&&r.hasChildren()?this.expandChildren(t,e,r).pipe(n.map(function(t){return new K([],t)})):this.expandSegment(t,r,e,r.segments,o,!0)},t.prototype.expandChildren=function(t,e,o){var i=this;return function a(t,e){if(0===Object.keys(t).length)return r.of({});var o=[],i=[],a={};return W(t,function(t,r){var u=e(r,t).pipe(n.map(function(t){return a[r]=t}));r===j?o.push(u):i.push(u)}),r.of.apply(null,o.concat(i)).pipe(n.concatAll(),n.last(),n.map(function(){return a}))}(o.children,function(r,n){return i.expandSegmentGroup(t,e,n,r)})},t.prototype.expandSegment=function(t,e,o,i,a,u){var s=this;return r.of.apply(void 0,d(o)).pipe(n.map(function(c){return s.expandSegmentAgainstRoute(t,e,o,c,i,a,u).pipe(n.catchError(function(t){if(t instanceof gt)return r.of(null);throw t}))}),n.concatAll(),n.first(function(t){return!!t}),n.catchError(function(t,n){if(t instanceof r.EmptyError||"EmptyError"===t.name){if(s.noLeftoversInUrl(e,i,a))return r.of(new K([],{}));throw new gt(e)}throw t}))},t.prototype.noLeftoversInUrl=function(t,e,r){return 0===e.length&&!t.children[r]},t.prototype.expandSegmentAgainstRoute=function(t,e,r,n,o,i,a){return Pt(n)!==i?mt(e):void 0===n.redirectTo?this.matchSegmentAgainstRoute(t,e,n,o):a&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(t,e,r,n,o,i):mt(e)},t.prototype.expandSegmentAgainstRouteUsingRedirect=function(t,e,r,n,o,i){return"**"===n.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(t,r,n,i):this.expandRegularSegmentAgainstRouteUsingRedirect(t,e,r,n,o,i)},t.prototype.expandWildCardWithParamsAgainstRouteUsingRedirect=function(t,e,r,o){var i=this,a=this.applyRedirectCommands([],r.redirectTo,{});return r.redirectTo.startsWith("/")?yt(a):this.lineralizeSegments(r,a).pipe(n.mergeMap(function(r){var n=new K(r,{});return i.expandSegment(t,n,e,r,o,!1)}))},t.prototype.expandRegularSegmentAgainstRouteUsingRedirect=function(t,e,r,o,i,a){var u=this,s=bt(e,o,i),c=s.consumedSegments,l=s.lastChild,p=s.positionalParamSegments;if(!s.matched)return mt(e);var h=this.applyRedirectCommands(c,o.redirectTo,p);return o.redirectTo.startsWith("/")?yt(h):this.lineralizeSegments(o,h).pipe(n.mergeMap(function(n){return u.expandSegment(t,e,r,n.concat(i.slice(l)),a,!1)}))},t.prototype.matchSegmentAgainstRoute=function(t,e,o,i){var a=this;if("**"===o.path)return o.loadChildren?this.configLoader.load(t.injector,o).pipe(n.map(function(t){return o._loadedConfig=t,new K(i,{})})):r.of(new K(i,{}));var u=bt(e,o,i),c=u.consumedSegments,l=u.lastChild;if(!u.matched)return mt(e);var p=i.slice(l);return this.getChildConfig(t,o).pipe(n.mergeMap(function(t){var o=t.module,i=t.routes,u=function l(t,e,r,n){return r.length>0&&function o(t,e,r){return r.some(function(r){return Rt(t,e,r)&&Pt(r)!==j})}(t,r,n)?{segmentGroup:Ct(new K(e,function i(t,e){var r,n,o={};o[j]=e;try{for(var i=h(t),a=i.next();!a.done;a=i.next()){var u=a.value;""===u.path&&Pt(u)!==j&&(o[Pt(u)]=new K([],{}))}}catch(t){r={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return o}(n,new K(r,t.children)))),slicedSegments:[]}:0===r.length&&function a(t,e,r){return r.some(function(r){return Rt(t,e,r)})}(t,r,n)?{segmentGroup:Ct(new K(t.segments,function u(t,e,r,n){var o,i,a={};try{for(var u=h(r),c=u.next();!c.done;c=u.next()){var l=c.value;Rt(t,e,l)&&!n[Pt(l)]&&(a[Pt(l)]=new K([],{}))}}catch(t){o={error:t}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}return s({},n,a)}(t,r,n,t.children))),slicedSegments:r}:{segmentGroup:t,slicedSegments:r}}(e,c,p,i),f=u.segmentGroup,d=u.slicedSegments;return 0===d.length&&f.hasChildren()?a.expandChildren(o,i,f).pipe(n.map(function(t){return new K(c,t)})):0===i.length&&0===d.length?r.of(new K(c,{})):a.expandSegment(o,f,i,d,j,!0).pipe(n.map(function(t){return new K(c.concat(t.segments),t.children)}))}))},t.prototype.getChildConfig=function(t,e){var o=this;return e.children?r.of(new N(e.children,t)):e.loadChildren?void 0!==e._loadedConfig?r.of(e._loadedConfig):function i(t,e){var o=e.canLoad;return o&&0!==o.length?Q(r.from(o).pipe(n.map(function(r){var n=t.get(r);return Z(n.canLoad?n.canLoad(e):n(e))}))):r.of(!0)}(t.injector,e).pipe(n.mergeMap(function(i){return i?o.configLoader.load(t.injector,e).pipe(n.map(function(t){return e._loadedConfig=t,t})):function a(t){return new r.Observable(function(e){return e.error(function r(t){var e=Error("NavigationCancelingError: "+t);return e.ngNavigationCancelingError=!0,e}("Cannot load children because the guard of the route \"path: '"+t.path+"'\" returned false"))})}(e)})):r.of(new N([],t))},t.prototype.lineralizeSegments=function(t,e){for(var n=[],o=e.root;;){if(n=n.concat(o.segments),0===o.numberOfChildren)return r.of(n);if(o.numberOfChildren>1||!o.children[j])return St(t.redirectTo);o=o.children[j]}},t.prototype.applyRedirectCommands=function(t,e,r){return this.applyRedirectCreatreUrlTree(e,this.urlSerializer.parse(e),t,r)},t.prototype.applyRedirectCreatreUrlTree=function(t,e,r,n){var o=this.createSegmentGroup(t,e.root,r,n);return new $(o,this.createQueryParams(e.queryParams,this.urlTree.queryParams),e.fragment)},t.prototype.createQueryParams=function(t,e){var r={};return W(t,function(t,n){if("string"==typeof t&&t.startsWith(":")){var o=t.substring(1);r[n]=e[o]}else r[n]=t}),r},t.prototype.createSegmentGroup=function(t,e,r,n){var o=this,i=this.createSegments(t,e.segments,r,n),a={};return W(e.children,function(e,i){a[i]=o.createSegmentGroup(t,e,r,n)}),new K(i,a)},t.prototype.createSegments=function(t,e,r,n){var o=this;return e.map(function(e){return e.path.startsWith(":")?o.findPosParam(t,e,n):o.findOrReturn(e,r)})},t.prototype.findPosParam=function(t,e,r){var n=r[e.path.substring(1)];if(!n)throw new Error("Cannot redirect to '"+t+"'. Cannot find '"+e.path+"'.");return n},t.prototype.findOrReturn=function(t,e){var r,n,o=0;try{for(var i=h(e),a=i.next();!a.done;a=i.next()){var u=a.value;if(u.path===t.path)return e.splice(o),u;o++}}catch(t){r={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return t},t}();function bt(t,e,r){if(""===e.path)return"full"===e.pathMatch&&(t.hasChildren()||r.length>0)?{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}:{matched:!0,consumedSegments:[],lastChild:0,positionalParamSegments:{}};var n=(e.matcher||M)(r,t,e);return n?{matched:!0,consumedSegments:n.consumed,lastChild:n.consumed.length,positionalParamSegments:n.posParams}:{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}}function Ct(t){if(1===t.numberOfChildren&&t.children[j]){var e=t.children[j];return new K(t.segments.concat(e.segments),e.children)}return t}function Rt(t,e,r){return(!(t.hasChildren()||e.length>0)||"full"!==r.pathMatch)&&""===r.path&&void 0!==r.redirectTo}function Pt(t){return t.outlet||j}
|
|
35
35
|
/**
|
|
36
36
|
* @license
|
|
37
37
|
* Copyright Google Inc. All Rights Reserved.
|
|
38
38
|
*
|
|
39
39
|
* Use of this source code is governed by an MIT-style license that can be
|
|
40
40
|
* found in the LICENSE file at https://angular.io/license
|
|
41
|
-
*/var
|
|
41
|
+
*/var Ot=function(){function t(t){this._root=t}return Object.defineProperty(t.prototype,"root",{get:function(){return this._root.value},enumerable:!0,configurable:!0}),t.prototype.parent=function(t){var e=this.pathFromRoot(t);return e.length>1?e[e.length-2]:null},t.prototype.children=function(t){var e=At(t,this._root);return e?e.children.map(function(t){return t.value}):[]},t.prototype.firstChild=function(t){var e=At(t,this._root);return e&&e.children.length>0?e.children[0].value:null},t.prototype.siblings=function(t){var e=_t(t,this._root);return e.length<2?[]:e[e.length-2].children.map(function(t){return t.value}).filter(function(e){return e!==t})},t.prototype.pathFromRoot=function(t){return _t(t,this._root).map(function(t){return t.value})},t}();function At(t,e){var r,n;if(t===e.value)return e;try{for(var o=h(e.children),i=o.next();!i.done;i=o.next()){var a=At(t,i.value);if(a)return a}}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return null}function _t(t,e){var r,n;if(t===e.value)return[e];try{for(var o=h(e.children),i=o.next();!i.done;i=o.next()){var a=_t(t,i.value);if(a.length)return a.unshift(e),a}}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return[]}var Ut=function(){function t(t,e){this.value=t,this.children=e}return t.prototype.toString=function(){return"TreeNode("+this.value+")"},t}();function Et(t){var e={};return t&&t.children.forEach(function(t){return e[t.value.outlet]=t}),e}
|
|
42
42
|
/**
|
|
43
43
|
* @license
|
|
44
44
|
* Copyright Google Inc. All Rights Reserved.
|
|
45
45
|
*
|
|
46
46
|
* Use of this source code is governed by an MIT-style license that can be
|
|
47
47
|
* found in the LICENSE file at https://angular.io/license
|
|
48
|
-
*/var
|
|
48
|
+
*/var xt=function(t){function e(e,r){var n=t.call(this,e)||this;return n.snapshot=r,Mt(n,e),n}return u(e,t),e.prototype.toString=function(){return this.snapshot.toString()},e}(Ot);function Tt(t,e){var n=function o(t,e){var r=new kt([],{},{},"",{},j,e,null,t.root,-1,{});return new Lt("",new Ut(r,[]))}(t,e),i=new r.BehaviorSubject([new Y("",{})]),a=new r.BehaviorSubject({}),u=new r.BehaviorSubject({}),s=new r.BehaviorSubject({}),c=new r.BehaviorSubject(""),l=new It(i,a,s,c,u,j,e,n.root);return l.snapshot=n.root,new xt(new Ut(l,[]),n)}var It=function(){function t(t,e,r,n,o,i,a,u){this.url=t,this.params=e,this.queryParams=r,this.fragment=n,this.data=o,this.outlet=i,this.component=a,this._futureSnapshot=u}return Object.defineProperty(t.prototype,"routeConfig",{get:function(){return this._futureSnapshot.routeConfig},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._routerState.root},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"paramMap",{get:function(){return this._paramMap||(this._paramMap=this.params.pipe(n.map(function(t){return L(t)}))),this._paramMap},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(n.map(function(t){return L(t)}))),this._queryParamMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return this.snapshot?this.snapshot.toString():"Future("+this._futureSnapshot+")"},t}();function jt(t,e){void 0===e&&(e="emptyOnly");var r=t.pathFromRoot,n=0;if("always"!==e)for(n=r.length-1;n>=1;){var o=r[n],i=r[n-1];if(o.routeConfig&&""===o.routeConfig.path)n--;else{if(i.component)break;n--}}return function a(t){return t.reduce(function(t,e){return{params:s({},t.params,e.params),data:s({},t.data,e.data),resolve:s({},t.resolve,e._resolvedData)}},{params:{},data:{},resolve:{}})}(r.slice(n))}var kt=function(){function t(t,e,r,n,o,i,a,u,s,c,l){this.url=t,this.params=e,this.queryParams=r,this.fragment=n,this.data=o,this.outlet=i,this.component=a,this.routeConfig=u,this._urlSegment=s,this._lastPathIndex=c,this._resolve=l}return Object.defineProperty(t.prototype,"root",{get:function(){return this._routerState.root},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"paramMap",{get:function(){return this._paramMap||(this._paramMap=L(this.params)),this._paramMap},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=L(this.queryParams)),this._queryParamMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return"Route(url:'"+this.url.map(function(t){return t.toString()}).join("/")+"', path:'"+(this.routeConfig?this.routeConfig.path:"")+"')"},t}(),Lt=function(t){function e(e,r){var n=t.call(this,r)||this;return n.url=e,Mt(n,r),n}return u(e,t),e.prototype.toString=function(){return Nt(this._root)},e}(Ot);function Mt(t,e){e.value._routerState=t,e.children.forEach(function(e){return Mt(t,e)})}function Nt(t){var e=t.children.length>0?" { "+t.children.map(Nt).join(", ")+" } ":"";return""+t.value+e}function Dt(t){if(t.snapshot){var e=t.snapshot,r=t._futureSnapshot;t.snapshot=r,G(e.queryParams,r.queryParams)||t.queryParams.next(r.queryParams),e.fragment!==r.fragment&&t.fragment.next(r.fragment),G(e.params,r.params)||t.params.next(r.params),function n(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r)if(!G(t[r],e[r]))return!1;return!0}(e.url,r.url)||t.url.next(r.url),G(e.data,r.data)||t.data.next(r.data)}else t.snapshot=t._futureSnapshot,t.data.next(t._futureSnapshot.data)}function qt(t,e){return G(t.params,e.params)&&function r(t,e){return J(t,e)&&t.every(function(t,r){return G(t.parameters,e[r].parameters)})}(t.url,e.url)&&!(!t.parent!=!e.parent)&&(!t.parent||qt(t.parent,e.parent))}
|
|
49
49
|
/**
|
|
50
50
|
* @license
|
|
51
51
|
* Copyright Google Inc. All Rights Reserved.
|
|
52
52
|
*
|
|
53
53
|
* Use of this source code is governed by an MIT-style license that can be
|
|
54
54
|
* found in the LICENSE file at https://angular.io/license
|
|
55
|
-
*/function
|
|
55
|
+
*/function zt(t){return"object"==typeof t&&null!=t&&!t.outlets&&!t.segmentPath}function Ht(t,e,r,n,o){var i={};return n&&W(n,function(t,e){i[e]=Array.isArray(t)?t.map(function(t){return""+t}):""+t}),new $(r.root===t?e:function t(e,r,n){var o={};return W(e.children,function(e,i){o[i]=e===r?n:t(e,r,n)}),new K(e.segments,o)}(r.root,t,e),i,o)}var Gt=function(){function t(t,e,r){if(this.isAbsolute=t,this.numberOfDoubleDots=e,this.commands=r,t&&r.length>0&&zt(r[0]))throw new Error("Root segment cannot have matrix parameters");var n=r.find(function(t){return"object"==typeof t&&null!=t&&t.outlets});if(n&&n!==B(r))throw new Error("{outlets:{}} has to be the last command")}return t.prototype.toRoot=function(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]},t}(),Ft=function Ft(t,e,r){this.segmentGroup=t,this.processChildren=e,this.index=r};function Bt(t){return"object"==typeof t&&null!=t&&t.outlets?t.outlets[j]:""+t}function Wt(t,e,r){if(t||(t=new K([],{})),0===t.segments.length&&t.hasChildren())return Qt(t,e,r);var n=function o(t,e,r){for(var n=0,o=e,i={match:!1,pathIndex:0,commandIndex:0};o<t.segments.length;){if(n>=r.length)return i;var a=t.segments[o],u=Bt(r[n]),s=n<r.length-1?r[n+1]:null;if(o>0&&void 0===u)break;if(u&&s&&"object"==typeof s&&void 0===s.outlets){if(!Kt(u,s,a))return i;n+=2}else{if(!Kt(u,{},a))return i;n++}o++}return{match:!0,pathIndex:o,commandIndex:n}}(t,e,r),i=r.slice(n.commandIndex);if(n.match&&n.pathIndex<t.segments.length){var a=new K(t.segments.slice(0,n.pathIndex),{});return a.children[j]=new K(t.segments.slice(n.pathIndex),t.children),Qt(a,0,i)}return n.match&&0===i.length?new K(t.segments,{}):n.match&&!t.hasChildren()?Zt(t,e,r):n.match?Qt(t,0,i):Zt(t,e,r)}function Qt(t,e,r){if(0===r.length)return new K(t.segments,{});var n=function o(t){var e,r;return"object"!=typeof t[0]?((e={})[j]=t,e):void 0===t[0].outlets?((r={})[j]=t,r):t[0].outlets}(r),i={};return W(n,function(r,n){null!==r&&(i[n]=Wt(t.children[n],e,r))}),W(t.children,function(t,e){void 0===n[e]&&(i[e]=t)}),new K(t.segments,i)}function Zt(t,e,r){for(var n=t.segments.slice(0,e),o=0;o<r.length;){if("object"==typeof r[o]&&void 0!==r[o].outlets){var i=Vt(r[o].outlets);return new K(n,i)}if(0===o&&zt(r[0]))n.push(new Y(t.segments[e].path,r[0])),o++;else{var a=Bt(r[o]),u=o<r.length-1?r[o+1]:null;a&&u&&zt(u)?(n.push(new Y(a,$t(u))),o+=2):(n.push(new Y(a,{})),o++)}}return new K(n,{})}function Vt(t){var e={};return W(t,function(t,r){null!==t&&(e[r]=Zt(new K([],{}),0,t))}),e}function $t(t){var e={};return W(t,function(t,r){return e[r]=""+t}),e}function Kt(t,e,r){return t==r.path&&G(e,r.parameters)}
|
|
56
56
|
/**
|
|
57
57
|
* @license
|
|
58
58
|
* Copyright Google Inc. All Rights Reserved.
|
|
59
59
|
*
|
|
60
60
|
* Use of this source code is governed by an MIT-style license that can be
|
|
61
61
|
* found in the LICENSE file at https://angular.io/license
|
|
62
|
-
*/var
|
|
62
|
+
*/var Yt=function Yt(t){this.path=t,this.route=this.path[this.path.length-1]},Jt=function Jt(t,e){this.component=t,this.route=e},Xt=function(){function t(t,e,r,n){this.future=t,this.curr=e,this.moduleInjector=r,this.forwardEvent=n,this.canActivateChecks=[],this.canDeactivateChecks=[]}return t.prototype.initialize=function(t){var e=this.future._root;this.setupChildRouteGuards(e,this.curr?this.curr._root:null,t,[e.value])},t.prototype.checkGuards=function(){var t=this;return this.isDeactivating()||this.isActivating()?this.runCanDeactivateChecks().pipe(n.mergeMap(function(e){return e?t.runCanActivateChecks():r.of(!1)})):r.of(!0)},t.prototype.resolveData=function(t){var e=this;return this.isActivating()?r.from(this.canActivateChecks).pipe(n.concatMap(function(r){return e.runResolve(r.route,t)}),n.reduce(function(t,e){return t})):r.of(null)},t.prototype.isDeactivating=function(){return 0!==this.canDeactivateChecks.length},t.prototype.isActivating=function(){return 0!==this.canActivateChecks.length},t.prototype.setupChildRouteGuards=function(t,e,r,n){var o=this,i=Et(e);t.children.forEach(function(t){o.setupRouteGuards(t,i[t.value.outlet],r,n.concat([t.value])),delete i[t.value.outlet]}),W(i,function(t,e){return o.deactivateRouteAndItsChildren(t,r.getContext(e))})},t.prototype.setupRouteGuards=function(t,e,r,n){var o=t.value,i=e?e.value:null,a=r?r.getContext(t.value.outlet):null;if(i&&o.routeConfig===i.routeConfig){var u=this.shouldRunGuardsAndResolvers(i,o,o.routeConfig.runGuardsAndResolvers);u?this.canActivateChecks.push(new Yt(n)):(o.data=i.data,o._resolvedData=i._resolvedData),this.setupChildRouteGuards(t,e,o.component?a?a.children:null:r,n),u&&this.canDeactivateChecks.push(new Jt(a.outlet.component,i))}else i&&this.deactivateRouteAndItsChildren(e,a),this.canActivateChecks.push(new Yt(n)),this.setupChildRouteGuards(t,null,o.component?a?a.children:null:r,n)},t.prototype.shouldRunGuardsAndResolvers=function(t,e,r){switch(r){case"always":return!0;case"paramsOrQueryParamsChange":return!qt(t,e)||!G(t.queryParams,e.queryParams);case"paramsChange":default:return!qt(t,e)}},t.prototype.deactivateRouteAndItsChildren=function(t,e){var r=this,n=Et(t),o=t.value;W(n,function(t,n){r.deactivateRouteAndItsChildren(t,o.component?e?e.children.getContext(n):null:e)}),this.canDeactivateChecks.push(new Jt(o.component&&e&&e.outlet&&e.outlet.isActivated?e.outlet.component:null,o))},t.prototype.runCanDeactivateChecks=function(){var t=this;return r.from(this.canDeactivateChecks).pipe(n.mergeMap(function(e){return t.runCanDeactivate(e.component,e.route)}),n.every(function(t){return!0===t}))},t.prototype.runCanActivateChecks=function(){var t=this;return r.from(this.canActivateChecks).pipe(n.concatMap(function(e){return Q(r.from([t.fireChildActivationStart(e.route.parent),t.fireActivationStart(e.route),t.runCanActivateChild(e.path),t.runCanActivate(e.route)]))}),n.every(function(t){return!0===t}))},t.prototype.fireActivationStart=function(t){return null!==t&&this.forwardEvent&&this.forwardEvent(new E(t)),r.of(!0)},t.prototype.fireChildActivationStart=function(t){return null!==t&&this.forwardEvent&&this.forwardEvent(new _(t)),r.of(!0)},t.prototype.runCanActivate=function(t){var e=this,o=t.routeConfig?t.routeConfig.canActivate:null;return o&&0!==o.length?Q(r.from(o).pipe(n.map(function(r){var o=e.getToken(r,t);return Z(o.canActivate?o.canActivate(t,e.future):o(t,e.future)).pipe(n.first())}))):r.of(!0)},t.prototype.runCanActivateChild=function(t){var e=this,o=t[t.length-1],i=t.slice(0,t.length-1).reverse().map(function(t){return e.extractCanActivateChild(t)}).filter(function(t){return null!==t});return Q(r.from(i).pipe(n.map(function(t){return Q(r.from(t.guards).pipe(n.map(function(r){var i=e.getToken(r,t.node);return Z(i.canActivateChild?i.canActivateChild(o,e.future):i(o,e.future)).pipe(n.first())})))})))},t.prototype.extractCanActivateChild=function(t){var e=t.routeConfig?t.routeConfig.canActivateChild:null;return e&&0!==e.length?{node:t,guards:e}:null},t.prototype.runCanDeactivate=function(t,e){var o=this,i=e&&e.routeConfig?e.routeConfig.canDeactivate:null;return i&&0!==i.length?r.from(i).pipe(n.mergeMap(function(r){var i=o.getToken(r,e);return Z(i.canDeactivate?i.canDeactivate(t,e,o.curr,o.future):i(t,e,o.curr,o.future)).pipe(n.first())})).pipe(n.every(function(t){return!0===t})):r.of(!0)},t.prototype.runResolve=function(t,e){return this.resolveNode(t._resolve,t).pipe(n.map(function(r){return t._resolvedData=r,t.data=s({},t.data,jt(t,e).resolve),null}))},t.prototype.resolveNode=function(t,e){var o=this,i=Object.keys(t);if(0===i.length)return r.of({});if(1===i.length){var a=i[0];return this.getResolver(t[a],e).pipe(n.map(function(t){var e;return(e={})[a]=t,e}))}var u={};return r.from(i).pipe(n.mergeMap(function(r){return o.getResolver(t[r],e).pipe(n.map(function(t){return u[r]=t,t}))})).pipe(n.last(),n.map(function(){return u}))},t.prototype.getResolver=function(t,e){var r=this.getToken(t,e);return Z(r.resolve?r.resolve(e,this.future):r(e,this.future))},t.prototype.getToken=function(t,e){var r=function n(t){if(!t)return null;for(var e=t.parent;e;e=e.parent){var r=e.routeConfig;if(r&&r._loadedConfig)return r._loadedConfig}return null}
|
|
63
63
|
/**
|
|
64
64
|
* @license
|
|
65
65
|
* Copyright Google Inc. All Rights Reserved.
|
|
66
66
|
*
|
|
67
67
|
* Use of this source code is governed by an MIT-style license that can be
|
|
68
68
|
* found in the LICENSE file at https://angular.io/license
|
|
69
|
-
*/(e);return(r?r.module.injector:this.moduleInjector).get(t)},t}(),
|
|
69
|
+
*/(e);return(r?r.module.injector:this.moduleInjector).get(t)},t}(),te=function gt(){},ee=function(){function t(t,e,r,n,o,i){this.rootComponentType=t,this.config=e,this.urlTree=r,this.url=n,this.paramsInheritanceStrategy=o,this.relativeLinkResolution=i}return t.prototype.recognize=function(){try{var t=oe(this.urlTree.root,[],[],this.config,this.relativeLinkResolution).segmentGroup,e=this.processSegmentGroup(this.config,t,j),n=new kt([],Object.freeze({}),Object.freeze(s({},this.urlTree.queryParams)),this.urlTree.fragment,{},j,this.rootComponentType,null,this.urlTree.root,-1,{}),o=new Ut(n,e),i=new Lt(this.url,o);return this.inheritParamsAndData(i._root),r.of(i)}catch(t){return new r.Observable(function(e){return e.error(t)})}},t.prototype.inheritParamsAndData=function(t){var e=this,r=t.value,n=jt(r,this.paramsInheritanceStrategy);r.params=Object.freeze(n.params),r.data=Object.freeze(n.data),t.children.forEach(function(t){return e.inheritParamsAndData(t)})},t.prototype.processSegmentGroup=function(t,e,r){return 0===e.segments.length&&e.hasChildren()?this.processChildren(t,e):this.processSegment(t,e,e.segments,r)},t.prototype.processChildren=function(t,e){var r=this,n=X(e,function(e,n){return r.processSegmentGroup(t,e,n)});return function o(t){var e={};t.forEach(function(t){var r=e[t.value.outlet];if(r){var n=r.url.map(function(t){return t.toString()}).join("/"),o=t.value.url.map(function(t){return t.toString()}).join("/");throw new Error("Two segments cannot have the same outlet name: '"+n+"' and '"+o+"'.")}e[t.value.outlet]=t.value})}(n),function i(t){t.sort(function(t,e){return t.value.outlet===j?-1:e.value.outlet===j?1:t.value.outlet.localeCompare(e.value.outlet)})}(n),n},t.prototype.processSegment=function(t,e,r,n){var o,i;try{for(var a=h(t),u=a.next();!u.done;u=a.next()){var s=u.value;try{return this.processSegmentAgainstRoute(s,e,r,n)}catch(t){if(!(t instanceof te))throw t}}}catch(t){o={error:t}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}if(this.noLeftoversInUrl(e,r,n))return[];throw new te},t.prototype.noLeftoversInUrl=function(t,e,r){return 0===e.length&&!t.children[r]},t.prototype.processSegmentAgainstRoute=function(t,e,r,n){if(t.redirectTo)throw new te;if((t.outlet||j)!==n)throw new te;var o,i=[],a=[];if("**"===t.path){var u=r.length>0?B(r).parameters:{};o=new kt(r,u,Object.freeze(s({},this.urlTree.queryParams)),this.urlTree.fragment,ue(t),n,t.component,t,re(e),ne(e)+r.length,se(t))}else{var c=function l(t,e,r){if(""===e.path){if("full"===e.pathMatch&&(t.hasChildren()||r.length>0))throw new te;return{consumedSegments:[],lastChild:0,parameters:{}}}var n=(e.matcher||M)(r,t,e);if(!n)throw new te;var o={};W(n.posParams,function(t,e){o[e]=t.path});var i=n.consumed.length>0?s({},o,n.consumed[n.consumed.length-1].parameters):o;return{consumedSegments:n.consumed,lastChild:n.consumed.length,parameters:i}}(e,t,r);i=c.consumedSegments,a=r.slice(c.lastChild),o=new kt(i,c.parameters,Object.freeze(s({},this.urlTree.queryParams)),this.urlTree.fragment,ue(t),n,t.component,t,re(e),ne(e)+i.length,se(t))}var p=function h(t){return t.children?t.children:t.loadChildren?t._loadedConfig.routes:[]}(t),f=oe(e,i,a,p,this.relativeLinkResolution),d=f.segmentGroup,g=f.slicedSegments;if(0===g.length&&d.hasChildren()){var v=this.processChildren(p,d);return[new Ut(o,v)]}if(0===p.length&&0===g.length)return[new Ut(o,[])];var m=this.processSegment(p,d,g,j);return[new Ut(o,m)]},t}();function re(t){for(var e=t;e._sourceSegment;)e=e._sourceSegment;return e}function ne(t){for(var e=t,r=e._segmentIndexShift?e._segmentIndexShift:0;e._sourceSegment;)r+=(e=e._sourceSegment)._segmentIndexShift?e._segmentIndexShift:0;return r-1}function oe(t,e,r,n,o){if(r.length>0&&function i(t,e,r){return r.some(function(r){return ie(t,e,r)&&ae(r)!==j})}(t,r,n)){var a=new K(e,function u(t,e,r,n){var o,i,a={};a[j]=n,n._sourceSegment=t,n._segmentIndexShift=e.length;try{for(var u=h(r),s=u.next();!s.done;s=u.next()){var c=s.value;if(""===c.path&&ae(c)!==j){var l=new K([],{});l._sourceSegment=t,l._segmentIndexShift=e.length,a[ae(c)]=l}}}catch(t){o={error:t}}finally{try{s&&!s.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}return a}(t,e,n,new K(r,t.children)));return a._sourceSegment=t,a._segmentIndexShift=e.length,{segmentGroup:a,slicedSegments:[]}}if(0===r.length&&function c(t,e,r){return r.some(function(r){return ie(t,e,r)})}(t,r,n)){var l=new K(t.segments,function p(t,e,r,n,o,i){var a,u,c={};try{for(var l=h(n),p=l.next();!p.done;p=l.next()){var f=p.value;if(ie(t,r,f)&&!o[ae(f)]){var d=new K([],{});d._sourceSegment=t,d._segmentIndexShift="legacy"===i?t.segments.length:e.length,c[ae(f)]=d}}}catch(t){a={error:t}}finally{try{p&&!p.done&&(u=l.return)&&u.call(l)}finally{if(a)throw a.error}}return s({},o,c)}(t,e,r,n,t.children,o));return l._sourceSegment=t,l._segmentIndexShift=e.length,{segmentGroup:l,slicedSegments:r}}var f=new K(t.segments,t.children);return f._sourceSegment=t,f._segmentIndexShift=e.length,{segmentGroup:f,slicedSegments:r}}function ie(t,e,r){return(!(t.hasChildren()||e.length>0)||"full"!==r.pathMatch)&&""===r.path&&void 0===r.redirectTo}function ae(t){return t.outlet||j}function ue(t){return t.data||{}}function se(t){return t.resolve||{}}
|
|
70
70
|
/**
|
|
71
71
|
* @license
|
|
72
72
|
* Copyright Google Inc. All Rights Reserved.
|
|
73
73
|
*
|
|
74
74
|
* Use of this source code is governed by an MIT-style license that can be
|
|
75
75
|
* found in the LICENSE file at https://angular.io/license
|
|
76
|
-
*/var
|
|
76
|
+
*/var ce=function ce(){},le=function(){function t(){}return t.prototype.shouldDetach=function(t){return!1},t.prototype.store=function(t,e){},t.prototype.shouldAttach=function(t){return!1},t.prototype.retrieve=function(t){return null},t.prototype.shouldReuseRoute=function(t,e){return t.routeConfig===e.routeConfig},t}(),pe=new e.InjectionToken("ROUTES"),he=function(){function t(t,e,r,n){this.loader=t,this.compiler=e,this.onLoadStartListener=r,this.onLoadEndListener=n}return t.prototype.load=function(t,e){var r=this;return this.onLoadStartListener&&this.onLoadStartListener(e),this.loadModuleFactory(e.loadChildren).pipe(n.map(function(n){r.onLoadEndListener&&r.onLoadEndListener(e);var o=n.create(t);return new N(F(o.injector.get(pe)).map(H),o)}))},t.prototype.loadModuleFactory=function(t){var o=this;return"string"==typeof t?r.from(this.loader.load(t)):Z(t()).pipe(n.mergeMap(function(t){return t instanceof e.NgModuleFactory?r.of(t):r.from(o.compiler.compileModuleAsync(t))}))},t}(),fe=function fe(){},de=function(){function t(){}return t.prototype.shouldProcessUrl=function(t){return!0},t.prototype.extract=function(t){return t},t.prototype.merge=function(t,e){return t},t}();
|
|
77
77
|
/**
|
|
78
78
|
* @license
|
|
79
79
|
* Copyright Google Inc. All Rights Reserved.
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
* Use of this source code is governed by an MIT-style license that can be
|
|
82
82
|
* found in the LICENSE file at https://angular.io/license
|
|
83
83
|
*/
|
|
84
|
-
function
|
|
84
|
+
function ge(t){throw t}function ve(t,e,r){return e.parse("/")}function me(t,e){return r.of(null)}var ye=function(){function t(t,n,o,i,a,u,s,c){var l=this;this.rootComponentType=t,this.urlSerializer=n,this.rootContexts=o,this.location=i,this.config=c,this.navigations=new r.BehaviorSubject(null),this.navigationId=0,this.isNgZoneEnabled=!1,this.events=new r.Subject,this.errorHandler=ge,this.malformedUriErrorHandler=ve,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:me,afterPreactivation:me},this.urlHandlingStrategy=new de,this.routeReuseStrategy=new le,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="legacy",this.ngModule=a.get(e.NgModuleRef),this.console=a.get(e.ɵConsole);var p=a.get(e.NgZone);this.isNgZoneEnabled=p instanceof e.NgZone,this.resetConfig(c),this.currentUrlTree=function h(){return new $(new K([],{}),{},null)}(),this.rawUrlTree=this.currentUrlTree,this.configLoader=new he(u,s,function(t){return l.triggerEvent(new O(t))},function(t){return l.triggerEvent(new A(t))}),this.routerState=Tt(this.currentUrlTree,this.rootComponentType),this.processNavigations()}return t.prototype.resetRootComponentType=function(t){this.rootComponentType=t,this.routerState.root.component=this.rootComponentType},t.prototype.initialNavigation=function(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})},t.prototype.setUpLocationChangeListener=function(){var t=this;this.locationSubscription||(this.locationSubscription=this.location.subscribe(function(e){var r=t.parseUrl(e.url),n="popstate"===e.type?"popstate":"hashchange",o=e.state&&e.state.navigationId?{navigationId:e.state.navigationId}:null;setTimeout(function(){t.scheduleNavigation(r,n,o,{replaceUrl:!0})},0)}))},Object.defineProperty(t.prototype,"url",{get:function(){return this.serializeUrl(this.currentUrlTree)},enumerable:!0,configurable:!0}),t.prototype.triggerEvent=function(t){this.events.next(t)},t.prototype.resetConfig=function(t){D(t),this.config=t.map(H),this.navigated=!1,this.lastSuccessfulId=-1},t.prototype.ngOnDestroy=function(){this.dispose()},t.prototype.dispose=function(){this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=null)},t.prototype.createUrlTree=function(t,r){void 0===r&&(r={});var n=r.relativeTo,o=r.queryParams,i=r.fragment,a=r.preserveQueryParams,u=r.queryParamsHandling,c=r.preserveFragment;e.isDevMode()&&a&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead.");var l=n||this.routerState.root,p=c?this.currentUrlTree.fragment:i,h=null;if(u)switch(u){case"merge":h=s({},this.currentUrlTree.queryParams,o);break;case"preserve":h=this.currentUrlTree.queryParams;break;default:h=o||null}else h=a?this.currentUrlTree.queryParams:o||null;return null!==h&&(h=this.removeEmptyProps(h)),
|
|
85
85
|
/**
|
|
86
86
|
* @license
|
|
87
87
|
* Copyright Google Inc. All Rights Reserved.
|
|
@@ -89,35 +89,35 @@ function pe(t){throw t}function fe(t,e,r){return e.parse("/")}function de(t,e){r
|
|
|
89
89
|
* Use of this source code is governed by an MIT-style license that can be
|
|
90
90
|
* found in the LICENSE file at https://angular.io/license
|
|
91
91
|
*/
|
|
92
|
-
function
|
|
92
|
+
function f(t,e,r,n,o){if(0===r.length)return Ht(e.root,e.root,e,n,o);var i=function a(t){if("string"==typeof t[0]&&1===t.length&&"/"===t[0])return new Gt(!0,0,t);var e=0,r=!1,n=t.reduce(function(t,n,o){if("object"==typeof n&&null!=n){if(n.outlets){var i={};return W(n.outlets,function(t,e){i[e]="string"==typeof t?t.split("/"):t}),d(t,[{outlets:i}])}if(n.segmentPath)return d(t,[n.segmentPath])}return"string"!=typeof n?d(t,[n]):0===o?(n.split("/").forEach(function(n,o){0==o&&"."===n||(0==o&&""===n?r=!0:".."===n?e++:""!=n&&t.push(n))}),t):d(t,[n])},[]);return new Gt(r,e,n)}(r);if(i.toRoot())return Ht(e.root,new K([],{}),e,n,o);var u=function s(t,e,r){if(t.isAbsolute)return new Ft(e.root,!0,0);if(-1===r.snapshot._lastPathIndex)return new Ft(r.snapshot._urlSegment,!0,0);var n=zt(t.commands[0])?0:1;return function o(t,e,r){for(var n=t,o=e,i=r;i>o;){if(i-=o,!(n=n.parent))throw new Error("Invalid number of '../'");o=n.segments.length}return new Ft(n,!1,o-i)}(r.snapshot._urlSegment,r.snapshot._lastPathIndex+n,t.numberOfDoubleDots)}(i,e,t),c=u.processChildren?Qt(u.segmentGroup,u.index,i.commands):Wt(u.segmentGroup,u.index,i.commands);return Ht(u.segmentGroup,c,e,n,o)}(l,this.currentUrlTree,t,h,p)},t.prototype.navigateByUrl=function(t,r){void 0===r&&(r={skipLocationChange:!1}),e.isDevMode()&&this.isNgZoneEnabled&&!e.NgZone.isInAngularZone()&&this.console.warn("Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?");var n=t instanceof $?t:this.parseUrl(t),o=this.urlHandlingStrategy.merge(n,this.rawUrlTree);return this.scheduleNavigation(o,"imperative",null,r)},t.prototype.navigate=function(t,e){return void 0===e&&(e={skipLocationChange:!1}),function r(t){for(var e=0;e<t.length;e++){var r=t[e];if(null==r)throw new Error("The requested path contains "+r+" segment at index "+e)}}
|
|
93
93
|
/**
|
|
94
94
|
* @license
|
|
95
95
|
* Copyright Google Inc. All Rights Reserved.
|
|
96
96
|
*
|
|
97
97
|
* Use of this source code is governed by an MIT-style license that can be
|
|
98
98
|
* found in the LICENSE file at https://angular.io/license
|
|
99
|
-
*/(t),this.navigateByUrl(this.createUrlTree(t,e),e)},t.prototype.serializeUrl=function(t){return this.urlSerializer.serialize(t)},t.prototype.parseUrl=function(t){var e;try{e=this.urlSerializer.parse(t)}catch(r){e=this.malformedUriErrorHandler(r,this.urlSerializer,t)}return e},t.prototype.isActive=function(t,e){if(t instanceof Q)return B(this.currentUrlTree,t,e);var r=this.parseUrl(t);return B(this.currentUrlTree,r,e)},t.prototype.removeEmptyProps=function(t){return Object.keys(t).reduce(function(e,r){var n=t[r];return null!==n&&void 0!==n&&(e[r]=n),e},{})},t.prototype.processNavigations=function(){var t=this;this.navigations.pipe(n.concatMap(function(e){return e?(t.executeScheduledNavigation(e),e.promise.catch(function(){})):r.of(null)})).subscribe(function(){})},t.prototype.scheduleNavigation=function(t,e,r,n){var o=this.navigations.value;if(o&&"imperative"!==e&&"imperative"===o.source&&o.rawUrl.toString()===t.toString())return Promise.resolve(!0);if(o&&"hashchange"==e&&"popstate"===o.source&&o.rawUrl.toString()===t.toString())return Promise.resolve(!0);if(o&&"popstate"==e&&"hashchange"===o.source&&o.rawUrl.toString()===t.toString())return Promise.resolve(!0);var i=null,a=null,u=new Promise(function(t,e){i=t,a=e}),s=++this.navigationId;return this.navigations.next({id:s,source:e,state:r,rawUrl:t,extras:n,resolve:i,reject:a,promise:u}),u.catch(function(t){return Promise.reject(t)})},t.prototype.executeScheduledNavigation=function(t){var e=this,r=t.id,n=t.rawUrl,o=t.extras,i=t.resolve,a=t.reject,u=t.source,s=t.state,c=this.urlHandlingStrategy.extract(n),l=!this.navigated||c.toString()!==this.currentUrlTree.toString();("reload"===this.onSameUrlNavigation||l)&&this.urlHandlingStrategy.shouldProcessUrl(n)?("eager"!==this.urlUpdateStrategy||o.skipLocationChange||this.setBrowserUrl(n,!!o.replaceUrl,r),this.events.next(new f(r,this.serializeUrl(c),u,s)),Promise.resolve().then(function(t){return e.runNavigate(c,n,!!o.skipLocationChange,!!o.replaceUrl,r,null)}).then(i,a)):l&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)?(this.events.next(new f(r,this.serializeUrl(c),u,s)),Promise.resolve().then(function(t){return e.runNavigate(c,n,!1,!1,r,Ut(c,e.rootComponentType).snapshot)}).then(i,a)):(this.rawUrlTree=n,i(null))},t.prototype.runNavigate=function(t,e,o,i,a,u){var s=this;return a!==this.navigationId?(this.events.next(new g(a,this.serializeUrl(t),"Navigation ID "+a+" is not equal to the current navigation id "+this.navigationId)),Promise.resolve(!1)):new Promise(function(l,h){var p,f=(u?r.of({appliedUrl:t,snapshot:u}):function d(t,e,r,n,o){return new mt(t,e,r,n,o).apply()}(s.ngModule.injector,s.configLoader,s.urlSerializer,t,s.config).pipe(n.mergeMap(function(e){return function r(t,e,n,o,i,a){return void 0===i&&(i="emptyOnly"),void 0===a&&(a="legacy"),new Jt(t,e,n,o,i,a).recognize()}(s.rootComponentType,s.config,e,s.serializeUrl(e),s.paramsInheritanceStrategy,s.relativeLinkResolution).pipe(n.map(function(r){return s.events.next(new m(a,s.serializeUrl(t),s.serializeUrl(e),r)),{appliedUrl:e,snapshot:r}}))}))).pipe(n.mergeMap(function(u){return"boolean"==typeof u?r.of(u):s.hooks.beforePreactivation(u.snapshot,{navigationId:a,appliedUrlTree:t,rawUrlTree:e,skipLocationChange:o,replaceUrl:i}).pipe(n.map(function(){return u}))})).pipe(n.map(function(t){if("boolean"==typeof t)return t;var e=t.appliedUrl,r=t.snapshot;return(p=new Kt(r,s.routerState.snapshot,s.ngModule.injector,function(t){return s.triggerEvent(t)})).initialize(s.rootContexts),{appliedUrl:e,snapshot:r}})).pipe(n.mergeMap(function(e){if("boolean"==typeof e||s.navigationId!==a)return r.of(!1);var o=e.appliedUrl,i=e.snapshot;return s.triggerEvent(new y(a,s.serializeUrl(t),s.serializeUrl(o),i)),p.checkGuards().pipe(n.map(function(e){return s.triggerEvent(new S(a,s.serializeUrl(t),s.serializeUrl(o),i,e)),{appliedUrl:o,snapshot:i,shouldActivate:e}}))})).pipe(n.mergeMap(function(e){return"boolean"==typeof e||s.navigationId!==a?r.of(!1):e.shouldActivate&&p.isActivating()?(s.triggerEvent(new w(a,s.serializeUrl(t),s.serializeUrl(e.appliedUrl),e.snapshot)),p.resolveData(s.paramsInheritanceStrategy).pipe(n.map(function(){return s.triggerEvent(new C(a,s.serializeUrl(t),s.serializeUrl(e.appliedUrl),e.snapshot)),e}))):r.of(e)})).pipe(n.mergeMap(function(u){return"boolean"==typeof u||s.navigationId!==a?r.of(!1):s.hooks.afterPreactivation(u.snapshot,{navigationId:a,appliedUrlTree:t,rawUrlTree:e,skipLocationChange:o,replaceUrl:i}).pipe(n.map(function(){return u}))})).pipe(n.map(function(t){if("boolean"==typeof t||s.navigationId!==a)return!1;var e=t.appliedUrl,n=t.shouldActivate;return n?{appliedUrl:e,state:function o(t,e,n){var o=function t(e,n,o){if(o&&e.shouldReuseRoute(n.value,o.value.snapshot)){(l=o.value)._futureSnapshot=n.value;var i=function a(e,r,n){return r.children.map(function(r){var o,i;try{for(var a=c(n.children),u=a.next();!u.done;u=a.next()){var s=u.value;if(e.shouldReuseRoute(s.value.snapshot,r.value))return t(e,r,s)}}catch(t){o={error:t}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}return t(e,r)})}(e,n,o);return new _t(l,i)}var u=e.retrieve(n.value);if(u){var s=u.route;return function t(e,r){if(e.value.routeConfig!==r.value.routeConfig)throw new Error("Cannot reattach ActivatedRouteSnapshot created from a different route");if(e.children.length!==r.children.length)throw new Error("Cannot reattach ActivatedRouteSnapshot with a different number of children");r.value._futureSnapshot=e.value;for(var n=0;n<e.children.length;++n)t(e.children[n],r.children[n])}(n,s),s}var l=function h(t){return new Et(new r.BehaviorSubject(t.url),new r.BehaviorSubject(t.params),new r.BehaviorSubject(t.queryParams),new r.BehaviorSubject(t.fragment),new r.BehaviorSubject(t.data),t.outlet,t.component,t)}(n.value);return i=n.children.map(function(r){return t(e,r)}),new _t(l,i)}(t,e._root,n?n._root:void 0);return new Ot(o,e)}(s.routeReuseStrategy,t.snapshot,s.routerState),shouldActivate:n}:{appliedUrl:e,state:null,shouldActivate:n}}));s.activateRoutes(f,s.routerState,s.currentUrlTree,a,t,e,o,i,l,h)})},t.prototype.activateRoutes=function(t,e,r,n,o,i,a,u,s,c){var l,h=this;t.forEach(function(t){if("boolean"!=typeof t&&t.shouldActivate&&n===h.navigationId&&t.state){var r=t.state;h.currentUrlTree=t.appliedUrl,h.rawUrlTree=h.urlHandlingStrategy.merge(h.currentUrlTree,i),h.routerState=r,"deferred"!==h.urlUpdateStrategy||a||h.setBrowserUrl(h.rawUrlTree,u,n),new ve(h.routeReuseStrategy,r,e,function(t){return h.triggerEvent(t)}).activate(h.rootContexts),l=!0}else l=!1}).then(function(){l?(h.navigated=!0,h.lastSuccessfulId=n,h.events.next(new d(n,h.serializeUrl(o),h.serializeUrl(h.currentUrlTree))),s(!0)):(h.resetUrlToCurrentUrlTree(),h.events.next(new g(n,h.serializeUrl(o),"")),s(!1))},function(t){if(function a(t){return t&&t.ngNavigationCancelingError}(t))h.navigated=!0,h.resetStateAndUrl(e,r,i),h.events.next(new g(n,h.serializeUrl(o),t.message)),s(!1);else{h.resetStateAndUrl(e,r,i),h.events.next(new v(n,h.serializeUrl(o),t));try{s(h.errorHandler(t))}catch(t){c(t)}}})},t.prototype.setBrowserUrl=function(t,e,r){var n=this.urlSerializer.serialize(t);this.location.isCurrentPathEqualTo(n)||e?this.location.replaceState(n,"",{navigationId:r}):this.location.go(n,"",{navigationId:r})},t.prototype.resetStateAndUrl=function(t,e,r){this.routerState=t,this.currentUrlTree=e,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,r),this.resetUrlToCurrentUrlTree()},t.prototype.resetUrlToCurrentUrlTree=function(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",{navigationId:this.lastSuccessfulId})},t}(),ve=function(){function t(t,e,r,n){this.routeReuseStrategy=t,this.futureState=e,this.currState=r,this.forwardEvent=n}return t.prototype.activate=function(t){var e=this.futureState._root,r=this.currState?this.currState._root:null;this.deactivateChildRoutes(e,r,t),Lt(this.futureState.root),this.activateChildRoutes(e,r,t)},t.prototype.deactivateChildRoutes=function(t,e,r){var n=this,o=At(e);t.children.forEach(function(t){var e=t.value.outlet;n.deactivateRoutes(t,o[e],r),delete o[e]}),G(o,function(t,e){n.deactivateRouteAndItsChildren(t,r)})},t.prototype.deactivateRoutes=function(t,e,r){var n=t.value,o=e?e.value:null;if(n===o)if(n.component){var i=r.getContext(n.outlet);i&&this.deactivateChildRoutes(t,e,i.children)}else this.deactivateChildRoutes(t,e,r);else o&&this.deactivateRouteAndItsChildren(e,r)},t.prototype.deactivateRouteAndItsChildren=function(t,e){this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,e):this.deactivateRouteAndOutlet(t,e)},t.prototype.detachAndStoreRouteSubtree=function(t,e){var r=e.getContext(t.value.outlet);if(r&&r.outlet){var n=r.outlet.detach(),o=r.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:n,route:t,contexts:o})}},t.prototype.deactivateRouteAndOutlet=function(t,e){var r=this,n=e.getContext(t.value.outlet);if(n){var o=At(t),i=t.value.component?n.children:e;G(o,function(t,e){return r.deactivateRouteAndItsChildren(t,i)}),n.outlet&&(n.outlet.deactivate(),n.children.onOutletDeactivated())}},t.prototype.activateChildRoutes=function(t,e,r){var n=this,o=At(e);t.children.forEach(function(t){n.activateRoutes(t,o[t.value.outlet],r),n.forwardEvent(new O(t.value.snapshot))}),t.children.length&&this.forwardEvent(new _(t.value.snapshot))},t.prototype.activateRoutes=function(t,e,r){var n=t.value,o=e?e.value:null;if(Lt(n),n===o)if(n.component){var i=r.getOrCreateContext(n.outlet);this.activateChildRoutes(t,e,i.children)}else this.activateChildRoutes(t,e,r);else if(n.component)if(i=r.getOrCreateContext(n.outlet),this.routeReuseStrategy.shouldAttach(n.snapshot)){var a=this.routeReuseStrategy.retrieve(n.snapshot);this.routeReuseStrategy.store(n.snapshot,null),i.children.onOutletReAttached(a.contexts),i.attachRef=a.componentRef,i.route=a.route.value,i.outlet&&i.outlet.attach(a.componentRef,a.route.value),me(a.route)}else{var u=function s(t){for(var e=t.parent;e;e=e.parent){var r=e.routeConfig;if(r&&r._loadedConfig)return r._loadedConfig;if(r&&r.component)return null}return null}(n.snapshot),c=u?u.module.componentFactoryResolver:null;i.route=n,i.resolver=c,i.outlet&&i.outlet.activateWith(n,c),this.activateChildRoutes(t,null,i.children)}else this.activateChildRoutes(t,null,r)},t}();function me(t){Lt(t.value),t.children.forEach(me)}var ye=function(){function t(t,e,r,n,o){this.router=t,this.route=e,this.commands=[],null==r&&n.setAttribute(o.nativeElement,"tabindex","0")}return Object.defineProperty(t.prototype,"routerLink",{set:function(t){this.commands=null!=t?Array.isArray(t)?t:[t]:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"preserveQueryParams",{set:function(t){e.isDevMode()&&console&&console.warn&&console.warn("preserveQueryParams is deprecated!, use queryParamsHandling instead."),this.preserve=t},enumerable:!0,configurable:!0}),t.prototype.onClick=function(){var t={skipLocationChange:we(this.skipLocationChange),replaceUrl:we(this.replaceUrl)};return this.router.navigateByUrl(this.urlTree,t),!0},Object.defineProperty(t.prototype,"urlTree",{get:function(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:we(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:we(this.preserveFragment)})},enumerable:!0,configurable:!0}),t.decorators=[{type:e.Directive,args:[{selector:":not(a)[routerLink]"}]}],t.ctorParameters=function(){return[{type:ge},{type:Et},{type:String,decorators:[{type:e.Attribute,args:["tabindex"]}]},{type:e.Renderer2},{type:e.ElementRef}]},t.propDecorators={queryParams:[{type:e.Input}],fragment:[{type:e.Input}],queryParamsHandling:[{type:e.Input}],preserveFragment:[{type:e.Input}],skipLocationChange:[{type:e.Input}],replaceUrl:[{type:e.Input}],routerLink:[{type:e.Input}],preserveQueryParams:[{type:e.Input}],onClick:[{type:e.HostListener,args:["click"]}]},t}(),Se=function(){function t(t,e,r){var n=this;this.router=t,this.route=e,this.locationStrategy=r,this.commands=[],this.subscription=t.events.subscribe(function(t){t instanceof d&&n.updateTargetUrlAndHref()})}return Object.defineProperty(t.prototype,"routerLink",{set:function(t){this.commands=null!=t?Array.isArray(t)?t:[t]:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"preserveQueryParams",{set:function(t){e.isDevMode()&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead."),this.preserve=t},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){this.updateTargetUrlAndHref()},t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t.prototype.onClick=function(t,e,r,n){if(0!==t||e||r||n)return!0;if("string"==typeof this.target&&"_self"!=this.target)return!0;var o={skipLocationChange:we(this.skipLocationChange),replaceUrl:we(this.replaceUrl)};return this.router.navigateByUrl(this.urlTree,o),!1},t.prototype.updateTargetUrlAndHref=function(){this.href=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree))},Object.defineProperty(t.prototype,"urlTree",{get:function(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:we(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:we(this.preserveFragment)})},enumerable:!0,configurable:!0}),t.decorators=[{type:e.Directive,args:[{selector:"a[routerLink]"}]}],t.ctorParameters=function(){return[{type:ge},{type:Et},{type:o.LocationStrategy}]},t.propDecorators={target:[{type:e.HostBinding,args:["attr.target"]},{type:e.Input}],queryParams:[{type:e.Input}],fragment:[{type:e.Input}],queryParamsHandling:[{type:e.Input}],preserveFragment:[{type:e.Input}],skipLocationChange:[{type:e.Input}],replaceUrl:[{type:e.Input}],href:[{type:e.HostBinding}],routerLink:[{type:e.Input}],preserveQueryParams:[{type:e.Input}],onClick:[{type:e.HostListener,args:["click",["$event.button","$event.ctrlKey","$event.metaKey","$event.shiftKey"]]}]},t}();function we(t){return""===t||!!t}
|
|
99
|
+
*/(t),this.navigateByUrl(this.createUrlTree(t,e),e)},t.prototype.serializeUrl=function(t){return this.urlSerializer.serialize(t)},t.prototype.parseUrl=function(t){var e;try{e=this.urlSerializer.parse(t)}catch(r){e=this.malformedUriErrorHandler(r,this.urlSerializer,t)}return e},t.prototype.isActive=function(t,e){if(t instanceof $)return V(this.currentUrlTree,t,e);var r=this.parseUrl(t);return V(this.currentUrlTree,r,e)},t.prototype.removeEmptyProps=function(t){return Object.keys(t).reduce(function(e,r){var n=t[r];return null!==n&&void 0!==n&&(e[r]=n),e},{})},t.prototype.processNavigations=function(){var t=this;this.navigations.pipe(n.concatMap(function(e){return e?(t.executeScheduledNavigation(e),e.promise.catch(function(){})):r.of(null)})).subscribe(function(){})},t.prototype.scheduleNavigation=function(t,e,r,n){var o=this.navigations.value;if(o&&"imperative"!==e&&"imperative"===o.source&&o.rawUrl.toString()===t.toString())return Promise.resolve(!0);if(o&&"hashchange"==e&&"popstate"===o.source&&o.rawUrl.toString()===t.toString())return Promise.resolve(!0);if(o&&"popstate"==e&&"hashchange"===o.source&&o.rawUrl.toString()===t.toString())return Promise.resolve(!0);var i=null,a=null,u=new Promise(function(t,e){i=t,a=e}),s=++this.navigationId;return this.navigations.next({id:s,source:e,state:r,rawUrl:t,extras:n,resolve:i,reject:a,promise:u}),u.catch(function(t){return Promise.reject(t)})},t.prototype.executeScheduledNavigation=function(t){var e=this,r=t.id,n=t.rawUrl,o=t.extras,i=t.resolve,a=t.reject,u=t.source,s=t.state,c=this.urlHandlingStrategy.extract(n),l=!this.navigated||c.toString()!==this.currentUrlTree.toString();("reload"===this.onSameUrlNavigation||l)&&this.urlHandlingStrategy.shouldProcessUrl(n)?("eager"!==this.urlUpdateStrategy||o.skipLocationChange||this.setBrowserUrl(n,!!o.replaceUrl,r),this.events.next(new v(r,this.serializeUrl(c),u,s)),Promise.resolve().then(function(t){return e.runNavigate(c,n,!!o.skipLocationChange,!!o.replaceUrl,r,null)}).then(i,a)):l&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)?(this.events.next(new v(r,this.serializeUrl(c),u,s)),Promise.resolve().then(function(t){return e.runNavigate(c,n,!1,!1,r,Tt(c,e.rootComponentType).snapshot)}).then(i,a)):(this.rawUrlTree=n,i(null))},t.prototype.runNavigate=function(t,e,o,i,a,u){var s=this;return a!==this.navigationId?(this.events.next(new y(a,this.serializeUrl(t),"Navigation ID "+a+" is not equal to the current navigation id "+this.navigationId)),Promise.resolve(!1)):new Promise(function(c,l){var p,f=(u?r.of({appliedUrl:t,snapshot:u}):function d(t,e,r,n,o){return new wt(t,e,r,n,o).apply()}(s.ngModule.injector,s.configLoader,s.urlSerializer,t,s.config).pipe(n.mergeMap(function(e){return function r(t,e,n,o,i,a){return void 0===i&&(i="emptyOnly"),void 0===a&&(a="legacy"),new ee(t,e,n,o,i,a).recognize()}(s.rootComponentType,s.config,e,s.serializeUrl(e),s.paramsInheritanceStrategy,s.relativeLinkResolution).pipe(n.map(function(r){return s.events.next(new w(a,s.serializeUrl(t),s.serializeUrl(e),r)),{appliedUrl:e,snapshot:r}}))}))).pipe(n.mergeMap(function(u){return"boolean"==typeof u?r.of(u):s.hooks.beforePreactivation(u.snapshot,{navigationId:a,appliedUrlTree:t,rawUrlTree:e,skipLocationChange:o,replaceUrl:i}).pipe(n.map(function(){return u}))})).pipe(n.map(function(t){if("boolean"==typeof t)return t;var e=t.appliedUrl,r=t.snapshot;return(p=new Xt(r,s.routerState.snapshot,s.ngModule.injector,function(t){return s.triggerEvent(t)})).initialize(s.rootContexts),{appliedUrl:e,snapshot:r}})).pipe(n.mergeMap(function(e){if("boolean"==typeof e||s.navigationId!==a)return r.of(!1);var o=e.appliedUrl,i=e.snapshot;return s.triggerEvent(new b(a,s.serializeUrl(t),s.serializeUrl(o),i)),p.checkGuards().pipe(n.map(function(e){return s.triggerEvent(new C(a,s.serializeUrl(t),s.serializeUrl(o),i,e)),{appliedUrl:o,snapshot:i,shouldActivate:e}}))})).pipe(n.mergeMap(function(e){return"boolean"==typeof e||s.navigationId!==a?r.of(!1):e.shouldActivate&&p.isActivating()?(s.triggerEvent(new R(a,s.serializeUrl(t),s.serializeUrl(e.appliedUrl),e.snapshot)),p.resolveData(s.paramsInheritanceStrategy).pipe(n.map(function(){return s.triggerEvent(new P(a,s.serializeUrl(t),s.serializeUrl(e.appliedUrl),e.snapshot)),e}))):r.of(e)})).pipe(n.mergeMap(function(u){return"boolean"==typeof u||s.navigationId!==a?r.of(!1):s.hooks.afterPreactivation(u.snapshot,{navigationId:a,appliedUrlTree:t,rawUrlTree:e,skipLocationChange:o,replaceUrl:i}).pipe(n.map(function(){return u}))})).pipe(n.map(function(t){if("boolean"==typeof t||s.navigationId!==a)return!1;var e=t.appliedUrl,n=t.shouldActivate;return n?{appliedUrl:e,state:function o(t,e,n){var o=function t(e,n,o){if(o&&e.shouldReuseRoute(n.value,o.value.snapshot)){(c=o.value)._futureSnapshot=n.value;var i=function a(e,r,n){return r.children.map(function(r){var o,i;try{for(var a=h(n.children),u=a.next();!u.done;u=a.next()){var s=u.value;if(e.shouldReuseRoute(s.value.snapshot,r.value))return t(e,r,s)}}catch(t){o={error:t}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}return t(e,r)})}(e,n,o);return new Ut(c,i)}var u=e.retrieve(n.value);if(u){var s=u.route;return function t(e,r){if(e.value.routeConfig!==r.value.routeConfig)throw new Error("Cannot reattach ActivatedRouteSnapshot created from a different route");if(e.children.length!==r.children.length)throw new Error("Cannot reattach ActivatedRouteSnapshot with a different number of children");r.value._futureSnapshot=e.value;for(var n=0;n<e.children.length;++n)t(e.children[n],r.children[n])}(n,s),s}var c=function l(t){return new It(new r.BehaviorSubject(t.url),new r.BehaviorSubject(t.params),new r.BehaviorSubject(t.queryParams),new r.BehaviorSubject(t.fragment),new r.BehaviorSubject(t.data),t.outlet,t.component,t)}(n.value);return i=n.children.map(function(r){return t(e,r)}),new Ut(c,i)}(t,e._root,n?n._root:void 0);return new xt(o,e)}(s.routeReuseStrategy,t.snapshot,s.routerState),shouldActivate:n}:{appliedUrl:e,state:null,shouldActivate:n}}));s.activateRoutes(f,s.routerState,s.currentUrlTree,a,t,e,o,i,c,l)})},t.prototype.activateRoutes=function(t,e,r,n,o,i,a,u,s,c){var l,p=this;t.forEach(function(t){if("boolean"!=typeof t&&t.shouldActivate&&n===p.navigationId&&t.state){var r=t.state;p.currentUrlTree=t.appliedUrl,p.rawUrlTree=p.urlHandlingStrategy.merge(p.currentUrlTree,i),p.routerState=r,"deferred"!==p.urlUpdateStrategy||a||p.setBrowserUrl(p.rawUrlTree,u,n),new Se(p.routeReuseStrategy,r,e,function(t){return p.triggerEvent(t)}).activate(p.rootContexts),l=!0}else l=!1}).then(function(){l?(p.navigated=!0,p.lastSuccessfulId=n,p.events.next(new m(n,p.serializeUrl(o),p.serializeUrl(p.currentUrlTree))),s(!0)):(p.resetUrlToCurrentUrlTree(),p.events.next(new y(n,p.serializeUrl(o),"")),s(!1))},function(t){if(function a(t){return t&&t.ngNavigationCancelingError}(t))p.navigated=!0,p.resetStateAndUrl(e,r,i),p.events.next(new y(n,p.serializeUrl(o),t.message)),s(!1);else{p.resetStateAndUrl(e,r,i),p.events.next(new S(n,p.serializeUrl(o),t));try{s(p.errorHandler(t))}catch(t){c(t)}}})},t.prototype.setBrowserUrl=function(t,e,r){var n=this.urlSerializer.serialize(t);this.location.isCurrentPathEqualTo(n)||e?this.location.replaceState(n,"",{navigationId:r}):this.location.go(n,"",{navigationId:r})},t.prototype.resetStateAndUrl=function(t,e,r){this.routerState=t,this.currentUrlTree=e,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,r),this.resetUrlToCurrentUrlTree()},t.prototype.resetUrlToCurrentUrlTree=function(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",{navigationId:this.lastSuccessfulId})},t}(),Se=function(){function t(t,e,r,n){this.routeReuseStrategy=t,this.futureState=e,this.currState=r,this.forwardEvent=n}return t.prototype.activate=function(t){var e=this.futureState._root,r=this.currState?this.currState._root:null;this.deactivateChildRoutes(e,r,t),Dt(this.futureState.root),this.activateChildRoutes(e,r,t)},t.prototype.deactivateChildRoutes=function(t,e,r){var n=this,o=Et(e);t.children.forEach(function(t){var e=t.value.outlet;n.deactivateRoutes(t,o[e],r),delete o[e]}),W(o,function(t,e){n.deactivateRouteAndItsChildren(t,r)})},t.prototype.deactivateRoutes=function(t,e,r){var n=t.value,o=e?e.value:null;if(n===o)if(n.component){var i=r.getContext(n.outlet);i&&this.deactivateChildRoutes(t,e,i.children)}else this.deactivateChildRoutes(t,e,r);else o&&this.deactivateRouteAndItsChildren(e,r)},t.prototype.deactivateRouteAndItsChildren=function(t,e){this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,e):this.deactivateRouteAndOutlet(t,e)},t.prototype.detachAndStoreRouteSubtree=function(t,e){var r=e.getContext(t.value.outlet);if(r&&r.outlet){var n=r.outlet.detach(),o=r.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:n,route:t,contexts:o})}},t.prototype.deactivateRouteAndOutlet=function(t,e){var r=this,n=e.getContext(t.value.outlet);if(n){var o=Et(t),i=t.value.component?n.children:e;W(o,function(t,e){return r.deactivateRouteAndItsChildren(t,i)}),n.outlet&&(n.outlet.deactivate(),n.children.onOutletDeactivated())}},t.prototype.activateChildRoutes=function(t,e,r){var n=this,o=Et(e);t.children.forEach(function(t){n.activateRoutes(t,o[t.value.outlet],r),n.forwardEvent(new x(t.value.snapshot))}),t.children.length&&this.forwardEvent(new U(t.value.snapshot))},t.prototype.activateRoutes=function(t,e,r){var n=t.value,o=e?e.value:null;if(Dt(n),n===o)if(n.component){var i=r.getOrCreateContext(n.outlet);this.activateChildRoutes(t,e,i.children)}else this.activateChildRoutes(t,e,r);else if(n.component)if(i=r.getOrCreateContext(n.outlet),this.routeReuseStrategy.shouldAttach(n.snapshot)){var a=this.routeReuseStrategy.retrieve(n.snapshot);this.routeReuseStrategy.store(n.snapshot,null),i.children.onOutletReAttached(a.contexts),i.attachRef=a.componentRef,i.route=a.route.value,i.outlet&&i.outlet.attach(a.componentRef,a.route.value),we(a.route)}else{var u=function s(t){for(var e=t.parent;e;e=e.parent){var r=e.routeConfig;if(r&&r._loadedConfig)return r._loadedConfig;if(r&&r.component)return null}return null}(n.snapshot),c=u?u.module.componentFactoryResolver:null;i.attachRef=null,i.route=n,i.resolver=c,i.outlet&&i.outlet.activateWith(n,c),this.activateChildRoutes(t,null,i.children)}else this.activateChildRoutes(t,null,r)},t}();function we(t){Dt(t.value),t.children.forEach(we)}var be=function(){function t(t,e,r,n,o){this.router=t,this.route=e,this.commands=[],null==r&&n.setAttribute(o.nativeElement,"tabindex","0")}return Object.defineProperty(t.prototype,"routerLink",{set:function(t){this.commands=null!=t?Array.isArray(t)?t:[t]:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"preserveQueryParams",{set:function(t){e.isDevMode()&&console&&console.warn&&console.warn("preserveQueryParams is deprecated!, use queryParamsHandling instead."),this.preserve=t},enumerable:!0,configurable:!0}),t.prototype.onClick=function(){var t={skipLocationChange:Re(this.skipLocationChange),replaceUrl:Re(this.replaceUrl)};return this.router.navigateByUrl(this.urlTree,t),!0},Object.defineProperty(t.prototype,"urlTree",{get:function(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:Re(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:Re(this.preserveFragment)})},enumerable:!0,configurable:!0}),c([e.Input(),p("design:type",Object)],t.prototype,"queryParams",void 0),c([e.Input(),p("design:type",String)],t.prototype,"fragment",void 0),c([e.Input(),p("design:type",String)],t.prototype,"queryParamsHandling",void 0),c([e.Input(),p("design:type",Boolean)],t.prototype,"preserveFragment",void 0),c([e.Input(),p("design:type",Boolean)],t.prototype,"skipLocationChange",void 0),c([e.Input(),p("design:type",Boolean)],t.prototype,"replaceUrl",void 0),c([e.Input(),p("design:type",Object),p("design:paramtypes",[Object])],t.prototype,"routerLink",null),c([e.Input(),p("design:type",Boolean),p("design:paramtypes",[Boolean])],t.prototype,"preserveQueryParams",null),c([e.HostListener("click"),p("design:type",Function),p("design:paramtypes",[]),p("design:returntype",Boolean)],t.prototype,"onClick",null),c([e.Directive({selector:":not(a)[routerLink]"}),l(2,e.Attribute("tabindex")),p("design:paramtypes",[ye,It,String,e.Renderer2,e.ElementRef])],t)}(),Ce=function(){function t(t,e,r){var n=this;this.router=t,this.route=e,this.locationStrategy=r,this.commands=[],this.subscription=t.events.subscribe(function(t){t instanceof m&&n.updateTargetUrlAndHref()})}return Object.defineProperty(t.prototype,"routerLink",{set:function(t){this.commands=null!=t?Array.isArray(t)?t:[t]:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"preserveQueryParams",{set:function(t){e.isDevMode()&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead."),this.preserve=t},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){this.updateTargetUrlAndHref()},t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t.prototype.onClick=function(t,e,r,n){if(0!==t||e||r||n)return!0;if("string"==typeof this.target&&"_self"!=this.target)return!0;var o={skipLocationChange:Re(this.skipLocationChange),replaceUrl:Re(this.replaceUrl)};return this.router.navigateByUrl(this.urlTree,o),!1},t.prototype.updateTargetUrlAndHref=function(){this.href=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree))},Object.defineProperty(t.prototype,"urlTree",{get:function(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:Re(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:Re(this.preserveFragment)})},enumerable:!0,configurable:!0}),c([e.HostBinding("attr.target"),e.Input(),p("design:type",String)],t.prototype,"target",void 0),c([e.Input(),p("design:type",Object)],t.prototype,"queryParams",void 0),c([e.Input(),p("design:type",String)],t.prototype,"fragment",void 0),c([e.Input(),p("design:type",String)],t.prototype,"queryParamsHandling",void 0),c([e.Input(),p("design:type",Boolean)],t.prototype,"preserveFragment",void 0),c([e.Input(),p("design:type",Boolean)],t.prototype,"skipLocationChange",void 0),c([e.Input(),p("design:type",Boolean)],t.prototype,"replaceUrl",void 0),c([e.HostBinding(),p("design:type",String)],t.prototype,"href",void 0),c([e.Input(),p("design:type",Object),p("design:paramtypes",[Object])],t.prototype,"routerLink",null),c([e.Input(),p("design:type",Boolean),p("design:paramtypes",[Boolean])],t.prototype,"preserveQueryParams",null),c([e.HostListener("click",["$event.button","$event.ctrlKey","$event.metaKey","$event.shiftKey"]),p("design:type",Function),p("design:paramtypes",[Number,Boolean,Boolean,Boolean]),p("design:returntype",Boolean)],t.prototype,"onClick",null),c([e.Directive({selector:"a[routerLink]"}),p("design:paramtypes",[ye,It,o.LocationStrategy])],t)}();function Re(t){return""===t||!!t}
|
|
100
100
|
/**
|
|
101
101
|
* @license
|
|
102
102
|
* Copyright Google Inc. All Rights Reserved.
|
|
103
103
|
*
|
|
104
104
|
* Use of this source code is governed by an MIT-style license that can be
|
|
105
105
|
* found in the LICENSE file at https://angular.io/license
|
|
106
|
-
*/var
|
|
106
|
+
*/var Pe=function(){function t(t,e,r,n){var o=this;this.router=t,this.element=e,this.renderer=r,this.cdr=n,this.classes=[],this.isActive=!1,this.routerLinkActiveOptions={exact:!1},this.subscription=t.events.subscribe(function(t){t instanceof m&&o.update()})}return t.prototype.ngAfterContentInit=function(){var t=this;this.links.changes.subscribe(function(e){return t.update()}),this.linksWithHrefs.changes.subscribe(function(e){return t.update()}),this.update()},Object.defineProperty(t.prototype,"routerLinkActive",{set:function(t){var e=Array.isArray(t)?t:t.split(" ");this.classes=e.filter(function(t){return!!t})},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){this.update()},t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t.prototype.update=function(){var t=this;this.links&&this.linksWithHrefs&&this.router.navigated&&Promise.resolve().then(function(){var e=t.hasActiveLinks();t.isActive!==e&&(t.isActive=e,t.classes.forEach(function(r){e?t.renderer.addClass(t.element.nativeElement,r):t.renderer.removeClass(t.element.nativeElement,r)}))})},t.prototype.isLinkActive=function(t){var e=this;return function(r){return t.isActive(r.urlTree,e.routerLinkActiveOptions.exact)}},t.prototype.hasActiveLinks=function(){return this.links.some(this.isLinkActive(this.router))||this.linksWithHrefs.some(this.isLinkActive(this.router))},c([e.ContentChildren(be,{descendants:!0}),p("design:type",e.QueryList)],t.prototype,"links",void 0),c([e.ContentChildren(Ce,{descendants:!0}),p("design:type",e.QueryList)],t.prototype,"linksWithHrefs",void 0),c([e.Input(),p("design:type",Object)],t.prototype,"routerLinkActiveOptions",void 0),c([e.Input(),p("design:type",Object),p("design:paramtypes",[Object])],t.prototype,"routerLinkActive",null),c([e.Directive({selector:"[routerLinkActive]",exportAs:"routerLinkActive"}),p("design:paramtypes",[ye,e.ElementRef,e.Renderer2,e.ChangeDetectorRef])],t)}(),Oe=function Oe(){this.outlet=null,this.route=null,this.resolver=null,this.children=new Ae,this.attachRef=null},Ae=function(){function t(){this.contexts=new Map}return t.prototype.onChildOutletCreated=function(t,e){var r=this.getOrCreateContext(t);r.outlet=e,this.contexts.set(t,r)},t.prototype.onChildOutletDestroyed=function(t){var e=this.getContext(t);e&&(e.outlet=null)},t.prototype.onOutletDeactivated=function(){var t=this.contexts;return this.contexts=new Map,t},t.prototype.onOutletReAttached=function(t){this.contexts=t},t.prototype.getOrCreateContext=function(t){var e=this.getContext(t);return e||(e=new Oe,this.contexts.set(t,e)),e},t.prototype.getContext=function(t){return this.contexts.get(t)||null},t}(),_e=function(){function t(t,r,n,o,i){this.parentContexts=t,this.location=r,this.resolver=n,this.changeDetector=i,this.activated=null,this._activatedRoute=null,this.activateEvents=new e.EventEmitter,this.deactivateEvents=new e.EventEmitter,this.name=o||j,t.onChildOutletCreated(this.name,this)}return t.prototype.ngOnDestroy=function(){this.parentContexts.onChildOutletDestroyed(this.name)},t.prototype.ngOnInit=function(){if(!this.activated){var t=this.parentContexts.getContext(this.name);t&&t.route&&(t.attachRef?this.attach(t.attachRef,t.route):this.activateWith(t.route,t.resolver||null))}},Object.defineProperty(t.prototype,"isActivated",{get:function(){return!!this.activated},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"component",{get:function(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activatedRoute",{get:function(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activatedRouteData",{get:function(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}},enumerable:!0,configurable:!0}),t.prototype.detach=function(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();var t=this.activated;return this.activated=null,this._activatedRoute=null,t},t.prototype.attach=function(t,e){this.activated=t,this._activatedRoute=e,this.location.insert(t.hostView)},t.prototype.deactivate=function(){if(this.activated){var t=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}},t.prototype.activateWith=function(t,e){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=t;var r=(e=e||this.resolver).resolveComponentFactory(t._futureSnapshot.routeConfig.component),n=this.parentContexts.getOrCreateContext(this.name).children,o=new Ue(t,n,this.location.injector);this.activated=this.location.createComponent(r,this.location.length,o),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)},c([e.Output("activate"),p("design:type",Object)],t.prototype,"activateEvents",void 0),c([e.Output("deactivate"),p("design:type",Object)],t.prototype,"deactivateEvents",void 0),c([e.Directive({selector:"router-outlet",exportAs:"outlet"}),l(3,e.Attribute("name")),p("design:paramtypes",[Ae,e.ViewContainerRef,e.ComponentFactoryResolver,String,e.ChangeDetectorRef])],t)}(),Ue=function(){function t(t,e,r){this.route=t,this.childContexts=e,this.parent=r}return t.prototype.get=function(t,e){return t===It?this.route:t===Ae?this.childContexts:this.parent.get(t,e)},t}(),Ee=function Ee(){},xe=function(){function t(){}return t.prototype.preload=function(t,e){return e().pipe(n.catchError(function(){return r.of(null)}))},t}(),Te=function(){function t(){}return t.prototype.preload=function(t,e){return r.of(null)},t}(),Ie=function(){function t(t,e,r,n,o){this.router=t,this.injector=n,this.preloadingStrategy=o,this.loader=new he(e,r,function(e){return t.triggerEvent(new O(e))},function(e){return t.triggerEvent(new A(e))})}return t.prototype.setUpPreloading=function(){var t=this;this.subscription=this.router.events.pipe(n.filter(function(t){return t instanceof m}),n.concatMap(function(){return t.preload()})).subscribe(function(){})},t.prototype.preload=function(){var t=this.injector.get(e.NgModuleRef);return this.processRoutes(t,this.router.config)},t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t.prototype.processRoutes=function(t,e){var o,i,a=[];try{for(var u=h(e),s=u.next();!s.done;s=u.next()){var c=s.value;if(c.loadChildren&&!c.canLoad&&c._loadedConfig){var l=c._loadedConfig;a.push(this.processRoutes(l.module,l.routes))}else c.loadChildren&&!c.canLoad?a.push(this.preloadConfig(t,c)):c.children&&a.push(this.processRoutes(t,c.children))}}catch(t){o={error:t}}finally{try{s&&!s.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}return r.from(a).pipe(n.mergeAll(),n.map(function(t){}))},t.prototype.preloadConfig=function(t,e){var r=this;return this.preloadingStrategy.preload(e,function(){return r.loader.load(t.injector,e).pipe(n.mergeMap(function(t){return e._loadedConfig=t,r.processRoutes(t.module,t.routes)}))})},c([e.Injectable(),p("design:paramtypes",[ye,e.NgModuleFactoryLoader,e.Compiler,e.Injector,Ee])],t)}(),je=function(){function t(t,e,r){void 0===r&&(r={}),this.router=t,this.viewportScroller=e,this.options=r,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},r.scrollPositionRestoration=r.scrollPositionRestoration||"disabled",r.anchorScrolling=r.anchorScrolling||"disabled"}return t.prototype.init=function(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()},t.prototype.createScrollEvents=function(){var t=this;return this.router.events.subscribe(function(e){e instanceof v?(t.store[t.lastId]=t.viewportScroller.getScrollPosition(),t.lastSource=e.navigationTrigger,t.restoredId=e.restoredState?e.restoredState.navigationId:0):e instanceof m&&(t.lastId=e.id,t.scheduleScrollEvent(e,t.router.parseUrl(e.urlAfterRedirects).fragment))})},t.prototype.consumeScrollEvents=function(){var t=this;return this.router.events.subscribe(function(e){e instanceof T&&(e.position?"top"===t.options.scrollPositionRestoration?t.viewportScroller.scrollToPosition([0,0]):"enabled"===t.options.scrollPositionRestoration&&t.viewportScroller.scrollToPosition(e.position):e.anchor&&"enabled"===t.options.anchorScrolling?t.viewportScroller.scrollToAnchor(e.anchor):"disabled"!==t.options.scrollPositionRestoration&&t.viewportScroller.scrollToPosition([0,0]))})},t.prototype.scheduleScrollEvent=function(t,e){this.router.triggerEvent(new T(t,"popstate"===this.lastSource?this.store[this.restoredId]:null,e))},t.prototype.ngOnDestroy=function(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()},t}(),ke=[_e,be,Ce,Pe,I],Le=new e.InjectionToken("ROUTER_CONFIGURATION"),Me=new e.InjectionToken("ROUTER_FORROOT_GUARD"),Ne=[o.Location,{provide:tt,useClass:et},{provide:ye,useFactory:Be,deps:[e.ApplicationRef,tt,Ae,o.Location,e.Injector,e.NgModuleFactoryLoader,e.Compiler,pe,Le,[fe,new e.Optional],[ce,new e.Optional]]},Ae,{provide:It,useFactory:We,deps:[ye]},{provide:e.NgModuleFactoryLoader,useClass:e.SystemJsNgModuleLoader},Ie,Te,xe,{provide:Le,useValue:{enableTracing:!1}}];
|
|
107
107
|
/**
|
|
108
108
|
* @license
|
|
109
109
|
* Copyright Google Inc. All Rights Reserved.
|
|
110
110
|
*
|
|
111
111
|
* Use of this source code is governed by an MIT-style license that can be
|
|
112
112
|
* found in the LICENSE file at https://angular.io/license
|
|
113
|
-
*/function
|
|
113
|
+
*/function De(){return new e.NgProbeToken("Router",ye)}var qe=function(){function t(t,e){}var r;return r=t,t.forRoot=function(t,n){return{ngModule:r,providers:[Ne,Fe(t),{provide:Me,useFactory:Ge,deps:[[ye,new e.Optional,new e.SkipSelf]]},{provide:Le,useValue:n||{}},{provide:o.LocationStrategy,useFactory:He,deps:[o.PlatformLocation,[new e.Inject(o.APP_BASE_HREF),new e.Optional],Le]},{provide:je,useFactory:ze,deps:[ye,o.ViewportScroller,Le]},{provide:Ee,useExisting:n&&n.preloadingStrategy?n.preloadingStrategy:Te},{provide:e.NgProbeToken,multi:!0,useFactory:De},Ke()]}},t.forChild=function(t){return{ngModule:r,providers:[Fe(t)]}},r=c([e.NgModule({declarations:ke,exports:ke,entryComponents:[I]}),l(0,e.Optional()),l(0,e.Inject(Me)),l(1,e.Optional()),p("design:paramtypes",[Object,ye])],t)}();function ze(t,e,r){return r.scrollOffset&&e.setOffset(r.scrollOffset),new je(t,e,r)}function He(t,e,r){return void 0===r&&(r={}),r.useHash?new o.HashLocationStrategy(t,e):new o.PathLocationStrategy(t,e)}function Ge(t){if(t)throw new Error("RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.");return"guarded"}function Fe(t){return[{provide:e.ANALYZE_FOR_ENTRY_COMPONENTS,multi:!0,useValue:t},{provide:pe,multi:!0,useValue:t}]}function Be(t,e,r,n,o,a,u,s,c,l,p){void 0===c&&(c={});var h=new ye(null,e,r,n,o,a,u,F(s));if(l&&(h.urlHandlingStrategy=l),p&&(h.routeReuseStrategy=p),c.errorHandler&&(h.errorHandler=c.errorHandler),c.malformedUriErrorHandler&&(h.malformedUriErrorHandler=c.malformedUriErrorHandler),c.enableTracing){var f=i.ɵgetDOM();h.events.subscribe(function(t){f.logGroup("Router Event: "+t.constructor.name),f.log(t.toString()),f.log(t),f.logGroupEnd()})}return c.onSameUrlNavigation&&(h.onSameUrlNavigation=c.onSameUrlNavigation),c.paramsInheritanceStrategy&&(h.paramsInheritanceStrategy=c.paramsInheritanceStrategy),c.urlUpdateStrategy&&(h.urlUpdateStrategy=c.urlUpdateStrategy),c.relativeLinkResolution&&(h.relativeLinkResolution=c.relativeLinkResolution),h}function We(t){return t.routerState.root}var Qe=function(){function t(t){this.injector=t,this.initNavigation=!1,this.resultOfPreactivationDone=new r.Subject}return t.prototype.appInitializer=function(){var t=this;return this.injector.get(o.LOCATION_INITIALIZED,Promise.resolve(null)).then(function(){var e=null,n=new Promise(function(t){return e=t}),o=t.injector.get(ye),i=t.injector.get(Le);if(t.isLegacyDisabled(i)||t.isLegacyEnabled(i))e(!0);else if("disabled"===i.initialNavigation)o.setUpLocationChangeListener(),e(!0);else{if("enabled"!==i.initialNavigation)throw new Error("Invalid initialNavigation options: '"+i.initialNavigation+"'");o.hooks.afterPreactivation=function(){return t.initNavigation?r.of(null):(t.initNavigation=!0,e(!0),t.resultOfPreactivationDone)},o.initialNavigation()}return n})},t.prototype.bootstrapListener=function(t){var r=this.injector.get(Le),n=this.injector.get(Ie),o=this.injector.get(je),i=this.injector.get(ye),a=this.injector.get(e.ApplicationRef);t===a.components[0]&&(this.isLegacyEnabled(r)?i.initialNavigation():this.isLegacyDisabled(r)&&i.setUpLocationChangeListener(),n.setUpPreloading(),o.init(),i.resetRootComponentType(a.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())},t.prototype.isLegacyEnabled=function(t){return"legacy_enabled"===t.initialNavigation||!0===t.initialNavigation||void 0===t.initialNavigation},t.prototype.isLegacyDisabled=function(t){return"legacy_disabled"===t.initialNavigation||!1===t.initialNavigation},c([e.Injectable(),p("design:paramtypes",[e.Injector])],t)}();function Ze(t){return t.appInitializer.bind(t)}function Ve(t){return t.bootstrapListener.bind(t)}var $e=new e.InjectionToken("Router Initializer");function Ke(){return[Qe,{provide:e.APP_INITIALIZER,multi:!0,useFactory:Ze,deps:[Qe]},{provide:$e,useFactory:Ve,deps:[Qe]},{provide:e.APP_BOOTSTRAP_LISTENER,multi:!0,useExisting:$e}]}
|
|
114
114
|
/**
|
|
115
115
|
* @license
|
|
116
116
|
* Copyright Google Inc. All Rights Reserved.
|
|
117
117
|
*
|
|
118
118
|
* Use of this source code is governed by an MIT-style license that can be
|
|
119
119
|
* found in the LICENSE file at https://angular.io/license
|
|
120
|
-
*/var
|
|
120
|
+
*/var Ye=new e.Version("6.1.10");
|
|
121
121
|
/**
|
|
122
122
|
* @license
|
|
123
123
|
* Copyright Google Inc. All Rights Reserved.
|
|
@@ -145,4 +145,4 @@ function d(t,e,r,n,o){if(0===r.length)return Nt(e.root,e.root,e,n,o);var i=funct
|
|
|
145
145
|
*
|
|
146
146
|
* Use of this source code is governed by an MIT-style license that can be
|
|
147
147
|
* found in the LICENSE file at https://angular.io/license
|
|
148
|
-
*/t.ɵangular_packages_router_router_a=
|
|
148
|
+
*/t.ɵangular_packages_router_router_a=Me,t.ɵangular_packages_router_router_h=Qe,t.ɵangular_packages_router_router_c=ze,t.ɵangular_packages_router_router_i=Ze,t.ɵangular_packages_router_router_j=Ve,t.ɵangular_packages_router_router_e=Ge,t.ɵangular_packages_router_router_d=He,t.ɵangular_packages_router_router_k=Ke,t.ɵangular_packages_router_router_g=We,t.ɵangular_packages_router_router_b=De,t.ɵangular_packages_router_router_f=Be,t.ɵangular_packages_router_router_n=je,t.ɵangular_packages_router_router_l=Ot,t.ɵangular_packages_router_router_m=Ut,t.RouterLink=be,t.RouterLinkWithHref=Ce,t.RouterLinkActive=Pe,t.RouterOutlet=_e,t.ActivationEnd=x,t.ActivationStart=E,t.ChildActivationEnd=U,t.ChildActivationStart=_,t.GuardsCheckEnd=C,t.GuardsCheckStart=b,t.NavigationCancel=y,t.NavigationEnd=m,t.NavigationError=S,t.NavigationStart=v,t.ResolveEnd=P,t.ResolveStart=R,t.RouteConfigLoadEnd=A,t.RouteConfigLoadStart=O,t.RouterEvent=g,t.RoutesRecognized=w,t.Scroll=T,t.RouteReuseStrategy=ce,t.Router=ye,t.ROUTES=pe,t.ROUTER_CONFIGURATION=Le,t.ROUTER_INITIALIZER=$e,t.RouterModule=qe,t.provideRoutes=Fe,t.ChildrenOutletContexts=Ae,t.OutletContext=Oe,t.NoPreloading=Te,t.PreloadAllModules=xe,t.PreloadingStrategy=Ee,t.RouterPreloader=Ie,t.ActivatedRoute=It,t.ActivatedRouteSnapshot=kt,t.RouterState=xt,t.RouterStateSnapshot=Lt,t.PRIMARY_OUTLET=j,t.convertToParamMap=L,t.UrlHandlingStrategy=fe,t.DefaultUrlSerializer=et,t.UrlSegment=Y,t.UrlSegmentGroup=K,t.UrlSerializer=tt,t.UrlTree=$,t.VERSION=Ye,t.ɵEmptyOutletComponent=I,t.ɵROUTER_PROVIDERS=Ne,t.ɵflatten=F,Object.defineProperty(t,"__esModule",{value:!0})});
|