@angular/language-service 5.2.4 → 5.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @license Angular v5.2.4
2
+ * @license Angular v5.2.8
3
3
  * (c) 2010-2018 Google, Inc. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
  function $getModule(name){return $provided[name]||require(name)}function define(modules,cb){$deferred={modules:modules,cb:cb}}var $reflect={defineMetadata:function(){},getOwnMetadata:function(){}};("undefined"!=typeof global&&global||{}).Reflect=$reflect;var $deferred,$resolved,$provided;module.exports=function(provided){if($resolved)return $resolved;var result={};return $provided=Object.assign({"reflect-metadata":$reflect},provided||{},{exports:result}),$deferred.cb.apply(this,$deferred.modules.map($getModule)),$resolved=result,result},define(["exports","fs","path","typescript"],function(exports,fs,path,ts){"use strict";function __extends(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}/**
7
- * @license Angular v5.2.4
7
+ * @license Angular v5.2.8
8
8
  * (c) 2010-2018 Google, Inc. https://angular.io/
9
9
  * License: MIT
10
10
  */
@@ -92,7 +92,7 @@ function forwardRef(forwardRefFn){return forwardRefFn.__forward_ref__=forwardRef
92
92
  * Use of this source code is governed by an MIT-style license that can be
93
93
  * found in the LICENSE file at https://angular.io/license
94
94
  */
95
- function findFirstClosedCycle(keys){for(var res=[],i=0;i<keys.length;++i){if(res.indexOf(keys[i])>-1)return res.push(keys[i]),res;res.push(keys[i])}return res}function constructResolvingPath(keys){if(keys.length>1){return" ("+findFirstClosedCycle(keys.slice().reverse()).map(function(k){return stringify$1(k.token)}).join(" -> ")+")"}return""}function injectionError(injector,key,constructResolvingMessage,originalError){var keys=[key],errMsg=constructResolvingMessage(keys),error=originalError?wrappedError(errMsg,originalError):Error(errMsg);return error.addKey=addKey,error.keys=keys,error.injectors=[injector],error.constructResolvingMessage=constructResolvingMessage,error[ERROR_ORIGINAL_ERROR]=originalError,error}function addKey(injector,key){this.injectors.push(injector),this.keys.push(key),this.message=this.constructResolvingMessage(this.keys)}function noProviderError(injector,key){return injectionError(injector,key,function(keys){return"No provider for "+stringify$1(keys[0].token)+"!"+constructResolvingPath(keys)})}function cyclicDependencyError(injector,key){return injectionError(injector,key,function(keys){return"Cannot instantiate cyclic dependency!"+constructResolvingPath(keys)})}function instantiationError(injector,originalException,originalStack,key){return injectionError(injector,key,function(keys){var first=stringify$1(keys[0].token);return originalException.message+": Error during instantiation of "+first+"!"+constructResolvingPath(keys)+"."},originalException)}function invalidProviderError(provider){return Error("Invalid provider - only instances of Provider and Type are allowed, got: "+provider)}function noAnnotationError(typeOrFunc,params){for(var signature=[],i=0,ii=params.length;i<ii;i++){var parameter=params[i];parameter&&0!=parameter.length?signature.push(parameter.map(stringify$1).join(" ")):signature.push("?")}return Error("Cannot resolve all parameters for '"+stringify$1(typeOrFunc)+"'("+signature.join(", ")+"). Make sure that all the parameters are decorated with Inject or have valid type annotations and that '"+stringify$1(typeOrFunc)+"' is decorated with Injectable.")}function outOfBoundsError(index){return Error("Index "+index+" is out-of-bounds.")}function mixingMultiProvidersWithRegularProvidersError(provider1,provider2){return Error("Cannot mix multi providers and regular providers, got: "+provider1+" "+provider2)}function isType(v){return"function"==typeof v}function convertTsickleDecoratorIntoMetadata(decoratorInvocations){return decoratorInvocations?decoratorInvocations.map(function(decoratorInvocation){var decoratorType=decoratorInvocation.type,annotationCls=decoratorType.annotationCls,annotationArgs=decoratorInvocation.args?decoratorInvocation.args:[];return new(annotationCls.bind.apply(annotationCls,[void 0].concat(annotationArgs)))}):[]}function getParentCtor(ctor){var parentProto=Object.getPrototypeOf(ctor.prototype);return(parentProto?parentProto.constructor:null)||Object}function resolveReflectiveFactory(provider){var factoryFn,resolvedDeps;if(provider.useClass){var useClass=resolveForwardRef$1(provider.useClass);factoryFn=reflector.factory(useClass),resolvedDeps=_dependenciesFor(useClass)}else provider.useExisting?(factoryFn=function(aliasInstance){return aliasInstance},resolvedDeps=[ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))]):provider.useFactory?(factoryFn=provider.useFactory,resolvedDeps=constructDependencies(provider.useFactory,provider.deps)):(factoryFn=function(){return provider.useValue},resolvedDeps=_EMPTY_LIST);return new ResolvedReflectiveFactory(factoryFn,resolvedDeps)}function resolveReflectiveProvider(provider){return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide),[resolveReflectiveFactory(provider)],provider.multi||!1)}function resolveReflectiveProviders(providers){var normalized=_normalizeProviders(providers,[]),resolved=normalized.map(resolveReflectiveProvider),resolvedProviderMap=mergeResolvedReflectiveProviders(resolved,new Map);return Array.from(resolvedProviderMap.values())}function mergeResolvedReflectiveProviders(providers,normalizedProvidersMap){for(var i=0;i<providers.length;i++){var provider=providers[i],existing=normalizedProvidersMap.get(provider.key.id);if(existing){if(provider.multiProvider!==existing.multiProvider)throw mixingMultiProvidersWithRegularProvidersError(existing,provider);if(provider.multiProvider)for(var j=0;j<provider.resolvedFactories.length;j++)existing.resolvedFactories.push(provider.resolvedFactories[j]);else normalizedProvidersMap.set(provider.key.id,provider)}else{var resolvedProvider=void 0;resolvedProvider=provider.multiProvider?new ResolvedReflectiveProvider_(provider.key,provider.resolvedFactories.slice(),provider.multiProvider):provider,normalizedProvidersMap.set(provider.key.id,resolvedProvider)}}return normalizedProvidersMap}function _normalizeProviders(providers,res){return providers.forEach(function(b){if(b instanceof Type$1$1)res.push({provide:b,useClass:b});else if(b&&"object"==typeof b&&void 0!==b.provide)res.push(b);else{if(!(b instanceof Array))throw invalidProviderError(b);_normalizeProviders(b,res)}}),res}function constructDependencies(typeOrFunc,dependencies){if(dependencies){var params_1=dependencies.map(function(t){return[t]});return dependencies.map(function(t){return _extractToken(typeOrFunc,t,params_1)})}return _dependenciesFor(typeOrFunc)}function _dependenciesFor(typeOrFunc){var params=reflector.parameters(typeOrFunc);if(!params)return[];if(params.some(function(p){return null==p}))throw noAnnotationError(typeOrFunc,params);return params.map(function(p){return _extractToken(typeOrFunc,p,params)})}function _extractToken(typeOrFunc,metadata,params){var token=null,optional=!1;if(!Array.isArray(metadata))return metadata instanceof Inject$1?_createDependency(metadata.token,optional,null):_createDependency(metadata,optional,null);for(var visibility=null,i=0;i<metadata.length;++i){var paramMetadata=metadata[i];paramMetadata instanceof Type$1$1?token=paramMetadata:paramMetadata instanceof Inject$1?token=paramMetadata.token:paramMetadata instanceof Optional?optional=!0:paramMetadata instanceof Self||paramMetadata instanceof SkipSelf?visibility=paramMetadata:paramMetadata instanceof InjectionToken&&(token=paramMetadata)}if(null!=(token=resolveForwardRef$1(token)))return _createDependency(token,optional,visibility);throw noAnnotationError(typeOrFunc,params)}function _createDependency(token,optional,visibility){return new ReflectiveDependency(ReflectiveKey.get(token),optional,visibility)}function _mapProviders(injector,fn){for(var res=new Array(injector._providers.length),i=0;i<injector._providers.length;++i)res[i]=fn(injector.getProviderAtIndex(i));return res}/**
95
+ function findFirstClosedCycle(keys){for(var res=[],i=0;i<keys.length;++i){if(res.indexOf(keys[i])>-1)return res.push(keys[i]),res;res.push(keys[i])}return res}function constructResolvingPath(keys){if(keys.length>1){return" ("+findFirstClosedCycle(keys.slice().reverse()).map(function(k){return stringify$1(k.token)}).join(" -> ")+")"}return""}function injectionError(injector,key,constructResolvingMessage,originalError){var keys=[key],errMsg=constructResolvingMessage(keys),error=originalError?wrappedError(errMsg,originalError):Error(errMsg);return error.addKey=addKey,error.keys=keys,error.injectors=[injector],error.constructResolvingMessage=constructResolvingMessage,error[ERROR_ORIGINAL_ERROR]=originalError,error}function addKey(injector,key){this.injectors.push(injector),this.keys.push(key),this.message=this.constructResolvingMessage(this.keys)}function noProviderError(injector,key){return injectionError(injector,key,function(keys){return"No provider for "+stringify$1(keys[0].token)+"!"+constructResolvingPath(keys)})}function cyclicDependencyError(injector,key){return injectionError(injector,key,function(keys){return"Cannot instantiate cyclic dependency!"+constructResolvingPath(keys)})}function instantiationError(injector,originalException,originalStack,key){return injectionError(injector,key,function(keys){var first=stringify$1(keys[0].token);return originalException.message+": Error during instantiation of "+first+"!"+constructResolvingPath(keys)+"."},originalException)}function invalidProviderError(provider){return Error("Invalid provider - only instances of Provider and Type are allowed, got: "+provider)}function noAnnotationError(typeOrFunc,params){for(var signature=[],i=0,ii=params.length;i<ii;i++){var parameter=params[i];parameter&&0!=parameter.length?signature.push(parameter.map(stringify$1).join(" ")):signature.push("?")}return Error("Cannot resolve all parameters for '"+stringify$1(typeOrFunc)+"'("+signature.join(", ")+"). Make sure that all the parameters are decorated with Inject or have valid type annotations and that '"+stringify$1(typeOrFunc)+"' is decorated with Injectable.")}function outOfBoundsError(index){return Error("Index "+index+" is out-of-bounds.")}function mixingMultiProvidersWithRegularProvidersError(provider1,provider2){return Error("Cannot mix multi providers and regular providers, got: "+provider1+" "+provider2)}function isType(v){return"function"==typeof v}function convertTsickleDecoratorIntoMetadata(decoratorInvocations){return decoratorInvocations?decoratorInvocations.map(function(decoratorInvocation){var decoratorType=decoratorInvocation.type,annotationCls=decoratorType.annotationCls,annotationArgs=decoratorInvocation.args?decoratorInvocation.args:[];return new(annotationCls.bind.apply(annotationCls,[void 0].concat(annotationArgs)))}):[]}function getParentCtor(ctor){var parentProto=ctor.prototype?Object.getPrototypeOf(ctor.prototype):null;return(parentProto?parentProto.constructor:null)||Object}function resolveReflectiveFactory(provider){var factoryFn,resolvedDeps;if(provider.useClass){var useClass=resolveForwardRef$1(provider.useClass);factoryFn=reflector.factory(useClass),resolvedDeps=_dependenciesFor(useClass)}else provider.useExisting?(factoryFn=function(aliasInstance){return aliasInstance},resolvedDeps=[ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))]):provider.useFactory?(factoryFn=provider.useFactory,resolvedDeps=constructDependencies(provider.useFactory,provider.deps)):(factoryFn=function(){return provider.useValue},resolvedDeps=_EMPTY_LIST);return new ResolvedReflectiveFactory(factoryFn,resolvedDeps)}function resolveReflectiveProvider(provider){return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide),[resolveReflectiveFactory(provider)],provider.multi||!1)}function resolveReflectiveProviders(providers){var normalized=_normalizeProviders(providers,[]),resolved=normalized.map(resolveReflectiveProvider),resolvedProviderMap=mergeResolvedReflectiveProviders(resolved,new Map);return Array.from(resolvedProviderMap.values())}function mergeResolvedReflectiveProviders(providers,normalizedProvidersMap){for(var i=0;i<providers.length;i++){var provider=providers[i],existing=normalizedProvidersMap.get(provider.key.id);if(existing){if(provider.multiProvider!==existing.multiProvider)throw mixingMultiProvidersWithRegularProvidersError(existing,provider);if(provider.multiProvider)for(var j=0;j<provider.resolvedFactories.length;j++)existing.resolvedFactories.push(provider.resolvedFactories[j]);else normalizedProvidersMap.set(provider.key.id,provider)}else{var resolvedProvider=void 0;resolvedProvider=provider.multiProvider?new ResolvedReflectiveProvider_(provider.key,provider.resolvedFactories.slice(),provider.multiProvider):provider,normalizedProvidersMap.set(provider.key.id,resolvedProvider)}}return normalizedProvidersMap}function _normalizeProviders(providers,res){return providers.forEach(function(b){if(b instanceof Type$1$1)res.push({provide:b,useClass:b});else if(b&&"object"==typeof b&&void 0!==b.provide)res.push(b);else{if(!(b instanceof Array))throw invalidProviderError(b);_normalizeProviders(b,res)}}),res}function constructDependencies(typeOrFunc,dependencies){if(dependencies){var params_1=dependencies.map(function(t){return[t]});return dependencies.map(function(t){return _extractToken(typeOrFunc,t,params_1)})}return _dependenciesFor(typeOrFunc)}function _dependenciesFor(typeOrFunc){var params=reflector.parameters(typeOrFunc);if(!params)return[];if(params.some(function(p){return null==p}))throw noAnnotationError(typeOrFunc,params);return params.map(function(p){return _extractToken(typeOrFunc,p,params)})}function _extractToken(typeOrFunc,metadata,params){var token=null,optional=!1;if(!Array.isArray(metadata))return metadata instanceof Inject$1?_createDependency(metadata.token,optional,null):_createDependency(metadata,optional,null);for(var visibility=null,i=0;i<metadata.length;++i){var paramMetadata=metadata[i];paramMetadata instanceof Type$1$1?token=paramMetadata:paramMetadata instanceof Inject$1?token=paramMetadata.token:paramMetadata instanceof Optional?optional=!0:paramMetadata instanceof Self||paramMetadata instanceof SkipSelf?visibility=paramMetadata:paramMetadata instanceof InjectionToken&&(token=paramMetadata)}if(null!=(token=resolveForwardRef$1(token)))return _createDependency(token,optional,visibility);throw noAnnotationError(typeOrFunc,params)}function _createDependency(token,optional,visibility){return new ReflectiveDependency(ReflectiveKey.get(token),optional,visibility)}function _mapProviders(injector,fn){for(var res=new Array(injector._providers.length),i=0;i<injector._providers.length;++i)res[i]=fn(injector.getProviderAtIndex(i));return res}/**
96
96
  * @license
97
97
  * Copyright Google Inc. All Rights Reserved.
98
98
  *
@@ -226,7 +226,7 @@ function createLanguageService(host){return new LanguageServiceImpl(host)}functi
226
226
  * Use of this source code is governed by an MIT-style license that can be
227
227
  * found in the LICENSE file at https://angular.io/license
228
228
  */
229
- function createLanguageServiceFromTypescript(host,service){var ngHost=new TypeScriptServiceHost(host,service),ngServer=createLanguageService(ngHost);return ngHost.setSite(ngServer),ngServer}function findTsConfig(fileName){for(var dir=path.dirname(fileName);fs.existsSync(dir);){var candidate=path.join(dir,"tsconfig.json");if(fs.existsSync(candidate))return candidate;var parentDir=path.dirname(dir);if(parentDir===dir)break;dir=parentDir}}function spanOf$1(node){return{start:node.getStart(),end:node.getEnd()}}function shrink(span,offset){return null==offset&&(offset=1),{start:span.start+offset,end:span.end-offset}}function spanAt(sourceFile,line,column){if(null!=line&&null!=column){var position_1=ts.getPositionOfLineAndCharacter(sourceFile,line,column),findChild=function findChild(node){if(node.kind>ts.SyntaxKind.LastToken&&node.pos<=position_1&&node.end>position_1){return ts.forEachChild(node,findChild)||node}},node=ts.forEachChild(sourceFile,findChild);if(node)return{start:node.getStart(),end:node.getEnd()}}}function convertChain(chain){return{message:chain.message,next:chain.next?convertChain(chain.next):void 0}}function errorToDiagnosticWithChain(error,span){return{message:error.chain?convertChain(error.chain):error.message,span:span}}function getExternalFiles(project){var host=projectHostMap.get(project);if(host)return host.getTemplateReferences()}function angularOnlyFilter(ls){return{cleanupSemanticCache:function(){return ls.cleanupSemanticCache()},getSyntacticDiagnostics:function(fileName){return[]},getSemanticDiagnostics:function(fileName){return[]},getCompilerOptionsDiagnostics:function(){return[]},getSyntacticClassifications:function(fileName,span){return[]},getSemanticClassifications:function(fileName,span){return[]},getEncodedSyntacticClassifications:function(fileName,span){return{undefined:void 0}},getEncodedSemanticClassifications:function(fileName,span){},getCompletionsAtPosition:function(fileName,position){},getCompletionEntryDetails:function(fileName,position,entryName){},getCompletionEntrySymbol:function(fileName,position,entryName){},getQuickInfoAtPosition:function(fileName,position){},getNameOrDottedNameSpan:function(fileName,startPos,endPos){},getBreakpointStatementAtPosition:function(fileName,position){},getSignatureHelpItems:function(fileName,position){},getRenameInfo:function(fileName,position){},findRenameLocations:function(fileName,position,findInStrings,findInComments){return[]},getDefinitionAtPosition:function(fileName,position){return[]},getTypeDefinitionAtPosition:function(fileName,position){return[]},getImplementationAtPosition:function(fileName,position){return[]},getReferencesAtPosition:function(fileName,position){return[]},findReferences:function(fileName,position){return[]},getDocumentHighlights:function(fileName,position,filesToSearch){return[]},getOccurrencesAtPosition:function(fileName,position){return[]},getNavigateToItems:function(searchValue){return[]},getNavigationBarItems:function(fileName){return[]},getNavigationTree:function(fileName){},getOutliningSpans:function(fileName){return[]},getTodoComments:function(fileName,descriptors){return[]},getBraceMatchingAtPosition:function(fileName,position){return[]},getIndentationAtPosition:function(fileName,position,options){},getFormattingEditsForRange:function(fileName,start,end,options){return[]},getFormattingEditsForDocument:function(fileName,options){return[]},getFormattingEditsAfterKeystroke:function(fileName,position,key,options){return[]},getDocCommentTemplateAtPosition:function(fileName,position){},isValidBraceCompletionAtPosition:function(fileName,position,openingBrace){},getSpanOfEnclosingComment:function(fileName,position,onlyMultiLine){},getCodeFixesAtPosition:function(fileName,start,end,errorCodes){return[]},applyCodeActionCommand:function(action){return Promise.resolve(void 0)},getEmitOutput:function(fileName){},getProgram:function(){return ls.getProgram()},dispose:function(){return ls.dispose()},getApplicableRefactors:function(fileName,positionOrRaneg){return[]},getEditsForRefactor:function(fileName,formatOptions,positionOrRange,refactorName,actionName){}}}function create(info){function tryCall(fileName,callback){if(!fileName||oldLS.getProgram().getSourceFile(fileName))try{return callback()}catch(e){return}}function tryFilenameCall(m){return function(fileName){return tryCall(fileName,function(){return m.call(ls,fileName)})}}function tryFilenameOneCall(m){return function(fileName,p){return tryCall(fileName,function(){return m.call(ls,fileName,p)})}}function tryFilenameTwoCall(m){return function(fileName,p1,p2){return tryCall(fileName,function(){return m.call(ls,fileName,p1,p2)})}}function tryFilenameThreeCall(m){return function(fileName,p1,p2,p3){return tryCall(fileName,function(){return m.call(ls,fileName,p1,p2,p3)})}}function tryFilenameFourCall(m){return function(fileName,p1,p2,p3,p4){return tryCall(fileName,function(){return m.call(ls,fileName,p1,p2,p3,p4)})}}function completionToEntry(c){return{kind:c.kind,name:c.name,sortText:c.sort,kindModifiers:""}}function diagnosticChainToDiagnosticChain(chain){return{messageText:chain.message,category:ts.DiagnosticCategory.Error,code:0,next:chain.next?diagnosticChainToDiagnosticChain(chain.next):void 0}}function diagnosticMessageToDiagnosticMessageText(message){return"string"==typeof message?message:diagnosticChainToDiagnosticChain(message)}function diagnosticToDiagnostic(d,file){return{file:file,start:d.span.start,length:d.span.end-d.span.start,messageText:diagnosticMessageToDiagnosticMessageText(d.message),category:ts.DiagnosticCategory.Error,code:0,source:"ng"}}function tryOperation(attempting,callback){try{return callback()}catch(e){return info.project.projectService.logger.info("Failed to "+attempting+": "+e.toString()),info.project.projectService.logger.info("Stack trace: "+e.stack),null}}var proxy=Object.create(null),oldLS=info.languageService;angularOnlyResults&&(oldLS=angularOnlyFilter(oldLS)),oldLS=function(ls){return{cleanupSemanticCache:function(){return ls.cleanupSemanticCache()},getSyntacticDiagnostics:tryFilenameCall(ls.getSyntacticDiagnostics),getSemanticDiagnostics:tryFilenameCall(ls.getSemanticDiagnostics),getCompilerOptionsDiagnostics:function(){return ls.getCompilerOptionsDiagnostics()},getSyntacticClassifications:tryFilenameOneCall(ls.getSemanticClassifications),getSemanticClassifications:tryFilenameOneCall(ls.getSemanticClassifications),getEncodedSyntacticClassifications:tryFilenameOneCall(ls.getEncodedSyntacticClassifications),getEncodedSemanticClassifications:tryFilenameOneCall(ls.getEncodedSemanticClassifications),getCompletionsAtPosition:tryFilenameTwoCall(ls.getCompletionsAtPosition),getCompletionEntryDetails:tryFilenameFourCall(ls.getCompletionEntryDetails),getCompletionEntrySymbol:tryFilenameThreeCall(ls.getCompletionEntrySymbol),getQuickInfoAtPosition:tryFilenameOneCall(ls.getQuickInfoAtPosition),getNameOrDottedNameSpan:tryFilenameTwoCall(ls.getNameOrDottedNameSpan),getBreakpointStatementAtPosition:tryFilenameOneCall(ls.getBreakpointStatementAtPosition),getSignatureHelpItems:tryFilenameOneCall(ls.getSignatureHelpItems),getRenameInfo:tryFilenameOneCall(ls.getRenameInfo),findRenameLocations:tryFilenameThreeCall(ls.findRenameLocations),getDefinitionAtPosition:tryFilenameOneCall(ls.getDefinitionAtPosition),getTypeDefinitionAtPosition:tryFilenameOneCall(ls.getTypeDefinitionAtPosition),getImplementationAtPosition:tryFilenameOneCall(ls.getImplementationAtPosition),getReferencesAtPosition:tryFilenameOneCall(ls.getReferencesAtPosition),findReferences:tryFilenameOneCall(ls.findReferences),getDocumentHighlights:tryFilenameTwoCall(ls.getDocumentHighlights),getOccurrencesAtPosition:tryFilenameOneCall(ls.getOccurrencesAtPosition),getNavigateToItems:function(searchValue,maxResultCount,fileName,excludeDtsFiles){return tryCall(fileName,function(){return ls.getNavigateToItems(searchValue,maxResultCount,fileName,excludeDtsFiles)})},getNavigationBarItems:tryFilenameCall(ls.getNavigationBarItems),getNavigationTree:tryFilenameCall(ls.getNavigationTree),getOutliningSpans:tryFilenameCall(ls.getOutliningSpans),getTodoComments:tryFilenameOneCall(ls.getTodoComments),getBraceMatchingAtPosition:tryFilenameOneCall(ls.getBraceMatchingAtPosition),getIndentationAtPosition:tryFilenameTwoCall(ls.getIndentationAtPosition),getFormattingEditsForRange:tryFilenameThreeCall(ls.getFormattingEditsForRange),getFormattingEditsForDocument:tryFilenameOneCall(ls.getFormattingEditsForDocument),getFormattingEditsAfterKeystroke:tryFilenameThreeCall(ls.getFormattingEditsAfterKeystroke),getDocCommentTemplateAtPosition:tryFilenameOneCall(ls.getDocCommentTemplateAtPosition),isValidBraceCompletionAtPosition:tryFilenameTwoCall(ls.isValidBraceCompletionAtPosition),getSpanOfEnclosingComment:tryFilenameTwoCall(ls.getSpanOfEnclosingComment),getCodeFixesAtPosition:tryFilenameFourCall(ls.getCodeFixesAtPosition),applyCodeActionCommand:function(action){return tryCall(void 0,function(){return ls.applyCodeActionCommand(action)})},getEmitOutput:tryFilenameCall(ls.getEmitOutput),getProgram:function(){return ls.getProgram()},dispose:function(){return ls.dispose()},getApplicableRefactors:tryFilenameOneCall(ls.getApplicableRefactors),getEditsForRefactor:tryFilenameFourCall(ls.getEditsForRefactor)}}(oldLS);for(var k in oldLS)!function(k){proxy[k]=function(){return oldLS[k].apply(oldLS,arguments)}}(k);var serviceHost=new TypeScriptServiceHost(info.languageServiceHost,info.languageService),ls=createLanguageService(serviceHost);return serviceHost.setSite(ls),projectHostMap.set(info.project,serviceHost),proxy.getCompletionsAtPosition=function(fileName,position,options){var base=oldLS.getCompletionsAtPosition(fileName,position,options)||{isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:!1,entries:[]};return tryOperation("get completions",function(){var results=ls.getCompletionsAt(fileName,position);if(results&&results.length){void 0===base&&(base={isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:!1,entries:[]});for(var _i=0,results_1=results;_i<results_1.length;_i++){var entry=results_1[_i];base.entries.push(completionToEntry(entry))}}}),base},proxy.getQuickInfoAtPosition=function(fileName,position){var base=oldLS.getQuickInfoAtPosition(fileName,position);return tryOperation("get quick info",function(){var ours=ls.getHoverAt(fileName,position);if(ours){for(var displayParts=[],_i=0,_a=ours.text;_i<_a.length;_i++){var part=_a[_i];displayParts.push({kind:part.language||"angular",text:part.text})}var tags=base&&base.tags;base={displayParts:displayParts,documentation:[],kind:"angular",kindModifiers:"what does this do?",textSpan:{start:ours.span.start,length:ours.span.end-ours.span.start}},tags&&(base.tags=tags)}}),base},proxy.getSemanticDiagnostics=function(fileName){var result=oldLS.getSemanticDiagnostics(fileName),base=result||[];return tryOperation("get diagnostics",function(){info.project.projectService.logger.info("Computing Angular semantic diagnostics...");var ours=ls.getDiagnostics(fileName);if(ours&&ours.length){var file_1=oldLS.getProgram().getSourceFile(fileName);base.push.apply(base,ours.map(function(d){return diagnosticToDiagnostic(d,file_1)}))}}),base},proxy.getDefinitionAtPosition=function(fileName,position){var base=oldLS.getDefinitionAtPosition(fileName,position);return base&&base.length?base:tryOperation("get definition",function(){var ours=ls.getDefinitionAt(fileName,position);if(ours&&ours.length){base=base||[];for(var _i=0,ours_1=ours;_i<ours_1.length;_i++){var loc=ours_1[_i];base.push({fileName:loc.fileName,textSpan:{start:loc.span.start,length:loc.span.end-loc.span.start},name:"",kind:"definition",containerName:loc.fileName,containerKind:"file"})}}return base})||[]},proxy}var fs__default="default"in fs?fs.default:fs,path__default="default"in path?path.default:path,ts__default="default"in ts?ts.default:ts,extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},createInject=makeMetadataFactory("Inject",function(token){return{token:token}}),createInjectionToken=makeMetadataFactory("InjectionToken",function(desc){return{_desc:desc}}),createAttribute=makeMetadataFactory("Attribute",function(attributeName){return{attributeName:attributeName}}),createContentChildren=makeMetadataFactory("ContentChildren",function(selector,data){return void 0===data&&(data={}),__assign({selector:selector,first:!1,isViewQuery:!1,descendants:!1},data)}),createContentChild=makeMetadataFactory("ContentChild",function(selector,data){return void 0===data&&(data={}),__assign({selector:selector,first:!0,isViewQuery:!1,descendants:!0},data)}),createViewChildren=makeMetadataFactory("ViewChildren",function(selector,data){return void 0===data&&(data={}),__assign({selector:selector,first:!1,isViewQuery:!0,descendants:!0},data)}),createViewChild=makeMetadataFactory("ViewChild",function(selector,data){return __assign({selector:selector,first:!0,isViewQuery:!0,descendants:!0},data)}),createDirective=makeMetadataFactory("Directive",function(dir){return void 0===dir&&(dir={}),dir}),ViewEncapsulation={Emulated:0,Native:1,None:2};ViewEncapsulation[ViewEncapsulation.Emulated]="Emulated",ViewEncapsulation[ViewEncapsulation.Native]="Native",ViewEncapsulation[ViewEncapsulation.None]="None";var ChangeDetectionStrategy={OnPush:0,Default:1};ChangeDetectionStrategy[ChangeDetectionStrategy.OnPush]="OnPush",ChangeDetectionStrategy[ChangeDetectionStrategy.Default]="Default";var createComponent=makeMetadataFactory("Component",function(c){return void 0===c&&(c={}),__assign({changeDetection:ChangeDetectionStrategy.Default},c)}),createPipe=makeMetadataFactory("Pipe",function(p){return __assign({pure:!0},p)}),createInput=makeMetadataFactory("Input",function(bindingPropertyName){return{bindingPropertyName:bindingPropertyName}}),createOutput=makeMetadataFactory("Output",function(bindingPropertyName){return{bindingPropertyName:bindingPropertyName}}),createHostBinding=makeMetadataFactory("HostBinding",function(hostPropertyName){return{hostPropertyName:hostPropertyName}}),createHostListener=makeMetadataFactory("HostListener",function(eventName,args){return{eventName:eventName,args:args}}),createNgModule=makeMetadataFactory("NgModule",function(ngModule){return ngModule}),CUSTOM_ELEMENTS_SCHEMA={name:"custom-elements"},NO_ERRORS_SCHEMA={name:"no-errors-schema"},createOptional=makeMetadataFactory("Optional"),createInjectable=makeMetadataFactory("Injectable"),createSelf=makeMetadataFactory("Self"),createSkipSelf=makeMetadataFactory("SkipSelf"),createHost=makeMetadataFactory("Host"),Type=Function,SecurityContext={NONE:0,HTML:1,STYLE:2,SCRIPT:3,URL:4,RESOURCE_URL:5};SecurityContext[SecurityContext.NONE]="NONE",SecurityContext[SecurityContext.HTML]="HTML",SecurityContext[SecurityContext.STYLE]="STYLE",SecurityContext[SecurityContext.SCRIPT]="SCRIPT",SecurityContext[SecurityContext.URL]="URL",SecurityContext[SecurityContext.RESOURCE_URL]="RESOURCE_URL";var NodeFlags={None:0,TypeElement:1,TypeText:2,ProjectedTemplate:4,CatRenderNode:3,TypeNgContent:8,TypePipe:16,TypePureArray:32,TypePureObject:64,TypePurePipe:128,CatPureExpression:224,TypeValueProvider:256,TypeClassProvider:512,TypeFactoryProvider:1024,TypeUseExistingProvider:2048,LazyProvider:4096,PrivateProvider:8192,TypeDirective:16384,Component:32768,CatProviderNoDirective:3840,CatProvider:20224,OnInit:65536,OnDestroy:131072,DoCheck:262144,OnChanges:524288,AfterContentInit:1048576,AfterContentChecked:2097152,AfterViewInit:4194304,AfterViewChecked:8388608,EmbeddedViews:16777216,ComponentView:33554432,TypeContentQuery:67108864,TypeViewQuery:134217728,StaticQuery:268435456,DynamicQuery:536870912,CatQuery:201326592,Types:201347067},DepFlags={None:0,SkipSelf:1,Optional:2,Value:8},ArgumentType={Inline:0,Dynamic:1},BindingFlags={TypeElementAttribute:1,TypeElementClass:2,TypeElementStyle:4,TypeProperty:8,SyntheticProperty:16,SyntheticHostProperty:32,CatSyntheticProperty:48,Types:15},QueryBindingType={First:0,All:1},QueryValueType={ElementRef:0,RenderElement:1,TemplateRef:2,ViewContainerRef:3,Provider:4},ViewFlags={None:0,OnPush:2},MissingTranslationStrategy={Error:0,Warning:1,Ignore:2};MissingTranslationStrategy[MissingTranslationStrategy.Error]="Error",MissingTranslationStrategy[MissingTranslationStrategy.Warning]="Warning",MissingTranslationStrategy[MissingTranslationStrategy.Ignore]="Ignore";var core=Object.freeze({Inject:Inject,createInject:createInject,createInjectionToken:createInjectionToken,Attribute:Attribute,createAttribute:createAttribute,Query:Query,createContentChildren:createContentChildren,createContentChild:createContentChild,createViewChildren:createViewChildren,createViewChild:createViewChild,Directive:Directive,createDirective:createDirective,Component:Component,ViewEncapsulation:ViewEncapsulation,ChangeDetectionStrategy:ChangeDetectionStrategy,createComponent:createComponent,Pipe:Pipe,createPipe:createPipe,Input:Input,createInput:createInput,Output:Output,createOutput:createOutput,HostBinding:HostBinding,createHostBinding:createHostBinding,HostListener:HostListener,createHostListener:createHostListener,NgModule:NgModule,createNgModule:createNgModule,ModuleWithProviders:ModuleWithProviders,SchemaMetadata:SchemaMetadata,CUSTOM_ELEMENTS_SCHEMA:CUSTOM_ELEMENTS_SCHEMA,NO_ERRORS_SCHEMA:NO_ERRORS_SCHEMA,createOptional:createOptional,createInjectable:createInjectable,createSelf:createSelf,createSkipSelf:createSkipSelf,createHost:createHost,Type:Type,SecurityContext:SecurityContext,NodeFlags:NodeFlags,DepFlags:DepFlags,ArgumentType:ArgumentType,BindingFlags:BindingFlags,QueryBindingType:QueryBindingType,QueryValueType:QueryValueType,ViewFlags:ViewFlags,MissingTranslationStrategy:MissingTranslationStrategy,MetadataFactory:MetadataFactory,Route:Route}),DASH_CASE_REGEXP=/-+([a-z0-9])/g,ValueTransformer=function(){function ValueTransformer(){}return ValueTransformer.prototype.visitArray=function(arr,context){var _this=this;return arr.map(function(value){return visitValue(value,_this,context)})},ValueTransformer.prototype.visitStringMap=function(map,context){var _this=this,result={};return Object.keys(map).forEach(function(key){result[key]=visitValue(map[key],_this,context)}),result},ValueTransformer.prototype.visitPrimitive=function(value,context){return value},ValueTransformer.prototype.visitOther=function(value,context){return value},ValueTransformer}(),SyncAsync={assertSync:function(value){if(isPromise(value))throw new Error("Illegal state: value cannot be a promise");return value},then:function(value,cb){return isPromise(value)?value.then(cb):cb(value)},all:function(syncAsyncValues){return syncAsyncValues.some(isPromise)?Promise.all(syncAsyncValues):syncAsyncValues}},ERROR_SYNTAX_ERROR="ngSyntaxError",ERROR_PARSE_ERRORS="ngParseErrors",STRING_MAP_PROTO=Object.getPrototypeOf({}),Version=function(){function Version(full){this.full=full;var splits=full.split(".");this.major=splits[0],this.minor=splits[1],this.patch=splits.slice(2).join(".")}return Version}(),VERSION$1=new Version("5.2.4"),TextAst=function(){function TextAst(value,ngContentIndex,sourceSpan){this.value=value,this.ngContentIndex=ngContentIndex,this.sourceSpan=sourceSpan}return TextAst.prototype.visit=function(visitor,context){return visitor.visitText(this,context)},TextAst}(),BoundTextAst=function(){function BoundTextAst(value,ngContentIndex,sourceSpan){this.value=value,this.ngContentIndex=ngContentIndex,this.sourceSpan=sourceSpan}return BoundTextAst.prototype.visit=function(visitor,context){return visitor.visitBoundText(this,context)},BoundTextAst}(),AttrAst=function(){function AttrAst(name,value,sourceSpan){this.name=name,this.value=value,this.sourceSpan=sourceSpan}return AttrAst.prototype.visit=function(visitor,context){return visitor.visitAttr(this,context)},AttrAst}(),BoundElementPropertyAst=function(){function BoundElementPropertyAst(name,type,securityContext,value,unit,sourceSpan){this.name=name,this.type=type,this.securityContext=securityContext,this.value=value,this.unit=unit,this.sourceSpan=sourceSpan,this.isAnimation=this.type===PropertyBindingType.Animation}return BoundElementPropertyAst.prototype.visit=function(visitor,context){return visitor.visitElementProperty(this,context)},BoundElementPropertyAst}(),BoundEventAst=function(){function BoundEventAst(name,target,phase,handler,sourceSpan){this.name=name,this.target=target,this.phase=phase,this.handler=handler,this.sourceSpan=sourceSpan,this.fullName=BoundEventAst.calcFullName(this.name,this.target,this.phase),this.isAnimation=!!this.phase}return BoundEventAst.calcFullName=function(name,target,phase){return target?target+":"+name:phase?"@"+name+"."+phase:name},BoundEventAst.prototype.visit=function(visitor,context){return visitor.visitEvent(this,context)},BoundEventAst}(),ReferenceAst=function(){function ReferenceAst(name,value,sourceSpan){this.name=name,this.value=value,this.sourceSpan=sourceSpan}return ReferenceAst.prototype.visit=function(visitor,context){return visitor.visitReference(this,context)},ReferenceAst}(),VariableAst=function(){function VariableAst(name,value,sourceSpan){this.name=name,this.value=value,this.sourceSpan=sourceSpan}return VariableAst.prototype.visit=function(visitor,context){return visitor.visitVariable(this,context)},VariableAst}(),ElementAst=function(){function ElementAst(name,attrs,inputs,outputs,references,directives,providers,hasViewContainer,queryMatches,children,ngContentIndex,sourceSpan,endSourceSpan){this.name=name,this.attrs=attrs,this.inputs=inputs,this.outputs=outputs,this.references=references,this.directives=directives,this.providers=providers,this.hasViewContainer=hasViewContainer,this.queryMatches=queryMatches,this.children=children,this.ngContentIndex=ngContentIndex,this.sourceSpan=sourceSpan,this.endSourceSpan=endSourceSpan}return ElementAst.prototype.visit=function(visitor,context){return visitor.visitElement(this,context)},ElementAst}(),EmbeddedTemplateAst=function(){function EmbeddedTemplateAst(attrs,outputs,references,variables,directives,providers,hasViewContainer,queryMatches,children,ngContentIndex,sourceSpan){this.attrs=attrs,this.outputs=outputs,this.references=references,this.variables=variables,this.directives=directives,this.providers=providers,this.hasViewContainer=hasViewContainer,this.queryMatches=queryMatches,this.children=children,this.ngContentIndex=ngContentIndex,this.sourceSpan=sourceSpan}return EmbeddedTemplateAst.prototype.visit=function(visitor,context){return visitor.visitEmbeddedTemplate(this,context)},EmbeddedTemplateAst}(),BoundDirectivePropertyAst=function(){function BoundDirectivePropertyAst(directiveName,templateName,value,sourceSpan){this.directiveName=directiveName,this.templateName=templateName,this.value=value,this.sourceSpan=sourceSpan}return BoundDirectivePropertyAst.prototype.visit=function(visitor,context){return visitor.visitDirectiveProperty(this,context)},BoundDirectivePropertyAst}(),DirectiveAst=function(){function DirectiveAst(directive,inputs,hostProperties,hostEvents,contentQueryStartId,sourceSpan){this.directive=directive,this.inputs=inputs,this.hostProperties=hostProperties,this.hostEvents=hostEvents,this.contentQueryStartId=contentQueryStartId,this.sourceSpan=sourceSpan}return DirectiveAst.prototype.visit=function(visitor,context){return visitor.visitDirective(this,context)},DirectiveAst}(),ProviderAst=function(){function ProviderAst(token,multiProvider,eager,providers,providerType,lifecycleHooks,sourceSpan){this.token=token,this.multiProvider=multiProvider,this.eager=eager,this.providers=providers,this.providerType=providerType,this.lifecycleHooks=lifecycleHooks,this.sourceSpan=sourceSpan}return ProviderAst.prototype.visit=function(visitor,context){return null},ProviderAst}(),ProviderAstType={PublicService:0,PrivateService:1,Component:2,Directive:3,Builtin:4};ProviderAstType[ProviderAstType.PublicService]="PublicService",ProviderAstType[ProviderAstType.PrivateService]="PrivateService",ProviderAstType[ProviderAstType.Component]="Component",ProviderAstType[ProviderAstType.Directive]="Directive",ProviderAstType[ProviderAstType.Builtin]="Builtin";var NgContentAst=function(){function NgContentAst(index,ngContentIndex,sourceSpan){this.index=index,this.ngContentIndex=ngContentIndex,this.sourceSpan=sourceSpan}return NgContentAst.prototype.visit=function(visitor,context){return visitor.visitNgContent(this,context)},NgContentAst}(),PropertyBindingType={Property:0,Attribute:1,Class:2,Style:3,Animation:4};PropertyBindingType[PropertyBindingType.Property]="Property",PropertyBindingType[PropertyBindingType.Attribute]="Attribute",PropertyBindingType[PropertyBindingType.Class]="Class",PropertyBindingType[PropertyBindingType.Style]="Style",PropertyBindingType[PropertyBindingType.Animation]="Animation";var NullTemplateVisitor=function(){function NullTemplateVisitor(){}return NullTemplateVisitor.prototype.visitNgContent=function(ast,context){},NullTemplateVisitor.prototype.visitEmbeddedTemplate=function(ast,context){},NullTemplateVisitor.prototype.visitElement=function(ast,context){},NullTemplateVisitor.prototype.visitReference=function(ast,context){},NullTemplateVisitor.prototype.visitVariable=function(ast,context){},NullTemplateVisitor.prototype.visitEvent=function(ast,context){},NullTemplateVisitor.prototype.visitElementProperty=function(ast,context){},NullTemplateVisitor.prototype.visitAttr=function(ast,context){},NullTemplateVisitor.prototype.visitBoundText=function(ast,context){},NullTemplateVisitor.prototype.visitText=function(ast,context){},NullTemplateVisitor.prototype.visitDirective=function(ast,context){},NullTemplateVisitor.prototype.visitDirectiveProperty=function(ast,context){},NullTemplateVisitor}(),RecursiveTemplateAstVisitor=function(_super){function RecursiveTemplateAstVisitor(){return _super.call(this)||this}return __extends(RecursiveTemplateAstVisitor,_super),RecursiveTemplateAstVisitor.prototype.visitEmbeddedTemplate=function(ast,context){return this.visitChildren(context,function(visit){visit(ast.attrs),visit(ast.references),visit(ast.variables),visit(ast.directives),visit(ast.providers),visit(ast.children)})},RecursiveTemplateAstVisitor.prototype.visitElement=function(ast,context){return this.visitChildren(context,function(visit){visit(ast.attrs),visit(ast.inputs),visit(ast.outputs),visit(ast.references),visit(ast.directives),visit(ast.providers),visit(ast.children)})},RecursiveTemplateAstVisitor.prototype.visitDirective=function(ast,context){return this.visitChildren(context,function(visit){visit(ast.inputs),visit(ast.hostProperties),visit(ast.hostEvents)})},RecursiveTemplateAstVisitor.prototype.visitChildren=function(context,cb){function visit(children){children&&children.length&&results.push(templateVisitAll(t,children,context))}var results=[],t=this;return cb(visit),[].concat.apply([],results)},RecursiveTemplateAstVisitor}(NullTemplateVisitor),CompilerConfig=function(){function CompilerConfig(_a){var _b=void 0===_a?{}:_a,_c=_b.defaultEncapsulation,defaultEncapsulation=void 0===_c?ViewEncapsulation.Emulated:_c,_d=_b.useJit,useJit=void 0===_d||_d,_e=_b.jitDevMode,jitDevMode=void 0!==_e&&_e,_f=_b.missingTranslation,missingTranslation=void 0===_f?null:_f,enableLegacyTemplate=_b.enableLegacyTemplate,preserveWhitespaces=_b.preserveWhitespaces,strictInjectionParameters=_b.strictInjectionParameters;this.defaultEncapsulation=defaultEncapsulation,this.useJit=!!useJit,this.jitDevMode=!!jitDevMode,this.missingTranslation=missingTranslation,this.enableLegacyTemplate=!0===enableLegacyTemplate,this.preserveWhitespaces=preserveWhitespacesDefault(noUndefined(preserveWhitespaces)),this.strictInjectionParameters=!0===strictInjectionParameters}return CompilerConfig}(),StaticSymbol=function(){function StaticSymbol(filePath,name,members){this.filePath=filePath,this.name=name,this.members=members}return StaticSymbol.prototype.assertNoMembers=function(){if(this.members.length)throw new Error("Illegal state: symbol without members expected, but got "+JSON.stringify(this)+".")},StaticSymbol}(),StaticSymbolCache=function(){function StaticSymbolCache(){this.cache=new Map}return StaticSymbolCache.prototype.get=function(declarationFile,name,members){members=members||[];var memberSuffix=members.length?"."+members.join("."):"",key='"'+declarationFile+'".'+name+memberSuffix,result=this.cache.get(key);return result||(result=new StaticSymbol(declarationFile,name,members),this.cache.set(key,result)),result},StaticSymbolCache}(),HOST_REG_EXP=/^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))|(\@[-\w]+)$/,_anonymousTypeIndex=0,CompileSummaryKind={Pipe:0,Directive:1,NgModule:2,Injectable:3};CompileSummaryKind[CompileSummaryKind.Pipe]="Pipe",CompileSummaryKind[CompileSummaryKind.Directive]="Directive",CompileSummaryKind[CompileSummaryKind.NgModule]="NgModule",CompileSummaryKind[CompileSummaryKind.Injectable]="Injectable";var CompileStylesheetMetadata=function(){function CompileStylesheetMetadata(_a){var _b=void 0===_a?{}:_a,moduleUrl=_b.moduleUrl,styles=_b.styles,styleUrls=_b.styleUrls;this.moduleUrl=moduleUrl||null,this.styles=_normalizeArray(styles),this.styleUrls=_normalizeArray(styleUrls)}return CompileStylesheetMetadata}(),CompileTemplateMetadata=function(){function CompileTemplateMetadata(_a){var encapsulation=_a.encapsulation,template=_a.template,templateUrl=_a.templateUrl,htmlAst=_a.htmlAst,styles=_a.styles,styleUrls=_a.styleUrls,externalStylesheets=_a.externalStylesheets,animations=_a.animations,ngContentSelectors=_a.ngContentSelectors,interpolation=_a.interpolation,isInline=_a.isInline,preserveWhitespaces=_a.preserveWhitespaces;if(this.encapsulation=encapsulation,this.template=template,this.templateUrl=templateUrl,this.htmlAst=htmlAst,this.styles=_normalizeArray(styles),this.styleUrls=_normalizeArray(styleUrls),this.externalStylesheets=_normalizeArray(externalStylesheets),this.animations=animations?flatten$1(animations):[],this.ngContentSelectors=ngContentSelectors||[],interpolation&&2!=interpolation.length)throw new Error("'interpolation' should have a start and an end symbol.");this.interpolation=interpolation,this.isInline=isInline,this.preserveWhitespaces=preserveWhitespaces}return CompileTemplateMetadata.prototype.toSummary=function(){return{ngContentSelectors:this.ngContentSelectors,encapsulation:this.encapsulation}},CompileTemplateMetadata}(),CompileDirectiveMetadata=function(){function CompileDirectiveMetadata(_a){var isHost=_a.isHost,type=_a.type,isComponent=_a.isComponent,selector=_a.selector,exportAs=_a.exportAs,changeDetection=_a.changeDetection,inputs=_a.inputs,outputs=_a.outputs,hostListeners=_a.hostListeners,hostProperties=_a.hostProperties,hostAttributes=_a.hostAttributes,providers=_a.providers,viewProviders=_a.viewProviders,queries=_a.queries,guards=_a.guards,viewQueries=_a.viewQueries,entryComponents=_a.entryComponents,template=_a.template,componentViewType=_a.componentViewType,rendererType=_a.rendererType,componentFactory=_a.componentFactory;this.isHost=!!isHost,this.type=type,this.isComponent=isComponent,this.selector=selector,this.exportAs=exportAs,this.changeDetection=changeDetection,this.inputs=inputs,this.outputs=outputs,this.hostListeners=hostListeners,this.hostProperties=hostProperties,this.hostAttributes=hostAttributes,this.providers=_normalizeArray(providers),this.viewProviders=_normalizeArray(viewProviders),this.queries=_normalizeArray(queries),this.guards=guards,this.viewQueries=_normalizeArray(viewQueries),this.entryComponents=_normalizeArray(entryComponents),this.template=template,this.componentViewType=componentViewType,this.rendererType=rendererType,this.componentFactory=componentFactory}return CompileDirectiveMetadata.create=function(_a){
229
+ function createLanguageServiceFromTypescript(host,service){var ngHost=new TypeScriptServiceHost(host,service),ngServer=createLanguageService(ngHost);return ngHost.setSite(ngServer),ngServer}function findTsConfig(fileName){for(var dir=path.dirname(fileName);fs.existsSync(dir);){var candidate=path.join(dir,"tsconfig.json");if(fs.existsSync(candidate))return candidate;var parentDir=path.dirname(dir);if(parentDir===dir)break;dir=parentDir}}function spanOf$1(node){return{start:node.getStart(),end:node.getEnd()}}function shrink(span,offset){return null==offset&&(offset=1),{start:span.start+offset,end:span.end-offset}}function spanAt(sourceFile,line,column){if(null!=line&&null!=column){var position_1=ts.getPositionOfLineAndCharacter(sourceFile,line,column),findChild=function findChild(node){if(node.kind>ts.SyntaxKind.LastToken&&node.pos<=position_1&&node.end>position_1){return ts.forEachChild(node,findChild)||node}},node=ts.forEachChild(sourceFile,findChild);if(node)return{start:node.getStart(),end:node.getEnd()}}}function convertChain(chain){return{message:chain.message,next:chain.next?convertChain(chain.next):void 0}}function errorToDiagnosticWithChain(error,span){return{message:error.chain?convertChain(error.chain):error.message,span:span}}function getExternalFiles(project){var host=projectHostMap.get(project);if(host)return host.getTemplateReferences()}function angularOnlyFilter(ls){return{cleanupSemanticCache:function(){return ls.cleanupSemanticCache()},getSyntacticDiagnostics:function(fileName){return[]},getSemanticDiagnostics:function(fileName){return[]},getCompilerOptionsDiagnostics:function(){return[]},getSyntacticClassifications:function(fileName,span){return[]},getSemanticClassifications:function(fileName,span){return[]},getEncodedSyntacticClassifications:function(fileName,span){return{undefined:void 0}},getEncodedSemanticClassifications:function(fileName,span){},getCompletionsAtPosition:function(fileName,position){},getCompletionEntryDetails:function(fileName,position,entryName){},getCompletionEntrySymbol:function(fileName,position,entryName){},getQuickInfoAtPosition:function(fileName,position){},getNameOrDottedNameSpan:function(fileName,startPos,endPos){},getBreakpointStatementAtPosition:function(fileName,position){},getSignatureHelpItems:function(fileName,position){},getRenameInfo:function(fileName,position){},findRenameLocations:function(fileName,position,findInStrings,findInComments){return[]},getDefinitionAtPosition:function(fileName,position){return[]},getTypeDefinitionAtPosition:function(fileName,position){return[]},getImplementationAtPosition:function(fileName,position){return[]},getReferencesAtPosition:function(fileName,position){return[]},findReferences:function(fileName,position){return[]},getDocumentHighlights:function(fileName,position,filesToSearch){return[]},getOccurrencesAtPosition:function(fileName,position){return[]},getNavigateToItems:function(searchValue){return[]},getNavigationBarItems:function(fileName){return[]},getNavigationTree:function(fileName){},getOutliningSpans:function(fileName){return[]},getTodoComments:function(fileName,descriptors){return[]},getBraceMatchingAtPosition:function(fileName,position){return[]},getIndentationAtPosition:function(fileName,position,options){},getFormattingEditsForRange:function(fileName,start,end,options){return[]},getFormattingEditsForDocument:function(fileName,options){return[]},getFormattingEditsAfterKeystroke:function(fileName,position,key,options){return[]},getDocCommentTemplateAtPosition:function(fileName,position){},isValidBraceCompletionAtPosition:function(fileName,position,openingBrace){},getSpanOfEnclosingComment:function(fileName,position,onlyMultiLine){},getCodeFixesAtPosition:function(fileName,start,end,errorCodes){return[]},applyCodeActionCommand:function(action){return Promise.resolve(void 0)},getEmitOutput:function(fileName){},getProgram:function(){return ls.getProgram()},dispose:function(){return ls.dispose()},getApplicableRefactors:function(fileName,positionOrRaneg){return[]},getEditsForRefactor:function(fileName,formatOptions,positionOrRange,refactorName,actionName){}}}function create(info){function tryCall(fileName,callback){if(!fileName||oldLS.getProgram().getSourceFile(fileName))try{return callback()}catch(e){return}}function tryFilenameCall(m){return function(fileName){return tryCall(fileName,function(){return m.call(ls,fileName)})}}function tryFilenameOneCall(m){return function(fileName,p){return tryCall(fileName,function(){return m.call(ls,fileName,p)})}}function tryFilenameTwoCall(m){return function(fileName,p1,p2){return tryCall(fileName,function(){return m.call(ls,fileName,p1,p2)})}}function tryFilenameThreeCall(m){return function(fileName,p1,p2,p3){return tryCall(fileName,function(){return m.call(ls,fileName,p1,p2,p3)})}}function tryFilenameFourCall(m){return function(fileName,p1,p2,p3,p4){return tryCall(fileName,function(){return m.call(ls,fileName,p1,p2,p3,p4)})}}function completionToEntry(c){return{kind:c.kind,name:c.name,sortText:c.sort,kindModifiers:""}}function diagnosticChainToDiagnosticChain(chain){return{messageText:chain.message,category:ts.DiagnosticCategory.Error,code:0,next:chain.next?diagnosticChainToDiagnosticChain(chain.next):void 0}}function diagnosticMessageToDiagnosticMessageText(message){return"string"==typeof message?message:diagnosticChainToDiagnosticChain(message)}function diagnosticToDiagnostic(d,file){return{file:file,start:d.span.start,length:d.span.end-d.span.start,messageText:diagnosticMessageToDiagnosticMessageText(d.message),category:ts.DiagnosticCategory.Error,code:0,source:"ng"}}function tryOperation(attempting,callback){try{return callback()}catch(e){return info.project.projectService.logger.info("Failed to "+attempting+": "+e.toString()),info.project.projectService.logger.info("Stack trace: "+e.stack),null}}var proxy=Object.create(null),oldLS=info.languageService;angularOnlyResults&&(oldLS=angularOnlyFilter(oldLS)),oldLS=function(ls){return{cleanupSemanticCache:function(){return ls.cleanupSemanticCache()},getSyntacticDiagnostics:tryFilenameCall(ls.getSyntacticDiagnostics),getSemanticDiagnostics:tryFilenameCall(ls.getSemanticDiagnostics),getCompilerOptionsDiagnostics:function(){return ls.getCompilerOptionsDiagnostics()},getSyntacticClassifications:tryFilenameOneCall(ls.getSemanticClassifications),getSemanticClassifications:tryFilenameOneCall(ls.getSemanticClassifications),getEncodedSyntacticClassifications:tryFilenameOneCall(ls.getEncodedSyntacticClassifications),getEncodedSemanticClassifications:tryFilenameOneCall(ls.getEncodedSemanticClassifications),getCompletionsAtPosition:tryFilenameTwoCall(ls.getCompletionsAtPosition),getCompletionEntryDetails:tryFilenameFourCall(ls.getCompletionEntryDetails),getCompletionEntrySymbol:tryFilenameThreeCall(ls.getCompletionEntrySymbol),getQuickInfoAtPosition:tryFilenameOneCall(ls.getQuickInfoAtPosition),getNameOrDottedNameSpan:tryFilenameTwoCall(ls.getNameOrDottedNameSpan),getBreakpointStatementAtPosition:tryFilenameOneCall(ls.getBreakpointStatementAtPosition),getSignatureHelpItems:tryFilenameOneCall(ls.getSignatureHelpItems),getRenameInfo:tryFilenameOneCall(ls.getRenameInfo),findRenameLocations:tryFilenameThreeCall(ls.findRenameLocations),getDefinitionAtPosition:tryFilenameOneCall(ls.getDefinitionAtPosition),getTypeDefinitionAtPosition:tryFilenameOneCall(ls.getTypeDefinitionAtPosition),getImplementationAtPosition:tryFilenameOneCall(ls.getImplementationAtPosition),getReferencesAtPosition:tryFilenameOneCall(ls.getReferencesAtPosition),findReferences:tryFilenameOneCall(ls.findReferences),getDocumentHighlights:tryFilenameTwoCall(ls.getDocumentHighlights),getOccurrencesAtPosition:tryFilenameOneCall(ls.getOccurrencesAtPosition),getNavigateToItems:function(searchValue,maxResultCount,fileName,excludeDtsFiles){return tryCall(fileName,function(){return ls.getNavigateToItems(searchValue,maxResultCount,fileName,excludeDtsFiles)})},getNavigationBarItems:tryFilenameCall(ls.getNavigationBarItems),getNavigationTree:tryFilenameCall(ls.getNavigationTree),getOutliningSpans:tryFilenameCall(ls.getOutliningSpans),getTodoComments:tryFilenameOneCall(ls.getTodoComments),getBraceMatchingAtPosition:tryFilenameOneCall(ls.getBraceMatchingAtPosition),getIndentationAtPosition:tryFilenameTwoCall(ls.getIndentationAtPosition),getFormattingEditsForRange:tryFilenameThreeCall(ls.getFormattingEditsForRange),getFormattingEditsForDocument:tryFilenameOneCall(ls.getFormattingEditsForDocument),getFormattingEditsAfterKeystroke:tryFilenameThreeCall(ls.getFormattingEditsAfterKeystroke),getDocCommentTemplateAtPosition:tryFilenameOneCall(ls.getDocCommentTemplateAtPosition),isValidBraceCompletionAtPosition:tryFilenameTwoCall(ls.isValidBraceCompletionAtPosition),getSpanOfEnclosingComment:tryFilenameTwoCall(ls.getSpanOfEnclosingComment),getCodeFixesAtPosition:tryFilenameFourCall(ls.getCodeFixesAtPosition),applyCodeActionCommand:function(action){return tryCall(void 0,function(){return ls.applyCodeActionCommand(action)})},getEmitOutput:tryFilenameCall(ls.getEmitOutput),getProgram:function(){return ls.getProgram()},dispose:function(){return ls.dispose()},getApplicableRefactors:tryFilenameOneCall(ls.getApplicableRefactors),getEditsForRefactor:tryFilenameFourCall(ls.getEditsForRefactor)}}(oldLS);for(var k in oldLS)!function(k){proxy[k]=function(){return oldLS[k].apply(oldLS,arguments)}}(k);var serviceHost=new TypeScriptServiceHost(info.languageServiceHost,info.languageService),ls=createLanguageService(serviceHost);return serviceHost.setSite(ls),projectHostMap.set(info.project,serviceHost),proxy.getCompletionsAtPosition=function(fileName,position,options){var base=oldLS.getCompletionsAtPosition(fileName,position,options)||{isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:!1,entries:[]};return tryOperation("get completions",function(){var results=ls.getCompletionsAt(fileName,position);if(results&&results.length){void 0===base&&(base={isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:!1,entries:[]});for(var _i=0,results_1=results;_i<results_1.length;_i++){var entry=results_1[_i];base.entries.push(completionToEntry(entry))}}}),base},proxy.getQuickInfoAtPosition=function(fileName,position){var base=oldLS.getQuickInfoAtPosition(fileName,position);return tryOperation("get quick info",function(){var ours=ls.getHoverAt(fileName,position);if(ours){for(var displayParts=[],_i=0,_a=ours.text;_i<_a.length;_i++){var part=_a[_i];displayParts.push({kind:part.language||"angular",text:part.text})}var tags=base&&base.tags;base={displayParts:displayParts,documentation:[],kind:"angular",kindModifiers:"what does this do?",textSpan:{start:ours.span.start,length:ours.span.end-ours.span.start}},tags&&(base.tags=tags)}}),base},proxy.getSemanticDiagnostics=function(fileName){var result=oldLS.getSemanticDiagnostics(fileName),base=result||[];return tryOperation("get diagnostics",function(){info.project.projectService.logger.info("Computing Angular semantic diagnostics...");var ours=ls.getDiagnostics(fileName);if(ours&&ours.length){var file_1=oldLS.getProgram().getSourceFile(fileName);base.push.apply(base,ours.map(function(d){return diagnosticToDiagnostic(d,file_1)}))}}),base},proxy.getDefinitionAtPosition=function(fileName,position){var base=oldLS.getDefinitionAtPosition(fileName,position);return base&&base.length?base:tryOperation("get definition",function(){var ours=ls.getDefinitionAt(fileName,position);if(ours&&ours.length){base=base||[];for(var _i=0,ours_1=ours;_i<ours_1.length;_i++){var loc=ours_1[_i];base.push({fileName:loc.fileName,textSpan:{start:loc.span.start,length:loc.span.end-loc.span.start},name:"",kind:"definition",containerName:loc.fileName,containerKind:"file"})}}return base})||[]},proxy}var fs__default="default"in fs?fs.default:fs,path__default="default"in path?path.default:path,ts__default="default"in ts?ts.default:ts,extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},createInject=makeMetadataFactory("Inject",function(token){return{token:token}}),createInjectionToken=makeMetadataFactory("InjectionToken",function(desc){return{_desc:desc}}),createAttribute=makeMetadataFactory("Attribute",function(attributeName){return{attributeName:attributeName}}),createContentChildren=makeMetadataFactory("ContentChildren",function(selector,data){return void 0===data&&(data={}),__assign({selector:selector,first:!1,isViewQuery:!1,descendants:!1},data)}),createContentChild=makeMetadataFactory("ContentChild",function(selector,data){return void 0===data&&(data={}),__assign({selector:selector,first:!0,isViewQuery:!1,descendants:!0},data)}),createViewChildren=makeMetadataFactory("ViewChildren",function(selector,data){return void 0===data&&(data={}),__assign({selector:selector,first:!1,isViewQuery:!0,descendants:!0},data)}),createViewChild=makeMetadataFactory("ViewChild",function(selector,data){return __assign({selector:selector,first:!0,isViewQuery:!0,descendants:!0},data)}),createDirective=makeMetadataFactory("Directive",function(dir){return void 0===dir&&(dir={}),dir}),ViewEncapsulation={Emulated:0,Native:1,None:2};ViewEncapsulation[ViewEncapsulation.Emulated]="Emulated",ViewEncapsulation[ViewEncapsulation.Native]="Native",ViewEncapsulation[ViewEncapsulation.None]="None";var ChangeDetectionStrategy={OnPush:0,Default:1};ChangeDetectionStrategy[ChangeDetectionStrategy.OnPush]="OnPush",ChangeDetectionStrategy[ChangeDetectionStrategy.Default]="Default";var createComponent=makeMetadataFactory("Component",function(c){return void 0===c&&(c={}),__assign({changeDetection:ChangeDetectionStrategy.Default},c)}),createPipe=makeMetadataFactory("Pipe",function(p){return __assign({pure:!0},p)}),createInput=makeMetadataFactory("Input",function(bindingPropertyName){return{bindingPropertyName:bindingPropertyName}}),createOutput=makeMetadataFactory("Output",function(bindingPropertyName){return{bindingPropertyName:bindingPropertyName}}),createHostBinding=makeMetadataFactory("HostBinding",function(hostPropertyName){return{hostPropertyName:hostPropertyName}}),createHostListener=makeMetadataFactory("HostListener",function(eventName,args){return{eventName:eventName,args:args}}),createNgModule=makeMetadataFactory("NgModule",function(ngModule){return ngModule}),CUSTOM_ELEMENTS_SCHEMA={name:"custom-elements"},NO_ERRORS_SCHEMA={name:"no-errors-schema"},createOptional=makeMetadataFactory("Optional"),createInjectable=makeMetadataFactory("Injectable"),createSelf=makeMetadataFactory("Self"),createSkipSelf=makeMetadataFactory("SkipSelf"),createHost=makeMetadataFactory("Host"),Type=Function,SecurityContext={NONE:0,HTML:1,STYLE:2,SCRIPT:3,URL:4,RESOURCE_URL:5};SecurityContext[SecurityContext.NONE]="NONE",SecurityContext[SecurityContext.HTML]="HTML",SecurityContext[SecurityContext.STYLE]="STYLE",SecurityContext[SecurityContext.SCRIPT]="SCRIPT",SecurityContext[SecurityContext.URL]="URL",SecurityContext[SecurityContext.RESOURCE_URL]="RESOURCE_URL";var NodeFlags={None:0,TypeElement:1,TypeText:2,ProjectedTemplate:4,CatRenderNode:3,TypeNgContent:8,TypePipe:16,TypePureArray:32,TypePureObject:64,TypePurePipe:128,CatPureExpression:224,TypeValueProvider:256,TypeClassProvider:512,TypeFactoryProvider:1024,TypeUseExistingProvider:2048,LazyProvider:4096,PrivateProvider:8192,TypeDirective:16384,Component:32768,CatProviderNoDirective:3840,CatProvider:20224,OnInit:65536,OnDestroy:131072,DoCheck:262144,OnChanges:524288,AfterContentInit:1048576,AfterContentChecked:2097152,AfterViewInit:4194304,AfterViewChecked:8388608,EmbeddedViews:16777216,ComponentView:33554432,TypeContentQuery:67108864,TypeViewQuery:134217728,StaticQuery:268435456,DynamicQuery:536870912,CatQuery:201326592,Types:201347067},DepFlags={None:0,SkipSelf:1,Optional:2,Value:8},ArgumentType={Inline:0,Dynamic:1},BindingFlags={TypeElementAttribute:1,TypeElementClass:2,TypeElementStyle:4,TypeProperty:8,SyntheticProperty:16,SyntheticHostProperty:32,CatSyntheticProperty:48,Types:15},QueryBindingType={First:0,All:1},QueryValueType={ElementRef:0,RenderElement:1,TemplateRef:2,ViewContainerRef:3,Provider:4},ViewFlags={None:0,OnPush:2},MissingTranslationStrategy={Error:0,Warning:1,Ignore:2};MissingTranslationStrategy[MissingTranslationStrategy.Error]="Error",MissingTranslationStrategy[MissingTranslationStrategy.Warning]="Warning",MissingTranslationStrategy[MissingTranslationStrategy.Ignore]="Ignore";var core=Object.freeze({Inject:Inject,createInject:createInject,createInjectionToken:createInjectionToken,Attribute:Attribute,createAttribute:createAttribute,Query:Query,createContentChildren:createContentChildren,createContentChild:createContentChild,createViewChildren:createViewChildren,createViewChild:createViewChild,Directive:Directive,createDirective:createDirective,Component:Component,ViewEncapsulation:ViewEncapsulation,ChangeDetectionStrategy:ChangeDetectionStrategy,createComponent:createComponent,Pipe:Pipe,createPipe:createPipe,Input:Input,createInput:createInput,Output:Output,createOutput:createOutput,HostBinding:HostBinding,createHostBinding:createHostBinding,HostListener:HostListener,createHostListener:createHostListener,NgModule:NgModule,createNgModule:createNgModule,ModuleWithProviders:ModuleWithProviders,SchemaMetadata:SchemaMetadata,CUSTOM_ELEMENTS_SCHEMA:CUSTOM_ELEMENTS_SCHEMA,NO_ERRORS_SCHEMA:NO_ERRORS_SCHEMA,createOptional:createOptional,createInjectable:createInjectable,createSelf:createSelf,createSkipSelf:createSkipSelf,createHost:createHost,Type:Type,SecurityContext:SecurityContext,NodeFlags:NodeFlags,DepFlags:DepFlags,ArgumentType:ArgumentType,BindingFlags:BindingFlags,QueryBindingType:QueryBindingType,QueryValueType:QueryValueType,ViewFlags:ViewFlags,MissingTranslationStrategy:MissingTranslationStrategy,MetadataFactory:MetadataFactory,Route:Route}),DASH_CASE_REGEXP=/-+([a-z0-9])/g,ValueTransformer=function(){function ValueTransformer(){}return ValueTransformer.prototype.visitArray=function(arr,context){var _this=this;return arr.map(function(value){return visitValue(value,_this,context)})},ValueTransformer.prototype.visitStringMap=function(map,context){var _this=this,result={};return Object.keys(map).forEach(function(key){result[key]=visitValue(map[key],_this,context)}),result},ValueTransformer.prototype.visitPrimitive=function(value,context){return value},ValueTransformer.prototype.visitOther=function(value,context){return value},ValueTransformer}(),SyncAsync={assertSync:function(value){if(isPromise(value))throw new Error("Illegal state: value cannot be a promise");return value},then:function(value,cb){return isPromise(value)?value.then(cb):cb(value)},all:function(syncAsyncValues){return syncAsyncValues.some(isPromise)?Promise.all(syncAsyncValues):syncAsyncValues}},ERROR_SYNTAX_ERROR="ngSyntaxError",ERROR_PARSE_ERRORS="ngParseErrors",STRING_MAP_PROTO=Object.getPrototypeOf({}),Version=function(){function Version(full){this.full=full;var splits=full.split(".");this.major=splits[0],this.minor=splits[1],this.patch=splits.slice(2).join(".")}return Version}(),VERSION$1=new Version("5.2.8"),TextAst=function(){function TextAst(value,ngContentIndex,sourceSpan){this.value=value,this.ngContentIndex=ngContentIndex,this.sourceSpan=sourceSpan}return TextAst.prototype.visit=function(visitor,context){return visitor.visitText(this,context)},TextAst}(),BoundTextAst=function(){function BoundTextAst(value,ngContentIndex,sourceSpan){this.value=value,this.ngContentIndex=ngContentIndex,this.sourceSpan=sourceSpan}return BoundTextAst.prototype.visit=function(visitor,context){return visitor.visitBoundText(this,context)},BoundTextAst}(),AttrAst=function(){function AttrAst(name,value,sourceSpan){this.name=name,this.value=value,this.sourceSpan=sourceSpan}return AttrAst.prototype.visit=function(visitor,context){return visitor.visitAttr(this,context)},AttrAst}(),BoundElementPropertyAst=function(){function BoundElementPropertyAst(name,type,securityContext,value,unit,sourceSpan){this.name=name,this.type=type,this.securityContext=securityContext,this.value=value,this.unit=unit,this.sourceSpan=sourceSpan,this.isAnimation=this.type===PropertyBindingType.Animation}return BoundElementPropertyAst.prototype.visit=function(visitor,context){return visitor.visitElementProperty(this,context)},BoundElementPropertyAst}(),BoundEventAst=function(){function BoundEventAst(name,target,phase,handler,sourceSpan){this.name=name,this.target=target,this.phase=phase,this.handler=handler,this.sourceSpan=sourceSpan,this.fullName=BoundEventAst.calcFullName(this.name,this.target,this.phase),this.isAnimation=!!this.phase}return BoundEventAst.calcFullName=function(name,target,phase){return target?target+":"+name:phase?"@"+name+"."+phase:name},BoundEventAst.prototype.visit=function(visitor,context){return visitor.visitEvent(this,context)},BoundEventAst}(),ReferenceAst=function(){function ReferenceAst(name,value,sourceSpan){this.name=name,this.value=value,this.sourceSpan=sourceSpan}return ReferenceAst.prototype.visit=function(visitor,context){return visitor.visitReference(this,context)},ReferenceAst}(),VariableAst=function(){function VariableAst(name,value,sourceSpan){this.name=name,this.value=value,this.sourceSpan=sourceSpan}return VariableAst.prototype.visit=function(visitor,context){return visitor.visitVariable(this,context)},VariableAst}(),ElementAst=function(){function ElementAst(name,attrs,inputs,outputs,references,directives,providers,hasViewContainer,queryMatches,children,ngContentIndex,sourceSpan,endSourceSpan){this.name=name,this.attrs=attrs,this.inputs=inputs,this.outputs=outputs,this.references=references,this.directives=directives,this.providers=providers,this.hasViewContainer=hasViewContainer,this.queryMatches=queryMatches,this.children=children,this.ngContentIndex=ngContentIndex,this.sourceSpan=sourceSpan,this.endSourceSpan=endSourceSpan}return ElementAst.prototype.visit=function(visitor,context){return visitor.visitElement(this,context)},ElementAst}(),EmbeddedTemplateAst=function(){function EmbeddedTemplateAst(attrs,outputs,references,variables,directives,providers,hasViewContainer,queryMatches,children,ngContentIndex,sourceSpan){this.attrs=attrs,this.outputs=outputs,this.references=references,this.variables=variables,this.directives=directives,this.providers=providers,this.hasViewContainer=hasViewContainer,this.queryMatches=queryMatches,this.children=children,this.ngContentIndex=ngContentIndex,this.sourceSpan=sourceSpan}return EmbeddedTemplateAst.prototype.visit=function(visitor,context){return visitor.visitEmbeddedTemplate(this,context)},EmbeddedTemplateAst}(),BoundDirectivePropertyAst=function(){function BoundDirectivePropertyAst(directiveName,templateName,value,sourceSpan){this.directiveName=directiveName,this.templateName=templateName,this.value=value,this.sourceSpan=sourceSpan}return BoundDirectivePropertyAst.prototype.visit=function(visitor,context){return visitor.visitDirectiveProperty(this,context)},BoundDirectivePropertyAst}(),DirectiveAst=function(){function DirectiveAst(directive,inputs,hostProperties,hostEvents,contentQueryStartId,sourceSpan){this.directive=directive,this.inputs=inputs,this.hostProperties=hostProperties,this.hostEvents=hostEvents,this.contentQueryStartId=contentQueryStartId,this.sourceSpan=sourceSpan}return DirectiveAst.prototype.visit=function(visitor,context){return visitor.visitDirective(this,context)},DirectiveAst}(),ProviderAst=function(){function ProviderAst(token,multiProvider,eager,providers,providerType,lifecycleHooks,sourceSpan){this.token=token,this.multiProvider=multiProvider,this.eager=eager,this.providers=providers,this.providerType=providerType,this.lifecycleHooks=lifecycleHooks,this.sourceSpan=sourceSpan}return ProviderAst.prototype.visit=function(visitor,context){return null},ProviderAst}(),ProviderAstType={PublicService:0,PrivateService:1,Component:2,Directive:3,Builtin:4};ProviderAstType[ProviderAstType.PublicService]="PublicService",ProviderAstType[ProviderAstType.PrivateService]="PrivateService",ProviderAstType[ProviderAstType.Component]="Component",ProviderAstType[ProviderAstType.Directive]="Directive",ProviderAstType[ProviderAstType.Builtin]="Builtin";var NgContentAst=function(){function NgContentAst(index,ngContentIndex,sourceSpan){this.index=index,this.ngContentIndex=ngContentIndex,this.sourceSpan=sourceSpan}return NgContentAst.prototype.visit=function(visitor,context){return visitor.visitNgContent(this,context)},NgContentAst}(),PropertyBindingType={Property:0,Attribute:1,Class:2,Style:3,Animation:4};PropertyBindingType[PropertyBindingType.Property]="Property",PropertyBindingType[PropertyBindingType.Attribute]="Attribute",PropertyBindingType[PropertyBindingType.Class]="Class",PropertyBindingType[PropertyBindingType.Style]="Style",PropertyBindingType[PropertyBindingType.Animation]="Animation";var NullTemplateVisitor=function(){function NullTemplateVisitor(){}return NullTemplateVisitor.prototype.visitNgContent=function(ast,context){},NullTemplateVisitor.prototype.visitEmbeddedTemplate=function(ast,context){},NullTemplateVisitor.prototype.visitElement=function(ast,context){},NullTemplateVisitor.prototype.visitReference=function(ast,context){},NullTemplateVisitor.prototype.visitVariable=function(ast,context){},NullTemplateVisitor.prototype.visitEvent=function(ast,context){},NullTemplateVisitor.prototype.visitElementProperty=function(ast,context){},NullTemplateVisitor.prototype.visitAttr=function(ast,context){},NullTemplateVisitor.prototype.visitBoundText=function(ast,context){},NullTemplateVisitor.prototype.visitText=function(ast,context){},NullTemplateVisitor.prototype.visitDirective=function(ast,context){},NullTemplateVisitor.prototype.visitDirectiveProperty=function(ast,context){},NullTemplateVisitor}(),RecursiveTemplateAstVisitor=function(_super){function RecursiveTemplateAstVisitor(){return _super.call(this)||this}return __extends(RecursiveTemplateAstVisitor,_super),RecursiveTemplateAstVisitor.prototype.visitEmbeddedTemplate=function(ast,context){return this.visitChildren(context,function(visit){visit(ast.attrs),visit(ast.references),visit(ast.variables),visit(ast.directives),visit(ast.providers),visit(ast.children)})},RecursiveTemplateAstVisitor.prototype.visitElement=function(ast,context){return this.visitChildren(context,function(visit){visit(ast.attrs),visit(ast.inputs),visit(ast.outputs),visit(ast.references),visit(ast.directives),visit(ast.providers),visit(ast.children)})},RecursiveTemplateAstVisitor.prototype.visitDirective=function(ast,context){return this.visitChildren(context,function(visit){visit(ast.inputs),visit(ast.hostProperties),visit(ast.hostEvents)})},RecursiveTemplateAstVisitor.prototype.visitChildren=function(context,cb){function visit(children){children&&children.length&&results.push(templateVisitAll(t,children,context))}var results=[],t=this;return cb(visit),[].concat.apply([],results)},RecursiveTemplateAstVisitor}(NullTemplateVisitor),CompilerConfig=function(){function CompilerConfig(_a){var _b=void 0===_a?{}:_a,_c=_b.defaultEncapsulation,defaultEncapsulation=void 0===_c?ViewEncapsulation.Emulated:_c,_d=_b.useJit,useJit=void 0===_d||_d,_e=_b.jitDevMode,jitDevMode=void 0!==_e&&_e,_f=_b.missingTranslation,missingTranslation=void 0===_f?null:_f,enableLegacyTemplate=_b.enableLegacyTemplate,preserveWhitespaces=_b.preserveWhitespaces,strictInjectionParameters=_b.strictInjectionParameters;this.defaultEncapsulation=defaultEncapsulation,this.useJit=!!useJit,this.jitDevMode=!!jitDevMode,this.missingTranslation=missingTranslation,this.enableLegacyTemplate=!0===enableLegacyTemplate,this.preserveWhitespaces=preserveWhitespacesDefault(noUndefined(preserveWhitespaces)),this.strictInjectionParameters=!0===strictInjectionParameters}return CompilerConfig}(),StaticSymbol=function(){function StaticSymbol(filePath,name,members){this.filePath=filePath,this.name=name,this.members=members}return StaticSymbol.prototype.assertNoMembers=function(){if(this.members.length)throw new Error("Illegal state: symbol without members expected, but got "+JSON.stringify(this)+".")},StaticSymbol}(),StaticSymbolCache=function(){function StaticSymbolCache(){this.cache=new Map}return StaticSymbolCache.prototype.get=function(declarationFile,name,members){members=members||[];var memberSuffix=members.length?"."+members.join("."):"",key='"'+declarationFile+'".'+name+memberSuffix,result=this.cache.get(key);return result||(result=new StaticSymbol(declarationFile,name,members),this.cache.set(key,result)),result},StaticSymbolCache}(),HOST_REG_EXP=/^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))|(\@[-\w]+)$/,_anonymousTypeIndex=0,CompileSummaryKind={Pipe:0,Directive:1,NgModule:2,Injectable:3};CompileSummaryKind[CompileSummaryKind.Pipe]="Pipe",CompileSummaryKind[CompileSummaryKind.Directive]="Directive",CompileSummaryKind[CompileSummaryKind.NgModule]="NgModule",CompileSummaryKind[CompileSummaryKind.Injectable]="Injectable";var CompileStylesheetMetadata=function(){function CompileStylesheetMetadata(_a){var _b=void 0===_a?{}:_a,moduleUrl=_b.moduleUrl,styles=_b.styles,styleUrls=_b.styleUrls;this.moduleUrl=moduleUrl||null,this.styles=_normalizeArray(styles),this.styleUrls=_normalizeArray(styleUrls)}return CompileStylesheetMetadata}(),CompileTemplateMetadata=function(){function CompileTemplateMetadata(_a){var encapsulation=_a.encapsulation,template=_a.template,templateUrl=_a.templateUrl,htmlAst=_a.htmlAst,styles=_a.styles,styleUrls=_a.styleUrls,externalStylesheets=_a.externalStylesheets,animations=_a.animations,ngContentSelectors=_a.ngContentSelectors,interpolation=_a.interpolation,isInline=_a.isInline,preserveWhitespaces=_a.preserveWhitespaces;if(this.encapsulation=encapsulation,this.template=template,this.templateUrl=templateUrl,this.htmlAst=htmlAst,this.styles=_normalizeArray(styles),this.styleUrls=_normalizeArray(styleUrls),this.externalStylesheets=_normalizeArray(externalStylesheets),this.animations=animations?flatten$1(animations):[],this.ngContentSelectors=ngContentSelectors||[],interpolation&&2!=interpolation.length)throw new Error("'interpolation' should have a start and an end symbol.");this.interpolation=interpolation,this.isInline=isInline,this.preserveWhitespaces=preserveWhitespaces}return CompileTemplateMetadata.prototype.toSummary=function(){return{ngContentSelectors:this.ngContentSelectors,encapsulation:this.encapsulation}},CompileTemplateMetadata}(),CompileDirectiveMetadata=function(){function CompileDirectiveMetadata(_a){var isHost=_a.isHost,type=_a.type,isComponent=_a.isComponent,selector=_a.selector,exportAs=_a.exportAs,changeDetection=_a.changeDetection,inputs=_a.inputs,outputs=_a.outputs,hostListeners=_a.hostListeners,hostProperties=_a.hostProperties,hostAttributes=_a.hostAttributes,providers=_a.providers,viewProviders=_a.viewProviders,queries=_a.queries,guards=_a.guards,viewQueries=_a.viewQueries,entryComponents=_a.entryComponents,template=_a.template,componentViewType=_a.componentViewType,rendererType=_a.rendererType,componentFactory=_a.componentFactory;this.isHost=!!isHost,this.type=type,this.isComponent=isComponent,this.selector=selector,this.exportAs=exportAs,this.changeDetection=changeDetection,this.inputs=inputs,this.outputs=outputs,this.hostListeners=hostListeners,this.hostProperties=hostProperties,this.hostAttributes=hostAttributes,this.providers=_normalizeArray(providers),this.viewProviders=_normalizeArray(viewProviders),this.queries=_normalizeArray(queries),this.guards=guards,this.viewQueries=_normalizeArray(viewQueries),this.entryComponents=_normalizeArray(entryComponents),this.template=template,this.componentViewType=componentViewType,this.rendererType=rendererType,this.componentFactory=componentFactory}return CompileDirectiveMetadata.create=function(_a){
230
230
  var isHost=_a.isHost,type=_a.type,isComponent=_a.isComponent,selector=_a.selector,exportAs=_a.exportAs,changeDetection=_a.changeDetection,inputs=_a.inputs,outputs=_a.outputs,host=_a.host,providers=_a.providers,viewProviders=_a.viewProviders,queries=_a.queries,guards=_a.guards,viewQueries=_a.viewQueries,entryComponents=_a.entryComponents,template=_a.template,componentViewType=_a.componentViewType,rendererType=_a.rendererType,componentFactory=_a.componentFactory,hostListeners={},hostProperties={},hostAttributes={};null!=host&&Object.keys(host).forEach(function(key){var value=host[key],matches=key.match(HOST_REG_EXP);null===matches?hostAttributes[key]=value:null!=matches[1]?hostProperties[matches[1]]=value:null!=matches[2]&&(hostListeners[matches[2]]=value)});var inputsMap={};null!=inputs&&inputs.forEach(function(bindConfig){var parts=splitAtColon(bindConfig,[bindConfig,bindConfig]);inputsMap[parts[0]]=parts[1]});var outputsMap={};return null!=outputs&&outputs.forEach(function(bindConfig){var parts=splitAtColon(bindConfig,[bindConfig,bindConfig]);outputsMap[parts[0]]=parts[1]}),new CompileDirectiveMetadata({isHost:isHost,type:type,isComponent:!!isComponent,selector:selector,exportAs:exportAs,changeDetection:changeDetection,inputs:inputsMap,outputs:outputsMap,hostListeners:hostListeners,hostProperties:hostProperties,hostAttributes:hostAttributes,providers:providers,viewProviders:viewProviders,queries:queries,guards:guards,viewQueries:viewQueries,entryComponents:entryComponents,template:template,componentViewType:componentViewType,rendererType:rendererType,componentFactory:componentFactory})},CompileDirectiveMetadata.prototype.toSummary=function(){return{summaryKind:CompileSummaryKind.Directive,type:this.type,isComponent:this.isComponent,selector:this.selector,exportAs:this.exportAs,inputs:this.inputs,outputs:this.outputs,hostListeners:this.hostListeners,hostProperties:this.hostProperties,hostAttributes:this.hostAttributes,providers:this.providers,viewProviders:this.viewProviders,queries:this.queries,guards:this.guards,viewQueries:this.viewQueries,entryComponents:this.entryComponents,changeDetection:this.changeDetection,template:this.template&&this.template.toSummary(),componentViewType:this.componentViewType,rendererType:this.rendererType,componentFactory:this.componentFactory}},CompileDirectiveMetadata}(),CompilePipeMetadata=function(){function CompilePipeMetadata(_a){var type=_a.type,name=_a.name,pure=_a.pure;this.type=type,this.name=name,this.pure=!!pure}return CompilePipeMetadata.prototype.toSummary=function(){return{summaryKind:CompileSummaryKind.Pipe,type:this.type,name:this.name,pure:this.pure}},CompilePipeMetadata}(),CompileNgModuleMetadata=function(){function CompileNgModuleMetadata(_a){var type=_a.type,providers=_a.providers,declaredDirectives=_a.declaredDirectives,exportedDirectives=_a.exportedDirectives,declaredPipes=_a.declaredPipes,exportedPipes=_a.exportedPipes,entryComponents=_a.entryComponents,bootstrapComponents=_a.bootstrapComponents,importedModules=_a.importedModules,exportedModules=_a.exportedModules,schemas=_a.schemas,transitiveModule=_a.transitiveModule,id=_a.id;this.type=type||null,this.declaredDirectives=_normalizeArray(declaredDirectives),this.exportedDirectives=_normalizeArray(exportedDirectives),this.declaredPipes=_normalizeArray(declaredPipes),this.exportedPipes=_normalizeArray(exportedPipes),this.providers=_normalizeArray(providers),this.entryComponents=_normalizeArray(entryComponents),this.bootstrapComponents=_normalizeArray(bootstrapComponents),this.importedModules=_normalizeArray(importedModules),this.exportedModules=_normalizeArray(exportedModules),this.schemas=_normalizeArray(schemas),this.id=id||null,this.transitiveModule=transitiveModule||null}return CompileNgModuleMetadata.prototype.toSummary=function(){var module=this.transitiveModule;return{summaryKind:CompileSummaryKind.NgModule,type:this.type,entryComponents:module.entryComponents,providers:module.providers,modules:module.modules,exportedDirectives:module.exportedDirectives,exportedPipes:module.exportedPipes}},CompileNgModuleMetadata}(),TransitiveCompileNgModuleMetadata=function(){function TransitiveCompileNgModuleMetadata(){this.directivesSet=new Set,this.directives=[],this.exportedDirectivesSet=new Set,this.exportedDirectives=[],this.pipesSet=new Set,this.pipes=[],this.exportedPipesSet=new Set,this.exportedPipes=[],this.modulesSet=new Set,this.modules=[],this.entryComponentsSet=new Set,this.entryComponents=[],this.providers=[]}return TransitiveCompileNgModuleMetadata.prototype.addProvider=function(provider,module){this.providers.push({provider:provider,module:module})},TransitiveCompileNgModuleMetadata.prototype.addDirective=function(id){this.directivesSet.has(id.reference)||(this.directivesSet.add(id.reference),this.directives.push(id))},TransitiveCompileNgModuleMetadata.prototype.addExportedDirective=function(id){this.exportedDirectivesSet.has(id.reference)||(this.exportedDirectivesSet.add(id.reference),this.exportedDirectives.push(id))},TransitiveCompileNgModuleMetadata.prototype.addPipe=function(id){this.pipesSet.has(id.reference)||(this.pipesSet.add(id.reference),this.pipes.push(id))},TransitiveCompileNgModuleMetadata.prototype.addExportedPipe=function(id){this.exportedPipesSet.has(id.reference)||(this.exportedPipesSet.add(id.reference),this.exportedPipes.push(id))},TransitiveCompileNgModuleMetadata.prototype.addModule=function(id){this.modulesSet.has(id.reference)||(this.modulesSet.add(id.reference),this.modules.push(id))},TransitiveCompileNgModuleMetadata.prototype.addEntryComponent=function(ec){this.entryComponentsSet.has(ec.componentType)||(this.entryComponentsSet.add(ec.componentType),this.entryComponents.push(ec))},TransitiveCompileNgModuleMetadata}(),ProviderMeta=function(){function ProviderMeta(token,_a){var useClass=_a.useClass,useValue=_a.useValue,useExisting=_a.useExisting,useFactory=_a.useFactory,deps=_a.deps,multi=_a.multi;this.token=token,this.useClass=useClass||null,this.useValue=useValue,this.useExisting=useExisting,this.useFactory=useFactory||null,this.dependencies=deps||null,this.multi=!!multi}return ProviderMeta}(),AstPath=function(){function AstPath(path$$1,position){void 0===position&&(position=-1),this.path=path$$1,this.position=position}return Object.defineProperty(AstPath.prototype,"empty",{get:function(){return!this.path||!this.path.length},enumerable:!0,configurable:!0}),Object.defineProperty(AstPath.prototype,"head",{get:function(){return this.path[0]},enumerable:!0,configurable:!0}),Object.defineProperty(AstPath.prototype,"tail",{get:function(){return this.path[this.path.length-1]},enumerable:!0,configurable:!0}),AstPath.prototype.parentOf=function(node){return node&&this.path[this.path.indexOf(node)-1]},AstPath.prototype.childOf=function(node){return this.path[this.path.indexOf(node)+1]},AstPath.prototype.first=function(ctor){for(var i=this.path.length-1;i>=0;i--){var item=this.path[i];if(item instanceof ctor)return item}},AstPath.prototype.push=function(node){this.path.push(node)},AstPath.prototype.pop=function(){return this.path.pop()},AstPath}(),Text=function(){function Text(value,sourceSpan){this.value=value,this.sourceSpan=sourceSpan}return Text.prototype.visit=function(visitor,context){return visitor.visitText(this,context)},Text}(),Expansion=function(){function Expansion(switchValue,type,cases,sourceSpan,switchValueSourceSpan){this.switchValue=switchValue,this.type=type,this.cases=cases,this.sourceSpan=sourceSpan,this.switchValueSourceSpan=switchValueSourceSpan}return Expansion.prototype.visit=function(visitor,context){return visitor.visitExpansion(this,context)},Expansion}(),ExpansionCase=function(){function ExpansionCase(value,expression,sourceSpan,valueSourceSpan,expSourceSpan){this.value=value,this.expression=expression,this.sourceSpan=sourceSpan,this.valueSourceSpan=valueSourceSpan,this.expSourceSpan=expSourceSpan}return ExpansionCase.prototype.visit=function(visitor,context){return visitor.visitExpansionCase(this,context)},ExpansionCase}(),Attribute$1=function(){function Attribute(name,value,sourceSpan,valueSpan){this.name=name,this.value=value,this.sourceSpan=sourceSpan,this.valueSpan=valueSpan}return Attribute.prototype.visit=function(visitor,context){return visitor.visitAttribute(this,context)},Attribute}(),Element=function(){function Element(name,attrs,children,sourceSpan,startSourceSpan,endSourceSpan){void 0===startSourceSpan&&(startSourceSpan=null),void 0===endSourceSpan&&(endSourceSpan=null),this.name=name,this.attrs=attrs,this.children=children,this.sourceSpan=sourceSpan,this.startSourceSpan=startSourceSpan,this.endSourceSpan=endSourceSpan}return Element.prototype.visit=function(visitor,context){return visitor.visitElement(this,context)},Element}(),Comment=function(){function Comment(value,sourceSpan){this.value=value,this.sourceSpan=sourceSpan}return Comment.prototype.visit=function(visitor,context){return visitor.visitComment(this,context)},Comment}(),RecursiveVisitor=function(){function RecursiveVisitor(){}return RecursiveVisitor.prototype.visitElement=function(ast,context){this.visitChildren(context,function(visit){visit(ast.attrs),visit(ast.children)})},RecursiveVisitor.prototype.visitAttribute=function(ast,context){},RecursiveVisitor.prototype.visitText=function(ast,context){},RecursiveVisitor.prototype.visitComment=function(ast,context){},RecursiveVisitor.prototype.visitExpansion=function(ast,context){return this.visitChildren(context,function(visit){visit(ast.cases)})},RecursiveVisitor.prototype.visitExpansionCase=function(ast,context){},RecursiveVisitor.prototype.visitChildren=function(context,cb){function visit(children){children&&results.push(visitAll(t,children,context))}var results=[],t=this;return cb(visit),[].concat.apply([],results)},RecursiveVisitor}(),INTERPOLATION_BLACKLIST_REGEXPS=[/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//],InterpolationConfig=function(){function InterpolationConfig(start,end){this.start=start,this.end=end}return InterpolationConfig.fromArray=function(markers){return markers?(assertInterpolationSymbols("interpolation",markers),new InterpolationConfig(markers[0],markers[1])):DEFAULT_INTERPOLATION_CONFIG},InterpolationConfig}(),DEFAULT_INTERPOLATION_CONFIG=new InterpolationConfig("{{","}}"),StyleWithImports=function(){function StyleWithImports(style,styleUrls){this.style=style,this.styleUrls=styleUrls}return StyleWithImports}(),CSS_IMPORT_REGEXP=/@import\s+(?:url\()?\s*(?:(?:['"]([^'"]*))|([^;\)\s]*))[^;]*;?/g,CSS_STRIPPABLE_COMMENT_REGEXP=/\/\*(?!#\s*(?:sourceURL|sourceMappingURL)=)[\s\S]+?\*\//g,URL_WITH_SCHEMA_REGEXP=/^([^:\/?#]+):/,TagContentType={RAW_TEXT:0,ESCAPABLE_RAW_TEXT:1,PARSABLE_DATA:2};TagContentType[TagContentType.RAW_TEXT]="RAW_TEXT",TagContentType[TagContentType.ESCAPABLE_RAW_TEXT]="ESCAPABLE_RAW_TEXT",TagContentType[TagContentType.PARSABLE_DATA]="PARSABLE_DATA";var NAMED_ENTITIES={Aacute:"Á",aacute:"á",Acirc:"Â",acirc:"â",acute:"´",AElig:"Æ",aelig:"æ",Agrave:"À",agrave:"à",alefsym:"ℵ",Alpha:"Α",alpha:"α",amp:"&",and:"∧",ang:"∠",apos:"'",Aring:"Å",aring:"å",asymp:"≈",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",bdquo:"„",Beta:"Β",beta:"β",brvbar:"¦",bull:"•",cap:"∩",Ccedil:"Ç",ccedil:"ç",cedil:"¸",cent:"¢",Chi:"Χ",chi:"χ",circ:"ˆ",clubs:"♣",cong:"≅",copy:"©",crarr:"↵",cup:"∪",curren:"¤",dagger:"†",Dagger:"‡",darr:"↓",dArr:"⇓",deg:"°",Delta:"Δ",delta:"δ",diams:"♦",divide:"÷",Eacute:"É",eacute:"é",Ecirc:"Ê",ecirc:"ê",Egrave:"È",egrave:"è",empty:"∅",emsp:" ",ensp:" ",Epsilon:"Ε",epsilon:"ε",equiv:"≡",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",exist:"∃",fnof:"ƒ",forall:"∀",frac12:"½",frac14:"¼",frac34:"¾",frasl:"⁄",Gamma:"Γ",gamma:"γ",ge:"≥",gt:">",harr:"↔",hArr:"⇔",hearts:"♥",hellip:"…",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",image:"ℑ",infin:"∞",int:"∫",Iota:"Ι",iota:"ι",iquest:"¿",isin:"∈",Iuml:"Ï",iuml:"ï",Kappa:"Κ",kappa:"κ",Lambda:"Λ",lambda:"λ",lang:"⟨",laquo:"«",larr:"←",lArr:"⇐",lceil:"⌈",ldquo:"“",le:"≤",lfloor:"⌊",lowast:"∗",loz:"◊",lrm:"‎",lsaquo:"‹",lsquo:"‘",lt:"<",macr:"¯",mdash:"—",micro:"µ",middot:"·",minus:"−",Mu:"Μ",mu:"μ",nabla:"∇",nbsp:" ",ndash:"–",ne:"≠",ni:"∋",not:"¬",notin:"∉",nsub:"⊄",Ntilde:"Ñ",ntilde:"ñ",Nu:"Ν",nu:"ν",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",OElig:"Œ",oelig:"œ",Ograve:"Ò",ograve:"ò",oline:"‾",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",oplus:"⊕",or:"∨",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",otimes:"⊗",Ouml:"Ö",ouml:"ö",para:"¶",permil:"‰",perp:"⊥",Phi:"Φ",phi:"φ",Pi:"Π",pi:"π",piv:"ϖ",plusmn:"±",pound:"£",prime:"′",Prime:"″",prod:"∏",prop:"∝",Psi:"Ψ",psi:"ψ",quot:'"',radic:"√",rang:"⟩",raquo:"»",rarr:"→",rArr:"⇒",rceil:"⌉",rdquo:"”",real:"ℜ",reg:"®",rfloor:"⌋",Rho:"Ρ",rho:"ρ",rlm:"‏",rsaquo:"›",rsquo:"’",sbquo:"‚",Scaron:"Š",scaron:"š",sdot:"⋅",sect:"§",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sim:"∼",spades:"♠",sub:"⊂",sube:"⊆",sum:"∑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supe:"⊇",szlig:"ß",Tau:"Τ",tau:"τ",there4:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thinsp:" ",THORN:"Þ",thorn:"þ",tilde:"˜",times:"×",trade:"™",Uacute:"Ú",uacute:"ú",uarr:"↑",uArr:"⇑",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",Uuml:"Ü",uuml:"ü",weierp:"℘",Xi:"Ξ",xi:"ξ",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ",Yuml:"Ÿ",Zeta:"Ζ",zeta:"ζ",zwj:"‍",zwnj:"‌"},NGSP_UNICODE="";NAMED_ENTITIES.ngsp=NGSP_UNICODE;/**
231
231
  * @license
232
232
  * Copyright Google Inc. All Rights Reserved.
@@ -235,8 +235,8 @@ var isHost=_a.isHost,type=_a.type,isComponent=_a.isComponent,selector=_a.selecto
235
235
  * found in the LICENSE file at https://angular.io/license
236
236
  */
237
237
  var NG_CONTENT_SELECT_ATTR="select",LINK_ELEMENT="link",LINK_STYLE_REL_ATTR="rel",LINK_STYLE_HREF_ATTR="href",LINK_STYLE_REL_VALUE="stylesheet",STYLE_ELEMENT="style",SCRIPT_ELEMENT="script",NG_NON_BINDABLE_ATTR="ngNonBindable",NG_PROJECT_AS="ngProjectAs",PreparsedElementType={NG_CONTENT:0,STYLE:1,STYLESHEET:2,SCRIPT:3,OTHER:4};PreparsedElementType[PreparsedElementType.NG_CONTENT]="NG_CONTENT",PreparsedElementType[PreparsedElementType.STYLE]="STYLE",PreparsedElementType[PreparsedElementType.STYLESHEET]="STYLESHEET",PreparsedElementType[PreparsedElementType.SCRIPT]="SCRIPT",PreparsedElementType[PreparsedElementType.OTHER]="OTHER";var PreparsedElement=function(){function PreparsedElement(type,selectAttr,hrefAttr,nonBindable,projectAs){this.type=type,this.selectAttr=selectAttr,this.hrefAttr=hrefAttr,this.nonBindable=nonBindable,this.projectAs=projectAs}return PreparsedElement}(),DirectiveNormalizer=function(){function DirectiveNormalizer(_resourceLoader,_urlResolver,_htmlParser,_config){this._resourceLoader=_resourceLoader,this._urlResolver=_urlResolver,this._htmlParser=_htmlParser,this._config=_config,this._resourceLoaderCache=new Map}return DirectiveNormalizer.prototype.clearCache=function(){this._resourceLoaderCache.clear()},DirectiveNormalizer.prototype.clearCacheFor=function(normalizedDirective){var _this=this;if(normalizedDirective.isComponent){var template=normalizedDirective.template;this._resourceLoaderCache.delete(template.templateUrl),template.externalStylesheets.forEach(function(stylesheet){_this._resourceLoaderCache.delete(stylesheet.moduleUrl)})}},DirectiveNormalizer.prototype._fetch=function(url){var result=this._resourceLoaderCache.get(url);return result||(result=this._resourceLoader.get(url),this._resourceLoaderCache.set(url,result)),result},DirectiveNormalizer.prototype.normalizeTemplate=function(prenormData){var _this=this;if(isDefined(prenormData.template)){if(isDefined(prenormData.templateUrl))throw syntaxError("'"+stringify(prenormData.componentType)+"' component cannot define both template and templateUrl");if("string"!=typeof prenormData.template)throw syntaxError("The template specified for component "+stringify(prenormData.componentType)+" is not a string")}else{if(!isDefined(prenormData.templateUrl))throw syntaxError("No template specified for component "+stringify(prenormData.componentType));if("string"!=typeof prenormData.templateUrl)throw syntaxError("The templateUrl specified for component "+stringify(prenormData.componentType)+" is not a string")}if(isDefined(prenormData.preserveWhitespaces)&&"boolean"!=typeof prenormData.preserveWhitespaces)throw syntaxError("The preserveWhitespaces option for component "+stringify(prenormData.componentType)+" must be a boolean");return SyncAsync.then(this._preParseTemplate(prenormData),function(preparsedTemplate){return _this._normalizeTemplateMetadata(prenormData,preparsedTemplate)})},DirectiveNormalizer.prototype._preParseTemplate=function(prenomData){var template,templateUrl,_this=this;return null!=prenomData.template?(template=prenomData.template,templateUrl=prenomData.moduleUrl):(templateUrl=this._urlResolver.resolve(prenomData.moduleUrl,prenomData.templateUrl),template=this._fetch(templateUrl)),SyncAsync.then(template,function(template){return _this._preparseLoadedTemplate(prenomData,template,templateUrl)})},DirectiveNormalizer.prototype._preparseLoadedTemplate=function(prenormData,template,templateAbsUrl){var isInline=!!prenormData.template,interpolationConfig=InterpolationConfig.fromArray(prenormData.interpolation),rootNodesAndErrors=this._htmlParser.parse(template,templateSourceUrl({reference:prenormData.ngModuleType},{type:{reference:prenormData.componentType}},{isInline:isInline,templateUrl:templateAbsUrl}),!0,interpolationConfig);if(rootNodesAndErrors.errors.length>0){throw syntaxError("Template parse errors:\n"+rootNodesAndErrors.errors.join("\n"))}var templateMetadataStyles=this._normalizeStylesheet(new CompileStylesheetMetadata({styles:prenormData.styles,moduleUrl:prenormData.moduleUrl})),visitor=new TemplatePreparseVisitor;visitAll(visitor,rootNodesAndErrors.rootNodes);var templateStyles=this._normalizeStylesheet(new CompileStylesheetMetadata({styles:visitor.styles,styleUrls:visitor.styleUrls,moduleUrl:templateAbsUrl}));return{template:template,templateUrl:templateAbsUrl,isInline:isInline,htmlAst:rootNodesAndErrors,styles:templateMetadataStyles.styles.concat(templateStyles.styles),inlineStyleUrls:templateMetadataStyles.styleUrls.concat(templateStyles.styleUrls),styleUrls:this._normalizeStylesheet(new CompileStylesheetMetadata({styleUrls:prenormData.styleUrls,moduleUrl:prenormData.moduleUrl})).styleUrls,ngContentSelectors:visitor.ngContentSelectors}},DirectiveNormalizer.prototype._normalizeTemplateMetadata=function(prenormData,preparsedTemplate){var _this=this;return SyncAsync.then(this._loadMissingExternalStylesheets(preparsedTemplate.styleUrls.concat(preparsedTemplate.inlineStyleUrls)),function(externalStylesheets){return _this._normalizeLoadedTemplateMetadata(prenormData,preparsedTemplate,externalStylesheets)})},DirectiveNormalizer.prototype._normalizeLoadedTemplateMetadata=function(prenormData,preparsedTemplate,stylesheets){var _this=this,styles=preparsedTemplate.styles.slice();this._inlineStyles(preparsedTemplate.inlineStyleUrls,stylesheets,styles);var styleUrls=preparsedTemplate.styleUrls,externalStylesheets=styleUrls.map(function(styleUrl){var stylesheet=stylesheets.get(styleUrl),styles=stylesheet.styles.slice();return _this._inlineStyles(stylesheet.styleUrls,stylesheets,styles),new CompileStylesheetMetadata({moduleUrl:styleUrl,styles:styles})}),encapsulation=prenormData.encapsulation;return null==encapsulation&&(encapsulation=this._config.defaultEncapsulation),encapsulation===ViewEncapsulation.Emulated&&0===styles.length&&0===styleUrls.length&&(encapsulation=ViewEncapsulation.None),new CompileTemplateMetadata({encapsulation:encapsulation,template:preparsedTemplate.template,templateUrl:preparsedTemplate.templateUrl,htmlAst:preparsedTemplate.htmlAst,styles:styles,styleUrls:styleUrls,ngContentSelectors:preparsedTemplate.ngContentSelectors,animations:prenormData.animations,interpolation:prenormData.interpolation,isInline:preparsedTemplate.isInline,externalStylesheets:externalStylesheets,preserveWhitespaces:preserveWhitespacesDefault(prenormData.preserveWhitespaces,this._config.preserveWhitespaces)})},DirectiveNormalizer.prototype._inlineStyles=function(styleUrls,stylesheets,targetStyles){var _this=this;styleUrls.forEach(function(styleUrl){var stylesheet=stylesheets.get(styleUrl);stylesheet.styles.forEach(function(style){return targetStyles.push(style)}),_this._inlineStyles(stylesheet.styleUrls,stylesheets,targetStyles)})},DirectiveNormalizer.prototype._loadMissingExternalStylesheets=function(styleUrls,loadedStylesheets){var _this=this;return void 0===loadedStylesheets&&(loadedStylesheets=new Map),SyncAsync.then(SyncAsync.all(styleUrls.filter(function(styleUrl){return!loadedStylesheets.has(styleUrl)}).map(function(styleUrl){return SyncAsync.then(_this._fetch(styleUrl),function(loadedStyle){var stylesheet=_this._normalizeStylesheet(new CompileStylesheetMetadata({styles:[loadedStyle],moduleUrl:styleUrl}));return loadedStylesheets.set(styleUrl,stylesheet),_this._loadMissingExternalStylesheets(stylesheet.styleUrls,loadedStylesheets)})})),function(_){return loadedStylesheets})},DirectiveNormalizer.prototype._normalizeStylesheet=function(stylesheet){var _this=this,moduleUrl=stylesheet.moduleUrl,allStyleUrls=stylesheet.styleUrls.filter(isStyleUrlResolvable).map(function(url){return _this._urlResolver.resolve(moduleUrl,url)}),allStyles=stylesheet.styles.map(function(style){var styleWithImports=extractStyleUrls(_this._urlResolver,moduleUrl,style);return allStyleUrls.push.apply(allStyleUrls,styleWithImports.styleUrls),styleWithImports.style});return new CompileStylesheetMetadata({styles:allStyles,styleUrls:allStyleUrls,moduleUrl:moduleUrl})},DirectiveNormalizer}(),TemplatePreparseVisitor=function(){function TemplatePreparseVisitor(){this.ngContentSelectors=[],this.styles=[],this.styleUrls=[],this.ngNonBindableStackCount=0}return TemplatePreparseVisitor.prototype.visitElement=function(ast,context){var preparsedElement=preparseElement(ast);switch(preparsedElement.type){case PreparsedElementType.NG_CONTENT:0===this.ngNonBindableStackCount&&this.ngContentSelectors.push(preparsedElement.selectAttr);break;case PreparsedElementType.STYLE:var textContent_1="";ast.children.forEach(function(child){child instanceof Text&&(textContent_1+=child.value)}),this.styles.push(textContent_1);break;case PreparsedElementType.STYLESHEET:this.styleUrls.push(preparsedElement.hrefAttr)}return preparsedElement.nonBindable&&this.ngNonBindableStackCount++,visitAll(this,ast.children),preparsedElement.nonBindable&&this.ngNonBindableStackCount--,null},TemplatePreparseVisitor.prototype.visitExpansion=function(ast,context){visitAll(this,ast.cases)},TemplatePreparseVisitor.prototype.visitExpansionCase=function(ast,context){visitAll(this,ast.expression)},TemplatePreparseVisitor.prototype.visitComment=function(ast,context){return null},TemplatePreparseVisitor.prototype.visitAttribute=function(ast,context){return null},TemplatePreparseVisitor.prototype.visitText=function(ast,context){return null},TemplatePreparseVisitor}(),QUERY_METADATA_IDENTIFIERS=[createViewChild,createViewChildren,createContentChild,createContentChildren],DirectiveResolver=function(){function DirectiveResolver(_reflector){this._reflector=_reflector}return DirectiveResolver.prototype.isDirective=function(type){var typeMetadata=this._reflector.annotations(resolveForwardRef(type));return typeMetadata&&typeMetadata.some(isDirectiveMetadata)},DirectiveResolver.prototype.resolve=function(type,throwIfNotFound){void 0===throwIfNotFound&&(throwIfNotFound=!0);var typeMetadata=this._reflector.annotations(resolveForwardRef(type));if(typeMetadata){var metadata=findLast(typeMetadata,isDirectiveMetadata);if(metadata){var propertyMetadata=this._reflector.propMetadata(type),guards=this._reflector.guards(type);return this._mergeWithPropertyMetadata(metadata,propertyMetadata,guards,type)}}if(throwIfNotFound)throw new Error("No Directive annotation found on "+stringify(type));return null},DirectiveResolver.prototype._mergeWithPropertyMetadata=function(dm,propertyMetadata,guards,directiveType){var inputs=[],outputs=[],host={},queries={};return Object.keys(propertyMetadata).forEach(function(propName){var input=findLast(propertyMetadata[propName],function(a){return createInput.isTypeOf(a)});input&&(input.bindingPropertyName?inputs.push(propName+": "+input.bindingPropertyName):inputs.push(propName));var output=findLast(propertyMetadata[propName],function(a){return createOutput.isTypeOf(a)});output&&(output.bindingPropertyName?outputs.push(propName+": "+output.bindingPropertyName):outputs.push(propName)),propertyMetadata[propName].filter(function(a){return createHostBinding.isTypeOf(a)}).forEach(function(hostBinding){if(hostBinding.hostPropertyName){var startWith=hostBinding.hostPropertyName[0];if("("===startWith)throw new Error("@HostBinding can not bind to events. Use @HostListener instead.");if("["===startWith)throw new Error("@HostBinding parameter should be a property name, 'class.<name>', or 'attr.<name>'.");host["["+hostBinding.hostPropertyName+"]"]=propName}else host["["+propName+"]"]=propName}),propertyMetadata[propName].filter(function(a){return createHostListener.isTypeOf(a)}).forEach(function(hostListener){var args=hostListener.args||[];host["("+hostListener.eventName+")"]=propName+"("+args.join(",")+")"});var query=findLast(propertyMetadata[propName],function(a){return QUERY_METADATA_IDENTIFIERS.some(function(i){return i.isTypeOf(a)})});query&&(queries[propName]=query)}),this._merge(dm,inputs,outputs,host,queries,guards,directiveType)},DirectiveResolver.prototype._extractPublicName=function(def){return splitAtColon(def,[null,def])[1].trim()},DirectiveResolver.prototype._dedupeBindings=function(bindings){for(var names=new Set,publicNames=new Set,reversedResult=[],i=bindings.length-1;i>=0;i--){var binding=bindings[i],name_1=this._extractPublicName(binding);publicNames.add(name_1),names.has(name_1)||(names.add(name_1),reversedResult.push(binding))}return reversedResult.reverse()},DirectiveResolver.prototype._merge=function(directive,inputs,outputs,host,queries,guards,directiveType){var mergedInputs=this._dedupeBindings(directive.inputs?directive.inputs.concat(inputs):inputs),mergedOutputs=this._dedupeBindings(directive.outputs?directive.outputs.concat(outputs):outputs),mergedHost=directive.host?__assign({},directive.host,host):host,mergedQueries=directive.queries?__assign({},directive.queries,queries):queries;if(createComponent.isTypeOf(directive)){var comp=directive;return createComponent({selector:comp.selector,inputs:mergedInputs,outputs:mergedOutputs,host:mergedHost,exportAs:comp.exportAs,moduleId:comp.moduleId,queries:mergedQueries,changeDetection:comp.changeDetection,providers:comp.providers,viewProviders:comp.viewProviders,entryComponents:comp.entryComponents,template:comp.template,templateUrl:comp.templateUrl,styles:comp.styles,styleUrls:comp.styleUrls,encapsulation:comp.encapsulation,animations:comp.animations,interpolation:comp.interpolation,preserveWhitespaces:directive.preserveWhitespaces})}return createDirective({selector:directive.selector,inputs:mergedInputs,outputs:mergedOutputs,host:mergedHost,exportAs:directive.exportAs,queries:mergedQueries,providers:directive.providers,guards:guards})},DirectiveResolver}(),$EOF=0,$TAB=9,$LF=10,$VTAB=11,$FF=12,$CR=13,$SPACE=32,$DQ=34,$$=36,$SQ=39,$PLUS=43,$MINUS=45,$SLASH=47,$SEMICOLON=59,$EQ=61,$GT=62,$0=48,$9=57,$A=65,$E=69,$F=70,$Z=90,$_=95,$a=97,$e=101,$f=102,$n=110,$r=114,$t=116,$v=118,$z=122,$LBRACE=123,$NBSP=160,$BT=96,TokenType={Character:0,Identifier:1,Keyword:2,String:3,Operator:4,Number:5,Error:6};TokenType[TokenType.Character]="Character",TokenType[TokenType.Identifier]="Identifier",TokenType[TokenType.Keyword]="Keyword",TokenType[TokenType.String]="String",TokenType[TokenType.Operator]="Operator",TokenType[TokenType.Number]="Number",TokenType[TokenType.Error]="Error";var KEYWORDS=["var","let","as","null","undefined","true","false","if","else","this"],Lexer=function(){function Lexer(){}return Lexer.prototype.tokenize=function(text){for(var scanner=new _Scanner(text),tokens=[],token=scanner.scanToken();null!=token;)tokens.push(token),token=scanner.scanToken();return tokens},Lexer}(),Token=function(){function Token(index,type,numValue,strValue){this.index=index,this.type=type,this.numValue=numValue,this.strValue=strValue}return Token.prototype.isCharacter=function(code){return this.type==TokenType.Character&&this.numValue==code},Token.prototype.isNumber=function(){return this.type==TokenType.Number},Token.prototype.isString=function(){return this.type==TokenType.String},Token.prototype.isOperator=function(operater){return this.type==TokenType.Operator&&this.strValue==operater},Token.prototype.isIdentifier=function(){return this.type==TokenType.Identifier},Token.prototype.isKeyword=function(){return this.type==TokenType.Keyword},Token.prototype.isKeywordLet=function(){return this.type==TokenType.Keyword&&"let"==this.strValue},Token.prototype.isKeywordAs=function(){return this.type==TokenType.Keyword&&"as"==this.strValue},Token.prototype.isKeywordNull=function(){return this.type==TokenType.Keyword&&"null"==this.strValue},Token.prototype.isKeywordUndefined=function(){return this.type==TokenType.Keyword&&"undefined"==this.strValue},Token.prototype.isKeywordTrue=function(){return this.type==TokenType.Keyword&&"true"==this.strValue},Token.prototype.isKeywordFalse=function(){return this.type==TokenType.Keyword&&"false"==this.strValue},Token.prototype.isKeywordThis=function(){return this.type==TokenType.Keyword&&"this"==this.strValue},Token.prototype.isError=function(){return this.type==TokenType.Error},Token.prototype.toNumber=function(){return this.type==TokenType.Number?this.numValue:-1},Token.prototype.toString=function(){switch(this.type){case TokenType.Character:case TokenType.Identifier:case TokenType.Keyword:case TokenType.Operator:case TokenType.String:case TokenType.Error:return this.strValue;case TokenType.Number:return this.numValue.toString();default:return null}},Token}(),EOF=new Token(-1,TokenType.Character,0,""),_Scanner=function(){function _Scanner(input){this.input=input,this.peek=0,this.index=-1,this.length=input.length,this.advance()}return _Scanner.prototype.advance=function(){this.peek=++this.index>=this.length?$EOF:this.input.charCodeAt(this.index)},_Scanner.prototype.scanToken=function(){for(var input=this.input,length=this.length,peek=this.peek,index=this.index;peek<=$SPACE;){if(++index>=length){peek=$EOF;break}peek=input.charCodeAt(index)}if(this.peek=peek,this.index=index,index>=length)return null;if(isIdentifierStart(peek))return this.scanIdentifier();if(isDigit(peek))return this.scanNumber(index);var start=index;switch(peek){case 46:return this.advance(),isDigit(this.peek)?this.scanNumber(start):newCharacterToken(start,46);case 40:case 41:case $LBRACE:case 125:case 91:case 93:case 44:case 58:case $SEMICOLON:return this.scanCharacter(start,peek);case $SQ:case $DQ:return this.scanString();case 35:case $PLUS:case $MINUS:case 42:case $SLASH:case 37:case 94:return this.scanOperator(start,String.fromCharCode(peek));case 63:return this.scanComplexOperator(start,"?",46,".");case 60:case $GT:return this.scanComplexOperator(start,String.fromCharCode(peek),$EQ,"=");case 33:case $EQ:return this.scanComplexOperator(start,String.fromCharCode(peek),$EQ,"=",$EQ,"=");case 38:return this.scanComplexOperator(start,"&",38,"&");case 124:return this.scanComplexOperator(start,"|",124,"|");case $NBSP:for(;isWhitespace(this.peek);)this.advance();return this.scanToken()}return this.advance(),this.error("Unexpected character ["+String.fromCharCode(peek)+"]",0)},_Scanner.prototype.scanCharacter=function(start,code){return this.advance(),newCharacterToken(start,code)},_Scanner.prototype.scanOperator=function(start,str){return this.advance(),newOperatorToken(start,str)},_Scanner.prototype.scanComplexOperator=function(start,one,twoCode,two,threeCode,three){this.advance();var str=one;return this.peek==twoCode&&(this.advance(),str+=two),null!=threeCode&&this.peek==threeCode&&(this.advance(),str+=three),newOperatorToken(start,str)},_Scanner.prototype.scanIdentifier=function(){var start=this.index;for(this.advance();isIdentifierPart(this.peek);)this.advance();var str=this.input.substring(start,this.index);return KEYWORDS.indexOf(str)>-1?newKeywordToken(start,str):newIdentifierToken(start,str)},_Scanner.prototype.scanNumber=function(start){var simple=this.index===start;for(this.advance();;){if(isDigit(this.peek));else if(46==this.peek)simple=!1;else{if(!isExponentStart(this.peek))break;if(this.advance(),isExponentSign(this.peek)&&this.advance(),!isDigit(this.peek))return this.error("Invalid exponent",-1);simple=!1}this.advance()}var str=this.input.substring(start,this.index);return newNumberToken(start,simple?parseIntAutoRadix(str):parseFloat(str))},_Scanner.prototype.scanString=function(){var start=this.index,quote=this.peek;this.advance();for(var buffer="",marker=this.index,input=this.input;this.peek!=quote;)if(92==this.peek){buffer+=input.substring(marker,this.index),this.advance();var unescapedCode=void 0;if(this.peek=this.peek,117==this.peek){var hex=input.substring(this.index+1,this.index+5);if(!/^[0-9a-f]+$/i.test(hex))return this.error("Invalid unicode escape [\\u"+hex+"]",0);unescapedCode=parseInt(hex,16);for(var i=0;i<5;i++)this.advance()}else unescapedCode=unescape(this.peek),this.advance();buffer+=String.fromCharCode(unescapedCode),marker=this.index}else{if(this.peek==$EOF)return this.error("Unterminated quote",0);this.advance()}var last=input.substring(marker,this.index);return this.advance(),newStringToken(start,buffer+last)},_Scanner.prototype.error=function(message,offset){var position=this.index+offset;return newErrorToken(position,"Lexer Error: "+message+" at column "+position+" in expression ["+this.input+"]")},_Scanner}(),ParserError=function(){function ParserError(message,input,errLocation,ctxLocation){this.input=input,this.errLocation=errLocation,this.ctxLocation=ctxLocation,this.message="Parser Error: "+message+" "+errLocation+" ["+input+"] in "+ctxLocation}return ParserError}(),ParseSpan=function(){function ParseSpan(start,end){this.start=start,this.end=end}return ParseSpan}(),AST=function(){function AST(span){this.span=span}return AST.prototype.visit=function(visitor,context){return void 0===context&&(context=null),null},AST.prototype.toString=function(){return"AST"},AST}(),Quote=function(_super){function Quote(span,prefix,uninterpretedExpression,location){var _this=_super.call(this,span)||this;return _this.prefix=prefix,_this.uninterpretedExpression=uninterpretedExpression,_this.location=location,_this}return __extends(Quote,_super),Quote.prototype.visit=function(visitor,context){return void 0===context&&(context=null),visitor.visitQuote(this,context)},Quote.prototype.toString=function(){return"Quote"},Quote}(AST),EmptyExpr=function(_super){function EmptyExpr(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(EmptyExpr,_super),EmptyExpr.prototype.visit=function(visitor,context){void 0===context&&(context=null)},EmptyExpr}(AST),ImplicitReceiver=function(_super){function ImplicitReceiver(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(ImplicitReceiver,_super),ImplicitReceiver.prototype.visit=function(visitor,context){return void 0===context&&(context=null),visitor.visitImplicitReceiver(this,context)},ImplicitReceiver}(AST),Chain=function(_super){function Chain(span,expressions){var _this=_super.call(this,span)||this;return _this.expressions=expressions,_this}return __extends(Chain,_super),Chain.prototype.visit=function(visitor,context){return void 0===context&&(context=null),visitor.visitChain(this,context)},Chain}(AST),Conditional=function(_super){function Conditional(span,condition,trueExp,falseExp){var _this=_super.call(this,span)||this;return _this.condition=condition,_this.trueExp=trueExp,_this.falseExp=falseExp,_this}return __extends(Conditional,_super),Conditional.prototype.visit=function(visitor,context){return void 0===context&&(context=null),visitor.visitConditional(this,context)},Conditional}(AST),PropertyRead=function(_super){function PropertyRead(span,receiver,name){var _this=_super.call(this,span)||this;return _this.receiver=receiver,_this.name=name,_this}return __extends(PropertyRead,_super),PropertyRead.prototype.visit=function(visitor,context){return void 0===context&&(context=null),visitor.visitPropertyRead(this,context)},PropertyRead}(AST),PropertyWrite=function(_super){function PropertyWrite(span,receiver,name,value){var _this=_super.call(this,span)||this;return _this.receiver=receiver,_this.name=name,_this.value=value,_this}return __extends(PropertyWrite,_super),PropertyWrite.prototype.visit=function(visitor,context){return void 0===context&&(context=null),visitor.visitPropertyWrite(this,context)},PropertyWrite}(AST),SafePropertyRead=function(_super){function SafePropertyRead(span,receiver,name){var _this=_super.call(this,span)||this;return _this.receiver=receiver,_this.name=name,_this}return __extends(SafePropertyRead,_super),SafePropertyRead.prototype.visit=function(visitor,context){return void 0===context&&(context=null),visitor.visitSafePropertyRead(this,context)},SafePropertyRead}(AST),KeyedRead=function(_super){function KeyedRead(span,obj,key){var _this=_super.call(this,span)||this;return _this.obj=obj,_this.key=key,_this}return __extends(KeyedRead,_super),KeyedRead.prototype.visit=function(visitor,context){return void 0===context&&(context=null),visitor.visitKeyedRead(this,context)},KeyedRead}(AST),KeyedWrite=function(_super){function KeyedWrite(span,obj,key,value){var _this=_super.call(this,span)||this;return _this.obj=obj,_this.key=key,_this.value=value,_this}return __extends(KeyedWrite,_super),KeyedWrite.prototype.visit=function(visitor,context){return void 0===context&&(context=null),visitor.visitKeyedWrite(this,context)},KeyedWrite}(AST),BindingPipe=function(_super){function BindingPipe(span,exp,name,args){var _this=_super.call(this,span)||this;return _this.exp=exp,_this.name=name,_this.args=args,_this}return __extends(BindingPipe,_super),BindingPipe.prototype.visit=function(visitor,context){return void 0===context&&(context=null),visitor.visitPipe(this,context)},BindingPipe}(AST),LiteralPrimitive=function(_super){function LiteralPrimitive(span,value){var _this=_super.call(this,span)||this;return _this.value=value,_this}return __extends(LiteralPrimitive,_super),LiteralPrimitive.prototype.visit=function(visitor,context){return void 0===context&&(context=null),visitor.visitLiteralPrimitive(this,context)},LiteralPrimitive}(AST),LiteralArray=function(_super){function LiteralArray(span,expressions){var _this=_super.call(this,span)||this;return _this.expressions=expressions,_this}return __extends(LiteralArray,_super),LiteralArray.prototype.visit=function(visitor,context){return void 0===context&&(context=null),visitor.visitLiteralArray(this,context)},LiteralArray}(AST),LiteralMap=function(_super){function LiteralMap(span,keys,values){var _this=_super.call(this,span)||this;return _this.keys=keys,_this.values=values,_this}return __extends(LiteralMap,_super),LiteralMap.prototype.visit=function(visitor,context){return void 0===context&&(context=null),visitor.visitLiteralMap(this,context)},LiteralMap}(AST),Interpolation=function(_super){function Interpolation(span,strings,expressions){var _this=_super.call(this,span)||this;return _this.strings=strings,_this.expressions=expressions,_this}return __extends(Interpolation,_super),Interpolation.prototype.visit=function(visitor,context){return void 0===context&&(context=null),visitor.visitInterpolation(this,context)},Interpolation}(AST),Binary=function(_super){function Binary(span,operation,left,right){var _this=_super.call(this,span)||this;return _this.operation=operation,_this.left=left,_this.right=right,_this}return __extends(Binary,_super),Binary.prototype.visit=function(visitor,context){return void 0===context&&(context=null),visitor.visitBinary(this,context)},Binary}(AST),PrefixNot=function(_super){function PrefixNot(span,expression){var _this=_super.call(this,span)||this;return _this.expression=expression,_this}return __extends(PrefixNot,_super),PrefixNot.prototype.visit=function(visitor,context){return void 0===context&&(context=null),visitor.visitPrefixNot(this,context)},PrefixNot}(AST),NonNullAssert=function(_super){function NonNullAssert(span,expression){var _this=_super.call(this,span)||this;return _this.expression=expression,_this}return __extends(NonNullAssert,_super),NonNullAssert.prototype.visit=function(visitor,context){return void 0===context&&(context=null),visitor.visitNonNullAssert(this,context)},NonNullAssert}(AST),MethodCall=function(_super){function MethodCall(span,receiver,name,args){var _this=_super.call(this,span)||this;return _this.receiver=receiver,_this.name=name,_this.args=args,_this}return __extends(MethodCall,_super),MethodCall.prototype.visit=function(visitor,context){return void 0===context&&(context=null),visitor.visitMethodCall(this,context)},MethodCall}(AST),SafeMethodCall=function(_super){function SafeMethodCall(span,receiver,name,args){var _this=_super.call(this,span)||this;return _this.receiver=receiver,_this.name=name,_this.args=args,_this}return __extends(SafeMethodCall,_super),SafeMethodCall.prototype.visit=function(visitor,context){return void 0===context&&(context=null),visitor.visitSafeMethodCall(this,context)},SafeMethodCall}(AST),FunctionCall=function(_super){function FunctionCall(span,target,args){var _this=_super.call(this,span)||this;return _this.target=target,_this.args=args,_this}return __extends(FunctionCall,_super),FunctionCall.prototype.visit=function(visitor,context){return void 0===context&&(context=null),visitor.visitFunctionCall(this,context)},FunctionCall}(AST),ASTWithSource=function(_super){function ASTWithSource(ast,source,location,errors){var _this=_super.call(this,new ParseSpan(0,null==source?0:source.length))||this;return _this.ast=ast,_this.source=source,_this.location=location,_this.errors=errors,_this}return __extends(ASTWithSource,_super),ASTWithSource.prototype.visit=function(visitor,context){return void 0===context&&(context=null),this.ast.visit(visitor,context)},ASTWithSource.prototype.toString=function(){return this.source+" in "+this.location},ASTWithSource}(AST),TemplateBinding=function(){function TemplateBinding(span,key,keyIsVar,name,expression){this.span=span,this.key=key,this.keyIsVar=keyIsVar,this.name=name,this.expression=expression}return TemplateBinding}(),NullAstVisitor=function(){function NullAstVisitor(){}return NullAstVisitor.prototype.visitBinary=function(ast,context){},NullAstVisitor.prototype.visitChain=function(ast,context){},NullAstVisitor.prototype.visitConditional=function(ast,context){},NullAstVisitor.prototype.visitFunctionCall=function(ast,context){},NullAstVisitor.prototype.visitImplicitReceiver=function(ast,context){},NullAstVisitor.prototype.visitInterpolation=function(ast,context){},NullAstVisitor.prototype.visitKeyedRead=function(ast,context){},NullAstVisitor.prototype.visitKeyedWrite=function(ast,context){},NullAstVisitor.prototype.visitLiteralArray=function(ast,context){},NullAstVisitor.prototype.visitLiteralMap=function(ast,context){},NullAstVisitor.prototype.visitLiteralPrimitive=function(ast,context){},NullAstVisitor.prototype.visitMethodCall=function(ast,context){},NullAstVisitor.prototype.visitPipe=function(ast,context){},NullAstVisitor.prototype.visitPrefixNot=function(ast,context){},NullAstVisitor.prototype.visitNonNullAssert=function(ast,context){},NullAstVisitor.prototype.visitPropertyRead=function(ast,context){},NullAstVisitor.prototype.visitPropertyWrite=function(ast,context){},NullAstVisitor.prototype.visitQuote=function(ast,context){},NullAstVisitor.prototype.visitSafeMethodCall=function(ast,context){},NullAstVisitor.prototype.visitSafePropertyRead=function(ast,context){},NullAstVisitor}(),RecursiveAstVisitor=function(){function RecursiveAstVisitor(){}return RecursiveAstVisitor.prototype.visitBinary=function(ast,context){return ast.left.visit(this),ast.right.visit(this),null},RecursiveAstVisitor.prototype.visitChain=function(ast,context){return this.visitAll(ast.expressions,context)},RecursiveAstVisitor.prototype.visitConditional=function(ast,context){return ast.condition.visit(this),ast.trueExp.visit(this),ast.falseExp.visit(this),null},RecursiveAstVisitor.prototype.visitPipe=function(ast,context){return ast.exp.visit(this),this.visitAll(ast.args,context),null},RecursiveAstVisitor.prototype.visitFunctionCall=function(ast,context){return ast.target.visit(this),this.visitAll(ast.args,context),null},RecursiveAstVisitor.prototype.visitImplicitReceiver=function(ast,context){return null},RecursiveAstVisitor.prototype.visitInterpolation=function(ast,context){return this.visitAll(ast.expressions,context)},RecursiveAstVisitor.prototype.visitKeyedRead=function(ast,context){return ast.obj.visit(this),ast.key.visit(this),null},RecursiveAstVisitor.prototype.visitKeyedWrite=function(ast,context){return ast.obj.visit(this),ast.key.visit(this),ast.value.visit(this),null},RecursiveAstVisitor.prototype.visitLiteralArray=function(ast,context){return this.visitAll(ast.expressions,context)},RecursiveAstVisitor.prototype.visitLiteralMap=function(ast,context){return this.visitAll(ast.values,context)},RecursiveAstVisitor.prototype.visitLiteralPrimitive=function(ast,context){return null},RecursiveAstVisitor.prototype.visitMethodCall=function(ast,context){return ast.receiver.visit(this),this.visitAll(ast.args,context)},RecursiveAstVisitor.prototype.visitPrefixNot=function(ast,context){
238
- return ast.expression.visit(this),null},RecursiveAstVisitor.prototype.visitNonNullAssert=function(ast,context){return ast.expression.visit(this),null},RecursiveAstVisitor.prototype.visitPropertyRead=function(ast,context){return ast.receiver.visit(this),null},RecursiveAstVisitor.prototype.visitPropertyWrite=function(ast,context){return ast.receiver.visit(this),ast.value.visit(this),null},RecursiveAstVisitor.prototype.visitSafePropertyRead=function(ast,context){return ast.receiver.visit(this),null},RecursiveAstVisitor.prototype.visitSafeMethodCall=function(ast,context){return ast.receiver.visit(this),this.visitAll(ast.args,context)},RecursiveAstVisitor.prototype.visitAll=function(asts,context){var _this=this;return asts.forEach(function(ast){return ast.visit(_this,context)}),null},RecursiveAstVisitor.prototype.visitQuote=function(ast,context){return null},RecursiveAstVisitor}(),AstTransformer=function(){function AstTransformer(){}return AstTransformer.prototype.visitImplicitReceiver=function(ast,context){return ast},AstTransformer.prototype.visitInterpolation=function(ast,context){return new Interpolation(ast.span,ast.strings,this.visitAll(ast.expressions))},AstTransformer.prototype.visitLiteralPrimitive=function(ast,context){return new LiteralPrimitive(ast.span,ast.value)},AstTransformer.prototype.visitPropertyRead=function(ast,context){return new PropertyRead(ast.span,ast.receiver.visit(this),ast.name)},AstTransformer.prototype.visitPropertyWrite=function(ast,context){return new PropertyWrite(ast.span,ast.receiver.visit(this),ast.name,ast.value.visit(this))},AstTransformer.prototype.visitSafePropertyRead=function(ast,context){return new SafePropertyRead(ast.span,ast.receiver.visit(this),ast.name)},AstTransformer.prototype.visitMethodCall=function(ast,context){return new MethodCall(ast.span,ast.receiver.visit(this),ast.name,this.visitAll(ast.args))},AstTransformer.prototype.visitSafeMethodCall=function(ast,context){return new SafeMethodCall(ast.span,ast.receiver.visit(this),ast.name,this.visitAll(ast.args))},AstTransformer.prototype.visitFunctionCall=function(ast,context){return new FunctionCall(ast.span,ast.target.visit(this),this.visitAll(ast.args))},AstTransformer.prototype.visitLiteralArray=function(ast,context){return new LiteralArray(ast.span,this.visitAll(ast.expressions))},AstTransformer.prototype.visitLiteralMap=function(ast,context){return new LiteralMap(ast.span,ast.keys,this.visitAll(ast.values))},AstTransformer.prototype.visitBinary=function(ast,context){return new Binary(ast.span,ast.operation,ast.left.visit(this),ast.right.visit(this))},AstTransformer.prototype.visitPrefixNot=function(ast,context){return new PrefixNot(ast.span,ast.expression.visit(this))},AstTransformer.prototype.visitNonNullAssert=function(ast,context){return new NonNullAssert(ast.span,ast.expression.visit(this))},AstTransformer.prototype.visitConditional=function(ast,context){return new Conditional(ast.span,ast.condition.visit(this),ast.trueExp.visit(this),ast.falseExp.visit(this))},AstTransformer.prototype.visitPipe=function(ast,context){return new BindingPipe(ast.span,ast.exp.visit(this),ast.name,this.visitAll(ast.args))},AstTransformer.prototype.visitKeyedRead=function(ast,context){return new KeyedRead(ast.span,ast.obj.visit(this),ast.key.visit(this))},AstTransformer.prototype.visitKeyedWrite=function(ast,context){return new KeyedWrite(ast.span,ast.obj.visit(this),ast.key.visit(this),ast.value.visit(this))},AstTransformer.prototype.visitAll=function(asts){for(var res=new Array(asts.length),i=0;i<asts.length;++i)res[i]=asts[i].visit(this);return res},AstTransformer.prototype.visitChain=function(ast,context){return new Chain(ast.span,this.visitAll(ast.expressions))},AstTransformer.prototype.visitQuote=function(ast,context){return new Quote(ast.span,ast.prefix,ast.uninterpretedExpression,ast.location)},AstTransformer}(),SplitInterpolation=function(){function SplitInterpolation(strings,expressions,offsets){this.strings=strings,this.expressions=expressions,this.offsets=offsets}return SplitInterpolation}(),TemplateBindingParseResult=function(){function TemplateBindingParseResult(templateBindings,warnings,errors){this.templateBindings=templateBindings,this.warnings=warnings,this.errors=errors}return TemplateBindingParseResult}(),Parser=function(){function Parser(_lexer){this._lexer=_lexer,this.errors=[]}return Parser.prototype.parseAction=function(input,location,interpolationConfig){void 0===interpolationConfig&&(interpolationConfig=DEFAULT_INTERPOLATION_CONFIG),this._checkNoInterpolation(input,location,interpolationConfig);var sourceToLex=this._stripComments(input),tokens=this._lexer.tokenize(this._stripComments(input)),ast=new _ParseAST(input,location,tokens,sourceToLex.length,!0,this.errors,input.length-sourceToLex.length).parseChain();return new ASTWithSource(ast,input,location,this.errors)},Parser.prototype.parseBinding=function(input,location,interpolationConfig){void 0===interpolationConfig&&(interpolationConfig=DEFAULT_INTERPOLATION_CONFIG);var ast=this._parseBindingAst(input,location,interpolationConfig);return new ASTWithSource(ast,input,location,this.errors)},Parser.prototype.parseSimpleBinding=function(input,location,interpolationConfig){void 0===interpolationConfig&&(interpolationConfig=DEFAULT_INTERPOLATION_CONFIG);var ast=this._parseBindingAst(input,location,interpolationConfig),errors=SimpleExpressionChecker.check(ast);return errors.length>0&&this._reportError("Host binding expression cannot contain "+errors.join(" "),input,location),new ASTWithSource(ast,input,location,this.errors)},Parser.prototype._reportError=function(message,input,errLocation,ctxLocation){this.errors.push(new ParserError(message,input,errLocation,ctxLocation))},Parser.prototype._parseBindingAst=function(input,location,interpolationConfig){var quote=this._parseQuote(input,location);if(null!=quote)return quote;this._checkNoInterpolation(input,location,interpolationConfig);var sourceToLex=this._stripComments(input),tokens=this._lexer.tokenize(sourceToLex);return new _ParseAST(input,location,tokens,sourceToLex.length,!1,this.errors,input.length-sourceToLex.length).parseChain()},Parser.prototype._parseQuote=function(input,location){if(null==input)return null;var prefixSeparatorIndex=input.indexOf(":");if(-1==prefixSeparatorIndex)return null;var prefix=input.substring(0,prefixSeparatorIndex).trim();if(!isIdentifier(prefix))return null;var uninterpretedExpression=input.substring(prefixSeparatorIndex+1);return new Quote(new ParseSpan(0,input.length),prefix,uninterpretedExpression,location)},Parser.prototype.parseTemplateBindings=function(prefixToken,input,location){var tokens=this._lexer.tokenize(input);if(prefixToken){var prefixTokens=this._lexer.tokenize(prefixToken).map(function(t){return t.index=0,t});tokens.unshift.apply(tokens,prefixTokens)}return new _ParseAST(input,location,tokens,input.length,!1,this.errors,0).parseTemplateBindings()},Parser.prototype.parseInterpolation=function(input,location,interpolationConfig){void 0===interpolationConfig&&(interpolationConfig=DEFAULT_INTERPOLATION_CONFIG);var split=this.splitInterpolation(input,location,interpolationConfig);if(null==split)return null;for(var expressions=[],i=0;i<split.expressions.length;++i){var expressionText=split.expressions[i],sourceToLex=this._stripComments(expressionText),tokens=this._lexer.tokenize(sourceToLex),ast=new _ParseAST(input,location,tokens,sourceToLex.length,!1,this.errors,split.offsets[i]+(expressionText.length-sourceToLex.length)).parseChain();expressions.push(ast)}return new ASTWithSource(new Interpolation(new ParseSpan(0,null==input?0:input.length),split.strings,expressions),input,location,this.errors)},Parser.prototype.splitInterpolation=function(input,location,interpolationConfig){void 0===interpolationConfig&&(interpolationConfig=DEFAULT_INTERPOLATION_CONFIG);var regexp=_createInterpolateRegExp(interpolationConfig),parts=input.split(regexp);if(parts.length<=1)return null;for(var strings=[],expressions=[],offsets=[],offset=0,i=0;i<parts.length;i++){var part=parts[i];i%2==0?(strings.push(part),offset+=part.length):part.trim().length>0?(offset+=interpolationConfig.start.length,expressions.push(part),offsets.push(offset),offset+=part.length+interpolationConfig.end.length):(this._reportError("Blank expressions are not allowed in interpolated strings",input,"at column "+this._findInterpolationErrorColumn(parts,i,interpolationConfig)+" in",location),expressions.push("$implict"),offsets.push(offset))}return new SplitInterpolation(strings,expressions,offsets)},Parser.prototype.wrapLiteralPrimitive=function(input,location){return new ASTWithSource(new LiteralPrimitive(new ParseSpan(0,null==input?0:input.length),input),input,location,this.errors)},Parser.prototype._stripComments=function(input){var i=this._commentStart(input);return null!=i?input.substring(0,i).trim():input},Parser.prototype._commentStart=function(input){for(var outerQuote=null,i=0;i<input.length-1;i++){var char=input.charCodeAt(i),nextChar=input.charCodeAt(i+1);if(char===$SLASH&&nextChar==$SLASH&&null==outerQuote)return i;outerQuote===char?outerQuote=null:null==outerQuote&&isQuote(char)&&(outerQuote=char)}return null},Parser.prototype._checkNoInterpolation=function(input,location,interpolationConfig){var regexp=_createInterpolateRegExp(interpolationConfig),parts=input.split(regexp);parts.length>1&&this._reportError("Got interpolation ("+interpolationConfig.start+interpolationConfig.end+") where expression was expected",input,"at column "+this._findInterpolationErrorColumn(parts,1,interpolationConfig)+" in",location)},Parser.prototype._findInterpolationErrorColumn=function(parts,partInErrIdx,interpolationConfig){for(var errLocation="",j=0;j<partInErrIdx;j++)errLocation+=j%2==0?parts[j]:""+interpolationConfig.start+parts[j]+interpolationConfig.end;return errLocation.length},Parser}(),_ParseAST=function(){function _ParseAST(input,location,tokens,inputLength,parseAction,errors,offset){this.input=input,this.location=location,this.tokens=tokens,this.inputLength=inputLength,this.parseAction=parseAction,this.errors=errors,this.offset=offset,this.rparensExpected=0,this.rbracketsExpected=0,this.rbracesExpected=0,this.index=0}return _ParseAST.prototype.peek=function(offset){var i=this.index+offset;return i<this.tokens.length?this.tokens[i]:EOF},Object.defineProperty(_ParseAST.prototype,"next",{get:function(){return this.peek(0)},enumerable:!0,configurable:!0}),Object.defineProperty(_ParseAST.prototype,"inputIndex",{get:function(){return this.index<this.tokens.length?this.next.index+this.offset:this.inputLength+this.offset},enumerable:!0,configurable:!0}),_ParseAST.prototype.span=function(start){return new ParseSpan(start,this.inputIndex)},_ParseAST.prototype.advance=function(){this.index++},_ParseAST.prototype.optionalCharacter=function(code){return!!this.next.isCharacter(code)&&(this.advance(),!0)},_ParseAST.prototype.peekKeywordLet=function(){return this.next.isKeywordLet()},_ParseAST.prototype.peekKeywordAs=function(){return this.next.isKeywordAs()},_ParseAST.prototype.expectCharacter=function(code){this.optionalCharacter(code)||this.error("Missing expected "+String.fromCharCode(code))},_ParseAST.prototype.optionalOperator=function(op){return!!this.next.isOperator(op)&&(this.advance(),!0)},_ParseAST.prototype.expectOperator=function(operator){this.optionalOperator(operator)||this.error("Missing expected operator "+operator)},_ParseAST.prototype.expectIdentifierOrKeyword=function(){var n=this.next;return n.isIdentifier()||n.isKeyword()?(this.advance(),n.toString()):(this.error("Unexpected token "+n+", expected identifier or keyword"),"")},_ParseAST.prototype.expectIdentifierOrKeywordOrString=function(){var n=this.next;return n.isIdentifier()||n.isKeyword()||n.isString()?(this.advance(),n.toString()):(this.error("Unexpected token "+n+", expected identifier, keyword, or string"),"")},_ParseAST.prototype.parseChain=function(){for(var exprs=[],start=this.inputIndex;this.index<this.tokens.length;){var expr=this.parsePipe();if(exprs.push(expr),this.optionalCharacter($SEMICOLON))for(this.parseAction||this.error("Binding expression cannot contain chained expression");this.optionalCharacter($SEMICOLON););else this.index<this.tokens.length&&this.error("Unexpected token '"+this.next+"'")}return 0==exprs.length?new EmptyExpr(this.span(start)):1==exprs.length?exprs[0]:new Chain(this.span(start),exprs)},_ParseAST.prototype.parsePipe=function(){var result=this.parseExpression();if(this.optionalOperator("|")){this.parseAction&&this.error("Cannot have a pipe in an action expression");do{for(var name_1=this.expectIdentifierOrKeyword(),args=[];this.optionalCharacter(58);)args.push(this.parseExpression());result=new BindingPipe(this.span(result.span.start),result,name_1,args)}while(this.optionalOperator("|"))}return result},_ParseAST.prototype.parseExpression=function(){return this.parseConditional()},_ParseAST.prototype.parseConditional=function(){var start=this.inputIndex,result=this.parseLogicalOr();if(this.optionalOperator("?")){var yes=this.parsePipe(),no=void 0;if(this.optionalCharacter(58))no=this.parsePipe();else{var end=this.inputIndex,expression=this.input.substring(start,end);this.error("Conditional expression "+expression+" requires all 3 expressions"),no=new EmptyExpr(this.span(start))}return new Conditional(this.span(start),result,yes,no)}return result},_ParseAST.prototype.parseLogicalOr=function(){for(var result=this.parseLogicalAnd();this.optionalOperator("||");){var right=this.parseLogicalAnd();result=new Binary(this.span(result.span.start),"||",result,right)}return result},_ParseAST.prototype.parseLogicalAnd=function(){for(var result=this.parseEquality();this.optionalOperator("&&");){var right=this.parseEquality();result=new Binary(this.span(result.span.start),"&&",result,right)}return result},_ParseAST.prototype.parseEquality=function(){for(var result=this.parseRelational();this.next.type==TokenType.Operator;){var operator=this.next.strValue;switch(operator){case"==":case"===":case"!=":case"!==":this.advance();var right=this.parseRelational();result=new Binary(this.span(result.span.start),operator,result,right);continue}break}return result},_ParseAST.prototype.parseRelational=function(){for(var result=this.parseAdditive();this.next.type==TokenType.Operator;){var operator=this.next.strValue;switch(operator){case"<":case">":case"<=":case">=":this.advance();var right=this.parseAdditive();result=new Binary(this.span(result.span.start),operator,result,right);continue}break}return result},_ParseAST.prototype.parseAdditive=function(){for(var result=this.parseMultiplicative();this.next.type==TokenType.Operator;){var operator=this.next.strValue;switch(operator){case"+":case"-":this.advance();var right=this.parseMultiplicative();result=new Binary(this.span(result.span.start),operator,result,right);continue}break}return result},_ParseAST.prototype.parseMultiplicative=function(){for(var result=this.parsePrefix();this.next.type==TokenType.Operator;){var operator=this.next.strValue;switch(operator){case"*":case"%":case"/":this.advance();var right=this.parsePrefix();result=new Binary(this.span(result.span.start),operator,result,right);continue}break}return result},_ParseAST.prototype.parsePrefix=function(){if(this.next.type==TokenType.Operator){var start=this.inputIndex,operator=this.next.strValue,result=void 0;switch(operator){case"+":return this.advance(),this.parsePrefix();case"-":return this.advance(),result=this.parsePrefix(),new Binary(this.span(start),operator,new LiteralPrimitive(new ParseSpan(start,start),0),result);case"!":return this.advance(),result=this.parsePrefix(),new PrefixNot(this.span(start),result)}}return this.parseCallChain()},_ParseAST.prototype.parseCallChain=function(){for(var result=this.parsePrimary();;)if(this.optionalCharacter(46))result=this.parseAccessMemberOrMethodCall(result,!1);else if(this.optionalOperator("?."))result=this.parseAccessMemberOrMethodCall(result,!0);else if(this.optionalCharacter(91)){this.rbracketsExpected++;var key=this.parsePipe();if(this.rbracketsExpected--,this.expectCharacter(93),this.optionalOperator("=")){var value=this.parseConditional();result=new KeyedWrite(this.span(result.span.start),result,key,value)}else result=new KeyedRead(this.span(result.span.start),result,key)}else if(this.optionalCharacter(40)){this.rparensExpected++;var args=this.parseCallArguments();this.rparensExpected--,this.expectCharacter(41),result=new FunctionCall(this.span(result.span.start),result,args)}else{if(!this.optionalOperator("!"))return result;result=new NonNullAssert(this.span(result.span.start),result)}},_ParseAST.prototype.parsePrimary=function(){var start=this.inputIndex;if(this.optionalCharacter(40)){this.rparensExpected++;var result=this.parsePipe();return this.rparensExpected--,this.expectCharacter(41),result}if(this.next.isKeywordNull())return this.advance(),new LiteralPrimitive(this.span(start),null);if(this.next.isKeywordUndefined())return this.advance(),new LiteralPrimitive(this.span(start),void 0);if(this.next.isKeywordTrue())return this.advance(),new LiteralPrimitive(this.span(start),!0);if(this.next.isKeywordFalse())return this.advance(),new LiteralPrimitive(this.span(start),!1);if(this.next.isKeywordThis())return this.advance(),new ImplicitReceiver(this.span(start));if(this.optionalCharacter(91)){this.rbracketsExpected++;var elements=this.parseExpressionList(93);return this.rbracketsExpected--,this.expectCharacter(93),new LiteralArray(this.span(start),elements)}if(this.next.isCharacter($LBRACE))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMemberOrMethodCall(new ImplicitReceiver(this.span(start)),!1);if(this.next.isNumber()){var value=this.next.toNumber();return this.advance(),new LiteralPrimitive(this.span(start),value)}if(this.next.isString()){var literalValue=this.next.toString();return this.advance(),new LiteralPrimitive(this.span(start),literalValue)}return this.index>=this.tokens.length?(this.error("Unexpected end of expression: "+this.input),new EmptyExpr(this.span(start))):(this.error("Unexpected token "+this.next),new EmptyExpr(this.span(start)))},_ParseAST.prototype.parseExpressionList=function(terminator){var result=[];if(!this.next.isCharacter(terminator))do{result.push(this.parsePipe())}while(this.optionalCharacter(44));return result},_ParseAST.prototype.parseLiteralMap=function(){var keys=[],values=[],start=this.inputIndex;if(this.expectCharacter($LBRACE),!this.optionalCharacter(125)){this.rbracesExpected++;do{var quoted=this.next.isString(),key=this.expectIdentifierOrKeywordOrString();keys.push({key:key,quoted:quoted}),this.expectCharacter(58),values.push(this.parsePipe())}while(this.optionalCharacter(44));this.rbracesExpected--,this.expectCharacter(125)}return new LiteralMap(this.span(start),keys,values)},_ParseAST.prototype.parseAccessMemberOrMethodCall=function(receiver,isSafe){void 0===isSafe&&(isSafe=!1);var start=receiver.span.start,id=this.expectIdentifierOrKeyword();if(this.optionalCharacter(40)){this.rparensExpected++;var args=this.parseCallArguments();this.expectCharacter(41),this.rparensExpected--;var span=this.span(start);return isSafe?new SafeMethodCall(span,receiver,id,args):new MethodCall(span,receiver,id,args)}if(isSafe)return this.optionalOperator("=")?(this.error("The '?.' operator cannot be used in the assignment"),new EmptyExpr(this.span(start))):new SafePropertyRead(this.span(start),receiver,id);if(this.optionalOperator("=")){if(!this.parseAction)return this.error("Bindings cannot contain assignments"),new EmptyExpr(this.span(start));var value=this.parseConditional();return new PropertyWrite(this.span(start),receiver,id,value)}return new PropertyRead(this.span(start),receiver,id)},_ParseAST.prototype.parseCallArguments=function(){if(this.next.isCharacter(41))return[];var positionals=[];do{positionals.push(this.parsePipe())}while(this.optionalCharacter(44));return positionals},_ParseAST.prototype.expectTemplateBindingKey=function(){var result="",operatorFound=!1;do{result+=this.expectIdentifierOrKeywordOrString(),(operatorFound=this.optionalOperator("-"))&&(result+="-")}while(operatorFound);return result.toString()},_ParseAST.prototype.parseTemplateBindings=function(){for(var bindings=[],prefix=null,warnings=[];this.index<this.tokens.length;){var start=this.inputIndex,keyIsVar=this.peekKeywordLet();keyIsVar&&this.advance();var rawKey=this.expectTemplateBindingKey(),key=rawKey;keyIsVar||(null==prefix?prefix=key:key=prefix+key[0].toUpperCase()+key.substring(1)),this.optionalCharacter(58);var name_2=null,expression=null;if(keyIsVar)name_2=this.optionalOperator("=")?this.expectTemplateBindingKey():"$implicit";else if(this.peekKeywordAs()){var letStart=this.inputIndex;this.advance(),name_2=rawKey,key=this.expectTemplateBindingKey(),keyIsVar=!0}else if(this.next!==EOF&&!this.peekKeywordLet()){var start_1=this.inputIndex,ast=this.parsePipe(),source=this.input.substring(start_1-this.offset,this.inputIndex-this.offset);expression=new ASTWithSource(ast,source,this.location,this.errors)}if(bindings.push(new TemplateBinding(this.span(start),key,keyIsVar,name_2,expression)),this.peekKeywordAs()&&!keyIsVar){var letStart=this.inputIndex;this.advance();var letName=this.expectTemplateBindingKey();bindings.push(new TemplateBinding(this.span(letStart),letName,!0,key,null))}this.optionalCharacter($SEMICOLON)||this.optionalCharacter(44)}return new TemplateBindingParseResult(bindings,warnings,this.errors)},_ParseAST.prototype.error=function(message,index){void 0===index&&(index=null),this.errors.push(new ParserError(message,this.input,this.locationText(index),this.location)),this.skip()},_ParseAST.prototype.locationText=function(index){return void 0===index&&(index=null),null==index&&(index=this.index),index<this.tokens.length?"at column "+(this.tokens[index].index+1)+" in":"at the end of the expression"},_ParseAST.prototype.skip=function(){for(var n=this.next;this.index<this.tokens.length&&!n.isCharacter($SEMICOLON)&&(this.rparensExpected<=0||!n.isCharacter(41))&&(this.rbracesExpected<=0||!n.isCharacter(125))&&(this.rbracketsExpected<=0||!n.isCharacter(93));)this.next.isError()&&this.errors.push(new ParserError(this.next.toString(),this.input,this.locationText(),this.location)),this.advance(),n=this.next},_ParseAST}(),SimpleExpressionChecker=function(){function SimpleExpressionChecker(){this.errors=[]}return SimpleExpressionChecker.check=function(ast){var s=new SimpleExpressionChecker;return ast.visit(s),s.errors},SimpleExpressionChecker.prototype.visitImplicitReceiver=function(ast,context){},SimpleExpressionChecker.prototype.visitInterpolation=function(ast,context){},SimpleExpressionChecker.prototype.visitLiteralPrimitive=function(ast,context){},SimpleExpressionChecker.prototype.visitPropertyRead=function(ast,context){},SimpleExpressionChecker.prototype.visitPropertyWrite=function(ast,context){},SimpleExpressionChecker.prototype.visitSafePropertyRead=function(ast,context){},SimpleExpressionChecker.prototype.visitMethodCall=function(ast,context){},SimpleExpressionChecker.prototype.visitSafeMethodCall=function(ast,context){},SimpleExpressionChecker.prototype.visitFunctionCall=function(ast,context){},SimpleExpressionChecker.prototype.visitLiteralArray=function(ast,context){this.visitAll(ast.expressions)},SimpleExpressionChecker.prototype.visitLiteralMap=function(ast,context){this.visitAll(ast.values)},SimpleExpressionChecker.prototype.visitBinary=function(ast,context){},SimpleExpressionChecker.prototype.visitPrefixNot=function(ast,context){},SimpleExpressionChecker.prototype.visitNonNullAssert=function(ast,context){},SimpleExpressionChecker.prototype.visitConditional=function(ast,context){},SimpleExpressionChecker.prototype.visitPipe=function(ast,context){this.errors.push("pipes")},SimpleExpressionChecker.prototype.visitKeyedRead=function(ast,context){},SimpleExpressionChecker.prototype.visitKeyedWrite=function(ast,context){},SimpleExpressionChecker.prototype.visitAll=function(asts){var _this=this;return asts.map(function(node){return node.visit(_this)})},SimpleExpressionChecker.prototype.visitChain=function(ast,context){},SimpleExpressionChecker.prototype.visitQuote=function(ast,context){},SimpleExpressionChecker}(),ParseLocation=function(){function ParseLocation(file,offset,line,col){this.file=file,this.offset=offset,this.line=line,this.col=col}return ParseLocation.prototype.toString=function(){return null!=this.offset?this.file.url+"@"+this.line+":"+this.col:this.file.url},ParseLocation.prototype.moveBy=function(delta){for(var source=this.file.content,len=source.length,offset=this.offset,line=this.line,col=this.col;offset>0&&delta<0;){offset--,delta++;var ch=source.charCodeAt(offset);if(ch==$LF){line--;var priorLine=source.substr(0,offset-1).lastIndexOf(String.fromCharCode($LF));col=priorLine>0?offset-priorLine:offset}else col--}for(;offset<len&&delta>0;){var ch=source.charCodeAt(offset);offset++,delta--,ch==$LF?(line++,col=0):col++}return new ParseLocation(this.file,offset,line,col)},ParseLocation.prototype.getContext=function(maxChars,maxLines){var content=this.file.content,startOffset=this.offset;if(null!=startOffset){startOffset>content.length-1&&(startOffset=content.length-1);for(var endOffset=startOffset,ctxChars=0,ctxLines=0;ctxChars<maxChars&&startOffset>0&&(startOffset--,ctxChars++,"\n"!=content[startOffset]||++ctxLines!=maxLines););for(ctxChars=0,ctxLines=0;ctxChars<maxChars&&endOffset<content.length-1&&(endOffset++,ctxChars++,"\n"!=content[endOffset]||++ctxLines!=maxLines););return{before:content.substring(startOffset,this.offset),after:content.substring(this.offset,endOffset+1)}}return null},ParseLocation}(),ParseSourceFile=function(){function ParseSourceFile(content,url){this.content=content,this.url=url}return ParseSourceFile}(),ParseSourceSpan=function(){function ParseSourceSpan(start,end,details){void 0===details&&(details=null),this.start=start,this.end=end,this.details=details}return ParseSourceSpan.prototype.toString=function(){return this.start.file.content.substring(this.start.offset,this.end.offset)},ParseSourceSpan}(),ParseErrorLevel={WARNING:0,ERROR:1};ParseErrorLevel[ParseErrorLevel.WARNING]="WARNING",ParseErrorLevel[ParseErrorLevel.ERROR]="ERROR";var ParseError=function(){function ParseError(span,msg,level){void 0===level&&(level=ParseErrorLevel.ERROR),this.span=span,this.msg=msg,this.level=level}return ParseError.prototype.contextualMessage=function(){var ctx=this.span.start.getContext(100,3);return ctx?this.msg+' ("'+ctx.before+"["+ParseErrorLevel[this.level]+" ->]"+ctx.after+'")':this.msg},ParseError.prototype.toString=function(){var details=this.span.details?", "+this.span.details:"";return this.contextualMessage()+": "+this.span.start+details},ParseError}(),TokenType$1={TAG_OPEN_START:0,TAG_OPEN_END:1,TAG_OPEN_END_VOID:2,TAG_CLOSE:3,TEXT:4,ESCAPABLE_RAW_TEXT:5,RAW_TEXT:6,COMMENT_START:7,COMMENT_END:8,CDATA_START:9,CDATA_END:10,ATTR_NAME:11,ATTR_VALUE:12,DOC_TYPE:13,EXPANSION_FORM_START:14,EXPANSION_CASE_VALUE:15,EXPANSION_CASE_EXP_START:16,EXPANSION_CASE_EXP_END:17,EXPANSION_FORM_END:18,EOF:19};TokenType$1[TokenType$1.TAG_OPEN_START]="TAG_OPEN_START",TokenType$1[TokenType$1.TAG_OPEN_END]="TAG_OPEN_END",TokenType$1[TokenType$1.TAG_OPEN_END_VOID]="TAG_OPEN_END_VOID",TokenType$1[TokenType$1.TAG_CLOSE]="TAG_CLOSE",TokenType$1[TokenType$1.TEXT]="TEXT",TokenType$1[TokenType$1.ESCAPABLE_RAW_TEXT]="ESCAPABLE_RAW_TEXT",TokenType$1[TokenType$1.RAW_TEXT]="RAW_TEXT",TokenType$1[TokenType$1.COMMENT_START]="COMMENT_START",TokenType$1[TokenType$1.COMMENT_END]="COMMENT_END",TokenType$1[TokenType$1.CDATA_START]="CDATA_START",TokenType$1[TokenType$1.CDATA_END]="CDATA_END",TokenType$1[TokenType$1.ATTR_NAME]="ATTR_NAME",TokenType$1[TokenType$1.ATTR_VALUE]="ATTR_VALUE",TokenType$1[TokenType$1.DOC_TYPE]="DOC_TYPE",TokenType$1[TokenType$1.EXPANSION_FORM_START]="EXPANSION_FORM_START",TokenType$1[TokenType$1.EXPANSION_CASE_VALUE]="EXPANSION_CASE_VALUE",TokenType$1[TokenType$1.EXPANSION_CASE_EXP_START]="EXPANSION_CASE_EXP_START",TokenType$1[TokenType$1.EXPANSION_CASE_EXP_END]="EXPANSION_CASE_EXP_END",TokenType$1[TokenType$1.EXPANSION_FORM_END]="EXPANSION_FORM_END",TokenType$1[TokenType$1.EOF]="EOF";var Token$1=function(){function Token(type,parts,sourceSpan){this.type=type,this.parts=parts,this.sourceSpan=sourceSpan}return Token}(),TokenError=function(_super){function TokenError(errorMsg,tokenType,span){var _this=_super.call(this,span,errorMsg)||this;return _this.tokenType=tokenType,_this}return __extends(TokenError,_super),TokenError}(ParseError),TokenizeResult=function(){function TokenizeResult(tokens,errors){this.tokens=tokens,this.errors=errors}return TokenizeResult}(),_CR_OR_CRLF_REGEXP=/\r\n?/g,_ControlFlowError=function(){function _ControlFlowError(error){this.error=error}return _ControlFlowError}(),_Tokenizer=function(){function _Tokenizer(_file,_getTagDefinition,_tokenizeIcu,_interpolationConfig){void 0===_interpolationConfig&&(_interpolationConfig=DEFAULT_INTERPOLATION_CONFIG),this._file=_file,this._getTagDefinition=_getTagDefinition,this._tokenizeIcu=_tokenizeIcu,this._interpolationConfig=_interpolationConfig,this._peek=-1,this._nextPeek=-1,this._index=-1,this._line=0,this._column=-1,this._expansionCaseStack=[],this._inInterpolation=!1,this.tokens=[],this.errors=[],this._input=_file.content,this._length=_file.content.length,this._advance()}return _Tokenizer.prototype._processCarriageReturns=function(content){return content.replace(_CR_OR_CRLF_REGEXP,"\n")},_Tokenizer.prototype.tokenize=function(){for(;this._peek!==$EOF;){var start=this._getLocation();try{this._attemptCharCode(60)?this._attemptCharCode(33)?this._attemptCharCode(91)?this._consumeCdata(start):this._attemptCharCode($MINUS)?this._consumeComment(start):this._consumeDocType(start):this._attemptCharCode($SLASH)?this._consumeTagClose(start):this._consumeTagOpen(start):this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeText()}catch(e){if(!(e instanceof _ControlFlowError))throw e;this.errors.push(e.error)}}return this._beginToken(TokenType$1.EOF),this._endToken([]),new TokenizeResult(mergeTextTokens(this.tokens),this.errors)},_Tokenizer.prototype._tokenizeExpansionForm=function(){if(isExpansionFormStart(this._input,this._index,this._interpolationConfig))return this._consumeExpansionFormStart(),!0;if(isExpansionCaseStart(this._peek)&&this._isInExpansionForm())return this._consumeExpansionCaseStart(),!0;if(125===this._peek){if(this._isInExpansionCase())return this._consumeExpansionCaseEnd(),!0;if(this._isInExpansionForm())return this._consumeExpansionFormEnd(),!0}return!1},_Tokenizer.prototype._getLocation=function(){return new ParseLocation(this._file,this._index,this._line,this._column)},_Tokenizer.prototype._getSpan=function(start,end){return void 0===start&&(start=this._getLocation()),void 0===end&&(end=this._getLocation()),new ParseSourceSpan(start,end)},_Tokenizer.prototype._beginToken=function(type,start){void 0===start&&(start=this._getLocation()),this._currentTokenStart=start,this._currentTokenType=type},_Tokenizer.prototype._endToken=function(parts,end){void 0===end&&(end=this._getLocation());var token=new Token$1(this._currentTokenType,parts,new ParseSourceSpan(this._currentTokenStart,end));return this.tokens.push(token),this._currentTokenStart=null,this._currentTokenType=null,token},_Tokenizer.prototype._createError=function(msg,span){this._isInExpansionForm()&&(msg+=' (Do you have an unescaped "{" in your template? Use "{{ \'{\' }}") to escape it.)');var error=new TokenError(msg,this._currentTokenType,span);return this._currentTokenStart=null,this._currentTokenType=null,new _ControlFlowError(error)},_Tokenizer.prototype._advance=function(){if(this._index>=this._length)throw this._createError(_unexpectedCharacterErrorMsg($EOF),this._getSpan());this._peek===$LF?(this._line++,this._column=0):this._peek!==$LF&&this._peek!==$CR&&this._column++,this._index++,
239
- this._peek=this._index>=this._length?$EOF:this._input.charCodeAt(this._index),this._nextPeek=this._index+1>=this._length?$EOF:this._input.charCodeAt(this._index+1)},_Tokenizer.prototype._attemptCharCode=function(charCode){return this._peek===charCode&&(this._advance(),!0)},_Tokenizer.prototype._attemptCharCodeCaseInsensitive=function(charCode){return!!compareCharCodeCaseInsensitive(this._peek,charCode)&&(this._advance(),!0)},_Tokenizer.prototype._requireCharCode=function(charCode){var location=this._getLocation();if(!this._attemptCharCode(charCode))throw this._createError(_unexpectedCharacterErrorMsg(this._peek),this._getSpan(location,location))},_Tokenizer.prototype._attemptStr=function(chars){var len=chars.length;if(this._index+len>this._length)return!1;for(var initialPosition=this._savePosition(),i=0;i<len;i++)if(!this._attemptCharCode(chars.charCodeAt(i)))return this._restorePosition(initialPosition),!1;return!0},_Tokenizer.prototype._attemptStrCaseInsensitive=function(chars){for(var i=0;i<chars.length;i++)if(!this._attemptCharCodeCaseInsensitive(chars.charCodeAt(i)))return!1;return!0},_Tokenizer.prototype._requireStr=function(chars){var location=this._getLocation();if(!this._attemptStr(chars))throw this._createError(_unexpectedCharacterErrorMsg(this._peek),this._getSpan(location))},_Tokenizer.prototype._attemptCharCodeUntilFn=function(predicate){for(;!predicate(this._peek);)this._advance()},_Tokenizer.prototype._requireCharCodeUntilFn=function(predicate,len){var start=this._getLocation();if(this._attemptCharCodeUntilFn(predicate),this._index-start.offset<len)throw this._createError(_unexpectedCharacterErrorMsg(this._peek),this._getSpan(start,start))},_Tokenizer.prototype._attemptUntilChar=function(char){for(;this._peek!==char;)this._advance()},_Tokenizer.prototype._readChar=function(decodeEntities){if(decodeEntities&&38===this._peek)return this._decodeEntity();var index=this._index;return this._advance(),this._input[index]},_Tokenizer.prototype._decodeEntity=function(){var start=this._getLocation();if(this._advance(),!this._attemptCharCode(35)){var startPosition=this._savePosition();if(this._attemptCharCodeUntilFn(isNamedEntityEnd),this._peek!=$SEMICOLON)return this._restorePosition(startPosition),"&";this._advance();var name_1=this._input.substring(start.offset+1,this._index-1),char=NAMED_ENTITIES[name_1];if(!char)throw this._createError(_unknownEntityErrorMsg(name_1),this._getSpan(start));return char}var isHex=this._attemptCharCode(120)||this._attemptCharCode(88),numberStart=this._getLocation().offset;if(this._attemptCharCodeUntilFn(isDigitEntityEnd),this._peek!=$SEMICOLON)throw this._createError(_unexpectedCharacterErrorMsg(this._peek),this._getSpan());this._advance();var strNum=this._input.substring(numberStart,this._index-1);try{var charCode=parseInt(strNum,isHex?16:10);return String.fromCharCode(charCode)}catch(e){var entity=this._input.substring(start.offset+1,this._index-1);throw this._createError(_unknownEntityErrorMsg(entity),this._getSpan(start))}},_Tokenizer.prototype._consumeRawText=function(decodeEntities,firstCharOfEnd,attemptEndRest){var tagCloseStart,textStart=this._getLocation();this._beginToken(decodeEntities?TokenType$1.ESCAPABLE_RAW_TEXT:TokenType$1.RAW_TEXT,textStart);for(var parts=[];;){if(tagCloseStart=this._getLocation(),this._attemptCharCode(firstCharOfEnd)&&attemptEndRest())break;for(this._index>tagCloseStart.offset&&parts.push(this._input.substring(tagCloseStart.offset,this._index));this._peek!==firstCharOfEnd;)parts.push(this._readChar(decodeEntities))}return this._endToken([this._processCarriageReturns(parts.join(""))],tagCloseStart)},_Tokenizer.prototype._consumeComment=function(start){var _this=this;this._beginToken(TokenType$1.COMMENT_START,start),this._requireCharCode($MINUS),this._endToken([]);var textToken=this._consumeRawText(!1,$MINUS,function(){return _this._attemptStr("->")});this._beginToken(TokenType$1.COMMENT_END,textToken.sourceSpan.end),this._endToken([])},_Tokenizer.prototype._consumeCdata=function(start){var _this=this;this._beginToken(TokenType$1.CDATA_START,start),this._requireStr("CDATA["),this._endToken([]);var textToken=this._consumeRawText(!1,93,function(){return _this._attemptStr("]>")});this._beginToken(TokenType$1.CDATA_END,textToken.sourceSpan.end),this._endToken([])},_Tokenizer.prototype._consumeDocType=function(start){this._beginToken(TokenType$1.DOC_TYPE,start),this._attemptUntilChar($GT),this._advance(),this._endToken([this._input.substring(start.offset+2,this._index-1)])},_Tokenizer.prototype._consumePrefixAndName=function(){for(var nameOrPrefixStart=this._index,prefix=null;58!==this._peek&&!isPrefixEnd(this._peek);)this._advance();var nameStart;return 58===this._peek?(this._advance(),prefix=this._input.substring(nameOrPrefixStart,this._index-1),nameStart=this._index):nameStart=nameOrPrefixStart,this._requireCharCodeUntilFn(isNameEnd,this._index===nameStart?1:0),[prefix,this._input.substring(nameStart,this._index)]},_Tokenizer.prototype._consumeTagOpen=function(start){var tagName,lowercaseTagName,savedPos=this._savePosition();try{if(!isAsciiLetter(this._peek))throw this._createError(_unexpectedCharacterErrorMsg(this._peek),this._getSpan());var nameStart=this._index;for(this._consumeTagOpenStart(start),tagName=this._input.substring(nameStart,this._index),lowercaseTagName=tagName.toLowerCase(),this._attemptCharCodeUntilFn(isNotWhitespace);this._peek!==$SLASH&&this._peek!==$GT;)this._consumeAttributeName(),this._attemptCharCodeUntilFn(isNotWhitespace),this._attemptCharCode($EQ)&&(this._attemptCharCodeUntilFn(isNotWhitespace),this._consumeAttributeValue()),this._attemptCharCodeUntilFn(isNotWhitespace);this._consumeTagOpenEnd()}catch(e){if(e instanceof _ControlFlowError)return this._restorePosition(savedPos),this._beginToken(TokenType$1.TEXT,start),void this._endToken(["<"]);throw e}var contentTokenType=this._getTagDefinition(tagName).contentType;contentTokenType===TagContentType.RAW_TEXT?this._consumeRawTextWithTagClose(lowercaseTagName,!1):contentTokenType===TagContentType.ESCAPABLE_RAW_TEXT&&this._consumeRawTextWithTagClose(lowercaseTagName,!0)},_Tokenizer.prototype._consumeRawTextWithTagClose=function(lowercaseTagName,decodeEntities){var _this=this,textToken=this._consumeRawText(decodeEntities,60,function(){return!!_this._attemptCharCode($SLASH)&&(_this._attemptCharCodeUntilFn(isNotWhitespace),!!_this._attemptStrCaseInsensitive(lowercaseTagName)&&(_this._attemptCharCodeUntilFn(isNotWhitespace),_this._attemptCharCode($GT)))});this._beginToken(TokenType$1.TAG_CLOSE,textToken.sourceSpan.end),this._endToken([null,lowercaseTagName])},_Tokenizer.prototype._consumeTagOpenStart=function(start){this._beginToken(TokenType$1.TAG_OPEN_START,start);var parts=this._consumePrefixAndName();this._endToken(parts)},_Tokenizer.prototype._consumeAttributeName=function(){this._beginToken(TokenType$1.ATTR_NAME);var prefixAndName=this._consumePrefixAndName();this._endToken(prefixAndName)},_Tokenizer.prototype._consumeAttributeValue=function(){this._beginToken(TokenType$1.ATTR_VALUE);var value;if(this._peek===$SQ||this._peek===$DQ){var quoteChar=this._peek;this._advance();for(var parts=[];this._peek!==quoteChar;)parts.push(this._readChar(!0));value=parts.join(""),this._advance()}else{var valueStart=this._index;this._requireCharCodeUntilFn(isNameEnd,1),value=this._input.substring(valueStart,this._index)}this._endToken([this._processCarriageReturns(value)])},_Tokenizer.prototype._consumeTagOpenEnd=function(){var tokenType=this._attemptCharCode($SLASH)?TokenType$1.TAG_OPEN_END_VOID:TokenType$1.TAG_OPEN_END;this._beginToken(tokenType),this._requireCharCode($GT),this._endToken([])},_Tokenizer.prototype._consumeTagClose=function(start){this._beginToken(TokenType$1.TAG_CLOSE,start),this._attemptCharCodeUntilFn(isNotWhitespace);var prefixAndName=this._consumePrefixAndName();this._attemptCharCodeUntilFn(isNotWhitespace),this._requireCharCode($GT),this._endToken(prefixAndName)},_Tokenizer.prototype._consumeExpansionFormStart=function(){this._beginToken(TokenType$1.EXPANSION_FORM_START,this._getLocation()),this._requireCharCode($LBRACE),this._endToken([]),this._expansionCaseStack.push(TokenType$1.EXPANSION_FORM_START),this._beginToken(TokenType$1.RAW_TEXT,this._getLocation());var condition=this._readUntil(44);this._endToken([condition],this._getLocation()),this._requireCharCode(44),this._attemptCharCodeUntilFn(isNotWhitespace),this._beginToken(TokenType$1.RAW_TEXT,this._getLocation());var type=this._readUntil(44);this._endToken([type],this._getLocation()),this._requireCharCode(44),this._attemptCharCodeUntilFn(isNotWhitespace)},_Tokenizer.prototype._consumeExpansionCaseStart=function(){this._beginToken(TokenType$1.EXPANSION_CASE_VALUE,this._getLocation());var value=this._readUntil($LBRACE).trim();this._endToken([value],this._getLocation()),this._attemptCharCodeUntilFn(isNotWhitespace),this._beginToken(TokenType$1.EXPANSION_CASE_EXP_START,this._getLocation()),this._requireCharCode($LBRACE),this._endToken([],this._getLocation()),this._attemptCharCodeUntilFn(isNotWhitespace),this._expansionCaseStack.push(TokenType$1.EXPANSION_CASE_EXP_START)},_Tokenizer.prototype._consumeExpansionCaseEnd=function(){this._beginToken(TokenType$1.EXPANSION_CASE_EXP_END,this._getLocation()),this._requireCharCode(125),this._endToken([],this._getLocation()),this._attemptCharCodeUntilFn(isNotWhitespace),this._expansionCaseStack.pop()},_Tokenizer.prototype._consumeExpansionFormEnd=function(){this._beginToken(TokenType$1.EXPANSION_FORM_END,this._getLocation()),this._requireCharCode(125),this._endToken([]),this._expansionCaseStack.pop()},_Tokenizer.prototype._consumeText=function(){var start=this._getLocation();this._beginToken(TokenType$1.TEXT,start);var parts=[];do{this._interpolationConfig&&this._attemptStr(this._interpolationConfig.start)?(parts.push(this._interpolationConfig.start),this._inInterpolation=!0):this._interpolationConfig&&this._inInterpolation&&this._attemptStr(this._interpolationConfig.end)?(parts.push(this._interpolationConfig.end),this._inInterpolation=!1):parts.push(this._readChar(!0))}while(!this._isTextEnd());this._endToken([this._processCarriageReturns(parts.join(""))])},_Tokenizer.prototype._isTextEnd=function(){if(60===this._peek||this._peek===$EOF)return!0;if(this._tokenizeIcu&&!this._inInterpolation){if(isExpansionFormStart(this._input,this._index,this._interpolationConfig))return!0;if(125===this._peek&&this._isInExpansionCase())return!0}return!1},_Tokenizer.prototype._savePosition=function(){return[this._peek,this._index,this._column,this._line,this.tokens.length]},_Tokenizer.prototype._readUntil=function(char){var start=this._index;return this._attemptUntilChar(char),this._input.substring(start,this._index)},_Tokenizer.prototype._restorePosition=function(position){this._peek=position[0],this._index=position[1],this._column=position[2],this._line=position[3];var nbTokens=position[4];nbTokens<this.tokens.length&&(this.tokens=this.tokens.slice(0,nbTokens))},_Tokenizer.prototype._isInExpansionCase=function(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===TokenType$1.EXPANSION_CASE_EXP_START},_Tokenizer.prototype._isInExpansionForm=function(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===TokenType$1.EXPANSION_FORM_START},_Tokenizer}(),TreeError=function(_super){function TreeError(elementName,span,msg){var _this=_super.call(this,span,msg)||this;return _this.elementName=elementName,_this}return __extends(TreeError,_super),TreeError.create=function(elementName,span,msg){return new TreeError(elementName,span,msg)},TreeError}(ParseError),ParseTreeResult=function(){function ParseTreeResult(rootNodes,errors){this.rootNodes=rootNodes,this.errors=errors}return ParseTreeResult}(),Parser$1=function(){function Parser(getTagDefinition){this.getTagDefinition=getTagDefinition}return Parser.prototype.parse=function(source,url,parseExpansionForms,interpolationConfig){void 0===parseExpansionForms&&(parseExpansionForms=!1),void 0===interpolationConfig&&(interpolationConfig=DEFAULT_INTERPOLATION_CONFIG);var tokensAndErrors=tokenize(source,url,this.getTagDefinition,parseExpansionForms,interpolationConfig),treeAndErrors=new _TreeBuilder(tokensAndErrors.tokens,this.getTagDefinition).build();return new ParseTreeResult(treeAndErrors.rootNodes,tokensAndErrors.errors.concat(treeAndErrors.errors))},Parser}(),_TreeBuilder=function(){function _TreeBuilder(tokens,getTagDefinition){this.tokens=tokens,this.getTagDefinition=getTagDefinition,this._index=-1,this._rootNodes=[],this._errors=[],this._elementStack=[],this._advance()}return _TreeBuilder.prototype.build=function(){for(;this._peek.type!==TokenType$1.EOF;)this._peek.type===TokenType$1.TAG_OPEN_START?this._consumeStartTag(this._advance()):this._peek.type===TokenType$1.TAG_CLOSE?this._consumeEndTag(this._advance()):this._peek.type===TokenType$1.CDATA_START?(this._closeVoidElement(),this._consumeCdata(this._advance())):this._peek.type===TokenType$1.COMMENT_START?(this._closeVoidElement(),this._consumeComment(this._advance())):this._peek.type===TokenType$1.TEXT||this._peek.type===TokenType$1.RAW_TEXT||this._peek.type===TokenType$1.ESCAPABLE_RAW_TEXT?(this._closeVoidElement(),this._consumeText(this._advance())):this._peek.type===TokenType$1.EXPANSION_FORM_START?this._consumeExpansion(this._advance()):this._advance();return new ParseTreeResult(this._rootNodes,this._errors)},_TreeBuilder.prototype._advance=function(){var prev=this._peek;return this._index<this.tokens.length-1&&this._index++,this._peek=this.tokens[this._index],prev},_TreeBuilder.prototype._advanceIf=function(type){return this._peek.type===type?this._advance():null},_TreeBuilder.prototype._consumeCdata=function(startToken){this._consumeText(this._advance()),this._advanceIf(TokenType$1.CDATA_END)},_TreeBuilder.prototype._consumeComment=function(token){var text=this._advanceIf(TokenType$1.RAW_TEXT);this._advanceIf(TokenType$1.COMMENT_END);var value=null!=text?text.parts[0].trim():null;this._addToParent(new Comment(value,token.sourceSpan))},_TreeBuilder.prototype._consumeExpansion=function(token){for(var switchValue=this._advance(),type=this._advance(),cases=[];this._peek.type===TokenType$1.EXPANSION_CASE_VALUE;){var expCase=this._parseExpansionCase();if(!expCase)return;cases.push(expCase)}if(this._peek.type!==TokenType$1.EXPANSION_FORM_END)return void this._errors.push(TreeError.create(null,this._peek.sourceSpan,"Invalid ICU message. Missing '}'."));var sourceSpan=new ParseSourceSpan(token.sourceSpan.start,this._peek.sourceSpan.end);this._addToParent(new Expansion(switchValue.parts[0],type.parts[0],cases,sourceSpan,switchValue.sourceSpan)),this._advance()},_TreeBuilder.prototype._parseExpansionCase=function(){var value=this._advance();if(this._peek.type!==TokenType$1.EXPANSION_CASE_EXP_START)return this._errors.push(TreeError.create(null,this._peek.sourceSpan,"Invalid ICU message. Missing '{'.")),null;var start=this._advance(),exp=this._collectExpansionExpTokens(start);if(!exp)return null;var end=this._advance();exp.push(new Token$1(TokenType$1.EOF,[],end.sourceSpan));var parsedExp=new _TreeBuilder(exp,this.getTagDefinition).build();if(parsedExp.errors.length>0)return this._errors=this._errors.concat(parsedExp.errors),null;var sourceSpan=new ParseSourceSpan(value.sourceSpan.start,end.sourceSpan.end),expSourceSpan=new ParseSourceSpan(start.sourceSpan.start,end.sourceSpan.end);return new ExpansionCase(value.parts[0],parsedExp.rootNodes,sourceSpan,value.sourceSpan,expSourceSpan)},_TreeBuilder.prototype._collectExpansionExpTokens=function(start){for(var exp=[],expansionFormStack=[TokenType$1.EXPANSION_CASE_EXP_START];;){if(this._peek.type!==TokenType$1.EXPANSION_FORM_START&&this._peek.type!==TokenType$1.EXPANSION_CASE_EXP_START||expansionFormStack.push(this._peek.type),this._peek.type===TokenType$1.EXPANSION_CASE_EXP_END){if(!lastOnStack(expansionFormStack,TokenType$1.EXPANSION_CASE_EXP_START))return this._errors.push(TreeError.create(null,start.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(expansionFormStack.pop(),0==expansionFormStack.length)return exp}if(this._peek.type===TokenType$1.EXPANSION_FORM_END){if(!lastOnStack(expansionFormStack,TokenType$1.EXPANSION_FORM_START))return this._errors.push(TreeError.create(null,start.sourceSpan,"Invalid ICU message. Missing '}'.")),null;expansionFormStack.pop()}if(this._peek.type===TokenType$1.EOF)return this._errors.push(TreeError.create(null,start.sourceSpan,"Invalid ICU message. Missing '}'.")),null;exp.push(this._advance())}},_TreeBuilder.prototype._consumeText=function(token){var text=token.parts[0];if(text.length>0&&"\n"==text[0]){var parent_1=this._getParentElement();null!=parent_1&&0==parent_1.children.length&&this.getTagDefinition(parent_1.name).ignoreFirstLf&&(text=text.substring(1))}text.length>0&&this._addToParent(new Text(text,token.sourceSpan))},_TreeBuilder.prototype._closeVoidElement=function(){var el=this._getParentElement();el&&this.getTagDefinition(el.name).isVoid&&this._elementStack.pop()},_TreeBuilder.prototype._consumeStartTag=function(startTagToken){for(var prefix=startTagToken.parts[0],name=startTagToken.parts[1],attrs=[];this._peek.type===TokenType$1.ATTR_NAME;)attrs.push(this._consumeAttr(this._advance()));var fullName=this._getElementFullName(prefix,name,this._getParentElement()),selfClosing=!1;if(this._peek.type===TokenType$1.TAG_OPEN_END_VOID){this._advance(),selfClosing=!0;var tagDef=this.getTagDefinition(fullName);tagDef.canSelfClose||null!==getNsPrefix(fullName)||tagDef.isVoid||this._errors.push(TreeError.create(fullName,startTagToken.sourceSpan,'Only void and foreign elements can be self closed "'+startTagToken.parts[1]+'"'))}else this._peek.type===TokenType$1.TAG_OPEN_END&&(this._advance(),selfClosing=!1);var end=this._peek.sourceSpan.start,span=new ParseSourceSpan(startTagToken.sourceSpan.start,end),el=new Element(fullName,attrs,[],span,span,void 0);this._pushElement(el),selfClosing&&(this._popElement(fullName),el.endSourceSpan=span)},_TreeBuilder.prototype._pushElement=function(el){var parentEl=this._getParentElement();parentEl&&this.getTagDefinition(parentEl.name).isClosedByChild(el.name)&&this._elementStack.pop();var tagDef=this.getTagDefinition(el.name),_a=this._getParentElementSkippingContainers(),parent=_a.parent,container=_a.container;if(parent&&tagDef.requireExtraParent(parent.name)){var newParent=new Element(tagDef.parentToAdd,[],[],el.sourceSpan,el.startSourceSpan,el.endSourceSpan);this._insertBeforeContainer(parent,container,newParent)}this._addToParent(el),this._elementStack.push(el)},_TreeBuilder.prototype._consumeEndTag=function(endTagToken){var fullName=this._getElementFullName(endTagToken.parts[0],endTagToken.parts[1],this._getParentElement());if(this._getParentElement()&&(this._getParentElement().endSourceSpan=endTagToken.sourceSpan),this.getTagDefinition(fullName).isVoid)this._errors.push(TreeError.create(fullName,endTagToken.sourceSpan,'Void elements do not have end tags "'+endTagToken.parts[1]+'"'));else if(!this._popElement(fullName)){var errMsg='Unexpected closing tag "'+fullName+'". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags';this._errors.push(TreeError.create(fullName,endTagToken.sourceSpan,errMsg))}},_TreeBuilder.prototype._popElement=function(fullName){for(var stackIndex=this._elementStack.length-1;stackIndex>=0;stackIndex--){var el=this._elementStack[stackIndex];if(el.name==fullName)return this._elementStack.splice(stackIndex,this._elementStack.length-stackIndex),!0;if(!this.getTagDefinition(el.name).closedByParent)return!1}return!1},_TreeBuilder.prototype._consumeAttr=function(attrName){var fullName=mergeNsAndName(attrName.parts[0],attrName.parts[1]),end=attrName.sourceSpan.end,value="",valueSpan=void 0;if(this._peek.type===TokenType$1.ATTR_VALUE){var valueToken=this._advance();value=valueToken.parts[0],end=valueToken.sourceSpan.end,valueSpan=valueToken.sourceSpan}return new Attribute$1(fullName,value,new ParseSourceSpan(attrName.sourceSpan.start,end),valueSpan)},_TreeBuilder.prototype._getParentElement=function(){return this._elementStack.length>0?this._elementStack[this._elementStack.length-1]:null},_TreeBuilder.prototype._getParentElementSkippingContainers=function(){for(var container=null,i=this._elementStack.length-1;i>=0;i--){if(!isNgContainer(this._elementStack[i].name))return{parent:this._elementStack[i],container:container};container=this._elementStack[i]}return{parent:null,container:container}},_TreeBuilder.prototype._addToParent=function(node){var parent=this._getParentElement();null!=parent?parent.children.push(node):this._rootNodes.push(node)},_TreeBuilder.prototype._insertBeforeContainer=function(parent,container,node){if(container){if(parent){var index=parent.children.indexOf(container);parent.children[index]=node}else this._rootNodes.push(node);node.children.push(container),this._elementStack.splice(this._elementStack.indexOf(container),0,node)}else this._addToParent(node),this._elementStack.push(node)},_TreeBuilder.prototype._getElementFullName=function(prefix,localName,parentElement){return null==prefix&&null==(prefix=this.getTagDefinition(localName).implicitNamespacePrefix)&&null!=parentElement&&(prefix=getNsPrefix(parentElement.name)),mergeNsAndName(prefix,localName)},_TreeBuilder}(),_SerializerVisitor=function(){function _SerializerVisitor(){}return _SerializerVisitor.prototype.visitText=function(text,context){return text.value},_SerializerVisitor.prototype.visitContainer=function(container,context){var _this=this;return"["+container.children.map(function(child){return child.visit(_this)}).join(", ")+"]"},_SerializerVisitor.prototype.visitIcu=function(icu,context){var _this=this,strCases=Object.keys(icu.cases).map(function(k){return k+" {"+icu.cases[k].visit(_this)+"}"});return"{"+icu.expression+", "+icu.type+", "+strCases.join(", ")+"}"},_SerializerVisitor.prototype.visitTagPlaceholder=function(ph,context){var _this=this;return ph.isVoid?'<ph tag name="'+ph.startName+'"/>':'<ph tag name="'+ph.startName+'">'+ph.children.map(function(child){return child.visit(_this)}).join(", ")+'</ph name="'+ph.closeName+'">'},_SerializerVisitor.prototype.visitPlaceholder=function(ph,context){return ph.value?'<ph name="'+ph.name+'">'+ph.value+"</ph>":'<ph name="'+ph.name+'"/>'},_SerializerVisitor.prototype.visitIcuPlaceholder=function(ph,context){return'<ph icu name="'+ph.name+'">'+ph.value.visit(this)+"</ph>"},_SerializerVisitor}(),serializerVisitor=new _SerializerVisitor,_SerializerIgnoreIcuExpVisitor=function(_super){function _SerializerIgnoreIcuExpVisitor(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(_SerializerIgnoreIcuExpVisitor,_super),_SerializerIgnoreIcuExpVisitor.prototype.visitIcu=function(icu,context){var _this=this,strCases=Object.keys(icu.cases).map(function(k){return k+" {"+icu.cases[k].visit(_this)+"}"});return"{"+icu.type+", "+strCases.join(", ")+"}"},_SerializerIgnoreIcuExpVisitor}(_SerializerVisitor),Endian={Little:0,Big:1};Endian[Endian.Little]="Little",Endian[Endian.Big]="Big";/**
238
+ return ast.expression.visit(this),null},RecursiveAstVisitor.prototype.visitNonNullAssert=function(ast,context){return ast.expression.visit(this),null},RecursiveAstVisitor.prototype.visitPropertyRead=function(ast,context){return ast.receiver.visit(this),null},RecursiveAstVisitor.prototype.visitPropertyWrite=function(ast,context){return ast.receiver.visit(this),ast.value.visit(this),null},RecursiveAstVisitor.prototype.visitSafePropertyRead=function(ast,context){return ast.receiver.visit(this),null},RecursiveAstVisitor.prototype.visitSafeMethodCall=function(ast,context){return ast.receiver.visit(this),this.visitAll(ast.args,context)},RecursiveAstVisitor.prototype.visitAll=function(asts,context){var _this=this;return asts.forEach(function(ast){return ast.visit(_this,context)}),null},RecursiveAstVisitor.prototype.visitQuote=function(ast,context){return null},RecursiveAstVisitor}(),AstTransformer=function(){function AstTransformer(){}return AstTransformer.prototype.visitImplicitReceiver=function(ast,context){return ast},AstTransformer.prototype.visitInterpolation=function(ast,context){return new Interpolation(ast.span,ast.strings,this.visitAll(ast.expressions))},AstTransformer.prototype.visitLiteralPrimitive=function(ast,context){return new LiteralPrimitive(ast.span,ast.value)},AstTransformer.prototype.visitPropertyRead=function(ast,context){return new PropertyRead(ast.span,ast.receiver.visit(this),ast.name)},AstTransformer.prototype.visitPropertyWrite=function(ast,context){return new PropertyWrite(ast.span,ast.receiver.visit(this),ast.name,ast.value.visit(this))},AstTransformer.prototype.visitSafePropertyRead=function(ast,context){return new SafePropertyRead(ast.span,ast.receiver.visit(this),ast.name)},AstTransformer.prototype.visitMethodCall=function(ast,context){return new MethodCall(ast.span,ast.receiver.visit(this),ast.name,this.visitAll(ast.args))},AstTransformer.prototype.visitSafeMethodCall=function(ast,context){return new SafeMethodCall(ast.span,ast.receiver.visit(this),ast.name,this.visitAll(ast.args))},AstTransformer.prototype.visitFunctionCall=function(ast,context){return new FunctionCall(ast.span,ast.target.visit(this),this.visitAll(ast.args))},AstTransformer.prototype.visitLiteralArray=function(ast,context){return new LiteralArray(ast.span,this.visitAll(ast.expressions))},AstTransformer.prototype.visitLiteralMap=function(ast,context){return new LiteralMap(ast.span,ast.keys,this.visitAll(ast.values))},AstTransformer.prototype.visitBinary=function(ast,context){return new Binary(ast.span,ast.operation,ast.left.visit(this),ast.right.visit(this))},AstTransformer.prototype.visitPrefixNot=function(ast,context){return new PrefixNot(ast.span,ast.expression.visit(this))},AstTransformer.prototype.visitNonNullAssert=function(ast,context){return new NonNullAssert(ast.span,ast.expression.visit(this))},AstTransformer.prototype.visitConditional=function(ast,context){return new Conditional(ast.span,ast.condition.visit(this),ast.trueExp.visit(this),ast.falseExp.visit(this))},AstTransformer.prototype.visitPipe=function(ast,context){return new BindingPipe(ast.span,ast.exp.visit(this),ast.name,this.visitAll(ast.args))},AstTransformer.prototype.visitKeyedRead=function(ast,context){return new KeyedRead(ast.span,ast.obj.visit(this),ast.key.visit(this))},AstTransformer.prototype.visitKeyedWrite=function(ast,context){return new KeyedWrite(ast.span,ast.obj.visit(this),ast.key.visit(this),ast.value.visit(this))},AstTransformer.prototype.visitAll=function(asts){for(var res=new Array(asts.length),i=0;i<asts.length;++i)res[i]=asts[i].visit(this);return res},AstTransformer.prototype.visitChain=function(ast,context){return new Chain(ast.span,this.visitAll(ast.expressions))},AstTransformer.prototype.visitQuote=function(ast,context){return new Quote(ast.span,ast.prefix,ast.uninterpretedExpression,ast.location)},AstTransformer}(),SplitInterpolation=function(){function SplitInterpolation(strings,expressions,offsets){this.strings=strings,this.expressions=expressions,this.offsets=offsets}return SplitInterpolation}(),TemplateBindingParseResult=function(){function TemplateBindingParseResult(templateBindings,warnings,errors){this.templateBindings=templateBindings,this.warnings=warnings,this.errors=errors}return TemplateBindingParseResult}(),Parser=function(){function Parser(_lexer){this._lexer=_lexer,this.errors=[]}return Parser.prototype.parseAction=function(input,location,interpolationConfig){void 0===interpolationConfig&&(interpolationConfig=DEFAULT_INTERPOLATION_CONFIG),this._checkNoInterpolation(input,location,interpolationConfig);var sourceToLex=this._stripComments(input),tokens=this._lexer.tokenize(this._stripComments(input)),ast=new _ParseAST(input,location,tokens,sourceToLex.length,!0,this.errors,input.length-sourceToLex.length).parseChain();return new ASTWithSource(ast,input,location,this.errors)},Parser.prototype.parseBinding=function(input,location,interpolationConfig){void 0===interpolationConfig&&(interpolationConfig=DEFAULT_INTERPOLATION_CONFIG);var ast=this._parseBindingAst(input,location,interpolationConfig);return new ASTWithSource(ast,input,location,this.errors)},Parser.prototype.parseSimpleBinding=function(input,location,interpolationConfig){void 0===interpolationConfig&&(interpolationConfig=DEFAULT_INTERPOLATION_CONFIG);var ast=this._parseBindingAst(input,location,interpolationConfig),errors=SimpleExpressionChecker.check(ast);return errors.length>0&&this._reportError("Host binding expression cannot contain "+errors.join(" "),input,location),new ASTWithSource(ast,input,location,this.errors)},Parser.prototype._reportError=function(message,input,errLocation,ctxLocation){this.errors.push(new ParserError(message,input,errLocation,ctxLocation))},Parser.prototype._parseBindingAst=function(input,location,interpolationConfig){var quote=this._parseQuote(input,location);if(null!=quote)return quote;this._checkNoInterpolation(input,location,interpolationConfig);var sourceToLex=this._stripComments(input),tokens=this._lexer.tokenize(sourceToLex);return new _ParseAST(input,location,tokens,sourceToLex.length,!1,this.errors,input.length-sourceToLex.length).parseChain()},Parser.prototype._parseQuote=function(input,location){if(null==input)return null;var prefixSeparatorIndex=input.indexOf(":");if(-1==prefixSeparatorIndex)return null;var prefix=input.substring(0,prefixSeparatorIndex).trim();if(!isIdentifier(prefix))return null;var uninterpretedExpression=input.substring(prefixSeparatorIndex+1);return new Quote(new ParseSpan(0,input.length),prefix,uninterpretedExpression,location)},Parser.prototype.parseTemplateBindings=function(prefixToken,input,location){var tokens=this._lexer.tokenize(input);if(prefixToken){var prefixTokens=this._lexer.tokenize(prefixToken).map(function(t){return t.index=0,t});tokens.unshift.apply(tokens,prefixTokens)}return new _ParseAST(input,location,tokens,input.length,!1,this.errors,0).parseTemplateBindings()},Parser.prototype.parseInterpolation=function(input,location,interpolationConfig){void 0===interpolationConfig&&(interpolationConfig=DEFAULT_INTERPOLATION_CONFIG);var split=this.splitInterpolation(input,location,interpolationConfig);if(null==split)return null;for(var expressions=[],i=0;i<split.expressions.length;++i){var expressionText=split.expressions[i],sourceToLex=this._stripComments(expressionText),tokens=this._lexer.tokenize(sourceToLex),ast=new _ParseAST(input,location,tokens,sourceToLex.length,!1,this.errors,split.offsets[i]+(expressionText.length-sourceToLex.length)).parseChain();expressions.push(ast)}return new ASTWithSource(new Interpolation(new ParseSpan(0,null==input?0:input.length),split.strings,expressions),input,location,this.errors)},Parser.prototype.splitInterpolation=function(input,location,interpolationConfig){void 0===interpolationConfig&&(interpolationConfig=DEFAULT_INTERPOLATION_CONFIG);var regexp=_createInterpolateRegExp(interpolationConfig),parts=input.split(regexp);if(parts.length<=1)return null;for(var strings=[],expressions=[],offsets=[],offset=0,i=0;i<parts.length;i++){var part=parts[i];i%2==0?(strings.push(part),offset+=part.length):part.trim().length>0?(offset+=interpolationConfig.start.length,expressions.push(part),offsets.push(offset),offset+=part.length+interpolationConfig.end.length):(this._reportError("Blank expressions are not allowed in interpolated strings",input,"at column "+this._findInterpolationErrorColumn(parts,i,interpolationConfig)+" in",location),expressions.push("$implict"),offsets.push(offset))}return new SplitInterpolation(strings,expressions,offsets)},Parser.prototype.wrapLiteralPrimitive=function(input,location){return new ASTWithSource(new LiteralPrimitive(new ParseSpan(0,null==input?0:input.length),input),input,location,this.errors)},Parser.prototype._stripComments=function(input){var i=this._commentStart(input);return null!=i?input.substring(0,i).trim():input},Parser.prototype._commentStart=function(input){for(var outerQuote=null,i=0;i<input.length-1;i++){var char=input.charCodeAt(i),nextChar=input.charCodeAt(i+1);if(char===$SLASH&&nextChar==$SLASH&&null==outerQuote)return i;outerQuote===char?outerQuote=null:null==outerQuote&&isQuote(char)&&(outerQuote=char)}return null},Parser.prototype._checkNoInterpolation=function(input,location,interpolationConfig){var regexp=_createInterpolateRegExp(interpolationConfig),parts=input.split(regexp);parts.length>1&&this._reportError("Got interpolation ("+interpolationConfig.start+interpolationConfig.end+") where expression was expected",input,"at column "+this._findInterpolationErrorColumn(parts,1,interpolationConfig)+" in",location)},Parser.prototype._findInterpolationErrorColumn=function(parts,partInErrIdx,interpolationConfig){for(var errLocation="",j=0;j<partInErrIdx;j++)errLocation+=j%2==0?parts[j]:""+interpolationConfig.start+parts[j]+interpolationConfig.end;return errLocation.length},Parser}(),_ParseAST=function(){function _ParseAST(input,location,tokens,inputLength,parseAction,errors,offset){this.input=input,this.location=location,this.tokens=tokens,this.inputLength=inputLength,this.parseAction=parseAction,this.errors=errors,this.offset=offset,this.rparensExpected=0,this.rbracketsExpected=0,this.rbracesExpected=0,this.index=0}return _ParseAST.prototype.peek=function(offset){var i=this.index+offset;return i<this.tokens.length?this.tokens[i]:EOF},Object.defineProperty(_ParseAST.prototype,"next",{get:function(){return this.peek(0)},enumerable:!0,configurable:!0}),Object.defineProperty(_ParseAST.prototype,"inputIndex",{get:function(){return this.index<this.tokens.length?this.next.index+this.offset:this.inputLength+this.offset},enumerable:!0,configurable:!0}),_ParseAST.prototype.span=function(start){return new ParseSpan(start,this.inputIndex)},_ParseAST.prototype.advance=function(){this.index++},_ParseAST.prototype.optionalCharacter=function(code){return!!this.next.isCharacter(code)&&(this.advance(),!0)},_ParseAST.prototype.peekKeywordLet=function(){return this.next.isKeywordLet()},_ParseAST.prototype.peekKeywordAs=function(){return this.next.isKeywordAs()},_ParseAST.prototype.expectCharacter=function(code){this.optionalCharacter(code)||this.error("Missing expected "+String.fromCharCode(code))},_ParseAST.prototype.optionalOperator=function(op){return!!this.next.isOperator(op)&&(this.advance(),!0)},_ParseAST.prototype.expectOperator=function(operator){this.optionalOperator(operator)||this.error("Missing expected operator "+operator)},_ParseAST.prototype.expectIdentifierOrKeyword=function(){var n=this.next;return n.isIdentifier()||n.isKeyword()?(this.advance(),n.toString()):(this.error("Unexpected token "+n+", expected identifier or keyword"),"")},_ParseAST.prototype.expectIdentifierOrKeywordOrString=function(){var n=this.next;return n.isIdentifier()||n.isKeyword()||n.isString()?(this.advance(),n.toString()):(this.error("Unexpected token "+n+", expected identifier, keyword, or string"),"")},_ParseAST.prototype.parseChain=function(){for(var exprs=[],start=this.inputIndex;this.index<this.tokens.length;){var expr=this.parsePipe();if(exprs.push(expr),this.optionalCharacter($SEMICOLON))for(this.parseAction||this.error("Binding expression cannot contain chained expression");this.optionalCharacter($SEMICOLON););else this.index<this.tokens.length&&this.error("Unexpected token '"+this.next+"'")}return 0==exprs.length?new EmptyExpr(this.span(start)):1==exprs.length?exprs[0]:new Chain(this.span(start),exprs)},_ParseAST.prototype.parsePipe=function(){var result=this.parseExpression();if(this.optionalOperator("|")){this.parseAction&&this.error("Cannot have a pipe in an action expression");do{for(var name_1=this.expectIdentifierOrKeyword(),args=[];this.optionalCharacter(58);)args.push(this.parseExpression());result=new BindingPipe(this.span(result.span.start),result,name_1,args)}while(this.optionalOperator("|"))}return result},_ParseAST.prototype.parseExpression=function(){return this.parseConditional()},_ParseAST.prototype.parseConditional=function(){var start=this.inputIndex,result=this.parseLogicalOr();if(this.optionalOperator("?")){var yes=this.parsePipe(),no=void 0;if(this.optionalCharacter(58))no=this.parsePipe();else{var end=this.inputIndex,expression=this.input.substring(start,end);this.error("Conditional expression "+expression+" requires all 3 expressions"),no=new EmptyExpr(this.span(start))}return new Conditional(this.span(start),result,yes,no)}return result},_ParseAST.prototype.parseLogicalOr=function(){for(var result=this.parseLogicalAnd();this.optionalOperator("||");){var right=this.parseLogicalAnd();result=new Binary(this.span(result.span.start),"||",result,right)}return result},_ParseAST.prototype.parseLogicalAnd=function(){for(var result=this.parseEquality();this.optionalOperator("&&");){var right=this.parseEquality();result=new Binary(this.span(result.span.start),"&&",result,right)}return result},_ParseAST.prototype.parseEquality=function(){for(var result=this.parseRelational();this.next.type==TokenType.Operator;){var operator=this.next.strValue;switch(operator){case"==":case"===":case"!=":case"!==":this.advance();var right=this.parseRelational();result=new Binary(this.span(result.span.start),operator,result,right);continue}break}return result},_ParseAST.prototype.parseRelational=function(){for(var result=this.parseAdditive();this.next.type==TokenType.Operator;){var operator=this.next.strValue;switch(operator){case"<":case">":case"<=":case">=":this.advance();var right=this.parseAdditive();result=new Binary(this.span(result.span.start),operator,result,right);continue}break}return result},_ParseAST.prototype.parseAdditive=function(){for(var result=this.parseMultiplicative();this.next.type==TokenType.Operator;){var operator=this.next.strValue;switch(operator){case"+":case"-":this.advance();var right=this.parseMultiplicative();result=new Binary(this.span(result.span.start),operator,result,right);continue}break}return result},_ParseAST.prototype.parseMultiplicative=function(){for(var result=this.parsePrefix();this.next.type==TokenType.Operator;){var operator=this.next.strValue;switch(operator){case"*":case"%":case"/":this.advance();var right=this.parsePrefix();result=new Binary(this.span(result.span.start),operator,result,right);continue}break}return result},_ParseAST.prototype.parsePrefix=function(){if(this.next.type==TokenType.Operator){var start=this.inputIndex,operator=this.next.strValue,result=void 0;switch(operator){case"+":return this.advance(),result=this.parsePrefix(),new Binary(this.span(start),"-",result,new LiteralPrimitive(new ParseSpan(start,start),0));case"-":return this.advance(),result=this.parsePrefix(),new Binary(this.span(start),operator,new LiteralPrimitive(new ParseSpan(start,start),0),result);case"!":return this.advance(),result=this.parsePrefix(),new PrefixNot(this.span(start),result)}}return this.parseCallChain()},_ParseAST.prototype.parseCallChain=function(){for(var result=this.parsePrimary();;)if(this.optionalCharacter(46))result=this.parseAccessMemberOrMethodCall(result,!1);else if(this.optionalOperator("?."))result=this.parseAccessMemberOrMethodCall(result,!0);else if(this.optionalCharacter(91)){this.rbracketsExpected++;var key=this.parsePipe();if(this.rbracketsExpected--,this.expectCharacter(93),this.optionalOperator("=")){var value=this.parseConditional();result=new KeyedWrite(this.span(result.span.start),result,key,value)}else result=new KeyedRead(this.span(result.span.start),result,key)}else if(this.optionalCharacter(40)){this.rparensExpected++;var args=this.parseCallArguments();this.rparensExpected--,this.expectCharacter(41),result=new FunctionCall(this.span(result.span.start),result,args)}else{if(!this.optionalOperator("!"))return result;result=new NonNullAssert(this.span(result.span.start),result)}},_ParseAST.prototype.parsePrimary=function(){var start=this.inputIndex;if(this.optionalCharacter(40)){this.rparensExpected++;var result=this.parsePipe();return this.rparensExpected--,this.expectCharacter(41),result}if(this.next.isKeywordNull())return this.advance(),new LiteralPrimitive(this.span(start),null);if(this.next.isKeywordUndefined())return this.advance(),new LiteralPrimitive(this.span(start),void 0);if(this.next.isKeywordTrue())return this.advance(),new LiteralPrimitive(this.span(start),!0);if(this.next.isKeywordFalse())return this.advance(),new LiteralPrimitive(this.span(start),!1);if(this.next.isKeywordThis())return this.advance(),new ImplicitReceiver(this.span(start));if(this.optionalCharacter(91)){this.rbracketsExpected++;var elements=this.parseExpressionList(93);return this.rbracketsExpected--,this.expectCharacter(93),new LiteralArray(this.span(start),elements)}if(this.next.isCharacter($LBRACE))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMemberOrMethodCall(new ImplicitReceiver(this.span(start)),!1);if(this.next.isNumber()){var value=this.next.toNumber();return this.advance(),new LiteralPrimitive(this.span(start),value)}if(this.next.isString()){var literalValue=this.next.toString();return this.advance(),new LiteralPrimitive(this.span(start),literalValue)}return this.index>=this.tokens.length?(this.error("Unexpected end of expression: "+this.input),new EmptyExpr(this.span(start))):(this.error("Unexpected token "+this.next),new EmptyExpr(this.span(start)))},_ParseAST.prototype.parseExpressionList=function(terminator){var result=[];if(!this.next.isCharacter(terminator))do{result.push(this.parsePipe())}while(this.optionalCharacter(44));return result},_ParseAST.prototype.parseLiteralMap=function(){var keys=[],values=[],start=this.inputIndex;if(this.expectCharacter($LBRACE),!this.optionalCharacter(125)){this.rbracesExpected++;do{var quoted=this.next.isString(),key=this.expectIdentifierOrKeywordOrString();keys.push({key:key,quoted:quoted}),this.expectCharacter(58),values.push(this.parsePipe())}while(this.optionalCharacter(44));this.rbracesExpected--,this.expectCharacter(125)}return new LiteralMap(this.span(start),keys,values)},_ParseAST.prototype.parseAccessMemberOrMethodCall=function(receiver,isSafe){void 0===isSafe&&(isSafe=!1);var start=receiver.span.start,id=this.expectIdentifierOrKeyword();if(this.optionalCharacter(40)){this.rparensExpected++;var args=this.parseCallArguments();this.expectCharacter(41),this.rparensExpected--;var span=this.span(start);return isSafe?new SafeMethodCall(span,receiver,id,args):new MethodCall(span,receiver,id,args)}if(isSafe)return this.optionalOperator("=")?(this.error("The '?.' operator cannot be used in the assignment"),new EmptyExpr(this.span(start))):new SafePropertyRead(this.span(start),receiver,id);if(this.optionalOperator("=")){if(!this.parseAction)return this.error("Bindings cannot contain assignments"),new EmptyExpr(this.span(start));var value=this.parseConditional();return new PropertyWrite(this.span(start),receiver,id,value)}return new PropertyRead(this.span(start),receiver,id)},_ParseAST.prototype.parseCallArguments=function(){if(this.next.isCharacter(41))return[];var positionals=[];do{positionals.push(this.parsePipe())}while(this.optionalCharacter(44));return positionals},_ParseAST.prototype.expectTemplateBindingKey=function(){var result="",operatorFound=!1;do{result+=this.expectIdentifierOrKeywordOrString(),(operatorFound=this.optionalOperator("-"))&&(result+="-")}while(operatorFound);return result.toString()},_ParseAST.prototype.parseTemplateBindings=function(){for(var bindings=[],prefix=null,warnings=[];this.index<this.tokens.length;){var start=this.inputIndex,keyIsVar=this.peekKeywordLet();keyIsVar&&this.advance();var rawKey=this.expectTemplateBindingKey(),key=rawKey;keyIsVar||(null==prefix?prefix=key:key=prefix+key[0].toUpperCase()+key.substring(1)),this.optionalCharacter(58);var name_2=null,expression=null;if(keyIsVar)name_2=this.optionalOperator("=")?this.expectTemplateBindingKey():"$implicit";else if(this.peekKeywordAs()){var letStart=this.inputIndex;this.advance(),name_2=rawKey,key=this.expectTemplateBindingKey(),keyIsVar=!0}else if(this.next!==EOF&&!this.peekKeywordLet()){var start_1=this.inputIndex,ast=this.parsePipe(),source=this.input.substring(start_1-this.offset,this.inputIndex-this.offset);expression=new ASTWithSource(ast,source,this.location,this.errors)}if(bindings.push(new TemplateBinding(this.span(start),key,keyIsVar,name_2,expression)),this.peekKeywordAs()&&!keyIsVar){var letStart=this.inputIndex;this.advance();var letName=this.expectTemplateBindingKey();bindings.push(new TemplateBinding(this.span(letStart),letName,!0,key,null))}this.optionalCharacter($SEMICOLON)||this.optionalCharacter(44)}return new TemplateBindingParseResult(bindings,warnings,this.errors)},_ParseAST.prototype.error=function(message,index){void 0===index&&(index=null),this.errors.push(new ParserError(message,this.input,this.locationText(index),this.location)),this.skip()},_ParseAST.prototype.locationText=function(index){return void 0===index&&(index=null),null==index&&(index=this.index),index<this.tokens.length?"at column "+(this.tokens[index].index+1)+" in":"at the end of the expression"},_ParseAST.prototype.skip=function(){for(var n=this.next;this.index<this.tokens.length&&!n.isCharacter($SEMICOLON)&&(this.rparensExpected<=0||!n.isCharacter(41))&&(this.rbracesExpected<=0||!n.isCharacter(125))&&(this.rbracketsExpected<=0||!n.isCharacter(93));)this.next.isError()&&this.errors.push(new ParserError(this.next.toString(),this.input,this.locationText(),this.location)),this.advance(),n=this.next},_ParseAST}(),SimpleExpressionChecker=function(){function SimpleExpressionChecker(){this.errors=[]}return SimpleExpressionChecker.check=function(ast){var s=new SimpleExpressionChecker;return ast.visit(s),s.errors},SimpleExpressionChecker.prototype.visitImplicitReceiver=function(ast,context){},SimpleExpressionChecker.prototype.visitInterpolation=function(ast,context){},SimpleExpressionChecker.prototype.visitLiteralPrimitive=function(ast,context){},SimpleExpressionChecker.prototype.visitPropertyRead=function(ast,context){},SimpleExpressionChecker.prototype.visitPropertyWrite=function(ast,context){},SimpleExpressionChecker.prototype.visitSafePropertyRead=function(ast,context){},SimpleExpressionChecker.prototype.visitMethodCall=function(ast,context){},SimpleExpressionChecker.prototype.visitSafeMethodCall=function(ast,context){},SimpleExpressionChecker.prototype.visitFunctionCall=function(ast,context){},SimpleExpressionChecker.prototype.visitLiteralArray=function(ast,context){this.visitAll(ast.expressions)},SimpleExpressionChecker.prototype.visitLiteralMap=function(ast,context){this.visitAll(ast.values)},SimpleExpressionChecker.prototype.visitBinary=function(ast,context){},SimpleExpressionChecker.prototype.visitPrefixNot=function(ast,context){},SimpleExpressionChecker.prototype.visitNonNullAssert=function(ast,context){},SimpleExpressionChecker.prototype.visitConditional=function(ast,context){},SimpleExpressionChecker.prototype.visitPipe=function(ast,context){this.errors.push("pipes")},SimpleExpressionChecker.prototype.visitKeyedRead=function(ast,context){},SimpleExpressionChecker.prototype.visitKeyedWrite=function(ast,context){},SimpleExpressionChecker.prototype.visitAll=function(asts){var _this=this;return asts.map(function(node){return node.visit(_this)})},SimpleExpressionChecker.prototype.visitChain=function(ast,context){},SimpleExpressionChecker.prototype.visitQuote=function(ast,context){},SimpleExpressionChecker}(),ParseLocation=function(){function ParseLocation(file,offset,line,col){this.file=file,this.offset=offset,this.line=line,this.col=col}return ParseLocation.prototype.toString=function(){return null!=this.offset?this.file.url+"@"+this.line+":"+this.col:this.file.url},ParseLocation.prototype.moveBy=function(delta){for(var source=this.file.content,len=source.length,offset=this.offset,line=this.line,col=this.col;offset>0&&delta<0;){offset--,delta++;var ch=source.charCodeAt(offset);if(ch==$LF){line--;var priorLine=source.substr(0,offset-1).lastIndexOf(String.fromCharCode($LF));col=priorLine>0?offset-priorLine:offset}else col--}for(;offset<len&&delta>0;){var ch=source.charCodeAt(offset);offset++,delta--,ch==$LF?(line++,col=0):col++}return new ParseLocation(this.file,offset,line,col)},ParseLocation.prototype.getContext=function(maxChars,maxLines){var content=this.file.content,startOffset=this.offset;if(null!=startOffset){startOffset>content.length-1&&(startOffset=content.length-1);for(var endOffset=startOffset,ctxChars=0,ctxLines=0;ctxChars<maxChars&&startOffset>0&&(startOffset--,ctxChars++,"\n"!=content[startOffset]||++ctxLines!=maxLines););for(ctxChars=0,ctxLines=0;ctxChars<maxChars&&endOffset<content.length-1&&(endOffset++,ctxChars++,"\n"!=content[endOffset]||++ctxLines!=maxLines););return{before:content.substring(startOffset,this.offset),after:content.substring(this.offset,endOffset+1)}}return null},ParseLocation}(),ParseSourceFile=function(){function ParseSourceFile(content,url){this.content=content,this.url=url}return ParseSourceFile}(),ParseSourceSpan=function(){function ParseSourceSpan(start,end,details){void 0===details&&(details=null),this.start=start,this.end=end,this.details=details}return ParseSourceSpan.prototype.toString=function(){return this.start.file.content.substring(this.start.offset,this.end.offset)},ParseSourceSpan}(),ParseErrorLevel={WARNING:0,ERROR:1};ParseErrorLevel[ParseErrorLevel.WARNING]="WARNING",ParseErrorLevel[ParseErrorLevel.ERROR]="ERROR";var ParseError=function(){function ParseError(span,msg,level){void 0===level&&(level=ParseErrorLevel.ERROR),this.span=span,this.msg=msg,this.level=level}return ParseError.prototype.contextualMessage=function(){var ctx=this.span.start.getContext(100,3);return ctx?this.msg+' ("'+ctx.before+"["+ParseErrorLevel[this.level]+" ->]"+ctx.after+'")':this.msg},ParseError.prototype.toString=function(){var details=this.span.details?", "+this.span.details:"";return this.contextualMessage()+": "+this.span.start+details},ParseError}(),TokenType$1={TAG_OPEN_START:0,TAG_OPEN_END:1,TAG_OPEN_END_VOID:2,TAG_CLOSE:3,TEXT:4,ESCAPABLE_RAW_TEXT:5,RAW_TEXT:6,COMMENT_START:7,COMMENT_END:8,CDATA_START:9,CDATA_END:10,ATTR_NAME:11,ATTR_VALUE:12,DOC_TYPE:13,EXPANSION_FORM_START:14,EXPANSION_CASE_VALUE:15,EXPANSION_CASE_EXP_START:16,EXPANSION_CASE_EXP_END:17,EXPANSION_FORM_END:18,EOF:19};TokenType$1[TokenType$1.TAG_OPEN_START]="TAG_OPEN_START",TokenType$1[TokenType$1.TAG_OPEN_END]="TAG_OPEN_END",TokenType$1[TokenType$1.TAG_OPEN_END_VOID]="TAG_OPEN_END_VOID",TokenType$1[TokenType$1.TAG_CLOSE]="TAG_CLOSE",TokenType$1[TokenType$1.TEXT]="TEXT",TokenType$1[TokenType$1.ESCAPABLE_RAW_TEXT]="ESCAPABLE_RAW_TEXT",TokenType$1[TokenType$1.RAW_TEXT]="RAW_TEXT",TokenType$1[TokenType$1.COMMENT_START]="COMMENT_START",TokenType$1[TokenType$1.COMMENT_END]="COMMENT_END",TokenType$1[TokenType$1.CDATA_START]="CDATA_START",TokenType$1[TokenType$1.CDATA_END]="CDATA_END",TokenType$1[TokenType$1.ATTR_NAME]="ATTR_NAME",TokenType$1[TokenType$1.ATTR_VALUE]="ATTR_VALUE",TokenType$1[TokenType$1.DOC_TYPE]="DOC_TYPE",TokenType$1[TokenType$1.EXPANSION_FORM_START]="EXPANSION_FORM_START",TokenType$1[TokenType$1.EXPANSION_CASE_VALUE]="EXPANSION_CASE_VALUE",TokenType$1[TokenType$1.EXPANSION_CASE_EXP_START]="EXPANSION_CASE_EXP_START",TokenType$1[TokenType$1.EXPANSION_CASE_EXP_END]="EXPANSION_CASE_EXP_END",TokenType$1[TokenType$1.EXPANSION_FORM_END]="EXPANSION_FORM_END",TokenType$1[TokenType$1.EOF]="EOF";var Token$1=function(){function Token(type,parts,sourceSpan){this.type=type,this.parts=parts,this.sourceSpan=sourceSpan}return Token}(),TokenError=function(_super){function TokenError(errorMsg,tokenType,span){var _this=_super.call(this,span,errorMsg)||this;return _this.tokenType=tokenType,_this}return __extends(TokenError,_super),TokenError}(ParseError),TokenizeResult=function(){function TokenizeResult(tokens,errors){this.tokens=tokens,this.errors=errors}return TokenizeResult}(),_CR_OR_CRLF_REGEXP=/\r\n?/g,_ControlFlowError=function(){function _ControlFlowError(error){this.error=error}return _ControlFlowError}(),_Tokenizer=function(){function _Tokenizer(_file,_getTagDefinition,_tokenizeIcu,_interpolationConfig){void 0===_interpolationConfig&&(_interpolationConfig=DEFAULT_INTERPOLATION_CONFIG),this._file=_file,this._getTagDefinition=_getTagDefinition,this._tokenizeIcu=_tokenizeIcu,this._interpolationConfig=_interpolationConfig,this._peek=-1,this._nextPeek=-1,this._index=-1,this._line=0,this._column=-1,this._expansionCaseStack=[],this._inInterpolation=!1,this.tokens=[],this.errors=[],this._input=_file.content,this._length=_file.content.length,this._advance()}return _Tokenizer.prototype._processCarriageReturns=function(content){return content.replace(_CR_OR_CRLF_REGEXP,"\n")},_Tokenizer.prototype.tokenize=function(){for(;this._peek!==$EOF;){var start=this._getLocation();try{this._attemptCharCode(60)?this._attemptCharCode(33)?this._attemptCharCode(91)?this._consumeCdata(start):this._attemptCharCode($MINUS)?this._consumeComment(start):this._consumeDocType(start):this._attemptCharCode($SLASH)?this._consumeTagClose(start):this._consumeTagOpen(start):this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeText()}catch(e){if(!(e instanceof _ControlFlowError))throw e;this.errors.push(e.error)}}return this._beginToken(TokenType$1.EOF),this._endToken([]),new TokenizeResult(mergeTextTokens(this.tokens),this.errors)},_Tokenizer.prototype._tokenizeExpansionForm=function(){if(isExpansionFormStart(this._input,this._index,this._interpolationConfig))return this._consumeExpansionFormStart(),!0;if(isExpansionCaseStart(this._peek)&&this._isInExpansionForm())return this._consumeExpansionCaseStart(),!0;if(125===this._peek){if(this._isInExpansionCase())return this._consumeExpansionCaseEnd(),!0;if(this._isInExpansionForm())return this._consumeExpansionFormEnd(),!0}return!1},_Tokenizer.prototype._getLocation=function(){return new ParseLocation(this._file,this._index,this._line,this._column)},_Tokenizer.prototype._getSpan=function(start,end){return void 0===start&&(start=this._getLocation()),void 0===end&&(end=this._getLocation()),new ParseSourceSpan(start,end)},_Tokenizer.prototype._beginToken=function(type,start){void 0===start&&(start=this._getLocation()),this._currentTokenStart=start,this._currentTokenType=type},_Tokenizer.prototype._endToken=function(parts,end){void 0===end&&(end=this._getLocation());var token=new Token$1(this._currentTokenType,parts,new ParseSourceSpan(this._currentTokenStart,end));return this.tokens.push(token),this._currentTokenStart=null,this._currentTokenType=null,token},_Tokenizer.prototype._createError=function(msg,span){this._isInExpansionForm()&&(msg+=' (Do you have an unescaped "{" in your template? Use "{{ \'{\' }}") to escape it.)');var error=new TokenError(msg,this._currentTokenType,span);return this._currentTokenStart=null,this._currentTokenType=null,new _ControlFlowError(error)},_Tokenizer.prototype._advance=function(){if(this._index>=this._length)throw this._createError(_unexpectedCharacterErrorMsg($EOF),this._getSpan());this._peek===$LF?(this._line++,
239
+ this._column=0):this._peek!==$LF&&this._peek!==$CR&&this._column++,this._index++,this._peek=this._index>=this._length?$EOF:this._input.charCodeAt(this._index),this._nextPeek=this._index+1>=this._length?$EOF:this._input.charCodeAt(this._index+1)},_Tokenizer.prototype._attemptCharCode=function(charCode){return this._peek===charCode&&(this._advance(),!0)},_Tokenizer.prototype._attemptCharCodeCaseInsensitive=function(charCode){return!!compareCharCodeCaseInsensitive(this._peek,charCode)&&(this._advance(),!0)},_Tokenizer.prototype._requireCharCode=function(charCode){var location=this._getLocation();if(!this._attemptCharCode(charCode))throw this._createError(_unexpectedCharacterErrorMsg(this._peek),this._getSpan(location,location))},_Tokenizer.prototype._attemptStr=function(chars){var len=chars.length;if(this._index+len>this._length)return!1;for(var initialPosition=this._savePosition(),i=0;i<len;i++)if(!this._attemptCharCode(chars.charCodeAt(i)))return this._restorePosition(initialPosition),!1;return!0},_Tokenizer.prototype._attemptStrCaseInsensitive=function(chars){for(var i=0;i<chars.length;i++)if(!this._attemptCharCodeCaseInsensitive(chars.charCodeAt(i)))return!1;return!0},_Tokenizer.prototype._requireStr=function(chars){var location=this._getLocation();if(!this._attemptStr(chars))throw this._createError(_unexpectedCharacterErrorMsg(this._peek),this._getSpan(location))},_Tokenizer.prototype._attemptCharCodeUntilFn=function(predicate){for(;!predicate(this._peek);)this._advance()},_Tokenizer.prototype._requireCharCodeUntilFn=function(predicate,len){var start=this._getLocation();if(this._attemptCharCodeUntilFn(predicate),this._index-start.offset<len)throw this._createError(_unexpectedCharacterErrorMsg(this._peek),this._getSpan(start,start))},_Tokenizer.prototype._attemptUntilChar=function(char){for(;this._peek!==char;)this._advance()},_Tokenizer.prototype._readChar=function(decodeEntities){if(decodeEntities&&38===this._peek)return this._decodeEntity();var index=this._index;return this._advance(),this._input[index]},_Tokenizer.prototype._decodeEntity=function(){var start=this._getLocation();if(this._advance(),!this._attemptCharCode(35)){var startPosition=this._savePosition();if(this._attemptCharCodeUntilFn(isNamedEntityEnd),this._peek!=$SEMICOLON)return this._restorePosition(startPosition),"&";this._advance();var name_1=this._input.substring(start.offset+1,this._index-1),char=NAMED_ENTITIES[name_1];if(!char)throw this._createError(_unknownEntityErrorMsg(name_1),this._getSpan(start));return char}var isHex=this._attemptCharCode(120)||this._attemptCharCode(88),numberStart=this._getLocation().offset;if(this._attemptCharCodeUntilFn(isDigitEntityEnd),this._peek!=$SEMICOLON)throw this._createError(_unexpectedCharacterErrorMsg(this._peek),this._getSpan());this._advance();var strNum=this._input.substring(numberStart,this._index-1);try{var charCode=parseInt(strNum,isHex?16:10);return String.fromCharCode(charCode)}catch(e){var entity=this._input.substring(start.offset+1,this._index-1);throw this._createError(_unknownEntityErrorMsg(entity),this._getSpan(start))}},_Tokenizer.prototype._consumeRawText=function(decodeEntities,firstCharOfEnd,attemptEndRest){var tagCloseStart,textStart=this._getLocation();this._beginToken(decodeEntities?TokenType$1.ESCAPABLE_RAW_TEXT:TokenType$1.RAW_TEXT,textStart);for(var parts=[];;){if(tagCloseStart=this._getLocation(),this._attemptCharCode(firstCharOfEnd)&&attemptEndRest())break;for(this._index>tagCloseStart.offset&&parts.push(this._input.substring(tagCloseStart.offset,this._index));this._peek!==firstCharOfEnd;)parts.push(this._readChar(decodeEntities))}return this._endToken([this._processCarriageReturns(parts.join(""))],tagCloseStart)},_Tokenizer.prototype._consumeComment=function(start){var _this=this;this._beginToken(TokenType$1.COMMENT_START,start),this._requireCharCode($MINUS),this._endToken([]);var textToken=this._consumeRawText(!1,$MINUS,function(){return _this._attemptStr("->")});this._beginToken(TokenType$1.COMMENT_END,textToken.sourceSpan.end),this._endToken([])},_Tokenizer.prototype._consumeCdata=function(start){var _this=this;this._beginToken(TokenType$1.CDATA_START,start),this._requireStr("CDATA["),this._endToken([]);var textToken=this._consumeRawText(!1,93,function(){return _this._attemptStr("]>")});this._beginToken(TokenType$1.CDATA_END,textToken.sourceSpan.end),this._endToken([])},_Tokenizer.prototype._consumeDocType=function(start){this._beginToken(TokenType$1.DOC_TYPE,start),this._attemptUntilChar($GT),this._advance(),this._endToken([this._input.substring(start.offset+2,this._index-1)])},_Tokenizer.prototype._consumePrefixAndName=function(){for(var nameOrPrefixStart=this._index,prefix=null;58!==this._peek&&!isPrefixEnd(this._peek);)this._advance();var nameStart;return 58===this._peek?(this._advance(),prefix=this._input.substring(nameOrPrefixStart,this._index-1),nameStart=this._index):nameStart=nameOrPrefixStart,this._requireCharCodeUntilFn(isNameEnd,this._index===nameStart?1:0),[prefix,this._input.substring(nameStart,this._index)]},_Tokenizer.prototype._consumeTagOpen=function(start){var tagName,lowercaseTagName,savedPos=this._savePosition();try{if(!isAsciiLetter(this._peek))throw this._createError(_unexpectedCharacterErrorMsg(this._peek),this._getSpan());var nameStart=this._index;for(this._consumeTagOpenStart(start),tagName=this._input.substring(nameStart,this._index),lowercaseTagName=tagName.toLowerCase(),this._attemptCharCodeUntilFn(isNotWhitespace);this._peek!==$SLASH&&this._peek!==$GT;)this._consumeAttributeName(),this._attemptCharCodeUntilFn(isNotWhitespace),this._attemptCharCode($EQ)&&(this._attemptCharCodeUntilFn(isNotWhitespace),this._consumeAttributeValue()),this._attemptCharCodeUntilFn(isNotWhitespace);this._consumeTagOpenEnd()}catch(e){if(e instanceof _ControlFlowError)return this._restorePosition(savedPos),this._beginToken(TokenType$1.TEXT,start),void this._endToken(["<"]);throw e}var contentTokenType=this._getTagDefinition(tagName).contentType;contentTokenType===TagContentType.RAW_TEXT?this._consumeRawTextWithTagClose(lowercaseTagName,!1):contentTokenType===TagContentType.ESCAPABLE_RAW_TEXT&&this._consumeRawTextWithTagClose(lowercaseTagName,!0)},_Tokenizer.prototype._consumeRawTextWithTagClose=function(lowercaseTagName,decodeEntities){var _this=this,textToken=this._consumeRawText(decodeEntities,60,function(){return!!_this._attemptCharCode($SLASH)&&(_this._attemptCharCodeUntilFn(isNotWhitespace),!!_this._attemptStrCaseInsensitive(lowercaseTagName)&&(_this._attemptCharCodeUntilFn(isNotWhitespace),_this._attemptCharCode($GT)))});this._beginToken(TokenType$1.TAG_CLOSE,textToken.sourceSpan.end),this._endToken([null,lowercaseTagName])},_Tokenizer.prototype._consumeTagOpenStart=function(start){this._beginToken(TokenType$1.TAG_OPEN_START,start);var parts=this._consumePrefixAndName();this._endToken(parts)},_Tokenizer.prototype._consumeAttributeName=function(){this._beginToken(TokenType$1.ATTR_NAME);var prefixAndName=this._consumePrefixAndName();this._endToken(prefixAndName)},_Tokenizer.prototype._consumeAttributeValue=function(){this._beginToken(TokenType$1.ATTR_VALUE);var value;if(this._peek===$SQ||this._peek===$DQ){var quoteChar=this._peek;this._advance();for(var parts=[];this._peek!==quoteChar;)parts.push(this._readChar(!0));value=parts.join(""),this._advance()}else{var valueStart=this._index;this._requireCharCodeUntilFn(isNameEnd,1),value=this._input.substring(valueStart,this._index)}this._endToken([this._processCarriageReturns(value)])},_Tokenizer.prototype._consumeTagOpenEnd=function(){var tokenType=this._attemptCharCode($SLASH)?TokenType$1.TAG_OPEN_END_VOID:TokenType$1.TAG_OPEN_END;this._beginToken(tokenType),this._requireCharCode($GT),this._endToken([])},_Tokenizer.prototype._consumeTagClose=function(start){this._beginToken(TokenType$1.TAG_CLOSE,start),this._attemptCharCodeUntilFn(isNotWhitespace);var prefixAndName=this._consumePrefixAndName();this._attemptCharCodeUntilFn(isNotWhitespace),this._requireCharCode($GT),this._endToken(prefixAndName)},_Tokenizer.prototype._consumeExpansionFormStart=function(){this._beginToken(TokenType$1.EXPANSION_FORM_START,this._getLocation()),this._requireCharCode($LBRACE),this._endToken([]),this._expansionCaseStack.push(TokenType$1.EXPANSION_FORM_START),this._beginToken(TokenType$1.RAW_TEXT,this._getLocation());var condition=this._readUntil(44);this._endToken([condition],this._getLocation()),this._requireCharCode(44),this._attemptCharCodeUntilFn(isNotWhitespace),this._beginToken(TokenType$1.RAW_TEXT,this._getLocation());var type=this._readUntil(44);this._endToken([type],this._getLocation()),this._requireCharCode(44),this._attemptCharCodeUntilFn(isNotWhitespace)},_Tokenizer.prototype._consumeExpansionCaseStart=function(){this._beginToken(TokenType$1.EXPANSION_CASE_VALUE,this._getLocation());var value=this._readUntil($LBRACE).trim();this._endToken([value],this._getLocation()),this._attemptCharCodeUntilFn(isNotWhitespace),this._beginToken(TokenType$1.EXPANSION_CASE_EXP_START,this._getLocation()),this._requireCharCode($LBRACE),this._endToken([],this._getLocation()),this._attemptCharCodeUntilFn(isNotWhitespace),this._expansionCaseStack.push(TokenType$1.EXPANSION_CASE_EXP_START)},_Tokenizer.prototype._consumeExpansionCaseEnd=function(){this._beginToken(TokenType$1.EXPANSION_CASE_EXP_END,this._getLocation()),this._requireCharCode(125),this._endToken([],this._getLocation()),this._attemptCharCodeUntilFn(isNotWhitespace),this._expansionCaseStack.pop()},_Tokenizer.prototype._consumeExpansionFormEnd=function(){this._beginToken(TokenType$1.EXPANSION_FORM_END,this._getLocation()),this._requireCharCode(125),this._endToken([]),this._expansionCaseStack.pop()},_Tokenizer.prototype._consumeText=function(){var start=this._getLocation();this._beginToken(TokenType$1.TEXT,start);var parts=[];do{this._interpolationConfig&&this._attemptStr(this._interpolationConfig.start)?(parts.push(this._interpolationConfig.start),this._inInterpolation=!0):this._interpolationConfig&&this._inInterpolation&&this._attemptStr(this._interpolationConfig.end)?(parts.push(this._interpolationConfig.end),this._inInterpolation=!1):parts.push(this._readChar(!0))}while(!this._isTextEnd());this._endToken([this._processCarriageReturns(parts.join(""))])},_Tokenizer.prototype._isTextEnd=function(){if(60===this._peek||this._peek===$EOF)return!0;if(this._tokenizeIcu&&!this._inInterpolation){if(isExpansionFormStart(this._input,this._index,this._interpolationConfig))return!0;if(125===this._peek&&this._isInExpansionCase())return!0}return!1},_Tokenizer.prototype._savePosition=function(){return[this._peek,this._index,this._column,this._line,this.tokens.length]},_Tokenizer.prototype._readUntil=function(char){var start=this._index;return this._attemptUntilChar(char),this._input.substring(start,this._index)},_Tokenizer.prototype._restorePosition=function(position){this._peek=position[0],this._index=position[1],this._column=position[2],this._line=position[3];var nbTokens=position[4];nbTokens<this.tokens.length&&(this.tokens=this.tokens.slice(0,nbTokens))},_Tokenizer.prototype._isInExpansionCase=function(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===TokenType$1.EXPANSION_CASE_EXP_START},_Tokenizer.prototype._isInExpansionForm=function(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===TokenType$1.EXPANSION_FORM_START},_Tokenizer}(),TreeError=function(_super){function TreeError(elementName,span,msg){var _this=_super.call(this,span,msg)||this;return _this.elementName=elementName,_this}return __extends(TreeError,_super),TreeError.create=function(elementName,span,msg){return new TreeError(elementName,span,msg)},TreeError}(ParseError),ParseTreeResult=function(){function ParseTreeResult(rootNodes,errors){this.rootNodes=rootNodes,this.errors=errors}return ParseTreeResult}(),Parser$1=function(){function Parser(getTagDefinition){this.getTagDefinition=getTagDefinition}return Parser.prototype.parse=function(source,url,parseExpansionForms,interpolationConfig){void 0===parseExpansionForms&&(parseExpansionForms=!1),void 0===interpolationConfig&&(interpolationConfig=DEFAULT_INTERPOLATION_CONFIG);var tokensAndErrors=tokenize(source,url,this.getTagDefinition,parseExpansionForms,interpolationConfig),treeAndErrors=new _TreeBuilder(tokensAndErrors.tokens,this.getTagDefinition).build();return new ParseTreeResult(treeAndErrors.rootNodes,tokensAndErrors.errors.concat(treeAndErrors.errors))},Parser}(),_TreeBuilder=function(){function _TreeBuilder(tokens,getTagDefinition){this.tokens=tokens,this.getTagDefinition=getTagDefinition,this._index=-1,this._rootNodes=[],this._errors=[],this._elementStack=[],this._advance()}return _TreeBuilder.prototype.build=function(){for(;this._peek.type!==TokenType$1.EOF;)this._peek.type===TokenType$1.TAG_OPEN_START?this._consumeStartTag(this._advance()):this._peek.type===TokenType$1.TAG_CLOSE?this._consumeEndTag(this._advance()):this._peek.type===TokenType$1.CDATA_START?(this._closeVoidElement(),this._consumeCdata(this._advance())):this._peek.type===TokenType$1.COMMENT_START?(this._closeVoidElement(),this._consumeComment(this._advance())):this._peek.type===TokenType$1.TEXT||this._peek.type===TokenType$1.RAW_TEXT||this._peek.type===TokenType$1.ESCAPABLE_RAW_TEXT?(this._closeVoidElement(),this._consumeText(this._advance())):this._peek.type===TokenType$1.EXPANSION_FORM_START?this._consumeExpansion(this._advance()):this._advance();return new ParseTreeResult(this._rootNodes,this._errors)},_TreeBuilder.prototype._advance=function(){var prev=this._peek;return this._index<this.tokens.length-1&&this._index++,this._peek=this.tokens[this._index],prev},_TreeBuilder.prototype._advanceIf=function(type){return this._peek.type===type?this._advance():null},_TreeBuilder.prototype._consumeCdata=function(startToken){this._consumeText(this._advance()),this._advanceIf(TokenType$1.CDATA_END)},_TreeBuilder.prototype._consumeComment=function(token){var text=this._advanceIf(TokenType$1.RAW_TEXT);this._advanceIf(TokenType$1.COMMENT_END);var value=null!=text?text.parts[0].trim():null;this._addToParent(new Comment(value,token.sourceSpan))},_TreeBuilder.prototype._consumeExpansion=function(token){for(var switchValue=this._advance(),type=this._advance(),cases=[];this._peek.type===TokenType$1.EXPANSION_CASE_VALUE;){var expCase=this._parseExpansionCase();if(!expCase)return;cases.push(expCase)}if(this._peek.type!==TokenType$1.EXPANSION_FORM_END)return void this._errors.push(TreeError.create(null,this._peek.sourceSpan,"Invalid ICU message. Missing '}'."));var sourceSpan=new ParseSourceSpan(token.sourceSpan.start,this._peek.sourceSpan.end);this._addToParent(new Expansion(switchValue.parts[0],type.parts[0],cases,sourceSpan,switchValue.sourceSpan)),this._advance()},_TreeBuilder.prototype._parseExpansionCase=function(){var value=this._advance();if(this._peek.type!==TokenType$1.EXPANSION_CASE_EXP_START)return this._errors.push(TreeError.create(null,this._peek.sourceSpan,"Invalid ICU message. Missing '{'.")),null;var start=this._advance(),exp=this._collectExpansionExpTokens(start);if(!exp)return null;var end=this._advance();exp.push(new Token$1(TokenType$1.EOF,[],end.sourceSpan));var parsedExp=new _TreeBuilder(exp,this.getTagDefinition).build();if(parsedExp.errors.length>0)return this._errors=this._errors.concat(parsedExp.errors),null;var sourceSpan=new ParseSourceSpan(value.sourceSpan.start,end.sourceSpan.end),expSourceSpan=new ParseSourceSpan(start.sourceSpan.start,end.sourceSpan.end);return new ExpansionCase(value.parts[0],parsedExp.rootNodes,sourceSpan,value.sourceSpan,expSourceSpan)},_TreeBuilder.prototype._collectExpansionExpTokens=function(start){for(var exp=[],expansionFormStack=[TokenType$1.EXPANSION_CASE_EXP_START];;){if(this._peek.type!==TokenType$1.EXPANSION_FORM_START&&this._peek.type!==TokenType$1.EXPANSION_CASE_EXP_START||expansionFormStack.push(this._peek.type),this._peek.type===TokenType$1.EXPANSION_CASE_EXP_END){if(!lastOnStack(expansionFormStack,TokenType$1.EXPANSION_CASE_EXP_START))return this._errors.push(TreeError.create(null,start.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(expansionFormStack.pop(),0==expansionFormStack.length)return exp}if(this._peek.type===TokenType$1.EXPANSION_FORM_END){if(!lastOnStack(expansionFormStack,TokenType$1.EXPANSION_FORM_START))return this._errors.push(TreeError.create(null,start.sourceSpan,"Invalid ICU message. Missing '}'.")),null;expansionFormStack.pop()}if(this._peek.type===TokenType$1.EOF)return this._errors.push(TreeError.create(null,start.sourceSpan,"Invalid ICU message. Missing '}'.")),null;exp.push(this._advance())}},_TreeBuilder.prototype._consumeText=function(token){var text=token.parts[0];if(text.length>0&&"\n"==text[0]){var parent_1=this._getParentElement();null!=parent_1&&0==parent_1.children.length&&this.getTagDefinition(parent_1.name).ignoreFirstLf&&(text=text.substring(1))}text.length>0&&this._addToParent(new Text(text,token.sourceSpan))},_TreeBuilder.prototype._closeVoidElement=function(){var el=this._getParentElement();el&&this.getTagDefinition(el.name).isVoid&&this._elementStack.pop()},_TreeBuilder.prototype._consumeStartTag=function(startTagToken){for(var prefix=startTagToken.parts[0],name=startTagToken.parts[1],attrs=[];this._peek.type===TokenType$1.ATTR_NAME;)attrs.push(this._consumeAttr(this._advance()));var fullName=this._getElementFullName(prefix,name,this._getParentElement()),selfClosing=!1;if(this._peek.type===TokenType$1.TAG_OPEN_END_VOID){this._advance(),selfClosing=!0;var tagDef=this.getTagDefinition(fullName);tagDef.canSelfClose||null!==getNsPrefix(fullName)||tagDef.isVoid||this._errors.push(TreeError.create(fullName,startTagToken.sourceSpan,'Only void and foreign elements can be self closed "'+startTagToken.parts[1]+'"'))}else this._peek.type===TokenType$1.TAG_OPEN_END&&(this._advance(),selfClosing=!1);var end=this._peek.sourceSpan.start,span=new ParseSourceSpan(startTagToken.sourceSpan.start,end),el=new Element(fullName,attrs,[],span,span,void 0);this._pushElement(el),selfClosing&&(this._popElement(fullName),el.endSourceSpan=span)},_TreeBuilder.prototype._pushElement=function(el){var parentEl=this._getParentElement();parentEl&&this.getTagDefinition(parentEl.name).isClosedByChild(el.name)&&this._elementStack.pop();var tagDef=this.getTagDefinition(el.name),_a=this._getParentElementSkippingContainers(),parent=_a.parent,container=_a.container;if(parent&&tagDef.requireExtraParent(parent.name)){var newParent=new Element(tagDef.parentToAdd,[],[],el.sourceSpan,el.startSourceSpan,el.endSourceSpan);this._insertBeforeContainer(parent,container,newParent)}this._addToParent(el),this._elementStack.push(el)},_TreeBuilder.prototype._consumeEndTag=function(endTagToken){var fullName=this._getElementFullName(endTagToken.parts[0],endTagToken.parts[1],this._getParentElement());if(this._getParentElement()&&(this._getParentElement().endSourceSpan=endTagToken.sourceSpan),this.getTagDefinition(fullName).isVoid)this._errors.push(TreeError.create(fullName,endTagToken.sourceSpan,'Void elements do not have end tags "'+endTagToken.parts[1]+'"'));else if(!this._popElement(fullName)){var errMsg='Unexpected closing tag "'+fullName+'". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags';this._errors.push(TreeError.create(fullName,endTagToken.sourceSpan,errMsg))}},_TreeBuilder.prototype._popElement=function(fullName){for(var stackIndex=this._elementStack.length-1;stackIndex>=0;stackIndex--){var el=this._elementStack[stackIndex];if(el.name==fullName)return this._elementStack.splice(stackIndex,this._elementStack.length-stackIndex),!0;if(!this.getTagDefinition(el.name).closedByParent)return!1}return!1},_TreeBuilder.prototype._consumeAttr=function(attrName){var fullName=mergeNsAndName(attrName.parts[0],attrName.parts[1]),end=attrName.sourceSpan.end,value="",valueSpan=void 0;if(this._peek.type===TokenType$1.ATTR_VALUE){var valueToken=this._advance();value=valueToken.parts[0],end=valueToken.sourceSpan.end,valueSpan=valueToken.sourceSpan}return new Attribute$1(fullName,value,new ParseSourceSpan(attrName.sourceSpan.start,end),valueSpan)},_TreeBuilder.prototype._getParentElement=function(){return this._elementStack.length>0?this._elementStack[this._elementStack.length-1]:null},_TreeBuilder.prototype._getParentElementSkippingContainers=function(){for(var container=null,i=this._elementStack.length-1;i>=0;i--){if(!isNgContainer(this._elementStack[i].name))return{parent:this._elementStack[i],container:container};container=this._elementStack[i]}return{parent:null,container:container}},_TreeBuilder.prototype._addToParent=function(node){var parent=this._getParentElement();null!=parent?parent.children.push(node):this._rootNodes.push(node)},_TreeBuilder.prototype._insertBeforeContainer=function(parent,container,node){if(container){if(parent){var index=parent.children.indexOf(container);parent.children[index]=node}else this._rootNodes.push(node);node.children.push(container),this._elementStack.splice(this._elementStack.indexOf(container),0,node)}else this._addToParent(node),this._elementStack.push(node)},_TreeBuilder.prototype._getElementFullName=function(prefix,localName,parentElement){return null==prefix&&null==(prefix=this.getTagDefinition(localName).implicitNamespacePrefix)&&null!=parentElement&&(prefix=getNsPrefix(parentElement.name)),mergeNsAndName(prefix,localName)},_TreeBuilder}(),_SerializerVisitor=function(){function _SerializerVisitor(){}return _SerializerVisitor.prototype.visitText=function(text,context){return text.value},_SerializerVisitor.prototype.visitContainer=function(container,context){var _this=this;return"["+container.children.map(function(child){return child.visit(_this)}).join(", ")+"]"},_SerializerVisitor.prototype.visitIcu=function(icu,context){var _this=this,strCases=Object.keys(icu.cases).map(function(k){return k+" {"+icu.cases[k].visit(_this)+"}"});return"{"+icu.expression+", "+icu.type+", "+strCases.join(", ")+"}"},_SerializerVisitor.prototype.visitTagPlaceholder=function(ph,context){var _this=this;return ph.isVoid?'<ph tag name="'+ph.startName+'"/>':'<ph tag name="'+ph.startName+'">'+ph.children.map(function(child){return child.visit(_this)}).join(", ")+'</ph name="'+ph.closeName+'">'},_SerializerVisitor.prototype.visitPlaceholder=function(ph,context){return ph.value?'<ph name="'+ph.name+'">'+ph.value+"</ph>":'<ph name="'+ph.name+'"/>'},_SerializerVisitor.prototype.visitIcuPlaceholder=function(ph,context){return'<ph icu name="'+ph.name+'">'+ph.value.visit(this)+"</ph>"},_SerializerVisitor}(),serializerVisitor=new _SerializerVisitor,_SerializerIgnoreIcuExpVisitor=function(_super){function _SerializerIgnoreIcuExpVisitor(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(_SerializerIgnoreIcuExpVisitor,_super),_SerializerIgnoreIcuExpVisitor.prototype.visitIcu=function(icu,context){var _this=this,strCases=Object.keys(icu.cases).map(function(k){return k+" {"+icu.cases[k].visit(_this)+"}"});return"{"+icu.type+", "+strCases.join(", ")+"}"},_SerializerIgnoreIcuExpVisitor}(_SerializerVisitor),Endian={Little:0,Big:1};Endian[Endian.Little]="Little",Endian[Endian.Big]="Big";/**
240
240
  * @license
241
241
  * Copyright Google Inc. All Rights Reserved.
242
242
  *
@@ -331,7 +331,7 @@ var __assign=commonjsGlobal&&commonjsGlobal.__assign||Object.assign||function(t)
331
331
  * Use of this source code is governed by an MIT-style license that can be
332
332
  * found in the LICENSE file at https://angular.io/license
333
333
  */
334
- var PRIVATE_NAME_CHARS="abcdefghijklmnopqrstuvwxyz",MetadataBundler=function(){function MetadataBundler(root,importAs,host){this.root=root,this.importAs=importAs,this.host=host,this.symbolMap=new Map,this.metadataCache=new Map,this.exports=new Map,this.rootModule="./"+path__default.basename(root)}return MetadataBundler.prototype.getMetadataBundle=function(){var exportedSymbols=this.exportAll(this.rootModule);this.canonicalizeSymbols(exportedSymbols);var metadata=this.getEntries(exportedSymbols),privates=Array.from(this.symbolMap.values()).filter(function(s){return s.referenced&&s.isPrivate}).map(function(s){return{privateName:s.privateName,name:s.declaration.name,module:s.declaration.module}}),origins=Array.from(this.symbolMap.values()).filter(function(s){return s.referenced&&!s.reexport}).reduce(function(p,s){return p[s.isPrivate?s.privateName:s.name]=s.declaration.module,p},{}),exports=this.getReExports(exportedSymbols);return{metadata:{__symbolic:"module",version:schema.METADATA_VERSION,exports:exports.length?exports:void 0,metadata:metadata,origins:origins,importAs:this.importAs},privates:privates}},MetadataBundler.resolveModule=function(importName,from){return resolveModule(importName,from)},MetadataBundler.prototype.getMetadata=function(moduleName){var result=this.metadataCache.get(moduleName);if(!result){if(moduleName.startsWith(".")){var fullModuleName=resolveModule(moduleName,this.root);result=this.host.getMetadataFor(fullModuleName)}this.metadataCache.set(moduleName,result)}return result},MetadataBundler.prototype.exportAll=function(moduleName){var _this=this,module=this.getMetadata(moduleName),result=this.exports.get(moduleName);if(result)return result;result=[];var exportSymbol=function(exportedSymbol,exportAs){var symbol=_this.symbolOf(moduleName,exportAs);result.push(symbol),exportedSymbol.reexportedAs=symbol,symbol.exports=exportedSymbol};if(module&&module.metadata)for(var key in module.metadata){var data=module.metadata[key];if(schema.isMetadataImportedSymbolReferenceExpression(data)){var exportFrom=resolveModule(data.module,moduleName);this.exportAll(exportFrom);var symbol=this.symbolOf(exportFrom,data.name);exportSymbol(symbol,key)}else result.push(this.symbolOf(moduleName,key))}if(module&&module.exports)for(var _i=0,_a=module.exports;_i<_a.length;_i++){var exportDeclaration=_a[_i],exportFrom=resolveModule(exportDeclaration.from,moduleName),exportedSymbols=this.exportAll(exportFrom);if(exportDeclaration.export)for(var _b=0,_c=exportDeclaration.export;_b<_c.length;_b++){var exportItem=_c[_b],name_1="string"==typeof exportItem?exportItem:exportItem.name,exportAs="string"==typeof exportItem?exportItem:exportItem.as,symbol=this.symbolOf(exportFrom,name_1);exportedSymbols&&1==exportedSymbols.length&&exportedSymbols[0].reexport&&"*"==exportedSymbols[0].name&&(symbol.reexport=!0),exportSymbol(this.symbolOf(exportFrom,name_1),exportAs)}else for(var exportedSymbols_1=this.exportAll(exportFrom),_d=0,exportedSymbols_2=exportedSymbols_1;_d<exportedSymbols_2.length;_d++){var exportedSymbol=exportedSymbols_2[_d],name_2=exportedSymbol.name;exportSymbol(exportedSymbol,name_2)}}if(!module){var symbol=this.symbolOf(moduleName,"*");symbol.reexport=!0,result.push(symbol)}return this.exports.set(moduleName,result),result},MetadataBundler.prototype.canonicalizeSymbols=function(exportedSymbols){var symbols=Array.from(this.symbolMap.values());this.exported=new Set(exportedSymbols),symbols.forEach(this.canonicalizeSymbol,this)},MetadataBundler.prototype.canonicalizeSymbol=function(symbol){var rootExport=getRootExport(symbol),declaration=getSymbolDeclaration(symbol),isPrivate=!this.exported.has(rootExport),canonicalSymbol=isPrivate?declaration:rootExport;symbol.isPrivate=isPrivate,symbol.declaration=declaration,symbol.canonicalSymbol=canonicalSymbol,symbol.reexport=declaration.reexport},MetadataBundler.prototype.getEntries=function(exportedSymbols){function newPrivateName(){for(;;){for(var digits=[],index=privateName++,base=PRIVATE_NAME_CHARS;!digits.length||index>0;)digits.unshift(base[index%base.length]),index=Math.floor(index/base.length);digits.unshift("ɵ");var result_1=digits.join("");if(!exportedNames.has(result_1))return result_1}}var _this=this,result={},exportedNames=new Set(exportedSymbols.map(function(s){return s.name})),privateName=0;exportedSymbols.forEach(function(symbol){return _this.convertSymbol(symbol)});var symbolsMap=new Map;return Array.from(this.symbolMap.values()).forEach(function(symbol){if(symbol.referenced&&!symbol.reexport){var name_3=symbol.name,identifier=symbol.declaration.module+":"+symbol.declaration.name;if(symbol.isPrivate&&!symbol.privateName&&(name_3=newPrivateName(),symbol.privateName=name_3),symbolsMap.has(identifier)){symbolsMap.get(identifier).push(name_3)}else symbolsMap.set(identifier,[name_3]);result[name_3]=symbol.value}}),symbolsMap.forEach(function(names,identifier){if(names.length>1){var _a=identifier.split(":"),declaredName=(_a[0],_a[1]),reference_1=names.indexOf(declaredName);-1===reference_1&&(reference_1=0),names.forEach(function(name,i){i!==reference_1&&(result[name]={__symbolic:"reference",name:names[reference_1]})})}}),result},MetadataBundler.prototype.getReExports=function(exportedSymbols){for(var modules=new Map,exportAlls=new Set,_i=0,exportedSymbols_3=exportedSymbols;_i<exportedSymbols_3.length;_i++){var symbol=exportedSymbols_3[_i];if(symbol.reexport){var declaration=symbol.declaration,module_2=declaration.module;if("*"==declaration.name)exportAlls.add(declaration.module);else{var entry=modules.get(module_2);entry||(entry=[],modules.set(module_2,entry));var as=symbol.name,name_4=declaration.name;entry.push({name:name_4,as:as})}}}return Array.from(exportAlls.values()).map(function(from){return{from:from}}).concat(Array.from(modules.entries()).map(function(_a){var from=_a[0];return{export:_a[1],from:from}}))},MetadataBundler.prototype.convertSymbol=function(symbol){var canonicalSymbol=symbol.canonicalSymbol;if(!canonicalSymbol.referenced){canonicalSymbol.referenced=!0;var declaration=canonicalSymbol.declaration,module_3=this.getMetadata(declaration.module);if(module_3){var value=module_3.metadata[declaration.name];value&&!declaration.name.startsWith("___")&&(canonicalSymbol.value=this.convertEntry(declaration.module,value))}}},MetadataBundler.prototype.convertEntry=function(moduleName,value){return schema.isClassMetadata(value)?this.convertClass(moduleName,value):schema.isFunctionMetadata(value)?this.convertFunction(moduleName,value):schema.isInterfaceMetadata(value)?value:this.convertValue(moduleName,value)},MetadataBundler.prototype.convertClass=function(moduleName,value){var _this=this;return{__symbolic:"class",arity:value.arity,extends:this.convertExpression(moduleName,value.extends),decorators:value.decorators&&value.decorators.map(function(d){return _this.convertExpression(moduleName,d)}),members:this.convertMembers(moduleName,value.members),statics:value.statics&&this.convertStatics(moduleName,value.statics)}},MetadataBundler.prototype.convertMembers=function(moduleName,members){var _this=this,result={};for(var name_5 in members){var value=members[name_5];result[name_5]=value.map(function(v){return _this.convertMember(moduleName,v)})}return result},MetadataBundler.prototype.convertMember=function(moduleName,member){var _this=this,result={__symbolic:member.__symbolic};return result.decorators=member.decorators&&member.decorators.map(function(d){return _this.convertExpression(moduleName,d)}),schema.isMethodMetadata(member)&&(result.parameterDecorators=member.parameterDecorators&&member.parameterDecorators.map(function(d){return d&&d.map(function(p){return _this.convertExpression(moduleName,p)})}),schema.isConstructorMetadata(member)&&member.parameters&&(result.parameters=member.parameters.map(function(p){return _this.convertExpression(moduleName,p)}))),result},MetadataBundler.prototype.convertStatics=function(moduleName,statics){var result={};for(var key in statics){var value=statics[key];result[key]=schema.isFunctionMetadata(value)?this.convertFunction(moduleName,value):value}return result},MetadataBundler.prototype.convertFunction=function(moduleName,value){var _this=this;return{__symbolic:"function",parameters:value.parameters,defaults:value.defaults&&value.defaults.map(function(v){return _this.convertValue(moduleName,v)}),value:this.convertValue(moduleName,value.value)}},MetadataBundler.prototype.convertValue=function(moduleName,value){var _this=this;if(isPrimitive(value))return value;if(schema.isMetadataError(value))return this.convertError(moduleName,value);if(schema.isMetadataSymbolicExpression(value))return this.convertExpression(moduleName,value);if(Array.isArray(value))return value.map(function(v){return _this.convertValue(moduleName,v)});var object=value,result={};for(var key in object)result[key]=this.convertValue(moduleName,object[key]);return result},MetadataBundler.prototype.convertExpression=function(moduleName,value){if(value)switch(value.__symbolic){case"error":return this.convertError(moduleName,value);case"reference":return this.convertReference(moduleName,value);default:return this.convertExpressionNode(moduleName,value)}return value},MetadataBundler.prototype.convertError=function(module,value){return{__symbolic:"error",message:value.message,line:value.line,character:value.character,context:value.context,module:module}},MetadataBundler.prototype.convertReference=function(moduleName,value){var _this=this,createReference=function(symbol){var declaration=symbol.declaration;return declaration.module.startsWith(".")?(_this.convertSymbol(symbol),{__symbolic:"reference",get name(){var canonicalSymbol=symbol.canonicalSymbol;if(null==canonicalSymbol.isPrivate)throw Error("Invalid state: isPrivate was not initialized");return canonicalSymbol.isPrivate?canonicalSymbol.privateName:canonicalSymbol.name}}):{__symbolic:"reference",name:declaration.name,module:declaration.module}};if(schema.isMetadataGlobalReferenceExpression(value)){var metadata=this.getMetadata(moduleName);return metadata&&metadata.metadata&&metadata.metadata[value.name]?createReference(this.canonicalSymbolOf(moduleName,value.name)):value.arguments?{__symbolic:"reference",name:value.name,arguments:value.arguments.map(function(a){return _this.convertValue(moduleName,a)})}:value}if(schema.isMetadataImportedSymbolReferenceExpression(value)){if(value.module.startsWith(".")){var referencedModule=resolveModule(value.module,moduleName),referencedName=value.name;return createReference(this.canonicalSymbolOf(referencedModule,referencedName))}return value.arguments?{__symbolic:"reference",name:value.name,module:value.module,arguments:value.arguments.map(function(a){return _this.convertValue(moduleName,a)})}:value}if(schema.isMetadataModuleReferenceExpression(value))return value.module.startsWith(".")?{__symbolic:"error",message:"Unsupported bundled module reference",context:{module:value.module}}:value},MetadataBundler.prototype.convertExpressionNode=function(moduleName,value){var result={__symbolic:value.__symbolic};for(var key in value)result[key]=this.convertValue(moduleName,value[key]);return result},MetadataBundler.prototype.symbolOf=function(module,name){var symbolKey=module+":"+name,symbol=this.symbolMap.get(symbolKey);return symbol||(symbol={module:module,name:name},this.symbolMap.set(symbolKey,symbol)),symbol},MetadataBundler.prototype.canonicalSymbolOf=function(module,name){this.exportAll(module);var symbol=this.symbolOf(module,name);return symbol.canonicalSymbol||this.canonicalizeSymbol(symbol),symbol},MetadataBundler}();exports.MetadataBundler=MetadataBundler;var CompilerHostAdapter=function(){function CompilerHostAdapter(host){this.host=host,this.collector=new collector.MetadataCollector}return CompilerHostAdapter.prototype.getMetadataFor=function(fileName){var sourceFile=this.host.getSourceFile(fileName+".ts",ts__default.ScriptTarget.Latest);return sourceFile&&this.collector.getMetadata(sourceFile)},CompilerHostAdapter}();exports.CompilerHostAdapter=CompilerHostAdapter}),index_writer=createCommonjsModule(function(module,exports){function privateEntriesToIndex(index,privates){var results=[INDEX_HEADER];results.push("export * from '"+index+"';","");for(var exports=new Map,_i=0,privates_1=privates;_i<privates_1.length;_i++){var entry=privates_1[_i],entries=exports.get(entry.module);entries||(entries=[],exports.set(entry.module,entries)),entries.push(entry)}for(var compareEntries=compare(function(e){return e.name}),compareModules=compare(function(e){return e[0]}),orderedExports=Array.from(exports).map(function(_a){return[_a[0],_a[1].sort(compareEntries)]}).sort(compareModules),_a=0,orderedExports_1=orderedExports;_a<orderedExports_1.length;_a++){var _b=orderedExports_1[_a],module_1=_b[0],entries=_b[1],symbols=entries.map(function(e){return e.name+" as "+e.privateName});results.push("export {"+symbols+"} from '"+module_1+"';")}return results.join("\n")}function compare(select){return function(a,b){var ak=select(a),bk=select(b);return ak>bk?1:ak<bk?-1:0}}/**
334
+ var PRIVATE_NAME_CHARS="abcdefghijklmnopqrstuvwxyz",MetadataBundler=function(){function MetadataBundler(root,importAs,host){this.root=root,this.importAs=importAs,this.host=host,this.symbolMap=new Map,this.metadataCache=new Map,this.exports=new Map,this.rootModule="./"+path__default.basename(root)}return MetadataBundler.prototype.getMetadataBundle=function(){var exportedSymbols=this.exportAll(this.rootModule);this.canonicalizeSymbols(exportedSymbols);var metadata=this.getEntries(exportedSymbols),privates=Array.from(this.symbolMap.values()).filter(function(s){return s.referenced&&s.isPrivate}).map(function(s){return{privateName:s.privateName,name:s.declaration.name,module:s.declaration.module}}),origins=Array.from(this.symbolMap.values()).filter(function(s){return s.referenced&&!s.reexport}).reduce(function(p,s){return p[s.isPrivate?s.privateName:s.name]=s.declaration.module,p},{}),exports=this.getReExports(exportedSymbols);return{metadata:{__symbolic:"module",version:schema.METADATA_VERSION,exports:exports.length?exports:void 0,metadata:metadata,origins:origins,importAs:this.importAs},privates:privates}},MetadataBundler.resolveModule=function(importName,from){return resolveModule(importName,from)},MetadataBundler.prototype.getMetadata=function(moduleName){var result=this.metadataCache.get(moduleName);if(!result){if(moduleName.startsWith(".")){var fullModuleName=resolveModule(moduleName,this.root);result=this.host.getMetadataFor(fullModuleName)}this.metadataCache.set(moduleName,result)}return result},MetadataBundler.prototype.exportAll=function(moduleName){var _this=this,module=this.getMetadata(moduleName),result=this.exports.get(moduleName);if(result)return result;result=[];var exportSymbol=function(exportedSymbol,exportAs){var symbol=_this.symbolOf(moduleName,exportAs);result.push(symbol),exportedSymbol.reexportedAs=symbol,symbol.exports=exportedSymbol};if(module&&module.metadata)for(var key in module.metadata){var data=module.metadata[key];if(schema.isMetadataImportedSymbolReferenceExpression(data)){var exportFrom=resolveModule(data.module,moduleName);this.exportAll(exportFrom);var symbol=this.symbolOf(exportFrom,data.name);exportSymbol(symbol,key)}else result.push(this.symbolOf(moduleName,key))}if(module&&module.exports)for(var _i=0,_a=module.exports;_i<_a.length;_i++){var exportDeclaration=_a[_i],exportFrom=resolveModule(exportDeclaration.from,moduleName),exportedSymbols=this.exportAll(exportFrom);if(exportDeclaration.export)for(var _b=0,_c=exportDeclaration.export;_b<_c.length;_b++){var exportItem=_c[_b],name_1="string"==typeof exportItem?exportItem:exportItem.name,exportAs="string"==typeof exportItem?exportItem:exportItem.as,symbol=this.symbolOf(exportFrom,name_1);exportedSymbols&&1==exportedSymbols.length&&exportedSymbols[0].reexport&&"*"==exportedSymbols[0].name&&(symbol.reexport=!0),exportSymbol(this.symbolOf(exportFrom,name_1),exportAs)}else for(var exportedSymbols_1=this.exportAll(exportFrom),_d=0,exportedSymbols_2=exportedSymbols_1;_d<exportedSymbols_2.length;_d++){var exportedSymbol=exportedSymbols_2[_d],name_2=exportedSymbol.name;exportSymbol(exportedSymbol,name_2)}}if(!module){var symbol=this.symbolOf(moduleName,"*");symbol.reexport=!0,result.push(symbol)}return this.exports.set(moduleName,result),result},MetadataBundler.prototype.canonicalizeSymbols=function(exportedSymbols){var symbols=Array.from(this.symbolMap.values());this.exported=new Set(exportedSymbols),symbols.forEach(this.canonicalizeSymbol,this)},MetadataBundler.prototype.canonicalizeSymbol=function(symbol){var rootExport=getRootExport(symbol),declaration=getSymbolDeclaration(symbol),isPrivate=!this.exported.has(rootExport),canonicalSymbol=isPrivate?declaration:rootExport;symbol.isPrivate=isPrivate,symbol.declaration=declaration,symbol.canonicalSymbol=canonicalSymbol,symbol.reexport=declaration.reexport},MetadataBundler.prototype.getEntries=function(exportedSymbols){function newPrivateName(){for(;;){for(var digits=[],index=privateName++,base=PRIVATE_NAME_CHARS;!digits.length||index>0;)digits.unshift(base[index%base.length]),index=Math.floor(index/base.length);digits.unshift("ɵ");var result_1=digits.join("");if(!exportedNames.has(result_1))return result_1}}var _this=this,result={},exportedNames=new Set(exportedSymbols.map(function(s){return s.name})),privateName=0;exportedSymbols.forEach(function(symbol){return _this.convertSymbol(symbol)});var symbolsMap=new Map;return Array.from(this.symbolMap.values()).forEach(function(symbol){if(symbol.referenced&&!symbol.reexport){var name_3=symbol.name,identifier=symbol.declaration.module+":"+symbol.declaration.name;if(symbol.isPrivate&&!symbol.privateName&&(name_3=newPrivateName(),symbol.privateName=name_3),symbolsMap.has(identifier)){symbolsMap.get(identifier).push(name_3)}else symbolsMap.set(identifier,[name_3]);result[name_3]=symbol.value}}),symbolsMap.forEach(function(names,identifier){if(names.length>1){var _a=identifier.split(":"),declaredName=(_a[0],_a[1]),reference_1=names.indexOf(declaredName);-1===reference_1&&(reference_1=0),names.forEach(function(name,i){i!==reference_1&&(result[name]={__symbolic:"reference",name:names[reference_1]})})}}),result},MetadataBundler.prototype.getReExports=function(exportedSymbols){for(var modules=new Map,exportAlls=new Set,_i=0,exportedSymbols_3=exportedSymbols;_i<exportedSymbols_3.length;_i++){var symbol=exportedSymbols_3[_i];if(symbol.reexport){var declaration=symbol.declaration,module_2=declaration.module;if("*"==declaration.name)exportAlls.add(declaration.module);else{var entry=modules.get(module_2);entry||(entry=[],modules.set(module_2,entry));var as=symbol.name,name_4=declaration.name;entry.push({name:name_4,as:as})}}}return Array.from(exportAlls.values()).map(function(from){return{from:from}}).concat(Array.from(modules.entries()).map(function(_a){var from=_a[0];return{export:_a[1],from:from}}))},MetadataBundler.prototype.convertSymbol=function(symbol){var canonicalSymbol=symbol.canonicalSymbol;if(!canonicalSymbol.referenced){canonicalSymbol.referenced=!0;var declaration=canonicalSymbol.declaration,module_3=this.getMetadata(declaration.module);if(module_3){var value=module_3.metadata[declaration.name];value&&!declaration.name.startsWith("___")&&(canonicalSymbol.value=this.convertEntry(declaration.module,value))}}},MetadataBundler.prototype.convertEntry=function(moduleName,value){return schema.isClassMetadata(value)?this.convertClass(moduleName,value):schema.isFunctionMetadata(value)?this.convertFunction(moduleName,value):schema.isInterfaceMetadata(value)?value:this.convertValue(moduleName,value)},MetadataBundler.prototype.convertClass=function(moduleName,value){var _this=this;return{__symbolic:"class",arity:value.arity,extends:this.convertExpression(moduleName,value.extends),decorators:value.decorators&&value.decorators.map(function(d){return _this.convertExpression(moduleName,d)}),members:this.convertMembers(moduleName,value.members),statics:value.statics&&this.convertStatics(moduleName,value.statics)}},MetadataBundler.prototype.convertMembers=function(moduleName,members){var _this=this,result={};for(var name_5 in members){var value=members[name_5];result[name_5]=value.map(function(v){return _this.convertMember(moduleName,v)})}return result},MetadataBundler.prototype.convertMember=function(moduleName,member){var _this=this,result={__symbolic:member.__symbolic};return result.decorators=member.decorators&&member.decorators.map(function(d){return _this.convertExpression(moduleName,d)}),schema.isMethodMetadata(member)&&(result.parameterDecorators=member.parameterDecorators&&member.parameterDecorators.map(function(d){return d&&d.map(function(p){return _this.convertExpression(moduleName,p)})}),schema.isConstructorMetadata(member)&&member.parameters&&(result.parameters=member.parameters.map(function(p){return _this.convertExpression(moduleName,p)}))),result},MetadataBundler.prototype.convertStatics=function(moduleName,statics){var result={};for(var key in statics){var value=statics[key];result[key]=schema.isFunctionMetadata(value)?this.convertFunction(moduleName,value):value}return result},MetadataBundler.prototype.convertFunction=function(moduleName,value){var _this=this;return{__symbolic:"function",parameters:value.parameters,defaults:value.defaults&&value.defaults.map(function(v){return _this.convertValue(moduleName,v)}),value:this.convertValue(moduleName,value.value)}},MetadataBundler.prototype.convertValue=function(moduleName,value){var _this=this;if(isPrimitive(value))return value;if(schema.isMetadataError(value))return this.convertError(moduleName,value);if(schema.isMetadataSymbolicExpression(value))return this.convertExpression(moduleName,value);if(Array.isArray(value))return value.map(function(v){return _this.convertValue(moduleName,v)});var object=value,result={};for(var key in object)result[key]=this.convertValue(moduleName,object[key]);return result},MetadataBundler.prototype.convertExpression=function(moduleName,value){if(value)switch(value.__symbolic){case"error":return this.convertError(moduleName,value);case"reference":return this.convertReference(moduleName,value);default:return this.convertExpressionNode(moduleName,value)}return value},MetadataBundler.prototype.convertError=function(module,value){return{__symbolic:"error",message:value.message,line:value.line,character:value.character,context:value.context,module:module}},MetadataBundler.prototype.convertReference=function(moduleName,value){var _this=this,createReference=function(symbol){var declaration=symbol.declaration;return declaration.module.startsWith(".")?(_this.convertSymbol(symbol),{__symbolic:"reference",get name(){var canonicalSymbol=symbol.canonicalSymbol;if(null==canonicalSymbol.isPrivate)throw Error("Invalid state: isPrivate was not initialized");return canonicalSymbol.isPrivate?canonicalSymbol.privateName:canonicalSymbol.name}}):{__symbolic:"reference",name:declaration.name,module:declaration.module}};if(schema.isMetadataGlobalReferenceExpression(value)){var metadata=this.getMetadata(moduleName);return metadata&&metadata.metadata&&metadata.metadata[value.name]?createReference(this.canonicalSymbolOf(moduleName,value.name)):value.arguments?{__symbolic:"reference",name:value.name,arguments:value.arguments.map(function(a){return _this.convertValue(moduleName,a)})}:value}if(schema.isMetadataImportedSymbolReferenceExpression(value)){if(value.module.startsWith(".")){var referencedModule=resolveModule(value.module,moduleName),referencedName=value.name;return createReference(this.canonicalSymbolOf(referencedModule,referencedName))}return value.arguments?{__symbolic:"reference",name:value.name,module:value.module,arguments:value.arguments.map(function(a){return _this.convertValue(moduleName,a)})}:value}if(schema.isMetadataModuleReferenceExpression(value))return value.module.startsWith(".")?{__symbolic:"error",message:"Unsupported bundled module reference",context:{module:value.module}}:value},MetadataBundler.prototype.convertExpressionNode=function(moduleName,value){var result={__symbolic:value.__symbolic};for(var key in value)result[key]=this.convertValue(moduleName,value[key]);return result},MetadataBundler.prototype.symbolOf=function(module,name){var symbolKey=module+":"+name,symbol=this.symbolMap.get(symbolKey);return symbol||(symbol={module:module,name:name},this.symbolMap.set(symbolKey,symbol)),symbol},MetadataBundler.prototype.canonicalSymbolOf=function(module,name){this.exportAll(module);var symbol=this.symbolOf(module,name);return symbol.canonicalSymbol||this.canonicalizeSymbol(symbol),symbol},MetadataBundler}();exports.MetadataBundler=MetadataBundler;var CompilerHostAdapter=function(){function CompilerHostAdapter(host){this.host=host,this.collector=new collector.MetadataCollector}return CompilerHostAdapter.prototype.getMetadataFor=function(fileName){if(this.host.fileExists(fileName+".ts")){var sourceFile=this.host.getSourceFile(fileName+".ts",ts__default.ScriptTarget.Latest);return sourceFile&&this.collector.getMetadata(sourceFile)}},CompilerHostAdapter}();exports.CompilerHostAdapter=CompilerHostAdapter}),index_writer=createCommonjsModule(function(module,exports){function privateEntriesToIndex(index,privates){var results=[INDEX_HEADER];results.push("export * from '"+index+"';","");for(var exports=new Map,_i=0,privates_1=privates;_i<privates_1.length;_i++){var entry=privates_1[_i],entries=exports.get(entry.module);entries||(entries=[],exports.set(entry.module,entries)),entries.push(entry)}for(var compareEntries=compare(function(e){return e.name}),compareModules=compare(function(e){return e[0]}),orderedExports=Array.from(exports).map(function(_a){return[_a[0],_a[1].sort(compareEntries)]}).sort(compareModules),_a=0,orderedExports_1=orderedExports;_a<orderedExports_1.length;_a++){var _b=orderedExports_1[_a],module_1=_b[0],entries=_b[1],symbols=entries.map(function(e){return e.name+" as "+e.privateName});results.push("export {"+symbols+"} from '"+module_1+"';")}return results.join("\n")}function compare(select){return function(a,b){var ak=select(a),bk=select(b);return ak>bk?1:ak<bk?-1:0}}/**
335
335
  * @license
336
336
  * Copyright Google Inc. All Rights Reserved.
337
337
  *
@@ -402,9 +402,9 @@ var Directive$1=makeDecorator("Directive",function(dir){return void 0===dir&&(di
402
402
  * Use of this source code is governed by an MIT-style license that can be
403
403
  * found in the LICENSE file at https://angular.io/license
404
404
  */
405
- var trace,events,_platform,Version$1=function(){function Version(full){this.full=full,this.major=full.split(".")[0],this.minor=full.split(".")[1],this.patch=full.split(".").slice(2).join(".")}return Version}(),VERSION$2=new Version$1("5.2.4"),Inject$1=makeParamDecorator("Inject",function(token){return{token:token}}),Optional=makeParamDecorator("Optional"),Injectable=makeDecorator("Injectable"),Self=makeParamDecorator("Self"),SkipSelf=makeParamDecorator("SkipSelf"),__window=(makeParamDecorator("Host"),"undefined"!=typeof window&&window),__self="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,__global="undefined"!=typeof global&&global,_global=__window||__global||__self,promise=Promise.resolve(0),_symbolIterator=null,SOURCE="__source",_THROW_IF_NOT_FOUND=new Object,THROW_IF_NOT_FOUND=_THROW_IF_NOT_FOUND,_NullInjector=function(){function _NullInjector(){}return _NullInjector.prototype.get=function(token,notFoundValue){if(void 0===notFoundValue&&(notFoundValue=_THROW_IF_NOT_FOUND),notFoundValue===_THROW_IF_NOT_FOUND)throw new Error("NullInjectorError: No provider for "+stringify$1(token)+"!");return notFoundValue},_NullInjector}(),Injector=function(){function Injector(){}return Injector.create=function(options,parent){return Array.isArray(options)?new StaticInjector(options,parent):new StaticInjector(options.providers,options.parent,options.name||null)},Injector.THROW_IF_NOT_FOUND=_THROW_IF_NOT_FOUND,Injector.NULL=new _NullInjector,Injector}(),IDENT=function(value){return value},EMPTY=[],CIRCULAR=IDENT,MULTI_PROVIDER_FN=function(){return Array.prototype.slice.call(arguments)},GET_PROPERTY_NAME={},ɵ2=GET_PROPERTY_NAME,USE_VALUE$1=function(objWithPropertyToExtract){for(var key in objWithPropertyToExtract)if(objWithPropertyToExtract[key]===GET_PROPERTY_NAME)return key;throw Error("!prop")}({provide:String,useValue:ɵ2}),NG_TEMP_TOKEN_PATH="ngTempTokenPath",NULL_INJECTOR=Injector.NULL,NEW_LINE=/\n/gm,NO_NEW_LINE="ɵ",StaticInjector=function(){function StaticInjector(providers,parent,source){void 0===parent&&(parent=NULL_INJECTOR),void 0===source&&(source=null),this.parent=parent,this.source=source;var records=this._records=new Map;records.set(Injector,{token:Injector,fn:IDENT,deps:EMPTY,value:this,useNew:!1}),recursivelyProcessProviders(records,providers)}return StaticInjector.prototype.get=function(token,notFoundValue){var record=this._records.get(token);try{return tryResolveToken(token,record,this._records,this.parent,notFoundValue)}catch(e){var tokenPath=e[NG_TEMP_TOKEN_PATH];throw token[SOURCE]&&tokenPath.unshift(token[SOURCE]),e.message=formatError("\n"+e.message,tokenPath,this.source),e.ngTokenPath=tokenPath,e[NG_TEMP_TOKEN_PATH]=null,e}},StaticInjector.prototype.toString=function(){var tokens=[];return this._records.forEach(function(v,token){return tokens.push(stringify$1(token))}),"StaticInjector["+tokens.join(", ")+"]"},StaticInjector}(),ERROR_DEBUG_CONTEXT="ngDebugContext",ERROR_ORIGINAL_ERROR="ngOriginalError",ERROR_LOGGER="ngErrorLogger",ErrorHandler=function(){function ErrorHandler(){this._console=console}return ErrorHandler.prototype.handleError=function(error){var originalError=this._findOriginalError(error),context=this._findContext(error),errorLogger=getErrorLogger(error);errorLogger(this._console,"ERROR",error),originalError&&errorLogger(this._console,"ORIGINAL ERROR",originalError),context&&errorLogger(this._console,"ERROR CONTEXT",context)},ErrorHandler.prototype._findContext=function(error){return error?getDebugContext(error)?getDebugContext(error):this._findContext(getOriginalError(error)):null},ErrorHandler.prototype._findOriginalError=function(error){for(var e=getOriginalError(error);e&&getOriginalError(e);)e=getOriginalError(e);return e},ErrorHandler}(),ReflectiveKey=function(){function ReflectiveKey(token,id){if(this.token=token,this.id=id,!token)throw new Error("Token must be defined!");this.displayName=stringify$1(this.token)}return ReflectiveKey.get=function(token){return _globalKeyRegistry.get(resolveForwardRef$1(token))},Object.defineProperty(ReflectiveKey,"numberOfKeys",{get:function(){return _globalKeyRegistry.numberOfKeys},enumerable:!0,configurable:!0}),ReflectiveKey}(),KeyRegistry=function(){function KeyRegistry(){this._allKeys=new Map}return KeyRegistry.prototype.get=function(token){if(token instanceof ReflectiveKey)return token;if(this._allKeys.has(token))return this._allKeys.get(token);var newKey=new ReflectiveKey(token,ReflectiveKey.numberOfKeys);return this._allKeys.set(token,newKey),newKey},Object.defineProperty(KeyRegistry.prototype,"numberOfKeys",{get:function(){return this._allKeys.size},enumerable:!0,configurable:!0}),KeyRegistry}(),_globalKeyRegistry=new KeyRegistry,Type$1$1=Function,DELEGATE_CTOR=/^function\s+\S+\(\)\s*{[\s\S]+\.apply\(this,\s*arguments\)/,ReflectionCapabilities=function(){function ReflectionCapabilities(reflect){this._reflect=reflect||_global.Reflect}return ReflectionCapabilities.prototype.isReflectionEnabled=function(){return!0},ReflectionCapabilities.prototype.factory=function(t){return function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];return new(t.bind.apply(t,[void 0].concat(args)))}},ReflectionCapabilities.prototype._zipTypesAndAnnotations=function(paramTypes,paramAnnotations){var result;result=void 0===paramTypes?new Array(paramAnnotations.length):new Array(paramTypes.length);for(var i=0;i<result.length;i++)void 0===paramTypes?result[i]=[]:paramTypes[i]!=Object?result[i]=[paramTypes[i]]:result[i]=[],paramAnnotations&&null!=paramAnnotations[i]&&(result[i]=result[i].concat(paramAnnotations[i]));return result},ReflectionCapabilities.prototype._ownParameters=function(type,parentCtor){if(DELEGATE_CTOR.exec(type.toString()))return null;if(type.parameters&&type.parameters!==parentCtor.parameters)return type.parameters;var tsickleCtorParams=type.ctorParameters;if(tsickleCtorParams&&tsickleCtorParams!==parentCtor.ctorParameters){var ctorParameters="function"==typeof tsickleCtorParams?tsickleCtorParams():tsickleCtorParams,paramTypes_1=ctorParameters.map(function(ctorParam){return ctorParam&&ctorParam.type}),paramAnnotations_1=ctorParameters.map(function(ctorParam){return ctorParam&&convertTsickleDecoratorIntoMetadata(ctorParam.decorators)});return this._zipTypesAndAnnotations(paramTypes_1,paramAnnotations_1)}var paramAnnotations=type.hasOwnProperty(PARAMETERS)&&type[PARAMETERS],paramTypes=this._reflect&&this._reflect.getOwnMetadata&&this._reflect.getOwnMetadata("design:paramtypes",type);return paramTypes||paramAnnotations?this._zipTypesAndAnnotations(paramTypes,paramAnnotations):new Array(type.length).fill(void 0)},ReflectionCapabilities.prototype.parameters=function(type){if(!isType(type))return[];var parentCtor=getParentCtor(type),parameters=this._ownParameters(type,parentCtor);return parameters||parentCtor===Object||(parameters=this.parameters(parentCtor)),parameters||[]},ReflectionCapabilities.prototype._ownAnnotations=function(typeOrFunc,parentCtor){if(typeOrFunc.annotations&&typeOrFunc.annotations!==parentCtor.annotations){var annotations=typeOrFunc.annotations;return"function"==typeof annotations&&annotations.annotations&&(annotations=annotations.annotations),annotations}return typeOrFunc.decorators&&typeOrFunc.decorators!==parentCtor.decorators?convertTsickleDecoratorIntoMetadata(typeOrFunc.decorators):typeOrFunc.hasOwnProperty(ANNOTATIONS)?typeOrFunc[ANNOTATIONS]:null},ReflectionCapabilities.prototype.annotations=function(typeOrFunc){if(!isType(typeOrFunc))return[];var parentCtor=getParentCtor(typeOrFunc),ownAnnotations=this._ownAnnotations(typeOrFunc,parentCtor)||[];return(parentCtor!==Object?this.annotations(parentCtor):[]).concat(ownAnnotations)},ReflectionCapabilities.prototype._ownPropMetadata=function(typeOrFunc,parentCtor){if(typeOrFunc.propMetadata&&typeOrFunc.propMetadata!==parentCtor.propMetadata){var propMetadata=typeOrFunc.propMetadata;return"function"==typeof propMetadata&&propMetadata.propMetadata&&(propMetadata=propMetadata.propMetadata),propMetadata}if(typeOrFunc.propDecorators&&typeOrFunc.propDecorators!==parentCtor.propDecorators){var propDecorators_1=typeOrFunc.propDecorators,propMetadata_1={};return Object.keys(propDecorators_1).forEach(function(prop){propMetadata_1[prop]=convertTsickleDecoratorIntoMetadata(propDecorators_1[prop])}),propMetadata_1}return typeOrFunc.hasOwnProperty("__prop__metadata__")?typeOrFunc.__prop__metadata__:null},ReflectionCapabilities.prototype.propMetadata=function(typeOrFunc){if(!isType(typeOrFunc))return{};var parentCtor=getParentCtor(typeOrFunc),propMetadata={};if(parentCtor!==Object){var parentPropMetadata_1=this.propMetadata(parentCtor);Object.keys(parentPropMetadata_1).forEach(function(propName){propMetadata[propName]=parentPropMetadata_1[propName]})}var ownPropMetadata=this._ownPropMetadata(typeOrFunc,parentCtor);return ownPropMetadata&&Object.keys(ownPropMetadata).forEach(function(propName){var decorators=[];propMetadata.hasOwnProperty(propName)&&decorators.push.apply(decorators,propMetadata[propName]),decorators.push.apply(decorators,ownPropMetadata[propName]),propMetadata[propName]=decorators}),propMetadata},ReflectionCapabilities.prototype.hasLifecycleHook=function(type,lcProperty){return type instanceof Type$1$1&&lcProperty in type.prototype},ReflectionCapabilities.prototype.guards=function(type){return{}},ReflectionCapabilities.prototype.getter=function(name){return new Function("o","return o."+name+";")},ReflectionCapabilities.prototype.setter=function(name){return new Function("o","v","return o."+name+" = v;")},ReflectionCapabilities.prototype.method=function(name){var functionBody="if (!o."+name+") throw new Error('\""+name+"\" is undefined');\n return o."+name+".apply(o, args);";return new Function("o","args",functionBody)},ReflectionCapabilities.prototype.importUri=function(type){return"object"==typeof type&&type.filePath?type.filePath:"./"+stringify$1(type)},ReflectionCapabilities.prototype.resourceUri=function(type){return"./"+stringify$1(type)},ReflectionCapabilities.prototype.resolveIdentifier=function(name,moduleUrl,members,runtime){return runtime},ReflectionCapabilities.prototype.resolveEnum=function(enumIdentifier,name){return enumIdentifier[name]},ReflectionCapabilities}(),Reflector=function(){function Reflector(reflectionCapabilities){this.reflectionCapabilities=reflectionCapabilities}return Reflector.prototype.updateCapabilities=function(caps){this.reflectionCapabilities=caps},Reflector.prototype.factory=function(type){return this.reflectionCapabilities.factory(type)},Reflector.prototype.parameters=function(typeOrFunc){return this.reflectionCapabilities.parameters(typeOrFunc)},Reflector.prototype.annotations=function(typeOrFunc){return this.reflectionCapabilities.annotations(typeOrFunc)},Reflector.prototype.propMetadata=function(typeOrFunc){return this.reflectionCapabilities.propMetadata(typeOrFunc)},Reflector.prototype.hasLifecycleHook=function(type,lcProperty){return this.reflectionCapabilities.hasLifecycleHook(type,lcProperty)},Reflector.prototype.getter=function(name){return this.reflectionCapabilities.getter(name)},Reflector.prototype.setter=function(name){return this.reflectionCapabilities.setter(name)},Reflector.prototype.method=function(name){return this.reflectionCapabilities.method(name)},Reflector.prototype.importUri=function(type){return this.reflectionCapabilities.importUri(type)},Reflector.prototype.resourceUri=function(type){return this.reflectionCapabilities.resourceUri(type)},Reflector.prototype.resolveIdentifier=function(name,moduleUrl,members,runtime){return this.reflectionCapabilities.resolveIdentifier(name,moduleUrl,members,runtime)},Reflector.prototype.resolveEnum=function(identifier,name){return this.reflectionCapabilities.resolveEnum(identifier,name)},Reflector}(),reflector=new Reflector(new ReflectionCapabilities),ReflectiveDependency=function(){function ReflectiveDependency(key,optional,visibility){this.key=key,this.optional=optional,this.visibility=visibility}return ReflectiveDependency.fromKey=function(key){return new ReflectiveDependency(key,!1,null)},ReflectiveDependency}(),_EMPTY_LIST=[],ResolvedReflectiveProvider_=function(){function ResolvedReflectiveProvider_(key,resolvedFactories,multiProvider){this.key=key,this.resolvedFactories=resolvedFactories,this.multiProvider=multiProvider,this.resolvedFactory=this.resolvedFactories[0]}return ResolvedReflectiveProvider_}(),ResolvedReflectiveFactory=function(){function ResolvedReflectiveFactory(factory,dependencies){this.factory=factory,this.dependencies=dependencies}return ResolvedReflectiveFactory}(),UNDEFINED=new Object,ReflectiveInjector=function(){function ReflectiveInjector(){}return ReflectiveInjector.resolve=function(providers){return resolveReflectiveProviders(providers)},ReflectiveInjector.resolveAndCreate=function(providers,parent){var ResolvedReflectiveProviders=ReflectiveInjector.resolve(providers);return ReflectiveInjector.fromResolvedProviders(ResolvedReflectiveProviders,parent)},ReflectiveInjector.fromResolvedProviders=function(providers,parent){return new ReflectiveInjector_(providers,parent)},ReflectiveInjector}(),ReflectiveInjector_=function(){function ReflectiveInjector_(_providers,_parent){this._constructionCounter=0,this._providers=_providers,this.parent=_parent||null;var len=_providers.length;this.keyIds=new Array(len),this.objs=new Array(len);for(var i=0;i<len;i++)this.keyIds[i]=_providers[i].key.id,this.objs[i]=UNDEFINED}return ReflectiveInjector_.prototype.get=function(token,notFoundValue){return void 0===notFoundValue&&(notFoundValue=THROW_IF_NOT_FOUND),this._getByKey(ReflectiveKey.get(token),null,notFoundValue)},ReflectiveInjector_.prototype.resolveAndCreateChild=function(providers){var ResolvedReflectiveProviders=ReflectiveInjector.resolve(providers);return this.createChildFromResolved(ResolvedReflectiveProviders)},ReflectiveInjector_.prototype.createChildFromResolved=function(providers){var inj=new ReflectiveInjector_(providers);return inj.parent=this,inj},ReflectiveInjector_.prototype.resolveAndInstantiate=function(provider){return this.instantiateResolved(ReflectiveInjector.resolve([provider])[0])},ReflectiveInjector_.prototype.instantiateResolved=function(provider){return this._instantiateProvider(provider)},ReflectiveInjector_.prototype.getProviderAtIndex=function(index){if(index<0||index>=this._providers.length)throw outOfBoundsError(index);return this._providers[index]},ReflectiveInjector_.prototype._new=function(provider){if(this._constructionCounter++>this._getMaxNumberOfObjects())throw cyclicDependencyError(this,provider.key);return this._instantiateProvider(provider)},ReflectiveInjector_.prototype._getMaxNumberOfObjects=function(){return this.objs.length},ReflectiveInjector_.prototype._instantiateProvider=function(provider){if(provider.multiProvider){for(var res=new Array(provider.resolvedFactories.length),i=0;i<provider.resolvedFactories.length;++i)res[i]=this._instantiate(provider,provider.resolvedFactories[i]);return res}return this._instantiate(provider,provider.resolvedFactories[0])},ReflectiveInjector_.prototype._instantiate=function(provider,ResolvedReflectiveFactory$$1){var deps,_this=this,factory=ResolvedReflectiveFactory$$1.factory;try{deps=ResolvedReflectiveFactory$$1.dependencies.map(function(dep){return _this._getByReflectiveDependency(dep)})}catch(e){throw e.addKey&&e.addKey(this,provider.key),e}var obj;try{obj=factory.apply(void 0,deps)}catch(e){throw instantiationError(this,e,e.stack,provider.key)}return obj},ReflectiveInjector_.prototype._getByReflectiveDependency=function(dep){return this._getByKey(dep.key,dep.visibility,dep.optional?null:THROW_IF_NOT_FOUND)},ReflectiveInjector_.prototype._getByKey=function(key,visibility,notFoundValue){return key===ReflectiveInjector_.INJECTOR_KEY?this:visibility instanceof Self?this._getByKeySelf(key,notFoundValue):this._getByKeyDefault(key,notFoundValue,visibility)},ReflectiveInjector_.prototype._getObjByKeyId=function(keyId){for(var i=0;i<this.keyIds.length;i++)if(this.keyIds[i]===keyId)return this.objs[i]===UNDEFINED&&(this.objs[i]=this._new(this._providers[i])),this.objs[i];return UNDEFINED},ReflectiveInjector_.prototype._throwOrNull=function(key,notFoundValue){if(notFoundValue!==THROW_IF_NOT_FOUND)return notFoundValue;throw noProviderError(this,key)},ReflectiveInjector_.prototype._getByKeySelf=function(key,notFoundValue){var obj=this._getObjByKeyId(key.id);return obj!==UNDEFINED?obj:this._throwOrNull(key,notFoundValue)},ReflectiveInjector_.prototype._getByKeyDefault=function(key,notFoundValue,visibility){var inj;for(inj=visibility instanceof SkipSelf?this.parent:this;inj instanceof ReflectiveInjector_;){var inj_=inj,obj=inj_._getObjByKeyId(key.id);if(obj!==UNDEFINED)return obj;inj=inj_.parent}return null!==inj?inj.get(key.token,notFoundValue):this._throwOrNull(key,notFoundValue)},Object.defineProperty(ReflectiveInjector_.prototype,"displayName",{get:function(){return"ReflectiveInjector(providers: ["+_mapProviders(this,function(b){return' "'+b.key.displayName+'" '}).join(", ")+"])"},enumerable:!0,configurable:!0}),ReflectiveInjector_.prototype.toString=function(){return this.displayName},ReflectiveInjector_.INJECTOR_KEY=ReflectiveKey.get(Injector),ReflectiveInjector_}(),APP_INITIALIZER=new InjectionToken("Application Initializer"),ApplicationInitStatus=function(){function ApplicationInitStatus(appInits){var _this=this;this.appInits=appInits,this.initialized=!1,this.done=!1,this.donePromise=new Promise(function(res,rej){_this.resolve=res,_this.reject=rej})}return ApplicationInitStatus.prototype.runInitializers=function(){var _this=this;if(!this.initialized){var asyncInitPromises=[],complete=function(){_this.done=!0,_this.resolve()};if(this.appInits)for(var i=0;i<this.appInits.length;i++){var initResult=this.appInits[i]();isPromise$1(initResult)&&asyncInitPromises.push(initResult)}Promise.all(asyncInitPromises).then(function(){complete()}).catch(function(e){_this.reject(e)}),0===asyncInitPromises.length&&complete(),this.initialized=!0}},ApplicationInitStatus.decorators=[{type:Injectable}],ApplicationInitStatus.ctorParameters=function(){return[{type:Array,decorators:[{type:Inject$1,args:[APP_INITIALIZER]},{type:Optional}]}]},ApplicationInitStatus}(),APP_ID=new InjectionToken("AppId"),APP_ID_RANDOM_PROVIDER={provide:APP_ID,useFactory:_appIdRandomProviderFactory,deps:[]},PLATFORM_INITIALIZER=new InjectionToken("Platform Initializer"),PLATFORM_ID=new InjectionToken("Platform ID"),APP_BOOTSTRAP_LISTENER=new InjectionToken("appBootstrapListener"),Console=(new InjectionToken("Application Packages Root URL"),function(){function Console(){}return Console.prototype.log=function(message){console.log(message)},Console.prototype.warn=function(message){console.warn(message)},Console.decorators=[{type:Injectable}],Console.ctorParameters=function(){return[]},Console}()),Compiler=function(){function Compiler(){}return Compiler.prototype.compileModuleSync=function(moduleType){throw _throwError()},Compiler.prototype.compileModuleAsync=function(moduleType){throw _throwError()},Compiler.prototype.compileModuleAndAllComponentsSync=function(moduleType){throw _throwError()},Compiler.prototype.compileModuleAndAllComponentsAsync=function(moduleType){throw _throwError()},Compiler.prototype.clearCache=function(){},Compiler.prototype.clearCacheFor=function(type){},Compiler.decorators=[{type:Injectable}],Compiler.ctorParameters=function(){return[]},Compiler}(),CompilerFactory=(new InjectionToken("compilerOptions"),function(){function CompilerFactory(){}return CompilerFactory}()),ComponentRef=function(){function ComponentRef(){}return ComponentRef}(),ComponentFactory=function(){function ComponentFactory(){}return ComponentFactory}(),ERROR_COMPONENT="ngComponent",_NullComponentFactoryResolver=function(){function _NullComponentFactoryResolver(){}return _NullComponentFactoryResolver.prototype.resolveComponentFactory=function(component){throw noComponentFactoryError(component)},_NullComponentFactoryResolver}(),ComponentFactoryResolver=function(){function ComponentFactoryResolver(){}return ComponentFactoryResolver.NULL=new _NullComponentFactoryResolver,ComponentFactoryResolver}(),ComponentFactoryBoundToModule=function(_super){function ComponentFactoryBoundToModule(factory,ngModule){var _this=_super.call(this)||this;return _this.factory=factory,_this.ngModule=ngModule,_this.selector=factory.selector,_this.componentType=factory.componentType,_this.ngContentSelectors=factory.ngContentSelectors,_this.inputs=factory.inputs,_this.outputs=factory.outputs,_this}return __extends(ComponentFactoryBoundToModule,_super),ComponentFactoryBoundToModule.prototype.create=function(injector,projectableNodes,rootSelectorOrNode,ngModule){return this.factory.create(injector,projectableNodes,rootSelectorOrNode,ngModule||this.ngModule)},ComponentFactoryBoundToModule}(ComponentFactory),NgModuleRef=function(){function NgModuleRef(){}return NgModuleRef}(),NgModuleFactory=function(){function NgModuleFactory(){}return NgModuleFactory}(),wtfEnabled=function(){var wtf=_global.wtf;return!(!wtf||!(trace=wtf.trace))&&(events=trace.events,!0)}(),wtfCreateScope=wtfEnabled?createScope:function(signature,flags){return noopScope},wtfLeave=wtfEnabled?leave:function(s,r){return r},EventEmitter=function(_super){function EventEmitter(isAsync){void 0===isAsync&&(isAsync=!1);var _this=_super.call(this)||this;return _this.__isAsync=isAsync,_this}return __extends(EventEmitter,_super),EventEmitter.prototype.emit=function(value){_super.prototype.next.call(this,value)},EventEmitter.prototype.subscribe=function(generatorOrNext,error,complete){var schedulerFn,errorFn=function(err){return null},completeFn=function(){return null};generatorOrNext&&"object"==typeof generatorOrNext?(schedulerFn=this.__isAsync?function(value){setTimeout(function(){return generatorOrNext.next(value)})}:function(value){generatorOrNext.next(value)},generatorOrNext.error&&(errorFn=this.__isAsync?function(err){setTimeout(function(){return generatorOrNext.error(err)})}:function(err){generatorOrNext.error(err)}),generatorOrNext.complete&&(completeFn=this.__isAsync?function(){setTimeout(function(){return generatorOrNext.complete()})}:function(){generatorOrNext.complete()})):(schedulerFn=this.__isAsync?function(value){setTimeout(function(){return generatorOrNext(value)})}:function(value){generatorOrNext(value)},error&&(errorFn=this.__isAsync?function(err){setTimeout(function(){return error(err)})}:function(err){error(err)}),complete&&(completeFn=this.__isAsync?function(){setTimeout(function(){return complete()})}:function(){complete()}));var sink=_super.prototype.subscribe.call(this,schedulerFn,errorFn,completeFn);return generatorOrNext instanceof Subscription_2&&generatorOrNext.add(sink),sink},EventEmitter}(Subject_2),NgZone=function(){function NgZone(_a){var _b=_a.enableLongStackTrace,enableLongStackTrace=void 0!==_b&&_b;if(this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new EventEmitter(!1),this.onMicrotaskEmpty=new EventEmitter(!1),this.onStable=new EventEmitter(!1),this.onError=new EventEmitter(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();var self=this;self._nesting=0,self._outer=self._inner=Zone.current,Zone.wtfZoneSpec&&(self._inner=self._inner.fork(Zone.wtfZoneSpec)),enableLongStackTrace&&Zone.longStackTraceZoneSpec&&(self._inner=self._inner.fork(Zone.longStackTraceZoneSpec)),forkInnerZoneWithAngularBehavior(self)}return NgZone.isInAngularZone=function(){return!0===Zone.current.get("isAngularZone")},NgZone.assertInAngularZone=function(){if(!NgZone.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")},NgZone.assertNotInAngularZone=function(){if(NgZone.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")},NgZone.prototype.run=function(fn,applyThis,applyArgs){return this._inner.run(fn,applyThis,applyArgs)},NgZone.prototype.runTask=function(fn,applyThis,applyArgs,name){var zone=this._inner,task=zone.scheduleEventTask("NgZoneEvent: "+name,fn,EMPTY_PAYLOAD,noop,noop);try{return zone.runTask(task,applyThis,applyArgs)}finally{zone.cancelTask(task)}},NgZone.prototype.runGuarded=function(fn,applyThis,applyArgs){return this._inner.runGuarded(fn,applyThis,applyArgs)},NgZone.prototype.runOutsideAngular=function(fn){return this._outer.run(fn)},NgZone}(),EMPTY_PAYLOAD={},NoopNgZone=function(){function NoopNgZone(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new EventEmitter,this.onMicrotaskEmpty=new EventEmitter,this.onStable=new EventEmitter,this.onError=new EventEmitter}return NoopNgZone.prototype.run=function(fn){return fn()},NoopNgZone.prototype.runGuarded=function(fn){return fn()},NoopNgZone.prototype.runOutsideAngular=function(fn){return fn()},NoopNgZone.prototype.runTask=function(fn){return fn()},NoopNgZone}(),Testability=function(){function Testability(_ngZone){this._ngZone=_ngZone,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this._watchAngularEvents()}return Testability.prototype._watchAngularEvents=function(){var _this=this;this._ngZone.onUnstable.subscribe({next:function(){_this._didWork=!0,_this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(function(){_this._ngZone.onStable.subscribe({next:function(){NgZone.assertNotInAngularZone(),scheduleMicroTask(function(){_this._isZoneStable=!0,_this._runCallbacksIfReady()})}})})},Testability.prototype.increasePendingRequestCount=function(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount},Testability.prototype.decreasePendingRequestCount=function(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount},Testability.prototype.isStable=function(){return this._isZoneStable&&0==this._pendingCount&&!this._ngZone.hasPendingMacrotasks},Testability.prototype._runCallbacksIfReady=function(){var _this=this;this.isStable()?scheduleMicroTask(function(){for(;0!==_this._callbacks.length;)_this._callbacks.pop()(_this._didWork);_this._didWork=!1}):this._didWork=!0},Testability.prototype.whenStable=function(callback){this._callbacks.push(callback),this._runCallbacksIfReady()},Testability.prototype.getPendingRequestCount=function(){return this._pendingCount},Testability.prototype.findProviders=function(using,provider,exactMatch){return[]},Testability.decorators=[{type:Injectable}],Testability.ctorParameters=function(){return[{type:NgZone}]},Testability}(),TestabilityRegistry=function(){function TestabilityRegistry(){this._applications=new Map,_testabilityGetter.addToWindow(this)}return TestabilityRegistry.prototype.registerApplication=function(token,testability){this._applications.set(token,testability)},TestabilityRegistry.prototype.unregisterApplication=function(token){this._applications.delete(token)},TestabilityRegistry.prototype.unregisterAllApplications=function(){this._applications.clear()},TestabilityRegistry.prototype.getTestability=function(elem){return this._applications.get(elem)||null},TestabilityRegistry.prototype.getAllTestabilities=function(){return Array.from(this._applications.values())},TestabilityRegistry.prototype.getAllRootElements=function(){return Array.from(this._applications.keys())},TestabilityRegistry.prototype.findTestabilityInTree=function(elem,findInAncestors){return void 0===findInAncestors&&(findInAncestors=!0),_testabilityGetter.findTestabilityInTree(this,elem,findInAncestors)},TestabilityRegistry.decorators=[{type:Injectable}],TestabilityRegistry.ctorParameters=function(){return[]},TestabilityRegistry}(),_NoopGetTestability=function(){function _NoopGetTestability(){}return _NoopGetTestability.prototype.addToWindow=function(registry){},_NoopGetTestability.prototype.findTestabilityInTree=function(registry,elem,findInAncestors){return null},_NoopGetTestability}(),_testabilityGetter=new _NoopGetTestability,_devMode=!0,_runModeLocked=!1,ALLOW_MULTIPLE_PLATFORMS=new InjectionToken("AllowMultipleToken"),PlatformRef=function(){function PlatformRef(_injector){this._injector=_injector,this._modules=[],this._destroyListeners=[],this._destroyed=!1}return PlatformRef.prototype.bootstrapModuleFactory=function(moduleFactory,options){var _this=this,ngZoneOption=options?options.ngZone:void 0,ngZone=getNgZone(ngZoneOption),providers=[{provide:NgZone,useValue:ngZone}];return ngZone.run(function(){var ngZoneInjector=Injector.create({providers:providers,parent:_this.injector,name:moduleFactory.moduleType.name}),moduleRef=moduleFactory.create(ngZoneInjector),exceptionHandler=moduleRef.injector.get(ErrorHandler,null);if(!exceptionHandler)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return moduleRef.onDestroy(function(){return remove(_this._modules,moduleRef)}),ngZone.runOutsideAngular(function(){return ngZone.onError.subscribe({next:function(error){exceptionHandler.handleError(error)}})}),_callAndReportToErrorHandler(exceptionHandler,ngZone,function(){var initStatus=moduleRef.injector.get(ApplicationInitStatus);return initStatus.runInitializers(),initStatus.donePromise.then(function(){return _this._moduleDoBootstrap(moduleRef),moduleRef})})})},PlatformRef.prototype.bootstrapModule=function(moduleType,compilerOptions){var _this=this;void 0===compilerOptions&&(compilerOptions=[]);var compilerFactory=this.injector.get(CompilerFactory),options=optionsReducer({},compilerOptions);return compilerFactory.createCompiler([options]).compileModuleAsync(moduleType).then(function(moduleFactory){return _this.bootstrapModuleFactory(moduleFactory,options)})},PlatformRef.prototype._moduleDoBootstrap=function(moduleRef){var appRef=moduleRef.injector.get(ApplicationRef);if(moduleRef._bootstrapComponents.length>0)moduleRef._bootstrapComponents.forEach(function(f){return appRef.bootstrap(f)});else{if(!moduleRef.instance.ngDoBootstrap)throw new Error("The module "+stringify$1(moduleRef.instance.constructor)+' was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.');moduleRef.instance.ngDoBootstrap(appRef)}this._modules.push(moduleRef)},PlatformRef.prototype.onDestroy=function(callback){this._destroyListeners.push(callback)},Object.defineProperty(PlatformRef.prototype,"injector",{get:function(){return this._injector},enumerable:!0,configurable:!0}),PlatformRef.prototype.destroy=function(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(function(module){return module.destroy()}),this._destroyListeners.forEach(function(listener){return listener()}),this._destroyed=!0},Object.defineProperty(PlatformRef.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!0,configurable:!0}),PlatformRef.decorators=[{type:Injectable}],PlatformRef.ctorParameters=function(){return[{type:Injector}]},PlatformRef}(),ApplicationRef=function(){function ApplicationRef(_zone,_console,_injector,_exceptionHandler,_componentFactoryResolver,_initStatus){var _this=this;this._zone=_zone,this._console=_console,this._injector=_injector,this._exceptionHandler=_exceptionHandler,this._componentFactoryResolver=_componentFactoryResolver,this._initStatus=_initStatus,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._enforceNoNewChanges=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._enforceNoNewChanges=isDevMode(),this._zone.onMicrotaskEmpty.subscribe({next:function(){_this._zone.run(function(){_this.tick()})}});var isCurrentlyStable=new Observable_2(function(observer){_this._stable=_this._zone.isStable&&!_this._zone.hasPendingMacrotasks&&!_this._zone.hasPendingMicrotasks,_this._zone.runOutsideAngular(function(){observer.next(_this._stable),observer.complete()})}),isStable=new Observable_2(function(observer){var stableSub
406
- ;_this._zone.runOutsideAngular(function(){stableSub=_this._zone.onStable.subscribe(function(){NgZone.assertNotInAngularZone(),scheduleMicroTask(function(){_this._stable||_this._zone.hasPendingMacrotasks||_this._zone.hasPendingMicrotasks||(_this._stable=!0,observer.next(!0))})})});var unstableSub=_this._zone.onUnstable.subscribe(function(){NgZone.assertInAngularZone(),_this._stable&&(_this._stable=!1,_this._zone.runOutsideAngular(function(){observer.next(!1)}))});return function(){stableSub.unsubscribe(),unstableSub.unsubscribe()}});this.isStable=merge_2(isCurrentlyStable,share_3.call(isStable))}return ApplicationRef.prototype.bootstrap=function(componentOrFactory,rootSelectorOrNode){var _this=this;if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");var componentFactory;componentFactory=componentOrFactory instanceof ComponentFactory?componentOrFactory:this._componentFactoryResolver.resolveComponentFactory(componentOrFactory),this.componentTypes.push(componentFactory.componentType);var ngModule=componentFactory instanceof ComponentFactoryBoundToModule?null:this._injector.get(NgModuleRef),selectorOrNode=rootSelectorOrNode||componentFactory.selector,compRef=componentFactory.create(Injector.NULL,[],selectorOrNode,ngModule);compRef.onDestroy(function(){_this._unloadComponent(compRef)});var testability=compRef.injector.get(Testability,null);return testability&&compRef.injector.get(TestabilityRegistry).registerApplication(compRef.location.nativeElement,testability),this._loadComponent(compRef),isDevMode()&&this._console.log("Angular is running in the development mode. Call enableProdMode() to enable the production mode."),compRef},ApplicationRef.prototype.tick=function(){var _this=this;if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");var scope=ApplicationRef._tickScope();try{this._runningTick=!0,this._views.forEach(function(view){return view.detectChanges()}),this._enforceNoNewChanges&&this._views.forEach(function(view){return view.checkNoChanges()})}catch(e){this._zone.runOutsideAngular(function(){return _this._exceptionHandler.handleError(e)})}finally{this._runningTick=!1,wtfLeave(scope)}},ApplicationRef.prototype.attachView=function(viewRef){var view=viewRef;this._views.push(view),view.attachToAppRef(this)},ApplicationRef.prototype.detachView=function(viewRef){var view=viewRef;remove(this._views,view),view.detachFromAppRef()},ApplicationRef.prototype._loadComponent=function(componentRef){this.attachView(componentRef.hostView),this.tick(),this.components.push(componentRef),this._injector.get(APP_BOOTSTRAP_LISTENER,[]).concat(this._bootstrapListeners).forEach(function(listener){return listener(componentRef)})},ApplicationRef.prototype._unloadComponent=function(componentRef){this.detachView(componentRef.hostView),remove(this.components,componentRef)},ApplicationRef.prototype.ngOnDestroy=function(){this._views.slice().forEach(function(view){return view.destroy()})},Object.defineProperty(ApplicationRef.prototype,"viewCount",{get:function(){return this._views.length},enumerable:!0,configurable:!0}),ApplicationRef._tickScope=wtfCreateScope("ApplicationRef#tick()"),ApplicationRef.decorators=[{type:Injectable}],ApplicationRef.ctorParameters=function(){return[{type:NgZone},{type:Console},{type:Injector},{type:ErrorHandler},{type:ComponentFactoryResolver},{type:ApplicationInitStatus}]},ApplicationRef}(),Renderer=function(){function Renderer(){}return Renderer}(),RendererFactory2=(new InjectionToken("Renderer2Interceptor"),function(){function RendererFactory2(){}return RendererFactory2}()),Renderer2=function(){function Renderer2(){}return Renderer2}(),ElementRef=function(){function ElementRef(nativeElement){this.nativeElement=nativeElement}return ElementRef}(),QueryList=function(){function QueryList(){this.dirty=!0,this._results=[],this.changes=new EventEmitter}return QueryList.prototype.map=function(fn){return this._results.map(fn)},QueryList.prototype.filter=function(fn){return this._results.filter(fn)},QueryList.prototype.find=function(fn){return this._results.find(fn)},QueryList.prototype.reduce=function(fn,init){return this._results.reduce(fn,init)},QueryList.prototype.forEach=function(fn){this._results.forEach(fn)},QueryList.prototype.some=function(fn){return this._results.some(fn)},QueryList.prototype.toArray=function(){return this._results.slice()},QueryList.prototype[getSymbolIterator()]=function(){return this._results[getSymbolIterator()]()},QueryList.prototype.toString=function(){return this._results.toString()},QueryList.prototype.reset=function(res){this._results=flatten$2(res),this.dirty=!1,this.length=this._results.length,this.last=this._results[this.length-1],this.first=this._results[0]},QueryList.prototype.notifyOnChanges=function(){this.changes.emit(this)},QueryList.prototype.setDirty=function(){this.dirty=!0},QueryList.prototype.destroy=function(){this.changes.complete(),this.changes.unsubscribe()},QueryList}(),TemplateRef=function(){function TemplateRef(){}return TemplateRef}(),ViewContainerRef=function(){function ViewContainerRef(){}return ViewContainerRef}(),ChangeDetectorRef=function(){function ChangeDetectorRef(){}return ChangeDetectorRef}(),ViewRef=function(_super){function ViewRef(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(ViewRef,_super),ViewRef}(ChangeDetectorRef),EventListener=(function(_super){function EmbeddedViewRef(){return null!==_super&&_super.apply(this,arguments)||this}__extends(EmbeddedViewRef,_super)}(ViewRef),function(){function EventListener(name,callback){this.name=name,this.callback=callback}return EventListener}()),DebugNode=function(){function DebugNode(nativeNode,parent,_debugContext){this._debugContext=_debugContext,this.nativeNode=nativeNode,parent&&parent instanceof DebugElement?parent.addChild(this):this.parent=null,this.listeners=[]}return Object.defineProperty(DebugNode.prototype,"injector",{get:function(){return this._debugContext.injector},enumerable:!0,configurable:!0}),Object.defineProperty(DebugNode.prototype,"componentInstance",{get:function(){return this._debugContext.component},enumerable:!0,configurable:!0}),Object.defineProperty(DebugNode.prototype,"context",{get:function(){return this._debugContext.context},enumerable:!0,configurable:!0}),Object.defineProperty(DebugNode.prototype,"references",{get:function(){return this._debugContext.references},enumerable:!0,configurable:!0}),Object.defineProperty(DebugNode.prototype,"providerTokens",{get:function(){return this._debugContext.providerTokens},enumerable:!0,configurable:!0}),DebugNode}(),DebugElement=function(_super){function DebugElement(nativeNode,parent,_debugContext){var _this=_super.call(this,nativeNode,parent,_debugContext)||this;return _this.properties={},_this.attributes={},_this.classes={},_this.styles={},_this.childNodes=[],_this.nativeElement=nativeNode,_this}return __extends(DebugElement,_super),DebugElement.prototype.addChild=function(child){child&&(this.childNodes.push(child),child.parent=this)},DebugElement.prototype.removeChild=function(child){var childIndex=this.childNodes.indexOf(child);-1!==childIndex&&(child.parent=null,this.childNodes.splice(childIndex,1))},DebugElement.prototype.insertChildrenAfter=function(child,newChildren){var _this=this,siblingIndex=this.childNodes.indexOf(child);-1!==siblingIndex&&((_a=this.childNodes).splice.apply(_a,[siblingIndex+1,0].concat(newChildren)),newChildren.forEach(function(c){c.parent&&c.parent.removeChild(c),c.parent=_this}));var _a},DebugElement.prototype.insertBefore=function(refChild,newChild){var refIndex=this.childNodes.indexOf(refChild);-1===refIndex?this.addChild(newChild):(newChild.parent&&newChild.parent.removeChild(newChild),newChild.parent=this,this.childNodes.splice(refIndex,0,newChild))},DebugElement.prototype.query=function(predicate){return this.queryAll(predicate)[0]||null},DebugElement.prototype.queryAll=function(predicate){var matches=[];return _queryElementChildren(this,predicate,matches),matches},DebugElement.prototype.queryAllNodes=function(predicate){var matches=[];return _queryNodeChildren(this,predicate,matches),matches},Object.defineProperty(DebugElement.prototype,"children",{get:function(){return this.childNodes.filter(function(node){return node instanceof DebugElement})},enumerable:!0,configurable:!0}),DebugElement.prototype.triggerEventHandler=function(eventName,eventObj){this.listeners.forEach(function(listener){listener.name==eventName&&listener.callback(eventObj)})},DebugElement}(DebugNode),_nativeNodeToDebugNode=new Map,WrappedValue=function(){function WrappedValue(value){this.wrapped=value}return WrappedValue.wrap=function(value){return new WrappedValue(value)},WrappedValue.unwrap=function(value){return WrappedValue.isWrapped(value)?value.wrapped:value},WrappedValue.isWrapped=function(value){return value instanceof WrappedValue},WrappedValue}(),SimpleChange=function(){function SimpleChange(previousValue,currentValue,firstChange){this.previousValue=previousValue,this.currentValue=currentValue,this.firstChange=firstChange}return SimpleChange.prototype.isFirstChange=function(){return this.firstChange},SimpleChange}(),DefaultIterableDifferFactory=function(){function DefaultIterableDifferFactory(){}return DefaultIterableDifferFactory.prototype.supports=function(obj){return isListLikeIterable(obj)},DefaultIterableDifferFactory.prototype.create=function(trackByFn){return new DefaultIterableDiffer(trackByFn)},DefaultIterableDifferFactory}(),trackByIdentity=function(index,item){return item},DefaultIterableDiffer=function(){function DefaultIterableDiffer(trackByFn){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=trackByFn||trackByIdentity}return DefaultIterableDiffer.prototype.forEachItem=function(fn){var record;for(record=this._itHead;null!==record;record=record._next)fn(record)},DefaultIterableDiffer.prototype.forEachOperation=function(fn){for(var nextIt=this._itHead,nextRemove=this._removalsHead,addRemoveOffset=0,moveOffsets=null;nextIt||nextRemove;){var record=!nextRemove||nextIt&&nextIt.currentIndex<getPreviousIndex(nextRemove,addRemoveOffset,moveOffsets)?nextIt:nextRemove,adjPreviousIndex=getPreviousIndex(record,addRemoveOffset,moveOffsets),currentIndex=record.currentIndex;if(record===nextRemove)addRemoveOffset--,nextRemove=nextRemove._nextRemoved;else if(nextIt=nextIt._next,null==record.previousIndex)addRemoveOffset++;else{moveOffsets||(moveOffsets=[]);var localMovePreviousIndex=adjPreviousIndex-addRemoveOffset,localCurrentIndex=currentIndex-addRemoveOffset;if(localMovePreviousIndex!=localCurrentIndex){for(var i=0;i<localMovePreviousIndex;i++){var offset=i<moveOffsets.length?moveOffsets[i]:moveOffsets[i]=0,index=offset+i;localCurrentIndex<=index&&index<localMovePreviousIndex&&(moveOffsets[i]=offset+1)}var previousIndex=record.previousIndex;moveOffsets[previousIndex]=localCurrentIndex-localMovePreviousIndex}}adjPreviousIndex!==currentIndex&&fn(record,adjPreviousIndex,currentIndex)}},DefaultIterableDiffer.prototype.forEachPreviousItem=function(fn){var record;for(record=this._previousItHead;null!==record;record=record._nextPrevious)fn(record)},DefaultIterableDiffer.prototype.forEachAddedItem=function(fn){var record;for(record=this._additionsHead;null!==record;record=record._nextAdded)fn(record)},DefaultIterableDiffer.prototype.forEachMovedItem=function(fn){var record;for(record=this._movesHead;null!==record;record=record._nextMoved)fn(record)},DefaultIterableDiffer.prototype.forEachRemovedItem=function(fn){var record;for(record=this._removalsHead;null!==record;record=record._nextRemoved)fn(record)},DefaultIterableDiffer.prototype.forEachIdentityChange=function(fn){var record;for(record=this._identityChangesHead;null!==record;record=record._nextIdentityChange)fn(record)},DefaultIterableDiffer.prototype.diff=function(collection){if(null==collection&&(collection=[]),!isListLikeIterable(collection))throw new Error("Error trying to diff '"+stringify$1(collection)+"'. Only arrays and iterables are allowed");return this.check(collection)?this:null},DefaultIterableDiffer.prototype.onDestroy=function(){},DefaultIterableDiffer.prototype.check=function(collection){var _this=this;this._reset();var index,item,itemTrackBy,record=this._itHead,mayBeDirty=!1;if(Array.isArray(collection)){this.length=collection.length;for(var index_1=0;index_1<this.length;index_1++)item=collection[index_1],itemTrackBy=this._trackByFn(index_1,item),null!==record&&looseIdentical(record.trackById,itemTrackBy)?(mayBeDirty&&(record=this._verifyReinsertion(record,item,itemTrackBy,index_1)),looseIdentical(record.item,item)||this._addIdentityChange(record,item)):(record=this._mismatch(record,item,itemTrackBy,index_1),mayBeDirty=!0),record=record._next}else index=0,iterateListLike(collection,function(item){itemTrackBy=_this._trackByFn(index,item),null!==record&&looseIdentical(record.trackById,itemTrackBy)?(mayBeDirty&&(record=_this._verifyReinsertion(record,item,itemTrackBy,index)),looseIdentical(record.item,item)||_this._addIdentityChange(record,item)):(record=_this._mismatch(record,item,itemTrackBy,index),mayBeDirty=!0),record=record._next,index++}),this.length=index;return this._truncate(record),this.collection=collection,this.isDirty},Object.defineProperty(DefaultIterableDiffer.prototype,"isDirty",{get:function(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead},enumerable:!0,configurable:!0}),DefaultIterableDiffer.prototype._reset=function(){if(this.isDirty){var record=void 0,nextRecord=void 0;for(record=this._previousItHead=this._itHead;null!==record;record=record._next)record._nextPrevious=record._next;for(record=this._additionsHead;null!==record;record=record._nextAdded)record.previousIndex=record.currentIndex;for(this._additionsHead=this._additionsTail=null,record=this._movesHead;null!==record;record=nextRecord)record.previousIndex=record.currentIndex,nextRecord=record._nextMoved;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}},DefaultIterableDiffer.prototype._mismatch=function(record,item,itemTrackBy,index){var previousRecord;return null===record?previousRecord=this._itTail:(previousRecord=record._prev,this._remove(record)),record=null===this._linkedRecords?null:this._linkedRecords.get(itemTrackBy,index),null!==record?(looseIdentical(record.item,item)||this._addIdentityChange(record,item),this._moveAfter(record,previousRecord,index)):(record=null===this._unlinkedRecords?null:this._unlinkedRecords.get(itemTrackBy,null),null!==record?(looseIdentical(record.item,item)||this._addIdentityChange(record,item),this._reinsertAfter(record,previousRecord,index)):record=this._addAfter(new IterableChangeRecord_(item,itemTrackBy),previousRecord,index)),record},DefaultIterableDiffer.prototype._verifyReinsertion=function(record,item,itemTrackBy,index){var reinsertRecord=null===this._unlinkedRecords?null:this._unlinkedRecords.get(itemTrackBy,null);return null!==reinsertRecord?record=this._reinsertAfter(reinsertRecord,record._prev,index):record.currentIndex!=index&&(record.currentIndex=index,this._addToMoves(record,index)),record},DefaultIterableDiffer.prototype._truncate=function(record){for(;null!==record;){var nextRecord=record._next;this._addToRemovals(this._unlink(record)),record=nextRecord}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)},DefaultIterableDiffer.prototype._reinsertAfter=function(record,prevRecord,index){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(record);var prev=record._prevRemoved,next=record._nextRemoved;return null===prev?this._removalsHead=next:prev._nextRemoved=next,null===next?this._removalsTail=prev:next._prevRemoved=prev,this._insertAfter(record,prevRecord,index),this._addToMoves(record,index),record},DefaultIterableDiffer.prototype._moveAfter=function(record,prevRecord,index){return this._unlink(record),this._insertAfter(record,prevRecord,index),this._addToMoves(record,index),record},DefaultIterableDiffer.prototype._addAfter=function(record,prevRecord,index){return this._insertAfter(record,prevRecord,index),null===this._additionsTail?this._additionsTail=this._additionsHead=record:this._additionsTail=this._additionsTail._nextAdded=record,record},DefaultIterableDiffer.prototype._insertAfter=function(record,prevRecord,index){var next=null===prevRecord?this._itHead:prevRecord._next;return record._next=next,record._prev=prevRecord,null===next?this._itTail=record:next._prev=record,null===prevRecord?this._itHead=record:prevRecord._next=record,null===this._linkedRecords&&(this._linkedRecords=new _DuplicateMap),this._linkedRecords.put(record),record.currentIndex=index,record},DefaultIterableDiffer.prototype._remove=function(record){return this._addToRemovals(this._unlink(record))},DefaultIterableDiffer.prototype._unlink=function(record){null!==this._linkedRecords&&this._linkedRecords.remove(record);var prev=record._prev,next=record._next;return null===prev?this._itHead=next:prev._next=next,null===next?this._itTail=prev:next._prev=prev,record},DefaultIterableDiffer.prototype._addToMoves=function(record,toIndex){return record.previousIndex===toIndex?record:(null===this._movesTail?this._movesTail=this._movesHead=record:this._movesTail=this._movesTail._nextMoved=record,record)},DefaultIterableDiffer.prototype._addToRemovals=function(record){return null===this._unlinkedRecords&&(this._unlinkedRecords=new _DuplicateMap),this._unlinkedRecords.put(record),record.currentIndex=null,record._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=record,record._prevRemoved=null):(record._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=record),record},DefaultIterableDiffer.prototype._addIdentityChange=function(record,item){return record.item=item,null===this._identityChangesTail?this._identityChangesTail=this._identityChangesHead=record:this._identityChangesTail=this._identityChangesTail._nextIdentityChange=record,record},DefaultIterableDiffer}(),IterableChangeRecord_=function(){function IterableChangeRecord_(item,trackById){this.item=item,this.trackById=trackById,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}return IterableChangeRecord_}(),_DuplicateItemRecordList=function(){function _DuplicateItemRecordList(){this._head=null,this._tail=null}return _DuplicateItemRecordList.prototype.add=function(record){null===this._head?(this._head=this._tail=record,record._nextDup=null,record._prevDup=null):(this._tail._nextDup=record,record._prevDup=this._tail,record._nextDup=null,this._tail=record)},_DuplicateItemRecordList.prototype.get=function(trackById,atOrAfterIndex){var record;for(record=this._head;null!==record;record=record._nextDup)if((null===atOrAfterIndex||atOrAfterIndex<=record.currentIndex)&&looseIdentical(record.trackById,trackById))return record;return null},_DuplicateItemRecordList.prototype.remove=function(record){var prev=record._prevDup,next=record._nextDup;return null===prev?this._head=next:prev._nextDup=next,null===next?this._tail=prev:next._prevDup=prev,null===this._head},_DuplicateItemRecordList}(),_DuplicateMap=function(){function _DuplicateMap(){this.map=new Map}return _DuplicateMap.prototype.put=function(record){var key=record.trackById,duplicates=this.map.get(key);duplicates||(duplicates=new _DuplicateItemRecordList,this.map.set(key,duplicates)),duplicates.add(record)},_DuplicateMap.prototype.get=function(trackById,atOrAfterIndex){var key=trackById,recordList=this.map.get(key);return recordList?recordList.get(trackById,atOrAfterIndex):null},_DuplicateMap.prototype.remove=function(record){var key=record.trackById;return this.map.get(key).remove(record)&&this.map.delete(key),record},Object.defineProperty(_DuplicateMap.prototype,"isEmpty",{get:function(){return 0===this.map.size},enumerable:!0,configurable:!0}),_DuplicateMap.prototype.clear=function(){this.map.clear()},_DuplicateMap}(),DefaultKeyValueDifferFactory=function(){function DefaultKeyValueDifferFactory(){}return DefaultKeyValueDifferFactory.prototype.supports=function(obj){return obj instanceof Map||isJsObject(obj)},DefaultKeyValueDifferFactory.prototype.create=function(){return new DefaultKeyValueDiffer},DefaultKeyValueDifferFactory}(),DefaultKeyValueDiffer=function(){function DefaultKeyValueDiffer(){this._records=new Map,this._mapHead=null,this._appendAfter=null,this._previousMapHead=null,this._changesHead=null,this._changesTail=null,this._additionsHead=null,this._additionsTail=null,this._removalsHead=null,this._removalsTail=null}return Object.defineProperty(DefaultKeyValueDiffer.prototype,"isDirty",{get:function(){return null!==this._additionsHead||null!==this._changesHead||null!==this._removalsHead},enumerable:!0,configurable:!0}),DefaultKeyValueDiffer.prototype.forEachItem=function(fn){var record;for(record=this._mapHead;null!==record;record=record._next)fn(record)},DefaultKeyValueDiffer.prototype.forEachPreviousItem=function(fn){var record;for(record=this._previousMapHead;null!==record;record=record._nextPrevious)fn(record)},DefaultKeyValueDiffer.prototype.forEachChangedItem=function(fn){var record;for(record=this._changesHead;null!==record;record=record._nextChanged)fn(record)},DefaultKeyValueDiffer.prototype.forEachAddedItem=function(fn){var record;for(record=this._additionsHead;null!==record;record=record._nextAdded)fn(record)},DefaultKeyValueDiffer.prototype.forEachRemovedItem=function(fn){var record;for(record=this._removalsHead;null!==record;record=record._nextRemoved)fn(record)},DefaultKeyValueDiffer.prototype.diff=function(map){if(map){if(!(map instanceof Map||isJsObject(map)))throw new Error("Error trying to diff '"+stringify$1(map)+"'. Only maps and objects are allowed")}else map=new Map;return this.check(map)?this:null},DefaultKeyValueDiffer.prototype.onDestroy=function(){},DefaultKeyValueDiffer.prototype.check=function(map){var _this=this;this._reset();var insertBefore=this._mapHead;if(this._appendAfter=null,this._forEach(map,function(value,key){if(insertBefore&&insertBefore.key===key)_this._maybeAddToChanges(insertBefore,value),_this._appendAfter=insertBefore,insertBefore=insertBefore._next;else{var record=_this._getOrCreateRecordForKey(key,value);insertBefore=_this._insertBeforeOrAppend(insertBefore,record)}}),insertBefore){insertBefore._prev&&(insertBefore._prev._next=null),this._removalsHead=insertBefore;for(var record=insertBefore;null!==record;record=record._nextRemoved)record===this._mapHead&&(this._mapHead=null),this._records.delete(record.key),record._nextRemoved=record._next,record.previousValue=record.currentValue,record.currentValue=null,record._prev=null,record._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty},DefaultKeyValueDiffer.prototype._insertBeforeOrAppend=function(before,record){if(before){var prev=before._prev;return record._next=before,record._prev=prev,before._prev=record,prev&&(prev._next=record),before===this._mapHead&&(this._mapHead=record),this._appendAfter=before,before}return this._appendAfter?(this._appendAfter._next=record,record._prev=this._appendAfter):this._mapHead=record,this._appendAfter=record,null},DefaultKeyValueDiffer.prototype._getOrCreateRecordForKey=function(key,value){if(this._records.has(key)){var record_1=this._records.get(key);this._maybeAddToChanges(record_1,value);var prev=record_1._prev,next=record_1._next;return prev&&(prev._next=next),next&&(next._prev=prev),record_1._next=null,record_1._prev=null,record_1}var record=new KeyValueChangeRecord_(key);return this._records.set(key,record),record.currentValue=value,this._addToAdditions(record),record},DefaultKeyValueDiffer.prototype._reset=function(){if(this.isDirty){var record=void 0;for(this._previousMapHead=this._mapHead,record=this._previousMapHead;null!==record;record=record._next)record._nextPrevious=record._next;for(record=this._changesHead;null!==record;record=record._nextChanged)record.previousValue=record.currentValue;for(record=this._additionsHead;null!=record;record=record._nextAdded)record.previousValue=record.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}},DefaultKeyValueDiffer.prototype._maybeAddToChanges=function(record,newValue){looseIdentical(newValue,record.currentValue)||(record.previousValue=record.currentValue,record.currentValue=newValue,this._addToChanges(record))},DefaultKeyValueDiffer.prototype._addToAdditions=function(record){null===this._additionsHead?this._additionsHead=this._additionsTail=record:(this._additionsTail._nextAdded=record,this._additionsTail=record)},DefaultKeyValueDiffer.prototype._addToChanges=function(record){null===this._changesHead?this._changesHead=this._changesTail=record:(this._changesTail._nextChanged=record,this._changesTail=record)},DefaultKeyValueDiffer.prototype._forEach=function(obj,fn){obj instanceof Map?obj.forEach(fn):Object.keys(obj).forEach(function(k){return fn(obj[k],k)})},DefaultKeyValueDiffer}(),KeyValueChangeRecord_=function(){function KeyValueChangeRecord_(key){this.key=key,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}return KeyValueChangeRecord_}(),IterableDiffers=function(){function IterableDiffers(factories){this.factories=factories}return IterableDiffers.create=function(factories,parent){if(null!=parent){var copied=parent.factories.slice();return factories=factories.concat(copied),new IterableDiffers(factories)}return new IterableDiffers(factories)},IterableDiffers.extend=function(factories){return{provide:IterableDiffers,useFactory:function(parent){if(!parent)throw new Error("Cannot extend IterableDiffers without a parent injector");return IterableDiffers.create(factories,parent)},deps:[[IterableDiffers,new SkipSelf,new Optional]]}},IterableDiffers.prototype.find=function(iterable){var factory=this.factories.find(function(f){return f.supports(iterable)});if(null!=factory)return factory;throw new Error("Cannot find a differ supporting object '"+iterable+"' of type '"+getTypeNameForDebugging(iterable)+"'")},IterableDiffers}(),KeyValueDiffers=function(){function KeyValueDiffers(factories){this.factories=factories}return KeyValueDiffers.create=function(factories,parent){if(parent){var copied=parent.factories.slice();factories=factories.concat(copied)}return new KeyValueDiffers(factories)},KeyValueDiffers.extend=function(factories){return{provide:KeyValueDiffers,useFactory:function(parent){if(!parent)throw new Error("Cannot extend KeyValueDiffers without a parent injector");return KeyValueDiffers.create(factories,parent)},deps:[[KeyValueDiffers,new SkipSelf,new Optional]]}},KeyValueDiffers.prototype.find=function(kv){var factory=this.factories.find(function(f){return f.supports(kv)});if(factory)return factory;throw new Error("Cannot find a differ supporting object '"+kv+"'")},KeyValueDiffers}(),keyValDiff=[new DefaultKeyValueDifferFactory],iterableDiff=[new DefaultIterableDifferFactory],defaultIterableDiffers=new IterableDiffers(iterableDiff),defaultKeyValueDiffers=new KeyValueDiffers(keyValDiff),_CORE_PLATFORM_PROVIDERS=[{provide:PLATFORM_ID,useValue:"unknown"},{provide:PlatformRef,deps:[Injector]},{provide:TestabilityRegistry,deps:[]},{provide:Console,deps:[]}],LOCALE_ID=(function(parentPlatformFactory,name,providers){void 0===providers&&(providers=[]);var desc="Platform: "+name,marker=new InjectionToken(desc)}(null,"core",_CORE_PLATFORM_PROVIDERS),new InjectionToken("LocaleId")),SecurityContext$1=(new InjectionToken("Translations"),new InjectionToken("TranslationsFormat"),function(){function ApplicationModule(appRef){}ApplicationModule.decorators=[{type:NgModule$1,args:[{providers:[ApplicationRef,ApplicationInitStatus,Compiler,APP_ID_RANDOM_PROVIDER,{provide:IterableDiffers,useFactory:_iterableDiffersFactory},{provide:KeyValueDiffers,useFactory:_keyValueDiffersFactory},{provide:LOCALE_ID,useFactory:_localeFactory,deps:[[new Inject$1(LOCALE_ID),new Optional,new SkipSelf]]}]}]}],ApplicationModule.ctorParameters=function(){return[{type:ApplicationRef}]}}(),{NONE:0,HTML:1,STYLE:2,SCRIPT:3,URL:4,RESOURCE_URL:5});SecurityContext$1[SecurityContext$1.NONE]="NONE",SecurityContext$1[SecurityContext$1.HTML]="HTML",SecurityContext$1[SecurityContext$1.STYLE]="STYLE",SecurityContext$1[SecurityContext$1.SCRIPT]="SCRIPT",SecurityContext$1[SecurityContext$1.URL]="URL",SecurityContext$1[SecurityContext$1.RESOURCE_URL]="RESOURCE_URL";var Sanitizer=function(){function Sanitizer(){}return Sanitizer}(),Services={setCurrentNode:void 0,createRootView:void 0,createEmbeddedView:void 0,createComponentView:void 0,createNgModuleRef:void 0,overrideProvider:void 0,overrideComponentView:void 0,clearOverrides:void 0,checkAndUpdateView:void 0,checkNoChangesView:void 0,destroyView:void 0,resolveDep:void 0,createDebugContext:void 0,handleEvent:void 0,updateDirectives:void 0,updateRenderer:void 0,dirtyParentQueries:void 0},NOOP=function(){},_tokenKeyCache=new Map,DEFINITION_CACHE=new WeakMap,NS_PREFIX_RE=/^:([^:]+):(.+)$/,UNDEFINED_VALUE=new Object,InjectorRefTokenKey$1=tokenKey(Injector),NgModuleRefTokenKey=tokenKey(NgModuleRef),EMPTY_CONTEXT=new Object,ComponentRef_=(function(_super){function ComponentFactory_(selector,componentType,viewDefFactory,_inputs,_outputs,ngContentSelectors){var _this=_super.call(this)||this;return _this.selector=selector,_this.componentType=componentType,_this._inputs=_inputs,_this._outputs=_outputs,_this.ngContentSelectors=ngContentSelectors,_this.viewDefFactory=viewDefFactory,_this}__extends(ComponentFactory_,_super),Object.defineProperty(ComponentFactory_.prototype,"inputs",{get:function(){var inputsArr=[],inputs=this._inputs;for(var propName in inputs){var templateName=inputs[propName];inputsArr.push({propName:propName,templateName:templateName})}return inputsArr},enumerable:!0,configurable:!0}),Object.defineProperty(ComponentFactory_.prototype,"outputs",{get:function(){var outputsArr=[];for(var propName in this._outputs){var templateName=this._outputs[propName];outputsArr.push({propName:propName,templateName:templateName})}return outputsArr},enumerable:!0,configurable:!0}),ComponentFactory_.prototype.create=function(injector,projectableNodes,rootSelectorOrNode,ngModule){if(!ngModule)throw new Error("ngModule should be provided");var viewDef=resolveDefinition(this.viewDefFactory),componentNodeIndex=viewDef.nodes[0].element.componentProvider.nodeIndex,view=Services.createRootView(injector,projectableNodes||[],rootSelectorOrNode,viewDef,ngModule,EMPTY_CONTEXT),component=asProviderData(view,componentNodeIndex).instance;return rootSelectorOrNode&&view.renderer.setAttribute(asElementData(view,0).renderElement,"ng-version",VERSION$2.full),new ComponentRef_(view,new ViewRef_(view),component)}}(ComponentFactory),function(_super){function ComponentRef_(_view,_viewRef,_component){var _this=_super.call(this)||this;return _this._view=_view,
407
- _this._viewRef=_viewRef,_this._component=_component,_this._elDef=_this._view.def.nodes[0],_this.hostView=_viewRef,_this.changeDetectorRef=_viewRef,_this.instance=_component,_this}return __extends(ComponentRef_,_super),Object.defineProperty(ComponentRef_.prototype,"location",{get:function(){return new ElementRef(asElementData(this._view,this._elDef.nodeIndex).renderElement)},enumerable:!0,configurable:!0}),Object.defineProperty(ComponentRef_.prototype,"injector",{get:function(){return new Injector_(this._view,this._elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(ComponentRef_.prototype,"componentType",{get:function(){return this._component.constructor},enumerable:!0,configurable:!0}),ComponentRef_.prototype.destroy=function(){this._viewRef.destroy()},ComponentRef_.prototype.onDestroy=function(callback){this._viewRef.onDestroy(callback)},ComponentRef_}(ComponentRef)),ViewContainerRef_=function(){function ViewContainerRef_(_view,_elDef,_data){this._view=_view,this._elDef=_elDef,this._data=_data,this._embeddedViews=[]}return Object.defineProperty(ViewContainerRef_.prototype,"element",{get:function(){return new ElementRef(this._data.renderElement)},enumerable:!0,configurable:!0}),Object.defineProperty(ViewContainerRef_.prototype,"injector",{get:function(){return new Injector_(this._view,this._elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(ViewContainerRef_.prototype,"parentInjector",{get:function(){for(var view=this._view,elDef=this._elDef.parent;!elDef&&view;)elDef=viewParentEl(view),view=view.parent;return view?new Injector_(view,elDef):new Injector_(this._view,null)},enumerable:!0,configurable:!0}),ViewContainerRef_.prototype.clear=function(){for(var len=this._embeddedViews.length,i=len-1;i>=0;i--){var view=detachEmbeddedView(this._data,i);Services.destroyView(view)}},ViewContainerRef_.prototype.get=function(index){var view=this._embeddedViews[index];if(view){var ref=new ViewRef_(view);return ref.attachToViewContainerRef(this),ref}return null},Object.defineProperty(ViewContainerRef_.prototype,"length",{get:function(){return this._embeddedViews.length},enumerable:!0,configurable:!0}),ViewContainerRef_.prototype.createEmbeddedView=function(templateRef,context,index){var viewRef=templateRef.createEmbeddedView(context||{});return this.insert(viewRef,index),viewRef},ViewContainerRef_.prototype.createComponent=function(componentFactory,index,injector,projectableNodes,ngModuleRef){var contextInjector=injector||this.parentInjector;ngModuleRef||componentFactory instanceof ComponentFactoryBoundToModule||(ngModuleRef=contextInjector.get(NgModuleRef));var componentRef=componentFactory.create(contextInjector,projectableNodes,void 0,ngModuleRef);return this.insert(componentRef.hostView,index),componentRef},ViewContainerRef_.prototype.insert=function(viewRef,index){if(viewRef.destroyed)throw new Error("Cannot insert a destroyed View in a ViewContainer!");var viewRef_=viewRef,viewData=viewRef_._view;return attachEmbeddedView(this._view,this._data,index,viewData),viewRef_.attachToViewContainerRef(this),viewRef},ViewContainerRef_.prototype.move=function(viewRef,currentIndex){if(viewRef.destroyed)throw new Error("Cannot move a destroyed View in a ViewContainer!");var previousIndex=this._embeddedViews.indexOf(viewRef._view);return moveEmbeddedView(this._data,previousIndex,currentIndex),viewRef},ViewContainerRef_.prototype.indexOf=function(viewRef){return this._embeddedViews.indexOf(viewRef._view)},ViewContainerRef_.prototype.remove=function(index){var viewData=detachEmbeddedView(this._data,index);viewData&&Services.destroyView(viewData)},ViewContainerRef_.prototype.detach=function(index){var view=detachEmbeddedView(this._data,index);return view?new ViewRef_(view):null},ViewContainerRef_}(),ViewRef_=function(){function ViewRef_(_view){this._view=_view,this._viewContainerRef=null,this._appRef=null}return Object.defineProperty(ViewRef_.prototype,"rootNodes",{get:function(){return rootRenderNodes(this._view)},enumerable:!0,configurable:!0}),Object.defineProperty(ViewRef_.prototype,"context",{get:function(){return this._view.context},enumerable:!0,configurable:!0}),Object.defineProperty(ViewRef_.prototype,"destroyed",{get:function(){return 0!=(128&this._view.state)},enumerable:!0,configurable:!0}),ViewRef_.prototype.markForCheck=function(){markParentViewsForCheck(this._view)},ViewRef_.prototype.detach=function(){this._view.state&=-5},ViewRef_.prototype.detectChanges=function(){var fs$$1=this._view.root.rendererFactory;fs$$1.begin&&fs$$1.begin();try{Services.checkAndUpdateView(this._view)}finally{fs$$1.end&&fs$$1.end()}},ViewRef_.prototype.checkNoChanges=function(){Services.checkNoChangesView(this._view)},ViewRef_.prototype.reattach=function(){this._view.state|=4},ViewRef_.prototype.onDestroy=function(callback){this._view.disposables||(this._view.disposables=[]),this._view.disposables.push(callback)},ViewRef_.prototype.destroy=function(){this._appRef?this._appRef.detachView(this):this._viewContainerRef&&this._viewContainerRef.detach(this._viewContainerRef.indexOf(this)),Services.destroyView(this._view)},ViewRef_.prototype.detachFromAppRef=function(){this._appRef=null,renderDetachView(this._view),Services.dirtyParentQueries(this._view)},ViewRef_.prototype.attachToAppRef=function(appRef){if(this._viewContainerRef)throw new Error("This view is already attached to a ViewContainer!");this._appRef=appRef},ViewRef_.prototype.attachToViewContainerRef=function(vcRef){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._viewContainerRef=vcRef},ViewRef_}(),TemplateRef_=function(_super){function TemplateRef_(_parentView,_def){var _this=_super.call(this)||this;return _this._parentView=_parentView,_this._def=_def,_this}return __extends(TemplateRef_,_super),TemplateRef_.prototype.createEmbeddedView=function(context){return new ViewRef_(Services.createEmbeddedView(this._parentView,this._def,this._def.element.template,context))},Object.defineProperty(TemplateRef_.prototype,"elementRef",{get:function(){return new ElementRef(asElementData(this._parentView,this._def.nodeIndex).renderElement)},enumerable:!0,configurable:!0}),TemplateRef_}(TemplateRef),Injector_=function(){function Injector_(view,elDef){this.view=view,this.elDef=elDef}return Injector_.prototype.get=function(token,notFoundValue){void 0===notFoundValue&&(notFoundValue=Injector.THROW_IF_NOT_FOUND);var allowPrivateServices=!!this.elDef&&0!=(33554432&this.elDef.flags);return Services.resolveDep(this.view,this.elDef,allowPrivateServices,{flags:0,token:token,tokenKey:tokenKey(token)},notFoundValue)},Injector_}(),RendererAdapter=function(){function RendererAdapter(delegate){this.delegate=delegate}return RendererAdapter.prototype.selectRootElement=function(selectorOrNode){return this.delegate.selectRootElement(selectorOrNode)},RendererAdapter.prototype.createElement=function(parent,namespaceAndName){var _a=splitNamespace(namespaceAndName),ns=_a[0],name=_a[1],el=this.delegate.createElement(name,ns);return parent&&this.delegate.appendChild(parent,el),el},RendererAdapter.prototype.createViewRoot=function(hostElement){return hostElement},RendererAdapter.prototype.createTemplateAnchor=function(parentElement){var comment=this.delegate.createComment("");return parentElement&&this.delegate.appendChild(parentElement,comment),comment},RendererAdapter.prototype.createText=function(parentElement,value){var node=this.delegate.createText(value);return parentElement&&this.delegate.appendChild(parentElement,node),node},RendererAdapter.prototype.projectNodes=function(parentElement,nodes){for(var i=0;i<nodes.length;i++)this.delegate.appendChild(parentElement,nodes[i])},RendererAdapter.prototype.attachViewAfter=function(node,viewRootNodes){for(var parentElement=this.delegate.parentNode(node),nextSibling=this.delegate.nextSibling(node),i=0;i<viewRootNodes.length;i++)this.delegate.insertBefore(parentElement,viewRootNodes[i],nextSibling)},RendererAdapter.prototype.detachView=function(viewRootNodes){for(var i=0;i<viewRootNodes.length;i++){var node=viewRootNodes[i],parentElement=this.delegate.parentNode(node);this.delegate.removeChild(parentElement,node)}},RendererAdapter.prototype.destroyView=function(hostElement,viewAllNodes){for(var i=0;i<viewAllNodes.length;i++)this.delegate.destroyNode(viewAllNodes[i])},RendererAdapter.prototype.listen=function(renderElement,name,callback){return this.delegate.listen(renderElement,name,callback)},RendererAdapter.prototype.listenGlobal=function(target,name,callback){return this.delegate.listen(target,name,callback)},RendererAdapter.prototype.setElementProperty=function(renderElement,propertyName,propertyValue){this.delegate.setProperty(renderElement,propertyName,propertyValue)},RendererAdapter.prototype.setElementAttribute=function(renderElement,namespaceAndName,attributeValue){var _a=splitNamespace(namespaceAndName),ns=_a[0],name=_a[1];null!=attributeValue?this.delegate.setAttribute(renderElement,name,attributeValue,ns):this.delegate.removeAttribute(renderElement,name,ns)},RendererAdapter.prototype.setBindingDebugInfo=function(renderElement,propertyName,propertyValue){},RendererAdapter.prototype.setElementClass=function(renderElement,className,isAdd){isAdd?this.delegate.addClass(renderElement,className):this.delegate.removeClass(renderElement,className)},RendererAdapter.prototype.setElementStyle=function(renderElement,styleName,styleValue){null!=styleValue?this.delegate.setStyle(renderElement,styleName,styleValue):this.delegate.removeStyle(renderElement,styleName)},RendererAdapter.prototype.invokeElementMethod=function(renderElement,methodName,args){renderElement[methodName].apply(renderElement,args)},RendererAdapter.prototype.setText=function(renderNode$$1,text){this.delegate.setValue(renderNode$$1,text)},RendererAdapter.prototype.animate=function(){throw new Error("Renderer.animate is no longer supported!")},RendererAdapter}(),NgModuleRef_=function(){function NgModuleRef_(_moduleType,_parent,_bootstrapComponents,_def){this._moduleType=_moduleType,this._parent=_parent,this._bootstrapComponents=_bootstrapComponents,this._def=_def,this._destroyListeners=[],this._destroyed=!1,this.injector=this,initNgModule(this)}return NgModuleRef_.prototype.get=function(token,notFoundValue){return void 0===notFoundValue&&(notFoundValue=Injector.THROW_IF_NOT_FOUND),resolveNgModuleDep(this,{token:token,tokenKey:tokenKey(token),flags:0},notFoundValue)},Object.defineProperty(NgModuleRef_.prototype,"instance",{get:function(){return this.get(this._moduleType)},enumerable:!0,configurable:!0}),Object.defineProperty(NgModuleRef_.prototype,"componentFactoryResolver",{get:function(){return this.get(ComponentFactoryResolver)},enumerable:!0,configurable:!0}),NgModuleRef_.prototype.destroy=function(){if(this._destroyed)throw new Error("The ng module "+stringify$1(this.instance.constructor)+" has already been destroyed.");this._destroyed=!0,callNgModuleLifecycle(this,131072),this._destroyListeners.forEach(function(listener){return listener()})},NgModuleRef_.prototype.onDestroy=function(callback){this._destroyListeners.push(callback)},NgModuleRef_}(),RendererV1TokenKey=tokenKey(Renderer),Renderer2TokenKey=tokenKey(Renderer2),ElementRefTokenKey=tokenKey(ElementRef),ViewContainerRefTokenKey=tokenKey(ViewContainerRef),TemplateRefTokenKey=tokenKey(TemplateRef),ChangeDetectorRefTokenKey=tokenKey(ChangeDetectorRef),InjectorRefTokenKey=tokenKey(Injector),NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR={},ViewAction={CreateViewNodes:0,CheckNoChanges:1,CheckNoChangesProjectedViews:2,CheckAndUpdate:3,CheckAndUpdateProjectedViews:4,Destroy:5};ViewAction[ViewAction.CreateViewNodes]="CreateViewNodes",ViewAction[ViewAction.CheckNoChanges]="CheckNoChanges",ViewAction[ViewAction.CheckNoChangesProjectedViews]="CheckNoChangesProjectedViews",ViewAction[ViewAction.CheckAndUpdate]="CheckAndUpdate",ViewAction[ViewAction.CheckAndUpdateProjectedViews]="CheckAndUpdateProjectedViews",ViewAction[ViewAction.Destroy]="Destroy";/**
405
+ var trace,events,_platform,Version$1=function(){function Version(full){this.full=full,this.major=full.split(".")[0],this.minor=full.split(".")[1],this.patch=full.split(".").slice(2).join(".")}return Version}(),VERSION$2=new Version$1("5.2.8"),Inject$1=makeParamDecorator("Inject",function(token){return{token:token}}),Optional=makeParamDecorator("Optional"),Injectable=makeDecorator("Injectable"),Self=makeParamDecorator("Self"),SkipSelf=makeParamDecorator("SkipSelf"),__window=(makeParamDecorator("Host"),"undefined"!=typeof window&&window),__self="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,__global="undefined"!=typeof global&&global,_global=__window||__global||__self,promise=Promise.resolve(0),_symbolIterator=null,SOURCE="__source",_THROW_IF_NOT_FOUND=new Object,THROW_IF_NOT_FOUND=_THROW_IF_NOT_FOUND,_NullInjector=function(){function _NullInjector(){}return _NullInjector.prototype.get=function(token,notFoundValue){if(void 0===notFoundValue&&(notFoundValue=_THROW_IF_NOT_FOUND),notFoundValue===_THROW_IF_NOT_FOUND)throw new Error("NullInjectorError: No provider for "+stringify$1(token)+"!");return notFoundValue},_NullInjector}(),Injector=function(){function Injector(){}return Injector.create=function(options,parent){return Array.isArray(options)?new StaticInjector(options,parent):new StaticInjector(options.providers,options.parent,options.name||null)},Injector.THROW_IF_NOT_FOUND=_THROW_IF_NOT_FOUND,Injector.NULL=new _NullInjector,Injector}(),IDENT=function(value){return value},EMPTY=[],CIRCULAR=IDENT,MULTI_PROVIDER_FN=function(){return Array.prototype.slice.call(arguments)},GET_PROPERTY_NAME={},ɵ2=GET_PROPERTY_NAME,USE_VALUE$1=function(objWithPropertyToExtract){for(var key in objWithPropertyToExtract)if(objWithPropertyToExtract[key]===GET_PROPERTY_NAME)return key;throw Error("!prop")}({provide:String,useValue:ɵ2}),NG_TEMP_TOKEN_PATH="ngTempTokenPath",NULL_INJECTOR=Injector.NULL,NEW_LINE=/\n/gm,NO_NEW_LINE="ɵ",StaticInjector=function(){function StaticInjector(providers,parent,source){void 0===parent&&(parent=NULL_INJECTOR),void 0===source&&(source=null),this.parent=parent,this.source=source;var records=this._records=new Map;records.set(Injector,{token:Injector,fn:IDENT,deps:EMPTY,value:this,useNew:!1}),recursivelyProcessProviders(records,providers)}return StaticInjector.prototype.get=function(token,notFoundValue){var record=this._records.get(token);try{return tryResolveToken(token,record,this._records,this.parent,notFoundValue)}catch(e){var tokenPath=e[NG_TEMP_TOKEN_PATH];throw token[SOURCE]&&tokenPath.unshift(token[SOURCE]),e.message=formatError("\n"+e.message,tokenPath,this.source),e.ngTokenPath=tokenPath,e[NG_TEMP_TOKEN_PATH]=null,e}},StaticInjector.prototype.toString=function(){var tokens=[];return this._records.forEach(function(v,token){return tokens.push(stringify$1(token))}),"StaticInjector["+tokens.join(", ")+"]"},StaticInjector}(),ERROR_DEBUG_CONTEXT="ngDebugContext",ERROR_ORIGINAL_ERROR="ngOriginalError",ERROR_LOGGER="ngErrorLogger",ErrorHandler=function(){function ErrorHandler(){this._console=console}return ErrorHandler.prototype.handleError=function(error){var originalError=this._findOriginalError(error),context=this._findContext(error),errorLogger=getErrorLogger(error);errorLogger(this._console,"ERROR",error),originalError&&errorLogger(this._console,"ORIGINAL ERROR",originalError),context&&errorLogger(this._console,"ERROR CONTEXT",context)},ErrorHandler.prototype._findContext=function(error){return error?getDebugContext(error)?getDebugContext(error):this._findContext(getOriginalError(error)):null},ErrorHandler.prototype._findOriginalError=function(error){for(var e=getOriginalError(error);e&&getOriginalError(e);)e=getOriginalError(e);return e},ErrorHandler}(),ReflectiveKey=function(){function ReflectiveKey(token,id){if(this.token=token,this.id=id,!token)throw new Error("Token must be defined!");this.displayName=stringify$1(this.token)}return ReflectiveKey.get=function(token){return _globalKeyRegistry.get(resolveForwardRef$1(token))},Object.defineProperty(ReflectiveKey,"numberOfKeys",{get:function(){return _globalKeyRegistry.numberOfKeys},enumerable:!0,configurable:!0}),ReflectiveKey}(),KeyRegistry=function(){function KeyRegistry(){this._allKeys=new Map}return KeyRegistry.prototype.get=function(token){if(token instanceof ReflectiveKey)return token;if(this._allKeys.has(token))return this._allKeys.get(token);var newKey=new ReflectiveKey(token,ReflectiveKey.numberOfKeys);return this._allKeys.set(token,newKey),newKey},Object.defineProperty(KeyRegistry.prototype,"numberOfKeys",{get:function(){return this._allKeys.size},enumerable:!0,configurable:!0}),KeyRegistry}(),_globalKeyRegistry=new KeyRegistry,Type$1$1=Function,DELEGATE_CTOR=/^function\s+\S+\(\)\s*{[\s\S]+\.apply\(this,\s*arguments\)/,INHERITED_CLASS=/^class\s+[A-Za-z\d$_]*\s*extends\s+[A-Za-z\d$_]+\s*{/,INHERITED_CLASS_WITH_CTOR=/^class\s+[A-Za-z\d$_]*\s*extends\s+[A-Za-z\d$_]+\s*{[\s\S]*constructor\s*\(/,ReflectionCapabilities=function(){function ReflectionCapabilities(reflect){this._reflect=reflect||_global.Reflect}return ReflectionCapabilities.prototype.isReflectionEnabled=function(){return!0},ReflectionCapabilities.prototype.factory=function(t){return function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];return new(t.bind.apply(t,[void 0].concat(args)))}},ReflectionCapabilities.prototype._zipTypesAndAnnotations=function(paramTypes,paramAnnotations){var result;result=void 0===paramTypes?new Array(paramAnnotations.length):new Array(paramTypes.length);for(var i=0;i<result.length;i++)void 0===paramTypes?result[i]=[]:paramTypes[i]!=Object?result[i]=[paramTypes[i]]:result[i]=[],paramAnnotations&&null!=paramAnnotations[i]&&(result[i]=result[i].concat(paramAnnotations[i]));return result},ReflectionCapabilities.prototype._ownParameters=function(type,parentCtor){var typeStr=type.toString();if(DELEGATE_CTOR.exec(typeStr)||INHERITED_CLASS.exec(typeStr)&&!INHERITED_CLASS_WITH_CTOR.exec(typeStr))return null;if(type.parameters&&type.parameters!==parentCtor.parameters)return type.parameters;var tsickleCtorParams=type.ctorParameters;if(tsickleCtorParams&&tsickleCtorParams!==parentCtor.ctorParameters){var ctorParameters="function"==typeof tsickleCtorParams?tsickleCtorParams():tsickleCtorParams,paramTypes_1=ctorParameters.map(function(ctorParam){return ctorParam&&ctorParam.type}),paramAnnotations_1=ctorParameters.map(function(ctorParam){return ctorParam&&convertTsickleDecoratorIntoMetadata(ctorParam.decorators)});return this._zipTypesAndAnnotations(paramTypes_1,paramAnnotations_1)}var paramAnnotations=type.hasOwnProperty(PARAMETERS)&&type[PARAMETERS],paramTypes=this._reflect&&this._reflect.getOwnMetadata&&this._reflect.getOwnMetadata("design:paramtypes",type);return paramTypes||paramAnnotations?this._zipTypesAndAnnotations(paramTypes,paramAnnotations):new Array(type.length).fill(void 0)},ReflectionCapabilities.prototype.parameters=function(type){if(!isType(type))return[];var parentCtor=getParentCtor(type),parameters=this._ownParameters(type,parentCtor);return parameters||parentCtor===Object||(parameters=this.parameters(parentCtor)),parameters||[]},ReflectionCapabilities.prototype._ownAnnotations=function(typeOrFunc,parentCtor){if(typeOrFunc.annotations&&typeOrFunc.annotations!==parentCtor.annotations){var annotations=typeOrFunc.annotations;return"function"==typeof annotations&&annotations.annotations&&(annotations=annotations.annotations),annotations}return typeOrFunc.decorators&&typeOrFunc.decorators!==parentCtor.decorators?convertTsickleDecoratorIntoMetadata(typeOrFunc.decorators):typeOrFunc.hasOwnProperty(ANNOTATIONS)?typeOrFunc[ANNOTATIONS]:null},ReflectionCapabilities.prototype.annotations=function(typeOrFunc){if(!isType(typeOrFunc))return[];var parentCtor=getParentCtor(typeOrFunc),ownAnnotations=this._ownAnnotations(typeOrFunc,parentCtor)||[];return(parentCtor!==Object?this.annotations(parentCtor):[]).concat(ownAnnotations)},ReflectionCapabilities.prototype._ownPropMetadata=function(typeOrFunc,parentCtor){if(typeOrFunc.propMetadata&&typeOrFunc.propMetadata!==parentCtor.propMetadata){var propMetadata=typeOrFunc.propMetadata;return"function"==typeof propMetadata&&propMetadata.propMetadata&&(propMetadata=propMetadata.propMetadata),propMetadata}if(typeOrFunc.propDecorators&&typeOrFunc.propDecorators!==parentCtor.propDecorators){var propDecorators_1=typeOrFunc.propDecorators,propMetadata_1={};return Object.keys(propDecorators_1).forEach(function(prop){propMetadata_1[prop]=convertTsickleDecoratorIntoMetadata(propDecorators_1[prop])}),propMetadata_1}return typeOrFunc.hasOwnProperty("__prop__metadata__")?typeOrFunc.__prop__metadata__:null},ReflectionCapabilities.prototype.propMetadata=function(typeOrFunc){if(!isType(typeOrFunc))return{};var parentCtor=getParentCtor(typeOrFunc),propMetadata={};if(parentCtor!==Object){var parentPropMetadata_1=this.propMetadata(parentCtor);Object.keys(parentPropMetadata_1).forEach(function(propName){propMetadata[propName]=parentPropMetadata_1[propName]})}var ownPropMetadata=this._ownPropMetadata(typeOrFunc,parentCtor);return ownPropMetadata&&Object.keys(ownPropMetadata).forEach(function(propName){var decorators=[];propMetadata.hasOwnProperty(propName)&&decorators.push.apply(decorators,propMetadata[propName]),decorators.push.apply(decorators,ownPropMetadata[propName]),propMetadata[propName]=decorators}),propMetadata},ReflectionCapabilities.prototype.hasLifecycleHook=function(type,lcProperty){return type instanceof Type$1$1&&lcProperty in type.prototype},ReflectionCapabilities.prototype.guards=function(type){return{}},ReflectionCapabilities.prototype.getter=function(name){return new Function("o","return o."+name+";")},ReflectionCapabilities.prototype.setter=function(name){return new Function("o","v","return o."+name+" = v;")},ReflectionCapabilities.prototype.method=function(name){var functionBody="if (!o."+name+") throw new Error('\""+name+"\" is undefined');\n return o."+name+".apply(o, args);";return new Function("o","args",functionBody)},ReflectionCapabilities.prototype.importUri=function(type){return"object"==typeof type&&type.filePath?type.filePath:"./"+stringify$1(type)},ReflectionCapabilities.prototype.resourceUri=function(type){return"./"+stringify$1(type)},ReflectionCapabilities.prototype.resolveIdentifier=function(name,moduleUrl,members,runtime){return runtime},ReflectionCapabilities.prototype.resolveEnum=function(enumIdentifier,name){return enumIdentifier[name]},ReflectionCapabilities}(),Reflector=function(){function Reflector(reflectionCapabilities){this.reflectionCapabilities=reflectionCapabilities}return Reflector.prototype.updateCapabilities=function(caps){this.reflectionCapabilities=caps},Reflector.prototype.factory=function(type){return this.reflectionCapabilities.factory(type)},Reflector.prototype.parameters=function(typeOrFunc){return this.reflectionCapabilities.parameters(typeOrFunc)},Reflector.prototype.annotations=function(typeOrFunc){return this.reflectionCapabilities.annotations(typeOrFunc)},Reflector.prototype.propMetadata=function(typeOrFunc){return this.reflectionCapabilities.propMetadata(typeOrFunc)},Reflector.prototype.hasLifecycleHook=function(type,lcProperty){return this.reflectionCapabilities.hasLifecycleHook(type,lcProperty)},Reflector.prototype.getter=function(name){return this.reflectionCapabilities.getter(name)},Reflector.prototype.setter=function(name){return this.reflectionCapabilities.setter(name)},Reflector.prototype.method=function(name){return this.reflectionCapabilities.method(name)},Reflector.prototype.importUri=function(type){return this.reflectionCapabilities.importUri(type)},Reflector.prototype.resourceUri=function(type){return this.reflectionCapabilities.resourceUri(type)},Reflector.prototype.resolveIdentifier=function(name,moduleUrl,members,runtime){return this.reflectionCapabilities.resolveIdentifier(name,moduleUrl,members,runtime)},Reflector.prototype.resolveEnum=function(identifier,name){return this.reflectionCapabilities.resolveEnum(identifier,name)},Reflector}(),reflector=new Reflector(new ReflectionCapabilities),ReflectiveDependency=function(){function ReflectiveDependency(key,optional,visibility){this.key=key,this.optional=optional,this.visibility=visibility}return ReflectiveDependency.fromKey=function(key){return new ReflectiveDependency(key,!1,null)},ReflectiveDependency}(),_EMPTY_LIST=[],ResolvedReflectiveProvider_=function(){function ResolvedReflectiveProvider_(key,resolvedFactories,multiProvider){this.key=key,this.resolvedFactories=resolvedFactories,this.multiProvider=multiProvider,this.resolvedFactory=this.resolvedFactories[0]}return ResolvedReflectiveProvider_}(),ResolvedReflectiveFactory=function(){function ResolvedReflectiveFactory(factory,dependencies){this.factory=factory,this.dependencies=dependencies}return ResolvedReflectiveFactory}(),UNDEFINED=new Object,ReflectiveInjector=function(){function ReflectiveInjector(){}return ReflectiveInjector.resolve=function(providers){return resolveReflectiveProviders(providers)},ReflectiveInjector.resolveAndCreate=function(providers,parent){var ResolvedReflectiveProviders=ReflectiveInjector.resolve(providers);return ReflectiveInjector.fromResolvedProviders(ResolvedReflectiveProviders,parent)},ReflectiveInjector.fromResolvedProviders=function(providers,parent){return new ReflectiveInjector_(providers,parent)},ReflectiveInjector}(),ReflectiveInjector_=function(){function ReflectiveInjector_(_providers,_parent){this._constructionCounter=0,this._providers=_providers,this.parent=_parent||null;var len=_providers.length;this.keyIds=new Array(len),this.objs=new Array(len);for(var i=0;i<len;i++)this.keyIds[i]=_providers[i].key.id,this.objs[i]=UNDEFINED}return ReflectiveInjector_.prototype.get=function(token,notFoundValue){return void 0===notFoundValue&&(notFoundValue=THROW_IF_NOT_FOUND),this._getByKey(ReflectiveKey.get(token),null,notFoundValue)},ReflectiveInjector_.prototype.resolveAndCreateChild=function(providers){var ResolvedReflectiveProviders=ReflectiveInjector.resolve(providers);return this.createChildFromResolved(ResolvedReflectiveProviders)},ReflectiveInjector_.prototype.createChildFromResolved=function(providers){var inj=new ReflectiveInjector_(providers);return inj.parent=this,inj},ReflectiveInjector_.prototype.resolveAndInstantiate=function(provider){return this.instantiateResolved(ReflectiveInjector.resolve([provider])[0])},ReflectiveInjector_.prototype.instantiateResolved=function(provider){return this._instantiateProvider(provider)},ReflectiveInjector_.prototype.getProviderAtIndex=function(index){if(index<0||index>=this._providers.length)throw outOfBoundsError(index);return this._providers[index]},ReflectiveInjector_.prototype._new=function(provider){if(this._constructionCounter++>this._getMaxNumberOfObjects())throw cyclicDependencyError(this,provider.key);return this._instantiateProvider(provider)},ReflectiveInjector_.prototype._getMaxNumberOfObjects=function(){return this.objs.length},ReflectiveInjector_.prototype._instantiateProvider=function(provider){if(provider.multiProvider){for(var res=new Array(provider.resolvedFactories.length),i=0;i<provider.resolvedFactories.length;++i)res[i]=this._instantiate(provider,provider.resolvedFactories[i]);return res}return this._instantiate(provider,provider.resolvedFactories[0])},ReflectiveInjector_.prototype._instantiate=function(provider,ResolvedReflectiveFactory$$1){var deps,_this=this,factory=ResolvedReflectiveFactory$$1.factory;try{deps=ResolvedReflectiveFactory$$1.dependencies.map(function(dep){return _this._getByReflectiveDependency(dep)})}catch(e){throw e.addKey&&e.addKey(this,provider.key),e}var obj;try{obj=factory.apply(void 0,deps)}catch(e){throw instantiationError(this,e,e.stack,provider.key)}return obj},ReflectiveInjector_.prototype._getByReflectiveDependency=function(dep){return this._getByKey(dep.key,dep.visibility,dep.optional?null:THROW_IF_NOT_FOUND)},ReflectiveInjector_.prototype._getByKey=function(key,visibility,notFoundValue){return key===ReflectiveInjector_.INJECTOR_KEY?this:visibility instanceof Self?this._getByKeySelf(key,notFoundValue):this._getByKeyDefault(key,notFoundValue,visibility)},ReflectiveInjector_.prototype._getObjByKeyId=function(keyId){for(var i=0;i<this.keyIds.length;i++)if(this.keyIds[i]===keyId)return this.objs[i]===UNDEFINED&&(this.objs[i]=this._new(this._providers[i])),this.objs[i];return UNDEFINED},ReflectiveInjector_.prototype._throwOrNull=function(key,notFoundValue){if(notFoundValue!==THROW_IF_NOT_FOUND)return notFoundValue;throw noProviderError(this,key)},ReflectiveInjector_.prototype._getByKeySelf=function(key,notFoundValue){var obj=this._getObjByKeyId(key.id);return obj!==UNDEFINED?obj:this._throwOrNull(key,notFoundValue)},ReflectiveInjector_.prototype._getByKeyDefault=function(key,notFoundValue,visibility){var inj;for(inj=visibility instanceof SkipSelf?this.parent:this;inj instanceof ReflectiveInjector_;){var inj_=inj,obj=inj_._getObjByKeyId(key.id);if(obj!==UNDEFINED)return obj;inj=inj_.parent}return null!==inj?inj.get(key.token,notFoundValue):this._throwOrNull(key,notFoundValue)},Object.defineProperty(ReflectiveInjector_.prototype,"displayName",{get:function(){return"ReflectiveInjector(providers: ["+_mapProviders(this,function(b){return' "'+b.key.displayName+'" '}).join(", ")+"])"},enumerable:!0,configurable:!0}),ReflectiveInjector_.prototype.toString=function(){return this.displayName},ReflectiveInjector_.INJECTOR_KEY=ReflectiveKey.get(Injector),ReflectiveInjector_}(),APP_INITIALIZER=new InjectionToken("Application Initializer"),ApplicationInitStatus=function(){function ApplicationInitStatus(appInits){var _this=this;this.appInits=appInits,this.initialized=!1,this.done=!1,this.donePromise=new Promise(function(res,rej){_this.resolve=res,_this.reject=rej})}return ApplicationInitStatus.prototype.runInitializers=function(){var _this=this;if(!this.initialized){var asyncInitPromises=[],complete=function(){_this.done=!0,_this.resolve()};if(this.appInits)for(var i=0;i<this.appInits.length;i++){var initResult=this.appInits[i]();isPromise$1(initResult)&&asyncInitPromises.push(initResult)}Promise.all(asyncInitPromises).then(function(){complete()}).catch(function(e){_this.reject(e)}),0===asyncInitPromises.length&&complete(),this.initialized=!0}},ApplicationInitStatus.decorators=[{type:Injectable}],ApplicationInitStatus.ctorParameters=function(){return[{type:Array,decorators:[{type:Inject$1,args:[APP_INITIALIZER]},{type:Optional}]}]},ApplicationInitStatus}(),APP_ID=new InjectionToken("AppId"),APP_ID_RANDOM_PROVIDER={provide:APP_ID,useFactory:_appIdRandomProviderFactory,deps:[]},PLATFORM_INITIALIZER=new InjectionToken("Platform Initializer"),PLATFORM_ID=new InjectionToken("Platform ID"),APP_BOOTSTRAP_LISTENER=new InjectionToken("appBootstrapListener"),Console=(new InjectionToken("Application Packages Root URL"),function(){function Console(){}return Console.prototype.log=function(message){console.log(message)},Console.prototype.warn=function(message){console.warn(message)},Console.decorators=[{type:Injectable}],Console.ctorParameters=function(){return[]},Console}()),Compiler=function(){function Compiler(){}return Compiler.prototype.compileModuleSync=function(moduleType){throw _throwError()},Compiler.prototype.compileModuleAsync=function(moduleType){throw _throwError()},Compiler.prototype.compileModuleAndAllComponentsSync=function(moduleType){throw _throwError()},Compiler.prototype.compileModuleAndAllComponentsAsync=function(moduleType){throw _throwError()},Compiler.prototype.clearCache=function(){},Compiler.prototype.clearCacheFor=function(type){},Compiler.decorators=[{type:Injectable}],Compiler.ctorParameters=function(){return[]},Compiler}(),CompilerFactory=(new InjectionToken("compilerOptions"),function(){function CompilerFactory(){}return CompilerFactory}()),ComponentRef=function(){function ComponentRef(){}return ComponentRef}(),ComponentFactory=function(){function ComponentFactory(){}return ComponentFactory}(),ERROR_COMPONENT="ngComponent",_NullComponentFactoryResolver=function(){function _NullComponentFactoryResolver(){}return _NullComponentFactoryResolver.prototype.resolveComponentFactory=function(component){throw noComponentFactoryError(component)},_NullComponentFactoryResolver}(),ComponentFactoryResolver=function(){function ComponentFactoryResolver(){}return ComponentFactoryResolver.NULL=new _NullComponentFactoryResolver,ComponentFactoryResolver}(),ComponentFactoryBoundToModule=function(_super){function ComponentFactoryBoundToModule(factory,ngModule){var _this=_super.call(this)||this;return _this.factory=factory,_this.ngModule=ngModule,_this.selector=factory.selector,_this.componentType=factory.componentType,_this.ngContentSelectors=factory.ngContentSelectors,_this.inputs=factory.inputs,_this.outputs=factory.outputs,_this}return __extends(ComponentFactoryBoundToModule,_super),ComponentFactoryBoundToModule.prototype.create=function(injector,projectableNodes,rootSelectorOrNode,ngModule){return this.factory.create(injector,projectableNodes,rootSelectorOrNode,ngModule||this.ngModule)},ComponentFactoryBoundToModule}(ComponentFactory),NgModuleRef=function(){function NgModuleRef(){}return NgModuleRef}(),NgModuleFactory=function(){function NgModuleFactory(){}return NgModuleFactory}(),wtfEnabled=function(){var wtf=_global.wtf;return!(!wtf||!(trace=wtf.trace))&&(events=trace.events,!0)}(),wtfCreateScope=wtfEnabled?createScope:function(signature,flags){return noopScope},wtfLeave=wtfEnabled?leave:function(s,r){return r},EventEmitter=function(_super){function EventEmitter(isAsync){void 0===isAsync&&(isAsync=!1);var _this=_super.call(this)||this;return _this.__isAsync=isAsync,_this}return __extends(EventEmitter,_super),EventEmitter.prototype.emit=function(value){_super.prototype.next.call(this,value)},EventEmitter.prototype.subscribe=function(generatorOrNext,error,complete){var schedulerFn,errorFn=function(err){return null},completeFn=function(){return null};generatorOrNext&&"object"==typeof generatorOrNext?(schedulerFn=this.__isAsync?function(value){setTimeout(function(){return generatorOrNext.next(value)})}:function(value){generatorOrNext.next(value)},generatorOrNext.error&&(errorFn=this.__isAsync?function(err){setTimeout(function(){return generatorOrNext.error(err)})}:function(err){generatorOrNext.error(err)}),generatorOrNext.complete&&(completeFn=this.__isAsync?function(){setTimeout(function(){return generatorOrNext.complete()})}:function(){generatorOrNext.complete()})):(schedulerFn=this.__isAsync?function(value){setTimeout(function(){return generatorOrNext(value)})}:function(value){generatorOrNext(value)},error&&(errorFn=this.__isAsync?function(err){setTimeout(function(){return error(err)})}:function(err){error(err)}),complete&&(completeFn=this.__isAsync?function(){setTimeout(function(){return complete()})}:function(){complete()}));var sink=_super.prototype.subscribe.call(this,schedulerFn,errorFn,completeFn);return generatorOrNext instanceof Subscription_2&&generatorOrNext.add(sink),sink},EventEmitter}(Subject_2),NgZone=function(){function NgZone(_a){var _b=_a.enableLongStackTrace,enableLongStackTrace=void 0!==_b&&_b;if(this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new EventEmitter(!1),this.onMicrotaskEmpty=new EventEmitter(!1),this.onStable=new EventEmitter(!1),this.onError=new EventEmitter(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();var self=this;self._nesting=0,self._outer=self._inner=Zone.current,Zone.wtfZoneSpec&&(self._inner=self._inner.fork(Zone.wtfZoneSpec)),enableLongStackTrace&&Zone.longStackTraceZoneSpec&&(self._inner=self._inner.fork(Zone.longStackTraceZoneSpec)),forkInnerZoneWithAngularBehavior(self)}return NgZone.isInAngularZone=function(){return!0===Zone.current.get("isAngularZone")},NgZone.assertInAngularZone=function(){if(!NgZone.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")},NgZone.assertNotInAngularZone=function(){if(NgZone.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")},NgZone.prototype.run=function(fn,applyThis,applyArgs){return this._inner.run(fn,applyThis,applyArgs)},NgZone.prototype.runTask=function(fn,applyThis,applyArgs,name){var zone=this._inner,task=zone.scheduleEventTask("NgZoneEvent: "+name,fn,EMPTY_PAYLOAD,noop,noop);try{return zone.runTask(task,applyThis,applyArgs)}finally{zone.cancelTask(task)}},NgZone.prototype.runGuarded=function(fn,applyThis,applyArgs){return this._inner.runGuarded(fn,applyThis,applyArgs)},NgZone.prototype.runOutsideAngular=function(fn){return this._outer.run(fn)},NgZone}(),EMPTY_PAYLOAD={},NoopNgZone=function(){function NoopNgZone(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new EventEmitter,this.onMicrotaskEmpty=new EventEmitter,this.onStable=new EventEmitter,this.onError=new EventEmitter}return NoopNgZone.prototype.run=function(fn){return fn()},NoopNgZone.prototype.runGuarded=function(fn){return fn()},NoopNgZone.prototype.runOutsideAngular=function(fn){return fn()},NoopNgZone.prototype.runTask=function(fn){return fn()},NoopNgZone}(),Testability=function(){function Testability(_ngZone){this._ngZone=_ngZone,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this._watchAngularEvents()}return Testability.prototype._watchAngularEvents=function(){var _this=this;this._ngZone.onUnstable.subscribe({next:function(){_this._didWork=!0,_this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(function(){_this._ngZone.onStable.subscribe({next:function(){NgZone.assertNotInAngularZone(),scheduleMicroTask(function(){_this._isZoneStable=!0,_this._runCallbacksIfReady()})}})})},Testability.prototype.increasePendingRequestCount=function(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount},Testability.prototype.decreasePendingRequestCount=function(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount},Testability.prototype.isStable=function(){return this._isZoneStable&&0==this._pendingCount&&!this._ngZone.hasPendingMacrotasks},Testability.prototype._runCallbacksIfReady=function(){var _this=this;this.isStable()?scheduleMicroTask(function(){for(;0!==_this._callbacks.length;)_this._callbacks.pop()(_this._didWork);_this._didWork=!1}):this._didWork=!0},Testability.prototype.whenStable=function(callback){this._callbacks.push(callback),this._runCallbacksIfReady()},Testability.prototype.getPendingRequestCount=function(){return this._pendingCount},Testability.prototype.findProviders=function(using,provider,exactMatch){return[]},Testability.decorators=[{type:Injectable}],Testability.ctorParameters=function(){return[{type:NgZone}]},Testability}(),TestabilityRegistry=function(){function TestabilityRegistry(){this._applications=new Map,_testabilityGetter.addToWindow(this)}return TestabilityRegistry.prototype.registerApplication=function(token,testability){this._applications.set(token,testability)},TestabilityRegistry.prototype.unregisterApplication=function(token){this._applications.delete(token)},TestabilityRegistry.prototype.unregisterAllApplications=function(){this._applications.clear()},TestabilityRegistry.prototype.getTestability=function(elem){return this._applications.get(elem)||null},TestabilityRegistry.prototype.getAllTestabilities=function(){return Array.from(this._applications.values())},TestabilityRegistry.prototype.getAllRootElements=function(){return Array.from(this._applications.keys())},TestabilityRegistry.prototype.findTestabilityInTree=function(elem,findInAncestors){return void 0===findInAncestors&&(findInAncestors=!0),_testabilityGetter.findTestabilityInTree(this,elem,findInAncestors)},TestabilityRegistry.decorators=[{type:Injectable}],TestabilityRegistry.ctorParameters=function(){return[]},TestabilityRegistry}(),_NoopGetTestability=function(){function _NoopGetTestability(){}return _NoopGetTestability.prototype.addToWindow=function(registry){},_NoopGetTestability.prototype.findTestabilityInTree=function(registry,elem,findInAncestors){return null},_NoopGetTestability}(),_testabilityGetter=new _NoopGetTestability,_devMode=!0,_runModeLocked=!1,ALLOW_MULTIPLE_PLATFORMS=new InjectionToken("AllowMultipleToken"),PlatformRef=function(){function PlatformRef(_injector){this._injector=_injector,this._modules=[],this._destroyListeners=[],this._destroyed=!1}return PlatformRef.prototype.bootstrapModuleFactory=function(moduleFactory,options){var _this=this,ngZoneOption=options?options.ngZone:void 0,ngZone=getNgZone(ngZoneOption),providers=[{provide:NgZone,useValue:ngZone}];return ngZone.run(function(){var ngZoneInjector=Injector.create({providers:providers,parent:_this.injector,name:moduleFactory.moduleType.name}),moduleRef=moduleFactory.create(ngZoneInjector),exceptionHandler=moduleRef.injector.get(ErrorHandler,null);if(!exceptionHandler)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return moduleRef.onDestroy(function(){return remove(_this._modules,moduleRef)}),ngZone.runOutsideAngular(function(){return ngZone.onError.subscribe({next:function(error){exceptionHandler.handleError(error)}})}),_callAndReportToErrorHandler(exceptionHandler,ngZone,function(){var initStatus=moduleRef.injector.get(ApplicationInitStatus);return initStatus.runInitializers(),initStatus.donePromise.then(function(){return _this._moduleDoBootstrap(moduleRef),moduleRef})})})},PlatformRef.prototype.bootstrapModule=function(moduleType,compilerOptions){var _this=this;void 0===compilerOptions&&(compilerOptions=[]);var compilerFactory=this.injector.get(CompilerFactory),options=optionsReducer({},compilerOptions);return compilerFactory.createCompiler([options]).compileModuleAsync(moduleType).then(function(moduleFactory){return _this.bootstrapModuleFactory(moduleFactory,options)})},PlatformRef.prototype._moduleDoBootstrap=function(moduleRef){var appRef=moduleRef.injector.get(ApplicationRef);if(moduleRef._bootstrapComponents.length>0)moduleRef._bootstrapComponents.forEach(function(f){return appRef.bootstrap(f)});else{if(!moduleRef.instance.ngDoBootstrap)throw new Error("The module "+stringify$1(moduleRef.instance.constructor)+' was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.');moduleRef.instance.ngDoBootstrap(appRef)}this._modules.push(moduleRef)},PlatformRef.prototype.onDestroy=function(callback){this._destroyListeners.push(callback)},Object.defineProperty(PlatformRef.prototype,"injector",{get:function(){return this._injector},enumerable:!0,configurable:!0}),PlatformRef.prototype.destroy=function(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(function(module){return module.destroy()}),this._destroyListeners.forEach(function(listener){return listener()}),this._destroyed=!0},Object.defineProperty(PlatformRef.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!0,configurable:!0}),PlatformRef.decorators=[{type:Injectable}],PlatformRef.ctorParameters=function(){return[{type:Injector}]},PlatformRef}(),ApplicationRef=function(){function ApplicationRef(_zone,_console,_injector,_exceptionHandler,_componentFactoryResolver,_initStatus){var _this=this;this._zone=_zone,this._console=_console,this._injector=_injector,this._exceptionHandler=_exceptionHandler,this._componentFactoryResolver=_componentFactoryResolver,this._initStatus=_initStatus,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._enforceNoNewChanges=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._enforceNoNewChanges=isDevMode(),this._zone.onMicrotaskEmpty.subscribe({next:function(){_this._zone.run(function(){_this.tick()})}});var isCurrentlyStable=new Observable_2(function(observer){
406
+ _this._stable=_this._zone.isStable&&!_this._zone.hasPendingMacrotasks&&!_this._zone.hasPendingMicrotasks,_this._zone.runOutsideAngular(function(){observer.next(_this._stable),observer.complete()})}),isStable=new Observable_2(function(observer){var stableSub;_this._zone.runOutsideAngular(function(){stableSub=_this._zone.onStable.subscribe(function(){NgZone.assertNotInAngularZone(),scheduleMicroTask(function(){_this._stable||_this._zone.hasPendingMacrotasks||_this._zone.hasPendingMicrotasks||(_this._stable=!0,observer.next(!0))})})});var unstableSub=_this._zone.onUnstable.subscribe(function(){NgZone.assertInAngularZone(),_this._stable&&(_this._stable=!1,_this._zone.runOutsideAngular(function(){observer.next(!1)}))});return function(){stableSub.unsubscribe(),unstableSub.unsubscribe()}});this.isStable=merge_2(isCurrentlyStable,share_3.call(isStable))}return ApplicationRef.prototype.bootstrap=function(componentOrFactory,rootSelectorOrNode){var _this=this;if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");var componentFactory;componentFactory=componentOrFactory instanceof ComponentFactory?componentOrFactory:this._componentFactoryResolver.resolveComponentFactory(componentOrFactory),this.componentTypes.push(componentFactory.componentType);var ngModule=componentFactory instanceof ComponentFactoryBoundToModule?null:this._injector.get(NgModuleRef),selectorOrNode=rootSelectorOrNode||componentFactory.selector,compRef=componentFactory.create(Injector.NULL,[],selectorOrNode,ngModule);compRef.onDestroy(function(){_this._unloadComponent(compRef)});var testability=compRef.injector.get(Testability,null);return testability&&compRef.injector.get(TestabilityRegistry).registerApplication(compRef.location.nativeElement,testability),this._loadComponent(compRef),isDevMode()&&this._console.log("Angular is running in the development mode. Call enableProdMode() to enable the production mode."),compRef},ApplicationRef.prototype.tick=function(){var _this=this;if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");var scope=ApplicationRef._tickScope();try{this._runningTick=!0,this._views.forEach(function(view){return view.detectChanges()}),this._enforceNoNewChanges&&this._views.forEach(function(view){return view.checkNoChanges()})}catch(e){this._zone.runOutsideAngular(function(){return _this._exceptionHandler.handleError(e)})}finally{this._runningTick=!1,wtfLeave(scope)}},ApplicationRef.prototype.attachView=function(viewRef){var view=viewRef;this._views.push(view),view.attachToAppRef(this)},ApplicationRef.prototype.detachView=function(viewRef){var view=viewRef;remove(this._views,view),view.detachFromAppRef()},ApplicationRef.prototype._loadComponent=function(componentRef){this.attachView(componentRef.hostView),this.tick(),this.components.push(componentRef),this._injector.get(APP_BOOTSTRAP_LISTENER,[]).concat(this._bootstrapListeners).forEach(function(listener){return listener(componentRef)})},ApplicationRef.prototype._unloadComponent=function(componentRef){this.detachView(componentRef.hostView),remove(this.components,componentRef)},ApplicationRef.prototype.ngOnDestroy=function(){this._views.slice().forEach(function(view){return view.destroy()})},Object.defineProperty(ApplicationRef.prototype,"viewCount",{get:function(){return this._views.length},enumerable:!0,configurable:!0}),ApplicationRef._tickScope=wtfCreateScope("ApplicationRef#tick()"),ApplicationRef.decorators=[{type:Injectable}],ApplicationRef.ctorParameters=function(){return[{type:NgZone},{type:Console},{type:Injector},{type:ErrorHandler},{type:ComponentFactoryResolver},{type:ApplicationInitStatus}]},ApplicationRef}(),Renderer=function(){function Renderer(){}return Renderer}(),RendererFactory2=(new InjectionToken("Renderer2Interceptor"),function(){function RendererFactory2(){}return RendererFactory2}()),Renderer2=function(){function Renderer2(){}return Renderer2}(),ElementRef=function(){function ElementRef(nativeElement){this.nativeElement=nativeElement}return ElementRef}(),QueryList=function(){function QueryList(){this.dirty=!0,this._results=[],this.changes=new EventEmitter,this.length=0}return QueryList.prototype.map=function(fn){return this._results.map(fn)},QueryList.prototype.filter=function(fn){return this._results.filter(fn)},QueryList.prototype.find=function(fn){return this._results.find(fn)},QueryList.prototype.reduce=function(fn,init){return this._results.reduce(fn,init)},QueryList.prototype.forEach=function(fn){this._results.forEach(fn)},QueryList.prototype.some=function(fn){return this._results.some(fn)},QueryList.prototype.toArray=function(){return this._results.slice()},QueryList.prototype[getSymbolIterator()]=function(){return this._results[getSymbolIterator()]()},QueryList.prototype.toString=function(){return this._results.toString()},QueryList.prototype.reset=function(res){this._results=flatten$2(res),this.dirty=!1,this.length=this._results.length,this.last=this._results[this.length-1],this.first=this._results[0]},QueryList.prototype.notifyOnChanges=function(){this.changes.emit(this)},QueryList.prototype.setDirty=function(){this.dirty=!0},QueryList.prototype.destroy=function(){this.changes.complete(),this.changes.unsubscribe()},QueryList}(),TemplateRef=function(){function TemplateRef(){}return TemplateRef}(),ViewContainerRef=function(){function ViewContainerRef(){}return ViewContainerRef}(),ChangeDetectorRef=function(){function ChangeDetectorRef(){}return ChangeDetectorRef}(),ViewRef=function(_super){function ViewRef(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(ViewRef,_super),ViewRef}(ChangeDetectorRef),EventListener=(function(_super){function EmbeddedViewRef(){return null!==_super&&_super.apply(this,arguments)||this}__extends(EmbeddedViewRef,_super)}(ViewRef),function(){function EventListener(name,callback){this.name=name,this.callback=callback}return EventListener}()),DebugNode=function(){function DebugNode(nativeNode,parent,_debugContext){this._debugContext=_debugContext,this.nativeNode=nativeNode,parent&&parent instanceof DebugElement?parent.addChild(this):this.parent=null,this.listeners=[]}return Object.defineProperty(DebugNode.prototype,"injector",{get:function(){return this._debugContext.injector},enumerable:!0,configurable:!0}),Object.defineProperty(DebugNode.prototype,"componentInstance",{get:function(){return this._debugContext.component},enumerable:!0,configurable:!0}),Object.defineProperty(DebugNode.prototype,"context",{get:function(){return this._debugContext.context},enumerable:!0,configurable:!0}),Object.defineProperty(DebugNode.prototype,"references",{get:function(){return this._debugContext.references},enumerable:!0,configurable:!0}),Object.defineProperty(DebugNode.prototype,"providerTokens",{get:function(){return this._debugContext.providerTokens},enumerable:!0,configurable:!0}),DebugNode}(),DebugElement=function(_super){function DebugElement(nativeNode,parent,_debugContext){var _this=_super.call(this,nativeNode,parent,_debugContext)||this;return _this.properties={},_this.attributes={},_this.classes={},_this.styles={},_this.childNodes=[],_this.nativeElement=nativeNode,_this}return __extends(DebugElement,_super),DebugElement.prototype.addChild=function(child){child&&(this.childNodes.push(child),child.parent=this)},DebugElement.prototype.removeChild=function(child){var childIndex=this.childNodes.indexOf(child);-1!==childIndex&&(child.parent=null,this.childNodes.splice(childIndex,1))},DebugElement.prototype.insertChildrenAfter=function(child,newChildren){var _this=this,siblingIndex=this.childNodes.indexOf(child);-1!==siblingIndex&&((_a=this.childNodes).splice.apply(_a,[siblingIndex+1,0].concat(newChildren)),newChildren.forEach(function(c){c.parent&&c.parent.removeChild(c),c.parent=_this}));var _a},DebugElement.prototype.insertBefore=function(refChild,newChild){var refIndex=this.childNodes.indexOf(refChild);-1===refIndex?this.addChild(newChild):(newChild.parent&&newChild.parent.removeChild(newChild),newChild.parent=this,this.childNodes.splice(refIndex,0,newChild))},DebugElement.prototype.query=function(predicate){return this.queryAll(predicate)[0]||null},DebugElement.prototype.queryAll=function(predicate){var matches=[];return _queryElementChildren(this,predicate,matches),matches},DebugElement.prototype.queryAllNodes=function(predicate){var matches=[];return _queryNodeChildren(this,predicate,matches),matches},Object.defineProperty(DebugElement.prototype,"children",{get:function(){return this.childNodes.filter(function(node){return node instanceof DebugElement})},enumerable:!0,configurable:!0}),DebugElement.prototype.triggerEventHandler=function(eventName,eventObj){this.listeners.forEach(function(listener){listener.name==eventName&&listener.callback(eventObj)})},DebugElement}(DebugNode),_nativeNodeToDebugNode=new Map,WrappedValue=function(){function WrappedValue(value){this.wrapped=value}return WrappedValue.wrap=function(value){return new WrappedValue(value)},WrappedValue.unwrap=function(value){return WrappedValue.isWrapped(value)?value.wrapped:value},WrappedValue.isWrapped=function(value){return value instanceof WrappedValue},WrappedValue}(),SimpleChange=function(){function SimpleChange(previousValue,currentValue,firstChange){this.previousValue=previousValue,this.currentValue=currentValue,this.firstChange=firstChange}return SimpleChange.prototype.isFirstChange=function(){return this.firstChange},SimpleChange}(),DefaultIterableDifferFactory=function(){function DefaultIterableDifferFactory(){}return DefaultIterableDifferFactory.prototype.supports=function(obj){return isListLikeIterable(obj)},DefaultIterableDifferFactory.prototype.create=function(trackByFn){return new DefaultIterableDiffer(trackByFn)},DefaultIterableDifferFactory}(),trackByIdentity=function(index,item){return item},DefaultIterableDiffer=function(){function DefaultIterableDiffer(trackByFn){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=trackByFn||trackByIdentity}return DefaultIterableDiffer.prototype.forEachItem=function(fn){var record;for(record=this._itHead;null!==record;record=record._next)fn(record)},DefaultIterableDiffer.prototype.forEachOperation=function(fn){for(var nextIt=this._itHead,nextRemove=this._removalsHead,addRemoveOffset=0,moveOffsets=null;nextIt||nextRemove;){var record=!nextRemove||nextIt&&nextIt.currentIndex<getPreviousIndex(nextRemove,addRemoveOffset,moveOffsets)?nextIt:nextRemove,adjPreviousIndex=getPreviousIndex(record,addRemoveOffset,moveOffsets),currentIndex=record.currentIndex;if(record===nextRemove)addRemoveOffset--,nextRemove=nextRemove._nextRemoved;else if(nextIt=nextIt._next,null==record.previousIndex)addRemoveOffset++;else{moveOffsets||(moveOffsets=[]);var localMovePreviousIndex=adjPreviousIndex-addRemoveOffset,localCurrentIndex=currentIndex-addRemoveOffset;if(localMovePreviousIndex!=localCurrentIndex){for(var i=0;i<localMovePreviousIndex;i++){var offset=i<moveOffsets.length?moveOffsets[i]:moveOffsets[i]=0,index=offset+i;localCurrentIndex<=index&&index<localMovePreviousIndex&&(moveOffsets[i]=offset+1)}var previousIndex=record.previousIndex;moveOffsets[previousIndex]=localCurrentIndex-localMovePreviousIndex}}adjPreviousIndex!==currentIndex&&fn(record,adjPreviousIndex,currentIndex)}},DefaultIterableDiffer.prototype.forEachPreviousItem=function(fn){var record;for(record=this._previousItHead;null!==record;record=record._nextPrevious)fn(record)},DefaultIterableDiffer.prototype.forEachAddedItem=function(fn){var record;for(record=this._additionsHead;null!==record;record=record._nextAdded)fn(record)},DefaultIterableDiffer.prototype.forEachMovedItem=function(fn){var record;for(record=this._movesHead;null!==record;record=record._nextMoved)fn(record)},DefaultIterableDiffer.prototype.forEachRemovedItem=function(fn){var record;for(record=this._removalsHead;null!==record;record=record._nextRemoved)fn(record)},DefaultIterableDiffer.prototype.forEachIdentityChange=function(fn){var record;for(record=this._identityChangesHead;null!==record;record=record._nextIdentityChange)fn(record)},DefaultIterableDiffer.prototype.diff=function(collection){if(null==collection&&(collection=[]),!isListLikeIterable(collection))throw new Error("Error trying to diff '"+stringify$1(collection)+"'. Only arrays and iterables are allowed");return this.check(collection)?this:null},DefaultIterableDiffer.prototype.onDestroy=function(){},DefaultIterableDiffer.prototype.check=function(collection){var _this=this;this._reset();var index,item,itemTrackBy,record=this._itHead,mayBeDirty=!1;if(Array.isArray(collection)){this.length=collection.length;for(var index_1=0;index_1<this.length;index_1++)item=collection[index_1],itemTrackBy=this._trackByFn(index_1,item),null!==record&&looseIdentical(record.trackById,itemTrackBy)?(mayBeDirty&&(record=this._verifyReinsertion(record,item,itemTrackBy,index_1)),looseIdentical(record.item,item)||this._addIdentityChange(record,item)):(record=this._mismatch(record,item,itemTrackBy,index_1),mayBeDirty=!0),record=record._next}else index=0,iterateListLike(collection,function(item){itemTrackBy=_this._trackByFn(index,item),null!==record&&looseIdentical(record.trackById,itemTrackBy)?(mayBeDirty&&(record=_this._verifyReinsertion(record,item,itemTrackBy,index)),looseIdentical(record.item,item)||_this._addIdentityChange(record,item)):(record=_this._mismatch(record,item,itemTrackBy,index),mayBeDirty=!0),record=record._next,index++}),this.length=index;return this._truncate(record),this.collection=collection,this.isDirty},Object.defineProperty(DefaultIterableDiffer.prototype,"isDirty",{get:function(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead},enumerable:!0,configurable:!0}),DefaultIterableDiffer.prototype._reset=function(){if(this.isDirty){var record=void 0,nextRecord=void 0;for(record=this._previousItHead=this._itHead;null!==record;record=record._next)record._nextPrevious=record._next;for(record=this._additionsHead;null!==record;record=record._nextAdded)record.previousIndex=record.currentIndex;for(this._additionsHead=this._additionsTail=null,record=this._movesHead;null!==record;record=nextRecord)record.previousIndex=record.currentIndex,nextRecord=record._nextMoved;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}},DefaultIterableDiffer.prototype._mismatch=function(record,item,itemTrackBy,index){var previousRecord;return null===record?previousRecord=this._itTail:(previousRecord=record._prev,this._remove(record)),record=null===this._linkedRecords?null:this._linkedRecords.get(itemTrackBy,index),null!==record?(looseIdentical(record.item,item)||this._addIdentityChange(record,item),this._moveAfter(record,previousRecord,index)):(record=null===this._unlinkedRecords?null:this._unlinkedRecords.get(itemTrackBy,null),null!==record?(looseIdentical(record.item,item)||this._addIdentityChange(record,item),this._reinsertAfter(record,previousRecord,index)):record=this._addAfter(new IterableChangeRecord_(item,itemTrackBy),previousRecord,index)),record},DefaultIterableDiffer.prototype._verifyReinsertion=function(record,item,itemTrackBy,index){var reinsertRecord=null===this._unlinkedRecords?null:this._unlinkedRecords.get(itemTrackBy,null);return null!==reinsertRecord?record=this._reinsertAfter(reinsertRecord,record._prev,index):record.currentIndex!=index&&(record.currentIndex=index,this._addToMoves(record,index)),record},DefaultIterableDiffer.prototype._truncate=function(record){for(;null!==record;){var nextRecord=record._next;this._addToRemovals(this._unlink(record)),record=nextRecord}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)},DefaultIterableDiffer.prototype._reinsertAfter=function(record,prevRecord,index){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(record);var prev=record._prevRemoved,next=record._nextRemoved;return null===prev?this._removalsHead=next:prev._nextRemoved=next,null===next?this._removalsTail=prev:next._prevRemoved=prev,this._insertAfter(record,prevRecord,index),this._addToMoves(record,index),record},DefaultIterableDiffer.prototype._moveAfter=function(record,prevRecord,index){return this._unlink(record),this._insertAfter(record,prevRecord,index),this._addToMoves(record,index),record},DefaultIterableDiffer.prototype._addAfter=function(record,prevRecord,index){return this._insertAfter(record,prevRecord,index),null===this._additionsTail?this._additionsTail=this._additionsHead=record:this._additionsTail=this._additionsTail._nextAdded=record,record},DefaultIterableDiffer.prototype._insertAfter=function(record,prevRecord,index){var next=null===prevRecord?this._itHead:prevRecord._next;return record._next=next,record._prev=prevRecord,null===next?this._itTail=record:next._prev=record,null===prevRecord?this._itHead=record:prevRecord._next=record,null===this._linkedRecords&&(this._linkedRecords=new _DuplicateMap),this._linkedRecords.put(record),record.currentIndex=index,record},DefaultIterableDiffer.prototype._remove=function(record){return this._addToRemovals(this._unlink(record))},DefaultIterableDiffer.prototype._unlink=function(record){null!==this._linkedRecords&&this._linkedRecords.remove(record);var prev=record._prev,next=record._next;return null===prev?this._itHead=next:prev._next=next,null===next?this._itTail=prev:next._prev=prev,record},DefaultIterableDiffer.prototype._addToMoves=function(record,toIndex){return record.previousIndex===toIndex?record:(null===this._movesTail?this._movesTail=this._movesHead=record:this._movesTail=this._movesTail._nextMoved=record,record)},DefaultIterableDiffer.prototype._addToRemovals=function(record){return null===this._unlinkedRecords&&(this._unlinkedRecords=new _DuplicateMap),this._unlinkedRecords.put(record),record.currentIndex=null,record._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=record,record._prevRemoved=null):(record._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=record),record},DefaultIterableDiffer.prototype._addIdentityChange=function(record,item){return record.item=item,null===this._identityChangesTail?this._identityChangesTail=this._identityChangesHead=record:this._identityChangesTail=this._identityChangesTail._nextIdentityChange=record,record},DefaultIterableDiffer}(),IterableChangeRecord_=function(){function IterableChangeRecord_(item,trackById){this.item=item,this.trackById=trackById,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}return IterableChangeRecord_}(),_DuplicateItemRecordList=function(){function _DuplicateItemRecordList(){this._head=null,this._tail=null}return _DuplicateItemRecordList.prototype.add=function(record){null===this._head?(this._head=this._tail=record,record._nextDup=null,record._prevDup=null):(this._tail._nextDup=record,record._prevDup=this._tail,record._nextDup=null,this._tail=record)},_DuplicateItemRecordList.prototype.get=function(trackById,atOrAfterIndex){var record;for(record=this._head;null!==record;record=record._nextDup)if((null===atOrAfterIndex||atOrAfterIndex<=record.currentIndex)&&looseIdentical(record.trackById,trackById))return record;return null},_DuplicateItemRecordList.prototype.remove=function(record){var prev=record._prevDup,next=record._nextDup;return null===prev?this._head=next:prev._nextDup=next,null===next?this._tail=prev:next._prevDup=prev,null===this._head},_DuplicateItemRecordList}(),_DuplicateMap=function(){function _DuplicateMap(){this.map=new Map}return _DuplicateMap.prototype.put=function(record){var key=record.trackById,duplicates=this.map.get(key);duplicates||(duplicates=new _DuplicateItemRecordList,this.map.set(key,duplicates)),duplicates.add(record)},_DuplicateMap.prototype.get=function(trackById,atOrAfterIndex){var key=trackById,recordList=this.map.get(key);return recordList?recordList.get(trackById,atOrAfterIndex):null},_DuplicateMap.prototype.remove=function(record){var key=record.trackById;return this.map.get(key).remove(record)&&this.map.delete(key),record},Object.defineProperty(_DuplicateMap.prototype,"isEmpty",{get:function(){return 0===this.map.size},enumerable:!0,configurable:!0}),_DuplicateMap.prototype.clear=function(){this.map.clear()},_DuplicateMap}(),DefaultKeyValueDifferFactory=function(){function DefaultKeyValueDifferFactory(){}return DefaultKeyValueDifferFactory.prototype.supports=function(obj){return obj instanceof Map||isJsObject(obj)},DefaultKeyValueDifferFactory.prototype.create=function(){return new DefaultKeyValueDiffer},DefaultKeyValueDifferFactory}(),DefaultKeyValueDiffer=function(){function DefaultKeyValueDiffer(){this._records=new Map,this._mapHead=null,this._appendAfter=null,this._previousMapHead=null,this._changesHead=null,this._changesTail=null,this._additionsHead=null,this._additionsTail=null,this._removalsHead=null,this._removalsTail=null}return Object.defineProperty(DefaultKeyValueDiffer.prototype,"isDirty",{get:function(){return null!==this._additionsHead||null!==this._changesHead||null!==this._removalsHead},enumerable:!0,configurable:!0}),DefaultKeyValueDiffer.prototype.forEachItem=function(fn){var record;for(record=this._mapHead;null!==record;record=record._next)fn(record)},DefaultKeyValueDiffer.prototype.forEachPreviousItem=function(fn){var record;for(record=this._previousMapHead;null!==record;record=record._nextPrevious)fn(record)},DefaultKeyValueDiffer.prototype.forEachChangedItem=function(fn){var record;for(record=this._changesHead;null!==record;record=record._nextChanged)fn(record)},DefaultKeyValueDiffer.prototype.forEachAddedItem=function(fn){var record;for(record=this._additionsHead;null!==record;record=record._nextAdded)fn(record)},DefaultKeyValueDiffer.prototype.forEachRemovedItem=function(fn){var record;for(record=this._removalsHead;null!==record;record=record._nextRemoved)fn(record)},DefaultKeyValueDiffer.prototype.diff=function(map){if(map){if(!(map instanceof Map||isJsObject(map)))throw new Error("Error trying to diff '"+stringify$1(map)+"'. Only maps and objects are allowed")}else map=new Map;return this.check(map)?this:null},DefaultKeyValueDiffer.prototype.onDestroy=function(){},DefaultKeyValueDiffer.prototype.check=function(map){var _this=this;this._reset();var insertBefore=this._mapHead;if(this._appendAfter=null,this._forEach(map,function(value,key){if(insertBefore&&insertBefore.key===key)_this._maybeAddToChanges(insertBefore,value),_this._appendAfter=insertBefore,insertBefore=insertBefore._next;else{var record=_this._getOrCreateRecordForKey(key,value);insertBefore=_this._insertBeforeOrAppend(insertBefore,record)}}),insertBefore){insertBefore._prev&&(insertBefore._prev._next=null),this._removalsHead=insertBefore;for(var record=insertBefore;null!==record;record=record._nextRemoved)record===this._mapHead&&(this._mapHead=null),this._records.delete(record.key),record._nextRemoved=record._next,record.previousValue=record.currentValue,record.currentValue=null,record._prev=null,record._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty},DefaultKeyValueDiffer.prototype._insertBeforeOrAppend=function(before,record){if(before){var prev=before._prev;return record._next=before,record._prev=prev,before._prev=record,prev&&(prev._next=record),before===this._mapHead&&(this._mapHead=record),this._appendAfter=before,before}return this._appendAfter?(this._appendAfter._next=record,record._prev=this._appendAfter):this._mapHead=record,this._appendAfter=record,null},DefaultKeyValueDiffer.prototype._getOrCreateRecordForKey=function(key,value){if(this._records.has(key)){var record_1=this._records.get(key);this._maybeAddToChanges(record_1,value);var prev=record_1._prev,next=record_1._next;return prev&&(prev._next=next),next&&(next._prev=prev),record_1._next=null,record_1._prev=null,record_1}var record=new KeyValueChangeRecord_(key);return this._records.set(key,record),record.currentValue=value,this._addToAdditions(record),record},DefaultKeyValueDiffer.prototype._reset=function(){if(this.isDirty){var record=void 0;for(this._previousMapHead=this._mapHead,record=this._previousMapHead;null!==record;record=record._next)record._nextPrevious=record._next;for(record=this._changesHead;null!==record;record=record._nextChanged)record.previousValue=record.currentValue;for(record=this._additionsHead;null!=record;record=record._nextAdded)record.previousValue=record.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}},DefaultKeyValueDiffer.prototype._maybeAddToChanges=function(record,newValue){looseIdentical(newValue,record.currentValue)||(record.previousValue=record.currentValue,record.currentValue=newValue,this._addToChanges(record))},DefaultKeyValueDiffer.prototype._addToAdditions=function(record){null===this._additionsHead?this._additionsHead=this._additionsTail=record:(this._additionsTail._nextAdded=record,this._additionsTail=record)},DefaultKeyValueDiffer.prototype._addToChanges=function(record){null===this._changesHead?this._changesHead=this._changesTail=record:(this._changesTail._nextChanged=record,this._changesTail=record)},DefaultKeyValueDiffer.prototype._forEach=function(obj,fn){obj instanceof Map?obj.forEach(fn):Object.keys(obj).forEach(function(k){return fn(obj[k],k)})},DefaultKeyValueDiffer}(),KeyValueChangeRecord_=function(){function KeyValueChangeRecord_(key){this.key=key,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}return KeyValueChangeRecord_}(),IterableDiffers=function(){function IterableDiffers(factories){this.factories=factories}return IterableDiffers.create=function(factories,parent){if(null!=parent){var copied=parent.factories.slice();return factories=factories.concat(copied),new IterableDiffers(factories)}return new IterableDiffers(factories)},IterableDiffers.extend=function(factories){return{provide:IterableDiffers,useFactory:function(parent){if(!parent)throw new Error("Cannot extend IterableDiffers without a parent injector");return IterableDiffers.create(factories,parent)},deps:[[IterableDiffers,new SkipSelf,new Optional]]}},IterableDiffers.prototype.find=function(iterable){var factory=this.factories.find(function(f){return f.supports(iterable)});if(null!=factory)return factory;throw new Error("Cannot find a differ supporting object '"+iterable+"' of type '"+getTypeNameForDebugging(iterable)+"'")},IterableDiffers}(),KeyValueDiffers=function(){function KeyValueDiffers(factories){this.factories=factories}return KeyValueDiffers.create=function(factories,parent){if(parent){var copied=parent.factories.slice();factories=factories.concat(copied)}return new KeyValueDiffers(factories)},KeyValueDiffers.extend=function(factories){return{provide:KeyValueDiffers,useFactory:function(parent){if(!parent)throw new Error("Cannot extend KeyValueDiffers without a parent injector");return KeyValueDiffers.create(factories,parent)},deps:[[KeyValueDiffers,new SkipSelf,new Optional]]}},KeyValueDiffers.prototype.find=function(kv){var factory=this.factories.find(function(f){return f.supports(kv)});if(factory)return factory;throw new Error("Cannot find a differ supporting object '"+kv+"'")},KeyValueDiffers}(),keyValDiff=[new DefaultKeyValueDifferFactory],iterableDiff=[new DefaultIterableDifferFactory],defaultIterableDiffers=new IterableDiffers(iterableDiff),defaultKeyValueDiffers=new KeyValueDiffers(keyValDiff),_CORE_PLATFORM_PROVIDERS=[{provide:PLATFORM_ID,useValue:"unknown"},{provide:PlatformRef,deps:[Injector]},{provide:TestabilityRegistry,deps:[]},{provide:Console,deps:[]}],LOCALE_ID=(function(parentPlatformFactory,name,providers){void 0===providers&&(providers=[]);var desc="Platform: "+name,marker=new InjectionToken(desc)}(null,"core",_CORE_PLATFORM_PROVIDERS),new InjectionToken("LocaleId")),SecurityContext$1=(new InjectionToken("Translations"),new InjectionToken("TranslationsFormat"),function(){function ApplicationModule(appRef){}ApplicationModule.decorators=[{type:NgModule$1,args:[{providers:[ApplicationRef,ApplicationInitStatus,Compiler,APP_ID_RANDOM_PROVIDER,{provide:IterableDiffers,useFactory:_iterableDiffersFactory},{provide:KeyValueDiffers,useFactory:_keyValueDiffersFactory},{provide:LOCALE_ID,useFactory:_localeFactory,deps:[[new Inject$1(LOCALE_ID),new Optional,new SkipSelf]]}]}]}],ApplicationModule.ctorParameters=function(){return[{type:ApplicationRef}]}}(),{NONE:0,HTML:1,STYLE:2,SCRIPT:3,URL:4,RESOURCE_URL:5});SecurityContext$1[SecurityContext$1.NONE]="NONE",SecurityContext$1[SecurityContext$1.HTML]="HTML",SecurityContext$1[SecurityContext$1.STYLE]="STYLE",SecurityContext$1[SecurityContext$1.SCRIPT]="SCRIPT",SecurityContext$1[SecurityContext$1.URL]="URL",SecurityContext$1[SecurityContext$1.RESOURCE_URL]="RESOURCE_URL";var Sanitizer=function(){function Sanitizer(){}return Sanitizer}(),Services={setCurrentNode:void 0,createRootView:void 0,createEmbeddedView:void 0,createComponentView:void 0,createNgModuleRef:void 0,overrideProvider:void 0,overrideComponentView:void 0,clearOverrides:void 0,checkAndUpdateView:void 0,checkNoChangesView:void 0,destroyView:void 0,resolveDep:void 0,createDebugContext:void 0,handleEvent:void 0,updateDirectives:void 0,updateRenderer:void 0,dirtyParentQueries:void 0},NOOP=function(){},_tokenKeyCache=new Map,DEFINITION_CACHE=new WeakMap,NS_PREFIX_RE=/^:([^:]+):(.+)$/,UNDEFINED_VALUE=new Object,InjectorRefTokenKey$1=tokenKey(Injector),NgModuleRefTokenKey=tokenKey(NgModuleRef),EMPTY_CONTEXT=new Object,ComponentRef_=(function(_super){function ComponentFactory_(selector,componentType,viewDefFactory,_inputs,_outputs,ngContentSelectors){var _this=_super.call(this)||this;return _this.selector=selector,_this.componentType=componentType,_this._inputs=_inputs,_this._outputs=_outputs,_this.ngContentSelectors=ngContentSelectors,_this.viewDefFactory=viewDefFactory,_this}__extends(ComponentFactory_,_super),Object.defineProperty(ComponentFactory_.prototype,"inputs",{get:function(){var inputsArr=[],inputs=this._inputs;for(var propName in inputs){var templateName=inputs[propName];inputsArr.push({propName:propName,templateName:templateName})}return inputsArr},enumerable:!0,configurable:!0}),Object.defineProperty(ComponentFactory_.prototype,"outputs",{get:function(){var outputsArr=[];for(var propName in this._outputs){var templateName=this._outputs[propName];outputsArr.push({propName:propName,templateName:templateName})}return outputsArr},enumerable:!0,configurable:!0}),ComponentFactory_.prototype.create=function(injector,projectableNodes,rootSelectorOrNode,ngModule){if(!ngModule)throw new Error("ngModule should be provided");var viewDef=resolveDefinition(this.viewDefFactory),componentNodeIndex=viewDef.nodes[0].element.componentProvider.nodeIndex,view=Services.createRootView(injector,projectableNodes||[],rootSelectorOrNode,viewDef,ngModule,EMPTY_CONTEXT),component=asProviderData(view,componentNodeIndex).instance
407
+ ;return rootSelectorOrNode&&view.renderer.setAttribute(asElementData(view,0).renderElement,"ng-version",VERSION$2.full),new ComponentRef_(view,new ViewRef_(view),component)}}(ComponentFactory),function(_super){function ComponentRef_(_view,_viewRef,_component){var _this=_super.call(this)||this;return _this._view=_view,_this._viewRef=_viewRef,_this._component=_component,_this._elDef=_this._view.def.nodes[0],_this.hostView=_viewRef,_this.changeDetectorRef=_viewRef,_this.instance=_component,_this}return __extends(ComponentRef_,_super),Object.defineProperty(ComponentRef_.prototype,"location",{get:function(){return new ElementRef(asElementData(this._view,this._elDef.nodeIndex).renderElement)},enumerable:!0,configurable:!0}),Object.defineProperty(ComponentRef_.prototype,"injector",{get:function(){return new Injector_(this._view,this._elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(ComponentRef_.prototype,"componentType",{get:function(){return this._component.constructor},enumerable:!0,configurable:!0}),ComponentRef_.prototype.destroy=function(){this._viewRef.destroy()},ComponentRef_.prototype.onDestroy=function(callback){this._viewRef.onDestroy(callback)},ComponentRef_}(ComponentRef)),ViewContainerRef_=function(){function ViewContainerRef_(_view,_elDef,_data){this._view=_view,this._elDef=_elDef,this._data=_data,this._embeddedViews=[]}return Object.defineProperty(ViewContainerRef_.prototype,"element",{get:function(){return new ElementRef(this._data.renderElement)},enumerable:!0,configurable:!0}),Object.defineProperty(ViewContainerRef_.prototype,"injector",{get:function(){return new Injector_(this._view,this._elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(ViewContainerRef_.prototype,"parentInjector",{get:function(){for(var view=this._view,elDef=this._elDef.parent;!elDef&&view;)elDef=viewParentEl(view),view=view.parent;return view?new Injector_(view,elDef):new Injector_(this._view,null)},enumerable:!0,configurable:!0}),ViewContainerRef_.prototype.clear=function(){for(var len=this._embeddedViews.length,i=len-1;i>=0;i--){var view=detachEmbeddedView(this._data,i);Services.destroyView(view)}},ViewContainerRef_.prototype.get=function(index){var view=this._embeddedViews[index];if(view){var ref=new ViewRef_(view);return ref.attachToViewContainerRef(this),ref}return null},Object.defineProperty(ViewContainerRef_.prototype,"length",{get:function(){return this._embeddedViews.length},enumerable:!0,configurable:!0}),ViewContainerRef_.prototype.createEmbeddedView=function(templateRef,context,index){var viewRef=templateRef.createEmbeddedView(context||{});return this.insert(viewRef,index),viewRef},ViewContainerRef_.prototype.createComponent=function(componentFactory,index,injector,projectableNodes,ngModuleRef){var contextInjector=injector||this.parentInjector;ngModuleRef||componentFactory instanceof ComponentFactoryBoundToModule||(ngModuleRef=contextInjector.get(NgModuleRef));var componentRef=componentFactory.create(contextInjector,projectableNodes,void 0,ngModuleRef);return this.insert(componentRef.hostView,index),componentRef},ViewContainerRef_.prototype.insert=function(viewRef,index){if(viewRef.destroyed)throw new Error("Cannot insert a destroyed View in a ViewContainer!");var viewRef_=viewRef,viewData=viewRef_._view;return attachEmbeddedView(this._view,this._data,index,viewData),viewRef_.attachToViewContainerRef(this),viewRef},ViewContainerRef_.prototype.move=function(viewRef,currentIndex){if(viewRef.destroyed)throw new Error("Cannot move a destroyed View in a ViewContainer!");var previousIndex=this._embeddedViews.indexOf(viewRef._view);return moveEmbeddedView(this._data,previousIndex,currentIndex),viewRef},ViewContainerRef_.prototype.indexOf=function(viewRef){return this._embeddedViews.indexOf(viewRef._view)},ViewContainerRef_.prototype.remove=function(index){var viewData=detachEmbeddedView(this._data,index);viewData&&Services.destroyView(viewData)},ViewContainerRef_.prototype.detach=function(index){var view=detachEmbeddedView(this._data,index);return view?new ViewRef_(view):null},ViewContainerRef_}(),ViewRef_=function(){function ViewRef_(_view){this._view=_view,this._viewContainerRef=null,this._appRef=null}return Object.defineProperty(ViewRef_.prototype,"rootNodes",{get:function(){return rootRenderNodes(this._view)},enumerable:!0,configurable:!0}),Object.defineProperty(ViewRef_.prototype,"context",{get:function(){return this._view.context},enumerable:!0,configurable:!0}),Object.defineProperty(ViewRef_.prototype,"destroyed",{get:function(){return 0!=(128&this._view.state)},enumerable:!0,configurable:!0}),ViewRef_.prototype.markForCheck=function(){markParentViewsForCheck(this._view)},ViewRef_.prototype.detach=function(){this._view.state&=-5},ViewRef_.prototype.detectChanges=function(){var fs$$1=this._view.root.rendererFactory;fs$$1.begin&&fs$$1.begin();try{Services.checkAndUpdateView(this._view)}finally{fs$$1.end&&fs$$1.end()}},ViewRef_.prototype.checkNoChanges=function(){Services.checkNoChangesView(this._view)},ViewRef_.prototype.reattach=function(){this._view.state|=4},ViewRef_.prototype.onDestroy=function(callback){this._view.disposables||(this._view.disposables=[]),this._view.disposables.push(callback)},ViewRef_.prototype.destroy=function(){this._appRef?this._appRef.detachView(this):this._viewContainerRef&&this._viewContainerRef.detach(this._viewContainerRef.indexOf(this)),Services.destroyView(this._view)},ViewRef_.prototype.detachFromAppRef=function(){this._appRef=null,renderDetachView(this._view),Services.dirtyParentQueries(this._view)},ViewRef_.prototype.attachToAppRef=function(appRef){if(this._viewContainerRef)throw new Error("This view is already attached to a ViewContainer!");this._appRef=appRef},ViewRef_.prototype.attachToViewContainerRef=function(vcRef){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._viewContainerRef=vcRef},ViewRef_}(),TemplateRef_=function(_super){function TemplateRef_(_parentView,_def){var _this=_super.call(this)||this;return _this._parentView=_parentView,_this._def=_def,_this}return __extends(TemplateRef_,_super),TemplateRef_.prototype.createEmbeddedView=function(context){return new ViewRef_(Services.createEmbeddedView(this._parentView,this._def,this._def.element.template,context))},Object.defineProperty(TemplateRef_.prototype,"elementRef",{get:function(){return new ElementRef(asElementData(this._parentView,this._def.nodeIndex).renderElement)},enumerable:!0,configurable:!0}),TemplateRef_}(TemplateRef),Injector_=function(){function Injector_(view,elDef){this.view=view,this.elDef=elDef}return Injector_.prototype.get=function(token,notFoundValue){void 0===notFoundValue&&(notFoundValue=Injector.THROW_IF_NOT_FOUND);var allowPrivateServices=!!this.elDef&&0!=(33554432&this.elDef.flags);return Services.resolveDep(this.view,this.elDef,allowPrivateServices,{flags:0,token:token,tokenKey:tokenKey(token)},notFoundValue)},Injector_}(),RendererAdapter=function(){function RendererAdapter(delegate){this.delegate=delegate}return RendererAdapter.prototype.selectRootElement=function(selectorOrNode){return this.delegate.selectRootElement(selectorOrNode)},RendererAdapter.prototype.createElement=function(parent,namespaceAndName){var _a=splitNamespace(namespaceAndName),ns=_a[0],name=_a[1],el=this.delegate.createElement(name,ns);return parent&&this.delegate.appendChild(parent,el),el},RendererAdapter.prototype.createViewRoot=function(hostElement){return hostElement},RendererAdapter.prototype.createTemplateAnchor=function(parentElement){var comment=this.delegate.createComment("");return parentElement&&this.delegate.appendChild(parentElement,comment),comment},RendererAdapter.prototype.createText=function(parentElement,value){var node=this.delegate.createText(value);return parentElement&&this.delegate.appendChild(parentElement,node),node},RendererAdapter.prototype.projectNodes=function(parentElement,nodes){for(var i=0;i<nodes.length;i++)this.delegate.appendChild(parentElement,nodes[i])},RendererAdapter.prototype.attachViewAfter=function(node,viewRootNodes){for(var parentElement=this.delegate.parentNode(node),nextSibling=this.delegate.nextSibling(node),i=0;i<viewRootNodes.length;i++)this.delegate.insertBefore(parentElement,viewRootNodes[i],nextSibling)},RendererAdapter.prototype.detachView=function(viewRootNodes){for(var i=0;i<viewRootNodes.length;i++){var node=viewRootNodes[i],parentElement=this.delegate.parentNode(node);this.delegate.removeChild(parentElement,node)}},RendererAdapter.prototype.destroyView=function(hostElement,viewAllNodes){for(var i=0;i<viewAllNodes.length;i++)this.delegate.destroyNode(viewAllNodes[i])},RendererAdapter.prototype.listen=function(renderElement,name,callback){return this.delegate.listen(renderElement,name,callback)},RendererAdapter.prototype.listenGlobal=function(target,name,callback){return this.delegate.listen(target,name,callback)},RendererAdapter.prototype.setElementProperty=function(renderElement,propertyName,propertyValue){this.delegate.setProperty(renderElement,propertyName,propertyValue)},RendererAdapter.prototype.setElementAttribute=function(renderElement,namespaceAndName,attributeValue){var _a=splitNamespace(namespaceAndName),ns=_a[0],name=_a[1];null!=attributeValue?this.delegate.setAttribute(renderElement,name,attributeValue,ns):this.delegate.removeAttribute(renderElement,name,ns)},RendererAdapter.prototype.setBindingDebugInfo=function(renderElement,propertyName,propertyValue){},RendererAdapter.prototype.setElementClass=function(renderElement,className,isAdd){isAdd?this.delegate.addClass(renderElement,className):this.delegate.removeClass(renderElement,className)},RendererAdapter.prototype.setElementStyle=function(renderElement,styleName,styleValue){null!=styleValue?this.delegate.setStyle(renderElement,styleName,styleValue):this.delegate.removeStyle(renderElement,styleName)},RendererAdapter.prototype.invokeElementMethod=function(renderElement,methodName,args){renderElement[methodName].apply(renderElement,args)},RendererAdapter.prototype.setText=function(renderNode$$1,text){this.delegate.setValue(renderNode$$1,text)},RendererAdapter.prototype.animate=function(){throw new Error("Renderer.animate is no longer supported!")},RendererAdapter}(),NgModuleRef_=function(){function NgModuleRef_(_moduleType,_parent,_bootstrapComponents,_def){this._moduleType=_moduleType,this._parent=_parent,this._bootstrapComponents=_bootstrapComponents,this._def=_def,this._destroyListeners=[],this._destroyed=!1,this.injector=this,initNgModule(this)}return NgModuleRef_.prototype.get=function(token,notFoundValue){return void 0===notFoundValue&&(notFoundValue=Injector.THROW_IF_NOT_FOUND),resolveNgModuleDep(this,{token:token,tokenKey:tokenKey(token),flags:0},notFoundValue)},Object.defineProperty(NgModuleRef_.prototype,"instance",{get:function(){return this.get(this._moduleType)},enumerable:!0,configurable:!0}),Object.defineProperty(NgModuleRef_.prototype,"componentFactoryResolver",{get:function(){return this.get(ComponentFactoryResolver)},enumerable:!0,configurable:!0}),NgModuleRef_.prototype.destroy=function(){if(this._destroyed)throw new Error("The ng module "+stringify$1(this.instance.constructor)+" has already been destroyed.");this._destroyed=!0,callNgModuleLifecycle(this,131072),this._destroyListeners.forEach(function(listener){return listener()})},NgModuleRef_.prototype.onDestroy=function(callback){this._destroyListeners.push(callback)},NgModuleRef_}(),RendererV1TokenKey=tokenKey(Renderer),Renderer2TokenKey=tokenKey(Renderer2),ElementRefTokenKey=tokenKey(ElementRef),ViewContainerRefTokenKey=tokenKey(ViewContainerRef),TemplateRefTokenKey=tokenKey(TemplateRef),ChangeDetectorRefTokenKey=tokenKey(ChangeDetectorRef),InjectorRefTokenKey=tokenKey(Injector),NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR={},ViewAction={CreateViewNodes:0,CheckNoChanges:1,CheckNoChangesProjectedViews:2,CheckAndUpdate:3,CheckAndUpdateProjectedViews:4,Destroy:5};ViewAction[ViewAction.CreateViewNodes]="CreateViewNodes",ViewAction[ViewAction.CheckNoChanges]="CheckNoChanges",ViewAction[ViewAction.CheckNoChangesProjectedViews]="CheckNoChangesProjectedViews",ViewAction[ViewAction.CheckAndUpdate]="CheckAndUpdate",ViewAction[ViewAction.CheckAndUpdateProjectedViews]="CheckAndUpdateProjectedViews",ViewAction[ViewAction.Destroy]="Destroy";/**
408
408
  * @license
409
409
  * Copyright Google Inc. All Rights Reserved.
410
410
  *
@@ -433,5 +433,5 @@ var currentView;!function(){function QueryList_(){this.dirty=!1,this._valuesTree
433
433
  * found in the LICENSE file at https://angular.io/license
434
434
  */
435
435
  var values=["ID","CDATA","NAME",["ltr","rtl"],["rect","circle","poly","default"],"NUMBER",["nohref"],["ismap"],["declare"],["DATA","REF","OBJECT"],["GET","POST"],"IDREF",["TEXT","PASSWORD","CHECKBOX","RADIO","SUBMIT","RESET","FILE","HIDDEN","IMAGE","BUTTON"],["checked"],["disabled"],["readonly"],["multiple"],["selected"],["button","submit","reset"],["void","above","below","hsides","lhs","rhs","vsides","box","border"],["none","groups","rows","cols","all"],["left","center","right","justify","char"],["top","middle","bottom","baseline"],"IDREFS",["row","col","rowgroup","colgroup"],["defer"]],groups=[{id:0},{onclick:1,ondblclick:1,onmousedown:1,onmouseup:1,onmouseover:1,onmousemove:1,onmouseout:1,onkeypress:1,onkeydown:1,onkeyup:1},{lang:2,dir:3},{onload:1,onunload:1},{name:1},{href:1},{type:1},{alt:1},{tabindex:5},{media:1},{nohref:6},{usemap:1},{src:1},{onfocus:1,onblur:1},{charset:1},{declare:8,classid:1,codebase:1,data:1,codetype:1,archive:1,standby:1},{title:1},{value:1},{cite:1},{datetime:1},{accept:1},{shape:4,coords:1},{for:11},{action:1,method:10,enctype:1,onsubmit:1,onreset:1,"accept-charset":1},{valuetype:9},{longdesc:1},{width:1},{disabled:14},{readonly:15,onselect:1},{accesskey:1},{size:5,multiple:16},{onchange:1},{label:1},{selected:17},{type:12,checked:13,size:1,maxlength:5},{rows:5,cols:5},{type:18},{height:1},{summary:1,border:1,frame:19,rules:20,cellspacing:1,cellpadding:1,datapagesize:1},{align:21,char:1,charoff:1,valign:22},{span:5},{abbr:1,axis:1,headers:23,scope:24,rowspan:5,colspan:5},{profile:1},{"http-equiv":2,name:2,content:1,scheme:1},{class:1,style:1},{hreflang:2,rel:1,rev:1},{ismap:7},{defer:25,event:1,for:1}],elements={TT:[0,1,2,16,44],I:[0,1,2,16,44],B:[0,1,2,16,44],BIG:[0,1,2,16,44],SMALL:[0,1,2,16,44],EM:[0,1,2,16,44],STRONG:[0,1,2,16,44],DFN:[0,1,2,16,44],CODE:[0,1,2,16,44],SAMP:[0,1,2,16,44],KBD:[0,1,2,16,44],VAR:[0,1,2,16,44],CITE:[0,1,2,16,44],ABBR:[0,1,2,16,44],ACRONYM:[0,1,2,16,44],SUB:[0,1,2,16,44],SUP:[0,1,2,16,44],SPAN:[0,1,2,16,44],BDO:[0,2,16,44],BR:[0,16,44],BODY:[0,1,2,3,16,44],ADDRESS:[0,1,2,16,44],DIV:[0,1,2,16,44],A:[0,1,2,4,5,6,8,13,14,16,21,29,44,45],MAP:[0,1,2,4,16,44],AREA:[0,1,2,5,7,8,10,13,16,21,29,44],LINK:[0,1,2,5,6,9,14,16,44,45],IMG:[0,1,2,4,7,11,12,16,25,26,37,44,46],OBJECT:[0,1,2,4,6,8,11,15,16,26,37,44],PARAM:[0,4,6,17,24],HR:[0,1,2,16,44],P:[0,1,2,16,44],H1:[0,1,2,16,44],H2:[0,1,2,16,44],H3:[0,1,2,16,44],H4:[0,1,2,16,44],H5:[0,1,2,16,44],H6:[0,1,2,16,44],PRE:[0,1,2,16,44],Q:[0,1,2,16,18,44],BLOCKQUOTE:[0,1,2,16,18,44],INS:[0,1,2,16,18,19,44],DEL:[0,1,2,16,18,19,44],DL:[0,1,2,16,44],DT:[0,1,2,16,44],DD:[0,1,2,16,44],OL:[0,1,2,16,44],UL:[0,1,2,16,44],LI:[0,1,2,16,44],FORM:[0,1,2,4,16,20,23,44],LABEL:[0,1,2,13,16,22,29,44],INPUT:[0,1,2,4,7,8,11,12,13,16,17,20,27,28,29,31,34,44,46],SELECT:[0,1,2,4,8,13,16,27,30,31,44],OPTGROUP:[0,1,2,16,27,32,44],OPTION:[0,1,2,16,17,27,32,33,44],TEXTAREA:[0,1,2,4,8,13,16,27,28,29,31,35,44],FIELDSET:[0,1,2,16,44],LEGEND:[0,1,2,16,29,44],BUTTON:[0,1,2,4,8,13,16,17,27,29,36,44],TABLE:[0,1,2,16,26,38,44],CAPTION:[0,1,2,16,44],COLGROUP:[0,1,2,16,26,39,40,44],COL:[0,1,2,16,26,39,40,44],THEAD:[0,1,2,16,39,44],TBODY:[0,1,2,16,39,44],TFOOT:[0,1,2,16,39,44],TR:[0,1,2,16,39,44],TH:[0,1,2,16,39,41,44],TD:[0,1,2,16,39,41,44],HEAD:[2,42],TITLE:[2],BASE:[5],META:[2,43],STYLE:[2,6,9,16],SCRIPT:[6,12,14,47],NOSCRIPT:[0,1,2,16,44],HTML:[2]},defaultAttributes=[0,1,2,4],SCHEMA=["[Element]|textContent,%classList,className,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*copy,*cut,*paste,*search,*selectstart,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerHTML,#scrollLeft,#scrollTop,slot,*message,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored","[HTMLElement]^[Element]|accessKey,contentEditable,dir,!draggable,!hidden,innerText,lang,*abort,*auxclick,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,outerText,!spellcheck,%style,#tabIndex,title,!translate","abbr,address,article,aside,b,bdi,bdo,cite,code,dd,dfn,dt,em,figcaption,figure,footer,header,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,contentEditable,dir,!draggable,!hidden,innerText,lang,*abort,*auxclick,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,outerText,!spellcheck,%style,#tabIndex,title,!translate","media^[HTMLElement]|!autoplay,!controls,%controlsList,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,*waitingforkey,#playbackRate,preload,src,%srcObject,#volume",":svg:^[HTMLElement]|*abort,*auxclick,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,%style,#tabIndex",":svg:graphics^:svg:|",":svg:animation^:svg:|*begin,*end,*repeat",":svg:geometry^:svg:|",":svg:componentTransferFunction^:svg:|",":svg:gradient^:svg:|",":svg:textContent^:svg:graphics|",":svg:textPositioning^:svg:textContent|","a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,rev,search,shape,target,text,type,username","area^[HTMLElement]|alt,coords,download,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,rel,search,shape,target,username","audio^media|","br^[HTMLElement]|clear","base^[HTMLElement]|href,target","body^[HTMLElement]|aLink,background,bgColor,link,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink","button^[HTMLElement]|!autofocus,!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value","canvas^[HTMLElement]|#height,#width","content^[HTMLElement]|select","dl^[HTMLElement]|!compact","datalist^[HTMLElement]|","details^[HTMLElement]|!open","dialog^[HTMLElement]|!open,returnValue","dir^[HTMLElement]|!compact","div^[HTMLElement]|align","embed^[HTMLElement]|align,height,name,src,type,width","fieldset^[HTMLElement]|!disabled,name","font^[HTMLElement]|color,face,size","form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target","frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src","frameset^[HTMLElement]|cols,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows","hr^[HTMLElement]|align,color,!noShade,size,width","head^[HTMLElement]|","h1,h2,h3,h4,h5,h6^[HTMLElement]|align","html^[HTMLElement]|version","iframe^[HTMLElement]|align,!allowFullscreen,frameBorder,height,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width","img^[HTMLElement]|align,alt,border,%crossOrigin,#height,#hspace,!isMap,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width","input^[HTMLElement]|accept,align,alt,autocapitalize,autocomplete,!autofocus,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width","li^[HTMLElement]|type,#value","label^[HTMLElement]|htmlFor","legend^[HTMLElement]|align","link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,integrity,media,referrerPolicy,rel,%relList,rev,%sizes,target,type","map^[HTMLElement]|name","marquee^[HTMLElement]|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width","menu^[HTMLElement]|!compact","meta^[HTMLElement]|content,httpEquiv,name,scheme","meter^[HTMLElement]|#high,#low,#max,#min,#optimum,#value","ins,del^[HTMLElement]|cite,dateTime","ol^[HTMLElement]|!compact,!reversed,#start,type","object^[HTMLElement]|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width","optgroup^[HTMLElement]|!disabled,label","option^[HTMLElement]|!defaultSelected,!disabled,label,!selected,text,value","output^[HTMLElement]|defaultValue,%htmlFor,name,value","p^[HTMLElement]|align","param^[HTMLElement]|name,type,value,valueType","picture^[HTMLElement]|","pre^[HTMLElement]|#width","progress^[HTMLElement]|#max,#value","q,blockquote,cite^[HTMLElement]|","script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,src,text,type","select^[HTMLElement]|!autofocus,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value","shadow^[HTMLElement]|","slot^[HTMLElement]|name","source^[HTMLElement]|media,sizes,src,srcset,type","span^[HTMLElement]|","style^[HTMLElement]|!disabled,media,type","caption^[HTMLElement]|align","th,td^[HTMLElement]|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width","col,colgroup^[HTMLElement]|align,ch,chOff,#span,vAlign,width","table^[HTMLElement]|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width","tr^[HTMLElement]|align,bgColor,ch,chOff,vAlign","tfoot,thead,tbody^[HTMLElement]|align,ch,chOff,vAlign","template^[HTMLElement]|","textarea^[HTMLElement]|autocapitalize,!autofocus,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap","title^[HTMLElement]|text","track^[HTMLElement]|!default,kind,label,src,srclang","ul^[HTMLElement]|!compact,type","unknown^[HTMLElement]|","video^media|#height,poster,#width",":svg:a^:svg:graphics|",":svg:animate^:svg:animation|",":svg:animateMotion^:svg:animation|",":svg:animateTransform^:svg:animation|",":svg:circle^:svg:geometry|",":svg:clipPath^:svg:graphics|",":svg:defs^:svg:graphics|",":svg:desc^:svg:|",":svg:discard^:svg:|",":svg:ellipse^:svg:geometry|",":svg:feBlend^:svg:|",":svg:feColorMatrix^:svg:|",":svg:feComponentTransfer^:svg:|",":svg:feComposite^:svg:|",":svg:feConvolveMatrix^:svg:|",":svg:feDiffuseLighting^:svg:|",":svg:feDisplacementMap^:svg:|",":svg:feDistantLight^:svg:|",":svg:feDropShadow^:svg:|",":svg:feFlood^:svg:|",":svg:feFuncA^:svg:componentTransferFunction|",":svg:feFuncB^:svg:componentTransferFunction|",":svg:feFuncG^:svg:componentTransferFunction|",":svg:feFuncR^:svg:componentTransferFunction|",":svg:feGaussianBlur^:svg:|",":svg:feImage^:svg:|",":svg:feMerge^:svg:|",":svg:feMergeNode^:svg:|",":svg:feMorphology^:svg:|",":svg:feOffset^:svg:|",":svg:fePointLight^:svg:|",":svg:feSpecularLighting^:svg:|",":svg:feSpotLight^:svg:|",":svg:feTile^:svg:|",":svg:feTurbulence^:svg:|",":svg:filter^:svg:|",":svg:foreignObject^:svg:graphics|",":svg:g^:svg:graphics|",":svg:image^:svg:graphics|",":svg:line^:svg:geometry|",":svg:linearGradient^:svg:gradient|",":svg:mpath^:svg:|",":svg:marker^:svg:|",":svg:mask^:svg:|",":svg:metadata^:svg:|",":svg:path^:svg:geometry|",":svg:pattern^:svg:|",":svg:polygon^:svg:geometry|",":svg:polyline^:svg:geometry|",":svg:radialGradient^:svg:gradient|",":svg:rect^:svg:geometry|",":svg:svg^:svg:graphics|#currentScale,#zoomAndPan",":svg:script^:svg:|type",":svg:set^:svg:animation|",":svg:stop^:svg:|",":svg:style^:svg:|!disabled,media,title,type",":svg:switch^:svg:graphics|",":svg:symbol^:svg:|",":svg:tspan^:svg:textPositioning|",":svg:text^:svg:textPositioning|",":svg:textPath^:svg:textContent|",":svg:title^:svg:|",":svg:use^:svg:graphics|",":svg:view^:svg:|#zoomAndPan","data^[HTMLElement]|value","keygen^[HTMLElement]|!autofocus,challenge,!disabled,form,keytype,name","menuitem^[HTMLElement]|type,label,icon,!disabled,!checked,radiogroup,!default","summary^[HTMLElement]|","time^[HTMLElement]|dateTime",":svg:cursor^:svg:|"],EVENT="event",BOOLEAN="boolean",NUMBER="number",STRING="string",OBJECT="object",SchemaInformation=function(){function SchemaInformation(){var _this=this;this.schema={},SCHEMA.forEach(function(encodedType){var parts=encodedType.split("|"),properties=parts[1].split(","),typeParts=(parts[0]+"^").split("^"),typeName=typeParts[0],type={};typeName.split(",").forEach(function(tag){return _this.schema[tag.toLowerCase()]=type});var superName=typeParts[1],superType=superName&&_this.schema[superName.toLowerCase()];if(superType)for(var key in superType)type[key]=superType[key];properties.forEach(function(property){""==property||(property.startsWith("*")?type[property.substring(1)]=EVENT:property.startsWith("!")?type[property.substring(1)]=BOOLEAN:property.startsWith("#")?type[property.substring(1)]=NUMBER:property.startsWith("%")?type[property.substring(1)]=OBJECT:type[property]=STRING)})})}return SchemaInformation.prototype.allKnownElements=function(){return Object.keys(this.schema)},SchemaInformation.prototype.eventsOf=function(elementName){var elementType=this.schema[elementName.toLowerCase()]||{};return Object.keys(elementType).filter(function(property){return elementType[property]===EVENT})},SchemaInformation.prototype.propertiesOf=function(elementName){var elementType=this.schema[elementName.toLowerCase()]||{};return Object.keys(elementType).filter(function(property){return elementType[property]!==EVENT})},SchemaInformation.prototype.typeOf=function(elementName,property){return(this.schema[elementName.toLowerCase()]||{})[property]},Object.defineProperty(SchemaInformation,"instance",{get:function(){var result=SchemaInformation._instance;return result||(result=SchemaInformation._instance=new SchemaInformation),result},enumerable:!0,configurable:!0}),SchemaInformation}(),hiddenHtmlElements={html:!0,script:!0,noscript:!0,base:!0,body:!0,title:!0,head:!0,link:!0},ExpressionVisitor=function(_super){function ExpressionVisitor(info,position,attr,getExpressionScope$$1){var _this=_super.call(this)||this;return _this.info=info,_this.position=position,_this.attr=attr,_this.getExpressionScope=getExpressionScope$$1||function(){return info.template.members},_this}return __extends(ExpressionVisitor,_super),ExpressionVisitor.prototype.visitDirectiveProperty=function(ast){this.attributeValueCompletions(ast.value)},ExpressionVisitor.prototype.visitElementProperty=function(ast){this.attributeValueCompletions(ast.value)},ExpressionVisitor.prototype.visitEvent=function(ast){this.attributeValueCompletions(ast.handler)},ExpressionVisitor.prototype.visitElement=function(ast){var _this=this;if(this.attr&&getSelectors(this.info)&&this.attr.name.startsWith("*")){var key_1=this.attr.name.substr("*".length),selectorInfo=getSelectors(this.info),selectors=selectorInfo.selectors,selector_1=selectors.filter(function(s){return s.attrs.some(function(attr,i){return i%2==0&&attr==key_1})})[0],templateBindingResult=this.info.expressionParser.parseTemplateBindings(key_1,this.attr.value,null);if(!this.attr.valueSpan)return;var valueRelativePosition_1=this.position-this.attr.valueSpan.start.offset-1,bindings=templateBindingResult.templateBindings,binding=bindings.find(function(binding){return inSpan(valueRelativePosition_1,binding.span,!0)})||bindings.find(function(binding){return inSpan(valueRelativePosition_1,binding.span)}),keyCompletions=function(){var keys=[];if(selector_1){keys=selector_1.attrs.filter(function(_,i){return i%2==0}).filter(function(name){return name.startsWith(key_1)&&name!=key_1}).map(function(name){return lowerName(name.substr(key_1.length))})}keys.push("let"),_this.result=keys.map(function(key){return{kind:"key",name:key,sort:key}})};if(!binding||binding.key==key_1&&!binding.expression)keyCompletions();else if(binding.keyIsVar){var equalLocation=this.attr.value.indexOf("=");if(this.result=[],equalLocation>=0&&valueRelativePosition_1>=equalLocation){var directiveMetadata=selectorInfo.map.get(selector_1);if(directiveMetadata){var contextTable=this.info.template.query.getTemplateContext(directiveMetadata.type.reference);contextTable&&(this.result=this.symbolsToCompletions(contextTable.values()))}}else binding.key&&valueRelativePosition_1<=binding.key.length-key_1.length&&keyCompletions()}else if(binding.expression&&inSpan(valueRelativePosition_1,binding.expression.ast.span)||binding.key&&valueRelativePosition_1>binding.span.start+(binding.key.length-key_1.length)||!binding.key){var span=new ParseSpan(0,this.attr.value.length);this.attributeValueCompletions(binding.expression?binding.expression.ast:new PropertyRead(span,new ImplicitReceiver(span),""),valueRelativePosition_1)}else keyCompletions()}},ExpressionVisitor.prototype.visitBoundText=function(ast){var expressionPosition=this.position-ast.sourceSpan.start.offset;if(inSpan(expressionPosition,ast.value.span)){var completions=getExpressionCompletions(this.getExpressionScope(),ast.value,expressionPosition,this.info.template.query);completions&&(this.result=this.symbolsToCompletions(completions))}},ExpressionVisitor.prototype.attributeValueCompletions=function(value,position){var symbols=getExpressionCompletions(this.getExpressionScope(),value,null==position?this.attributeValuePosition:position,this.info.template.query);symbols&&(this.result=this.symbolsToCompletions(symbols))},ExpressionVisitor.prototype.symbolsToCompletions=function(symbols){return symbols.filter(function(s){return!s.name.startsWith("__")&&s.public}).map(function(symbol){return{kind:symbol.kind,name:symbol.name,sort:symbol.name}})},Object.defineProperty(ExpressionVisitor.prototype,"attributeValuePosition",{get:function(){return this.attr&&this.attr.valueSpan?this.position-this.attr.valueSpan.start.offset-1:0},enumerable:!0,configurable:!0}),ExpressionVisitor}(NullTemplateVisitor),templateAttr=/^(\w+:)?(template$|^\*)/,OverrideKindSymbol=function(){function OverrideKindSymbol(sym,kindOverride){this.sym=sym,this.kind=kindOverride}return Object.defineProperty(OverrideKindSymbol.prototype,"name",{get:function(){return this.sym.name},enumerable:!0,configurable:!0}),Object.defineProperty(OverrideKindSymbol.prototype,"language",{get:function(){return this.sym.language},enumerable:!0,configurable:!0}),Object.defineProperty(OverrideKindSymbol.prototype,"type",{get:function(){return this.sym.type},enumerable:!0,configurable:!0}),Object.defineProperty(OverrideKindSymbol.prototype,"container",{get:function(){return this.sym.container},enumerable:!0,configurable:!0}),Object.defineProperty(OverrideKindSymbol.prototype,"public",{get:function(){return this.sym.public},enumerable:!0,configurable:!0}),Object.defineProperty(OverrideKindSymbol.prototype,"callable",{get:function(){return this.sym.callable},enumerable:!0,configurable:!0}),Object.defineProperty(OverrideKindSymbol.prototype,"nullable",{get:function(){return this.sym.nullable},enumerable:!0,configurable:!0}),Object.defineProperty(OverrideKindSymbol.prototype,"definition",{get:function(){return this.sym.definition},enumerable:!0,configurable:!0}),OverrideKindSymbol.prototype.members=function(){return this.sym.members()},OverrideKindSymbol.prototype.signatures=function(){return this.sym.signatures()},OverrideKindSymbol.prototype.selectSignature=function(types){return this.sym.selectSignature(types)},OverrideKindSymbol.prototype.indexed=function(argument){return this.sym.indexed(argument)},OverrideKindSymbol}(),LanguageServiceImpl=function(){function LanguageServiceImpl(host){this.host=host}return Object.defineProperty(LanguageServiceImpl.prototype,"metadataResolver",{get:function(){return this.host.resolver},enumerable:!0,configurable:!0}),LanguageServiceImpl.prototype.getTemplateReferences=function(){return this.host.getTemplateReferences()},LanguageServiceImpl.prototype.getDiagnostics=function(fileName){var results=[],templates=this.host.getTemplates(fileName);templates&&templates.length&&results.push.apply(results,getTemplateDiagnostics(fileName,this,templates));var declarations=this.host.getDeclarations(fileName);if(declarations&&declarations.length){var summary=this.host.getAnalyzedModules();results.push.apply(results,getDeclarationDiagnostics(declarations,summary))}return uniqueBySpan(results)},LanguageServiceImpl.prototype.getPipesAt=function(fileName,position){var templateInfo=this.getTemplateAstAtPosition(fileName,position);return templateInfo?templateInfo.pipes:[]},LanguageServiceImpl.prototype.getCompletionsAt=function(fileName,position){var templateInfo=this.getTemplateAstAtPosition(fileName,position);if(templateInfo)return getTemplateCompletions(templateInfo)},LanguageServiceImpl.prototype.getDefinitionAt=function(fileName,position){var templateInfo=this.getTemplateAstAtPosition(fileName,position);if(templateInfo)return getDefinition(templateInfo)},LanguageServiceImpl.prototype.getHoverAt=function(fileName,position){var templateInfo=this.getTemplateAstAtPosition(fileName,position);if(templateInfo)return getHover(templateInfo)},LanguageServiceImpl.prototype.getTemplateAstAtPosition=function(fileName,position){var template=this.host.getTemplateAt(fileName,position);if(template){var astResult=this.getTemplateAst(template,fileName);if(astResult&&astResult.htmlAst&&astResult.templateAst&&astResult.directive&&astResult.directives&&astResult.pipes&&astResult.expressionParser)return{position:position,fileName:fileName,template:template,htmlAst:astResult.htmlAst,directive:astResult.directive,directives:astResult.directives,pipes:astResult.pipes,templateAst:astResult.templateAst,expressionParser:astResult.expressionParser}}},LanguageServiceImpl.prototype.getTemplateAst=function(template,contextFile){var _this=this,result=void 0;try{var resolvedMetadata=this.metadataResolver.getNonNormalizedDirectiveMetadata(template.type),metadata=resolvedMetadata&&resolvedMetadata.metadata;if(metadata){var rawHtmlParser=new HtmlParser,htmlParser=new I18NHtmlParser(rawHtmlParser),expressionParser=new Parser(new Lexer),config=new CompilerConfig,parser=new TemplateParser(config,this.host.resolver.getReflector(),expressionParser,new DomElementSchemaRegistry,htmlParser,null,[]),htmlResult=htmlParser.parse(template.source,"",!0),analyzedModules=this.host.getAnalyzedModules(),ngModule=analyzedModules.ngModuleByPipeOrDirective.get(template.type);if(ngModule||(ngModule=findSuitableDefaultModule(analyzedModules)),ngModule){var resolvedDirectives=ngModule.transitiveModule.directives.map(function(d){return _this.host.resolver.getNonNormalizedDirectiveMetadata(d.reference)}),directives=removeMissing(resolvedDirectives).map(function(d){return d.metadata.toSummary()}),pipes=ngModule.transitiveModule.pipes.map(function(p){return _this.host.resolver.getOrLoadPipeMetadata(p.reference).toSummary()}),schemas=ngModule.schemas,parseResult=parser.tryParseHtml(htmlResult,metadata,directives,pipes,schemas);result={htmlAst:htmlResult.rootNodes,templateAst:parseResult.templateAst,directive:metadata,directives:directives,pipes:pipes,parseErrors:parseResult.errors,expressionParser:expressionParser,errors:void 0}}}}catch(e){var span=template.span;e.fileName==contextFile&&(span=template.query.getSpanAt(e.line,e.column)||span),result={errors:[{kind:DiagnosticKind.Error,message:e.message,span:span}]}}return result||{}},LanguageServiceImpl}(),ReflectorModuleModuleResolutionHost=function(){function ReflectorModuleModuleResolutionHost(host,getProgram){var _this=this;this.host=host,this.getProgram=getProgram,this.metadataCollector=new language_services_13({verboseInvalidExpression:!0}),host.directoryExists&&(this.directoryExists=function(directoryName){return _this.host.directoryExists(directoryName)})}return ReflectorModuleModuleResolutionHost.prototype.fileExists=function(fileName){return!!this.host.getScriptSnapshot(fileName)},ReflectorModuleModuleResolutionHost.prototype.readFile=function(fileName){var snapshot=this.host.getScriptSnapshot(fileName);if(snapshot)return snapshot.getText(0,snapshot.getLength())},ReflectorModuleModuleResolutionHost.prototype.getSourceFileMetadata=function(fileName){var sf=this.getProgram().getSourceFile(fileName);return sf?this.metadataCollector.getMetadata(sf):void 0},ReflectorModuleModuleResolutionHost.prototype.cacheMetadata=function(fileName){return fileName.endsWith(".d.ts")},ReflectorModuleModuleResolutionHost}(),ReflectorHost=function(){function ReflectorHost(getProgram,serviceHost,options){this.options=options,this.metadataReaderCache=language_services_14(),this.hostAdapter=new ReflectorModuleModuleResolutionHost(serviceHost,getProgram),this.moduleResolutionCache=ts.createModuleResolutionCache(serviceHost.getCurrentDirectory(),function(s){return s})}return ReflectorHost.prototype.getMetadataFor=function(modulePath){return language_services_15(modulePath,this.hostAdapter,this.metadataReaderCache)},ReflectorHost.prototype.moduleNameToFileName=function(moduleName,containingFile){if(!containingFile){if(0===moduleName.indexOf("."))throw new Error("Resolution of relative paths requires a containing file.");containingFile=path.join(this.options.basePath,"index.ts").replace(/\\/g,"/")}var resolved=ts.resolveModuleName(moduleName,containingFile,this.options,this.hostAdapter).resolvedModule;return resolved?resolved.resolvedFileName:null},ReflectorHost.prototype.getOutputName=function(filePath){return filePath},ReflectorHost}(),DummyHtmlParser=function(_super){function DummyHtmlParser(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(DummyHtmlParser,_super),DummyHtmlParser.prototype.parse=function(source,url,parseExpansionForms,interpolationConfig){return void 0===parseExpansionForms&&(parseExpansionForms=!1),void 0===interpolationConfig&&(interpolationConfig=DEFAULT_INTERPOLATION_CONFIG),new ParseTreeResult([],[])},DummyHtmlParser}(HtmlParser),DummyResourceLoader=function(_super){function DummyResourceLoader(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(DummyResourceLoader,_super),DummyResourceLoader.prototype.get=function(url){return Promise.resolve("")},DummyResourceLoader}(ResourceLoader),TypeScriptServiceHost=function(){function TypeScriptServiceHost(host,tsService){this.host=host,this.tsService=tsService,this._staticSymbolCache=new StaticSymbolCache,this._typeCache=[],this.modulesOutOfDate=!0,this.fileVersions=new Map}return TypeScriptServiceHost.prototype.setSite=function(service){this.service=service},Object.defineProperty(TypeScriptServiceHost.prototype,"resolver",{get:function(){var _this=this;this.validate();var result=this._resolver;if(!result){var moduleResolver=new NgModuleResolver(this.reflector),directiveResolver=new DirectiveResolver(this.reflector),pipeResolver=new PipeResolver(this.reflector),elementSchemaRegistry=new DomElementSchemaRegistry,resourceLoader=new DummyResourceLoader,urlResolver=createOfflineCompileUrlResolver(),htmlParser=new DummyHtmlParser,config=new CompilerConfig({defaultEncapsulation:ViewEncapsulation$1.Emulated,useJit:!1}),directiveNormalizer=new DirectiveNormalizer(resourceLoader,urlResolver,htmlParser,config);result=this._resolver=new CompileMetadataResolver(config,htmlParser,moduleResolver,directiveResolver,pipeResolver,new JitSummaryResolver,elementSchemaRegistry,directiveNormalizer,new Console,this._staticSymbolCache,this.reflector,function(error,type){return _this.collectError(error,type&&type.filePath)})}return result},enumerable:!0,configurable:!0}),TypeScriptServiceHost.prototype.getTemplateReferences=function(){return this.ensureTemplateMap(),this.templateReferences||[]},TypeScriptServiceHost.prototype.getTemplateAt=function(fileName,position){var sourceFile=this.getSourceFile(fileName);if(sourceFile){this.context=sourceFile.fileName;var node=this.findNode(sourceFile,position);if(node)return this.getSourceFromNode(fileName,this.host.getScriptVersion(sourceFile.fileName),node)}else{this.ensureTemplateMap();var componentType=this.fileToComponent.get(fileName);if(componentType)return this.getSourceFromType(fileName,this.host.getScriptVersion(fileName),componentType)}},TypeScriptServiceHost.prototype.getAnalyzedModules=function(){return this.updateAnalyzedModules(),this.ensureAnalyzedModules()},TypeScriptServiceHost.prototype.ensureAnalyzedModules=function(){var analyzedModules=this.analyzedModules;if(!analyzedModules){if(0===this.host.getScriptFileNames().length)analyzedModules={files:[],ngModuleByPipeOrDirective:new Map,ngModules:[]};else{var analyzeHost={isSourceFile:function(filePath){return!0}};analyzedModules=analyzeNgModules(this.program.getSourceFiles().map(function(sf){return sf.fileName}),analyzeHost,this.staticSymbolResolver,this.resolver)}this.analyzedModules=analyzedModules}return analyzedModules},TypeScriptServiceHost.prototype.getTemplates=function(fileName){var _this=this;if(this.ensureTemplateMap(),!this.fileToComponent.get(fileName)){var version_1=this.host.getScriptVersion(fileName),result_1=[],visit_1=function(child){var templateSource=_this.getSourceFromNode(fileName,version_1,child);templateSource?result_1.push(templateSource):ts.forEachChild(child,visit_1)},sourceFile=this.getSourceFile(fileName);return sourceFile&&(this.context=sourceFile.path||sourceFile.fileName,ts.forEachChild(sourceFile,visit_1)),result_1.length?result_1:void 0}var templateSource=this.getTemplateAt(fileName,0);if(templateSource)return[templateSource]},TypeScriptServiceHost.prototype.getDeclarations=function(fileName){var _this=this,result=[],sourceFile=this.getSourceFile(fileName);if(sourceFile){var visit_2=function(child){var declaration=_this.getDeclarationFromNode(sourceFile,child);declaration?result.push(declaration):ts.forEachChild(child,visit_2)};ts.forEachChild(sourceFile,visit_2)}return result},TypeScriptServiceHost.prototype.getSourceFile=function(fileName){return this.tsService.getProgram().getSourceFile(fileName)},TypeScriptServiceHost.prototype.updateAnalyzedModules=function(){this.validate(),this.modulesOutOfDate&&(this.analyzedModules=null,this._reflector=null,this.templateReferences=null,this.fileToComponent=null,this.ensureAnalyzedModules(),this.modulesOutOfDate=!1)},Object.defineProperty(TypeScriptServiceHost.prototype,"program",{get:function(){return this.tsService.getProgram()},enumerable:!0,configurable:!0}),
436
- Object.defineProperty(TypeScriptServiceHost.prototype,"checker",{get:function(){var checker=this._checker;return checker||(checker=this._checker=this.program.getTypeChecker()),checker},enumerable:!0,configurable:!0}),TypeScriptServiceHost.prototype.validate=function(){var _this=this,program=this.program;if(this.lastProgram!==program){var invalidateFile=function(fileName){return _this._staticSymbolResolver.invalidateFile(fileName)};this.clearCaches();for(var seen_1=new Set,_i=0,_a=this.program.getSourceFiles();_i<_a.length;_i++){var sourceFile=_a[_i],fileName=sourceFile.fileName;seen_1.add(fileName);var version$$1=this.host.getScriptVersion(fileName);version$$1!=this.fileVersions.get(fileName)&&(this.fileVersions.set(fileName,version$$1),this._staticSymbolResolver&&invalidateFile(fileName))}var missing=Array.from(this.fileVersions.keys()).filter(function(f){return!seen_1.has(f)});missing.forEach(function(f){return _this.fileVersions.delete(f)}),this._staticSymbolResolver&&missing.forEach(invalidateFile),this.lastProgram=program}},TypeScriptServiceHost.prototype.clearCaches=function(){this._checker=null,this._typeCache=[],this._resolver=null,this.collectedErrors=null,this.modulesOutOfDate=!0},TypeScriptServiceHost.prototype.ensureTemplateMap=function(){if(!this.fileToComponent||!this.templateReferences){for(var fileToComponent=new Map,templateReference=[],ngModuleSummary=this.getAnalyzedModules(),urlResolver=createOfflineCompileUrlResolver(),_i=0,_a=ngModuleSummary.ngModules;_i<_a.length;_i++)for(var module_1=_a[_i],_b=0,_c=module_1.declaredDirectives;_b<_c.length;_b++){var directive$$1=_c[_b],metadata=this.resolver.getNonNormalizedDirectiveMetadata(directive$$1.reference).metadata;if(metadata.isComponent&&metadata.template&&metadata.template.templateUrl){var templateName=urlResolver.resolve(this.reflector.componentModuleUrl(directive$$1.reference),metadata.template.templateUrl);fileToComponent.set(templateName,directive$$1.reference),templateReference.push(templateName)}}this.fileToComponent=fileToComponent,this.templateReferences=templateReference}},TypeScriptServiceHost.prototype.getSourceFromDeclaration=function(fileName,version$$1,source,span,type,declaration,node,sourceFile){var queryCache=void 0,t=this;if(declaration)return{version:version$$1,source:source,span:span,type:type,get members(){return language_services_10(t.program,t.checker,sourceFile,declaration)},get query(){if(!queryCache){var pipes_1=t.service.getPipesAt(fileName,node.getStart());queryCache=language_services_12(t.program,t.checker,sourceFile,function(){return language_services_11(sourceFile,t.program,t.checker,pipes_1)})}return queryCache}}},TypeScriptServiceHost.prototype.getSourceFromNode=function(fileName,version$$1,node){switch(node.kind){case ts.SyntaxKind.NoSubstitutionTemplateLiteral:case ts.SyntaxKind.StringLiteral:var _a=this.getTemplateClassDeclFromNode(node),declaration=_a[0];_a[1];if(declaration&&declaration.name){var sourceFile=this.getSourceFile(fileName);return this.getSourceFromDeclaration(fileName,version$$1,this.stringOf(node)||"",shrink(spanOf$1(node)),this.reflector.getStaticSymbol(sourceFile.fileName,declaration.name.text),declaration,node,sourceFile)}}},TypeScriptServiceHost.prototype.getSourceFromType=function(fileName,version$$1,type){var result=void 0,declaration=this.getTemplateClassFromStaticSymbol(type);if(declaration){var snapshot=this.host.getScriptSnapshot(fileName);if(snapshot){var source=snapshot.getText(0,snapshot.getLength());result=this.getSourceFromDeclaration(fileName,version$$1,source,{start:0,end:source.length},type,declaration,declaration,declaration.getSourceFile())}}return result},Object.defineProperty(TypeScriptServiceHost.prototype,"reflectorHost",{get:function(){var _this=this,result=this._reflectorHost;if(!result){if(!this.context){var scriptFileNames=this.host.getScriptFileNames();if(0===scriptFileNames.length)throw new Error("Internal error: no script file names found");this.context=scriptFileNames[0]}var source=this.tsService.getProgram().getSourceFile(this.context);if(!source)throw new Error("Internal error: no context could be determined");var tsConfigPath=findTsConfig(source.fileName),basePath=path.dirname(tsConfigPath||this.context),options={basePath:basePath,genDir:basePath},compilerOptions=this.host.getCompilationSettings();compilerOptions&&compilerOptions.baseUrl&&(options.baseUrl=compilerOptions.baseUrl),compilerOptions&&compilerOptions.paths&&(options.paths=compilerOptions.paths),result=this._reflectorHost=new ReflectorHost(function(){return _this.tsService.getProgram()},this.host,options)}return result},enumerable:!0,configurable:!0}),TypeScriptServiceHost.prototype.collectError=function(error,filePath){if(filePath){var errorMap=this.collectedErrors;errorMap&&this.collectedErrors||(errorMap=this.collectedErrors=new Map);var errors=errorMap.get(filePath);errors||(errors=[],this.collectedErrors.set(filePath,errors)),errors.push(error)}},Object.defineProperty(TypeScriptServiceHost.prototype,"staticSymbolResolver",{get:function(){var _this=this,result=this._staticSymbolResolver;return result||(this._summaryResolver=new AotSummaryResolver({loadSummary:function(filePath){return null},isSourceFile:function(sourceFilePath){return!0},toSummaryFileName:function(sourceFilePath){return sourceFilePath},fromSummaryFileName:function(filePath){return filePath}},this._staticSymbolCache),result=this._staticSymbolResolver=new StaticSymbolResolver(this.reflectorHost,this._staticSymbolCache,this._summaryResolver,function(e,filePath){return _this.collectError(e,filePath)})),result},enumerable:!0,configurable:!0}),Object.defineProperty(TypeScriptServiceHost.prototype,"reflector",{get:function(){var _this=this,result=this._reflector;if(!result){var ssr=this.staticSymbolResolver;result=this._reflector=new StaticReflector(this._summaryResolver,ssr,[],[],function(e,filePath){return _this.collectError(e,filePath)})}return result},enumerable:!0,configurable:!0}),TypeScriptServiceHost.prototype.getTemplateClassFromStaticSymbol=function(type){var source=this.getSourceFile(type.filePath);if(source){return ts.forEachChild(source,function(child){if(child.kind===ts.SyntaxKind.ClassDeclaration){var classDeclaration=child;if(null!=classDeclaration.name&&classDeclaration.name.text===type.name)return classDeclaration}})}},TypeScriptServiceHost.prototype.getTemplateClassDeclFromNode=function(currentToken){var parentNode=currentToken.parent;if(!parentNode)return TypeScriptServiceHost.missingTemplate;if(parentNode.kind!==ts.SyntaxKind.PropertyAssignment)return TypeScriptServiceHost.missingTemplate;if("template"!==parentNode.name.text)return TypeScriptServiceHost.missingTemplate;if(!(parentNode=parentNode.parent)||parentNode.kind!==ts.SyntaxKind.ObjectLiteralExpression)return TypeScriptServiceHost.missingTemplate;if(!(parentNode=parentNode.parent)||parentNode.kind!==ts.SyntaxKind.CallExpression)return TypeScriptServiceHost.missingTemplate;var callTarget=parentNode.expression,decorator=parentNode.parent;if(!decorator||decorator.kind!==ts.SyntaxKind.Decorator)return TypeScriptServiceHost.missingTemplate;var declaration=decorator.parent;return declaration&&declaration.kind===ts.SyntaxKind.ClassDeclaration?[declaration,callTarget]:TypeScriptServiceHost.missingTemplate},TypeScriptServiceHost.prototype.getCollectedErrors=function(defaultSpan,sourceFile){var errors=this.collectedErrors&&this.collectedErrors.get(sourceFile.fileName);return errors&&errors.map(function(e){var line=e.line||e.position&&e.position.line,column=e.column||e.position&&e.position.column,span=spanAt(sourceFile,line,column)||defaultSpan;return isFormattedError(e)?errorToDiagnosticWithChain(e,span):{message:e.message,span:span}})||[]},TypeScriptServiceHost.prototype.getDeclarationFromNode=function(sourceFile,node){if(node.kind==ts.SyntaxKind.ClassDeclaration&&node.decorators&&node.name)for(var _i=0,_a=node.decorators;_i<_a.length;_i++){var decorator=_a[_i];if(decorator.expression&&decorator.expression.kind==ts.SyntaxKind.CallExpression){var classDeclaration=node;if(classDeclaration.name){var call=decorator.expression,target=call.expression,type=this.checker.getTypeAtLocation(target);if(type){var staticSymbol=this.reflector.getStaticSymbol(sourceFile.fileName,classDeclaration.name.text);try{if(this.resolver.isDirective(staticSymbol)){var metadata=this.resolver.getNonNormalizedDirectiveMetadata(staticSymbol).metadata,declarationSpan=spanOf$1(target);return{type:staticSymbol,declarationSpan:declarationSpan,metadata:metadata,errors:this.getCollectedErrors(declarationSpan,sourceFile)}}}catch(e){if(e.message){this.collectError(e,sourceFile.fileName);var declarationSpan=spanOf$1(target);return{type:staticSymbol,declarationSpan:declarationSpan,errors:this.getCollectedErrors(declarationSpan,sourceFile)}}}}}}}},TypeScriptServiceHost.prototype.stringOf=function(node){switch(node.kind){case ts.SyntaxKind.NoSubstitutionTemplateLiteral:case ts.SyntaxKind.StringLiteral:return node.text}},TypeScriptServiceHost.prototype.findNode=function(sourceFile,position){function find(node){if(position>=node.getStart()&&position<node.getEnd())return ts.forEachChild(node,find)||node}return find(sourceFile)},TypeScriptServiceHost.missingTemplate=[void 0,void 0],TypeScriptServiceHost}(),projectHostMap=new WeakMap,angularOnlyResults=process.argv.indexOf("--angularOnlyResults")>=0,VERSION=new Version$1("5.2.4");exports.createLanguageService=createLanguageService,exports.TypeScriptServiceHost=TypeScriptServiceHost,exports.createLanguageServiceFromTypescript=createLanguageServiceFromTypescript,exports.VERSION=VERSION,exports.getExternalFiles=getExternalFiles,exports.create=create,Object.defineProperty(exports,"__esModule",{value:!0})});
436
+ Object.defineProperty(TypeScriptServiceHost.prototype,"checker",{get:function(){var checker=this._checker;return checker||(checker=this._checker=this.program.getTypeChecker()),checker},enumerable:!0,configurable:!0}),TypeScriptServiceHost.prototype.validate=function(){var _this=this,program=this.program;if(this.lastProgram!==program){var invalidateFile=function(fileName){return _this._staticSymbolResolver.invalidateFile(fileName)};this.clearCaches();for(var seen_1=new Set,_i=0,_a=this.program.getSourceFiles();_i<_a.length;_i++){var sourceFile=_a[_i],fileName=sourceFile.fileName;seen_1.add(fileName);var version$$1=this.host.getScriptVersion(fileName);version$$1!=this.fileVersions.get(fileName)&&(this.fileVersions.set(fileName,version$$1),this._staticSymbolResolver&&invalidateFile(fileName))}var missing=Array.from(this.fileVersions.keys()).filter(function(f){return!seen_1.has(f)});missing.forEach(function(f){return _this.fileVersions.delete(f)}),this._staticSymbolResolver&&missing.forEach(invalidateFile),this.lastProgram=program}},TypeScriptServiceHost.prototype.clearCaches=function(){this._checker=null,this._typeCache=[],this._resolver=null,this.collectedErrors=null,this.modulesOutOfDate=!0},TypeScriptServiceHost.prototype.ensureTemplateMap=function(){if(!this.fileToComponent||!this.templateReferences){for(var fileToComponent=new Map,templateReference=[],ngModuleSummary=this.getAnalyzedModules(),urlResolver=createOfflineCompileUrlResolver(),_i=0,_a=ngModuleSummary.ngModules;_i<_a.length;_i++)for(var module_1=_a[_i],_b=0,_c=module_1.declaredDirectives;_b<_c.length;_b++){var directive$$1=_c[_b],metadata=this.resolver.getNonNormalizedDirectiveMetadata(directive$$1.reference).metadata;if(metadata.isComponent&&metadata.template&&metadata.template.templateUrl){var templateName=urlResolver.resolve(this.reflector.componentModuleUrl(directive$$1.reference),metadata.template.templateUrl);fileToComponent.set(templateName,directive$$1.reference),templateReference.push(templateName)}}this.fileToComponent=fileToComponent,this.templateReferences=templateReference}},TypeScriptServiceHost.prototype.getSourceFromDeclaration=function(fileName,version$$1,source,span,type,declaration,node,sourceFile){var queryCache=void 0,t=this;if(declaration)return{version:version$$1,source:source,span:span,type:type,get members(){return language_services_10(t.program,t.checker,sourceFile,declaration)},get query(){if(!queryCache){var pipes_1=t.service.getPipesAt(fileName,node.getStart());queryCache=language_services_12(t.program,t.checker,sourceFile,function(){return language_services_11(sourceFile,t.program,t.checker,pipes_1)})}return queryCache}}},TypeScriptServiceHost.prototype.getSourceFromNode=function(fileName,version$$1,node){switch(node.kind){case ts.SyntaxKind.NoSubstitutionTemplateLiteral:case ts.SyntaxKind.StringLiteral:var _a=this.getTemplateClassDeclFromNode(node),declaration=_a[0];_a[1];if(declaration&&declaration.name){var sourceFile=this.getSourceFile(fileName);return this.getSourceFromDeclaration(fileName,version$$1,this.stringOf(node)||"",shrink(spanOf$1(node)),this.reflector.getStaticSymbol(sourceFile.fileName,declaration.name.text),declaration,node,sourceFile)}}},TypeScriptServiceHost.prototype.getSourceFromType=function(fileName,version$$1,type){var result=void 0,declaration=this.getTemplateClassFromStaticSymbol(type);if(declaration){var snapshot=this.host.getScriptSnapshot(fileName);if(snapshot){var source=snapshot.getText(0,snapshot.getLength());result=this.getSourceFromDeclaration(fileName,version$$1,source,{start:0,end:source.length},type,declaration,declaration,declaration.getSourceFile())}}return result},Object.defineProperty(TypeScriptServiceHost.prototype,"reflectorHost",{get:function(){var _this=this,result=this._reflectorHost;if(!result){if(!this.context){var scriptFileNames=this.host.getScriptFileNames();if(0===scriptFileNames.length)throw new Error("Internal error: no script file names found");this.context=scriptFileNames[0]}var source=this.tsService.getProgram().getSourceFile(this.context);if(!source)throw new Error("Internal error: no context could be determined");var tsConfigPath=findTsConfig(source.fileName),basePath=path.dirname(tsConfigPath||this.context),options={basePath:basePath,genDir:basePath},compilerOptions=this.host.getCompilationSettings();compilerOptions&&compilerOptions.baseUrl&&(options.baseUrl=compilerOptions.baseUrl),compilerOptions&&compilerOptions.paths&&(options.paths=compilerOptions.paths),result=this._reflectorHost=new ReflectorHost(function(){return _this.tsService.getProgram()},this.host,options)}return result},enumerable:!0,configurable:!0}),TypeScriptServiceHost.prototype.collectError=function(error,filePath){if(filePath){var errorMap=this.collectedErrors;errorMap&&this.collectedErrors||(errorMap=this.collectedErrors=new Map);var errors=errorMap.get(filePath);errors||(errors=[],this.collectedErrors.set(filePath,errors)),errors.push(error)}},Object.defineProperty(TypeScriptServiceHost.prototype,"staticSymbolResolver",{get:function(){var _this=this,result=this._staticSymbolResolver;return result||(this._summaryResolver=new AotSummaryResolver({loadSummary:function(filePath){return null},isSourceFile:function(sourceFilePath){return!0},toSummaryFileName:function(sourceFilePath){return sourceFilePath},fromSummaryFileName:function(filePath){return filePath}},this._staticSymbolCache),result=this._staticSymbolResolver=new StaticSymbolResolver(this.reflectorHost,this._staticSymbolCache,this._summaryResolver,function(e,filePath){return _this.collectError(e,filePath)})),result},enumerable:!0,configurable:!0}),Object.defineProperty(TypeScriptServiceHost.prototype,"reflector",{get:function(){var _this=this,result=this._reflector;if(!result){var ssr=this.staticSymbolResolver;result=this._reflector=new StaticReflector(this._summaryResolver,ssr,[],[],function(e,filePath){return _this.collectError(e,filePath)})}return result},enumerable:!0,configurable:!0}),TypeScriptServiceHost.prototype.getTemplateClassFromStaticSymbol=function(type){var source=this.getSourceFile(type.filePath);if(source){return ts.forEachChild(source,function(child){if(child.kind===ts.SyntaxKind.ClassDeclaration){var classDeclaration=child;if(null!=classDeclaration.name&&classDeclaration.name.text===type.name)return classDeclaration}})}},TypeScriptServiceHost.prototype.getTemplateClassDeclFromNode=function(currentToken){var parentNode=currentToken.parent;if(!parentNode)return TypeScriptServiceHost.missingTemplate;if(parentNode.kind!==ts.SyntaxKind.PropertyAssignment)return TypeScriptServiceHost.missingTemplate;if("template"!==parentNode.name.text)return TypeScriptServiceHost.missingTemplate;if(!(parentNode=parentNode.parent)||parentNode.kind!==ts.SyntaxKind.ObjectLiteralExpression)return TypeScriptServiceHost.missingTemplate;if(!(parentNode=parentNode.parent)||parentNode.kind!==ts.SyntaxKind.CallExpression)return TypeScriptServiceHost.missingTemplate;var callTarget=parentNode.expression,decorator=parentNode.parent;if(!decorator||decorator.kind!==ts.SyntaxKind.Decorator)return TypeScriptServiceHost.missingTemplate;var declaration=decorator.parent;return declaration&&declaration.kind===ts.SyntaxKind.ClassDeclaration?[declaration,callTarget]:TypeScriptServiceHost.missingTemplate},TypeScriptServiceHost.prototype.getCollectedErrors=function(defaultSpan,sourceFile){var errors=this.collectedErrors&&this.collectedErrors.get(sourceFile.fileName);return errors&&errors.map(function(e){var line=e.line||e.position&&e.position.line,column=e.column||e.position&&e.position.column,span=spanAt(sourceFile,line,column)||defaultSpan;return isFormattedError(e)?errorToDiagnosticWithChain(e,span):{message:e.message,span:span}})||[]},TypeScriptServiceHost.prototype.getDeclarationFromNode=function(sourceFile,node){if(node.kind==ts.SyntaxKind.ClassDeclaration&&node.decorators&&node.name)for(var _i=0,_a=node.decorators;_i<_a.length;_i++){var decorator=_a[_i];if(decorator.expression&&decorator.expression.kind==ts.SyntaxKind.CallExpression){var classDeclaration=node;if(classDeclaration.name){var call=decorator.expression,target=call.expression,type=this.checker.getTypeAtLocation(target);if(type){var staticSymbol=this.reflector.getStaticSymbol(sourceFile.fileName,classDeclaration.name.text);try{if(this.resolver.isDirective(staticSymbol)){var metadata=this.resolver.getNonNormalizedDirectiveMetadata(staticSymbol).metadata,declarationSpan=spanOf$1(target);return{type:staticSymbol,declarationSpan:declarationSpan,metadata:metadata,errors:this.getCollectedErrors(declarationSpan,sourceFile)}}}catch(e){if(e.message){this.collectError(e,sourceFile.fileName);var declarationSpan=spanOf$1(target);return{type:staticSymbol,declarationSpan:declarationSpan,errors:this.getCollectedErrors(declarationSpan,sourceFile)}}}}}}}},TypeScriptServiceHost.prototype.stringOf=function(node){switch(node.kind){case ts.SyntaxKind.NoSubstitutionTemplateLiteral:case ts.SyntaxKind.StringLiteral:return node.text}},TypeScriptServiceHost.prototype.findNode=function(sourceFile,position){function find(node){if(position>=node.getStart()&&position<node.getEnd())return ts.forEachChild(node,find)||node}return find(sourceFile)},TypeScriptServiceHost.missingTemplate=[void 0,void 0],TypeScriptServiceHost}(),projectHostMap=new WeakMap,angularOnlyResults=process.argv.indexOf("--angularOnlyResults")>=0,VERSION=new Version$1("5.2.8");exports.createLanguageService=createLanguageService,exports.TypeScriptServiceHost=TypeScriptServiceHost,exports.createLanguageServiceFromTypescript=createLanguageServiceFromTypescript,exports.VERSION=VERSION,exports.getExternalFiles=getExternalFiles,exports.create=create,Object.defineProperty(exports,"__esModule",{value:!0})});
437
437
  //# sourceMappingURL=language-service.umd.min.js.map