@angular/router 6.0.3 → 6.0.7
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 +21 -15
- package/bundles/router-testing.umd.js.map +1 -1
- package/bundles/router-testing.umd.min.js +2 -2
- package/bundles/router-testing.umd.min.js.map +1 -1
- package/bundles/router-upgrade.umd.js +10 -1
- package/bundles/router-upgrade.umd.js.map +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 +348 -706
- package/bundles/router.umd.js.map +1 -1
- package/bundles/router.umd.min.js +18 -18
- package/bundles/router.umd.min.js.map +1 -1
- package/esm2015/index.js +2 -2
- package/esm2015/public_api.js +2 -2
- package/esm2015/src/components/empty_outlet.js +28 -0
- package/esm2015/src/config.js +13 -6
- package/esm2015/src/directives/router_link.js +29 -47
- package/esm2015/src/directives/router_link_active.js +9 -18
- package/esm2015/src/directives/router_outlet.js +8 -17
- package/esm2015/src/index.js +2 -2
- package/esm2015/src/private_export.js +2 -1
- package/esm2015/src/router.js +4 -4
- package/esm2015/src/router_config_loader.js +3 -3
- package/esm2015/src/router_module.js +11 -22
- package/esm2015/src/router_preloader.js +6 -13
- package/esm2015/src/version.js +1 -1
- package/esm2015/testing/src/router_testing_module.js +2 -20
- package/esm5/index.js +5 -1
- package/esm5/public_api.js +6 -1
- package/esm5/src/apply_redirects.js +14 -26
- package/esm5/src/components/empty_outlet.js +28 -0
- package/esm5/src/config.js +15 -6
- package/esm5/src/create_router_state.js +1 -1
- package/esm5/src/create_url_tree.js +2 -4
- package/esm5/src/directives/router_link.js +33 -33
- package/esm5/src/directives/router_link_active.js +9 -9
- package/esm5/src/directives/router_outlet.js +10 -22
- package/esm5/src/events.js +86 -340
- package/esm5/src/index.js +1 -1
- package/esm5/src/interfaces.js +1 -1
- package/esm5/src/pre_activation.js +12 -68
- package/esm5/src/private_export.js +2 -1
- package/esm5/src/recognize.js +5 -5
- package/esm5/src/route_reuse_strategy.js +3 -23
- package/esm5/src/router.js +49 -311
- package/esm5/src/router_config_loader.js +5 -4
- package/esm5/src/router_module.js +15 -44
- package/esm5/src/router_outlet_context.js +6 -46
- package/esm5/src/router_preloader.js +10 -71
- package/esm5/src/router_state.js +49 -231
- package/esm5/src/shared.js +1 -1
- package/esm5/src/url_handling_strategy.js +3 -23
- package/esm5/src/url_tree.js +33 -239
- package/esm5/src/utils/collection.js +1 -1
- package/esm5/src/utils/tree.js +6 -36
- package/esm5/src/version.js +7 -2
- package/esm5/testing/index.js +5 -1
- package/esm5/testing/public_api.js +6 -1
- package/esm5/testing/src/router_testing_module.js +7 -15
- package/esm5/testing/src/testing.js +6 -1
- package/esm5/upgrade/index.js +5 -1
- package/esm5/upgrade/public_api.js +6 -1
- package/esm5/upgrade/src/upgrade.js +1 -1
- package/fesm2015/router.js +100 -64
- package/fesm2015/router.js.map +1 -1
- package/fesm2015/testing.js +2 -4
- package/fesm2015/testing.js.map +1 -1
- package/fesm2015/upgrade.js +1 -1
- package/fesm2015/upgrade.js.map +1 -1
- package/fesm5/router.js +349 -708
- package/fesm5/router.js.map +1 -1
- package/fesm5/testing.js +21 -15
- package/fesm5/testing.js.map +1 -1
- package/fesm5/upgrade.js +10 -1
- package/fesm5/upgrade.js.map +1 -1
- package/package.json +4 -4
- package/router.metadata.json +1 -1
- package/src/components/empty_outlet.d.ts +11 -0
- package/src/config.d.ts +4 -1
- package/src/private_export.d.ts +1 -0
- package/testing.d.ts +0 -5
- package/testing.metadata.json +1 -1
- package/upgrade.d.ts +0 -5
- package/upgrade.metadata.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v6.0.
|
|
2
|
+
* @license Angular v6.0.7
|
|
3
3
|
* (c) 2010-2018 Google, Inc. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -10,70 +10,70 @@
|
|
|
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 p,f=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}(p=function p(t,e){this.id=t,this.url=e}),d=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}(p),g=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}(p),v=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}(p),m=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}(p),y=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}(p),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}(p),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"ResolveStart(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},e}(p),S=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}(p),b=function(){function t(t){this.route=t}return t.prototype.toString=function(){return"RouteConfigLoadStart(path: "+this.route.path+")"},t}(),R=function(){function t(t){this.route=t}return t.prototype.toString=function(){return"RouteConfigLoadEnd(path: "+this.route.path+")"},t}(),P=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ChildActivationStart(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),A=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ChildActivationEnd(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),_=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ActivationStart(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),O=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ActivationEnd(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),x="
|
|
13
|
+
*/var p,f=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}(p=function p(t,e){this.id=t,this.url=e}),d=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}(p),g=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}(p),v=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}(p),m=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}(p),y=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}(p),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}(p),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"ResolveStart(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},e}(p),S=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}(p),b=function(){function t(t){this.route=t}return t.prototype.toString=function(){return"RouteConfigLoadStart(path: "+this.route.path+")"},t}(),R=function(){function t(t){this.route=t}return t.prototype.toString=function(){return"RouteConfigLoadEnd(path: "+this.route.path+")"},t}(),P=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ChildActivationStart(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),A=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ChildActivationEnd(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),_=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ActivationStart(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),O=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ActivationEnd(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),x=function(){function t(){}return t.decorators=[{type:r.Component,args:[{template:"<router-outlet></router-outlet>"}]}],t}(),U="primary",E=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 T(t){return new E(t)}function I(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 j=function j(t,e){this.routes=t,this.module=e};function k(t,e){void 0===e&&(e="");for(var r=0;r<t.length;r++){var n=t[r];L(n,M(e,n))}}function L(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!==U)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&&k(t.children,e)}function M(t,e){return e?t||e.path?t&&!e.path?t+"/":!t&&e.path?e.path:t+"/"+e.path:"":t}function D(t){var e=t.children&&t.children.map(D),r=e?s({},t,{children:e}):s({},t);return!r.component&&(e||r.loadChildren)&&r.outlet&&r.outlet!==U&&(r.component=x),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 N(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 q(t){return Array.prototype.concat.apply([],t)}function z(t){return t.length>0?t[t.length-1]:null}function G(t,e){for(var r in t)t.hasOwnProperty(r)&&e(t[r],r)}function H(t){return t.pipe(o.mergeAll(),o.every(function(t){return!0===t}))}function F(t){return r.ɵisObservable(t)?t:r.ɵisPromise(t)?n.from(Promise.resolve(t)):n.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 F(t,e,r){return r?function n(t,e){return D(t,e)}(t.queryParams,e.queryParams)&&function t(e,r){if(!V(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!!V(a=r.segments.slice(0,o.length),o)&&!n.hasChildren();if(r.segments.length===o.length){if(!V(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!!V(r.segments,a)&&!!r.children[x]&&e(r.children[x],n,u)}(e,r,r.segments)}(t.root,e.root)}var W=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=E(this.queryParams)),this._queryParamMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return Y.serialize(this)},t}(),B=function(){function t(t,e){var r=this;this.segments=t,this.children=e,this.parent=null,z(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 J(this)},t}(),Q=function(){function t(t,e){this.path=t,this.parameters=e}return Object.defineProperty(t.prototype,"parameterMap",{get:function(){return this._parameterMap||(this._parameterMap=E(this.parameters)),this._parameterMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return ot(this)},t}();function V(t,e){return t.length===e.length&&t.every(function(t,r){return t.path===e[r].path})}function $(t,e){var r=[];return z(t.children,function(t,n){n===x&&(r=r.concat(e(t,n)))}),z(t.children,function(t,n){n!==x&&(r=r.concat(e(t,n)))}),r}var Z=function Z(){},K=function(){function t(){}return t.prototype.parse=function(t){var e=new ct(t);return new W(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())},t.prototype.serialize=function(t){return"/"+function t(e,r){if(!e.hasChildren())return J(e);if(r){var n=e.children[x]?t(e.children[x],!1):"",o=[];return z(e.children,function(e,r){r!==x&&o.push(r+":"+t(e,!1))}),o.length>0?n+"("+o.join("//")+")":n}var i=$(e,function(r,n){return n===x?[t(e.children[x],!1)]:[n+":"+t(r,!1)]});return J(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 tt(e)+"="+tt(t)}).join("&"):tt(e)+"="+tt(r)});return e.length?"?"+e.join("&"):""}(t.queryParams)+("string"==typeof t.fragment?"#"+function r(t){return encodeURI(t)}(t.fragment):"")},t}(),Y=new K;function J(t){return t.segments.map(function(t){return ot(t)}).join("/")}function X(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function tt(t){return X(t).replace(/%3B/gi,";")}function et(t){return X(t).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function rt(t){return decodeURIComponent(t)}function nt(t){return rt(t.replace(/\+/g,"%20"))}function ot(t){return""+et(t.path)+function e(t){return Object.keys(t).map(function(e){return";"+et(e)+"="+et(t[e])}).join("")}(t.parameters)}var it=/^[^\/()?;=#]+/;function at(t){var e=t.match(it);return e?e[0]:""}var ut=/^[^=?&#]+/,st=/^[^?&#]+/,ct=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 B([],{}):new B([],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 B(t,e)),r},t.prototype.parseSegment=function(){var t=at(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new Error("Empty path url segment cannot have parameters: '"+this.remaining+"'.");return this.capture(t),new Q(rt(t),this.parseMatrixParams())},t.prototype.parseMatrixParams=function(){for(var t={};this.consumeOptional(";");)this.parseParam(t);return t},t.prototype.parseParam=function(t){var e=at(this.remaining);if(e){this.capture(e);var r="";if(this.consumeOptional("=")){var n=at(this.remaining);n&&this.capture(r=n)}t[rt(e)]=rt(r)}},t.prototype.parseQueryParam=function(t){var e=function r(t){var e=t.match(ut);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(st);return e?e[0]:""}(this.remaining);o&&this.capture(n=o)}var a=nt(e),u=nt(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=at(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 B([],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}(),lt=function lt(t){this.segmentGroup=t||null},ht=function ht(t){this.urlTree=t};function pt(t){return new n.Observable(function(e){return e.error(new lt(t))})}function ft(t){return new n.Observable(function(e){return e.error(new ht(t))})}function dt(t){return new n.Observable(function(e){return e.error(new Error("Only absolute redirects can have named outlets. redirectTo: '"+t+"'"))})}var gt=function(){function t(t,e,n,o,i){this.configLoader=e,this.urlSerializer=n,this.urlTree=o,this.config=i,this.allowRedirects=!0,this.ngModule=t.get(r.NgModuleRef)}return t.prototype.apply=function(){var t=this;return this.expandSegmentGroup(this.ngModule,this.config,this.urlTree.root,x).pipe(o.map(function(e){return t.createUrlTree(e,t.urlTree.queryParams,t.urlTree.fragment)})).pipe(o.catchError(function(e){if(e instanceof ht)return t.allowRedirects=!1,t.match(e.urlTree);if(e instanceof lt)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(o.map(function(r){return e.createUrlTree(r,t.queryParams,t.fragment)})).pipe(o.catchError(function(t){if(t instanceof lt)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 B([],((n={})[x]=t,n)):t;return new W(o,e,r)},t.prototype.expandSegmentGroup=function(t,e,r,n){return 0===r.segments.length&&r.hasChildren()?this.expandChildren(t,e,r).pipe(o.map(function(t){return new B([],t)})):this.expandSegment(t,r,e,r.segments,n,!0)},t.prototype.expandChildren=function(t,e,r){var i=this;return function a(t,e){if(0===Object.keys(t).length)return n.of({});var r=[],i=[],a={};return z(t,function(t,n){var u=e(n,t).pipe(o.map(function(t){return a[n]=t}));n===x?r.push(u):i.push(u)}),n.of.apply(null,r.concat(i)).pipe(o.concatAll(),o.last(),o.map(function(){return a}))}(r.children,function(r,n){return i.expandSegmentGroup(t,e,n,r)})},t.prototype.expandSegment=function(t,e,r,i,a,u){var s=this;return n.of.apply(void 0,h(r)).pipe(o.map(function(c){return s.expandSegmentAgainstRoute(t,e,r,c,i,a,u).pipe(o.catchError(function(t){if(t instanceof lt)return n.of(null);throw t}))}),o.concatAll(),o.first(function(t){return!!t}),o.catchError(function(t,r){if(t instanceof n.EmptyError||"EmptyError"===t.name){if(s.noLeftoversInUrl(e,i,a))return n.of(new B([],{}));throw new lt(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?pt(e):void 0===n.redirectTo?this.matchSegmentAgainstRoute(t,e,n,o):a&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(t,e,r,n,o,i):pt(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,n){var i=this,a=this.applyRedirectCommands([],r.redirectTo,{});return r.redirectTo.startsWith("/")?ft(a):this.lineralizeSegments(r,a).pipe(o.mergeMap(function(r){var o=new B(r,{});return i.expandSegment(t,o,e,r,n,!1)}))},t.prototype.expandRegularSegmentAgainstRouteUsingRedirect=function(t,e,r,n,i,a){var u=this,s=vt(e,n,i),c=s.consumedSegments,l=s.lastChild,h=s.positionalParamSegments;if(!s.matched)return pt(e);var p=this.applyRedirectCommands(c,n.redirectTo,h);return n.redirectTo.startsWith("/")?ft(p):this.lineralizeSegments(n,p).pipe(o.mergeMap(function(n){return u.expandSegment(t,e,r,n.concat(i.slice(l)),a,!1)}))},t.prototype.matchSegmentAgainstRoute=function(t,e,r,i){var a=this;if("**"===r.path)return r.loadChildren?this.configLoader.load(t.injector,r).pipe(o.map(function(t){return r._loadedConfig=t,new B(i,{})})):n.of(new B(i,{}));var u=vt(e,r,i),l=u.consumedSegments,h=u.lastChild;if(!u.matched)return pt(e);var p=i.slice(h);return this.getChildConfig(t,r).pipe(o.mergeMap(function(t){var r=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 yt(t,e,r)&&Ct(r)!==x})}(t,r,n)?{segmentGroup:mt(new B(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 B([],{}))}}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 B(r,t.children)))),slicedSegments:[]}:0===r.length&&function a(t,e,r){return r.some(function(r){return yt(t,e,r)})}(t,r,n)?{segmentGroup:mt(new B(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;yt(t,e,h)&&!n[Ct(h)]&&(a[Ct(h)]=new B([],{}))}}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(r,i,f).pipe(o.map(function(t){return new B(l,t)})):0===i.length&&0===d.length?n.of(new B(l,{})):a.expandSegment(r,f,i,d,x,!0).pipe(o.map(function(t){return new B(l.concat(t.segments),t.children)}))}))},t.prototype.getChildConfig=function(t,e){var r=this;return e.children?n.of(new I(e.children,t)):e.loadChildren?void 0!==e._loadedConfig?n.of(e._loadedConfig):function i(t,e){var r=e.canLoad;return r&&0!==r.length?G(n.from(r).pipe(o.map(function(r){var n=t.get(r);return H(n.canLoad?n.canLoad(e):n(e))}))):n.of(!0)}(t.injector,e).pipe(o.mergeMap(function(i){return i?r.configLoader.load(t.injector,e).pipe(o.map(function(t){return e._loadedConfig=t,t})):function a(t){return new n.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)})):n.of(new I([],t))},t.prototype.lineralizeSegments=function(t,e){for(var r=[],o=e.root;;){if(r=r.concat(o.segments),0===o.numberOfChildren)return n.of(r);if(o.numberOfChildren>1||!o.children[x])return dt(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 W(o,this.createQueryParams(e.queryParams,this.urlTree.queryParams),e.fragment)},t.prototype.createQueryParams=function(t,e){var r={};return z(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 z(e.children,function(e,i){a[i]=o.createSegmentGroup(t,e,r,n)}),new B(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 vt(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||T)(r,t,e);return n?{matched:!0,consumedSegments:n.consumed,lastChild:n.consumed.length,positionalParamSegments:n.posParams}:{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}}function mt(t){if(1===t.numberOfChildren&&t.children[x]){var e=t.children[x];return new B(t.segments.concat(e.segments),e.children)}return t}function yt(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 W(t,e,r){return r?function n(t,e){return N(t,e)}(t.queryParams,e.queryParams)&&function t(e,r){if(!$(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!!$(a=r.segments.slice(0,o.length),o)&&!n.hasChildren();if(r.segments.length===o.length){if(!$(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!!$(r.segments,a)&&!!r.children[U]&&e(r.children[U],n,u)}(e,r,r.segments)}(t.root,e.root)}var B=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=T(this.queryParams)),this._queryParamMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return J.serialize(this)},t}(),Q=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 X(this)},t}(),V=function(){function t(t,e){this.path=t,this.parameters=e}return Object.defineProperty(t.prototype,"parameterMap",{get:function(){return this._parameterMap||(this._parameterMap=T(this.parameters)),this._parameterMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return it(this)},t}();function $(t,e){return t.length===e.length&&t.every(function(t,r){return t.path===e[r].path})}function Z(t,e){var r=[];return G(t.children,function(t,n){n===U&&(r=r.concat(e(t,n)))}),G(t.children,function(t,n){n!==U&&(r=r.concat(e(t,n)))}),r}var K=function K(){},Y=function(){function t(){}return t.prototype.parse=function(t){var e=new lt(t);return new B(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())},t.prototype.serialize=function(t){return"/"+function t(e,r){if(!e.hasChildren())return X(e);if(r){var n=e.children[U]?t(e.children[U],!1):"",o=[];return G(e.children,function(e,r){r!==U&&o.push(r+":"+t(e,!1))}),o.length>0?n+"("+o.join("//")+")":n}var i=Z(e,function(r,n){return n===U?[t(e.children[U],!1)]:[n+":"+t(r,!1)]});return X(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 et(e)+"="+et(t)}).join("&"):et(e)+"="+et(r)});return e.length?"?"+e.join("&"):""}(t.queryParams)+("string"==typeof t.fragment?"#"+function r(t){return encodeURI(t)}(t.fragment):"")},t}(),J=new Y;function X(t){return t.segments.map(function(t){return it(t)}).join("/")}function tt(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function et(t){return tt(t).replace(/%3B/gi,";")}function rt(t){return tt(t).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function nt(t){return decodeURIComponent(t)}function ot(t){return nt(t.replace(/\+/g,"%20"))}function it(t){return""+rt(t.path)+function e(t){return Object.keys(t).map(function(e){return";"+rt(e)+"="+rt(t[e])}).join("")}(t.parameters)}var at=/^[^\/()?;=#]+/;function ut(t){var e=t.match(at);return e?e[0]:""}var st=/^[^=?&#]+/,ct=/^[^?&#]+/,lt=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 Q([],{}):new Q([],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[U]=new Q(t,e)),r},t.prototype.parseSegment=function(){var t=ut(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new Error("Empty path url segment cannot have parameters: '"+this.remaining+"'.");return this.capture(t),new V(nt(t),this.parseMatrixParams())},t.prototype.parseMatrixParams=function(){for(var t={};this.consumeOptional(";");)this.parseParam(t);return t},t.prototype.parseParam=function(t){var e=ut(this.remaining);if(e){this.capture(e);var r="";if(this.consumeOptional("=")){var n=ut(this.remaining);n&&this.capture(r=n)}t[nt(e)]=nt(r)}},t.prototype.parseQueryParam=function(t){var e=function r(t){var e=t.match(st);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(ct);return e?e[0]:""}(this.remaining);o&&this.capture(n=o)}var a=ot(e),u=ot(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=ut(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=U);var i=this.parseChildren();e[o]=1===Object.keys(i).length?i[U]:new Q([],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}(),ht=function ht(t){this.segmentGroup=t||null},pt=function pt(t){this.urlTree=t};function ft(t){return new n.Observable(function(e){return e.error(new ht(t))})}function dt(t){return new n.Observable(function(e){return e.error(new pt(t))})}function gt(t){return new n.Observable(function(e){return e.error(new Error("Only absolute redirects can have named outlets. redirectTo: '"+t+"'"))})}var vt=function(){function t(t,e,n,o,i){this.configLoader=e,this.urlSerializer=n,this.urlTree=o,this.config=i,this.allowRedirects=!0,this.ngModule=t.get(r.NgModuleRef)}return t.prototype.apply=function(){var t=this;return this.expandSegmentGroup(this.ngModule,this.config,this.urlTree.root,U).pipe(o.map(function(e){return t.createUrlTree(e,t.urlTree.queryParams,t.urlTree.fragment)})).pipe(o.catchError(function(e){if(e instanceof pt)return t.allowRedirects=!1,t.match(e.urlTree);if(e instanceof ht)throw t.noMatchError(e);throw e}))},t.prototype.match=function(t){var e=this;return this.expandSegmentGroup(this.ngModule,this.config,t.root,U).pipe(o.map(function(r){return e.createUrlTree(r,t.queryParams,t.fragment)})).pipe(o.catchError(function(t){if(t instanceof ht)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 Q([],((n={})[U]=t,n)):t;return new B(o,e,r)},t.prototype.expandSegmentGroup=function(t,e,r,n){return 0===r.segments.length&&r.hasChildren()?this.expandChildren(t,e,r).pipe(o.map(function(t){return new Q([],t)})):this.expandSegment(t,r,e,r.segments,n,!0)},t.prototype.expandChildren=function(t,e,r){var i=this;return function a(t,e){if(0===Object.keys(t).length)return n.of({});var r=[],i=[],a={};return G(t,function(t,n){var u=e(n,t).pipe(o.map(function(t){return a[n]=t}));n===U?r.push(u):i.push(u)}),n.of.apply(null,r.concat(i)).pipe(o.concatAll(),o.last(),o.map(function(){return a}))}(r.children,function(r,n){return i.expandSegmentGroup(t,e,n,r)})},t.prototype.expandSegment=function(t,e,r,i,a,u){var s=this;return n.of.apply(void 0,h(r)).pipe(o.map(function(c){return s.expandSegmentAgainstRoute(t,e,r,c,i,a,u).pipe(o.catchError(function(t){if(t instanceof ht)return n.of(null);throw t}))}),o.concatAll(),o.first(function(t){return!!t}),o.catchError(function(t,r){if(t instanceof n.EmptyError||"EmptyError"===t.name){if(s.noLeftoversInUrl(e,i,a))return n.of(new Q([],{}));throw new ht(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 wt(n)!==i?ft(e):void 0===n.redirectTo?this.matchSegmentAgainstRoute(t,e,n,o):a&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(t,e,r,n,o,i):ft(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,n){var i=this,a=this.applyRedirectCommands([],r.redirectTo,{});return r.redirectTo.startsWith("/")?dt(a):this.lineralizeSegments(r,a).pipe(o.mergeMap(function(r){var o=new Q(r,{});return i.expandSegment(t,o,e,r,n,!1)}))},t.prototype.expandRegularSegmentAgainstRouteUsingRedirect=function(t,e,r,n,i,a){var u=this,s=mt(e,n,i),c=s.consumedSegments,l=s.lastChild,h=s.positionalParamSegments;if(!s.matched)return ft(e);var p=this.applyRedirectCommands(c,n.redirectTo,h);return n.redirectTo.startsWith("/")?dt(p):this.lineralizeSegments(n,p).pipe(o.mergeMap(function(n){return u.expandSegment(t,e,r,n.concat(i.slice(l)),a,!1)}))},t.prototype.matchSegmentAgainstRoute=function(t,e,r,i){var a=this;if("**"===r.path)return r.loadChildren?this.configLoader.load(t.injector,r).pipe(o.map(function(t){return r._loadedConfig=t,new Q(i,{})})):n.of(new Q(i,{}));var u=mt(e,r,i),l=u.consumedSegments,h=u.lastChild;if(!u.matched)return ft(e);var p=i.slice(h);return this.getChildConfig(t,r).pipe(o.mergeMap(function(t){var r=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 Ct(t,e,r)&&wt(r)!==U})}(t,r,n)?{segmentGroup:yt(new Q(e,function i(t,e){var r,n,o={};o[U]=e;try{for(var i=c(t),a=i.next();!a.done;a=i.next()){var u=a.value;""===u.path&&wt(u)!==U&&(o[wt(u)]=new Q([],{}))}}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 Q(r,t.children)))),slicedSegments:[]}:0===r.length&&function a(t,e,r){return r.some(function(r){return Ct(t,e,r)})}(t,r,n)?{segmentGroup:yt(new Q(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;Ct(t,e,h)&&!n[wt(h)]&&(a[wt(h)]=new Q([],{}))}}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(r,i,f).pipe(o.map(function(t){return new Q(l,t)})):0===i.length&&0===d.length?n.of(new Q(l,{})):a.expandSegment(r,f,i,d,U,!0).pipe(o.map(function(t){return new Q(l.concat(t.segments),t.children)}))}))},t.prototype.getChildConfig=function(t,e){var r=this;return e.children?n.of(new j(e.children,t)):e.loadChildren?void 0!==e._loadedConfig?n.of(e._loadedConfig):function i(t,e){var r=e.canLoad;return r&&0!==r.length?H(n.from(r).pipe(o.map(function(r){var n=t.get(r);return F(n.canLoad?n.canLoad(e):n(e))}))):n.of(!0)}(t.injector,e).pipe(o.mergeMap(function(i){return i?r.configLoader.load(t.injector,e).pipe(o.map(function(t){return e._loadedConfig=t,t})):function a(t){return new n.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)})):n.of(new j([],t))},t.prototype.lineralizeSegments=function(t,e){for(var r=[],o=e.root;;){if(r=r.concat(o.segments),0===o.numberOfChildren)return n.of(r);if(o.numberOfChildren>1||!o.children[U])return gt(t.redirectTo);o=o.children[U]}},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 B(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 Q(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 mt(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||I)(r,t,e);return n?{matched:!0,consumedSegments:n.consumed,lastChild:n.consumed.length,positionalParamSegments:n.posParams}:{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}}function yt(t){if(1===t.numberOfChildren&&t.children[U]){var e=t.children[U];return new Q(t.segments.concat(e.segments),e.children)}return t}function Ct(t,e,r){return(!(t.hasChildren()||e.length>0)||"full"!==r.pathMatch)&&""===r.path&&void 0!==r.redirectTo}function wt(t){return t.outlet||U}
|
|
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 St=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=bt(t,this._root);return e?e.children.map(function(t){return t.value}):[]},t.prototype.firstChild=function(t){var e=bt(t,this._root);return e&&e.children.length>0?e.children[0].value:null},t.prototype.siblings=function(t){var e=Rt(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 Rt(t,this._root).map(function(t){return t.value})},t}();function bt(t,e){if(t===e.value)return e;try{for(var r=c(e.children),n=r.next();!n.done;n=r.next()){var o=bt(t,n.value);if(o)return o}}catch(t){i={error:t}}finally{try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(i)throw i.error}}return null;var i,a}function Rt(t,e){if(t===e.value)return[e];try{for(var r=c(e.children),n=r.next();!n.done;n=r.next()){var o=Rt(t,n.value);if(o.length)return o.unshift(e),o}}catch(t){i={error:t}}finally{try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(i)throw i.error}}return[];var i,a}var Pt=function(){function t(t,e){this.value=t,this.children=e}return t.prototype.toString=function(){return"TreeNode("+this.value+")"},t}();function At(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 _t=function(t){function e(e,r){var n=t.call(this,e)||this;return n.snapshot=r,It(n,e),n}return u(e,t),e.prototype.toString=function(){return this.snapshot.toString()},e}(St);function Ot(t,e){var r=function o(t,e){var r=new Et([],{},{},"",{},U,e,null,t.root,-1,{});return new Tt("",new Pt(r,[]))}(t,e),i=new n.BehaviorSubject([new V("",{})]),a=new n.BehaviorSubject({}),u=new n.BehaviorSubject({}),s=new n.BehaviorSubject({}),c=new n.BehaviorSubject(""),l=new xt(i,a,s,c,u,U,e,r.root);return l.snapshot=r.root,new _t(new Pt(l,[]),r)}var xt=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(o.map(function(t){return T(t)}))),this._paramMap},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(o.map(function(t){return T(t)}))),this._queryParamMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return this.snapshot?this.snapshot.toString():"Future("+this._futureSnapshot+")"},t}();function Ut(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 Et=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=T(this.params)),this._paramMap},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=T(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}(),Tt=function(t){function e(e,r){var n=t.call(this,r)||this;return n.url=e,It(n,r),n}return u(e,t),e.prototype.toString=function(){return jt(this._root)},e}(St);function It(t,e){e.value._routerState=t,e.children.forEach(function(e){return It(t,e)})}function jt(t){var e=t.children.length>0?" { "+t.children.map(jt).join(", ")+" } ":"";return""+t.value+e}function kt(t){if(t.snapshot){var e=t.snapshot,r=t._futureSnapshot;t.snapshot=r,N(e.queryParams,r.queryParams)||t.queryParams.next(r.queryParams),e.fragment!==r.fragment&&t.fragment.next(r.fragment),N(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(!N(t[r],e[r]))return!1;return!0}(e.url,r.url)||t.url.next(r.url),N(e.data,r.data)||t.data.next(r.data)}else t.snapshot=t._futureSnapshot,t.data.next(t._futureSnapshot.data)}function Lt(t,e){return N(t.params,e.params)&&function r(t,e){return $(t,e)&&t.every(function(t,r){return N(t.parameters,e[r].parameters)})}(t.url,e.url)&&!(!t.parent!=!e.parent)&&(!t.parent||Lt(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 Mt(t){return"object"==typeof t&&null!=t&&!t.outlets&&!t.segmentPath}function Dt(t,e,r,n,o){var i={};return n&&G(n,function(t,e){i[e]=Array.isArray(t)?t.map(function(t){return""+t}):""+t}),new B(r.root===t?e:function t(e,r,n){var o={};return G(e.children,function(e,i){o[i]=e===r?n:t(e,r,n)}),new Q(e.segments,o)}(r.root,t,e),i,o)}var Nt=function(){function t(t,e,r){if(this.isAbsolute=t,this.numberOfDoubleDots=e,this.commands=r,t&&r.length>0&&Mt(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!==z(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}(),qt=function qt(t,e,r){this.segmentGroup=t,this.processChildren=e,this.index=r};function zt(t){return"object"==typeof t&&null!=t&&t.outlets?t.outlets[U]:""+t}function Gt(t,e,r){if(t||(t=new Q([],{})),0===t.segments.length&&t.hasChildren())return Ht(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=zt(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(!Qt(u,s,a))return i;n+=2}else{if(!Qt(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 Q(t.segments.slice(0,n.pathIndex),{});return a.children[U]=new Q(t.segments.slice(n.pathIndex),t.children),Ht(a,0,i)}return n.match&&0===i.length?new Q(t.segments,{}):n.match&&!t.hasChildren()?Ft(t,e,r):n.match?Ht(t,0,i):Ft(t,e,r)}function Ht(t,e,r){if(0===r.length)return new Q(t.segments,{});var n=function o(t){return"object"!=typeof t[0]?((e={})[U]=t,e):void 0===t[0].outlets?((r={})[U]=t,r):t[0].outlets;var e,r}(r),i={};return G(n,function(r,n){null!==r&&(i[n]=Gt(t.children[n],e,r))}),G(t.children,function(t,e){void 0===n[e]&&(i[e]=t)}),new Q(t.segments,i)}function Ft(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=Wt(r[o].outlets);return new Q(n,i)}if(0===o&&Mt(r[0]))n.push(new V(t.segments[e].path,r[0])),o++;else{var a=zt(r[o]),u=o<r.length-1?r[o+1]:null;a&&u&&Mt(u)?(n.push(new V(a,Bt(u))),o+=2):(n.push(new V(a,{})),o++)}}return new Q(n,{})}function Wt(t){var e={};return G(t,function(t,r){null!==t&&(e[r]=Ft(new Q([],{}),0,t))}),e}function Bt(t){var e={};return G(t,function(t,r){return e[r]=""+t}),e}function Qt(t,e,r){return t==r.path&&N(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 Vt=function Vt(t){this.path=t,this.route=this.path[this.path.length-1]},$t=function $t(t,e){this.component=t,this.route=e},Zt=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(o.mergeMap(function(e){return e?t.runCanActivateChecks():n.of(!1)})):n.of(!0)},t.prototype.resolveData=function(t){var e=this;return this.isActivating()?n.from(this.canActivateChecks).pipe(o.concatMap(function(r){return e.runResolve(r.route,t)}),o.reduce(function(t,e){return t})):n.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=At(e);t.children.forEach(function(t){o.setupRouteGuards(t,i[t.value.outlet],r,n.concat([t.value])),delete i[t.value.outlet]}),G(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 Vt(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 $t(a.outlet.component,i))}else i&&this.deactivateRouteAndItsChildren(e,a),this.canActivateChecks.push(new Vt(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!Lt(t,e)||!N(t.queryParams,e.queryParams);case"paramsChange":default:return!Lt(t,e)}},t.prototype.deactivateRouteAndItsChildren=function(t,e){var r=this,n=At(t),o=t.value;G(n,function(t,n){r.deactivateRouteAndItsChildren(t,o.component?e?e.children.getContext(n):null:e)}),this.canDeactivateChecks.push(new $t(o.component&&e&&e.outlet&&e.outlet.isActivated?e.outlet.component:null,o))},t.prototype.runCanDeactivateChecks=function(){var t=this;return n.from(this.canDeactivateChecks).pipe(o.mergeMap(function(e){return t.runCanDeactivate(e.component,e.route)}),o.every(function(t){return!0===t}))},t.prototype.runCanActivateChecks=function(){var t=this;return n.from(this.canActivateChecks).pipe(o.concatMap(function(e){return H(n.from([t.fireChildActivationStart(e.route.parent),t.fireActivationStart(e.route),t.runCanActivateChild(e.path),t.runCanActivate(e.route)]))}),o.every(function(t){return!0===t}))},t.prototype.fireActivationStart=function(t){return null!==t&&this.forwardEvent&&this.forwardEvent(new _(t)),n.of(!0)},t.prototype.fireChildActivationStart=function(t){return null!==t&&this.forwardEvent&&this.forwardEvent(new P(t)),n.of(!0)},t.prototype.runCanActivate=function(t){var e=this,r=t.routeConfig?t.routeConfig.canActivate:null;return r&&0!==r.length?H(n.from(r).pipe(o.map(function(r){var n=e.getToken(r,t);return F(n.canActivate?n.canActivate(t,e.future):n(t,e.future)).pipe(o.first())}))):n.of(!0)},t.prototype.runCanActivateChild=function(t){var e=this,r=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 H(n.from(i).pipe(o.map(function(t){return H(n.from(t.guards).pipe(o.map(function(n){var i=e.getToken(n,t.node);return F(i.canActivateChild?i.canActivateChild(r,e.future):i(r,e.future)).pipe(o.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 r=this,i=e&&e.routeConfig?e.routeConfig.canDeactivate:null;return i&&0!==i.length?n.from(i).pipe(o.mergeMap(function(n){var i=r.getToken(n,e);return F(i.canDeactivate?i.canDeactivate(t,e,r.curr,r.future):i(t,e,r.curr,r.future)).pipe(o.first())})).pipe(o.every(function(t){return!0===t})):n.of(!0)},t.prototype.runResolve=function(t,e){return this.resolveNode(t._resolve,t).pipe(o.map(function(r){return t._resolvedData=r,t.data=s({},t.data,Ut(t,e).resolve),null}))},t.prototype.resolveNode=function(t,e){var r=this,i=Object.keys(t);if(0===i.length)return n.of({});if(1===i.length){var a=i[0];return this.getResolver(t[a],e).pipe(o.map(function(t){return(e={})[a]=t,e;var e}))}var u={};return n.from(i).pipe(o.mergeMap(function(n){return r.getResolver(t[n],e).pipe(o.map(function(t){return u[n]=t,t}))})).pipe(o.last(),o.map(function(){return u}))},t.prototype.getResolver=function(t,e){var r=this.getToken(t,e);return F(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}(),Kt=function ht(){},Yt=function(){function t(t,e,r,n,o){this.rootComponentType=t,this.config=e,this.urlTree=r,this.url=n,this.paramsInheritanceStrategy=o}return t.prototype.recognize=function(){try{var t=te(this.urlTree.root,[],[],this.config).segmentGroup,e=this.processSegmentGroup(this.config,t,U),r=new Et([],Object.freeze({}),Object.freeze(s({},this.urlTree.queryParams)),this.urlTree.fragment,{},U,this.rootComponentType,null,this.urlTree.root,-1,{}),o=new Pt(r,e),i=new Tt(this.url,o);return this.inheritParamsAndData(i._root),n.of(i)}catch(t){return new n.Observable(function(e){return e.error(t)})}},t.prototype.inheritParamsAndData=function(t){var e=this,r=t.value,n=Ut(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=Z(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===U?-1:e.value.outlet===U?1:t.value.outlet.localeCompare(e.value.outlet)})}(n),n},t.prototype.processSegment=function(t,e,r,n){try{for(var o=c(t),i=o.next();!i.done;i=o.next()){var a=i.value;try{return this.processSegmentAgainstRoute(a,e,r,n)}catch(t){if(!(t instanceof Kt))throw t}}}catch(t){u={error:t}}finally{try{i&&!i.done&&(s=o.return)&&s.call(o)}finally{if(u)throw u.error}}if(this.noLeftoversInUrl(e,r,n))return[];throw new Kt;var u,s},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 Kt;if((t.outlet||U)!==n)throw new Kt;var o,i=[],a=[];if("**"===t.path){var u=r.length>0?z(r).parameters:{};o=new Et(r,u,Object.freeze(s({},this.urlTree.queryParams)),this.urlTree.fragment,ne(t),n,t.component,t,Jt(e),Xt(e)+r.length,oe(t))}else{var c=function l(t,e,r){if(""===e.path){if("full"===e.pathMatch&&(t.hasChildren()||r.length>0))throw new Kt;return{consumedSegments:[],lastChild:0,parameters:{}}}var n=(e.matcher||I)(r,t,e);if(!n)throw new Kt;var o={};G(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 Et(i,c.parameters,Object.freeze(s({},this.urlTree.queryParams)),this.urlTree.fragment,ne(t),n,t.component,t,Jt(e),Xt(e)+i.length,oe(t))}var h=function p(t){return t.children?t.children:t.loadChildren?t._loadedConfig.routes:[]}(t),f=te(e,i,a,h),d=f.segmentGroup,g=f.slicedSegments;if(0===g.length&&d.hasChildren()){var v=this.processChildren(h,d);return[new Pt(o,v)]}if(0===h.length&&0===g.length)return[new Pt(o,[])];var m=this.processSegment(h,d,g,U);return[new Pt(o,m)]},t}();function Jt(t){for(var e=t;e._sourceSegment;)e=e._sourceSegment;return e}function Xt(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 te(t,e,r,n){if(r.length>0&&function o(t,e,r){return r.some(function(r){return ee(t,e,r)&&re(r)!==U})}(t,r,n)){var i=new Q(e,function a(t,e,r,n){var o,i,a={};a[U]=n,n._sourceSegment=t,n._segmentIndexShift=e.length;try{for(var u=c(r),s=u.next();!s.done;s=u.next()){var l=s.value;if(""===l.path&&re(l)!==U){var h=new Q([],{});h._sourceSegment=t,h._segmentIndexShift=e.length,a[re(l)]=h}}}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 Q(r,t.children)));return i._sourceSegment=t,i._segmentIndexShift=e.length,{segmentGroup:i,slicedSegments:[]}}if(0===r.length&&function u(t,e,r){return r.some(function(r){return ee(t,e,r)})}(t,r,n)){var l=new Q(t.segments,function h(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;if(ee(t,e,h)&&!n[re(h)]){var p=new Q([],{});p._sourceSegment=t,p._segmentIndexShift=t.segments.length,a[re(h)]=p}}}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));return l._sourceSegment=t,l._segmentIndexShift=e.length,{segmentGroup:l,slicedSegments:r}}var p=new Q(t.segments,t.children);return p._sourceSegment=t,p._segmentIndexShift=e.length,{segmentGroup:p,slicedSegments:r}}function ee(t,e,r){return(!(t.hasChildren()||e.length>0)||"full"!==r.pathMatch)&&""===r.path&&void 0===r.redirectTo}function re(t){return t.outlet||U}function ne(t){return t.data||{}}function oe(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 ie=function ie(){},ae=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}(),ue=new r.InjectionToken("ROUTES"),se=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(o.map(function(n){r.onLoadEndListener&&r.onLoadEndListener(e);var o=n.create(t);return new j(q(o.injector.get(ue)).map(D),o)}))},t.prototype.loadModuleFactory=function(t){var e=this;return"string"==typeof t?n.from(this.loader.load(t)):F(t()).pipe(o.mergeMap(function(t){return t instanceof r.NgModuleFactory?n.of(t):n.from(e.compiler.compileModuleAsync(t))}))},t}(),ce=function ce(){},le=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 he(t){throw t}function pe(t){return n.of(null)}var fe=function(){function t(t,e,o,i,a,u,s,c){var l=this;this.rootComponentType=t,this.urlSerializer=e,this.rootContexts=o,this.location=i,this.config=c,this.navigations=new n.BehaviorSubject(null),this.navigationId=0,this.events=new n.Subject,this.errorHandler=he,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:pe,afterPreactivation:pe},this.urlHandlingStrategy=new le,this.routeReuseStrategy=new ae,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.ngModule=a.get(r.NgModuleRef),this.resetConfig(c),this.currentUrlTree=function h(){return new B(new Q([],{}),{},null)}(),this.rawUrlTree=this.currentUrlTree,this.configLoader=new se(u,s,function(t){return l.triggerEvent(new b(t))},function(t){return l.triggerEvent(new R(t))}),this.routerState=Ot(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.urlSerializer.parse(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){k(t),this.config=t.map(D),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,e){void 0===e&&(e={});var n=e.relativeTo,o=e.queryParams,i=e.fragment,a=e.preserveQueryParams,u=e.queryParamsHandling,c=e.preserveFragment;r.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,f=null;if(u)switch(u){case"merge":f=s({},this.currentUrlTree.queryParams,o);break;case"preserve":f=this.currentUrlTree.queryParams;break;default:f=o||null}else f=a?this.currentUrlTree.queryParams:o||null;return null!==f&&(f=this.removeEmptyProps(f)),
|
|
85
85
|
/**
|
|
86
86
|
* @license
|
|
87
87
|
* Copyright Google Inc. All Rights Reserved.
|
|
@@ -89,35 +89,35 @@ function le(t){throw t}function he(t){return n.of(null)}var pe=function(){functi
|
|
|
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 d(t,e,r,n,o){if(0===r.length)return
|
|
92
|
+
function d(t,e,r,n,o){if(0===r.length)return Dt(e.root,e.root,e,n,o);var i=function a(t){if("string"==typeof t[0]&&1===t.length&&"/"===t[0])return new Nt(!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 G(n.outlets,function(t,e){i[e]="string"==typeof t?t.split("/"):t}),h(t,[{outlets:i}])}if(n.segmentPath)return h(t,[n.segmentPath])}return"string"!=typeof n?h(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):h(t,[n])},[]);return new Nt(r,e,n)}(r);if(i.toRoot())return Dt(e.root,new Q([],{}),e,n,o);var u=function s(t,e,r){if(t.isAbsolute)return new qt(e.root,!0,0);if(-1===r.snapshot._lastPathIndex)return new qt(r.snapshot._urlSegment,!0,0);var n=Mt(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 qt(n,!1,o-i)}(r.snapshot._urlSegment,r.snapshot._lastPathIndex+n,t.numberOfDoubleDots)}(i,e,t),c=u.processChildren?Ht(u.segmentGroup,u.index,i.commands):Gt(u.segmentGroup,u.index,i.commands);return Dt(u.segmentGroup,c,e,n,o)}(l,this.currentUrlTree,t,f,p)},t.prototype.navigateByUrl=function(t,e){void 0===e&&(e={skipLocationChange:!1});var r=t instanceof B?t:this.parseUrl(t),n=this.urlHandlingStrategy.merge(r,this.rawUrlTree);return this.scheduleNavigation(n,"imperative",null,e)},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){return this.urlSerializer.parse(t)},t.prototype.isActive=function(t,e){if(t instanceof W)return F(this.currentUrlTree,t,e);var r=this.urlSerializer.parse(t);return F(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(o.concatMap(function(e){return e?(t.executeScheduledNavigation(e),e.promise.catch(function(){})):n.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)?(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,_t(c,e.rootComponentType).snapshot)}).then(i,a)):(this.rawUrlTree=n,i(null))},t.prototype.runNavigate=function(t,e,r,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?n.of({appliedUrl:t,snapshot:u}):function d(t,e,r,n,o){return new gt(t,e,r,n,o).apply()}(s.ngModule.injector,s.configLoader,s.urlSerializer,t,s.config).pipe(o.mergeMap(function(e){return function r(t,e,n,o,i){return void 0===i&&(i="emptyOnly"),new Kt(t,e,n,o,i).recognize()}(s.rootComponentType,s.config,e,s.serializeUrl(e),s.paramsInheritanceStrategy).pipe(o.map(function(r){return s.events.next(new m(a,s.serializeUrl(t),s.serializeUrl(e),r)),{appliedUrl:e,snapshot:r}}))}))).pipe(o.mergeMap(function(t){return"boolean"==typeof t?n.of(t):s.hooks.beforePreactivation(t.snapshot).pipe(o.map(function(){return t}))})).pipe(o.map(function(t){if("boolean"==typeof t)return t;var e=t.appliedUrl,r=t.snapshot;return(p=new $t(r,s.routerState.snapshot,s.ngModule.injector,function(t){return s.triggerEvent(t)})).initialize(s.rootContexts),{appliedUrl:e,snapshot:r}})).pipe(o.mergeMap(function(e){if("boolean"==typeof e||s.navigationId!==a)return n.of(!1);var r=e.appliedUrl,i=e.snapshot;return s.triggerEvent(new y(a,s.serializeUrl(t),s.serializeUrl(r),i)),p.checkGuards().pipe(o.map(function(e){return s.triggerEvent(new C(a,s.serializeUrl(t),s.serializeUrl(r),i,e)),{appliedUrl:r,snapshot:i,shouldActivate:e}}))})).pipe(o.mergeMap(function(e){return"boolean"==typeof e||s.navigationId!==a?n.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(o.map(function(){return s.triggerEvent(new S(a,s.serializeUrl(t),s.serializeUrl(e.appliedUrl),e.snapshot)),e}))):n.of(e)})).pipe(o.mergeMap(function(t){return"boolean"==typeof t||s.navigationId!==a?n.of(!1):s.hooks.afterPreactivation(t.snapshot).pipe(o.map(function(){return t}))})).pipe(o.map(function(t){if("boolean"==typeof t||s.navigationId!==a)return!1;var e=t.appliedUrl,r=t.shouldActivate;return r?{appliedUrl:e,state:function o(t,e,r){var o=function t(e,r,o){if(o&&e.shouldReuseRoute(r.value,o.value.snapshot)){(l=o.value)._futureSnapshot=r.value;var i=function a(e,r,n){return r.children.map(function(r){try{for(var o=c(n.children),i=o.next();!i.done;i=o.next()){var a=i.value;if(e.shouldReuseRoute(a.value.snapshot,r.value))return t(e,r,a)}}catch(t){u={error:t}}finally{try{i&&!i.done&&(s=o.return)&&s.call(o)}finally{if(u)throw u.error}}return t(e,r);var u,s})}(e,r,o);return new Rt(l,i)}var u=e.retrieve(r.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])}(r,s),s}var l=function h(t){return new Ot(new n.BehaviorSubject(t.url),new n.BehaviorSubject(t.params),new n.BehaviorSubject(t.queryParams),new n.BehaviorSubject(t.fragment),new n.BehaviorSubject(t.data),t.outlet,t.component,t)}(r.value);return i=r.children.map(function(r){return t(e,r)}),new Rt(l,i)}(t,e._root,r?r._root:void 0);return new At(o,e)}(s.routeReuseStrategy,t.snapshot,s.routerState),shouldActivate:r}:{appliedUrl:e,state:null,shouldActivate:r}}));s.activateRoutes(f,s.routerState,s.currentUrlTree,a,t,e,r,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;if(h.currentUrlTree=t.appliedUrl,h.rawUrlTree=h.urlHandlingStrategy.merge(h.currentUrlTree,i),h.routerState=r,!a){var o=h.urlSerializer.serialize(h.rawUrlTree);h.location.isCurrentPathEqualTo(o)||u?h.location.replaceState(o,"",{navigationId:n}):h.location.go(o,"",{navigationId:n})}new fe(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.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}(),fe=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),jt(this.futureState.root),this.activateChildRoutes(e,r,t)},t.prototype.deactivateChildRoutes=function(t,e,r){var n=this,o=Pt(e);t.children.forEach(function(t){var e=t.value.outlet;n.deactivateRoutes(t,o[e],r),delete o[e]}),z(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=Pt(t),i=t.value.component?n.children:e;z(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=Pt(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 A(t.value.snapshot))},t.prototype.activateRoutes=function(t,e,r){var n=t.value,o=e?e.value:null;if(jt(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),de(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 de(t){jt(t.value),t.children.forEach(de)}var ge=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){r.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:me(this.skipLocationChange),replaceUrl:me(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:me(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:me(this.preserveFragment)})},enumerable:!0,configurable:!0}),t.decorators=[{type:r.Directive,args:[{selector:":not(a)[routerLink]"}]}],t.ctorParameters=function(){return[{type:pe},{type:Ot},{type:void 0,decorators:[{type:r.Attribute,args:["tabindex"]}]},{type:r.Renderer2},{type:r.ElementRef}]},t.propDecorators={queryParams:[{type:r.Input}],fragment:[{type:r.Input}],queryParamsHandling:[{type:r.Input}],preserveFragment:[{type:r.Input}],skipLocationChange:[{type:r.Input}],replaceUrl:[{type:r.Input}],routerLink:[{type:r.Input}],preserveQueryParams:[{type:r.Input}],onClick:[{type:r.HostListener,args:["click"]}]},t}(),ve=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){r.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:me(this.skipLocationChange),replaceUrl:me(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:me(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:me(this.preserveFragment)})},enumerable:!0,configurable:!0}),t.decorators=[{type:r.Directive,args:[{selector:"a[routerLink]"}]}],t.ctorParameters=function(){return[{type:pe},{type:Ot},{type:e.LocationStrategy}]},t.propDecorators={target:[{type:r.HostBinding,args:["attr.target"]},{type:r.Input}],queryParams:[{type:r.Input}],fragment:[{type:r.Input}],queryParamsHandling:[{type:r.Input}],preserveFragment:[{type:r.Input}],skipLocationChange:[{type:r.Input}],replaceUrl:[{type:r.Input}],href:[{type:r.HostBinding}],routerLink:[{type:r.Input}],preserveQueryParams:[{type:r.Input}],onClick:[{type:r.HostListener,args:["click",["$event.button","$event.ctrlKey","$event.metaKey","$event.shiftKey"]]}]},t}();function me(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){return this.urlSerializer.parse(t)},t.prototype.isActive=function(t,e){if(t instanceof B)return W(this.currentUrlTree,t,e);var r=this.urlSerializer.parse(t);return W(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(o.concatMap(function(e){return e?(t.executeScheduledNavigation(e),e.promise.catch(function(){})):n.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)?(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,Ot(c,e.rootComponentType).snapshot)}).then(i,a)):(this.rawUrlTree=n,i(null))},t.prototype.runNavigate=function(t,e,r,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?n.of({appliedUrl:t,snapshot:u}):function d(t,e,r,n,o){return new vt(t,e,r,n,o).apply()}(s.ngModule.injector,s.configLoader,s.urlSerializer,t,s.config).pipe(o.mergeMap(function(e){return function r(t,e,n,o,i){return void 0===i&&(i="emptyOnly"),new Yt(t,e,n,o,i).recognize()}(s.rootComponentType,s.config,e,s.serializeUrl(e),s.paramsInheritanceStrategy).pipe(o.map(function(r){return s.events.next(new m(a,s.serializeUrl(t),s.serializeUrl(e),r)),{appliedUrl:e,snapshot:r}}))}))).pipe(o.mergeMap(function(t){return"boolean"==typeof t?n.of(t):s.hooks.beforePreactivation(t.snapshot).pipe(o.map(function(){return t}))})).pipe(o.map(function(t){if("boolean"==typeof t)return t;var e=t.appliedUrl,r=t.snapshot;return(p=new Zt(r,s.routerState.snapshot,s.ngModule.injector,function(t){return s.triggerEvent(t)})).initialize(s.rootContexts),{appliedUrl:e,snapshot:r}})).pipe(o.mergeMap(function(e){if("boolean"==typeof e||s.navigationId!==a)return n.of(!1);var r=e.appliedUrl,i=e.snapshot;return s.triggerEvent(new y(a,s.serializeUrl(t),s.serializeUrl(r),i)),p.checkGuards().pipe(o.map(function(e){return s.triggerEvent(new C(a,s.serializeUrl(t),s.serializeUrl(r),i,e)),{appliedUrl:r,snapshot:i,shouldActivate:e}}))})).pipe(o.mergeMap(function(e){return"boolean"==typeof e||s.navigationId!==a?n.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(o.map(function(){return s.triggerEvent(new S(a,s.serializeUrl(t),s.serializeUrl(e.appliedUrl),e.snapshot)),e}))):n.of(e)})).pipe(o.mergeMap(function(t){return"boolean"==typeof t||s.navigationId!==a?n.of(!1):s.hooks.afterPreactivation(t.snapshot).pipe(o.map(function(){return t}))})).pipe(o.map(function(t){if("boolean"==typeof t||s.navigationId!==a)return!1;var e=t.appliedUrl,r=t.shouldActivate;return r?{appliedUrl:e,state:function o(t,e,r){var o=function t(e,r,o){if(o&&e.shouldReuseRoute(r.value,o.value.snapshot)){(l=o.value)._futureSnapshot=r.value;var i=function a(e,r,n){return r.children.map(function(r){try{for(var o=c(n.children),i=o.next();!i.done;i=o.next()){var a=i.value;if(e.shouldReuseRoute(a.value.snapshot,r.value))return t(e,r,a)}}catch(t){u={error:t}}finally{try{i&&!i.done&&(s=o.return)&&s.call(o)}finally{if(u)throw u.error}}return t(e,r);var u,s})}(e,r,o);return new Pt(l,i)}var u=e.retrieve(r.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])}(r,s),s}var l=function h(t){return new xt(new n.BehaviorSubject(t.url),new n.BehaviorSubject(t.params),new n.BehaviorSubject(t.queryParams),new n.BehaviorSubject(t.fragment),new n.BehaviorSubject(t.data),t.outlet,t.component,t)}(r.value);return i=r.children.map(function(r){return t(e,r)}),new Pt(l,i)}(t,e._root,r?r._root:void 0);return new _t(o,e)}(s.routeReuseStrategy,t.snapshot,s.routerState),shouldActivate:r}:{appliedUrl:e,state:null,shouldActivate:r}}));s.activateRoutes(f,s.routerState,s.currentUrlTree,a,t,e,r,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;if(h.currentUrlTree=t.appliedUrl,h.rawUrlTree=h.urlHandlingStrategy.merge(h.currentUrlTree,i),h.routerState=r,!a){var o=h.urlSerializer.serialize(h.rawUrlTree);h.location.isCurrentPathEqualTo(o)||u?h.location.replaceState(o,"",{navigationId:n}):h.location.go(o,"",{navigationId:n})}new de(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.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}(),de=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),kt(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 A(t.value.snapshot))},t.prototype.activateRoutes=function(t,e,r){var n=t.value,o=e?e.value:null;if(kt(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),ge(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 ge(t){kt(t.value),t.children.forEach(ge)}var ve=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){r.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:ye(this.skipLocationChange),replaceUrl:ye(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:ye(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:ye(this.preserveFragment)})},enumerable:!0,configurable:!0}),t.decorators=[{type:r.Directive,args:[{selector:":not(a)[routerLink]"}]}],t.ctorParameters=function(){return[{type:fe},{type:xt},{type:String,decorators:[{type:r.Attribute,args:["tabindex"]}]},{type:r.Renderer2},{type:r.ElementRef}]},t.propDecorators={queryParams:[{type:r.Input}],fragment:[{type:r.Input}],queryParamsHandling:[{type:r.Input}],preserveFragment:[{type:r.Input}],skipLocationChange:[{type:r.Input}],replaceUrl:[{type:r.Input}],routerLink:[{type:r.Input}],preserveQueryParams:[{type:r.Input}],onClick:[{type:r.HostListener,args:["click"]}]},t}(),me=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){r.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:ye(this.skipLocationChange),replaceUrl:ye(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:ye(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:ye(this.preserveFragment)})},enumerable:!0,configurable:!0}),t.decorators=[{type:r.Directive,args:[{selector:"a[routerLink]"}]}],t.ctorParameters=function(){return[{type:fe},{type:xt},{type:e.LocationStrategy}]},t.propDecorators={target:[{type:r.HostBinding,args:["attr.target"]},{type:r.Input}],queryParams:[{type:r.Input}],fragment:[{type:r.Input}],queryParamsHandling:[{type:r.Input}],preserveFragment:[{type:r.Input}],skipLocationChange:[{type:r.Input}],replaceUrl:[{type:r.Input}],href:[{type:r.HostBinding}],routerLink:[{type:r.Input}],preserveQueryParams:[{type:r.Input}],onClick:[{type:r.HostListener,args:["click",["$event.button","$event.ctrlKey","$event.metaKey","$event.shiftKey"]]}]},t}();function ye(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 Ce=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 d&&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))},t.decorators=[{type:r.Directive,args:[{selector:"[routerLinkActive]",exportAs:"routerLinkActive"}]}],t.ctorParameters=function(){return[{type:fe},{type:r.ElementRef},{type:r.Renderer2},{type:r.ChangeDetectorRef}]},t.propDecorators={links:[{type:r.ContentChildren,args:[ve,{descendants:!0}]}],linksWithHrefs:[{type:r.ContentChildren,args:[me,{descendants:!0}]}],routerLinkActiveOptions:[{type:r.Input}],routerLinkActive:[{type:r.Input}]},t}(),we=function we(){this.outlet=null,this.route=null,this.resolver=null,this.children=new Se,this.attachRef=null},Se=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 we,this.contexts.set(t,e)),e},t.prototype.getContext=function(t){return this.contexts.get(t)||null},t}(),be=function(){function t(t,e,n,o,i){this.parentContexts=t,this.location=e,this.resolver=n,this.changeDetector=i,this.activated=null,this._activatedRoute=null,this.activateEvents=new r.EventEmitter,this.deactivateEvents=new r.EventEmitter,this.name=o||U,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 Re(t,n,this.location.injector);this.activated=this.location.createComponent(r,this.location.length,o),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)},t.decorators=[{type:r.Directive,args:[{selector:"router-outlet",exportAs:"outlet"}]}],t.ctorParameters=function(){return[{type:Se},{type:r.ViewContainerRef},{type:r.ComponentFactoryResolver},{type:String,decorators:[{type:r.Attribute,args:["name"]}]},{type:r.ChangeDetectorRef}]},t.propDecorators={activateEvents:[{type:r.Output,args:["activate"]}],deactivateEvents:[{type:r.Output,args:["deactivate"]}]},t}(),Re=function(){function t(t,e,r){this.route=t,this.childContexts=e,this.parent=r}return t.prototype.get=function(t,e){return t===xt?this.route:t===Se?this.childContexts:this.parent.get(t,e)},t}(),Pe=function Pe(){},Ae=function(){function t(){}return t.prototype.preload=function(t,e){return e().pipe(o.catchError(function(){return n.of(null)}))},t}(),_e=function(){function t(){}return t.prototype.preload=function(t,e){return n.of(null)},t}(),Oe=function(){function t(t,e,r,n,o){this.router=t,this.injector=n,this.preloadingStrategy=o,this.loader=new se(e,r,function(e){return t.triggerEvent(new b(e))},function(e){return t.triggerEvent(new R(e))})}return t.prototype.setUpPreloading=function(){var t=this;this.subscription=this.router.events.pipe(o.filter(function(t){return t instanceof d}),o.concatMap(function(){return t.preload()})).subscribe(function(){})},t.prototype.preload=function(){var t=this.injector.get(r.NgModuleRef);return this.processRoutes(t,this.router.config)},t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t.prototype.processRoutes=function(t,e){var r,i,a=[];try{for(var u=c(e),s=u.next();!s.done;s=u.next()){var l=s.value;if(l.loadChildren&&!l.canLoad&&l._loadedConfig){var h=l._loadedConfig;a.push(this.processRoutes(h.module,h.routes))}else l.loadChildren&&!l.canLoad?a.push(this.preloadConfig(t,l)):l.children&&a.push(this.processRoutes(t,l.children))}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}return n.from(a).pipe(o.mergeAll(),o.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(o.mergeMap(function(t){return e._loadedConfig=t,r.processRoutes(t.module,t.routes)}))})},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:fe},{type:r.NgModuleFactoryLoader},{type:r.Compiler},{type:r.Injector},{type:Pe}]},t}(),xe=[be,ve,me,Ce,x],Ue=new r.InjectionToken("ROUTER_CONFIGURATION"),Ee=new r.InjectionToken("ROUTER_FORROOT_GUARD"),Te=[e.Location,{provide:K,useClass:Y},{provide:fe,useFactory:De,deps:[r.ApplicationRef,K,Se,e.Location,r.Injector,r.NgModuleFactoryLoader,r.Compiler,ue,Ue,[ce,new r.Optional],[ie,new r.Optional]]},Se,{provide:xt,useFactory:Ne,deps:[fe]},{provide:r.NgModuleFactoryLoader,useClass:r.SystemJsNgModuleLoader},Oe,_e,Ae,{provide:Ue,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 Ie(){return new r.NgProbeToken("Router",fe)}var je=function(){function t(t,e){}return t.forRoot=function(n,o){return{ngModule:t,providers:[Te,Me(n),{provide:Ee,useFactory:Le,deps:[[fe,new r.Optional,new r.SkipSelf]]},{provide:Ue,useValue:o||{}},{provide:e.LocationStrategy,useFactory:ke,deps:[e.PlatformLocation,[new r.Inject(e.APP_BASE_HREF),new r.Optional],Ue]},{provide:Pe,useExisting:o&&o.preloadingStrategy?o.preloadingStrategy:_e},{provide:r.NgProbeToken,multi:!0,useFactory:Ie},Fe()]}},t.forChild=function(e){return{ngModule:t,providers:[Me(e)]}},t.decorators=[{type:r.NgModule,args:[{declarations:xe,exports:xe,entryComponents:[x]}]}],t.ctorParameters=function(){return[{type:void 0,decorators:[{type:r.Optional},{type:r.Inject,args:[Ee]}]},{type:fe,decorators:[{type:r.Optional}]}]},t}();function ke(t,r,n){return void 0===n&&(n={}),n.useHash?new e.HashLocationStrategy(t,r):new e.PathLocationStrategy(t,r)}function Le(t){if(t)throw new Error("RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.");return"guarded"}function Me(t){return[{provide:r.ANALYZE_FOR_ENTRY_COMPONENTS,multi:!0,useValue:t},{provide:ue,multi:!0,useValue:t}]}function De(t,e,r,n,o,a,u,s,c,l,h){void 0===c&&(c={});var p=new fe(null,e,r,n,o,a,u,q(s));if(l&&(p.urlHandlingStrategy=l),h&&(p.routeReuseStrategy=h),c.errorHandler&&(p.errorHandler=c.errorHandler),c.enableTracing){var f=i.ɵgetDOM();p.events.subscribe(function(t){f.logGroup("Router Event: "+t.constructor.name),f.log(t.toString()),f.log(t),f.logGroupEnd()})}return c.onSameUrlNavigation&&(p.onSameUrlNavigation=c.onSameUrlNavigation),c.paramsInheritanceStrategy&&(p.paramsInheritanceStrategy=c.paramsInheritanceStrategy),p}function Ne(t){return t.routerState.root}var qe=function(){function t(t){this.injector=t,this.initNavigation=!1,this.resultOfPreactivationDone=new n.Subject}return t.prototype.appInitializer=function(){var t=this;return this.injector.get(e.LOCATION_INITIALIZED,Promise.resolve(null)).then(function(){var e=null,r=new Promise(function(t){return e=t}),o=t.injector.get(fe),i=t.injector.get(Ue);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?n.of(null):(t.initNavigation=!0,e(!0),t.resultOfPreactivationDone)},o.initialNavigation()}return r})},t.prototype.bootstrapListener=function(t){var e=this.injector.get(Ue),n=this.injector.get(Oe),o=this.injector.get(fe),i=this.injector.get(r.ApplicationRef);t===i.components[0]&&(this.isLegacyEnabled(e)?o.initialNavigation():this.isLegacyDisabled(e)&&o.setUpLocationChangeListener(),n.setUpPreloading(),o.resetRootComponentType(i.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},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:r.Injector}]},t}();function ze(t){return t.appInitializer.bind(t)}function Ge(t){return t.bootstrapListener.bind(t)}var He=new r.InjectionToken("Router Initializer");function Fe(){return[qe,{provide:r.APP_INITIALIZER,multi:!0,useFactory:ze,deps:[qe]},{provide:He,useFactory:Ge,deps:[qe]},{provide:r.APP_BOOTSTRAP_LISTENER,multi:!0,useExisting:He}]}
|
|
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 We=new r.Version("6.0.7");
|
|
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 Mt(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=Ee,t.ɵangular_packages_router_router_g=qe,t.ɵangular_packages_router_router_h=ze,t.ɵangular_packages_router_router_i=Ge,t.ɵangular_packages_router_router_d=Le,t.ɵangular_packages_router_router_c=ke,t.ɵangular_packages_router_router_j=Fe,t.ɵangular_packages_router_router_f=Ne,t.ɵangular_packages_router_router_b=Ie,t.ɵangular_packages_router_router_e=De,t.ɵangular_packages_router_router_k=St,t.ɵangular_packages_router_router_l=Pt,t.RouterLink=ve,t.RouterLinkWithHref=me,t.RouterLinkActive=Ce,t.RouterOutlet=be,t.ActivationEnd=O,t.ActivationStart=_,t.ChildActivationEnd=A,t.ChildActivationStart=P,t.GuardsCheckEnd=C,t.GuardsCheckStart=y,t.NavigationCancel=g,t.NavigationEnd=d,t.NavigationError=v,t.NavigationStart=f,t.ResolveEnd=S,t.ResolveStart=w,t.RouteConfigLoadEnd=R,t.RouteConfigLoadStart=b,t.RouterEvent=p,t.RoutesRecognized=m,t.RouteReuseStrategy=ie,t.Router=fe,t.ROUTES=ue,t.ROUTER_CONFIGURATION=Ue,t.ROUTER_INITIALIZER=He,t.RouterModule=je,t.provideRoutes=Me,t.ChildrenOutletContexts=Se,t.OutletContext=we,t.NoPreloading=_e,t.PreloadAllModules=Ae,t.PreloadingStrategy=Pe,t.RouterPreloader=Oe,t.ActivatedRoute=xt,t.ActivatedRouteSnapshot=Et,t.RouterState=_t,t.RouterStateSnapshot=Tt,t.PRIMARY_OUTLET=U,t.convertToParamMap=T,t.UrlHandlingStrategy=ce,t.DefaultUrlSerializer=Y,t.UrlSegment=V,t.UrlSegmentGroup=Q,t.UrlSerializer=K,t.UrlTree=B,t.VERSION=We,t.ɵEmptyOutletComponent=x,t.ɵROUTER_PROVIDERS=Te,t.ɵflatten=q,Object.defineProperty(t,"__esModule",{value:!0})});
|