source: trip-planner-front/node_modules/@angular/router/esm2015/src/router.js@ 188ee53

Last change on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 177.9 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import { Location } from '@angular/common';
9import { Compiler, Injectable, Injector, NgModuleFactoryLoader, NgModuleRef, NgZone, Type, ɵConsole as Console } from '@angular/core';
10import { BehaviorSubject, EMPTY, of, Subject } from 'rxjs';
11import { catchError, filter, finalize, map, switchMap, tap } from 'rxjs/operators';
12import { createRouterState } from './create_router_state';
13import { createUrlTree } from './create_url_tree';
14import { GuardsCheckEnd, GuardsCheckStart, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RoutesRecognized } from './events';
15import { activateRoutes } from './operators/activate_routes';
16import { applyRedirects } from './operators/apply_redirects';
17import { checkGuards } from './operators/check_guards';
18import { recognize } from './operators/recognize';
19import { resolveData } from './operators/resolve_data';
20import { switchTap } from './operators/switch_tap';
21import { DefaultRouteReuseStrategy } from './route_reuse_strategy';
22import { RouterConfigLoader } from './router_config_loader';
23import { ChildrenOutletContexts } from './router_outlet_context';
24import { createEmptyState } from './router_state';
25import { isNavigationCancelingError, navigationCancelingError } from './shared';
26import { DefaultUrlHandlingStrategy } from './url_handling_strategy';
27import { containsTree, createEmptyUrlTree, UrlSerializer } from './url_tree';
28import { standardizeConfig, validateConfig } from './utils/config';
29import { getAllRouteGuards } from './utils/preactivation';
30import { isUrlTree } from './utils/type_guards';
31function defaultErrorHandler(error) {
32 throw error;
33}
34function defaultMalformedUriErrorHandler(error, urlSerializer, url) {
35 return urlSerializer.parse('/');
36}
37/**
38 * @internal
39 */
40function defaultRouterHook(snapshot, runExtras) {
41 return of(null);
42}
43/**
44 * The equivalent `IsActiveMatchOptions` options for `Router.isActive` is called with `true`
45 * (exact = true).
46 */
47export const exactMatchOptions = {
48 paths: 'exact',
49 fragment: 'ignored',
50 matrixParams: 'ignored',
51 queryParams: 'exact'
52};
53/**
54 * The equivalent `IsActiveMatchOptions` options for `Router.isActive` is called with `false`
55 * (exact = false).
56 */
57export const subsetMatchOptions = {
58 paths: 'subset',
59 fragment: 'ignored',
60 matrixParams: 'ignored',
61 queryParams: 'subset'
62};
63/**
64 * @description
65 *
66 * A service that provides navigation among views and URL manipulation capabilities.
67 *
68 * @see `Route`.
69 * @see [Routing and Navigation Guide](guide/router).
70 *
71 * @ngModule RouterModule
72 *
73 * @publicApi
74 */
75export class Router {
76 /**
77 * Creates the router service.
78 */
79 // TODO: vsavkin make internal after the final is out.
80 constructor(rootComponentType, urlSerializer, rootContexts, location, injector, loader, compiler, config) {
81 this.rootComponentType = rootComponentType;
82 this.urlSerializer = urlSerializer;
83 this.rootContexts = rootContexts;
84 this.location = location;
85 this.config = config;
86 this.lastSuccessfulNavigation = null;
87 this.currentNavigation = null;
88 this.disposed = false;
89 /**
90 * Tracks the previously seen location change from the location subscription so we can compare
91 * the two latest to see if they are duplicates. See setUpLocationChangeListener.
92 */
93 this.lastLocationChangeInfo = null;
94 this.navigationId = 0;
95 /**
96 * The id of the currently active page in the router.
97 * Updated to the transition's target id on a successful navigation.
98 *
99 * This is used to track what page the router last activated. When an attempted navigation fails,
100 * the router can then use this to compute how to restore the state back to the previously active
101 * page.
102 */
103 this.currentPageId = 0;
104 this.isNgZoneEnabled = false;
105 /**
106 * An event stream for routing events in this NgModule.
107 */
108 this.events = new Subject();
109 /**
110 * A handler for navigation errors in this NgModule.
111 */
112 this.errorHandler = defaultErrorHandler;
113 /**
114 * A handler for errors thrown by `Router.parseUrl(url)`
115 * when `url` contains an invalid character.
116 * The most common case is a `%` sign
117 * that's not encoded and is not part of a percent encoded sequence.
118 */
119 this.malformedUriErrorHandler = defaultMalformedUriErrorHandler;
120 /**
121 * True if at least one navigation event has occurred,
122 * false otherwise.
123 */
124 this.navigated = false;
125 this.lastSuccessfulId = -1;
126 /**
127 * Hooks that enable you to pause navigation,
128 * either before or after the preactivation phase.
129 * Used by `RouterModule`.
130 *
131 * @internal
132 */
133 this.hooks = { beforePreactivation: defaultRouterHook, afterPreactivation: defaultRouterHook };
134 /**
135 * A strategy for extracting and merging URLs.
136 * Used for AngularJS to Angular migrations.
137 */
138 this.urlHandlingStrategy = new DefaultUrlHandlingStrategy();
139 /**
140 * A strategy for re-using routes.
141 */
142 this.routeReuseStrategy = new DefaultRouteReuseStrategy();
143 /**
144 * How to handle a navigation request to the current URL. One of:
145 *
146 * - `'ignore'` : The router ignores the request.
147 * - `'reload'` : The router reloads the URL. Use to implement a "refresh" feature.
148 *
149 * Note that this only configures whether the Route reprocesses the URL and triggers related
150 * action and events like redirects, guards, and resolvers. By default, the router re-uses a
151 * component instance when it re-navigates to the same component type without visiting a different
152 * component first. This behavior is configured by the `RouteReuseStrategy`. In order to reload
153 * routed components on same url navigation, you need to set `onSameUrlNavigation` to `'reload'`
154 * _and_ provide a `RouteReuseStrategy` which returns `false` for `shouldReuseRoute`.
155 */
156 this.onSameUrlNavigation = 'ignore';
157 /**
158 * How to merge parameters, data, and resolved data from parent to child
159 * routes. One of:
160 *
161 * - `'emptyOnly'` : Inherit parent parameters, data, and resolved data
162 * for path-less or component-less routes.
163 * - `'always'` : Inherit parent parameters, data, and resolved data
164 * for all child routes.
165 */
166 this.paramsInheritanceStrategy = 'emptyOnly';
167 /**
168 * Determines when the router updates the browser URL.
169 * By default (`"deferred"`), updates the browser URL after navigation has finished.
170 * Set to `'eager'` to update the browser URL at the beginning of navigation.
171 * You can choose to update early so that, if navigation fails,
172 * you can show an error message with the URL that failed.
173 */
174 this.urlUpdateStrategy = 'deferred';
175 /**
176 * Enables a bug fix that corrects relative link resolution in components with empty paths.
177 * @see `RouterModule`
178 */
179 this.relativeLinkResolution = 'corrected';
180 /**
181 * Configures how the Router attempts to restore state when a navigation is cancelled.
182 *
183 * 'replace' - Always uses `location.replaceState` to set the browser state to the state of the
184 * router before the navigation started.
185 *
186 * 'computed' - Will always return to the same state that corresponds to the actual Angular route
187 * when the navigation gets cancelled right after triggering a `popstate` event.
188 *
189 * The default value is `replace`
190 *
191 * @internal
192 */
193 // TODO(atscott): Determine how/when/if to make this public API
194 // This shouldn’t be an option at all but may need to be in order to allow migration without a
195 // breaking change. We need to determine if it should be made into public api (or if we forgo
196 // the option and release as a breaking change bug fix in a major version).
197 this.canceledNavigationResolution = 'replace';
198 const onLoadStart = (r) => this.triggerEvent(new RouteConfigLoadStart(r));
199 const onLoadEnd = (r) => this.triggerEvent(new RouteConfigLoadEnd(r));
200 this.ngModule = injector.get(NgModuleRef);
201 this.console = injector.get(Console);
202 const ngZone = injector.get(NgZone);
203 this.isNgZoneEnabled = ngZone instanceof NgZone && NgZone.isInAngularZone();
204 this.resetConfig(config);
205 this.currentUrlTree = createEmptyUrlTree();
206 this.rawUrlTree = this.currentUrlTree;
207 this.browserUrlTree = this.currentUrlTree;
208 this.configLoader = new RouterConfigLoader(loader, compiler, onLoadStart, onLoadEnd);
209 this.routerState = createEmptyState(this.currentUrlTree, this.rootComponentType);
210 this.transitions = new BehaviorSubject({
211 id: 0,
212 targetPageId: 0,
213 currentUrlTree: this.currentUrlTree,
214 currentRawUrl: this.currentUrlTree,
215 extractedUrl: this.urlHandlingStrategy.extract(this.currentUrlTree),
216 urlAfterRedirects: this.urlHandlingStrategy.extract(this.currentUrlTree),
217 rawUrl: this.currentUrlTree,
218 extras: {},
219 resolve: null,
220 reject: null,
221 promise: Promise.resolve(true),
222 source: 'imperative',
223 restoredState: null,
224 currentSnapshot: this.routerState.snapshot,
225 targetSnapshot: null,
226 currentRouterState: this.routerState,
227 targetRouterState: null,
228 guards: { canActivateChecks: [], canDeactivateChecks: [] },
229 guardsResult: null,
230 });
231 this.navigations = this.setupNavigations(this.transitions);
232 this.processNavigations();
233 }
234 /**
235 * The ɵrouterPageId of whatever page is currently active in the browser history. This is
236 * important for computing the target page id for new navigations because we need to ensure each
237 * page id in the browser history is 1 more than the previous entry.
238 */
239 get browserPageId() {
240 var _a;
241 return (_a = this.location.getState()) === null || _a === void 0 ? void 0 : _a.ɵrouterPageId;
242 }
243 setupNavigations(transitions) {
244 const eventsSubject = this.events;
245 return transitions.pipe(filter(t => t.id !== 0),
246 // Extract URL
247 map(t => (Object.assign(Object.assign({}, t), { extractedUrl: this.urlHandlingStrategy.extract(t.rawUrl) }))),
248 // Using switchMap so we cancel executing navigations when a new one comes in
249 switchMap(t => {
250 let completed = false;
251 let errored = false;
252 return of(t).pipe(
253 // Store the Navigation object
254 tap(t => {
255 this.currentNavigation = {
256 id: t.id,
257 initialUrl: t.currentRawUrl,
258 extractedUrl: t.extractedUrl,
259 trigger: t.source,
260 extras: t.extras,
261 previousNavigation: this.lastSuccessfulNavigation ? Object.assign(Object.assign({}, this.lastSuccessfulNavigation), { previousNavigation: null }) :
262 null
263 };
264 }), switchMap(t => {
265 const browserUrlTree = this.browserUrlTree.toString();
266 const urlTransition = !this.navigated ||
267 t.extractedUrl.toString() !== browserUrlTree ||
268 // Navigations which succeed or ones which fail and are cleaned up
269 // correctly should result in `browserUrlTree` and `currentUrlTree`
270 // matching. If this is not the case, assume something went wrong and try
271 // processing the URL again.
272 browserUrlTree !== this.currentUrlTree.toString();
273 const processCurrentUrl = (this.onSameUrlNavigation === 'reload' ? true : urlTransition) &&
274 this.urlHandlingStrategy.shouldProcessUrl(t.rawUrl);
275 if (processCurrentUrl) {
276 // If the source of the navigation is from a browser event, the URL is
277 // already updated. We already need to sync the internal state.
278 if (isBrowserTriggeredNavigation(t.source)) {
279 this.browserUrlTree = t.extractedUrl;
280 }
281 return of(t).pipe(
282 // Fire NavigationStart event
283 switchMap(t => {
284 const transition = this.transitions.getValue();
285 eventsSubject.next(new NavigationStart(t.id, this.serializeUrl(t.extractedUrl), t.source, t.restoredState));
286 if (transition !== this.transitions.getValue()) {
287 return EMPTY;
288 }
289 // This delay is required to match old behavior that forced
290 // navigation to always be async
291 return Promise.resolve(t);
292 }),
293 // ApplyRedirects
294 applyRedirects(this.ngModule.injector, this.configLoader, this.urlSerializer, this.config),
295 // Update the currentNavigation
296 tap(t => {
297 this.currentNavigation = Object.assign(Object.assign({}, this.currentNavigation), { finalUrl: t.urlAfterRedirects });
298 }),
299 // Recognize
300 recognize(this.rootComponentType, this.config, (url) => this.serializeUrl(url), this.paramsInheritanceStrategy, this.relativeLinkResolution),
301 // Update URL if in `eager` update mode
302 tap(t => {
303 if (this.urlUpdateStrategy === 'eager') {
304 if (!t.extras.skipLocationChange) {
305 this.setBrowserUrl(t.urlAfterRedirects, t);
306 // TODO(atscott): The above line is incorrect. It sets the url to
307 // only the part that is handled by the router. It should merge
308 // that with the rawUrl so the url includes segments not handled
309 // by the router:
310 // const rawUrl = this.urlHandlingStrategy.merge(
311 // t.urlAfterRedirects, t.rawUrl);
312 // this.setBrowserUrl(rawUrl, t);
313 }
314 this.browserUrlTree = t.urlAfterRedirects;
315 }
316 // Fire RoutesRecognized
317 const routesRecognized = new RoutesRecognized(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot);
318 eventsSubject.next(routesRecognized);
319 }));
320 }
321 else {
322 const processPreviousUrl = urlTransition && this.rawUrlTree &&
323 this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree);
324 /* When the current URL shouldn't be processed, but the previous one was,
325 * we handle this "error condition" by navigating to the previously
326 * successful URL, but leaving the URL intact.*/
327 if (processPreviousUrl) {
328 const { id, extractedUrl, source, restoredState, extras } = t;
329 const navStart = new NavigationStart(id, this.serializeUrl(extractedUrl), source, restoredState);
330 eventsSubject.next(navStart);
331 const targetSnapshot = createEmptyState(extractedUrl, this.rootComponentType).snapshot;
332 return of(Object.assign(Object.assign({}, t), { targetSnapshot, urlAfterRedirects: extractedUrl, extras: Object.assign(Object.assign({}, extras), { skipLocationChange: false, replaceUrl: false }) }));
333 }
334 else {
335 /* When neither the current or previous URL can be processed, do nothing
336 * other than update router's internal reference to the current "settled"
337 * URL. This way the next navigation will be coming from the current URL
338 * in the browser.
339 */
340 this.rawUrlTree = t.rawUrl;
341 this.browserUrlTree = t.urlAfterRedirects;
342 t.resolve(null);
343 return EMPTY;
344 }
345 }
346 }),
347 // Before Preactivation
348 switchTap(t => {
349 const { targetSnapshot, id: navigationId, extractedUrl: appliedUrlTree, rawUrl: rawUrlTree, extras: { skipLocationChange, replaceUrl } } = t;
350 return this.hooks.beforePreactivation(targetSnapshot, {
351 navigationId,
352 appliedUrlTree,
353 rawUrlTree,
354 skipLocationChange: !!skipLocationChange,
355 replaceUrl: !!replaceUrl,
356 });
357 }),
358 // --- GUARDS ---
359 tap(t => {
360 const guardsStart = new GuardsCheckStart(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot);
361 this.triggerEvent(guardsStart);
362 }), map(t => (Object.assign(Object.assign({}, t), { guards: getAllRouteGuards(t.targetSnapshot, t.currentSnapshot, this.rootContexts) }))), checkGuards(this.ngModule.injector, (evt) => this.triggerEvent(evt)), tap(t => {
363 if (isUrlTree(t.guardsResult)) {
364 const error = navigationCancelingError(`Redirecting to "${this.serializeUrl(t.guardsResult)}"`);
365 error.url = t.guardsResult;
366 throw error;
367 }
368 const guardsEnd = new GuardsCheckEnd(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot, !!t.guardsResult);
369 this.triggerEvent(guardsEnd);
370 }), filter(t => {
371 if (!t.guardsResult) {
372 this.restoreHistory(t);
373 this.cancelNavigationTransition(t, '');
374 return false;
375 }
376 return true;
377 }),
378 // --- RESOLVE ---
379 switchTap(t => {
380 if (t.guards.canActivateChecks.length) {
381 return of(t).pipe(tap(t => {
382 const resolveStart = new ResolveStart(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot);
383 this.triggerEvent(resolveStart);
384 }), switchMap(t => {
385 let dataResolved = false;
386 return of(t).pipe(resolveData(this.paramsInheritanceStrategy, this.ngModule.injector), tap({
387 next: () => dataResolved = true,
388 complete: () => {
389 if (!dataResolved) {
390 this.restoreHistory(t);
391 this.cancelNavigationTransition(t, `At least one route resolver didn't emit any value.`);
392 }
393 }
394 }));
395 }), tap(t => {
396 const resolveEnd = new ResolveEnd(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot);
397 this.triggerEvent(resolveEnd);
398 }));
399 }
400 return undefined;
401 }),
402 // --- AFTER PREACTIVATION ---
403 switchTap((t) => {
404 const { targetSnapshot, id: navigationId, extractedUrl: appliedUrlTree, rawUrl: rawUrlTree, extras: { skipLocationChange, replaceUrl } } = t;
405 return this.hooks.afterPreactivation(targetSnapshot, {
406 navigationId,
407 appliedUrlTree,
408 rawUrlTree,
409 skipLocationChange: !!skipLocationChange,
410 replaceUrl: !!replaceUrl,
411 });
412 }), map((t) => {
413 const targetRouterState = createRouterState(this.routeReuseStrategy, t.targetSnapshot, t.currentRouterState);
414 return (Object.assign(Object.assign({}, t), { targetRouterState }));
415 }),
416 /* Once here, we are about to activate syncronously. The assumption is this
417 will succeed, and user code may read from the Router service. Therefore
418 before activation, we need to update router properties storing the current
419 URL and the RouterState, as well as updated the browser URL. All this should
420 happen *before* activating. */
421 tap((t) => {
422 this.currentUrlTree = t.urlAfterRedirects;
423 this.rawUrlTree =
424 this.urlHandlingStrategy.merge(t.urlAfterRedirects, t.rawUrl);
425 this.routerState = t.targetRouterState;
426 if (this.urlUpdateStrategy === 'deferred') {
427 if (!t.extras.skipLocationChange) {
428 this.setBrowserUrl(this.rawUrlTree, t);
429 }
430 this.browserUrlTree = t.urlAfterRedirects;
431 }
432 }), activateRoutes(this.rootContexts, this.routeReuseStrategy, (evt) => this.triggerEvent(evt)), tap({
433 next() {
434 completed = true;
435 },
436 complete() {
437 completed = true;
438 }
439 }), finalize(() => {
440 /* When the navigation stream finishes either through error or success, we
441 * set the `completed` or `errored` flag. However, there are some situations
442 * where we could get here without either of those being set. For instance, a
443 * redirect during NavigationStart. Therefore, this is a catch-all to make
444 * sure the NavigationCancel
445 * event is fired when a navigation gets cancelled but not caught by other
446 * means. */
447 if (!completed && !errored) {
448 const cancelationReason = `Navigation ID ${t.id} is not equal to the current navigation id ${this.navigationId}`;
449 if (this.canceledNavigationResolution === 'replace') {
450 // Must reset to current URL tree here to ensure history.state is set. On
451 // a fresh page load, if a new navigation comes in before a successful
452 // navigation completes, there will be nothing in
453 // history.state.navigationId. This can cause sync problems with
454 // AngularJS sync code which looks for a value here in order to determine
455 // whether or not to handle a given popstate event or to leave it to the
456 // Angular router.
457 this.restoreHistory(t);
458 this.cancelNavigationTransition(t, cancelationReason);
459 }
460 else {
461 // We cannot trigger a `location.historyGo` if the
462 // cancellation was due to a new navigation before the previous could
463 // complete. This is because `location.historyGo` triggers a `popstate`
464 // which would also trigger another navigation. Instead, treat this as a
465 // redirect and do not reset the state.
466 this.cancelNavigationTransition(t, cancelationReason);
467 // TODO(atscott): The same problem happens here with a fresh page load
468 // and a new navigation before that completes where we won't set a page
469 // id.
470 }
471 }
472 // currentNavigation should always be reset to null here. If navigation was
473 // successful, lastSuccessfulTransition will have already been set. Therefore
474 // we can safely set currentNavigation to null here.
475 this.currentNavigation = null;
476 }), catchError((e) => {
477 // TODO(atscott): The NavigationTransition `t` used here does not accurately
478 // reflect the current state of the whole transition because some operations
479 // return a new object rather than modifying the one in the outermost
480 // `switchMap`.
481 // The fix can likely be to:
482 // 1. Rename the outer `t` variable so it's not shadowed all the time and
483 // confusing
484 // 2. Keep reassigning to the outer variable after each stage to ensure it
485 // gets updated. Or change the implementations to not return a copy.
486 // Not changed yet because it affects existing code and would need to be
487 // tested more thoroughly.
488 errored = true;
489 /* This error type is issued during Redirect, and is handled as a
490 * cancellation rather than an error. */
491 if (isNavigationCancelingError(e)) {
492 const redirecting = isUrlTree(e.url);
493 if (!redirecting) {
494 // Set property only if we're not redirecting. If we landed on a page and
495 // redirect to `/` route, the new navigation is going to see the `/`
496 // isn't a change from the default currentUrlTree and won't navigate.
497 // This is only applicable with initial navigation, so setting
498 // `navigated` only when not redirecting resolves this scenario.
499 this.navigated = true;
500 this.restoreHistory(t, true);
501 }
502 const navCancel = new NavigationCancel(t.id, this.serializeUrl(t.extractedUrl), e.message);
503 eventsSubject.next(navCancel);
504 // When redirecting, we need to delay resolving the navigation
505 // promise and push it to the redirect navigation
506 if (!redirecting) {
507 t.resolve(false);
508 }
509 else {
510 // setTimeout is required so this navigation finishes with
511 // the return EMPTY below. If it isn't allowed to finish
512 // processing, there can be multiple navigations to the same
513 // URL.
514 setTimeout(() => {
515 const mergedTree = this.urlHandlingStrategy.merge(e.url, this.rawUrlTree);
516 const extras = {
517 skipLocationChange: t.extras.skipLocationChange,
518 // The URL is already updated at this point if we have 'eager' URL
519 // updates or if the navigation was triggered by the browser (back
520 // button, URL bar, etc). We want to replace that item in history if
521 // the navigation is rejected.
522 replaceUrl: this.urlUpdateStrategy === 'eager' ||
523 isBrowserTriggeredNavigation(t.source)
524 };
525 this.scheduleNavigation(mergedTree, 'imperative', null, extras, { resolve: t.resolve, reject: t.reject, promise: t.promise });
526 }, 0);
527 }
528 /* All other errors should reset to the router's internal URL reference to
529 * the pre-error state. */
530 }
531 else {
532 this.restoreHistory(t, true);
533 const navError = new NavigationError(t.id, this.serializeUrl(t.extractedUrl), e);
534 eventsSubject.next(navError);
535 try {
536 t.resolve(this.errorHandler(e));
537 }
538 catch (ee) {
539 t.reject(ee);
540 }
541 }
542 return EMPTY;
543 }));
544 // TODO(jasonaden): remove cast once g3 is on updated TypeScript
545 }));
546 }
547 /**
548 * @internal
549 * TODO: this should be removed once the constructor of the router made internal
550 */
551 resetRootComponentType(rootComponentType) {
552 this.rootComponentType = rootComponentType;
553 // TODO: vsavkin router 4.0 should make the root component set to null
554 // this will simplify the lifecycle of the router.
555 this.routerState.root.component = this.rootComponentType;
556 }
557 getTransition() {
558 const transition = this.transitions.value;
559 // TODO(atscott): This comment doesn't make it clear why this value needs to be set. In the case
560 // described below (where we don't handle previous or current url), the `browserUrlTree` is set
561 // to the `urlAfterRedirects` value. However, these values *are already the same* because of the
562 // line below. So it seems that we should be able to remove the line below and the line where
563 // `browserUrlTree` is updated when we aren't handling any part of the navigation url.
564 // Run TGP to confirm that this can be done.
565 // This value needs to be set. Other values such as extractedUrl are set on initial navigation
566 // but the urlAfterRedirects may not get set if we aren't processing the new URL *and* not
567 // processing the previous URL.
568 transition.urlAfterRedirects = this.browserUrlTree;
569 return transition;
570 }
571 setTransition(t) {
572 this.transitions.next(Object.assign(Object.assign({}, this.getTransition()), t));
573 }
574 /**
575 * Sets up the location change listener and performs the initial navigation.
576 */
577 initialNavigation() {
578 this.setUpLocationChangeListener();
579 if (this.navigationId === 0) {
580 this.navigateByUrl(this.location.path(true), { replaceUrl: true });
581 }
582 }
583 /**
584 * Sets up the location change listener. This listener detects navigations triggered from outside
585 * the Router (the browser back/forward buttons, for example) and schedules a corresponding Router
586 * navigation so that the correct events, guards, etc. are triggered.
587 */
588 setUpLocationChangeListener() {
589 // Don't need to use Zone.wrap any more, because zone.js
590 // already patch onPopState, so location change callback will
591 // run into ngZone
592 if (!this.locationSubscription) {
593 this.locationSubscription = this.location.subscribe(event => {
594 const currentChange = this.extractLocationChangeInfoFromEvent(event);
595 // The `setTimeout` was added in #12160 and is likely to support Angular/AngularJS
596 // hybrid apps.
597 if (this.shouldScheduleNavigation(this.lastLocationChangeInfo, currentChange)) {
598 setTimeout(() => {
599 const { source, state, urlTree } = currentChange;
600 const extras = { replaceUrl: true };
601 if (state) {
602 const stateCopy = Object.assign({}, state);
603 delete stateCopy.navigationId;
604 delete stateCopy.ɵrouterPageId;
605 if (Object.keys(stateCopy).length !== 0) {
606 extras.state = stateCopy;
607 }
608 }
609 this.scheduleNavigation(urlTree, source, state, extras);
610 }, 0);
611 }
612 this.lastLocationChangeInfo = currentChange;
613 });
614 }
615 }
616 /** Extracts router-related information from a `PopStateEvent`. */
617 extractLocationChangeInfoFromEvent(change) {
618 var _a;
619 return {
620 source: change['type'] === 'popstate' ? 'popstate' : 'hashchange',
621 urlTree: this.parseUrl(change['url']),
622 // Navigations coming from Angular router have a navigationId state
623 // property. When this exists, restore the state.
624 state: ((_a = change.state) === null || _a === void 0 ? void 0 : _a.navigationId) ? change.state : null,
625 transitionId: this.getTransition().id
626 };
627 }
628 /**
629 * Determines whether two events triggered by the Location subscription are due to the same
630 * navigation. The location subscription can fire two events (popstate and hashchange) for a
631 * single navigation. The second one should be ignored, that is, we should not schedule another
632 * navigation in the Router.
633 */
634 shouldScheduleNavigation(previous, current) {
635 if (!previous)
636 return true;
637 const sameDestination = current.urlTree.toString() === previous.urlTree.toString();
638 const eventsOccurredAtSameTime = current.transitionId === previous.transitionId;
639 if (!eventsOccurredAtSameTime || !sameDestination) {
640 return true;
641 }
642 if ((current.source === 'hashchange' && previous.source === 'popstate') ||
643 (current.source === 'popstate' && previous.source === 'hashchange')) {
644 return false;
645 }
646 return true;
647 }
648 /** The current URL. */
649 get url() {
650 return this.serializeUrl(this.currentUrlTree);
651 }
652 /**
653 * Returns the current `Navigation` object when the router is navigating,
654 * and `null` when idle.
655 */
656 getCurrentNavigation() {
657 return this.currentNavigation;
658 }
659 /** @internal */
660 triggerEvent(event) {
661 this.events.next(event);
662 }
663 /**
664 * Resets the route configuration used for navigation and generating links.
665 *
666 * @param config The route array for the new configuration.
667 *
668 * @usageNotes
669 *
670 * ```
671 * router.resetConfig([
672 * { path: 'team/:id', component: TeamCmp, children: [
673 * { path: 'simple', component: SimpleCmp },
674 * { path: 'user/:name', component: UserCmp }
675 * ]}
676 * ]);
677 * ```
678 */
679 resetConfig(config) {
680 validateConfig(config);
681 this.config = config.map(standardizeConfig);
682 this.navigated = false;
683 this.lastSuccessfulId = -1;
684 }
685 /** @nodoc */
686 ngOnDestroy() {
687 this.dispose();
688 }
689 /** Disposes of the router. */
690 dispose() {
691 this.transitions.complete();
692 if (this.locationSubscription) {
693 this.locationSubscription.unsubscribe();
694 this.locationSubscription = undefined;
695 }
696 this.disposed = true;
697 }
698 /**
699 * Appends URL segments to the current URL tree to create a new URL tree.
700 *
701 * @param commands An array of URL fragments with which to construct the new URL tree.
702 * If the path is static, can be the literal URL string. For a dynamic path, pass an array of path
703 * segments, followed by the parameters for each segment.
704 * The fragments are applied to the current URL tree or the one provided in the `relativeTo`
705 * property of the options object, if supplied.
706 * @param navigationExtras Options that control the navigation strategy.
707 * @returns The new URL tree.
708 *
709 * @usageNotes
710 *
711 * ```
712 * // create /team/33/user/11
713 * router.createUrlTree(['/team', 33, 'user', 11]);
714 *
715 * // create /team/33;expand=true/user/11
716 * router.createUrlTree(['/team', 33, {expand: true}, 'user', 11]);
717 *
718 * // you can collapse static segments like this (this works only with the first passed-in value):
719 * router.createUrlTree(['/team/33/user', userId]);
720 *
721 * // If the first segment can contain slashes, and you do not want the router to split it,
722 * // you can do the following:
723 * router.createUrlTree([{segmentPath: '/one/two'}]);
724 *
725 * // create /team/33/(user/11//right:chat)
726 * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: 'chat'}}]);
727 *
728 * // remove the right secondary node
729 * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: null}}]);
730 *
731 * // assuming the current url is `/team/33/user/11` and the route points to `user/11`
732 *
733 * // navigate to /team/33/user/11/details
734 * router.createUrlTree(['details'], {relativeTo: route});
735 *
736 * // navigate to /team/33/user/22
737 * router.createUrlTree(['../22'], {relativeTo: route});
738 *
739 * // navigate to /team/44/user/22
740 * router.createUrlTree(['../../team/44/user/22'], {relativeTo: route});
741 *
742 * Note that a value of `null` or `undefined` for `relativeTo` indicates that the
743 * tree should be created relative to the root.
744 * ```
745 */
746 createUrlTree(commands, navigationExtras = {}) {
747 const { relativeTo, queryParams, fragment, queryParamsHandling, preserveFragment } = navigationExtras;
748 const a = relativeTo || this.routerState.root;
749 const f = preserveFragment ? this.currentUrlTree.fragment : fragment;
750 let q = null;
751 switch (queryParamsHandling) {
752 case 'merge':
753 q = Object.assign(Object.assign({}, this.currentUrlTree.queryParams), queryParams);
754 break;
755 case 'preserve':
756 q = this.currentUrlTree.queryParams;
757 break;
758 default:
759 q = queryParams || null;
760 }
761 if (q !== null) {
762 q = this.removeEmptyProps(q);
763 }
764 return createUrlTree(a, this.currentUrlTree, commands, q, f !== null && f !== void 0 ? f : null);
765 }
766 /**
767 * Navigates to a view using an absolute route path.
768 *
769 * @param url An absolute path for a defined route. The function does not apply any delta to the
770 * current URL.
771 * @param extras An object containing properties that modify the navigation strategy.
772 *
773 * @returns A Promise that resolves to 'true' when navigation succeeds,
774 * to 'false' when navigation fails, or is rejected on error.
775 *
776 * @usageNotes
777 *
778 * The following calls request navigation to an absolute path.
779 *
780 * ```
781 * router.navigateByUrl("/team/33/user/11");
782 *
783 * // Navigate without updating the URL
784 * router.navigateByUrl("/team/33/user/11", { skipLocationChange: true });
785 * ```
786 *
787 * @see [Routing and Navigation guide](guide/router)
788 *
789 */
790 navigateByUrl(url, extras = {
791 skipLocationChange: false
792 }) {
793 if (typeof ngDevMode === 'undefined' ||
794 ngDevMode && this.isNgZoneEnabled && !NgZone.isInAngularZone()) {
795 this.console.warn(`Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?`);
796 }
797 const urlTree = isUrlTree(url) ? url : this.parseUrl(url);
798 const mergedTree = this.urlHandlingStrategy.merge(urlTree, this.rawUrlTree);
799 return this.scheduleNavigation(mergedTree, 'imperative', null, extras);
800 }
801 /**
802 * Navigate based on the provided array of commands and a starting point.
803 * If no starting route is provided, the navigation is absolute.
804 *
805 * @param commands An array of URL fragments with which to construct the target URL.
806 * If the path is static, can be the literal URL string. For a dynamic path, pass an array of path
807 * segments, followed by the parameters for each segment.
808 * The fragments are applied to the current URL or the one provided in the `relativeTo` property
809 * of the options object, if supplied.
810 * @param extras An options object that determines how the URL should be constructed or
811 * interpreted.
812 *
813 * @returns A Promise that resolves to `true` when navigation succeeds, to `false` when navigation
814 * fails,
815 * or is rejected on error.
816 *
817 * @usageNotes
818 *
819 * The following calls request navigation to a dynamic route path relative to the current URL.
820 *
821 * ```
822 * router.navigate(['team', 33, 'user', 11], {relativeTo: route});
823 *
824 * // Navigate without updating the URL, overriding the default behavior
825 * router.navigate(['team', 33, 'user', 11], {relativeTo: route, skipLocationChange: true});
826 * ```
827 *
828 * @see [Routing and Navigation guide](guide/router)
829 *
830 */
831 navigate(commands, extras = { skipLocationChange: false }) {
832 validateCommands(commands);
833 return this.navigateByUrl(this.createUrlTree(commands, extras), extras);
834 }
835 /** Serializes a `UrlTree` into a string */
836 serializeUrl(url) {
837 return this.urlSerializer.serialize(url);
838 }
839 /** Parses a string into a `UrlTree` */
840 parseUrl(url) {
841 let urlTree;
842 try {
843 urlTree = this.urlSerializer.parse(url);
844 }
845 catch (e) {
846 urlTree = this.malformedUriErrorHandler(e, this.urlSerializer, url);
847 }
848 return urlTree;
849 }
850 isActive(url, matchOptions) {
851 let options;
852 if (matchOptions === true) {
853 options = Object.assign({}, exactMatchOptions);
854 }
855 else if (matchOptions === false) {
856 options = Object.assign({}, subsetMatchOptions);
857 }
858 else {
859 options = matchOptions;
860 }
861 if (isUrlTree(url)) {
862 return containsTree(this.currentUrlTree, url, options);
863 }
864 const urlTree = this.parseUrl(url);
865 return containsTree(this.currentUrlTree, urlTree, options);
866 }
867 removeEmptyProps(params) {
868 return Object.keys(params).reduce((result, key) => {
869 const value = params[key];
870 if (value !== null && value !== undefined) {
871 result[key] = value;
872 }
873 return result;
874 }, {});
875 }
876 processNavigations() {
877 this.navigations.subscribe(t => {
878 this.navigated = true;
879 this.lastSuccessfulId = t.id;
880 this.currentPageId = t.targetPageId;
881 this.events
882 .next(new NavigationEnd(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(this.currentUrlTree)));
883 this.lastSuccessfulNavigation = this.currentNavigation;
884 t.resolve(true);
885 }, e => {
886 this.console.warn(`Unhandled Navigation Error: ${e}`);
887 });
888 }
889 scheduleNavigation(rawUrl, source, restoredState, extras, priorPromise) {
890 var _a, _b;
891 if (this.disposed) {
892 return Promise.resolve(false);
893 }
894 // * Imperative navigations (router.navigate) might trigger additional navigations to the same
895 // URL via a popstate event and the locationChangeListener. We should skip these duplicate
896 // navs. Duplicates may also be triggered by attempts to sync AngularJS and Angular router
897 // states.
898 // * Imperative navigations can be cancelled by router guards, meaning the URL won't change. If
899 // the user follows that with a navigation using the back/forward button or manual URL change,
900 // the destination may be the same as the previous imperative attempt. We should not skip
901 // these navigations because it's a separate case from the one above -- it's not a duplicate
902 // navigation.
903 const lastNavigation = this.getTransition();
904 // We don't want to skip duplicate successful navs if they're imperative because
905 // onSameUrlNavigation could be 'reload' (so the duplicate is intended).
906 const browserNavPrecededByRouterNav = isBrowserTriggeredNavigation(source) && lastNavigation &&
907 !isBrowserTriggeredNavigation(lastNavigation.source);
908 const lastNavigationSucceeded = this.lastSuccessfulId === lastNavigation.id;
909 // If the last navigation succeeded or is in flight, we can use the rawUrl as the comparison.
910 // However, if it failed, we should compare to the final result (urlAfterRedirects).
911 const lastNavigationUrl = (lastNavigationSucceeded || this.currentNavigation) ?
912 lastNavigation.rawUrl :
913 lastNavigation.urlAfterRedirects;
914 const duplicateNav = lastNavigationUrl.toString() === rawUrl.toString();
915 if (browserNavPrecededByRouterNav && duplicateNav) {
916 return Promise.resolve(true); // return value is not used
917 }
918 let resolve;
919 let reject;
920 let promise;
921 if (priorPromise) {
922 resolve = priorPromise.resolve;
923 reject = priorPromise.reject;
924 promise = priorPromise.promise;
925 }
926 else {
927 promise = new Promise((res, rej) => {
928 resolve = res;
929 reject = rej;
930 });
931 }
932 const id = ++this.navigationId;
933 let targetPageId;
934 if (this.canceledNavigationResolution === 'computed') {
935 const isInitialPage = this.currentPageId === 0;
936 if (isInitialPage) {
937 restoredState = this.location.getState();
938 }
939 // If the `ɵrouterPageId` exist in the state then `targetpageId` should have the value of
940 // `ɵrouterPageId`. This is the case for something like a page refresh where we assign the
941 // target id to the previously set value for that page.
942 if (restoredState && restoredState.ɵrouterPageId) {
943 targetPageId = restoredState.ɵrouterPageId;
944 }
945 else {
946 // If we're replacing the URL or doing a silent navigation, we do not want to increment the
947 // page id because we aren't pushing a new entry to history.
948 if (extras.replaceUrl || extras.skipLocationChange) {
949 targetPageId = (_a = this.browserPageId) !== null && _a !== void 0 ? _a : 0;
950 }
951 else {
952 targetPageId = ((_b = this.browserPageId) !== null && _b !== void 0 ? _b : 0) + 1;
953 }
954 }
955 }
956 else {
957 // This is unused when `canceledNavigationResolution` is not computed.
958 targetPageId = 0;
959 }
960 this.setTransition({
961 id,
962 targetPageId,
963 source,
964 restoredState,
965 currentUrlTree: this.currentUrlTree,
966 currentRawUrl: this.rawUrlTree,
967 rawUrl,
968 extras,
969 resolve,
970 reject,
971 promise,
972 currentSnapshot: this.routerState.snapshot,
973 currentRouterState: this.routerState
974 });
975 // Make sure that the error is propagated even though `processNavigations` catch
976 // handler does not rethrow
977 return promise.catch((e) => {
978 return Promise.reject(e);
979 });
980 }
981 setBrowserUrl(url, t) {
982 const path = this.urlSerializer.serialize(url);
983 const state = Object.assign(Object.assign({}, t.extras.state), this.generateNgRouterState(t.id, t.targetPageId));
984 if (this.location.isCurrentPathEqualTo(path) || !!t.extras.replaceUrl) {
985 this.location.replaceState(path, '', state);
986 }
987 else {
988 this.location.go(path, '', state);
989 }
990 }
991 /**
992 * Performs the necessary rollback action to restore the browser URL to the
993 * state before the transition.
994 */
995 restoreHistory(t, restoringFromCaughtError = false) {
996 var _a, _b;
997 if (this.canceledNavigationResolution === 'computed') {
998 const targetPagePosition = this.currentPageId - t.targetPageId;
999 // The navigator change the location before triggered the browser event,
1000 // so we need to go back to the current url if the navigation is canceled.
1001 // Also, when navigation gets cancelled while using url update strategy eager, then we need to
1002 // go back. Because, when `urlUpdateSrategy` is `eager`; `setBrowserUrl` method is called
1003 // before any verification.
1004 const browserUrlUpdateOccurred = (t.source === 'popstate' || this.urlUpdateStrategy === 'eager' ||
1005 this.currentUrlTree === ((_a = this.currentNavigation) === null || _a === void 0 ? void 0 : _a.finalUrl));
1006 if (browserUrlUpdateOccurred && targetPagePosition !== 0) {
1007 this.location.historyGo(targetPagePosition);
1008 }
1009 else if (this.currentUrlTree === ((_b = this.currentNavigation) === null || _b === void 0 ? void 0 : _b.finalUrl) && targetPagePosition === 0) {
1010 // We got to the activation stage (where currentUrlTree is set to the navigation's
1011 // finalUrl), but we weren't moving anywhere in history (skipLocationChange or replaceUrl).
1012 // We still need to reset the router state back to what it was when the navigation started.
1013 this.resetState(t);
1014 // TODO(atscott): resetting the `browserUrlTree` should really be done in `resetState`.
1015 // Investigate if this can be done by running TGP.
1016 this.browserUrlTree = t.currentUrlTree;
1017 this.resetUrlToCurrentUrlTree();
1018 }
1019 else {
1020 // The browser URL and router state was not updated before the navigation cancelled so
1021 // there's no restoration needed.
1022 }
1023 }
1024 else if (this.canceledNavigationResolution === 'replace') {
1025 // TODO(atscott): It seems like we should _always_ reset the state here. It would be a no-op
1026 // for `deferred` navigations that haven't change the internal state yet because guards
1027 // reject. For 'eager' navigations, it seems like we also really should reset the state
1028 // because the navigation was cancelled. Investigate if this can be done by running TGP.
1029 if (restoringFromCaughtError) {
1030 this.resetState(t);
1031 }
1032 this.resetUrlToCurrentUrlTree();
1033 }
1034 }
1035 resetState(t) {
1036 this.routerState = t.currentRouterState;
1037 this.currentUrlTree = t.currentUrlTree;
1038 this.rawUrlTree = this.urlHandlingStrategy.merge(this.currentUrlTree, t.rawUrl);
1039 }
1040 resetUrlToCurrentUrlTree() {
1041 this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree), '', this.generateNgRouterState(this.lastSuccessfulId, this.currentPageId));
1042 }
1043 cancelNavigationTransition(t, reason) {
1044 const navCancel = new NavigationCancel(t.id, this.serializeUrl(t.extractedUrl), reason);
1045 this.triggerEvent(navCancel);
1046 t.resolve(false);
1047 }
1048 generateNgRouterState(navigationId, routerPageId) {
1049 if (this.canceledNavigationResolution === 'computed') {
1050 return { navigationId, ɵrouterPageId: routerPageId };
1051 }
1052 return { navigationId };
1053 }
1054}
1055Router.decorators = [
1056 { type: Injectable }
1057];
1058Router.ctorParameters = () => [
1059 { type: Type },
1060 { type: UrlSerializer },
1061 { type: ChildrenOutletContexts },
1062 { type: Location },
1063 { type: Injector },
1064 { type: NgModuleFactoryLoader },
1065 { type: Compiler },
1066 { type: undefined }
1067];
1068function validateCommands(commands) {
1069 for (let i = 0; i < commands.length; i++) {
1070 const cmd = commands[i];
1071 if (cmd == null) {
1072 throw new Error(`The requested path contains ${cmd} segment at index ${i}`);
1073 }
1074 }
1075}
1076function isBrowserTriggeredNavigation(source) {
1077 return source !== 'imperative';
1078}
1079//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91dGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvcm91dGVyL3NyYy9yb3V0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFDLFFBQVEsRUFBZ0IsTUFBTSxpQkFBaUIsQ0FBQztBQUN4RCxPQUFPLEVBQUMsUUFBUSxFQUFFLFVBQVUsRUFBRSxRQUFRLEVBQUUscUJBQXFCLEVBQUUsV0FBVyxFQUFFLE1BQU0sRUFBRSxJQUFJLEVBQUUsUUFBUSxJQUFJLE9BQU8sRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUNwSSxPQUFPLEVBQUMsZUFBZSxFQUFFLEtBQUssRUFBYyxFQUFFLEVBQUUsT0FBTyxFQUFtQixNQUFNLE1BQU0sQ0FBQztBQUN2RixPQUFPLEVBQUMsVUFBVSxFQUFFLE1BQU0sRUFBRSxRQUFRLEVBQUUsR0FBRyxFQUFFLFNBQVMsRUFBRSxHQUFHLEVBQUMsTUFBTSxnQkFBZ0IsQ0FBQztBQUdqRixPQ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pb24+IHtcbiAgICBjb25zdCBldmVudHNTdWJqZWN0ID0gKHRoaXMuZXZlbnRzIGFzIFN1YmplY3Q8RXZlbnQ+KTtcbiAgICByZXR1cm4gdHJhbnNpdGlvbnMucGlwZShcbiAgICAgICAgICAgICAgIGZpbHRlcih0ID0+IHQuaWQgIT09IDApLFxuXG4gICAgICAgICAgICAgICAvLyBFeHRyYWN0IFVSTFxuICAgICAgICAgICAgICAgbWFwKHQgPT5cbiAgICAgICAgICAgICAgICAgICAgICAgKHsuLi50LCBleHRyYWN0ZWRVcmw6IHRoaXMudXJsSGFuZGxpbmdTdHJhdGVneS5leHRyYWN0KHQucmF3VXJsKX0gYXNcbiAgICAgICAgICAgICAgICAgICAgICAgIE5hdmlnYXRpb25UcmFuc2l0aW9uKSksXG5cbiAgICAgICAgICAgICAgIC8vIFVzaW5nIHN3aXRjaE1hcCBzbyB3ZSBjYW5jZWwgZXhlY3V0aW5nIG5hdmlnYXRpb25zIHdoZW4gYSBuZXcgb25lIGNvbWVzIGluXG4gICAgICAgICAgICAgICBzd2l0Y2hNYXAodCA9PiB7XG4gICAgICAgICAgICAgICAgIGxldCBjb21wbGV0ZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgbGV0IGVycm9yZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgcmV0dXJuIG9mKHQpLnBpcGUoXG4gICAgICAgICAgICAgICAgICAgICAvLyBTdG9yZSB0aGUgTmF2aWdhdGlvbiBvYmplY3RcbiAgICAgICAgICAgICAgICAgICAgIHRhcCh0ID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50TmF2aWdhdGlvbiA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICBpZDogdC5pZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICBpbml0aWFsVXJsOiB0LmN1cnJlbnRSYXdVcmwsXG4gICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmFjdGVkVXJsOiB0LmV4dHJhY3RlZFVybCxcbiAgICAgICAgICAgICAgICAgICAgICAgICB0cmlnZ2VyOiB0LnNvdXJjZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYXM6IHQuZXh0cmFzLFxuICAgICAgICAgICAgICAgICAgICAgICAgIHByZXZpb3VzTmF2aWdhdGlvbjogdGhpcy5sYXN0U3VjY2Vzc2Z1bE5hdmlnYXRpb24gP1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Li4udGhpcy5sYXN0U3VjY2Vzc2Z1bE5hdmlnYXRpb24sIHByZXZpb3VzTmF2aWdhdGlvbjogbnVsbH0gOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsXG4gICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICAgICAgIHN3aXRjaE1hcCh0ID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgYnJvd3NlclVybFRyZWUgPSB0aGlzLmJyb3dzZXJVcmxUcmVlLnRvU3RyaW5nKCk7XG4gICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHVybFRyYW5zaXRpb24gPSAhdGhpcy5uYXZpZ2F0ZWQgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIHQuZXh0cmFjdGVkVXJsLnRvU3RyaW5nKCkgIT09IGJyb3dzZXJVcmxUcmVlIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBOYXZpZ2F0aW9ucyB3aGljaCBzdWNjZWVkIG9yIG9uZXMgd2hpY2ggZmFpbCBhbmQgYXJlIGNsZWFuZWQgdXBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvcnJlY3RseSBzaG91bGQgcmVzdWx0IGluIGBicm93c2VyVXJsVHJlZWAgYW5kIGBjdXJyZW50VXJsVHJlZWBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG1hdGNoaW5nLiBJZiB0aGlzIGlzIG5vdCB0aGUgY2FzZSwgYXNzdW1lIHNvbWV0aGluZyB3ZW50IHdyb25nIGFuZCB0cnlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHByb2Nlc3NpbmcgdGhlIFVSTCBhZ2Fpbi5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyb3dzZXJVcmxUcmVlICE9PSB0aGlzLmN1cnJlbnRVcmxUcmVlLnRvU3RyaW5nKCk7XG4gICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHByb2Nlc3NDdXJyZW50VXJsID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICh0aGlzLm9uU2FtZVVybE5hdmlnYXRpb24gPT09ICdyZWxvYWQnID8gdHJ1ZSA6IHVybFRyYW5zaXRpb24pICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnVybEhhbmRsaW5nU3RyYXRlZ3kuc2hvdWxkUHJvY2Vzc1VybCh0LnJhd1VybCk7XG5cblxuICAgICAgICAgICAgICAgICAgICAgICBpZiAocHJvY2Vzc0N1cnJlbnRVcmwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgc291cmNlIG9mIHRoZSBuYXZpZ2F0aW9uIGlzIGZyb20gYSBicm93c2VyIGV2ZW50LCB0aGUgVVJMIGlzXG4gICAgICAgICAgICAgICAgICAgICAgICAgLy8gYWxyZWFkeSB1cGRhdGVkLiBXZSBhbHJlYWR5IG5lZWQgdG8gc3luYyB0aGUgaW50ZXJuYWwgc3RhdGUuXG4gICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzQnJvd3NlclRyaWdnZXJlZE5hdmlnYXRpb24odC5zb3VyY2UpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmJyb3dzZXJVcmxUcmVlID0gdC5leHRyYWN0ZWRVcmw7XG4gICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBvZih0KS5waXBlKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBGaXJlIE5hdmlnYXRpb25TdGFydCBldmVudFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2hNYXAodCA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdHJhbnNpdGlvbiA9IHRoaXMudHJhbnNpdGlvbnMuZ2V0VmFsdWUoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudHNTdWJqZWN0Lm5leHQobmV3IE5hdmlnYXRpb25TdGFydChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5pZCwgdGhpcy5zZXJpYWxpemVVcmwodC5leHRyYWN0ZWRVcmwpLCB0LnNvdXJjZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5yZXN0b3JlZFN0YXRlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRyYW5zaXRpb24gIT09IHRoaXMudHJhbnNpdGlvbnMuZ2V0VmFsdWUoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVNUFRZO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoaXMgZGVsYXkgaXMgcmVxdWlyZWQgdG8gbWF0Y2ggb2xkIGJlaGF2aW9yIHRoYXQgZm9yY2VkXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbmF2aWdhdGlvbiB0byBhbHdheXMgYmUgYXN5bmNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gUHJvbWlzZS5yZXNvbHZlKHQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBBcHBseVJlZGlyZWN0c1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHBseVJlZGlyZWN0cyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMubmdNb2R1bGUuaW5qZWN0b3IsIHRoaXMuY29uZmlnTG9hZGVyLCB0aGlzLnVybFNlcmlhbGl6ZXIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbmZpZyksXG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVXBkYXRlIHRoZSBjdXJyZW50TmF2aWdhdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YXAodCA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50TmF2aWdhdGlvbiA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC4uLnRoaXMuY3VycmVudE5hdmlnYXRpb24hLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluYWxVcmw6IHQudXJsQWZ0ZXJSZWRpcmVjdHNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBSZWNvZ25pemVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjb2duaXplKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5yb290Q29tcG9uZW50VHlwZSwgdGhpcy5jb25maWcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodXJsKSA9PiB0aGlzLnNlcmlhbGl6ZVVybCh1cmwpLCB0aGlzLnBhcmFtc0luaGVyaXRhbmNlU3RyYXRlZ3ksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnJlbGF0aXZlTGlua1Jlc29sdXRpb24pLFxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFVwZGF0ZSBVUkwgaWYgaW4gYGVhZ2VyYCB1cGRhdGUgbW9kZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YXAodCA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMudXJsVXBkYXRlU3RyYXRlZ3kgPT09ICdlYWdlcicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdC5leHRyYXMuc2tpcExvY2F0aW9uQ2hhbmdlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0QnJvd3NlclVybCh0LnVybEFmdGVyUmVkaXJlY3RzLCB0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ETyhhdHNjb3R0KTogVGhlIGFib3ZlIGxpbmUgaXMgaW5jb3JyZWN0LiBJdCBzZXRzIHRoZSB1cmwgdG9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gb25seSB0aGUgcGFydCB0aGF0IGlzIGhhbmRsZWQgYnkgdGhlIHJvdXRlci4gSXQgc2hvdWxkIG1lcmdlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoYXQgd2l0aCB0aGUgcmF3VXJsIHNvIHRoZSB1cmwgaW5jbHVkZXMgc2VnbWVudHMgbm90IGhhbmRsZWRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYnkgdGhlIHJvdXRlcjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIGNvbnN0IHJhd1VybCA9IHRoaXMudXJsSGFuZGxpbmdTdHJhdGVneS5tZXJnZShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICB0LnVybEFmdGVyUmVkaXJlY3RzLCB0LnJhd1VybCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICB0aGlzLnNldEJyb3dzZXJVcmwocmF3VXJsLCB0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuYnJvd3NlclVybFRyZWUgPSB0LnVybEFmdGVyUmVkaXJlY3RzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEZpcmUgUm91dGVzUmVjb2duaXplZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHJvdXRlc1JlY29nbml6ZWQgPSBuZXcgUm91dGVzUmVjb2duaXplZChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5pZCwgdGhpcy5zZXJpYWxpemVVcmwodC5leHRyYWN0ZWRVcmwpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNlcmlhbGl6ZVVybCh0LnVybEFmdGVyUmVkaXJlY3RzKSwgdC50YXJnZXRTbmFwc2hvdCEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50c1N1YmplY3QubmV4dChyb3V0ZXNSZWNvZ25pemVkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHByb2Nlc3NQcmV2aW91c1VybCA9IHVybFRyYW5zaXRpb24gJiYgdGhpcy5yYXdVcmxUcmVlICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMudXJsSGFuZGxpbmdTdHJhdGVneS5zaG91bGRQcm9jZXNzVXJsKHRoaXMucmF3VXJsVHJlZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgLyogV2hlbiB0aGUgY3VycmVudCBVUkwgc2hvdWxkbid0IGJlIHByb2Nlc3NlZCwgYnV0IHRoZSBwcmV2aW91cyBvbmUgd2FzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAqIHdlIGhhbmRsZSB0aGlzIFwiZXJyb3IgY29uZGl0aW9uXCIgYnkgbmF2aWdhdGluZyB0byB0aGUgcHJldmlvdXNseVxuICAgICAgICAgICAgICAgICAgICAgICAgICAqIHN1Y2Nlc3NmdWwgVVJMLCBidXQgbGVhdmluZyB0aGUgVVJMIGludGFjdC4qL1xuICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwcm9jZXNzUHJldmlvdXNVcmwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHtpZCwgZXh0cmFjdGVkVXJsLCBzb3VyY2UsIHJlc3RvcmVkU3RhdGUsIGV4dHJhc30gPSB0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgbmF2U3RhcnQgPSBuZXcgTmF2aWdhdGlvblN0YXJ0KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkLCB0aGlzLnNlcmlhbGl6ZVVybChleHRyYWN0ZWRVcmwpLCBzb3VyY2UsIHJlc3RvcmVkU3RhdGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnRzU3ViamVjdC5uZXh0KG5hdlN0YXJ0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHRhcmdldFNuYXBzaG90ID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjcmVhdGVFbXB0eVN0YXRlKGV4dHJhY3RlZFVybCwgdGhpcy5yb290Q29tcG9uZW50VHlwZSkuc25hcHNob3Q7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBvZih7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIC4uLnQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldFNuYXBzaG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxBZnRlclJlZGlyZWN0czogZXh0cmFjdGVkVXJsLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYXM6IHsuLi5leHRyYXMsIHNraXBMb2NhdGlvbkNoYW5nZTogZmFsc2UsIHJlcGxhY2VVcmw6IGZhbHNlfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBXaGVuIG5laXRoZXIgdGhlIGN1cnJlbnQgb3IgcHJldmlvdXMgVVJMIGNhbiBiZSBwcm9jZXNzZWQsIGRvIG5vdGhpbmdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIG90aGVyIHRoYW4gdXBkYXRlIHJvdXRlcidzIGludGVybmFsIHJlZmVyZW5jZSB0byB0aGUgY3VycmVudCBcInNldHRsZWRcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICogVVJMLiBUaGlzIHdheSB0aGUgbmV4dCBuYXZpZ2F0aW9uIHdpbGwgYmUgY29taW5nIGZyb20gdGhlIGN1cnJlbnQgVVJMXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBpbiB0aGUgYnJvd3Nlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5yYXdVcmxUcmVlID0gdC5yYXdVcmw7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmJyb3dzZXJVcmxUcmVlID0gdC51cmxBZnRlclJlZGlyZWN0cztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIHQucmVzb2x2ZShudWxsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBFTVBUWTtcbiAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgIH0pLFxuXG4gICAgICAgICAgICAgICAgICAgICAvLyBCZWZvcmUgUHJlYWN0aXZhdGlvblxuICAgICAgICAgICAgICAgICAgICAgc3dpdGNoVGFwKHQgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0U25hcHNob3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IG5hdmlnYXRpb25JZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYWN0ZWRVcmw6IGFwcGxpZWRVcmxUcmVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgIHJhd1VybDogcmF3VXJsVHJlZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYXM6IHtza2lwTG9jYXRpb25DaGFuZ2UsIHJlcGxhY2VVcmx9XG4gICAgICAgICAgICAgICAgICAgICAgIH0gPSB0O1xuICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5ob29rcy5iZWZvcmVQcmVhY3RpdmF0aW9uKHRhcmdldFNuYXBzaG90ISwge1xuICAgICAgICAgICAgICAgICAgICAgICAgIG5hdmlnYXRpb25JZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICBhcHBsaWVkVXJsVHJlZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICByYXdVcmxUcmVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgIHNraXBMb2NhdGlvbkNoYW5nZTogISFza2lwTG9jYXRpb25DaGFuZ2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAgcmVwbGFjZVVybDogISFyZXBsYWNlVXJsLFxuICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgIH0pLFxuXG4gICAgICAgICAgICAgICAgICAgICAvLyAtLS0gR1VBUkRTIC0tLVxuICAgICAgICAgICAgICAgICAgICAgdGFwKHQgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBndWFyZHNTdGFydCA9IG5ldyBHdWFyZHNDaGVja1N0YXJ0KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5pZCwgdGhpcy5zZXJpYWxpemVVcmwodC5leHRyYWN0ZWRVcmwpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXJpYWxpemVVcmwodC51cmxBZnRlclJlZGlyZWN0cyksIHQudGFyZ2V0U25hcHNob3QhKTtcbiAgICAgICAgICAgICAgICAgICAgICAgdGhpcy50cmlnZ2VyRXZlbnQoZ3VhcmRzU3RhcnQpO1xuICAgICAgICAgICAgICAgICAgICAgfSksXG5cbiAgICAgICAgICAgICAgICAgICAgIG1hcCh0ID0+ICh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAuLi50LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3VhcmRzOiBnZXRBbGxSb3V0ZUd1YXJkcyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0LnRhcmdldFNuYXBzaG90ISwgdC5jdXJyZW50U25hcHNob3QsIHRoaXMucm9vdENvbnRleHRzKVxuICAgICAgICAgICAgICAgICAgICAgICAgIH0pKSxcblxuICAgICAgICAgICAgICAgICAgICAgY2hlY2tHdWFyZHModGhpcy5uZ01vZHVsZS5pbmplY3RvciwgKGV2dDogRXZlbnQpID0+IHRoaXMudHJpZ2dlckV2ZW50KGV2dCkpLFxuICAgICAgICAgICAgICAgICAgICAgdGFwKHQgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNVcmxUcmVlKHQuZ3VhcmRzUmVzdWx0KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGVycm9yOiBFcnJvciZ7dXJsPzogVXJsVHJlZX0gPSBuYXZpZ2F0aW9uQ2FuY2VsaW5nRXJyb3IoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGBSZWRpcmVjdGluZyB0byBcIiR7dGhpcy5zZXJpYWxpemVVcmwodC5ndWFyZHNSZXN1bHQpfVwiYCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3IudXJsID0gdC5ndWFyZHNSZXN1bHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgZXJyb3I7XG4gICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBndWFyZHNFbmQgPSBuZXcgR3VhcmRzQ2hlY2tFbmQoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICB0LmlkLCB0aGlzLnNlcmlhbGl6ZVVybCh0LmV4dHJhY3RlZFVybCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNlcmlhbGl6ZVVybCh0LnVybEFmdGVyUmVkaXJlY3RzKSwgdC50YXJnZXRTbmFwc2hvdCEsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAhIXQuZ3VhcmRzUmVzdWx0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgdGhpcy50cmlnZ2VyRXZlbnQoZ3VhcmRzRW5kKTtcbiAgICAgICAgICAgICAgICAgICAgIH0pLFxuXG4gICAgICAgICAgICAgICAgICAgICBmaWx0ZXIodCA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgIGlmICghdC5ndWFyZHNSZXN1bHQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnJlc3RvcmVIaXN0b3J5KHQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY2FuY2VsTmF2aWdhdGlvblRyYW5zaXRpb24odCwgJycpO1xuICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgIH0pLFxuXG4gICAgICAgICAgICAgICAgICAgICAvLyAtLS0gUkVTT0xWRSAtLS1cbiAgICAgICAgICAgICAgICAgICAgIHN3aXRjaFRhcCh0ID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgaWYgKHQuZ3VhcmRzLmNhbkFjdGl2YXRlQ2hlY2tzLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBvZih0KS5waXBlKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YXAodCA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVzb2x2ZVN0YXJ0ID0gbmV3IFJlc29sdmVTdGFydChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5pZCwgdGhpcy5zZXJpYWxpemVVcmwodC5leHRyYWN0ZWRVcmwpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNlcmlhbGl6ZVVybCh0LnVybEFmdGVyUmVkaXJlY3RzKSwgdC50YXJnZXRTbmFwc2hvdCEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMudHJpZ2dlckV2ZW50KHJlc29sdmVTdGFydCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2hNYXAodCA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRhdGFSZXNvbHZlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBvZih0KS5waXBlKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlRGF0YShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGFyYW1zSW5oZXJpdGFuY2VTdHJhdGVneSwgdGhpcy5uZ01vZHVsZS5pbmplY3RvciksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhcCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV4dDogKCkgPT4gZGF0YVJlc29sdmVkID0gdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wbGV0ZTogKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFkYXRhUmVzb2x2ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5yZXN0b3JlSGlzdG9yeSh0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jYW5jZWxOYXZpZ2F0aW9uVHJhbnNpdGlvbihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgQXQgbGVhc3Qgb25lIHJvdXRlIHJlc29sdmVyIGRpZG4ndCBlbWl0IGFueSB2YWx1ZS5gKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YXAodCA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVzb2x2ZUVuZCA9IG5ldyBSZXNvbHZlRW5kKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0LmlkLCB0aGlzLnNlcmlhbGl6ZVVybCh0LmV4dHJhY3RlZFVybCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc2VyaWFsaXplVXJsKHQudXJsQWZ0ZXJSZWRpcmVjdHMpLCB0LnRhcmdldFNuYXBzaG90ISk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy50cmlnZ2VyRXZlbnQocmVzb2x2ZUVuZCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICAgfSksXG5cbiAgICAgICAgICAgICAgICAgICAgIC8vIC0tLSBBRlRFUiBQUkVBQ1RJVkFUSU9OIC0tLVxuICAgICAgICAgICAgICAgICAgICAgc3dpdGNoVGFwKCh0OiBOYXZpZ2F0aW9uVHJhbnNpdGlvbikgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0U25hcHNob3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IG5hdmlnYXRpb25JZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYWN0ZWRVcmw6IGFwcGxpZWRVcmxUcmVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgIHJhd1VybDogcmF3VXJsVHJlZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYXM6IHtza2lwTG9jYXRpb25DaGFuZ2UsIHJlcGxhY2VVcmx9XG4gICAgICAgICAgICAgICAgICAgICAgIH0gPSB0O1xuICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5ob29rcy5hZnRlclByZWFjdGl2YXRpb24odGFyZ2V0U25hcHNob3QhLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgbmF2aWdhdGlvbklkLFxuICAgICAgICAgICAgICAgICAgICAgICAgIGFwcGxpZWRVcmxUcmVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgIHJhd1VybFRyZWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgc2tpcExvY2F0aW9uQ2hhbmdlOiAhIXNraXBMb2NhdGlvbkNoYW5nZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICByZXBsYWNlVXJsOiAhIXJlcGxhY2VVcmwsXG4gICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgfSksXG5cbiAgICAgICAgICAgICAgICAgICAgIG1hcCgodDogTmF2aWdhdGlvblRyYW5zaXRpb24pID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdGFyZ2V0Um91dGVyU3RhdGUgPSBjcmVhdGVSb3V0ZXJTdGF0ZShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucm91dGVSZXVzZVN0cmF0ZWd5LCB0LnRhcmdldFNuYXBzaG90ISwgdC5jdXJyZW50Um91dGVyU3RhdGUpO1xuICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKHsuLi50LCB0YXJnZXRSb3V0ZXJTdGF0ZX0pO1xuICAgICAgICAgICAgICAgICAgICAgfSksXG5cbiAgICAgICAgICAgICAgICAgICAgIC8qIE9uY2UgaGVyZSwgd2UgYXJlIGFib3V0IHRvIGFjdGl2YXRlIHN5bmNyb25vdXNseS4gVGhlIGFzc3VtcHRpb24gaXMgdGhpc1xuICAgICAgICAgICAgICAgICAgICAgICAgd2lsbCBzdWNjZWVkLCBhbmQgdXNlciBjb2RlIG1heSByZWFkIGZyb20gdGhlIFJvdXRlciBzZXJ2aWNlLiBUaGVyZWZvcmVcbiAgICAgICAgICAgICAgICAgICAgICAgIGJlZm9yZSBhY3RpdmF0aW9uLCB3ZSBuZWVkIHRvIHVwZGF0ZSByb3V0ZXIgcHJvcGVydGllcyBzdG9yaW5nIHRoZSBjdXJyZW50XG4gICAgICAgICAgICAgICAgICAgICAgICBVUkwgYW5kIHRoZSBSb3V0ZXJTdGF0ZSwgYXMgd2VsbCBhcyB1cGRhdGVkIHRoZSBicm93c2VyIFVSTC4gQWxsIHRoaXMgc2hvdWxkXG4gICAgICAgICAgICAgICAgICAgICAgICBoYXBwZW4gKmJlZm9yZSogYWN0aXZhdGluZy4gKi9cbiAgICAgICAgICAgICAgICAgICAgIHRhcCgodDogTmF2aWdhdGlvblRyYW5zaXRpb24pID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50VXJsVHJlZSA9IHQudXJsQWZ0ZXJSZWRpcmVjdHM7XG4gICAgICAgICAgICAgICAgICAgICAgIHRoaXMucmF3VXJsVHJlZSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnVybEhhbmRsaW5nU3RyYXRlZ3kubWVyZ2UodC51cmxBZnRlclJlZGlyZWN0cywgdC5yYXdVcmwpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICh0aGlzIGFzIHtyb3V0ZXJTdGF0ZTogUm91dGVyU3RhdGV9KS5yb3V0ZXJTdGF0ZSA9IHQudGFyZ2V0Um91dGVyU3RhdGUhO1xuXG4gICAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnVybFVwZGF0ZVN0cmF0ZWd5ID09PSAnZGVmZXJyZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF0LmV4dHJhcy5za2lwTG9jYXRpb25DaGFuZ2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0QnJvd3NlclVybCh0aGlzLnJhd1VybFRyZWUsIHQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmJyb3dzZXJVcmxUcmVlID0gdC51cmxBZnRlclJlZGlyZWN0cztcbiAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgfSksXG5cbiAgICAgICAgICAgICAgICAgICAgIGFjdGl2YXRlUm91dGVzKFxuICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucm9vdENvbnRleHRzLCB0aGlzLnJvdXRlUmV1c2VTdHJhdGVneSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAoZXZ0OiBFdmVudCkgPT4gdGhpcy50cmlnZ2VyRXZlbnQoZXZ0KSksXG5cbiAgICAgICAgICAgICAgICAgICAgIHRhcCh7XG4gICAgICAgICAgICAgICAgICAgICAgIG5leHQoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgY29tcGxldGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgY29tcGxldGUoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgY29tcGxldGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgICAgICBmaW5hbGl6ZSgoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgIC8qIFdoZW4gdGhlIG5hdmlnYXRpb24gc3RyZWFtIGZpbmlzaGVzIGVpdGhlciB0aHJvdWdoIGVycm9yIG9yIHN1Y2Nlc3MsIHdlXG4gICAgICAgICAgICAgICAgICAgICAgICAqIHNldCB0aGUgYGNvbXBsZXRlZGAgb3IgYGVycm9yZWRgIGZsYWcuIEhvd2V2ZXIsIHRoZXJlIGFyZSBzb21lIHNpdHVhdGlvbnNcbiAgICAgICAgICAgICAgICAgICAgICAgICogd2hlcmUgd2UgY291bGQgZ2V0IGhlcmUgd2l0aG91dCBlaXRoZXIgb2YgdGhvc2UgYmVpbmcgc2V0LiBGb3IgaW5zdGFuY2UsIGFcbiAgICAgICAgICAgICAgICAgICAgICAgICogcmVkaXJlY3QgZHVyaW5nIE5hdmlnYXRpb25TdGFydC4gVGhlcmVmb3JlLCB0aGlzIGlzIGEgY2F0Y2gtYWxsIHRvIG1ha2VcbiAgICAgICAgICAgICAgICAgICAgICAgICogc3VyZSB0aGUgTmF2aWdhdGlvbkNhbmNlbFxuICAgICAgICAgICAgICAgICAgICAgICAgKiBldmVudCBpcyBmaXJlZCB3aGVuIGEgbmF2aWdhdGlvbiBnZXRzIGNhbmNlbGxlZCBidXQgbm90IGNhdWdodCBieSBvdGhlclxuICAgICAgICAgICAgICAgICAgICAgICAgKiBtZWFucy4gKi9cbiAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFjb21wbGV0ZWQgJiYgIWVycm9yZWQpIHtc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AgICAgICAgICAgICAvLyBhbmQgYSBuZXcgbmF2aWdhdGlvbiBiZWZvcmUgdGhhdCBjb21wbGV0ZXMgd2hlcmUgd2Ugd29uJ3Qgc2V0IGEgcGFnZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWQuXG4gICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgIC8vIGN1cnJlbnROYXZpZ2F0aW9uIHNob3VsZCBhbHdheXMgYmUgcmVzZXQgdG8gbnVsbCBoZXJlLiBJZiBuYXZpZ2F0aW9uIHdhc1xuICAgICAgICAgICAgICAgICAgICAgICAvLyBzdWNjZXNzZnVsLCBsYXN0U3VjY2Vzc2Z1bFRyYW5zaXRpb24gd2lsbCBoYXZlIGFscmVhZHkgYmVlbiBzZXQuIFRoZXJlZm9yZVxuICAgICAgICAgICAgICAgICAgICAgICAvLyB3ZSBjYW4gc2FmZWx5IHNldCBjdXJyZW50TmF2aWdhdGlvbiB0byBudWxsIGhlcmUuXG4gICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudE5hdmlnYXRpb24gPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgICAgICBjYXRjaEVycm9yKChlKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgIC8vIFRPRE8oYXRzY290dCk6IFRoZSBOYXZpZ2F0aW9uVHJhbnNpdGlvbiBgdGAgdXNlZCBoZXJlIGRvZXMgbm90IGFjY3VyYXRlbHlcbiAgICAgICAgICAgICAgICAgICAgICAgLy8gcmVmbGVjdCB0aGUgY3VycmVudCBzdGF0ZSBvZiB0aGUgd2hvbGUgdHJhbnNpdGlvbiBiZWNhdXNlIHNvbWUgb3BlcmF0aW9uc1xuICAgICAgICAgICAgICAgICAgICAgICAvLyByZXR1cm4gYSBuZXcgb2JqZWN0IHJhdGhlciB0aGFuIG1vZGlmeWluZyB0aGUg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KGUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVkaXJlY3RpbmcgPSBpc1VybFRyZWUoZS51cmwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghcmVkaXJlY3RpbmcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNldCBwcm9wZXJ0eSBvbmx5IGlmIHdlJ3JlIG5vdCByZWRpcmVjdGluZy4gSWYgd2UgbGFuZGVkIG9uIGEgcGFnZSBhbmRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJlZGlyZWN0IHRvIGAvYCByb3V0ZSwgdGhlIG5ldyBuYXZpZ2F0aW9uIGlzIGdvaW5nIHRvIHNlZSB0aGUgYC9gXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpc24ndCBhIGNoYW5nZSBmcm9tIHRoZSBkZWZhdWx0IGN1cnJlbnRVcmxUcmVlIGFuZCB3b24ndCBuYXZpZ2F0ZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoaXMgaXMgb25seSBhcHBsaWNhYmxlIHdpdGggaW5pdGlhbCBuYXZpZ2F0aW9uLCBzbyBzZXR0aW5nXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBgbmF2aWdhdGVkYCBvbmx5IHdoZW4gbm90IHJlZGlyZWN0aW5nIHJlc29sdmVzIHRoaXMgc2NlbmFyaW8uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLm5hdmlnYXRlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnJlc3RvcmVIaXN0b3J5KHQsIHRydWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBuYXZDYW5jZWwgPSBuZXcgTmF2aWdhdGlvbkNhbmNlbChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5pZCwgdGhpcy5zZXJpYWxpemVVcmwodC5leHRyYWN0ZWRVcmwpLCBlLm1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50c1N1YmplY3QubmV4dChuYXZDYW5jZWwpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2hlbiByZWRpcmVjdGluZywgd2UgbmVlZCB0byBkZWxheSByZXNvbHZpbmcgdGhlIG5hdmlnYXRpb25cbiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBwcm9taXNlIGFuZCBwdXNoIGl0IHRvIHRoZSByZWRpcmVjdCBuYXZpZ2F0aW9uXG4gICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFyZWRpcmVjdGluZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5yZXNvbHZlKGZhbHNlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2V0VGltZW91dCBpcyByZXF1aXJlZCBzbyB0aGlzIG5hdmlnYXRpb24gZmluaXNoZXMgd2l0aFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhlIHJldHVybiBFTVBUWSBiZWxvdy4gSWYgaXQgaXNuJ3QgYWxsb3dlZCB0byBmaW5pc2hcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHByb2Nlc3NpbmcsIHRoZXJlIGNhbiBiZSBtdWx0aXBsZSBuYXZpZ2F0aW9ucyB0byB0aGUgc2FtZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVVJMLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dCgoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IG1lcmdlZFRyZWUgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy51cmxIYW5kbGluZ1N0cmF0ZWd5Lm1lcmdlKGUudXJsLCB0aGlzLnJhd1VybFRyZWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBleHRyYXMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2tpcExvY2F0aW9uQ2hhbmdlOiB0LmV4dHJhcy5za2lwTG9jYXRpb25DaGFuZ2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGhlIFVSTCBpcyBhbHJlYWR5IHVwZGF0ZWQgYXQgdGhpcyBwb2ludCBpZiB3ZSBoYXZlICdlYWdlcicgVVJMXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdXBkYXRlcyBvciBpZiB0aGUgbmF2aWdhdGlvbiB3YXMgdHJpZ2dlcmVkIGJ5IHRoZSBicm93c2VyIChiYWNrXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYnV0dG9uLCBVUkwgYmFyLCBldGMpLiBXZSB3YW50IHRvIHJlcGxhY2UgdGhhdCBpdGVtIGluIGhpc3RvcnkgaWZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgbmF2aWdhdGlvbiBpcyByZWplY3RlZC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXBsYWNlVXJsOiB0aGlzLnVybFVwZGF0ZVN0cmF0ZWd5ID09PSAnZWFnZXInIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzQnJvd3NlclRyaWdnZXJlZE5hdmlnYXRpb24odC5zb3VyY2UpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zY2hlZHVsZU5hdmlnYXRpb24oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXJnZWRUcmVlLCAnaW1wZXJhdGl2ZScsIG51bGwsIGV4dHJhcyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtyZXNvbHZlOiB0LnJlc29sdmUsIHJlamVjdDogdC5yZWplY3QsIHByb21pc2U6IHQucHJvbWlzZX0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgLyogQWxsIG90aGVyIGVycm9ycyBzaG91bGQgcmVzZXQgdG8gdGhlIHJvdXRlcidzIGludGVybmFsIFVSTCByZWZlcmVuY2UgdG9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgKiB0aGUgcHJlLWVycm9yIHN0YXRlLiAqL1xuICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucmVzdG9yZUhpc3RvcnkodCwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgbmF2RXJyb3IgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgTmF2aWdhdGlvbkVycm9yKHQuaWQsIHRoaXMuc2VyaWFsaXplVXJsKHQuZXh0cmFjdGVkVXJsKSwgZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnRzU3ViamVjdC5uZXh0KG5hdkVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5yZXNvbHZlKHRoaXMuZXJyb3JIYW5kbGVyKGUpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgdC5yZWplY3QoZWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gRU1QVFk7XG4gICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgIC8vIFRPRE8oamFzb25hZGVuKTogcmVtb3ZlIGNhc3Qgb25jZSBnMyBpcyBvbiB1cGRhdGVkIFR5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