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 | */
|
---|
8 | import { CompileSummaryKind } from '../compile_metadata';
|
---|
9 | import { createAttribute, createComponent, createContentChild, createContentChildren, createDirective, createHost, createHostBinding, createHostListener, createInject, createInjectable, createInput, createNgModule, createOptional, createOutput, createPipe, createSelf, createSkipSelf, createViewChild, createViewChildren } from '../core';
|
---|
10 | import { syntaxError } from '../parse_util';
|
---|
11 | import { formattedError } from './formatted_error';
|
---|
12 | import { StaticSymbol } from './static_symbol';
|
---|
13 | const ANGULAR_CORE = '@angular/core';
|
---|
14 | const ANGULAR_ROUTER = '@angular/router';
|
---|
15 | const HIDDEN_KEY = /^\$.*\$$/;
|
---|
16 | const IGNORE = {
|
---|
17 | __symbolic: 'ignore'
|
---|
18 | };
|
---|
19 | const USE_VALUE = 'useValue';
|
---|
20 | const PROVIDE = 'provide';
|
---|
21 | const REFERENCE_SET = new Set([USE_VALUE, 'useFactory', 'data', 'id', 'loadChildren']);
|
---|
22 | const TYPEGUARD_POSTFIX = 'TypeGuard';
|
---|
23 | const USE_IF = 'UseIf';
|
---|
24 | function shouldIgnore(value) {
|
---|
25 | return value && value.__symbolic == 'ignore';
|
---|
26 | }
|
---|
27 | /**
|
---|
28 | * A static reflector implements enough of the Reflector API that is necessary to compile
|
---|
29 | * templates statically.
|
---|
30 | */
|
---|
31 | export class StaticReflector {
|
---|
32 | constructor(summaryResolver, symbolResolver, knownMetadataClasses = [], knownMetadataFunctions = [], errorRecorder) {
|
---|
33 | this.summaryResolver = summaryResolver;
|
---|
34 | this.symbolResolver = symbolResolver;
|
---|
35 | this.errorRecorder = errorRecorder;
|
---|
36 | this.annotationCache = new Map();
|
---|
37 | this.shallowAnnotationCache = new Map();
|
---|
38 | this.propertyCache = new Map();
|
---|
39 | this.parameterCache = new Map();
|
---|
40 | this.methodCache = new Map();
|
---|
41 | this.staticCache = new Map();
|
---|
42 | this.conversionMap = new Map();
|
---|
43 | this.resolvedExternalReferences = new Map();
|
---|
44 | this.annotationForParentClassWithSummaryKind = new Map();
|
---|
45 | this.initializeConversionMap();
|
---|
46 | knownMetadataClasses.forEach((kc) => this._registerDecoratorOrConstructor(this.getStaticSymbol(kc.filePath, kc.name), kc.ctor));
|
---|
47 | knownMetadataFunctions.forEach((kf) => this._registerFunction(this.getStaticSymbol(kf.filePath, kf.name), kf.fn));
|
---|
48 | this.annotationForParentClassWithSummaryKind.set(CompileSummaryKind.Directive, [createDirective, createComponent]);
|
---|
49 | this.annotationForParentClassWithSummaryKind.set(CompileSummaryKind.Pipe, [createPipe]);
|
---|
50 | this.annotationForParentClassWithSummaryKind.set(CompileSummaryKind.NgModule, [createNgModule]);
|
---|
51 | this.annotationForParentClassWithSummaryKind.set(CompileSummaryKind.Injectable, [createInjectable, createPipe, createDirective, createComponent, createNgModule]);
|
---|
52 | }
|
---|
53 | componentModuleUrl(typeOrFunc) {
|
---|
54 | const staticSymbol = this.findSymbolDeclaration(typeOrFunc);
|
---|
55 | return this.symbolResolver.getResourcePath(staticSymbol);
|
---|
56 | }
|
---|
57 | /**
|
---|
58 | * Invalidate the specified `symbols` on program change.
|
---|
59 | * @param symbols
|
---|
60 | */
|
---|
61 | invalidateSymbols(symbols) {
|
---|
62 | for (const symbol of symbols) {
|
---|
63 | this.annotationCache.delete(symbol);
|
---|
64 | this.shallowAnnotationCache.delete(symbol);
|
---|
65 | this.propertyCache.delete(symbol);
|
---|
66 | this.parameterCache.delete(symbol);
|
---|
67 | this.methodCache.delete(symbol);
|
---|
68 | this.staticCache.delete(symbol);
|
---|
69 | this.conversionMap.delete(symbol);
|
---|
70 | }
|
---|
71 | }
|
---|
72 | resolveExternalReference(ref, containingFile) {
|
---|
73 | let key = undefined;
|
---|
74 | if (!containingFile) {
|
---|
75 | key = `${ref.moduleName}:${ref.name}`;
|
---|
76 | const declarationSymbol = this.resolvedExternalReferences.get(key);
|
---|
77 | if (declarationSymbol)
|
---|
78 | return declarationSymbol;
|
---|
79 | }
|
---|
80 | const refSymbol = this.symbolResolver.getSymbolByModule(ref.moduleName, ref.name, containingFile);
|
---|
81 | const declarationSymbol = this.findSymbolDeclaration(refSymbol);
|
---|
82 | if (!containingFile) {
|
---|
83 | this.symbolResolver.recordModuleNameForFileName(refSymbol.filePath, ref.moduleName);
|
---|
84 | this.symbolResolver.recordImportAs(declarationSymbol, refSymbol);
|
---|
85 | }
|
---|
86 | if (key) {
|
---|
87 | this.resolvedExternalReferences.set(key, declarationSymbol);
|
---|
88 | }
|
---|
89 | return declarationSymbol;
|
---|
90 | }
|
---|
91 | findDeclaration(moduleUrl, name, containingFile) {
|
---|
92 | return this.findSymbolDeclaration(this.symbolResolver.getSymbolByModule(moduleUrl, name, containingFile));
|
---|
93 | }
|
---|
94 | tryFindDeclaration(moduleUrl, name, containingFile) {
|
---|
95 | return this.symbolResolver.ignoreErrorsFor(() => this.findDeclaration(moduleUrl, name, containingFile));
|
---|
96 | }
|
---|
97 | findSymbolDeclaration(symbol) {
|
---|
98 | const resolvedSymbol = this.symbolResolver.resolveSymbol(symbol);
|
---|
99 | if (resolvedSymbol) {
|
---|
100 | let resolvedMetadata = resolvedSymbol.metadata;
|
---|
101 | if (resolvedMetadata && resolvedMetadata.__symbolic === 'resolved') {
|
---|
102 | resolvedMetadata = resolvedMetadata.symbol;
|
---|
103 | }
|
---|
104 | if (resolvedMetadata instanceof StaticSymbol) {
|
---|
105 | return this.findSymbolDeclaration(resolvedSymbol.metadata);
|
---|
106 | }
|
---|
107 | }
|
---|
108 | return symbol;
|
---|
109 | }
|
---|
110 | tryAnnotations(type) {
|
---|
111 | const originalRecorder = this.errorRecorder;
|
---|
112 | this.errorRecorder = (error, fileName) => { };
|
---|
113 | try {
|
---|
114 | return this.annotations(type);
|
---|
115 | }
|
---|
116 | finally {
|
---|
117 | this.errorRecorder = originalRecorder;
|
---|
118 | }
|
---|
119 | }
|
---|
120 | annotations(type) {
|
---|
121 | return this._annotations(type, (type, decorators) => this.simplify(type, decorators), this.annotationCache);
|
---|
122 | }
|
---|
123 | shallowAnnotations(type) {
|
---|
124 | return this._annotations(type, (type, decorators) => this.simplify(type, decorators, true), this.shallowAnnotationCache);
|
---|
125 | }
|
---|
126 | _annotations(type, simplify, annotationCache) {
|
---|
127 | let annotations = annotationCache.get(type);
|
---|
128 | if (!annotations) {
|
---|
129 | annotations = [];
|
---|
130 | const classMetadata = this.getTypeMetadata(type);
|
---|
131 | const parentType = this.findParentType(type, classMetadata);
|
---|
132 | if (parentType) {
|
---|
133 | const parentAnnotations = this.annotations(parentType);
|
---|
134 | annotations.push(...parentAnnotations);
|
---|
135 | }
|
---|
136 | let ownAnnotations = [];
|
---|
137 | if (classMetadata['decorators']) {
|
---|
138 | ownAnnotations = simplify(type, classMetadata['decorators']);
|
---|
139 | if (ownAnnotations) {
|
---|
140 | annotations.push(...ownAnnotations);
|
---|
141 | }
|
---|
142 | }
|
---|
143 | if (parentType && !this.summaryResolver.isLibraryFile(type.filePath) &&
|
---|
144 | this.summaryResolver.isLibraryFile(parentType.filePath)) {
|
---|
145 | const summary = this.summaryResolver.resolveSummary(parentType);
|
---|
146 | if (summary && summary.type) {
|
---|
147 | const requiredAnnotationTypes = this.annotationForParentClassWithSummaryKind.get(summary.type.summaryKind);
|
---|
148 | const typeHasRequiredAnnotation = requiredAnnotationTypes.some((requiredType) => ownAnnotations.some(ann => requiredType.isTypeOf(ann)));
|
---|
149 | if (!typeHasRequiredAnnotation) {
|
---|
150 | this.reportError(formatMetadataError(metadataError(`Class ${type.name} in ${type.filePath} extends from a ${CompileSummaryKind[summary.type.summaryKind]} in another compilation unit without duplicating the decorator`,
|
---|
151 | /* summary */ undefined, `Please add a ${requiredAnnotationTypes.map((type) => type.ngMetadataName)
|
---|
152 | .join(' or ')} decorator to the class`), type), type);
|
---|
153 | }
|
---|
154 | }
|
---|
155 | }
|
---|
156 | annotationCache.set(type, annotations.filter(ann => !!ann));
|
---|
157 | }
|
---|
158 | return annotations;
|
---|
159 | }
|
---|
160 | propMetadata(type) {
|
---|
161 | let propMetadata = this.propertyCache.get(type);
|
---|
162 | if (!propMetadata) {
|
---|
163 | const classMetadata = this.getTypeMetadata(type);
|
---|
164 | propMetadata = {};
|
---|
165 | const parentType = this.findParentType(type, classMetadata);
|
---|
166 | if (parentType) {
|
---|
167 | const parentPropMetadata = this.propMetadata(parentType);
|
---|
168 | Object.keys(parentPropMetadata).forEach((parentProp) => {
|
---|
169 | propMetadata[parentProp] = parentPropMetadata[parentProp];
|
---|
170 | });
|
---|
171 | }
|
---|
172 | const members = classMetadata['members'] || {};
|
---|
173 | Object.keys(members).forEach((propName) => {
|
---|
174 | const propData = members[propName];
|
---|
175 | const prop = propData
|
---|
176 | .find(a => a['__symbolic'] == 'property' || a['__symbolic'] == 'method');
|
---|
177 | const decorators = [];
|
---|
178 | // hasOwnProperty() is used here to make sure we do not look up methods
|
---|
179 | // on `Object.prototype`.
|
---|
180 | if (propMetadata === null || propMetadata === void 0 ? void 0 : propMetadata.hasOwnProperty(propName)) {
|
---|
181 | decorators.push(...propMetadata[propName]);
|
---|
182 | }
|
---|
183 | propMetadata[propName] = decorators;
|
---|
184 | if (prop && prop['decorators']) {
|
---|
185 | decorators.push(...this.simplify(type, prop['decorators']));
|
---|
186 | }
|
---|
187 | });
|
---|
188 | this.propertyCache.set(type, propMetadata);
|
---|
189 | }
|
---|
190 | return propMetadata;
|
---|
191 | }
|
---|
192 | parameters(type) {
|
---|
193 | if (!(type instanceof StaticSymbol)) {
|
---|
194 | this.reportError(new Error(`parameters received ${JSON.stringify(type)} which is not a StaticSymbol`), type);
|
---|
195 | return [];
|
---|
196 | }
|
---|
197 | try {
|
---|
198 | let parameters = this.parameterCache.get(type);
|
---|
199 | if (!parameters) {
|
---|
200 | const classMetadata = this.getTypeMetadata(type);
|
---|
201 | const parentType = this.findParentType(type, classMetadata);
|
---|
202 | const members = classMetadata ? classMetadata['members'] : null;
|
---|
203 | const ctorData = members ? members['__ctor__'] : null;
|
---|
204 | if (ctorData) {
|
---|
205 | const ctor = ctorData.find(a => a['__symbolic'] == 'constructor');
|
---|
206 | const rawParameterTypes = ctor['parameters'] || [];
|
---|
207 | const parameterDecorators = this.simplify(type, ctor['parameterDecorators'] || []);
|
---|
208 | parameters = [];
|
---|
209 | rawParameterTypes.forEach((rawParamType, index) => {
|
---|
210 | const nestedResult = [];
|
---|
211 | const paramType = this.trySimplify(type, rawParamType);
|
---|
212 | if (paramType)
|
---|
213 | nestedResult.push(paramType);
|
---|
214 | const decorators = parameterDecorators ? parameterDecorators[index] : null;
|
---|
215 | if (decorators) {
|
---|
216 | nestedResult.push(...decorators);
|
---|
217 | }
|
---|
218 | parameters.push(nestedResult);
|
---|
219 | });
|
---|
220 | }
|
---|
221 | else if (parentType) {
|
---|
222 | parameters = this.parameters(parentType);
|
---|
223 | }
|
---|
224 | if (!parameters) {
|
---|
225 | parameters = [];
|
---|
226 | }
|
---|
227 | this.parameterCache.set(type, parameters);
|
---|
228 | }
|
---|
229 | return parameters;
|
---|
230 | }
|
---|
231 | catch (e) {
|
---|
232 | console.error(`Failed on type ${JSON.stringify(type)} with error ${e}`);
|
---|
233 | throw e;
|
---|
234 | }
|
---|
235 | }
|
---|
236 | _methodNames(type) {
|
---|
237 | let methodNames = this.methodCache.get(type);
|
---|
238 | if (!methodNames) {
|
---|
239 | const classMetadata = this.getTypeMetadata(type);
|
---|
240 | methodNames = {};
|
---|
241 | const parentType = this.findParentType(type, classMetadata);
|
---|
242 | if (parentType) {
|
---|
243 | const parentMethodNames = this._methodNames(parentType);
|
---|
244 | Object.keys(parentMethodNames).forEach((parentProp) => {
|
---|
245 | methodNames[parentProp] = parentMethodNames[parentProp];
|
---|
246 | });
|
---|
247 | }
|
---|
248 | const members = classMetadata['members'] || {};
|
---|
249 | Object.keys(members).forEach((propName) => {
|
---|
250 | const propData = members[propName];
|
---|
251 | const isMethod = propData.some(a => a['__symbolic'] == 'method');
|
---|
252 | methodNames[propName] = methodNames[propName] || isMethod;
|
---|
253 | });
|
---|
254 | this.methodCache.set(type, methodNames);
|
---|
255 | }
|
---|
256 | return methodNames;
|
---|
257 | }
|
---|
258 | _staticMembers(type) {
|
---|
259 | let staticMembers = this.staticCache.get(type);
|
---|
260 | if (!staticMembers) {
|
---|
261 | const classMetadata = this.getTypeMetadata(type);
|
---|
262 | const staticMemberData = classMetadata['statics'] || {};
|
---|
263 | staticMembers = Object.keys(staticMemberData);
|
---|
264 | this.staticCache.set(type, staticMembers);
|
---|
265 | }
|
---|
266 | return staticMembers;
|
---|
267 | }
|
---|
268 | findParentType(type, classMetadata) {
|
---|
269 | const parentType = this.trySimplify(type, classMetadata['extends']);
|
---|
270 | if (parentType instanceof StaticSymbol) {
|
---|
271 | return parentType;
|
---|
272 | }
|
---|
273 | }
|
---|
274 | hasLifecycleHook(type, lcProperty) {
|
---|
275 | if (!(type instanceof StaticSymbol)) {
|
---|
276 | this.reportError(new Error(`hasLifecycleHook received ${JSON.stringify(type)} which is not a StaticSymbol`), type);
|
---|
277 | }
|
---|
278 | try {
|
---|
279 | return !!this._methodNames(type)[lcProperty];
|
---|
280 | }
|
---|
281 | catch (e) {
|
---|
282 | console.error(`Failed on type ${JSON.stringify(type)} with error ${e}`);
|
---|
283 | throw e;
|
---|
284 | }
|
---|
285 | }
|
---|
286 | guards(type) {
|
---|
287 | if (!(type instanceof StaticSymbol)) {
|
---|
288 | this.reportError(new Error(`guards received ${JSON.stringify(type)} which is not a StaticSymbol`), type);
|
---|
289 | return {};
|
---|
290 | }
|
---|
291 | const staticMembers = this._staticMembers(type);
|
---|
292 | const result = {};
|
---|
293 | for (let name of staticMembers) {
|
---|
294 | if (name.endsWith(TYPEGUARD_POSTFIX)) {
|
---|
295 | let property = name.substr(0, name.length - TYPEGUARD_POSTFIX.length);
|
---|
296 | let value;
|
---|
297 | if (property.endsWith(USE_IF)) {
|
---|
298 | property = name.substr(0, property.length - USE_IF.length);
|
---|
299 | value = USE_IF;
|
---|
300 | }
|
---|
301 | else {
|
---|
302 | value = this.getStaticSymbol(type.filePath, type.name, [name]);
|
---|
303 | }
|
---|
304 | result[property] = value;
|
---|
305 | }
|
---|
306 | }
|
---|
307 | return result;
|
---|
308 | }
|
---|
309 | _registerDecoratorOrConstructor(type, ctor) {
|
---|
310 | this.conversionMap.set(type, (context, args) => new ctor(...args));
|
---|
311 | }
|
---|
312 | _registerFunction(type, fn) {
|
---|
313 | this.conversionMap.set(type, (context, args) => fn.apply(undefined, args));
|
---|
314 | }
|
---|
315 | initializeConversionMap() {
|
---|
316 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Injectable'), createInjectable);
|
---|
317 | this.injectionToken = this.findDeclaration(ANGULAR_CORE, 'InjectionToken');
|
---|
318 | this.opaqueToken = this.findDeclaration(ANGULAR_CORE, 'OpaqueToken');
|
---|
319 | this.ROUTES = this.tryFindDeclaration(ANGULAR_ROUTER, 'ROUTES');
|
---|
320 | this.ANALYZE_FOR_ENTRY_COMPONENTS =
|
---|
321 | this.findDeclaration(ANGULAR_CORE, 'ANALYZE_FOR_ENTRY_COMPONENTS');
|
---|
322 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Host'), createHost);
|
---|
323 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Self'), createSelf);
|
---|
324 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'SkipSelf'), createSkipSelf);
|
---|
325 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Inject'), createInject);
|
---|
326 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Optional'), createOptional);
|
---|
327 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Attribute'), createAttribute);
|
---|
328 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ContentChild'), createContentChild);
|
---|
329 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ContentChildren'), createContentChildren);
|
---|
330 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ViewChild'), createViewChild);
|
---|
331 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'ViewChildren'), createViewChildren);
|
---|
332 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Input'), createInput);
|
---|
333 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Output'), createOutput);
|
---|
334 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Pipe'), createPipe);
|
---|
335 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'HostBinding'), createHostBinding);
|
---|
336 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'HostListener'), createHostListener);
|
---|
337 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Directive'), createDirective);
|
---|
338 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Component'), createComponent);
|
---|
339 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'NgModule'), createNgModule);
|
---|
340 | // Note: Some metadata classes can be used directly with Provider.deps.
|
---|
341 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Host'), createHost);
|
---|
342 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Self'), createSelf);
|
---|
343 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'SkipSelf'), createSkipSelf);
|
---|
344 | this._registerDecoratorOrConstructor(this.findDeclaration(ANGULAR_CORE, 'Optional'), createOptional);
|
---|
345 | }
|
---|
346 | /**
|
---|
347 | * getStaticSymbol produces a Type whose metadata is known but whose implementation is not loaded.
|
---|
348 | * All types passed to the StaticResolver should be pseudo-types returned by this method.
|
---|
349 | *
|
---|
350 | * @param declarationFile the absolute path of the file where the symbol is declared
|
---|
351 | * @param name the name of the type.
|
---|
352 | */
|
---|
353 | getStaticSymbol(declarationFile, name, members) {
|
---|
354 | return this.symbolResolver.getStaticSymbol(declarationFile, name, members);
|
---|
355 | }
|
---|
356 | /**
|
---|
357 | * Simplify but discard any errors
|
---|
358 | */
|
---|
359 | trySimplify(context, value) {
|
---|
360 | const originalRecorder = this.errorRecorder;
|
---|
361 | this.errorRecorder = (error, fileName) => { };
|
---|
362 | const result = this.simplify(context, value);
|
---|
363 | this.errorRecorder = originalRecorder;
|
---|
364 | return result;
|
---|
365 | }
|
---|
366 | /** @internal */
|
---|
367 | simplify(context, value, lazy = false) {
|
---|
368 | const self = this;
|
---|
369 | let scope = BindingScope.empty;
|
---|
370 | const calling = new Map();
|
---|
371 | const rootContext = context;
|
---|
372 | function simplifyInContext(context, value, depth, references) {
|
---|
373 | function resolveReferenceValue(staticSymbol) {
|
---|
374 | const resolvedSymbol = self.symbolResolver.resolveSymbol(staticSymbol);
|
---|
375 | return resolvedSymbol ? resolvedSymbol.metadata : null;
|
---|
376 | }
|
---|
377 | function simplifyEagerly(value) {
|
---|
378 | return simplifyInContext(context, value, depth, 0);
|
---|
379 | }
|
---|
380 | function simplifyLazily(value) {
|
---|
381 | return simplifyInContext(context, value, depth, references + 1);
|
---|
382 | }
|
---|
383 | function simplifyNested(nestedContext, value) {
|
---|
384 | if (nestedContext === context) {
|
---|
385 | // If the context hasn't changed let the exception propagate unmodified.
|
---|
386 | return simplifyInContext(nestedContext, value, depth + 1, references);
|
---|
387 | }
|
---|
388 | try {
|
---|
389 | return simplifyInContext(nestedContext, value, depth + 1, references);
|
---|
390 | }
|
---|
391 | catch (e) {
|
---|
392 | if (isMetadataError(e)) {
|
---|
393 | // Propagate the message text up but add a message to the chain that explains how we got
|
---|
394 | // here.
|
---|
395 | // e.chain implies e.symbol
|
---|
396 | const summaryMsg = e.chain ? 'references \'' + e.symbol.name + '\'' : errorSummary(e);
|
---|
397 | const summary = `'${nestedContext.name}' ${summaryMsg}`;
|
---|
398 | const chain = { message: summary, position: e.position, next: e.chain };
|
---|
399 | // TODO(chuckj): retrieve the position information indirectly from the collectors node
|
---|
400 | // map if the metadata is from a .ts file.
|
---|
401 | self.error({
|
---|
402 | message: e.message,
|
---|
403 | advise: e.advise,
|
---|
404 | context: e.context,
|
---|
405 | chain,
|
---|
406 | symbol: nestedContext
|
---|
407 | }, context);
|
---|
408 | }
|
---|
409 | else {
|
---|
410 | // It is probably an internal error.
|
---|
411 | throw e;
|
---|
412 | }
|
---|
413 | }
|
---|
414 | }
|
---|
415 | function simplifyCall(functionSymbol, targetFunction, args, targetExpression) {
|
---|
416 | if (targetFunction && targetFunction['__symbolic'] == 'function') {
|
---|
417 | if (calling.get(functionSymbol)) {
|
---|
418 | self.error({
|
---|
419 | message: 'Recursion is not supported',
|
---|
420 | summary: `called '${functionSymbol.name}' recursively`,
|
---|
421 | value: targetFunction
|
---|
422 | }, functionSymbol);
|
---|
423 | }
|
---|
424 | try {
|
---|
425 | const value = targetFunction['value'];
|
---|
426 | if (value && (depth != 0 || value.__symbolic != 'error')) {
|
---|
427 | const parameters = targetFunction['parameters'];
|
---|
428 | const defaults = targetFunction.defaults;
|
---|
429 | args = args.map(arg => simplifyNested(context, arg))
|
---|
430 | .map(arg => shouldIgnore(arg) ? undefined : arg);
|
---|
431 | if (defaults && defaults.length > args.length) {
|
---|
432 | args.push(...defaults.slice(args.length).map((value) => simplify(value)));
|
---|
433 | }
|
---|
434 | calling.set(functionSymbol, true);
|
---|
435 | const functionScope = BindingScope.build();
|
---|
436 | for (let i = 0; i < parameters.length; i++) {
|
---|
437 | functionScope.define(parameters[i], args[i]);
|
---|
438 | }
|
---|
439 | const oldScope = scope;
|
---|
440 | let result;
|
---|
441 | try {
|
---|
442 | scope = functionScope.done();
|
---|
443 | result = simplifyNested(functionSymbol, value);
|
---|
444 | }
|
---|
445 | finally {
|
---|
446 | scope = oldScope;
|
---|
447 | }
|
---|
448 | return result;
|
---|
449 | }
|
---|
450 | }
|
---|
451 | finally {
|
---|
452 | calling.delete(functionSymbol);
|
---|
453 | }
|
---|
454 | }
|
---|
455 | if (depth === 0) {
|
---|
456 | // If depth is 0 we are evaluating the top level expression that is describing element
|
---|
457 | // decorator. In this case, it is a decorator we don't understand, such as a custom
|
---|
458 | // non-angular decorator, and we should just ignore it.
|
---|
459 | return IGNORE;
|
---|
460 | }
|
---|
461 | let position = undefined;
|
---|
462 | if (targetExpression && targetExpression.__symbolic == 'resolved') {
|
---|
463 | const line = targetExpression.line;
|
---|
464 | const character = targetExpression.character;
|
---|
465 | const fileName = targetExpression.fileName;
|
---|
466 | if (fileName != null && line != null && character != null) {
|
---|
467 | position = { fileName, line, column: character };
|
---|
468 | }
|
---|
469 | }
|
---|
470 | self.error({
|
---|
471 | message: FUNCTION_CALL_NOT_SUPPORTED,
|
---|
472 | context: functionSymbol,
|
---|
473 | value: targetFunction,
|
---|
474 | position
|
---|
475 | }, context);
|
---|
476 | }
|
---|
477 | function simplify(expression) {
|
---|
478 | if (isPrimitive(expression)) {
|
---|
479 | return expression;
|
---|
480 | }
|
---|
481 | if (Array.isArray(expression)) {
|
---|
482 | const result = [];
|
---|
483 | for (const item of expression) {
|
---|
484 | // Check for a spread expression
|
---|
485 | if (item && item.__symbolic === 'spread') {
|
---|
486 | // We call with references as 0 because we require the actual value and cannot
|
---|
487 | // tolerate a reference here.
|
---|
488 | const spreadArray = simplifyEagerly(item.expression);
|
---|
489 | if (Array.isArray(spreadArray)) {
|
---|
490 | for (const spreadItem of spreadArray) {
|
---|
491 | result.push(spreadItem);
|
---|
492 | }
|
---|
493 | continue;
|
---|
494 | }
|
---|
495 | }
|
---|
496 | const value = simplify(item);
|
---|
497 | if (shouldIgnore(value)) {
|
---|
498 | continue;
|
---|
499 | }
|
---|
500 | result.push(value);
|
---|
501 | }
|
---|
502 | return result;
|
---|
503 | }
|
---|
504 | if (expression instanceof StaticSymbol) {
|
---|
505 | // Stop simplification at builtin symbols or if we are in a reference context and
|
---|
506 | // the symbol doesn't have members.
|
---|
507 | if (expression === self.injectionToken || self.conversionMap.has(expression) ||
|
---|
508 | (references > 0 && !expression.members.length)) {
|
---|
509 | return expression;
|
---|
510 | }
|
---|
511 | else {
|
---|
512 | const staticSymbol = expression;
|
---|
513 | const declarationValue = resolveReferenceValue(staticSymbol);
|
---|
514 | if (declarationValue != null) {
|
---|
515 | return simplifyNested(staticSymbol, declarationValue);
|
---|
516 | }
|
---|
517 | else {
|
---|
518 | return staticSymbol;
|
---|
519 | }
|
---|
520 | }
|
---|
521 | }
|
---|
522 | if (expression) {
|
---|
523 | if (expression['__symbolic']) {
|
---|
524 | let staticSymbol;
|
---|
525 | switch (expression['__symbolic']) {
|
---|
526 | case 'binop':
|
---|
527 | let left = simplify(expression['left']);
|
---|
528 | if (shouldIgnore(left))
|
---|
529 | return left;
|
---|
530 | let right = simplify(expression['right']);
|
---|
531 | if (shouldIgnore(right))
|
---|
532 | return right;
|
---|
533 | switch (expression['operator']) {
|
---|
534 | case '&&':
|
---|
535 | return left && right;
|
---|
536 | case '||':
|
---|
537 | return left || right;
|
---|
538 | case '|':
|
---|
539 | return left | right;
|
---|
540 | case '^':
|
---|
541 | return left ^ right;
|
---|
542 | case '&':
|
---|
543 | return left & right;
|
---|
544 | case '==':
|
---|
545 | return left == right;
|
---|
546 | case '!=':
|
---|
547 | return left != right;
|
---|
548 | case '===':
|
---|
549 | return left === right;
|
---|
550 | case '!==':
|
---|
551 | return left !== right;
|
---|
552 | case '<':
|
---|
553 | return left < right;
|
---|
554 | case '>':
|
---|
555 | return left > right;
|
---|
556 | case '<=':
|
---|
557 | return left <= right;
|
---|
558 | case '>=':
|
---|
559 | return left >= right;
|
---|
560 | case '<<':
|
---|
561 | return left << right;
|
---|
562 | case '>>':
|
---|
563 | return left >> right;
|
---|
564 | case '+':
|
---|
565 | return left + right;
|
---|
566 | case '-':
|
---|
567 | return left - right;
|
---|
568 | case '*':
|
---|
569 | return left * right;
|
---|
570 | case '/':
|
---|
571 | return left / right;
|
---|
572 | case '%':
|
---|
573 | return left % right;
|
---|
574 | case '??':
|
---|
575 | return left !== null && left !== void 0 ? left : right;
|
---|
576 | }
|
---|
577 | return null;
|
---|
578 | case 'if':
|
---|
579 | let condition = simplify(expression['condition']);
|
---|
580 | return condition ? simplify(expression['thenExpression']) :
|
---|
581 | simplify(expression['elseExpression']);
|
---|
582 | case 'pre':
|
---|
583 | let operand = simplify(expression['operand']);
|
---|
584 | if (shouldIgnore(operand))
|
---|
585 | return operand;
|
---|
586 | switch (expression['operator']) {
|
---|
587 | case '+':
|
---|
588 | return operand;
|
---|
589 | case '-':
|
---|
590 | return -operand;
|
---|
591 | case '!':
|
---|
592 | return !operand;
|
---|
593 | case '~':
|
---|
594 | return ~operand;
|
---|
595 | }
|
---|
596 | return null;
|
---|
597 | case 'index':
|
---|
598 | let indexTarget = simplifyEagerly(expression['expression']);
|
---|
599 | let index = simplifyEagerly(expression['index']);
|
---|
600 | if (indexTarget && isPrimitive(index))
|
---|
601 | return indexTarget[index];
|
---|
602 | return null;
|
---|
603 | case 'select':
|
---|
604 | const member = expression['member'];
|
---|
605 | let selectContext = context;
|
---|
606 | let selectTarget = simplify(expression['expression']);
|
---|
607 | if (selectTarget instanceof StaticSymbol) {
|
---|
608 | const members = selectTarget.members.concat(member);
|
---|
609 | selectContext =
|
---|
610 | self.getStaticSymbol(selectTarget.filePath, selectTarget.name, members);
|
---|
611 | const declarationValue = resolveReferenceValue(selectContext);
|
---|
612 | if (declarationValue != null) {
|
---|
613 | return simplifyNested(selectContext, declarationValue);
|
---|
614 | }
|
---|
615 | else {
|
---|
616 | return selectContext;
|
---|
617 | }
|
---|
618 | }
|
---|
619 | if (selectTarget && isPrimitive(member))
|
---|
620 | return simplifyNested(selectContext, selectTarget[member]);
|
---|
621 | return null;
|
---|
622 | case 'reference':
|
---|
623 | // Note: This only has to deal with variable references, as symbol references have
|
---|
624 | // been converted into 'resolved'
|
---|
625 | // in the StaticSymbolResolver.
|
---|
626 | const name = expression['name'];
|
---|
627 | const localValue = scope.resolve(name);
|
---|
628 | if (localValue != BindingScope.missing) {
|
---|
629 | return localValue;
|
---|
630 | }
|
---|
631 | break;
|
---|
632 | case 'resolved':
|
---|
633 | try {
|
---|
634 | return simplify(expression.symbol);
|
---|
635 | }
|
---|
636 | catch (e) {
|
---|
637 | // If an error is reported evaluating the symbol record the position of the
|
---|
638 | // reference in the error so it can
|
---|
639 | // be reported in the error message generated from the exception.
|
---|
640 | if (isMetadataError(e) && expression.fileName != null &&
|
---|
641 | expression.line != null && expression.character != null) {
|
---|
642 | e.position = {
|
---|
643 | fileName: expression.fileName,
|
---|
644 | line: expression.line,
|
---|
645 | column: expression.character
|
---|
646 | };
|
---|
647 | }
|
---|
648 | throw e;
|
---|
649 | }
|
---|
650 | case 'class':
|
---|
651 | return context;
|
---|
652 | case 'function':
|
---|
653 | return context;
|
---|
654 | case 'new':
|
---|
655 | case 'call':
|
---|
656 | // Determine if the function is a built-in conversion
|
---|
657 | staticSymbol = simplifyInContext(context, expression['expression'], depth + 1, /* references */ 0);
|
---|
658 | if (staticSymbol instanceof StaticSymbol) {
|
---|
659 | if (staticSymbol === self.injectionToken || staticSymbol === self.opaqueToken) {
|
---|
660 | // if somebody calls new InjectionToken, don't create an InjectionToken,
|
---|
661 | // but rather return the symbol to which the InjectionToken is assigned to.
|
---|
662 | // OpaqueToken is supported too as it is required by the language service to
|
---|
663 | // support v4 and prior versions of Angular.
|
---|
664 | return context;
|
---|
665 | }
|
---|
666 | const argExpressions = expression['arguments'] || [];
|
---|
667 | let converter = self.conversionMap.get(staticSymbol);
|
---|
668 | if (converter) {
|
---|
669 | const args = argExpressions.map(arg => simplifyNested(context, arg))
|
---|
670 | .map(arg => shouldIgnore(arg) ? undefined : arg);
|
---|
671 | return converter(context, args);
|
---|
672 | }
|
---|
673 | else {
|
---|
674 | // Determine if the function is one we can simplify.
|
---|
675 | const targetFunction = resolveReferenceValue(staticSymbol);
|
---|
676 | return simplifyCall(staticSymbol, targetFunction, argExpressions, expression['expression']);
|
---|
677 | }
|
---|
678 | }
|
---|
679 | return IGNORE;
|
---|
680 | case 'error':
|
---|
681 | let message = expression.message;
|
---|
682 | if (expression['line'] != null) {
|
---|
683 | self.error({
|
---|
684 | message,
|
---|
685 | context: expression.context,
|
---|
686 | value: expression,
|
---|
687 | position: {
|
---|
688 | fileName: expression['fileName'],
|
---|
689 | line: expression['line'],
|
---|
690 | column: expression['character']
|
---|
691 | }
|
---|
692 | }, context);
|
---|
693 | }
|
---|
694 | else {
|
---|
695 | self.error({ message, context: expression.context }, context);
|
---|
696 | }
|
---|
697 | return IGNORE;
|
---|
698 | case 'ignore':
|
---|
699 | return expression;
|
---|
700 | }
|
---|
701 | return null;
|
---|
702 | }
|
---|
703 | return mapStringMap(expression, (value, name) => {
|
---|
704 | if (REFERENCE_SET.has(name)) {
|
---|
705 | if (name === USE_VALUE && PROVIDE in expression) {
|
---|
706 | // If this is a provider expression, check for special tokens that need the value
|
---|
707 | // during analysis.
|
---|
708 | const provide = simplify(expression.provide);
|
---|
709 | if (provide === self.ROUTES || provide == self.ANALYZE_FOR_ENTRY_COMPONENTS) {
|
---|
710 | return simplify(value);
|
---|
711 | }
|
---|
712 | }
|
---|
713 | return simplifyLazily(value);
|
---|
714 | }
|
---|
715 | return simplify(value);
|
---|
716 | });
|
---|
717 | }
|
---|
718 | return IGNORE;
|
---|
719 | }
|
---|
720 | return simplify(value);
|
---|
721 | }
|
---|
722 | let result;
|
---|
723 | try {
|
---|
724 | result = simplifyInContext(context, value, 0, lazy ? 1 : 0);
|
---|
725 | }
|
---|
726 | catch (e) {
|
---|
727 | if (this.errorRecorder) {
|
---|
728 | this.reportError(e, context);
|
---|
729 | }
|
---|
730 | else {
|
---|
731 | throw formatMetadataError(e, context);
|
---|
732 | }
|
---|
733 | }
|
---|
734 | if (shouldIgnore(result)) {
|
---|
735 | return undefined;
|
---|
736 | }
|
---|
737 | return result;
|
---|
738 | }
|
---|
739 | getTypeMetadata(type) {
|
---|
740 | const resolvedSymbol = this.symbolResolver.resolveSymbol(type);
|
---|
741 | return resolvedSymbol && resolvedSymbol.metadata ? resolvedSymbol.metadata :
|
---|
742 | { __symbolic: 'class' };
|
---|
743 | }
|
---|
744 | reportError(error, context, path) {
|
---|
745 | if (this.errorRecorder) {
|
---|
746 | this.errorRecorder(formatMetadataError(error, context), (context && context.filePath) || path);
|
---|
747 | }
|
---|
748 | else {
|
---|
749 | throw error;
|
---|
750 | }
|
---|
751 | }
|
---|
752 | error({ message, summary, advise, position, context, value, symbol, chain }, reportingContext) {
|
---|
753 | this.reportError(metadataError(message, summary, advise, position, symbol, context, chain), reportingContext);
|
---|
754 | }
|
---|
755 | }
|
---|
756 | const METADATA_ERROR = 'ngMetadataError';
|
---|
757 | function metadataError(message, summary, advise, position, symbol, context, chain) {
|
---|
758 | const error = syntaxError(message);
|
---|
759 | error[METADATA_ERROR] = true;
|
---|
760 | if (advise)
|
---|
761 | error.advise = advise;
|
---|
762 | if (position)
|
---|
763 | error.position = position;
|
---|
764 | if (summary)
|
---|
765 | error.summary = summary;
|
---|
766 | if (context)
|
---|
767 | error.context = context;
|
---|
768 | if (chain)
|
---|
769 | error.chain = chain;
|
---|
770 | if (symbol)
|
---|
771 | error.symbol = symbol;
|
---|
772 | return error;
|
---|
773 | }
|
---|
774 | function isMetadataError(error) {
|
---|
775 | return !!error[METADATA_ERROR];
|
---|
776 | }
|
---|
777 | const REFERENCE_TO_NONEXPORTED_CLASS = 'Reference to non-exported class';
|
---|
778 | const VARIABLE_NOT_INITIALIZED = 'Variable not initialized';
|
---|
779 | const DESTRUCTURE_NOT_SUPPORTED = 'Destructuring not supported';
|
---|
780 | const COULD_NOT_RESOLVE_TYPE = 'Could not resolve type';
|
---|
781 | const FUNCTION_CALL_NOT_SUPPORTED = 'Function call not supported';
|
---|
782 | const REFERENCE_TO_LOCAL_SYMBOL = 'Reference to a local symbol';
|
---|
783 | const LAMBDA_NOT_SUPPORTED = 'Lambda not supported';
|
---|
784 | function expandedMessage(message, context) {
|
---|
785 | switch (message) {
|
---|
786 | case REFERENCE_TO_NONEXPORTED_CLASS:
|
---|
787 | if (context && context.className) {
|
---|
788 | return `References to a non-exported class are not supported in decorators but ${context.className} was referenced.`;
|
---|
789 | }
|
---|
790 | break;
|
---|
791 | case VARIABLE_NOT_INITIALIZED:
|
---|
792 | return 'Only initialized variables and constants can be referenced in decorators because the value of this variable is needed by the template compiler';
|
---|
793 | case DESTRUCTURE_NOT_SUPPORTED:
|
---|
794 | return 'Referencing an exported destructured variable or constant is not supported in decorators and this value is needed by the template compiler';
|
---|
795 | case COULD_NOT_RESOLVE_TYPE:
|
---|
796 | if (context && context.typeName) {
|
---|
797 | return `Could not resolve type ${context.typeName}`;
|
---|
798 | }
|
---|
799 | break;
|
---|
800 | case FUNCTION_CALL_NOT_SUPPORTED:
|
---|
801 | if (context && context.name) {
|
---|
802 | return `Function calls are not supported in decorators but '${context.name}' was called`;
|
---|
803 | }
|
---|
804 | return 'Function calls are not supported in decorators';
|
---|
805 | case REFERENCE_TO_LOCAL_SYMBOL:
|
---|
806 | if (context && context.name) {
|
---|
807 | return `Reference to a local (non-exported) symbols are not supported in decorators but '${context.name}' was referenced`;
|
---|
808 | }
|
---|
809 | break;
|
---|
810 | case LAMBDA_NOT_SUPPORTED:
|
---|
811 | return `Function expressions are not supported in decorators`;
|
---|
812 | }
|
---|
813 | return message;
|
---|
814 | }
|
---|
815 | function messageAdvise(message, context) {
|
---|
816 | switch (message) {
|
---|
817 | case REFERENCE_TO_NONEXPORTED_CLASS:
|
---|
818 | if (context && context.className) {
|
---|
819 | return `Consider exporting '${context.className}'`;
|
---|
820 | }
|
---|
821 | break;
|
---|
822 | case DESTRUCTURE_NOT_SUPPORTED:
|
---|
823 | return 'Consider simplifying to avoid destructuring';
|
---|
824 | case REFERENCE_TO_LOCAL_SYMBOL:
|
---|
825 | if (context && context.name) {
|
---|
826 | return `Consider exporting '${context.name}'`;
|
---|
827 | }
|
---|
828 | break;
|
---|
829 | case LAMBDA_NOT_SUPPORTED:
|
---|
830 | return `Consider changing the function expression into an exported function`;
|
---|
831 | }
|
---|
832 | return undefined;
|
---|
833 | }
|
---|
834 | function errorSummary(error) {
|
---|
835 | if (error.summary) {
|
---|
836 | return error.summary;
|
---|
837 | }
|
---|
838 | switch (error.message) {
|
---|
839 | case REFERENCE_TO_NONEXPORTED_CLASS:
|
---|
840 | if (error.context && error.context.className) {
|
---|
841 | return `references non-exported class ${error.context.className}`;
|
---|
842 | }
|
---|
843 | break;
|
---|
844 | case VARIABLE_NOT_INITIALIZED:
|
---|
845 | return 'is not initialized';
|
---|
846 | case DESTRUCTURE_NOT_SUPPORTED:
|
---|
847 | return 'is a destructured variable';
|
---|
848 | case COULD_NOT_RESOLVE_TYPE:
|
---|
849 | return 'could not be resolved';
|
---|
850 | case FUNCTION_CALL_NOT_SUPPORTED:
|
---|
851 | if (error.context && error.context.name) {
|
---|
852 | return `calls '${error.context.name}'`;
|
---|
853 | }
|
---|
854 | return `calls a function`;
|
---|
855 | case REFERENCE_TO_LOCAL_SYMBOL:
|
---|
856 | if (error.context && error.context.name) {
|
---|
857 | return `references local variable ${error.context.name}`;
|
---|
858 | }
|
---|
859 | return `references a local variable`;
|
---|
860 | }
|
---|
861 | return 'contains the error';
|
---|
862 | }
|
---|
863 | function mapStringMap(input, transform) {
|
---|
864 | if (!input)
|
---|
865 | return {};
|
---|
866 | const result = {};
|
---|
867 | Object.keys(input).forEach((key) => {
|
---|
868 | const value = transform(input[key], key);
|
---|
869 | if (!shouldIgnore(value)) {
|
---|
870 | if (HIDDEN_KEY.test(key)) {
|
---|
871 | Object.defineProperty(result, key, { enumerable: false, configurable: true, value: value });
|
---|
872 | }
|
---|
873 | else {
|
---|
874 | result[key] = value;
|
---|
875 | }
|
---|
876 | }
|
---|
877 | });
|
---|
878 | return result;
|
---|
879 | }
|
---|
880 | function isPrimitive(o) {
|
---|
881 | return o === null || (typeof o !== 'function' && typeof o !== 'object');
|
---|
882 | }
|
---|
883 | class BindingScope {
|
---|
884 | static build() {
|
---|
885 | const current = new Map();
|
---|
886 | return {
|
---|
887 | define: function (name, value) {
|
---|
888 | current.set(name, value);
|
---|
889 | return this;
|
---|
890 | },
|
---|
891 | done: function () {
|
---|
892 | return current.size > 0 ? new PopulatedScope(current) : BindingScope.empty;
|
---|
893 | }
|
---|
894 | };
|
---|
895 | }
|
---|
896 | }
|
---|
897 | BindingScope.missing = {};
|
---|
898 | BindingScope.empty = { resolve: name => BindingScope.missing };
|
---|
899 | class PopulatedScope extends BindingScope {
|
---|
900 | constructor(bindings) {
|
---|
901 | super();
|
---|
902 | this.bindings = bindings;
|
---|
903 | }
|
---|
904 | resolve(name) {
|
---|
905 | return this.bindings.has(name) ? this.bindings.get(name) : BindingScope.missing;
|
---|
906 | }
|
---|
907 | }
|
---|
908 | function formatMetadataMessageChain(chain, advise) {
|
---|
909 | const expanded = expandedMessage(chain.message, chain.context);
|
---|
910 | const nesting = chain.symbol ? ` in '${chain.symbol.name}'` : '';
|
---|
911 | const message = `${expanded}${nesting}`;
|
---|
912 | const position = chain.position;
|
---|
913 | const next = chain.next ?
|
---|
914 | formatMetadataMessageChain(chain.next, advise) :
|
---|
915 | advise ? { message: advise } : undefined;
|
---|
916 | return { message, position, next: next ? [next] : undefined };
|
---|
917 | }
|
---|
918 | function formatMetadataError(e, context) {
|
---|
919 | if (isMetadataError(e)) {
|
---|
920 | // Produce a formatted version of the and leaving enough information in the original error
|
---|
921 | // to recover the formatting information to eventually produce a diagnostic error message.
|
---|
922 | const position = e.position;
|
---|
923 | const chain = {
|
---|
924 | message: `Error during template compile of '${context.name}'`,
|
---|
925 | position: position,
|
---|
926 | next: { message: e.message, next: e.chain, context: e.context, symbol: e.symbol }
|
---|
927 | };
|
---|
928 | const advise = e.advise || messageAdvise(e.message, e.context);
|
---|
929 | return formattedError(formatMetadataMessageChain(chain, advise));
|
---|
930 |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luZCFcbiAgICAgICAgICAgIF19IGluIGFub3RoZXIgY29tcGlsYXRpb24gdW5pdCB3aXRob3V0IGR1cGxpY2F0aW5nIHRoZSBkZWNvcmF0b3JgLFxuICAgICAgICAgICAgICAgICAgICAgICAgLyogc3VtbWFyeSAqLyB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICBgUGxlYXNlIGFkZCBhICR7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZWRBbm5vdGF0aW9uVHlwZXMubWFwKCh0eXBlKSA9PiB0eXBlLm5nTWV0YWRhdGFOYW1lKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuam9pbignIG9yICcpfSBkZWNvcmF0b3IgdG8gdGhlIGNsYXNzYCksXG4gICAgICAgICAgICAgICAgICAgIHR5cGUpLFxuICAgICAgICAgICAgICAgIHR5cGUpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgYW5ub3RhdGlvbkNhY2hlLnNldCh0eXBlLCBhbm5vdGF0aW9ucy5maWx0ZXIoYW5uID0+ICEhYW5uKSk7XG4gICAgfVxuICAgIHJldHVybiBhbm5vdGF0aW9ucztcbiAgfVxuXG4gIHB1YmxpYyBwcm9wTWV0YWRhdGEodHlwZTogU3RhdGljU3ltYm9sKToge1trZXk6IHN0cmluZ106IGFueVtdfSB7XG4gICAgbGV0IHByb3BNZXRhZGF0YSA9IHRoaXMucHJvcGVydHlDYWNoZS5nZXQodHlwZSk7XG4gICAgaWYgKCFwcm9wTWV0YWRhdGEpIHtcbiAgICAgIGNvbnN0IGNsYXNzTWV0YWRhdGEgPSB0aGlzLmdldFR5cGVNZXRhZGF0YSh0eXBlKTtcbiAgICAgIHByb3BNZXRhZGF0YSA9IHt9O1xuICAgICAgY29uc3QgcGFyZW50VHlwZSA9IHRoaXMuZmluZFBhcmVudFR5cGUodHlwZSwgY2xhc3NNZXRhZGF0YSk7XG4gICAgICBpZiAocGFyZW50VHlwZS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mVzdGVkQ29udGV4dFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgY29udGV4dCk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8vIEl0IGlzIHByb2JhYmx5IGFuIGludGVybmFsIGVycm9yLlxuICAgICAgICAgICAgdGhyb3cgZTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgZnVuY3Rpb24gc2ltcGxpZnlDYWxsKFxuICAgICAgICAgIGZ1bmN0aW9uU3ltYm9sOiBTdGF0aWNTeW1ib2wsIHRhcmdldEZ1bmN0aW9uOiBhbnksIGFyZ3M6IGFueVtdLCB0YXJnZXRFeHByZXNzaW9uOiBhbnkpIHtcbiAgICAgICAgaWYgKHRhcmdldEZ1bmN0aW9uICYmIHRhcmdldEZ1bmN0aW9uWydfX3N5bWJvbGljJ10gPT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgIGlmIChjYWxsaW5nLmdldChmdW5jdGlvblN5bWJvbCkpIHtcbiAgICAgICAgICAgIHNlbGYuZXJyb3IoXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgbWVzc2FnZTogJ1JlY3Vyc2lvbiBpcyBub3Qgc3VwcG9ydGVkJyxcbiAgICAgICAgICAgICAgICAgIHN1bW1hcnk6IGBjYWxsZWQgJyR7ZnVuY3Rpb25TeW1ib2wubmFtZX0nIHJlY3Vyc2l2ZWx5YCxcbiAgICAgICAgICAgICAgICAgIHZhbHVlOiB0YXJnZXRGdW5jdGlvblxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgZnVuY3Rpb25TeW1ib2wpO1xuICAgICAgICAgIH1cbiAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgY29uc3QgdmFsdWUgPSB0YXJnZXRGdW5jdGlvblsndmFsdWUnXTtcbiAgICAgICAgICAgIGlmICh2YWx1ZSAmJiAoZGVwdGggIT0gMCB8fCB2YWx1ZS5fX3N5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BjaGFyYWN0ZXIgPSB0YXJnZXRFeHByZXNzaW9uLmNoYXJhY3RlcjtcbiAgICAgICAgICBjb25zdCBmaWxlTmFtZSA9IHRhcmdldEV4cHJlc3Npb24uZmlsZU5hbWU7XG4gICAgICAgICAgaWYgKGZpbGVOYW1lICE9IG51bGwgJiYgbGluZSAhPSBudWxsICYmIGNoYXJhY3RlciAhPSBudWxsKSB7XG4gICAgICAgICAgICBwb3NpdGlvbiA9IHtmaWxlTmFtZSwgbGluZSwgY29sdW1uOiBjaGFyYWN0ZXJ9O1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBzZWxmLmVycm9yKFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBtZXNzYWdlOiBGVU5DVElPTl9DQUxMX05PVF9TVVBQT1JURUQsXG4gICAgICAgICAgICAgIGNvbnRleHQ6IGZ1bmN0aW9uU3ltYm9sLFxuICAgICAgICAgICAgICB2YWx1ZTogdGFyZ2V0RnVuY3Rpb24sXG4gICAgICAgICAgICAgIHBvc2l0aW9uXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY29udGV4dCk7XG4gICAgICB9XG5cbiAgICAgIGZ1bmN0aW9uIHNpbXBsaWZ5KGV4cHJlc3Npb246IGFueSk6IGFueSB7XG4gICAgICAgIGlmIChpc1ByaW1pdGl2ZShleHByZXNzaW9uKSkge1xuICAgICAgICAgIHJldHVybiBleHByZXNzaW9uO1xuICAgICAgICB9XG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KGV4cHJlc3Npb24pKSB7XG4gICAgICAgICAgY29uc3QgcmVzdWx0OiBhbnlbXSA9IFtdO1xuICAgICAgICAgIGZvciAoY29uc3QgaXRlbSBvZiAoPGFueT5leHByZXNzaW9uKSkge1xuICAgICAgICAgICAgLy8gQ2hlY2sgZm9yIGEgc3ByZWFkIGV4cHJlc3Npb25cbiAgICAgICAgICAgIGlmIChpdGVtICYmIGl0ZW0uX19zeW1ib2xpYyA9PT0gJ3NwcmVhZ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gICAgIGlmIChleHByZXNzaW9uID09PSBzZWxmLmluamVjdGlvblRva2VuIHx8IHNlbGYuY29udmVyc2lvbk1hcC5oYXMoZXhwcmVzc2lvbikgfHxcbiAgICAgICAgICAgICAgKHJlZmVyZW5jZXMgPiAwICYmICFleHByZXNzaW9uLm1lbWJlcnMubGVuZ3RoKSkge1xuICAgICAgICAgICAgcmV0dXJuIGV4cHJlc3Npb247XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbnN0IHN0YXRpY1N5bWJvbCA9IGV4cHJlc3Npb247XG4gICAgICAgICAgICBjb25zdCBkZWNsYXJhdGlvblZhbHVlID0gcmVzb2x2ZVJlZmVyZW5jZVZhbHVlKHN0YXRpY1N5bWJvbCk7XG4gICAgICAgICAgICBpZiAoZGVjbGFyYXRpb25WYWx1ZSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgIHJldHVybiBzaW1wbGlmeU5lc3RlZChzdGF0aWNTeW1ib2wsIGRlY2xhcmF0aW9uVmFsdWUpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHN0YXRpY1N5bWJvbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGV4cHJlc3Npb24pIHtcbiAgICAgICAgICBpZiAoZXhwcmVzc2lvblsnX19zeW1ib2xpYyddKSB7XG4gICAgICAgICAgICBsZXQgc3RhdGljU3ltYm9sOiBTdGF0aWNTeW1ib2w7XG4gICAgICAgICAgICBzd2l0Y2ggKGV4cHJlc3Npb25bJ19fc3ltYm9saWMnXSkge1xuICAgICAgICAgICAgICBjYXNlICdiaW5vcCc6XG4gICAgICAgICAgICAgICAgbGV0IGxlZnQgPSBzaW1wbGlmeShleHByZXNzaW9uWydsZWZ0J10pO1xuICAgICAgICAgICAgICAgIGlmIChzaG91bGRJZ25vcmUobGVmdCkpIHJldHVybiBsZWZ0O1xuICAgICAgICAgICAgICAgIGxldCByaWdodCA9IHNpbXBsaWZ5KGV4cHJlc3Npb25bJ3JpZ2h0J10pO1xuICAgICAgICAgICAgICAgIGlmIChzaG91bGRJZ25vcmUocmlnaHQpKSByZXR1cm4gcmlnaHQ7XG4gICAgICAgICAgICAgICAgc3dpdGNoIChleHByZXNzaW9uWydvcGVyYXRvciddKSB7XG4gICAgICAgICAgICAgICAgICBjYXNlICcmJic6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBsZWZ0ICYmIHJpZ2h0O1xuICAgICAgICAgICAgICAgICAgY2FzZSAnfHwnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGVmdCB8fCByaWdodDtcbiAgICAgICAgICAgICAgICAgIGNhc2UgJ3wnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGVmdCB8IHJpZ2h0O1xuICAgICAgICAgICAgICAgICAgY2FzZSAnXic6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBsZWZ0IF4gcmlnaHQ7XG4gICAgICAgICAgICAgICAgICBjYXNlICcmJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxlZnQgJiByaWdodDtcbiAgICAgICAgICAgICAgICAgIGNhc2UgJz09JzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxlZnQgPT0gcmlnaHQ7XG4gICAgICAgICAgICAgICAgICBjYXNlICchPSc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBsZWZ0ICE9IHJpZ2h0O1xuICAgICAgICAgICAgICAgICAgY2FzZSAnPT09JzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxlZnQgPT09IHJpZ2h0O1xuICAgICAgICAgICAgICAgICAgY2FzZSAnIT09JzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxlZnQgIT09IHJpZ2h0O1xuICAgICAgICAgICAgICAgICAgY2FzZSAnPCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBsZWZ0IDwgcmlnaHQ7XG4gICAgICAgICAgICAgICAgICBjYXNlICc+JzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxlZnQgPiByaWdodDtcbiAgICAgICAgICAgICAgICAgIGNhc2UgJzw9JzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxlZnQgPD0gcmlnaHQ7XG4gICAgICAgICAgICAgICAgICBjYXNlICc+PSc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBsZWZ0ID49IHJpZ2h0O1xuICAgICAgICAgICAgICAgICAgY2FzZSAnPDwnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGVmdCA8PCByaWdodDtcbiAgICAgICAgICAgICAgICAgIGNhc2UgJz4+JzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxlZnQgPj4gcmlnaHQ7XG4gICAgICAgICAgICAgICAgICBjYXNlICcrJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxlZnQgKyByaWdodDtcbiAgICAgICAgICAgICAgICAgIGNhc2UgJy0nOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGVmdCAtIHJpZ2h0O1xuICAgICAgICAgICAgICAgICAgY2FzZSAnKic6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBsZWZ0ICogcmlnaHQ7XG4gICAgICAgICAgICAgICAgICBjYXNlICcvJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxlZnQgLyByaWdodDtcbiAgICAgICAgICAgICAgICAgIGNhc2UgJyUnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGVmdCAlIHJpZ2h0O1xuICAgICAgICAgICAgICAgICAgY2FzZSAnPz8nOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGVmdCA/PyByaWdodDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgIGNhc2UgJ2lmJzpcbiAgICAgICAgICAgICAgICBsZXQgY29uZGl0aW9uID0gc2ltcGxpZnkoZXhwcmVzc2lvblsnY29uZGl0aW9uJ10pO1xuICAgICAgICAgICAgICAgIHJldHVybiBjb25kaXRpb24gPyBzaW1wbGlmeShleHByZXNzaW9uWyd0aGVuRXhwcmVzc2lvbiddKSA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpbXBsaWZ5KGV4cHJlc3Npb25bJ2Vsc2VFeHByZXNzaW9uJ10pO1xuICAgICAgICAgICAgICBjYXNlICdwcmUnOlxuICAgICAgICAgICAgICAgIGxldCBvcGVyYW5kID0gc2ltcGxpZnkoZXhwcmVzc2lvblsnb3BlcmFuZCddKTtcbiAgICAgICAgICAgICAgICBpZiAoc2hvdWxkSWdub3JlKG9wZXJhbmQpKSByZXR1cm4gb3BlcmFuZDtcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKGV4cHJlc3Npb25bJ29wZXJhdG9yJ10pIHtcbiAgICAgICAgICAgICAgICAgIGNhc2UgJysnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3BlcmFuZDtcbiAgICAgICAgICAgICAgICAgIGNhc2UgJy0nOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gLW9wZXJhbmQ7XG4gICAgICAgICAgICAgICAgICBjYXNlICchJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICFvcGVyYW5kO1xuICAgICAgICAgICAgICAgICAgY2FzZSAnfic6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB+b3BlcmFuZDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgIGNhc2UgJ2luZGV4JzpcbiAgICAgICAgICAgICAgICBsZXQgaW5kZXhUYXJnZXQgPSBzaW1wbGlmeUVhZ2VybHkoZXhwcmVzc2lvblsnZXhwcmVzc2lvbiddKTtcbiAgICAgICAgICAgICAgICBsZXQgaW5kZXggPSBzaW1wbGlmeUVhZ2VybHkoZXhwcmVzc2lvblsnaW5kZXgnXSk7XG4gICAgICAgICAgICAgICAgaWYgKGluZGV4VGFyZ2V0ICYmIGlzUHJpbWl0aXZlKGluZGV4KSkgcmV0dXJuIGluZGV4VGFyZ2V0W2luZGV4XTtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgICAgY2FzZSAnc2VsZWN0JzpcbiAgICAgICAgICAgICAgICBjb25zdCBtZW1iZXIgPSBleHByZXNzaW9uWydtZW1iZXInXTtcbiAgICAgICAgICAgICAgICBsZXQgc2VsZWN0Q29udGV4dCA9IGNvbnRleHQ7XG4gICAgICAgICAgICAgICAgbGV0IHNlbGVjdFRhcmdldCA9IHNpbXBsaWZ5KGV4cHJlc3Npb25bJ2V4cHJlc3Npb24nXSk7XG4gICAgICAgICAgICAgICAgaWYgKHNlbGVjdFRhcmdldCBpbnN0YW5jZW9mIFN0YXRpY1N5bWJvbCkge1xuICAgICAgICAgICAgICAgICAgY29uc3QgbWVtYmVycyA9IHNlbGVjdFRhcmdldC5tZW1iZXJzLmNvbmNhdChtZW1iZXIpO1xuICAgICAgICAgICAgICAgICAgc2VsZWN0Q29udGV4dCA9XG4gICAgICAgICAgICAgICAgICAgICAgc2VsZi5nZXRTdGF0aWNTeW1ib2woc2VsZWN0VGFyZ2V0LmZpbGVQYXRoLCBzZWxlY3RUYXJnZXQubmFtZSwgbWVtYmVycyk7XG4gICAgICAgICAgICAgICAgICBjb25zdCBkZWNsYXJhdGlvblZhbHVlID0gcmVzb2x2ZVJlZmVyZW5jZVZhbHVlKHNlbGVjdENvbnRleHQpO1xuICAgICAgICAgICAgICAgICAgaWYgKGRlY2xhcmF0aW9uVmFsdWUgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2ltcGxpZnlOZXN0ZWQoc2VsZWN0Q29udGV4dCwgZGVjbGFyYXRpb25WYWx1ZSk7XG4gICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2VsZWN0Q29udGV4dDtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHNlbGVjdFRhcmdldCAmJiBpc1ByaW1pdGl2ZShtZW1iZXIpKVxuICAgICAgICAgICAgICAgICAgcmV0dXJuIHNpbXBsaWZ5TmVzdGVkKHNlbGVjdENvbnRleHQsIHNlbGVjdFRhcmdldFttZW1iZXJdKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgICAgY2FzZSAncmVmZXJlbmNlJzpcbiAgICAgICAgICAgICAgICAvLyBOb3RlOiBUaGlzIG9ubHkgaGFzIHRvIGRlYWwgd2l0aCB2YXJpYWJsZSByZWZlcmVuY2VzLCBhcyBzeW1ib2wgcmVmZXJlbmNlcyBoYXZlXG4gICAgICAgICAgICAgICAgLy8gYmVlbiBjb252ZXJ0ZWQgaW50byAncmVzb2x2ZWQnXG4gICAgICAgICAgICAgICAgLy8gaW4gdGhlIFN0YXRpY1N5bWJvbFJlc29sdmVyLlxuICAgICAgICAgICAgICAgIGNvbnN0IG5hbWU6IHN0cmluZyA9IGV4cHJlc3Npb25bJ25hbWUnXTtcbiAgICAgICAgICAgICAgICBjb25zdCBsb2NhbFZhbHVlID0gc2NvcGUucmVzb2x2ZShuYW1lKTtcbiAgICAgICAgICAgICAgICBpZiAobG9jYWxWYWx1ZSAhPSBCaW5kaW5nU2NvcGUubWlzc2luZykge1xuICAgICAgICAgICAgICAgICAgcmV0dXJuIGxvY2FsVmFsdWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICBjYXNlICdyZXNvbHZlZCc6XG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiBzaW1wbGlmeShleHByZXNzaW9uLnN5bWJvbCk7XG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgLy8gSWYgYW4gZXJyb3IgaXMgcmVwb3J0ZWQgZXZhbHVhdGluZyB0aGUgc3ltYm9sIHJlY29yZCB0aGUgcG9zaXRpb24gb2YgdGhlXG4gICAgICAgICAgICAgICAgICAvLyByZWZlcmVuY2UgaW4gdGhlIGVycm9yIHNvIGl0IGNhblxuICAgICAgICAgICAgICAgICAgLy8gYmUgcmVwb3J0ZWQgaW4gdGhlIGVycm9yIG1lc3NhZ2UgZ2VuZXJhdGVkIGZyb20gdGhlIGV4Y2VwdGlvbi5cbiAgICAgICAgICAgICAgICAgIGlmIChpc01ldGFkYXRhRXJyb3IoZSkgJiYgZXhwcmVzc2lvbi5maWxlTmFtZSAhPSBudWxsICYmXG4gICAgICAgICAgICAgICAgICAgICAgZXhwcmVzc2lvbi5saW5lICE9IG51bGwgJiYgZXhwcmVzc2lvbi5jaGFyYWN0ZXIgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICBlLnBvc2l0aW9uID0ge1xuICAgICAgICAgICAgICAgICAgICAgIGZpbGVOYW1lOiBleHByZXNzaW9uLmZpbGVOYW1lLFxuICAgICAgICAgICAgICAgICAgICAgIGxpbmU6IGV4cHJlc3Npb24ubGluZSxcbiAgICAgICAgICAgICAgICAgICAgICBjb2x1bW46IGV4cHJlc3Npb24uY2hhcmFjdGVyXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgY2FzZSAnY2xhc3MnOlxuICAgICAgICAgICAgICAgIHJldHVybiBjb250ZXh0O1xuICAgICAgICAgICAgICBjYXNlICdmdW5jdGlvbic6XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbnRleHQ7XG4gICAgICAgICAgICAgIGNhc2UgJ25ldyc6XG4gICAgICAgICAgICAgIGNhc2UgJ2NhbGwnOlxuICAgICAgICAgICAgICAgIC8vIERldGVyb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gICAgICAgICAgICAgICBsZXQgY29udmVydGVyID0gc2VsZi5jb252ZXJzaW9uTWFwLmdldChzdGF0aWNTeW1ib2wpO1xuICAgICAgICAgICAgICAgICAgaWYgKGNvbnZlcnRlcikge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBhcmdzID0gYXJnRXhwcmVzc2lvbnMubWFwKGFyZyA9PiBzaW1wbGlmeU5lc3RlZChjb250ZXh0LCBhcmcpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5tYXAoYXJnID0+IHNob3VsZElnbm9yZShhcmcpID8gdW5kZWZpbmVkIDogYXJnKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbnZlcnRlcihjb250ZXh0LCBhcmdzKTtcbiAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIERldGVybWluZSBpZiB0aGUgZnVuY3Rpb24gaXMgb25lIHdlIGNhbiBzaW1wbGlmeS5cbiAgICAgICAgICAgICAgICAgICAgY29uc3QgdGFyZ2V0RnVuY3Rpb24gPSByZXNvbHZlUmVmZXJlbmNlVmFsdWUoc3RhdGljU3ltYm9sKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNpbXBsaWZ5Q2FsbChcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRpY1N5bWJvbCwgdGFyZ2V0RnVuY3Rpb24sIGFyZ0V4cHJlc3Npb25zLCBleHByZXNzaW9uWydleHByZXNzaW9uJ10pO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gSUdOT1JFO1xuICAgICAgICAgICAgICBjYXNlICdlcnJvcic6XG4gICAgICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSBleHByZXNzaW9uLm1lc3NhZ2U7XG4gICAgICAgICAgICAgICAgaWYgKGV4cHJlc3Npb25bJ2xpbmUnXSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICBzZWxmLmVycm9yKFxuICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0OiBleHByZXNzaW9uLmNvbnRleHQsXG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogZXhwcmVzc2lvbixcbiAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVOYW1lOiBleHByZXNzaW9uWydmaWxlTmFtZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lOiBleHByZXNzaW9uWydsaW5lJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGNvbHVtbjogZXhwcmVzc2lvblsnY2hhcmFjdGVyJ11cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgIGNvbnRleHQpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICBzZWxmLmVycm9yKHttZXNzYWdlLCBjb250ZXh0OiBleHByZXNzaW9uLmNvbnRleHR9LCBjb250ZXh0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIElHTk9SRTtcbiAgICAgICAgICAgICAgY2FzZSAnaWdub3JlJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gZXhwcmVzc2lvbjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gbWFwU3RyaW5nTWFwKGV4cHJlc3Npb24sICh2YWx1ZSwgbmFtZSkgPT4ge1xuICAgICAgICAgICAgaWYgKFJFRkVSRU5DRV9TRVQuaGFzKG5hbWUpKSB7XG4gICAgICAgICAgICAgIGlmIChuYW1lID09PSBVU0VfVkFM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