@angular/router 6.0.0-rc.3 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/router-testing.umd.js +54 -9
- package/bundles/router-testing.umd.js.map +1 -1
- package/bundles/router-testing.umd.min.js +5 -4
- package/bundles/router-testing.umd.min.js.map +1 -1
- package/bundles/router-upgrade.umd.js +3 -3
- package/bundles/router-upgrade.umd.js.map +1 -1
- package/bundles/router-upgrade.umd.min.js +2 -2
- package/bundles/router-upgrade.umd.min.js.map +1 -1
- package/bundles/router.umd.js +163 -78
- package/bundles/router.umd.js.map +1 -1
- package/bundles/router.umd.min.js +19 -19
- package/bundles/router.umd.min.js.map +1 -1
- package/esm2015/src/config.js +2 -2
- package/esm2015/src/create_router_state.js +12 -9
- package/esm2015/src/directives/router_link.js +3 -3
- package/esm2015/src/directives/router_link_active.js +2 -2
- package/esm2015/src/directives/router_outlet.js +2 -2
- package/esm2015/src/events.js +6 -6
- package/esm2015/src/interfaces.js +6 -6
- package/esm2015/src/router.js +3 -3
- package/esm2015/src/router_module.js +6 -6
- package/esm2015/src/router_outlet_context.js +3 -3
- package/esm2015/src/router_preloader.js +2 -2
- package/esm2015/src/router_state.js +5 -5
- package/esm2015/src/shared.js +4 -4
- package/esm2015/src/url_tree.js +6 -6
- package/esm2015/src/version.js +3 -3
- package/esm2015/testing/src/router_testing_module.js +4 -4
- package/esm5/src/config.js +1 -1
- package/esm5/src/create_router_state.js +12 -9
- package/esm5/src/directives/router_link.js +3 -3
- package/esm5/src/directives/router_link_active.js +2 -2
- package/esm5/src/directives/router_outlet.js +2 -2
- package/esm5/src/events.js +16 -16
- package/esm5/src/interfaces.js +1 -1
- package/esm5/src/router.js +4 -4
- package/esm5/src/router_module.js +5 -5
- package/esm5/src/router_outlet_context.js +7 -7
- package/esm5/src/router_preloader.js +2 -2
- package/esm5/src/router_state.js +13 -13
- package/esm5/src/shared.js +3 -3
- package/esm5/src/url_tree.js +16 -16
- package/esm5/src/version.js +3 -3
- package/esm5/testing/src/router_testing_module.js +4 -4
- package/fesm2015/router.js +46 -43
- package/fesm2015/router.js.map +1 -1
- package/fesm2015/testing.js +4 -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 +42 -39
- package/fesm5/router.js.map +1 -1
- package/fesm5/testing.js +4 -4
- package/fesm5/testing.js.map +1 -1
- package/fesm5/upgrade.js +1 -1
- package/fesm5/upgrade.js.map +1 -1
- package/package.json +7 -6
- package/router.metadata.json +1 -1
- package/src/config.d.ts +7 -7
- package/src/directives/router_link.d.ts +2 -2
- package/src/directives/router_link_active.d.ts +1 -1
- package/src/directives/router_outlet.d.ts +1 -1
- package/src/events.d.ts +6 -6
- package/src/interfaces.d.ts +5 -5
- package/src/router.d.ts +3 -3
- package/src/router_module.d.ts +4 -4
- package/src/router_outlet_context.d.ts +2 -2
- package/src/router_preloader.d.ts +1 -1
- package/src/router_state.d.ts +4 -4
- package/src/shared.d.ts +4 -4
- package/src/url_tree.d.ts +5 -5
- package/src/version.d.ts +1 -1
- package/testing/src/router_testing_module.d.ts +3 -3
- package/testing.d.ts +1 -1
- package/upgrade.d.ts +1 -1
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v6.0.0
|
|
2
|
+
* @license Angular v6.0.0
|
|
3
3
|
* (c) 2010-2018 Google, Inc. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/common"),require("@angular/core"),require("
|
|
6
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/common"),require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define("@angular/router",["exports","@angular/common","@angular/core","rxjs","rxjs/operators","@angular/platform-browser"],e):e((t.ng=t.ng||{},t.ng.router={}),t.ng.common,t.ng.core,t.rxjs,t.rxjs.operators,t.ng.platformBrowser)}(this,function(t,e,r,n,o,i){"use strict";var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};function u(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var s=Object.assign||function t(e){for(var r,n=1,o=arguments.length;n<o;n++)for(var i in r=arguments[n])Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i]);return e};function c(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function l(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function h(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(l(arguments[e]));return t}
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright Google Inc. All Rights Reserved.
|
|
10
10
|
*
|
|
11
11
|
* Use of this source code is governed by an MIT-style license that can be
|
|
12
12
|
* found in the LICENSE file at https://angular.io/license
|
|
13
|
-
*/var
|
|
13
|
+
*/var 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="primary",U=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 E(t){return new U(t)}function T(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 I=function I(t,e){this.routes=t,this.module=e};function j(t,e){void 0===e&&(e="");for(var r=0;r<t.length;r++){var n=t[r];k(n,L(e,n))}}function k(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.outlet&&t.outlet!==x)throw new Error("Invalid configuration of route '"+e+"': a componentless route 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&&j(t.children,e)}function L(t,e){return e?t||e.path?t&&!e.path?t+"/":!t&&e.path?e.path:t+"/"+e.path:"":t}function M(t){var e=t.children&&t.children.map(M);return e?s({},t,{children:e}):s({},t)}
|
|
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 D(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 N(t){return Array.prototype.concat.apply([],t)}function q(t){return t.length>0?t[t.length-1]:null}function z(t,e){for(var r in t)t.hasOwnProperty(r)&&e(t[r],r)}function G(t){return t.pipe(o.mergeAll(),o.every(function(t){return!0===t}))}function H(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 z(t,e,r){return r?function n(t,e){return j(t,e)}(t.queryParams,e.queryParams)&&function t(e,r){if(!W(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!!W(a=r.segments.slice(0,o.length),o)&&!n.hasChildren();if(r.segments.length===o.length){if(!W(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!!W(r.segments,a)&&!!r.children[R]&&e(r.children[R],n,u)}(e,r,r.segments)}(t.root,e.root)}var G=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=A(this.queryParams)),this._queryParamMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return Z.serialize(this)},t}(),H=function(){function t(t,e){var r=this;this.segments=t,this.children=e,this.parent=null,D(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 K(this)},t}(),F=function(){function t(t,e){this.path=t,this.parameters=e}return Object.defineProperty(t.prototype,"parameterMap",{get:function(){return this._parameterMap||(this._parameterMap=A(this.parameters)),this._parameterMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return rt(this)},t}();function W(t,e){return t.length===e.length&&t.every(function(t,r){return t.path===e[r].path})}function B(t,e){var r=[];return D(t.children,function(t,n){n===R&&(r=r.concat(e(t,n)))}),D(t.children,function(t,n){n!==R&&(r=r.concat(e(t,n)))}),r}var Q=function V(){},$=function(){function t(){}return t.prototype.parse=function(t){var e=new ut(t);return new G(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())},t.prototype.serialize=function(t){return"/"+function t(e,r){if(!e.hasChildren())return K(e);if(r){var n=e.children[R]?t(e.children[R],!1):"",o=[];return D(e.children,function(e,r){r!==R&&o.push(r+":"+t(e,!1))}),o.length>0?n+"("+o.join("//")+")":n}var i=B(e,function(r,n){return n===R?[t(e.children[R],!1)]:[n+":"+t(r,!1)]});return K(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 J(e)+"="+J(t)}).join("&"):J(e)+"="+J(r)});return e.length?"?"+e.join("&"):""}(t.queryParams)+("string"==typeof t.fragment?"#"+function r(t){return encodeURI(t)}(t.fragment):"")},t}(),Z=new $;function K(t){return t.segments.map(function(t){return rt(t)}).join("/")}function Y(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function J(t){return Y(t).replace(/%3B/gi,";")}function X(t){return Y(t).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function tt(t){return decodeURIComponent(t)}function et(t){return tt(t.replace(/\+/g,"%20"))}function rt(t){return""+X(t.path)+function e(t){return Object.keys(t).map(function(e){return";"+X(e)+"="+X(t[e])}).join("")}(t.parameters)}var nt=/^[^\/()?;=&#]+/;function ot(t){var e=t.match(nt);return e?e[0]:""}var it=/^[^=?&#]+/,at=/^[^?&#]+/,ut=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 H([],{}):new H([],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[R]=new H(t,e)),r},t.prototype.parseSegment=function(){var t=ot(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new Error("Empty path url segment cannot have parameters: '"+this.remaining+"'.");return this.capture(t),new F(tt(t),this.parseMatrixParams())},t.prototype.parseMatrixParams=function(){for(var t={};this.consumeOptional(";");)this.parseParam(t);return t},t.prototype.parseParam=function(t){var e=ot(this.remaining);if(e){this.capture(e);var r="";if(this.consumeOptional("=")){var n=ot(this.remaining);n&&this.capture(r=n)}t[tt(e)]=tt(r)}},t.prototype.parseQueryParam=function(t){var e=function r(t){var e=t.match(it);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(at);return e?e[0]:""}(this.remaining);o&&this.capture(n=o)}var a=et(e),u=et(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=ot(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=R);var i=this.parseChildren();e[o]=1===Object.keys(i).length?i[R]:new H([],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}(),st=function ct(t){this.segmentGroup=t||null},lt=function ht(t){this.urlTree=t};function pt(t){return new o.Observable(function(e){return e.error(new st(t))})}function ft(t){return new o.Observable(function(e){return e.error(new lt(t))})}function dt(t){return new o.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,R).pipe(i.map(function(e){return t.createUrlTree(e,t.urlTree.queryParams,t.urlTree.fragment)})).pipe(i.catchError(function(e){if(e instanceof lt)return t.allowRedirects=!1,t.match(e.urlTree);if(e instanceof st)throw t.noMatchError(e);throw e}))},t.prototype.match=function(t){var e=this;return this.expandSegmentGroup(this.ngModule,this.config,t.root,R).pipe(i.map(function(r){return e.createUrlTree(r,t.queryParams,t.fragment)})).pipe(i.catchError(function(t){if(t instanceof st)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 H([],((n={})[R]=t,n)):t;return new G(o,e,r)},t.prototype.expandSegmentGroup=function(t,e,r,n){return 0===r.segments.length&&r.hasChildren()?this.expandChildren(t,e,r).pipe(i.map(function(t){return new H([],t)})):this.expandSegment(t,r,e,r.segments,n,!0)},t.prototype.expandChildren=function(t,e,r){var n=this;return function a(t,e){if(0===Object.keys(t).length)return o.of({});var r=[],n=[],a={};return D(t,function(t,o){var u=e(o,t).pipe(i.map(function(t){return a[o]=t}));o===R?r.push(u):n.push(u)}),o.of.apply(null,r.concat(n)).pipe(i.concatAll(),i.last(),i.map(function(){return a}))}(r.children,function(r,o){return n.expandSegmentGroup(t,e,o,r)})},t.prototype.expandSegment=function(t,e,r,a,u,s){var c=this;return o.of.apply(void 0,n.__spread(r)).pipe(i.map(function(n){return c.expandSegmentAgainstRoute(t,e,r,n,a,u,s).pipe(i.catchError(function(t){if(t instanceof st)return o.of(null);throw t}))}),i.concatAll(),i.first(function(t){return!!t}),i.catchError(function(t,r){if(t instanceof o.EmptyError||"EmptyError"===t.name){if(c.noLeftoversInUrl(e,a,u))return o.of(new H([],{}));throw new st(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 o=this,a=this.applyRedirectCommands([],r.redirectTo,{});return r.redirectTo.startsWith("/")?ft(a):this.lineralizeSegments(r,a).pipe(i.mergeMap(function(r){var i=new H(r,{});return o.expandSegment(t,i,e,r,n,!1)}))},t.prototype.expandRegularSegmentAgainstRouteUsingRedirect=function(t,e,r,n,o,a){var u=this,s=vt(e,n,o),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(i.mergeMap(function(n){return u.expandSegment(t,e,r,n.concat(o.slice(l)),a,!1)}))},t.prototype.matchSegmentAgainstRoute=function(t,e,r,a){var u=this;if("**"===r.path)return r.loadChildren?this.configLoader.load(t.injector,r).pipe(i.map(function(t){return r._loadedConfig=t,new H(a,{})})):o.of(new H(a,{}));var s=vt(e,r,a),c=s.consumedSegments,l=s.lastChild;if(!s.matched)return pt(e);var h=a.slice(l);return this.getChildConfig(t,r).pipe(i.mergeMap(function(t){var r=t.module,a=t.routes,s=function l(t,e,r,o){return r.length>0&&function i(t,e,r){return r.some(function(r){return yt(t,e,r)&&Ct(r)!==R})}(t,r,o)?{segmentGroup:mt(new H(e,function a(t,e){var r,o,i={};i[R]=e;try{for(var a=n.__values(t),u=a.next();!u.done;u=a.next()){var s=u.value;""===s.path&&Ct(s)!==R&&(i[Ct(s)]=new H([],{}))}}catch(t){r={error:t}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return i}(o,new H(r,t.children)))),slicedSegments:[]}:0===r.length&&function u(t,e,r){return r.some(function(r){return yt(t,e,r)})}(t,r,o)?{segmentGroup:mt(new H(t.segments,function s(t,e,r,o){var i,a,u={};try{for(var s=n.__values(r),c=s.next();!c.done;c=s.next()){var l=c.value;yt(t,e,l)&&!o[Ct(l)]&&(u[Ct(l)]=new H([],{}))}}catch(t){i={error:t}}finally{try{c&&!c.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}return n.__assign({},o,u)}(t,r,o,t.children))),slicedSegments:r}:{segmentGroup:t,slicedSegments:r}}(e,c,h,a),p=s.segmentGroup,f=s.slicedSegments;return 0===f.length&&p.hasChildren()?u.expandChildren(r,a,p).pipe(i.map(function(t){return new H(c,t)})):0===a.length&&0===f.length?o.of(new H(c,{})):u.expandSegment(r,p,a,f,R,!0).pipe(i.map(function(t){return new H(c.concat(t.segments),t.children)}))}))},t.prototype.getChildConfig=function(t,e){var r=this;return e.children?o.of(new U(e.children,t)):e.loadChildren?void 0!==e._loadedConfig?o.of(e._loadedConfig):function n(t,e){var r=e.canLoad;return r&&0!==r.length?N(o.from(r).pipe(i.map(function(r){var n=t.get(r);return q(n.canLoad?n.canLoad(e):n(e))}))):o.of(!0)}(t.injector,e).pipe(i.mergeMap(function(n){return n?r.configLoader.load(t.injector,e).pipe(i.map(function(t){return e._loadedConfig=t,t})):function a(t){return new o.Observable(function(e){return e.error(function r(t){var e=Error("NavigationCancelingError: "+t);return e[x]=!0,e}("Cannot load children because the guard of the route \"path: '"+t.path+"'\" returned false"))})}(e)})):o.of(new U([],t))},t.prototype.lineralizeSegments=function(t,e){for(var r=[],n=e.root;;){if(r=r.concat(n.segments),0===n.numberOfChildren)return o.of(r);if(n.numberOfChildren>1||!n.children[R])return dt(t.redirectTo);n=n.children[R]}},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 G(o,this.createQueryParams(e.queryParams,this.urlTree.queryParams),e.fragment)},t.prototype.createQueryParams=function(t,e){var r={};return D(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 D(e.children,function(e,i){a[i]=o.createSegmentGroup(t,e,r,n)}),new H(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,o,i=0;try{for(var a=n.__values(e),u=a.next();!u.done;u=a.next()){var s=u.value;if(s.path===t.path)return e.splice(i),s;i++}}catch(t){r={error:t}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}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||O)(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[R]){var e=t.children[R];return new H(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||R}
|
|
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}
|
|
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 wt=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=St(t,this._root);return e?e.children.map(function(t){return t.value}):[]},t.prototype.firstChild=function(t){var e=St(t,this._root);return e&&e.children.length>0?e.children[0].value:null},t.prototype.siblings=function(t){var e=bt(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 bt(t,this._root).map(function(t){return t.value})},t}();function St(t,e){if(t===e.value)return e;try{for(var r=
|
|
41
|
+
*/var wt=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=St(t,this._root);return e?e.children.map(function(t){return t.value}):[]},t.prototype.firstChild=function(t){var e=St(t,this._root);return e&&e.children.length>0?e.children[0].value:null},t.prototype.siblings=function(t){var e=bt(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 bt(t,this._root).map(function(t){return t.value})},t}();function St(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=St(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 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.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 Rt=function(){function t(t,e){this.value=t,this.children=e}return t.prototype.toString=function(){return"TreeNode("+this.value+")"},t}();function Pt(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 At=function(t){function e(e,r){var n=t.call(this,e)||this;return n.snapshot=r,Tt(n,e),n}return u(e,t),e.prototype.toString=function(){return this.snapshot.toString()},e}(wt);function _t(t,e){var r=function o(t,e){var r=new Ut([],{},{},"",{},x,e,null,t.root,-1,{});return new Et("",new Rt(r,[]))}(t,e),i=new n.BehaviorSubject([new Q("",{})]),a=new n.BehaviorSubject({}),u=new n.BehaviorSubject({}),s=new n.BehaviorSubject({}),c=new n.BehaviorSubject(""),l=new Ot(i,a,s,c,u,x,e,r.root);return l.snapshot=r.root,new At(new Rt(l,[]),r)}var Ot=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 E(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 E(t)}))),this._queryParamMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return this.snapshot?this.snapshot.toString():"Future("+this._futureSnapshot+")"},t}();function xt(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 Ut=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=E(this.params)),this._paramMap},enumerable:!0,configurable:!0}),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"Route(url:'"+this.url.map(function(t){return t.toString()}).join("/")+"', path:'"+(this.routeConfig?this.routeConfig.path:"")+"')"},t}(),Et=function(t){function e(e,r){var n=t.call(this,r)||this;return n.url=e,Tt(n,r),n}return u(e,t),e.prototype.toString=function(){return It(this._root)},e}(wt);function Tt(t,e){e.value._routerState=t,e.children.forEach(function(e){return Tt(t,e)})}function It(t){var e=t.children.length>0?" { "+t.children.map(It).join(", ")+" } ":"";return""+t.value+e}function jt(t){if(t.snapshot){var e=t.snapshot,r=t._futureSnapshot;t.snapshot=r,D(e.queryParams,r.queryParams)||t.queryParams.next(r.queryParams),e.fragment!==r.fragment&&t.fragment.next(r.fragment),D(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(!D(t[r],e[r]))return!1;return!0}(e.url,r.url)||t.url.next(r.url),D(e.data,r.data)||t.data.next(r.data)}else t.snapshot=t._futureSnapshot,t.data.next(t._futureSnapshot.data)}function kt(t,e){return D(t.params,e.params)&&function r(t,e){return V(t,e)&&t.every(function(t,r){return D(t.parameters,e[r].parameters)})}(t.url,e.url)&&!(!t.parent!=!e.parent)&&(!t.parent||kt(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 Lt(t){return"object"==typeof t&&null!=t&&!t.outlets&&!t.segmentPath}function Mt(t,e,r,n,o){var i={};return n&&
|
|
55
|
+
*/function Lt(t){return"object"==typeof t&&null!=t&&!t.outlets&&!t.segmentPath}function Mt(t,e,r,n,o){var i={};return n&&z(n,function(t,e){i[e]=Array.isArray(t)?t.map(function(t){return""+t}):""+t}),new W(r.root===t?e:function t(e,r,n){var o={};return z(e.children,function(e,i){o[i]=e===r?n:t(e,r,n)}),new B(e.segments,o)}(r.root,t,e),i,o)}var Dt=function(){function t(t,e,r){if(this.isAbsolute=t,this.numberOfDoubleDots=e,this.commands=r,t&&r.length>0&&Lt(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!==q(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}(),Nt=function Nt(t,e,r){this.segmentGroup=t,this.processChildren=e,this.index=r};function qt(t){return"object"==typeof t&&null!=t&&t.outlets?t.outlets[x]:""+t}function zt(t,e,r){if(t||(t=new B([],{})),0===t.segments.length&&t.hasChildren())return Gt(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=qt(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(!Bt(u,s,a))return i;n+=2}else{if(!Bt(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 B(t.segments.slice(0,n.pathIndex),{});return a.children[x]=new B(t.segments.slice(n.pathIndex),t.children),Gt(a,0,i)}return n.match&&0===i.length?new B(t.segments,{}):n.match&&!t.hasChildren()?Ht(t,e,r):n.match?Gt(t,0,i):Ht(t,e,r)}function Gt(t,e,r){if(0===r.length)return new B(t.segments,{});var n=function o(t){return"object"!=typeof t[0]?((e={})[x]=t,e):void 0===t[0].outlets?((r={})[x]=t,r):t[0].outlets;var e,r}(r),i={};return z(n,function(r,n){null!==r&&(i[n]=zt(t.children[n],e,r))}),z(t.children,function(t,e){void 0===n[e]&&(i[e]=t)}),new B(t.segments,i)}function Ht(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=Ft(r[o].outlets);return new B(n,i)}if(0===o&&Lt(r[0]))n.push(new Q(t.segments[e].path,r[0])),o++;else{var a=qt(r[o]),u=o<r.length-1?r[o+1]:null;a&&u&&Lt(u)?(n.push(new Q(a,Wt(u))),o+=2):(n.push(new Q(a,{})),o++)}}return new B(n,{})}function Ft(t){var e={};return z(t,function(t,r){null!==t&&(e[r]=Ht(new B([],{}),0,t))}),e}function Wt(t){var e={};return z(t,function(t,r){return e[r]=""+t}),e}function Bt(t,e,r){return t==r.path&&D(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 Qt=function Qt(t){this.path=t,this.route=this.path[this.path.length-1]},Vt=function Vt(t,e){this.component=t,this.route=e},$t=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=Pt(e);t.children.forEach(function(t){o.setupRouteGuards(t,i[t.value.outlet],r,n.concat([t.value])),delete i[t.value.outlet]}),z(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 Qt(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 Vt(a.outlet.component,i))}else i&&this.deactivateRouteAndItsChildren(e,a),this.canActivateChecks.push(new Qt(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!kt(t,e)||!D(t.queryParams,e.queryParams);case"paramsChange":default:return!kt(t,e)}},t.prototype.deactivateRouteAndItsChildren=function(t,e){var r=this,n=Pt(t),o=t.value;z(n,function(t,n){r.deactivateRouteAndItsChildren(t,o.component?e?e.children.getContext(n):null:e)}),this.canDeactivateChecks.push(new Vt(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 G(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?G(n.from(r).pipe(o.map(function(r){var n=e.getToken(r,t);return H(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 G(n.from(i).pipe(o.map(function(t){return G(n.from(t.guards).pipe(o.map(function(n){var i=e.getToken(n,t.node);return H(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 H(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,xt(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 H(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}(),Zt=function lt(){},Kt=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=Xt(this.urlTree.root,[],[],this.config).segmentGroup,e=this.processSegmentGroup(this.config,t,x),r=new Ut([],Object.freeze({}),Object.freeze(this.urlTree.queryParams),this.urlTree.fragment,{},x,this.rootComponentType,null,this.urlTree.root,-1,{}),o=new Rt(r,e),i=new Et(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=xt(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=$(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===x?-1:e.value.outlet===x?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 Zt))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 Zt;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 Zt;if((t.outlet||x)!==n)throw new Zt;var o,i=[],a=[];if("**"===t.path){var u=r.length>0?q(r).parameters:{};o=new Ut(r,u,Object.freeze(this.urlTree.queryParams),this.urlTree.fragment,re(t),n,t.component,t,Yt(e),Jt(e)+r.length,ne(t))}else{var c=function l(t,e,r){if(""===e.path){if("full"===e.pathMatch&&(t.hasChildren()||r.length>0))throw new Zt;return{consumedSegments:[],lastChild:0,parameters:{}}}var n=(e.matcher||T)(r,t,e);if(!n)throw new Zt;var o={};z(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 Ut(i,c.parameters,Object.freeze(this.urlTree.queryParams),this.urlTree.fragment,re(t),n,t.component,t,Yt(e),Jt(e)+i.length,ne(t))}var h=function p(t){return t.children?t.children:t.loadChildren?t._loadedConfig.routes:[]}(t),f=Xt(e,i,a,h),d=f.segmentGroup,g=f.slicedSegments;if(0===g.length&&d.hasChildren()){var v=this.processChildren(h,d);return[new Rt(o,v)]}if(0===h.length&&0===g.length)return[new Rt(o,[])];var m=this.processSegment(h,d,g,x);return[new Rt(o,m)]},t}();function Yt(t){for(var e=t;e._sourceSegment;)e=e._sourceSegment;return e}function Jt(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 Xt(t,e,r,n){if(r.length>0&&function o(t,e,r){return r.some(function(r){return te(t,e,r)&&ee(r)!==x})}(t,r,n)){var i=new B(e,function a(t,e,r,n){var o,i,a={};a[x]=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&&ee(l)!==x){var h=new B([],{});h._sourceSegment=t,h._segmentIndexShift=e.length,a[ee(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 B(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 te(t,e,r)})}(t,r,n)){var l=new B(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(te(t,e,h)&&!n[ee(h)]){var p=new B([],{});p._sourceSegment=t,p._segmentIndexShift=t.segments.length,a[ee(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 B(t.segments,t.children);return p._sourceSegment=t,p._segmentIndexShift=e.length,{segmentGroup:p,slicedSegments:r}}function te(t,e,r){return(!(t.hasChildren()||e.length>0)||"full"!==r.pathMatch)&&""===r.path&&void 0===r.redirectTo}function ee(t){return t.outlet||x}function re(t){return t.data||{}}function ne(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 oe=function oe(){},ie=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}(),ae=new r.InjectionToken("ROUTES"),ue=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 I(N(o.injector.get(ae)).map(M),o)}))},t.prototype.loadModuleFactory=function(t){var e=this;return"string"==typeof t?n.from(this.loader.load(t)):H(t()).pipe(o.mergeMap(function(t){return t instanceof r.NgModuleFactory?n.of(t):n.from(e.compiler.compileModuleAsync(t))}))},t}(),se=function se(){},ce=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 le(t){throw t}function he(t){return n.of(null)}var pe=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=le,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:he,afterPreactivation:he},this.urlHandlingStrategy=new ce,this.routeReuseStrategy=new ie,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.ngModule=a.get(r.NgModuleRef),this.resetConfig(c),this.currentUrlTree=function h(){return new W(new B([],{}),{},null)}(),this.rawUrlTree=this.currentUrlTree,this.configLoader=new ue(u,s,function(t){return l.triggerEvent(new b(t))},function(t){return l.triggerEvent(new R(t))}),this.routerState=_t(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){j(t),this.config=t.map(M),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 ve(t){throw t}function me(t){return o.of(null)}var ye=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
|
|
92
|
+
function d(t,e,r,n,o){if(0===r.length)return Mt(e.root,e.root,e,n,o);var i=function a(t){if("string"==typeof t[0]&&1===t.length&&"/"===t[0])return new Dt(!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 z(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 Dt(r,e,n)}(r);if(i.toRoot())return Mt(e.root,new B([],{}),e,n,o);var u=function s(t,e,r){if(t.isAbsolute)return new Nt(e.root,!0,0);if(-1===r.snapshot._lastPathIndex)return new Nt(r.snapshot._urlSegment,!0,0);var n=Lt(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 Nt(n,!1,o-i)}(r.snapshot._urlSegment,r.snapshot._lastPathIndex+n,t.numberOfDoubleDots)}(i,e,t),c=u.processChildren?Gt(u.segmentGroup,u.index,i.commands):zt(u.segmentGroup,u.index,i.commands);return Mt(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 W?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 G)return z(this.currentUrlTree,t,e);var r=this.urlSerializer.parse(t);return z(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(i.concatMap(function(e){return e?(t.executeScheduledNavigation(e),e.promise.catch(function(){})):o.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,l=this.urlHandlingStrategy.extract(n),h=!this.navigated||l.toString()!==this.currentUrlTree.toString();("reload"===this.onSameUrlNavigation||h)&&this.urlHandlingStrategy.shouldProcessUrl(n)?(this.events.next(new c(r,this.serializeUrl(l),u,s)),Promise.resolve().then(function(t){return e.runNavigate(l,n,!!o.skipLocationChange,!!o.replaceUrl,r,null)}).then(i,a)):h&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)?(this.events.next(new c(r,this.serializeUrl(l),u,s)),Promise.resolve().then(function(t){return e.runNavigate(l,n,!1,!1,r,At(l,e.rootComponentType).snapshot)}).then(i,a)):(this.rawUrlTree=n,i(null))},t.prototype.runNavigate=function(t,e,r,a,u,s){var c=this;return u!==this.navigationId?(this.events.next(new h(u,this.serializeUrl(t),"Navigation ID "+u+" is not equal to the current navigation id "+this.navigationId)),Promise.resolve(!1)):new Promise(function(l,h){var p,y=(s?o.of({appliedUrl:t,snapshot:s}):function C(t,e,r,n,o){return new gt(t,e,r,n,o).apply()}(c.ngModule.injector,c.configLoader,c.urlSerializer,t,c.config).pipe(i.mergeMap(function(e){return function r(t,e,n,o,i){return void 0===i&&(i="emptyOnly"),new te(t,e,n,o,i).recognize()}(c.rootComponentType,c.config,e,c.serializeUrl(e),c.paramsInheritanceStrategy).pipe(i.map(function(r){return c.events.next(new f(u,c.serializeUrl(t),c.serializeUrl(e),r)),{appliedUrl:e,snapshot:r}}))}))).pipe(i.mergeMap(function(t){return"boolean"==typeof t?o.of(t):c.hooks.beforePreactivation(t.snapshot).pipe(i.map(function(){return t}))})).pipe(i.map(function(t){if("boolean"==typeof t)return t;var e=t.appliedUrl,r=t.snapshot;return(p=new Yt(r,c.routerState.snapshot,c.ngModule.injector,function(t){return c.triggerEvent(t)})).initialize(c.rootContexts),{appliedUrl:e,snapshot:r}})).pipe(i.mergeMap(function(e){if("boolean"==typeof e||c.navigationId!==u)return o.of(!1);var r=e.appliedUrl,n=e.snapshot;return c.triggerEvent(new d(u,c.serializeUrl(t),c.serializeUrl(r),n)),p.checkGuards().pipe(i.map(function(e){return c.triggerEvent(new g(u,c.serializeUrl(t),c.serializeUrl(r),n,e)),{appliedUrl:r,snapshot:n,shouldActivate:e}}))})).pipe(i.mergeMap(function(e){return"boolean"==typeof e||c.navigationId!==u?o.of(!1):e.shouldActivate&&p.isActivating()?(c.triggerEvent(new v(u,c.serializeUrl(t),c.serializeUrl(e.appliedUrl),e.snapshot)),p.resolveData(c.paramsInheritanceStrategy).pipe(i.map(function(){return c.triggerEvent(new m(u,c.serializeUrl(t),c.serializeUrl(e.appliedUrl),e.snapshot)),e}))):o.of(e)})).pipe(i.mergeMap(function(t){return"boolean"==typeof t||c.navigationId!==u?o.of(!1):c.hooks.afterPreactivation(t.snapshot).pipe(i.map(function(){return t}))})).pipe(i.map(function(t){if("boolean"==typeof t||c.navigationId!==u)return!1;var e=t.appliedUrl,r=t.shouldActivate;return r?{appliedUrl:e,state:function i(t,e,r){var i=function t(e,r,i){if(i&&e.shouldReuseRoute(r.value,i.value.snapshot)){(c=i.value)._futureSnapshot=r.value;var a=function u(e,r,o){return r.children.map(function(r){try{for(var i=n.__values(o.children),a=i.next();!a.done;a=i.next()){var u=a.value;if(e.shouldReuseRoute(u.value.snapshot,r.value))return t(e,r,u)}}catch(t){s={error:t}}finally{try{a&&!a.done&&(c=i.return)&&c.call(i)}finally{if(s)throw s.error}}return t(e,r);var s,c})}(e,r,i);return new _t(c,a)}if(e.retrieve(r.value)){var s=e.retrieve(r.value).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 c=function l(t){return new xt(new o.BehaviorSubject(t.url),new o.BehaviorSubject(t.params),new o.BehaviorSubject(t.queryParams),new o.BehaviorSubject(t.fragment),new o.BehaviorSubject(t.data),t.outlet,t.component,t)}(r.value);return a=r.children.map(function(r){return t(e,r)}),new _t(c,a)}(t,e._root,r?r._root:void 0);return new Pt(i,e)}(c.routeReuseStrategy,t.snapshot,c.routerState),shouldActivate:r}:{appliedUrl:e,state:null,shouldActivate:r}}));c.activateRoutes(y,c.routerState,c.currentUrlTree,u,t,e,r,a,l,h)})},t.prototype.activateRoutes=function(t,e,r,n,o,i,a,u,s,c){var f,d=this;t.forEach(function(t){if("boolean"!=typeof t&&t.shouldActivate&&n===d.navigationId&&t.state){var r=t.state;if(d.currentUrlTree=t.appliedUrl,d.rawUrlTree=d.urlHandlingStrategy.merge(d.currentUrlTree,i),d.routerState=r,!a){var o=d.urlSerializer.serialize(d.rawUrlTree);d.location.isCurrentPathEqualTo(o)||u?d.location.replaceState(o,"",{navigationId:n}):d.location.go(o,"",{navigationId:n})}new Ce(d.routeReuseStrategy,r,e,function(t){return d.triggerEvent(t)}).activate(d.rootContexts),f=!0}else f=!1}).then(function(){f?(d.navigated=!0,d.lastSuccessfulId=n,d.events.next(new l(n,d.serializeUrl(o),d.serializeUrl(d.currentUrlTree))),s(!0)):(d.resetUrlToCurrentUrlTree(),d.events.next(new h(n,d.serializeUrl(o),"")),s(!1))},function(t){if(function a(t){return t&&t[x]}(t))d.navigated=!0,d.resetStateAndUrl(e,r,i),d.events.next(new h(n,d.serializeUrl(o),t.message)),s(!1);else{d.resetStateAndUrl(e,r,i),d.events.next(new p(n,d.serializeUrl(o),t));try{s(d.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}(),Ce=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=Rt(e);t.children.forEach(function(t){var e=t.value.outlet;n.deactivateRoutes(t,o[e],r),delete o[e]}),D(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=Rt(t),i=t.value.component?n.children:e;D(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=Rt(e);t.children.forEach(function(t){n.activateRoutes(t,o[t.value.outlet],r),n.forwardEvent(new _(t.value.snapshot))}),t.children.length&&this.forwardEvent(new S(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),we(a.route)}else{var u=function s(t){for(var e=t.parent;e;e=e.parent){var r=e.routeConfig;if(r&&r._loadedConfig)return r._loadedConfig;if(r&&r.component)return null}return null}(n.snapshot),c=u?u.module.componentFactoryResolver:null;i.route=n,i.resolver=c,i.outlet&&i.outlet.activateWith(n,c),this.activateChildRoutes(t,null,i.children)}else this.activateChildRoutes(t,null,r)},t}();function we(t){kt(t.value),t.children.forEach(we)}var Se=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:_e(this.skipLocationChange),replaceUrl:_e(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:_e(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:_e(this.preserveFragment)})},enumerable:!0,configurable:!0}),t.decorators=[{type:r.Directive,args:[{selector:":not(a)[routerLink]"}]}],t.ctorParameters=function(){return[{type:ye},{type:xt},{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}(),be=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 l&&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:_e(this.skipLocationChange),replaceUrl:_e(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:_e(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:_e(this.preserveFragment)})},enumerable:!0,configurable:!0}),t.decorators=[{type:r.Directive,args:[{selector:"a[routerLink]"}]}],t.ctorParameters=function(){return[{type:ye},{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 _e(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 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}
|
|
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 ye=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:pe},{type:r.ElementRef},{type:r.Renderer2},{type:r.ChangeDetectorRef}]},t.propDecorators={links:[{type:r.ContentChildren,args:[ge,{descendants:!0}]}],linksWithHrefs:[{type:r.ContentChildren,args:[ve,{descendants:!0}]}],routerLinkActiveOptions:[{type:r.Input}],routerLinkActive:[{type:r.Input}]},t}(),Ce=function Ce(){this.outlet=null,this.route=null,this.resolver=null,this.children=new we,this.attachRef=null},we=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 Ce,this.contexts.set(t,e)),e},t.prototype.getContext=function(t){return this.contexts.get(t)||null},t}(),Se=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||x,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 be(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:we},{type:r.ViewContainerRef},{type:r.ComponentFactoryResolver},{type:void 0,decorators:[{type:r.Attribute,args:["name"]}]},{type:r.ChangeDetectorRef}]},t.propDecorators={activateEvents:[{type:r.Output,args:["activate"]}],deactivateEvents:[{type:r.Output,args:["deactivate"]}]},t}(),be=function(){function t(t,e,r){this.route=t,this.childContexts=e,this.parent=r}return t.prototype.get=function(t,e){return t===Ot?this.route:t===we?this.childContexts:this.parent.get(t,e)},t}(),Re=function Re(){},Pe=function(){function t(){}return t.prototype.preload=function(t,e){return e().pipe(o.catchError(function(){return n.of(null)}))},t}(),Ae=function(){function t(){}return t.prototype.preload=function(t,e){return n.of(null)},t}(),_e=function(){function t(t,e,r,n,o){this.router=t,this.injector=n,this.preloadingStrategy=o,this.loader=new ue(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:pe},{type:r.NgModuleFactoryLoader},{type:r.Compiler},{type:r.Injector},{type:Re}]},t}(),Oe=[Se,ge,ve,ye],xe=new r.InjectionToken("ROUTER_CONFIGURATION"),Ue=new r.InjectionToken("ROUTER_FORROOT_GUARD"),Ee=[e.Location,{provide:Z,useClass:K},{provide:pe,useFactory:Me,deps:[r.ApplicationRef,Z,we,e.Location,r.Injector,r.NgModuleFactoryLoader,r.Compiler,ae,xe,[se,new r.Optional],[oe,new r.Optional]]},we,{provide:Ot,useFactory:De,deps:[pe]},{provide:r.NgModuleFactoryLoader,useClass:r.SystemJsNgModuleLoader},_e,Ae,Pe,{provide:xe,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 Te(){return new r.NgProbeToken("Router",pe)}var Ie=function(){function t(t,e){}return t.forRoot=function(n,o){return{ngModule:t,providers:[Ee,Le(n),{provide:Ue,useFactory:ke,deps:[[pe,new r.Optional,new r.SkipSelf]]},{provide:xe,useValue:o||{}},{provide:e.LocationStrategy,useFactory:je,deps:[e.PlatformLocation,[new r.Inject(e.APP_BASE_HREF),new r.Optional],xe]},{provide:Re,useExisting:o&&o.preloadingStrategy?o.preloadingStrategy:Ae},{provide:r.NgProbeToken,multi:!0,useFactory:Te},He()]}},t.forChild=function(e){return{ngModule:t,providers:[Le(e)]}},t.decorators=[{type:r.NgModule,args:[{declarations:Oe,exports:Oe}]}],t.ctorParameters=function(){return[{type:void 0,decorators:[{type:r.Optional},{type:r.Inject,args:[Ue]}]},{type:pe,decorators:[{type:r.Optional}]}]},t}();function je(t,r,n){return void 0===n&&(n={}),n.useHash?new e.HashLocationStrategy(t,r):new e.PathLocationStrategy(t,r)}function ke(t){if(t)throw new Error("RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.");return"guarded"}function Le(t){return[{provide:r.ANALYZE_FOR_ENTRY_COMPONENTS,multi:!0,useValue:t},{provide:ae,multi:!0,useValue:t}]}function Me(t,e,r,n,o,a,u,s,c,l,h){void 0===c&&(c={});var p=new pe(null,e,r,n,o,a,u,N(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 De(t){return t.routerState.root}var Ne=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(pe),i=t.injector.get(xe);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(xe),n=this.injector.get(_e),o=this.injector.get(pe),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 qe(t){return t.appInitializer.bind(t)}function ze(t){return t.bootstrapListener.bind(t)}var Ge=new r.InjectionToken("Router Initializer");function He(){return[Ne,{provide:r.APP_INITIALIZER,multi:!0,useFactory:qe,deps:[Ne]},{provide:Ge,useFactory:ze,deps:[Ne]},{provide:r.APP_BOOTSTRAP_LISTENER,multi:!0,useExisting:Ge}]}
|
|
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 Fe=new r.Version("6.0.0");
|
|
121
121
|
/**
|
|
122
122
|
* @license
|
|
123
123
|
* Copyright Google Inc. All Rights Reserved.
|
|
@@ -145,4 +145,4 @@ function f(t,e,r,o,i){if(0===r.length)return Mt(e.root,e.root,e,o,i);var a=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=Ue,t.ɵangular_packages_router_router_g=Ne,t.ɵangular_packages_router_router_h=qe,t.ɵangular_packages_router_router_i=ze,t.ɵangular_packages_router_router_d=ke,t.ɵangular_packages_router_router_c=je,t.ɵangular_packages_router_router_j=He,t.ɵangular_packages_router_router_f=De,t.ɵangular_packages_router_router_b=Te,t.ɵangular_packages_router_router_e=Me,t.ɵangular_packages_router_router_k=wt,t.ɵangular_packages_router_router_l=Rt,t.RouterLink=ge,t.RouterLinkWithHref=ve,t.RouterLinkActive=ye,t.RouterOutlet=Se,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=oe,t.Router=pe,t.ROUTES=ae,t.ROUTER_CONFIGURATION=xe,t.ROUTER_INITIALIZER=Ge,t.RouterModule=Ie,t.provideRoutes=Le,t.ChildrenOutletContexts=we,t.OutletContext=Ce,t.NoPreloading=Ae,t.PreloadAllModules=Pe,t.PreloadingStrategy=Re,t.RouterPreloader=_e,t.ActivatedRoute=Ot,t.ActivatedRouteSnapshot=Ut,t.RouterState=At,t.RouterStateSnapshot=Et,t.PRIMARY_OUTLET=x,t.convertToParamMap=E,t.UrlHandlingStrategy=se,t.DefaultUrlSerializer=K,t.UrlSegment=Q,t.UrlSegmentGroup=B,t.UrlSerializer=Z,t.UrlTree=W,t.VERSION=Fe,t.ɵROUTER_PROVIDERS=Ee,t.ɵflatten=N,Object.defineProperty(t,"__esModule",{value:!0})});
|